P2 visibility on the pinned SwiftShader device — 2026-09-23
The first Windows CI run of P2 at ba3efa8 exposed two related problems. The native CPU-only job ran gpu_visibility because its CTest registration lacked the gpu label. The graphics job had a Vulkan driver, but every P2 rendering test fell back to Direct. Its pinned SwiftShader device reports shaderDrawParameters = false. Slang generated OpCapability DrawParameters and a BaseInstance input for SV_InstanceID, and Faset therefore excluded the device from GPU visibility. The graphics failures in shader reload, Player diagnostics and the HZB overlay followed from that same fallback. The failing runs are Windows graphics and native/manual checks.
Commit 433bce0 changes both GPU vertex entries to SV_VulkanInstanceID, which reads Vulkan's raw InstanceIndex. Every fixed-bin indirect command has firstInstance = 0 and passes its visible-ID range base separately, so indexing is unchanged. The renderer no longer requests shaderDrawParameters. A shader reflection regression test rejects OpCapability DrawParameters in both compiled vertex entries. The GPU smoke test now carries gpu;p2 labels: a CPU-only ctest -LE gpu excludes it, while P2 runs include it. Slang's SPIR-V semantics explain why SV_InstanceID had introduced BaseInstance.
The matching Linux build of the pinned SwiftShader source reports the same unsupported feature and sufficient storage-buffer/workgroup limits in the capability record. After the change, both vertex SPIR-V modules contain only the core Shader capability and pass spirv-val. All 16 P2 cases pass with GPU visibility active on this device. The three previously failing ancillary checks — shader reload, Player diagnostics and HZB overlay — also pass. With Vulkan deliberately unavailable, the 26 CPU-only Release tests passed and ctest -LE gpu excluded gpu_visibility.
The first green Windows graphics CI run at 433bce0 used the pinned SwiftShader Win32 driver: all 58 registered tests passed, including GPU visibility, shader reload, HZB overlay, Player mode diagnostics and native window/editor tests. Its export integration test built and launched 2D and 3D Release games. The matching native/manual CI run also passed, including Windows CPU-only selection and strict documentation.
The Linux SwiftShader ICD in this local build does not expose a Wayland surface, so its window lifecycle and GUI/MCP tests cannot be used as a native-window acceptance result. The Windows graphics workflow checks those paths on its Win32 surface. The Windows runner did not provide the Khronos validation layer; its reported zero validation errors are not a validation-layer pass. Software Vulkan establishes compatibility and functional behavior, not frame-time performance or coverage of physical Windows GPUs. The Linux NVIDIA/Lavapipe dossier keeps the earlier benchmark, exported Player and visual-comparison evidence at its original revision.
An independent review of the complete P2 branch found two reporting/identity gaps, fixed in 22012c1. The renderer now records the effective visibility mode separately from the requested mode; an occlusion request on a device without HZB is reported as GPU frustum, and missing GPU culling is reported as Direct. A CPU policy test covers both capability fallbacks. The stable slot and full 64-bit generation from InstanceTracker now travel in each GPU instance record; compact candidate/visible indices remain frame-local buffer addresses. A focused test covers reorder, mesh replacement, anonymous records and upper generation bits. The reviewer confirmed both fixes. At 22012c1, full Linux Debug and Release CTest each reported 57 registered tests, zero failures and one existing native-window skip; the ImGui overlay test passed 1/1; pinned Linux SwiftShader passed P2 16/16 and Player diagnostics 1/1; a driverless CPU-only Release selection passed 26/26.
The final Windows graphics CI run at 22012c1 passed all 58 registered tests with no skips on pinned SwiftShader. Its export integration test and the separate playable-export report, retained from that run's artifact, record both checked-in 2D/3D Release games after Unicode-path relocation and 120 headless frames each with captured image hashes. Those exported games used the default Direct mode; P2 GPU-mode Player execution was exercised by Windows CTest and by relocated Linux exports, not by this Windows export script. The native/manual CI run at 22012c1 passed on Linux and Windows, including the Windows CPU-only selection and strict documentation build.