Skip to content

obs-hotkey: port single-hotkey registration to Rust - #4920

Merged
zackees merged 2 commits into
masterfrom
port/4425-hotkey-register-stacked
Nov 17, 2026
Merged

zackees merged 2 commits into
masterfrom
port/4425-hotkey-register-stacked

Conversation

@zackees

@zackees zackees commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Refs #4425.

Port the five single-hotkey registration entry points to obs-hotkey. The safe core preserves NULL/private-source admission and lock/acquire/register/unlock ordering. Thin FFI uses real owner-layout accessors and delegates allocation and binding enrollment to the existing C registration engine. The original wrappers remain available to the C reference and differential oracle.

Rebased the port's two commits onto master 21d62feeb8010da3a1b1de85206e71bd4018953e, after parent #4908 merged. RED remains before GREEN. The oracle build-registry conflict retains both master's FFmpeg orientation extracts and this port's registration extract; git range-diff shows only the expected surrounding context changes.

Fresh rebase validation:

  • RED 311468dacd7fa8feab03aa963c2b3c02fd53b3d4: all four safe registration tests fail at the intended todo!() stub.
  • GREEN: all 583 reduced hotkey tests pass, including the seven registration, real-header ABI and original-C differential cases.
  • Focused Tier 2: all ten unchanged hotkey/portal/Wayland C tests pass against both C reference and hybrid libobs; loader diagnostics identify each implementation.
  • Dynamic exports match exactly: 1,768 symbols.
  • Extraction, port-unit metadata and test-binary-budget regressions: nine tests pass.
  • Full ./lint: passed once in 434.6 seconds with a 1,800-second deadline, including repository self-tests, formatting, workspace/feature Clippy and Dylint.
  • Fresh ./push client proof: six-target Clippy/Dylint, repository validators/self-tests, 8,686 host tests (six skipped), documentation tests, all 918 utility feature-variant tests, and Windows GNU linking of all eight category binaries pass. Final head is signed and carries 19 Ci-Attestation records plus Client-Checks. Optional Swift evidence is absent (swift-format is unavailable); this PR changes no Swift.
  • Published through ./push --replace-remote-head 2a865663a52083532dec66019951c08142433ccc; the exact lease succeeded. The wrapper then reported a PR-lookup API error; direct PR inspection confirms the published head bbce09cd162e91d996383856518fd497453972d6.

The original implementation review passed. Its mutation check killed both fixed-edge and randomized parity tests; the mutation check was not repeated for this rebase.

Test cost (original worker's 25 reduced debug runs): seven registration cases, longest combined run 0.080 s, peak RSS 23,648 KB, no own threads. Existing core-state binary; no additional Rust test executable.

No existing C tests, public headers, WebSocket plugin, test graph or native.rs changes. Behavior is preserved; no feature-ledger entry is needed. Tier 4 does not apply to this local C API unit. Complete local Tier 2 and native Windows/macOS runtime are not claimed; selected hosted checks remain the merge gate.

@zackees zackees added the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 16, 2026
@zackees zackees removed the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 17, 2026
@zackees
zackees force-pushed the port/4425-hotkey-register-stacked branch from 0f5e4ea to 2a86566 Compare November 17, 2026 00:45
@zackees
zackees marked this pull request as ready for review November 17, 2026 00:45
@zackees
zackees enabled auto-merge November 17, 2026 00:45
@zackees
zackees added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 17, 2026
@zackees zackees added the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 17, 2026
… stubs

Refs #4425. Mirror admission, identity, callbacks, saved bindings and owner teardown in the existing core-state binary. All four tests fail at the todo stub.
Refs #4425. Preserve admission, weak owner/context and lock order through narrow private adapters; keep the original wrappers in the C reference. Add original-C differential traces, a mutation-killing seed and unchanged C characterization coverage.

Ci-Attestation: {"at":1794885370,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":153,"stamp":"53839a38c5895ac619d708a8429ed155","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885370,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":153,"stamp":"24446e3f635fa6dd376914708da947f3","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885370,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":153,"stamp":"67caa5af1f01965a48b572769b6a71aa","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885370,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":153,"stamp":"9b9b86db464cb395541ff2891f5941ea","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885214,"gate":"general/all/client-lint","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"63a589d2f34ae48d18991212d7befdb3","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885370,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":153,"stamp":"fc1c11ecc26477f98372e9653761ce5b","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885215,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"0085eb01d2cd16638c8e7920d8737067","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885215,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"959cfdf6da51990f05a6b5eb19c96ef9","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885215,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"7f04c8dd459c1aae5f64bf9c019658dd","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885215,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"3075bce69a1511331e9647677a7e53e3","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885214,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"20ddad6350073daa6d9b419b44692d2d","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885214,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"0a0db8ac15835c7843a64472f886ca8a","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885215,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"f05143a76c5d9dd24cc3291691c7d61a","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885215,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"635b905b9fcb15611ef0c606720d62a6","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885215,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"c645ef953394723135ff775b8d4cd676","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885215,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"2669cce37e6cf455f6792dbd55ff6dab","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885214,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"107a7ce2fb15f2bd36c4af5989abc960","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794885214,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"14c4be0572359999ea5e75ae25e352978469af440ea72916a6a6aa840ee75ec0","lane":"client-lint","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":289,"stamp":"110b07e6cdb1abc2d7c4e2fda7fdca81","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}
Ci-Attestation: {"at":1794886788,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"7893d1dfff4a2b96b112370cda2554020918dad7422ee4f85122c1dc5b850a55","lane":"client-test-x86_64-unknown-linux-gnu","parents":["311468dacd7fa8feab03aa963c2b3c02fd53b3d4"],"secs":1416,"stamp":"ea5f3772d4b946d344cff7858ddaf6c5","tree":"2981fb34c1330be658c15b74e166a01df570132a","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"21d62feeb8010da3a1b1de85206e71bd4018953e","coverage":"all-tracked-applicable-files","diff":["ci/test_hotkey_register_extraction.py","libobs/build/libobs.core+.h.c","libobs/build/libobs.ported-hotkey-register+.h.c","libobs/build/ported-source-sets/hotkey-register.json","libobs/cmake/rust-exports.d/obs-hotkey-register.txt","libobs/obs-hotkey-register-fields.c.h","libobs/obs-hotkey-register.c.h","libobs/obs-hotkey.c.h","rust/README.md","rust/obs-c-oracle/build.rs","rust/obs-c-oracle/oracle/hotkey_register.c","rust/obs-hotkey/src/ffi/mod.rs","rust/obs-hotkey/src/ffi/register.rs","rust/obs-hotkey/src/lib.rs","rust/obs-hotkey/src/register.rs","rust/obs-hotkey/tests/hotkey/main.rs","rust/obs-hotkey/tests/hotkey/register.rs","rust/obs-hotkey/tests/hotkey/register_parity.rs","rust/obs-hotkey/tests/proptest-regressions/register_parity.txt"],"head":"20f9c06ec9d108082fa87f3862043294fe7c066c","tools":{"orchestrator-python":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]","schema-dependencies":"3.13.15 (main, Aug 14 2026, 15:34:59) [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":"630f0069b118401d5134bded806a2d64fc5be2a9205f7a6049d6379d629f298b","tree":"2981fb34c1330be658c15b74e166a01df570132a"}}
@zackees
zackees force-pushed the port/4425-hotkey-register-stacked branch from 2a86566 to bbce09c Compare November 17, 2026 03:39
@zackees
zackees enabled auto-merge November 17, 2026 03:41
@zackees zackees removed the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 17, 2026
@zackees
zackees added this pull request to the merge queue Nov 17, 2026
Merged via the queue into master with commit 82e680c Nov 17, 2026
41 checks passed
@zackees
zackees deleted the port/4425-hotkey-register-stacked branch November 17, 2026 06:10
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In review to Done in obs-rust Multiview Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant