Repository navigation
test: expect sparse dot(x, A, y) to work on Julia versions with LinearAlgebra.jl#1842 - #332
Merged
Merged
Conversation
DilumAluthge
marked this pull request as ready for review
November 20, 2026 02:55
DilumAluthge
force-pushed
the
dpa/dot-sparse-version-check
branch
from
November 20, 2026 02:59
b8e242e to
0ded45f
Compare
Member
Author
|
This is ready to review and merge. |
DilumAluthge
force-pushed
the
dpa/dot-sparse-version-check
branch
from
November 20, 2026 03:13
0ded45f to
7f6f703
Compare
…earAlgebra.jl#1842 JuliaLang/LinearAlgebra.jl#1842 removed the `iszero(y[j])` check from the generic `dot(x, A, y)`. With a `SparseVector` `x`, `dot(x, A, y)` falls back to that method, and on tracers without primal values the `iszero` call threw `MissingPrimalError`. Without the check, `dot(sx, tA, ty)` and `dot(sx, rA, ty)` now succeed, and the `@test_throws` tests fail. The change is in Julia 1.10.14, 1.13.4 and 1.14.0-beta1, and will reach master (1.15.0-DEV) with its next LinearAlgebra bump. Move the two tests into their own testset, test them with `@test_nowarn` on those versions (including their -DEV builds) and later, and keep the `@test_throws` tests on older versions. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
DilumAluthge
force-pushed
the
dpa/dot-sparse-version-check
branch
from
November 20, 2026 03:18
7f6f703 to
f2e77a1
Compare
This was referenced Nov 20, 2026
Member
Author
|
Also, this PR is at the top of the stack, and CI is all green here. |
adrhill
approved these changes
Nov 20, 2026
adrhill
left a comment
Collaborator
There was a problem hiding this comment.
Thanks a lot, I'll trust you on the bounds. :)
Collaborator
|
Tagged a new |
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.
Dilum's PR description:
I discovered this while running PkgEval on Julia 1.10.13 vs the upcoming 1.10.14.
These two calls no longer throw an exception, thanks to JuliaLang/LinearAlgebra.jl#1842.
So this PR fixes the tests. Specifically, we no longer expect an exception if we are running with a Julia version that has JuliaLang/LinearAlgebra.jl#1842. If our Julia version doesn't have JuliaLang/LinearAlgebra.jl#1842, then we continue to expect an exception.
🤖 Assisted-by: Claude Code:claude-opus-5-5
🤖 Claude Code PR description: (click to expand)
Before
JuliaLang/LinearAlgebra.jl#1842 (a fix for JuliaLang/LinearAlgebra.jl#1836) removed the
if !iszero(yj)check from the genericdot(x, A, y). Intest/test_arrays.jl,sxis aSparseVector, sodot(sx, tA, ty)anddot(sx, rA, ty)fall back to that generic method. With the check in place, theiszerocall on a tracer without a primal value threwMissingPrimalError, and the tests asserted that. Without the check, both calls succeed, and the two@test_throws MissingPrimalErrortests fail. PkgEval found this on the Julia 1.10.14 backports (JuliaLang/julia#64473). It also already happens on the released Julia 1.13.4, so the CI job on1will hit it.Change
Move the two tests into their own
JuliaLang/LinearAlgebra.jl#1842testset, and pick the expected behavior fromVERSION:@test_nowarn. Those versions are 1.10.14 and later 1.10 patch releases, 1.13.4 and later 1.13 patch releases, and 1.14.0-beta1 and everything after it.@test_throws MissingPrimalErrortests.The lower bounds include prereleases, so
-DEVbuilds such as 1.10.14-DEV, which PkgEval tests, get the new behavior.After
Dottestset passes on Julia 1.13.4 (new behavior) and 1.10.13 (old behavior): 46/46 locally on each.Not part of this PR:
test/Project.tomlallows only JET 0.9, 0.10 and 0.11, none of which can be installed on Julia 1.13, so the1CI job may fail while resolving the test environment, independently of this change. That is fixed in #333, below this PR in the stack. I checked this change on 1.13 by runningtest/test_arrays.jlin an environment without JET. I didn't add aCHANGELOG.mdentry or bump the version; that's for the maintainers to decide.The Invalidations check failure is likely unrelated: it fails the same way (2 more invalidations, all via dependencies) on test-only PRs such as #331.