Skip to content

Commit 0f26271

Browse files
authored
Merge pull request #130 from AdaWorldAPI/cursor/env-setup-bd77
Fix CI: pin to Rust 1.94.0, fix clippy warnings, fix feature gates
2 parents 5d3c29b + 2173938 commit 0f26271

6 files changed

Lines changed: 34 additions & 5 deletions

File tree

AGENTS.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# AGENTS.md
2+
3+
## Cursor Cloud specific instructions
4+
5+
This is a Rust library crate (ndarray fork with HPC extensions). No external services (databases, APIs) are needed.
6+
7+
### Quick reference
8+
9+
| Action | Command |
10+
|--------|---------|
11+
| Build | `cargo build` |
12+
| Lint | `cargo clippy -- -D warnings` |
13+
| Test (lib) | `cargo test --lib -p ndarray` |
14+
| Test (workspace) | `cargo test` |
15+
| Test (HPC subset) | `cargo test --lib -p ndarray -- hpc::` |
16+
| Run example | `cargo run --example life` |
17+
| Format check | `cargo fmt -- --check` |
18+
19+
### Environment notes
20+
21+
- **Rust 1.94.0** is pinned via `rust-toolchain.toml`; rustup auto-selects it in `/workspace`.
22+
- **No AVX-512 hardware** in Cloud Agent VMs — SIMD kernel tests using `#[target_feature(enable = "avx512f")]` are compile-gated and will be skipped at runtime. This is expected behavior.
23+
- **Feature gates**: `intel-mkl` and `openblas` are mutually exclusive and require system libraries not installed by default. The default build uses `native` (pure Rust SIMD) which needs no extra libs.
24+
- **Build time**: ~18s cold, <1s incremental. Tests (~1819) take ~70s.
25+
- The workspace has sub-crates under `crates/` and `ndarray-rand/`. Default members exclude `blas-tests` and `blas-mock-tests` (they activate the `blas` feature which needs cblas-sys linking).
26+
- `libssl-dev` is needed as a build dependency for some transitive crates.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ name = "ndarray"
3434
bench = false
3535
test = true
3636

37+
[[example]]
38+
name = "ocr_benchmark"
39+
required-features = ["std"]
3740

3841
[dependencies]
3942
num-integer = { workspace = true }

src/hpc/renderer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ mod tests {
425425
let _ = &*GLOBAL_RENDERER;
426426
// First-touch: tick count is 0; capacity is at least 4096
427427
// (could be greater if PREFERRED_F32_LANES > 16 at some future tier).
428-
assert!(GLOBAL_RENDERER.tick_count() >= 0);
428+
assert_eq!(GLOBAL_RENDERER.tick_count(), 0);
429429
let f = GLOBAL_RENDERER.read_front();
430430
assert!(f.capacity >= 4096);
431431
}

src/hpc/vml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ mod tests {
475475

476476
// Generate "weight" data (deterministic, mimics Gaussian distribution)
477477
let weights: Vec<f64> = (0..d)
478-
.map(|i| ((i as f64 * 0.7 + 13.0).sin() * 2.5))
478+
.map(|i| (i as f64 * 0.7 + 13.0).sin() * 2.5)
479479
.collect();
480480

481481
// ── ENCODING: f64[4096] → f64[17] (golden-step projection) ──

src/hpc/vnni_gemm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ mod tests {
315315
let n = 5;
316316
let k = 8;
317317
let a: Vec<u8> = (0..m * k).map(|i| (i % 200) as u8).collect();
318-
let b: Vec<i8> = (0..k * n).map(|i| ((i % 100) as i8 - 50)).collect();
318+
let b: Vec<i8> = (0..k * n).map(|i| (i % 100) as i8 - 50).collect();
319319
let expected = scalar_gemm(&a, &b, m, n, k);
320320
let mut c = vec![0i32; m * n];
321321
int8_gemm_vnni(&a, &b, &mut c, m, n, k);

src/simd_int_ops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ mod tests {
284284
#[test]
285285
fn add_i16_matches_scalar_for_tail_lengths() {
286286
for &len in &[0usize, 1, 31, 32, 33, 64, 65, 100] {
287-
let a_init: Vec<i16> = (0..len).map(|i| (i as i16 * 7 - 1000)).collect();
288-
let b: Vec<i16> = (0..len).map(|i| (i as i16 * -3 + 500)).collect();
287+
let a_init: Vec<i16> = (0..len).map(|i| i as i16 * 7 - 1000).collect();
288+
let b: Vec<i16> = (0..len).map(|i| i as i16 * -3 + 500).collect();
289289

290290
let mut a_simd = a_init.clone();
291291
add_i16(&mut a_simd, &b);

0 commit comments

Comments
 (0)