Skip to content

perf(groebner): use additive monomial hashes - #11045

Merged
kim-em merged 4 commits into
mainfrom
groebner-additive-hash
Nov 9, 2026
Merged

kim-em merged 4 commits into
mainfrom
groebner-additive-hash

Conversation

@kim-em

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

Copy link
Copy Markdown
Owner

This PR replaces the FNV monomial hash with an additive hash: each coordinate has a fixed 64-bit weight and a monomial's hash is the weighted sum of its exponents. Product degrees, support masks and full-width hashes then combine from the two factors' cached metadata instead of being recomputed coordinate by coordinate, in both the portable MonomialTable path and the bounded native product batches. Hashes only select collision chains; every successful lookup still compares all exponents, so monomial identity, outputs and the reference/native equivalence are unchanged. Reduced-width hash tables keep their full prepared workspace hash.

Charged work changes only where collision-chain visits change, so the F4 conformance fixture's statistics are regenerated. All HexGroebner conformance modules build, the emitted F4 fixture matches the committed one, and its 567 reduced bases match SymPy 1.14.0 and Singular 4.4.1.

On the first-size selection (all ten families in three fields plus Eco-14/Eco-15 over F₂), frozen adjacent AB/BA campaigns against the main build, with MIMALLOC_ALLOW_THP=0 in both arms, give candidate/process ratios of 0.9991/0.9632 in the first campaign, which is inconclusive, and 0.9338/0.9450 in the one permitted unchanged repeat. Pooled, they are 0.9659/0.9541. All 128 pairs have identical complete bases and identical counters other than work. This supports a modest improvement only. reports/bench-results/hexgroebner-additive-hash.md is recomputed by scripts/bench/groebner_additive_report.py from the retained capsule f4-additive-02a5eb690462.

Continues #10987.

🤖 Prepared with Claude Code

Kim Morrison and others added 3 commits November 9, 2026 07:34
Two adjacent AB/BA campaigns (the first inconclusive, then the single
permitted unchanged repeat) against the frozen main build. All 128 pairs
have identical bases and counters other than the charged work. The report
is recomputed from the retained capsule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kim-em
kim-em marked this pull request as ready for review November 9, 2026 11:07
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kim-em
kim-em enabled auto-merge (squash) November 9, 2026 11:27
@kim-em
kim-em merged commit 235dbd7 into main Nov 9, 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