report: collect capability kinds without recursive type walks
This commit is contained in:
1 parent
53030efcea
commit
8a714ba6de
5 files changed
+62
-3
No files matched your search
@@ -80,3 +80,9 @@ Type printing now records anonymous suffixes in an explicit stack, then emits th
|
||||
Unit tests compare separate 65,536-level chains with equal types, unequal deep leaves and unequal middle array lengths; they retain each unary constructor identity. A 65,536-level varied-length type prints exactly and passes parse/print/parse/print canonical equality. Wrapper spellings, suffix-allocation failure and buffered writer failure are checked independently. Unit/format checks, test-extended and all 1,769 conformance cases pass, and all 366 public AIR checks retain exact old/new exit status, stdout and stderr.
|
||||
|
||||
Both verified crashing CLI inputs now finish: return equality at depth 65,536 accepts with no output, and invalid atomic content at depth 32,768 returns exactly one E1001 at the original primary position with the complete canonical found type. These are direct process outcomes on the ordinary native stack, not just isolated helper tests. Uncached nominal fallback and other type-query call paths still require audit; Q-059 remains open. No new syntax-depth limit, semantic feature, public diagnostic code or bundle text is introduced.
|
||||
|
||||
## Audit-report traversal
|
||||
|
||||
Call-path inspection finds a further anonymous traversal in report.write's capability-kind collector. The verified 65,536-depth parameter module accepts checking but `aji report` aborts with 10,000 go frames (plus one inner frame), no JSON and exit -6. The collector now iterates inner types, preserving its nominal-name stop, scan sites, deduplication and sorted output. The complete report probe now returns an audit JSON document, and a checked deep capability parameter unit test retains sorted deduplication across declarations, parameters, return and block parameters. Unit/format checks and all 1,769 conformance cases pass; all 366 public AIR report commands preserve exact old/new exit/stdout/stderr.
|
||||
|
||||
The CLI retains verifyModule's size/property caches in check.Report.module; frontend constraints use properties.prepare before structural queries. Uncached nominal fallback remains present in the low-level APIs and needs its own audit. No blanket native-stack claim is made for all query paths. A separate accepted runtime zero-materialization probe exposes [Q-060](runtime-value-depth-audit.md); compiler type repairs do not resolve runtime value traversal.
|
||||
@@ -468,3 +468,9 @@ The [type-validity increment](air-type-depth-audit.md#type-validity-and-finite-l
|
||||
The [anonymous property-query increment](air-type-depth-audit.md#anonymous-property-query-repair) removes recursive anonymous linearity/property/dependency walks, preserving Send/Share mode changes, nominal fixed points and the existing saturated height/witness summaries. Complete checking now accepts 32,768 nested arrays. Follow-up checks verify separate remaining failures: Type.eql at depth 65,536 and diagnostic printType at depth 32,768, both without diagnostic JSON. Equality/printing and uncached nominal fallback remain open; Q-059 is not resolved.
|
||||
|
||||
The [equality/printing increment](air-type-depth-audit.md#type-equality-and-printing-repair) removes anonymous recursion from Type.eql and diagnostic/canonical printing. The formerly failing 65,536-depth equality check now accepts; the 32,768-depth invalid-atomic check returns one E1001 with the complete found type. The serializer uses an explicit compiler allocator for its suffix stack, retaining AIR spelling and diagnostic fields. Uncached nominal fallback and remaining type-query call paths still need audit; Q-059 remains open.
|
||||
|
||||
The [audit-report increment](air-type-depth-audit.md#audit-report-traversal) fixes the capability-kind collector after a verified 65,536-depth module crashes `aji report`. The collector now iterates anonymous edges and retains report contents/order. Uncached nominal/query call paths remain open; Q-059 is not resolved.
|
||||
|
||||
## Q-060 — Native recursion while materializing runtime values
|
||||
|
||||
The [executed runtime audit](runtime-value-depth-audit.md) confirms that a verified one-byte value with 32,768 length-one nested arrays aborts inside zeroValue under `aji run --fuel 8`, rather than producing a run record. The instruction has not exhausted fuel. Iterative runtime traversal must preserve initialization, value shape, allocator/root lifetimes, collection safety and instruction accounting; adding a depth trap/acceptance limit needs a normative decision. Recursive copying, value sizing, marking and serialization are additional audit candidates, with their failure paths unverified. Compiler type repairs in Q-059 do not resolve Q-060.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Runtime value-depth audit
|
||||
|
||||
Non-normative evidence at 53030ef, separate from Q-059's compiler type traversals. No acceptance limit or runtime rule is proposed here.
|
||||
|
||||
Generate TYPE as `"array<" * 32768 + "u8" + ",1>" * 32768`:
|
||||
|
||||
```air
|
||||
module depth.zero
|
||||
air 0
|
||||
lang 0.1
|
||||
features [arrays, ownership]
|
||||
fn @main() -> void
|
||||
effects []
|
||||
entry:
|
||||
%a = local.alloc TYPE
|
||||
local.zero %a
|
||||
ret
|
||||
```
|
||||
|
||||
Every array length is one. The accounted value/frame size is one byte, and `aji check` accepts with no output. `aji run --fuel 8` aborts with exit -6, no JSON run record and a symbolized traceback containing 9,997 zeroValue frames. The input has three instructions; the failure occurs inside materialization, not because fuel is exhausted. Tests use the ordinary 8-MiB native stack; only child core capture is disabled. No timeout ends the run.
|
||||
|
||||
This confirms native recursion in zeroValue on a verified input. An iterative fix must retain zero initialization, value shape, heap/root lifetimes, allocation failure handling, collection safety and instruction/fuel accounting. A new accepted-depth limit or trap would require a normative decision; none is added by compiler-side repairs.
|
||||
|
||||
Source inspection also finds recursion in deepCopy/copyAll and valueBytes. Those failure paths are **unverified**: no deep-value input reached them in this probe. Runtime marking and output serialization also need inspection before claiming complete bounded native-stack behavior. Q-060 remains open.
|
||||
@@ -349,6 +349,8 @@ The [Q-059 anonymous property-query increment](../design/air-type-depth-audit.md
|
||||
|
||||
The [Q-059 equality/printing increment](../design/air-type-depth-audit.md#type-equality-and-printing-repair) iterates structural type comparison and emits canonical suffixes through an explicitly allocated compiler stack. Constructor/leaf identities, array lengths, AIR spelling and diagnostic payloads remain unchanged. Deep unit cases cover equality/inequality and varied-length canonical round trips at 65,536 levels, plus allocation/writer errors. Unit/format checks, test-extended, all 1,769 conformance cases and exact old/new output comparisons on 366 public AIR files pass. The previous CLI failures now finish: equality at 65,536 accepts; invalid atomic content at 32,768 returns one E1001 with its complete found type. Q-059 remains open for uncached nominal/query call-path audits, with no normative/bundle/feature/code change or new depth limit. No fresh Claude review was available.
|
||||
|
||||
The [Q-059 report audit](../design/air-type-depth-audit.md#audit-report-traversal) confirms and removes recursion from capability-kind collection: `aji report` now completes for a verified 65,536-depth parameter. The scan sites, nominal-name boundary, deduplication and sorting remain unchanged. Unit/format checks, all 1,769 conformance cases and exact report-command output comparisons on 366 public AIR files pass. Call-path inspection confirms retained verifier/property caches but leaves low-level uncached nominal APIs open. A separately verified runtime zero-materialization crash is recorded as [Q-060](../design/runtime-value-depth-audit.md), with no new acceptance/trap limit. No fresh Claude review was available.
|
||||
|
||||
Spec 15's initial Phase 6A limits now point to its existing extensions. Its introductory diagnostic rule follows §10 and construct-specific codes; widening reports source E7005 while AIR retains E1002, including the corrected Quick Reference entry. Multi-result bindings include complete unpacking, byte escapes agree with the later exact list, and grammar comments locate graph access in §8. Old incremental limits link buffers/borrow returns to §17/§19. No grammar production, semantic rule or implementation changes. Six existing public fixtures confirm the reported code and deterministic successful AIR; Claude independently audited the corrections. The reference bundle rebuilds; source growth is +50/+47/+58 tokens across the three tokenizers, with unchanged Quick Reference token counts, AIR and std (docs/agent/README.md). P6-1/P6-5 remain open for their unimplemented surfaces.
|
||||
|
||||
## P6-6 contract spec gate (2026-10-09)
|
||||
|
||||
Reference in new issue
Block a user