Repository navigation
quest(m2): spike UniFFI-generated browser bindings before growing moq-wasm - #5478
Conversation
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. |
|
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 15 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. Comment |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: b17ebcd.
One P3 correction to the cancellation premise below. Overall direction is sound: compare measured candidates before choosing a binding, keep the compatibility downgrade confined to the spike, and gate adoption on the supported generator version. The baseline → generator → complete bindings → adoption dependencies are acyclic; the existing baseline already calls for matched workloads and complete shipped assets. No blocking design issue found.
Verification: GitHub-only static review of the three changed plans, surrounding prerequisites and current moq-ffi feature/lifetime implementation. No builds or browser tests run. Upstream generator implementation/version claims were not independently verified because this review is scoped to moq-dev/moq.
| - Parity on the harness cases: exact u64 above 2^53, cancellation through | ||
| `AbortSignal`, close/error propagation, and freeing a handle mid-call. | ||
| - On wasm, `ffi::Task` cancels when the caller drops it, whereas native | ||
| detaches. Check that `@moq/net` semantics hold under that difference. |
There was a problem hiding this comment.
[P3] Update the Task cancellation premise
The native/WASM split described here no longer exists: rs/moq-ffi/src/ffi.rs:319–348 uses one await-in-place Task::run implementation for both. Its comment explicitly avoids spawned work so a cancelled foreign call cannot consume the next call's event before rust_future_free. Describe that current contract and test that aborting/freeing a pending call releases its state without stealing the next event, rather than measuring against native detachment.
There was a problem hiding this comment.
Fixed: the premise now describes the current await-in-place contract and tests that aborting or freeing a pending call releases its state without stealing the next event.
(Written by Claude Opus 5.5)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b17ebcd6ce
ℹ️ 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".
| - Use [uniffi-bindgen-react-native](https://github.com/jhugman/uniffi-bindgen-react-native) | ||
| (ubrn), whose `wasm2` flavour is a plain wasm32 cargo build driven by a | ||
| generic JS player. Upstream UniFFI will not ship a JS generator and points | ||
| to ubrn. ubrn pins UniFFI 0.31, while `moq-ffi` is on 0.32. The spike |
There was a problem hiding this comment.
Add the required wasm2 runtime to the spike setup
The current rs/moq-ffi manifest and crate root contain neither uniffi-runtime-wasm nor extern crate uniffi_runtime_wasm as _, so this proposed wasm2 build cannot reach the browser harness: ubrn build wasm2 rejects the missing dependency, and without the forced link the player fails to load because __ubrn_alloc is absent. The spike must temporarily add and link the matching 0.31 runtime, and count it in the shipped-size measurement, rather than treating the existing crate as directly runnable. See the upstream wasm2 preparation requirements.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed: the spike branch adds the matching uniffi-runtime-wasm plus the forced extern crate link, and counts the runtime in the shipped size.
(Written by Claude Opus 5.5)
b17ebcd to
d08c136
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d08c136fac
ℹ️ 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".
| BoltFFI has its own macros, so it cannot bind `moq-ffi` as-is. Reuse | ||
| that spike's slice crate, which binds both generators via `cfg_attr`, | ||
| and measure UniFFI on the same slice so the per-call numbers compare | ||
| like for like. Full `moq-ffi` through UniFFI still provides the size and |
There was a problem hiding this comment.
Compare a full BoltFFI binding before selecting it
These lines restrict BoltFFI to the slice crate and explicitly reserve full moq-ffi size and coverage measurements for UniFFI. As a result, BoltFFI cannot run the promised browser parity cases or produce comparable shipped-size, startup, and memory results, yet the quest still permits the maintainer to select it and the dependent quest assumes moq-ffi through BoltFFI. Either port a representative full workload for this spike or treat the slice measurement only as a feasibility filter, not winner-selection evidence.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed: the slice is now a feasibility filter. If BoltFFI passes and is favored, the harness workload is ported and the parity, size, startup, and memory cases rerun before it can be picked.
(Written by Claude Opus 5.5)
| keeps every UniFFI export, so only cargo features reduce size. Measure | ||
| `default-features` on and off. If size decides the result, propose a | ||
| net-only feature rather than a new crate. |
There was a problem hiding this comment.
Use a feature split that changes the wasm build
On wasm32, toggling default-features currently changes no compiled surface: moq-ffi's defaults are only audio and video, their dependencies are under cfg(not(target_arch = "wasm32")), and both modules have the same non-wasm guard. The proposed on/off measurements therefore build the same browser code and cannot inform the stated size-driven feature decision; define an actual feature over browser-exported modules or omit this comparison.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, audio/video are native-only. The on/off comparison is replaced with each module's share of the .wasm; a net-only size knob would need a new gate.
(Written by Claude Opus 5.5)
| (2026-09-28, released in v0.31.0). Async constructors and static async | ||
| methods are dropped | ||
| ([boltffi#95](https://github.com/boltffi/boltffi/issues/95), open), | ||
| which `connect` hits. TypeScript streams are experimental |
There was a problem hiding this comment.
Correct the claimed BoltFFI connect limitation
The cited BoltFFI issue explicitly shows that async instance methods with &self work and that only no-receiver static methods are dropped. moq-ffi has a synchronous MoqClient::new constructor followed by the async instance method MoqClient::connect(&self, ...), so this limitation does not hit its connect; leaving this claim in the decision record incorrectly presents a nonexistent blocker for BoltFFI.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, connect takes &self. The example is now the async constructor MoqMediaCatalogConsumer::subscribe.
(Written by Claude Opus 5.5)
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: d08c136
Reviewed the substantive BoltFFI addition against my previous review, excluding equivalent rebased changes.
- New P3, already independently reported in 4266559190: quest/m2/rs2ts/generator.md:45–48 says the async-static/constructor limitation affects connect. In this repository MoqClient::new is synchronous and connect is async with &self (rs/moq-ffi/src/session.rs:553–578). Remove that claimed blocker and assess the actual instance-method path in the spike.
- Prior P3 4265516925 remains open at generator.md:69–70: Task::run awaits in place on both targets; native detachment is not the current baseline.
Direction: adding a measured candidate before adoption is reasonable. Matching the two generated slices for per-call costs is useful; keep those measurements distinct from full-library size/coverage and the later complete-workload adoption gate. No additional actionable design bug found.
Limits: GitHub-only static review of changed plans, surrounding prerequisites and current FFI implementation. No builds/browser tests run; upstream generator/version claims were not independently verified outside moq-dev/moq.
…-wasm Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…I evidence, and cancel Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d08c136 to
fb19781
Compare
|
Merge summary. Quest files only, with no API or wire impact.
Review fixes:
(Written by Claude Opus 5.5) |
…feature #5776 put uniffi-bindgen's binary behind a `cli` feature, so run.sh now runs it through `cargo run --features cli` like rs/moq-ffi/build.sh. `just bench-ffi-gen` takes several steps, and `size` builds the moq-ffi and moq-wasm references only it needs. The nightly runs `build bench` so #5478 and #5838 can reuse a slice that still builds. Also fixes clippy on the standalone crate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds
quest/m2/rs2ts/generator.md. Beforers2tsgrows the hand-written wasm-bindgenmoq-wasm, a spike measures TypeScript that UniFFI or BoltFFI generates frommoq-ffiagainst it on the browser baseline harness. The maintainer then picks which binding@moq/netwraps.wasm-bindingsnow requires this quest and completes whichever binding is chosen.Background:
moq-ffialready compiles for wasm32 (#2911). #2907 argued for this route before it was folded into rs2ts. Upstream UniFFI won't ship a JS generator and points to uniffi-bindgen-react-native, whosewasm2flavour targets plain browsers. That generator pins UniFFI 0.31, and moq-ffi is on 0.32.Decisions
Goal
Goal confirmed: a spike measures UniFFI-generated TS from moq-ffi against moq-wasm on the baseline harness, and the maintainer picks. No adoption, no deletion of moq-wasm, no JS-only work.
Generator version
Surface
.wasmdoesn't, so the spike measures cargo features on and off.Placement
BoltFFI
cfg_attrslice crate, because BoltFFI cannot bind moq-ffi's UniFFI macros. UniFFI is measured on the same slice for per-call numbers, and full moq-ffi still provides size and coverage.Public API: none. Wire: none.
(written by Claude Opus 5.5)
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.