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

[experiment] rustc_mir: remove #![type_length_limit] checks. #76772

Closed
wants to merge 1 commit into from

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Sep 15, 2020

The first time we started doubting the usefulness of this check was in #54540, but it's been showing up more.

I've since learned that the PR which added this (#37789) did fix a real issue (#37311) but IMO it's not the most efficient solution (we could instead e.g. periodically warn that monomorphization collection is still ongoing, and that it could indicate an accidental generic blowup), though we may not have anything better in general.

Nevertheless, I think it's a good idea to try this out, even if it may be too late for certain regressions.

This PR was specifically prompted by @hawkw running into a slowdown which may be caused by the #![type_length_limit] check, but we don't really know much for certain yet (and a try build is the easiest comparison that has some guarantees of fairness, plus we can get the perf run results).

cc @nikomatsakis @pnkfelix @arielb1 @lcnr

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 15, 2020
@eddyb
Copy link
Member Author

eddyb commented Sep 15, 2020

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Sep 15, 2020

⌛ Trying commit 688ec8c with merge dd5d681da665963dde4cc4561bcfc4d348beb75b...

@jyn514 jyn514 added A-typesystem Area: The type system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 16, 2020
@bors
Copy link
Contributor

bors commented Sep 16, 2020

☀️ Try build successful - checks-actions, checks-azure
Build commit: dd5d681da665963dde4cc4561bcfc4d348beb75b (dd5d681da665963dde4cc4561bcfc4d348beb75b)

@rust-timer
Copy link
Collaborator

Queued dd5d681da665963dde4cc4561bcfc4d348beb75b with parent 6af1bdd, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (dd5d681da665963dde4cc4561bcfc4d348beb75b): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never

@eddyb
Copy link
Member Author

eddyb commented Sep 16, 2020

So 1% at best, and only on incr-unchanged runs. Also, from what I'm hearing, it doesn't help much (even if it does lower compile times a bit) for the usecase that motivated this PR.

Perhaps we could test further on some of the reported regressions?

@petrochenkov
Copy link
Contributor

r? @nikomatsakis

@camelid
Copy link
Member

camelid commented Oct 5, 2020

@eddyb It appears there are merge conflicts.

@camelid camelid added the A-mir Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html label Oct 5, 2020
@nikomatsakis
Copy link
Contributor

So chalk uses a type-length limit test but in a different way. Instead of forbidding types completely, it "just" causes trait solving to yield ambiguous results when types are getting too big.

@nikomatsakis
Copy link
Contributor

Closing this as it's a super old experiment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-typesystem Area: The type system S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants