Repository navigation
Conversation
Add one command that measures playback frame rate and frame latency at two preview qualities on the same project. It does not write the saved quality and does not change the platform default.
|
@kyzer1023 is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
| for pair in summaries.windows(2) { | ||
| match ranges_overlap(metric(&pair[0]), metric(&pair[1])) { |
There was a problem hiding this comment.
metric_overlap checks only neighboring qualities. With --preview-compare-qualities quarter,half,full, ranges of 50..60, 20..30, and 55..65 produce false, even though the first and third overlap. This can mislead anyone comparing three qualities. Check every distinct pair before reporting that the ranges do not overlap.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/editor_latency_bench.rs
Line: 1191-1192
Comment:
**Range comparison skips pairs**
`metric_overlap` checks only neighboring qualities. With `--preview-compare-qualities quarter,half,full`, ranges of 50..60, 20..30, and 55..65 produce `false`, even though the first and third overlap. This can mislead anyone comparing three qualities. Check every distinct pair before reporting that the ranges do not overlap.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in 1f42c2c. metric_overlap now checks every distinct quality pair (i < j) instead of only adjacent pairs, with a unit test (non_adjacent_qualities_still_count_as_overlapping) covering the non-adjacent overlap case.
| Stage::Rendered, | ||
| frame, | ||
| 0, | ||
| painted - Duration::from_millis(8), |
There was a problem hiding this comment.
Tests use forbidden time subtraction
The new steady_playback helper subtracts Duration values directly from an Instant, here and at line 608. The repository instructions forbid unchecked time subtraction, including in tests. Use checked_sub(...).expect(...) for these known fixture offsets. This repository requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/editor_latency.rs
Line: 602
Comment:
**Tests use forbidden time subtraction**
The new `steady_playback` helper subtracts `Duration` values directly from an `Instant`, here and at line 608. The repository instructions forbid unchecked time subtraction, including in tests. Use `checked_sub(...).expect(...)` for these known fixture offsets. This repository requirement must be satisfied before merging.
**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in 1f42c2c. Replaced unchecked Instant - Duration subtraction in steady_playback with checked_sub(...).expect(...) and verified no other unchecked time subtraction remains in the diff.
Range overlap now checks every quality pair, so a non-adjacent overlap is reported. Playback fixtures subtract known offsets with checked_sub.
…2 fixes pushed, ID2 Sway running
The test uses the Linux editor window fixture, so it is gated the same way as the other editor window tests.
Why
Editor preview is Full on Apple Silicon and Half on every other machine until Full is measured there (#4392). This adds the reproducible Half vs Full benchmark and reports measurements across three real GPUs and software rendering. The platform default stays Half.
What changed
cargo run --release -- --preview-compare <project.cap>fromapps/desktop-gpuiplays the same project at half and full across alternating repeats (default 5). It prints the adapter, playback frames per second, playback and pause p95 frame latency, painted size, range overlap, anddefault_unchanged. The quality change stays in memory.Scope
The editor latency bench, the in-memory preview quality setter, and one argument parse in
apps/desktop-gpui/src/main.rs.EditorPreviewQuality::for_this_machineis unchanged.Tradeoffs
Playback frame latency is the p95 from the render callback to paint over seconds 1 to 10 of a 10 s play. Decode cost shows up as presented frame rate and skipped source frames. Pause latency is the wait until a painted frame covers the canvas.
Blast Radius
The sweep does not call
set_editor_preview_quality. A unit test verifies the store file is unchanged, and every release run confirmeddefault_unchanged=truewith noeditorPreviewQualitykey written. Any future default change stays a single condition infor_this_machine.Verification
Release builds, 5 alternating repeats, synthetic 1920x1080 15 s H.264 project (
resolution_changed=true,default_unchanged=true,errors=0, Half1248x702vs Full1920x1080). 22 unit tests passed.overlap=true).present_interval_p951003 to 1022 ms, rendered ~59.9 fps); ranges overlap.Takeaway: Full keeps ~56 to 60 fps on Radeon 780M and MX150, but regresses on software rendering and hits higher p95 latency alongside a 1 Hz present bottleneck on Intel UHD 620, so keeping the default Half off Apple Silicon is warranted until more adapters are measured. Windows NVIDIA/Intel GPUs were not tested.


Confidence Score: 5/5
The PR appears safe to merge; both previous findings are fixed and no new blocking issue remains.Summary
Adds an opt-in Half versus Full preview benchmark without changing the platform default.
Reviews (3) · Last reviewed commit: "fix(desktop): compile the preview measur..." · Reviewed by Greptile