Files
metal2vulkan/crates
Anees Iqbal a5c7cbadfa Test a buffer over host pages made on another thread while a draw takes every step
What: tests::draw_again gains
a_buffer_over_host_pages_made_while_a_draw_takes_every_step_is_met_by_the_next_draw. A new
test-build hook, Hooks::at_keep (device/line.rs, with the recovery tests' hooks), runs once on
the lowering thread as the n-th draw that takes every step reaches its keeping, after its uses'
noting. The test holds the run's first draw again there (in a debug build, the first draw again
takes every step for its check) while another thread makes a no-copy buffer over host pages.
That moves the host aliases' version and the device's "has buffers over host pages" flag, which
a kept draw's Under reads through NotedInto. The test asserts that the next draw takes every
step (draws_unlike_kept_under 1), one draw fewer draws again than the reference run, and the
pixels match.

Why: render/draw_again.rs:994 "a draw again kept no draw" fired intermittently in
lone_fetch::a_lone_fetched_bgra8unorm_color_over_host_pages_reaches_them (jobs 24214, 24235) and
in pass_end_tiles. The device's in-place check (in_place_check.rs) runs on a thread of its own
and makes and lets go no-copy buffers over host pages on the program's device. When one lands
between a checked draw again's noting and its keeping, noted_now compares the noting's alias
version with the moved one and the draw keeps nothing. The hook forces that moment, so the test
fails without the fix instead of waiting for the race.

Verified: expected to fail here (the panic) and pass with the next commit, as potluck jobs on
lavapipe; reported with the shas.
2026-11-12 22:19:46 -08:00
..