Skip to content

perf(id): add a hub-level fair guest scheduler #15577

Backlog

Description

@dezren39

Problem

Continue F12.10 fair scheduling from #1067. The diagnostic profiles in PR #15573 show the lifecycle effect but not a fair result: on the AMD Ryzen 7 7840U, respawn spinners measured 27.859x victim p99 at 29.8B settled fuel, while persistent spinners measured 2.036x at 202.2B. At admission bound 1, the persistent profile was 1.288x at 24.5B, near but above the 1.10x target. All were one-repetition runs, so noise remains.

The current semaphore limits concurrent guest calls and orders waiters by attained fuel. It does not provide a bounded scheduling quantum or preserve victim latency under continuously queued worlds. Implement the next hub-level scheduler slice that gives runnable worlds bounded, fair CPU service while keeping guest calls and actor progress off shared runtime workers.

Acceptance

  • Add an executable oracle that compares victim p99 under a sustained fuel spinner with an equivalent amount of per-world work; collect at least five repetitions and report median plus range.
  • Implement a work-conserving hub scheduler with a stated fairness rule and no starvation across world keys/accounts.
  • Keep guest execution from saturating Tokio's shared worker pool; show the profiler's before/after runtime wake-lateness and victim p99.
  • Meet the F12.10 target: spinning raises victim p99 by at most 10% on the AMD reference host, with exact commands and outputs recorded in pkgs/id/benches/BASELINES.md. If a repeatable host limit prevents that, document the measured ceiling and attribution on id: F12.10 fair scheduling and per-account quotas #1067 before declaring the target unmet.
  • Run the touched pkgs/id tests through the Fleet dispatch route and record exact commands and counts.

Scope

Own pkgs/id scheduler, runtime integration and benchmark files only. Preserve the existing per-account charge decision and ensure the scheduler remains work-conserving when an account is idle. This follows #1067 and PR #15573; it does not close #1067 by itself.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-26T12:39:22Z",
    "session_id": "ses_e5de831c61bffeC7giqYOrQe07",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/code",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/code",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "6fd30c93b62a4b6fba19e6444c7d69f343fb93a1"
    },
    "auth_subject": "oc-code-08",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Refs #1067
Refs #15573

Acceptance criteria

  • A hub-level fair guest scheduler exists for id: guests sharing a hub get fair service under contention (no single guest starves the others).
  • Fairness is demonstrated by a test or benchmark with at least two competing guests.
  • Single-guest latency is not materially regressed.

Activity

  1. added
    status/ready
    kind/feature
    priority/high
    app/id
    effort/m
    queue/queued
    on Nov 26, 2026
  2. added
    meta/enriched
    on Nov 26, 2026
  3. developing-today-fleet commented on Nov 26, 2026

    @developing-today-fleet
    Contributor

    Intake review

    🤖 Agent note · filed

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: repo-fleet-monitor run 2026-11-26 07:14 CST
    • Found via: monitor reconciliation (intake enrichment, protocol §5)
    • Task: Intake pass — acceptance criteria appended to the issue body, labels normalized (priority/high (existing), effort/m (existing), meta/enriched).
    • Expectation: a queue worker or sweep picks this up with the criteria above as the definition of done.
    • Links: n/a

    Notes: Performance feature for id, already labelled priority/high + effort/m + queue/queued + status/ready. Suggested approach: define the fairness unit (per guest binding) and the scheduling quantum at the hub, then prove with a two-guest contention test. Risk: scheduler overhead on the uncontended path — measure before/after.

    Verified live: no merged PR found in this pass that explicitly resolves this issue, so it stays open. If a candidate fix surfaces, link it here before closing.

  4. dezren39 commented on Nov 26, 2026

    @dezren39
    MemberAuthor

    Claimed by lane 6, 2026-11-26T18:37Z. First slice: a bounded scheduling quantum. A guest call that holds a burn permit yields it at each quantum tick when a waiter with less attained service is queued. It then requeues under the existing least-attained-service rule, so a spinner can't hold a permit for its whole fuel budget while a light world waits. Fuel and results stay deterministic. A fairness oracle with two competing guests comes with it.


    Generated by Claude Code

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

    @developing-today-fleet
    Contributor

    Claimed via queue task 24183 (repo-worker-code/lane sweep-15577); queue fallback shows no live fallback claim and the lane-6 comment has no pushed branch or PR, so proceeding with the queued slice.

    Progress: slice 1 landed as PR #15747 — module docs now state the bounded-wait rule (light call waits at most one permit turnover per round; quantum is one fuel-bounded guest call since Wasm cannot be preempted mid-call) with two deterministic five-round contention oracles (per key and per account). cargo test -p id-worlds --lib guest_burn: 10 passed, 0 failed (run locally — Fleet remote dispatch returned HTTP 403 twice, so dispatch verification is still owed). Docs + tests only; no execution-path change.

    Remaining for this task: reference-host bench (fuel_spin_isolation + fuel_spin_persistent, five reps, median/range in BASELINES.md) on the AMD host, plus a Fleet-dispatch test pass once dispatch is healthy. PR body records both.

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

    @developing-today-fleet
    Contributor

    Fleet lane checkpoint (task #24183, 2026-11-26): PR #15747 remains open with deterministic admission fairness tests and documentation; no execution-path scheduler implementation has been added by this pass. The required remote test command cargo test --manifest-path pkgs/id/Cargo.toml -p id-worlds --lib guest_burn was dispatched through fleet queue dispatch against sweep/15577-fair-guest-scheduler; placement chose developing-today-forks/fleet, but submission failed before a run was created with HTTP 403 Resource not accessible by integration. The alternate Fleet Actions route (fleet actions exec start --repo dezren39/fleet --target-repo developing-today/code --ref main --timeout 900 --detach) failed at workflow dispatch with HTTP 403 as well. No runner test result exists. The local target inventory reports laptop and Codespace unreachable; AMD host is Ryzen 7 7840U (16 CPUs), but no current benchmark binary is present in the worktree and I did not compile or run the sustained benchmark locally. Resume when Fleet can create a runner workflow for developing-today/code; then run the touched tests remotely and collect five matched-work repetitions on the AMD reference host before closing this slice.

  7. added
    status/parked
    queue/parked
    on Nov 26, 2026
  8. 18 remaining items

  9. added
    queue/claimed
    work/assigned
    status/in-progress
    and removed
    status/in-progress
    queue/claimed
    on Nov 27, 2026
  10. developing-today-fleet commented on Nov 28, 2026

    @developing-today-fleet
    Contributor

    🤖 Agent note · parked

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: repo-fleet-monitor run 2026-11-27 19:14 CST
    • Found via: monitor reconciliation (Duty 1 claim/label divergence)
    • Task: Sync this issue's lifecycle labels to the live queue truth
    • Expectation: Labels now match the broker state; no work changes hands.
    • Links: task 24183 (repo-health-code-pilot)

    The digest (Turso mirror) flagged task 24183 as queued, but a scoped broker read this run shows task 24183 is parked (not_before 2026-11-28T02:30:00Z). The issue carried contradictory label pairs — queue/claimed + queue/parked and status/in-progress + status/parked. I removed queue/claimed and status/in-progress; the parked truth stands: queue/parked + status/parked + work/assigned.

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

    @developing-today-fleet
    Contributor

    Agent note · lane 2152-J (bravo SUSTAIN follow-through, 2026-11-28) — posting the owed evidence for lane 2107-D's park of queue task 24183 (the original post failed: GitHub egress was down fleet-wide at park time; absence of this evidence on the issue was re-verified by 2152-J against all 11 comments before posting).

    Scheduler PR #15797 + evidence PR #15916 already merged; sole remainder = 5+5 quiet-host repetitions.

    Lane 2107-D's fresh evidence from amd via laptop-agent, 2026-11-28 21:21-21:27 CST: load 2.67/3.00/3.58 -> 2.16/2.83/3.50 -> 3.46/3.11/3.54 — the 5m<=4 leg was met for the first time that day, BUT no valid oracle run was possible: primary clone ~/git/code conflict-dirty (UU .github/scripts/id-pr-checks.txt, .github/test-suite-registry.json, .opencode/opencode.jsonc, doc/2026-11-01_design_id2039.md) at 94c0018; the only other bench worktree is another lane's (code-wt-26056); opencode.service active; sibling processes at gh 125% / codedb 58% CPU.

    Park verified (2107-D read-back, re-confirmed by 2152-J via fleet queue show): task 24183 status=parked, not_before 2026-11-29T04:23:57Z. Ready condition: 5m load <=4 + executor outside opencode.service + clean current-main checkout on host, then 5x fuel_spin_isolation + 5x fuel_spin_persistent, update BASELINES.md/#1067.

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

    @developing-today-fleet
    Contributor

    Lane 2337-F (alpha DRIVE queue-draw, 2026-11-28 23:37 CST) — drew task 24183, premise-checked, re-parked.

    Draw: fleet agent next (queue rung) atomically claimed task 24183 at 2026-11-29T05:41:04Z after lane 2107-D's park lapsed (not_before 2026-11-29T04:23:57Z). Second draw: queue rung empty.

    Premise check (issue + all 12 comments read firsthand): scheduler implementation already merged (PR #15797), evidence PR #15916 merged; the sole remainder is the 5+5 quiet-host benchmark repetitions on the AMD reference host — no code slice remains for a Git-API/CI lane.

    Fresh host check via laptop-agent, 2026-11-29T05:42Z (host amd): load 3.30 / 3.45 / 3.69 — the load_5m ≤4 leg is met — BUT opencode.service is active and the primary clone ~/git/code is still conflict-dirty (UU .github/scripts/id-pr-checks.txt, .github/test-suite-registry.json, .opencode/opencode.jsonc, plus doc files) at 94c0018a5b1. Two of the three ready-condition legs fail, so no valid oracle run was possible; no benchmarks run, no code changed.

    Disposition: task 24183 re-parked via fleet queue park (read-back verified: status=parked, not_before 2026-11-29T11:43:19Z). Resume condition unchanged: load_5m ≤4 AND executor outside opencode.service AND a clean current-main checkout on the host; then 5x fuel_spin_isolation + 5x fuel_spin_persistent, update pkgs/id/benches/BASELINES.md and #1067.

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

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix): rechecked in full (body, labels, comments, edges).

    STRENGTHS: Measured problem statement (the PR #15573 diagnostic numbers with host, repetitions, and the noise caveat stated), acceptance that demands an executable oracle with at least five repetitions and median+range, and an honest escape hatch (document the measured ceiling on #1067 if the 1.10x target proves unreachable on the reference host). kind/feature + priority/high already set; status/parked is accurate.

    GAPS: The scheduler slice LANDED (PR #15797 merged: 2ms quantum via Wasmtime epochs, least-attained-service requeue; guest_burn tests 11/11 on main; results recorded via PR #15916). What remains is the acceptance benchmark itself — five repetitions on the AMD reference host — and it is parked on a physical condition: the host must be QUIET (5-minute load ≤ 4). Repeated lane checks (oc-code-06, oc-code-01, code-j, 2337-F) found load 6.5–11.7 every time; the host is busy with the fleet's own work.

    FIXES I APPLIED: None — labels and priority verified correct.

    REMAINS: A quiet window on amd-6. Nothing for Drewry; the park's wake condition is the resumption path.

  14. dezren39 commented on Nov 29, 2026

    @dezren39
    MemberAuthor

    Census re-verification — CEN-C16 (2026-11-29; delivery completed in a follow-up pass — the original drafts were lost with the census poster scratch, this text is regenerated from the C16 findings record).

    Verdict: blocked (environmental gate, precisely specified)

    Blocker: the 5+5 quiet-host repetitions need three legs at once on host amd — 5-minute load ≤4, executor outside opencode.service, and a clean current-main checkout. Rechecked 2026-11-29 (05:42Z): load leg met (3.45) but opencode.service active and the primary clone still conflict-dirty — no valid oracle run possible.

    Strengths: the implementation is merged (PR #15797: 2ms epoch-bounded quantum, least-attained-service requeue, work-conserving) and the loaded-host evidence is recorded (PR #15916; medians ~9.6x/~8.2x against the 1.10x target under load 12–23, decision preserved on #1067). The resume condition is exact and non-person.
    Gaps: none in detail.
    Priority: priority/high — unchanged.
    Label actions (census): none (status/parked matches the gate).

  15. added
    priority/normal
    and removed
    priority/high
    on Nov 29, 2026
  16. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Priority validation 2026-11-29 (Felix): priority/high → priority/normal — scheduler implementation merged (PR #15797, evidence PR #15916); sole remainder is parked quiet-host benchmark repetitions — no longer time-sensitive

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

    @developing-today-fleet
    Contributor

    Lane 0640-BD — drew task 24183 via fleet agent next, premise-checked, re-parked (fresh gate evidence).

    Premise confirmed firsthand: the scheduler implementation is merged (PR #15797) and the loaded-host evidence is recorded (PR #15916); the sole remainder is the 5+5 quiet-host repetitions on host amd. No code slice remains.

    Fresh host check via fleet shell, 2026-11-29T17:48Z (host amd): load averages 13.35 / 6.98 / 5.14 — the load_5m ≤4 leg fails (the host is busy: multiple sibling-lane git processes at 55–65% CPU each, plus a python3 process at ~98%); opencode.service is active. Two of the three ready-condition legs fail, so no valid oracle run is possible this pass; no benchmarks run, no code changed.

    Disposition: task 24183 re-parked. Resume condition unchanged: load_5m ≤4 AND executor outside opencode.service AND a clean current-main checkout on the host; then 5× fuel_spin_isolation + 5× fuel_spin_persistent, update pkgs/id/benches/BASELINES.md and #1067.

    Priority validation 2026-11-29 (Felix): priority/normal confirmed correct — implementation merged, remainder is parked benchmark repetitions behind an environmental gate; not time-sensitive. No change.

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

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Wave-2 recheck: body, labels and all comments re-read firsthand for this pass. Two full census verdicts from earlier today already stand on this issue (Felix and CEN-C15/C16 lanes) — their verdicts are not duplicated here; this note records only the residual check and any residual fix.

    Residual check (kind/feature; priority/normal; status: status/parked; acceptance criteria present): no residual gaps found — verified complete, no changes.

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/mkind/featuremeta/enrichedpriority/normalqueue/parkedstatus/parkedwork/assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions