feat(libwebrtc): implement the webrtc::SmoothingFilterImpl destructor #15272

Merged
alvaroelpob merged 5 commits from upstream-pr/15272 into main 2026-11-07 05:18:58 +00:00
alvaroelpob commented 2026-11-02 22:35:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alvaroelpob on 2026-11-02T22:35:31Z.


What

Implements the webrtc::SmoothingFilterImpl destructor in libwebrtc, which threw and was declared without parameters.

The module's WebRTC revision lies between M127 and M134, as recorded in the debt file. smoothing_filter.cc (M127, M134) defines it = default at both. The filter's members in smoothing_filter.h (init time, factor and constant, an optional end time, the last sample, alpha, state and last state time) are trivially destructible, so it writes nothing. The destructor is virtual, so a compiled one would also point the object's vtable at the class's own on the way out, which no caller can observe after destruction. src/SmoothingFilterImpl.cpp starts with that file's WebRTC notice and the BSD licence. It removes 1 export from the inventory.

Tested

Ubuntu 26.04 (WSL2, kernel 6.18), GCC 15.2.0, Release, full build with BUILD_TESTING=ON.

  • New guest_webrtc_smoothing_filter test: destroying 64 bytes filled with 0xA5 leaves every byte as it was.
  • Full ctest -j16 on head 8d9706d5ef: 3596/3596 pass. check_conventions.py --base upstream/main passes.
  • pr_overlap.py: no open pull request implements these functions. The shared lines are the pending-export count in docs/dev/debt/libwebrtc.md and the source, test and declaration lists in CMakeLists.txt and Api.hpp.
  • Not tested: Windows, a title.
  • Rebased on main 4f41f4c375, head e6c628b9fb, to resolve the conflicts on the shared CMakeLists.txt, Export.cpp and debt-file lines; both sides are kept and the debt count is recomputed from Export.cpp. Full build and ctest -j16: 3796/3800 pass; guest_sce_net, guest_poll, guest_select_wait and guest_memory failed under that load, pass when run alone, and main 4f41f4c375 passes all 3799 with -j16 on the same machine. check_conventions.py --base upstream/main passes.

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:5128527336 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15272). Originally posted by [alvaroelpob](https://github.com/alvaroelpob) on 2026-11-02T22:35:31Z. --- ### What Implements the `webrtc::SmoothingFilterImpl` destructor in libwebrtc, which threw and was declared without parameters. The module's WebRTC revision lies between M127 and M134, as recorded in the debt file. `smoothing_filter.cc` ([M127](https://webrtc.googlesource.com/src/+/e0b28a6a81a989c1f5c89e30fcd247870047390d/common_audio/smoothing_filter.cc), [M134](https://webrtc.googlesource.com/src/+/8d78f5de6c27b2c793039989ea381f1428fb0100/common_audio/smoothing_filter.cc)) defines it `= default` at both. The filter's members in `smoothing_filter.h` (init time, factor and constant, an optional end time, the last sample, alpha, state and last state time) are trivially destructible, so it writes nothing. The destructor is virtual, so a compiled one would also point the object's vtable at the class's own on the way out, which no caller can observe after destruction. `src/SmoothingFilterImpl.cpp` starts with that file's WebRTC notice and the BSD licence. It removes 1 export from the inventory. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Ubuntu 26.04 (WSL2, kernel 6.18), GCC 15.2.0, Release, full build with `BUILD_TESTING=ON`. - New `guest_webrtc_smoothing_filter` test: destroying 64 bytes filled with 0xA5 leaves every byte as it was. - Full `ctest -j16` on head 8d9706d5ef: 3596/3596 pass. `check_conventions.py --base upstream/main` passes. - `pr_overlap.py`: no open pull request implements these functions. The shared lines are the pending-export count in `docs/dev/debt/libwebrtc.md` and the source, test and declaration lists in `CMakeLists.txt` and `Api.hpp`. - Not tested: Windows, a title. - Rebased on `main` 4f41f4c375, head e6c628b9fb, to resolve the conflicts on the shared `CMakeLists.txt`, `Export.cpp` and debt-file lines; both sides are kept and the debt count is recomputed from `Export.cpp`. Full build and `ctest -j16`: 3796/3800 pass; `guest_sce_net`, `guest_poll`, `guest_select_wait` and `guest_memory` failed under that load, pass when run alone, and `main` 4f41f4c375 passes all 3799 with `-j16` on the same machine. `check_conventions.py --base upstream/main` passes. ### 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
BunnyFl commented 2026-11-03 23:51:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-03T23:51:36Z.

Review: APPROVED


@alvaroelpob approved at e6c628b9fb.

What I ran: this head merged onto main (merge 0826dae22e), Windows 11, WinLibs GCC, Release.

  • guest_webrtc_smoothing_filter and public_headers pass (2 of 2).
  • tools/check_conventions.py --base upstream/main --head on this head: all checks pass.
  • Mutation: with a throw at the top of the new body in core/libs/prx/libwebrtc/src/SmoothingFilterImpl.cpp, guest_webrtc_smoothing_filter fails (1 of 1). So the test checks the change.

Firmware: this also settles what the debt entry leaves open. In 13.42 system/common/lib/libwebrtc.sprx (sha256 d59d0caf6967329b39201a2a0bd6df7b994516f21701b9801908db6735ae5314), _ZN6webrtc19SmoothingFilterImplD1Ev (2ck4jCN8Qcc) is a lone ret at 0x41fcd0. That's read from disassembly, not run. So the empty body matches the console module, not only upstream. If you like, the debt entry can say so instead of "nothing is checked on the console".

Merge order: this PR and its siblings (#15266–#15269 and #15272) each change the same 351 exports line in docs/dev/debt/libwebrtc.md, and so does my #15609. Whichever lands later only needs that count rebased. I haven't tried merging the siblings into each other.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5761138522 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15272#pullrequestreview-5761138522). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-03T23:51:36Z. **Review:** APPROVED --- @alvaroelpob approved at `e6c628b9fb`. **What I ran:** this head merged onto `main` (merge `0826dae22e`), Windows 11, WinLibs GCC, Release. - `guest_webrtc_smoothing_filter` and `public_headers` pass (2 of 2). - `tools/check_conventions.py --base upstream/main --head` on this head: all checks pass. - **Mutation:** with a `throw` at the top of the new body in `core/libs/prx/libwebrtc/src/SmoothingFilterImpl.cpp`, `guest_webrtc_smoothing_filter` fails (1 of 1). So the test checks the change. **Firmware:** this also settles what the debt entry leaves open. In 13.42 `system/common/lib/libwebrtc.sprx` (sha256 `d59d0caf6967329b39201a2a0bd6df7b994516f21701b9801908db6735ae5314`), `_ZN6webrtc19SmoothingFilterImplD1Ev` (`2ck4jCN8Qcc`) is a lone `ret` at `0x41fcd0`. That's read from disassembly, not run. So the empty body matches the console module, not only upstream. If you like, the debt entry can say so instead of "nothing is checked on the console". **Merge order:** this PR and its siblings (#15266–#15269 and #15272) each change the same `351 exports` line in `docs/dev/debt/libwebrtc.md`, and so does my #15609. Whichever lands later only needs that count rebased. I haven't tried merging the siblings into each other.
XairRrR commented 2026-11-04 00:08:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-04T00:08:35Z.

Review: APPROVED


Reviewed — approved

The webrtc::SmoothingFilterImpl destructor is now a no-op taking the object pointer, which matches upstream's = default destructor. The merged tree builds, the new test and public_headers pass, the new test fails against the old throwing export, and the debt count is consistent with Export.cpp.

What I ran

Head e6c628b9fb825ac88da151699fa495cbff91353f merged into main 1c8c0efc8c41314402e6966da5bef6ea3d639d10 (merged tree 441c096a3199b2c1f95b36695a97c164a859c030). Machine: Debian 13 VM, Intel Xeon Gold 6136, GCC 14.2.0, Release, Ninja.

git diff --check 1c8c0efc8c41314402e6966da5bef6ea3d639d10...e6c628b9fb825ac88da151699fa495cbff91353f
python3 tools/check_conventions.py --base 1c8c0efc8c41314402e6966da5bef6ea3d639d10
grep -c "NotImplemented" core/libs/prx/libwebrtc/Export.cpp
grep -rn "SmoothingFilterImplD1Ev" core
ctest --test-dir build --output-on-failure -R "guest_webrtc_smoothing_filter|public_headers"
# negative control (see below)
git show 1c8c0efc8c…:core/libs/prx/libwebrtc/Export.cpp > core/libs/prx/libwebrtc/Export.cpp
git show 1c8c0efc8c…:core/libs/prx/libwebrtc/include/Api.hpp > core/libs/prx/libwebrtc/include/Api.hpp
: > core/libs/prx/libwebrtc/src/SmoothingFilterImpl.cpp
ninja -C build guest_webrtc_smoothing_filter_tests libwebrtc
ctest --test-dir build -R guest_webrtc_smoothing_filter --output-on-failure
# restore merged files, rebuild, rerun, git status --porcelain

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Script build, selected tests (833 ran) 829 passed, 3 expected skips, no new failures; the one known failure (unwrap_self_…inherits_the_destination_directory_group) also fails on main
guest_webrtc_smoothing_filter + public_headers* (66 tests) 66/66 passed; the new test takes 0.01 s
Debt count 350 NotImplemented calls in Export.cpp at the merged tree, matching "350 exports" (main has 351)
Remaining declarations exactly one, in Api.hpp:353; the old Export.cpp stub is removed
Validation layer comparison skipped by the script: no AGC, shader or VideoOut files changed
Negative control output
../core/libs/prx/libwebrtc/tests/SmoothingFilterImpl.cpp:21:52: error: too many arguments to function 'int _ZN6webrtc19SmoothingFilterImplD1Ev_nid_postfix()'
...
1/1 Test #3602: guest_webrtc_smoothing_filter ....Subprocess aborted***Exception:   0.01 sec
  what():  _ZN6webrtc19SmoothingFilterImplD1Ev_nid_postfix not implemented

Negative control

I restored Export.cpp and Include/Api.hpp from main and emptied src/SmoothingFilterImpl.cpp:

  • Compile: the test no longer compiles against the old (void) declaration ("too many arguments").
  • Runtime: the rebuilt libwebrtc with main's throwing export was then run under the previously linked test executable. The test aborts with _ZN6webrtc19SmoothingFilterImplD1Ev_nid_postfix not implemented.

So the test catches a missing implementation. I then restored the merged files and rebuilt; the test passes again, and git status --porcelain is empty.

This agrees with BunnyFl's earlier throw mutation.

Findings

Blocking

None.

Non-blocking

  • docs/dev/debt/libwebrtc.md:24: the entry says "nothing is checked on the console". BunnyFl's review reports that the 13.42 firmware's _ZN6webrtc19SmoothingFilterImplD1Ev is a lone ret, read from disassembly. I can't confirm that (no firmware here). If it holds, the entry could name that evidence, or be cut to what is still open, as CONTRIBUTING.md asks for closed gaps.
  • The description says the inventory drops "from 352 to 351". After the rebase the diff changes it from 351 to 350, and 350 is correct for the merged tree. Only the description is out of date.

Not verified

  • Behaviour on the console, and BunnyFl's disassembly claim.
  • Windows/MinGW build and run.
  • No title was run (none was launched, per policy).
  • I ran only the selected tests, not the full suite.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5761292068 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15272#pullrequestreview-5761292068). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-04T00:08:35Z. **Review:** APPROVED --- # Reviewed — approved The `webrtc::SmoothingFilterImpl` destructor is now a no-op taking the object pointer, which matches upstream's `= default` destructor. The merged tree builds, the new test and `public_headers` pass, the new test fails against the old throwing export, and the debt count is consistent with `Export.cpp`. ## What I ran Head `e6c628b9fb825ac88da151699fa495cbff91353f` merged into `main` `1c8c0efc8c41314402e6966da5bef6ea3d639d10` (merged tree `441c096a3199b2c1f95b36695a97c164a859c030`). Machine: Debian 13 VM, Intel Xeon Gold 6136, GCC 14.2.0, Release, Ninja. ``` git diff --check 1c8c0efc8c41314402e6966da5bef6ea3d639d10...e6c628b9fb825ac88da151699fa495cbff91353f python3 tools/check_conventions.py --base 1c8c0efc8c41314402e6966da5bef6ea3d639d10 grep -c "NotImplemented" core/libs/prx/libwebrtc/Export.cpp grep -rn "SmoothingFilterImplD1Ev" core ctest --test-dir build --output-on-failure -R "guest_webrtc_smoothing_filter|public_headers" # negative control (see below) git show 1c8c0efc8c…:core/libs/prx/libwebrtc/Export.cpp > core/libs/prx/libwebrtc/Export.cpp git show 1c8c0efc8c…:core/libs/prx/libwebrtc/include/Api.hpp > core/libs/prx/libwebrtc/include/Api.hpp : > core/libs/prx/libwebrtc/src/SmoothingFilterImpl.cpp ninja -C build guest_webrtc_smoothing_filter_tests libwebrtc ctest --test-dir build -R guest_webrtc_smoothing_filter --output-on-failure # restore merged files, rebuild, rerun, git status --porcelain ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Script build, selected tests (833 ran) | 829 passed, 3 expected skips, no new failures; the one known failure (`unwrap_self_…inherits_the_destination_directory_group`) also fails on `main` | | `guest_webrtc_smoothing_filter` + `public_headers*` (66 tests) | 66/66 passed; the new test takes 0.01 s | | Debt count | 350 `NotImplemented` calls in `Export.cpp` at the merged tree, matching "350 exports" (`main` has 351) | | Remaining declarations | exactly one, in `Api.hpp:353`; the old `Export.cpp` stub is removed | | Validation layer comparison | skipped by the script: no AGC, shader or VideoOut files changed | <details><summary>Negative control output</summary> ``` ../core/libs/prx/libwebrtc/tests/SmoothingFilterImpl.cpp:21:52: error: too many arguments to function 'int _ZN6webrtc19SmoothingFilterImplD1Ev_nid_postfix()' ... 1/1 Test #3602: guest_webrtc_smoothing_filter ....Subprocess aborted***Exception: 0.01 sec what(): _ZN6webrtc19SmoothingFilterImplD1Ev_nid_postfix not implemented ``` </details> ## Negative control I restored `Export.cpp` and `Include/Api.hpp` from `main` and emptied `src/SmoothingFilterImpl.cpp`: - **Compile:** the test no longer compiles against the old `(void)` declaration ("too many arguments"). - **Runtime:** the rebuilt `libwebrtc` with `main`'s throwing export was then run under the previously linked test executable. The test aborts with `_ZN6webrtc19SmoothingFilterImplD1Ev_nid_postfix not implemented`. So the test catches a missing implementation. I then restored the merged files and rebuilt; the test passes again, and `git status --porcelain` is empty. This agrees with BunnyFl's earlier `throw` mutation. ## Findings ### Blocking None. ### Non-blocking - `docs/dev/debt/libwebrtc.md:24`: the entry says "nothing is checked on the console". BunnyFl's review reports that the 13.42 firmware's `_ZN6webrtc19SmoothingFilterImplD1Ev` is a lone `ret`, read from disassembly. I can't confirm that (no firmware here). If it holds, the entry could name that evidence, or be cut to what is still open, as CONTRIBUTING.md asks for closed gaps. - The description says the inventory drops "from 352 to 351". After the rebase the diff changes it from 351 to 350, and 350 is correct for the merged tree. Only the description is out of date. ## Not verified - Behaviour on the console, and BunnyFl's disassembly claim. - Windows/MinGW build and run. - No title was run (none was launched, per policy). - I ran only the selected tests, not the full suite. <!-- anyps5-bots job=2859 head=e6c628b9fb825ac88da151699fa495cbff91353f -->
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!15272
No description provided.