|
6 | 6 | //! (fine but undiscoverable) or rolls a raw slice index without the |
7 | 7 | //! compile-time bounds check. |
8 | 8 | //! |
| 9 | +//! # Semantics — non-overlapping (NOT std `array_windows`) |
| 10 | +//! |
| 11 | +//! Despite the plural name, this is the **non-overlapping** chunk variant — |
| 12 | +//! consecutive windows do not share elements. The name follows std's |
| 13 | +//! plural iterator-type convention ([`std::slice::ArrayWindows`]), but the |
| 14 | +//! semantics match [`std::slice::ArrayChunks`] / `slice::as_chunks`. |
| 15 | +//! |
| 16 | +//! For an 8-element input walked at `N = 4`: |
| 17 | +//! - `array_windows` (this module): yields `[0..4]`, `[4..8]` — **2 windows**. |
| 18 | +//! - `std::slice::array_windows` (overlapping): would yield 5 windows. |
| 19 | +//! |
| 20 | +//! Non-overlapping is the correct shape for SIMD-staged inner loops where |
| 21 | +//! each lane-register load consumes its N elements before advancing by N. |
| 22 | +//! |
9 | 23 | //! # Layering |
10 | 24 | //! |
11 | | -//! Lives in `hpc::array_windows`; the `crate::simd::*` re-export lands in the |
12 | | -//! PR-X1 re-export sweep (see `.claude/knowledge/pr-x1-design.md` § 4). |
13 | | -//! Doctests therefore use the canonical `ndarray::hpc::array_windows` path |
14 | | -//! until the sweep ships. |
| 25 | +//! Lives in `hpc::array_windows`, re-exported from `crate::simd::*` per the |
| 26 | +//! W1a consumer contract at |
| 27 | +//! `.claude/knowledge/vertical-simd-consumer-contract.md`. |
15 | 28 | //! |
16 | 29 | //! # Design reference |
17 | 30 | //! |
18 | | -//! `.claude/knowledge/pr-x1-design.md` § "3. `array_windows`". This module |
| 31 | +//! `.claude/knowledge/pr-x1-design.md` § "3. `array_window`". This module |
19 | 32 | //! ships the **iterator-shape** variant (whole-buffer walk yielding all |
20 | | -//! const-size windows). The design doc sketches a singular-window form |
21 | | -//! (`array_windows(slice, offset) -> &[T; N]`); the maintainer-blessed final |
22 | | -//! shape is the iterator form here, which composes directly with SIMD-staged |
23 | | -//! consumer loops and avoids per-call panic surface in tight inner loops. |
| 33 | +//! const-size windows); the design doc's singular-window sketch |
| 34 | +//! (`array_window(slice, offset) -> &[T; N]`) was superseded by the |
| 35 | +//! iterator form here, which composes directly with SIMD-staged consumer |
| 36 | +//! loops and avoids per-call panic surface in tight inner loops. The name |
| 37 | +//! was pluralised to match the std iterator-type convention. |
24 | 38 |
|
25 | 39 | /// Walk `data` as a sequence of non-overlapping const-size windows. |
26 | 40 | /// |
|
0 commit comments