verifier: account finite anonymous type sizes exactly

This commit is contained in:
dev committed 2026-10-09 13:26:17 +03:00
1 parent 03614c9bef
commit 111a3861f9
16 files changed
+226 -8

No files matched your search

+14
View File
@@ -432,3 +432,17 @@ These are specified observation limits, not new verifier bugs. A shared linear s
Decide the required source/AIR observation surface. Candidate directions include a shared-view variant operation yielding borrowed payloads and an explicit shared content view through `ref<own<T>>`; neither is adopted here. Any new primitive requires a registered feature, its full AIR contract, ordinary alias/loan/lifetime enforcement, deterministic behavior, format compatibility and vertical source/Quick Reference/conformance coverage. Do not enable consumption, hidden owner copies or unrestricted partial moves to make predicates expressible.
2026-10-09: [RFC 0040](../rfcs/0040-shared-enum-and-owner-views.md) Draft proposes selective `enum.view` edges and shared `own.view` for scalar and array owners, with explicit source `match ref place`. Single-ingress arm blocks create only the chosen edge's dependent views; no general borrow joins or variant proofs are assumed. A current-language probe confirms that a dormant 65-payload variant is legal, while its value match rejects E5101; selecting no payloads or one would avoid that limit in the candidate. Complete unknown `enum.view` spellings currently report E0004 alone, not E0006 for their borrowed parameters. Isolated `own.view` reports E0004; a used result adds E5001, retaining Q-055's dependent-error gate. This is not adoption, implementation or complete contract coverage.
## Q-058 — Finite anonymous types truncated by the size cycle guard
The checked-property audit independently reproduced three accepted modules at `03614c9` that violate spec 08 §7.1/§11.5: a 1,049,600-byte nested-array parameter, a 1,048,576-byte nested-array local plus one byte, and a 1-GiB nested-array parameter with an unrelated nominal declaration. The budget query counted anonymous wrapper edges toward a cutoff based on the number of nominal declarations, truncating finite content to zero. Claude independently identified the same defect. These are implementation failures against existing mandatory limits, not an unresolved size policy.
**Resolved:** only nominal struct-field/enum-payload edges advance the bounded cycle-query depth; array/atomic/mutex size edges preserve it. Finite valid types therefore follow the existing checked sum/product metric regardless of unrelated declarations. Memo keys and the published runtime cache use the same nominal-depth convention; invalid cycles still terminate within V × (V + 2) nominal states. No new feature, diagnostic code, configurable limit or semantic rule is introduced.
Compatibility impact is explicit: oversized values/frames formerly accepted now reject E5101; valid nested content previously undercharged can select allocation failure under a tight grant. A named 32-byte nested-array record is rejected by a 31-byte heap grant and accepted by a 32-byte grant. Invalid cyclic layouts with large array multiplicities can now exceed max_value_size in the budget stage and report E5101 before E1003; the cyclic-wrapper regression pins that transition with finite found = 4,294,967,297. Diagnostic collection and source-position ordering remain unchanged. AIR and source boundary/rejection cases, runtime quota cases and cached/uncached size tests cover the correction. This fix is separate from adopting or implementing RFC 0039.
## Q-059 — AIR type-syntax nesting and native recursion
Source inspection during Q-058 finds recursive `parseType` in `src/air/parse.zig` without an explicit syntax-nesting bound. Size/property traversals also use native recursion over finite anonymous type syntax. **Unverified:** no parser stack-exhaustion reproducer has been run; syntactic finiteness alone does not establish a bound on native stack use.
Audit parser and subsequent type traversals before claiming bounded processing for arbitrary AIR type syntax. Iterative traversal could preserve accepted syntax; imposing a new acceptance limit instead needs normative spec 08 resource rules and fixed diagnostic facts. Q-058 does not add such a limit or claim to resolve this separate issue.