Skip to content

Commit 5702eac

Browse files
physicsrobclaude
andcommitted
Generalize CLAUDE.md Testing section, drop compile_game() block
The Testing section was anchored to `compile_game()` — a function in the now-deleted `torchwright/doom/compile.py`. Three nested issues: - The 'Why sharding?' rationale named DOOM renderer tests and `compile_game(d=2048)` as the workload that motivated the design. After Step E, _HEAVY_FILES is empty in modal_test.py — there's no heavy file at all. Rewrote to general phrasing ('Tests that compile large transformer modules on GPU can take tens of seconds each'), noted _HEAVY_FILES is currently empty, and dropped the `compile_game(d=2048)` example from the 'when you add new tests' block. Kept the mechanism (the slot exists, future heavy tests will populate it). - The 'Compiled DOOM pipeline (test_pipeline.py): ~35-60s' bullet in Performance Expectations referenced a deleted file. Dropped. - The entire 'Writing Tests That Use compile_game()' subsection was guidance for a function and its dependents that are gone: `compile_game()`, `step_frame`, `tests/doom/test_pipeline.py`, `TestPipeline`. Deleted the subsection. The class-scoped-fixture pattern is real but has no current example in this repo; can be reintroduced when a heavy compiled-test exists. Also softened 'across 4 independent A100 GPU containers' to 'across independent A100 GPU containers' — the count varies as files move between shards (currently 2, was 4 before Step E). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e6ee1ae commit 5702eac

1 file changed

Lines changed: 11 additions & 25 deletions

File tree

CLAUDE.md

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -113,29 +113,29 @@ and directory-level runs belong on Modal via `make test`.
113113

114114
## How Test Sharding Works
115115

116-
`make test` runs the full suite across 4 independent A100 GPU containers
116+
`make test` runs the full suite across independent A100 GPU containers
117117
on Modal. Each container runs a subset of tests with exclusive GPU access.
118118

119-
**Why sharding?** The DOOM renderer tests call `compile_game(d=2048)` which
120-
builds a ~8GB transformer model on GPU. Sharding gives each compiled-test
121-
file its own GPU so compilations run in parallel.
119+
**Why sharding?** Tests that compile large transformer modules on GPU
120+
can take tens of seconds each. Sharding gives each heavy-test file
121+
its own GPU so compilations run in parallel.
122122

123123
**How it's configured** (in `modal_test.py`):
124124

125-
- `_HEAVY_FILES` — test files with large `compile_game()` calls get their
126-
own container.
127-
- `_MEDIUM_FILE_GROUPS` — list of file lists; each inner list shares one
128-
container. Multiple medium groups keep no single shard from
125+
- `_HEAVY_FILES` — test files heavy enough to warrant their own
126+
container. Currently empty; populate when a heavy compiled-test
127+
file is added.
128+
- `_MEDIUM_FILE_GROUPS` — list of file lists; each inner list shares
129+
one container. Multiple medium groups keep any single shard from
129130
dominating wall time.
130131
- Everything else goes into a catch-all shard automatically.
131132

132133
**When you add new tests:**
133134

134135
- New test files anywhere under `tests/` are picked up by the catch-all
135136
shard automatically. No config changes needed.
136-
- If a new file calls `compile_game(d=2048)` and is slow enough to warrant
137-
its own container, add it to `_HEAVY_FILES` or one of the
138-
`_MEDIUM_FILE_GROUPS`.
137+
- If a new file is slow enough to warrant its own container, add it
138+
to `_HEAVY_FILES` or one of the `_MEDIUM_FILE_GROUPS`.
139139

140140
**When using `FILE=`**, sharding is bypassed — the file runs in a single
141141
container. `-k` filters passed via `ARGS=` are applied to every shard.
@@ -147,20 +147,6 @@ Modal container orchestration overhead).
147147

148148
Single file (`make test FILE=...`): depends on the file.
149149
- Fast tests (ops, compile/forward, graph): 10-30s
150-
- Compiled DOOM pipeline (test_pipeline.py): ~35-60s
151-
152-
## Writing Tests That Use compile_game()
153-
154-
Tests calling `compile_game()` are expensive (~17s to compile, ~2s per
155-
`step_frame` inference on A100). Follow these patterns:
156-
157-
1. **Use class-scoped fixtures** to share the compiled module across tests
158-
in the same class. See `TestPipeline` in `tests/doom/test_pipeline.py`
159-
for an example.
160-
161-
2. **Don't pass `device="cpu"`** to `compile_headless()` or `compile_game()`.
162-
The default is `"auto"` which uses GPU when available. Forcing CPU will
163-
make inference ~8x slower.
164150

165151
## When full-suite tests fail but `-k` passes
166152

0 commit comments

Comments
 (0)