Stream: wg-traits

Topic: rust-analyzer sync


nikomatsakis (Aug 30 2019 at 16:02, on Zulip):

Hey @Florian Diebold -- are you around for me to ask questions of?

nikomatsakis (Aug 30 2019 at 16:03, on Zulip):

To start, you posed these numbers in another topic:

Well, it seems like it might. Here are numbers for analyzing the Chalk repo:
Everything enumerable, using fuel: 20.685380613s
Everything enumerable, without fuel: 20.752197389s
Everything enumerable, removing our hardcoded blacklist of 'bad' traits (Send, Sync, Sized, the Fn traits): seems to hang indefinitely
Marking those traits as non-enumerable instead: 21.311616989s

where did they come from and how did you get them?

Florian Diebold (Aug 30 2019 at 16:07, on Zulip):

yes

Florian Diebold (Aug 30 2019 at 16:08, on Zulip):

I just ran ra_cli's analysis-stats command by hand, nothing scientific ;)

Florian Diebold (Aug 30 2019 at 16:09, on Zulip):

(we've run into new cases where trait solving takes a long time since then though: https://github.com/rust-analyzer/rust-analyzer/issues/1684)

nikomatsakis (Aug 30 2019 at 16:09, on Zulip):

Do you have some open issues or other things with steps to reproduce really painful slowdowns?

nikomatsakis (Aug 30 2019 at 16:09, on Zulip):

I guess that's an example :)

nikomatsakis (Aug 30 2019 at 16:14, on Zulip):

Though I was hoping for something a bit more .. "reduced"

Florian Diebold (Aug 30 2019 at 16:15, on Zulip):

Yeah, I haven't looked into that case in detail either so far

Florian Diebold (Aug 30 2019 at 16:30, on Zulip):

I could do that later today and try to create a small example if you think it'll help though ;)

matklad (Aug 30 2019 at 16:36, on Zulip):

I think this hurts a lot lately: https://github.com/rust-analyzer/rust-analyzer/issues/1684#issuecomment-526589665

Florian Diebold (Aug 30 2019 at 16:37, on Zulip):

I think that's mainly because we're using Chalk in more cases though

nikomatsakis (Aug 30 2019 at 17:16, on Zulip):

OK, so, I've been reading into the code. I've been collecting some notes in this paper document, though they're more notes to myself.

nikomatsakis (Aug 30 2019 at 17:16, on Zulip):

I think that the integration of normalization into rust-analyzer doesn't quite look like the "lazy normalization" design we are shooting for in rusc.

nikomatsakis (Aug 30 2019 at 17:16, on Zulip):

I also think I see a good sol'n to the fuel problem

nikomatsakis (Aug 30 2019 at 17:17, on Zulip):

hmm, that may not be entirely true

nikomatsakis (Aug 30 2019 at 17:18, on Zulip):

in any case I was thinking that, with some relatively minimal tweaks, we can modify how chalk's solver works so that it doesn't have as many "loops" -- in particular, handling of cyclic impls today potentially requires iterating over all impls

nikomatsakis (Aug 30 2019 at 17:19, on Zulip):

I think my ideal would be that fuel is more-or-less moved out from chalk and I think we could move closer to that -- though I realize that it's possible that even processing one strand might require a lot of recursion

nikomatsakis (Aug 30 2019 at 17:19, on Zulip):

that said, the other thing I remember now that I want to investigate is that I want to look at the "other side" of how the integration with rust-analyzer is working -- i.e., the data that chalk pulls from r-a about what traits/impls exists. I sort of remember thinking that we needed to improve that setup, and I've kind of forgotten where it stands now.

Florian Diebold (Aug 30 2019 at 17:27, on Zulip):

I was meaning to ask about lazy normalization, since I couldn't find any explanation of it -- my impression was that it means normalization happens during unification (resulting in additional obligations), but I'm not very clear on what practical difference that makes

Florian Diebold (Aug 30 2019 at 17:29, on Zulip):

Concerning fuel, I did try a bit to reorganize the chalk solver loop so we could handle it from the outside, but it wasn't so easy because after getting the first solution, the loop has to run a bit further to determine whether the answer is ambiguous

nikomatsakis (Aug 30 2019 at 17:32, on Zulip):

yes. that will still be needed. the main thing we can do is move those invocations a bit out so they can be interrupted if you no longer care

Florian Diebold (Aug 30 2019 at 17:33, on Zulip):

Btw @nikomatsakis did you see the issue I opened in the chalk repo? It outlines two other problems I ran into with associated types that I could use feedback on. Maybe they're related to the lazy normalization thing

nikomatsakis (Aug 30 2019 at 17:48, on Zulip):

@Florian Diebold nope, I'll check out now

nikomatsakis (Aug 30 2019 at 17:48, on Zulip):

to a 1st approx you can assume I see no github notifications :P

Last update: Nov 12 2019 at 15:30UTC