Skip to content

Support qualified static event registrations in Lua hot reload - #1589

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

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

Conversation

@Frotty

@Frotty Frotty commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Qualified static registrations such as EventListener.add(EVENT_..., callback) and DamageEvent.addListener(102, callback) previously stayed outside the hot-reload registration model. Inserting distinct static handlers while editing an existing one could reject an ordinary edit; newly added handlers could remain unregistered. This appears in CF commits fc2ccf5 and 15d728e.

The frontend now uses the resolved static target and stable operands for callback identity and owns each eligible top-level registration as the same complete init-action unit used for free calls. Existing handlers retain their captured state, new handlers run once, and native/named callbacks use the existing completion/retry/history contract. Static qualification changes keep the same target identity. Instance receivers, computed/local operands, generic qualifiers/callees and duplicate registrations retain their restrictions.

The action protocol advances to v2: even earlier action-aware sessions require restart, because they never recorded completion for qualified static calls. This avoids repeating already executed registrations after upgrading without changing the compiler version label.

Validation:

  • 666 focused tests passed on Windows / Java 27: LuaHotReloadTests, LuaHotReloadFuzzTests, DeterministicChecks, IncrementalHotReloadCompilationTests, LuaBackendAuditTests and ClosureTests. No failures/errors/skips.
  • Failing-before/passing-after repros cover static callback insertion/body edits and protocol upgrade refusal. With only callback identity fixed, the init test still failed at runtime because the new event was absent; action ownership fixes that separate failure.
  • Runtime checks cover old captured instances, new registrations without repeated setup, native and named callbacks, and qualified/unqualified spelling. The normal-build case executes on Jass, Lua and the IM interpreter.
  • Instance receivers and both generic systems remain excluded; shuffled compilation units with stack traces produce identical manifests.
  • Baseline and post-implementation 500-program campaigns passed with anonymous insertions enabled. The post-change campaign (seed202610271700) exercised 1,500 edits: 1,272 applied, 223 expected refusals, 5 permitted ambiguity refusals, zero failures. Omitting emitted function updates was detected by the mutation probe; exact source was restored before green checks. Final protocol-v2 checks are included in the 666 focused passes.
  • Three selected real-map history pairs matched independent fresh Lua and manifests on published head 9a1cecb: CF fc2ccf5 changed from rejected to accepted (one guarded-startup warning retained); CF 15d728e changed from accepted with an unapplied-init warning to accepted without warnings; ZD 6a22737 remains accepted with its four capture/state/init warnings. These are selected replays, not an updated full-corpus pass rate or whole-commit engine behavior proof.

Hot reload remains experimental and opt-in. Live state/capture migration, undoing old effects and latest actual-Warcraft validation remain outstanding. This change does not claim complete application of arbitrary map commits. Linux is covered by PR CI; macOS and actual engine application are unverified. WurstScript2.1.0 release work is owned by its separate completed release task.

@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-27T12:14:47.610622Z 9a1cecb 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.

@Frotty

Frotty commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 9a1cecbd93

ℹ️ 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 436ab60 into master Oct 27, 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