Repository navigation
t27b: module vars that hold a string or start undefined (Closes #7448) - #7470
Conversation
A module var declared `= undefined` starts as 0xAA in every byte, which is what Zig's Debug build used by `t27c test-report` puts there (zig 0.15, measured on the t27b lab). A module var whose type holds a `str` is written with its initial value at the start of every test, invariant and bench, as the reference does by running each test in a fresh process; a data image cannot hold a string's address before the program is loaded. A pointer or slice module var, and a string-holding var declared `undefined`, are still refused. Conformance specs, written first: str_module_var.t27 (reference 5/5) and undefined_module_var.t27 (reference 4/4), nonzero asserts in every test. Ledger: xc7a100t_minimal blocked -> pass, similarity_search moves to ExprCall(@intcast), two new pass rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#7448) The CI reference (zig 0.16 on the arm64 runners) does not give 0xAA for a container-level `undefined`, so three of the four tests had no reference verdict there (STALE in the native ratchet). Reading an undefined byte has no portable value; the fixture now writes before every read. Reference on the lab: 4/4, asserts 4, 2, 1, 2, 0 vacuous. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Master moved (#7747, #7749 and #7725 changed cli/t27b/src/lower.rs and the ledger). lower.rs, source.rs and the exception list merged cleanly; only the ledger conflicted. Ledger: master's (01de65c), with only this PR's five rows, as a `tri t27b ratchet --bless` of the lab run of babedd9 gives them: xc7a100t_minimal blocked -> pass; similarity_search blocked -> pass (its next blocker was @setEvalBranchQuota, which #7459 lowered); the browseros agents runtime registry's blocker -> VarDecl(module, pointer/slice); str_module_var and undefined_module_var new pass. Closes #7448 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Master moved again (#7750 added the W585 scaffold fields `fns` and `scaffold` to `Lower`, next to this PR's `str_globals`). - cli/t27b/src/lower.rs: both sides' fields kept, in the struct and in lower_mode's initializer; this PR's diff against master is unchanged (+35 -12). - Ledger: master's (579bc55), with only this PR's five rows, as the bless of the lab run of babedd9 gives them (xc7a100t_minimal and similarity_search -> pass, the registry's blocker -> VarDecl(module, pointer/slice), str_module_var and undefined_module_var new pass). Closes #7448 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merge shepherd: merged master in from master's side four times, never rebased or force-pushed. Each merge commit is a fast-forward of this branch.
Ledger: master's ledger with only this PR's five rows, from a
Foreign-line budget: master's Signed lane receipts (#7672), compared on the t27b lab with
The earlier pairs gave the same verdict:
The final head 0cd837a differs from 93606bd only by the #7750 merge described above. The stale base.sha was cleared (#7489). Auto-merge was off; the base was flipped to a temporary branch and back to master, and checked to be master. The |
Master moved (#7747, #7725, #7750 and #7470 landed); the AGENTS.md debt line conflicted. Master's history is kept and this PR's entry is re-measured with `wc -l` on this tree: master 1f2448e has cli/t27b/src/*.rs 14967, src/*/*.rs 1222 and tests/*.rs 7987; after this PR 14995 (+28 glue) and 1166 (-56, lower/lencall.rs deleted), tests unchanged. The two lanes that moved the numbers without an entry, #7459 (+31, +39) and #7448 (+23, +23), get one, so the chain is continuous. The exception list and lower.rs merged cleanly. Closes #7524 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ledger takes both sides: #7470's rows and this branch's. Counts recomputed from the entries: pass 902, pass_vacuous 151, not_pass 37 (max_not_pass 37). AGENTS.md re-measured with wc -l: 14967 plus 7987 on master 1f2448e (#7470: +23 and +23), 14988 plus 8003 on this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From master's side (#7470's module vars, and policy and verified commits). docs/reports/t27b_expectations.json: master's ledger plus this branch's six rows, recomposed as before: pass 898 -> 901, max_not_pass 39 -> 40. AGENTS.md: this branch's clause re-measured with `wc -l` over master 1f2448e: 14967 -> 14998 and 7987 -> 8005. Merged-tree checks on the t27c lab: cargo test --release -p t27b 120 passed, 0 failed; under `t27b test --check` the four new specs, #7470's two conformance specs and static_slice_literal.t27 (#7694) pass, and frame_address_return.t27 (#7660), frame_address_store.t27, gen_lockfree_stack.t27 and tool-registry.t27 are refused by name as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second half of #7422 (a test that writes a local it declared) landed on master differently, in #7671 (ef26684). This branch keeps only what master still lacks, the shadowing local (#7668); see the earlier merge ac867a9 for the parts dropped as master's already. Master has since moved (#7414, #7745, #7459, #7747, #7725, #7750, #7470). - tools/policy/foreign-exceptions.txt: both approval comments kept (#7448 and this PR's #7668) above the shared lower.rs / source.rs entries; no entry added. - lower.rs and source.rs merged cleanly (this PR: lower.rs +34 -5, source.rs +14 -1). - Ledger: master's (1f2448e), with only this PR's rows: zig_test_shadowing blocked -> pass, shadow_module_var new pass; to be confirmed by the lab run of this head. Closes #7668 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From master's side (#7470's module vars, and policy and verified commits). docs/reports/t27b_expectations.json: master's ledger plus this branch's three rows, recomposed as before: pass 898 -> 901, max_not_pass 39 -> 38. AGENTS.md: this branch's clause re-measured with `wc -l` over master 1f2448e: 14967 -> 15005 and 7987 -> 7998. Merged-tree checks on the t27c lab: cargo test --release -p t27b 119 passed, 0 failed; under `t27b test --check` opaque_pointer.t27, opaque_plan.t27, gen_assertion.t27 and #7470's two conformance specs pass, and gen_hazard_pointers.t27 stays blocked on ExprBinary(?T) (#7742). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pecs (Refs #7625) Brings master 1f2448e in. One conflict, the t27b ledger header, resolved the same way as 7047b7b: master's rows win, this branch's rows for paths master does not name stay, counts recounted from the rows -- pass 916, pass_vacuous 151, not_pass 38, so max_not_pass moves down 39 -> 38. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k
) (#7913) Part of #6063 (t27b coverage), item C10 of #6488. `var g: ?T = null;` is a container-level var whose payload is never read before a write. t27b holds a ?T as the payload and then a flag byte, 0 for null, so the var's initial image is zero bytes, a str in the payload included: nothing has to be written when the program starts, unlike #7470's string vars. Every test starts from null, as the reference runs each test in a fresh process. Any other initial value stays refused. - specs/tri/t27b/conformance/optional_module_var.t27: 4 tests, reference 4/4, 0 vacuous; tests/source.rs runs it and pins the refusal. - registry.t27 now stops only at `reg1 == reg2` (pointer equality, #7742). - Glue: lower.rs +2, tests +11. Co-authored-by: Claude <claude@anthropic.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ce is a static written at every entry (Closes #7833, Closes #8091) (#8174) * t27b: an array literal of strings for a slice field or a returned slice is a static written at every entry (Closes #7833) t27c prints `files_modified: ["specs/automation/wrapup-auto.t27"]` as `@constCast(&[_][]const u8{ ... })`, the form slice_lit_plan.t27 takes for scalar elements: a comptime constant, defined to read. t27b refused it, since a static is bytes written before the program runs and a string's address is not known then, which blocked specs/automation/wrapup-auto.t27. slice_lit_plan.t27 now makes elements that hold a `str` STATIC like any other constant elements, and a new answer, written_at_entry, writes their object at the start of every test, invariant and bench: #7470's str_globals, the way a module var holding a string is written. REFUSE_STRINGS and plan's `strings` parameter go. #7765's write check covers these statics as any STATIC; run-time elements stay refused. Regenerated with `t27c gen-rust` and resealed. The conformance spec is specs/tri/t27b/conformance/string_slice_literal.t27: `t27c test-report` 5/5, 0 vacuous. Glue: lower/arraylit.rs +17 -2, tests/arraylit.rs +13. Ledger: wrapup-auto.t27 now passes; the conformance spec is a new row. Part of #6063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wip: string slice literal on top of #7765 * t27b: an array literal of strings for a slice field or a returned slice is a static written at every entry (Closes #7833, Closes #8091) t27c prints a slice-field or returned-slice literal of strings, such as wrapup-auto.t27's `files_modified: ["specs/automation/wrapup-auto.t27"]`, as `@constCast(&[_][]const u8{ ... })`: a comptime array, defined to read. t27b refused it, because a static is bytes written before the program runs and a string's address is not known then. slice_lit_plan.t27 replaces REFUSE_STRINGS with STATIC_STRINGS and adds at_entry. Such an array is a module global written at the start of every test, invariant and bench, as a module var holding a str is (str_globals). Equal literals share one global. Run-time elements stay refused, and #7765's write check covers these statics as it covers any static. Regenerated with `t27c gen-rust` and resealed. This builds on the earlier lane branch t27b-string-slice (f7abed3, never opened as a PR). That branch is merged in and brought up to date with #7765's plan. Conformance: specs/tri/t27b/conformance/string_slice_literal.t27. - Reference: 6/6, 0 vacuous. - t27b: 6/6 with 30 runtime asserts. - wrapup-auto.t27 passes in t27b with 6 runtime asserts. - Assert-flip mutants: 30/30 killed in the conformance spec and 30/30 in the plan, under both the reference and t27b. Glue: lower/arraylit.rs +27 -3, tests/arraylit.rs +13. Ledger: wrapup-auto.t27 moves to pass, plus a new conformance row; max_not_pass goes from 27 to 26. Refs #6063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * t27b string slice: set the AGENTS.md debt line and the ledger back to the merge-base before merging master; the next commit after the merge re-applies them (#7833) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * t27b string slice: re-apply the ledger rows and the AGENTS.md debt line on master 3d2ea88; max_not_pass 21, which is what the ledger now holds (Closes #7833) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude <claude@anthropic.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Closes #7448
Part of #6063
Lane 5 of #6063. Two specs the reference runs were refused by t27b on a module-level
var:specs/boards/xc7a100t_minimal.t27, blocked onVarDecl(module, pointer/str/slice);specs/vsa/similarity_search.t27, blocked onVarDecl(module, undefined).What changed (
cli/t27b/src/lower.rs)= undefinedstarts as 0xAA in every byte. Reading it before a write has no portable reference verdict (0xAA on the x86_64 lab, not on the arm64 CI runners), so no fixture reads one before writing it.str(astr, a struct with astrfield, or an array of those) is written with its initial value at the start of every test, invariant and bench. The reference does the same, because each test runs in a fresh process. A data image cannot hold a string's address before the program is loaded.undefined. Each is checked precisely incli/t27b/tests/source.rs. Two new run tests there check that the interpreter and the JIT agree on pass and fail.Conformance specs, written first
specs/tri/t27b/conformance/str_module_var.t27: the reference passes it 5 of 5, with no vacuous tests.specs/tri/t27b/conformance/undefined_module_var.t27: the reference passes it 4 of 4, with no vacuous tests.Lab evidence (Railway t27b lab, aarch64 under qemu, base 3df7065)
cargo build0 andcargo test -p t27b0.t27b testresults:ExprCall(@intCast).t27b.py ratchet:UNEXPECTED PASS xc7a100t_minimal,MOVED similarity_search -> ExprCall(@intCast), and the two conformance specs UNLISTED with pass. These are this PR's ledger rows.specs/policy/own_language.t27is ledgerpassbut stops atExprCall(@intCast)(line 411). That line came in with policy: a foreign-line budget no label lifts, and a local list from origin/master (Closes #7371) #7399, which did not move the row, so master shows the same thing.@intCastbelongs to lane 4, and the ledger bless belongs to lane 2, so this PR leaves the row alone; see t27b ratchet: specs/policy/own_language.t27 regressed to ExprCall(@intCast) with #7399 #7478.Ledger
xc7a100t_minimal.t27: blocked -> pass;similarity_search.t27: blockerVarDecl(module, undefined)->ExprCall(@intCast);passrows for the two conformance specs.max_not_passgoes from 24 to 23.Foreign-line budget (#7371): master's
check_budget()onorigin/master...HEADpasses.lower.rsadds 35 lines andsource.rsadds 24, 59 in total. Rust is edited under the owner's standing rule; theowner-approved-foreignlabel is set, and a block for #7448 is at the top oftools/policy/foreign-exceptions.txt. The master merge was made from master's side, with the hooks on.Scope note: this was first written together with array-literal slice fields of constants (
ExprArrayLiteral(to slice field), which blocksspecs/automation/wrapup-auto.t27), and the two together went over the budget. That part is a different blocker and is not in this PR. Under #7371 it will not be opened as a small follow-up PR to fit under the cap; it stays parked until its logic can be written in .t27.CI fix (ae8420c): the native ratchet on the arm64 runners called
undefined_module_var.t27STALE, because there the reference does not read 0xAA from an undefined container var (3 of 4 tests failed). The fixture now writes every var before reading it. Lab, at the new head: reference 4/4 (asserts 4, 2, 1, 2; 0 vacuous), t27b 4/4, str_module_var 5/5, xc7a100t_minimal 23/23 with 15 invariants held,cargo test --test source51/51.🤖 Generated with Claude Code