feat(libSceLibcInternal): implement istreambuf_iterator equal #23809
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23809"
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 GiannisG1 on 2026-11-19T17:35:33Z.
What
std::istreambuf_iterator<char>::equalandstd::istreambuf_iterator<wchar_t>::equalthrew:charform through a parameterless placeholder inInventoryExports2.cpp;wchar_tform through the unnamed aliassceLibcInternalUnknown_jZmLD_ASDto. Its mangled name_ZNKSt19istreambuf_iteratorIwSt11char_traitsIwEE5equalERKS2_hashes to that NID (tools/nid_names.py), so it is now exported by name like thecharform.Both now follow Microsoft STL's
istreambuf_iterator::equal(stl/inc/iterator), the commitTimeGetFields.cppalready derives from, and C++ [istreambuf.iterator.ops]:underflow;The functions reuse the
Peek/Equalhelperstime_getalready uses on the same 16-byte iterator layout: the buffer at 0, the fetched flag at 8 and the element at 9 or 10. So the exports are inTimeGetFields.cpp, between the_Getintanddo_get_timeexports, where no open PR changes lines. A null iterator throwsstd::invalid_argument: it is an invalid argument, not an unimplemented path, andtools/progress.pycounts a reachableNotImplemented_nid_no_patchas a stub. The debt entry "Additional 3.20 imports" keeps onlybad_exception::_Doraise.std::string text(std::istreambuf_iterator<char>(file), {}), the usual way to read a whole stream, compares throughequal. No title was seen calling it.Tested
Linux Mint 22.3, GCC 13.3.0, Release, head on
maine4cee4952b.Rebased again 2026-11-21 onto
main3bf7091b75, after #19359 (head3b30cf23cc): #19359 removed the widebasic_string_Xlen/_Xranplaceholders right before ours inInventoryExports2.cpp, so all four are gone;git range-diffshows no changed patch line. On that head the 81 libc tests pass 3/3, and the split suite matchesmain's failures (GTX 1050 Ti 0; HD 630 the same 9 plusagc_driver_frame_replay_rewind_copy, intermittent, #22028; llvmpipe the same 3). The checkers anddebt_fold.py --checkare clean.Rebased again 2026-11-20 onto
maine481b13555, after #24043 (head9c5dbdd66e). The patch is unchanged except for two lines that #24043 made obsolete:InventoryExports2.cpp: #24043 removed the_Doraiseplaceholder right before ours, so all three placeholders are now gone.u6UfGT9+HEAto list only the twoequalexports, and this PR implements both. So that entry now has no function left: its## changebecomes## remove u6UfGT9+HEA, and this PR's own fragment, which changed the same entry, is gone.debt_fold.py --checkis clean, and the entry count drops by one.guest_libc_internal_*,istreambufandtime_gettests pass 3/3. Split suite: GTX 1050 Ti 0 failed; HD 630 and llvmpipe exactly the failures ofmain42f6354612's own run (HD 630 9, llvmpipe 3, all claimed by open pull requests).check_conventions.py,check_test_registration.py,check_main_sync.py(merges cleanly),check_compile.py,debt_fold.py --checkandgit diff --checkare clean, andprogress.py --module libSceLibcInternallists both exports as done.Rebased 2026-11-20 onto
mainf57cd3aafc(head1f5e30197d): #23988 changed_Getloctxt's declaration next to ours inTimeGetFields.hpp, the only conflict. The patch itself is unchanged (git range-diff: no changed patch line, same diffstat). On the rebased head: the 79guest_libc_internal_*andtime_gettests pass 3/3, including both above. Split suite on that head: GTX 1050 Ti 6353 run, 1 failed; HD 630 1472 GPU tests, 10 failed; llvmpipe 1472, 4 failed. Apart fromguest_kernel_socket_broadcast_debug_route_bounds, the failures are those of this machine's other runs today and ofmain's Linux job (HD 630: the 9 ofmain0626a8334f; llvmpipe:agc_driver_image_gather_lod,agc_driver_image_table_packed_guards,agc_driver_scattered_runs). That test came tomaintoday in #21149, aborts on every device here and calls only libkernel's socket options; the checkers below are clean again, andprogress.pylists neither export as pending. The results below are from the first head.guest_libc_internal_istreambuf_equal, forcharandwchar_t:underflow. The peeked element is kept,uflowis never called, and a second comparison does not callunderflowagain;std::invalid_argument.main: the test does not link (nowchar_texport). With thewchar_thalf removed it aborts:_ZNKSt19istreambuf_iteratorIcSt11char_traitsIcEE5equalERKS2__nid_postfix not implemented. This PR: passes 3/3.tools/suite.py): GPU tests on a GTX 1050 Ti (NVIDIA 580.178.04), an HD 630 (Mesa 25.2.8 ANV) and llvmpipe 25.2.8, everything else once.guest_libc_internal_istreambuf_equalandguest_libc_internal_time_get_fieldspass.mainbaseline (HD 630 10, llvmpipe 3) plus two timing tests that do not load libSceLibcInternal.agc_driver_pm4_order_signalchecks for a median below 0.1 ms. Run interleaved with amaine4cee4952bbuild, 5 times per GPU, both builds fail 7 of 15.agc_driver_depth_fast_clear_submitfailed on the GTX and passes 3/3 alone.NotImplemented_nid_no_patchtostd::invalid_argument(headd94b629435), so the progress report counts both exports as implemented. On that tree,public_headersand its compile tests, everyguest_libc_internal_*test and the conventions and checker tests (344) pass.progress.py --module libSceLibcInternallists neither export as pending.check_conventions.py,check_test_registration.py,check_main_sync.py(merges cleanly),check_compile.pyanddebt_fold.py --checkare clean.pr_overlap.py --branchfound two cases, both checked:wchar_talias.TimeGetFields.cppwith an earlier placement of these exports. They were moved, andgit merge-treewith #22528, #22462 and #22370 is now clean.bad_exception::_Doraise) removed placeholder rows next to ours inInventoryExports2.cpp; it is merged and resolved above.basic_string_Xlen/_Xran) removed the placeholders right before ours inInventoryExports2.cpp; it is merged and resolved above.main, a trial merge adds no conflicting file. #18135 deletes the declarations around the removedequaldeclaration inInventoryExports2.hpp, a file where it already conflicts withmain.Update 2026-11-25 (head
352c5ae5af):maind237f5d065is merged into the branch on top of oneandonlydean's merge (b1acaec95b). The one conflict, inTimeGetFields.hpp, keeps both sides' declarations. On this head,guest_libc_internal_istreambuf_equal,guest_libc_internal_time_getandguest_libc_internal_time_get_fieldspass 3/3 on the GTX 1050 Ti, the HD 630, llvmpipe and lavapipe. The split suite (-j2, SPIRV-Tools ON) matches ourmaind237f5d065run with the same configuration. The checkers are clean, and the branch merges cleanly withmain.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T17:58:02Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
03f42644fb:tools/check_conventions.pypassed.guest_libc_internal_istreambuf_equal_testsbuilt cleanly.guest_libc_internal_istreambuf_equal):core/libs/prx/libSceLibcInternal/InventoryExports2.cpp,core/libs/prx/libSceLibcInternal/TimeGetFields.cpp,core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp,core/libs/prx/libSceLibcInternal/include/TimeGetFields.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T19:38:08Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
d94b629435:tools/check_conventions.pypassed.guest_libc_internal_istreambuf_equal_testsbuilt cleanly.guest_libc_internal_istreambuf_equal):core/libs/prx/libSceLibcInternal/InventoryExports2.cpp,core/libs/prx/libSceLibcInternal/TimeGetFields.cpp,core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp,core/libs/prx/libSceLibcInternal/include/TimeGetFields.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T19:46:54Z.
Review: APPROVED
Reviewed — looks good
The implementation and registered tests support the stated iterator equality behavior; no blocking defect was found in the reviewed files.
What I ran
d94b629435e84f0cd09e5f944f76ed1e84787064.repo_read.pywas used to read targeted source ranges; the ruling file was supplied in the prompt and was not read.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and test outcomes were not independently verified. The prepared
files.jsonwas not available through the reader, so excluded-file details were not verified; the manifest lists seven changed files and all were read. No runtime behavior on a physical console was verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T07:23:06Z.
Review: APPROVED
Reviewed — looks good
The implementation and added tests support merging at head
1f5e30197d7f71ea0785a147ebdaca7ff6c416f2; the author-reported checks were not rerun here.What I ran
Read the prepared description, commit list, manifest, diff, and all seven changed files at the pinned head. No commands or tests were run.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and test results were not independently verified. No changed files were excluded from review.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T19:59:11Z.
Review: APPROVED
Reviewed — looks good
The reviewed changes at head
9c5dbdd66ef6569fe038934f0a38b64404521344implement both iterator equality exports, and the inspected code and reported checks support merging.What I ran
Read the prepared diff and all seven changed files listed in the manifest. No commands or tests were run during this review; test results below are author-reported.
Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Behavior claims are based on the changed implementation and tests at the reviewed head.
Not verified
I did not run tests, checkers, or a build. I did not independently verify behavior on console hardware. The PR description reports passing iterator and time-get tests and clean checkers on its rebased head; those results were not reproduced here. No files were excluded from review.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T00:06:56Z.
Review: APPROVED
Reviewed — looks good
The reviewed change implements the two iterator equality exports and adds a focused regression test; no blocking defect was verified.
What I ran
Reviewed head
3b30cf23ccb6fa48d395bf003562f6aa48e979f3. No commands or tests were run in this review;repo_read.pywas unavailable as a command, so I used the prepared review reader.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests or checkers were run for this review. The author-reported test results were not independently verified. No files were excluded by the manifest;
files.jsonwas not available through the reader, so that exclusion list could not be checked.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T08:52:22Z.
Review: APPROVED
Reviewed — looks good
Nothing in the inspected changes blocks merging; the implementation and its focused test align with the described iterator equality behavior.
What I ran
Read the prepared review artifacts for head
b1acaec95b9ea63983b61c81b50fe0bc7b968e4band inspected the changed implementation, declarations, test, build registration, and debt fragment throughrepo_read.py. No commands or tests were run in this review.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Did not run the test suite or independently verify the author's reported test and checker results. No changed files were excluded; all six files listed in
manifest.jsonwere read.files.jsonwas not available in the prepared review folder, so exclusions by rule were not independently confirmed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T22:56:59Z.
Review: APPROVED
Reviewed — looks good
The implementation at head
352c5ae5af688d4edce549570210ad2037ae062buses the existing iterator peek/equality helpers, exports both character variants, and includes focused coverage; I did not run checks in this review.What I ran
No commands or checks were run. I read the prepared description, commit list, manifest, diff, and the full text of all six changed files at the pinned head. The description reports successful checks on the head; those results were not run or independently verified here.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build, test, checker, merge-preview, and console behavior were not verified in this review. The description reports the focused tests and split suite passed on the stated head/configuration; this review did not reproduce those runs. No files were excluded from the review manifest; all six changed files were read.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:52:02Z.
Review: COMMENTED
Built the branch’s changed sources and ran GuestLibcInternalIstreambufEqual on Linux against the existing runtime libraries. The test run passed and covered the istreambuf iterator equality cases.
AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.