Skip to content

D120 stage 6: sweep ceremonial .clone() on values and add CoW value list benchmarks (#2304) - #2446

Merged
ehartford merged 1 commit into
mainfrom
d120-cow6
Oct 18, 2026
Merged

ehartford merged 1 commit into
mainfrom
d120-cow6

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Completes Stage 6 of D120 (docs/proposals/d120-implementation-plan.md, #2304):

  • Sweeps ceremonial .clone() calls across src/compiler/, lib/std/collections.w, lib/std/compiler.w, and tools/ (clone-call in lib 4 -> 2, src 34 -> 17, tools 11 -> 5; move-arg in tools 5 -> 3).
  • Outlines LIST_MAKE_UNIQUE, MAP_MAKE_UNIQUE, and List/HashMap struct-field drops into per-type helpers (ensure_list_make_unique_fn, ensure_map_make_unique_fn, ensure_structural_drop_fn) in src/CodegenDispatch.w and skips non-drop fields before wl_build_struct_gep (:stage2 peak RSS 1,971 MB).
  • Fixes materialize_tail_view_for_owned_demand in src/MirLower.w so contextual-copy view tails of non-drop Copy types (xs[n - 1]) materialize before block scope-exit drops, and extends validate_read_after_drop in src/MirCore.w to track single-assignment RK_REF/RK_USE reference temporaries.
  • Adds test/benchmark/cow_value_lists.w microbenchmarks:
    • field-push: 3 ns/op (200,000 ops)
    • param-element-write: <1 ns/op (400,000 ops)
    • share-then-mutate (256): 452 ns/op (10,000 ops)

…ist benchmarks (#2304)

- Sweep ceremonial .clone() calls on values across src/compiler/,
  lib/std/collections.w, lib/std/compiler.w, tools/pub_lint.w, and
  tools/migrate_diff.w while keeping src/ compatible with the pinned
  pre-D120 seed.
- Add the three D120 microbenchmarks (field-push, param-element-write,
  share-then-mutate) in test/benchmark/cow_value_lists.w.
- Mark D120 and docs/proposals/d120-implementation-plan.md compliant.
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