Repository navigation
Map builds: purging what nothing imports no longer forces a second type check - #1453
Merged
Merged
Conversation
…pe check Before it compiles, a map build removes the units nothing imports (retainCompilationUnits). That marked the whole model unchecked, "what is left may have used what went", so the compilation checked everything a second time. What is left is now marked unchecked only where it may have used what went, as for a removed file: what imports a removed package or one it configures, and, as Jass names are visible everywhere, what resolves a name into a removed unit or declares a Jass name a removed unit declares too. Those units have their attributes cleared before they are checked again. A large map: the second type check 2.3 s to 0 (the build adopts the first), build 48.7 to 46.2 s; output identical. The same purge runs before every run from the editor.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Before it compiles, a map build (and a run from the editor, which purges the managed model) removes the units nothing imports through
MapRequest.purgeUnimportedFiles->ModelManagerImpl.retainCompilationUnits. That marked the whole model unchecked ("what is left may have used what went"), soMapRequest.checkModelchecked everything a second time right after the first check.The kept units are closed under imports, so they can have used what went only through a config package or a Jass name.
retainCompilationUnitsnow marks unchecked only what may have used what went, asremoveCompilationUnitdoes for a removed file:calculateCUsToUpdate);FuncRef,NameRef,TypeRef, read from the links the last check resolved) and what declares a Jass name a removed unit declares too, since removing one of two equal Jass names changes how the other resolves.Those units have their attributes and cached lookups cleared, so the check that follows resolves them afresh. Only the managed model is tracked; a copy is just purged, as before.
A large map (Jass):
Typecheck program2.3 s to 0 ms (the build adopts the first check), build 48.7 to 46.2 s (-measurefrom #1452 applied locally), Jass output identical; the walk over the references costs about 0.1 s.ModelManagerTests.purgingWhatNothingUsesKeepsTheModelChecked(fails on master): purging an unused package or a Jass file nothing calls keeps the model checked; purging a config package or a Jass file something calls does not, and the check then reports the unresolved call. The existing test where a purged package is imported by what is left still holds. Run locally: ModelManagerTests, IncrementalModelOracleTests, CliBuildMapTests, MapRequestPatchTargetTests, LanguageWorkerTest, InitialBuildProgressTest, MapCancellationTest, DeterministicChecks.