Skip to content

Validate shapes in update_component_array (companion to #304) - #437

Draft
pankgeorg wants to merge 14 commits into
SciML:mainfrom
pankgeorg:update-component-array-validation
Draft

pankgeorg wants to merge 14 commits into
SciML:mainfrom
pankgeorg:update-component-array-validation

Conversation

@pankgeorg

@pankgeorg pankgeorg commented Nov 29, 2026 •

Copy link
Copy Markdown

Companion to #304: keeps its commits, merges current main, and validates names and shapes in update_component_array before writing, per the review in #304 (comment).

Scope

  • Only fields named in the update change. A structural mismatch at a known key (named block vs plain vector, matrix leaf vs vector), or a named field whose backing indices alias another field, throws an ArgumentError before anything is written. Neither input is mutated, and the result keeps the default's axes and element type in writable storage (including view-, range- and offset-backed defaults without OffsetArrays loaded). Traversal is limited to ComponentVector. Tests are in test/update_tests.jl.
  • Storage: CPU arrays (including offset arrays) and one-based GPU arrays on the same backend. Other combinations throw before writing (one helper).

Out of scope / follow-up

  • Offset GPU views, cross-backend updates, multi-device GPU affinity, Reactant, and ComponentMatrix updates.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HN2L2WfNr9MSqkXLDjQPDA

@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #437

Reviewed head: 16e5e7b
Raw SHA-256: 71fab43b797c97a65a168d2e8f3f221d9516c53873a2bcff3ae3e6cc0fb8b2f9
Source SHA-256: 6efbf28878a76aa4bddb37cc5d329777a08f31b08ae99fd5c6e44141956a761e
Source: operator-attested-codex-v1 (runner attested by pankgeorg)
Reviewer session: 01a2265a-58bd-7370-9fa6-44850a5970c6
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: CHANGES
  • Reviewed head: 16e5e7b

Review report

VERDICT: CHANGES
PR: #437
Head: 16e5e7b
Base: 277ad9c
Reviewer: codex-cli 0.172.0 / gpt-6.2-sol
Session: 01a2265a-58bd-7370-9fa6-44850a5970c6

Risk

medium-low (ML7: The patch adds an opt-in public API for structured updates to ComponentVector.)

Blocking findings

  • P1 · src/componentarray.jl:638 — A CPU-backed array component sent to a CUDA-backed default reaches GPU broadcast with its host storage still attached. The helper in ext/ComponentArraysGPUArraysExt.jl:18 handles GPU sources only. For example, a CPU patch ComponentVector(x = Float32[3, 4]) targeting a CuArray-backed x would send a view of a host Vector to a kernel whose CUDA argument adaptor rejects host arrays. This finding comes from reading the local GPUArrays and CUDACore sources. Stage the source on the destination backend before broadcasting, and verify the mixed-storage case on a physical GPU.
  • P2 · src/componentarray.jl:619 — Reproduced ArgumentError: step cannot be zero when updating two vectors with the same stored layout for block = [(a = Int[],), (a = Int[],)]. Construction succeeds, but the update reaches the existing partition iterator with a zero step before it can compare the layouts. Handle compatible zero-width partitions before constructing views, and add a test that updates another field while preserving the empty block.

Nonblocking findings

  • test/GPU/gpu_tests.jl:94 — In the identity cases, the CPU-backed input and the fixture used to check it share storage. An in-place mutation could therefore pass the preservation assertion. Snapshot both inputs before the call and compare their contents against those snapshots. The expected output values are independent literals, and the patch leaves existing test assertions and skip conditions intact.

What I ran

  • diff -qr before head, git -C before apply --check ../changes.diff, and git -C head apply --reverse --check ../changes.diff. The five changed files matched the supplied patch, and both patch checks passed. The workspace supplied no separate target/ checkout.
  • GROUP=Core julia --startup-file=no --project=.review-env head/test/runtests.jl and the corresponding before run in an offline environment. On Julia 1.13.4, head had 569 passes and base had 506 passes, with 11 existing broken checks on each. The head Core run on Julia 1.10.14 had 571 passes and 9 existing broken checks.
  • Ran head/test/update_tests.jl directly against each snapshot. All 63 assertions passed on head on both Julia versions. The base run stopped at UndefVarError because the API is new.
  • Ran head/test/GPU/gpu_tests.jl with scalar indexing disabled on JLArrays 0.3.3/GPUArrays 11.5.16 and JLArrays 0.4.2/GPUArrays 12.2.0. Each run had 66 passes, including 36 new assertions, and one existing broken check. The base run on GPUArrays 11 had 30 passes and the same broken check.
  • Ran local probes for matrix and record updates, strided views, static backing, offset indices, and zero-width records. The offset-view update passed with collect; my initial probe raised during Array conversion of the returned offset backing. The documented example produced the stated output.

What I did not verify

  • Physical GPU execution. The AArch64 environment exposed no GPU device, so the CUDA kernel path remains unexecuted.
  • Head CI, downstream, autodiff, Reactant, QA, the documentation build, and the 32-bit and prerelease lanes. ci.json lists zero head checks and two base Downstream failures whose logs were unavailable locally.
  • Performance. I found no before/after benchmark or performance claim for the new API.

Head link: 16e5e7b


🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol
Conversation: local session 01a2265a-58bd-7370-9fa6-44850a5970c6 (no session URL)

@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #437

Reviewed head: de38e08
Raw SHA-256: f48701db7159bc2e7e28731167ff03bab7fa2fa706f13ec1343b136ec672e45d
Source SHA-256: 19c4755bd632275b4fd00933f629a27e30c52773ab1ef1abde386ab544abb462
Source: operator-attested-codex-v1 (runner attested by pankgeorg)
Reviewer session: 01a2268b-e7aa-7112-b6d0-826be783efb0
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: CHANGES
  • Reviewed head: de38e08

Review report

VERDICT: CHANGES
PR: #437
Head: de38e08
Base: 277ad9c
Reviewer: codex-cli 0.172.0 / gpt-6.2-sol
Session: 01a2268b-e7aa-7112-b6d0-826be783efb0

Risk

medium-low (ML7: The patch adds an opt-in public API for structured updates on CPU and GPU-backed component vectors.)

Blocking findings

  • P2 · src/componentarray.jl:595 · Offset GPU backing triggers scalar indexing. With JLArrays.allowscalar(false), a default built as ComponentVector(OffsetArray(jl(Float32[1, 2, 3]), 0:2), Axis(x = 0, b = 1:2)) throws Scalar indexing is disallowed during the initial copy, even for an empty update. I reproduced this on Julia 1.10.14 and 1.13.4. On 1.13.4, copy(default) succeeded, and using that vector as the source for a CPU array-field update also threw. Route copies and leaf transfers through the wrapped GPU storage with translated indices, preserve the offset axes, and add public-API tests for both input positions.

Nonblocking findings

None

What I ran

  • diff -qr before head, git apply --stat changes.diff, a forward git apply --check in before/, and a reverse check in head/. Both apply checks passed and the snapshots differed in the five files listed by the patch. The target SHA matches the supplied base SHA, and there was no separate target/ snapshot.
  • GROUP=Core julia --startup-file=no --project=.review/core head/test/runtests.jl on Julia 1.13.4. All 576 active checks passed, including the 70 new update checks. The runner reported 11 pre-existing broken checks. The focused update file also passed all 70 checks on Julia 1.10.14. Running that file against before/ stopped at UndefVarError because the new API was absent.
  • julia --startup-file=no --project=.review/gpu head/test/GPU/gpu_tests.jl with JLArrays 0.3.3 and GPUArrays 11.5.16, then direct runs with the same dependency versions on Julia 1.10.14 and with JLArrays 0.4.2 and GPUArrays 12.2.0 on Julia 1.13.4. Each run passed 70 checks, including all 40 additions, and reported one pre-existing broken check. The base GPU file passed its 30 active checks with that same broken check.
  • Local CPU and JLArrays probes passed 27 checks covering matrix leaves, arrays of records, empty leaves, and view-backed inputs. Six strided-shape checks passed on each Julia version. The offset GPU case errored on both. A separate 12-assertion probe confirmed InexactError and input preservation on failed integer conversion. The docstring example matched its expected REPL display.
  • Reviewed the test expectations and SciMLTesting discovery rules. The new value checks use literal expectations. Axes, type, and mutation checks compare against the inputs or snapshots taken before the update. The patch adds no skips and weakens no existing assertions.
  • Parsed ci.json. It records zero head checks, 17 base successes, eight skips, and two base Downstream failures. Those results supply no execution evidence for the changed head paths. Base Downstream LTS · Base Downstream Julia 1

What I did not verify

  • No GPU device was exposed on this ARM64 runner. JLArrays exercised CPU-to-GPU, GPU-to-CPU, and same-backend dispatch in emulation. Physical GPU transfers and the different-backend fallback in ext/ComponentArraysGPUArraysExt.jl:29 remain unverified.
  • I did not run the full Core suite on Julia 1.10, the prerelease or 32-bit matrices, the Downstream group, or the full documentation build.
  • The patch makes no performance claim and supplies no before/after benchmark results. I did not run a benchmark.

Head link: de38e08


🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol
Conversation: local session 01a2268b-e7aa-7112-b6d0-826be783efb0 (no session URL)

@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #437

Reviewed head: 365f228
Raw SHA-256: fc1dfc93b079af63c3661273d2a04f630d6f9a5b0e35447fa0bd5fce043e1e1e
Source SHA-256: 3aa3d9cb831034bc1dca179ac62688d08ac22ff0b4a75852364a9585c9d4060a
Source: operator-attested-codex-v1 (runner attested by pankgeorg)
Reviewer session: 01a226bd-4ae1-7ab0-b6fa-ae11325e1ce0
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: CHANGES
  • Reviewed head: 365f228

Review report

VERDICT: CHANGES
PR: #437
Head: 365f228
Base: 277ad9c
Reviewer: codex-cli 0.172.0 / gpt-6.2-sol
Session: 01a226bd-4ae1-7ab0-b6fa-ae11325e1ce0

Risk

medium-low (ML7: update_component_array adds an opt-in public API for recursively updating a copy of a ComponentVector.)

Blocking findings

  • P2 — ext/ComponentArraysGPUArraysExt.jl:29, ext/ComponentArraysGPUArraysOffsetArraysExt.jl:3. The repository’s ExplicitImports checks pass on the merge base and fail on the head. GPUArrays.get_backend is accessed through a module that neither owns nor exports it, and the checks also flag private helper and Base references when both extensions are loaded. Use KernelAbstractions.get_backend through a declared extension dependency, replace private Base calls where practical, and document narrowly scoped QA exceptions for the remaining intentional internal references. Add OffsetArrays to the QA environment and assert that the new extension loads so those checks cover it.
  • P2 — src/componentarray.jl:656. A GPU-backed update built from view(PermutedDimsArray(gpu_matrix, (2, 1)), :, 2) throws Scalar indexing is disallowed when applied to a CPU default. I reproduced this with scalar indexing disabled on GPUArrays 11.5.16 and 12.2.0. The nested view falls outside AnyGPUArray, so the leaf copy uses Base’s scalar loop. Normalize the wrapper to a GPU-native view before copying, and add an end-to-end regression with scalar indexing disabled.

Nonblocking findings

  • test/GPU/gpu_tests.jl:82 covers scalar and vector leaves. Named-record recursion and matrix-shaped leaves passed in local JLArrays probes, but the checked-in GPU suite leaves those combinations uncovered. Add both cases with literal expected values.

What I ran

  • Applied changes.diff to a scratch copy of before/ with git apply and compared it with head/ using diff -qr. The trees matched.
  • GROUP=Core julia --startup-file=no --project=.review/core head/test/runtests.jl passed on Julia 1.13.4 with 606 passes and 11 existing broken checks. The new update tests accounted for 100 passes. Direct runs of head/test/update_tests.jl also passed on Julia 1.10.14 and in a Julia 1.13.4 process with the GPU extension unloaded. Running the same file against before/ stopped at the first call because the API was absent.
  • Ran test/GPU/gpu_tests.jl with julia --startup-file=no --project=.review/head and julia +lts --startup-file=no --project=.review/lts. Both runs reported 196 passes and one existing broken check. The runs used JLArrays 0.4.2 with GPUArrays 12.2.0 and JLArrays 0.3.3 with GPUArrays 11.5.16, respectively.
  • Ran .review/qa_gpu.jl with the repository’s ExplicitImports settings. The merge base passed all six checks. The head failed two on GPUArrays 11.5.16 and three on GPUArrays 12.2.0 with the OffsetArrays extension loaded. A separate check of the OffsetArrays extension reproduced the private Base references.
  • Ran .review/probes.jl, .review/offset_gpu_selectors.jl, and .review/gpu_nested_wrapper.jl for reordered and nested records, shaped leaves, offset selectors, and wrapped GPU storage. The nested permutation view reproduced the blocking failure. The documented zero-width restriction also reproduced. The added tests use literal expected values or input snapshots for preservation checks, and the patch removes or relaxes no existing assertions.
  • Parsed ci.json locally. The head has no recorded checks. The base has 17 successes, 11 skips, and two downstream failures. Base downstream LTS · Base downstream stable

What I did not verify

  • This Linux aarch64 workspace exposed no GPU device nodes. JLArrays exercised the GPU dispatch on CPU, leaving physical-device behavior and the cross-backend host-staging branch at ext/ComponentArraysGPUArraysExt.jl:29 unverified.
  • I did not run full QA, downstream, or the full Julia and dependency compatibility matrix. No before/after benchmark results were supplied, and the patch makes no performance claim.

Head link: 365f228


🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol
Conversation: local session 01a226bd-4ae1-7ab0-b6fa-ae11325e1ce0 (no session URL)

@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #437

Reviewed head: 78f541b
Raw SHA-256: 8cf51355e01efff7951ccb9458735a28f01f320a4a40f9ecffc5aeb8ff662e99
Source SHA-256: 858e60c63e0b9ab86d46246bd8014b822673352aa2ef558bd377ab057c770e7d
Source: operator-attested-codex-v1 (runner attested by pankgeorg)
Reviewer session: 01a22789-048f-7fe3-bd16-c3b56e2160c9
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: CHANGES
  • Reviewed head: 78f541b

Review report

VERDICT: CHANGES
PR: #437
Head: 78f541b
Base: 277ad9c
Reviewer: codex-cli 0.172.0 / gpt-6.2-sol
Session: 01a22789-048f-7fe3-bd16-c3b56e2160c9

Risk

medium-low (ML7: The patch exports a new structured update operation for ComponentVector and adds optional GPU and offset-array integration.)

Blocking findings

  • P2 — src/componentarray.jl:623. A valid scalar field is rejected when its axis uses a different integer type. On Julia 1.13.4, update_component_array(ComponentVector([1, 2], Axis(x = Int32(1), y = 2)), ComponentVector(x = 9)) throws ArgumentError even though both x properties are scalars. The expected backing is [9, 2]. ComponentIndex assigns NullAxis only to Int selectors. Classify scalar integer selectors consistently and add a regression in both update directions that also checks a one-element vector is still rejected.
  • P2 — ext/ComponentArraysGPUArraysOffsetArraysExt.jl:4. The new no_offset_view import fails the configured all_explicit_imports_are_public check with OffsetArrays 1.17.0, which test/qa/Project.toml:25 permits. I reproduced the error on Julia 1.13.4. The same check passes with OffsetArrays 1.18.0. Add a version-scoped QA exception for this documented import on releases that lack the public declaration.

Nonblocking findings

None

What I ran

  • git apply --check, git apply --reverse --check, and diff -qr .review-env/applied head confirmed that applying changes.diff to a scratch copy of before/ reproduces head/. The changed Julia and TOML files also parsed successfully.
  • GROUP=Core julia --startup-file=no --project=.review-env/head head/test/runtests.jl passed on Julia 1.13.4 with 606 passes and 11 existing expected-broken checks. Direct include("head/test/update_tests.jl") runs passed all 100 assertions on Julia 1.13.4 and 1.10.14. The new tests use independent expected values, and the patch leaves existing numerical assertions in place.
  • Direct include("head/test/GPU/gpu_tests.jl") runs passed with scalar indexing disabled on Julia 1.10.14 with JLArrays 0.3.3 and GPUArrays 11.5.16, and on Julia 1.13.4 with JLArrays 0.4.2 and GPUArrays 12.2.0. Each run had 200 passes and one existing expected-broken check. The matching base run on Julia 1.13.4 had 30 passes and the same expected-broken check.
  • A Julia Test repro for the mixed integer axes failed on head in both update directions. A process-local trial that classified all Integer selectors as scalar passed both directions and still rejected a scalar-to-singleton-vector update. Additional CPU and JLArrays probes returned the expected values for offset selectors, matrix leaves, and arrays of named records.
  • julia --startup-file=no --project=.review-env/{head,offset-117} .review-env/check-imports.jl was run separately in both environments using the patch’s ExplicitImports configuration. OffsetArrays 1.18.0 passed all six checks. OffsetArrays 1.17.0 passed five and errored on the public-import check. A direct rerun of that check passed with a name-specific exception.

What I did not verify

  • The ARM runner exposed no GPU devices. Real-device transfers, copies between different GPU backends or devices, and the KernelAbstractions 0.10 path remain unverified. JLArrays exercised the emulated bulk-copy paths.
  • The full test/qa/qa.jl run was still precompiling Reactant at the end of the review. I did not run downstream suites, Julia preview, or 32-bit Julia. No before/after benchmark for the new API was supplied or run.
  • ci.json contains no head checks. It records two base Downstream failures whose causes and relevance could not be established from the supplied metadata. Base Downstream LTS · Base Downstream Julia 1

Head link: 78f541b


🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol
Conversation: local session 01a22789-048f-7fe3-bd16-c3b56e2160c9 (no session URL)

@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #437

Reviewed head: f2711cd
Raw SHA-256: c9c2b51f73a60633b1191d0f9f87594b15c878a6382c3d006734e0541c9b59a6
Source SHA-256: 9de47df97c25d94a4000ac5fa3f968d438ba1cd1ec4371668d1d5ebed7425e60
Source: operator-attested-codex-v1 (runner attested by pankgeorg)
Reviewer session: 01a227df-15b7-7c30-8a50-8075be2f82bf
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: CHANGES
  • Reviewed head: f2711cd

Review report

VERDICT: CHANGES
PR: #437
Head: f2711cd
Base: 277ad9c
Reviewer: codex-cli 0.172.0 / gpt-6.2-sol
Session: 01a227df-15b7-7c30-8a50-8075be2f82bf

Risk

medium-low (ML7: The patch adds a public structured-update API with optional GPU support.)

Blocking findings

  • P2 — ext/ComponentArraysGPUArraysOffsetArraysExt.jl:11. A GPU view can acquire offset axes from its selector even when its parent is already native GPU storage. I reproduced this with view(jl([1, 2, 3, 4]), OffsetArray([4, 2, 1], -2:0)), wrapped as ComponentVector(v, Axis(x = :)). An explicit bulk copy returned [4, 2, 1], but update_component_array threw DimensionMismatch when updating a CPU default and BoundsError when updating a GPU default or using the view as the default backing. Normalize the view’s selectors when the view itself has offset axes, even if its parent is unchanged. Add public API regression tests for all three directions.

Nonblocking findings

  • test/GPU/Project.toml:11 restricts the standard JLArrays suite to the GPUArrays 11 dependency line, leaving GPUArrays 12 coverage outside the standard suite despite the compatibility declaration at Project.toml:51. Add a GPUArrays 12 test environment alongside the existing one. The supplied GPU suite passed locally with JLArrays 0.4.2 and GPUArrays 12.2.0.

What I ran

  • Applied changes.diff to a scratch copy of before/ with git apply and compared it with head/ using diff -qr. The trees matched exactly.
  • Ran GROUP=Core julia --project=.review/core head/test/runtests.jl and the corresponding merge-base run. Julia 1.13.4 reported 613 passes on head and 506 on the merge base, with the same 11 expected-broken checks. The 107 new assertions also passed on Julia 1.10.14. Running the new test file against the merge base stopped at the first call because the API was absent.
  • Ran head/test/GPU/gpu_tests.jl in cached JLArrays environments with GPUArrays 11.5.16 on Julia 1.10.14 and 1.13.4, and with GPUArrays 12.2.0 on Julia 1.13.4. Each run reported 200 passes and one existing expected-broken check. The merge-base GPU suite reported 30 passes and the same expected-broken check.
  • Ran .review/offset-regression.jl against head and a scratch copy with the proposed normalization change. Head produced one passing bulk-copy control and three API errors. The scratch change passed all four assertions on Julia 1.10.14 and 1.13.4 and passed the supplied GPU suite. The reviewed snapshots were left intact.
  • Checked the docstring example’s rendered output and ran focused GPU extension loading, import, and API QA checks. All passed. The new value assertions use independent expected values. The patch adds targeted import exceptions with rationale and leaves the existing numerical assertions in place.
  • Parsed ci.json. It lists zero head checks, 17 base successes, 15 base skips, and two base Downstream failures. The check labels provide no path-level execution evidence. Base Downstream LTS · Base Downstream Julia 1

What I did not verify

  • Physical GPU execution, cross-backend transfers, and cross-device copies. The ARM host exposed no GPU devices, and JLArrays exercised CPU-backed emulation.
  • Full QA. julia --project=.review/qa head/test/qa/qa.jl was still compiling Reactant at the end of the review. A bounded retry with --compiled-modules=existing reached its 75-second limit while loading Reactant. I did not run the full documentation build or the Autodiff, Reactant, and Downstream groups.
  • Before/after performance. The patch makes no measured performance claim and supplies no comparative benchmark.

Head link: f2711cd


🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol
Conversation: local session 01a227df-15b7-7c30-8a50-8075be2f82bf (no session URL)

pankgeorg and others added 9 commits November 30, 2026 08:09
Match nested components by name and traverse corresponding records. Restrict the helper to component vectors and preserve their axes and element type when copying.

Co-authored-by: Codex gpt-6.2-sol <noreply@openai.com>
Codex-Session: 01a22633-77c2-7733-a3dd-3c635355a195
Allocate writable copies with the default element type and backing indices. Transfer GPU leaves in bulk when assigning into CPU-backed results.

Co-authored-by: Codex gpt-6.2-sol <noreply@openai.com>
Codex-Session: 01a22633-77c2-7733-a3dd-3c635355a195
Copy update values into destination-typed GPU storage before assignment.
Validate empty record layouts without constructing partition iterators.

Co-authored-by: Codex gpt-6.2-sol <noreply@openai.com>
Codex-Session: 01a22633-77c2-7733-a3dd-3c635355a195
Translate offset indices onto native storage before copying and assigning.
Rebuild views and reshapes on the underlying storage for bulk transfers.

Co-authored-by: Codex gpt-6.2-sol <noreply@openai.com>
Codex-Session: 01a22633-77c2-7733-a3dd-3c635355a195
Keep child axes with their logical views during traversal. Bulk copy leaf
values from explicit linear positions after checking their shapes.

Co-authored-by: Codex gpt-6.2-sol <noreply@openai.com>
Codex-Session: 01a22633-77c2-7733-a3dd-3c635355a195
Reject GPU-backed wrappers outside the bulk-copy paths before reading values. Import the backend query from KernelAbstractions and exercise both GPU extensions in ExplicitImports QA.

Co-authored-by: Codex gpt-6.2-sol <noreply@openai.com>
Codex-Session: 01a22633-77c2-7733-a3dd-3c635355a195
Classify integer selectors as scalar while retaining explicit child axes. Limit the no_offset_view QA exception to releases before its public declaration.

Co-authored-by: Codex gpt-6.2-sol <noreply@openai.com>
Codex-Session: 01a22633-77c2-7733-a3dd-3c635355a195
Validate GPU backing and component views before copying values. Remove the offset GPU extension and mixed-backend transfers.

Co-authored-by: Codex gpt-6.2-sol <noreply@openai.com>
Codex-Session: 01a22633-77c2-7733-a3dd-3c635355a195
@pankgeorg
pankgeorg force-pushed the update-component-array-validation branch from f2711cd to 4b47566 Compare November 30, 2026 08:23
Use the integer coordinate when classifying one-dimensional Cartesian scalar selectors. Retain the bulk range copy for CPU and GPU storage.

Co-authored-by: Codex gpt-6.2-sol <noreply@openai.com>
Codex-Session: 01a22633-77c2-7733-a3dd-3c635355a195
@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #437

Reviewed head: 4b47566
Raw SHA-256: bc1c3b2f4b00a0f45703c933429a5b27f450eae930067f71bbc5cdb815a804d8
Source SHA-256: 8b384f696ee8eb21a283ed029e7ae7fc9c55aad30139a37c23d900a1ff3df94b
Source: operator-attested-codex-v1 (runner attested by pankgeorg)
Reviewer session: 01a22b8e-d293-7462-8047-3114cb5b33a4
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: CHANGES
  • Reviewed head: 4b47566

Review report

VERDICT: CHANGES
PR: #437
Head: 4b47566
Base: ae51f27
Reviewer: codex-cli 0.172.0 / gpt-6.2-sol
Session: 01a22b8e-d293-7462-8047-3114cb5b33a4

Risk

medium-low (ML7: The patch adds an opt-in public API, and existing GPU operations passed with the revised extension trigger.)

Blocking findings

  • P2 — src/componentarray.jl:627. The update rejects compatible scalar fields when one uses a CartesianIndex{1} selector. For d = ComponentVector([1, 2], Axis(a = CartesianIndex(1), b = 2)) and u = ComponentVector(a = 9), ordinary property access returns scalars for both d.a and u.a. Updates in both directions throw ArgumentError("Incompatible structure for component a") instead of producing backing values [9, 2] and [1], respectively. I reproduced both failures on Julia 1.10.14 and 1.13.4. Normalize one-dimensional Cartesian scalar selectors to integer positions before classifying the fields, retain the one-element range copy, and add regression assertions for both directions.

Nonblocking findings

None

What I ran

  • Applied changes.diff to a scratch copy of before/ with git apply --whitespace=error-all. diff -qr .review/reconstructed head found no differences.
  • Resolved dependencies offline in scratch environments with Pkg.develop. GROUP=Core julia --startup-file=no --project=.review/head head/test/runtests.jl passed 613 assertions with 11 inherited marked-broken checks. Direct runs of head/test/update_tests.jl passed all 107 assertions on both Julia versions.
  • Ran head/test/GPU/gpu_tests.jl with JLArrays on both Julia versions, covering GPUArrays 11.5.16 and 12.2.0. Each run passed 175 assertions with one inherited marked-broken check. The merge-base GPU suite passed 46 assertions with the same marked-broken check. Three extra JLArrays probes passed for matrix leaves, record arrays, and zero-width records.
  • Ran .review/cartesian.jl on both Julia versions. Both scalar reads passed and both update assertions errored on each version. The merge base supported reading and assigning the Cartesian-selected field through its property and had no update_component_array API.
  • Checked extension loading with GPUArrays 11.5.16 and with GPUArrays 12.3.0 plus KernelAbstractions 0.10.9. Both probes passed. The focused QA run passed six ExplicitImports checks and two public API documentation checks. The docstring example also matched its expected output.
  • Reviewed the new assertions for circular expectations and skipped checks. Expected numerical values come from the fixtures. The QA exception covers the new package-internal method, and the patch adds no numerical skips or relaxed tolerances.

What I did not verify

  • Native GPU kernels or physical device-to-device copies. This Linux aarch64 runner exposed no GPU devices. JLArrays exercised host emulation with scalar indexing disabled.
  • The full QA run had yet to produce results while compiling optional dependencies. I did not run the full Autodiff, Reactant, or Downstream groups, or the 32-bit matrix.
  • ci.json contains no head checks. Its base Downstream jobs report failures on Julia 1 and LTS. I did not reproduce those failures locally. Julia 1 · LTS
  • No performance claim or before/after benchmark was supplied.

Head link: 4b47566


🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol
Conversation: local session 01a22b8e-d293-7462-8047-3114cb5b33a4 (no session URL)

@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #437

Reviewed head: 69f3072
Raw SHA-256: d0f87f0569c5e2ed145661754d093cb8fc97341ed42a268b0b12a382d56d0eb0
Source SHA-256: f9d97c839d15bdb7f3f16baee08e32fc46a7b95d61559c15e64415fff6d01118
Source: operator-attested-codex-v1 (runner attested by pankgeorg)
Reviewer session: 01a22bab-b29c-7782-8ece-45ba924d28f8
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: CHANGES
  • Reviewed head: 69f3072

Review report

VERDICT: CHANGES
PR: #437
Head: 69f3072
Base: ae51f27
Reviewer: codex-cli 0.172.0 / gpt-6.2-sol
Session: 01a22bab-b29c-7782-8ece-45ba924d28f8

Risk

medium-low (ML7: the patch adds a public structured-update API, and the existing GPU tests passed with the revised extension trigger in the configurations exercised.)

Blocking findings

  • P2 — Base-only offset views throw during allocation (src/componentarray.jl:604). On Julia 1.10.14 and 1.13.4, ComponentVector(view([1,2,3,4,5], Base.IdentityUnitRange(2:4)), Axis(a=2, b=3:4)) throws a MethodError from similar when patched with ComponentVector(a=9). Loading OffsetArrays makes the same call succeed, so the current offset tests miss the Base-only failure. Add a writable allocation fallback that preserves the backing axes and test it in a process that loads only ComponentArrays.
  • P2 — Updating a matching field also changes an unmentioned field when the axes overlap (src/componentarray.jl:641). I patched ComponentVector([1,2], Axis(x=1, y=1:2)) with ComponentVector(x=9). The result’s y changed from [1,2] to [9,2], despite the documented matching-name behavior. Reject overlapping destination mappings before copying, or document how shared indices and conflicting updates behave and cover that contract with a test.

Nonblocking findings

  • ext/ComponentArraysGPUArraysExt.jl:36 compares backend objects without checking device affinity. Local CUDA source shows that arrays on separate CUDA devices return equal backend objects, while a copy kernel can fail if it needs to access memory on a peer device that is inaccessible. This is a source-based concern. Document the device-affinity requirement and add a multi-device check for the intended behavior.

What I ran

  • diff -qr before head and git apply --check forward against before and in reverse against head. Both patch checks passed. No separate target/ was supplied.
  • Resolved dependencies with offline Pkg.develop in scratch environments. SCIML_TEST_GROUP=Core GROUP=Core julia --startup-file=no --project=.review/core head/test/runtests.jl passed on Julia 1.13.4, including all 115 new CPU assertions. The new CPU file also passed under julia +lts --startup-file=no --project=.review/core-lts. Running that file against before errored with UndefVarError at the new API call.
  • Included head/test/GPU/gpu_tests.jl with the GPU extension asserted loaded. The suite passed on Julia 1.10.14 and 1.13.4 with JLArrays 0.3.3, GPUArrays 11.5.16 and scalar indexing disabled. It also passed in a supplemental Julia 1.13.4 run with JLArrays 0.4.2 and GPUArrays 12.2.0. The existing merge-base GPU suite passed with JLArrays 0.3.3 and retained its existing expected-broken assertion.
  • Ran doctest(ComponentArrays), targeted ExplicitImports checks for the GPU extension, and a GPUArrays 12.3.0 / KernelAbstractions 0.10.9 extension-load and mixed-storage rejection check. All passed.
  • Ran .review/offset_probes.jl on both Julia versions and a separate overlapping-axis probe on Julia 1.13.4. They reproduced the blockers above. Additional CPU and JLArrays probes passed for multidimensional leaves, zero-dimensional leaves and record arrays. The added tests use independent expected values, and the patch leaves the existing numerical assertions and skip conditions intact.

What I did not verify

  • Native CUDA or ROCm execution on ARM, including multi-device copies. uname -m returned aarch64, and the runner exposed no GPU device nodes. JLArrays exercised the GPUArrays dispatch paths on CPU.
  • Full QA was still precompiling dependencies at the last check. I did not run the full documentation build, downstream suite, prerelease or 32-bit matrix. The patch makes no performance claim, and I found no before/after benchmark for the new API.
  • ci.json supplies no head checks. Its target-side labels report successful Core, GPU and QA jobs and two Downstream failures. The labels alone provide no path-level execution evidence. Downstream Julia 1 · Downstream Julia LTS

Head link: 69f3072


🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol
Conversation: local session 01a22bab-b29c-7782-8ece-45ba924d28f8 (no session URL)

pankgeorg and others added 2 commits December 1, 2026 14:19
Allocate writable CPU backing with the original axes when similar has no method. Reject aliases between named destination fields during update preflight.

Co-authored-by: Codex gpt-6.2-sol <noreply@openai.com>
Codex-Session: 01a22633-77c2-7733-a3dd-3c635355a195
Check the destination positions of each written leaf during overlap preflight.

Co-authored-by: Codex gpt-6.2-sol <noreply@openai.com>
Codex-Session: 01a22633-77c2-7733-a3dd-3c635355a195
@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #437

Reviewed head: 94ac947
Raw SHA-256: 60e364f3dd99951cb7a63ed0b7620b42212b8ce0760b53af4e57ce0fc7f7e930
Source SHA-256: ece945971ce66d3f947cf12970238f30fd05eb63d489d5341769051424c7bfd3
Source: operator-attested-codex-v1 (runner attested by pankgeorg)
Reviewer session: 01a23224-228d-7733-8105-fd301e268367
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=3)

Risk assessment

  • Risk: medium-low (ML7)
  • Verdict: CHANGES
  • Reviewed head: 94ac947

Review report

VERDICT: CHANGES
PR: #437
Head: 94ac947
Base: ae51f27
Reviewer: codex-cli 0.172.0 / gpt-6.2-sol
Session: 01a23224-228d-7733-8105-fd301e268367

Risk

medium-low (ML7: The patch adds an exported structured-update API and extends GPU storage validation for that API.)

Blocking findings

  • P1. Preserve the backing index space when allocating the result. On Julia 1.10.14 and 1.13.4, an offset CPU vector with axes 0:2 and a similar method that returns a one-based Vector silently shifted named fields. With backing values [1, 2, 3], Axis(a=0, b=1:2), and an update of b to [8, 9], the result was [8, 9, 3] instead of [1, 8, 9]. The unchanged field a became inaccessible. Check the allocated axes before reusing the component metadata, and use the offset-preserving allocation when they differ. src/componentarray.jl:620
  • P2. Reject GPU-backed wrappers before entering the CPU copy path. A CPU default and a source backed by vec(Tridiagonal(...)) with JLArray diagonals bypassed the mixed-storage check on GPUArrays 11.5.16 and 12.2.0. parent(tridiagonal) === tridiagonal, so the check classified it as CPU storage. The update raised a scalar-indexing error with scalar access disabled and copied the GPU-backed values into the CPU result with scalar access enabled. Recognize GPU-backed terminal wrappers through GPUArrays or KernelAbstractions before the CPU fallback, then validate the outer wrapper and test both argument orders. ext/ComponentArraysGPUArraysExt.jl:28

Nonblocking findings

  • A patch for block.a was rejected when a sibling alias shared only block.b’s backing position. Document that overlap is checked on the entire matched parent field so callers can predict which partial updates will be rejected. src/componentarray.jl:667

What I ran

  • diff -qr before head, git diff --no-index --check before head, and forward and reverse git apply --check against the snapshots. The changed files matched the patch, both apply checks passed, and the whitespace check emitted no diagnostics.
  • GROUP=Core JULIA_PKG_PRECOMPILE_AUTO=0 julia --startup-file=no --project=.review/release head/test/runtests.jl passed on Julia 1.13.4 with 641 passes, including all 135 update assertions, and 11 expected broken checks. Direct runs of head/test/update_tests.jl in the release and LTS environments also passed all 135 assertions.
  • Direct Julia runs of head/test/GPU/gpu_tests.jl in .review/gpu11, .review/release, and .review/lts each reported 179 passes and one expected broken GPU-map check. The first used the declared JLArrays 0.3 series. The other two exercised GPUArrays 12.2 with JLArrays 0.4. The direct merge-base GPU run reported 46 passes and the same expected broken check.
  • Ran .review/probes.jl, .review/storage-probes.jl, .review/gpu-probes.jl, .review/gpu-probes-11.jl, and .review/gpu-copy-probe.jl with Julia. These reproduced the findings, confirmed the docstring example, and exercised a successful GPU-backed named-record update. The merge base lacks the new API. The new tests use literal expected values and input snapshots. The QA exception covers one named internal hook, and the patch adds no test skips.
  • Loaded the extension with GPUArrays 12.3.0 and KernelAbstractions 0.10.9 using julia --startup-file=no --project=.review/gpu123 -e …. Both synthetic mixed-storage rejection checks and the CPU update check passed. Started julia --startup-file=no --project=.review/qa head/test/qa/qa.jl; it had produced no test result when I closed the review.
  • Read ci.json. It records zero head checks. The merge base has Core, GPU, and QA successes and two Downstream failures. Those records apply to the base snapshot. Core · GPU · QA · Downstream Julia 1 · Downstream LTS

What I did not verify

  • Physical CUDA or AMDGPU paths. The Linux aarch64 runner exposed no GPU device. JLArrays also could not resolve with KernelAbstractions 0.10, so validation of that combination covered extension loading and the storage guard.
  • A completed QA run, downstream behavior, the prerelease and 32-bit lanes, or a full documentation build. The patch supplied no performance claim or before/after benchmark.

Head link: 94ac947


🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol
Conversation: local session 01a23224-228d-7733-8105-fd301e268367 (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.

3 participants