fix(agc): name the shader address and stage in preparation failures #3946

Merged
danzaio merged 3 commits from upstream-pr/3946 into main 2026-10-12 10:51:10 +00:00
danzaio commented 2026-10-11 19:35:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by danzaio on 2026-10-11T19:35:58Z.


What

Replaces #2867, which the intake bot closed and GitHub now refuses to reopen.

Astro Bot (PPSA01284) was reported in #2062 with this failure:

computed/data-dependent s_swappc_b64 call target at program counter 0x00000074 is not statically resolvable

That message does not identify the shader address or stage. PrepareShaderWithDiagnostics adds a dynamic address/stage prefix and, when request capture succeeds, the dump filename to standard exceptions while preserving the complete message. It attempts the dump for non-standard exceptions too and rethrows those unchanged, even if dumping fails. This does not implement s_swappc_b64 or claim gameplay progress.

#4152 also edits this wrapper for pipeline-library registration. A file-level three-way merge using GitHub's actual merge base (bca7a29d259299aaa8972c94d12694232bb3bb08), #4152 head 14b52c1ac38d2f9c254299189e0bccba26bed752, and this commit's source is clean. The combined branches were not built or run together.

Tested

  • Current head: 56df893667a484c8e2e4057871f55804fca30f9f, rebased onto captured main 2da042eee09fc3b3341fecfbeb33c9112d8591eb.
  • Windows 10 x64, MinGW-w64 GCC 15.2.0. No title or homebrew run.
  • On prior local HEAD 0f24caf42b0f88f75b256ed12264616b727013d5, agc_driver_prepared_shaders_tests built with -j1; all 9 agc_driver_prepared_shaders* CTests passed with ANYPS5_REQUIRE_VULKAN=1 and --timeout 30. The final HEAD's ShaderRegistry.cpp has the same blob (e31f423ba947a05a3bc96cc7b50a65515a51724f). After rebase, an incremental target build was attempted with -j1 and stopped at Ninja action 50/123 when free RAM fell to 1,848,635,392 bytes, below the 2-GiB floor. No compile error preceded the guard; the target did not finish, so CTest was not rerun on the rebased HEAD.
  • The external harness was compiled with -std=c++23 -Wall -Wextra -Werror and passed multiline-error, 324-character dump-path, non-standard exception, and dump-failure checks. Its extracted function exactly matches the final source (SHA-256 ebd61616bdae2957d772f20c25f1813b22b6ef48b21ac83ba88ee47725697fdf).
  • python tools/check_conventions.py --base 2da042eee09fc3b3341fecfbeb33c9112d8591eb and git diff --check 2da042eee09fc3b3341fecfbeb33c9112d8591eb..HEAD pass.
  • The prior full Release build attempt (BUILD_TESTING=ON, ANYPS5_RELINKER_ONLY=OFF, ANYPS5_ENABLE_SPIRV_TOOLS=OFF) stopped at Ninja action 784/2423 when free RAM reached 2,120,896,512 bytes, below the 2-GiB floor. No compiler/dependency error preceded the guard; full build is incomplete and was not restarted. The fresh focused build also emitted only CMake glob/deprecation notices before the RAM guard. Logs: full build C:/Users/admin/AppData/Local/Temp/opencode/anyps5-3946-fullbuild-20261012-011324.stdout.log and .stderr.log; focused build C:/Users/admin/AppData/Local/Temp/opencode/anyps5-3946-focused-build-20261012-014526.stdout.log and .stderr.log.
  • Full Linux/Windows PR CI was not dispatched; it requires a collaborator. No combined build/runtime with #4152 or title run is claimed.

Checklist

  • Based on current main as captured when rebased onto 2da042eee09fc3b3341fecfbeb33c9112d8591eb at 2026-10-12T01:33:37-03:00; no other open PR implements the same functions. A later live-main query returned e013f8c9c565e4a28be16268c93ec36c64baa34b; no further rebase was performed. #4152 edits the wrapper for separate pipeline-library behavior, not these diagnostics.
  • 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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4821765585 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3946). Originally posted by [danzaio](https://github.com/danzaio) on 2026-10-11T19:35:58Z. --- ### What Replaces #2867, which the intake bot closed and GitHub now refuses to reopen. Astro Bot (PPSA01284) was reported in #2062 with this failure: ```text computed/data-dependent s_swappc_b64 call target at program counter 0x00000074 is not statically resolvable ``` That message does not identify the shader address or stage. `PrepareShaderWithDiagnostics` adds a dynamic address/stage prefix and, when request capture succeeds, the dump filename to standard exceptions while preserving the complete message. It attempts the dump for non-standard exceptions too and rethrows those unchanged, even if dumping fails. This does not implement `s_swappc_b64` or claim gameplay progress. #4152 also edits this wrapper for pipeline-library registration. A file-level three-way merge using GitHub's actual merge base (`bca7a29d259299aaa8972c94d12694232bb3bb08`), #4152 head `14b52c1ac38d2f9c254299189e0bccba26bed752`, and this commit's source is clean. The combined branches were not built or run together. ### Tested - Current head: `56df893667a484c8e2e4057871f55804fca30f9f`, rebased onto captured main `2da042eee09fc3b3341fecfbeb33c9112d8591eb`. - Windows 10 x64, MinGW-w64 GCC 15.2.0. No title or homebrew run. - On prior local HEAD `0f24caf42b0f88f75b256ed12264616b727013d5`, `agc_driver_prepared_shaders_tests` built with `-j1`; all 9 `agc_driver_prepared_shaders*` CTests passed with `ANYPS5_REQUIRE_VULKAN=1` and `--timeout 30`. The final HEAD's `ShaderRegistry.cpp` has the same blob (`e31f423ba947a05a3bc96cc7b50a65515a51724f`). After rebase, an incremental target build was attempted with `-j1` and stopped at Ninja action 50/123 when free RAM fell to 1,848,635,392 bytes, below the 2-GiB floor. No compile error preceded the guard; the target did not finish, so CTest was not rerun on the rebased HEAD. - The external harness was compiled with `-std=c++23 -Wall -Wextra -Werror` and passed multiline-error, 324-character dump-path, non-standard exception, and dump-failure checks. Its extracted function exactly matches the final source (SHA-256 `ebd61616bdae2957d772f20c25f1813b22b6ef48b21ac83ba88ee47725697fdf`). - `python tools/check_conventions.py --base 2da042eee09fc3b3341fecfbeb33c9112d8591eb` and `git diff --check 2da042eee09fc3b3341fecfbeb33c9112d8591eb..HEAD` pass. - The prior full Release build attempt (`BUILD_TESTING=ON`, `ANYPS5_RELINKER_ONLY=OFF`, `ANYPS5_ENABLE_SPIRV_TOOLS=OFF`) stopped at Ninja action 784/2423 when free RAM reached 2,120,896,512 bytes, below the 2-GiB floor. No compiler/dependency error preceded the guard; full build is incomplete and was not restarted. The fresh focused build also emitted only CMake glob/deprecation notices before the RAM guard. Logs: full build `C:/Users/admin/AppData/Local/Temp/opencode/anyps5-3946-fullbuild-20261012-011324.stdout.log` and `.stderr.log`; focused build `C:/Users/admin/AppData/Local/Temp/opencode/anyps5-3946-focused-build-20261012-014526.stdout.log` and `.stderr.log`. - Full Linux/Windows PR CI was not dispatched; it requires a collaborator. No combined build/runtime with #4152 or title run is claimed. ### Checklist - [x] Based on current `main` as captured when rebased onto `2da042eee09fc3b3341fecfbeb33c9112d8591eb` at `2026-10-12T01:33:37-03:00`; no other open PR implements the same functions. A later live-main query returned `e013f8c9c565e4a28be16268c93ec36c64baa34b`; no further rebase was performed. #4152 edits the wrapper for separate pipeline-library behavior, not these diagnostics. - [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 - [x] AI-assisted: yes
oneandonlydean commented 2026-10-11 23:19:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:19:25Z.


The wrapper cuts the reason at its first newline (ShaderRegistry.cpp:40), so the rest of a multi-line recompiler error is lost. Please keep the whole message after the prefix.

Two smaller things in the same function:

  • char where[128] truncates a long dump path; build the prefix as a std::string.
  • The trailing catch (...) { throw; } no longer writes the request dump that main writes for every throw.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115028072 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3946#issuecomment-6115028072). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T23:19:25Z. --- The wrapper cuts the reason at its first newline (`ShaderRegistry.cpp:40`), so the rest of a multi-line recompiler error is lost. Please keep the whole message after the prefix. Two smaller things in the same function: - `char where[128]` truncates a long dump path; build the prefix as a `std::string`. - The trailing `catch (...) { throw; }` no longer writes the request dump that main writes for every throw.
danzaio commented 2026-10-12 02:55:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by danzaio on 2026-10-12T02:55:14Z.


Updated 05a362d3c and rebased onto main 6253883de addressing all three points:

  • Kept the full recompiler error message after the prefix without truncating at newline (and updated the test expectation accordingly).
  • Built the prefix dynamically via std::ostringstream without a fixed-size char buffer.
  • Preserved the request dump in the trailing catch (...) before rethrowing.

Local conventions pass, git diff --check is clean, and 9/9 agc_driver_prepared_shaders* execution tests pass with ANYPS5_REQUIRE_VULKAN=1.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116911636 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3946#issuecomment-6116911636). Originally posted by [danzaio](https://github.com/danzaio) on 2026-10-12T02:55:14Z. --- Updated 05a362d3c and rebased onto main 6253883de addressing all three points: - Kept the full recompiler error message after the prefix without truncating at newline (and updated the test expectation accordingly). - Built the prefix dynamically via std::ostringstream without a fixed-size char buffer. - Preserved the request dump in the trailing catch (...) before rethrowing. Local conventions pass, git diff --check is clean, and 9/9 agc_driver_prepared_shaders* execution tests pass with ANYPS5_REQUIRE_VULKAN=1.
danzaio commented 2026-10-12 04:57:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by danzaio on 2026-10-12T04:57:28Z.


Dean's requested diagnostics are preserved: standard exceptions keep the full original message with the shader address and stage, and request dumping is attempted without swallowing non-standard exceptions. The file-level merge with #4152 is clean; its pipeline-library change is separate.

Current head is 56df893667a484c8e2e4057871f55804fca30f9f, rebased onto captured main 2da042eee09fc3b3341fecfbeb33c9112d8591eb. The 9/9 Vulkan CTests passed on pre-rebase 0f24caf with an identical wrapper. The post-rebase focused build and earlier full Release build both stopped at the 2-GiB RAM guard, so neither is a final-head/full-build pass. Could a collaborator run the manual full CI for this head against current main? No combined-runtime or gameplay validation is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118024915 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3946#issuecomment-6118024915). Originally posted by [danzaio](https://github.com/danzaio) on 2026-10-12T04:57:28Z. --- Dean's requested diagnostics are preserved: standard exceptions keep the full original message with the shader address and stage, and request dumping is attempted without swallowing non-standard exceptions. The file-level merge with #4152 is clean; its pipeline-library change is separate. Current head is `56df893667a484c8e2e4057871f55804fca30f9f`, rebased onto captured main `2da042eee09fc3b3341fecfbeb33c9112d8591eb`. The 9/9 Vulkan CTests passed on pre-rebase `0f24caf` with an identical wrapper. The post-rebase focused build and earlier full Release build both stopped at the 2-GiB RAM guard, so neither is a final-head/full-build pass. Could a collaborator run the manual full CI for this head against current `main`? No combined-runtime or gameplay validation is claimed.
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!3946
No description provided.