Every submission (28 a frame) made its Batch anew: the table of pending
refreshes by copy, the staging buffers seen (with the standard hasher),
the copies refreshed ahead; and three walks over its steps each built a
hash table of the copies from nothing: the spans of the one write-watch
asking, the spans of copies shaders may be writing (stale_under_flights),
and refresh_front's copies. In profile-y-prof60 hash tables growing and
inserting under Host::submit were 2.4% of the submitting thread
(reserve_rehash and HashMap::insert), heap allocation and freeing more.
Now the Batch is kept per thread, emptied with its room, for the next
submission. The per-copy spans of all refreshes are found in one walk
(Batch::copy_spans) and serve the asking (the copies asked ahead, as
before), the stale check behind flights (the copies with writes pending,
as before) and refresh_front, which takes the copies' references from
them instead of a table of its own. The staging buffers seen use the
address hash.
Behaviour-neutral: the same ranges are asked about (in another order;
the asking sorts them), the same spans are looked at in the same order,
the same refreshes are made. On by default, no switch.
Co-Authored-By: Claude Opus 5.5 <[email protected]>