Skip to content

Tooling: 1.88× faster production joint-dual replay via containment masks with identical receipts - #2239

Merged
Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
VictorLiwentao:cursor/joint-dual-replay-production-60b9
Oct 15, 2026
Merged

Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
VictorLiwentao:cursor/joint-dual-replay-production-60b9

Conversation

@VictorLiwentao

@VictorLiwentao VictorLiwentao commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Change and scope

At base 0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2, scripts/experiments/binary_frame_replay.py:replay still paid an O(outputs × triples) literal scan for each paid output when checking expected source symbols. Aaron Wang’s opt-in adapter research/joint-dual-replay-fast/ (incorporated #1880) already proved exact containment masks with identical receipts. This PR wires that equivalent check into the production source used by make joint-dual-verify.

Only the source pin for scripts/experiments/binary_frame_replay.py changes inside certificates/joint-dual-kappa.json, certificates/skip-frame-kappa.json, and research/joint-dual/SOURCE.json (plus the consequent source_manifest_sha256 / skip-frame certificate digest). Compiler replay bytes and every assertion / check_word / full-basis orientation receipt stay identical.

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 both pinned words gave median wall time 5.873 → 3.120 seconds (1.88×). Timing is host-descriptive and is not a correctness gate. Every replay receipt matches the baseline checker fieldwise. The measured path is both-words replay() (the historical checker used by make joint-dual-verify), not full make wall time including C++/transitions/unittest.

Package: research/joint-dual-replay-production/.
Tip: 8fdb992c7d40239f8a5b7602fa6f4636f3d97961.

Validation

python3.12 -I -B research/joint-dual-replay-production/verify.py
python3.12 -I -O -B research/joint-dual-replay-production/verify.py
python3.12 -B scripts/research_package.py --package research/joint-dual-replay-production
python3.12 -I -B research/joint-dual-replay-production/benchmark.py --rounds 5

Expected:

PASS_JOINT_DUAL_REPLAY_PRODUCTION words=[23, 25] outputs=12261 receipts=2 no_new_kappa
PASS_JOINT_DUAL_REPLAY_PRODUCTION_O_POLICY refused_by_assert_gate=2 no_new_kappa
PASS_REGISTERED_RESEARCH_PACKAGE research/joint-dual-replay-production outcome=completed
PASS_IDENTICAL_JOINT_DUAL_REPLAY_PRODUCTION_RECEIPTS

Default verify is read-only. Historical checks use assert and deliberately refuse to load under -O (same production policy as before). 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 delivery): Aaron Wang’s research/joint-dual-replay-fast/ / #1880 (opt-in containment masks; this is the production wiring), CrocSwap/integer-mult-bounds#756, CrocSwap/integer-mult-bounds#2194 / #2210 / #2231 (same production-promotion pattern on other objects). No competing open PR on production binary_frame_replay.replay at refresh.

Chafik Boukhalfa authored the joint-dual / binary-frame replay verifier path. Aaron Wang authored the containment-mask algorithm. Prepared by Wentao Li (VictorLiwentao, @Is__Victor) with substantial AI assistance, under Apache-2.0.

Wire Aaron Wang's proved opt-in containment-mask scan from
research/joint-dual-replay-fast/ into scripts/experiments/binary_frame_replay.py
so make joint-dual-verify no longer pays the O(outputs x triples) literal scan.
Identical receipts; source pins updated only for that file. No new kappa.

Prepared by Wentao Li with substantial AI assistance.
…pts)

Five alternating fresh-process pairs on Linux/CPython 3.12.3: both pinned
words median 5.873 → 3.120 s. Timing is descriptive, not a correctness gate.
@Mister-Meeseeks
Mister-Meeseeks merged commit bcdf338 into CrocSwap:main Oct 15, 2026
49 of 61 checks passed
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