feat(libSceNKWebKit): implement JSC::MarkingConstraint::quickWorkEstimate #23746

Merged
Dark3581 merged 1 commit from upstream-pr/23746 into main 2026-11-20 16:19:35 +00:00
Dark3581 commented 2026-11-19 15:36:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dark3581 on 2026-11-19T15:36:28Z.


What

Implements JSC::MarkingConstraint::quickWorkEstimate(SlotVisitor&) in libSceNKWebKit. It was a throwing stub in Export.cpp.

  • The base-class default returns 0 and reads neither the constraint nor the visitor. Both the pinned PS5 WebKit 11.x MarkingConstraint.cpp and WebKit Safari-611.1.1 define it that way.
  • The result is a double, returned in xmm0.
  • The debt fragment removes its inventory row and adds a Functional entry.

tools/pr_overlap.py --names lists no open PR for it, and no PR closed by the open-PR limit touches it. --branch shows only the line every NKWebKit PR appends to libSceNKWebKit.hpp. It failed closed on 30 PRs that conflict with main. I grepped each one's diff from its merge base, and none changes this export.

Tested

Windows 10 22H2, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, on main 77d2c4ae60 plus this commit.

  • ctest -R "^(nkwebkit_|guest_nkwebkit)": 154 of 154 pass, including the new nkwebkit_markingconstraint.
  • The new test checks that the result is a positive zero, with and without pointers, and that neither argument is touched.
  • tools/check_conventions.py --base origin/main, tools/debt_fold.py --check and tools/env_reference.py --check pass.

No title run: no title on hand reaches this function.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5397951063 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23746). Originally posted by [Dark3581](https://github.com/Dark3581) on 2026-11-19T15:36:28Z. --- ### What Implements `JSC::MarkingConstraint::quickWorkEstimate(SlotVisitor&)` in libSceNKWebKit. It was a throwing stub in `Export.cpp`. - The base-class default returns 0 and reads neither the constraint nor the visitor. Both the pinned [PS5 WebKit 11.x MarkingConstraint.cpp](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/JavaScriptCore/heap/MarkingConstraint.cpp#L70-L73) and WebKit [Safari-611.1.1](https://github.com/WebKit/WebKit/blob/Safari-611.1.1/Source/JavaScriptCore/heap/MarkingConstraint.cpp#L63-L66) define it that way. - The result is a `double`, returned in `xmm0`. - The debt fragment removes its inventory row and adds a Functional entry. `tools/pr_overlap.py --names` lists no open PR for it, and no PR closed by the open-PR limit touches it. `--branch` shows only the line every NKWebKit PR appends to `libSceNKWebKit.hpp`. It failed closed on 30 PRs that conflict with `main`. I grepped each one's diff from its merge base, and none changes this export. ### Tested Windows 10 22H2, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, on `main` 77d2c4ae60 plus this commit. - `ctest -R "^(nkwebkit_|guest_nkwebkit)"`: 154 of 154 pass, including the new `nkwebkit_markingconstraint`. - The new test checks that the result is a positive zero, with and without pointers, and that neither argument is touched. - `tools/check_conventions.py --base origin/main`, `tools/debt_fold.py --check` and `tools/env_reference.py --check` pass. No title run: no title on hand reaches this function. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-19 15:37:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T15:37:44Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 3fb38415d5:

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_markingconstraint_tests built cleanly.
  • CTest (nkwebkit_markingconstraint):
    1/1 Test #4673: nkwebkit_markingconstraint .......   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp, core/libs/prx/libSceNKWebKit/src/MarkingConstraint.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified mangled symbol '_ZN3JSC17MarkingConstraint17quickWorkEstimateERNS_11SlotVisitorE' matches JSC::MarkingConstraint::quickWorkEstimate(SlotVisitor&) and returns double (0.0) in xmm0 as per WebKit / JavaScriptCore upstream base class implementation.
    • Verified ABI signature double APS5_VABI (void* self, void* visitor) in MarkingConstraintExports.hpp and MarkingConstraint.cpp correctly ignores both unused arguments and returns 0 without dereferencing guest pointers.
    • Verified removal of the unimplemented stub from core/libs/prx/libSceNKWebKit/Export.cpp and core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp.
    • Verified docs/dev/debt/changes/feat-nkwebkit-marking-constraint-work-estimate.md adheres to debt fragment conventions (removing inventory NID DD08+9TAImA and adding Functional entry).
    • Verified test suite core/libs/prx/libSceNKWebKit/tests/MarkingConstraint.cpp thoroughly validates return value, signbit, caller state immutability, and null safety.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5978127610 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23746#pullrequestreview-5978127610). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-19T15:37:44Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `3fb38415d5`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_markingconstraint_tests` built cleanly. - **CTest** (`nkwebkit_markingconstraint`): ``` 1/1 Test #4673: nkwebkit_markingconstraint ....... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp`, `core/libs/prx/libSceNKWebKit/src/MarkingConstraint.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified mangled symbol '_ZN3JSC17MarkingConstraint17quickWorkEstimateERNS_11SlotVisitorE' matches JSC::MarkingConstraint::quickWorkEstimate(SlotVisitor&) and returns double (0.0) in xmm0 as per WebKit / JavaScriptCore upstream base class implementation. - Verified ABI signature double APS5_VABI (void* self, void* visitor) in MarkingConstraintExports.hpp and MarkingConstraint.cpp correctly ignores both unused arguments and returns 0 without dereferencing guest pointers. - Verified removal of the unimplemented stub from core/libs/prx/libSceNKWebKit/Export.cpp and core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp. - Verified docs/dev/debt/changes/feat-nkwebkit-marking-constraint-work-estimate.md adheres to debt fragment conventions (removing inventory NID DD08+9TAImA and adding Functional entry). - Verified test suite core/libs/prx/libSceNKWebKit/tests/MarkingConstraint.cpp thoroughly validates return value, signbit, caller state immutability, and null safety. Looks Good To Me
MarcZX10 commented 2026-11-19 16:54:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T16:54:53Z.

Review: APPROVED


Reviewed — looks good

The implementation matches the documented default behavior, and the changed files reviewed show no concrete defect.

What I ran

Reviewed head f7984e2299c5ca77ed835fd2d94d2dcfc3a75539. No commands or tests were run; author-reported test results were not independently verified.

Results

Check Result Note
Source review passed Implementation and test inspected
Tests not run Reported results are author supplied
Console behavior not run Not compared with a console module

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full contents of core/libs/prx/libSceNKWebKit/Export.cpp and core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp were excluded as too large; only the removal hunk in the prepared diff was reviewed. No builds, tests, hardware, or console behavior were independently verified. Read: core/libs/prx/libSceNKWebKit/src/MarkingConstraint.cpp, core/libs/prx/libSceNKWebKit/include/MarkingConstraintExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp, core/libs/prx/libSceNKWebKit/tests/MarkingConstraint.cpp, core/libs/prx/libSceNKWebKit/CMakeLists.txt, and docs/dev/debt/changes/feat-nkwebkit-marking-constraint-work-estimate.md; also reviewed the relevant diff hunks for the two excluded files. files.json was unavailable; the manifest identifies those two excluded files.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5979517198 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23746#pullrequestreview-5979517198). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T16:54:53Z. **Review:** APPROVED --- # Reviewed — looks good The implementation matches the documented default behavior, and the changed files reviewed show no concrete defect. ## What I ran Reviewed head `f7984e2299c5ca77ed835fd2d94d2dcfc3a75539`. No commands or tests were run; author-reported test results were not independently verified. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Implementation and test inspected | | Tests | not run | Reported results are author supplied | | Console behavior | not run | Not compared with a console module | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The full contents of `core/libs/prx/libSceNKWebKit/Export.cpp` and `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp` were excluded as too large; only the removal hunk in the prepared diff was reviewed. No builds, tests, hardware, or console behavior were independently verified. Read: `core/libs/prx/libSceNKWebKit/src/MarkingConstraint.cpp`, `core/libs/prx/libSceNKWebKit/include/MarkingConstraintExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp`, `core/libs/prx/libSceNKWebKit/tests/MarkingConstraint.cpp`, `core/libs/prx/libSceNKWebKit/CMakeLists.txt`, and `docs/dev/debt/changes/feat-nkwebkit-marking-constraint-work-estimate.md`; also reviewed the relevant diff hunks for the two excluded files. `files.json` was unavailable; the manifest identifies those two excluded files. ## To get this to a good state Nothing is required.
PrivacyOnion commented 2026-11-19 16:59:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T16:59:34Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against f7984e2299:

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_markingconstraint_tests built cleanly.
  • CTest (nkwebkit_markingconstraint):
    1/1 Test #4680: nkwebkit_markingconstraint .......   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp, core/libs/prx/libSceNKWebKit/src/MarkingConstraint.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified mangled symbol '_ZN3JSC17MarkingConstraint17quickWorkEstimateERNS_11SlotVisitorE' corresponds to JSC::MarkingConstraint::quickWorkEstimate(SlotVisitor&) and accurately returns double 0.0 in xmm0 per WebKit upstream base-class implementation.
    • Verified ABI calling convention signature 'double APS5_VABI _ZN3JSC17MarkingConstraint17quickWorkEstimateERNS_11SlotVisitorE(void*, void*)' in MarkingConstraintExports.hpp and MarkingConstraint.cpp.
    • Verified stub removal from core/libs/prx/libSceNKWebKit/Export.cpp and InventoryExports.hpp, and correct header inclusion in libSceNKWebKit.hpp.
    • Verified technical debt fragment format in docs/dev/debt/changes/feat-nkwebkit-marking-constraint-work-estimate.md adhering to technical debt conventions.
    • Verified unit test core/libs/prx/libSceNKWebKit/tests/MarkingConstraint.cpp validates double return value (0.0), signbit check, immutability of arguments, and null pointer safety without dereferencing guest pointers.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5979589370 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23746#pullrequestreview-5979589370). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-19T16:59:34Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `f7984e2299`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_markingconstraint_tests` built cleanly. - **CTest** (`nkwebkit_markingconstraint`): ``` 1/1 Test #4680: nkwebkit_markingconstraint ....... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp`, `core/libs/prx/libSceNKWebKit/src/MarkingConstraint.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified mangled symbol '_ZN3JSC17MarkingConstraint17quickWorkEstimateERNS_11SlotVisitorE' corresponds to JSC::MarkingConstraint::quickWorkEstimate(SlotVisitor&) and accurately returns double 0.0 in xmm0 per WebKit upstream base-class implementation. - Verified ABI calling convention signature 'double APS5_VABI _ZN3JSC17MarkingConstraint17quickWorkEstimateERNS_11SlotVisitorE(void*, void*)' in MarkingConstraintExports.hpp and MarkingConstraint.cpp. - Verified stub removal from core/libs/prx/libSceNKWebKit/Export.cpp and InventoryExports.hpp, and correct header inclusion in libSceNKWebKit.hpp. - Verified technical debt fragment format in docs/dev/debt/changes/feat-nkwebkit-marking-constraint-work-estimate.md adhering to technical debt conventions. - Verified unit test core/libs/prx/libSceNKWebKit/tests/MarkingConstraint.cpp validates double return value (0.0), signbit check, immutability of arguments, and null pointer safety without dereferencing guest pointers. Looks Good To Me
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!23746
No description provided.