Skip to content

obs-core: Port borrowed global core getters (#3881) - #3885

Merged
zackees merged 4 commits into
masterfrom
port/core-global-getters
Nov 7, 2026
Merged

zackees merged 4 commits into
masterfrom
port/core-global-getters

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Ports obs_get_locale, obs_get_signal_handler, and obs_get_proc_handler into the existing obs-core crate. Rust reads borrowed pointer fields through three private typed field-pointer adapters; it does not mirror obs_core, allocate, acquire references, or take locks. Public headers and pointer identity stay compatible, including null stored fields.

The original C directly dereferences obs. These getters therefore retain their initialized-core precondition; calling them before initialization is undefined behavior in C, rather than a null-return contract. No intentional behavior differences or user-visible change.

Fixes #3881. Refs Phase 6 parent #444.

Commit order: actual-library C characterization 64f1d5caf, verbatim C extraction e5a90e0e7, Tier 1 RED 2322b865e, Rust GREEN da7dd0fab. The observed RED commit before rebase was 9e1b3cec0: all four safe-core tests failed at the stub under soldr cargo test -p obs-data --test obs-tests-core obs_core::global_getters:: (exit 101; artifact local-test-b6RBsF.log). The C characterization has not changed since its own C-only commit.

Validation:

  • Three unchanged actual-library C cases passed against both libraries before extraction, after verbatim extraction, and after the Rust swap. Loader proof selected /build/tree/libobs-c-reference/libobs.so.30 and /build/tree/libobs/libobs.so.30; dynamic exports matched exactly at 1,767 symbols. The focused Docker replay uses docker_task_command, this slot's warm volume, and upstream API version 33.
  • Four Tier 1 cases and one Tier 3 differential case passed, including the restored final rebased run (local-test-mmZG0y.log). The oracle compiles the verbatim extracted getter and production adapter bodies over test-owned pointer slots. Fixed and randomized cases compare exact pointer identity across null fields, aliases, independent changes, and repeated reads. No public struct layout is mirrored, so no new public-layout measurement is applicable.
  • Mutation: replacing the safe read with a panic makes global_reads_match_c fail (exit 101; local-test-WhnfmT.log). Proptest persistence is disabled. GREEN was restored exactly before further Docker work.
  • README port-table policy, sorted native graph, exact native inventory, and merge-tree checks pass. No public headers, existing C tests, or WebSocket files were changed; no new Rust test executable or workflow was added.

Test cost: 25 reduced-case debug differential runs, longest wall time 0.017 s, peak child RSS 16,184 KiB; no own threads. The existing Core state binary owns all five new tests. Tier 4 does not apply to these pointer reads.

The definitive rebased Docker replay again passes all three C cases per library, with loader proof and identical 1,767 exports. Targeted Clippy (soldr cargo clippy -p obs-data --test obs-tests-core -- -D warnings) exits 0 (local-test-iTubyd.log); changed Rust/C formatting and strict Clang/GCC checks of the oracle and C characterization pass. Range-diff preserves the characterization, extraction and RED patches; GREEN differs only in its finalized commit message. The latest master merge-tree is clean.

Full workspace/Tier 2 suites, native macOS/Windows execution, repo-wide Dylint, and local-gate attestation were not run for this final globals head; hosted PR CI remains the merge gate. The full lint invocation during the priority repairs passed earlier lanes and stopped at soldr's documented refusal to build the missing Dylint driver under clud; no tooling workaround was attempted.

Pool preflight repaired the merge conflict after #3880 by rebasing onto master and dropping the obsolete absolute inventory-count edits. Range-diff preserves all characterization, extraction, RED and GREEN implementation/test patches otherwise. No new RED is needed for this mechanical rebase; the original RED/GREEN sequence remains. All seven exact canonical Rust-static registrations, four master portability tests, graph sorting and README policy pass. Both new C sources pass strict Clang and GCC with -Wformat-nonliteral -Werror (Clang uses -Qunused-arguments); the oracle uses its two generated include extracts. No new private-header test/stub dependency applies to this PR. Full lint/native/Tier 2 execution was not repeated for this rebase. Evidence: build_ci_audit/preflight/green/3885-results.json and adjacent logs. Replaced da7dd0f with 7d80d34 using an exact lease; verified remote head and re-armed head-pinned auto-merge. Handed back to the pool chaperone.

@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Manager priority change: paused here at WIP GREEN cd2fb3e; keep this PR draft and do not arm it. RED-before-GREEN is preserved. Five focused Rust tests passed; the unchanged C characterization passed OFF/ON with ldd proof and identical 1,767 exports; Tier 3 killed the removed-read mutant. Final restored rerun/lint, rebase and final PR body remain before resuming.

@zackees
zackees force-pushed the port/core-global-getters branch from cd2fb3e to da7dd0f Compare November 7, 2026 11:42
@obs-rust-project-manager obs-rust-project-manager Bot moved this to In progress in obs-rust Multiview Nov 7, 2026
@zackees
zackees marked this pull request as ready for review November 7, 2026 11:44
@zackees
zackees enabled auto-merge November 7, 2026 11:45
@zackees
zackees force-pushed the port/core-global-getters branch from da7dd0f to 7d80d34 Compare November 7, 2026 12:40
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Pool preflight repaired the merge conflict after #3880 by rebasing onto master and dropping the obsolete absolute inventory-count edits. Range-diff preserves all characterization, extraction, RED and GREEN implementation/test patches otherwise. No new RED is needed for this mechanical rebase; the original RED/GREEN sequence remains. All seven exact canonical Rust-static registrations, four master portability tests, graph sorting and README policy pass. Both new C sources pass strict Clang and GCC with -Wformat-nonliteral -Werror (Clang uses -Qunused-arguments); the oracle uses its two generated include extracts. No new private-header test/stub dependency applies to this PR. Full lint/native/Tier 2 execution was not repeated for this rebase. Evidence: build_ci_audit/preflight/green/3885-results.json and adjacent logs. Replaced da7dd0f with 7d80d34 using an exact lease; verified remote head and re-armed head-pinned auto-merge. Handed back to the pool chaperone.

@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/core-global-getters branch from 7d80d34 to 52ab412 Compare November 7, 2026 15:00
@zackees
zackees enabled auto-merge November 7, 2026 15:01
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased after the 14:43 UTC merges onto master 5de5b53. Resolved the oracle build.rs conflict by retaining both canvas and core-global extraction blocks; other disjoint adapters, table rows and graph registrations merged intact. Range-diff preserves the original port/test patches. Whole native_build:: module (113 tests), portability (6), sorted graph (2), README (1), local_gate --only self-test, obs-c-oracle build and all five focused obs_core::global_getters unit/parity tests passed. An initial oracle attempt was refused while the native test held the target lock; the serial retry passed. Exact lease replaced 7d80d34 with 52ab412; remote verified and head-pinned auto-merge enabled. Full Tier 2 and native Windows/macOS were not rerun; hosted CI remains the merge gate.

@zackees
zackees force-pushed the port/core-global-getters branch from 52ab412 to 9daf94f Compare November 7, 2026 15:53
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased after #3849 onto e4571c5; replaced 52ab412 with 9daf94f using an exact lease. Kept both display and globals module declarations in rustfmt order. Range-diff shows only declaration-list context changes. Checks pass: workspace fmt, all native_build tests (127), portability (6), graph sorting (2), README (1), oracle build, globals Rust/parity (5), display Rust/parity/layout (6). Soldr refused the first concurrent display attempt due to the active build lock; the serial retry passed without changing safeguards. Auto-merge remains enabled. Hosted CI/full Tier 2 were not repeated locally; handed back to the pool manager.

@obs-rust-project-manager obs-rust-project-manager Bot moved this from In progress to Needs fix in obs-rust Multiview Nov 7, 2026
@zackees
zackees force-pushed the port/core-global-getters branch from 9daf94f to c4fe97e Compare November 7, 2026 18:37
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased onto master 8e406b2 after #3916/#3920/#3919, replacing 9daf94f with c4fe97e using an exact lease. Kept sibling unity includes in sorted order. Removed manual field-adapter extraction and changed the oracle include to discovery-generated core_global_fields.inc; retained explicit extraction of the non-adapter getter body. No shared registration additions or production-getter dependencies required repairs. All requested checks pass: discovery/registration guards, workspace fmt, whole native_build (129), oracle build, obs-util (914 plus doctests), focused global Rust/parity (5), portability, sorted graph, README, build groups, and local-gate self-test. First native run had 128 passes and one OS Text file busy error in the staged-executable fixture; whole-module retry passed. Range-diff reviewed; remote head verified and auto-merge remains enabled.

@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 failed status checks 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/core-global-getters branch from c4fe97e to 37c2ef7 Compare November 7, 2026 21:28
@zackees
zackees enabled auto-merge November 7, 2026 21:28
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current master, replacing c4fe97e with 37c2ef7. Preserved master’s hotkey identity adapter and the getter field adapter, with characterization, extraction, RED and GREEN order intact. Focused Tier 1 and Tier 3 tests, oracle discovery, registration inventory, all 148 native-build tests, 914 utility tests and both doctests, workspace formatting, portability, graph sorting and README checks pass. The conflicted core group compiles with GCC and Clang in the Nix environment; Clang allows the existing GNU variadic-macro extension. Exact-lease push verified and head-pinned auto-merge re-armed. Hosted CI and full Tier 2 were not rerun locally. Handed back to the pool coordinator.

@obs-rust-project-manager obs-rust-project-manager Bot moved this from Needs fix to In review in obs-rust Multiview Nov 7, 2026
@zackees
zackees added this pull request to the merge queue Nov 7, 2026
Merged via the queue into master with commit e1169a8 Nov 7, 2026
40 checks passed
@zackees
zackees deleted the port/core-global-getters branch November 7, 2026 22:48
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In review 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 libobs/obs-core-global-getters.c.h to obs-core

1 participant