Skip to content

Accelerate exact mixed-point construction 1.51× (no new κ) - #6007

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/w1-1022ag-support-interning
Oct 28, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/w1-1022ag-support-interning

Conversation

@petalas

@petalas petalas commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The frozen mixed-point builder repeatedly hashes large support integers when interning sums. An opt-in compact interner preserves the exact first-decomposition DAG while reducing median construction time from 3.384 s to 2.246 s, 1.507×. The complete fresh process, including unchanged output verification and complete structural hashing, falls 24.2%, from 4.538 s to 3.440 s.

- full support integer -> dictionary lookup
+ XOR of fixed-width input keys -> candidate bucket -> full support equality

Claim type: a scoped exact-equivalence proof with finite engineering evidence and measured performance on one host. Collisions never establish equality. No new supplier, κ or selected-frontier change is claimed.

This answers Open next question 1 of Victor Li / VictorLiwentao's PR #2150. Its faster output verifier and mathematical conclusions are cited dependencies. The new contribution is the interner, its exact adapter and construction gain, produced by Nick Petalas. Credit Douglas R. Colkitt for the original builders. Hash consing and XOR-linear fingerprints are standard methods; no general-method priority is claimed.

Only research/mixed-point-support-interning/ is added. Four original source files are retained byte for byte; the complete adapter diff is checked. Shared scripts and historical certificate pins are unchanged. Base: canonical main 19fdb086ea96af9a9f87936a2b888e10af4ed810, priority revision 8, refreshed unchanged before publication.

Evidence

Five alternating fresh-process pairs on macOS 27.0.1 arm64 / CPython 3.12.15 retain all ten samples with zero errors and the same complete DAG digest. Construction ranges are 3.336–3.490 s before and 1.932–2.345 s after. Complete-process ranges are 4.470–4.691 s before and 3.105–3.541 s after. Peak RSS median rises from 1.897 to 1.992 GiB. BENCHMARK.json binds the actual timed source files and records every sample; timing is not a correctness gate.

The diagnostic profile puts 2.087 s of 5.202 s profiled construction inside add, plus 0.398 s in initialization. Profiling is excluded from the reported measurements. The new key lookup retains complete support union, disjointness and equality work.

Local normal and optimized direct checks pass in 9.50 s and 12.15 s. Both registered commands also pass:

  • 28 interner fixtures and 41,212 exact union calls against a separate set oracle, including all keys colliding.
  • Complete structure equality for 15 small builder pairs covering the distinct construction paths.
  • A fresh large pair with 509,195 nodes, 489,594 active additions and 509,194 active nodes; every DAG field enters its matching digest.
  • Eight collision, first-decomposition, boundary and source controls.
  • Metadata/source pins, all 20 committed files, executable modes and source-history ancestry pass. The official committed export and a read-only Git-free replay with empty PATH pass.

RESULT.json is generated and bound to code, benchmark and source-map hashes. The large comparison uses a structural SHA256 digest; small comparisons use the complete structures. The written invariant proves general first-decomposition preservation for successful valid addition sequences within capacity.

From the worktree root, using the actual local interpreter path:

/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/mixed-point-support-interning/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -O -W error -B research/mixed-point-support-interning/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/mixed-point-support-interning
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/mixed-point-support-interning --check-source-history --check-modes
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/mixed-point-support-interning/benchmark.py --rounds 5 --output /tmp/new-mixed-point-benchmark.json

Another CPython 3.12 path can replace the local path. Registered checks are read-only, standard-library-only and bounded at 180 s each.

Limitations and unrun obligations

The adapter is opt-in and its private lookup representation changes. Production-audit adoption needs a consumer and source-pin check. The performance figure is limited to this host and frozen workload; no second-host timing is claimed. Additional memory is explicit, and worst-case key collisions can slow bucket scans without affecting correctness. The runner uses POSIX resource accounting and is not qualified on Windows.

No predecessor mathematical audit, selected scientific cold replay, Lean or Docker run is supplied. Supplier/native, ownership, compiler, precision/tape and analytic recovery obligations remain. Independent human and formal proof-kernel review are unclaimed.

Open next questions

  • Can the shared mixed-point audit adopt the interner under its source-pin and consumer contracts? First inventory direct lookup consumers and pins, then retain every complete audit check.
  • Does the measured gain persist on Linux CPython 3.12? Run the fixed five-pair benchmark on that host and retain every sample.

Related open work

Fresh open-PR object/path searches found no open PR studying mixed-point support interning or its construction-time quantity. PR #2150 is the merged question source. Merged #1459/#1461 optimize rational-frame containment on a different stage of the historical audit; they are not imported or replayed, and no combined speedup is claimed. Open Lean PRs mentioning a mixed-point provenance pin concern different source files and proof obligations.

Completion refresh inspected the titles and result scopes of all 14 other open account PRs created since the CLAIM at 2026-10-27T21:02:46Z: #5997, #5998, #5999, #6000, #6001, #6002, #6003, #6004, #6005, #6006, #6008, #6009, #6010, #6011. None studies mixed-point support interning or the same construction-time workload. No extra computations were run to check their results, and no numerical comparison was needed.

CI notes

Both hosted checks passed at head f2f3f3171886d24207173859fe32002d528c0b5e in Registered research packages run 40585170144: plan in 3m48s and replay (research/mixed-point-support-interning) in 2m5s. The run is completed with conclusion success, and its head SHA matches the PR. The completed check list was read once. Hosted replay certifies the registered normal and optimized correctness checks; it does not establish the local performance factor. All registered commands also ran locally, with no check deferred to CI.

Merge danger

Door: two-way. Blast radius: isolated. Twenty files are added under one opt-in research package. No shared code, frozen predecessor source, credit line or selected-frontier 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