Skip to content

Map builds: purging what nothing imports no longer forces a second type check - #1453

Merged
Frotty merged 1 commit into
masterfrom
claude/purge-recheck
Oct 13, 2026
Merged

Frotty merged 1 commit into
masterfrom
claude/purge-recheck

Conversation

@Frotty

@Frotty Frotty commented Oct 13, 2026

Copy link
Copy Markdown
Member

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"), so MapRequest.checkModel checked 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. retainCompilationUnits now marks unchecked only what may have used what went, as removeCompilationUnit does for a removed file:

  • what imports a removed package, or one a removed config package configures (calculateCUsToUpdate);
  • when Jass names go (they are visible everywhere): what resolves a name into a removed unit (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 program 2.3 s to 0 ms (the build adopts the first check), build 48.7 to 46.2 s (-measure from #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.

…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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T09:24:20.715329Z 727d3f1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Frotty
Frotty merged commit 7bf1f5a into master Oct 13, 2026
2 checks passed
@Frotty
Frotty deleted the claude/purge-recheck branch November 25, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant