launcher: wake the live shader worker for a request while jobs run #283

Merged
NickStallman merged 1 commit from upstream-pr/283 into main 2026-11-26 23:21:12 +00:00
NickStallman commented 2026-11-26 23:04:32 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-26T23:04:32Z.


Problem

While any job is running, the live shader worker waits on its futures with a 50 ms timeout and doesn't listen for the request directory's notification. A request published beside a running compile waits for the next rescan: about 50 ms at the median. An idle worker already wakes on the notification in 2-3 ms. Raised in Discussion #229.

Change

A finished job writes to a pipe that the notification wait polls together with the inotify descriptor. One wait now serves both, and the worker uses it whether or not jobs are running. Without inotify, the worker waits on its futures with the 50 ms rescan, as before. No compiler flags, cache identities, worker counts or request order change.

Measured

Host worker only: four workers, real xshader, DXC and dxv, no guest and no GPU. 30 quick recorded ProjectScarlett requests, with their DXIL already stored, were published one at a time beside one long compute compile that was still running at the end. Three runs each, median reply time:

main this change
beside a long compile 50.4, 50.5, 50.8 ms 1.8, 1.7, 2.4 ms
no other job running 2.3, 2.3, 2.9 ms 2.3, 2.4, 2.3 ms

This is the latency of one host worker request. It is not a frame-time or load-time measurement, and I haven't measured how often a title publishes a request beside a running compile.

Tests

  • New test in tests/test_runtime_shader_workers.py: a request published 10 ms after a blocked job starts must start within 20 ms. It takes 35 ms on main, so it fails there 3 times out of 3, and it passes 30 times out of 30 with the change. It runs through serve with real directory notifications.
  • No Lanes scenario: the change is in the host worker's scheduling, and Lanes has no timing gate for one request beside another.

Checks (on e76ff6a)

  • python -m unittest discover -s tests -q: OK.
  • AMD Raphael iGPU (1002:13c0), RADV (Mesa 26.0.8), GE-Proton11-14: the full python tuxbox.py check --adapter 1002:13c0 --proton … --prefix … --windows-dxc … passed, 120 gates. An earlier run on the previous base failed lanes-selftest-compute-frame once, while a game compile was loading the machine. It passed in 3 of 3 reruns on this branch, and in 3 of 3 on main, so I count it as load, not this change.
  • RTX 5090 (10de:2b85), driver 620.70.10, GE-Proton11-14: the same full check passed, 120 gates.

Note: #240 edits the same loop. It keeps the 50 ms wait, so the two are independent, but whichever merges second needs a small rebase.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5518333904 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/283). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-26T23:04:32Z. --- **Problem** While any job is running, the live shader worker waits on its futures with a 50 ms timeout and doesn't listen for the request directory's notification. A request published beside a running compile waits for the next rescan: about 50 ms at the median. An idle worker already wakes on the notification in 2-3 ms. Raised in Discussion #229. **Change** A finished job writes to a pipe that the notification wait polls together with the inotify descriptor. One wait now serves both, and the worker uses it whether or not jobs are running. Without inotify, the worker waits on its futures with the 50 ms rescan, as before. No compiler flags, cache identities, worker counts or request order change. **Measured** Host worker only: four workers, real xshader, DXC and dxv, no guest and no GPU. 30 quick recorded ProjectScarlett requests, with their DXIL already stored, were published one at a time beside one long compute compile that was still running at the end. Three runs each, median reply time: | | main | this change | | --- | --- | --- | | beside a long compile | 50.4, 50.5, 50.8 ms | 1.8, 1.7, 2.4 ms | | no other job running | 2.3, 2.3, 2.9 ms | 2.3, 2.4, 2.3 ms | This is the latency of one host worker request. It is not a frame-time or load-time measurement, and I haven't measured how often a title publishes a request beside a running compile. **Tests** - New test in `tests/test_runtime_shader_workers.py`: a request published 10 ms after a blocked job starts must start within 20 ms. It takes 35 ms on main, so it fails there 3 times out of 3, and it passes 30 times out of 30 with the change. It runs through `serve` with real directory notifications. - No Lanes scenario: the change is in the host worker's scheduling, and Lanes has no timing gate for one request beside another. **Checks** (on `e76ff6a`) - `python -m unittest discover -s tests -q`: OK. - AMD Raphael iGPU (1002:13c0), RADV (Mesa 26.0.8), GE-Proton11-14: the full `python tuxbox.py check --adapter 1002:13c0 --proton … --prefix … --windows-dxc …` passed, 120 gates. An earlier run on the previous base failed `lanes-selftest-compute-frame` once, while a game compile was loading the machine. It passed in 3 of 3 reruns on this branch, and in 3 of 3 on main, so I count it as load, not this change. - RTX 5090 (10de:2b85), driver 620.70.10, GE-Proton11-14: the same full check passed, 120 gates. **Note:** #240 edits the same loop. It keeps the 50 ms wait, so the two are independent, but whichever merges second needs a small rebase. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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
brcly/TuxBox!283
No description provided.