Skip to content

feat: Introduce the plurality pool allocator#532

Open
geeknoid wants to merge 1 commit into
mainfrom
plurality
Open

feat: Introduce the plurality pool allocator#532
geeknoid wants to merge 1 commit into
mainfrom
plurality

Conversation

@geeknoid

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 27, 2026 00:02
@geeknoid geeknoid changed the title Introduce the plurality pool allocator feat: Introduce the plurality pool allocator Jun 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new workspace crate, plurality, implementing a growable fixed-slot pool allocator that returns thin smart-pointer handles (Box, Alloc, Arc, Rc) and includes a full suite of tests, concurrency model-checking (loom), property testing (bolero), and benchmarking/reporting tooling.

Changes:

  • Add the crates/plurality crate with pool/slot/chunk infrastructure and four handle types.
  • Add extensive correctness coverage: integration tests, loom model tests, bolero property tests, plus local correctness/perf scripts.
  • Wire plurality into the workspace docs/dependency listings and mutation-testing exclusions.

Reviewed changes

Copilot reviewed 41 out of 42 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
README.md Adds plurality to the root crate list.
CHANGELOG.md Adds plurality to the workspace changelog index.
Cargo.toml Adds plurality to [workspace.dependencies].
Cargo.lock Updates lockfile for new crate + benchmark/dev dependencies.
.cargo/mutants.toml Adds plurality-related mutant exclusions.
crates/plurality/Cargo.toml New crate manifest (features, deps, benches).
crates/plurality/README.md New crate README describing API, benchmarks, testing.
crates/plurality/CHANGELOG.md New crate changelog.
crates/plurality/logo.png Adds crate logo asset via Git LFS pointer.
crates/plurality/favicon.ico Adds crate favicon asset via Git LFS pointer.
crates/plurality/docs/DESIGN.md Detailed internal design/architecture document.
crates/plurality/docs/TODO.md Tracks planned/unimplemented follow-ups.
crates/plurality/docs/PERF.md Adds a generated performance report snapshot.
crates/plurality/scripts/perf_report.rs Script to run benches and regenerate PERF.md.
crates/plurality/scripts/correctness.rs Script to run the full local correctness suite.
crates/plurality/src/lib.rs Crate root, docs, module wiring, public re-exports.
crates/plurality/src/atomic.rs Atomic shim to support loom-instrumented atomics.
crates/plurality/src/builder.rs PoolBuilder implementation and validation.
crates/plurality/src/chunk.rs Chunk layout math + slot/header recovery helpers.
crates/plurality/src/slot.rs SlotCell definition + refcount overflow abort path.
crates/plurality/src/pool.rs Core pool allocation/grow/free/teardown logic.
crates/plurality/src/common.rs Shared handle surface + forwarding trait impl macros.
crates/plurality/src/boxed.rs plurality::Box handle implementation.
crates/plurality/src/alloced.rs plurality::Alloc handle implementation.
crates/plurality/src/sync.rs plurality::Arc handle implementation.
crates/plurality/src/rc.rs plurality::Rc handle implementation.
crates/plurality/tests/common/mod.rs Shared test helpers (drop counters).
crates/plurality/tests/box.rs Box handle integration tests.
crates/plurality/tests/arc.rs Arc handle integration tests.
crates/plurality/tests/rc.rs Rc handle integration tests (incl. cross-thread reuse scenario).
crates/plurality/tests/alloc.rs Alloc handle integration tests.
crates/plurality/tests/smart_ptr.rs Cross-handle smart-pointer surface/trait forwarding tests.
crates/plurality/tests/pool.rs Pool/builder behavior tests, stress tests, allocator tests.
crates/plurality/tests/loom.rs Loom model-checking tests for concurrency interleavings.
crates/plurality/tests/bolero.rs Bolero property/fuzz tests for pool invariants.
crates/plurality/benches/shared/ops.rs Shared per-op benchmark bodies for criterion/gungraun.
crates/plurality/benches/criterion_alloc.rs Wall-clock (criterion) allocation benchmarks.
crates/plurality/benches/gungraun_alloc/main.rs Callgrind bench entrypoint (Linux-only no-op otherwise).
crates/plurality/benches/gungraun_alloc/linux.rs Callgrind bench bodies aligned with criterion ops.
crates/plurality/benches/pool_comparison/main.rs Cross-crate Callgrind comparison entrypoint.
crates/plurality/benches/pool_comparison/linux.rs Cross-crate Callgrind comparison bodies.
crates/plurality/benches/graph_churn.rs Macro benchmark comparing pool vs Box+mimalloc.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/plurality/src/pool.rs
Comment thread crates/plurality/src/pool.rs
Comment thread crates/plurality/src/pool.rs
Comment thread crates/plurality/src/pool.rs
Comment thread crates/plurality/src/pool.rs Outdated
@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown

⚠️ Breaking Changes Detected

error: failed to retrieve local crate data from git revision

Caused by:
    0: failed to retrieve manifest file from git revision source
    1: possibly due to errors: [
         failed to parse /home/runner/work/oxidizer/oxidizer/target/semver-checks/git-origin_main/d0dd41f40df58d043f54d09533cf86bc61204458/Cargo.toml: no `package` table,
         failed when reading /home/runner/work/oxidizer/oxidizer/target/semver-checks/git-origin_main/d0dd41f40df58d043f54d09533cf86bc61204458/scripts/crate-template/Cargo.toml: TOML parse error at line 9, column 26
         |
       9 | keywords = ["oxidizer", {{CRATE_KEYWORDS}}]
         |                          ^
       missing key for inline table element, expected key
       : TOML parse error at line 9, column 26
         |
       9 | keywords = ["oxidizer", {{CRATE_KEYWORDS}}]
         |                          ^
       missing key for inline table element, expected key
       ,
       ]
    2: package `plurality` not found in /home/runner/work/oxidizer/oxidizer/target/semver-checks/git-origin_main/d0dd41f40df58d043f54d09533cf86bc61204458

Stack backtrace:
   0: anyhow::error::<impl anyhow::Error>::msg
   1: cargo_semver_checks::rustdoc_gen::RustdocFromProjectRoot::get_crate_source
   2: cargo_semver_checks::rustdoc_gen::StatefulRustdocGenerator<cargo_semver_checks::rustdoc_gen::CoupledState>::prepare_generator
   3: cargo_semver_checks::Check::check_release::{{closure}}
   4: cargo_semver_checks::Check::check_release
   5: cargo_semver_checks::exit_on_error
   6: cargo_semver_checks::main
   7: std::sys::backtrace::__rust_begin_short_backtrace
   8: main

If the breaking changes are intentional then everything is fine - this message is merely informative.

Remember to apply a version number bump with the correct severity when publishing a version with breaking changes (1.x.x -> 2.x.x or 0.1.x -> 0.2.x).

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (7f46d79) to head (b929807).

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #532    +/-   ##
========================================
  Coverage   100.0%   100.0%            
========================================
  Files         343      352     +9     
  Lines       26202    26809   +607     
========================================
+ Hits        26202    26809   +607     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings June 27, 2026 00:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 42 out of 43 changed files in this pull request and generated 2 comments.

Comment thread crates/plurality/src/slot.rs Outdated
Comment thread crates/plurality/src/pool.rs Outdated
Copilot AI review requested due to automatic review settings June 27, 2026 00:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 42 out of 43 changed files in this pull request and generated 1 comment.

Comment thread crates/plurality/src/builder.rs
Copilot AI review requested due to automatic review settings June 27, 2026 06:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 42 out of 43 changed files in this pull request and generated 3 comments.

Comment thread crates/plurality/src/chunk.rs
Comment thread crates/plurality/benches/graph_churn.rs
Comment thread crates/plurality/README.md
Copilot AI review requested due to automatic review settings June 27, 2026 13:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 42 out of 43 changed files in this pull request and generated 3 comments.

Comment thread crates/plurality/src/pool.rs
Comment thread crates/plurality/docs/DESIGN.md Outdated
Comment thread .cargo/mutants.toml
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.

2 participants