Skip to content

feat(t27c): test-report counts asserts and flags vacuous passes (Closes #6509) - #6788

Merged
gHashTag merged 1 commit into
masterfrom
claude/t27c-test-report-vacuity-6509
Oct 6, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claude/t27c-test-report-vacuity-6509

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Closes #6509
Refs #6488

What

t27c test-report now reports, per test, how many runtime asserts the test executed, and a summary line counting vacuous passes -- passes that executed 0 asserts. Such a pass certifies nothing: the trivial backend that compiles every test to return passes it too (sieve filter C10, theorem T730 in specs/compiler/theory/toolchain.t27). Semantics mirror t27b pass_vacuous (#6115, cli/t27b/src/eval.rs Interp::asserts): every assert executed at run time counts, callees included, once per execution (a loop counts per iteration); an assert whose operands are all compile-time constants, and comptime evaluation (invariants), do not count.

Single spec:

  tests       4
  pass        4
  FAIL        0
  rate    100.0%

  runtime asserts executed, per test (#6509; a pass with 0 is vacuous, T730):
       0  empty_test   VACUOUS
       0  folded_only   VACUOUS
       2  checked
       4  loop_checked
  vacuous passes  2 of 4  (passed with 0 runtime asserts executed)

Tree (--all) adds checked passes, VACUOUS passes, uncounted passes and specs every pass vacuous (t27b's per-file pass_vacuous).

How

  • Counting is a rewrite of the generated Zig text inside bootstrap/src/test_report.rs (instrument): the two lowered assert shapes (if (!(c)) __t27_assert_fail(..) / @panic(..)), the prelude assert_eq, and the std.testing.expect* checks specs write themselves. A tuple literal tells Zig which operands are comptime-known, so constant-folded asserts are not counted; @inComptime() excludes comptime evaluation. The counting runner prints asserts<TAB>n after a passing test.
  • Codegen and compiler.rs are untouched, so FROZEN_HASH and the seals do not move (no reseal needed; CONTRIBUTING 'Build speed' does not apply). No overlap with the gen-* work in t27c gen emits code for specs typecheck refuses (35 misread pairs stay 'green') #6446.
  • If the counting build does not compile, the plain build runs exactly as before and the report says the count is unknown; a spec that does not compile at all is BLOCKED with the plain build's own error text.
  • Output compatibility: the lines parse_test_report / parse_test_verdicts (cli/t27b/src/blockers.rs, contrib/railway/t27b-lab/lab.py), string_eq_zig.rs and the xilinx7 bench workflow read (BLOCKED, tests N, FAIL N, pass <name>) are unchanged; every new line comes after them and starts with a count, -, ? or vacuous. seal --save records are unchanged.

Test

  • Fixture bootstrap/tests/fixtures/vacuity/vacuity.t27: an empty test (0, VACUOUS), a constant-only assert (0, VACUOUS), two asserts (2), a 4-iteration loop (4) -- vacuous passes 2 of 4. Unit test an_empty_test_is_a_vacuous_pass_and_a_checked_test_is_not runs it end to end.
  • Unit tests for the rewrite (string literals, comments, std.testing.allocator, expectError left alone), the refusal on an unrecognised assert_eq, the counting runner contract, and that no new line can be read as pass/FAIL/tests/BLOCKED.

Corpus numbers (Railway t27c lab, zig 0.16.0)

t27c test-report over every spec under specs/ (scratch excluded), run per spec:

count
specs 1318 (472 BLOCKED, 576 measured with at least one test)
tests run 3659 -- 3578 pass, 81 FAIL
checked passes (>= 1 runtime assert executed) 3301
VACUOUS passes (0 runtime asserts executed) 277 (7.7% of passes)
uncounted passes (counting build failed) 0 -- every spec that compiled plain also compiled counted
specs with at least one vacuous pass 130
specs where every pass is vacuous (t27b pass_vacuous analogue) 31

Largest: automation/browser-pod-restart 13 of 18, physics/gamma-conflict 10 of 10, numeric/gfternary 8 of 13, physics/e8_lqg_bridge 8 of 8, physics/hslm_benchmark 7 of 7.

No measurement moved: the same 1318 specs were run with the base binary (master 5bad205) and this branch's binary, and every spec's BLOCKED status, tests/pass/FAIL totals and per-test pass/FAIL verdicts are identical (0 differences). (Units differ from the t27b lab's 281 vacuous of 723: those are files, these are tests.)

Lab

  • Lab run for a6edf9e (/runs/a6edf9e92da7f9e35b531aa364515eba7ecd2ac7.json): green -- frozen-hash matches (3c78f3c7ffb7, compiler.rs untouched), build, suite RATCHET CLEAN, lean, seal-currency, seal-coverage, specs-parse, specs-generate, misread all exit 0.
  • On the lab with zig 0.16.0: cargo test --release -p t27c --bin t27c test_report 14 passed (5 new); --test string_eq_zig 4 passed; --test seal_refuses_failing_tests 4 passed.

Foreign code approval

This PR edits existing Rust in bootstrap/ (bootstrap/src/test_report.rs, bootstrap/src/main.rs). The owner approved it on 2026-10-06 by putting the label owner-approved-foreign on issue #6509, which approves edits to existing Rust in bootstrap/ (t27c) for this issue. The two paths are entered in tools/policy/foreign-exceptions.txt with that citation, and this PR carries the same label. The fixture is .t27.

🤖 Generated with Claude Code

#6509)

`t27c test-report` now builds the generated Zig with every runtime assert
counted -- `assert` (both lowered shapes), the prelude `assert_eq`, and the
`std.testing.expect*` checks specs write themselves -- and prints, per test,
the number of asserts executed, then `vacuous passes N of M`. A pass with 0
is VACUOUS: the trivial backend passes it too (T730, epic #6488). Semantics
mirror t27b `pass_vacuous` (#6115): callees counted, once per execution,
all-constant asserts and comptime evaluation not counted.

The count is a text rewrite of the generated source inside test_report.rs;
codegen and compiler.rs are untouched, so FROZEN_HASH and seals do not move.
If the counting build does not compile, the plain build runs exactly as
before and the report says the count is unknown. The lines the t27b and lab
parsers read (BLOCKED, tests N, FAIL N, pass/FAIL <name>) are unchanged;
the new lines come after them. Tree mode adds checked / VACUOUS / uncounted
pass totals and the number of specs whose every pass is vacuous.

Fixture bootstrap/tests/fixtures/vacuity/vacuity.t27: empty test 0, folded
constant assert 0, two asserts 2, a 4-iteration loop 4 -- vacuous 2 of 4.

Foreign Rust: label owner-approved-foreign on #6509 (owner, 2026-10-06)
approves these edits to existing Rust in bootstrap/ for this issue; the
two paths are entered in tools/policy/foreign-exceptions.txt.

Refs #6488

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

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-06 12:18:18 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 45
PRs with All Checks Green 5
READY 1
FAILING 45
PENDING 0
NO CHECKS YET 0

These columns do not partition: 1 + 45 + 0 + 0 = 46, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=3c78f3c7ffb7 != 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t27c test-report: count executed asserts and flag vacuous passes (sieve C10, T730)

1 participant