Repository navigation
Release stale app timing data and deferred frame-type presents - #702
markgalvan-intel merged 1 commit into
Conversation
| // last one stays deferred forever once the runtime stops typing frames (e.g., XeSS-FG | ||
| // switched off or replaced by another frame generation), blocking every process until | ||
| // the completed ring overflows. | ||
| deferredPresent->WaitingForFrameId = false; |
There was a problem hiding this comment.
This works for the stall in #695, but this block only runs when mReadyCount == 0, which depends on how far the output thread has dequeued, not on the trace. So the same ETL can release a typed present in one run and keep it in the next. If it's released before its partner completes, the partner no longer finds it in the merge loop and loses its AppPropagated* data. We saw this as intermittent gold failures on internal XeSS-FG captures. We're accepting it as is and will replace it in a follow-up PR with a release driven by the trace: the next later-started present from the same process, plus a 2 s backstop based on trace time.
markgalvan-intel
left a comment
There was a problem hiding this comment.
Thank you for the PR. Code looks good. Appreciate the contribution!
Replace the WaitingForFrameId reset added to the stale-deferral block in #702 with a deterministic release rule. That reset only ran when mReadyCount was 0, so it depended on how fast the output thread dequeued presents. This made ETL results vary between runs and could release a generated frame before its partner merged the propagated data. A present waiting for a PresentFrameType partner is now released when: - a later-started present from the same process completes, whether or not it has a PresentFrameType (e.g., frame generation was turned off), or - any present that started more than mDeferralTimeLimit later completes (e.g., the process stopped presenting). A limit of 0 releases on the next later-started present, matching the documented meaning of 0. An earlier-started present that completes late does not release a waiting present. Only a typed successor with the same FrameId takes the propagated data from an Intel_XEFG present. Add PresentFrameTypeDeferralTests to the CMake and Visual Studio unit test projects. Update the AuxData lock to the regenerated gold CSVs for test_case_7, 8, 9, 11 and 12 (default and _v2), which reflect the app timing pruning from #702 and the new release rule.
Replace the WaitingForFrameId reset added to the stale-deferral block in #702 with a deterministic release rule. That reset only ran when mReadyCount was 0, so it depended on how fast the output thread dequeued presents. This made ETL results vary between runs and could release a generated frame before its partner merged the propagated data. A present waiting for a PresentFrameType partner is now released when: - a later-started present from the same process completes, whether or not it has a PresentFrameType (e.g., frame generation was turned off), or - any present that started more than mDeferralTimeLimit later completes (e.g., the process stopped presenting). A limit of 0 releases on the next later-started present, matching the documented meaning of 0. An earlier-started present that completes late does not release a waiting present. Only a typed successor with the same FrameId takes the propagated data from an Intel_XEFG present. Add PresentFrameTypeDeferralTests to the CMake and Visual Studio unit test projects. Update the AuxData lock to the regenerated gold CSVs for test_case_7, 8, 9, 11 and 12 (default and _v2), which reflect the app timing pruning from #702 and the new release rule.
Fixes #695.
App timing data now expires based on its newest timestamp, even when AppPresentStart is missing. This also removes stale PC latency data from other processes. WaitingForFrameId is cleared at the deferral limit, so the last typed frame cannot block output after frame generation is switched off.
In the original Bodycam retest, memory stayed around 8 MB and CPU at 0.1% over 86 minutes. The Assassin's Creed Shadows retest had no ring overflow after disabling XeSS-FG; the previous stall lasted about 60 seconds.
Built with VS2022, Debug x64. All 18 checked-in Gold ETL/CSV comparisons and 7 local regression tests passed. Three of those regression tests fail against the unpatched upstream consumer.