Skip to content

Execution Tests: Fix bugs in LoadAndStoreOps#7856

Merged
alsepkow merged 9 commits into
microsoft:mainfrom
alsepkow:user/alsepkow/StructuredBufferFix
Nov 3, 2025
Merged

Execution Tests: Fix bugs in LoadAndStoreOps#7856
alsepkow merged 9 commits into
microsoft:mainfrom
alsepkow:user/alsepkow/StructuredBufferFix

Conversation

@alsepkow
Copy link
Copy Markdown
Contributor

This PR fixes three issues in the LoadAndStoreOp tests:

Buffer sizing for odd-sized vectors: Previously, stride and resource width calculations could misalign, causing runtime errors.

Descriptor correctness for StructuredBuffers: Formats, flags, and the StructuredByteStride were not consistently set. WARP tolerated this but some IHVs reported issues as their drivers are stricter about this.

Some of the StructuredBuffer tests were hitting the runtime size limit of 2048 bytes for StructuredBuffers. I updated the logic around InputVectorSizes to account for this.

These changes ensure proper alignment, descriptor initialization, and resource sizing across all of the test cases.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 29, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

Comment thread tools/clang/unittests/HLSLExec/LongVectors.cpp Outdated
Comment thread tools/clang/unittests/HLSLExec/LongVectors.cpp Outdated
Comment thread tools/clang/unittests/HLSLExec/LongVectors.cpp Outdated
@alsepkow alsepkow force-pushed the user/alsepkow/StructuredBufferFix branch from 2818e2a to 54d31d7 Compare October 29, 2025 04:10
@alsepkow
Copy link
Copy Markdown
Contributor Author

Rebased to pick up fixes for asuint tests

Copy link
Copy Markdown
Member

@damyanp damyanp left a comment

Choose a reason for hiding this comment

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

LGTM

Unfortunately, the force-push made it difficult to see what changed since my last review :( When things are in review it's better to merge than to rebase.

// StructuredBuffers are capped at 2048 bytes.
MaxInputSize = 2048 / sizeof(T);

if (InputVectorSizes.back() < MaxInputSize)
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.

I guess this avoids duplicating a test of the maximum input size, but what happens if InputVectorSizes.back() > MaxInputSize? Is that really something we want to test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Won't ever hit now. But its a fair point to keep this framework robust to future test cases that might test some larger user defined type.

I'll update it.

Copy link
Copy Markdown
Collaborator

@bob80905 bob80905 left a comment

Choose a reason for hiding this comment

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

LGTMUE

@alsepkow alsepkow merged commit fa3fe95 into microsoft:main Nov 3, 2025
12 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Nov 3, 2025
@alsepkow alsepkow deleted the user/alsepkow/StructuredBufferFix branch January 31, 2026 01:46
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