Repository navigation
#91 stage 4, H3a: the memory model of a runtime buffer, kernel-checked (SP-26) - #262
Conversation
…d 31 row, scenario, and the failing named test
…ecked: RustMemory, its case, four planted defects
|
Maintainer review of e7adb12 (read-only; Round
Nits (same push)
I will re-verify the round by reading the diff. Generated by Claude Code |
…date' into claude/issue-91-stage4-heap-memory
|
Maintainer, amending item 3 of the round: keep Generated by Claude Code |
…ed definitions, prune term_cases, and tighten plant assertions
|
Maintainer: re-verification of the round at 36704c3 (read-only;
Two small things to carry in the same push:
Whoever pushes (the author session or the owner), one push; I re-verify by reading. Generated by Claude Code |
…ates some, put_in_slot, pushResult removed, subWindow count bounded, a Buf plant
…RMANCE regenerated
|
Maintainer: re-verification of 87a4985 (read-only;
After that the PR is accepted and waits for its landing after #254 and #255. Generated by Claude Code |
…uncate, the holds converse, the allocation of capacity sixteen, uncons as the noun; #262's window_count merged
|
Maintainer: c353d25 is accepted (read-only re-verification; Lands after #254 and #255 with its own regeneration. Generated by Claude Code |
# Conflicts: # CHANGELOG.md # README.md # SPEC.md # crates/conformance/src/cases/repository.rs # xtask/src/spec_links.rs
…26, as the merge dropped Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
…y model's root set; the compiler-semantics identity does not move Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
…date' into landing-262 # Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
Stacked on #259 (
claude/issue-91-stage4-heap-validateateda82e1ad, merged in); draft. First of the two memory PRs of the heap half (H3a of H3a/H3b; the list representation and its abstraction theorems are H3b).What
RustMemory(compiler/src/RustMemory.lex.tex, a language-1.2 module of the compiler project over the calculus's values; two inductivesFlagandCells, two structuresBufandWindow, and sixteen definitions) models a runtime buffer (Buf) as index-addressed slots (Cells), whose number is the capacity, and a length, and a slice (Window) as base slots, an offset, and a count (subWindowtaking a window of a window, its count bounded by what the parent has left after the skip,minusNat). Seventeen theorems, each kernel-checked with[propext], no definition observing an axiom:size_put: a write never changes the number of slots (putbeyond the slots is a no-op in the model and is not the runtime's behaviour, which refuses).get_put_same,get_put_below,get_put_above: a write is read back at its own index (nonewhen no slot), and every slot below and above it is as it was.size_blank,get_blank: a new buffer has the capacity it was asked for, each slot the fill.no_room_at_capacity,room_before_slot,push_lands_in_slot,put_in_slot: the push guardlessThan len (size slots)isnoat capacity andyesbefore a slot, andputat the length writes the slot.push_at_capacity,push_with_room: stated directly. A push at capacity isnoneand writes nothing; a push with a slot at its length issomeof the buffer with the item in that slot and the length one more. Both are closed by simplifying with the prior theorems above as rewrite rules (pushResultis gone).below_truncated,get_truncated: a truncated length (bufTruncate) admits the indices below both lengths inbufGet.plus_assoc,window_of_window,window_count: a window of a window adds its offsets, and its count isminNat keep (minusNat count skip).Every statement is total because the proof language has no hypothesis to assume (a prior theorem can be a rewrite rule, a premise cannot): facts about an index below a length are stated for a sum with a gap, or as a guard's result (
guardGet,lessThan,both). The claim is the model's; that the runtime'sVecbehaves as the model, and growth by reallocation (the declared effectallocation), are the differential's and rustc's evidence and are not claimed here (growth is modelled in H3b).SP-26 (
build)Command and host:
cargo test -p repo-conformance --test conformance -- conformance_sp_26, 4-core 15 GB container, pinned Lean 4.32.1: 43.9 s wall with the accepted module and five planted modules. The case lists the 17 laws itself (not read from the module) and requires each theorem to state the functions of its law; plants: a write that lands elsewhere (⊢ some head = some item), a write that drops a slot (⊢ size tail = size tail + 1), a reversed order of indices (⊢ some item = none), a truncation that keeps one too many (⊢ lessThan lower (minNat less oldLess + 1)), a push that adds two to the length (len := size front + 1 + 1, inpush_with_room), a theorem renamed, a law without a theorem, a theorem about another function.Calibration for H3b (cost)
The plan estimated 15 to 40 minutes of Lean per module family and called the first theorem the proof risk. Measured: seconds per module. What costs is the shape of the statements: a hypothesis cannot be assumed, so a fact about a valid state is stated as a guard or a gap, and unused
simplifyarguments are verification errors (the lists were pruned mechanically).Identity
compiler/srcis not in the embedded set the compiler-semantics ID hashes andcompiler/expectedcovers onlyMain's closure, so this PR moves no ID and owes no relock or record. Register 448,SP-26in the §31 table and the totals (xtaskspec_links,repository.rs, README, SPEC).Generated by Claude Code