Skip to content

Commit 58db9cc

Browse files
committed
chore: merge main into website live hero branch
2 parents 37a20c5 + db9ba2a commit 58db9cc

19 files changed

Lines changed: 54 additions & 31 deletions

File tree

‎src/components/ai-edition/RightPanes.layout.test.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,11 @@ describe("LayoutPane picture-in-picture camera", () => {
286286
expect(stored()).toMatchObject({ webcamAnchor: "right" });
287287
});
288288

289-
it("offers a camera from 15% to 50% of the frame", () => {
289+
it("offers a camera from 15% to 60% of the frame", () => {
290290
renderLayout(seedProject(true));
291291
const slider = screen.getByRole("slider", { name: "Webcam size" });
292292
expect(slider).toHaveAttribute("min", "15");
293-
expect(slider).toHaveAttribute("max", "50");
293+
expect(slider).toHaveAttribute("max", "60");
294294
});
295295
});
296296

‎src/components/ai-edition/v4/V4Timeline.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
Pencil,
1212
Scissors,
1313
Sparkles,
14-
SplitSquareHorizontal,
1514
Trash2,
1615
Wand2,
1716
ZoomIn,
@@ -1534,7 +1533,7 @@ export function V4Timeline({
15341533
id: "cut",
15351534
label: t("buttons.addTrim"),
15361535
shortcut: formatBinding(shortcuts.addTrim, isMac),
1537-
icon: <SplitSquareHorizontal size={16} />,
1536+
icon: <Scissors size={16} />,
15381537
},
15391538
{
15401539
id: "comment",

‎src/components/video-editor/types.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import { clamp01 } from "@/utils/math";
1111
export type { ZoomDepth, ZoomScaleInput };
1212
export type ZoomFocusMode = "manual" | "auto";
1313
export type { WebcamLayoutPreset };
14-
/** Webcam size as a percentage of the canvas reference dimension (15-50). */
14+
/** Webcam size as a percentage of the canvas reference dimension (15-60). */
1515
export type WebcamSizePreset = number;
1616

17-
export const DEFAULT_WEBCAM_SIZE_PRESET: WebcamSizePreset = 25;
17+
export const DEFAULT_WEBCAM_SIZE_PRESET: WebcamSizePreset = 40;
1818

1919
export const DEFAULT_WEBCAM_LAYOUT_PRESET: WebcamLayoutPreset = "picture-in-picture";
2020

‎src/lib/ai-edition/store/editorSettings.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ describe("patchEditorSettings", () => {
264264
expect(read({})).toEqual(["square", 0.7]);
265265
});
266266

267-
it("reads a camera size outside the slider's 15–50% into it", () => {
267+
it("reads a camera size outside the slider's 15–60% into it", () => {
268268
const read = (webcamSizePreset: number) =>
269269
getEditorSettings({ ...baseDoc, legacyEditor: { webcamSizePreset } }).webcamSizePreset;
270270
// An older build allowed 10%.
271271
expect(read(10)).toBe(15);
272-
expect(read(80)).toBe(50);
272+
expect(read(80)).toBe(60);
273273
});
274274

275275
it("preserves a non-zero crop at the bottom-right edge", () => {

‎src/lib/compositeLayout.test.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe("computeCompositeLayout", () => {
8181
});
8282

8383
const refDim = Math.sqrt(1280 * 720);
84-
const defaultFraction = 25 / 100; // DEFAULT_WEBCAM_SIZE_PRESET = 25
84+
const defaultFraction = 40 / 100; // DEFAULT_WEBCAM_SIZE_PRESET = 40
8585
expect(layout).not.toBeNull();
8686
expect(layout!.webcamRect).not.toBeNull();
8787
expect(layout!.webcamRect!.width).toBeLessThanOrEqual(Math.round(refDim * defaultFraction) + 1);
@@ -580,7 +580,7 @@ describe("computeCompositeLayout", () => {
580580

581581
// A fraction of half the short side: the same value is the same shape at any size.
582582
it("rounds by the roundness, and a fully round square is a circle", () => {
583-
const circle = pipAt({ webcamMaskShape: "square", webcamRoundness: 1 });
583+
const circle = pipAt({ webcamMaskShape: "square", webcamRoundness: 1, webcamSizePreset: 25 });
584584
expect(circle.width).toBe(circle.height);
585585
expect(circle.borderRadius).toBe(circle.width / 2);
586586
expect(pipAt({ webcamRoundness: 0 }).borderRadius).toBe(0);
@@ -612,10 +612,10 @@ describe("computeCompositeLayout", () => {
612612
}
613613
});
614614

615-
// The size is the camera's long side: a 16:9 camera at the 50% cap is 540 x 304 in 1080p.
616-
it("caps the camera at 50% of the short side", () => {
617-
expect(pipAt({ webcamSizePreset: WEBCAM_SIZE_MAX })).toMatchObject({ width: 540, height: 304 });
618-
expect(pipAt({ webcamSizePreset: 80 }).height).toBe(304);
615+
// The size is the camera's long side: a 16:9 camera at the 60% cap is 648 x 365 in 1080p.
616+
it("caps the camera at 60% of the short side", () => {
617+
expect(pipAt({ webcamSizePreset: WEBCAM_SIZE_MAX })).toMatchObject({ width: 648, height: 365 });
618+
expect(pipAt({ webcamSizePreset: 80 }).height).toBe(365);
619619
});
620620
});
621621

‎src/lib/compositeLayout.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ export function computeCompositeLayout(params: {
426426
screenSize,
427427
webcamSize,
428428
layoutPreset = "picture-in-picture",
429-
webcamSizePreset = 25,
429+
webcamSizePreset = 40,
430430
webcamAnchor = "bottom-right",
431431
webcamMaskShape = "rectangle",
432432
webcamRoundness = DEFAULT_WEBCAM_ROUNDNESS[

‎src/lib/projectDefaults.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ const LEGACY_WEBCAM_ROUNDNESS = 0.3;
148148

149149
/**
150150
* The picture-in-picture camera's size, in percent of the frame's short side: the camera's
151-
* long side, so a 16:9 camera at 50 is 28% of a 1080p frame's height. Below 15 a face no
151+
* long side, so a 16:9 camera at 60 is 34% of a 1080p frame's height. Below 15 a face no
152152
* longer reads, and less still once a zoom shrinks it; older builds allowed 10, read back as 15.
153153
*/
154154
export const WEBCAM_SIZE_MIN = 15;
155-
export const WEBCAM_SIZE_MAX = 50;
155+
export const WEBCAM_SIZE_MAX = 60;
156156

157157
/**
158158
* Reads a stored camera shape and roundness. `circle` and `rounded` were a proportion and a
@@ -253,7 +253,7 @@ export const DEFAULT_PROJECT_APPEARANCE: ProjectAppearanceDefaults = {
253253
webcamRoundness: DEFAULT_WEBCAM_ROUNDNESS.square,
254254
webcamMirrored: false,
255255
webcamReactiveZoom: true,
256-
webcamSizePreset: 25,
256+
webcamSizePreset: 40,
257257
webcamAnchor: "bottom-right",
258258
webcamBackgroundMode: "none",
259259
webcamWallpaper: "/wallpapers/wallpaper11.jpg",

‎src/native/sceneDescription.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,11 +1259,11 @@ describe("buildSceneDescription.settings mapping", () => {
12591259
expect(buildSceneDescription(doc).layout.webcamSize).toBeCloseTo(0.334, 5);
12601260
});
12611261

1262-
it("webcamSize clamps below 15 and above 50", () => {
1262+
it("webcamSize clamps below 15 and above 60", () => {
12631263
const low = makeDoc({ legacyEditor: { webcamSizePreset: 2 } });
12641264
const high = makeDoc({ legacyEditor: { webcamSizePreset: 90 } });
12651265
expect(buildSceneDescription(low).layout.webcamSize).toBeCloseTo(0.15, 5);
1266-
expect(buildSceneDescription(high).layout.webcamSize).toBeCloseTo(0.5, 5);
1266+
expect(buildSceneDescription(high).layout.webcamSize).toBeCloseTo(0.6, 5);
12671267
});
12681268

12691269
it("carries the camera's anchor, the point its zoom-time shrink keeps fixed", () => {

‎technical-documentation/engineering/rendering-performance.md‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,28 @@ All three in one afternoon, with the editor open in the background (~40 % of a c
354354

355355
**Reading the GPU on this machine:** ACO's statistics come out only when a pipeline is compiled, and Mesa's disk cache skips compilation for a shader it has seen — set `MESA_SHADER_CACHE_DISABLE=true` or the shader you are measuring prints nothing. Per-pass timestamps read back synchronously every frame disturb the clocks and the overlap with decode; trust the span of a frame and repeated wall-clock runs over a single draw's number.
356356

357+
### The same fix on Windows — 2026-10-03
358+
359+
The same laptop under Windows 11 (26200): D3D11 on the Radeon iGPU, `h264_amf` encode, the same benchmark scenario, three builds in one session. Each ran from the app tree of its CI-built installer, side by side in one directory. 2.0.0-rc.13 is the build for the fix: its tag has the same `crates/`, `electron/`, `src/` and `scripts/` as `main` at `0624c148`, and its export path differs from rc.12's by `compositor_view.node` alone (the ffmpeg DLLs are hash-identical).
360+
361+
| | 1.11.0-rc.1 | 2.0.0-rc.12 | 2.0.0-rc.13 (= `main`) |
362+
|---|---:|---:|---:|
363+
| benchmark median | 34.18 s ± 0.73 | 116.79 s ± 2.36 | 35.05 s ± 0.46 |
364+
| local `h264_amf` floor | 19.83 s | 24.42 s | 20.54 s |
365+
| × its local floor | 1.72 | 4.78 | 1.71 |
366+
| foreign load, export / floor | 88 % / 61 % | 154 % / 206 % | 72 % / 72 % |
367+
368+
**The regression was worse here than on Linux**, 4.78× against 2.43×: the export ran at half real time. The fix takes it back to 1.11 exactly. rc.12's row ran under the heaviest foreign load of the three, and its floor spread from 20.8 to 30.4 s, which inflates its cost somewhat. Its raw seconds, 3.3× rc.13's, do not depend on the floor. The load came from a Claude client, FocuSee, Steam, Discord and Slack idling; there was no remote session (Parsec's last guest left on 2026-09-30). The benchmark's `calibration.json` was the M1's, the same for all three rows, so it moves nothing between them.
369+
370+
**The pixels did not change.** rc.13's three scoring exports are byte-identical to rc.12's (md5 `e8ce4b86…`). Its warm-up export, the build's first run on the machine, differed in the first GOP only: 23–39 pixels off by ±2 in frames 1–29, gone at the next I-frame. A fresh copy of the build in a new directory exported `e8ce4b86…` straight away, so it did not reproduce. Twelve-second variants exported by both builds:
371+
372+
- **Byte-identical:** the 3D cursor with click impact and the laptop frame with its shadow; the window frame (`sd_screen_under_bar`); a solid colour with Aurora.
373+
- **Different, invisibly:** a gradient with 70 % background blur, and an image with Waves, 40 % blur and the phone frame. Each build is deterministic on its own. Between them, PSNR is at least 76 and 67 dB, the differences are macroblock-shaped in the screen and camera content, and side-by-side crops cannot be told apart. The blurred background is now drawn once and copied, and a one-level difference upstream gets redistributed by the encoder's rate control.
374+
375+
In the editor (a dev build of `main` with rc.13's native directory), the preview followed every change while the static background is cached: image → colour → colour → gradient → image, blur 100 → 0 → 50, and a window resize from 1508×794 to 1028×650. Aurora kept the background moving between two programme times (mean difference 3.47 on the border), while None left it unchanged (0.01).
376+
377+
No register counts: Radeon GPU Analyzer was not run, so the VGPR explanation under fxc is inferred from the Linux measurement and from this outcome, not measured.
378+
357379
## How we got here — the WebCodecs trail
358380

359381
> **This section is history.** It records the measurements that killed the browser-based export pipeline and motivated the native one. The code it describes is **gone**: `src/lib/exporter/videoExporter.ts`, `src/bench/runBench.ts` and the `npm run bench:export` script were deleted with the web MP4 pipeline. It is kept because it is the evidence for [why the compositor, not the encoder, was the wall](#the-wall-is-the-compositor) — which is the entire reason `crates/compositor/` exists — and because the [measurement hazards](#measurement-hazards) it uncovered still apply to any new benchmark here.
@@ -821,7 +843,7 @@ the bench runs on the reference machine.
821843

822844
## Known gaps
823845

824-
- **The D3D11 and Metal layer shaders were split like the WGSL one without a measurement on either.** Whether an AMD or Intel iGPU under Windows paid the same occupancy for the models is unknown, and so is what the split buys there; the M1 showed no regression on 2.0, which says nothing about fxc's register allocation. [The Linux section](#the-linux-export-path--2026-10-02) has the method — the register counts first, then the export. The static-background cache (keyed by the shared `BackgroundKey`) and the scissored cursor-trail composite were ported to both, unmeasured as well.
846+
- **The Metal layer shader was split like the WGSL one without a measurement, and D3D11 only on an AMD iGPU.** On the Ryzen 5 7520U under Windows, the split, the static-background cache and the scissored trail together took the export from 4.78× to 1.71× its floor, level with 1.11.0-rc.1's 1.72×. The benchmark's scoring exports were byte-identical, and so were the model and frame variants; only the blurred-background variants differed, invisibly ([the Windows A/B](#the-same-fix-on-windows--2026-10-03)). Still owed: an Intel iGPU under Windows, fxc's register counts (Radeon GPU Analyzer, `ps_main` against `ps_main_models`), and an A/B on the M1, where the published figures are 1.04× for 1.11.0-rc.1 and 1.11× for 2.0.0-rc.12. [The Linux section](#the-linux-export-path--2026-10-02) has the method: register counts first, then the export.
825847
- **macOS export startup can cost 4 s, and nobody has reproduced it on demand.** Measured repeatedly at 4208–4502 ms between the CLI's `started` event and the first composed frame — 18 % of a 60 s export, 71 % of a 5 s one — then gone, on the same shipped binary, hours later (481 ms). It is not the compositor (init is 2.4 ms, runtime MSL compilation included), not the `<video>` metadata probes (13 ms and 6 ms), not the CLI prologue (24 ms total), and not the renderer entry point (measured at −0.1 %). It correlates with memory pressure on an 8 GiB machine — `387M unused / 2613M compressor` while it reproduced, `564M unused / 1837M compressor` after — which would fit faulting ~1.8 MB of module chunks out of a 274 MB `app.asar` while the compressor thrashes: seconds of wall clock, no CPU in either process, cost independent of the media. Untested. Recreating the pressure deliberately and watching it return is what would settle it, and then whether asar size is the lever.
826848
- **10-bit and HEVC decode on macOS are unmeasured.** The export's decode predicate is `codec_id == H264 && format == YUV420P`, so both keep VideoToolbox untested. HEVC is the case most likely to invert the result, since its software decoder is materially more expensive. 10-bit needs work beyond the predicate first: `mac_frames::CpuFrames` converts to 8-bit NV12, so routing 10-bit through the software path would silently truncate — the predicate is currently what prevents that.
827849
- **The macOS preview's decode backend has never been measured.** `DecodeIntent` splits preview from export precisely so the preview could keep the old arbitration; the export won on throughput, but the preview scrubs, where seek latency after `avcodec_flush_buffers` may matter more, and it shares the machine with the editor UI. Changing it without measuring it would be the same mistake the export change corrects.

0 commit comments

Comments
 (0)