Conversation
geeknoid
commented
Jul 17, 2026
- Onboard bytesbuf and layered to plurality
✅ Version increments look sufficient
|
There was a problem hiding this comment.
Pull request overview
This PR extends the plurality pooled-handle model to support type erasure to unsized types (dyn Trait and slices) for owning/shared handles, and migrates consumers (notably bytesbuf and layered) away from infinity_pool to plurality.
Changes:
- Add DST/type-erasure support for
plurality::Box,plurality::Arc, andplurality::Rcviaunsize::Coercion, including erased reclaim logic in the pool. - Expand correctness + fuzz/property + allocation-tracking tests, plus new benchmark coverage for fat-pointer owning handles.
- Migrate downstream crates to use
pluralityinstead ofinfinity_pool, and update supporting docs/scripts/CI helpers.
Reviewed changes
Copilot reviewed 40 out of 42 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| justfiles/extended.just | Ensure Loom runs with the loom feature enabled when executing loom_*.rs tests. |
| crates/plurality/tests/unsize.rs | New integration tests covering Box/Arc/Rc unsizing to trait objects/slices and drop/reclaim behavior. |
| crates/plurality/tests/smart_ptr.rs | Extend smart-pointer behavior assertions (ordering/hash set semantics). |
| crates/plurality/tests/pool.rs | Add regression test coverage for panicking destructors returning slots. |
| crates/plurality/tests/loom_pool.rs | Update Loom test invocation docs to match new test target/feature usage. |
| crates/plurality/tests/box.rs | Add into_raw/from_raw round-trip tests for pooled Box. |
| crates/plurality/tests/bolero_pool.rs | New Bolero property/fuzz test for core pool invariants. |
| crates/plurality/tests/alloc.rs | Add regression test for panicking destructors returning local slots. |
| crates/plurality/tests/alloc_tracking.rs | Add allocation-tracking assertions for the new dyn-box benchmark bodies. |
| crates/plurality/src/sync.rs | Make Arc<T> support T: ?Sized and add Arc::unsize; use erased drop/reclaim. |
| crates/plurality/src/slot.rs | Add MAX_POOL_SLOTS cap helper and clarify refcount/free-link semantics. |
| crates/plurality/src/rc.rs | Make Rc<T> support T: ?Sized and add Rc::unsize; refcount via erased offsets. |
| crates/plurality/src/pool.rs | Introduce PoolCore for erased teardown; implement erased reclaim from value ptr + size/align. |
| crates/plurality/src/lib.rs | Document type erasure and re-export unsize::Coercion from the crate API. |
| crates/plurality/src/common.rs | Add shared impl macros for T: ?Sized handles and update handle-layout docs. |
| crates/plurality/src/chunk.rs | Remove type parameters from ChunkHeader and related layout/addressing helpers. |
| crates/plurality/src/builder.rs | Build PoolCore with a concrete teardown callback; validate caps via MAX_POOL_SLOTS. |
| crates/plurality/src/boxed.rs | Make Box<T> support T: ?Sized, add Box::unsize + into_raw/from_raw, and erased drop path. |
| crates/plurality/src/alloced.rs | Update Alloc drop path to new local-free API shape. |
| crates/plurality/scripts/perf_report.rs | Extend PERF report generation to include dyn-box benchmarks and ratio formatting. |
| crates/plurality/scripts/correctness.rs | Update correctness harness to new Loom/Bolero test target names and flags. |
| crates/plurality/README.md | Regenerate crate README with new type-erasure API docs and links. |
| crates/plurality/docs/PERF.md | Update published performance report with new operations + dyn-box comparison section. |
| crates/plurality/docs/DESIGN.md | Update design doc to reflect erased handles, PoolCore, and new recovery strategy. |
| crates/plurality/Cargo.toml | Bump version; add unsize dep; add dyn-box benches; rename loom test target; move dev-deps. |
| crates/plurality/benches/shared/ops.rs | Add Marker trait and unsize operations used by alloc benchmarks. |
| crates/plurality/benches/shared/dyn_box_ops.rs | New shared bodies for fat-pointer owning-handle cross-crate comparison. |
| crates/plurality/benches/gungraun_dyn_box/main.rs | New Callgrind bench harness for dyn-box comparison. |
| crates/plurality/benches/gungraun_dyn_box/linux.rs | Linux implementation of dyn-box Callgrind benches. |
| crates/plurality/benches/gungraun_alloc/linux.rs | Add box_unsize/arc_unsize to alloc Callgrind suite. |
| crates/plurality/benches/criterion_dyn_box.rs | New wall-clock criterion benches for dyn-box comparison. |
| crates/plurality/benches/criterion_alloc.rs | Add box_unsize/arc_unsize to criterion allocation suite. |
| crates/layered/src/dynamic.rs | Switch dynamic-service implementation from infinity_pool to plurality with boxed DST handles. |
| crates/layered/Cargo.toml | Replace infinity_pool feature/deps with optional plurality. |
| crates/fetch/Cargo.toml | Formatting-only update to native-tls feature list. |
| crates/data_privacy_macros_impl/Cargo.toml | Formatting-only update to allowed external types list. |
| crates/bytesbuf/src/mem/global.rs | Replace raw infinity_pool block pooling with plurality, using raw-handle escape for self-handle. |
| crates/bytesbuf/Cargo.toml | Replace infinity_pool dependency with plurality. |
| crates/bytesbuf_io/Cargo.toml | Formatting-only update to categories. |
| Cargo.toml | Bump plurality workspace dependency version and add unsize workspace dependency. |
| Cargo.lock | Lockfile updates for plurality 0.1.1 and new unsize dependency usage. |
| .spelling | Add unsize/unsizing to spelling allowlist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #585 +/- ##
========================================
Coverage 100.0% 100.0%
========================================
Files 359 359
Lines 27885 28066 +181
========================================
+ Hits 27885 28066 +181
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 43 out of 45 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
crates/layered/Cargo.toml:47
dynamicmodule is compiled for unit tests (#[cfg(any(test, feature = "dynamic-service"))]in src/lib.rs), butpluralityis only an optional dependency. As-is,cargo test -p layeredwithout--features dynamic-servicewill still compilesrc/dynamic.rsand fail to resolve thepluralitycrate. Addpluralityas a non-optional dev-dependency (mirroring the oldinfinity_poolsetup), or gate the module strictly behind the feature.
[features]
default = []
intercept = []
dynamic-service = ["dep:plurality"]
tower-service = ["dep:tower-service"]
[dependencies]
plurality = { workspace = true, optional = true }
tower-layer = { workspace = true }
tower-service = { workspace = true, optional = true }
[dev-dependencies]
alloc_tracker = { workspace = true }
criterion = { workspace = true }
futures = { workspace = true, features = ["executor"] }
mutants = { workspace = true }
pin-project-lite = { workspace = true }
static_assertions = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
tower = { workspace = true, features = ["limit", "util"] }
tower-service = { workspace = true }
8785751 to
5b90a60
Compare
- Onboard bytesbuf and layered to plurality
|