Skip to content

quest: plan the overnight follow-ups - #29

Merged
kixelated merged 9 commits into
mainfrom
plan/overnight-followups
Oct 24, 2026
Merged

kixelated merged 9 commits into
mainfrom
plan/overnight-followups

Conversation

@kixelated

@kixelated kixelated commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The overnight PRs (#13, #15, #16, #18, #26, #27, #28) left follow-ups and decisions, which the maintainer settled on 2026-10-24 (prompts below). They need to be quests.

Approach

New quests, each ranked in its milestone:

Build-speed research behind them (2026-10-24): rustc's SVH covers every body, so a reused dependent fails with E0460, and no build tool gets early cutoff for Rust today. A hash-patching wrapper is dropped: tinymold ran that spike (tinyhumansai/tinymold#13, ADR 0007) and hit E0460, and mbx rejected it as unsound (jdx/mr-boxington#645). mbx's numbers put dependents at about 1.1 s of a 1.7 s edit with incremental on, so the spike measures what incremental leaves and classifies edits by mbx's list of interface-relevant bodies. headstart (early interface-only metadata for clean builds) is not chosen for now; it also found rmeta def-id order unstable across incremental sessions, hence the determinism check. The OpenAI-funded cg_clif performance goal speeds up the backend, 6% of moq's edit, so it is not relevant. ra-jit hot-patches changed functions through Cranelift into the linked binary, claiming 12-24x, but treats async fn bodies as signatures.

Output goals, recorded in ts/README.md's Design and the m2 Plan: correctness first, speed second, and the consumer's final tree-shaken, minified JS third; readable output is not a goal; output stays .ts; types are solid at the API boundary (root items and printable types are branded), while internal casts stay since they compile away. The MIR spike now weighs its 1.4-2.6x speed ahead of its roughly 18% larger bundle. The README's opening line drops "readable".

  • m2 Tree-shaking spike [M]: classes everywhere, free functions everywhere, or free functions behind root-type class facades, measured on speed, a consumer's bun build --minify bundle, and caller code, with a survey of RxJS, Zod 4 mini, Valibot, Effect, date-fns, and wasm-bindgen.
  • m2 Tree-shakable runtime [M]: rt becomes individually exported functions, kept only if no slower, with a tree-shake test.

Into existing quests: Async gains ? in Poll-returning functions (about 224 ready!(..)? sites in moq-net) and the tsc error on a () future awaited as a statement; Drop gains owning a temporary held across an .await instead of refusing it.

Merged with main after #13, #21, #26, and #30 landed. #16 is still open: it deletes ts-async-spike.md, which these link to, and rewrites Drop and Async. Whichever merges second aligns the quests.

Impact

No public API change. ts/README.md records the output goals.

Alternatives

None beyond the prompts below.

Follow-ups

moq's side (the pure-crypto epic, the C name clash, the crate split rerun) is in moq-dev/moq#6659.

Decisions

  • Async feat(ts): async fns as generators and drops from THIR scopes, from the async spike #16: ✅ Merge feat(ts): async fns as generators and drops from THIR scopes, from the async spike #16 + MIR spike / Go to MIR now / Merge, stay on THIR
  • MIR spike scope: ✅ Whole lowering, 2 fixtures / Async and drops only
  • Wide feat(ts): wide integers are numbers while safe, and each integer type is branded #26: ✅ plain numbers, but brand every integer type with Rust type names / bigint / limbs everywhere
  • Naming: ✅ Always suffix / Leave as is
  • Suffix format: ✅ Rust-like suffix / Hash suffix
  • Crypto feat(bench): measure moq-relay on pure-Rust crypto #13: ✅ Adopt, all 7 recs / Keep measuring / Drop it
  • moq crypto split: ✅ Epic, 3 quests / One quest
  • TS gaps: ✅ ? in Poll fns, ✅ Await/drop gaps, ✅ ! edge cases / Unused self param
  • TS perf: ✅ Chrome timeout, ✅ A/B routes, ✅ Wide-int fast paths, ✅ Error-path workload
  • UniFFI: ✅ Drop C++ dead modes, ✅ C name clash, ✅ moq crate split rerun / Namespace edge cases
  • Build: ✅ No-C check / Early cutoff upstream / moq-net split
  • Ranking: Correct > size > speed / ✅ Correct > speed > size
  • Output: ✅ .ts, brands at boundary / .js + .d.ts / Both
  • Shaking: No classes, free functions / Classes, prove unused / Runtime only / ✅ (free text) "Spike both and measure, see what other libraries do; we want libraries that don't force callers into ugly code; maybe make it optional"
  • Variants: ✅ Classes everywhere, ✅ Free functions everywhere, ✅ Free inside, classes at roots / ts.toml option
  • Runtime: ✅ Runtime always free / Same as types
  • Boundary: ✅ Root items only / Every exported item. Clarified: casts are free in JS, so internal casts stay; no quest.
  • Bundler for size: ✅ Bun build, tree-shaken and minified (what the bench already uses) / Vite (considered; the maintainer said Bun is fine)
  • Build plan after the thread research: ✅ Re-scope cutoff spike, ✅ ra-jit bench variant / headstart later / None
  • Early cutoff goal: ✅ Spike, research first / Cargo replacement / Not now
  • First step: ✅ Measure real edits first / Carry #156940 / Wrapper prototype / Upstream only

(written by Opus 5.5)

🤖 Generated with Claude Code

https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T18:10:54.522562Z eae358a New commits
🔒 Security Review ✅ Completed 2026-10-24T18:11:40.750400Z eae358a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merging. Summary:

  • New m2 quests: the MIR lowering spike, stable names, ! edge cases, Chrome timeout, A/B routes, the error-path workload, wide-integer fast paths, the tree-shaking spike, the tree-shakable runtime, and deleting the C++ generator's dead modes.
  • New m3 quests: the no-C check, early cutoff (rust#156940 replayed over real moq-net edits), and an ra-jit benchmark variant.
  • Async and Drop gain the spike gate and the gaps found since. ts/README.md records the output goals.
  • Checks: just check and quest check --base origin/main --branch plan/overnight-followups pass, CI passes, and Codex had no findings on eae358a. just test was not run, since only quest files and README prose changed.
  • moq's side: quest: plan pure-Rust crypto, the C name clash, and the crate split rerun moq#6659 (open, not merged).

(written by Opus 5.5)

@kixelated
kixelated merged commit 2a7d9d9 into main Oct 24, 2026
1 check passed
@kixelated
kixelated deleted the plan/overnight-followups branch October 27, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant