KhronosGroup / KhronosGroup/SPIRV-Tools
spirv-diff should test that merely permuting ids never produces a diff
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 709
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 28
Description
If two SPIR-V programs have identical instructions streams except for some reversible substitution of ids, it seems like it should be possible for `spirv-diff` to always recognize them as identical. One reason #5218 wasn't caught before is that many of the test programs have `%2 = OpTypeVoid`, so comparing src and dst ids without applying the mapping just happened to produce matches anyway.
It would be pretty easy to catch mistakes like this by taking every `.spvasm` file in `test/diff/diff_files`, permuting its ids, and checking that `Differ` reports no changes.
Contributor guide
Research direction
Start by inspecting the .spvasm files in test/diff/diff_files and the existing Differ tests or entry points. Permute each file's IDs, compare the original and permuted programs with Differ, and verify that no changes are reported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100