Skip to content

Commit b8a44cc

Browse files
physicsrobclaude
andcommitted
Sweep remaining broken-pointer doom citations
Five spots cited specific deleted artifacts (deleted test files, deleted flows, deleted callsite tables). Each carried a citation that no reader could resolve. - `torchwright/compiler/components/attn.py:22` — dropped the `tests/doom/test_thinking_readback.py::test_emit_continuous_roundtrip` citation. The surrounding paragraph already explains the failure mode it demonstrated. - `torchwright/compiler/export.py:953` — dropped 'dev-mode DOOM play' from 'Used for dev-mode DOOM play and compiler-output tests…'. The dev-mode play flow lived in deleted code; compiler-output tests are the only surviving caller. - `torchwright/debug/noise.py:219` — dropped 'DOOM callsites' from the noise-footer generator's docstring; after the bucket-3 distribution rename, distributions no longer carry callsite descriptions, so the warning was misleading. Kept the rule (per-distribution context lives in the markdown reference, not in op docstrings). - `tests/ops/test_piecewise_linear_2d.py:4` — dropped 'it was only exercised indirectly through the DOOM renderer tests' from the module docstring. Those tests don't exist here. The remaining description (what the tests verify) stands on its own. - `CLAUDE.md` § 'probe_compiled' — rewrote the 'Interpreting atol' paragraph. Was: 'For the DOOM renderer (deep op chains, values in the 10^4 range), atol=500 is the empirical floor — see the atol comment in tests/debug/test_probe.py:test_probe_clean_on_v2_box_room'. That test was deleted in the Step E aftermath. Replaced with a general rule (op-chain depth and value-range magnitude both push the floor up; tighten on precision wins). Three flavor mentions ('e.g. the DOOM renderer', 'e.g. DOOM's rows_per_patch', 'typical DOOM pattern') in the same files were left alone — they cite DOOM as a worked example without broken pointers, which is fine per the user's standing policy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bdb0332 commit b8a44cc

5 files changed

Lines changed: 17 additions & 18 deletions

File tree

CLAUDE.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,14 @@ one call:
355355
d=2048, d_head=32, atol=500.0)
356356

357357
**Interpreting `atol`.** The tolerance must account for accumulated
358-
piecewise-linear approximation error through the graph. For a
359-
shallow graph (few ops, small value range), `atol=1e-3` is
360-
appropriate. For the DOOM renderer (deep op chains, values in the
361-
10^4 range), `atol=500` is the empirical floor — see the atol
362-
comment in `tests/debug/test_probe.py:test_probe_clean_on_v2_box_room`.
358+
piecewise-linear approximation error through the graph. Both op-chain
359+
depth and value-range magnitude push the floor up: a shallow graph
360+
with values near 1 can use `atol=1e-3`; a deep chain operating on
361+
values in the `10^4` range may need `atol` of several hundred to
362+
absorb fp32 accumulation in the matmul-based residual writes. Set it
363+
just above the largest legitimate divergence the oracle comparison
364+
should tolerate, and tighten it whenever you land a precision
365+
improvement.
363366

364367
## probe_residual — layer-by-layer node values
365368

tests/ops/test_piecewise_linear_2d.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
"""Unit tests for piecewise_linear_2d.
22
3-
The 2D primitive had no dedicated tests — it was only exercised
4-
indirectly through the DOOM renderer tests. These tests verify
5-
correctness in isolation: exact at grid points, bounded interpolation
6-
error, boundary clamping, non-uniform grids, and compiled-vs-oracle
7-
agreement via probe_graph.
3+
These tests verify correctness in isolation: exact at grid points,
4+
bounded interpolation error, boundary clamping, non-uniform grids, and
5+
compiled-vs-oracle agreement via probe_graph.
86
"""
97

108
import math

torchwright/compiler/components/attn.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
# Why it matters here: cancel heads (V=identity, O=-identity) rely on
1919
# attn_out + skip = 0 algebraically. A 1-LSB perturbation at q≈22855
2020
# leaves a ~1/512 leak in the residual column, which propagates through
21-
# the encoder and flips Gray-code bits at boundary q values — see
22-
# tests/doom/test_thinking_readback.py::test_emit_continuous_roundtrip.
21+
# the encoder and flips Gray-code bits at boundary q values.
2322
# Same shape applies to compute_linear (Linear emulated as self-attn).
2423
_SDPA_BACKEND = [SDPBackend.MATH]
2524

torchwright/compiler/export.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -950,10 +950,9 @@ def add(op, ins, outs, **attrs):
950950
# In-process headless callable: a thin adapter over HeadlessTransformer.compute()
951951
# that presents the same (inputs) -> outputs interface as OnnxHeadlessModule.
952952
#
953-
# Used for dev-mode DOOM play and compiler-output tests that don't need an
954-
# ONNX round-trip. For production inference, export with
955-
# compile_headless_to_onnx instead — that path streams weights and runs
956-
# under onnxruntime.
953+
# Used for compiler-output tests that don't need an ONNX round-trip. For
954+
# production inference, export with compile_headless_to_onnx instead —
955+
# that path streams weights and runs under onnxruntime.
957956
# ---------------------------------------------------------------------------
958957

959958

torchwright/debug/noise.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ def render_footer_block(
216216
217217
The footer is deliberately distribution-agnostic: it reports the worst
218218
observed abs and rel error across every distribution the op was measured
219-
on. Project-specific context (DOOM callsites, distribution names) lives
220-
in ``docs/numerical_noise.md``, not in the op's docstring.
219+
on. Per-distribution context lives in ``docs/numerical_noise.md``, not
220+
in the op's docstring.
221221
"""
222222
body = indent + " "
223223
rel_txt = "n/a" if _is_nan(max_rel_error) else _fmt(max_rel_error)

0 commit comments

Comments
 (0)