Skip to content

build: unify the native C test graph for Cargo and CMake - #1805

Merged
zackees merged 54 commits into
masterfrom
infra/1332-canonical-native-tests
Oct 22, 2026
Merged

zackees merged 54 commits into
masterfrom
infra/1332-canonical-native-tests

Conversation

@zackees

@zackees zackees commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Current rebase evidence — f6b0c2512

Rebased onto master 72a5b5fe0 after GitHub reported a conflict following #1831. Its new protocol-list test is preserved in the canonical graph, including original sources/order, includes, libraries, sanitizers and command; upstream C tests and public headers are unchanged.

  • Four focused graph contracts pass. The stale inventory assertion first failed at 132 versus 131; updated counts and explicit protocol-list source/link/sanitizer assertions pass.
  • 288 native core/graphics executions pass, zero skips, with exact case names checked against the current graph for both C-reference and Rust-hybrid variants.
  • All 152 canonical targets compile through CMake; all 144 core/graphics CMake cases pass, zero skips/failures.
  • Formatting and the same primary review pass. Logs: /tmp/obs-1332-rebase-72a-{count-red,graph-green,native-validation,fmt}.log; independently checked summary: /tmp/obs-1332-rebase-72a-evidence-summary.json.
  • Pre-rebase head 2b63b8b46 passed all PR CI in run 39860136825: Linux 370 registered cases per mode (four environment skips), Windows 185 cases per compatibility run, macOS 210, plus Qt, Rust tests and cross-platform lint. Current rebased-head CI also passed: run 39866230018, with Linux 373 cases per mode (four environment skips), Windows 188 per compatibility run and macOS 213 per compatibility run. Requeued normally; merge-result CI run 39868534511 is pending.

Earlier slice evidence below retains its original scope and counts. CMake remains authoritative; this PR does not complete #1332.

Refs #1332

Draft. CMake remains authoritative. This is progress toward the complete application build conversion, not completion of #1332 or full test inventory parity.

Implementation

  • One strict typed JSON test graph consumed by CMake and Cargo/cc::Build: conditional sources, libraries and compiler options; imported dependency interfaces; explicit platform/feature/plugin facts; runtime argv/environment/cwd/timeout/skip/resource metadata.
  • 152 canonical definitions: the previous Linux inventory, eight additional output-plugin tests, the graphics, VLC and standalone WHIP suites, and 30 additional core helpers, 28 output/encoder/scene regressions and seven frontend utility helpers now use the graph. The separate Linux manifest and build loop are removed. C tests and public headers are unchanged.
  • Preserve original RTMP/AMF/FLV plugin guards, ordered private sources, TLS/zlib/happy-eyeballs interfaces, Windows system libraries, macOS frameworks, conditional Clang warnings and non-MSVC signed-char/sanitizer policy.
  • Header-only dependency imports inherit public include directories without compiler definitions, flags, archives or link policy. Private PCH header requirements are explicit.
  • Execute against both Cargo-built core variants; verify selected core with ldd, isolate runtime directories, retain command metadata and reject skipped assertions. Windows diagnostic scanning consumes the shared graph without weakening checks.
  • Restore metadata the old Cargo entries omitted: video-output shader path, AVC private caption headers and per-target sanitizers for context-name, video-plan and scene-audio helpers.

Rebased onto e7a272ffd after GitHub reported conflicts. Preserved upstream hotkey-pair changes and the scene-audio split, including both C sources in order and the upstream port explanation. Repeated local native validation against the new core. No workflow files are added or changed.

Resolved dependency artifacts are shared by compilation and runtime validation. Tests that declare a core dependency must resolve the selected core. The standalone AMF test retains its original core-free link; imported header-only providers create no runtime dependency. Added output-plugin coverage includes AMF/AMF3, multichannel MP4, timed MP4 splitting, null-output stop-thread cleanup and RTMP bitrate/send-thread regressions.

The independent WebRTC/graphics/VLC builder lists are also removed. The graph partitions tests into suites (132 core, 12 graphics, 6 VLC, 2 WHIP). Named artifact definitions supply actual module paths without linking those modules into the executable; CMake adds producer dependencies. The runtime token keeps the original CMake runtime directory and isolated Cargo test directories. VLC dummy custom targets remain excluded from runtime cases.

Explicit watch_inputs retains indirect header and runtime-data dependencies formerly declared by the separate builders. Cargo emits deduplicated watches; CMake registers configuration dependencies. The fixture verifies registration/emissions, not recursive edit detection or the full edited-input benchmark requirement.

RED → GREEN

Separate failing contracts precede implementation throughout the history. Recent pairs:

  • abd3685fb → 51d664223: real header-only import policy isolation.

  • 3769870d8 → 8c4f7290b: plugin availability independent of core audio features.

  • 6999d3d09 → ad0fe5b9f: real enabled compiler option, deliberately invalid disabled option, unknown-condition rejection in both consumers.

  • 84df2d038 → 8f3a6281f: eliminate the independent Linux inventory and preserve all remaining definitions.

  • 81958b884 → 01d6a0709: eight remaining output-plugin tests and runtime artifact dependency contracts.

  • 331b889c4 → de55053e2: shared suite selection and real built-module path definitions, then remove the separate graphics/VLC/WHIP inventories.

  • ea85cfaba → 615887930: preserve indirect header/data watches and reject malformed paths, including empty CMake array entries.

Latest fix and validation

  • 2ed143429 → 2b63b8b46 (on top of 15de5fda7): migrate seven frontend/utility helper tests (test_menu_text, test_profile_remove, test_profile_activate, test_tbar_position, test_media_time, test_studio_mode_exit, test_studio_mode_swap). Sources, include paths, link sets (only profile-activate links libobs; six stay core-free) and default runtime are preserved; frontend/utility is watched. RED failed with missing canonical test_menu_text.

  • 286 unchanged native executions pass, zero skips: 262 core (131 each against C reference and Rust hybrid) plus 24 graphics (12 each).

  • All 151 canonical targets compile through the real CMake consumer; all 143 core/graphics cases pass, zero skips/failures.

  • Eight configuration-only guard comparisons pass: Linux151, optional modules off119, core PulseAudio off150, features/runtime modules off129; macOS facts119, MSVC facts109, Windows GNU facts114, FreeBSD facts127. Selection checks only, not native non-Linux execution.

  • Focused graph contracts (28 native_build tests), six Python checks, warnings-denied Clippy with libobs-integration, and ./lint pass.

  • Evidence: /tmp/obs-1332-frontend-utility-{red,green,validation,python,clippy,lint}.log, independently checked against the then-current graph in /tmp/obs-1332-frontend-utility-evidence-summary.json. Native case names match the graph for both variants; same single primary review passes.

  • Rebased onto e7a272ffd only after GitHub reported DIRTY. The upstream scene-audio split added libobs/obs-scene-item-audio-actions.c.h; the canonical target now preserves both original C sources in order and the upstream explanatory comments. The independent Linux JSON inventory remains removed. Browser submodule mismatch is unchanged and excluded.

  • Rebased core proof (1a5187093): all 272 Cargo-driven native executions pass, zero skips; all 144 canonical CMake targets compile and all 136 core/graphics cases pass, zero skips/failures. All eight configuration comparisons pass unchanged. Four contracts, ten Python checks, integration-runner Clippy, formatting and rebase review pass. Evidence: /tmp/obs-1332-rebase-e7a-native-validation.log, /tmp/obs-1332-rebase-e7a-{runtime,cmake,selection}-evidence.json, /tmp/obs-1332-rebase-e7a-{graph,clippy,python}.log.

  • a12ea435d → 15de5fda7: close a demonstrated parser mismatch. Rust rejected an unknown template in an unavailable optional wrapper's arguments; CMake accepted it. CMake now checks syntax before lookup, while known source/build/runtime/target tokens remain accepted without resolving an unavailable wrapper. Four real contracts and ten Python checks pass; same primary review clean. The production graph is unchanged from the full rebased native proof. Evidence: /tmp/obs-1332-missing-prefix-template-{red,green,python}.log.

  • Previous public head 9cf2300ab passed all PR CI, run 39853903933. Linux OFF/ON each had 369 registered cases and four documented PulseAudio environment skips. Windows ran 184 existing CMake-compiled C tests against each Cargo-built core; macOS ran 209 against each, with core/renderer identity checks (Windows D3D11/OpenGL, macOS OpenGL/Metal). These component checks do not prove full Cargo-built applications or all-platform test compilation. Logs: /tmp/obs-1332-current-ci-{linux-off,linux-on,windows-tier2,macos-tier2}-clean.log. Rebased/new-head CI remains required.

  • 7a1ba92c9 → 9cf2300ab: migrate 17 core and 11 real OpenGL output/encoder/scene regressions. Preserve original guards, dependency/source order, module paths, runtime directories, timeouts and skip codes. Four frontend utility helpers remain core-free and watch their headers.

  • 272 unchanged native executions pass, zero skips: 248 core (124 each against C reference and Rust hybrid) plus 24 graphics (12 each). Library resolution is verified for all 262 linked cases; ten cases are intentionally core-free. Startup/module/API checks and core export equality also pass.

  • All 144 canonical CMake targets compile; all 136 core/graphics cases pass, zero skips/failures. The eight unchanged VLC/WHIP runtime cases retain the earlier runtime proof. Actual OpenGL module and effect data are used; no fake renderer.

  • Native validation found a harness bug on the existing caption-text test's non-UTF-8 output. Read/scans now use raw bytes; raw files, skip exit codes and exact ASCII skip-marker rejection remain intact. Preserved reference stdout is 708031 bytes and fails UTF-8 decoding; the unchanged test now passes.

  • Eight configuration-only guard comparisons pass: Linux144, optional modules off112, core PulseAudio off143, features/runtime modules off122; macOS facts112, MSVC facts102, Windows GNU facts107, FreeBSD facts120. These are selection checks, not native non-Linux execution.

  • Four graph contracts, ten Python checks, warnings-denied Clippy (including the integration runner), rustfmt, scoped gersemi, diff checks and the same single primary reviewer pass.

  • Evidence: /tmp/obs-1332-canonical-output-scene-validation-green.log, /tmp/obs-1332-output-scene-{runtime,cmake,selection}-evidence.json, /tmp/obs-1332-output-scene-{red,green,clippy,python,runner-clippy}.log. The initial runtime failure is preserved in /tmp/obs-1332-canonical-output-scene-validation.log.

  • Hosted Windows and macOS Rust tests pass on 02adc5e24, confirming the configuration fix below. Current-head CI remains required.

  • Hosted Format job 120076247029 on bb0832d6c passes, confirming the concurrency registration correction.

  • f93743f7f → 02adc5e24: fix the Windows native graph fixture's configuration mismatch. Reproduced the previous hosted failure locally with CMAKE_BUILD_TYPE=Debug; single-config generators ignore build/CTest --config Release. Configure now explicitly sets CMAKE_BUILD_TYPE=Release, and the fixture asserts the exact registered Release working directory and marker. Four graph contracts pass with the conflicting Debug environment, and the real fixture passes Ninja Multi-Config. No production source or existing C test changed. Evidence: /tmp/obs-1332-config-selection-red.log, /tmp/obs-1332-config-contract-red.log, /tmp/obs-1332-config-selection-green.log, /tmp/obs-1332-multiconfig-green.log. New-head Windows CI remains required.

  • 4f3897a3e → bb0832d6c: migrate 30 core/helper definitions and preserve optional command prefixes, ordering and missing-program fallback. Both consumers preserve the existing Xvfb shared-display helper; Cargo generates it from the existing template.

  • Fix the hosted Format job's concurrency registration failure: the fixture now reads migrated definitions from the shared graph, retaining all ten expected names, timeouts and isolation assertions. Local failure reproduced before the fix; all ten Python checks now pass.

  • 214 unchanged core program executions pass, zero skips: 107 each against C reference and Rust hybrid, with selected-core resolution verified (212 linked cases plus two intentionally core-free AMF cases).

  • All 116 canonical targets compile through the real CMake consumer; all 107 core tests pass, zero skips/failures. The nine graphics/VLC/WHIP runtime cases remain covered by the earlier full run below.

  • Eight configuration-only selection comparisons pass: Linux default116, optional modules off95, core PulseAudio off115, features/runtime modules off105; macOS facts96, MSVC facts89, Windows GNU facts94, FreeBSD facts104. These do not claim native non-Linux execution.

  • Four real graph contracts, ten Python checks, warnings-denied Clippy, rustfmt, scoped gersemi, diff checks and the same single primary review pass.

  • test_audio_io remains on its original CMake path: successful OBS startup intentionally skips its absent-core crash assertion. The initial run detected that on both cores. No C test or skip detection was weakened; this test requires a separately designed execution strategy before migration.

  • Evidence: /tmp/obs-1332-canonical-core-helper-validation-green.log, /tmp/obs-1332-core-helper-runtime-evidence.json, /tmp/obs-1332-core-helper-final-host.log, /tmp/obs-1332-core-helper-python-final.log, /tmp/obs-1332-core-helper-final-clippy.log.

Previous suite validation

  • 170 unchanged native program executions pass, zero skips. Core: 154 (152 linked to selected cores plus 2 core-free AMF runs); graphics: 2; VLC: 12; standalone WHIP: 2 without libobs or a transport SDK. Module/API integration checks and core export equality pass. Real OpenGL/VLC artifacts are loaded under Xvfb; no fake transport or graphics module substitutes are used.
  • All 86 programs compile and pass through the real CMake consumer, zero skips/failures. The validation project imports actual Cargo core/native module/dependency artifacts, stages effect data, and preserves the declared runtime layout. CTest names equal the graph inventory; skipped JUnit records and CMocka SKIPPED output are rejected. This is not a complete OBS CMake application build.
  • Eight configuration-only guard comparisons pass: Linux default 86, optional plugin/runtime modules off 65, core PulseAudio off 85, features/runtime modules off 75; macOS facts 68, MSVC facts 63, Windows GNU facts 66, FreeBSD facts 75. These are not native non-Linux executions.
  • Four focused contracts pass with an actual independently built module under a path containing spaces, isolated runtime cwd, suite labels/partitions, dependency-policy isolation and malformed artifact/input rejection.
  • Full execution evidence is from de55053e2. The watch-only followup passes focused tests, warnings-denied Clippy and a fresh configure/build of the entire 86-target CMake project. Windows diagnostics, rustfmt, scoped gersemi, diff checks and the same single primary review pass.
  • Evidence: /tmp/obs-1332-canonical-test-suites-artifacts.log, /tmp/obs-1332-test-suites-runtime-evidence.json, /tmp/obs-1332-test-suites-artifacts-{red,green,clippy,windows-scan}.log, /tmp/obs-1332-test-watch-inputs-{red,green,clippy}.log, /tmp/obs-1332-watch-input-configure-build.log.
  • Hosted previous-head Linux tests-ON job 120053338869 failed before compilation: apt could not find required zlib1g version 1:1.3.dfsg+really1.3.1-1ubuntu3.2. The current security index contains it. No package pin or inventory validation was relaxed. New-head CI remains required.

Remaining scope

Reconcile the entire applicable CMake inventory, including frontend, graphics and plugin tests, generated inputs, platform/configuration guards and runtime properties. A literal scan still finds 222 independent add_executable declarations; loops and other directories also need evaluation. The suite-count assertions are transitional, not proof of full suite coverage. Graphics/VLC/WebRTC consumers now use the shared graph; the remaining CMake-only tests still need migration.

Full #1332 still requires application/platform/configuration and packaging coverage, representative saved capture profiles, controlled cold/warm/no-change/edited-input native compiler-cache evidence, configurable unity/PCH proof, and CMake authority retirement only after all acceptance requirements are proven. No new Rust test binary is introduced.

@zackees

zackees commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

Local validation is complete for current head 2b63b8b46: 286 native executions (zero skips), all 151 canonical targets compiled, 143 core/graphics CMake cases passed (zero skips/failures), and eight platform/feature selection comparisons passed. I independently checked native case names against the current graph for both variants; the single primary review is clean.

Holding this branch unchanged for CI run https://github.com/obs-rust/obs-studio/actions/runs/39860136825, then the normal merge queue. The next migration follows after this PR lands so work proceeds one PR at a time. CMake remains authoritative and #1332 remains open.

@zackees
zackees marked this pull request as ready for review October 22, 2026 22:17
@zackees
zackees added this pull request to the merge queue Oct 22, 2026
@zackees

zackees commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

PR CI passed on 2b63b8b4665fd44422fce95f04432cb96abb0f46: https://github.com/obs-rust/obs-studio/actions/runs/39860136825.

  • Linux: both modes passed, 370 registered cases each; four PulseAudio environment skips each, zero failures.
  • Windows: four compatibility runs passed, 185 cases each, including existing CMake-compiled tests against Cargo-built cores and renderer identity/resource checks.
  • macOS: four compatibility runs passed, 210 cases each, including existing CMake-compiled tests against Cargo-built cores, OpenGL/Metal and capture-module identity/registration checks.
  • Qt frontend, Rust tests and cross-platform lint passed.

Marked ready and entered the normal merge queue. No admin merge. This is component/build-graph evidence, not a claim that Windows/macOS complete applications are Cargo-built. #1332 remains open; CMake remains authoritative pending its full acceptance requirements.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 22, 2026
Migrate 30 native tests to the shared graph. Resolve optional command prefixes in order and preserve the existing Xvfb shared-display helper. Update the concurrency registration fixture to consume canonical tests while retaining its full inventory and assertions.

Validated 214 core executions across C reference and Rust hybrid, 107 CMake core cases, all 116 canonical targets compiled, eight configuration selections, four graph contracts, ten Python checks, and warnings-denied Clippy. Keep test_audio_io on its original CMake path because its successful startup intentionally skips an incompatible crash assertion.
Reproduce the hosted Windows CTest failure with CMAKE_BUILD_TYPE=Debug. Set the configure-time build type as well as build/ctest --config, so single-config generators use the runtime directory created by the fixture. Require the Release marker rather than accepting an unconfigured directory.

Four graph contracts pass under conflicting Debug environment, and the real CMake/native graph fixture passes with Ninja Multi-Config. RED f93743f. Same primary review clean. No production source or existing C tests changed.
Migrate 17 core and 11 real OpenGL regression targets to the canonical graph, preserving original platform guards, sources, dependencies, module paths, runtime directories, timeouts and skip codes. Keep four frontend utility helpers core-free and watch their shared headers.

Native validation exposed non-UTF8 caption-text output. Preserve raw log bytes and scan ASCII skip markers without UTF8 decoding. All 272 native executions pass against C reference and Rust hybrid (262 core-linked, ten core-free); all 144 CMake targets compile and all 136 core/graphics programs pass with zero skips. Eight platform/config selection comparisons, four contracts, ten Python checks, Clippy including integration runner, formatting and single-primary review pass. RED 7a1ba92.
Reject malformed optional-prefix arguments even when the program is missing, matching Rust's typed graph validation. Keep known tokens valid without requiring resolution context for unavailable wrappers. RED a12ea43; four real graph contracts and ten Python checks pass. Same primary reviewer clean.
Migrate seven frontend/utility helper tests (menu text, profile remove and
activate, T-Bar position, media time, Studio Mode exit and swap) to the
canonical graph, preserving sources, include paths, link sets (only
profile-activate links libobs) and default runtime. Watch frontend/utility.
RED 2ed1434.
@zackees
zackees force-pushed the infra/1332-canonical-native-tests branch from 2b63b8b to f6b0c25 Compare October 22, 2026 22:36
@zackees

zackees commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

Rebased onto 72a5b5fe0 after GitHub reported DIRTY following the upstream queue landings. New head: f6b0c25127aac5bc835cb0fd45fc71823d7b26e2.

Preserved #1831's new protocol-list case in the canonical graph instead of restoring the retired Linux manifest. C tests/public headers remain unchanged. Current inventory: 152 targets, 132 core; 222 literal CMake declarations remain outside this graph.

Local evidence: four graph contracts pass; all 288 native core/graphics executions pass with zero skips, matching current graph names for both variants; all 152 canonical targets compile through CMake; 144 core/graphics CMake cases pass with zero skips/failures. Formatting and the same primary review pass. Full logs and summary are linked in the updated PR body.

Following current-head CI https://github.com/obs-rust/obs-studio/actions/runs/39866230018, then normal requeueing. No admin merge. CMake remains authoritative and #1332 remains open.

@zackees
zackees added this pull request to the merge queue Oct 22, 2026
@zackees

zackees commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

Current-head PR CI passed on f6b0c25127aac5bc835cb0fd45fc71823d7b26e2: https://github.com/obs-rust/obs-studio/actions/runs/39866230018.

Both Linux modes passed with 373 registered cases each, zero failures and four documented PulseAudio environment skips. Windows passed four compatibility runs of 188 cases each; macOS passed four runs of 213 each. Qt, Rust tests and cross-platform lint passed. These are component/core/renderer checks with existing CMake-compiled test executables, not complete Cargo-built Windows/macOS application proof.

Re-entered the normal merge queue behind #1840. Holding the branch unchanged for merged-result validation. No admin merge; #1332 stays open and CMake remains authoritative.

Merged via the queue into master with commit cca4351 Oct 22, 2026
32 checks passed
@zackees
zackees deleted the infra/1332-canonical-native-tests branch October 26, 2026 15:45
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.

1 participant