Closed Bug 1779953 Opened 2 years ago Closed 2 years ago

CompositionRecorder records previous frame rather than current frame

Categories

(Core :: Graphics: WebRender, defect)

defect

Tracking

()

RESOLVED FIXED
104 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox-esr102 --- wontfix
firefox102 --- wontfix
firefox103 --- wontfix
firefox104 --- fixed

People

(Reporter: lsalzman, Assigned: lsalzman)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: perf, regression)

Attachments

(1 file)

Both I and Timothy Nikkel noticed that CompositionRecorder results seem to be late by a frame, as if it was recording the previous frame rather then the current frame. Timothy suspected that this was because MaybeRecordFrame was called after EndFrame (and thus SwapBuffers).

On further analysis, this was indeed true, and means that the recorded frame was coming from the state of the GL back buffer immediately after a call to SwapBuffers, which is in general undefined, and at best will tend to give you an older version of the back buffer from a previously rendered frame (or a completely new buffer), depending on the GL driver's internal buffer handling.

This has the side effect of skewing test results in harnesses that depend on the frame timestamps being accurate, such as browsertime.

If MaybeRecordFrame is called after EndFrame, this means we are reading from
the back buffer state immediately after a call to SwapBuffers. The state of
the back buffer is undefined in that scenario, and mostly was just returning
old frames. We actually want to call MaybeRecordFrame before EndFrame, so we
get the valid contents of the back buffer before it is swapped out.

Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
Blocks: gpu-canvas

Set release status flags based on info from the regressing bug 1551735

It seems that for a lot of browsertime tests, the *SpeedIndex and *VisualChange metrics were being inaccurately judged because the duration of the orange frame used to track the first visual change was wrong. The CompositionRecorder was assigning the duration of the current frame to the contents of the previous frame (you could view this inversely as it having assigned the duration of the next frame to the contents of the current frame). Now that the CompositionRecorder is actually outputting the correct screenshot contents with the correct associated timestamp, browsertime is now getting the correct duration of time associated with the content. We will see a lot of browsertime tests seemingly "regress" as a result of this fix, but these are our true results, whereas the other ones were just illusory and somewhat random.

Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/29943068938a
Ensure MaybeRecordFrame is called before EndFrame. r=tnikkel
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: