Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wgsl: Implement determinant validation tests #3533

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

zoddicus
Copy link
Contributor

This only tests the shapes of the inputs compilation, and not that later validation passes, since this builtin has undefined error.


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 in the test tree.
  • Test descriptions allow a reader to "read only the test plans and evaluate coverage completeness", and accurately reflect the test code.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Helpers and types promote readability and maintainability.

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

@zoddicus zoddicus added the wgsl label Mar 19, 2024
@zoddicus zoddicus requested review from ben-clayton and dneto0 March 19, 2024 20:51
@zoddicus zoddicus self-assigned this Mar 19, 2024
Copy link
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

Thanks!

import { ShaderValidationTest } from '../../../shader_validation_test.js';

export const g = makeTestGroup(ShaderValidationTest);

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: This was a bit hard to read. I'd suggest adding a comment

// Generate a dictionary mapping each matrix type variation (columns,rows, floating point type) to a nontrivial matrix value of that type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

const type = t.params.type;
const arg = kMatrixCases[`mat${cols}x${rows}_${type}`];
t.expectCompileResult(
cols === rows,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice.

@zoddicus zoddicus force-pushed the addDeterminantValidation branch from 5bdd7e9 to d90b525 Compare March 21, 2024 20:04
This only tests the shapes of the inputs compilation, and not that
later validation passes, since this builtin has undefined error.
@zoddicus zoddicus force-pushed the addDeterminantValidation branch from d90b525 to 3d63f49 Compare March 21, 2024 20:22
@zoddicus zoddicus merged commit 93ed962 into gpuweb:main Mar 21, 2024
1 check passed
@zoddicus zoddicus deleted the addDeterminantValidation branch March 21, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants