-
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
Normalize alloc-id in tests. #116767
Normalize alloc-id in tests. #116767
Conversation
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
aab070c
to
a8d90ba
Compare
@bors r+ p=1 bitrotty |
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`
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
☔ The latest upstream changes (presumably #114330) made this pull request unmergeable. Please resolve the merge conflicts. |
r=me after rebase and rebless |
a8d90ba
to
02424e4
Compare
@bors r=oli-obk |
Ah I didn't realize one PR is based on the other. Please mention that in the PR description. :) |
// 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. |
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.
// 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. |
src/tools/compiletest/src/runtest.rs
Outdated
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. |
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.
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 ╾─*
.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
42e3bd2
to
1f90d85
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (09df610): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 627.092s -> 626.723s (-0.06%) |
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>
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