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

coverage: Remove pending_dups from the span refiner #121261

Merged
merged 3 commits into from
Feb 22, 2024

Conversation

Zalathar
Copy link
Contributor

When extracting coverage spans from a function's MIR, we need to decide how to handle spans that are associated with more than one node (BCB) in the coverage control flow graph.

The existing code for managing those duplicate spans is very subtle and difficult to modify. But by eagerly deduplicating those extracted spans in a much simpler way, we can remove a massive chunk of complexity from the span refiner.

There is a tradeoff here, in that we no longer try to retain all nondominating BCBs that have the same span, only the last one in the (semi-arbitrary) dominance ordering. But in practice, this produces very little difference in our coverage tests, and the simplification is so significant that I think it's worthwhile.

@rustbot label +A-code-coverage

@rustbot
Copy link
Collaborator

rustbot commented Feb 18, 2024

r? @estebank

rustbot has assigned @estebank.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 18, 2024
@rustbot
Copy link
Collaborator

rustbot commented Feb 18, 2024

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label Feb 18, 2024
@Zalathar
Copy link
Contributor Author

The changes in #121019 and #121135 were a huge help here. I was surprised when I stumbled upon the fact that this is even possible.

@rust-log-analyzer

This comment has been minimized.

@Zalathar Zalathar force-pushed the pending-dups branch 2 times, most recently from 776684b to 0cf9973 Compare February 19, 2024 05:49
@oli-obk
Copy link
Contributor

oli-obk commented Feb 21, 2024

r? @oli-obk

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 21, 2024

📌 Commit 3a83b27 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 Feb 21, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 21, 2024
coverage: Remove `pending_dups` from the span refiner

When extracting coverage spans from a function's MIR, we need to decide how to handle spans that are associated with more than one node (BCB) in the coverage control flow graph.

The existing code for managing those duplicate spans is very subtle and difficult to modify. But by eagerly deduplicating those extracted spans in a much simpler way, we can remove a massive chunk of complexity from the span refiner.

There is a tradeoff here, in that we no longer try to retain *all* nondominating BCBs that have the same span, only the last one in the (semi-arbitrary) dominance ordering. But in practice, this produces very little difference in our coverage tests, and the simplification is so significant that I think it's worthwhile.

`@rustbot` label +A-code-coverage
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 21, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#119636 (os::net: expanding TcpStreamExt for Linux with `tcp_deferaccept`.)
 - rust-lang#121261 (coverage: Remove `pending_dups` from the span refiner)
 - rust-lang#121336 (triagebot: add queue notifications)
 - rust-lang#121391 (never patterns: Fix liveness analysis in the presence of never patterns)
 - rust-lang#121399 (Solaris linker does not support --strip-debug)
 - rust-lang#121406 (Add a couple tests)

Failed merges:

 - rust-lang#121206 (Top level error handling)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 22, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#121206 (Top level error handling)
 - rust-lang#121261 (coverage: Remove `pending_dups` from the span refiner)
 - rust-lang#121336 (triagebot: add queue notifications)
 - rust-lang#121373 (Consistently refer to a test's `revision` instead of `cfg`)
 - rust-lang#121391 (never patterns: Fix liveness analysis in the presence of never patterns)
 - rust-lang#121392 (Unify dylib loading between proc macros and codegen backends)
 - rust-lang#121399 (Solaris linker does not support --strip-debug)
 - rust-lang#121406 (Add a couple tests)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9949bbc into rust-lang:master Feb 22, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 22, 2024
Rollup merge of rust-lang#121261 - Zalathar:pending-dups, r=oli-obk

coverage: Remove `pending_dups` from the span refiner

When extracting coverage spans from a function's MIR, we need to decide how to handle spans that are associated with more than one node (BCB) in the coverage control flow graph.

The existing code for managing those duplicate spans is very subtle and difficult to modify. But by eagerly deduplicating those extracted spans in a much simpler way, we can remove a massive chunk of complexity from the span refiner.

There is a tradeoff here, in that we no longer try to retain *all* nondominating BCBs that have the same span, only the last one in the (semi-arbitrary) dominance ordering. But in practice, this produces very little difference in our coverage tests, and the simplification is so significant that I think it's worthwhile.

``@rustbot`` label +A-code-coverage
@Zalathar Zalathar deleted the pending-dups branch February 22, 2024 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants