Skip to content

test: restore inverse_of_R value checks across depwarn modes - #622

Merged
ChrisRackauckas merged 4 commits into
SciML:masterfrom
ChrisRackauckas-Claude:test/gek-deprecated-binding
Oct 16, 2026
Merged

ChrisRackauckas merged 4 commits into
SciML:masterfrom
ChrisRackauckas-Claude:test/gek-deprecated-binding

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Under --depwarn=error, the deprecated getter cannot return a value, so the original Rinv = @test_deprecated …; @test Rinv * Matrix(R_fact) ≈ I errored. Nesting the identity inside @test_deprecated (or replacing it with inv(R_fact) ≈ I) either skipped the identity or stopped checking the shim's return. These tests now: (1) under depwarn != error, assign Rinv = @test_deprecated … and assert Rinv * Matrix(R_fact) ≈ I; (2) under depwarn == error, @test_throws ErrorException on the getter; (3) in every mode, assert Surrogates._deprecated_inverse_of_R's return is still R⁻¹ (via a --depwarn=no subprocess when the in-process shim cannot return). Serialization is declared in [extras] / [targets].test / [compat] so Pkg.test can load test/testutils.jl.

Verification

Pkg.test() (runtests temporarily limited to GEK + Kriging safetestsets; restored afterward):

julia --project=. --depwarn=yes -e 'using Pkg; Pkg.test()'
GEK     |  273    273  40.8s
Kriging |  153    153  27.5s
Testing Surrogates tests passed
EXIT_CODE=0

julia --project=. --depwarn=error -e 'using Pkg; Pkg.test()'
GEK     |  272    272  44.1s
Kriging |  152    152  32.9s
Testing Surrogates tests passed
EXIT_CODE=0

Earlier (round 3): shim mutated to return 2 .* inv(...) failed under yes/no/error; clean shim passed. Count difference by mode is intentional (getter return cannot be observed under --depwarn=error).

Not verified: full GROUP=Core without reducing runtests, QA, GitHub Actions on this tip.

Please ignore this draft until reviewed by @ChrisRackauckas.

Risk assessment

  • Risk: low
  • Blast radius: test-only; GEK/Kriging deprecated-property checks, a shared test helper, and declaring Serialization as a test dependency. No public API change.
  • Evidence: real Pkg.test() green for GEK/Kriging under --depwarn=yes (273/153) and --depwarn=error (272/152); mutated-shim failures shown in prior round.
  • Independent review: Claude Code (claude-opus-5-5), rounds 3-5. Round 3 found the deprecated getter was no longer tested; round 4 found Serialization undeclared for Pkg.test; round 5 on 2fe28d6: MERGE.
  • Merge: needs human review while independent review is pending.

Cursor Agent CLI 2026.10.01-14929f9 (model: auto); transcript: /home/crackauc/sandbox/goals/qa-hygiene/jobs/surr-622-fix/log.txt

Independent review: Devin Fusion (fusion-claude-opus-5-5-high-sidekick-swe-2-medium) rated it low, verdict MERGE: #622 (comment)

ChrisRackauckas and others added 2 commits October 3, 2026 07:34
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.160.0
Agent-Model: gpt-6-luna
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/qa-hygiene/jobs/surr-fixes/log.txt on amdci2
Under --depwarn=error, @test_deprecated becomes @test_throws and never
runs assertions nested in the begin block. Keep the deprecation check
separate and evaluate inv(R_fact) ≈ I so the identity runs in every mode.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/qa-hygiene/jobs/surr-622-fix/log.txt on amdci2
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title test: keep deprecated inverse assertions valid with depwarn errors test: assert inverse identity outside deprecated getter Oct 3, 2026
Keep the getter return assertion under depwarn≠error, throw under
depwarn=error, and always check Surrogates._deprecated_inverse_of_R's
return (via a --depwarn=no subprocess when the in-process shim cannot
return) so a broken shim fails in every mode.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/qa-hygiene/jobs/surr-622-fix/log.txt on amdci2
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title test: assert inverse identity outside deprecated getter test: restore inverse_of_R value checks across depwarn modes Oct 7, 2026
Pkg.test only loads declared extras; testutils.jl uses Serialization for
the --depwarn=error shim subprocess, so Core was erroring on include.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/qa-hygiene/jobs/surr-622-fix/log.txt on amdci2
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Devin CLI 3000.11.3, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium): MERGE, risk low.

Full review

VERDICT: MERGE
RISK: low

Test-only change. It touches test/GEK.jl, test/Kriging.jl and test/testutils.jl, and adds the stdlib Serialization as a test-only dependency. No src/ or public API change. I confirmed by running that master's inverse_of_R testsets error under --depwarn=error, that the PR fixes this, and that a broken shim is still caught in every depwarn mode.

Blocking findings

None.

Non-blocking findings

  1. The extra helper call repeats a check when depwarn is not error, and it prints an uncaptured deprecation warning (confirmed by running). test/testutils.jl:109-112 calls Surrogates._deprecated_inverse_of_R directly. In the else branch at test/GEK.jl:263-264 and test/Kriging.jl:322-323, the getter's return value has already been checked against I, and the getter is just s === :inverse_of_R && return _deprecated_inverse_of_R(...). So the helper adds no coverage there.
    • Under --depwarn=yes, the direct call writes a second Kriging.inverse_of_R is deprecated / GEK.inverse_of_R is deprecated warning to the test log. The warning shows caller = ip:0x0 @ Core :-1. See scratch/log_pr_Kriging_yes.txt lines 1-3.
    • Suggested change: call check_deprecated_inverse_of_R_value only in the depwarn == 2 branch, or move the whole three-way branch into the helper.
  2. The subprocess branch is a lot of machinery for a mode CI never runs (suspected from reading; CI mode confirmed from reading the config and Pkg source).
    • Pkg passes --depwarn=error to tests only when the parent julia was started with it: Pkg/Operations.jl, --depwarn=$(Base.JLOptions().depwarn == 2 ? "error" : "yes").
    • .github/workflows/Tests.yml uses SciML's grouped-tests.yml, which does not set depwarn to error. CI therefore always takes the else branch, where the getter's return value is already checked.
    • The roughly 30-line serialize-and-spawn path, and the new Serialization test dependency, exist only so the identity check also runs under a local --depwarn=error run.
    • It works (mutation results below), and @test success(p) fails loudly if the subprocess cannot load Surrogates, so there is no silent fallback. Still, @test_throws ErrorException alone in the error branch would be a smaller change that covers the motivating failure.
    • This is a judgement call for the maintainer, not a defect.
  3. Project.toml:94: Serialization is placed in [extras] between SafeTestsets and SciMLTesting. Every other entry is alphabetical, so it belongs after SciMLTesting. [compat] and [targets] are fine. Cosmetic.
  4. The branch has 4 commits; the first two (3527531, c3b770f) contain approaches that the later commits replace. Squash on merge.
  5. The PR links no issue, so I had no parent or tracking issue to check sibling work against.
  6. The PR body does not open with the attribution banner required by ~/.claude/CLAUDE.md. It has only "Please ignore this draft until reviewed by @ChrisRackauckas" near the end, plus a harness/model/transcript line. The commit trailers are complete. The model is recorded as auto, which is what Cursor reports.
  7. On CI, both benchmark jobs show as failed. gh run list shows that run as cancelled at about 30 min (https://github.com/SciML/Surrogates.jl/actions/runs/37684723756), and earlier benchmark runs on this branch succeeded. A test-only diff cannot change benchmark results, so this is infrastructure. All test, QA, docs, Runic and typos checks pass.

What I ran

All runs used julia +1.11 (1.11.9). For the per-file runs I used a scratch env with scratch/pr dev'd plus Test, ForwardDiff, Statistics, Serialization and LinearAlgebra. scratch/master and scratch/pr are git archive copies; src/ is identical between them.

  • Bug reproduction on master (confirmed by running):

    • julia --depwarn=error master/test/GEK.jl exits 1.
    • julia --depwarn=error master/test/Kriging.jl exits 1, with MethodError: no method matching *(::Test.Pass, ::Matrix{Float64}) at Rinv * Matrix(k.R_fact) ≈ I. Under --depwarn=error, @test_deprecated returns a Test.Pass.
    • Under --depwarn=yes and --depwarn=no, master passes.
  • PR test files in each of --depwarn=yes|no|error (confirmed by running): pr/test/GEK.jl and pr/test/Kriging.jl exit 0 in all six runs.

    • The inverse_of_R testset counts are 3/2/2 (yes/no/error).
    • Under error, the subprocess testset "deprecated inverse shim value" reports 1 pass.
  • Mutation probes. The probe file holds the PR's two testsets verbatim plus the file headers. I edited _deprecated_inverse_of_R in the scratch copy only, then restored it and checked with diff.

    Mutation yes no error
    clean pass pass pass
    return 2 .* inv(...) FAIL (getter check + helper) FAIL (getter check + helper) FAIL (subprocess test failed → @test success(p) failed)
    Base.depwarn removed FAIL (@test_deprecated log test) pass (expected; same as master) FAIL (@test_throws got no exception)

    A wrong return value is caught in every mode, and a missing deprecation is caught wherever it can be observed.

  • Pkg.test path (confirmed by running). In scratch/pr, with test/runtests.jl replaced by @safetestset GEK + Kriging, I ran julia --project=. --depwarn=error -e 'using Pkg; Pkg.test()'. Result: GEK 272/272, Kriging 152/152, "Surrogates tests passed". This matches the PR body's numbers. It also confirms that the Serialization declaration and the subprocess's --project=Base.active_project() (Pkg's temporary sandbox) work.

  • Base.julia_cmd() under --depwarn=error includes --depwarn=error. The helper appends --depwarn=no after it, and the subprocess passing shows the later flag wins.

  • julia +1.12 --project=@runic -m Runic --check on the three test files exits 0. git diff origin/master...HEAD | typos - exits 0.

  • gh pr checks 622 and gh run list --workflow benchmark.yml.

  • No Julia processes were left running.

What I did not verify

  • The PR's --depwarn=yes Pkg.test numbers (273/153). I ran the files directly under yes instead, which passed.
  • The full GROUP=Core or GROUP=QA suites locally. CI on this tip reports Core (lts, 1, x86, pre) and QA as passing; the "pre" job finished in 38 s, which I did not look into.
  • Whether the rest of the test suite passes under --depwarn=error. The PR does not claim it does.
  • Julia 1.10 (lts) locally; CI covers it.

🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (review), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium
Conversation: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master)

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review October 16, 2026 03:19
@ChrisRackauckas
ChrisRackauckas merged commit 23cacf4 into SciML:master Oct 16, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants