Skip to content

[HLSL] Add LinAlg element boundary coverage#8668

Draft
JoeCitizen wants to merge 9 commits into
microsoft:mainfrom
JoeCitizen:linalg-hlk-element-access-boundaries
Draft

[HLSL] Add LinAlg element boundary coverage#8668
JoeCitizen wants to merge 9 commits into
microsoft:mainfrom
JoeCitizen:linalg-hlk-element-access-boundaries

Conversation

@JoeCitizen

@JoeCitizen JoeCitizen commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace the shared element-access output with per-thread Length, GetCoordinate, and GetElement records, avoiding UAV races when multiple threads map to one component
  • retain the mandatory 16x16 F16 element-access and Set baselines, and add capability-gated rectangular 4x8 F32 coverage
  • add the specified boundary cases: Get(Length()) returns zero and Set(Length(), value) leaves the matrix unchanged
  • seed OOB-Get values and execution markers with non-zero sentinels, then require every lane in the selected first wave to execute and write the specified zero result
  • select a supported MatrixConstruction wave size and compile each optional F32 shader at that exact size; mandatory legacy cases retain their ranged WaveSize

Expected matrix values come from the typed CPU oracle. The host validates every reported coordinate/value pair, requires the summed thread-local lengths to cover the matrix, verifies exact unchanged-matrix results for Set OOB, and prevents untouched zero-initialized UAV data from satisfying Get OOB.

Validation

  • built the Release ExecHLSLTests target
  • passed the existing ElementAccess_Wave_16x16_F16 and ElementSet_Wave_16x16_F16 methods
  • passed ElementAccess_Wave_4x8_F32, ElementGetOOB_Wave_4x8_F32, and ElementSetOOB_Wave_4x8_F32 on WARP with D3D12 Agility SDK 1.721.2-preview and ExperimentalShaders=*
  • all three optional methods selected wave 4 and compiled with FORCED_WAVE_SIZE=4; the corrected Get OOB test observed exactly four executing lanes
  • passed the capability-policy and typed-oracle host tests plus all three CopyConvert regressions
  • propagated the correction through the stacked descendants; the complete 66-method LinAlg selection remained 61 passed, 0 failed and 5 capability-backed skips
  • clang-format 17.0.1, git diff --check, and focused correctness review pass

No physical GPU or HLK lab execution is claimed.

Stack

This draft is stacked on PR #8667, which is stacked on PR #8666, PR #8665, and PR #8662. Until those ancestors land, this diff contains their commits as well. The element-boundary commits are 2dc434497 and review correction 49a726cd0.

This is intentionally a draft for named human review. The reviewer should reproduce the OOB rules from proposal 0035, inspect the per-thread record and sentinel oracles, and confirm the capability-gated exact-wave policy before requesting maintainer review.

Refs #7841
Refs #8648
Refs #8549
Refs #8550
Refs #8551
Refs #8552

Assisted-by: GitHub Copilot

Jack Elliott and others added 3 commits July 23, 2026 14:52
Use the shared MatrixUse parameter for the OuterProduct result and set it to Accumulator, matching proposal 0035 and the public dx::linalg API. Add a host-side invariant to prevent the legacy A-use declaration from returning.

Assisted-by: GitHub Copilot

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

Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
Create SRV buffers without UAV flags and transition them for both pixel and non-pixel shader access. Use a direct resource-initialization list so the graphics-only pixel state is legal.

Assisted-by: GitHub Copilot

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
Add typed F16, F32, I32, and U32 matrix data with safe byte encoding, rectangular row/column-major storage mapping, and explicit exact, permitted-result, or excluded comparison policy. Cover offsets and padded strides with independent host goldens, and migrate the existing CopyConvert tests onto the oracle.

Assisted-by: GitHub Copilot

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
Jack Elliott and others added 3 commits July 25, 2026 12:59
Handle packed row or column byte-count overflow before using the result, and include raw F32 bits in exact mismatch diagnostics. Cover adjacent float bit patterns in the host oracle test.

Assisted-by: GitHub Copilot

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

Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
Add ABI-checked wrappers for the six D3D12 Linear Algebra capability
query categories and explicit applicability classification. Gate the
rectangular F32 CopyConvert case using concrete supported wave sizes.

Assisted-by: GitHub Copilot

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
Compile capability-gated CopyConvert coverage at the exact wave size whose MatrixConstruction support was queried. Keep mandatory baseline cases on the existing ranged WaveSize attribute.

Assisted-by: GitHub Copilot

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

Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
@JoeCitizen
JoeCitizen force-pushed the linalg-hlk-element-access-boundaries branch from bf8b650 to 786820c Compare July 25, 2026 01:03
Jack Elliott added 2 commits July 25, 2026 14:10
Validate multiplication support flags per operation, exhaustively check the preview D3D12 ABI mirrors, and preserve query-backed optional skips in HLK mode.

Assisted-by: GitHub Copilot

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

Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
Add rectangular Length/GetCoordinate/GetElement coverage and the specified Get/Set out-of-bounds behaviour. Capture thread-local matrix records without UAV races and gate optional F32 cases at the exact queried wave size.

Assisted-by: GitHub Copilot

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

Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
@JoeCitizen
JoeCitizen force-pushed the linalg-hlk-element-access-boundaries branch from 786820c to 2dc4344 Compare July 25, 2026 02:27
Seed OOB Get outputs with non-zero sentinels and require every lane in the selected wave to execute and write the specified zero result.

Assisted-by: GitHub Copilot

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

Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
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.

1 participant