Skip to content

Compress continuation frames from 65,571 to 243 symbols (no new κ) - #6020

Merged
Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
petalas:research/w11-1022ah-binary-distance-continuations
Oct 28, 2026
Merged

Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
petalas:research/w11-1022ah-binary-distance-continuations

Conversation

@petalas

@petalas petalas commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Scoped constructive proof with exact finite corroboration: replace unary head-return distances in Mihir Srivastava's PR #5364 local continuation contract with binary counters, using the same nineteen tapes and nine symbols.

- control frame = d + 35 + sum_i H_i
+ control frame = d + 35 + sum_i bitlength(H_i)

For sixteen distances of 4096 and an empty descriptor, the executed frame shrinks 65,571 → 243 symbols, saving 65,328. The new code preserves all parent bytes, physical heads, role flags, opaque descriptor and older control state, supports every finite properly nested successful call tree, and pays for child/scratch erasure. It reuses the reverse-scratch tape for counters. The first verified reduction is the complete scope of this contribution.

PROOF.md derives the exact matched tape-action bill
22d + 24H - 10P + 22L + 613 + 2G + 5W,
bounded by 22d + 46H + 613 + 7W. H sums head-to-end distances, P their popcounts, L their bit lengths, W the seventeen child-word lengths and G their return offsets. This exchanges a larger linear action constant for smaller continuation headers.

New construction, proof and checker produced by Nick Petalas. Credit Mihir Srivastava for #5364's contract, descriptor/cleanup recipe and unit-action simulator; Ali Romman for #5356/#5368's related stack/output constructions; zxv for #5404's historical-backing theorem; and the retained JoyboyBrian, Jose Manuel, Douglas Colkitt, Cinna Davis, Matarener and Sagar Thakrar lineage. Binary-counter amortization is classical. The contribution is this complete contract refinement and exact space/action tradeoff, not a claim to invent binary counters.

Evidence

  • Before: Add delimited continuation primitive with a complete local tape bill #5364's cited frame formula is d+35+H. Its theorem is a premise, not a re-audited deliverable.
  • After: the new verifier emits the exact binary grammar and checks complete nineteen-tape restoration, scratch erasure and exact read/write/unit-move invoices. It discards the push controller before constructing the return controller.
  • All 4,816 small matched boundaries, 36 power-of-two boundary cases, 117 nested returns and the sixteen-role 4096 illustration pass. Four controls reject a damaged top delimiter, omitted increment, omitted decrement and absent nonempty role.
  • Warning-strict normal and optimized CPython 3.12.15 checks pass locally in 1.251 s and 1.307 s. These are timeout checks, not speedup measurements. The registered wrapper passes both full commands in 2.788 s, well inside each 120 s command limit.
  • Metadata/source pins, syntax/AST checks, committed bytes, executable modes and declared source history pass. Every new function is under sixty lines. No external linter/type checker was available.
  • The generated receipt binds implementation, verifier and proof hashes. No predecessor verifier/census, unrelated historical suite or selected scientific cold replay was run.

Exact reproduction from the repository root:

/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/binary-distance-continuations
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/binary-distance-continuations/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -O -W error -B research/binary-distance-continuations/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/binary-distance-continuations --check-source-history --check-modes

Any CPython 3.12 executable can replace the local absolute path. Expected markers: PASS_BINARY_DISTANCE_CONTINUATIONS, PASS_REGISTERED_RESEARCH_PACKAGE, PASS_RESEARCH_COMMIT_BYTES. Local platform: macOS 27.0.1 arm64.

Limitations and unrun obligations

This is an informal all-size proof for the declared local segment ABI, supported by finite exact tests. It is not a complete multiplication theorem or a new kappa. The selected record and every predecessor file remain unchanged.

The caller supplies well-formed contiguous binary segments, separate tapes, local markers and successful proper nesting. Intended child output must be delivered before destructive pop. Failed or malformed calls need not restore state. Scratch backing includes its marker and terminal blank; erased cells remain allocated in historical extent accounting.

Actual production dispatch, descriptor production, designated output installation, complete payload/high-water backing, caller allocation/stock and full invoice integration remain open. No flat finite-state transition table, formal proof-kernel run, Lean, Docker or selected cold replay is supplied. Neither precision_tape nor owned_erasure is discharged at its complete selected caller. Independent human and formal proof-kernel review are unclaimed.

Open next questions

Can an actual selected recursive caller use this binary frame with a smaller complete historical tape reserve? First bind one real continuation boundary and a complete nested execution to the changed grammar, counting every tape's high-water extent. Production descriptor/dispatch semantics, output delivery, allocation and stock are the blockers. No follow-on implementation is reserved.

Related open work

Targeted live continuation searches, main README searches, merged searches and current handoffs found no open PR implementing this binary-distance refinement. Unpublished work and arbitrary historical code diffs remain coverage limits. Advance CLAIM. Canonical base remains 19fdb086ea96af9a9f87936a2b888e10af4ed810, priorities revision 8.

Completion refresh inspected this account's fourteen other open PRs created since the advance CLAIM: #6014, #6015, #6016, #6017, #6018, #6019, #6021, #6022, #6023, #6024, #6025, #6026, #6027 and #6028. None computes this binary head-distance continuation-frame quantity. Adjacent physical-storage and routing work is distinguished explicitly:

  • #6018 reuses a 52-role CRT ROM bank across retired row queries. This package compresses suspension-frame distances; the backing objects and numerical quantities differ.
  • #6024 removes endpoint reversals from a physical convolution caller. This package changes continuation encoding and supplies no transform/permutation-routing count.
  • #6028 reduces XOR-routing tape travel while restoring one dirty scratch record. This package reduces local control-frame storage while accepting a larger linear action constant; it computes no shared routing quantity.

No extra computations were run to check those contributions, and no conflicting shared numerical value was identified.

CI notes

Both hosted checks passed at exact head 20ff91f09f67b1ab8b496ca1f80a4e6e7cb19cd2: plan and replay (research/binary-distance-continuations), in run 40592126228. The completed check list was read once; the successful run records that same head. The hosted replay runs both registered modes. All local checks above passed as well. This certifies the bounded automated checks, not independent acceptance of the written all-size proof or the open caller obligations.

Merge Danger

Door: two-way.

Blast Radius: isolated.

Only research/binary-distance-continuations/ and its opted-in replay are added. No shared code, frozen evidence, predecessor notices or selected frontier changes.

@Mister-Meeseeks
Mister-Meeseeks merged commit e30cc1a into CrocSwap:main Oct 28, 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.

2 participants