Skip to content

Add validation tests for statement behavior analysis#3506

Merged
alan-baker merged 3 commits intogpuweb:mainfrom
alan-baker:statement-behavior
Mar 15, 2024
Merged

Add validation tests for statement behavior analysis#3506
alan-baker merged 3 commits intogpuweb:mainfrom
alan-baker:statement-behavior

Conversation

@alan-baker
Copy link
Contributor

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 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.

@alan-baker alan-baker requested review from dneto0 and jrprice March 14, 2024 19:06
Copy link
Contributor

@jrprice jrprice left a comment

Choose a reason for hiding this comment

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

LGTM with a couple of minor comments.

for5: `for (;; return ) { }`,
for6: `for (;;) { continue; break; }`,
// while loops always have break in their behaviors.
switch1: `switch (1) { case 1 { } }`,
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is invalid because there's no default clause - was there something specific to the behavior analysis that it was supposed to be testing instead?


const kInvalidFunctions = {
next_for_type: `fn foo() -> bool { }`,
next_return_for_type: `fn foo() -> bool { if true { return true } }`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing semicolon on the return statement, might cause it to be rejected for the wrong reasons.

@alan-baker alan-baker enabled auto-merge (squash) March 15, 2024 17:34
@alan-baker alan-baker merged commit 249807a into gpuweb:main Mar 15, 2024
@alan-baker alan-baker deleted the statement-behavior branch March 15, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants