Skip to content

Stage 3: Low and High for the cellar, and cheaper on both - #115

Merged
ChefControl merged 8 commits into
mainfrom
claude/stage3-graphics-267070
Oct 19, 2026
Merged

ChefControl merged 8 commits into
mainfrom
claude/stage3-graphics-267070

Conversation

@ChefControl

Copy link
Copy Markdown
Owner

Stage 3 (the cellar) gets a Low and a High version under the Graphics setting, plus fixes that make both cheaper. Stacked on #114.

Owner's decisions (2026-10-19): today's stage 3 look is High, and Low is a cut-down copy of it for phones. The exception is the Undertow's figures: today's look counts as Low, and High is finer. Every Low cut below was approved.

Both settings (no visible change)

  • Shadows only from what could be on screen (levelCull.ts). The sun's shadow box is fitted to the floor on screen. The Undertow's figures cast their shadows only while they, or their shadow, could be seen. From the ring they used to cast 388k triangles of shadow while off screen; now it's 8.5k.
  • The fans' shadows come from a plainer copy (swarm.ts): snapped to a 4 cm grid, and the trim (eyes, buttons) casts none. That's 244k → 97k triangles.
  • A cheaper merge check (batch.ts): what isn't merged is looked at one frame in eight. Cost per frame: 1.4 → 0.5 ms, or 4 → 1.5 ms with the CPU slowed 4×.

Low

  • 4 stand-in lamps instead of 14, taking the lamps that light the spot most, fading as they swap.
  • No shadows from small or rod-thin things, and none from the fans.
  • The figures a notch plainer: fewer sides on their balls.
  • Half the hatch's smoke puffs.

High

  • The Undertow's figures are finer: coat buttons, a front seam, a hem, pocket flaps and a pocket square, shirt cuffs, thumbs, round trousers with creases and cuffs, rounded shoes on soles. Every ball now gets as many sides as its size needs: a 4 mm glint used to be a 252-triangle sphere.
  • The wrestlers and referee are finer: ears, a nose, eye glints, a navel, thumbs, toes, a cord on the belt, and the referee's sash bow.

Speed

Measured on a Mac (M4) at 393×852, back to back. The scenes are Fukure's rush (1,250 fans, everything bought: the new demo option &full) and the Undertow club. The frame rate is shown at full speed and with the CPU slowed 4×; frame-time p90/p95/p99 are all 16.7 ms at full speed in both versions.

Scene Before After
Ring rush, High 897 calls · 1.16M tris · 60 / 37 fps 677 calls · 619k tris · 60 / 44 fps
Ring rush, Low 881 calls · 1.0M tris · 60 / 41 fps 520 calls · 423k tris · 60 / 51 fps
Club, High 733 calls · 1.12M tris · 60 / 39 fps 581 calls · 567k tris · 60 / 44 fps
Club, Low 717 calls · 1.02M tris · 60 / 42 fps 512 calls · 362k tris · 60 / 52 fps

The frame's own JS time at p50 went 6.0 → 4.8 ms (ring rush, High) and 5.1 → 3.8 ms (ring rush, Low). With the CPU slowed 4×: 24 → 21 ms and 22 → 18 ms.

The profile also showed the iPhone's limit is the graphics chip's geometry work (the shadow pass and the moving people), not pixels. A quarter of the pixels saved only 11% of GPU time. That's why the cuts go after triangles, lamps and shadows.

Luck

Everything new is made on dice of its own. With the same seed, loading the cellar on Low and on High draws the same 69,789 numbers from the same places. The test checks this.

Tests

test/stage3Graphics.test.ts (new, 6 tests): the luck, the lamps, the shadows, the figures, the wrestlers, and the shadow fit and culling. These files pass locally: eyecandy, graphics, stage3, undertow, offer, crowd, finishers, cellarLooks, monte. The full suite runs on CI.

Docs: a stage 3 section in docs/graphics.md.

🤖 Generated with Claude Code

@ChefControl
ChefControl added this pull request to stack #116 October 19, 2026 13:44
Base automatically changed from claude/stage3-front-restaurant to main October 19, 2026 13:49
ChefControl and others added 7 commits October 19, 2026 16:49
…nd and line), for timing Fukure's rush

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…or the fans and the Undertow's figures, a cheaper merge check; on Low four lamps, no small shadows, no fans' shadows, half the hatch's smoke

- levelCull.ts: down in the cellar the sun's shadow box is fitted to the floor on screen, turned square to the
  screen; the Undertow's figures cast only while they or their shadow could be seen (a third of a boss night's
  shadow pass came from the club, off screen)
- swarm.ts: the fans cast from a copy snapped to a 4 cm grid, the trim (eyes, buttons) not at all; none on Low
- family.ts: a figure's merged parts cast a plainer copy of what was made to cast; on Low only the bigger pieces
- batch.ts: what isn't merged is looked at one frame in eight (1.4 -> 0.5 ms a frame in Fukure's rush); a shadow
  put out or back moves a mesh to the right batch without a strike against it
- cellar.ts: on Low, four stand-in lamps take the four nearest where the camera looks, fading as they swap; small
  or rod-thin things cast no shadow
- hatchFx.ts: half the puffs on Low

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and High finer (coat buttons, hem and pockets, shirt cuffs, thumbs, round trousers and soled shoes), each ball given the sides its size wants; Low's lamps set each time the cellar's drawn

- family.ts flatten: Low's merged mesh is made just as the one mesh was (on the game's luck), its balls a notch
  plainer; High's, on dice of its own, with the pieces only it has (fine/finePiece) and without Low's blocks (lowOnly)
- angler.ts: Al's freckles, nostrils, buttons and welts baked from a six-sided dot (a centimetre across)
- levelCull.ts eachDrawing: what's done each time the cellar's drawn, scene, menu or not (Low's four lamps)
- cellar.ts: the stand-ins go to the lamps that light the spot most, not just the nearest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…humbs, toes, a cord round the belt) and referee (his sash's bow, a thumb); tests for stage 3's Low and High

test/stage3Graphics.test.ts: the luck the same on either, all fourteen lamps on High and four standing in on Low, no
small things' or fans' shadows on Low, the figures finer on High and plainer on Low, the wrestlers' finer things on
High only, the shadows fitted to the screen down here and the figures casting only when they could be seen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… their limits on CI under coverage: 29.5 s of 30, 13.4 s of 15 on #114)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r games, 17 s under coverage on CI; the one after crashed into its still-running load)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ChefControl
ChefControl force-pushed the claude/stage3-graphics-267070 branch from d80294b to 7282a73 Compare October 19, 2026 13:49
…(the offer's first test timed out at 15.7 s of 15)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ChefControl
ChefControl merged commit 8c31265 into main Oct 19, 2026
7 checks passed
@ChefControl
ChefControl deleted the claude/stage3-graphics-267070 branch October 19, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant