Skip to content

Research: bidirectional Horner saves 312 SW4 primitives per orientation (no new kappa) - #837

Merged
Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
bitplane:research/pass03-dyadic-horner-direction
Oct 13, 2026
Merged

Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
bitplane:research/pass03-dyadic-horner-direction

Conversation

@bitplane

@bitplane bitplane commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

A dyadic coefficient can sometimes be built more cheaply by processing its digits from low to high, halving between reads. This contribution chooses between binary/NAF Horner in both directions while preserving the original per-macro scratch boundary. Finite complex-supplier circuit construction; no new κ.

Beyond the credited #696 copy/unit and #723/#787 forward signed-digit methods, this saves 312 real primitives per orientation on the #741 SW4 supplier selected at the starting base, plus 928 for historical CK and 810 for historical JP8:

Program Best forward lowering Bidirectional Additional saving
SW4 forward / backward 142,536 / 142,552 142,224 / 142,240 312 / 312
CK forward / backward 169,416 / 169,432 168,488 / 168,504 928 / 928
JP8 forward / backward 197,104 / 197,120 196,294 / 196,310 810 / 810

Every source read, copy, shift, accumulation and clear is charged. All 716+9 checkpoint or 728+9 SW4 arbitrary input columns pass exact primitive replay, including dirty helpers and private scratch. Fresh positive prefix bounds remain within the inherited 192-bit local allowance. Frames, paid children and macro clearing boundaries are preserved. These are circuit counts, not measured runtime improvements.

Only research/dyadic-horner-direction/ is added: executable lowering, induction/cost proof, exact receipt, pins, separate integer checker, tests, local claim and validation.

python3 -B -I research/dyadic-horner-direction/verify.py
python3 -B -I research/dyadic-horner-direction/crosscheck.py
python3 -B -I research/dyadic-horner-direction/test_verify.py

Expected: six programs, 962 distinct coefficients, additional savings 928,810,312 per orientation, 14 adverse controls; the separate integer checker agrees on every coefficient and 13,286 grid inputs; eight tests pass. Both implementations were written by one AI agent, not independent human reviewers.

Linux CPython 3.12.3 and 3.14.4 pass, including optimization, no site packages and minimal relocation. Source/receipt/typed-JSON/circuit corruption fails as intended; gzip/tar repackaging passes; existing output is preserved. Selected-record and staged whitespace checks pass. Full repository/cold supplier/global admission/phase-wrapper regeneration, Lean and hosted CI passes are not claimed.

Exact base: 7ee02b7c96d85f22b38d28bd7ed49bb8c1aeb261. OS seed 39, complex supplier; no sprint coordination issue was available. Both reviewed records are bound through their manifests to the consumed SPEC/program payloads. SW4 uses the committed maintainer replay archive; the complete construction chain is not rebuilt here. The final overlap snapshot covered 646 open PRs through #833; upstream main was unchanged at that check. During publication main advanced to f567884aeb8851b6e794af1184119a3bfbe1e631, selecting #799 at κ = 0.001661634653669567. The complete receipt also passes against its actual inputs and new selected pointer; #741's identical pinned record is accepted at its new official checkpoint location. A corrupted checkpoint is rejected. This remains a #741/#626 contribution, with no transport claim for #799.

Credit Sagar Thakrar's #696/#723, Chris Pagolu's #734, our #787 replay, icekylinx, DreamingOfClouds, Jeremy Kothe, Chafik Boukhalfa, Rohan Arun, eumemic and the retained #622/#626/#741 lineage. #696's lowering is vendored verbatim with its source notice. #751 and #830 collect/transpose work across macro boundaries; this construction reverses digits within individual coefficients. #739/#769/#811 and the target/helper panel constructions are also distinct; their savings are not assumed additive.

Prepared for Gareth Davidson (@bitplane) with substantial OpenAI Codex assistance, Apache-2.0. Production integration and refreshed global invoices remain separate work. Uniform compiler, realization, hosting, recursive interface, precision/tape and analytic assumptions remain inherited. The selected frontier is unchanged; finite replay is not a full multiplication theorem proof.

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