Skip to content

obs-scene: Port obs_sceneitem_group_enum_items to Rust (Refs #4724) - #5051

Merged
rdoupe merged 3 commits into
masterfrom
port/4724-scene-group-enum-rust
Nov 18, 2026
Merged

rdoupe merged 3 commits into
masterfrom
port/4724-scene-group-enum-rust

Conversation

@rdoupe

@rdoupe rdoupe commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Ports obs_sceneitem_group_enum_items (libobs/obs-scene-group-enum.c.h) to obs-scene. Refs #4724. This continues zackees' port/4724-scene-group-enum branch (authorship kept), now on master after the extraction (#4982) landed.

The Rust wrapper reuses the Rust group-scene getter (NULL and non-group checks before any source read) and calls the existing C obs_scene_enum_items exactly once for a present scene, passing callback and param through unchanged, NULL included. Snapshot, removal, order and early stop stay in the C enumerator. The C file moves to libobs.ported-scene-group-enum for the C reference build.

Commits

  1. RED (c9bab75): Tier 1 safe-core cases mirroring the unchanged test_scene_group_enum_items, against a todo!() stub.
  2. GREEN (f89ecc5): the core, the extern "C" shim, Tier 3 parity against the original wrapper, the export list and the source move.
  3. Fit to current master (a428359). Master changed under the branch since it was written:
    • the canvas-move oracle (rust: Port canvas scene migration to obs-core (Refs #4774) #4899) also stands in for obs_scene_enum_items under its libobs name, so the link had two definitions. One oracle/scene_enum_items.c now hands the call to whichever probe is running on the thread.
    • the transform-states link stand-ins defined obs_sceneitem_group_enum_items, which obs-scene now exports. That stand-in goes.
    • transform_states.rs declared obs_scene_enum_items with a different signature (rustc clashing_extern_declarations warning). It now calls the crate's one declaration and the Rust group enumerator.
    • the extract is registered in oracle.d/scene-group-enum.list instead of build.rs.

Evidence

  • RED, at c9bab75: soldr cargo test -p obs-data --test obs-tests-core scene::group_enum → 0 passed; 5 failed (each panics at rust/obs-scene/src/group_enum.rs:6, the stub).
  • GREEN, at the tip: soldr cargo test -p obs-data --test obs-tests-core -- scene:: canvas_move → 607 passed; 0 failed, no warnings.
  • Tier 3 mutation: making the shim pass a NULL param instead of the caller's fails group_enum_parity::characterized_edges (bits=0x209) and matches_original_c.
  • Tier 2 (OBS_CTEST_JOBS=10 uv run rust/tools/linux-validate/run.py --repeat 1 --tests 'test_scene_group|test_scene_transform_states|test_canvas_move|test_scene_dup'): full suite 978/978 on the C reference and 978/978 on hybrid libobs, plus the 9 targeted tests (including test_scene_group_enum_items, test_canvas_move_scene, test_scene_transform_states) passed on both; the exported-symbol comparison passed. C tests unchanged.
  • ./lint passes. Tier 4 does not apply.

No intentional differences.

🤖 Generated with Claude Code

zackees and others added 3 commits November 18, 2026 00:43
…ve port (Refs #4724)

Master changed under the group enumeration swap in three ways:
- the canvas-move oracle (#4899) stands in for obs_scene_enum_items under
  its libobs name, as the group-enumeration oracle does;
- the transform-states link stand-ins define obs_sceneitem_group_enum_items,
  which obs-scene now exports itself;
- whole-source oracle extracts are registered in oracle.d, not build.rs.

One obs_scene_enum_items in oracle/scene_enum_items.c hands the call to the
canvas-move or group-enumeration probe running on this thread. The link
stand-in for the ported symbol goes. transform_states.rs calls the crate's
own group enumerator and its one obs_scene_enum_items declaration, so the
extern declarations no longer clash. The extract moves to
oracle.d/scene-group-enum.list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ci-Attestation: {"at":1794982451,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":57,"stamp":"4ca0d9e9d195fdbb8dd0f1c0296ba9aa","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982451,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":57,"stamp":"4ba6b119f800447da79df2774eb1ff40","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982451,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":57,"stamp":"16991ad9f31765eb5b9707f172ebdce9","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982451,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":57,"stamp":"7e18f12fe4286d14966eb18557d0c6b3","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"general/all/client-lint","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"78f957b8a97460ff597e6d81150ab5a1","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982451,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":57,"stamp":"a2a593c0cf4d45bf0310d18221ffebaa","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"e229858f5e22173416b3d3d39395fe52","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"a5668c7af7f0aef96801da0c6f738330","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"cf3aaa14ca2e7b29cdcf40a1fc3e659d","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"240441a4f2157130e7ef2ee18e673b98","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"b56d9f8b25fb66099b92777b87a41b81","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"b6e375dcf02aa74d79f7a6e80981008b","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"7bacb03577a6709c93690b90cb761686","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"cdccdb12463fac909dde5775b7f7c47b","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"4b3e2540b08c7735f95b412b408070ea","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"8e93821aa94116bf144a6fac0e853103","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"c3f082f81d3d670be41c1f09fe9c9d5d","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982394,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"4668be0008b9f096e158265a14a5f2d9325385f4fe72cbb5bf388116d5851a32","lane":"client-lint","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":91,"stamp":"485dc600e1e976345ca2a8bde6539e4f","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}
Ci-Attestation: {"at":1794982661,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"f518209902bdc94a4586d2297c7057b1b62e146b875346f04e280f903b3f8f8e","lane":"client-test-x86_64-unknown-linux-gnu","parents":["f89ecc57708308128f42159b3d9479587af832b5"],"secs":209,"stamp":"44ecd53d46ab968feb01b3bbd9783675","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"f5734b90819fb75d6a0681add2283191e0fa032d","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core+.h.c","libobs/build/libobs.core-output+.h.c","libobs/build/libobs.core-source+.h.c","libobs/build/libobs.ported-scene-group-enum+.h.c","libobs/build/libobs.ported-ui-task-handler+.h.c","libobs/build/ported-source-sets/scene-group-enum.json","libobs/build/ported-source-sets/ui-task-handler.json","libobs/cmake/rust-exports.d/obs-core-ui_task_handler.txt","libobs/cmake/rust-exports.d/obs-scene-group_enum.txt","libobs/cmake/rust-hidden.d/obs-core-ui_task_handler.txt","libobs/obs-encoder-get-name.c.h","libobs/obs-encoder.c.h","libobs/obs-internal.h","libobs/obs-ui-task-handler-fields.c.h","libobs/obs-ui-task-handler.c.h","libobs/obs.c.h","rust/README.md","rust/obs-build/tests/native.rs","rust/obs-build/tests/native/registration/canonical_ui_task_handler_is_registered.rs","rust/obs-c-oracle/oracle.d/obs-ui-task-handler.list","rust/obs-c-oracle/oracle.d/scene-group-enum.list","rust/obs-c-oracle/oracle/canvas_move.c","rust/obs-c-oracle/oracle/scene_enum_items.c","rust/obs-c-oracle/oracle/scene_group_enum.c","rust/obs-c-oracle/oracle/scene_transform_states_links.c","rust/obs-c-oracle/oracle/source_profiler_host.c","rust/obs-c-oracle/oracle/ui_task_handler.c","rust/obs-core/src/ffi/mod.rs","rust/obs-core/src/ffi/ui_task_handler.rs","rust/obs-core/src/lib.rs","rust/obs-core/src/ui_task_handler.rs","rust/obs-core/tests/obs_core/main.rs","rust/obs-core/tests/obs_core/ui_task_handler.rs","rust/obs-core/tests/obs_core/ui_task_handler_parity.rs","rust/obs-scene/src/ffi/group_enum.rs","rust/obs-scene/src/ffi/mod.rs","rust/obs-scene/src/ffi/transform_states.rs","rust/obs-scene/src/group_enum.rs","rust/obs-scene/src/lib.rs","rust/obs-scene/tests/scene/group_enum.rs","rust/obs-scene/tests/scene/group_enum_parity.rs","rust/obs-scene/tests/scene/main.rs","test/cmocka/test_encoder_get_name.c","test/cmocka/tests.d/test_encoder_get_name.cmake"],"head":"5444655a264e146fe97cfb259c3b018801db8bcc","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.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-GITv2.15.4\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"01bed513337700797a17020ffe42a044c28736b40bdb04d7411053daabdaf8d1","tree":"4d31822cd4d13013c6eb46c4dc48cff1e27eb935"}}
@rdoupe
rdoupe requested a review from zackees as a code owner November 18, 2026 06:17
@rdoupe rdoupe changed the title fix(obs-scene): share the oracle scene enumerator after the canvas-move port (Refs #4724) obs-scene: Port obs_sceneitem_group_enum_items to Rust (Refs #4724) Nov 18, 2026
@rdoupe
rdoupe added this pull request to the merge queue Nov 18, 2026
Merged via the queue into master with commit a3a58f0 Nov 18, 2026
43 checks passed
@rdoupe
rdoupe deleted the port/4724-scene-group-enum-rust branch November 18, 2026 07:28
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.

2 participants