From d24266971e97b05b47ceb3b53df89111f4c32a02 Mon Sep 17 00:00:00 2001 From: CruddOCE <306717720+CruddOCE@users.noreply.github.com> Date: Thu, 29 Oct 2026 14:04:10 +1300 Subject: [PATCH] test(agc): wait for a batch to read as signaled before the recorder's signaled-batch checks agc_driver_recorder used vkQueueWaitIdle as a stand-in for "this batch's fence signaled". On AMD's 32.0.32015.7029 Windows driver the fence still reads VK_NOT_READY for a short time after the queue wait returns, so the checks failed although the recorder behaved correctly. Each one now waits, up to 5 s, until the recorder describes the batch as signaled, then makes the same assertion. Fixes #12278 --- core/libs/prx/libSceAgcDriver/tests/Recorder.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp b/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp index 6bcfea05b4..810e625866 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp @@ -584,6 +584,15 @@ private: using Kind = Recorder::ReadKind; +template +void WaitUntilSignaled(TDescribe describe, const char* what) { + const auto deadline = std::chrono::steady_clock::now() + std::chrono::seconds(5); + for (auto info = describe(); !(info.has_value() && info->signaled); info = describe()) { + Require(info.has_value() && std::chrono::steady_clock::now() < deadline, what); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } +} + void copiedDirectOrderingTests(const Device& device, Recorder& recorder) { auto context = device.GetContext(); context.nullDescriptors = device.NullDescriptors(); @@ -866,6 +875,7 @@ void readTrackingTests(const Device& device, Recorder& recorder) { // An empty batch completes at once: once its fence signaled, its read is no reader any more, // although the batch stays in flight until it is reaped. device.WaitQueue(); + WaitUntilSignaled([&] { return recorder.DescribePendingRead(0x10000, 4); }, "the read's batch did not signal after the queue went idle"); Require(!recorder.PendingReadOverlaps(0x10000, 4), "a signaled batch's read still refuses"); Require(!recorder.Idle(), "an overlap query reaped the batch"); const auto signaled = recorder.DescribePendingRead(0x10000, 4); @@ -1226,6 +1236,7 @@ void writeSettledTests(const Device& device, Recorder& recorder) { Require(recorder.PendingWriteOverlaps(0x50000, 0x100) && !recorder.PendingWriteSettled(0x50000, 0x100) && recorder.PendingWriteSettled(0x50100, 0x100), "an open batch's write counts as settled"); recorder.Submit(); device.WaitQueue(); + WaitUntilSignaled([&] { return recorder.DescribePendingWrite(0x50000, 0x100); }, "the write's batch did not signal after the queue went idle"); Require(recorder.PendingWriteOverlaps(0x50000, 0x100) && recorder.PendingWriteSettled(0x50000, 0x100), "a signaled batch's write is not settled"); recorder.NotePendingWrite(0x50080, 0x10); Require(!recorder.PendingWriteSettled(0x50000, 0x100) && recorder.PendingWriteSettled(0x50000, 0x80), "a later open write over the range still counts as settled"); @@ -3676,6 +3687,7 @@ void resourceReadTests(const Device& device, Recorder& recorder) { Require(info.has_value() && info->kind == Kind::DispatchElement && info->open, "the build's read has the wrong kind"); recorder.Submit(); device.WaitQueue(); + WaitUntilSignaled([&] { return recorder.DescribePendingRead(element, 16); }, "the build's read batch did not signal after the queue went idle"); Require(!recorder.PendingReadOverlaps(element, 16), "the build's read refuses after its batch ran"); recorder.Sync(); }