Skip to content

Hot reload event registrations under constant build guards - #1590

Merged
Frotty merged 1 commit into
masterfrom
codex/hotreload-guarded-registrations
Oct 27, 2026
Merged

Frotty merged 1 commit into
masterfrom
codex/hotreload-guarded-registrations

Conversation

@Frotty

@Frotty Frotty commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Adding a handler under common build guards (if not isProd in CF and if isAntiCheatEnabled in ZD) previously left it outside hot reload's independent initialization actions. Existing callbacks could update, while the new handler never registered without restarting.

The frontend now plans source statements under immutable boolean branch paths before lowering. Eligible registrations own their complete guard and setup; ordinary source statements keep their original path and order. New handlers run once without repeating ordinary startup work or completed siblings. Guarded actions complete once even when disabled, without constructing their callbacks. A later constant edit does not replay completed setup; a client that missed an earlier payload can therefore complete different setup from one that applied it.

Admission is limited to boolean literals, constant boolean globals, and not/and/or. Dynamic/effectful predicates, loops, init-local captures, generic calls and duplicate registration identities retain their restrictions. Changing an existing guard's code warns instead of replaying setup. The startup protocol advances to v3 because earlier scripts did not record guarded completion: upgrading requires a fresh game session even if the compiler version label is unchanged.

Validation:

  • 691 focused tests passed on Windows / Java27: LuaHotReloadTests, LuaHotReloadFuzzTests, DeterministicChecks, IncrementalHotReloadCompilationTests, LuaBackendAuditTests and ClosureTests; zero failures/errors/skips.
  • Failing-before/passing-after repros cover missing guarded registrations and the protocol upgrade barrier. Runtime checks cover active/inactive nested then/else branches, statement order, old callback bodies, native callbacks, failed registration retry, cumulative/skipped payloads, disabled completion and first registration added beside ordinary setup.
  • Normal-build cases execute on Jass, Lua and the IM interpreter. Shuffled compilation units with stack traces produce identical manifests. Unsupported dynamic/effectful guards are not reevaluated by payloads; loop and local-capture boundaries remain explicit.
  • Baseline and post-change 500-program campaigns passed with anonymous insertions enabled. The final campaign (seed202610273600) covered 1,500 edits: 1,287 applied, 212 expected refusals and 1 allowed ambiguity refusal, zero failures. The omitted-function-update mutation was caught, and source was restored byte-for-byte before green checks.
  • Four selected real-map script history pairs match independent fresh Lua and manifests on published head c2204f6: CF fc2ccf5 is now warning-free (previously one guarded-startup warning); CF fa8613a retains only its removed-live-callback warning (guarded-startup warning removed); ZD c164021 is now warning-free (guarded-startup warning removed); ZD 6a22737 retains its four capture/state/init warnings. Replays use frozen dependencies, raw assets and base maps. These are selected compiler/script checks, not updated full-corpus rates or proof of complete historical commits in the engine.

Hot reload remains experimental and opt-in. State/capture migration, undoing old effects and latest actual-Warcraft validation remain outstanding. Linux is covered by PR CI; macOS and actual engine behavior are unverified. No release/tag is part of this change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-27T13:13:07.384992Z c2204f6 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 b5c919e into master Oct 27, 2026
2 checks passed
@Frotty
Frotty deleted the codex/hotreload-guarded-registrations 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