Repository navigation
Conversation
Behavior-neutral extraction before the Rust port: os_nstime_to_timespec, its static init_timespec_offset and the timespec_offset static move verbatim from libobs/util/platform.c.h into libobs/util/platform-time.c.h, in the same libobs.platform unity group and precompiled header. The oracle compiles both files. No host conditionals move. test_platform_time characterizes os_nstime_to_timespec, which no test called. The base pair is taken on the first call and cannot be read back, but its wall-minus-monotonic difference can: the group setup converts a timestamp read just before the first call, which is at or below the base, so every case predicts its result exactly. It covers the first call taking the base, NULL storage, timestamps around, above and below the base, the nanosecond carry and borrow, and timestamps up to UINT64_MAX. One case is characterized, not endorsed: above the base, a result on a whole second comes back as tv_nsec == 1000000000 with tv_sec one short (the carry is `>` where `>=` was meant). Refs obs-rust#262
6 of 7 tasks
zackees
enabled auto-merge
October 20, 2026 06:42
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 20, 2026
Member
This was referenced Oct 20, 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.
Refs #262 (slice 6, time).
What and why
Behavior-neutral extraction before the Rust port, as the testing policy asks for a partial-file port:
os_nstime_to_timespec, its staticinit_timespec_offsetand thetimespec_offsetstatic move verbatim fromlibobs/util/platform.c.hintolibobs/util/platform-time.c.h. No Rust, no signature, header or behavior change.libobs.platformunity group andlibobs-platform.pch.h.rust/obs-c-oracle/oracle/platform.cincludes it too (os_nstime_to_timespecwas already renamedoracle_os_nstime_to_timespecthere), so the oracle still runs the real C.New characterization test
test_platform_time(tests.d/fragment, plus the Cargo C-test manifest). No test calledos_nstime_to_timespecbefore. The base is taken on the first call and can't be read back, but its wall-minus-monotonic difference can: the group setup converts a timestamp read just before the first call, which is at or below the base, so that result is exact. Every case then predicts its result from that difference, so nothing depends on how much time passes. The one exception is the bounds check that the first call takes the base. Cases:UINT64_MAX.One case is characterized, not endorsed: above the base, a result that lands on a whole second comes back as
tv_nsec == 1000000000withtv_secone second short. The carry isnsecs > nsecs_per_secwhere>=was meant. It is filed as #1505. The port keeps it, and the fix goes in its own PR.RED → GREEN
libobs.so.30, both the C one and theobs-studio-rust/one.ENABLE_RUST_LIBOBS=OFFandON). Each runs the cmocka tests againstlibobsand againstlibobs-with-rust:ENABLE_RUST_LIBOBS=OFF)ENABLE_RUST_LIBOBS=ON)¹
test_pulse_monitor_device(PipeWire default sink) failed once under-j6; it passes 3/3 on its own in all four. 7 frontend tests (test_config_migration_*,test_virtual_cam_shutdown) were not built in these trees: I built only thecmocka-teststarget. Nothing was skipped.test_platform_time: 9/9 in all four, and 20 repeated runs in each../lint(ci/local_gate.py --lane lint): passed (121 s)Windows/macOS: PR CI scopes this Linux-only. The stacked port PR touches
rust/obs-util/src/platform/, so its CI runs the Windows and macOS Rust and Tier 2 lanes, which build plainlibobswith this moved file and runtest_platform_timethere.Checklist
masterdocs/features.mdis added or updated (not applicable: no user-visible change)-W..., ratchets): not applicable