feat(libSceNKWebKit): implement 64 field getters and setters read from the module #23475
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23475"
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 RiverWhy on 2026-11-19T04:12:56Z.
What
Implements 64
libSceNKWebKitexports whose body in the module is a single load from, or store into,thisfollowed byret. All 64 throwNotImplementedonmaintoday. They extend the existingFieldGetters.cpp(45) andFieldSetters.cpp(19) in the same style: getters read the field, and setters check for a null object and store the argument.Source: the
libSceNKWebKit.sprxwith SHA-2563af992253665387feeb5df90ff27dff683e3aa270cc4d92a0535b46ab18fa20d(the module the existing Constant-return exports and Field setters debt entries read as 11.00). Offsets and widths come from the body bytes:mov off(%rdi),%al; retstd::uint8_tgetter (onlyalis defined)mov off(%rdi),%rax; retstd::uint64_tgettermovzwl off(%rdi),%eax; retstd::uint16_tgettermov off(%rdi),%eax; retstd::uint32_tgetter (HTMLInputElement::size)vmovsd off(%rdi),%xmm0; retdoublegetter (ProgressTracker::estimatedProgress)lea off(%rdi),%rax; retHTMLFormElement::unsafeAssociatedElements)mov %sil,off(%rdi); retmovb $imm,off(%rdi); retstopRunningTasks,setDidGCRecently,enable/disableICECandidateFiltering,InspectorTarget::pause)si/esi/rsiFrameView::setPaintBehavior,TextureMapperLayer::setID,InspectorController::setInspectorFrontendClientWhere
mainalready reads the same field, the offsets agree. For example,TextureMapperLayer::setIDstores at 0x2b0, wheremain'sTextureMapperLayer::idreads, and getter/setter pairs added here (GCActivityCallback0x23,FullGCActivityCallback0x30,NetworkStorageSession0x30/0x31,Page0xe0,FrameView0x390) use the same offset for both. None of these classes is constructed by AnyPS5 with a layout of its own; the only overlapping hand-written code,CrossOriginAccessControl.cpp, already implements that class's two accessors and is not touched.How the table was produced: I recomputed each NID from the declared name and found it in the module's symbol table. I decoded each body twice, once from
objdumpoutput and once from the raw bytes, and both agree on all 64 kinds, offsets and constants. I generated the list against the currentmain; two accessors thatmaingained in the meantime were dropped.Debt: the fragment
docs/dev/debt/changes/feat-nkwebkit-module-field-accessors.mdadds two Functional entries and removes the 46 inventory rows.Overlap: I fetched every open PR head and diffed it against
main. None removes any of these 64 stubs.Tested
Linux Mint 22.3, GCC 13.3, Release:
nkwebkit_modulefieldaccessorstest uses a 4 KiB object filled with 0xa5. Each getter reads back a distinct byte pattern placed at its offset, and the address getter returnsobject + offset. Each setter writes the pattern, or its constant, at exactly its offset and width with every other byte untouched. Every setter throwsinvalid_argumenton a null object.MediaPlayer::mutedfrom 0xd2 to 0xd3 makes the test fail.nkwebkit_*tests pass, including the existingFieldGettersandFieldSetterstests.tools/check_conventions.pypasses.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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T04:26:07Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
aa4250309f:tools/check_conventions.pypassed.nkwebkit_modulefieldaccessors_testsbuilt cleanly.nkwebkit_modulefieldaccessors):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/FieldGettersExports.hpp,core/libs/prx/libSceNKWebKit/include/FieldSettersExports.hpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/src/FieldGetters.cpp,core/libs/prx/libSceNKWebKit/src/FieldSetters.cppreverted 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-21T07:56:02Z.
Review: COMMENTED
Reviewed — comments
Changes are required before merge: resolve the test integration and confirm the newly implemented exports are registered in the runtime dispatch.
What I ran
Reviewed head
779e626397e1ba87ebbc7c0f93c1e3080d15b955using the prepared diff andrepo_read.py; no tests were run.Results
Findings
Blocking
None verified.
Non-blocking
core/libs/prx/libSceNKWebKit/tests/ModuleFieldAccessors.cppis not referenced by theCMakeLists.txttest discovery. That file adds tests for the new accessors, but the existing glob searchestests/*.cppundercore/libs/prx/libSceNKWebKit, and the new file is present there; the observed search for its name in the CMake file itself was empty. Verify the normal glob includes it and add an explicit test registration if the project’s test setup does not discover it.Sources
Not verified
Read:
FieldGettersExports.hpp,FieldSettersExports.hpp,FieldGetters.cpp,FieldSetters.cpp,ModuleFieldAccessors.cpp, debt change note,libSceNKWebKit.hpp,CMakeLists.txt, and the relevant prepared diff and metadata. Full text forExport.cppandInventoryExports.hppwas excluded from the review folder; targeted reader checks confirmed their include structure, but export dispatch and all inventory edits were not audited. Author-reported test results were not rerun. No environment or toolchain checks were run.To get this to a good state
Nothing is required. Optional: confirm the test is picked up by the CMake glob and verify registration for the new accessor implementations.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T13:11:02Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and its tests provide enough evidence to support merging.
What I ran
Reviewed head
8c07f3eafd5de8451f2db1dad7215a9c6d518297usingrepo_read.pyto inspect the prepared diff and targeted source. No test or build commands were run; the test results below are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Export.cppwas excluded from the prepared files because it was too large; its removal hunks were visible indiff.patch, but its full text was not reviewed.InventoryExports.hppandLegacyExports.hpphad no added lines and their full contents were not read. Repository-wide build and test results, console behavior, and the module binary’s hash and decoded instruction bodies were not independently verified. The author reports Linux Mint 22.3/GCC 13.3 tests and convention checks passed.Files read:
description.md,commits.md,manifest.json,diff.patch,README.md; changed filesFieldGettersExports.hpp,FieldSettersExports.hpp,FieldGetters.cpp,FieldSetters.cpp,ModuleFieldAccessors.cpp, andfeat-nkwebkit-module-field-accessors.md; targeted contextCMakeLists.txt,libSceNKWebKit.hpp,InventoryExports.hpp,LegacyExports.hpp, andExport.cpp. Excluded from full-text review:Export.cpp(too large),InventoryExports.hppandLegacyExports.hpp(no added lines).To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:52:18Z.
Review: COMMENTED
Built the branch’s changed sources and ran ModuleFieldAccessors on Linux against the existing runtime libraries. The test run passed and covered the WebKit field getter and setter cases.
AI-assisted: yes.
Pull request closed