Repository navigation
Fix red browser test on main: faster software-GL rendering, isolated smoke-test scenes - #3
Merged
Merged
Conversation
The browser job on main failed after the kidney scene: the harness reused
one page and its page.goto('about:blank') timed out (30 s) while the
renderer was still busy with software-GL frames. Reproduced by pinning the
browser to two cores (kidney then also misses its 90 s 45-frame budget).
Root cause is how slowly kidney renders under SwiftShader:
- adaptive resolution counted frames (20 per step, -15 %, floor 0.5), so
at ~2 s/frame it needed minutes to adapt. It now closes a window after
20 frames or 0.75 s, judges the median frame time (a lone shader-compile
stall does not count), steps in proportion to the overrun (cost ~ pr^2)
and may go down to 0.35
- with bloom off (H&E mode) the scene went straight to the multisampled
canvas; a device that had to lower its resolution now renders through
the composer's single-sample target instead. Fast GPUs are unchanged
- kidney's ~3,700 epithelial and podocyte nuclei, inside translucent
membranes, use an 80- instead of a 180-triangle sphere
smoke.mjs gives every scene its own browser context, so no navigation has
to wait for the previous scene to unload; it bounds page.evaluate/close,
records a failing scene instead of crashing the run, and drops the
pointless switch back to 3D mode at the end of each scene.
Two cores, every scene and view in all three modes: 28/28 pass in
13.6 min (kidney 118 s; before: kidney failed at 229 s).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016pbMe2Yw2abpatNN7kc6j2
Mecca-Research
marked this pull request as ready for review
September 29, 2026 20:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After #2 merged, one job on
mainwent red (CI run 36568871236): Every 3D scene renders (headless Chromium). The other jobs passed, including the reproducibility check that #2 fixed.The harness reuses one page and moves between scenes through
about:blank. After the kidney scene, the renderer was still busy with slow software-GL frames, so that navigation timed out and crashed the run. The same code had passed on the PR run, where kidney took 136 s instead of 220 s. The timeout therefore depends on how fast the runner is.Reproduction
Pinning the browser to two cores (
taskset -c 0,1) reproduces a slow runner: kidney takes 229 s and misses its 90 s 45-frame budget. The underlying problem is that kidney renders very slowly under SwiftShader, and every fixed timeout in the harness only just fits it.Profile at the lowest resolution: simulation JS costs about 1 ms per frame and an empty scene about 94 ms. The confocal volume costs about 300 ms. The 3D nephron costs about 600 ms: 3,690 epithelial cells, each drawn as two icospheres, about 1.3 M triangles.
Changes
js/engine/stage.js: adaptive resolution that actually adapts on slow GPUssetFixedPixelRatio) are unaffected.js/scenes/kidney.jstests/e2e/smoke.mjspage.evaluate,closeandscreenshotcalls have explicit time limits.Testing
node tests/e2e/smoke.mjs --all --modes: 28/28 PASS in 13.6 min. Kidney takes 118 s; before this change it failed at 229 s. Colony dropped from 102 s to 44 s. With the two-core pin, kidney reaches its 45 frames about 46 s after loading, well within the 90 s limit.node --test tests/models/*.test.mjs: 98/98 pass.git diff --checkis clean, and the tests leave tracked files unchanged.Not verified here: frame rates on a real GPU. On fast GPUs the new logic keeps the old full-resolution, multisampled path, because the median frame time stays under 20 ms.
🤖 Generated with Claude Code
https://claude.ai/code/session_016pbMe2Yw2abpatNN7kc6j2
Generated by Claude Code