Skip to content

id: F12.10 fair scheduling and per-account quotas #1067

Open

Description

@dezren39

F12.10 — Fair scheduling and quotas

From the Phase 12 plan (.opencode/plans/phase-12-platform-flexibility.md, workstream D):

A hub scheduler that shares fuel and CPU fairly across worlds, with per-account quotas for worlds, storage, and fuel per second, and back-pressure for slow clients. Depends on F11.7 (#553) and F11.8 (#539).

Exit: a world that spins on fuel cannot raise another world's p99 latency by more than 10 percent, shown in a benchmark.

Coordination (2026-10-26 reprioritization, per Drew): every id roadmap item now has its own GitHub issue, and priority encodes the order: (1) the path to Phase 12 — now + priority/high; (2) Phase 12 itself — next; (3) Phase 13 and long-term ideas — priority/low. The dashboard mirrors this list (org Project "Developing Today" #4, Area id-train; Grist Program roadmap, Area id). If this item turns out to be blocked, wrong, or superseded, park or close it with a note rather than letting it stall the queue — dropping an issue is always allowed; silently stalling is not.

Slice progress (F12.10)

  • Exit benchmark (a fuel-spinning world raises another world's p99 by ≤10%): measured, unmet, attributed — reference ratio 2.517 (2026-11-10, in pkgs/id/benches/BASELINES.md); slice 1 profile: PR bench(id): profile the fuel-spin isolation gap (#1067 slice 1) #12572 — the spinning-phase victim p99 is runtime wake starvation (~86–100% of the tail), not victim service.
  • Hub scheduler sharing fuel and CPU fairly across worlds: unimplemented — first fix step named by the slice-1 profile (guest execution off the shared runtime workers).
  • Per-account quotas (worlds, storage, fuel per second): unimplemented.
  • Back-pressure for slow clients: unimplemented.

Activity

  1. developing-today commented on Oct 27, 2026

    @developing-today
    Contributor
  2. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    nextOrg Project gate: queued next — orchestrator adds to the board
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    on Oct 27, 2026
  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 1, 2026
  4. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Triage verdict: CONFIRMED unimplemented; dependencies now closed; too large for a small_fix packet — stays as the tracked next roadmap item

    Dependencies — both closed (fresh check this run):

    Confirmed absent at origin/main b56ccda (laptop probes this run):

    • grep -rn 'fair|per-account|per_account' pkgs/id/src --include='*.rs' → zero hits; grep -rln quota pkgs/id --include='*.rs' → zero source files.
    • What exists is static per-world execution ceilings, not fair scheduling or quotas: pkgs/id/src/world_limits.rs defines server-admin RuntimeLimits (Wasm fuel/memory/payload caps; native rlimits + per-call deadline) and a per-world WorldExecutionProfile clamped beneath those ceilings. There is no hub scheduler sharing fuel/CPU across worlds, no per-account quota accounting (worlds/storage/fuel-per-second), and no back-pressure mechanism for slow clients.
    • The plan text stands at .opencode/plans/phase-12-platform-flexibility.md:49 with the benchmark exit: a fuel-spinning world must not raise another world's p99 latency by >10%.

    Routing — why no follow-up packet from this triage: the queue's follow-up kind for implementation is small_fix (45-minute timebox); this is effort/l design+implementation (a scheduler + quota accounting + a p99 benchmark on the F11.8 harness). Enqueuing it as a small_fix would guarantee a park/evaporation cycle. The issue itself — open, next, priority/normal per the 2026-10-26 coordination — remains the tracking vehicle. Recommended next step when Phase 12 work is picked: a design slice first (scheduler placement: world actor vs hub; quota store; benchmark shape on #539's harness), then implementation slices sized to the queue.

  5. 246 remaining items

  6. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Progress from felix: per-account quotas slice starting on the decided ownership model (decision note 7088000939): ownership resolution at the charge path (registry > creator-principal config > caller), per-account bound alongside the process-wide guest-burn budget at run_guest_call, charges settling by actual fuel. Design doc + worktree felix/1067-per-account-quotas first; PR (unmerged, Felix reviews) to follow.

  7. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: progress
    by: agent felix (kind muse, Muse sandbox seat; queue fallback claim, worker felix)
    at: 2026-11-22

    Per-account quotas slice is up for review: #12739 (unmerged; Felix reviews). Design: doc/2026-11-23_design_id1067-account-quotas.md on the branch.

    What landed, on the 2026-11-22 ownership decision (registry > creator-principal configuration > caller):

    • Resolution — new id-worlds::account_charge: WorldAccountRegistry (JSON config store in the RuntimeLimits idiom; install_shared, first install wins; a malformed file errors rather than reading as empty), WorldChargeConfig/ChargeMode, and the pure resolve_charge_account. A callerless call charges the world's own charge key as its account bucket — visible in the counters, never silently charged to a different account.
    • Fail-visible (a) — creator mode with no recorded creator is ChargeResolutionError::CreatorNotRecorded: the guest call does not run, no permit is taken, nothing is charged, a warn log names the world and reason, and the error propagates as the call's error. No silent caller fallback.
    • Enforcement — GuestBurnBudget::acquire_charged admits against the process-wide bound and an optional per-account concurrency bound (RuntimeLimits::guest_burn_per_account_concurrency / --world-guest-burn-per-account-concurrency; 0 = none, the default, so an unconfigured hub runs exactly slice-2 admission). Queue-never-refuse preserved; per-waiter eligibility means one account at its bound queues only its own calls. Grant order: least attained service by account, then key, then arrival. Charges settle by actual fuel at both levels; snapshot() gains per-account counters. Pre-account acquire() delegates with the key as its own account — behaviour-identical for existing callers.
    • Wiring — WorldInstance resolves before admission; restore_program installs the shared registry and applies the bound. The instance setter surface mirrors set_charge_key/set_burn_budget.

    Evidence (laptop, fleet-build-lock): fail-before — the new budget tests on pristine main fail to compile, 10 errors naming the missing APIs. Pass-after — id-worlds filtered suites (guest_burn + account_charge + sandbox) 57/57 including all 14 new tests; id-caps 179/179; id-cli check clean and lib 743 passed with the single failure test_command_lists_cover_all_clap_subcommands ("README CLI Commands table omits walk") failing identically on pristine main — pre-existing, not this change. Module-reach OK; rustfmt clean; no new dependencies.

    Honest exit shape: the exit criterion is not claimed — the ratio gap is attributed in BASELINES.md to scheduler contention around the burn path, which a per-account bound does not govern. What changed: per-account fairness and attribution are real at the funnel. Remaining on #1067: the hub scheduler, slow-client back-pressure, caller-principal threading (the funnel still sees participant ids, not accounts — the session layer's resolved Principal does not reach the actor today; until it does, default-mode charges land on the installed caller where one is set and on the world's own bucket otherwise, and no world yet records a creator for mode (a)), and the persistent-spinner profile variant.

    Note: this issue currently shows CLOSED (closed 2026-11-22T15:56:21Z, at the slice-2 merge) while its own record — the decision note and this slice — treats the quota remainder as open. Flagging for the reviewer rather than reopening from the lane.

  8. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Released by felix (outcome: free). Per-account quotas slice landed as PR #12739 (unmerged, Felix reviews): ownership resolution (registry > creator config > caller) at the run_guest_call charge path, per-account concurrency bound + per-account LAS fairness in GuestBurnBudget, creator-less creator-mode fails visibly. Evidence: fail-before compile errors on main; laptop id-worlds filtered 57/57 (14 new tests), id-caps 179/179, id-cli 743+1 pre-existing failure identical on main. Remaining on #1067: hub scheduler, slow-client back-pressure, caller-principal threading to the funnel, persistent-spinner profile variant. Note: issue shows CLOSED since the slice-2 merge while its record treats the remainder as open — flagged on the issue for the reviewer.

  9. added and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 23, 2026
  10. added a commit that references this issue on Nov 23, 2026
  11. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

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

    Reopening: this issue was auto-closed at the slice-2 merge (2026-11-22T15:56:21Z), but its record continues past that point — Drewry's ownership decision landed after the close (comment 7088000939: calling account is the DEFAULT, creator principal and admin registry are per-world OPTIONS, precedence registry > creator-config > caller, directory-derived rejected), and remainder work was explicitly still open. The close was a merge-keyword artifact, not a done verdict.

    Landed against the decision: PR #12739 merged 2026-11-23T00:49:53Z — per-account quotas at the run_guest_call funnel. resolve_charge_account implements the decided precedence; the admin registry is a JSON config store in the RuntimeLimits idiom (no UI, as scoped); GuestBurnBudget admits against the process-wide bound AND a per-account concurrency bound (default 0 = unconfigured hub runs exactly slice-2 admission), grant order least-attained-service by account then key then arrival, charges settle by actual fuel at both levels, snapshot gains per-account counters. Creator-less creator-mode worlds fail VISIBLY (typed CreatorNotRecorded error, call does not run, nothing charged) — never silently charged to the caller. Evidence (laptop, build lock): fail-before compile errors naming the new API on pristine main; 57/57 filtered id-worlds tests, id-caps 179/179; the one lib-test failure (README CLI table omits walk) fails identically on pristine main. No new dependencies. Design: doc/2026-11-23_design_id1067-account-quotas.md.

    Still open on this issue, unchanged: the exit-shape criterion (ratio ~3.8 vs ≤2 — attributed to spawn/shutdown churn + the blocking round trip, not governed by admission), hub scheduler, slow-client back-pressure, caller-principal threading (the session layer's resolved Principal does not yet reach the actor, so default-mode charges go to the installed caller or the world's own bucket), a world creation record for creator-mode, and the persistent-spinner profile variant. The clippy gate could not run to a verdict on the laptop (venue rustc mix, E0514 in dependency crates, identical on untouched code) — just check in the nix dev shell remains the canonical gate for this slice.

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/idPackage/app: id (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestmode/onlineFully doable remotely: design, config, code, cloudnowOrg Project gate: active priority — orchestrator adds to the boardpriority/normalOrdinary priority (the default)queue/queuedHas a queued queue tasksource/humanFiled directly by a humanstatus:in-reviewtask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions