Skip to content

Rectangle FPS benchmark: 4k/8k/16k counts, 16k cap for L2/L3 - #64

Merged
wouterlucas merged 3 commits into
mainfrom
feat/rectangle-fps-benchmark
Nov 30, 2026
Merged

wouterlucas merged 3 commits into
mainfrom
feat/rectangle-fps-benchmark

Conversation

@wouterlucas

Copy link
Copy Markdown
Contributor

What

Adds the moving-rectangle FPS benchmark to the suite (node index.js --rectangles / npm run rectangles):

  • shared seeded scene + FPS sampler (shared/rectangleBenchmark.js) and per-framework adapters (shared/rectanglePlatformAdapters.js)
  • runner (testrunner/runRectangles.js) isolating every framework/count slice in a fresh browser process under 6x CPU throttling, with partial results saved per slice
  • L2 RAF cross-check (rafFps/rafChecks), FPSMeter-style meterFps and frame-pacing stats in the JSON, plus an FPS section in the HTML overview
  • tests in tests/ (node --test tests/rectangleBenchmark.test.js tests/rectangleResults.test.js)

Count changes

  • Default counts are now 4,000 / 8,000 / 16,000 (previously 8k/16k/32k/64k); still overridable via RECTANGLE_COUNTS.
  • The Lightning 2 variants and the L3 renderer variants reject counts above 16,000 before creating elements (16-bit quad indices wrap past 16,384 slots); such slices are reported as unsupported 0-FPS failures instead of measuring wrapped geometry.

Notes

  • No results files and no renderer-local experiment are included in this PR; both remain local-only.
  • .env now defaults to the WebGL-only set (canvas/bitmap/core variants off).

… L2/L3

Adds the moving-rectangle FPS benchmark (node index.js --rectangles /
npm run rectangles): shared seeded scene + FPS sampler, per-framework
adapters, a runner that isolates every framework/count slice in a fresh
browser process under 6x CPU throttling, RAF cross-check for L2, and
JSON/HTML reporting alongside the existing results.

Default counts are now 4,000 / 8,000 / 16,000 (override with
RECTANGLE_COUNTS). The Lightning 2 variants and the L3 renderer variants
reject counts above 16,000 before creating elements (16-bit quad indices
wrap past 16,384 slots); such slices are reported as unsupported 0-FPS
failures instead of measuring wrapped geometry.
@wouterlucas
wouterlucas force-pushed the feat/rectangle-fps-benchmark branch from 4cd0915 to 6e27c66 Compare November 25, 2026 22:08
Comment thread tests/rectangleResults.test.js Fixed
The WebGL FTL rectangle slice now renders with FTL's lightweight
OutlineShader (hard-edged, instanced, alphaInBleed path) instead of
BorderShader, and moves rectangles via el.setPosition(x, y) so the
position-only world-state fast path is exercised. Falls back to
x=/dirty() when setPosition is unavailable (canvas/bitmap variants).
The overview test asserted the escaped HTML contains no raw <script> tag
with a case-sensitive regex, which CodeQL flags as a bad HTML filtering
regexp (uppercase <SCRIPT> would bypass it). Assert with /i and add an
uppercase <SCRIPT> payload to the fixture to prove escaping handles it.
@wouterlucas
wouterlucas merged commit bd959a9 into main Nov 30, 2026
2 checks passed
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.

2 participants