fix(agc): synchronize pending writes before command allocation #6747
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6747"
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 krishalivaibhav on 2026-10-16T09:22:53Z.
What
Before the native command allocator returns a range for CPU packet writes, synchronize tracked GPU writes already pending over that range. Disjoint ranges keep the existing asynchronous path. The check runs after
Reserve, so callback-selected storage is covered, and before cursor advancement or packet writes. Packet tests that compilePacket.cppdirectly now link its driver dependency.Balatro PPSA21402 exposed the problem in our combined macOS port: a deferred queue-0 GPU label requested a four-byte store of
1at0x2c4432738. The next copied submission used that exact address as the value word ofSET_UCONFIG_REG_INDEX:That selects four-byte indices for an address aligned only to two bytes. The native setter normally emits
0x400 | indexSize. Symbolication identifies the matching write request asDriver::recordDeferredLabels. This evidence identifies a concrete overlapping write request; the patch guarantees ordering for tracked writes already pending at allocation. It does not cover external packet patches that bypassAllocate, GPU readers, or newly racing unsynchronized writers.Tested
Agc::Command::Emit: queue a GPU store of1, emit an index-type packet reusing that word for0x400, finish GPU work, and check0x400survives. A disjoint packet allocation must leave the pending batch recording. The local integration fixture fails with synchronization disabled (a pending GPU label overwrote a reused command word) and passes with it enabled. The dedicated CTest entry returns 77 when host imports are unavailable.tools/check_conventions.py --base origin/mainandgit diff --checkpass on this clean branch based on5d9dcc42d.workflow_dispatchrequires collaborator write access. A maintainer can selectpr=6747,full=true,linux=trueto validate the clean main merge. The passing eligibility job does not mean the skipped platform builds ran.Checklist
main; no known open PR implements this allocator guardImported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-17T09:52:54Z.
Rebase handoff — rebased onto current
main(authorship unchanged). One conflict in the test registration: youragc_command_memory_reuseentry sits alongsidemain's neweragc_recorder_device_selectionentry, both with their Windows environment blocks.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727), not this PRTo pick it up:
Head is
2b5e10f8d.Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-21T20:30:33Z.
Thanks @blawesom for the rebase handoff. I picked it up and rebased again onto current
main(head0b5ba4470); the test registration resolution is unchanged from yours.Linux (Ubuntu 24.04 x86-64 under Rosetta, GCC 13.3, Ninja, Release,
BUILD_TESTING=ON):agc_command_memory_reuse,agc_recorder_device_selection,agc_recorder_read_list,agc_recorder_deferred_failure_reportandagc_recorder_kept_bytespass. Full suite not run locally.