Skip to content

libobs: Characterize and extract source type-info queries (Refs #4718) - #4728

Merged
zackees merged 2 commits into
masterfrom
test/4718-source-type-info-extract
Nov 11, 2026
Merged

zackees merged 2 commits into
masterfrom
test/4718-source-type-info-extract

Conversation

@zackees

@zackees zackees commented Nov 11, 2026

Copy link
Copy Markdown
Member

Refs #4718. The Rust swap is tracked separately in #4719.

What and why

obs_get_source_output_flags, obs_source_get_display_name and obs_is_source_configurable were embedded in obs-source.c.h, preventing a whole-file Rust swap. This prerequisite first characterizes their current behavior through actual libobs exports and public source registration, then moves all three bodies verbatim into libobs/obs-source-type-info.c.h. The new member includes the existing PCH and occupies sorted position in libobs.core-source+.h.c. All three use the existing extern get_source_info seam; there is no private static dependency or new adapter.

The new six-case cmocka test pins unknown/empty/exact IDs; NULL IDs in an observed live empty registry; exactly one get_name callback with non-NULL/NULL type_data and NULL/empty/raw/changing borrowed results; all 32 individual flag bits, zero and a valid mixed mask; and all 16 properties/properties2/defaults/defaults2 presence combinations without invoking callbacks. Defaults alone remain non-configurable. Duplicate registration retains the first type's metadata. IDs remain case-sensitive, byte-exact and NUL-terminated. No instances are created; the normal shutdown frees the registry. Populated-registry NULL IDs, no-core queries and a found record without get_name remain outside the C valid domain. This does not change the lookup/NULL policy owned by #4606 / #4608.

Characterization and extraction

Commit order is characterization 4d2096a61, then behavior-neutral extraction 45d479806 before attestation. Rust RED/GREEN, Tier 1, layout and Tier 3 differential/mutation coverage belong to #4719 after this lands; Tier 4 is inapplicable. There is no behavior change or user-visible feature.

Validation:

  • Before and after extraction, the identical new test and unchanged test_source_properties / test_source_theme_icon passed three repeats each against hybrid and C-reference libraries: 18 suite runs (96 cmocka case runs) per phase, no skips. ldd verified each loaded library. All 1,768 dynamic exports match in each phase.
  • A byte comparison confirms all three bodies verbatim, and the parent differs only by their removal and separating blank lines. All 10 build-group checks, pinned C/CMake formatting, soldr cargo fmt --all --check, diff checks and pinned self-review passed.
  • Exactly one full SOLDR_PORCELAIN=0 ./lint ran with a 1,800-second deadline and passed, exit 0, ending lane lint: ok (138.6s). Matching passing soldr Rust verdicts were reused; full lint was not repeated.

The initial exploratory fixture reused a stack ID buffer and therefore hit duplicate registration: registration retains the original unversioned-ID pointer. It was corrected to static per-ID storage before the characterization commit; the final before/after evidence uses identical corrected tests.

No existing C test, public header, Rust source, test-graph.json, native.rs, obs-websocket file or workflow changed. No new Rust test binary. Full Tier 2, native Windows/macOS execution and sanitizers were not run locally; hosted checks remain the merge gate. The current master push failure (43029874707) is the existing Ubuntu apt DNS outage, unrelated to this unit.

Checklist

🤖 Generated with Claude Code

@zackees
zackees enabled auto-merge November 11, 2026 18:18
@zackees
zackees added this pull request to the merge queue Nov 11, 2026
Merged via the queue into master with commit a4c9c53 Nov 11, 2026
40 checks passed
@zackees
zackees deleted the test/4718-source-type-info-extract branch November 11, 2026 18:47
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