The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.
Rust ffmpegfree-video-editormodel-context-protocolnon-linear-editoroffline-firstopen-source-video-editorself-hostedvideo-editingvideo-editing-automationvideo-editing-softwarevideo-editing-toolsvideo-editorvoice-cloningyoutube-automationyoutube-shorts
docs: how Concat works, and the 19 September audit
Jareer88bae69a5196
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.mdnew file mode 100644index 00000000..ce04b426--- /dev/null+++ b/ARCHITECTURE.md@@ -0,0 +1,310 @@+# How Concat works++A map of the engine and the window for someone who wants to change one part+without reading the rest. Every section names the crate and the file to open+when the picture is not enough. Diagrams are Mermaid, which GitHub renders.++Concat is a video editor in Rust. The engine is a set of crates with no window+in them; the window is a Slint application over that engine; a command-line+tool and a socket server drive the same engine through the same API the+window uses. One document format, one command set, one renderer, three ways+in.++## 1. The crates and who depends on whom++Every arrow points one way: nothing lower knows the window exists, and the+engine's core knows nothing about FFmpeg.++```mermaid+graph BT+ core["concat-core<br/>time, arena, timeline, frame, shader types<br/>std only, builds for wasm"]+ project["concat-project<br/>the document: model, commands, undo, serde"]+ media["concat-media<br/>FFmpeg: probe, decode, encode, pool, prefetch, hardware"]+ effects["concat-effects<br/>packages: manifest + WGSL, catalogue, budgets"]+ render["concat-render<br/>FramePlan, CPU and GPU compositors, kernels, SSIM"]+ vision["concat-vision<br/>cutout masks, brushes"]+ text["concat-text<br/>title rasteriser"]+ export["concat-export<br/>document to engine timeline; render loop; preview"]+ host["concat-host<br/>Session, projects, playback, monitor, proxies, scheduler, jobs"]+ speech["concat-speech<br/>whisper and Kokoro models"]+ api["concat-api<br/>one dispatcher: every verb as JSON"]+ server["concat-server<br/>JSON-RPC lines, gRPC, tokens"]+ cli["concat-cli"]+ window["concat<br/>the Slint window"]+ android["concat-android"]+ perf["concat-perf<br/>the performance table"]++ project --> core+ media --> core+ effects --> core+ effects --> project+ render --> core+ render --> effects+ vision --> core+ vision --> project+ export --> media+ export --> render+ export --> vision+ export --> project+ host --> export+ host --> text+ speech --> host+ api --> host+ server --> api+ cli --> server+ window --> server+ window --> speech+ android --> window+ perf --> host+```++`concat-core` and `concat-project` build for `wasm32`, which CI checks; the+FFmpeg boundary is `concat-media` and nothing else links it.++## 2. From the document to a pixel++A clip exists in three shapes on its way to the screen, and each crossing is+one function in one file.++```mermaid+flowchart LR+ doc["Project<br/>(concat-project::model)<br/>f64 seconds, string ids,<br/>keys as fractions"]+ flat["Vec<ExportClip><br/>(concat-export::flatten)<br/>one list, tracks by index,<br/>transitions resolved"]+ tl["core::Timeline<br/>(concat-export::resolve)<br/>Rational time, arena ids,<br/>quantised to the frame grid"]+ plan["FramePlan<br/>(concat-render::plan_frame)<br/>what is on screen at t:<br/>media, source time, placement,<br/>opacity, blend, per layer"]+ filled["FramePlan, filled<br/>(concat-export)<br/>+ decoded picture, effects<br/>resolved for t, treatments"]+ cpu["CpuCompositor<br/>the reference"]+ gpu["WgpuCompositor<br/>the fast one"]+ enc["Encoder<br/>(concat-media)"]+ tex["a texture on the<br/>window's device"]++ doc -- "flatten_timeline" --> flat+ flat -- "build_timeline" --> tl+ tl -- "plan_frame(t)" --> plan+ plan -- "decode + passes_at" --> filled+ filled --> cpu+ filled --> gpu+ cpu --> enc+ gpu --> enc+ gpu --> tex+```++- **The document** (`concat-project/src/model.rs`) is what a person edits and+ what is saved. Times are seconds, ids are strings, and every keyframe is a+ fraction of its clip's length. Every change goes through a `Command`+ (`commands/`), and the `Editor` (`editor.rs`) keeps undo as snapshots that+ share whatever a command did not touch.+- **Flatten and resolve** (`concat-export/src/flatten.rs`, `resolve.rs`) turn+ the document into the engine's `Timeline`: rational time, quantised to the+ frame grid so `f64` equality is exact, plus the per-clip facts the model has+ no field for (decode sizes, filter chains, cutout jobs, layer treatments).+- **The plan** (`concat-render/src/plan.rs`) is pure: no files, no pixels. It+ says what is visible at one instant and where. The export fills it with the+ decoded picture, the effects resolved for that instant, and the treatments+ live over the stack, and hands the whole thing to a compositor, which takes+ a `FramePlan` and nothing else.+- **Two compositors, one description.** The CPU one is the reference and the+ fallback; the GPU one must match it, and the parity suite+ (`concat-render/src/gpu/tests.rs`) holds it to a structural similarity+ above 0.99 on a plan per thing a frame can ask for. Geometry (crop, fit,+ centre, scale, turn) and weighing (fades folded into a scale and offset,+ wipes into edges, mask, opacity) are computed once in the plan so the two+ cannot drift.++Still baked into the decoder's FFmpeg chain rather than filled into the plan+by the export: the crop, the flips and the transition fades. The plan has the+fields; the tests fill them; the export does not yet.++## 3. Effects++An effect is a folder under `concat-effects/packages/`: a manifest+(`effect.toml`) naming its knobs, a WGSL shader (`effect.wgsl`) declaring a+`Params` struct and `fn effect(uv)`, and an FFmpeg chain template for audio+and for the CPU path's history.++```mermaid+flowchart TD+ pkg["package folder<br/>effect.toml + effect.wgsl"]+ cat["Catalogue<br/>(concat-effects::catalogue)<br/>parsed, validated, kept"]+ pass["ShaderPass<br/>package id, compiled source,<br/>params bytes laid out to the struct,<br/>values by key, intensity, LUT"]+ gpu["GPU: the shader runs<br/>params as a uniform buffer"]+ cpu["CPU: kernels.rs<br/>a kernel per known package,<br/>else untreated, said once"]++ pkg --> cat+ cat -- "shader_passes_at(effects, t)" --> pass+ pass --> gpu+ pass --> cpu+```++At load, `concat-effects/src/shader.rs` stitches the host's prelude round the+package body, parses and validates it with naga, reads the `Params` layout for+the uniform buffer, and refuses a shader that binds anything the host did not+declare or loops without a break. A look-up table larger than 65 a side is+refused too. The GPU compositor can run a package once on a sixteen-pixel+picture against a timeout (`WgpuCompositor::trial`) before it is enabled.++## 4. Decoding, caching and scheduling++Export decodes every frame once, in order, with one decoder per clip. Everything+interactive goes through the pool and the scheduler.++```mermaid+flowchart LR+ transport["transport<br/>(playback, scrub)"]+ cursor["Cursor {time, direction, rate}"]+ sched["Prefetcher<br/>(concat-media::prefetch)<br/>a few threads, one queue,<br/>Playback > Filmstrip > Artwork > Proxy"]+ pool["ReaderPool<br/>(concat-media::pool)<br/>source cache: (file, level, frame)<br/>treated cache: + crop, fit, chain<br/>warm readers"]+ dec["Decoder<br/>software, or the platform's hardware<br/>(hardware.rs), falling back once"]+ proxy["proxy<br/>(concat-host::proxy)<br/>quarter-size H.264 of anything<br/>larger than HD, in cache/proxy"]++ transport --> cursor --> sched+ sched -- "frames ahead, held until passed" --> pool+ pool --> dec+ proxy -- "adopted for a moving picture" --> pool+ sched -- "written once, on the proxy lane" --> proxy+```++- **The source cache** is keyed by the file, the level it was decoded at (the+ file's own size halved as long as it still covers what was asked for) and+ the frame index, and nothing else. The crop, the fit and the effect chain+ are applied to the cached picture on the way out and kept in a second,+ smaller cache, so turning a knob costs a filter per frame and a scrub back+ over covered ground costs a lookup.+- **The scheduler** is one per process (`concat_host::scheduler()`). The+ monitor's frames and the frames ahead of the playhead come first, then the+ lanes' filmstrips, the bin's artwork and proxies, on two to four threads+ with one always kept clear of background work, so an import of twenty files+ never runs twenty decoders at once.+- **Hardware decode** (`concat-media/src/hardware.rs`) is a process-wide+ preference the Settings switch sets: VideoToolbox on a Mac, D3D11VA on+ Windows, MediaCodec on Android, VAAPI only when named. Any failure falls back+ to software, logged once.+- **Audio** for playback (`concat-host/src/playback.rs`) is decoded per clip+ span to a WAV in the project's cache and memory-mapped; the mixer reads+ those.++## 5. The window++The window is one Slint tree published from Rust. The controller is `Studio`+(`concat/src/studio.rs`); each pane owns its state and is changed only by its+own messages.++```mermaid+sequenceDiagram+ participant Slint+ participant lib as lib.rs (callbacks)+ participant Studio as Studio::handle+ participant Pane as pane.update(msg, &mut Studio)+ participant Worker+ Slint->>lib: callback (a click, an edit)+ lib->>Studio: handle(Msg::Pane(msg))+ Studio->>Pane: take the pane out, update+ Pane->>Worker: spawn(work, then)+ Worker-->>Studio: on_ui(|studio| studio.handle(Msg::Pane(done)))+ Studio->>Slint: publish(): every pane's data(), rows synced by diff+```++- **Panes** (`concat/src/panes/`): export, settings, captions, speech, relink,+ project sheet, launch form, media bin, monitor, timeline view. Each is+ `state + Msg + update + data`. The pane is taken out of the studio for the+ duration of `update`, so it can be handed the rest of the window without+ borrowing itself twice; a result that arrives after its project closed is+ dropped in one place.+- **What stays on the controller:** the gestures (a clip dragged, trimmed or+ razored; a picture moved on the stage; a brush stroke), because one gesture+ spans the lanes and the stage over an *echo* of the document, a clone the+ pointer mutates and commits as one command on release. Moving those is the+ next cut of `studio.rs`.+- **Publishing** rebuilds each pane's Slint data on every event; row models go+ through `sync`, which diffs against the last published rows. The lanes+ report their width, and the controller publishes only the clips that+ intersect the visible window plus one screen either side.+- **The monitor** asks the controller for the flattened clips with titles,+ auditions and the brush tint, and draws them on the window's own wgpu+ device (`concat/src/gpu.rs`), so a frame is a texture Slint samples with no+ readback. Drawing happens on the event-loop thread only; decoding on a+ worker.+- **The launch screen** (`concat/ui/start.slint`) takes three shapes by+ width: recents beside the form, under it, or the phone shape with stacked+ labels and full-width controls.++## 6. The document, undo and the file++```mermaid+flowchart LR+ cmd["Command"] --> validate["run(&mut Project)<br/>clamps in Clip::tidy"]+ validate --> snap["snapshot<br/>Arc-shared: only the touched<br/>timeline's clips are copied"]+ snap --> undo["undo stack, depth 200<br/>a gesture is one step"]+ file["concat.json<br/>version + document"] -- "serde, unknown fields kept" --> migrate["doc::migrate<br/>one version step at a time"] --> tidy["tidy pass"] --> proj["Project"]+ proj -- "derive Serialize" --> file+```++- Commands live in `concat-project/src/commands/` by group (clip, keys, audio,+ tracks, timelines, media). Every clip is built by `Clip::blank` and clamped+ by `Clip::tidy`; there is one place clamps live.+- Keys stay on their instant of the picture through split, trim, freeze and+ merge by re-anchoring the fractions in those commands, so the document+ stays version 1.+- Selecting or moving a timeline is view state and does not enter undo.++## 7. The API and the three doors++```mermaid+flowchart LR+ window["the window"] --> api+ cli["concat-cli"] --> api+ json["JSON-RPC lines<br/>TCP or a Unix socket"] --> hub+ grpc["gRPC (feature)"] --> hub+ hub["Hub: one thread,<br/>every caller in turn"] --> api["Api<br/>(concat-api)"]+ api --> host["Session, jobs, export<br/>(concat-host)"]+```++`Server::start` (`concat-server/src/lib.rs`) mints a token when none is+configured, on loopback too, and every connection presents it first; the+comparison is constant-time. `version` reports `capabilities` so a client can+tell what a build serves before calling. The CLI prints the token it serves+with; the window's Remote page shows it.++## 8. Testing and measuring++| Suite | Where | What it holds |+|---|---|---|+| Unit tests, 429 across 75 files | every crate | the arithmetic, the commands, the reader, the plan |+| Export end to end | `concat-host/tests/export.rs` | every edit a person can make exports, through real `Session` commands over synthetic media, read back; crashes hard on purpose |+| Parity | `concat-render/src/gpu/tests.rs` | the GPU against the CPU reference by SSIM, one plan per feature |+| Hostile packages | `concat-effects/src/shader.rs` tests | the unbounded loop, the extra binding, the oversized table are refused |+| Locales | `concat/src/i18n.rs` tests | every shipped locale covers the inventory `scripts/locales.py` writes |+| Performance | `cargo run -p concat-perf --release [--check]` | planning, undo, the document, decode, scrub, compositing, export, each against a budget; the quick ones also run under `cargo test` |++## 9. Where to look++| To change | Open |+|---|---|+| what a clip can be | `concat-project/src/model.rs` |+| what an edit does | `concat-project/src/commands/` |+| the file format | `concat-project/src/doc.rs` |+| how a frame is planned | `concat-render/src/plan.rs` |+| how it is drawn | `concat-render/src/compositor.rs`, `gpu.rs`, `kernels.rs` |+| an effect | `concat-effects/packages/<id>/` |+| decoding, the cache | `concat-media/src/decode.rs`, `pool.rs`, `prefetch.rs`, `hardware.rs` |+| the export loop | `concat-export/src/lib.rs` (`render_picture`), `resolve.rs` |+| the monitor | `concat-host/src/preview.rs`, `concat/src/panes/monitor.rs` |+| a sheet or a pane | `concat/src/panes/<name>.rs` and `concat/ui/` |+| the gestures | `concat/src/studio.rs` |+| the API's verbs | `concat-api/src/message.rs`, `lib.rs` |+| the server | `concat-server/src/lib.rs`, `json.rs`, `grpc.rs`, `token.rs` |+| a number that matters | `concat-perf/src/main.rs` |++## 10. Known gaps++- The gestures and the stage still live on the controller.+- The crop, the flips and the transition fades reach the compositor baked+ into the decoder's chain, not through the plan.+- `ExportClip` remains the CLI and API wire type and the title rasteriser's+ output.+- Cached frames are uploaded to the GPU per composite; keeping them as+ textures in the pool is the follow-up now that both compositors read a plan.+- Zero-copy hardware frames (IOSurface into wgpu) are not done; a hardware+ frame is transferred to memory first.+- Filmstrips are one image per clip; one texture per track per zoom level is+ not done, and the Slint repaint itself is not measured headless.diff --git a/AUDIT-2026-09-19.md b/AUDIT-2026-09-19.mdnew file mode 100644index 00000000..2972a771--- /dev/null+++ b/AUDIT-2026-09-19.md@@ -0,0 +1,206 @@+# Concat `src/` audit — 19 September 2026++Scope: the Cargo workspace under `src/` (16 crates, 58.5k lines of Rust, 20.2k+lines of Slint), the tracker (87 issues, 38 open), CI, and everything that+landed since the 16 September audit and its proposal. Method: the proposal was+worked through step by step over three days; every step landed on `main` with+its tests green; this report is what was found on the way, what the numbers+say now, and what is still wrong. It follows the shape of+`AUDIT-2026-09-16.md` so the two can be read side by side.++**Status of the proposal:** every line of `ARCHITECTURE-PROPOSAL.md` is+ticked, each with a note on what it left for later. `ARCHITECTURE.md` is back+and describes the tree as it is now.++## 1. Where the project stands++| Signal | 16 Sept | 19 Sept |+|---|---|---|+| Version / commits | 0.2.2, 435 commits | 0.2.2, 510 commits |+| Community | 2 490 stars, 216 forks | 2 867 stars, 254 forks |+| Crates / Rust lines | 14 / ~34k | 16 / 58.5k (`concat-perf` and the window's panes are new; the rest is tests and docs) |+| Slint lines | ~14k | 20.2k |+| Clippy (`--workspace --all-targets`) | 0 warnings | 0 warnings |+| Tests | 345 | 429 `#[test]` functions across 75 files, plus the export end-to-end suite, the parity suite and the performance table |+| CI on `main` | red (locales) | red until commit `796e9a9` (three test initialisers left behind by the ripple-on-drop PR); green from there |+| `unsafe` blocks | 22 | 31 (the nine new ones are the hardware decode path in `concat-media`, each with a SAFETY note) |+| `unwrap`/`expect` outside `#[test]` fns | ~500 | 725 in files that also hold tests; most are in test modules, and the count is a grep, not a judgement |+| Largest files | `studio.rs` 8 043; `export/lib.rs` 2 474; `commands.rs` 2 148 | `studio.rs` 6 360; `project/lib.rs` 2 957 (tests); `export/lib.rs` 2 046; `model.rs` 1 921; `pool.rs` 1 438 |++**The weight has moved.** Three days ago the window's controller was the+model, the view-model and the event bus at once. Ten of its concerns are now+panes behind one message loop, the engine gained a scheduler, a source-keyed+cache, proxies, hardware decode, one render description for both compositors+and a parity suite, the server mints tokens, and there is a performance table+with budgets. The gestures are what is left on the controller, and they are+the next cut.++**The engine found its own bugs.** The performance table's scrub scenario, on+its first run, showed one decode on the way back over covered ground. That was+two real defects (bugs 1 and 2 below), both older than the cache work, both+fixed the same hour. That is the argument for the table.++## 2. Bugs found and fixed this pass++Verified from source or a local run unless marked.++1. **Constant-rate files were indexed at a skewed rate (verified, fixed+ `381c477`).** The probe took `avg_frame_rate` first, which on a short or+ oddly-closed file is the frame count over a duration a frame short: ninety+ frames over eighty-nine thirtieths is 30.34 fps. Every frame landed a third+ of a frame early, boundary frames rounded up by one, and the cache had a+ hole at the skipped index, so every scrub back re-decoded there. A+ constant-rate stream now takes its base rate exactly when the two agree+ within two percent; a variable stream keeps its average.++2. **A request past a file's last frame walked from the keyframe every time+ (verified, fixed `381c477`).** A container that claims one frame more than+ it holds made the pool seek and decode to the end on each request for that+ index, since the answer was never remembered under it. It is now.++3. **The window did not build on `main` (verified, fixed `1147533`).** The+ Persian locale arrived with the locale table still declared thirteen long.+ The new file also lacked the inventory's newer keys, which the coverage+ test refuses; they are filled with English until a translator gets there.++4. **The crate's tests did not build on `main` (verified, fixed `796e9a9`).**+ The ripple-on-drop PR (#141) gave `AddClip` a `ripple` field and left three+ test initialisers without it. CI has been red since it merged.++5. **Two title bars on Linux (reported #97, #145, fixed `ad28218`).** Slint's+ winit backend re-applies the window's `no-frame` property after the window+ is made, over the attribute hook the window used, so on GNOME under Wayland+ the compositor's bar came back above the strip. The Slint window now says+ `no-frame` wherever the strip carries its own buttons. Not run on a Wayland+ desktop here; reasoned from the backend's source and the report.++6. **The loopback API trusted every local process (verified 16 Sept, fixed+ `e35b2d9`).** A token is minted when none is set, on loopback too; the+ comparison is constant-time; `version` reports `capabilities`.++7. **Touching an effect knob threw the clip's cached frames away (verified 16+ Sept, fixed `7311d2d`).** The cache keys on the source frame now.++8. **An import of twenty files ran twenty decoders (reported #52, fixed+ `ab70838`).** One scheduler with priorities and a reserved worker.++9. **Keys re-timed on split and trim (verified 16 Sept, fixed+ `cbd961e`).** Re-anchored in the four commands that move a clip's window.++## 3. Bugs still open++From the tracker, with what this pass learned about each.++1. **Logo click freezes the window (#99, #111).** Still open and still the+ highest-priority UX bug. The message loop now drops a result that arrives+ after its project closed in one place, which removes one class of cause,+ but the freeze itself has not been reproduced here. The next step is a+ Linux run with `SLINT_DEBUG_PERFORMANCE` and a log of the last callback+ before input stops.++2. **Windows exits silently with no compatible GPU adapter (#135).** The+ window acquires a device with `Backends::DX12` only and, without one, asks+ Slint for D3D by name (`platform.rs`), which refuses to start rather than+ fall back. Refusing to start was chosen so a silent CPU fallback would not+ hide a fault; it needs at least a message box before the exit, and an+ opt-in software path.++3. **Android export has no encoder (#130).** The Android build links a+ different FFmpeg; `VideoCodec::encoders` lists names the mobile build does+ not carry. Needs the mobile FFmpeg script to build x264 or MediaCodec+ encoding, and a test that every listed encoder exists on each target.++4. **Fade to black and white do not apply (#132).** Transitions are modelled+ in the plan now (`Transition::FadeTo`, `Shading`) and the compositors draw+ them, and the parity suite proves it, but the export still bakes fades into+ the decoder's FFmpeg chain. Filling the plan's `transitions` from the+ resolved transitions and dropping the chain is the fix, and it is the+ follow-up named in the proposal's §5 tick.++5. **Android and iPad layout (#92).** Not touched. The launch screen now has a+ phone shape; the editor's panes do not.++## 4. What is still poorly designed++- **The gestures.** `studio.rs` is 6 360 lines, and most of what remains is+ the drag, trim, razor, stage and brush machinery over the echo. It is one+ `Gesture` across the lanes and the stage, which is why it did not move with+ the panes. It should become its own module with a `Gesture` state machine+ and a test per gesture over a fake pointer.+- **Two shapes of the plan.** The plan can carry the crop, flips, transitions+ and mask, and the tests fill them, but the export still bakes the first+ three into the decoder and cuts the picture for the mask before planning.+ Until that moves, the decoder's chain and the plan can disagree, which is+ the drift the proposal set out to end.+- **`ExportClip` is still the wire type.** The CLI, the API and the title+ rasteriser speak it. Deleting it means the API takes the project model+ directly, which is a wire change.+- **Locales.** Fourteen locales, and the keys added this week are English in+ thirteen of them. The coverage test keeps that honest; it does not make it+ translated.+- **The Android crate has no tests** and nine `unsafe` blocks in a JNI bridge.+- **`unwrap` in the project crate's `lib.rs`** is mostly tests, but the file is+ 2 957 lines of them and should split by concern the way `commands/` did.++## 5. Test coverage++429 tests in 75 files. What is held hard:++- Every edit exports, end to end, over synthetic media, and the suite crashes+ on purpose rather than tolerating a bad file (`concat-host/tests/export.rs`,+ four scenarios, ~35 s).+- The GPU matches the CPU reference on thirteen plans by SSIM, every one at+ 0.9997 or better on this machine.+- The pool: eviction under budget, a scrub over covered ground decodes+ nothing, a proxy that vanished falls back, a request past the end is+ remembered.+- The scheduler: priority order, a reserved worker, a cursor that reverses.+- Hostile packages are refused at load; a table over budget too.+- Every locale covers the inventory.+- The panes' pure parts: rows are never reused, a marquee over zero columns,+ the zoom's limits and a NaN factor, the frame's size at every tier.++What is not covered: anything that needs a window (the repaint, the gestures,+the freeze in #99), Android, gRPC on CI (the feature builds and tests locally),+and the hardware decode paths on Windows and Android.++## 6. Performance, this machine++`cargo run -p concat-perf --release` on a 2023 MacBook, 19 September:++| Scenario | Measured | Budget |+|---|---|---|+| plan one frame of 200 clips on 4 tracks | 0.76 µs | ≤ 200 µs |+| 200 clip additions and 200 undos | 0.59 ms | ≤ 150 ms |+| save and open a 200-clip document (116 KB) | 1.90 ms | ≤ 60 ms |+| choose the visible clips of 200 for one publish | 0.22 µs | ≤ 50 µs |+| decode 1080p H.264 in software | 1 600 fps | ≥ 120 fps |+| decode 1080p H.264 on VideoToolbox | 308 fps | ≥ 120 fps |+| scrub forward over 90 frames, cold | 0.81 ms/frame | ≤ 25 ms |+| scrub back over covered ground | 0.24 µs/frame | ≤ 200 µs |+| decodes when an effect knob is turned | 0 | ≤ 0 |+| compose 1080p, 3 layers, sepia, CPU | 55 ms | ≤ 400 ms |+| compose 1080p, 3 layers, sepia, GPU with readback | 2.5 ms | ≤ 25 ms |+| export a 4 s 720p cut, two overlapping clips | 119 fps | ≥ 30 fps |++Hardware decode is slower than software here because the software decoder+runs on every core and the test file is a trivially-coded gradient; on real+4K H.264 the order reverses. The budgets are loose on purpose: they catch a+regression of two or three times, not a slow laptop.++## 7. Recommended order of work++1. Push `main` so CI goes green, and add the `--check` run of `concat-perf+ --quick` to the engine job.+2. Reproduce #99 on Linux with logging; it is the bug every user meets.+3. Fill the plan's crop, flips and transitions from the export and drop the+ decoder's chain for them; this closes #132 and ends the last two-path+ drift.+4. Move the gestures out of `studio.rs` into a state machine with tests.+5. A message before the exit, and a software path, for Windows without a+ usable adapter (#135).+6. The Android encoder (#130), with a test that every listed encoder links+ on every target.+7. Keep cached frames as textures in the GPU pool now that both compositors+ read a plan.+8. Translate the week's keys.