Skip to content

Reuse unchanged function facts across garbage removals - #1472

Merged
Frotty merged 1 commit into
masterfrom
codex/cache-garbage-function-facts
Oct 17, 2026
Merged

Frotty merged 1 commit into
masterfrom
codex/cache-garbage-function-facts

Conversation

@Frotty

@Frotty Frotty commented Oct 16, 2026

Copy link
Copy Markdown
Member

Garbage removal discarded its body facts between invocations and relied on passes calling functionChanged after edits. Reuse facts while ImFunction.modificationCount() is unchanged, and validate virtual implementation targets separately because method tables live outside the caller's tree. Remove the explicit invalidation API and its callers; prune saved facts to reachable functions after each removal.

Six focused regressions cover reuse, nested edits, moved statements, call/reference changes, successive read updates, and external dispatch changes. Test mode also compares cached answers against independent fresh walks on every use. Update the backlog and agent guidance for the completed item.

Validation:

  • 871 tests passed on Windows across optimizer, facts, observable effects, determinism, classes, generics, tuples, compile-time execution and both Lua backend regression classes. The cache-reuse regression failed before the change.
  • Ten alternating optimized Castle Fight builds in one JVM: 64,088 body-analysis walks with a fresh cache versus 38,223 with reuse (40.4% fewer). Every build emitted byte-identical Lua (SHA-256 b74a982381865d047e9662eb2bd690d931fa75d6a3026ba4133eeb7c44ce24e6). Whole-build timings overlap and vary substantially; this does not establish an end-to-end speedup.
  • Pure Java identity/counter logic introduces no OS-specific behavior. Linux/macOS execution remains unverified locally; no game execution was required.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-16T14:17:39.797490Z e8f956c 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 0e48e96 into master Oct 17, 2026
2 checks passed
Frotty added a commit that referenced this pull request Oct 17, 2026
…les (#1477)

#1473 removed calculateCallRelationsAndUsedVariables and getUsedVariables
as dead code while #1472 added a test calling them; together master's
tests no longer compile. Nothing in the compiler computes used variables
any more, so the test checks the moved statements through the read path
the garbage removal uses.
@Frotty
Frotty deleted the codex/cache-garbage-function-facts 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