Skip to content

Document the upstream blocker for 32-bit Core CI - #626

Draft
ChrisRackauckas-Claude wants to merge 1 commit into
masterfrom
agent/625-green-ci
Draft

ChrisRackauckas-Claude wants to merge 1 commit into
masterfrom
agent/625-green-ci

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

🚧 UNREVIEWED — awaiting review by @ChrisRackauckas. Filed by an AI agent running as @ChrisRackauckas; Chris has not seen this.
Harness: Codex CLI 0.170.0 · Model: gpt-6.2-sol
Conversation: local session 01a20353-743e-7592-901a-61f377ff0088 (no session URL)

Part of #625. Please ignore this draft until @ChrisRackauckas reviews it.

The 32-bit Core lane fails when Flux precompilation reaches the PoCL backend in KernelAbstractions and GPUCompiler tries to build its SPIR-V runtime. This PR updates the lane's note in test/test_groups.toml to identify the upstream blocker. The parsed test matrix is identical to master.

CI evidence

The 32-bit Core job on Julia 1.13.3 installed Flux 0.16.15, NNlib 0.9.58, KernelAbstractions 0.10.4 and GPUCompiler 2.20.0. The job reported:

LoadError: Invalid return type for runtime function 'unbox_int64': expected LLVM.IntegerType(i64), got LLVM.VoidType(void)
Core/AD_compatibility.jl: Error During Test
Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.

The first error comes from GPUCompiler.emit_function! in src/rtlib.jl during Flux precompilation, before Surrogates assertions run. The last green 32-bit run used KernelAbstractions 0.9.45 and had the same QuasiMonteCarlo 0.4.4 and LatticeRules 0.0.2 as the failing run. There was no open Surrogates PR addressing this failure. Failing job, last green job.

GPUCompiler tracks the failure and has an open patch for the return ABI mismatch on i686. Upstream issue, upstream PR.

Local verification

  • Core on Julia 1.13.3 x86, exit 1. The first attempts hit PTHREAD ERROR in pthread_scheduler_init():310: Resource temporarily unavailable (11) while starting PoCL. The run below limits PoCL's workers and CPU affinity for local reproduction only. It reaches the same compiler error as CI using Flux 0.16.15, NNlib 0.9.61, KernelAbstractions 0.10.8 and GPUCompiler 2.23.4.

    POCL_MAX_PTHREAD_COUNT=4 POCL_CPU_MAX_CU_COUNT=4 GROUP=Core taskset -c 0-3 julia +1.13.3~x86 --startup-file=no --project -e 'import Pkg; Pkg.test(; julia_args = ["--check-bounds=yes", "--compiled-modules=yes", "--depwarn=yes"], allow_reresolve=true, coverage=true, force_latest_compatible_version=false)'
    ERROR: LoadError: Invalid return type for runtime function 'unbox_int64': expected LLVM.IntegerType(i64), got LLVM.VoidType(void)
    ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
    Test Summary:            | Error  Total     Time
    Core/AD_compatibility.jl |     1      1  1m07.8s
    ERROR: Package Surrogates errored during testing
    
  • Importing Flux in an isolated x86 environment reproduced the CI error with the five package versions shown below. PoCL needed a four-CPU affinity and explicit worker limits to start in the local 32-bit test process.

    JULIA_PKG_PRECOMPILE_AUTO=0 julia +1.13.3~x86 --startup-file=no --project="$flux_env" -e 'using Pkg; Pkg.add([PackageSpec(name=name, version=version) for (name,version) in [("Flux",v"0.16.15"),("NNlib",v"0.9.58"),("KernelAbstractions",v"0.10.4"),("GPUCompiler",v"2.20.0"),("LLVM",v"10.4.3")]]); Pkg.status()'
    POCL_MAX_PTHREAD_COUNT=4 POCL_CPU_MAX_CU_COUNT=4 taskset -c 0-3 julia +1.13.3~x86 --startup-file=no --project="$flux_env" -e 'using Flux; println("Flux loaded")'
    ERROR: LoadError: Invalid return type for runtime function 'unbox_int64': expected LLVM.IntegerType(i64), got LLVM.VoidType(void)
    
  • An isolated environment with KernelAbstractions 0.10.8 and GPUCompiler 2.23.4 reproduced the same compiler error on Julia 1.13.3 x86. The script loads neither Surrogates nor Flux.

    JULIA_PKG_PRECOMPILE_AUTO=0 julia +1.13.3~x86 --startup-file=no --project="$kernel_env" -e 'using Pkg; Pkg.add(["KernelAbstractions", "GPUCompiler"]); Pkg.status()'
    julia +1.13.3~x86 --startup-file=no --project="$kernel_env" "$kernel_env/reproduce.jl"
    using KernelAbstractions
    
    @kernel function fill_index!(a)
        i = @index(Global)
        a[i] = i
    end
    
    backend = CPU()
    a = zeros(Float32, 4)
    fill_index!(backend)(a; ndrange = length(a))
    KernelAbstractions.synchronize(backend)
    @assert a == Float32[1, 2, 3, 4]
    println("PoCL kernel completed")
    [61eb1bfa] GPUCompiler v2.23.4
    [63c18a36] KernelAbstractions v0.10.8
    ERROR: LoadError: Invalid return type for runtime function 'unbox_int64': expected LLVM.IntegerType(i64), got LLVM.VoidType(void)
    
  • QA on Julia 1.13.3 x64, exit 0.

    GROUP=QA julia +1.13.3 --startup-file=no --project -e 'using Pkg; Pkg.test()'
    Test Summary: | Pass  Total     Time
    QA/qa.jl      |   26     26  2m41.8s
         Testing Surrogates tests passed
    
  • Runic, typos, and the parsed matrix comparison exited 0.

    git ls-files -z '*.jl' | xargs -0 julia --startup-file=no --project=@runic -m Runic --check
    git ls-files | typos --force-exclude --file-list -
    git diff --name-only origin/master | typos --force-exclude --file-list -
    git diff --check
    git show origin/master:test/test_groups.toml | julia --startup-file=no -e 'using TOML; @assert TOML.parse(read(stdin, String)) == TOML.parsefile("test/test_groups.toml"); println("Test group configuration is identical to master")'
    Runic exit code: 0
    typos exit code: 0
    Test group configuration is identical to master
    

Draft CI

  • The 32-bit Core job on Julia 1.13.4 and GPUCompiler 2.23.4 reproduced the same unbox_int64 error and reported 0 passed, 0 failed, 1 errored. 32-bit Core job.
  • The stable and LTS 64-bit Core jobs both resolved Zygote 0.7.19 and ChainRules 1.74.14. Each reported 261 passed, 0 failed, 7 errored. The errors come from adding a MutableTangent to a named tuple or ref in Zygote's reverse pass. Stable Core job, LTS Core job.
  • Format, spelling, QA, documentation, downgrade tests, and both benchmarks passed. The existing prerelease gate skipped Core on the Julia 1.14.0 beta. The Dependabot workflow reported a startup failure with no jobs, also seen on the preceding PR. Draft checks, draft Dependabot run, preceding Dependabot run.

Zygote reproducer

An unmodified archive of the master tree at adeed82f reproduced the tangent error with Zygote 0.7.19.

git archive origin/master | tar -x -C "$master_tree"
julia +1.13.3 --startup-file=no --project="$master_tree" -e 'using Surrogates, Zygote; @show pkgversion(Zygote); model = InverseDistanceSurrogate([0.0, 2.0], [0.0, 4.0], 0.0, 2.0; p=2.0); @show Zygote.gradient(model, 0.5)'
pkgversion(Zygote) = v"0.7.19"
ERROR: MethodError: no method matching +(::ChainRulesCore.MutableTangent{InverseDistanceSurrogate{Vector{Float64}, Vector{Float64}, Float64, Float64, Float64}, @NamedTuple{x::Base.RefValue{ChainRulesCore.NoTangent}, y::Base.RefValue{Vector{Float64}}, lb::Base.RefValue{ChainRulesCore.NoTangent}, ub::Base.RefValue{ChainRulesCore.NoTangent}, p::Base.RefValue{ChainRulesCore.NoTangent}}}, ::@NamedTuple{x::Vector{Float64}, y::Vector{Float64}, lb::Nothing, ub::Nothing, p::Nothing})

The following standalone script imports only Zygote. With ChainRules fixed at 1.74.14, the assertion passes with Zygote 0.7.15 and the gradient call raises the same MethodError with 0.7.18 and 0.7.19.

JULIA_PKG_PRECOMPILE_AUTO=0 julia +1.13.3 --startup-file=no --project="$zygote_env" -e 'using Pkg; Pkg.add([PackageSpec(name="Zygote", version=VersionNumber(ARGS[1])), PackageSpec(name="ChainRules", version=v"1.74.14")]); Pkg.status()' "$zygote_version"
julia +1.13.3 --startup-file=no --project="$zygote_env" zygote-mwe.jl
using Zygote

mutable struct Model
    x::Vector{Float64}
    y::Vector{Float64}
end

function (m::Model)(v)
    length(m.x[1]) == length(v) || error("Dimension mismatch")
    d = [abs(v - m.x[i]) for i in eachindex(m.x)]
    d_min = minimum(d)
    w = (d ./ d_min) .^ (-2.0)
    return sum(w[i] * m.y[i] for i in eachindex(w)) / sum(w)
end

m = Model([0.0, 2.0], [0.0, 4.0])
result = Zygote.gradient(m, 0.5)
@show result
@assert only(result) ≈ 1.92
Zygote 0.7.15
result = (1.9199999999999997,)

Zygote 0.7.18 and 0.7.19
ERROR: LoadError: MethodError: no method matching +(::ChainRulesCore.MutableTangent{Model, @NamedTuple{x::Base.RefValue{ChainRulesCore.NoTangent}, y::Base.RefValue{Vector{Float64}}}}, ::@NamedTuple{x::Vector{Float64}, y::Vector{Float64}})

I ran git bisect start v0.7.18 v0.7.15 and used the standalone script with julia +1.13.3 --startup-file=no --compiled-modules=existing and a scratch project that developed the checked-out Zygote sources. Parent 727da5ef passed and the first bad commit 229ab20a reproduced the same error. The commit routes reductions over generators through new Zygote adjoints and is present from Zygote 0.7.16. Passing parent, first bad commit, Zygote PR.

The full local Core run on the same unmodified master tree also exited 1 and reproduced all seven errors from the 64-bit CI lanes.

JULIA_NUM_PRECOMPILE_TASKS=4 OPENBLAS_NUM_THREADS=1 JULIA_KA_CPU_THREADS=4 GROUP=Core julia +1.13.3 --startup-file=no --project="$master_tree" -e 'import Pkg; Pkg.test(; julia_args = ["--check-bounds=yes", "--compiled-modules=yes", "--depwarn=yes"], allow_reresolve=true, coverage=true, force_latest_compatible_version=false)'
ERROR: LoadError: Some tests did not pass: 261 passed, 0 failed, 7 errored, 0 broken.
Test Summary:                                 | Pass  Error  Total      Time
Core/AD_compatibility.jl                      |  261      7    268  33m44.4s
ERROR: Package Surrogates errored during testing

Remaining work

The 32-bit Core job needs a compatible GPUCompiler release. The stable and LTS 64-bit Core jobs need a compatible Zygote release. This PR adds no dependency constraint or test workaround. The reviewer should confirm the upstream links and the parsed matrix comparison. Docs, downgrade, benchmark, and LTS verification came from GitHub CI. The existing prerelease gate prevented a prerelease test run.

Risk assessment

  • Risk: low
  • Blast radius: One comment in the test matrix. No executable code or public API change.
  • Evidence: Identical parsed TOML, local Core and QA output, three draft Core job logs, and independent reproductions of the two dependency failures.
  • Independent review: Pending.
  • Merge: Needs human review. The dependency failures still block green Core CI.

🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.2-sol
Conversation: local session 01a20353-743e-7592-901a-61f377ff0088 (no session URL)

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

Fix by opencode 2.0.27 opencode-go/glm-5.3 (head f91371c, unchanged)

No code change was made, and none is needed: all three failing checks of run 45026152625 are proven pre-existing (upstream dependency causes, reproduced on the default branch), and the PR's diff is a two-line comment change in test/test_groups.toml whose parsed matrix is identical to master. This section records the fresh verification behind that statement.

64-bit legs — Zygote MutableTangent regression, present on the default branch

Both Core (julia 1, ubuntu-latest) and Core (julia lts, ubuntu-latest) resolved Zygote v0.7.19 + ChainRules v1.74.14 and failed 7 assertions in test/AD_compatibility.jl:

MethodError: no method matching +(::ChainRulesCore.MutableTangent{Surrogates.InverseDistanceSurrogate{...}, @NamedTuple{...}}, ::@NamedTuple{x::Vector{Float64}, y::Vector{Float64}, lb::Nothing, ub::Nothing, p::Nothing})
Test Summary:                                 | Pass  Error  Total     Time
ERROR: LoadError: Some tests did not pass: 261 passed, 0 failed, 7 errored, 0 broken.

Zygote v0.7.19 was registered at 2026-11-22T10:41Z, about 2.5 hours before the run was created (13:11Z). The comparison base run on master (41773291651, created 2026-11-04) predates Zygote v0.7.16 (registered 2026-11-06), so it resolved Zygote v0.7.15 (its job log confirms + Zygote v0.7.15) and passed both 64-bit legs. The "base-green" classification for the 64-bit legs is therefore stale: the breakage arrived with the Zygote releases between the two runs, not with this PR.

Fresh local runs today (CI-equivalent command, fresh resolve picking Zygote v0.7.20 — registered 2026-11-23, i.e. newer than the failing run — with the same ChainRules v1.74.14 and ChainRulesCore v1.26.8 as the failing run):

GROUP=Core julia +1.13.3 --startup-file=no --project=. -e 'import Pkg; Pkg.test(; julia_args = ["--check-bounds=yes", "--compiled-modules=yes", "--depwarn=yes"], allow_reresolve=true, coverage=false, force_latest_compatible_version=false)'

PR head, Julia 1.13.3 (exit 1):

Test Summary:                                 | Pass  Error  Total      Time
Core/AD_compatibility.jl                      |  261      7    268  10m05.6s
ERROR: LoadError: Some tests did not pass: 261 passed, 0 failed, 7 errored, 0 broken.

Unmodified export of master (adeed82f), Julia 1.13.3 (exit 1) — the default branch fails identically:

Test Summary:                                 | Pass  Error  Total      Time
Core/AD_compatibility.jl                      |  261      7    268  10m05.0s
ERROR: LoadError: Some tests did not pass: 261 passed, 0 failed, 7 errored, 0 broken.

PR head, Julia 1.10.12 (lts lane, exit 1):

Test Summary:                                 | Pass  Error  Total     Time
Core/AD_compatibility.jl                      |  261      7    268  9m52.6s
ERROR: LoadError: Some tests did not pass: 261 passed, 0 failed, 7 errored, 0 broken.

All 7 errors sit at the same AD_compatibility.jl locations as the CI logs (lines 531, 543, 746, 785, 800, 845, 1107) with the same MutableTangent MethodError.

Zygote v0.7.20 does not fix the regression. A standalone script that imports only Zygote — a mutable struct holding two vectors, reduced over a generator, Zygote.gradient(m, 0.5), ChainRules pinned at v1.74.14 — passes on Zygote v0.7.15 and raises the identical MethodError on v0.7.19 and v0.7.20, so a CI rerun today resolves v0.7.20 and stays red on both 64-bit legs. This matches the bisect already recorded in the PR body (first bad commit 229ab20a, in releases since 0.7.16).

Zygote v0.7.15: result = (1.9199999999999997,)   MWE PASSED
Zygote v0.7.19: ERROR: LoadError: MethodError: no method matching +(::ChainRulesCore.MutableTangent{Model, @NamedTuple{x::Base.RefValue{ChainRulesCore.NoTangent}, y::Base.RefValue{Vector{Float64}}}}, ::@NamedTuple{x::Vector{Float64}, y::Vector{Float64}})
Zygote v0.7.20: ERROR: LoadError: MethodError: no method matching +(::ChainRulesCore.MutableTangent{Model, @NamedTuple{x::Base.RefValue{ChainRulesCore.NoTangent}, y::Base.RefValue{Vector{Float64}}}}, ::@NamedTuple{x::Vector{Float64}, y::Vector{Float64}})

x86 leg — GPUCompiler 32-bit runtime build, already red on the default branch

Core (julia 1, ubuntu-latest, x86) resolved Flux v0.16.15, KernelAbstractions v0.10.8 and GPUCompiler v2.23.4 and failed during Flux precompilation, before any Surrogates test executes:

ERROR: LoadError: Invalid return type for runtime function 'unbox_int64': expected LLVM.IntegerType(i64), got LLVM.VoidType(void)
LoadError: The following 1 package failed to precompile:
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.

The identical error already fails the default branch's own latest run (master, run 41773291651, job 126387821848), so this leg is pre-existing by definition. The 32-bit host fix is still open upstream (JuliaGPU/GPUCompiler.jl#1062, issue #1085) and no GPUCompiler release contains it (latest v2.23.4 was registered 2026-11-19, before the run).

What remains

  • Both 64-bit legs need a Zygote release that fixes MutableTangent accumulation (+ between a ChainRulesCore.MutableTangent and a NamedTuple cotangent).
  • The x86 leg needs a GPUCompiler release carrying the 32-bit runtime fix.
  • Until those land, every branch of this repository — including master on its next push — is red on these lanes; re-running this PR's CI today resolves Zygote v0.7.20 and reproduces the same three failures.

Next counted review must come from a smart model in a fresh session, not this fix session.


🤖 Posted by an AI agent — harness: opencode 2.0.27 · model: opencode-go/glm-5.3
Conversation: local session ses_df2d72772ffeaiKnj0vWPE3vBp (no session URL)

Flux precompilation exercises the GPUCompiler SPIR-V runtime through PoCL. Record the upstream issue next to the hard-failing 32-bit lane.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6.2-sol
Agent-Job: 625-codex
Agent-Session: local session 01a20353-743e-7592-901a-61f377ff0088 (no session URL)
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

I reproduced all three failing legs from PR head f91371c9 locally. Stable and LTS each fail in Core/AD_compatibility.jl with 261 passed and 7 errored; x86 fails while Flux precompiles, before Surrogates assertions run. The same failures are already documented against the unmodified default branch in this PR’s earlier investigation, so this retry provides no evidence of a repository regression and no safe package-side fix.

Julia 1.13.3, 64-bit: Core/AD_compatibility.jl | 261 passed, 7 errored, 268 total
Julia 1.10.12 LTS:     Core/AD_compatibility.jl | 261 passed, 7 errored, 268 total
Julia 1.13.3, x86:    Core/AD_compatibility.jl | 0 passed, 0 failed, 1 errored

The 64-bit errors are Zygote MethodErrors adding ChainRulesCore.MutableTangent to a named-tuple cotangent. The x86 error is Invalid return type for runtime function 'unbox_int64': expected LLVM.IntegerType(i64), got LLVM.VoidType(void) in GPUCompiler’s SPIR-V runtime emission. The x86 CI failure log and the local run show the same error. GPUCompiler’s 32-bit support PR and tracking issue remain open. Zygote’s latest release is 0.7.20; pinning users to an older Zygote or changing tests would hide an upstream compatibility failure, so I made no code or dependency change.

Commands used (with the juliaup versions named):

GROUP=Core julia +1.13.3 --startup-file=no --project -e 'import Pkg; Pkg.test(; julia_args = ["--check-bounds=yes", "--compiled-modules=yes", "--depwarn=yes"], allow_reresolve=true, coverage=false, force_latest_compatible_version=false)'
GROUP=Core julia +lts --startup-file=no --project -e 'import Pkg; Pkg.test(; julia_args = ["--check-bounds=yes", "--compiled-modules=yes", "--depwarn=yes"], allow_reresolve=true, coverage=false, force_latest_compatible_version=false)'
GROUP=Core taskset -c 0-3 julia +1.13.3~x86 --startup-file=no --project -e 'import Pkg; Pkg.test(; julia_args = ["--check-bounds=yes", "--compiled-modules=yes", "--depwarn=yes"], allow_reresolve=true, coverage=false, force_latest_compatible_version=false)'

There is no passing-after-fix result because no Surrogates fix is supported by these results. This PR should remain blocked pending compatible upstream dependency releases.


🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6-luna
Conversation: local job 625-codex (no session URL)

@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Diagnosis record for this PR's remaining red legs (the fixer's own posting attempts failed repeatedly with GitHub API server errors; this is the fallback record).

64-bit Core (Julia 1 and LTS): fails with Zygote MutableTangent accumulation MethodErrors — locally reproduced twice: 261 passed, 7 errored on both channels. A sibling investigation bisected the regression to Zygote 0.7.16 (QuasiMonteCarlo.jl scheduled IntegrationTest: green 289/289 on Zygote 0.7.15 at the same commit on Nov 2; first 7-error failure on Nov 8 with Zygote 0.7.16 and the same ChainRulesCore 1.26.8; repeats on 0.7.18 and 0.7.19). The bisection and a standalone callable-inverse-distance MWE (Zygote + LinearAlgebra only) are recorded on SciML/QuasiMonteCarlo.jl#204.

x86 Core: fails during Flux precompilation in GPUCompiler — SPIR-V unbox_int64 return-ABI mismatch; upstream GPUCompiler issue #1085 and PR #1062 remain open.

Upstream issue search: no matching open issue found on FluxML/Zygote.jl for MutableTangent / accumulation MethodError variants. Filing there needs maintainer confirmation, so no upstream issue was filed from this job; the evidence above is ready to paste.

No package-side change is safe for these two dependency defects; no test, expectation, or matrix entry was weakened, skipped, or gated.


🤖 Posted by an AI agent — harness: Claude Code 2.1.331 · model: qwen3.8-flash-next
Conversation: local session a09f46d7-b920-4f6d-9b42-767a8886bd17 (no session URL)

This branch has not been deployed

No deployments
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