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

Avoid re-adding solutions to forked state #3967

Merged
merged 1 commit into from
Jun 2, 2024
Merged

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Jun 2, 2024

Summary

Running a resolution that required forking was failing due to breaking an invariant in PubGrub. It looks like we were adding the same incompatibility multiple times, or something like that. The issue appears to be that when forking, we modify the current state, then clone it as the "next state", then push to the "forked states" -- but that means we're cloning the modified state.

This PR changes the order of operations such that we clone, then modify. It shouldn't introduce any additional clones though.

@charliermarsh charliermarsh added bug Something isn't working preview Experimental behavior labels Jun 2, 2024
@charliermarsh charliermarsh marked this pull request as ready for review June 2, 2024 21:14
@charliermarsh charliermarsh requested a review from BurntSushi June 2, 2024 21:15
Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

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

I bet I flubbed this when I fixed the perf regression in my initial PR. Namely, I had previously been cloning forked states eagerly. But this resulted in cloning the state for every call to get_dependencies, even when there was no forking.

@charliermarsh charliermarsh merged commit c500b78 into main Jun 2, 2024
46 checks passed
@charliermarsh charliermarsh deleted the charlie/glob branch June 2, 2024 21:58
@charliermarsh
Copy link
Member Author

No prob, you would’ve noticed immediately next week when you wrote the universal tests anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants