Commit Graph

520 Commits

Author SHA1 Message Date
d34c90d932 test: ratchet LANGBYTEID floor 152->153 after #14 narrow-tail-widen pins 2026-06-28 15:16:52 +09:00
ac6e86cefe test: ratchet LANGBYTEID floor 151->152 after #9 arr-struct-subtail-frame pin 2026-06-28 12:20:28 +09:00
c6cdd8c2d6 test: ratchet LANGBYTEID floor 150->151 after #17 arrvar-union-slice pin 2026-06-28 10:43:34 +09:00
fa1b6b77d4 test: ratchet LANGBYTEID floor 149->150 after #16 global/chained-unwrap pin 2026-06-28 09:54:59 +09:00
01649598f4 test: ratchet LANGBYTEID floor 148->149 after #15 union-subtail-bp pin 2026-06-28 01:59:46 +09:00
b691a6d8c3 test: ratchet LANGBYTEID floor 147->148 after #12 struct-unwrap pin 2026-06-28 01:10:47 +09:00
3a0389ce60 test: ratchet LANGBYTEID floor 146->147 after #10 aggregate-tail pin 2026-06-27 23:44:58 +09:00
5b33ea3f7d test: ratchet LANGBYTEID floor 144->146 after #6 unwrap-callarg str+slice pins 2026-06-27 21:10:43 +09:00
5071996efe test: ratchet LANGBYTEID floor 143->144 after #11b idx-dot-src pin 2026-06-27 19:40:23 +09:00
737126ed69 test: ratchet LANGBYTEID floor 142->143 after #11 idx-dot-aggret pin 2026-06-27 18:49:24 +09:00
b8d55a729e test: ratchet LANGBYTEID floor 141->142 after #9 deref-callarg pin 2026-06-27 17:20:02 +09:00
597a6ba7ff test: ratchet LANGBYTEID floor 140->141 after C6a fn-ptr-autoderef pin 2026-06-27 14:49:53 +09:00
8c7b6b49d4 test: ratchet LANGBYTEID floor 139->140 after C7c nested-aggregate-fill pin 2026-06-27 14:16:20 +09:00
d152f0d744 test: ratchet LANGBYTEID floor 138->139 after C2c idx-aggret-receive pin 2026-06-27 13:28:37 +09:00
33295c41c6 test: ratchet LANGBYTEID floor 137->138 after #120 float-narrow pin 2026-06-27 12:35:15 +09:00
98b84986b7 test: ratchet LANGBYTEID floor 136->137 after C1b deref-header pin 2026-06-27 11:48:17 +09:00
b855b3bdbc test: ratchet LANGBYTEID floor 135->136 after #28 slice-global promotion 2026-06-26 23:18:06 +09:00
f476797a47 test: ratchet LANGBYTEID floor 124->135 after Fam4 migration (#30)
Fam4 added 11 new byte-id @test files. Ratchet the minimum so a future
drop is caught.
2026-06-25 01:32:42 +09:00
74cc35d488 test: migrate Fam4 static-init/DATA-emit value tests to @test (#30)
Continues the test-arch tower past Fam8-13. 11 module-level static-init
/ DATA-emit value drivers move from test/wcc/*_run.c into @test row-
tables under test/lang/; every classification empirically re-probed at
HEAD (refuting two stale worklist tags).

- value rows -> test/lang/*_test.ww (11 files)
- reject rows -> runww //ww:error carriers (3, dual-stage non-vacuous;
  947 const-divzero confirmed a both-stage compile-reject, not run-exit)
- 840_zeroinit, 944_array_zeroinit, 989_arrlit_tail_zero kept as byte-id
  .c pins (zero-over-dirtied-frame / DATAW-length is byte-id-blind to a
  runtime @test; #263), mutation-gated
- repoint two stale comment refs to deleted test names (719,
  989_structlocal_frame)

Migrated static-init @test ride the cs==ww T2 byte-id gate, preserving
DATA-emit byte-id. 2D global-struct array-field read (#137/#150)
confirmed cs==ww + correct at HEAD. Coverage parity verified row-by-row;
two-round reviewed. Floor ratchet follows.
2026-06-25 01:32:32 +09:00
4cb697af87 test: ratchet LANGBYTEID floor 113->124 after Fam13 migration (#5-C6)
Fam13 added 11 new byte-id @test files (12 migrated minus the one
_runonly). Ratchet the minimum so a future drop is caught.
2026-06-24 22:59:46 +09:00
132ea4ee60 test: migrate Fam13 misc checker/coercion value tests to @test (#5-C6)
Final fold-2 chunk. The 12 Fam13 single-file value drivers move from
test/wcc/*_run.c into in-language @test row-tables under test/lang/:

- value rows -> test/lang/*_test.ww (12 files)
- reject rows -> runww //ww:error carriers (13, dual-stage non-vacuous)
- nullable abort rows -> runww //ww:run-exit 1 carriers (3)
- 953_globalslice_arg -> _runonly (cs!=ww checker divergence, #28)
- 788 value_not_type_neg + 953_arrlit_slice reject_assign kept as slim
  rc-only .c pins (divergent-diag dual-reject, mutation-gated); 788 #29

Coverage parity verified row-by-row vs each retired driver; advisor-
ratified carve taxonomy; two-round reviewed. Floor ratchet follows.
2026-06-24 22:59:32 +09:00
246e5bb90e test: migrate Fam9 match/tagged value tests to @test (#5-C5)
fold-2 chunk C5 (drew's Fam8-13 plan), the highest-risk chunk: 21 match/tagged
value-row C drivers re-homed. 20 -> test/lang/*_test.ww @test row-tables + 12
runww //ww:error carriers (both stages reject). The global-tag cluster
(globtag*/globstructwiden/taggedderefstore/...), which sits on the #15/#17
global-ptr fix, was empirically probed byte-id CLEAN -- the predicted hotspot
surfaced ZERO fresh cs!=ww. Carves: variant_chain_b95 #81 -> _runonly (genuinely
diverges at HEAD); callret_bound277 #277 -> slim C pin (cs-runs/ww-rejects),
mutation-gated. 929_tagged_memarg kept whole (SSE-ABI asm conformance). 19
drivers deleted, 944_variant_chain slimmed to the #277 pin.

The match-on-tagged-struct-field divergence (former #26) probed RESOLVED for all
its cited shapes (938 voidstr_field/recursion_torture, tagnorm dedup_match all
byte-id cs==ww + value-correct) -- closed no-reproducer-at-HEAD, attribution to
#15/#17 INFERRED. Those rows migrate as normal byte-id @test and serve as the
REGRESSION SENTINEL for the inferred close (a resurgence trips the gate).

LANGBYTEID floor 93->113; test count 374->355 (19 deleted; 929 + 944_variant_chain
kept). do-not-auto-batch (926_tagscr/940_global_sret/940_str_forrange) untouched.
2026-06-24 20:42:08 +09:00
60dec4a6bf test: migrate Fam11 float value tests to @test, keep ABI-conformance pins (#5-C4)
fold-2 chunk C4 (drew's Fam8-13 plan): 13 float value-row C drivers re-homed.
11 migrate to test/lang/*_test.ww @test row-tables (exact IEEE-bit asserts);
1 float-overflow reject row -> a runww //ww:error carrier. 956_tuprecv_f64
slims to a w6c_ww asserttyped pin (20 value rows -> @test; the stamp dimension
can't be a value/byte-id @test) -- mutation-proven non-vacuous (break #121
stamp -> RED 6/6 -> restore -> GREEN) + an in-test vacuity self-check.
946_structparam/structret stay whole: their SSE register-class .s-grep (SysV
ABI conformance, #165/#171a) is the genuine defect-guard, not @test-expressible.
Float was the predicted SSE-cursor byte-id hotspot -- zero fresh cs!=ww
surfaced; 951_f64cgen (cstage-only before) byte-ids clean. LANGBYTEID floor
82->93; test count 384->374 (10 deleted drivers; 956 + the 2 946 kept).
2026-06-24 03:25:47 +09:00
3ee1906497 test: migrate Fam10 alias value tests to @test, carve divergences to pins (#5-C3)
fold-2 chunk C3 (drew's Fam8-13 plan): 8 alias value-row C drivers, 205 rows
re-homed with zero loss -- 177 value -> 8 test/lang/alias_*_test.ww @test
row-tables; 16 reject -> runww //ww:error carriers (both stages reject);
3 cs!=ww value rows -> 2 *_runonly_test.ww (T1, byte-id-excluded, #60/#81);
9 irreducible asymmetric rows -> slim C pins, each ticket-cited and
mutation-proven non-vacuous:
  - accept amplen1/2,ampcap2: cs runs / ww rejects 'unsupported address-of
    shape' (#96)
  - cgen_b5 g73_heapfill: cs!=ww .s + ww link-fails on self-contained alloc;
    compile-smoke pin (#24)
  - cgen_b6 fsarg2_bound: both reject, different msgs, each vs the correct
    stage (#271/#165 cs vs #272/#276/#277 ww)
  - emit_b7 slc/slcstr/slctag _2lvl + slc_plain_ctl: slice-literal static-init
    divergence (#120/#29-kin, ken-d2-oracle)
4 fully-migrated drivers deleted, 4 slimmed-in-place to hold only the
irreducible pins. LANGBYTEID floor 74->82 (8 new byte-id @test files); test
count 388->384 (4 deleted; 4 slimmed kept). do-not-auto-batch files not in
Fam10.
2026-06-24 02:45:09 +09:00
07b3c74ab0 test: migrate Fam8 tuple value tests to @test + reject carriers (#5-C2)
fold-2 chunk C2 (drew's Fam8-13 plan): 14 tuple value-row C drivers migrate to
15 test/lang/*_test.ww @test row-tables (the +1 is 954_tuprecv, slimmed not
deleted -- its value rows split out while the asserttyped-stamp dimension stays
as a carrier-split C pin, mutation-proven non-vacuous). Reject rows move to 32
test/wcc/data/*/case.ww //ww:error carriers (runww asserts the substring in
BOTH stages). The test-lang byte-id (LANGBYTEID) gate gives cs==ww automatically
and is strictly more sensitive than re-running the wwstage leg; floor 59->74.
Tuple surfaced zero cs!=ww as the plan predicted -- no value-only carve. The 945
trio folds in here; 940_global_sret / 940_str_forrange / 926_tagscr untouched
(routed to drew per-file). Test count 402->388 = the 14 retired drivers.
2026-06-24 01:44:13 +09:00
47c7dbc2c8 test: migrate Fam12 opaque value tests to @test row-tables (#5-C1)
fold-2 chunk C1 (drew's Fam8-13 plan): 960_opaque_decl_run.c and
962_opaque_assign_cast_run.c were value-row C drivers. Migrate their 3+3
cases to test/lang/opaque_decl_test.ww and opaque_assign_cast_test.ww as
@test row-tables. The test-lang byte-id (LANGBYTEID) gate gives cs==ww
automatically -- 960 was cstage-only-run before, so this strengthens it.
Both byte-id clean, no cs!=ww carve. Retire the 2 C drivers (LANGBYTEID floor
57->59) and repoint a dead comment ref in lib/sort/sort.ww. 961_opaque_guards
(reject/guards) stays in C -- fold-3 territory, not in the Fam12 fold-2
worklist.
2026-06-24 01:00:47 +09:00
475c003b0d cgen: fix global-ptr field READ, load ptr value via SB before offset (#15)
Reading gp.f through a module-global pointer miscompiled in BOTH stages,
differently: cstage classified gp as a local at boff 0 and derefed BP
(MOVQ (BP),BX), wwstage collapsed gp.f to an undefined global symbol f
(MOVQ f(SB)). Both now load the pointer value from the global's data slot
before the field offset, converging on MOVQ gp(SB),BX; MOVQ off(BX),AX.
cstage mirrors the #6 store decline; wwstage gains a global-ptr arm and
shares a cgptrfieldload helper with the local arm.

Fused, not split: the two stages must emit byte-identical asm, so a
one-stage commit would fail the byte-id gate. Sibling byte-divergences
filed: #16 (chained-spine gp.x.y), #17 (>32B tagged word-order).

Test: table-driven 689_globptr_field_read_run (24 rows, runtime + byte-id).
2026-06-23 06:42:38 +09:00
02967e04ce w6c: fix global-ptr field-store SEGV via decline-to-resolver (#6)
A module-global pointer's field store/compound (`let gp:*S=nil; gp.f += 5`,
`gp.in = Inner{...}`) SEGV'd in cstage: the enumerated N_DOT-lhs arms load
the base pointer with `MOVQ boff(BP),BX`, valid only for a LOCAL ptr slot,
but a module-global ptr has no local slot (localfind=0) so it dereferenced
the saved BP. wwstage was correct -- it routes these through its F6
cgplaceaddr resolver (its dedicated arm is scalar-`=`-only by design,
#60/#61). The byte-id gate was blind (no global-ptr compound in the
bootstrap corpus) and the deferral note was stale: this is a live cs!=ww
divergence with wwstage as the oracle.

cstage already has an equivalent assign-resolver (cgen.c ~7488) that emits
byte-identically to wwstage's F6 route, but the enumerated arms intercepted
the global case first. Fix (align cstage UP, cstage-only): two precondition
entry-guards decline a module-global `*struct` base for the compound +
non-scalar-field cases so they fall through to the resolver. Plain-scalar
`=` stays in the enumerated arm (its #47 fix already matches wwstage). The
decline and resolver accept-sets exactly partition the global-base
N_DOT-lhs space (no gap, no overlap); tagged/float field stores now both
loud-stop symmetrically (were SEGV'ing). The discriminant keys on
localfind-presence + let_islet, so a param at offset 0 stays local.

New both-stage + byte-id test 689_globptr_field_store_run covers offset-0/8,
compound, struct/str field, chained gp.x.y, indexed gp.a[i].f, with local +
offset-0-param controls. The field-READ path is independently broken in
both stages (filed #15). make clean && make test: all 403 passed, byte-id
990-996 green.
2026-06-23 01:12:27 +09:00
81ebaf7bfa build: redirect selfhost-build sepwork scratch out of tree with -o main (#14)
The 9 Makefile recipes that build selfhost/cmd/<tool>/main.ww (5 primary
$(BIN)/*_ww + 4 nocc bootstrap) passed no -o, so the compiler's scratch
followed the SOURCE stem and left selfhost/cmd/<tool>/main.sepwork in the
tracked tree (the binary was mv'd out; the .sepwork dir stayed behind).

Each recipe already cd's into a gitignored out-of-tree dir before building,
so a uniform `-o main` makes the scratch follow the OUTPUT stem (cwd) out
of the source tree; the binary still lands at cwd `main` and the existing
`mv` lines are unchanged. Same intermediates-follow-output principle as the
T3 -o redirect (rule 14).

Carved from #8 by unanimous advisor ruling as its own bisect-clean commit.
make clean && make test: all 402 passed, zero in-repo .sepwork, zero /tmp
scratch.
2026-06-22 23:41:24 +09:00
6525e137ae wwi: derive decl-less module's .wwi package leaf from parse-stamped path (#11)
wwi_emit took the .wwi `package` leaf from the first primary decl's module tag;
a fully empty primary module body (zero decls) had none, so the leaf stayed the
literal default "main" and the importer rejected it ("package main does not
match import path <leaf>"). The module identity is only available at parse time
(curmod is overwritten by imported //ww:module sections before emit), so stamp
the primary path onto the N_FILE node (TK_MODULE and TK_MODRESET rp!=NULL sites,
only-if-empty so a bare-reset `package main` root stays "main") and, when the
decl-scan finds no leaf, fall back to that stamped path. Symmetric cstage+
selfhost; both detect scan-miss via the same found-flag so the emitted .wwi
stays byte-identical.

Regression: test/wcc/989_wwileaf_run.c, table-driven over {empty body,
comment-only, nested a.b.c} decl-less shapes, non-vacuity proven.
2026-06-22 21:17:30 +09:00
a1484aef28 pkgcache: reject 0-byte artifacts on store and lookup, self-heal torn writes (#10)
A torn producer write (e.g. disk-full mid-copy) could leave a 0-byte P.wwi or
P.o in out/.pkgcache under a self-consistent key; cache_lookup checked only
existence, so every later build HIT and served the empty artifact forever
(silent serve-wrong). Reject size==0 on both sides, symmetric across stages:
store refuses to commit a 0-byte temp before the key write, lookup treats a
0-byte cached artifact as a MISS so existing poison self-heals on re-derive.
A valid .wwi/.o is never 0 bytes, so the guard cannot misfire.

Regression: test/wcc/989_pkgcache_poison_run.c, table-driven over
{poison P.wwi | P.o | both}, non-vacuity proven by guard-neuter.
2026-06-22 20:52:11 +09:00
c0383274d1 lex: clear pending modpath on module-reset, fix empty-module stale-modpath miscompile (#9)
BUG-A #9: when an empty/export-less inlined module body produces `//ww:module <p>` immediately followed by `//ww:module-reset` in one skipws run, lexnext drained TK_MODRESET first then emitted the STALE TK_MODPATH past the reset boundary, re-binding pathmod=<p> so the root `package main` was validated against <p> -> wrong reject. Fix clears the pending modpath at the reset-RECOGNITION site in skipws (NOT lexnext drain): cstage l->modpath=NULL after both l->modreset=1 (cmd/wcc/lex.c); selfhost l.modpathset=0 after all three l.modreset=1 (lib/ww/syntax/lex.ww). Symmetric (rule-10): identical token streams, bootstrap byte-id holds. The normal RESET-then-PATH boundary is unaffected (clear is a no-op when no path is pending). Pin: test/wcc/989_modresetadj_run.c feeds the raw composed adjacency to w6c+w6c_ww (accept + byte-id), red-path-proven (reverting a clear reddens it). A separate wwi-producer defect surfaced (decl-less .wwi defaults to 'package main') filed as #11; not touched here.
2026-06-22 19:49:57 +09:00
99b98b9b1b test: migrate 989_letshadow to @test value pin, retire C twin (fold-3)
#152 link-the-let-before-its-init miscompile (miscompiled IDENTICALLY on both stages, so byte-id 990-997 was blind; only a runtime value check catches it). Lifted the run fixture into test/lang/letshadow_test.ww (primitive @test value pin; byteid-eligible — symmetric, cs==ww). byteid floor 56->57. Closes the fold-3 #7 umbrella (last C test twin retired).
2026-06-22 18:30:04 +09:00
9cef92175f test: migrate 989_strglobeq to @test value pin, retire C twin (fold-3)
#154 cstage-only str== global-header miscompile (str== fast-path read the global str header off BP+0 instead of name(SB); byte-id 990-997 blind to a runtime-value miscompile). Lifted the run fixture into test/lang/strglobeq_test.ww (primitive @test value pin; byteid-eligible — post-fix cs==ww). byteid floor 55->56.
2026-06-22 18:28:41 +09:00
50d1705100 test: migrate 949_dotbase_addr_slice to @test + byteid carve-out seam, retire C twin (fold-3)
#252/#253/#257 N_DOT-base addr-of-slice: 105 byteid=1 rows -> test/lang/dotbase_addr_slice_test.ww (primitive-only); 6 #254 run-only rows (4 chain_val_* + letcopy_dot_struct/letcopy_nest_struct, value-nested-struct frame divergence) -> dotbase_addr_slice_runonly_test.ww. New byteid-exclusion seam: LANGBYTEID_FILES filter-out %_runonly_test.ww (suffix convention; T1 value-runs both, T2 byteid skips runonly). byteid floor 54->55. Carve-out preserves the .c byteid field 1:1; all 105 byteid=1 rows verified cs==ww under the live sepwork gate.
2026-06-22 18:06:05 +09:00
094ccc63f0 test: migrate 944_alias_def_addr to @test + runww reject, retire C twin (fold-3)
#88 alias/def/address-of family: 5 value rows -> test/lang/alias_def_addr_test.ww (primitive-only asserts), 1 reject (str-def-non-addressable, shared body 'cannot take address of non-addressable def') -> runww //ww:error dual-stage carrier. byteid floor 53->54.
2026-06-22 17:10:22 +09:00
04f163dde6 test: migrate 802_lenidx to @test + runww rejects, retire C twin (fold-3)
#19 len/index family: value rows -> test/lang/lenidx_test.ww (primitive-only asserts), 3 reject (callres/sliceexpr/strlit) -> runww //ww:error dual-stage carriers. byteid floor 52->53.
2026-06-22 16:53:49 +09:00
057e805cf0 test: migrate dotfield/idxfield compound-assign to @test + runww rejects, retire C twins (fold-3)
949_dotfield_compound + 949_idxfield_compound are one bug class (#133-lineage compound-assign load-op-store on field lvalues; #34/#33, #263 carve-out) sharing the combine + hard-error path, so the two C carriers fuse into one commit: 26 value rows -> test/lang @test row-tables (primitive-only asserts), 8 reject rows -> runww //ww:error dual-stage carriers. byteid floor 50->52.
2026-06-22 16:34:33 +09:00
af3c49a4c7 test: migrate 948_idx_compound to @test + runww rejects, retire C twin (fold-3)
#133 indexed-scalar compound-assign. The 21 rows split by observability:
18 value rows -> test/lang/idx_compound_test.ww (one @test fn each,
primitive-only asserts, slot-poison + neighbor-unchanged read-back);
3 reject rows -> test/wcc/data/idx_compound_{float_indexed,str_indexed,
chained_ptr_float}/case.ww as //ww:error, asserting BOTH stages reject on
the shared diagnostic body (cstage's leading prefix excluded). The C twin
is retired; its coverage is a strict superset of the original rows.

First reject-bearing fold-3 migration -- validates the runww dual-stage
home end to end. LANGBYTEID_EXPECTED_MIN 49 -> 50.
2026-06-22 16:02:01 +09:00
e57fcf230b make: wire test-run into make test (pre-push reject gate)
test-run drives runww.ww over the test/wcc/data/*/case.ww behavior and
//ww:error cases, but was not a prerequisite of any aggregate, so the
reject surface was ungated. With runww's arm now dual-stage, gate it.

Added to the pre-push `test` target only -- not test-unit, not the
test-commit content-key tier. runww execve's its children with nil envp,
so a WW_PKGCACHE override cannot reach them; they fall back to the default
out/.pkgcache that $(TESTS) and the byte-id gates also use. A normal
prereq would let make -j overlap test-run with those writers, so test-run
carries an order-only prereq (| $(TESTS) test-lang test-lang-byteid) and
is scheduled strictly after every default-cache writer. No cache
isolation is added: it would be inert under nil envp, and the ordering
prevents the race.

True per-run cache isolation stays blocked on an os envp() forwarder.
2026-06-22 15:34:36 +09:00
d8e7470555 test: migrate struct/sret round-trip family-7 to test/lang @test, retire C twins (fold-2)
Continue fold-2: migrate the struct-by-value / sret round-trip family from
bespoke build+run C twins to test/lang @test, retiring each twin in the same
commit. Runtime coverage MOVES from $(TESTS) to test-lang (T1 runs+asserts via
`ww test`) + test-lang-byteid (T2 keeps cs==ww .s byte-id); the $(TESTS)
headline drops 6. Every assert is a primitive int/u8/bool comparison (no
fmt/strconv in the assert path); each returned struct/tuple FIELD is asserted
individually so a dropped/mis-offset/over-wide word FAILS. 46 @test cases, a
strict superset of the 46 C rows (799=4, 925=10, 930=6, 949odd=7, 949chained=9,
949aggret=10).

  799_tuple_sret_receive_run.c   -> tuple_sret_receive_test.ww    (#10 Fold B: over-4-GP tuple `([]u8,[]u8)` sret RECEIVE — destructure/single-var/return-forward/reassign; len() only on destructured bindings, never len(t.N))
  925_sret_struct_return_run.c   -> sret_struct_return_test.ww     (#23: >24B sret round-trip; 32B/40B/nested/slice-payload, reassign-receive, struct16-by-value-arg #11 collision, N_IDENT return rhs, forward #9 simple/multi-arg/slice)
  930_sret_narrow_field_run.c    -> sret_narrow_field_test.ww      (#33: sret narrow trailing-field copy — bool/u8/i16/i32 + mixed bool+i32+i64 after the 24B slice)
  949_oddstruct_byval_ret_run.c  -> oddstruct_byval_ret_test.ww    (#107: by-value return of odd sub-8 size {3,5,6,7} single-eightbyte + 8/12/24 boundaries)
  949_chained_dot_struct_copy_run.c -> chained_dot_struct_copy_test.ww (#107 sibling: chained-DOT `t.m.l = s` natural-size tail copy {0..7} + via-CX global dest; neighbour z is the oracle)
  949_aggret_source_run.c        -> aggret_source_test.ww          (#272: aggregate return from every addressable source — arrlit/N_DOT/N_INDEX/deref/ident + >24B sret arm + global-receive caller-half)

This family is sret / struct-by-value-return (the #107/#38/#271/#272 ABI area):
all 6 new files are byte-id cs==ww (no fold-5 divergence surfaced). Bump
LANGBYTEID_EXPECTED_MIN 43->49 to ratchet the new corpus floor.
2026-06-22 13:52:41 +09:00
c9c5f6406f test: migrate deref/narrow/stride family-6 to test/lang @test, retire C twins (fold-2)
Continue fold-2: migrate the pointer-deref / narrow-load / pointer-array-stride
family from bespoke build+run C twins to test/lang @test, retiring each twin in
the same commit. Runtime coverage MOVES from $(TESTS) to test-lang (T1 runs +
asserts via `ww test`) + test-lang-byteid (T2 keeps cs==ww .s byte-id); the
$(TESTS) headline drops 5. Every assert is a primitive int/bool comparison with
a width-preserving (`==`) sink so a stale high half or wrong stride FAILS; the
narrow-signed rows route through an `: i32` cast against a 64B-widened literal
to force sign-extension onto the load. Each .c row maps to one inline @test fn
(50 cases total, strict superset of the C rows):

  947_deref_narrow_run.c  -> deref_narrow_test.ww  (#116, 10 rows: *p reads pointee width not 8B MOVQ; i32/u32/u8/i8/i16/u16 + !i32-alias + enum-i8 + bool/i64 controls)
  949_ptrarr_index_run.c  -> ptrarr_index_test.ww  (#61, 23 rows: p[i]/(&p[i])/(*p)[i] stride by size(T); {1,2,4,8}B, const+var idx, param/local/cast bases, neighbor guards, nested *[2][3], *[3]str header, siphash round())
  949_dotbase_arr_run.c   -> dotbase_arr_test.ww   (#135, 3 rows: (*struct).arrayfield[i] read/write/compound addresses the field)
  944_def_amp_idx_run.c   -> def_amp_idx_test.ww   (#94, 6 rows: &D[i] over a def-array; +plain/read/2D controls)
  944_alias_amp_idx_run.c -> alias_amp_idx_test.ww (#5, 8 rows: &a[i] over an alias-typed base classifies off the chased type; local/global, narrow, fwd-ref, plain+str controls)

The two sibling .c (949_dotbase_addr_slice_run, 944_alias_def_addr_run) stay in
$(TESTS): the first is run-only byteid=0 (#254 cs!=ww rows), the second carries
a LOUD rule-7 reject row — both routed to fold-3 (task #7). Bump
LANGBYTEID_EXPECTED_MIN 38->43.
2026-06-22 13:34:28 +09:00
a6b74e46c4 test: migrate global value r/w family-5 to test/lang @test, retire C twins (fold-2)
Continue fold-2: migrate the global-value read/store/addr-of family (non-tagged)
from bespoke build+run C twins to test/lang @test, retiring each twin in the
same commit. Runtime coverage MOVES from $(TESTS) to test-lang (T1 runs+asserts
via `ww test`) + test-lang-byteid (T2 keeps cs==ww .s byte-id); the $(TESTS)
headline drops 3 (421->418). All asserts are primitive int comparisons; fresh
globals are zeroed, so a store that misses the symbol reads back 0 and FAILS.

  989_globptrfield_run.c  -> glob_ptr_field_test.ww  (scalar field store through a module-global *struct pointer loads the pointer from gp(SB), not saved BP; runtime gp=&backing form, static-init is #48-blocked)
  989_globstructret_run.c -> glob_struct_ret_test.ww (returning a module-global struct ident by value copies g's bytes; rsz 16 + rsz 24, each field asserted)
  989_dotbasehijack_run.c -> dotbase_hijack_test.ww  (indexing an [N]T field of a module-global struct addresses the struct field, not an unrelated global sharing the field name; +typed-inner control +colliding-global-intact pin)

glob_ptr_field keeps only the .c's offset-0 row: an added non-zero-offset row
(gp.g=9) surfaced a cs!=ww divergence (cstage folds the offset into the store
displacement `MOVQ AX,8(BX)`; wwstage emits `ADDQ $8,BX; MOVQ AX,(BX)`) — a
latent global-*struct-pointer field-store divergence beyond the .c's coverage,
reported for the backlog, not carried here. Bump LANGBYTEID_EXPECTED_MIN 35->38.
2026-06-22 12:31:23 +09:00
b879d38b0f test: migrate structcopytail #73 struct-copy-tail family to test/lang @test, retire C twin (fold-2)
Continue fold-2: migrate the #73 whole-struct field-copy ragged-tail test from a
bespoke build+run C twin to test/lang @test, retiring the twin in the same
commit. Runtime coverage MOVES from $(TESTS) to test-lang (T1 runs+asserts via
`ww test`) + test-lang-byteid (T2 keeps cs==ww .s byte-id); coverage is
preserved, the $(TESTS) headline drops 1 (422->421). All four rows are pure
value-rows (no reject rows): each poisons `mark` at the inner struct's natural
offset, copies, then asserts every field back with primitive int comparisons, so
an 8-byte MOVQ that over-writes the ragged-tail successor FAILS.

  989_structcopytail_run.c -> structcopytail_test.ww (tail2/tail6/tail7 ragged-tail copy preserves mark; ctl8 8-aligned control)

This is the only Family-3 file with no build-must-fail rows; the three
compound-OP= twins (948_idx_compound, 949_dotfield_compound, 949_idxfield_compound)
carry loud //ww:error reject rows a runtime @test cannot replicate and are
DEFERRED to a fold-3 value-split + reject-carrier pass (they stay fully in
$(TESTS), no coverage lost).

Bump LANGBYTEID_EXPECTED_MIN 34->35 to ratchet the new corpus floor.
2026-06-22 12:11:46 +09:00
a367bf984e test: migrate defdim len/cap family to test/lang @test, retire C twins (fold-2)
Continue fold-2: migrate drew's Family 2 (def-dimensioned array len/cap/slice
resolution) from bespoke build+run C twins to test/lang @test, retiring each
twin in the same commit. Runtime coverage MOVES from $(TESTS) to test-lang (T1
runs+asserts via `ww test`) + test-lang-byteid (T2 keeps cs==ww .s byte-id);
coverage is preserved, the $(TESTS) headline drops 3 (425->422). All asserts are
primitive int comparisons (no fmt/strconv in the assert path); the defcap rows
poison cap != len and assert both words so a dropped cap word FAILS.

  989_defdim_field_run.c    -> defdim_field_test.ww    (`.len` field-read on a def-dim [MAX]T resolves from the type table: local/let-global/def cgdot arms + sum)
  989_defdim_slice_run.c    -> defdim_slice_test.ww    (slicing a def-dim [MAX]T resolves len AND cap from the type table: default-hi + cgbasecap, local+global)
  989_defdim_argslice_run.c -> defdim_argslice_test.ww (def-dim slice passed as a call arg resolves default-hi len in the N_SLICE arg-push arms; litctrl pins the N_INTLIT path)

Bump LANGBYTEID_EXPECTED_MIN 31->34 to ratchet the new corpus floor.
2026-06-22 12:04:03 +09:00
438efab8c6 test: migrate str/slice global family-1 batch to test/lang @test, retire C twins (fold-2)
Continue fold-2 (after 374e97b): migrate the remaining Family-1 str/slice
global + literal + index + call-arg group from bespoke build+run C twins to
test/lang @test, retiring each twin in the same commit. Runtime coverage MOVES
from $(TESTS) to test-lang (T1 runs+asserts via `ww test`) + test-lang-byteid
(T2 keeps cs==ww .s byte-id); coverage is preserved, the $(TESTS) headline
drops 9 (434->425). All asserts are primitive int/u8/bool comparisons (no
fmt/strconv in the assert path); the slice-store/index rows reset the global
each fn and sum ADJACENT elements so a dropped/mis-strided/over-wide word FAILS.

  989_globslicefield_run.c    -> glob_slice_field_test.ww     (slice field of a global struct: g.f=<slice> stores full 24B header; len/cap/non-zero-offset + str/scalar controls)
  989_globstrslice_run.c      -> glob_str_slice_arg_test.ww   (global str sliced with default hi passed as call arg loads its len word; explicit-hi control)
  989_trystr_run.c            -> try_str_unwrap_test.ww       (`!` unwrap of str-success tagged union shuffles the str header for ident-source/error-first/success-first)
  797_len_strglobal_run.c     -> len_str_global_test.ww       (len(str-global) loads .len via name(SB); local-str control)
  801_litstr_pseudo_run.c     -> lit_str_pseudo_test.ww       (string-literal .len/.ptr pseudo-field; empty/multibyte + arg-passthrough)
  803_globalidx_run.c         -> global_index_test.ww         (global str/slice index read/addr-of/store/compound, esz 1/4; local regression pins)
  903_tuple_elem_slice_len.c  -> tuple_elem_slice_len_test.ww (len(t.N) of a slice/str tuple element loads .len at +8; 2/3-slice, str-slice both orders)
  927_composite_call_arg_run.c-> composite_call_arg_test.ww   (slice-returning CALL passed inline as a composite arg; canonical/letslice/two-call/middle/nested/scalar/tagged)
  952_slicecopy_assign_run.c  -> slice_copy_assign_test.ww    (bulk slice-copy-assign `arr[lo:hi]=bs`, esz 1/4, field/via-ptr/local bases; reslice-read companion)

rd_reslice asserts the TRUE value 360 (the .c twin's want=104 was 360 & 0xFF,
an exit-code truncation). 723_composite_call_arg.c's comment repointed to the
new test/lang location. 802_lenidx_run.c is DEFERRED (it carries //ww:error
reject rows — needs a value-rows-only split + a slim reject carrier, a fold-3
pass). Bump LANGBYTEID_EXPECTED_MIN 22->31 to ratchet the new corpus floor.
2026-06-22 11:52:41 +09:00
374e97b9e8 test: migrate str/slice header family-1 batch to test/lang @test, retire C twins (fold-2)
Migrate the slice/str-header core of drew's Family 1 from bespoke
build+run C twins to test/lang @test, retiring each now-redundant twin in
the same commit. Runtime coverage MOVES from $(TESTS) to test-lang (T1
runs+asserts via `ww test`) + test-lang-byteid (T2 keeps cs==ww .s
byte-id); coverage is preserved, the $(TESTS) headline drops 6 (440->434).
All asserts are primitive int/u8/bool comparisons (no fmt/strconv in the
assert path); the slice-store families poison the slot (cap!=len) and read
it back so a dropped data word FAILS.

  928_str_abi_run.c          -> str_abi_test.ww          (str 24B ABI: .len/.cap across literal/arg/return/field/tuple/deref/index/tagged)
  941_slice_store_cap_run.c  -> slice_store_cap_test.ww  (slice value store through indexed/field/chained lhs writes full 24B header; cap==8)
  942_subslice_cap_run.c     -> subslice_cap_test.ww     (sub-slice cap = base_cap-lo; array/slice/str/append-no-realloc/hi-default)
  943_subslice_ptresz_run.c  -> subslice_ptresz_test.ww  (sub-slice ptr advances lo*esz bytes; esz 2/4/8, let + call-arg)
  944_deref_slice_store_run.c-> deref_slice_store_test.ww(*p=sliceval whole-deref store writes 24B header; cap==8)
  949_f6_header_run.c        -> f6_header_test.ww        (str/slice header partial load/store; .cap/.len after clobber)

Bump LANGBYTEID_EXPECTED_MIN 16->22 to ratchet the new corpus floor.
2026-06-22 09:02:40 +09:00
f864e9f9bc test: retire 15 T2+T1-covered byte-id .c twins (fold-6 batch-1)
These test/wcc/*_run.c carriers were migrated to test/lang @test packages
(value-asserting under test-lang/T1) and now have a byte-id home under
test-lang-byteid/T2. With T1 wired into make test + test-commit (prior
commit), union(T1 runtime value-asserts + T2 .s byte-id) covers everything
each .c proved, so the C twins are pure-deletion redundant. Each retired
family below names the T1 twin that now carries its value obligation; every
twin was verified to READ the value/slot and ASSERT it (not merely compile),
including the pre-zeroed-slot families (it poisons cap!=len / spoils the base
so a wrong data word fails the read-back, which byte-id alone cannot catch).

  989_gunsigned_run            -> gunsigned_test (global unsigned opcode select)
  989_chainidx_run             -> chainidx_test (chained m[i][k] header load)
  989_idxarg_run               -> idxarg_test (indexed elem call-arg header push)
  906_callret_unsigned_arith   -> callret_unsigned_test (call-return unsigned arm)
  912_sar_shr_run              -> sar_shr_test (signed >> emits SAR)
  793_widen_pad_zero_run       -> widen_pad_test (#227 high-pad zeroing; reads pad)
  932_str_elem_cap_run         -> str_elem_cap_test (str-elem .cap full 24B load)
  957_size_type_run            -> size_type_test (`size` type-position bind)
  933_str_field_cap_run        -> str_field_cap_test (str field .cap read)
  934_str_chained_field_cap_run-> str_chained_field_cap_test (chained field .cap)
  935_str_tuple_elem_cap_run   -> str_tuple_elem_cap_test (tuple-elem str .cap)
  936_str_arrfield_cap_run     -> str_arrfield_cap_test (array-field str .cap)
  937_str_arrfield_store_cap_run  -> str_arrfield_store_cap_test (array-field store)
  938_str_chainfield_store_cap_run-> str_chainfield_store_cap_test (chain-field store)
  939_str_massign_store_cap_run   -> str_massign_store_cap_test (multi-assign store)

110_uniesc_run.c is KEPT: it carries a .wwi round-trip sep-build (exit 42)
the uniesc_test twin does not replicate (HAS-UNIQUE-MODE, deferred).
2026-06-22 08:37:57 +09:00
bb4ff6e27f make: wire test-lang (T1) into make test + test-commit
test-lang runs each test/lang/*_test.ww @test through the cstage ww
driver (the runtime value-assert leg, T1). It existed as a standalone
target but was not in any aggregate gate, so the pre-push gate carried
only test-lang-byteid (T2) for these families — and T2 is compile-only
(-c, .s byte-id), blind to a both-stages-wrong value. Wiring T1 in gives
make test and test-commit the runtime value coverage that the test/wcc
.c twins currently provide, the precondition for retiring those twins.

Kept out of test-unit (inner loop stays fast) and run-always in
test-commit (NOT in the content-key skip set — caching a value gate
reintroduces silent-skip-of-value). Isolated WW_PKGCACHE=$(OUT)/langcache
so concurrent make -j cannot corrupt the default cache.
2026-06-22 08:31:06 +09:00
f56b056ed3 make: add test-lang-byteid T2 cross-stage .s byte-id gate
Compiles every test/lang/*_test.ww twice through the same cstage ww
orchestrator swapping only the frontend (WW_W6C = w6c vs w6c_ww) and
asserts every per-package <pkg>.s (incl the synth-main __root.s) is
byte-identical. This is the rule-10 stage-symmetry gate test/runww.ww
reserves as T2. .s-only (Q3); .o/.wwi are 991/992's surface. Distinct
WW_PKGCACHE per leg, both caches+sepworks wiped per file. Recipe is
parameterized over an input-class (file-list + build-verb); only the
test/lang class ships now, fold-6 slots in build --sep for selfhost/data.
Wired into make test (pre-push) only, not test-commit/test-unit.
2026-06-22 07:56:20 +09:00