Repository navigation
Release unfinished frames from synchronous native damage - #524
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ee34f67e5
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
A nested cleave splash can deliver DAMAGING and return from UnitDamageTarget without delivering DAMAGED. In the Castle Fight reproduction, the stack grew from 1 to 2 on the splash call. The unreduced frame matched the splash source and target. Later, releasing the enclosing hit left its freed ID on the stack, where a UnitIndex reused it.
Add an opt-in DamageEvent.dealNativeDamage API for a synchronous native hit. It releases a single unfinished frame that belongs to that call and reports an error for other stack changes. Ordinary paired hits keep both listener passes.
The unchanged Castle Fight Lua bank on Warcraft III 3.0.1.24371 reproduced three stale destroys. Rebuilding the same seed, models and Elemental/Nature/Undead trio with this API at the cleave call site passed all 364 native assertions with zero uncaught errors. The damage-procs suite passed all 80 assertions. Castle Fight typecheck and the focused DamageEvent listener test passed.
Native regression
The checked-in fixture in
tests/fixtures/RegressionNativeLifecycle.wurstinvokes the public API from an actual reduced damage listener. It observes both listener passes for an ordinary nested hit. It then disables only the shared DAMAGED bridge during one real native hit to reproduce the unfinished frame deterministically. The assertions cover the enclosing target and amount, exact listener counts, and an empty stack when the outer hit returns.For each of
luaandjass, prepare withpython tests/prepare_regressions.py --backend <backend> --name scope-final --focus indexing. Rungrill build ExampleMap.w3x --quietin the printed directory, then launch the built map in Warcraft III. These runs used the WGC launcher at 6× and readWurstStdlibRegressions.txtthroughNATIVE LIFECYCLE COMPLETE.eac3824, fixture uses rawUnitDamageTarget364940a243e54f454bef45e031e415f0grill typecheck --quietpassed.grill test --quietpassed 771/771. The regression preparer’s Python tests passed 5/5.