prometeu-runtime/discussion/workflow/plans/PLN-0091-implement-appmode-render-policy-matrix.md
2026-06-05 09:41:09 +01:00

64 lines
2.1 KiB
Markdown

---
id: PLN-0091
ticket: vm-render-parallel-execution-boundary
title: Implement AppMode Render Policy Matrix
status: done
created: 2026-06-05
ref_decisions: [DEC-0031]
tags: [runtime, appmode, shell, game, policy]
---
## Briefing
`DEC-0031` requires render execution policy to be explicit by AppMode/pipeline: Game is frame-paced and may use worker; Shell/System UI is lifecycle-driven and local/synchronous by default.
## Objective
Add an explicit render policy matrix so Game and Shell rendering cannot accidentally share the wrong lifecycle or pacing model.
## Dependencies
- Source decision: `DEC-0031`.
- `PLN-0090` defines the Game pacing contract.
## Scope
- Represent render policy for current `AppMode::Game` and `AppMode::Shell`.
- Make policy selection a SystemOS/lifecycle decision executed by `RenderManager`.
- Add host/runtime capability fallback for worker-supported vs local render.
- Keep Shell VM-backed apps under Shell lifecycle.
## Non-Goals
- Do not rename `AppMode::Game` to `Game2D` in this plan.
- Do not implement Game3D.
- Do not define Game pause/resume foreground stack; that belongs to `DSC-0041`.
## Execution Method
1. Locate `AppMode` routing through cartridge load, firmware state, SystemOS, and `RenderManager`.
2. Add a render policy enum or equivalent explicit matrix.
3. Route Game to frame-paced policy with optional worker capability.
4. Route Shell/system screens to local/synchronous lifecycle policy.
5. Add assertions/tests that Shell UI does not consume Game frame scheduler.
## Acceptance Criteria
- Policy is explicit and testable for Game and Shell.
- Shell UI remains local/synchronous by default.
- Game can declare worker-capable policy without requiring the worker to exist.
- Host/runtime capability fallback is represented without moving ownership decisions to host.
## Tests
- Unit tests for AppMode-to-render-policy mapping.
- Lifecycle test proving Shell does not require Game frame ticks.
- Regression test for Game still producing frame-paced submissions.
## Affected Artifacts
- `AppMode` routing modules.
- `RenderManager`.
- Firmware load/run steps.
- SystemOS lifecycle integration tests.