Skip to content

Make Core5 parameter_handling u0 Float32-homogeneous (fixes LuxLib mixed-precision warning) - #1691

Draft
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/1609-float32-test
Draft

ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/1609-float32-test

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Please ignore until reviewed by @ChrisRackauckas.

Summary

test/Core5/parameter_handling.jl built NonlinearProblem / ODEProblem states with default Float64 zeros/ones while Lux parameters in the ComponentArray are Float32. That mismatch triggers LuxLib's mixed-precision matmul_cpu_fallback! warning, which fails @test_nowarn. This change makes the three state constructions Float32 so they match the existing x = ones(Float32, 2, 3) and Lux params. No production code changed; @test_nowarn is intentionally left strict.

Closes #1609

Verification

Scratch env (Pkg.develop of this repo + Lux, ComponentArrays, NonlinearSolve, OrdinaryDiffEq, Zygote, Test), Julia 1.12.7:

export TMPDIR=/home/crackauc/sandbox/goals/issue-backlog/ibd/SciMLSensitivity.jl/jobs/1609-cursor/tmp
export JULIA_DEPOT_PATH=.../jobs/1609-cursor/depot:$HOME/.julia
julia +1.12 --project=.../scratch/ph_env test/Core5/parameter_handling.jl

Before (unmodified master contents of the test file)

[ Info: Testing Nonlinear Solve Adjoint with Nested Parameters
┌ Warning: Mixed-Precision `matmul_cpu_fallback!` detected and Octavian.jl cannot be used for this set of inputs (C [Matrix{Float64}]: A [Base.ReshapedArray{Float32, 2, SubArray{Float32, 1, Vector{Float32}, Tuple{UnitRange{Int64}}, true}, Tuple{}}] x B [Matrix{Float64}]). Falling back to generic implementation. This may be slow.
└ @ LuxLib.Impl ~/.julia/packages/LuxLib/zPBrt/src/impl/matmul.jl:194
Test Failed at .../Test.jl:934
  Expression: contains_warn(...)
ERROR: LoadError: There was an error during testing
in expression starting at .../test/Core5/parameter_handling.jl:17

After (this PR)

[ Info: Testing Nonlinear Solve Adjoint with Nested Parameters
[ Info: Testing Gauss Adjoint with Nested Parameters

(exit code 0; both @test_nowarn paths and nested Zygote gradients completed)

Also: Runic --check and typos on the touched file both exit 0.

Not verified

  • Full GROUP=Core5 / Pkg.test() suite (only this file was run, to keep load down on a busy machine).
  • Downstream OrdinaryDiffEq IntegrationTest CI that originally surfaced the failure.

Reviewer push-back

  • Whether any callers intentionally want mixed Float64 state / Float32 Lux params (this PR only fixes the test boundary, not library behavior).
  • Whether Float32 tolerance / adjoint numerics need an explicit absolute/relative check beyond @test_nowarn and non-nothing gradients (existing assertions kept as-is).

Risk assessment

  • Risk: low
  • Blast radius: one Core5 test file only; no src/ changes
  • Evidence: fail-before / pass-after on parameter_handling.jl with the mixed-precision warning present then absent
  • Independent review: Claude Code (Opus 5.5) rated it low, high confidence: master 9 pass / 1 fail (LuxLib mixed-precision warning at line 17), PR 10/10 with no warnings; the Float64 enters from the test's own u0, not SciMLSensitivity (both @test_nowarn calls are plain forward solves); the ODE hunk is also needed — LuxLib logs the warning with maxlog=1, so master's ODE @test_nowarn passed only by accident and fails when run alone.
  • Merge: auto-merge candidate once CI shows no regressions (test-only, 3 lines; author and reviewer both low).

Please ignore this draft until reviewed by @ChrisRackauckas.

Harness: Cursor Agent CLI 2026.09.28-64d2043; model: auto; transcript: /home/crackauc/sandbox/goals/issue-backlog/ibd/SciMLSensitivity.jl/jobs/1609-cursor/log.txt on amdci2.julia.csail.mit.edu

Avoid LuxLib mixed-precision matmul fallback warnings that fail @test_nowarn
when Float64 zeros/ones u0 meet Float32 ComponentArray parameters.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.09.28-64d2043
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/ibd/SciMLSensitivity.jl/jobs/1609-cursor/log.txt on amdci2.julia.csail.mit.edu

This branch has not been deployed

No deployments
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.

Core5 parameter_handling @test_nowarn fails on LuxLib mixed-precision fallback warning

2 participants