fix(metal,gpu): guard compute/mesh pipeline compiles, flush archive, and budget thread_pipe #243
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/243"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-27T03:57:14Z.
Summary
Closes three gaps where compute and mesh pipelines could block the
TITLElock for multiple seconds or lose compiled pipeline states across runs (#15, #180, #181):victory-metal):COMPILE_DEADLINEanddisk::crashed/remember_crashfrom vertex render pipelines to compute pipelines (archive::compile_compute,Metal::create_compute_pipeline*) and mesh render pipelines (archive::compile_mesh), preventing slow or crashingMTLCompilerServiceruns from holdingTITLEpast the 30 s watchdog.MTLBinaryArchivepersistence withoutDrop(victory_metal::archive):Titlelives insidestatic TITLE,Archive::dropnever runs when the process exits or is ended by the watchdog, andadded_oneonly saved when a subsequent pipeline arrived >= 5 s after the previous save.>= 200 ms(SAVE_SLOW_COMPILE) so multi-second world compute pipelines are persisted right away, and addsArchive::flush_dueat command-buffer commit so trailing additions flush onceSAVE_EVERYelapses even if no further pipelines compile.glue::thread_pipe(victory-gpu):FIRST_BIND_BUDGET+put_offtoOptions::thread_countscompute translations (Shader::threads_ready,Shader::native_threads_shader), matchingpipeandguess.Tests
archive::tests::compute_archive_hits_after_flush_across_reloaded_libraries(verifiesFailOnBinaryArchiveMisshits across separateload_librarytemp URLs afterflush_due)victory-metal,victory-gpu,victory-shader,victory-hle,victory, andxtasktest suites pass, along with Windows clippy (--all-targetsand--all-features) andcargo xtask policy.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T04:26:17Z.
Review: APPROVED
Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). The deadline path and the thread_pipe budget match the render path. Thanks!
One thing to watch, not blocking:
added_onenow serializes the whole binary archive synchronously after every compile of 200 ms or more. On a cold first world frame with many slow compiles, that is repeated full-archive writes on the frame thread inside the title's 30 s watchdog window. If it shows up in a cold run, raisingSAVE_SLOW_COMPILEor limiting the save to once a second would cover it.