Skip to content

D108/D114 sweep (#2262 item 4): a .len() is an isize; the cast moves to the narrowing or goes away - #2346

Merged
ehartford merged 4 commits into
battery-guardfrom
len-sweep
Oct 11, 2026
Merged

ehartford merged 4 commits into
battery-guardfrom
len-sweep

Conversation

@ehartford

@ehartford ehartford commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Implements item 4 of #2262 (items 1–3 landed with #2327).

  • 5339 .len() as i32 sites stripped across src, lib/std (not the migrated corpora, D112), rt, tools, build/ and build.w. 803 casts remain, each at a genuine i32 demand (an i32 field, id, parameter or index width the D114 audit kept).
  • Where stripping exposed a real narrowing, the pinned seed and the installed compiler named it and the cast went back there: at the declaration when the local is a let or two or more uses narrow, at the use when one does.
  • docs/with-abi.sha256 re-recorded: the sweep touched src/TypeLayout.w with spelling only; WITH_ABI_VERSION unchanged.
  • Evidence: src/main check src/main.w and with check src/main.w clean, seed-driven :dev green, seed-driven :gate green (survey: all targets green, 884 s).

Stacked on #2345. Draft until the stack's battery is green.

Eric Hartford added 3 commits October 11, 2026 08:59
…t moves to the narrowing or goes away

4414 `.len() as i32` sites stripped in src/; the seed and the installed
compiler then named every real narrowing (an isize into an i32 field, index
id or parameter) and the cast went back there: at the declaration when two
or more uses narrow or the local is a let, at the use when one does. 738
casts remain in src/, each at a genuine i32 demand. Both compilers check
src/main.w clean.
…same rule as src/

925 sites stripped; the narrowings the seed and the installed compiler named
got their cast back at the declaration or the use. The migrated corpora are
untouched (D112). Every touched tools and std file checks clean; build.w
checks clean under the pinned seed and the installed compiler.
…ng only, no convention change; WITH_ABI_VERSION unchanged)
@ehartford
ehartford added this pull request to stack #2347 October 11, 2026 16:45
@ehartford ehartford changed the title len sweep D108/D114 sweep (#2262 item 4): a .len() is an isize; the cast moves to the narrowing or goes away Oct 11, 2026
…(MirValidationTests, foundation/Arena, InternPool, Source) get the same rule

The battery's one red: these four are not reachable from src/main.w, so the
check loop never saw their narrowings. Casts restored at the i32 demands;
out/bootstrap/bin/with-stage1 test test/internals: 70 files ok.
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery green on stack #2347 top 43f4ffdfe (len-sweep, 2026-10-11, seed-driven with run tools/battery.w: gate, uat, battery-checks all green; out/battery/status.txt: green). Battery 1 on d695b0e was red on internals-tests only, fixed in 43f4ffd.

@ehartford
ehartford marked this pull request as ready for review October 11, 2026 17:58
@ehartford
ehartford merged commit 14a720b into main Oct 11, 2026
@ehartford
ehartford deleted the len-sweep branch October 11, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant