Repository navigation
Tooling: faster partial-swap SharedPoint verify digests and __init__ construction with identical receipts - #2039
Merged
Mister-Meeseeks merged 3 commits intoOct 15, 2026
Conversation
…l receipts Hand-roll byte-identical circuit_sha256 lines in scripts/partial_swap/shared.py, preserving support checks. Pin-only refresh of certificates/partial-swap-network.json. No new kappa. Prepared by Wentao Li with substantial AI assistance.
Five alternating fresh-process pairs on CPython 3.12.3; median verify 2.176 → 1.050 s. Prepared by Wentao Li with substantial AI assistance.
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change and scope
At base
0b1cccf86e2f5132ed286a26ef0a681a495740ea, the partial-swap fork (scripts/partial_swap/shared.py) spends substantial wall time in two places on the historicalh=46circuit:SharedPointCircuit.verify— per-node / per-outputjson.dumpswhile buildingcircuit_sha256SharedPointCircuit.__init__— per-common sort/unpack/lookup in the merge/lookup loopThis PR applies the same byte-identical hand-rolled digest formatter used on the canonical producer in CrocSwap/integer-mult-bounds#1994, then ports the merge/lookup construction rewrite from CrocSwap/integer-mult-bounds#2054 onto this distinct producer fork (including
point_order/ sortedpair_ids). Support checks stay;circuit_sha256and the constructed DAG stay fieldwise identical.certificates/partial-swap-network.jsonupdates only thescripts/partial_swap/shared.pysource_sha256pin once for the combined file.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:
partial_swap.shared.SharedPointCircuit(46).verifypartial_swap.shared.SharedPointCircuit(46)constructionTiming is host-descriptive and is not a correctness gate.
Packages:
research/partial-swap-digest/,research/partial-swap-init/.Validation
Expected:
Default verify is read-only aside from the already-committed pin-only certificate refresh. Historical support checks use
assertand are stripped under-O; structure/circuit_sha256identity remain the gates. Fullmake verify, selected cold replay, Lean, and multiplication-theorem obligations were not rerun for these isolated historical-checker changes.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, CrocSwap/integer-mult-bounds#1994, CrocSwap/integer-mult-bounds#2054 (canonical
__init__; this ports the same construction rewrite to the producer fork). #2001's ExclusionCircuit / DisjointTensor support-mask files are not touched.Douglas R. Colkitt authored the shared-point / exclusion circuits. icekylinx adapted the partial-swap producer copy. Prepared by Wentao Li (VictorLiwentao, @Is__Victor) with substantial AI assistance, under Apache-2.0.