feat(libSceJsc): implement WTF object identifiers and random numbers #19313
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19313"
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 B-Howell on 2026-11-13T03:03:11Z.
What
Implements five
libSceJscWTF exports that threw:ObjectIdentifierBase::generateIdentifierInternal,ObjectIdentifierBase::generateThreadSafeIdentifierInternal,cryptographicallyRandomNumber,randomNumberandweakRandomUint32. They follow the WebKit revision the library's debt file already pins:std::atomichere.randomNumberdivides onecryptographicallyRandomNumberword by 2^32, giving [0, 1).weakRandomUint32advances one shared xorshift128+ generator, written as WeakRandom.h does and seeded fromcryptographicallyRandomNumber. A mutex guards that state, which WebKit leaves racy.cryptographicallyRandomNumberreuses the existingHostEntropy_nid_no_patchinstead of WebKit's ARC4 generator.The typed prototypes move from
InventoryExports.hppto a newWtfRandomExports.hpp. The five inventory rows are removed, the table count goes from main's stated 330 to 325, and a debt entry records that none of this has been compared with a console module.createCanonicalUUIDStringis left out, because it returns aWTF::String.Tested
Ubuntu WSL2, GCC, Release, Ninja.
b72a0cd5201): with the new test and typed header but theExport.cppstubs still in place,jsc_wtf_randomfails 3/3:Subprocess aborted,_ZN3WTF20ObjectIdentifierBase26generateIdentifierInternalEv not implemented.dac63a20c52(the PR head9c896c566bediffers only in the debt entry wording):jsc_wtf_randompasses 3/3. It checks that both counters start at 1, are independent and step by one; that 4 threads x 2000 thread-safe calls give unique, dense values; thatrandomNumberstays in [0, 1); and that the three random sources vary, withcryptographicallyRandomNumbersetting and clearing all 32 bits across 256 calls.jsc_wtf_url,jsc_wtf_string_search,jsc_placement_newandguest_jsc_stringpass, andpublic_headerspasses 65/65.tools/progress.py: libraries done goes from 15578 on main7a6183485f7to 15583 (+5) out of 39251;libSceJscgoes from 64 to 69.pr_overlapagainst 1492 open PRs on maina6606d5bab7found #18951 editing neighbouringExport.cpplines (a text conflict only, with no shared exports). It could not compare #18430 and #18442, so they were checked by hand; neither touches these five exports.28a3bb1fe67, an ordinary merge ofmainate90cbbc086fafter #19188, #19193 and #19271, whoselibSceJscchanges landed within 50 lines of ours. The callable-exports count is main's stated 330 minus these five (325). Rebuilt on WSL Ubuntu, GCC, Release:jsc_wtf_random,jsc_wtf_sha1andjsc_wtf_bit_vectorpassed. Conventions passed.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 PrivacyOnion on 2026-11-13T12:43:51Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
9c896c566b:tools/check_conventions.pypassed;git diff --checkclean.jsc_wtf_random_testsbuilt cleanly.jsc_wtf_random):core/libs/prx/libSceJsc/Export.cpp,core/libs/prx/libSceJsc/include/InventoryExports.hpp,core/libs/prx/libSceJsc/libSceJsc.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Generated withfooter from the description; the AI-assisted checkbox can stay.Looks Good To Me