Skip to content

Research construction: seven grid-preserving JP8 circuits save 104 primitives per orientation (no new kappa) - #882

Merged
Mister-Meeseeks merged 3 commits into
CrocSwap:mainfrom
mightyOil:research/jp8-grid-bounded-synthesis
Oct 13, 2026
Merged

Mister-Meeseeks merged 3 commits into
CrocSwap:mainfrom
mightyOil:research/jp8-grid-bounded-synthesis

Conversation

@mightyOil

@mightyOil mightyOil commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Seven coefficients in the historical #626 JP8 scalar programs admit shorter single-scratch circuits than all four binary/NAF Horner variants from #837. The circuits interleave halvings and repeated source additions while retaining the original magnitude envelope, fractional grid and clearing boundary.

Status: finite complex-supplier circuit construction; no new kappa.

Complete JP8 scalar projection Accepted #696 Replacement Saved
Forward 200,380 200,276 104
Backward / inverse-transpose 200,396 200,292 104

Each orientation changes 44 macros. At those occurrences, the saving against the best of all four #837 variants is 88 real primitives. The full #837 program is not composed here; all other macros retain #696. These savings are not additive. The additional 92 macro-source reads per orientation are paid in the primitive bill. Counting every arithmetic operand occurrence, total register reads decrease by 12. Neither count is a physical memory-traffic or runtime claim.

Reproduce offline with standard-library Python 3.11+:

python3 -I -O -B research/jp8-grid-bounded-synthesis/verify.py
python3 -I -O -B research/jp8-grid-bounded-synthesis/test_package.py
python3 -I -O -B research/jp8-grid-bounded-synthesis/test_independent.py

Main marker: PASS_JP8_GRID_BOUNDED_SYNTHESIS coefficients=49 improved=7 extra_vs_four_horner=88,88 columns=716+9 kappa=unchanged.

The prespecified search covers all 49 nonunit absolute JP8 coefficients with reduced numerator <=127 and denominator <=16. An independently implemented Bellman/potential checker verifies all 3,703 vertices and 14,311 distinct directed edges, establishing exact minima only in the declared bounded single-scratch class. Seven words strictly beat all four Horner comparators; no general circuit-optimality or shift/add novelty claim is made.

Both complete scalar orientations execute on 716 logical plus nine arbitrary private input columns, with restoration and clearing checked at every macro boundary. A separate integer implementation imports neither Fraction nor project modules: it independently emits baseline/replacement words and compares them to direct integer macro semantics. Full primitive-stream hashes, costs, operand counts, fractional guards and scalar row-L1 maxima agree between implementations. Exact denominator maxima stay 4 forward / 27 backward, and scalar prefix row-L1 maxima stay 503316465 / (1469388997/2). Physical frame/phase operators are outside those scalar traces; the inherited 192-bit allocation is retained.

The same 49 graphs also have certified instruction/source-read Pareto frontiers: 4,104 state labels and 16,096 edge-label closure obligations. All submitted shortest witnesses minimize reads among equally short words. Exactly the seven selected coefficients have a longer, lower-read alternative. For hypothetical additional read price p, the unchanged schedule's gain against #696 is 104-92p; alternative choices switch at 1/3,1,2. An independent weighted Dijkstra test checks 490 graph/price cases. These alternatives remain diagnostics, not installed programs or physical price claims; the lower-read 15/4 bounded-Horner alternative is credited to #734.

Validation: 14 package tests and six independent differential/graph tests pass on CPython 3.14.7 and 3.11.15, including isolated optimized minimal relocation, gzip repackaging, provenance/JSON-type/source/receipt/path corruption and output preservation. Eleven macro, six integer, four graph and four Pareto adverse controls pass. Differential arithmetic checks include 7,000 multiplications, 39,200 sums and all 383 comparator parameter pairs. Selected-record integrity, exact staged-file reproduction, scope and whitespace checks pass. The further review corrected permissive provenance metadata and Python's boolean/integer/float equality at certificate boundaries; submitted circuits and their savings are unchanged.

Only research/jp8-grid-bounded-synthesis/ is added. Base: f567884aeb8851b6e794af1184119a3bfbe1e631. OS assignment seed33 selected the complex track and JP8 scope. Source/comparator heads, input hashes, certificates, proof, receipt and validation are included. The local claim records this PR because no pinned sprint issue exists. Continued overlap checks through #893 found no duplicate; eight dependency heads and main remained unchanged. #883 concerns selected-X4 two-register block fusion, a different object; no composition is asserted. The selected #799 frontier and upstream/ are untouched.

Credit Sagar Thakrar's #696/#723, Gareth Davidson's #837 and #866, Chris Pagolu's #734, and the retained icekylinx / Jeremy Kothe / Chafik Boukhalfa / DreamingOfClouds / Rohan Arun / eumemic lineage. #811/#860 reuse work across macros; this contribution retains every clearing boundary.

Production integration, native frame/phase admission, refreshed global owner/invoice/assembly and full compiler precision remain separate obligations. Full repository/cold supplier suites, remote CI and Lean were not run. All inherited all-size, realization, hosting, precision/tape and analytic assumptions remain. Finite scalar checks are not a full multiplication theorem.

Prepared for Philipp (@mightyOil) with substantial OpenAI Codex assistance, including separate AI implementations and reviews. No independent human review is claimed. Apache-2.0; predecessor attribution is retained.

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