Skip to content

obs-core: Port canvas borrowed getters and video presence (#3860) - #3863

Merged
zackees merged 7 commits into
masterfrom
port/canvas-readonly-getters
Nov 7, 2026
Merged

zackees merged 7 commits into
masterfrom
port/canvas-readonly-getters

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Ports obs_canvas_get_name, obs_canvas_get_uuid, obs_canvas_get_signal_handler and obs_canvas_has_video to obs-core. Preserves exact borrowed pointers, nullable fields, unchanged canvas state, and the required non-null canvas. A present mix still counts as video even when its video output is NULL. No intended behavior or public ABI changes.

Fixes #3860 (native sub-issue of #444). Channel lookup, video-info, lifecycle, rendering, mix management and scene operations stay outside this slice.

Commit sequence: C-only actual-library characterization 0bb0809, byte-for-byte C extraction 3597b61, Tier 1 RED 46f3d85, Rust GREEN 5cbfcb4. RED command: SOLDR_PORCELAIN=0 SOLDR_RUSTC_WRAPPER=none OBS_PARITY_CASES=reduced soldr cargo test -p obs-data --test obs-tests-core obs_core::canvas_readonly_getters::; exit 101, both new tests fail at todo!("#3860"). RED artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-L9Zbgs.log (recorded before the behavior-neutral rebase).

Rust owns field reads and mix-presence logic. The private C adapter only returns borrowed field addresses; Rust does not mirror the large canvas layout. The oracle compiles the original extracted getters and the adapter extracted verbatim, against the real obs-internal.h. The pointer-view layout checks measure size, alignment and all four offsets from that header. No hidden-symbol fragment is needed for the public getters; their exports fragment lists all four. There are no matching benchmark stand-ins. Public headers, existing upstream C tests and WebSocket are unchanged. The new C characterization remains unchanged by the Rust swap. No feature-ledger entry applies to a behavior-preserving port.

Validation:

  • All five new Tier 1/layout/Tier 3 tests pass at reduced parity. Fixed edges cover all 16 nullable-field/mix combinations, exact pointer identity, arbitrary bytes and unchanged canvas state; randomized names and UUIDs are bounded to 127 bytes. The existing Core state executable owns all new Rust tests.
  • 48 canvas-related Rust tests pass after restoring GREEN, command SOLDR_PORCELAIN=0 SOLDR_RUSTC_WRAPPER=none OBS_PARITY_CASES=reduced soldr cargo test -p obs-data --test obs-tests-core obs_core::canvas_. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-UtXQQx.log. The same 48 tests also pass after the rebase; artifact /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-1E9fAv.log.
  • Focused Tier 2 uses repository docker_task_command, this slot’s warm volume, actual hybrid libobs and /build/tree/libobs-c-reference. The unchanged C characterization passes three repeats per library before porting, after extraction, and after the swap. ldd proves each selected implementation; both dynamic export sets match exactly: 1,767 symbols. GREEN artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-ZuZgcN.log; baseline local-test-gmRfOC.log; extraction local-test-beAmBE.log in the same directory.
  • Mutation: inverting mix.is_some() makes characterized_edges and random_fields_match_c fail, exit 101. Proptest persistence is disabled. The exact GREEN source was restored and the 48-test run passed afterward. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-WD2T2s.log.
  • GCC in the Docker harness and host Nix Clang accept the new getter group and C characterization with -Wconversion -Wsign-conversion -Wfloat-conversion; Clang also uses -Werror -Qunused-arguments. Docker lacks Clang, so its replay ran on the host with the real private header and repository dependency headers. GCC artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-nxHkkF.log.
  • Build-group inventory: 10 checks pass; port metadata: 5; ported-source inventory: 4; graph sorting: 2; native inventory: 3. Native test-count expectation increases by one for the new actual-library test.
  • SOLDR_PORCELAIN=0 SOLDR_RUSTC_WRAPPER=none ./lint --fix exited 1 only at the documented soldr refusal to build the Dylint driver under clud (Dylint 6.2.0 has no pre-deployed driver for the selected nightly). Formatting, CI self-tests, workspace Clippy and all feature-specific Clippy lanes passed first. No toolchain workaround; hosted Fast Gate must supply Dylint. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-wfxCye.log. The earlier real native-inventory count failure was corrected and its three focused checks pass.
  • One primary clud-review reviewer inspected C, Rust, Python, metadata and docs: clean, no actionable findings.
  • Rebased on current master; git range-diff confirms all four commits unchanged and git merge-tree --write-tree --name-only origin/master HEAD reports no conflicts.

Test cost: 25 debug runs per new module, OBS_PARITY_CASES=reduced; Tier 1 longest 0.057 s, peak 11,052 KiB RSS; layout/parity longest 0.044 s, peak 16,892 KiB RSS. No own threads; generated allocations are bounded. Measurements include test process launch.

The full ./unittest/Tier 2 suite, native macOS/Windows runtime checks and local-gate attestation were not run. Hosted required checks remain the merge gate. Tier 4 is inapplicable to these read-only getters.

CI repair: rebased onto master 6d29998aa; MSVC C2065/C2057 in the new characterization fixture came from max_align_t, which its C headers do not provide. The borrowed, never-dereferenced signal token now uses built-in long double alignment; every test assertion remains unchanged. GCC and host Clang accept it with -Werror -Wformat -Wformat-nonliteral. The focused C characterization builds and passes against hybrid libobs and the C reference in this slot’s Tier 2 container. No upstream C tests or public headers changed.

Pool preflight repair: The new real-canvas layout fixture lacked conditional Windows pthread headers. RED and GREEN commits are retained; the new targeted portability regression fails before the dependency fix and passes after it. All seven exact native_build::canonical_rust_static_ registrations, all four master native portability tests, graph sorting and README policy pass. Strict host Clang (-Qunused-arguments -Wformat-nonliteral -Werror) and GCC checks pass on the new oracle/C fixtures. Evidence is in build_ci_audit/preflight/green/3863-results.json and its adjacent logs. Rebased the conflicting branch after #3880 merged, preserving master inventory assertions; range-diff retains port implementation/test patches and drops only obsolete absolute-count edits. No existing C assertions, public headers or WebSocket changed. Full lint, native runtimes and Tier 2 were not repeated for this mechanical dependency/configuration repair; hosted Fast Gate and required CI remain the gate. Serial lint on #3858/#3891 reached only the documented clud Dylint-driver refusal after earlier lanes passed. Replaced 878c65a with a627b5e using an exact force-with-lease. Head-pinned auto-merge is re-armed and the pool chaperone retains the handoff.

@zackees
zackees force-pushed the port/canvas-readonly-getters branch from bc4b915 to 5cbfcb4 Compare November 7, 2026 09:35
@zackees
zackees marked this pull request as ready for review November 7, 2026 09:38
@zackees
zackees enabled auto-merge November 7, 2026 09:38
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator / worker-pool chaperone. Verified GREEN head 5cbfcb4 is pushed; PR is ready and auto-merge is confirmed, awaiting required hosted checks. 48 canvas tests pass post-rebase, focused Tier 2 passes against both actual libraries with identical 1,767 exports, mutation is killed and one reviewer is clean. Local lint passed every earlier lane and stopped only at the documented soldr Dylint-driver refusal under clud; hosted Fast Gate supplies that check. Full evidence and limitations are in the final PR body.

@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased pool head 5cbfcb4 onto current master 19da800; exact force-with-lease pushed and remote head verified as 79a4daa. Range-diff preserves the four port patches with only the SDK-enabled native inventory count addition (425); all master assertions retained. Native inventory (3), graph ordering (2), graph slices (1), port metadata (5), build groups (10), diff-check and all 48 canvas Rust tests pass, including the five new layout/parity/getter tests. No port behavior changes. Series SOLDR_PORCELAIN=0 ./lint passed on #3870 (exit 0; matching passing Dylint verdict reused). Full Tier 2/native platform suites were not repeated. Head-pinned auto-merge confirmed; existing chaperone retains the handoff.

@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Continuing pool CI repair in slot obs-studio4. Windows job 128382681643 reports C2065/C2057 at the new characterization fixture: MSVC has no max_align_t for its _Alignas expression. Rebasing onto current master and fixing only the new fixture token alignment, preserving all assertions and the getter behavior. No upstream C tests or public headers change.

@zackees
zackees force-pushed the port/canvas-readonly-getters branch from 79a4daa to 878c65a Compare November 7, 2026 11:32
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

CI repair pushed at 878c65a (replaces 79a4daa; exact force-with-lease and range-diff checked). Windows job 128382681643 failed C2065/C2057 because the new fixture used max_align_t, unavailable in MSVC C headers. The borrowed, never-dereferenced signal token now uses built-in long double alignment; all characterization assertions are preserved. No upstream C tests or public headers changed. GCC and host Clang syntax checks pass with -Werror -Wformat -Wformat-nonliteral. The focused Tier 2 characterization builds and passes against hybrid libobs (0.05 s) and the C reference; all 48 canvas Rust tests pass (0.94 s). Native inventory, graph ordering, README, port metadata and diff-check pass. SOLDR_PORCELAIN=0 ./lint passes, including Dylint (354.7 s). Full Tier 2 and native Windows runtime were not repeated locally. Head-pinned auto-merge re-armed and autoMergeRequest confirmed. Handed back to the pool chaperone.

@zackees
zackees force-pushed the port/canvas-readonly-getters branch from 878c65a to a627b5e Compare November 7, 2026 12:34
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Pool preflight repair: The new real-canvas layout fixture lacked conditional Windows pthread headers. RED and GREEN commits are retained; the new targeted portability regression fails before the dependency fix and passes after it. All seven exact native_build::canonical_rust_static_ registrations, all four master native portability tests, graph sorting and README policy pass. Strict host Clang (-Qunused-arguments -Wformat-nonliteral -Werror) and GCC checks pass on the new oracle/C fixtures. Evidence is in build_ci_audit/preflight/green/3863-results.json and its adjacent logs. Rebased the conflicting branch after #3880 merged, preserving master inventory assertions; range-diff retains port implementation/test patches and drops only obsolete absolute-count edits. No existing C assertions, public headers or WebSocket changed. Full lint, native runtimes and Tier 2 were not repeated for this mechanical dependency/configuration repair; hosted Fast Gate and required CI remain the gate. Serial lint on #3858/#3891 reached only the documented clud Dylint-driver refusal after earlier lanes passed. Replaced 878c65a with a627b5e using an exact force-with-lease. Head-pinned auto-merge is re-armed and the pool chaperone retains the handoff.

@zackees
zackees added this pull request to the merge queue Nov 7, 2026
Merged via the queue into master with commit 704659d Nov 7, 2026
44 checks passed
@zackees
zackees deleted the port/canvas-readonly-getters branch November 7, 2026 14:43
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In review to Done in obs-rust Multiview Nov 7, 2026
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 libobs/obs-canvas.c.h read-only identity and video-presence getters to obs-core

1 participant