The device's reset waits for the GPU work the guest committed before it, so
none of that work writes the guest's memory after the reset returns. It waited
a flat 30 s, and ended the process past that. A guest that is busy, with
nothing stuck, could reach it: the settle waits for every command buffer
committed before the reset, and a backlog of long ones, each well within the
drivers' watchdogs, can sum past 30 s. Nothing of ours bounds that backlog.
The wait now runs on progress. The set of command buffers it waits for is
fixed as it begins. It waits while they complete, each within 30 s of the one
before (or of its start), and 10 min at most in all: the time cap of the helper
process that runs pipeline compiles and stage fills, read from its definition
(os::compile_helper's TIME_MOST, exported as COMPILE_HELPER_TIME_MOST), not a
new constant. The decoder's locks the settle takes keep their flat 30 s. Each
settle logs the longest it waited with none of its command buffers completing.
What the host observes: rvg_graphics_device_reset and a STATUS write of 0 wait
while that work completes, past 30 s, and end the process only once 30 s pass
with none of it completing, or at 10 min. A reset still waiting 2 s on writes
one line on stderr, whatever REIMS_VGPU_LOG says ("reims-vgpu: reset waiting:
for the GPU work committed before it, N command buffers, 2 s on"), and one
once it is done ("reims-vgpu: reset waited: S s for the GPU work committed
before it"). The death's line says which bound it passed. reims-ctl's
interface reads the first line from QEMU's log, and shows the VM's state as
"reset: waits for GPU", with the line in its pane, until the second comes. The
header's reset docs, docs/api.md ("Waiting", "Deaths", the threads table and a
new "The reset's lines") and docs/known-issues.md ("A stuck GPU closes the VM
when it restarts": one command buffer running past 30 s on a driver that never
ends it is a stuck GPU to the reset) say so.
GpuDevice::settle takes SettleBounds and a waiting callback and answers
Settled; rt's Flights::settle restarts its bound on each command buffer that
completes, on the platform's clock, as the testkit's World::settle does on
virtual time.
Tests: a_reset_waits_on_while_its_gpu_work_completes (three buffers, one
completing every 20 s: the reset returns, having said both lines) and
a_reset_whose_gpu_work_completes_past_the_most_ends_the_process (one buffer
every 29 s, 22 of them: alive after 20, dead at the ceiling); rt's
a_settle_waits_while_its_command_buffers_settle_within_the_quiet_bound on a
virtual clock; reims-ctl's a_vm_whose_reset_waits_for_its_gpu_shows_it.
Red, job m3-max-79515 (homelab-um870-1, fake platform): with the settle's
ceiling set back to the flat 30 s, both reims-vgpu tests fail (the reset ended
40 s on, with its GPU work completing; it ended before the most it waits).
Green: the same tests pass (79515); fmt, the header's check and clippy on the
host and the Windows target (79539); the workspace's 3156 tests on
homelab-um870-1's Radeon 780M (79546); make check-ctl on the Mac (79521).