compass(tests): size the tied head at a 4-byte element size as well as a 2-byte one - #290
Conversation
…s a 2-byte one Every call to tied_lm_head_bytes in test_memory_compare.py passed a 2-byte element size, so a function that ignored dtype_bytes and multiplied by 2 passed the whole file. Add one assertion on the tied 0.6B geometry at dtype_bytes=4: 151936 * 1024 * 4 = 622,329,856 bytes. Closes #284 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
| assert nbytes == 151_936 * 1_024 * 4 | ||
| assert nbytes == 622_329_856 |
There was a problem hiding this comment.
shrink: (principle 3, non-blocking) L320-321 assert the same value twice, once as the product and once as its literal. One line carries both: assert nbytes == 151_936 * 1_024 * 4 == 622_329_856. The T2 red keeps its message under the chained form: pytest still prints assert 311164928 == ((151936 * 1024) * 4). net: -1 line.
|
Review 1: APPROVE at No blocking issues. There is one non-blocking I read the eight design principles in Named result: reproduced (principle 8)I ran this on node 18, container
The T2 red at the head:
This matches the developer's table exactly. M3 is the caller-side mechanism: the function reads
Is the expected value derived or pinned? (principle 8)It is pinned, and the pin is sourced.
Design-doc referencesThe PR adds none. I checked over the whole of ponytail-review
net: -1 lines possible. Gate 1: the tree that will land
I gated it once on node 18, using the tree's own
Gates 2 and 3
Verdict: APPROVE, head |
Closes #284
What changed
One test in
tests/compass/test_memory_compare.py. It callstied_lm_head_byteson the tied Qwen3-0.6B geometry atdtype_bytes=4and checks the exact byte count:151936 * 1024 * 4 = 622,329,856. Before this, every call in the file passed a 2-byte element size. That meant a function which ignoreddtype_bytesand always multiplied by 2 still passed the whole file.Lines changed: production 0, tests +7 / -0.
Named result (node 18,
xiaobizh_n18_cpu, each side on its owngit archivecopy,atom.__file__checked under it)T2 is
return vocab * hidden * int(dtype_bytes)changed toreturn vocab * hidden * 2, one line for one line. The null control keeps the original line and adds a trailing comment to it. Both runs usedpytest tests/compass/test_memory_compare.py.3c8bca938dfed2cb3dThe test that fails under T2:
tests/compass/test_memory_compare.py::test_the_tied_head_scales_with_a_4_byte_element_size.The base now has 53 tests rather than the 51 the brief measured, because #283 landed two parametrised cases in this file. I rebased onto that tip before gating.
Gate 1: ATOM CPU suite, unmodified, against a control measured on the same tip
I ran
scripts/compass/gate_cpu.shfrom each tree's own copy, with the.compass-commitand.compass-changedstamps written.GATE_CPU_RC3c8bca938dfed2cb3dThe difference in collected node ids is exactly one, the added test above.
git merge-tree --write-tree 99fc506f9 dfed2cb3dgivesb4b0fe4a977ece102ae94bfe5f1ad4e031fcc4eb(clean).99fc506f9is the integration tip when this PR was opened. It is3c8bca938plus #287, which changes only design markdown files and no code or tests. For that reason I did not restack or re-gate the branch onto it.Gate 2
The new test is CPU-only, lives in
tests/compass/, and runs under the device-reading autouse fixture already in the file. On this file,ruff checkandruff format --checkare clean on both sides.Dev record
Nothing surprising came up. #283 landed on the same file while this branch was being gated. The two changes touch separate regions, and the rebase was clean.
🤖 Generated with Claude Code