Skip to content

feat(agc): accept disabled shader instrumentation - #2850

Closed
alfalfa-star wants to merge 3 commits into
boykopovar:mainfrom
alfalfa-star:feat/agc-shader-instrumentation
Closed

alfalfa-star wants to merge 3 commits into
boykopovar:mainfrom
alfalfa-star:feat/agc-shader-instrumentation

Conversation

@alfalfa-star

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

Copy link
Copy Markdown
Contributor

What

Implements the two libSceAgc shader instrumentation exports that still called NotImplemented_nid_no_patch:

  • sceAgcSetShaderInstrumentation(flags) accepts 0 and throws for any other value, because what the flags change is unknown.
  • sceAgcGetShaderInstrumentation() returns 0.

Source: OpenAGC describes a title's bundled module storing the flags and the getter returning them; it accepts any value. Accepting only 0 is this PR's choice, not a measured behaviour: what non-zero flags change on a console is unknown, so they throw rather than being stored without effect. Recorded in TechnicalDebt under Silent stubs.

Tested

Linux (Arch, GCC), Release build:

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
  • AI-assisted: yes

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Progress report (097f4e2 → 095dcee)

📈 System libraries: 85.47% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceAgc sceAgcGetShaderInstrumentation

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

Copy link
Copy Markdown
Collaborator

Which title calls sceAgcSetShaderInstrumentation on main? As it stands nothing is implemented beyond accepting 0, so without a title stopping at it I'd close it.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 10, 2026
@screamm

screamm commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Tried to validate the current head e90ae6f1 on Windows: it no longer merges with main (262c0316 and later). git merge main conflicts in core/libs/prx/libSceAgc/Unimplemented.cpp (both sides remove neighbouring stubs), and GitHub reports the branch as conflicting. A rebase is needed before it can be built as the merge commit; happy to rerun after that.

@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 PR. Two things before this can go in:

  • @oneandonlydean asked which title calls sceAgcSetShaderInstrumentation on main and that is still unanswered. Please name the title (PPSA id) and where it stops, or attach a log. Astro's Playroom doesn't import either export, so we have no evidence of use. Without a caller this only moves the progress metric.
  • The branch conflicts with main in core/libs/prx/libSceAgc/Unimplemented.cpp (as @screamm also found). Please rebase and rerun the tests.

Also, the cited OpenAGC code stores the flags and returns them from the getter; it doesn't throw on non-zero values. State in the PR and TechnicalDebt that "accept only 0" is your choice and why, since no PS5 measurement backs it.

If no title needs it, we'll close it; feel free to reopen later with a caller.

@Mouhand-Kaddo

Copy link
Copy Markdown
Contributor

Additional platform validation of standalone PR head e90ae6f15b3bd0a0920a2af73de12764eaf86301 (2026-10-11):

Windows: passed — Windows 11, WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja; Release, BUILD_TESTING=ON.

1 checks, 0 failures, 0 CTest skips. Built the selected targets and dependencies; this is focused validation, not a full build or full-suite run.

Checks: agc_platform_tests.

Command after building: ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_platform_tests$".

This scope checks CPU-side behavior; no GPU execution result is claimed.

No title/gameplay validation. These results cover the standalone head, not a merge with current main.

alfalfa-star and others added 2 commits October 11, 2026 11:36
sceAgcSetShaderInstrumentation accepts flags 0 and throws for others, as
what the flags change is unknown; sceAgcGetShaderInstrumentation
returns 0.

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

OpenAGC stores any flags and returns them from the getter. No PS5
measurement shows what non-zero flags do, so throwing for them is this
project's choice; TechnicalDebt now says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alfalfa-star
alfalfa-star force-pushed the feat/agc-shader-instrumentation branch from e90ae6f to b5619b8 Compare October 11, 2026 09:36
Main's conventions check now requires a silent stub to be listed in the
Silent stubs section; the getter returns 0 without reading any state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 11, 2026

@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 rebase and the TechnicalDebt wording; build and agc_platform_tests pass here, and the new test fails without the change.

One point is still open: @oneandonlydean's question. Which title (PPSA id) calls sceAgcSetShaderInstrumentation, and where does it stop? Astro's Playroom doesn't import either export and the only source is OpenAGC, so without a caller this only moves the progress metric. Please name the title or attach a log; otherwise we'll close it (feel free to reopen with a caller).

@alfalfa-star

Copy link
Copy Markdown
Contributor Author

No title I can run reaches sceAgcSetShaderInstrumentation 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 (rebased onto main, which resolves the Unimplemented.cpp conflict):

  • TechnicalDebt now says that OpenAGC stores any flags, and that accepting only 0 is this project's choice, not a measured behaviour.
  • The entry moved under Silent stubs, which main's conventions check now requires for the getter.

Tested: Linux, GCC, Release, RX 9070 XT (RADV): full ctest 813/813 (4 video_out_flip_* skipped) on main 90c152e merged with this branch, #2847, #2849 and #2852; 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
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>
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 11, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

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

Labels

agc libSceAgc* docs needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants