Repository navigation
Add delimited continuation primitive with a complete local tape bill - #5364
Mister-Meeseeks merged 2 commits into
Conversation
Prove and replay sequential restoration of sixteen payload heads, role occupancy and an opaque descriptor with a complete linear tape-action invoice. Preserve the PR5329 source and keep logical handle compilation, recursive C and child-output delivery explicit. Prepared with substantial OpenAI Codex assistance; predecessor attribution is retained in the package.
|
Independent review (James Reed, with Claude Code). Head Verdict: the primitive restores exactly, and the exact action formulas hold, under an independent randomized nested harness. There is a duplicate-work note for maintainers at the end. Proof check
Independent harnessI imported only
Result: 1,286 checks, 0 failures. The contract that absent child roles be empty is enforced by The registered replay passes locally ( Overlap note for maintainers#5356 (aliromman, "Implement a local continuation stack with exact linear cost", opened six minutes earlier) addresses the same PR5329 saved-frame-oracle question. It uses a delimited control tape restoring the sixteen payload heads, presence bits and descriptors, in an eighteen-tape, seven-symbol construction. This PR uses nineteen tapes and nine symbols, with unary parked distances. The two look like independent solutions to one handoff. A maintainer may want to pick one as canonical, or keep both with a cross-reference comparing constants and tape counts. |
Change and mathematical scope
PR5329's local tape boundary uses a Python frame stack to recover origins, parent objects and descriptor lengths. This adds an isolated constructive primitive and written all-size proof: a delimited control tape restores sixteen parent payload heads, their bytes, the role mask and an opaque binary descriptor by sequential reads, writes and unit moves.
The changed encoding records each head-to-end distance in unary while parking that head. Nineteen fixed tapes and a nine-symbol alphabet suffice at every finite nesting depth. For descriptor length d, total return distance H and child payload-plus-descriptor length W, the complete matched boundary costs at most 24d + 12H + 576 + 8W tape actions, including child cleanup. The live frame is exactly d + H + 35 symbols. Sharper exact action formulas and the nesting induction are in PROOF.md.
This completes the stated primitive, not the full source caller. The retained-source calibration still uses Python logical sizes and weak-reference handle allocation. Recursive C, actual child-output delivery, production dispatch/recipe semantics, complete caller space/stock/precision and supplier admission remain open. No paid-profile or kappa improvement is claimed. Only eight files in
research/segment-continuation-stack/are added.Task and overlap
7c472563474e60185e6ca101a17622133d047e56, priority revision 7. The pre-submission fetch retained that head and unchanged guidance/inputs.uniform-transfer-audit, refined to the local continuation primitive requested by the released physical-local-continuation handoff. Canonical claim.08456995d5e520a4f9e0501c9b2ea9b03dbae87a, retained unchanged on main. PR5041 supplies the locality motivation. The central ledger marks both predecessors partially reviewed.Validation
CPython 3.12.0, 64-bit Windows 11; standard library only.
All pass locally. Evidence:
compact.executecalibrations on complete reduced 128-record rectangles, both field orders, two nested levels and all sixteen enclosing roles. Each inner boundary costs exactly 16,672 actions, including cleanup, at every ancestor length.a032168509338cbe5b5213acbdef81719e33b0a9; final headfd74da128f0e5ab702a8fe7b2b00e1a316bb22adonly adds validation prose and clarifies a fixture sentence. Final committed-byte and export checks pass.The all-size claim rests on the written proof; these finite checks corroborate it. No selected cold replay, full selected-source closure, Lean/Docker build, independent human review or formal-kernel acceptance is claimed. Full source-history preflight was unavailable in the shallow checkout. Hosted CI is separate from these local results.
Credit
JoyboyBrian: PR5329 segment refinement and handoff, PR5041 locality invoice and fixed-bank recursive-row precedent. Jose Manuel/jmbarrancoml: PR2250 sequential compact/monomial source. Douglas Colkitt: compact identity, guard and repair construction. Cinna Davis: #4100/#4088 framework. Matarener: cover/stock work. Sagar Thakrar: PR3385 parent-return audit. The fixed-bank precedent credits commdata2338 and retained Lean push/pop authors. Full source notices and the carry/guard/native lineage remain pinned and unchanged.
Prepared by Mihir Srivastava (
mihir-s-05) with substantial OpenAI Codex assistance. Apache-2.0. Author-checked evidence awaiting independent review.Open next questions
Bind one
repair/stable_radixmaximum-live cut and nested call to explicit source counter/slot operations, replacing the calibration facade. Separately, name and price one actual child-output transfer before destructive pop. Those are prerequisites for composing the complete production caller invoice; the primitive alone does not justify another construction search. README.md and TASK.json give concrete first steps and blockers.