Skip to content

Fix LuaJIT compatibility on dev - #2503

Open
JLawMcGraw wants to merge 2 commits into
PathOfBuildingCommunity:devfrom
JLawMcGraw:fix/luajit-compatibility
Open

Fix LuaJIT compatibility on dev#2503
JLawMcGraw wants to merge 2 commits into
PathOfBuildingCommunity:devfrom
JLawMcGraw:fix/luajit-compatibility

Conversation

@JLawMcGraw

Copy link
Copy Markdown

Description of the problem being solved:

Recent dev changes introduced syntax accepted by Luau but not by the LuaJIT 2.1 runtime used by Path of Building and its test workflow. Attribute-node switching also recursively deep-copies references into the passive-tree graph, which greatly increases allocation and can exhaust LuaJIT table capacity during replay-heavy workloads.

This replaces the incompatible operators, optional chaining, continue statements, and arrow function with LuaJIT-compatible equivalents. It also switches attribute nodes with a shallow structural copy while copying the stat-description array that ReplaceNode mutates.

Steps taken to verify a working solution:

  • Parsed all 1,121 Lua files with stock LuaJIT 2.1.
  • Ran all 53 system spec files: 824 passed, 0 failed, 2 expected failures, 18 pending.
  • Swept all 293 attribute nodes and verified each override while reducing allocation from about 5 MB to about 993 KB.

Link to a build that showcases this PR:

N/A; this is runtime compatibility and passive-tree correctness.

Before screenshot:

N/A

After screenshot:

N/A

@vaisest

vaisest commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

This syntax is part of LuaJIT v2.1 as of July 2026. Update your LuaJIT: LuaJIT/LuaJIT#1476

@vaisest vaisest closed this Sep 6, 2026
@vaisest vaisest reopened this Sep 6, 2026
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.

2 participants