Skip to content

Commit c75a67b

Browse files
committed
guard: skip dangling symlinks; correct stale wasm mul_add and DR512 notes
facet-stride-guard --all crashed on the 34 crates/burn/src/*.rs paths, which are symlinks into an absent ../upstream checkout. The --diff and --hook modes already skipped non-files; --all now does too. The count is unchanged (166). wasm-simd-consumer-guide said wasm mul_add rounds twice; since #374/#378 it rounds once on every realization and is checked bit for bit, so a mul_add parity test may assert equality. The NaN mindmap plan records #383: on integer lanes one presence/polarity bit replaces #381's two planes, and float presence of a DR512 lane is P | ne_u8_to_mask(M, 0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMPh2Seh2WLccCksAdY
1 parent 2cbe131 commit c75a67b

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

‎.claude/hooks/facet-stride-guard.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ print(ti.get("file_path") or ti.get("notebook_path") or "")' 2>/dev/null)"
217217
for f in "$@"; do f="${f#"$ROOT"/}"; [ -f "$f" ] && whole_file "$f" | check_lines "$f"; done
218218
;;
219219
--all)
220-
while IFS= read -r f; do whole_file "$f" | check_lines "$f"; done \
220+
# A tracked path can be a dangling symlink (crates/burn/src/*.rs point
221+
# into an absent ../upstream checkout); skip anything that is not a file.
222+
while IFS= read -r f; do [ -f "$f" ] && whole_file "$f" | check_lines "$f"; done \
221223
< <(git ls-files '*.rs' | while IFS= read -r f; do in_scope "$f" && echo "$f"; done)
222224
;;
223225
*) echo "usage: $0 --hook | --diff <rev> | --all | --file <path>..." >&2; exit 64 ;;

‎.claude/knowledge/wasm-simd-consumer-guide.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Any parity test that must pass on more than one target has to allow for it:
203203

204204
| | wasm32 SIMD128 | scalar fallback | AVX / NEON |
205205
|---|---|---|---|
206-
| `mul_add` | `mul`+`add`, two roundings (unless `relaxed-simd`) | fused | fused |
206+
| `mul_add` | one rounding, emulated (f32 via round-to-odd in f64; f64 via Dekker + two-sum, exact fallback outside the certified range) | one rounding | one rounding (fused) |
207207
| `reduce_sum` | balanced tree | sequential fold | tree |
208208
| `round` | round-half-to-even | half-away-from-zero | half-to-even |
209209
| `min`/`max` with NaN | IEEE, NaN-propagating | returns the non-NaN operand | varies |
@@ -218,8 +218,11 @@ assert!((a - b).abs() <= 1e-4 * b.abs().max(1.0));
218218
and the scalar reference should be **the same function the tail uses** —
219219
one definition, so the two cannot drift apart.
220220

221-
Enabling `relaxed-simd` restores a fused `mul_add` via `f32x4_relaxed_madd`,
222-
at the cost of a target feature not every runtime has. Prefer the tolerance.
221+
`mul_add` is the exception to the tolerance rule: since #374/#378 every
222+
realization, wasm included, rounds once and is checked bit for bit against the
223+
parity crate's integer oracle, so a `mul_add` parity test may assert equality.
224+
`relaxed-simd` changes nothing here; no source path selects
225+
`f32x4_relaxed_madd`. The other rows still need the tolerance.
223226

224227
---
225228

‎.claude/plans/nan-exclusion-mindmap-scratch.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
> so a later session can pick a design without re-deriving the trade-offs.
1111
> Context: the follow-up to #378 (wasm `mul_add` rounds once on every
1212
> realization) and lance-graph `D-WFL-DET` (replay determinism).
13+
>
14+
> **2026-10-29 update.** The float-lane decision below stands and is merged
15+
> (#381). For integer lanes, #383 (`.claude/knowledge/dr512-epistemic-pm-invariant.md`)
16+
> replaced the two-plane sign + presence layout of #381's probe and #382's
17+
> first `lut9` with ONE presence/polarity bit: P=0,M=0 is the only NaN
18+
> (never touched), P=0,M>0 is negative, P=1 is positive or +0. `codec9.rs`
19+
> encodes it and `lut9` keeps it. The bridge to the float lane is one mask
20+
> expression: float presence = `P | ne_u8_to_mask(M, 0)` (its complement is
21+
> `never_touched`), which is the plane `nan_where_clear_f32` consumes when a
22+
> DR512 lane is decoded. S2 (masked float
23+
> fold) and S3 (`n_excluded`) are still open.
1324
1425
## The question
1526

0 commit comments

Comments
 (0)