From 9a63e7a625013c330f6e064e0c85d8a696144d87 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 09:38:25 +0000 Subject: [PATCH] splat3d_correctness: clippy 1.99 clean under --features splat3d Five lints in the test file: needless mut on a closure, an over-precise f32 literal (same bits, 0x3e906ebb), three chunks_exact(3) -> as_chunks. No behaviour change; 5/5 pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFw2WdKr1oxvaKCJC2ua2R --- .claude/blackboard.md | 6 ++++++ tests/splat3d_correctness.rs | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.claude/blackboard.md b/.claude/blackboard.md index 350e88fd..3894c478 100644 --- a/.claude/blackboard.md +++ b/.claude/blackboard.md @@ -1,3 +1,9 @@ +## 2026-10-10 — `tests/splat3d_correctness.rs`: clippy 1.99 clean under `--features splat3d` + +- Five lints, all in the test file: an unneeded `mut` on a closure, an over-precise f32 literal (`0.28209479177387814` → `0.282_094_8`; same bits, `0x3e906ebb`), and three `chunks_exact(3)` → `as_chunks::<3>().0.iter()`. +- No behaviour change: `cargo test --features splat3d --test splat3d_correctness` 5/5. +- The file is `#![cfg(feature = "splat3d")]`, so a plain `cargo clippy --test splat3d_correctness` compiles nothing and reports success. The feature has to be on to see these lints. + ## 2026-10-10 — `simd_avx.rs`: AVX-without-AVX2 realization (Sandy/Ivy Bridge, Bulldozer–Jaguar), plus three pre-existing x86 fixes - **What:** a seventh realization, selected at compile time by `all(target_feature = "avx", not(target_feature = "avx2"))`. You get it with `target-cpu=native` on such a CPU, or with `.cargo/config-avx.toml` (`sandybridge`). The types and the `simd.rs` exports are unchanged; the 49 AVX2-only items in `simd_avx2.rs` and 19 in `simd_avx512.rs` are cfg-gated, and `simd_avx.rs` supplies the same methods from SSE2–SSE4.1 halves plus AVX1 float-domain ops. There are no runtime feature checks. The `cpu_guard` AVX2 startup floor applies only when the AVX2 arm is compiled in. Baseline builds (no `avx` cfg) are UNCHANGED: they keep the AVX2 arm and the floor. Whether the SSE tier should take them over is an open operator question. diff --git a/tests/splat3d_correctness.rs b/tests/splat3d_correctness.rs index 56732e67..0bb24d28 100644 --- a/tests/splat3d_correctness.rs +++ b/tests/splat3d_correctness.rs @@ -28,7 +28,7 @@ use ndarray::hpc::splat3d::{Camera, Gaussian3D, SplatFrame, SplatRenderer, SH_CO fn build_synthetic_cube_scene(frame: &mut SplatFrame) { let n = 10; let mut state = 0xC0FFEEu32; - let mut xor_advance = |s: &mut u32| { + let xor_advance = |s: &mut u32| { *s ^= *s << 13; *s ^= *s >> 17; *s ^= *s << 5; @@ -45,7 +45,7 @@ fn build_synthetic_cube_scene(frame: &mut SplatFrame) { // R = ix/(n-1), G = iy/(n-1), B = iz/(n-1) // Pre-divide by SH_C0 ≈ 0.282 so the output (which is // SH_C0 · sh[0] + 0.5) lands at the intended color. - let sh_c0: f32 = 0.28209479177387814; + let sh_c0: f32 = 0.282_094_8; sh[0] = (ix as f32) / (n - 1) as f32 / sh_c0; sh[16] = (iy as f32) / (n - 1) as f32 / sh_c0; sh[32] = (iz as f32) / (n - 1) as f32 / sh_c0; @@ -116,7 +116,9 @@ fn end_to_end_synthetic_cube_renders_without_panic() { // nothing. let lit_pixels = frame .framebuffer - .chunks_exact(3) + .as_chunks::<3>() + .0 + .iter() .filter(|p| p[0] > 0.01 || p[1] > 0.01 || p[2] > 0.01) .count(); assert!(lit_pixels > 100, "expected > 100 lit pixels from a 1000-gaussian cube scene, got {lit_pixels}"); @@ -125,7 +127,9 @@ fn end_to_end_synthetic_cube_renders_without_panic() { // total saturation bug or an early-out failure). let saturated_pixels = frame .framebuffer - .chunks_exact(3) + .as_chunks::<3>() + .0 + .iter() .filter(|p| p[0] > 0.99 && p[1] > 0.99 && p[2] > 0.99) .count(); assert!( @@ -195,7 +199,7 @@ fn end_to_end_empty_scene_yields_pure_background() { let bg = [0.25_f32, 0.5, 0.75]; frame.tick(&camera, bg); - for (i, chunk) in frame.framebuffer.chunks_exact(3).enumerate() { + for (i, chunk) in frame.framebuffer.as_chunks::<3>().0.iter().enumerate() { assert!( (chunk[0] - bg[0]).abs() < 1e-6 && (chunk[1] - bg[1]).abs() < 1e-6 && (chunk[2] - bg[2]).abs() < 1e-6, "pixel {i}: expected bg = {bg:?}, got [{}, {}, {}]",