@@ -52,12 +52,38 @@ libc = { version = "0.2.82", optional = true }
5252
5353matrixmultiply = { version = " 0.3.2" , default-features = false , features =[" cgemm" ] }
5454
55- # blake3 — gated behind `hpc-extras` (integrity hashing in
56- # plane/seal/merkle_tree/vsa/spo_bundle/crystal_encoder/compression_curves/
57- # deepnsm). Optional + opt-in because the transitive dep `constant_time_eq`
58- # does not declare `#![no_std]`, so unconditionally including blake3 breaks
59- # the `thumbv6m-none-eabi --no-default-features` nostd build with
60- # `error[E0463]: can't find crate for std`.
55+ # =====================================================================
56+ # blake3 — DEPENDENCY OF `std` FEATURE (NOT `hpc-extras`). READ BEFORE
57+ # TOUCHING.
58+ # =====================================================================
59+ #
60+ # blake3 is required by the cognitive substrate modules — plane, seal,
61+ # merkle_tree, vsa, spo_bundle, crystal_encoder, compression_curves,
62+ # deepnsm — which all live under `pub mod hpc;` (itself gated on
63+ # `feature = "std"` in lib.rs). Those modules `use blake3;` directly
64+ # and unconditionally; there is no #[cfg] dance inside them.
65+ #
66+ # Pinning blake3 to the `std` feature (rather than `hpc-extras`) means:
67+ # * ANY consumer that enables `std` automatically gets blake3, with
68+ # ZERO additional feature wiring. This is the default. Cargo's
69+ # transitive feature resolution does the rest.
70+ # * Consumers selecting `default-features = false, features = ["std"]`
71+ # (e.g. burn-ndarray, which disables hpc-extras to shed p64/fractal)
72+ # STILL get blake3 — no more "missing blake3" build errors that
73+ # used to require chasing down hpc-extras.
74+ # * Consumers selecting `default-features = false` (no std at all,
75+ # e.g. the `thumbv6m-none-eabi` CI matrix entry) do NOT pull blake3
76+ # and therefore do not pull `constant_time_eq`, whose lack of
77+ # `#![no_std]` declaration would otherwise fail the nostd link with
78+ # `error[E0463]: can't find crate for std`.
79+ #
80+ # If you find yourself wanting to make blake3 unconditional (drop the
81+ # `optional = true`), check first: does it still pass
82+ # `cargo rustc -p ndarray --target=thumbv6m-none-eabi
83+ # --no-default-features --features portable-atomic-critical-section`?
84+ # If not, leave the `optional = true` + `std`-feature pinning in place.
85+ #
86+ # =====================================================================
6187blake3 = { version = " 1" , optional = true }
6288
6389# p64 + fractal — specialized convergence / manifold math. Gated behind
@@ -144,7 +170,7 @@ blas = ["dep:cblas-sys", "dep:libc"]
144170
145171serde = [" dep:serde" ]
146172
147- std = [" num-traits/std" , " matrixmultiply/std" ]
173+ std = [" num-traits/std" , " matrixmultiply/std" , " dep:blake3 " ]
148174rayon = [" dep:rayon" , " std" ]
149175
150176# Portable-SIMD backend (NIGHTLY ONLY). Routes `crate::simd::*` types
@@ -161,11 +187,15 @@ rayon = ["dep:rayon", "std"]
161187# cfg-dispatch in `simd.rs` remains the production path.
162188nightly-simd = [" std" ]
163189
164- # HPC extras: blake3 hashing, p64 palette/NARS bridge, fractal manifold.
190+ # HPC extras: p64 palette/NARS bridge + fractal manifold.
191+ # (blake3 was previously listed here; it is now part of `std` directly
192+ # because the cognitive substrate modules under hpc/ that import blake3
193+ # are themselves `std`-gated. See the blake3 comment in [dependencies].)
165194# These pull in a non-trivial dependency tree; downstream crates such as
166195# burn-ndarray that only need the core array layer can disable this with
167- # `default-features = false` (and re-enable `std` explicitly if needed).
168- hpc-extras = [" std" , " dep:p64" , " dep:fractal" , " fractal/std" , " dep:blake3" ]
196+ # `default-features = false` (and re-enable `std` explicitly if needed —
197+ # blake3 will come along with `std`).
198+ hpc-extras = [" std" , " dep:p64" , " dep:fractal" , " fractal/std" ]
169199
170200matrixmultiply-threading = [" matrixmultiply/threading" ]
171201
0 commit comments