feat(libSceNKWebKitRequirements): implement the libjpeg, libxml2 and libpsl exports #14421
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14421"
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 PrivacyOnion on 2026-11-01T12:12:43Z.
What
Implements the 60 libjpeg, libxml2 and libpsl exports of libSceNKWebKitRequirements, stacked on #14374 (zlib). Only the last five commits are new here; the three before them are #14374.
Jpeg.cpp): the decompression API (jpeg_CreateDecompress,jpeg_std_error,jpeg_read_header,jpeg_start_decompress,jpeg_read_scanlines,jpeg_finish_decompress,jpeg_save_markers,jpeg_resync_to_restart, …) over the libjpeg-turbo already in3rdparty/libjpeg-turbo. Guestjpeg_decompress_struct,jpeg_error_mgr,jpeg_source_mgrand saved markers are LP64 mirrors (include/GuestJpeg.hpp, sizes fixed bystatic_assert) copied to and from the host objects around each call. Guest source-manager, marker and error callbacks run throughAPS5_VABItrampolines. A null object, or one not created byjpeg_CreateDecompress, throwsstd::invalid_argument.Xml.cpp): parser contexts, push and memory parsing, SAX handlers, documents, entities, error access and output buffers over libxml2 2.9.14, a new submodule at3rdparty/libxml2built from source bycmake/LibXml2.cmakewithout iconv, ICU, HTTP, FTP or catalogs. Guest-visible structures are LP64 mirrors (include/GuestXml.hpp); SAX, input and output callbacks go through trampolines.Psl.cpp):psl_builtin,psl_load_file,psl_is_public_suffix,psl_registrable_domain,psl_unregistrable_domain,psl_is_cookie_domain_acceptable,psl_str_to_utf8lower, the builtin metadata getters and the rest of the 0.21.5 API, over libpsl 0.21.5, a new submodule at3rdparty/libpsl(with its pinnedlistsubmodule) built bycmake/LibPsl.cmake. The builtin table is generated at build time from the pinned list.The 60 stubs are removed from
Export.cppand their parameterless declarations inIdentified.hppare replaced by the real prototypes. 95 entries stay stubs (63 pending inventory exports, mostly SQLite, plus the 32 additional callable exports). Technical debt: pending counts updated and one Functional entry per library (no console verification,error_exithandling, libxml2 build options, libpsl snapshot).Tested
Windows 11, host harness built with the Qt MinGW 13.1 toolchain:
tests/Jpeg.cpp: decodes a JPEG encoded by libjpeg-turbo through a guest source manager (init_source,fill_input_buffer,skip_input_data,resync_to_restart,term_sourceas guest callbacks), checks dimensions, components, a saved APP1 marker and every pixel against host libjpeg output, then decodes a progressive image in buffered-image mode (jpeg_has_multiple_scans,jpeg_consume_input,jpeg_input_complete,jpeg_start_output,jpeg_finish_output), and drives a guesterror_exitthroughJERR_NO_SOI;tests/Xml.cpp: strings and dictionary, chunked push parsing with guest SAX2 callbacks, error retrieval through guesterror/serrorandxmlCtxtGetLastError, memory parsing with predefined and document entities, external entities loaded through two distinct guest input handlers (including a registration made while one stream is open and registrations rejected by a full table), and output registration and rejection;tests/Psl.cpp: builtin list queries (public suffix, registrable and unregistrable domain, cookie domain, counts, metadata),psl_str_to_utf8lower, andpsl_load_file,psl_load_fpandpsl_lateston a list the test writes, including wildcard and exception rules and their counts;Not covered by a test: guest output callbacks being called (no export of this library opens an output buffer).
Export.cpp,Zlib.cpp,Jpeg.cpp,Xml.cppandPsl.cppcompile with the realAPS5_VABI.tools/check_conventions.pyreports 0 errors (the one warning is the zlib entry from #14374) andtest_public_headers.py --audit-onlypasses. A full CMake configure is not possible here (missing SDL2/ffmpeg submodules), so the guest build and CTest run are left to CI.pr_overlap.py:.gitmodulesis shared with #1835, #5021, #9855 and #13578, which add other submodules; #14212 only reformats this debt file. None implements these functions.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T12:32:52Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The mirror layouts, submodule pins, CMake files and public-header audit check out, but the libxml2 I/O registrations share one set of guest callbacks, so a later registration changes the callbacks of earlier ones, and the debt document was rewritten with CRLF line endings, so
git diff --checkfails atec1fa3c51e.What I ran
Exact head
ec1fa3c51ec88d663f13c3b97fc92b4fde802adb; PR baseba627802e2210187d417deb64c8f2fed8e33011f(currentmain), unchanged at completion. Stacking: the PR declaresDepends on: #14374; the first three commits are #14374's (head3979b705f3, an ancestor of this head), and the two new commits are408a262b5eandec1fa3c51e. No build and no test run (no-build review). Commands and tools:Hand checks: the LP64 layout of every
sizeof/offsetofassertion inGuestJpeg.hpp,GuestXml.hppandGuestPsl.hpp(a Python layout calculator over the header members, not a compile); the submodule pins against the upstream repositories; the new CMake files against the upstream CMake options; the export move betweenExport.cpp,Jpeg.cpp,Xml.cppandPsl.cpp.Results
docs/dev/debt/libSceNKWebKitRequirements.md(CRLF).gitmodulesand pins3rdparty/libxml2ishttps://github.com/GNOME/libxml2.gitat7846b0a677f8(tag v2.9.14, 2022-05-02).3rdparty/libpslishttps://github.com/rockdaboot/libpsl.gitatba4c49a20540(v0.21.5, 2024-01-13). Both commits exist upstreamGuestJpeg.hppsizeofand 120offsetofassertionsGuestXml.hppsizeofand 172offsetofassertions. ThexmlDocprefix offsets match libxml2 2.9.14tree.hGuestPsl.hppstruct psl_ctx_stforward declaration; no layout to checkcmake/LibXml2.cmake,cmake/LibPsl.cmake)LIBXML2_WITH_*options exist in upstream 2.9.14CMakeLists.txt; the libpsl template variables and thesrc/psl-make-dafsa,src/psl.c,src/lookup_string_in_fixed_set.csources exist at the pin399 libraries, 26181 exports: unique declarations and umbrella coverage verified, exit 0passed_with_warnings, 27 findings, allpublic-declaration-not-found: 5staticDefaultGuest*callbacks inJpeg.cpp, 8Dummy*callbacks, 5Guest*callbacks and 9Sax*callbacks, allstaticintests/Jpeg.cppandtests/Xml.cpp. None is an exportExport.cppdeclarations go from 155 (3979b705f3) to 95 (head); exactly 60 names leave it and are defined inJpeg.cpp(15),Xml.cpp(23) andPsl.cpp(22). The 95 left are 63 pending exports and 32Unknownrowsguest_nk_req_{jpeg,xml,psl}viaforeachinCMakeLists.txt;guest_webkit_zlibfrom #14374Unedited diff check output (precheck)
Findings
Blocking:
xmlRegisterInputCallbacks_nid_postfixandxmlRegisterOutputCallbacks_nid_postfixoverwrite the globalss_guestInputMatch,s_guestInputOpen,s_guestInputRead,s_guestInputClose(and the output set) before calling libxml2 (Xml.cpp L695-L708 at head). Every host entry libxml2 stores for a registration uses the same trampoline, and the trampolines call the current globals (Xml.cpp L517-L521 at head). So registering a second handler changes the callbacks reached through the first handler's entry, including reads and closes for a context already opened through it. A registration that libxml2 rejects with-1has already overwritten the globals. The only test registers one dummy handler, so none of this is pinned. I confirmed the same point independently of the comment at 12:25 by oneandonlydean. Fix: keep each callback set with its registration and its opened contexts, leave existing registrations unchanged when a new one fails, and add regressions that parse through two distinct input handlers, keep using an earlier open context after another registration, and check a rejected registration; cover the output handler the same way.408a262b5e(the first new commit) rewrotedocs/dev/debt/libSceNKWebKitRequirements.mdwith 55 CRLF lines; the stacked base3979b705f3has LF.git diff --checktherefore fails on every line, and the diff of that file is a whole-file rewrite that hides the real debt change. Fix: convert the file back to LF (for examplesed -i 's/\r$//') and push. Nothing else in the PR carries CR characters.Non-blocking:
cmake/LibXml2.cmakesetsBUILD_SHARED_LIBSwithCACHE BOOL "" FORCE(line 6). The other bundled-library files use a plainset(for examplecore/libs/prx/libSceAgcDriver/CMakeLists.txtline 16). The forced cache write changes the value for every subdirectory configured after this one. Suggest the plainset.HostErrorExit(Jpeg.cpplines 39-41) throws a C++ exception through libjpeg's C frames. The debt entry discloses that errors become exceptions, but correctness relies on the unwind tables of the C code. Worth stating which toolchains this was checked on.Psl.cppassertions are weak:wildCount >= 0,excCount >= 0, a non-null check ondistFn, andint outdatedis discarded ((void)outdated). The version-number assertions are precise and match upstreampsl_check_version_number(returnsPSL_VERSION_NUMBERfor 0x001505 and 0 for 0x001000,src/psl.clines 1574-1590 atba4c49a2).The debt counts check out against the code: 63 pending in
Export.cpp, 32Unknowntable rows, 52 pending exports declared inIdentified.hppand 11 others, and 15 + 23 + 22 = 60 moved exports. The zlib claim (vendored 1.3.2 underlibjpeg-turbo/src/spng/zlibwithNO_GZIPdefined inzconf.h) is accurate.Sources
GuestXml.hppxmlDoc mirror against libxml2 2.9.14include/libxml/tree.hpsl_check_version_numberat the pinNO_GZIPcmake/LibXml2.cmakeat the headNot verified
To get this to a good state
Make the libxml2 I/O registrations keep their callbacks per registration, add the regressions described in finding 1, and convert
docs/dev/debt/libSceNKWebKitRequirements.mdto LF so thatgit diff --check ba627802e2210187d417deb64c8f2fed8e33011f HEADis empty. The remaining points are optional. The diff check, the public-header audit, the layout checks and the Xml tests will be rerun on the new head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T12:46:31Z.
Review: CHANGES_REQUESTED
Re-checked — new head, I/O callbacks fixed; line endings still blocking
The libxml2 I/O registrations now keep one callback slot per registration, which fixes the shared-callback defect from my review at
ec1fa3c51e, but the debt document still uses CRLF line endings, sogit diff --checkstill fails atfbc2ded785.What I ran
Exact head
fbc2ded78536e77667752a3c29c0201457a53fc4; PR baseba627802e2210187d417deb64c8f2fed8e33011f(currentmain), unchanged at completion. The new commit touches onlyXml.cppandtests/Xml.cpp. No build and no test run. Commands:I also read the slot table and the templated trampolines in
Xml.cpp(L45-L46 and theHost*<Slot>functions), the registration functions (L745-L781), and the new regressions intests/Xml.cpp(L292-L326 and L376-L414). The libxml2 callback table capacity at the pinned commit7846b0a677f8isMAX_INPUT_CALLBACKandMAX_OUTPUT_CALLBACK= 15 (xmlIO.cL100 and L117), which matchesXmlInputSlotCountandXmlOutputSlotCount= 15.Results
docs/dev/debt/libSceNKWebKitRequirements.md(unchanged by this commit)passed_with_warnings, 27 findings, the same static test-helper set as before; none is an exportpossible-unregistered-cpp-testfindings; false positives, because the Xml test is registered viaforeachinlibSceNKWebKitRequirements/CMakeLists.txtFindings
Blocking:
408a262b5e, unchanged byfbc2ded785.git diff --checkfails on every line, and the file diff is a whole-file rewrite. Fix: convert the file to LF.Non-blocking:
ec1fa3c51e(the globalBUILD_SHARED_LIBSforce incmake/LibXml2.cmake, the libxml2 version wording in the debt entry, the C++ exceptions thrown through libjpeg's C frames, and the weakPsl.cppassertions) still apply. This commit does not touch those files, and I did not re-check them at this head.Not verified
To get this to a good state
Convert
docs/dev/debt/libSceNKWebKitRequirements.mdto LF and confirmgit diff --check ba627802e2210187d417deb64c8f2fed8e33011f HEADis empty. The diff check and the I/O regressions will be rerun on the new head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T13:48:03Z.
Review: COMMENTED
Reviewed — no blocking findings
The CRLF line endings that blocked the previous head are fixed at head 967de9b889, and the three changes in this delta (a CMake cache change, a JPEG error-exit test and tighter PSL assertions) read correctly; hosted checks are still pending, so I am not approving.
What I ran
967de9b8893ca8dae0c6dc1da04728233073f943(one commit afterfbc2ded785, the head of my earlier request-changes review 5728122842), baseba627802e2210187d417deb64c8f2fed8e33011f./usr/bin/python33.11.2, no build.python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14421 --output-dir /dev/shm/reviewer-run/precheck/14421bfbc2ded7...967de9b8): four files,cmake/LibXml2.cmake,Jpeg.cpp,Psl.cpp, and the debt doc.gh apicontents at both heads: 0 CR bytes at967de9b8, 57 atfbc2ded7.python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base ba627802e2210187d417deb64c8f2fed8e33011f --head 967de9b8893ca8dae0c6dc1da04728233073f943 --jsonJpeg.cppandPsl.cppfrom a head extract: each reports one literal-path registration heuristic; both are already registered in the library's test target.Results
Precheck report, checks table, unedited (
/dev/shm/reviewer-run/precheck/14421b/report.md):The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check ba627802e2210187d417deb64c8f2fed8e33011f...967de9b8893ca8dae0c6dc1da04728233073f943/usr/bin/python3 tools/check_conventions.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head 967de9b8893ca8dae0c6dc1da04728233073f943 --title feat(libSceNKWebKitRequirements): implement the libjpeg, libxml2 and libpsl exports --body /dev/shm/reviewer-run/precheck/14421b/pr-body.md/usr/bin/python3 tools/pr_abi_audit.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head 967de9b8893ca8dae0c6dc1da04728233073f943 --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14421 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14421b/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./usr/bin/python3 /dev/shm/reviewer-run/precheck/14421b/head-967de9b8893c-7d3f2d4f/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14421b/head-967de9b8893c-7d3f2d4f --json .gitmodules 3rdparty/libpsl 3rdparty/libxml2 cmake/LibPsl.cmake cmake/LibXml2.cmake core/libs/prx/libSceNKWebKitRequirements/CMakeLists.txt core/libs/prx/libSceNKWebKitRequirements/Export.cpp core/libs/prx/libSceNKWebKitRequirements/Jpeg.cpp core/libs/prx/libSceNKWebKitRequirements/Psl.cpp core/libs/prx/libSceNKWebKitRequirements/Xml.cpp core/libs/prx/libSceNKWebKitRequirements/Zlib.cpp core/libs/prx/libSceNKWebKitRequirements/include/GuestJpeg.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestPsl.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestXml.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestZStream.hpp core/libs/prx/libSceNKWebKitRequirements/include/Identified.hpp core/libs/prx/libSceNKWebKitRequirements/tests/Jpeg.cpp core/libs/prx/libSceNKWebKitRequirements/tests/Psl.cpp core/libs/prx/libSceNKWebKitRequirements/tests/Xml.cpp core/libs/tests/GuestWebKitZlib.cpp docs/dev/debt/libSceNKWebKitRequirements.mdNo changed Python test module in tools/ can be run as a no-build base-source control.Manual results: the ABI audit at
967de9b8reportspassed_with_warningswith 28 findings and 195 symbols; atfbc2ded7it reported 27. The one new finding isRecordingErrorExit, the test callback described below, flagged lexically as a definition with no header declaration.Hosted at review time:
conventionswas cancelled and re-queued, andeligibility,library-portabilityandreportwere queued. No approval until these pass.Negative control
Not run. The PR does not claim a negative control for the new JPEG test.
Findings
Blocking: none.
Non-blocking:
TestGuestErrorExitexpectsjpeg_read_headerto return 0 after the guesterror_exitreturns. libjpeg's contract is thaterror_exitdoes not return, so this asserts behaviour of the bundled libjpeg-turbo when a callback returns. That is worth a comment in the test, and the assertion should be confirmed on a build.RecordingErrorExitis markedAPS5_VABIinside the anonymous namespace; the ABI audit's new finding comes from that marker. Dropping the marker, or stating in the debt doc that it is test-local, would clear it.wildCount > 0andexcCount > 0assume the bundled list contains wildcard and exception rules such as*.ckand!www.ck. The bundled list is in the libpsl submodule, which is not in this checkout, so I did not check it.cmake/LibXml2.cmakechangesset(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)to a plainset. That is a function-scope variable, so it no longer writes the cache. Confirm on a configure that the bundled libxml2add_subdirectoryruns inside that function.Sources
github.com/boykopovar/AnyPS5@967de9b889/docs/dev/debt/libSceNKWebKitRequirements.mdgithub.com/boykopovar/AnyPS5@967de9b889/core/libs/prx/libSceNKWebKitRequirements/tests/Jpeg.cpp (L230-L261)github.com/boykopovar/AnyPS5@967de9b889/cmake/LibXml2.cmake (L6)Not verified
error_exitreturns is not verified.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T14:44:40Z.
Review: COMMENTED
Re-checked — new head, no blocking findings
The CRLF line endings and the libxml2 callback-slot problems that my earlier request-changes reviews raised are both resolved at head 8cabcc04effd5bff71a887b1a70e2753de68924b; the only new change is a rename of five static default callbacks, and hosted checks are still pending, so this is a COMMENTED result, not an approval.
What I ran
8cabcc04effd5bff71a887b1a70e2753de68924b, baseba627802e2(the precheck base). The head moved from967de9b889(my last posted result, review 5728363081). The one new commit,8cabcc04ef, is a refactor incore/libs/prx/libSceNKWebKitRequirements/Jpeg.cpp./usr/bin/python33.11.2, no build.python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14421 --output-dir /dev/shm/reviewer-run/precheck/14421c967de9b8...8cabcc04): one file,Jpeg.cpp, 10 lines changed.docs/dev/debt/libSceNKWebKitRequirements.mdat this head has 0 CR bytes (fetched withgh api); atfbc2ded785it had 57.core/libs/prx/libSceNKWebKitRequirements/Xml.cpplines 745-785.xmlRegisterInputCallbacks_nid_postfixandxmlRegisterOutputCallbacks_nid_postfixstore each guest callback set in its own slot (g_inputSlots[slot],g_outputSlots[slot]), bind it to a per-slot host trampoline (InputTrampolines[slot],OutputTrampolines[slot]), refuse when the slot count is reached, and clear the slot if libxml2 rejects the registration. Both slot counts are 15 (XmlInputSlotCount,XmlOutputSlotCount, lines 45-46).python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base ba627802e2 --head 8cabcc04effd5bff71a887b1a70e2753de68924b --json(exit 0;passed_with_warnings; 23public-declaration-not-foundfindings, all lexical; 195 symbols).Results
Precheck report, checks table, unedited (
/dev/shm/reviewer-run/precheck/14421c/report.md):The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check ba627802e2210187d417deb64c8f2fed8e33011f...8cabcc04effd5bff71a887b1a70e2753de68924b/usr/bin/python3 tools/check_conventions.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head 8cabcc04effd5bff71a887b1a70e2753de68924b --title feat(libSceNKWebKitRequirements): implement the libjpeg, libxml2 and libpsl exports --body /dev/shm/reviewer-run/precheck/14421c/pr-body.md/usr/bin/python3 tools/pr_abi_audit.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head 8cabcc04effd5bff71a887b1a70e2753de68924b --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14421 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14421c/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./usr/bin/python3 /dev/shm/reviewer-run/precheck/14421c/head-8cabcc04effd-d0337903/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14421c/head-8cabcc04effd-d0337903 --json .gitmodules 3rdparty/libpsl 3rdparty/libxml2 cmake/LibPsl.cmake cmake/LibXml2.cmake core/libs/prx/libSceNKWebKitRequirements/CMakeLists.txt core/libs/prx/libSceNKWebKitRequirements/Export.cpp core/libs/prx/libSceNKWebKitRequirements/Jpeg.cpp core/libs/prx/libSceNKWebKitRequirements/Psl.cpp core/libs/prx/libSceNKWebKitRequirements/Xml.cpp core/libs/prx/libSceNKWebKitRequirements/Zlib.cpp core/libs/prx/libSceNKWebKitRequirements/include/GuestJpeg.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestPsl.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestXml.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestZStream.hpp core/libs/prx/libSceNKWebKitRequirements/include/Identified.hpp core/libs/prx/libSceNKWebKitRequirements/tests/Jpeg.cpp core/libs/prx/libSceNKWebKitRequirements/tests/Psl.cpp core/libs/prx/libSceNKWebKitRequirements/tests/Xml.cpp core/libs/tests/GuestWebKitZlib.cpp docs/dev/debt/libSceNKWebKitRequirements.mdNo changed Python test module in tools/ can be run as a no-build base-source control.Negative control
Not applicable to this head: the change is a rename.
Findings
Blocking: none.
Non-blocking:
DefaultGuestErrorExit,DefaultGuestEmitMessage,DefaultGuestOutputMessage,DefaultGuestFormatMessage,DefaultGuestResetErrorMgr) arestatic, so the rename changes no linkage or behaviour; it only changes whattools/progress.pycounts. A rename to satisfy a counting tool is a workaround. The tool should skipstaticfunctions, and the rename can then be dropped.Stale reviews: my earlier CHANGES_REQUESTED reviews 5728052613 (at
ec1fa3c51e) and 5728122842 (atfbc2ded785) no longer describe this head. 5728052613 raised two things atec1fa3c51e: libxml2 registrations sharing one set of guest callbacks, and CRLF debt-file line endings. The shared-callback defect is fixed by the per-registration slots atfbc2ded785(read above); the CRLF item is fixed at967de9b889(0 CR bytes). 5728122842 raised the CRLF item atfbc2ded785, fixed at967de9b889. Both should be dismissed or superseded by the author or coordinator.Sources
github.com/boykopovar/AnyPS5@8cabcc04ef/core/libs/prx/libSceNKWebKitRequirements/Xml.cpp (L745-L785)github.com/boykopovar/AnyPS5@8cabcc04ef/core/libs/prx/libSceNKWebKitRequirements/Xml.cpp (L45-L46)github.com/boykopovar/AnyPS5@8cabcc04ef/core/libs/prx/libSceNKWebKitRequirements/Jpeg.cppNot verified
guest_nkwebkit_requirementsand the Jpeg, Psl and Xml tests) were not built or run here.conventions(one run cancelled, one queued),eligibility,labels,library-portabilityandreportwere queued at review time.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-11-01T15:07:37Z.
Review: DISMISSED
Reviewed
8cabcc04effd5bff71a887b1a70e2753de68924b.[P1] Unwrap guest FILE streams before passing them to libpsl —
Psl.cpp:76–77.psl_load_fp_nid_postfixforwards its argument directly to hostpsl_load_fp. Guest stdio usesFileStream*, whose hostFILE*is stored beyond the guest FILE prefix; the two pointers are not interchangeable. Reproduced on Windows with the pinned libpsl: loading the same two-rule suffix list through a host FILE passes, while passing a realFileStreamwrapper segfaults. A separate control that unwraps the stream withGetStreamHandlepasses. Please expose the guest stream type, unwrap it for libpsl, and make the regression use a guest stream rather thanstd::fopen's host pointer.Validation: built the submitted shared library against the pinned JPEG/XML/PSL dependencies with MSYS2 GCC 16.2 Release; all four supplied suites pass. The supplied PSL test also passes standalone, but its FILE test uses a host FILE and misses this defect. Conventions and whitespace pass. The diagnostic control changes only the review harness; this PR's files are unchanged. Depends on #14374.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T15:43:55Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Three blocking defects at this head: a guest FILE* reaches a host FILE API, a guest document pointer dangles after its parser context is freed, and the default JPEG error callback returns after a fatal error.
What I ran
8cabcc04effd5bff71a887b1a70e2753de68924b; PR baseba627802e2; merge baseba8dcc6ae8; 21 changed files, +4012/-351 (PR files API).Results
Commands and unedited precheck output
Commands:
python3 tools/pr_abi_audit.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head 8cabcc04effd5bff71a887b1a70e2753de68924b --json. Result: status passed_with_warnings; 195 symbols; 0 alias mismatches; 23 findings, all of kind public-declaration-not-found. The 23 are defined only in tests/Jpeg.cpp (GuestFillInputBuffer, GuestInitSource, GuestResyncToRestart, GuestSkipInputData, GuestTermSource, RecordingErrorExit) and tests/Xml.cpp (IoClose, IoMatch, IoOpen, IoRead, OutClose, OutMatch, OutOpen, OutWrite, SaxCdataBlock, SaxCharacters, SaxComment, SaxEndDoc, SaxEndElementNs, SaxError, SaxSerror, SaxStartDoc, SaxStartElementNs).python3 tools/pr_test_quality.py --root <archive> --json tests/Jpeg.cpp tests/Psl.cpp tests/Xml.cpp core/libs/tests/GuestWebKitZlib.cpp. Result: 4 possible-unregistered-cpp-test flags. Registration exists: CMakeLists.txt line 21 (guest_webkit_zlib_tests) and line 31 (foreach over Jpeg, Xml, Psl).gh api repos/boykopovar/AnyPS5/commits/8cabcc04effd5bff71a887b1a70e2753de68924b/check-runs.Precheck table (unedited):
The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check ba627802e2210187d417deb64c8f2fed8e33011f...8cabcc04effd5bff71a887b1a70e2753de68924b/usr/bin/python3 tools/check_conventions.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head 8cabcc04effd5bff71a887b1a70e2753de68924b --title feat(libSceNKWebKitRequirements): implement the libjpeg, libxml2 and libpsl exports --body /dev/shm/reviewer-run/precheck/14421c/pr-body.md/usr/bin/python3 tools/pr_abi_audit.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head 8cabcc04effd5bff71a887b1a70e2753de68924b --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14421 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14421c/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./usr/bin/python3 /dev/shm/reviewer-run/precheck/14421c/head-8cabcc04effd-d0337903/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14421c/head-8cabcc04effd-d0337903 --json .gitmodules 3rdparty/libpsl 3rdparty/libxml2 cmake/LibPsl.cmake cmake/LibXml2.cmake core/libs/prx/libSceNKWebKitRequirements/CMakeLists.txt core/libs/prx/libSceNKWebKitRequirements/Export.cpp core/libs/prx/libSceNKWebKitRequirements/Jpeg.cpp core/libs/prx/libSceNKWebKitRequirements/Psl.cpp core/libs/prx/libSceNKWebKitRequirements/Xml.cpp core/libs/prx/libSceNKWebKitRequirements/Zlib.cpp core/libs/prx/libSceNKWebKitRequirements/include/GuestJpeg.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestPsl.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestXml.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestZStream.hpp core/libs/prx/libSceNKWebKitRequirements/include/Identified.hpp core/libs/prx/libSceNKWebKitRequirements/tests/Jpeg.cpp core/libs/prx/libSceNKWebKitRequirements/tests/Psl.cpp core/libs/prx/libSceNKWebKitRequirements/tests/Xml.cpp core/libs/tests/GuestWebKitZlib.cpp docs/dev/debt/libSceNKWebKitRequirements.mdNo changed Python test module in tools/ can be run as a no-build base-source control.Negative control
Not run. The new tests are C++ and need a build.
Findings
Blocking
A guest FILE is passed to a host FILE API.*
Identified.hppline 52 declarespsl_load_fp_nid_postfix(FILE* fp)with the hostFILE, andPsl.cpplines 76-78 pass it unchanged to libpsl'spsl_load_fp. In this libraryfopenreturns aFileStream*, and the hoststd::FILE*sits behind the guest prefix (FileStream.hpplines 64-68), so libpsl would run stdio on aFileStreamobject.tests/Psl.cpplines 103-105 use the hoststd::fopen, so the test cannot catch this. Smallest fix: take the guest stream type and pass its native handle; add a test that goes through the libcfopenpath.A document outlives its parser context.
Xml.cppline 190 setsg->myDoc = &b->guest_doc, andguest_docis a member of the binding (line 37).xmlFreeParserCtxt_nid_postfix(lines 694-703) moves the binding out of the map (line 696), freeshost_ctxt(line 701), and destroys the binding, includingguest_doc, when it returns. A guest that takesctxt->myDoc, frees the context and keeps using the document reads freed memory. Smallest fix: give the guest document storage its own owner, released with the document, not with the binding; add a test that frees the context before the document.The default JPEG error callback returns after a fatal error.
Jpeg.cpplines 152-156 (DefaultGuestErrorExit_nid_no_patch) only calloutput_messageand return.HandleException(lines 314-329) callserror_exit(line 326) and returns; the wrapperjpeg_calc_output_dimensions(lines 470-480) catchesJpegException(line 477), callsHandleException(line 478) and returns normally, so a fatal decode error becomes a normal return. CONTRIBUTING.md line 7 requires each function to do what it is supposed to or throw. Smallest fix: make the defaulterror_exitthrow.tests/Jpeg.cppreplaceserror_exit(line 242), so the default path is not tested; add a test for it.Non-blocking (subagent findings; line numbers as reported except where cited above)
jpeg_CreateDecompresscatch does not copymsg_code(374-378).s_std_initedis set without synchronisation (338-341). Source-manager callbacks return success when the guest callback is NULL (93-122). The exception object leaks if a guesterror_exitlongjmps out of the catch (423).SyncHostToGuest(781-799). A reentrantSyncGuestToHostcan restore a stalespaceTab(663, 730, 739, 819).h->charset = h->charsetshould readg->charset(226). Six SAX slots are never forwarded andhost_saxstarts zeroed (502-528).guest_ctxt.saxis never set (608-625).FindBindingreleases the mutex before returning a raw pointer (68-76).InitHostSaxsetsinitializedunconditionally (504).uncompress(231-269) are maintainer questions under the third-party code rules; CONVENTIONS allows only debt comments, but the same kind of header exists in libc sources. The branch at 151 leaks on a path the pinned zlib does not reach; a re-initialisation leaks the old stream (148). The totals are checked only on zero-initialised streams (GuestWebKitZlib.cpp 102-108 and 122-128).outdatedcheck accepts 0 or 1 and so proves nothing (tests/Psl.cpp 40-41). The builtin list name returned at Psl.cpp 20-22 comes from the build configuration; whether it embeds a build-host path was not confirmed. IDN support is disabled, so the version string reports "no IDNA support", and the debt doc does not record it.cmake/LibPsl.cmakerequires Python 3 at every configure.cmake/LibXml2.cmakekeeps the libxml2 install rules and turns off XInclude, XPath, Reader, Writer, zlib and gzip input; the debt doc lists none of this.TestErrorHandlingnever asserts the error callback (tests/Xml.cpp 174); thexmlSwitchEncodingresult is discarded (200-201); the external-entity text is not checked (344-358); the progressive JPEG test does no pixel comparison and has unbounded loops (182-226).Sources
github.com/boykopovar/AnyPS5@8cabcc04ef/core/libs/prx/libSceNKWebKitRequirements/Psl.cpp (L76-L78)andgithub.com/boykopovar/AnyPS5@8cabcc04ef/core/libs/prx/libSceNKWebKitRequirements/include/Identified.hpp (L52)github.com/boykopovar/AnyPS5@8cabcc04ef/core/libs/prx/libc/include/FileStream.hpp (L64-L68)github.com/boykopovar/AnyPS5@8cabcc04ef/core/libs/prx/libSceNKWebKitRequirements/Xml.cpp (L188-L190)andgithub.com/boykopovar/AnyPS5@8cabcc04ef/core/libs/prx/libSceNKWebKitRequirements/Xml.cpp (L694-L703)github.com/boykopovar/AnyPS5@8cabcc04ef/core/libs/prx/libSceNKWebKitRequirements/Jpeg.cpp (L152-L156), #L314-L329 and #L470-L480github.com/boykopovar/AnyPS5@8cabcc04ef/CONTRIBUTING.md (L7)Not verified
myDocand frees the context, and whether a guest'serror_exitlongjmps.myDocon context free was not checked against the pinned source. The submodule is not checked out; the pin itself was checked.To get this to a good state
psl_load_fpthrough the libc stream path; a document read after its context is freed; the default JPEGerror_exitthrows.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T19:07:53Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The three blockers from my earlier review are fixed at this head, but the Windows job still aborts in guest_nk_req_jpeg (a libjpeg error path throws through C frames), as it did at 8cabcc04ef. This review at a32021388e supersedes 5728873006 (8cabcc04ef) for the current head.
What I ran
a32021388e2d09040667e76c72f3fa56d8d38672; baseba627802e2; merge baseba8dcc6ae8; 21 changed files, +4101/-351, 9 commits (PR files API).8cabcc04ef: one commit (a32021388e), 8 files, +101/-12. I read the whole delta with context myself and checked each fix against the libcFileStreamAPI and the libjpeg error path. The other 13 PR files are byte-identical to8cabcc04ef(verified withgit diff --statbetween the two heads); the five read-only subagent reports from that review still cover them. I did not re-read those 13 files.8cabcc04ef, to compare the abort.Results
Commands, logs and unedited precheck output
Commands:
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14421 --output-dir <scratch>/precheck/14421d(report.md in that directory).python3 tools/pr_abi_audit.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head a32021388e2d09040667e76c72f3fa56d8d38672 --json. Result: passed_with_warnings; 195 symbols; 0 alias mismatches; 23 public-declaration-not-found warnings, all in test files.guest_nk_req_jpeg ... Exit code 0xc0000409,unhandled exception 'JpegException' thrown,terminate called after throwing an instance of '(anonymous namespace)::JpegException'. The same test, with the same messages, failed at 8cabcc04ef: run 41316484095, job 124885806921.Precheck table (unedited):
The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check ba627802e2210187d417deb64c8f2fed8e33011f...a32021388e2d09040667e76c72f3fa56d8d38672/marc/Conlyse-VIEJO/.venv/bin/python3 tools/check_conventions.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head a32021388e2d09040667e76c72f3fa56d8d38672 --title feat(libSceNKWebKitRequirements): implement the libjpeg, libxml2 and libpsl exports --body /dev/shm/reviewer-run/precheck/14421d/pr-body.md/marc/Conlyse-VIEJO/.venv/bin/python3 tools/pr_abi_audit.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head a32021388e2d09040667e76c72f3fa56d8d38672 --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./marc/Conlyse-VIEJO/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14421 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14421d/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./marc/Conlyse-VIEJO/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14421d/head-a32021388e2d-f482c71c/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14421d/head-a32021388e2d-f482c71c --json .gitmodules 3rdparty/libpsl 3rdparty/libxml2 cmake/LibPsl.cmake cmake/LibXml2.cmake core/libs/prx/libSceNKWebKitRequirements/CMakeLists.txt core/libs/prx/libSceNKWebKitRequirements/Export.cpp core/libs/prx/libSceNKWebKitRequirements/Jpeg.cpp core/libs/prx/libSceNKWebKitRequirements/Psl.cpp core/libs/prx/libSceNKWebKitRequirements/Xml.cpp core/libs/prx/libSceNKWebKitRequirements/Zlib.cpp core/libs/prx/libSceNKWebKitRequirements/include/GuestJpeg.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestPsl.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestXml.hpp core/libs/prx/libSceNKWebKitRequirements/include/GuestZStream.hpp core/libs/prx/libSceNKWebKitRequirements/include/Identified.hpp core/libs/prx/libSceNKWebKitRequirements/tests/Jpeg.cpp core/libs/prx/libSceNKWebKitRequirements/tests/Psl.cpp core/libs/prx/libSceNKWebKitRequirements/tests/Xml.cpp core/libs/tests/GuestWebKitZlib.cpp docs/dev/debt/libSceNKWebKitRequirements.mdNo changed Python test module in tools/ can be run as a no-build base-source control.Negative control
Not run. The new tests are C++ and need a build.
Findings
Blocking
JpegExceptionleaving the test and callingterminate. The throw comes from the host error callback (Jpeg.cppline 41,throw JpegException{cinfo}), which runs inside libjpeg's C code; the C++catchin the wrappers is above those frames. On Windows, C frames built without unwind information cannot be unwound through, which is consistent with the abort. The same abort is in the job at 8cabcc04ef, so this predates this commit; the commit does not change this path. I did not check the libjpeg-turbo build flags for Windows. Direction, not verified: keep libjpeg's error path unwind-safe on Windows (build flags for the C sources), or leave the error through libjpeg's own setjmp path instead of throwing through it. Hosted checks must pass before approval.Blockers 1 to 3 from the earlier review: fixed at this head
psl_load_fp_nid_postfixnow takes the guestFileStream*(Psl.cppline 76,Identified.hppline 52), returns null for a null stream, and passes the native handle fromGetNativeStream(FileStream.hppline 401).SyncStatus(line 252) publishes end-of-file and error state, as other libc functions do when they read the native handle. Tests attests/Psl.cpplines 105-110 go through the guestfopenpath and checkfeof,fcloseand a null stream.g_guestDocs, keyed by the host document (Xml.cpplines 43, 140-143, 196-198), and released inxmlFreeDoc(lines 681-696), not with the parser binding.tests/Xml.cpplines 417-443 free the context and then use the document.error_exitnow throwsstd::runtime_errorwith the formatted message (Jpeg.cpplines 153-159).tests/Jpeg.cpplines 265-291 check the throw andJERR_NO_SOI. The debt file (line 12) records this.Non-blocking
jpeg_CreateDecompress(lines 377-384): the catch calls the guesterror_exitwithout copyingmsg_codefrom the host error, unlike the other wrappers (lines 323-328). The defaulterror_exitformats from the guestmsg_code, so the message on this path can be stale.s_std_initedis set without synchronisation.error_exitlongjmps out of a catch block (reported; not re-run).h->charset = h->charset;should readg->charset.InitHostSaxsetsinitializedunconditionally. Host SAX slots are forwarded only when the guest slot is set (lines 513-525).SyncGuestToHostwritesh->spaceTabfrom the guest; a reentrant sync can restore a stale value (reported; not re-run).FindBindingreleases the mutex before its raw pointer is used.guest_ctxt.saxexists in the file, so the guest SAX table is not set on the guest context (grep).TestErrorHandling(tests/Xml.cppline 171) never asserts the error callback; thexmlSwitchEncodingresult at line 200 is discarded (line 201).outdated == 0 || outdated == 1proves nothing.uncompress(maintainer questions); the leak at Zlib.cpp line 151 and the re-initialisation leak at line 148; the zero-initialised checks at GuestWebKitZlib.cpp lines 102-108 and 122-128; CMake requires Python 3 on every configure; libxml2 install rules and the disabled features are not all in the debt file.Sources
github.com/boykopovar/AnyPS5@a32021388e/core/libs/prx/libSceNKWebKitRequirements/Psl.cpp (L76-L82)andgithub.com/boykopovar/AnyPS5@a32021388e/core/libs/prx/libc/include/FileStream.hpp (L252-L255)and #L401-L405github.com/boykopovar/AnyPS5@a32021388e/core/libs/prx/libSceNKWebKitRequirements/Xml.cpp (L43)and #L140-L143 and #L196-L198 and #L681-L696github.com/boykopovar/AnyPS5@a32021388e/core/libs/prx/libSceNKWebKitRequirements/Jpeg.cpp (L41)and #L153-L159 and #L377-L384Not verified
error_exitreaches the guest boundary was not traced. Guest code can also call that function through the pointer.myDocon context free was not checked against the pinned source.To get this to a good state
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T21:15:06Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Four blocking defects at head
1946ca063c: the Xml use-after-free, two Xml pointer forwards, and the JPEG stale-position bug are verified by reading the exact lines, andZlib.cppcarries block comments that the repository's rule forbids.What I ran
1946ca063c119301a8a1212063c0e81bd6ec7b2f, PR baseba627802e2210187d417deb64c8f2fed8e33011f.git -C /marc/AnyPS5 show 1946ca063c119301a8a1212063c0e81bd6ec7b2f:<path>for the changed files, split across read-only file-range reads. I re-read the lines cited below myself.python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14421 --output-dir <scratch>.Results
Precheck report (unedited header and failing rows)
Findings
Blocking
core/libs/prx/libSceNKWebKitRequirements/Xml.cpp698-699:xmlFreeDocreleases the host document, but nothing clears the host parser context'smyDoc. The next sync (195-198) reads the freed document. Fix: clearmyDocon every binding that points at the freed document, under the same lock.Xml.cpp812:xmlSAX2StartDocument(b ? b->host_ctxt : ctx)passes the guest pointer to libxml2 when no binding is found. The same pattern appears at 657, 797, 802 and 807 (reported). Fix: return without calling libxml2 whenbis null.core/libs/prx/libSceNKWebKitRequirements/Jpeg.cpp104-137: the guest source callbacks see the guest's input position from before the libjpeg call. libjpeg advances the host copy, and the write-back at 137 overwrites it with the stale value. Syncs happen only at entry and exit. Fix: copy the host state into the guest source before each guest callback. Add a test with an unsaved APPn marker that checks pixels.core/libs/prx/libSceNKWebKitRequirements/Zlib.cpp1-4 (the comment block runs to line 35): block comments with the zlib attribution and copyright. CONVENTIONS.md line 13 allows comments only for debt. Fix: remove them and put the attribution in the PR description, or ask maintainers for an exception.Non-blocking
guest_nk_req_jpegappears fixed:Jpeg.cpp36-54 replaces the C++ throw withlongjmp, and the only throw left runs after libjpeg has returned. Not confirmed by a Windows run.tests/Psl.cpp28 expectspsl_check_version_number_nid_postfix(0x001000) == 0. A minimum-version check should not return 0 for a library that is newer. Reported, not run. It needs a run before merge.Jpeg.cpp380 does not checkstructsize(reported).Sources
github.com/boykopovar/AnyPS5@1946ca063c/core/libs/prx/libSceNKWebKitRequirements/Xml.cpp (L195-L198)and #L698-L699github.com/boykopovar/AnyPS5@1946ca063c/core/libs/prx/libSceNKWebKitRequirements/Xml.cpp (L812)github.com/boykopovar/AnyPS5@1946ca063c/core/libs/prx/libSceNKWebKitRequirements/Jpeg.cpp (L104-L137)github.com/boykopovar/AnyPS5@1946ca063c/core/libs/prx/libSceNKWebKitRequirements/Zlib.cpp (L1-L4)Not verified
To get this to a good state
Fix blocking 1-4, rebuild, and run
guest_nk_req_xml,guest_nk_req_jpegandguest_nk_req_pslon the new head. Confirm the Windows job passes.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T09:54:56Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
At head
bb9960ffa0d11520159f16adb43c283c67e4f8e1, the new CMake dependency breaks the documented Python-optional configure path, and guest updates to the XML parser context’scharsetare discarded.What I ran
Reviewed all 21 changed file entries at head
bb9960ffa0d11520159f16adb43c283c67e4f8e1against PR baseba627802e2210187d417deb64c8f2fed8e33011f. The dependency-aware merge preview against currentmain88e804b0a7df1f1ac373a9e2f72fb378d925fdd4was clean; #14374 is included in this PR’s stack. Environment: Debian Linux, Python 3.11.2, GCC 12.2.0; no build or compilation was run.Results
main; #14374 includedPrecheck results (unedited)
The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check ba627802e2210187d417deb64c8f2fed8e33011f...bb9960ffa0d11520159f16adb43c283c67e4f8e1tools/check_conventions.py --base ba627802e2210187d417deb64c8f2fed8e33011f --head bb9960ffa0d11520159f16adb43c283c67e4f8e1tools/pr_abi_audit.py; the workspace copy was run separately.tools/pr_stack_check.py 14421 --repo boykopovar/AnyPS5tools/pr_test_quality.py; the workspace copy was run separately.Negative control
Not run locally. The author reports regressions against prior code for the XML lifetime and JPEG callback fixes; I did not reproduce them. The current Windows CI is hosted evidence, not a local run.
Findings
Blocking
core/libs/CMakeLists.txtadds every PRX directory, which includes this library. ItsCMakeLists.txtunconditionally includescmake/LibPsl.cmake, wherefind_package(Python3 COMPONENTS Interpreter REQUIRED)runs even though the library target isEXCLUDE_FROM_ALL. This makes a default CMake configure fail on systems without Python, contrary to the repository’s documented optional-Python path. Scope the Python requirement to building the PSL target or avoid requiring Python during configure.SyncGuestToHostassignsh->charset = h->charsetatXml.cpp:241, so a guest update to the exposed parser-context field is discarded before the next libxml2 call. Copy the guest field, or explicitly document and enforce that this exposed field is read-only.Zlib.cpp:1-35adds source comments, whileAGENTS.mdanddocs/dev/CONVENTIONS.mdpermit code comments only for technical debt and the specified closing markers. The PR author identifies the notice as required for the adapted zlib source; I am not asking that it be removed. Resolve this through a maintainer-approved exception or other license-compliant repository policy before merge.Non-blocking
public-declaration-not-foundwarnings. These are lexical findings for internal callback/helper definitions; the audit does not establish an ABI defect.CMakeLists.txtregisters them throughforeach(topic IN ITEMS Jpeg Xml Psl), so these are heuristic false positives.SyncGuestToHostalso leavesdictandsax2untouched; I did not establish whether guest writes to those opaque pointers are supported by this wrapper.Sources
Not verified
charset,dict, orsax2in practice was not confirmed from a runtime caller.To get this to a good state
Make the PSL generator optional at configure time, correct or formally restrict the XML
charsetsync, and resolve the Zlib notice policy with maintainers while preserving required license terms. Then run the applicable build and tests on the new head; I will rerun the same no-build checks and re-review the fixes.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T02:03:54Z.
Review: DISMISSED
Reviewed — changes requested
The entity-returning XML exports reuse one mutable mirror and clear the owning-document link, so valid entity lookups can return incorrect guest data.
What I ran
Reviewed all 21 changed files at head
31dabab2080fe1d6e94db59aaa477f1cf4479b5cagainst PR baseb28bb772177768f99874ca38f6252cd0139acf2a. The merge preview against currentmain(7feb37ee3e30e10139b483fb4df689d5b5b69ab8) was clean. Environment: Debian Linux 6.1, Python 3.11.2, GCC 12.2.0. No local build or compilation was run.Results
mainRaw check output
Precheck output:
The ABI helper returned
passed_with_warnings; all 23 warnings were for callback definitions used by the added tests. The test-quality heuristic warned that four C++ test sources may be unregistered; direct inspection of the CMake registration confirmed they are included.Hosted checks:
Negative control
Findings
Blocking
SyncHostEntityToGuestrewrites the samethread_local GuestEntityfor every call. A caller that saves the result ofxmlGetPredefinedEntity("amp")and then looks up"lt"receives a pointer whose fields now describe"lt"; a document entity result is overwritten the same way. Keep a stable guest mirror for each host entity for the relevant entity lifetime and add a regression that retains two lookup results and checks both after the second lookup.GuestEntity::docto null. libxml2 associates document entities with their owning document, and consumers reading this field through the guest ABI will see a different relationship. Map the hostxmlDocPtrto itsGuestDocand preserve that pointer in the stable mirror; test a document entity'sdocfield.Non-blocking
Sources
doc: Xml.cpp at the reviewed head.xmlAddEntitysets document entities'doctodtd->doc(same pinned source).Not verified
To get this to a good state
Use stable guest entity mirrors, preserve each document entity's owning
GuestDoc*, and add the two regression cases above. On the new head I will rerun the precheck, diff check, and hosted-check inspection listed under What I ran, then run the focused XML CTest if an exact-head build is available.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T06:40:11Z.
Review: COMMENTED
Re-checked — new head, no blocking findings
The new per-entity mirrors and regression tests address the prior aliasing and missing-document-owner findings; hosted Windows and several platform jobs are still running.
What I ran
b75abdf6b120847836beea01fbf91f6fd52cf0c3against the PR-recorded baseb28bb772177768f99874ca38f6252cd0139acf2a; compared the three changed files since my previous review at31dabab2080fe1d6e94db59aaa477f1cf4479b5c. The precheck's current-main merge preview was clean againstd1ae628bc2f62459cce1e9872ba5632c938c71f2.Results
main.Commands and unedited outputs
Precheck command output:
The precheck report says
diff_checkandconventions_and_pr_templatepassed, and the live merge preview passed. Its ABI and test-quality helper invocations failed because those scripts are absent from the isolated PR snapshot. The update does not alter export declarations; the full-diff lexical ABI audit emitted 23 warnings and is not treated as a correctness certificate.The raw
git diff --checkoutput was empty (exit status 0).Hosted check output at the final refresh:
Negative control
Not run: the added C++ regression needs an exact-head test binary, and no safe no-build mutation path was available.
Findings
Blocking
GuestEntity::doc.Non-blocking
3979b705f3b87d75827d036a587be8c37bc6f148; that current dependency head is not included in this branch. The stack preview is clean against currentmain, so this is not a conflict finding. Defer dependency integration until #14374 lands.Sources
Not verified
To get this to a good state
No blocking code change is needed in the reviewed update. Let the pending hosted checks finish and keep the #14374 stack relationship until that dependency lands. If this head changes, I will rerun the same no-build checks and review the new delta.
Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-11-08T20:35:34Z.
Review: COMMENTED
The PSL regression now reopens the test list through guest stdio, which exercises the guest stream boundary from my earlier review. The current Windows job failed in
guest_standard_streamswith0xc0000409. Please compare that test on the workflow's merge base and PR merge to determine whether it is specific to this change. Windows job