Skip to content

libobs: Characterize and extract the source-type enumeration - #4884

Merged
rdoupe merged 2 commits into
masterfrom
test/4772-source-type-enum-rebased
Nov 16, 2026
Merged

rdoupe merged 2 commits into
masterfrom
test/4772-source-type-enum-rebased

Conversation

@rdoupe

@rdoupe rdoupe commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #4772. Carries zackees's branch test/4772-source-type-enum-extract (rebased onto master, authorship kept) after they handed it over on the issue.

What

  1. fd11636de test(libobs): test_source_type_enum characterizes obs_enum_source_types and obs_enum_input_types2 through the public API: empty registries (probed at startup before the built-in registrations), registry order across input/filter/transition/scene, a versioned input (enum_input_v3), bounds at num, num+1, UINT32_MAX and SIZE_MAX, borrowed-pointer identity across calls, no output writes on failure, and each of the four optional-output combinations of obs_enum_input_types2 on its own. Registered once in test/cmocka/build/test-graph.json.
  2. dce3fb737 refactor(libobs): moves only those two bodies, verbatim, from libobs/obs.c.h into libobs/obs-source-type-enum.c.h, with its own unity group core-source-type-enum (libobs/build/libobs.core-source-type-enum+.h.c, modules.d/core.json, LIBOBS_SOURCES.json). Signatures and behaviour unchanged.

No Rust swap (that is #4781), no edits to existing C tests or public headers.

Evidence

This is a characterization plus a behaviour-neutral move, so there is no failing state: the proof is the same tests passing before and after the move, on both libraries.

On the extraction commit (dce3fb737):

uv run rust/tools/linux-validate/run.py --repeat 1 --tests 'test_source_type_enum|test_source_registration'
== [OFF] tests load /build/tree/libobs-c-reference/libobs.so.30
100% tests passed, 0 tests failed out of 939
== [OFF] ctest --repeat until-fail:1 -R test_source_type_enum|test_source_registration
100% tests passed, 0 tests failed out of 2
== [ON] tests load /build/tree/libobs/libobs.so.30
100% tests passed, 0 tests failed out of 939
== [ON] ctest --repeat until-fail:1 -R test_source_type_enum|test_source_registration
100% tests passed, 0 tests failed out of 2

The characterization-only commit (fd11636de) result follows in a comment.

./lint: ok. ./push client lanes: client-lint, client-checks, client-test (x86_64 Linux) ok; unsigned, so ordinary PR CI runs.

Tiers: Tier 2 above. Tier 1 and Tier 3 apply to the later Rust swap (#4781). Tier 4 does not apply (registry queries, no protocol).

🤖 Generated with Claude Code

Ci-Attestation: {"at":1794801229,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":52,"stamp":"2daa0b42ca8f519451256d255b083f0e","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801229,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":52,"stamp":"a04c6c76f676f69ba7cecf8010e49933","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801229,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":52,"stamp":"56505f991077bfa37c1a528381596609","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801229,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":52,"stamp":"dc10e3b8163c58e2dd4184b5d49133ee","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"general/all/client-lint","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"9f90f435ec844804ac4a462d6c3f976f","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801229,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":52,"stamp":"9f0bb7641c7f3cd5458403c58bb4fb45","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"fdd40f68a1eaa6c6c28a071f72f9a956","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"a84354e5126de990aec2990cca551d26","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"3c325a9b874006009642e25dd42194e1","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"fd8ccbeb2a2205184482bcdc5f515c78","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"86f4e13f231bb93be6fb192610cf9756","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"38dcfd09b2cd1bb9bf49ca0a11ac2cc4","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"4c0ab791eb22a2d4210aa917c18c63f6","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"70cbc6f19af2e74e207c1dad40f2d94e","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"d3029d28c67c9befc5584247afbd24ea","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"402021c2dce5b3ec66d2e76455b7c02d","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"5944587d4a57c1e18ee0e20ea353f01a","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801176,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"740085cc06854ca66911221e0bf8d99393d563ab350a3cd197c4dec9a9564447","lane":"client-lint","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":10,"stamp":"a212991abea20564adfcf67bf882fe4d","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}
Ci-Attestation: {"at":1794801462,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"55f66237b24a23a5fb51648417d04aa2f5c2fe518eaa804cf07d573498eef704","lane":"client-test-x86_64-unknown-linux-gnu","parents":["fd11636de58d5e07f670e04f76dc78d4f87b97e7"],"secs":232,"stamp":"feb04be6b9a6a6ef82dbea17dba4c114","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"cb12facdaa4cff897be2239e85fa85ad38032b12","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-source-type-enum+.h.c","libobs/build/modules.d/core.json","libobs/build/source-sets.d/LIBOBS_SOURCES.json","libobs/obs-source-type-enum.c.h","libobs/obs.c.h","test/cmocka/build/test-graph.json","test/cmocka/test_source_type_enum.c"],"head":"cab0de8e10d26e6d1e16c24dd5f547a277406388","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":"3944420a51009328b7819c67dbdda25d833b6b2959715dc56268642860ed5e57","tree":"1adc4191bb5c7fb103fea0470bf2d85c77191dfd"}}
@rdoupe
rdoupe requested a review from zackees as a code owner November 16, 2026 03:57
@rdoupe rdoupe changed the title refactor(libobs): extract source-type enumeration verbatim (Refs #4772) libobs: Characterize and extract the source-type enumeration Nov 16, 2026
@rdoupe

rdoupe commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Before the move, on the characterization commit alone (fd11636de, the source-type bodies still in libobs/obs.c.h), same command:

uv run rust/tools/linux-validate/run.py --repeat 1 --tests 'test_source_type_enum|test_source_registration'
== [OFF] tests load /build/tree/libobs-c-reference/libobs.so.30
100% tests passed, 0 tests failed out of 939
== [OFF] ctest --repeat until-fail:1 -R test_source_type_enum|test_source_registration
100% tests passed, 0 tests failed out of 2
== [ON] tests load /build/tree/libobs/libobs.so.30
100% tests passed, 0 tests failed out of 939
== [ON] ctest --repeat until-fail:1 -R test_source_type_enum|test_source_registration
100% tests passed, 0 tests failed out of 2

So the new characterization and unchanged test_source_registration pass on both libraries before and after the extraction. PR CI: CI Gate ✅ green, with Tier 2 Linux (tests OFF and ON) and Windows passing.

@rdoupe
rdoupe added this pull request to the merge queue Nov 16, 2026
Merged via the queue into master with commit 992d117 Nov 16, 2026
42 checks passed
@rdoupe
rdoupe deleted the test/4772-source-type-enum-rebased branch November 16, 2026 05:08
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