feat(shader): add GDS ordered counts and ordered-append dispatches #5176

Merged
n-delic merged 2 commits from upstream-pr/5176 into main 2026-10-14 20:52:36 +00:00
n-delic commented 2026-10-13 13:56:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by n-delic on 2026-10-13T13:56:26Z.


What

ds_ordered_count (DS opcode 0x3f) now translates instead of throwing. Each wave adds its first active lane's value to a GDS counter with one device-scope atomic, and every active lane gets the counter's previous value, the same way ds_append hands out ranges. DISPATCH_DIRECT and DISPATCH_INDIRECT accept ORDERED_APPEND_ENBL (initiator bit 3), the modifier such dispatches set.

Compute shaders of MXGP 26 (PPSA30839, Unreal Engine 5) use both. On main that title stops at the first such shader with ds_ordered_count at pc ...: GDS counters updated in wave launch order are not modeled.

Source of the operand fields: LLVM's lowering of llvm.amdgcn.ds.ordered.add (SIISelLowering.cpp L8844-L8894, llvmorg-19.1.0):

  • offset0 is the counter index times 4, and the whole GDS address.
  • M0 holds the ordered wave ID, not a GDS address (radeonsi si_compute_prim_discard.c in Mesa 20.3 and gfx10_shader_ngg.c in Mesa 21.3, ACO ordered_xfb_counter_add_amd: "The GDS address is always 0 with ordered append"). It only orders the waves, which is not modeled, so it is ignored.
  • offset1 bit 0 releases the wave and bit 1 marks it done; bits 2-3 are the shader type.
  • offset1 bit 4 selects swap instead of add.
  • offset1 bits 6-7 are the dword count less one.

Not modeled, and recorded in docs/dev/debt/shader.md:

  • The hardware serializes the waves of a dispatch in launch order; here waves add in any order. Totals match, but the ranges may be handed out in a different order.
  • Which lane's value is added is not documented. The first active lane is assumed, not measured on hardware.

Swap, counts of more than one dword, and non-GDS forms still throw.

Tested

Linux (Pop!_OS, kernel 7.1.5), GCC, Release, RTX 3060 (NVIDIA 595.104.02).

  • agc_driver_gds_append_consume: a new pass runs ds_ordered_count (release and done set) for wave32 and wave64 workgroups of 32 and 64 threads, once with M0 = 0 and once with M0 = 7 (a wave ID). Each wave adds its first lane id + 3. The test checks that:

    • every lane of a wave returns the same previous value;
    • the waves' values chain without gaps;
    • the GDS counter ends at the sum.

    Changing the expected amount makes it fail (GDS counter 0 is 1003, expected 1004). With M0 read as a GDS address, as in the first head, the M0 = 0 pass fails (wave 0 returned 0, expected 1000).

  • agc_wave_control_decode, agc_driver_pm4: an add is translated, while swap and multi-dword counts are refused with their own messages. ORDERED_APPEND_ENBL is accepted, and other unknown modifiers are still refused.

  • ctest -R 'agc|shader': 484 of 484 pass (one Vulkan test skipped as on main).

  • MXGP 26: with this change (on a branch with other local fixes), the shaders that used it run and the title reaches its main menu.

  • tools/check_conventions.py --base upstream/main passes.

Windows (RTX 4080, UHD 770) and macOS (M2 Max, MoltenVK) runs by reviewers are in the comments, on the first head.

Not tested: AMD hardware, the hardware oracle.

Checklist

  • Based on current main; no other open PR implements the same functions (#980 decoded the opcode only and was closed)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • 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
  • Unblocks: PPSA30839 (MXGP 26), no bring-up discussion yet
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4844338876 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5176). Originally posted by [n-delic](https://github.com/n-delic) on 2026-10-13T13:56:26Z. --- ### What `ds_ordered_count` (DS opcode 0x3f) now translates instead of throwing. Each wave adds its first active lane's value to a GDS counter with one device-scope atomic, and every active lane gets the counter's previous value, the same way `ds_append` hands out ranges. `DISPATCH_DIRECT` and `DISPATCH_INDIRECT` accept `ORDERED_APPEND_ENBL` (initiator bit 3), the modifier such dispatches set. Compute shaders of MXGP 26 (PPSA30839, Unreal Engine 5) use both. On `main` that title stops at the first such shader with `ds_ordered_count at pc ...: GDS counters updated in wave launch order are not modeled`. Source of the operand fields: LLVM's lowering of `llvm.amdgcn.ds.ordered.add` ([SIISelLowering.cpp L8844-L8894, llvmorg-19.1.0](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/AMDGPU/SIISelLowering.cpp#L8844-L8894)): - `offset0` is the counter index times 4, and the whole GDS address. - `M0` holds the ordered wave ID, not a GDS address (radeonsi `si_compute_prim_discard.c` in Mesa 20.3 and `gfx10_shader_ngg.c` in Mesa 21.3, ACO `ordered_xfb_counter_add_amd`: "The GDS address is always 0 with ordered append"). It only orders the waves, which is not modeled, so it is ignored. - `offset1` bit 0 releases the wave and bit 1 marks it done; bits 2-3 are the shader type. - `offset1` bit 4 selects swap instead of add. - `offset1` bits 6-7 are the dword count less one. Not modeled, and recorded in `docs/dev/debt/shader.md`: - The hardware serializes the waves of a dispatch in launch order; here waves add in any order. Totals match, but the ranges may be handed out in a different order. - Which lane's value is added is not documented. The first active lane is assumed, not measured on hardware. Swap, counts of more than one dword, and non-GDS forms still throw. ### Tested Linux (Pop!_OS, kernel 7.1.5), GCC, Release, RTX 3060 (NVIDIA 595.104.02). - **`agc_driver_gds_append_consume`:** a new pass runs `ds_ordered_count` (release and done set) for wave32 and wave64 workgroups of 32 and 64 threads, once with M0 = 0 and once with M0 = 7 (a wave ID). Each wave adds its first lane id + 3. The test checks that: - every lane of a wave returns the same previous value; - the waves' values chain without gaps; - the GDS counter ends at the sum. Changing the expected amount makes it fail (`GDS counter 0 is 1003, expected 1004`). With M0 read as a GDS address, as in the first head, the M0 = 0 pass fails (`wave 0 returned 0, expected 1000`). - **`agc_wave_control_decode`, `agc_driver_pm4`:** an add is translated, while swap and multi-dword counts are refused with their own messages. `ORDERED_APPEND_ENBL` is accepted, and other unknown modifiers are still refused. - **`ctest -R 'agc|shader'`:** 484 of 484 pass (one Vulkan test skipped as on `main`). - **MXGP 26:** with this change (on a branch with other local fixes), the shaders that used it run and the title reaches its main menu. - `tools/check_conventions.py --base upstream/main` passes. Windows (RTX 4080, UHD 770) and macOS (M2 Max, MoltenVK) runs by reviewers are in the comments, on the first head. Not tested: AMD hardware, the hardware oracle. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions (#980 decoded the opcode only and was closed) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA30839 (MXGP 26), no bring-up discussion yet - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
johnmaia commented 2026-10-13 14:49:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-13T14:49:33Z.


Windows run, since the description says Windows is untested. Setup: Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, ctest -j4 --timeout 300. Head merged into main 69b4ca5d9. Two GPUs: RTX 4080 (NVIDIA 617.42) and Intel UHD 770 (101.6129).

  • agc_driver_gds_append_consume runs on both GPUs and prints gds append consume tests passed; it is not skipped. agc_driver_pm4 and agc_wave_control_decode also pass on both.
  • The full suite passes 1081 of 1081 on both GPUs.

Not tested: AMD hardware, the hardware oracle, a title.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6148289906 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5176#issuecomment-6148289906). Originally posted by [johnmaia](https://github.com/johnmaia) on 2026-10-13T14:49:33Z. --- Windows run, since the description says Windows is untested. Setup: Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`, `ctest -j4 --timeout 300`. Head merged into `main` 69b4ca5d9. Two GPUs: RTX 4080 (NVIDIA 617.42) and Intel UHD 770 (101.6129). - `agc_driver_gds_append_consume` runs on both GPUs and prints `gds append consume tests passed`; it is not skipped. `agc_driver_pm4` and `agc_wave_control_decode` also pass on both. - The full suite passes 1081 of 1081 on both GPUs. Not tested: AMD hardware, the hardware oracle, a title. AI-assisted: yes (Claude Code)
tv7 commented 2026-10-13 17:54:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-13T17:54:55Z.


A second title for this: Silent Hill: Townfall (PPSA33286, Unreal Engine). Windows 11, RTX 3070, GCC 15.2.0, Release.

  • On main 61b8742b6 the title presents frames at 3840x2160, then stops at AGC driver: DISPATCH_DIRECT at DWORD 2309: dispatch modifiers 0x49 are not implemented (ORDERED_APPEND_ENBL | ORDER_MODE).
  • On main 8cf6a0bc3 + this head (bb17e6110) that dispatch is accepted. The title then stops at the next compile, in the same compute shader, before its ds_ordered_count is reached, so I cannot confirm the ordered count itself in the title yet.

The shader (0x16402d6e00, wave64; 0x1640286900 and 0x16402b0500 have the same code) uses the form this PR covers: a DPP prefix sum over the wave, v_readlane_b32 of lanes 31 and 63 for the wave total, then

0x14c  ds_ordered_count v3, v4, GDS  offset0:0x00 offset1:0x03   ; add, release + done, M0 set just before

and appends to a buffer at the returned base, so only the order of the appended ranges differs from hardware, as the debt entry says.

What stops it now is the call just before that (computed/data-dependent s_swappc_b64 call target at program counter 0x00000134): the target pair is read through a descriptor loaded from the constant address 0xF_E0040000, not from user data. I left a note on #4706, which links table-loaded call targets from user-data descriptors.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6151785123 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5176#issuecomment-6151785123). Originally posted by [tv7](https://github.com/tv7) on 2026-10-13T17:54:55Z. --- A second title for this: Silent Hill: Townfall (PPSA33286, Unreal Engine). Windows 11, RTX 3070, GCC 15.2.0, Release. - On main `61b8742b6` the title presents frames at 3840x2160, then stops at `AGC driver: DISPATCH_DIRECT at DWORD 2309: dispatch modifiers 0x49 are not implemented` (`ORDERED_APPEND_ENBL | ORDER_MODE`). - On main `8cf6a0bc3` + this head (`bb17e6110`) that dispatch is accepted. The title then stops at the next compile, in the same compute shader, before its `ds_ordered_count` is reached, so I cannot confirm the ordered count itself in the title yet. The shader (`0x16402d6e00`, wave64; `0x1640286900` and `0x16402b0500` have the same code) uses the form this PR covers: a DPP prefix sum over the wave, `v_readlane_b32` of lanes 31 and 63 for the wave total, then ``` 0x14c ds_ordered_count v3, v4, GDS offset0:0x00 offset1:0x03 ; add, release + done, M0 set just before ``` and appends to a buffer at the returned base, so only the order of the appended ranges differs from hardware, as the debt entry says. What stops it now is the call just before that (`computed/data-dependent s_swappc_b64 call target at program counter 0x00000134`): the target pair is read through a descriptor loaded from the constant address `0xF_E0040000`, not from user data. I left a note on #4706, which links table-loaded call targets from user-data descriptors. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
adriadam10 commented 2026-10-14 11:31:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T11:31:35Z.

Review: CHANGES_REQUESTED


Thanks. Build, the touched agc tests and a negative check are fine here (agc_driver_gds_append_consume, agc_driver_pm4 and agc_wave_control_decode fail without the change). One problem blocks the merge:

  • M0 is read as a GDS address, but on ds_ordered_count it holds the ordered wave ID. SharedMemoryInstructions.cpp:304 passes M0 to the ds_append path, which takes the base from M0[31:16] and skips the add when M0[15:0] is 0 (SpirvMemoryInstructions.cpp:1187-1193). Every user of the instruction I could find puts the ordered wave ID in M0, and the counter address is only offset0:

    • radeonsi si_compute_prim_discard.c (Mesa 20.3): ordered_wave_id = (TG_SIZE >> 6) & 0xfff is passed as the llvm.amdgcn.ds.ordered.* pointer, with the comment "The GDS address is always 0 with ordered append";
    • radeonsi gfx10_shader_ngg.c (Mesa 21.3): ngg_get_ordered_id() (gs_tg_info[11:0]) is the pointer;
    • ACO nir_intrinsic_ordered_xfb_counter_add_amd: m0 = ordered_id, address VGPR 0.

    The LLVM lowering cited in the description only copies the pointer operand into M0, so it does not support "M0 is the GDS address". Our compute entry fills TG_SIZE's wave-ID bits with 0 (InstructionTranslator.cpp:229-236), so a shader that builds M0 the way these do gets M0 = 0: the counter is never updated and every wave receives 0, which means they all append at the same base. The test sets m0 = 0xffff (GdsAppendConsume.cpp:50), the ds_append form, so it can't see this.

    Suggested direction: address the counter by offset0 alone and leave M0 out of the address and the bounds check. Add a pass with M0 = 0 and one with a small wave ID in M0, and correct the M0 sentence in the description and in docs/dev/debt/shader.md.

The rest looks right to me: the offset1 decoding matches LLVM/ACO's ds_ordered_count_offsets, swap and multi-dword counts throw, the lane-varying result is in LaneSource, and the debt entry records the launch order that isn't modeled. We couldn't run this on the hardware oracle (no GDS ordered append through HSA).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5517201329 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5176#pullrequestreview-5517201329). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T11:31:35Z. **Review:** CHANGES_REQUESTED --- Thanks. Build, the touched agc tests and a negative check are fine here (`agc_driver_gds_append_consume`, `agc_driver_pm4` and `agc_wave_control_decode` fail without the change). One problem blocks the merge: - **M0 is read as a GDS address, but on `ds_ordered_count` it holds the ordered wave ID.** `SharedMemoryInstructions.cpp:304` passes M0 to the `ds_append` path, which takes the base from M0[31:16] and skips the add when M0[15:0] is 0 (`SpirvMemoryInstructions.cpp:1187-1193`). Every user of the instruction I could find puts the ordered wave ID in M0, and the counter address is only `offset0`: - radeonsi `si_compute_prim_discard.c` (Mesa 20.3): `ordered_wave_id = (TG_SIZE >> 6) & 0xfff` is passed as the `llvm.amdgcn.ds.ordered.*` pointer, with the comment "The GDS address is always 0 with ordered append"; - radeonsi `gfx10_shader_ngg.c` (Mesa 21.3): `ngg_get_ordered_id()` (`gs_tg_info[11:0]`) is the pointer; - ACO `nir_intrinsic_ordered_xfb_counter_add_amd`: `m0 = ordered_id`, address VGPR 0. The LLVM lowering cited in the description only copies the pointer operand into M0, so it does not support "M0 is the GDS address". Our compute entry fills TG_SIZE's wave-ID bits with 0 (`InstructionTranslator.cpp:229-236`), so a shader that builds M0 the way these do gets M0 = 0: the counter is never updated and every wave receives 0, which means they all append at the same base. The test sets `m0 = 0xffff` (`GdsAppendConsume.cpp:50`), the `ds_append` form, so it can't see this. Suggested direction: address the counter by `offset0` alone and leave M0 out of the address and the bounds check. Add a pass with M0 = 0 and one with a small wave ID in M0, and correct the M0 sentence in the description and in `docs/dev/debt/shader.md`. The rest looks right to me: the `offset1` decoding matches LLVM/ACO's `ds_ordered_count_offsets`, swap and multi-dword counts throw, the lane-varying result is in `LaneSource`, and the debt entry records the launch order that isn't modeled. We couldn't run this on the hardware oracle (no GDS ordered append through HSA).
jotitadev commented 2026-10-14 17:18:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-14T17:18:39Z.


Run on an Apple GPU, next to the RTX 3060 and the RTX 4080 and UHD 770 runs above.

GPUs tested: Apple M2 Max, MoltenVK 1.4.2 (Vulkan 1.4.357), macOS 27.2, x86-64 under Rosetta

main does not run the GPU tests on macOS yet, so I tested on macos-port at b7eb6b6b (mugurc/AnyPS5) with this PR's diff applied, not on main. Release build, LunarG Vulkan SDK 1.4.363.0. The suite is ctest -R agc -E 'flip|display|lds_atomics64' -j1 --timeout 30. Without the PR, 22 tests fail on this branch, all of them known macOS failures listed in #1. Head bb17e6110. The diff applies cleanly, except docs/.

  • agc_driver_gds_append_consume passes, and is not skipped. With only the test files applied to the unchanged branch, it fails with ds_ordered_count at pc 16: GDS counters updated in wave launch order are not modeled, so the new pass runs here.
  • agc_driver_pm4 and agc_wave_control_decode pass.
  • Suite: the same 22 failures with and without the PR. None are new and none are fixed.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6174106535 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5176#issuecomment-6174106535). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-14T17:18:39Z. --- Run on an Apple GPU, next to the RTX 3060 and the RTX 4080 and UHD 770 runs above. GPUs tested: Apple M2 Max, MoltenVK 1.4.2 (Vulkan 1.4.357), macOS 27.2, x86-64 under Rosetta `main` does not run the GPU tests on macOS yet, so I tested on `macos-port` at `b7eb6b6b` (mugurc/AnyPS5) with this PR's diff applied, not on `main`. Release build, LunarG Vulkan SDK 1.4.363.0. The suite is `ctest -R agc -E 'flip|display|lds_atomics64' -j1 --timeout 30`. Without the PR, 22 tests fail on this branch, all of them known macOS failures listed in #1. Head `bb17e6110`. The diff applies cleanly, except `docs/`. - `agc_driver_gds_append_consume` passes, and is not skipped. With only the test files applied to the unchanged branch, it fails with `ds_ordered_count at pc 16: GDS counters updated in wave launch order are not modeled`, so the new pass runs here. - `agc_driver_pm4` and `agc_wave_control_decode` pass. - Suite: the same 22 failures with and without the PR. None are new and none are fixed. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
tv7 commented 2026-10-14 18:23:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-14T18:23:59Z.


Silent Hill: Townfall (PPSA33286) runs into what @adriadam10 describes. The compute shader at 0x16402d6e00 (wave64) builds M0 for its ds_ordered_count from an ordered wave ID and a high half, not from a GDS address:

0x13c  s_pack_hh_b32_b16  vcc_hi, 0, s3
0x140  s_bfe_u32          vcc_lo, s28, 0xc0006     ; s28 = s17 copied at entry, bits [17:6]
0x148  s_or_b32           m0, vcc_lo, vcc_hi
0x14c  ds_ordered_count   v3, v4 gds

Windows 11, RTX 3070, main e34c47921 + this PR at bb17e6110. The shader also makes a computed s_swappc_b64 at 0x134 that main can't link yet (separate from this PR), so all three runs used a local stub that skips that call. One 900 s run each:

Result
this PR as is no frames; within a few minutes the title aborts with GameThread timed out waiting for RenderThread after 120.00 secs
ordered-append dispatches skipped (local) runs the full 900 s, the GPU is still working at the end
this PR with the counter addressed by offset0 alone (M0 left out, as suggested above) runs the full 900 s with the ordered-append dispatches recorded, the GPU is still working at the end

So the suggested direction also fixes the hang this title hits. Runs of this title are somewhat flaky, so treat one run per row as an indication, not proof. I can test a new head on it.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6175340908 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5176#issuecomment-6175340908). Originally posted by [tv7](https://github.com/tv7) on 2026-10-14T18:23:59Z. --- Silent Hill: Townfall (PPSA33286) runs into what @adriadam10 describes. The compute shader at `0x16402d6e00` (wave64) builds M0 for its `ds_ordered_count` from an ordered wave ID and a high half, not from a GDS address: ``` 0x13c s_pack_hh_b32_b16 vcc_hi, 0, s3 0x140 s_bfe_u32 vcc_lo, s28, 0xc0006 ; s28 = s17 copied at entry, bits [17:6] 0x148 s_or_b32 m0, vcc_lo, vcc_hi 0x14c ds_ordered_count v3, v4 gds ``` Windows 11, RTX 3070, `main` e34c47921 + this PR at bb17e6110. The shader also makes a computed `s_swappc_b64` at 0x134 that `main` can't link yet (separate from this PR), so all three runs used a local stub that skips that call. One 900 s run each: | | Result | |---|---| | this PR as is | no frames; within a few minutes the title aborts with `GameThread timed out waiting for RenderThread after 120.00 secs` | | ordered-append dispatches skipped (local) | runs the full 900 s, the GPU is still working at the end | | this PR with the counter addressed by `offset0` alone (M0 left out, as suggested above) | runs the full 900 s with the ordered-append dispatches recorded, the GPU is still working at the end | So the suggested direction also fixes the hang this title hits. Runs of this title are somewhat flaky, so treat one run per row as an indication, not proof. I can test a new head on it. AI-assisted: yes
n-delic commented 2026-10-14 19:03:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by n-delic on 2026-10-14T19:03:51Z.


@adriadam10 Thanks, you're right. Fixed in 8b25a9486:

  • The counter is addressed by offset0 alone. M0 is no longer part of the address or the bounds check, and the translation doesn't read it.
  • GdsAppendConsume.cpp runs the ordered pass with M0 = 0 and with M0 = 7. With the first head's M0 addressing, the M0 = 0 pass fails (wave 0 returned 0, expected 1000).
  • The M0 sentence is corrected in docs/dev/debt/shader.md (citing the radeonsi sources you listed) and in the description.

ctest -R 'agc|shader': 484 of 484 pass, and check_conventions.py passes (Linux, RTX 3060).

@tv7 Thanks for the Townfall runs. The new head should behave like your "offset0 alone" row.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6176095190 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5176#issuecomment-6176095190). Originally posted by [n-delic](https://github.com/n-delic) on 2026-10-14T19:03:51Z. --- @adriadam10 Thanks, you're right. Fixed in 8b25a9486: - The counter is addressed by `offset0` alone. M0 is no longer part of the address or the bounds check, and the translation doesn't read it. - `GdsAppendConsume.cpp` runs the ordered pass with M0 = 0 and with M0 = 7. With the first head's M0 addressing, the M0 = 0 pass fails (`wave 0 returned 0, expected 1000`). - The M0 sentence is corrected in `docs/dev/debt/shader.md` (citing the radeonsi sources you listed) and in the description. `ctest -R 'agc|shader'`: 484 of 484 pass, and `check_conventions.py` passes (Linux, RTX 3060). @tv7 Thanks for the Townfall runs. The new head should behave like your "offset0 alone" row. AI-assisted: yes (Claude Code)
adriadam10 commented 2026-10-14 19:27:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T19:27:55Z.

Review: APPROVED


Re-checked 8b25a9486: the counter is addressed by offset0 alone, the M0 = 0 and M0 = 7 passes in GdsAppendConsume.cpp fail on the first head's M0 addressing, and the debt entry now describes M0 correctly. agc_driver_gds_append_consume, agc_driver_pm4 and agc_wave_control_decode fail without the change.

The branch conflicted with main in docs/dev/debt/shader.md (adjacent line from the s_swappc_b64 entry); I rebased it, keeping both lines. Build and the touched agc tests pass on the rebased tree. Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5523504028 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5176#pullrequestreview-5523504028). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T19:27:55Z. **Review:** APPROVED --- Re-checked 8b25a9486: the counter is addressed by `offset0` alone, the M0 = 0 and M0 = 7 passes in `GdsAppendConsume.cpp` fail on the first head's M0 addressing, and the debt entry now describes M0 correctly. `agc_driver_gds_append_consume`, `agc_driver_pm4` and `agc_wave_control_decode` fail without the change. The branch conflicted with main in `docs/dev/debt/shader.md` (adjacent line from the `s_swappc_b64` entry); I rebased it, keeping both lines. Build and the touched agc tests pass on the rebased tree. Merging once the full Build is green.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5176
No description provided.