test(shader): cover fault check dedup for formatted loads and loops #17523
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17523"
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 boykopovar/AnyPS5. Originally posted by adam25136 on 2026-11-08T20:12:12Z.
What
The fault check dedup from #15795 has a debt entry that names two untested paths: "The formatted swizzle-selector check and loops are not covered by tests." It ends with "Closes when: a test covers the swizzle-selector check and a loop." This PR adds those cases to
agc_driver_fault_check_dedupand removes that sentence and its closing condition from the entry; the rest of the entry stays.Program::FormatLoademitsBUFFER_LOAD_FORMAT_X(MUBUF op 0) through a GPU descriptor. Descriptor A gets a third state next to valid and reserved bit set:dst_sel_x= 2, which only the selector check of a formatted load (formattedDispatch, key9 + components) faults on. New cases:Program::Loopemits a scalar loop ons20(s_mov_b32,s_add_u32,s_cmp_lt_u32,s_cbranch_scc1, three passes; the output does not show the pass count). These cases meet the entry's closing condition; the one dominance mutation tried is caught first by an existing case (see Tested). New cases:ifdoes not cover the join (0);APS5_NO_FAULT_CHECK_DEDUPmust give the same fault and output, and the removed count, the fault and the values must match the expectation.Programsholds 32 programs instead of 16.Tested
Windows 10 Pro 22H2 (19045), i9-12900KF, NVIDIA GeForce RTX 5080 (
10de:2c02, driver 621.14, 32.0.16.2114), WinLibs GCC 15.2.0 r7, Release,BUILD_TESTING=ON, this branch rebased ontomainbfdb58119e:ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R '^agc_driver_fault_check_dedup$' -Vpasses, withSelected GPU name=NVIDIA GeForce RTX 5080in the log: 17 cases, the 4 with a formatted load in 6 descriptor states and the others in 4. 0.95 s, against 0.63 s formain's test.ANYPS5_ENABLE_SPIRV_TOOLS=ON(separate build, as the Linux CI job builds it) the test passes with the same removed counts: 4.74-4.83 s over three runs after a first run of 9.18 s, against 2.29-2.38 s over three runs ofmain's test.mainand on this branch, with the same two variables plusVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(1.4.367, the Khronos nightly built from3baa2b8) andVK_LOADER_LAYERS_DISABLE=~implicit~, throughctest -V. Neither log haswas not found but was requested by env var VK_INSTANCE_LAYERSor aVUID-line. A rerun on this branch withVK_LOADER_DEBUG=layershows the layer inserted.SpirvRuntimeBuffer.cppon this commit, each reverted afterwards:9u + componentsto8u): the full test fails at "formatted load, same descriptor twice" with "the default removed 3 record_bda_fault calls (23 opt-out, 20 default), expected 2". "raw load does not cover the selector check of a formatted load", run alone, fails with "the default removed 2 record_bda_fault calls (23 opt-out, 21 default), expected 1". With the count check disabled it fails on the fault instead: with A's reserved selector,APS5_NO_FAULT_CHECK_DEDUPreports the fault at the formatted load (instruction=0x5c) and the default reports none.faultBlockDominatesreturning true: the full test fails first at the existing case "check in a skipped uniform if does not cover the join". "check in a skipped loop does not cover the join", run alone, fails with "the default removed 1 record_bda_fault calls (14 opt-out, 13 default), expected 0".main095ff72367before opening: the test passes there too (0.96 s, RTX 5080); the results above are frombfdb58119e.python tools/check_conventions.py --base origin/mainwith this title and description passed.python tools/pr_overlap.py --branchprobed all 1,856 open pull requests: 95 share a file or an export with this branch. Its line comparison did not finish here, so I checked those files on the heads it fetched: no open pull request changesFaultCheckDedup.cpp; the 10 that changeSpirvRuntimeBuffer.cppchange none offaultCheckCovered,faultCheckKey,faultBlockDominates,PlanFaultCheckDominatorsorformattedDispatch; and none of the 93 that editdocs/dev/debt/shader.mdchanges the "Fault check dedup" entry.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code