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

Fixed-point computations and other desirable cycles #9

Open
nikomatsakis opened this issue Oct 1, 2018 · 0 comments · May be fixed by #603
Open

Fixed-point computations and other desirable cycles #9

nikomatsakis opened this issue Oct 1, 2018 · 0 comments · May be fixed by #603
Labels
rfc Active discussion about a possible future feature
Milestone

Comments

@nikomatsakis
Copy link
Member

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).

@nikomatsakis nikomatsakis changed the title Fixed-point computations and other cycles Fixed-point computations and other desirable cycles Oct 1, 2018
@nikomatsakis nikomatsakis added the rfc Active discussion about a possible future feature label Oct 1, 2018
@nikomatsakis nikomatsakis added this to the Far future milestone Oct 1, 2018
@Veykril Veykril linked a pull request Feb 25, 2025 that will close this issue
9 tasks
@carljm carljm linked a pull request Feb 26, 2025 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfc Active discussion about a possible future feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant