Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

test(verify): expect the Windows Instant audio trim and the variable encoder start

Richie McIlroy4891a1c6329e
diff --git a/crates/verify/expectations.toml b/crates/verify/expectations.toml
index 204668ab8..2bb3ab2fd 100644
--- a/crates/verify/expectations.toml
+++ b/crates/verify/expectations.toml
@@ -137,9 +137,17 @@ link = ""
[[xfail]]
case = "export/instant*/output/mp4/native"
class = "timestamps"
-platforms = ["macos"]
+platforms = ["macos", "windows"]
+flaky = true
+reason = "On macOS and Windows the Instant video timestamps follow the muxer's processing clock, not the capture timestamps: after the 2 s warmup VideoDriftTracker::calculate_timestamp (crates/recording/src/output_pipeline/core.rs) returns anchor_source + (wall clock when the frame is processed - anchor wall clock), and the anchor is the first frame processed after the first 2 s segment rollover. Any delay between capture and processing (late delivery, a muxer stall) moves frames by that delay, and a stall at the anchor shifts every later frame (860 ms in one fresh recording, frames 62-75 compressed into 35 ms). Linux uses CaptureInstantTimeline (capture cadence bounded by the wall clock) and is not affected. Fresh fixtures: 22 of 105 case runs on macos-15/26 (instant probe run 38735811849, every Instant variant), 1 of 7 in run 38735816076; spread 17-860 ms against the 16.7 ms limit. Windows shares the code path: on a starved windows-2022 runner (Engine verify 38818870844, windows shard 4, where the same tests ran 3 to 4.5 times slower than in other shards) the spread was 173.9 and 17.3 ms with the test emitter 273.5 and 17.6 ms late; 0 of 102 fresh Windows recordings otherwise (probes 38782202975, 38785649744)"
+link = ""
+
+[[xfail]]
+case = "export/instant-ungated-system-continuous-mic-late/output/mp4/native"
+class = "sync"
+platforms = ["windows"]
flaky = true
-reason = "On macOS the Instant video timestamps follow the muxer's processing clock, not the capture timestamps: after the 2 s warmup VideoDriftTracker::calculate_timestamp (crates/recording/src/output_pipeline/core.rs) returns anchor_source + (wall clock when the frame is processed - anchor wall clock), and the anchor is the first frame processed after the first 2 s segment rollover. Any delay between capture and processing (late delivery, a muxer stall) moves frames by that delay, and a stall at the anchor shifts every later frame (860 ms in one fresh recording, frames 62-75 compressed into 35 ms). Linux uses CaptureInstantTimeline (capture cadence bounded by the wall clock) and is not affected. Fresh fixtures: 22 of 105 case runs on macos-15/26 (instant probe run 38735811849, every Instant variant), 1 of 7 in run 38735816076; spread 17-860 ms against the 16.7 ms limit"
+reason = "NEW: the recorder deletes real audio samples when audio delivery latency falls. AudioGapTracker::detect_overlap (crates/recording/src/output_pipeline/core.rs, called from process_audio_frame) compares a frame's capture time against a wall-clock delta, so a delivery catch-up reads as overlap and the frame is trimmed; every later sample plays early. The saved Windows outputs lost exactly 279, 250 and 842 samples (5.8, 5.2 and 17.5 ms; mic and system shifted together, one step), reproduced deterministically by feeding those delivery schedules to the real function (sol-windows-audio-offset.md). Seen 3 times on windows-2022 (38764978019, 38780016448, 38804993000), about 1 in 35 recordings, and 0 of 102 in probes 38782202975 and 38785649744; never on macOS (30 recordings, -0.3 to +2.9 ms) or Linux (16, 0.0 ms), whose delivery in this harness does not catch up the same way. A fix PR is being built"
link = ""
[[xfail]]
@@ -303,7 +311,8 @@ link = ""
case = "recording/instant/screen-mic-system"
class = "sync"
platforms = ["macos"]
-reason = "NEW: the Instant screen track starts at its first encoded frame (the VideoToolbox encoder starts after the audio pipeline), so the screen plays early against mic and system audio: runners 34 to 92 ms (10 of 10 runs), developer Mac 340 to 570 ms (8 of 8)"
+flaky = true
+reason = "NEW: the Instant screen track starts at its first encoded frame (the VideoToolbox encoder starts after the audio pipeline), so the screen plays early against mic and system audio: runners 34 to 92 ms (10 of 10 runs), developer Mac 340 to 570 ms (8 of 8). The offset is the encoder start delay, which varies: in Verify recording 38818894595 (macos-26, one repeat) screen-mic was -8.5 ms, inside the allowed -10..+75 ms, so the check passed; flaky until the screen track is anchored to the recording start"
link = ""
[[xfail]]