-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Make create_def a side effect instead of marking the entire query as always red #115613
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
base: master
Are you sure you want to change the base?
Conversation
Another tricky case:
We wouldn't want to create 2 definitions where we only ask for one. |
Huh... why does that happen? Shouldn't we already be getting weird diagnostics in that case? |
This happens if we don't have the result of |
More precisely: the first call is |
The logic is the fallback case in |
Thanks. I really need to dig into |
I did some testing and a code dive, and I don't think that's what's happening.
|
|
yay, with this hint I was able to produce an example that actually exhibits an issue
oh wait... I even have this issue without doing any other changes to rustc. So it's not even ensure related yet |
☔ The latest upstream changes (presumably #115920) made this pull request unmergeable. Please resolve the merge conflicts. |
The difficulty is to know when to skip creating the DefId and reuse the one created by side-effect replay. What about adding a new variant |
Thanks! I was thinking about doing
but didn't know how. I'll investigate the |
6f8f71c
to
a7f29ee
Compare
☔ The latest upstream changes (presumably #120486) made this pull request unmergeable. Please resolve the merge conflicts. |
6d6b1eb
to
6831868
Compare
@cjgillot I implemented replaying, and that fixes the issues I was able to coax out of incremental tests, could you have a look? I'll keep working on it and adding more tests, but I think I could benefit from a review @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Some(local) => { | ||
// Ensure these two number spaces do not collide. 2^31 disambiguators should be enough for everyone. | ||
assert!(local < u32::MAX / 2); | ||
u32::MAX - local |
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.
This affects symbol names in incremental compilation. Not sure if that is a problem
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
17bd715
to
c65f83e
Compare
This PR modifies cc @jieyouxu |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Make create_def a side effect instead of marking the entire query as always red Before this PR: * query A creates def id D * query A is marked as depending on the always-red node, meaning it will always get re-run * in the next run of rustc: query A is not loaded from the incremental cache, but rerun After this PR: * query A creates def id D * query system registers this a side effect (just like we collect diagnostics to re-emit them without running a query) * in the next run of rustc: query A is loaded from the incremental cache and its side effect is run (thus re-creating def id D without running query A) r? `@cjgillot` TODO: * [ ] need to make feeding queries a side effect, too. At least ones that aren't written to disk. * [ ] need to re-feed the `def_span` query * [ ] many more tests
Finished benchmarking commit (ffbd260): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 2.3%, secondary 6.0%)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.
CyclesResults (primary 1.3%, secondary 531.5%)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.
Binary sizeResults (secondary 0.1%)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.
Bootstrap: 776.42s -> 775.666s (-0.10%) |
Lmao oh right I need to take out c6c92c3 |
☀️ Try build successful - checks-actions |
c65f83e
to
6d5d29c
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Make create_def a side effect instead of marking the entire query as always red Before this PR: * query A creates def id D * query A is marked as depending on the always-red node, meaning it will always get re-run * in the next run of rustc: query A is not loaded from the incremental cache, but rerun After this PR: * query A creates def id D * query system registers this a side effect (just like we collect diagnostics to re-emit them without running a query) * in the next run of rustc: query A is loaded from the incremental cache and its side effect is run (thus re-creating def id D without running query A) r? `@cjgillot` TODO: * [ ] need to make feeding queries a side effect, too. At least ones that aren't written to disk. * [ ] need to re-feed the `def_span` query * [ ] many more tests
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (8117600): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -2.0%)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.
CyclesResults (primary 0.9%, secondary 2.2%)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.
Binary sizeResults (secondary 0.1%)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.
Bootstrap: 776.211s -> 776.632s (0.05%) |
Yay, not even a regression anymore. Now I just need to figure out if there are still query feeding issues and how to resolve them run A -> feed B |
Before this PR:
After this PR:
r? @cjgillot
TODO:
def_span
query