Repository navigation
Respect destination dimensions in VectorOfArray broadcasting - #685
Draft
ChrisRackauckas wants to merge 2 commits into
Draft
ChrisRackauckas wants to merge 2 commits into
ChrisRackauckas wants to merge 2 commits into
Conversation
Slice operands using the destination dimension and preserve lower-dimensional arguments across inner arrays. Expand each inner broadcast to its destination axes, including static arrays and FastBroadcast extension paths. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Codex <noreply@openai.com> Agent-Harness: Codex CLI 0.162.1 Agent-Model: gpt-6.1-sol Agent-Session: 01a14bd6-bd53-7dd2-94c0-6f6613286f91
Construct the mutable StructArray fixture from SizedVector elements so it has an accessible field schema on Julia 1.10. Keep ordinary Vector storage and all 130 broadcast assertions, including the existing threaded scalar assignment. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Codex <noreply@openai.com> Agent-Harness: Codex CLI 0.164.0 Agent-Model: gpt-6.1-sol Agent-Session: local fixer job SciML__RecursiveArrayTools.jl__685 (no session URL)
This was referenced Nov 6, 2026
Open
This branch has not been deployed
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.
In-place
VectorOfArraybroadcasting slices array arguments along the destination's outer dimension. Lower-dimensional arguments broadcast across inner arrays, and singleton outer dimensions reuse their sole slice. Inner broadcasts use the destination axes for expansion, including immutable StaticArrays, StructArrays storage, and serial/Polyester FastBroadcast.Fixes #680
Keep this draft out of merge consideration until a maintainer has reviewed it. No public signatures or dependencies change.
Reproduction and regression evidence
Reproduced on default-branch commit
214fb8d556b24581e65015bdeb340102aa33a76d(package version 4.5.5) and the latest registered release, 4.5.5, with Julia 1.12.7. Both produce[11.0 24.0; 12.0 25.0; 13.0 26.0]for the issue's vector-addition example instead of dense-array broadcasting's[11.0 14.0; 22.0 25.0; 33.0 36.0].The new regression file compares against Base dense-array broadcasting for mutable vectors, SVectors, MVectors, StructArray storage, matrix inner arrays, zero-dimensional operands, singleton dimensions, and full-dimensional operands. It exercises serial and threaded FastBroadcast on SVector storage.
With the implementation fix stashed, running the regression file in a local environment that develops the checkout:
JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 timeout 3600 julia --project=tmp/main -e 'using RecursiveArrayTools, StaticArrays; v=VectorOfArray([SVector(1.,2.), SVector(3.,4.)]); f(v)=(v .= v .+ v); f(v); @show @allocated f(v); include("RecursiveArrayTools.jl/test/Core/voa_broadcast_dimensions.jl")'Relevant output (stack traces omitted):
After restoring the fix, the same regression file:
JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 timeout 3600 julia --project=tmp/main -e 'include("RecursiveArrayTools.jl/test/Core/voa_broadcast_dimensions.jl")'Validation
All Julia commands use
JULIA_NUM_THREADS=4,JULIA_NUM_PRECOMPILE_TASKS=4, andtimeout 3600.GROUP=Core julia --project=RecursiveArrayTools.jl -e 'using Pkg; Pkg.test()':Testing RecursiveArrayTools tests passed; includes all 130 new checks and the existing zero-allocation assertions.GROUP=QA julia --project=RecursiveArrayTools.jl -e 'using Pkg; Pkg.test()': 20/20 passed.julia --project=@runic -m Runic --inplaceon all six changed Julia files: passed.typos tmp/diff.patchon the complete diff, including the new test file, andgit diff --check: passed.Range-only FastBroadcast expressions can simplify to a range assignment before reaching these broadcast methods. A separate
@.. v = x + 1check with an SVector-backed destination andx = 10.:10.:30.fails on the unmodified default branch withsetindex!(::SVector{3, Float64}, value, ::Int) is not defined.That assignment path is outside this fix; the tests cover lower-dimensional ranges through Base broadcasting.Risk assessment
🤖 Posted by an AI agent — harness: Codex CLI 0.162.1 · model: gpt-6.1-sol
Conversation: Codex exec session 01a14bd6-bd53-7dd2-94c0-6f6613286f91 (no session URL)
Fix by Codex CLI 0.164.0 gpt-6.1-sol (head 5c18e1d)
Partial fix: the mutable StructArray fixture uses
SizedVector{3}elements, which have an accessible field schema on Julia 1.10. Ordinary Vector storage, the other static-array fixtures, and all 130 assertions remain. The scalar FastBroadcast expression and all assertions are unchanged.Failing-before / passing-after evidence
Before this commit, the full Core group on Julia 1.10.12 reproduced the reported CI failure:
GROUP=Core timeout 3600 julia +1.10 --project -e 'using Pkg; Pkg.test()'With the fixture correction, the same command completed successfully (1,415 passing assertions across Core; two existing broken assertions):
Validation
Julia runs used four threads and
timeout 3600. The final test file was compared byte-for-byte with the file from the passing full Core run.GROUP=QA timeout 3600 julia +1 --project -e 'using Pkg; Pkg.test()'Julia 1.13.3 output:
julia +1.12 --project=@runic -m Runic --inplace test/Core/voa_broadcast_dimensions.jl git diff HEAD^ HEAD > committed.diff typos committed.diff git show --format= --check HEADAll exited zero with no output. Docs, GPU, AD, downstream suites, other Julia versions, and benchmarks were not run for this fixture-only correction.
Remaining pre-existing failures
Downgraded Core remains red. The same downgrade action revision as the failed CI run resolved StructArrays 0.7.0, StaticArrays 1.6.0, FastBroadcast 1.3.0, and Polyester 0.7.16 in an isolated checkout. With those dependencies:
GROUP=Core timeout 3600 julia +1.10 --project -e 'using Pkg; Pkg.test(; allow_reresolve=false)'The scalar assignment also fails on the clean, unmodified PR parent
214fb8d556b24581e65015bdeb340102aa33a76d. A standalone reproducer importing only FastBroadcast and Polyester fails with a dense Vector on FastBroadcast 1.3.0 and passes unchanged on 1.3.1:The released upstream fix is SciML/FastBroadcast.jl@0711312 . This commit leaves the failing scalar assertion and compatibility bounds intact, following the instruction to leave pre-existing behavior unchanged. Default-branch Core and Downgrade checks pass because that branch does not contain this new regression file; that does not establish scalar correctness at the FastBroadcast floor.
SciMLSensitivity Core4 is also pre-existing: the exact PR-parent default push and the PR both fail
ensembles.jl:19, EnsembleThreads, withAssertionError: mi2 !== nothingin Enzymeparallelrules.jl:233, using the same Julia 1.13.2 and dependency versions. The latest default push has the same assertion. No local Core4 reproduction or causal bisect was completed; CI history establishes that the failure predates this PR.Next counted review must come from a smart model in a fresh session, not this fix session (risk.md § Independent reviews).
Links
🤖 Posted by an AI agent — harness: Codex CLI 0.164.0 · model: gpt-6.1-sol
Conversation: local fixer job SciML__RecursiveArrayTools.jl__685 (no session URL)