Skip to content

test(bitnet): harden MAC coverage (overflow boundary + randomized reference sweep) - #1735

Merged
gHashTag merged 1 commit into
masterfrom
test/mac-randomized-sweep-work
Aug 5, 2026
Merged

gHashTag merged 1 commit into
masterfrom
test/mac-randomized-sweep-work

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Follow-up to the ternary MAC overflow fix (#1733). The functional testbench found that bug with 6 golden vectors; this hardens it so the bug class is provably dry and future arithmetic regressions are caught.

Closes #1734

Added to tests/bitnet_compute_mac.rs

  1. Overflow-boundary vectors — a level-2 group summing to exactly ±8 (8 P / 8 N in trits 0..7, rest Z, dotted with all-P). ±8 is the exact value the old signed [3:0] wrapped (it holds only +7), so this pins the fix at its boundary.
  2. Randomized reference sweep — 200 random valid-trit vector pairs (deterministic iverilog seed), each cross-checked against an independent in-testbench ref_dot (decode + multiply-accumulate, not using the DUT reduction tree). Any discrepancy would mean a real DUT bug.

Result

All golden + boundary + 200 random vectors pass → no further MAC arithmetic bug in the searched space. Test-only; no compiler/emitter change, no reseal. Skips gracefully without iverilog/vvp.

🤖 Generated with Claude Code

… sweep

Follow-up to the adder_tree_27 overflow fix (#1733). Add to the functional
MAC testbench: (1) level-2 boundary vectors summing to exactly +/-8 (the
value the old signed [3:0] wrapped), and (2) a 200-vector randomized sweep
checked against an independent in-testbench reference dot product. All pass;
no further MAC arithmetic bug in the searched space. Test-only; no reseal.

Closes #1734

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-05 18:10:59 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 0
PRs with All Checks Green 50
READY 0
FAILING 0
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=864a709e6e17 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag merged commit 11d7b98 into master Aug 5, 2026
21 of 23 checks passed
@gHashTag
gHashTag deleted the test/mac-randomized-sweep-work branch August 5, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: harden ternary MAC functional coverage (overflow boundary + randomized reference sweep)

1 participant