Skip to content

Index lowered SteadyStateProblem solutions through their own container - #1657

Merged
AayushSabharwal merged 2 commits into
masterfrom
as/fix-ci
Nov 2, 2026
Merged

AayushSabharwal merged 2 commits into
masterfrom
as/fix-ci

Conversation

@AayushSabharwal

Copy link
Copy Markdown
Member

Green CI is good CI

`solve(ssprob, DynamicSS)` now returns a solution expressed on the
`SCCNonlinearProblem` that MTK stores as `SteadyStateProblem.lowered_problem`:
its `state_values` is in the lowering's (torn) ordering — solved variables
only — while torn unknowns such as `Y` are `observed` on the lowering. The
non-timeseries indexing test assumed `state_values(valp)` is laid out in
`unknowns(indp)` order, so `u[variable_index(indp, [X, Y])]` threw a
BoundsError while the test tuples were being built, erroring the
"State indexing" and "Observed" testsets.

When `variable_index(indp, ·)` does not index `state_values(valp)`, the test
now indexes through `symbolic_container(valp)` instead: solved variables are
referenced by `variable_index` on the container and torn/observed variables by
evaluating `observed` on it. Coverage for the lowered solution is preserved
(getsym/getindex on X, Y, XY, X * Y, and multi-symbol forms); non-lowered
objects take the original path.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

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

Independent review (Codex CLI 0.166.0 / gpt-6.1-sol), session 01a1966e-6877-7763-853c-8c5c6f0220ec, reviewed head 2c864d3

  • Verdict: CHANGES
  • Risk: high (H4: existing verification is bypassed for lowered solutions without equivalent assertions).
  • Round / slot: 1 / 1
  • Blocking priorities: P2

Review written by the reviewer named above in a session other than the PR author's, and copied here by the posting agent without change to its findings. The posting agent did not re-run the reviewer's commands.

Summary: The PR adapts comprehensive symbolic-indexing tests to lowered steady-state solutions without changing production code. Changes are required because the replacement branch removes inference coverage and computes observed-value expectations through the implementation under test.

Blast radius: Only test/downstream/comprehensive_indexing.jl; regression coverage of non-timeseries symbolic state and observed indexing, especially lowered steady-state solutions.

Evidence: Blind diff assessment recorded and hashed before author context; exact head matches live PR. PR CI passes the affected comprehensive-indexing testset (3,781 assertions); recent master CI errors in its state and observed testsets with the reported one-element BoundsError. The complete file also passes locally on Julia 1.13.2 (3,781/3,781 assertions, exit 0); the base file fails locally with two BoundsErrors (exit 1). The independent algebraic-reference and inference probe passes 8/8 checks (exit 0), including a synthetic scalar-oracle corruption that the self-oracle accepts and the independent reference rejects.

Blocking findings

  1. [P2] Preserve inference assertions for retained states — confirmed by running, test/downstream/comprehensive_indexing.jl:143. The original loop asserts @inferred get(valp) for state getters, but the lowered branch only checks equality, including for scalar X and its integer index that remain genuine states. A getter returning the correct value with an uninferable return type now passes. My probe restores all four retained-X inference assertions and they pass. Restore @inferred for these getters; only move eliminated Y and expressions to the observed checks.
  2. [P2] Keep an independent oracle for observed values — confirmed by running, test/downstream/comprehensive_indexing.jl:193. Expected Y and XY are obtained by calling observed(sc, ...), which getsym(sc, ...) also uses. An incorrect generated observed function can therefore agree with itself; the original XY expectation used independent arithmetic. A synthetic scalar observed-function corruption of +7 passes this self-oracle comparison while the independent reference rejects it; this demonstrates a coverage hole, not an incorrect result in the unmodified production code. Derive Y from the fixture equation, (1 + k1 * xval) / (k2 + 1), using numeric parameter inputs, then use xyval = xval + yval and compare with a justified floating-point bound.

Non-blocking findings

None.

What I ran

Read-only repository inspection: git status --short, git rev-parse HEAD, git rev-parse origin/master, git diff origin/master...HEAD, git diff dc3ab4edcbfd68981166fde3e11940b6ba674831...HEAD --stat, git merge-base origin/master HEAD, and git log -1 --no-merges --format=%B (exit 0). The live API base SHA is dc3ab4e; the fetched master tip is 030ec28. Both comparisons isolate the same test-only change. No Agent-Harness or Agent-Model trailers are present.

gh pr view 1657 --repo SciML/SciMLBase.jl --json number,url,state,isDraft,headRefOid,baseRefName,baseRefOid (exit 0) confirmed an open PR with the target head. gh pr checks 1657 --repo SciML/SciMLBase.jl returned exit 1 because downstream jobs failed. Read the description and commit body only after writing and hashing the blind assessment; the description contains no linked issue or author risk section.

CI logs were fetched with gh run view <run-id> --repo SciML/SciMLBase.jl --log-failed and a writable XDG cache; an initial attempt could not write the default cache. Inspected:

  • PR indexing CI: the changed file passes 3,781 checks; both Julia 1 and LTS indexing jobs are green.
  • PR IntegrationTest: SciMLSensitivity Core2 has three Unexpected Pass errors at stiff_adjoints.jl:238 and a finished-tape error; Core4 has AssertionError: mi2 !== nothing; Core8 errors in mtk.jl:216 with a time-gradient AD failure wrapping a 3,600-element-vector BoundsError at index 3,601.
  • Master IntegrationTest: inspected failed logs and matched those same Core2, Core4, and Core8 errors.
  • PR ReleaseTest and master ReleaseTest: both fail opening Catalyst's test/extensions/Project.toml with Permission denied.
  • Master indexing CI: state and observed indexing error with BoundsError: attempt to access 1-element Vector{Float64} at index [[1, 2]]; 3,747 passed and two errored. Recent completed master runs were selected using gh run list --repo SciML/SciMLBase.jl --branch master --event push --limit 5 and the analogous --workflow Downstream.yml query.

Local run 1 (head): JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH=<shared-depot>: JULIA_PKG_PRECOMPILE_AUTO=0 timeout 3600 julia +1.13.2 --startup-file=no run-head.jl (exit 0). Machine-specific depot argument is normalized here. The driver runs Pkg.activate("env"), Pkg.develop(path="src"), Pkg.instantiate(; allow_autoprecomp=false), and includes src/test/downstream/comprehensive_indexing.jl; it does not call Pkg.test(). The separate environment contains the test file's direct imports and their downstream compat bounds. Versions: Julia 1.13.2, SciMLBase 3.59.0, ModelingToolkit 11.45.5, ModelingToolkitBase 1.77.5, SymbolicIndexingInterface 0.3.55, SteadyStateDiffEq 2.18.1. Output: 29 testsets, 3,781/3,781 assertions passed; the lowered NonlinearSolution case passes 60/60. Final tail: RODESolutions save discretes | 2 2.

Local run 2 (base): same environment prefix and timeout 3600 julia +1.13.2 --startup-file=no run-base.jl (exit 1). The driver includes the original test/downstream/comprehensive_indexing.jl from a detached worktree at dc3ab4e. Since the entire production tree is unchanged by the PR, both test versions use the same developed production source and manifest. Observed output: State indexing at test/downstream/comprehensive_indexing.jl:127 and Observed at test/downstream/comprehensive_indexing.jl:164 each raise BoundsError: attempt to access 1-element Vector{Float64} at index [[1, 2]]. The failing lowered-solution testset reports 26 passed, 0 failed, 2 errored, 0 broken.

This is a test-fixture correction, not a production behavior fix: the original test file fails on base and the revised file passes on head in my runs. No added production regression test fails against the base implementation, because production code is identical.

Local run 3 (adversarial probe): same environment prefix and timeout 3600 julia +1.13.2 --startup-file=no run-probe.jl (exit 0). The driver activates the same environment and runs a separate steady-state fixture plus an observed-container wrapper used only for mutation testing. Independent references come directly from the fixture's second equation, Y = (1 + 0.25X) / 1.5, and its declared XY = X + Y. Comparisons allow 16 machine epsilons in relative and absolute error for the handful of floating-point arithmetic operations; this bound concerns algebraic evaluation, not integration accuracy. Output:

REVIEW_JULIA_VERSION=1.13.2
STATE_LENGTH=1
SYMBOLIC_REFERENCE=(x = 5.0, y = 1.5, xy = 6.5)
Independent lowering reference and retained inference | 6 6
Oracle mutation | 2 2
MUTATED_OBSERVED_ACCEPTED_BY_SELF_ORACLE=true
MUTATED_OBSERVED_REJECTED_BY_INDEPENDENT_REFERENCE=true

The six reference/inference checks comprise two independent observed-value comparisons and four @inferred retained-X getters. The mutation adds 7 only to the scalar XY observed function through a reviewer-owned wrapper; both direct observed evaluation and getsym accept the same wrong value, while the algebraic reference rejects it. This probe does not claim the entire PR test file accepts every possible mutation. Exactly three Julia invocations were run, once each, sequentially; no whole package suite or Pkg.test() was run.

What I did not verify

The base file stops at the failing lowered-solution testset, so later base-file testsets did not execute; the entire revised head file did execute. No full downstream, integration, GPU, AD, tracing, or MPI suite was rerun locally. The reviewed diff changes no production GPU, AD, tracing, or MPI path. I did not exhaustively mutate every indexing form or test other Julia versions/platforms; relevant Julia 1/LTS CI results were inspected. The run-3 corruption targets the scalar observed oracle only.

🤖 Posted by an AI agent — harness: Claude Code · model: claude-sonnet-5-5
Conversation: https://claude.ai/code/session_01379heiiB35TtywhR7uSU74

…lutions

Address review on #1657: the SCC-lowered state-indexing branch regained the
`@inferred get(valp)` assertions for the retained state `X`, and the observed
expectations no longer come from `observed` itself — a wrong generated
function would otherwise agree with itself. `Y` is now derived from the
fixture residual `0 ~ 1 + k1 * X - k2 * Y - Y` as `Y = (1 + k1 * X) / (1 + k2)`
and `XY` from the declared `XY ~ X + Y`, compared with `≈`.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@AayushSabharwal
AayushSabharwal merged commit 9342e94 into master Nov 2, 2026
68 of 74 checks passed
@AayushSabharwal
AayushSabharwal deleted the as/fix-ci branch November 2, 2026 16:13
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/SciMLBase.jl that referenced this pull request Nov 8, 2026
Include the upstream SymbolicIndexingInterface fixture correction while preserving the constructor and ensemble changes.

SciML#1657

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.164.0
Agent-Model: gpt-6.1-sol
Agent-Session: local fixer job SciML__SciMLBase.jl__1638 (no session URL)
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