Skip to content

[HLSL] Convert the LinAlg descriptor I/O runner to the typed CPU oracle - #8752

Merged
Jack Elliott (JoeCitizen) merged 1 commit into
microsoft:mainfrom
JoeCitizen:linalg-hlk-descriptor-io-runner
Aug 11, 2026
Merged

[HLSL] Convert the LinAlg descriptor I/O runner to the typed CPU oracle#8752
Jack Elliott (JoeCitizen) merged 1 commit into
microsoft:mainfrom
JoeCitizen:linalg-hlk-descriptor-io-runner

Conversation

@JoeCitizen

@JoeCitizen Jack Elliott (JoeCitizen) commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

runLoadStoreDescriptor used the untyped packed-buffer helpers, which can only
describe a matrix at offset zero with a packed stride, and carried a TODO to
vary those. This moves it to the layout-aware oracle path, matching
runCopyConvert.

Load and store layouts are separate parameters: with one shared layout the round
trip cannot detect a consistently applied addressing error, since the load reads
Input[f(i)] and the store writes Output[f(i)].

No behaviour change. The one caller still passes a packed layout on both sides
and owns every byte of its buffer, so the new padding check only proves the
wiring; the next change adds the cases that exercise it.

Assisted-by: GitHub Copilot

Copilot AI balanced review requested due to automatic review settings August 10, 2026 18:47

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

Converts descriptor load/store testing to the layout-aware typed CPU oracle.

Changes:

  • Supports independent load and store layouts.
  • Seeds and verifies untouched destination bytes.
  • Preserves the existing packed-layout test behavior.

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

Comment thread tools/clang/unittests/HLSLExec/LinAlgTests.cpp Outdated
Comment thread tools/clang/unittests/HLSLExec/LinAlgTests.cpp Outdated
Copilot AI review requested due to automatic review settings August 10, 2026 20:03
@JoeCitizen
Jack Elliott (JoeCitizen) force-pushed the linalg-hlk-descriptor-io-runner branch from edf363a to 28eee76 Compare August 10, 2026 20:03

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 1 out of 1 changed files in this pull request and generated no new comments.

@damyanp Damyan Pepper (damyanp) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving, but I think that the PoisonSeed stuff is unnecessarily complicated and confusing.

Comment thread tools/clang/unittests/HLSLExec/LinAlgTests.cpp Outdated
runLoadStoreDescriptor predated the typed CPU oracle and used the untyped
packed-buffer helpers, which can only describe a matrix that starts at offset
zero and has a tightly packed stride. It carried a standing TODO to vary those.
This converts it to the layout-aware oracle path, matching runCopyConvert, so a
caller can describe where in the buffer the matrix actually sits.

The load and store layouts are separate parameters rather than one shared
layout. With a single layout the round trip cannot detect an addressing error
the implementation applies consistently: the load reads Input[f(i)] and the
store writes Output[f(i)], so for any bijective f the result is byte-identical
to a correctly encoded buffer. Varying only the offset or only the stride does
not help either, because the same f appears on both sides and cancels. Being
able to load one layout and store another is what makes a layout the
implementation did not honour observable.

The destination is now seeded with a poison pattern and checked with
verifyUntouchedBytes, so a store that places its elements correctly but also
writes over the offset prologue or the inter-row padding is caught rather than
silently accepted.

The poison seed is a single file-scope constant instead of a value threaded
through the helpers as a parameter. Every call site already passed the same
constant, so the parameter advertised a generality no test used, and the
parameters shared its name closely enough to shadow it.

No behaviour change. LoadStoreDescriptor_Wave_16x16_F16 is still the only
caller and still passes the same layout on both sides, which is the packed
offset-zero case it always used. Being packed, it owns every byte of its
buffer, so the new padding check is satisfied trivially and only proves the
wiring; a following change adds the cases that give it something to find.

Validated on WARP: 28 total, 23 passed, the same 4 pre-existing failures and 1
skip as before, so no existing outcome changed.

Assisted-by: GitHub Copilot

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
Copilot AI review requested due to automatic review settings August 10, 2026 21:26
@JoeCitizen
Jack Elliott (JoeCitizen) force-pushed the linalg-hlk-descriptor-io-runner branch from 28eee76 to 96bef77 Compare August 10, 2026 21:26

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 1 out of 1 changed files in this pull request and generated no new comments.

@JoeCitizen
Jack Elliott (JoeCitizen) merged commit 0dd8045 into microsoft:main Aug 11, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants