Commit ef07808
committed
refactor(simd_caps): graduate from hpc/ to crate root with back-compat re-export
First step in the substrate-graduation thread documented in #192's
wrap-up: lift the substrate-tier modules out of `hpc/` (which was
the rustynum migration staging area) to crate root, where they sit
in scope of the W1a polyfill contract and no longer carry the
spurious `std`-gate inherited from `hpc/`.
`simd_caps` is the smallest and cleanest first move:
* No internal `hpc/` dependencies (only `use std::sync::LazyLock`).
* 8 internal callers; back-compat re-export keeps them working.
* Pure CPU-detection metadata; the most polyfill-adjacent module
in the entire `hpc/` set.
Changes:
1. `src/hpc/simd_caps.rs` → `src/simd_caps.rs` (file move).
2. `src/lib.rs` adds `#[cfg(feature = "std")] pub mod simd_caps;`.
The std-gate is retained for now (uses `std::sync::LazyLock`);
lifting it to `core::sync::LazyLock` is a separate follow-up.
3. `src/hpc/mod.rs` replaces `pub mod simd_caps;` with
`pub use crate::simd_caps;` — keeps `crate::hpc::simd_caps::*`
resolving for cross-repo consumers (lance-graph, WoA, MedCare,
q2 may have `use ndarray::hpc::simd_caps::*` imports that this
preserves untouched).
No public-API breakage; the test suite picks up the new path
(test names now `simd_caps::tests::*` rather than `hpc::simd_caps::*`),
all 10 tests pass under both default and `runtime-dispatch` configs.
The 8 internal callers (`crate::simd_avx512`, `crate::hpc::p64_bridge`,
`crate::simd_runtime::{cpu_ops, add_mul, vnni_dot}`) continue using
`crate::hpc::simd_caps::*` via the re-export and work unmodified.
Next graduation candidates (deferred to follow-up PRs):
- `fingerprint` (bitwise substrate; raw `u64` polyfill audit)
- `dn_tree` (bitwise substrate; same audit)
- `ogit_bridge` (pure logic, no SIMD primitives)
- `splat3d` (already uses `crate::simd::*` polyfilled types)
Each move follows the same pattern: relocate file, drop std-gate
inheritance where unneeded, keep back-compat re-export. Cognitive
layer (pillar, plane, seal, merkle_tree, deepnsm, …) stays inside
`hpc/` and keeps its legitimate std-gate.1 parent 510d5f3 commit ef07808
3 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
265 | 275 | | |
266 | 276 | | |
267 | 277 | | |
| |||
File renamed without changes.
0 commit comments