test(bitnet): assert the DMA address advance per state arm, not by literal count - #2385
Merged
Conversation
…teral count dma_local_addr_autoincrement_both_paths counted one literal across the whole module and required two. #2345 replaced the read path's post-increment with local_addr <= beat_index -- the #2003 fix -- so the count fell to one and the test has been red on master since. The emitter is correct; the test was stale. A global count cannot say which path a match came from, which is what let the read path lose its advance while the assertion still saw one match. Lowering the threshold to >= 1 would go green and re-open the same blind spot. Now sliced per state arm. Invisible until now because cargo test stops at the first failing target and this is the 42nd of 73 (#2382). Closes #2384
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-08-22 07:49:29 UTC
Summary
Seal Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2384
The defect
dma_local_addr_autoincrement_both_pathscounts one literal across the whole emittedmodule and requires two:
#2345 (
Closes #2003) replaced the read path's post-increment withlocal_addr <= beat_index— deliberately, because the post-increment landed beat 0'sdata at address 1 and never wrote slot 0.
bumpsfell to 1 and the test has been red onmaster since. #2345's file list is
bootstrap/src/bitnet_dma.rsplus its NOW entry; thetest was not touched.
The emitter is correct. The test was stale.
Why it was invisible, and why that is the interesting part
cargo test -p t27c --testsstops after the first failing target, and this is the 42nd of73 — so it never ran. That is #2382, and this is its first concrete instance: a genuine
regression sitting on master for a day, not because a gate was missing but because the gate
everyone assumed was running had never reached the target. The ratchet landed in #2383 is
what will surface the next one.
Why not lower the threshold
The property the test names — each transfer path advances the destination address — is
still true. Both paths do it, by different mechanisms:
On the write path
local_addris a read pointer into local memory, so a post-incrementis right there and must not be harmonised with the read path.
Changing
>= 2to>= 1would go green and re-open the same blind spot: a global countcannot say which path a match came from, which is exactly what would let one path silently
lose its advance while the assertion still saw the other. Now sliced per state arm, so
an assertion cannot be satisfied by an identical line in a different state.
Evidence
Three mutants, one per assertion. Each verified planted (
planted=1) before running —an earlier attempt's
sedsilently matched nothing and the tests passed, which would haveread as "the guard does not bite" had the plant not been checked.
bitnet_dma.rs:217removedREAD_DATA must present the beat index as the address, not post-increment (that was #2003 — beat 0 landed at address 1 and slot 0 was never written).:218removedREAD_DATA must advance beat_index, or every beat writes address 0.:235removedWRITE_DATA must advance local_addr, or every beat reads the same word.21 passed; 1 failedeach time, each caught by its own assertion. Restored:22 passed; 0 failed.Baseline pruned 383 → 382, since the test now passes and a fixed entry left in the baseline
is the rot the ratchet's recovery reporting exists to prevent.
What this does not establish
property it names.
still unestablished — born-failing and just-regressed need different responses.
Corpus ratchet,coverageandexhaustive-fullare red on master already; none isrequired and none is reachable from a test-plus-docs diff.