8

Add config.toml options for enabling overflow checks in rustc and std by hkratz...

 3 years ago
source link: https://github.com/rust-lang/rust/pull/87784
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Copy link

Contributor

hkratz commented 11 days ago

The names are overflow-checks and overflow-checks-std and they work similar to debug-assertions and debug-assertions-std. Once added we can measure how big the performance impact actually is and maybe enable them for CI tests.

Enabling them already makes two ui tests fail:

failures:
    [ui] ui/parser/item-free-const-no-body-semantic-fail.rs
    [ui] ui/parser/item-free-static-no-body-semantic-fail.rs

(See #84219 and #87761.)

Copy link

Collaborator

rust-highfive commented 11 days ago

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

hkratz

changed the title Add options for enabling overflow checks in rustc and std in config.toml

Add config.toml options for enabling overflow checks in rustc and std

11 days ago

Copy link

Contributor

Author

hkratz commented 10 days ago

Performance impact for running the full stage 1 testsuite locally is less than I expected:

# With fix from #87761 for the failing tests.
./x.py clean; time ./x.py test --stage 1

# no checks:
real	23m19.492s
user	176m22.251s
sys	20m28.837s

# w/ overflow checks in everything but std:
real	23m26.973s
user	176m50.005s
sys	20m32.393s

# w/ overflow checks in everything:
real	23m57.156s
user	181m20.771s
sys	21m25.673s

Could you change them to default to true in this PR temporarily, so we can run perf on this PR? I think if we can get away with not exposing this as an option (and instead always enabling them) we should.

Copy link

Contributor

Author

hkratz commented 10 days ago

Could you change them to default to true in this PR temporarily, so we can run perf on this PR? I think if we can get away with not exposing this as an option (and instead always enabling them) we should.

@Mark-Simulacrum Done. This should be ready for a perf test.

Copy link

Collaborator

rust-timer commented 10 days ago

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

Copy link

Contributor

bors commented 10 days ago

hourglass Trying commit 72ada17 with merge f9bbcb1...

Copy link

Contributor

bors commented 10 days ago

sunny Try build successful - checks-actions
Build commit: f9bbcb1 (f9bbcb152f7bd5dba5923c3c42999ee3c78aae98)

Copy link

Collaborator

rust-timer commented 10 days ago

Copy link

Collaborator

rust-timer commented 10 days ago

Finished benchmarking try commit (f9bbcb1): comparison url.

Summary: This change led to significant regressions crying_cat_face in compiler performance.

  • Very large regression in instruction counts (up to 23.8% on incr-unchanged builds of ctfe-stress-4-check)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

Copy link

Contributor

Author

hkratz commented 10 days ago

Hmm, at least now we know.

(Sorry the Close and Reopen was an accident on my mobile)

Could you drop the enablement for std and we can rerun benchmarks? I'd be interested in just rustc enablement impact.

I expect it'd be interesting to work out if there's just a few adds or whatever we can replace with explicit wrapping adds (with comments about performance or so). But that's a larger project, I just want numbers for now on the rustc-only overflow checks and we can likely merge after that.

Copy link

Contributor

Author

hkratz commented 10 days ago

@Mark-Simulacrum Ready for perf testing.

Copy link

Collaborator

rust-timer commented 10 days ago

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

Copy link

Contributor

bors commented 10 days ago

hourglass Trying commit 1ee9083 with merge d570e77cc2384b466568c2ebc072def445db0f1b...

Copy link

Contributor

bors commented 10 days ago

sunny Try build successful - checks-actions
Build commit: d570e77 (d570e77cc2384b466568c2ebc072def445db0f1b)

Copy link

Collaborator

rust-timer commented 10 days ago

Copy link

Collaborator

rust-timer commented 10 days ago

Finished benchmarking try commit (d570e77): comparison url.

Summary: This change led to significant regressions crying_cat_face in compiler performance.

  • Very large regression in instruction counts (up to 21.4% on incr-unchanged builds of ctfe-stress-4-check)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

Alright, thanks! Looks like neither is an option for now as default, so if you can drop the testing commits we can probably merge (I'll give another glance over the code but don't think there's likely to be more work before merging).

hkratz

force-pushed the

rusticstuff:bootstrap_config_overflow_checks

branch from 1ee9083 to 7f34b96

10 days ago

r=me after last nit is fixed

hkratz

force-pushed the

rusticstuff:bootstrap_config_overflow_checks

branch from 7f34b96 to 2f70953

9 days ago

@bors r+

Thanks!

Copy link

Contributor

bors commented 9 days ago

pushpin Commit 2f70953 has been approved by Mark-Simulacrum

Copy link

Contributor

bors commented 9 days ago

hourglass Testing commit 2f70953 with merge 24380a6...

Copy link

Contributor

bors commented 9 days ago

sunny Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 24380a6 to master...

bors

merged commit 24380a6 into rust-lang:master 9 days ago

11 checks passed

rustbot

added this to the 1.56.0 milestone

9 days ago

hkratz

deleted the

rusticstuff:bootstrap_config_overflow_checks

branch

9 days ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects

None yet

Milestone

1.56.0

Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK