You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(builtin): add clamped_view for FixedArray/ReadOnlyArray
Completes the total view variant across the whole family. `FixedArray` mirrors
`Array::clamped_view` through
`unsafe_cast_fixedarray_to_uninitializedarray`; `ReadOnlyArray` delegates to
`FixedArray::clamped_view` via `unsafe_reinterpret_to_fixed_array()`, the same
way its existing `view` and `get_view` delegate.
Contract is unchanged: both offsets are clamped independently into
`[0, length()]`, an inverted range yields an empty view at the clamped `start`,
and the result aliases the backing storage.
Codex CLI review: "No blocking issues in the uncommitted diff. `ReadOnlyArray`
correctly forwards `start` in both arms. Omitting `end` produces exactly the
same bounds as explicitly passing `length()` [...] Clamping guarantees
`0 <= lo <= len` and `0 <= count <= len - lo`; subtraction cannot overflow."
It also spotted a real gap: with the `end=None` arm exercised only at starts 0,
-5 and 100, a `start * 2` mutation there survived the suite. The added test
"clamped_view with `end` omitted forwards `start` unchanged" compares the
omitted-`end` result against an explicit `end=5` across every start in -1..=6,
including `start_offset()`; that mutation now fails 1 test.
Signed-off-by: Codex CLI <codex@openai.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F4N5Hc1TYuJW5oRDTY19Wf
0 commit comments