Skip to content

Incrementally emit Lua scalar locals spilling and loop demotion - #1581

Merged
Frotty merged 2 commits into
masterfrom
codex/incremental-scalar-spilling
Oct 26, 2026
Merged

Frotty merged 2 commits into
masterfrom
codex/incremental-scalar-spilling

Conversation

@Frotty

@Frotty Frotty commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Scalar hot reload edits now keep the incremental path when the function reaches Lua's local/register limit. Previously these functions fell back to whole-program copying and backend work. The private function runs the existing numeric-loop demotion and locals-table spilling producers, preserving the batch compiler's runtime representation and numeric spill slots.

The cold spilling producer records its generated table binding in the immutable function frame. Private emission consumes that binding directly, preserving collisions with local and global names without rebuilding a program-wide naming environment. The existing closed-body, unchanged-structure/source-position and compiler-option restrictions still apply. Calls, stack traces, compile-time execution, local optimisations and garbage-producing bodies remain outside this slice. Source scans, full-script assembly, hashing and payload comparison still process the program; this change makes no real-map latency claim.

Validation:

  • The reuse regression first failed on the previous backend with 1,992 copied functions. Boundary tests now assert zero copied functions/nodes and one lowered/emitted function. A spilled function with nested loops also keeps that work count with 1,000 additional live functions.
  • Latest-head focused scalar, Lua translation and Lua backend audit classes pass: 493 tests, no failures/errors/skips. Independent fresh-build comparisons cover both sides of the local/register boundary, loop recognition changes, local/global name collisions, reverts and cancellation/retry. Collision edit-chain references are all built before warm replay. Stock Lua applies payloads to spilled functions, preserving nested initialisations and calls through unchanged callers.
  • A deliberately removed frozen spill binding was caught by the local-name collision regression; the correct implementation was restored before final validation.
  • All five bounded 100-program batches passed on the latest head, fresh seeds 20261026130 through 20261026134: 500 generated scalar programs around the local/register limit with 1,500 warm edits compared against independent fresh Lua/manifests/payloads, plus 500 existing hot-reload fuzz programs with anonymous insertion enabled. XML receipts verify no failures/errors/skips in every batch. An earlier single-task attempt hit Gradle's fixed 20-minute task limit and is not counted as a successful campaign.
  • Local checks run on Windows. Ubuntu full-suite PR CI passed. Codex cleared the latest commit 61ab6fff8c512344f9305af6f37b2a39ad8ad39f with no findings; complete review snapshots were stable. macOS and Warcraft client execution remain unverified locally.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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-26T09:18:45.004120Z 61ab6ff 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 26, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 61ab6fff8c

ℹ️ 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 d6338e6 into master Oct 26, 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