Repository navigation
obs-source: Port the 2x deinterlace frame pacing - #1954
Merged
Merged
Conversation
…ace-pacing.c Behaviour-neutral extraction before the Rust port. The pacing decisions of double-rate deinterlacing (Yadif 2x, Linear 2x, Discard 2x) in obs-source-deinterlace.c.h move to libobs/obs-source-deinterlace-pacing.c.h as six pure functions on plain integers, declared in the new libobs/obs-source-deinterlace-pacing.h without EXPORT (hidden, as -fvisibility=hidden keeps them): - obs_source_deinterlace_pacing_hold(): an unbuffered source keeps its frame while the frame's end (frame_ts + offset + 2 * half_duration - TWOX_TOLERANCE) is ahead of the clock by less than TS_JUMP_THRESHOLD; - obs_source_deinterlace_pacing_wait_for_next() and obs_source_deinterlace_pacing_waiting_frame_ts(): the "don't skip ahead" guard of ready_deinterlace_frames() for an unbuffered source with two frames queued, and the timestamp it then stores; - obs_source_deinterlace_pacing_half_duration(): half the time from the frame before, truncated to uint32_t; - obs_source_deinterlace_pacing_buffered_offset(): the offset of a buffered source, from the source clock that picks frames (obs-rust#395); - obs_source_deinterlace_pacing_reanchor(): the offset of an unbuffered source, kept unless the frame comes early or misses its tick and its first field (obs-rust#395). obs-source-deinterlace.c.h keeps everything else: the async_frames queue, the buffered walk, first_frame(), deinterlace_process_last_frame(), the textures and the render. It still tests async_unbuffered and deinterlace_offset before the hold and the guard, reads the same fields and obs->video values, and stores deinterlace_frame_ts, deinterlace_half_duration and deinterlace_offset in the same order. The re-anchor now stores the offset it returns every time; when it keeps the offset, that is the value already there. All arithmetic is the same uint64_t arithmetic, wrapping where it wrapped, the (int64_t) cast of the re-anchor's lateness included; TWOX_TOLERANCE is now 1000000ULL, which every use already converted to uint64_t. The thresholds are named in the header. obs-source-deinterlace.c.h keeps FRAME_TOLERANCE (the buffered walk) and TWOX_TOLERANCE (the render) and checks them against the header at compile time; TS_JUMP_THRESHOLD was used only by the hold and moves. The obs-rust#395 comments move with the code. The new file joins libobs.core-source with libobs.pch.h, which includes the new header. The exported symbol sets are unchanged (1766). Refs obs-rust#1950
test_deinterlace_pacing_steps compiles libobs/obs-source-deinterlace-pacing.c.h (ASan and UBSan, no libobs core) and calls only its six hidden functions, so it runs on every platform. 20 cases: - obs_source_deinterlace_pacing_hold(): held until the frame's end and not at it; TS_JUMP_THRESHOLD - 1 (held), TS_JUMP_THRESHOLD and TS_JUMP_THRESHOLD + 1 (moves on, the clock jumped: strict); the half duration widened before it is doubled (UINT32_MAX gives 8.6 s, no 32-bit wrap); a half duration of 0; the end wrapping past UINT64_MAX and below 0. - obs_source_deinterlace_pacing_wait_for_next() and _waiting_frame_ts(): wait until timestamp + offset + duration (no tolerance, no threshold), the waiting timestamp one duration back, so its half duration is half the duration; a next frame before the first. - obs_source_deinterlace_pacing_half_duration(): 50i and 59.94i, rounding down, the largest that fits. - obs_source_deinterlace_pacing_buffered_offset(): video_time - last_frame_ts + FRAME_TOLERANCE + TWOX_TOLERANCE (obs-rust#395). - obs_source_deinterlace_pacing_reanchor(): no offset yet; a frame early by 1 ns; on time and later by less than the larger of the field and the tick, less TWOX_TOLERANCE (kept); at it and past it (re-anchored), for 50i into 60 fps (the field is longer) and into 30 fps (the tick is), ties, a field and a tick of 0, a tick over UINT32_MAX. - Unbuffered sequences of 100 frames through a model of deinterlace_get_closest_frames() (hold, newest arrived frame, half duration, re-anchor), on exact rational clocks: 25 and 50 frames a second into 30 and 60 fps never re-anchor and never pick early (obs-rust#395), 50 into 30 drops 76 frames; a frame a field late re-anchors once and an early one re-anchors back. Characterized, not endorsed: - half a duration of 2^32 ns or more is truncated to 32 bits (a 10 s gap gives 705 ms); - a timestamp going backwards wraps: the half duration of a frame 40 ms back is 2^32 - 20 ms, the guard's end is the next frame's timestamp plus the offset, the waiting timestamp lands after the first frame; - the first frame with no second one queued takes its half duration against deinterlace_frame_ts, which is 0 for a source that never showed a frame: half its own timestamp truncated (1.78 s for a capture timestamp 1000 s after boot), or against the last frame shown before a queue reset. An unbuffered source then moves on at the next tick as if the clock jumped, or, when the truncation leaves 30 ms, holds the frame to 59 ms where a 50i frame ends at 39 ms; - the buffered offset and the re-anchored offset wrap when the frame's clock is ahead of the canvas, and the re-anchor's lateness is an int64_t, so 2^63 late or more counts as early; - 29.97 frames a second into 30 and 60 fps, and 59.94 into 60, re-anchor on every frame: the canvas ticks a little faster than the frames, so a tick lands within TWOX_TOLERANCE before the frame's time and the frame counts as early; the offset follows the canvas, 33 or 17 us a frame. It is in the native test graph, in the core suite. The real-libobs test_deinterlace_2x_field_order is unchanged. Refs obs-rust#1950
RED for the port of libobs/obs-source-deinterlace-pacing.c.h to the deinterlace_pacing module of rust/obs-source, next to audio_timing (obs-rust#1936). The safe core is a stub (todo!()): hold(), wait_for_next(), waiting_frame_ts(), half_duration(), buffered_offset() and reanchor(), one per hidden C function, on plain u64 and u32 values, and FRAME_TOLERANCE, TWOX_TOLERANCE and TS_JUMP_THRESHOLD. tests/source/deinterlace_pacing.rs ports test_deinterlace_pacing_steps 1:1: its 20 cases under the same names (steps_*), in the same order, with the same inputs and expectations, the characterized-not-endorsed wraps, the first frame's half duration and the model of the unbuffered sequences included. Edge cases (edge_*) check each function against a model of the C's uint64_t arithmetic written in i128 with the modulo explicit (the guard's end as next + offset, the waiting timestamp as 2 * timestamp - next, the lateness negative from 2^63): over the special values of the u64 range and the thresholds +-1 (every combination), the hold at TS_JUMP_THRESHOLD +-1 before every end, the re-anchor at its threshold and at the int64_t sign from every offset, and four proptests over full-range values with the clock drawn near the end and the lateness near the thresholds (4000 cases each). The tests are a module of obs-tests-core (rust/obs-data/tests/core.rs), as audio_timing's are. soldr cargo test -p obs-data --test obs-tests-core source::deinterlace_pacing fails 30 of 30 with "not yet implemented". Refs obs-rust#1950
Ports libobs/obs-source-deinterlace-pacing.c.h, the frame pacing of double-rate deinterlacing, to the deinterlace_pacing module of rust/obs-source. deinterlace_get_closest_frames() and ready_deinterlace_frames() stay C in obs-source-deinterlace.c.h: the async_unbuffered and deinterlace_offset tests before the hold and the guard, the field reads and the stores in their order, the async_frames queue, the buffered walk, first_frame(), the textures and the render. The hybrid libobs drops the C file and links the Rust shims in its place. Safe core (src/deinterlace_pacing.rs): hold() keeps an unbuffered frame while its end (frame_ts + offset + twice the widened half duration, less TWOX_TOLERANCE) is ahead of the clock by less than TS_JUMP_THRESHOLD; wait_for_next() waits while the clock is before timestamp + offset + the frame's duration, and waiting_frame_ts() is the timestamp one duration back; half_duration() is half the difference, its low 32 bits as the C's (uint32_t); buffered_offset() is video_time - last_frame_ts + FRAME_TOLERANCE + TWOX_TOLERANCE (obs-rust#395); reanchor() returns video_time - frame_ts when there is no offset, when the frame is early (the lateness, cast_signed() of the wrapped difference as the C's (int64_t), is negative) or when the lateness plus TWOX_TOLERANCE reaches the larger of the half duration and the canvas interval, and the old offset otherwise (obs-rust#395). Every sum and difference is wrapping_* where the C's uint64_t wraps. The module denies clippy's arithmetic, indexing, as, unwrap, expect, panic, unimplemented and unreachable lints, keeps no state and takes no lock. Shim (src/ffi/source_deinterlace_pacing.rs): the six functions keep the C signatures, plain integers in and out, so nothing is mirrored and no pointer is checked. No intentional differences. Kept, characterized, not endorsed (test_deinterlace_pacing_steps): half a duration of 2^32 ns or more is truncated; a timestamp going backwards wraps the half duration, the guard's end and the waiting timestamp; the first frame with no second one queued takes its half duration against a deinterlace_frame_ts of 0; the offsets wrap when the frame's clock is ahead of the canvas; a lateness of 2^63 or more counts as early; at 29.97 and 59.94 frames a second into a slightly faster canvas the offset re-anchors on every frame and follows the canvas. C side: the file leaves libobs.core-source for its own group, libobs.ported-source-deinterlace-pacing (LIBOBS_PORTED_SOURCES), whose PCH is only obs-source-deinterlace-pacing.h; libobs.pch.h now includes the header for obs-source-deinterlace.c. The six functions are not EXPORT, so the shims are hidden: rust-hidden.txt, the local: list of rust-exports.map and rust-unexports-macos.txt. libobs-rust already links the crate's ffi. The exported symbol sets are unchanged and equal: 1766 on the C backend, the hybrid and libobs-c-reference; the six are local in all three, and the hybrid's come from the Rust archive. ci/test_ported_sources.py checks the group on every host. test_deinterlace_pacing_steps still compiles the C file into itself, unchanged. The new test_deinterlace_pacing_steps_rust builds the same test source against libobs_rust-static instead, as test_source_audio_timing_steps_rust does, and links: the test includes only the header and calls only the six functions. test_deinterlace_2x_field_order sees the swap through the hybrid. Tier 1 source::deinterlace_pacing passes 30/30. Refs obs-rust#1950
Oracle (oracle/source_deinterlace_pacing.c): the original obs-source-deinterlace-pacing.c.h, unmodified, with its six functions renamed to oracle_*, plus the three thresholds. The bool results are declared as u8 on the Rust side, the byte the C returns. Tier 3 (tests/source/deinterlace_pacing_parity.rs). Every function takes and returns plain integers, so each run compares the bytes of the two results: the C's bool as its byte, the uint32_t and uint64_t results as their bytes. Runs: - the three thresholds against the C header; - each function over the special values of the u64 range (0, 1, the thresholds +-1, 50i and 60 fps durations, 2^32, 2^63 +-1, the end of the range) and ten half durations, every combination: 138240 holds, 331776 guards, 576 half durations and buffered offsets, 3317760 re-anchors; - proptests of each function over full-range u64 and u32 values, with the clock drawn near the frame's end and the lateness near the thresholds as often as anywhere (20000 cases each); - 3000 random sequences of 2 to 300 canvas ticks through a model of deinterlace_get_closest_frames(), ready_deinterlace_frames() (the unbuffered queue trim and guard, and the buffered walk with frame_out_of_bounds() and the MAX_TS_VAR jump) and first_frame(), with the stores in the C's order, driven once by the C functions and once by the shims: sources of 25, 29.97, 50 and 59.94 frames a second into 30 and 60 fps canvases, buffered and unbuffered, with timestamp and arrival jitter, late deliveries, late ticks, timestamps that jump or go backwards or land anywhere, queue resets (last_frame_ts 0, the first-frame path), a full queue and the buffering toggled. The bytes of every call's result and the model's state after every tick must be equal; - a check that 2000 sequences reach every branch of every function more than 100 times (held, moved on, the clock jumped; waited or not; the half duration from a pair and from deinterlace_frame_ts, truncated; the buffered offset; the re-anchor with no offset, early, late and kept; the first frame) and every rate pair. The parity module passed 20 runs in a row with fresh random seeds; no regression file came up. Mutation check (done once, not committed), with the two test modules built into a scratch test binary: 53 mutants. The 45 non-equivalent core mutants fail Tier 1 (2 to 10 of 30) and Tier 3 (1 to 4 of 11): each comparison at its threshold (< and <=, >= and >), the hold without its jump threshold or its "before the end" test, one half duration instead of two, the half duration doubled in 32 bits, TWOX_TOLERANCE or FRAME_TOLERANCE dropped, the guard without its duration or offset, the waiting timestamp ahead or unchanged, the half duration not halved, rounded up, saturated to UINT32_MAX or from the high bits, the buffered offset reversed, the re-anchor without its no-offset, early or late rule, early only past TWOX_TOLERANCE, the smaller of field and tick or only one of them, the pre-obs-rust#395 re-anchor at every pick, the lateness clamped or computed without the modulo, and every wrapping operation made saturating. Two mutants survive and are equivalent: end - sys_time is computed only when sys_time is before the end, and the lateness plus TWOX_TOLERANCE is reached only for a lateness of at most INT64_MAX, so neither can wrap. The 6 shim mutants (a result negated, arguments swapped) fail Tier 3; Tier 1 does not reach the shims. No intentional differences: there is no pointer to check. Refs obs-rust#1950
The rust/README.md crate table now says rust/obs-source also holds the units extracted from libobs/obs-source-deinterlace.c, and its port table has a row for libobs/obs-source-deinterlace-pacing.c.h: the six functions, what stays C, the seam (the async_unbuffered and deinterlace_offset tests, the field and obs->video reads and the stores in their order), the wrapping arithmetic and the (int64_t) lateness, what the characterization pins and the port keeps, no intentional differences, the _rust variant of the steps test, test_deinterlace_2x_field_order and what Tier 3 compares. The crate's description and lib.rs say what it holds. docs/rust-port/naming.md already maps libobs/obs-source*.c.h to rust/obs-source. port_comparison gets its own bench file, benches/port_comparison/source_deinterlace_pacing.rs: 1024 ticks of 50i and 59.94i sources into 60 fps that reach every branch, as an unbuffered source runs the hold, the guard, the half duration and the re-anchor, and as a buffered one runs the half duration and its offset, the results folded into a checksum both sides must match. On x86_64 Linux (GCC, not pinned; median per 1024 ticks): unbuffered_tick 8.67 us Rust and 7.59 us C (1.14x), buffered_pick 3.20 us Rust and 3.13 us C (1.02x), about 1 ns more per tick. Fixes obs-rust#1950
rdoupe
force-pushed
the
port/deinterlace-pacing
branch
from
October 23, 2026 17:58
41ee560 to
5839d86
Compare
This was referenced Oct 23, 2026
5 of 7 tasks
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1950
What and why
Ports the frame pacing of double-rate deinterlacing (Yadif 2x, Linear 2x, Discard 2x) in
libobs/obs-source-deinterlace.c.htorust/obs-source, as a new moduledeinterlace_pacingnext toaudio_timing(#1936). With a 2x mode each async frame is shown as two fields, the second one fromdeinterlace_frame_ts + deinterlace_offset + deinterlace_half_duration - TWOX_TOLERANCEon the canvas clock. These rules decide that offset and half duration, and when an unbuffered source moves on to its next frame. #395 fixed them for real users (upstream issues 3402, where 50i into a 60 fps canvas dropped about a quarter of the fields, and 6061, the field order). Each rule #395 and 3ea98b8 (the unbuffered hold and "don't skip ahead") added is pinned in the characterization and checked by a mutant.Six commits:
Move (behaviour-neutral): the decisions go to
libobs/obs-source-deinterlace-pacing.c.has six pure functions on plain integers. They are declared in the newobs-source-deinterlace-pacing.hwithoutEXPORT, so they are hidden:obs_source_deinterlace_pacing_hold(): an unbuffered source keeps its frame while the frame's end is ahead of the clock by less thanTS_JUMP_THRESHOLD;obs_source_deinterlace_pacing_wait_for_next()and_waiting_frame_ts(): the "don't skip ahead" guard ofready_deinterlace_frames(), and the timestamp it then stores;obs_source_deinterlace_pacing_half_duration(): half the time from the frame before, truncated touint32_t;obs_source_deinterlace_pacing_buffered_offset(): a buffered source's offset, from the source clock that picks frames (libobs: Show every field with 2x deinterlacing at another canvas rate #395);obs_source_deinterlace_pacing_reanchor(): an unbuffered source's offset, kept unless the frame comes early or misses its tick and its first field (libobs: Show every field with 2x deinterlacing at another canvas rate #395).obs-source-deinterlace.c.hkeeps everything else: theasync_unbuffered && deinterlace_offsettests in front of the hold and the guard, theasync_framesqueue, the buffered walk,first_frame(),deinterlace_process_last_frame(), the textures and the render. It reads the same fields andobs->videovalues and storesdeinterlace_frame_ts,deinterlace_half_durationanddeinterlace_offsetin the same order. The thresholds are named in the header;FRAME_TOLERANCE(the buffered walk) andTWOX_TOLERANCE(the render) stay inobs-source-deinterlace.c.hand are checked against it with_Static_assert. The file stays inlibobs.core-sourcefor this commit.Characterization:
test_deinterlace_pacing_steps, 20 cases, compiles the moved file. It covers:TS_JUMP_THRESHOLD- 1, at it and + 1, and at the frame's end;It is in the core suite of the test graph, so no pinned suite count changes.
RED: Tier 1 in the crate against
todo!(). 30 of 30 fail.GREEN: the safe core and
#[no_mangle]shims, in a newlibobs.ported-source-deinterlace-pacinggroup with its own PCH (only the new header). The export lists,source-sets.json, the unity lists andci/test_ported_sources.pyare updated, and a_rustvariant of the steps test is added (see below).Tier 3: a C oracle and byte-level parity, with the mutation check.
Docs: the README rows, the crate's description and
lib.rs, and aport_comparisonbench file.docs/rust-port/naming.mdalready mapslibobs/obs-source*.c.htorust/obs-source.Every sum and difference is
wrapping_*where the C'suint64_twraps. The re-anchor's lateness iscast_signed()of the wrapped difference, the C's(int64_t)(offset - deinterlace_offset). The half duration is the low 32 bits, the C's(uint32_t). The crate still depends on no other crate.What changed in the C. The re-anchor now stores the offset it returns on every unbuffered pick. When it keeps the offset, that is the value already there.
TWOX_TOLERANCEin the header is1000000ULL; every use already converted it touint64_t.TS_JUMP_THRESHOLDwas used only by the hold, so it moves to the header.Kept, characterized, not endorsed:
deinterlace_frame_ts, which is 0 for a source that never showed a frame (see below);TWOX_TOLERANCEbefore a frame's time, the frame counts as early, and the offset re-anchors on every frame, 33 or 17 µs back each time. The offset follows the canvas. This is the rule working as written: no field is skipped and none is shown early.No intentional differences. Every input is a value, so there is no pointer to check.
The
_rustvariant links.test_deinterlace_pacing_steps_rustbuilds the unchanged test source againstlibobs_rust-static, astest_source_audio_timing_steps_rustdoes. The test includes only the new header and calls only the six functions. It passes 20 of 20 on the hybrid tree.Exported symbols: 1766 on the C backend, the hybrid and
libobs-c-reference, with identical sets. The six functions are local (t) in all three. In the hybrid they come fromliblibobs_rust.a(the group's object is not on the hybrid link line), and the ported group is compiled only intolibobs-c-reference.Performance (port_comparison, x86_64, GCC, not pinned; median per 1024 ticks):
unbuffered_tick(hold, guard, half duration, re-anchor): 8.67 µs Rust, 7.59 µs C (1.14x);buffered_pick(half duration, buffered offset): 3.20 µs Rust, 3.13 µs C (1.02x).That is about 1 ns more per tick, for one tick of each deinterlaced source per canvas frame.
No user-visible change, so no
docs/features.mdline.Observed, not changed (upstream behaviour; the first is in the moved code, the second is outside it). Neither is fixed here: both fixes would change behaviour, and each can be its own issue.
The first frame's half duration. When a source's first frame (or the first after
last_frame_tsis reset byobs_source_output_video(NULL)or a full queue) is picked with no second frame queued,first_frame()cannot mark a pair, so the half duration is(uint32_t)((ts - deinterlace_frame_ts) / 2). For a source that never showed a frame,deinterlace_frame_tsis 0. Example: a capture card's frame stamped 1000 s after boot (os_gettime_ns()) gives1e12 / 2 mod 2^32= 1.78 s.video_time - ts + 3 ms, so the second field comes due 1.78 s + 2 ms after the pick. The next frame replaces the first 40 ms later (50i), so the first frame's second field is never shown. That happens unless the truncation leaves less than about a frame, so nearly always.TS_JUMP_THRESHOLD, so the next tick moves on as if the clock had jumped, and the second field is skipped the same way. When the truncation leaves 0.5 to 35.5 ms (about 0.8 % of start times), the first frame is held too long. Example: a timestamp that leaves 30 ms holds it to 59 ms after the pick, where a 50i frame ends at 39 ms, one 60 fps tick more.deinterlace_frame_tsis the last frame shown, so a 10 s pause gives 705 ms, with the same effect.The cost is one field (20 ms at 50i) at each start, restart or queue overflow. The next frame's half duration is right again, so it does not carry on.
test_deinterlace_2x_field_orderleaves the first two frames out of its counts for this reason.half_duration_first_frameandfirst_frame_half_duration_holdpin it.A stale
prev_frameflag in the buffered walk (ready_deinterlace_frames(), not moved). When the walk erasesprev_frame(da_eraseandremove_async_frame()) and then finds two or fewer frames left, it setsprev_frame->prev_frame = trueon the frame it just removed. This was likely meant forframe, the new front. Two effects:remove_async_frame()only returns the frame toasync_cache, andcopy_frame_data()does not resetprev_frame. So the next incoming frame that reuses that cache entry is queued withprev_framealready true. When it is picked with another frame behind it,deinterlace_get_closest_frames()takes it as the previous frame of a pair and shows the next frame instead: one frame early, and the due frame's fields are skipped.This happens when a buffered source falls three frames behind, for example after a stall. It is memory-safe: the write happens under
async_mutex, to a frame that stays allocated in the cache. This comes from reading the code, not from a reproduction. The Tier 3 model mirrors the C here (the write goes to the erased frame).RED → GREEN
6ed2b2253.soldr cargo test -p obs-data --test obs-tests-core source::deinterlace_pacingfails 30 of 30, every failure "not yet implemented": the 20 portedsteps_*cases and 10edge_*cases, four of them proptests.b51e2a419. Tier 1 passes 30/30. Tier 2 ran under a privateXvfb -noresetwithdbus-run-session, a fresh HOME andulimit -c 0, with no TMPDIR set:test_deinterlace_2x_field_ordertest_deinterlace_pacing_stepstest_deinterlace_pacing_steps_rustThese ran on
e00f1e328: the branch on20839ada6(#1929), with the same tree as the head before the last rebase (41ee56071, onaf0273e37) except for one obs-scene Rust test from #1952. No ctest test was skipped. Inside the tests, three cases skip on each lane, as on master:open_crashes_without_obs_coreintest_audio_ioandtest_video_io, andtest_hex_float_values_ignore_comma_locale, which needs a comma-decimal locale this host does not have. No PipeWire or PulseAudio case skipped. No rerun was needed:test_deinterlace_2x_field_orderpassed every time it ran, 4 runs on each lane. Besides the run above, it also passed on all three builds at commit 2 (c922ff3ea, before the rebases), at commit 4 (5e891bbb3, before the rebases) and on07683bc85(ondd6a5597e). The full ctest also passed on07683bc85(394/394 and 398/398, 0 ctest skips). Each c-ref run checked that the loader usedlibobs-c-reference/libobs.so.30, which was rebuilt (ninja libobs-c-reference) before every c-ref run.Tier 3,
c8e2030c8(source::deinterlace_pacing_parity, 11 tests). Each run compares the bytes of the two results: the C'sboolas the byte it returns, and the integers as their bytes. Runs:u64range (0, 1, the thresholds ±1, 2^32, 2^63 ±1, the end of the range) and ten half durations: 138,240 holds, 331,776 guards, 576 half durations and buffered offsets, and 3,317,760 re-anchors;u64andu32values, with the clock drawn near the frame's end and the lateness near the thresholds as often as anywhere (20,000 cases each);deinterlace_get_closest_frames(),ready_deinterlace_frames()(the unbuffered trim and guard, the buffered walk withframe_out_of_bounds()) andfirst_frame(), with the stores in the C's order, run once with the C functions and once with the shims. The sequences cover sources of 25, 29.97, 50 and 59.94 frames a second into 30 and 60 fps canvases, buffered and unbuffered, with timestamp and arrival jitter, late deliveries and ticks, timestamps that jump, go backwards or land anywhere, queue resets (the first-frame path), a full queue and the buffering toggled. The bytes of every call's result and the model's state after every tick must be equal;The parity module passed 20 runs in a row with fresh seeds, and no regression file came up.
Mutation check (once, not committed; the two test modules built into a scratch test binary): 51 of 53 mutants fail, and the 2 that survive are equivalent.
<=<=TWOX_TOLERANCEframe_ts + offset/+ 2 * half/- TWOX_TOLERANCE<=+ offset/+ durationts - durationUINT32_MAX/ the high 32 bitsFRAME_TOLERANCE/ noTWOX_TOLERANCE/ reversed+ FRAME_TOLERANCE/+ TWOX_TOLERANCETWOX_TOLERANCE>TWOX_TOLERANCEin the late rule(int64_t)end - sys_time(computed only whensys_timeis before the end)late + TWOX_TOLERANCE(reached only for a lateness of at mostINT64_MAX)Other runs:
uv run ci/local_gate.py --test-diff origin/master(the CI changed-crates step) on the head5839d8614: 2877/2877 passed, 1 skipped (an existing ignored test). The disk on the build host was under soldr's 5 GiB guard, so this ran withSOLDR_TARGET_BLOCK_FREE_GB=3. An earlier run, without the override, passed every test and then stopped at the doc-test step because of the disk guard.uv run ci/local_gate.py --lane lint: ok.--lane cross: ok. Both ran one00f1e328, and before that on07683bc85and39d231d0d.cargo clippy -p obs-source -p obs-c-oracle -p obs-data --all-targets -D warningsis clean.ci/test_build_groups.py,ci/test_ported_sources.pyandci/test_oracle_standins.py: OK on the head.e00f1e328.soldr cargo test -p obs-data --test obs-tests-core source::: 86/86 (45audio_timingand 30 + 11deinterlace_pacing).dd6a5597e,20839ada6,af0273e37and773faa051(obs-scene: Port the scene item crop arithmetic #1947). The last one conflicted in the bench list and therust/README.mdrows; after it,ci/test_build_groups.py,ci/test_ported_sources.py,uv run ci/local_gate.py --test-diff(2902/2902, 1 skipped) and the lint lane were re-run and pass. Only theport_comparisonbench list conflicted (libobs: Port the source registration rules to obs-core #1929 addedmodule_source_rules, and both entries are kept). After each rebase,source-sets.json,test-graph.json, the unity lists and the three export lists were compared by hand against master: only this PR's lines differ.Checklist
master(or the description starts with a Stacked: note)docs/features.mdis added or updated (not applicable: no user-visible change)-W..., ratchets): built with scripting ON (PR CI builds no OBS app: rungh workflow run ci.yml --ref <branch>for the full builds) and cross-checked with clang and MSVC (not applicable: no warning or flag change)