Calculate AnimationError and AnimationTime for generated frames#669
Open
markgalvan-intel wants to merge 1 commit into
Open
Calculate AnimationError and AnimationTime for generated frames#669markgalvan-intel wants to merge 1 commit into
markgalvan-intel wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the unified swap-chain metrics pipeline to compute AnimationError and AnimationTime per displayed frame (including generated frames) by buffering display-instance “rows” until both animation context (app-to-app interval resolution) and display-timing lookahead are available, while preserving ingest order and handling simulation-source transitions.
Changes:
- Introduces a row-based processing pipeline (
DisplayFrameQueue+AnimationErrorTracker) and routes console/middleware/API ingestion throughUnifiedSwapChain::ProcessPresent(). - Splits swap-chain state updates into V1/V2-specific paths and adds
ReadyDisplayRow/AnimationDisplayContextto carry per-display-instance context. - Updates API2 CSV verification helpers to throw on metric mismatches and adds a unit test to ensure not-displayed rows preserve last-displayed state.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| PresentMon/OutputThread.cpp | Switches console processing to new ProcessPresent() path for V2 and updates V1 handling/seed behavior. |
| PresentData/PresentMonTraceConsumer.cpp | Adds helper to ignore/log duplicate Application FlipFrameType events. |
| IntelPresentMon/UnitTests/SwapChainTests.cpp | Adds regression test to ensure not-displayed rows don’t clear last-displayed state. |
| IntelPresentMon/PresentMonMiddleware/FrameMetricsSource.cpp | Routes middleware metrics through UnifiedSwapChain::ProcessPresent(). |
| IntelPresentMon/PresentMonAPI2Tests/CsvHelper.h | Adds *OrThrow helpers and simplifies per-column validation logic. |
| IntelPresentMon/CommonUtilities/mc/UnifiedSwapChain.h | Replaces Enqueue() interface with ProcessPresent() and adds new row/apply plumbing. |
| IntelPresentMon/CommonUtilities/mc/UnifiedSwapChain.cpp | Implements ProcessPresent(), EnqueueReadyDisplayRows(), and apply step; updates repeated-frame sanitization. |
| IntelPresentMon/CommonUtilities/mc/SwapChainState.h | Splits swap-chain update APIs into V1/bootstrap-V2/row-based update methods. |
| IntelPresentMon/CommonUtilities/mc/SwapChainState.cpp | Implements new swap-chain update paths and row-based state advancement rules. |
| IntelPresentMon/CommonUtilities/mc/MetricsTypes.h | Adds AnimationDisplayContext and ReadyDisplayRow structures. |
| IntelPresentMon/CommonUtilities/mc/MetricsCalculatorInternal.h | Changes animation metric calculation to consume AnimationDisplayContext. |
| IntelPresentMon/CommonUtilities/mc/MetricsCalculatorDisplay.cpp | Removes legacy DisplayIndexing helper implementation. |
| IntelPresentMon/CommonUtilities/mc/MetricsCalculatorAnimation.cpp | Moves animation computation out of calculator path; now consumes precomputed animation context. |
| IntelPresentMon/CommonUtilities/mc/MetricsCalculator.h | Updates exported calculator APIs and adds ComputeMetricsForReadyDisplayRow(). |
| IntelPresentMon/CommonUtilities/mc/MetricsCalculator.cpp | Refactors V1 present-level computation and adds row-based compute/apply entry point. |
| IntelPresentMon/CommonUtilities/mc/DisplayFrameQueue.h | New: buffering and publish policy for display-instance rows. |
| IntelPresentMon/CommonUtilities/mc/DisplayFrameQueue.cpp | New: implements ingest/order/lookahead + release policy for rows. |
| IntelPresentMon/CommonUtilities/mc/AnimationErrorTracker.h | New: interval-resolution and animation context distribution across display instances. |
| IntelPresentMon/CommonUtilities/mc/AnimationErrorTracker.cpp | New: implements source resolution, sim-start resolution, interval distribution, and transitions. |
| IntelPresentMon/CommonUtilities/CommonUtilities.vcxproj.filters | Adds new mc headers/sources to project filters. |
| IntelPresentMon/CommonUtilities/CommonUtilities.vcxproj | Adds new mc headers/sources to the CommonUtilities build. |
Comments suppressed due to low confidence (1)
IntelPresentMon/CommonUtilities/mc/SwapChainState.h:6
- This header starts with a UTF-8 BOM character (visible before the leading //). That introduces non-ASCII content at the start of the file and is inconsistent with other files in this PR that removed the BOM. Also, SwapChainState.h uses std::optional but doesn't include directly, which makes the header rely on transitive includes.
// Copyright (C) 2025 Intel Corporation
// SPDX-License-Identifier: MIT
#pragma once
#include <cstdint>
#include "MetricsTypes.h"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
355
to
359
| *outProcessInfo = processInfo; | ||
| auto chain = &processInfo->mSwapChain[presentEvent->SwapChainAddress]; | ||
| *outChain = chain; | ||
| *outPresentTime = chain->mUnifiedSwapChain.GetLastPresentQpc(); | ||
| return false; |
| @@ -0,0 +1,141 @@ | |||
| // Copyright (C) 2025 Intel Corporation | |||
| @@ -0,0 +1,548 @@ | |||
| // Copyright (C) 2025 Intel Corporation | |||
| @@ -0,0 +1,61 @@ | |||
| // Copyright (C) 2025 Intel Corporation | |||
| @@ -0,0 +1,187 @@ | |||
| // Copyright (C) 2025 Intel Corporation | |||
markgalvan-intel
force-pushed
the
cleanup-aefg
branch
from
July 17, 2026 18:29
b104d8f to
a9b3ece
Compare
Comment on lines
+535
to
+545
| void ValidateMetricOrThrow(Header columnId, size_t line, double gold, double actual) { | ||
| if (!ValidateMetricValue(gold, actual)) { | ||
| throw CsvValidationException(columnId, line, gold, actual); | ||
| } | ||
| } | ||
|
|
||
| void ValidateFrameTypeOrThrow(Header columnId, size_t line, PM_FRAME_TYPE gold, PM_FRAME_TYPE test) { | ||
| if (!ValidateFrameType(gold, test)) { | ||
| throw CsvValidationException(columnId, line, gold, test); | ||
| } | ||
| } |
| } | ||
| } | ||
|
|
||
| static inline bool TryApplyFlipFrameType( |
Calculate animation metrics per displayed frame by distributing the application simulation interval across every generated and application display step between two application frames. Buffer rows until both animation context and display timing are available, while preserving ingest order for generated and not-displayed frames. Start a new animation timeline when the simulation source changes, omit animation metrics when no valid interval exists, and retain lookahead buffering so displayed duration remains accurate.
markgalvan-intel
force-pushed
the
cleanup-aefg
branch
from
July 17, 2026 19:14
a9b3ece to
f8b9dc7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calculate animation metrics per displayed frame by distributing the application simulation interval across every generated and application display step between two application frames. Buffer rows until both animation context and display timing are available, while preserving ingest order for generated and not-displayed frames. Start a new animation timeline when the simulation source changes, omit animation metrics when no valid interval exists, and retain lookahead buffering so displayed duration remains accurate.