Three scheduler_wakes tests need the scheduler's thread asleep before a
commit: each burst's commits, each commit_and_submit, and the commit under the
held lock. Each slept 5 ms and assumed the thread was asleep by then. The
thread can outlast that, because the last commit's waking and pass run on a
thread that load beside the test can hold off the CPU.
- A commit_and_submit that finds the thread making a pass leaves its batch to
the thread, so batches submitted at commit fall short of the commits.
- One that finds the thread awake between passes wakes nothing, because the
notify is spared, so the commit wakings fall short.
The PHOENIX sighting (bug 748, "scheduler_wakes 9/10") has the first shape.
Scheduler::asleep, compiled only under the device-test cfgs, reads the thread's
sleep state under the lock of its sleep. It is true when the thread sleeps on
its condition variable or on the GPU and no waker has woken it since. The tests
wait for it, bounded by BOUND, before each commit that needs a sleeping thread.
No runtime behaviour changes. The runtime-sources pin moves because
scheduler/mod.rs gains the test-only accessor. RUNTIME_VERSION is left to the
pin cut.
Verified on the Radeon 780M PHOENIX (RADV, Mesa 26.2.6), potluck job 13644, with
this commit carried on the scratch branch at fbfb62949e. A scratch switch there
holds the thread 10 ms after each pass before it sleeps, holding no lock.
- With that delay and the 5 ms wait, a_commit_and_submit_wakes... failed 5 of 5
runs. Run 1: "0 wakings by a commit, 9 batches submitted at commit, 10
commits". Runs 2-5: 0 wakings, 10 at commit.
- With the delay and this wait: 5 of 5 passed, each with 10 wakings and 10 at
commit.
- Without the delay: both waits passed 5 of 5.
- The whole module with this wait, run alone: 10 of 10.
- Before the change, full suites on the 780M (jobs 13609, 13631) passed all
four tests, 2 of 2.
(cherry picked from commit 346f32bad36fb752caee2a991efe1b670a59b112)