|
28 | 28 | ## Entries (append below; newest first) |
29 | 29 |
|
30 | 30 |
|
| 31 | +## 2026-05-21T16:00 — substrate-graduation batch 3 (opus 4.7) |
| 32 | + |
| 33 | +**Branch:** `claude/continue-ndarray-x0Oaw` |
| 34 | +**Continues:** PR #194 batch of 5 (`bitwise`/`heel_f64x8`/`distance`/`byte_scan`/`spatial_hash`) + #193 (`simd_caps`). |
| 35 | +**Verdict:** SHIP — `cargo check`, `cargo clippy --features approx,serde,rayon -- -D warnings`, doctest suite (15 graduated-module doctests pass), and unit tests (104 lib tests pass) all green. |
| 36 | + |
| 37 | +**Modules graduated (4):** |
| 38 | + |
| 39 | +| Module | Old path | New path | Internal hpc/ deps? | |
| 40 | +|---|---|---|---| |
| 41 | +| `aabb` | `src/hpc/aabb.rs` | `src/aabb.rs` | None — only `super::simd_caps` (now resolves via crate root) | |
| 42 | +| `nibble` | `src/hpc/nibble.rs` | `src/nibble.rs` | None — only `super::simd_caps` | |
| 43 | +| `palette_codec` | `src/hpc/palette_codec.rs` | `src/palette_codec.rs` | None — pure logic | |
| 44 | +| `property_mask` | `src/hpc/property_mask.rs` | `src/property_mask.rs` | None — only `super::simd_caps` | |
| 45 | + |
| 46 | +**Why these four, why now (criteria carried over from #194 wrap-up):** |
| 47 | +1. No internal `hpc/` dependencies. All four only reach into `crate::simd::*` (the polyfill surface) and `super::simd_caps` (itself at crate root post-#192). |
| 48 | +2. Already polyfill-clean — no raw-intrinsic refactor required before the move. |
| 49 | +3. Single in-tree downstream caller (`hpc::framebuffer` imports `palette_codec`) → the `pub use crate::palette_codec;` back-compat shim in `hpc/mod.rs` keeps that resolution working zero-touch. |
| 50 | + |
| 51 | +**Changes:** |
| 52 | +- `git mv src/hpc/{aabb,nibble,palette_codec,property_mask}.rs src/` |
| 53 | +- Added `pub mod {aabb, nibble, palette_codec, property_mask};` to `src/lib.rs` (with `# Example` rustdoc blocks per CLAUDE.md hard rule "all public APIs need /// doc comments with examples"). |
| 54 | +- Replaced the four `pub mod` declarations in `src/hpc/mod.rs` with `pub use crate::{aabb, nibble, palette_codec, property_mask};` back-compat re-exports. |
| 55 | + |
| 56 | +**Lint follow-ups (graduated modules lose the `#![allow(clippy::all, …)]` umbrella that `hpc/mod.rs` carries):** |
| 57 | + |
| 58 | +17 clippy errors surfaced under `-D warnings`. All fixed at the canonical Rust idiom rather than re-applying the umbrella, per the #194 cleanup precedent (417131bc): |
| 59 | + |
| 60 | +- **`manual_div_ceil` (6 sites)**: `(n + d - 1) / d` → `n.div_ceil(d)` in `nibble.rs` (×2), `palette_codec.rs` (×3), `property_mask.rs` (×1). |
| 61 | +- **`needless_range_loop` (10 sites)**: `for i in start..vec.len() { vec[i] }` → `for x in &vec[start..]` or `for (i, &x) in iter().enumerate()` depending on whether the index is used. Sites in `aabb.rs` (×4), `nibble.rs` (×3), `palette_codec.rs` (×1), `property_mask.rs` (×2). |
| 62 | +- **`missing_docs` (4 sites)**: Added field doc comments on `pub struct Aabb { min, max }` and `pub struct Ray { origin, inv_dir }` — these were previously caught by the `hpc/mod.rs` umbrella's `#![allow(missing_docs)]`. |
| 63 | + |
| 64 | +**Doctest fix:** Initial `bits_for_palette_size(1) → 1` in the `lib.rs` `# Example` block was wrong — the actual impl returns 0 for `palette_size <= 1` (trivial-palette special case; the bits/indices table in `palette_codec.rs`'s module docstring overpromises). Changed example to `bits_for_palette_size(2) → 1`. |
| 65 | + |
| 66 | +**Verification:** |
| 67 | + |
| 68 | +``` |
| 69 | +cargo check --lib → clean |
| 70 | +cargo clippy --lib -- -D warnings → clean |
| 71 | +cargo clippy --lib --features rayon -- -D warnings → clean |
| 72 | +cargo clippy --features approx,serde,rayon -- -D warnings → clean |
| 73 | +cargo test --doc (filtered: graduated modules) → 15 doctests pass |
| 74 | +cargo test --lib aabb::tests nibble::tests palette_codec::tests property_mask::tests → 104 unit tests pass |
| 75 | +``` |
| 76 | + |
| 77 | +**No back-compat break:** every existing `use ndarray::hpc::{aabb, nibble, palette_codec, property_mask}::*` continues to resolve via the `pub use crate::*` shims in `hpc/mod.rs`. Verified via `cargo check` of the full workspace — `framebuffer.rs:29` (the one in-tree downstream consumer of `palette_codec`) compiles unchanged. |
| 78 | + |
| 79 | +**Remaining hpc/ inventory after this batch:** ~55 → ~51 modules at crate root path `crate::hpc::*`. Next-batch candidates (still low-hanging by the same criteria) — to be audited in a separate pass before move: `framebuffer` (depends on `palette_codec` shim, otherwise pure crate-root), `ocr_simd`/`ocr_felt` (need dep audit), `audio` (depends on `crate::simd`). |
| 80 | + |
| 81 | +**Commit:** TBD (pending push). |
| 82 | + |
| 83 | +--- |
| 84 | + |
31 | 85 | ## 2026-05-13T00:00 — agent #3 polyfill-ops (sonnet) |
32 | 86 |
|
33 | 87 | **File:** `src/simd_ops.rs` (288 lines) |
|
0 commit comments