Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens multitude’s chunk layout and concurrency guarantees by moving the backing allocator into a shared Arc<A> in chunk metadata, preventing allocator state from inflating the chunk header past the first 64 KiB tile (which smart-pointer header recovery relies on). It also fixes a ZST-specific Drain drop edge case, expands safety documentation for assume_init, and rewrites docs/DESIGN.md into a higher-level architecture and invariants overview.
Changes:
- Store the backing allocator as
Arc<A>inChunk/ChunkProviderand tightenSend/Syncbounds to requireA: Send + Syncwhere cross-thread chunk teardown is possible. - Fix
Drain’s drop path for zero-sized types by avoidingoffset_fromon dangling ZST pointers; add regression test coverage. - Add tests reproducing the “large allocator state displaces header” issue and expand
assume_initdocumentation; rewrite DESIGN documentation.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/multitude/tests/send_sync.rs | Adds a regression test ensuring Arena<A> is not Send when A is !Sync. |
| crates/multitude/tests/audit_repro.rs | Adds a large-allocator-state regression test ensuring smart pointers remain valid after arena drop. |
| crates/multitude/tests/arena_vec.rs | Adds a test ensuring ZST drain(..) drop restores tail and runs drops correctly. |
| crates/multitude/src/vec/drain.rs | Fixes ZST Drain drop behavior by avoiding pointer offset computation for ZSTs. |
| crates/multitude/src/rc.rs | Documents assume_init clone/leak footgun for Rc<MaybeUninit<...>>. |
| crates/multitude/src/internal/chunk.rs | Stores allocator as Arc<A>, updates alignment/header computations and related tests. |
| crates/multitude/src/internal/chunk_provider.rs | Stores allocator as Arc<A> and tightens Send/Sync impl bounds to A: Send + Sync. |
| crates/multitude/src/internal/chunk_mutator.rs | Tightens Send impl bound to A: Send + Sync to match allocator sharing semantics. |
| crates/multitude/src/arena/retired_local.rs | Tightens Send impl bound to A: Send + Sync for moved arenas with pinned chunks. |
| crates/multitude/src/arena/mod.rs | Updates Arena: Send rationale to reflect A: Send + Sync requirement. |
| crates/multitude/src/arc.rs | Documents assume_init clone/leak footgun for Arc<MaybeUninit<...>>. |
| crates/multitude/docs/DESIGN.md | Rewrites internal design doc into an architecture overview with invariants, failure modes, and concurrency model. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
✅ Version increments look sufficient
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #587 +/- ##
=========================================
Coverage 100.0% 100.0%
=========================================
Files 359 375 +16
Lines 27885 30664 +2779
=========================================
+ Hits 27885 30664 +2779
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 90 out of 92 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
crates/multitude_macros/README.md:2
- README references
./logo.png, but no such file exists in this crate, so the header image will be broken on GitHub/crates.io/docs.rs renders. Either add the image (non-LFS, included in the published crate) or point this to an existing asset (e.g. the repo-levellogo.svg).
crates/multitude_macros_impl/README.md:2 - README references
./logo.png, but no such file exists in this crate, so the header image will be broken on GitHub/crates.io/docs.rs renders. Either add the image (non-LFS, included in the published crate) or point this to an existing asset (e.g. the repo-levellogo.svg).
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 90 out of 92 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
crates/multitude_macros/README.md:2
- README references
./logo.png, but that file is not present in this crate directory, so the image will render as a broken link. Either add the missing asset or point to an existing logo file in the repo.
crates/multitude_macros_impl/README.md:2 - README references
./logo.png, but that file is not present in this crate directory, so the image will render as a broken link. Either add the missing asset or point to an existing logo file in the repo.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 90 out of 92 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
crates/multitude_macros/README.md:3
- This README references local assets (
./logo.pngand../../logo.svg). The workspace packaging allowlist (workspace.package include) does not include images or repo-root assets likelogo.svg, so these links will be broken on crates.io/docs.rs. Prefer absolute URLs for badges/logos (also aligns with the packaging guideline to reference binary assets by URL).
crates/multitude_macros_impl/README.md:3 - This README references local assets (
./logo.pngand../../logo.svg). The workspace packaging allowlist (workspace.package include) does not include images or repo-root assets likelogo.svg, so these links will be broken on crates.io/docs.rs. Prefer absolute URLs for badges/logos (also aligns with the packaging guideline to reference binary assets by URL).
Add allocator-backed deserialization traits, derive support, recursive containers, dynamic values, reuse, limits, and JSON helpers. Harden chunk ownership and thread-safety, fix ZST drain and Rc overflow handling, and align benchmarks and reporting with bumpalo.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 90 out of 92 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
crates/multitude_macros/README.md:2
- The README references
./logo.png, butcrates/multitude_macros/logo.pngis not present in the repo, so the image will be broken anywhere the README is rendered. Add the expectedlogo.png(matching other crates’ README template) or adjust the README/template to point at an existing asset.
crates/multitude_macros_impl/README.md:2 - The README references
./logo.png, butcrates/multitude_macros_impl/logo.pngis not present in the repo, so the image will be broken anywhere the README is rendered. Add the expectedlogo.png(matching other crates’ README template) or adjust the README/template to point at an existing asset.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: fa351567-09e0-4465-939b-b07b1a8ca841
Summary
Send/Syncbounds, and fix ZST drain andRcoverflow handling.bumpalo, add representative Serde benchmarks and examples, and refresh architecture and performance documentation.Validation