Closed xFrednet closed 3 days ago
The job x86_64-gnu-llvm-17
failed! Check out the build log: (web) (plain)
It's green :D
Now let's see bors destroy all my hopes and dreams. /s JK love you bors
@bors try
:hourglass: Trying commit 813c97a401764cabf8291f2b28da2af33b47bd3b with merge 541a4da3b58309ad64ca0d6b33aabfba94b445bb...
:sunny: Try build successful - checks-actions
Build commit: 541a4da3b58309ad64ca0d6b33aabfba94b445bb (541a4da3b58309ad64ca0d6b33aabfba94b445bb
)
@craterbot run mode=clippy
:ok_hand: Experiment pr-124756
created and queued.
:robot: Automatically detected try build 541a4da3b58309ad64ca0d6b33aabfba94b445bb
:mag: You can check out the queue and this experiment's details.
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
@craterbot abort
Need to add clippy to try CI.
:wastebasket: Experiment pr-124756
deleted!
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
@bors try
:hourglass: Trying commit 4d7e11d65d6559f1d9c2a424ddbc1c03b099aa81 with merge a353969eafa00eade807d5bd90455d3bc3e4a489...
:sunny: Try build successful - checks-actions
Build commit: a353969eafa00eade807d5bd90455d3bc3e4a489 (a353969eafa00eade807d5bd90455d3bc3e4a489
)
@craterbot run mode=clippy
:ok_hand: Experiment pr-124756
created and queued.
:robot: Automatically detected try build a353969eafa00eade807d5bd90455d3bc3e4a489
:mag: You can check out the queue and this experiment's details.
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
@craterbot p=1
:memo: Configuration of the pr-124756
experiment changed.
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
Thank you @Mark-Simulacrum, now it will run before the beta-1.79-2
test, should be increase the prio of that one to make sure that it runs first or is it not time critical?
:construction: Experiment pr-124756
is now running
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
:tada: Experiment pr-124756
is completed!
:bar_chart: 30230 regressed and 17032 fixed (446250 total)
:newspaper: Open the full report.
:warning: If you notice any spurious failure please add them to the blacklist! :information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
I'm closing this since the experiment is done running. Thank you for kicking off crater!
Now I'll need to take some time to look at the data. :)
TL;DR: I want to collect data about ownership in Rust's ecosystem. I modified Clippy to extract things from MIR. This PR is intended for a crater run, but should definitely not be merged.
Roses are red, Violets are blue, Can I borrow, A pattern from you?
So, what is this project all about? Well, last year I was looking for a topic for my master's thesis. I had the incredible luck that the programming languages group at my university is not only a collection of incredibly cool people but also has some interest in Rust. It just so happens that @amandasystems is part of the group.
We then spent some time looking for a thesis project in the domain of Rust's memory ownership model, and finally settled on the idea to analyze how the memory ownership model is used in practice.
For Polonius, it could be interesting to know how many bodies contain borrows and if the changes from the NLL RFC are actually used, etc.
Implementation
Disclaimer, this PR contains some of the most convoluted and spaghettified code I've ever written. Do not use this as an example for anything! I'm pretty sure that the insufficiencies of this PR single-handedly increases the compile time by 100%. It's honestly a miracle that the whole thing doesn't ICE on every function.
So at the beginning, I decided to use MIR as that is the IR that the borrow check uses, and it contains all the borrows and moves which might not be explicit in the HIR. While all nice and good it turns out that MIR also gets writ of information which I would have wanted for my analysis.
To be clear, MIR is an excellent tool for what it was designed to do, but its loss of information has been a struggle for this project specifically.
I would like to collect way more metadata, more complex patterns, and data how named references are used, but the deadline for my thesis is coming up. We decided to limit the scope to named owned variables and see how the analysis goes. If I find some interesting things there is potential to extend this work.
Run
I decided to implement the analysis on Clippy for the shorter compile times and familiar codebase. This branch disables all other lints by default to safe on some runtime. The crater run with Clippy from master might also expose some ICEs which could be interesting for us.
The results of this will be aggregated and published as part of my thesis. The time imposed limitations of this implementation probably mean that the results have to be taken with a metric ton of salt, but they should be sufficient to pass my thesis and know if more work in this area would be interesting.
I don't know if there is much more too to say. Let's hope:
r? @ghost