test(sim): commit the three remaining differential harnesses (Refs #2348) - #2381
Merged
Conversation
Contributor
PR DashboardGenerated at: 2026-08-22 02:04:22 UTC
Summary
Seal Status
|
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
gHashTag
enabled auto-merge (squash)
August 22, 2026 02:04
…ng (Refs #1977) `layer_sequencer` never left RUN when asked for zero work: both terminators are `index == count-1` against an unsigned port, and the bare literal 1 widens each subtraction to 32 bits, so a zero count borrows to 32'hFFFFFFFF while the index zero-extends. Elaborates the PR #2337 pre-fix and post-fix renderings in one simulation. Reproduces the published numbers: 200,000 cycles with no `done` and `neuron_id` reaching exactly 50,000, plus six non-zero controls that are identical on every output every cycle. Reporting, not a gate: `vvp` exits 0 on FAIL as well as PASS. Refs #2348
#1985) `weight_prefetch_ctrl` documented `prefetch_done` as a one-cycle pulse but cleared it only inside the start guard, leaving it asserted for the whole idle gap. A requester sampling it in the cycle it raises `start_prefetch` reads the previous transaction's completion. Elaborates the PR #2340 pre-fix and post-fix renderings in one simulation. Reproduces the published numbers: t2 sampled_done OLD=1 / NEW=0, done_rises 2/2, we_count 4/4. A second case varies the idle gap to separate level from pulse: old's high-time grows with the gap, new's does not. Reporting, not a gate: `vvp` exits 0 on FAIL as well as PASS. Refs #2348
) #2006 defaults `local_we` low ahead of the case. The pre-fix and post-fix renderings are observationally IDENTICAL: every reachable path already drove the strobe, and the states that never mention it are never entered with it high, because READ_DATA's only exit is DONE_ST. A harness that passes by finding no difference proves nothing, so this one is three-way: A = pre-#2006 (PR #2344 base), B = #2006 (PR #2344 head), C = #2006 + #2003 (PR #2345 head). B and C are consecutive revisions -- #2344's head rendering is byte-identical to #2345's base -- so one comparator sees all three. A vs B must be identical; B vs C must differ. Same comparator, same stimulus, same run, same 293-bit vector of every output port. Putting B in the C slot makes the run fail rather than certify its null result. Measured: A vs B 0 mismatching cycles, B vs C 266, over 373 cycles and seven phases. Deleting READ_DATA's `end else local_we <= 1'b0;` from both renderings makes A emit 22 local writes against B's 18 -- latent today, a real backstop the moment an arm stops clearing the strobe. Reporting, not a gate: `vvp` exits 0 on FAIL as well as PASS. Refs #2348
…ecipe (Refs #2348) Adds a README section per harness in the style #2379 established, plus the shared emit recipe: every BitNet emitter compiles standalone under `rustc` with a four-line driver, no cargo and no target directory, because the only `use` in any of them is `use super::*` inside `#[cfg(test)]`. Records the base/head shas each harness was rendered from, and the three instrument faults found while reproducing the published claims -- a posedge-sampled observer trailing the design by a cycle, an observer racing the stimulus that drove `start_prefetch`, and `first_chunk`/`last_chunk` having no reset in either rendering. Each was a fault in the instrument; every published number reproduced once the instrument was corrected. Refs #1977, #1985, #2006
gHashTag
force-pushed
the
sim/2348-harnesses
branch
from
August 22, 2026 02:09
416c40f to
0f9295e
Compare
Contributor
PR DashboardGenerated at: 2026-08-22 02:09:46 UTC
Summary
Seal Status
|
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
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.
Commits the three differential harnesses that were still uncommitted under #2348, following the shape #2379 set for
tb_bitnet_dma_write_address.v— samesim/directory, same structure, same README section style.tb_bitnet_sequencer_zero_count.vbitnet_pipeline.rstb_bitnet_prefetch_done_pulse.vbitnet_buffers.rsprefetch_doneread stale at the next requesttb_bitnet_dma_we_default.vbitnet_dma.rsEvery published number reproduces
#2006 is a null result, so it got a third rendering
Its claim is that old and new are observationally identical — a harness that "passes" by showing no difference proves nothing, since one wired to the wrong ports finds no difference either.
A, B and C form a linear chain: PR #2344's head rendering is byte-identical to PR #2345's base rendering. So one comparator, one stimulus, one simulation, one 293-bit vector of every output port sees all three, and B vs C is the control — #2003 changed the
READ_DATAaddress arm, so a working comparator has to see it. Substituting B into the C slot makes the run fail rather than certify its own null result:Biting — one mutant per guard
num_neurons==0only1'b1valid never asserted (old=1 new=0) -- the control did no work and proves nothingprefetch_doneclear moved back inside the guard, new syntax keptFAIL new prefetch_done high-time is one cycle per completion: got 56, want 2— measures ports, not emitter textFAIL a non-prefetch_done output diverged ... baddr 1/2READ_DATAelse-clear deleted from both DMA renderingsFAIL A vs B local writes: got 18, want 22— A emits 4 spurious strobes; #2006 is latent today and a real backstopAnti-vacuity in all three: placing the fixed rendering in the
oldslot makes each harness fail, so none can pass against a non-defective "before" — e.g.FAIL harness: old reported done for a zero-neuron request -- the non-termination this harness exists to demonstrate is not reproducing.Three numbers did not reproduce at first — all three were my instrument
Diagnosed before any assertion was touched:
max_nid=49999while the port read50000;200000/4confirms 50000 independently. Observers moved to the negedge.start_prefetch, reportingt2 sampled_done=0for both renderings. The sample moved into the driving process.first_chunk/last_chunkare absent from the reset block of both renderings, so both sit at X until the first RUN cycle andX !== X. Now compared only whilevalidis high, withqual_cyclesasserted equal tonum_neurons*num_chunksso the qualification cannot void the check.A fourth bug surfaced only by running a mutant:
$displaytwo-string continuation together with format args printed"expe"as1702391909. Failure messages that are never exercised are not known to work.Reporting, not gates
vvpexits 0 onRESULT: FAILas well asRESULT: PASS, and no workflow runs these —cargo test -p t27cis invoked by none (#2292) andfpga-build.ymlnever callsvvp(#2241). No claim is made that anything here defendsmaster. Wiringsim/into CI is tracked separately.Every emitter compiles standalone under
rustcwith a four-line driver — no cargo, no target directory — because the onlyusein each isuse super::*inside#[cfg(test)]. Recipe and per-harness base/head shas are insim/README.md.Refs #2348, #1977, #1985, #2006