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

Open
#2,546 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

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.

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 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.

Dominant language
C++
Stars
234
Forks
240
Avg merge
6d 12h
Merged PRs (30d)
15

Getting set up

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.

More from KhronosGroup/OpenCL-CTS

All issues in KhronosGroup/OpenCL-CTS

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.