fix(libc): retain pending pushback across consecutive purges #27497
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27497"
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 JJenkx on 2026-11-26T15:00:30Z.
What
fpurgerestores a regular file's pending pushback, but its final status update invalidates the pushback bookkeeping. A second purge therefore loses the same pending byte. Restore the bookkeeping after that status update so consecutive purges preserve the bytes and their order; reading them still invalidates the record so consumed input does not return.This extends the existing keep-pushback model from merged #22143. The reported firmware 11.60 measurements there cover a single purge, not consecutive purges. The debt fragment explicitly distinguishes the new host-tested sequence from console measurements and retains the other intervening-operation, multi-byte, pipe/terminal and text-mode limitations. No new console result is claimed.
Tested
Fixture-only follow-up at
bc5b4118bbc1c8bdc7401e3a218ecac808fbd08a: the revisedGuestStreamPurge.cppwas compiled in isolation with GCC 16.2.1, Release, and passed on Linux against the unchanged raw provider from8dccb31affee0c6cf5bed802c6b8181926a68b9d. Loader records verify that exact provider; its SHA-256 is unchanged. Conventions on the committed follow-up, debt-fold and whitespace checks pass. This follow-up did not rebuild the SDK, run the full CTest suite or execute Windows/macOS/console/title/GPU tests. Earlier qualification below retains its pinned revisions.Both fixture patches, full sources, compile commands, execution/loader logs and hashes, SHA-256
fb3a384481f3f1eea32726bbdc8332f829aed354901740ed14b021a57ffeaaf0; anonymous download and all 21 payload hashes verified.Review fixture update (2026-11-26): addressed the buffer ownership finding from #27497 review.
CheckRepeatedPurgeWithMultipleBytesnow callsstd::setvbuf(file.native, nullptr, _IOFBF, 4096)before any I/O, selecting a CRT-owned buffer that the Windows helper can grow. Production buffering is unchanged. Windows execution remains paused and unqualified.2026-11-26, Linux 7.3.5-arch1-1 x86-64, GCC 16.2.1, Release. Base
af6a58c4d30bbc8901b5855081002cd965254b7c; head8dccb31affee0c6cf5bed802c6b8181926a68b9d. Fresh independent source/build, 49 verified submodules.libspatched-SDK andrelinkerbuild passes at the final head; artifact receipts include the patched/raw libc and relinker hashes.cfa8c693cc959d2df7a024476ff830851ec1b90ebe79243fa923e91fc275dd82) passes against the fixed provider and aborts atthe pending byte survives repeated purgesagainst the preserved main provider. Only the fixture differs from main in that control. Loader records verify both providers;ldd -r, conventions, debt-fold and whitespace checks pass.2b1eec1ddd570840d07439af97d489703e0391a0) is clean after placing the two sets of test cases in separate sections. That combined tree is not built or runtime-qualified. This PR does not depend on #27494.Patch, final fixture, SDK/build logs, JUnit, loader records, source and artifact hashes, SHA-256
632c0783dd484ba256eebf0fa738d983b7739412c5deabfaac580d61b66cc9ec; anonymous download and all 33 payload hashes verified. No Windows/macOS, patched-SDK execution, title/GPU, performance or full-suite result is claimed.The export lookup found only #11831 touching
fpurge. The final global branch scan examined 2,409 open PRs and no longer reports the former test-placement conflict with #27494. It still fails closed for #11831's sharedStreamPurge.cppbecause that branch conflicts with main. Manual review of exact head6d970d904f8ef9c952e60587d3ab094cb871fe5cshows its entire shared-file patch adds the stream-operation gate and replaces the initial open check; it does not implement this replay/tracking change. This is source disposition, not a clean full peer merge or runtime comparison.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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T15:10:46Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
8dccb31affee0c6cf5bed802c6b8181926a68b9dusing the prepared diff and pinned repository reader. No build or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build logs, test output, console behavior, and the excluded-file list were not independently inspected. All three changed files listed in the manifest were read; no files listed as excluded were available to inspect in the review folder.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T21:00:00Z.
Review: COMMENTED
Actionable comments posted: 1
fbbb8734-5d67-4853-9e23-ce40c7a274f3Reviewing files that changed from the base of the PR and between
8dccb31affandbc5b4118bb.core/libs/tests/GuestStreamPurge.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T21:06:28Z.
Review: APPROVED
Reviewed — looks good
Nothing in the reviewed changes blocks merging; the focused tests are reported as passing, and the implementation restores pushback tracking after status synchronization invalidates it.
What I ran
Reviewed head
bc5b4118bbc1c8bdc7401e3a218ecac808fbd08a. No commands or tests were run; the PR description reports the test results.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests were run independently. Windows, macOS, console, title, GPU, and full-suite behavior were not verified. All files listed under
reviewedinfiles.jsonwere read; no files were excluded from this review.