The scheduler's order across queues compares a held batch with each later queue's head by
their footprints (scheduler/order.rs), and its memo lasts one pass: every pass, one at each
commit and completion on any queue, built the held batch's footprint again, copying and sorting
every use of its summaries under its command buffer's lock. On the replayed-frames page at 5000
resident pairs on the M3 (macOS sample, 4 s), that was 193 of the scheduler thread's 571 busy
samples, and the host step's draws, which take the same lock, waited 137 samples for it.
CommandBufferShared::footprint now keeps each batch's footprint (State::footprints) with what it
was built from (FootprintSources), and a later ask takes the kept one while that holds:
- The recordings' revision. State::recorded is a Parts, whose every mutable access moves the
revision (DerefMut), so no change to an encoder's summary, a segment's recording or its bound
(a host step's recording, a rebind's encoding again, a submission's scrubs and joins) leaves a
kept footprint standing.
- The batch's encoders (its range among the recordings).
- Which summary each segment takes (Taken: a loop's laying, its recording, or the bound commit
gave its host step): what may change while the recordings stand, as a route met since makes
the GPU write what a segment's work reads or outgrows what commit recorded for good, or a
recording falls due again.
A footprint a segment's known uses join (Segment::known_summary, made from the device's aliases
as they stand) is built at each ask, as before. A kept footprint is built from uses copied out
under the lock (Footprint::gathered) and sorted without it (Footprint::sorted), and is kept only
where the revision did not move meanwhile. WorkCounts::footprints_built counts the builds; the
scheduler shares the footprint (Arc).
Lane: replayed_frames::a_batch_s_footprint_is_built_once_however_many_passes_look holds the page's
frame for its host step while a bystander commits on another queue until the frame completes, and
asserts at most one build a bystander command buffer and two for each of the frame's batches.
Verified: nothing yet; the M3 jobs (clippy, the lanes, the negative control, the page's sample
before and after) follow.
(cherry picked from commit d862eadd34ac9f218de5c1a0952c2d22a1e5b0b8)