Skip to content

perf(groebner): vectorize wide-prime delayed elimination - #11043

Merged
kim-em merged 10 commits into
mainfrom
issue-10987
Nov 6, 2026
Merged

kim-em merged 10 commits into
mainfrom
issue-10987

Conversation

@kim-em

@kim-em kim-em commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

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.md and hexgroebner-wide-prime-experiments.md, and hexgroebner-wide-prime-validation.md for 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.

@kim-em
kim-em merged commit 6134cc4 into main Nov 6, 2026
1 check 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.

1 participant