From 050f5911e24ae82509dabd89ff4ab85fd5f9757f Mon Sep 17 00:00:00 2001 From: blawesom Date: Sun, 11 Oct 2026 10:11:37 +0200 Subject: [PATCH 1/6] test(agc): register the full recorder run with ctest The full run of agc_driver_recorder_tests (no arguments) was the only section of the binary no ctest test covered: the registered entries run the -only flags, which skip the main flow from readTrackingTests through drawSnapshotPatchTests. Both failures that kept it off the run are resolved on main: the (w) import window and (s) stale generation sections now check generations around the storage image's own import (433302be), and the lavapipe partial publish copy is preserved when device writes reach the write watch (60f12c88). Run on a Radeon RX 9070 (RADV, Mesa 26.2.4), Linux 7.2: 3/3 pass, 0.5-0.9 s per run; the full run joins the existing agc_driver_recorder_tests entries in the same CMake block. --- core/libs/prx/libSceAgcDriver/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/libs/prx/libSceAgcDriver/CMakeLists.txt b/core/libs/prx/libSceAgcDriver/CMakeLists.txt index dca6910043..845fee18b0 100644 --- a/core/libs/prx/libSceAgcDriver/CMakeLists.txt +++ b/core/libs/prx/libSceAgcDriver/CMakeLists.txt @@ -1074,6 +1074,8 @@ if(BUILD_TESTING) set_tests_properties(agc_storage_cpu_snapshot PROPERTIES ENVIRONMENT "ANYPS5_NO_SHADER_CACHE=1" TIMEOUT 30 SKIP_RETURN_CODE 77 ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() + add_test(NAME agc_driver_recorder COMMAND agc_driver_recorder_tests) + set_tests_properties(agc_driver_recorder PROPERTIES SKIP_RETURN_CODE 77) add_test(NAME agc_descriptor_pool_recycling COMMAND agc_driver_recorder_tests --descriptor-pool-only) set_tests_properties(agc_descriptor_pool_recycling PROPERTIES SKIP_RETURN_CODE 77) add_test(NAME agc_draw_snapshot_cap COMMAND agc_driver_recorder_tests --draw-snapshot-cap-only) @@ -1096,7 +1098,7 @@ if(BUILD_TESTING) add_test(NAME agc_metadata_pass COMMAND agc_driver_recorder_tests --metadata-pass-only) set_tests_properties(agc_metadata_pass PROPERTIES SKIP_RETURN_CODE 77) if(WIN32) - set_tests_properties(agc_recorder_read_list agc_host_import_unmap agc_parked_import_unmap agc_host_import_retirement agc_sparse_run_import agc_sparse_run_import_copied agc_unit_shadow agc_descriptor_pool_recycling agc_draw_snapshot_cap agc_multisample_guest_access agc_draw_inputs_in_place agc_resident_present agc_slice_dirty agc_queued_write_groups agc_metadata_pass PROPERTIES ENVIRONMENT_MODIFICATION + set_tests_properties(agc_recorder_read_list agc_host_import_unmap agc_parked_import_unmap agc_host_import_retirement agc_sparse_run_import agc_sparse_run_import_copied agc_unit_shadow agc_descriptor_pool_recycling agc_draw_snapshot_cap agc_multisample_guest_access agc_draw_inputs_in_place agc_resident_present agc_slice_dirty agc_queued_write_groups agc_metadata_pass agc_driver_recorder PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") add_test(NAME agc_host_import_second_mapping COMMAND agc_driver_recorder_tests --host-import-second-mapping-only) set_tests_properties(agc_host_import_second_mapping PROPERTIES SKIP_RETURN_CODE 77 ENVIRONMENT_MODIFICATION From 68f1c77477c13b6fcbc6e024074661ea9b4ad6c4 Mon Sep 17 00:00:00 2001 From: Kovalev Vladislav Date: Tue, 13 Oct 2026 19:02:41 +0600 Subject: [PATCH 2/6] test(agc): bound the full recorder run to thirty seconds --- core/libs/prx/libSceAgcDriver/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/libs/prx/libSceAgcDriver/CMakeLists.txt b/core/libs/prx/libSceAgcDriver/CMakeLists.txt index 845fee18b0..23b930e98e 100644 --- a/core/libs/prx/libSceAgcDriver/CMakeLists.txt +++ b/core/libs/prx/libSceAgcDriver/CMakeLists.txt @@ -1075,7 +1075,7 @@ if(BUILD_TESTING) ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() add_test(NAME agc_driver_recorder COMMAND agc_driver_recorder_tests) - set_tests_properties(agc_driver_recorder PROPERTIES SKIP_RETURN_CODE 77) + set_tests_properties(agc_driver_recorder PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 30) add_test(NAME agc_descriptor_pool_recycling COMMAND agc_driver_recorder_tests --descriptor-pool-only) set_tests_properties(agc_descriptor_pool_recycling PROPERTIES SKIP_RETURN_CODE 77) add_test(NAME agc_draw_snapshot_cap COMMAND agc_driver_recorder_tests --draw-snapshot-cap-only) From b617576af03903743568d99e6fc9c114070ccb38 Mon Sep 17 00:00:00 2001 From: Kovalev Vladislav Date: Tue, 13 Oct 2026 19:22:45 +0600 Subject: [PATCH 3/6] test(agc): keep recorder runtime path scoped to its test --- core/libs/prx/libSceAgcDriver/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/libs/prx/libSceAgcDriver/CMakeLists.txt b/core/libs/prx/libSceAgcDriver/CMakeLists.txt index 23b930e98e..99f3225df8 100644 --- a/core/libs/prx/libSceAgcDriver/CMakeLists.txt +++ b/core/libs/prx/libSceAgcDriver/CMakeLists.txt @@ -1076,6 +1076,10 @@ if(BUILD_TESTING) endif() add_test(NAME agc_driver_recorder COMMAND agc_driver_recorder_tests) set_tests_properties(agc_driver_recorder PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 30) + if(WIN32) + set_tests_properties(agc_driver_recorder PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() add_test(NAME agc_descriptor_pool_recycling COMMAND agc_driver_recorder_tests --descriptor-pool-only) set_tests_properties(agc_descriptor_pool_recycling PROPERTIES SKIP_RETURN_CODE 77) add_test(NAME agc_draw_snapshot_cap COMMAND agc_driver_recorder_tests --draw-snapshot-cap-only) @@ -1098,7 +1102,7 @@ if(BUILD_TESTING) add_test(NAME agc_metadata_pass COMMAND agc_driver_recorder_tests --metadata-pass-only) set_tests_properties(agc_metadata_pass PROPERTIES SKIP_RETURN_CODE 77) if(WIN32) - set_tests_properties(agc_recorder_read_list agc_host_import_unmap agc_parked_import_unmap agc_host_import_retirement agc_sparse_run_import agc_sparse_run_import_copied agc_unit_shadow agc_descriptor_pool_recycling agc_draw_snapshot_cap agc_multisample_guest_access agc_draw_inputs_in_place agc_resident_present agc_slice_dirty agc_queued_write_groups agc_metadata_pass agc_driver_recorder PROPERTIES ENVIRONMENT_MODIFICATION + set_tests_properties(agc_recorder_read_list agc_host_import_unmap agc_parked_import_unmap agc_host_import_retirement agc_sparse_run_import agc_sparse_run_import_copied agc_unit_shadow agc_descriptor_pool_recycling agc_draw_snapshot_cap agc_multisample_guest_access agc_draw_inputs_in_place agc_resident_present agc_slice_dirty agc_queued_write_groups agc_metadata_pass PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") add_test(NAME agc_host_import_second_mapping COMMAND agc_driver_recorder_tests --host-import-second-mapping-only) set_tests_properties(agc_host_import_second_mapping PROPERTIES SKIP_RETURN_CODE 77 ENVIRONMENT_MODIFICATION From 62d80787be3ffc2dd5a0d32e6370d511e57fce30 Mon Sep 17 00:00:00 2001 From: Kovalev Vladislav Date: Tue, 13 Oct 2026 20:22:17 +0600 Subject: [PATCH 4/6] test(agc): require the kernel device for DMA-BUF coverage --- core/libs/prx/libSceAgcDriver/tests/Recorder.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp b/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp index 916b9ca313..02289ee9d4 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -198,6 +199,12 @@ public: extensionsEnabled.push_back(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME); extensionsEnabled.push_back(VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME); context.dmaBufImport = true; +#ifdef __linux__ + if (!std::filesystem::exists("/dev/udmabuf")) { + context.dmaBufImport = false; + std::cout << "No /dev/udmabuf: DMA-BUF imports are unavailable\n"; + } +#endif } VkPhysicalDeviceImageViewMinLodFeaturesEXT minLod{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT}; if (hasExtension(VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME)) { From 6bd076c1917ef71211a2753a48ac3c5a708cebc1 Mon Sep 17 00:00:00 2001 From: AnzouBeli Date: Wed, 14 Oct 2026 15:38:03 +0100 Subject: [PATCH 5/6] test(agc): account for unknown pending DCC key writes (cherry picked from commit 1b3f2e098260418b06dbd47aaa3429671c0f9bd7) --- core/libs/prx/libSceAgcDriver/tests/Recorder.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp b/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp index 02289ee9d4..e0c7d6050f 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp @@ -1175,15 +1175,14 @@ void keyProofTests(const Device& device, Recorder& recorder) { before = KeyProofCounts(); Require(before.scanned == after.scanned + 1 && proof.keys == DccKeys::Clear0001, "(9) the CPU write did not make a scan"); Require(ProvedClearKeys(resource, surfaceBytes, proof) == DccKeys::Clear0001 && KeyProofCounts().proved == before.proved + 1, "(9) the new keys were not proved"); - // A recorded write over the keys (noted and stamped as the driver's key stores are): the scans - // are not kept until its batch signaled. + // An unknown pending write cannot supply DCC keys, so reading them synchronizes before caching a proof. recorder.NotePendingWrite(address, keyCount); MarkWritten(address, keyCount); before = KeyProofCounts(); - Require(ProvedClearKeys(resource, surfaceBytes, proof) == DccKeys::Clear0001 && proof.generation == 0, "(9) a scan under a pending write was kept"); - Require(ProvedClearKeys(resource, surfaceBytes, proof) == DccKeys::Clear0001 && proof.generation == 0, "(9) a second scan under a pending write was kept"); + Require(ProvedClearKeys(resource, surfaceBytes, proof) == DccKeys::Clear0001 && proof.generation != 0, "(9) an unknown pending write was not synchronized before proving keys"); + Require(ProvedClearKeys(resource, surfaceBytes, proof) == DccKeys::Clear0001 && KeyProofCounts().proved == before.proved + 1, "(9) the synchronized proof did not hold"); after = KeyProofCounts(); - Require(after.scanned == before.scanned + 2 && after.unstable == before.unstable + 2 && after.proved == before.proved, "(9) unstable scans were miscounted"); + Require(after.scanned == before.scanned + 1 && after.unstable == before.unstable && after.proved == before.proved + 1, "(9) a synchronized key scan was miscounted"); recorder.Submit(); device.WaitQueue(); Require(ProvedClearKeys(resource, surfaceBytes, proof) == DccKeys::Clear0001 && proof.generation != 0, "(9) a signaled write kept the scan unstable"); From a95e122dca1f59e6f60f8a37774d47cfabd34de5 Mon Sep 17 00:00:00 2001 From: Kovalev Vladislav Date: Wed, 14 Oct 2026 23:47:08 +0600 Subject: [PATCH 6/6] test(agc): isolate the reported read-tracking check --- core/libs/prx/libSceAgcDriver/tests/Recorder.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp b/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp index e0c7d6050f..5be833ad5a 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp @@ -1175,7 +1175,6 @@ void keyProofTests(const Device& device, Recorder& recorder) { before = KeyProofCounts(); Require(before.scanned == after.scanned + 1 && proof.keys == DccKeys::Clear0001, "(9) the CPU write did not make a scan"); Require(ProvedClearKeys(resource, surfaceBytes, proof) == DccKeys::Clear0001 && KeyProofCounts().proved == before.proved + 1, "(9) the new keys were not proved"); - // An unknown pending write cannot supply DCC keys, so reading them synchronizes before caching a proof. recorder.NotePendingWrite(address, keyCount); MarkWritten(address, keyCount); before = KeyProofCounts(); @@ -7075,6 +7074,11 @@ int main(int argc, char** argv) { std::cout << "host imports " << (PrepareImportWatch(device.GetContext()) == ImportWatch::Unwatch ? "are compared" : "stay watched") << '\n'; Recorder recorder(device.GetContext()); recorder.Activate(); + if (argc == 2 && std::string_view(argv[1]) == "--read-tracking-only") { + readTrackingTests(device, recorder); + std::cout << "Recorder read tracking tests passed\n"; + return 0; + } if (argc == 2 && std::string_view(argv[1]) == "--copied-direct-only") { copiedDirectOrderingTests(device, recorder); return 0;