Skip to content

Commit 59bdb04

Browse files
authored
Merge pull request #351 from AdaWorldAPI/ccr-b2e415d9-4jfvyk
splat3d_correctness: clippy 1.99 clean under --features splat3d
2 parents 3932a21 + 9a63e7a commit 59bdb04

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

‎.claude/blackboard.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2026-10-10 — `tests/splat3d_correctness.rs`: clippy 1.99 clean under `--features splat3d`
2+
3+
- 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()`.
4+
- No behaviour change: `cargo test --features splat3d --test splat3d_correctness` 5/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.
6+
17
## 2026-10-10 — `simd_avx.rs`: AVX-without-AVX2 realization (Sandy/Ivy Bridge, Bulldozer–Jaguar), plus three pre-existing x86 fixes
28

39
- **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.

‎tests/splat3d_correctness.rs‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use ndarray::hpc::splat3d::{Camera, Gaussian3D, SplatFrame, SplatRenderer, SH_CO
2828
fn build_synthetic_cube_scene(frame: &mut SplatFrame) {
2929
let n = 10;
3030
let mut state = 0xC0FFEEu32;
31-
let mut xor_advance = |s: &mut u32| {
31+
let xor_advance = |s: &mut u32| {
3232
*s ^= *s << 13;
3333
*s ^= *s >> 17;
3434
*s ^= *s << 5;
@@ -45,7 +45,7 @@ fn build_synthetic_cube_scene(frame: &mut SplatFrame) {
4545
// R = ix/(n-1), G = iy/(n-1), B = iz/(n-1)
4646
// Pre-divide by SH_C0 ≈ 0.282 so the output (which is
4747
// SH_C0 · sh[0] + 0.5) lands at the intended color.
48-
let sh_c0: f32 = 0.28209479177387814;
48+
let sh_c0: f32 = 0.282_094_8;
4949
sh[0] = (ix as f32) / (n - 1) as f32 / sh_c0;
5050
sh[16] = (iy as f32) / (n - 1) as f32 / sh_c0;
5151
sh[32] = (iz as f32) / (n - 1) as f32 / sh_c0;
@@ -116,7 +116,9 @@ fn end_to_end_synthetic_cube_renders_without_panic() {
116116
// nothing.
117117
let lit_pixels = frame
118118
.framebuffer
119-
.chunks_exact(3)
119+
.as_chunks::<3>()
120+
.0
121+
.iter()
120122
.filter(|p| p[0] > 0.01 || p[1] > 0.01 || p[2] > 0.01)
121123
.count();
122124
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() {
125127
// total saturation bug or an early-out failure).
126128
let saturated_pixels = frame
127129
.framebuffer
128-
.chunks_exact(3)
130+
.as_chunks::<3>()
131+
.0
132+
.iter()
129133
.filter(|p| p[0] > 0.99 && p[1] > 0.99 && p[2] > 0.99)
130134
.count();
131135
assert!(
@@ -195,7 +199,7 @@ fn end_to_end_empty_scene_yields_pure_background() {
195199
let bg = [0.25_f32, 0.5, 0.75];
196200
frame.tick(&camera, bg);
197201

198-
for (i, chunk) in frame.framebuffer.chunks_exact(3).enumerate() {
202+
for (i, chunk) in frame.framebuffer.as_chunks::<3>().0.iter().enumerate() {
199203
assert!(
200204
(chunk[0] - bg[0]).abs() < 1e-6 && (chunk[1] - bg[1]).abs() < 1e-6 && (chunk[2] - bg[2]).abs() < 1e-6,
201205
"pixel {i}: expected bg = {bg:?}, got [{}, {}, {}]",

0 commit comments

Comments
 (0)