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

Update print_environment to show featureLevel and defaultDevice #4130

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

kainino0x
Copy link
Collaborator

@kainino0x kainino0x commented Jan 7, 2025

Updates the print_environment test to print all properties with a blocklist, rather than print only specific properties, and to print the properties of the default device (i.e. requestDevice with no descriptor).

Aside: there are still two other places using isCompatibilityMode:

  • getDefaultLimitsForAdapter()
    This should probably be updated to understand both isCompatibilityMode and featureLevel,
    but we also need to consider how it can work if we remove adapter.featureLevel (Compat: remove GPUAdapter.featureLevel gpuweb#5037, cc @greggman)
  • webgpu:api,operation,adapter,requestDevice:always_returns_device:*
    Should just be updated to understand both.

Anyway, result from this PR:

{
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
  "globalScope": "Window",
  "globalTestConfig": {
    "enableDebugLogs": false,
    "maxSubcasesInFlight": 100,
    "subcasesBetweenAttemptingGC": 5000,
    "noRaceWithRejectOnTimeout": false,
    "unrollConstEvalLoops": false,
    "compatibility": true,
    "forceFallbackAdapter": false,
    "logToWebSocket": false
  },
  "baseResourcePath": "../out/resources/",
  "defaultRequestAdapterOptions": {
    "compatibilityMode": true,
    "featureLevel": "compatibility"
  },
  "adapter": {
    "features": [
      "depth32float-stencil8",
      "rg11b10ufloat-renderable",
      "bgra8unorm-storage",
      "texture-compression-astc",
      "texture-compression-etc2",
      "depth-clip-control",
      "subgroups-f16",
      "texture-compression-bc",
      "dual-source-blending",
      "clip-distances",
      "timestamp-query",
      "shader-f16",
      "float32-filterable",
      "indirect-first-instance",
      "subgroups"
    ],
    "limits": {
      "maxTextureDimension1D": 16384,
      "maxTextureDimension2D": 16384,
      "maxTextureDimension3D": 2048,
      "maxTextureArrayLayers": 2048,
      "maxBindGroups": 4,
      "maxBindGroupsPlusVertexBuffers": 24,
      "maxBindingsPerBindGroup": 1000,
      "maxDynamicUniformBuffersPerPipelineLayout": 10,
      "maxDynamicStorageBuffersPerPipelineLayout": 8,
      "maxSampledTexturesPerShaderStage": 16,
      "maxSamplersPerShaderStage": 16,
      "maxStorageBuffersPerShaderStage": 10,
      "maxStorageTexturesPerShaderStage": 8,
      "maxUniformBuffersPerShaderStage": 12,
      "maxUniformBufferBindingSize": 65536,
      "maxStorageBufferBindingSize": 4294967292,
      "minUniformBufferOffsetAlignment": 256,
      "minStorageBufferOffsetAlignment": 256,
      "maxVertexBuffers": 8,
      "maxBufferSize": 4294967296,
      "maxVertexAttributes": 30,
      "maxVertexBufferArrayStride": 2048,
      "maxInterStageShaderComponents": 112,
      "maxInterStageShaderVariables": 28,
      "maxColorAttachments": 8,
      "maxColorAttachmentBytesPerSample": 128,
      "maxComputeWorkgroupStorageSize": 32768,
      "maxComputeInvocationsPerWorkgroup": 1024,
      "maxComputeWorkgroupSizeX": 1024,
      "maxComputeWorkgroupSizeY": 1024,
      "maxComputeWorkgroupSizeZ": 64,
      "maxComputeWorkgroupsPerDimension": 65535,
      "minSubgroupSize": 4,
      "maxSubgroupSize": 64
    },
    "info": {
      "vendor": "apple",
      "architecture": "common-3",
      "device": "",
      "description": ""
    },
    "isFallbackAdapter": false
  },
  "defaultDevice": {
    "features": [],
    "limits": {
      "maxTextureDimension1D": 8192,
      "maxTextureDimension2D": 8192,
      "maxTextureDimension3D": 2048,
      "maxTextureArrayLayers": 256,
      "maxBindGroups": 4,
      "maxBindGroupsPlusVertexBuffers": 24,
      "maxBindingsPerBindGroup": 1000,
      "maxDynamicUniformBuffersPerPipelineLayout": 8,
      "maxDynamicStorageBuffersPerPipelineLayout": 4,
      "maxSampledTexturesPerShaderStage": 16,
      "maxSamplersPerShaderStage": 16,
      "maxStorageBuffersPerShaderStage": 8,
      "maxStorageTexturesPerShaderStage": 4,
      "maxUniformBuffersPerShaderStage": 12,
      "maxUniformBufferBindingSize": 65536,
      "maxStorageBufferBindingSize": 134217728,
      "minUniformBufferOffsetAlignment": 256,
      "minStorageBufferOffsetAlignment": 256,
      "maxVertexBuffers": 8,
      "maxBufferSize": 268435456,
      "maxVertexAttributes": 16,
      "maxVertexBufferArrayStride": 2048,
      "maxInterStageShaderComponents": 64,
      "maxInterStageShaderVariables": 16,
      "maxColorAttachments": 8,
      "maxColorAttachmentBytesPerSample": 32,
      "maxComputeWorkgroupStorageSize": 16384,
      "maxComputeInvocationsPerWorkgroup": 256,
      "maxComputeWorkgroupSizeX": 256,
      "maxComputeWorkgroupSizeY": 256,
      "maxComputeWorkgroupSizeZ": 64,
      "maxComputeWorkgroupsPerDimension": 65535,
      "minSubgroupSize": 4294967295,
      "maxSubgroupSize": 4294967295
    }
  }
}

Issue: None


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.

// Print all of the properties of the adapter and defaultDeviceProperties. JSON.stringify
// will skip methods (e.g. adapter.requestDevice), because they're not stringifiable.
adapter: t.adapter,
defaultDevice: defaultDeviceProperties,
Copy link
Collaborator

@beaufortfrancois beaufortfrancois Jan 8, 2025

Choose a reason for hiding this comment

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

Suggested change
defaultDevice: defaultDeviceProperties,
defaultDevice: {
adapterInfo: device.adapterInfo,
features: device.features,
limits: device.limits
},

src/webgpu/print_environment.spec.ts Show resolved Hide resolved
@kainino0x kainino0x force-pushed the print_environment-updates branch from c40f951 to f2573fa Compare January 10, 2025 01:53
@kainino0x kainino0x enabled auto-merge (squash) January 10, 2025 01:53
@kainino0x kainino0x merged commit 467b5f7 into gpuweb:main Jan 10, 2025
1 check passed
@kainino0x kainino0x deleted the print_environment-updates branch January 10, 2025 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants