Repository navigation
PPC64LE FFDH parameter candidates: q's trial division before p's whole - #4684
Merged
Merged
Conversation
alex
force-pushed
the
claude/ppc64le-ffdh-residue
branch
from
November 8, 2026 20:22
14275dd to
80ce837
Compare
alex
force-pushed
the
claude/ppc64le-ffdh-order
branch
2 times, most recently
from
November 8, 2026 20:28
4632a48 to
e27fee6
Compare
|
This pull request has conflicts with Posted by |
Most candidates that pass the congruence and p's first trial divisions fail on q, and a small factor of q (p ≡ 1 mod s) was found only after p's whole trial division. Now p is divided by the table's first 16 entries (trialSieveN), then q by all of them, and only then, with p loaded again (MB.reshape), p by all of them. trialSieve's proofs take the count as a parameter (MB.countN, trialSieveN_ok, trialRest_ct), and trialPrefix_mono drops the first entries' check from the shape's conjunction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHGTYqNsecxgCdT9ZaD
alex
force-pushed
the
claude/ppc64le-ffdh-order
branch
from
November 8, 2026 20:53
e27fee6 to
e08ace0
Compare
alex
marked this pull request as ready for review
November 8, 2026 20:54
This was referenced Nov 9, 2026
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.
#4660 and #4677 have merged. This is the third step on finding 3 of the PPC64LE audit, and it is x86-64's "sieve p's first primes before q's".
What it changes
After #4677, g = 5 still spent most of its time in trial division. Its congruence passes 2/5 of odd candidates. For each small prime s, a third of them have p ≡ 1 (mod s), which means s divides q. That was found only after p's whole trial division, which such a p usually survives.
mainnow runs:trialSieveN firstEntries);mainQ);shapeP), p's whole trial division (mainP);Each step stops at the first divisor.
Proof
Trial.lean:MB.trialAandMB.loopArgstake the count as a parameter. AddedMB.countNandtrialSieveN_ok.Main.lean: addedMB.reshape(p in array 0 again) andtrialPrefix_mono(the whole division implies the first 16).main_okfollows the new flow.CTMain.lean:MnC,MnT,MnL,MnEandtrialGotake the count as a parameter (trialRest_ct). AddedtrialSieveN_ct,reshape_ct,mainP_ctand the conditionspOk,qOkandallOk. Each one is a function of the public candidate.No TCB or spec change. No Rust change.
Checks
lake build: everything.Emit.lean: in full, onlyvg_ffdh_parameter_candidate_sievedchanges.check_lean_public_imports.pyon the edited modules.Static checkssteps.Benchmark
Benchmarks run 42514854733: powerpc64,
modules=ffdh,groups=ffdh_parameters_g(2|5), base 14275dd = #4677's head. Medians:ffdh_parameters_g2/64ffdh_parameters_g5/64The three PRs together, from
mainbefore #4660:main🤖 Generated with Claude Code
https://claude.ai/code/session_01TKUFHGTYqNsecxgCdT9ZaD