---
generated: true
model: claude-opus-4-7
generated_at: 2026-05-22T00:00:00+00:00
source_commit: 6e923e2c0fe3cae4e7cf40e25a96569df5b9f009
watched_paths_digest: 3a231855d2500716d08acc7404223e6d69655007cc529e406477b87c9bf1a697
source_doc: docs/generated/design/target-pipelines/wgsl.md
source_doc_digest: d16c48a1b04e16432afea2867f729fb871e9db503b94181cca95f2b816a5f61d
warning: "Auto-generated. May drift from source. Do not edit by hand."
---

# Tests for target-pipelines/wgsl

## Intent
This bundle exercises the **WGSL target pipeline** documented at
`docs/generated/design/target-pipelines/wgsl.md`. The doc enumerates
four phases (Link / Specialization / WGSL legalization / Emit +
Tint) and several WGSL-specific gates and emit shapes. The
strategy is: one functional test per observable claim, using the
compute stage and FileCheck on the WGSL emit text. All tests run
with `-target wgsl -entry main -stage compute` against the
`slangc` text emitter; no Tint, no runtime, no GPU.


## Functional coverage
| Claim | Intent | Anchor | Tests |
| --- | --- | --- | --- |
| The wgsl-spirv target hands the emitted WGSL text to Tint which produces a SPIR-V module whose OpEntryPoint names main | functional | [#downstream-tint](../../../design/target-pipelines/wgsl.md#downstream-tint) | [`tint-downstream-spirv-emit.slang`](tint-downstream-spirv-emit.slang) |
| Five-level nested if/else with a merged value still lowers via the var+per-branch-assignment pattern of eliminatePhis | stress | [#eliminatephis-with-default-options](../../../design/target-pipelines/wgsl.md#eliminatephis-with-default-options) | [`nested-branches-five-deep-phi.slang`](nested-branches-five-deep-phi.slang) |
| eliminatePhis with default options replaces phi nodes with an explicit var and per-branch assignments | functional | [#eliminatephis-with-default-options](../../../design/target-pipelines/wgsl.md#eliminatephis-with-default-options) | [`eliminate-phis-default-options.slang`](eliminate-phis-default-options.slang) |
| ByteAddressBuffer.Load<uint>(0) at offset zero still emits the array<u32>[...]/4 indexing expression | boundary | [#legalizebyteaddressbufferops-with-wgsl-options](../../../design/target-pipelines/wgsl.md#legalizebyteaddressbufferops-with-wgsl-options) | [`byte-address-buffer-load-offset-zero.slang`](byte-address-buffer-load-offset-zero.slang) |
| legalizeByteAddressBufferOps with WGSL options lowers a ByteAddressBuffer.Load<uint> to an array<u32>[offset/4] indexing expression | functional | [#legalizebyteaddressbufferops-with-wgsl-options](../../../design/target-pipelines/wgsl.md#legalizebyteaddressbufferops-with-wgsl-options) | [`byte-address-buffer-load-divides-by-four.slang`](byte-address-buffer-load-divides-by-four.slang) |
| SV_DispatchThreadID becomes @builtin(global_invocation_id) on the WGSL entry-point parameter | functional | [#legalizeirforwgsl](../../../design/target-pipelines/wgsl.md#legalizeirforwgsl) | [`dispatch-thread-id-builtin.slang`](dispatch-thread-id-builtin.slang) |
| SV_GroupThreadID becomes @builtin(local_invocation_id) on the WGSL entry-point parameter | functional | [#legalizeirforwgsl](../../../design/target-pipelines/wgsl.md#legalizeirforwgsl) | [`group-thread-id-builtin.slang`](group-thread-id-builtin.slang) |
| Logical and-or over vector operands is rewritten to a WGSL select() call by legalizeLogicalAndOr | functional | [#legalizelogicalandor](../../../design/target-pipelines/wgsl.md#legalizelogicalandor) | [`vector-logical-and-becomes-select.slang`](vector-logical-and-becomes-select.slang) |
| lowerEnumType replaces enumerator references with the underlying integer literal in WGSL emit | functional | [#phase-a-link-and-entry-point-prep](../../../design/target-pipelines/wgsl.md#phase-a-link-and-entry-point-prep) | [`enum-lowering-to-integer.slang`](enum-lowering-to-integer.slang) |
| A static array index past the upper edge of a fixed-size array is rejected by Phase B with E30029 | negative | [#phase-b-specialization-and-type-legalization](../../../design/target-pipelines/wgsl.md#phase-b-specialization-and-type-legalization) | [`array-index-out-of-bounds-rejected.slang`](array-index-out-of-bounds-rejected.slang) |
| AppendStructuredBuffer.Append is rejected for the WGSL compute target with E36107 (unavailable features) | negative | [#phase-b-specialization-and-type-legalization](../../../design/target-pipelines/wgsl.md#phase-b-specialization-and-type-legalization) | [`append-structured-buffer-rejected.slang`](append-structured-buffer-rejected.slang) |
| Two Sampler2D globals each split into their own <name>_texture_* / <name>_sampler_* pair with distinct bindings | boundary | [#phase-b-specialization-and-type-legalization](../../../design/target-pipelines/wgsl.md#phase-b-specialization-and-type-legalization) | [`multi-combined-texture-sampler-pairs.slang`](multi-combined-texture-sampler-pairs.slang) |
| lowerCombinedTextureSamplers splits Sampler2D into a separate texture and sampler pair on WGSL | functional | [#phase-b-specialization-and-type-legalization](../../../design/target-pipelines/wgsl.md#phase-b-specialization-and-type-legalization) | [`combined-texture-sampler-split.slang`](combined-texture-sampler-split.slang) |
| A rectangular RWStructuredBuffer<float3x4> wraps in _MatrixStorage_float3x4_ColMajorstd430 with a 4-element array<vec3<f32>> | boundary | [#phase-c-wgsl-legalization-lowering-phi-elimination](../../../design/target-pipelines/wgsl.md#phase-c-wgsl-legalization-lowering-phi-elimination) | [`matrix-storage-rectangular-3x4.slang`](matrix-storage-rectangular-3x4.slang) |
| A small square RWStructuredBuffer<float2x2> wraps in _MatrixStorage_float2x2_ColMajorstd430 with @align(8) | boundary | [#phase-c-wgsl-legalization-lowering-phi-elimination](../../../design/target-pipelines/wgsl.md#phase-c-wgsl-legalization-lowering-phi-elimination) | [`matrix-storage-square-2x2.slang`](matrix-storage-square-2x2.slang) |
| asuint() / asfloat() reinterprets emit as WGSL bitcast<T>(...) expressions | functional | [#phase-c-wgsl-legalization-lowering-phi-elimination](../../../design/target-pipelines/wgsl.md#phase-c-wgsl-legalization-lowering-phi-elimination) | [`bitcast-spelling.slang`](bitcast-spelling.slang) |
| collectCooperativeMetadata is gated on cooperative_matrix or cooperative_vector capability and does not fire for a plain WGSL compute kernel | negative | [#phase-c-wgsl-legalization-lowering-phi-elimination](../../../design/target-pipelines/wgsl.md#phase-c-wgsl-legalization-lowering-phi-elimination) | [`cooperative-metadata-not-collected-on-wgsl.slang`](cooperative-metadata-not-collected-on-wgsl.slang) |
| legalizeArrayReturnType rewrites array-returning functions into out-parameter form on WGSL | functional | [#phase-c-wgsl-legalization-lowering-phi-elimination](../../../design/target-pipelines/wgsl.md#phase-c-wgsl-legalization-lowering-phi-elimination) | [`array-return-rewritten-to-out-pointer.slang`](array-return-rewritten-to-out-pointer.slang) |
| legalizeUniformBufferLoad / invertYOfPositionOutput / rcpWOfPositionInput are gated on isKhronosTarget or HLSL and do not fire for the WGSL target | negative | [#phase-c-wgsl-legalization-lowering-phi-elimination](../../../design/target-pipelines/wgsl.md#phase-c-wgsl-legalization-lowering-phi-elimination) | [`uniform-buffer-load-no-khronos-legalization.slang`](uniform-buffer-load-no-khronos-legalization.slang) |
| lowerBufferElementTypeToStorageType wraps a structured buffer's matrix element in a _MatrixStorage_ struct on WGSL | functional | [#phase-c-wgsl-legalization-lowering-phi-elimination](../../../design/target-pipelines/wgsl.md#phase-c-wgsl-legalization-lowering-phi-elimination) | [`structured-buffer-of-matrix-wraps-storage.slang`](structured-buffer-of-matrix-wraps-storage.slang) |
| +inf and -inf in a float vector emit via the _slang_getInfinity helper because WGSL has no inf literal | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`float-vector-with-infinity.slang`](float-vector-with-infinity.slang) |
| A 1024-element function-local int array emits as array<i32, i32(1024)> with the size preserved verbatim | stress | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`large-array-1024-elements.slang`](large-array-1024-elements.slang) |
| A ConstantBuffer holding a matrix uses the std140 (not std430) flavour of the matrix wrapper struct | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`constant-buffer-matrix-std140-wrapper.slang`](constant-buffer-matrix-std140-wrapper.slang) |
| A NaN-producing expression (0.0/0.0) emits via the _slang_getNan helper because WGSL has no nan literal | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`float-nan-via-helper.slang`](float-nan-via-helper.slang) |
| A struct field after a vec3 carries @align(4) in the std430 wrapper while the vec3 itself is @align(16) | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`vec3-padding-trailing-field.slang`](vec3-padding-trailing-field.slang) |
| A vec2(0.0, -0.0) preserves the distinct positive- and negative-zero bit patterns in the emitted f32 literals | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`float-positive-and-negative-zero.slang`](float-positive-and-negative-zero.slang) |
| Atomic<int> emits as atomic<i32> and .add() lowers to atomicAdd on the i32 element | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`atomic-int-add.slang`](atomic-int-add.slang) |
| Atomic<uint> emits as atomic<u32> in the storage buffer element and .add() lowers to atomicAdd | functional | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`atomic-add-buffer.slang`](atomic-add-buffer.slang) |
| ConstantBuffer<T> emits as a std140-shaped struct with @align field annotations bound as var<uniform> | functional | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`constant-buffer-uniform-std140.slang`](constant-buffer-uniform-std140.slang) |
| Eight module-scope storage buffers receive eight distinct sequential @binding indices in @group(0) | stress | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`multi-resources-many-bindings-stress.slang`](multi-resources-many-bindings-stress.slang) |
| Explicit vk::binding(0, 0) emits @binding(0) @group(0) at the lower edge of the binding axis | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`binding-zero-group-zero.slang`](binding-zero-group-zero.slang) |
| Explicit vk::binding(15, 3) emits @binding(15) @group(3) preserving high binding/group indices | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`binding-15-group-3-high.slang`](binding-15-group-3-high.slang) |
| HLSL-style InterlockedAdd is rejected for the WGSL compute target with E36107 (use Atomic<T> instead) | negative | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`interlocked-add-rejected.slang`](interlocked-add-rejected.slang) |
| Multiple resources at module scope receive distinct sequential @binding indices in @group(0) | functional | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`multiple-resources-distinct-bindings.slang`](multiple-resources-distinct-bindings.slang) |
| RWStructuredBuffer<T> emits as var<storage, read_write> with @binding/@group attributes | functional | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`rw-structured-buffer-storage-binding.slang`](rw-structured-buffer-storage-binding.slang) |
| RWTexture2D<float4> emits as a global var with WGSL texture_storage_2d<...,read_write> type and textureStore/textureLoad lowerings. | expansion | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`rwtexture2d-storage-emit.slang`](rwtexture2d-storage-emit.slang) |
| Read-only StructuredBuffer<T> emits as var<storage, read> (read-only access mode) | functional | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`structured-buffer-storage-read.slang`](structured-buffer-storage-read.slang) |
| Slang integer constants emit as i32(N) / u32(N) constructor-style spellings in WGSL | functional | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`integer-literal-spelling.slang`](integer-literal-spelling.slang) |
| Texture1D<float4> emits as a global var with WGSL texture_1d<f32> type with a @binding/@group annotation. | expansion | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`texture1d-emit.slang`](texture1d-emit.slang) |
| Texture2D<float4> emits as a global var with texture_2d<f32> type and a @binding/@group pair | functional | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`texture2d-binding.slang`](texture2d-binding.slang) |
| Texture2D<float4>.Load(int3(xy, lod)) lowers to WGSL textureLoad(tex, xy, lod) (no sampler involved). | expansion | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`texture2d-load-emit.slang`](texture2d-load-emit.slang) |
| Texture2D<float4>.Sample(samp, uv) lowers to WGSL textureSample(tex, samp, uv) without an explicit LOD argument. | expansion | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`texture2d-sample-emit.slang`](texture2d-sample-emit.slang) |
| Texture2DArray<float4> emits as a global var with WGSL texture_2d_array<f32> type and a @binding/@group annotation. | expansion | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`texture2darray-emit.slang`](texture2darray-emit.slang) |
| Texture3D<float4> emits as a global var with WGSL texture_3d<f32> type and a @binding/@group annotation. | expansion | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`texture3d-emit.slang`](texture3d-emit.slang) |
| TextureCube<float4> emits as a global var with WGSL texture_cube<f32> type and a @binding/@group annotation. | expansion | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`texturecube-emit.slang`](texturecube-emit.slang) |
| The int literal -2147483648 emits as i32(-2147483648) at the lower edge of the signed 32-bit range | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`integer-literal-int-min.slang`](integer-literal-int-min.slang) |
| The int literal 2147483647 emits as i32(2147483647) at the upper edge of the signed 32-bit range | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`integer-literal-int-max.slang`](integer-literal-int-max.slang) |
| The uint literal 0u emits as u32(0) at the lower edge of the unsigned integer range | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`integer-literal-uint-zero.slang`](integer-literal-uint-zero.slang) |
| The uint literal 0xFFFFFFFFu emits as u32(4294967295) at the upper edge of the unsigned integer range | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`integer-literal-uint-max.slang`](integer-literal-uint-max.slang) |
| WGSL emit selects LineDirectiveMode::None so the output contains no #line directives | functional | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`no-line-directives.slang`](no-line-directives.slang) |
| WGSL emit uses generic-vector spellings: uint3 becomes vec3<u32>, float2 becomes vec2<f32> | functional | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`uint3-becomes-vec3-u32.slang`](uint3-becomes-vec3-u32.slang) |
| WGSL preserves the entry-point name; 'main' emits as 'fn main(...)' | functional | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`entry-point-name-main-preserved.slang`](entry-point-name-main-preserved.slang) |
| [numthreads(0,1,1)] is rejected with diagnostic E31102 ('invalid numthreads value') because the @workgroup_size axis cannot be zero | negative | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`numthreads-zero-rejected.slang`](numthreads-zero-rejected.slang) |
| [numthreads(1,1,1)] at the lower edge emits @workgroup_size(1, 1, 1) | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`numthreads-one-one-one-minimum.slang`](numthreads-one-one-one-minimum.slang) |
| [numthreads(256,1,1)] at the WebGPU compute upper edge emits @workgroup_size(256, 1, 1) verbatim | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`numthreads-256-1-1-webgpu-max.slang`](numthreads-256-1-1-webgpu-max.slang) |
| [numthreads(8,8,4)] (a 3D 256-product) emits @workgroup_size(8, 8, 4) preserving each axis | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`numthreads-3d-product-256.slang`](numthreads-3d-product-256.slang) |
| [numthreads(X,Y,Z)] on a compute entry point emits @compute followed by @workgroup_size(X, Y, Z) | functional | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`numthreads-becomes-workgroup-size.slang`](numthreads-becomes-workgroup-size.slang) |
| atomicAdd at uint MAX (0xFFFFFFFFu) emits the value as u32(4294967295) inside the atomicAdd call | boundary | [#phase-d-wgsl-emit-and-downstream-tools](../../../design/target-pipelines/wgsl.md#phase-d-wgsl-emit-and-downstream-tools) | [`atomic-uint-add-max-value.slang`](atomic-uint-add-max-value.slang) |
| A 256-element groupshared array emits as var<workgroup> ... : array<u32, i32(256)> | boundary | [#specializeaddressspaceforwgsl](../../../design/target-pipelines/wgsl.md#specializeaddressspaceforwgsl) | [`groupshared-array-256-elements.slang`](groupshared-array-256-elements.slang) |
| A loose-uniform global parameter emits with var<uniform> address space and a std140 wrapper struct | boundary | [#specializeaddressspaceforwgsl](../../../design/target-pipelines/wgsl.md#specializeaddressspaceforwgsl) | [`storage-uniform-explicit-address-space.slang`](storage-uniform-explicit-address-space.slang) |
| Module-scope static variables become var<private> with the initializer fired inside main | functional | [#specializeaddressspaceforwgsl](../../../design/target-pipelines/wgsl.md#specializeaddressspaceforwgsl) | [`static-module-global-becomes-private.slang`](static-module-global-becomes-private.slang) |
| groupshared declarations are tagged var<workgroup> by specializeAddressSpaceForWGSL | functional | [#specializeaddressspaceforwgsl](../../../design/target-pipelines/wgsl.md#specializeaddressspaceforwgsl) | [`groupshared-becomes-workgroup-address-space.slang`](groupshared-becomes-workgroup-address-space.slang) |


## Untested claims
| Claim | Reason | Anchor | Why untested |
| --- | --- | --- | --- |
| **`AppendStructuredBuffer<T>` / `ConsumeStructuredBuffer<T>`.** The Slang front-end rejects these in a WGSL compute entry point with `E36107`, so the `lowerAppendConsumeStructuredBuffers` pass that runs for WGSL is not reachable from a `.slang` source. | (unclassified) | [#e36107](../../../design/target-pipelines/wgsl.md#e36107) | Reason and explanation to be refined by the next regeneration. |
| **HLSL-style `InterlockedAdd` / `InterlockedExchange`.** Slang rejects these for WGSL; use `Atomic<T>` instead (covered by `atomic-add-buffer.slang`). | (unclassified) | [#interlockedadd](../../../design/target-pipelines/wgsl.md#interlockedadd) | Reason and explanation to be refined by the next regeneration. |
| **`legalizeEntryPointsForGLSL`, `legalizeImageSubscript`, `legalizeConstantBufferLoadForGLSL`.** GLSL/SPIR-V only. | (unclassified) | [#legalizeentrypointsforglsl](../../../design/target-pipelines/wgsl.md#legalizeentrypointsforglsl) | Reason and explanation to be refined by the next regeneration. |
| **WGSL has no iterative passes (zero loops in `linkAndOptimizeIR`).** A textual claim about the absence of a while loop; not directly observable in emitted text. | (unclassified) | [#linkandoptimizeir](../../../design/target-pipelines/wgsl.md#linkandoptimizeir) | Reason and explanation to be refined by the next regeneration. |
| **Pass-ordering inside Phase A/B/C.** Pass existence is observable from emitted text; intra-phase ordering needs `-dump-ir` anchors that the doc does not pin. | implementation-detail | (unspecified) | Internal compiler choice (pass ordering, hoistability decisions, deduplication) with no test-directive that reveals it. |
| **DXR / mesh / ray-tracing / graphics-stage entry points.** WGSL has no DXR or ray-tracing surface; ray-tracing entry points are covered in the HLSL and SPIR-V target-pipeline bundles instead. | out-of-bundle | (unspecified) | WGSL fundamentally lacks the ray-tracing surface; covered by the `hlsl` / `spirv` sibling bundles. |


## Doc gaps observed
| Anchor | Kind | Gap | Suggested addition |
| --- | --- | --- | --- |
| [#phase-d-](../../../design/target-pipelines/wgsl.md#phase-d-) | undocumented-behavior | The doc names the `i32(N)` / `u32(N)` / `<value>f` literal spellings only obliquely (in passing inside the address-space discussion). | A short subsection under "Phase D" that pins down the literal-emit shapes (and the `vec<rank><elem>` rule for WGSL vector types) would let tests anchor directly to that subsection instead of to the broad `#phase-d-...` anchor. |
| [#matrix-storage-wrapper](../../../design/target-pipelines/wgsl.md#matrix-storage-wrapper) | undocumented-behavior | The doc does not describe the `_MatrixStorage_<spelling>_ColMajorstd430_*` wrapper struct shape produced when a structured buffer holds a matrix element. The `lowerBufferElementTypeToStorageType` paragraph mentions the policy but not the generated struct name. Add an anchor (e.g. `#matrix-storage-wrapper`) under Phase C with the canonical wrapper name. |  |
| [#std140](../../../design/target-pipelines/wgsl.md#std140) | undocumented-behavior | The doc mentions `std140`-shaped struct layouts for constant buffers but does not document the per-field `@align(N)` annotations on the wrapper struct. A subsection describing the `_std140_*` wrapper struct shape and its `@align` decorations would let `constant-buffer-uniform-std140.slang` anchor more precisely. |  |
| [#lowercombinedtexturesamplers](../../../design/target-pipelines/wgsl.md#lowercombinedtexturesamplers) | undocumented-behavior | The doc states `lowerCombinedTextureSamplers` fires for WGSL (since WGSL is in the same arm as HLSL/Metal/WGSL) but does not document the naming convention for the split pair (`<name>_texture_*` / `<name>_sampler_*`). The naming is an emit-observable that lacks a marker in the doc. |  |
| [#eliminatephis](../../../design/target-pipelines/wgsl.md#eliminatephis) | undocumented-behavior | `eliminatePhis` is described in terms of `PhiEliminationOptions` defaults but the doc does not say what the WGSL emit shape of an `if`/`else` merged value looks like (the `var ... : T` + branch assignment pattern). A small example of the emit shape would strengthen the anchor for the eliminate-phis test. |  |
| [#texture2dfloat4](../../../design/target-pipelines/wgsl.md#texture2dfloat4) | undocumented-behavior | The doc names the Phase-D `Texture2D<float4>` emit shape (`texture_2d<f32>`) but does not enumerate the **per-Slang- texture-variant → WGSL `texture_*<f32>` mapping** for `Texture1D` (`texture_1d`), `Texture3D` (`texture_3d`), `TextureCube` (`texture_cube`), `Texture2DArray` (`texture_2d_array`), or `RWTexture2D` (`texture_storage_2d<format, access>`). A Phase-D subsection with the table would let texture-variant tests anchor each mapping precisely. |  |
| [#sample](../../../design/target-pipelines/wgsl.md#sample) | undocumented-behavior | The doc does not describe how Slang lowers the various texture-access intrinsics (`Sample`, `SampleLevel`, `SampleGrad`, `Load`) to their WGSL counterparts (`textureSample`, `textureSampleLevel`, `textureSampleGrad`, `textureLoad`). A subsection would let sample-shape tests anchor concretely. |  |
| [#rwtexture2dfloat4](../../../design/target-pipelines/wgsl.md#rwtexture2dfloat4) | undocumented-behavior | The doc does not document how WGSL's storage-texture format is inferred from the Slang element type (`RWTexture2D<float4>` → `rgba32float`). The `RWTexture2D.Load` / `.Store` test anchors broadly to Phase D; pinning the inferred-format rule would let it anchor precisely. |  |
