refactor(app): extract focused window lifetime

Move the exact retryable shutdown manifest, typed root snapshot, terminal reporting, and native-window-last release out of GameWindow. Keep session and GPU convergence as hard barriers while reporting persistent physical callback cleanup without stranding dependent owners.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-22 19:43:52 +02:00
parent 5a55d08106
commit 31e6e192b3
21 changed files with 1297 additions and 572 deletions

View file

@ -35,6 +35,8 @@ after Slice 8 checkpoint D 4,330 lines / 192 fields / 67 method
after Slice 8 checkpoint E 4,266 lines / 194 fields / 65 methods
after Slice 8 checkpoint F 4,057 lines / 198 fields / 54 methods
after Slice 8 checkpoint G 3,663 lines / 162 fields / 37 methods
after Slice 8 checkpoint I 1,945 lines / startup composition shell
after Slice 8 checkpoint J 1,625 lines / focused lifetime shell
```
`GameWindow` is the single object that:
@ -683,7 +685,7 @@ Issue #232 records the coarse process-residency gate's run-to-run variance so
future diagnostics can distinguish canonical owner growth from OS/driver/GC
residency without weakening leak detection.
#### Slice 8 — composition and shutdown cleanup — ACTIVE
#### Slice 8 — composition and shutdown cleanup — ACTIVE (KL remain)
Detailed execution ledger:
[`docs/plans/2026-07-22-gamewindow-slice-8-composition-lifecycle.md`](../plans/2026-07-22-gamewindow-slice-8-composition-lifecycle.md).
@ -741,12 +743,17 @@ body into `FrameRootCompositionPhase`, publishes the pair through an exact
lease, and gives lifecycle resource sampling a focused source. `GameWindow` is
1,945 raw lines after I.9 corrects production to invoke the same executable
pipeline as the failure oracle, carries exact platform/settings results through
the typed contract, and keeps live-session start terminal. Checkpoint I is
complete; JL remain active with lifetime/shutdown extraction next. The App gate
passes 3,431 tests / 3 intentional skips and the complete Release suite passes
7,803 tests / 5 intentional skips. The clean solution build retains only the 17
test-project warnings tracked by #228; the complete Checkpoint-I behavior,
architecture, and adversarial corrected-diff passes are clean.
the typed contract, and keeps live-session start terminal. Checkpoint J then
moves the complete shutdown manifest into `GameWindowLifetime`: typed root
groups, retry/no-replay progress, structured reportable physical-detach
failures, hard session/GPU barriers, and native-window-last release now live
outside the host. The shell captures roots once and makes one lifetime call
from Closing/Dispose; no shutdown stage remains in it. `GameWindow` is 1,625
raw lines after J. The App gate passes 3,441 tests / 3 intentional skips and
the complete Release suite passes 7,813 tests / 5 intentional skips. The clean
solution build retains only the 17 test-project warnings tracked by #228; the
complete Checkpoint-J behavior, architecture, and adversarial corrected-diff
passes are clean. Checkpoints KL remain active.
### 4.4 Exit criteria