Keep a clip that starts later playing at its first frame
The e2e 68 check "a clip that starts later" was red in 3 of the last 8 suites (CI tasks 697, 703, 712). Two causes sat on top of each other. - The check measured too late. It started sampling after play(), and under CI load the clock was already at 0.05 to 0.22 s. It now starts before the click, like 68d does. - Measured early, a real bug showed: the video held for one frame at its first picture. The first picture triggers a redraw, and the game takes its first step in the same frame. readSpeed got both calls with the same frame time and divided by 1 ms. The speed came out at 16.7x, which counted as a jump, so the player paused. - readSpeed now measures a step without elapsed wall time against one frame at 60 fps. A real jump still counts as a jump. - e2e 34 "the pause holds the stream" also failed in task 712. Its cause is still open. The failure message now names the state before the pause, so the next red run shows where the samples got lost. Tests: - video-follow.test.ts 18/18, the new test is red without the fix - e2e 68 on melektaus-atx: ALL PASSED, 21 checks - Gate on melektaus-atx: CHECK EXIT 0, 314 files, 4853 tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0d7672a5af
commit
5b9d084dfe
4 files changed
+42
-12
No files matched your search
@@ -59,7 +59,11 @@ export function readSpeed(reading: SpeedReading | null, time: number, now: numbe
|
||||
while (samples.length > 2 && now - samples[1]!.at >= SPEED_SPAN_MS) samples.shift();
|
||||
const first = samples[0]!;
|
||||
const span = now - first.at;
|
||||
const pace = ((time - first.time) * 1000) / Math.max(span, 1);
|
||||
// Asked twice in one frame, the time moved in no time at all: the first picture of a video
|
||||
// redraws the view at once, then the game takes its first step in the same frame. Read over a
|
||||
// millisecond that step was a jump and the video held a frame at its start (CI task 712), so it
|
||||
// counts over a frame at 60 fps.
|
||||
const pace = ((time - first.time) * 1000) / (span > 0 ? span : 1000 / 60);
|
||||
if (span >= SPEED_WINDOW_MS) return { samples, speed: pace };
|
||||
// A start from standing plays at 1x until the window has its reading: held and sought frame by
|
||||
// frame instead, the first pictures of a cut stuck and were skipped. A step faster than a video
|
||||
|
||||
Reference in new issue
Block a user