Repository navigation
chore(ts): run the differential fixtures optimized and single-threaded, and share lang's translation - #419
Conversation
Quest-Claim: b513aa5d0c89f7f9
…d, and share lang's translation Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
…or settled Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
The ts differential tests run each fixture's native wasm32 side as a debug build, which V8 runs several times slower, with V8's background threads adding CPU on top.
stable_namesalso translatedlanga second time as its base, with the same roots as thelangtest's own translation. Per the 2026-11-01 checks audit, that madelangplusstable_namesmost ofjust ts test's CPU.Approach
differentialprofile ints/Cargo.tomlinheritsdevwithopt-level = 1. Overflow checks and debug assertions stay on, so panics and overflow match exactly. Every fixture's native side now builds with it, andstock's getrandom override moves to that profile.differential.tswith--single-threaded.lang's translation sits in aOnceLockthatlangandstable_namesshare.stable_nameschecks its added-root translation against that output instead of translating a base of its own.added_rootsplits intorooted(translate with replaced roots) andkept(the line-order check), sosource_orderstill translates its own base.Evidence
Every fixture compares the same cases, with the same panic and abort counts as origin/main and 0 differences (
--nocapture, coldtarget/tmp):Breaking the runtime by one (
u32Add's bound at0xfffffffe) failslang:709442 cases, 84411 panics, 96 aborts, 13 differences, e.g. nativeffffffff01, tspanic "attempt to add with overflow".Cold
cargo test --lockedints/(test binaries prebuilt,target/tmpremoved), measured on this host (32 cores, shared with other agents, so wall time is noisy; CPU is the measure):langstable_namesAbout 1050 to 1600 CPU-seconds saved per cold run (47% to 57%). Wall time is bound by
lang's translation, which this PR does not change.Impact
Alternatives
--config profile.dev.opt-level=1on the build command: hides the profile fromCargo.tomland sharesdebug/with any other dev build of the fixtures.stable_namesinto thelangtest: shares the translation without aOnceLock, but serializes its added-root translation afterlang's differential and loses its separate test name.debug = falsein the profile as well: not measured, left out to keep the change to what the audit measured.Follow-ups
borrows::leakswas unreachable came from a base before fix(ts): hold a byte vector's capacity as a heap or deque takes it #417. fix(ts): hold a byte vector's capacity as a heap or deque takes it #417 picks a case by two bytes, soborrows::leaksis[0x00, 0xff], andoprefuses any case a 0xff first byte would shadow. The quest planned for it in this branch is dropped again, and nothing new is planned.stable_names' remaininglangtranslation, though it can no longer sharelang's.Checks
just cipassed in a freshnix developon head bfbd5dc, after merging origin/main (345aa82). Running the built nativelangwasm confirms[0x00, 0xff, ...]runsborrows::leaks, notFault.Review
Codex gpt-6.1-sol, medium effort, via
quest review --base origin/main.ts/runtime/rt.ts:1381byte-vector capacity on heap and deque conversion: refuted, already fixed on origin/main by fix(ts): hold a byte vector's capacity as a heap or deque takes it #417 (byteVecToVecusescapHold).ts/fixtures/lang/src/harness.rs:300case 255 unreachable: refuted. The base predated fix(ts): hold a byte vector's capacity as a heap or deque takes it #417's two-byte selector, so on origin/mainborrows::leaksis[0x00, 0xff]and runs. The quest first recorded for it is deleted.quest/m0/lang-cases.md, with no source change.🤖 Generated with Claude Code