Skip to content

Keep failed static linear solutions cache-free#1094

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:agent/fix-static-failure-cache
Jul 20, 2026
Merged

Keep failed static linear solutions cache-free#1094
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:agent/fix-static-failure-cache

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Jul 15, 2026

Copy link
Copy Markdown
Member

Ignore this PR until it has been reviewed by @ChrisRackauckas.

Summary

  • pass nothing as the solution cache when static LU/GESV factorization reports failure
  • cover singular SMatrix LU and GESV solves with a lightweight-solution regression

The successful static paths already return cache-free LinearSolution objects. The failure paths instead passed the problem as the cache, which violates the LinearSolve 5 lightweight-solution invariant and makes otherwise successful static solves infer a union of cache::Nothing and cache::LinearProblem.

Root cause

An automated git bisect from a9b13cfa through clean main 0496f135 identified 459445950ef413fe96ed78d0b1507aca7abe591c (LinearSolve 5.0 lightweight solutions) as the first bad commit.

Explicit adjacent validation on Julia 1.10.11 confirmed:

  • parent a9b13cfa: the reduced static LU @inferred solve(...) passes and returns a successful solution with cache::LinearProblem
  • child 45944595: the same call fails inference because the successful return has cache::Nothing while the singular-failure branch still has cache::LinearProblem

Making both static LU and GESV failure returns cache-free restores one concrete return type and completes the intended LinearSolve 5 behavior.

Local verification

On commit a10fe1283009e27d7499ce4d3239bfcaf3046b33:

  • Julia 1.10.11, GROUP=AD: Mooncake 41/41; Static Arrays 23 pass + 1 pre-existing broken; Caching 49 pass + 23 pre-existing broken; Enzyme 47/47; Pkg.test() exited 0
  • Julia 1.12.6, GROUP=AD: the same counts passed; Pkg.test() exited 0
  • reduced static LU @inferred reproducer: passed on Julia 1.10.11 and 1.12.6 with sol.cache === nothing
  • Julia 1.12, GROUP=Core: exited 0; the modified Lightweight Solution testset passed 43/43, and all remaining Core testsets passed with only their pre-existing broken tests
  • Runic 1.7.0, repository-wide --check .: exited 0
  • git diff --check: exited 0
  • generated manifests and the test-environment source rewrite were removed; the worktree is clean

CI

The PR's AD jobs pass on Julia LTS and current, and Core passes on Julia LTS, current, and pre-release. The remaining red checks are unrelated baseline/external failures (including the PyAMG documentation link returning HTTP 429, the clean-main KLU JET failure tracked in #1095, and the Trim environment compatibility failure tracked in #1093).

Copy link
Copy Markdown
Member Author

Audit verification scratchpad:

  • base: upstream/main@6487e3d1a1749a5b1efd36d70cb833563f251d52; a post-publish fetch found no newer base commits
  • commit: 005caa986d2070dd7dee8ae652e3c79f2e7bcdfc (includes the required Chris Rackauckas co-author trailer)
  • Julia 1.12 GROUP=AD: Mooncake 41/41; Static Arrays 23 pass + 1 pre-existing broken; Caching 49 pass + 23 pre-existing broken; Enzyme 47/47
  • Julia 1.10 GROUP=AD: identical passing counts
  • Julia 1.12 GROUP=Core: exit 0; Lightweight Solution 43/43 and all other Core sections passed, retaining only pre-existing broken cases
  • Runic 1.7.0 --check --diff .: exit 0
  • git diff --check: clean

Copy link
Copy Markdown
Member Author

Scheduled CI checkpoint (2026-07-15 08:33 EDT):

  • 19 checks have succeeded, 1 is in progress, 31 are queued, 4 have failed, and 4 are skipped.
  • The four failures are independently classified: two downgrade jobs are outside this audit's scope; the NonlinearSolve downstream job is outside this audit's scope and is tracked separately; and the Trim job is the pre-existing current-branch incompatibility fixed independently in Align the Trim test environment with SciMLBase 3 #1093.
  • Core on Julia LTS and Julia prerelease is green. The targeted AD jobs and Core on current Julia are still queued.

No observed failure at this checkpoint is attributable to this PR. This is an interim checkpoint, not a claim that the full CI matrix or the targeted jobs have passed.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Final CI follow-up (checked 2026-07-16 12:42 EDT): 50 checks succeeded, 5 failed, and 4 were skipped. Both target AD lanes and all Core lanes are green. Remaining reds are Trim repaired separately by #1093, QA/KLU repaired separately by #1095, the existing NonlinearSolve downstream failure, and excluded downgrade jobs. The formerly queued Ginkgo and GPU checks completed successfully.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude
ChrisRackauckas-Claude force-pushed the agent/fix-static-failure-cache branch from 005caa9 to a10fe12 Compare July 16, 2026 17:25
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Post-rebase verification (2026-07-16): rebased commit a10fe1283009e27d7499ce4d3239bfcaf3046b33 onto current upstream/main@0496f1351010ed70c1ee764534012dbc674ede59. The exact Julia 1.12 GROUP=AD run exited 0: Mooncake 41/41; Static Arrays 23 pass plus 1 pre-existing broken; Caching 49 pass plus 23 pre-existing broken; Enzyme 47/47. git diff --check passed and the worktree was clean after restoring generated test-environment files. Immediately before updating the PR, I fetched both remotes, verified that upstream remained at 0496f135 and that the feature branch remained at expected old head 005caa986d2070dd7dee8ae652e3c79f2e7bcdfc, then used an explicit force-with-lease for that exact old head.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

One-hour post-rebase CI checkpoint (2026-07-16 14:28 EDT): 49 checks succeeded, 5 failed, 4 were skipped, and only the self-hosted GPU job remains queued. Both target AD lanes are green. The five completed reds are Trim repaired independently by #1093, QA/KLU repaired independently by #1095, the separately tracked NonlinearSolve downstream job, and excluded documentation/downgrade jobs. No completed failure is attributable to this focused static-cache change; the queued GPU job is still pending and this is not a claim that the entire matrix has completed.

Copy link
Copy Markdown
Member Author

Independent clean-main follow-up completed:

  • reproduced the static-array @inferred failure on 0496f135 with Julia 1.10.11
  • bisected the regression to 459445950ef413fe96ed78d0b1507aca7abe591c; its parent a9b13cfa passes the same reduced reproducer, while the child fails with the Nothing/LinearProblem cache union
  • validated this PR's head a10fe128 with full GROUP=AD runs on Julia 1.10.11 and 1.12.6; both exited 0 with Mooncake 41/41, Static Arrays 23+1 broken, Caching 49+23 broken, and Enzyme 47/47
  • repository-wide Runic --check . and git diff --check exited 0; the test worktree was cleaned

The same two-line fix addresses both the LTS and current-Julia inference failures without weakening or skipping any test.

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review July 20, 2026 08:31
@ChrisRackauckas
ChrisRackauckas merged commit f04f14f into SciML:main Jul 20, 2026
54 of 59 checks passed
ChrisRackauckas added a commit that referenced this pull request Jul 21, 2026
Releases unreleased fixes on master: KLU JET inference paths (#1095) and cache-free static failure solutions (#1094).



Claude-Session: https://claude.ai/code/session_01SFmcAmLrGPrGtzwP333mX8

Co-authored-by: ChrisRackauckas-Claude <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