Skip to content

rework recursive solver for better integration into an expanded version of salsa #708

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

Merged
merged 15 commits into from
Jul 14, 2021

Conversation

nikomatsakis
Copy link
Contributor

The overall plan is described here. I should probably move that into a tracking issue or project board or something. =)

This branch so far contains:

  • Separate out the logic to iterate until a fixed point is reached and to manage the caching during that iteration from the logic to search program clauses.

@jackh726 jackh726 self-assigned this May 19, 2021
@nikomatsakis
Copy link
Contributor Author

r? @jackh726 -- probably worth merging this in pieces. I think my next step is probably to create a distinct crate and mix/match the traits a bit but I'm not sure.

@nikomatsakis nikomatsakis changed the title [WIP] rework recursive solver for better integration into an expanded version of salsa rework recursive solver for better integration into an expanded version of salsa May 27, 2021
Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

Sorry it took me so long to look at this.

A couple thoughts but overall LGTM and r=me

max_size: usize,
}

pub(super) trait SolverStuff<K, V>: Copy
Copy link
Member

Choose a reason for hiding this comment

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

"Stuff" 🤣 maybe a more meaning for name might be better? I can't think of one atm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol, yes, I plan to rename this eventually =) I wasn't 100% sure what this interface was going to look like though so I left it for now.


/// The maximum size for goals.
max_size: usize,
}
Copy link
Member

Choose a reason for hiding this comment

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

Where is this used? This doesn't seem like the right place for this logically...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The field is used to truncate goals and things.

Hmm, you're not wrong. We should eventually factor RecursiveContext into "local state" and "global state" -- the cache and max-size are both "global state". The "stack" and "search graph" are "local state" (there could be multiple copies of them).

Copy link
Member

Choose a reason for hiding this comment

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

Well, truncation doesn't feel like logic that the "fixed state" portion of the solver should be doing. More so, where we get answers and such.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Truncation is part of the fixed state -- it is a "deep property". i.e., if you are solving goal A, and it has a bunch of sub-goals, and some of them get truncated, the results you get for A are affected.

@jackh726
Copy link
Member

Going to merge this. Better to not let this bitrot.

@bors r+

@bors
Copy link
Contributor

bors commented Jul 14, 2021

📌 Commit 8ce0360 has been approved by jackh726

@bors
Copy link
Contributor

bors commented Jul 14, 2021

⌛ Testing commit 8ce0360 with merge c1d64ee...

@bors
Copy link
Contributor

bors commented Jul 14, 2021

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing c1d64ee to master...

@bors bors merged commit c1d64ee into rust-lang:master Jul 14, 2021
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.

3 participants