FIX: Have SeedCorpus._original_index track correct indices#105
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #105 +/- ##
=======================================
Coverage 73.51% 73.51%
=======================================
Files 91 91
Lines 20506 20508 +2
=======================================
+ Hits 15075 15077 +2
Misses 5431 5431
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Contributor
|
it is good to me. |
hanyuone
marked this pull request as ready for review
July 21, 2026 00:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using
SeedCorpus, we give it a set of seeds that corresponds 1-to-1 to a batchedVerifiableModel'slabeled_input(as in this example fromipynb/vnnlib_fuzzer.ipynb):However,
SeedCorpusdoes deduplicating, and then storesself._original_indexas the indices of the deduplicated list of seeds, instead of the original. For example, if we set the number of samples to 4, the images inlabeled_inputwould correspond to images[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3]. However,_original_index = [0, 1, 2, 3]because of deduping.This means that there is no longer a 1-to-1 correspondence between the indices in
_original_indexand the batched input spec, which means when we fuzz withBOXinput specs, we use the wronglbandub. Input tensors now "blend together" when fuzzing:To replicate this bug, run the following Python file as a Jupyter notebook, in the
ipynbfolder of ACT: https://gist.github.com/hanyuone/8a551837e90091ac720aa89c9f397c1cThis PR fixes the above bug by keeping track of original indices when deduplicating.