test(fields): add Mersenne31 regression coverage#260
Draft
adrienlacombe wants to merge 5 commits into
Draft
Conversation
🤖 PR SummaryTest / Regression Coverage
Infrastructure / CI
Refactoring
Remarks
Statistics
Lean Declarations ✏️ Removed: 3 declaration(s)
✏️ Added: 114 declaration(s)
📋 **Additional Analysis**The diff restructures the Mersenne field implementation, replacing the single-file 📄 **Per-File Summaries**
Last updated: 2026-07-20 09:49 UTC. |
Add guards for positive subtraction, negation, square, power edge cases, division, inverse products, int powers, and ringEquiv on multiplication. Use a flat Mersenne31.Fast namespace consistent with KoalaBear.Fast tests. Co-authored-by: Cursor <cursoragent@cursor.com>
adrienlacombe
force-pushed
the
feat/pr257-mersenne31-tests
branch
from
July 20, 2026 09:47
6e4f165 to
51a0180
Compare
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.
Summary
Adds a small regression-test layer on top of #257's Mersenne31 implementation.
Changes
CompPolyTests.Fields.Mersenne31.Mersenne31.Basicprime, field, andNonBinaryFieldinstances.Mersenne31.Fastfield surface and representative/canonical conversion behavior for a few arithmetic paths.CompPolyTests.Validation
lake build CompPolyTests.Fields.Mersenne31lake build CompPolyTests./scripts/lint-style.py tests/CompPolyTests/Fields/Mersenne31.lean./scripts/lint-style.sh./scripts/check-imports.shlake testStack note
This PR is intended as companion regression coverage for #257. The upstream repository does not currently have the fork PR's base branch
pr257-mersenne31-base, and I do not have permission to push that branch toVerified-zkEVM/CompPoly, so this draft is temporarily opened againstmaster. As a result, GitHub's raw diff includes the #257 implementation commits in addition to this PR's two test-file changes.The additive test diff relative to
adrienlacombe:pr257-mersenne31-baseis:tests/CompPolyTests.leantests/CompPolyTests/Fields/Mersenne31.lean