Skip to content

Fix scalar indexing of offset inner arrays - #691

Open
ChrisRackauckas-Claude wants to merge 1 commit into
masterfrom
agent/675-issue-675
Open

ChrisRackauckas-Claude wants to merge 1 commit into
masterfrom
agent/675-issue-675

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Nov 27, 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.1-terra
Conversation: local session 01a21b42-61bb-7543-b515-20b0fa4883f0 (no session URL)

Scalar indexing translates the wrapper's one-based positions to each inner array's axes, including scalar writes. This prevents invalid unchecked reads and preserves ragged zero padding.

Closes #675

Verification

Before the fix, GROUP=Core julia --project -e 'using Pkg; Pkg.test()' reported:

Expression: O[1, 1] == 1.0
Evaluated: 2.0 == 1.0
Expression: O[3, 1] == 3.0
BoundsError: attempt to access 3-element OffsetArray
Offset inner arrays use positional indices |          1      2              3   3.6s

After the fix:

GROUP=Core julia --project -e 'using Pkg; Pkg.test()':

Test Summary:           | Pass  Broken  Total   Time
VecOfArr Indexing Tests |  214       2    216  24.7s
Test Summary:            | Pass  Total   Time
VecOfArr Interface Tests |  194    194  33.1s
Test Summary:     | Pass  Total  Time
Measurement Tests |    2      2  1.6s
     Testing RecursiveArrayTools tests passed

GROUP=QA julia --project -e 'using Pkg; Pkg.test()':

QA            |   20     20  33.5s
     Testing RecursiveArrayTools tests passed

Julia Runic --check on the two changed files, git diff | typos -, and git diff --check all exited 0. A separate run with normal bounds settings checked the reported scalar access and collect: 2 regression checks passed.

julia --project=docs docs/make.jl in an isolated copy with an instantiated docs environment:

[ Info: Doctest: running doctests.
[ Info: CheckDocument: running document checks.
[ Info: HTMLWriter: rendering HTML pages.

GPU, downstream, and allowed-to-fail jobs were not run locally. CI’s OrdinaryDiffEq downstream job raised IllegalTypeAnalysisException in loss_mixed on Julia 1.13.4; the same error reproduced locally on the unmodified base commit, using Julia 1.13.4 and the downstream CI revision. It also appeared in an earlier run on another branch. SciMLSensitivity Core2 also reported three unexpected passes and a ReverseDiff tape error; the earlier run on another branch reported the same errors. The SciMLSensitivity Core2 group reproduced the same four errors locally on the unmodified base commit with Julia 1.13.4 and the downstream CI revision (194 passed, 4 errors, 6 broken). Neither baseline failure was bisected. Slicing with offset inner arrays and offset outer containers were not covered by this change.

Reviewer consideration: scalar writes use positional translation too; other indexing paths remain outside this fix.

Risk assessment

  • Risk: medium
  • Blast radius: scalar indexing and assignment on all AbstractVectorOfArray implementations; no new API.
  • Evidence: failing-before and passing-after tests above.
  • Independent review: pending; this job runs alone.
  • Merge: needs human review and CI.

🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.1-terra
Conversation: local session 01a21b42-61bb-7543-b515-20b0fa4883f0 (no session URL)

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6.1-terra
Agent-Job: 675-codex
Agent-Session: local session 01a21b42-61bb-7543-b515-20b0fa4883f0 (no session URL)
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review November 27, 2026 11:49

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.

VectorOfArray with OffsetArray inner arrays returns garbage from A[i,j] (@inbounds after size-only check)

2 participants