Repository navigation
Lua hot reload: preserve named closure identities across sibling additions - #1549
Conversation
A hot-reload build names each function, global, class, field, allocator and dispatch stub after its source name and a short hash of its identity, so adding or removing a declaration renames nothing else. Release builds keep their numbered names.
…erloads keep their own names
… within their function Identities whose six-digit hashes collide get sixteen digits, found before anything is named, so names do not depend on the order of the compilation units. Locals and parameters are numbered per function, so a function added to the program renumbers nothing in another (the stack-trace parameter of every function did).
… which name helpers
…defaults, entry and legacy-manifest diagnostics
…ctural # Conflicts: # de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/translation/lua/translation/LuaTranslator.java # de.peeeq.wurstscript/src/test/java/tests/wurstscript/tests/LuaHotReloadTests.java # docs/LUA_HOT_RELOAD.md
…ge init fails the install
…hanges to functions stored by an earlier payload rejected
…lled, start new packages in dependency order
|
@codex review Please review head ed6e7b9. This is the requested follow-on to #1548, scoped to stable class identities for variable-bound closures in hot-reload mode. Executing tests retain old captures while inserting named siblings and replacing bodies; nested repeated binding names and underscore method names are covered. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed6e7b9d21
ℹ️ 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".
|
@codex review Please review current head 1368563. It distinguishes source owners by scope/signature and protects any remaining shared closure identities against swaps/body changes through baseline/history. New executing regressions cover reordered overloads and fresh ambiguous group installation; focused Windows checks (72 hot-reload, 36 determinism, 68 closure cases) pass with -PallBackends. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1368563036
ℹ️ 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".
|
@codex review Please review current head ed7c7be. Closure owner signatures now include complete nested source scopes through structural type references. The new A.N/B.N signature replacement regression fails before the fix and rejects afterward. Focused Windows checks pass (74 hot-reload, 36 determinism, 68 closure cases; closure coverage includes both backends). |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review Please review current head fdee052. #1548 was squash-merged, so this ancestry-only merge brings the merged base into the branch and the PR now targets master. Verified with git diff that the complete tree is byte-identical to reviewed head ed7c7be, which received a no-major-issues result and passed Ubuntu CI. All earlier findings remain addressed; no source changes were introduced by this merge. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Ready to merge at fdee052, targeting master after the squash merge of #1548. The ancestry-only update preserves the exact reviewed source tree. Current-head Codex review reports no major issues, both earlier findings are addressed and resolved, and two complete review snapshots separated by 73 seconds are unchanged. Ubuntu CI and test reporting passed on this head; merge status is clean. Review rounds for this follow-on: 4. Windows focused validation: 74 hot-reload, 36 determinism and 68 closure cases passed, with both-backend closure coverage. New in-game behavior and macOS remain unverified. This completes the named-closure identity increment; incompatible storage/type migrations still require an explicit migration contract. |
Adding a variable-bound lambda beside existing lambdas of the same interface currently rejects the hot-reload payload because the generated closure classes share an identity and are numbered by order. Hot-reload builds now include enclosing source-variable bindings in each closure class name, including outer bindings for nested closures. A hash of the resolved source owner's scope and structural signature, including nested type owners, distinguishes overloads without positions or translation order. Existing objects keep their captures and receive updated method bodies when distinct named siblings are inserted or reordered.
This is the next increment after the merged #1548 and targets
master. Wholly new ambiguous closure groups may be introduced together. Once present, their definitions are protected through baseline and session history: adding/removing siblings, editing their bodies or swapping same-named bindings requires a restart. Removals/renames with surviving old bindings also retain their restart checks. The naming change applies only with-luaHotReload; ordinary Lua and Jass emission follows the existing path.Validation: the executing regression rejects the edit before the fix, then passes with old closures alive and new closures created after reload. Windows: LuaHotReloadTests (74), DeterministicChecks (36) and ClosureTests (68) pass with
-PallBackends. Coverage includes sibling reordering, nested repeated local names, underscore method names, reordered overloads with existing captured objects, ambiguous same-owner bindings, first group introduction, earlier-payload history, nested types such asA.NversusB.N, and reversed compilation-unit order. The overload, ambiguity and nested owner regressions fail before their fixes. New behavior has not been measured in game; macOS remains unverified.