PhotoCraft: An open-source, photo editor written by scratch in pure Rust
control-protocol: CPU rendering lasts the session only after a device loss (#6897 review)
00xJ09e83b41f458f
diff --git a/docs/control-protocol.md b/docs/control-protocol.mdindex 46fbe47fe..937330bd4 100644--- a/docs/control-protocol.md+++ b/docs/control-protocol.md@@ -82,7 +82,7 @@ The transport is `apps/photocraft/src/control_server.rs`, and the handlers are i- Engine commands (`engine.execute`, `photocraft-cli run`, MCP `command_run`) reject a param key their `params` doc does not name for the commands listed in `STRICT` (`crates/engine/src/param_check.rs`, today `layer.hideLayers` and `layer.showLayers`): `{"ids":[4]}` is the error `unknown parameter \`ids\` (expected: layer)`, and nothing runs. Other commands still ignore unknown keys until their `params` doc is complete and they are added to that list (`coalesce` and `target` are always accepted).- `ui.type {text}`: type text (goes to the focused widget, or to the canvas while the Type tool is editing)- `ui.resize {width, height}`: resize the main window-- `ui.gpu.simulateLoss {error?}`: act as if the wgpu device was lost (or reported an error with `error: true`). The app switches to the CPU image compositor for the rest of the session and shows the same recovery warning as on a real loss. `gpuFallbackNotice` in `ui.inspect` contains the reason while the warning is open. Keep Using CPU saves CPU compatibility for the next launch. Retry GPU saves GPU mode; after an error (`error: true`) it also builds a new GPU canvas on the same device at once (`gpuInfo.canvas` is `gpu` again, #6577), and after a loss it asks the user to save and restart. The window renderer still requires a working graphics or software adapter. Returns `wasActive` and `gpuInfo`. For testing the fallback+- `ui.gpu.simulateLoss {error?}`: act as if the wgpu device was lost (or reported an error with `error: true`). The app switches to the CPU image compositor (after a loss for the rest of the session; after an error until a successful Retry GPU) and shows the same recovery warning as on a real loss. `gpuFallbackNotice` in `ui.inspect` contains the reason while the warning is open. Keep Using CPU saves CPU compatibility for the next launch. Retry GPU saves GPU mode; after an error (`error: true`) it also builds a new GPU canvas on the same device at once (`gpuInfo.canvas` is `gpu` again, #6577), and after a loss it asks the user to save and restart. The window renderer still requires a working graphics or software adapter. Returns `wasActive` and `gpuInfo`. For testing the fallback- `ui.screenshot {path?, focus?}`: capture the main window (PNG). With no path the reply containsbase64 PNG data; a path is relative to the automation write root. Raises the window first(default) because occluded macOS windows stop rendering