Skip to content

Select a native HLSL validator for artifacts requiring 16-bit scalar types #1817

Description

@NripeshN

Problem

Project and regression validation can fall back from DXC to glslangValidator for generated HLSL. That fallback is not valid when the artifact requires native DirectX 16-bit scalar types such as int16_t or uint16_t.

For example, the Metal nested-reference regression emits an HLSL helper with int16_t parameters. DXC accepts this profile with -enable-16bit-types, but glslang rejects the declaration during HLSL parsing even when invoked with --hlsl-enable-16bit-types.

This also applies to repository-porting workloads whose reports declare directx.native-16bit-types, including MLX kernels at commit 4367c73b60541ddd5a266ce4644fd93d20223b6e.

Required behavior

  • Detect HLSL artifacts that require the native 16-bit DirectX profile.
  • Select DXC with -enable-16bit-types for those artifacts.
  • When DXC is unavailable, report a structured validator-unavailable result instead of treating glslang as an equivalent validator.
  • Keep glslang fallback validation for HLSL profiles it can parse faithfully.
  • Cover direct toolchain APIs, project validation, and regression-test helpers with tests.

Acceptance criteria

  • Native-16-bit HLSL is never submitted to an incompatible glslang fallback.
  • Reports distinguish tool unavailability from shader compilation failure.
  • Existing non-native HLSL glslang validation remains covered.
  • A reduced int16_t helper fixture passes with DXC and produces the expected unavailable result without DXC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions