chore(rivetkit): wasm support#4860
Conversation
c2da5e3 to
cc67013
Compare
Review: chore(rivetkit): wasm supportThis is a substantial Phase 1 PR that adds remote SQLite execution (v4 envoy protocol) and a WASM runtime path ( Bugs / Correctness
In
The caller in Convention ViolationsInline CLAUDE.md: Rust tests live under Missing doc comment on The adjacent Performance / Design Notes
The signature change from Global 32-worker limit per connection, not per actor
What's well done
Minor
|
cc67013 to
716eee0
Compare
Code Review: WASM Support + Remote SQLite ExecutionThis PR adds WASM support for Protocol versioning (
|
Review: chore(rivetkit): wasm support (Draft)This PR lays the infrastructure groundwork for WebAssembly compilation of Bug: Serverful actor transition state (actor2/runtime.rs)This is a genuine bug fix embedded in the PR. Before this change, the AsyncCounter: atomic ordering inconsistencypub fn increment(&self) {
self.value.fetch_add(1, Ordering::Relaxed); // Relaxed
self.notify_change();
}
pub fn decrement(&self) {
let prev = self.value.fetch_sub(1, Ordering::AcqRel); // AcqRel
AsyncCounter: dead-Weak accumulation in zero_observers
AsyncCounter: change_callbacks clone under lockfn notify_change(&self) {
let callbacks = self.change_callbacks.lock().clone();
for callback in callbacks {
callback();
}
}The lock is released before invoking callbacks (correct - avoids re-entrant deadlock), but the Stub SQLite handlers return raw string errorsprotocol::ToRivet::ToRivetSqliteExecRequest(req) => {
send_sqlite_exec_response(
&conn,
req.request_id,
protocol::SqliteExecResponse::SqliteErrorResponse(protocol::SqliteErrorResponse {
message: "remote sqlite exec handling is not wired".to_string(),
}),
)
.await?;
}All three stub handlers ( connection/mod.rs: wasm cfg gating asymmetry
#[cfg(any(
feature = "native-transport",
all(feature = "wasm-transport", target_arch = "wasm32")
))]But Also: Guard path filter (pegboard_gateway/mod.rs)if !req_ctx.is_websocket() && !is_actor_http_request_path(req_ctx.path()) {
return Ok(None);
}The Cargo.toml: rivet-envoy-client default-features = false[workspace.dependencies.rivet-envoy-client]
path = "engine/sdks/rust/envoy-client"
default-features = falseDisabling default features at the workspace level means every consumer that previously relied on the implicit CI: build-wasm jobThe new job is well-structured. One note: the validation step checks for exactly namespace_name added to ConnAdding Minor
SummaryThe PR scaffolds wasm transport gating, moves
|
716eee0 to
8da73a1
Compare
Preview packages published to npmInstall with: npm install rivetkit@pr-4860All packages published as Engine binary is shipped via Docker images: docker pull rivetdev/engine:slim-2a8ccdf
docker pull rivetdev/engine:full-2a8ccdfIndividual packagesnpm install rivetkit@pr-4860
npm install @rivetkit/react@pr-4860
npm install @rivetkit/rivetkit-napi@pr-4860
npm install @rivetkit/workflow-engine@pr-4860 |
6213c3a to
4966b21
Compare
3412c8f to
b178905
Compare
b084261 to
7600ef8
Compare
b178905 to
e5c68c2
Compare
7600ef8 to
ecba65a
Compare
e5c68c2 to
9d83f98
Compare
ecba65a to
4bb9291
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: