fix: Check the fallback map before queueing child in visible_parent_map breadth-first search - #160464
Conversation
|
r? @nnethercote rustbot has assigned @nnethercote. Use Why was this reviewer chosen?The reviewer was selected based on:
|
visible_parent_map breadth-first-searchvisible_parent_map breadth-first search
|
@rustbot label +perf-regression |
|
Actually, after looking at PRs labeled @rustbot label -perf-regression |
|
That makes me think, maybe we could have a perf job that runs rustdoc on Cc @Kobzol |
|
Huh, those CI failures on Is my reading correct that the CI failure seems unrelated to this change and could be caused by something else? |
|
Looks like that job may be having some issues #t-infra > Tree ops @ 💬 |
This comment has been minimized.
This comment has been minimized.
We do actually run rustdoc on libc on every merge :) https://perf.rust-lang.org/compare.html?debug=false&check=false&opt=false&nonRelevant=true |
|
Oh I was wondering why it didn't show up in https://perf.rust-lang.org/compare.html?start=b04d3c8c22822b7f10dab5a563b4e2afff1861c1&end=28c66af27578a28bc8cad1c5957be4b1e2e7fb8b&stat=instructions%3Au&nonRelevant=true&opt=false&debug=false&check=false&doc-json=false. But testing again locally, it looks like @zalanlevai if you have a build locally, |
|
Thank you @tgross35 for the reproducer! I can confirm that running |
|
Should I force CI checks to re-run on this PR, now that the |
|
Yeah, you can just repush the latest commit. |
464edf2 to
45cd627
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
I'm going to pass this on to the reviewer of #159881: r? @fee1-dead |
|
Reminder, once the PR becomes ready for a review, use |
45cd627 to
640032d
Compare
|
I have made the change we discussed. I also found a way to test the behaviour through path printing in diagnostics. Just like with regular entries, we expect to store the topmost fallback entry in the BFS to produce the shortest visible paths. This condition was failed for fallback items before this change. The added regression test checks that we do not override fallback entries with later ones by ensuring that we use the shortest available fallback path. @rustbot ready |
…fallback-entry-check, r=oli-obk fix: Check the fallback map before queueing child in `visible_parent_map` breadth-first search The fix in rust-lang#159881 extended the `visible_parent_map` breadth-first search (BFS) to include items nested within "fallback" items, such as `#[doc(hidden)]` modules and re-exports. However, the fix resulted in fallback entries not being checked before enqueueing new items into the BFS, resulting in fallback items being explored in the BFS multiple times, once for each fallback parent, up until a non-fallback visible parent is found instead, if any. This PR adds a check before new fallback items are recorded and the BFS queue is extended that ensures that the item has not already been searched through a fallback parent item. Fixes the `libc` performance regression described in rust-lang#160439. (Fixes rust-lang#160439.) Unfortunately, I could not think of a way to write a test case that covers the regression that this PR fixes, as it would require a massive crate with a very large number of "fallback" parents, and the test would be performance-based.
…fallback-entry-check, r=oli-obk fix: Check the fallback map before queueing child in `visible_parent_map` breadth-first search The fix in rust-lang#159881 extended the `visible_parent_map` breadth-first search (BFS) to include items nested within "fallback" items, such as `#[doc(hidden)]` modules and re-exports. However, the fix resulted in fallback entries not being checked before enqueueing new items into the BFS, resulting in fallback items being explored in the BFS multiple times, once for each fallback parent, up until a non-fallback visible parent is found instead, if any. This PR adds a check before new fallback items are recorded and the BFS queue is extended that ensures that the item has not already been searched through a fallback parent item. Fixes the `libc` performance regression described in rust-lang#160439. (Fixes rust-lang#160439.) Unfortunately, I could not think of a way to write a test case that covers the regression that this PR fixes, as it would require a massive crate with a very large number of "fallback" parents, and the test would be performance-based.
…fallback-entry-check, r=oli-obk fix: Check the fallback map before queueing child in `visible_parent_map` breadth-first search The fix in rust-lang#159881 extended the `visible_parent_map` breadth-first search (BFS) to include items nested within "fallback" items, such as `#[doc(hidden)]` modules and re-exports. However, the fix resulted in fallback entries not being checked before enqueueing new items into the BFS, resulting in fallback items being explored in the BFS multiple times, once for each fallback parent, up until a non-fallback visible parent is found instead, if any. This PR adds a check before new fallback items are recorded and the BFS queue is extended that ensures that the item has not already been searched through a fallback parent item. Fixes the `libc` performance regression described in rust-lang#160439. (Fixes rust-lang#160439.) Unfortunately, I could not think of a way to write a test case that covers the regression that this PR fixes, as it would require a massive crate with a very large number of "fallback" parents, and the test would be performance-based.
…fallback-entry-check, r=oli-obk fix: Check the fallback map before queueing child in `visible_parent_map` breadth-first search The fix in rust-lang#159881 extended the `visible_parent_map` breadth-first search (BFS) to include items nested within "fallback" items, such as `#[doc(hidden)]` modules and re-exports. However, the fix resulted in fallback entries not being checked before enqueueing new items into the BFS, resulting in fallback items being explored in the BFS multiple times, once for each fallback parent, up until a non-fallback visible parent is found instead, if any. This PR adds a check before new fallback items are recorded and the BFS queue is extended that ensures that the item has not already been searched through a fallback parent item. Fixes the `libc` performance regression described in rust-lang#160439. (Fixes rust-lang#160439.) Unfortunately, I could not think of a way to write a test case that covers the regression that this PR fixes, as it would require a massive crate with a very large number of "fallback" parents, and the test would be performance-based.
…uwer Rollup of 17 pull requests Successful merges: - #159530 (Cap socket send length to c_int::MAX on Apple targets) - #159506 (Allow associated const equality constraints with GCA) - #160006 (Account for desugaring in method call move errors) - #160415 (Split `aarch64-apple{,-macos-26}` => `aarch64-apple{,-macos-26}-{1,2}` jobs) - #160464 (fix: Check the fallback map before queueing child in `visible_parent_map` breadth-first search) - #160555 (Split `apply_primary_terminator_effect`) - #160592 (Suggest if-let chain continuation on unclosed delimiter) - #160600 (Avoid the std DLL copy alongside rustc) - #160156 (check_consts: exhaustively match on CastKind) - #160211 (Rename `#[unroll]` => `#[rustc_unroll]` to mitigate nameres ambiguity) - #160304 (Add tests for fixed new solver issues) - #160398 (rustc_abi: Add `LayoutData::is_variant_uninhabited` method) - #160546 (Update error message in documentation comments) - #160568 (Use `VisitorResult` helper macros) - #160571 (Add regression test for array type recovery in generic arguments) - #160588 (add a test showing polonius alpha is not a subset of datalog polonius) - #160617 (Add a suggestion to MissingUnsafeOnExtern diagnostic)
Rollup merge of #160464 - zalanlevai:fix-visible-parent-map-fallback-entry-check, r=oli-obk fix: Check the fallback map before queueing child in `visible_parent_map` breadth-first search The fix in #159881 extended the `visible_parent_map` breadth-first search (BFS) to include items nested within "fallback" items, such as `#[doc(hidden)]` modules and re-exports. However, the fix resulted in fallback entries not being checked before enqueueing new items into the BFS, resulting in fallback items being explored in the BFS multiple times, once for each fallback parent, up until a non-fallback visible parent is found instead, if any. This PR adds a check before new fallback items are recorded and the BFS queue is extended that ensures that the item has not already been searched through a fallback parent item. Fixes the `libc` performance regression described in #160439. (Fixes #160439.) Unfortunately, I could not think of a way to write a test case that covers the regression that this PR fixes, as it would require a massive crate with a very large number of "fallback" parents, and the test would be performance-based.
|
@rust-timer build e577f4b |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (e577f4b): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -6.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeResults (secondary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 458.35s -> 458.321s (-0.01%) |
View all comments
The fix in #159881 extended the
visible_parent_mapbreadth-first search (BFS) to include items nested within "fallback" items, such as#[doc(hidden)]modules and re-exports. However, the fix resulted in fallback entries not being checked before enqueueing new items into the BFS, resulting in fallback items being explored in the BFS multiple times, once for each fallback parent, up until a non-fallback visible parent is found instead, if any.This PR adds a check before new fallback items are recorded and the BFS queue is extended that ensures that the item has not already been searched through a fallback parent item.
Fixes the
libcperformance regression described in #160439. (Fixes #160439.)Unfortunately, I could not think of a way to write a test case that covers the regression that this PR fixes, as it would require a massive crate with a very large number of "fallback" parents, and the test would be performance-based.