tests: inventory and verify source rejection twins

This commit is contained in:
dev committed 2026-10-08 18:01:58 +03:00
1 parent 09fbf8a5bc
commit e4aacef48c
28 files changed
+1092 -8

No files matched your search

+6
View File
@@ -380,3 +380,9 @@ An ordinary function declaring `effects [bogus.effect]` reaches AIR and reports
P6-7 rejection-twin work reproduced accepted source that returns the cancelled handle from an inner block, ends its lent borrow at that block's exit, then joins the renamed handle. Ordinary AIR `br` has the same defect: loans and creating scopes remain attached to the moved SSA value. Review also reproduced lost guard parents and shield order. These violate existing spec 04 §33–§34, §37.3 and §40; they are verifier bugs, not missing transfer semantics.
**Resolved (DD-024):** resource relations follow simultaneous edge renaming, with a finite worklist covering later predecessors and backedges. Loans retain the creating spawn; tasks retain scope associations even when only the scope is passed. Guard parents and ordered shield relations survive handoff. Task/guard facts merge by union; shield stacks retain their existing exact join requirement. Existing codes E4302/E4101/E4301/E2102/E4305/E3002 apply. Valid correlated scope/task permutations and joins remain accepted. Runtime, source lowering and AIR format-0 meanings are unchanged; previously accepted violations now reject.
## Q-053 — P6-7's literal same-code exit criterion and the source boundary
P6-7 requires every conformance rejection to have a source twin with the same code. Spec 15 §10 instead requires fully source-decided type errors to use E7xxx, and malformed generated AIR/SSA/CFG to report E7900 as compiler defects. Spec 15 §1/§9 also makes SSA, CFG, local placement, lexical borrow ends and feature headers generated mechanics. Examples: AIR lossy widening is E1002 but source is E7005; missing borrow-return `from` is E2102 in AIR but E7006 in source (§19); explicit branch arity, unsupported AIR versions and duplicate feature headers have no source operation. Uninitialized locals and deliberately invalid proven-index fact forms likewise have no implemented source spelling.
The exhaustive inventory in `tools/source_reject_twins.py` keeps these rows visible: same-code pairs, audited source-error analogues, AIR-only cases and pending audits. Only verified same-code pairs satisfy the current criterion; the other categories are not exclusions or completion evidence. The owner needs to decide how the final phase review should account for mandatory E7xxx translation and generated-only AIR defects, without weakening existing AIR tests, exposing raw mechanics in source, or changing diagnostics solely to satisfy coverage. Until then the original criterion and P6-7's doing status remain unchanged; unreviewed and authorable twins can still be completed.
+8
View File
@@ -309,3 +309,11 @@ Validation: units and Zig formatting pass; full conformance is 1,618/1,618, and
Rejection-twin work exposed accepted source that ended a task loan after cancelled-handle transfer through a block parameter. DD-024 resolves Q-052: task loans/scopes, guard parents and shield order now follow simultaneous CFG transfers, with a fixed point for later predecessors and backedges. Existing concurrency invariants and diagnostic codes apply; interpreter behavior and valid source lowering are unchanged. This enforces existing AIR format-0 rules, with no new source concept, syntax or feature.
Validation: units and Zig formatting pass; full conformance is 1,642/1,642. All 24 new AIR/source fixtures pass schedule stress and collection before every instruction. A counted 63-handle rotation test verifies convergence and retained spawn provenance. CLI integration passes 146 checks, including exact source/package/generic positions, three loan rejection twins and both correlated scope/task permutations; existing related-location and lifetime suites pass 349/188 checks. Old/new comparison changes zero diagnostics on 1,327 existing public sources and 338 AIR files, preserving all 715 old source lowerings. Claude wrote independent regressions and reviewed the implementation with additional loop/permutation/cancellation probes. Source bundle size is unchanged; AIR growth is recorded in docs/agent/README.md. The exhaustive rejection-twin inventory and P6-7 remain open.
## P6-7 exhaustive rejection inventory (2026-10-08)
`tools/source_reject_twins.py` discovers all 199 public AIR rejection files, including new tests without manual metadata. The audited manifest verifies 27 same-code pairs: 13 new source fixtures, three existing source links and 11 existing lifetime/CFG pairs. It also records four mandatory E7xxx analogues and 15 cases without an implemented source spelling; these remain unmet rows alongside 153 pending audits. Q-053 records the conflict between the literal same-code criterion and spec 15's source boundary. The criterion and P6-7's doing status are unchanged; `--require-complete` fails.
Pairs compare operation/site, resource family, identity roles and stable rule facts, then independently check marked primary/related source positions against canonical AIR annotations. Early declaration errors and function budget sites have explicit checks; raw errors use spec 15 §10's exact duplicate projection. Cancellation witnesses preserve the reviewed regression context. Manual rule audits remain necessary. CI runs both the partial checker and 21 negative/positive checker regressions, including wrong operation, ordering, resource family, source position, related role and cancellation context. No compiler, verifier, runtime, normative rule, diagnostic code or reference bundle changes.
Validation: unit tests and Zig formatting pass; full conformance is 1,655/1,655. All 13 new source fixtures pass collection before every instruction. The pair checker verifies 27/199 and reports incomplete coverage; its completion gate rejects that inventory. Existing borrow-return, related-position and source-coverage checks pass (133, 355 and 121/121 respectively). Claude independently audited Phase 0–1 cases and reviewed the checker; its false-pair findings are covered by regression probes.