You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a sister issue to #6 to handle the case of "fixed-point computations" or other cases where a cycles are expected and do not represent user error.
Some examples that have arisen in the context of rustc:
Inlining when tracing across call graphs
Trait resolution
...
I think we should punt on this issue for a while. It's an area of active research in the incremental computation community, to start, and I've found that in most instances, it's desirable to reframe the issue in a different way. e.g., to handle inlining, you can have one query that finds the call graph, then other queries that traverse it, avoiding cycles.
That said, if we did want some semantics, we could probably implement a Prolog-like tabling semantics fairly easily. This is specific to a "fixed-point" computation where you are trying to find a set of things. The idea would be that when we detect a cycle we return an empty set to start, but we mark the cycle participants. Then, when the last participant in the cycle finishes, we save the result R we got and re-execute the cycle. This time, when we return that last result R. We again mark the participants in the cycle though and we keep re-executing as long as the result is changing (it should be growing each time).
The text was updated successfully, but these errors were encountered:
nikomatsakis
changed the title
Fixed-point computations and other cycles
Fixed-point computations and other desirable cycles
Oct 1, 2018
This is a sister issue to #6 to handle the case of "fixed-point computations" or other cases where a cycles are expected and do not represent user error.
Some examples that have arisen in the context of rustc:
I think we should punt on this issue for a while. It's an area of active research in the incremental computation community, to start, and I've found that in most instances, it's desirable to reframe the issue in a different way. e.g., to handle inlining, you can have one query that finds the call graph, then other queries that traverse it, avoiding cycles.
That said, if we did want some semantics, we could probably implement a Prolog-like tabling semantics fairly easily. This is specific to a "fixed-point" computation where you are trying to find a set of things. The idea would be that when we detect a cycle we return an empty set to start, but we mark the cycle participants. Then, when the last participant in the cycle finishes, we save the result R we got and re-execute the cycle. This time, when we return that last result R. We again mark the participants in the cycle though and we keep re-executing as long as the result is changing (it should be growing each time).
The text was updated successfully, but these errors were encountered: