Skip to content

Mythic Masters: open-world frame budget (95th under 16.7 ms, no hitch, a party of six), hill climb to 8/10, rounds 1+ #3664

Closed

Description

@QuinnsCode

Score: 0/10 (target 8, on the owner's scale: agent judges halve their number, per the 2026-11-05 reset)

The owner's brief (2026-11-05): Mythic Masters' open world must be performant, especially once friends walk it together (#3663). The world is a heightfield continent with three ground patches rebuilt as you walk, instanced plants, a sky dome and weather, flocks and wild food (src/world/, docs/WORLD-EXPANSION.md, which already names the hitch: a patch rebuild is one frame's work, 16k vertices).

Goalpost: 8/10 from the owner

Scored on numbers, not taste, so each round prints the same table from the same recipe (bun run probe mythic-masters --js with the mythicMasters handle; a fixed walk of 90 seconds across a region border at a fixed hour, with a party of one and of six shown):

  1. Frame time. 95th percentile under 16.7 ms on this Mac's headless Chrome through the whole walk, and no single frame over 50 ms (the patch hitch gone: builds split over frames or moved to a worker).
  2. Draw calls and memory. Draw calls per frame and JS heap printed and flat across the walk; a party of six adds at most 12 draw calls and 60 MB.
  3. Load. Time to first walkable frame under 3 s on a cold cache locally, and the bytes it took, printed.
  4. Phones. The same walk at a phone viewport with the quality knob (@rustybuns/util/quality) on low stays under 16.7 ms at the 95th; no feature only works at high.
  5. A budget that holds. The numbers live in one test (test/budget.test.ts) that fails when a round regresses them, so the next climb can't spend them.

The loop

Each round is one PR against main that says "Part of #N" with the before/after table in the body. A fresh judge scores the five points, halves it, and the comment starts Score: x/10 (target 8) and ends Next: ...; then open "rounds N+ (from #N)", close this one with "Moved up to #new". Keep effect out of the per-frame code. At the target, a MANUAL RUN: for the owner's own walk on their phone.

Activity

  1. self-assigned this
    on Nov 5, 2026
  2. QuinnsCode commented on Nov 5, 2026

    @QuinnsCode
    OwnerAuthor

    Point 4 (phones), from Gizmo: #3682. It culls the open world's plants to the camera's view, and the quality tier now sets the renderer and a plant budget (low: full plants within 110 m, cards past that). Cosmo's round has the desktop walk, the hitch and the budget test.

    The same 90 s walk, before and now, back to back on main at e558f6c, headless Chrome on this Mac's GPU. Phone is 390×844 at 2× with ?quality=low.

    Row p95 p99 max late (>25 ms) draw calls triangles
    phone, low before 16.8 33.3 83.4 81 of 5293 72 4283k
    phone, low now 16.8 16.8 83.3 26 of 5364 70 612k
    desktop, party of 1 before 16.8 33.3 66.7 62 of 5329 97 4287k
    desktop, party of 1 now 16.8 16.8 83.3 50 of 5340 96 1697k

    The 95th sits on the 60 Hz beat both times on this Mac. Frame gaps here vary from run to run (an earlier run on main read 33.4 at the 95th), so the triangle count, 7× fewer on a phone, is the steady number. The 66–83 ms frames left are the patch rebuild that Cosmo's round is fixing. Phones are still guessed as high unless told ?quality=low, and the phone row isn't in the shared walk yet: #3683.

  3. QuinnsCode commented on Nov 5, 2026

    @QuinnsCode
    OwnerAuthor

    Score: 3/10 (target 8). Round 1, PR #3685. A fresh judge scored 6/10 and that is halved.

    Recipe: cd apps/mythic-masters && bun scripts/walk-budget.ts (90 s at 12 m/s, 11:00, calm weather, region 1 into region 3 at the midpoint; cold-cache load; headless Chrome on Metal). test/budget.test.ts holds it with MM_BUDGET=1.

    BEFORE (main)

    view p95 max frames > 50 ms draw calls heap MB load
    desktop 33.4 2083 56 83-233 117 -> 120 1.99 s, 6.2 MB
    phone 50.0 1367 120 67-99 119 -> 113 4.11 s, 6.2 MB

    NOW

    view p95 max frames > 50 ms draw calls triangles programs heap MB load
    desktop 16.8 (33.3 on a second run) 300 3 80-210 4.31 M 91 -> 135 117 -> 112 1.74 s, 6.2 MB
    phone 16.8 (all three runs) 83 3 67-99 4.31 M 46 -> 46 129 -> 113 1.34 s, 6.2 MB

    Judge, per point: frame time 1/2, draw calls and memory 1/2 (no party-of-six row), load 2/2, phones 1/2 (no quality knob yet, Gizmo's PR), budget test 1/2 (desktop limit loose, GPU-only).

    Files: mine are src/world/view.ts, scatterTurf in flora.ts, walker3d.ts, the perf and compile lines in main.ts, scripts/walk-budget.ts and test/budget.test.ts. Gizmo has the quality tier and plant culling.

    Next: cull or LOD the plants (4.3 M triangles drawn unculled), so desktop p95 stays under 16.7 ms every run; then find the creature shader variants still compiling mid-walk (programs 91 -> 135, the 300 ms max).

  4. QuinnsCode commented on Nov 5, 2026

    @QuinnsCode
    OwnerAuthor

    Moved up to #3686

  5. QuinnsCode commented on Nov 5, 2026

    @QuinnsCode
    OwnerAuthor

    Point 4, second PR from Gizmo: #3689 (Part of #3664, from main, merges clean after #3682). A phone is now guessed as mid at most, not high. The tier steps down a level when the 95th percentile sits over 18 ms for 4 s, and climbs back, no higher than it started, after 20 calm seconds.

    The same 90 s walk on main at e558f6c, headless Chrome on this Mac's GPU, no ?quality=. The phone is 390×844 at 2×.

    Row tier p95 p99 max late (>25 ms)
    phone before none: pixel ratio 2, antialias, shadows 16.8 33.3 83.4 81 of 5293
    phone now mid (guessed), no steps 16.8 16.8 66.7 25 of 5368
    desktop, party of 1 before none 16.8 33.3 66.7 62 of 5329
    desktop, party of 1 now high (guessed), no steps 16.8 33.3 66.7 98 of 5285

    Nothing changes on a desktop: the 62 → 98 late frames is run-to-run noise on this shared Mac. I also forced a step: burning 30 ms a frame on the phone page dropped it from mid to low, and 20 calm seconds later it climbed back to mid, with no errors. Left for after #3682 and #3689 merge (the plant budget following a step, one tier read in main.ts): #3683.

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions