feat(libSceNKWebKit): implement 3D TransformationMatrix inverse, scale, rotation and blending #18377

Closed
SHOnnay wants to merge 14 commits from upstream-pr/18377 into main
SHOnnay commented 2026-11-11 12:55:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SHOnnay on 2026-11-11T12:55:12Z.


What

Implements the six WebCore::TransformationMatrix exports that still threw. With them, CSS 3D transforms can be inverted and animated:

  • inverse() const
  • scale3d(double, double, double)
  • rotate3d(double x, double y, double z, double angle)
  • blend, blend2 and blend4(const TransformationMatrix&, double)

Source revision. The newer pinned PS5-WebKit-11.x declares blend(const TransformationMatrix&, double, CompositeOperation), so its mangled name differs from the exported _ZN7WebCore20TransformationMatrix5blendERKS0_d. The port therefore follows WebKit c55364d53f97, already pinned elsewhere in this library's debt file. Its signatures match all six exported names.

inverse ABI. At that revision it returns WTF::Optional<TransformationMatrix>. That Optional stores bool init_ before its storage (Optional.h), the reverse of std::optional. On x86-64, Matrix4 is 16-byte aligned (TRANSFORMATION_MATRIX_USE_X86_64_SSE2, already reflected by alignas(16) here). The new OptionalTransformationMatrix is therefore {bool; pad; matrix at 16}, 144 bytes, returned through the hidden pointer. Static asserts pin the size and offset.

Port. The bodies are ported line for line:

  • scale3d
  • the 4-argument rotate3d: major-axis fast paths, a zero axis leaves the matrix unchanged
  • inverse: identity and translation, affine, and adjoint/determinant paths, with the same SMALL_NUMBER threshold as the existing isInvertible
  • decompose2 and decompose4, including the identity shortcut that leaves quaternionW at 0 in both pinned revisions
  • slerp, recompose2, recompose4
  • blend's affine/3D dispatch, and the fallback when a matrix can't be decomposed: from if progress < 0.5, otherwise unchanged

Matrix products reuse the existing scalar multiply, not WebKit's x86-64 SSE2 path. That gap and the unverified Optional layout are recorded in docs/dev/debt/libSceNKWebKit.md. The six stubs and their LegacyExports.hpp placeholders are removed.

Tested

macOS 27 on Apple M1. The nkwebkit_* tests are full-build tests, and the full build does not run on macOS, so the registered test was not run. It needs a Linux or Windows run.

Harness. A temporary host harness, not committed, compiled the unchanged src/WebCoreTransform.cpp with these copied verbatim from tests/WebCoreGeometry.cpp: the new TestTransformationMatrixScale3dAndAxisRotation, TestTransformationMatrixInverse and TestTransformationMatrixBlend, plus the existing TestTransformationMatrix. It passed on x86-64 under Rosetta (Apple clang, -O2) and on arm64. The expectations are hand-derived, not taken from the port:

  • Inverse. Exact affine inverse [0.5, 0.25, -1.5, -0.5] and exact negated translation. M·M⁻¹ and M⁻¹·M equal identity within 1e-12 for a rotated, scaled, perspective matrix. Singular affine and singular 4x4 matrices are disengaged.
  • rotate3d. 120° about (1,1,1) permutes the axes. Non-unit major axes equal the Euler rotate3d. A zero axis is a byte-identical no-op.
  • blend.
    • 2D: rotation midpoints, 170° to −170° going through 180°, translation and scale midpoints.
    • 3D: Y-axis slerp from 10° to 90° at 0, 0.5 and 1, z translation and scale, and perspective m34 midpoint.
    • A matrix with m44 = 0 takes from below 0.5 and stays unchanged above it.
  • Mutation check. Four hand mutations of the source each fail the harness: the long-way-around rule, the affine inverse translation, the slerp scale, and the arbitrary-axis rotation sign.

Syntax. clang++ -arch x86_64 -fsyntax-only passes on tests/WebCoreGeometry.cpp and Export.cpp.

$ python3 tools/check_conventions.py --base upstream/main
All conventions checks passed.
$ python3 core/libs/tests/test_public_headers.py --audit-only
407 libraries, 34229 exports: unique declarations and umbrella coverage verified
$ python3 tools/pr_overlap.py --branch feat/nkwebkit-transform-3d
overlap check failed closed; manually compare every reported PR branch before opening this one

pr_overlap.py found no overlap among the 112 pull requests it could merge. It could not compare 59 that conflict with main. None of their diffs mentions any of the six exports or OptionalTransformationMatrix. #14138 also edits WebCoreTransform.cpp (other functions), so a textual conflict is possible. #17643 implements applyPerspective, a different export.

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 (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5259843355 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18377). Originally posted by [SHOnnay](https://github.com/SHOnnay) on 2026-11-11T12:55:12Z. --- ### What Implements the six `WebCore::TransformationMatrix` exports that still threw. With them, CSS 3D transforms can be inverted and animated: - `inverse() const` - `scale3d(double, double, double)` - `rotate3d(double x, double y, double z, double angle)` - `blend`, `blend2` and `blend4(const TransformationMatrix&, double)` **Source revision.** The newer pinned [PS5-WebKit-11.x](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h#L348-L350) declares `blend(const TransformationMatrix&, double, CompositeOperation)`, so its mangled name differs from the exported `_ZN7WebCore20TransformationMatrix5blendERKS0_d`. The port therefore follows WebKit [`c55364d53f97`](https://github.com/WebKit/WebKit/blob/c55364d53f97/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h#L253-L326), already pinned elsewhere in this library's debt file. Its signatures match all six exported names. **`inverse` ABI.** At that revision it returns `WTF::Optional<TransformationMatrix>`. That `Optional` stores `bool init_` before its storage ([Optional.h](https://github.com/WebKit/WebKit/blob/c55364d53f97/Source/WTF/wtf/Optional.h#L311-L316)), the reverse of `std::optional`. On x86-64, `Matrix4` is 16-byte aligned (`TRANSFORMATION_MATRIX_USE_X86_64_SSE2`, already reflected by `alignas(16)` here). The new `OptionalTransformationMatrix` is therefore `{bool; pad; matrix at 16}`, 144 bytes, returned through the hidden pointer. Static asserts pin the size and offset. **Port.** The bodies are ported line for line: - `scale3d` - the 4-argument `rotate3d`: major-axis fast paths, a zero axis leaves the matrix unchanged - `inverse`: identity and translation, affine, and adjoint/determinant paths, with the same `SMALL_NUMBER` threshold as the existing `isInvertible` - `decompose2` and `decompose4`, including the identity shortcut that leaves `quaternionW` at 0 in both pinned revisions - `slerp`, `recompose2`, `recompose4` - `blend`'s affine/3D dispatch, and the fallback when a matrix can't be decomposed: `from` if `progress < 0.5`, otherwise unchanged Matrix products reuse the existing scalar `multiply`, not WebKit's x86-64 SSE2 path. That gap and the unverified `Optional` layout are recorded in `docs/dev/debt/libSceNKWebKit.md`. The six stubs and their `LegacyExports.hpp` placeholders are removed. ### Tested macOS 27 on Apple M1. The `nkwebkit_*` tests are full-build tests, and the full build does not run on macOS, so the registered test was **not run**. It needs a Linux or Windows run. **Harness.** A temporary host harness, not committed, compiled the unchanged `src/WebCoreTransform.cpp` with these copied verbatim from `tests/WebCoreGeometry.cpp`: the new `TestTransformationMatrixScale3dAndAxisRotation`, `TestTransformationMatrixInverse` and `TestTransformationMatrixBlend`, plus the existing `TestTransformationMatrix`. It passed on x86-64 under Rosetta (Apple clang, `-O2`) and on arm64. The expectations are hand-derived, not taken from the port: - **Inverse.** Exact affine inverse `[0.5, 0.25, -1.5, -0.5]` and exact negated translation. `M·M⁻¹` and `M⁻¹·M` equal identity within 1e-12 for a rotated, scaled, perspective matrix. Singular affine and singular 4x4 matrices are disengaged. - **`rotate3d`.** 120° about (1,1,1) permutes the axes. Non-unit major axes equal the Euler `rotate3d`. A zero axis is a byte-identical no-op. - **`blend`.** - 2D: rotation midpoints, 170° to −170° going through 180°, translation and scale midpoints. - 3D: Y-axis slerp from 10° to 90° at 0, 0.5 and 1, z translation and scale, and perspective `m34` midpoint. - A matrix with `m44 = 0` takes `from` below 0.5 and stays unchanged above it. - **Mutation check.** Four hand mutations of the source each fail the harness: the long-way-around rule, the affine inverse translation, the slerp scale, and the arbitrary-axis rotation sign. **Syntax.** `clang++ -arch x86_64 -fsyntax-only` passes on `tests/WebCoreGeometry.cpp` and `Export.cpp`. ```text $ python3 tools/check_conventions.py --base upstream/main All conventions checks passed. $ python3 core/libs/tests/test_public_headers.py --audit-only 407 libraries, 34229 exports: unique declarations and umbrella coverage verified $ python3 tools/pr_overlap.py --branch feat/nkwebkit-transform-3d overlap check failed closed; manually compare every reported PR branch before opening this one ``` `pr_overlap.py` found no overlap among the 112 pull requests it could merge. It could not compare 59 that conflict with `main`. None of their diffs mentions any of the six exports or `OptionalTransformationMatrix`. #14138 also edits `WebCoreTransform.cpp` (other functions), so a textual conflict is possible. #17643 implements `applyPerspective`, a different export. ### 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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
PrivacyOnion commented 2026-11-11 16:22:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-11T16:22:49Z.

Review: CHANGES_REQUESTED


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

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_webcoregeometry_tests built cleanly.
  • CTest (nkwebkit_webcoregeometry):
    1/1 Test #3702: nkwebkit_webcoregeometry .........   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/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp, core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp, 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:
    • Verified scale3d in core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: correctly calls scaleNonUniformEdd and scales row 2 entries by sz matching WebCore row-vector conventions.
    • Verified rotate3d (4-argument) in core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: validates zero-length axis no-op, normalizes non-unit axes, and sets up correct major-axis and general-axis rotation matrices.
    • Verified OptionalTransformationMatrix layout in core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: verified size (144 bytes) and offset (16 bytes) match WTF::Optional layout on x86_64.
    • Verified 2D decomposition and blending in Decompose2 and blend2: checked scale sign preservation, angle normalization across 180-degree boundary, and recomposition order.
    • Verified quaternion decomposition and SLERP interpolation in Decompose4 and Slerp in core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp.
    • Verified export signatures and removals across core/libs/prx/libSceNKWebKit/Export.cpp, include/LegacyExports.hpp, and include/WebCoreExports.hpp.
  • Concerns:
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:146: In Adjoint(), result[3][1] is computed as Determinant3x3(a1, a3, a4, b1, b3, b4, c1, c2, c4);. Cofactors in column 1 omit row 2 (a2, b2, c2, d2) and must consist strictly of rows 1, 3, and 4. Passing c2 instead of c3 incorporates row 2 instead of row 3 for column c, producing an invalid adjoint matrix and corrupting general 4x4 matrix inversion in InverseMatrix() and TransformationMatrix::inverse().
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:214: In Decompose4(), the return value of InverseMatrix(perspective, inversePerspective) is ignored. If InverseMatrix fails due to a singular or near-singular perspective matrix (|det| < kSmallNumber), it returns false leaving inversePerspective incomplete, but Decompose4() proceeds with undefined/corrupted perspective values instead of returning false.
    • .github/pull_request_template.md: AGENTS.md requires copying the PR template, keeping every line, ticking every box, and filling What, Tested, Depends on (#N or none), Fixes (Fixes #N or none), Unblocks (title ID and discussion, or none), GPUs tested (otherwise n/a), and AI-assisted (yes or no). The PR body deleted Depends on, Fixes, Unblocks, GPUs tested, and AI-assisted sections, and stripped the template checklist.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5861916299 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18377#pullrequestreview-5861916299). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-11T16:22:49Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `0dae6ed0a6`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_webcoregeometry_tests` built cleanly. - **CTest** (`nkwebkit_webcoregeometry`): ``` 1/1 Test #3702: nkwebkit_webcoregeometry ......... 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/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp`, `core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp`, `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**: - Verified scale3d in core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: correctly calls scaleNonUniformEdd and scales row 2 entries by sz matching WebCore row-vector conventions. - Verified rotate3d (4-argument) in core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: validates zero-length axis no-op, normalizes non-unit axes, and sets up correct major-axis and general-axis rotation matrices. - Verified OptionalTransformationMatrix layout in core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: verified size (144 bytes) and offset (16 bytes) match WTF::Optional<TransformationMatrix> layout on x86_64. - Verified 2D decomposition and blending in Decompose2 and blend2: checked scale sign preservation, angle normalization across 180-degree boundary, and recomposition order. - Verified quaternion decomposition and SLERP interpolation in Decompose4 and Slerp in core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp. - Verified export signatures and removals across core/libs/prx/libSceNKWebKit/Export.cpp, include/LegacyExports.hpp, and include/WebCoreExports.hpp. - **Concerns**: - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:146: In `Adjoint()`, `result[3][1]` is computed as `Determinant3x3(a1, a3, a4, b1, b3, b4, c1, c2, c4);`. Cofactors in column 1 omit row 2 (`a2, b2, c2, d2`) and must consist strictly of rows 1, 3, and 4. Passing `c2` instead of `c3` incorporates row 2 instead of row 3 for column `c`, producing an invalid adjoint matrix and corrupting general 4x4 matrix inversion in `InverseMatrix()` and `TransformationMatrix::inverse()`. - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:214: In `Decompose4()`, the return value of `InverseMatrix(perspective, inversePerspective)` is ignored. If `InverseMatrix` fails due to a singular or near-singular perspective matrix (`|det| < kSmallNumber`), it returns `false` leaving `inversePerspective` incomplete, but `Decompose4()` proceeds with undefined/corrupted perspective values instead of returning `false`. - .github/pull_request_template.md: AGENTS.md requires copying the PR template, keeping every line, ticking every box, and filling `What`, `Tested`, `Depends on` (#N or none), `Fixes` (Fixes #N or none), `Unblocks` (title ID and discussion, or none), `GPUs tested` (otherwise n/a), and `AI-assisted` (yes or no). The PR body deleted `Depends on`, `Fixes`, `Unblocks`, `GPUs tested`, and `AI-assisted` sections, and stripped the template checklist. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-11 18:41:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-11T18:41:34Z.

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_webcoregeometry_tests built cleanly.
  • CTest (nkwebkit_webcoregeometry):
    1/1 Test #3702: nkwebkit_webcoregeometry .........   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/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp, core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp, 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:
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZNK7WebCore20TransformationMatrix7inverseEv correctly handles identity/translation matrices, 2D affine inverses with WebCore::kSmallNumber determinant checks and cofactor inversion, and general 4x4 projective matrices via InverseMatrix, returning an unengaged OptionalTransformationMatrix on singular inputs.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix8rotate3dEdddd normalizes axes via std::hypot, safely leaves the matrix unchanged if axis length is zero, and matches WebKit Rodrigues rotation matrix formulas across all major axes and arbitrary 3D vectors.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix5blendERKS0_d, blend2, and blend4 accurately handle 2D/3D decomposition (Decompose2/Decompose4), quaternion slerp, and the fallback to from when progress < 0.5 or *self when progress >= 0.5 upon decomposition failure.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified OptionalTransformationMatrix struct layout and static assertions (sizeof == 144, offsetof(m_value) == 16) conforming to WebKit WTF::Optional ABI on x86_64.
    • core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp: Verified comprehensive test coverage in TestTransformationMatrixScale3dAndAxisRotation, TestTransformationMatrixInverse, and TestTransformationMatrixBlend covering cardinal/arbitrary/zero rotation axes, exact affine/projective inverses, singular rejections, and short-way/3D slerp/degenerate blending.
    • docs/dev/debt/libSceNKWebKit.md and AGENTS.md: Verified strict compliance with repository conventions, ensuring zero comments in code outside namespace ends, proper removal of unimplemented stubs from Export.cpp and LegacyExports.hpp, and accurate tracking of scalar multiply and Optional layout debt.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5863765042 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18377#pullrequestreview-5863765042). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-11T18:41:34Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `0dae6ed0a6`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_webcoregeometry_tests` built cleanly. - **CTest** (`nkwebkit_webcoregeometry`): ``` 1/1 Test #3702: nkwebkit_webcoregeometry ......... 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/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp`, `core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp`, `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**: - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZNK7WebCore20TransformationMatrix7inverseEv correctly handles identity/translation matrices, 2D affine inverses with WebCore::kSmallNumber determinant checks and cofactor inversion, and general 4x4 projective matrices via InverseMatrix, returning an unengaged OptionalTransformationMatrix on singular inputs. - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix8rotate3dEdddd normalizes axes via std::hypot, safely leaves the matrix unchanged if axis length is zero, and matches WebKit Rodrigues rotation matrix formulas across all major axes and arbitrary 3D vectors. - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix5blendERKS0_d, blend2, and blend4 accurately handle 2D/3D decomposition (Decompose2/Decompose4), quaternion slerp, and the fallback to from when progress < 0.5 or *self when progress >= 0.5 upon decomposition failure. - core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified OptionalTransformationMatrix struct layout and static assertions (sizeof == 144, offsetof(m_value) == 16) conforming to WebKit WTF::Optional<TransformationMatrix> ABI on x86_64. - core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp: Verified comprehensive test coverage in TestTransformationMatrixScale3dAndAxisRotation, TestTransformationMatrixInverse, and TestTransformationMatrixBlend covering cardinal/arbitrary/zero rotation axes, exact affine/projective inverses, singular rejections, and short-way/3D slerp/degenerate blending. - docs/dev/debt/libSceNKWebKit.md and AGENTS.md: Verified strict compliance with repository conventions, ensuring zero comments in code outside namespace ends, proper removal of unimplemented stubs from Export.cpp and LegacyExports.hpp, and accurate tracking of scalar multiply and Optional layout debt. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Looks Good To Me
PrivacyOnion commented 2026-11-12 06:13:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T06:13:02Z.

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_webcoregeometry_tests built cleanly.
  • CTest (nkwebkit_webcoregeometry):
    1/1 Test #3754: nkwebkit_webcoregeometry .........   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/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp, core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp, 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:
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZNK7WebCore20TransformationMatrix7inverseEv handles identity/translation, 2D affine, and general 4x4 matrices with singularity guards (std::abs(det) < kSmallNumber), correctly populating OptionalTransformationMatrix layout (m_engaged at byte 0, 16-byte alignment, 144-byte total size).
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix7scale3dEddd properly multiplies row 2 elements (m_matrix[2][0..3]) by sz after non-uniform 2D scaling, matching WebKit row-vector conventions without corrupting translation.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix8rotate3dEdddd normalizes non-zero axes, preserves the matrix when axis length is zero, correctly branches on major axes fast-paths (X, Y, Z), and computes the Rodrigues rotation matrix for arbitrary axes.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix5blendERKS0_d, blend2, and blend4 decomposition/recomposition pathways, including shortest-path angular interpolation in blend2, quaternion Slerp in blend4, and fallback to from when progress < 0.5 upon decomposition failure.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified ABI compatibility and layout constraints of OptionalTransformationMatrix (sizeof == 144, offsetof(m_value) == 16) ensuring matching return slot layout for x86_64 System V / PS5 ABI.
    • core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp: Verified test suite coverage across TestTransformationMatrixScale3dAndAxisRotation, TestTransformationMatrixInverse, and TestTransformationMatrixBlend, validating singular matrix rejection, exact affine inversions, axis rotations, and non-affine fallback branches.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5869932424 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18377#pullrequestreview-5869932424). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-12T06:13:02Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `584bda01cb`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_webcoregeometry_tests` built cleanly. - **CTest** (`nkwebkit_webcoregeometry`): ``` 1/1 Test #3754: nkwebkit_webcoregeometry ......... 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/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp`, `core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp`, `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**: - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZNK7WebCore20TransformationMatrix7inverseEv handles identity/translation, 2D affine, and general 4x4 matrices with singularity guards (std::abs(det) < kSmallNumber), correctly populating OptionalTransformationMatrix layout (m_engaged at byte 0, 16-byte alignment, 144-byte total size). - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix7scale3dEddd properly multiplies row 2 elements (m_matrix[2][0..3]) by sz after non-uniform 2D scaling, matching WebKit row-vector conventions without corrupting translation. - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix8rotate3dEdddd normalizes non-zero axes, preserves the matrix when axis length is zero, correctly branches on major axes fast-paths (X, Y, Z), and computes the Rodrigues rotation matrix for arbitrary axes. - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix5blendERKS0_d, blend2, and blend4 decomposition/recomposition pathways, including shortest-path angular interpolation in blend2, quaternion Slerp in blend4, and fallback to from when progress < 0.5 upon decomposition failure. - core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified ABI compatibility and layout constraints of OptionalTransformationMatrix (sizeof == 144, offsetof(m_value) == 16) ensuring matching return slot layout for x86_64 System V / PS5 ABI. - core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp: Verified test suite coverage across TestTransformationMatrixScale3dAndAxisRotation, TestTransformationMatrixInverse, and TestTransformationMatrixBlend, validating singular matrix rejection, exact affine inversions, axis rotations, and non-affine fallback branches. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Looks Good To Me
PrivacyOnion commented 2026-11-12 08:28:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T08:28:37Z.

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_webcoregeometry_tests built cleanly.
  • CTest (nkwebkit_webcoregeometry):
    1/1 Test #3761: nkwebkit_webcoregeometry .........   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/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp, core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp, 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:
    • Verified all six exported symbols (_ZN7WebCore20TransformationMatrix5blendERKS0_d, blend2, blend4, scale3d, rotate3d, and _ZNK7WebCore20TransformationMatrix7inverseEv) match WebCore mangling and ABI calling conventions with hidden return pointers for 144-byte structs.
    • Audited OptionalTransformationMatrix layout in WebCoreTypes.hpp; static asserts verify 16-byte alignment, 16-byte value offset, and 144-byte total size matching WTF::Optional layout.
    • Verified Adjoint() and InverseMatrix() cofactor expansion in WebCoreTransform.cpp across all 16 matrix elements against singular threshold kSmallNumber.
    • Verified rotate3d unit axis optimizations (X, Y, Z cardinal axes) and general Rodrigues/Euler arbitrary axis rotation formulas and trigonometry.
    • Checked Decompose2 and Decompose4 decomposition, Slerp quaternion interpolation, and recomposition pipelines for 2D and 3D blending paths, including degenerate zero-determinant fallback handling.
    • Confirmed removal of former NotImplemented_nid_no_patch stubs from Export.cpp and LegacyExports.hpp without symbol duplication or missing definitions.
    • Validated docs/dev/debt/libSceNKWebKit.md technical debt documentation regarding scalar multiply vs SSE2 and Optional ABI verification.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5871364221 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18377#pullrequestreview-5871364221). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-12T08:28:37Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `65a5e33ac1`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_webcoregeometry_tests` built cleanly. - **CTest** (`nkwebkit_webcoregeometry`): ``` 1/1 Test #3761: nkwebkit_webcoregeometry ......... 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/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp`, `core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp`, `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**: - Verified all six exported symbols (_ZN7WebCore20TransformationMatrix5blendERKS0_d, blend2, blend4, scale3d, rotate3d, and _ZNK7WebCore20TransformationMatrix7inverseEv) match WebCore mangling and ABI calling conventions with hidden return pointers for 144-byte structs. - Audited OptionalTransformationMatrix layout in WebCoreTypes.hpp; static asserts verify 16-byte alignment, 16-byte value offset, and 144-byte total size matching WTF::Optional layout. - Verified Adjoint() and InverseMatrix() cofactor expansion in WebCoreTransform.cpp across all 16 matrix elements against singular threshold kSmallNumber. - Verified rotate3d unit axis optimizations (X, Y, Z cardinal axes) and general Rodrigues/Euler arbitrary axis rotation formulas and trigonometry. - Checked Decompose2 and Decompose4 decomposition, Slerp quaternion interpolation, and recomposition pipelines for 2D and 3D blending paths, including degenerate zero-determinant fallback handling. - Confirmed removal of former NotImplemented_nid_no_patch stubs from Export.cpp and LegacyExports.hpp without symbol duplication or missing definitions. - Validated docs/dev/debt/libSceNKWebKit.md technical debt documentation regarding scalar multiply vs SSE2 and Optional ABI verification. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Looks Good To Me
PrivacyOnion commented 2026-11-12 13:34:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T13:34:24Z.

Review: CHANGES_REQUESTED


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

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_webcoregeometry_tests built cleanly.
  • CTest (nkwebkit_webcoregeometry):
    1/1 Test #3798: nkwebkit_webcoregeometry .........   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/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp, core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp, 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:
    • Verified ABI compatibility, memory alignment, and struct layout of OptionalTransformationMatrix (core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp:129-132, 225-226) confirming sizeof 144 bytes, offsetof 16, and hidden-pointer return semantics for _ZNK7WebCore20TransformationMatrix7inverseEv.
    • Verified cofactor signs, submatrix minor indexing, and determinant singularity checks (kSmallNumber) in Adjoint, InverseMatrix, and _ZNK7WebCore20TransformationMatrix7inverseEv (core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:161-205, 1109-1153) across identity, 2D affine, and general projective cases.
    • Verified Rodrigues rotation matrix calculation, vector normalization, and coordinate axis fast paths in _ZN7WebCore20TransformationMatrix8rotate3dEdddd (core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:1039-1082), including zero-length axis no-op behavior.
    • Verified 2D/3D matrix decomposition, Slerp quaternion interpolation, and matrix reconstruction in _ZN7WebCore20TransformationMatrix6blend2ERKS0_d, _ZN7WebCore20TransformationMatrix6blend4ERKS0_d, and _ZN7WebCore20TransformationMatrix5blendERKS0_d (core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:798-927), including non-decomposable fallback dispatch.
    • Checked unit test coverage in core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp:518-652 to ensure TestTransformationMatrixScale3dAndAxisRotation, TestTransformationMatrixInverse, and TestTransformationMatrixBlend exercise identity, translation, projective, and degenerate matrices without leaving dirty global state.
    • Checked AGENTS.md compliance across all modified headers, sources, and debt documentation in core/libs/prx/libSceNKWebKit.
  • Concerns:
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:1: Lines 1-28 add multi-line block comments containing an Apple/Torch Mobile copyright header and WebKit revision provenance notice. AGENTS.md strictly forbids comments in code ('No comments in code, except #endif and namespace ends'). Third-party derivation and technical debt details belong in docs/dev/debt/libSceNKWebKit.md and the pull request, not in C++ source files.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5875328624 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18377#pullrequestreview-5875328624). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-12T13:34:24Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `35178bafb9`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_webcoregeometry_tests` built cleanly. - **CTest** (`nkwebkit_webcoregeometry`): ``` 1/1 Test #3798: nkwebkit_webcoregeometry ......... 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/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp`, `core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp`, `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**: - Verified ABI compatibility, memory alignment, and struct layout of OptionalTransformationMatrix (core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp:129-132, 225-226) confirming sizeof 144 bytes, offsetof 16, and hidden-pointer return semantics for _ZNK7WebCore20TransformationMatrix7inverseEv. - Verified cofactor signs, submatrix minor indexing, and determinant singularity checks (kSmallNumber) in Adjoint, InverseMatrix, and _ZNK7WebCore20TransformationMatrix7inverseEv (core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:161-205, 1109-1153) across identity, 2D affine, and general projective cases. - Verified Rodrigues rotation matrix calculation, vector normalization, and coordinate axis fast paths in _ZN7WebCore20TransformationMatrix8rotate3dEdddd (core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:1039-1082), including zero-length axis no-op behavior. - Verified 2D/3D matrix decomposition, Slerp quaternion interpolation, and matrix reconstruction in _ZN7WebCore20TransformationMatrix6blend2ERKS0_d, _ZN7WebCore20TransformationMatrix6blend4ERKS0_d, and _ZN7WebCore20TransformationMatrix5blendERKS0_d (core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:798-927), including non-decomposable fallback dispatch. - Checked unit test coverage in core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp:518-652 to ensure TestTransformationMatrixScale3dAndAxisRotation, TestTransformationMatrixInverse, and TestTransformationMatrixBlend exercise identity, translation, projective, and degenerate matrices without leaving dirty global state. - Checked AGENTS.md compliance across all modified headers, sources, and debt documentation in core/libs/prx/libSceNKWebKit. - **Concerns**: - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:1: Lines 1-28 add multi-line block comments containing an Apple/Torch Mobile copyright header and WebKit revision provenance notice. AGENTS.md strictly forbids comments in code ('No comments in code, except #endif and namespace ends'). Third-party derivation and technical debt details belong in docs/dev/debt/libSceNKWebKit.md and the pull request, not in C++ source files. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-15 05:08:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T05:08:23Z.

Review: CHANGES_REQUESTED


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

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_webcoregeometry_tests built cleanly.
  • CTest (nkwebkit_webcoregeometry):
    1/1 Test #4113: nkwebkit_webcoregeometry .........   Passed    0.06 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp, core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp, 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:
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified all 16 cofactor entries in Adjoint() and determinant threshold checking against kSmallNumber in InverseMatrix() and _ZNK7WebCore20TransformationMatrix7inverseEv, verifying exact identity, translation, affine, and projective inverse computations.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix8rotate3dEdddd vector normalization, zero-norm axis early exit preserving *self, major-axis fast paths, and Rodrigues' rotation matrix signs for row-vector multiplication conventions.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified 2D/3D decomposition, recomposition, and blending in Decompose2, Decompose4, Slerp, blend2, blend4, and blend, including angle wrapping across 180 degrees, quaternion interpolation, and non-decomposable fallback behavior for progress < 0.5.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified layout and alignment of OptionalTransformationMatrix (sizeof == 144, offsetof(m_value) == 16, alignas(16)), ensuring binary compatibility with WTF::Optional returned via hidden pointer in x86-64 System V ABI.
    • core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp and LegacyExports.hpp: Verified that all six implemented exports were properly declared with correct C++ parameter types and removed from LegacyExports and NotImplemented stubs in Export.cpp.
    • core/libs/prx/libwebrtc/include/WavReader.hpp and Api.hpp: Verified WebRtcWavReader struct layout, 64-byte size, and field offsets (sampleRate at 8, numChannels at 16, format at 24, numSamplesInFile at 32, numUnreadSamples at 40, file at 48, dataStartPos at 56) across LP64 and LLP64 platforms.
    • core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp: Verified unit test coverage in TestTransformationMatrixScale3dAndAxisRotation, TestTransformationMatrixInverse, and TestTransformationMatrixBlend for identity, translations, rotations, perspective matrices, singular matrices, and degenerate decomposition fallbacks.
    • core/libs/tests/GuestAudiodecCpuQueryGuest.cpp: verified that sceAudiodecCpuQueryMemSize and sceAudiodecCpuInternalQueryMemSize reject null control pointers with 0x80f70009 (ErrorCtrl), unreadable control pointers, null parameter pointers with 0x80f7000a (ErrorParam), null memory pointers with 0x80f7000e (ErrorMemory), invalid descriptor sizes with 0x80f70008 (ErrorMemorySize), and unsupported codec types with 0x80f70001 (ErrorType).
  • Concerns:
    • core/libs/prx/libwebrtc/src/WavReader.cpp:109: In _ZN6webrtc9WavReader11ReadSamplesEmPs_nid_postfix, passing reader = nullptr with numSamples > 0 triggers an immediate null-pointer dereference at line 109 when evaluating reader->numUnreadSamples > 0 in the while loop condition. The null check in Stream(reader, ...) at line 110 is unreachable because the dereference occurs prior to entering the loop body.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5909215507 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18377#pullrequestreview-5909215507). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T05:08:23Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `9dde1ef466`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_webcoregeometry_tests` built cleanly. - **CTest** (`nkwebkit_webcoregeometry`): ``` 1/1 Test #4113: nkwebkit_webcoregeometry ......... Passed 0.06 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp`, `core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp`, `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**: - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified all 16 cofactor entries in Adjoint() and determinant threshold checking against kSmallNumber in InverseMatrix() and _ZNK7WebCore20TransformationMatrix7inverseEv, verifying exact identity, translation, affine, and projective inverse computations. - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix8rotate3dEdddd vector normalization, zero-norm axis early exit preserving *self, major-axis fast paths, and Rodrigues' rotation matrix signs for row-vector multiplication conventions. - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified 2D/3D decomposition, recomposition, and blending in Decompose2, Decompose4, Slerp, blend2, blend4, and blend, including angle wrapping across 180 degrees, quaternion interpolation, and non-decomposable fallback behavior for progress < 0.5. - core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified layout and alignment of OptionalTransformationMatrix (sizeof == 144, offsetof(m_value) == 16, alignas(16)), ensuring binary compatibility with WTF::Optional<TransformationMatrix> returned via hidden pointer in x86-64 System V ABI. - core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp and LegacyExports.hpp: Verified that all six implemented exports were properly declared with correct C++ parameter types and removed from LegacyExports and NotImplemented stubs in Export.cpp. - core/libs/prx/libwebrtc/include/WavReader.hpp and Api.hpp: Verified WebRtcWavReader struct layout, 64-byte size, and field offsets (sampleRate at 8, numChannels at 16, format at 24, numSamplesInFile at 32, numUnreadSamples at 40, file at 48, dataStartPos at 56) across LP64 and LLP64 platforms. - core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp: Verified unit test coverage in TestTransformationMatrixScale3dAndAxisRotation, TestTransformationMatrixInverse, and TestTransformationMatrixBlend for identity, translations, rotations, perspective matrices, singular matrices, and degenerate decomposition fallbacks. - core/libs/tests/GuestAudiodecCpuQueryGuest.cpp: verified that sceAudiodecCpuQueryMemSize and sceAudiodecCpuInternalQueryMemSize reject null control pointers with 0x80f70009 (ErrorCtrl), unreadable control pointers, null parameter pointers with 0x80f7000a (ErrorParam), null memory pointers with 0x80f7000e (ErrorMemory), invalid descriptor sizes with 0x80f70008 (ErrorMemorySize), and unsupported codec types with 0x80f70001 (ErrorType). - **Concerns**: - core/libs/prx/libwebrtc/src/WavReader.cpp:109: In _ZN6webrtc9WavReader11ReadSamplesEmPs_nid_postfix, passing reader = nullptr with numSamples > 0 triggers an immediate null-pointer dereference at line 109 when evaluating reader->numUnreadSamples > 0 in the while loop condition. The null check in Stream(reader, ...) at line 110 is unreachable because the dereference occurs prior to entering the loop body. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-15 19:16:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T19:16:47Z.

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_webcoregeometry_tests built cleanly.
  • CTest (nkwebkit_webcoregeometry):
    1/1 Test #4113: nkwebkit_webcoregeometry .........   Passed    0.06 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp, core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp, 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:
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified all 16 cofactor entries in Adjoint() and determinant threshold checking against kSmallNumber in InverseMatrix() and _ZNK7WebCore20TransformationMatrix7inverseEv, verifying exact identity, translation, affine, and projective inverse computations.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix8rotate3dEdddd vector normalization, zero-norm axis early exit preserving *self, major-axis fast paths, and Rodrigues' rotation matrix signs for row-vector multiplication conventions.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified 2D/3D decomposition, recomposition, and blending in Decompose2, Decompose4, Slerp, blend2, blend4, and blend, including angle wrapping across 180 degrees, quaternion interpolation, and non-decomposable fallback behavior for progress < 0.5.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified layout and alignment of OptionalTransformationMatrix (sizeof == 144, offsetof(m_value) == 16, alignas(16)), ensuring binary compatibility with WTF::Optional returned via hidden pointer in x86-64 System V ABI.
    • core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp and LegacyExports.hpp: Verified that all six implemented exports were properly declared with correct C++ parameter types and removed from LegacyExports and NotImplemented stubs in Export.cpp.
    • core/libs/prx/libwebrtc/include/WavReader.hpp and Api.hpp: Verified WebRtcWavReader struct layout, 64-byte size, and field offsets (sampleRate at 8, numChannels at 16, format at 24, numSamplesInFile at 32, numUnreadSamples at 40, file at 48, dataStartPos at 56) across LP64 and LLP64 platforms.
    • core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp: Verified unit test coverage in TestTransformationMatrixScale3dAndAxisRotation, TestTransformationMatrixInverse, and TestTransformationMatrixBlend for identity, translations, rotations, perspective matrices, singular matrices, and degenerate decomposition fallbacks.
    • core/libs/tests/GuestAudiodecCpuQueryGuest.cpp: verified that sceAudiodecCpuQueryMemSize and sceAudiodecCpuInternalQueryMemSize reject null control pointers with 0x80f70009 (ErrorCtrl), unreadable control pointers, null parameter pointers with 0x80f7000a (ErrorParam), null memory pointers with 0x80f7000e (ErrorMemory), invalid descriptor sizes with 0x80f70008 (ErrorMemorySize), and unsupported codec types with 0x80f70001 (ErrorType).

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912390077 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18377#pullrequestreview-5912390077). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T19:16:47Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `9dde1ef466`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_webcoregeometry_tests` built cleanly. - **CTest** (`nkwebkit_webcoregeometry`): ``` 1/1 Test #4113: nkwebkit_webcoregeometry ......... Passed 0.06 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp`, `core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp`, `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**: - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified all 16 cofactor entries in Adjoint() and determinant threshold checking against kSmallNumber in InverseMatrix() and _ZNK7WebCore20TransformationMatrix7inverseEv, verifying exact identity, translation, affine, and projective inverse computations. - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix8rotate3dEdddd vector normalization, zero-norm axis early exit preserving *self, major-axis fast paths, and Rodrigues' rotation matrix signs for row-vector multiplication conventions. - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified 2D/3D decomposition, recomposition, and blending in Decompose2, Decompose4, Slerp, blend2, blend4, and blend, including angle wrapping across 180 degrees, quaternion interpolation, and non-decomposable fallback behavior for progress < 0.5. - core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified layout and alignment of OptionalTransformationMatrix (sizeof == 144, offsetof(m_value) == 16, alignas(16)), ensuring binary compatibility with WTF::Optional<TransformationMatrix> returned via hidden pointer in x86-64 System V ABI. - core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp and LegacyExports.hpp: Verified that all six implemented exports were properly declared with correct C++ parameter types and removed from LegacyExports and NotImplemented stubs in Export.cpp. - core/libs/prx/libwebrtc/include/WavReader.hpp and Api.hpp: Verified WebRtcWavReader struct layout, 64-byte size, and field offsets (sampleRate at 8, numChannels at 16, format at 24, numSamplesInFile at 32, numUnreadSamples at 40, file at 48, dataStartPos at 56) across LP64 and LLP64 platforms. - core/libs/prx/libSceNKWebKit/tests/WebCoreGeometry.cpp: Verified unit test coverage in TestTransformationMatrixScale3dAndAxisRotation, TestTransformationMatrixInverse, and TestTransformationMatrixBlend for identity, translations, rotations, perspective matrices, singular matrices, and degenerate decomposition fallbacks. - core/libs/tests/GuestAudiodecCpuQueryGuest.cpp: verified that sceAudiodecCpuQueryMemSize and sceAudiodecCpuInternalQueryMemSize reject null control pointers with 0x80f70009 (ErrorCtrl), unreadable control pointers, null parameter pointers with 0x80f7000a (ErrorParam), null memory pointers with 0x80f7000e (ErrorMemory), invalid descriptor sizes with 0x80f70008 (ErrorMemorySize), and unsupported codec types with 0x80f70001 (ErrorType). Looks Good To Me
PrivacyOnion commented 2026-11-19 06:44:33 +00:00 (Migrated from github.com)

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

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_webcoregeometry_tests built cleanly.
  • CTest (nkwebkit_webcoregeometry):
    1/1 Test #4645: nkwebkit_webcoregeometry .........   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/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp, core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp, 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:
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified Adjoint() cofactor matrix entries and determinant inversion threshold against kSmallNumber (1e-8) for general 4x4 matrix inversion in InverseMatrix and _ZNK7WebCore20TransformationMatrix7inverseEv.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix7scale3dEddd and _ZN7WebCore20TransformationMatrix8rotate3dEdddd normalization, zero-axis guard, and single-axis fast paths matching upstream WebKit behavior.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified 2D and 3D matrix decomposition, quaternion slerp, and blend/blend2/blend4 interpolation semantics against upstream WebKit c55364d53f97.
    • core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified memory layout, 16-byte alignment, and struct offsets for OptionalTransformationMatrix (sizeof 144, offsetof m_value 16).
    • docs/dev/debt/changes/feat-nkwebkit-transform-3d.md: Verified AGENTS.md compliance, including technical debt documentation fragment, conventional commits, and lack of illegal inline comments.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5970493784 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18377#pullrequestreview-5970493784). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-19T06:44:33Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `d59c54743a`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_webcoregeometry_tests` built cleanly. - **CTest** (`nkwebkit_webcoregeometry`): ``` 1/1 Test #4645: nkwebkit_webcoregeometry ......... 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/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp`, `core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp`, `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**: - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified Adjoint() cofactor matrix entries and determinant inversion threshold against kSmallNumber (1e-8) for general 4x4 matrix inversion in InverseMatrix and _ZNK7WebCore20TransformationMatrix7inverseEv. - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified _ZN7WebCore20TransformationMatrix7scale3dEddd and _ZN7WebCore20TransformationMatrix8rotate3dEdddd normalization, zero-axis guard, and single-axis fast paths matching upstream WebKit behavior. - core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp: Verified 2D and 3D matrix decomposition, quaternion slerp, and blend/blend2/blend4 interpolation semantics against upstream WebKit c55364d53f97. - core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hpp: Verified memory layout, 16-byte alignment, and struct offsets for OptionalTransformationMatrix (sizeof 144, offsetof m_value 16). - docs/dev/debt/changes/feat-nkwebkit-transform-3d.md: Verified AGENTS.md compliance, including technical debt documentation fragment, conventional commits, and lack of illegal inline comments. Looks Good To Me
MarcZX10 commented 2026-11-21 04:40:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T04:40:34Z.

Review: DISMISSED


Reviewed — changes requested

Changes are required before merge: guard 3D decomposition against zero scale axes and preserve the input when decomposition is singular.

What I ran

Reviewed head d59c54743a82b7e56ee2cb4dd0ba4b5dcd70a08e using the prepared diff and repo_read.py. No commands or tests were run by me.

Results

Check Result Note
Source review failed Zero-axis 3D decomposition can divide by zero
Registered tests not run Author reports the full build test was not run
Other reported checks not run Results in the PR description were not independently run

Findings

Blocking

  • Decompose4 divides by scaleY and scaleZ without checking for zero, then returns success. A singular 3D transform such as scale3d(1, 0, 1) therefore produces non-finite skew/quaternion data; blend4 proceeds to compose it into the target. Return failure for degenerate axes so blend4 follows its existing fallback. core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:372

Non-blocking

None.

Not verified

  • core/libs/prx/libSceNKWebKit/Export.cpp was excluded from the review bundle because it is too large; its removal hunk is visible in diff.patch, but its full text was not read.
  • The author reports temporary host harness and syntax checks, convention and public-header checks, and an overlap check. These reports were not independently verified. The registered test was reported as not run.
  • Console ABI behavior and OptionalTransformationMatrix layout remain unverified, as recorded in the PR description.

Files read: description.md, commits.md, manifest.json, diff.patch, README.md, WebCoreExports.hpp, WebCoreTransform.cpp, WebCoreTypes.hpp, and WebCoreGeometry.cpp. LegacyExports.hpp and the full Export.cpp were not read; files.json was not available in the review folder. The changed line ranges of WebCoreTransform.cpp and WebCoreGeometry.cpp were not all read.

To get this to a good state

Guard zero-length axes in Decompose4, add regression coverage for blending a singular matrix with a valid one, and run the registered test on a supported build environment.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6002877976 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18377#pullrequestreview-6002877976). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T04:40:34Z. **Review:** DISMISSED --- # Reviewed — changes requested Changes are required before merge: guard 3D decomposition against zero scale axes and preserve the input when decomposition is singular. ## What I ran Reviewed head `d59c54743a82b7e56ee2cb4dd0ba4b5dcd70a08e` using the prepared diff and `repo_read.py`. No commands or tests were run by me. ## Results | Check | Result | Note | |---|---|---| | Source review | failed | Zero-axis 3D decomposition can divide by zero | | Registered tests | not run | Author reports the full build test was not run | | Other reported checks | not run | Results in the PR description were not independently run | ## Findings ### Blocking - `Decompose4` divides by `scaleY` and `scaleZ` without checking for zero, then returns success. A singular 3D transform such as `scale3d(1, 0, 1)` therefore produces non-finite skew/quaternion data; `blend4` proceeds to compose it into the target. Return failure for degenerate axes so `blend4` follows its existing fallback. `core/libs/prx/libSceNKWebKit/src/WebCoreTransform.cpp:372` ### Non-blocking None. ## Not verified - `core/libs/prx/libSceNKWebKit/Export.cpp` was excluded from the review bundle because it is too large; its removal hunk is visible in `diff.patch`, but its full text was not read. - The author reports temporary host harness and syntax checks, convention and public-header checks, and an overlap check. These reports were not independently verified. The registered test was reported as not run. - Console ABI behavior and `OptionalTransformationMatrix` layout remain unverified, as recorded in the PR description. Files read: `description.md`, `commits.md`, `manifest.json`, `diff.patch`, `README.md`, `WebCoreExports.hpp`, `WebCoreTransform.cpp`, `WebCoreTypes.hpp`, and `WebCoreGeometry.cpp`. `LegacyExports.hpp` and the full `Export.cpp` were not read; `files.json` was not available in the review folder. The changed line ranges of `WebCoreTransform.cpp` and `WebCoreGeometry.cpp` were not all read. ## To get this to a good state Guard zero-length axes in `Decompose4`, add regression coverage for blending a singular matrix with a valid one, and run the registered test on a supported build environment.
ligmaSec commented 2026-12-03 13:17:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:17:26Z.

Review: COMMENTED


Built the change against the integration checkout on Linux. The registered WebCore geometry CTest passed, including the matrix inverse and transform cases.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6170540570 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18377#pullrequestreview-6170540570). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T13:17:26Z. **Review:** COMMENTED --- Built the change against the integration checkout on Linux. The registered WebCore geometry CTest passed, including the matrix inverse and transform cases. AI-assisted: yes.

Pull request closed

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!18377
No description provided.