feat(libSceNKWebKit): implement HistoricalVelocityData::velocityForNewData and the VelocityData dump #19302

Merged
MatteoSid merged 8 commits from upstream-pr/19302 into main 2026-11-14 17:19:29 +00:00
MatteoSid commented 2026-11-13 02:43:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MatteoSid on 2026-11-13T02:43:48Z.


What

Implements two VelocityData exports, following pinned WebKit VelocityData.cpp at c55364d53f97, the revision the libSceNKWebKit debt entries pin:

  • WebCore::HistoricalVelocityData::velocityForNewData(FloatPoint, double, MonotonicTime) (_ZN7WebCore22HistoricalVelocityData18velocityForNewDataENS_10FloatPointEdN3WTF13MonotonicTimeE, NID TJbM4gtL7mU), lines 33-70;
  • WebCore::operator<<(WTF::TextStream&, const VelocityData&) (_ZN7WebCorelsERN3WTF10TextStreamERKNS_12VelocityDataE, NID BTXZgU0oot8), lines 72-83.

VelocityData.h declares both with WEBCORE_EXPORT, with the parameter types the export names demangle to. The file is the same in the PS5 11.x tree the other libSceNKWebKit entries pin, and the header differs only by one #include <wtf/Optional.h>.

velocityForNewData keeps a ring of three {timestamp, position, scale} samples. When there is history and the new timestamp is more than 1/60 s after the oldest sample, it returns (position delta / time delta, scale delta / time delta, timestamp); otherwise it returns a zero VelocityData. A sample more than 1/60 s after the last append is appended (the index advances first, so the first sample lands in slot 1), and an earlier one overwrites the latest slot. The dump writes the timestamp, then each non-zero rate, as dumpProperty groups.

Layouts in WebCoreTypes.hpp, checked with static_assert: VelocityData is 24 bytes (three floats, MonotonicTime at 16) and is returned through the hidden result pointer; HistoricalVelocityData is 88 bytes (m_historySize, m_latestDataIndex, m_lastAppendTimestamp at 8, three 24-byte samples from 16). The code is in the new src/WebCoreVelocityData.cpp, which carries the upstream notice verbatim. It uses the existing TextStream exports startGroup, endGroup and operator<< for const char*, float and double. Upstream's inline dumpProperty builds a temporary WTF::String for each name. The dump writes the name as a C string instead, which appends the same characters. Both stubs leave Export.cpp and InventoryExports.hpp, and the declarations go into WebCoreExports.hpp and WebCoreDumpExports.hpp.

Reachability: HistoricalVelocityData() is = default with inline member initializers, VelocityData has an inline constructor, and TextStream has an inline constructor. A title builds all three inline and passes plain values (a point, a scale and a time), so both functions run on objects no unimplemented export has to create.

New debt entry: not compared with a console module; the layouts come from the pinned header; the property names are written as C strings.

Tested

After merging main: head b77e99252a is a real merge (no rebase) of main cda5c28fa0, which includes #19993. Since #19603, the inventory line in docs/dev/debt/libSceNKWebKit.md has no count. Against main, the debt file differs only by this PR's VelocityData entry and the two inventory rows it removes (TJbM4gtL7mU, BTXZgU0oot8); there are no duplicate lines, and #19993's entry is kept. Linux (Ubuntu 24.04 container, GCC 13.3), Release, -DBUILD_TESTING=ON: all 81 libSceNKWebKit test targets and the patched libSceNKWebKit.prx build with ninja -k 0 and no errors. nkwebkit_webcorevelocitydata passes, and ctest -R 'nkwebkit|^public_headers$' passes 82 of 82 (the 81 libSceNKWebKit tests and public_headers). nm -D on the patched .prx still lists TJbM4gtL7mU and BTXZgU0oot8. tools/check_conventions.py --base origin/main --head HEAD and git diff --check pass. The earlier merges of main (heads 159a789996 and 7943f67670) passed the same checks. The approval, the mutation check, the overlap check and the Windows run below were on 77928b987d.

Before the merge, on 77928b987d: Linux (Ubuntu 24.04 container, GCC 13.3), Release, -DBUILD_TESTING=ON, on head 77928b987d based on main 7a6183485f. I built all 75 libSceNKWebKit test targets and the patched libSceNKWebKit.prx with ninja -k 0, with no errors. ctest -R '^(guest_)?nkwebkit_|public_headers' passes 140 of 140: the 75 libSceNKWebKit tests and the 65 public_headers tests.

Windows: JJenkx ran nkwebkit_webcorevelocitydata on head 77928b987d merged onto main (Windows 11, WinLibs GCC 15.2 UCRT, Release); it passes in 3 of 3 runs (comment).

The new nkwebkit_webcorevelocitydata test checks exact values. Expected rates were worked out by hand, or rounded to float in Python where the division is not exact.

  • A seven-sample sequence fills the ring and wraps it, covering both branches of the oldest-sample index, including the full ring with the latest slot at 2. After each call it checks the returned velocity and time, m_historySize, m_latestDataIndex, m_lastAppendTimestamp and the stored samples.
  • Inside the filtering window, the latest sample is overwritten and the last-append time stays unchanged.
  • A first sample at exactly 1/60 s is not appended.
  • A time delta of exactly 1/60 s (hex-float timestamps whose difference is exactly 1.0 / 60) gives no velocity and no append. This checks that both comparisons are strict.
  • The dump is checked in multi-line mode, single-line mode, with an indent, and with NumberRespectingIntegers. It checks which rates are omitted when zero, and that the stream and its indent come back unchanged.

Mutation check, one change at a time: 19 of 20 make the test fail. The killed ones change the ring modulo, the size cap, the last-append update, the history test, the oldest-index branch and wrap formula, both strict comparisons, the overwrite inside the window, the horizontal, scale and time components, the 1/60 threshold, each of the three dump conditions, the scale value written, the property name, the separator and the group end. The survivor writes the float rates through the double writer. It is equivalent: the conversion is exact and both writers format with two fixed digits.

nm -D on the patched libSceNKWebKit.prx lists TJbM4gtL7mU and BTXZgU0oot8, and tools/nid_names.py's compute_nid gives those NIDs for the two names. tools/check_conventions.py --base origin/main --head HEAD passes. tools/pr_overlap.py --branch finds no overlap with the 91 open PRs it could merge. It could not compare 44 PRs that share files but conflict with main. I checked their diffs by hand: none adds or removes these two exports or edits the lines next to them. #16510 (filter operations) removes operator<<(TextStream&, const FilterOperation&) from InventoryExports.hpp two lines below the VelocityData declaration, with one unchanged line between, and shows that declaration only as context. Searches for VelocityData and HistoricalVelocityData find no other open PR. #15517 listed the VelocityData dump as not implemented for lack of source; the pinned revision has it. No title tested.

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
  • 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:5289018184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19302). Originally posted by [MatteoSid](https://github.com/MatteoSid) on 2026-11-13T02:43:48Z. --- ### What Implements two `VelocityData` exports, following pinned WebKit [`VelocityData.cpp`](https://github.com/WebKit/WebKit/blob/c55364d53f971f63a709976f168d932d558b8909/Source/WebCore/platform/graphics/VelocityData.cpp#L33-L83) at `c55364d53f97`, the revision the libSceNKWebKit debt entries pin: - `WebCore::HistoricalVelocityData::velocityForNewData(FloatPoint, double, MonotonicTime)` (`_ZN7WebCore22HistoricalVelocityData18velocityForNewDataENS_10FloatPointEdN3WTF13MonotonicTimeE`, NID `TJbM4gtL7mU`), [lines 33-70](https://github.com/WebKit/WebKit/blob/c55364d53f971f63a709976f168d932d558b8909/Source/WebCore/platform/graphics/VelocityData.cpp#L33-L70); - `WebCore::operator<<(WTF::TextStream&, const VelocityData&)` (`_ZN7WebCorelsERN3WTF10TextStreamERKNS_12VelocityDataE`, NID `BTXZgU0oot8`), [lines 72-83](https://github.com/WebKit/WebKit/blob/c55364d53f971f63a709976f168d932d558b8909/Source/WebCore/platform/graphics/VelocityData.cpp#L72-L83). [`VelocityData.h`](https://github.com/WebKit/WebKit/blob/c55364d53f971f63a709976f168d932d558b8909/Source/WebCore/platform/graphics/VelocityData.h#L38-L87) declares both with `WEBCORE_EXPORT`, with the parameter types the export names demangle to. The file is the same in the [PS5 11.x tree](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/graphics/VelocityData.cpp) the other libSceNKWebKit entries pin, and the header differs only by one `#include <wtf/Optional.h>`. `velocityForNewData` keeps a ring of three `{timestamp, position, scale}` samples. When there is history and the new timestamp is more than 1/60 s after the oldest sample, it returns `(position delta / time delta, scale delta / time delta, timestamp)`; otherwise it returns a zero `VelocityData`. A sample more than 1/60 s after the last append is appended (the index advances first, so the first sample lands in slot 1), and an earlier one overwrites the latest slot. The dump writes the timestamp, then each non-zero rate, as `dumpProperty` groups. Layouts in `WebCoreTypes.hpp`, checked with `static_assert`: `VelocityData` is 24 bytes (three floats, `MonotonicTime` at 16) and is returned through the hidden result pointer; `HistoricalVelocityData` is 88 bytes (`m_historySize`, `m_latestDataIndex`, `m_lastAppendTimestamp` at 8, three 24-byte samples from 16). The code is in the new `src/WebCoreVelocityData.cpp`, which carries the upstream notice verbatim. It uses the existing `TextStream` exports `startGroup`, `endGroup` and `operator<<` for `const char*`, `float` and `double`. Upstream's inline [`dumpProperty`](https://github.com/WebKit/WebKit/blob/c55364d53f971f63a709976f168d932d558b8909/Source/WTF/wtf/text/TextStream.h#L88-L95) builds a temporary `WTF::String` for each name. The dump writes the name as a C string instead, which appends the same characters. Both stubs leave `Export.cpp` and `InventoryExports.hpp`, and the declarations go into `WebCoreExports.hpp` and `WebCoreDumpExports.hpp`. Reachability: `HistoricalVelocityData()` is `= default` with inline member initializers, `VelocityData` has an inline constructor, and `TextStream` has an inline constructor. A title builds all three inline and passes plain values (a point, a scale and a time), so both functions run on objects no unimplemented export has to create. New debt entry: not compared with a console module; the layouts come from the pinned header; the property names are written as C strings. ### Tested After merging `main`: head `b77e99252a` is a real merge (no rebase) of `main` `cda5c28fa0`, which includes #19993. Since #19603, the inventory line in `docs/dev/debt/libSceNKWebKit.md` has no count. Against `main`, the debt file differs only by this PR's VelocityData entry and the two inventory rows it removes (`TJbM4gtL7mU`, `BTXZgU0oot8`); there are no duplicate lines, and #19993's entry is kept. Linux (Ubuntu 24.04 container, GCC 13.3), Release, `-DBUILD_TESTING=ON`: all 81 libSceNKWebKit test targets and the patched `libSceNKWebKit.prx` build with `ninja -k 0` and no errors. `nkwebkit_webcorevelocitydata` passes, and `ctest -R 'nkwebkit|^public_headers$'` passes 82 of 82 (the 81 libSceNKWebKit tests and `public_headers`). `nm -D` on the patched `.prx` still lists `TJbM4gtL7mU` and `BTXZgU0oot8`. `tools/check_conventions.py --base origin/main --head HEAD` and `git diff --check` pass. The earlier merges of `main` (heads `159a789996` and `7943f67670`) passed the same checks. The approval, the mutation check, the overlap check and the Windows run below were on `77928b987d`. Before the merge, on `77928b987d`: Linux (Ubuntu 24.04 container, GCC 13.3), Release, `-DBUILD_TESTING=ON`, on head `77928b987d` based on `main` `7a6183485f`. I built all 75 libSceNKWebKit test targets and the patched `libSceNKWebKit.prx` with `ninja -k 0`, with no errors. `ctest -R '^(guest_)?nkwebkit_|public_headers'` passes 140 of 140: the 75 libSceNKWebKit tests and the 65 `public_headers` tests. Windows: JJenkx ran `nkwebkit_webcorevelocitydata` on head `77928b987d` merged onto `main` (Windows 11, WinLibs GCC 15.2 UCRT, Release); it passes in 3 of 3 runs ([comment](https://github.com/boykopovar/AnyPS5/pull/19302#issuecomment-6842926313)). The new `nkwebkit_webcorevelocitydata` test checks exact values. Expected rates were worked out by hand, or rounded to `float` in Python where the division is not exact. - A seven-sample sequence fills the ring and wraps it, covering both branches of the oldest-sample index, including the full ring with the latest slot at 2. After each call it checks the returned velocity and time, `m_historySize`, `m_latestDataIndex`, `m_lastAppendTimestamp` and the stored samples. - Inside the filtering window, the latest sample is overwritten and the last-append time stays unchanged. - A first sample at exactly 1/60 s is not appended. - A time delta of exactly 1/60 s (hex-float timestamps whose difference is exactly `1.0 / 60`) gives no velocity and no append. This checks that both comparisons are strict. - The dump is checked in multi-line mode, single-line mode, with an indent, and with `NumberRespectingIntegers`. It checks which rates are omitted when zero, and that the stream and its indent come back unchanged. Mutation check, one change at a time: 19 of 20 make the test fail. The killed ones change the ring modulo, the size cap, the last-append update, the history test, the oldest-index branch and wrap formula, both strict comparisons, the overwrite inside the window, the horizontal, scale and time components, the 1/60 threshold, each of the three dump conditions, the scale value written, the property name, the separator and the group end. The survivor writes the `float` rates through the `double` writer. It is equivalent: the conversion is exact and both writers format with two fixed digits. `nm -D` on the patched `libSceNKWebKit.prx` lists `TJbM4gtL7mU` and `BTXZgU0oot8`, and `tools/nid_names.py`'s `compute_nid` gives those NIDs for the two names. `tools/check_conventions.py --base origin/main --head HEAD` passes. `tools/pr_overlap.py --branch` finds no overlap with the 91 open PRs it could merge. It could not compare 44 PRs that share files but conflict with `main`. I checked their diffs by hand: none adds or removes these two exports or edits the lines next to them. #16510 (filter operations) removes `operator<<(TextStream&, const FilterOperation&)` from `InventoryExports.hpp` two lines below the `VelocityData` declaration, with one unchanged line between, and shows that declaration only as context. Searches for `VelocityData` and `HistoricalVelocityData` find no other open PR. #15517 listed the `VelocityData` dump as not implemented for lack of source; the pinned revision has it. No title tested. ### 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) - [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
MarcZX10 commented 2026-11-13 03:03:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-13T03:03:37Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional. The ring-buffer arithmetic, the struct layouts and the TextStream calls match the code I read, and every symbol the new file calls is declared.

What I ran

  • Head: 77928b987db0f8b38fdad343fbde4f4a9dc9cbed, base main. The merged-preview check was not run.
  • Environment: none. I did not build or run tests.
  • Commands (reader searches and one read at head):
python3 repo_read.py search "startGroup"
python3 repo_read.py search "TextStreamlsEf"
python3 repo_read.py search "TextStreamlsEd"
python3 repo_read.py search "TextStreamlsEPKc"
python3 repo_read.py search "endGroupEv"
python3 repo_read.py search "MonotonicTime" core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp
python3 repo_read.py search "#include" core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp
python3 repo_read.py search "GLOB"
python3 repo_read.py search "Derived from Source/"
python3 repo_read.py cat docs/dev/debt/libSceNKWebKit.md 3290 3310

Results

Check Result Note
Changed files read passed 8 of 8, through the diff
Full text at head not run Two large files and the debt doc were read as hunks only
Symbols the new file calls passed Declared in WtfExports.hpp
Source and test pickup passed CMake globs src/*.cpp and tests/*.cpp
Ring-buffer sequence in the test passed Worked through by hand against the code, not run
Build and ctest not run Author-reported: 140 of 140
Convention and overlap tools not run Author-reported

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceNKWebKit/src/WebCoreVelocityData.cpp:64: the append lambda's parameters newPosition, scale and timestamp shadow the function's parameters of the same names. This is legal C++. Renaming them, for example pos, s and t, would make the copy from upstream easier to compare.

Not verified

  • The build, the 75 libSceNKWebKit test targets and ctest (140 of 140), and the 19 of 20 mutation check: author-reported, not run here.
  • The upstream WebKit permalinks: not fetched.
  • The NID values: not recomputed.
  • tools/check_conventions.py and tools/pr_overlap.py: author-reported, not run.
  • Inventory and progress-report counts after the two stubs are removed from Export.cpp and InventoryExports.hpp: not checked.
  • Full text of Export.cpp, InventoryExports.hpp and docs/dev/debt/libSceNKWebKit.md: too large for the review folder. I read only their hunks in the diff.
  • Console behaviour: out of scope.

To get this to a good state

Nothing is required.

Optional: the parameter rename in the non-blocking point above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5885401741 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19302#pullrequestreview-5885401741). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-13T03:03:37Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. The ring-buffer arithmetic, the struct layouts and the `TextStream` calls match the code I read, and every symbol the new file calls is declared. ## What I ran - Head: `77928b987db0f8b38fdad343fbde4f4a9dc9cbed`, base `main`. The merged-preview check was not run. - Environment: none. I did not build or run tests. - Commands (reader searches and one read at head): ``` python3 repo_read.py search "startGroup" python3 repo_read.py search "TextStreamlsEf" python3 repo_read.py search "TextStreamlsEd" python3 repo_read.py search "TextStreamlsEPKc" python3 repo_read.py search "endGroupEv" python3 repo_read.py search "MonotonicTime" core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp python3 repo_read.py search "#include" core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp python3 repo_read.py search "GLOB" python3 repo_read.py search "Derived from Source/" python3 repo_read.py cat docs/dev/debt/libSceNKWebKit.md 3290 3310 ``` ## Results | Check | Result | Note | |---|---|---| | Changed files read | passed | 8 of 8, through the diff | | Full text at head | not run | Two large files and the debt doc were read as hunks only | | Symbols the new file calls | passed | Declared in `WtfExports.hpp` | | Source and test pickup | passed | CMake globs `src/*.cpp` and `tests/*.cpp` | | Ring-buffer sequence in the test | passed | Worked through by hand against the code, not run | | Build and `ctest` | not run | Author-reported: 140 of 140 | | Convention and overlap tools | not run | Author-reported | ## Findings **Blocking** None. **Non-blocking** - `core/libs/prx/libSceNKWebKit/src/WebCoreVelocityData.cpp:64`: the `append` lambda's parameters `newPosition`, `scale` and `timestamp` shadow the function's parameters of the same names. This is legal C++. Renaming them, for example `pos`, `s` and `t`, would make the copy from upstream easier to compare. ## Not verified - The build, the 75 libSceNKWebKit test targets and `ctest` (140 of 140), and the 19 of 20 mutation check: author-reported, not run here. - The upstream WebKit permalinks: not fetched. - The NID values: not recomputed. - `tools/check_conventions.py` and `tools/pr_overlap.py`: author-reported, not run. - Inventory and progress-report counts after the two stubs are removed from `Export.cpp` and `InventoryExports.hpp`: not checked. - Full text of `Export.cpp`, `InventoryExports.hpp` and `docs/dev/debt/libSceNKWebKit.md`: too large for the review folder. I read only their hunks in the diff. - Console behaviour: out of scope. ## To get this to a good state Nothing is required. Optional: the parameter rename in the non-blocking point above.
PrivacyOnion commented 2026-11-13 12:43:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-13T12:43:46Z.

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_webcorevelocitydata_tests built cleanly.
  • CTest (nkwebkit_webcorevelocitydata):
    1/1 Test #3889: nkwebkit_webcorevelocitydata .....   Passed    0.03 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/include/WebCoreDumpExports.hpp, core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp, core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Ring buffer arithmetic and bounds safety in core/libs/prx/libSceNKWebKit/src/WebCoreVelocityData.cpp: Verified that m_latestDataIndex wrap-around via modulo maxHistoryDepth and both branches for calculating oldestDataIndex strictly constrain index resolution to [0, maxHistoryDepth - 1], preventing out-of-bounds accesses on m_positionHistory.
    • Threshold and floating-point safety in WebCore::HistoricalVelocityData::velocityForNewData: Confirmed that timeDelta must strictly exceed filteringThreshold (1.0 / 60 s) before division, preventing division by zero or NaN velocity components, and verified that sub-threshold samples overwrite the latest slot without updating m_lastAppendTimestamp.
    • Struct memory layouts and ABI compliance in core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified sizeof(VelocityData) == 24 and sizeof(HistoricalVelocityData) == 88 along with member offsets (scaleChangeRate at 8, lastUpdateTime at 16, m_lastAppendTimestamp at 8, m_positionHistory at 16) matching the pinned WebCore ABI and System V AMD64 hidden return pointer (sret) convention.
    • TextStream group serialization in core/libs/prx/libSceNKWebKit/src/WebCoreVelocityData.cpp: Confirmed proper dispatch to TextStream::startGroup(), operator<<(const char*), operator<<(float/double), and TextStream::endGroup(), ensuring unconditional output of timestamp and omission of zero-valued velocities as in upstream WebKit.
    • Export symbol replacement in core/libs/prx/libSceNKWebKit/Export.cpp and InventoryExports.hpp: Verified clean removal of NotImplemented_nid_no_patch stubs for NIDs TJbM4gtL7mU and BTXZgU0oot8 and accurate declaration with APS5_VABI in WebCoreExports.hpp and WebCoreDumpExports.hpp.
    • Test coverage in core/libs/prx/libSceNKWebKit/tests/WebCoreVelocityData.cpp: Verified comprehensive testing covering ring buffer wrapping across 7 samples, sub-threshold overwrite semantics, boundary-condition time deltas exactly equal to 1/60 s, and single-line/multi-line/indented TextStream formatting.
  • Note: the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5891210184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19302#pullrequestreview-5891210184). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-13T12:43:46Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `77928b987d`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_webcorevelocitydata_tests` built cleanly. - **CTest** (`nkwebkit_webcorevelocitydata`): ``` 1/1 Test #3889: nkwebkit_webcorevelocitydata ..... Passed 0.03 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/include/WebCoreDumpExports.hpp`, `core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp`, `core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Ring buffer arithmetic and bounds safety in core/libs/prx/libSceNKWebKit/src/WebCoreVelocityData.cpp: Verified that m_latestDataIndex wrap-around via modulo maxHistoryDepth and both branches for calculating oldestDataIndex strictly constrain index resolution to [0, maxHistoryDepth - 1], preventing out-of-bounds accesses on m_positionHistory. - Threshold and floating-point safety in WebCore::HistoricalVelocityData::velocityForNewData: Confirmed that timeDelta must strictly exceed filteringThreshold (1.0 / 60 s) before division, preventing division by zero or NaN velocity components, and verified that sub-threshold samples overwrite the latest slot without updating m_lastAppendTimestamp. - Struct memory layouts and ABI compliance in core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified sizeof(VelocityData) == 24 and sizeof(HistoricalVelocityData) == 88 along with member offsets (scaleChangeRate at 8, lastUpdateTime at 16, m_lastAppendTimestamp at 8, m_positionHistory at 16) matching the pinned WebCore ABI and System V AMD64 hidden return pointer (sret) convention. - TextStream group serialization in core/libs/prx/libSceNKWebKit/src/WebCoreVelocityData.cpp: Confirmed proper dispatch to TextStream::startGroup(), operator<<(const char*), operator<<(float/double), and TextStream::endGroup(), ensuring unconditional output of timestamp and omission of zero-valued velocities as in upstream WebKit. - Export symbol replacement in core/libs/prx/libSceNKWebKit/Export.cpp and InventoryExports.hpp: Verified clean removal of NotImplemented_nid_no_patch stubs for NIDs TJbM4gtL7mU and BTXZgU0oot8 and accurate declaration with APS5_VABI in WebCoreExports.hpp and WebCoreDumpExports.hpp. - Test coverage in core/libs/prx/libSceNKWebKit/tests/WebCoreVelocityData.cpp: Verified comprehensive testing covering ring buffer wrapping across 7 samples, sub-threshold overwrite semantics, boundary-condition time deltas exactly equal to 1/60 s, and single-line/multi-line/indented TextStream formatting. - Note: the AI-assisted checkbox can stay. 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!19302
No description provided.