Skip to content

Reuse specialization demand with a pass-local worklist - #1547

Merged
Frotty merged 2 commits into
masterfrom
codex/specialization-demand-worklist
Oct 22, 2026
Merged

Frotty merged 2 commits into
masterfrom
codex/specialization-demand-worklist

Conversation

@Frotty

@Frotty Frotty commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Specialization-demand queries repeatedly inspect overlapping callees, overrides and class members. Reuse their facts in a pass-local dependency worklist, then discard it before specialization mutates bodies.

Function facts and relevant-node indexes validate modificationCount(); referenced implementations, overrides, members and superclasses are checked against identity snapshots. Queries validate newly introduced dependencies before returning. Callers no longer notify the cache of changes.

Benchmarks of the version-validated implementation (835fd3a)

Nine measured pairs per map after three warm-up rounds, rotating both algorithms in the same JVM on real Lua RunMap builds. Windows x64, Zulu Java 27, 4 GiB heap, ParallelGC, optional optimizations disabled. The worklist code is from the reviewed head; the surrounding benchmark compiler baseline is 9893fb9ac (includes #1542). JFR and counters were off during timing.

Map Paired specialization saving Observed paired whole-request saving Faster requests
Castle Fight 384 ms / 23.6% 481 ms / 8.7% 7/9
Zombie Defense 17 ms / 4.6% 105 ms / 4.3% 5/9

Castle specialization savings range from -70 to +1,321 ms; Zombie from -175 to +155 ms. Whole-request ranges are -643 to +4,712 ms and -198 to +687 ms. Castle retains a useful phase improvement; Zombie is noisy and approximately neutral. Whole-request figures include movement in untouched phases and are not exact causal estimates. Paired savings are medians of within-round differences, not differences between independent medians.

All 56 new map requests emitted identical Lua between algorithms, including both source states and fresh-model oracles. The original trials also matched across 112 requests. The earlier 49% / 611 ms Castle result belongs to the explicit-notification prototype and does not describe this reviewed implementation.

The committed report and six historical CSVs preserve the original investigation. The completed rebenchmark below supersedes that report's publication-time pending-timing note. No code changed after review to add these results.

All nine measured pairs per map, milliseconds
map,round,legacy_request_ms,worklist_request_ms,legacy_specialize_ms,worklist_specialize_ms
castle,3,5672.2061,5384.4574,1627,1243
castle,4,4947.157,4589.3548,1088,1058
castle,5,5649.178,4996.7801,1558,1082
castle,6,5509.182,5028.5791,1345,1036
castle,7,9979.4094,5267.1341,2513,1192
castle,8,7755.1941,5947.9538,1945,1111
castle,9,4869.3291,5509.5224,1187,1218
castle,10,4322.6556,4965.1655,999,1069
castle,11,7031.0756,6225.0097,2141,1046
zombie,3,2531.6787,2725.3569,252,427
zombie,4,2962.0346,2359.2424,298,262
zombie,5,2860.8992,2345.4798,479,324
zombie,6,2433.3398,2327.9321,321,278
zombie,7,3398.764,2711.7758,397,375
zombie,8,2901.8595,2962.5204,343,437
zombie,9,2937.5156,2666.2618,371,354
zombie,10,2642.4785,2781.5977,305,378
zombie,11,2799.773,2997.6856,389,393

For each map, odd rounds use the edited body and even rounds the original. Exact output SHA-256 values match the historical CSVs for the same source state; all four fresh-model oracles per map match as well.

Validation and review

  • 957 focused cases passed, zero failures/skips, with Error Prone enabled.
  • Final graph rerun: 7 cases passed, covering callee mutation without caller notification, class-list identity, changed implementations/superclasses, and newly introduced dependencies.
  • Mutation probe fails with old cache behavior and passes with validation; git diff --check passes.
  • Latest-head Ubuntu CI: 3,417 tests passed, zero failures/skips.
  • Codex review completed for 835fd3a with no new findings. The original modification-count finding is fixed and resolved; two complete snapshots over 60 seconds apart were stable.

The earlier scope-scan optimization and profiling instrumentation are excluded from this PR's production diff. No new dependency or platform-specific production code. Local tests/benchmarks ran on Windows; CI covers Ubuntu. macOS timings and in-game execution remain unverified.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-22T20:15:09.581092Z 835fd3a Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c76a2d6ac1

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Frotty

Frotty commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 835fd3a986

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Frotty
Frotty merged commit 9c90bc8 into master Oct 22, 2026
2 checks passed
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