From b2a02513767f51c679c965fe2f94db5cbf3e5d2e Mon Sep 17 00:00:00 2001 From: "A.Shakhmatov" Date: Sat, 10 Oct 2026 12:46:42 +0300 Subject: [PATCH] docs: record nominal property review and query guidance --- docs/design/air-type-depth-audit.md | 4 +++- docs/plan/phase-6-source-language.md | 2 ++ src/air/properties.zig | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/design/air-type-depth-audit.md b/docs/design/air-type-depth-audit.md index 539ed73..ca5e2fc 100644 --- a/docs/design/air-type-depth-audit.md +++ b/docs/design/air-type-depth-audit.md @@ -103,7 +103,7 @@ The repaired process-level 32,768-declaration query returns one byte, and both p At 897f538, each of nine direct queries over 32,768 nested nominal records ending in u8 aborts with exit -6 and recursive property frames on the ordinary 8-MiB stack: linearity, Zeroable, Copy, Local, Send, Share, IslandSafe, endpoint and forbidden content. These constructed resolved graphs test the query API, not acceptance by the complete verifier. Only child core capture is disabled; no timeout terminates a probe. All nine repaired probes return their expected booleans. -Public property queries now take a host allocator and propagate metadata OutOfMemory. An iterative classifier retains the original anonymous edges, Send/Share transitions and terminal rules. Cached facts and anonymous terminal paths allocate nothing. A cache-free nominal query runs the existing monotone property worklist in a temporary arena and releases it before returning; it neither mutates the caller's module nor installs a cache. Zeroable rejects an enum without preparing its payload graph. Explicit prepared queries serve internal stages whose preceding type verification supplies immutable caches and value types. Public generic-argument validation and result-type helpers use fallible queries where that precondition does not hold. +Public property queries now take a host allocator and propagate metadata OutOfMemory. An iterative classifier retains the original anonymous edges, Send/Share transitions and terminal rules. Cached facts and anonymous terminal paths allocate nothing. A cache-free nominal query runs the existing monotone property worklist in a temporary arena and releases it before returning; it neither mutates the caller's module nor installs a cache. Zeroable rejects an enum without preparing its payload graph. Explicit prepared queries serve internal stages whose preceding type verification supplies immutable caches and value types. Public generic-argument validation uses fallible queries where that precondition does not hold. The private derivedType helper already receives the prepared module; its fallible calls therefore read cached facts without allocating. The preserved invariant is that ownership/transfer/aliasing decisions use the same structural facts, independently of whether the caller retained verifier caches (spec 02/03/04). Property preparation retains its fixed points, universal/existential aggregation, declaration dependencies, phantom edges and saturated summaries. Invalid recursive layouts still reject E1003. Valid `source/generics/constraints_positive.aji` and the `nominal_queries/cycle` AIR/source rejection pair remain conformance examples; raw and prepared `own_array` arguments accept, while `own_array` arguments retain the same E1001 envelope. Verifier rules, runtime ownership, authority, fuel and deterministic scheduling are unchanged. There is no new Aji allocation, code, trap, feature, flag, syntax limit or bundle text. Only the internal Zig allocator/error API changes. @@ -111,6 +111,8 @@ Tests compare both raw and prepared queries against 9,216 independent shallow pr Q-059 remains open for the closing public-call-path audit and source AST traversal inspection. The earlier full per-instruction collection suite is still running; no incomplete suite or unavailable Claude review is counted as a pass. Phase 6 and contract decisions remain open. +A subsequent read-only Claude review, relayed by the owner, examined the property diff against 897f538, including frontend/lower.zig. No defects were reported in the nine classifications, fixed-point preparation, cache preconditions, allocator/error lifetime or test construction. Nothing was built or run, and the expanded suite was not observed; this is code-review evidence only, not independent test confirmation or review of later source-parser work. The resultType/derivedType wording above is corrected, and query's API comment now directs repeated callers to prepare once rather than rebuilding the entire module for each nominal query. + ## Source type-syntax parser At 3563560, an 82,013-byte monomorphic source file containing 16,384 nested length-one arrays aborts in `typeExpr` with 8,704 symbolized frames and exit -6. Depths 63, 64 and 4,096 accept. Spec 15 ยง15's depth-64 generic traversal guard is not a universal parser limit: specialization returns an unchanged module when there are no generic declarations or uses. Applying that guard to every parsed annotation would change existing acceptance. Only child core capture is disabled during probes; no timeout terminates them. diff --git a/docs/plan/phase-6-source-language.md b/docs/plan/phase-6-source-language.md index 17ce94b..1b6a7f8 100644 --- a/docs/plan/phase-6-source-language.md +++ b/docs/plan/phase-6-source-language.md @@ -447,6 +447,8 @@ The [Q-059 property increment](../design/air-type-depth-audit.md#cache-free-nomi Units/format checks, test-extended and the 1,791-case property-engine conformance snapshot pass. All 370 AIR and 1,421 source CLI checks, plus 506 accepted lowerings, retain exact old/new outputs. Final full conformance after the public helper correction passes all 1,791 cases with exact corpus coverage. The earlier full ReleaseSafe per-step suite also remains in progress. No normative/bundle/feature/code change or depth limit is introduced; Q-059's closing audit, Q-060's closing validation and Phase 6/contract gates remain open. No fresh Claude review was available. +A subsequent read-only Claude review against the property base 897f538 found no defects in the classifications, worklist, cache preconditions or allocator/error lifetime. It did not build or run tests and did not observe the expanded suite. The helper-name wording and repeated-query preparation guidance are corrected; this does not review later source-parser changes. + ## Source type-syntax parser (2026-10-10) The [Q-059 source parser increment](../design/air-type-depth-audit.md#source-type-syntax-parser) replaces recursive type/argument parsing with explicit array and argument-list frames, preserving static function arguments, sibling order, split angle positions, syntax failures and slice repair candidates. Unit tests inspect deep mixed types and static arguments and fail parser metadata allocations. The old 16,384-array source crashes in parsing; the new parser allows formatting, while full checking confirms the next failure in `usesGenerics`. A deep invalid slice annotation now returns its original E7001 candidate instead of crashing. The existing generic guard is not imposed on monomorphic syntax. diff --git a/src/air/properties.zig b/src/air/properties.zig index 01f67d4..fa7b6fe 100644 --- a/src/air/properties.zig +++ b/src/air/properties.zig @@ -214,6 +214,9 @@ fn fact(m: air.Module, n: Named) bool { }; } +/// Each uncached nominal query prepares the entire resolved module afresh. +/// For repeated queries, call prepare once and query its returned immutable +/// module; this avoids paying the preparation cost for every named root. pub fn query(a: std.mem.Allocator, m: air.Module, t: Type, property: Property) std.mem.Allocator.Error!bool { return switch (classify(t, property)) { .known => |value| value,