Skip to content

feat(agc-driver): report GPU capture as unavailable - #2851

Closed
alfalfa-star wants to merge 4 commits into
boykopovar:mainfrom
alfalfa-star:feat/agc-driver-capture-unavailable
Closed

alfalfa-star wants to merge 4 commits into
boykopovar:mainfrom
alfalfa-star:feat/agc-driver-capture-unavailable

Conversation

@alfalfa-star

@alfalfa-star alfalfa-star commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What

Implements the four libSceAgcDriver capture exports that still called NotImplemented_nid_no_patch:

  • sceAgcDriverRequestCaptureStart, sceAgcDriverRequestCaptureStop, sceAgcDriverTriggerCapture take no arguments and return DEBUG_UNAVAILABLE (0x8A6C1000), since no capture tool is attached. OpenAGC's agcdriver.h and SharpProspero's SceAgcDriver.cs both declare RequestCaptureStart without arguments. sceAgcDriverIsCaptureInProgress already returns false.
  • sceAgcDriverGetShaderDebuggingStatus returns 1.

Sources: OpenAGC returns the same code for the capture calls; whether a console with no capture attached does the same is unconfirmed. The value 1 is the constant OpenAGC reads from firmware 5.50 (rJUyMrDdxJg at 0x6740); what it means is unknown. Both are recorded in TechnicalDebt.

Tested

Linux (Arch, GCC), Release build, on main 57f96fd:

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. Adds the same DEBUG_UNAVAILABLE constant to Status.cpp and touches the same test as feat(agc-driver): report submit validation as unavailable #2849, so whichever merges second needs a rebase
  • AI-assisted: yes

🤖 Generated with Claude Code

alfalfa-star and others added 2 commits October 10, 2026 18:25
sceAgcDriverRequestCaptureStart, sceAgcDriverRequestCaptureStop and
sceAgcDriverTriggerCapture return DEBUG_UNAVAILABLE (0x8A6C1000), as
no capture tool is attached. sceAgcDriverGetShaderDebuggingStatus
returns the firmware's constant 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Progress report (66d577d → ae327c4)

📈 System libraries: 85.56% (+0.12%, +4 implemented functions)

✅ 4 implemented
Library Name
libSceAgcDriver sceAgcDriverGetShaderDebuggingStatus
libSceAgcDriver sceAgcDriverRequestCaptureStart
libSceAgcDriver sceAgcDriverRequestCaptureStop
libSceAgcDriver sceAgcDriverTriggerCapture

@github-actions github-actions Bot added docs agc libSceAgc* labels Oct 10, 2026
@alfalfa-star

Copy link
Copy Markdown
Contributor Author

The one failing job, write-watch (macos-15-intel), is the same write_watch_threads timeout as on #2699. The three repeats took 16.8 s, 23.3 s and then hit the 30 s limit. This PR only touches libSceAgcDriver and GuestAgcDriverResources.cpp, which that job does not build. In the last 100 Build runs this job failed 9 times, once on main. Could someone with rights rerun it?

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Same as #2849: which title calls these? For sceAgcDriverGetShaderDebuggingStatus the title would also show what the 1 means to it.

@screamm

screamm commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Windows validation of the current head 69be6331 merged onto main 91b13413.

Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including the libs target, NVIDIA RTX 4070.

  • ctest -j8 -E "^agc_driver_|^video_out_flip": 478/479, including guest_agc_driver_resources. The one failure was the GPU test agc_driver with a heap-corruption exit under -j8 load; it passes 2/2 when run alone on the same binaries, so I count it as load-related and unrelated to this change.
  • The other GPU execution tests (agc_driver_*) were not run; two of them fail on unchanged main on this host for unrelated reasons.

Validation run with Claude Code assistance.

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the Windows run and the clear TechnicalDebt entry. Before this can go in:

  • No title is named. @oneandonlydean asked which title calls these exports (and, for sceAgcDriverGetShaderDebuggingStatus, what the 1 means to it) and that is still unanswered. Please add the title ID and the log line where it stops on main.
  • core/libs/prx/libSceAgcDriver/State/src/Status.cpp:26,30,34,38: the returned values (0x8A6C1000 for the capture calls, 1 for the debugging status) come from one source (OpenAGC) and are unconfirmed on a console, as the PR itself says. Unverified codes should keep throwing until a title or a second source confirms them.
  • Status.cpp:24: sceAgcDriverRequestCaptureStart takes const char* here, but SharpProspero declares it without arguments (Interop/Agc/SceAgcDriver.cs:206). Please say which one the signature follows and why.

The red write-watch (macos-15-intel) job is the known write_watch_threads flake, not this change. Happy to look again once a title and a confirmed value are in.

alfalfa-star and others added 2 commits October 11, 2026 11:37
…ments

OpenAGC's agcdriver.h and SharpProspero's SceAgcDriver.cs both declare it
as taking no arguments; the const char* came from main's earlier stub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's conventions check now requires a silent stub to be listed in the
Silent stubs section; sceAgcDriverGetShaderDebuggingStatus returns a
constant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alfalfa-star

Copy link
Copy Markdown
Contributor Author

No title I can run reaches the capture exports on current main (90c152e):

I'm converting this to a draft until a title stops at it. Then I'll post the title ID and the log line and mark it ready.

Changed:

  • sceAgcDriverRequestCaptureStart now takes no arguments. OpenAGC's agcdriver.h and SharpProspero's SceAgcDriver.cs both declare it that way; the const char* came from main's earlier stub. The test calls it without arguments.
  • The entry moved under Silent stubs, as main's conventions check now requires.

On the values: I found no second source. sharpemu, REmu and shadPS4 only list the names, and prosper has no golden for them. They stay as in the PR until a title reaching them shows how it treats the result.

Tested: Linux, GCC, Release, RX 9070 XT (RADV): full ctest 813/813 (4 video_out_flip_* skipped) on main 90c152e merged with this branch, #2848 and #2853; tools/check_conventions.py passes.

AI-assisted: yes (Claude Code)

@alfalfa-star
alfalfa-star marked this pull request as draft October 11, 2026 09:45

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the signature fix and the TechnicalDebt entry; both look right, and guest_agc_driver_resources fails without the change and passes with it. Two points are still open:

  • No title is named. @oneandonlydean's question (which title calls sceAgcDriverRequestCaptureStart/Stop/TriggerCapture and sceAgcDriverGetShaderDebuggingStatus, and what the 1 means to it) is unanswered. Please add the title ID and the call site or log line where it stops on main; Astro's Playroom does not import any of them, so we cannot check it from our side.
  • core/libs/prx/libSceAgcDriver/State/src/Status.cpp:24,28,32,36: 0x8A6C1000 and the constant 1 come from a single source (OpenAGC) and are unconfirmed on a console. Where main threw, returning a plausible unverified value is not exact-or-throw. Either a second source or a title's observed behaviour, or keep these throwing.

RINNECODER added a commit to RINNECODER/AnyPS5 that referenced this pull request Oct 11, 2026
…l bridge (#373)

* Apply upstream open AGC PRs for the remaining stubbed imports

Ports upstream boykopovar/AnyPS5 open PRs into core/libs/prx (libs and
their tests only; docs excluded):
- boykopovar#2847 DCB/ACB marker span builders
- boykopovar#2848 occlusion query size queries
- boykopovar#2849 submit validation reported as unavailable
- boykopovar#2850 disabled shader instrumentation accepted
- boykopovar#2851 GPU capture reported as unavailable, shader debugging status
- boykopovar#1060 sceAgcAcquireMemSetEngine

Conflicts between the PRs (Unimplemented.cpp stubs and shared test
files) were resolved by keeping every change from both sides.

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

* Port libSceAgcDriver leaf imports and remaining libSceAgc rows to the Metal bridge

Binds the 35 libSceAgcDriver imports and 17 libSceAgc imports through
SceAgcImports without dereferencing guest pointers on the host:

- Driver leaf exports (resource registration, capture, submit
  validation, equeue queries) run the upstream bodies through prx bridge
  descriptors (upstream-prx/AgcDriver.cpp); the 7-argument registrations
  read user data from the caller stack.
- ACB flip and rendering wait emit the Metal driver packets, as the DCB
  rows do.
- Marker spans, occlusion sizes, shader instrumentation, AcquireMemSetEngine
  and branch _0300 patchers reuse upstream encoders on host copies.
- GetRegisterDefaults2(+Internal) publish the upstream tables in a guest
  window above the gate table; Create/UpdatePrimState run on host copies
  of the stage type and special registers.

New CTest anyps5_cpu_agc_driver_leaf is in NATIVE_REQUIRED_TESTS.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Same as #2849: closing until a title reaches these; the title will also settle the return values.

You're welcome to reopen this if you think it was closed by mistake or the situation changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants