test(agc): keep the saved-baseline fixtures outside the write watch on Windows #22166
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22166"
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 oneandonlydean on 2026-11-17T07:28:41Z.
What
agc_driver_color_memo_baseline_enabled/_disabled(added by #17738) fail on Windows in about half the runs with "the baseline fixture has no saved bytes". This is a race in the fixture, not in the driver.The
baselineandheld-baselinefixtures unwatch their target, draw, flush, and then require that the store saved the stored bytes. The store saves them only while the range is outside the write watch (Texture.cpp: the save units are empty whenGuestMemory::Watchedholds). On Windows a host import of unwatched memory is settled on the settle queue and then returned to the write watch (rewatchSettledImportsinGuestBufferMemory.cpp, polled every 100 us). When that settle completes before the fixture's flush, the range is watched again, the store saves nothing, and the precondition fails. Both states are valid for the driver; the fixture just needs the unwatched one.Both fixtures now turn deferred settles off for their duration with
SetHostImportDeferredSettles(false), the hook the deferred settle tests intests/Recorder.cppalready use, so the range stays outside the watch until the fixture's ownRewatch. Test file only, no driver change. The call does nothing on Linux.Tested
Linux, built on
c8c044b0d8: the test target builds. Linux cannot show the race (deferred settles exist only on Windows).Windows: on main the test failed in 7 of 13 CI runs today across two machines (one of the two variants each time). A repeat run of both fixtures on this head on Windows is the proof; I will add its result here.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T07:53:47Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional. The Windows proof the description promises is not in yet, so I am not approving.
What I ran
62aaa6fb8aef427b9ff0acbdc5f5d856d1c79329, basemain.core/libs/prx/libSceAgcDriver/tests/TargetStateMemo.cppand the hook they call,SetHostImportDeferredSettles.c8c044b0d8.Results
GuestBufferMemory.cppFindings
Blocking
None.
Non-blocking
None verified.
Not verified
heldBaselineUnitsafter its ownRewatch. I read only the start of that fixture, so I did not confirm that its rewatch happens while the guard still holds.fix(agc): rename the settle guard that shadowed the held byte. The diff does not show a rename, so I could not match it to a change.To get this to a good state
validRefreshBaselinesandheldBaselineUnitson this head, with the output.Files read:
core/libs/prx/libSceAgcDriver/tests/TargetStateMemo.cpp(changed regions, lines 1225–1274 at head), plus the hook incore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp. Files reviewed: 1 of 1 listed infiles.json.