feat(libScePfs): implement query, command, and validation exports #14096

Merged
akkadbakkad89 merged 3 commits from upstream-pr/14096 into main 2026-11-13 05:03:28 +00:00
akkadbakkad89 commented 2026-10-31 18:39:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-31T18:39:49Z.


What

Implements seven libScePfs exports — scePfsGetHeaderReadCommand, scePfsGetBlockTableReadCommand, scePfsGetSingleBlockReadCommand, scePfsGetPreadBlockRange, scePfsGetUncompressedSize, scePfsGetWorkBufferSize, scePfsValidate — from the bundled decrypted libScePfs.prx shipped with Stellar Blade (PPSA13197), whose disassembly pins every behaviour below.

  • PFSC header: magic 0x43534650, version u16 at +4, uncompressed total at +0x18; errors 0x8a780001–0x8a780005.
  • v2 (layout tag +0x28 == 2): u64 boundary table at +0x30, 48-bit masked entries.
  • v3: 16-byte index records at +0x48, types 3 (block table) and 7 (data region) keyed on the low byte; block-table entries are pairs masked 44 bits.
  • scePfsGetWorkBufferSize returns the constant 0xed0d8 (allocator helper 0x15b0 case edi=8 gives 0xa8 + 0x6d020, 0x15a0 adds 0x10, export adds 0x80000).
  • scePfsValidate modes 0/1/2: mode 2 additionally walks the block boundaries checking <= 0x40000 spans (v3) / < 0x20001 deltas and <= total (v2).
  • One deviation, recorded in the debt file: v3 scePfsGetSingleBlockReadCommand with a missing type-3 index record and blockIndex >= 0 dereferences null on console; the host returns 0x8a780003 like the missing type-7 case.

scePfsPread and scePfsPreadDecompressBlock still throw NotImplemented_nid_no_patch: the former's block-read worker loop and the latter's internal range decoder (0xf0a20, calls 0x6380, 0xaa0) are not yet ported; both gaps are documented in docs/dev/debt/libScePfs.md.

Tested

New guest_pfs test (Windows, MinGW): read-command layouts for v2/v3, block-range arithmetic incl. the firmware found != offset correction quirk, single-block commands, validation levels and all error paths — passes. tools/check_conventions.py --base origin/main clean; tools/pr_overlap.py --branch reports no overlap with open PRs. Not run against a title.

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:5100444206 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14096). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-10-31T18:39:49Z. --- ### What Implements seven `libScePfs` exports — `scePfsGetHeaderReadCommand`, `scePfsGetBlockTableReadCommand`, `scePfsGetSingleBlockReadCommand`, `scePfsGetPreadBlockRange`, `scePfsGetUncompressedSize`, `scePfsGetWorkBufferSize`, `scePfsValidate` — from the bundled decrypted `libScePfs.prx` shipped with Stellar Blade (PPSA13197), whose disassembly pins every behaviour below. - PFSC header: magic `0x43534650`, version u16 at `+4`, uncompressed total at `+0x18`; errors `0x8a780001`–`0x8a780005`. - v2 (layout tag `+0x28` == 2): u64 boundary table at `+0x30`, 48-bit masked entries. - v3: 16-byte index records at `+0x48`, types 3 (block table) and 7 (data region) keyed on the low byte; block-table entries are pairs masked 44 bits. - `scePfsGetWorkBufferSize` returns the constant `0xed0d8` (allocator helper `0x15b0` case `edi=8` gives `0xa8 + 0x6d020`, `0x15a0` adds `0x10`, export adds `0x80000`). - `scePfsValidate` modes 0/1/2: mode 2 additionally walks the block boundaries checking `<= 0x40000` spans (v3) / `< 0x20001` deltas and `<= total` (v2). - One deviation, recorded in the debt file: v3 `scePfsGetSingleBlockReadCommand` with a missing type-3 index record and `blockIndex >= 0` dereferences null on console; the host returns `0x8a780003` like the missing type-7 case. `scePfsPread` and `scePfsPreadDecompressBlock` still throw `NotImplemented_nid_no_patch`: the former's block-read worker loop and the latter's internal range decoder (`0xf0a20`, calls `0x6380`, `0xaa0`) are not yet ported; both gaps are documented in `docs/dev/debt/libScePfs.md`. ### Tested New `guest_pfs` test (Windows, MinGW): read-command layouts for v2/v3, block-range arithmetic incl. the firmware `found != offset` correction quirk, single-block commands, validation levels and all error paths — passes. `tools/check_conventions.py --base origin/main` clean; `tools/pr_overlap.py --branch` reports no overlap with open PRs. Not run against a title. ### 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-10-31 18:43:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T18:43:57Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The new scePfsGetPreadBlockRange accepts an out-of-range request when its 64-bit end calculation wraps, then can return wrapped block indices or walk beyond the v3 table.

What I ran

Reviewed exact head 43714ccd26770439af397db3f04212548bdda909 against PR base ca073ec3ad0d766ea9f4658e418a5c977001a353. The no-build precheck recorded a clean individual merge preview against the current base ca073ec3ad0d766ea9f4658e418a5c977001a353. Environment: Linux x86-64, Python 3.11.2, Git 2.39.5. No C++ build or test was run.

python3 /root/.codex/skills/anyps5-pr-review/scripts/pr_snapshot.py 14096 --repo boykopovar/AnyPS5
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14096 --output-dir /tmp/anyps5-14096-review
gh api repos/boykopovar/AnyPS5/commits/43714ccd26770439af397db3f04212548bdda909/check-runs

Results

Check Result
Diff check Passed
Repository conventions and PR template Passed
Current-base merge preview Clean
Changed-export ABI audit Not run: the helper is absent from the isolated PR snapshot
Test-quality heuristic Ran; flagged the C++ test path as possibly unregistered. The new guest_pfs_tests target and add_test(NAME guest_pfs ...) in the changed CMake file appear to register it, so this signal is a false positive on inspection.
Hosted Windows job In progress at the last check
Hosted Linux and specialized jobs Skipped
Precheck output
All conventions checks passed.
Conclusion: checks failed

The overall precheck status reflects the unavailable local helper scripts, not a failed repository convention check.

Findings

Blocking

At Export.cpp lines 93 and 119, offset + size > total is evaluated after unsigned 64-bit addition. For total = UINT64_MAX, offset = UINT64_MAX - 1, and size = 2, the sum wraps to zero, so both v2 and v3 pass the range guard even though the requested end exceeds total. The v2 path can then return UINT32_MAX as a block index; the v3 path uses the huge offset to index blockTable.

The round-up expression also adds 0x3ffff to the end before shifting, which can overflow for otherwise in-range values near UINT64_MAX. Please use subtraction-based bounds (offset <= total and size <= total - offset), overflow-safe ceiling division for block indices, and reject indices that cannot be represented by the uint32_t outputs. Add v2 and v3 regression cases around UINT64_MAX that assert an error without reading beyond the supplied table.

Non-blocking

None.

Sources

Not verified

I did not build or run guest_pfs_tests; hosted Windows was still running, and Linux/specialized jobs were skipped. I did not validate behavior against a PS5 or a game image.

To get this to a good state

Add overflow-safe range and rounding checks with regression cases for v2 and v3, then I will rerun the same no-build checks and re-review the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5724354118 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14096#pullrequestreview-5724354118). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T18:43:57Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The new `scePfsGetPreadBlockRange` accepts an out-of-range request when its 64-bit end calculation wraps, then can return wrapped block indices or walk beyond the v3 table. ## What I ran Reviewed exact head `43714ccd26770439af397db3f04212548bdda909` against PR base `ca073ec3ad0d766ea9f4658e418a5c977001a353`. The no-build precheck recorded a clean individual merge preview against the current base `ca073ec3ad0d766ea9f4658e418a5c977001a353`. Environment: Linux x86-64, Python 3.11.2, Git 2.39.5. No C++ build or test was run. ```sh python3 /root/.codex/skills/anyps5-pr-review/scripts/pr_snapshot.py 14096 --repo boykopovar/AnyPS5 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14096 --output-dir /tmp/anyps5-14096-review gh api repos/boykopovar/AnyPS5/commits/43714ccd26770439af397db3f04212548bdda909/check-runs ``` ## Results | Check | Result | |---|---| | Diff check | Passed | | Repository conventions and PR template | Passed | | Current-base merge preview | Clean | | Changed-export ABI audit | Not run: the helper is absent from the isolated PR snapshot | | Test-quality heuristic | Ran; flagged the C++ test path as possibly unregistered. The new `guest_pfs_tests` target and `add_test(NAME guest_pfs ...)` in the changed CMake file appear to register it, so this signal is a false positive on inspection. | | Hosted Windows job | In progress at the last check | | Hosted Linux and specialized jobs | Skipped | <details> <summary>Precheck output</summary> ```text All conventions checks passed. Conclusion: checks failed ``` The overall precheck status reflects the unavailable local helper scripts, not a failed repository convention check. </details> ## Findings ### Blocking At `Export.cpp` lines 93 and 119, `offset + size > total` is evaluated after unsigned 64-bit addition. For `total = UINT64_MAX`, `offset = UINT64_MAX - 1`, and `size = 2`, the sum wraps to zero, so both v2 and v3 pass the range guard even though the requested end exceeds `total`. The v2 path can then return `UINT32_MAX` as a block index; the v3 path uses the huge offset to index `blockTable`. The round-up expression also adds `0x3ffff` to the end before shifting, which can overflow for otherwise in-range values near `UINT64_MAX`. Please use subtraction-based bounds (`offset <= total` and `size <= total - offset`), overflow-safe ceiling division for block indices, and reject indices that cannot be represented by the `uint32_t` outputs. Add v2 and v3 regression cases around `UINT64_MAX` that assert an error without reading beyond the supplied table. ### Non-blocking None. ## Sources - [Affected range checks at the reviewed commit](https://github.com/boykopovar/AnyPS5/blob/43714ccd26770439af397db3f04212548bdda909/core/libs/prx/libScePfs/Export.cpp#L86-L123) - [Added boundary tests at the reviewed commit](https://github.com/boykopovar/AnyPS5/blob/43714ccd26770439af397db3f04212548bdda909/core/libs/tests/GuestPfs.cpp#L155-L201) ## Not verified I did not build or run `guest_pfs_tests`; hosted Windows was still running, and Linux/specialized jobs were skipped. I did not validate behavior against a PS5 or a game image. ## To get this to a good state Add overflow-safe range and rounding checks with regression cases for v2 and v3, then I will rerun the same no-build checks and re-review the new head.
MarcZX10 commented 2026-10-31 20:27:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T20:27:43Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The update fixes the wrapping range arithmetic, but the v2 path still accepts a zero-length request whose first block index exceeds the uint32_t output range and silently wraps it.

What I ran

Reviewed head 5ab9369ddfba3ae8669e83cc5553617b067f067f against PR base ca073ec3ad0d766ea9f4658e418a5c977001a353; the merge preview against current main 0836dfdf4fecb1e0326100c490476e15d3a74da5 was clean. Environment: Debian Linux, Python 3.11.2, GCC 12.2.0. No local C++ build or CTest run.

git diff --check ca073ec3ad0d766ea9f4658e418a5c977001a353...5ab9369ddfba3ae8669e83cc5553617b067f067f
python3 tools/check_conventions.py --base ca073ec3ad0d766ea9f4658e418a5c977001a353 --head 5ab9369ddfba3ae8669e83cc5553617b067f067f --title 'feat(libScePfs): implement query, command, and validation exports' --body /tmp/anyps5-14096-review/pr-body.md
python3 tools/pr_abi_audit.py --base ca073ec3ad0d766ea9f4658e418a5c977001a353 --head 5ab9369ddfba3ae8669e83cc5553617b067f067f --json
python3 tools/pr_stack_check.py 14096 --repo boykopovar/AnyPS5
python3 tools/pr_test_quality.py --root /tmp/anyps5-review-14096 core/libs/tests/GuestPfs.cpp

Results

Check Result
Diff and repository conventions/template Passed
Export/declaration audit Passed: no lexical findings; this does not establish binary ABI correctness
Current-main merge preview Clean; no declared dependencies
C++ test registration Confirmed manually: GuestPfs.cpp is included through ${LIBS_INCLUDE_DIR}/tests/GuestPfs.cpp and registered as guest_pfs in the changed CMake file
Test-quality heuristic One false-positive registration warning; the CMake target and add_test are present
Hosted Windows Passed on this head
Hosted eligibility, conventions, labels, portability, report Passed
Hosted Linux and specialized jobs Skipped
Local C++ build/test Not run
Unedited local command output
All conventions checks passed.

The ABI audit returned "status": "passed" and "findings": []. The test-quality warning was possible-unregistered-cpp-test; manual inspection confirmed the registration described above.

Negative control

No local negative-control run was performed because exercising this C++ test requires a build. The hosted Windows job passed on the reviewed head; it is not a mutation test.

Findings

Blocking

In the v2 branch, firstBlockOut is cast from offset >> 0x12, but only lastIndex is checked against UINT32_MAX (reviewed source). For total = offset = 0x4000000000000 and size = 0, the request passes the bounds check; firstIndex is 0x100000000, lastIndex is 0xffffffff, and the cast returns firstBlockOut == 0. The function therefore reports a wrapped first block instead of rejecting an index that cannot fit its output. This contradicts the new overflow hardening and the debt note's claim that unrepresentable block indices return 0x8a780005.

Please check offset >> 0x12 against UINT32_MAX before assigning the output, and add a v2 zero-length boundary regression that expects OutOfRange.

    const std::uint64_t firstIndex = offset >> 0x12;
    const std::uint64_t lastIndex = end ? (end - 1) >> 0x12 : 0xffffffffULL;
    if (firstIndex > 0xffffffffULL || lastIndex > 0xffffffffULL) return OutOfRange;
    *firstBlockOut = static_cast<std::uint32_t>(firstIndex);

Non-blocking

The update appropriately removes tests that asserted still-unimplemented exports throw. The PR now documents its older-firmware differences and the remaining malformed-v3 validation-count divergence.

Sources

Not verified

I did not run the C++ test locally or verify behavior against a PS5. The hosted Linux and specialized jobs were skipped; only the hosted Windows job is evidence of a compiled test run on this head.

To get this to a good state

Reject the oversized v2 first index and add the zero-length boundary regression. I will rerun the same no-build checks and review the exact new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5724789463 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14096#pullrequestreview-5724789463). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T20:27:43Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The update fixes the wrapping range arithmetic, but the v2 path still accepts a zero-length request whose first block index exceeds the `uint32_t` output range and silently wraps it. ## What I ran Reviewed head `5ab9369ddfba3ae8669e83cc5553617b067f067f` against PR base `ca073ec3ad0d766ea9f4658e418a5c977001a353`; the merge preview against current `main` `0836dfdf4fecb1e0326100c490476e15d3a74da5` was clean. Environment: Debian Linux, Python 3.11.2, GCC 12.2.0. No local C++ build or CTest run. ```sh git diff --check ca073ec3ad0d766ea9f4658e418a5c977001a353...5ab9369ddfba3ae8669e83cc5553617b067f067f python3 tools/check_conventions.py --base ca073ec3ad0d766ea9f4658e418a5c977001a353 --head 5ab9369ddfba3ae8669e83cc5553617b067f067f --title 'feat(libScePfs): implement query, command, and validation exports' --body /tmp/anyps5-14096-review/pr-body.md python3 tools/pr_abi_audit.py --base ca073ec3ad0d766ea9f4658e418a5c977001a353 --head 5ab9369ddfba3ae8669e83cc5553617b067f067f --json python3 tools/pr_stack_check.py 14096 --repo boykopovar/AnyPS5 python3 tools/pr_test_quality.py --root /tmp/anyps5-review-14096 core/libs/tests/GuestPfs.cpp ``` ## Results | Check | Result | |---|---| | Diff and repository conventions/template | Passed | | Export/declaration audit | Passed: no lexical findings; this does not establish binary ABI correctness | | Current-main merge preview | Clean; no declared dependencies | | C++ test registration | Confirmed manually: `GuestPfs.cpp` is included through `${LIBS_INCLUDE_DIR}/tests/GuestPfs.cpp` and registered as `guest_pfs` in the changed CMake file | | Test-quality heuristic | One false-positive registration warning; the CMake target and `add_test` are present | | Hosted Windows | Passed on this head | | Hosted eligibility, conventions, labels, portability, report | Passed | | Hosted Linux and specialized jobs | Skipped | | Local C++ build/test | Not run | <details><summary>Unedited local command output</summary> ```text All conventions checks passed. ``` The ABI audit returned `"status": "passed"` and `"findings": []`. The test-quality warning was `possible-unregistered-cpp-test`; manual inspection confirmed the registration described above. </details> ## Negative control No local negative-control run was performed because exercising this C++ test requires a build. The hosted Windows job passed on the reviewed head; it is not a mutation test. ## Findings ### Blocking In the v2 branch, `firstBlockOut` is cast from `offset >> 0x12`, but only `lastIndex` is checked against `UINT32_MAX` ([reviewed source](https://github.com/boykopovar/AnyPS5/blob/5ab9369ddfba3ae8669e83cc5553617b067f067f/core/libs/prx/libScePfs/Export.cpp#L126-L132)). For `total = offset = 0x4000000000000` and `size = 0`, the request passes the bounds check; `firstIndex` is `0x100000000`, `lastIndex` is `0xffffffff`, and the cast returns `firstBlockOut == 0`. The function therefore reports a wrapped first block instead of rejecting an index that cannot fit its output. This contradicts the new overflow hardening and the debt note's claim that unrepresentable block indices return `0x8a780005`. Please check `offset >> 0x12` against `UINT32_MAX` before assigning the output, and add a v2 zero-length boundary regression that expects `OutOfRange`. ```suggestion const std::uint64_t firstIndex = offset >> 0x12; const std::uint64_t lastIndex = end ? (end - 1) >> 0x12 : 0xffffffffULL; if (firstIndex > 0xffffffffULL || lastIndex > 0xffffffffULL) return OutOfRange; *firstBlockOut = static_cast<std::uint32_t>(firstIndex); ``` ### Non-blocking The update appropriately removes tests that asserted still-unimplemented exports throw. The PR now documents its older-firmware differences and the remaining malformed-v3 validation-count divergence. ## Sources - [v2 range calculation and outputs at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/5ab9369ddfba3ae8669e83cc5553617b067f067f/core/libs/prx/libScePfs/Export.cpp#L126-L132) - [Boundary regression tests at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/5ab9369ddfba3ae8669e83cc5553617b067f067f/core/libs/tests/GuestPfs.cpp#L161-L169) - [Hosted checks for this head](https://github.com/boykopovar/AnyPS5/actions/runs/41236744899) ## Not verified I did not run the C++ test locally or verify behavior against a PS5. The hosted Linux and specialized jobs were skipped; only the hosted Windows job is evidence of a compiled test run on this head. ## To get this to a good state Reject the oversized v2 first index and add the zero-length boundary regression. I will rerun the same no-build checks and review the exact new head.
MarcZX10 commented 2026-11-01 07:57:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T07:57:48Z.

Review: COMMENTED


Re-checked — new head, no blocking findings

The new head 255caee65ab8befea3d10638d8b1c09e8db48a66 adds the first-index range check that blocked the previous head, and the hosted Windows job passed guest_pfs on this exact head.

What I ran

Exact head reviewed: 255caee65ab8befea3d10638d8b1c09e8db48a66, one commit (fix(libScePfs): reject v2 ranges whose first block index cannot fit) on top of 5ab9369ddfba3ae8669e83cc5553617b067f067f, the head that received my earlier CHANGES_REQUESTED review. PR base ca073ec3ad0d766ea9f4658e418a5c977001a353. Merge preview against current main c674f8c14da93df7a6b37657117ca3f58357477f: clean (git merge-tree --write-tree exit 0, no conflicts).

Environment: Debian host, git 2.39.5, system Python 3. No build, no compile, no local C++ test run. The checks were run from the trusted checkout /marc/AnyPS5/tools against the PR's git objects; the PR's own tools and tests were not executed.

git diff --check ca073ec3ad0d766ea9f4658e418a5c977001a353 255caee65ab8befea3d10638d8b1c09e8db48a66
python3 tools/check_conventions.py --base ca073ec3ad0d766ea9f4658e418a5c977001a353 --head 255caee65ab8befea3d10638d8b1c09e8db48a66 --title '<PR title>' --body <PR body file>
python3 tools/pr_abi_audit.py --base ca073ec3ad0d766ea9f4658e418a5c977001a353 --head 255caee65ab8befea3d10638d8b1c09e8db48a66 --json
python3 tools/pr_test_quality.py --root <git archive of 255caee: core/libs/tests/GuestPfs.cpp> --json core/libs/tests/GuestPfs.cpp
git merge-tree --write-tree --name-only c674f8c14da93df7a6b37657117ca3f58357477f 255caee65ab8befea3d10638d8b1c09e8db48a66

The pr_precheck.py wrapper was not run for this head, because its isolated checkout would execute PR-head tooling and tests, and its helpers are absent from detached checkouts. The component checks above were run by hand instead.

Results

Check Result
git diff --check over the PR range Passed (no output, exit 0)
Repository conventions and PR body Passed
Export/declaration audit (pr_abi_audit.py, by hand) Passed: status passed, 9 symbols, 0 findings; lexical only, not an ABI proof
Test-quality heuristic (pr_test_quality.py) One possible-unregistered-cpp-test finding, a false positive: core/libs/prx/libScePfs/CMakeLists.txt registers guest_pfs_tests from ${LIBS_INCLUDE_DIR}/tests/GuestPfs.cpp as test guest_pfs
Current-main merge preview Clean
Hosted Windows, Build run 41245988671, job 124670344335 Success; guest_pfs passed
Hosted eligibility, conventions, labels, library-portability, report Success
Hosted Linux, relinker, relinker-asan, register-context, write-watch Skipped
Unedited command and log output
$ git diff --check ca073ec3ad0d766ea9f4658e418a5c977001a353 255caee65ab8befea3d10638d8b1c09e8db48a66
(no output, exit 0)

$ python3 tools/check_conventions.py ...
All conventions checks passed.

$ python3 tools/pr_abi_audit.py ... --json   (parsed)
status: passed; symbols: 9; findings: 0

2026-10-31T22:14:32.3396658Z 2021/2540 Test #2475: guest_pfs ................................................................   Passed    0.02 sec
2026-10-31T22:15:41.6407513Z 100% tests passed, 0 tests failed out of 2540

Negative control

Assertion Change to the code under test Did the new assertion fail?
scePfsGetPreadBlockRange(0, 0x4000000000000) == OutOfRange (GuestPfs.cpp L170) Previous head 5ab9369d, which lacks the firstIndex > 0xffffffff check (Export.cpp L126-L133 at that commit) Not executed (no build). By source reading it would fail, because the old code truncates 0x100000000 to 0 and returns 0.

Findings

Blocking: none. The blocking item from the previous head is fixed. The v2 path now checks firstIndex together with lastIndex before the uint32_t assignments, and the v3 path already checked both indices before its table scan. The regression cases cover the unrepresentable zero-length index and the representable boundary.

Non-blocking: none.

Sources

Not verified

  • No local build and no local run of guest_pfs; the only run evidence is the hosted Windows job at this exact head.
  • Hosted Linux, relinker, relinker-asan, register-context and write-watch jobs were skipped on this head.
  • Firmware behavior of the new boundary cases was not re-derived here; the author's firmware claims were not checked against firmware.
  • The negative control was not executed.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727055364 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14096#pullrequestreview-5727055364). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T07:57:48Z. **Review:** COMMENTED --- # Re-checked — new head, no blocking findings The new head `255caee65ab8befea3d10638d8b1c09e8db48a66` adds the first-index range check that blocked the previous head, and the hosted Windows job passed `guest_pfs` on this exact head. ## What I ran Exact head reviewed: `255caee65ab8befea3d10638d8b1c09e8db48a66`, one commit (`fix(libScePfs): reject v2 ranges whose first block index cannot fit`) on top of `5ab9369ddfba3ae8669e83cc5553617b067f067f`, the head that received my earlier CHANGES_REQUESTED review. PR base `ca073ec3ad0d766ea9f4658e418a5c977001a353`. Merge preview against current `main` `c674f8c14da93df7a6b37657117ca3f58357477f`: clean (`git merge-tree --write-tree` exit 0, no conflicts). Environment: Debian host, git 2.39.5, system Python 3. No build, no compile, no local C++ test run. The checks were run from the trusted checkout `/marc/AnyPS5/tools` against the PR's git objects; the PR's own tools and tests were not executed. ```sh git diff --check ca073ec3ad0d766ea9f4658e418a5c977001a353 255caee65ab8befea3d10638d8b1c09e8db48a66 python3 tools/check_conventions.py --base ca073ec3ad0d766ea9f4658e418a5c977001a353 --head 255caee65ab8befea3d10638d8b1c09e8db48a66 --title '<PR title>' --body <PR body file> python3 tools/pr_abi_audit.py --base ca073ec3ad0d766ea9f4658e418a5c977001a353 --head 255caee65ab8befea3d10638d8b1c09e8db48a66 --json python3 tools/pr_test_quality.py --root <git archive of 255caee: core/libs/tests/GuestPfs.cpp> --json core/libs/tests/GuestPfs.cpp git merge-tree --write-tree --name-only c674f8c14da93df7a6b37657117ca3f58357477f 255caee65ab8befea3d10638d8b1c09e8db48a66 ``` The `pr_precheck.py` wrapper was not run for this head, because its isolated checkout would execute PR-head tooling and tests, and its helpers are absent from detached checkouts. The component checks above were run by hand instead. ## Results | Check | Result | |---|---| | `git diff --check` over the PR range | Passed (no output, exit 0) | | Repository conventions and PR body | Passed | | Export/declaration audit (`pr_abi_audit.py`, by hand) | Passed: status `passed`, 9 symbols, 0 findings; lexical only, not an ABI proof | | Test-quality heuristic (`pr_test_quality.py`) | One `possible-unregistered-cpp-test` finding, a false positive: `core/libs/prx/libScePfs/CMakeLists.txt` registers `guest_pfs_tests` from `${LIBS_INCLUDE_DIR}/tests/GuestPfs.cpp` as test `guest_pfs` | | Current-main merge preview | Clean | | Hosted Windows, `Build` run 41245988671, job 124670344335 | Success; `guest_pfs` passed | | Hosted eligibility, conventions, labels, library-portability, report | Success | | Hosted Linux, relinker, relinker-asan, register-context, write-watch | Skipped | <details><summary>Unedited command and log output</summary> ```text $ git diff --check ca073ec3ad0d766ea9f4658e418a5c977001a353 255caee65ab8befea3d10638d8b1c09e8db48a66 (no output, exit 0) $ python3 tools/check_conventions.py ... All conventions checks passed. $ python3 tools/pr_abi_audit.py ... --json (parsed) status: passed; symbols: 9; findings: 0 2026-10-31T22:14:32.3396658Z 2021/2540 Test #2475: guest_pfs ................................................................ Passed 0.02 sec 2026-10-31T22:15:41.6407513Z 100% tests passed, 0 tests failed out of 2540 ``` </details> ## Negative control | Assertion | Change to the code under test | Did the new assertion fail? | |---|---|---| | `scePfsGetPreadBlockRange(0, 0x4000000000000) == OutOfRange` (`GuestPfs.cpp` L170) | Previous head `5ab9369d`, which lacks the `firstIndex > 0xffffffff` check (`Export.cpp` L126-L133 at that commit) | Not executed (no build). By source reading it would fail, because the old code truncates `0x100000000` to `0` and returns 0. | ## Findings **Blocking:** none. The blocking item from the previous head is fixed. The v2 path now checks `firstIndex` together with `lastIndex` before the `uint32_t` assignments, and the v3 path already checked both indices before its table scan. The regression cases cover the unrepresentable zero-length index and the representable boundary. **Non-blocking:** none. ## Sources - [Export.cpp L129-L133 at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/255caee65ab8befea3d10638d8b1c09e8db48a66/core/libs/prx/libScePfs/Export.cpp#L129-L133) - [GuestPfs.cpp L170-L173 at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/255caee65ab8befea3d10638d8b1c09e8db48a66/core/libs/tests/GuestPfs.cpp#L170-L173) - [Previous head without the check, Export.cpp L126-L133](https://github.com/boykopovar/AnyPS5/blob/5ab9369ddfba3ae8669e83cc5553617b067f067f/core/libs/prx/libScePfs/Export.cpp#L126-L133) - [Hosted Build run for the reviewed head](https://github.com/boykopovar/AnyPS5/actions/runs/41245988671) ## Not verified - No local build and no local run of `guest_pfs`; the only run evidence is the hosted Windows job at this exact head. - Hosted Linux, relinker, relinker-asan, register-context and write-watch jobs were skipped on this head. - Firmware behavior of the new boundary cases was not re-derived here; the author's firmware claims were not checked against firmware. - The negative control was not executed.
MarcZX10 commented 2026-11-10 18:28:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-10T18:28:49Z.

Review: APPROVED


Reviewed — looks good

The reviewed head has no remaining blocking findings, and the changed guest test step completed successfully on the exact head.

What I ran

I previously reviewed all five changed files at head 255caee65ab8befea3d10638d8b1c09e8db48a66 against PR base ca073ec3ad0d766ea9f4658e418a5c977001a353, including the exact-head no-build precheck and export audit. In this follow-up, I rechecked the overflow guard and its regressions, current PR state, CI run, and current-main merge preview. The merge preview against current main 865323b2a9e7f7f056c313cf23a71eb8fecd0882 is clean.

Environment: Linux x86-64; Git 2.39.5. I did not compile locally.

git diff --check ca073ec3ad0d766ea9f4658e418a5c977001a353...255caee65ab8befea3d10638d8b1c09e8db48a66
git merge-tree --write-tree --name-only 865323b2a9e7f7f056c313cf23a71eb8fecd0882 255caee65ab8befea3d10638d8b1c09e8db48a66
gh run view 41245988671 --repo boykopovar/AnyPS5 --json event,headSha,conclusion,jobs

Results

Check Result Note
Exact-head no-build checks passed Diff, conventions, and export audit passed in the earlier review of this unchanged head.
Current-main merge preview passed Clean at current main 865323b2a9e7.
GitHub Windows Build run passed Exact-head run completed “Build and run changed guest core/libs tests.”
Additional guest_pfs run passed A reviewer comment reports three successful Windows 11 runs; this is supplied evidence, not a run I performed.
Other hosted jobs not run Linux and specialized jobs were skipped.
Local build and CTest not run No local compile or C++ test execution.
Hosted results

The Windows Build run was triggered for head 255caee65ab8befea3d10638d8b1c09e8db48a66 and completed successfully. Its job includes the successful “Build and run changed guest core/libs tests” step. Separately, the reviewer comment #6720266778 reports guest_pfs passing 3 of 3 runs on Windows 11 with WinLibs GCC 15.2.

The conventions, labels, report, eligibility, and library-portability checks passed. Linux, relinker, ASan, register-context, and write-watch jobs were skipped.

Negative control

No negative-control or mutation run was performed.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

Linux and specialized jobs were skipped; no local build or CTest run, console run, or title-level behavior check was performed. The Windows 11 3/3 report is supplied by another reviewer and was not independently reproduced.

To get this to a good state

No further code change is requested for this head. If the PR receives a new commit, I will review and test that exact head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5847227889 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14096#pullrequestreview-5847227889). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-10T18:28:49Z. **Review:** APPROVED --- # Reviewed — looks good The reviewed head has no remaining blocking findings, and the changed guest test step completed successfully on the exact head. ## What I ran I previously reviewed all five changed files at head `255caee65ab8befea3d10638d8b1c09e8db48a66` against PR base `ca073ec3ad0d766ea9f4658e418a5c977001a353`, including the exact-head no-build precheck and export audit. In this follow-up, I rechecked the overflow guard and its regressions, current PR state, CI run, and current-main merge preview. The merge preview against current `main` `865323b2a9e7f7f056c313cf23a71eb8fecd0882` is clean. Environment: Linux x86-64; Git 2.39.5. I did not compile locally. ```sh git diff --check ca073ec3ad0d766ea9f4658e418a5c977001a353...255caee65ab8befea3d10638d8b1c09e8db48a66 git merge-tree --write-tree --name-only 865323b2a9e7f7f056c313cf23a71eb8fecd0882 255caee65ab8befea3d10638d8b1c09e8db48a66 gh run view 41245988671 --repo boykopovar/AnyPS5 --json event,headSha,conclusion,jobs ``` ## Results | Check | Result | Note | |---|---|---| | Exact-head no-build checks | passed | Diff, conventions, and export audit passed in the earlier review of this unchanged head. | | Current-main merge preview | passed | Clean at current main `865323b2a9e7`. | | GitHub Windows Build run | passed | Exact-head run completed “Build and run changed guest core/libs tests.” | | Additional `guest_pfs` run | passed | A reviewer comment reports three successful Windows 11 runs; this is supplied evidence, not a run I performed. | | Other hosted jobs | not run | Linux and specialized jobs were skipped. | | Local build and CTest | not run | No local compile or C++ test execution. | <details> <summary>Hosted results</summary> The Windows Build run was triggered for head `255caee65ab8befea3d10638d8b1c09e8db48a66` and completed successfully. Its job includes the successful “Build and run changed guest core/libs tests” step. Separately, the reviewer comment [#6720266778](https://github.com/boykopovar/AnyPS5/pull/14096#issuecomment-6720266778) reports `guest_pfs` passing 3 of 3 runs on Windows 11 with WinLibs GCC 15.2. The conventions, labels, report, eligibility, and library-portability checks passed. Linux, relinker, ASan, register-context, and write-watch jobs were skipped. </details> ## Negative control No negative-control or mutation run was performed. ## Findings ### Blocking None. ### Non-blocking None. ## Sources - [Overflow-safe v2 range and output-index checks](https://github.com/boykopovar/AnyPS5/blob/255caee65ab8befea3d10638d8b1c09e8db48a66/core/libs/prx/libScePfs/Export.cpp#L126-L134) - [v3 range boundary regressions](https://github.com/boykopovar/AnyPS5/blob/255caee65ab8befea3d10638d8b1c09e8db48a66/core/libs/tests/GuestPfs.cpp#L186-L207) - [Windows Build run for this exact head](https://github.com/boykopovar/AnyPS5/actions/runs/41245988671) - [Additional Windows 11 test report](https://github.com/boykopovar/AnyPS5/pull/14096#issuecomment-6720266778) ## Not verified Linux and specialized jobs were skipped; no local build or CTest run, console run, or title-level behavior check was performed. The Windows 11 3/3 report is supplied by another reviewer and was not independently reproduced. ## To get this to a good state No further code change is requested for this head. If the PR receives a new commit, I will review and test that exact head.
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!14096
No description provided.