Skip to content

Update to Chalk 88 #13728

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 2 commits into from
Dec 5, 2022
Merged

Update to Chalk 88 #13728

merged 2 commits into from
Dec 5, 2022

Conversation

detrumi
Copy link
Member

@detrumi detrumi commented Dec 5, 2022

This Chalk release introduces fuel for the recursive solver (chalk#774).
I'm not sure how often it calls should_continue compared to the other solver, so we might want to increase CHALK_SOLVER_FUEL, the current default value of 100 might be too low.

This should fix a lot of hangs and crashes, for example this solves the hang in #12897.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 5, 2022
@lnicola
Copy link
Member

lnicola commented Dec 5, 2022

the current default value of 100 might be too low

We run analysis-stats on CI, this appears to yield a small increase in unknown types: https://github.com/rust-lang/rust-analyzer/actions/runs/3622085677/jobs/6106355642 vs. https://github.com/rust-lang/rust-analyzer/actions/runs/3616670546/jobs/6094828214.

@detrumi
Copy link
Member Author

detrumi commented Dec 5, 2022

A quick comparison using cargo run --release -p rust-analyzer -- analysis-stats .

master: exprs: 414387, ??ty: 43 (0%), ?ty: 131 (0%), !ty: 1
   100: exprs: 414387, ??ty: 78 (0%), ?ty: 152 (0%), !ty: 5
   500: exprs: 414387, ??ty: 78 (0%), ?ty: 152 (0%), !ty: 5
  1000: exprs: 414387, ??ty: 43 (0%), ?ty: 131 (0%), !ty: 1

So increasing it removes the increase when running it against rust-analyzer itself.

Lowering it might make things faster but also hide existing problems more.
So I think 1000 would be a good value.

The old value was for the old chalk-engine solver, nowadays the newer chalk-recursive solver is used.
The new solver currently uses fuel a bit more quickly, so a higher value is needed.
Running analysis-stats showed that a value of 100 increases the amount of unknown types,
while for a value of 1000 it's staying mostly the same.
@lnicola
Copy link
Member

lnicola commented Dec 5, 2022

If it's not too much of a hassle, can you also check rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std?

@detrumi
Copy link
Member Author

detrumi commented Dec 5, 2022

cargo run --release -p rust-analyzer -- analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std

master: exprs: 421758, ??ty: 42535 (10%), ?ty: 18863 (4%), !ty: 265
   100: exprs: 421758, ??ty: 42555 (10%), ?ty: 18883 (4%), !ty: 267                                                       
  1000: exprs: 421758, ??ty: 42535 (10%), ?ty: 18863 (4%), !ty: 265                                                       

Same story here

@lnicola
Copy link
Member

lnicola commented Dec 5, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Dec 5, 2022

📌 Commit a75bffc has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 5, 2022

⌛ Testing commit a75bffc with merge f9bd487...

@bors
Copy link
Contributor

bors commented Dec 5, 2022

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing f9bd487 to master...

@bors bors merged commit f9bd487 into rust-lang:master Dec 5, 2022
@detrumi detrumi deleted the chalk-update branch December 5, 2022 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants