Stream: wg-async-foundations

Topic: meeting 2019.12.10


nikomatsakis (Dec 10 2019 at 18:04, on Zulip):

Hey @WG-async-foundations -- sync meeting?

nikomatsakis (Dec 10 2019 at 18:05, on Zulip):

Also, I've been talking to @tmandry and trying to convince them to start taking over some part of the leading of the "polish impl" side of this work :)

nikomatsakis (Dec 10 2019 at 18:05, on Zulip):

(something I mentioned a bit at the end of last meeting)

Giles Cope (Dec 10 2019 at 18:05, on Zulip):

Hi!

nikomatsakis (Dec 10 2019 at 18:05, on Zulip):

but let's look over untriaged issues to start

nikomatsakis (Dec 10 2019 at 18:06, on Zulip):

ps for those who don't know I use the links on the working group page

nikomatsakis (Dec 10 2019 at 18:06, on Zulip):

Uncategorized issues

nikomatsakis (Dec 10 2019 at 18:06, on Zulip):

ICE on beta and nightly as result of use of yield in combination with macro call in async block #67158

tmandry (Dec 10 2019 at 18:08, on Zulip):

seems like P-medium since yield is unstable?

nikomatsakis (Dec 10 2019 at 18:09, on Zulip):

sorry

nikomatsakis (Dec 10 2019 at 18:09, on Zulip):

had to run to the bathroom :)

nikomatsakis (Dec 10 2019 at 18:09, on Zulip):

yeah, sounds right

nikomatsakis (Dec 10 2019 at 18:10, on Zulip):

I'll just tag it as triaged

nikomatsakis (Dec 10 2019 at 18:11, on Zulip):

ICE while compiling async/await code #67087

nikomatsakis (Dec 10 2019 at 18:11, on Zulip):

welp

nikomatsakis (Dec 10 2019 at 18:11, on Zulip):

no source code

nikomatsakis (Dec 10 2019 at 18:11, on Zulip):

kind of inactionable

tmandry (Dec 10 2019 at 18:11, on Zulip):

yeah :/

nikomatsakis (Dec 10 2019 at 18:12, on Zulip):

I guess i'll just leave it as is for now

nikomatsakis (Dec 10 2019 at 18:12, on Zulip):

I see that https://github.com/rust-lang/rust/issues/67200 was mentioned

tmandry (Dec 10 2019 at 18:13, on Zulip):

yeah, and that reproducer does use async/await

nikomatsakis (Dec 10 2019 at 18:13, on Zulip):

that was mentioned as a potential duplicate

tmandry (Dec 10 2019 at 18:13, on Zulip):

we should probably go ahead and triage that issue at least

nikomatsakis (Dec 10 2019 at 18:13, on Zulip):

yeah

nikomatsakis (Dec 10 2019 at 18:13, on Zulip):

how serious do we think #67200 is...

nikomatsakis (Dec 10 2019 at 18:14, on Zulip):

I wonder if that repro is the actual repro

nikomatsakis (Dec 10 2019 at 18:14, on Zulip):

also, as it relies on async-std, it's going to be harder for us to minimiz

nikomatsakis (Dec 10 2019 at 18:14, on Zulip):

that is, the author says "It was quite basic, something like"

nikomatsakis (Dec 10 2019 at 18:14, on Zulip):

as opposed to "this is defintely the repro" :)

nikomatsakis (Dec 10 2019 at 18:14, on Zulip):

I'm include to just mark as "triaged" for now, or maybe wait until next week on this too

tmandry (Dec 10 2019 at 18:15, on Zulip):

hmm. it looks like it happened on stable though

tmandry (Dec 10 2019 at 18:15, on Zulip):

but yeah, without a real reproducer it's hard to do anything

nikomatsakis (Dec 10 2019 at 18:16, on Zulip):
async fn foo() {
  async {
    loop {
      bar(&"test_string".to_string()).await;
    }
  };
}

async fn bar(x: &String) { }

fn main() { }

didn't encounter any problem

nikomatsakis (Dec 10 2019 at 18:17, on Zulip):

Reduce type errors in async fns #67025

tmandry (Dec 10 2019 at 18:17, on Zulip):

yikes :D

Giles Cope (Dec 10 2019 at 18:17, on Zulip):

wow

nikomatsakis (Dec 10 2019 at 18:17, on Zulip):

there is a minimal reproduction at the bottom

nikomatsakis (Dec 10 2019 at 18:17, on Zulip):

I wonder if this would be aided by @davidtwco's long-standing PR

nikomatsakis (Dec 10 2019 at 18:18, on Zulip):

(which I need perhaps to give feedback on, I sort of forget what was going on with that)

davidtwco (Dec 10 2019 at 18:18, on Zulip):

I can check (not today, I've got an exam in < 16 hours).

davidtwco (Dec 10 2019 at 18:18, on Zulip):

(which I need perhaps to give feedback on, I sort of forget what was going on with that)

I believe that's the case.

nikomatsakis (Dec 10 2019 at 18:18, on Zulip):

I will try to do that tomorrow morning, most likely, i'll block out some time for it

nikomatsakis (Dec 10 2019 at 18:18, on Zulip):

else this afternoon

tmandry (Dec 10 2019 at 18:18, on Zulip):

There's also a draft PR which claims to fix this: https://github.com/rust-lang/rust/pull/67116

nikomatsakis (Dec 10 2019 at 18:18, on Zulip):

I'm trying to reduce my PR backlog

davidtwco (Dec 10 2019 at 18:19, on Zulip):

I hadn't seen that. I wonder in what ways it overlaps with my PR.

nikomatsakis (Dec 10 2019 at 18:19, on Zulip):

Yeah I was wondering the same

nikomatsakis (Dec 10 2019 at 18:20, on Zulip):

IF you have a build around, @davidtwco, you could test against the minimized example here

csmoe (Dec 10 2019 at 18:20, on Zulip):

also, as it relies on async-std, it's going to be harder for us to minimiz

async repro is a bit hard as the issues always mixed with futures/tokio/..., https://github.com/rust-lang/rust/issues/65180 @nikomatsakis I had removed the Error and some code, but the Server, make_servic_fn etc were hard for me to reduce as complex traits and pin_project involved in.

nikomatsakis (Dec 10 2019 at 18:20, on Zulip):

yeah that is a challenge

davidtwco (Dec 10 2019 at 18:21, on Zulip):

my pr's diff for async-fn-nonsend and that pr's diff for async-fn-nonsend

davidtwco (Dec 10 2019 at 18:22, on Zulip):

IF you have a build around, davidtwco, you could test against the minimized example here

I do, I'll give it a check shortly.

nikomatsakis (Dec 10 2019 at 18:22, on Zulip):

my pr's diff for async-fn-nonsend and that pr's diff for async-fn-nonsend

seems pretty similar

nikomatsakis (Dec 10 2019 at 18:22, on Zulip):

OK, so I guess i'll mark this as "triaged" for now any
way

nikomatsakis (Dec 10 2019 at 18:22, on Zulip):

I think we have enough "on deck" issues and this is probably overlapping anyway?

nikomatsakis (Dec 10 2019 at 18:23, on Zulip):

So I guess maybe we should take last 10 minutes to touch base

nikomatsakis (Dec 10 2019 at 18:23, on Zulip):

We have more folks around :)

nikomatsakis (Dec 10 2019 at 18:23, on Zulip):

I'm not sure who is working on what (or looking for something to do)

nikomatsakis (Dec 10 2019 at 18:24, on Zulip):

My own async time for this week I expect to use on (a) async interviews, (b) reviewing davidtwco's PR, and (c) talking to @Aaron Hill about some of the work they've been doing on getting more precise idea of which types are live across awaits

Giles Cope (Dec 10 2019 at 18:24, on Zulip):

I'm going to have a bit of time over xmas to do some PRs.

nikomatsakis (Dec 10 2019 at 18:24, on Zulip):

Ah, nice

csmoe (Dec 10 2019 at 18:25, on Zulip):

still working on https://github.com/rust-lang/rust/issues/66312

tmandry (Dec 10 2019 at 18:25, on Zulip):

talking to Aaron Hill about some of the work they've been doing on getting more precise idea of which types are live across awaits

is intrigued

tmandry (Dec 10 2019 at 18:26, on Zulip):

The next thing I pick up will likely be #62958

nikomatsakis (Dec 10 2019 at 18:26, on Zulip):

still working on https://github.com/rust-lang/rust/issues/66312

do you need some help getting unstuck?

nikomatsakis (Dec 10 2019 at 18:26, on Zulip):

one thing I feel like I"ve kind of lost track of

nikomatsakis (Dec 10 2019 at 18:26, on Zulip):

maybe it'd be useful to write it down

davidtwco (Dec 10 2019 at 18:26, on Zulip):

IF you have a build around, davidtwco, you could test against the minimized example here

error: future cannot be shared between threads safely
  --> /home/david/projects/rust/rust4/src/test/ui/async-await/issue-64130-foo.rs:18:5
   |
LL | fn require_sync<T: Sync>(val: T) {}
   |    ------------    ---- required by this bound in `require_sync`
...
LL |     require_sync(async_not_sync());
   |     ^^^^^^^^^^^^ future returned by `async_not_sync` is not `Sync`
   |
   = help: within `impl std::future::Future`, the trait `std::marker::Sync` is not implemented for `*const ()`
note: future is not `Sync` as this value is used across an await
  --> /home/david/projects/rust/rust4/src/test/ui/async-await/issue-64130-foo.rs:12:5
   |
LL |     let a = NotSync(0 as *const ());
   |         - has type `NotSync`
...
LL |     dummy().await;
   |     ^^^^^^^^^^^^^ await occurs here, with `a` maybe used later
LL | }
   | - `a` is later dropped here

error: aborting due to previous error
nikomatsakis (Dec 10 2019 at 18:27, on Zulip):

@davidtwco perhaps leave a comment? that seems great!

nikomatsakis (Dec 10 2019 at 18:27, on Zulip):

one thing I feel like I've kind of lost track of

basically "What would be the biggest problems with using async fn in practice" today

csmoe (Dec 10 2019 at 18:27, on Zulip):

maybe it'd be useful to write it down

okay, will update my progress.

nikomatsakis (Dec 10 2019 at 18:28, on Zulip):

I feel like the imprecise analysis of what is live is one of those corners we kind of cut that seems very suboptimal, and we have to land davidtwco's PR clearly to improve diagnostics, but not sure what the other "big toestubers" are

nikomatsakis (Dec 10 2019 at 18:28, on Zulip):

(recursive functions maybe?)

nikomatsakis (Dec 10 2019 at 18:28, on Zulip):

ps, @Giles Cope, I guess you might like to have some ideas for issues to work on over xmas? I'm looking over the list of on deck issues

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

it's actually not that long

Giles Cope (Dec 10 2019 at 18:29, on Zulip):

I'm easy - anything not too urgent is good :-)

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

async-await keywords are not documented in the libstd docs #66909

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

this should be an easy one, but i'm not sure what to
edit

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

it'll involve a bit of slething or pinging, probalby just a quick ripgrep of the source mihgt find the answer

nikomatsakis (Dec 10 2019 at 18:30, on Zulip):

e.g., where does this comment appear in the source...

nikomatsakis (Dec 10 2019 at 18:30, on Zulip):

also super low priority :)

tmandry (Dec 10 2019 at 18:30, on Zulip):

basically "What would be the biggest problems with using async fn in practice" today

IMO debugging a live program in an async world needs to be easier, but that feels like a "bigger" discussion

nikomatsakis (Dec 10 2019 at 18:31, on Zulip):

async-block diagnostics do not suggest async move when it may be needed #66107

this seems like a good one, @Giles Cope, that's a bit trickier but hopefully not too difficult

nikomatsakis (Dec 10 2019 at 18:31, on Zulip):

I could try to leave a note or two

Giles Cope (Dec 10 2019 at 18:31, on Zulip):

sure I can sort that out

Giles Cope (Dec 10 2019 at 18:32, on Zulip):

I'll take two - more chance one will get done ;-)

nikomatsakis (Dec 10 2019 at 18:32, on Zulip):

not sure why I marked " An async fn which isn't Send but which should be? #63768 " as on-deck -- I think this is probably mostly a matter of getting a more precise analysis

nikomatsakis (Dec 10 2019 at 18:32, on Zulip):

IMO debugging a live program in an async world needs to be easier, but that feels like a "bigger" discussion

that sounds likely. rust debugging in general is in need of some "ownership"

tmandry (Dec 10 2019 at 18:33, on Zulip):

I also think there's work that can be done in the executor implementations to make it easier

tmandry (Dec 10 2019 at 18:34, on Zulip):

and we may want to come up with ways of standardizing some of those interfaces

tmandry (Dec 10 2019 at 18:34, on Zulip):

I'll probably prototype some things in the fuchsia executor at some point

tmandry (Dec 10 2019 at 18:35, on Zulip):

(for example, we don't even have a way of saying "get me a list of all tasks" in the debugger today)

nikomatsakis (Dec 10 2019 at 18:36, on Zulip):

ah yeah

nikomatsakis (Dec 10 2019 at 18:37, on Zulip):

I wonder if e.g. there is some support for go or other languages that we could build on

nikomatsakis (Dec 10 2019 at 18:37, on Zulip):

(in gdb or other debuggers)

tmandry (Dec 10 2019 at 18:37, on Zulip):

good question, I'll make a mental note to look into that

nikomatsakis (Dec 10 2019 at 18:37, on Zulip):

though we'd really need a gdb expert to make that work (too bad @Tom Tromey moved on to other things :)

nikomatsakis (Dec 10 2019 at 18:38, on Zulip):

/me guilt trips

boats (Dec 10 2019 at 18:38, on Zulip):

and we may want to come up with ways of standardizing some of those interfaces

exactly this, i think creating an interface for executors is the main thing for Rust to do here

tmandry (Dec 10 2019 at 18:38, on Zulip):

I wonder if e.g. there is some support for go or other languages that we could build on

I think I've seen some fancy stuff in Swift when using Grand Dispatch Central, in LLDB

tmandry (Dec 10 2019 at 18:39, on Zulip):

exactly this, i think creating an interface for executors is the main thing for Rust to do here

once we have some things prototyped, it might be good to schedule time to go over those and brainstorm further

tmandry (Dec 10 2019 at 18:41, on Zulip):

(I don't know if anyone else in the ecosystem is working on this, would be good to know if so)

boats (Dec 10 2019 at 19:13, on Zulip):

The tracing project might be interested in it

David Barsky (Dec 11 2019 at 03:34, on Zulip):

Somewhat, tracing wrote a crate for this purpose: https://docs.rs/tracing-futures/0.2.0/tracing_futures/. in practice, it hasn't been terrible to maintain, but it could just be a learned acceptance of pain

Last update: Jul 02 2020 at 17:55UTC