Repository navigation
Fix non-termination of the lifting of the parametrization with -L 1 - #417
Open
jerebertho wants to merge 2 commits into
Open
jerebertho wants to merge 2 commits into
jerebertho wants to merge 2 commits into
Conversation
With -L 1, once the multiplication matrix is lifted, the next primes skip F4. But the primes of the batch in which the lifting completes (or the batch right after, when it completes on the last prime of a batch) have already run F4, and only one of them was checked against the lifted matrix: the images of the others entered the CRT unchecked. If the lifted matrix is wrong (e.g. all its primes divide some coefficient of the input, which can be forced with a fixed seed), these images are mixed with images computed from the wrong matrix, and the rational reconstruction never succeeds: msolve does not terminate (with -t 2 and more). Now every prime that ran F4 while the matrix or the linear forms are lifted is checked against them; on a mismatch, -L is given up (all images obtained so far come from F4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
With
-L 1, the lifting of the parametrization over QQ (msolve_trace_qq) may notterminate when the lifted multiplication matrix is wrong. This PR checks the lifted data
against every prime that ran F4 and gives up
-Lon a mismatch. It does not change theoutputs.
Once the multiplication matrix (and the linear forms) are lifted over QQ, the next primes
skip F4 and get their matrix by reduction of the lifted one. But the primes of the batch
in which the lifting completes (or of the next batch, when it completes on the last prime
of a batch) have already run F4. Only one of them was checked against the lifted matrix
(
check_matrix), and the images of the others entered the CRT unchecked. If the liftedmatrix is wrong, the images obtained from it are then mixed with correct images, and no
rational number can agree with all of them: the rational reconstruction never succeeds.
Each prime passes its own checks, so no bad prime is counted and nothing stops the loop.
A wrong lifted matrix is very unlikely with random primes, but with a fixed seed the
primes are known in advance. Adding to a constant term of the input the product of the
first primes that msolve draws makes the input coincide with the original one modulo all
of them. For Katsura-8 (
input_files/kat8-qq-truncate.ms,-P 2 -L 1 --random-seed 7),adding the product of the first 14 primes (about 420 bits) makes master loop with
-t 2and
-t 3, and the product of the first 15 to 18 primes (up to 543 bits) makes it loopwith
-t 3, while the actual computation takes 3 s. With-t 1, and whenever all theprimes in flight divide the product, master returns the parametrization of the original
system instead: this wrong output is expected with a fixed seed, with or without
-L.Now every prime that ran F4 while the matrix or the linear forms are lifted is checked
against them (
check_lifted_data; coefficients whose denominator vanishes modulo theprime are skipped). On a mismatch,
-Lis given up for the rest of the computation (allprimes run F4 again); since no image has been computed from the lifted data yet, nothing
has to be discarded. The images then all come from F4 or all agree with the lifted
matrix, so they are the reductions of a single parametrization and the lifting
terminates. The output is then the one of the call without
-L, and the verbose outputshows
<-L given up>.On the trapped Katsura-8 inputs,
-t 2and-t 3now terminate, with the output of thecall without
-L. On the input files with-P 2 -L 1,-P 2,-L 1,-P 1 -L 1and thedefault call, with
-t 1and-t 3, all outputs are identical to master (870 runs), and-Lis never given up (172 runs with-P 2 -L 1, 20 of them with the matrix lifted).make checkpasses, and AddressSanitizer reports no error.This branch also contains a commit that raises the CI time-out to 30 minutes, see PR#416.