Skip to content

obs-source: Port async flag getters (#3872) - #3873

Merged
zackees merged 11 commits into
masterfrom
port/source-async-flag-getters
Nov 7, 2026
Merged

zackees merged 11 commits into
masterfrom
port/source-async-flag-getters

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Ports obs_source_async_unbuffered and obs_source_async_decoupled into the existing obs-source crate. Preserves independent stored flags, false NULL defaults and exact debug diagnostics. No intended behavior or public ABI differences.

Fixes #3872, native sub-issue of #444. Setters, atomic reads, locking, callbacks, references and lifecycle remain outside this slice. Original C implementation by Lain Bailey (OBS Project).

Commit sequence: actual-library C characterization d10519234; verbatim extraction 8164129d9; Tier 1 RED bb7a5a8c2; Rust GREEN 92416ba98. RED command: SOLDR_PORCELAIN=0 SOLDR_RUSTC_WRAPPER=none OBS_PARITY_CASES=reduced soldr cargo test -p obs-data --test obs-tests-core source::async_flag_getters:: exits 101: both tests panic at todo!("#3872"). RED artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-pBP7pP.log.

Rust owns getter decisions and log dispatch. A private C adapter returns borrowed field addresses; each Rust shim reads only its requested field under the original synchronization contract. Rust does not mirror obs_source. The exact production adapter is extracted into the oracle; real obs-internal.h supplies the source fixture and view layout. Both public symbols have their own export fragment. No hidden fragment or Windows benchmark stand-in applies. Public headers, existing C tests and WebSocket are unchanged. This behavior-preserving port needs no feature-ledger entry.

Validation:

  • Restored GREEN source regression: 1,104 passed, 0 failed, 5 ignored, exit 0, with OBS_PARITY_CASES=reduced soldr cargo test -p obs-data --test obs-tests-core source::. Includes all six new Tier 1/layout/Tier 3 tests. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-zxlDVS.log. Focused six-test GREEN artifact: local-test-DSjtou.log in the same directory.
  • New real-header checks measure view size/alignment/every field offset and C bool size/alignment. C owns complete fixtures; Tier 3 covers all four flag combinations, random independent flags, exact NULL diagnostics and byte-for-byte immutability of the entire source after each getter. No exclusions or intentional differences; proptest persistence is disabled. Global-log checks re-exec the existing Core state binary with an exact selector; output confirms one child test runs.
  • Focused Tier 2 uses repository docker_task_command and this slot's warm volume. The unchanged characterization passed three repeats against both actual libraries, before extraction, after extraction and after the Rust swap. ldd proves /build/tree/libobs-c-reference/libobs.so.30 and /build/tree/libobs/libobs.so.30 load respectively. Dynamic exports match exactly: 1,767 symbols. Artifacts: baseline local-test-0tMbuy.log, extraction local-test-QuIfil.log, post-swap local-test-JszEln.log, all under /home/niteris/.clud/tmp/tool-output/local-test-private/. Reproducer: /tmp/port-source2-tier2.py.
  • GCC and Clang accept the extracted group with -Wall -Wextra -Werror -Wconversion -Wsign-conversion -Wfloat-conversion, the real private header and dependency header roots. Clang uses -Qunused-arguments for the Nix wrapper's injected linker arguments.
  • Mutation: inverting both non-NULL flag results makes characterized_edges and random_fields_match_c fail, exit 101; exact GREEN was restored before the 1,104-test regression. Artifact: /tmp/port-source2-mutation.log.
  • Source-group, port-metadata, sorted native-graph and exact inventory checks: 20 passed. Native executable registered once in test-graph.json, tests.d only points there.
  • SOLDR_PORCELAIN=0 SOLDR_RUSTC_WRAPPER=none ./lint --fix exits 1 only at the documented soldr refusal to build the Dylint driver under clud. Formatting, all 350 CI self-test scripts, workspace Clippy and feature Clippy passed. No workaround; hosted Fast Gate must supply Dylint. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-GvMUnL.log. Standalone soldr cargo fmt --all --check also passed.
  • One primary clud-review reviewer: clean across Rust, C, Python, configuration and docs.
  • Fetched/rebased onto current origin/master immediately before final push; the extraction, RED and GREEN patches remain unchanged (git range-diff). The characterization registration retains master's new SDK-enabled inventory check and adjusts its exact count from 424 to 425; the normal count is 418. Sorted-graph and exact-inventory checks passed again after conflict resolution. Superseded pushed head: ebdb9899708e4538b1d5d04351e06db97f8f7888. git merge-tree --write-tree --name-only origin/master HEAD succeeds without conflicts. obs-source: Port deinterlace mode and field-order getters (#3861) #3862 is still open, so no sibling changes needed combining yet.

Test cost: 25 debug invocations per new module with reduced parity. Tier 1 longest 0.01 s, peak 10,560 KiB RSS; layout/parity longest 0.02 s, peak 15,356 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 runs and local-gate attestation were not run. Hosted required checks remain the merge gate. Tier 4 does not apply to plain field readers.

Manager repair of failed hosted validation (superseded head 92416ba98c6d59a0cca3236a53d044e8c30e865b):

  • Read macOS Rust, Apple Cross Lint, both native Tier 2, Linux Tier 2 and ASan failure logs. Downloaded ASan build artifact: its undefined-symbol set is exactly obs_source_async_flag_fields and blog, matching Windows Tier 2 and the 27 failing Linux links.
  • Reproduced the oracle callback's original Clang -Wformat-nonliteral error. A GNU/Clang printf format attribute on its declaration fixes the forwarder without suppressing diagnostics. The patched oracle passes Clang and GCC with -Werror -Wformat=2 and strict conversion warnings. This is the only oracle file changed in this PR.
  • Removed the stack-only characterization's unnecessary ${runtime} working directory, fixing macOS configuration when OBS_OUTPUT_DIR is absent.
  • New aborting support resolves uncalled getter dependencies pulled into unrelated source-step tests by Rust archive members. All 23 native-graph targets declare the real private-header dependencies; a deferred helper covers the four legacy targets and guards duplicate sources. The generic logging support is byte-identical to obs-source: Port deinterlace mode and field-order getters (#3861) #3862 and composed helpers avoid adding it twice. Existing C tests and actual getter characterization remain unchanged; the latter links the real libraries without stand-ins.
  • Focused Docker replay: 28 targets (all 27 formerly failing links plus unchanged characterization) pass three repeats against each actual library. ldd proves both paths, and 1,767 exports match. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-PmrsK8.log.
  • Focused Rust regression: all six tests pass, plus its exact-selector one-test child. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-yLeI5D.log.
  • Native graph, sorting, port metadata and exact inventory checks pass. No cache-code changes were made for infrastructure failures.

No full sanitizer or native macOS/Windows runtime replay was performed locally; hosted required checks remain the merge gate.

Final repair validation: formatters, CI self-tests and workspace/feature Clippy passed. The final Dylint stage exited 1 only because soldr refuses to build its driver under clud; the final three artifact lines confirm that documented environment refusal. No workaround. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-exvQAf.log.

Fetched/rebased current master immediately before repair push. Characterization, extraction and RED patches remain exact; GREEN differs only in README hunk context from current master. One repair commit follows them. The merge-tree check succeeds without conflicts. Repair head: 636da06e1162853a08c102ff3a0eb6c615f3141d; remote verified after a lease pinned to 92416ba98c6d59a0cca3236a53d044e8c30e865b. Claim rechecked without refusal or competing claim. The incremental repair review is clean.

Second hosted-CI repair: Windows Tier 2 job 128395702953 fails at libobs/util/threading.h with C1083 (pthread.h missing) while compiling source-async-flag-getter-link-stubs.c; it is a real build dependency failure, not LLP64/layout parity or infrastructure. #3862 independently found the same cause; its repair pattern is applied here without changing its branch. The 23 graph targets and legacy support helper now import OBS::w32-pthreads only on Windows. RED commit 5390d7b8a adds a regression check that failed all 23 graph targets and the helper (24 failures, exit 1; artifact /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-yUKIkd.log). GREEN commit ec63ee034 fixes these dependencies.

Also read newly failed macOS Rust job 128395702933: six registration contracts still expected one source or the old library count after the first link-support repair. Adapted the shared #3862 fix to the async support filename: exact ordered source lists, complete support-library suffix including the Windows condition, exact header sets and original library-prefix/count checks are all retained. No assertions were replaced with subset checks.

Validation: four native portability tests (including normal/SDK exact inventories), two graph ordering tests, native graph slices and all five port metadata checks pass. Seven canonical_rust_static_ registration tests pass in 0.04 seconds (local-test-6SFH5u.log); all six focused async getter tests and the exact-selector log child pass (local-test-Qvdhil.log). No new Rust test case/executable, generator or own threads. README record remains in its port-table row. Range-diff preserves all five prior commits exactly and adds only this RED/GREEN pair; merge-tree succeeds on current master. Runtime getters, existing C tests, public headers, workflows and websocket remain unchanged. Native macOS/Windows execution and full Tier 2 are left to required hosted CI. The claim-bot failure is outside the assigned build checks; no infrastructure rerun was needed.

SOLDR_PORCELAIN=0 ./lint passed formatting, CI self-tests and workspace/feature Clippy, then exited 1 only because soldr refuses to build the Dylint driver under clud. The final three log lines confirm this documented environment limitation. No workaround attempted; hosted Fast Gate must supply Dylint. Artifact: /home/niteris/.clud/tmp/tool-output/local-test-private/local-test-XcRkj0.log. Verified GREEN head: ec63ee034ed69f13d2c9750bd159116de48e5d81.

Pool preflight repair: The 23 existing link-support dependencies were correct, but the new characterization target still lacked Windows pthreads and its log callback lacked a printf annotation. The hosted claim-bot failure log reports integration HTTP 403; no code-job failure was present. 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/3873-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 ec63ee0 with 469e9d5 using an exact force-with-lease. Head-pinned auto-merge is re-armed and the pool chaperone retains the handoff.

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

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator. Verified GREEN head ebdb989 is pushed, PR is ready and auto-merge is enabled with that head pinned. Full validation evidence and the documented local Dylint environment refusal are in the final body. Per worker-pool instructions, retiring the clean slot without waiting on hosted checks. #3862 remained open at the final rebase; preserve both getter modules and native graph entries if it lands first.

@zackees
zackees force-pushed the port/source-async-flag-getters branch from ebdb989 to 92416ba Compare November 7, 2026 10:28
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Coordinator handoff update: final cleanup fetch found #3852 had just merged. Rebased by hand, preserving its SDK-enabled native inventory check and adjusting that exact count to 425 (ordinary count 418). Sorted graph and inventory checks pass. Range-diff confirms extraction, RED and GREEN patches unchanged; merge-tree is clean. Replaced ebdb989 with 92416ba using an explicit lease after listing replaced remote commits. Final body updated; auto-merge re-confirmed with the new head pinned. Retiring the clean slot now.

@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator after manager-directed repairs. Replaced 92416ba with verified head 636da06 using an explicit lease. All 27 formerly failing staticlib links plus unchanged characterization pass on both libraries (28 targets per mode, three repeats); six focused Rust tests pass. Format, CI self-tests and Clippy pass; only the documented local Dylint-driver refusal remains for hosted Fast Gate. Full repair evidence and limits are in the PR body. Auto-merge re-armed with match-head-commit; required CI is pending.

@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Second hosted repair: Windows Tier 2 job 128395702953 had C1083 for pthread.h from the real private headers included by async getter link support. Following the shared cause found by the #3862 worker, all 23 graph targets and the legacy helper now import Windows pthreads conditionally. RED 5390d7b reproduced 24 missing-dependency failures; GREEN ec63ee0 passes the check. Also repaired the six stale native registration contracts exposed by macOS Rust job 128395702933, retaining exact source order, header sets, library counts/prefixes and complete conditional support suffixes. Seven registrations, six focused getter/layout/parity tests plus the child, inventory, graph sorting/slices and metadata pass. SOLDR_PORCELAIN=0 ./lint passed earlier lanes and stopped only at the documented soldr Dylint-driver refusal (last three lines checked). Body contains artifacts and limits; native/full Tier 2 remains hosted. Explicit lease push verified and head-pinned auto-merge re-armed. Handed off to pool chaperone; no hosted-CI wait. Claim-bot failure ignored as assigned.

@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Pool preflight repair: The 23 existing link-support dependencies were correct, but the new characterization target still lacked Windows pthreads and its log callback lacked a printf annotation. The hosted claim-bot failure log reports integration HTTP 403; no code-job failure was present. 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/3873-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 ec63ee0 with 469e9d5 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
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 7, 2026
@zackees
zackees force-pushed the port/source-async-flag-getters branch from 469e9d5 to 0797609 Compare November 7, 2026 15:18
@zackees
zackees enabled auto-merge November 7, 2026 15:18
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased after the 14:43 UTC merges onto master 5de5b53, replacing 469e9d5 with 0797609. Kept both oracle extraction blocks and both portability groups; combined exact source-getter support with master’s ordered scene logging-stub lists and corrected scene detection for library counts. Later Windows header/dependency fixes retained. No semantic overlap. Passed whole native_build:: (113), portability (7), sorted graph (2), README (1), full CI self-tests, obs-c-oracle build and six reduced async getter Rust/layout/parity tests. soldr cargo fmt --all ran successfully before validation; diff check clean and range-diff reviewed. Explicit-lease push verified; auto-merge re-armed and confirmed. Manager’s later requested workspace fmt --check sweep was blocked by clud verify-ratio; reported to manager without bypass under worker rules. Handed off for hosted checks and queue observation.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 7, 2026
@zackees
zackees force-pushed the port/source-async-flag-getters branch from 918e0aa to 9acbffc Compare November 7, 2026 20:22
@zackees
zackees enabled auto-merge November 7, 2026 20:22
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased onto master 1f39fb9 after #3884 and #3912, preserving both field adapters, link-support source sets, Windows dependencies and independent inventory assertions. Every master native target field remains present. Characterization, extraction, RED and GREEN order is retained; range-diff reviewed. Replaced 918e0aa with 9acbffc using a pinned lease and verified the remote.

Passed: seven focused Tier 1/Tier 3 tests, whole native-build module, whole obs-util suite and doctests, oracle discovery, independent registration, portability, graph sorting, README and workspace formatting. GCC and Clang compiled the affected core-source unity group in Nix. Hosted CI, Tier 2 and Windows/macOS runtimes were not repeated. Head-pinned auto-merge re-armed; handed back to the pool coordinator.

@zackees
zackees added this pull request to the merge queue Nov 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 7, 2026
@zackees
zackees added this pull request to the merge queue Nov 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 7, 2026
@zackees
zackees force-pushed the port/source-async-flag-getters branch from 9acbffc to e547d63 Compare November 7, 2026 22:39
@zackees
zackees enabled auto-merge November 7, 2026 22:40
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased onto origin/master 6c7a15f after #3862, preserving both getter ports and the original RED-before-GREEN sequence. Replaced 9acbffc with e547d63 using an exact force-with-lease; remote head verified. All 23 shared native targets retain both supports in the exact independent-registration order with shared entries deduplicated.

Serial validation exited zero: six focused Tier 1/layout/Tier 3 tests and the isolated log child, oracle field discovery, registration entries, all 149 native_build tests, 914 obs-util tests and two doctests, Rust formatting, pinned clang-format through ./lint, native portability, graph sorting, README and async getter portability checks. The native core-source unity group compiles with both GCC and Clang in the sanitizer Nix shell. The first compile attempt used a missing generated-config directory; rerunning with this slot's existing Linux generated config passed. No guard refusals occurred.

Head-pinned auto-merge is re-armed. Handed back to the pool coordinator without waiting on hosted CI.

@zackees
zackees added this pull request to the merge queue Nov 7, 2026
Merged via the queue into master with commit 9d5477c Nov 7, 2026
39 of 40 checks passed
@zackees
zackees deleted the port/source-async-flag-getters branch November 7, 2026 23:11
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Needs fix to Done in obs-rust Multiview Nov 8, 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-source async flag getters to obs-source

1 participant