Skip to content

build: consolidate Rust tests into one executable per category #1397

Closed

Description

@zackees

Problem

Rust test compilation and linking repeats across many executables. The earlier checkout had 37 targets; current master also includes native-build contracts. Empty per-crate unit harnesses and separate integration suites multiply compiler work.

Requested behavior

Use one executable per selected category, preserving assertions and test tiers. Keep thread-safe cases parallel, share locks for shared mutable state, and use exact-test subprocess re-execution for process-global hazards without compiling separate executables. Preserve the unchanged C++ OBS WebSocket plugin as a compatibility check.

Plan

  1. Enforce all unit/integration targets with a cheap manifest linter and independent Cargo inventory.
  2. Consolidate existing and newly landed native-build suites into the owning categories, preserving private tests and feature-gated contracts.
  3. Validate discovery, CI scope selection, formatting, Clippy, Dylint, and full tests; review before merging.
  4. After the quality sweep and successful CI, dispatch the existing daily beta release workflow as requested by the maintainer.

Decisions

Reduce executable compilations, not test cases. Preserve native feature gates and avoid serializing the entire suite. Release through release-rust.yaml, whose own full platform and packaged-artifact gates decide publication.

Activity

  1. zackees commented on Oct 18, 2026

    @zackees
    MemberAuthor

    Claiming: consolidate Rust test executables for #1397. Plan: (1) retain all category and native-build coverage, (2) enforce unit and integration target ownership, (3) run the quality sweep, full tests and lint, then open a PR. Initial PR expected in this session. Release follows successful merge and the existing release gate.

  2. added
    claimed
    on Oct 18, 2026
  3. zackees commented on Oct 18, 2026

    @zackees
    MemberAuthor

    CI follow-up

    PR run https://github.com/obs-rust/obs-studio/actions/runs/39104203194 passed lint, cross lint, native builds, and unchanged C tests against both implementations on all three platforms. The Windows/macOS Rust graphics differential tests failed:

    • The newly merged obs-graphics: vec2 ceil/floor round inline instead of calling libm (#1298) #1394 rounding edge case expects native C's quieted signaling NaN on Windows/macOS; the new Rust inline sequence preserved the signaling bit.
    • macOS paired trig differs by one ULP from separate Rust sin/cos calls. A Clang -target arm64-apple-macos11 -O2 assembly probe confirms C combines these into __sincosf_stret.

    Decisions: retain exact differential assertions and fix the Rust host boundary. Keep the upstream exhaustive rounding and edge tests in the existing graphics category executable, through the production safe API; disabling the old library harness must not drop them. Capture fixed macOS regression inputs in the existing category. No C tests, public headers, or OBS WebSocket changes.

    The Linux graphics suite, including all 2^32 rounding patterns, passes (202 cases, 4.95 seconds). Native platform validation follows in the next PR run.

  4. zackees commented on Oct 18, 2026

    @zackees
    MemberAuthor

    Native follow-up: run 39104977446 confirms signaling-NaN rounding and the exhaustive rounding tests pass on macOS, while the paired trig binding still fails exact parity. SDK/compiler review established why: the C oracle is unoptimized and calls scalar sinf/cosf; optimized Rust combines them into Apple's paired function, which may differ by one ULP.

    Commit 2015d81 preserves the scalar source operations with separate non-inlined safe Rust helpers. It removes the proposed custom ABI binding and all added unsafe code. Both fixed-input regression suites remain unchanged. Linux graphics (202 cases, exhaustive rounding included) and full lint pass. The existing independent reviewer rechecked the correction and reports clean; native confirmation is running in https://github.com/obs-rust/obs-studio/actions/runs/39105501275.

  5. zackees commented on Oct 18, 2026

    @zackees
    MemberAuthor

    Merge-queue follow-up: 39106986466 passed all native C compatibility jobs and Rust graphics, but Windows config_file_parity::parity_open_mutate_save failed once: C config_save_safe returned -2 while Rust returned0. The standalone PR run passed this property.

    Source review found a shared-process exposure: C stdio files are inheritable, and concurrent Windows child creation can retain an open target/temp handle after C closes its own copy, blocking ReplaceFileW. This is consistent with the failure; the original log did not capture the OS error, so it does not rule out external filesystem interference.

    Keep the exact property test name and all192cases/assertions, but run this one file-replacement property in the existing binary's isolated process before opening any files. Add best-effort OS-error diagnostics immediately after the C save call. No retries, relaxed assertions, new executable, C-test changes, or production-code changes. Linux utility528cases passed at32threads (14.27s); full lint/Dylint passed (26.7s); the existing independent reviewer reports clean. Native Windows confirmation remains pending.

  6. zackees commented on Oct 18, 2026

    @zackees
    MemberAuthor

    Fixed by #1398, merged through the queue after native validation.

    • Default Rust test executables:40→8; all declared targets including opt-ins:42→8. Library unit harnesses:17→2. Existing cases and all required tiers remain covered.
    • ./lint and CI enforce the exact category inventory and cross-check Cargo metadata, including implicit workspace members and feature-gated targets.
    • Thread-safe cases stay parallel. Profiler tests keep their lock; process-global state, C pipe hazards, crash probes and Windows file-replacement parity use exact-selected processes of the same executable.
    • Linux1280cases plus four documentation tests pass, with one existing ignored case. Native Windows/macOS Rust tests, cross lint and unchanged C compatibility tests pass in PR and merge-queue runs. Review is clean.
    • Test-only rebuild measurement:about22% faster with warm dependencies/two compiler jobs; the fresh eight-job build was flat. Scope and raw measurements are in docs/ci-evidence/2026-10-18-test-binary-consolidation.json.
    • The original C++ WebSocket compatibility directive is recorded; its code/pointer were not changed by this PR.

    No consolidation follow-up remains. The requested OBS beta is undergoing full package/runtime validation in https://github.com/obs-rust/obs-studio/actions/runs/39109915393. The missing published dependency was separately fixed by merged #1399; publication still waits for the release gate.

  7. zackees commented on Oct 18, 2026

    @zackees
    MemberAuthor

    Released: https://github.com/obs-rust/obs-studio/releases/tag/obs-studio-rust-v0.1.0-beta.20261018 (065fa7d). Final release run 39115087613 passed all builds, Rust/C compatibility suites, AppImage runtime tests on four distributions and Windows/macOS packaged startup checks. The checkout and release tag match; the category guard still reports exactly eight Rust test executables. Release blockers uncovered along the way were fixed by #1399 (published FFmpeg archive checksum), #1408 (shared Cargo preflight ordering), and #1413 (bounded owned-window discovery). OBS WebSocket plugin source and the user’s original submodule state remain preserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions