Skip to content

Tooling: faster SharedPointCircuit.__init__ and verify_frames with identical receipts - #2054

Merged
Mister-Meeseeks merged 4 commits into
CrocSwap:mainfrom
VictorLiwentao:cursor/shared-point-init-60b9
Oct 15, 2026
Merged

Mister-Meeseeks merged 4 commits into
CrocSwap:mainfrom
VictorLiwentao:cursor/shared-point-init-60b9

Conversation

@VictorLiwentao

@VictorLiwentao VictorLiwentao commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Change and scope

At base 0b1cccf86e2f5132ed286a26ef0a681a495740ea (folded onto merged CrocSwap/integer-mult-bounds#1994 verify digests), this PR rewrites two residual hot paths on scripts/shared_point_circuit.py with identical receipts:

  1. SharedPointCircuit.__init__ — pre-sorts local.active / local.outputs once, unpacks children directly, binds hot lists/dicts locally, keeps historical node-allocation order (research/shared-point-init/).
  2. support_in / verify_frames — replaces thrashing process-wide lru_cache(maxsize=16384) with a per-instance dense table indexed by node * h + common, plus local nesting closures (research/shared-point-frame-contains/). Folded here because it edits the same production file. On h=46 the dense table is large (~hundreds of MB of Python object slots); that is a deliberate space/time trade for the historical full-size checker, not a selected-frontier memory claim.

Every structural field and every verify / verify_frames receipt stays identical. The bit-compression certificate does not list scripts/shared_point_circuit.py in source_sha256. Production verify keeps #1994’s hand-rolled digests.

Tooling improvement; no new kappa. Selected frontier untouched.

Result

On Linux / CPython 3.12.3 (Linux-6.12.94+-x86_64-with-glibc2.39), five alternating fresh-process pairs:

  • SharedPointCircuit(46) construction only: median 0.649 → 0.438 seconds (1.48×)
  • SharedPointCircuit(46).verify_frames(code) only (construction/compile excluded): median 2.888 → 1.729 seconds (1.67×)

Timing is host-descriptive and is not a correctness gate.

Validation

python3.12 -I -B research/shared-point-init/verify.py
python3.12 -I -O -B research/shared-point-init/verify.py
python3.12 -B scripts/research_package.py --package research/shared-point-init
python3.12 -I -B research/shared-point-init/benchmark.py --rounds 5

python3.12 -I -B research/shared-point-frame-contains/verify.py
python3.12 -I -O -B research/shared-point-frame-contains/verify.py
python3.12 -B scripts/research_package.py --package research/shared-point-frame-contains
python3.12 -I -B research/shared-point-frame-contains/benchmark.py --rounds 5

Expected:

PASS_SHARED_POINT_INIT verify_cases=5 mutant=rejected certs=0 no_new_kappa
PASS_REGISTERED_RESEARCH_PACKAGE research/shared-point-init outcome=completed
PASS_IDENTICAL_SHARED_POINT_INIT_RECEIPTS

PASS_SHARED_POINT_FRAME_CONTAINS cases=5 json_files=4 certs=0 no_new_kappa
PASS_REGISTERED_RESEARCH_PACKAGE research/shared-point-frame-contains outcome=completed
PASS_IDENTICAL_SHARED_POINT_FRAME_CONTAINS_RECEIPTS

Default verify is read-only. Historical nesting checks use assert and are stripped under -O; structure / receipt identity remain the gates. Full make verify, selected cold replay, Lean, and multiplication-theorem obligations were not rerun for this isolated historical-checker change.

Overlap and credit

Closest priors (different objects): CrocSwap/integer-mult-bounds#756, CrocSwap/integer-mult-bounds#1793, CrocSwap/integer-mult-bounds#1861, CrocSwap/integer-mult-bounds#1922, CrocSwap/integer-mult-bounds#1984, merged CrocSwap/integer-mult-bounds#1994 (verify digests on the same file), CrocSwap/integer-mult-bounds#2039. No second competing PR for the frame-contains package (folded here).

Douglas R. Colkitt authored the shared-point / exclusion circuits and bit-compression screens. Prepared by Wentao Li (VictorLiwentao, @Is__Victor) with substantial AI assistance, under Apache-2.0.

…receipts

Pre-sort local active/outputs once, unpack child mappings directly, and bind
hot attributes locally in SharedPointCircuit.__init__. Node allocation order,
merged_additions, and circuit_sha256 stay identical. Package:
research/shared-point-init/.

Prepared by Wentao Li with substantial AI assistance.
Five alternating fresh-process pairs on CPython 3.12.3 / Linux give median
0.856 → 0.601 seconds with fieldwise-identical SharedPointCircuit construction
and verify receipts.
…p#1994 verify

Keep hand-rolled verify digests from CrocSwap#1994 and add the merge/lookup
construction speedup with identical DAG and circuit_sha256. Refresh package
pins and benchmark receipts (median 0.649 → 0.438 s, 1.48×).

Prepared by Wentao Li with substantial AI assistance.
cursor Bot pushed a commit to VictorLiwentao/integer-mult-bounds that referenced this pull request Oct 14, 2026
…rocSwap#2039

Port the CrocSwap#2054 merge/lookup construction rewrite onto the producer fork after
CrocSwap#2039's verify digests. Identical DAG and circuit_sha256; one re-pin of
certificates/partial-swap-network.json; package research/partial-swap-init/.
Median construction 0.771 → 0.523 s (1.47×).

Prepared by Wentao Li with substantial AI assistance.
…cSwap#2054

Same production file as the __init__ rewrite. Dense per-instance support_in
table replaces thrashing lru_cache(16384); identical nesting receipts
(2.888 → 1.729 s median on h=46). Package research/shared-point-frame-contains.
cursor Bot pushed a commit to VictorLiwentao/integer-mult-bounds that referenced this pull request Oct 14, 2026
@VictorLiwentao VictorLiwentao changed the title Tooling: 1.48× faster SharedPointCircuit.__init__ merge construction with identical receipts Tooling: faster SharedPointCircuit.__init__ and verify_frames with identical receipts Oct 14, 2026
@Mister-Meeseeks
Mister-Meeseeks merged commit 06164c0 into CrocSwap:main Oct 15, 2026
antunishdPursuit added a commit to antunishdPursuit/integer-mult-bounds that referenced this pull request Oct 16, 2026
Retain complete baseline payload comparisons while authenticating the accepted central-factor, mixed-point and Leech companion source updates. Keep unknown-field, forged-pin and changed-source rejection controls; add central-source drift rejection. Update the shared-point digest test to bind the reviewed CrocSwap#2054 successor and its retained original baseline independently. No frozen research verifier or certificate is edited here.

Verified: all 13 tests across the three affected modules pass. Attribution remains with the accepted optimization authors; compatibility tests by Dennis with substantial OpenAI Codex assistance, Apache-2.0.
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