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

MutationTree.num_mutations might have been returning the largest mutant IDs #10

Open
JonathanFoo0523 opened this issue Aug 23, 2024 · 1 comment

Comments

@JonathanFoo0523
Copy link
Collaborator

The num_mutations is intiliased and modified as below:

self.num_mutation = 0

# being modified by recursive call to `populate()`
temp: int = functools.reduce(max, self.nodes[node_id].mutation_ids, 0)
self.num_mutations = max(self.num_mutations, temp)

However, self.nodes[node_id].mutation_ids have range [0, largest_mutants_id], thus self.num_mutations <= largest_mutants_id

But in most case, we have self.num_mutations == largest_mutants_id + 1

I think (not verified) that this bug has been present since before the script was modified to accommodate the new format (flatten representation) of the mutation_info_file.

@JonathanFoo0523 JonathanFoo0523 changed the title MutationTree.num_mutations might have return largest mutants ids instead MutationTree.num_mutations might have been returning the largest mutant IDs Aug 23, 2024
@JonathanFoo0523
Copy link
Collaborator Author

If this is the case, then

unkilled_mutants: Set[int] = set(range(0, mutation_tree.num_mutations))

in llvm_test_suite_runner is wrong and might crash when we do

unkilled_mutants.remove(largest_mutant)

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

No branches or pull requests

1 participant