Skip to content

feat(libwebrtc): implement the webrtc::AudioEncoderRuntimeConfig destructor - #15269

Open
alvaroelpob wants to merge 4 commits into
boykopovar:mainfrom
alvaroelpob:feat/libwebrtc-audio-encoder-runtime-config-destructor
Open

alvaroelpob wants to merge 4 commits into
boykopovar:mainfrom
alvaroelpob:feat/libwebrtc-audio-encoder-runtime-config-destructor

Conversation

@alvaroelpob

@alvaroelpob alvaroelpob commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What

Implements the webrtc::AudioEncoderRuntimeConfig 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. audio_network_adaptor_config.cc (M127, M134) defines it = default at both. Its six optional int, float, bool and size_t settings are trivially destructible. So it leaves the object as it is. src/AudioEncoderRuntimeConfig.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_audio_encoder_runtime_config test: destroying 48 bytes filled with 0xA5 leaves every byte as it was.
  • Full ctest -j16 on head 0146af9: 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 4f41f4c, head f080dab, 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 4f41f4c 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

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Progress report (0fbe14c → 77de878)

📈 System libraries: 29.1% (+0.0026%, +1 implemented functions)

✅ 1 implemented
Library Name
libwebrtc _ZN6webrtc25AudioEncoderRuntimeConfigD1Ev_nid_postfix
⚪ 1 behaviourally empty (constant return or throw)
Library Name
libwebrtc _ZN6webrtc25AudioEncoderRuntimeConfigD1Ev_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libwebrtc 72/412 (17.48%) 73/412 (17.72%) +0.24%

@alvaroelpob
alvaroelpob marked this pull request as ready for review November 2, 2026 23:24
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 3, 2026
@alvaroelpob
alvaroelpob force-pushed the feat/libwebrtc-audio-encoder-runtime-config-destructor branch from 0146af9 to f080dab Compare November 3, 2026 18:26
@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased onto main 4f41f4c and recomputed the debt counter. Build, check_conventions and the full ctest pass.

@BunnyFl BunnyFl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alvaroelpob approved at f080dabe68.

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

  • guest_webrtc_audio_encoder_runtime_config 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/AudioEncoderRuntimeConfig.cpp, guest_webrtc_audio_encoder_runtime_config 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), _ZN6webrtc25AudioEncoderRuntimeConfigD1Ev (Qj85effg-HQ) is a lone ret at 0x6176c0. 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 XairRrR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — approved

The empty webrtc::AudioEncoderRuntimeConfig destructor matches upstream's defaulted destructor. It merges, builds and passes its test and public_headers, and the test fails once the throwing stub is put back.

What I ran

Head f080dabe68e245ff0023206b18de37fcf68a79b8, main 1c8c0efc8c41314402e6966da5bef6ea3d639d10, merged with --no-ff into tree 973c6dd3fdcb38dcf03e48ba331d510781204e69. Machine: Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja.

git diff --check 1c8c0efc8c41314402e6966da5bef6ea3d639d10...f080dabe68e245ff0023206b18de37fcf68a79b8
python3 tools/check_conventions.py --base 1c8c0efc8c41314402e6966da5bef6ea3d639d10
ctest --test-dir build --output-on-failure -R "guest_webrtc_audio_encoder_runtime_config|public_headers"
git show <main|merged>:core/libs/prx/libwebrtc/Export.cpp | grep -c "NotImplemented_nid_no_patch(__func__)"
# negative control (see below)
ninja -C build -j32 -l32 guest_webrtc_audio_encoder_runtime_config_tests libwebrtc
ctest --test-dir build --output-on-failure -R "^guest_webrtc_audio_encoder_runtime_config$"
git status --porcelain

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) OK
Selected tests (script, 833 run) 829 passed, 3 expected skips, no new failures or timeouts; 1 known failure that also fails on main (unwrap_self_UnwrapTest_test_new_output_inherits_the_destination_directory_group)
guest_webrtc_audio_encoder_runtime_config passed (0.01 s)
public_headers + 64 public_headers_compile_* 65/65 passed
Debt counter Export.cpp stubs 291 → 290 and the debt line 351 → 350: both drop by one
Vulkan validation not applicable (no AGC, shader or VideoOut files changed)

Negative control

I replaced the new body in core/libs/prx/libwebrtc/src/AudioEncoderRuntimeConfig.cpp with the old behaviour, NotImplemented_nid_no_patch(__func__) (and added the General.hpp include it needs), then rebuilt. guest_webrtc_audio_encoder_runtime_config failed:

output
1/1 Test #3602: guest_webrtc_audio_encoder_runtime_config ...Subprocess aborted***Exception:   0.01 sec
terminate called after throwing an instance of 'std::runtime_error'
  what():  _ZN6webrtc25AudioEncoderRuntimeConfigD1Ev_nid_postfix not implemented

I then restored the file from the merged tree, rebuilt and re-ran the test, which passed. git status --porcelain is empty.

Findings

Blocking

None.

Non-blocking

  • The description's count is out of date after the rebase. The "What" section says the inventory drops "from 352 to 351". On the merged tree, docs/dev/debt/libwebrtc.md:5 goes from 351 to 350, which matches the 291 → 290 drop in NotImplemented_nid_no_patch stubs in Export.cpp. The file is correct; only the PR text is stale. As BunnyFl noted, sibling PRs that change the same line will need the count rebased whichever lands first.
  • Optional wording change in the debt entry. BunnyFl reports from firmware 13.42 disassembly that the console's D1Ev is a lone ret. I did not check that. If the author accepts it, the entry at docs/dev/debt/libwebrtc.md:24 could say so instead of "nothing is checked on the console".

Other points I checked, with no change needed:

  • Api.hpp:398 is still the only declaration, now void(void*), which matches a D1 destructor taking this.
  • The licence header follows the pattern of the sibling src/*.cpp files.
  • The test registration matches the existing guest_webrtc_* entries: 20 s timeout and the Windows PATH modification.

Not verified

  • Windows/MinGW build and test. BunnyFl reports they pass.
  • Behaviour on the console: I had no firmware and did not run a title.
  • The upstream M127/M134 audio_network_adaptor_config.cc contents. I had no network access, so I relied on the description's citation that the destructor is = default there.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head f080dab merged onto main 1e65852 · tested 2026-11-04 00:17 UTC · 16 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 1,087 passed · 2 failed (0 new, 1 also fail on main, 1 unstable on main) · 4 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 1,093 of 3,818 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (547 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ public_headers 57.8 s, ⚠️ agc_driver_image_sample_unnormalized 40.4 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 8 of the last 10 main runs
Failing on main too (1, not counted against this PR)
agc_driver_image_table
Validated but not compared (53, not in the main baseline's validation pass)
public_headers_compile_0
public_headers_compile_10
public_headers_compile_12
public_headers_compile_14
public_headers_compile_18
public_headers_compile_2
public_headers_compile_20
public_headers_compile_21
public_headers_compile_22
public_headers_compile_23
public_headers_compile_24
public_headers_compile_25
public_headers_compile_26
public_headers_compile_27
public_headers_compile_28
public_headers_compile_29
public_headers_compile_30
public_headers_compile_31
public_headers_compile_32
public_headers_compile_33
public_headers_compile_34
public_headers_compile_35
public_headers_compile_36
public_headers_compile_37
public_headers_compile_38
public_headers_compile_39
public_headers_compile_4
public_headers_compile_40
public_headers_compile_41
public_headers_compile_42
public_headers_compile_43
public_headers_compile_44
public_headers_compile_45
public_headers_compile_46
public_headers_compile_47
public_headers_compile_48
public_headers_compile_49
public_headers_compile_50
public_headers_compile_51
public_headers_compile_52
public_headers_compile_53
public_headers_compile_54
public_headers_compile_55
public_headers_compile_56
public_headers_compile_57
public_headers_compile_58
public_headers_compile_59
public_headers_compile_6
public_headers_compile_60
public_headers_compile_61
public_headers_compile_62
public_headers_compile_63
public_headers_compile_8
Validation IDs already present on main (4 IDs in 417 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (417 tests): agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, agc_driver_bindless_images, and 409 more
VUID-vkCmdCopyImage-srcImage-01548 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
Skipped (4)
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
Reproduce
git fetch origin f080dabe68e245ff0023206b18de37fcf68a79b8 1e658521a0a599872612bb91949311e2956b5283
git checkout 1e658521a0a599872612bb91949311e2956b5283 && git merge --no-ff f080dabe68e245ff0023206b18de37fcf68a79b8
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@alvaroelpob

Copy link
Copy Markdown
Contributor Author

@BunnyFl thanks. The debt entry now cites your 13.42 disassembly (a lone ret, read from disassembly, not measured on a console) instead of "nothing is checked on the console".

@XairRrR the description now says how many exports the PR removes instead of giving totals, so it no longer goes stale.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 4, 2026
@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased on main d63781e to resolve the conflicts on the shared CMakeLists.txt, Export.cpp and debt lines (#14224); the export count is recomputed as the Export.cpp stubs plus the 60 NID-only exports. Head 4ac7620. Full Linux suite on that head: 3936/3936; check_conventions.py passes.

@alvaroelpob
alvaroelpob force-pushed the feat/libwebrtc-audio-encoder-runtime-config-destructor branch from 0ea9e97 to 4ac7620 Compare November 5, 2026 13:22
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 5, 2026
@alvaroelpob
alvaroelpob force-pushed the feat/libwebrtc-audio-encoder-runtime-config-destructor branch from 4ac7620 to 77de878 Compare November 6, 2026 09:41
@alvaroelpob

Copy link
Copy Markdown
Contributor Author

Rebased on main 018cfcb to resolve the new conflicts. Head 77de878. Full Linux suite: 4168/4168. check_conventions.py passes.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 6, 2026
@oneandonlydean oneandonlydean self-assigned this Nov 6, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build docs needs rebase Conflicts with main, rebase needed prx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants