From a079f45eba3ff20d708c3fc90d94d962cc716615 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Mon, 26 Oct 2026 14:01:52 -0700 Subject: [PATCH 1/7] chore(quest): gzip-only handoff target; time minified bundles Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn --- quest/m2/README.md | 1 + quest/m2/ts-bench-minified.md | 20 ++++++++++++++++++++ quest/m2/ts-mir-size.md | 8 +++++++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 quest/m2/ts-bench-minified.md diff --git a/quest/m2/README.md b/quest/m2/README.md index fed4211af..f19bd853e 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -28,6 +28,7 @@ The fork's feature quests folded into the [exporter](/quest/m1/ffi-export.md); - [Cheaper byte slices](/quest/m2/ts-byte-views.md) - splitting a `&[u8]` stops making a `Uint8Array` view per split - [Smaller output from MIR](/quest/m2/ts-mir-size.md) - the bench's bundles shrink back to THIR's sizes, coroutine classes first +- [Time the minified bundles](/quest/m2/ts-bench-minified.md) - `just ts bench` times what it measures for size, as consumers ship it - [Wide-integer runtime off bigint](/quest/m2/ts-wide-bigint.md) - checked sums, 128-bit quotients, and comparisons with numbers stop going through `bigint`, kept only if measured faster - [Drop in the TypeScript translator](/quest/m2/ts-drop.md) - every value that drops in moq-net and kio drops where Rust drops it - [Async in the TypeScript translator](/quest/m2/ts-async.md) - moq-net's and kio's async code translates with Rust's lazy futures diff --git a/quest/m2/ts-bench-minified.md b/quest/m2/ts-bench-minified.md new file mode 100644 index 000000000..233340a25 --- /dev/null +++ b/quest/m2/ts-bench-minified.md @@ -0,0 +1,20 @@ +# [XS] Time the minified bundles + +## Goal + +`just ts bench` times the same minified bundles it measures for size, for every route +and engine, so speed calls judge what consumers ship. + +## Plan + +Decided with the maintainer on 2026-10-26, from +[#85](https://github.com/kixelated/rust2/pull/85): `ts/bench/main.ts` reports sizes +from `bundle(..., { minify: true })` but serves the pages unminified bundles, so a +minifier's renaming and restructuring never reaches the timings. + +- Serve each route's minified bundle, the hand-written and wasm routes included, so + every route is timed the same way. +- Record in the PR the A/A spread and each route's change against the unminified + timings, in Chrome first, then Firefox and Bun. + +Public API: none. diff --git a/quest/m2/ts-mir-size.md b/quest/m2/ts-mir-size.md index 31228f4e8..ebc6a75cd 100644 --- a/quest/m2/ts-mir-size.md +++ b/quest/m2/ts-mir-size.md @@ -4,7 +4,7 @@ [rust2-ts](/ts/README.md)'s bundles on `just ts bench` are no larger than the THIR lowering's were, without giving up the speed MIR gained: the codec's at most 30629 -bytes minified and 9422 gzipped, and the async handoff's at most 10949 and 3458. +bytes minified and 9422 gzipped, and the async handoff's at most 3458 gzipped. ## Plan @@ -33,6 +33,12 @@ Tried and dropped: in (`level2` into `level1` and on): exact, but it removes the depth the handoff measures, and moq-net's wrappers await `kio::wait`, not such an `async fn`. +Decided with the maintainer on 2026-10-26, from +[#85](https://github.com/kixelated/rust2/pull/85): the handoff's target is gzipped +only. Its minified gap is the fixture's repeated one-await classes, which only a +shared driver (measured slower or larger) or collapsing the wrappers (which empties +the bench) would close. + Generators and closures stay out: they measured 1.4-5.5x and 1.3-1.8x slower on the handoff. Coroutine fields stay private. From 5446e17a7596066eda1ec929548eab5b1f2197ea Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Mon, 26 Oct 2026 14:15:27 -0700 Subject: [PATCH 2/7] chore(quest): plan #83's follow-ups Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn --- quest/m2/README.md | 3 +++ quest/m2/ts-ref-shapes.md | 17 +++++++++++++++++ quest/m2/ts-shared-read.md | 20 ++++++++++++++++++++ quest/m2/ts-tsc-shapes.md | 17 +++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 quest/m2/ts-ref-shapes.md create mode 100644 quest/m2/ts-shared-read.md create mode 100644 quest/m2/ts-tsc-shapes.md diff --git a/quest/m2/README.md b/quest/m2/README.md index 32ba80061..e3425c16c 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -33,6 +33,9 @@ The fork's feature quests folded into the [exporter](/quest/m1/ffi-export.md); - [Drop in the TypeScript translator](/quest/m2/ts-drop.md) - every value that drops in moq-net and kio drops where Rust drops it - [Async in the TypeScript translator](/quest/m2/ts-async.md) - moq-net's and kio's async code translates with Rust's lazy futures - [Shared ownership](/quest/m2/ts-shared.md) - `Arc`/`Rc`/`Weak` keep exact counts, and locks and atomics become plain values +- [Share a held-back read across a call](/quest/m2/ts-shared-read.md) - `leading-ones` decode recovers what #83's copy fix cost +- [Output tsc accepts for writes through Result and Poll compares](/quest/m2/ts-tsc-shapes.md) - two shapes whose output fails `tsc` type-check +- [Translate derived == through references and slice index writes](/quest/m2/ts-ref-shapes.md) - two refused shapes #83's tests hit - [Translate char and vec![x]](/quest/m2/ts-char-vec.md) - `char` values and `vec![x]` translate, unblocking moq-net's refused sites - [Firefox in the TS benchmark](/quest/m2/ts-bench-firefox.md) - SpiderMonkey joins Chrome, Bun, and Node in `just ts bench` - [Translate moq-net's model to TypeScript](/quest/m2/ts-model.md) - the driver grows from moq-net's codec to its model, for moq to compare against WASM diff --git a/quest/m2/ts-ref-shapes.md b/quest/m2/ts-ref-shapes.md new file mode 100644 index 000000000..f9bb1f9a0 --- /dev/null +++ b/quest/m2/ts-ref-shapes.md @@ -0,0 +1,17 @@ +# [S] Translate derived == through references and slice index writes + +## Goal + +rust2-ts translates `<&T as PartialEq>::eq`, which a derived `==` on an enum holding +references reaches, and `live[0] = x` on a `&mut [u8]` parameter, proven by +differential tests against native Rust. + +## Plan + +Found by [#83](https://github.com/kixelated/rust2/pull/83)'s tests on 2026-10-26. +Both are refused with a span today: the first as unsupported, the second as a raw +pointer. + +- Report each one's count in moq-net's census before and after. + +Public API: the translator's output. diff --git a/quest/m2/ts-shared-read.md b/quest/m2/ts-shared-read.md new file mode 100644 index 000000000..cefa252a8 --- /dev/null +++ b/quest/m2/ts-shared-read.md @@ -0,0 +1,20 @@ +# [XS] Share a held-back read across a call + +## Goal + +`Decoder::varint`'s `leading-ones` decode on `just ts bench` is back to its speed before +[#83](https://github.com/kixelated/rust2/pull/83) in Chrome, with every differential +test still passing. + +## Plan + +Decided with the maintainer on 2026-10-26: #83 fixed a silent copy miscompile and +accepted a 2-19% `leading-ones` decode cost in Node and Chromium to do it. The +translator now copies `self.form` before calling `read`, because an earlier pass stops +holding back the read of `self.form` before that call, so the call can't share it. + +- Let the held-back read reach the call when nothing between them can change the + source, so `self.form` is shared again without a copy. +- Prove the read is still exact with the argument-aliasing cases #83 added. + +Public API: the translator's output. diff --git a/quest/m2/ts-tsc-shapes.md b/quest/m2/ts-tsc-shapes.md new file mode 100644 index 000000000..a7c6b2efa --- /dev/null +++ b/quest/m2/ts-tsc-shapes.md @@ -0,0 +1,17 @@ +# [S] Output tsc accepts for writes through Result and Poll compares + +## Goal + +Translated code that `tsc` rejects today type-checks and matches native Rust in +differential tests: writing through `if let Err(e) = &mut res { *e += 1 }`, and +comparing a `Poll` whose state TypeScript can see with `rt.Pending`. + +## Plan + +Found by [#83](https://github.com/kixelated/rust2/pull/83)'s tests on 2026-10-26. +The first writes the read-only `rt.Result.error`; the second narrows the `Poll` so +the comparison has no overlap. Both fail `tsc`, so they are loud, not silent. + +- Fix each in the lowering or the runtime's types, not by casting at the call site. + +Public API: the translator's output and `rt`'s types. From dd309c0268f31f069b943baee01ece341223cc45 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Mon, 26 Oct 2026 14:23:59 -0700 Subject: [PATCH 3/7] chore(quest): time Timestamp's u128 paths Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn --- quest/m2/README.md | 1 + quest/m2/ts-bench-timestamp.md | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 quest/m2/ts-bench-timestamp.md diff --git a/quest/m2/README.md b/quest/m2/README.md index e3425c16c..15028c6ae 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -28,6 +28,7 @@ The fork's feature quests folded into the [exporter](/quest/m1/ffi-export.md); - [Cheaper byte slices](/quest/m2/ts-byte-views.md) - splitting a `&[u8]` stops making a `Uint8Array` view per split - [Smaller output from MIR](/quest/m2/ts-mir-size.md) - the bench's bundles shrink back to THIR's sizes, coroutine classes first +- [Time Timestamp's checked_add and Ord](/quest/m2/ts-bench-timestamp.md) - the `u128` paths #89 sped up get a Chrome timing - [Time the minified bundles](/quest/m2/ts-bench-minified.md) - `just ts bench` times what it measures for size, as consumers ship it - [Wide-integer runtime off bigint](/quest/m2/ts-wide-bigint.md) - checked sums, 128-bit quotients, and comparisons with numbers stop going through `bigint`, kept only if measured faster - [Drop in the TypeScript translator](/quest/m2/ts-drop.md) - every value that drops in moq-net and kio drops where Rust drops it diff --git a/quest/m2/ts-bench-timestamp.md b/quest/m2/ts-bench-timestamp.md new file mode 100644 index 000000000..6d00143d6 --- /dev/null +++ b/quest/m2/ts-bench-timestamp.md @@ -0,0 +1,21 @@ +# [XS] Time Timestamp's checked_add and Ord in the TS benchmark + +## Goal + +`just ts bench` times moq-net's `Timestamp::checked_add` and `Ord`, whose `u128` +cross products the wide runtime now computes in limbs, in Chrome, Firefox and Bun +with the A/A control. + +## Plan + +Decided with the maintainer on 2026-10-26, from +[#89](https://github.com/kixelated/rust2/pull/89): its Node/Bun microbench put +`checked_add` and `saturating_sub` 20-100x faster, but no bench workload reaches them, +so Chrome never timed them. + +- Add the workload beside `time/u128`, drawing its inputs from the wasm32 build as + the other workloads do. +- The remaining 128-bit `bigint` paths (bitwise ops, shifts, `leading_*`, `try_from`) + stay until a consumer reaches them. + +Public API: none. From 62445e3c25b5e0121994d63f1c5568caaf2951fc Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Mon, 26 Oct 2026 14:54:57 -0700 Subject: [PATCH 4/7] chore(quest): wait on Swift 6.4 to move the fixtures back to arm Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn --- quest/m2/README.md | 1 + quest/m2/uniffi-swift-arm.md | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 quest/m2/uniffi-swift-arm.md diff --git a/quest/m2/README.md b/quest/m2/README.md index 15028c6ae..1846e2b9c 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -41,4 +41,5 @@ The fork's feature quests folded into the [exporter](/quest/m1/ffi-export.md); - [Firefox in the TS benchmark](/quest/m2/ts-bench-firefox.md) - SpiderMonkey joins Chrome, Bun, and Node in `just ts bench` - [Translate moq-net's model to TypeScript](/quest/m2/ts-model.md) - the driver grows from moq-net's codec to its model, for moq to compare against WASM - [Symlinked paths](/quest/m2/uniffi-symlink-path.md) - the fork builds when a consumer reaches it through a symlink, as on macOS's `/var` +- [Waiting: Swift 6.4 in nixpkgs-unstable](/quest/m2/uniffi-swift-arm.md) - the nightly UniFFI fixtures move back to arm - [Waiting: ubrn reads UniFFI 0.32](/quest/m2/ubrn-release.md) - the binding benchmark's browser runner pins a ubrn release, not an open PR diff --git a/quest/m2/uniffi-swift-arm.md b/quest/m2/uniffi-swift-arm.md new file mode 100644 index 000000000..db80e9377 --- /dev/null +++ b/quest/m2/uniffi-swift-arm.md @@ -0,0 +1,20 @@ +# [XS] Waiting: Swift 6.4 in nixpkgs-unstable + +## Goal + +The nightly `uniffi-fixtures` job runs on `ubuntu-24.04-arm` again, and +`nix develop .#uniffi` evaluates on aarch64-linux. Check: the latest +`nixpkgs-unstable` carries Swift 6.4.0 +([NixOS/nixpkgs#574002](https://github.com/NixOS/nixpkgs/pull/574002), merged to +`staging`), and `nix build --dry-run .#devShells.aarch64-linux.uniffi` succeeds +after a bump. + +## Plan + +Decided with the maintainer on 2026-10-26, from +[#93](https://github.com/kixelated/rust2/pull/93): swiftc 6.3.3 is marked broken on +aarch64-linux in the pinned nixpkgs, where its gold link fails, so the job moved to +x86_64. Then bump the `nixpkgs` input in its own change, move the job back, and +drop the workflow comment. Never allow the broken package. + +Public API: none. From 1bf7843d0b20bc5acb2c721b0b76194ff7370a73 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Mon, 26 Oct 2026 15:20:41 -0700 Subject: [PATCH 5/7] chore(quest): #76's follow-ups in the ffi-export quest Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn --- quest/m1/ffi-export.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quest/m1/ffi-export.md b/quest/m1/ffi-export.md index 68ea66c2e..021fc0535 100644 --- a/quest/m1/ffi-export.md +++ b/quest/m1/ffi-export.md @@ -33,6 +33,10 @@ census refuses and what moq waits on: - ✅ One header, `include/.h`. - ✅ One `ffi.toml`, with a `[crates.]` table per other export, and `--census ` writing `.md` for each. + - Landed in [#76](https://github.com/kixelated/rust2/pull/76). Next, decided with the + maintainer on 2026-10-26: the glue also carries `[patch]` and `[replace]` from + `.cargo/config.toml`, as it already does from the workspace manifest. moq-clock is + merging into kio, so its export moves with it and its C names wait until then. - **Driving**: sessions and origins run a `Driver` polled with a time and a `kio::Waiter`. Decide between exporting that poll, a generated thread that drives it, or moq-tokio's runtime helpers. From 96103af62e953366c2b639e83186d3a790a101bf Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Mon, 26 Oct 2026 15:23:19 -0700 Subject: [PATCH 6/7] chore(quest): plan #86's follow-ups Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn --- quest/m2/README.md | 2 ++ quest/m2/ts-store-alias.md | 23 +++++++++++++++++++++++ quest/m2/ts-str-char.md | 18 ++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 quest/m2/ts-store-alias.md create mode 100644 quest/m2/ts-str-char.md diff --git a/quest/m2/README.md b/quest/m2/README.md index ffca8e37e..04147d2f7 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -34,6 +34,8 @@ The fork's feature quests folded into the [exporter](/quest/m1/ffi-export.md); - [Drop in the TypeScript translator](/quest/m2/ts-drop.md) - every value that drops in moq-net and kio drops where Rust drops it - [Async in the TypeScript translator](/quest/m2/ts-async.md) - moq-net's and kio's async code translates with Rust's lazy futures - [Shared ownership](/quest/m2/ts-shared.md) - `Arc`/`Rc`/`Weak` keep exact counts, and locks and atomics become plain values +- [Copy what a container stores](/quest/m2/ts-store-alias.md) - `push` and other stores of a `Copy` aggregate copy it instead of sharing it +- [str and String methods over char](/quest/m2/ts-str-char.md) - `chars`, `char` patterns, and `String::push` translate, unblocking `ietf/namespace.rs` - [Share a held-back read across a call](/quest/m2/ts-shared-read.md) - `leading-ones` decode recovers what #83's copy fix cost - [Output tsc accepts for writes through Result and Poll compares](/quest/m2/ts-tsc-shapes.md) - two shapes whose output fails `tsc` type-check - [Translate derived == through references and slice index writes](/quest/m2/ts-ref-shapes.md) - two refused shapes #83's tests hit diff --git a/quest/m2/ts-store-alias.md b/quest/m2/ts-store-alias.md new file mode 100644 index 000000000..990f2807a --- /dev/null +++ b/quest/m2/ts-store-alias.md @@ -0,0 +1,23 @@ +# [S] Copy what a container stores + +## Goal + +Storing a by-value `Copy` aggregate in a container copies it, as Rust does: +`v.push(pair); v.push(pair); v[0].0 ^= 1` leaves `v[1]` and `pair` unchanged in +translated TypeScript. Differential tests against native Rust cover `Vec::push`, +`insert`, `VecDeque::push_back`, map inserts, and `Box::new`. + +## Plan + +Found by [#86](https://github.com/kixelated/rust2/pull/86) on 2026-10-26, and it +still reproduces after [#83](https://github.com/kixelated/rust2/pull/83)'s typed +copies: 1280 differences against native Rust in its probe. It is a silent miscompile. + +- The cause is the share analysis in `ts/src/lower/mir/mod.rs`: it sees a later change + made in place through a local, not through a container element, so it shares the + argument instead of copying it. +- Fix it there, once for every std call that stores a by-value argument, not in each + mapping. +- Measure the codec bench before and after. + +Public API: the translator's output. diff --git a/quest/m2/ts-str-char.md b/quest/m2/ts-str-char.md new file mode 100644 index 000000000..b888a906e --- /dev/null +++ b/quest/m2/ts-str-char.md @@ -0,0 +1,18 @@ +# [S] str and String methods over char + +## Goal + +rust2-ts translates `str::chars`, the `str` methods that take a `char` pattern, +`char::is_ascii_digit`, and `String::push` through `&mut String`, so moq-net's +`ietf/namespace.rs` translates, proven by differential tests against native Rust. + +## Plan + +Found by [#86](https://github.com/kixelated/rust2/pull/86)'s census on 2026-10-26, +after `char` values themselves translate. `String::push` through `&mut String` is the +one that blocks `ietf/namespace.rs`. + +- Cover multi-byte and surrogate-boundary characters in the differential tests. +- Report moq-net's census before and after. + +Public API: the translator's output. From bfde604d49d114a0fe42e5350f89d6cd21652bff Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Mon, 26 Oct 2026 16:24:40 -0700 Subject: [PATCH 7/7] chore(quest): config files carry only [patch] Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn --- quest/m1/ffi-export.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/quest/m1/ffi-export.md b/quest/m1/ffi-export.md index 021fc0535..4510fdf92 100644 --- a/quest/m1/ffi-export.md +++ b/quest/m1/ffi-export.md @@ -34,8 +34,9 @@ census refuses and what moq waits on: - ✅ One `ffi.toml`, with a `[crates.]` table per other export, and `--census ` writing `.md` for each. - Landed in [#76](https://github.com/kixelated/rust2/pull/76). Next, decided with the - maintainer on 2026-10-26: the glue also carries `[patch]` and `[replace]` from - `.cargo/config.toml`, as it already does from the workspace manifest. moq-clock is + maintainer on 2026-10-26: the glue also carries the `[patch]` tables cargo reads + from `.cargo/config.toml` (config has no `[replace]`), with cargo's precedence + between config and manifest and paths relative to the config file. moq-clock is merging into kio, so its export moves with it and its C names wait until then. - **Driving**: sessions and origins run a `Driver` polled with a time and a `kio::Waiter`. Decide between exporting that poll, a generated thread that drives it, or moq-tokio's