* test(conformance): compare TypeScript resolution with compiler declarations * test(typescript): compare fixture declarations and runtime dispatch * test(typescript): compare namespace and generic dispatch fixtures with tsc * fix(typescript): resolve qualified types and nested generic references * test(typescript): run CLI, embedding and workspace fixtures in conformance * fix(typescript): compare JSX member bindings and callable declarations * test(bench): pin compiler-verified property declaration positions * test(typescript): exercise parser cache and graph publication in conformance * test(typescript): run graph publication and recovery fixtures in conformance * fix(typescript): select member overloads from bound call results * bench(typescript): pin the verified overload resolver source tree * test(typescript): compare property accesses and migrate mixed fixtures * test(typescript): require FTS and correct conformance run instructions * fix(typescript): attribute constrained and aliased types to their declarations * test(bench): verify graph and capture changes for TypeScript aliases * test(typescript): move MCP and embedding fixtures into native conformance * test(typescript): check callback signatures and concrete targets against the compiler * test(conformance): verify callback types and migrate TypeScript product fixtures * fix(typescript): propagate the selected overload return to receiver calls * test(conformance): compare callback assignments and preserve class-expression coverage * test(bench): pin the verified overload resolver tree for parse reuse * test(conformance): compare overloaded callbacks and migrate rename and workspace fixtures * fix(typescript): preserve distinct local classes and chained overload return types * test(conformance): cover dirty snapshot reuse and graph rename in the native runner * test(conformance): release the database when fixture setup fails * test(conformance): run TypeScript watcher and shared-store fixtures natively * test(conformance): verify embedding identity and cache reuse in the native runner * test(conformance): move shared-store checkout fixtures into TypeScript jobs * test(bench): pin cold and resumed graphs for the local-class resolver * test(conformance): compare block-shadowed property reads with TypeScript * test(conformance): exercise TypeScript WAL recovery and Git directory handling natively * fix(ingestion): count receiver ownership suppressions once after replay * test(conformance): exercise TypeScript source edits during cold and cached resolution * test(conformance): stage only bundled dependencies for the installed CLI fixture * test(conformance): verify cold and incremental TypeScript file reuse in the native suite * test(conformance): exercise mixed-language embedding chunk reuse and source ranges * fix(typescript): qualify class graph identities by their namespace * test(conformance): move mixed worker persistence and filesystem fixtures to Node * test(cache): verify namespace owner identities across all reuse phases * test(conformance): exercise all 38 POSIX atomic publication cases in the native job * Move TypeScript graph, heap and scenario fixtures to native conformance * Resolve inherited TypeScript overloads and verify transitive interface methods * Compare TypeScript method keys and move wiki and embedding fixtures to conformance * Run TypeScript-backed rename, benchmark and scenario fixtures in native conformance * Compare class type parameters with TypeScript and preserve literal constraints * Fix conformance lint, formatting and rename fixture file handling * Pin both verified cache trials for literal type parameters * Run embedding recovery and control-flow fixtures in TypeScript conformance * Check TypeScript local function identities and repository fixtures in conformance * Compile shared TypeScript callable query patterns once per worker * Verify the Java wildcard graph includes the field declaration column * Pin verified file reuse results for the consolidated TypeScript query * Compare generator, closure and shadowing fixtures with the TypeScript compiler * Run incremental database fixtures in TypeScript conformance on their original platforms * Limit receiver replay to files with call-result consumers and resolve TypeScript overloads in declaration order * Bind TypeScript ambient declarations in their project and reject named imports from declaration scripts * Verify compiler capture, graph and file reuse baselines for the scoped resolver Two real-corpus runs agree across all five reuse phases. The TypeScript ingestion workload retains its call targets on all three sizes. Method-declaration graphs add only the source columns of the Dart and Kotlin properties. The migrated private-field fixture contributes the one additional array push reported by both runtimes. * Shard the Linux TypeScript product tests and require coverage from both runners * Run full-text opt-out lifecycle fixtures in native TypeScript conformance * Verify actual CLI exits, repeated skill output and shared-store analysis * Match TypeScript inheritance order, declared generic defaults and interface method identities * Trace callable arguments through TypeScript constructors and conditional expressions * Give anonymous TypeScript signatures their own generic scope * Move parser drain and analysis lifecycle fixtures into native conformance * Verify TypeScript reference and capture changes against frozen benchmark corpora * Move TypeScript incremental analysis and external config fixtures to conformance * Skip interface identity and callable-flow work for ordinary TypeScript values * Check TypeScript overload declarations and migrate fixture-backed product coverage * Resolve TypeScript script visibility, merged overloads, and immutable receivers * Record the verified TypeScript parse-cache benchmark graphs * Use TypeScript project file membership for global declarations * Match merged rest overloads and hoisted script declarations * Run TypeScript-backed indexing, worker, and rename fixtures in conformance * Move TypeScript gRPC and workspace-link fixtures to conformance * Keep runtime inference out of TypeScript compiler conformance * Keep TypeScript compiler conformance focused on static resolution * fix(typescript): preserve compiler-selected project and method bindings * test(typescript): compare callback sites with the resolved call range * test(typescript): let the compiler check namespace and ambient exports * style(test): format TypeScript conformance fixtures * test(typescript): align capture and receiver benchmarks with the compiler corpus Fingerprint all 174 capture inputs. Compared with main, these inputs add 25 call-result assignments, 19 type references and four scopes. Preserve the scaling budgets. The former duplicate Store fixture contributed one unresolved array push. Replaying both revisions on the current corpus yields exactly the same 20 TypeScript drop sites. Restore the original receiver counts. * perf(typescript): limit overload lookup to compiler-visible bindings * Compare TypeScript module ownership, defaults, and tuple bindings with the compiler Treat export flags as declaration metadata so identifier length cannot displace the declaration anchor. The benchmark corpus gains two reads and two calls to the two extractor helpers. All five cache scenarios keep their previous reparse counts. * Check published call locations and keep receiver replay scoped to call sites Resolve qualified heritage through its lexical namespace and honor TypeScript module detection for script globals. Index overload consumers by scope so 400 independent functions take 400 owner checks instead of 80,200. The published graph and all five real-corpus cache fingerprints remain stable. * Resolve script globals within their TypeScript projects and namespaces Follow compiler project references and source directives, share the global binding tables, and keep namespace values from resolving to unrelated types. Record the compiler-verified declaration positions in the lexical benchmark. * Resolve destructured script globals and preserve CommonJS loader targets Compare script bindings with TypeScript and forwarded CommonJS values with Node after compilation. Move capture ordering and worker parity checks to the native conformance job. Verify the iterable benchmark against the compiler-selected Value.save declaration. * Preserve TypeScript default factory exports across unrelated writes * Resolve standalone TypeScript projects and callable CommonJS exports * Match TypeScript compiler overloads, overrides, and narrowed calls * Resolve TypeScript CommonJS defaults using the project's module format * Check block-local handler bindings against the TypeScript compiler * Run TypeScript compiler conformance from one entry point * Match TypeScript on scoped enum members and tuple overloads * fix(typescript): address resolver and compiler conformance review Preserve shared overload implementation edges and exact literal member keys. Track reachable writes and namespace receiver types, honor inherited package mode, and scan shared overload bindings once. Extend compiler and graph controls for the outstanding literal, scope, and generic-parameter findings. * fix(typescript): verify module bindings and computed keys against runtime Restrict factory invalidation to reachable direct eval and preserve CommonJS wrapper binding order. Evaluate grouped numeric operands in property keys. Add runtime, compiler and scope controls. Update only the capture digests attributable to the awaited tuple marker. * fix(typescript): preserve native ESM exports around CommonJS references Use the module format to select explicit ESM exports in JavaScript and TypeScript. Check namespace keys and imported call targets against Node for .mjs, .mts, .js and .ts, with executable CommonJS controls. * fix(ingestion): preserve JavaScript and TypeScript binding identities Honor project nullability during overload selection and distinguish lexical loop callables. Preserve empty TypeScript method names and signatures through database publication. Track CommonJS wrapper identity across reassignment and grouping. Resolve JavaScript numeric property keys under the owning package format and refresh the affected index rows after a manifest change. * fix(ingestion): restore compiler-proven graph edges and CI parity Correct ESM package scope, CommonJS wrapper evaluation, strict class keys and TypeScript overload and field resolution. Share workspace discovery across providers in the same scan. Pin the verified graph changes to the exact benchmark inputs, preserve the measured performance limits, and cover the reported cases with compiler and runtime regressions. * fix(ingestion): validate package reads and TypeScript type evidence Read package manifests through the same validated descriptor. Preserve keyof precedence, cooked template overloads, and static computed method identities. Pin the compiler-confirmed graph changes to the frozen benchmark inputs. * fix(ingestion): resolve nullable inheritance and TypeScript overloads Preserve nullable generic override targets across C#, Kotlin and Dart. Match TypeScript overloads for loose object fields and inherited instance methods on union receivers. Share the verified parse-cache graph expectations across the two source revisions. * fix(ingestion): preserve narrowed call targets and generic overrides Carry prior instanceof exclusions through direct else-if chains and respect execution order for CommonJS wrapper writes. Match scoped C# reference and global-qualified generic signatures and Kotlin nullable generic arguments. Add compiler-backed regression cases and record the verified cache graph identity. * fix(ingestion): preserve constructed overrides and guard C++ defaults Retain the scoped identity and nested arguments of nullable C# and Dart overrides. Keep earlier C++ template parameters when parser recovery truncates a comparison in the last default. Add compiler-backed positive and negative controls. * fix(ingestion): resolve Map entries and qualified nullable overrides * ci: require both compiler checks for coverage reuse * test(bench): verify resolver graph on release corpus * fix(ingestion): preserve scoped call and override identities * fix(ingestion): preserve timer handles and inherited method targets Classify host timer registrations through lexical bindings. Preserve Vue inherited method selection and C++ digit-separated template arguments. Track Babel in the parse cache, skip unnecessary generic substitution work, and verify both frozen graph corpora. * fix(ingestion): preserve module exports and method return types Keep CommonJS wrapper-only exports out of native ES modules. Resolve TypeScript literal method returns by owner and preserve rooted nullable C# generic overrides. Record exact graph equivalence for both frozen corpora. * fix(ingestion): preserve receiver and override targets Separate TypeScript static and instance lookup and retain nullable C# and Kotlin override identity. Make conformance ordering and syntax scanning explicit. Both frozen cache corpora preserve all graph rows and duplicate counts. * test(java): load graph helpers in native Node Use the conformance comparator from a native ECMAScript module. The Java contract runner imports the TypeScript graph helper directly under Node 22. * fix(csharp): resolve named tuple overrides and repair CI checks Compare C# tuple element types and labels in declaration scope and select an eligible inherited method. Cover method arity, accessibility, return conversions and closed slots. Verify raw Git path bytes and preserve Node test registration. Both frozen graph corpora match on the new source trees. * fix(ingestion): preserve CLR override identities and C++ template defaults Resolve predefined C# types in their declaring scope and compare explicit ValueTuple and Nullable return types, including array variance and long tuples. Keep C++ comparison operators intact inside template parameter defaults. Preserve point and range coordinates in the lexical benchmark. Add compiler-backed regressions and record the verified graph equivalence. * fix(ingestion): resolve default classes and namespace aliases Preserve default-class ownership through parentheses and stop at nested anonymous classes. Keep existing CommonJS exports across unrelated property writes. Resolve ambient namespace aliases by public name and preserve type-only visibility. Document receiver filtering and add regression coverage. * fix(ingestion): preserve compiler-selected bindings Filter function-local namespace accesses. Preserve Node setImmediate handles and qualified verbatim C# names. Use each TypeScript project’s optional-property rules for overload selection and verify the resulting call and read edges against the compiler. * test(bench): record frozen graph equivalence Accept the verified source trees for the two existing frozen-corpus expectations. All 1,671,468 graph rows and their multiplicities matched across ten indexing runs; all 78 negative controls rejected altered evidence. * fix(ingestion): preserve template defaults and TypeScript call targets Recover complete C++ template defaults from verified parser spans and retain their source spelling. Resolve intrinsic Set tuple iteration and matching primitive method overloads across union receivers. Add compiler-backed positive and negative controls. * fix(ingestion): address SonarCloud findings in compiler conformance Simplify resolver and conformance code, preserve compiler-selected bindings, and distinguish C++ reference overloads in the graph lookup cache. Record graph equivalence for both frozen benchmark corpora. * refactor(ingestion): simplify four resolver functions Resolve the remaining four hosted SonarCloud complexity findings. Preserve class ownership, narrowing order, tsconfig file selection, and template parameter parsing. Record the matching graph fingerprints for both frozen corpora. --------- Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com> |
||
|---|---|---|
| .. | ||
| baselines.json | ||
| call-signature-memory.mts | ||
| corpus.mts | ||
| dense-java.mts | ||
| finalize-miss.mts | ||
| measure.mts | ||
| README.md | ||
| wildcard-java.mts | ||
Scope-resolution measurements
Run from gitnexus/ after npm run build:
node --import tsx bench/scope-resolution/measure.mts --check --output /tmp/scope-resolution.json
CI runs every language in both SupportedLanguages and SCOPE_RESOLVERS, serially.
Missing corpus or resolver entries fail the inventory check. Each language has
100- and 1,000-entity workloads with 20 generated members or procedures per entity,
plus callers and helpers. Rust also needs a root
module file; Objective-C has a header and implementation per entity. Java adds an
isolated producer file and exercises transitive factory returns and repeated
unreachable return-name lookups. Swift uses same-module visibility; COBOL exercises
program references and procedure pointers. R sources the preceding file and calls
through an R6 instance; the second call of its chain stays unresolved, because R6
method results carry no type. Other arms import the preceding file and call through its
return value. These generated sources exercise the analyzer; they are not builds
or representative application benchmarks.
Every sample runs in a fresh process through real parsing with one worker and the production scope-resolution pass. COBOL also runs its standalone structural parser. Configuration files are written to a temporary workspace and loaded through the resolver's normal configuration hook. No production heap, file-count, or propagation limit is imposed.
The JSON artifact and GitHub job summary report the median of three samples:
- Parsing and scope-resolution wall time separately.
- JavaScript heap immediately after parsing and after resolution. These are endpoint samples, not peak heap or retained heap after garbage collection.
- Process peak RSS through resolution, including worker memory. This is the OS high-water mark, not a timer that can miss synchronous allocation spikes.
- Module and total type-binding counts, node/edge counts, and cross-file calls.
- An order-independent fingerprint of node identities and complete relationship endpoints, types, confidence and reasons. Equal counts alone are insufficient.
The check requires every source to reach scope resolution, nonempty declarations and cross-file calls, identical graph fingerprints between trials, and equality with committed graph baselines. Type-binding counts must be deterministic and must not exceed the recorded counts; reductions are allowed. These measured allocation budgets catch redundant table growth even when the graph stays identical. Runtime and heap/RSS are measurements, without uncalibrated absolute performance thresholds. Compare the same workload on the same machine before choosing an optimization.
For a smaller diagnostic run:
node --import tsx bench/scope-resolution/measure.mts --language java --sizes 10,100 --methods 20 --repetitions 3
To establish baselines after reviewing a fixture, semantic, or allocation change,
run the default all-language workload with --record instead of --check and inspect
baselines.json. CI never records or accepts a new baseline automatically.
Finalization import-miss probe
To reproduce the allocation trigger isolated while investigating #3695:
node --expose-gc --import tsx bench/scope-resolution/finalize-miss.mts 500
Run in fresh processes on each revision after building. This constructs 500 files with chained wildcard imports, a terminal module with an unresolved external wildcard import, and a consumer importing a missing name from that terminal module. The missing name cannot be supplied by re-exports, so it should not trigger construction of the unrelated chain's transitive export tables. The JSON reports finalization time, endpoint heap growth, process peak RSS, and a fingerprint of all finalized imports, bindings, SCCs and statistics. It is a synthetic finalizer workload, not a full Java indexing run or a reproduction of the reporter's private repository.
For a real indexing run, the existing GITNEXUS_DEBUG_HEAP=1 and
GITNEXUS_HEAP_PROBE_FILE settings now include sr-finalize-* markers for input
preparation, import-target resolution, SCCs, ambiguity checks, transitive exports
(only if requested), linking, wildcard expansion, bindings and workspace indexes.
sr-extract-start precedes sr-post-nodeLookup; a last sr-post-nodeLookup
marker therefore points into finalization after extraction.
Post-resolution memory probes (#3695)
node --expose-gc --import tsx bench/scope-resolution/call-signature-memory.mts 500000
GITNEXUS_DEBUG_HEAP=1 node --import tsx bench/scope-resolution/dense-java.mts 300 20 10
node --expose-gc --import tsx bench/scope-resolution/wildcard-java.mts 700 700
wildcard-java.mts has 700 files that each write import big.*; over a 700-file
package and use one of its types: 490,000 (importer, package file) pairs, 700
IMPORTS edges. With --check it requires that no wildcard import is stored as
one edge per package file, that every importer still reaches every package file,
the reviewed graph fingerprint, and at most 16 MiB of heap retained by the pass.
The pass retains about 4 MiB when on-demand imports are stored as groups and about
54 MiB with one edge per package file; set GITNEXUS_DISABLE_IMPORT_GROUPS=1
(without --check) to measure the second form on the same build. This is one
synthetic shape, not a representative repository.
--closure adds an enum whose file has import big.*; and a static import of
one of its constants. Finalize does not find that name among the enum file's
top-level declarations, so it builds re-export closures for the workspace. Retained heap stays near
4 MiB either way; what the build holds while it runs shows only in the heap the
process needs. CI therefore runs this shape under --max-old-space-size=180:
the pass completes in 160 MB (not in 150 MB), and did not complete in 200 MB
when the build wrote out one draft per (importer, package file) pair. The
closure tables themselves are still one entry per importer and imported name.
CI runs these probes once with --check in the existing
scope-resolution-benchmark job, alongside its all-language measurements.
The ordinary-call check rejects any retained signatures. The dense Java check
requires the default 300/20/10 workload and its reviewed full graph fingerprint
below. Heap and timing remain measurements, without absolute thresholds.
Both outputs join the existing scope-resolution-benchmark artifact: the
collector's JSON and dense Java's log, including sr-emit-* heap checkpoints.
Omit --check for comparisons against older revisions or custom workloads.
The first probe isolates ordinary calls with no indirect-call facts. Previously
the deferred-call collector retained a signature object and position key for
every call even though none could be consumed. At 500,000 calls, three fresh
processes measured a median 90.29 MiB retained overhead before the change and
0.08 MiB afterward. With --max-old-space-size=160, the old collector exhausted
the heap (exit 134); the updated collector completed. Input records remain live
through both measurements. This measures one allocation source, not total
indexing memory.
The second probe uses real worker parsing and scope resolution on generated
Java: 300 files, 20 methods per file, 10 receiver calls per method. It reports
per-stage heap samples and a fingerprint of complete nodes and relationships.
Before and after the change it produced 66,300 nodes and 126,600 relationships,
with fingerprint 3209302e91e7023328464540ec7d0ac72ac03bf49fa73303817a56ed3d415ef5.
The current fingerprint is 7ff03cec3bbfd427bb232bc75fcebc19b37f097aa6d1e7b4e1a5fbf0d00197b2.
The change marks all 60,000 method-local variables as unexported. All 60,000
call edges match the caller and target declarations reported by javac.
It uses the in-memory graph helper, so its RSS is not a measurement of the CLI's
streaming graph sink. Calls pass null to match each receiver's parameter type;
the 300-file workload compiles with javac --release 17. The probe measures
analysis and does not execute the generated Java.
GITNEXUS_DEBUG_HEAP=1 now adds sr-emit-* checkpoints after receiver calls,
free calls, replay, references, property passes, callable flow, imports and
provider hooks, including elapsed emit time and graph counts. sr-post-resolve
marks the end of the initial registry lookup only; substantial resolution still
follows it. These markers distinguish that work on the next reporter run.
The private repository's complete OOM has not been reproduced by these probes.
For the import-emission memory benchmark, see its README.