refactor(lifetime): own render resource prefixes

Give terrain, sky, retained UI, portal preparation, and the update/render frame pair explicit single owners. Make shader, texture, text, bindless, and GL construction prefixes checked and retryable so partial failure cannot lose or replay resource ownership.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-22 14:42:14 +02:00
parent fec0d94148
commit c87b15303d
41 changed files with 3768 additions and 355 deletions

View file

@ -3,9 +3,9 @@
## Current state
The behavior-preserving App ownership campaign is complete through Slice 7 and
Slice 8 checkpoints AG. `GameWindow.cs` moved from the 2026-07-21 baseline of
15,723 lines / 278 fields / 205 methods to 3,663 lines / 162 fields / 37
methods: 12,060 lines (76.7%) were removed without changing accepted gameplay
Slice 8 checkpoints AH. `GameWindow.cs` moved from the 2026-07-21 baseline of
15,723 lines / 278 fields / 205 methods to 3,689 lines / 162 fields / 37
methods: 12,034 lines (76.5%) were removed without changing accepted gameplay
or rendering behavior.
| Slice | Ownership moved out | Closeout size |
@ -20,6 +20,7 @@ or rendering behavior.
| 8 AE | shell freeze, native/session/environment composition, reversible pointer/input/framebuffer ownership | 4,266 / 194 / 65 |
| 8 F | sole gameplay action route, typed commands, retained-root callback lifetime | 4,057 / 198 / 54 |
| 8 G | pre-window/runtime settings ownership, one startup snapshot, inert late target binding | 3,663 / 162 / 37 |
| 8 H | render/UI/frame/portal resource roots plus checked retryable GL leaves | 3,689 / 162 / 37 |
Slice 8 is an ordered checkpoint campaign rather than another feature-body
move. A froze/pruned the shell boundary; B gave all nine native window callback
@ -72,6 +73,18 @@ Saved FOV now applies without devtools, fixing the former accidental
SettingsVM gate. AP-121 records the intentional modern persistence added to
the named-retail `/framerate` live toggle/notice.
H adds explicit ownership for the terrain atlas, dedicated sky shader,
retained Host/runtime chain, atomic update/render root pair, and portal tunnel
fallback/preparation/transfer. Every GL construction or mutation prefix added
to the checkpoint advances CPU ownership only after an always-on checked
driver commit. Failed shader/program/texture/buffer/VAO/text construction
retains exact names through the construction ledger; bindless residency and
the prior texture binding retain retry obligations across transient failure.
UI input cutoff and resource slots reject reentrant ownership mutation, and
portal preparation retries the same published fallback instead of replaying
the factory. This is a lifetime-only cutover; no AC algorithm or accepted
presentation order changed.
Slice 6 implementation commits are `99a3e819`, `4e4aac2c`, `0bc9fda9`,
`c5570383`, `eeb0f6b4`, `947c61d2`, and production cutover `e91f3102`.
Slice 7 implementation commits are `7e4cfb37`, `733126a2`, `bc6f09f9`,
@ -128,6 +141,12 @@ review rule live in `docs/architecture/code-structure.md`.
## Accepted verification
- Slice 8 Checkpoint H: 61 focused ownership/lifetime tests pass; App Release
passes 3,236 tests / 3 intentional skips. Four corrected-diff cycles closed
every architecture, retail, and adversarial finding; all three final reviews
are clean. The production App build has zero warnings/errors. The complete
Release suite passes 7,606 tests / 5 intentional skips; the 17 existing test-
project warnings remain tracked by #228.
- Slice 8 Checkpoint G Release suite: 7,553 passed / 5 fixture or environment
skips; App 3,183/3 skips, UI Abstractions 534/0, 35 focused App
settings/boundary tests, and all 43 `SettingsVMTests` pass. The production App
@ -170,8 +189,8 @@ review rule live in `docs/architecture/code-structure.md`.
## Next work
Slice 8 checkpoints HL group the remaining resource ownership, ordered
startup composition, and shutdown wiring and reduce Silk callbacks to
Slice 8 checkpoints IL group the remaining ordered startup composition,
shutdown wiring, canonical soak snapshots, and closeout and reduce Silk callbacks to
narrow calls into input, update, render, resize, focus, and shutdown owners.
It removes leftover feature state only where Slices 17 already established a
canonical owner; it does not redesign gameplay, rendering, or resource lifetime.