Stream: t-compiler/wg-polonius

Topic: unit testing


nikomatsakis (Nov 20 2019 at 14:05, on Zulip):

but the relations etc are so complex

nikomatsakis (Nov 20 2019 at 14:05, on Zulip):

I'm breaking this into a separate topic, but I want to compare to chalk

nikomatsakis (Nov 20 2019 at 14:05, on Zulip):

in Chalk, we have a much more extensive unit testing harness

nikomatsakis (Nov 20 2019 at 14:05, on Zulip):

that takes in Rust syntax, effectively, and desugars it

nikomatsakis (Nov 20 2019 at 14:06, on Zulip):

and we are now working on getting that "desugaring" to be shared between rust + chalk, as well

nikomatsakis (Nov 20 2019 at 14:06, on Zulip):

I wonder if that is what polonius needs -- i.e., if we could find ways to share the fact generation

lqd (Nov 20 2019 at 14:06, on Zulip):

the chalk subset seems more focused than what we're testing in polonius tho

nikomatsakis (Nov 20 2019 at 14:06, on Zulip):

and model MIR etc using traits or whatever else

nikomatsakis (Nov 20 2019 at 14:06, on Zulip):

the chalk subset seems more focused than what we're testing in polonius tho

I'm not sure if this is true

nikomatsakis (Nov 20 2019 at 14:06, on Zulip):

ok, I think it is true :)

nikomatsakis (Nov 20 2019 at 14:06, on Zulip):

but what I mean is

lqd (Nov 20 2019 at 14:07, on Zulip):

:)

nikomatsakis (Nov 20 2019 at 14:07, on Zulip):

I guess I think that with some effort we could probably find a "simplified" representation

lqd (Nov 20 2019 at 14:07, on Zulip):

I hoped we could write rust in unit tests and be able to test the polonius output, but wondered if "in-progress" work where we have to walk in lockstep between 2 wip branches would still be required anyway

nikomatsakis (Nov 20 2019 at 14:08, on Zulip):

In any case I don't think, sadly,

nikomatsakis (Nov 20 2019 at 14:08, on Zulip):

well I have q uestion actually

lqd (Nov 20 2019 at 14:08, on Zulip):

(which would also alleviate the need to store .facts in the repo for example)

nikomatsakis (Nov 20 2019 at 14:08, on Zulip):

hmm

nikomatsakis (Nov 20 2019 at 14:08, on Zulip):

I was going to suggest

nikomatsakis (Nov 20 2019 at 14:08, on Zulip):

maybe rustc should invoke a polonius executable

nikomatsakis (Nov 20 2019 at 14:08, on Zulip):

that may still be a good idea, I guess

nikomatsakis (Nov 20 2019 at 14:08, on Zulip):

it would at least allow us to rapidly iterate on polonius

nikomatsakis (Nov 20 2019 at 14:08, on Zulip):

but it wouldn't help if you need to tweak rustc fact generation

nikomatsakis (Nov 20 2019 at 14:09, on Zulip):

that said

nikomatsakis (Nov 20 2019 at 14:09, on Zulip):

I anticipate we may be leaving that phase soon

lqd (Nov 20 2019 at 14:09, on Zulip):

I guess it just means we can't have our out of tree cake and eat it too :)

nikomatsakis (Nov 20 2019 at 14:09, on Zulip):

once we have subset errors + initialization facts

nikomatsakis (Nov 20 2019 at 14:09, on Zulip):

I don't think there is much more data

lqd (Nov 20 2019 at 14:09, on Zulip):

yeah

nikomatsakis (Nov 20 2019 at 14:09, on Zulip):

anywaY I think it's probably something to ponder for later

nikomatsakis (Nov 20 2019 at 14:09, on Zulip):

more than try to address today

lqd (Nov 20 2019 at 14:10, on Zulip):

yeah agreed, in the meantime a combination of ergonomics improvement over the status quo could be enough

lqd (Nov 20 2019 at 14:10, on Zulip):

(some of which you might be able to see, and imagine, in the current PR)

nikomatsakis (Nov 20 2019 at 14:11, on Zulip):

One last thought though

nikomatsakis (Nov 20 2019 at 14:11, on Zulip):

when doing the NLL modeling early on

nikomatsakis (Nov 20 2019 at 14:12, on Zulip):

I had a setup that took as input a very simple set of input programs

nikomatsakis (Nov 20 2019 at 14:12, on Zulip):

with actions like X = ... and so forth

nikomatsakis (Nov 20 2019 at 14:12, on Zulip):

that was still really useful for modeling patterns and showing examples

nikomatsakis (Nov 20 2019 at 14:12, on Zulip):

I am basically imagining we might make a harness that takes a simple "Rust-like" input language

lqd (Nov 20 2019 at 14:12, on Zulip):

hmm I remember some of this

lqd (Nov 20 2019 at 14:13, on Zulip):

I wonder how far we are from this with the current test "programs" and otherwise whether we could reuse this machinery easily

nikomatsakis (Nov 20 2019 at 14:13, on Zulip):

I think we're .. "close-ish"

lqd (Nov 20 2019 at 14:14, on Zulip):

ah I may also be misremembering https://github.com/nikomatsakis/nll-souffle

lqd (Nov 20 2019 at 14:15, on Zulip):

ah most likely eg https://github.com/nikomatsakis/borrowck/blob/master/test/arielb1-loop-carry-drop.nll

lqd (Nov 20 2019 at 14:15, on Zulip):

yeah interesting

nikomatsakis (Nov 20 2019 at 14:16, on Zulip):

yes

nikomatsakis (Nov 20 2019 at 14:16, on Zulip):

that particular syntax etc evolved very organically

nikomatsakis (Nov 20 2019 at 14:16, on Zulip):

and I remember being annoyed with it :)

nikomatsakis (Nov 20 2019 at 14:17, on Zulip):

but I think we have a better idea what we want now

Last update: Dec 12 2019 at 00:55UTC