Each egui_kittest wgpu renderer creates its own Vulkan instance and
device. When one test uses its device while a test on another thread
creates or destroys one, the Vulkan loader now and then crashes the test
binary with SIGSEGV. The previous commit serialized the four rendering
tests in tests/visual_regression.rs; the craft-ui unit test binary has
the same pattern in two tests:
combo::tests::the_button_and_menu_look_like_eguis and
tabs::dialog::tests::selected_tab_erases_a_baseline_centered_on_its_bottom_edge.
Both now take crate::gpu_test_lock() before building their harness and
hold it until the harness is dropped. The comment on the lock in
visual_regression.rs now names the loader race instead of concurrent
rendering alone.
The visual_regression test binary crashed with SIGSEGV now and then on
the Ubuntu CI runner, where wgpu uses Vulkan (WGPU_BACKEND=vulkan) with
Mesa's software driver. Four of its tests each create a
WgpuTestRenderer, which creates its own Vulkan instance and device, and
the test harness runs them on parallel threads. When one test uses its
device while another creates or destroys one, the Vulkan loader can
read a device entry that is being freed.
Each of those tests now takes a shared lock before it creates its
renderer and holds it until the renderer is dropped. A poisoned lock is
taken over, so a failed test does not block the others.
B pictures between anchors (b_pictures 0..=4, default 2) with reordering:
pictures go in in display order, packets come out in decoding order with
dts one picture interval before the presentation times. Closed or open
GOPs; the leading B pictures of a closed GOP predict backward only.
B macroblocks are forward, backward or interpolated, from a search per
direction seeded with the P picture's vectors scaled to the distance, or
skipped (previous directions with the predictors, kept inside the
reference). Rate control adds TM5's B complexity (K_b 1.4); a constant
quantiser codes B pictures at 1.25 times it.