Skip to content

Commit bdb0332

Browse files
physicsrobclaude
andcommitted
Rename doom_* noise distributions to neutral names
The five `doom_*` input distributions defined in `scripts/measure_op_noise.py` were named after the doom-graph callsites that originally motivated them. After Step E, those callsites live in the sibling `torchwright_doom` repo; the distributions still encode the input-range characterizations used to calibrate piecewise ops, but the names and descriptions pointed at deleted code (Option A from inventory). Renames (chosen to match the file's existing `<op>_<range>_<details>` style — e.g. `log_4decades_001_100`, `compare_uniform_pm80`): - `doom_reciprocal_wall` → `reciprocal_03_200` - `doom_reciprocal_sorted` → `reciprocal_01_50_step01` - `doom_diff_trig` → `diff_trig_nonuniform` - `doom_diff_vel` → `diff_vel_nonuniform` - `doom_atan_cross_dot` → `atan_cross_dot_nonuniform` Description rewrites (drop the `mirrors the X callsite at torchwright/doom/...:line` tail; keep the input-range characterization). The `compare_near_thresh_05` and `linear_bin_index_tex_col_16` descriptions also had similar dead-callsite tails — scrubbed inline. Regenerated by `make measure-noise`: - `docs/op_noise_data.json` (commit SHA + new names) - `docs/numerical_noise.md` (auto-rendered) - per-op `.. noise-footer::` blocks in `torchwright/ops/{arithmetic, logic}_ops.py` Hand-edited `docs/numerical_noise_findings.md`: - Renamed all distribution references to the new names. - Renamed 'Input-amplification hazards (the Phase E trap, now partially mitigated)' to 'Input-amplification hazards in gate ops'; dropped the 'Worked Phase E example (historical)' subsection (postmortem pointer was deleted in Step E). - Dropped the 'Wired into DOOM' subsection of the `log` finding — documented how DOOM used log/exp on `torchwright/doom/stages/render.py`. - Dropped the E1M1/`inv_scale` worked example from the `compare(x, 0)` finding; kept the general working-rule. - Renamed 'Known gap: reciprocal sorted callsite' to 'Known gap: reciprocal at step=0.1'; dropped the `thinking_wall.py:1196` callsite reference and 'Latent production implication' paragraph. - Deleted the entire 'Production call-sites' section: every row was a deleted `torchwright/doom/stages/...` path. CLAUDE.md: - Removed the 'which DOOM call-sites each distribution covers' clause from the Numerical-noise section preamble. - Removed the 'Keep the call-site cross-reference table in sync when you add, rename, or remove a `doom_*` distribution' bullet from the measure-noise workflow. Also scrubbed one stale ops-docstring mention: `log_abs`'s docstring example 'coord · inv_scale in DOOM normalization' → 'signed_coord · positive_scale' (matches the parallel rewrite in the findings doc). Verified: full `make test` passes — 635 passed, 3 skipped. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c234ba4 commit bdb0332

7 files changed

Lines changed: 138 additions & 254 deletions

File tree

CLAUDE.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ is the canonical source; `docs/numerical_noise.md` and the per-op docstring
167167
footers are **generated** from that JSON. Never edit them by hand.
168168

169169
Commentary on the measurements — which numbers are by design, which deserve
170-
investigation, and which DOOM call-sites each distribution covers — lives in
171-
`docs/numerical_noise_findings.md`. That file is **hand-written and is
172-
Claude's responsibility to keep current**. The measurement pipeline does not
173-
regenerate it and the consistency test does not enforce it; synthesizing
174-
findings from the raw numbers is an interpretive task that belongs to the
175-
agent running the workflow, not to the script.
170+
investigation — lives in `docs/numerical_noise_findings.md`. That file is
171+
**hand-written and is Claude's responsibility to keep current**. The
172+
measurement pipeline does not regenerate it and the consistency test does
173+
not enforce it; synthesizing findings from the raw numbers is an
174+
interpretive task that belongs to the agent running the workflow, not to
175+
the script.
176176

177177
Specifically, whenever you run `make measure-noise` — whether because you
178178
added an op, edited one, or widened a distribution — you must:
@@ -183,8 +183,6 @@ added an op, edited one, or widened a distribution — you must:
183183
entry in `docs/numerical_noise_findings.md` or add a new one.
184184
3. Remove findings that no longer apply (e.g., if a bound is tightened and
185185
the previously-flagged number is now within expectations).
186-
4. Keep the call-site cross-reference table in sync when you add, rename, or
187-
remove a `doom_*` distribution.
188186

189187
Regenerate the auto-artefacts with:
190188

docs/numerical_noise.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Numerical noise reference
22

33
*Generated by `scripts/measure_op_noise.py`; do not edit by hand.*
4-
*Measured at commit `3829b69` on `2026-04-26`.*
4+
*Measured at commit `c234ba4` on `2026-04-29`.*
55

66
Every piecewise-linear op in `torchwright/ops/` is measured on one or more
7-
named input distributions that mirror its production use in
8-
`torchwright/doom/`. The canonical data lives in `docs/op_noise_data.json`;
9-
this file is regenerated from that JSON by `make measure-noise`.
7+
named input distributions characterising its expected input ranges.
8+
The canonical data lives in `docs/op_noise_data.json`; this file is
9+
regenerated from that JSON by `make measure-noise`.
1010

11-
For commentary on the numbers — which are expected, which warrant investigation — and for the DOOM call-site cross-reference, see the hand-written `docs/numerical_noise_findings.md`.
11+
For commentary on the numbers — which are expected, which warrant investigation — see the hand-written `docs/numerical_noise_findings.md`.
1212

1313
## Summary
1414

@@ -28,15 +28,15 @@ For commentary on the numbers — which are expected, which warrant investigatio
2828
| `linear_bin_index` | `torchwright.ops.arithmetic_ops` | 1 | 0.9854 | `linear_bin_index_tex_col_16` |
2929
| `log` | `torchwright.ops.arithmetic_ops` | 0.003026 | 0.003721 | `log_6decades_wide` |
3030
| `log_abs` | `torchwright.ops.arithmetic_ops` | 0.000699 | 0.1428 | `log_abs_3decades_pm100` |
31-
| `low_rank_2d` | `torchwright.ops.arithmetic_ops` | 0.0651 | 0.3314 | `doom_atan_cross_dot` |
31+
| `low_rank_2d` | `torchwright.ops.arithmetic_ops` | 0.0651 | 0.3314 | `atan_cross_dot_nonuniform` |
3232
| `max` | `torchwright.ops.arithmetic_ops` | 3.815e-06 | 1.953e-06 | `minmax_uniform_pm50` |
3333
| `min` | `torchwright.ops.arithmetic_ops` | 3.815e-06 | 1.953e-06 | `minmax_uniform_pm50` |
3434
| `mod_const` | `torchwright.ops.arithmetic_ops` | 0 | 0 | `mod_integers_0_100_by7` |
3535
| `multiply_2d` | `torchwright.ops.arithmetic_ops` | 0.0625 | 2.15 | `multiply_uniform_pm10` |
3636
| `multiply_integers` | `torchwright.ops.arithmetic_ops` | 0 | 0 | `multiply_integers_0_10` |
3737
| `piecewise_linear` | `torchwright.ops.arithmetic_ops` | 0.25 | 231.1 | `parabola_0_10_step1` |
38-
| `piecewise_linear_2d` | `torchwright.ops.arithmetic_ops` | 7.778 | 0.6024 | `doom_diff_trig` |
39-
| `reciprocal` | `torchwright.ops.arithmetic_ops` | 0.0009137 | 0.1686 | `doom_reciprocal_wall` |
38+
| `piecewise_linear_2d` | `torchwright.ops.arithmetic_ops` | 7.778 | 0.6024 | `diff_trig_nonuniform` |
39+
| `reciprocal` | `torchwright.ops.arithmetic_ops` | 0.0009137 | 0.1686 | `reciprocal_03_200` |
4040
| `signed_multiply` | `torchwright.ops.arithmetic_ops` | 0.06248 | 2.15 | `signed_multiply_pm10` |
4141
| `square` | `torchwright.ops.arithmetic_ops` | 0.25 | 231.1 | `square_unsigned_0_10` |
4242
| `square_signed` | `torchwright.ops.arithmetic_ops` | 0.25 | 276.7 | `square_signed_pm10` |
@@ -309,7 +309,7 @@ End-to-end composite (~6 MLP sublayers). Error compounds across `reciprocal`, `s
309309

310310
### `linear_bin_index_tex_col_16`
311311

312-
16-bin quantisation of x ∈ [0, 64] with x_min=0, x_max=64 — mirrors texture-column bucketing in the RENDER stage.
312+
16-bin quantisation of x ∈ [0, 64] with x_min=0, x_max=64.
313313

314314
| Metric | Value |
315315
| --- | --- |
@@ -379,9 +379,9 @@ log_abs(x) for x ∈ [-100, 100] with min_abs=0.1, max_abs=100 (3 decades on |x|
379379

380380
Rank-3 SVD of `atan(cross/dot)` on a non-uniform grid. Worst-cell error is bounded by σ_{K+1}, the first truncated singular value — verify against the SVD computed in `tests/ops/test_low_rank_2d.py:100`.
381381

382-
### `doom_atan_cross_dot`
382+
### `atan_cross_dot_nonuniform`
383383

384-
atan2(cross/dot) over [-2, 2] × [0.5, 10] on non-uniform grid — mirrors the `atan_front_*` callsite at `torchwright/doom/stages/sorted.py:549` (rank-3 SVD).
384+
atan2(cross/dot) over [-2, 2] × [0.5, 10] on a non-uniform grid — rank-3 SVD via `low_rank_2d`.
385385

386386
| Metric | Value |
387387
| --- | --- |
@@ -512,9 +512,9 @@ f(x)=x² on [0, 10] with integer breakpoints — probes generic `piecewise_linea
512512

513513
Triangulated-grid lookup with non-uniform breakpoints. On non-uniform grids `piecewise_linear_2d` uses a constrained least-squares fit that can oscillate in cell interiors — `low_rank_2d` is preferred there.
514514

515-
### `doom_diff_trig`
515+
### `diff_trig_nonuniform`
516516

517-
wall-geometry product over DIFF_BP × TRIG_BP — mirrors the `sort_ey_cos`/`sort_ex_sin` family of calls at `torchwright/doom/stages/thinking_wall.py:1115` and neighbours.
517+
Two-input product over DIFF_BP × TRIG_BP — DIFF in [-40, 40] (non-uniform), TRIG in [-1, 1] (non-uniform).
518518

519519
| Metric | Value |
520520
| --- | --- |
@@ -527,9 +527,9 @@ wall-geometry product over DIFF_BP × TRIG_BP — mirrors the `sort_ey_cos`/`sor
527527
| p99 rel error | 0.35 |
528528
| Worst input | `a=22.22`, `b=-1` |
529529

530-
### `doom_diff_vel`
530+
### `diff_vel_nonuniform`
531531

532-
collision product over DIFF_BP × VEL_BP — mirrors the `p_dx_ey`/`p_dy_ex` family at `torchwright/doom/stages/thinking_wall.py:1014`.
532+
Two-input product over DIFF_BP × VEL_BP — DIFF in [-40, 40] (non-uniform), VEL in [-0.7, 0.7] (non-uniform).
533533

534534
| Metric | Value |
535535
| --- | --- |
@@ -544,11 +544,11 @@ collision product over DIFF_BP × VEL_BP — mirrors the `p_dx_ey`/`p_dy_ex` fam
544544

545545
## `reciprocal`
546546

547-
Geometric breakpoint spacing keeps relative interpolation error roughly constant across the range. Measured against a reciprocal graph whose `(min_value, max_value, step)` matches its production callsite: `(0.3, 200.0, 1.0)` for `doom_reciprocal_wall` (`torchwright/doom/stages/wall.py:431`).
547+
Geometric breakpoint spacing keeps relative interpolation error roughly constant across the range. Measured against a reciprocal graph with `(min_value, max_value, step) = (0.3, 200.0, 1.0)`.
548548

549-
### `doom_reciprocal_wall`
549+
### `reciprocal_03_200`
550550

551-
1/x over [0.3, 200.0], step=1.0 — mirrors the `inv_abs_num_t` callsite at `torchwright/doom/stages/wall.py:339`.
551+
1/x over [0.3, 200.0], step=1.0.
552552

553553
| Metric | Value |
554554
| --- | --- |

0 commit comments

Comments
 (0)