Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spirv-fuzz: Improve code coverage of tests #3686

Merged
merged 3 commits into from
Aug 14, 2020

Conversation

antonikarp
Copy link
Collaborator

I have significantly improved code coverage in tests for my transformations:

  1. TransformationAddRelaxedDecoration
  2. TransformationReplaceCopyMemoryWithLoadStore
  3. TransformationReplaceCopyObjectWithStoreLoad
  4. TransformationReplaceLoadStoreWithCopyMemory
  5. TransformationReplaceAddSubMulWithCarryingExtended

@antonikarp antonikarp changed the title spirv-fuzz: Improved code coverage. spirv-fuzz: Improved code coverage in tests. Aug 11, 2020
Copy link
Collaborator

@andreperezmaselco andreperezmaselco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvements, @antnkarp!
I just made a suggestion.

Comment on lines 111 to 115
// Invalid: initializer_id=15 is invalid.
auto transformation_invalid_5 = TransformationReplaceCopyObjectWithStoreLoad(
27, 30, SpvStorageClassPrivate, 15);
27, 30, SpvStorageClassFunction, 15);
ASSERT_FALSE(transformation_invalid_5.IsApplicable(context.get(),
transformation_context));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you recall what coverage this added? I just worry that this assert is supposed to cover a return statement because of id 15, so what coverage does this change add? I guess it maybe covers the right-hand side of a || operator?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This triggers the condition copy_object_instruction->type_id() != constant_inst->type_id()
See line 74 in transformation_replace_copy_object_with_store_load.cpp

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. Could you change the comment to say something like:

initializer_id=15 has the wrong type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@paulthomson paulthomson changed the title spirv-fuzz: Improved code coverage in tests. spirv-fuzz: Improve code coverage of tests Aug 14, 2020
@paulthomson paulthomson merged commit c20995e into KhronosGroup:master Aug 14, 2020
dnovillo pushed a commit to dnovillo/SPIRV-Tools that referenced this pull request Aug 19, 2020
Improves the code coverage of tests for the following transformations:

1. TransformationAddRelaxedDecoration
2. TransformationReplaceCopyMemoryWithLoadStore
3. TransformationReplaceCopyObjectWithStoreLoad
4. TransformationReplaceLoadStoreWithCopyMemory
5. TransformationReplaceAddSubMulWithCarryingExtended
dneto0 pushed a commit to dneto0/SPIRV-Tools that referenced this pull request Sep 14, 2024
Roll third_party/glslang/ b60e067..f257e0e (11 commits)

KhronosGroup/glslang@b60e067...f257e0e

$ git log b60e067..f257e0e --date=short --no-merges --format='%ad %ae %s'
2020-08-14 john Build: fix a build warning
2020-08-14 rafael.fariasmarinheiro Use --test-root to pass files to Bazel tests.
2020-08-14 john Fix KhronosGroup#2366, fix KhronosGroup#2358, correctly separate out numerical feature checking
2020-08-14 john Non-functional (almost): Refactor when 'extensionRequested' is called.
2020-08-14 john Non-functional: Remove reinventing the scalar type, note code issues
2020-08-11 john Non-functional: spellings of "destinaton" and "addPairConversion"
2020-08-12 alanbaker Update test expectations
2020-08-12 alanbaker Update SPIRV-Tools and SPIRV-Headers known good
2020-08-10 ezdiy GLSLANG_EXPORT for C APIs.
2020-08-07 john Non-functional: correctly do GL_EXT_buffer_reference2 semantic checking
2020-08-06 john Non-functional: consistently use 'const TSourceLoc&' to pass location.

Created with:
  roll-dep third_party/glslang

Roll third_party/googletest/ 3af06fe16..adeef1929 (4 commits)

google/googletest@3af06fe...adeef19

$ git log 3af06fe16..adeef1929 --date=short --no-merges --format='%ad %ae %s'
2020-08-12 krzysio Googletest export
2020-08-11 absl-team Googletest export
2020-08-11 dmauro Googletest export
2020-08-10 absl-team Googletest export

Created with:
  roll-dep third_party/googletest

Roll third_party/spirv-cross/ 82d1c43e4..4c7944bb4 (1 commit)

KhronosGroup/SPIRV-Cross@82d1c43...4c7944b

$ git log 82d1c43e4..4c7944bb4 --date=short --no-merges --format='%ad %ae %s'
2020-08-13 lehoangq Fix KhronosGroup#1445: MSL: Enclose args when convert distance(a,b) to abs(a-b)

Created with:
  roll-dep third_party/spirv-cross

Roll third_party/spirv-tools/ 2990a21..b8de4f5 (19 commits)

KhronosGroup/SPIRV-Tools@2990a21...b8de4f5

$ git log 2990a21..b8de4f5 --date=short --no-merges --format='%ad %ae %s'
2020-08-16 jaebaek Allow DebugTypeTemplate for Type operand (KhronosGroup#3702)
2020-08-14 antonikarp spirv-fuzz: Improve code coverage of tests (KhronosGroup#3686)
2020-08-14 stefanomil spirv-fuzz: Fuzzer pass to randomly apply loop preheaders (KhronosGroup#3668)
2020-08-14 vasniktel spirv-fuzz: Support identical predecessors in TransformationPropagateInstructionUp (KhronosGroup#3689)
2020-08-13 alanbaker Improve non-semantic instruction handling in the optimizer (KhronosGroup#3693)
2020-08-13 vasniktel Fix the bug (KhronosGroup#3680)
2020-08-12 andreperezmaselco.developer spirv-fuzz: Check integer and float width capabilities (KhronosGroup#3670)
2020-08-12 andreperezmaselco.developer spirv-fuzz: consider additional access chain instructions (KhronosGroup#3672)
2020-08-12 andreperezmaselco.developer spirv-fuzz: Ignore specialization constants (KhronosGroup#3664)
2020-08-12 vasniktel Fix the bug (KhronosGroup#3683)
2020-08-12 vasniktel spirv-fuzz: Fix width in FuzzerPassAddEquationInstructions (KhronosGroup#3685)
2020-08-12 jaebaek Preserve debug info in dead-insert-elim pass (KhronosGroup#3652)
2020-08-12 jaebaek Validate more OpenCL.DebugInfo.100 instructions (KhronosGroup#3684)
2020-08-11 alanbaker Only validation locations for appropriate execution models (KhronosGroup#3656)
2020-08-11 andreperezmaselco.developer spirv-fuzz: Fix in operand type assertion (KhronosGroup#3666)
2020-08-11 andreperezmaselco.developer spirv-opt: Add spvOpcodeIsAccessChain (KhronosGroup#3682)
2020-08-11 vasniktel spirv-fuzz: FuzzerPassPropagateInstructionsUp (KhronosGroup#3478)
2020-08-10 stevenperron Handle no index access chain in local access chain convert (KhronosGroup#3678)
2020-08-10 rharrison Roll 2 dependencies (KhronosGroup#3677)

Created with:
  roll-dep third_party/spirv-tools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants