Skip to content

gpui: Add frame snapshot oracle and render benchmarks - #62585

Draft
mikayla-maki wants to merge 1 commit into
mainfrom
gpui-frame-snapshot-oracle-benchmarks
Draft

gpui: Add frame snapshot oracle and render benchmarks#62585
mikayla-maki wants to merge 1 commit into
mainfrom
gpui-frame-snapshot-oracle-benchmarks

Conversation

@mikayla-maki

Copy link
Copy Markdown
Member

Summary

  • add an exact, test-support-gated FrameSnapshot covering scene primitives, hit testing, dispatch/focus state, cursor and tab requests, deferred draws, and accessibility updates
  • add a deterministic dual-window frame oracle with a walk-vs-walk storybook and property-test scaffolding
  • add GPUI frame-production Criterion benchmarks for layout, scene assembly, presentation proxies, and a scripted 300-frame workload
  • report layout/prepaint and scene-assembly phase histograms through the existing GPUI benchmark report
  • document snapshot canonicalization and extending storybook coverage

Canonicalization

Oracle windows share the test context's text system and sprite atlas. Scene order remains semantic, and primitive floating-point fields are compared by their IEEE-754 bit representation.

The oracle work also moved ordinary animation timing onto the GPUI executor clock so deterministic tests do not leak wall-clock time.

Validation

  • walk-vs-walk storybook passed across 100 scheduler seeds
  • generated walk-vs-walk property test passed with seeds 0, 1, 7, 42, and 99
  • GPUI animation tests passed
  • cargo check -p gpui --features test-support
  • cargo check -p benchmarks --bench gpui_frame_production
  • ./script/clippy -p gpui --features test-support
  • cargo fmt --all
  • git diff --check

Full Criterion sampling and the <5% machine-local variance check remain to be run on the target benchmark machine.

Suggested .rules additions

For GPUI code whose behavior depends on elapsed time, use the context executor's clock (cx.background_executor().now()) instead of scheduler::Instant::now() or Instant::elapsed(). The executor clock follows the deterministic test clock while production executors still use real time.

Release Notes:

  • N/A

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 13, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant