Skip to content

Deliver child output through the physical continuation boundary - #5368

Merged
Mister-Meeseeks merged 4 commits into
CrocSwap:mainfrom
aliromman:codex/five-harder-20261023-r3
Oct 24, 2026
Merged

Mister-Meeseeks merged 4 commits into
CrocSwap:mainfrom
aliromman:codex/five-harder-20261023-r3

Conversation

@aliromman

@aliromman aliromman commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

This closes the designated output-return boundary left by PR #5329 and PR #5356. One reusable relay tape preserves a binary child result through child cleanup and physical pop, installs it in a reserved empty parent role, and returns empty. All other parent payloads, heads, presence bits and descriptors return exactly. Nineteen tapes suffice for every finite properly nested successful call tree.

The proof and exact invoice, return routine, receipt and source pins define the scope. The complete matched push/return bill is 13Hp+4Sp+38k+18d+5q+2A+2Hc+5W+17L+61 reads, writes and unit moves. The variables and input ABI are defined in the proof. This includes both output copies, all child cleanup, physical frame cleanup, descriptor return and relay cleanup. It excludes child computation and input/descriptor production. It has no ancestor-length or depth factor. Relay backing and the parent output are charged explicitly.

The complete kappa calculation is unchanged. The parent must reserve an occupied empty output role. The byte-exact retained stack is from pending PR #5356 and remains an explicit predecessor premise. This does not implement packet reorder, recursive C, source counter/slot compilation, production descriptor delivery, complete supplier stock/precision or outer recovery. The actual-source calibration retains its Python allocation facade. Failed ABI calls need not restore partially changed state.

Validation on CPython 3.12.13, standard library only:

python3.12 -B scripts/research_package.py --package research/continuation-output-return
python3.12 -B scripts/check_research_commit.py --package research/continuation-output-return

Both registered isolated, warning-strict normal and optimized commands pass PASS_CONTINUATION_OUTPUT_RETURN. There are 1800 exact invoice cases, twelve nested cases through depth 31, six unchanged compact-source cases in both layouts, and six rejecting ABI controls. The source returns deliver all 1024 bits of an independently checked 128-record permutation. Each return costs 24388 tape actions at ancestor lengths 16,257,4096. Four disposable code mutations reject in both modes before receipt comparison. Committed-byte checks, official export integrity and both read-only Git-free export commands pass; all 16 exported files remain unchanged.

Base is canonical main 7c472563474e60185e6ca101a17622133d047e56, priority 7, refreshed before submission. Base-source ancestry is on main. Replay pins bind the byte-exact vendored copies in this PR history; upstream_pin retains each original pending source. Clean checkout replay does not require that unmerged commit. The pending stack theorem remains an explicit premise, not an accepted result. The full-history wrapper, selected cold replay, full production rectangle, native compiler, Lean and Docker were not run. Hosted CI and independent human/proof-kernel acceptance remain separate.

Overlap includes the live continuation Discussion, targeted all-state output-return PR search, refreshed public PR/Discussion bodies and a supplementary canonical-main README search. The sparse checkout does not contain all notes; arbitrary historical diffs and unpublished work remain unsearched. This PR adds only this package. The live stack scope was already complete, so the contribution takes its separate output-delivery handoff.

Credit @aliromman for the retained physical stack; @JoyboyBrian for the segment refinement and PR #5041 locality invoice; @jmbarrancoml for the sequential compact primitives in PR #2250; Douglas Colkitt for guard/repair; Cinna Davis for the caller; and @Matarener for cover/stock work. Their retained roles and notices are in the pinned source package. New work: Ali Romman with substantial OpenAI Codex assistance in proof, implementation, review and verification. Apache-2.0.

@jwr404

jwr404 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Independent review (James Reed, with Claude Code). Head 1362d9350b733af1c8a8822e0a013c1ff7de64dc.

Verdict: correct. Output delivery, exact parent restoration and the complete bill hold under an independent randomized nested harness.

Checks

Harness

I used your return_output and the vendored stack; the driver and expectations are my own. Over 250 top-level scenarios:

  • Parents. 16 roles at 80% presence, arbitrary ancestor prefixes (including stray LEFT), random parent words and heads, and a reserved empty present output role chosen at random.
  • Children. Each child writes arbitrary binary work on all present roles and a child descriptor. With probability 0.5 it makes a properly nested inner call that returns its output into a reserved child role, up to depth 4, all sharing one relay tape.
  • Return. The child slot is picked at random and may equal the parent slot's index.
  • Checks per call.
    1. The reserved parent role holds exactly the child's output, with its head at 0.
    2. Every other payload, the control, the descriptor and the relay match their pre-push snapshots exactly. The relay is empty at its origin again.
    3. The measured push and return_output actions, excluding child work, equal the exact formula.

Result: 910 checks (455 calls, outer and nested), 0 failures.

The registered replay passes locally. The scope (a reserved empty parent role, #5356 as a pending predecessor premise, no packet reorder or recursive C) is stated accurately. If #5364 rather than #5356 becomes the canonical stack, this boundary would need re-pricing against #5364's ABI, where pop itself erases child bodies.

@Mister-Meeseeks
Mister-Meeseeks merged commit e36f783 into CrocSwap:main Oct 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants