Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion quest/m2/ts-model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ read into a group, to the benchmark's workloads, which hold only its sync frame
codec's WASM route stays in the benchmark as the baseline of compiled Rust in a browser.

The codec's differential harness is the pattern to repeat. The shared npm runtime
(for checked integer ops and the rest of `rt.ts`) is published only once two
(for checked integer ops and the rest of `rs.ts`) is published only once two
generated packages need it.

Decided with the maintainer on 2026-10-23, for the subset: `u128` stays, on the
Expand Down
1 change: 0 additions & 1 deletion quest/m3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ generic std gap is planned here even when moq never calls it.

## Required

- [The runtime's namespace is rs](/quest/m3/ts-rs-rename.md) - translated code and hand-written callers import the runtime as `rs`, not `rt`
- [Retrial Cranelift on moq's tests](/quest/m3/cranelift-unwind.md) - waits on upstream: moq's tests pass under Cranelift, so its CI can weigh it again
- [Relink without rebuilding](/quest/m3/relink.md) - measure upstream's skip of dependency-only rebuilds on moq's edits once it reaches nightly
- [Unsafe code the translator can model](/quest/m3/ts-unsafe.md) - a dependency using only `unsafe` the translator can model translates from source
Expand Down
4 changes: 2 additions & 2 deletions quest/m3/ts-chunk-mut.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ against native Rust.

## Plan

`spare_capacity_mut` is an `rt.ByteSlice` of the storage past the length, and
`spare_capacity_mut` is an `rs.ByteSlice` of the storage past the length, and
`advance_mut` maps. An `UninitSlice` is `#[repr(transparent)]` over `[MaybeUninit<u8>]`,
so it can be the same `rt.ByteSlice`; `chunk_mut` reserves 64 bytes where there is no
so it can be the same `rs.ByteSlice`; `chunk_mut` reserves 64 bytes where there is no
room, as the runtime's `bytesMutRoom` and `byteVecRoom` already model. A generic
`B: BufMut`, the crate's own included, reaches it, as it is a required method. moq calls
neither.
4 changes: 2 additions & 2 deletions quest/m3/ts-dyn.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ config, so trait objects move from never to not yet.

- `dyn Debug` and `dyn Display` translate as functions writing their value, behind `&`,
`&mut`, `Box`, `Arc`, and `Rc`, `dyn Future`
as an `rt.Future`, `dyn Any` as the class a downcast checks for, `dyn Fn*` as the
closure itself, `dyn Iterator` and its subtraits as an `rt.Iter`, behind `&`, `&mut`,
as an `rs.Future`, `dyn Any` as the class a downcast checks for, `dyn Fn*` as the
closure itself, `dyn Iterator` and its subtraits as an `rs.Iter`, behind `&`, `&mut`,
`Box`, `Arc`, and `Rc`, and the translated
crates' traits as an object with the trait's methods. Build the rest on those.
- `dyn Error` translates as an object of `source`, `Debug`, and `Display`, whose downcasts
Expand Down
21 changes: 0 additions & 21 deletions quest/m3/ts-rs-rename.md

This file was deleted.

3 changes: 1 addition & 2 deletions quest/m3/ts-slice-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ whole write. Noting the origin costs, per shared part of 8 of 16 values, in ns:
| the origin as a symbol property | 27.4 | 30.6 |
| the origin in a `WeakMap` | 410 | 116 |

The object carries the array and start, and compares by them as `rt.ByteSlice` does.
The object carries the array and start, and compares by them as `rs.ByteSlice` does.

Public API: the translator's output and what a hand-written caller passes for a slice.

## Related

- [The runtime's namespace is rs](/quest/m3/ts-rs-rename.md) - runs in parallel
- [rs.String](/quest/m3/ts-string-capacity.md) - the other native mapping becoming a wrapper
1 change: 0 additions & 1 deletion quest/m3/ts-string-capacity.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ Public API: the translator's output and what a hand-written caller passes for a

## Related

- [The runtime's namespace is rs](/quest/m3/ts-rs-rename.md) - runs in parallel
- [rs.Slice](/quest/m3/ts-slice-object.md) - the other native mapping becoming a wrapper
2 changes: 1 addition & 1 deletion quest/m3/ts-uninit-slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ differential tests against native Rust.
## Plan

A `MaybeUninit<T>` is a `T` in JS, and one of a byte is the byte, so a `[MaybeUninit<u8>]`
is an `rt.ByteSlice`; `write_copy_of_slice` and a slice's `assume_init_ref` and
is an `rs.ByteSlice`; `write_copy_of_slice` and a slice's `assume_init_ref` and
`assume_init_mut` already map. `write_clone_of_slice` clones in without dropping what was
there, unlike `clone_from_slice`. Found translating `spare_capacity_mut`; no consumer calls
either yet.
14 changes: 7 additions & 7 deletions quest/m3/ts-unsafe.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ the consumer [at first](/ts/README.md#bindings), and moq gives its own `unsafe`
annotations or config; this quest is what retires them.

Decided with the maintainer on 2026-10-28, typed pointers: a raw pointer is what its
reference is, the object, an `rt.Place`, or `rt.NULL`, and a pointer into a slice or `Vec`
reference is, the object, an `rs.Place`, or `rs.NULL`, and a pointer into a slice or `Vec`
is `{ array, index }`. Byte reinterpretation, pointer-to-integer casts, and raw allocation
are refused with a span. [#201](https://github.com/moq-dev/rust2/pull/201) landed `Box`
to raw and back, `NonNull`, `MaybeUninit`, raw reads and writes, `get_unchecked`, and
Expand All @@ -25,7 +25,7 @@ none of its own `unsafe`.
- An `unsafe` operation outside the modeled set is refused with its span, as today.
- Undefined behavior in Rust need not be reproduced, but a translated program never
silently differs from native where Rust's behavior is defined.
- Element pointers into arrays of values JS copies are `rt.AtIndex`, `{ array, index }`,
- Element pointers into arrays of values JS copies are `rs.AtIndex`, `{ array, index }`,
which `add`, `offset`, `offset_from`, `ptr::copy`, and `slice::from_raw_parts` act on.
Decided with the maintainer on 2026-11-01: where one body shows a pointer crossing what
JS keeps apart (a value in no array, a copied shared subslice), translation refuses it
Expand All @@ -38,7 +38,7 @@ none of its own `unsafe`.
is a fresh JS array of `T`s, which `realloc` copies and `dealloc` frees. Untyped and
byte allocation stay refused. smallvec spills to it, and `Vec::from_raw_parts` of it is
left.
- Decided with the maintainer on 2026-11-02: a raw slice pointer is `rt.RawSlice`, its
- Decided with the maintainer on 2026-11-02: a raw slice pointer is `rs.RawSlice`, its
first element's pointer and its length, read through only where Rust reads, and an empty
slice from a pointer into no array keeps that pointer through every part of it.
- A union over a type parameter, whose layout has no fixed offsets until an instance
Expand Down Expand Up @@ -68,14 +68,14 @@ none of its own `unsafe`.
defines it, but a debug build aborts on a violated precondition where the checked form
panics with another message.
- `BinaryHeap` and `PeekMut` translate from std's MIR, whose `Hole` moves elements
through raw pointers into the `Vec`'s storage, replacing `rt.BinaryHeap` and
`rt.PeekMut`, the hand-written port of std's sifts that
through raw pointers into the `Vec`'s storage, replacing `rs.BinaryHeap` and
`rs.PeekMut`, the hand-written port of std's sifts that
[#252](https://github.com/moq-dev/rust2/pull/252) mapped them to and that must track
std's by hand. The lang fixture's `orders` differential case proves the translation
still matches std's comparisons, pop order, and drops.
- `Vec::drain` translates from std's MIR, whose `Drain` reads its range out and moves the
tail back through raw pointers into the `Vec`'s storage, replacing `rt.vecDrain` and
`rt.byteVecDrain`, the runtime port that
tail back through raw pointers into the `Vec`'s storage, replacing `rs.vecDrain` and
`rs.byteVecDrain`, the runtime port that
[the slice gaps' PR](https://github.com/moq-dev/rust2/pull/259) mapped it to. The lang
fixture's `slices::drains` differential case proves the translation still matches std's
items, drops, and what a forgotten drain leaves.
Expand Down
Loading