Skip to content

Lua hot reload: name declarations from their identity - #1546

Merged
Frotty merged 5 commits into
masterfrom
lua-hot-reload-stable-names
Oct 22, 2026
Merged

Frotty merged 5 commits into
masterfrom
lua-hot-reload-stable-names

Conversation

@Frotty

@Frotty Frotty commented Oct 22, 2026

Copy link
Copy Markdown
Member

First step towards hot reloading more than function bodies: a -luaHotReload build names its declarations from their identity instead of numbering them.

Release builds number generated Lua names in translation order (score, score1, ...), so adding or removing a declaration can rename others, and the running map then no longer matches the edited program. A hot-reload build now names each function, global, class, field storage, class allocator and dispatch stub after its source name plus six hex digits of a hash of its package, IM name and signature (score_010f82). Every function is still named before any body is translated, so a new local cannot take a function's name.

This accepts no new kind of edit on its own; it is what new functions, new globals and fields, and new lambdas will build on.

  • Release output is unchanged: outside hot-reload builds declarationName is the previous uniqueName(rawName).
  • addedDeclarationsRenameNothing: a global, a function and a class added in front of existing declarations, plus another package declaring the same names, leave every existing name and its meaning as it was.
  • The test harness aliases the library's testSuccess/testFail by their Lua names (LuaTranslator.functionNames), which now carry the hash in hot-reload builds.
  • LuaHotReloadTests (17) pass locally (Windows).

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.
@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:00:36.329979Z 1ef3c23 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: df1cc5f328

ℹ️ 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 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: 5bef3d58db

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

… 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).
@Frotty

Frotty commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: e9aa23ea2f

ℹ️ 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 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: 1ef3c23df9

ℹ️ 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 1ae6ff4 into master Oct 22, 2026
2 checks passed
@Frotty
Frotty deleted the lua-hot-reload-stable-names branch October 22, 2026 20:23
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