Repository navigation
Conversation
…-V words A diagnostic switch for cold-cache boots. A compute pipeline whose translated module is over n 32-bit words is created as a no-op stub, like a pipeline without a translated shader under LEONIDA_STUB_PIPELINES: S_OK, no shader module, layout or Vulkan pipeline, never registered, so SetPipelineState binds no compute pipeline. Unset, 0 or not a number is off; every refusal before the module is read is unchanged. Every compute pipeline compile over 2 s is now logged once with its time, word count, program SHA-256 and VkResult, which is where a value for n comes from. d3d12_stub_compute_words_test: the same PSO is registered when unset, at n equal to its word count, at 0 and at values that are not a word count, and an unregistered stub below it; an untranslated program is still E_INVALIDARG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ABh377Xfov1ZDULWTYvTm
Grimkeh
left a comment
There was a problem hiding this comment.
Independent Linux CPU review
Checked: LEONIDA_STUB_COMPUTE_WORDS diagnostic stub for oversized compute SPIR-V; docs/boot.md + README + d3d12_stub_compute_words_test + CMake. Windows/D3D12 path not run here.
Looks correct from review; no game files.
al3xar
left a comment
There was a problem hiding this comment.
Independent Windows + GPU + Vulkan validation verification of 1d02e658d (AI-assisted).
- Environment: Windows 11 x64, MSVC 19.44.35230.0 (Ninja Release), Windows SDK 10.0.26100.0, NVIDIA GeForce RTX 3060 (driver
621.24), Vulkan SDK1.4.363.0(LEONIDA_VK_VALIDATION=1), no game files. - Test runs (
LEONIDA_VK_VALIDATION=1):d3d12_stub_compute_words_test: PASS (PASS: 1670-word module compiled at n=1670 and stubbed at n=1669, exit 0, 0 Vulkan validation errors).d3d12_compute_test: PASS (exit 0, 0 Vulkan validation errors).
- Negative control: Reverted
runtime/shims/d3d12_vulkan_device.cpptoupstream/main(867d922f0) and re-rand3d12_stub_compute_words_test→ FAIL (line 101: create(device.p, desc) == 0, exit 1). - Code review:
stub_compute_words()safely caps decimal parsing at 19 digits (fits in 64-bitstd::size_twithout overflow) and treats unset/0/non-numeric/overflow as off.- Power-of-two rate-limited stub logging and
> 2000 msslow-compile logging are clean and leak no Vulkan objects; stubbing occurs beforevkCreateShaderModule/vkCreateComputePipelineswhile preserving pre-read refusals (E_INVALIDARG).
LGTM.
|
Verified on native Windows 11 (
AI-assisted. |
|
Independent Windows check: PASS Tested
AI-assisted: yes |
Claimed in #9065 (comment) (first posted in #8868).
What
LEONIDA_STUB_COMPUTE_WORDS=<n>is a diagnostic, off by default. A compute pipeline whose translated SPIR-V module is larger than n 32-bit words is created as a no-op stub instead of being compiled, the same wayLEONIDA_STUB_PIPELINES(d3d12: LEONIDA_STUB_PIPELINES, a pipeline without a translated shader is a no-op stub (boot past stop 18) #7417) stubs a pipeline without a translated shader:SetPipelineStatebinds no compute pipeline.Unset,
0or a value that isn't a number means off. Refusals that happen before the module is read are unchanged: unknown program, LDS over the device limit, missing set 0.Every compute pipeline compile over 2 s is logged once, with its duration, word count, program SHA-256 and VkResult. That log is where a value for n comes from. d3d12: checkpoint slow compute pipeline compiles #7535 times compiles for its cache checkpoint but logs nothing. Both PRs touch the same call, so whichever lands second needs a trivial rebase.
The switch is documented in docs/boot.md "Useful switches", and the test is listed in runtime/README.md.
Why
Measured on the retail title, RTX 5060 Ti, with a cold pipeline cache (#8851):
LEONIDA_STUB_COMPUTE_WORDS=100000, loading continues: about 9.6 GB read, about 2,700 compute pipelines, and per-frame draws.Note: a dispatch with a stub behaves like any dispatch without a bound compute pipeline. It is dropped and marks its list invalid, so
Closereturns E_INVALIDARG. The docs say so.Tested
d3d12_stub_compute_words_test, using a synthetic FSSM program and test/glsl/cs_user_data.comp, with no game data. It skips with 77 without a Vulkan device.d3d12_computeandd3d12_fspx_computestill pass.scripts/check_no_game_data.pyis clean on all changed files.-DLEONIDA_REQUIRE_VULKAN=ON, Vulkan SDK 1.4.363, NVIDIA GeForce RTX 5060 Ti, driver 621.01.AI-assisted (Claude Code). Reviewed and tested as above.
🤖 Generated with Claude Code
https://claude.ai/code/session_016ABh377Xfov1ZDULWTYvTm