GPU: release ready queues before forcing present waits #216

Open
avt0m4t48 wants to merge 2 commits from upstream-pr/216 into main
avt0m4t48 commented 2026-11-24 22:36:38 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-24T22:36:38Z.


Refs #143. Drain work whose waits are reached under the queue release lock before forcing any remaining waits at Present. The regression sets up a blocked consumer first, then makes its producer ready before the usual wake. The old forced drain runs the consumer first and leaves the shared sequence fence at 1. The patched drain runs the producer first and leaves it at 2.

The source-built Windows x64 regression fails before and passes after under Wine 10. VICTORY_WAIT_FORCE=0 passes the baseline control, and the patched exact test also passes with late-wait stage 3. The GPU library suite gave 111 passed and one ignored. With diagnostics it gave 118 passed and one ignored. GPU-dependent cases can skip on this environment. The regression itself exercises queue and fence order before DXGI presentation.

The in-game symptom in #143 still needs correlation. AI-assisted using Codex. Source-built inputs only.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6592796154 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/216). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-24T22:36:38Z. --- Refs #143. Drain work whose waits are reached under the queue release lock before forcing any remaining waits at `Present`. The regression sets up a blocked consumer first, then makes its producer ready before the usual wake. The old forced drain runs the consumer first and leaves the shared sequence fence at 1. The patched drain runs the producer first and leaves it at 2. The source-built Windows x64 regression fails before and passes after under Wine 10. `VICTORY_WAIT_FORCE=0` passes the baseline control, and the patched exact test also passes with late-wait stage 3. The GPU library suite gave 111 passed and one ignored. With diagnostics it gave 118 passed and one ignored. GPU-dependent cases can skip on this environment. The regression itself exercises queue and fence order before DXGI presentation. The in-game symptom in #143 still needs correlation. AI-assisted using Codex. Source-built inputs only.
Filip722 commented 2026-11-25 12:07:05 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-25T11:57:45Z.


I reproduced the producer/consumer ordering test on Bazzite 44 with GE-Proton 11-14's Wine, using a Windows MSVC release build and Rust 1.98.1.

With the same fixture on parent 2119b0e, the forced-release control left the sequence at 1 instead of 2. The control reached 2 with forcing disabled. On exact PR head 421bf51, the fixture passed with forcing enabled. Both builds used VICTORY_QUEUE_WAIT=1 and VICTORY_LATE_WAIT=0.

This fixture uses zero present planes to exercise fence ordering. Prepared and run with OpenAI Codex assistance.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7161736124 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/216#issuecomment-7161736124). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-25T11:57:45Z. --- I reproduced the producer/consumer ordering test on Bazzite 44 with GE-Proton 11-14's Wine, using a Windows MSVC release build and Rust 1.98.1. With the same fixture on parent `2119b0e`, the forced-release control left the sequence at 1 instead of 2. The control reached 2 with forcing disabled. On exact PR head `421bf51`, the fixture passed with forcing enabled. Both builds used `VICTORY_QUEUE_WAIT=1` and `VICTORY_LATE_WAIT=0`. This fixture uses zero present planes to exercise fence ordering. Prepared and run with OpenAI Codex assistance.
avt0m4t48 commented 2026-11-25 15:08:30 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T14:11:16Z.


Merged 0b0074e into this branch at db3d91e. The ready-work pass and forced fallback still run under the same release lock. The async submit and present paths added on main remain available.

On Windows, all five queue tests passed on the updated branch. The exact regression also passed with late-wait stage 3 and async submission enabled. On main, with forcing enabled, the regression again ended at fence value 1 instead of 2. Turning forcing off passed the baseline control. These are synthetic queue-order checks before presentation.

Exact-head and baseline Windows run

AI-assisted using Codex.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7164890510 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/216#issuecomment-7164890510). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T14:11:16Z. --- Merged `0b0074e` into this branch at `db3d91e`. The ready-work pass and forced fallback still run under the same release lock. The async submit and present paths added on main remain available. On Windows, all five queue tests passed on the updated branch. The exact regression also passed with late-wait stage 3 and async submission enabled. On main, with forcing enabled, the regression again ended at fence value 1 instead of 2. Turning forcing off passed the baseline control. These are synthetic queue-order checks before presentation. [Exact-head and baseline Windows run](https://github.com/avt0m4t48/victory-fork/actions/runs/45630282295) AI-assisted using Codex.
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/216:upstream-pr/216'
git switch 'upstream-pr/216'

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/216'
git switch 'upstream-pr/216'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/216'
git switch 'upstream-pr/216'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/216'
git switch 'main'
git merge --squash 'upstream-pr/216'
git switch 'main'
git merge --ff-only 'upstream-pr/216'
git switch 'main'
git merge 'upstream-pr/216'
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
fxceless/victory-fork!216
No description provided.