diff --git a/quest/m4/README.md b/quest/m4/README.md index a36d84b77..d92634831 100644 --- a/quest/m4/README.md +++ b/quest/m4/README.md @@ -28,5 +28,7 @@ build's retired instructions by 16%. ## Required +- [Bump the build benchmark's moq pin past poll-first](/quest/m4/bench-moq-pin.md) - the benchmark builds moq after poll-first, so its hub edit rebuilds the 10 crates main does +- [Bench TPDE on moq](/quest/m4/tpde.md) - what TPDE cuts from moq's clean build and non-incremental edit; waits on `-Zllvm-tpde` reaching a nightly - [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/bench-moq-pin.md b/quest/m4/bench-moq-pin.md new file mode 100644 index 000000000..d41a9eedb --- /dev/null +++ b/quest/m4/bench-moq-pin.md @@ -0,0 +1,27 @@ +# [S] Bump the build benchmark's moq pin past poll-first + +## Goal + +The `moq` corpus in [corpus.toml](/bench/build/corpus.toml) pins a moq main +after poll-first ([moq-dev/moq#7607](https://github.com/moq-dev/moq/pull/7607)), +so the benchmark measures the moq its developers edit: the hub edit rebuilds the +10 crates it rebuilds at main, not the pin's 8, and the async body edit is a +thin wrapper over a `poll_*` function, as moq's rule makes it. + +## Plan + +Decided with the maintainer on 2026-11-07: m4. Found by the subset-compiler +report ([moq-dev/rust2#615](https://github.com/moq-dev/rust2/pull/615)), which +measured at moq main because the pin (`f36c848`) predates poll-first. + +- Land the bump on its own, as corpus.toml asks, so no report compares numbers + across it. +- Update what names the old tree: the `sync` and `async` lines (at main, + `Session::closed` awaits `poll_closed`), the `test` package versions, and the + bench README's moq notes, such as the ra-jit bugs seen at the pin. At main, + the report saw `edit-async` fall back on usage-argv's `parsed_values_given`. +- `moq-pure-crypto` is the old rev plus moq's `spike/pure-crypto` branch, so the + bump leaves it comparing a different tree. Recommended: merge moq main into a + new spike branch in moq-dev/moq and pin that, so the comparison still holds. +- Out of scope: [nix.toml](/bench/build/nix.toml)'s own moq pin, which the Nix + comparison keeps for crane's dependency layer. diff --git a/quest/m4/tpde.md b/quest/m4/tpde.md new file mode 100644 index 000000000..56b51ed60 --- /dev/null +++ b/quest/m4/tpde.md @@ -0,0 +1,40 @@ +# [M] Bench TPDE on moq + +## Goal + +The [build-speed benchmark](/bench/build/README.md) gains a `tpde` variant, on +the nightly that ships `-Zllvm-tpde`, against `nightly` in the same job. Its +report says how much TPDE, a fast O0 machine-code generator for LLVM IR, cuts +moq's clean build and non-incremental hub edit, and how many codegen units fall +back to LLVM. + +## Plan + +Decided with the maintainer on 2026-11-07: m4. + +What it targets, from the subset-compiler report +([moq-dev/rust2#615](https://github.com/moq-dev/rust2/pull/615)) at moq main: +LLVM is 21% of a clean build's rustc self-time and 28% of a non-incremental +moq-net edit's (36% with building the IR, which TPDE does not replace), almost +all of it O0 machine-code emission. The incremental edit spends 0.1% in LLVM, +so expect nothing there. Cranelift, the existing lever on the same step, cut +instructions by 16% clean and 25% on the non-incremental edit. + +- Bump the nightly in `flake.nix` to one that ships the flag, then add the + variant beside `cranelift` in [corpus.toml](/bench/build/corpus.toml), with + the same scenarios. `nightly` moves with the bump, so the variant's change + compares within one run. +- Recommended: `-Zllvm-tpde=try`, which falls back to LLVM per module where + TPDE fails (inline and global assembly, SIMD, sanitizers); `=only` fails the + build instead. Report the fallback count. +- Recommended: list it in the nightly moq job in + [bench.yml](/.github/workflows/bench.yml) beside `cranelift`, since upstream + plans to optimize the TPDE path after it lands. + +## Waiting + +- rust-lang/rust: [rust-lang/rust#164108](https://github.com/rust-lang/rust/pull/164108) + adds `-Zllvm-tpde`. Check that it merged and that a nightly from + `rust-bin.nightly` in `flake.nix` accepts the flag: `rustc -Z help` lists + `llvm-tpde`, and a `-Zllvm-tpde=only` build of a hello world succeeds, since + a shipped toolchain may build without TPDE.