Commit 07c2fcd
committed
fix(helix): address CodeRabbit review — NaN guard + f32 clamp epsilon
Two valid review findings on PR #459:
1. placement.rs: HemispherePoint::lift produced NaN for n >= total
(u > 1 -> sqrt(1-u) = NaN). lift is public API, so an external caller
got a silent NaN. Clamp u to <= 1.0 so out-of-range n saturates to the
rim (r=1, y=0), matching the documented no-NaN contract. Added the
lift_out_of_range_n_saturates_to_rim test.
2. simd.rs: the batch Fisher-Z clamp epsilon 1e-9 is below the f32 ULP
near 1.0 (~1.19e-7), so 1.0 - 1e-9 rounded to 1.0f32 and the clamp was
a no-op -- s = +/-1 produced ln(0) = -inf. Bumped EPS to 1e-6 (the f64
Similarity::fisher_z keeps 1e-9). Added the
batch_fisher_z_boundary_inputs_are_finite test (+/-1, out-of-range).
The third comment (ndarray::simd::U8x64 "missing") is a false positive:
the ndarray-hpc feature resolves ndarray to the AdaWorldAPI fork at
../../../ndarray (which provides ::simd), not crates.io ndarray 0.16.1 --
the feature builds and tests green. Added a Cargo.toml note documenting
the sibling-fork requirement.
63 unit + 6 doctests pass on both feature configs; clippy -D warnings and
rustfmt clean.
https://claude.ai/code/session_013rjF2Dvo1DnBACpbpYSffE1 parent 4b70c8a commit 07c2fcd
3 files changed
Lines changed: 46 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
| 63 | + | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
255 | 276 | | |
256 | 277 | | |
257 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | | - | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
120 | 135 | | |
121 | 136 | | |
122 | 137 | | |
| |||
0 commit comments