Skip to content

Tooling: 4.75× faster production P112 free-sink audit via signed modular determinants with identical receipts - #2433

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
VictorLiwentao:cursor/p112-signed-modular-production-60b9
Oct 15, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
VictorLiwentao:cursor/p112-signed-modular-production-60b9

Conversation

@VictorLiwentao

Copy link
Copy Markdown
Contributor

Change and scope

At base 0b1cccf86e2f5132ed286a26ef0a681a495740ea, production research/p112-free-sink-audit97/independent.py still computed every signed minor with rational Fraction elimination. woklerx’s opt-in adapter research/p112-signed-modular86/ (incorporated #1144) already proved a modulo-521 kernel that recovers each full signed determinant inside a checked Hadamard envelope, with identical complete audit receipts. This PR wires that equivalent rewrite into the production independent checker.

The original rational elimination is retained as rational_determinant and as the fallback for rows outside the envelope. Pairwise Fraction-only bytes are vendored in baseline.py. The opt-in package vendors the same baseline for its reference engine. Leave-alone tooling through #2431 and deferred ck-dyadic-replay-production / scalar-fused-dyadic-production were not reopened.

No certificate κ pins change.

Tooling improvement; no new kappa. Selected frontier untouched.

Result

On Linux / CPython 3.12.3 with taskset -c 0, five alternating in-process pairs over the complete 28,560-case / 4,030-minor audit gave median wall time 0.681 → 0.143 s (4.754×) with per-round ratios 4.618–4.880×. Timing is host-descriptive and is not a correctness gate. Every audit receipt matches the pairwise baseline.

Package: research/p112-signed-modular-production/.
Tip: d688ec0ff64f300c3ff124a60893c5c8c5e4f1c4.

Validation

python3.12 -I -B research/p112-signed-modular-production/verify.py
python3.12 -I -O -B research/p112-signed-modular-production/verify.py
python3.12 -B scripts/research_package.py --package research/p112-signed-modular-production
python3.12 -B -m unittest tests.test_p112_signed_modular_production
taskset -c 0 python3.12 -I -B research/p112-signed-modular-production/benchmark.py --rounds 5

Expected:

PASS_P112_SIGNED_MODULAR_PRODUCTION cases=28560 minors=4030 signed_matrices=19767 controls=10 no_new_kappa
PASS_REGISTERED_RESEARCH_PACKAGE research/p112-signed-modular-production outcome=completed
PASS_IDENTICAL_P112_SIGNED_MODULAR_PRODUCTION_RECEIPTS

Default verify is read-only. Temp-copy certificate determinant-flip foil rejects via audit failure. Package gates under -O still load checkers with compile(..., optimize=0). Full make verify, selected cold replay, Lean, and multiplication-theorem obligations were not rerun for this isolated historical-checker change.

Why the modular path is equivalent

Every frozen square minor has dimension at most eight and integer rows of squared Euclidean norm at most four. Hadamard’s inequality gives |det A| ≤ 2^n ≤ 256. Modulus 521 is prime and greater than twice 256, so the unique representative in (-260, 260) recovers the exact signed determinant whenever the modular path fires. See research/p112-signed-modular86/.

Overlap and credit

Closest priors (different delivery): woklerx’s research/p112-signed-modular86/ / #1144 (opt-in modular dets; this is the production wiring), CrocSwap/integer-mult-bounds#756. Leave-alone tooling through #2431 was not reopened. No competing open PR on production p112-free-sink-audit97/independent.py at refresh.

Credit woklerx and the retained P112 free-sink lineage. Prepared by Wentao Li (VictorLiwentao, @Is__Victor) with substantial AI assistance, under Apache-2.0.

…lar determinants

Wire woklerx's proved opt-in modulo-521 kernel
(research/p112-signed-modular86, CrocSwap#1144) into production
research/p112-free-sink-audit97/independent.py with identical
28,560-case / 4,030-minor receipts. Package
research/p112-signed-modular-production/ with baseline, verify,
benchmark, and registered VERIFY. Vendor pairwise Fraction baseline
inside the opt-in package for reference comparisons.

Pinned-CPU five-round median 0.681→0.143 s (4.754×; per-round
4.618–4.880×). No new kappa.

Prepared by Wentao Li with substantial AI assistance.
@Mister-Meeseeks
Mister-Meeseeks merged commit b86e0d1 into CrocSwap:main Oct 15, 2026
55 of 62 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