Repository navigation
fix(agc): check a rejected submission's packets on its own queue in the report - #20236
Conversation
…he report Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
|
|
Windows + NVIDIA (Blackwell) run of head Setup: Windows 11 Pro, NVIDIA GeForce RTX 5070 Ti, driver 621.01, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 UCRT, Release,
AI-assisted: yes |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The change reports packet validation results using the rejected submission’s queue, and the inspected diff and source support merging.
What I ran
Reviewed head 4ff4d22b1761c524d076d3aaa9a73706f6c318fb. Read the prepared description, commit summary, manifest, diff, and all three changed files at the pinned head. Searched for dumpPackets callers. No commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed code | passed | All three changed files read |
| Tests | not run | Author-reported results only |
| Caller search | passed | Both report call sites pass the submission queue |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Tests and runtime behavior were not independently verified. The description reports Windows 10 testing and notes Linux, AMD and Intel GPUs, and PS4/PS5 behavior were not covered. The listed changed files were all read; files.json was unavailable in the prepared review folder, so exclusions by rule were not independently inspected.
To get this to a good state
Nothing is required.
What
When AGC rejects a submission,
Driver::dumpPacketsprints a report that lists each packet type with the reason the packet check gives for its first packet of that type. It checked them as if they were on the graphics queue (Pm4::Validate(..., 0)), so the report for a compute queue's submission could give reasons that do not apply on that queue and leave out ones that do. For example, aCOND_EXECwhose control word sets its cache policy is valid on a compute queue, but the report listed it withCOND_EXEC reserved control fields are not implemented, and it listed a graphics-onlyCLEAR_STATEwith no reason.dumpPacketsnow takes the submission's queue fromDriver::validate, checks each packet on it, and names it in the report's first line:[gpu] rejected submission of <n> dwords on queue 0x<queue> at guest <address>:. Nothing else in the repository parses that line.testRejectionReportUsesTheSubmissionQueueintests/Pm4.cppsubmits to queue 0x20 aCOND_EXECwith cache-policy bits, aWRITE_DATA, a typed user-data NOP that the check refuses and aCLEAR_STATE. It captures stderr and checks that the report names the queue, lists theCOND_EXECwithout the graphics-queue reason, and givesgraphics packet in compute queue. The test file'sCapturedStderrredirected only the process's standard error handle on Windows, which the report'sfprintfdoes not write to: with that alone the test fails, as the report never reaches the capture. It now also points the C runtime's descriptor 2 at the capture file, as its Linux branch already does withdup2, and on its way out sets the standard error handle from the restored descriptor, as libc'sRestoreStandarddoes. On Windows, the test then checks that the two agree.Found while reading the rejection reports of a PS4 title's compute queue for #20127.
Overlap:
tools/pr_overlap.py --branch(in a full clone, this head merged ontomain6667ad1664): 39 of 1,510 open pull requests share a file with this branch, and none of the 15 it could compare shares lines. It could not compare 24 that conflict withmain(20 shareDriver.hpp, 4 sharetests/Pm4.cpp, one of them, #18914, alsoCommandValidation.cpp). In GitHub's patches of these, none edits thedumpPacketsorvalidatedeclarations,dumpPacketsitself, thedumpPacketscalls invalidate,CapturedStderr, or the test spot.Tested
Windows 10 Pro 22H2 (19045), i9-12900KF, NVIDIA GeForce RTX 5080 (
10de:2c02, driver 621.14), WinLibs GCC 15.2.0 r7, Release,BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=OFFunless stated. Head4ff4d22b17onmain27578d8a54, rebased from2797787010on0d2f004881with the same changed lines; on it,agc_driver_pm4passes 3 of 3 runs and all 29agc_driver_pm4*tests pass. The results below are from2797787010, except the selected tests, the validation runs and the layer check, which ran ona6c34de712(the same driver change and an earlier version of the test) merged ontomain6b7f28803e.agc_driver_pm4passes in 3 of 3 runs, and all 29agc_driver_pm4*tests pass. The 29 also pass in one run in a build withANYPS5_ENABLE_SPIRV_TOOLS=ON(as the Linux CI job builds).CommandValidation.cppandDriver.hppfrommain(the test kept),agc_driver_pm4fails withthe rejection report does not name the submission's queue. With each part of the change reverted on its own (restored afterwards):the rejection report checked a compute queue's COND_EXEC as a graphics-queue packetthe rejection report does not name the submission's queueCapturedStderr's C-runtime redirect on Windowsthe rejection report does not name the submission's queue(the report is not captured)Setting the standard error handle back to the one saved at the start, as before, still passes here: the test does not tell that restore from the new one.
tools/select_tests.pypicks 2,893 tests for the changed files. Witha6c34de712merged ontomain(select_tests.py ctest build --parallel 4 --timeout 120,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1), 2,873 run: 2,872 pass, andagc_driver_unregistered_label_on_gpufailed once (the label held 0x00000000 when a later label had landed), then passed 3 of 3 reruns. It fails now and then (AGC: agc_driver_unregistered_label_on_gpu fails now and then: two stores of one label run have no barrier between them #17937); its output has no rejection report, so this change's code did not run in it. The other 20 do not run, and all 20 also do not run inmain's full suite on this machine (5,593 tests). One of them,agc_driver_upload_cache_read_only_flush, has a test program that does not build on Windows (setenv, open fix(tests): set the upload cache test's environment with _putenv_s on Windows #19899); both sides were built with ninja's-k 0, and it was the only target that failed.^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu, 1,747 of the selection and 1,832 inmain's run, throughctest -V --parallel 4withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(1.4.367) andVK_LOADER_LAYERS_DISABLE=~implicit~: all pass, and both logs have the same 61 messages in the same 14 tests, with no newVUID-ID and no "was not found but was requested by env var VK_INSTANCE_LAYERS" line. WithVK_LOADER_DEBUG=layeradded, on thatmainand witha6c34de712merged:agc_driver_alpha_to_coverageshows the loader inserting the layer on both sides, and the 29agc_driver_pm4*tests pass on both sides with no loader line, since they do not open Vulkan.python tools/check_conventions.py --base origin/mainwith this title and description: "All conventions checks passed."Not covered: AMD and Intel GPUs, Linux, a PS5 or PS4.
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)10de:2c02), driver 621.14, Windows 10 Pro 22H2🤖 Generated with Claude Code