Repository navigation
t27b: anytype and [*]T in the signature of a fn no test reaches, from a t27 plan (Closes #7857) - #7875
Conversation
… a t27 plan (Closes #7857) Zig analyzes a fn only when something analyzed refers to it, so on a fn no test, invariant or constant reaches, `f: anytype` is never instantiated and `?[*]AgentIssue` is never resolved. t27c prints both as written and the reference passes gh.t27 and trios-scarab-types SR-00 and SR-02; t27b refused them as `type anytype` and `type [*]T`. specs/tri/t27b/lazy_sig_plan.t27 (t27c gen-rust, mounted in lower.rs) decides which refused signature types count like a struct whose layout fails in `unresolved_sig`: `anytype` on a parameter, and `[*]T` whose element Zig reads in the file. On an unreached fn the refusal is withdrawn and the fn has no body. What AstGen refuses in every fn keeps its refusal: an undeclared name in the signature (an unreached fn now checks every parameter, not just the first) or in the withdrawn body (`zig_knows` lists the names Zig resolves with no declaration), and `anytype` outside a parameter. The body check also closes the same gap in the existing layout case. Conformance: specs/tri/t27b/conformance/lazy_signature.t27, t27c test-report 3/3, 0 vacuous. Plan: 8/8, 0 vacuous; tri mutate spec kills 82 of 86, the 4 others hang in loops the mutant made endless. 4 of 4 glue mutants are caught by tests/tail.rs. Both specs sealed (seal --save, --verify: all MATCH). cargo test --release -p t27b: 125 passed (x86_64, t27c lab). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR DashboardGenerated at: 2026-10-08 18:36:37 UTC
Summary
Seal Status
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # AGENTS.md # docs/reports/t27b_expectations.json
PR DashboardGenerated at: 2026-10-08 19:27:02 UTC
Summary
Seal Status
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # AGENTS.md # cli/t27b/tests/tail.rs # docs/reports/t27b_expectations.json
PR DashboardGenerated at: 2026-10-08 20:19:11 UTC
Summary
Seal Status
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # AGENTS.md # docs/reports/t27b_expectations.json
PR DashboardGenerated at: 2026-10-08 20:48:42 UTC
Summary
Seal Status
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # AGENTS.md # cli/t27b/src/lower.rs # cli/t27b/tests/tail.rs # docs/reports/t27b_expectations.json
PR DashboardGenerated at: 2026-10-08 21:32:15 UTC
Summary
Seal Status
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # AGENTS.md # docs/reports/t27b_expectations.json
PR DashboardGenerated at: 2026-10-08 21:56:12 UTC
Summary
Seal Status
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/reports/t27b_expectations.json
PR DashboardGenerated at: 2026-10-08 22:44:17 UTC
Summary
Seal Status
|
From master's side (#7875's anytype and [*]T signatures, #7862's derived ledger counts, and others; the conflict is the ledger only). docs/reports/t27b_expectations.json: master's ledger plus this branch's three rows, recomposed as before (gen_hazard_pointers.t27 -> pass, two new pass rows): the ledger now stores no counts (#7862), so only max_not_pass moves, 31 -> 30. AGENTS.md: master's remainder plus this branch's clause, re-measured with `wc -l` over master 4270760: src/*.rs 15232 -> 15271, src/*/*.rs unchanged, tests/*.rs 8183 -> 8191. Merged-tree checks on the t27c lab: cargo test --release -p t27b 131 passed, 0 failed; under `t27b test --check` gen_hazard_pointers.t27 (4/4), pointer_equality.t27, ptr_eq_plan.t27 and opaque_pointer.t27 pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…27b-const-div (Closes #7812) lower.rs and tests/tail.rs keep both sides. AGENTS.md takes master's and adds this branch's step: 15235 plus 1233 and 8200, on master 4270760's 15232 plus 1233 and 8183. The ledger takes master's (no stored counts since #7862) and re-applies this branch's rows; max_not_pass 31 -> 30. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #7857. Part of #6063 (t27b coverage), which is item C10 of #6488.
Decision
Zig 0.16 analyzes a fn only when something analyzed refers to it. On a fn that no test, invariant or constant reaches:
anytypefn is never instantiated, so a method likef.write_str(..)that no type has is never looked up.t27c prints
f: anytypeand?[*]AgentIssueas written, and the reference passes three files that t27b refused astype anytype/type [*]T:specs/port/trios/crates/trios-cli/src/gh.t27GhClient_list_agent_issues(..) -> ?[*]AgentIssue, never calledassert(true), so vacuous)specs/port/trios/crates/trios-scarab-types/rings/SR-00/src/lib.t27Term_fmt(self, f: anytype)callingf.write_str(slug), never calledspecs/port/trios/crates/trios-scarab-types/rings/SR-02/src/lib.t27SoulScarabType_fmt(self, f: anytype), never calledt27b now applies the rule it already had for a struct whose layout fails (
unresolved_sig). On an unreached fn, a refusedanytypeparameter, or a[*]Twhose element Zig reads in the file, is withdrawn, and the fn has no body.What AstGen refuses in every fn keeps its refusal. Each case was probed on the t27c lab (zig 0.16.0), and the reference refuses each one:
anytypefnwrite_strincomptime_inttype anytype(reached, so not withdrawn)-> ?[*]Missingon an unreached fnMissingtype [*]T(element not spelled)fn f(n: u32) -> anytypetype anytype(not a parameter)fn g(f: anytype, y: Missing), unreachedMissingtype (undeclared): an unreached fn now checks every parameter, not just the firstundeclared_thing()in the body of a withdrawnanytypefnExprIdentifier(undeclared), newfn first(p: [*]u32), unreachedThe last refusal is new, and it also closes an old gap. The withdrawn body may name only:
zig_knowslists: builtins, primitive types and values,std,_,assert,assert_eq.Before this PR, a fn withdrawn for a layout failure could name an undeclared identifier in its body, and t27b would pass a file that the reference refuses.
Not covered here. A fn a test reaches keeps both refusals, because Zig instantiates
anytypeper call and lays out[*]T:identity.t27: ananytypeparameter that no instance reads (next PR);queen-public-agents.t27: dispatches on@TypeOf(value) == i64.Where the decisions live
They are in
specs/tri/t27b/lazy_sig_plan.t27, which has 8 tests.t27c gen-rustturns it intogen/rust/tri/t27b/lazy_sig_plan.rs, andlower.rsmounts that file next to the other plans. The plan provides:many_item_elem: where T starts in?[*]const T;plan: whether a refused type is resolved lazily;zig_knows: names Zig resolves with no declaration.The glue (
signature, pluslazy_sigandundeclared_ininlower/unanalyzed.rs) only gathers the facts and asks.Conformance spec first
specs/tri/t27b/conformance/lazy_signature.t27holds:anytypefn whose body calls two methods no type has and binds a local;-> ?[*]Issue;[*]const Issueparameter;t27c test-reportseal --save,--verify: all MATCH)type anytypet27b test --check)tri mutate spec). 5 of 7 are killed. The 2 survivors empty the bodies offormat_intoandfirst_issue, which no test reaches. That is the point of the spec, and its header says so.t27c test-reportgives 8/8, 0 vacuous; sealed.tri mutate speckills 82 of 86 mutants. The other 4 drop a loop's step and hang in a loop the mutant made endless.tests/tail.rs:lazy_sigforced false;Lines (
git diff --numstat --no-renames origin/master...HEAD)cli/t27b/src/lower.rscli/t27b/src/lower/unanalyzed.rscli/t27b/tests/tail.rscli/t27b/tests/source.rs[*]Tcase oft27_array_spelling_rejections_are_precisenow reaches its fn, since the unreached one is the reference's passgen/rust/tri/t27b/lazy_sig_plan.rst27c gen-rust, not hand-editedspecs/tri/t27b/lazy_sig_plan.t27specs/tri/t27b/conformance/lazy_signature.t27.trinity/seals/*.json(2)t27c seal --savedocs/reports/t27b_expectations.jsonAGENTS.mdHand-written foreign code: 59 added lines, 4 deleted, every file under 40. That is under the #7371 cap of 40 per file and 80 per PR. All four files are on master's
tools/policy/foreign-exceptions.txt. This PR does not change that file and needs no label.Gates. Both ran on the t27c lab with master's
gen/c/policy/own_language.c:check_budget()overgit diff --numstat --no-renames origin/master...HEAD: exit 0;check_all()withorigin/master:tools/policy/foreign-exceptions.txt: exit 0.AGENTS.md was re-measured with
wc -lon the merged tree. On master 408d740 it reads 15227 plus 1202 and tests 8164; on this branch, 15232 plus 1233 and 8183.Ledger:
gh.t27: blocked -> pass_vacuous;SR-02: blocked -> pass;SR-00: a new row, pass (the reference passes it; the ledger did not name it);Corpus, t27c lab (aarch64 t27b under qemu,
t27b corpus specs, master vs this branch)compiler/pipeline.t27,test_framework/runner.t27,tri/net/async_stream.t27andvsa/sdk.t27..blockedcompiler/optimizer.t27(NodeKind::ExprLiteral); the split on:fixes that, and the rerun shows it unchanged.cargo test --release -p t27b: 125 passed, 0 failed (x86_64, interpreter); 143 passed, 0 failed (aarch64 under qemu, before the final rebase onto master).t27b lab: signed receipts (#7686)
Head 31f52b1 against its merge-base, master 81da894. Both are signed runs of the deployed t27b lab. The head run was requested with a fresh 32-byte challenge.
/work/t27c-master corpus-receipt compare BASE HEAD --challenge-head <mine>, run on the t27b lab from/work/t27:Exit 3, IMPROVED_ONLY. The
input,verdictandoutputlines name the same five files and are left out here.On the lab, SR-00 passes with 13 runtime asserts and SR-02 with 10.
gh.t27is pass_vacuous: its 8 tests assert onlytrue.The final head is 31f52b1 merged seven times with master, from master's side. The merges brought in #7864 and #7887, which fix master's
duplicate-bodiesred, plus #7744, #7863, #7870, #7853, #7934 and #7904. They resolved only:AGENTS.mdline, re-measured;tests/tail.rsand the#[path]mounts inlower.rs, where both sides are kept.On the merged tree cd4e68b, the t27c lab gives
cargo test --release -p t27b: 130 passed, 0 failed. The seventh merge touched nocli/t27bfile; only the ledger was re-resolved.emit-bitexactis red since the second merge, for threebootstrap/tests/fixtures/core_selfhost/refuse/fixtures master brought in (#7436). None of them is a file of this PR, and the check is not a required one.t27b-native-ratchetis red on master as well, and it names none of this PR's specs. It reports UNEXPECTED PASS 2, UNLISTED 72 and MOVED 3, and it has no REFDISAGREE line.gen-rust gaps
None hit. The plan's byte parameters are
&[u8]because it slices (t[at .. t.len]). Without a slice, gen-rust gives&'static str(#7449).🤖 Generated with Claude Code