From 6f2a70ef7e23ff2352a2ca6b11e85a2174e2b406 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Fri, 30 Oct 2026 18:09:50 -0700 Subject: [PATCH] chore(quest): plan cloning std's iterators and the bench's A/B route Co-Authored-By: Claude Opus 5.5 --- quest/m3/README.md | 2 ++ quest/m3/ts-bench-route.md | 17 +++++++++++++++++ quest/m3/ts-iter-clone.md | 23 +++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 quest/m3/ts-bench-route.md create mode 100644 quest/m3/ts-iter-clone.md diff --git a/quest/m3/README.md b/quest/m3/README.md index 77debb463..36039e942 100644 --- a/quest/m3/README.md +++ b/quest/m3/README.md @@ -34,3 +34,5 @@ generic std gap is planned here even when moq never calls it. - [A parameter read only where lowering leaves nothing](/quest/m3/ts-unread-params.md) - an instance whose lowering drops every read of a parameter marks it unused, so `tsc` accepts it - [Zip's next_back in constant time](/quest/m3/ts-zip-back.md) - a reversed zip of random-access iterators skips the longer side's excess at once - [Unbounded ranges as iterators adaptors take](/quest/m3/ts-range-from-iter.md) - `iter.zip(0..)` and other adaptors taking a `start..` type-check +- [Cloning std's iterators](/quest/m3/ts-iter-clone.md) - `clone` of std's iterators and adaptors translates, each clone reading on independently +- [The TS benchmark's A/B route as documented](/quest/m3/ts-bench-route.md) - the README's A/B bench command runs as written diff --git a/quest/m3/ts-bench-route.md b/quest/m3/ts-bench-route.md new file mode 100644 index 000000000..4a502c0f0 --- /dev/null +++ b/quest/m3/ts-bench-route.md @@ -0,0 +1,17 @@ +# [XS] The TS benchmark's A/B route as documented + +## Goal + +The A/B run [the TS README](/ts/README.md#bench) documents times another checkout's +translation as one more route, as written. + +## Plan + +Found by [#314](https://github.com/moq-dev/rust2/pull/314) on 2026-10-30: +`just ts bench --route main=` fails, since the recipe takes `checkout` and `route` +as positional parameters and no `--route` flag, and `just` reads a positional +`main=` as a variable override, failing with "justfile does not contain recipe". +Make the recipe take the route the way the README shows, or the README show a form that +works, and run the documented command once to prove it. + +Public API: none. diff --git a/quest/m3/ts-iter-clone.md b/quest/m3/ts-iter-clone.md new file mode 100644 index 000000000..a082a8194 --- /dev/null +++ b/quest/m3/ts-iter-clone.md @@ -0,0 +1,23 @@ +# [S] Cloning std's iterators + +## Goal + +[rust2-ts](/ts/README.md) translates `clone` of std's iterators and adaptors, such as a +`zip`, a `map`, a `chars`, and a set operation's iterator, the clone reading on from where +the original was, independently of it, proven by differential tests against native Rust. + +## Plan + +Found by [#314](https://github.com/moq-dev/rust2/pull/314) writing its zip fixture, and +by [#302](https://github.com/moq-dev/rust2/pull/302), where the set operations' +iterators refuse `clone` as other std iterators do. Planned without a moq consumer, under +the maintainer's 2026-10-27 decision that rust2 aims to support all of std. + +- An `rt.Iter` that reads a collection by position clones its position; one that reads + another iterator clones that one too, as std's derived `Clone` does, and a closure an + adaptor holds is cloned as Rust clones the closure's captures. +- A clone must not share state the original advances: test both read after the clone, + in turns, including partially read ones, a zip past its shorter side, and adaptors whose + closures capture values that drop. + +Public API: the translator's output.