libc: model guest stdio streams for legacy imports #1925
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1925
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1925/head"
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?
@Febsho on GitHub · 2026-10-26 20:41 UTC · original
Febsho:pr/pps31544-libc-stdio→main· +203 −5 · 4 files · 1 commits · closed without mergingSummary
The legacy
LibcInternalstdout/stderr imports expose guestFILE*slots. Binding those slots to the host process'sstdoutandstderrgives guest libc an incompatible hostFILElayout. With PPSA31544, guestfputsthen stops making progress while flushing a status message.This change provides stable guest-layout stream objects for file descriptors 1 and 2, maps the legacy imports to those objects, and forwards buffered output to the corresponding host streams in the
fflushshim. It covers the two stdout NIDs and the stderr NID without game-specific handling.References #1859. Observed with PPSA31544.
Validation
cmake --build _Build/pps31544-baseline --target kyty_emulator libc_stdio_symbol_tests -j8— passed.ctest --test-dir _Build/pps31544-baseline -R '^libc_stdio_symbols$' --output-on-failure— passed.AI assistance
AI assistance was used for diagnosis, implementation, and test preparation.
@chatgpt-codex-connector[bot] on GitHub · 2026-10-26 20:41 UTC · original
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
We couldn’t complete this review. Comment
@codex reviewto try again.69f42bfℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@coderabbitai[bot] on GitHub · 2026-10-26 20:46 UTC · original
Walkthrough
The change adds guest-layout stdio streams with 64-KiB buffers and flush handling for host output and error streams.
fflushaccepts guest stream pointers, flushes both standard streams when passednullptr, and returnsEOFfor unsupported streams. Standard-stream imports now point to guest stream-pointer slots. A new test checks stream symbols, buffer flushing, andfflush; CMake builds and registers the test.Suggested reviewers:
nmzikPriority:
Normal
Change: Bug fix
Merge Risk:
Low · up to
69f42The change appears mergeable, but a regression in flushing an individual guest stream could go undetected. Add a non-null fflush assertion before merging if practical.
Pre-merge checks:
4 ·
1
Full details: Title check
Explanation
The title "libc: model guest stdio streams for legacy imports" matches the main change. The PR adds guest-layout stdio stream objects for fds 1 and 2, maps the legacy stdout and stderr imports to them, and forwards buffered output in the fflush shim. The title is specific and concise, and it follows the repository's area-prefixed style.
Full details: Description check
Explanation
The description states the problem (legacy stdout/stderr imports bind guest FILE* slots to host stdout/stderr, which gives an incompatible FILE layout and stalls guest fputs). It also lists the fix (guest-layout stream objects for fds 1 and 2, legacy import mapping, fflush forwarding), the build and ctest validation, and the unverified Windows status. This matches the changeset directly.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 3 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-10-26 20:46 UTC · original · reviewed
🧹 Nitpick comments: 1
aedb0aac-8426-4944-a96e-9352c5b51b23Reviewing files that changed from the base of the PR and between
f90a8b1589and69f42bf1f5.CMakeLists.txtsrc/libs/guestStdio.hsrc/libs/libC.cpptests/LibcStdIoSymbolTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Pull request closed