GPU: report failed DXGI presents before updating frame stats #3785

Open
andrewpozdnakov7-jpg wants to merge 4 commits from upstream-pr/3785 into main
andrewpozdnakov7-jpg commented 2026-11-28 19:24:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T19:24:27Z.


The host presenter currently drops the HRESULT from DXGI Present and updates the frame meter even when the call fails. Check the HRESULT before reporting a host frame. On failure, the log records the frame and status code once per run of identical failures. A successful call clears that error so a later recurrence gets logged. DXGI Present documentation

A status-sequence regression covers the first failure, a repeated failure, a different failure, recovery and a recurrence. The two existing checks for creation and resize retry and for successful fallback/composited presentation passed, including actual Windows WARP readback. Strict GPU Clippy in both feature configurations and the asset policy passed.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5543766541 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3785). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T19:24:27Z. --- The host presenter currently drops the HRESULT from DXGI Present and updates the frame meter even when the call fails. Check the HRESULT before reporting a host frame. On failure, the log records the frame and status code once per run of identical failures. A successful call clears that error so a later recurrence gets logged. [DXGI Present documentation](https://learn.microsoft.com/en-us/windows/win32/api/dxgi/nf-dxgi-idxgiswapchain-present) A status-sequence regression covers the first failure, a repeated failure, a different failure, recovery and a recurrence. The two existing checks for creation and resize retry and for successful fallback/composited presentation passed, including actual Windows WARP readback. Strict GPU Clippy in both feature configurations and the asset policy passed. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 19:31:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T19:31:42Z.


Windows CI passed on 234bf68, including both Clippy configurations and the workspace tests. The follow-up separates per-frame housekeeping from the successful-present meter. The status-sequence test, creation/resize retry and actual WARP presentation readback all passed locally on the updated source.

The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7244611524 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3785#issuecomment-7244611524). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T19:31:42Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46181251342/job/141091090073) passed on 234bf68, including both Clippy configurations and the workspace tests. The follow-up separates per-frame housekeeping from the successful-present meter. The status-sequence test, creation/resize retry and actual WARP presentation readback all passed locally on the updated source. The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
jordanamr commented 2026-11-28 20:04:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jordanamr on 2026-11-28T20:04:07Z.


On 234bf68, check_present_result treats every nonnegative HRESULT as a presented frame. DXGI can return DXGI_STATUS_OCCLUDED when the window is occluded, so a full second of occluded presents still advances the successful-present meter. The new test with S_FALSE also passes this path.

Could the meter count only S_OK, keep the title's per-frame work running on every completed call, and report zero accepted presents during a fully occluded reporting period? A status sequence of success, occlusion, error, success would also check that the frame-time interval spans the gap. #2935 handles the title-frame and accepted-present counts separately.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7245011040 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3785#issuecomment-7245011040). Originally posted by [jordanamr](https://github.com/jordanamr) on 2026-11-28T20:04:07Z. --- On 234bf68, `check_present_result` treats every nonnegative HRESULT as a presented frame. DXGI can return `DXGI_STATUS_OCCLUDED` when the window is occluded, so a full second of occluded presents still advances the successful-present meter. The new test with `S_FALSE` also passes this path. Could the meter count only `S_OK`, keep the title's per-frame work running on every completed call, and report zero accepted presents during a fully occluded reporting period? A status sequence of success, occlusion, error, success would also check that the frame-time interval spans the gap. #2935 handles the title-frame and accepted-present counts separately.
andrewpozdnakov7-jpg commented 2026-11-28 20:11:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T20:11:37Z.


@jordanamr I updated this in c2ec0ed. The meter counts only S_OK. Every completed attempt still runs the title-frame housekeeping and advances the reporting window. A fully occluded window reports zero accepted presents. Present-to-present time keeps the last accepted timestamp across the reporting boundary.

The regression runs success, occlusion, failure and success at one-second intervals. It reports zero accepts in the occluded window and a 3,000 ms interval at recovery. It also checks that S_FALSE is skipped. The WARP fixture now checks the actual back-buffer pixels before an occluded Present can affect the return value. All four focused tests, both strict GPU Clippy configurations and the asset policy passed.

The next step is your review of the updated head.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7245104362 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3785#issuecomment-7245104362). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T20:11:37Z. --- @jordanamr I updated this in [c2ec0ed](https://github.com/Marvisak/VIctory/pull/3785/commits/c2ec0ed6804e5017fd6311e1e3cb2cd72b42ff7d). The meter counts only S_OK. Every completed attempt still runs the title-frame housekeeping and advances the reporting window. A fully occluded window reports zero accepted presents. Present-to-present time keeps the last accepted timestamp across the reporting boundary. The regression runs success, occlusion, failure and success at one-second intervals. It reports zero accepts in the occluded window and a 3,000 ms interval at recovery. It also checks that S_FALSE is skipped. The WARP fixture now checks the actual back-buffer pixels before an occluded Present can affect the return value. All four focused tests, both strict GPU Clippy configurations and the asset policy passed. The next step is your review of the updated head. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 20:17:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T20:17:48Z.


I ran the full GPU diagnostics suite on the updated #3785 head c2ec0ed. WARP 1.0.22 with Agility 1.620.2 gave 248 passed and one ignored with the D3D12 debug layer off and on. The synthetic sequence reports zero accepted presents for the occluded window and a 3,000 ms gap on recovery. The compositor readback also passed.

The current heads of #2935 and #3785 conflict in host.rs. I resolved that overlap in 4f6f48f, a merge of exact heads 98c48a4 and c2ec0ed. It keeps the present-to-present timing and both frame-accounting tests. The title-frame test sends occluded, failed and accepted statuses through the same meter call as production and checks that each advances the title frame clock. On the merge, both WARP runs passed 249 tests with one ignored. Strict Clippy passed with default features and diagnostics, and the asset policy check passed.

Integration branch. Please retain the Git authors on cherry-pick or rebase. If folding my changes into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7245181724 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3785#issuecomment-7245181724). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T20:17:48Z. --- I ran the full GPU diagnostics suite on the updated #3785 head `c2ec0ed`. WARP 1.0.22 with Agility 1.620.2 gave 248 passed and one ignored with the D3D12 debug layer off and on. The synthetic sequence reports zero accepted presents for the occluded window and a 3,000 ms gap on recovery. The compositor readback also passed. The current heads of #2935 and #3785 conflict in `host.rs`. I resolved that overlap in [`4f6f48f`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/4f6f48fa730006259ddd79e4292ba74e543d356c), a merge of exact heads `98c48a4` and `c2ec0ed`. It keeps the present-to-present timing and both frame-accounting tests. The title-frame test sends occluded, failed and accepted statuses through the same meter call as production and checks that each advances the title frame clock. On the merge, both WARP runs passed 249 tests with one ignored. Strict Clippy passed with default features and diagnostics, and the asset policy check passed. [Integration branch](https://github.com/andrewpozdnakov7-jpg/VIctory/tree/review/2935-3785-current-heads). Please retain the Git authors on cherry-pick or rebase. If folding my changes into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with OpenAI Codex.
cloph-dsp commented 2026-11-29 00:08:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-29T00:08:54Z.


Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):

  • PR #3785 at head c2ec0ed6804e5017fd6311e1e3cb2cd72b42ff7d, base 63bcca43c6a00a758510398fa43096ce7e4f7df0 (4 commits; last-commit parent 4a2d0b7a9b12ffc7465c49dd7f32e467a1ecd02d).
  • cargo test --locked -p victory-gpu --lib --features diagnostics -- host::tests::present_errors_clear_after_success --exact --test-threads=1 --quiet → 1 passed, 0 failed, 248 filtered, exit 0.
  • cargo test --locked -p victory-gpu --lib --features diagnostics -- host::tests::occluded_windows_count_zero_presents_and_keep_the_gap --exact --test-threads=1 --quiet → 1 passed, 0 failed, 248 filtered, exit 0.
  • git grep -F on the parent for both test names returned no match (tests are new); git diff --check 63bcca43 HEAD clean (1 file, +135/-32).
  • Used a per-worktree CARGO_TARGET_DIR (target-3785-watch) with CARGO_BUILD_JOBS=2, never shared. Two pre-existing fetch_update deprecation warnings in the lib test build.
  • Only the two named synthetic tests were replayed; full workspace suite and clippy were not run locally.
  • GPU/driver: N/A (CPU-only synthetic DXGI-present tests). No game data, assets, extracted shaders, DRM or decrypt involved.
  • Zero formal approvals; no existing cloph-dsp comment before posting.

AI-assisted (Hy4 flash).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7247908806 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3785#issuecomment-7247908806). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-29T00:08:54Z. --- Independent local verification (Windows, Rust 1.100.0/MSVC, no game data): - PR #3785 at head `c2ec0ed6804e5017fd6311e1e3cb2cd72b42ff7d`, base `63bcca43c6a00a758510398fa43096ce7e4f7df0` (4 commits; last-commit parent `4a2d0b7a9b12ffc7465c49dd7f32e467a1ecd02d`). - `cargo test --locked -p victory-gpu --lib --features diagnostics -- host::tests::present_errors_clear_after_success --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 248 filtered, exit 0. - `cargo test --locked -p victory-gpu --lib --features diagnostics -- host::tests::occluded_windows_count_zero_presents_and_keep_the_gap --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 248 filtered, exit 0. - `git grep -F` on the parent for both test names returned no match (tests are new); `git diff --check 63bcca43 HEAD` clean (1 file, +135/-32). - Used a per-worktree `CARGO_TARGET_DIR` (`target-3785-watch`) with `CARGO_BUILD_JOBS=2`, never shared. Two pre-existing `fetch_update` deprecation warnings in the lib test build. - Only the two named synthetic tests were replayed; full workspace suite and clippy were not run locally. - GPU/driver: N/A (CPU-only synthetic DXGI-present tests). No game data, assets, extracted shaders, DRM or decrypt involved. - Zero formal approvals; no existing cloph-dsp comment before posting. AI-assisted (Hy4 flash).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3785:upstream-pr/3785'
git switch 'upstream-pr/3785'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3785'
git switch 'upstream-pr/3785'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3785'
git switch 'upstream-pr/3785'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3785'
git switch 'main'
git merge --squash 'upstream-pr/3785'
git switch 'main'
git merge --ff-only 'upstream-pr/3785'
git switch 'main'
git merge 'upstream-pr/3785'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!3785
No description provided.