Skip to content

obs-scene: Port selected and locked item getters (#3855) - #3859

Merged
zackees merged 4 commits into
masterfrom
port/scene-item-state-getters
Nov 7, 2026
Merged

zackees merged 4 commits into
masterfrom
port/scene-item-state-getters

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Ports obs_sceneitem_selected and obs_sceneitem_locked into the existing obs-scene crate. Both preserve false for null and return their independent stored flag without mutating the item. Each shim reads only the requested field, preserving the C synchronization contract. No intended behavior differences, public-header changes or user-visible change.

Fixes #3855.

Commit sequence: C-only actual-library characterization 615a0b5ac; verbatim extraction dbb021191; Tier 1 RED adf87685c; Rust GREEN 670a04285. RED command SOLDR_PORCELAIN=0 SOLDR_RUSTC_WRAPPER=none OBS_PARITY_CASES=reduced soldr cargo test -p obs-data --test obs-tests-core scene::item_state_getters:: exited 101 with both tests failing at todo!().

The C reference retains the verbatim extracted functions in its ported source group. The public symbols use an export fragment; no hidden-symbol fragment is needed. Neither symbol has a Windows benchmark stand-in to remove. The Rust prefix ends before item_render; it does not model or borrow the opaque suffix. Size/span, alignment and every prefix field offset are measured from real C headers, including C long width. Parity uses complete C-owned items and checks null, independent flags, unrelated flags, arbitrary IDs and all item bytes after the getter calls. No public headers or existing C tests were edited.

Validation:

  • All five new Tier 1/layout/Tier 3 tests pass. All 351 scene Rust tests pass with OBS_PARITY_CASES=reduced (5.52 seconds).
  • Focused Tier 2 used docker_task_command and this slot’s warm volume to build libobs, libobs-c-reference and test_scene_item_state_getters. The new unchanged characterization passed three repeats against each library before extraction, after extraction and after the Rust swap. The pre-existing test_scene_canvas_characterization also passed three repeats against each library after the swap; an additional verbose run under Xvfb confirmed all 13 C cases passed in each library, with no startup skips. ldd confirmed both actual loader paths. Dynamic exports match exactly: 1,767 symbols.
  • GCC and Clang accept the extracted C group with -Wall -Wextra -Werror -Wconversion -Wsign-conversion -Wfloat-conversion, using the oracle dependency header shims. Clang needed -Qunused-arguments for the host Nix wrapper’s injected linker-only arguments; no source warning was suppressed.
  • Staged source-group inventory (10 tests) and port metadata (5 tests) pass.
  • Mutation: forcing the safe locked core to return false makes scene::item_state_getters_parity::characterized_edges fail at flags 0x2, with mismatch bit 8 (exit 101). Proptest persistence is disabled. The original core was restored byte-for-byte, and all five new tests passed again (exit 0).
  • SOLDR_PORCELAIN=0 ./lint --fix passes (267.5 seconds): formatting, all 349 CI self-test scripts, workspace and feature Clippy, and Dylints.

Test cost: 25 debug invocations of the five new tests, longest 0.08 seconds, peak RSS 16,260 KiB; no own threads and no new Rust test executable (existing Core state category).

The full ./unittest/Tier 2 suite, native macOS/Windows runs and a local-gate attestation were not run. Hosted PR CI remains the merge gate. Tier 4 does not apply to these field readers.

@zackees
zackees marked this pull request as ready for review November 7, 2026 09:05
@zackees
zackees enabled auto-merge November 7, 2026 09:05
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator/pool chaperone at verified head 670a042. Auto-merge is enabled with that head pinned; no hosted-CI wait was performed, per the pool assignment. Final body records RED/GREEN, passing focused Tier 2 and identical exports, mutation kill/restored GREEN, all 351 scene Rust tests and passing full lint. Full ./unittest, native macOS/Windows and local-gate attestation were not run. Please observe required checks and the merge queue from here.

@zackees
zackees added this pull request to the merge queue Nov 7, 2026
Merged via the queue into master with commit e53544d Nov 7, 2026
45 checks passed
@zackees
zackees deleted the port/scene-item-state-getters branch November 7, 2026 10:05
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.

rust: Port obs-scene item selected and locked getters to obs-scene

1 participant