Skip to content

refactor(benchmarks): extract persistent viewport controllers - #23

Merged
thejustinwalsh merged 2 commits into
feat/benchmark-workload-instancesfrom
feat/benchmark-route-viewports
Aug 4, 2026
Merged

refactor(benchmarks): extract persistent viewport controllers#23
thejustinwalsh merged 2 commits into
feat/benchmark-workload-instancesfrom
feat/benchmark-route-viewports

Conversation

@thejustinwalsh

@thejustinwalsh thejustinwalsh commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • move Bitmap, MTSDF, and Slug persistent live-text viewport controllers from the route coordinator into surfaces/benchmark
  • colocate warm update queues, host leases, loading/error chrome, telemetry attributes, and shared viewport contracts with their rendered surfaces
  • preserve literal dynamic renderer imports and add a boundary test requiring every static renderer reference to remain type-only
  • reduce app.tsx from 2,647 to 1,661 lines while leaving route orchestration and the retained comparison viewport in place

Evidence

  • mise exec -- pnpm benchmarks:check
    • 53 test files / 301 tests before the boundary fixture; focused boundary adds 3 passing cases
    • TypeScript, OXLint, Oxfmt, scripts, size gates, and production build passed
  • production build review
    • separate bitmap-text, mtsdf-text, and slug-text chunks retained
    • no ineffective-dynamic-import warnings after converting renderer references to explicit import type
  • mise exec -- pnpm benchmarks:check:react-doctor
    • React Doctor 0.7.2 reported no issues
  • mise exec -- pnpm --filter @pmndrs/text-benchmarks test:presentation-workloads
    • all 42 retained-scene cells rendered visible pixels across all techniques and both backends
    • exactly one renderer remained alive per lane
  • mise exec -- pnpm --filter @pmndrs/text-benchmarks test:presentation-demo
    • both 60-second demos traversed Advanced Shaping and the complete authored workload sequence
    • both returned to Off-axis / 3D with one renderer
    • Icon Grid measured 60.02 FPS on WebGPU and 60.36 FPS on forced WebGL2
  • mise exec -- pnpm docs:check
    • OKF v0.2: 0 errors, 0 warnings

Boundaries

  • Persistent renderer/canvas/RAF/GPU timer ownership remains in the route host.
  • The extracted controllers retain the existing public data/test-id probe contract exactly.
  • No renderer implementation or package API changed.

Stacked on #22.

@thejustinwalsh thejustinwalsh changed the title feat/benchmark route viewports refactor(benchmarks): extract persistent viewport controllers Aug 3, 2026
@thejustinwalsh
thejustinwalsh marked this pull request as ready for review August 3, 2026 15:57
@thejustinwalsh
thejustinwalsh force-pushed the feat/benchmark-route-viewports branch from 7b640cc to 85c42c5 Compare August 4, 2026 01:44
@thejustinwalsh
thejustinwalsh merged commit 1ee47d7 into main Aug 4, 2026
1 check 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.

1 participant