The cold-creation split (probe a3318b088f, m3-max-45806/45807/45809/45810) showed rt writing
each new lowering to the store inside the guest's creation call: 57-119 us on Linux and
434-446 us on the UHD 630 under Windows (NTFS), per creation. The old runtime hands its
writes to a thread, at 3-7 us. The planner ruled the write off the creating thread.
Now a state serializes its lowering, or the translator's refusal of a variant, and hands it
to the reaper: cache::keep_translation pushes it onto a queue of at most 8 MiB of bytes
(PENDING_BYTES, about the 9.16 MB a long recorded session's 282 lowerings fill) and pokes the
reaper. The reaper writes queued files after its jobs and before anything else it does, so a
teardown writes every lowering handed over before the reaper ends. A file that would take the
queue past its bound is dropped and counted in the new Metrics::cache_writes_dropped, never
waited for: a lowering is only a cache, and a later device lowers it again. Store::put's
state-file lock and the temporary file's rename leave the creating thread with the write. The
warm read stays where it was.
Tests:
- host the_write_queue_refuses_a_file_past_its_bound: a file past the bound is refused and
nothing is queued; files come out in order; each one taken makes room;
- device every_device_writes_its_lowerings_off_the_creating_thread_and_drops_them_past_its_queue:
with the reaper's writes held (a test-only stall), a creation returns with nothing written;
with the queue full, the next state's lowering is dropped and counted; let go, the reaper
writes what was queued, and a device after it reads the first kernel's lowering and lowers
the second again.
Docs: the cache and reaper module docs, the rt README's lowerings paragraph, the metric's doc,
the api_signatures row.
Verified: nothing yet; the check and device legs of this commit are reported with its sha.