- 
                Notifications
    You must be signed in to change notification settings 
- Fork 190
Track cycle function dependenciees as part of the cyclic query #1018
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
base: master
Are you sure you want to change the base?
Conversation
| ✅ Deploy Preview for salsa-rs canceled.
 | 
| CodSpeed Performance ReportMerging #1018 will degrade performances by 6.52%Comparing  Summary
 
 Benchmarks breakdown
 | 
403c11b    to
    1339754      
    Compare
  
    1339754    to
    0354267      
    Compare
  
    | "WillCheckCancellation", | ||
| "WillIterateCycle { database_key: query(Id(0)), iteration_count: IterationCount(5) }", | ||
| "WillCheckCancellation", | ||
| "DidValidateMemoizedValue { database_key: entry(Id(0)) }", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the fix, this incorrectly re-executed entry but not the cycle (which is what depends on the value).
With the fix in execute_maybe_iterate, it did re-execute the cycle, but it also re-executed entry, which is incorrect because query returns the same value (it can be backdated). Now, the behavior is what we want. entry does not get re-executed but the cycle is
This fixes a bug in our fixpoint handling: the dependencies introduced by the cycle recovery function were recorded as dependencies of the outer function rather than the query with cycle handling.
This PR also requires that a cycle recovery function not introduce any new cycles, since it's unclear how to handle that.
I have the impression that we should probably to the same for
cycle_initialbut this is a bit trickier because we'd have to merge theinput/outputsinexecute_maybe_iterate. I also think it matters less because the dependencies are added to some query within the cycle and we always need to execute the cycle as a whole if any input it depends on changed. That's why I think it's probably fine if the dependencies are tracked by another cycle participant.Test plan
I added a regression test, yay :)
Except... it revealed a bug with deep verify memo where we failed to remove the head when we early-returned. Luckily, this was easy to fix.