Skip to content

PR: feat: tagma hardware fixture specs, decode projector, and coverage gate #47 - #49

Merged
metasmile merged 10 commits into
mainfrom
47-tagma-fixture-specs
Aug 23, 2026
Merged

PR: feat: tagma hardware fixture specs, decode projector, and coverage gate #47#49
metasmile merged 10 commits into
mainfrom
47-tagma-fixture-specs

Conversation

@metasmile

Copy link
Copy Markdown
Contributor

Summary

Adds the Tagma hardware verification slice of the syntagma hardware track to ev, per issue #47, plus the decode projector extension of issue #46 (milestone 2).

Changes

  • tests/fixtures/tagma/tagma_decoder.xif.yaml: decoder input domain contract (65,536 raw, 11,172 valid), pinning the U+D7A3 boundary correction.
  • tests/fixtures/tagma/tagma_demo_top.xif.yaml: demo top output axis space (11,172, all valid).
  • tagma_decode projector (issue Tagma decoder execution path verification: ev as an independent channel #46 milestone 2): ProjectorSpec::TagmaDecode in src/spec/mod.rs, evaluator in src/verify/registry.rs packing the decomposition into the golden-anchor layout offset[28:15] i[14:10] m[9:5] f[4:0], and the sv_projector arm in src/synth/mod.rs. The projection of code 0xAC00 + k equals line k of syntagma/hw/rtl/golden_anchors.hex (spot values 0x00000000, 0x00008001, 0x00010002 confirmed; full 11,172-domain loop in tests).
  • Tests: tests/tagma_fixture.rs (5 lib-level tests incl. projection spot values and SV generation), tests/cli_test.rs (+3), run.sh assertions, R4 CLI test un-ignored.
  • CI coverage gate: scripts/coverage.sh, Makefile coverage, run.sh --coverage, coverage job in build-ev.yml (80% lines/regions, Spike/Yosys/sim backends exercised via local tools or the ev image). Measured 83.35% lines / 82.34% regions at the time of writing.
  • Docs: plan devlog docs/devlog/2026-08-23-tagma-hw-fixtures.md, README fixture table, projectors, coverage gate rows.

Validation

  • cargo test --release: 101 passing (73 lib + 18 CLI + 5 tagma + 5 structural), 1 ignored (the 33M CLI test, tracked by CLI structural integration + CVA6 full struct_enum benchmark verification #42).
  • bash run.sh --code: fmt, clippy, build, test, bench all pass.
  • bash run.sh --coverage: gate passes (82.30% regions / 83.27% lines at HEAD).
  • All committed fixture counts verified unchanged on the structural pipeline path.

Related

@metasmile metasmile left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the Tagma fixtures, decode projector, and coverage gate. Actionable items: add --pull=always to the coverage docker fallbacks, add a comment to the generated SV about the negative-offset case, and reconcile the README validation table with main at merge. The tautology note on tagma_demo_top is informational.

Comment thread README.md Outdated
| Constraint types | 13 (range, even, eq, neq, lt, gt, le, ge, oneof, cross, bitmask, enable_mask, enable_set) |
| Tests | 92 (73 lib + 14 CLI + 5 structural), all passing |
| Projector types | 4 (sum, identity, parity, tagma_decode) |
| Tests | 101 (73 lib + 18 CLI + 5 tagma + 5 structural), all passing |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line will conflict with main's validation table, which the CLI structural integration (already merged) restructured and updated to 97 tests. After merging this branch into that main, the reconciled count is 105 (73 lib + 19 CLI + 5 tagma + 8 structural), and the Coverage gate / Projector types rows should be kept alongside the restructured metrics. Please reconcile the README table at merge time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixture is a tautology: the 11,172 combinations are exactly the product of the three field ranges, so every combination passes without any constraint. It documents the decoder codomain (and the devlog says so explicitly), but it adds no verification beyond the ranges themselves. Acceptable as documentation; consider dropping it if it ever becomes a maintenance burden.

Comment thread src/synth/mod.rs
crate::spec::ProjectorSpec::Parity { field } => {
format!("{}[0]", field)
}
crate::spec::ProjectorSpec::TagmaDecode { field, base } => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated SV computes (code - base) / 588 and (code - base) % 28 on a possibly negative value for code points below the block base. SystemVerilog integer division and modulo semantics for negative operands are tool-dependent, but this assertion module is only exercised on the valid domain, so out-of-domain behavior is irrelevant to the check. A short comment noting that the expression is only meaningful for code >= base would prevent a future reader from "fixing" the negative case.

Comment thread scripts/coverage.sh Outdated
EV_SYNTH_BACKEND=yosys LLVM_PROFILE_FILE="$PROFRAW_DIR/ev-ext-%p-%m.profraw" \
"$EV_COV" synth --target "$ALL_PASS" >/dev/null
else
docker run --rm -v "$(pwd):/workspace" -w /workspace \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docker fallback runs docker run without a pull policy, so it uses whatever ghcr.io/ssccsorg/ev:latest is cached locally. In CI the runner is fresh and always fetches, but on a machine with a warm docker cache a stale image would silently change the yosys/spike versions used for the external backend runs, making the coverage numbers non-reproducible. Add --pull=always to both docker invocations (or an explicit docker pull step) so the gate is deterministic.

@metasmile metasmile self-assigned this Aug 23, 2026
@metasmile
metasmile merged commit aee34f5 into main Aug 23, 2026
1 check passed
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.

1 participant