Repository navigation
obs-source: port async_tick and its filter_frame and get_closest_frame steps to Rust (Fixes #5929) - #5930
Conversation
Move async_tick() and its two static steps, filter_frame() and get_closest_frame(), out of obs-source.c.h into obs-source-async-tick.c.h (live group libobs.core-source), unchanged. async_tick() loses its static: obs-source.c.h declares it (no EXPORT) for obs_source_video_tick(), as it does process_media_actions(). The new file keeps a file-local copy of deinterlacing_enabled() and names MAX_ASYNC_FRAMES by the frame copy's OBS_SOURCE_FRAME_COPY_MAX_ASYNC_FRAMES (30, checked in obs-source.c.h). The async filter registration test now finds the filter_async_video() call in the new file. No behavior change. The new test_source_async_tick_entry characterizes them through the real libobs, one video tick at a time: a tick callback, which libobs runs before it ticks the sources, sets an async source's fields and queues its frames, and in the next tick reads what the source's tick left. 12 cases: an empty queue (nothing taken, last_frame_ts untouched, no texture size); unbuffered after a shown frame (the newest taken, the rest dropped to the cache); the first frame (the oldest, seeding last_frame_ts); frames not due (nothing taken, the clock moved by the canvas time); a timestamp jump; frames the clock passed dropped; the held frame released to the cache first; a filter that keeps the frame (one more reference during the walk, async_mutex held), replaces it (the replacement loses the reference) or drops it (no frame, no texture size, the passed frame keeps the reference); the previous frame left alone without deinterlacing; and with deinterlacing the previous frame filtered before the current one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The safe core's Host trait (the canvas frame time, async_mutex, the
deinterlace mode, deinterlace_process_last_frame(), the two frame slots,
remove_async_frame(), last_sys_timestamp, last_frame_ts, async_unbuffered,
the queue, a frame's timestamp and refs, filter_async_video(),
set_async_texture_size() and async_update_texture) and todo!() steps, with
17 Tier 1 tests over a recording model: an empty queue (the pacing not
asked, the empty slot stored again), unbuffered after a shown frame, the
first frame, frames not due, a jump, frames passed and dropped (each front
read, erased, then released), the held frame read twice and released
first, every timestamp read past the stack array of MAX_ASYNC_FRAMES, the
frame time read once before the lock; a replacement losing the walk's
reference, a NULL keeping it, an empty slot; no texture size without a
frame left and a false result stored; with deinterlacing the previous frame
filtered before the current one, the mode read again for it either way, and
the previous frame left alone without. The model fails a test on a field,
frame or call touched with async_mutex in the wrong state. All 17 fail on
the todo!() core.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ci-Attestation: {"at":1795941875,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":75,"stamp":"db0fa76a296bbcfad0264deca7a4ce2f","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941875,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":75,"stamp":"4af15f8f27bf3fbba62db9964c98eb78","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941875,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":75,"stamp":"ba2e208fedb67b5c51263d966277f8c5","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941875,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":75,"stamp":"1885df7a8e4de594c79f4b41b8b86e56","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"general/all/client-lint","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"cbab53ea3342c2275376979a5ca7549b","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941875,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":75,"stamp":"79c4ec41cf08fda42bc5760b547c967b","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"0a685dbba3dd3d25056282a9fbc88967","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941799,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"f52b6dd633a692e1e6f8df7c39177eb1","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"edcca1f83db45c757a5f70e9714c5644","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"193149473422766867528d0c23f272f0","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"3e21d037513ef485c6dd7c1c9cba8573","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"30579ca2a4a13794b79a690afa338662","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"3f2e027696b474bc5e7a6ecfa725001c","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"ff382636e23c1bfd5147a48b0ca71bdc","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"cece41590bd0af3053b5faf8c7801533","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"40445439036a2f9a4839d940e92e22aa","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"9c9d0cbace2de8bdbcb510d23f4d20b9","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
Ci-Attestation: {"at":1795941798,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"b2a1cdc24c8d3a28bfe9ddbc9a9db7b8674bff35313d74f259cb3138bce6262f","lane":"client-lint","parents":["990d4c614f86abed5f99d4ea8d5a85a3a4e62b0b"],"secs":152,"stamp":"00e3ad58a1cccea50374d47db9fc48d7","tree":"6ccf9690d7cfec5123e66c1522101bb9b9d65764","v":1,"via":"run"}
async_tick(), filter_frame() and get_closest_frame() are now the safe core
in obs-source::async_tick over a Host trait, exported as the hidden
async_tick() in obs-source::ffi::source_async_tick (rust-hidden.d). The
fields, async_mutex, the queue, the frame refs and the calls of
remove_async_frame(), deinterlace_process_last_frame(),
filter_async_video() and set_async_texture_size() stay C, one access per
adapter, in obs-source-async-tick-fields.c.h (live group core-source, no
EXPORT). The original moves to the reference-only group
libobs.ported-source-async-tick.
Tier 3 runs the original C in obs-c-oracle against the Rust export over a
grid of routes, held frames, queues of 0 to 40, both clocks, filter chains,
texture results and deinterlace scripts plus a proptest, with clobbers that
rewrite fields mid-call, and rejects eight mutants. No intentional
differences.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ci-Attestation: {"at":1795947558,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":76,"stamp":"c8720ef9daff0585756f154640959a94","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947558,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":76,"stamp":"65fb2b846fa0202a930756ba45fab9a3","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947558,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":76,"stamp":"d24a2c6bfc3a75c55b37f34ea9b3cc62","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947558,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":76,"stamp":"7ad491d7e8effe2a21c2c4c002009845","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"general/all/client-lint","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"d4d9195d3e01b7c8d73e68d5c1797a41","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947558,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":76,"stamp":"591e501b668d95a86df7e609160e092b","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"52dc5914216995e822cd8273c07a081e","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"c583b07e3d1910e6af9307235101f18b","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"6effe9a1961e46165d41a44655beec5d","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"f4aceefa765106070857ace3e641320a","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"389b159dee34c07f9cef6be22946e307","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"5a70dd979ef4017c4eea24f915076d8e","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"ddf0191c0ea97e1fc18307d7d6d50596","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"59a830295976a0525c94b1d1c17e0c2d","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"adc5445530d4d12a5e3c0e06ce28d444","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"943e6fe41775efdc4427a322a726eb05","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"5e66eae392aa8478ae6a385890f7d791","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947481,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"b09bf2162a7a0d96d4e0f6b338d456f736f59b0fe3ec15206e4ba2b74c045b07","lane":"client-lint","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":125,"stamp":"6dc8b246741786d6eab505acca5352ef","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Ci-Attestation: {"at":1795947896,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"a34292fa51628aae94534600abcf5242db5031fbdd8a04c7f3eb17fc76692c34","lane":"client-test-x86_64-unknown-linux-gnu","parents":["573d406978d48d75b4e4c98bb77b6b10509d0f5a"],"secs":337,"stamp":"7ab371d15fe101ab97ee90feaebd9d89","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa","v":1,"via":"run"}
Client-Checks: {"checks":{"base":"14773a296642f2f7b1c83d9a6e0438a110c2f9e2","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-source+.h.c","libobs/build/libobs.ported-source-async-tick+.h.c","libobs/build/ported-source-sets/source-async-tick.json","libobs/cmake/rust-hidden.d/obs-source-source_async_tick.txt","libobs/obs-source-async-tick-fields.c.h","libobs/obs-source-async-tick.c.h","libobs/obs-source.c.h","rust/README.md","rust/obs-build/tests/native.rs","rust/obs-build/tests/native/registration/canonical_source_async_filter_swap_is_registered.rs","rust/obs-build/tests/native/registration/canonical_source_async_tick_swap_is_registered.rs","rust/obs-c-oracle/oracle.d/source-async-tick.list","rust/obs-c-oracle/oracle/source_async_tick.c","rust/obs-source/src/async_tick.rs","rust/obs-source/src/ffi/mod.rs","rust/obs-source/src/ffi/source_async_tick.rs","rust/obs-source/src/lib.rs","rust/obs-source/tests/source/async_tick.rs","rust/obs-source/tests/source/async_tick_parity.rs","rust/obs-source/tests/source/main.rs","test/cmocka/build/test-graph.json","test/cmocka/test_source_async_tick_entry.c","test/cmocka/tests.d/test_source_async_tick_entry.cmake"],"head":"70a4279efaf9cdbf3aa6cd47d17a0282a86556ce","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504-GITv2.15.4\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"04ccaf3b18dca31a3a6baf12b0d3530ab8f788565fe6221a032bd7304f382e85","tree":"d07cbde3f624e2c86dc8ee67abb8213fb5185baa"}}
1eeba27 to
d6501c2
Compare
|
Rebased onto master (14773a2). The previous run's Windows links failed in obs-util's lib test and obs-tests-codec: COFF pulled the oracle's |
…nly (Refs #5929) The UCRT headers define _snprintf and friends inline in every object, so a COFF link can pick this member for them in a test that never calls it, and it then needs libobs signal and data symbols obs-tests-codec and obs-util's lib test don't link. Windows Link Check and the wine Rust tests failed that way on this PR's archive order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Ci-Attestation: {"at":1795949184,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":76,"stamp":"006c35488eacf4ccf247e35899d8eaba","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949184,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":76,"stamp":"83626f75a39bf078b29ca4a25934f7f7","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949184,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":76,"stamp":"61b127ca73ab94ddb244aa5300d9c6ea","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949184,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":76,"stamp":"054740df86feef7d71a265771130ff12","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"general/all/client-lint","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"6ae31c6f0bf96cd20a1f66af58c32211","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949184,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":76,"stamp":"ff0e8c84f5a107dc57e857e257ea6ce1","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"75e2f573889f39ecc7146911c9e2338f","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"ed6bd001909eb3937f7d5c245ae64349","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"80b6de823812bb11a0ac97cdec74151c","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"25e72ec37d1cb50e9c358f885876b6a8","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"0ce5f4776768e2d2b55d8576228f1943","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"b43b91917a8e7f410959da05726930c7","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"1702a9d34539c3167960dc997cec61cc","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"3b42e145edea0a9ca019374c0fcc54c1","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"faac719e64b22820da052b4925ce5b44","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"24c4df2222ddaafa102b32b84f3ed738","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"66311ec066e97dc3566c0223e9980af3","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949108,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"962400aae9cc543bce1866ab1a7bc72a2b09bee309e4f8e0f937d8f7f09eb4b2","lane":"client-lint","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":45,"stamp":"95ab669c04be23f6c63cda4edcf74bae","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Ci-Attestation: {"at":1795949430,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"09334eada25784ac2005f87c93bc40872c9c5c75ab8a5197ecd2313dc0a19ee9","lane":"client-test-x86_64-unknown-linux-gnu","parents":["d6501c24d69b23980de408ce4a85282e6d46cafe"],"secs":245,"stamp":"f17d2a98d649c074733d298bed65d891","tree":"f1749873825a66453ce37682e4f521ff554ad25e","v":1,"via":"run"} Client-Checks: {"checks":{"base":"14773a296642f2f7b1c83d9a6e0438a110c2f9e2","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-source+.h.c","libobs/build/libobs.ported-source-async-tick+.h.c","libobs/build/ported-source-sets/source-async-tick.json","libobs/cmake/rust-hidden.d/obs-source-source_async_tick.txt","libobs/obs-source-async-tick-fields.c.h","libobs/obs-source-async-tick.c.h","libobs/obs-source.c.h","rust/README.md","rust/obs-build/tests/native.rs","rust/obs-build/tests/native/registration/canonical_source_async_filter_swap_is_registered.rs","rust/obs-build/tests/native/registration/canonical_source_async_tick_swap_is_registered.rs","rust/obs-c-oracle/oracle.d/source-async-tick.list","rust/obs-c-oracle/oracle/source_async_tick.c","rust/obs-c-oracle/oracle/source_video_tick_callbacks.c","rust/obs-source/src/async_tick.rs","rust/obs-source/src/ffi/mod.rs","rust/obs-source/src/ffi/source_async_tick.rs","rust/obs-source/src/lib.rs","rust/obs-source/tests/source/async_tick.rs","rust/obs-source/tests/source/async_tick_parity.rs","rust/obs-source/tests/source/main.rs","test/cmocka/build/test-graph.json","test/cmocka/test_source_async_tick_entry.c","test/cmocka/tests.d/test_source_async_tick_entry.cmake"],"head":"778aa2cb76801de3fbe55b98c42e5975a25f3932","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504-GITv2.15.4\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"9e614f0daf2c21ee8180ff4904f767841fe8028deb98eb2a78d9090a4ff77eec","tree":"f1749873825a66453ce37682e4f521ff554ad25e"}}
|
The last run's Windows links still failed the same way: 5461071 adds |
zackees
left a comment
There was a problem hiding this comment.
Coordinator review: LGTM. It has the usual port shape:
- Extraction: a verbatim extraction into
obs-source-async-tick.c.h, with the fields adapter and the hidden export throughrust-hidden.d. - Tests: a new Tier 2
test_source_async_tick_entry.c, Tier 1async_tick.rs, and Tier 3async_tick_parity.rsagainst the oracle. - Registration: a canonical-swap registration test.
- Rules: a Test cost line, and no existing C test or public header edited.
- Windows (after #5919): there are no wide
usize/u64inputs and noutil_mul_div64on the path, so the MSVC_udiv128trap doesn't apply.
Fixes #5929.
This ports
async_tick()and its two static steps,filter_frame()andget_closest_frame(), toobs-source, in the shape of #5916 and #5926.obs_source_video_tick()runsasync_tick()once a tick on the video thread for every async source (media, cameras, capture cards). Every decision in it was already Rust: the route (obs-source::video_tick), the frame pacing (obs-source::async_pacing) and the async filter chain (#5917). What moves now is the glue on the source's fields,async_mutex, the frame queue and the frame refs.What changes
libobs: extract async_tick and its steps verbatim). The three functions move unchanged intolibobs/obs-source-async-tick.c.h(live grouplibobs.core-source).async_tick()loses itsstatic;obs-source.c.hdeclares it withoutEXPORTforobs_source_video_tick(). The async filter registration test now finds thefilter_async_video()call in the new file. The same commit adds the Tier 2 testtest_source_async_tick_entry, so it first runs against the unchanged C.Hosttrait andtodo!()steps, with 17 Tier 1 tests over a recording model.obs-source::async_tick, the hidden export inobs-source::ffi::source_async_tick(rust-hidden.d), one-access adapters inlibobs/obs-source-async-tick-fields.c.h(live group, noEXPORT), and the original moved to the reference-only grouplibobs.ported-source-async-tick.Kept call for call: the canvas frame time is read before the lock. Under
async_mutex, the route fordeinterlacing_enabled()runsdeinterlace_process_last_frame(), or releasescur_async_framethroughremove_async_frame()(read for the check and again for the call), stores NULL and stores the closest frame. Thenlast_sys_timestamp, the route again (the mode is read a second time), the previous frame through the filters only when deinterlacing, then the current one, andasync_update_texturefromset_async_texture_size()when a current frame is left.filter_frame()adds a reference, runsfilter_async_video()and drops a reference from the frame that comes back (not the one passed in), storing the slot, NULL included.get_closest_frame()returns NULL on an empty queue before reading anything else; otherwise it copies every queued timestamp (a heap array pastMAX_ASYNC_FRAMES), asks the pacing, drops the passed frames off the front one at a time (read, erased, released), storeslast_frame_tsand takes the front frame when the pacing says so.I checked the callers:
obs_source_video_tick()is the only one, in both libraries, and reaches the symbol by name. No intentional differences; Tier 4 does not apply. Not user-visible, so no features ledger line.Tiers
rust/obs-source/tests/source/async_tick.rs, 17 tests): every access in order on a recording model: an empty queue, unbuffered, the first frame, frames not due, a jump, passed frames dropped, the held frame released first, the frame time read once before the lock, a filter that keeps, replaces or drops the frame, the previous frame left alone without deinterlacing, the mode read again for it, the texture size stored only with a frame left, and every queued timestamp read past the stack array.test_source_async_tick_entry, Linux with OpenGL; the tick runs on the video thread): one tick at a time from a tick callback, 12 cases: an empty queue, unbuffered, the first frame, frames not due, a jump, passed frames dropped, the held frame back to the cache, a filter that gets the frame under the lock with one more reference, replaces or drops it, the previous frame left alone without deinterlacing, and with deinterlacing the previous frame filtered first. The existing async tests run unchanged.async_tick_parity.rswithrust/obs-c-oracle/oracle/source_async_tick.c): the original C (with the oracle's original route and pacing) against the Rust export on real-layout sources and frames, through shared recorders of the lock, the frame time and the four calls, with clobbers that flip the mode and rewritelast_frame_ts,async_unbuffered,last_sys_timestampand the current slot mid-call. Over a grid of routes, held frames, queues of 0 to 40 in four timestamp patterns, both clocks, filter chains, texture results and deinterlace scripts, plus a proptest, it compares both slots, the queue, every frame's refs, the fields, the event log and every other byte. Eight mutants are rejected.Evidence
RED, on the RED commit 2d4377b (Tier 1 against the
todo!()core):GREEN:
Tier 2 on GREEN,
OBS_CTEST_JOBS=10 uv run rust/tools/linux-validate/run.py --repeat 1 --tests 'test_source_async_tick_entry|test_source_async_filter|test_async_frame_pacing_steps', which runs the whole suite on both libraries and then those tests:100% tests passed, 0 tests failed out of 1153for the C reference (OFF) and hybrid (ON), and the repeat100% tests passed, 0 tests failed out of 4on each.Because ctest counts a cmocka
skip()as Passed, I also ran the binary in the kept build volume underxvfb-run -afromrundir/RelWithDebInfo: against hybrid and againstlibobs-c-referenceit reports[==========] tests: 12 test(s) run.and[ PASSED ] 12 test(s).. In the built hybridlibobs.so,get_closest_frameis gone andasync_tickis the Rust one; the reference still has the C.Test cost: the new Rust tests run longest 0.52 s (
matches_c_over_the_grid, debug; 0.16 s withOBS_PARITY_CASES=reduced), the Tier 1 module a few ms. Peak RSS is 17.6 MB over both modules. The tests start no threads of their own.🤖 Generated with Claude Code