wgsl-tooling-wg / wgsl-linker

enriched WGSL with support for import/export and more
BSD 2-Clause "Simplified" License
3 stars 1 forks source link

tool to verify parser/linker on example wgsl files #28

Open mighdoll opened 5 days ago

mighdoll commented 5 days ago

Create a repeatable way to test the linker against sample wgsl files from separate repositories like the unity collection and the webgpu samples.

Perhaps something like this: . specify a particular git revision from the external repo to download . use a glob syntax to select .wgsl files within the external repo . run the wgsl-linker over every file, making sure that no parsing/linking failures are found

. later could extend this to emit some basic reflection metadata for snapshot test verification (e.g. names of root level elements found)

mighdoll commented 4 days ago

Looks like vitest might work well for this. Trivial to generate tests dynamically from data files. And supports parallel execution too for throughput (separate test files or maybe virtual test modules). And benchmarking too. But we'll have to test whether scaling is a problem for large test suites (e.g. the CTS)

For verification, one idea is to compare a few of the extracted results with @brendan-duncan's reflect library.