Move canvas async work into app runtime

This commit is contained in:
2026-06-16 08:33:16 +02:00
parent 3e4eb89499
commit 52f0d32612
9 changed files with 151 additions and 119 deletions

View File

@@ -18,6 +18,21 @@ agent or engineer to remove them without reconstructing context from chat.
## Reductions
- 2026-06-16: `DEBT-0003` was narrowed again. Canvas async
import/export/save/open background work now runs through an
`AppRuntime`-owned queue/worker in `src/app_runtime.h/.cpp`, and
`src/canvas.cpp` no longer defines a retained static canvas async worker;
broader app task ownership and retained runtime singleton reach remain.
- 2026-06-16: `DEBT-0037` was narrowed again. `App::rec_loop()` in
`src/app.cpp` now routes its wait plus iteration plan/encode shell through a
local helper instead of carrying that orchestration inline; retained
recording loop control, readback call sites, and MP4 execution remain.
- 2026-06-16: `DEBT-0036` was narrowed again. `NodeCanvas` grid-mode draw
callback setup now routes through
`make_legacy_canvas_draw_merge_grid_modes_draw(...)` in
`src/legacy_canvas_draw_merge_services.h` instead of keeping that callback
loop inline in `NodeCanvas::draw()`; broader canvas draw orchestration and
retained GL resource ownership remain.
- 2026-06-16: `DEBT-0003` was narrowed again. Prepared-file background work
now runs through an `AppRuntime`-owned queue/worker in
`src/app_runtime.h/.cpp`, and `src/app_events.cpp` no longer defines a

View File

@@ -117,8 +117,8 @@ Current architecture mismatches that must be treated as real blockers:
checkerboard background setup now route through retained draw-merge helpers,
with the cache-to-screen checkerboard-plane callback setup also reduced and
the merged-path per-plane merged-texture draw plus the smoothing-mask face
shader/draw pass plus heightmap and current-mode callback setup now routed
through the same retained helper family.
shader/draw pass plus heightmap, current-mode, and grid-mode callback setup
now routed through the same retained helper family.
- `app_layout.cpp` and `app_dialogs.cpp` are still mixed shell/controller files
rather than thin composition/binding surfaces.
- `App`, `Canvas`, `Node`, retained workers, and platform entrypoints still use
@@ -135,10 +135,11 @@ Current architecture mismatches that must be treated as real blockers:
while the main Win32 entrypoint now groups window/GL/task/VR state behind a
retained local state object instead of separate process-wide globals, the
canvas async worker now sits behind a named retained local worker-state
helper instead of a bare static accessor, the prepared-file worker now lives
under `AppRuntime` instead of a retained static app-events worker, and
`App::rec_loop()` has a smaller local iteration/encode shell even though the
retained recording loop still owns the worker-side readback flow.
helper instead of a bare static accessor, the prepared-file worker and the
canvas async import/export/save/open worker now live under `AppRuntime`
instead of retained static app-events/canvas workers, and `App::rec_loop()`
now has a smaller local wait/iteration/encode shell even though the retained
recording loop still owns the worker-side readback flow.
- Modern C++23 usage exists in extracted components, especially `std::span`,
explicit result/status objects, and a few concepts, but the live app still
does not consistently express ownership, thread affinity, or renderer

View File

@@ -147,8 +147,10 @@ Current slice:
`make_legacy_canvas_draw_merge_heightmap_draw(...)`, but the node still owns
current-mode traversal and broader post-draw orchestration.
- `NodeCanvas` current-mode draw callback setup now also routes through
`make_legacy_canvas_draw_merge_current_modes_draw(...)`, but grid-mode
traversal and broader post-draw orchestration are still inline.
`make_legacy_canvas_draw_merge_current_modes_draw(...)`, and grid-mode
callback setup now also routes through
`make_legacy_canvas_draw_merge_grid_modes_draw(...)`, but broader post-draw
orchestration is still inline.
- `NodeCanvas` smoothing-mask face shader setup plus per-face draw execution
now also route through
`execute_legacy_canvas_draw_merge_smask_faces(...)`, but the node still owns
@@ -352,6 +354,9 @@ Current slice:
object instead of separate file-scope globals
- prepared-file background work now runs through an `AppRuntime`-owned worker
queue instead of a retained static worker in `src/app_events.cpp`
- canvas async import/export/save/open background work now also runs through an
`AppRuntime`-owned worker queue instead of a retained static worker in
`src/canvas.cpp`
- retained `App` composition, task call sites, and platform/runtime entrypoint
coupling are still not fully reduced behind the runtime contract
@@ -409,16 +414,18 @@ Current slice:
- `src/app_events.cpp` prepared-file worker ownership and `src/canvas.cpp`
async import/export/save/open worker ownership now also sit behind named
retained local worker-state helpers instead of bare static worker accessors
- the prepared-file worker has now moved again into `AppRuntime`, removing the
retained static worker from `src/app_events.cpp`; the broader canvas async
worker still remains local because that slice is wider
- the prepared-file worker and the broader canvas async import/export/save/open
worker have now both moved into `AppRuntime`, removing the retained static
workers from `src/app_events.cpp` and `src/canvas.cpp`
- preview background rendering, recording, and the retained
`NodePanelGrid::bake_uvs()` worker now also use `std::jthread`, but their
retained loop/control flow is still open
- `App::rec_loop()` now routes its frame encode/update chunk through a local
helper, its iteration-context setup now also routes through a local helper,
and `App::update()` no longer carries the dead update mutex residue, but
retained recording loop control and readback ownership are still open
and its wait/plan/encode iteration shell now also routes through a local
helper, while `App::update()` no longer carries the dead update mutex
residue; retained recording loop control and readback ownership are still
open
Write scope:
- `src/canvas.cpp`