Repository navigation
D100: the pub sweep over src/ (#2211) - #2463
Merged
Merged
Conversation
… outside the package uses (#2211) tools/pub_lint.w --apply over src/main.w: every reported pub removed by byte edit at the declaration the analyze facts name. The 21 residual findings were generated Embedded*Data modules; their generators (build/runtime.w, build/clang_resource.w) no longer emit pub, so the report now reads 0 of 10,868 declarations and a re-run is idempotent. lib/std is untouched: its pub is its API to consumers outside this compilation. Cross-package keeps verified by checking the eight tools that import compiler modules (all ok) before the gate.
Contributor
Author
|
Battery green on 6f88cee: |
ehartford
marked this pull request as ready for review
October 19, 2026 05:26
This was referenced Oct 19, 2026
ehartford
pushed a commit
that referenced
this pull request
Oct 21, 2026
…#2211) #2463 swept src/ of the 1,763 `pub` the compiler proved nothing outside the package uses; the lint re-run over current main reports 0 of 11,077 declarations. Nothing kept it that way: `pub-lint-check` runs `tools/pub_lint.w src/main.w` with the release compiler (224 s, 3.1 GB: battery-checks, not the gate) and fails on any reported `pub`, naming the `--apply` that removes it. The D100 record gains its status: lib/std is not swept, by ruling (Eric, 2026-10-19) — its `pub` is its API to consumers outside the compilation.
ehartford
added a commit
that referenced
this pull request
Oct 21, 2026
…#2211) (#2501) #2463 swept src/ of the 1,763 `pub` the compiler proved nothing outside the package uses; the lint re-run over current main reports 0 of 11,077 declarations. Nothing kept it that way: `pub-lint-check` runs `tools/pub_lint.w src/main.w` with the release compiler (224 s, 3.1 GB: battery-checks, not the gate) and fails on any reported `pub`, naming the `--apply` that removes it. The D100 record gains its status: lib/std is not swept, by ruling (Eric, 2026-10-19) — its `pub` is its API to consumers outside the compilation. Co-authored-by: Eric Hartford <[email protected]>
ehartford
added a commit
that referenced
this pull request
Oct 29, 2026
* codegen: an element `++` copies takes its copy glue, not only a str's retain (D111) `a ++ a` over a List[List[str]] appended the inner Lists by their bits: two holders of each inner buffer with no count, freed twice (debug allocator: DOUBLE FREE origin=List, first and second drop both __drop_struct_760). mir_emit_list_extend_from now runs the element copy glue over the appended range when the element has glue and is not a str (the runtime's extend retains strs). * emit-c: the C backend runs destructors and takes holds (#983) The C backend emitted every drop as a comment, copied every value by its bits and never blanked a move's source, so a C program ran no Drop impl and freed nothing. It now follows the LLVM backend shape for shape: - per-type drop and copy glue (__with_drop_<tid>, __with_copy_<tid>), declared before every body: a type's Drop impl then its fields in reverse, an enum's live payloads, Box, Rc/Arc, List, HashMap/HashSet, SlotMap, channel endpoints, closure cells; members guarded by the reset-on-move sentinel (§2.5.1) - `drop(place)` and DropAndGoto call the glue, guarded when the local was ever moved (§2.5.2); the reset blank is a memset (padding included) - MIR's operand holds (D111): a retained copy takes the copy glue, a taken copy hands the value over and blanks the source - a Drop.drop receiver is the owner's place (FnAbi owned_place) - a struct's hidden liveness byte is set when it is built (D72) - make-unique copies take element glue (D120); clear, an overwriting insert, map remove and clear, ListSlot set drop what they end; ListSlot get and a map slot read take a hold; `++` holds its elements Found on the way: List.remove's result was never written (typed as returning nothing), `a ++ b`'s result was never stored, and the map slot read's dead-slot panic was overwritten by the read. The emit-C harness runs a fixture with an `//! expect-debug-alloc:` line under the debug allocator; six new fixtures do, each at leak count=0. Fixes #983 * emit-c: Atomic.new builds the cell, typed by its destination The C backend had no lowering for the generic `new` an `Atomic.new(v)` call is, and typed its result by another type's `new` (StringBuilder). #985 made std.random's state an Atomic in a global's initializer, so emit-c-test (the compiler emitted as C) stopped emitting: "emit-c does not support generic intrinsic new" in __with_init_global_rng_state. * emit-c: a map key that is not its bytes hashes and compares by its parts (#2180) The C backend refused every map key but an integer, a bool, a pointer and a str, so the compiler itself could not be emitted (Sema keeps a HashMap[(i32, i32), _]). Per key type it now generates the hash and the equality the runtime map calls (with_hashmap_new_keyed kind 2), part by part in the LLVM backend's order (mir_emit_hash_ptrs, mir_emit_eq_ptrs): tuples, arrays, structs, enums and Options by variant, Lists, Boxes, str; a type with its own eq (derived or written) compares by it. A key projection is refused, not compared by its parts. The glue's two `insert(…, name)` then `name` sites are routed through an observing helper, seed-bound: every pinned seed returns the blank a last-use take left (fixed in this stack's MIR layer). * emit-c-test: the bridges declare no public C ABI since D100; that is not a failure The stub generator scanned LlvmBridge.w and ClangBridge.w for `pub fn wl_*` and failed with "found no bridge exports" when there were none. The D100 pub sweep (#2463) made every bridge function package-internal: the emitted unit defines each wl_* itself. The scan now reports whether it read and parsed every source, apart from what it found, and an empty list writes a header and stubs that declare nothing. --------- Co-authored-by: Eric Hartford <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Runs
tools/pub_lint.w --applyoversrc/main.w: 1,763pubremovals across 109 files, each a byte edit at the declaration thewith analyzefacts name — a pub declaration nothing outside the program package references (D100: pub is what another package needs).The 21 residual findings were generated
Embedded*Datamodules; their generators (build/runtime.w,build/clang_resource.w) no longer emitpub, so a re-run reports 0 of 10,868 declarations and is idempotent.docs/with-abi.sha256is re-recorded because the sweep touchedsrc/FnAbi.w/src/TypeLayout.wtext (verified pub-only diff; the convention is unchanged, so no ABI version bump). Every .wo rebuilds once under the new hash.lib/stdis untouched by ruling: its pub is its API to consumers outside this compilation.Evidence:
:devgreen before/after, the eight tools that import compiler modules all check, ceremony census diff ok,:gaterc=0 green (first run caught the abi-hash re-record, the only root). Battery result posted before ready.