Skip to content

Optimize THREE-base logical defect guards: save 2336 per direction (no κ) - #6121

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/w4-1022aj-invoice-contact
Oct 28, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/w4-1022aj-invoice-contact

Conversation

@petalas

@petalas petalas commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Finite certificate and scoped integer-optimality proof for a new logical precision objective on David Ganz / Dugongue's PR4510 rewritten THREE-base suffix ledger.

- Forward ADD/SCALE guards  (11,11): charge 191741
+ Forward ADD/SCALE guards  (11, 9): charge 189405
- Backward ADD/SCALE guards (13,13): charge 226707
+ Backward ADD/SCALE guards (13,11): charge 224371

Each direction saves 2336 under the declared charge J=N_ADD*g_ADD+N_SCALE*g_SCALE. Both allocations are uniquely optimal over nonnegative integer guards satisfying every published row inequality. The largest normalized output bounds are 7257/8192 and 827/1024. This is a logical defect-budget result on a historical word, with no claim of physical storage/runtime savings or new kappa.

The source ledger and its perturbation theorem are cited inputs, not re-audited deliverables. The new contribution was produced by Nick Petalas. Credit David Ganz / Dugongue's PR4510 and PR4505, the borrowed-adapter/gauge/source-selector chain and the native/compiler predecessors retained in the package. The selected PR6030 frontier and every existing source are unchanged.

Evidence

  • Before: the uniform benchmark requires 11 forward or 13 backward guard bits under the predecessor's exact-input, exact-other-classes, logical-isometry model. After: SCALE needs two fewer bits at the unique event-weighted optimum.
  • All 1264 output constraints pass, 632 per orientation. Monotonicity certificates prove optimality; a separately represented integer-arithmetic oracle enumerates all 1057 forward and 1457 backward integer pairs at or below the respective uniform charge. It finds the same unique optima.
  • All 15 rejection controls pass normally and under optimization, including insufficient guards, a nonoptimal guard rejected by the optimality certificate, malformed guards and corrupt source bytes.
  • CPython 3.12.15, standard library only: both direct warning-strict checks, both registered commands, metadata/source pins, committed bytes/modes and source ancestry pass at bbf28e1a678e1a9cbc633f35de5231eaab967f01. The two final separately timed registered commands take 0.051 s and 0.060 s locally, each below its 120 s timeout. These are validation durations, not a speed comparison.
  • The official six-file export passes integrity and declared-input coverage; optimized replay with an empty executable PATH passes outside Git. The selected-baseline source-binding orientation passes after sparse inputs are materialized. No predecessor scientific replay is run.

From the repository root:

/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/suffix-guard-allocation/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -O -B research/suffix-guard-allocation/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/suffix-guard-allocation
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/suffix-guard-allocation --check-source-history --check-modes

Any CPython 3.12 executable can replace that path. The direct command prints PASS_SUFFIX_GUARD_ALLOCATION in a generated JSON receipt bound to the exact input and all five package files. Sparse checkouts must first materialize research/native-suffix-errors. Exact source pins, including the cited proof, are in SOURCES.json.

Limitations

Optimality concerns the sufficient inequalities in the supplied ledger, not the smallest true error of the program. The charge sums additional logical defect guard bits over source-supplied event counts. It is not peak live storage, a physical mantissa prescription or a machine-cost theorem. Every non-ADD/SCALE class is exact under the explicitly inherited model.

Physical norm conversions, recursive defects/feedback, rounding-grid ownership, restoration and a complete paid implementation remain open. This historical allocation cannot be transferred to the selected PR6030 word without new source-bound weights. No selected framework assumption or complete multiplication theorem is discharged. Independent human and formal proof-kernel review are unclaimed. Selected cold replay, predecessor scientific suites, Lean and Docker were not run.

Open next questions

Can a literal ADD/SCALE implementation realize these unequal entire-field tolerances with a smaller complete arithmetic bill? Start by translating its componentwise errors into the retained logical norm, then price width conversion, routing and restoration. Missing physical contracts are the blocker.

Related open work

The live open-PR and Discussion search found no other contribution optimizing the PR4510 rewritten THREE-base ADD/SCALE event-weighted guard charge. PR4510 is a merged predecessor. PR6119 is adjacent rounding work on the selected deferred-row interface; it studies suffix amplification of temporary-row noise, while this contribution allocates logical class tolerances on a different historical word. No same-instance numerical value is compared.

Completion refresh read the titles and bodies of all five other open account PRs created since the CLAIM: #6122, #6123, #6124, #6125 and #6126. They concern higher-rank query capacity, two-coset centre kernels, sampler-table sharing, direct-flow leaf tariffs and production Gaussian conditioning. None studies the PR4510 guard-allocation objective or reports a competing value for this instance. No extra numerical computations were run to compare them.

The advance claim is the canonical investigation pointer. Main-tree formula/object searches, merged-PR searches, recent account work and current local claims were checked. Cached remote coverage includes 379 open PRs and 5775 Discussion records with complete pagination; sparse local coverage and unpublished work remain limitations.

CI notes

CI is uncertified at commit bbf28e1a678e1a9cbc633f35de5231eaab967f01. In run 40691885316, plan failed during Onboarding helper tests and the package replay was skipped. The package replay did not run in CI.

The failure is inherited from canonical main 721c03822c421b7f7fcbb2598993b947c4d88419, the PR6030 admission commit whose subject contains [skip ci], and is unrelated to this package. Its selected-record/documentation mismatch causes exactly these two test failures:

  • test_research_current_status.CurrentStatusTests.test_current_section_matches_selected_record expects the exact marker **0.003125804** in docs/research/current-status.md. The document instead bolds 0.003125804 = 781451/250000000 together, so that marker is absent.
  • test_research_current_status.CurrentCiNavigationTests.test_current_ci_section_matches_selected_record expects make frontier6030-verify in docs/ci.md, which still describes Raise conditional kappa to 0.00310045 with independent helper splits #5599 and make frontier5599-verify.

The log reports 678 onboarding tests, two failures and 23 skips. PR6120's run 40691776027 fails the same two tests, confirmed from its failed-job log. No other onboarding failure is inferred from incidental diagnostic text.

All package checks listed above passed locally, but none was certified by this hosted run. A maintainer must re-run CI after main's documentation is fixed. No branch push, documentation fix or CI re-run was performed for this blocker.

Merge danger

Door: two-way. Blast radius: isolated.

Adds one standalone research package and its opt-in replay. No shared-code or selected-record 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