feat(libSceGnmDriver): answer the CU mask and tessellation ring queries as firmware 13.42 does #16882
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16882"
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 BunnyFl on 2026-11-07T19:53:13Z.
What
sceGnmLogicalCuMaskToPhysicalCuMaskandsceGnmGetTheTessellationFactorRingBufferBaseAddressthrew. Firmware 13.42libSceGnmDriver.sprxanswers both without reading memory or calling anything:sceGnmLogicalCuMaskToPhysicalCuMaskRU74kek-N0cmov %esi,%eax; retat0x4c10sceGnmGetTheTessellationFactorRingBufferBaseAddressln33zjBrfjkmovabs $0xff0000000,%rax; retat0x4c700xff0000000core/libs/prx/libSceGnmDriver/Export.cpp:559and:568, declarations atcore/libs/prx/libSceGnmDriver/include/Api.hpp:44and:46(at1415816433).(std::uint32_t, std::uint32_t mask)and returnsstd::uint32_t(core/libs/prx/libSceGnmDriver/include/Api.hpp:46): the body at0x4c10reads onlyesiand writes onlyeax, so the first argument is left unnamed and its width is not claimed. Returning the full 32 bits ofmaskreproducesmov %esi,%eaxat0x4c10for any value inesi.std::uint64_t(core/libs/prx/libSceGnmDriver/include/Api.hpp:44), sincemovabsat0x4c70writes all ofrax.docs/dev/debt/libSceGnmDriver.md:11(at1415816433): the entry covered both CU calls and said the mask mapping "depends on which units are disabled on each chip and is not documented". The 13.42 module returns the mask unchanged (0x4c10), so the mask call leaves the entry, which is cut tosceGnmLogicalCuIndexToPhysicalCuIndex(docs/dev/debt/libSceGnmDriver.md:11). That one still throws: its body at0x4bc0(0x4c bytes) returns0xffffffffwhen the first argument is at most 1 (unsigned) and the second is below 9. Otherwise it calls the PLT stub at0x85a0(jmp *0x14158) with"%s failed: %s\n"(0xffa5), its own name (0xefe1) and"invalid value for engine"(0xf2b6, first argument above 1) or"invalid value for cuIndex"(0xfedb), and returns 0. Which import the stub at0x85a0reaches (slot0x14158) was not resolved, so the message is not reproduced and the entry records it (docs/dev/debt/libSceGnmDriver.md:11).Source
Firmware 13.42
system/common/lib/libSceGnmDriver.sprx(sha2560169144cf56c80cff9c89d1c7c136f288ea7983584231ae77825a7631f5c260f), read from disassembly, not run on a console. The module's dynamic symbol table givesRU74kek-N0cat0x4c10(size 3) andln33zjBrfjkat0x4c70(size 0xb). Each body, every instruction to its return:The index call, for the debt entry (
0x4bc0, to its return):Strings:
0xffa5%s failed: %s\n,0xefe1sceGnmLogicalCuIndexToPhysicalCuIndex,0xf2b6invalid value for engine,0xfedbinvalid value for cuIndex.Tested
Windows 11 Pro 10.0.26300, WinLibs GCC, Release, head
1415816433(onmain8f7c957ed0):2 of 2 pass, none Not Run, with the test executable rebuilt at this head:
guest_gnm_driverandpublic_headers. ThelibSceGnmDriverlibrary target builds too.TestQueriesincore/libs/tests/GuestGnmDriver.cpp(lines 127-133 at1415816433) checks the ring base address and the mask call with first arguments 0, 1, 7 and0xffffffff, including masks0,0x1f,0xabcdand0xffffffff.Negative controls at this head, each rebuilt and run, each failing
guest_gnm_driver(1 of 1 failed):NotImplemented_nid_no_patch(__func__)put back in both bodies, which ismain's behaviour, with this branch's test: it aborts withsceGnmGetTheTessellationFactorRingBufferBaseAddress not implemented.mask & 0xff.0xf0000000(the 32-bit truncation).After the controls, the test executable and the library were rebuilt and the 2 tests pass again.
The two changed declarations: every file on the tree that names them was mapped to its target and built (
guest_gnm_driver_tests,libSceGnmDriver); none outside this branch's own files.tools/check_conventions.py --base upstream/mainon the committed head1415816433: all checks pass.tools/pr_overlap.py --branch feat/gnm-cu-mask-tess-ring --jobs 8at1415816433, against 1,769 open pull requests: 1 shares a file, and the run failed closed on it, #14212, which conflicts withmain, fordocs/dev/debt/libSceGnmDriver.md. Its diff of that file only inserts blank lines between entries, one of them right before the entry this branch cuts; it names neither call. Whichever lands later keeps that blank line.Linux and macOS were not built or run. No title was run, and no GPU test is involved.
Upkeep at head
975e93eba4(main39a172839amerged in; the merge touched no file this branch changes):2 of 2 pass, none Not Run (100% tests passed, 0 tests failed out of 2), with both test executables rebuilt at this head and the
libSceGnmDrivertarget built:guest_gnm_driverandguest_avplayer.tools/check_conventions.py --base upstream/mainon the committed head975e93eba4: all checks pass.review-tools/sig_users.py HEAD --buildat this head: the two changed declarations are named in 3 files, none outside this branch's own changes, and both targets that name them (guest_gnm_driver_tests,libSceGnmDriver) build.tools/pr_overlap.py --branch feat/gnm-cu-mask-tess-ring --jobs 8at this head, against 1,939 open pull requests: 2 share a file with the branch, none has a conflicting line, and the run failed closed on #14212, which conflicts withmainitself, fordocs/dev/debt/libSceGnmDriver.md. Its diff was searched by hand at this head forsceGnmGetTheTessellationFactorRingBufferBaseAddressandsceGnmLogicalCuMaskToPhysicalCuMaskin every added and removed line: neither appears.The negative controls above were not repeated at this head; the branch's own diff against
mainis unchanged by the merge.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)🤖 Generated with Claude Code