Repository navigation
fix(ts): pick bench varint forms from versions moq still has, and type-check the bench - #229
Conversation
…e-check the bench #196's moq pin dropped Ietf DRAFT_16 and DRAFT_17, so the hand-written route passed undefined as both forms' versions, which moq reads as leading ones: its QUIC varint decode of 2 bytes and wider failed the output check. Use Lite DRAFT_06 for QUIC and DRAFT_07 for leading ones, typed as moq's StreamVersion, and type-check bench/ against moq at the pin in just check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head 7d80a0733882056d45e2e1c5d740298701bd78a1 against base 8a8d4b61d7b15fc63161e2134ffd091d5f3b5e7e.
No actionable findings. At the pinned MoQ revision 30f25c04e6d0288d87893dc609ba582518be2cf6, the stream codec explicitly treats Lite-06 as QUIC varints and Lite-07 as leading-ones, so the replacement versions match their encoders. Typing them as StreamVersion and checking the bench against that same checkout closes the missing-export gap without weakening the output comparisons.
The new tsconfig paths resolve from ts/bench to ts/target/moq; the check installs dependencies with the existing frozen-lockfile/ignore-scripts convention, and the default devshell already provides Bun and TypeScript. ArrayBuffer-specific byte annotations agree with the buffer constructors. Using the global property test avoids the DOM/webworker declaration conflict without changing normal page/worker selection.
The additional network/dependency-install requirement for check is an explicit tradeoff, not a local-only lint check anymore. GitHub-only static review of the diff, bench callers, recipes/devshell, and pinned upstream codec. No installation, typecheck, benchmark, cross-engine run, or CI was executed; reported round trips and timings were not independently reproduced.
Problem
just ts benchfails onmain. #196's moq pin droppedIetf.DRAFT_16andDRAFT_17from moq'sjs/net, sobench/moq.ts'sFORMSpassedundefinedas both versions. moq'sisLeadingOnesreads anything it doesn't know as leading ones, so the hand-written decode ofvarint/quic/2Band wider read QUIC wire as leading ones and failed the output check (found by #222). Nothing type-checksbench/, so the pin bump passed.Approach
FORMStakes each form's version from versions moq still has, typed as moq'sStreamVersion:Lite.DRAFT_06, the last Lite draft with QUIC varints.Lite.DRAFT_07, the first.Encoding and decoding round-trip in Bun for 2-, 4-, and 8-byte QUIC varints and 2-, 3-, and 6-byte leading-ones varints, each with the expected length prefix.
just ts checknow type-checksbench/against moq at the pin, through a newbench/tsconfig.json:moq/*maps totarget/moq.@types/bun.It runs
just moq-pinand moq'sbun install --filter @moq/net(36 packages), thentsc -p bench, at about 1 s of CPU. On this branch's parent, it reports the two missing versions.Three type errors the bench had never surfaced, fixed without changing behavior:
entry.tstests"WorkerGlobalScope" in globalThis. TheWorkerGlobalScopename exists only in the webworker lib, which clashes with dom.main.ts'sbundle,read, andmeasureSizetype their bytes asUint8Array<ArrayBuffer>, asBun.gzipSyncwants.Impact
just check(merge gate) now clones moq at the pin and installs@moq/net's dependencies: a few seconds, mostly network.Alternatives
Ietf.DRAFT_18for leading ones: works too, butLite.DRAFT_07keeps both forms on one version family.Follow-ups
None.
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code