feat(libSceNKWebKit): implement WebCore::Length CalculationValue exports #24007
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24007"
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 FinleyLaempe on 2026-11-20T00:51:53Z.
What
Implements the two
WebCore::Length(Ref<CalculationValue>&&)constructors,WebCore::Length::ref() const,WebCore::Length::deref() constandWebCore::Length::nonNanCalculatedValue(int) constin libSceNKWebKit, replacing the fiveNotImplemented_nid_no_patchstubs inExport.cpp.Length.cpp: calculation value handles grow monotonically from 1, skipping 0 andUINT_MAX; the map owns the leakedRefand copies share it by handle, as inCalculationValueMap::insert.WebCore::Lengthlayout is the existing struct inRegionExports.hpp; the newNKWebKit::CalculationAbi::CalculationValueinWebCoreLengthAbi.hppis pinned bystatic_asserts to 24 bytes withm_refCountat offset 0,m_expressionat 8 andm_shouldClampToNonNegativeat 16. Not compared on a console; the same layout appears in the module-translatedCalculationValue::createof #23758 (fastMalloc(0x18), reference count 1 at 0, expression at 8, clamp flag at 0x10). That PR implements the factory and this one only theLengthside, so they do not share an export.refandderefadjust the map entry'sreferenceCountMinusOne; the lastdereferases the entry, andCalculationValue::derefruns the expression node's deleting-destructor vtable slot and frees the value withWTF::fastFree, the upstreamWTF_MAKE_FAST_ALLOCATEDpairing (FastMalloc.h).nonNanCalculatedValuetakesintwhere upstream takesfloat, casts tofloat, evaluates the expression node through its vtable slot 2 and appliesCalculationValue.cpp's NaN-to-0 andshouldClampToNonNegativeclamping.WTF::fastMalloc/WTF::fastFreeexports andWTF::Ref/adoptReffromWtfExports.hpp.LengthorCalculationValue, a non-CalculatedLengthType, an unknown handle and a null expression innonNanCalculatedValuethrowstd::invalid_argument; noNotImplemented_nid_no_patchpath remains in the five exports.WebCoreLengthExports.hppinclude inlibSceNKWebKit.hpp.WebCoreLayout.cppis untouched:valueForLengthandfloatValueForLengthstill throw for calculated lengths, and the debt entry is reworded to explain why._ZNK7WebCore6Length3refEv(8OHZsn1lLv0) and_ZNK7WebCore6Length5derefEv(CKQm3LRNxFQ) inventory rows, and rewords the "WebCore layout helpers" entry.tests/WebCoreLength.cppcovers both constructors, shared-handle ref/deref, evaluation and clamping, handle wrap-around and the error paths, using fake expression nodes built withWTF::fastMalloc.Tested
Arch Linux x86-64, GCC 16.2.1, Release build with
-DBUILD_TESTING=ON: the newnkwebkit_webcorelengthtest and every othernkwebkit_*test, 164 of 164 passed.python3 tools/check_conventions.py --base upstream/mainpasses. Not tested on a console or on Windows.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 copilot-pull-request-reviewer[bot] on 2026-11-20T00:52:01Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T01:17:24Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
5b600466b9:tools/check_conventions.pypassed.nkwebkit_webcorelength_testsbuilt cleanly.nkwebkit_webcorelength):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/WebCoreLength.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-20T06:33:39Z.
Review: DISMISSED
Reviewed — changes requested
Changes are required before merge: fix the constructor’s ownership leak when handle insertion throws or exhausts the handle space.
What I ran
Reviewed head
5b600466b9f252d5fe3dc7e5bf7084662be27528from the prepared patch and repository reader. No build or test command was run; the test results below are author-reported.Results
Findings
Blocking
core/libs/prx/libSceNKWebKit/src/WebCoreLength.cpp:251:leakRef()releases theWTF::Refbefore the handle is inserted. Ifunordered_map::emplacethrows (for example, allocation failure), the value has no remaining owner and is leaked. Keep an owning reference until insertion succeeds, or restore ownership on failure.Non-blocking
None.
Not verified
The full contents of
Export.cppandInventoryExports.hppwere excluded from the prepared folder; their changed hunks were inspected indiff.patch. The completeLegacyExports.hppwas also not read; its changed hunks were inspected indiff.patch. Console ABI behavior was not tested.files.jsonwas not available through the reader; manifest entries show which files were included and excluded.Files read:
description.md,commits.md,manifest.json,diff.patch; changed source/header/test filesWebCoreLength.cpp,WebCoreLengthAbi.hpp,WebCoreLengthExports.hpp, andlibSceNKWebKit.hpp; context filesRegionExports.hpp,WebCoreTypes.hpp,WtfExports.hpp, andCMakeLists.txt. Excluded full texts:Export.cpp,InventoryExports.hpp.To get this to a good state
Preserve ownership of the calculation value if handle insertion fails, then rerun the new test and the project test suite on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T13:38:56Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the review was limited to the changed files available in the prepared bundle and targeted repository context.
What I ran
Inspected the prepared diff at head
4678d34e8a74289c0d606950782c51cc4e746c50and usedrepo_read.pyto read changed source and test files plusRegionExports.hpp. No build, test, or convention check was run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full text of
Export.cppandInventoryExports.hppwas excluded for size, and the rest of the changed files listed in the manifest were not read. The claimed build, test suite, and convention check were author-reported only. Console and Windows behavior were not verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T20:30:02Z.
Review: COMMENTED
Reviewed — comments
The change could not be assessed because the prepared review bundle and pinned repository reader were inaccessible in this session.
What I ran
No commands were available to run; the review bundle and source files were not read.
Results
Findings
Blocking
None verified.
Non-blocking
None verified.
Not verified
The PR description, commits, diff, manifest, and changed file contents were not accessible. No file can be reported as read or reviewed.
To get this to a good state
Nothing is required by this draft; a complete review requires access to the prepared bundle and
repo_read.py.Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T14:23:07Z.
Review: COMMENTED
Built the exact WebCore length sources and ran the branch's
WebCoreLengthfixture against the existing Linux runtime. The fixture passed its constructor, shared-handle, evaluation, and rejection checks.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-03T23:49:44Z.
Review: COMMENTED
Actionable comments
46be571f-9cb2-47dc-99f8-eb32e942cf1aReviewing files that changed from the base of the PR and between
5ff6ec4365and3020d911eb.core/libs/prx/libSceNKWebKit/Export.cppcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppcore/libs/prx/libSceNKWebKit/include/LegacyExports.hppcore/libs/prx/libSceNKWebKit/include/WebCoreLengthExports.hppcore/libs/prx/libSceNKWebKit/libSceNKWebKit.hppcore/libs/prx/libSceNKWebKit/src/WebCoreLength.cppcore/libs/prx/libSceNKWebKit/src/WebCoreLengthAbi.hppcore/libs/prx/libSceNKWebKit/tests/WebCoreLength.cppdocs/dev/debt/changes/feat-nkwebkit-length.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T00:21:25Z.
Review: APPROVED
Reviewed — looks good
The reviewed changes implement the calculated
WebCore::Lengthexports, and I found no verified blocking defect.What I ran
Reviewed head
3020d911eb917427a0c5acc066ff40de91eebdbdfrom the prepared diff and inspectedWebCoreLength.cppat the pinned head withrepo_read.py. No tests or builds were run.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No tests or builds were run in this review, and console behavior was not verified. The description reports 164 tests passed on Arch Linux; this is author-reported. The reader’s subsequent call could not log because the run folder is read-only. Files covered from the prepared diff:
Export.cpp,InventoryExports.hpp,LegacyExports.hpp,WebCoreLengthExports.hpp,libSceNKWebKit.hpp,WebCoreLength.cpp,WebCoreLengthAbi.hpp,tests/WebCoreLength.cpp, andfeat-nkwebkit-length.md. Excluded files: none.To get this to a good state
Nothing is required.
Pull request closed