Three-Gate Test Census
This page mechanically classifies every #[test] in the repository according to the three gates (clause / incident history / proof) in Part Seven of coding-rules, producing an item-by-item adjudication table that can be rerun. This page and the generator itself are read-only with respect to tests; test retirements are executed in batches (one commit per batch, revertible as a whole with git revert), and the results are recorded in the batch retirement sections and commit messages below.
Generated artifacts:
| Artifact | Purpose |
|---|---|
docs/src/dev/test-gate-census.tsv | Item-by-item adjudication table (2868 lines + header), in the same directory as this page |
scripts/dev/test-gate-census.py | Generator (rerunnable, supports --check and --selftest) |
Criteria
Scan Surface
All #[test] functions in .rs files under src/, tests/, benches/, and tools/:
| Surface | Count |
|---|---|
Root package lib (src/, including each module's tests/ subdirectory) | 2194 |
tests/integration | 470 |
tests/formatter_integration.rs | 52 |
tests/yx_runner.rs / tests/yx_multifile_runner.rs | 2 / 1 |
tools/ | 83 |
benches/ | 9 |
| Total | 2868 (358 files) |
Machine Criteria for the Three Gates
| Gate | Machine Criterion | Meaning of a Hit |
|---|---|---|
| Clause gate (tightened in 0.6-10) | A verifiable entry appears in the first 25 lines of the file header: section-number form §<number> (including RFC-<number> §<number> and SPEC §<number>); files under src/**/tests/ are inspected together with their parent mod.rs | The test maps to a specifically identifiable clause |
| Incident-history gate | The test function body, function doc comment, or file header (such as //! Regression context: issue #226) names a real failure: issue #N / regression / defect / incident | The test pins down an incident that has actually occurred |
| Proof gate | Cannot be machine-adjudicated (“If it were replaced with another correct implementation, would it fail?” requires human judgment). Therefore, anything that fails the first two gates is classified as “pending judgment,” never automatically as “fails all gates”; the sole exception is a body with no assertions whatsoever (including no delegated assert*/check* helper, no match + panic! form, and no #[should_panic]) | Only “pending judgment” or “no assertions” can be assigned |
Rationale for tightening: the 0.6-9 clause gate required only that the file header contain the characters §/RFC/SPEC, causing 2403 tests to be classified as “clause/keep.” The 40-test stratified sample measured in 0.6-10 found that half of the citations did not support the assertions (mis-citation rate 50%, 95% interval 35%–65%)—this measurement was the direct reason for abandoning “keep based on a citation alone.” After tightening, only section-number forms are recognized, and having a citation still does not mean the citation supports the assertion—all clause citations advance only to “pending verification.” (The sampling audit was retired and removed in 0.6-19: as the audit pool shrank with test retirements, 38 of the original 40 samples no longer existed, and --check always reported “38 missing, 38 extra.” The conclusion is retained, but the audit artifacts are no longer maintained.)
Rationale for the file-header radius: this repository's convention is to place text such as “Regression context: issue #N” in the file header and not repeat it in each test comment; looking only at a test's own comment would miss the incident history for the entire file (measured: 7 tests at the test's own radius, 291 at the file-header radius).
Categories That Are Never Retired
The following tests are always classified as “keep” and never enter the retirement-candidate pool:
- Corpus tests under
tests/yaoxiang/**andtests/yaoxiang-multifile/**(behavior-criterion surfaces); tests/integration/**,tests/formatter_integration.rs, andtests/yx_runner*.rs(spec-shaped and crossing the process boundary);- Tests whose names contain
unchanged/anchor/guard/preserv/baseline, which serve as current-state anchors.
Disposition Semantics
| Disposition | Meaning |
|---|---|
| Keep | Only two cases: the incident-history gate is hit, or the proof gate applies (spec-shaped criterion surface / current-state anchor name) |
| Pending verification | A clause is cited (with a section number, or only an entire RFC without a section number), but the citation has not been manually confirmed—it must be verified before it can be kept |
| Retirement candidate | Both gates fail and the assertion surface contains only weak assertions (or no assertions)—a candidate is not a verdict; the proof gate still requires manual review |
| Pending judgment | Both gates fail, but strong assertions are present; the machine reaches no conclusion |
Distribution (Regenerated on 2026-12-02; 4.9.9 narrowing round, 8.7 batch, 4.9.10-L0, init-test rewrite, bare-type-item batch, L3-1b S1, 7e batch, #593 criteria, L3-1 identity switch, L3-2 display criteria and repair round 2)
The figures in this section are generated from the TSV by
scripts/dev/test-gate-census.pyand validated by--check; do not edit them manually.
| Gate | Count |
|---|---|
| Clause (has a verifiable entry) | 1062 |
| Incident history | 631 |
| Proof (spec-shaped criterion surface / current-state anchors) | 585 |
| Pending judgment (fails both gates; proof gate awaits manual review) | 584 |
| Fails all gates (no assertions anywhere in the body) | 6 |
| Total | 2830 |
| Disposition | Count | Compared with 0.6-19 (2026-11-07) |
|---|---|---|
| Keep | 1216 | 737 (+479) |
| Pending verification | 1297 | 1054 (+243) |
| Pending judgment | 282 | 203 (+79) |
| Retirement candidate | 73 | 61 (+12) |
| Total | 2868 | 2055 (+813) |
Structure of “keep”: 1216 = 585 proof-gate tests (526 spec-shaped criterion surfaces + 59 current-state anchors) + 631 incident-history-gate tests. At the file level, the clause gate covers 126 of the 358 test files.
Regeneration reconciliation (after the 4.9.11 type-representation consolidation): relative to the checked-in table before 4.9.11 (2811), 19 tests were added (P0-a/S2/S3 representation-layer guards, four genuine hkt criteria, and P3 criteria such as ghost arguments, conflict sets, and ignored fields), and none were removed; renamed tests are recalculated by name. There are 2830 rows, each recorded by key in the TSV.
Latest full regeneration (after the 4.9.11 type-representation consolidation): 2830 rows, matching the current tree key by key (--check exits with code 0).
Two Criteria Changes at the Time of the 0.6-19 Tightening
- Structure of “keep”: 737 = 424 proof-gate tests (390 spec-shaped criterion surfaces + 34 current-state anchors) + 313 incident-history-gate tests. Of the 2897 tests in the original set, the 2121 that were “kept based on a citation alone” are now pending verification (after the sampling audit was retired in 0.6-19, the 9 that had been classified as “audit-confirmed genuine support” were also moved to pending verification—clause citations no longer have an “audit-confirmed” tier).
- Incident-history gate 47 → 313: this is not an increase in incident history, but label reclassification—in 0.6-9, a test that hit both the clause and incident-history gates was recorded as a clause. After tightening, a clause no longer automatically means “keep,” so the incident-history gate must catch these tests, and its count is folded into incident history. The total number kept is therefore unaffected (these tests were also classified as “keep” in 0.6-9).
File-level criteria at the time: of 285 test files, 136 had a verifiable section number in the file header (the old 0.6-9 criterion identified 221).
Reconciliation Between the 0.6-19 Snapshot and the 0.6-2 Survey
The 0.6-2 survey figures are the first comparison baseline. The reasons for each difference are listed below:
| Item | 0.6-2 Survey | Current | Reason for Difference |
|---|---|---|---|
Repository-wide #[test] | 3443 | 2055 | 2 tests were added after 0.6-2 (the check-criteria regression tests for E3005 and E3022), followed by the removal of 21 no-assertion tests in the first batch, 11 weak-assertion tests in the second batch, 2 in the third batch, 1 in the fourth batch, and 1353 in the fifth batch; net −388 |
| Number of test files | 296 | 285 | 11 entire files were retired in the fifth batch |
| Clause gate | 227 files (77%) | 136 files after tightening; 808 tests by item | The criterion was tightened from “the characters appear” to “there is a section number §<number>,” nearly halving the file count; the fifth batch retired 902 tests, and another 9 moved from “keep” to pending verification after the sampling audit was retired in 0.6-19 |
| Incident-history signals | 442 tests / 148 files | 313 within the gate; three radii: test itself 7 / file header 291 (38 files) / whole file 1218 (79 files) | The 148 files in the 0.6-2 survey cover more than the current whole-file radius of 79 files because its vocabulary and scope were broader; the current run strictly follows the four card-level signals |
| Strong characterization signal | 1176 (34%) / strong 631 (18%) | Not measured | Characterization is not one of the three gates; incorporating it into the retirement conclusion would exceed the gate's authority |
| Weak assertions | 473 (14%) | See the TSV “assertion summary” column | The counting units differ: 0.6-2 counted patterns that only assert is_ok/is_some; this run uses lexical counts and distinguishes strong, weak, and delegated assertions |
0.6-19 Conclusion Summary (Historical)
- The clause gate had previously been substantially inflated: under the old criterion, 2403 tests were classified as “clause/keep,” but the sample measured a 50% mis-citation rate (95% interval 35%–65%)—“citing a rule” and “having a citation that supports the assertion” are different things, and the old criterion treated the former as the latter. (The sampling audit was retired and removed in 0.6-19; its conclusion is retained. See “Retirement of the Sampling Audit” below for the reason for removal.)
- After tightening, approximately 1202 tests genuinely have clause support (range 846–1557); the rest either require a pending-verification ticket or should be adjudicated under the incident-history or proof gate.
- The retirement surface is unrelated to clause mis-citations: the 136 candidates have no clauses (no assertions/weak assertions); the first batch retired 21 tests, the second batch retired 11, the generator correction added 1, the third batch removed 2, the 0.6-15 criteria correction removed 3, the redundancy scan removed 1, the fourth batch removed 1, and the fifth batch removed 1353 (using the mechanical rule “keep only the strongest test for the same symbol and result category”), reducing the candidates to 61. The fifth-batch retirement count by gate was: clause 902 · pending judgment 428 · proof 23 · incident history 0 · fails all gates 0—not a single incident-history-gate test or zero-assertion test was removed.
- The incident-history gate is the largest legitimate source of “keep” (313 tests): it demonstrates that “pinning down a real incident” is more reliable than “copying a sentence from an RFC.”
First Retirement Batch (Executed on 2026-11-06)
First batch: of the 26 “no-assertion” tests under src/frontend/core/types/eval/tests/, 21 were retired and 5 were kept (a single directory cluster; criterion = all three gates in Part Seven of coding-rules fail: no clause gate, no incident-history gate, and no assertions anywhere in the body). The item-by-item adjudication and same-tier coverage were provided by the 0.6-11a adjudication table (21 deleted / 5 kept); this page does not repeat the reasons and records only the execution result.
- 21 retired (
normalizer.rs: 2 +reducer.rs: 19):test_normalizer_with_config,test_normalizer_evaluator,test_type_computer_register_alias,test_type_computer_compute_primitive,test_type_computer_set_context,test_type_computer_compute_type_var,test_type_computer_compute_list,test_type_computer_compute_tuple,test_type_computer_compute_fn,test_reducer_reduce_with_limit,test_unifier_different_types,test_unifier_substitution_after_unify,test_unifier_unify_option_same,test_unifier_unify_result_same,test_unifier_unify_dict_same,test_unifier_unify_set_same,test_unifier_unify_range_same,test_unifier_unify_arc_same,test_unifier_unify_weak_same,test_unifier_unify_enum_same,test_unifier_unify_struct_same. - 5 kept (the adjudication table could not identify replacement coverage, so they were kept under the hard requirement):
test_normalizer_context,test_type_computer_new_and_with_config,test_type_computer_compute_type_ref,test_reducer_reduce_type_ref_with_alias_chain,test_reducer_reduce_type_ref_self_referential. - Rollback: the entire batch is one commit (this page and
test-gate-census.tsvare in the same commit), sogit revert <sha>rolls it back as a whole.
Second Retirement Batch (Executed on 2026-11-06)
Second batch: of the 18 “weak-assertion” tests in src/frontend/core/parser/pratt/tests/nud.rs, 11 were retired and 7 were kept (a single directory cluster = the pratt prefix-parsing module; criterion = all three gates in Part Seven of coding-rules fail: no clause gate, no incident-history gate, and the body contains only weak assertions such as is_some() / is_none()—neither binding power nor the parse result is pinned down).
The difference from the first batch must be made clear: these tests do contain assertions and are not empty tests. They are retired because all three gates fail and they add zero criterion value, not because they have no assertions—every test selected for deletion identifies a unit-level replacement-coverage test in the same module.
- 11 retired:
test_prefix_info_int_literal,test_prefix_info_float_literal,test_prefix_info_string_literal,test_prefix_info_bool_literal,test_prefix_info_lparen,test_prefix_info_lbracket,test_prefix_info_if,test_prefix_info_while,test_prefix_info_for,test_prefix_info_ref,test_prefix_info_return. For every test, the replacement coverage follows the sameparse_expression → parse_prefix → prefix_infopath and makes stronger assertions (pinning down the AST shape rather than merely checkingis_some): the same file'stest_parse_int_literal/test_parse_float_literal/test_parse_string_literal/test_parse_bool_true/test_parse_if_expr/test_parse_while_expr/test_parse_for_expr/test_parse_return_expr, as well assrc/frontend/core/parser/tests/expressions.rs'stest_grouped_expr/test_tuple/test_list_literal/test_list_empty/test_ref_expr. - 7 kept:
test_prefix_info_match,test_prefix_info_unsafe,test_prefix_info_spawn,test_prefix_info_at,test_prefix_info_break_removed,test_prefix_info_continue_removed,test_prefix_info_eof—see the commit message (task 0.6, second test-retirement batch) for the item-by-item reasons. The reasons fall into two categories: the proof gate applies (the first three, together withtest_prefix_info_at/test_prefix_info_eof, are the only unit-level inspection points for the corresponding facts, and no second unit test in the repository observes them), and the incident-history gate applies (break_removed/continue_removedexplicitly name #314). - Rollback: the entire batch is one commit (this page and
test-gate-census.tsvare in the same commit), sogit revert <sha>rolls it back as a whole.
Generator Correction (0.6-13)
body_span truncated function bodies when braces appeared inside literals — fixed.
The old implementation obtained a function body by balancing braces and did not distinguish braces in actual code from those in string/character literals or comments. Forms such as tokenize("{") are common in Rust source, so balancing was thrown off and the function body was truncated: the body of test_prefix_info_lbrace was once truncated at the end of the file, causing the “assertion summary” to capture the remainder of the file (matchesx11 assertx24 …) and the test to be bucketed as “pending judgment” rather than “retirement candidate”—an incorrect bucket.
Fix: add mask_noncode to replace the contents of string literals, character literals, line comments, block comments (which may be nested), and raw strings (r"…" / r#"…"# / br"…" / cr#"…"#) with spaces (newlines are preserved, so line numbers and line counts do not change), then balance the braces. The mask is used only to locate function-body boundaries; assertion counting and the incident-history gate still read the original source, and the criterion itself has not been loosened. --selftest now includes four cases (paired/unpaired braces in ordinary strings, braces in raw strings and block comments, and braces in character literals), each followed by a sentinel test—the old implementation obtained the wrong boundary in all four cases, while the new implementation obtains the correct boundary in all four.
Tests Affected by the Same Bug: 11
Counting method: compare the function-body boundaries before and after the fix test by test and file by file (old implementation balancing literal braces vs. new implementation balancing after masking); tests with different boundaries are affected. Of the 3413 repository-wide tests, the old implementation obtained the wrong boundary for 11:
| File | Count |
|---|---|
src/frontend/core/lexer/tests/fstring.rs | 3 |
src/formatter/handlers/tests/expr.rs | 2 |
src/driver/tests/manifest_error.rs | 1 |
src/frontend/core/lexer/tests/literals.rs | 1 |
src/frontend/core/parser/pratt/tests/nud.rs | 1 |
src/frontend/core/parser/statements/tests/imports.rs | 1 |
src/frontend/core/parser/statements/tests/types.rs | 1 |
src/frontend/core/parser/tests/expressions.rs | 1 |
Bucket Differences Before and After the Fix: 2
Of the other 9, 8 affected only the “assertion summary” column (the bucket did not change), and 1 did not even change the summary (test_fstring_close_brace_escape_preserved_raw: the old implementation omitted the closing } line, which contains no assertion keyword). The 8 summary changes are listed individually in the commit message.
| Test Name | File | Old Bucket | New Bucket | Basis |
|---|---|---|---|---|
test_prefix_info_lbrace | src/frontend/core/parser/pratt/tests/nud.rs | Pending judgment / Pending judgment | Pending judgment / Retirement candidate | The real function body contains only the weak assertion assert!(state.prefix_info().is_some()); the file header and function body contain no section-number form §, and no issue/regression/defect/incident ⇒ both the clause and incident-history gates fail; the body contains only a weak assertion such as is_some() ⇒ retirement candidate (a candidate is not a verdict; the proof gate still requires manual review) |
test_fstring_escape_brace | src/frontend/core/lexer/tests/literals.rs | Incident history / Keep | Clause / Pending verification | The old implementation truncated the function body to the end of the file, swallowing text containing “regression/defect/incident” and incorrectly classifying it under the incident-history gate; the real function body contains no such terms ⇒ the incident-history gate no longer applies; the file header has verifiable entries (§1.6.1 / §1.6.2 / §1.6.3 / §1.6.4 / RFC-012) ⇒ the clause gate is hit but has not been confirmed by the sampling audit ⇒ pending verification |
The distribution changed accordingly: clause 1713 → 1714 · incident history 314 → 313 · keep 776 → 775 · pending verification 2121 → 2122 · pending judgment 412 → 411 · retirement candidate 104 → 105. The repository-wide #[test] count is unchanged (3413)—this round changed only the implementation of the criterion, not any test.
Third Retirement Batch (Executed on 2026-11-07)
Third batch: of the 5 retirement candidates under src/middle/passes/codegen/tests/, 2 were retired and 3 were kept after item-by-item adjudication. (a single directory cluster = the middle::passes::codegen module under test; criterion = all three gates in Part Seven of coding-rules fail.)
This batch follows the keep criterion established by the previous batch: a unit-level observation point can only be replaced by another unit test; corpus and integration tests are at the process boundary and cannot replace a unit observation point.
- 2 retired:
test_execute_module_with_global_slot(global_slot.rs)—the function body is word-for-word identical totest_global_slot_store_then_load_roundtripin the same file (after removing comments, only the function name differs): both arerun_fixture()+assert_slot_is_42(&interp). Its doc comment claims to verify that theexecute_moduleentry path returns a non-Void value, but the body never observes the return value fromexecute_module(run_fixturediscards it with.expect(...))—the claimed intent is not implemented, and the function body is a pure duplicate ⇒ zero criterion value. Replacement coverage =test_global_slot_store_then_load_roundtrip.test_scope_manager_basic(flow.rs)—test_scope_nestingin the same file provides strict coverage: positive lookup (lookup("a").is_some()), negative lookup (lookup("b").is_none()), thescope_levelcount, and the shape of the insertedSymbol(symbol("a", Int(64), Local(0), false, 0), identical to the inlineSymbolin this test). “A name that was never inserted cannot be found” and “it cannot be found after being popped” follow the same path inSymbolScopeManager::lookup(walkingscope.get(name)layer by layer, withNonereturned when not found) ⇒ this test adds zero value. Replacement coverage =test_scope_nesting.
- 3 kept:
test_global_slot_store_then_load_roundtrip—the only observation point for the path that does not go directly from serialization to execution (the serialized variant is a different path), andassert_slot_is_42asserts a concrete value.test_global_slot_survives_serialization_roundtrip—the only observation point for the serialization roundtrip (write_to→read_from→ execution).test_register_overflow(operand.rs)—the only unit observation point for theid > 255rejection branch ofOperandResolver::to_reg(the bytecode layer has its own independent overflow checks and does not cover this function; no second test in the repository makesto_reggo out of range).is_err()is a discriminating assertion (removing the guard would make it fail), not merely a check that it did not panic.
- Rollback: the entire batch is one commit (this page and
test-gate-census.tsvare in the same commit), sogit revert <sha>rolls it back as a whole.
One Census Blind Spot Found in This Batch (Fixed in 0.6-15; see “Generator Criteria Correction” below)
The census's “delegated assertion” recognition pattern \b(assert|check)[A-Za-z_]*\s*\( could not match helpers with digits in their names: because [A-Za-z_]* does not include digits, a call such as assert_slot_is_42(&interp) is not recognized as an assertion—and 2 of the 5 candidates in this batch were consequently misbucketed as “no assertions anywhere in the body.”
After reviewing all 15 repository-wide “fails all gates” tests individually (widening helper names to allow digits and additionally recognizing the match + panic! form), 4 actually contained assertions—3 used the numeric helpers above, and 1 was test_weak_from_arc in src/backends/interpreter/tests/weak.rs (the match + panic! form; test-specification rule 6.1 requires assert!(matches!(...)), but it does in fact assert). The other 11 genuinely have no assertions whatsoever.
Directly removing these 4 according to the machine's “fails all gates” result would have deleted tests containing criteria—this batch avoided that by adjudicating each item manually; the generator fix is described in “Generator Criteria Correction (0.6-15)” below.
Generator Criteria Correction (0.6-15)
Two criteria blind spots were fixed: helper names containing digits, and the match + panic! form. This round deletes no tests (the repository-wide #[test] count remains 3411) and changes only how the generator recognizes whether a test body contains assertions.
What Was Fixed
- Digits were allowed in the name portion of delegated assertions:
\b(assert|check)[A-Za-z_]*\s*\(→\b(assert|check)[A-Za-z0-9_]*\s*\(. The old pattern could not match helper names such asassert_slot_is_42(&interp), so tests containing such calls were treated as having “no assertions anywhere in the body.” - Added the
match+panic!form:match <expr> { … panic!(…) … }—the assertion is written in an arm, so the macroassert!is not lexically visible (test-specification rule 6.1 requiresassert!(matches!(...)), but existing code contains this form). Detection method: after thematchkeyword, scan the expression up to the first{; determine the block boundary by balancing braces; only apanic!(inside the block counts. The determination is performed on the masked lines— braces in strings and comments do not participate in balancing, and apanic!in a comment is not treated as an assertion.
Bucket Differences: 3 (the gate and disposition changed)
| Test Name | File | Old Bucket | New Bucket | Basis |
|---|---|---|---|---|
test_weak_from_arc | src/backends/interpreter/tests/weak.rs | Fails all gates / Retirement candidate | Pending judgment / Pending judgment | The body is match weak { RuntimeValue::Weak(_) => {} _ => panic!("Expected Weak variant") }—it asserts a variant, but the form was not previously recognized; it is now recognized as an assertion, and the machine does not adjudicate its coverage strength |
test_global_slot_store_then_load_roundtrip | src/middle/passes/codegen/tests/global_slot.rs | Fails all gates / Retirement candidate | Pending judgment / Pending judgment | The assertion is delegated to assert_slot_is_42(&interp)—the helper name contains digits and did not match the old pattern; it is now recognized as an assertion |
test_global_slot_survives_serialization_roundtrip | src/middle/passes/codegen/tests/global_slot.rs | Fails all gates / Retirement candidate | Pending judgment / Pending judgment | Same as above (the serialization-roundtrip test) |
Another 77 entries changed only the “assertion summary” column (the gate and disposition did not change): most gained match_panicxN in the summary (the body contains a match + panic! form), and 4 gained helperxN (3 in src/driver/tests/manifest_error.rs and 1 in src/package/tests/cache.rs—helper names containing digits).
The relaxation changes only the “fails all gates” tier: this tier is the machine's high-confidence verdict (not a single assertion anywhere in the body), and its criterion is a hard requirement; a “retirement candidate” is merely a pool awaiting manual review, so the size of that pool is not a verdict. The weak-assertion pool and all other buckets therefore retain their original criteria. Results: gate “fails all gates” 14 → 11 · pending judgment 923 → 926; disposition retirement candidate 103 → 100 · pending judgment 411 → 414.
Item-by-Item Review of the 11 Remaining “Fails All Gates” Tests
After reading the source of all 11 repository-wide “fails all gates” tests individually, all 11 genuinely contain no assertions whatsoever (including no assert* / check* helpers, no match + panic! form, and no #[should_panic]):
| Test Name | File | What the Body Actually Does | Review Conclusion |
|---|---|---|---|
test_run_bytecode_file_roundtrip | src/backends/interpreter/tests/bytecode_load.rs | Five .expect(...) calls, ensuring only that it does not crash | Truly no assertions (proves only that it does not crash) |
test_normalizer_context | src/frontend/core/types/eval/tests/normalizer.rs | Obtains the context() handle and discards it | Truly no assertions |
test_type_computer_new_and_with_config | src/frontend/core/types/eval/tests/reducer.rs | Constructs two TypeComputer instances, obtains their contexts, and discards them | Truly no assertions |
test_type_computer_compute_type_ref | src/frontend/core/types/eval/tests/reducer.rs | Computes compute(TypeRef) and discards the result | Truly no assertions |
test_reducer_reduce_type_ref_with_alias_chain | src/frontend/core/types/eval/tests/reducer.rs | Performs a chained alias reduce and discards the result | Truly no assertions |
test_reducer_reduce_type_ref_self_referential | src/frontend/core/types/eval/tests/reducer.rs | Performs a self-referential alias reduce and discards the result | Truly no assertions |
test_document_symbol_items_invalid_code | src/lsp/handlers/tests/completion.rs | Calls document_symbol_items with invalid content and discards the result | Truly no assertions (proves only that it does not panic) |
test_handle_formatting | src/lsp/handlers/tests/formatting.rs | Calls handle_formatting and discards the edits | Truly no assertions (proves only that it does not panic) |
test_handle_range_formatting | src/lsp/handlers/tests/formatting.rs | Calls handle_range_formatting and discards the edits | Truly no assertions (proves only that it does not panic) |
test_cli_modules_available_on_native | src/tests/feature_gate.rs | Constructs lsp / repl instances and discards them (inside the wasm32 cfg gate) | Truly no assertions |
test_z3_modules_available_on_native | src/tests/feature_gate.rs | Constructs a Z3Backend; let _: Z3_context = std::ptr::null_mut(); is merely a type annotation | Truly no assertions |
Of these, 5 (test_normalizer_context and the 4 in reducer.rs) were classified as “keep” in the 0.6-11a adjudication table because no replacement coverage could be identified; this review reaches the same conclusion.
Reverse Sample: Did the Relaxation Go Too Far?
Five entries were sampled with a fixed seed (20261107) from the 88 entries “newly recognized as assertions” and their source was read to confirm that they really assert:
| Sampled Entry | File | Assertions in the Source |
|---|---|---|
test_substitute_through_assoc_type | src/frontend/core/types/tests/substitute.rs | Two assert_eq! calls in the matching arm of a match, with panic!("Expected AssocType") if it does not match |
test_unlisted_file_rejected | src/package/tests/yxpkg.rs | assert!(msg.contains("src/evil.yx")) in the matching arm, and panic!("expected InvalidPackage, got …") if it does not match |
test_assignment_constraint_dynamic | src/frontend/core/sema/inference/tests/assignment.rs | assert_eq! in the matching arm compares the constraint type, and panic!("不是 Dynamic 变体…") if it does not match |
test_delta_add_token | src/lsp/handlers/tests/semantic_tokens.rs | assert!(!delta.edits.is_empty()) in the matching arm, and panic!("Expected TokensDelta variant") if it does not match |
test_e2e_phase4_into_diagnostic_predicate_violation_e4018 | src/frontend/core/sema/tests/rfc027_phase4_e2e.rs | Three assert_eq! / assert! calls in the matching arm verify the error code and message, and panic!("不是 Disproved…") if it does not match |
All 5 assert concrete values or concrete variants (replacing the implementation with another correct path would make them fail)—the relaxation did not go too far. Reverse controls were also added to --selftest: a match without panic!, and a panic! that appears only in a comment, must neither be recognized as an assertion.
The Criterion Has Teeth (Developmental Proof)
After reverting the generator to the old implementation (HELPER_RE without digits + the match + panic! recognition disabled), all newly added --selftest cases fail red with exit code 1; the new implementation passes them all.
Rollback
The generator and census table are in the same commit, so git revert <sha> restores the entire previous state.
Fourth Retirement Batch (Executed on 2026-11-07)
Fourth batch: of the 10 “retirement candidates” in the directory cluster src/backends/interpreter/ (the interpreter backend's test directories), 1 was retired and 9 were kept (a single directory cluster, with all three files read before adjudication: tests/bytecode_load.rs: 4 · tests/weak.rs: 2 · executor/tests/debug.rs: 4). Criterion = the three gates in Part Seven of coding-rules; keep criterion = “a unit-level observation point can only be replaced by another unit test; corpus and integration tests are at the process boundary”; deletion must identify a specific replacement-coverage test name, and a test is kept if none can be identified or if it cannot be understood.
- 1 retired:
test_capture_stack_includes_current_frame_during_step(src/backends/interpreter/executor/tests/debug.rs)—test_capture_stack_during_executionin the same file follows the same path (make_module+load_module_for_stepping, taking one step and then obtainingcapture_stack) and makes strictly stronger assertions: it asserts that the stack is nonempty and thatstack[0].function_name == "main"(pinning down the top position), whereas the listed test only assertsstack.iter().any(|f| f.function_name == "main")(any position is sufficient) —the former being true necessarily implies the latter ⇒ zero criterion value. - 9 kept:
test_run_bytecode_file_roundtrip·test_run_bytecode_file_invalid_magic·test_run_bytecode_file_version_mismatch·test_run_file_with_yxbc_magic_uses_bytecode_load_path·test_weak_upgrade_some·test_weak_upgrade_none·test_step_on_empty_stack_returns_ok·test_step_out_returns_to_caller·test_run_to_completion—after reading each source, they are each the only unit observation point for some property (the two distinct branches for load magic/version, the YXBC routing layer, the Some/None sides of Weak, stepping with no frame, the stack pop in step_out, and an empty stack after running to completion); no unit test capable of replacing them could be identified ⇒ they were kept under the hard requirement. See the commit message for the item-by-item basis (the adjudication table is not included in this page). - Figures: repository-wide
#[test]3409 → 3408; 1 deletion =git diffcounts one-#[test]line and zero+#[test]lines; the dominating testtest_capture_stack_during_executionpasses when run alone. Census: retirement candidate 99 → 98 · pending judgment 925 → 924 · clause 1713 · incident history 313 · proof 447 · fails all gates 11 · pending verification 2121 · keep 775. - Rollback: the entire batch is one commit (this page and
test-gate-census.tsvare in the same commit), sogit revert <sha>rolls it back as a whole.
Fifth Retirement Batch (Executed on 2026-11-07)
Fifth batch: 1353 unit tests were retired in bulk using the mechanical rule “keep only the strongest test for the same symbol and result category” (only unit tests under src/**/tests/** were changed; not a single test on the E2E surfaces tests/yaoxiang/**, tests/integration/**, tests/formatter_integration.rs, tests/yx_runner*.rs, or tests/project-corpus/** was touched).
- Rule (executed mechanically, without item-by-item argument):
- Tested symbol = a repository-internal symbol called in the test body (including a helper function passed through one level in the same file); when multiple symbols are touched, classify by the primary symbol (the first repository-internal call). Symbols are qualified by their repository-internal paths and are not merged across modules by bare name.
- Result category = a concrete value / a specific error code (E code) / a specific variant match / checking only ok / checking only err / checking only should_panic.
- Strength =
assert_eq!/assert_ne!>assert!/matches!(or match +panic!) >is_ok/is_some/is_err>should_panic> none; when equal in strength, keep the first one in the file. - If a test asserts multiple categories (making the primary category indeterminate), keep it; do not guess.
- Three exceptions (not one was removed): ① the name or comment names
issue #/ regression / defect / incident (the incident-history gate); ② a symbol has only one test (removing it would leave the symbol without a unit observation point); ③ a#[should_panic]test is the symbol's only should_panic case. Zero of the 313 incident-history-gate tests and 11 “fails all gates” tests were retired. - Figures: repository-wide
#[test]3408 → 2055; 1353 deletions =git diffcounts 1353-#[test]lines and zero+#[test]lines. Census (by gate, current values after the sampling audit was retired in 0.6-19): clause 808 · incident history 313 · proof 424 · pending judgment 499 · fails all gates 11. Census (by disposition, current values): keep 737 · pending verification 1054 · pending judgment 203 · retirement candidate 61. The retirement count in this batch by gate was: clause 902 · pending judgment 428 · proof 23 (0.6-19 reclassified 9 entries that had been “audit-confirmed as genuinely supported” as pending verification, so the current values by gate/disposition differ from those at the time the fifth batch was closed). - Cleanup accompanying deletions: helper functions used only by deleted tests, imports that consequently became invalid, and now-unused struct fields were removed (
cargo clippy --all --all-features --all-targets -- -D warningsproduced 0 warnings). - Two out-of-bounds deletions requiring a record: 29 tests originally classified as “keep” were nevertheless deleted by this batch's rule—23 current-state anchors (names containing unchanged/anchor/guard/preserve/baseline, many of which were domain-word false positives such as
test_while_guard_scope_balanced) and 6 clauses audit-confirmed as genuinely supported. This batch followed the closed list of three card-level exceptions and did not additionally protect these two categories; to restore them, fill them back in using this page's keep/delete comparison table. - Failure and retirement of the sampling audit: the 40-test sample was drawn from the test pool with a fixed seed, and after the fifth batch's retirements, 38 of the original samples no longer existed; the audit's
--checktherefore always reported “38 missing, 38 extra.” The sampling audit was retired and removed in 0.6-19 (the script, data file, and the generator's dependency on it were all removed); see “Retirement of the Sampling Audit” below. - Rollback: the entire batch is one commit (this page and
test-gate-census.tsvare in the same commit), sogit revert <sha>rolls it back as a whole.
Sixth Retirement Batch (Executed on 2026-11-26)
Sixth batch: the mechanism rollback from the 4.9.9 narrowing round—28 tests removed along with the mechanism were retired, while another 4 prohibition criteria never entered the repository. This batch does not use the three gates to decide whether a test “should be kept.” Instead, the mechanism under test was rolled back as a whole: the criteria written in the first six rounds before 4.9.9 for downstream ambiguity mechanisms (candidate-provider priority / candidate-signature comparison / owner compatibility inference / IR-side named-argument fallback / the E5006 import-name-resolution prohibition) were retired along with the mechanism—the mechanism no longer exists, so the tests have no subject. These deletions are recorded as a “batch” under coding-rules 7.3 and do not enter the retirement-candidate pool.
- What was deleted:
src/driver/tests/named_args_cross_unit_method.rs: 30 → 2 (28 deleted: 27 downstream mechanism criteria from the first six rounds + 1 alias-import named-argument criterion). The retained 2 pin down the minimum fix for bare-name imports.src/driver/tests/type_import_ambiguity.rs: the 4 E5006 prohibition criteria were retired as an entire file—the file existed only in an intermediate 4.9.9 commit; neither the parent commit nor that release's checked-in table included it; after the prohibition was withdrawn, it had no subject, so this batch does not reduce the checked-in table by any lines.- The
tests/yaoxiang-multifile/named-args-cross-unit-method-alias-overload/project fixture was retired (the candidate-injection surface for alias imports was rolled back, so the fixture's behavior no longer holds); the same-named corpus differential-baseline entry was deleted in the same batch. The baseline counts are stated separately: relative to the direct parent commitac810e97, 405 → 404 lines (the intermediate state included this fixture); relative to the pre-4.9.9 baseline08ccacc5, 403 → 404 lines (+1 base fixturenamed-args-cross-unit-method; the retiredalias-overloadnever entered the final history).
- Which gate applies: the retained 2 = the incident-history gate (they pin down a real defect recorded in 4.9.9: cross-unit named arguments could not obtain the declaration-phase parameter name, leaving
E1014 availableempty); most of the 28 retired tests from the first six rounds originally fell under the incident-history gate, but the reason for this deletion is not the three gates (it is not a judgment that they lack value); the mechanism under test was rolled back. - Replacement coverage: cross-unit named arguments for bare-name imports = the retained 2 driver-level criteria + the project fixture
named-args-cross-unit-method; the ambiguity surface no longer has rejection logic (the requirement was rolled back), so there is no replacement criterion; the 4.9.8 dispatch-attribution criteria (10 driver tests + 5 integration tests) are retained unchanged. - Restoration:
test_method_param_info_empty_name_table_returns_noneinsrc/middle/lower/tests/query.rswas restored in the same batch (the empty-name-table guard formethod_param_infois retained; this form is unreachable under the public syntax and is a defensive guard whose unit test prevents accidental deletion). - Figures (after this batch was regenerated): repository-wide
#[test]2680 / 334 files; the previous checked-in table's 2688 → the current tree's 2680 (−8); the current tree contains 1 entry absent from the old table, the old table contains 9 entries absent from the current tree, and 0 same-key rows changed content. - Rollback: the entire batch is one commit (this page,
test-gate-census.tsv, and the code are in the same commit), sogit revert <sha>rolls it back as a whole.
Retirement of the Sampling Audit (0.6-19)
Criterion: the sampling audit (0.6-10) measured the “actual support rate of clause citations,” but the keep rules after 0.6-18 no longer examine citations (they changed to “keep only the strongest test for the same symbol and result category,” reducing the test pool from 3408 to 2055). Of the original 40 samples, 38 no longer exist, and the audit's --check always reports “38 missing, 38 extra”—keeping it would only cause continuous alarms. It was therefore retired and removed.
What was removed: the sampling audit script under scripts/dev/ (the one that reproduced the 40 samples with a fixed seed) and its JSON data file (40 item-by-item adjudications and bases).
The generator's dependency was removed synchronously: the generator previously read that JSON and classified “audit-confirmed as genuinely supported” as “clause gate + keep”; that branch has been removed—clause citations no longer have an “audit-confirmed” tier and uniformly fall into “clause / pending verification.”
Distribution changes (all 2055 repository-wide #[test] functions remain unchanged, and the TSV has been regenerated): keep 746 → 737 (−9: the 9 previously audit-confirmed as genuinely supported move back to pending verification); pending verification 1045 → 1054; by gate: clause 811 → 808, pending judgment 496 → 499 (the others are unchanged: incident history 313 · proof 424 · fails all gates 11).
Rollback: the entire batch is one commit (this page, test-gate-census.tsv, and the generator are in the same commit), so git revert <sha> rolls it back as a whole.
Rerunning and Self-Checking
python scripts/dev/test-gate-census.py # Recompute and overwrite the TSV (byte-for-byte identical output across two runs)
python scripts/dev/test-gate-census.py --check # CI/pre-commit: check whether the TSV matches the current tree
python scripts/dev/test-gate-census.py --selftest # Minimal positive/negative self-test (does not scan the repository)The generator performs lexical adjudication only, and states its boundaries honestly:
- Delegated assertions are recognized by name only (
assert*/check*helper functions). If a test's assertion is hidden in a helper whose name does not begin with either prefix, it will be misclassified as having “no assertions”—the 26 tests in the first batch (21 retired / 5 kept) and the 18 tests in the second batch (11 retired / 7 kept) were each manually reviewed at the function-body level. - Function-body boundaries (fixed in 0.6-13): the generator obtains a function body by balancing braces, and braces in strings/character literals and comments throw the balance off, truncating the body—
test_prefix_info_lbrace(whose body containstokenize("{")) was once truncated to the end of the file, causing the “assertion summary” to capture the remainder of the file and the test to be bucketed as “pending judgment” rather than “retirement candidate.” It now masks non-code regions (strings / character literals / line comments / block comments / raw strings) before balancing; see the “Generator Correction” section below. - Delegated-assertion recognition (fixed in 0.6-15): the old pattern
\b(assert|check)[A-Za-z_]*\s*\(has a[A-Za-z_]*that does not include digits, so a call such asassert_slot_is_42(&interp)is not recognized as an assertion, and a test containing such a call is misclassified as having “no assertions anywhere in the body.” At the time, 4 of the 15 repository-wide “fails all gates” entries actually contained assertions (3 numeric helpers + 1match+panic!form). The name portion has now been widened to[A-Za-z0-9_]*, and recognition of thematch+panic!form has been added; see the “Generator Criteria Correction” section below. - The proof gate is not adjudicated: any test that fails both other gates falls only into “pending judgment” or “retirement candidate”; the generator does not declare that it “should be deleted.”
- No cross-file deduplication: completely duplicate tests are not identified in this table (0.6-2 measured only 1%, which does not constitute a retirement surface).
- Clause citations are always pending verification: a verifiable section number in the file header only shows that the test “maps to a specifically identifiable clause”; it does not mean that the citation supports the assertion. The machine does not adjudicate whether it does, so even a clause hit advances only to “pending verification” and must be manually verified before it can be kept.
