Repository navigation
refactor: reuse index normalization in array slicing kernels - #4474
Conversation
|
The documentation preview is ready to be viewed at https://preview.awkward-array.org/PR4474/ |
|
🤖 This comment was written by Claude Code and posted by an automated workflow. The PR replaces the inline negative-index normalization and bounds check in three CPU kernels ( Public API changesNone. Changes to existing-test expectationsNone. Checked with no findingsRegressions from main. Performance measurementsProbe
At n = 1,000,000 there is no measurable difference. At n = 10, slices that use no changed kernel ( Minor details
🤖 Generated with Claude Code |
Reuse the scalar index-normalization helper from #4471 in
awkward_ListArray_getitem_next_array, its advanced-indexing variant, andawkward_RegularArray_getitem_next_array_regularize.Preserve starts/stops validation and its precedence over index errors, the original attempted index and failing row, advanced-index mappings, empty-index behavior, and partial writes. In particular, RegularArray continues to write the normalized failing index before returning its error. Kernel signatures, canonical reference definitions, CUDA implementations, and package versions are unchanged.
This draft targets
mainand requires only C++17. It depends on #4471; the current diff includes that PR’s shared helper, scalar-kernel refactor, and tests. After #4471 merges, rebase ontomainto leave only this three-kernel extension. No dependency on the experimental C++23 PRs or evaluation workflow remains.Validation after rebasing:
-std=c++17in compiler flags.AI assistance: Codex assisted with implementation and validation.