Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incr.comp.: Deduplicate some DepNodes and introduce anonymous DepNodes #43028

Merged
merged 10 commits into from
Jul 11, 2017

Conversation

michaelwoerister
Copy link
Member

This is a parallel PR to the pending #42769. It implements most of what is possible in terms of DepNode re-opening without having anonymous DepNodes yet (#42298).

r? @nikomatsakis

@@ -661,3 +661,60 @@ for ty::TypeckTables<'tcx> {
})
}
}

impl_stable_hash_for!(enum ty::fast_reject::SimplifiedType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why SimplifiedType? Seems ok though

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's used in the query key of relevant_trait_impls.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jul 7, 2017

📌 Commit 4ad0609 has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Jul 8, 2017

🔒 Merge conflict

@michaelwoerister michaelwoerister changed the title incr.comp.: Deduplicate some DepNodes incr.comp.: Deduplicate some DepNodes and introduce anonymous DepNodes Jul 10, 2017
@michaelwoerister
Copy link
Member Author

I pushed 3 more commits to this branch. They introduce anonymous DepNodes, move dep-graph management completely to the main thread and introduce caching of DepNodes in queries.

fn new(v: usize) -> IdIndex {
impl DepNodeIndex {

pub const INVALID: DepNodeIndex = DepNodeIndex { index: ::std::u32::MAX };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this is fine for now, but it'd be nicer to use Nonzero so that we can (efficiently) use Option<DepNodeIndex>, I suspect.

@nikomatsakis
Copy link
Contributor

So travis is failing because the log is too big. The log seems to include some DEBUG output, which is weird?

...
[00:48:05] DEBUG:rustc::session::filesearch: rejected /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/issue-2735-2.rs-stage2-x86_64-unknown-linux-gnu.stamp
[00:48:05] DEBUG:rustc::session::filesearch: testing /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/issue-20763-1.rs-stage2-x86_64-unknown-linux-gnu.stamp
[00:48:05] DEBUG:rustc::session::filesearch: rejected /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/issue-20763-1.rs-stage2-x86_64-unknown-linux-gnu.stamp
[00:48:05] DEBUG:rustc::session::filesearch: testing /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/issue-10638.out
[00:48:05] DEBUG:rustc::session::filesearch: rejected /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/issue-10638.out
[00:48:05] DEBUG:rustc::session::filesearch: testing /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/purity-infer.err
[00:48:

The log length has exceeded the limit of 4 MB (this usually means that the test suite is raising the same exception over and over).

@nikomatsakis
Copy link
Contributor

That said, the test that is failing probably enables the log, so i think the real problem is the test is failing for some reason:

[00:48:05] ---- [run-pass] run-pass/rustc-rust-log.rs stdout ----
[00:48:05] 	
[00:48:05] error: compilation failed!
[00:48:05] status: exit code: 101
[00:48:05] command: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc /checkout/src/test/run-pass/rustc-rust-log.rs -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass --target=x86_64-unknown-linux-gnu -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/rustc-rust-log.stage2-x86_64-unknown-linux-gnu.run-pass.libaux -C prefer-dynamic -o /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/rustc-rust-log.stage2-x86_64-unknown-linux-gnu -Crpath -O -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers
[00:48:05] stdout:
[00:48:05] ------------------------------------------
[00:48:05] 
[00:48:05] ------------------------------------------
[00:48:05] stderr:
[00:48:05] ------------------------------------------

@kennytm
Copy link
Member

kennytm commented Jul 10, 2017

@nikomatsakis The logs are part of the test's stderr.

// rustc-env:RUST_LOG=debug

fn main() {}

@nikomatsakis
Copy link
Contributor

@kennytm right, this is why I said I suspect the real problem is that the test fails in the first place.

@kennytm
Copy link
Member

kennytm commented Jul 10, 2017

Tried locally but not reproducible. Spurious I guess.

Compiler-test should probably filter the output so only the top and bottom 16 KB of text are printed out.

@nikomatsakis
Copy link
Contributor

@kennytm

Spurious I guess.

Huh. Can we test that hypothesis? I guess we can r+... maybe if we cycle travis?

@kennytm
Copy link
Member

kennytm commented Jul 10, 2017

@nikomatsakis r+ is one way. Owners of this repo could also go to Travis and restart the job, without accepting the PR.

Closing the PR and reopening it would also trigger a build.

screenshot_2017-07-11 02 18 05_crmd57

@nikomatsakis
Copy link
Contributor

@kennytm I am able to reproduce locally

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jul 10, 2017

📌 Commit 4f1f671 has been approved by nikomatsakis

@michaelwoerister
Copy link
Member Author

Thanks for fixing!

@bors
Copy link
Contributor

bors commented Jul 10, 2017

⌛ Testing commit 4f1f671 with merge 9228d23...

bors added a commit that referenced this pull request Jul 10, 2017
incr.comp.: Deduplicate some DepNodes and introduce anonymous DepNodes

This is a parallel PR to the pending #42769. It implements most of what is possible in terms of DepNode re-opening without having anonymous DepNodes yet (#42298).

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Jul 11, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 9228d23 to master...

@bors bors merged commit 4f1f671 into rust-lang:master Jul 11, 2017
@Mark-Simulacrum
Copy link
Member

@michaelwoerister
Copy link
Member Author

@Mark-Simulacrum, nice! Thanks for making me aware of that. Overall I expected this patch to make things 10% slower, but I seem to have tested only the worst case. Or difference gets more pronounced when turning off debug assertions (which I mostly do for performance testing).

@alexcrichton
Copy link
Member

It looks like this may have regressed another benchmark though :(

Was that expected though?

@michaelwoerister
Copy link
Member Author

Yes, that was expected. I'm surprised it doesn't show up in other benchmarks more. This should get better again when the current (humongous) refactoring is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants