Commit Graph

3 Commits

Author SHA1 Message Date
b17397f0dd tests: derive every test's scratch folder from test_temp_dir::temp_dir, not GetTempPath (TEST-TEMPDIR-STRIPPED-ENV)
With TMP, TEMP and USERPROFILE all unset, GetTempPathW returns C:\Windows\, and the throwing create_directories/copy_file/ofstream on C:\Windows\leonida_* aborts with 0xc0000409 before the test body runs. runtime/test/test_temp_dir.h grows one entry, testfiles::temp_dir(): LEONIDA_TEST_DIR when set, the current directory when the temp environment is stripped (Windows), else the standard temp resolution. Fifty-two test files and the tiny_game fixture that called GetTempPathA/W or temp_directory_path directly now use it; d3d12_queue_handover_test.cpp also checks the _sopen_s result in capture_stderr instead of silently returning empty stderr. One runtime source function needed the same fallback because tests exercise it: tls_host_clone_dir in runtime/src/pe_loader.cpp (the loader_tls tests). Rebased onto current main after its D3D-448 additions to d3d12_mesh_test.cpp (3-way; the mesh test keeps both). Verification on a Windows VM: stripped environment - the previously crashing d3d12 tests exit 77 (no usable Vulkan device) instead of aborting, file_system_test runs all 505 checks and loader_test all 95 with zero failures; normal environment - identical outcomes; LEONIDA_TEST_DIR honored under a fully stripped environment (the scratch folder observed mid-run inside it, cleaned up after the pass). The finding is whoalin1's (coordination issue #14, 02:37:44Z).

AI-assisted.
2026-11-28 19:01:06 +00:00
07032412c8 spirv_stores: bound the walk through array types; the GPU test honours LEONIDA_VK_VALIDATION=0
A malformed module whose array type names itself made the element walk spin
inside CreateGraphicsPipelineState; it now stops after 16 levels, with a case in
spirv_stores_test. d3d12_stores_atomics_test turns the validation layer on for
itself only when the variable is unset. The docs say how the 1,018 of 1,038
figure is counted.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 22:04:06 +00:00
a36506022f d3d12: the runtime's own Vulkan device enables fragmentStoresAndAtomics; a PSO that needs it elsewhere is refused
create_vulkan_device_standalone never enabled fragmentStoresAndAtomics or
vertexPipelineStoresAndAtomics, so a pixel shader with a writable storage
image (an image atomic: 1,018 corpus pixel shaders) broke
VUID-RuntimeSpirv-NonWritable-06340 while CreateGraphicsPipelineState
answered S_OK.

The device enables both where the GPU has them. A graphics PSO whose stage
declares writable storage (src/spirv_stores.h reads the declarations) on a
device without the feature is refused with E_NOTIMPL and a log line.

spirv_stores_test checks the rule on hand-built SPIR-V; d3d12_stores_atomics_test
checks the refusal and the standalone device under the validation layer.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 22:04:06 +00:00