Skip to content

Fix Initial parameters for unsplit array systems - #5302

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/unsplit-array-initial-parameters
Oct 30, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/unsplit-array-initial-parameters

Conversation

@ChrisRackauckas-Claude

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

Copy link
Copy Markdown
Member

🚧 UNREVIEWED — Ignore this PR until reviewed by @ChrisRackauckas.
🤖 This PR was prepared by an AI agent; Chris has not reviewed it.

With complete(sys; split=false), mixed matrix/vector/scalar states produce array-valued Initial parameters inside a flat numeric parameter buffer, and DAEProblem construction throws a Matrix{Bool}/Float64 promotion error. Scalarize Initial parameter symbols for the unsplit layout and preserve supplied indexed values when completing its operating point. Split storage retains its current symbolic layout.

The regression checks numerical DAE residuals, state/derivative order, flat numeric parameter storage, ODE construction, and explicit Initial values for both split modes. Two production lines and one existing test file change; no dependency or public API changes.

Verification

Julia 1.13.1, four Julia/precompile threads, one BLAS/OMP thread, isolated local package environments. Actual sources use base 207f39e . Its ModelingToolkitBase Project declares 1.77.5; preserved Manifest metadata labels the developed entry 1.77.4. Loaded source paths/hashes were verified; this is not a fresh minimum-dependency resolution.

The identical complete final official array_equation_dae.jl was executed against clean base and candidate, with standard compilation/default optimization:

Before, exit 1: 43 passed, 1 error
mixed array initial parameters with split=false: Error During Test
AssertionError: `promote_to_concrete` can't make type Matrix{Bool} uniform with Float64

After: 55/55 passed

Official package groups, using the existing runners:

GROUP=InterfaceI julia --startup-file=no --project="$VALIDATION_ENV" -e 'using Pkg; Pkg.test("ModelingToolkitBase")'
GROUP=QA julia --startup-file=no --project="$VALIDATION_ENV" -e 'using Pkg; Pkg.test("ModelingToolkitBase"; julia_args=["--compiled-modules=no", "-O1"])'
InterfaceI: 1825 passed, 1 failed, 5 existing broken; exit 1
  array_equation_dae.jl: 55/55
  sole failure: existing causal connector expectation, components.jl:446
JET:54/54; Aqua:21/21; Testing ModelingToolkitBase tests passed; exit 0

The causal assertion independently fails on clean base and has a separate test-only repair linked below. An earlier InterfaceI run with --compiled-modules=no also failed an unchanged 180-second child-liveness assertion; that assertion fails on clean base under the same flag and passes unchanged with standard compilation. No timeout or assertion was modified.

Additional identical public-API controls compare absent, whole-array, fully indexed, and partial indexed Initial maps:

Mode Clean base Candidate
Default 80pass,4fail 80pass,4samefail
Explicit split=true 80pass,4fail 80pass,4samefail
Explicit split=false 4 constructor errors 84/84pass

Combined controls deliberately exit 1 in both conditions because the eight inherited partial-indexed split/default failures remain asserted. This PR does not fix those failures; the separate reduced report is linked below.

Fresh exact Runic check over the three final Julia files, spelling over the final diff, and whitespace checks completed exit0. The source/test hashes match the independently reviewed files; temporary docs Project paths and clone origin were restored. Final tracked diff contains the three intended files only.

Three full local docs attempts ran without changing source, link checking or warning policy: the original covered build, a standard build, and its identical retry. All exited1 solely on external GitHub HTTP429 link-check errors, stopping before rendering. The affected existing links varied across attempts (ColPrac README, ModelingToolkit NEWS, PDEBase interface); direct HEAD requests returned200 afterward. No local docs pass is claimed. The candidate CI build subsequently passed on this exact reviewed commit. Its downloaded raw log contains RenderDocument and HTMLWriter rendering; this is candidate CI evidence, not a local docs pass. A fresh separate final gate audit classified the earlier HTTP429 failures as disclosed external validation gaps suitable for a draft, not identified source blockers.

Final candidate CI completed with94 successful checks,14 failures and3 skipped checks, no pending jobs. Deterministic comparison classifies all14 failures as pre-existing against default207f39e2: seven root/Base/downgrade InterfaceI causal assertions, five Optimization/MOI failures, SymbolicIndexingInterface downstream and SciMLSensitivity Core8. Matching failing steps and error signatures were read; this is inherited-red qualification, not an all-green claim.

No complete local Everything, Initialization group, dependency-floor, downstream, or GPU run is claimed.

Independent review

Fresh Codex CLI 0.163.0 / gpt-6-astra: APPROVE SOURCE, low risk, high confidence, with docs/formatter/metadata completion required before publication. The reviewer independently ran clean archives: same official file43pass1error→55/55; full map controls160pass8fail4errors→244pass8samefail0errors, with all84 unsplit assertions passing. The final three candidate file hashes match those independently tested. Full official QA/InterfaceI author logs were inspected, not independently rerun. A separate fresh Codex CLI0.163.0/gpt-6-astra session01a15e62-2aa5-7050-884c-24515430bf2a verified the unchanged full diff and three hashes, formatter/spelling exits, clean metadata, and raw failures from all three docs attempts. It retained low source risk/high gate-classification confidence and accepted the disclosed external docs gap for a draft, without claiming rendering or merge approval.

Reviewer local session 01a15dc7-4a29-7591-bd4d-2160fa15e372 (no session URL).

Links

Risk assessment

  • Risk: low
  • Blast radius: unsplit array Initial parameter construction and supplied indexed-value preservation in operating-point completion; split/default controls are unchanged. No public API or dependency change.
  • Evidence: identical official43pass1error→55/55, independent84/84 unsplit controls, official QA75/75; inherited failures retained above. Formatter and metadata cleanup passed; three local docs attempts failed only external HTTP429, with an independent gate audit accepting that disclosed external gap for a draft.
  • Independent review: Codex CLI 0.163.0 / gpt-6-astra rated it low risk/high confidence, no source blockers; fresh separate gate audit verified completed formatting/cleanup and accepted the external docs gap for a draft (review evidence).
  • Merge: qualified review-clean candidate under the parent inherited-red policy: current-head CI is complete and all14 failures match default. Parent assesses merge eligibility; root has no merge authority.

🤖 Posted by an AI agent — harness: Codex CLI 0.163.0 · model: gpt-6.1-sol.
Original writer conversation: local session 01a15d04-553f-7240-8d96-8de0c6f663b8 (no session URL).
Validation recovery: Codex CLI 0.163.0, model gpt-6-astra; local session 01a15dac-5d4e-7cb0-bd5a-7c9bed03d2f7 (no session URL).
Conversation: local session 01a15ca3-5696-7ea3-bbac-ba551b6975af (no session URL).

🤖 Automated review section from an AI agent running as Chris Rackauckas's account — not written or reviewed by Chris.

Risk assessment (independent review, Codex gpt-6.1-sol, head d570f9a)

  • Risk: medium-low (ML1: already-constructible scalarized split=false problems change from silently discarding explicit Initial values to preserving them; ML2 also applies to this optional initialization path). L6 covers the mixed-array constructor error, and L2 covers the added assertions. Default/split controls are unchanged; this is a peripheral opt-in layout rather than a default numerical algorithm change.
  • Blast radius: Initial parameter generation for unsplit array systems and operating-point completion in problem/parameter constructors. Scalar, matrix, vector and derivative Initial values are involved. No new public names, signature changes, dependencies, copyleft exposure, or test weakening; no new public API requires documentation or a version bump.
  • Evidence: Read the complete three-file diff using git diff origin/HEAD...HEAD, the risk policy, and the linked issue Partial indexed Initial overrides lose explicitly supplied values during split parameter construction #5299. git diff origin/HEAD...HEAD --check passed. Independently extracted clean archives of base 207f39e2d3c63d87e9ecde21279ec6967e4e8b21 and head, verified changed source bytes, and ran the byte-identical added test block with a common fresh dependency resolution. Julia 1.13.1; Symbolics 7.48.0, SymbolicUtils 4.54.0, SciMLBase 3.58.0 and SymbolicIndexingInterface 0.3.55. Commands used the requested depot, four Julia threads, one BLAS thread and a 3600-second shell timeout:
    # From the review run directory; JULIA is the installed Julia 1.13.1 binary.
    timeout 3600 "$JULIA" --startup-file=no --compiled-modules=existing --compile=min -O0 --project=scratch/env scratch/run.jl
    timeout 3600 "$JULIA" --startup-file=no --compiled-modules=existing --compile=min -O0 --project=scratch/baseenv scratch/run.jl
    Head: 23/23 new assertions and 36/36 additional scalarized-array state/residual assertions, exit 0. Base: the 36 controls and 11 split-mode regression assertions passed, then the unsplit regression errored with AssertionError: promote_to_concrete can't make type Matrix{Bool} uniform with Float64, exit 1. On successful scalarized unsplit constructions, whole-array and fully indexed Initial overrides printed [0,0,0,0] on base versus the supplied [7,8,17,18] on head; partial overrides similarly preserve the supplied entries on head. All eight default/explicit-split map controls printed identical results across revisions. Logs: scratch/head-tests.log, scratch/base-tests.log; runner: scratch/run.jl.
    Independently downloaded all 14 candidate failure logs and their 14 matching default-branch jobs at the fork-point commit. Failure headings, evaluated expressions and exception signatures match after normalizing runner paths, timing whitespace and increased passing-test counts: seven causal-direction assertions, five Optimization/MOI failures, SymbolicIndexingInterface BoundsErrors, and SciMLSensitivity's EnzymeVJP failure. The candidate Base InterfaceI log explicitly reports the changed official file at 55/55, versus 32/32 on that historical default. Evidence and exact job mappings are in scratch/ci-compare.json and scratch/job-*.log. This establishes inherited failures against that tested default revision, not a green current-default claim.
    G1: pass — independently hand-computed residual -(u0 + du0), exact initial state/derivative ordering and supplied numerical Initial values. G2: not applicable — no GPU kernel, AD rule, Reactant tracing or MPI implementation changes. G3: not applicable — no shared state, cache, threading or global-default changes.
  • Merge: merge

🤖 Posted by an AI agent — harness: Codex CLI · model: gpt-6.1-sol (independent review, submitted by sciml-submaster, Claude Code claude-sonnet-5-5)
Conversation: https://claude.ai/code/session_01379heia6cKWmdtNob6NGzg

Scalarize array Initial parameters for flat unsplit storage and preserve
supplied indexed values when completing operating points. Add the official
mixed matrix/vector/scalar DAE and ODE regression for both split modes.

The identical official file errors on the base and passes55/55 after the
fix. Independent source and final publication-gate reviews are clean.
Three local docs attempts reached checks but stopped on external HTTP429;
no candidate rendering pass is claimed.

Initial implementation: Codex CLI0.163.0 / gpt-6.1-sol, local session
01a15d04-553f-7240-8d96-8de0c6f663b8 (no session URL).
Validation recovery: Codex CLI0.163.0 / gpt-6-astra, local session
01a15dac-5d4e-7cb0-bd5a-7c9bed03d2f7 (no session URL).

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.163.0
Agent-Model: gpt-6.1-sol
Agent-Session: local session 01a15ca3-5696-7ea3-bbac-ba551b6975af (no session URL)
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review October 30, 2026 12:53
@ChrisRackauckas
ChrisRackauckas merged commit b9cc449 into SciML:master Oct 30, 2026
97 of 111 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