---
generated: true
model: claude-opus-4-7
generated_at: 2026-05-21T09:38:00Z
source_commit: 1106750632bd5fb062ea9e50319f7763d34f78d5
watched_paths_digest: 79f0d532a4fd57a48ed9dba066f683cc3eb4cbf8e598a4baa37929c3e9113855
source_doc: docs/generated/design/cross-cutting/core-module.md
source_doc_digest: 940b46557a03f1e089bcd47c43fb6d5a5cc72aa0dcf703ab83e117d28307a902
warning: "Auto-generated. May drift from source. Do not edit by hand."
---

# Tests for cross-cutting/core-module

## Intent
Tests verify the core-module / GLSL-module / standard-module / prelude
claims in
[`docs/generated/design/cross-cutting/core-module.md`](../../../design/cross-cutting/core-module.md):

- The core module is a single identified Slang module
  (`public module core;`) whose declarations (scalar typedef aliases,
  vector/matrix types, `Optional`, `Tuple`) are in scope without
  explicit `import`.
- The HLSL meta-module layers in HLSL-named intrinsics (`dot`,
  `length`, `mul`) and resource types (`Texture2D`,
  `RWStructuredBuffer`) that lower to per-target spellings.
- The diff meta-module declares `IDifferentiable` and is implicitly
  loaded.
- The GLSL module (`vec3`, `gl_*`) is loaded conditionally via
  `-allow-glsl` (the doc's "compiler pulls it in when ... asks for
  GLSL-flavoured names from Slang code" wording).
- Standard modules (`import slang.<name>`; currently `neural`) are
  loaded on demand at runtime, NOT implicit.
- Per-target preludes (the C/C++/CUDA headers) are referenced from
  emitted text output, observable via prelude-defined markers
  (`SLANG_PRELUDE_EXPORT`, `extern "C" __global__`).

Multi-target where the claim is target-dependent (intrinsic /
resource / vector lowering); single-target where the claim is
module-identity (typedef resolves, `Optional<T>` compiles).


## Functional coverage
| Claim | Intent | Anchor | Tests |
| --- | --- | --- | --- |
| Boundary: HLSL meta-module Texture2D.Sample accepts the (0,0) corner UV and lowers per target. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture-sample-uv-corner.slang`](texture-sample-uv-corner.slang) |
| Boundary: HLSL meta-module Texture2D.Sample accepts the center UV (0.5,0.5) and lowers per target. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture-sample-uv-center.slang`](texture-sample-uv-center.slang) |
| Boundary: the HLSL meta-module's `dot` intrinsic accepts a NaN-vector argument and the HLSL backend preserves the `dot(` call. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`dot-nan-vector.slang`](dot-nan-vector.slang) |
| Boundary: the HLSL meta-module's `dot` intrinsic accepts a zero-vector argument and the HLSL backend preserves the `dot(` call. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`dot-zero-vector.slang`](dot-zero-vector.slang) |
| Boundary: the HLSL meta-module's `dot` intrinsic accepts an (inf,inf,inf) argument and the HLSL backend preserves the `dot(` call. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`dot-inf-vector.slang`](dot-inf-vector.slang) |
| Boundary: the HLSL meta-module's `length` intrinsic accepts a (0,0,0) vector; the HLSL backend preserves the `length(` call. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`length-zero-vector.slang`](length-zero-vector.slang) |
| Boundary: the HLSL meta-module's `length` intrinsic accepts a NaN vector; the HLSL backend preserves the `length(` call. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`length-nan-vector.slang`](length-nan-vector.slang) |
| Boundary: the HLSL meta-module's `mul(matrix, vector)` accepts a 2x2 matrix (smallest practical square dim) and lowers per target. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`mul-matrix-vector-2x2.slang`](mul-matrix-vector-2x2.slang) |
| Boundary: the HLSL meta-module's `mul(matrix, vector)` accepts a 4x4 matrix (large common dim) and lowers per target. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`mul-matrix-vector-4x4.slang`](mul-matrix-vector-4x4.slang) |
| Boundary: the HLSL meta-module's `mul(matrix, vector)` accepts an all-zero matrix and the HLSL backend preserves the `mul(` call. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`mul-zero-matrix-vector.slang`](mul-zero-matrix-vector.slang) |
| Boundary: the HLSL meta-module's `normalize` intrinsic accepts a zero-vector argument; the HLSL backend preserves the `normalize(` call (runtime result is implementation-defined, not asserted here). | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`normalize-zero-vector.slang`](normalize-zero-vector.slang) |
| Boundary: the core/HLSL meta-module `printf` accepts a +inf float argument and formats it under the interpreter. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`printf-float-inf.slang`](printf-float-inf.slang) |
| Boundary: the core/HLSL meta-module `printf` accepts a NaN float argument and formats it under the interpreter. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`printf-float-nan.slang`](printf-float-nan.slang) |
| Boundary: the core/HLSL meta-module `printf` accepts a format string with zero format specifiers (no variadic args). | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`printf-no-args.slang`](printf-no-args.slang) |
| Boundary: the core/HLSL meta-module `printf` accepts an int32 MAX argument and formats it correctly under the interpreter. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`printf-int-max.slang`](printf-int-max.slang) |
| Boundary: the core/HLSL meta-module `printf` accepts int32 MIN and formats it correctly under the interpreter. | boundary | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`printf-int-min.slang`](printf-int-min.slang) |
| Expansion: HLSL meta-module `RWTexture1D.Load(int idx)` lowers per target (HLSL Load on RWTexture1D, GLSL imageLoad over an image1D, SPIR-V OpImageRead). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`rwtexture1d-load.slang`](rwtexture1d-load.slang) |
| Expansion: HLSL meta-module `RWTexture1D<uint>` (integer-format variant) subscript-store lowers per target — GLSL emits a uint image (uimage1D), confirming the writable-resource lowering carries the uint sampled-type. | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`rwtexture1d-uint-format-store.slang`](rwtexture1d-uint-format-store.slang) |
| Expansion: HLSL meta-module `RWTexture1D[idx] = value` (subscript-store) lowers per target (HLSL subscript-store, GLSL imageStore over an image1D, SPIR-V OpImageWrite). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`rwtexture1d-store.slang`](rwtexture1d-store.slang) |
| Expansion: HLSL meta-module `RWTexture3D.Load(int3 idx)` lowers per target (HLSL Load on RWTexture3D, GLSL imageLoad over image3D, SPIR-V OpImageRead). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`rwtexture3d-load.slang`](rwtexture3d-load.slang) |
| Expansion: HLSL meta-module `RWTexture3D[uint3] = value` (subscript-store) lowers per target (HLSL subscript-store, GLSL imageStore over image3D, SPIR-V OpImageWrite). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`rwtexture3d-store.slang`](rwtexture3d-store.slang) |
| Expansion: HLSL meta-module `Texture1D.Load(int2 x+mip)` (sampler-less direct texel fetch) lowers per target (HLSL Load, GLSL texelFetch over a 1D texture, SPIR-V OpImageFetch). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture1d-load.slang`](texture1d-load.slang) |
| Expansion: HLSL meta-module `Texture1D.Sample(sampler, u)` lowers per target (HLSL Sample, GLSL texture over sampler1D, SPIR-V OpImageSampleImplicitLod over a 1D OpTypeImage). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture1d-sample.slang`](texture1d-sample.slang) |
| Expansion: HLSL meta-module `Texture1D.SampleGrad(sampler, u, ddx, ddy)` lowers per target (HLSL SampleGrad, GLSL textureGrad over sampler1D, SPIR-V OpImageSampleExplicitLod Grad). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture1d-samplegrad.slang`](texture1d-samplegrad.slang) |
| Expansion: HLSL meta-module `Texture1D.SampleLevel(sampler, u, lod)` lowers per target (HLSL SampleLevel, GLSL textureLod over sampler1D, SPIR-V OpImageSampleExplicitLod Lod). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture1d-samplelevel.slang`](texture1d-samplelevel.slang) |
| Expansion: HLSL meta-module `Texture2D<float>.SampleCmp(SamplerComparisonState, uv, ref)` lowers per target (HLSL SampleCmp, GLSL textureLod over sampler2DShadow, SPIR-V OpImageSampleDrefImplicitLod). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`samplercmp-samplecmp.slang`](samplercmp-samplecmp.slang) |
| Expansion: HLSL meta-module `Texture2D<float>.SampleCmpLevelZero(SamplerComparisonState, uv, ref)` lowers per target (HLSL SampleCmpLevelZero, GLSL textureLod over sampler2DShadow with LOD 0, SPIR-V OpImageSampleDrefExplicitLod Lod 0). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`samplercmp-samplecmplevelzero.slang`](samplercmp-samplecmplevelzero.slang) |
| Expansion: HLSL meta-module `Texture2DArray.GatherRed(sampler, float3{uv, slice})` lowers per target (HLSL GatherRed, GLSL textureGather over sampler2DArray, SPIR-V OpImageGather). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture2darray-gatherred.slang`](texture2darray-gatherred.slang) |
| Expansion: HLSL meta-module `Texture2DArray.Load(int4 xy + slice + mip)` lowers per target (HLSL Load, GLSL texelFetch over a 2D-array texture, SPIR-V OpImageFetch over a 2D Arrayed image). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture2darray-load.slang`](texture2darray-load.slang) |
| Expansion: HLSL meta-module `Texture2DArray.Sample(sampler, float3{uv, slice})` lowers per target (HLSL Sample, GLSL texture over sampler2DArray, SPIR-V OpImageSampleImplicitLod over a 2D Arrayed OpTypeImage). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture2darray-sample.slang`](texture2darray-sample.slang) |
| Expansion: HLSL meta-module `Texture2DArray.SampleGrad(sampler, float3{uv, slice}, ddx, ddy)` lowers per target (HLSL SampleGrad, GLSL textureGrad over sampler2DArray, SPIR-V OpImageSampleExplicitLod Grad). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture2darray-samplegrad.slang`](texture2darray-samplegrad.slang) |
| Expansion: HLSL meta-module `Texture2DArray.SampleLevel(sampler, float3{uv, slice}, lod)` lowers per target (HLSL SampleLevel, GLSL textureLod over sampler2DArray, SPIR-V OpImageSampleExplicitLod Lod). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture2darray-samplelevel.slang`](texture2darray-samplelevel.slang) |
| Expansion: HLSL meta-module `Texture2DMS.Load(int2 coord, sampleIdx)` lowers per target (HLSL Load with sample index, GLSL texelFetch, SPIR-V OpImageFetch over a multisampled image). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture2dms-load.slang`](texture2dms-load.slang) |
| Expansion: HLSL meta-module `Texture3D.Load(int4 xyz+mip)` (sampler-less direct texel fetch) lowers per target (HLSL Load, GLSL texelFetch over a 3D texture handle, SPIR-V OpImageFetch). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture3d-load.slang`](texture3d-load.slang) |
| Expansion: HLSL meta-module `Texture3D.SampleGrad(sampler, uvw, ddx, ddy)` lowers per target (HLSL SampleGrad, GLSL textureGrad over sampler3D, SPIR-V OpImageSampleExplicitLod with Grad operand). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture3d-samplegrad.slang`](texture3d-samplegrad.slang) |
| Expansion: HLSL meta-module `Texture3D.SampleLevel(sampler, uvw, lod)` lowers per target (HLSL SampleLevel, GLSL textureLod over sampler3D, SPIR-V OpImageSampleExplicitLod with Lod operand). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture3d-samplelevel.slang`](texture3d-samplelevel.slang) |
| Expansion: HLSL meta-module `Texture3D<uint4>` (integer-format variant) lowers per target — GLSL emits a uint-flavoured sampler (utexture3D/usampler3D), confirming the format generic propagates through the resource lowering. | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture3d-uint-format-load.slang`](texture3d-uint-format-load.slang) |
| Expansion: HLSL meta-module `Texture3D` plus `Sample(sampler, uvw)` lowers per target (HLSL keeps Sample, GLSL emits texture(sampler3D), SPIR-V emits OpImageSampleImplicitLod over a 3D OpTypeImage). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texture3d-sample.slang`](texture3d-sample.slang) |
| Expansion: HLSL meta-module `TextureCube.GatherRed(sampler, dir)` lowers per target (HLSL GatherRed, GLSL textureGather over samplerCube, SPIR-V OpImageGather). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texturecube-gatherred.slang`](texturecube-gatherred.slang) |
| Expansion: HLSL meta-module `TextureCube.Load(int4 face-major coord + mip)` is accepted by the front-end and lowered (HLSL keeps Load on TextureCube). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texturecube-load.slang`](texturecube-load.slang) |
| Expansion: HLSL meta-module `TextureCube.Sample(sampler, dir)` lowers per target (HLSL Sample, GLSL texture over samplerCube, SPIR-V OpImageSampleImplicitLod over a Cube OpTypeImage). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texturecube-sample.slang`](texturecube-sample.slang) |
| Expansion: HLSL meta-module `TextureCube.SampleGrad(sampler, dir, ddx, ddy)` lowers per target (HLSL SampleGrad, GLSL textureGrad over samplerCube, SPIR-V OpImageSampleExplicitLod Grad). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texturecube-samplegrad.slang`](texturecube-samplegrad.slang) |
| Expansion: HLSL meta-module `TextureCube.SampleLevel(sampler, dir, lod)` lowers per target (HLSL SampleLevel, GLSL textureLod over samplerCube, SPIR-V OpImageSampleExplicitLod Lod). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texturecube-samplelevel.slang`](texturecube-samplelevel.slang) |
| Expansion: HLSL meta-module `TextureCubeArray.Sample(sampler, float4{dir, slice})` lowers per target (HLSL Sample, GLSL texture over samplerCubeArray, SPIR-V OpImageSampleImplicitLod over a Cube Arrayed image). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texturecubearray-sample.slang`](texturecubearray-sample.slang) |
| Expansion: HLSL meta-module `TextureCubeArray.SampleGrad(sampler, float4{dir, slice}, ddx, ddy)` lowers per target (HLSL SampleGrad, GLSL textureGrad over samplerCubeArray, SPIR-V OpImageSampleExplicitLod Grad). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texturecubearray-samplegrad.slang`](texturecubearray-samplegrad.slang) |
| Expansion: HLSL meta-module `TextureCubeArray.SampleLevel(sampler, float4{dir, slice}, lod)` lowers per target (HLSL SampleLevel, GLSL textureLod over samplerCubeArray, SPIR-V OpImageSampleExplicitLod Lod). | expansion | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`texturecubearray-samplelevel.slang`](texturecubearray-samplelevel.slang) |
| Stress: eight back-to-back `dot` intrinsic calls in one expression all survive HLSL emit. | stress | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`dot-many-uses-stress.slang`](dot-many-uses-stress.slang) |
| Stress: four chained `mul(matrix, vector)` calls all survive HLSL emit. | stress | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`mul-many-uses-stress.slang`](mul-many-uses-stress.slang) |
| Stress: the core/HLSL meta-module `printf` accepts a long variadic arg list (>=8) and emits each value. | stress | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`printf-many-args.slang`](printf-many-args.slang) |
| The HLSL meta-module's `RWStructuredBuffer<T>` resource type legalizes to per-target binding shapes — HLSL `register(u..)`, GLSL/SPIR-V `Binding`, Metal `buffer(..)`. | functional | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`hlsl-resource-rwstructuredbuffer-lowers-per-target.slang`](hlsl-resource-rwstructuredbuffer-lowers-per-target.slang) |
| The HLSL meta-module's `Texture2D` resource type lowers per target — HLSL `Texture2D`, GLSL `texture2D`/sampler binding, SPIR-V `OpTypeImage` / `OpTypeSampledImage`. | functional | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`hlsl-resource-texture2d-lowers-per-target.slang`](hlsl-resource-texture2d-lowers-per-target.slang) |
| The HLSL meta-module's `dot` intrinsic lowers to per-target spellings: HLSL `dot`, GLSL `dot`, SPIR-V `OpDot`, CUDA scalar fma chain. | functional | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`hlsl-intrinsic-dot-lowers-per-target.slang`](hlsl-intrinsic-dot-lowers-per-target.slang) |
| The HLSL meta-module's `length` intrinsic lowers per target — HLSL `length`, GLSL `length`, SPIR-V GLSL.std.450 `Length`. | functional | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`hlsl-intrinsic-length-lowers-per-target.slang`](hlsl-intrinsic-length-lowers-per-target.slang) |
| The HLSL meta-module's `mul(matrix, vector)` intrinsic lowers to per-target matrix-vector multiplication spellings. | functional | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`hlsl-intrinsic-mul-matrix-lowers-per-target.slang`](hlsl-intrinsic-mul-matrix-lowers-per-target.slang) |
| The diff meta-module declares `IDifferentiable`; a user struct conforming to it with `Differential = This` is accepted by the front-end without explicit import. | functional | [#core-module](../../../design/cross-cutting/core-module.md#core-module) | [`diff-idifferentiable-frontend-accepts.slang`](diff-idifferentiable-frontend-accepts.slang) |
| Boundary: the GLSL module provides `mat4` (4x4 matrix alias) under -allow-glsl and the per-target lowering preserves matrix-vector multiply. | boundary | [#glsl-module](../../../design/cross-cutting/core-module.md#glsl-module) | [`glsl-mat4-allow-glsl.slang`](glsl-mat4-allow-glsl.slang) |
| Boundary: under -allow-glsl, GLSL-flavoured names `min`, `max`, `clamp` resolve and lower to per-target spellings. | boundary | [#glsl-module](../../../design/cross-cutting/core-module.md#glsl-module) | [`glsl-min-max-clamp-aliases.slang`](glsl-min-max-clamp-aliases.slang) |
| Negative: the GLSL module is target-conditional; without -allow-glsl, `vec3` is an undefined identifier in Slang source. | negative | [#glsl-module](../../../design/cross-cutting/core-module.md#glsl-module) | [`glsl-vec3-without-allow-glsl.slang`](glsl-vec3-without-allow-glsl.slang) |
| The GLSL module provides `vec3` as an alias for `float3`; using `vec3` in Slang source compiles and lowers to the same per-target spelling as `float3`. | functional | [#glsl-module](../../../design/cross-cutting/core-module.md#glsl-module) | [`glsl-module-vec3-alias.slang`](glsl-module-vec3-alias.slang) |
| Emitted C++ output references the C++ prelude — observe `SLANG_PRELUDE_EXPORT` (defined in slang-cpp-prelude.h) on the entry point. | functional | [#preludes](../../../design/cross-cutting/core-module.md#preludes) | [`cpp-prelude-export-marker.slang`](cpp-prelude-export-marker.slang) |
| Emitted CUDA output references the CUDA prelude — a compute entry point is emitted with `extern "C"` linkage and `__global__` annotation defined by slang-cuda-prelude.h. | functional | [#preludes](../../../design/cross-cutting/core-module.md#preludes) | [`cuda-prelude-extern-c-marker.slang`](cuda-prelude-extern-c-marker.slang) |
| Negative: `import` of a non-existent module name is rejected at the module-loader stage. | negative | [#standard-modules](../../../design/cross-cutting/core-module.md#standard-modules) | [`import-nonexistent-module.slang`](import-nonexistent-module.slang) |
| Negative: the diff meta-module is embedded (implicit) — it is not importable by a `import diff;` filename lookup. | negative | [#standard-modules](../../../design/cross-cutting/core-module.md#standard-modules) | [`import-diff-by-name-fails.slang`](import-diff-by-name-fails.slang) |
| Standard modules (e.g. `neural`) are loaded on demand via `import slang.<name>`; without that import, neural-namespaced names are unresolved. | negative | [#standard-modules](../../../design/cross-cutting/core-module.md#standard-modules) | [`standard-module-neural-not-implicit.slang`](standard-module-neural-not-implicit.slang) |
| Boundary: `float32_t` accepts +infinity (1.0/0.0) and lowers per target without diagnostic. | boundary | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`core-typedef-float32-inf.slang`](core-typedef-float32-inf.slang) |
| Boundary: `float32_t` accepts NaN (0.0/0.0) and lowers per target without diagnostic. | boundary | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`core-typedef-float32-nan.slang`](core-typedef-float32-nan.slang) |
| Boundary: `int32_t` accepts MAX literal 2147483647; lowers per target without overflow diagnostic. | boundary | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`core-typedef-int32-max.slang`](core-typedef-int32-max.slang) |
| Boundary: `uint32_t` accepts MAX literal 0xFFFFFFFFu and lowers per target. | boundary | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`core-typedef-uint32-max.slang`](core-typedef-uint32-max.slang) |
| Boundary: core-module implicit conversion accepts int32_t(MAX) -> float32_t; the cast is preserved in HLSL emit. | boundary | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`conv-int32-max-to-float32.slang`](conv-int32-max-to-float32.slang) |
| Boundary: round-trip float32_t -> half -> float32_t is accepted by the front-end; both cast directions appear in HLSL emit. | boundary | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`conv-half-roundtrip.slang`](conv-half-roundtrip.slang) |
| Core-module typedef `float32_t` resolves and lowers to a 32-bit float spelling on each text-emit backend. | functional | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`core-typedef-float32-resolves.slang`](core-typedef-float32-resolves.slang) |
| Core-module typedef `int32_t` is visible without explicit import and lowers to a 32-bit int on every text-emit backend. | functional | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`core-typedef-int32-resolves.slang`](core-typedef-int32-resolves.slang) |
| Core-module typedef `uint32_t` resolves without explicit import and lowers to an unsigned 32-bit integer across text-emit backends. | functional | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`core-typedef-uint32-resolves.slang`](core-typedef-uint32-resolves.slang) |
| Stress: the core-module `Optional<T>` type composes under nesting (Optional<Optional<Optional<int>>>). | stress | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`optional-deep-nesting-stress.slang`](optional-deep-nesting-stress.slang) |
| The core module declares the scalar/vector/matrix type vocabulary; `float3` and `float3x3` are usable without import and lower per target. | functional | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`core-vector-matrix-types-lower.slang`](core-vector-matrix-types-lower.slang) |
| The core module exposes `Optional<T>`; user code can declare and use `Optional<int>` without an explicit import. | functional | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`core-optional-type-usable.slang`](core-optional-type-usable.slang) |
| The core module's `float64_t` typedef resolves and lowers to a 64-bit float spelling on HLSL (`double`) and CUDA (`double`). | functional | [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | [`core-typedef-float64-resolves.slang`](core-typedef-float64-resolves.slang) |


## Untested claims
| Claim | Reason | Anchor | Why untested |
| --- | --- | --- | --- |
| DXIL / metallib / WGSL→SPIRV downstream paths and Torch / LLVM / Slang round-trip targets. | out-of-bundle | (unspecified) | The core-module doc routes these to the relevant `target-pipelines/*` bundles. |
| The byte-for-byte embedded module artefact (a build product). | (unclassified) | (unspecified) | Reason and explanation to be refined by the next regeneration. |
| The `slang-standard-module-config.h.in` template machinery (internal build infrastructure). | (unclassified) | (unspecified) | Reason and explanation to be refined by the next regeneration. |
| The full intrinsic list (the doc explicitly disclaims enumerating it). | (unclassified) | (unspecified) | Reason and explanation to be refined by the next regeneration. |
| **Atomic-op intrinsics** (e.g. `InterlockedAdd`, `atomicAdd`, `OpAtomicIAdd`) — target-specific spellings, and prior agentic attempts have wasted iterations on them; skipped entirely. | (unclassified) | [#interlockedadd](../../../design/cross-cutting/core-module.md#interlockedadd) | Reason and explanation to be refined by the next regeneration. |
| The `SLANG_EMBED_CORE_MODULE` ON vs. OFF build option — affects how the compiler ships the module, not what user code sees. | (unclassified) | [#slangembedcoremodule](../../../design/cross-cutting/core-module.md#slangembedcoremodule) | Reason and explanation to be refined by the next regeneration. |
| The "Adding a new built-in" developer workflow (not a user- observable behaviour). | process-doc | [#adding-a-new-built-in](../../../design/cross-cutting/core-module.md#adding-a-new-built-in) | Contributor walkthrough / process documentation, not a compiler behavior. |


## Doc gaps observed
| Anchor | Kind | Gap | Suggested addition |
| --- | --- | --- | --- |
| [#core-module](../../../design/cross-cutting/core-module.md#core-module) | undocumented-behavior | `#core-module` lists `__intrinsic_op` and `__target_intrinsic` as the modifier vocabulary mapping core-module declarations onto IR and per-target spellings, but the per-target spelling table for any specific intrinsic (e.g. `dot`, `length`, `mul`) is not enumerated in `cross-cutting/core-module.md` itself — tests had to discover SPIR-V spellings (`OpDot`, `Length`, `OpVectorTimesMatrix`) by inspection. |  |
| [#glsl-module](../../../design/cross-cutting/core-module.md#glsl-module) | undocumented-behavior | `#glsl-module` says the GLSL module is "target-conditional ... when the user is compiling GLSL or asks for GLSL-flavoured names from Slang code" but does not name the user-facing flag (`-allow-glsl`) that enables the second mode from Slang source. |  |
| [#standard-modules](../../../design/cross-cutting/core-module.md#standard-modules) | undocumented-behavior | `#standard-modules` describes the on-demand `import slang.<name>` mechanism but does not describe what happens when a standard- module-namespaced name is referenced without the import — i.e. the doc does not state the negative case used by `standard-module-neural-not-implicit.slang`. |  |
| [#preludes](../../../design/cross-cutting/core-module.md#preludes) | undocumented-behavior | `#preludes` lists prelude headers by file name but does not describe which symbols from each prelude appear in emitted output. Tests had to find observable markers (`SLANG_PRELUDE_EXPORT`, `extern "C" __global__`) by inspection. |  |
| [#what-the-core-module-provides](../../../design/cross-cutting/core-module.md#what-the-core-module-provides) | undocumented-behavior | `#what-the-core-module-provides` lists `Optional`, `Result`, `Tuple` but does not describe their public API (`hasValue` property, `value` property, `none` literal). |  |
| [#float16t](../../../design/cross-cutting/core-module.md#float16t) | undocumented-behavior | 16-bit float support (`float16_t` / `half`) is mentioned in the doc's typedef list but its per-target capability requirements (e.g. HLSL `-profile sm_6_2`, SPIR-V `Float16` capability) are not documented; we therefore skip a `float16_t` lowering test rather than guess at the right flag set. |  |
| [#dot](../../../design/cross-cutting/core-module.md#dot) | undocumented-behavior | The doc lists `dot`, `length`, `mul` (and by inference `normalize`) as HLSL-meta-module intrinsics but does not name the documented behaviour of these intrinsics at numeric edges (zero-vector, infinity, NaN) — boundary tests therefore assert only front-end acceptance and emit preservation, not specific per-target runtime values. |  |
| [#hlsl-meta-module-exposes-intrinsics](../../../design/cross-cutting/core-module.md#hlsl-meta-module-exposes-intrinsics) | undocumented-behavior | The doc does not state the per-target spelling of `printf` format conversions (`%d`, `%f` at MIN/MAX/inf/NaN) or whether `slangi` shares the host's libc formatting; boundary printf tests cite the doc's general "HLSL meta-module exposes ... intrinsics" wording and assert string-match on the interpreter output observed today. |  |
| [#target-conditional](../../../design/cross-cutting/core-module.md#target-conditional) | undocumented-behavior | The doc identifies the GLSL module as "target-conditional" but does not enumerate the GLSL-flavoured arithmetic helpers (`min`, `max`, `clamp`, etc.) that the module re-exports — our `glsl-min-max-clamp-aliases` test had to discover their availability empirically. |  |
| (unspecified) | undocumented-behavior | The doc does not state that the diff meta-module is non- importable by `import diff;` from user code — our negative `import-diff-by-name-fails` test had to discover the loader-search-path behaviour empirically. |  |
| [#core-module](../../../design/cross-cutting/core-module.md#core-module) | undocumented-behavior | `#core-module` lists `Texture2D` and `RWTexture2D` as the representative HLSL-named resource types but does not enumerate the full set of texture variants the HLSL meta-module surfaces (`Texture1D`, `Texture3D`, `TextureCube`, `Texture2DArray`, `TextureCubeArray`, `Texture2DMS`, `RWTexture1D`, `RWTexture3D`, `SamplerComparisonState`). Texture-variant expansion tests had to discover the per-target lowering (1D / 3D / Cube image dimensionality, multisampled image marker, Dref opcodes for shadow samplers) from emit inspection rather than from a doc table. |  |
| [#core-module](../../../design/cross-cutting/core-module.md#core-module) | undocumented-behavior | `#core-module` does not enumerate which sampling operations (`Sample`, `SampleLevel`, `SampleGrad`, `Load`, `GatherRed`, `SampleCmp`, `SampleCmpLevelZero`) are available on which texture variant, nor the per-variant coordinate shapes (e.g. `Texture3D.Load` takes `int4`, `Texture1D.Load` takes `int2`, `Texture2DMS.Load` takes `(int2, sampleIdx)`). These signatures were determined empirically from compiler errors. |  |
| [#core-module](../../../design/cross-cutting/core-module.md#core-module) | undocumented-behavior | `#core-module` does not name which texel-format generics (`float4` / `int4` / `uint4` / `unorm` / `snorm`) are valid on each texture variant, nor describe the per-target sampler-type flavouring (e.g. GLSL `utexture3D` for `uint4` content, `image1D` vs `uimage1D` for the RW variants). Format-variant tests probe only `float4` and `uint4` and leave the `unorm`/`snorm` admission status as a doc gap. |  |
