[pr-fix][linux-proton] A waiting draw raises the worker making its pipeline under Wine too #352

Open
ntsthay wants to merge 1 commit from ntsthay/boost-set-information into main AGit
First-time contributor

Not run in the game. Two unit tests show the problem under Wine.

Contributor role (optional)

  • Fluxer ID:

What it changes

When a draw or a dispatch waits on a pipeline a worker is making, boost raises that worker to the title's priority. It opened the worker with THREAD_SET_LIMITED_INFORMATION. Windows accepts that right for SetThreadPriority, but Wine does not, so under Wine or Proton the worker stays at its low priority while the title waits on it.

On f3840d7, under Proton, a_waiting_draw_raises_the_worker_making_its_pipeline fails with raised while a draw waits, left: -2 (still THREAD_PRIORITY_LOWEST). a_dispatch_waiting_on_a_worker_raises_it fails with "the worker was not raised". With the same code and only the access right changed to THREAD_SET_INFORMATION, both pass.

boost now opens the thread with THREAD_SET_INFORMATION. It is a thread of our own process, so Windows grants that right as it granted the limited one.

How it was tested

  • Tested revision: 94ae9e0, this branch on f3840d7.
  • Commands and results: cargo nextest run -p darner-gpu -E 'test(/pipeline::make::/)' under Proton (proton-cachyos, RTX 4080): 50 passed, both priority tests included. On f3840d7 those two fail as above.
  • Gates 1 and 2 are clean. Gate 3 ran under Wine, not on Windows.
  • Gameplay: not run. In play this matters when a draw waits on a pipeline that is still being made.
  • Coverage gaps: no game run and no run on Windows. cores.rs and stall.rs also open threads with limited rights; I have not checked them under Wine.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found
Not run in the game. Two unit tests show the problem under Wine. ## Contributor role (optional) - Fluxer ID: ## What it changes When a draw or a dispatch waits on a pipeline a worker is making, `boost` raises that worker to the title's priority. It opened the worker with `THREAD_SET_LIMITED_INFORMATION`. Windows accepts that right for `SetThreadPriority`, but Wine does not, so under Wine or Proton the worker stays at its low priority while the title waits on it. On `f3840d7`, under Proton, `a_waiting_draw_raises_the_worker_making_its_pipeline` fails with `raised while a draw waits`, `left: -2` (still THREAD_PRIORITY_LOWEST). `a_dispatch_waiting_on_a_worker_raises_it` fails with "the worker was not raised". With the same code and only the access right changed to `THREAD_SET_INFORMATION`, both pass. `boost` now opens the thread with `THREAD_SET_INFORMATION`. It is a thread of our own process, so Windows grants that right as it granted the limited one. ## How it was tested - Tested revision: `94ae9e0`, this branch on `f3840d7`. - Commands and results: `cargo nextest run -p darner-gpu -E 'test(/pipeline::make::/)'` under Proton (proton-cachyos, RTX 4080): 50 passed, both priority tests included. On `f3840d7` those two fail as above. - Gates 1 and 2 are clean. Gate 3 ran under Wine, not on Windows. - Gameplay: not run. In play this matters when a draw waits on a pipeline that is still being made. - Coverage gaps: no game run and no run on Windows. `cores.rs` and `stall.rs` also open threads with limited rights; I have not checked them under Wine. ## Checklist - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/352/head:ntsthay/boost-set-information'
git switch 'ntsthay/boost-set-information'

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 'ntsthay/boost-set-information'
git switch 'ntsthay/boost-set-information'
git rebase 'main'
git switch 'main'
git merge --ff-only 'ntsthay/boost-set-information'
git switch 'ntsthay/boost-set-information'
git rebase 'main'
git switch 'main'
git merge --no-ff 'ntsthay/boost-set-information'
git switch 'main'
git merge --squash 'ntsthay/boost-set-information'
git switch 'main'
git merge --ff-only 'ntsthay/boost-set-information'
git switch 'main'
git merge 'ntsthay/boost-set-information'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!352
No description provided.