feat(libc): implement fcloseall with tracked stream lifetimes #11831
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11831"
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 B-Howell on 2026-10-27T09:03:11Z.
What
Implement the named fcloseall export using FreeBSD 11.4's void __fcloseall/_fwalk(fclose) behavior: visit streams present at entry and ignore individual close errors. The public PS5 3.20 libSceLibcInternal inventory establishes the export name; its console signature and edge cases have not been measured.
Tracked registrations, pinned wrapper lifetimes and shared per-native-stream gates let close-all coordinate with fclose, freopen and explicit stream locks without holding the registry mutex across blocking native operations. Windows reopen retains native FILE identity; aliases follow successful and failed reopen. Host output preservation completes before destructive closure. Known limitations are recorded in libc debt.
Draft: #10755 kernel descriptor-state cleanup is an implementation prerequisite for correct guest-descriptor reuse after fcloseall, not merely a proposed landing order. In the accepted same-main private comparison, the Windows #11831-alone close-all control
4e714d379658486989f0587195a321b7b116f76fexits 204 at stale status flags after descriptor reuse; compositionebd07d1d6b48e08fd32a60bd561239eede4816aewith exact #1075592f4276f28e9643fe7e336e1cc40ee02f30277dapasses 13 focused cases three times each (39 passes) on each of Windows and Linux (results). That historical comparison did not update public #11831; the later candidate7f6aca1154is summarized below, and neither public branch was changed by the comparison. Ragbie agreed in comment #6545147764 that #10755 lands first and #11831 follows on top, preserving descriptor cleanup, FILE-before-descriptor lock order and release-before-open. This resolves the author-order acknowledgement. #10755 landed upstream on 2026-11-02 (mergefc3a5af62c); that does not retarget the historical candidate results below. #9763 and #10929 have landed and their closed-stream/pending-UTF16 behavior is retained in the current-main integration below. #11872 is closed, so it is no longer listed as an open dependency. The former #11872-before-#11831 agreement is historical, not proof that its cancellation implementation landed. Candidate7f6aca1154incorporates #10755 as an ancestor; its recorded tests remain tied to that historical candidate and do not qualify the present #11831 head. Reviewer acceptance is separate. Existing overlap reports remain pinned to their declared heads; this main integration does not refresh every historical comparison. The earlier October 29 warning snapshot contained 170 candidates. The frozen overlap-bot snapshot updated2026-10-30T00:18:59Zcontains 45 rows: 10 compared conflicts and 35 skipped comparisons. The mapped source evidence covers all 45 pinned candidate heads and shared paths (79 complete shared-file patches), with no missing head or path in that snapshot. This is source coverage only: historical reviews retain their original target pins, and it does not establish the same semantic effect on changed context, clean pairwise integration, runtime compatibility or author agreement. Existing lifecycle/cancellation composition obligations, including #12682/#12688/#12700/#12965, remain separate and are not cleared by the private #10755 result.2026-10-31 selected overlap follow-through: the edited bot comment has 59 table-row appearances across 56 distinct PR IDs (16 compared, 43 skipped); #12688, #12700 and #12965 each appear twice. Manual current-head review covered the 15 selected CMake/source-registration hunks and four changed libc debt entries, alongside selected lifecycle source seams. The registrations are distinct from this PR’s close-stream tests; #9557 and #9566 share one target in their declared stack, while the four math debt entries are separate from stream-close debt. The lifecycle notes preserve close-note capture/delivery ordering, archive detach before descriptor teardown, orientation resets, random-device reopen handling, and the declared cancellation-family composition order. These are selected-path source dispositions, not full reviews of the other PRs or runtime/test results; they do not add a dependency or clear the existing landing, review, or hosted-check gates.
Reference: https://github.com/freebsd/freebsd-src/blob/releng/11.4/lib/libc/stdio/fcloseall.c and https://github.com/freebsd/freebsd-src/blob/releng/11.4/lib/libc/stdio/fwalk.c.
Tested
64fd5ee977b(CodeRabbit review 6091260171): Windows freopen moves a descriptor into the kept FILE instead of opening a second stream; a failed glibc freopen drops a non-standard stream's lock record instead of unlocking a FILE glibc 2.41 frees; the /dev/random reopen shares the regular rollback, which no longer throws while unwinding; alias sync after a reopen follows the shared FILE, not the gate. New children--freopen-exhausted-slots-child,--closed-alias-reopen-child,--freopen-failed-lock-childand twoFreopenExceptionCleanupChildcases; with each fix reverted they exit 233, 224, 181 and terminate. Windows 11, WinLibs GCC 15.2.0 r7, Release:file_streams(5/5 with--repeat until-fail:5), the fiveguest_standard_streams,guest_stream_purge,guest_fopen_errors,guest_libc_file_lock,guest_stream_close,guest_freopen_host_standardandguest_freopen_host_logpass, 12/12. Linux: changed files passg++ -fsyntax-only(GCC 11.4); not rebuilt locally. Conventions pass.6d970d904f8(MarcZX10 review 6053309746): fread, fwrite, fgetc, fputc, fgets, fputs, ungetc, fseek/ftell, fflush, fileno, setvbuf, fpurge, feof/ferror/clearerr, fwide, the printf/scanf and wide families, puts, perror and putw now pin the stream and hold its close/reopen gate until they return, sofclose,freopenandfcloseallwait for an operation in progress. The_unlockedvariants still take no lock (CheckUnlockedStreamLockrequires that). New--fcloseall-read-in-progress-child: anfreadblocked on a pipe keeps the stream open whilefcloseallwaits, returns the data, and a laterfreadgets EBADF; on3a0ebf711a0it hangs and the watchdog exits 69. WSL Ubuntu 22.04, GCC 11.4, Release:file_streams,file_stream_status, the fiveguest_standard_streams,guest_stream_purge,guest_fwide,guest_wide_stream_scan,guest_formatting,guest_stream_close,log_file,guest_freopen_host_standardand theguest_freopen_host_logcases pass 3/3 with--repeat until-fail:3(_keep_return_failureonce, with its fixture). Conventions pass. Windows and macOS not run locally.1c17f817b39merges mainc8d5f91168d. OnlyFileStream.hppconflicted, against #17459 (c8d5f91168d, Windows streams grow their pushback room for repeatedungetc): kept this PR's registry, gate and atomic handle, and added main's pushback-buffer release to the destructor,Detach,Adopt,ReopenandCloseNativeUnderGate.Reopenalso releases a buffer an alias of the same FILE grew, before the handle is reopened, so no alias keeps a buffer the reopened stream still points at. Windows (WinLibs GCC 15.2.0 r7, Release/Ninja):file_streams,file_stream_status, theguest_standard_streamscases (including #17459's),guest_freopen_host_standardandguest_freopen_host_log*pass, 11/11. WSL Ubuntu 22.04, GCC 11.4, Release: the same set passes, 12/12.debt_fold.py --checkand conventions pass. macOS not run locally.9ffa56b8e3merged into main, full ctest suite (6495 tests), WinLibs GCC 15.2.0. Windows Server 2025: 0 failures in both runs. Windows Server 2022: 2 and 3 failures, all of which also fail on main on that machine. Nothing fails only with this PR.ce7cc3d5e4bmerges main2b718a22fe1. OnlyFileStream.hppconflicted, against main commit36651ef7fd2from #23948 (freopen clears the orientation when it reopens a closed stream): kept this PR'sunique_ptrguard that closes the new FILE ifAdoptfails, then main's orientation reset. Main's macOSDropFailedUnbufferedWrite(9ce1ab4fc5d, #21721) now reads the handle through the same atomic load asSyncStatus. WSL Ubuntu 22.04, GCC 11.4, Release:file_streams,file_stream_status, the fiveguest_standard_streams,guest_freopen_host_standard,guest_freopen_host_logand_keep_failurepass 3/3 with--repeat until-fail:3.debt_fold.py --checkand conventions pass. Windows and macOS not run locally.fe6d7839da2(MarcZX10 review 5921060792): a thread that holdsflockfileand then callsfcloseallorfcloseno longer leaves the host FILE locked or itsfunlockfilethrowing. Lock calls record each native lock; closing a native stream releases the owner's held locks beforefclose, and the later unlock only releases the gate and pin. New--owner-locked-close-childcase exits 151 on169b0edf3a0. Windows 11, WinLibs GCC 15.2.0 r7, Release:file_streams,guest_freopen_host_standard,guest_freopen_host_logpass 3/3 with--repeat until-fail:3, andguest_binary_word,guest_filesystem,guest_filesystem_error, the fiveguest_standard_streams,guest_libc_internal_filebuf_unlock,guest_host_standard_error_windows,guest_stream_closepass. WSL Ubuntu 22.04, GCC 11.4, Release:file_streams,guest_freopen_host_standard,guest_freopen_host_log,guest_stream_close,guest_binary_wordand the fiveguest_standard_streamspass 3/3. Conventions pass.af5efff88b9fixes the Windowsfile_streamsfailure on62f3917e9b9(fcloseall child failed, child exit 62): the Windows-only check that exhausted the CRT stream table still expectedfcloseallto throw. That case now runs in its own child and expectsfcloseallto return normally and close the guest streams. Windows 11, WinLibs GCC 15.2.0 r7, Release:file_streamspasses 10/10 with--repeat until-fail:10; the old test rebuilt on the same tree exits 62 as on CI. Conventions pass. The Linux path only gains an empty child; not rebuilt locally.62f3917e9b9(fcloseall ignores a failed keep of host fd 1 or 2, as freopen does; debt fragment rewrites the_Filesentry). WSL Ubuntu 22.04, GCC 11.4:file_streamswith the new closed-host-standard child,guest_freopen_host_standardand the fourguest_freopen_host_logcases pass 3/3; the new child fails on the previousfcloseall.debt_fold.py --checkand conventions pass. Windows not run locally.e7e050bc54dmerges maina6fbf9ce963(onlydocs/dev/debt/libc.mdconflicted; both entries kept). WSL Ubuntu 22.04, GCC 11.4, Release: 14 of the 15 focused cases (public_headers,guest_stream_purge, the fiveguest_standard_streams,file_stream_status,file_streams,guest_freopen_host_standard,guest_freopen_host_log,_keep_failure,_native_closed_stdout,log_file) pass 3/3 with--repeat until-fail:3;guest_freopen_host_log_keep_return_failureconsumes its fixture's baseline file once, so it passes 3/3 when run with its setup each time but fails a--repeatsecond pass. Windows not run.Main-refresh candidate
4a435cca770907c13c2445505b3f7ef8fc7881cc, tree77eb45c4ad8ce58f4ed6a66852242ed71436b069, ordinary parents136c01112bef728d3b2937634665575f3430cc7cand frozen tested mainfd41cca5d9133081edc27e21f87f53d73b6aa53b:file_streamsinvocations using unique child-onlyANYPS5_LOG_FILEpaths (3 passes). All fiveguest_standard_streamscases are included: default, closed stdout, exclusive stdout, reopen closed stdout, update stdout. Other cases:public_headersaudit,guest_stream_purge,file_stream_status,file_streams,guest_freopen_host_standard, and Windowsguest_stream_buffer_host_writeor Linuxlog_file. Internal FileStreams child modes are not additional registered cases. Explicit 10/20/90-second timeouts remain; other selected cases use a 30-second runner limit./tmpscratch has bounded before/after observations only; transient actual paths and cleanup success are unknown. Those earlier pins do not qualify #10755 descriptor reuse; the later 7f6 candidate results are described below. At the time of this earlier qualification, #10755 had not landed; candidate 7f6 is a historical tested composition, not a current-head qualification. Human/CI gates remain, the author-order acknowledgement is complete, and this PR stays draft. This does not clear every current overlap row. Install/export, full-suite, separate scanner/strerror_s/UDP correctness, console/title/GPU and cancellation-family scope remain untested.The previous
136c01112bef728d3b2937634665575f3430cc7c42-pass qualification remains historical. Historical verification below retains its original source pins and controls; none is retargeted to this candidate.Historical published integration commit
beba15a60f1223d6db34cc79cd282cb75a081c0d, treea7dcbf9df5df5f8f3ab6b1e95f1d0d4873addd6f, ordinary merge of main4c8cff191609bc5f28bf9ee2f93672b531285aa4into existing head3aac4f32d3fced7f0558a47541e517c2715ae246:cmake --build build --target file_streams_tests guest_freopen_host_standard_tests guest_standard_stream_tests guest_wide_stream_scan_tests --parallel 2passes.ctest --test-dir build -R '^(file_streams|guest_freopen_host_standard|guest_standard_streams.*|guest_wide_stream_scan|public_headers)$' --output-on-failure --repeat until-fail:3: 9/9 cases, each three repetitions, final restored run 64.25 seconds. Includes the lifetime child checks, closed-wrapper revival, snapshot publication and landed supplementary-wide-read/pushback regressions.getwc/freopenalias regression leaves low surrogates pending on source and alias, then reads the replacement file without stale halves. Removing only the two pending-state alias assignments and rebuilding actual libc madefile_streamsfail withReopen must discard the alias's old low surrogate(CTest 8, process 0xc0000409). Restored exact staged source, rebuilt all four targets, and obtained the final 9/9 result above.Main merge
165f564f34132c1b5bdfe2b0b1f42ff2099c13a8, ordinary parents2c70c9968099c484bcf37a5cf277993ab2506c4eand mainf3688ae7e30188e9c855243e36d7a8a071496238, which resolves the #16170 conflict inFileStreams.cppby keeping bothmain()calls:file_streamspassed 3/3. Conventions againstf3688ae7pass.Fix
358f4fa52983cd463a4bea71a959116badb1cba6(parent165f564f), which arms thefreopencleanup beforeFileStream::Reopenso a throwing reopen closes and retires the stream:Ubuntu 22.04 WSL2 / GCC 11.4, Release:
file_streamsandguest_freopen_host_standardpassed 3/3 each. The new--freopen-exception-childcase makes the closing-descriptor hook throwbad_allocinsideReopen; with only the test applied (no fix)file_streamsfailed with child exit 193 (the stream was still registered). Its Windows-only half, where the directory-descriptor duplicate throws, did not run: the Windows checkout used has no ICU submodule and cannot build, so it relies on Windows CI. WinLibs GCC 15.2.0-fsyntax-onlyonFileStreams.cpppassed.guest_standard_streams(the default case) aborts in this WSL checkout on both165f564fand this fix when standard output is redirected; the other four cases pass. Conventions againstorigin/mainpass.On
ed163c8a88e: ordinary merge ofmain667dbde5131to pick up #19618, which reverted the CES change that madeguest_ces_widetime out on Windows (the previous Windows run built on a main from before the revert). Clean merge with no code file in common, so not rebuilt. Conventions passed.Debt fragment
9e7ed25001: merged mainc3d38470e0cand moved this PR's debt edits intodocs/dev/debt/changes/codex-libc-fcloseall.md; the debt files match main, and the fragment applied to main gives the same debt lines as the previous head.debt_fold.py --checkandcheck_conventions.py --base origin/mainpass. Documentation only, no build.On
8a0fe296b36: ordinary merge ofmain1bc92752d23. Conflicts inFileStream.hpp(main's pushback bookkeeping and regular-file cache kept beside this PR's registry, gate and atomic handle) andFormattingWide.cpp(main's guest-string copy kept, then this PR'sFileStreamOperation). Main's newgetdelimnow holds aFileStreamOperationtoo. From @JJenkx's integration note:SynchronizeFileStreamAliases_nid_no_patchnow clears the source's and each alias's recorded pushback and copies the source's reset regular-file cache; newCheckPushbackStateAfterAliasReopeninFileStreams.cpp. Windows 11, WinLibs GCC 15.2.0 r7, Release:file_streams,guest_freopen_host_standard,guest_freopen_host_logand its twokeep_returncases pass 3/3; with onlyFileAndHeap.cppreverted to the previous commit,file_streamsfails withReopen must reset the alias's regular-file cache. Linux and macOS not run locally.check_conventions.py --base origin/mainpasses.On
4d8419eb351: second CodeRabbit round. A closed stream reopened byfreopenno longer hands its new file to aliases closed with it; when rollback cannot close the oldFILEthe stream stays open and registered; directory-open failures are translated to guest errno once; the host standard directory reopen closes its temporary descriptor when the duplicate throws; a failedfreopenno longer erases a reused address's explicit-lock record; the failed-lock child checks the running glibc. The Windows extra-descriptor case is a recorded gap. Windows 11, WinLibs GCC 15.2.0 r7, Release:file_streamspasses 3/3; reverting each fix alone fails it with child exit 273 (alias), 184 (rollback), 264 (errno) and 268 (descriptor). Ubuntu 22.04 WSL2, GCC 11.4, Release:file_streamspasses 3/3, the fiveguest_freopen_host*cases pass 6/6 plain runs, and the alias and rollback reverts fail with 17 (273 mod 256) and 184. macOS not run.check_conventions.py --base origin/mainpasses.On
eb45c76240b: third CodeRabbit round.Reopentakes a registry snapshot when it starts, and alias synchronization skips streams registered after it, so a stream opened while the nativefreopenruns (and reusing the oldFILEaddress) keeps its own handle. Windows 11, WinLibs GCC 15.2.0 r7, Release:file_streamspasses 3/3; removing the snapshot check fails the new case ("Synchronization must leave a stream registered after the snapshot unchanged"). Ubuntu 22.04 WSL2, GCC 11.4, Release:file_streamsand the fiveguest_freopen_host*cases pass 6/6. macOS not run.check_conventions.py --base origin/mainpasses.Checklist
Based on current
main; no other open PR implements the same functionsOne 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 fileNo notes, investigation
.mdfiles 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
CI configuration prerequisite — 2026-10-30
CI-only integration
035245f793d7157dc0ea9a1219ced0bbafeca85d(tree8cabff0d10a59c419afec7badfb05f57e54acbaa) retains original #13220 commite9f09f54fabb6408d3e2711b8df10c10112ab00eas its second merge parent, after4a435cca770907c13c2445505b3f7ef8fc7881cc. Whole-tree and source-pin verification confirms onlycore/libs/tests/write_watch/CMakeLists.txtchanges: five lines deleting the repeated execute-fault/read-fault registration. No libc implementation or fixture source changes.Configuration-only comparison used the exact exported four-file graphs: the old graphs match across #11831/#12271, the fixed graphs match across both integrations, and all three companion C++ files are unchanged. Two shared arms per OS were configured serially: Windows CMake 4.4.4 / WinLibs GCC 15.2.0 r7 / Ninja 1.13.2 and WSL CMake 3.22.1 / GCC 11.4 / Ninja 1.10.1. Both old arms failed on both duplicate names after genuine native compiler/Threads probes; both fixed arms configured/generated successfully. Each fixed generated inventory contains exactly 18 unique name/executable/mode mappings with 30-second timeouts. These are four configure checks (two expected RED, two GREEN), not 18 runtime passes. No fixture build or CTest execution occurred.
The 72 native passes remain pinned to
4a435cca770907c13c2445505b3f7ef8fc7881cc/ frozenfd41cca5d9133081edc27e21f87f53d73b6aa53b; they were not rerun or retargeted to this integration. As of this 2026-10-30 configuration check, upstream #10755 landing remained required; that historical status is superseded by the current dependency summary below. Human/bot review and verified main landing remain open; author-order agreement is recorded above. This PR stays draft.New-head hosted CI qualification remains pending after publication. No macOS tests were run locally; the earlier hosted failure and all historical results retain their original heads. This configuration result does not establish platform/runtime, whole-product or dependency-order clearance.
Host-stream integration and focused follow-up — 2026-10-30
Candidate
0db63ae0011f859a41c04f6d277835f39e1c9938retains public035245f793d7157dc0ea9a1219ced0bbafeca85d, the ordinary main merge anchored to deliberately frozenbadd7cd5b8d3f06118d7aced81e8875cc71da407, original #13220e9f09f54fabb6408d3e2711b8df10c10112ab00e, and both original #13390 author commits through its exact head4cf81e1d1d4aebae35b813dd8dc89a118d72beba. This preserves upstream authorship and the existing stream-lifetime/alias logic. It adds #13390's host-output preservation and fixed Windows standard-FILE identity, then restores entry errno when a real keep helper returns a negative result and continues the guest reopen, matching its best-effort failure policy.Focused Release evidence on the same machine (Windows 11 / WinLibs GCC 15.2.0 r7; Ubuntu 22.04 WSL2 / GCC 11.4, glibc 2.35):
a3cb2a218b8754e930e2df68abab7fb581ca5deafails both real stdout/stderr keep-return cases specifically because errno leaks into the native-open callback. Candidateb49bb5c9ba74ab6d9d8df6674e10d3f270ff9041passes ten native cases and one audit-only header check. These runtime pins are retained; Windows was not rerun on the later Linux-only fixture amendments.00b952303c9ab2cf320e74c63dbefec795be3f5cpasses three native cases. Candidate0db63ae0011f859a41c04f6d277835f39e1c9938passes eleven native cases and one audit-only header check, with zero failures/skips. Each arm includes a direct nativefreopensetup in a fresh process and a real-helper/lease/gate/Reopen consumer in another, requiring identical return/errno for the same closed-stdout state and pathname. This is host-outcome coverage, not a Linux RED discriminator or a hardcoded ENOENT requirement.The later source amendments affect only Linux fixture/dispatch and Linux CMake registration; production and Windows test branches remain unchanged. The selected cases cover host-log isolation, both platform-specific keep-failure paths, all five guest-standard-stream modes,
file_streamsandguest_freopen_host_standard. Real production/fixture builds, Release checks, same-arm PE/CTest PATH or ELF/ldd bindings and artifacts were retained; no live CPU PID/module or patched-NID tracing is claimed. Both borrowed workspaces and their prior protected artifacts were restored, and all owned processes ended.This integrates frozen main
badd7cd, not every later main revision. A bounded source check at observed mainf1e340be4a6e67440f1d2b2574ede902140cbed4found the coupled stream implementation/helpers and libc CMake unchanged; two related fixtures switched temporary-file allocation to the shared helper (Linux still usesstd::tmpfile, Windows uses its temp-directory path). That later main context was not integrated or runtime-qualified here. All older qualifications above remain at their stated pins.As of this 2026-10-30 source follow-up, #10755 and #13220 had not yet landed and #13390 remained open; that paragraph records the dependency status at that time. The historical tests above retain their stated source pins and do not qualify the current #11831 head. This PR remained draft, with current overlap/lifecycle/cancellation obligations and broader platform, full-suite, install/export, console/title/GPU, hosted-CI and review gates still separate.
Combined #10755 candidate evidence —
7f6aca1154The tested candidate
7f6aca115491679bf5db6f693378a127e84f1978includes previous public #11831 head0db63ae0011f859a41c04f6d277835f39e1c9938and original #10755 head92f4276f28e9643fe7e336e1cc40ee02f30277dain its ancestry. On this exact candidate, Windows and Linux each passed three native cases and onepublic_headersaudit-only case: six native passes and two audit-only passes total, with no candidate failures or selected skips. The existing combined results report records the tested source pins and artifacts.The two registered control CTest failures are independently verified. The Linux direct-child exit 180 is retained as the owner's verbatim execution extract; the Windows direct-child exit 180 is session-reported, and its raw invocation output is unavailable. This is bounded candidate-pass evidence with those control-provenance limits, not an independently raw-verified two-OS RED/GREEN claim or full-suite/main/hosted-CI qualification. Hosted CI on the updated PR head remains pending; this PR remains draft until review and landing gates are met.
Main refresh at
30fb1b82— frozen 2026-10-31 source baselineHead
30fb1b82b95d38cc017914bfe2c538ce483bec27(tree9b7165e7203ea1da6195c483fcd3c24b45032e9f) ordinarily merges previous public head7f6aca115491679bf5db6f693378a127e84f1978with main474030e58424fefdb65e5df9f3820810fbb4553c, observed on 2026-10-31. This is the frozen main baseline for this update; later main revisions are not certified here.The only manual conflict resolution retains all four required includes in
FileStreams.cpp: the descriptor, flag and random-device headers from our tested reuse fixture, and main'sTemporaryFile.hpp. Main's temporary-file helper calls and non-Windows Clang variadic aliases are retained. No production logic was manually changed. The close/reopen cleanup implementation, descriptor-reuse assertions and full file-content readback remain unchanged; all other automatic merge results are retained.The six native passes and two audit-only passes above remain pinned to exact
7f6acaand its recorded source/binary pair, including the stated control-provenance limits. They are not test results for30fb1b82.Focused Windows follow-through on exact
30fb1b82used WinLibs GCC 15.2.0 r7, Release/Ninja (CMake 4.3.1, Ninja 1.13.2). The existing cache automatically regenerated for main's refreshed source graph. Building the actualfile_streams_teststarget with at most two jobs exited 0;ctest --test-dir <cache> -R '^file_streams$' -Vpassed the one registered case once (test 665, 1/1, exit 0, 1.50 seconds total). Same-cache executable/libc/libkernel artifacts and generated Windows PATH were retained, and the borrowed checkout was restored to its original branch/HEAD and pins with no owned build/test processes left. No control or other test ran in this follow-through. No Linux, macOS, hosted-CI, whole-product or full-suite result is claimed for30fb1b82.As of the 2026-10-31 candidate, the acknowledged #10755-before-#11831 order remained in force and #13220 and #13390 were still prerequisites. This historical status is superseded by the current dependency summary below; the qualifications above remain pinned to their stated candidates.
Current prerequisite and review status — 2026-11-11
#10755 and #13220 landed upstream. The earlier test results retain their original candidate and baseline commits.
#13390 landed upstream and is included in the current branch. The current-head test results and re-review request cover
2c70c99. MarcZX10 re-reviewed head9e7ed25001on 2026-11-16 with no blocking findings (review), so the PR is ready for review.#11872 closed as superseded by #12682.
Overlap with #12682, #12688, #12700 and #12965 — 2026-11-12
This PR needs none of them: it builds and passes its tests on
mainwithout them, and uses nothing they add. They are one stack by the same author (#12688 depends on #12682, #12700 on both, #12965 on all three); all four are conflicting withmainand #12965 is a draft. They change the sameFileStream::Reopen,FileStream::CloseandClosingDescriptorcode that this PR rewrites, so whichever lands second has to be reworked. Proposed order: this PR first, then the stack on top of it.Depends onstays none here; the order is proposed to their author in the review reply.Summary by CodeRabbit
Bug Fixes
Tests
Documentation
fcloseandfcloseallbehavior and limitations.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T09:09:49Z.
Review: COMMENTED
I checked the three declared predecessors: #9763, #10755 and #10929 are all still open, and I could not find a public acknowledgement in their PR discussions confirming an agreed landing order. The description says this is a draft pending that agreement, so I am leaving the code review pending rather than requesting a code change or approving it. The contribution rule requires the overlapping authors to agree which PR lands first and to record the dependency.
The current build workflow has its Windows job in progress and Linux product tests skipped; the author reports the focused Windows/UCRT tests, but no POSIX runtime run. Please link the agreed order when it is settled and revisit POSIX coverage before marking this ready.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T09:16:17Z.
Review: COMMENTED
The focused checks have useful results now: the relinker builds on Windows, but its CTest run failed 1 of 369 tests because
web_releaseexceeded its 20-second timeout; the other 368 passed. The PR changes no web tooling, so this looks unrelated to the diff, but the failed check should be understood or rerun before treating the matrix as green. The Linux relinker, relinker ASan, Ubuntu register-context, conventions, intake, labels, and eligibility jobs passed. Windows product tests and several macOS jobs are still pending; Linux product was skipped.One readiness item: this PR's base SHA is
5bc84038c490a0427ff272e39e2a1cdf6fdc3c0e, while currentmainis801d5b9bc11049e6274daca09d70690bd5b8d0a9. CONTRIBUTING asks PR branches to stay current withmain, and the body describes this tested branch as based on5bc8403. Please update/retest against the current base before marking this draft ready. Since the PR is draft, I am leaving a comment rather than approving it.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T09:21:59Z.
Review: CHANGES_REQUESTED
I checked the updated head
1ec2f73ee67254dac42ad634b47d347e723c6a3d; the implementation is unchanged, but the commit removes thefclosealldebt entry. The PR body still says the console signature and edge cases have not been measured. That is an unresolved gap under the repository's documentation rules, so please retain a concise debt entry limited to the unverified console signature/behavior and relevant boundary conditions; the implementation itself need not be restated as debt.On integration order, I can assess the technical overlap, but I cannot confirm agreement on behalf of #9763, #10755, or #10929's authors. All three remain open, and #10929 currently has change requests for the
ungetwcpushback ordering when a low surrogate is pending. Please keep this draft until the affected authors agree to the order and that blocking issue is resolved. I am requesting changes for the missing debt note and unresolved integration agreement, not asserting a new runtime failure in this unchanged implementation.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T04:33:04Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
On head
165f564f34132c1b5bdfe2b0b1f42ff2099c13a8, an exceptional Windows directoryfreopenpath can leave a closed dynamic stream registered, and the unresolved shared cancellation changes still have no agreed landing order recorded.What I ran
I reviewed the PR-specific changes from merge parent
f3688ae7e30188e9c855243e36d7a8a071496238through head165f564f34132c1b5bdfe2b0b1f42ff2099c13a8. No merged-preview build was run. The no-build precheck started against base84fbc2328c1e3c021f5a0b9f67ea9bebc2ccaa43; the base moved to4feeb71951c4e60592543e97b1a5195b8d36419cduring that run, while the PR head stayed unchanged. At the final live refresh,mainwasc85dcfd0056e0e341c3a2f5e285c94602353a7b7.Environment: Linux 6.1, Python 3.11.2, GCC C++ 12.2.0. I read all nine changed files, the current PR discussion, the repository contribution rules, the cleanup and directory-descriptor paths, and the registered focused tests.
The author reports
file_streamspassed 3/3 on this head; I did not run that test.Results
Recorded commands and selected output
Output: no lines; exit 0.
Precheck report excerpt:
Test-quality heuristic stdout (unmodified):
Negative control
Findings
Blocking
ReopenCleanupguard remains unarmed untilFileStream::Reopenreturns. In the directory-stream path,Reopencan throw while duplicating the directory descriptor: the kernel records the duplicated descriptor in astd::map, whose insertion can allocate. The local catch rethrows after theFILE*has been cleared; the outerbad_allochandler returnsnullptr. Because the guard is still unarmed, it does not retire the dynamicFileStream; the active lease then unpins a registered, unretired wrapper, leaving it in the registry with no native handle. Arm cleanup before entering operations that can throw, while retaining the latercleanup.armed = reopenedassignment for ordinary returns, and add a focused regression for this exceptional path.Depends on: none, but the current description says the shared cancellation integration with #12682, #12688, #12700 and #12965 remains outstanding. Those PRs are open and touch the same libc stream implementation files. The repository requires authors to agree which overlapping change lands first and record it withDepends on. Refresh the overlap report, agree on the landing order with the affected authors, and update the checklist; this review does not assume which PR must go first.Non-blocking
Sources
Depends onruleNot verified
file_streamsresult is author-reported only.maintip.To get this to a good state
Arm the cleanup for exceptional
freopenexits, add a focused regression, and record the agreed order for the overlapping cancellation work. On the resulting head, I will rerun the exact-head no-build checks and review the updated hosted CI before reconsidering the outcome.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T06:55:31Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed source shows the close-all registry and lifecycle implementation, but the full changed-file review and runtime checks are incomplete, so a formal approval is not justified.
What I ran
Reviewed head
ed163c8a88e7a3e36403893ae799258a364ea1a2. No build or tests were run. I read the prepared description, commit list, manifest, and relevant diff hunks, then used the pinned reader for targeted source context.Results
Negative control
Not run.
Findings
Blocking
None verified in the source inspected.
Non-blocking
None.
Sources
Not verified
The change description reports historical and current-head test results, but those were not independently run here. I read targeted portions of
FileStream.hpp,FileAndHeap.cpp, andRuntimeSupport.cpp, plus the diff hunks forCMakeLists.txt,Api.hpp, andFileStreams.cpp. I did not read the changedGuestFreopenHostLog.cpp,GuestFreopenHostStandard.cpp, ordocs/dev/debt/libc.mdcontents, nor the remainder of the test diff. Thus the changed files in the manifest are not all fully reviewed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T01:45:13Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected implementation adds snapshot-based stream closure and per-stream gates; this review is incomplete because I did not read every changed file or run checks.
What I ran
Reviewed head
9e7ed250015aa8d0c89fb417a636f8176ed42efeusing the prepared diff andrepo_read.py. No build or tests were run.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
None.
Not verified
The changed files reviewed are
core/libs/prx/libc/CMakeLists.txt,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/include/FileStream.hpp,core/libs/prx/libc/src/FileAndHeap.cpp,core/libs/prx/libc/src/RuntimeSupport.cpp,core/libs/tests/FileStreams.cpp, anddocs/dev/debt/changes/codex-libc-fcloseall.md; several were read only in selected ranges.core/libs/tests/GuestFreopenHostLog.cppandcore/libs/tests/GuestFreopenHostStandard.cppwere not read. No files were excluded by the manifest. Build/test behavior, console behavior, and the unread code were not verified.To get this to a good state
Nothing is required. The optional next step is to finish reviewing the unread changed files and run the relevant checks before making a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T03:18:36Z.
Review: COMMENTED
Reviewed — comments
The pinned change implements tracked stream lifetimes and
fcloseall; this review was incomplete because I inspected only selected hunks and did not read every changed file or run checks.What I ran
Read the prepared description, commit summary, manifest, and selected diff hunks at head
62f3917e9b90c60211e771f45f9c5815089a7f49. No commands or tests were run.Results
Findings
Blocking
None verified in the inspected hunks.
Non-blocking
None.
Not verified
The review did not read all changed files or inspect all relevant callers, so correctness, edge cases, and the absence of blocking defects are not established. Tests cited in the PR description are author-reported and were not run here. Files read:
review/description.md,review/commits.md,review/manifest.json, and selected portions ofreview/diff.patch. Changed files not fully reviewed;files.jsonwas not available through the reader. Files excluded by rule were not inspected.To get this to a good state
Complete the review of every changed file and run the relevant checks before making a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T06:20:21Z.
Review: COMMENTED
Reviewed — comments
The inspected code shows no verified blocking defect, but the review is incomplete because several changed-line ranges were not inspected and no checks were run.
What I ran
Read the prepared description, commit list, manifest, and the first 400 lines of the diff at head
af5efff88b928a4eba8a58b1b528b697521fddb2. Read targeted ranges ofFileAndHeap.cpp,FileStream.hpp,RuntimeSupport.cpp,General.cpp,CMakeLists.txt,GuestFreopenHostStandard.cpp,FileStreams.cpp,GuestFreopenHostLog.cpp, and the debt fragment. No commands or tests were run.Results
Findings
Blocking
None verified in the inspected ranges.
Non-blocking
Not verified
The diff after line 400, the remaining changed-line ranges in the source and test files, and any runtime behavior are not verified. The changed files listed in the manifest are
core/libs/prx/libc/CMakeLists.txt,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/include/FileStream.hpp,core/libs/prx/libc/src/FileAndHeap.cpp,core/libs/prx/libc/src/RuntimeSupport.cpp,core/libs/tests/FileStreams.cpp,core/libs/tests/GuestFreopenHostLog.cpp,core/libs/tests/GuestFreopenHostStandard.cpp, anddocs/dev/debt/changes/codex-libc-fcloseall.md; complete changed-line coverage was not achieved.To get this to a good state
Nothing is required. Optional: finish reading every changed-line range and run the focused tests before requesting a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T10:03:41Z.
Review: COMMENTED
Reviewed — no blocking findings
This review inspected the stream registry and close-all implementation at head
a32fbf6da8dfd5858a134ef6a5411a8d2d395cde; no blocking defect was verified in the inspected code, but the review is incomplete.What I ran
No build or tests were run. I read the prepared description, commit list, diff, and manifest, then inspected targeted source and test context through
repo_read.py.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
None.
Not verified
I read
core/libs/prx/libc/src/FileAndHeap.cpp,core/libs/prx/libc/src/RuntimeSupport.cpp, andcore/libs/tests/GuestFreopenHostLog.cppin targeted ranges, plus the preparedreview/description.md,review/commits.md,review/manifest.json, andreview/diff.patchexcerpts. The remaining changed files were not fully read:core/libs/prx/libc/CMakeLists.txt,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/include/FileStream.hpp,core/libs/tests/FileStreams.cpp,core/libs/tests/GuestFreopenHostStandard.cpp, anddocs/dev/debt/changes/codex-libc-fcloseall.md. Their behavior and test coverage are not verified. No local build, test, host-platform matrix, console behavior, or exact-head qualification was independently confirmed.To get this to a good state
Nothing is required. Optional: complete inspection of the unread changed files and run focused checks against this exact head before treating the review as complete.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T13:49:32Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: avoid closing a stream while an explicit stream lock still owns its gate.
What I ran
Inspected prepared diff and source at head
169b0edf3a0b3acca9d1f0326c37a0c3d2c63b04usingrepo_read.py. No tests were run.Results
Findings
Blocking
core/libs/prx/libc/src/FileAndHeap.cpp:965:fcloseallcloses each selected native stream under its gate without accounting for an outstandingflockfile/_Lockfilelockacquisition. Those lock functions retain the gate lock and a stream pin until unlock (core/libs/prx/libc/src/RuntimeSupport.cpp:183-195). If another thread holds such a lock,fcloseallwaits for the gate; if the same thread callsfcloseallwhile holding it, the recursive gate allows close to proceed while the native FILE lock remains held. The stream is then retired, and_Unlockfilelockreads the now-null handle and throws before releasing the gate or pin (core/libs/prx/libc/src/RuntimeSupport.cpp:203-205). This leaves the gate locked and the pin leaked, and violates the stated close-all coordination with explicit stream locks. Preserve unlockability or defer close until explicit locks are released.Non-blocking
None.
Not verified
No tests were run. Author-reported platform runs and CI status were not independently verified. The prepared bundle includes all changed files in
review/manifest.json; relevant source inspected includedcore/libs/prx/libc/src/FileAndHeap.cpp,core/libs/prx/libc/include/FileStream.hpp, andcore/libs/prx/libc/src/RuntimeSupport.cpp. Other changed-file content was not inspected in detail.To get this to a good state
Make
fcloseallsafe when called with an explicit stream lock held, then run the focused stream tests on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T15:22:16Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected changes implement the stated
fcloseallbehavior, but this review did not run tests and did not read every changed file in full.What I ran
Reviewed head
fe6d7839da2fc0313cb6f06f5903c4fe4d03ca11using the pinnedrepo_read.pyreader. No build or test commands were run.Results
Findings
Blocking
None in the code inspected.
Non-blocking
None.
Not verified
The full text of all changed files was available in the review bundle, but I inspected only relevant ranges in the implementation and test diff; I did not read every changed file in full. In particular, I did not fully review
FileStreams.cpp,GuestFreopenHostLog.cpp, or all surrounding callers. No behavior beyond the inspected code is verified. The review bundle listed nine changed files, all included;files.jsonwas not available through the reader.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T04:49:22Z.
Review: COMMENTED
Reviewed — comments
The implementation and focused tests were inspected at head
9ffa56b8e378c4cd43e8c7dfd92450eb45927a0e; I did not run checks, and review completeness is limited by the unreviewed remainder of the test file and excluded-file inventory.What I ran
No build or test commands were run. The prepared diff and changed implementation sections were inspected, with targeted reads of related runtime code.
Results
Findings
Blocking
None verified in the inspected implementation.
Non-blocking
None.
Not verified
core/libs/tests/FileStreams.cppandcore/libs/tests/GuestFreopenHostLog.cppare changed files listed as reviewed in the manifest but were not read in full; only a targetedFileStreams.cppexcerpt was inspected.core/libs/tests/GuestFreopenHostStandard.cpp,docs/dev/debt/changes/codex-libc-fcloseall.md, and the full changedCMakeLists.txtandRuntimeSupport.cppfiles were not read.files.jsonwas not available in the reader listing, so excluded-by-rule files could not be noted. No build, test, platform behavior, or console behavior was verified.To get this to a good state
Nothing is required. The author may share the review with the noted inspection limits in mind.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T01:38:56Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: allow
freopento proceed when preserving a closed host standard descriptor fails.What I ran
Reviewed head
1c17f817b396eec0d46ddfedccb5a2ab9113493ausingrepo_read.py. I did not run build, tests, or conventions checks.Results
Findings
Blocking
core/libs/prx/libc/include/FileStream.hpp:467-469, but the unconditionalDuplicateHostDescriptor_nid_no_patchat line 474 can throw beforefreopenis called. This conflicts with the documented behavior that a failed keep of closed descriptor 1 or 2 does not prevent the stream from closing/reopening. Skip the duplicate when keeping the descriptor failed, while preserving the existing host-stream recovery behavior when a duplicate succeeds.Non-blocking
None.
Not verified
Builds, tests, conventions, macOS behavior, and console behavior were not run or confirmed. Read all changed files listed in the manifest:
core/libs/prx/libc/CMakeLists.txt,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/include/FileStream.hpp,core/libs/prx/libc/src/FileAndHeap.cpp,core/libs/prx/libc/src/RuntimeSupport.cpp,core/libs/tests/FileStreams.cpp,core/libs/tests/GuestFreopenHostLog.cpp,core/libs/tests/GuestFreopenHostStandard.cpp, anddocs/dev/debt/changes/codex-libc-fcloseall.md. No changed files were excluded by the manifest.To get this to a good state
Fix the Linux reopen path so a failed host-descriptor keep does not lead to a duplicate attempt on the invalid descriptor; then run the focused stream and host-standard reopen tests.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T07:13:26Z.
Review: DISMISSED
Reviewed — changes requested
Changes are required before merge: serialize ordinary stream I/O with the close/reopen gate so
fcloseallcannot close a nativeFILEwhile an operation is using it.What I ran
3a0ebf711a09201db10dc33cbba5566147854d58usingrepo_read.pyon the prepared review artifacts and repository source.Results
Findings
Blocking
core/libs/prx/libc/src/FileAndHeap.cpp:1056:freadobtains a raw handle and uses it at line 1071 without acquiring the stream gate or pinning the wrapper.fcloseallcloses that native handle under the gate atcore/libs/prx/libc/src/FileAndHeap.cpp:1018-1021; a concurrent read can therefore use aFILE*after it has been closed and freed. The same ungated pattern appears in other ordinary I/O operations. Route these operations through the same per-stream lease/gate used by close and reopen, and keep the lease through the native operation.Non-blocking
None.
Not verified
core/libs/prx/libc/CMakeLists.txt,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/include/FileStream.hpp,core/libs/prx/libc/src/FileAndHeap.cpp,core/libs/prx/libc/src/RuntimeSupport.cpp,core/libs/tests/FileStreams.cpp,core/libs/tests/GuestFreopenHostLog.cpp,core/libs/tests/GuestFreopenHostStandard.cpp, anddocs/dev/debt/changes/codex-libc-fcloseall.md. The complete text of every changed file was not read; review focused on the lifecycle and lock paths cited above.To get this to a good state
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T08:01:40Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this draft; the reviewed excerpts do not establish a defect, but the review is incomplete and does not justify approval.
What I ran
No tests or build commands were run. The prepared bundle is pinned to head
6d970d904f8ef9c952e60587d3ab094cb871fe5c.Results
Findings
Blocking
None identified in the excerpts reviewed.
Non-blocking
None.
Not verified
The full diff and changed source files were not reviewed.
description.md,commits.md,manifest.json, and selected sections ofdiff.patchwere read; the bundle lists 17 changed files, all included, but none was reviewed in full.files.jsonwas not available through the reader. No test output was independently verified.To get this to a good state
Complete the source review across the changed files and run the relevant checks before making a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T16:56:07Z.
Review: COMMENTED
Actionable comments posted: 7
6b103d7e-de6e-4aa5-852c-3c8012c5ddc9Reviewing files that changed from the base of the PR and between
1bc92752d2and8a0fe296b3.core/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/include/Api.hppcore/libs/prx/libc/include/FileStream.hppcore/libs/prx/libc/src/BinaryWordIo.cppcore/libs/prx/libc/src/Errors.cppcore/libs/prx/libc/src/FileAndHeap.cppcore/libs/prx/libc/src/Formatting.cppcore/libs/prx/libc/src/FormattingWide.cppcore/libs/prx/libc/src/HeapDiagnostics.cppcore/libs/prx/libc/src/RuntimeSupport.cppcore/libs/prx/libc/src/ScanningWide.cppcore/libs/prx/libc/src/StandardStreams.cppcore/libs/prx/libc/src/StreamPurge.cppcore/libs/tests/FileStreams.cppcore/libs/tests/GuestFreopenHostLog.cppcore/libs/tests/GuestFreopenHostStandard.cppdocs/dev/debt/changes/codex-libc-fcloseall.mdIncluded 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-27T17:04:16Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected portions show no verified blocking defect, but the changed-line audit is incomplete, so a formal approval is not justified.
What I ran
Reviewed head
8a0fe296b3651ab584fae32203c0889840005e60. No commands or tests were run. Author-reported test results in the description were not independently verified.Read the review bundle’s
description.md,commits.md,manifest.json, anddiff.patch. Read portions ofFileAndHeap.cpp,RuntimeSupport.cpp, andStandardStreams.cppthrough the pinned reader. No files were excluded by the bundle’s listed changed-file inventory; the other changed-file additions were not read.Results
Findings
Blocking
None verified in the portions inspected.
Non-blocking
None.
Not verified
The added lines in
CMakeLists.txt,Api.hpp,FileStream.hpp,BinaryWordIo.cpp,Errors.cpp,Formatting.cpp,FormattingWide.cpp,HeapDiagnostics.cpp,ScanningWide.cpp,StreamPurge.cpp,FileStreams.cpp,GuestFreopenHostLog.cpp,GuestFreopenHostStandard.cpp, anddocs/dev/debt/changes/codex-libc-fcloseall.mdwere not fully read. The changed additions outside the cited ranges inFileAndHeap.cpp,RuntimeSupport.cpp, andStandardStreams.cppwere not fully read either. No current-head build, test suite, or console behavior was verified.To get this to a good state
Nothing is required. Optional: complete the changed-line audit and run the focused checks on this exact head before seeking approval.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T17:47:34Z.
Review: COMMENTED
Reviewed — comments
The PR adds tracked stream lifetimes and
fcloseall; I inspected selected lifecycle code, but not every changed line or the full test changes, so a formal approval or change request is not justified.What I ran
Pinned head:
64fd5ee977b9e861065caeb0bce6e584c77fbab3. No build or tests were run. I read the prepared description, commits, manifest, README, and the first 1,400 lines of the diff, along with selected ranges ofFileStream.hpp,FileAndHeap.cpp, andRuntimeSupport.cppthroughrepo_read.py.Results
Findings
Blocking
None identified in the inspected ranges.
Non-blocking
No specific non-blocking defect verified.
Not verified
The manifest lists 17 changed files. I read selected source ranges in 3 changed files:
core/libs/prx/libc/include/FileStream.hpp,core/libs/prx/libc/src/FileAndHeap.cpp, andcore/libs/prx/libc/src/RuntimeSupport.cpp. I did not read all added lines in those files, or the changed lines in the other 14 files. In particular, I did not inspect the complete test additions or run the author-reported checks.files.jsonwas not available through the review reader, so excluded-by-rule files are not verified.To get this to a good state
Nothing is required. Optional: complete inspection of the remaining changed lines and run the relevant checks on this head before a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T17:54:15Z.
Review: COMMENTED
Actionable comments posted: 6
d8dab2ef-ff3d-4c38-a6e9-9ee38e6db15cReviewing files that changed from the base of the PR and between
8a0fe296b3and64fd5ee977.core/libs/prx/libc/include/FileStream.hppcore/libs/prx/libc/src/FileAndHeap.cppcore/libs/prx/libc/src/RuntimeSupport.cppcore/libs/tests/FileStreams.cppcore/libs/tests/GuestFreopenHostLog.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-27T20:25:31Z.
Review: COMMENTED
Reviewed — comments
The review is incomplete, so a formal approval or change request is not justified.
What I ran
No tests or build commands were run. I inspected the prepared diff and targeted source at head
4d8419eb351db0f3b58ffde6f6af988ba9979606.Results
Findings
Blocking
None verified in the excerpts inspected.
Non-blocking
Not verified
This is not a full review: I did not read every changed file or inspect every changed hunk and its callers. Read from the repository: selected excerpts from
core/libs/prx/libc/src/FileAndHeap.cpp,core/libs/prx/libc/src/RuntimeSupport.cpp, andcore/libs/prx/libc/include/FileStream.hpp. The preparedreview/description.md,review/commits.md,review/manifest.json, andreview/diff.patchwere read;review/files.jsonwas unavailable. The file listing reports all 16 changed files included, but their full text was not all read. macOS, console behavior, and hosted CI were not independently verified.To get this to a good state
Nothing is required. Optional: complete review of the remaining changed files and independently run the focused checks on this head.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T20:30:28Z.
Review: COMMENTED
Actionable comments posted: 1
ed73c983-fbf8-407e-a643-8e86bc9ecb83Reviewing files that changed from the base of the PR and between
64fd5ee977and4d8419eb35.core/libs/prx/libc/include/FileStream.hppcore/libs/prx/libc/src/FileAndHeap.cppcore/libs/prx/libc/src/RuntimeSupport.cppcore/libs/tests/FileStreams.cppdocs/dev/debt/changes/codex-libc-fcloseall.mdIncluded 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-27T21:25:10Z.
Review: COMMENTED
Reviewed — no blocking findings
This review covers head
eb45c76240b52a0f4faa423a3ba5427eecb1a8ca; the registry snapshot, per-stream gates, and tracked stream operations provide a coherent basis forfclosealland its coordination withfcloseandfreopen.What I ran
FileAndHeap.cppand stream lifetime logic inFileStream.hpp.repo_read.pywas not run as a command; repository context was read with the pinned reader tools.Results
Findings
Blocking
None identified in the inspected implementation.
Non-blocking
None.
Not verified
core/libs/prx/libc/CMakeLists.txt,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/include/FileStream.hpp,core/libs/prx/libc/src/FileAndHeap.cpp, and selected portions ofreview/description.md,review/commits.md,review/manifest.json, andreview/diff.patch.core/libs/prx/libc/src/BinaryWordIo.cpp,core/libs/prx/libc/src/Errors.cpp,core/libs/prx/libc/src/Formatting.cpp,core/libs/prx/libc/src/FormattingWide.cpp,core/libs/prx/libc/src/HeapDiagnostics.cpp,core/libs/prx/libc/src/RuntimeSupport.cpp,core/libs/prx/libc/src/ScanningWide.cpp,core/libs/prx/libc/src/StandardStreams.cpp,core/libs/prx/libc/src/StreamPurge.cpp,core/libs/tests/FileStreams.cpp,core/libs/tests/GuestFreopenHostLog.cpp,core/libs/tests/GuestFreopenHostStandard.cpp, anddocs/dev/debt/changes/codex-libc-fcloseall.md.