Skip to content

rust: Port libobs/obs-output-total-bytes-query.c.h to obs-output #5208

Closed

Description

@zackees

Phase 6: port only obs_output_get_total_bytes in libobs/obs-output-total-bytes-query.c.h to obs-output after prerequisite #5203 lands. The prerequisite characterizes and extracts the C wrapper without changing behavior. Keep its new test_output_total_bytes_query.c and existing test_encoder_output_getters_characterization.c unchanged.

Preserve NULL output returning zero with the same debug diagnostic, callback presence before delay loads, short-circuit atomic delay-active/delay-capturing reads, zero without dispatch when delay is active and not capturing, and otherwise exactly one current callback receiving the exact context.data token (including NULL) and returning every bit of uint64_t. Do not eagerly snapshot callback/data/flags or add owner/data guards that change the C order. Do not mirror struct obs_output in Rust.

Start RED with safe-core assertion mirrors in the existing Core state category binary (soldr cargo test -p obs-data --test obs-tests-core), then GREEN. Thin FFI plus real private C adapters, with NULL owner checked before field-address formation, must preserve C atomic and pointer semantics. Keep extracted original C in the reference/oracle; add bounded edge/random Tier 3 call/result/state differential tests and demonstrate a killed mutation. Measure all real-header FFI layout fields used. Tier 2 runs the unchanged tests against hybrid/reference and verifies exact export parity. Tier 4 applies if exercising the existing WebSocket output status surface; preserve the unchanged C++ plugin and its v5 protocol.

Every real Rust-referenced C adapter must be linked into EVERY standalone *_rust cmocka consumer via per-unit link-support fragments. Never use aborting or placeholder adapters. Build every Linux *_rust target and run ci/windows_link_check.py for Windows MSVC and Darwin links; preserve all existing host conditions. Use c_long/c_ulong directly if they appear; their width differs across targets. No new Rust test executable, public-header edits, existing-C-test edits, WebSocket edits or workflow files. Publish through ./push, use Refs, follow pool backpressure and serialize conflicting queued graph/output-group changes.

Dependencies: #5203 must merge before the swap is ready for implementation. Proposed unit scope is one safe orchestration core/FFI module, per-unit export/hidden/source/oracle fragments and real adapter linkage; no behavior changes or adjacent output getter ports.

Prerequisite PR: #5207. Its verified head is 9ceffca. The C-only change has original-C baseline evidence, extraction RED/GREEN, 315 native_build tests, every Linux *_rust link, repeated reference/hybrid C tests and export parity, MSVC/Darwin links (including the new C fixture), one full lint and complete client proofs. Native Windows/macOS runtime and the later Rust-specific tiers remain to be verified by the swap.

Activity

  1. added
    port
    ready
    P2
    size:S
    on Nov 19, 2026
  2. rdoupe commented on Nov 19, 2026

    @rdoupe
    Collaborator

    Claiming: #5208

    Plan: safe-core mirror RED in the obs-tests-core binary, then the obs-output swap with a thin FFI over private C adapters (NULL owner checked first, callback presence before the delay loads, short-circuit delay reads, one dispatch with the exact context.data). Original C stays in the oracle for the Tier 3 differential; Tier 2 runs the unchanged tests against hybrid and reference.

  3. rdoupe commented on Nov 20, 2026

    @rdoupe
    Collaborator

    Done in #5223 (merged): obs-output-total-bytes-query.c.h now builds only in its ported group and the entry points are Rust on master. The PR said Refs, so closing by hand.

  4. moved this from In progress to Done in obs-rust Multiviewon Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2portreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions