Just to confirm, is the trace in question from the 3rd run of Commit 898254 of the pinpoint run (https://pinpoint-dot-chromeperf.appspot.com/job/1682012e320000)?
On Wed, Jul 21, 2021 at 10:33 AM Behdad Bakhshinategh <beh...@chromium.org> wrote:Just to confirm, is the trace in question from the 3rd run of Commit 898254 of the pinpoint run (https://pinpoint-dot-chromeperf.appspot.com/job/1682012e320000)?Yes. Sorry for the typo.On Wed, Jul 21, 2021 at 1:21 PM Chris Harrelson <chri...@chromium.org> wrote:+Michal Mocny +Behdad Bakhshinategh +Jonathan Ross This sounds like more instances of the things being discussed as part of the smoothness metric project? Maybe there are more insights in this example?
On Wed, Jul 21, 2021 at 10:19 AM Xianzhu Wang <wangx...@chromium.org> wrote:Thanks Mingjing for the answer.However, it seems that some of such dropped frames are counted into PercentDroppedFrame. The trace's PercentDroppedFrames.AllSequences is 2.333 (from 3 values: 6, 2, 0). The frame counts in the sequences are (produced/expected): 265/281, 268/284, 298/299, 298/299, 185/185, 182/182. There are 34 dropped frames reported in PercentDroppedFrames, but only 9 dropped frame alerts (some of which seem to happen before the real measurement starts).In PipelineReporter, there are constantly STATE_PRESENTED_PARTIAL frames during the whole test, but during most of the time, there are no long frames in FrameSequenceTracker. Are there other reasons causing the long frames at the beginning of the sequence (between 5500ms and 6900ms)?Also I would like to know the reason for the dropped frame alerts at 5496ms and 5530ms, so that I can find a way to avoid them. PipelineReporter shows STATE_DROPPED (do we only report such frames as dropped frame alerts?), but the CPU looks mostly idle, and there are no long tasks in the main thread or the compositor thread. Any hints about the reason for such dropped frames?On Wed, Jul 21, 2021 at 9:18 AM Mingjing Zhang <mjz...@chromium.org> wrote:Hi Xianzhu,In this particular trace, it appears that most frames are actually not dropped, but rather "partially presented", i.e. main updates do get displayed but are lagging behind. Such frames are reported with STATE_PRESENTED_PARTIAL state in the PipelineReporter, and will not show up in the dropped frame alerts. I believe these partially presented frames are no longer counted into PercentDroppedFrame metrics either. See https://crbug.com/1210636.
Thanks Behdad for the detailed explanation.I still have several questions:1. The reason for PR_2 seems that PR_1 is slow. However when starting PR_2, how do we know PR_1 will be slow? (I feel my understanding of "starting PR_2" is wrong, but I'm still asking like this, hoping the answer will help me correctly understand it :) )
2. What is "EndActivateToSubmitCompositorFrame" waiting for exactly? The end of PR_1 seems much later than the end of the "DrawAndSwap" during the same time span.3. For PR_2 of frame 151, is it possible that the frame doesn't need submit because there is no change?4. The main thread updates are faster around the dropped frames. It seems that if the main thread updates were slower, the frames wouldn't be dropped because the next frame wouldn't be activated before the current frame was submitted. It's weird, but can we say faster main thread updates could cause dropped frames? A trace before the regression doesn't have the faster main thread updates.
Thanks Behdad for the detailed explanation.I still have several questions:1. The reason for PR_2 seems that PR_1 is slow. However when starting PR_2, how do we know PR_1 will be slow? (I feel my understanding of "starting PR_2" is wrong, but I'm still asking like this, hoping the answer will help me correctly understand it :) )
2. What is "EndActivateToSubmitCompositorFrame" waiting for exactly? The end of PR_1 seems much later than the end of the "DrawAndSwap" during the same time span.
3. For PR_2 of frame 151, is it possible that the frame doesn't need submit because there is no change?
4. The main thread updates are faster around the dropped frames. It seems that if the main thread updates were slower, the frames wouldn't be dropped because the next frame wouldn't be activated before the current frame was submitted. It's weird, but can we say faster main thread updates could cause dropped frames? A trace before the regression doesn't have the faster main thread updates.
There are also long frames in FrameSequenceTracker without dropped frame alerts, e.g. the one starting at 5554ms, duration 86ms (5 vsyncs). The frame covers 10 PRs, 5 of them are STATE_PRESENTED_ALL and others are STATE_PRESENTED_PARTIAL. There is no compositor animation or scroll. The test is a JS animation test. I compared the traces during long frames and during short/smooth frames, and didn't find any difference. What am I missing?
I tried answering some of your questions below.But overall, I should note that the current dropped frame alerts are simply looking at the state of each PR and create and alert for every dropped frame and that is not fully matching the definition of dropped frame used for calculation of "Graphics.Smoothness.PercentDroppedFrames.AllSequences". For example the initial three dropped frame alerts (around 3080ms time) are not contributing to the percent dropped frames because no sequence is started yet. Also based on the length of sequence (around 13s) we would have about 700 frames and an increase of 1.7 percent dropped frames would mean around 10 more frames being dropped which are not shown with comparing the dropped frame alerts of traces before and after the change.On Fri, Jul 23, 2021 at 8:24 PM Xianzhu Wang <wangx...@chromium.org> wrote:Thanks Behdad for the detailed explanation.I still have several questions:1. The reason for PR_2 seems that PR_1 is slow. However when starting PR_2, how do we know PR_1 will be slow? (I feel my understanding of "starting PR_2" is wrong, but I'm still asking like this, hoping the answer will help me correctly understand it :) )As Michal explained, PR_1 and PR_2 are reporting the same frame, and they are not two different pieces of work that might block each other. We usually like to have one PR per frame (example of that would be PR with frame sequence of 150), but for a frame that is reaching it's deadline, and we will be submitting it partially (the compositor side update is ready and main thread update is not), we would report that frame using two PRs being the PR_1 and PR_2 to report both the partial update and it's breakdowns (PR_2) and later on the full update including the main thread work (PR_1).
2. What is "EndActivateToSubmitCompositorFrame" waiting for exactly? The end of PR_1 seems much later than the end of the "DrawAndSwap" during the same time span.I'm not sure about that, to know the details of that we need to look into the scheduler and how it decides how much to wait.
In terms of "DrawAndSwap" I think the initial one goes unused and the later "DrawAndSwap" is used for the frame. To check for the corresponding "DrawAndSwap" look at the last breakdown of the PR, "SubmitCompositorFrameToPresentationCompositorFrame" and more specifically its own breakdown of "StartDrawToSwapStart".3. For PR_2 of frame 151, is it possible that the frame doesn't need submit because there is no change?
No, if that was the case, the state would be reported as "NO_UPDATE_DESIRED", also looking at other flags of the PR, that frame has an active has_main_animation.4. The main thread updates are faster around the dropped frames. It seems that if the main thread updates were slower, the frames wouldn't be dropped because the next frame wouldn't be activated before the current frame was submitted. It's weird, but can we say faster main thread updates could cause dropped frames? A trace before the regression doesn't have the faster main thread updates.There are also long frames in FrameSequenceTracker without dropped frame alerts, e.g. the one starting at 5554ms, duration 86ms (5 vsyncs). The frame covers 10 PRs, 5 of them are STATE_PRESENTED_ALL and others are STATE_PRESENTED_PARTIAL. There is no compositor animation or scroll. The test is a JS animation test. I compared the traces during long frames and during short/smooth frames, and didn't find any difference. What am I missing?There is an issue with how FrameSequenceTracker separates frames that we noticed in these traces, the issue is most likely related to out of sync presentation feedback that is used for cutting the time into frame segments in frame sequence tracker.
Thanks Michal and Behdad for the detailed answers!On Mon, Jul 26, 2021 at 8:55 AM Behdad Bakhshinategh <beh...@chromium.org> wrote:I tried answering some of your questions below.But overall, I should note that the current dropped frame alerts are simply looking at the state of each PR and create and alert for every dropped frame and that is not fully matching the definition of dropped frame used for calculation of "Graphics.Smoothness.PercentDroppedFrames.AllSequences". For example the initial three dropped frame alerts (around 3080ms time) are not contributing to the percent dropped frames because no sequence is started yet. Also based on the length of sequence (around 13s) we would have about 700 frames and an increase of 1.7 percent dropped frames would mean around 10 more frames being dropped which are not shown with comparing the dropped frame alerts of traces before and after the change.On Fri, Jul 23, 2021 at 8:24 PM Xianzhu Wang <wangx...@chromium.org> wrote:Thanks Behdad for the detailed explanation.I still have several questions:1. The reason for PR_2 seems that PR_1 is slow. However when starting PR_2, how do we know PR_1 will be slow? (I feel my understanding of "starting PR_2" is wrong, but I'm still asking like this, hoping the answer will help me correctly understand it :) )As Michal explained, PR_1 and PR_2 are reporting the same frame, and they are not two different pieces of work that might block each other. We usually like to have one PR per frame (example of that would be PR with frame sequence of 150), but for a frame that is reaching it's deadline, and we will be submitting it partially (the compositor side update is ready and main thread update is not), we would report that frame using two PRs being the PR_1 and PR_2 to report both the partial update and it's breakdowns (PR_2) and later on the full update including the main thread work (PR_1).Are the following correct about PR_2 of frame 149:- The works are actually from frame 148.
- The STATE_PRESENTED_PARTIAL means that the updates from frame 148 are presented (after frame 149 is started), but the updates for frame 149 haven't been presented yet.
--
To unsubscribe from this group and stop receiving emails from it, send an email to graphics-dev...@chromium.org.
We have an upcoming project to move compositing decisions off the main thread and these issues will likely impact that project too (+szager).Is it correct to say that there are two bugs in PercentDroppedFrames?1. If a compositor frame finds out there is a new main frame due to faster main frames, the compositor frame can be dropped when it wouldn't have been with a slower main frame.
2. FrameSequenceTracker separates frames for an unknown reason, possibly related to ordering of frames.
On Tue, Jul 27, 2021 at 3:08 PM Philip Rogers <p...@chromium.org> wrote:We have an upcoming project to move compositing decisions off the main thread and these issues will likely impact that project too (+szager).Is it correct to say that there are two bugs in PercentDroppedFrames?1. If a compositor frame finds out there is a new main frame due to faster main frames, the compositor frame can be dropped when it wouldn't have been with a slower main frame.I don't think so, the cause of the frame dropping is it taking longer than a vsync to be produced, the faster next main frame is not the cause of frame being dropped, but just a cuttingpoint for giving up on the previous frame because we have a more recent update ready to be presented.
Hi,I believe what we are seeing at frame 150 -> 151 we are seeing a complicated interaction.(TLDR: 151 misses 2 VSyncs and is never shown.)PipelineReporters' presentation state is tied to the frame_sequence number, and this is applied retroactively. So if a Compositor-thread frame submits for frame X, it won't decide on PARTIAL/ALL until the Main-thread has completed for frame X as well. The previous Main-thread frame (X-1) submitting within that VSync won't directly affect the submission result.Looking at 150,151
- 150 is both Main and Compositor(Impl) successfully submitting in time.
- 151 Impl has no damage, and there is no update from 151 Main.
- This would have been PARTIAL if 151 Main had submitted within the next VSync. However it did not, 152 starts and the content of 151 is never shown. That is why 151 is DROPPED