microsoft / microsoft/DirectXShaderCompiler

[SPIR-V] DXC SPIR-V test fail with the latest spir-v tools

Open
#8,740 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage spirv
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Description
Since https://github.com/KhronosGroup/SPIRV-Tools/pull/6792, some of the tests related to descriptor heaps have started to fail.

https://btx.cloud.google.com/invocations/c69d88f2-98e9-45f4-ba65-5d93e2504e77/targets/graphics_shader_compiler%2Fspirv_tools%2Fdxc-smoketest%2Fpresubmit/log

Steps to Reproduce

Check out the latest DXC source.
Update the submodule using the top-of-tree SPIR-V tools.
Run the codegenspirv tests.

There are two failures. Here is the output of one of them:

FAIL: Clang :: CodeGenSPIRV/resource-heap-ext-texture.hlsl (829 of 1566)
******************** TEST 'Clang :: CodeGenSPIRV/resource-heap-ext-texture.hlsl' FAILED ********************
Script:
--
/tmp/dxc/build/./bin/dxc -T cs_6_6 -E main -fspv-use-descriptor-heap -spirv /tmp/dxc/tools/clang/test/CodeGenSPIRV/resource-heap-ext-texture.hlsl | /tmp/dxc/build/./bin/FileCheck /tmp/dxc/tools/clang/test/CodeGenSPIRV/resource-heap-ext-texture.hlsl
--
Exit Code: 2

Command Output (stderr):
--
...
fatal error: generated SPIR-V is invalid: Array must be explicitly laid out with ArrayStride or ArrayStrideIdEXT decorations. Instantiated via '36[%36]' in the UniformConstant storage class using standard layout rules.
This is may be allowed if you enable the scalarBlockLayout feature (or use the --scalar-block-layout command line flag)
  %_runtimearr_type_2d_image = OpTypeRuntimeArray %type_2d_image

note: please file a bug report on https://github.com/Microsoft/DirectXShaderCompiler/issues with source code if possible

FileCheck error: '-' is empty.

Actual Behavior

There is a validation error. See above.

Environment

  • DXC version: latest main
  • Host Operating System: all

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tools/clang/test/CodeGenSPIRV/resource-heap-ext-texture.hlsl and the related descriptor-heap codegen tests. Update the SPIR-V tools submodule to the latest revision, run the codegenspirv tests, and compare the failing validation output with the generated SPIR-V. Done means both reported tests pass with the updated tools.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.