A draw rebound that was not carried in went on only where its uses of shadowed
textures (ShadowUse::used_as: the shadow, writes, area, own-pixel read bounds)
equalled its kept draw's, since it gathered nothing into its instance. Another
shadow at a changed slot, or own-pixel bounds that follow a restated scissor,
stopped it, and the draw took every step. That is the largest rebind stop in the
780M desktop walk (draws_rebind_stopped_arguments_shadows 62,642 of 98,870
stops; Launchpad 24.1k, Mission Control 26.6k).
Now such a draw gathers its own shadow uses into its instance as every step
does (shadow::join, through InstanceShadows::add, or InstanceShadows::join for
a narrowed draw), as a carried draw already did, and keeps them as the uses the
next draw rebound compares with. It still stops where it uses some and its kept
draw used none, or the other way: Kept::again follows that. A new check stops a
draw that reads a color's copy after a barrier inside its instance (counted
_checks): every step splits there or weighs the spare, and only the shadow stop
kept such draws out before. The debug rebound check compares a ninth part, the
draw's shadow uses against its every step's.
kept_shadowed_draws: the kept frame's commands recorded (every kind) and copies
equal the every-step frame's; its second-target and scissor draws rebound
instead of stopping; a lane of draws of other arguments (base instance
alternating) rebinds every draw after the first; a lane across a barrier stops
at the new check, with the split and texels of every step.
Also: examples/draw_costs gains a "backdrops" shape (every compositor draw reads its pass's colour
at its own pixel under its own scissor), which the A/B below uses.
No new WorkCounts field or Degradation kind. No RUNTIME_VERSION bump: the commands, copies and
pixels are those every step records. The runtime pin moves alone.
Verified (msi lavapipe):
- Base repro m3-max-29949: the kept frame had as_before 2, rebound 0, stopped 2.
- kept_shadowed_draws, 4 lanes. Each compares the kept frame with an every-step frame on pixels,
copy counts with copied texels, and the recorded command map. At the tip:
- plain lane: stops 2 -> 0;
- other-arguments lane: _arguments_shadows 2 -> 0;
- a lane where the rebound draws are the last to use a shadow: _shadows 3 -> 0;
- barrier lane: _checks 1, with 1 split.
- Negative control m3-max-30008, by hand:
- restoring the stop fails 3 lanes (_shadows 2/2/3);
- removing the gather fails 3 lanes on copied texels (1124 vs 2048) and on the last-use lane
(copies 1 vs 2, texels 525 vs 1313).
- Release A/B m3-max-29983/30002:
- base 88f577d11c md5 48293e84, tip 882c9a785b md5 daa3de5b;
- own target dirs, P-cores, 5 interleaved rounds, medians per draw.
Results:
- backdrops: cpu 9963.7 -> 6688.9 ns (-32.9%), instructions 75034 -> 50632 (-32.5%);
_arguments_shadows 1856 -> 0 and rebound 383 -> 2239 over 2240 draws;
- compositor: instructions 54492 -> 54493 with identical counts (time +2.2%, noise).
- m3-max-30016 at 1494716c54: clippy -D warnings --all-targets --all-features (runtime crate), plain
and --cfg m2v_cpu_icd, exit 0; 204/204 touched tests: draw_again, kept_shadowed_draws,
render_fold, encoder_fold, kept_*, rebind_*, shadow_*, attached_read_*, render::shadows.