Skip to content

Assign unit identity at entry and remove lazy lookup allocation - #522

Merged
Frotty merged 29 commits into
masterfrom
codex/unit-entry-release-trace
Nov 2, 2026
Merged

Frotty merged 29 commits into
masterfrom
codex/unit-entry-release-trace

Conversation

@Frotty

@Frotty Frotty commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Assign identity during native entry, before ordinary enter consumers and before runtime creation returns. Store the association before onUnitIndex, retain it through death, and release it on leave/deindex. Missing or stale identity is a critical error: getIndex() and toUnitIndex() never allocate or repair it.

Keep consumer/spatial exclusions independent of identity. Preserve nonfatal absence handling for optional listener registration, event routing and order history. Once identity exists, route through configured getIndex(). Resolve UnitIndex objects through strictly validated backing allocator IDs; validate backing ownership before comparing a captured configured ID. Reentrant deindex cannot attach listeners to slot zero or resurrect cancelled startup registrations.

Preserve and document native zero self-damage before entry. Tornado Slow Aura emits these notifications even with no allowed targets; damage callbacks do not allocate identity.

Publish portable lifecycle, birth-damage, optional-routing and allocator checks. The checked-in preparer executes lifecycle/birth tests in both default and indexing profiles and offers a configured-provider profile. The latter overrides only getIndex() and exercises native events, order history, default object lookup, captured lifetimes and native removal.

Validation:

  • 764/764 unit tests, plus 5/5 Python preparer tests. The new null-owner test fails on the old default indexer (0/1); the expired-capture regression previously exposed an already-destroyed object dereference.
  • Final portable matrix on 64b0da7: 393/393 JASS and 393/393 guarded Lua, zero uncaught errors and one intentional caught allocator probe each. Artifacts: construction-lifetime-2026-11-02T17-47-34-830Z and construction-lifetime-2026-11-02T17-47-56-974Z.
  • Standalone native lifecycle/birth profiles: 426/426 Lua, 415/415 JASS, zero errors; explicit completion of three lifecycle seeds. Artifacts: construction-lifetime-2026-11-02T17-41-25-384Z, construction-lifetime-2026-11-02T16-41-37-336Z.
  • Final configured-provider profile: 17/17 Lua, 14/14 JASS, zero errors. Old default object lookup raises four invalid-object/free errors. Artifacts: construction-lifetime-2026-11-02T17-19-07-483Z before, construction-lifetime-2026-11-02T17-19-35-283Z Lua after, construction-lifetime-2026-11-02T17-21-21-083Z JASS after. The preceding routing-only control also failed 5/9 before and passed 9/9 after.

Artifacts are local under the investigating map checkout's artifacts/cf-e2e/. Warcraft executable: 3.0.1.24371. The final portable Lua run uses compiler PR #1593 at 720e3be; JASS and standalone profiles use the installed compiler. No installed compiler was replaced by this work.

Compatibility: lazy lookup is removed. Release indexed state during deindex while the association remains valid. UnitIndex subclasses use getUnit() instead of the removed protected _unit field.

Limits: the original full automatic suite still has one flat-terrain fixture failure (107 passed, one failed); interactive UI checks remain pending. The old Lua compiler fails the stale typed-destroy allocator regression; this PR does not fix the compiler. The production stale destroyer remains unidentified, same-class stale reuse and allocator parity remain separate compiler work, and single-client native passes do not establish multiplayer synchronization or prove the original replay fixed.

Optional spatial refresh, order-history clearing, and explicit unindexed order construction observe absence before strict lookup. The default-provider spatial control records two caught missing-index errors before the fix and passes 426/426 with zero errors after (before artifact: construction-lifetime-2026-11-02T17-40-55-675Z). Both new order-history unit tests fail independently on the old default implementation.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-11-02T17:48:59.510988Z 64b0da7 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: 539edf6a95

ℹ️ 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".

Comment thread wurst/util/UnitIndexer.wurst Resolved
Comment thread wurst/util/UnitIndexer.wurst Resolved
@Frotty

Frotty commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: 867e7ca157

ℹ️ 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".

Comment thread wurst/closures/ClosureEvents.wurst Resolved
Comment thread wurst/util/UnitSpatialIndex.wurst Resolved
Comment thread wurst/util/UnitIndexer.wurst Resolved
@Frotty

Frotty commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: 31d5f0cd52

ℹ️ 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".

Comment thread wurst/StdlibIngameUnitIndexTests.wurst Resolved
Comment thread wurst/util/UnitSpatialIndex.wurst Resolved
Comment thread tests/prepare_regressions.py Resolved
@Frotty

Frotty commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: 8778ad9251

ℹ️ 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".

Comment thread wurst/closures/ClosureEvents.wurst Resolved
Comment thread wurst/event/LastOrder.wurst Resolved
@Frotty

Frotty commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: 391108ea24

ℹ️ 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".

Comment thread wurst/util/UnitIndexer.wurst Resolved
Comment thread wurst/util/UnitIndexer.wurst Resolved
@Frotty

Frotty commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: 325874241b

ℹ️ 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".

Comment thread wurst/util/UnitIndexer.wurst Resolved
@Frotty

Frotty commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 64b0da701a

ℹ️ 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 eac3824 into master Nov 2, 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