Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

revert(bench): keep the profiling binaries, which never measured the engine\n\nBoth `[[bin]]`s behind the `rss-bench` gate went out with the engine. Only one\nof them was ever about it.\n\n`rss_bench.rs` names no engine symbol at all — it builds an `Agent` roster over\nits own in-file `NoopMemory` and samples RSS, and its own doc comment explains\nthat it hand-rolls that store rather than asking the factory, because\n`create_memory(backend = "none")` never returned a no-op backend. It was deleted\nonly because it shared a feature gate with `library-profile`, and the CI lane\nthat builds it (`Rust RSS Benchmark`, report-only, #5046) would have been red on\nevery rust-core PR from here on.\n\n`library_profile` is 12 files and 2 of them touch the engine: `memory_ingest`\ndrained its queue and `cold_phases` checkpointed its bootstrap through\n`tinymemory_core::store::MemoryClient`. Those two are gone. The other six\nscenarios — agent-turn, long-agent, workflow, fleet, skill-run, subagent-storm —\nmeasure the agent harness, the flows engine and a real `node` child, and named\nno engine symbol. So does everything in `scripts/profile/`, all seven scripts of\nwhich invoke this binary.\n\nThe feature that gated them is now `rss-bench = []`. It used to read\n`["dep:tinycortex", "dep:tinymemory-core"]`, and that was never for the\nbenchmark's sake: a `[[bin]]` cannot use a dev-dependency, so this feature was\nwhat turned the engine on for the two scenarios that are now gone. `dhat` and\n`rss-bench-dhat` come back with it, because `library-heap.sh` needs them; both\nstay default-OFF and out of `product-features.txt`, and `cargo tree -e normal -i\ndhat` under the product set finds nothing.\n\n**The `rss-bench` arm of the test-provider override had to come back too, and\nthis is the part I got wrong first time.** Six `library_profile` scenarios plus\nits `mock.rs` call `factory::test_provider_override`, which is `#[cfg]`-gated on\n`any(test, e2e-test-support, rss-bench)`. Dropping `rss-bench` from that cfg\nmade the profiling binary dial a real provider — a hermetic benchmark quietly\nlosing its mock. tinysweeper flagged it; I checked three of the twelve files,\nfound nothing, and called it a false positive. The compiler found the other six.\n\nScenario lists are reconciled with what `dispatch` actually answers.\n`library-bench.sh` had drifted before this branch touched it — it swept\n`subagents` and `subconscious`, neither of which has been a scenario for some\ntime (the subconscious domain was removed from the product outright), so a full\nsweep exited non-zero on two entries that could never run. The measurement\ntables in `docs/library-benchmarking.md` are left as recorded: they are a log of\nwhat was measured when, not a description of what runs today.\n

Shanu6a21262480a1
diff --git a/Cargo.lock b/Cargo.lock
index 9a732ad90d..9b6e47ac54 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -479,7 +479,7 @@ dependencies = [
"proc-macro2",
"quote",
"regex",
- "rustc-hash",
+ "rustc-hash 2.1.3",
"shlex 1.3.0",
"syn 2.0.119",
]
@@ -1595,6 +1595,22 @@ dependencies = [
"syn 2.0.119",
]
+[[package]]
+name = "dhat"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "98cd11d84628e233de0ce467de10b8633f4ddaecafadefc86e13b84b8739b827"
+dependencies = [
+ "backtrace",
+ "lazy_static",
+ "mintex",
+ "parking_lot",
+ "rustc-hash 1.1.0",
+ "serde",
+ "serde_json",
+ "thousands",
+]
+
[[package]]
name = "digest"
version = "0.10.7"
@@ -3486,6 +3502,12 @@ dependencies = [
"simd-adler32",
]
+[[package]]
+name = "mintex"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c505b3e17ed6b70a7ed2e67fbb2c560ee327353556120d6e72f5232b6880d536"
+
[[package]]
name = "mio"
version = "1.2.2"
@@ -4090,6 +4112,7 @@ dependencies = [
"cron",
"crossterm",
"curve25519-dalek",
+ "dhat",
"directories",
"dirs 5.0.1",
"dotenvy",
@@ -4793,7 +4816,7 @@ dependencies = [
"pin-project-lite",
"quinn-proto",
"quinn-udp",
- "rustc-hash",
+ "rustc-hash 2.1.3",
"rustls",
"socket2",
"thiserror 2.0.20",
@@ -4814,7 +4837,7 @@ dependencies = [
"rand 0.10.2",
"rand_pcg",
"ring",
- "rustc-hash",
+ "rustc-hash 2.1.3",
"rustls",
"rustls-pki-types",
"slab",
@@ -5291,6 +5314,12 @@ version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb"
+[[package]]
+name = "rustc-hash"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
+
[[package]]
name = "rustc-hash"
version = "2.1.3"
@@ -6274,6 +6303,12 @@ dependencies = [
"syn 3.0.4",
]
+[[package]]
+name = "thousands"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820"
+
[[package]]
name = "thread_local"
version = "1.1.10"
diff --git a/Cargo.toml b/Cargo.toml
index 9464afd16a..547a8c19ab 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -54,6 +54,35 @@ path = "src/bin/fleet.rs"
# (no `http-server`) this target is skipped rather than failing to link.
required-features = ["http-server", "bin-tools"]
+# Embedded-RSS benchmark harness (#5046). Gated behind the default-OFF
+# `rss-bench` feature so no benchmark code enters the shipped build. Build with
+# `cargo build --release --features rss-bench --bin rss-bench`.
+#
+# It survives the engine removal because it never measured the engine. The
+# `library-profile` bins that shared this gate did — they embedded
+# `tinymemory-core` in-process, which is why the feature used to name the engine
+# crates — and they are gone with it. This one builds an `Agent` roster over its
+# own in-file `NoopMemory` and samples RSS; its own doc comment explains that it
+# hand-rolls that rather than asking the factory, because
+# `create_memory(backend = "none")` never returned a no-op backend.
+[[bin]]
+name = "rss-bench"
+path = "src/bin/rss_bench.rs"
+required-features = ["rss-bench"]
+
+# Stateful library profiling workloads (real sub-agent delegation, flows graphs
+# and skill runs under a hermetic mock provider). Local/dev only, and the
+# subject of every script in `scripts/profile/`.
+#
+# Two of its scenarios are gone with the in-process engine: `memory-ingest`
+# drained the memory queue and `cold-phases` checkpointed the engine bootstrap
+# through `tinymemory_core::store::MemoryClient`. The other six never named an
+# engine symbol, which is why this binary survives rather than going with them.
+[[bin]]
+name = "library-profile"
+path = "src/bin/library_profile/main.rs"
+required-features = ["rss-bench"]
+
# ── Integration tests that need a PRODUCT gate ──────────────────────────────
#
# `[features] default` is the contributor set and no longer turns on `voice`,
@@ -379,6 +408,10 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_repr = "0.1"
serde_yaml = "0.9"
+# dhat — heap profiler for the offline `library-profile` benchmark binary only.
+# Default-OFF, dev-only: pulled in solely by the `rss-bench-dhat` feature so it
+# never enters the shipped desktop/library build (same posture as `rss-bench`).
+dhat = { version = "0.3", optional = true }
# (Removed `html2md` dep. dhat-rs profiling on real Gmail inboxes
# showed `html2md::walk` and `html2md::tables::handle` allocating
# ~894 MB peak heap on a 10 KB HTML input from Otter.ai-style emails
@@ -1226,6 +1259,23 @@ whatsapp-web = ["channels", "tinychannels/whatsapp-web"]
# build (app/scripts/e2e-build.sh) flips it on. Shipped binaries never have
# this feature so the wipe RPC isn't even registered, let alone reachable.
e2e-test-support = []
+# Compiles the embedded-RSS benchmark bin (#5046). Default-OFF and absent from
+# `scripts/ci/product-features.txt`, so nothing shipped enables it, and — like
+# `tui` — it is in NEITHER the contributor nor the product set, which is why the
+# `Rust RSS Benchmark` lane names it explicitly.
+#
+# The list is EMPTY, and that is the whole point of this edit. It used to read
+# `["dep:tinycortex", "dep:tinymemory-core"]`, but not for the benchmark's sake:
+# a `[[bin]]` cannot use a dev-dependency, so this feature was what turned the
+# engine on for the two `library-profile` bins that shared the gate. Those
+# measured the in-process engine and went with it. The benchmark itself names no
+# engine symbol and never did.
+rss-bench = []
+# Adds dhat heap profiling on top of `rss-bench` for the `library-profile`
+# binary. Default-OFF, dev-only: installs dhat's global allocator, which
+# perturbs RSS/timing numbers, so it is a separate opt-in feature rather than
+# folded into `rss-bench`. Never forwarded to the shipped build.
+rss-bench-dhat = ["rss-bench", "dep:dhat"]
# Compiles `memory::host_impls`, the host side of the seam traits the memory
# ENGINE declares, for builds that embed that engine in-process.
#
diff --git a/docs/library-benchmarking.md b/docs/library-benchmarking.md
index 445ff3e68b..de3899d01a 100644
--- a/docs/library-benchmarking.md
+++ b/docs/library-benchmarking.md
@@ -27,15 +27,23 @@ stderr). Each models a distinct embedding use case:
| Scenario | Models |
| --- | --- |
-| `memory-ingest` | Canonicalizing and ingesting a batch of chat messages through the real extraction/admission/tree-queue pipeline. |
-| `subagents` | A delegation turn: an orchestrator session spawns real subagents via `spawn_parallel_agents` and merges their findings. |
| `agent-turn` | The minimal embed case: one agent, one turn, no delegation, no workflow. The smallest useful "hello world" for a host that just wants a single reply. |
| `long-agent` | A long-running agent loop (`OPENHUMAN_PROFILE_TURNS`, default 25) in one process, to see whether RSS plateaus or grows per turn. |
| `workflow` | A saved automation run (`flows_create` + `flows_run`), representing the flows/automation embedding path rather than ad hoc chat. |
-| `subconscious` | A background subconscious turn (the always-on reflective pass), distinct from an interactive chat turn. |
-| `cold-phases` | Bootstrap attribution: per-phase checkpoints (config load, registry init, agent build, memory construction, first turn) so cold-start cost can be attributed to a phase instead of one lump sum. |
| `fleet` | N concurrent live agents with latency-realistic mock inference — the "100-1000 agents in a 2 GB / 2 vCPU server" question. See [below](#the-2-gb--2-vcpu-server-budget). |
+Four scenarios that this table used to list are gone, for two different
+reasons. `memory-ingest` and `cold-phases` measured the memory engine embedded
+in this process — one drained its queue, the other checkpointed its bootstrap
+through `tinymemory_core::store::MemoryClient` — and the binary no longer links
+one (openhuman#6161). Measuring the memory *module* over the bus instead is a
+different scenario and wants its own design, not a revived file. `subagents`
+and `subconscious` had already stopped existing before that: the subconscious
+domain was removed from the product outright, and both were still named in
+`library-bench.sh`'s sweep list, where `dispatch` answered "unknown scenario".
+The measurement tables further down are left as recorded — they are a log of
+what was measured when, not a description of what runs today.
+
## How to run
Six scripts under `scripts/profile/` (each has `-h`/`--help`):
@@ -64,8 +72,8 @@ Six scripts under `scripts/profile/` (each has `-h`/`--help`):
`library-bench.sh` output.
```bash
- ./scripts/profile/library-heap.sh memory-ingest
- # load target/profile/rust-library/dhat-memory-ingest.json at
+ ./scripts/profile/library-heap.sh agent-turn
+ # load target/profile/rust-library/dhat-agent-turn.json at
# https://nnethercote.github.io/dh_view/dh_view.html
```
diff --git a/scripts/profile/README.md b/scripts/profile/README.md
index ff5a73b218..58022d06bc 100644
--- a/scripts/profile/README.md
+++ b/scripts/profile/README.md
@@ -45,9 +45,9 @@ timing numbers from this build are perturbed by instrumentation; use it only
for allocation-site/retained-bytes attribution, not for RSS comparisons.
```bash
-./scripts/profile/library-heap.sh memory-ingest
+./scripts/profile/library-heap.sh agent-turn
# open https://nnethercote.github.io/dh_view/dh_view.html and load
-# target/profile/rust-library/dhat-memory-ingest.json
+# target/profile/rust-library/dhat-agent-turn.json
```
### `library-fleet.sh` — fleet sweep + 2 GB / 2 vCPU budget gate
diff --git a/scripts/profile/library-bench.sh b/scripts/profile/library-bench.sh
index e56912e13e..cb0c58fb41 100755
--- a/scripts/profile/library-bench.sh
+++ b/scripts/profile/library-bench.sh
@@ -16,22 +16,32 @@
# --scenarios "a,b,c" Comma-separated scenario list (default: all seven)
# --turns N OPENHUMAN_PROFILE_TURNS for long-agent (default binary default: 25)
# --skip-build Reuse the existing target/release binaries
-# --warm Also run PREWARM_SUBAGENTS=1 variants for subagents + subconscious
+# --warm Also run PREWARM_SUBAGENTS=1 variants for subagent-storm
# --out DIR Output directory (default: target/profile/rust-library/bench-<timestamp>)
# -h, --help Show this help
#
# Examples:
# ./scripts/profile/library-bench.sh
# ./scripts/profile/library-bench.sh --slim --repeat 7
-# ./scripts/profile/library-bench.sh --scenarios "long-agent,subagents" --turns 50 --warm
+# ./scripts/profile/library-bench.sh --scenarios "long-agent,subagent-storm" --turns 50 --warm
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
-ALL_SCENARIOS="memory-ingest,subagents,agent-turn,long-agent,workflow,subconscious,cold-phases"
-WARM_ELIGIBLE=("subagents" "subconscious")
+# The scenarios `library-profile` actually dispatches — keep in sync with
+# `src/bin/library_profile/scenarios/mod.rs`, which is the source of truth.
+#
+# This list had drifted before openhuman#6161 touched it: `subagents` and
+# `subconscious` are named here and neither has been a scenario for some time
+# (the subconscious domain was removed from the product outright). `dispatch`
+# answers "unknown scenario: …" for those, so a full sweep exited non-zero on
+# two entries that could never run. `memory-ingest` and `cold-phases` leave now
+# for a different reason: both measured the in-process memory engine, which
+# this binary no longer links.
+ALL_SCENARIOS="agent-turn,long-agent,workflow,fleet,skill-run,subagent-storm"
+WARM_ELIGIBLE=("subagent-storm")
SLIM=0
REPEAT=5
diff --git a/src/bin/library_profile/main.rs b/src/bin/library_profile/main.rs
index bbc5512bbb..d028234580 100644
--- a/src/bin/library_profile/main.rs
+++ b/src/bin/library_profile/main.rs
@@ -5,15 +5,16 @@
//! with network inference replaced by a deterministic provider.
//!
//! Scenarios (`library-profile <scenario>`):
-//! - `memory-ingest` — ingest 100 chat messages, drain the memory queue.
//! - `agent-turn` — a single cold agent turn (minimal library unit).
//! - `long-agent` — N warmed sequential turns with a per-turn checkpoint series.
//! - `workflow` — a real flows trigger->transform->agent graph, end to end.
-//! - `cold-phases` — per-phase checkpoints of the cold bootstrap in one region.
//! - `fleet` — N live agents: marginal RSS, idle CPU, fd/thread growth, turn latency.
//! - `skill-run` — a skill step executing on a real `node` child: process-tree RSS.
//! - `subagent-storm`— K parallel researcher subagents in one instance: marginal RSS per subagent.
//!
+//! `memory-ingest` and `cold-phases` were removed with the in-process memory
+//! engine (openhuman#6161); see `scenarios/mod.rs`.
+//!
//! stdout is ALWAYS a single pretty JSON object (the pinned schema in
//! `harness::ProfileResult`); every diagnostic goes to stderr with the stable
//! `[library-profile]` prefix.
@@ -52,11 +53,9 @@ fn start_dhat(scenario: &str) -> Result<dhat::Profiler> {
async fn dispatch(scenario: &str) -> Result<ProfileResult> {
match scenario {
- "memory-ingest" => scenarios::memory_ingest::run().await,
"agent-turn" => scenarios::agent_turn::run().await,
"long-agent" => scenarios::long_agent::run().await,
"workflow" => scenarios::workflow::run().await,
- "cold-phases" => scenarios::cold_phases::run().await,
"fleet" => scenarios::fleet::run().await,
"skill-run" => scenarios::skill_run::run().await,
"subagent-storm" => scenarios::subagent_storm::run().await,
@@ -86,8 +85,7 @@ fn main() -> Result<()> {
// can size the worker pool (the `fleet` scenario simulates the 2 vCPU box).
let scenario = std::env::args().nth(1).context(
"usage: library-profile \
- <memory-ingest|agent-turn|long-agent|workflow|cold-phases|fleet|\
- skill-run|subagent-storm>",
+ <agent-turn|long-agent|workflow|fleet|skill-run|subagent-storm>",
)?;
// Profiler must outlive the whole run + the JSON print so its Drop writes
diff --git a/src/bin/library_profile/scenarios/mod.rs b/src/bin/library_profile/scenarios/mod.rs
index 2c612d6800..922f15e061 100644
--- a/src/bin/library_profile/scenarios/mod.rs
+++ b/src/bin/library_profile/scenarios/mod.rs
@@ -1,11 +1,17 @@
//! One module per profiling scenario. Each exposes a single
//! `run() -> Result<ProfileResult>` entry point dispatched from `main`.
+//!
+//! `memory-ingest` and `cold-phases` are absent. Both measured the memory
+//! engine embedded in this process — `memory_ingest` drained its queue,
+//! `cold_phases` checkpointed its bootstrap through
+//! `tinymemory_core::store::MemoryClient` — and this binary no longer links
+//! one (openhuman#6161). Re-adding them means measuring the memory *module*
+//! over the bus, which is a different scenario and wants a fresh design
+//! rather than a revived file.
pub mod agent_turn;
-pub mod cold_phases;
pub mod fleet;
pub mod long_agent;
-pub mod memory_ingest;
pub mod skill_run;
pub mod subagent_storm;
pub mod workflow;