Skip to content

PR: feat: make structural enumeration the CLI verify default #42 - #48

Merged
metasmile merged 2 commits into
mainfrom
42-cli-structural-integration
Aug 23, 2026
Merged

PR: feat: make structural enumeration the CLI verify default #42#48
metasmile merged 2 commits into
mainfrom
42-cli-structural-integration

Conversation

@metasmile

Copy link
Copy Markdown
Contributor

Summary

Integrates the structural enumeration pipeline (issue #40, tagma_core CoordSpace) into the ev verify CLI path, closing issue #42 and unlocking the two speed-ignored CLI tests.

Changes

  • src/verify/compose.rs: raw_total_combinations computes the cartesian product size from field domains without enumeration, sharing the overflow and MAX_COMBINATIONS guard with expand_all.
  • src/verify/evaluate.rs: evaluate_structural returns the raw total plus the evaluations of the structurally valid subset (StructuralEnum + evaluate_all), with an invariant guard that fails loudly if the emitted count exceeds the raw total.
  • src/report/reporter.rs: ReporterCapable::report gains a total parameter; the four reporters derive failed = total - passed via split_counts, which asserts passed <= total. The TextReporter prints the failure header only when failure rows are present.
  • src/main.rs: verify routes through evaluate_structural; the simulate channel is unchanged.
  • Tests: the two ignored CLI tests now run and assert summary counts (16,384 / 2,560 / 13,824 R4; 33,554,432 / 196,608 / 33,357,824 full). Three lib-level tests in tests/structural_enum.rs pin evaluate_structural against expand_all + evaluate_all, including an enable_mask differential test (alu_ext).
  • run.sh: the 33M fixture is asserted in CI instead of skipped; CVA6 full and R4 counts checked via _verify_check.
  • Docs: devlog docs/devlog/2026-08-23-cli-structural-integration.md, README pipeline and validation table updates.

Measured result

Metric Before After
ev verify CVA6 full (33.5M raw) 10.4 s 0.21 s
Evaluation rows for CVA6 full 33,554,432 196,608 (valid subset)
CLI tests ignored for speed 2 0

Counts are unchanged on every committed fixture (verified across all 10 fixtures). The 33M CLI test runs in 0.45 s in debug.

Validation

  • cargo test --release: 97 passing (73 lib + 16 CLI + 8 structural), none ignored.
  • bash run.sh --code: fmt, clippy, build, test, bench all pass.

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 reporter refactor. One actionable item: the "and N more failures" count should reflect the present rows in the structural pipeline. The split_counts invariant approach is sound.

Comment thread src/report/reporter.rs
fn split_counts(total: usize, evaluations: &[Evaluation]) -> (usize, usize) {
let passed = evaluations.iter().filter(|e| e.passed).count();
assert!(
passed <= total,

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 invariant is enforced with assert!, which panics. The trait returns bool rather than Result, so a panic is the loudest available signal for a caller-side contract violation, and it is preferable to a silent usize wrap in release. This is a reasonable design choice; documenting it in the trait doc comment (already done) is sufficient.

Comment thread src/report/reporter.rs Outdated
if i == MAX_PRINTED_FAILURES {
println!(
" ... and {} more failures",
failed_count - MAX_PRINTED_FAILURES

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 "and N more failures" count is failed_count - MAX_PRINTED_FAILURES, where failed_count includes combinations that were never enumerated in the structural pipeline (the structurally absent ones). This overstates the unprinted detail. Since failed_rows holds the present rows, failed_rows.len() - MAX_PRINTED_FAILURES is the accurate count of remaining listed rows; on the full expansion path the two are identical.

@metasmile metasmile self-assigned this Aug 23, 2026
@metasmile
metasmile merged commit b324e37 into main Aug 23, 2026
1 check passed
@metasmile
metasmile deleted the 42-cli-structural-integration branch August 23, 2026 16:06
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