The fill queue's own submission and the batch's wait for it cost small
copies more than the copy engine saves them. The sweep of
managed_copies_bench (a Managed buffer's copy in each frame, the fill queue
against the batch's start, p50) placed the crossover:
- RTX 2080 (18167): 128 KiB 1.04x alone and 1.11x beside another queue's
kernels; 256 KiB 2.03x alone (0.94 against 0.46 ms), 1.09x beside;
512 KiB 1.31x alone; from 1 MiB up 0.98-1.00x alone and 0.51-0.91x
beside (1 MiB 1.81 against 3.57 ms).
- RTX 3090 (18199): faster or within 4% everywhere; 1 MiB alone 1.04x
(reproduced, 17900), beside 0.51x (1.80 against 3.53 ms).
- RTX 5080 Laptop GPU (18108, before the sweep): 64 KiB 1.44x alone and
1.06x beside; from 1 MiB up 0.93-0.99x alone and 0.56-0.96x beside.
So FILL_QUEUE_LEAST is 1 MiB, the smallest swept size from which the fill
queue is no slower beside the kernels on any of the three and at most 1.04
times as long alone: Taken::take_fills takes the batch's fills only where
they write that many bytes in all (copies and zeros), and fewer stay at the
batch's start, as on a device without a fill queue. Decided from bytes, not
from the device.
The fill-queue test gains a last command buffer whose fills (a new Managed
buffer's zeros and its copy in, under half the least each) make no
fill-queue submission and read back exactly. The ledger's costs of
matching Metal gain the fill queue's bullet; the staging, create, bench and
README docs say the least and the measured numbers (the create.rs 82% came
from the raw example and is gone).
Verified: cargo fmt; device runs, lavapipe and lint follow.