-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add config.toml options for enabling overflow checks in rustc and std #87784
Add config.toml options for enabling overflow checks in rustc and std #87784
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Performance impact for running the full stage 1 testsuite locally is less than I expected:
|
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. |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 72ada176db4853c7fb922e4b3efbdcb2b7df655c with merge f9bbcb152f7bd5dba5923c3c42999ee3c78aae98... |
☀️ Try build successful - checks-actions |
Queued f9bbcb152f7bd5dba5923c3c42999ee3c78aae98 with parent e21e1d6, future comparison URL. |
Finished benchmarking try commit (f9bbcb152f7bd5dba5923c3c42999ee3c78aae98): comparison url. Summary: This change led to significant regressions 😿 in compiler performance.
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 @bors rollup=never |
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. |
@Mark-Simulacrum Ready for perf testing. |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 1ee9083f12cf38e66e4c7bf2fc18a2d1c062f5ee with merge d570e77cc2384b466568c2ebc072def445db0f1b... |
☀️ Try build successful - checks-actions |
Queued d570e77cc2384b466568c2ebc072def445db0f1b with parent 2f07ae4, future comparison URL. |
Finished benchmarking try commit (d570e77cc2384b466568c2ebc072def445db0f1b): comparison url. Summary: This change led to significant regressions 😿 in compiler performance.
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 @bors rollup=never |
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). |
1ee9083
to
7f34b96
Compare
r=me after last nit is fixed |
The options are `overflow-checks` and `overflow-checks-std` defaulting to false.
7f34b96
to
2f70953
Compare
@bors r+ Thanks! |
📌 Commit 2f70953 has been approved by |
☀️ Test successful - checks-actions |
@@ -968,6 +976,8 @@ impl Config { | |||
config.rust_debug_assertions = debug_assertions.unwrap_or(default); | |||
config.rust_debug_assertions_std = | |||
debug_assertions_std.unwrap_or(config.rust_debug_assertions); | |||
config.rust_overflow_checks = overflow_checks.unwrap_or(default); | |||
config.rust_overflow_checks_std = overflow_checks_std.unwrap_or(default); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be .unwrap_or(rust_overflow_checks)
? Otherwise overflow_checks = true
won't actually enable it for the standard library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that too while working on #89776. It would be more in line with how rust_debug_assertions
and rust_debug_assertions_std
behave.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will put that and the stuff missing from config.toml.example
and configure.py
into a followup PR.
…take-two, r=Mark-Simulacrum Fix config.toml overflow-checks options This a follow-up PR to rust-lang#87784. Improvements: * Add missing entries for overflow-checks to config.toml.example. * Add --enable-overflow-checks-std option to configure script. * Make rust.overflow-checks-stdoption default to rust.overflow-checks. Also adds the missing `--enable-debug-assertions-std `option to configure script. r? `@Mark-Simulacrum` cc `@jyn514`
…take-two, r=Mark-Simulacrum Fix config.toml overflow-checks options This a follow-up PR to rust-lang#87784. Improvements: * Add missing entries for overflow-checks to config.toml.example. * Add --enable-overflow-checks-std option to configure script. * Make rust.overflow-checks-stdoption default to rust.overflow-checks. Also adds the missing `--enable-debug-assertions-std `option to configure script. r? ``@Mark-Simulacrum`` cc ``@jyn514``
…take-two, r=Mark-Simulacrum Fix config.toml overflow-checks options This a follow-up PR to rust-lang#87784. Improvements: * Add missing entries for overflow-checks to config.toml.example. * Add --enable-overflow-checks-std option to configure script. * Make rust.overflow-checks-stdoption default to rust.overflow-checks. Also adds the missing `--enable-debug-assertions-std `option to configure script. r? ```@Mark-Simulacrum``` cc ```@jyn514```
The names are
overflow-checks
andoverflow-checks-std
and they work similar todebug-assertions
anddebug-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:
(See #84219 and #87761.)