From 6bf200d24d83ce9e41727133b66f3187bfe877c9 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 6 Nov 2026 13:31:58 -0800 Subject: [PATCH 1/4] chore(quest): claim quest/m4/subset-compiler.md Quest-Claim: 5a5d15a7fcc173d2 From 716d1bc28b45d4af50f8dcce675573639342f3f5 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 6 Nov 2026 18:51:42 -0800 Subject: [PATCH 2/4] chore(quest): report that a subset compiler would not beat rustc on moq Co-Authored-By: Claude Opus 5.5 --- quest/README.md | 2 +- quest/m4/README.md | 8 +++++++- quest/m4/subset-compiler.md | 40 ------------------------------------- 3 files changed, 8 insertions(+), 42 deletions(-) delete mode 100644 quest/m4/subset-compiler.md diff --git a/quest/README.md b/quest/README.md index 01d837c1c..98b764ae1 100644 --- a/quest/README.md +++ b/quest/README.md @@ -33,4 +33,4 @@ Decided with the maintainer on 2026-10-23, when rust2 was planned from moq - [m1: consumers waiting](/quest/m1/README.md) - the exporter that replaces the UniFFI fork for moq - [m2: research](/quest/m2/README.md) - the TypeScript translator's spikes and features toward moq-net's model, and the fork's gated work - [m3: deferred](/quest/m3/README.md) - the pure-Rust profile and upstream's build-speed levers, measured by the benchmark -- [m4: long-term research](/quest/m4/README.md) - ideas no consumer needs yet, such as a subset compiler +- [m4: long-term research](/quest/m4/README.md) - ideas no consumer needs yet, such as a rustc and cargo fork diff --git a/quest/m4/README.md b/quest/m4/README.md index 6ee8d66f3..f39b7376e 100644 --- a/quest/m4/README.md +++ b/quest/m4/README.md @@ -18,8 +18,14 @@ only 7% of moq-net edits [moq-dev/rust2#70](https://github.com/moq-dev/rust2/pull/70)). [The fork](/quest/m4/fork.md) collects the reasons to change rustc and cargo instead. +Closed on 2026-11-06: a compiler for a stricter Rust subset +([moq-dev/rust2#615](https://github.com/moq-dev/rust2/pull/615)). 69% of the +LLVM IR moq's own crates emit is std's and dependencies' generics instantiated +at moq's types, closures included, so it would have to compile std too. Levers +that need no new frontend reach its best case: ra-jit already rebuilds moq-net +body edits in under half a second, and Cranelift cuts a clean build by 16%. + ## Required -- [A subset compiler](/quest/m4/subset-compiler.md) - whether a compiler for a stricter Rust subset can beat rustc on moq's builds, given the verdict that closed it before - [Waiting: a rustc and cargo fork](/quest/m4/fork.md) - the evidence ledger for carrying a fork; condition: enough measured reasons to pay for one - [moq in pure Go](/quest/m4/go/README.md) - rust2-go translating moq-net, with no cgo, fast enough to replace the cgo bindings for Go users diff --git a/quest/m4/subset-compiler.md b/quest/m4/subset-compiler.md deleted file mode 100644 index c62a23300..000000000 --- a/quest/m4/subset-compiler.md +++ /dev/null @@ -1,40 +0,0 @@ -# [XL] A subset compiler - -## Goal - -A report deciding whether a compiler for a stricter subset of Rust could build moq -faster than rustc can after moq adopts its own build rules. The subset is -poll-first code with no `async fn` in libraries, thin generics, and few proc -macros. The report names the subset, the speedup it predicts on moq's -clean build and moq-net edit, and how its output links with crates rustc builds. - -## Plan - -Decided with the maintainer on 2026-10-25: allow a custom compiler as long-term -research, after moq's -[poll-first](https://github.com/moq-dev/moq/blob/main/quest/m1/poll-first/README.md) -and thin-generics work. - -The [edit attribution](https://github.com/moq-dev/rust2/pull/22) closed the -earlier version. What a revival has to answer: - -- **Most of the edit is rebuilding dependents:** 65% of the moq-net edit's - critical path is crates rebuilt only because it changed. A public API hash - could skip them ([relink](/quest/m3/relink.md)), but the - [semantic API hash replay](https://github.com/moq-dev/rust2/pull/62) found - that a sound one holds on 18 of 250 non-test moq-net edits. -- **What is left scales with the crate:** expansion, resolution, crate-wide - analysis, and incremental I/O. A subset compiler would have to make these - incremental per item, as Zig's compiler does, to win. -- **Linking:** it can't read or write rustc's unstable metadata, so it must own - whole crates, with a C ABI or rustc-built shims at the boundary. -- **Few proc macros buys little on edits:** the - [macro cost report](https://github.com/moq-dev/rust2/pull/64) found that - running proc macros is about 5% of the moq-net edit, which - `-Z cache-proc-macros` already removes, and compiling them is a clean-build - cost. The largest share of macro output is tracing's `macro_rules!`, - re-expanded in full on every rebuild. -- **Evidence to collect first:** - - the [monomorphization budget](https://github.com/moq-dev/rust2/pull/65) numbers. - -Public API: none. From b69344d7670f8440afd2a1d1bd26010166124b58 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 6 Nov 2026 18:51:46 -0800 Subject: [PATCH 3/4] chore(quest): count only std's and dependencies' generics Co-Authored-By: Claude Opus 5.5 --- quest/m4/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quest/m4/README.md b/quest/m4/README.md index f39b7376e..4618909cf 100644 --- a/quest/m4/README.md +++ b/quest/m4/README.md @@ -19,7 +19,7 @@ only 7% of moq-net edits [The fork](/quest/m4/fork.md) collects the reasons to change rustc and cargo instead. Closed on 2026-11-06: a compiler for a stricter Rust subset -([moq-dev/rust2#615](https://github.com/moq-dev/rust2/pull/615)). 69% of the +([moq-dev/rust2#615](https://github.com/moq-dev/rust2/pull/615)). 61% of the LLVM IR moq's own crates emit is std's and dependencies' generics instantiated at moq's types, closures included, so it would have to compile std too. Levers that need no new frontend reach its best case: ra-jit already rebuilds moq-net From 6b42c0e78d5cc2361ba2c51b8a22c30b8fb14cd5 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 6 Nov 2026 20:43:12 -0800 Subject: [PATCH 4/4] quest: qualify m4's subset-compiler summary as instructions and served edits Co-Authored-By: Claude Opus 5.5 --- quest/m4/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/quest/m4/README.md b/quest/m4/README.md index 4618909cf..a36d84b77 100644 --- a/quest/m4/README.md +++ b/quest/m4/README.md @@ -22,8 +22,9 @@ Closed on 2026-11-06: a compiler for a stricter Rust subset ([moq-dev/rust2#615](https://github.com/moq-dev/rust2/pull/615)). 61% of the LLVM IR moq's own crates emit is std's and dependencies' generics instantiated at moq's types, closures included, so it would have to compile std too. Levers -that need no new frontend reach its best case: ra-jit already rebuilds moq-net -body edits in under half a second, and Cranelift cuts a clean build by 16%. +that need no new frontend reach its best case: ra-jit already applies the +moq-net body edits it serves in under half a second, and Cranelift cuts a clean +build's retired instructions by 16%. ## Required