Skip to content

[SM6.10] Define and Dump LinAlg PSV0 runtime data - #8913

Open
Ashley Coleman (V-FEXrt) wants to merge 2 commits into
microsoft:mainfrom
V-FEXrt:linalg-psv0-dump-test
Open

[SM6.10] Define and Dump LinAlg PSV0 runtime data#8913
Ashley Coleman (V-FEXrt) wants to merge 2 commits into
microsoft:mainfrom
V-FEXrt:linalg-psv0-dump-test

Conversation

@V-FEXrt

Copy link
Copy Markdown
Collaborator
  • Adds the PSV0 LinAlg runtime record layout definitions
  • Serializes/Deserializes the types to/from the container
  • Prints a deserialized type as a string header for the shader dump

Part of #7843

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Add the PSV0 LinAlg runtime record layout and teach the PSV reader and writer to serialize the optional tables.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Print the optional LinAlg runtime tables and resolve their operation shape references in PSV dumps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical PSV0 compatibility, validation, and shader-dump test issues block approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds Shader Model 6.10 PSV0 Linear Algebra runtime metadata support, including definitions, serialization/deserialization, and shader-dump output.

Changes:

  • Defines LinAlg runtime records, flags, and accessors.
  • Adds PSV0 container I/O and diagnostic printing.
  • Adds round-trip and dump-output regression coverage.
File summaries
File Reviewed changes and final notes
tools/clang/unittests/HLSL/DxilContainerTest.cpp Adds LinAlg serialization and round-trip coverage.
tools/clang/test/DXC/dumpPSV_VS.hlsl Updates dump checks. Critical finding (1 vote): requires dxil-1-8 although the v4-only line needs 1.10 or conditional checks.
tools/clang/test/DXC/dumpPSV_PS.hlsl Updates dump checks. Critical finding (1 vote): requires dxil-1-8 although the v4-only line needs 1.10 or conditional checks.
tools/clang/test/DXC/dumpPSV_MS.hlsl Updates PSV dump expectations.
tools/clang/test/DXC/dumpPSV_HS.hlsl Updates dump checks. Critical finding (1 vote): requires dxil-1-8 although the v4-only line needs 1.10 or conditional checks.
tools/clang/test/DXC/dumpPSV_GS.hlsl Updates dump checks. Critical finding (1 vote): requires dxil-1-8 although the v4-only line needs 1.10 or conditional checks.
tools/clang/test/DXC/dumpPSV_DS.hlsl Updates dump checks. Critical finding (1 vote): requires dxil-1-8 although the v4-only line needs 1.10 or conditional checks.
tools/clang/test/DXC/dumpPSV_CS.hlsl Updates PSV dump expectations.
tools/clang/test/DXC/dumpPSV_AS.hlsl Updates PSV dump expectations.
lib/DxilContainer/DxilPipelineStateValidation.cpp Prints LinAlg runtime metadata.
include/dxc/DxilContainer/DxilPipelineStateValidation.h Adds LinAlg records and PSV0 I/O. Findings: critical wire-size compatibility (1 vote) and validator trailer parsing (3 votes); moderate shape-table presence (2 votes) and stale pointer (1 vote); nit release note (3 votes).
Review details

Suppressed comments (1)

include/dxc/DxilContainer/DxilPipelineStateValidation.h:1350

  • On a successful second InitFromPSV0 or InitNew call without the flag, this condition is false but m_pPSVLinAlgRuntimeInfo0 still points into the previous blob. Print() checks that pointer directly and will dump stale LinAlg records, while the getters expose stale counts. Reset the LinAlg runtime pointer before this branch.
  bool HasLinAlgRuntimeInfo =
      m_pPSVRuntimeInfo4 &&
      (m_pPSVRuntimeInfo4->Flags &
       static_cast<uint32_t>(PSVRuntimeInfo4Flag::LinAlgRuntimeInfoPresent));
  PSVLinAlgRuntimeInfo0 tempLinAlgRuntimeInfo = {};
  • Files reviewed: 11/11 changed files
  • Comments generated: 9
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 185 to +187
struct PSVRuntimeInfo4 : public PSVRuntimeInfo3 {
uint32_t NumBytesGroupSharedMemory;
uint32_t Flags; // PSVRuntimeInfo4Flag
Comment on lines +1175 to +1179
// If PSVRuntimeInfo4::Flags has LinAlgRuntimeInfoPresent:
// uint32_t PSVLinAlgRuntimeInfo_size
// { PSVLinAlgRuntimeInfoN structure }
// For each non-empty LinAlg record table, in declaration order:
// uint32_t record_size
// CHECK-NEXT: SigOutputVectors[2]: 0
// CHECK-NEXT: SigOutputVectors[3]: 0
// CHECK-NEXT: EntryFunctionName: main
// CHECK-NEXT: LinAlgRuntimeInfoPresent: false
// CHECK-NEXT: SigOutputVectors[2]: 0
// CHECK-NEXT: SigOutputVectors[3]: 0
// CHECK-NEXT: EntryFunctionName: main
// CHECK-NEXT: LinAlgRuntimeInfoPresent: false
// CHECK-NEXT: SigOutputVectors[2]: 0
// CHECK-NEXT: SigOutputVectors[3]: 0
// CHECK-NEXT: EntryFunctionName: main
// CHECK-NEXT: LinAlgRuntimeInfoPresent: false
// CHECK-NEXT: SigOutputVectors[2]: 0
// CHECK-NEXT: SigOutputVectors[3]: 0
// CHECK-NEXT: EntryFunctionName: main
// CHECK-NEXT: LinAlgRuntimeInfoPresent: false
// CHECK-NEXT: SigOutputVectors[2]: 0
// CHECK-NEXT: SigOutputVectors[3]: 0
// CHECK-NEXT: EntryFunctionName: main
// CHECK-NEXT: LinAlgRuntimeInfoPresent: false
Comment on lines +614 to +618
return LinAlgMatrixConstructionCount ||
LinAlgThreadMatrixVectorMultiplyCount ||
LinAlgWaveMatrixMultiplyCount ||
LinAlgThreadGroupMatrixMultiplyCount || LinAlgOuterProductCount ||
LinAlgAccumulateStoreCount;
Comment on lines +178 to +182
enum class PSVRuntimeInfo4Flag : uint32_t {
None = 0x00000000,
// Indicates use of LinAlg operations beyond the Tier 1 required set, thus
// the presence of the PSVLinAlgRuntimeInfo structure with usage details.
LinAlgRuntimeInfoPresent = 0x00000001,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants