Skip to content

Optimize Lua array reads and div/mod emission - #1288

Merged
Frotty merged 2 commits into
big-lua-opt-updatefrom
codex/lua-array-divmod-hot-paths
Sep 3, 2026
Merged

Optimize Lua array reads and div/mod emission#1288
Frotty merged 2 commits into
big-lua-opt-updatefrom
codex/lua-array-divmod-hot-paths

Conversation

@Frotty

@Frotty Frotty commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • emit typed primitive array reads as raw Lua table indexes while retaining erased-generic normalization
  • lower raw integer division and integer/real fmod primitives directly to // and math.fmod
  • omit intrinsic-only raw numeric helper definitions and update affected backend assertions

Acceptance coverage

  • optimized and stacktrace Lua output contains no typed-array assurance wrappers
  • primitive array metatable defaults are verified at runtime for all four primitive types, unwritten and explicitly written slots, global and local sized arrays
  • optimized runtime div/mod output contains Lua primitives and no __wurst_raw* calls
  • negative-operand Jass-compatible div/mod semantics and the intentional I2S(1 div 0) abort trap remain covered

Checks

Base: big-lua-opt-update

Remove typed primitive array normalization, invert legacy assertions to require raw reads, and keep erased-generic normalization intact. Emit raw div/mod primitives directly as Lua operators without helper definitions.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 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-09-03T20:25:50.963051Z f59338e 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: 164bd317ac

ℹ️ 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 Sep 3, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: f59338e377

ℹ️ 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 be57b4e into big-lua-opt-update Sep 3, 2026
3 checks passed
Frotty added a commit that referenced this pull request Sep 4, 2026
* Stop the local-player barrier from refusing inlining on control taint (#1284)

* Optimize Lua array reads and div/mod emission (#1288)

* Optimize Lua array reads and div-mod intrinsics

Remove typed primitive array normalization, invert legacy assertions to require raw reads, and keep erased-generic normalization intact. Emit raw div/mod primitives directly as Lua operators without helper definitions.

* Track Lua numeric intrinsics by IM identity

* Give vararg calls a fixed-arity copy on Lua (#1286)

* Inline small Lua helpers regardless of popularity (#1289)

* Deduplicate Lua callback adapters (#1290)

* Deduplicate Lua callback adapters

* Preserve renamed Lua callback targets

* Bound Lua inlining by register pressure (#1291)
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