feat(libSceGnmDriver): export the workload, trace and tessellation si… #18235

Merged
erickerxhalli merged 3 commits from upstream-pr/18235 into main 2026-11-17 21:54:15 +00:00
erickerxhalli commented 2026-11-10 22:54:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by erickerxhalli on 2026-11-10T22:54:18Z.


What

Adds five exports to libSceGnmDriver that only libSceGnmDriverForNeoMode provided, so a title importing them from libSceGnmDriver stopped at load. They are 5 of the 47 imports listed in #17581 (inFAMOUS Second Son, CUSA00223, bring-up #8214); the issue stays open for the rest.

Function Export NID
sceGnmCreateWorkloadStream sceGnmCreateWorkloadStream_nid_disambig1 5udAm+6boVg
sceGnmBeginWorkload sceGnmBeginWorkload_nid_disambig1 ihxrbsoSKWc
sceGnmEndWorkload sceGnmEndWorkload_nid_disambig1 Fa3x75OOLRA
sceGnmDriverTraceInProgress sceGnmDriverTraceInProgress_nid_disambig1 R6z1xM3pW-w
sceGnmGetOffChipTessellationBufferSize sceGnmGetOffChipTessellationBufferSize_nid_disambig1 FFVZcCu3zWU

Source: shadPS4 f46a693c802f2d60573e07927b5fdaa753136567, src/core/libraries/gnmdriver/gnmdriver.cpp lines 168, 215, 906, 918 and 1000. None of the five reads the Neo mode there, and it keeps no stream or workload state; neither does this change. Nothing here is measured on a console, which docs/dev/debt/libSceGnmDriver.md records (Workload streams under Functional, and sceGnmDriverTraceInProgress added to the existing Silent stubs entry).

The functions carry the _nid_disambig1 suffix, as #17711 and #17942 do for the names the Neo provider already declares.

Overlap, checked against the merge refs of the open pull requests: none adds these names or NIDs to libSceGnmDriver (#17393, #16238 and #16463 mention them for the Neo provider only). #16882, #17711 and #17942 change the same files; a three-way merge with each is clean.

Tested

Ubuntu 24.04, GCC 13.3.0, Release, no title:

  • ctest --test-dir build -R '^guest_gnm_driver$' passes with the new TestWorkloads.

  • Twelve mutations of the five functions each fail the test: create accepting a null name, create storing 2, the begin boundary at 15 and at 17, begin storing 32 bits, begin checking the stream before the output, the end shift at 48, the end boundary at 15 and at 17, end accepting 0, another tessellation size, trace returning true.

  • python3 tools/check_conventions.py --base upstream/main and python3 core/libs/tests/test_public_headers.py --audit-only pass.

  • Full build with libs, then ctest --test-dir build --timeout 120 --parallel 4: of 4774 tests, 20 fail and 1128 are skipped. The 20 are socket tests (guest_net_*, guest_sce_net_keepalive, guest_socket_*, guest_tcp) on a container without IPv6, where creating an AF_INET6 socket fails; they were not run on main for comparison. The skips are the tests that need a Vulkan device, which the container lacks, so gnm_driver_submit_wait did not run.

Windows (windows-latest, WinLibs GCC 15.2.0), the windows job of build.yml with this branch merged into main at 07ae6afcee, run on the fork: the full build, libs, ctest (4885 tests registered) and check_skips.py pass. https://github.com/erickerxhalli/AnyPS5-fork/actions/runs/42767204852

Not tested on a title: CUSA00223 still stops on the other imports of #17581.

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 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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5250373378 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18235). Originally posted by [erickerxhalli](https://github.com/erickerxhalli) on 2026-11-10T22:54:18Z. --- ### What Adds five exports to `libSceGnmDriver` that only `libSceGnmDriverForNeoMode` provided, so a title importing them from `libSceGnmDriver` stopped at load. They are 5 of the 47 imports listed in #17581 (inFAMOUS Second Son, CUSA00223, bring-up #8214); the issue stays open for the rest. | Function | Export | NID | |---|---|---| | sceGnmCreateWorkloadStream | sceGnmCreateWorkloadStream_nid_disambig1 | 5udAm+6boVg | | sceGnmBeginWorkload | sceGnmBeginWorkload_nid_disambig1 | ihxrbsoSKWc | | sceGnmEndWorkload | sceGnmEndWorkload_nid_disambig1 | Fa3x75OOLRA | | sceGnmDriverTraceInProgress | sceGnmDriverTraceInProgress_nid_disambig1 | R6z1xM3pW-w | | sceGnmGetOffChipTessellationBufferSize | sceGnmGetOffChipTessellationBufferSize_nid_disambig1 | FFVZcCu3zWU | Source: shadPS4 `f46a693c802f2d60573e07927b5fdaa753136567`, `src/core/libraries/gnmdriver/gnmdriver.cpp` lines 168, 215, 906, 918 and 1000. None of the five reads the Neo mode there, and it keeps no stream or workload state; neither does this change. Nothing here is measured on a console, which `docs/dev/debt/libSceGnmDriver.md` records (Workload streams under Functional, and `sceGnmDriverTraceInProgress` added to the existing Silent stubs entry). The functions carry the `_nid_disambig1` suffix, as #17711 and #17942 do for the names the Neo provider already declares. Overlap, checked against the merge refs of the open pull requests: none adds these names or NIDs to `libSceGnmDriver` (#17393, #16238 and #16463 mention them for the Neo provider only). #16882, #17711 and #17942 change the same files; a three-way merge with each is clean. ### Tested Ubuntu 24.04, GCC 13.3.0, Release, no title: - `ctest --test-dir build -R '^guest_gnm_driver$'` passes with the new `TestWorkloads`. - Twelve mutations of the five functions each fail the test: create accepting a null name, create storing 2, the begin boundary at 15 and at 17, begin storing 32 bits, begin checking the stream before the output, the end shift at 48, the end boundary at 15 and at 17, end accepting 0, another tessellation size, trace returning true. - `python3 tools/check_conventions.py --base upstream/main` and `python3 core/libs/tests/test_public_headers.py --audit-only` pass. - Full build with `libs`, then `ctest --test-dir build --timeout 120 --parallel 4`: of 4774 tests, 20 fail and 1128 are skipped. The 20 are socket tests (`guest_net_*`, `guest_sce_net_keepalive`, `guest_socket_*`, `guest_tcp`) on a container without IPv6, where creating an `AF_INET6` socket fails; they were not run on `main` for comparison. The skips are the tests that need a Vulkan device, which the container lacks, so `gnm_driver_submit_wait` did not run. Windows (`windows-latest`, WinLibs GCC 15.2.0), the `windows` job of `build.yml` with this branch merged into `main` at 07ae6afcee, run on the fork: the full build, `libs`, `ctest` (4885 tests registered) and `check_skips.py` pass. https://github.com/erickerxhalli/AnyPS5-fork/actions/runs/42767204852 Not tested on a title: CUSA00223 still stops on the other imports of #17581. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-10 23:02:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-10T23:02:53Z.

Review: COMMENTED


Reviewed — no blocking findings

The five implementations are present and match the referenced PS4 behavior; I found a non-blocking name/NID mismatch in the PR description, and the required Windows check is still pending.

What I ran

Head 94add35100dad5ed57c1ddec0a4ce022ada9063c; base 8356b8bbea97649ff0d1185df0a631a814975fa1. The PR is open and mergeable. The no-build stack check produced a clean merge preview against that base; I did not build the preview.

Environment: Linux 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0.

I read all four changed files, their full diff, the PR discussion, and the linked issue. I ran the exact-head no-build precheck and checked the export-name/NID calculation:

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 18235 --output-dir /tmp/anyps5-pr-precheck-18235
python3 tools/pr_abi_audit.py --base 8356b8bbea97649ff0d1185df0a631a814975fa1 --head 94add35100dad5ed57c1ddec0a4ce022ada9063c --json
python3 - <<'PY'
from tools.nid_names import compute_nid
for name in ('sceGnmCreateWorkloadStream', 'sceGnmBeginWorkload', 'sceGnmEndWorkload'):
    print(name, compute_nid(name))
PY

I did not run a local build or CTest. I read the GitHub checks as a status snapshot.

Results

Check Result Note
Applicable no-build checks passed Diff, conventions, export audit, stack check and test heuristic completed.
Test registration passed The heuristic warning is a false positive; CMake explicitly registers guest_gnm_driver.
Local build and CTest not run The fast review pass excludes build-dependent checks.
Hosted checks not run Windows was pending; seven build jobs were skipped in the snapshot.
Full precheck table and relevant output
Check Status Why
build_and_compile not_run Builds are intentionally excluded from this fast, no-build check pass.
diff_check passed git diff --check completed with exit 0.
conventions_and_pr_template passed Completed with exit 0.
changed_export_abi_audit passed Completed with exit 0.
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed Python tool module has a related test suite.
python_test_registration not_applicable No changed Python tests need registration.
live_dependency_and_mergeability_check passed The exact-head merge preview was clean.
build_dependent_cpp_tests not_run This no-build pass does not compile changed C++ sources or tests.
test_quality_heuristics passed Heuristic emitted a test-registration warning; CMake registration was verified manually.
negative_controls not_applicable No changed Python tool tests are eligible.

Conventions output:

All conventions checks passed.

Name-derived NIDs after stripping _nid_disambig1:

sceGnmCreateWorkloadStream 5udAm+6boVg
sceGnmBeginWorkload ihxrbsoSKWc
sceGnmEndWorkload Fa3x75OOLRA

The test-quality warning was possible-unregistered-cpp-test; core/libs/prx/libSceGnmDriver/CMakeLists.txt registers GuestGnmDriver.cpp as guest_gnm_driver.

Negative control

Assertion Change made to code under test Result
Workload create/begin/end boundary and return behavior The author reports 12 mutations, including changed stream boundaries, output values, error checks, end-workload limits, and tessellation size. The author reports all 12 made the new test fail; I did not independently run these mutations.

Findings

Blocking

None found in the four changed files.

Non-blocking

The PR description’s table assigns the three workload NIDs to the wrong names. The code’s name-derived exports are CreateWorkloadStream → 5udAm+6boVg, BeginWorkload → ihxrbsoSKWc, and EndWorkload → Fa3x75OOLRA; the table currently rotates those three values. Please correct the table. The implementation itself uses the corresponding name-derived exports, so this documentation mismatch does not prevent the listed imports from resolving.

Sources

Not verified

  • I did not build the PR or run its C++ tests locally. A reviewer comment reports the Windows guest_gnm_driver test passed three times on this head; I did not reproduce it.
  • The author reports 20 Linux socket-test failures in a container without IPv6 and did not compare them with main, so I cannot confirm that they predate this change.
  • GitHub's Windows check was still pending at the final status read; the other seven build jobs were skipped.
  • No PS4/PS5 console measurement was provided; the debt entry correctly records that limitation.

To get this to a good state

Correct the three name/NID pairs in the PR description. I will recheck the exact head and required hosted checks before considering a later approval; if the code head changes, I will rerun the same no-build precheck and review the new diff.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5850852624 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18235#pullrequestreview-5850852624). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-10T23:02:53Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The five implementations are present and match the referenced PS4 behavior; I found a non-blocking name/NID mismatch in the PR description, and the required Windows check is still pending. ## What I ran Head `94add35100dad5ed57c1ddec0a4ce022ada9063c`; base `8356b8bbea97649ff0d1185df0a631a814975fa1`. The PR is open and mergeable. The no-build stack check produced a clean merge preview against that base; I did not build the preview. Environment: Linux 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0. I read all four changed files, their full diff, the PR discussion, and the linked issue. I ran the exact-head no-build precheck and checked the export-name/NID calculation: ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 18235 --output-dir /tmp/anyps5-pr-precheck-18235 python3 tools/pr_abi_audit.py --base 8356b8bbea97649ff0d1185df0a631a814975fa1 --head 94add35100dad5ed57c1ddec0a4ce022ada9063c --json python3 - <<'PY' from tools.nid_names import compute_nid for name in ('sceGnmCreateWorkloadStream', 'sceGnmBeginWorkload', 'sceGnmEndWorkload'): print(name, compute_nid(name)) PY ``` I did not run a local build or CTest. I read the GitHub checks as a status snapshot. ## Results | Check | Result | Note | |---|---|---| | Applicable no-build checks | passed | Diff, conventions, export audit, stack check and test heuristic completed. | | Test registration | passed | The heuristic warning is a false positive; CMake explicitly registers `guest_gnm_driver`. | | Local build and CTest | not run | The fast review pass excludes build-dependent checks. | | Hosted checks | not run | Windows was pending; seven build jobs were skipped in the snapshot. | <details> <summary>Full precheck table and relevant output</summary> | Check | Status | Why | |---|---|---| | build_and_compile | not_run | Builds are intentionally excluded from this fast, no-build check pass. | | diff_check | passed | `git diff --check` completed with exit 0. | | conventions_and_pr_template | passed | Completed with exit 0. | | changed_export_abi_audit | passed | Completed with exit 0. | | python_syntax | not_applicable | No changed Python implementation files. | | related_python_unit_tests | not_applicable | No changed Python tool module has a related test suite. | | python_test_registration | not_applicable | No changed Python tests need registration. | | live_dependency_and_mergeability_check | passed | The exact-head merge preview was clean. | | build_dependent_cpp_tests | not_run | This no-build pass does not compile changed C++ sources or tests. | | test_quality_heuristics | passed | Heuristic emitted a test-registration warning; CMake registration was verified manually. | | negative_controls | not_applicable | No changed Python tool tests are eligible. | Conventions output: ```text All conventions checks passed. ``` Name-derived NIDs after stripping `_nid_disambig1`: ```text sceGnmCreateWorkloadStream 5udAm+6boVg sceGnmBeginWorkload ihxrbsoSKWc sceGnmEndWorkload Fa3x75OOLRA ``` The test-quality warning was `possible-unregistered-cpp-test`; `core/libs/prx/libSceGnmDriver/CMakeLists.txt` registers `GuestGnmDriver.cpp` as `guest_gnm_driver`. </details> ## Negative control | Assertion | Change made to code under test | Result | |---|---|---| | Workload create/begin/end boundary and return behavior | The author reports 12 mutations, including changed stream boundaries, output values, error checks, end-workload limits, and tessellation size. | The author reports all 12 made the new test fail; I did not independently run these mutations. | ## Findings ### Blocking None found in the four changed files. ### Non-blocking The PR description’s table assigns the three workload NIDs to the wrong names. The code’s name-derived exports are `CreateWorkloadStream` → `5udAm+6boVg`, `BeginWorkload` → `ihxrbsoSKWc`, and `EndWorkload` → `Fa3x75OOLRA`; the table currently rotates those three values. Please correct the table. The implementation itself uses the corresponding name-derived exports, so this documentation mismatch does not prevent the listed imports from resolving. ## Sources - [Export implementations at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/94add35100dad5ed57c1ddec0a4ce022ada9063c/core/libs/prx/libSceGnmDriver/Export.cpp#L511-L534) - [NID hashing and suffix normalization at the checked base](https://github.com/boykopovar/AnyPS5/blob/8356b8bbea97649ff0d1185df0a631a814975fa1/tools/nid_names.py#L32-L39) - [CMake registration of the guest test at the checked base](https://github.com/boykopovar/AnyPS5/blob/8356b8bbea97649ff0d1185df0a631a814975fa1/core/libs/prx/libSceGnmDriver/CMakeLists.txt#L6-L12) - [Referenced PS4 implementation at commit f46a693c](https://github.com/shadps4-emu/shadPS4/blob/f46a693c802f2d60573e07927b5fdaa753136567/src/core/libraries/gnmdriver/gnmdriver.cpp#L168-L173) ## Not verified - I did not build the PR or run its C++ tests locally. A reviewer comment reports the Windows `guest_gnm_driver` test passed three times on this head; I did not reproduce it. - The author reports 20 Linux socket-test failures in a container without IPv6 and did not compare them with `main`, so I cannot confirm that they predate this change. - GitHub's Windows check was still pending at the final status read; the other seven build jobs were skipped. - No PS4/PS5 console measurement was provided; the debt entry correctly records that limitation. ## To get this to a good state Correct the three name/NID pairs in the PR description. I will recheck the exact head and required hosted checks before considering a later approval; if the code head changes, I will rerun the same no-build precheck and review the new diff.
MarcZX10 commented 2026-11-14 03:01:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T03:01:22Z.

Review: APPROVED


Reviewed — looks good

Nothing in the inspected changes shows a verified defect; the implementation follows the documented shadPS4 behavior, and the PR reports focused tests and build checks.

What I ran

Reviewed head 90662f4f47ffc778cb32eabd010ebcf784d38fbb. Read the prepared description, commit list, manifest, diff, and all four changed files. No commands or tests were run; reported test results are author-provided. The reader was repo_read.py.

Results

Check Result Note
Changed code review passed All four changed files read
Tests in this review not run Author reports focused and full-suite runs

Findings

Blocking

None.

Non-blocking

None.

Not verified

Console behavior is unmeasured, and the title was not tested. The reported Linux and Windows checks were not independently run. No files were excluded from the manifest; all four changed files were read.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5901117128 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18235#pullrequestreview-5901117128). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T03:01:22Z. **Review:** APPROVED --- # Reviewed — looks good Nothing in the inspected changes shows a verified defect; the implementation follows the documented shadPS4 behavior, and the PR reports focused tests and build checks. ## What I ran Reviewed head `90662f4f47ffc778cb32eabd010ebcf784d38fbb`. Read the prepared description, commit list, manifest, diff, and all four changed files. No commands or tests were run; reported test results are author-provided. The reader was `repo_read.py`. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | All four changed files read | | Tests in this review | not run | Author reports focused and full-suite runs | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Console behavior is unmeasured, and the title was not tested. The reported Linux and Windows checks were not independently run. No files were excluded from the manifest; all four changed files were read. ## To get this to a good state Nothing is required.
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!18235
No description provided.