fix(agc): accept bound copies of a registered shader header that differ only in user_data #1837

Merged
EdouardSence merged 1 commit from upstream-pr/1837 into main 2026-10-10 07:20:19 +00:00
EdouardSence commented 2026-10-08 21:09:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-08T21:09:06Z.


What

The static, graphics and rectangle ABI resolvers look up the registered shader by its code address. #639 made them require the bound Shader header to be at the registered header's address, and otherwise throw ... refers to a replaced shader header.

Astro Bot (PPSA21567) registers a vertex shader with its header at 0x50000e500, then binds it for a draw through a copy at 0x307ae3920. The copy's 96 fixed Shader bytes match the registered header except user_data: 0x50000e668 in the registered header, null in the copy. The cx_registers, sh_registers, specials and semantic pointers still point into the registered header. The bytes after the fixed fields are unrelated memory, so only sizeof(Shader) is compared.

SameHeader now accepts a bound header when it is at the registered address, or when its fixed fields equal the registered header's with user_data ignored. Any other difference still throws. The registered header's metadata is used, as before. This is recorded in TechnicalDebt, because whether the console reads the copy's user_data is unknown.

Tested

Linux (CachyOS, GCC), RX 9070 XT, Mesa 26.2.4 RADV.

  • agc_driver_prepared_shaders now also resolves the static ABI through a copy of the registered compute header:
    • with a different user_data, it is accepted;
    • with a different target, it still throws replaced shader header;
    • without the change, the first call throws.
  • Full ctest: 484/485. The failing test is import_audit, a Python tool test that fails the same way on main with Python 3.14 here.
  • tools/check_conventions.py passes.
  • Astro Bot on main 4b6ab6bb with #1836, scripted and headless:
    • before this change, it stops on rectangle ABI refers to a replaced shader header;
    • with it, it gets past that and stops on shader image heap capacity exceeded (#1789). No frame is presented yet.

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
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • 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 (it is reached in Astro Bot only after #1836, but the two are independent)
  • AI-assisted: yes. The investigation, code, tests and this description were written by Claude (Claude Code) on my machine.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4792820733 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-08T21:09:06Z. --- ### What The static, graphics and rectangle ABI resolvers look up the registered shader by its code address. #639 made them require the bound `Shader` header to be at the registered header's address, and otherwise throw `... refers to a replaced shader header`. Astro Bot (PPSA21567) registers a vertex shader with its header at 0x50000e500, then binds it for a draw through a copy at 0x307ae3920. The copy's 96 fixed `Shader` bytes match the registered header except `user_data`: 0x50000e668 in the registered header, null in the copy. The `cx_registers`, `sh_registers`, `specials` and semantic pointers still point into the registered header. The bytes after the fixed fields are unrelated memory, so only `sizeof(Shader)` is compared. `SameHeader` now accepts a bound header when it is at the registered address, or when its fixed fields equal the registered header's with `user_data` ignored. Any other difference still throws. The registered header's metadata is used, as before. This is recorded in TechnicalDebt, because whether the console reads the copy's `user_data` is unknown. ### Tested Linux (CachyOS, GCC), RX 9070 XT, Mesa 26.2.4 RADV. - `agc_driver_prepared_shaders` now also resolves the static ABI through a copy of the registered compute header: - with a different `user_data`, it is accepted; - with a different `target`, it still throws `replaced shader header`; - without the change, the first call throws. - Full `ctest`: 484/485. The failing test is `import_audit`, a Python tool test that fails the same way on `main` with Python 3.14 here. - `tools/check_conventions.py` passes. - Astro Bot on `main` 4b6ab6bb with #1836, scripted and headless: - before this change, it stops on `rectangle ABI refers to a replaced shader header`; - with it, it gets past that and stops on `shader image heap capacity exceeded` (#1789). No frame is presented yet. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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 (it is reached in Astro Bot only after #1836, but the two are independent) - [x] AI-assisted: yes. The investigation, code, tests and this description were written by Claude (Claude Code) on my machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fisherjoey commented 2026-10-09 00:46:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-09T00:46:50Z.


Tested on Stray (PPSA02100 v1.05, Unreal Engine 4). It hits the same rectangle ABI refers to a replaced shader header (from sceAgcCreateInterpolantMapping -> ResolveGraphicsAbi), but this PR alone doesn't get it through.

Setup: Linux (Nobara 44, kernel 7.2), RTX 5070 Ti, NVIDIA 595.91.07. Base is main 1be6f9f1 + #861 + #1836 + #1893 + #1902 + #1904.

Stray binds a copy of a registered vertex shader header (registered at +0x0, copy at +0x250). I dumped both 96-byte Shader structs at the failing compare. They differ in only two places:

[8..13]  user_data: a pointer in the registered header, null in the copy (this PR ignores it)
[93]     7f / 00

Byte 93 is padding: num_sh_registers is at offset 92 and sizeof(Shader) is 96. The game's copy zeroes it and the registered header has 0x7f there, so the memcmp over sizeof(Shader) still fails.

Comparing only up to the end of the last field fixes it:

return std::memcmp(&used, &registered, offsetof(Shader, num_sh_registers) + sizeof(Shader::num_sh_registers)) == 0;

With that one change on top of this PR, Stray gets past the interpolant mapping and stops later on an unrelated prepared rectangle artifacts are missing. Without it, it aborts at the same point every run (runs 8 to 11).

The test in this PR doesn't catch it because Shader copy = header.shader; copies the padding too. Writing a nonzero byte at offset 93 of the registered header (or zeroing the copy's padding) before the compare would cover it. Happy to send the change and a test as a suggestion on this PR if that helps.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6071950516 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6071950516). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-09T00:46:50Z. --- Tested on Stray (PPSA02100 v1.05, Unreal Engine 4). It hits the same `rectangle ABI refers to a replaced shader header` (from `sceAgcCreateInterpolantMapping` -> `ResolveGraphicsAbi`), but this PR alone doesn't get it through. Setup: Linux (Nobara 44, kernel 7.2), RTX 5070 Ti, NVIDIA 595.91.07. Base is `main` 1be6f9f1 + #861 + #1836 + #1893 + #1902 + #1904. Stray binds a copy of a registered vertex shader header (registered at +0x0, copy at +0x250). I dumped both 96-byte `Shader` structs at the failing compare. They differ in only two places: ``` [8..13] user_data: a pointer in the registered header, null in the copy (this PR ignores it) [93] 7f / 00 ``` Byte 93 is padding: `num_sh_registers` is at offset 92 and `sizeof(Shader)` is 96. The game's copy zeroes it and the registered header has 0x7f there, so the `memcmp` over `sizeof(Shader)` still fails. Comparing only up to the end of the last field fixes it: ```cpp return std::memcmp(&used, &registered, offsetof(Shader, num_sh_registers) + sizeof(Shader::num_sh_registers)) == 0; ``` With that one change on top of this PR, Stray gets past the interpolant mapping and stops later on an unrelated `prepared rectangle artifacts are missing`. Without it, it aborts at the same point every run (runs 8 to 11). The test in this PR doesn't catch it because `Shader copy = header.shader;` copies the padding too. Writing a nonzero byte at offset 93 of the registered header (or zeroing the copy's padding) before the compare would cover it. Happy to send the change and a test as a suggestion on this PR if that helps. AI-assisted: yes
NahuelGenchi commented 2026-10-09 05:15:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by NahuelGenchi on 2026-10-09T05:15:12Z.


Sonic Origins (PPSA05324) hits the static ABI variant of this, static ABI refers to a replaced shader header, on main f1451396 + #2004 once #1789 is worked around locally.

In one run, 14 shaders (header type 1) are bound 46 times through a copy of their registered header 0x78 bytes below it. All 96 fixed bytes of the copy equal the registered header, user_data included, so the comparison in this PR would accept them. Accepting byte-identical copies locally gets the title past this stop.

Bring-up thread: #2021

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6074767305 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6074767305). Originally posted by [NahuelGenchi](https://github.com/NahuelGenchi) on 2026-10-09T05:15:12Z. --- Sonic Origins (PPSA05324) hits the static ABI variant of this, `static ABI refers to a replaced shader header`, on `main` f1451396 + #2004 once #1789 is worked around locally. In one run, 14 shaders (header type 1) are bound 46 times through a copy of their registered header 0x78 bytes below it. All 96 fixed bytes of the copy equal the registered header, `user_data` included, so the comparison in this PR would accept them. Accepting byte-identical copies locally gets the title past this stop. Bring-up thread: #2021
johnmaia commented 2026-10-09 06:49:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-09T06:49:42Z.


Tested on a second title: Disney Epic Mickey: Rebrushed (PPSA15657, UE4) stops on the same rectangle ABI refers to a replaced shader header. With this PR it still stops there, because the comparison also covers the struct's tail padding.

I logged the 96-byte comparison in SameHeader locally. Every field matches, user_data included, and the only difference is in the last 8 bytes:

bound=0x…1220  registered=0x…0f80  sizeof(Shader)=96
+58  bound=00007d0b0a020030  reg=0000000b0a020030   <-- differs

At +0x58 the fields are special_sizes_bytes = 0x0030, type = 2, num_cx_registers = 10 and num_sh_registers = 11. They end at +0x5d. Bytes +0x5d..+0x5f are padding, and the title's copy has a leftover 0x7d there. std::memcmp(&used, &registered, sizeof(Shader)) therefore rejects a copy whose fields all match.

Comparing up to the end of the last field fixes it here:

return std::memcmp(&used, &registered, offsetof(Shader, num_sh_registers) + sizeof(registered.num_sh_registers)) == 0;

A field-by-field comparison would also work. With that change, the title gets past this point and stops at an unrelated stub.

Measured on RX 7600 (gfx1102), Linux, with main f1451396 plus a local stack of open PRs including #1836.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6075937261 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6075937261). Originally posted by [johnmaia](https://github.com/johnmaia) on 2026-10-09T06:49:42Z. --- Tested on a second title: **Disney Epic Mickey: Rebrushed** (PPSA15657, UE4) stops on the same `rectangle ABI refers to a replaced shader header`. With this PR it still stops there, because the comparison also covers the struct's tail padding. I logged the 96-byte comparison in `SameHeader` locally. Every field matches, `user_data` included, and the only difference is in the last 8 bytes: ``` bound=0x…1220 registered=0x…0f80 sizeof(Shader)=96 +58 bound=00007d0b0a020030 reg=0000000b0a020030 <-- differs ``` At +0x58 the fields are `special_sizes_bytes` = 0x0030, `type` = 2, `num_cx_registers` = 10 and `num_sh_registers` = 11. They end at +0x5d. Bytes +0x5d..+0x5f are padding, and the title's copy has a leftover `0x7d` there. `std::memcmp(&used, &registered, sizeof(Shader))` therefore rejects a copy whose fields all match. Comparing up to the end of the last field fixes it here: ```cpp return std::memcmp(&used, &registered, offsetof(Shader, num_sh_registers) + sizeof(registered.num_sh_registers)) == 0; ``` A field-by-field comparison would also work. With that change, the title gets past this point and stops at an unrelated stub. Measured on RX 7600 (gfx1102), Linux, with `main` f1451396 plus a local stack of open PRs including #1836. *Tested and written by Claude (AI assistant) on a contributor's machine.*
EdouardSence commented 2026-10-09 07:34:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-09T07:34:21Z.


@johnmaia thanks, you're right. Shader ends at +0x5d, so the last 3 bytes are padding, and memcmp over sizeof(Shader) compared them. 8d9bcb7a compares up to the end of num_sh_registers instead. The struct has no interior padding, so this covers every field and nothing else.

The test in Registration() now also binds a copy with 0x7d in its last padding byte. It fails before the change and passes after.

Rebased onto main a8b032b2. ctest -j8: 494 of 495 pass. The one failure is import_audit, which can't read the commit hash in my worktree and is unrelated.

@NahuelGenchi thanks for the Sonic Origins data. The static ABI path uses the same comparison.

AI-assisted: the fix, the test and this reply were written by Claude (Claude Code) on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6076558296 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6076558296). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-09T07:34:21Z. --- @johnmaia thanks, you're right. `Shader` ends at +0x5d, so the last 3 bytes are padding, and `memcmp` over `sizeof(Shader)` compared them. 8d9bcb7a compares up to the end of `num_sh_registers` instead. The struct has no interior padding, so this covers every field and nothing else. The test in `Registration()` now also binds a copy with `0x7d` in its last padding byte. It fails before the change and passes after. Rebased onto `main` a8b032b2. `ctest -j8`: 494 of 495 pass. The one failure is `import_audit`, which can't read the commit hash in my worktree and is unrelated. @NahuelGenchi thanks for the Sonic Origins data. The static ABI path uses the same comparison. AI-assisted: the fix, the test and this reply were written by Claude (Claude Code) on my machine.
orbz22 commented 2026-10-09 12:44:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orbz22 on 2026-10-09T12:44:45Z.


Astro's Playroom (PPSA01325) hits this on Windows with NVIDIA, right after #1836.

On main 745b775e + #1836 it stops with AGC driver: rectangle ABI refers to a replaced shader header. With this PR on top (8d9bcb7a) it gets past it. The next stop is the DB_RENDER_CONTROL depth clear draws that #1395 recognises.

Setup: Windows 11, RTX 3060 Laptop (NVIDIA 616.92), WinLibs GCC 15.2.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6081145591 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6081145591). Originally posted by [orbz22](https://github.com/orbz22) on 2026-10-09T12:44:45Z. --- Astro's Playroom (PPSA01325) hits this on Windows with NVIDIA, right after #1836. On `main` 745b775e + #1836 it stops with `AGC driver: rectangle ABI refers to a replaced shader header`. With this PR on top (8d9bcb7a) it gets past it. The next stop is the `DB_RENDER_CONTROL` depth clear draws that #1395 recognises. Setup: Windows 11, RTX 3060 Laptop (NVIDIA 616.92), WinLibs GCC 15.2. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Pipodi commented 2026-10-09 16:04:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pipodi on 2026-10-09T16:04:40Z.


PPSA26344 (Ghost of Yōtei) binds copies of registered headers that this still rejects with "replaced shader header". The title copies the whole header (header_size 376) to another address and relocates every pointer that points into the header. code stays the same:

field registered @0x8000031b38 bound @0x800005cbf0
user_data 0x8000031c48 0x800005cd00
code 0x8000410b00 0x8000410b00
cx_registers 0x8000031bf8 0x800005ccb0
sh_registers 0x8000031bc8 0x800005cc80
specials 0x8000031b98 0x800005cc50
input_semantics / output_semantics 0x8000031bc8 0x800005cc80

Every changed pointer moved by the same 0x2b0b8 as the header. The other fixed fields are identical.

A small extension on top of this PR treats a register, specials or semantics pointer as equal when it points into the registered header ([headerAddress, headerAddress + header_size)) and the copy's value is that pointer plus the distance between the two headers. Anything else still fails, including pointers moved by any other distance. With an earlier prototype of this check, the title got past every such copy in my runs and reached its first presented frames. It's on a branch stacked on this one, with a PreparedShaders case: a whole Header copied with its pointers relocated resolves, and one pointer off by one element is refused. I also extended your TechnicalDebt line.

Would you rather pick that up here, or should I open it as a separate PR on top of this one?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6084578049 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6084578049). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-10-09T16:04:40Z. --- PPSA26344 (Ghost of Yōtei) binds copies of registered headers that this still rejects with "replaced shader header". The title copies the whole header (`header_size` 376) to another address and relocates every pointer that points into the header. `code` stays the same: | field | registered @0x8000031b38 | bound @0x800005cbf0 | |---|---|---| | `user_data` | 0x8000031c48 | 0x800005cd00 | | `code` | 0x8000410b00 | 0x8000410b00 | | `cx_registers` | 0x8000031bf8 | 0x800005ccb0 | | `sh_registers` | 0x8000031bc8 | 0x800005cc80 | | `specials` | 0x8000031b98 | 0x800005cc50 | | `input_semantics` / `output_semantics` | 0x8000031bc8 | 0x800005cc80 | Every changed pointer moved by the same 0x2b0b8 as the header. The other fixed fields are identical. A small extension on top of this PR treats a register, specials or semantics pointer as equal when it points into the registered header (`[headerAddress, headerAddress + header_size)`) and the copy's value is that pointer plus the distance between the two headers. Anything else still fails, including pointers moved by any other distance. With an earlier prototype of this check, the title got past every such copy in my runs and reached its first presented frames. It's on a branch stacked on this one, with a `PreparedShaders` case: a whole `Header` copied with its pointers relocated resolves, and one pointer off by one element is refused. I also extended your TechnicalDebt line. Would you rather pick that up here, or should I open it as a separate PR on top of this one?
EdouardSence commented 2026-10-09 19:04:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-09T19:04:04Z.


Thanks, that table settles it: the copy is the whole header with every pointer into it moved by the header's own distance. That is the same thing this PR is about, bound copies of a registered header, so I'd rather take it here than stack a second PR. There is also a practical reason. Since pr-intake.yml landed today, a new PR from an author with fewer than 20 merged PRs is closed automatically, so a stacked PR from either of us would be closed on opening.

Could you link the branch? I'll pull your commit in as it is, keeping you as author, and update the description with your Yōtei result. Ghost of Yōtei is one of the titles I run, so I'll also check that it gets past the "replaced shader header" copies here. That run won't happen right away; the machine is busy for now.

Written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6087423785 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6087423785). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-09T19:04:04Z. --- Thanks, that table settles it: the copy is the whole header with every pointer into it moved by the header's own distance. That is the same thing this PR is about, bound copies of a registered header, so I'd rather take it here than stack a second PR. There is also a practical reason. Since `pr-intake.yml` landed today, a new PR from an author with fewer than 20 merged PRs is closed automatically, so a stacked PR from either of us would be closed on opening. Could you link the branch? I'll pull your commit in as it is, keeping you as author, and update the description with your Yōtei result. Ghost of Yōtei is one of the titles I run, so I'll also check that it gets past the "replaced shader header" copies here. That run won't happen right away; the machine is busy for now. *Written by Claude (AI assistant) on a contributor's machine.*
Pipodi commented 2026-10-09 19:24:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pipodi on 2026-10-09T19:24:19Z.


Thanks, happy for it to go in here. The branch is https://github.com/Pipodi/AnyPS5/tree/fix/relocated-shader-header-copies

It's one commit, 56b154a3, directly on your current head 8d9bcb7a, so it should fast-forward:

  • ShaderRegistry.cpp: a pointer field also matches when the registered one points into the registered header and the copy moved it by exactly the distance between the two headers. Any other difference still refuses the header.
  • PreparedShaders.cpp: a whole Header copied to another address with its register and specials pointers relocated now resolves. The same copy with specials one element past its relocated address is still refused. Without the change the relocated copy fails with "static ABI refers to a replaced shader header".
  • TechnicalDebt.md: the one-line update for the widened check.

Tested on Windows 11, MinGW-w64 GCC 15.2.0, RTX 4090: full ctest 489/489. On Yōtei (PPSA26344 v1.008), with an earlier prototype of this check on our integration branch, the "replaced shader header" stops are gone and the title reaches its first frames.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6087741963 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6087741963). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-10-09T19:24:19Z. --- Thanks, happy for it to go in here. The branch is https://github.com/Pipodi/AnyPS5/tree/fix/relocated-shader-header-copies It's one commit, `56b154a3`, directly on your current head `8d9bcb7a`, so it should fast-forward: - `ShaderRegistry.cpp`: a pointer field also matches when the registered one points into the registered header and the copy moved it by exactly the distance between the two headers. Any other difference still refuses the header. - `PreparedShaders.cpp`: a whole `Header` copied to another address with its register and specials pointers relocated now resolves. The same copy with `specials` one element past its relocated address is still refused. Without the change the relocated copy fails with "static ABI refers to a replaced shader header". - `TechnicalDebt.md`: the one-line update for the widened check. Tested on Windows 11, MinGW-w64 GCC 15.2.0, RTX 4090: full ctest 489/489. On Yōtei (PPSA26344 v1.008), with an earlier prototype of this check on our integration branch, the "replaced shader header" stops are gone and the title reaches its first frames.
oneandonlydean commented 2026-10-10 05:16:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T05:16:57Z.


This conflicts with main in ShaderRegistry.cpp since #1836 merged; could you rebase? It passed testing at 8d9bcb7a. If Pipodi's relocation commit comes in with the rebase, it gets tested again before merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094129330 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6094129330). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T05:16:57Z. --- This conflicts with main in `ShaderRegistry.cpp` since #1836 merged; could you rebase? It passed testing at 8d9bcb7a. If Pipodi's relocation commit comes in with the rebase, it gets tested again before merging.
adriadam10 commented 2026-10-10 07:11:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T07:11:36Z.


Rebased onto current main as requested: the only conflict was two adjacent includes in ShaderRegistry.cpp (<cstdio> from main, <cstddef> from this PR), both kept. The diff is otherwise unchanged. Partial build and ctest (libSceAgcDriver, libs, libkernel) pass 380/380. Pipodi's relocation commit is not included. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094993712 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6094993712). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T07:11:36Z. --- Rebased onto current `main` as requested: the only conflict was two adjacent includes in `ShaderRegistry.cpp` (`<cstdio>` from main, `<cstddef>` from this PR), both kept. The diff is otherwise unchanged. Partial build and ctest (libSceAgcDriver, libs, libkernel) pass 380/380. Pipodi's relocation commit is not included. Merging once CI is green.
github-actions[bot] commented 2026-10-10 07:14:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T07:14:11Z.


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
#1825 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp L14
#2169 docs/dev/TechnicalDebt.md L247
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095013848 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6095013848). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T07:14:11Z. --- <!-- pr-overlap --> 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 | |---|---|---|---| | #1825 | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp` [L14](https://github.com/boykopovar/AnyPS5/blob/2f250f83aa40899670c95cc2045803caab7374b1/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp#L14) | | | | #2169 | `docs/dev/TechnicalDebt.md` [L247](https://github.com/boykopovar/AnyPS5/blob/2f250f83aa40899670c95cc2045803caab7374b1/docs/dev/TechnicalDebt.md#L247) | | |
Pipodi commented 2026-10-10 07:45:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pipodi on 2026-10-10T07:45:56Z.


Thanks for merging. The relocation extension discussed above isn't part of this merge: whole-header copies whose pointers into the header all move by the header's own distance, which PPSA26344 binds and which still fail with "static ABI refers to a replaced shader header".

It's rebased onto current main as one commit, 44a80d4f, on https://github.com/Pipodi/AnyPS5/tree/fix/relocated-shader-header-copies. It touches ShaderRegistry.cpp, adds a PreparedShaders case, and updates the TechnicalDebt line. All seven agc_driver_prepared_shaders modes pass. With ShaderRegistry.cpp from main, the new case fails with that error.

pr-intake would close a new PR from me, and @EdouardSence is in the same position. How would you like us to carry it on?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095259186 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6095259186). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-10-10T07:45:56Z. --- Thanks for merging. The relocation extension discussed above isn't part of this merge: whole-header copies whose pointers into the header all move by the header's own distance, which PPSA26344 binds and which still fail with "static ABI refers to a replaced shader header". It's rebased onto current `main` as one commit, `44a80d4f`, on https://github.com/Pipodi/AnyPS5/tree/fix/relocated-shader-header-copies. It touches `ShaderRegistry.cpp`, adds a `PreparedShaders` case, and updates the TechnicalDebt line. All seven `agc_driver_prepared_shaders` modes pass. With `ShaderRegistry.cpp` from `main`, the new case fails with that error. `pr-intake` would close a new PR from me, and @EdouardSence is in the same position. How would you like us to carry it on?
EdouardSence commented 2026-10-10 12:00:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-10T12:00:25Z.


Data for Pipodi's relocation commit (44a80d4f, https://github.com/Pipodi/AnyPS5/tree/fix/relocated-shader-header-copies), from Ghost of Yōtei (PPSA26344) on Linux.

Setup: CachyOS (kernel 7.2.9), RX 9070 XT (RADV), Release, headless gamescope with scripted input. Main b5f5362d3 + #1940 (needed to get past operand 235, #1920).

Without 44a80d4f: the title stops about 21 s in on the graphics path:

AGC driver: graphics ABI refers to a replaced shader header

A local print (not pushed) of the words that differ between the bound header and the registered snapshot:

used 0x800005cbf0 registered 0x8000031b38 snapshot header bytes 376 code 0x8000410b00 type 2
+0x08 used 0005cd00 registered 00031c48   (user_data, already ignored)
+0x18 used 0005ccb0 registered 00031bf8   (cx_registers)
+0x20 used 0005cc80 registered 00031bc8   (sh_registers)
+0x28 used 0005cc50 registered 00031b98   (specials)
+0x30 used 0005cc80 registered 00031bc8   (input_semantics)
+0x38 used 0005cc80 registered 00031bc8   (output_semantics)

Every pointer is at the same distance from its own header (+0xc0, +0x90, +0x60, ...), so this is the whole-header copy the commit describes, on the graphics ABI and not only the static one.

With 44a80d4f cherry-picked: that stop is gone. The title runs on to about 26 s and stops on an unrelated recompiler refusal (compute shader 0x80003aa700: GetImageResource dword 0 is not a valid runtime value, an image descriptor read from a buffer at a computed index).

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6097265729 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6097265729). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-10T12:00:25Z. --- Data for Pipodi's relocation commit (`44a80d4f`, https://github.com/Pipodi/AnyPS5/tree/fix/relocated-shader-header-copies), from Ghost of Yōtei (PPSA26344) on Linux. **Setup:** CachyOS (kernel 7.2.9), RX 9070 XT (RADV), Release, headless gamescope with scripted input. Main `b5f5362d3` + #1940 (needed to get past operand 235, #1920). **Without `44a80d4f`:** the title stops about 21 s in on the graphics path: ``` AGC driver: graphics ABI refers to a replaced shader header ``` A local print (not pushed) of the words that differ between the bound header and the registered snapshot: ``` used 0x800005cbf0 registered 0x8000031b38 snapshot header bytes 376 code 0x8000410b00 type 2 +0x08 used 0005cd00 registered 00031c48 (user_data, already ignored) +0x18 used 0005ccb0 registered 00031bf8 (cx_registers) +0x20 used 0005cc80 registered 00031bc8 (sh_registers) +0x28 used 0005cc50 registered 00031b98 (specials) +0x30 used 0005cc80 registered 00031bc8 (input_semantics) +0x38 used 0005cc80 registered 00031bc8 (output_semantics) ``` Every pointer is at the same distance from its own header (`+0xc0`, `+0x90`, `+0x60`, ...), so this is the whole-header copy the commit describes, on the graphics ABI and not only the static one. **With `44a80d4f` cherry-picked:** that stop is gone. The title runs on to about 26 s and stops on an unrelated recompiler refusal (`compute shader 0x80003aa700: GetImageResource dword 0 is not a valid runtime value`, an image descriptor read from a buffer at a computed index). *Tested and written by Claude (AI assistant) on a contributor's machine.*
Pipodi commented 2026-10-10 12:57:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pipodi on 2026-10-10T12:57:26Z.


Thanks @EdouardSence, and @Dextroid17 in #675 on lavapipe: 44a80d4f clears the replaced-header stop on RADV and llvmpipe too, on the graphics ABI as well as the static one. The commit is unchanged on https://github.com/Pipodi/AnyPS5/tree/fix/relocated-shader-header-copies whenever the maintainers decide how they'd like it carried.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6097737651 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1837#issuecomment-6097737651). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-10-10T12:57:26Z. --- Thanks @EdouardSence, and @Dextroid17 in #675 on lavapipe: `44a80d4f` clears the replaced-header stop on RADV and llvmpipe too, on the graphics ABI as well as the static one. The commit is unchanged on https://github.com/Pipodi/AnyPS5/tree/fix/relocated-shader-header-copies whenever the maintainers decide how they'd like it carried.
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!1837
No description provided.