test(agc): skip vouched lookups where host imports report GPU reads as writes #7916
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7916"
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 DavidAmsellem on 2026-10-19T13:54:06Z.
What
agc_driver_image_table_vouched_lookupsfails on every RADV device reported in #7766 (RDNA4, RDNA3, RDNA2 iGPU, Vega). It passes on lavapipe and NVIDIA. The cause is in the test's assumption, not in the vouch path (full trace in this comment):APS5_WRITE_WATCH_IMPORTS=watchand keeps its table in a private block, which reaches the GPU as a host pointer import.4 of 4 scratch pages written after a GPU read, 4 after the importand therefore compares those imports. The forcedwatchkeeps trusting the watch anyway.ShaderMemory::Vouchedsees it changed,ResourceMaterializer::Unwritten()fails, andsupplyWordsis never called. The column is reused by comparison instead, so the second assertion still passes. The cached variant ends withshared.size() == 0, and the third assertion sees zero vouch counters.Two things that do not fix it: importing the block before the table is stamped (the GPU read alone moves the generation), and allocating the block through
GuestArenaon Linux (still private, still a host pointer import).The change is in the test only. Before
--vouched-lookupsruns, it callsProbeImportWriteProtectionon the test device. It skips (77) with the probe's numbers when a GPU read of a host import reports writes, or when the probe fails. A write reported at the import alone does not skip: NVIDIA reports one there, but none after a GPU read, and the fixture passes on it (thanks to @simonbbby for catching the first version's wider gate). The skip is worded as a device limitation, sotools/check_skips.py --job linuxaccepts it.PrepareImportWatchcan't be used for this: with the forcedwatchit returnsWatchwithout probing, and on lavapipe the probe answersUnwatchbecause of GPU writes, which this test never makes to the table. Devices without host imports are unchanged. Windows keeps its own gate from #7929, which this branch is rebased on; the Linux gate sits next to it. The other modes of the same binary are untouched.On RADV, the vouched path is then not exercised by this test. It still runs on lavapipe (CI) and NVIDIA. Covering it on RADV would need the block to go through the dma-buf import, which the probe reports as watched on this machine. That would be a separate change.
Tested
Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release, on
main85029a00fand on this branch, then again after rebasing ontomaindbac9fa15(same results, with the validation layer). Command:ctest --test-dir build -R "image_table_(vouch|cache)" -VwithANYPS5_REQUIRE_VULKAN=1, run 3 times per device.mainvouched_lookupsthe device reports 4 of 4 host-imported pages written after a GPU read)vouched_lookupsvouch_queued_draws,image_table_cache,image_table_cache_boundsValidation:
ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, layer 1.3.275 (loaded; checked withVK_LOADER_DEBUG=layer), no "was not found but was requested" line. On both devices,mainand this PR log onlyVUID-VkDeviceCreateInfo-pNext-pNextfrom device creation, and the PR adds no newVUID-. It logs fewer on RADV because the test now skips earlier.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
Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-19T14:26:38Z.
Two findings on exact head
7220d35b77985454693538c78175493e5aa201a5, compared with its exact main parent85029a00f526a80318dfd1ead199cf021a99236b.Ubuntu 24.04, Ryzen 9 9950X, GCC 13.3, Release. NVIDIA RTX 3090 / 595.99.02, gfx1036 iGPU / RADV RAPHAEL_MENDOCINO / Mesa 25.2.8, and lavapipe. Each driver was selected with its ICD; loader output confirms the actual device.
ANYPS5_REQUIRE_VULKAN=1, shader cache and pipeline journal disabled, and the registeredAPS5_WRITE_WATCH_IMPORTS=watchsetting retained.The new gate also removes passing NVIDIA coverage. Fresh
--vouched-lookupsprocesses, three per cell:The NVIDIA skip prints
4 of 4 pages written at the import and 0 after a GPU read; RADV prints4and4. So an import-time dirty count by itself is not evidence that this fixture cannot vouch on NVIDIA. Removing only the import-time predicate restores the entire existing test, including its mutation/refusal and re-vouch assertions:The actual RADV and NVIDIA JUnit skips fail the Linux skip checker.
python3 tools/check_skips.py pr-radv.xml --job linuxexits 1 witherror: agc_driver_image_table_vouched_lookups skipped. The output is present in the JUnit; the wordinghost imports on this device reportdoes not matchDEVICE_LIMITATION. Changing only that prefix toskipped, the device reports ...makes the RADV skip accepted. This is separate from the NVIDIA gate issue.With those two temporary line changes, the four-test
image_table_(vouch|cache)scope passes on NVIDIA and lavapipe, and passes with just the intended vouch skip on RADV. Each non-skipped case passed three executions per device; the actual JUnit skip checker passes for all three. The other three cases also pass on the unmodified parent and head.The original file is restored byte-for-byte and rebuilt, and the checkout is clean. Repeating the restored head reproduces NVIDIA/RADV 77/77/77 and lavapipe 0/0/0, confirming the predicate control rather than a production or device-selection change. No production fix, title result, Windows/macOS result or validation-layer check is claimed. The adjusted predicate is verified on these devices only; logs, JUnit and the two-line control are retained.
Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-19T15:01:00Z.
@simonbbby thank you, both are right. Fixed in
dfacadf46:probe.failure == nullptr && probe.writtenAfterSubmit == 0. Your NVIDIA numbers (4 at the import, 0 after a GPU read) are consistent with my RADV trace: the stamp moving after the GPU read alone was what broke the vouch here, and the import count was a condition I should not have added.skipped, the device reports ....Re-run on the RX 7900 XT (RADV NAVI31, Mesa 25.2.8) and lavapipe, 3 times each,
ANYPS5_REQUIRE_VULKAN=1,ctest -R "image_table_(vouch|cache)" --output-junit:vouched_lookupstools/check_skips.py --job linuxthe device reports 4 of 4 host-imported pages written after a GPU read, ...I have no NVIDIA GPU, so the NVIDIA cell rests on your run with the same predicate.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T16:01:11Z.
AMD and Intel Windows data: with this PR, the UHD 770 still fails
agc_driver_image_table_vouched_lookups, apparently for the same reason, through the Windows path. The RX 9070 XT passes with and without it.Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release,
ANYPS5_NO_SHADER_CACHE=1, serial CTest,--repeat until-fail:3. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, withVkCacheemptied first. This headdfacadf46merged intomaincded26c68, againstmaincded26c68alone. Tests:vouched_lookups,vouch_queued_draws,image_table_cacheandimage_table_cache_bounds.mainvouched_lookupsfails:a cached dispatch over an unwritten table was not validated by its table's vouch (0 vouched, 0 refused, 0 columns read, 0 reused); the other 3 passThe two devices' write-watch lines match the split:
[write-watch] Windows direct host imports use comparisons (no second queue to settle imports on)host imports of write-watched memory keep the write watch: yes (... 0 after a full GPU read ...); direct host imports of private memory are settled and stay watchedOn Windows,
decideImportWatchdoesn't readAPS5_WRITE_WATCH_IMPORTS. It watches private imports only when the context has a settle queue andProbeImportWriteProtectionpasses. The UHD 770 has no second queue, so the table's import is compared and never vouched for, the same chain as on RADV.ImportsStayWatchedThroughReadsreturnstrueon_WIN32, so the test still runs there. A Windows branch could skip whensettleQueueis null, or when the probe fails thewatchPrivateImportscondition. That would turn this failure into a skip, and the RX 9070 XT would keep running the vouched path.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-19T17:19:08Z.
@savvaniss thank you, your reading of
decideImportWatchis right: this PR returnedtrueon_WIN32, so it left the UHD 770 case uncovered. Since your run, #7929 has merged with a Windows gate for the same test, and yourmaincded26c68predates it. On a device without a settle queue,ProbeImportWriteProtectionfails atthe settle queue, so that gate should turn your UHD 770 failure into a skip.I have rebased this PR onto
maindbac9fa15. It now adds only the Linux gate next to the #7929 Windows block, and it gets the context fromdevice->graphicsContext(), as that block does. The Linux condition is unchanged (writtenAfterSubmit == 0).AMD Radeon RX 7900 XT (RADV NAVI31), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release, full build.
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ×3:vouched_lookupsthe device reports 4 of 4 host-imported pages written after a GPU read)vouch_queued_draws,image_table_cache,image_table_cache_boundsNo new
VUID-errors. The only one in either log isVkDeviceCreateInfo-pNext-pNext, from my older validation layer, which does not know maintenance8.tools/check_skips.py --job linuxaccepts the skip, andtools/check_conventions.pypasses.If you rerun on current
mainwith this PR merged, I would expect the UHD 770 to skip and the RX 9070 XT to keep passing, but I have not tested Windows.AI-assisted: yes (Claude Code)