Skip to content

Add a one-device option and test case callbacks - #4737

Merged
kainino0x merged 4 commits into
gpuweb:mainfrom
s-perron:user/s-perron/one-device
Nov 23, 2026
Merged

kainino0x merged 4 commits into
gpuweb:mainfrom
s-perron:user/s-perron/one-device

Conversation

@s-perron

@s-perron s-perron commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

These let a runtime capture each test case in a graphics debugger such
as RenderDoc, which can capture only one device at a time and has no
frame boundaries to capture between in the CTS.

  • --one-device (globalTestConfig.oneDevice) makes the device pool
    destroy its devices before it creates a new one.
  • globalTestConfig.testCaseStartCallback, deviceAcquiredCallback
    and testCaseEndCallback are called when a test case starts, when it
    acquires a device from the device pool, and when it has finished.

Draft for input on the design. The motivation is capturing each test case in RenderDoc from Dawn's standalone CTS runner.

Issue: #


Requirements for PR author:

  • All missing test coverage is tracked with "TODO" or .unimplemented().
  • New helpers are /** documented */ and new helper files are found in helper_index.txt.
  • Test behaves as expected in a WebGPU implementation. (If not passing, explain above.)
  • Test have be tested with compatibility mode validation enabled and behave as expected. (If not passing, explain above.)

Requirements for reviewer sign-off:

  • Tests are properly located.
  • Test descriptions are accurate and complete.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Tests avoid over-parameterization (see case count report).

When landing this PR, be sure to make any necessary issue status updates.

These let a runtime capture each test case in a graphics debugger such
as RenderDoc, which can capture only one device at a time and has no
frame boundaries to capture between in the CTS.

- `--one-device` (`globalTestConfig.oneDevice`) makes the device pool
  destroy its devices before it creates a new one.
- `globalTestConfig.testCaseStartCallback`, `deviceAcquiredCallback`
  and `testCaseEndCallback` are called when a test case starts, when it
  acquires a device from the device pool, and when it has finished.
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Results for build job (at def5c97):

 Test case/subcase counts did not change.

@kainino0x kainino0x left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/webgpu/util/device_pool.ts Resolved
Review feedback: destroy every device first, then await them all.
@s-perron
s-perron marked this pull request as ready for review November 23, 2026 14:37
The cache hashes cover each test's imports, which include the changed
framework files. Generated with 'npx grunt run:generate-cache'.
@kainino0x
kainino0x merged commit ba2dfb8 into gpuweb:main Nov 23, 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.

2 participants