Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #498 +/- ##
=======================================
Coverage 99.9% 100.0%
=======================================
Files 336 337 +1
Lines 24829 25213 +384
=======================================
+ Hits 24818 25213 +395
+ Misses 11 0 -11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR is a follow-up set of changes in multitude aimed at improving allocation throughput and strengthening chunk lifecycle correctness, while expanding runtime accounting and updating tests/benches/docs to reflect the new behaviors.
Changes:
- Reworked shared-chunk refcounting (pre-credited surplus + local counter reconciliation) and hardened shared/local chunk lifecycle + freelist linkage.
- Refactored hot allocation paths to reduce per-iteration overhead (precomputed sizes, cold-path extraction, len==0 fast paths, fewer overflow checks in tight loops).
- Updated
Vecfreezing APIs (into_arc/into_boxrenames, plus newinto_slice/into_slice_mut) and adjusted tests/benchmarks/perf reporting accordingly.
Reviewed changes
Copilot reviewed 50 out of 50 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/multitude/tests/utf16.rs | Renames a test to match updated Vec/freeze naming. |
| crates/multitude/tests/mutants_extras.rs | Updates mutant-kill tests and comments for renamed/changed freeze APIs. |
| crates/multitude/tests/mutant_kills_post_fix.rs | Removes stats byte-count mutant-kill tests aligned with new stats semantics. |
| crates/multitude/tests/mutant_kills_more.rs | Narrows mutant-kill scope now that stats byte-count recording is removed. |
| crates/multitude/tests/dst.rs | Updates into_* calls and related commentary to into_box. |
| crates/multitude/tests/coverage_gaps.rs | Renames try_into_* coverage module/tests to try_into_arc. |
| crates/multitude/tests/coverage_extras.rs | Updates coverage tests for into_arc/into_box naming. |
| crates/multitude/tests/bolero.rs | Updates lifecycle fuzz tests to use into_arc/into_box; adjusts stats assertions. |
| crates/multitude/tests/audit_repro.rs | Adds regression test for ZST shared handouts advancing cursor (audit finding). |
| crates/multitude/tests/arena.rs | Updates a stats/mutant test to use into_box. |
| crates/multitude/tests/arena_vec.rs | Adds stats regression test for releasing retired oversized chunks on growth. |
| crates/multitude/tests/alloc_ref.rs | Replaces/expands stats tests to validate live wasted_tail_bytes behavior. |
| crates/multitude/src/vec/mutate.rs | Minor doc tweak related to shrink_to_fit arithmetic helper. |
| crates/multitude/src/vec/mod.rs | Updates module docs for new into_arc/into_box names; grow path releases retired oversized chunks. |
| crates/multitude/src/vec/freeze.rs | Renames freeze APIs and adds into_slice/into_slice_mut for O(1) arena-tied freezing. |
| crates/multitude/src/vec/basic.rs | Optimizes extend_from_slice capacity check to avoid hot-path overflow guards. |
| crates/multitude/src/strings/utf16_string.rs | Simplifies imports/paths and uses Vec/FromIteratorIn re-exports consistently. |
| crates/multitude/src/strings/string.rs | Same as above for UTF-8 String builder. |
| crates/multitude/src/lib.rs | Updates top-level docs for renamed freeze APIs and updated usage wording. |
| crates/multitude/src/internal/uninit.rs | Minor formatting cleanup. |
| crates/multitude/src/internal/shared_chunk.rs | Moves cache freelist link into header, adds wasted-tail retire tracking, and adds ref surplus helpers. |
| crates/multitude/src/internal/local_chunk.rs | Adds unified intrusive next link, wasted-tail retire tracking, and payload-contains helper. |
| crates/multitude/src/internal/drop_entry.rs | Fixes drop-entry placement for unaligned payload starts; adds regression test. |
| crates/multitude/src/internal/chunk_provider.rs | Adds live counters (bytes outstanding, wasted tail), alignment slack for oversized payloads, and updates cache linkage. |
| crates/multitude/src/internal/chunk_ops.rs | Adds stats retire accounting hook for chunk mutator drop/forget paths. |
| crates/multitude/src/internal/chunk_mutator.rs | Refactors payload range math, adds wasted-tail computation, and de-duplicates prefixed-slice allocation internals. |
| crates/multitude/src/internal/chunk_alloc.rs | Pads DST allocation layout to alignment to avoid UB when forming fat references. |
| crates/multitude/src/internal/arena_buf.rs | Removes empty-slice early return; relies on well-defined zero-length memcpy. |
| crates/multitude/src/arena/retired_local.rs | Introduces intrusive retired-local-chunk list replacing Vec<ChunkMutator<...>>. |
| crates/multitude/src/arena/reserve.rs | Adds “with precomputed size” reserve helpers for hot slice-copy paths. |
| crates/multitude/src/arena/mod.rs | Adds shared ref surplus tracking, retired-local list integration, and updated stats aggregation. |
| crates/multitude/src/arena/alloc_value.rs | Extracts cold oversized paths; adds ZST shared-handout cursor-advance guard; integrates new shared-ref acquisition. |
| crates/multitude/src/arena/alloc_utf16.rs | Adjusts utf16 alloc APIs to use new shared-ref acquisition and import paths. |
| crates/multitude/src/arena/alloc_unsized.rs | Uses new shared-ref acquisition for DST allocations; removes old stats byte accounting. |
| crates/multitude/src/arena/alloc_str.rs | Removes old stats byte accounting on string alloc paths. |
| crates/multitude/src/arena/alloc_slice_ref.rs | Adds len==0 fast paths + precomputed-size helpers; extracts cold oversized/callsite-spill avoidance. |
| crates/multitude/src/arena/alloc_slice_box.rs | Hoists payload byte computations; uses new shared-slice reserve-with-size helper. |
| crates/multitude/src/arena/alloc_slice_arc.rs | Same as above for Arc<[T]> slice allocations. |
| crates/multitude/src/arena/alloc_prefixed.rs | Uses new shared-ref acquisition; minor cleanup of DropEntry size/align usage. |
| crates/multitude/src/arena_stats.rs | Updates high-level docs to reflect which fields are live gauges vs lifetime counters. |
| crates/multitude/src/arc.rs | Updates From<Vec> conversion to use into_arc. |
| crates/multitude/src/allocator_impl.rs | Uses new shared-ref acquisition for allocator-API2 bridge allocations. |
| crates/multitude/scripts/perf_report.rs | Renames benchmark identifiers/groups for consistency with updated benches. |
| crates/multitude/README.md | Regenerates crate README to reflect renamed APIs and updated perf naming. |
| crates/multitude/examples/multitude_basic.rs | Updates example to use into_arc. |
| crates/multitude/docs/TODO.md | Removes now-obsolete TODO list after landing the described items. |
| crates/multitude/docs/PERF.md | Updates published perf table entries/names for the new benchmark identifiers. |
| crates/multitude/benches/gungraun_drop/linux.rs | Renames drop benchmarks to match perf-report naming. |
| crates/multitude/benches/gungraun_alloc/linux.rs | Updates bench names and reduces unnecessary black_box(&x) patterns; uses into_slice_mut for vec benches. |
| crates/multitude/benches/criterion_alloc.rs | Splits warm_arena into local/shared variants to avoid dead-weight chunk priming; updates vec/string freeze benches. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
72d55ab to
505a8c1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 59 out of 59 changed files in this pull request and generated 9 comments.
Comments suppressed due to low confidence (1)
crates/multitude/src/lib.rs:270
- The crate-level docs still claim the UTF-16 builder freeze is O(1) and “reuses the buffer in place”, but
Utf16String::into_boxnow delegates toArena::alloc_utf16_str_box(...), which copies into a fresh shared allocation (O(n)). This is user-facing and will mislead performance expectations.
…ycle Follow-up to the multitude rewrite focused on allocation throughput, memory-safety hardening, and richer runtime accounting.
Follow-up to the multitude rewrite focused on allocation throughput, memory-safety hardening, and richer runtime accounting.