Repository navigation
launcher: wake the live shader worker for a request while jobs run - #283
Merged
Merged
Conversation
While any job was running, the live worker waited on its futures with a 50 ms timeout and did not listen for the directory notification, so a request published beside a running compile waited for the next rescan. An idle worker already woke on the notification. A finished job now writes to a pipe that the notification wait polls with the inotify descriptor, so one wait serves both and the worker uses it whether or not jobs are running. Without inotify the worker waits on its futures with the bounded rescan, as before. A serial stream of 30 quick recorded ProjectScarlett requests beside one long compute compile, four workers, real xshader, DXC and dxv, three runs each: the median reply went from 50.4-50.8 ms to 1.7-2.4 ms. With no other job running it is 2.3-2.9 ms either way. This is the host worker alone, with no guest and no GPU. A new test publishes a request 10 ms after a blocked job starts and expects it to start within 20 ms. It took 35 ms before the change. The 381 Python tests and the no-GPU check pass. The full GPU check was not run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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
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 throughservewith real directory notifications.Checks (on
e76ff6a)python -m unittest discover -s tests -q: OK.python tuxbox.py check --adapter 1002:13c0 --proton … --prefix … --windows-dxc …passed, 120 gates. An earlier run on the previous base failedlanes-selftest-compute-frameonce, 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.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