Repository navigation
Description
Scale & performance hardening — Phase 14 core topic (research + design)
Filed from the next-horizons discussion #1240, decided by Drew on 2026-11-05: all themes are planned. This issue is the core topic for Scale & performance hardening. Its job is research and design — broaden the idea beyond what is already understood, set up multiple next steps, and produce implementation plans. No implementation starts here; the output is design documents and implementation issues.
Drew's principles for everything in Phase 14 (from #1240, 2026-11-05)
- Local-first is always the goal, AND a hosted version is intended: central coordination supporting a large graph of broadly accessible objects.
- Anything built must be completely usable by others hosting a small or large server themselves. P2P-hosted worlds and data behave the same as a large hosted public server; differences live in backend scale elements and access controls.
- Users connect to each other and transfer/interact directly wherever possible, so hosted resources are an offloadable backstop, not a requirement. The app must not technically need us to function. Collaborative / shared / federated / local-first / p2p.
- Our hosted instance is essentially public; other operators open theirs only as much as they want. Publishing paths: share to a big server, publish on pkarr, or self-host. All comms through iroh on the backend; first-class clients.
The idea, broadened
Phase 12 makes worlds data; this topic makes them big. Broaden beyond benchmarks: the failure shapes of large worlds (journal growth, replay time, fan-out cost per frame, memory on small hosts), graceful degradation (what a world sheds first under load), and the difference between a big world on a laptop and a big world on the public server — same behavior, different budgets. Every claim here needs the harness (#539) and baselines (#542) to already exist; they now do.
Research questions (first pass)
- Limits inventory: entities, journal entries, members, programs per world — measured, not guessed (stress harness on the laptop + CI)
- Journal growth economics: snapshot/compaction policy, replay-time budget, cold-start of an old world
- Fan-out: bytes/frame per member (extends id(world): F11.9 bytes-per-frame baseline table #542 baselines), backpressure, slow-member isolation
- Degradation ladder: what sheds first — presence detail, history depth, program fuel — and who decides
Dependencies and existing pieces
Builds on #539 benchmark harness and #542 bytes-per-frame baselines (done), F11.7 metrics (#553, done), F12.10 scheduling (#1067), F12.12 presence at scale (#557), F12.13 replication (#806).
Next steps — the version ladder
- v1 — first-iteration design — its own issue, filed in the same pass and linked in the first comment below
- v2 — outline: growth policy — its own issue, filed in the same pass and linked in the first comment below
- v3 — outline: multi-node chaos — its own issue, filed in the same pass and linked in the first comment below
- v4 — outline: public-server targets — its own issue, filed in the same pass and linked in the first comment below
Plus a standing rule for this topic: anything the research surfaces that doesn't fit v1–v4 gets its own issue (Drew's rule: every feature, concept, or idea gets an issue), and future investigations are listed as comments here rather than lost.
Sequencing
Design queue order: F12.4 provider registry (#1061) and F12.10 scheduling/quotas (#1067) designs land first; Phase 14 v1 designs then run hosted worlds → discovery → agents spike → the rest. Implementation follows Phase 13. The drop rule applies throughout: anything that proves blocked, wrong, or superseded gets parked or closed with a note — never a silent stall.
Acceptance criteria
- A research + design output exists for Scale & performance hardening: design documents broadening the topic beyond the current understanding, per the Phase 14 principles in the body (local-first plus hosted coordination).
- Multiple concrete next steps are produced as implementation plans / implementation issues filed from this topic.
- No implementation starts under this issue itself (per its own charter).
Activity
developing-today commentedon Nov 5, 2026
CODE-1847
dezren39 commentedon Nov 5, 2026
Version ladder for this topic (filed in the same pass, 2026-11-05):
Phase 14 plan of record: #6312. Discussion of record: #1240.
dezren39 commentedon Nov 6, 2026
Intake review
🤖 Fleet monitor intake (repo-fleet-monitor), 2026-11-06.
dezren39 commentedon Nov 6, 2026
🤖 Agent note · handed off
opencode, so task 11053 is handed off to the opencode claimant per the worker instruction §1b and parked 1200s pending the claimant launching the bound session; if the park expires first, task 11053 returns to the queue.169 remaining items
dezren39 commentedon Nov 17, 2026
🤖 Agent note · triaged (re-verification, task 18458, lane any-h)
dezren39 commentedon Nov 17, 2026
Agent note — task 19973 triaged (lane any-n)
dezren39 commentedon Nov 23, 2026
🤖 Agent note · FIRST-PASS FINDINGS — Lane BY (archer), 2026-11-22
This is the deliverable two downstream records said was missing: #6304's triage (2026-11-17, comment 6937020980) — "#6281 is still OPEN and has produced no first-pass findings" — and #6305's park (2026-11-21, comment 7065963001) — "#6281 remains OPEN without first-pass findings." The five prior triage notes on this issue (tasks 11134, 12503, 14665, 18458, 19973) all verified the topic is real-and-current; none produced findings. This note does, from current main (
f8e14e0a86a, 2026-11-23) and the committed baselines inpkgs/id/benches/. It is a first pass: source- and baseline-grounded, not a new stress run.Premise verdict (fresh, this lane): #6281 OPEN, no hard-stop labels, no live claim by another worker on this issue. Prerequisites have moved since the last verification (2026-11-17): #539 harness CLOSED, #542 bytes-per-frame CLOSED, #553 metrics CLOSED, #1061 provider registry CLOSED, and #806 replication is now CLOSED (was OPEN at every prior check). Sequencing gate #1067 is OPEN and actively landing (slice: per-account quotas, PR #12739 merged 2026-11-23T00:49Z; claim released by felix, outcome free).
Finding 1 — Limits inventory (in code, not guessed). Hard limits that exist today are mostly per-object, not per-world aggregates:
MAX_JOURNAL_BYTES = 64 MiBper world journal (crates/id-worlds/src/world_store.rs:51); session checkpoint interval default 2,000 ms (crates/id-store/src/session_checkpoint.rs:55); documents capped 64 KiB each / 512 list items; compile inputs capped 8 files / 256 KiB total; SSH surface capped 64 connections / 16 tunnel streams. Gap: there is no codified per-world cap on entities, members, or programs in one place — the limits inventory the research questions ask for does not yet exist as a single measured table. That table is v1 (#6304) work, now unblocked by this note.Finding 2 — Journal growth economics (measured baselines, 2026-10-28, reference laptop,
benches/baseline.txt+BASELINES.md). Journal append+fsync median 5,180 µs/append; checkpoint compaction median 10,972 µs per compact (2,000-entry journals); guest replay 0.170 µs/event over 10,000 events (≈1.7 ms to replay 10k events, so replay time is not the cold-start bottleneck at this scale — fsync-bound append is). At 5.18 ms per durable append, a single world's durable-write ceiling is ≈193 appends/s before batching; this is the number the growth policy (v2, #6305) has to design around.Finding 3 — Fan-out (measured). Session fan-out median 1.437 µs/delivery (32 clients × 100 rounds, #542 baseline). Fan-out cost per frame is therefore linear and cheap per member at current scale; the known fan-out risk is not per-delivery cost but slow-member behaviour — which is exactly the "slow-client back-pressure" remainder still open on #1067.
Finding 4 — The one measured target currently being missed is many-worlds p99. #557: 1,000 idle / 100 active worlds, measured p99 4,549 ms (later run 5,650 ms) vs the 50 ms target (
target_met=false); its memory-budget and eviction criteria are complete, p99 is the only remaining criterion, and its scoped next phase is #8239 (group-commit batching, OPEN, unclaimed at last check). Related measured miss:fuel_spin_isolationratio target 1.10 not met — post-admission pairs on 2026-11-22 measured 3.80–3.89 (improved from 4.73 pre-admission), victim spinning command mean ~1.4–2.0 ms vs tens of µs calm. Both misses trace to the same shape: durable-append / scheduling contention under concurrent load, not raw compute.Finding 5 — Degradation ladder: not codified. No explicit "what sheds first" ladder was found in the current source. What exists are point mechanisms: guest-burn admission (shared budget, default bound = parallelism − 2 = 14, #1067 slice 2), per-account quotas at the
run_guest_callfunnel (PR #12739), and per-world memory budgets with eviction (#557, criteria complete). Naming the ladder — presence detail, history depth, program fuel, in that or another order, and who decides — is open design work for v2 (#6305); it is not answered by any current code or doc.What this unblocks / next concrete slice: #6304 (v1 first-iteration design) carries
status/parked+status/waiting-dependencywith this findings note as its stated entry condition — that condition is now met and linked; a pointer note is posted there. #6305–#6307 remain correctly sequenced behind #6304. #6281 itself stays OPEN as the core topic (its acceptance asks for the ladder of implementation issues, which exist: #6304–#6307 plus plan of record #6312, OPEN) — no code was landed under this issue, per its charter.