Fix test failures across the whole CI matrix - #86
Merged
Merged
Conversation
Every run-tests leg was red. Three of the 13 test items failed, for four
independent reasons, none of them caused by the test-item migration.
- `ccall(:jl_array_grow_beg, ...)`: the C symbol is gone from Julia 1.11 on.
Use `Base._growbeg!`, which wraps it and is present, with the same signature
and behaviour, on every version from 1.0.5 to 1.13.0-rc3.
- `pushfirst!(X, a, b, c)` reaches us as `prepend!(X, (a, b, c))`, and Base
narrowed `_prepend!`'s first argument from `Any` to `Vector` in 1.10, so from
1.10 on it threw a MethodError. Add a general-iterable `prepend!` fallback.
- `reverse`/`reverse!` left their positional arguments untyped, which became
ambiguous with Base once 1.6 typed its own as `Integer`. Type ours to match.
Their docstrings described (start, count) while the bodies always forwarded
Base's (start, stop); correct the docs.
- `promote_type(Any, DataValue{T})` recursed until the stack overflowed: Base's
`>:Union{Missing,Nothing}` rule answers `Any` while ours answers
`DataValue{Any}`, so `promote_result` re-asked the same question forever. Add
the mirror-image rule so both directions agree, keeping `DataValue{Any}`.
The Reduce item compared a DataValueArray reduction against Base's, which is
`@simd` and therefore reassociates; the two differ by 1 ULP at N = 2050. This
failed on every version including 1.0.5. Draw the test data from integers so
every partial sum is exact and the comparisons can stay exact too.
Verified: 13/13 items pass on 1.0.5, 1.6.7, 1.10.12, 1.11.9, 1.12.7 and
1.13.0-rc3 — each Base transition above is covered on both sides.
Co-Authored-By: Claude Opus 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.
Every
run-testsleg of CI is currently red — 78/78 on the last PR run and onmain. Three of the 13 test items fail. None of it is fallout from the test-item migration; these are long-standing bugs that the migration surfaced, plus one test that has been comparing floats for bit equality since Julia 1.0.Which items fail depends on the Julia version:
What changed in Base, and when
Every version in the CI matrix was probed locally through its juliaup channel, so each fix targets a known boundary rather than a runtime feature check — no
@static, noisdefinedbranches:Base._growbeg!ccall(:jl_array_grow_beg)Base._prepend!1st argBase.reverse(::AbstractVector, _, _)AnyAny, AnyAnyInteger, IntegerVectorInteger, IntegerVectorInteger, IntegerThe four source bugs
jl_array_grow_begis gone from Julia 1.11 on. The threeccalls indatavaluevector.jldie with "could not load symbol". Replaced withBase._growbeg!, the Base wrapper that has always sat in front of that symbol — present with the same signature and identical behaviour on 1.0.5 through 1.13.0-rc3 (checked functionally at both ends, withVector{Int}andVector{Bool}). The same file already usesBase._growat!andBase._deleteat!.Multi-value
pushfirst!broke in Julia 1.10.pushfirst!(X, a, b, c)reaches us asprepend!(X, (a, b, c)), whose Base fallback narrowed fromAnytoVector. Added a general-iterableprepend!beside the existingAbstractVectormethod;[x for x in items]always yields aVector, so it cannot recurse.reverse/reverse!became ambiguous in Julia 1.6, when Base typed its own positional arguments asIntegerwhile ours stayed untyped. Typed ours to match — strictly more specific on 1.6+, and equally unambiguous against the pre-1.6 untyped method. Their docstrings also claimed (start, count) semantics while the bodies always forwarded Base's (start, stop); corrected.promote_type(Any, DataValue{T})overflowed the stack. Base'smissing.jldefinespromote_rule(T::Type{>:Union{Missing,Nothing}}, S::Type) = Any, so for(Any, DataValue{Any})the two directions disagree — Base saysAny, we sayDataValue{Any}— andpromote_resultre-asks the same question forever. Added the mirror-image rule so both directions agree, keeping theDataValue{Any}answer. Every promotion case asserted intest_basederived.jlandtest_core.jlis unchanged. This was latent anywhereAnymet aDataValuein promotion, e.g.reduce(promote_type, ...)over column types in QueryOperators' pivot.The test bug
Reducecompared aDataValueArrayreduction against Base's for bit equality. Base'smapreduce_implover aVector{Float64}uses@simdand reassociates; accumulatingDataValues cannot vectorise and stays strictly sequential, so atN = 2050the two differ by exactly 1 ULP (5091.29121864207vs5091.291218642071). That has failed on every version since 1.0. Rather than relax the assertions, the data is now drawn from integers ≤ 1000, so every partial sum is exactly representable and reassociation cannot change the result — the fourisequal/==comparisons stay exact. KeepingFloat64storage leaves the sixDataValue{Float64}()expectations untouched.Verification
13/13 items pass on 1.0.5, 1.6.7, 1.10.12, 1.11.9, 1.12.7 and 1.13.0-rc3 — both sides of every Base transition in the table above.
No
Project.tomlchange: the version is already the unreleased1.0.0-DEV, andjulia = "1"still holds.🤖 Generated with Claude Code