Repository navigation
Conversation
…h run The suite section already warns that a passing percentage does not mean the tests ran. This adds the other half: one variable changes the answers. Measured on main cd9fe51 with a translated corpus exported for shader_library_corpus, 575 ran and four failed; from a shell without it, one failed and the two in the middle passed in 0.23 s and 0.31 s on their own.
|
Read by OreoFR on macOS 27.2.1, Apple M5, head READ IN CODE
ASSUMED
AI-assisted: Claude Code |
KelboLive
left a comment
There was a problem hiding this comment.
The mechanism checks out: a device created with an empty VulkanDeviceInfo::shader_dir loads whatever LEONIDA_SHADERS names (d3d12_vulkan_device.cpp:12263, with the count printed at :12267-12281), and both tests you cite leave it empty (d3d12_descriptor_test.cpp:330-347, d3d12_r9g9b9e5_uav_test.cpp:385-399). shader_library_corpus_test.cpp:121-124 is the registered-but-skipping one (SKIP_RETURN_CODE 77), so the variable changes pass/skip, not collection — the title is right.
But the enumeration is a big understatement, and that is the part that will rot: 95 of the 138 test files that call create_vulkan_device never set info.shader_dir, so on a shell with the variable exported they all load the corpus — d3d12_a8_copy, d3d12_clear_formats, d3d12_existing_heap, xbox_present_test and ninety-odd more. Please state the rule ("any test whose VulkanDeviceInfo leaves shader_dir empty") and give these two as examples.
Two smaller fixes:
display_white_cacheis listed among the four failures, but your own description calls it an unrelated scheduler race (#2713). As written, a reader will blame the variable — drop it from the list or label it.- "Pass it on that test's command line" does not work:
shader_library_corpus_test.cpp:120isint main()andadd_testpasses no arguments — only the environment (or an env prefix) works. And the corpus test also readsLEONIDA_SHADER_DXBCand defaults to../dxbc(:126-127), not justLEONIDA_SHADERS.
Otherwise the advice is worth having: run_gpu_tests.py never sets the variable, so a reader who exported it for the game gets exactly the false regression you describe. No test guards prose in this page (tests/test_docs_design_rows.py only checks table shape), which is another reason to state the rule rather than a list.
Verification — VERIFY-2806Verdict: PASS
AI-assisted: yes (Muse Wonder, Muse by Meta) |
|
I ran a synthetic A/B/C/D check of the two named GPU tests on cd0c52f with docs revision 97691da applied. The stock Win64 Release executables ran under Wine 11.22 on Radeon Raphael (RADV 26.3.1) and RTX 4070 SUPER (620.73.04). Both shader folders contained the same hand-written no-op compute SPIR-V, with the same digest. The only difference was the module’s descriptor_hash in index.json.
Every row agreed on both physical GPUs. The fmix runs explicitly logged that the library was loaded and selected fnv1a_fmix32. The descriptor test hit count == texels. The R9 test read 0 where the bindless sample expected 1. This isolates an independent way to reproduce the two failures without a translated corpus. The doc env-var, repo-path and link checks also passed. MEASURED with a synthetic shader. AI-assisted (Codex). |
|
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime ( |
LEONIDA_SHADERSchanges which tests pass, not just which tests run.docs/testing.mdwarns that a passingctestpercentage does not establish that the tests ran; this adds the other half of that sentence, because it cost me two false regression reports in one evening.What happened, on
maincd9fe51a9, Release, serial, this machine:And the two in the middle, re-run both ways:
Both binaries print
OKand0 validation errorswhen run directly, so it is not the test being flaky - it is the environment changing what it tests.display_white_cacheis a different thing: its own assertion races the scheduler (about 1 in 1000 runs here, written up in #2713), and I mention it only because it landed in the same run and would otherwise look like a third environment effect.The paragraph added, after the existing warning:
Why a doc and not a code change: I do not know why those two tests read it - they may load the library deliberately, and making them ignore it could remove a check. The honest fix tonight is to say what happens, and if the coupling is unintended, that is a separate change its authors should make.
docs-only,+9/-0, one file, no code.AI-assisted: yes - DeepSeek v4.1 (flash), which is also what ran the suite both ways.
Written with an AI assistant.