microsoft / microsoft/DirectXShaderCompiler

[HLK] Add missing tests for `countbits`

Open
#7,499 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

hlk-gap
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Currently we have defined tests for the 32-bit version of countbits, however, there is a gap for the 16-bit and 64-bit versions.

https://github.com/microsoft/DirectXShaderCompiler/blob/66287b27442d0af17a152d024a6deaadb075cd30/tools/clang/unittests/HLSLExec/ShaderOpArithTable.xml#L2609

This issue tracks the addition of these HLK tests to ensure that behaviour.

Note:

For some additional context, it was observed that the 16-bit version was inconsistent across GPU's when tested locally.

For NV we observed that when the input StructuredBuffer was of type int16_t2 or int16_t4, the output was incorrect.
For WARP we observed that when the input StructuredBuffer was of type int16_t3, the output was incorrect.

Please also see here: https://github.com/llvm/offload-test-suite/pull/205.

AC:

  • Add HLK test for 16-bit countbits
  • Add HLK test for 64-bit countbits

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at tools/clang/unittests/HLSLExec/ShaderOpArithTable.xml around line 2609 and review the existing 32-bit countbits tests. Add HLK coverage for the 16-bit and 64-bit versions, using the issue’s StructuredBuffer observations and the linked offload-test-suite pull request for context. Done means both acceptance-criteria tests are present.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, testing-qa
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.