Skip to content

obs-core: Port synchronized display size getter (#3911) - #3912

Merged
zackees merged 4 commits into
masterfrom
port/display-size
Nov 7, 2026
Merged

zackees merged 4 commits into
masterfrom
port/display-size

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #3911, native sub-issue of #444; follows #3848/#3849.

Ports only obs_display_size into obs-core. Both outputs are zeroed before checking the display or taking its existing draw_info_mutex. Width and height retain their original read/store order, including aliased outputs and outputs aliasing a display field. C wrappers take and release that exact mutex; a private field-pointer seam leaves the complete display and native mutex layouts in C. No intended behavior differences or protocol surface, so Tier 4 is inapplicable and no features-ledger change is needed.

Commit sequence:

  • Characterization d9b8068ba: new C actual-library tests for NULL, full-width dimensions, aliasing, unrelated fields, and another thread holding draw_info_mutex.
  • Extraction 80bd26198: verbatim C body in a separate building, behavior-neutral commit; unchanged characterization passes both libraries.
  • RED 71ff15f57: both Tier 1 tests fail at the todo stub (exit 101).
  • GREEN 9b0a26382: safe protocol, opaque FFI seam and C lock wrappers; existing Core state test binary gains six cases, with no new Rust executable.

Validation:

  • Tier 1/real-header layout/Tier 3: six focused tests pass. Randomized parity disables proptest persistence; boundary and aliasing cases always run. Concurrent writers use the same C-owned mutex.
  • Mutation replacing the height read with width fails boundary, randomized and concurrent parity (three failures, exit 101); restoring GREEN passes all six.
  • Unchanged Tier 2 test_display_size: 2/2 assertions groups pass against reference and hybrid, including 100 consecutive CTest runs per library. ldd selects /build/tree/libobs-c-reference/libobs.so.30 and /build/tree/libobs/libobs.so.30 respectively. Warm-volume builds run through docker_task_command; 1,767 identical exports.
  • Focused TSan via nix-shell rust/tools/sanitize/shell.nix, SOLDR_PORCELAIN=0, OBS_BUILD_NUMBER=1: actual-library characterization passes 2/2 with halt_on_error=1; loader confirms libtsan and instrumented hybrid libobs. This checks the C fixture and C lock wrappers; Rust itself is not TSan-instrumented by the stable build.
  • Host GCC and Clang accept oracle and characterization with -Wformat -Wformat-nonliteral -Werror (Clang -Qunused-arguments, real SIMDe includes). No printf-style callbacks or blog dependency are introduced.
  • Whole native_build:: module: 127 passed. ci/test_native_b2_portability.py, ci/test_test_graph_sorted.py, ci/test_rust_readme.py and staged build-group inventory pass.
  • Independent clud-review: clean; independently reran all six focused tests.
  • SOLDR_PORCELAIN=0 soldr cargo fmt --all --check: passed.
  • Full ./lint exit 1, diagnostic_state unknown: final artifact lines show soldr refusing to build a Dylint driver from source under clud (Dylint 6.2.0 has no pre-deployed driver for nightly-2026-05-28). No workaround attempted. Every preceding lane passed: C/CMake formatting, Ruff, all 356 CI self-test files, category/feature inventories, platform/performance/knowledge checks, rustfmt, workspace Clippy and all five feature Clippy runs. Hosted Fast Gate must supply the remaining Dylint result; no local attestation is claimed.

Test cost: 25 reduced runs of all six focused tests: longest 0.018 s, peak RSS 16,332 KiB (child rusage). One C writer thread at a time, two sequential writer launches in the concurrent test. The C contention fixture launches one getter thread and uses a bounded condition-variable wait; no sleeps.

Limits: no native Windows/macOS execution and no complete Tier 2 suite run claimed. Existing C tests, public headers, and plugins/obs-websocket are unchanged. Remaining display lifecycle, callback and rendering groups remain outside this slice.

@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased onto master 8e406b2 after #3916/#3920/#3919. Dropped the handwritten display field extraction: discovery generates display_size_fields.inc matching the oracle include. No shared registration-list additions to migrate; oracle has no direct production libobs calls. Passed discovery/registration guards, workspace fmt, whole native_build module (129), oracle build, obs-util (914 plus two doctests), all six focused display_size Rust/parity tests, portability, graph ordering, README and local-gate self-tests. Range-diff reviewed; lease-pushed dfeab35, remote verified, auto-merge remains enabled. No hosted CI wait or local attestation claimed.

@zackees
zackees added this pull request to the merge queue Nov 7, 2026
Merged via the queue into master with commit 1f39fb9 Nov 7, 2026
44 checks passed
@zackees
zackees deleted the port/display-size branch November 7, 2026 20:04
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Needs fix 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-display.c.h synchronized size getter to obs-core

1 participant