feat(libSceGnmDriver): expose base draw default state #18206
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18206"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by DonRyuzaki on 2026-11-10T21:00:37Z.
What
GTA V (CUSA00419, bring-up #18084) imports NID
Idffwf3yh8sassceGnmDrawInitDefaultHardwareStatefrom the regularlibSceGnmDriver. Currentmainprovides that name only fromlibSceGnmDriverForNeoMode, so the regular PRX leaves the import unresolved. Add a regular-provider export, using_nid_disambig1to keep its host symbol distinct while retaining the guest NID.Share the existing 256-dword draw-state writer with
sceGnmDrawInitDefaultHardwareState175, selectingSC_MODE_CNTL_1 = 0x06000000for the unversioned function and preserving0x06020000for 175. Both refuse a buffer shorter than 256 dwords without writing. The pinned shadPS4 writer and packet arrays use this signature and sequence; their base and 175 arrays differ in only that mode word. The existing GNM technical debt records that these packets have not been checked on a console. Null and invalid-pointer behavior is also unmeasured; this follows the existing regular 175 writer's size-first path, without a new success fallback.This change is independent of #18087's
_padebugdependency mapping. It removes one regular-library import gap; the title was not retested and still has the other local conversion/runtime dependencies listed in #18084. No title-start or in-game claim is made.Tested
Latest refresh (15 November 2026): current head
21ec57969d7deec7fbd045670cfdd5960617067eincludes upstream maineef73731fc926d18e3e8b19849ed42511a1adb09and merged #20844, which fixes the shared ICU test linker error that caused the preceding Windows Build failure. This PR’s patch relative to main remains confined to its intended files. The diff check andtools/check_conventions.pypassed on this current head. The GNM driver targets built andguest_gnm_driverplusguest_gnm_driver_init_modespassed (2/2) on prior head3235048a3b356d9afc8df3bfcad684e72000a06f. The current-head Build, Progress report, and Emscripten portability workflows passed; previous evidence below applies to its stated older heads.2d27859b056cf252cb76ce8e564905f5d143583c: built the regular GNM library and guest test (144 steps) and the NID-patched regular PRX (1,371 aggregate dependency steps). The existingguest_gnm_driverpassed. Its patched regular PRX (SHA-256796e157100911a363675889860f8f2e0f357553e68d4234317dec767c8ea489e) exported neighboring 175 NIDQhnyReteJ1Mbut notIdffwf3yh8s.sceGnmDrawInitDefaultHardwareState_nid_disambig1.libsplus guest-test build passed (811 steps; 407 patched PRXs).guest_gnm_driverpassed 3/3,gnm_driver_packetsandgnm_driver_submit_waitpassed 3/3 each, andpublic_headerspassed (407 libraries, 33,858 exports). The regular PRX (SHA-256ab0fe5e48f92a7908f5ed90ece2bf51ef16cc8badb505c1c60f868f1e9acec04) exported both NIDs; a separate dynamic lookup and call ofIdffwf3yh8son that PRX returned 256 complete packet dwords with the base mode and left the next dword untouched. The source files were byte-identical to the rebased commit below.b491fb2bc5c4e669e4dfe4aa75324d7154080656is based on02c52411e5b4df59e192301818182a228a9d353b. The intervening main commits changed no GNM implementation, guest-test, or GNM-debt files. Rebuilt the guest test and NID-patched regular PRX from the final source (639 steps);guest_gnm_driverpassed 3/3,public_headerspassed (407 libraries, 33,860 exports), and dynamic NID lookup/call passed again.check_conventions.py --base origin/mainandgit diff --checkpassed on this head.pr_overlap.py --branchwas attempted but could not start becauseghis unavailable. I manually compared the open #16882, #17711, #17942, #6977 and #18087 changes/comments; none implements this regular-provider export. #17942 touches a nearby API hunk and may need a routine rebase if it merges first.Rebased-head validation (November 10)
The current head is
c763323258dceaf91c8d4bf1b6a16ceaf72144a2, rebased onto upstream4306c608e2a552d5c96f11679332a222a4683ef9with the two worker-spin fixes. The feature patch is unchanged. On this exact source, the full Linuxlibstarget andguest_gnm_driver_testsrebuilt successfully (831 pending steps, two below-normal compiler jobs).guest_gnm_driverandpublic_headerseach passed three consecutive runs (6/6, no skips); the changed source files matched this head byte-for-byte. The earlier dynamic NID and packet test was on the prior head and has not been repeated on this rebase. Emscripten portability, Progress report and Conventions passed on the new head; the hosted Windows job passed. Hosted Linux and specialized PR jobs were skipped.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-10T21:04:32Z.
Review: COMMENTED
Reviewed — looks good
The new entry point shares the existing packet writer and changes only
SC_MODE_CNTL_1; I found no code-level blocker, but I’m leaving a comment until the Windows job completes.What I ran
Reviewed head
b491fb2bc5c4e669e4dfe4aa75324d7154080656against livemaind66e6aac01bdf52b7a0a97b255a4110e2efe03a3; the merge preview is clean. The PR API still showed base0aa98c0a07c74b1ebc8b9389185b6ff1d2978b38; livemainhad advanced tod66e6aac01bdf52b7a0a97b255a4110e2efe03a3, which the precheck used. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0.I read all three changed files. No local build or CTest was run.
Results
Idffwf3yh8sfor the new symbol.guest_gnm_driver3/3, related packet tests, public-header audit, and dynamic lookup/call passed; I did not reproduce them locally.Recorded local output
Diff check:
Conventions:
Merge preview:
Hosted checks at the time of review:
Findings
Blocking
None found.
Non-blocking
None.
Sources
Not verified
To get this to a good state
No code changes are requested. Let the Windows job finish; I will refresh its result before changing this review status.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T21:18:00Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
Head reviewed:
c763323258dceaf91c8d4bf1b6a16ceaf72144a2(PR #18206, basemain). The change adds a regular-library export forsceGnmDrawInitDefaultHardwareStateand moves the 256-dword writer into a shared helper that the 175 export also uses.What I ran
Read-only repository reads at the pinned head with
repo_read.py. No build and no test run in this review.The NID searches returned no matches. That is expected, because the source names functions and does not contain their NID hashes.
Results
Findings
Blocking
None.
Non-blocking
None.
Checked and no defect found:
core/libs/prx/libSceGnmDriver/Export.cpp:110-119: the shared helper keeps the old 175 order (CONTEXT_CONTROL, CLEAR_STATE, ACQUIRE_MEM, state, NOP pad) and returns 0 before writing when the buffer is under 256 dwords. The only difference from the old 175 body is the mode word, now a parameter.core/libs/prx/libSceGnmDriver/Export.cpp:404-409: the unversioned export passes0x6000000and the 175 export passes0x6020000, so 175 behaviour is unchanged.core/libs/tests/GuestGnmDriver.cpp:62-78: the new checks compare the base and 175 outputs word by word and allow only theSC_MODE_CNTL_1value to differ. The header layout they read matchesHeaderatExport.cpp:76-78.Not verified
Idffwf3yh8sis the NID of the base name. The author's dynamic lookup ran on the prior head and was not repeated on the rebase.0x6000000value and the packet sequence against the shadPS4 links in the PR body. I did not open those external links.Export.cpplines 1-110 at head plus the changed hunks;Api.hpplines 1-20 at head plus the changed line;GuestGnmDriver.cpplines 1-52 at head plus the new block. The rest of each file is unchanged by this diff and was not read.To get this to a good state
Nothing is required.
Optional: rerun the dynamic NID lookup and call on the current head, since the PR body says it was last run on the prior head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T13:51:19Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected implementation and tests support merging.
What I ran
21ec57969d7deec7fbd045670cfdd5960617067eagainst the prepared diff. I did not run commands or tests.core/libs/prx/libSceGnmDriver/Export.cpp,core/libs/prx/libSceGnmDriver/include/Api.hpp, andcore/libs/tests/GuestGnmDriver.cpp.files.json; the directory listing confirms the three manifest files were included. No changed files were excluded.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run tests, builds, or checks. The author-reported automated results were not independently verified. Physical-console behavior and null or invalid-pointer behavior remain unverified, as noted in the description.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T17:42:03Z.
Review: COMMENTED
guest_gnm_driverandguest_gnm_driver_init_modespassed with21ec57969dintegrated into a Linux release build. The new regular-provider draw-state checks covered a short buffer, the 256-dword packet stream, the untouched trailing word, and the expected mode-register difference from the 175 variant.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.