Lords2 earlier retirement: generated modal teardown defect
Run scratch/runs/20261106-lords2-earlier-retirement/ continues NEW-GAME-LORDS2-DEMO-20261015. This is emulator work; all original guest bytes remain read-only. USER.53's missing/retired HWND rejection is correct and unchanged. The original HWND 0x1804e / alias 0x013b was already retired before that call; its earlier native producer needs direct observation.
Demonstrated mismatch and repair
A generated NE uses real KERNEL.GlobalAlloc, USER.DialogBoxIndirect, GetDlgItem, SetWindowLong(-4), SendMessage and EndDialog. Its native Button child is subclassed with a generated far procedure. On both diagnostic modules before repair, EndDialog returned 42 and retired both windows, but root and child each received zero actual WM_DESTROY and WM_NCDESTROY callbacks. The observer distinguished attempted native delivery from guest entry: win16_dlg_pump -> wnd_destroy_children -> wnd_destroy_tree -> wnd_send_message_inner attempted an incomplete far WM_DESTROY before row removal; the root was removed directly. Native Wasm call stacks, live rows, owner/current task and full handles/generations are retained in modal-baseline-standard/ and modal-baseline-compat/. This establishes a generated modal teardown defect, independently of the original installer.
Microsoft's EndDialog contract defers destruction until the dialog procedure returns. WM_NCDESTROY follows WM_DESTROY and allows final window-data cleanup. Queuing a far callback and purging its HWND before entry does not satisfy delivery.
The repair reuses the existing Win16 far destruction walk before native modal removal. A 28-byte invocation-owned walk frame stores its cleanup mode. A separate 24-byte invocation-owned completion frame retains owner and screen bounds above the original modal result/far-return record. A new FFE4 continuation resumes modal restoration only after the walk finishes. No shared owner/result scratch or guest-map cleanup is introduced. Ordinary DestroyWindow retains its existing guard and cleanup policy; modal cleanup retains its existing owner/focus policy.
The first repair exposed an existing focus regression test: ordinary DestroyWindow's main-window fallback preselected an unrelated surviving window. Keeping modal cleanup separate fixed that failure. All focus target/result/stack assertions remain unchanged; the surviving-focus test now also expects the four newly delivered destruction callbacks while asserting no focus notifications.
Passive qualification
The temporary sensor is off by default and reports scalar host events. It records pre-removal producer entry, native send attempts/completion, local far callback entry after EIP/frame installation, actual RETF instruction before stack mutation, host retirement entry/return, and selected guest attach/detach/map operations. Callback matching includes instance, task, SS:SP, far return target, full HWND and generation. A matched RETF is return-instruction evidence; it is not claimed as later continuation entry. Host stacks retain native producer routing. Guest attach/detach events are observations only.
modal-exact-standard/ and modal-final-compat/ pass positive guest detach and retained-map negative cases. Each executes two real DialogBoxes: eight actual destruction entries and eight matched RETF instructions, live owner-thread routing, reused narrow aliases with distinct full HWND/generations, and NCDESTROY returns before retirement of the same generation. Reentrant SendMessage callbacks run while the destruction walk is suspended. Only the generated guest NCDESTROY handler clears its own map; the negative retains 0xcafe.
For each module and detach variant, armed versus disabled sensors have identical architecture and SHA-256 of all 512 MiB linear memory, with tracing common to both. A separate ordinary-no-trace versus traced-disabled comparison matches architecture and all three generated guest 64 KiB segments. Whole-memory equivalence is claimed only for the common-tracing cells, because tracing changes emulator cache state. Zero sensor errors, drops or unmatched callbacks were accepted. The standard/compat USER53 controls additionally preserve nested DestroyWindow/CallWindowProc, frame reuse, missing/retired rejection and stack WNDCLASS copy semantics. These are generated controls, not original-game acceptance.
The existing destruction walk's post-order policy is retained. This work qualifies actual per-window WM_DESTROY then WM_NCDESTROY delivery, callback lifetime and retirement ordering; it does not establish every Windows parent/child teardown interleaving.
Original media and remaining evidence
Use the existing exact 181-file media at /home/user/wine-assembly/scratch/game-media/lords2-demo-20261105/original (14,382,323 bytes), never a copy. SETUP.EXE SHA-256 is c9844241cf6594050cb4cdde5b04d4f994dfa6da83a3c5538dab16e792aa49b7; inventory SHA-256 is f73d8da675e08d1a5460e380e1b314a4bfe7cc59031ec1202b8f11560f929afc; fixture manifest SHA-256 is a1749143a2de176c4f3fdf314337a1767f6101eed4a88b6d5b0dee4d59012f8e. verify-media.cjs checks every inventory file in place and fixture symlink identity.
Coordinator granted one original at 22:26:51Z. A first harness attempt failed before browser creation because CHROME defaulted to a macOS path; the failure is retained. The coordinator explicitly confirmed that zero-guest prelaunch failure did not consume the original attempt. The sole actual browser used /usr/bin/google-chrome and loaded standard module SHA-256 ea9c475e98e09fb49585c856f57e9a81ea22a6496afb45dac22e45159ab92e3e, recorded independently by compile interception and actual HTTP response hashes.
There was an admission-order lapse: modal-final-standard had read the preceding 09189059... module while the locked build was still finishing. The exact current standard passed permanent regression and USER53 checks before launch, but its strengthened modal/full-memory rerun completed after original startup. This was reported immediately. All ordinary installer input followed the exact current modal-exact-standard PASS and coordinator's explicit 22:28:54Z instruction to continue in the existing instance. No original restart occurred. The run must not be described as fully admission-qualified from startup.
Ordinary Install and System Test Yes produced direct earlier-producer evidence. In observer instance 1 / task 2, sequence 1398 observes win16_dlg_pump ending dialog 0x1804a. Target HWND 0x1804e / alias 0x013b / generation 81 has actual WM_DESTROY entry/RETF at 1400/1401, and WM_NCDESTROY entry/RETF at 1403/1408, through 005f:8fd8 on its owner task 2. Inside that NCDESTROY callback, guest detach at 1404 receives 0087:88a4, map-remove at 1405 removes key 013b and returns AX=1 at 1406, then detach returns AX=013b at 1407. Native modal cleanup retires the still-live target row at 1449. The unrelated object's later detach is separately retained. The later destructor wrapper returns without the historical far fault. USER53's retired-handle guard remains unchanged.
The pre-retirement stack is compiler-identified as win16_destroy_finish -> wnd_destroy_children -> wnd_destroy_tree -> wnd_table_remove; the earlier ended-dialog stack identifies win16_dlg_pump. producer-compiler-names.json comes from a compiler re-emission byte-identical to the observed diagnostic module. Raw source-counting index tools produced incorrect names because they do not reproduce this compiled function layout; those first outputs are retained as rejected mappings. The prior historical stack was only a hypothesis; this run provides actual native producer and notification evidence.
The original map cell's payload bytes are not zeroed after map-remove. This run observes successful guest unlink/detach, not a zeroed map cell or a new map-membership lookup. No emulator-owned synthetic detach was used.
Personally reviewed captures show startup Main Menu, System Test Results, Wave sound test, CD-ROM Detect, Memory Test reporting too little memory, and then an empty desktop. Sound-test Yes is ordinary input and does not establish audible output. After Memory Test OK, the task reported exited with code 0; the observed child CPU EIP was zero, with no far fault. Installation completion, installed player control and a second distinct gameplay response were not reached. Next evidence gap: identify the memory query/result that caused the installer to report insufficient memory, qualify its documented semantics with generated controls, and obtain a separate future original grant. No memory/CPU repair is guessed here.
Final original readout retains 2,511 ordered records, 16 actual notification entries and 16 matched RETF instructions, zero errors/drops, and no pending callbacks or selected guest operations. Browser/harness exited normally at 22:32:05/06Z. The HTML response differs from disk because the dev server appends its documented agent-connect script; optional build-info.js was absent (404). These discrepancies are retained, not counted as byte matches. Successful served JavaScript and Wasm identities match local files.
Recovery and verification
Git is the source archive. The run stores source SHA, exact relevant binary diffs, owned new-file patches, unique diagnostic Wasm modules and module hashes; no source tree or repeated media archive. Temporary observation source was removed before publication; the production module exports no sensor. The shared helper also rejects zero/missing HWNDs when a modal callback has already retired its root. production-repair.patch reconstructs the semantic change; the diagnostic draft plus repair-plus-diagnostic.binarydiff reconstructs observation at its recorded source SHA.
Production validation: locked full build; new generated modal regression on standard and compatibility modules; existing Win16 destroy-notify, window-handle-map, WINDOWPOS/focus/modal-completion suites; far-fault evidence/collector lifetime controls on both modules. Exact final module/source hashes and command logs are retained in the run. Production source is not represented as original-tested: the original used the recorded diagnostic module, and final production adds the shared helper's zero-HWND guard and removes observations. Commit/publication and final process/lock cleanup are recorded in the run's publication/cleanup records.