Skip to content

obs-encoder: swap borrowed name query to Rust (Refs #5253) - #5257

Merged
zackees merged 2 commits into
masterfrom
port/5253-encoder-get-name
Nov 19, 2026
Merged

zackees merged 2 commits into
masterfrom
port/5253-encoder-get-name

Conversation

@zackees

@zackees zackees commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

obs_encoder_get_name now uses the safe obs-encoder core. NULL returns NULL with exactly one LOG_DEBUG diagnostic, obs_encoder_get_name: Null 'encoder' parameter. A live encoder returns its current borrowed context.name pointer through a private C projection after the NULL guard, without copying or caching.

The interleaver parity fixture previously defined the public getter for a synthetic encoder layout. It now supplies a distinct private name seam to both the Rust interleaver and original-C oracle. The benchmark stand-in follows that seam too. The real projection and production forwarding adapter join #5190's demand-linked shared support archive. Existing C tests, public headers, WebSocket sources and workflow files are unchanged; no Rust test executable was added.

RED commit 78b2f14e0 failed all five safe-core mirrors at the stub. GREEN adds the ABI swap and two differential tests using the unchanged original C body and real private layout. A mutation discarding the projection failed both differential tests; restoring it passed all seven new tests.

Local validation passed: 54 encoder tests; 1,376 output tests; the entire native_build module (322 tests plus two isolated child executions); all 65 configured Linux *_rust targets; unchanged test_encoder_get_name and test_context_names three times OFF and ON, plus a verbose replay confirming all four and 15 cases pass without skips. C reference and hybrid libobs export the identical 1,769 symbols.

ci/windows_link_check.py passed all eight MSVC category binaries, hybrid libobs and all 56 Windows fixtures, then all 56 Darwin fixtures. A separate ci/cmocka_link_check.py --alias mac-arm64 pass succeeded too. The Darwin Core category binary also linked. llvm-nm proves that _obs_encoder_get_name, _obs_encoder_get_name_context_name, _oracle_obs_encoder_get_name and the distinct synthetic _obs_output_interleave_encoder_name are each locally defined, with no dylib import providing them. Disassembly confirms the production Rust closure calls the real context projection. Evidence is retained in build_ci_audit/encoder-get-name/.

soldr cargo fmt --all --check passed. The one actual full ./lint execution caught the stale benchmark stand-in inventory; its two failures were corrected in this PR and all three focused inventory tests passed. ./push's complete client-lint lane subsequently passed host formatting, inventories, all feature configurations and Clippy/Dylint for all six supported targets (367.9 seconds). Complete client-checks then passed all 397 self-test files and validators. Client-test passed 9,221 host tests (six additional skips), 920 feature tests, doctests and Windows GNU workspace test linking. The final signed head carries 19 Ci-Attestation records and preserves the validated tree 6214a20504335715071c6994f1bbb15df73e77e9.

Test cost: seven new cases in the existing Core category binary, 25 reduced-parity repetitions, longest combined run 0.055 seconds, peak child RSS 19,928 KiB, no test-owned threads. One read-only clud-review reviewer found no actionable issues and independently passed the seven focused tests. Tier 4 does not apply to this behavior-preserving getter swap. Native macOS/Windows execution remains for the merge queue.

Forced-fetched the overlapping open PR heads and ran merge-tree, then deleted the temporary refs. #5250 combines cleanly. #5246 has one additional conflict in test/cmocka/tests.d/video_info_query_link_support.cmake because it replaces the shared-support mechanism; if #5246 lands first, rebasing must add encoder-get-name-link-support.c and output-interleave-name-link-support.c to its shared support manifest. The branch is clean against current master.

Refs #5253
Refs #4239

Ci-Attestation: {"at":1795105652,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":108,"stamp":"5a5ea63ed6dd9e310ca025e187f551cc","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105652,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":108,"stamp":"e39c43327900d7b78d811de9f4106038","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105652,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":108,"stamp":"abe4dc9310b43caa65d7786affc1ee4d","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105652,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":108,"stamp":"95c50c6e733f7cce3d9cf1b5e5e1d96a","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105542,"gate":"general/all/client-lint","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"a0254c42675dca0a011364a0fcdb2feb","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105652,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":108,"stamp":"712ce9efe287eee9daa777356bc97b81","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105543,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"c79f444f0ecd09f6326121e853ba6900","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105543,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"9e87bab0232b659048865ff6baee5842","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105542,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"0b43ee0605e6e4ceb2233ccd663debcb","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105542,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"2faeb0e8ddb8c0f6eb477435b8d5894d","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105542,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"ab3b2019ff752b44a0a0c611136d465e","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105542,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"410c4edcddbe77a0fb34b2f41d68f7ed","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105542,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"3f1caeb154e2942ce2f4e1e38cb268b0","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105543,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"d56d27977db0842f8a7c77543b59abe9","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105542,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"fee683c5923ec43ef91cc7052a86bfba","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105542,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"f3bd73beaf18b98d4396f034e351a205","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105542,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"26fe29ace1fbd6dfb4680173650d069a","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795105542,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"741b67eac56c2961afe27d9f3924324873d0a5e90fa4175c7e34f6e19eff0b09","lane":"client-lint","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":368,"stamp":"1380d727f9256e8f50ab50ba11744694","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}
Ci-Attestation: {"at":1795106255,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"1480c9f7f7f07e386e5b79ff6738012b65d520226523115bc200dd8f3aac9d93","lane":"client-test-x86_64-unknown-linux-gnu","parents":["78b2f14e059643f0ea38253c8840fe92d5a4a207"],"secs":601,"stamp":"96810343330ff747a7eb596c7528a79b","tree":"6214a20504335715071c6994f1bbb15df73e77e9","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"9135554e3e5b9c608f75794f930709ea15dd2af8","coverage":"all-tracked-applicable-files","diff":["ci/test_bench_libobs_stand_ins.py","libobs/build/libobs.core-output+.h.c","libobs/build/libobs.ported-encoder-get-name+.h.c","libobs/build/ported-source-sets/encoder-get-name.json","libobs/cmake/rust-exports.d/obs-encoder-get_name.txt","libobs/obs-encoder-get-name-fields.c.h","libobs/obs-output-interleave-name-fields.c.h","rust/obs-build/tests/native/registration/canonical_video_info_query_is_registered.rs","rust/obs-c-oracle/benches/port_comparison.rs","rust/obs-c-oracle/oracle.d/encoder-get-name.list","rust/obs-c-oracle/oracle/encoder_get_name.c","rust/obs-c-oracle/oracle/output_interleave.c","rust/obs-encoder/src/ffi/get_name.rs","rust/obs-encoder/src/ffi/mod.rs","rust/obs-encoder/src/get_name.rs","rust/obs-encoder/src/lib.rs","rust/obs-encoder/tests/encoder/get_name.rs","rust/obs-encoder/tests/encoder/get_name_parity.rs","rust/obs-encoder/tests/encoder/main.rs","rust/obs-output/src/ffi/output_interleave.rs","rust/obs-output/tests/output/interleave_parity.rs","test/cmocka/encoder-get-name-link-support.c","test/cmocka/output-interleave-name-link-support.c","test/cmocka/tests.d/video_info_query_link_support.cmake"],"head":"2f584bc1fd61eab712a02803362a8473f01c0578","tools":{"orchestrator-python":"3.14.7 (main, Aug 14 2026, 15:35:28) [Clang 22.1.3 ]","schema-dependencies":"3.14.7 (main, Aug 14 2026, 15:35:28) [Clang 22.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ISO8859X Regexps Automata RelaxNG Schemas Modules Debug"},"tracked-digest":"d63e040eb21b8830e89bfcba57745543f21dc1800e97272527f2602357cec5b1","tree":"6214a20504335715071c6994f1bbb15df73e77e9"}}
@zackees zackees added the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 19, 2026
@zackees
zackees enabled auto-merge November 19, 2026 16:38
@zackees zackees removed the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 19, 2026
@zackees
zackees added this pull request to the merge queue Nov 19, 2026
Merged via the queue into master with commit fa4ceee Nov 19, 2026
46 checks passed
@zackees
zackees deleted the port/5253-encoder-get-name branch November 19, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

1 participant