KhronosGroup / KhronosGroup/SPIRV-Tools

spirv-fuzz: Improve FuzzerPassObfuscateConstants to ignore types and to use synonyms

Open
#3,688 0 comments 0 reactions 0 assignees View on GitHub
component:fuzzer
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

FactManager::ConstantUniformFacts::GetUniformDescriptorsForConstant could be improved to ignore type ids; FuzzerPassObfuscateConstants could then add bitcasts as needed, replace signed int with unsigned int (and vice-versa), etc.

FuzzerPassObfuscateConstants::Apply can probably use ForEachInstructionWithInstructionDescriptor.

FuzzerPassObfuscateConstants::Apply need not only consider constants (it could include ids that are synonymous with constants), although perhaps this is fine.

The transformations used (e.g. TransformationReplaceBooleanConstantWithConstantBinary) should instead add a synonym. And then the fuzzer pass should apply TransformationReplaceIdWithSynonym. This is what we do in FuzzerPassInterchangeSignednessOfIntegerOperands.

Contributor guide

Open the contributing guide

Research direction

Start with FactManager::ConstantUniformFacts::GetUniformDescriptorsForConstant and FuzzerPassObfuscateConstants::Apply, then compare the synonym flow in FuzzerPassInterchangeSignednessOfIntegerOperands. Done means the obfuscation pass can ignore type IDs, add needed bitcasts, consider synonymous constants, and use TransformationReplaceIdWithSynonym while the named transformations add synonyms.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.