-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Assert that global cache values are stable on insertion #110473
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
This only partially addresses the FIXME, given that the |
Ah, @SparrowLii's #100987 seems to suggest a reason for the instability of the I'm mostly interested in the cached |
Lol, oh, didn't read down-thread enough to see you commented on that. Oh well. I'll update the FIXME anyways. |
5b22c84
to
6b9862d
Compare
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 looks good to me. Do we need a perf run? Adding an assertion to the cache seems potentially damaging it.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 6b9862d with merge 6fedcc8c38319f932c1e095b4e13a5cb1268253c... |
@rust-timer queue 6fedcc8c38319f932c1e095b4e13a5cb1268253c |
This comment has been minimized.
This comment has been minimized.
@bors try |
⌛ Trying commit 6b9862d with merge dc41b88ee80166179217d22575571a4b01efdc00... |
whoops wrong rust-timer command, maybe my try build from last night did succeed @rust-timer build 6fedcc8c38319f932c1e095b4e13a5cb1268253c |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (6fedcc8c38319f932c1e095b4e13a5cb1268253c): comparison URL. Overall result: ❌ regressions - 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Warning ⚠: The following benchmark(s) failed to build:
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.
CyclesThis benchmark run did not return any relevant results for this metric. |
this sucks lol |
☀️ Try build successful - checks-actions |
Why was this closed? The failure seems like an existing bug to me? |
That's a cache conflict in the InferCtxt-local cache used by evaluation. It's probably not a bug worth solving, since it's likely only going to happen on overflow anyways, when a goal is later re-evaluated without hitting overflow because the depth is lower or something. |
That does seem like something that could lead to incremental compilation bugs. |
Let's make sure not to overwrite cache values with new values in, e.g., the evaluation cache and selection cache. I haven't found this being triggered in practice, but if we ever did, that'd be incredibly interesting to study.
There was a FIXME that says that we should be using
HashMapExt::insert_same
, but it turns out that we can't (cc @Zoxc in #50507), because it turns out that these cache entries are only equal modulo dep node index. But we don't need to use that particular method to protect against collisions in these caches, since we can just ignore the dep node. So instead of using that, let's just check that the values are the same.