Repository navigation
quest(m5): key moq-net's model by explicit ids, with no cfg(rust2_ts) twins #8124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,16 +15,31 @@ rust2-ts stays general, translating safe dependencies from source and refusing ` | |||||||||||
| and trait objects, so the moq-specific changes are made here. Waits until rust2's epic | ||||||||||||
| reaches the model; none of these changes behavior. | ||||||||||||
|
|
||||||||||||
| - Safe twins, under `cfg(rust2_ts)`, which rust2-ts's driver passes, for the internal | ||||||||||||
| `unsafe`: | ||||||||||||
| `model/group.rs`'s `MaybeUninit` frame ring, `NonNull` in `track.rs` and | ||||||||||||
| `track/demand/ranges.rs`, `cache.rs`'s pointer identity, `frame.rs`'s `Segment`, and | ||||||||||||
| kio's lock-free `log`. Differential tests cover the twins, and native builds keep the | ||||||||||||
| `unsafe` versions. | ||||||||||||
| - `Track` and `FrameContent` take a unique id at construction, a `u64` from a counter, and | ||||||||||||
| key `cache.rs`'s deadlines and `frame.rs`'s per-group frames by it in place of their | ||||||||||||
| addresses (`Arc::as_ptr(..) as usize`, and `ptr::from_ref(self) as usize` in `Drop`). | ||||||||||||
| rust2-ts refuses every address read, while `ptr::eq` and `Arc::ptr_eq` translate. | ||||||||||||
| - The internal `unsafe`: `model/group.rs`'s `MaybeUninit` frame ring, `NonNull` in | ||||||||||||
| `track.rs` and `track/demand/ranges.rs`, `frame.rs`'s `Segment`, and kio's lock-free | ||||||||||||
|
Comment on lines
+22
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model's
Suggested change
Technical details# The `NonNull` census entry points at no code
## Affected sites
- `quest/m5/rs2ts-model-subset.md:22-23` — lists `NonNull` in `track.rs` and `track/demand/ranges.rs`.
- `rs/moq-net/src/model/track.rs` and `rs/moq-net/src/model/track/demand/ranges.rs` — no `unsafe` and no `NonNull` at this head.
- `rs/moq-net/src/model/frame.rs:859` — `Segment` is the only `unsafe` in the model besides `group.rs`'s `MaybeUninit` ring.
- `rs/kio/src/log.rs:27` — the only `NonNull` in the model's path, already covered by the separate kio `log` item.
## Required outcome
- Drop the `NonNull` clause or re-point it at the real `unsafe` sites. |
||||||||||||
| `log`. Each is either rewritten in safe Rust for both builds, at measured native cost, or | ||||||||||||
| left for rust2-ts's [unsafe epic](https://github.com/moq-dev/rust2/blob/main/quest/m3/ts-unsafe/README.md) | ||||||||||||
|
Comment on lines
+24
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The plan offers "left for rust2-ts's unsafe epic to translate as is" for every item, but rust2's model epic says
Suggested change
Technical details# `kio`'s log cannot be left to the unsafe epic
## Affected sites
- `quest/m5/rs2ts-model-subset.md:24-25` — the plan allows leaving each item to rust2-ts's unsafe epic.
- `rs/kio/src/log.rs:34` — imports `crossbeam_epoch`.
- `rs/kio/Cargo.toml:46` — `crossbeam-epoch = "0.9.21"`.
- rust2's model epic (`quest/m2/ts-model/README.md`) says `kio`'s `log.rs` retires through crossbeam-epoch, whose tagged pointers and inline closures translation refuses "for good".
## Required outcome
- Scope the "left for the unsafe epic" option to the items the epic can model, or state that `kio`'s log must be rewritten or dropped. |
||||||||||||
| to translate as is. | ||||||||||||
| - `group.rs`'s `dyn Expiry` becomes an enum of its two implementations. | ||||||||||||
| - Drop `hashlink`, `slab`, and `smallvec` from the model's path where a std type does the | ||||||||||||
| job at measured cost, or bind them to hand-written TS through rust2-ts's config. | ||||||||||||
|
|
||||||||||||
| Decided with the rust2 maintainer on 2026-11-07, in | ||||||||||||
| [rust2's model epic](https://github.com/moq-dev/rust2/blob/main/quest/m2/ts-model/README.md), | ||||||||||||
| after rust2-ts's designs for addresses as identity | ||||||||||||
| ([moq-dev/rust2#596](https://github.com/moq-dev/rust2/pull/596)) kept leaking: | ||||||||||||
|
|
||||||||||||
| - ✅ Explicit ids for the two address keys, the same in both builds (rejected: a | ||||||||||||
| `cfg(rust2_ts)` twin; rust2-ts translating `Arc` addresses). | ||||||||||||
| - ✅ No `cfg(rust2_ts)` twins anywhere: every change here is the same in native and | ||||||||||||
| translated builds (rejected: twins until rust2-ts translates the `unsafe`). | ||||||||||||
| - ✅ Whether each `unsafe` item is rewritten or waits on rust2-ts is decided per item when | ||||||||||||
| this quest starts (rejected: deciding now). | ||||||||||||
|
|
||||||||||||
| Public API: none. | ||||||||||||
|
|
||||||||||||
| ## Required | ||||||||||||
|
|
||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parenthetical names
Arc::as_ptrandptr::from_ref, butframe.rs'sDropusesself as *const SelfandSharedWeak::addressusesas_ptr, so those twoframe.rsreads are not explicit. Naming the four reads makes the plan's checklist complete.Technical details