wcc_ww: c1 collapse plain TY_NAMED chase loops into tichase across cgenstmt/cgen/check — byte-id neutral

F2a batch-4 c1, mechanical, per rob's spec census (re-verified at
4adf914; check.ww/cgenstmt.ww cites were stable as predicted, the
two cgenutil [B3-SHIFT] cites moved +8: :2746->:2754, :2895->:2903).

42 conversions, every site eyes-classified plain nil+NAMED:
- cgenstmt.ww 26: one-line :149 :325 :352 :532 :551 :594 :715 :732
  :938 :940 :1577 :1629 :1782 :2230 :2575 :3372 :3678 + multi-line
  :986 :1912 :2287 :2291 :2702 :2759 :2823 :3037 :3715 (all plain,
  no extra guards).
- cgen.ww 13: one-line :1505 :1541 :1658 :1691 :1697 :1947 :1951
  :2065 :2109 :2118 + multi-line :2239 :2648 :2663 (incl. the
  emitdefconstants struct/array arms — plain).
- check.ww 3: :1627 tupleelemslot, :1673 fieldslotsize, :4111 arrlit
  elem chase; WHY comments kept. tichase visibility verified: same
  `package wcc` (cgenstmt/cgen already call it) — no second helper.

Survivors (classified, untouched):
- cgenutil.ww :1301 tichase's own body (the accessor) + :2754
  nullableptrtag single peel (batch-2 c3-B2 PROBE-CLEARED, 018ef66 —
  peel-ok annotation added this commit, cites the banked record; cs
  twin cmd/w6c/cgen.c:747 verified at this SHA) + :2903
  flatvariantidxt pass-2 guard (batch-4 c2's site).
- check.ww :1765 comment + :1805 construction write (peellint-ok
  annotation added — the one WRITE building the NAMED link) + :2038
  spread peel (c3-B1) + :2273/:2275 &len/cap hand-walk (c3-B2) +
  :3666 comment FALSE POSITIVE ("io.underread" matches `.under`).
- cgenexpr.ww :2886 comment only.

Lint note for the peellint finale: the `.under` token-match must be
token-bounded — check.ww:3666's "io.underread" is a comment
false-positive at a non-boundary match.

Behavior sites (:2038, :2273/:2275, :2903) and #80's site excluded
per spec — they ride c2-c4.

Byte-neutral proof: rebuilt w6c_ww on the five BASE main.combined.ww
inputs -> all five .s byte-identical to the base build's outputs;
cs==ww byte-id holds on the five REGENERATED combineds; test-unit
290 green. w6c_ww + wwdump combined.ww regens ride along.
This commit is contained in:
2026-06-05 23:58:54 +09:00
parent 4adf914f2f
commit b26b3dbdc5
6 changed files with 147 additions and 198 deletions

View File

@@ -1624,7 +1624,7 @@ fn tupleelemslot(pt: *tinfo) u64 = {
// now fires on aliased operands; byte-id holds because it collapses
// NAMED to the alias-invariant underlying this read consumes.
let t: *tinfo = pt;
for (t != nil && t.kind == tykind.TY_NAMED) { t = t.under; };
t = tichase(t);
if (t == nil) { return 8u64; };
let pk: tykind = t.kind;
if (pk == tykind.TY_VOID) { return 0u64; };
@@ -1670,7 +1670,7 @@ fn fieldslotsize(ft: *tinfo) u64 = {
// now fires on aliased operands; byte-id holds because it collapses
// NAMED to the alias-invariant underlying this read consumes.
let t: *tinfo = ft;
for (t != nil && t.kind == tykind.TY_NAMED) { t = t.under; };
t = tichase(t);
if (t == nil) { return 8u64; };
let fk: tykind = t.kind;
if (fk == tykind.TY_STRUCT) { return t.slotsize; };
@@ -1802,6 +1802,9 @@ fn tinfofornode(c: *checker, n: *node) *tinfo = {
under = c.tc.tyerr;
};
named.resolving = 0;
// peellint-ok: construction — the one
// WRITE that builds the NAMED link;
// not a peel, can't route via tichase.
named.under = under;
if (under != nil) {
named.size = under.size;
@@ -4108,7 +4111,7 @@ fn checkarrlitfits(c: *checker, arrtn: *node, rhs: *node) void = {
let at: *tinfo = tinfofornode(c, arrtn);
let et: *tinfo = nil;
if (at != nil) { et = at.sub; };
for (et != nil && et.kind == tykind.TY_NAMED) { et = et.under; };
et = tichase(et);
let e: *node = rhs.list;
for (e != nil) {
let skip: bool = false;