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

[WGSL] Enable semantic related tests that work already for Metal #5502

Closed
jkwak-work opened this issue Nov 6, 2024 · 4 comments · Fixed by #5816
Closed

[WGSL] Enable semantic related tests that work already for Metal #5502

jkwak-work opened this issue Nov 6, 2024 · 4 comments · Fixed by #5816
Assignees
Labels
goal:client exploration Speculative work for a potential use case.

Comments

@jkwak-work
Copy link
Collaborator

The following tests are tests that are related to the semantics.
They are currently enabled for Metal and we should enable them for WGSL as well.

  • tests/compute/compile-time-loop.slang
  • tests/compute/constexpr.slang
  • tests/compute/discard-stmt.slang
  • tests/compute/texture-sampling.slang
  • tests/metal/atomic-intrinsics.slang
  • tests/metal/nested-struct-fragment-input.slang
  • tests/metal/nested-struct-fragment-output.slang
  • tests/metal/nested-struct-multi-entry-point-vertex.slang
  • tests/metal/no-struct-vertex-output.slang
  • tests/metal/stage-in-2.slang
  • tests/metal/sv_target-complex-1.slang
  • tests/metal/sv_target-complex-2.slang
@jkwak-work jkwak-work added the goal:client exploration Speculative work for a potential use case. label Nov 6, 2024
@jkwak-work jkwak-work self-assigned this Nov 6, 2024
@jkwak-work
Copy link
Collaborator Author

There are two PRs related to those tests and those tests still cannot be enabled yet.

The error message looks to be that the issue is on the Slang-RHI side.

WGPU error: Buffer usages (BufferUsage::(MapWrite|CopySrc|CopyDst)) is invalid. If a buffer usage contains BufferUsage::MapWrite the only other allowed usage is BufferUsage::CopySrc.

Here is how to reproduce the error,

$ build/Release/bin/slang-test.exe tests/compute/compile-time-loop.slang
Supported backends: fxc dxc glslang spirv-dis clang visualstudio genericcpp nvrtc llvm spirv-opt metal tint
Check vk,vulkan: Supported
Check dx12,d3d12: Supported
Check dx11,d3d11: Supported
Check cuda: Supported
Check wgpu,webgpu: Supported
passed test: 'tests/compute/compile-time-loop.slang (dx11)'
ignored test: 'tests/compute/compile-time-loop.slang.1 (mtl)'
WGPU error: Buffer usages (BufferUsage::(MapWrite|CopySrc|CopyDst)) is invalid. If a buffer usage contains BufferUsage::MapWrite the only other allowed usage is BufferUsage::CopySrc.
 - While calling [Device].CreateBuffer([BufferDescriptor]).

WGPU error: [Invalid Buffer (unlabeled)] is invalid.
 - While calling [Queue].WriteBuffer([Invalid Buffer (unlabeled)], (0 bytes), data, (96 bytes))

Warning: Old OnSubmittedWorkDone APIs are deprecated. If using C please pass a CallbackInfo struct that has two userdatas. Otherwise, if using C++, please use templated helpers.
WGPU error: [Invalid Buffer (unlabeled)] is invalid.
 - While encoding [RenderPassEncoder (unlabeled)].SetVertexBuffer(0, [Invalid Buffer (unlabeled)], 0, 96).
 - While finishing [CommandEncoder (unlabeled)].

WGPU error: [Invalid CommandBuffer] is invalid.
 - While calling [Queue].Submit([[Invalid CommandBuffer]])

Warning: Old MapAsync APIs are deprecated. If using C please pass a CallbackInfo struct that has two userdatas. Otherwise, if using C++, please use templated helpers.
error: ERROR:
EXPECTED{{{
40A00000
}}}
ACTUAL{{{
0
}}}

ignored test: 'tests/compute/compile-time-loop.slang.2 syn (wgpu)'
passed test: 'tests/compute/compile-time-loop.slang.3 syn (dx12)'
Retrying 1 failed tests...
WGPU error: Buffer usages (BufferUsage::(MapWrite|CopySrc|CopyDst)) is invalid. If a buffer usage contains BufferUsage::MapWrite the only other allowed usage is BufferUsage::CopySrc.
 - While calling [Device].CreateBuffer([BufferDescriptor]).

WGPU error: [Invalid Buffer (unlabeled)] is invalid.
 - While calling [Queue].WriteBuffer([Invalid Buffer (unlabeled)], (0 bytes), data, (96 bytes))

Warning: Old OnSubmittedWorkDone APIs are deprecated. If using C please pass a CallbackInfo struct that has two userdatas. Otherwise, if using C++, please use templated helpers.
WGPU error: [Invalid Buffer (unlabeled)] is invalid.
 - While encoding [RenderPassEncoder (unlabeled)].SetVertexBuffer(0, [Invalid Buffer (unlabeled)], 0, 96).
 - While finishing [CommandEncoder (unlabeled)].

WGPU error: [Invalid CommandBuffer] is invalid.
 - While calling [Queue].Submit([[Invalid CommandBuffer]])

Warning: Old MapAsync APIs are deprecated. If using C please pass a CallbackInfo struct that has two userdatas. Otherwise, if using C++, please use templated helpers.
error: ERROR:
EXPECTED{{{
40A00000
}}}
ACTUAL{{{
0
}}}

FAILED test: 'tests/compute/compile-time-loop.slang.2 syn (wgpu)'

===
66% of tests passed (2/3), 2 tests ignored
===

failing tests:
---
tests/compute/compile-time-loop.slang.2 syn (wgpu)
---

@jkwak-work jkwak-work changed the title [WGSL] Enable semantic related tests that works already for Metal [WGSL] Enable semantic related tests that work already for Metal Nov 6, 2024
@jkwak-work
Copy link
Collaborator Author

These tests need to be enabled after #4943 is resolved.
Pushing the issue to the next sprint.

@aleino-nv
Copy link
Collaborator

All of the mentioned tests from tests/compute should already be passing or not in scope.

The tests/compute/texture-sampling.slang test is not in scope, but I created tests/compute/texture-sampling-no-1d-arrays.slang which now works.

@jkwak-work
Copy link
Collaborator Author

I like to share some update.

The following four tests are working as of today:

  • tests/compute/compile-time-loop.slang
  • tests/compute/constexpr.slang
  • tests/compute/discard-stmt.slang
  • tests/compute/texture-sampling.slang

"tests/metal/atomic-intrinsics.slang" is not supported for WGSL because InterlockedXXX functions are not available for WGSL.
When attempted, the capacity system prints error messages saying that WGSL doesn't support InterlockedXXX functions.

tests/metal/nested-struct-fragment-input.slang and ests/metal/nested-struct-fragment-output.slang generates valid WGSL when tested with the shader-playground. But I need to enable it as a part of slang-test test.

I will check the rest of tests later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal:client exploration Speculative work for a potential use case.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants