Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gpuweb/cts
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0a2e3d2e4ceee18c43a1b59aac245963b8df3d7c
Choose a base ref
..
head repository: gpuweb/cts
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 184bd8b97a4508acdab66648a613ae8070aa9c95
Choose a head ref
Showing with 18 additions and 6 deletions.
  1. +15 −5 src/webgpu/shader/validation/parse/diagnostic.spec.ts
  2. +3 −1 src/webgpu/shader/validation/statement/statement_behavior.spec.ts
20 changes: 15 additions & 5 deletions src/webgpu/shader/validation/parse/diagnostic.spec.ts
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import { ShaderValidationTest } from '../shader_validation_test.js';

export const g = makeTestGroup(ShaderValidationTest);

const kSpecDiagnosticRules = ['derivative_uniformity'];
const kSpecDiagnosticRules = ['derivative_uniformity', 'subgroup_uniformity'];
const kSpecDiagnosticSeverities = ['off', 'info', 'warning', 'error'];
const kDiagnosticTypes = ['attribute', 'directive'];

@@ -124,9 +124,14 @@ g.test('warning_unknown_rule')
g.test('valid_locations')
.specURL('https://gpuweb.github.io/gpuweb/wgsl/#diagnostics')
.desc(`Tests valid locations`)
.params(u => u.combine('type', kDiagnosticTypes).combine('location', keysOf(kValidLocations)))
.params(u =>
u
.combine('type', kDiagnosticTypes)
.combine('location', keysOf(kValidLocations))
.combine('rule', kSpecDiagnosticRules)
)
.fn(t => {
const diag = generateDiagnostic(t.params.type, 'info', 'derivative_uniformity');
const diag = generateDiagnostic(t.params.type, 'info', t.params.rule);
const code = kValidLocations[t.params.location](diag);
let res = true;
if (t.params.type === 'directive') {
@@ -143,9 +148,14 @@ g.test('valid_locations')
g.test('invalid_locations')
.specURL('https://gpuweb.github.io/gpuweb/wgsl/#diagnostics')
.desc(`Tests invalid locations`)
.params(u => u.combine('type', kDiagnosticTypes).combine('location', keysOf(kInvalidLocations)))
.params(u =>
u
.combine('type', kDiagnosticTypes)
.combine('location', keysOf(kInvalidLocations))
.combine('rule', kSpecDiagnosticRules)
)
.fn(t => {
const diag = generateDiagnostic(t.params.type, 'info', 'derivative_uniformity');
const diag = generateDiagnostic(t.params.type, 'info', t.params.rule);
t.expectCompileResult(true, kInvalidLocations[t.params.location](''));
t.expectCompileResult(false, kInvalidLocations[t.params.location](diag));
});
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ const kValidStatements = {
while3: `while true { continue; break; }`,

switch1: `switch 1 { default { } }`,
swtich2: `switch 1 { case 1 { } default { } }`,
switch2: `switch 1 { case 1 { } default { } }`,
switch3: `switch 1 { default { break; } }`,
switch4: `switch 1 { default { } case 1 { break; } }`,

@@ -130,7 +130,9 @@ g.test('invalid_functions')
const kValidFunctions = {
empty: `fn foo() { }`,
next_return: `fn foo() { if true { return; } }`,
unreachable_code_after_return_with_value: `fn foo() -> bool { return false; _ = 0; }`,
no_final_return: `fn foo() -> bool { if true { return true; } else { return false; } }`,
no_final_return_unreachable_code: `fn foo() -> bool { if true { return true; } else { return false; } _ = 0; _ = 1; }`,
};

g.test('valid_functions')