Files
ruvnet--RuView/v2/crates/homecore/Cargo.toml
T
ruv 0c55498475 perf(homecore): criterion benches for state-machine hot paths
`cargo bench -p homecore --bench state_machine` covers:

- set/first_write — cold-path insert + alloc + broadcast
- set/warm_write_state_change — same-entity update fires broadcast
- set/noop_suppressed — same state+attrs, no broadcast (HA semantic)
- get/hit + get/miss — zero-copy Arc<State> read paths
- all_snapshot/{10,100,1000} — Vec<Arc<State>> snapshot for REST
- all_by_domain_light_20_of_100 — domain prefix filter
- broadcast_fan_out/{1,4,16,64} — 1 sender + N subscribers, async,
  measures end-to-end deliver-and-recv latency

The broadcast fan-out is the most load-bearing measurement for
HOMECORE — every integration, the recorder, the automation engine,
and every WS subscriber holds a receiver, so the per-subscriber
delivery cost determines how many add-ons the runtime can host.

criterion 0.5 with sample_size=20 (fast tick, the fast-path benches
run in nanoseconds and don't need 100 samples).

Refs: docs/adr/ADR-127-homecore-state-machine-rust.md
Refs: #798

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-25 19:53:16 -04:00

49 lines
1.8 KiB
TOML

# HOMECORE — Rust state machine, event bus, service registry, entity registry.
# Implements ADR-127 (HOMECORE-CORE), the foundation of the HOMECORE Home
# Assistant port (ADR-126 master + ADR-128/129/130/131/132/133/134 sub-ADRs).
#
# P1 scaffold (this commit): public types + DashMap-backed state machine +
# Tokio broadcast event bus + minimal entity registry. Persistence and the
# full HA-compat serde schema land in P2.
[package]
name = "homecore"
version = "0.1.0-alpha.0"
edition = "2021"
license = "MIT"
authors = ["rUv <ruv@ruv.net>", "HOMECORE Contributors"]
description = "Rust state machine + event bus + service registry — the foundation of the HOMECORE Home Assistant port (ADR-127)"
repository = "https://github.com/ruvnet/RuView"
[lib]
name = "homecore"
path = "src/lib.rs"
[dependencies]
# Core async runtime — matches the rest of the v2/ workspace (sensing-server etc.)
tokio = { version = "1", features = ["sync", "rt", "rt-multi-thread", "time", "macros"] }
# DashMap for the concurrent state store — ADR-127 §2.1.
dashmap = "6"
# Typed event channels + service handler boxing
futures = "0.3"
async-trait = "0.1"
# Time types matched to HA's UTC datetime usage
chrono = { version = "0.4", features = ["serde"] }
# Schema validation replacement for voluptuous (ADR-127 §3)
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# Unique IDs (Context, ConfigEntryId, DeviceId)
uuid = { version = "1", features = ["v4", "serde"] }
# Error handling
thiserror = "1"
# Read-only static catalogs (event type names etc.)
once_cell = "1"
[dev-dependencies]
tokio = { version = "1", features = ["sync", "rt", "rt-multi-thread", "time", "macros", "test-util"] }
criterion = { version = "0.5", features = ["html_reports"] }
[[bench]]
name = "state_machine"
harness = false