Repository navigation
#2942, #2939: the str .clone() and the explicit &x at a &T parameter go (2233 sites, census-driven) - #3027
Conversation
|
The first gate run was red only at |
6d26d3c to
106e36c
Compare
|
Battery red on |
106e36c to
260b752
Compare
D111: a str is a value; passing one copies (a count increment) and code using str never needs `.clone()`. The compiler and lib/std still spelled it. `tools/strip_census_sites.w` applies a rewrite at the sites the ceremony census lists (`--sites str-clone`, Sema-backed, never a regex): for str-clone it drops the trailing `.clone()`; it also knows ref-at-ref-param (drops a leading `&` at a `&T` parameter) for the next sweep. 483 sites in 50 files rewritten; the census' clone-call count in src falls 544 → 64. Seven sites keep their `.clone()`: an unannotated let of a str field or record field binds a view of the place (MIR alias-binds it), and a str global read in value position is refused as a move, so removing the clone fails to compile. That is one D111 gap, filed as #3026 with the sites; its fix is its own layer, after which the seven are re-swept.
…ameter goes (1757 sites)
§3.8: `peek(x)` where `peek` takes `&T` auto-references; the written `&`
teaches the idiom the mission says is wrong. `tools/strip_census_sites.w
ref-at-ref-param` drops the leading `&` at every site the census lists
(Sema-backed: an explicit `&x` at a `&T` parameter), 1754 by the tool
and three in lib/std/regex.w by line (the embedded copy's byte offsets
differ from the file's for those).
Two sites keep the `&`: `&List.new()` passed to a `&List[T]` parameter
(RecipeInterp.w, CodegenDispatch.w). The written `&` is what lets the
untyped empty literal take the parameter's element type; auto-ref of
the bare temporary is refused ("argument has type List, expects
&List[PyVal]"). Either the census pattern should skip a `&` on an
untyped literal, or auto-ref should infer the literal from the
parameter as `&` does.
…s own text_refs count owns it, not the str's holder count
…me symbols are module-mangled on the release binary); the trap pair needs equal env sets and WITH_BUILD_JOBS=1 for a parallel program
260b752 to
356ce1e
Compare
|
Seed-driven battery GREEN on `356ce1e3c` (rebased onto `main` `32b608a64`), wall 313s; UAT 12 pass / 1 skip (`raylib_spiral_windows`), `raylib_spiral` and `sdl` both green. Note: the 6 non-`ComptimeValue` str `.clone()` sites in `src/` (#3026 shape) stay seed-bound until a post-#3028 seed is pinned (the pinned seed compiles `src/` and refuses str global reads / unannotated str field lets before #3028). |
Two mechanical ceremony sweeps from the 2026-11-02 audit, each driven by the census's Sema-backed site listing (
with run tools/ceremony_census.w --sites PATTERN) through the newtools/strip_census_sites.w, never by a regex.#2942, str-clone (layer 1). D111: a str is a value; code using str never needs
.clone(). 476 of the 483 sites rewritten (50 files); the census's lexicalclone-callcount in src falls 544 → 64. Seven sites keep.clone()and are one D111 gap, filed as #3026: an unannotatedletof a str field (or a local record's str field) binds a view of the place (field_let_binds_as_view; MIR alias-binds it), so a laterselfmutation or a consume of the record is refused, and a str global read in value position is refused as "cannot move out of global". Its fix is its own layer (a str placelettakes the str by the annotated form's copy path;reject_move_out_of_globalexempts str); the seven are re-swept after.#2939, ref-at-ref-param (layer 2). §3.8 auto-references at a
&Tparameter. 1757 sites: 1754 by the tool, three inlib/std/regex.wby line (the embedded copy's byte offsets differ from the file's there). Two keep the&:&List.new()passed to a&List[T]parameter, where the written&is what lets the untyped empty literal take the parameter's element type (auto-ref of the bare temporary is refused "argument has type List, expects &List[PyVal]"). Either the census should skip a&on an untyped literal or auto-ref should infer the literal from the parameter as&does; your call which.Iterate tier: the swept tree builds (
:dev), a behavior smoke passes, census diff ok at each layer. No fixtures of their own: a sweep changes no behavior, and the gate plus battery are the proof. Draft until the battery is green.