Skip to content

Commit

Permalink
for issue #3488 -- avoid corruption of internal ideal data (#3536)
Browse files Browse the repository at this point in the history
* avoid corruption of internal ideal data (persisting information on a Singular ring), when normalization had been called for a normal ring
  • Loading branch information
afkafkafk13 authored Mar 21, 2024
1 parent 7c668a8 commit 1678b0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Rings/mpoly-affine-algebras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1302,11 +1302,13 @@ function _conv_normalize_alg(algorithm::Symbol)
end

function _conv_normalize_data(A::MPolyQuoRing, l, br)
# Note: The ugly construction of newAmap is due to the need to avoid
# inheriting corrupted internal data of the ideal
return [
begin
newSR = l[1][i][1]::Singular.PolyRing
newOR, _ = polynomial_ring(br, [string(x) for x in gens(newSR)])
newA, newAmap = quo(newOR, ideal(newOR, l[1][i][2][:norid]))
newA, newAmap = quo(newOR, ideal(newOR, newOR.(gens(l[1][i][2][:norid]))))
set_attribute!(newA, :is_normal=>true)
newgens = newOR.(gens(l[1][i][2][:normap]))
_hom = hom(A, newA, newA.(newgens))
Expand Down
8 changes: 8 additions & 0 deletions test/AlgebraicGeometry/Schemes/AffineSchemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,12 @@ end
N3 = normalization(X3)
@test all(is_smooth(i[1]) for i in N3)
@test length(N3) == 2

# data corruption bug, throws an error if bug reappears
P,(a,b) = polynomial_ring(QQ,[:a,:b])
I = ideal(P,a^2-b)
Q = normalization(quo(P,I)[1])[1][1]
R = base_ring(Q)
J = ideal(R, R[1])
Sat = saturation(modulus(Q),J)
end

0 comments on commit 1678b0d

Please sign in to comment.