Skip to content

obs-output: Port encoder counter accessors (#3856) - #3858

Merged
zackees merged 8 commits into
masterfrom
port/encoder-state-accessors
Nov 7, 2026
Merged

zackees merged 8 commits into
masterfrom
port/encoder-state-accessors

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Ports obs_encoder_get_encoded_frames and obs_encoder_get_pause_offset to obs-output, preserving exact counter values, NULL defaults, unchanged state, and the historical encoded-frame log name obs_output_get_encoded_frames. No intended behavior or public ABI differences.

Fixes #3856 (native sub-issue of #444). Other encoder accessor groups remain listed in that issue.

Commit sequence: C-only actual-library characterization 59edb8c, byte-for-byte C extraction 9d02c38, Tier 1 RED 51e625b, Rust GREEN 1dc7493. RED command SOLDR_PORCELAIN=0 SOLDR_RUSTC_WRAPPER=none soldr cargo test -p obs-data --test obs-tests-core output::encoder_counters:: exited 101: both tests failed at todo!("#3856"). RED artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-k0U9st.log.

Rust owns the public getters, null/default decisions and logging. The C adapter only returns borrowed field addresses, avoiding a Rust mirror of the large private encoder layout. The adapter is extracted verbatim into the oracle build; the original C getter source remains in its own C-reference ported group. Both Rust symbols are public and registered in rust-exports.d; no Rust hidden-symbol fragment is needed. No matching Windows benchmark stand-ins existed. Public headers, existing C tests and WebSocket are unchanged. No feature-ledger entry applies to this behavior-preserving port.

Validation:

  • Final restored-GREEN encoder regression run: 358 passed, exit 0, with OBS_PARITY_CASES=reduced soldr cargo test -p obs-data --test obs-tests-core output::encoder. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-0qYTgK.log.
  • Six new Tier 1/layout/Tier 3 tests pass at reduced parity. Real obs-internal.h supplies the view size, alignment and every field offset. C-allocated real-layout encoder fixtures check boundary/full-width and randomized counters, unchanged counter and pause state, and isolated NULL log behavior.
  • Focused Tier 2 uses the repository docker_task_command, this slot's warm build volume and actual libobs/libobs-c-reference. The unchanged characterization passes three repeats against each library before and after the swap. ldd confirms each implementation is loaded. Dynamic export sets match exactly: 1,767 symbols. Post-swap artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-bnr7mn.log.
  • GCC and Clang accept the extracted source group with -Wconversion -Wsign-conversion -Wfloat-conversion; Clang retains harmless host-wrapper injected linker-argument warnings during syntax-only compilation.
  • Mutation: replacing the non-null frame result with zero makes both characterized_edges and random_counters_match_c fail, exit 101 (two passed, two failed). Persistence is disabled; the exact GREEN source was restored. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-Cyoo6m.log.
  • Source-group inventory: 10 tests pass; port metadata: 5; benchmark stand-in inventory: 3.
  • SOLDR_PORCELAIN=0 SOLDR_RUSTC_WRAPPER=none ./lint --fix exited 1 only at the documented soldr refusal to build the Dylint driver under clud (v6.2.0 has no deployed driver for the pinned nightly). Every earlier formatting, 349 CI self-test scripts and workspace/feature Clippy lane passed. No toolchain workaround; hosted Fast Gate must supply Dylint. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-Uc5VOU.log.
  • One primary pre-push clud-review reviewer: clean, no actionable findings.

Test cost: 25 debug runs per new module with OBS_PARITY_CASES=reduced; Tier 1 longest 0.05 s, peak 11,952 KiB RSS; layout/parity longest 0.11 s, peak 17,136 KiB RSS. No own threads; one isolated child process for global-log probes. Existing Core state binary only.

The full ./unittest/Tier 2 suite, native macOS/Windows validation and local-gate attestation were not run. Hosted required PR checks remain the merge gate. Tier 4 does not apply to these counter readers.

Pool preflight repair: RED e0a4f223f fails both portability regressions; GREEN 0cd38a7e7 adds the new C fixture's printf callback annotation and conditional Windows pthread header dependency, preserving every assertion. The seven native_build::canonical_rust_static_ tests pass (local-test-esK6Kk.log), as do native portability, graph sorting, README and both new portability regressions. Strict host Clang and GCC syntax checks pass for the new oracle and characterization with -Wformat-nonliteral -Werror (Clang uses -Qunused-arguments). Serial ./lint --fix passes earlier lanes and stops only at the documented clud Dylint-driver refusal (local-test-Djq93U.log); hosted Fast Gate must supply Dylint. Full native runtime/Tier 2 suites were not repeated for this annotation/dependency repair.

@zackees
zackees marked this pull request as ready for review November 7, 2026 09:05
@zackees
zackees enabled auto-merge November 7, 2026 09:05
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator / pool chaperone. Verified GREEN head 1dc7493 is pushed, ready, and auto-merge is enabled with that head pinned. Final local encoder run: 358 passed; unchanged C characterization passes 3x against each library; all 1,767 exports match; deliberate mutant killed. Lint stops only at the documented soldr Dylint-driver refusal under clud; earlier lanes passed. Full local suite and native runtime validation are not claimed. Hosted checks remain pending; not waiting on them per pool assignment.

@zackees
zackees force-pushed the port/encoder-state-accessors branch from 1dc7493 to bd8e987 Compare November 7, 2026 10:01
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased assigned head 1dc74935b9b15d9eec4e1abc24c670bc00e7772f onto master d5428c98d093c45e531a303d57e5d2f5046172e1; new verified pushed head bd8e9879c70e044b225f082cfd90ef61165f11c0. Retained both README records and all registrations. Range-diff changes only context; encoder implementation/tests/oracle are byte-identical to the old head. Focused owning category output::encoder: 358 passed, exit 0 (artifact local-test-IbHitk.log). Graph/build inventory: 16 passed, exit 0 (local-test-Ltomhn.log). Exact force-with-lease used; head-pinned auto-merge confirmed. Full unittest/Tier 2 and native runtime suites were not repeated for this mechanical rebase. Existing pool chaperone retains the handoff.

SOLDR_PORCELAIN=0 ./lint exited 1, diagnostic_state unknown: artifact local-test-s7DvSb.log ends only with the documented soldr Dylint-driver build refusal under clud. Earlier formatting, Python and workspace/feature Clippy lanes passed; hosted Fast Gate must provide Dylint.

@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Pool preflight repaired the remaining strict-Clang failure: the new characterization log callback lacked its printf annotation (oracle was already annotated). Also added conditional OBS::w32-pthreads for its private encoder layout. RED e0a4f22 fails two regressions; GREEN 0cd38a7 passes both; seven exact registration tests and all three requested Python checks pass. Both GCC and Clang accept oracle and characterization with -Wformat-nonliteral -Werror. All assertions preserved. Lint stops only at documented clud Dylint-driver refusal after earlier lanes pass (local-test-Djq93U.log). Replaced c9494b5 with e141913 using an exact lease; original patches unchanged. Full native/Tier 2 runtime not repeated. Handed back to the pool chaperone after head-pinned auto-merge re-arming.

Merged via the queue into master with commit 93b0c20 Nov 7, 2026
44 checks passed
@zackees
zackees deleted the port/encoder-state-accessors branch November 7, 2026 14:42
@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 obs-encoder.c.h counter accessors to obs-output

1 participant