graphrefly-core 0.0.7

GraphReFly handle-protocol core dispatcher
Documentation
[package]
name        = "graphrefly-core"
description = "GraphReFly handle-protocol core dispatcher"
version.workspace      = true
edition.workspace      = true
rust-version.workspace = true
license.workspace      = true
repository.workspace   = true
homepage.workspace     = true
authors.workspace      = true

[dependencies]
parking_lot = { workspace = true }
ahash       = { workspace = true }
smallvec    = { workspace = true }
indexmap    = { workspace = true }
thiserror   = { workspace = true }
tracing     = { workspace = true }
serde_json  = { workspace = true }
# Compile-time `!Send + !Sync` assertions on owner-thread-only types
# (D254 — `DeferQueue` MUST stay `!Send + !Sync` by construction; a
# future field that silently widens the trait bounds breaks the actor-
# model "one owner thread per Core" invariant. Build-time-only; zero
# runtime cost).
static_assertions = { workspace = true }
# Sync SHA-256 for the `hash` module (no tokio — Core stays synchronous;
# the async-everywhere wrapping is applied only at the napi boundary).
sha2        = { workspace = true }
hex         = { workspace = true }
tokio       = { workspace = true, features = ["time", "sync", "rt", "macros"], optional = true }

[dev-dependencies]
proptest          = { workspace = true }
criterion         = { workspace = true }
tokio             = { workspace = true, features = ["time", "sync", "rt", "macros", "rt-multi-thread", "test-util"] }
# Bench-only: lock-strategy microbench (see benches/lock_strategy.rs).
dashmap           = { workspace = true }
crossbeam-channel = { workspace = true }

# loom is a concurrency model checker that permutes thread interleavings.
# Used only when compiling with `--cfg loom`. Tests that depend on loom
# must gate themselves with `#[cfg(loom)]` because loom replaces stdlib
# atomics/sync primitives. Run via:
#   RUSTFLAGS="--cfg loom" cargo test --test loom_subscription
[target.'cfg(loom)'.dev-dependencies]
loom = { workspace = true }

[[bench]]
name    = "dispatcher"
harness = false

[[bench]]
name    = "lock_strategy"
harness = false

# §7 floor regression harness (D208–D211) — a lean single-threaded
# handle-core mirror; the canonical comparison point for the
# `Core<SingleThreadCell>` ~83 ns target. Retained post-§7.
[[bench]]
name    = "minimal_handle_core"
harness = false

# §7 floor-verification (D216) — the REAL shipped `Core<C>`, both
# `SingleThreadCell` (floor) and `LockedCell` (production default)
# arms, same workloads as `dispatcher.rs`. The honest measure of what
# the §7 rewrite bought on the genuine dispatcher (vs the lean
# `minimal_handle_core` mirror).
[[bench]]
name    = "floor_compare"
harness = false

# §7 parallel-scaling (D216) — does a disjoint `SerializationGroupId`
# set actually run in parallel? N-thread aggregate-throughput scaling
# with `same_group` / `all_none` serialized controls.
[[bench]]
name    = "group_scaling"
harness = false

[features]
default      = ["std", "tokio"]
# `std` is the only supported configuration for now. Kept as a feature so
# `no_std` (alloc-only) remains a future option without breaking the API.
std          = []
# Timer substrate — spawns tokio tasks for schedule/cancel/fire lifecycle.
# Gated because Core stays fully synchronous; tokio enters only at the
# timer boundary layer. Operators, storage, and bindings enable this.
tokio        = ["dep:tokio"]
# Concurrency permutation testing via loom. Enable in CI for the per-subgraph
# RLock + dispatch tests.
loom-checked = []
# (§7/D208–D211: the throwaway `bench_naive` / `bench_state_collapse`
# perf-investigation features were removed — they isolated the
# union-find / lock-cycle machinery this slice deletes; see
# `docs/porting-deferred.md` §7-D.)

[lints.rust]
# Loom is enabled via `RUSTFLAGS="--cfg loom"`, not a Cargo feature.
# Tell cargo about the cfg so the default build doesn't emit the
# unexpected_cfgs warning for `#![cfg(loom)]` test gates.
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(loom)"] }