Repository navigation
feat(bindings)!: exact {value, scale} timestamps in every binding - #6946
Conversation
Quest-Claim: b389fb9601f12d46
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…indings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 8547267
One actionable issue: the new Swift exact-timestamp test calls a macOS 13-only helper without an availability guard, breaking the macOS test build at the package's 12.3 deployment target (inline).
Overall direction is sound: carrying value/scale through the FFI removes lossy conversions, and boxing optional C read timestamps correctly preserves pointer stability as the slab grows. Duration rounding remains an explicit boundary rather than the storage representation. The documented Python raw-record exceptions and moq-c JSON timestamp-argument parity gap remain limitations, not additional new findings here.
Verification: static inspection of binding conversions, C pointer ownership, wrapper helpers, OBS timebase changes and regression tests. I did not run builds, tests, generated-binding checks or interoperability checks; the PR's reported passes were not independently reproduced.
…amp moq-c data writes - Every wrapper's Timestamp-to-duration conversion rounds down to a whole unit, matching moq-net's own conversions and the C/C++ interop clients. - Python wraps Anchor, Range, and VideoDecodedFrame so a time anchor takes and a decoded frame returns moq.Timestamp. - moq-c's JSON and binary writes take a nullable const moq_timestamp *; NULL keeps stamping the broadcast clock. - Swift's macOS 13-only duration assertion moves into the annotated test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cond Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 047432d
Reviewed the substantive update since 8547267, separating changes brought in from main.
Fixed: the prior Swift availability finding. The duration assertions now live in the macOS 13/iOS 16-annotated test; the raw timestamp test no longer calls the unavailable helper.
No new actionable bugs found in the reviewed delta. The consistent floor-at-conversion policy is simpler to reason about, Python's Anchor/Range/decoded-frame wrappers close the raw-record exceptions, and the C JSON/binary timestamp arguments close the parity gap while preserving NULL clock stamping. The added boundary and timestamp tests fit these changes.
Verification: static inspection of changed conversion helpers, wrapper adapters, C API forwarding and relevant regression tests. I did not run builds, tests, generated-binding checks or interoperability checks; this is not a test-pass claim.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 047432d3df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…stamps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ting Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
|
quest land removed this pull request from the queue: Conflicts with the base: quest/m1/binding-timestamps.md, rs/moq-c/src/test.rs, rs/moq-ffi/src/test.rs, test/interop/clients/c/subscribe.c, test/interop/clients/cpp/main.cpp |
|
quest land removed this pull request from the queue: Conflicts with the base: c/moq/test/probe.c, cpp/moq/bench/main.cpp, cpp/moq/test/probe.cpp, kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/Aliases.kt, kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/audio/Audio.kt, kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/json/Tracks.kt, kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/media/Media.kt, kt/moq/src/jvmAndAndroidTest/kotlin/dev/moq/SmokeTest.kt, kt/moq/src/jvmAndAndroidTest/kotlin/dev/moq/docs/Prelude.kt, kt/moq/src/jvmTest/kotlin/dev/moq/FfiBench.kt |
|
codex / Codex land fixer: (written by codex / Codex) |
Resolve the C, C++ and Kotlin conflicts from main's clang-format and ktfmt reformatting by taking main's files and reapplying the exact timestamp changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… test exact datagram ticks The earlier mechanical merge left Go's InsertDatagram calling the removed Frame.ffi() (Frame is now ffi.MoqFrame) and an unused timedelta import in moq.video. timestamps_are_exact now also inserts a 90 kHz datagram and reads the tick back exactly, and uses the ambient clock timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed 17ce02ad803b7ded56c01707249c927574ad5956, focusing on changes since published review f0f03da387d36512214c64ad069d8ce0b273d9c8 and separating base merges and formatting.
No new actionable bugs found. The added timestamps_are_exact inserted-datagram case addresses the previous coverage suggestion: it inserts one 90 kHz tick, receives the datagram, and asserts both the sequence and the complete timestamp record. The existing conversion/validation path and direct Go forwarding remain consistent. Reusing this round-trip test is a simpler fit than a separate harness.
Verification: GitHub-only static comparison and inspection of the changed test and relevant forwarding/conversion paths. No builds, tests, generated-binding checks or interop runs were performed; reported results were not independently reproduced.
|
quest land: this pull request conflicts with a pull request queued ahead of it, in these files:
Once one of them lands, this one conflicts with the base and is ejected when its turn comes. Resolve the overlap before then, such as by coordinating with that author, or by merging the base once it lands. |
- e2ee: the ietf properties block is variable (up to 64 KiB), so no fixed allowance covers it; choose between a forwarding cap or documenting the drop, and add a vector with non-empty relay properties. - fmp4-refusal-framing: state the framing guarantee directly and fix the refusal-choice sentence. - kotlin-js-flakes: SmokeTest.kt moved to :579 after #6946. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's rational timestamps (#6946) replace the Dart durations export beside the retired epoch export. Main's moq-c epoch validation (#7246) has nothing to validate on an instance, which is any non-empty text: its malformed-epoch cases are dropped, and the instance parse keeps its MOQ_ERROR_INVALID_CONFIG mapping in one helper. Main's new relay-hops C test and resume-history bench are ported onto instances, and moqsrc's refactored session (#7558) logs the instance escaped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
Binding timestamps stored as microseconds lose precision: one 90 kHz tick reads as 11 µs and republishes as tick zero. Completes
quest/m1/binding-timestamps.md.Approach
{value, scale}timestamps through moq-ffi, the C ABI, every generated binding and wrapper, and OBS. Preserve absent timestamps on untimed tracks and reject invalid timestamp records on writes.Impact
MoqTimestamp/Timestamp { value, scale }; renametimestamp_ustotimestampandend_ustoend. Decoded videotimestamp_us()becomestimestamp(); catalognow()returns the record. A read carries the track's scale; writes at another scale floor to the track's scale.moq_timestamp { value, scale }. Optional timestamps use nullable pointers instead of microsecond fields and presence flags; required timestamps are passed by value. Read pointers live until their read is freed. JSON snapshot update and stream append take a trailing timestamp pointer; NULL retains broadcast-clock stamping. Raw writes use NULL for untimed, which timed tracks refuse.moq.Timestampinstead oftimedeltafor timestamps, withTimestamp.from_timedelta/to_timedeltafor conversion. Wrapper-ownedAnchor,RangeandVideoDecodedFramecarry wrapper timestamps; decoded video exposestimestamp().time.Durationtimestamps withmoq.Timestamp, usingTimestampFromDuration/TimestampToDuration.TimestampUs()becomesTimestamp()and catalogNow()returns the record. A zeroTimestamp{}is invalid;TimestampToDurationpanics on scale zero, and an audio frame with an unset timestamp is refused.timestampUs:/.timestampUswithtimestamp:/.timestamprecords.Timestamp(Duration)and.durationrequire macOS 13 / iOS 16. Catalognow()returns a timestamp.timestampUswithtimestamp; replace the removed duration extensions withDuration.toTimestamp()/Timestamp.toDuration().timestampUswithtimestamp; replace the removed*Durationextensions withDuration.toTimestamp()/Timestamp.toDuration().Alternatives
Validation
just cipasses all selected lanes, including Rust/C ABI unit tests, Python, Go, Kotlin, Dart, generated C/C++ probes, OBS compile checks, JS and docs. The Rust run passes 428 tests, with two existing skips.just rs c-testspasses, including the installed C exact-timestamp test.quest, run outside the head checkout against freshly fetchedorigin/main, passes: 678 documents.just test interop --allpasses: Rust, Python, Go, C++, browser JS, Node, Bun, C and GStreamer, including tone checks, permissions, finished media, late joins and finite tails. The harness logged two forced Rust publisher teardowns; it exited zero with all assertions passing.Merge with main
Merged
mainat 88e6990 (no rebase) after the land queue ejected the PR with a merge conflict. Main ran clang-format over the handwritten C/C++, ktfmt over the Kotlin and swift-format over the Swift, so every conflict was a reformatted file:c/moq/test/probe.c,cpp/moq/{bench/main.cpp,test/probe.cpp}, and seven Kotlin wrapper/test files. Each takes main's file and reapplies this PR's timestamp edits, then is formatted with the repo's tool (clang-format withcpp/obs/.clang-format,just kt fix,just swift fix). Kotlin drops thekotlin.time.Duration/microsecondsimports main still had for the removed duration extensions.The earlier mechanical merge (1afe329) also left two breakages, fixed here:
TrackProducer.InsertDatagramcalled the removedFrame.ffi();Frameisffi.MoqFramenow, so it passes the frame straight through.py/moq-rs/moq/video.pykept an unusedtimedeltaimport (ruff F401).Following the maintainer review's coverage suggestion,
timestamps_are_exactinrs/moq-ffi/src/test.rsalso inserts a datagram at one 90 kHz tick and asserts the value and scale read back, and switches tokio::clock::timeout(the clippy clock lint deniestokio::time::timeout).UniFFI outputs:
just dart generatereproduces the committedmoq.dart/uniffi_runtime.dartup to blank lines, which the Dart check'sdiff -Bignores. Kotlin, Go, Python and C++ bindings are regenerated by their checks.Checks in the Nix dev shell,
just ci origin/main(rs, go and python rerun on 17ce02a after their fixes): rs (check, and 446 moq-c/moq-ffi tests with 3 skips), py, kt, go, dart, c, cpp, obs, obs_compile, js (check and test), python, markdown, quest, shell, toml, nix, gh and carla pass. Swift is skipped: no Swift toolchain on this Linux host (swift-format ran). Interop was not rerun.Review
InsertDatagram's signature; an unused import removed; and one test leg. None of them changes a public API, the wire format, security code orunsafe.Earlier records:
mechanical fix by codex / Codex:
Merged base; preserved timestamp migration alongside clock rename, delay constant, interop assertions, and quest deletion.(head 1afe329)mechanical fix by codex / Codex:
Merged base; preserved timestamp/range migration alongside base defaults, clock timeout, and retired WASM/audit deletions.(head 8525d46)quest review --base origin/main), head f0f03da: 0 findings.Follow-ups
The existing moq-c JSON window parity gap is outside this timestamp change.
moq_publish_json_window_push/_popcould take a trailing timestamp pointer like the JSON snapshot and stream writers.(Written by GPT-6.1 Sol)
(Merge with main and Review written by Claude Opus 5.5)