Skip to content

fix(libSceGnmDriver): guard workload output pointers - #18212

Merged
oneandonlydean merged 6 commits into
boykopovar:mainfrom
DonRyuzaki:feat/gnm-workload-lifecycle
Nov 18, 2026
Merged

oneandonlydean merged 6 commits into
boykopovar:mainfrom
DonRyuzaki:feat/gnm-workload-lifecycle

Conversation

@DonRyuzaki

@DonRyuzaki DonRyuzaki commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What

Current main merged #18235, which already exports the regular GNM workload lifecycle functions. This PR now guards the output pointers in sceGnmCreateWorkloadStream and sceGnmBeginWorkload with GuestCopyOut_nid_no_patch. An invalid guest output address returns the existing code 3 instead of being dereferenced. Valid outputs, stream boundaries, and sceGnmEndWorkload behavior stay as implemented on main. The NeoMode provider already uses GuestCopyOut_nid_no_patch.

The existing guest_gnm_driver test now checks invalid output addresses for both functions, including the invalid-stream path. This is a pointer-safety fix; no new exports are added.

Tested

Head 8c362ff625287d52b6096239da42bd2facce8e40, merged with upstream main 1a4e8ab22c2f050cbaa177480fe98e11d187e9c1. The patch against that main changes only core/libs/prx/libSceGnmDriver/Export.cpp and core/libs/tests/GuestGnmDriver.cpp.

  • Ubuntu 24.04 under WSL2, GCC 13.3, CMake/Ninja Release, bundled dependencies, BUILD_TESTING=ON: cmake --build build --target guest_gnm_driver_tests --parallel 8 passed on the merged tree.
  • ctest --test-dir build --no-tests=error --output-on-failure -R '^guest_gnm_driver$': 1/1 passed on that tree.
  • git diff --check upstream/main HEAD and python3 -B tools/check_conventions.py --base upstream/main: passed on the committed head.
  • Hosted checks on this head are in progress. No game, console, or GPU execution is claimed.

Checklist

  • Based on current main; no other open PR implements this pointer-safety fix
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@JJenkx

JJenkx commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Windows check of head c3f27a5c00, merged onto main 9d90186563 (2d770219b7, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.

  • guest_gnm_driver passes in 3 of 3 runs, none skipped.

AI-assisted: yes.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Exports with a name or library/NID already present in main:

  • sceGnmBeginWorkload (same library/NID already present: core/libs/prx/libSceGnmDriver (ihxrbsoSKWc))
  • sceGnmBeginWorkload (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmCreateWorkloadStream (same library/NID already present: core/libs/prx/libSceGnmDriver (5udAm+6boVg))
  • sceGnmCreateWorkloadStream (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)
  • sceGnmEndWorkload (same library/NID already present: core/libs/prx/libSceGnmDriver (Fa3x75OOLRA))
  • sceGnmEndWorkload (also exported by another library in main: core/libs/prx/libSceGnmDriverForNeoMode; may be intentional)

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 16238 core/libs/prx/libSceGnmDriverForNeoMode/Export.cpp
PR 17711 core/libs/prx/libSceGnmDriver/Export.cpp
core/libs/prx/libSceGnmDriver/include/Api.hpp
core/libs/prx/libSceGnmDriverForNeoMode/Export.cpp
docs/dev/debt/libSceGnmDriver.md
PR 20730 core/libs/prx/libSceGnmDriver/Export.cpp
PR 21225 core/libs/prx/libSceGnmDriver/Export.cpp
PR 22375 core/libs/prx/libSceGnmDriver/Export.cpp

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Workload lifecycle exports for the regular GNM driver — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head c1d72b98d982407ab3a7649d24cb7bddbce7eaa2, base main.
  • Read the PR description, the commit list, the manifest, and the changed hunks of all six reviewed files in diff.patch. Read the head of core/libs/tests/GuestGnmDriver.cpp (lines 1–30) through the reader.
  • Files read: 6 of 6 reviewed, as diff hunks only. No files were excluded.
  • No build and no test run.
python3 repo_read.py search "5udAm+6boVg"
python3 repo_read.py search "_nid_disambig1"
python3 repo_read.py cat core/libs/tests/GuestGnmDriver.cpp 1 30

Results

Check Result Note
Logic against description passed Helper rules match the stated ones
Neo provider behavior passed Moved bodies are unchanged
Guest test assertions not run Read against the code, not executed
Build and guest tests not run Author-reported only
Hosted CI not run Not checked

Findings

Blocking: none.

Non-blocking: none found in the changed lines.

Not verified

  • The NID values 5udAm+6boVg, ihxrbsoSKWc and Fa3x75OOLRA. The repository has no text match for them, and the NID mapping comes from build tooling that I did not check.
  • The shadPS4 behavior the description cites. I did not fetch it.
  • The build, the guest test runs and the PRX SHA-256 values. They are author-reported and were not run here.
  • Hosted CI on this head.
  • Overlap with open PRs #17393, #17711, #17942, #16882, #16238, #16360 and #6977.
  • Full text at the head of Export.cpp (both providers), Api.hpp, the rest of GuestGnmDriver.cpp and the debt file. I read only the diff hunks of these.
  • Console behavior of the three calls, which the description says is unmeasured.

To get this to a good state

Nothing is required.

…-20261115

# Conflicts:
#	core/libs/prx/libSceGnmDriver/Export.cpp
#	core/libs/prx/libSceGnmDriverForNeoMode/Export.cpp
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 15, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 17, 2026
@DonRyuzaki DonRyuzaki changed the title feat(gnm): expose regular workload lifecycle fix(libSceGnmDriver): guard workload output pointers Nov 18, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 18, 2026
@oneandonlydean
oneandonlydean merged commit 9b1d983 into boykopovar:main Nov 18, 2026
14 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants