Fix ArrayPartition A[:] DimensionMismatch (#661) - #664
Merged
ChrisRackauckas merged 2 commits intoSep 26, 2026
Merged
ChrisRackauckas merged 2 commits into
ChrisRackauckas merged 2 commits into
Conversation
Require at least one index after Colon in the (colon, j...) getindex method so A[:] dispatches to the flattening Colon method instead of broadcasting getindex over empty indices. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/jobs/fix-RecursiveArrayTools.jl-661/log.txt on amdci2.julia.csail.mit.edu
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/jobs/fix-RecursiveArrayTools.jl-661/log.txt on amdci2.julia.csail.mit.edu
ChrisRackauckas
marked this pull request as ready for review
September 26, 2026 13:01
Merged
ChrisRackauckas
referenced
this pull request
Sep 26, 2026
Agent-Harness: Claude Code Agent-Model: claude-opus-5-5[1m] Agent-Session: local Claude Code session 3cd6500a-1f81-46b5-ac0b-c466e15b6a53 on Chris's Mac (session ID, no URL) Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Summary
A[:]onArrayPartitionwas dispatching to the(colon, j...)method introduced in PR #239 with an emptyj, which broadcastgetindexover zero indices and threwDimensionMismatch. The fix requires at least one index afterColon(j, js...) soA[:]uses the existing flattening::Colonmethod, whileA[:, j...]from #239 is unchanged.Bisect: first bad commit is
ba36f16("Fix (colon,j...) indexing of ArrayPartition", PR #239). Parentba36f16^returns the flattened vector;ba36f16breaksA[:](initiallyMethodErroronisless(::Int, ::Colon));1ce74b8b("oops add the dispatch") changes the failure to the currentDimensionMismatch.Failing before (src fix stashed; regression testset)
(The 4 passes are range indexing and
(colon, j...)checks; allA[:]asserts error.)Passing after
Test group run
GROUP=Core julia --project=. -e 'using Pkg; Pkg.test()'— passed.What was not verified
setindex!withA[:](out of scope)What a reviewer should push back on
j, js...(at least one index) is the preferred fix vs making the flatten::Colonmethod win on specificity another wayArrayPartitionflatten viaChainis the desired semantics forA[:]in all casesA[:]throws DimensionMismatch #661Fixes #661
Please ignore this draft until reviewed by @ChrisRackauckas.
Risk assessment
getindex(::ArrayPartition, ::Colon, j, js...)signature, tightened so thatA[:]dispatches to the existing flatteninggetindex(::ArrayPartition, ::Colon)method.A[:, j...]behaviour is unchanged.A[:]threw on every ArrayPartition since Fix (colon,j...) indexing of ArrayPartition #239 and now returns the flattened vector. No other public API change.DimensionMismatchand pass on the PR head. I reran this independently: PR head 5/5 pass, master src gives the 2 DimensionMismatch errors.🤖 Generated with Cursor Agent CLI 2026.09.26-dd393fe (model: auto), transcript /home/crackauc/sandbox/goals/issue-backlog/jobs/fix-RecursiveArrayTools.jl-661/log.txt on amdci2.julia.csail.mit.edu
Made with Cursor
Risk assessment and review by 🤖 Claude Code (model: claude-opus-5-5[1m]), https://claude.ai/code/session_01NdFVhANTF4nepTbqYxjfRP