This is the conformance test suite for React Native WebGPU.
It tests the behaviors defined by the WebGPU specification. This repository is forked from the WebGPU CTS and currently targets the react-native-wgpu
library. In the future, we hope to support any WebGPU-compliant React Native module.
The contents of this test suite are considered normative; implementations must pass them to be WebGPU-conformant. Mismatches between the specification and tests are bugs.
To install dependencies for the conformance test suite, run the following command:
npm install
For ios:
pod install --project-directory=ios
The React Native portion of this test suite is built on top of React Native Test App. Build instructions for your target platform can be found here: https://github.com/microsoft/react-native-test-app/wiki/Quick-Start#platform-specific-instructions. The conformance test suite targets Hermes by default.
To run on an ios simulator, run:
npm run ios
To run tests, click the "Run Tests" button on the app homepage. Once tests complete, the app will generate a summary of failed and skipped tests, along with a list of all tests that failed. The tests will take a few minutes to run. A log of the current running test can be viewed in the Metro console.
For the react-native-wgpu
library, there are a few blockers for generating a full inventory of tests passing. Here are the test suites that currently crash or hang:
webgpu/api/operation/adapter
: Main thread hangs on a promise await. See: wcandillon/react-native-webgpu#126webgpu/api/operation/buffers
:map.spec
andmap_oom.spec
have tests that crash when trying to allocate a buffer.remapped_for_write
,mappedAtCreation,mapState
,mapAsync,mapState
,mappedAtCreation
.webgpu/api/operation/command_buffer
: Tests with compressed texture formats seem to hang indefinitely (e.g. astc-4x4-unorm). Tests following the copyTextureToTexture tests all seem to time out, possibly due to the depth32float_stencil8 format.webgpu/api/operation/memory_sync
: The "either" interpolation option is not supported, causing shader compilation to crash. Shader compilation crashes should likely not crash the app. Tests run to completion when Dawn is updated to v6592+.webgpu/api/operation/render_pipeline
: Tests crash with an unknown error inpipeline_output_targets.spec
.webgpu/api/operation/rendering
: Same shader compilation issue asmemory_sync
tests. depth_clip_clamp has a hang when mapping buffer data asynchronously.webgpu/api/operation/shader_module
: Different shader compilation issue.webgpu/api/operation/storage_texture
: Same asmemory_sync
tests.webgpu/api/operation/vertex_state
: Same asmemory_sync
tests.webgpu/api/operation/reflection
: Attribute tests crash.
Please read the introductory guidelines before contributing.
Other documentation may be found in docs/
and in the helper index (source).
Read CONTRIBUTING.md on licensing.
For realtime communication about WebGPU spec and test, join the #WebGPU:matrix.org room on Matrix.