Repository navigation
perf(groebner): vectorize wide-prime delayed elimination - #11043
Merged
Merged
Conversation
added 10 commits
November 6, 2026 02:31
13 tasks
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.
Wide-prime delayed elimination spends most of its time gathering four accumulator cells and storing each updated lane separately. Add an exact eight-lane AVX-512F route with CPU/OS capability checks, contiguous vector loads/stores, indexed gather/scatter otherwise, and AVX2 handling for short rows. Unsupported hosts retain the existing fallbacks. Logical work, budgets, row order and counters are preserved.
The new route keeps each accumulator below p² using one correction: every intermediate is below 2p² < 2⁶³. Protected-page tests call the production routine across three wide primes, contiguous/strided indices and packet/tail lengths, with mixed corrected/uncorrected lanes and exact p² boundary sums. The eight-lane route is selected at runtime independently of the existing opt-in sixteen-lane scan route, which remains disabled in these measurements.
Matched single-thread evidence retains all 128 processes/64 equal complete-output pairs, 24 matched kernel observations, targeted Reimer-8 comparisons and 108 held-out processes/54 equal bases. Reimer-8 M31 candidate-time ratios are 0.8217 and 0.8346; contiguous kernel ratios improve about 2–3%. The held-out family-balanced Hex/msolve process ratio is 1.0627. Unchanged-field controls show host variation; no control-adjusted improvement or fastest-open-source claim is inferred. Candidate production excludes certificate generation, independent certification and kernel checking.
Retain the earlier gather-only implementation and its contiguous regressions. Its held-out run stopped after 72 processes when the disk filled; raw results and the unavailable exact-duration metadata are documented explicitly. Fix the collector to journal exact samples and atomically checkpoint metadata, with disk-full regression tests.
Validation: HexGroebner/HexGroebnerTheory builds, all nine project checks, 36 strict Clang/GCC sanitizer configurations, both complete 1,134-case drivers, independent oracles, downstream replay and axiom audits. A manual source-bound report replay passed against the final verification sources. The separate verification capsule binds all nine project gates and all 36 strict sanitizer configurations to the identical measured runtime; its SHA-256 is
75bc9b5a1e9cf45aa633a505c12fde0010a246197723ad4813311aac05edf100. Historical wide-prime report replay is included in the existing oracle job. The README explicitly documents default delayed AVX-512F dispatch independently of the opt-in sixteen-lane sparse scan. Rebase onto main preserves the exact measured runtime and verification source listings.See
reports/bench-results/hexgroebner-wide-prime.mdandhexgroebner-wide-prime-experiments.md, andhexgroebner-wide-prime-validation.mdfor raw archive indexes, full output comparisons, compiler identities, memory, flags and limitations. Scientific samples were collected manually on the shared host.Continues #10987; correctness/finite-field/full balanced and parallel acceptance obligations remain open.