Skip to content

[SM 6.10] Disable Work Graphs in SM 6.10 - #8798

Open
Chris B (llvm-beanz) wants to merge 3 commits into
microsoft:mainfrom
llvm-beanz:sm6.10-wg
Open

[SM 6.10] Disable Work Graphs in SM 6.10#8798
Chris B (llvm-beanz) wants to merge 3 commits into
microsoft:mainfrom
llvm-beanz:sm6.10-wg

Conversation

@llvm-beanz

@llvm-beanz Chris B (llvm-beanz) commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

With the introduction of SM 6.10, we're disabling Work Graphs support.

This is captured in the Dxil 1.10 specification in PR #918.

This is the first of two PRs, the second adds validation errors, validator tests, and updates the release notes.

Assisted-by: Copilot

With the introduction of SM 6.10, we're disabling Work Graphs support.

This is captured in the Dxil 1.10 specification in [PR microsoft#918]
(microsoft/hlsl-specs#918).

Assisted-by: Copilot
Copilot AI balanced review requested due to automatic review settings August 18, 2026 19:35
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

✅ With the latest revision this PR passed the C/C++ code formatter.

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds “maximum shader model” (obsoletion) metadata to HLSL intrinsics/built-in node record types, and converts that metadata into Clang availability diagnostics—most notably enforcing that Work Graphs (node shaders) are removed starting at shader model 6.10 (except for lib_6_x).

Changes:

  • Extend intrinsic database + HLSL_INTRINSIC API surface to carry MaxShaderModel, and plumb it into generated intrinsic tables.
  • Emit availability attributes with introduced/deprecated/obsoleted versions and diagnose “removed” intrinsics/types; explicitly error on node shader entry points for SM ≥ 6.10 (but not lib_6_x).
  • Update/add tests for new availability output and SM6.10 Work Graph removal, and remove older node-shader-based FileCheckLit tests.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
utils/hct/hctdb_instrhelp.py Adds max_shader_model into generated intrinsic table entries.
utils/hct/hctdb.py Parses max_sm attribute and stores encoded max shader model in intrinsic DB objects.
utils/hct/gen_intrin_main.txt Annotates an intrinsic with min_sm/max_sm to drive availability.
tools/clang/unittests/HLSL/ExtensionTest.cpp Updates intrinsic table initializers for the new struct field.
tools/clang/test/SemaHLSL/hlsl/workgraph/sm6_10_node_shader_removed.hlsl New semantic test ensuring node shaders are rejected at SM6.10+.
tools/clang/test/SemaHLSL/hlsl/workgraph/sm6_10_lib_6x_no_diagnostics.hlsl New test ensuring lib_6_x defers Work Graph diagnostics.
tools/clang/test/SemaHLSL/hlsl/workgraph/ast-NodeOutputArrayTypes.hlsl Updates AST checks for added availability attributes on node record types.
tools/clang/test/SemaHLSL/hlsl/workgraph/ast-EmptyNodeOutputArrayTypes.hlsl Updates AST checks for added availability attributes.
tools/clang/test/SemaHLSL/hlsl/linalg/builtins/stage-errors.hlsl Removes node-stage expectations now that node shaders are removed in SM6.10 context.
tools/clang/test/HLSLFileCheckLit/hlsl/intrinsics/wave/group-wave-nodes.hlsl Removes node-shader-based FileCheckLit coverage for SM6.10.
tools/clang/test/HLSLFileCheckLit/hlsl/intrinsics/wave/group-wave-invalid-nodes.hlsl Removes node-shader-based negative test that no longer applies to SM6.10.
tools/clang/test/HLSLFileCheckLit/hlsl/entry/attributes/GroupSharedLimitNodeError.hlsl Removes GroupSharedLimit node shader tests targeting SM6.10.
tools/clang/test/HLSLFileCheckLit/hlsl/entry/attributes/GroupSharedLimitNode.hlsl Removes GroupSharedLimit node shader tests targeting SM6.10.
tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-rwnodeinput.hlsl Updates AST checks for node input record availability attributes.
tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-nodeoutput.hlsl Updates AST checks for node output record availability attributes.
tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-nodeinput.hlsl Updates AST checks for node input record availability attributes.
tools/clang/lib/Sema/SemaHLSLDiagnoseTU.cpp Adds “removed” availability diagnostics and SM6.10 node shader entry-point erroring.
tools/clang/lib/Sema/SemaHLSL.cpp Creates availability attrs using both min/max shader model (introduced/deprecated/obsoleted).
tools/clang/lib/AST/ASTContextHLSL.cpp Adds availability attrs to node record template types (introduced 6.8, deprecated 6.9, obsoleted 6.10).
tools/clang/include/clang/Basic/DiagnosticSemaKinds.td Introduces new diagnostics for “removed” intrinsics/types/constants and node shaders.
include/dxc/dxcapi.internal.h Extends HLSL_INTRINSIC with MaxShaderModel.

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

Comment thread tools/clang/lib/AST/ASTContextHLSL.cpp Outdated
Comment on lines +2106 to +2111
if (pIntrinsic->MaxShaderModel) {
unsigned Major = pIntrinsic->MaxShaderModel >> 4;
unsigned Minor = pIntrinsic->MaxShaderModel & 0xF;
Deprecated = clang::VersionTuple(Major, Minor);
Obsoleted = clang::VersionTuple(Major, Minor + 1);
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I've added an assert to cover this because it is unclear to me exactly what we would do. Bumping the major version is possible, as is reving the file format to remove the restrictions on minor version count.

Comment thread utils/hct/hctdb.py
Comment on lines +9919 to +9920
# cannot be encoded in the version DWORD.
if major < 0 or minor < 0 or minor > 14:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we should change this. I've added an assert in the C++ code to make sure we know how if we encounter problems with this.

Comment on lines +1 to +7
// RUN: %dxc -T lib_6_10 %s -verify

// Work Graphs (node shaders) were obsoleted in shader model 6.10. Declaring a
// node shader of any launch type when targeting shader model 6.10 or above
// must be an error, regardless of whether any node record types are used.
// Using a node record type must also be an error, independent of whether the
// entry point declaring it is itself a node shader.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The removed tests all cover SM 6.10 features, and would otherwise fail targeting 6.9.

Copilot AI review requested due to automatic review settings August 18, 2026 19:42

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.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.

Suppressed comments (3)

tools/clang/lib/AST/ASTContextHLSL.cpp:484

  • This helper function has external linkage as written (non-static at TU scope). To avoid potential link-time symbol collisions across translation units, give it internal linkage (e.g., static and/or place it in an anonymous namespace), consistent with typical .cpp-local helpers.
AvailabilityAttr *
ConstructAvailabilityAttribute(clang::ASTContext &context,
                               VersionTuple Introduced,
                               VersionTuple Deprecated = VersionTuple(),
                               VersionTuple Obsoleted = VersionTuple()) {
  AvailabilityAttr *AAttr = AvailabilityAttr::CreateImplicit(
      context, &context.Idents.get(""), Introduced, Deprecated, Obsoleted,
      false, "");
  return AAttr;
}

utils/hct/hctdb.py:9921

  • The comment says a minor version of 15 has special meaning, but the validation currently rejects minor == 15 by enforcing minor > 14 as invalid. Either update the comment to state that 15 is reserved/disallowed for max_sm, or adjust the check (and downstream handling) if 6.15 is intended to be representable.
                        # minor of 15 has special meaning, and larger values
                        # cannot be encoded in the version DWORD.
                        if major < 0 or minor < 0 or minor > 14:
                            raise ValueError

tools/clang/lib/Sema/SemaHLSL.cpp:2114

  • New behavior is introduced here for MaxShaderModel (deriving an Obsoleted version and driving “removed” diagnostics). Add a dedicated SemaHLSL test that exercises an intrinsic with max_sm (e.g., compile at the obsoleted SM and assert the new warn_hlsl_intrinsic_removed diagnostic, and compile under lib_6_x to assert no diagnostics), so this doesn’t regress silently.
  if (pIntrinsic->MinShaderModel || pIntrinsic->MaxShaderModel) {
    clang::VersionTuple Introduced;
    if (pIntrinsic->MinShaderModel) {
      unsigned Major = pIntrinsic->MinShaderModel >> 4;
      unsigned Minor = pIntrinsic->MinShaderModel & 0xF;
      Introduced = clang::VersionTuple(Major, Minor);
    }
    // The maximum shader model is the last one that still supports the
    // intrinsic: it is deprecated there, and obsoleted in the next minor
    // shader model version. We could give longer deprecation periods in the
    // future if there is a need for that.
    clang::VersionTuple Deprecated;
    clang::VersionTuple Obsoleted;
    if (pIntrinsic->MaxShaderModel) {
      unsigned Major = pIntrinsic->MaxShaderModel >> 4;
      unsigned Minor = pIntrinsic->MaxShaderModel & 0xF;
      Deprecated = clang::VersionTuple(Major, Minor);
      Obsoleted = clang::VersionTuple(Major, Minor + 1);
    }
    FD->addAttr(AvailabilityAttr::CreateImplicit(
        context, &context.Idents.get(""), Introduced, Deprecated, Obsoleted,
        false, ""));

Copilot AI review requested due to automatic review settings August 18, 2026 19:44

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.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.

Suppressed comments (5)

utils/hct/hctdb.py:9924

  • assert False is used for input validation. Python assertions can be optimized out (e.g., running with -O), which would silently ignore invalid max_sm values. Prefer raising a regular exception (e.g., ValueError) with the same message (or using an existing error-reporting path in this tool) so invalid attributes are always rejected.
                    try:
                        major_minor = v.split(".")
                        if len(major_minor) != 2:
                            raise ValueError
                        major, minor = major_minor
                        major = int(major)
                        minor = int(minor)
                        # minor of 15 has special meaning, and larger values
                        # cannot be encoded in the version DWORD.
                        if major < 0 or minor < 0 or minor > 14:
                            raise ValueError
                        max_shader_model = (major, minor)
                    except ValueError:
                        assert False, "invalid max_sm: %s" % (v)

utils/hct/hctdb.py:9851

  • max_shader_model is initialized to (0, 0), which is truthy, while later code treats “unset” as falsy (if max_shader_model:). Although this currently encodes to 0 and behaves correctly downstream, it makes the control flow and intent harder to reason about. Consider initializing max_shader_model to None (and only setting a tuple when max_sm is present) to align with the existing sentinel semantics.
            hidden = False
            min_shader_model = (0, 0)
            max_shader_model = (0, 0)
            for a in attrs:

tools/clang/lib/AST/ASTContextHLSL.cpp:484

  • This helper function in a .cpp file has external linkage (not static / not in an anonymous namespace). That can create unnecessary exported symbols and increases the risk of collisions if a similarly-named helper is added elsewhere. Make it static (or wrap in an anonymous namespace) to keep the symbol TU-local.
AvailabilityAttr *
ConstructAvailabilityAttribute(clang::ASTContext &context,
                               VersionTuple Introduced,
                               VersionTuple Deprecated = VersionTuple(),
                               VersionTuple Obsoleted = VersionTuple()) {
  AvailabilityAttr *AAttr = AvailabilityAttr::CreateImplicit(
      context, &context.Idents.get(""), Introduced, Deprecated, Obsoleted,
      false, "");
  return AAttr;
}

tools/clang/lib/Sema/SemaHLSL.cpp:2110

  • Obsoleted is computed as (Major, Minor + 1) without guarding boundary conditions. Given the earlier comment that minor 15 has special meaning, a max_sm of 6.14 would produce an obsoleted version 6.15, which may be confusing in diagnostics and can collide semantically with the reserved/offline minor. Consider rejecting max_sm minors that would overflow into the reserved value, or explicitly handling the boundary (e.g., avoid generating an obsoleted tuple when Minor == 14, or map to a well-defined next versioning scheme).
    if (pIntrinsic->MaxShaderModel) {
      unsigned Major = pIntrinsic->MaxShaderModel >> 4;
      unsigned Minor = pIntrinsic->MaxShaderModel & 0xF;
      Deprecated = clang::VersionTuple(Major, Minor);
      Obsoleted = clang::VersionTuple(Major, Minor + 1);
    }

tools/clang/test/SemaHLSL/hlsl/workgraph/sm6_10_node_shader_removed.hlsl:7

  • This PR removes multiple existing FileCheckLit tests that exercised Work Graph node shaders in lib_6_10 (e.g., wave/group and GroupSharedLimit scenarios). The new Sema tests cover the removal diagnostics, but they don’t replace coverage for the underlying functionality in the last supported shader models (e.g., SM 6.8/6.9) or for lib_6_x where checks are deferred. Consider reintroducing equivalent tests retargeted to lib_6_9 (for “still supported”) and/or lib_6_x (for “no diagnostics”) so behavior remains covered where it’s intended to work.
// RUN: %dxc -T lib_6_10 %s -verify

// Work Graphs (node shaders) were obsoleted in shader model 6.10. Declaring a
// node shader of any launch type when targeting shader model 6.10 or above
// must be an error, regardless of whether any node record types are used.
// Using a node record type must also be an error, independent of whether the
// entry point declaring it is itself a node shader.

Copilot AI review requested due to automatic review settings August 18, 2026 19:49

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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