Encode spans relative to the enclosing item -- enable on nightly#84762
Encode spans relative to the enclosing item -- enable on nightly#84762bors merged 8 commits intorust-lang:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
|
@bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
|
⌛ Trying commit 0cadd9de4986fb7044d22b242bf514ff674d9384 with merge 3c172eeb011b95ff8df485a4979d875ae919ce24... |
|
☀️ Try build successful - checks-actions |
|
Queued 3c172eeb011b95ff8df485a4979d875ae919ce24 with parent 8fef006, future comparison URL. |
|
Finished benchmarking try commit (3c172eeb011b95ff8df485a4979d875ae919ce24): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
|
@bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
|
⌛ Trying commit 8d7131dfdeb2f5d52207e2acb8566d1e906d6af8 with merge 0355bb6a9f6aca12079750fb694c0353bf2533b2... |
|
☀️ Try build successful - checks-actions |
|
Queued 0355bb6a9f6aca12079750fb694c0353bf2533b2 with parent e10cbc3, future comparison URL. |
|
Finished benchmarking try commit (0355bb6a9f6aca12079750fb694c0353bf2533b2): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
e6448db to
8fd8ff9
Compare
This comment has been minimized.
This comment has been minimized.
e5b631e to
8bb0a62
Compare
|
Team member @petrochenkov has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
|
Regarding performance, I think this should be enabled. But I'm a bit worried about the potential for subtle bugs here. Spans + incremental just has a track record of introducing those. Is there a way to get more real-world testing for the feature before it's enabled by default? Maybe enable it by default just on nightly for a couple of cycles? |
|
@michaelwoerister I agree. I can enable this on nightly only, and then by default in 1.70.0. |
|
Sounds good, @cjgillot 🙂 |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
@petrochenkov I had removed |
Not at all. |
I agree there should always be some "waiting on" status label. In this case, it would have been reasonable to apply S-waiting-on-fcp (rather than S-waiting-on-team), since that is specifically for PRs that have entered FCP and are going through the ten day final comment period. (And also because all but two of the team had indeed signed off already, so S-waiting-on-fcp is more accurate reflection of what we are waiting on, in my opinion.) |
Ah, okay, I haven't seen this label before. |
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
Using that options basically changes all stable hashes we may compute. Adding/removing as UNTRACKED it makes everything ICE (unstable fingerprint everywhere). As TRACKED, it can still do its job without ICEing.
This comment was marked as resolved.
This comment was marked as resolved.
The diagnostics are replayed at the correct place anyway.
|
@bors r+ |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (fb9dfa8): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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.
CyclesResultsThis 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.
|
|
This had what seems to be an unintended effect on JSON diagnostics: #106571. |
Follow-up to #84373 with the flag
-Zincremental-relative-spansset by default.This PR seeks to remove one of the main shortcomings of incremental: the handling of spans.
Changing the contents of a function may require redoing part of the compilation process for another function in another file because of span information is changed.
Within one file: all the spans in HIR change, so typechecking had to be re-done.
Between files: spans of associated types/consts/functions change, so type-based resolution needs to be re-done (hygiene information is stored in the span).
The flag
-Zincremental-relative-spansencodes local spans relative to the span of an item, stored inside thesource_spanquery.Trap: stashed diagnostics are referenced by the "raw" span, so stealing them requires to remove the span's parent.
In order to avoid too much traffic in the span interner, span encoding uses the
ctxt_or_tagfield to encode:SyntaxContextis 0;SyntaxContextwhen the parent isNone.Even with this, the PR creates a lot of traffic to the Span interner, when a Span has both a LocalDefId parent and a non-root SyntaxContext. They appear in lowering, when we add a parent to all spans, including those which come from macros, and during inlining when we mark inlined spans.
The last commit changes how queries of
LocalDefIdmanage their cache. I can put this in a separate PR if required.Possible future directions: