Brings #1889 up to date with main after #1742 (the pipeline compile unlock),
resolving the five conflicts as described in the guide on the PR:
https://github.com/ubiquitarianism/leonida/pull/1889#issuecomment-7175252290
- vulkan_replay.h: PipelineCompiles::build takes both the large-compile
budget and main's `prior` compiles; build_pipelines passes the budget,
and main's check_compiled_pipelines / finish_compiled_pipelines stay.
- vulkan_backend.h: execute_now takes the large-compile demand and passes
the budget to the pass-0 compile, and pass 1 passes the budget too.
set_large_compiles locks pipeline_mutex_, since #1742 moved the
pipeline state under that lock.
- replay_pipeline_compiles_test.cpp: both test blocks kept, and the
prior_compiles_reuse call passes an empty budget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compute modules over 128 KiB and graphics pipelines of 1 MiB of SPIR-V or more wait at one gate for the process until their estimates fit the memory that is free, instead of one at a time. PipelineCompiles::build gives a submission as many lanes for them as can be in at once, largest first, and fills the rest with small ones. A thread that waits for its place holds no PSO's lock, and one that has a place waits for none. The warm-up's compiles are speculative. LEONIDA_SERIAL_BIG_COMPILES=1 keeps one at a time, 0 has no limit, LEONIDA_BIG_COMPILE_BUDGET_MB fixes the budget.
Address Windows MSVC / RX 7900 XT review findings on #1742:
- Qualify VulkanQueue::QueueKind::compute and ReplayResult::unresolved_resource
in replay_pipeline_compile_unlock_test.cpp and replay_pipeline_compiles_test.cpp.
- Add PipelineCompiles::build_serial() / build_pipelines_serial() so the
no-workers serial path still compiles outside resource_mutex_ while stopping
at the first fatal refusal (preserving d3d12_pipeline_workers::refused_graphics
serial expectations and avoiding wasted compiles after a failed draw).
- Add serial_stops_at_refused_draw() unit coverage in replay_pipeline_compiles_test.cpp.
prepare() leaves the pipelines that are not built yet to PipelineCompiles, once per pipeline and variant. VulkanQueue::execute_now compiles them together on the device's workers with the resource lock held, places them in the prepared commands and then writes the command buffer, so every draw and dispatch has its own pipeline. A refused compile gives the result prepare() alone would have given. LEONIDA_PIPELINE_THREADS=0 keeps the path of before. Graphics pipelines of 1 MiB of SPIR-V or more and compute pipelines over 128 KiB compile one after another, and LEONIDA_ASYNC_PIPELINES keeps its own worker.