Repository navigation
preflight: Add a headless verdict engine with OBS's own thresholds - #814
Conversation
|
CI triage: "Rust Tier 2 Linux" fails at CMake configure, not in a test. |
510e925 to
61cefb8
Compare
|
Thanks for the triage, @zackees. Both done; the new head is
Re-tested at the rebased head on an Apple Silicon Mac:
Not run here: |
|
Progress: the soldr configure error is gone. The new Tier 2 Linux failure is in the |
* test: Tier 2 shows cargo errors and build-script panics (RED, Refs #932) Fails: rust/tools/linux-validate/build-errors.sh does not exist; the inline filter in validate.sh drops rustc errors. * ci: Tier 2 shows cargo errors and build-script panics (Fixes #932) A failed Tier 2 build printed only lines matching ': error' and 'FAILED:', so a failed Rust build in the ON configuration showed just 'FAILED: [code=101] ...' (#814). build-errors.sh keeps those lines and adds rustc diagnostics with their location and build-script panics.
|
Thanks for the pointer. The Rust-ON failure was a race: with
The same tree passed our fork's Pull workflow twice, with Rust Tier 2 Linux ON and OFF, including
The branch also merges current master. |
|
Review at head What is good
Required changes before this leaves draft
Questions and notes (not blockers)
What is needed outside this PR: #752 is a proposal, and I can't see a maintainer decision on it. A maintainer (zackees) has to agree to the direction before this merges. I'm flagging that so you aren't waiting on something I can't answer. When items 1 to 3 are done and CI is still green, mark it ready for review and comment here. I can't promise a merge date. Nothing here merges until a maintainer reviews it and it passes the merge queue. |
47d1d8d to
f6b9087
Compare
|
Thanks for the review. I've reworked the branch as asked:
Two fork Pull runs passed on this exact head, including the Rust test lanes (34/34 preflight tests), and the C ABI test passes locally. I've marked it ready for review. I understand #752 still needs your decision on direction before this can merge. |
#814 merged a new crate, obs-preflight, with one integration-test binary. That is a new crate's single binary, not a missed consolidation, so the workspace cap goes from 21 to 22.
#814 merged a new crate, obs-preflight, with one integration-test binary. That is a new crate's single binary, not a missed consolidation, so the workspace cap goes from 21 to 22.
…test targets (obs-rust#968) (obs-rust#978) * ci: Cap integration-test binaries per crate (RED, Refs obs-rust#968) * test: Group Rust integration tests into category binaries (GREEN, Fixes obs-rust#968) 157 test targets -> 21 (<= 8 per crate). Pure moves via git mv; test count unchanged (1102 passed, 1 ignored). Move-only edits: include_str! paths, mod common -> use super::common, the base_parity self-respawn filter, and the proptest regression files. bmem gets its own binary: it counts allocations process-wide. * test: Group obs-gpu-status's newer tests into its category binary (obs-rust#968) * test: Profiler test modules must share one lock (RED, obs-rust#968) profiler.rs and profiler_parity.rs both reset the process-global profiler. As separate binaries each ran alone; grouped into one binary libtest runs them on parallel threads, each behind its own mutex, so each saw the other's roots (Windows Rust Tests on obs-rust#978: 3 roots instead of 2, and an extra empty root in the parity snapshot). * test: Serialize the profiler tests on one shared lock (GREEN, obs-rust#968) One PROFILER_LOCK in the category binary's main.rs; profiler.rs and profiler_parity.rs re-export it as TEST_LOCK and PARITY_LOCK, so their tests no longer reset the global profiler under each other. * ci: Count obs-preflight's test binary in the workspace cap (obs-rust#968) obs-rust#814 merged a new crate, obs-preflight, with one integration-test binary. That is a new crate's single binary, not a missed consolidation, so the workspace cap goes from 21 to 22.
Problem
Refs #752. The Auto-Configuration Wizard’s counter checks and server selection are implemented in UI-specific code. This PR adds the headless decision engine needed to evaluate recorded OBS counters without a running OBS instance.
Root cause
The existing warning comparisons are spread across the Qt statistics widgets: render time, skipped frames, render lag, and output drops are checked in
frontend/widgets/OBSBasicStats.cpp:364-367,393-398,419-423,579-584; congestion bands are infrontend/widgets/OBSBasicStatusBar.cpp:18-21,400-408. The wizard’s server choice is a separate calculation infrontend/wizards/AutoConfigTestPage.cpp:393-399,414-420. There is no reusable headless evaluator for applying those checks to a bounded counter trace.Fix
This adds
rust/obs-preflight, a safe engine that rolls cumulative frame, output, encoder, congestion, connection and CPU measurements into windows and returns a pass, marginal or fail verdict with a reason. Counter decreases start a new window. It uses OBS's current warning bands and maps the four congestion icon levels to three verdicts, with excellent and good treated as pass. A CLI replays JSON Lines traces for deterministic testing.A separate
obs-preflight-fficrate exposes the engine through a new C header and static library. Its#[path]module shares the implementation so the safe engine and C ABI use the same code while keeping their crate types separate. The engine is not wired into OBS in this step; the sampler and UI remain follow-up work.The ABI test's CMake uses the pinned toolchain's real Cargo and Rust compiler when available, falls back to
soldror Corrosion's Cargo, and skips with a status message if none is available. It orders the separate ABI build after Corrosion'scargo-build_libobs_rusttarget to avoid concurrent Rustup component installs.Evidence
RED: commit
152332eb263de0c9a608de61041b21638c56e377leavesroll_up_windowsandjudge_windowastodo!()stubs. The fork Pull run 38894365237 reportedtest result: FAILED. 16 passed; 18 failed; 0 ignored; 0 measured; 0 filtered outinobs-preflight/tests/preflight.rs; the failure output shows the intentionaltodo!()panics.Exact RED failures
GREEN: commit
f6b90878266a90db8d9c07d1a0e727e81f0d6f5cpassed two exact-head fork Pull CI runs (same workflows as upstream PR CI): run 38896783523 and run 38899213391. Each run finished with 27 jobs succeeded, 0 failed, and 3 skipped. In both macOS Rust test jobs,obs-preflight/tests/preflight.rspassed all 34 tests:test result: ok. 34 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s.C ABI:
test_preflight_abipassed 10/10 under CTest on macOS after amacos-ciCMake configure andRelWithDebInfobuild. It calls the Rust engine through the public C header. CTest reported100% tests passed, 0 tests failed out of 1.Tier 3 differential tests: not applicable because there is no C original for this new engine behavior.
Mergeability:
git merge-tree --write-tree upstream/master HEADagainst current upstream2dae7366609405b552965e428b926dfc61394591exited successfully twice and returned7f6a132e78a2d080acb4c251162701daad567d69both times.Compatibility & risk
This adds a crate, a public C header, and a separate static library. It does not change existing libobs symbols or runtime behavior; OBS does not call the engine yet.
test_preflight_abiis excluded on Windows as a known gap because linking the Rust static library there needs additional system libraries. No OBS application run was made because the engine is not integrated.Status
Prepared on
preflight/engine-v2atf6b90878266a90db8d9c07d1a0e727e81f0d6f5c, based on upstreamce0b976fd8ca15cbca2373f820d1071943fe5f02. Both independent review gates passed, and both exact-head fork Pull runs passed. The OBS-facing sampler and UI remain follow-up work.How this was tested
152332eb263de0c9a608de61041b21638c56e377and GREEN commitf6b90878266a90db8d9c07d1a0e727e81f0d6f5c. RED produced the namedtodo!()failures above; both exact-head GREEN runs passed (27 jobs succeeded, 0 failed, 3 skipped each).macos-ci/RelWithDebInfo;test_preflight_abipassed 10/10 with CTest timeout 300. No Cargo test command was run locally on macOS.Thank you to the obs-rust maintainers and contributors for building this project in the open. In the American spirit of free expression and individual independence, and with the principle of judging contributions on their merit alone, this PR is a small piece of what independent people can build when they come together.