KhronosGroup / KhronosGroup/OpenCL-CTS

add tests for multiple SPIR-V OpSpecConstant instructions with the same SpecId

Open
#2,546 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
232
Forks
235
Avg merge
8d 7h
Merged PRs (30d)
18

Description

See: https://github.com/KhronosGroup/SPIRV-Registry/issues/357

We should add tests to ensure implementations properly handle cases when multiple OpSpecConstant instructions are decorated with the same SpecId.

Rough test plan:

* Top Priority: Tests for multiple OpSpecConstant instructions:
* [ ] Test multiple OpSpecConstant instructions with the same default value without specialization.
* [ ] Test multiple OpSpecConstant instructions with the same default value with specialization.
* [ ] Test multiple OpSpecConstant instructions with different default values without specialization.
* [ ] Test multiple OpSpecConstant instructions with different default values with specialization.
* Additional tests for multiple OpSpecConstant instructions:
* [ ] Test multiple OpSpecConstant instructions with different types (but the same size) and different default values without specialization.
* [ ] Test multiple OpSpecConstant instructions with different types (but the same size) and different default values with specialization.
* Probably not? Test multiple OpSpecConstant instructions with different types and different sizes. These cases are unable to be specialized, since [clSetProgramSpecializationConstant](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#clSetProgramSpecializationConstant) requires the passed-in `spec_size` to match the size of the specialization constant in the SPIR-V module.
* Tests for boolean OpSpecConstantTrue / OpSpecConstantFalse instructions:
* [ ] Test multiple OpSpecConstantTrue instructions without specialization.
* [ ] Test mixed OpSpecConstantTrue and OpSpecConstantFalse instructions without specialization.
* [ ] Test mixed OpSpecConstantTrue and OpSpecConstantFalse instructions with specialization.
* Additional tests for mixed instructions:
* [ ] Test OpSpecConstant and OpSpecConstantNull without specialization.
* [ ] Test OpSpecConstant and OpSpecConstantNull with specialization.
* [ ] Test OpSpecConstant and either OpSpecConstantTrue or OpSpecConstantFalse without specialization.
* [ ] Test OpSpecConstant and either OpSpecConstantTrue or OpSpecConstantFalse with specialization.
* [ ] Test OpConstantNull and either OpSpecConstantTrue or OpSpecConstantFalse without specialization.
* [ ] Test OpConstantNull and either OpSpecConstantTrue or OpSpecConstantFalse with specialization.

The tests deemed "top priority" are those that I believe are most likely to occur in the wild and are therefore those that I believe we should implement first. The others cover corner cases and could be implemented at a later date, if desired.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or existing test entry points are named. Start with the linked SPIR-V Registry issue and the top-priority checklist, then locate the OpenCL-CTS tests covering specialization constants and follow their conventions; done means covering the listed same-SpecId cases with and without specialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.