Files
metal2vulkan/crates/metal2vulkan-runtime/examples
Anees Iqbal c6fa636665 Hold large pipeline makings to one large compile at a time
A guest's run on RADV made kernels of up to 4.5 M SPIR-V words several at
once; on the Radeon 780M one such making alone peaks at 3.6 to 10.3 GiB
resident (1.9 to 4.5 M words). Nothing bounded how many large modules the
driver compiled at once beside the budget's turns, which count makings and
not their size.

The process now keeps a limit of SPIR-V words in flight
(pipeline/compile_memory.rs): a making whose stages hold 65,536 words or
more holds its words around its driver call, the counted makings in
flight holding at most 4,194,304 words, a larger one alone. One that does
not fit waits for those in flight, lending its turn (budget::without_turn)
and taking one again after; the waiters go in their turns' rank order and
none passes one waiting before it, so a large making never starves. The
compute making (objects.rs) holds its kernel's words, a whole render
pipeline its stages', a pipeline library its own part's. Each module
carries its words. WorkCounts counts the makings that waited
(makings_held_for_compile_memory) and their wait
(compile_memory_held_nanos); the conformance cost half reads the count
with the other making counts.

Unit tests: a making below the floor is not held; two that do not fit
never hold at once; no counted making passes a waiting one, waiters going
in rank order; a waiter lends its turn and takes it again.
2026-11-12 15:37:20 -08:00
..