Skip to content

Reduce XOR tape travel by at least N-2 crossings (no new κ) - #6028

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/w16-1022ah-helper-obstruction
Oct 28, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/w16-1022ah-helper-obstruction

Conversation

@petalas

@petalas petalas commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A nested scratch-swap schedule reduces the in-place XOR correction of Dugongue / David Ganz's #3879 by at least N-2 record crossings, or (N-2)(B+2) unit transitions, for every nonzero mask on N=2^h >= 4 equal-width B-bit records. It restores the same arbitrary dirty scratch record and both heads, with the same 3N/2 record swaps and no additional tape or scratch cells.

- H_serial = (N-2)m + 2N-2
+ H_nested = Nm + 2(N/(2m)-1)(l+1)

Here delta=m+l, m is its highest power of two, and 0<=l<m. The exact transition count is (3N/2)(2B+3)+(B+2)H_nested; finite control has 2H_nested+9N/2+1 states and 16H_nested+33N/2 entries. At N=512, delta=16, crossings fall from the cited 9,182 to 8,222. The new B=2 machine executes 38,264 transitions, saving 3,840 under the cited serial invoice.

Claim type: scoped mathematical construction and proof with exact finite evidence. No optimality, new kappa or complete multiplication theorem is claimed. The classical star-transposition identity supplies the restoration argument; the new contribution is the nested physical schedule and its all-mask exact invoice. The construction, proof and verifier were produced by Nick Petalas.

Only eight files under research/nested-xor-scratch-tapes/ are added. PR #3879 supplies the record ABI, credited transition templates and serial formula. Its result is cited, not audited or replayed. Gonzalo Mier's #3480, Cinna Davis's #2297 and the retained routing/decoder lineage keep their credit. Merged #3880 provides a different larger-buffer space/time tradeoff, not this nested one-record schedule.

Evidence

  • Before: Implement framed XOR endpoint corrections on two tapes #3879 completes each three-swap pair before opening the next. After: open the smaller endpoints in increasing order and close all pairs in reverse order. The written induction preserves arbitrary dirt; the travel telescope gives the displayed formula for every h and B.
  • The new checker enumerates all 1,023 token schedules through h=9 and finds 1,012 strict improvements. It executes 254 payload cases and 100 complete one-bit data/scratch basis cases, totaling 284,889 unit transitions, with twelve rejecting controls. Two literal h=9 controllers use masks 1 and 16. Larger tables receive schedule checks, not claimed literal execution.
  • Local warning-strict normal and optimized CPython 3.12.15 checks pass in 0.32 and 0.34 seconds, each below its 120-second timeout. These are timeout-margin timings, not runtime speedup measurements. Registered metadata/replays, AST/indentation checks, whitespace, exact committed bytes and source-history checks pass at f916400a3dad1f5b7656a2d3dfe72ecf447dd1a9.
  • The exact eight-file publication also passes an optimized read-only replay outside Git, with empty PATH and the same generated SHA256-bound receipt. No predecessor executable is imported.

From the repository root:

/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/nested-xor-scratch-tapes/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -O -W error -B research/nested-xor-scratch-tapes/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/nested-xor-scratch-tapes
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/nested-xor-scratch-tapes --check-source-history

Any CPython 3.12 path can replace the local interpreter; standard library only. Expected markers are PASS_NESTED_XOR_SCRATCH_TAPES, PASS_REGISTERED_RESEARCH_PACKAGE and PASS_RESEARCH_COMMIT_BYTES. verify.py --emit-result prints the generated receipt. Default replay writes nothing.

Limitations and unrun obligations

The unrestricted quantifiers rest on the written proof. Executable schedules are bounded to h<=9 and literal tables to 250,000 entries before allocation. Full native-return layout, stream acquisition, scratch placement/lifetime, representation conversion, caller integration and recursive/outer costs remain open. No selected framework assumption is discharged. No selected cold replay, Lean proof or complete rounded multiplier was run. Independent human and formal proof-kernel review are unclaimed; the selected frontier is unchanged.

Open next questions

  • Can another same-swap-count order reduce travel further? Start with a bounded exact search at four or eight records; a global travel lower bound is missing.
  • Does the improvement survive one actual native return's complete placement and representation invoice? Bind its record layout and ownership, then price acquisition and return.

The first verified improvement ended construction work. These questions are unreserved.

Related open work

The completion refresh read the titles and stated scopes of all seven other open account PRs created since the advance CLAIM at 2026-10-27T22:06:36Z, #6021 through #6027. Only the adjacent record-permutation work #6024 is relevant here, as distinguished above. None computes a competing XOR-by-mask record-crossing or transition count. No additional scientific computations were run to validate or compare another contribution.

CI notes

Both hosted checks passed at exact head f916400a3dad1f5b7656a2d3dfe72ecf447dd1a9 in run 40593150762: plan in 4m7s and replay (research/nested-xor-scratch-tapes) in 1m41s. The completed PR check list was read once; run metadata confirms completed success and the same head as the PR.

Hosted replay certifies the registered normal and optimized bounded package checks. All recorded local scientific, metadata, committed-byte/source-history and read-only Git-free checks also passed. The universal statement rests on the written proof, and the native/caller obligations above remain open. Independent human and formal proof-kernel acceptance remain unclaimed.

Merge Danger

Door: two-way. The package can be reverted independently.

Blast radius: package. No shared code, frozen predecessor, workflow or selected-result file changes.

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