Repository navigation
Synced Lua: call lua_next directly in next, one closure for pairs - #3484
Open
moss-orbit-9f339e wants to merge 2 commits into
Open
moss-orbit-9f339e wants to merge 2 commits into
moss-orbit-9f339e wants to merge 2 commits into
Conversation
moss-orbit-9f339e
added a commit
to moss-orbit-9f339e/RecoilEngine
that referenced
this pull request
Oct 13, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Looks ok but does 3 unrelated things, split this into separate PRs. |
- SyncedNext called the original next through the registry with lua_call for each step of a synced pairs loop. It now calls lua_next directly, as luaB_next does, with the same results and the same key type checks. - SyncedPairs made a new C closure for SyncedNext on each call. It now returns one closure kept as an upvalue. - LuaHandleSynced.h: remove the unused origNextRef, and use #pragma once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 13, 2026
moss-orbit-9f339e
force-pushed
the
fix/lua-handle-fixes
branch
from
October 13, 2026 17:23
b638a4d to
4c8d102
Compare
Contributor
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Synced
nextcalled the originalnextthrough the registry withlua_callfor every step of apairsloop, and syncedpairsmade a new C closure on each call.nextnow callslua_nextdirectly (same key type checks), andpairsreturns one closure kept as an upvalue. Also removes the unusedorigNextRefand uses#pragma onceinLuaHandleSynced.h.Sync: same keys in the same order; fewer allocations, so GC timing can differ from master, identically on all clients.
Testing: Zero-K replay, same checksums as master, no Lua errors. Replay speed A/B: no measurable change (-0.49% median, within noise).
The
CallAsTeamand collision callin fixes from the first version are now #3502 and #3503.AI disclosure: found by OpenAI Codex in a code audit; checked, edited and tested with Claude Code.
🤖 Generated with Claude Code