Repository navigation
Fix Windows thread-view perf tests timing below the CPU clock tick - #5791
Merged
Merged
Conversation
#5684 shrank the parser benchmark workloads below the 2,048-character summary cap, so each threadCpuUsage sample now takes less CPU than one Windows scheduler tick (~15.6 ms). Both minimums read 0 there and the ratio assertions fail with "expected 0 to be less than 0", turning Windows tests (packages-other) red on main. Measure the three ratio tests with performance.now(), interleaving the cheap and expensive workloads and keeping each one's fastest of seven samples so load affects both sides alike. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Windows tests (packages-other)has failed on main since #5684 (3fcefa7), for example run 39330820112. Three ratio assertions inpackages/thread-view/test/tool-call-parsing-performance.test.tsfail withAssertionError: expected 0 to be less than 0. #5684 shrank the benchmark workloads below the new 2,048-character summary cap, so each sample now uses about 0.1–30 ms of CPU. On Windows,process.threadCpuUsage()comes fromGetThreadTimes, which advances in ~15.6 ms scheduler ticks. The cheap and expensive minimums both read 0, and0 < 0 / nfails. Windows tests were skipped on #5684's PR (frontend-only selection), so the failure first showed up on main.The other red jobs on main in the same window (
app-1,app-3,server-2, Checks, Package Smoke, Provider Model Listing, Node Compatibility Smoke, Linuxpackages-other) are infra. The pnpm tarball download (curl: (28) Operation timed out) orInstall dependencieshit their timeouts before any tests ran. One earlier Windows run also had aprovider-bridge-acp-nexttimeout followed byEBUSY; that run did not repeat it.What changed
performance.now(). Its resolution is sub-millisecond on every OS. The tests interleave the cheap and expensive workloads and keep each one's fastest of seven samples, so preemption and load affect both sides alike. Workloads, repeat counts, and ratio thresholds are unchanged.threadCpuUsage; one tick does not matter at that scale.Test-only change.
How you verified
pnpm exec turbo run test typecheck --filter=@bb/thread-view: 498/498 tests pass.src/tool-call-parsing.ts,reuses shell summaries across repeated timeline buildsfails. The cache regression the test exists for is still caught.workflow_dispatchrun on this branch covers the Windows shards; see the PR checks/comments.🤖 Generated with Claude Code