Skip to content

feat(agc): select occlusion counter blocks with PIXEL_PIPE_STAT_CONTROL - #22465

Merged
oneandonlydean merged 4 commits into
boykopovar:mainfrom
B-Howell:claude/agc-pixel-pipe-stat-control
Nov 19, 2026
Merged

oneandonlydean merged 4 commits into
boykopovar:mainfrom
B-Howell:claude/agc-pixel-pipe-stat-control

Conversation

@B-Howell

@B-Howell B-Howell commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What

EVENT_WRITE event type 56 (PIXEL_PIPE_STAT_CONTROL, event index 1) used to throw EVENT_WRITE event type 56 is not implemented. It now changes what later occlusion dumps do, which #1581 asked for before the event is accepted.

  • Packet layout. The second dword follows PAL's PM4_ME_EVENT_WRITE: counter_id in bits 3-8, stride in bits 9-10 and a 16-bit instance_enable in bits 11-26. Mesa writes the same fields at GFX11 init (ac_cmdbuf.c, sid.h).
  • What it changes. The queue keeps the instance_enable mask, starting at all 16 blocks. PIXEL_PIPE_STAT_DUMP then writes only the enabled blocks, on the CPU path, on the queued pipeline path and in the GPU shaders SampleCounter.comp and SampleDumps.comp. AnyPS5 counts samples for the whole target, so the lowest enabled block gets the count. Z-pass predication sums, and reads, only the enabled blocks.
  • What it changed for the title. The PS5 console's sceAgcDcbResetQueue writes 07fffc00, which enables all 16 blocks (sceAgcDcbResetQueue writes a different packet sequence on hardware than on main #1581), so behaviour is unchanged for it. CUSA00900 writes 0007fc00 before each dump, which enables 8 blocks, the PS4's render backends. Before this PR its dumps wrote 16 blocks, 128 bytes past its 8-pair result.
  • What still throws. Counters other than occlusion count 0 (counts 1-3 and the screen extents), strides other than 128 bits, reserved bits and a non-zero fourth dword. Z-pass predication after a mask of 0 also throws, because the console result is not known. These are in the debt fragment.
  • Other references. shadPS4 143b58aa48 handles only SoVgtStreamoutFlush and PixelPipeStatDump (8 or 16 pairs, from Neo mode) and ignores every other event. Mesa radeonsi and RADV do not emit event 56 for queries.

Tested

Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7, Release, RTX 4080 SUPER, driver 621.14.

  • New tests. tests/Pm4.cpp covers validation (each refused field), the per-queue mask and predication over 8 enabled blocks and over the gap mask 0x8001. PipelinedSampleDump.cpp submits masks 0xff, 0xf0 and 0 and checks that only the enabled blocks are written and that the count lands in the first enabled block. The new agc_driver_pipelined_sample_dump_cpu entry runs that file on the CPU dump path.
  • On main (1adc0e2f4b9, with these tests): tests/Pm4.cpp does not compile, and agc_driver_pipelined_sample_dump and _drained fail with EVENT_WRITE at DWORD 7: EVENT_WRITE event type 56 is not implemented.
  • Validation. Same machine, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, Khronos layer 1.4.363.1, ctest --test-dir build-win -R "^(agc_driver_pm4|agc_driver_pipelined_sample_dump|agc_driver_pipelined_sample_dump_drained|agc_driver_pipelined_sample_dump_cpu|agc_sample_dumps|agc_uncounted_passes)$" -V:
    • this PR: 6/6 passed, 8 Insert instance layer "VK_LAYER_KHRONOS_validation", 0 VUID-, no "was not found";
    • main: 5/5 passed (no _cpu entry), 6 inserts, 0 VUID-, no "was not found".
  • AMD and software GPUs (tablefrogpillow, report, Linux, head 97826291658, Khronos validation 1.4.363, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1): agc_driver_pipelined_sample_dump, _drained and _cpu pass 3/3 on a Ryzen 7000 iGPU (RADV gfx1036, RDNA2), RX 7900 GRE (RADV gfx1100, RDNA3) and lavapipe, with no VUID- on the 7900 GRE.
  • NVIDIA on Linux (domx4q, report, Arch Linux, GCC 16.2.1 Release, head 97826291658 merged onto main 1adc0e2f4b, Khronos validation 1.4.363.1, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1): the six-test pattern passes 6/6 on an RTX 4090 (620.70.06) against 5/5 on main, with no VUID- on either and no missing-layer line.
  • Mask 0 review fix (4a2591d5840, MarcZX10's review): same machine and validation settings, six-test pattern --repeat until-fail:3. Fix 6/6, 96 layer inserts, 0 VUID-, no missing-layer line. PR head 97826291658 with the new check: agc_driver_pm4 fails (expected PM4 rejection), the other 5 pass, 0 VUID-. Main 89b0eef7ab4: 5/5 (no _cpu entry), 0 VUID-.
  • Queue reset review fix (dbdd911e25e, MarcZX10's second review): tests/Pm4.cpp now checks that CLEAR_STATE and a CONTEXT_STATE clear keep the block mask and the dispatch reset restores all 16 blocks; test only, no driver change. Same machine and validation settings, six-test pattern --repeat until-fail:3: fix 6/6, 24 layer inserts, 0 VUID-, no missing-layer line. Main 2e22ad2062c: 5/5 (no _cpu entry), 18 inserts, 0 VUID-.
  • Predication read review fix (7679aea782f, MarcZX10's third review): Z-pass predication now reads each enabled counter pair on its own instead of every pair up to the highest enabled block, and tests/Pm4.cpp checks the gap mask 0x8001 (gap blocks unwritten, samples in a disabled block ignored, samples and an unwritten pair in block 15). Same machine and validation settings, six-test pattern --repeat until-fail:3: fix 6/6, 24 layer inserts, 0 VUID-, no missing-layer line. Main bef2f1f77d4: 5/5 (no _cpu entry), 18 inserts, 0 VUID-.
  • AMD on Linux, read-range guard (JJenkx, report, RX 6650 XT, RADV 26.2.7, Khronos validation 1.4.363, 7679aea782f inside the fix(agc): restore versioned draw queue defaults on reset #22535 stack on current main): a test-only guard that allows reads of enabled counter pairs only fails the old bulk reader at the disabled prefix (16 pass, 1 expected failure) and passes this reader (17 pass), with no skips and no VUID-. The guard test lives in fix(agc): restore versioned draw queue defaults on reset #22535.
  • Title. CUSA00900 (Bloodborne 1.09), on a local tree with the open PS4 PRs it needs (fix(relinker): import undefined global symbols with non-default visibility #17105, feat(shader): lower PS4 on-chip tessellation LDS through the off-chip ring #22328, feat(agc): draw PS4 ES-GS-VS geometry shaders through a Vulkan geometry stage #22439 and others), windowed, two runs.
    • Without this PR, Continue stopped at about 69 s on the item-tip loading screen with EVENT_WRITE event type 56 is not implemented.
    • With it, both runs got through the whole loading screen. They then crashed in the title's own heap code at the hand-over to gameplay (about 143 s and 115 s). The crash is the same guest read in both runs: a heap block header overwritten with non-pointer data. That is a separate stop, unrelated to occlusion dumps (the value has no bit 63).
  • check_conventions passes. pr_overlap reports same-line overlaps with fix(agc): leave GPU-stored words out of frame capture deltas #12568 (dumpSampleCounters), perf(agc): record Vulkan draw commands on an encoder thread #17943 and perf(agc): record transfers in the encoder stream without waiting #18029 (foldSamples signature); none of them implements this.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: CUSA00900 Bloodborne PS4 executables on AnyPS5: first results (a PS4 homebrew runs) and what retail PS4 games would need #3094
  • GPUs tested: RTX 4080 SUPER / 621.14 / Windows 11 Pro 10.0.26300; RX 7900 GRE, Ryzen 7000 iGPU and lavapipe / RADV, Linux (tablefrogpillow); RTX 4090 / 620.70.06 / Arch Linux (domx4q)
  • AI-assisted: yes

EVENT_WRITE event 56 (PIXEL_PIPE_STAT_CONTROL, index 1) now sets the
per-queue mask of render-backend counter blocks that later
PIXEL_PIPE_STAT_DUMP packets write and that Z-pass predication sums.
The mask starts with all 16 blocks, as before. Counter IDs other than
occlusion count 0, strides other than 128 bits and reserved bits throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@B-Howell

Copy link
Copy Markdown
Contributor Author

@PrivacyOnion @MarcZX10 when you have time, could one of you review this? It makes EVENT_WRITE type 56 (PIXEL_PIPE_STAT_CONTROL) choose which occlusion counter blocks the sample dumps write, so a PS4 title's 8-block dump no longer runs 128 bytes past its result. Bloodborne stopped on this event before. Other counter IDs, strides and reserved bits still throw.

@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Nov 17, 2026
@tablefrogpillow

Copy link
Copy Markdown
Contributor

Real-AMD coverage — the occlusion-counter-block selection path works across lavapipe, RDNA2 and RDNA3. agc_driver_pipelined_sample_dump (+ _drained, _cpu), head 97826291, Khronos validation 1.4.363, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1:

GPU arch result
Ryzen 7000 iGPU (RADV RAPHAEL, gfx1036) RDNA2 3/3 Pass
RX 7900 GRE (RADV NAVI31, gfx1100) RDNA3 3/3 Pass, 0 VUID
lavapipe SW 3/3 Pass

0 VUID on NAVI31. This is a driver-side counter-block/pipeline-journal path rather than an arch-divergence surface, so I didn't add GCN5 here — the RDNA pair + lavapipe cover it alongside your NVIDIA run.

AI-assisted: yes

@B-Howell

Copy link
Copy Markdown
Contributor Author

@tablefrogpillow thank you, RADV on RDNA2 and RDNA3 plus lavapipe is good cover for the mask path next to the NVIDIA run. I added it to Tested.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head reviewed: 97826291658959a1dcac3c01dc414f468d60ac31, base main. No merged-preview check.
  • Read the review folder (description, commits, manifest, diff) and the head through the repository reader (repo_read.py, search and line-range reads).
  • No build and no tests were run in this review; the review is by reading only.
  • Author-reported runs (Windows, RADV, lavapipe, CUSA00900) are not counted as checks I ran.

Results

Check Result Note
Build and unit tests not run No build in this review
Changed hunks read passed 16 of 16 listed files, by diff hunk
Targeted context read passed Pm4.cpp 700-735 and 1170-1200, VulkanDevice.cpp 3208-3228, Pm4.hpp 1-20
Shader compile not run SampleCounter.comp, SampleDumps.comp read from the diff only
Author-reported GPU runs not run Author report, not re-run

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp:715: when a queue's mask is 0, PredicationPasses reads no counter pair and skips every block, so the Z-pass predicate sums to zero and evaluates as "no samples" without the "never written" check. The debt note does not say what the console does here, and no test covers mask 0. Either state the intended result in the debt note, or add a test that pins it.

Sources

Commit-pinned lines at the head:

  • Validation of PIXEL_PIPE_STAT_CONTROL:
    case 0x38:
    graphics();
    size(4);
    require(eventIndex == 1, "invalid pixel pipe statistics control event index");
    require((packet[2] & ~0x07fffff8u) == 0 && packet[3] == 0, "unsupported PIXEL_PIPE_STAT_CONTROL reserved bits");
    require(((packet[2] >> 3u) & 0x3fu) == 0, "PIXEL_PIPE_STAT_CONTROL counters other than occlusion count 0 are not implemented");
    require(((packet[2] >> 9u) & 3u) == 2, "PIXEL_PIPE_STAT_CONTROL dump strides other than 128 bits are not implemented");
    break;
  • Mask set on the control packet:
    case 0x46:
    if (!SampleControl(packet)) throw std::runtime_error("packet requires driver execution");
    queue.sampleDumpBlocks = SampleControlBlocks(packet);
    return;
  • Queue reset makes a new QueueState, so the mask returns to 16 blocks:
    case 0x09: queue = std::move(*std::make_unique<QueueState>()); return;
  • Z-pass predication over enabled blocks:
    bool PredicationPasses(const QueueState& queue) {
    const auto& predication = queue.predication;
    if (predication.operation == 0) return true;
    const GuestMemory::ReadSiteScope site(GuestMemory::ReadSite::Wait);
    if (predication.operation == 1) {
    constexpr std::uint64_t ready = 1ull << 63u;
    std::array<std::uint64_t, SampleDumpBlocks * SampleDumpStride / sizeof(std::uint64_t)> words{};
    const auto pairs = static_cast<std::size_t>(std::bit_width(queue.sampleDumpBlocks));
    if (pairs != 0) GuestMemory::Read(predication.address, std::as_writable_bytes(std::span(words)).first(pairs * SampleDumpStride), 8);
    std::uint64_t samples = 0;
    for (std::uint64_t db = 0; db < SampleDumpBlocks; ++db) {
    if (((queue.sampleDumpBlocks >> db) & 1u) == 0) continue;
    const auto begin = words[db * SampleDumpStride / sizeof(std::uint64_t)];
    const auto end = words[db * SampleDumpStride / sizeof(std::uint64_t) + 1];
    if ((begin & ready) == 0 || (end & ready) == 0) {
    require(predication.runWhenUnwritten, "Z-pass predication waits for a counter pair that was never written");
    return true;
    }
    samples += (end & ~ready) - (begin & ~ready);
    }
    return (samples != 0) == predication.executeWhenSet;
    }
    const std::size_t bytes = PredicationBytes(predication);
    std::uint64_t value = 0;
    GuestMemory::Read(predication.address, std::as_writable_bytes(std::span(&value, 1)).first(bytes), bytes);
    return (value != 0) == predication.executeWhenSet;
    }

Not verified

  • PAL packet layout and the stride encoding (2 = 128 bits): the linked PAL header was not fetched.
  • Console behaviour: whether predication reads disabled blocks, what sceAgcDcbResetQueue writes, and the CUSA00900 title run. These are the author's reports and are not confirmed here.
  • Test results: the GPU, CPU and validation-layer runs are author-reported and were not re-run.
  • Shaders: SampleCounter.comp and SampleDumps.comp were read from the diff; they were not compiled.
  • core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp is too large for the review folder. Only the changed lines at 3210 and 3225 were read, through the reader. The full file was not read.
  • Other changed files were read by hunk. Code outside the hunks and their direct callers was not read.

To get this to a good state

Nothing is required.

The optional point is listed under Non-blocking above.

@domx4q

domx4q commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Ran the Tested section's pattern with the Khronos validation layer on Linux and an NVIDIA GPU; the Tested section's run is on Windows.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684, Ada, subgroup 32), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head 9782629165 merged onto main 1adc0e2f4b with --no-ff, clean merge. Main baseline is a Release build of 1adc0e2f4b on the same machine.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer \
ctest --test-dir build -R '^(agc_driver_pm4|agc_driver_pipelined_sample_dump|agc_driver_pipelined_sample_dump_drained|agc_driver_pipelined_sample_dump_cpu|agc_sample_dumps|agc_uncounted_passes)$' -V
main 1adc0e2f4b this PR
Result 5 of 5 passed 6 of 6 passed
Insert instance layer "VK_LAYER_KHRONOS_validation" 6 8
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

agc_driver_pipelined_sample_dump_cpu is new and does not exist on main; main runs its own versions of agc_driver_pm4 and agc_driver_pipelined_sample_dump. Every device selection picked the RTX 4090.

No new VUID- errors; all focused tests pass on Ada.

AI-assisted: yes (Claude Code)

@B-Howell

Copy link
Copy Markdown
Contributor Author

@domx4q thanks for the RTX 4090 Linux run on 97826291658. I added it to Tested and GPUs tested.

The console result of Z-pass predication after PIXEL_PIPE_STAT_CONTROL
enables no block is unknown, so throw instead of reporting no samples.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@B-Howell

Copy link
Copy Markdown
Contributor Author

Thanks, @MarcZX10. Took the mask 0 point in 4a2591d5840.

We don't know what the console returns for Z-pass predication when PIXEL_PIPE_STAT_CONTROL enables no block, so it now throws instead of reporting "no samples". A dump with mask 0 still writes nothing, as before. tests/Pm4.cpp pins it: mask 0 followed by PredicationPasses must throw. The debt fragment says the same.

Validation on the same machine (6 focused tests, 3 repeats, Khronos layer 1.4.363.1): the fix passes 6/6 with no VUID-; the PR head fails only the new check; main passes its 5 with no VUID-. check_conventions and debt_fold --check pass.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head 4a2591d5840b0d908713304a3aef0580a24b4f83, base main. No merged-preview check.
  • No build and no test run. Builds are not part of this review.
  • Reader searches and reads at head:
python3 repo_read.py search sampleDumpBlocks core/libs/prx/libSceAgcDriver
python3 repo_read.py search ResetQueue core/libs/prx/libSceAgcDriver
python3 repo_read.py search ClearContext core/libs/prx/libSceAgcDriver
python3 repo_read.py search DumpSamples core/libs/prx
python3 repo_read.py search foldSamples core/libs/prx
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp 3207 3228

Results

Check Result Note
Build and unit tests not run out of scope for this review
Author-reported GPU and console runs not applicable taken from the description, not reproduced
Changed lines in the 16 reviewed files passed read in the diff
Head context for changed functions passed limits under Not verified

Findings

Blocking

None.

Non-blocking

  1. docs/dev/debt/changes/claude-agc-pixel-pipe-stat-control.md:5 says the block mask "returns to that on a queue reset". The mask is set only by the QueueState default (core/libs/prx/libSceAgcDriver/Execution/include/QueueState.hpp:306). ClearContext, which CLEAR_STATE and the context-state packet call (core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp:1180 and :1200), does not touch the mask. A search for a queue-reset path at head found none. Either the reset lives outside this diff or the sentence is wrong. Reword it, or point to the code that resets the mask.
  2. core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp:376 gives DumpSamples a default of 0xffffu, and :907 does the same for foldSamples. Every current caller passes the queue's mask, or passes target 0 where the mask is unused (Recorder.cpp:4704). A future caller that leaves the argument out would dump all 16 blocks and ignore PIXEL_PIPE_STAT_CONTROL. Consider removing the default so a missing argument fails to compile. The calls in tests/Recorder.cpp would then need the mask passed.

Not verified

  • No build and no test run. The GPU and console results in the description are the author's; I did not reproduce them.
  • The console values (07fffc00, 0007fc00), the Bloodborne CUSA00900 run and the heap crash are not checked here.
  • The PAL, Mesa and shadPS4 links were not opened. No point in this review depends on them.
  • Read: the diff for all 16 reviewed files. Head context: VulkanDevice.cpp lines 3207–3228 (the full file is too large for the review folder, so only the changed function was read), and Pm4.cpp lines 700–733 and 1172–1203 from the review folder, plus the includes of Pm4.hpp. The other changed functions (PacketExecution.cpp, PacketMemory.cpp, Recorder.cpp, both shaders, PipelinedSampleDump.cpp, tests/Pm4.cpp) were judged from their hunks, not their full surrounding text.
  • Excluded by rule: none. files.json lists no excluded files.

To get this to a good state

Nothing is required.

Optional: the two points above.

Only the dispatch reset packet makes a new queue state, so it is the
only packet that restores all 16 counter blocks. CLEAR_STATE and
CONTEXT_STATE keep the PIXEL_PIPE_STAT_CONTROL selection. The debt
fragment now says this instead of "returns to that on a queue reset".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@B-Howell

Copy link
Copy Markdown
Contributor Author

Thanks, @MarcZX10.

  1. Taken in dbdd911e25e. The reset exists, but only for compute queues: sceAgcAcbResetQueue writes the custom NOP DISPATCH_RESET (subop 0x09), and Pm4.cpp:1171 replaces the whole QueueState, so the mask goes back to 16 blocks. sceAgcDcbResetQueue writes CLEAR_STATE (0x12), which only calls ClearContext and keeps the mask. The fragment now says exactly that, and that the console may differ. tests/Pm4.cpp pins all three: CLEAR_STATE and a CONTEXT_STATE clear keep 0x8001, and the dispatch reset restores 0xffff.
  2. Not taking this one in this PR. The only production caller (VulkanDevice.cpp:3225) passes the queue's mask, and 0xffff is the same value a new queue starts with. Removing the default would mean changing a dozen unrelated tests/Recorder.cpp calls and picking a mask for the target-0 fold at Recorder.cpp:4704, which doesn't use one. I'd rather keep this PR focused.

Validation on the same machine (six focused tests, 3 repeats, Khronos layer 1.4.363.1): the fix passes 6/6 and main 2e22ad2062c passes 5/5. Neither has a VUID- or a missing-layer line. check_conventions and debt_fold --check pass.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 12568 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp L338-339

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.

Pull request Shared files not compared
PR 1395 core/libs/prx/libSceAgcDriver/Execution/include/QueueState.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4847 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/Pm4.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/Pm4.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7275 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 7643 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9356 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 10249 core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 10359 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 10442 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 10652 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11435 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11436 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 11483 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12828 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12840 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 12944 core/libs/prx/libSceAgcDriver/Execution/include/Pm4.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Pm4.cpp
PR 13148 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13809 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 15136 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 15548 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 15845 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 16571 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 16753 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 16831 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 17611 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 17943 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 18029 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 18173 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 18185 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 19054 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 19697 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 20030 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20041 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 20111 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20172 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 20186 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 20187 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20315 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 20519 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 20845 core/libs/prx/libSceAgcDriver/Execution/include/QueueState.hpp
PR 21059 core/libs/prx/libSceAgcDriver/Execution/include/Pm4.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 21238 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 21669 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 21708 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22025 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22190 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 22434 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/QueueState.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/tests/Pm4.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/QueueState.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/Pm4.cpp
PR 22687 core/libs/prx/libSceAgcDriver/Execution/include/QueueState.hpp
PR 22697 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 22787 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 23058 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 23229 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 23243 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 23244 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head dbdd911e25e8edecfbb4e9a7b65cab3534ac933c, base main. No merged-preview check.
  • Read all 17 changed files through diff.patch. No changed file was read in full: VulkanDevice.cpp is too large for files/, and only its two changed hunks were read. Excluded by rule: none.
  • Read the description and commits, and the review sections of the house rules.
  • Checked surrounding code with repo_read.py (7 calls, listed below).
  • Nothing was built or tested in this run.

Results

Check Result Note
Diff read, 17 files passed Changed lines only
Full files read not run No file read in full
Build and ctest not run Not built here
Surrounding code passed Reader searches and one range read
Commands
repo_read.py search sampleDumpBlocks
repo_read.py search SampleCounterPushBytes
repo_read.py search ClearContext core/libs/prx/libSceAgcDriver/Execution
repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp 1174 1202

Findings

Blocking

None.

Non-blocking

  1. core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp:716: the Z-pass predication read covers every counter pair from block 0 up to the highest enabled block, not only the enabled blocks. The sum skips the disabled ones (Pm4.cpp:720), so the result holds. The PR text and the debt note say the read touches only enabled blocks, which is not what the code does. Either correct the wording or read each enabled block on its own. The wider read can also reach past an 8-pair result when a high block is enabled. I did not check the buffer size a game allocates.
  2. core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:1206: the predication tests use only the 8-block mask and mask 0. No predication test uses a gap mask such as 0x8001, so a regression in the point above would pass the suite.

Not verified

  • Build, ctest, and the GPU, driver and console runs in the PR body: not run here. They are author-reported only.
  • core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp: only the two changed hunks were read, not the whole file.
  • The dispatch reset that restores all 16 blocks (core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:1082): the reader did not find the production path. The test asserts it, but I did not run the test.
  • The read size of the predication: PredicationBytes was replaced by a pair count. I did not read PredicationBytes, so I cannot compare the old and new read sizes.
  • The GLSL changes in SampleCounter.comp and SampleDumps.comp: not compiled. The push-constant size is checked only by the C++ static_assert.
  • Stride value 2 (128 bits), the PAL and Mesa layouts, and the shadPS4 links: not checked against their sources.
  • The CUSA00900 run, the title crash analysis, check_conventions and pr_overlap: not checked.

To get this to a good state

Nothing is required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@B-Howell

Copy link
Copy Markdown
Contributor Author

Thanks, @MarcZX10. Both taken in 7679aea782f.

  1. You were right that the read did not match the text. PredicationPasses now reads each enabled pair on its own (16 bytes at db * 16), so it never touches a disabled block. The PR text and the debt fragment now say what the code does. The sum is unchanged.
  2. tests/Pm4.cpp now runs predication with mask 0x8001. Blocks 1-14 are left unwritten and must be skipped. Samples in disabled block 1 must not count. Samples in block 15 must count, and an unwritten pair in block 15 must throw.

Validation on the same machine (six focused tests, 3 repeats, Khronos layer 1.4.363.1): the fix passes 6/6 and main bef2f1f77d4 passes 5/5. Neither has a VUID- or a missing-layer line. check_conventions and debt_fold --check pass.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head reviewed: 7679aea782f801b37350caac9d90957b6e4f2d30, base main.
  • Read description.md, commits.md, manifest.json, files.json and diff.patch from the review folder.
  • Read repository text at the head with repo_read.py:
python3 repo_read.py search "case 0x46" core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
python3 repo_read.py search "PredicationBytes" core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
python3 repo_read.py search "include" core/libs/prx/libSceAgcDriver/Execution/include/Pm4.hpp
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp 280 292
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp 1196 1216
  • I ran no build and no test. The test results in the description are the author's reports, not mine.

Results

Check Result Note
Changed hunks read passed 16 of 16 reviewed files, from diff.patch
Full file text read not run only the Pm4.cpp ranges above
Build and ctest not run author-reported only
Vulkan validation not run author-reported only

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp:718: Z-pass predication now makes one GuestMemory::Read per enabled block, up to 16 small reads per predicated packet, where the old code made one bulk read. The logic reads correctly. The cost is not measured. One read of the enabled pairs would keep the old call count.
  • core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp:376: the default 0xffffu repeats AllSampleDumpBlocks from QueueState.hpp as a literal. The same literal is the default at line 907 for foldSamples. Using the constant would keep the value in one place, if this header can reach it.

Not verified

  • Build, the six-test ctest pattern and the Khronos validation run were not run by me. The GPU results (RTX 4080 SUPER, RTX 4090, RX 7900 GRE, Ryzen 7000 iGPU, lavapipe) are the author's and the reviewers' reports.
  • The claim that tests/Pm4.cpp does not compile on main was not checked.
  • The CUSA00900 title result, and the heap crash after the loading screen, were not checked.
  • Console behaviour of PIXEL_PIPE_STAT_CONTROL (CLEAR_STATE keeping the mask, predication on disabled blocks) cannot be checked here. The debt file says it is not measured on a console.
  • Full text of the changed files beyond the hunks was not read, including VulkanDevice.cpp, which is too large for the review folder.
  • The event is COMMENT, not APPROVE, because no check was run and the full files were not read.

To get this to a good state

Nothing is required. The non-blocking points above are optional.

@B-Howell

Copy link
Copy Markdown
Contributor Author

Thanks, @MarcZX10. I'm keeping the PR as it is for both points.

  1. The per-block reads are on purpose. Your previous review pointed out that the single bulk read covered disabled blocks and could run past an 8-pair result; reading each enabled pair alone is the fix for that (earlier reply). With a gap mask the enabled pairs are not contiguous, so one read of only those pairs isn't possible without going back to the wide read. It is at most 16 reads of 16 bytes per predicated packet.
  2. Same reasoning as for removing the default (earlier reply): the value matches AllSampleDumpBlocks and the only production caller passes the queue's mask, so this is tidy-up rather than a behaviour change. I'd rather leave it for a follow-up.

@JJenkx

JJenkx commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Included your original 7679aea782f8 follow-up in the self-contained #22535 stack with its author/date/message/coauthor preserved. I added a complementary test-only commit: guard inactive predication reads.

A range guard allows only the highest enabled counter pair. The same fixture fails the old bulk reader specifically at the disabled prefix and passes your enabled-pair reader; the existing result-value cases are retained. This covers the access boundary even when the backing host array is fully mapped.

On Linux/RX 6650 XT/RADV 26.2.7, validation 1.4.363, current-main integration: old reader 16 pass/1 expected guard failure, updated reader 17 pass, zero skips/VUIDs. Matched builds, verbose CTest/JUnit, exact source/fixture and binary manifests, SHA-256 c5674bb1a8d68ae4a7241e0160e5d2ef2a45474c72f494c7eb0cc1c98e32af24. Downloaded again; all 57 payload hashes verified.

AI-assisted: yes.

@B-Howell

Copy link
Copy Markdown
Contributor Author

@JJenkx thanks. The guard that fails the old bulk reader at the disabled prefix and passes the per-pair reader is a good check of the access boundary, on RADV with no VUID-. I added your run to Tested and linked the guard test in #22535.

@github-actions github-actions Bot added review queue Next in the maintainer review queue: checks pass, no open change request, no conflict and removed review queue Next in the maintainer review queue: checks pass, no open change request, no conflict labels Nov 19, 2026
@oneandonlydean
oneandonlydean merged commit c1d295c into boykopovar:main Nov 19, 2026
16 of 18 checks passed
chitters2004 added a commit to chitters2004/AnyPS5 that referenced this pull request Nov 19, 2026
PacketMemory dumpSampleCounters: main's per-block mask (boykopovar#22465) skips unselected dump blocks; this branch still notes each written block as a GPU store.
chitters2004 added a commit to chitters2004/AnyPS5 that referenced this pull request Nov 19, 2026
Merges boykopovar#17943's head 19728b1, which merges main 711ab41 (the foldSamples resolution of boykopovar#22465); no further conflicts.
chitters2004 added a commit to chitters2004/AnyPS5 that referenced this pull request Nov 19, 2026
Merges boykopovar#18029's head d161c08, which carries main 711ab41 through boykopovar#17943 (19728b1). Recorder ensureOpen: keep this branch's stream/direct split. Recorder foldSamples: main's blocks parameter (boykopovar#22465) with this branch's body (batch.commands, no quiesce). RuntimeSwitches: the lower branches' entries, then this branch's two.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build docs unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants