Repository navigation
#91 stage 4, H4-0: the meaning of the buffer, share, and replace primitives over the model, kernel-checked (SP-28) - #265
Conversation
…ver the model: register row, SPEC.md 31 row, scenario, and the failing named test
…the model is kernel-checked: RustPrims, its case, six planted defects
|
Maintainer review of 30389f7 (read-only; Round
Nits (same push)
For H4a's first commit, so the refinement is over the declared semantics and not the model alone: per new Machine constructor, the lifting theorem ( I re-verify the round by reading the diff. Generated by Claude Code |
…s' into claude/issue-91-stage4-heap-prims # Conflicts: # CONFORMANCE.md # SPEC.md
…the erased meanings are the calculus primitives, definitions worded as such, the growth declared, the section column
|
Maintainer: the round at 6a1416a is accepted (read-only re-verification; Wording to ride H4a's first commit on this branch (no theorem, plant or gate changes): "(by definition)" after #262 at 6af4ebd and #264 at e307369 carry only the asked wording and column changes and stay accepted. Lands after #254, #255, #259, #262 and #264 with its own regeneration. Generated by Claude Code |
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
…med row type, as clippy's type_complexity lint requires Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
… register 454 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
…30-slice-4 The line gained #265 (SP-28, register 454); conflicts were the register count only (README.md, SPEC.md section 31 total, cases/repository.rs, xtask/src/spec_links.rs). The register is 457: the line plus this branch's three rows; CHANGELOG states it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Stacked on #264 (
claude/issue-91-stage4-heap-listsate307369f6); draft. H4-0, ahead of H4a, as the maintainer asked on #91.What
RustPrims(compiler/src/RustPrims.lex.tex, language 1.2, onRustMemory,RustListsand the calculus's values; one structure and twelve definitions) states what the runtime's buffer, clone, and replace primitives are, for the semantics that reads aVec/Rcas the value it holds. 21 theorems, all[propext]except the reflexivities (clone_readsand the four primitive laws), no definition observing an axiom.erasedPushisprim appendof the list and the one item,erasedLengthisprim length;prim_append_nil,prim_append_cons,prim_length_nil,prim_length_consstate them on a list (reflexivity), andfirst_of_snoc/length_of_itemsare stated with them.erasedTruncatekeeps a prefix.readBuf).bufNewisVec::with_capacity(the slots of a capacity, none in use):new_reads.pushGrowis the push ofRustMemoryafter a growth when full (push_reads, built fromfirst_of_front,first_of_snoc,append_nothing,less_than_itself,put_into_blank);truncate_reads,first_of_take;length_reads,length_of_items. A valid buffer isappend front backwith lengthsize front. The model grows bylen + 1slots (at least doubling a full buffer); the runtime'sVecdoubles, and the capacity it reaches is the differential's, declared in SPEC §17.17.share_copy).cloneHandleis thecloneof a list's bufferRc:clone_reads,clone_holds,clone_blocks.share_copyof the shipped library table isRc::fromof a slice or text and is given no meaning here (H4b, withStr/Bytes).share_uniqueisaloneOn(alone_without_others,holder_blocksof #91 stage 4, H3b: the abstraction theorems of the list representation, kernel-checked (SP-27) #264);share_releaseis the release of #91 stage 4, H3b: the abstraction theorems of the list representation, kernel-checked (SP-27) #264.replaceHandle:replace_old_reads,replace_now_reads.clone_reads,clone_holds,alone_without_others,replace_old_reads,replace_now_readsrestate definitions (an identity, projections) and are worded and checked as that and no more.Proofs use the prior theorems (this module's and the imported ones:
push_with_room,room_after_growth,holder_blocks, ...) assimplifyrules.Not in this PR, and why
The claim is the model's. That the declared semantics gives the primitives these readings is the opening of H4a's first function (
length_list): per the maintainer's answer on #91, each list item is one machine call whose meaning is the existingTargetSyntax.Prim, withrefines_of the core shape, and the buffer/clone/replace constructors go where support code is authored (the RuntimeSyntax second module). That the runtime'sVec,Rcandmem::replacebehave as the model is the evidence of the differential and of rustc.SP-28 (
build) and the measured figurecargo test -p repo-conformance --test conformance -- conformance_sp_28, in its own part ofbdd(preservation-prims, rowbdd-preservation-prims), 4-core 15 GB container, pinned Lean 4.32.1, nothing else running: 120.9 s wall (module + seven planted modules), peak resident set of the pinned Lean 750,180 KiB (0.75 GB), sampled every three seconds, oneleanat a time;lexlean verifyof the module alone 24.4 s (debug binary). The figure first posted on #91 (62.6 s, 0.34 GB, 15.1 s) was for the 17-theorem version; the four primitive reflexivity lemmas and theprim append/prim lengthforms infirst_of_snoc,length_of_itemsandpush_readsaccount for the growth. Plants, each asserted by the theorems Lean refuses and the goal it leaves: a push that puts the item in front, a full buffer that is not grown (push_reads), a truncation that keeps one too many (truncate_reads), a clone that does not hold (clone_reads,clone_holds,clone_blocks), a replace that returns the new value, a length that counts one more (length_reads), a new buffer that is not empty (new_reads); plus the listing refusals.Identity
New module in the compiler project.
compiler/srcis not in the embedded set the compiler-semantics ID hashes andcompiler/expectedcovers onlyMain's closure, so no ID moves, no record regenerates, no relock is owed. Register 450,SP-28in §31 (section §17.17) and the totals.🤖 Generated with Claude Code
https://claude.ai/code/session_018vK7Tm6xHF5etAwKM6r9HG