Repository navigation
Description
Scout D / rank 10: C-only prerequisite for the remaining Phase 6 hotkey unregistration entry points, later targeting obs-hotkey. Snapshot: master a62bfe717d5d9610a5136ca211273e66a1ae1f84 (2026-11-19 UTC).
Context and scope
Exported entry points: obs_hotkey_unregister, obs_hotkey_pair_unregister. Live C definitions: libobs/obs-hotkey.c.h:357-373; public declarations remain in the unchanged libobs headers.
Move only these public bodies verbatim to proposed libobs/obs-hotkey-unregister-entry.c.h, within the existing libobs/build/libobs.core+.h.c PCH family. Preserve signatures, behavior, field-read/callback/lock order and all private dependency semantics. This prerequisite contains no Rust; a separate whole-file Rust-swap issue/PR follows after it lands.
Rust-side confirmation: The exact pair-unregister Rust grep is empty. The single public unregister name occurs only in Rust test documentation. rust/obs-hotkey/src/ffi/unregister.rs:89-100 exports hidden obs_hotkey_unregister_release_registerer and obs_hotkey_unregister_one only. That completed helper port did not export either selected public wrapper; current obs-hotkey.c.h:357-373 still defines both.
Characterization and build brief
Extract the public single-key and pair unregistration entry wrappers together. No core gives a silent no-op. With a core, acquire the existing hotkey mutex once, call the matching existing remover with the original size_t ID, then unlock. Pin wrong/missing/invalid IDs, repeated removal and call/lock ordering. Pair removal must preserve its existing helper semantics: first pair member unregisters before the second, then the pair hash entry is deleted and freed, under the same lock. Keep notifications, pressed-binding release and weak-owner cleanup in their existing already ported single-key remover; do not reorder or repair them. No pair registration/creation, owner context teardown or global shutdown scope.
Existing coverage to preserve: test/cmocka/test_hotkey_unregister.c covers single-key removal; test/cmocka/test_hotkey_press_state.c:788-820 and test_hotkey_pair_register.c exercise pair teardown. Preserve them and add only a focused deterministic wrapper/pair-recorder test for no-core, missing pair, member order and balanced locking.
Dependencies and sequencing: No functional prerequisite. Reuse obs_hotkey_seam_lock/unlock. The existing unregister_hotkey alias targets Rust obs_hotkey_unregister_one; scope any alias in the new file and undefine it at end. Keep static unregister_hotkey_pair reachable via an exact declaration in the same unity group/minimal callable seam without changing its body. The existing object-bound pair registration issue is disjoint and must not be claimed or modified.
Acceptance criteria
- Reuse applicable existing C characterization unchanged. Add a new focused test only for missing coverage, proving baseline behavior against original C first. Record RED for the missing extraction seam/new focused contract before GREEN; when assertions already cover the entire contract, use an extraction/build contract instead of redundant behavioral tests.
- Land a separate behavior-neutral C-only extraction commit/PR before the Rust swap. No public-header/signature edits, no existing C-test edits, no WebSocket plugin modifications and no new workflow files. Scope unity-local aliases and undefine them at file end; keep sorted source membership and native metadata consistent.
- Run focused unchanged/new C tests against both libobs-c-reference and hybrid libobs; retain identical public symbol sets and validate affected native-build registrations. Run repository lint once. Preserve fixture host conditions and check Windows MSVC fixture linkage as applicable (no max_align_t or invalid enum sentinels). New threading fixtures use synchronization and the policy's 100-repeat determinism check, not sleeps.
- Later swap: Tier 1 mirrors every unchanged C assertion in safe Rust, with a committed failing stub before GREEN. Tier 2 retains the unchanged C tests, real-header size/alignment/all-field-offset checks for any exposed layout, and symbol parity. Tier 3 compares the thin ABI shim and safe core against the original extracted C oracle, with bounded edge/random cases and a demonstrated mutation failure. Respect existing documented oracle exclusions; introduce no behavior changes here.
- Add Rust cases only to the existing Core state category (
soldr cargo test -p obs-data --test obs-tests-core), with the existing owningobs-hotkeysuite modules, never another Rust test executable. Link every real private adapter into affected standalone Rust-static consumers; never use aborting link stubs. Reject NULL owner tokens before field accessors where the original contract permits NULL. Rust through soldr, Python through uv; publication through ./push. - Tier 4 is inapplicable to this non-protocol extraction; keep the unchanged C++ WebSocket plugin compatibility contract. Exercise existing relevant black-box coverage if a later swap changes an externally observed protocol path.
Append points / lane HU / core: libobs/build/libobs.core+.h.c, libobs/build/modules.d/core.json and applicable existing source inventories. Proposed new coverage only: test/cmocka/test_hotkey_unregister_entry.c, its tests.d fragment and sorted test graph registration when needed. Later Rust append points: rust/obs-hotkey/src/lib.rs, src/ffi/mod.rs, existing category suite modules, per-unit export/source/oracle fragments and real-adapter link support. Every selected Scout D unit shares this physical core unity group: run at most one at a time and rebase between sibling landings.
Decisions
P2 / port / size:S / ready: one small deterministic extraction/characterization prerequisite, with no functional prerequisite on another unmerged conversion. The later Rust implementation and behavior fixes are separate work. Names above are proposed and may follow equivalent current conventions. All selected bodies live outside core-source, graphics and core-output unity groups; leave those busy groups and source/canvas/scene-item, graphics-backend and output/encoder instance implementations untouched. Refresh Ready/comments/open PRs before claiming. This issue is unclaimed; the scout posted no Claiming comment.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Nov 19, 2026
Claiming: prerequisite characterization and behavior-neutral hotkey unregistration entry extraction in pool slot obs-studio5 (branch test/5175-hotkey-unregister-entry). 1. Characterize the existing wrappers and record the missing extraction contract RED. 2. Extract the two public bodies verbatim and update sorted unity/test inventories. 3. Run native_build, focused dual-library Tier 2 including unrelated Rust-static targets, and lint; check sibling PR conflicts and backpressure before publication. First PR expected this session; the Rust swap will be a separate follow-up issue.
zackees commentedon Nov 19, 2026
Landed on master in #5197 (ade80e1): the hotkey unregistration entry points are characterized and extracted. The Rust swap is #5198.