Skip to content

Fix master CI: JET undefined-var, CSTR init over-determination, downgrade compat floors#52

Draft
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-qa-cstr-master
Draft

Fix master CI: JET undefined-var, CSTR init over-determination, downgrade compat floors#52
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-qa-cstr-master

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Summary

Fixes the three independent failures on main CI (HEAD 7cad441):

  1. QA / JETlocal variable ΔHᵣ may be undefined. In TPControlVolume (src/base/base_components.jl), the reaction variables ΔnR/ΔHᵣ were created with @variables inside a reactive ? append!(...) : nothing ternary, so they were never bound when reactive == false, while the equation list references them (guarded by reactive ? ... : 0.0). Moving the @variables block out of the ternary makes them always defined; they are only appended to the system's variable list when reactive. JET.report_package now reports 0 errors and run_qa passes 12/12 on Julia 1.12.

  2. Core tests (test/simple_cstr.jl, all Julia versions) — Tmax = 297.0 instead of 356.149 (no reaction). The test pinned cstr.cv.c2.n and outlet.m in u0; these are fixed by the algebraic flow balances, so pinning them over-determines MTK initialization (4 residuals, 0 free unknowns) and the least-squares fallback yields a degenerate steady state. Supplied as initialization guesses instead. The peak-time assertion is relaxed 1e-2 → 0.1 because the maximum sits on a flat plateau (<0.002 K across the bracketing steps), so the discrete argmax time shifts by one solver step (~0.02 s) across Julia versions while Tmax is identical to 6 figures; the physically meaningful Tmax assertion stays tight at 1e-3. Verified Pass 2/2 on Julia 1.10 and 1.12.

  3. Downgrade (Julia 1.10) — UndefVarError: AbstractNonlinearTerminationMode not defined. The floors ModelingToolkit = "9" / DifferentialEquations = "7" let downgrade-compat resolve an inconsistent SciML stack (NonlinearSolve 3.14 + DiffEqBase 6.174 + SteadyStateDiffEq 2.0; later, BoundaryValueDiffEqFIRK 1.6 vs RecursiveArrayTools 3.50). Raised to ModelingToolkit = "9.60" (pins NonlinearSolve 4.x) and DifferentialEquations = "7.16" (pins a modern BVP/SteadyState stack). Raising lower bounds only narrows resolution. Verified the downgraded resolution precompiles and simple_cstr.jl passes 2/2 on Julia 1.10.

Local verification

  • Julia 1.12: JET.report_package → 0 reports; run_qaQuality Assurance | 12 12; simple_cstr.jlPass 2/2.
  • Julia 1.10: downgrade-compat resolution (via julia-downgrade-compat's downgrade.jl) precompiles cleanly with the new floors; simple_cstr.jlPass 2/2.

Files Runic-formatted.

Please ignore until reviewed by @ChrisRackauckas

…rade compat floors

Three independent master failures on SciML/ProcessSimulator.jl:

QA / JET (`local variable ΔHᵣ may be undefined`):
`TPControlVolume` created the reaction variables `ΔnR`/`ΔHᵣ` inside a
`reactive ? append!(vars, @variables ...) : nothing` ternary, so when
`reactive == false` the symbolic variables were never bound, yet the equation
list still references `ΔHᵣ`/`ΔnR` (guarded by `reactive ? ... : 0.0`). JET's
`report_package` flagged the possibly-undefined local. Move the `@variables`
block out of the ternary so the variables are always created and only appended
to the system's variable list when `reactive`. `JET.report_package` now reports
0 errors and `run_qa` passes 12/12 on Julia 1.12.

Core tests (`simple_cstr.jl`, all Julia versions): `Tmax = 297.0` instead of
356.149. The test pinned `cstr.cv.c2.n` and `outlet.m` in `u0`; these are fixed
by the algebraic flow balances, so pinning them over-determines MTK's
initialization (4 residuals, 0 free unknowns) and the least-squares fallback
returns a degenerate steady state where no reaction occurs. Supply them as
initialization `guesses` instead. The peak-temperature *time* assertion is
relaxed from atol 1e-2 to 0.1 because the maximum sits on a flat plateau
(< 0.002 K across the bracketing steps) so the discrete argmax time shifts by
one solver step (~0.02 s) across Julia versions while `Tmax` stays identical to
6 figures; the physically meaningful `Tmax` assertion stays tight at 1e-3.
Verified `Pass 2/2` on Julia 1.10 and 1.12.

Downgrade (Julia 1.10): `UndefVarError: AbstractNonlinearTerminationMode not
defined`. The compat floors `ModelingToolkit = "9"` / `DifferentialEquations =
"7"` let downgrade-compat resolve an inconsistent SciML stack (NonlinearSolve
3.14 + DiffEqBase 6.174 + SteadyStateDiffEq 2.0, and BoundaryValueDiffEqFIRK 1.6
against RecursiveArrayTools 3.50). Raise the floors to `ModelingToolkit =
"9.60"` (pins NonlinearSolve 4.x) and `DifferentialEquations = "7.16"` (pins a
modern BVP/SteadyState stack). Raising lower bounds only narrows resolution.
Verified the downgraded resolution precompiles and `simple_cstr.jl` passes 2/2
on Julia 1.10.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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