KhronosGroup / KhronosGroup/SPIRV-Tools

Use NonSemantic info and other source debug information to map SPIR-V Validation errors to original source

Open
#6,617 6 comments 3 reactions 1 assignee Claimed by @spencer-lunarg View on GitHub
component:validation
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

Producers of SPIR-V can often emit invalid SPIR-V, and sometimes even on purpose (DXC).

During the development of a Compiler outputting SPIR-V bugs will be made, when users file bugreports we often ask for a minimally reproducible example.

Someone without a debug build of said compiler may never see the SPIR-V emitted being fed into SPIR-V Tools, and even if they do they'll have a hard time mapping the line of SPIR-V disassembly and the SSA Result ID that the SPIR-V Validator complains about back to their own source code.

Even for compiler developers this would greatly improve the workflow

I'd propose to use the existing embedded source information and non-semantic information (if the producer emits them) to also display are least the file name, function name and line of the function that generated the offending instructions.

Even better if we could show a range of source lines.

The SPIR-V Visualizer is already able to show the expression trees of operands (and their own trees) involved in an Operation or which produced an SSA ResultID, a full trace of source could be printed, similar to a C++ template instantiation error.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.