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

Normalize alloc-id in tests. #116767

Merged
merged 5 commits into from
Oct 17, 2023
Merged

Normalize alloc-id in tests. #116767

merged 5 commits into from
Oct 17, 2023

Conversation

cjgillot
Copy link
Contributor

AllocIds are globally numbered in a rustc invocation. This makes them very sensitive to changes unrelated to what is being tested. This commit normalizes them by renumbering, in order of appearance in the output.

The renumbering allows to keep the identity, that a simple allocN wouldn't. This is useful when we have memory dumps.

cc @saethlin
r? @oli-obk

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 15, 2023
@rustbot
Copy link
Collaborator

rustbot commented Oct 15, 2023

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 16, 2023

@bors r+ p=1 bitrotty

@bors
Copy link
Contributor

bors commented Oct 16, 2023

📌 Commit a8d90ba has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 16, 2023
@bors
Copy link
Contributor

bors commented Oct 16, 2023

⌛ Testing commit a8d90ba with merge 1c5c949...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 16, 2023
Normalize alloc-id in tests.

AllocIds are globally numbered in a rustc invocation. This makes them very sensitive to changes unrelated to what is being tested. This commit normalizes them by renumbering, in order of appearance in the output.

The renumbering allows to keep the identity, that a simple `allocN` wouldn't. This is useful when we have memory dumps.

cc `@saethlin`
r? `@oli-obk`
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 16, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 16, 2023
@bors
Copy link
Contributor

bors commented Oct 16, 2023

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

@oli-obk
Copy link
Contributor

oli-obk commented Oct 16, 2023

r=me after rebase and rebless

@cjgillot
Copy link
Contributor Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Oct 16, 2023

📌 Commit 02424e4 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 16, 2023
@RalfJung
Copy link
Member

Ah I didn't realize one PR is based on the other. Please mention that in the PR description. :)

Comment on lines +4262 to +4263
// depending on the exact compilation flags and host architecture. Meanwhile, we want
// to keep them numbered, to see if the same id appears multiple times.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// depending on the exact compilation flags and host architecture. Meanwhile, we want
// to keep them numbered, to see if the same id appears multiple times.
// depending on the exact compilation flags and host architecture. We want
// to normalize those differences away. Meanwhile, we want to keep
// the allocations numbered, to see if the same id appears multiple times.
// So we remap to deterministic numbers that only depend on the subset
// of allocations that actually appears in the output.

let index = caps.get(2).unwrap().as_str().to_string();
let (index, _) = seen_allocs.insert_full(index);
write!(&mut ret, "{index}").unwrap();
// If we have a tail finishing with `─`, this means pretty-printing.
Copy link
Member

@RalfJung RalfJung Oct 16, 2023

Choose a reason for hiding this comment

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

There could be 0 but then a final . That doesn't seem to be handled?
Also the number of can vary, since it might be alloc9 vs alloc10. So you probably want to eat all the trailing ─*╼ and replace them by something deterministic.

And same for the leading ╾─*.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@cjgillot cjgillot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 17, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Oct 17, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Oct 17, 2023

📌 Commit 1f90d85 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 17, 2023
@bors
Copy link
Contributor

bors commented Oct 17, 2023

⌛ Testing commit 1f90d85 with merge 09df610...

@bors
Copy link
Contributor

bors commented Oct 17, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 09df610 to master...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (09df610): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

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% [2.8%, 2.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.8% [2.8%, 2.8%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 627.092s -> 626.723s (-0.06%)
Artifact size: 305.13 MiB -> 305.15 MiB (0.01%)

@cjgillot cjgillot deleted the alloc-normalize branch October 18, 2023 06:06
bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request Oct 18, 2023
57: Pull upstream master 2023 10 18 r=pietroalbini a=Veykril

* rust-lang/rust#116505
* rust-lang/rust#116840
* rust-lang/rust#116767
* rust-lang/rust#116855
  * rust-lang/rust#116827
  * rust-lang/rust#116787
  * rust-lang/rust#116719
  * rust-lang/rust#116717
  * rust-lang/rust#111072
* rust-lang/rust#116844
* rust-lang/rust#115577
* rust-lang/rust#116756
* rust-lang/rust#116518



Co-authored-by: Urgau <urgau@numericable.fr>
Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
Co-authored-by: Deadbeef <ent3rm4n@gmail.com>
Co-authored-by: Ralf Jung <post@ralfj.de>
Co-authored-by: Camille GILLOT <gillot.camille@gmail.com>
Co-authored-by: Celina G. Val <celinval@amazon.com>
Co-authored-by: Nicholas Nethercote <n.nethercote@gmail.com>
Co-authored-by: Arthur Lafrance <lafrancearthur@gmail.com>
Co-authored-by: Nikolay Arhipov <n@arhipov.net>
Co-authored-by: Nikita Popov <npopov@redhat.com>
Co-authored-by: bors <bors@rust-lang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

7 participants