report: collect capability kinds without recursive type walks

This commit is contained in:
dev committed 2026-10-09 20:25:47 +03:00
1 parent 53030efcea
commit 8a714ba6de
5 files changed
+62 -3

No files matched your search

+6
View File
@@ -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.
+6
View File
@@ -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.
+24
View File
@@ -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.