Skip to content

Avoid materializing unused tuple fields - #1298

Merged
Frotty merged 1 commit into
masterfrom
codex/lua-tuple-field-read
Sep 4, 2026
Merged

Avoid materializing unused tuple fields#1298
Frotty merged 1 commit into
masterfrom
codex/lua-tuple-field-read

Conversation

@Frotty

@Frotty Frotty commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

  • resolve tuple selection against scalarized storage before expanding array or member reads
  • follow nested tuple component paths so only the selected scalar leaf (or selected subtree) is materialized
  • preserve one-time evaluation and source order for effectful receivers and indexes
  • add optimized-Lua coverage for plain, effectful, nested, and class-field tuple reads

Verification

  • ./gradlew test --tests "tests.wurstscript.tests.LuaBackendAuditTests.tuplesAreScalarizedWithoutLuaAllocations" --tests "tests.wurstscript.tests.LuaBackendAuditTests.tupleMemberArrayAssignmentCapturesIndex" --tests "tests.wurstscript.tests.LuaBackendAuditTests.tupleSelectionPreservesLeftToRightEvaluation" --tests "tests.wurstscript.tests.LuaBackendAuditTests.unreadTupleReturnSlotsAreRemoved" --tests "tests.wurstscript.tests.LuaBackendAuditTests.discardedTupleComponentsThatCanFailAreStillEvaluated" --tests "tests.wurstscript.tests.LuaBackendAuditTests.tupleFieldReadsOnlyLoadTheSelectedStorageComponent"
  • ./gradlew test --tests "tests.wurstscript.tests.TupleTests"
  • the new regression failed on the parent commit with points_x/y and Entity_pos_x/y discard calls, then passed with only the selected backing reads

Scope

  • tuple-return selection remains covered by the existing unread-return-slot regression
  • no inliner, register-budget, spill fallback, assurance, or integer arithmetic lowering changes
  • production-map counts and performance remain to be measured against a fresh parent-commit baseline

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 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-04T23:26:13.016851Z 5ad7edb PR opened
ℹ️ 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 merged commit a1beb13 into master Sep 4, 2026
3 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