Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.

Initial snapshot tests - #54

Open
fornwall wants to merge 10 commits into
mainfrom
start-snapshot-tests
Open

fornwall wants to merge 10 commits into
mainfrom
start-snapshot-tests

Conversation

@fornwall

@fornwall fornwall commented Nov 23, 2023

Copy link
Copy Markdown
Contributor

Part of #7.

Setup skeleton for snapshot tests:

  • tests/snapshots/in: Contains .wgsl, .glsl or .spvasm files as input.
  • tests/snapshots/in-spvasm: Contains the .spv files generated from the above .wgsl (using naga) or .glsl (using glslangValidator`) in files.
    • Not strictly necessary to have checked in, but might be good to track changes across wgsl and glsl compilers.
  • tests/snapshots/out-spirt: The .spirt files we generate from the files in the previous step.
  • tests/snapshots/out-spvasm: The .spv we generate from the files in the previous step.

Running cargo test generates files in the in-spvasm, out and out-spvasm directories. The CI check validates that files have not changed, and that the generated .spv files assembles and validates. If you are happy with generated changes as part of a PR, the updated snaphots should be included in the PR and be part of the review.

Future follow up work:

  • For a subset of compute shaders with a unit like structure, actually run them and validate that tests/snapshots/in-spvasm and tests/snapshots/out-spvasm produce the same output.
    • I have this in the pipeline, will submit as a follow up once we're happy with this.
  • Setup multiple output files for different transforms and passes?

@fornwall
fornwall requested a review from eddyb as a code owner November 23, 2023 07:18
@fornwall
fornwall force-pushed the start-snapshot-tests branch 12 times, most recently from e6299fb to 8175b64 Compare November 23, 2023 11:56
@fornwall
fornwall force-pushed the start-snapshot-tests branch from 8175b64 to ac5e584 Compare January 4, 2024 11:03
@fornwall
fornwall force-pushed the start-snapshot-tests branch from ac5e584 to 3371226 Compare January 4, 2024 11:16

This branch has not been deployed

No deployments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant