Skip to content

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

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
danzaio:fix/shader-failure-address
Oct 12, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
danzaio:fix/shader-failure-address

Conversation

@danzaio

@danzaio danzaio commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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 perf(agc): build shader pipeline libraries when shaders are registered #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. perf(agc): build shader pipeline libraries when shaders are registered #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

@github-actions github-actions Bot added the agc libSceAgc* label Oct 11, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

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

danzaio commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Updated 05a362d and rebased onto main 6253883 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.

FailureCapture now requires the code address and stage in the diagnosed failure, with and without the request dump. Fails before the wrap, passes after. AI-assisted: yes.
PrepareShaderWithDiagnostics dumped the request but rethrew the raw error, so a failure never said which shader it came from. Wrap it with the shader address and stage, keeping the dump. AI-assisted: yes.
Capture the request once before rethrowing from the shared handler. Standard exceptions keep the shader address, stage, optional dump filename and full message; non-standard exceptions remain unchanged after capture.

AI-assisted: yes.
@danzaio
danzaio force-pushed the fix/shader-failure-address branch from 05a362d to 56df893 Compare October 12, 2026 04:56
@danzaio

danzaio commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

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.

@oneandonlydean oneandonlydean self-assigned this Oct 12, 2026
@oneandonlydean
oneandonlydean merged commit b40a0b1 into boykopovar:main Oct 12, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants