Repository navigation
feat(agc): poll and write registers in PM4 COND_WRITE - #16184
oneandonlydean merged 3 commits into
Conversation
Use the queue register banks for DWORD-addressed COND_WRITE polls and destinations. Preserve masked comparisons, ordered packet execution, register side effects and the existing memory store. Refuse unknown register values, unmodeled ranges and scratch destinations. Cover comparisons, bank selection, isolation, ordering and rejected forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ NVIDIA GPU test: passedPR head
Failing on main too (3, not counted against this PR)Validation IDs already present on main (9 IDs in 585 tests)Skipped (51)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Reviewed PM4 COND_WRITE register poll and write — no blocking findingsThe field decoding matches the GFX10 packet definition and the repo's own register helpers; I found three non-blocking questions, none showing a wrong result on the tested path. What I ranHead reviewed: No build or test was run here; this review is from reading the code only. The test results in the description are the author's. Results
FindingsBlockingNone. Non-blocking
Not verified
To get this to a good stateNothing is required. Please answer or fix item 1 (and 2 if it matters), and update the analysis tool line (3). AI-assisted: yes (code read with Claude Code; no build or test run). |
A register-destination COND_WRITE into the context or user-config bank now fails validation on a compute queue, as SET_CONTEXT_REG and SET_UCONFIG_REG do. The dispatch-ahead scan stops at a register-destination COND_WRITE instead of skipping it, and Pm4Analysis prints register operands as registers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review. All three are addressed in bbbaa58:
Linux (lavapipe): 34/34 of the PM4, frame replay, dispatch-ahead, recorder and register-key tests pass, and |
…ITE register write Move the register-destination COND_WRITE check to the top of the scan loop, away from the indirect-register branch that boykopovar#18914 rewrites, so the two changes merge without a conflict. Behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
pr-overlap flagged #18914 on DispatchAhead.cpp lines 233-235. In d723030 the register-destination COND_WRITE check moved to the top of the scan loop, away from the indirect-register branch #18914 rewrites; a test merge with #18914's head is now clean, behaviour is unchanged, and the 34 related tests still pass. |
What
PM4
COND_WRITE(opcode 0x45) worked only with a memory poll and a memory destination. A register poll threwregister-space COND_WRITE poll is not implemented, and a register destination threwregister or scratch COND_WRITE destination is not implemented. This PR runs both for the registers the queue already models.Packet, from AMD's Southern Islands programming guide §2.7.2 (pp. 33–34) and PAL's GFX10 packet definition (lines 521–630, nine dwords):
POLL_SPACE(bit 4) selects register or memory, andWRITE_SPACE(bits 8–9) selects register, memory or scratch.SET_*_REGbuilders subtract (gfx9CmdUtil.cpplines 3650, 4025 and 4084) and Mesa'ssid.hdefines. Mesa'sac_cmdbuf.hconverts byte offsets to the same dword numbers.Change (
core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp):0x2c00–0x2fff), context (0xa000–0xa3ff) or user-config (0xc000–0xffff) register value, using the comparison code memory polls already use.SET_SH_REG,SET_CONTEXT_REGorSET_UCONFIG_REG, so a register's side effects apply. The test checks this withVGT_INDEX_TYPE(0xc243). It reports no guest memory store to capture or replay.docs/dev/debt/libSceAgcDriver.mdentry records what still throws and that PS5 behaviour, GFX10 high-dword handling and write confirmation are not measured.Tested
agc_driver_pm4(core/libs/prx/libSceAgcDriver/tests/Pm4.cpp) gainstestConditionalWriteRegisters. Every existing assertion is kept, including the existing rejections, whose register addresses are host pointers outside the modeled banks.SET_*_REGpackets followed by three register-pollCOND_WRITEs in one submission see the newly set values.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. The run covered the 18 PM4, replay, recorder and register-key tests (agc_driver_pm4*,agc_driver_pm4_replay*,agc_driver_recorder,agc_driver_register_key):mainpasses 18/18. With only the new test added,agc_driver_pm4fails withregister-space COND_WRITE poll is not implemented;VUID-lines and no missing-layer messages.COND_WRITE did not read back its register destination.agc_driver_pm4_ring_report_heapwhere Linux registersagc_driver_pm4_priority_refused;main'sPm4.cpp,agc_driver_pm4fails with the same message;VUID-lines and no missing-layer messages. The PM4 test creates no Vulkan instance; aVK_LOADER_DEBUG=layerrerun ofagc_driver_recorderconfirmed that the validation layer was inserted at instance and device level.python3 tools/check_conventions.py --base origin/main: all conventions checks passed.python3 tools/pr_overlap.py --branch feat/agc-cond-write-registers: no confirmed overlap.main. Trial merges of all 48 add no conflicted file, and the conflict contents stay the same except for docs(debt): separate entries with blank lines and drop derived export totals #14212 (blank lines between debt entries), which also conflicts with the new entry.Pm4.cpp, fix(agc): leave GPU-stored words out of frame capture deltas #12568, feat(agc): read frame capture deltas with the title's work in flight #15136, fix(agc): a 0xffffffff register offset names no register #16054, fix(agc): leave the GDS unallocated until it is used when no importable GDS was requested #15610, test(agc): cover idle publication through dma-buf imports #14330, fix(libSceAgcDriver): validate PM4 write and copy data register destination bounds #14130, fix(libSceAgcDriver): validate PM4 index base and indirect draw count address bounds #14110, fix(shader): serve ds_ordered_count in wave launch order #12944, fix(agc): read capture deltas and replay them while queues wait on the title #12567, feat(agc): write RELEASE_MEM DATA_SEL 4 for PS4 guests as an 800 MHz count #9893 and fix(agc): COPY_DATA to and from GDS #6549 merge cleanly. feat(libSceLibreSsl3): implement numeric object identifier text parsing #12315, fix: define decoded AGC state and bound size arithmetic #10249 and perf(agc): compile uncached draws ahead of queue 0 #6188 keep only the conflicts they already have withmain.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