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: New format_args!() representation #137294

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Feb 19, 2025

This is part of #99012

// TODO: description

@m-ou-se m-ou-se added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. A-fmt Area: `core::fmt` S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. labels Feb 19, 2025
@m-ou-se m-ou-se self-assigned this Feb 19, 2025
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 19, 2025
@m-ou-se m-ou-se removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 19, 2025
@m-ou-se
Copy link
Member Author

m-ou-se commented Feb 19, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 19, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 19, 2025
Experiment: New format_args!() representation

// TODO: description
@bors
Copy link
Contributor

bors commented Feb 19, 2025

⌛ Trying commit 87ac88f with merge 7e0e9f0...

@rust-log-analyzer

This comment has been minimized.

@m-ou-se m-ou-se force-pushed the fmt-args-2025 branch 2 times, most recently from e6dfd58 to d57fa21 Compare February 20, 2025 08:31
@rust-log-analyzer

This comment has been minimized.

@m-ou-se
Copy link
Member Author

m-ou-se commented Feb 20, 2025

@bors try

@bors
Copy link
Contributor

bors commented Feb 20, 2025

⌛ Trying commit 6dfd80e with merge 1885d10...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 20, 2025
Experiment: New format_args!() representation

This is part of rust-lang#99012

// TODO: description
@bors
Copy link
Contributor

bors commented Feb 20, 2025

☀️ Try build successful - checks-actions
Build commit: 1885d10 (1885d10e6da0f6b62959e91cc4ded55be400f537)

@rust-timer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-18 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#21 exporting to docker image format
#21 sending tarball 27.6s done
#21 DONE 40.9s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-18/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---


failures:

---- [mir-opt] tests/mir-opt/sroa/lifetimes.rs stdout ----
12       let _10: ();
13       let mut _11: std::fmt::Arguments<'_>;
14       let mut _12: core::fmt::rt::Template<'_>;
-       let mut _13: &[core::fmt::rt::Piece; 7];
-       let _14: &[core::fmt::rt::Piece; 7];
-       let _15: [core::fmt::rt::Piece; 7];
+       let mut _13: &[core::fmt::rt::Piece; 6];
+       let _14: &[core::fmt::rt::Piece; 6];
+       let _15: [core::fmt::rt::Piece; 6];
18       let mut _16: core::fmt::rt::Piece;
19       let mut _17: core::fmt::rt::Piece;
20       let mut _18: core::fmt::rt::Piece;
21       let mut _19: core::fmt::rt::Piece;
22       let mut _20: core::fmt::rt::Piece;
23       let mut _21: core::fmt::rt::Piece;
-       let mut _22: core::fmt::rt::Piece;
-       let mut _22: core::fmt::rt::Piece;
-       let mut _23: &[core::fmt::rt::Argument<'_>; 2];
-       let _24: &[core::fmt::rt::Argument<'_>; 2];
-       let _25: [core::fmt::rt::Argument<'_>; 2];
-       let mut _26: core::fmt::rt::Argument<'_>;
-       let mut _27: &std::boxed::Box<dyn std::fmt::Display>;
-       let _28: &std::boxed::Box<dyn std::fmt::Display>;
-       let mut _29: core::fmt::rt::Argument<'_>;
-       let mut _30: &u32;
-       let _31: &u32;
-       let mut _33: bool;
+       let mut _22: &[core::fmt::rt::Argument<'_>; 2];
+       let _23: &[core::fmt::rt::Argument<'_>; 2];
+       let _24: [core::fmt::rt::Argument<'_>; 2];
+       let mut _25: core::fmt::rt::Argument<'_>;
+       let mut _26: &std::boxed::Box<dyn std::fmt::Display>;
+       let _27: &std::boxed::Box<dyn std::fmt::Display>;
+       let mut _28: core::fmt::rt::Argument<'_>;
+       let mut _29: &u32;
+       let _30: &u32;
+       let mut _33: isize;
35       let mut _34: isize;
36       let mut _35: isize;
-       let mut _36: isize;
-       let mut _36: isize;
- +     let _37: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
- +     let _38: u32;
+ +     let _36: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
+ +     let _37: u32;
40       scope 1 {
41 -         debug foo => _1;
- +         debug ((foo: Foo<T>).0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>) => _37;
- +         debug ((foo: Foo<T>).1: u32) => _38;
+ +         debug ((foo: Foo<T>).0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>) => _36;
+ +         debug ((foo: Foo<T>).1: u32) => _37;
44           let _5: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
45           scope 2 {
46               debug x => _5;
50                   scope 4 {
50                   scope 4 {
51                       debug x => _8;
52                       let _8: std::boxed::Box<dyn std::fmt::Display>;
-                       let mut _32: &[core::fmt::rt::Piece; 7];
+                       let mut _31: &[core::fmt::rt::Piece; 6];
55               }
56           }

57       }
---
64 +         nop;
65           StorageLive(_2);
66           StorageLive(_3);

74           _2 = Result::<Box<dyn std::fmt::Display>, <T as Err>::Err>::Ok(move _3);
75           StorageDead(_3);
76 -         _1 = Foo::<T> { x: move _2, y: const 7_u32 };
- +         _37 = move _2;
- +         _38 = const 7_u32;
+ +         _36 = move _2;
+ +         _37 = const 7_u32;
79 +         nop;
81           StorageLive(_5);

-           _33 = const true;
+           _32 = const true;
+           _32 = const true;
83 -         _5 = move (_1.0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>);
- +         _5 = move _37;
+ +         _5 = move _36;
86 -         _6 = copy (_1.1: u32);
- +         _6 = copy _38;
+ +         _6 = copy _37;
+ +         _6 = copy _37;
88           _7 = discriminant(_5);
89           switchInt(move _7) -> [0: bb2, otherwise: bb8];

91   
92       bb2: {
93           StorageLive(_8);
93           StorageLive(_8);
-           _33 = const false;
+           _32 = const false;
95           _8 = move ((_5 as Ok).0: std::boxed::Box<dyn std::fmt::Display>);
97           StorageLive(_10);

99           StorageLive(_12);
100           StorageLive(_13);
100           StorageLive(_13);
101           StorageLive(_14);
-           _32 = const foo::<T>::promoted[0];
-           _14 = &(*_32);
+           _31 = const foo::<T>::promoted[0];
+           _14 = &(*_31);
104           _13 = &(*_14);
-           _12 = core::fmt::rt::Template::<'_>::new::<7>(move _13) -> [return: bb3, unwind unreachable];
+           _12 = core::fmt::rt::Template::<'_>::new::<6>(move _13) -> [return: bb3, unwind unreachable];
107   
108       bb3: {

109           StorageDead(_13);
---

113           StorageLive(_26);
114           StorageLive(_27);
-           StorageLive(_28);
-           _28 = &_8;
-           _27 = &(*_28);
-           _26 = core::fmt::rt::Argument::<'_>::new_display::<Box<dyn std::fmt::Display>>(move _27) -> [return: bb4, unwind unreachable];
+           _27 = &_8;
+           _26 = &(*_27);
+           _25 = core::fmt::rt::Argument::<'_>::new_display::<Box<dyn std::fmt::Display>>(move _26) -> [return: bb4, unwind unreachable];
120   
121       bb4: {

-           StorageDead(_27);
-           StorageDead(_27);
+           StorageDead(_26);
+           StorageLive(_28);
123           StorageLive(_29);
124           StorageLive(_30);
-           StorageLive(_31);
-           _31 = &_6;
-           _30 = &(*_31);
-           _29 = core::fmt::rt::Argument::<'_>::new_display::<u32>(move _30) -> [return: bb5, unwind unreachable];
+           _30 = &_6;
+           _29 = &(*_30);
+           _28 = core::fmt::rt::Argument::<'_>::new_display::<u32>(move _29) -> [return: bb5, unwind unreachable];
130   
131       bb5: {

-           StorageDead(_30);
-           StorageDead(_30);
-           _25 = [move _26, move _29];
-           StorageDead(_26);
-           _24 = &_25;
-           _23 = &(*_24);
-           _23 = &(*_24);
-           _11 = Arguments::<'_>::new::<2>(move _12, move _23) -> [return: bb6, unwind unreachable];
+           _24 = [move _25, move _28];
+           StorageDead(_25);
+           _23 = &_24;
+           _22 = &(*_23);
+           _22 = &(*_23);
+           _11 = Arguments::<'_>::new::<2>(move _12, move _22) -> [return: bb6, unwind unreachable];
140   
141       bb6: {

-           StorageDead(_23);
-           StorageDead(_23);
+           StorageDead(_22);
143           StorageDead(_12);
144           _10 = _eprint(move _11) -> [return: bb7, unwind unreachable];

146   
147       bb7: {
148           StorageDead(_11);
---

170   
171       bb10: {
172           StorageDead(_6);
-           _34 = discriminant(_5);
-           switchInt(move _34) -> [0: bb12, otherwise: bb14];
+           _33 = discriminant(_5);
+           switchInt(move _33) -> [0: bb12, otherwise: bb14];
176   
177       bb11: {

-           _33 = const false;
---
184           return;
185       }

186   
187       bb12: {
-           switchInt(copy _33) -> [0: bb11, otherwise: bb13];
+           switchInt(copy _32) -> [0: bb11, otherwise: bb13];
190   
191       bb13: {



thread '[mir-opt] tests/mir-opt/sroa/lifetimes.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:93:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff


failures:
    [mir-opt] tests/mir-opt/sroa/lifetimes.rs

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1885d10): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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 may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try 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-perf +perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
1.0% [0.2%, 6.7%] 169
Regressions ❌
(secondary)
1.0% [0.4%, 2.4%] 31
Improvements ✅
(primary)
-0.9% [-1.6%, -0.3%] 15
Improvements ✅
(secondary)
-0.5% [-1.3%, -0.2%] 18
All ❌✅ (primary) 0.9% [-1.6%, 6.7%] 184

Max RSS (memory usage)

Results (primary 2.2%, secondary 4.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.8% [1.2%, 7.0%] 21
Regressions ❌
(secondary)
4.1% [2.4%, 7.0%] 3
Improvements ✅
(primary)
-4.3% [-4.8%, -3.9%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.2% [-4.8%, 7.0%] 23

Cycles

Results (primary 1.7%, secondary 2.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.0% [1.0%, 4.8%] 28
Regressions ❌
(secondary)
2.4% [2.0%, 2.8%] 5
Improvements ✅
(primary)
-1.1% [-1.2%, -1.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.7% [-1.2%, 4.8%] 30

Binary size

Results (primary -0.2%, secondary -0.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.0%, 3.8%] 35
Regressions ❌
(secondary)
1.0% [0.1%, 3.9%] 19
Improvements ✅
(primary)
-0.5% [-2.1%, -0.0%] 82
Improvements ✅
(secondary)
-0.6% [-1.2%, -0.4%] 43
All ❌✅ (primary) -0.2% [-2.1%, 3.8%] 117

Bootstrap: 773.474s -> 773.677s (0.03%)
Artifact size: 360.26 MiB -> 359.61 MiB (-0.18%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Feb 20, 2025
@bors
Copy link
Contributor

bors commented Mar 5, 2025

☔ The latest upstream changes (presumably #138058) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-fmt Area: `core::fmt` perf-regression Performance regression. S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants