fix(libc): fpurge keeps the logical read position and the pushed-back bytes as the console does #22143

Merged
xXPBSXx merged 5 commits from upstream-pr/22143 into main 2026-11-26 04:22:03 +00:00
xXPBSXx commented 2026-11-17 06:26:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-11-17T06:26:43Z.


What

On the console, fpurge does not move a stream's read position and does not drop a pushed-back byte. A PS5 payload process on firmware 11.60 (libSceLibcInternal.sprx) read one byte of a 100-byte file and ftell returned 1; after fpurge it still returned 1 and the next byte read was the second one (case a, line 3 of the raw output). After ungetc('Z') and fpurge, the next fgetc returned Z (case c, line 4). End-of-file status was kept and ferror stayed 0 (case d, line 5), and output written with fputs and not flushed was discarded: the file had 0 bytes after fclose (case b, line 6). The fpurge of this library followed FreeBSD 11.4 and discarded buffered input and the pushback without writing or seeking: after the purge, the next read started at the host's position behind the read-ahead data, and the pushed-back byte was gone. The fpurge entry in docs/dev/debt/libc.md said that the console behavior is unverified.

StreamPurge.cpp now notes the logical position of a regular file (ftell) before the purge and, when a pushed-back byte is still recorded, its position and the byte; after the purge it moves the descriptor back to that position (_lseeki64 on Windows, fseeko elsewhere) and pushes the recorded byte back. ungetc in StandardStreams.cpp records the byte. FileStream.hpp gets three private fields (the recorded bytes, whether they are still valid and a cached "regular file" answer) and the accessors; any other access that goes through the stream status (SyncStatus, SyncUnlockedStatus) marks the recorded pushback invalid. Pipes, terminals and other streams that cannot be repositioned are purged as before. The debt fragment states the console result and what is still open.

Limits of this change, all stated in the pull request and not hidden: (1) a pushed-back byte survives fpurge only if no other stream call, feof and ferror included, happens between the ungetc and the fpurge; (2) bytes pushed back by std::ungetc calls outside StandardStreams.cpp are not recorded (Formatting.cpp lines 303 and 314, the scanf pushback), while the wide scanner's ungetc_nid_postfix call (ScanningWide.cpp line 185) is; (3) on Linux the repositioning uses fseeko, after which glibc reads the buffer again, so the descriptor's physical position differs from the logical one (the test therefore checks ftell); (4) macOS was not built. Not measured on the console: more than one pushed-back byte, a pipe or terminal, and text mode.

Tested

Measured on a PS5 with firmware 11.60 (kernel_get_fw_version 0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr) that loads libSceLibcInternal.sprx and takes fopen, fclose, fgetc, fputs, ftell, ungetc, feof, ferror, fwrite and fpurge with dlsym (line 2 shows that all ten were found), on 2026-11-16 at 23:37 UTC, on a temporary file in the probe's own directory on the data partition that was removed at the end. A title process may differ. The cases are 0 to b, lines 2 to 6 of the raw output in the first comment.

Check PS5 payload process, firmware 11.60 here (test and fix)
after one byte read, fpurge: ftell 1 and the next byte is the second ftell 1, next B (line 3) checked by guest_stream_purge, passes
ungetc, fpurge: the pushed-back byte comes back Z returned (line 4) checked by guest_stream_purge, passes
a pushback that was already read does not come back (also when fread read it) not measured, tested only here checked by guest_stream_purge, passes
EOF kept by fpurge, no error feof 1 before and after, ferror 0 (line 5) the same check existed before, passes
unwritten output discarded 0 bytes on disk (line 6) the same check existed before, passes

On main, with the test commit alone, one test, guest_stream_purge, fails; it contains the first three checks and does not fail row by row.

Windows 10 Pro 10.0.19045 and Linux (WSL), one build per commit, on base upstream/main 140d6a4546b, on 2026-11-17 between 03:51 and 03:56 UTC. Windows: the test commit alone built with ninja returning 0 and ctest returned 8, a failing test (the Linux run shows it is guest_stream_purge); a head with the same code as the head of this pull request (the documentation commit has changed only the text of the debt fragment since) built with ninja returning 0 and ctest returned 0. Linux: on commits whose trees equal the three commits of this pull request, ninja returned 0 for all three, the test commit alone aborted guest_stream_purge (1 of 9 tests failed), and the fix commit and the documentation commit passed all 9 tests (guest_stream_purge, file_streams, file_position, guest_binary_word and the five guest_standard_streams* tests) in three runs each; tools/check_conventions.py passed for each commit.

Cost of ungetc: a local benchmark by the author (not in the commits) of 2,000,000 pairs of fgetc and ungetc on a 26-byte file that fits the buffer, three runs per state. Windows: 205.2, 221.3 and 214.7 ns per pair on main, 255.6, 230.9 and 229.9 ns with this change (means 213.7 and 238.8 ns, about +12 %). Linux: 34.8, 35.2 and 34.3 ns on main, 51.8, 42.9 and 43.8 ns with this change (means 34.8 and 46.2 ns, about +11 ns). An earlier version of the change that read the position at every ungetc cost about 40 times as much on Windows and was dropped; the position is now read at fpurge, and ungetc only records the byte and, once per stream, whether the file is a regular file.

tools/check_conventions.py --base upstream/main passes with no error and no warning (the changed entry is 888 characters, counted without the leading '- ', up from 520). The change is 5 files, +122/-6, with no new comments in code. Not tested: macOS, the CI runner, a title process, other firmware, the cases listed above as not measured, and the pushback of std::ungetc calls outside StandardStreams.cpp.

Overlap: the other open pull requests that change one of the four files of this branch (core/libs/prx/libc/include/FileStream.hpp, core/libs/prx/libc/src/StandardStreams.cpp, core/libs/prx/libc/src/StreamPurge.cpp, core/libs/tests/GuestStreamPurge.cpp) or the debt fragment, found by reading the changed files of all 1650 open pull requests at about 05:06 UTC, by reading what they change in docs/dev/debt/libc.md and in the fragments under docs/dev/debt/changes/ for fpurge and ungetc, and by searching their titles and branch names for the same names (no hit), were test-merged on 2026-11-17 at about 05:12 UTC against main a72186d3cfd together with this head; the branch is based on 140d6a4546b, an ancestor of it, merges into main without a conflict, and tools/debt_fold.py --check applies its fragment without an error (checked without the fragment libressl3-20171-inventory.md, which already conflicts with feat-libressl3-evp-pkey-new-mac-key-v2.md on main and is not part of this change). Eleven pull requests list one of the files. Nine of them are unaffected by this change: #12965, #12700, #12688, #12682, #12315, #8150 and #7447 already conflict with main and conflict in the same files with this head merged first, and #22047 and #21721 merge cleanly with main and with this head. Two conflict only with this change: #17459 (fix(libc): grow the pushback room of Windows streams for repeated ungetc) changes 79 lines of FileStream.hpp and StandardStreams.cpp around the same pushback code, and #11831 (feat(libc): implement fcloseall with tracked stream lifetimes) changes FileStream.hpp; both merge cleanly with main and conflict with main plus this head in FileStream.hpp (#17459 also in StandardStreams.cpp). Whichever lands second needs a rebase. #17459 matters beyond the text: it keeps several pushed-back bytes on Windows, while this change remembers only the last pushed-back byte for fpurge, so after both the behaviour of fpurge with more than one pushed-back byte on Windows is not covered by either. The merged result was not built or run. No open pull request changes the fpurge debt entry or a line that names fpurge.

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 (no graphics change)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5351999779 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22143). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-11-17T06:26:43Z. --- ### What On the console, `fpurge` does not move a stream's read position and does not drop a pushed-back byte. A PS5 payload process on firmware 11.60 (`libSceLibcInternal.sprx`) read one byte of a 100-byte file and `ftell` returned 1; after `fpurge` it still returned 1 and the next byte read was the second one (case a, line 3 of the raw output). After `ungetc('Z')` and `fpurge`, the next `fgetc` returned `Z` (case c, line 4). End-of-file status was kept and `ferror` stayed 0 (case d, line 5), and output written with `fputs` and not flushed was discarded: the file had 0 bytes after `fclose` (case b, line 6). The `fpurge` of this library followed FreeBSD 11.4 and discarded buffered input and the pushback without writing or seeking: after the purge, the next read started at the host's position behind the read-ahead data, and the pushed-back byte was gone. The `fpurge` entry in `docs/dev/debt/libc.md` said that the console behavior is unverified. `StreamPurge.cpp` now notes the logical position of a regular file (`ftell`) before the purge and, when a pushed-back byte is still recorded, its position and the byte; after the purge it moves the descriptor back to that position (`_lseeki64` on Windows, `fseeko` elsewhere) and pushes the recorded byte back. `ungetc` in `StandardStreams.cpp` records the byte. `FileStream.hpp` gets three private fields (the recorded bytes, whether they are still valid and a cached "regular file" answer) and the accessors; any other access that goes through the stream status (`SyncStatus`, `SyncUnlockedStatus`) marks the recorded pushback invalid. Pipes, terminals and other streams that cannot be repositioned are purged as before. The debt fragment states the console result and what is still open. Limits of this change, all stated in the pull request and not hidden: (1) a pushed-back byte survives `fpurge` only if no other stream call, `feof` and `ferror` included, happens between the `ungetc` and the `fpurge`; (2) bytes pushed back by `std::ungetc` calls outside `StandardStreams.cpp` are not recorded (`Formatting.cpp` lines 303 and 314, the scanf pushback), while the wide scanner's `ungetc_nid_postfix` call (`ScanningWide.cpp` line 185) is; (3) on Linux the repositioning uses `fseeko`, after which glibc reads the buffer again, so the descriptor's physical position differs from the logical one (the test therefore checks `ftell`); (4) macOS was not built. Not measured on the console: more than one pushed-back byte, a pipe or terminal, and text mode. ### Tested Measured on a PS5 with firmware 11.60 (`kernel_get_fw_version` 0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr) that loads `libSceLibcInternal.sprx` and takes `fopen`, `fclose`, `fgetc`, `fputs`, `ftell`, `ungetc`, `feof`, `ferror`, `fwrite` and `fpurge` with `dlsym` (line 2 shows that all ten were found), on 2026-11-16 at 23:37 UTC, on a temporary file in the probe's own directory on the data partition that was removed at the end. A title process may differ. The cases are 0 to b, lines 2 to 6 of the raw output in the first comment. | Check | PS5 payload process, firmware 11.60 | here (test and fix) | |---|---|---| | after one byte read, `fpurge`: `ftell` 1 and the next byte is the second | `ftell` 1, next `B` (line 3) | checked by `guest_stream_purge`, passes | | `ungetc`, `fpurge`: the pushed-back byte comes back | `Z` returned (line 4) | checked by `guest_stream_purge`, passes | | a pushback that was already read does not come back (also when `fread` read it) | not measured, tested only here | checked by `guest_stream_purge`, passes | | EOF kept by `fpurge`, no error | `feof` 1 before and after, `ferror` 0 (line 5) | the same check existed before, passes | | unwritten output discarded | 0 bytes on disk (line 6) | the same check existed before, passes | On `main`, with the test commit alone, one test, `guest_stream_purge`, fails; it contains the first three checks and does not fail row by row. Windows 10 Pro 10.0.19045 and Linux (WSL), one build per commit, on base `upstream/main` `140d6a4546b`, on 2026-11-17 between 03:51 and 03:56 UTC. Windows: the test commit alone built with `ninja` returning 0 and `ctest` returned 8, a failing test (the Linux run shows it is `guest_stream_purge`); a head with the same code as the head of this pull request (the documentation commit has changed only the text of the debt fragment since) built with `ninja` returning 0 and `ctest` returned 0. Linux: on commits whose trees equal the three commits of this pull request, `ninja` returned 0 for all three, the test commit alone aborted `guest_stream_purge` (1 of 9 tests failed), and the fix commit and the documentation commit passed all 9 tests (`guest_stream_purge`, `file_streams`, `file_position`, `guest_binary_word` and the five `guest_standard_streams*` tests) in three runs each; `tools/check_conventions.py` passed for each commit. Cost of `ungetc`: a local benchmark by the author (not in the commits) of 2,000,000 pairs of `fgetc` and `ungetc` on a 26-byte file that fits the buffer, three runs per state. Windows: 205.2, 221.3 and 214.7 ns per pair on `main`, 255.6, 230.9 and 229.9 ns with this change (means 213.7 and 238.8 ns, about +12 %). Linux: 34.8, 35.2 and 34.3 ns on `main`, 51.8, 42.9 and 43.8 ns with this change (means 34.8 and 46.2 ns, about +11 ns). An earlier version of the change that read the position at every `ungetc` cost about 40 times as much on Windows and was dropped; the position is now read at `fpurge`, and `ungetc` only records the byte and, once per stream, whether the file is a regular file. `tools/check_conventions.py --base upstream/main` passes with no error and no warning (the changed entry is 888 characters, counted without the leading '- ', up from 520). The change is 5 files, +122/-6, with no new comments in code. Not tested: macOS, the CI runner, a title process, other firmware, the cases listed above as not measured, and the pushback of `std::ungetc` calls outside `StandardStreams.cpp`. Overlap: the other open pull requests that change one of the four files of this branch (`core/libs/prx/libc/include/FileStream.hpp`, `core/libs/prx/libc/src/StandardStreams.cpp`, `core/libs/prx/libc/src/StreamPurge.cpp`, `core/libs/tests/GuestStreamPurge.cpp`) or the debt fragment, found by reading the changed files of all 1650 open pull requests at about 05:06 UTC, by reading what they change in `docs/dev/debt/libc.md` and in the fragments under `docs/dev/debt/changes/` for `fpurge` and `ungetc`, and by searching their titles and branch names for the same names (no hit), were test-merged on 2026-11-17 at about 05:12 UTC against `main` `a72186d3cfd` together with this head; the branch is based on `140d6a4546b`, an ancestor of it, merges into `main` without a conflict, and `tools/debt_fold.py --check` applies its fragment without an error (checked without the fragment `libressl3-20171-inventory.md`, which already conflicts with `feat-libressl3-evp-pkey-new-mac-key-v2.md` on `main` and is not part of this change). Eleven pull requests list one of the files. Nine of them are unaffected by this change: #12965, #12700, #12688, #12682, #12315, #8150 and #7447 already conflict with `main` and conflict in the same files with this head merged first, and #22047 and #21721 merge cleanly with `main` and with this head. Two conflict only with this change: #17459 (`fix(libc): grow the pushback room of Windows streams for repeated ungetc`) changes 79 lines of `FileStream.hpp` and `StandardStreams.cpp` around the same pushback code, and #11831 (`feat(libc): implement fcloseall with tracked stream lifetimes`) changes `FileStream.hpp`; both merge cleanly with `main` and conflict with `main` plus this head in `FileStream.hpp` (#17459 also in `StandardStreams.cpp`). Whichever lands second needs a rebase. #17459 matters beyond the text: it keeps several pushed-back bytes on Windows, while this change remembers only the last pushed-back byte for `fpurge`, so after both the behaviour of `fpurge` with more than one pushed-back byte on Windows is not covered by either. The merged result was not built or run. No open pull request changes the `fpurge` debt entry or a line that names `fpurge`. ### 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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a (no graphics change) <!-- 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 -->
PrivacyOnion commented 2026-11-17 06:38:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-17T06:38:22Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 06172539a6:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_stream_purge_tests built cleanly.
  • CTest (guest_stream_purge):
    1/1 Test #973: guest_stream_purge ...............   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libc/include/FileStream.hpp, core/libs/prx/libc/src/StandardStreams.cpp, core/libs/prx/libc/src/StreamPurge.cpp reverted to main and the new tests kept, the suite fails:
    1/1 Test #973: guest_stream_purge ...............Subprocess aborted***Exception:   0.22 sec
    0% tests passed, 1 tests failed out of 1
    
    Restoring the change makes it pass again.
  • Code reading:
    • StreamPurge.cpp: Checked null handling and closed-stream validation: fpurge_nid_postfix correctly validates stream->IsOpen() and delegates null checks through GetStreamHandle/LockedStream to match standard stream wrappers.
    • StreamPurge.cpp: Checked descriptor seek vs logical ftell logic for regular files; verified resume offset calculation when pushback is live (logical + kept.size()) and when descriptor is ahead of logical position.
    • FileStream.hpp & StandardStreams.cpp: Inspected pushback tracking in ungetc_nid_postfix, PushbackLive, NotePushedBackByte, and clearing in SyncStatus / SyncUnlockedStatus / ClearPushback.
    • StreamPurge.cpp: Checked concurrency and stream locking across LockedStream (flockfile/funlockfile) and cross-platform descriptor manipulation (Linux __fpurge, Windows UcrtStreamState, and fallback fpurge).
    • AGENTS.md & Technical Debt: Verified no illegal code comments were introduced, and confirmed docs/dev/debt/changes/fix-libc-fpurge-keep-position.md accurately documents the verified console behavior and remaining unmeasured edge cases.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5934072693 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22143#pullrequestreview-5934072693). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-17T06:38:22Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `06172539a6`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_stream_purge_tests` built cleanly. - **CTest** (`guest_stream_purge`): ``` 1/1 Test #973: guest_stream_purge ............... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libc/include/FileStream.hpp`, `core/libs/prx/libc/src/StandardStreams.cpp`, `core/libs/prx/libc/src/StreamPurge.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/1 Test #973: guest_stream_purge ...............Subprocess aborted***Exception: 0.22 sec 0% tests passed, 1 tests failed out of 1 ``` Restoring the change makes it pass again. - **Code reading**: - StreamPurge.cpp: Checked null handling and closed-stream validation: fpurge_nid_postfix correctly validates stream->IsOpen() and delegates null checks through GetStreamHandle/LockedStream to match standard stream wrappers. - StreamPurge.cpp: Checked descriptor seek vs logical ftell logic for regular files; verified resume offset calculation when pushback is live (logical + kept.size()) and when descriptor is ahead of logical position. - FileStream.hpp & StandardStreams.cpp: Inspected pushback tracking in ungetc_nid_postfix, PushbackLive, NotePushedBackByte, and clearing in SyncStatus / SyncUnlockedStatus / ClearPushback. - StreamPurge.cpp: Checked concurrency and stream locking across LockedStream (flockfile/funlockfile) and cross-platform descriptor manipulation (Linux __fpurge, Windows UcrtStreamState, and fallback fpurge). - AGENTS.md & Technical Debt: Verified no illegal code comments were introduced, and confirmed docs/dev/debt/changes/fix-libc-fpurge-keep-position.md accurately documents the verified console behavior and remaining unmeasured edge cases. Looks Good To Me
MarcZX10 commented 2026-11-20 20:34:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T20:34:15Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 06172539a649fc4798ea4e6c49b60a899ff1dc34 using the prepared diff and repo_read.py for changed files and targeted context. No tests or builds were run during this review.

Results

Check Result Note
Diff and changed-file review passed Five changed files read
Tests and build not run Author-reported results only

Findings

Blocking

None.

Non-blocking

  • fpurge_nid_postfix ignores errors from SeekDescriptor and subsequent ungetc calls, then reports success. A failed reposition can leave the stream at the wrong position while returning success. Consider propagating those failures and preserving appropriate stream status. (core/libs/prx/libc/src/StreamPurge.cpp:70-72)

Not verified

  • No tests, builds, Windows or Linux checks, or console runs were performed as part of this review; the checks described in the PR body are author-reported.
  • macOS, title-process behavior, other firmware, text mode, and multiple pushed-back bytes were not verified.
  • All five changed files listed in the manifest were read: FileStream.hpp, StandardStreams.cpp, StreamPurge.cpp, GuestStreamPurge.cpp, and fix-libc-fpurge-keep-position.md. files.json was unavailable through the reader, so no additional excluded-file inventory was verified.

To get this to a good state

Nothing is required. Consider handling reposition and pushback failures in fpurge_nid_postfix.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5998986669 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22143#pullrequestreview-5998986669). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T20:34:15Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `06172539a649fc4798ea4e6c49b60a899ff1dc34` using the prepared diff and `repo_read.py` for changed files and targeted context. No tests or builds were run during this review. ## Results | Check | Result | Note | |---|---|---| | Diff and changed-file review | passed | Five changed files read | | Tests and build | not run | Author-reported results only | ## Findings ### Blocking None. ### Non-blocking - `fpurge_nid_postfix` ignores errors from `SeekDescriptor` and subsequent `ungetc` calls, then reports success. A failed reposition can leave the stream at the wrong position while returning success. Consider propagating those failures and preserving appropriate stream status. (`core/libs/prx/libc/src/StreamPurge.cpp:70-72`) ## Not verified - No tests, builds, Windows or Linux checks, or console runs were performed as part of this review; the checks described in the PR body are author-reported. - macOS, title-process behavior, other firmware, text mode, and multiple pushed-back bytes were not verified. - All five changed files listed in the manifest were read: `FileStream.hpp`, `StandardStreams.cpp`, `StreamPurge.cpp`, `GuestStreamPurge.cpp`, and `fix-libc-fpurge-keep-position.md`. `files.json` was unavailable through the reader, so no additional excluded-file inventory was verified. ## To get this to a good state Nothing is required. Consider handling reposition and pushback failures in `fpurge_nid_postfix`.
MarcZX10 commented 2026-11-25 03:07:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T03:07:59Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the reviewed code supports merging, with the documented scope limits for pushback tracking and unmeasured platforms and stream types.

What I ran

Reviewed head ee656502bf9d5e71b3c91e9f15b5bf799e7c3fa2 using repo_read.py for the prepared diff and targeted source. No commands, builds, or tests were run in this session; test results below are author-reported.

Results

Check Result Note
Source review passed Five changed files read
Build and tests here not run No execution available
Author-reported checks passed Linux and Windows builds and tests reported passing on fix head

Findings

Blocking

None.

Non-blocking

  • Pushback preservation is deliberately limited to bytes recorded by the standard ungetc wrapper and to the case where no intervening stream operation clears the live marker. The description documents these limits; multiple pushed-back bytes, text mode, and console behavior beyond the reported cases remain unmeasured.

Not verified

  • No tests or builds were run in this review session. macOS, CI, title processes, other firmware, and the unmeasured console cases were not verified.
  • The complete text of every changed file was read; files.json was unavailable. No other files were read.

To get this to a good state

Nothing is required. Optional: extend coverage for multiple pushbacks and additional console stream types when measurements are available.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6051271194 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22143#pullrequestreview-6051271194). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T03:07:59Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the reviewed code supports merging, with the documented scope limits for pushback tracking and unmeasured platforms and stream types. ## What I ran Reviewed head `ee656502bf9d5e71b3c91e9f15b5bf799e7c3fa2` using `repo_read.py` for the prepared diff and targeted source. No commands, builds, or tests were run in this session; test results below are author-reported. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Five changed files read | | Build and tests here | not run | No execution available | | Author-reported checks | passed | Linux and Windows builds and tests reported passing on fix head | ## Findings ### Blocking None. ### Non-blocking - Pushback preservation is deliberately limited to bytes recorded by the standard `ungetc` wrapper and to the case where no intervening stream operation clears the live marker. The description documents these limits; multiple pushed-back bytes, text mode, and console behavior beyond the reported cases remain unmeasured. ## Not verified - No tests or builds were run in this review session. macOS, CI, title processes, other firmware, and the unmeasured console cases were not verified. - The complete text of every changed file was read; `files.json` was unavailable. No other files were read. ## To get this to a good state Nothing is required. Optional: extend coverage for multiple pushbacks and additional console stream types when measurements are 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!22143
No description provided.