Skip to content

Remove unreachable classes before compiler lowering - #1457

Open
Frotty wants to merge 1 commit into
masterfrom
codex/early-unreachable-class-pruning
Open

Frotty wants to merge 1 commit into
masterfrom
codex/early-unreachable-class-pruning

Conversation

@Frotty

@Frotty Frotty commented Oct 14, 2026

Copy link
Copy Markdown
Member

Unused classes survive the early tree shaker and are processed by compile-time passes, generic specialization, and Jass class lowering. Remove classes whose types, surviving implementations, fields, and inheritance relationships are unreachable, collecting dependencies during the existing function walk rather than traversing function bodies again.

Keep the class universe when reachable reflection or explicit type-ID reads expose its numbering, including reads consumed at compile time. Preserve compile-time allocator state, Jass inheritance joins that share an allocator, and Lua nominal identities for targeted specializations. Record generic static-field ownership during class translation so specialization cannot lose classes used without an instance. Remove the completed class-pruning item from the backlog.

Validation:

  • New class-retention regressions failed before implementation and now pass.
  • 703 tests across TreeShakerTests, DeterministicChecks, GenericsTests, GenericsWithTypeclassesTests, FieldIterationTests, CompiletimeTests, NewFeatureTests, LuaTranslationTests, ClassesTests, and ClosureTests passed with no skips, including Jass/Lua execution and shuffled-unit output checks.
  • Local castle-fight measurement: 3,596 classes become 2,137 before compile-time processing on both targets (1,459 removed, about 41%). Timing samples were mixed; this does not claim an end-to-end build-time speedup.
  • git diff --check passed. The full test suite remains for PR CI.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 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-14T06:52:24.242807Z 3757b4a 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.

This branch has not been deployed

No deployments
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