Skip to content

[HLSL] Test vector accumulation bounds and exact I32 contention - #8921

Merged
Jack Elliott (JoeCitizen) merged 1 commit into
microsoft:mainfrom
JoeCitizen:linalg-hlk-submit-vector-integrity
Sep 21, 2026
Merged

Jack Elliott (JoeCitizen) merged 1 commit into
microsoft:mainfrom
JoeCitizen:linalg-hlk-submit-vector-integrity

Conversation

@JoeCitizen

@JoeCitizen Jack Elliott (JoeCitizen) commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Add bounded F16/F32 vector-accumulation tests with seeded results and typed guards, plus exact signed-I32 contention coverage using 256 distinct vectors.

Refs #7841.

Assisted-by: GitHub Copilot

Add an opt-in bounded raw UAV descriptor table to the existing vector
accumulation runner. Preserve its fully initialised root-SRV source and
all existing root-UAV cases. Check actual 64-byte destination alignment.

Exercise F16 and F32 with a view containing the complete vector but not
its guards, a view containing four of eight elements, and a view ending
at the vector start. Independently specified seeded results distinguish
accumulation from store, missing in-view updates, widened bounds and
outside writes. Only a partially viewed input vector admits either the
per-element result or a whole-operation no-op; the larger guarded
destination does not itself make the vector OOB. Typed guards belong to
the exact element comparison, while the byte oracle checks the prologue.

Add signed I32 contention using native int32_t data and the existing
four-component base-four dispatch-ID pattern. Across 256 invocations,
each digit contributes 384. Base {3,-7,11,-13} and seed
{101,-203,307,-409} yield {1253,-1611,3507,-3353}; all partial sums are
in range. Every invocation contributes a distinct whole vector, so one
unequal-vector drop/replay pair cannot cancel component-wise. This does
not claim detection of arbitrary cancelling combinations or rely on a
scalar-total check.

Fresh baseline and candidate use identical compiler/validator binaries
built from ef47f5a. All 91 existing per-test outcomes are unchanged.
Both bounded vector tests pass on preview WARP. The new I32 case
legitimately skips: SInt32 reports UAV=0. Its exact shader compiles and
validates as v4i32, but supported hardware and runtime-oracle non-vacuity
remain unproved. Existing baseline failures are not changed.

Local feature checkpoint before negative controls. This AI-assisted
engineering rationale and implementation await human review; publication
is not authorised.

Assisted-by: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
@JoeCitizen
Jack Elliott (JoeCitizen) marked this pull request as ready for review September 14, 2026 20:23
Copilot AI balanced review requested due to automatic review settings September 14, 2026 20:23

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.

🟡 Changes recommended

Newly added fixture declarations violate the repository’s explicit-type convention.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds execution coverage for bounded vector accumulation and exact signed-I32 contention.

Changes:

  • Tests F16/F32 in-bounds, partial-OOB, and full-OOB accumulation.
  • Tests 256-way signed-I32 contention with guard validation.
  • Supports bounded UAV descriptor views and alignment checks.
File summaries
File Description
tools/clang/unittests/HLSLExec/LinAlgTests.cpp Extends vector-accumulation helpers and execution tests.
Review details

Suppressed comments (1)

tools/clang/unittests/HLSLExec/LinAlgTests.cpp:9667

  • These three new fixture declarations also use auto for the simple std::optional<cpu_oracle::TypedMatrix> return type, contrary to the repository's explicit-type convention and the neighboring vector tests at LinAlgTests.cpp:9634-9641. Please spell out the type.
  const auto Input =
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 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

@bob80905 Joshua Batista (bob80905) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTMUE

@JoeCitizen
Jack Elliott (JoeCitizen) merged commit 128aa0e into microsoft:main Sep 21, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Sep 21, 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