feat(libSceDiscMap): report no disc bitmap from fJgP+wqifno #23349

Merged
adam25136 merged 1 commit from upstream-pr/23349 into main 2026-11-19 02:35:34 +00:00
adam25136 commented 2026-11-18 22:23:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adam25136 on 2026-11-18T22:23:28Z.


What

fJgP+wqifno is a libSceDiscMap export with no known name. libSceFios2 calls it with a path, an offset, a size and three output pointers. On main it throws as an unimplemented NID. On main with two open PRs merged, #17711 and #18184, inFAMOUS Second Son (CUSA00223) stops at the first call from its bundled libSceFios2. The code depends on neither PR.

  • Export.cpp: sceDiscMapUnknown_fJgP_plus_wqifno returns SCE_DISC_MAP_ERROR_NO_BITMAP_INFO (0x81100004) without reading or writing its arguments, like sceDiscMapIsRequestOnHDD and ioKMruft1ek.
  • Api.hpp declares it, and the placeholder in InventoryExports.hpp is removed.
  • tests/GuestDiscMap.cpp (guest_disc_map) checks that it returns 0x81100004 and writes none of its three outputs, and that it returns it for a call fpPS4 would refuse on every check (null pointers, size 0, offset -2).
  • docs/dev/debt/changes/discmap-fjgp-no-bitmap.md moves it from the placeholder table to an Unknown function info entry, and the libSceDiscMap entry names it next to the three other exports.

Where the answer comes from (the console's answer is not measured):

  • shadPS4#2686 reports, from Ghidra, that all calls "seems to check if lib is init first using a global", returning NO_BITMAP_INFO while it is clear. Before it, shadPS4 loaded the real module when one was supplied, and it called this answer "likely the same we do when we load this lib lle". #6527 drew on it for two of this function's siblings, and main's debt file gives that answer, before any argument check, for all three; for sceDiscMapGetPackageSize a PC run of the 13.42 module confirms it (#8647).
  • The same pull request still gave this function 0 with zeroed outputs, and shadPS4 and fpPS4 still do: shadPS4 (Func_7C980FFB0AA27E7A, registered as fJgP+wqifno at line 40), and fpPS4 after its own argument checks (0x81100001 for a size of 0 or less, an offset below -1 or a null pointer). #2686 was written on suggestions from fpPS4's author, so shadPS4's code, its note and fpPS4 are not independent sources. This PR follows #2686's note and the three siblings; the debt entry records the difference.
  • #10531's debt note reads CUSA00004's bundled libSceFios2 as passing three 64-bit outputs (an LBA package location, an LBA start and a count) and keeping the request unmapped after this error.

This carries the fJgP+wqifno part of DealPotato's #10531 (its answer, signature and reading of the outputs), with DealPotato as co-author. A bot closed #10531 for the open-PR limit, not on review. On 2026-11-16 I asked there whether they knew the console's answer and whether I could carry this part; there has been no reply so far. I also wrote there that I'd rather not claim an answer for this function without evidence like the siblings'. There is still none specific to it: this answer rests on #2686's note about the whole module, as two of the siblings' answers did.

Tested

Windows 10 Pro 19045, NVIDIA GeForce RTX 5080 (driver 621.14), WinLibs GCC 15.2.0 r7, Release. This branch (351c279b25) on main c23832d809, rebased after the Windows check failed on main's LibreSSL AES tests (since reverted). The selected-test, SPIR-V-tools and title runs, the overlap check and three of the breaks were on cd214f37f0, on main 82a8824748; the other two breaks on 2841cc1131, on main 866864a5bc. The changes since cd214f37f0 are one test argument (offset -2 in the null-argument call), the debt fragment's wording and the commit message, and the newer main commits change none of this PR's files. On 351c279b25, guest_disc_map passes.

  • guest_disc_map passes. Each deliberate break fails it, and the restored code passes:
    • the function made to throw (NotImplemented_nid_no_patch): "sceDiscMapUnknown_fJgP_plus_wqifno not implemented" (on 2841cc1131);
    • returning 0: "fJgP+wqifno did not report the missing bitmap";
    • writing 0 to the outputs: "fJgP+wqifno wrote an output";
    • fpPS4's null checks before the no-bitmap answer: "fJgP+wqifno with null arguments did not report the missing bitmap";
    • fpPS4's offset check alone before it (on 2841cc1131): the same message.
  • The tests tools/select_tests.py select picks for the four changed source files (1,129), run with select_tests.py ctest build --parallel 4 --timeout 120 and ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 on the branch and on main: the same one fails on both (check_compile_test_windows_quoted_response_tokens_match_clang), and none is skipped.
  • Build with ANYPS5_ENABLE_SPIRV_TOOLS=ON: everything builds except agc_driver_upload_cache_read_only_flush_tests, which fails the same way in the normal builds of this branch and of main (setenv is not declared).
  • inFAMOUS Second Son (CUSA00223 01.07, my own dump), one traced start each, on main 82a8824748 with #17711 (d20cbd0eb3) and #18184 (983c302fd1) merged locally. #17711 conflicts with main; its one conflicting file, libSceGnmDriverForNeoMode/Export.cpp, kept main's version.
    • Without this change: the title stops 5.0 s in with "libSceDiscMapUnknown_fJgP_plus_wqifno_nid_no_patch not implemented".
    • With it: the title gets past it and stops 21.0 s in, when compute shader 0x2f2fa2500's image descriptor (format 22, a 2D MSAA image, dim 6) is refused. #21961 (open) removes that refusal; the title then stops at the same dispatch in the driver.
  • tools/check_conventions.py with this title and description, and tools/debt_fold.py --check, pass.
  • tools/pr_overlap.py --branch (cd214f37f0) found no overlap among the 1,971 open pull requests except #8647, which it could not compare because #8647 conflicts with main (the tool fails closed, exit 2). By hand, #8647 changes sceDiscMapGetPackageSize in the same two files, not this function.

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 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: CUSA00223 #8214
  • GPUs tested: n/a
  • AI-assisted: yes

AI-assisted: Claude Code applied DealPotato's answer and test, added the null-argument check, wrote the debt entry, ran the tests and the title, and drafted this description; separate review agents checked it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5385113662 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23349). Originally posted by [adam25136](https://github.com/adam25136) on 2026-11-18T22:23:28Z. --- ### What `fJgP+wqifno` is a libSceDiscMap export with no known name. libSceFios2 calls it with a path, an offset, a size and three output pointers. On `main` it throws as an unimplemented NID. On `main` with two open PRs merged, #17711 and #18184, inFAMOUS Second Son (CUSA00223) stops at the first call from its bundled libSceFios2. The code depends on neither PR. - `Export.cpp`: `sceDiscMapUnknown_fJgP_plus_wqifno` returns `SCE_DISC_MAP_ERROR_NO_BITMAP_INFO` (`0x81100004`) without reading or writing its arguments, like `sceDiscMapIsRequestOnHDD` and `ioKMruft1ek`. - `Api.hpp` declares it, and the placeholder in `InventoryExports.hpp` is removed. - `tests/GuestDiscMap.cpp` (`guest_disc_map`) checks that it returns `0x81100004` and writes none of its three outputs, and that it returns it for a call fpPS4 would refuse on every check (null pointers, size 0, offset -2). - `docs/dev/debt/changes/discmap-fjgp-no-bitmap.md` moves it from the placeholder table to an Unknown function info entry, and the libSceDiscMap entry names it next to the three other exports. Where the answer comes from (the console's answer is not measured): - [shadPS4#2686](https://github.com/shadps4-emu/shadPS4/pull/2686) reports, from Ghidra, that all calls "seems to check if lib is init first using a global", returning `NO_BITMAP_INFO` while it is clear. Before it, shadPS4 loaded the real module when one was supplied, and it called this answer "likely the same we do when we load this lib lle". #6527 drew on it for two of this function's siblings, and `main`'s debt file gives that answer, before any argument check, for all three; for `sceDiscMapGetPackageSize` a PC run of the 13.42 module confirms it (#8647). - The same pull request still gave this function 0 with zeroed outputs, and shadPS4 and fpPS4 still do: [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/741d9b75fd87104ae2f81e4443ffc5433828eebf/src/core/libraries/disc_map/disc_map.cpp#L20-L26) (`Func_7C980FFB0AA27E7A`, registered as `fJgP+wqifno` at line 40), and [fpPS4](https://github.com/red-prig/fpPS4/blob/04cefd43e6fddd1ab033e7980cd356d14c964905/src/ps4_libscediscmap.pas#L38-L51) after its own argument checks (`0x81100001` for a size of 0 or less, an offset below -1 or a null pointer). #2686 was written on suggestions from fpPS4's author, so shadPS4's code, its note and fpPS4 are not independent sources. This PR follows #2686's note and the three siblings; the debt entry records the difference. - #10531's debt note reads CUSA00004's bundled libSceFios2 as passing three 64-bit outputs (an LBA package location, an LBA start and a count) and keeping the request unmapped after this error. This carries the `fJgP+wqifno` part of DealPotato's #10531 (its answer, signature and reading of the outputs), with DealPotato as co-author. A bot closed #10531 for the open-PR limit, not on review. On 2026-11-16 I asked there whether they knew the console's answer and whether I could carry this part; there has been no reply so far. I also wrote there that I'd rather not claim an answer for this function without evidence like the siblings'. There is still none specific to it: this answer rests on #2686's note about the whole module, as two of the siblings' answers did. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 10 Pro 19045, NVIDIA GeForce RTX 5080 (driver 621.14), WinLibs GCC 15.2.0 r7, Release. This branch (351c279b25) on `main` c23832d809, rebased after the Windows check failed on `main`'s LibreSSL AES tests (since reverted). The selected-test, SPIR-V-tools and title runs, the overlap check and three of the breaks were on cd214f37f0, on `main` 82a8824748; the other two breaks on 2841cc1131, on `main` 866864a5bc. The changes since cd214f37f0 are one test argument (offset -2 in the null-argument call), the debt fragment's wording and the commit message, and the newer `main` commits change none of this PR's files. On 351c279b25, `guest_disc_map` passes. - **`guest_disc_map` passes.** Each deliberate break fails it, and the restored code passes: - the function made to throw (`NotImplemented_nid_no_patch`): "sceDiscMapUnknown_fJgP_plus_wqifno not implemented" (on 2841cc1131); - returning 0: "fJgP+wqifno did not report the missing bitmap"; - writing 0 to the outputs: "fJgP+wqifno wrote an output"; - fpPS4's null checks before the no-bitmap answer: "fJgP+wqifno with null arguments did not report the missing bitmap"; - fpPS4's offset check alone before it (on 2841cc1131): the same message. - **The tests `tools/select_tests.py select` picks for the four changed source files** (1,129), run with `select_tests.py ctest build --parallel 4 --timeout 120` and `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1` on the branch and on `main`: the same one fails on both (`check_compile_test_windows_quoted_response_tokens_match_clang`), and none is skipped. - **Build with `ANYPS5_ENABLE_SPIRV_TOOLS=ON`:** everything builds except `agc_driver_upload_cache_read_only_flush_tests`, which fails the same way in the normal builds of this branch and of `main` (`setenv` is not declared). - **inFAMOUS Second Son** (CUSA00223 01.07, my own dump), one traced start each, on `main` 82a8824748 with #17711 (d20cbd0eb3) and #18184 (983c302fd1) merged locally. #17711 conflicts with `main`; its one conflicting file, `libSceGnmDriverForNeoMode/Export.cpp`, kept `main`'s version. - Without this change: the title stops 5.0 s in with "libSceDiscMapUnknown_fJgP_plus_wqifno_nid_no_patch not implemented". - With it: the title gets past it and stops 21.0 s in, when compute shader `0x2f2fa2500`'s image descriptor (format 22, a 2D MSAA image, `dim 6`) is refused. #21961 (open) removes that refusal; the title then stops at the same dispatch in the driver. - `tools/check_conventions.py` with this title and description, and `tools/debt_fold.py --check`, pass. - `tools/pr_overlap.py --branch` (cd214f37f0) found no overlap among the 1,971 open pull requests except #8647, which it could not compare because #8647 conflicts with `main` (the tool fails closed, exit 2). By hand, #8647 changes `sceDiscMapGetPackageSize` in the same two files, not this function. ### 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) and the licence notice of code adapted from upstream (see AGENTS.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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: CUSA00223 #8214 <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no --> AI-assisted: Claude Code applied DealPotato's answer and test, added the null-argument check, wrote the debt entry, ran the tests and the title, and drafted this description; separate review agents checked it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
PrivacyOnion commented 2026-11-18 22:24:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T22:24:41Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 2841cc1131:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_disc_map_tests built cleanly.
  • CTest (guest_disc_map):
    1/1 Test #3616: guest_disc_map ...................   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceDiscMap/Export.cpp, core/libs/prx/libSceDiscMap/include/Api.hpp, core/libs/prx/libSceDiscMap/include/InventoryExports.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified sceDiscMapUnknown_fJgP_plus_wqifno in core/libs/prx/libSceDiscMap/Export.cpp correctly returns SCE_DISC_MAP_ERROR_NO_BITMAP_INFO (0x81100004) without dereferencing or modifying any input/output pointers, matching the behavior of sibling exports.
    • Verified Export.cpp exports the NID 'fJgP+wqifno' with macro APS5_EXPORT and removes the stub from InventoryExports.hpp while adding the declaration to Api.hpp with identical ABI signature (APS5_VABI, extern 'C', matching fixed-width integer types).
    • Verified docs/dev/debt/changes/discmap-fjgp-no-bitmap.md properly records the debt transition, moves the NID out of placeholder tables, and documents the missing bitmap state without adding unapproved comments to source code.
    • Verified core/libs/tests/GuestDiscMap.cpp verifies both the expected return code, non-modification of output variables, and caller-safety when invoked with null pointers and out-of-bounds parameters.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5966164752 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23349#pullrequestreview-5966164752). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-18T22:24:41Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `2841cc1131`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_disc_map_tests` built cleanly. - **CTest** (`guest_disc_map`): ``` 1/1 Test #3616: guest_disc_map ................... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceDiscMap/Export.cpp`, `core/libs/prx/libSceDiscMap/include/Api.hpp`, `core/libs/prx/libSceDiscMap/include/InventoryExports.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified sceDiscMapUnknown_fJgP_plus_wqifno in core/libs/prx/libSceDiscMap/Export.cpp correctly returns SCE_DISC_MAP_ERROR_NO_BITMAP_INFO (0x81100004) without dereferencing or modifying any input/output pointers, matching the behavior of sibling exports. - Verified Export.cpp exports the NID 'fJgP+wqifno' with macro APS5_EXPORT and removes the stub from InventoryExports.hpp while adding the declaration to Api.hpp with identical ABI signature (APS5_VABI, extern 'C', matching fixed-width integer types). - Verified docs/dev/debt/changes/discmap-fjgp-no-bitmap.md properly records the debt transition, moves the NID out of placeholder tables, and documents the missing bitmap state without adding unapproved comments to source code. - Verified core/libs/tests/GuestDiscMap.cpp verifies both the expected return code, non-modification of output variables, and caller-safety when invoked with null pointers and out-of-bounds parameters. Looks Good To Me
MarcZX10 commented 2026-11-19 01:25:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T01:25:02Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the implementation follows the documented no-bitmap behavior, while its function-specific behavior remains an inference rather than a console measurement.

What I ran

Head reviewed: 351c279b25d5e4eaf2f9ea6d207a197291764bb4. I read the prepared description, commit summary, manifest, diff, and all five changed files. I did not run tests or other commands; the checks listed in the description are author-reported.

Results

Check Result Note
Diff and changed files passed All five changed files read
Tests and build not run Author reports tests and build results
Console behavior not run No console measurement reported

Findings

Blocking

None.

Non-blocking

  • The chosen return value and untouched outputs for fJgP+wqifno are supported by an inference from the module-wide Ghidra note and sibling behavior, and are explicitly documented as unmeasured. Console confirmation would strengthen this behavior claim. Changed implementation: core/libs/prx/libSceDiscMap/Export.cpp:35.

Not verified

I did not run the tests or build, verify author-reported results, or confirm behavior on console hardware. All files listed in review/manifest.json under changed were read; files.json was unavailable through the review reader, so exclusions beyond the manifest were not verified.

To get this to a good state

Nothing is required. Optional: record a console measurement for this export when available.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5967938754 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23349#pullrequestreview-5967938754). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T01:25:02Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the implementation follows the documented no-bitmap behavior, while its function-specific behavior remains an inference rather than a console measurement. ## What I ran Head reviewed: `351c279b25d5e4eaf2f9ea6d207a197291764bb4`. I read the prepared description, commit summary, manifest, diff, and all five changed files. I did not run tests or other commands; the checks listed in the description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and changed files | passed | All five changed files read | | Tests and build | not run | Author reports tests and build results | | Console behavior | not run | No console measurement reported | ## Findings ### Blocking None. ### Non-blocking - The chosen return value and untouched outputs for `fJgP+wqifno` are supported by an inference from the module-wide Ghidra note and sibling behavior, and are explicitly documented as unmeasured. Console confirmation would strengthen this behavior claim. Changed implementation: `core/libs/prx/libSceDiscMap/Export.cpp:35`. ## Not verified I did not run the tests or build, verify author-reported results, or confirm behavior on console hardware. All files listed in `review/manifest.json` under changed were read; `files.json` was unavailable through the review reader, so exclusions beyond the manifest were not verified. ## To get this to a good state Nothing is required. Optional: record a console measurement for this export when available.
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!23349
No description provided.