Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 15 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ cblas-sys = { workspace = true, optional = true }
libc = { version = "0.2.82", optional = true }

matrixmultiply = { version = "0.3.2", default-features = false, features=["cgemm"] }
blake3 = "1"
p64 = { path = "crates/p64" }
fractal = { path = "crates/fractal", default-features = false }

# HPC extras — gated behind the `hpc-extras` feature so downstream consumers
# (e.g. burn-ndarray) can opt out of the heavy compile tree when only the core
# array layer is needed. Enabled by default to preserve existing behavior.
blake3 = { version = "1", optional = true }
p64 = { path = "crates/p64", optional = true }
fractal = { path = "crates/fractal", default-features = false, optional = true }

serde = { version = "1.0", optional = true, default-features = false, features = ["alloc"] }
rawpointer = { version = "0.2" }
Expand All @@ -73,17 +77,23 @@ itertools = { workspace = true }
ndarray-gen = { workspace = true }

[features]
default = ["std"]
default = ["std", "hpc-extras"]

# Enable blas usage
# See README for more instructions
blas = ["dep:cblas-sys", "dep:libc"]

serde = ["dep:serde"]

std = ["num-traits/std", "matrixmultiply/std", "fractal/std"]
std = ["num-traits/std", "matrixmultiply/std"]
rayon = ["dep:rayon", "std"]

# HPC extras: blake3 hashing, p64 palette/NARS bridge, fractal manifold.
# These pull in a non-trivial dependency tree; downstream crates such as
# burn-ndarray that only need the core array layer can disable this with
# `default-features = false` (and re-enable `std` explicitly if needed).
hpc-extras = ["std", "dep:blake3", "dep:p64", "dep:fractal", "fractal/std"]

matrixmultiply-threading = ["matrixmultiply/threading"]

# JITSON: JSON parser + validator + template + scan pipeline (no Cranelift)
Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ pub mod simd_wasm;
pub mod backend;

/// HPC extensions ported from rustynum: BLAS, statistics, HDC, CogRecord, FFT, LAPACK.
#[cfg(feature = "std")]
///
/// Gated behind the `hpc-extras` feature (enabled by default) because the
/// module pulls in `blake3`, `p64`, and `fractal`. Disable default features to
/// drop those dependencies (e.g. burn-ndarray's polyfill-only build).
#[cfg(feature = "hpc-extras")]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep hpc available for std-only builds

Gating pub mod hpc; behind feature = "hpc-extras" breaks the advertised --no-default-features --features std configuration because simd is still compiled under std and unconditionally re-exports symbols from crate::hpc (see src/simd.rs around the pub use crate::hpc::... block). In that feature set, hpc is absent and these imports become unresolved, so downstream std-only consumers cannot compile.

Useful? React with 👍 / 👎.

#[allow(
clippy::all,
unused_imports,
Expand Down
Loading