Skip to content

P104 banked-circuit toolkit: exact pricer, circuit certifier, word screens and hub/split builders (tooling, no κ claim) - #7727

Open
DreamingOfClouds wants to merge 2 commits into
CrocSwap:mainfrom
DreamingOfClouds:tooling-p104-word-kit
Open

DreamingOfClouds wants to merge 2 commits into
CrocSwap:mainfrom
DreamingOfClouds:tooling-p104-word-kit

Conversation

@DreamingOfClouds

Copy link
Copy Markdown
Contributor

P104 banked-circuit toolkit (tooling, no κ claim)

This PR packages the tools behind #7705 and #7712 as one reviewable package with a self-test on published data, so that anyone can price, check or extend a P104 word or banked circuit. Every number in the tests reproduces a published result.

Tools (research/p104-banked-circuit-toolkit/tools/):

Tool Needs Purpose
pricekit.py stdlib Exact Theorem-K pricer. It builds the invoice from a caller and a native, encloses κ by certified Decimal bisection with a uniqueness check, and returns NO_CROSSING when S ≤ 0 (never a clipped bracket). It also gives S, D0 and Dk, the slot-ledger check, the parametric caller and exact dead-register pruning.
wordcheck.py stdlib Fast word screens: a sparse mod 2^61−1 replay compared with a base word, MOVE nesting, an exact-zero join census and an optional κ ratio. The 154,768-event #7700 word takes about 3 s.
bank.py, exval.py, fsolve.py stdlib Banked-circuit core: fold a word into rational forms over paid tokens, transpose, schedule (locality and acyclicity), the #7674 pivot algebra, histograms, pricing, exact values and exact sparse solves. Circuits are read and written as JSON, in this package's format or a published banked graph.
nest.py, phys.py, gauss.py stdlib GF(2) nesting and transfer rank, the symplectic rank of T_b·T_a⁻¹, and an exact Gaussian-dyadic state simulation of a chart transfer on all 512 columns.
certify.py stdlib Independent circuit check. It checks locality, acyclicity, nesting and symplectic rank, and optionally Gaussian columns. It then checks exact outputs, either against the word (mains equal, helpers identity) or against a reference circuit, and prices the result with an optional --claim gate.
hubbuild.py stdlib (numpy optional) Exact builder for hub reroutes, the generalised #7682 move.
hub2.py, split.py, splitbuild.py, search2.py, search3.py, stack.py numpy Mod-p screens for hub reroutes, causal helper splits (the generalised #7697 move), and #7674-class pivots, plus the split builder and pivot stacker.
relay.py stdlib Pure relay scan.

The screens only nominate candidates. Only the exact builders and certify.py decide, and every coefficient is an exact Fraction.

Check (python3.12 -B scripts/research_package.py --package research/p104-banked-circuit-toolkit; standard library only, about four minutes; ends with PASS_REGISTERED_RESEARCH_PACKAGE):

Run python3.12 -I -B tests/selftest.py --quick in the package for A–D in about 10 s.

Note: a small stacked tweak on #7717

The same tools found a small tweak on aliromman's #7717 circuit. Two transposed hub reroutes (chart 551 to hub 278, chart 545 to hub 488; ranks 6 + 3 → 7 + 2) build exactly on #7717's published graph. On #7717's own 16-call invoice plus the paid change {2:+2, 3:−2, 6:−2, 7:+2} per native, the crossing is 0.00376346450049, which is +0.0087% over #7717's 0.00376313686061.

This is not certified the usual way. certify.py cannot check #7717's helper-removal boundary: the graph has 1,470 public roles, against 1,504 for the cf6a word. The only output check is exact rational equality of all 1,470 outputs with #7717's own graph. The note inherits every #7717 premise and its physical and compiler bill unchanged. Its bank-cost terms are not recounted.

note-7717/check.py (about 40 s) does the following:

It is kept separate from the tooling and is not part of the title.

Limits.

  • The numpy screens are shipped as source and are not replayed in CI.
  • The REBUILDKIT helper-layer compiler, its incremental scorer and its C planner kernels are not included. They depend on unpublished planner state.
  • No human or proof-kernel review is claimed.

CI prerequisite. As in #7705 and #7712, the first commit is ToikY's cherry-picked CI repair (Repair inherited selected-family CI replay, from Clear1nsight's e29a5ae8). It only repairs the inherited selected-family replay, and it is not part of this package.

Credit.

The tools, tests and the #7717 note are by DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code.

🤖 Generated with Claude Code

ToikY and others added 2 commits November 18, 2026 12:10
Reuse Clear1nsight's exact CrocSwap#7257 guide and historical-source snapshot repair, already validated by the hosted checks on CrocSwap#7644. The research package bytes are unchanged.

(cherry picked from commit 694667c)
(cherry picked from commit 99f33bd)
…ub/split builders (tooling, no kappa claim)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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