Skip to content

Compute canonical padded-rotation switch bits without a ROM (no κ) - #7504

Open
petalas wants to merge 1 commit into
CrocSwap:mainfrom
petalas:research/w2-1113a-cut-obstruction
Open

petalas wants to merge 1 commit into
CrocSwap:mainfrom
petalas:research/w2-1113a-cut-obstruction

Conversation

@petalas

@petalas petalas commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A switch bit of the precise canonical Beneš network for a padded modular rotation can be computed directly in O(h²) bit operations and O(h) working bits, for N=2^h and every 1<=s<=N, 0<=a<s. Claim type: scoped written proof and arithmetic construction, with finite exact corroboration. No new κ.

The new endpoint formulas and child closure avoid constructing the permutation, colored graph or whole row ROM. Interior queries follow one child:

c = x mod 2
s' = floor(s/2) + [s odd and c=(a mod 2)]
a' = (floor(a/2) + c(a mod 2)) mod s'
(h,s,a,j,x) -> (h-1,s',a',j-1,floor(x/2))

An empty child is identity; the only nontrivial modular reduction is equality with s'. The proof identifies the source's component orientations, so this is the exact deterministic table, including padded-wire switches. At h=5,s=17,j=6 it supplies any one of the 544 offset/address bits without constructing that ROM.

Only research/canonical-rotation-switch-query/ is added. Canonical base is e54523517d0f03e58352e647c403a5af3e525a57, priority revision 8. The uniform-transfer-audit card explicitly changes scope to an original construction motivated by the current-state key handoff. The advance CLAIM is delivered without a scope change.

This contribution was produced by Nick Petalas. Credit 1337isnot1337 #4100 for the canonical compiler and padded rotation, ToikY #4192 for the generic arena lowering, and JoyboyBrian #5092/#5496 for the producer/current-row context, retaining their predecessor notices. Parity coloring and binary arithmetic are standard. The new formulas, child-closure proof and direct evaluator are this contribution. Nick Petalas #4876 studies optimal active-swap tariffs; its construction and proof are not dependencies.

Evidence

The old generic interface materializes a permutation/network or supplies a row ROM. The new arithmetic evaluator follows at most h child steps. This is a construction comparison, not a measured physical runtime speedup.

Warning-strict normal and optimized runs pass 713 complete small networks, all 168,862 switch entries, 710 root decompositions and 19,406 routed addresses. Twelve domain rejections, six semantic controls and twenty large-width queries through h=4096 pass. Both registered commands took 0.30 seconds locally on CPython 3.12.15 / macOS 27.0.1 arm64, standard library only. The mathematical proof covers every positive h; the executable height cap bounds Python allocation.

The hash-bound generated normal/optimized export receipts agree. Registered replay, committed bytes and declared source history, official package export/integrity, and read-only Git-free normal/optimized exported replays with empty PATH all passed. The nine exported source files retained their bytes. The canonical source is a reference for the new construction's certificate; no predecessor research replay or receipt audit is the deliverable.

From the repository root:

/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -W error -B research/canonical-rotation-switch-query/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -W error -O -B research/canonical-rotation-switch-query/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/canonical-rotation-switch-query
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/canonical-rotation-switch-query --check-source-history

Another CPython 3.12 path may be substituted. Direct verification prints PASS_CANONICAL_ROTATION_SWITCH_QUERY; registered replay prints PASS_REGISTERED_RESEARCH_PACKAGE. Add --receipt /absolute/path/outside/checkout.json for a generated report bound to the seven package-file hashes and canonical source hash. Export reproduction:

/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/export_research_package.py export --package research/canonical-rotation-switch-query --ref HEAD --output /absolute/scratch/package.tar
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/export_research_package.py check /absolute/scratch/package.tar

Limitations

This is an arithmetic bit-query construction. Literal fixed tape lowering, current CRT offset production, descriptor serialization, owned predicate return, borrowed-state restoration, cleanup and the full key/caller price remain unimplemented. Repeated queries need a complete workload comparison against retained ROM reuse. Optimal active-swap tariffs for padded rotations remain open. The selected frontier and its five assumptions are unchanged. No selected scientific cold replay, native replay, Lean, Docker, independent human review or formal proof-kernel acceptance is claimed.

Open next questions

  • Implement the direct predicate on fixed tape roles with encoded h,s,a,j,x. Start at h=5,s=17,j=6 and charge every comparison, scan, erasure and head return. The arithmetic bound alone is not that physical bill.
  • Compose the actual current-state offset producer with one owned Boolean return. Start with the complete (0,1,4) exceptional key and its stale-second-offset rejection. Preserve descriptor conversion and uninterrupted borrowing/retirement.

Structured first steps and blockers are in TASK.json; the proof and replay commands are in the package README.

Related open work

  • #4192 prices generic encoded-permutation Beneš compilation and queries with arena scans. This result specializes the exact canonical predicate to padded rotations; it supplies no replacement physical arena bill.
  • #7388 connects a live CRT leaf to an existing row query and literal payload mover. The direct predicate is not installed in that caller.
  • #7390 fuses two payload sorts while retaining ROM calls and physical row queries. This result changes only arithmetic predicate production; no sort count or instruction total is compared.
  • #7251 determines mixed-width active-row extrema. It counts a different quantity and is not a dependency or a physical integration of these point queries.

The completion overlap check found no additional open PR studying the canonical padded-rotation switch predicate. No new same-quantity comparison was required.

CI notes

CI did not certify this package. At unchanged head 4eece58f5cebdb70a92d65447974f1c02383f60b, run 43437339750, plan job 131925744532, failed during "Onboarding helper tests". The job log reports 760 tests, exactly one failure and 24 skips. The failing test is test_research_current_status.CurrentCiNavigationTests.test_current_ci_section_matches_selected_record, with an assertion that the literal command make frontier7000-verify was absent from the CI document.

The selected record on base e54523517d0f03e58352e647c403a5af3e525a57 names make frontier7000-verify; docs/ci-verification.md still describes selected #6030 and make frontier6030-verify. The record, CI document and failing test have no changes in this PR. This is an inherited repository-level navigation failure. The package replay job 131928073997 was skipped because planning failed. Local replay success above is not hosted certification.

The same exact test, missing-command assertion and failures=1, skipped=24 summary were independently read in rohanarun's run 42905094314, dillona's run 42903313790, and petalas #7503's run 43437288667. These are the other runs checked here; no wider failure-range claim is made. No fix commit, retrigger or workflow rerun was made. The shared repair remains with maintainers.

Merge danger

Reversible package-only addition. The replay registration affects this package and its declared immutable source inputs. Shared code, predecessor files and selected records are unchanged.

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.

1 participant