tests: the page-bytes probe reads WebGPU features and limits by name

Array.from(adapter.features) and for-in over adapter.limits threw "Xray wrapping of iterators not
supported" in the page (run 43652292533), so the reference held an error string instead of the
adapter. Both are read by the names of the WebGPU specification (has, a property read). The
Windows reference drops gpu.webgpu.error; features and limits are recorded with the rest.
This commit is contained in:
feder-cr committed 2026-11-15 01:54:44 +01:00
1 parent 4b2fb63fe6
commit aa53d6ea06
3 files changed
+25 -9

No files matched your search

+1 -4
View File
@@ -1,6 +1,6 @@
{
"os": "windows",
"source": "GitHub Actions run 43652292533 (workflow 'cpu render path hunt vm', job on windows-2022), arm `ours` = the published engine firefox-64_159.0_20261114003728 with the core the branch installed from the index (before the declaration of software compositing), seed 42, locale en-US, timezone Europe/Rome, headless=True; launched twice, and the arm `ours_vmretail` (the VM decisions of the new core) twice more: every key below is equal in the four launches. `pngs`: the PNG keys, whose bytes differ in a 16-byte chunk `deBG` in every launch; their length, and the pixels they decode to where the hunt kept the bytes (a data URL longer than 3000 characters was kept as hash and length only: those five entries have no `sha256` and are written by the first run of tests/test_the_bytes_a_page_reads_do_not_change_e2e.py on the engine of the reference). The keys of c2d.scale.* and c2d.gradtext.* were added to the probe after that run and are in no reference yet.",
"source": "GitHub Actions run 43652292533 (workflow 'cpu render path hunt vm', job on windows-2022), arm `ours` = the published engine firefox-64_159.0_20261114003728 with the core the branch installed from the index (before the declaration of software compositing), seed 42, locale en-US, timezone Europe/Rome, headless=True; launched twice, and the arm `ours_vmretail` (the VM decisions of the new core) twice more: every key below is equal in the four launches. `pngs`: the PNG keys, whose bytes differ in a 16-byte chunk `deBG` in every launch; their length, and the pixels they decode to where the hunt kept the bytes (a data URL longer than 3000 characters was kept as hash and length only: those five entries have no `sha256` and are written by the first run of tests/test_the_bytes_a_page_reads_do_not_change_e2e.py on the engine of the reference). The keys of c2d.scale.*, c2d.gradtext.*, gpu.webgpu.features and gpu.webgpu.limits were added to the probe after that run (in it the WebGPU read threw `Xray wrapping of iterators not supported`, key gpu.webgpu.error, dropped here) and are in no reference yet.",
"keys": {
"c2d.composite.getImageData": {
"h": "df65ebe03bf31",
@@ -259,9 +259,6 @@
"gl2.unmasked": {
"s": "[\"Google Inc. (Intel)\",\"ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0), or similar\"]"
},
"gpu.webgpu.error": {
"s": "Xray wrapping of iterators not supported."
},
"gpu.webgpu.info": {
"s": "{\"vendor\":\"\",\"architecture\":\"\",\"device\":\"\",\"description\":\"\"}"
},
+20 -2
View File
@@ -423,9 +423,27 @@
const a = await Promise.race([navigator.gpu.requestAdapter(), sleep(10000).then(() => "timeout")]);
if (!a || a === "timeout") { put("gpu.webgpu", String(a)); return; }
const info = a.info || (a.requestAdapterInfo ? await a.requestAdapterInfo() : {});
const lim = {}; for (const k in a.limits) lim[k] = a.limits[k];
// Features and limits are read by NAME, never by iterating them: the expression runs with the page's objects behind Xray wrappers, and
// `Array.from(a.features)` / `for (k in a.limits)` threw "Xray wrapping of iterators not supported" there (run 43652292533). `has` and a property
// read are plain calls. The names are those of the WebGPU specification (limits table and GPUFeatureName); one the engine does not know reads
// false / undefined, which is a value like any other.
const featureNames = ["depth-clip-control", "depth32float-stencil8", "texture-compression-bc", "texture-compression-bc-sliced-3d",
"texture-compression-etc2", "texture-compression-astc", "texture-compression-astc-sliced-3d", "timestamp-query", "indirect-first-instance",
"shader-f16", "rg11b10ufloat-renderable", "bgra8unorm-storage", "float32-filterable", "float32-blendable", "clip-distances",
"dual-source-blending", "subgroups"];
const limitNames = ["maxTextureDimension1D", "maxTextureDimension2D", "maxTextureDimension3D", "maxTextureArrayLayers", "maxBindGroups",
"maxBindGroupsPlusVertexBuffers", "maxBindingsPerBindGroup", "maxDynamicUniformBuffersPerPipelineLayout",
"maxDynamicStorageBuffersPerPipelineLayout", "maxSampledTexturesPerShaderStage", "maxSamplersPerShaderStage",
"maxStorageBuffersPerShaderStage", "maxStorageTexturesPerShaderStage", "maxUniformBuffersPerShaderStage", "maxUniformBufferBindingSize",
"maxStorageBufferBindingSize", "minUniformBufferOffsetAlignment", "minStorageBufferOffsetAlignment", "maxVertexBuffers", "maxBufferSize",
"maxVertexAttributes", "maxVertexBufferArrayStride", "maxInterStageShaderVariables", "maxColorAttachments",
"maxColorAttachmentBytesPerSample", "maxComputeWorkgroupStorageSize", "maxComputeInvocationsPerWorkgroup", "maxComputeWorkgroupSizeX",
"maxComputeWorkgroupSizeY", "maxComputeWorkgroupSizeZ", "maxComputeWorkgroupsPerDimension"];
const lim = {}, feat = {};
for (const k of limitNames) { try { lim[k] = a.limits[k]; } catch (e) { lim[k] = "ERR " + e.message; } }
for (const f of featureNames) { try { feat[f] = a.features.has(f); } catch (e) { feat[f] = "ERR " + e.message; } }
put("gpu.webgpu.info", { vendor: info.vendor, architecture: info.architecture, device: info.device, description: info.description });
put("gpu.webgpu.features", Array.from(a.features).sort());
put("gpu.webgpu.features", feat);
put("gpu.webgpu.limits", lim);
});
@@ -8,9 +8,10 @@ blocklisted with FEATURE_FAILURE_VM_VENDOR, and on Windows the core sets `gfx.we
1. the compositor the engine runs is WebRender (Software), on Windows AND on Linux (on Linux this closes the risk that the table,
with no pref beside it, sends the engine down another road);
2. the GPU process, which is where a hardware WebRender spends its CPU, spends almost none on a fixed scene;
3. no byte a page reads of canvas 2D, WebGL, WebGPU, text and the declared values changes: the 86 keys of the probe plus the canvas 2D
scenes added for the canvas blocklist (drawImage scaled up and down with imageSmoothing off and on at three qualities, text filled
and stroked with gradients of three kinds) equal the reference of the operating system, tests/data/page_bytes_<os>.json.
3. no byte a page reads of canvas 2D, WebGL, WebGPU, text and the declared values changes: the keys of the probe (the 86 of the first
hunt, WebGPU features and limits read by name, and the canvas 2D scenes added for the canvas blocklist: drawImage scaled up and down
with imageSmoothing off and on at three qualities, text filled and stroked with gradients of three kinds) equal the reference of the
operating system, tests/data/page_bytes_<os>.json.
Known-bad input: the engine with the core of firefox-64 before this declaration (64.71.0). On the Windows runner `gfx.webrender.software`
is false there (the effective prefs of run 43652292533, arm ours) and the GPU process uses 2.7 to 4.2 s on the scene of test 2 (GitHub