spec: Phase 0 spec gate (P0-1, P0-2, P0-3)

- text AIR format 0: grammar (reference/air-text.ebnf) and module,
  block, SSA, type and canonical-form rules (spec 07 §8)
- instruction contracts for format 0 (new spec 07a)
- traps: stable T0xxx codes and trap records (spec 01 §6)
- integer edge cases and explicit casts (spec 02 §2.1)
- fixed verifier resource limits (spec 08 §7)
- target description with pointer_bits (spec 09 §9)
- new codes E0001-E0006, E1003, T0001-T0007
- resolves Q-001, Q-003..Q-008, Q-018; Q-002 resolved for format 0
This commit is contained in:
dev committed 2026-10-04 12:14:25 +03:00
1 parent 11ce6cb38c
commit 41b764ccfd
13 files changed
+425 -18

No files matched your search

+15 -1
View File
@@ -85,7 +85,21 @@ It may justify elimination of later runtime checks.
Verifier algorithms must have deterministic resource budgets.
If verification exceeds configured/spec-defined complexity bounds, the verifier emits a stable failure rather than silently weakening checks.
If verification exceeds the spec-defined complexity bounds, the verifier emits a stable failure (`E5101`) rather than silently weakening checks.
Bounds are fixed by this specification, not configurable: a configurable bound would let a flag change which programs are accepted. Format version 0 defines:
| Limit | Value |
|---|---|
| functions per module | 65 536 |
| type declarations per module | 65 536 |
| fields per struct, variants per enum, payload values per variant | 256 |
| parameters per function or block, arguments per call or branch | 64 |
| blocks per function | 16 384 |
| instructions per function | 262 144 |
| cases per `switch` | 4 096 |
The `E5101` diagnostic carries the fields `limit` (name of the limit), `max` and `found`.
## 8. Contracts