Repository navigation
Conversation
Stack context: TSP vs pyrefly LSP latency benchmarks on PyTorch. - What: add `benches/tsp/record/`, which runs the latest VS Code and Pylance headless with pyrefly as the type server, opens `torch/_inductor/ir.py` in the pinned PyTorch checkout, and drives a hover, a completion, and an idle re-check after edits. It writes every TSP request Pylance sent to `benches/tsp/traces/`, one file per feature (`cold_start`, `hover`, `completion`, `recheck`; ~1 MB in total, checked in), so that each benchmark loads only its own trace and a re-recording diffs per feature. - Why: TSP benchmarks need the requests a real client sends. Hand-written sequences guess wrong: Pylance sends no requests for a repeated hover (it caches types until the snapshot changes), never sends `getDeclaredType`, and re-checks the whole file over TSP after every edit and on open. - Foreground requests come from pyrefly's stdin. Background-checker requests go over an extra connection, so they come from Pylance's own TSP log, which the runner copies as it grows because VS Code rotates it every 5 MB. Test Plan: On a devserver with internet through fwdproxy (Pylance 2026.4.1, VS Code 1.144.0): ``` HTTPS_PROXY=http://fwdproxy:8080 benches/tsp/record/record.sh <pyrefly> <pinned PyTorch checkout> startup: 17494 requests hover: 33 requests completion: 79 requests recheck: 16462 requests ```
This was referenced Oct 29, 2026
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D128211225. (Because this pull request was imported automatically, there will not be any future comments.) |
This branch has not been deployed
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.
Stack (review and merge in order):
Stack context: TSP vs pyrefly LSP latency benchmarks on PyTorch.
benches/tsp/record/, which runs the latest VS Code and Pylance headless with pyrefly as the type server, openstorch/_inductor/ir.pyin the pinned PyTorch checkout, and drives a hover, a completion, and an idle re-check after edits. It writes every TSP request Pylance sent tobenches/tsp/traces/, one file per feature (cold_start,hover,completion,recheck; ~1 MB in total, checked in), so that each benchmark loads only its own trace and a re-recording diffs per feature.getDeclaredType, and re-checks the whole file over TSP after every edit and on open.Test Plan:
On a devserver with internet through fwdproxy (Pylance 2026.4.1, VS Code 1.144.0):