Skip to content

Commit 6e0ce88

Browse files
committed
fix(hpc): clear last 5 clippy errors in lib doctest scope
Follow-up to bench migration commit (cb5caad). Removes the 5 lib-level clippy errors that surfaced under `cargo clippy --lib --tests`: - src/hpc/quantized.rs:431 — test fixture array used 3.14 as an arbitrary roundtrip value; clippy::approx_constant flagged it as approximate PI. Changed to 2.5 (still arbitrary, no longer triggers the lint). - src/hpc/blackboard.rs:484-485 — `bb.alloc_f32("x", 3.14)` + matching get assertion. Same case: arbitrary slot value, not actually PI. (The f64 sibling test correctly uses `std::f64::consts::PI` keyed as "pi" — kept unchanged.) Changed both 3.14 occurrences to 2.5. - src/hpc/jitson/parser.rs:487 — JSON parsing test with input `{"flt": 3.14, ...}` and matching float assertion. Both the JSON literal and the assertion changed to 2.5 in lockstep. - src/hpc/renderer.rs:428 — `assert!(GLOBAL_RENDERER.tick_count() >= 0)` was always true (u64 ≥ 0). The function-doc comment says "First-touch: tick count is 0", so the intent was an equality assertion. Changed to `assert_eq!(..., 0)`. Verification: `cargo clippy --all-targets --features rayon --no-deps` returns 0 errors across lib + tests + examples + benches + lib doctests. Remaining: 253 lib warnings (mostly unused imports + manual_div_ceil / manual_is_multiple_of mechanical lints; cargo clippy --fix can apply 107 of them automatically — separate cleanup commit if wanted).
1 parent cb5caad commit 6e0ce88

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/hpc/blackboard.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ mod tests {
481481
#[test]
482482
fn test_alloc_get_f32() {
483483
let mut bb = Blackboard::new();
484-
bb.alloc_f32("x", 3.14);
485-
assert_eq!(bb.get_f32("x"), Some(&3.14));
484+
bb.alloc_f32("x", 2.5);
485+
assert_eq!(bb.get_f32("x"), Some(&2.5));
486486
assert_eq!(bb.get_f32("y"), None);
487487
}
488488

src/hpc/jitson/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,10 @@ mod tests {
481481

482482
#[test]
483483
fn test_parse_negative_and_float() {
484-
let input = r#"{"neg": -42, "flt": 3.14, "exp": 1e10}"#;
484+
let input = r#"{"neg": -42, "flt": 2.5, "exp": 1e10}"#;
485485
let root = parse_json(input).unwrap();
486486
assert!((root.get("neg").unwrap().as_f64().unwrap() - (-42.0)).abs() < 1e-10);
487-
assert!((root.get("flt").unwrap().as_f64().unwrap() - 3.14).abs() < 1e-10);
487+
assert!((root.get("flt").unwrap().as_f64().unwrap() - 2.5).abs() < 1e-10);
488488
assert!((root.get("exp").unwrap().as_f64().unwrap() - 1e10).abs() < 1.0);
489489
}
490490

src/hpc/quantized.rs

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

429429
#[test]
430430
fn test_bf16_roundtrip() {
431-
let values = [1.0f32, -1.0, 0.0, 3.14, 1000.0, 0.001];
431+
let values = [1.0f32, -1.0, 0.0, 2.5, 1000.0, 0.001];
432432
for &v in &values {
433433
let bf = BF16::from_f32(v);
434434
let back = bf.to_f32();

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
}

0 commit comments

Comments
 (0)