Skip to content

Execution Tests: Update datasets for rhs values for shift operations - #8179

Merged
Alex Sepkowski (alsepkow) merged 2 commits into
microsoft:mainfrom
alsepkow:user/alsepkow/FixBitShifts
Feb 20, 2026
Merged

Alex Sepkowski (alsepkow) merged 2 commits into
microsoft:mainfrom
alsepkow:user/alsepkow/FixBitShifts

Conversation

@alsepkow

Copy link
Copy Markdown
Contributor

Assisted by gh copilot.

Fix BitShiftRhs test input sets to avoid shift amounts >= bit width, which is undefined behavior in C++ and can cause test failures as expected values are computed via C++.

@tex3d Tex Riddell (tex3d) 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.

Technically, it's defined in HLSL to shift by larger values because it masks the shift value to the lower bits (5 bits for 32-bit shift), effectively making it wrap. It does seem like the test's reference computation should be modified to match the specified HLSL behavior in this way. Testing out-of-range values may seem like it's technically unnecessary for testing HW implementation since the mask is generated explicitly by the compiler, however this is a pattern we expect some drivers to match and remove the explicit masking if the GPU instruction is only expected to use the lower bits anyway, so it would still be good to make sure it is behaving as expected with larger values.

@jenatali

Copy link
Copy Markdown
Member

Yep, +1 to Tex's feedback, my suggestion wasn't to remove the out-of-range values, just to make the CPU-side validation not violate the C++ spec.

@alsepkow
Alex Sepkowski (alsepkow) merged commit 435dbb6 into microsoft:main Feb 20, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Feb 20, 2026
Lucie Choi (luciechoi) pushed a commit to luciechoi/DirectXShaderCompiler that referenced this pull request Feb 20, 2026
…icrosoft#8179)

Assisted by gh copilot.

Fix BitShiftRhs test input sets to avoid shift amounts >= bit width,
which is undefined behavior in C++ and can cause test failures as
expected values are computed via C++.
Alex Sepkowski (alsepkow) added a commit to alsepkow/DirectXShaderCompiler that referenced this pull request Mar 2, 2026
…icrosoft#8179)

Assisted by gh copilot.

Fix BitShiftRhs test input sets to avoid shift amounts >= bit width,
which is undefined behavior in C++ and can cause test failures as
expected values are computed via C++.
Alex Sepkowski (alsepkow) added a commit that referenced this pull request Mar 5, 2026
… values for shift operations (#8216)

Cherry-pick PR (#8179)

Assisted by gh copilot.

SHA
[435dbb6](435dbb6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants