Skip to content

id(world): F12.12 many worlds per node: 1,000 idle / 100 active with a per-world memory budget #557

In progress

Description

@dezren39

What and why

Lazy open, idle eviction with checkpoint and a bounded memory budget per world, measured against 1,000 idle and 100 active (20 ev/s, p99 < 50 ms) targets with the F11.8 harness. Lazy open, eviction and per-guest memory caps exist, but nobody has measured the targets and a world's total memory is not bounded.

Source

Current status

Partial. Mechanisms exist from Phase 9/10: pkgs/id/src/world_hub.rs:7-15 (lazy single-flight open, session and open-world ceilings, idle eviction), and a per-guest linear memory cap of 16 MiB (pkgs/id/src/sandbox.rs:25-36). The per-world total memory budget with refusal tests landed in #4628. The F11.8 many-world measurement now exists; its p99 is 5,650.792 ms versus the 50 ms target, so that performance criterion remains open. The checkpoint/eviction/reopen integrity assertion passed for all 100 active worlds.

Acceptance criteria

  • A per-world total memory budget is enforced, with refusal tests
  • 1,000 idle and 100 active worlds (20 ev/s each, p99 < 50 ms) are measured with the F11.8 harness and the results recorded (measured p99: 5,650.792 ms; target missed)
  • Idle eviction checkpoints and reopens without loss under that load

Size

L

Prerequisites

Activity

  1. added
    enhancement
    on Oct 22, 2026
  2. added
    kind/feature
    source/human
    status/needs-triage
    priority/normal
    effort/l
    app/id
    meta/enriched
    on Oct 26, 2026
  3. dezren39 commented on Oct 26, 2026

    @dezren39
    MemberAuthor

    Intake review

    Fleet-monitor intake pass (2026-10-26). Body already carries a full ## Acceptance criteria section, so this pass is label normalization plus a liveness check — no body edit.

    Verified live on main e3467560 (2026-10-26): no per-world total memory budget exists — git grep -i 'memory_budget\|per-world.*memory' origin/main -- pkgs/id/src finds nothing; the per-guest linear-memory cap the body cites is still the only memory bound. The measurement half is also untouched (no harness run recorded). Still live; the body's "Partial" status assessment still holds.

    Related: prerequisite #539 (F11.8 benchmark harness with committed baselines) is still open and unenriched — the 1,000-idle/100-active measurement cannot be recorded without it. The metrics from #553 would make the budget observable once enforced.

    Risks / notes: a per-world budget needs a defined refusal behavior when a world exceeds it (refuse new allocations vs. evict vs. poison) — that semantic choice should be made in the implementation plan, mirroring how the sandbox handles guest memory exhaustion.

    Suggested approach: define and enforce the per-world budget with refusal tests first (verifiable without the harness), then run the scale measurement once #539's harness exists and record the numbers on this issue.

  4. added
    next
    work/assigned
    queue/claimed
    status/in-progress
    and removed
    status/needs-triage
    on Oct 27, 2026
  5. 416 remaining items

  6. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Progress from felix: ack modes implemented on branch felix/557-ack-modes (design doc + JournalAckMode + FileJournal modes + WorldLimits plumbing + tests + BASELINES note). Laptop test run queued on the fleet build lock; PR follows once the journal suites pass.

  7. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: slice-landed
    by: agent felix (kind muse, Muse sandbox seat)
    at: 2026-11-23

    Landed for review: #12746 — selectable journal ack modes, per Drewry's 2026-11-22 decision (comment 7087900634). NOT merged; Felix reviews.

    What it is: JournalAckMode on the journal — Sync (default; the documented durability-before-ack contract, byte-for-byte the old behaviour), Batched (one sync per 64 appends; loss bounded to the unsynced tail), Async (no sync on the ack path; durability at sync points only). Selected per world via WorldLimits::journal_ack_mode, plumbed through open_world to FileJournal::open_with_ack_mode; observable via WorldJournal::ack_mode() and FileJournal::unsynced_appends(). Tradeoffs for all three levers (ack timing, the fdatasync primitive, and the rejected syncfs/fdatasync group-commit axis) are documented on the enum where the modes are defined and in the design record doc/2026-11-23T00-24-00Z_design_journal_ack_modes/. Transactions and compaction stay full sync points in every mode; the journal format and recovery scan are unchanged, so a mode switch on reopen replays identically. No new dependencies.

    Evidence (laptop, fleet-build-lock): fail-before — the six new tests alone on pristine origin/main fail to compile (26 errors, the whole mode surface missing). Pass-after — cargo test -p id-worlds --lib journal_ 66 passed / 0 failed (incl. the five new mode tests); world_store:: 51 passed / 0 failed; world_limits_default 1 passed; rustfmt clean. Clippy is environment-blocked on the laptop's shared target dir (E0514, the same failure the #1062 lane recorded); no new warnings touch the changed code.

    What remains on #557, unchanged by this slice: the unloaded laptop re-run of the many-worlds harness is still the deciding measurement and still outstanding — the modes are opt-in and the default path is untouched, so no existing baseline moves. A BASELINES.md section records the landing with no new number, per the decision's terms.

  8. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Released by felix (outcome: free). Selectable ack modes landed as PR #12746 (unmerged, for Felix's review): JournalAckMode sync/batched/async, WorldLimits plumbing, design doc, 6 tests green on laptop; #557 stays open for the unloaded re-run.

  9. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: slice merged
    by: agent felix (kind muse, Muse sandbox seat)
    at: 2026-11-22

    Merged: PR #12746 (2026-11-23T00:58:39Z) — selectable journal ack modes, implementing Drewry's 2026-11-22 ruling (comment 7087900634). Sync remains the default with byte-for-byte the old contract; Batched (one sync_data per 64 appends, loss bounded to the unsynced tail) and Async (durability only at sync points) are opt-in per world via WorldLimits::journal_ack_mode. The running mode is observable (ack_mode(), unsynced_appends() — always 0 in Sync), journal bytes and recovery are mode-independent (pinned by the cross-mode reopen test), and transactions/compaction stay full sync points in every mode. The tradeoff documentation sits on the enum and in doc/2026-11-23T00-24-00Z_design_journal_ack_modes/, with all three durability levers side by side including the fsync/syncfs group-commit axis (measured-and-rejected numbers carried from the Fix 2 record). Evidence: fail-before compile failure on pristine main (26 errors, surface missing); 66/66 journal tests + 51/51 world_store on the laptop under the build lock. No new dependencies.

    Still outstanding on #557, unchanged: the unloaded laptop re-run of the many-worlds harness — the deciding measurement. No baseline number moves until a world runs in a relaxed mode and is measured.

  10. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    Fresh check: #557 is still OPEN. The only unmet criterion remains the reference-laptop p99 <50 ms measurement; the latest deciding run is 426.224 ms under heavy shared load. PR #12746 merged selectable Sync/Batched/Async journal ack modes with Sync still the default, so that does not resolve the criterion or change production behavior. Routed the next bounded slice as queued task 22182: expose benchmark-only ack-mode selection and measure the full workload in all three modes on an otherwise idle reference laptop, recording conditions and durability assertions. Keep #557 open; if all measurements remain >=50 ms, route the next optimization from the measured profile. Task: 22182 (repo-health-code-pilot).

  11. dezren39 commented on Nov 26, 2026

    @dezren39
    MemberAuthor

    Merge-watch progress for PR #14233: the branch now includes current main (a5c26fc17d77) via merge commit 43fdcdd321f; its unique diff is limited to the benchmark selector, world-bench wiring, and per-mode results. The PR's Closes #557 reference has been corrected to Refs #557: the loaded 9–13 venue does not satisfy the outstanding idle reference-laptop p99 criterion, so this issue stays open. Current PR mergeability is clean. Targeted Fleet validation is running at 45832216915.

  12. dezren39 commented on Nov 26, 2026

    @dezren39
    MemberAuthor

    Base refresh correction for PR #14233: main advanced again after the prior note. The PR branch now includes a965f0300c41 via merge commit 0b0b7436b2a; its four-file diff and non-closing Refs #557 link remain intact. GitHub reports a clean merge state. The final-head Fleet follow-up is 45836271733; I will verify its checkout SHA and terminal result before merge.

  13. developing-today-fleet commented on Nov 26, 2026

    @developing-today-fleet
    Contributor

    🤖 Agent note · verify-and-route verdict (queue task 24977, lane code-h, 2026-11-27)

    Fresh state verified this pass:

    Verdict: stays open; no new packet enqueued. Per the prior note (2026-11-24), the next step is the idle-laptop measurement; if all modes remain >= 50 ms, the next optimization routes from the measured profile. That routing happens once the measurement exists, not now.

  14. developing-today-fleet commented on Nov 27, 2026

    @developing-today-fleet
    Contributor

    Idle reference-laptop measurement — task 25926 (oc-code-03, 2026-11-27)

    The laptop is reachable, but the required idle-machine gate is not met. Fresh check at 03:37 local: load average 7.78 / 6.11 / 6.71 on 16 threads, with multiple rustc compiler processes using roughly 90–151% CPU, active git work, Python, OpenCode, and codedb. I did not start any benchmark runs, so no results are claimed or fabricated.

    Task 25926 is parked until the reference laptop is reachable and has no competing build or benchmark load. At that point, recheck processes/load and run the full Sync, Batched, and Async matrix; #557 remains open pending accepted idle measurements.

  15. dezren39 commented on Nov 27, 2026

    @dezren39
    MemberAuthor

    Stand-down — lane 0437-A-C, queue task 25926, 2026-11-27. Premise check confirms this task is already parked (oc-code-03, 09:39Z): the measurement requires an idle reference laptop, the idle gate is not met, and this seat runs builds/tests by remote dispatch only — a hardware-specific idle-laptop benchmark cannot be satisfied from a GitHub-hosted runner. No duplicate attempt made. Wake condition unchanged: reference laptop verifiably idle, then run the Sync/Batched/Async matrix per the task acceptance.

  16. developing-today-fleet commented on Nov 28, 2026

    @developing-today-fleet
    Contributor

    Lane 1222-J (delta PRESS, 2026-11-28) — queue task 25926 gate re-verified, parking unchanged.

    • id(world): F12.12 many worlds per node: 1,000 idle / 100 active with a per-world memory budget #557 OPEN, unchanged since 2026-11-27T11:20:19Z; no comment since the last gate recheck reports an idle window on the reference laptop.
    • Standing gate (oc-code-05 recheck): the ack-mode measurement's acceptance requires an idle venue; at recheck the reference laptop was not idle (load 12.66/17.48/18.22, active git/python3/nix/opencode/codedb/postgres competitors, /home disk 100%). A benchmark run under load would measure contention, not ack-mode.
    • This lane is Git-API-only (no laptop route); the measurement itself is a host action, not an authorable code slice.
    • Action: task 25926 parked with external ready condition: reference laptop idle (sustained low load, no competing build/agent processes, disk headroom healthy), then run the ack-mode measurement.
  17. dezren39 commented on Nov 29, 2026

    @dezren39
    MemberAuthor

    Census 2026-11-29 (lane CEN-C01) — body + all 100 comments re-read. The body is accurate and current; consolidating the remainder so nobody has to re-derive it:

  18. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Gaps found: None material. Labels are complete and an ## Acceptance criteria section is present. Priority was raised from priority/normal (at enumeration) to priority/high before this census; that fits Phase-12-path work and was left as-is.

    Strengths: Quantified target in the title itself (1,000 idle / 100 active worlds with a per-world memory budget), meta/enriched body, and full label coverage (kind, priority, status, queue, app, effort, source).

    Actions taken by this census: Verified complete — no changes needed.

  19. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix): full re-read (body, labels, all comments, edges) in the CODE-6 recovery pass. STRENGTHS: criteria accounting is exact — the per-world memory budget with refusal tests landed (#4628) and the checkpoint/eviction/reopen integrity assertion passed for all 100 active worlds; the sole open criterion is p99 latency (latest merged measurement 4,549 ms vs the 50 ms target, PR #10002, recorded in pkgs/id/benches/baseline.txt). PRIORITY VALIDATION: priority/high kept — this is a Phase-12 gate metric, important by the programme's own ordering (the now label agrees); not an age escalation. GAPS: the queue packet was typed small_fix for what is a size-L performance investigation — recorded in-thread as a packet defect (2026-11-17); a pickup must re-scope, not re-file. FIXES I APPLIED: none needed (the legacy enhancement label duplicates kind/feature but is harmless; left in place). REMAINS: the p99 investigation at size L; no Drewry decision needed.

  20. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Gate recheck — lane code-h (2026-11-29, task 25926)

    The reference laptop is reachable, but is not otherwise idle, so the accepted benchmark was not started. Fresh read via Fleet laptop shell: load average 6.90/16.47/16.29 on 16 logical cores; active CPU consumers include nix (60%), codedb (52%), gh (42%), find (36%), two OpenCode wrappers (~24% each), postgres, nix-daemon, and bun. Disk has 336 GB free (90% used). This does not satisfy the packet's idle-laptop requirement; another target would not satisfy it either.

    No benchmark or file changes. Resume after competing work subsides; recheck load, then run the full Sync/Batched/Async matrix and record the requested distributions and integrity assertions. #557 remains open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/ideffort/lenhancementepic/id-programkind/featuremeta/enrichedmode/onlinenowpriority/highqueue/queuedsource/humanstatus:in-reviewtask/triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions