reims-vgpu's 5080 game probe past its views' budget (512 copies of stitched views) spent
65% of its CPU in its dirty logs' queries, which every commit's copy in made for every
logged copy (about 110 commits a second, about 6 ms each, every copy's own log walked:
m3-max-5561's profile). A command buffer's GPU reaches only the resources its commands use,
as Metal's does, so the copies the others lie in need not be current for it.
DirtyCommit now keeps the keys its commands used, read or written (at most 4096, past which
every copy), beside the writes it kept; the commit hands them to CopiedBuffers::copy_in
(copied::Written, which named the merge back's writes, is CopiesReached, the key set both
take). A copy its commands do not reach is neither compared nor asked of its logs, and keeps
the stamp it last synced to, so the first commit that uses it takes every write since. Every
copy is copied in where the command buffer's uses went unnoted or a command may reach memory
no use names (a function that reaches buffers through addresses, work on the GPU alone, a
host step's records: State::reaches_unnamed). Shadows' copies in from a copy are commands of
their encoder, their uses noted with the copy's key, so a texture over a copied buffer
reaches its copy. Counted: WorkCounts::copied_copy_ins_unused.
The copied-host-pages notice and API.md's catalogue say which copies a commit compares.
tests::copied::a_commit_copies_in_only_the_copies_its_commands_use: a copy left alone keeps
its bytes, the first commit that uses it takes every write since, and every copy where one
may reach anything. copied_stitched_bench times a commit that uses 8 of 512 copies beside
one that reaches every copy.
(cherry picked from commit bc9f3f5ec63504fce3d8f89eb49110099b2b45ab)