Skip to content

feat(libSceJxr): implement the linked-list WMPStream - #15771

Merged
oneandonlydean merged 24 commits into
boykopovar:mainfrom
alvaroelpob:feat/libscejxr-list-stream
Nov 8, 2026
Merged

oneandonlydean merged 24 commits into
boykopovar:mainfrom
alvaroelpob:feat/libscejxr-list-stream

Conversation

@alvaroelpob

@alvaroelpob alvaroelpob commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What

Implements the libSceJxr list stream exports, CreateWS_List, CloseWS_List, ReadWS_List, WriteWS_List, SetPosWS_List and GetPosWS_List, as in jxrlib's strcodec.c. The stream keeps 4 KiB guest-heap packets chained through next-packet pointers, and jxrlib's bounds checks are kept as written.

Tested

Full suite on 715a2a2 (Linux): 3883/3883 passed, including the new guest_jxr_list_stream test. It covers writes that fill and link packets, jxrlib's capacity and wrap checks, a failed packet allocation and its retry, reads across packets up to the capacity clamp and past the last packet, seeks inside and beyond the chain, positions, closing a multi-packet stream, and CreateWS_List's layout, slots and allocation failure, with a round trip through the slots. check_conventions passes.

Checklist

@JJenkx

JJenkx commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Windows check of head 715a2a2b57, which already contains main b11c7bf84f.

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run this test on pull requests.

guest_jxr_list_stream fails in 3 of 3 runs, at JXR list stream check failed at line 202. That line is Require(stream->close == &CloseWS_List_nid_postfix && ...).

This is the same Windows behaviour as in #15739. The library stores the address of CloseWS_List_nid_postfix inside the DLL. In the test executable, &CloseWS_List_nid_postfix names a DLL import declared without dllimport, so it resolves to the executable's own import stub. The two pointers therefore differ on Windows, and so do lines 203 and 204, which make the same comparison for read, write, setPosition and getPosition.

#15739 fixed it by taking the expected pointer from GetProcAddress(GetModuleHandleA("<module>.prx"), "<name>") on Windows. libSceMouse/tests/MouseAbsolute.cpp's Resolve uses the same pattern.

AI-assisted: yes.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Progress report (9e47f0c → 4595cdf)

📈 System libraries: 32.03% (+0.02%, +6 implemented functions)

✅ 6 implemented
Library Name
libSceJxr CloseWS_List_nid_postfix
libSceJxr CreateWS_List_nid_postfix
libSceJxr GetPosWS_List_nid_postfix
libSceJxr ReadWS_List_nid_postfix
libSceJxr SetPosWS_List_nid_postfix
libSceJxr WriteWS_List_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libSceJxr 68/136 (50.00%) 74/136 (54.41%) +4.41%

@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Thanks. The test now takes the expected CloseWS_List, ReadWS_List, WriteWS_List, SetPosWS_List and GetPosWS_List pointers from GetProcAddress(GetModuleHandleA("libSceJxr.prx"), ...) under _WIN32, as #15739 does; other hosts keep the linked symbol. 47a6346. Full Linux suite 3883/3883.

@JJenkx

JJenkx commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Rechecked on Windows at head 47a6346ae7, which contains main b11c7bf84f, same setup: guest_jxr_list_stream passes in 3 of 3 runs.

AI-assisted: yes.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 5, 2026
@alvaroelpob
alvaroelpob force-pushed the feat/libscejxr-list-stream branch from 47a6346 to a870eb7 Compare November 5, 2026 19:35
@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased on main ce69412 to resolve the new conflicts. Head a870eb7. Full Linux suite: 4087/4087. check_conventions.py passes.

@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased on main 018cfcb to resolve the new conflicts. Head bbf0d80. Fixes from the rebase, as new commits: bbf0d80 (docs(libSceJxr): keep one entry for the list stream functions after the rebase); Full Linux suite: 4168/4168. check_conventions.py passes.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 14212 docs/dev/debt/libSceJxr.md
PR 16282 core/libs/prx/libSceJxr/CMakeLists.txt
core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16696 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16698 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16699 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16700 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16701 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16702 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16704 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16705 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16706 core/libs/prx/libSceJxr/CMakeLists.txt
core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16707 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16709 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16710 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16711 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16712 core/libs/prx/libSceJxr/CMakeLists.txt
core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16713 core/libs/prx/libSceJxr/CMakeLists.txt
core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16714 core/libs/prx/libSceJxr/CMakeLists.txt
core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16715 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16728 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16729 core/libs/prx/libSceJxr/CMakeLists.txt
core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16730 core/libs/prx/libSceJxr/CMakeLists.txt
core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16731 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16732 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16733 core/libs/prx/libSceJxr/CMakeLists.txt
core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16827 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16851 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md
PR 16854 core/libs/prx/libSceJxr/Export.cpp
core/libs/prx/libSceJxr/include/Api.hpp
docs/dev/debt/libSceJxr.md

@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased on main ef9dc27 to resolve the conflicts. Head 9db6287. The rebase needed follow-up commits: f76919b (docs(libSceJxr): place this branch's debt entry before the stub count); 9db6287 (docs(libSceJxr): count 70 after the rebase). Full Linux suite: 4407/4407. check_conventions.py passes.

@alvaroelpob
alvaroelpob force-pushed the feat/libscejxr-list-stream branch from bbf0d80 to 9db6287 Compare November 7, 2026 20:28
Fix-up on alvaroelpob's change: ListStream.cpp adapts the linked-list WMPStream
functions of jxrlib image/sys/strcodec.c (pinned submodule commit
f7521879862b9085318e814c6157490dd9dbbdb4, lines 455-601), so it carries the
same Microsoft notice block that main's SimpleBitIo.cpp carries for the same
file (strcodec.c lines 1-27, copied verbatim, UTF-8).
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 7, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi @alvaroelpob, ListStream.cpp adapts the linked-list stream functions of jxrlib's image/sys/strcodec.c (lines 455-601), so it needs jxrlib's licence notice the way main's SimpleBitIo.cpp has it. I added it as one fast-forward commit on top of your 9db62879de, without touching your change: the 27-line Microsoft notice block, copied verbatim from strcodec.c lines 1-27 at the pinned submodule commit f7521879862b9085318e814c6157490dd9dbbdb4, in the same UTF-8 form as SimpleBitIo.cpp. The jxr tests pass on it (16 of 16, including the list stream test). Nothing for you to do; if you push to the branch, pull first.

One conflict in docs/dev/debt/libSceJxr.md: keep main's PKImageDecode entry,
keep the list stream entry from this PR, and set the remaining additional
stubs to 62 (Export.cpp has 68 NotImplemented_nid_no_patch bodies on main; the
six list stream exports are implemented here).
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 7, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi @alvaroelpob, main had moved under this PR again (a new PKImageDecode entry landed in the libSceJxr debt doc next to yours), so I merged main into your branch as a fast-forward commit on top of d95f1b7e5c, without touching your change. Both entries are kept, and the remaining-stubs line now reads 62, counted from Export.cpp (68 on main, minus the six list stream exports you implement). The licence notice on ListStream.cpp is unchanged, and the jxr tests pass on the merged tree (16 of 16, including the list stream test). Nothing for you to do; if you push to the branch, pull first.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 7, 2026
@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Thanks @oneandonlydean. The conventions check now fails on your licence commit because its subject has no Conventional Commits type:

Commit subject is not Conventional Commits: d95f1b7e5c libSceJxr: add the jxrlib licence notice to the list stream code

Could you reword it, for example to docs(libSceJxr): add the jxrlib licence notice to the list stream code? I have left the branch alone so as not to rewrite your commits.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi @alvaroelpob, thanks for flagging the conventions failure. It comes from our own fix-up commit d95f1b7 (the licence notice), whose subject has no Conventional Commits type. Rewording it would mean rewriting your branch history with a force-push, which we don't do, so we're merging as-is with the conventions check red on that one commit. Everything else is green (windows pass on 4595cdf), and the content was reviewed. For the record: the subject should have been docs(libSceJxr): add the jxrlib licence notice to the list stream code. Our future fix-ups will carry a type.

@oneandonlydean
oneandonlydean merged commit 62e7ca8 into boykopovar:main Nov 8, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants