Files
metal2vulkan/crates
Anees Iqbal 06372f9dd6 A draw is kept under what another thread may change as its steps began
What: render/draw_again.rs gains Outside: the parts of a kept draw's Under that another thread
may change while a draw takes its steps:
- the no-copy buffers' moves;
- the sampler slots' changes;
- whether the device has buffers over host pages, and the host aliases' version.
RenderLowering::draw_began notes them as draw() begins. kept_under answers Under as of now, but
with those parts as of the draw's start. Both the plain draw's keeping (render.rs) and a draw
rebound (rebound.rs) keep their draw under kept_under. The plain keeping weighs its uses' noting
against that state: EncoderCore::noted_now now takes the NotedInto to compare with.
So a change made meanwhile on any thread makes the next draw take every step. Before, the keep
read the moved state, so one of two things happened:
- the draw kept nothing;
- or it was kept under a state its bindings and noting never read: a version that moved after
  noted_now but before Kept::under, or a sampler state made after the draw listed them.
The debug check (Checked::check) compares nothing where Outside moved while the checked draw took
every step: its steps read another state than the kept draw's. The module docs say both.

Why: the device's in-place check (in_place_check.rs) makes and lets go no-copy buffers over host
pages on the program's device from its own thread. When one landed between a checked draw
again's noting and its keeping, the draw kept nothing and the check panicked with "a draw again
kept no draw" (render/draw_again.rs:994). That was the intermittent failure in lone_fetch and
pass_end_tiles on lavapipe (jobs 24214, 24235). The skip of first-move zeros was not involved:
neither test's Private texture registers an overwrite.

Verified: as potluck jobs on lavapipe, the previous commit's test and the draw_again tests, the
runtime suite, and clippy; reported with the shas.
2026-11-12 22:19:46 -08:00
..