Skip to content

Reduce ECM traversal and Tonelli-Shanks setup overhead - #22

Merged
jwood000 merged 1 commit into
mainfrom
simple-gmp-updates
Dec 5, 2026
Merged

jwood000 merged 1 commit into
mainfrom
simple-gmp-updates

Conversation

@jwood000

@jwood000 jwood000 commented Dec 5, 2026

Copy link
Copy Markdown
Owner

Replace the big-integer mask walk in ecm_multiply() with descending mpz_tstbit() calls. Preserve the scalar-bit order, curve calculations, and search behavior while removing two unused scratch variables. We also use mpz_legendre() instead of repeated Euler-criterion exponentiation to identify the first quadratic nonresidue. Preserve the selected candidate, returned roots, and subsequent root iterations.

Validation:

  • Added a fixed serial/parallel factorization regression checking exact factors and reconstruction.
  • Coverage includes unreduced inputs, all odd-prime residue classes modulo eight, and prime moduli up to 101 digits.
  • Existing serial/parallel MPQS regressions passed.

Read ECM scalar bits directly instead of updating multiprecision masks.
Use GMP's Legendre symbol for the Tonelli-Shanks nonresidue search,
preserving curve calculations and selected roots. Add manual native
regression checks and exact ECM factor tests for serial and parallel
execution.
@jwood000
jwood000 merged commit 535c042 into main Dec 5, 2026
20 of 21 checks passed
@codecov

codecov Bot commented Dec 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.34%. Comparing base (6ff4e51) to head (7d27515).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
+ Coverage   92.21%   92.34%   +0.13%     
==========================================
  Files          18       18              
  Lines        1593     1581      -12     
==========================================
- Hits         1469     1460       -9     
+ Misses        124      121       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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