Skip to content

Tooling: 2.07× faster shared-point verify digests with identical receipts - #1994

Merged
Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
VictorLiwentao:cursor/shared-point-digest-60b9
Oct 14, 2026
Merged

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

Conversation

@VictorLiwentao

Copy link
Copy Markdown
Contributor

Change and scope

At base 0b1cccf86e2f5132ed286a26ef0a681a495740ea, SharedPointCircuit.verify builds circuit_sha256 with per-active-node and per-partial-output json.dumps(..., separators=(',',':')) updates. Profiling on the historical full-size circuit (h=46) shows about half of verify wall time in that JSON encoder path. Open CrocSwap/integer-mult-bounds#1984 left this object as an explicit next question after shipping mixed-point scalar_check digests.

This PR writes the same UTF-8 digest lines with an equivalent hand-rolled formatter ([node,null,null], [node,[a,b],[common,local]], [common,[t0,t1,t2],node]), keeps every support and topology assertion, and leaves circuit_sha256 unchanged. The bit-compression certificate does not list scripts/shared_point_circuit.py in source_sha256.

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 timing only SharedPointCircuit(46).verify (construction excluded; nested ExclusionCircuit.verify included) gave median wall time 2.212 → 1.070 seconds (2.07×). Timing is host-descriptive and is not a correctness gate. Every verify receipt matches the baseline checker fieldwise (roles, additions, merged_additions, circuit_sha256, flags).

Package: research/shared-point-digest/.

Validation

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

Expected:

PASS_SHARED_POINT_DIGEST verify_cases=5 encoding_cases=8 certs=0 no_new_kappa
PASS_REGISTERED_RESEARCH_PACKAGE research/shared-point-digest outcome=completed
PASS_IDENTICAL_SHARED_POINT_DIGEST_RECEIPTS

Default verify is read-only. Historical support checks use assert and are stripped under -O; circuit_sha256 identity remains the gate. 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 (mixed-point scalar_check; this package answers its SharedPoint open question), CrocSwap/integer-mult-bounds#1874. No competing open PR on the SharedPointCircuit.verify digest object at refresh.

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.

Replace per-node json.dumps in SharedPointCircuit.verify with byte-identical
hand-rolled digest lines. Package research/shared-point-digest/ with baseline
foil, equivalence controls and registered replay. No new kappa.
Five alternating fresh-process pairs on CPython 3.12.3 / Linux give median
2.212 → 1.070 seconds with fieldwise-identical SharedPointCircuit.verify
receipts.
@Mister-Meeseeks

Copy link
Copy Markdown
Contributor

Batch review at c5ba9f7b37b7e197c3faf5501d1c2f427d2972ab.

Merged to main, preserving the original contributor commits and package attribution.

Reviewed scope: Common-centre scalar digest optimization reproduces prior canonical digest/payloads across five ground sizes and complete encoding regression cases. Checks run with assertions enabled and optimized. Applies to valid constructed leaves; no frontier change or independently certified benchmark ratio.

The pinned scoped command passed; the batch ledger contains its command, input hashes, environment and log. This incorporates the research/tooling contribution and does not change the selected κ or discharge the inherited multiplication-theorem assumptions.

Batch review, attribution and evidence. Thank you for the contribution.

cursor Bot pushed a commit to VictorLiwentao/integer-mult-bounds that referenced this pull request Oct 14, 2026
…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.
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