Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion src/hpc/linalg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
//!
//! - **No SIMD primitives** — use `crate::simd::{F32x16, …}` directly.
//! - **No `#[target_feature]` annotations** — those live in `simd_avx512.rs`.
//! - **No distance metrics** — those live in `crate::hpc::distance`.
//! - **No distance metrics** — those live in `crate::distance` (graduated
//! from `crate::hpc::distance`; back-compat re-export in `crate::hpc::*`).

mod matrix;
pub use matrix::{Mat2, Mat3, Mat4, MatN, Spd2, Spd3};
Expand Down
16 changes: 9 additions & 7 deletions src/hpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ pub mod reductions;
pub mod statistics;
pub mod activations;
pub mod hdc;
pub mod bitwise;
// Bitwise SIMD primitives — graduated to crate root. Back-compat re-export.
pub use crate::bitwise;
Comment on lines +30 to +31

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Document the new hpc public re-exports with /// examples.

These public re-exports currently use regular // comments (or none), so they miss required API docs/examples.

Proposed doc-comment patch
-// Bitwise SIMD primitives — graduated to crate root. Back-compat re-export.
+/// Bitwise SIMD primitives — graduated to crate root. Back-compat re-export.
+///
+/// ```rust
+/// use ndarray::hpc::bitwise as _;
+/// ```
 pub use crate::bitwise;
@@
-// HEEL F64x8 distance kernels — graduated to crate root. Back-compat re-export.
+/// HEEL F64x8 distance kernels — graduated to crate root. Back-compat re-export.
+///
+/// ```rust
+/// use ndarray::hpc::heel_f64x8 as _;
+/// ```
 pub use crate::heel_f64x8;
@@
-// SIMD-accelerated spatial / byte-scan / hash utilities — graduated to crate root.
-// Back-compat re-exports for existing `use ndarray::hpc::{distance,byte_scan,spatial_hash}::*`.
+/// SIMD-accelerated spatial / byte-scan / hash utilities — graduated to crate root.
+/// Back-compat re-exports for existing `use ndarray::hpc::{distance,byte_scan,spatial_hash}::*`.
+///
+/// ```rust
+/// use ndarray::hpc::{byte_scan as _, distance as _, spatial_hash as _};
+/// ```
 pub use crate::byte_scan;
 pub use crate::distance;
 pub use crate::spatial_hash;

As per coding guidelines: “All public APIs must include /// doc comments with examples”.

Also applies to: 60-61, 173-177

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hpc/mod.rs` around lines 30 - 31, The public re-exports (pub use
crate::bitwise, pub use crate::heel_f64x8, pub use crate::byte_scan, pub use
crate::distance, pub use crate::spatial_hash) are missing /// doc comments and
examples; add triple-slash documentation above each re-export describing the
export and include a short fenced rust example that references it (e.g. "use
ndarray::hpc::bitwise as _;", "use ndarray::hpc::heel_f64x8 as _;", and "use
ndarray::hpc::{byte_scan as _, distance as _, spatial_hash as _};") so the API
carries required docs/examples—apply the same change to the other re-export
sites noted for bitwise/HEEL/distance/byte_scan/spatial_hash.

pub mod projection;
pub mod cogrecord;
pub mod graph;
Expand Down Expand Up @@ -56,8 +57,8 @@ pub mod soa;
pub mod node;
#[allow(missing_docs)]
pub mod cascade;
#[allow(missing_docs)]
pub mod heel_f64x8;
// HEEL F64x8 distance kernels — graduated to crate root. Back-compat re-export.
pub use crate::heel_f64x8;
// AMX is an x86_64-only ISA (Intel Sapphire Rapids+); both modules use
// `asm!` with `rcx`/`rax` register names that don't exist on other
// architectures (rejected at parse time on s390x / aarch64 / wasm32).
Expand Down Expand Up @@ -169,10 +170,11 @@ pub mod parallel_search;
// ZeckF64 progressive edge encoding + batch/top-k
pub mod zeck;

// SIMD-accelerated spatial / byte-scan / hash utilities
pub mod distance;
pub mod byte_scan;
pub mod spatial_hash;
// SIMD-accelerated spatial / byte-scan / hash utilities — graduated to crate root.
// Back-compat re-exports for existing `use ndarray::hpc::{distance,byte_scan,spatial_hash}::*`.
pub use crate::byte_scan;
pub use crate::distance;
pub use crate::spatial_hash;

// Variable-width palette index codec (Minecraft-style bit packing)
#[allow(missing_docs)]
Expand Down
29 changes: 29 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,35 @@ pub mod simd_amx;
#[cfg(feature = "std")]
pub mod simd_caps;

/// Bitwise SIMD primitives — popcount, Hamming distance over byte slices.
/// Graduated from `crate::hpc::bitwise::*` (substrate-tier; uses
/// `crate::simd::U64x8` polyfill internally). Back-compat re-export in
/// `crate::hpc::*` preserves existing import paths.
#[cfg(feature = "std")]
pub mod bitwise;

/// F64x8 HEEL distance kernels — 8-plane weighted Hamming, f64 SIMD
/// dot / cosine / sum-of-squares. Graduated from `crate::hpc::heel_f64x8::*`.
#[cfg(feature = "std")]
pub mod heel_f64x8;

/// Batch distance computations — spatial 3D-point queries +
/// slice-shape L1 / L2 / L∞ (PR-X10 A6). Graduated from
/// `crate::hpc::distance::*`.
#[cfg(feature = "std")]
pub mod distance;

/// SIMD-accelerated byte-scan utilities — needle search, delimiter
/// finding, parallel byte comparison. Graduated from
/// `crate::hpc::byte_scan::*`.
#[cfg(feature = "std")]
pub mod byte_scan;

/// SIMD-accelerated spatial hash — bucketing, candidate gather, hash
/// collision detection. Graduated from `crate::hpc::spatial_hash::*`.
#[cfg(feature = "std")]
pub mod spatial_hash;
Comment thread
coderabbitai[bot] marked this conversation as resolved.

#[cfg(feature = "std")]
#[allow(clippy::all, missing_docs, dead_code, unused_variables, unused_imports)]
pub mod simd_neon;
Expand Down
File renamed without changes.
Loading