QA: resolve Base.Broadcast.axistype ambiguity with CommonWorldInvalidations#180
Merged
ChrisRackauckas merged 1 commit intoJun 24, 2026
Conversation
…ations
CommonWorldInvalidations v1.1.0 ships despecialization methods
`Base.Broadcast.axistype(::Any, ::UDespec_k)` where the `UDespec` fixture
types are `<: AbstractUnitRange{Float64}`. Static's broadcast-axis helpers
were declared with a bare `::Any` open slot:
axistype(r::OptionallyStaticUnitRange{StaticInt{1}}, _)
axistype(_, r::OptionallyStaticUnitRange{StaticInt{1}})
That forms a diagonal ambiguity with CWI's methods at the intersection
`(OptionallyStaticUnitRange{StaticInt{1}}, UDespec_k)` — neither method is
more specific — so Aqua.test_ambiguities reported 4 ambiguities and the QA
lane (julia 1 and lts) went red.
A broadcast axis is always an `AbstractUnitRange{<:Integer}`, so narrowing
the open slot from `::Any` to `AbstractUnitRange{<:Integer}` keeps every
real call dispatching to these methods while excluding CWI's Float64-eltype
fixture types, removing the ambiguity without referencing CWI internals.
Behavior is unchanged: Core suite passes 2615/2615 and QA is green on
both julia 1 (1.12) and lts (1.10).
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ChrisRackauckas
added a commit
that referenced
this pull request
Jun 27, 2026
Convert the hand-rolled Aqua/ExplicitImports body in test/qa/qa.jl to the
SciMLTesting 1.6 run_qa form and turn on the full ExplicitImports suite.
- qa.jl: single run_qa(Static; ...) call. Aqua.test_all replaces the
per-sub-check calls; ambiguities recursive=false preserved via aqua_kwargs;
the test_piracies(broken=true) finding becomes aqua_broken=(:piracies,)
(Base.promote_shape overload on Tuple{Vararg{Union{Int,StaticInt}}}, tracked
in #181 — the prior piracy issue #162 was a different, now-resolved method).
- explicit_imports=true enables all six EI checks (was two). Four pass bare;
all_qualified_accesses_are_public ignores 22 Base/Base.Broadcast/
Base.IteratorsMD internals, all_explicit_imports_are_public ignores
IfElse.ifelse — other packages' not-yet-public names, documented per ignore.
- test/qa/Project.toml: drop ExplicitImports + SafeTestsets (both transitive
via SciMLTesting); keep Aqua direct (ambiguities child-proc needs it);
SciMLTesting compat -> "1.6".
Verified locally against released SciMLTesting 1.6.0 (Julia 1.10 and 1.12),
develop-by-path so the master axistype fix (#180) is in scope: 16 Pass,
1 Broken (piracies), 0 Fail, 0 Error; ExplicitImports 6/6 pass.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Please ignore until reviewed by @ChrisRackauckas.
Problem
The master CI QA lane (both
julia 1andlts) is red.Aqua.test_ambiguities(Static; recursive=false)reports 4 ambiguities:Root cause
CommonWorldInvalidationsv1.1.0 (picked up under Static's[compat] CommonWorldInvalidations = "1"; v1.0.0 had no such methods) ships despecialization methodsStatic's broadcast-axis helpers were declared with a bare
::Anyopen slot:At the intersection
(OptionallyStaticUnitRange{StaticInt{1}}, UDespec_k)neither method is more specific (Static wins the first arg, CWI wins the second) → an unresolvable diagonal ambiguity. The only method that resolves it is one referencing CWI's internalUDespecfixture types, which Static must not depend on.Fix
A broadcast axis is always an
AbstractUnitRange{<:Integer}(axes carry integer indices;Base.Broadcast.axistypeis only ever reached from_bcs1(a, b)with both args being array axes). Narrowing the open slot from::AnytoAbstractUnitRange{<:Integer}keeps every real call dispatching to Static's methods while excluding CWI'sFloat64-eltype fixture types — removing the diagonal without naming CWI internals.OptionallyStaticUnitRange{StaticInt{1}}is itself<: AbstractUnitRange{<:Integer}, so the existing 3-arg(OSUR, OSUR)disambiguator remains strictly more specific and unchanged.Verification (run locally)
Aqua+ExplicitImports→11 Pass, 1 Broken(the pre-existingtest_piracies(broken=true)), 0 Fail. The 4 ambiguities are gone.2615/2615passing on Julia 1.12 (includes theaxistypebehavior tests intest/shared/ranges.jl).🤖 Generated with Claude Code