Repository navigation
Make tuple-node getindex type-stable; replace @test_broken @inferred with @inferred - #172
Merged
ChrisRackauckas merged 1 commit intoOct 16, 2026
Conversation
Julia 1.13.2 infers getindex through heterogeneous tuple nodes, which turned the @test_broken @inferred checks into errors. Recursing over the tuple makes inference succeed on all supported versions, so the tests assert @inferred. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Devin <noreply@cognition.ai> Agent-Harness: Devin CLI 3000.11.92 Agent-Model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium Agent-Session: local headless Devin run (fleet master green lane; no session URL)
ChrisRackauckas
marked this pull request as ready for review
October 16, 2026 00:39
This was referenced Oct 16, 2026
Merged
ChrisRackauckas
referenced
this pull request
Oct 16, 2026
Agent-Harness: Claude Code 2.1.301 Agent-Model: claude-opus-5-5 Claude-Session: https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a failure on the default branch's CI. The diagnosis and the evidence below come from the investigating agent's report; "confirmed by running" and "read in logs" are kept apart there.
Failure 1:
test/tuple_nodes.jl:51-52@test_broken @inferrederrors with "Expression evaluated to non-Boolean" on Julia 1.13.2Error (read in logs)
Two jobs fail with the same error, both on
julia version 1.13.2: Core (julia 1, ubuntu-latest) and Core (julia 1, ubuntu-latest, x86).prelane passes only because it skips itself when there is no release candidate ("Julia 1.13.2 is not a release candidate ... skipping").julia version 1.13.0and reportedCore/tuple_nodes.jl | 20 pass, 2 broken.Cause: a Julia release (1.13.1 inference improvement), so the test expectation is now wrong. This is not a dependency change.
getindex(m::AbstractMultiScaleArray, i::Int)callsnodeselect(m.nodes, idx, i) = ns[idx][i]with a runtimeidx.m.nodeshere is a heterogeneous tuple (twoPlants with different settings/organ types). Julia 1.13.1 and later union-split this and inferFloat64. Earlier versions inferAny. So@inferrednow returns4.1instead of throwing, and@test_brokenrejects the non-Boolean value. The code path uses only Base (tuples,Vector{Int},searchsorted), so package versions cannot change the result.Confirmed by running (
scratch/infer.jlagainst unmodified master 4611c53 copied toscratch/master_src; it printsBase.return_types(getindex, (typeof(x), Int))and the@inferredresult):@inferredAnyAnyAnyFloat64Float64The behaviour changes between 1.13.0 and 1.13.1. I did not bisect to the individual Julia commit. The GitHub
julia 1lanes moved from 1.13.0 to 1.13.2 between the 2026-09-11 green run and today.Existing PRs
None. The only open PRs in SciML/MultiScaleArrays.jl are #74 (ChrisRackauckas, "simple arrayinterface overloads", 2023) and #54 (ChrisRackauckas, "Fix diffeq tag", 2021). Neither touches this. A search for
inferred OR tuple_nodes OR test_brokenfinds only merged QA PRs.Fix
The test is not version-gated. Instead, the code is made type-stable on every supported Julia version, so the test can assert inference unconditionally.
src/indexing.jl: add Tuple methods fornodeselect. They recurse over the tuple, so a runtime index into heterogeneous tuple nodes infers as the union of each element's result (concrete when the leaves share an eltype):ns[i][I...]method.test/tuple_nodes.jl:51-52:@test_broken @inferred getindex(...)becomes@inferred getindex(...), matching lines 49-50. The old expectation ("this is not inferable") is false on Julia ≥ 1.13.1, and with the fix it is false on every supported version. The test is now strictly stronger: it fails if inference regresses on any version.With the fix,
return_typesgives[Float64]for both community and scenario on 1.10.12, 1.12.7 and 1.13.2 (confirmed by running).Test before and after (confirmed by running; logs in
scratch/):master_release_nonboolean.log):Error During Test ... Expression evaluated to non-Boolean ... Value: 4.1, exit 1. This reproduces the CI failure.failbefore_1.12.log):ERROR: LoadError: return type Float64 does not match inferred return type Anyat tuple_nodes.jl:51, exit 1.include("test/tuple_nodes.jl")against the dev'd branch (tuple_release.log,tuple_1.12.log,tuple_lts.log): exit 0 on 1.13.2, 1.12.7 and 1.10.12.GROUP=Core Pkg.test()on 1.13.2 (core_release.log): all pass, includingCore/tuple_nodes.jl | 20 20andindexing_and_creation_tests.jl | 134 134.GROUP=QA Pkg.test()on 1.13.2 (qa_release.log):QA/qa.jl | 20 20, passed.--inplaceon both files: no changes.typoson both files: clean.Not run locally: the 32-bit Core lane (x86), and the full Core group on lts and 1.12. On lts and 1.12 only tuple_nodes.jl was run.
🤖 Posted by an AI agent — harness: Devin CLI 3000.11.92 (fix), Claude Code 2.1.300 (PR) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium / claude-opus-5-5
Conversation: https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq (fleet master)
🤖 Generated with Claude Code
Independent review (added by the fleet master)
Risk assessment
return type Float64 does not match inferred return type Any. Read the default-branch log independently: both release architectures report non-Boolean results at the two broken-inference assertions. Also ran the full tuple_nodes.jl on Julia 1.10.12, including its ODE solve: exit 0. PR CI remains pending.🤖 Section added by an AI agent — harness: Claude Code 2.1.300 · model: claude-opus-5-5 (review by codex-cli 0.162.1, gpt-6.1-sol)
Conversation: https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq