Repository navigation
Description
Unit
Port the entire extracted libobs/obs-video-level-queries.c.h to obs-core, preserving obs_get_video_sdr_white_level and obs_get_video_hdr_nominal_peak_level. This is the separate Rust swap following the C-only characterization/extraction prerequisite #5168; wait for that prerequisite to merge and be verified before implementation.
Phase and position
Phase 6 core query boundary, following the already ported level-setting admission rules. Preserve the two query bodies' behavior without changing obs_set_video_levels, its validation policy, graphics backends or any other core query.
Dependencies and existing tests
Blocked by #5168. Its test/cmocka/test_video_level_queries.c pins NULL-core defaults before and after synthetic live-core use, graphics-absent defaults despite stored fields, exact asymmetric stored float routing with graphics present, signed zeros, negative values, infinities, quiet NaN payloads, smallest normal and largest finite values, and unchanged core state/global pointer after each query. Float assertions require exact binary32 bits, with no approximate comparison. The test uses actual private core/graphics types without allocating resources, starting a backend or creating threads.
Relink that unchanged C-source fixture to the Rust replacement and real private adapters in its canonical graph registration; do not leave it exercising only the retained C oracle. Preserve its tests.d pointer, availability and sorted graph registration. Retain unchanged actual-library coverage in test_no_core_getters and test_video_levels_range against both implementations.
Notes and required evidence
Reject a NULL core before taking its video address or calling a C field adapter. Without a core or graphics return exactly 300.0f (0x43960000) and 1000.0f (0x447a0000). Otherwise return each corresponding stored field's exact bits, without validation, clamping, arithmetic, writes or allocation. Keep the owner opaque and private field access behind real C adapters; do not guess private Rust layouts or change public headers. Use a real graphics_t fixture object, not an underaligned char cast; MSVC has no max_align_t.
Commit safe-core Tier 1 assertion mirrors against failing stubs before GREEN. Add modules to the existing owning obs-core suite in the Core state category (soldr cargo test -p obs-data --test obs-tests-core), never a new test binary. Keep Tier 2 C tests and public headers unchanged; check exact public symbol parity and any necessary real-header size/alignment/all-field offsets. Tier 3 must compare the safe core and thin ABI shim against the original extracted C oracle with bounded random bit patterns and fixed edge cases, excluding only genuinely undefined input domains, and demonstrate a mutation failure. Tier 4 is inapplicable to this non-protocol query; preserve the unchanged C++ OBS WebSocket compatibility plugin.
Any real C adapter must be linked into every affected standalone Rust-static consumer using tests.d link-support fragments that compile the actual adapter source, never aborting stubs or placeholder globals. Adapters that reference graphics/runtime symbols can break unrelated static links. Before publishing, run ci/windows_link_check.py and a focused Linux Tier 2 build of at least two unrelated *_rust cmocka targets, using the release archive where archive-member selection matters. Type platform-width helpers and generated ranges directly as c_long/c_ulong: these are 32 bits on Windows and 64 bits on Linux/macOS, and .into() can fail Windows clippy as a useless conversion.
Run the entire native_build:: module and repository lint. Keep all source/module inventories and unity membership consistent and sorted. No existing C test, public-header, CI, workflow or WebSocket plugin changes. Rust through soldr, Python through uv, publication through ./push; use Refs and confirm empty closing references.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn progress
Activity
rdoupe commentedon Nov 19, 2026
Claiming: #5187 (swap obs_get_video_sdr_white_level and obs_get_video_hdr_nominal_peak_level to safe Rust in obs-core).
Plan, one PR:
rdoupe commentedon Nov 19, 2026
PR is up: #5196 (RED fc7b390, GREEN 1303511a4; Tier 1/2/3 evidence in the body). Auto-merge is armed, so it queues once PR CI is green.
test(obs-core): add RED video level query mirrors (Refs #5187)
obs-core: swap video level queries to safe Rust (Refs #5187)
obs-core: route the level fixture to hidden static entries (Refs #5187)
test(obs-core): add RED video level query mirrors (Refs #5187)
obs-core: swap video level queries to safe Rust (Refs #5187)
obs-core: route the level fixture to hidden static entries (Refs #5187)
test(obs-core): add RED video level query mirrors (Refs #5187)
obs-core: swap video level queries to safe Rust (Refs #5187)
obs-core: route the level fixture to hidden static entries (Refs #5187)