Adds OPUS-REPORT.md with every experiment's results, the recommended patch
series (opus-patches/, also a git bundle), timing and profile evidence under
evidence/opus/, latency microbenchmarks, and harness support for comparing
saved client/server builds (snapshot-build.mjs, compare-builds.mjs,
API_CLIENT_ROOT, server CPU accounting).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Most synchronous API round trips are dominated by the scheduler wakeup latency
of blocking pipe reads rather than by the work done on either side. The sync
client now polls its non-blocking stdout pipe for up to
responsePollMicroseconds (default 100) before switching back to a blocking
read. The server can likewise poll for the next request when the client sets
serverRequestPollMicroseconds (--requestPollMicroseconds, default 0), at a
larger CPU cost since it polls while the client works between requests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Symbols and signatures parsed every declaration handle into a NodeHandle as
soon as they were received, although most are never read. Keep the wire
strings and create the NodeHandles when declarations, valueDeclaration, or
declaration is first accessed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Location handles sent by the client repeated the file's full path
("index.kind.path"). Nodes decoded from a server-encoded source file now send
"index.kind.#nodeID", using the source-file node ID already carried in the
encoded file, and the server resolves it through a lazily built per-program
index. IDs of files encoded for a client but absent from the requested program
fall back to path lookup, preserving resolution of nodes from compatible
standalone files. getNodeId and compiler-produced handles keep the path form.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Every checker request repeated the project's full ID (its config file path).
Project responses now include a short handle ("#N"), assigned from a
process-wide table, that the client sends instead; request decoding maps
handles back to project IDs. Full project IDs are still accepted.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
encoding/json/v2 only omits empty JSON values for omitempty, so every
TypeResponse carried "objectFlags":0, "isTupleType":false, "value":null and
"isThisType":false, every SymbolResponse "checkFlags":0, and every
SignatureResponse "flags":0. Use omitzero and default the fields on the
client.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
createChildren allocated a fresh scanner for every node whose children were
materialized, and the token lookups (getTokenAtPosition, findNextToken,
findPrecedingToken) allocated one per query. Keep a per-source-file pool of
idle scanners (WeakMap<SourceFile, Scanner[]>): check out by popping or
creating, reset text/language variant on checkout, and in a finally block
clear comment directives and token state before returning the scanner.
Scanners are removed from the pool while in use, so nested or reentrant
traversals always get distinct scanners.
Add tests covering reuse across cached/repeated calls and token lookups,
nested child creation, exceptions during child creation, trivia/comment
directives/JSDoc state, exact token boundaries, and independent source files
with different language variants.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>