Repository navigation
Reduce exact downset replay time with integer dot products - #5002
Merged
Mister-Meeseeks merged 2 commits intoOct 23, 2026
Merged
Mister-Meeseeks merged 2 commits into
Mister-Meeseeks merged 2 commits into
Conversation
Contributor
|
Independent check at head
No coverage is dropped. This is an author-independent check, not maintainer acceptance. Reviewed by James Reed with substantial Anthropic Claude (Claude Code) 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 mathematical scope
Reduces the full downset proof replay from 19.814 to 16.715 seconds in a final local comparison, about 16% less time, by replacing repeated Fraction operations in matrix multiplication with scaled integer dot products. Every original scientific evidence field and rejection-witness count stays equal. This is a verifier runtime improvement; the proof and complete kappa calculation do not change.
Arithmetic identity and evidence, implementation and direct product oracle, and unchanged source pins.
Each row of the left matrix and each column of the right matrix is scaled by its denominator LCM. Their dot product uses integers, then one Fraction reduction per output. There is no cache or floating point arithmetic. The valid rectangular rational input contract and fixed matrix capacities are unchanged.
Task and overlap
Takes the non-caching multiplication follow-up from PR #4947. Base:
f259dabc7d70e0db8d6d36bfda888f008bbfecc1, priority 7. That main-branch file still contains the original inverse algorithm. This PR leaves it unchanged; the timing comparison is against those exact main bytes, not PR #4947's inverse-cache version. The original package metadata, frozen proof README and historical provenance pins remain byte-exact. Runtime notes are in a separate file because the Full-allocation package authenticates the proof document.The final search covered 300 open PRs, 4,098 Discussion records and 69 of 6,710 local notes. It found the separate inverse-cache and Full-allocation work. Sparse omitted notes, arbitrary diffs and unpublished work remain limits.
Validation
CPython 3.12.13, standard library:
Expected: both commands print
PASS_DOWNSET_BLOCK_SOLVE, followed byPASS_REGISTERED_RESEARCH_PACKAGE. Normal and optimized replay passed. All original counts remain equal: 46 trees, 2,380 states, 9,520 matrix identities, 23,504 spectral certificates, 9,372 partition blocks and eleven original control groups. The addedproduct_controls: 93field records signed/zero/rectangular Fraction-oracle comparisons, ownership/type checks and invalid-input controls. Four actual arithmetic mutations fail against that oracle.Both registered normal/optimized replays also passed for the dependent Full-allocation package (63 contracts, six fixtures, 24 trajectories and seven controls). Its frozen source bindings are unchanged.
Expected:
PASS_FULL_DOWNSET_ALLOCATION actual_factory_same_stored_inverse no_new_kappaandPASS_REGISTERED_RESEARCH_PACKAGE.Exact source-pin checks, committed-byte checks for both packages and Git-free read-only optimized export replay passed. The full-history wrapper was not run in this shallow checkout; all four historical blob/SHA-256 pins were checked directly. No selected cold replay, Lean, Docker or archive-wide sweep ran.
Timing uses sequential full subprocess replays on the same shared macOS host. Two earlier trials measured 19.488/21.431 seconds before and 16.765/16.696 seconds after; the final pair includes the new controls. This is local timing evidence, not a cross-platform guarantee.
Credit
Nick Petalas supplied the mathematics, fixtures and original checker; see the original source notice. Brian (JoyboyBrian) identified the remaining product bottleneck in PR #4947. Their predecessor credits are retained. Prepared for Ali Romman with substantial OpenAI Codex assistance; Apache-2.0.
Open next questions
The effect when combined with the separate inverse-cache implementation has not been measured. Other rational verifiers need their own bottleneck profile and exact equivalence checks before using this change.