Don't store current-session side effects in OnDiskCache#154252
Open
Zalathar wants to merge 4 commits intorust-lang:mainfrom
Open
Don't store current-session side effects in OnDiskCache#154252Zalathar wants to merge 4 commits intorust-lang:mainfrom
OnDiskCache#154252Zalathar wants to merge 4 commits intorust-lang:mainfrom
Conversation
nnethercote
approved these changes
Mar 24, 2026
| file_index_to_file: Lock<FxHashMap<SourceFileIndex, Arc<SourceFile>>>, | ||
|
|
||
| // A map from dep-node to the position of the cached query result in | ||
| // A map from dep-node to the position of its disk-cached query return value in |
| // A map from dep-node to the position of any associated `QuerySideEffect` in | ||
| // `serialized_data`. | ||
| prev_side_effects_index: FxHashMap<SerializedDepNodeIndex, AbsoluteBytePos>, | ||
| side_effects_index: FxHashMap<SerializedDepNodeIndex, AbsoluteBytePos>, |
Contributor
|
r=me with the comment nits fixed. |
Collaborator
|
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. |
These lists can be considered part of the encoder state, and bundling them inside the encoder is certainly more convenient than passing them around separately.
Every other part of `OnDiskCache` deals with loading information from the _previous_ session, except for this one field. Moving it out to `QuerySystem` makes more sense, because that's also where query return values are stored (inside the caches in their vtables).
This assertion makes the method body a lot messier, and seems very unlikely to ever usefully fail.
Member
Author
|
Rebased over a trivial conflict. Instead of applying the comment suggestions as-is, I ended up rewriting the two comments to hopefully be clearer (diff). |
Contributor
|
@bors r+ |
Contributor
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Mar 24, 2026
Don't store current-session side effects in `OnDiskCache` This PR is a series of related cleanups to `OnDiskCache`, which is responsible for loading query return values (and side effects) that were serialized during the previous incremental-compilation session. The primary change is to move the `current_side_effects` field out of OnDiskCache and into QuerySystem. That field was awkward because it was the only part of OnDiskCache state related to serializing the *current* compilation session, rather than loading values from the previous session. The other commits should hopefully be straightforward. r? nnethercote (or compiler)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a series of related cleanups to
OnDiskCache, which is responsible for loading query return values (and side effects) that were serialized during the previous incremental-compilation session.The primary change is to move the
current_side_effectsfield out of OnDiskCache and into QuerySystem. That field was awkward because it was the only part of OnDiskCache state related to serializing the current compilation session, rather than loading values from the previous session.The other commits should hopefully be straightforward.
r? nnethercote (or compiler)