Repository navigation
Conversation
The exact sparse-dense linear algebra (-l 1) does not record a trace, but F4 learned and applied the tracer with it, as with every option below 40. The trace stayed empty, so for the next primes F4 stopped after the input generators and reduce_final_basis read uninitialized basis elements. Do not use the tracer with -l 1, as is already done for the probabilistic linear algebra (-l 42, 44). Fixes algebraic-solving#378 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.
Fixes #378.
Over the rationals,
initialize_f4turns on the tracer for everylaopt < 40, and that includes-l 1. The exact sparse-dense linear algebra never records a trace, so the learned trace is empty. For the next primes, F4 stops after the input generators, andreduce_final_basisthen reads uninitialized basis elements and crashes.The issue lists several possible fixes. This PR takes the smallest one, which follows an existing precedent: the tracer is not used with
-l 1, the same as for the probabilistic linear algebra (-l 42,-l 44). It is a one-line change (laopt > 1 && laopt < 40).-l 1keeps its own linear algebra, but over the rationals it does not get the speedup from tracing. Recording a trace in the sparse-dense linear algebra (in all three bit widths) would keep that speedup, but it is a much bigger change. I left it out of this PR.Test
New
test/diff/diff_bug-sparse-dense-la-qq.shrunscyclic5-qqwith-l 1,-g 2and the default parametrization (-P 2 -d 4 -L 0), each with-t 1and-t 2. It compares the output with the existingoutput_files/cyclic5-qq.g2.resandcyclic5-qq.P2.d4.res.EXIT: 1, and AddressSanitizer reports a heap-buffer-overflow inreduce_final_basis.Other checks, all on an AddressSanitizer build (
-O1 -g -fsanitize=address, FLINT 3.6, Ubuntu 24.04):cyclic5-qq,eco6-qq,elim-qq,henrion5-qq,kat7-qq,multy-qq,radical-shape-qq,nonradical-shape-qq,nonradical-radicalshape-qq,nonradical-radicalshape-no-square-qq,choice-linear-form-qq,groebner-g2) with-l 1and with-l 2, both with-g 2and with the default output, using-t 1and a fixed seed. Every run exits 0, and every-l 1output is byte-identical to the-l 2output.make check: all 108 existing tests pass. The new test also passes when run throughmake checkafter regenerating the Makefile.AI use: Claude Code (Claude Opus 5.5) wrote the change and the test and ran the checks above. The commit has Claude as co-author.
🤖 Generated with Claude Code