Skip to content

Avoiding Viper functions in hashsets and as keys in hashmaps#867

Merged
marcoeilers merged 4 commits intomasterfrom
meilers_avoid_AST_hash
Nov 6, 2025
Merged

Avoiding Viper functions in hashsets and as keys in hashmaps#867
marcoeilers merged 4 commits intomasterfrom
meilers_avoid_AST_hash

Conversation

@marcoeilers
Copy link
Contributor

I recently saw a Viper program where some consistency checks that need the call graph between functions took literal minutes, because various parts of the code calculating that graph use Viper AST functions as keys in maps. So lots of operations have to compute the hash code of those functions, which is apparently not cached in Scala's generated hash code implementation for case classes. And if the functions are sufficiently complex, this can apparently take forever.

So this PR just changes that code to compute maps from function names to sets of function names, instead of directly mapping functions to sets of functions.

This requires simple adaptations in Silicon and Carbon, which need to be merged first.

@marcoeilers marcoeilers enabled auto-merge (squash) November 6, 2025 12:55
@marcoeilers marcoeilers merged commit ce12a0a into master Nov 6, 2025
5 of 9 checks passed
@marcoeilers marcoeilers deleted the meilers_avoid_AST_hash branch November 6, 2025 13:14
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.

2 participants