-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
349 lines (288 loc) · 11.8 KB
/
Cargo.toml
File metadata and controls
349 lines (288 loc) · 11.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
[package]
name = "ndarray"
version = "0.17.2"
edition = "2021"
rust-version = "1.95"
authors = [
"Ulrik Sverdrup \"bluss\"",
"Jim Turner"
]
license = "MIT OR Apache-2.0"
readme = "README-crates.io.md"
repository = "https://github.com/rust-ndarray/ndarray"
documentation = "https://docs.rs/ndarray/"
description = "An n-dimensional array for general elements and for numerics. Lightweight array views and slicing; views support chunking and splitting."
keywords = ["array", "data-structure", "multidimensional", "matrix", "blas"]
categories = ["data-structures", "science"]
include = [
"/src/**/*.rs",
"LICENSE-MIT",
"LICENSE-APACHE",
"RELEASES.md",
"README.rst",
"README-quick-start.md"
]
resolver = "2"
[lib]
name = "ndarray"
bench = false
test = true
[[example]]
name = "ocr_benchmark"
required-features = ["std"]
[[example]]
name = "splat3d_flex"
required-features = ["splat3d"]
[dependencies]
num-integer = { workspace = true }
num-traits = { workspace = true }
num-complex = { workspace = true }
approx = { workspace = true, optional = true }
rayon = { version = "1.10.0", optional = true }
# Use via the `blas` crate feature
cblas-sys = { workspace = true, optional = true }
libc = { version = "0.2.82", optional = true }
matrixmultiply = { version = "0.3.2", default-features = false, features=["cgemm"] }
# =====================================================================
# blake3 — DEPENDENCY OF `std` FEATURE (NOT `hpc-extras`). READ BEFORE
# TOUCHING.
# =====================================================================
#
# blake3 is required by the cognitive substrate modules — plane, seal,
# merkle_tree, vsa, spo_bundle, crystal_encoder, compression_curves,
# deepnsm — which all live under `pub mod hpc;` (itself gated on
# `feature = "std"` in lib.rs). Those modules `use blake3;` directly
# and unconditionally; there is no #[cfg] dance inside them.
#
# Pinning blake3 to the `std` feature (rather than `hpc-extras`) means:
# * ANY consumer that enables `std` automatically gets blake3, with
# ZERO additional feature wiring. This is the default. Cargo's
# transitive feature resolution does the rest.
# * Consumers selecting `default-features = false, features = ["std"]`
# (e.g. burn-ndarray, which disables hpc-extras to shed p64/fractal)
# STILL get blake3 — no more "missing blake3" build errors that
# used to require chasing down hpc-extras.
# * Consumers selecting `default-features = false` (no std at all,
# e.g. the `thumbv6m-none-eabi` CI matrix entry) do NOT pull blake3
# and therefore do not pull `constant_time_eq`, whose lack of
# `#![no_std]` declaration would otherwise fail the nostd link with
# `error[E0463]: can't find crate for std`.
#
# If you find yourself wanting to make blake3 unconditional (drop the
# `optional = true`), check first: does it still pass
# `cargo rustc -p ndarray --target=thumbv6m-none-eabi
# --no-default-features --features portable-atomic-critical-section`?
# If not, leave the `optional = true` + `std`-feature pinning in place.
#
# =====================================================================
blake3 = { version = "1", optional = true }
# p64 + fractal — specialized convergence / manifold math. Gated behind
# `hpc-extras` since they pull in a dep tree burn-ndarray doesn't need.
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" }
# paste — identifier concatenation in macro_rules! expansions.
# Required by `blocked_grid_struct!` to generate {Name}L1Block / {Name}L1BlockMut
# view types. Already present in the workspace lockfile (via crates/burn).
paste = "1"
# Cranelift JIT (optional, behind "jit-native" feature)
# For AVX-512 VPOPCNTDQ/VNNI/VPTERNLOG/BITALG support, use the patched fork:
# cranelift-codegen = { git = "https://github.com/AdaWorldAPI/wasmtime.git", branch = "main", optional = true }
cranelift-codegen = { version = "0.116", optional = true }
cranelift-jit = { version = "0.116", optional = true }
cranelift-module = { version = "0.116", optional = true }
cranelift-frontend = { version = "0.116", optional = true }
target-lexicon = { version = "0.13", optional = true }
[dev-dependencies]
defmac = "0.2"
quickcheck = { workspace = true }
approx = { workspace = true, default-features = true }
itertools = { workspace = true }
ndarray-gen = { workspace = true }
criterion = { version = "0.5", features = ["html_reports"] }
[[bench]]
name = "append"
harness = false
[[bench]]
name = "bench1"
harness = false
[[bench]]
name = "chunks"
harness = false
[[bench]]
name = "construct"
harness = false
[[bench]]
name = "gemv_gemm"
harness = false
[[bench]]
name = "higher-order"
harness = false
[[bench]]
name = "iter"
harness = false
[[bench]]
name = "numeric"
harness = false
[[bench]]
name = "par_rayon"
harness = false
required-features = ["rayon"]
[[bench]]
name = "reserve"
harness = false
[[bench]]
name = "to_shape"
harness = false
[[bench]]
name = "zip"
harness = false
[[bench]]
name = "splat3d_bench"
harness = false
required-features = ["splat3d"]
[features]
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", "dep:blake3"]
rayon = ["dep:rayon", "std"]
# Portable-SIMD backend (NIGHTLY ONLY). Routes `crate::simd::*` types
# through `core::simd::*` instead of the architecture-specific intrinsics
# in `simd_avx512.rs` / `simd_avx2.rs` / `simd_neon.rs`. The point is
# miri compatibility: miri can execute `core::simd` semantics but treats
# `_mm*_*` intrinsics as opaque. With this feature on, miri-run tests
# exercise the actual SIMD code paths in consumer code (`hpc/byte_scan`,
# `hpc/framebuffer`, etc.) and catch UB that the intrinsics backend hides.
#
# Requires `cargo +nightly` because `src/simd_nightly.rs` is gated on
# `#![feature(portable_simd)]` (Rust unstable issue #86656). The default
# build (stable 1.95) does NOT touch this; the existing intrinsics
# cfg-dispatch in `simd.rs` remains the production path.
nightly-simd = ["std"]
# Runtime SIMD dispatch — release-binary distribution path. Compiles all
# x86_64 backends into one artifact and selects per-op kernels via
# `LazyLock<fn>` trampolines that read `simd_caps()` on first call. The
# `crate::simd_runtime::*` module becomes reachable under this feature;
# the existing compile-time `crate::simd::*` / `crate::simd_ops::*`
# cascade is unchanged (additive). Use case: shipping one binary that
# adapts across heterogeneous deployment silicon (AVX-512 server +
# AVX2-only laptop) from the same artifact.
#
# Mutually exclusive with `nightly-simd` (the portable-SIMD polyfill
# replaces the architecture-specific intrinsics that the runtime
# trampolines select between; they can't coexist coherently).
#
# Per-call overhead: ~2-3 ns indirect-call through a static fn pointer
# (LazyLock fires once at first call, every subsequent call is a
# pointer deref). Invisible against any SIMD op's actual work.
#
# See `.claude/knowledge/simd-dispatch-architecture.md` § 7.1 / Phase 5
# for the design rationale.
runtime-dispatch = ["std"]
# HPC extras: p64 palette/NARS bridge + fractal manifold.
# (blake3 was previously listed here; it is now part of `std` directly
# because the cognitive substrate modules under hpc/ that import blake3
# are themselves `std`-gated. See the blake3 comment in [dependencies].)
# 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 —
# blake3 will come along with `std`).
hpc-extras = ["std", "dep:p64", "dep:fractal", "fractal/std"]
matrixmultiply-threading = ["matrixmultiply/threading"]
# JITSON: JSON parser + validator + template + scan pipeline (no Cranelift)
jitson = []
# JIT native compilation via Cranelift (jitson_cranelift module)
jit-native = ["jitson", "dep:cranelift-codegen", "dep:cranelift-jit", "dep:cranelift-module", "dep:cranelift-frontend", "dep:target-lexicon"]
# HPC backend feature gates (mutually exclusive)
native = ["std"]
intel-mkl = ["std"]
openblas = ["std"]
# linalg: middle-layer MatN carrier + Mat2/3/4 + Spd2/Spd3 SPD-cone (PR-X10 A1)
linalg = []
# pillar: Pillar-6 through Pillar-11 SPD-cascade certification probes (PR-X11).
# Depends on linalg for Spd2/Spd3 types consumed by B1-B7 pillar workers.
pillar = ["linalg", "splat3d"]
# ogit_bridge: zero-dep RDF 1.1 Turtle parser for the OGIT ontology TTL files.
# Provides TurtleLexer, TurtleParser, Triple, TripleNode, TurtleError.
# No external dependencies — pure-Rust, no unsafe.
ogit_bridge = []
# splat3d: CPU-SIMD 3D Gaussian Splatting forward renderer
# (`src/hpc/splat3d/*`). Pure SIMD, no GPU, no wgpu, reuses the
# existing `crate::simd` polyfill (F32x16 via AVX-512 / AVX2 / NEON
# / scalar dispatch). Gated because the module pulls in the Smith-1961
# 3×3 SPD eigendecomp + EWA-sandwich projection kernels; downstream
# consumers (medvol, lance-graph-render) opt in. f32 hot path; the
# Pillar-7 probe certifying the math sibling lives in
# `lance-graph/crates/jc/src/ewa_sandwich_3d.rs`.
splat3d = ["std"]
# PR-X12 cognitive codec — x265-shaped skip/merge/delta/escape mode classes
# over BlockedGrid CTUs. A1 (this crate) ships only the CTU carrier +
# quad-tree partition; the entropy coder + RDO loop land in later workers.
codec = ["std"]
# no_std polyfill for `static LazyLock` in `src/simd.rs` (sprint A12).
# Pulls in `portable-atomic` with the `critical-section` impl plus the
# `critical-section` runtime so we can build a once-cell-style cache for
# the SIMD tier without `std::sync::LazyLock`. The unconditional
# `portable-atomic` dependency below is itself optional, gated on this
# feature; the target-specific block keeps the un-optional copy alive on
# platforms that need it for atomic-pointer fallback.
portable-atomic-critical-section = [
"dep:portable-atomic",
"dep:critical-section",
"portable-atomic/critical-section",
]
[dependencies.portable-atomic]
version = "1"
optional = true
default-features = false
[dependencies.critical-section]
version = "1"
optional = true
[target.'cfg(not(target_has_atomic = "ptr"))'.dependencies]
portable-atomic = { version = "1.6.0" }
portable-atomic-util = { version = "0.2.0", features = [ "alloc" ] }
[workspace]
members = [
"ndarray-rand",
"crates/*",
]
exclude = ["crates/burn"]
default-members = [
".",
"ndarray-rand",
"crates/ndarray-gen",
"crates/numeric-tests",
"crates/serialization-tests",
# exclude blas-tests and blas-mock-tests that activate "blas" feature
]
[workspace.dependencies]
ndarray = { version = "0.17", path = ".", default-features = false }
ndarray-rand = { path = "ndarray-rand" }
ndarray-gen = { path = "crates/ndarray-gen" }
num-integer = { version = "0.1.39", default-features = false }
num-traits = { version = "0.2", default-features = false }
num-complex = { version = "0.4", default-features = false }
approx = { version = "0.5", default-features = false }
quickcheck = { version = "1.0", default-features = false }
rand = { version = "0.9.0", features = ["small_rng"] }
rand_distr = { version = "0.5.0" }
itertools = { version = "0.13.0", default-features = false, features = ["use_std"] }
cblas-sys = { version = "0.1.4", default-features = false }
[profile.bench]
debug = true
[profile.test.package.numeric-tests]
opt-level = 2
[profile.test.package.blas-tests]
opt-level = 2
# Config for cargo-release
[package.metadata.release]
tag-name = "{{version}}"
# Config specific to docs.rs
[package.metadata.docs.rs]
features = ["approx", "serde", "rayon"]
# Define the configuration attribute `docsrs`
rustdoc-args = ["--cfg", "docsrs"]