feat(libSceJsc): implement JSString ownership and conversion #10950
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10950"
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 AZLisme on 2026-10-25T11:20:11Z.
What
Implement the ten confirmed JavaScriptCore JSString exports: UTF-8/UTF-16 creation, retain/release, length/backing access, UTF-8 sizing/conversion and equality. Previously the library had no implementations for these functions. Strings own a copied UTF-16 buffer; bounded output preserves whole codepoints and null-string behavior.
Contract: WebKit revision f274ef4c03ebace644c46f8ec55746b391acdcc8, JSStringRef.cpp, OpaqueJSString.cpp and UTF8Conversion.cpp. Console version, allocation limits and foreign opaque-object interoperability remain unverified and are recorded in debt. No copied third-party implementation or new dependency.
Tested
Manual CI
40445885976, attempt 1, completed successfully for the ordered five-PR composition #114726e97111223→ #1097578cb208c0c→ #112694ccb760d12→ #109505746326efc→ #10961844e39236f, on frozen main09f9a63f6b85aec9f36ce5d0d46f41c37cbd86fd. This PR’s tested head is5746326efc33bc56c24b1a7e1192186a783eda83.121997011318121997011314Both jobs passed
guest_jsc_string,guest_icu_unescape,guest_icu_version, all 65 public-header CTests andpatched_libraries; both skip validators passed. This qualifies the recorded five-PR Linux/Windows Release composition, not either PR alone or later main. Ancillary macOS/relinker-ASan jobs do not establish macOS-library, library-ASan or native-console coverage. Earlier entries below retain their original heads, compositions, outcomes and historical status.Maintainer CI 40382857757/a1 has mixed results; the full run failed on Linux. Exact composition: base
6b16c9c6499a, then #10961@844e39236f0e→ #10953@8b4bb4d239ad→ #11235@3e333ce0fc5d→ #11337@d84c522f4bda→ #10950@5746326efc33.Windows job 121783493660 passed its normal Release build/library targets and suite: 1,692 passed, 815 validated expected skips, zero failed / 2,507. Linux job 121783493789 built successfully but reported 2,306 passed, 93 observed skips, two failed / 2,401:
guest_sigvec_modulesandguest_posix_spawn. Its skip validator was skipped; those 93 skips are not policy-qualified.On both platforms,
guest_jsc_stringand all 65 header cases (public_headersplus 64 compilation batches) passed. This qualifies only the exact five-input composition, not an isolated head, newer main, other ICU follower heads, console equivalence or an overall green run. No source changes or dependency waivers result from this evidence. Existing prerequisite and review gates remain. Earlier entries below retain their historical source/base scopes.Linux x86-64, GCC 16.2.1, Release, BUILD_TESTING=ON. Rebased onto main
63a863d3b07fafter #10005 merged. Rebuilt the complete changed PRX and focused test executables against freshly rebuilt libc/libkernel runtime dependencies from the same frozen base; tests pass 1/1.Every nonzero Unicode scalar against an independent standard-library conversion; malformed UTF-8, embedded NUL, UTF-16 surrogate boundaries, bounded output/canaries, copied ownership, concurrent reference counts and oversized-count rejection before reads.
The whole-tree
public_headers --audit-onlycheck passes. The canonical public API and umbrella headers compile standalone and twice-included with-Werror; cpp/test prototypes and ABI types use those headers.python3 tools/check_conventions.py --base origin/mainandgit diff --checkpass.Contributor wachi35676 reports Windows Release validation of head
5746326efc33bc56c24b1a7e1192186a783eda83merged onto main90f918fa7, using WinLibs GCC 15.2.0:guest_jsc_stringpassed twice. The reported scope includes the every-scalar standard-library conversion comparison, malformed UTF-8, surrogate boundaries, bounded-output canaries and concurrent reference counts.This is focused runtime validation. A monolithic repository build and local Windows/macOS/PS5 execution were not performed.
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)The current overlap report finds no overlap with open PRs.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T11:36:50Z.
Review: APPROVED
I reviewed the UTF-8 decoder/encoder boundaries, null-versus-empty representation, UTF-16 ownership, partial-output capacity handling, and atomic retain/release path. The exhaustive Unicode scalar round-trip and the explicit malformed-sequence and capacity-boundary cases provide useful focused coverage. I also confirmed the changed head passes the repository conventions check and
git diff --checkagainstupstream/main. The PR reports a passing focused runtime suite; I did not rerun that suite locally. I found no blocking correctness issue in this patch.