Skip to content

Conversation

@alsepkow
Copy link
Contributor

This PR fixes an off by 1 error when filling the expected output vector for WaveActiveAllEqual tests.

Comment on lines 1374 to 1378
std::vector<HLSLBool_t> Expected;
const size_t VectorSize = Inputs[0].size();
Expected.assign(VectorSize - 1, static_cast<HLSLBool_t>(true));
Expected.assign(VectorSize, static_cast<HLSLBool_t>(true));
// We set the last element to a different value on a single lane.
Expected[VectorSize - 1] = static_cast<HLSLBool_t>(false);
Copy link
Member

Choose a reason for hiding this comment

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

Code golf:

std::vector<HLSLBool_t> Expected(Inputs[0].size() - 1, static_cast<HLSLBool_t>(true));
Expected.push_back(static_cast<HLSLBool_t>(false));
std::vector<HLSLBool_t> Expected(Inputs[0].size(), static_cast<HLSLBool_t>(true));
Expected.back() = static_cast<HLSLBool_t>(false);

@damyanp
Copy link
Member

damyanp commented Nov 20, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@alsepkow alsepkow merged commit 833f91f into microsoft:main Nov 21, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Nov 21, 2025
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.

2 participants