Repository navigation
Tooling: 2.03× faster parity-side basis/contains with identical receipts - #1861
Open
VictorLiwentao wants to merge 2 commits into
Open
VictorLiwentao wants to merge 2 commits into
VictorLiwentao wants to merge 2 commits into
Conversation
Memoize basis on row tuples and reduce contains against one basis so the historical parity-side audit keeps identical h=8/10/26 receipts while the three binding certificates change only the binary_phase_frames.py pin.
Five alternating fresh-process pairs on CPython 3.12.3 / Linux give median 27.349 → 13.463 seconds with fieldwise-identical h=8/10/26 receipts.
This was referenced Oct 14, 2026
Contributor
|
Review found a cache-dependent validation regression in _basis_cached.cache_clear()
basis((1,)) # warms the cache
basis((1.0,)) # now returns (1,), bypassing the integer assertionThe baseline rejects |
This was referenced Oct 14, 2026
Merged
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 historical parity-side audit spends most time inscripts/binary_phase_frames.py:basisandcontainsare called millions of times, andcontainspreviously rebuiltbasis(space)twice per membership test.This PR memoizes
basison the row tuple and implementscontainsby reducing the vector against one basis of the space. The highest-bit pivot rule, elimination order, classify/nullspace/residual APIs and every Boolean result are unchanged. Only the source pin forscripts/binary_phase_frames.pychanges inside the three certificates that bind that file (parity-side,disjoint-tensor-compression,dyadic-central-factor).Tooling improvement; no new kappa. Selected frontier untouched.
Result
On Linux / CPython 3.12.3, five alternating fresh-process pairs of the full
h=8,10,26stream gave median 27.349 → 13.463 s (2.03×). Timing is host-descriptive and is not a correctness gate. Every experiment receipt matches the baseline checker fieldwise.Package:
research/parity-side-basis-cache/.Validation
Expected:
Default verify is read-only. 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#1217. No competing open PR on this object at refresh.
Douglas R. Colkitt authored the parity-side obstruction, repair and original binary phase-frame checkers. Prepared by Wentao Li (VictorLiwentao, @Is__Victor) with substantial AI assistance, under Apache-2.0.