Commit eb28764
Fix false-positive in check_primality on degenerate specialization
check_primality(polys, extra_relations) substitutes the non-leader
variables of each generator with random integers, then tests whether the
characteristic polynomial of a generic multiplication operator on the
resulting zero-dimensional quotient is irreducible. The random
specialization could land on a point where a generator's leading
coefficient (w.r.t. its leader) vanishes, dropping that generator's degree
in its leader. When every generator collapses to degree 1, the quotient
ring becomes 1-dimensional, its charpoly is a degree-1 (hence trivially
irreducible) polynomial, and the routine reports the ideal as prime even
when it is not.
This is a soundness bug: for the io_projections issue-#132 case the ideal
is not prime, yet ~6/500 RNG seeds drove check_primality(proj) to return
true. It surfaced as a master red on the julia-pre (1.13.0-rc1) Core lane,
whose changed global-RNG stream happened to hit such a draw at
test/bodies/io_projections.jl:55 (`@test !check_primality(proj)`).
Fix: only accept random specializations that preserve every generator's
degree in its leader, i.e. that stay on the open set where the leading
coefficients do not vanish (the set the ideal is implicitly saturated at,
per the docstring). Resample otherwise, with a bounded retry. The
extra_relations are evaluated at the same point, matching the previous
behavior.
Verified on Julia 1.13.0-rc1: false-positive rate over seeds 0..499 drops
from 6/500 to 0/500; io_projections body 10/10 (was 9/1); positive case
check_primality(proj, [projection_poly]) 50/50 true. No regression on Julia
1.12: io_projections 10/10, check_primality_zerodim 5/5.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent fae1e4a commit eb28764
1 file changed
Lines changed: 29 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
68 | 93 | | |
69 | 94 | | |
70 | 95 | | |
| |||
0 commit comments