tests: audit source rejections before AIR lowering
This commit is contained in:
1 parent
a491eba193
commit
ba99ad6727
7 files changed
+192
-9
No files matched your search
@@ -58,7 +58,9 @@ For lowered CFG cases whose diagnostic facts omit the handoff shape, `audited_co
|
||||
|
||||
Early rejection produces no canonical AIR. Its mandatory `early_context` records SHA-256 fingerprints of both manually audited AIR/source files, alongside the rule audit; compiled code/kind/type and independent source positions still have to match. The fingerprints preserve the reviewed cycle shape, including long nominal chains and recursive arrays. They attest unchanged bytes, not the correctness of the audit. Any edit, including comments or line endings, requires a fresh context review before updating these fingerprints; do not regenerate them just to make a failed check pass.
|
||||
|
||||
`--inventory` emits every current AIR rejection as JSON, including newly added unreviewed tests. Its `verification: metadata_only` output does not claim compiled verification. Rows are `same_code`, `source_error` (an audited E7xxx analogue), `air_only` (not authorable in the implemented source) or `pending`. The latter three remain unmet same-code rows. A successful ordinary check verifies the audited pairs against these checks; it does not prove P6-7 complete. `--require-complete` additionally fails until every AIR rejection has a verified same-code twin. Classification is a documented manual audit, not an automatic proof that a rule is inexpressible in source; the phase's literal exit criterion remains unchanged pending Q-053.
|
||||
`--inventory` emits every current AIR rejection as JSON, including newly added unreviewed tests. Its `verification: metadata_only` output does not claim compiled verification. Rows are `same_code`, `source_error` (an audited E7xxx analogue), `source_early` (a different verifier code from source validation before lowering), `air_only` (not authorable in the implemented source) or `pending`. Only same-code pairs meet the criterion. A successful ordinary check verifies the audited pairs and analogues against these checks; it does not prove P6-7 complete. `--require-complete` additionally fails until every AIR rejection has a verified same-code twin. Classification is a documented manual audit, not an automatic proof that a rule is inexpressible in source; the phase's literal exit criterion remains unchanged pending Q-053.
|
||||
|
||||
The currently supported `source_early` case is E5101 at an AIR type declaration versus E1003 at the corresponding source declaration. It requires `site: declaration`, `lowering: rejected`, one AIR budget diagnostic and analogue E1003/type facts. `air_fields` pins exactly kind/limit/max/found/type, while `early_context` pins the manually reviewed AIR and every source analogue. The checker executes both files, checks independent source markers and declaration positions, and requires lower to reproduce check's rejection without AIR coordinates. It does not compare unlike codes as though they were twins or infer the type-cycle shape. A new early-code category needs its own explicit support/audit; E7xxx analogue handling is unchanged. The cyclic-array size case retains E5101 in AIR and E1003 in source, counts zero same-code pairs, and keeps the completion gate failing.
|
||||
|
||||
`python3 tests/hosted/source_reject_twins.py` exercises false-pair detection, independent source markers, raw diagnostic projection, early declarations and automatic discovery of pending cases.
|
||||
|
||||
|
||||
@@ -1763,6 +1763,38 @@
|
||||
"site": "function",
|
||||
"spec": "docs/spec/08-verifier.md \u00a77.1",
|
||||
"rule": "A parameter of array<array<u8,1024>,1025> accounts 1049600 bytes in both artifacts, preserving the complete value-size budget facts."
|
||||
},
|
||||
"phase1/reject/nested_size_cycle_overflow.air": {
|
||||
"kind": "source_early",
|
||||
"site": "declaration",
|
||||
"lowering": "rejected",
|
||||
"spec": "docs/spec/15-source-language.md \u00a71/\u00a710; docs/spec/08-verifier.md \u00a77.1",
|
||||
"rule": "Both declarations have u8 n and an array of 4294967296 A values by value. Source finite-layout validation rejects E1003 at A before emitting AIR; the AIR input budget reports E5101 with bounded size 4294967297 first. This is an earlier-stage analogue, not same-code coverage or an AIR-only source shape.",
|
||||
"air_fields": {
|
||||
"kind": "verifier.resource_limit",
|
||||
"limit": "value size bytes",
|
||||
"max": 1048576,
|
||||
"found": 4294967297,
|
||||
"type": "@A"
|
||||
},
|
||||
"analogues": [
|
||||
{
|
||||
"source": "source/size_limits/nested_size_cycle.aji",
|
||||
"codes": [
|
||||
"E1003"
|
||||
],
|
||||
"fields": {
|
||||
"kind": "type.recursive",
|
||||
"type": "A"
|
||||
}
|
||||
}
|
||||
],
|
||||
"early_context": {
|
||||
"air": "c3eff4c2941ee59e32f9ae4a6aa5e68ef0986f5140301a88a81b86447dab4957",
|
||||
"sources": {
|
||||
"source/size_limits/nested_size_cycle.aji": "b549c862021856f209331a024ba419bf49cf3deb48989bb24c9147ae38e5fc6f"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,5 +4,5 @@
|
||||
// phase: 6
|
||||
// spec: docs/spec/15-source-language.md §1
|
||||
module test.nested_size_cycle
|
||||
struct A { n: u8, x: [A; 4294967296] }
|
||||
struct A { n: u8, x: [A; 4294967296] } // diagnostic here: struct A
|
||||
fn main() -> void effects [] {}
|
||||
Reference in new issue
Block a user