Skip to content

refactor(benchmarks): isolate canonical workload examples - #17

Merged
thejustinwalsh merged 3 commits into
feat/presentation-retained-workloadsfrom
feat/benchmark-workload-examples
Aug 4, 2026
Merged

refactor(benchmarks): isolate canonical workload examples#17
thejustinwalsh merged 3 commits into
feat/presentation-retained-workloadsfrom
feat/benchmark-workload-examples

Conversation

@thejustinwalsh

@thejustinwalsh thejustinwalsh commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • move every retained Presentation workload's authored content and public Text construction into a dedicated apps/benchmarks/src/workloads/ example module
  • add an exhaustive workload registry for camera, content-width, warm-update, and Icon Grid suspension policy while keeping renderer, canvas, RAF, telemetry, font delivery, and disposal in the persistent host adapter
  • isolate product, measurement, and conformance targets behind a lazy application-safe registry so direct font-baker and Wasm URL modules load only after an explicit low-level target selection
  • remove the Paragraph Stress presentation RAF allocation by reusing caller-owned motion state

Architecture

The seven comparison workloads now read as package-consumer examples: Text Ladder, Zoom Text, Icon Grid, Off-axis 3D, Dynamic Layout, Paragraph Stress, and Paint & Effects each visibly construct public @pmndrs/text Text objects in their own module. renderer/comparison-workload.ts remains the generic retained-scene adapter and contains no new Text(...) calls.

Low-level targets now live under benchmark/targets/product, measurement, and conformance. benchmark/targets.ts is a two-line lazy facade. A deterministic boundary test allowlists direct font-baker/Wasm imports to one low-level dependency adapter and resolves every registered target ID.

This changes benchmark application structure only. It does not add a public package API, change runtime/baker/Wasm artifacts, or change renderer ownership.

Verification

  • pnpm benchmarks:check — 271 unit tests, lint, formatting, production build, and exact package-size checks passed
  • pnpm --filter @pmndrs/text-benchmarks test — complete size, autoresearch, bidi/CJK contract, unit, headless conformance, and packed-consumer suite passed
  • pnpm benchmarks:check:react-doctor — no issues found
  • pnpm docs:check — zero conformance, producer-profile, or warning findings
  • sequential Presentation workload matrix — all seven workloads rendered visible DPR-2 framebuffer pixels with one renderer for Bitmap, MTSDF, and Slug on WebGPU and forced WebGL2
  • timed Presentation demo — complete authored sequence passed on WebGPU and forced WebGL2, including Advanced Shaping, both Icon Grid entries, focused-control Space capture, and final Off-axis 3D frame; observed Icon Grid rates were 59.8 FPS and 60.0 FPS

Review note

The React viewport remains a single generic host adapter in app.tsx; creating seven wrapper components would duplicate route/loading/evidence plumbing without making the library examples clearer. The existing host-facing optional entry view remains isolated behind the new factories; replacing it with seven exact runtime-state unions is intentionally outside this behavior-preserving structure change.

@thejustinwalsh thejustinwalsh changed the title feat/benchmark workload examples refactor(benchmarks): isolate canonical workload examples Aug 3, 2026
@thejustinwalsh
thejustinwalsh force-pushed the feat/benchmark-workload-examples branch from 01a4941 to c07c7d3 Compare August 4, 2026 01:44
@thejustinwalsh
thejustinwalsh merged commit 09a6f1d 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