Skip to content

obs-core: Port borrowed canvas video getter (#3945) - #3946

Merged
zackees merged 7 commits into
masterfrom
port/3945-canvas-video-getter
Nov 7, 2026
Merged

zackees merged 7 commits into
masterfrom
port/3945-canvas-video-getter

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Ports obs_canvas_get_video to obs-core, preserving the absent-mix and NULL-video results, exact borrowed pointer identity, and the original non-NULL canvas contract. It acquires no lock or reference and leaves canvas, mix, and token state unchanged. Video-info and channel lookup remain in C and outside this slice. There are no intended behavior or ABI changes.

Fixes #3945, a native child of #444. This follows the patterns in #3863 and #3943 without touching their branches.

Commit sequence: actual-library C characterization 8e5d037, separate building verbatim extraction 7021759, Tier 1 RED e9dc9fc, Rust GREEN 67168af, and allocation-backed oracle fixture correction ce499a4. RED fails the borrowed-video characterization at its intended stub with exit 101. The corrected C characterization was replayed at the C-only point and after extraction, and remains byte-for-byte unchanged throughout the Rust swap.

Rust owns the absent-mix selection. Two private C adapters expose only field addresses from the real canvas and mix layouts. The oracle includes the original getter and automatically discovered adapter; it calls no production libobs function. Real-header checks measure field-view size, alignment, and every field offset, plus the stored output pointer size and alignment. The new native registration entry selects only its own target. All new Rust cases belong to the existing Core state test executable.

Validation completed on the rebased tree:

  • Corrected C-only baseline and extraction each pass three repeats per library. The final unchanged Tier 2 characterization also passes three repeats against hybrid libobs and the C reference in the slot's warm Docker volume through docker_task_command. ldd proves both selected library paths; both dynamic export sets match exactly at 1,767 symbols.
  • All four Tier 1, layout, and differential tests pass. Fixed cases cover mix and token presence; randomized cases vary both flags and every token-byte value. Allocation-backed tokens satisfy C alignment requirements. Every output pointer and observable fixture state is compared.
  • Mutation forcing NULL causes both fixed-edge and randomized differential tests to fail with exit 101. Proptest persistence is disabled. The committed GREEN core was restored before the final successful gate.
  • Oracle discovery, native registration entries, native B2 portability, test-graph ordering, Rust README policy, and all ten build-group checks pass.
  • The whole native_build module passes all 153 tests. All 914 obs-util tests and both doctests pass. One earlier native-module attempt hit the existing runtime-staging test's OS ExecutableFileBusy error; its isolated rerun and the complete module rerun both pass without source changes.
  • GCC and Clang accept the getter, adapter, oracle, and C characterization with format-nonliteral warnings treated as errors inside the repository's Nix environment. Rust makes no blog call, so no blog link stub is needed.
  • Serial full lint passes with exit 0, including formatting and all configured Rust checks. One clud-review reviewer reports clean after the two alignment findings were corrected. Range-diff confirms the production implementation is unchanged by the fixture correction and rebases.

Evidence artifacts are under /home/niteris/.clud/tmp/tool-output/local-test-private/: local-test-qLKVjD.log is the corrected C-only baseline; local-test-Ufvtve.log is extraction; local-test-gikvxp.log is original RED; local-test-wyXfKo.log contains the corrected four-test pass and the recorded native ETXTBSY failure; local-test-wFTNhI.log is its isolated pass; local-test-w8OfIx.log contains the successful full native-module rerun, obs-util, final both-library Tier 2, and full lint. Corrected mutation evidence is local-test-53PhWy.log.

Test cost: 25 reduced-parity debug runs per new module. Tier 1 longest 0.012 seconds, peak RSS 11,092 KiB; layout/parity longest 0.017 seconds, peak RSS 15,776 KiB. Neither module starts its own threads; generated data and allocations are bounded.

The complete Tier 2 suite, full unittest entry point, native Windows/macOS runtimes, and local-gate attestation were not run. Tier 4 is inapplicable to this getter. Hosted PR CI remains the merge gate. Public headers, existing upstream C tests, WebSocket, workflows, and other workers' branches are unchanged. No feature-ledger entry applies to this behavior-preserving port.

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 borrowed video getter to obs-core

1 participant