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

[pull] main from gpuweb:main #15

Merged
merged 99 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
d849b67
validation: clamp low_high test must reference the test function (#3899)
dneto0 Aug 13, 2024
24725f3
fix smoothstep validation (#3900)
dneto0 Aug 13, 2024
701e646
Fix textureSampleLevel tests. (#3903)
greggman Aug 14, 2024
a17d71d
fix smoothstep execution: only compute valid cases when const (#3901)
dneto0 Aug 14, 2024
5c57149
clamp validation: conditionally include test function (#3904)
dneto0 Aug 14, 2024
67dc033
Compat: Fix textureLoad with depth texture test (#3902)
greggman Aug 15, 2024
c279d02
extractBits validation: conditionally include tested code in the shad…
dneto0 Aug 15, 2024
d4d5926
insertBits validation: conditionally include tested code in the shade…
dneto0 Aug 15, 2024
4ed3eaf
Fix for texture_utils.ts (#3907)
greggman Aug 15, 2024
4ccb5a4
Stop Sooner (#3889)
greggman Aug 15, 2024
a96693c
ldexp validation: conditionally include tested code in the shader (#3…
dneto0 Aug 16, 2024
32559ad
Reduce the number of shader modules used in texture tests (#3910)
greggman Aug 21, 2024
f8472c9
Print more info in certain asserts (#3911)
greggman Aug 21, 2024
6632746
Choose smaller texture sizes (#3912)
greggman Aug 21, 2024
348b113
Fix for 16f min (#3913)
petermcneeleychromium Aug 22, 2024
b2e8800
WGSL textureGather tests (#3898)
greggman Aug 22, 2024
479198b
WGSL textureGatherCompare tests (#3914)
greggman Aug 22, 2024
072d7b6
Tests for subgroup builtin values in fragment shaders (#3915)
alan-baker Aug 23, 2024
9bde593
Add Chrome OT token for "WebGPU Subgroups Feature" (#3895)
dneto0 Aug 23, 2024
fd4023c
Fix subgroup_size fragment tests to be valid WGSL. (#3916)
Kangz Aug 26, 2024
08ed9c3
Fix for textureGather (#3918)
greggman Aug 26, 2024
c23a47b
Only report on first texture builtin error (#3919)
greggman Aug 26, 2024
2b72ebb
CTS for subgroupAdd and subgroupMul (#3897)
alan-baker Aug 27, 2024
13d5f17
Remaining subgroup validation tests (#3920)
alan-baker Aug 28, 2024
19bb6db
Print more info for texture builtins (#3921)
greggman Aug 28, 2024
a72996c
Skip tests failing when VideoFrame is not supported. (#3917)
Kangz Aug 28, 2024
d61b6f2
Fix textureGather (#3922)
greggman Aug 28, 2024
3d24384
Fix another edge case for textureGather. (#3923)
greggman Aug 30, 2024
9b30f7a
Execution tests for subgroupAny and subgroupAll (#3924)
alan-baker Aug 30, 2024
07d31bd
Fixes for no attachments being an error. (#3927)
Kangz Sep 3, 2024
6935dbb
Remove GPUShaderModuleDescriptor.sourceMap (#3928)
beaufortfrancois Sep 3, 2024
6d45325
Get mip level mix weights just once. (#3929)
greggman Sep 3, 2024
e3a6ae6
Use the same pipeline for identifySamplePoints (#3930)
greggman Sep 3, 2024
d861142
Improve cube-array error logging (#3931)
greggman Sep 3, 2024
39d1b23
Fix interpolate test for compat (#3932)
greggman Sep 4, 2024
a358a6c
Compat: rg32xxx texture usage is not a WGSL error (#3933)
greggman Sep 4, 2024
a5065e3
wgsl: Add another phony assignment test case (#3925)
jrprice Sep 4, 2024
9045fed
Fixes for no attachments being an error in webgpu/compat (#3934)
Kangz Sep 5, 2024
dfe6729
More WGSL flat issues (#3935)
greggman Sep 6, 2024
ccab92d
Fragment tests for subgroupAny and subgroupAll (#3936)
alan-baker Sep 6, 2024
eca9b0d
Don't identify sample points for texture builtin (#3937)
greggman Sep 6, 2024
6c236a3
Add Origin Trial token for Subgroups in localhost:8080 (#3939)
dneto0 Sep 6, 2024
7568697
Avoid subnormals in expression validation for quantizing types (in no…
petermcneeleychromium Sep 6, 2024
e42b1f6
Remove all the tests about `maxInterStageShaderComponents` (#3945)
Jiawei-Shao Sep 11, 2024
9619e6a
Add shader validation tests about `clip_distances` and the extension …
Jiawei-Shao Sep 11, 2024
3208356
Minor initial fix for missing comma (#3943)
petermcneeleychromium Sep 11, 2024
e5c2484
Fix TestCaseRecord proxy (#3948)
greggman Sep 12, 2024
e321371
Remove non-standard GPUAdapter requestAdapterInfo() method (#3941)
beaufortfrancois Sep 13, 2024
383aa28
Add shader validation tests about built-in variable `clip_distances` …
Jiawei-Shao Sep 14, 2024
2f55512
wgsl: Add short-circuiting validation tests (#3567)
jrprice Sep 16, 2024
93c2ca0
Fix more compat textureBindingViewDimension validation (#3950)
shrekshao Sep 17, 2024
561d525
Add validation tests on clip_distances and maxInterStageShaderVariabl…
Jiawei-Shao Sep 19, 2024
1967655
Add shader execution tests about `clip_distances` (#3952)
Jiawei-Shao Sep 19, 2024
9387aa0
Add validation tests on the limit of max vertex output location with …
Jiawei-Shao Sep 19, 2024
99ea6fb
wgsl: test reservation of 'noncoherent' and 'non_coherent' (#3957)
dneto0 Sep 19, 2024
a95f649
Add the largest float representable as integer (signed/unsigned) to F…
petermcneeleychromium Sep 19, 2024
815ff2b
Allow for trailing comma in var template declaration (#3959)
petermcneeleychromium Sep 23, 2024
2cce943
Fix textureNumLayers view_type subcase (#3963)
shrekshao Sep 24, 2024
e46cff2
Roll types to 0.1.46 (#3966)
kainino0x Sep 25, 2024
77f1e4a
Initial commit for subgroupInclusive add/mul cts (#3964)
petermcneeleychromium Sep 25, 2024
11ac59b
robust_access_vertex shader add float tolerance (#3968)
shrekshao Sep 25, 2024
3f6f6b7
Clean output directories when building less than `all` (#3972)
kainino0x Sep 27, 2024
1746bcb
Test usage field of GPUTextureViewDescriptor (#3954)
vonture Sep 30, 2024
9d029d3
Fix reifyTextureViewDescriptor (#3969)
kainino0x Sep 30, 2024
c42a89c
Add some tests for GPUCanvasContext getConfiguration (#3973)
beaufortfrancois Oct 1, 2024
ac4f5e8
textureStore: fix compat texture view restriction (#3976)
shrekshao Oct 2, 2024
b0bc9b2
in_render_common: fix compat texture view restriction (#3979)
shrekshao Oct 3, 2024
3cc9878
Update types; switch to GPUCanvasConfiguration viewFormats array (#3977)
beaufortfrancois Oct 4, 2024
27f834b
Speed up Texture Builtin tests (#3980)
greggman Oct 4, 2024
c2db0ad
WGSL textureSample/Bias/Grad tests (#3981)
greggman Oct 7, 2024
825a256
Fix texture-builtin speedup (#3983)
greggman Oct 7, 2024
ae641a6
Padding tests for vec3h in arrays (#3985)
alan-baker Oct 7, 2024
046a7fa
Add textureSampleCompare/Level WGSL tests (#3984)
greggman Oct 8, 2024
d48c080
WGSL texture builtins all stages (#3986)
greggman Oct 9, 2024
40f19fb
Fix textureSampleBias test (#3988)
greggman Oct 9, 2024
0f96947
Fix textureSampleBias (#3989)
greggman Oct 9, 2024
e331ae2
clear reftest-wait after reftest failure (#3994)
sagudev Oct 11, 2024
ab266c9
Update tests for validating canvas texture formats in configure() (#3…
beaufortfrancois Oct 11, 2024
8a29164
fix texture_formats:canvas_configuration test for https://github.com/…
sagudev Oct 11, 2024
3cf7402
Get per stage GPU mix weights on demand (#3992)
greggman Oct 11, 2024
00c3c50
Refactor texture-builins for compat no storage (#3991)
greggman Oct 11, 2024
ae8b3ca
texture builtin offset subcase to case (#3999)
greggman Oct 14, 2024
c087b55
Include depth textures in more tests (#3995)
greggman Oct 15, 2024
7ec238c
Make identifySamplePoints handle compare (#3996)
greggman Oct 15, 2024
bca9099
Fix typescript error (#4002)
greggman Oct 15, 2024
39bab01
Revert "robust_access_vertex shader add float tolerance (#3968)" (#4000)
shrekshao Oct 15, 2024
ec54937
Use batching for shader,validation,expression,call,builtin,*:values: …
kainino0x Oct 15, 2024
85bd850
Add float32-blendable feature validation tests (#4003)
beaufortfrancois Oct 16, 2024
648e056
Texture Builtins: offset to case from subcase (#4004)
greggman Oct 16, 2024
ecefa0d
Reduce default maxSubcasesInFlight instead of using batching (#4006)
kainino0x Oct 16, 2024
da76b20
attemptGarbageCollection periodically (every N subcases) (#4007)
kainino0x Oct 18, 2024
0138660
Remove non ASCII from texture diagrams (#4008)
greggman Oct 18, 2024
3971de5
Subgroup bitwise tests (#3978)
alan-baker Oct 18, 2024
9a1cb0c
Quad broadcast execution tests (#3987)
alan-baker Oct 18, 2024
6a79ce2
Execution for quad swaps (#3990)
alan-baker Oct 18, 2024
f45a9e0
Show more queries that are too long. (#4009)
greggman Oct 21, 2024
3290214
Texture builtins: move addressMode? to case (#4010)
greggman Oct 21, 2024
44754db
Remove CSS attribute that did nothing and now breaks layout (#4011)
kainino0x Oct 22, 2024
d473d09
Test indexing of a matrix using non-const index (#3982)
sagudev Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ module.exports = function (grunt) {
pkg: grunt.file.readJSON('package.json'),

clean: {
out: ['gen/', 'out/', 'out-wpt/', 'out-node/'],
gen: ['gen/'],
out: ['out/'],
'out-wpt': ['out-wpt/'],
'out-node': ['out-node/'],
},

run: {
Expand Down Expand Up @@ -246,17 +249,20 @@ module.exports = function (grunt) {
});

grunt.registerTask('generate-common', 'Generate files into gen/ and src/', [
'clean:gen',
'run:generate-version',
'run:generate-listings-and-webworkers',
'run:generate-cache',
]);
grunt.registerTask('build-standalone', 'Build out/ (no checks; run after generate-common)', [
'clean:out',
'run:build-out',
'run:copy-assets',
'copy:gen-to-out',
'copy:htmlfiles-to-out',
]);
grunt.registerTask('build-wpt', 'Build out-wpt/ (no checks; run after generate-common)', [
'clean:out-wpt',
'run:build-out-wpt',
'run:copy-assets-wpt',
'copy:gen-to-out-wpt',
Expand All @@ -265,6 +271,7 @@ module.exports = function (grunt) {
'run:autoformat-out-wpt',
]);
grunt.registerTask('build-node', 'Build out-node/ (no checks; run after generate-common)', [
'clean:out-node',
'run:build-out-node',
'run:copy-assets-node',
]);
Expand All @@ -282,7 +289,6 @@ module.exports = function (grunt) {
grunt.registerTask('pre', ['all']);

registerTaskAndAddToHelp('all', 'Run all builds and checks', [
'clean',
'generate-common',
'concurrent:all-builds-and-checks',
]);
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@types/w3c-image-capture": "^1.0.10",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"@webgpu/types": "^0.1.43",
"@webgpu/types": "^0.1.49",
"ansi-colors": "4.1.3",
"babel-plugin-add-header-comment": "^1.0.3",
"babel-plugin-const-enum": "^1.2.0",
Expand Down
15 changes: 14 additions & 1 deletion src/common/framework/test_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ export type TestConfig = {
*/
enableDebugLogs: boolean;

/**
* Maximum number of subcases in flight at once, within a case. Once this many
* are in flight, wait for a subcase to finish before starting the next one.
*/
maxSubcasesInFlight: number;

/**
* Every `subcasesBetweenAttemptingGC` subcases, run `attemptGarbageCollection()`.
* Setting to `Infinity` disables this. Setting to 1 attempts GC every time (slow!).
*/
subcasesBetweenAttemptingGC: number;

testHeartbeatCallback: () => void;

noRaceWithRejectOnTimeout: boolean;

/**
Expand Down Expand Up @@ -40,7 +52,8 @@ export type TestConfig = {

export const globalTestConfig: TestConfig = {
enableDebugLogs: false,
maxSubcasesInFlight: 500,
maxSubcasesInFlight: 100,
subcasesBetweenAttemptingGC: 5000,
testHeartbeatCallback: () => {},
noRaceWithRejectOnTimeout: false,
unrollConstEvalLoops: false,
Expand Down
2 changes: 1 addition & 1 deletion src/common/internal/logging/test_case_recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class TestCaseRecorder {
private startTime = -1;
private logs: LogMessageWithStack[] = [];
private logLinesAtCurrentSeverity = 0;
private debugging = false;
public debugging = false;

constructor(result: LiveTestCaseResult, debugging: boolean) {
this.result = result;
Expand Down
36 changes: 28 additions & 8 deletions src/common/internal/test_group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
stringifyPublicParamsUniquely,
} from '../internal/query/stringify_params.js';
import { validQueryPart } from '../internal/query/validQueryPart.js';
import { attemptGarbageCollection } from '../util/collect_garbage.js';
import { DeepReadonly } from '../util/types.js';
import { assert, unreachable } from '../util/util.js';

Expand Down Expand Up @@ -620,7 +621,7 @@ class RunCaseSpecific implements RunCase {
const subcasePrefix = 'subcase: ' + stringifyPublicParams(subParams);
const subRec = new Proxy(rec, {
get: (target, k: keyof TestCaseRecorder) => {
const prop = TestCaseRecorder.prototype[k];
const prop = rec[k] ?? TestCaseRecorder.prototype[k];
if (typeof prop === 'function') {
testHeartbeatCallback();
return function (...args: Parameters<typeof prop>) {
Expand Down Expand Up @@ -696,6 +697,7 @@ class RunCaseSpecific implements RunCase {
subRec.threw(ex);
}
})
.finally(attemptGarbageCollectionIfDue)
.finally(subcaseFinishedCallback);

allPreviousSubcasesFinalizedPromise = allPreviousSubcasesFinalizedPromise.then(
Expand All @@ -711,13 +713,17 @@ class RunCaseSpecific implements RunCase {
rec.skipped(new SkipTestCase('all subcases were skipped'));
}
} else {
await this.runTest(
rec,
sharedState,
this.params,
/* throwSkip */ false,
getExpectedStatus(selfQuery)
);
try {
await this.runTest(
rec,
sharedState,
this.params,
/* throwSkip */ false,
getExpectedStatus(selfQuery)
);
} finally {
await attemptGarbageCollectionIfDue();
}
}
} finally {
testHeartbeatCallback();
Expand Down Expand Up @@ -754,3 +760,17 @@ export type CaseTimingLogLine = {
*/
nonskippedSubcaseCount: number;
};

/** Every `subcasesBetweenAttemptingGC` calls to this function will `attemptGarbageCollection()`. */
const attemptGarbageCollectionIfDue: () => Promise<void> = (() => {
// This state is global because garbage is global.
let subcasesSinceLastGC = 0;

return async function attemptGarbageCollectionIfDue() {
subcasesSinceLastGC++;
if (subcasesSinceLastGC >= globalTestConfig.subcasesBetweenAttemptingGC) {
subcasesSinceLastGC = 0;
return attemptGarbageCollection();
}
};
})();
3 changes: 3 additions & 0 deletions src/common/runtime/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ function makeSubtreeChildrenHTML(
const runMySubtree = async () => {
const results: SubtreeResult[] = [];
for (const { runSubtree } of childFns) {
if (stopRequested) {
break;
}
results.push(await runSubtree());
}
return mergeSubtreeResults(...results);
Expand Down
4 changes: 0 additions & 4 deletions src/common/tools/dev_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ const app = express();

// Send Chrome Origin Trial tokens
app.use((_req, res, next) => {
res.header('Origin-Trial', [
// Token for http://localhost:8080
'AvyDIV+RJoYs8fn3W6kIrBhWw0te0klraoz04mw/nPb8VTus3w5HCdy+vXqsSzomIH745CT6B5j1naHgWqt/tw8AAABJeyJvcmlnaW4iOiJodHRwOi8vbG9jYWxob3N0OjgwODAiLCJmZWF0dXJlIjoiV2ViR1BVIiwiZXhwaXJ5IjoxNjYzNzE4Mzk5fQ==',
]);
next();
});

Expand Down
38 changes: 29 additions & 9 deletions src/common/tools/gen_wpt_cts_html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
} from '../internal/query/query.js';
import { assert } from '../util/util.js';

const kMaxQueryLength = 184;

function printUsageAndExit(rc: number): never {
console.error(`\
Usage (simple, for webgpu:* suite only):
Expand Down Expand Up @@ -193,6 +195,7 @@ let config: Config;

const loader = new DefaultTestFileLoader();
const lines = [];
const tooLongQueries = [];
for (const prefix of config.argumentsPrefixes) {
const rootQuery = new TestQueryMultiFile(config.suite, []);
const tree = await loader.loadTree(rootQuery, {
Expand All @@ -219,15 +222,9 @@ let config: Config;
// Check for a safe-ish path length limit. Filename must be <= 255, and on Windows the whole
// path must be <= 259. Leave room for e.g.:
// 'c:\b\s\w\xxxxxxxx\layout-test-results\external\wpt\webgpu\cts_worker=0_q=...-actual.txt'
assert(
queryString.length < 185,
`Generated test variant would produce too-long -actual.txt filename. Possible solutions:
- Reduce the length of the parts of the test query
- Reduce the parameterization of the test
- Make the test function faster and regenerate the listing_meta entry
- Reduce the specificity of test expectations (if you're using them)
${queryString}`
);
if (queryString.length > kMaxQueryLength) {
tooLongQueries.push(queryString);
}
}

lines.push({
Expand All @@ -243,6 +240,29 @@ ${queryString}`
}
prefixComment.comment += `; ${variantCount} variants generated from ${testsSeen.size} tests in ${filesSeen.size} files`;
}

if (tooLongQueries.length > 0) {
// Try to show some representation of failures. We show one entry from each
// test that is different length. Without this the logger cuts off the error
// messages and you end up not being told about which tests have issues.
const queryStrings = new Map<string, string>();
tooLongQueries.forEach(s => {
const colonNdx = s.lastIndexOf(':');
const prefix = s.substring(0, colonNdx + 1);
const id = `${prefix}:${s.length}`;
queryStrings.set(id, s);
});
throw new Error(
`Generated test variant would produce too-long -actual.txt filename. Possible solutions:
- Reduce the length of the parts of the test query
- Reduce the parameterization of the test
- Make the test function faster and regenerate the listing_meta entry
- Reduce the specificity of test expectations (if you're using them)
|<${''.padEnd(kMaxQueryLength - 4, '-')}>|
${[...queryStrings.values()].join('\n')}`
);
}

await generateFile(lines);
})().catch(ex => {
console.log(ex.stack ?? ex.toString());
Expand Down
9 changes: 4 additions & 5 deletions src/common/util/navigator_gpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ export function getGPU(recorder: TestCaseRecorder | null): GPU {
): Promise<GPUAdapter | null> {
const promise = oldFn.call(this, { ...defaultRequestAdapterOptions, ...options });
if (recorder) {
void promise.then(async adapter => {
void promise.then(adapter => {
if (adapter) {
// MAINTENANCE_TODO: Remove requestAdapterInfo when info is implemented.
const info = adapter.info || (await adapter.requestAdapterInfo());
const infoString = `Adapter: ${info.vendor} / ${info.architecture} / ${info.device}`;
recorder.debug(new ErrorWithExtra(infoString, () => ({ adapterInfo: info })));
const adapterInfo = adapter.info;
const infoString = `Adapter: ${adapterInfo.vendor} / ${adapterInfo.architecture} / ${adapterInfo.device}`;
recorder.debug(new ErrorWithExtra(infoString, () => ({ adapterInfo })));
}
});
}
Expand Down
Loading
Loading