Stream: wg-traits

Topic: meeting 2019.04.29


nikomatsakis (Apr 29 2019 at 17:54, on Zulip):

Hey @WG-traits -- meeting time in 5 minutes or so!

nikomatsakis (Apr 29 2019 at 17:55, on Zulip):

/me realizes he didn't eat lunch today

nikomatsakis (Apr 29 2019 at 17:55, on Zulip):

I'm...gonna grab a falafel :) so maybe a few minutes late

Alexander Regueiro (Apr 29 2019 at 17:57, on Zulip):

@nikomatsakis Can't make it today sadly, but I thought I'd update that https://github.com/rust-lang/rust/pull/59445 is just waiting for review from Centril (though you or someone else is welcome to check it out and approve it too). The majority has already been reviewed.

nikomatsakis (Apr 29 2019 at 18:06, on Zulip):

@Alexander Regueiro nice

nikomatsakis (Apr 29 2019 at 18:07, on Zulip):

OK @WG-traits :wave:

nikomatsakis (Apr 29 2019 at 18:07, on Zulip):

So, it's the start of a new 6-week "sprint" this week

nikomatsakis (Apr 29 2019 at 18:08, on Zulip):

I've been thinking about that and what it means =)

nikomatsakis (Apr 29 2019 at 18:08, on Zulip):

I created this dropbox paper document, trying to identify some of the next steps we should take for chalk etc

nikomatsakis (Apr 29 2019 at 18:09, on Zulip):

I also realized a few things -- (a) I thnk that I should generally spend the sprints preparing for the next one :)

nikomatsakis (Apr 29 2019 at 18:09, on Zulip):

(too late now, but maybe I can work on that for next time)

nikomatsakis (Apr 29 2019 at 18:10, on Zulip):

and (b) I continue to struggle a bit in terms of the best next steps are :)

nikomatsakis (Apr 29 2019 at 18:11, on Zulip):

the doc I posted a link to includes a smattering of tasks; there are more, but I thnk that's a decent set, but maybe we can discuss a bit the goals and where those tasks came from

nikomatsakis (Apr 29 2019 at 18:12, on Zulip):

First off, I think a "enabling" thing to do is to try and land chalk#216, which @detrumi has been working on. That I think is not really considering as a "sprint" activity per se because I hope we can do it very soon. I was hoping to spend some time on that this afternoon, in fact, trying to see if I can finish it up

nikomatsakis (Apr 29 2019 at 18:13, on Zulip):

But that PR basically positions chalk-solve as the main chalk crate, and I think the way to understand the layering then is:

nikomatsakis (Apr 29 2019 at 18:14, on Zulip):

I think then that one piece of "validation" that makes sense for chalk is to extend it to cover some of the corners of Rust it doesn't yet handle. I have two notable entries on the list:

nikomatsakis (Apr 29 2019 at 18:14, on Zulip):

Each of them can I think be broken down into some subtasks

nikomatsakis (Apr 29 2019 at 18:15, on Zulip):

Trait object and impl traits:

nikomatsakis (Apr 29 2019 at 18:15, on Zulip):

(The former builds pretty directly on chalk#216)

nikomatsakis (Apr 29 2019 at 18:16, on Zulip):

The former is probably a "medium" engineering task

nikomatsakis (Apr 29 2019 at 18:16, on Zulip):

The latter is a design task, though @scalexm has basically laid it out -- so maybe it's more of a communication task :)

nikomatsakis (Apr 29 2019 at 18:17, on Zulip):

(which we can come back to)

nikomatsakis (Apr 29 2019 at 18:18, on Zulip):

When it comes to specialization, I think that there are more layers, but it begins with:

I think this is actually pretty straightforward, and I think @Sunjay Varma is interested. =)

After that, we start to get into the more interesting soundness-related questions: these basically boil down to extending the coherence rules to ensure that, if impl A specializes impl B, then various criteria are met.

In other words, we can separate into:

nikomatsakis (Apr 29 2019 at 18:19, on Zulip):

(I'm typing a lot, I assume this makes at least some sense to people so far?)

nikomatsakis (Apr 29 2019 at 18:19, on Zulip):

actually I sort of like this breakdown, maybe I'll edit my sprint.next doc :)

nikomatsakis (Apr 29 2019 at 18:20, on Zulip):

tl;dr:

Goal: extend chalk to cover bits of Rust it doesn’t cover

nikomatsakis (Apr 29 2019 at 18:21, on Zulip):

So I think the next goal has more to do w/ impl and search strategy

nikomatsakis (Apr 29 2019 at 18:22, on Zulip):

And I think the obvious steps I see in that direction are probably

Goal: validate search strategy

nikomatsakis (Apr 29 2019 at 18:22, on Zulip):

I can explain a bit what I mean by those things if desired, I realize that's mostly opaque jibberish

nikomatsakis (Apr 29 2019 at 18:23, on Zulip):

In short, the order in which we try to prove things matters. There are some simple steps ("order selection") that we can use to try and keep ourselves in a smart order, but the structure of the solver will still wind up constrained. The "non-enumerable clauses" idea is a deeper change to the solver that should let it do more aggressive reordering.

matklad (Apr 29 2019 at 18:24, on Zulip):

chalk -- testing harness

That's one confusing naming :) chalk-testing might be better

nikomatsakis (Apr 29 2019 at 18:24, on Zulip):

I think that doing those items probably involves some related things. One of them is probably me explaining chalk-engine in more detail, as a pre-req, so that we can then dive into how non-enumerable clauses would work

nikomatsakis (Apr 29 2019 at 18:24, on Zulip):

That's one confusing naming :) chalk-testing might be better

yes..I wanted to bring up the naming...

detrumi (Apr 29 2019 at 18:25, on Zulip):

I was also thinking it might be better to use the main crate for what is now chalk-solve, and create a chalk-testing crate

nikomatsakis (Apr 29 2019 at 18:25, on Zulip):

yeah, I think what we should do is

nikomatsakis (Apr 29 2019 at 18:25, on Zulip):

create a chalk_test crate

nikomatsakis (Apr 29 2019 at 18:25, on Zulip):

and then move tests to tests/ directory

nikomatsakis (Apr 29 2019 at 18:25, on Zulip):

i.e., use cargo properly

nikomatsakis (Apr 29 2019 at 18:27, on Zulip):

so we can add that I guess as a further work item

nikomatsakis (Apr 29 2019 at 18:27, on Zulip):

which raises a point I wanted to ask

nikomatsakis (Apr 29 2019 at 18:28, on Zulip):

Goal: make chalk a nice codebase to work with

nikomatsakis (Apr 29 2019 at 18:28, on Zulip):

this would be I think the meta goal

nikomatsakis (Apr 29 2019 at 18:28, on Zulip):

I think there is some work to be done there

nikomatsakis (Apr 29 2019 at 18:29, on Zulip):

in particular i've noticed (a) a general lack of comments

nikomatsakis (Apr 29 2019 at 18:29, on Zulip):

and (b) I think that the rustc-guide material is incomplete and/or out of date

nikomatsakis (Apr 29 2019 at 18:29, on Zulip):

maybe we want to put some energy into that?

nikomatsakis (Apr 29 2019 at 18:30, on Zulip):

not sure

detrumi (Apr 29 2019 at 18:30, on Zulip):

Makes large refactorings a bit harder, but maybe things are mostly in place now?

nikomatsakis (Apr 29 2019 at 18:31, on Zulip):

Yeah, that's a valid question.

nikomatsakis (Apr 29 2019 at 18:31, on Zulip):

Maybe not

nikomatsakis (Apr 29 2019 at 18:31, on Zulip):

API comments don't have that problem to the same degree

tmandry (Apr 29 2019 at 18:32, on Zulip):

to keep rustc-guide from getting too out of date, maybe we should lean more on rustdoc for "here are all the pieces and what they do" type documentation

tmandry (Apr 29 2019 at 18:32, on Zulip):

(as well as direct API documentation)

tmandry (Apr 29 2019 at 18:33, on Zulip):

it's easier to remember to update things in the same codebase

detrumi (Apr 29 2019 at 18:33, on Zulip):

API comments don't have that problem to the same degree

Yes, and some two-sentence descriptions of traits and structs would make a huge difference

nikomatsakis (Apr 29 2019 at 18:34, on Zulip):

Yeah, we could do that.

nikomatsakis (Apr 29 2019 at 18:34, on Zulip):

I think for this sprint we should just focus on API docs

nikomatsakis (Apr 29 2019 at 18:34, on Zulip):

it's sort of easy to "enumerate" the problem

nikomatsakis (Apr 29 2019 at 18:34, on Zulip):

and you have to walk before you can run

nikomatsakis (Apr 29 2019 at 18:34, on Zulip):

The goal of the rustc-guide docs was to help communicate the "high level design"

nikomatsakis (Apr 29 2019 at 18:34, on Zulip):

but I suspect that videos might be as good or better for serving that role

nikomatsakis (Apr 29 2019 at 18:35, on Zulip):

in case you've not been following the dropbox paper doc, I've got this so far:

Goal: extend chalk to cover bits of Rust it doesn’t cover

Goal: validate search strategy

Goal: make chalk a nice codebase to work with

tmandry (Apr 29 2019 at 18:36, on Zulip):

The goal of the rustc-guide docs was to help communicate the "high level design"

yeah, maybe a better criteria for rustc-guide material is "stuff that won't change significantly during refactoring"..?

nikomatsakis (Apr 29 2019 at 18:36, on Zulip):

This is true for a lot of that material

tmandry (Apr 29 2019 at 18:36, on Zulip):

even though that may be hard to decide :)

nikomatsakis (Apr 29 2019 at 18:36, on Zulip):

I have to review what's there

nikomatsakis (Apr 29 2019 at 18:37, on Zulip):

Here is my concern with the above list

nikomatsakis (Apr 29 2019 at 18:37, on Zulip):

I would like to be able to make clear steps towards chalk being used in something -- I think I would be happy with either rustc or rust-analyzer, or, ideally both

nikomatsakis (Apr 29 2019 at 18:37, on Zulip):

I guess that the non-enumerable clauses stuff is directly taking on the challenge of the "builtin traits"

nikomatsakis (Apr 29 2019 at 18:38, on Zulip):

I made a more complete table of work-items here for rustc-chalk integration specifically

nikomatsakis (Apr 29 2019 at 18:39, on Zulip):

I'm skimming it now

nikomatsakis (Apr 29 2019 at 18:40, on Zulip):

@scalexm you mentioned that some tests work in rustc now, right?

nikomatsakis (Apr 29 2019 at 18:40, on Zulip):

were you basically running things by hand?

nikomatsakis (Apr 29 2019 at 18:40, on Zulip):

did you ever try to run against run-pass or something like that?

scalexm (Apr 29 2019 at 18:41, on Zulip):

I did not try to run against run-pass or whatever, there are only a few tests in run-pass/chalkify

scalexm (Apr 29 2019 at 18:41, on Zulip):

Which just show that some basic programs do compile

nikomatsakis (Apr 29 2019 at 18:42, on Zulip):

ok.

nikomatsakis (Apr 29 2019 at 18:42, on Zulip):

I was wondering if we thought that might be useful

nikomatsakis (Apr 29 2019 at 18:42, on Zulip):

the other thing I was wondering about is:

nikomatsakis (Apr 29 2019 at 18:42, on Zulip):

if region constraints are a major work item, I think (a) we need something about them

nikomatsakis (Apr 29 2019 at 18:43, on Zulip):

and (b) maybe we should modify the chalk integration to ignore them completely for now

nikomatsakis (Apr 29 2019 at 18:43, on Zulip):

you could even imagine doing something where chalk + the existing trait engine run side-by-side

nikomatsakis (Apr 29 2019 at 18:43, on Zulip):

and chalk is just ignoring region bounds, say

nikomatsakis (Apr 29 2019 at 18:43, on Zulip):

the idea being: can we flesh out what other problems to expect?

nikomatsakis (Apr 29 2019 at 18:43, on Zulip):

if region constraints are a major work item, I think (a) we need something about them

I have some thoughts here but want to focus on the other half first

nikomatsakis (Apr 29 2019 at 18:44, on Zulip):

(ps, sorry for this meeting running over-- sprint planning meetings really need more time :/)

nikomatsakis (Apr 29 2019 at 18:46, on Zulip):

the idea being: can we flesh out what other problems to expect?

@scalexm any thoughts on that?

Separately, I remember you mentioning some kind of inference problems, right?

scalexm (Apr 29 2019 at 18:47, on Zulip):

Yes

scalexm (Apr 29 2019 at 18:47, on Zulip):

I described one of those in a PR of mine

scalexm (Apr 29 2019 at 18:48, on Zulip):

https://github.com/rust-lang/rust/pull/58305

nikomatsakis (Apr 29 2019 at 18:50, on Zulip):

OK

nikomatsakis (Apr 29 2019 at 18:50, on Zulip):

So I'm going to leave it at this for now:

Goal: rustc-chalk interation improvements

nikomatsakis (Apr 29 2019 at 18:50, on Zulip):

that's kind of vague but I will try to make it more specific

tmandry (Apr 29 2019 at 18:51, on Zulip):

hmm.. I'm a bit concerned with leaving things vague after sprint planning, since in practice people usually don't pick up things like that to work on

nikomatsakis (Apr 29 2019 at 18:52, on Zulip):

if region constraints are a major work item, I think (a) we need something about them

to circle back to this: I have been thinking about how I think we should handle region constraints but I don't have firm answers. I want to try and talk this stuff out and write-up some sort of proposals. However, I suspect the ultimate solution will build on chalk#216, most likely, and perhaps non-enumerable clauses.

scalexm (Apr 29 2019 at 18:52, on Zulip):

Btw some parts of rustc still use the existing solver even with -Z chalk

scalexm (Apr 29 2019 at 18:52, on Zulip):

For example code that need to use a SelectionContext directly rather than a FulfillmentContext

nikomatsakis (Apr 29 2019 at 18:53, on Zulip):

Ah, yeah, and there is e.g. the cast code in coercions

nikomatsakis (Apr 29 2019 at 18:53, on Zulip):

(ugh)

scalexm (Apr 29 2019 at 18:53, on Zulip):

Right

nikomatsakis (Apr 29 2019 at 18:55, on Zulip):

I'm not sure whether to worry about this right now :) one possible work item would be to try and refactor that code out of existence. I had a vague plan to try and move it to use evaluate -- but this would I think possibly be a breaking change, not entirely sure.

nikomatsakis (Apr 29 2019 at 18:55, on Zulip):

hmm.. I'm a bit concerned with leaving things vague after sprint planning, since in practice people usually don't pick up things like that to work on

indeed. I was thinking that after this I will try to create issues with specific instructions

nikomatsakis (Apr 29 2019 at 18:57, on Zulip):

OK, so, I'm feeling like this meeting has kind of gone long enough, we should look to some sort of wrap-up

nikomatsakis (Apr 29 2019 at 18:57, on Zulip):

I'm not sure whether to try and assign work now

nikomatsakis (Apr 29 2019 at 18:57, on Zulip):

or for me to go and create issues and we try to "assign work" mildly async

nikomatsakis (Apr 29 2019 at 18:57, on Zulip):

I'm leaning that way

nikomatsakis (Apr 29 2019 at 18:58, on Zulip):

one thing I want to ask is

nikomatsakis (Apr 29 2019 at 18:59, on Zulip):

well, I still have this feeling that we've not done a good job getting people "up to speed" on the big picture enough, and i'm debating what is the best way to do this

nikomatsakis (Apr 29 2019 at 18:59, on Zulip):

I guess I can't think of anything else that repeated zoom sessions trying to explain stuff :)

tmandry (Apr 29 2019 at 19:00, on Zulip):

what is the scope of the big picture you wish to bring people up to speed on? :)

nikomatsakis (Apr 29 2019 at 19:00, on Zulip):

i think it'd be nice to ways to 'cement' that, so that new people can come up to speed, though I suppose they can re-watch videos

nikomatsakis (Apr 29 2019 at 19:00, on Zulip):

what is the scope of the big picture you wish to bring people up to speed on? :)

i'm wondering that myself :)

nikomatsakis (Apr 29 2019 at 19:01, on Zulip):

I think I am thinking of things like this:

nikomatsakis (Apr 29 2019 at 19:01, on Zulip):

I guess let me turn this around

nikomatsakis (Apr 29 2019 at 19:01, on Zulip):

What things do you the assembled feel confused about and do you think we should make an effort to explain things, or should we just keep finding tasks and "learn by doing"?

detrumi (Apr 29 2019 at 19:03, on Zulip):

It's just a lot to take in. I mean, I can understand domain goals and such by looking at the implementation and the tests, but there's just so much to look at :slight_smile:

tmandry (Apr 29 2019 at 19:03, on Zulip):

I think both of those things would be helpful.
Another I hit when working in chalk was binders, shifting indices, and substitutions, not sure if that's been covered already.
Then there's the long tail of everything in rustc, e.g. I'm thinking of some of the things you mentioned that use the old trait code for -Z chalk and I don't have much context there at all.

nikomatsakis (Apr 29 2019 at 19:04, on Zulip):

like, why do we have FromEnv, Implemented, etc

one reason I would like to discuss these is that I want to pick better names=)

nikomatsakis (Apr 29 2019 at 19:05, on Zulip):

ok, so, let me ask the question a slightly different way

nikomatsakis (Apr 29 2019 at 19:05, on Zulip):

what do y'all think about fixing a weekly time (or perhaps every 2 weeks)

nikomatsakis (Apr 29 2019 at 19:05, on Zulip):

to do some kind of explanation

nikomatsakis (Apr 29 2019 at 19:05, on Zulip):

like we did last week

nikomatsakis (Apr 29 2019 at 19:05, on Zulip):

then we just have to pick which thing

nikomatsakis (Apr 29 2019 at 19:05, on Zulip):

I feel like scheduling is hard

nikomatsakis (Apr 29 2019 at 19:06, on Zulip):

but if we had a fixed slot, i'd be happy to just join a call and talk a bit

nikomatsakis (Apr 29 2019 at 19:06, on Zulip):

(is Zoom best? we could use zulip too)

nikomatsakis (Apr 29 2019 at 19:06, on Zulip):

somehow explaining things "lecture style" always feels very tedious over zulip :)

Sunjay Varma (Apr 29 2019 at 19:06, on Zulip):

Zoom works

Sunjay Varma (Apr 29 2019 at 19:07, on Zulip):

I suggest that the people on the call be responsible for fleshing out the document you are writing as you write it. Otherwise a lot gets lost.

nikomatsakis (Apr 29 2019 at 19:07, on Zulip):

that's a great idea

nikomatsakis (Apr 29 2019 at 19:07, on Zulip):

ok I can make a doodle to find a time for that

Sunjay Varma (Apr 29 2019 at 19:07, on Zulip):

It gives us a more active role on the call and produces an artifact for after the meeting too :)

nikomatsakis (Apr 29 2019 at 19:12, on Zulip):

OK, that seems good. So I'm going to go try and create issues.

nikomatsakis (Apr 29 2019 at 19:12, on Zulip):

and look a bit into chalk#216

nikomatsakis (Apr 29 2019 at 19:12, on Zulip):

:)

nikomatsakis (Apr 29 2019 at 19:12, on Zulip):

thanks all :heart:

Alexander Regueiro (Apr 29 2019 at 21:38, on Zulip):

@tmandry Think you’ll have time to review my ATB PR soonish btw? It’s been bit-rotting a while heh.

tmandry (Apr 29 2019 at 21:39, on Zulip):

@Alexander Regueiro I started a review, but it's a lot of code and I haven't gotten that far yet :)

tmandry (Apr 29 2019 at 21:40, on Zulip):

actually, I was talking about this with @centril

tmandry (Apr 29 2019 at 21:40, on Zulip):

I'm thinking it might be good to have separate reviewers for the implementation and the tests

centril (Apr 29 2019 at 21:42, on Zulip):

@nikomatsakis might want to look at the tests, but I think it's good if @tmandry also looks at them to connect it to the implementation

tmandry (Apr 29 2019 at 21:43, on Zulip):

looking at them is one thing, but if we're talking about reviewing for completeness/correctness, I think it's another

tmandry (Apr 29 2019 at 21:43, on Zulip):

both are a significant amount of code, and reviewing each requires a different focus

tmandry (Apr 29 2019 at 21:46, on Zulip):

essentially, I view the tests as a "lang" thing, and the implementation as a "compiler" thing

tmandry (Apr 29 2019 at 21:47, on Zulip):

doing a thorough review of both is.. a lot for one person, especially given that I need to learn some parts of the code to review the implementation side :)

centril (Apr 29 2019 at 21:58, on Zulip):

@tmandry I agree with your general description :P

Alexander Regueiro (Apr 29 2019 at 23:13, on Zulip):

@tmandry Okay sounds good, thanks.

Last update: Nov 18 2019 at 00:40UTC