Commit 8bec68c
authored
fix(perf): correct INLINE_BACKFILL_THRESHOLD docstring and raise threshold (#1492)
* chore: gitignore napi-generated artifacts in crates/codegraph-core
* chore(tests): remove unused biome suppression in visitor.test.ts
* fix(titan-run): sync --start-from enum and phase-timestamp list with actual phases
* fix(hooks): track Bash file modifications via before/after git status diff
Adds snapshot-pre-bash.sh (PreToolUse Bash) + track-bash-writes.sh
(PostToolUse Bash): the pre-hook captures git status --porcelain to a
per-worktree temp file before each Bash call; the post-hook diffs the
before/after state and appends newly modified or created files to
.claude/session-edits.log.
This closes the gap where files written by sed -i, printf redirects,
tee, heredocs, or build tools (Cargo.lock, lockfiles) were never
recorded, causing guard-git.sh to emit false-positive BLOCKED errors.
Closes #1457
* chore(native): remove dead code (unused var, method, variant, fields)
- clojure.rs: annotate lifetime-anchor assignment to silence false-positive
- cfg.rs: remove never-called start_line_of method
- complexity.rs: remove never-constructed NotHandled variant; convert
irrefutable if-let patterns to plain let destructures
- dataflow.rs: remove never-read callee fields from CallReturn/Destructured
- incremental.rs: remove never-read lang field from CacheEntry
cargo check and cargo clippy both clean after these changes.
* refactor(native): extract emit_pts_alias_edges params into PtsAliasCtx struct
* fix(wasm): sort call targets by confidence before emit to match native engine
* fix(bench): add 2 warmup runs and raise INCREMENTAL_RUNS to 5 for incremental tiers
* ci(bench): add per-PR perf canary for extractor/graph/native changes
Adds .github/workflows/perf-canary.yml — a path-filtered workflow that
fires on PRs touching src/extractors/, src/domain/graph/, or crates/**
and runs only the incremental-benchmark suite (full build + no-op +
1-file rebuild, both engines). Catches the class of regressions that
accumulated invisibly across the Phase 8.x PRs and were only detected
at v3.12.0 publish time.
The regression guard gains BENCH_CANARY=1 mode: raises thresholds to
50%/100%/150% (standard/noisy/WASM) and skips the build, query, and
resolution suites — only incremental checks run. This absorbs shared-
runner timing variance while still blocking catastrophic regressions
(+98% full build, +1827% 1-file rebuild from v3.12.0).
Closes #1433
* fix(perf): plumb symbolsOnly through parseFilesWasmInline to skip analysis visitors
* fix(perf): scope runPostNativeCha to changed files on incremental builds
On incremental builds, runPostNativeCha previously scanned all
call→qualified-method edges in the DB (~12ms flat, O(graph size)),
even for 1-file changes where no hierarchy or RTA evidence changed.
Add two cheap indexed gate queries. Gate A checks whether any changed
file introduced a class/interface/trait/struct/record node (hierarchy
may have new implementors reachable from unchanged call sites). Gate B
checks whether any changed file added a call edge to a class-kind target
(RTA set may have grown, enabling previously filtered expansions in
unchanged callers). If neither gate fires, restrict the candidate query
to src.file IN changedFiles — safe because the hierarchy and instantiated
set are unchanged for all other files.
Full builds (isFullBuild=true) and cases where either gate fires retain
the existing full-scan behaviour. Mirrors the changed-files scoping
pattern of runPostNativeThisDispatch.
Closes #1441
* fix(native): add post-pass phase timings to result.phases
Times each JS post-pass in tryNativeOrchestrator and exposes the
measurements in BuildResult.phases:
- gapDetectMs — dropped-language gap detection + backfill
- chaMs — CHA expansion (interface dispatch)
- thisDispatchMs — this/super dispatch WASM re-parse (was already
tracked but now properly named alongside the rest)
- reclassifyMs — scoped role re-classification after edge insertion
- techniqueBackfillMs — technique-column UPDATE on native-written edges
Previously only thisDispatchMs was reported, causing wall-clock vs
phaseSum to diverge by 1.1s+ on 1-file rebuilds and making benchmark
regressions undiagnosable from committed history.
Updates update-incremental-report.ts to render the new phases in a
collapsible details block under each engine's 1-file rebuild section.
Closes #1434
* fix(perf): correct INLINE_BACKFILL_THRESHOLD docstring; raise threshold for required-tier grammars
The docstring claimed pool cost was "amortised over enough parse work" —
measurements show IPC overhead scales linearly (~55–64ms/file pool vs
~8–10ms/file inline). The real motivation is crash safety for exotic WASM
grammars (#965); JS/TS/TSX (required-tier, used in all this-dispatch
backfill calls) have never triggered the V8 fatal crash class and are safe
to run inline.
Raise threshold 16 → 32 to keep typical this-dispatch batches (≤ 18 files
on the codegraph corpus) on the inline fast path. Exotic-language drops are
almost always well under 32 files and also benefit from the inline path
without meaningful crash risk increase.
Closes #1435
* fix(perf): update stale parseFilesWasmForBackfill docstring to reference threshold constant
The secondary docstring still described the old 16-value rationale
("engine-parity drop sizes"). Replace with a pointer to
INLINE_BACKFILL_THRESHOLD where the full rationale now lives.
* fix(perf): guard post-native passes on 1-file incremental rebuilds (#1493)
* fix(perf): guard post-native passes against unnecessary work on 1-file incremental rebuilds
On 1-file native incremental builds, two JS post-passes ran unconditionally
even when they had no work to do:
- `backfillNativeDroppedFiles`: called whenever changedCount > 0, even when
detectDroppedLanguageGap returned an empty gap. Gate now checks
gap.missingAbs.length > 0 || gap.staleRel.length > 0 directly, matching
backfillNativeDroppedFiles's own internal early-exit guard.
- Node/edge COUNT(*) re-count: ran unconditionally after all post-passes even
when none of them wrote any edges. COUNT(*) over 50K+ edge tables is
non-trivial, especially via the NativeDbProxy napi-rs round-trip. Now gated
on postPassWroteData (backfill | CHA edges | this-dispatch edges).
Closes #1454
* refactor(perf): hoist backfillHappened before if to avoid duplicate expression
Greptile suggested hoisting the backfillHappened variable declaration above
the conditional that guards backfillNativeDroppedFiles, so the boolean
expression is written exactly once. Previously the condition was evaluated
in both the if-guard and the const declaration on the following line.1 parent f718b8f commit 8bec68c
2 files changed
Lines changed: 45 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1538 | 1538 | | |
1539 | 1539 | | |
1540 | 1540 | | |
1541 | | - | |
1542 | | - | |
1543 | | - | |
1544 | | - | |
1545 | | - | |
1546 | | - | |
1547 | | - | |
1548 | | - | |
1549 | | - | |
1550 | | - | |
1551 | | - | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
1552 | 1547 | | |
1553 | 1548 | | |
1554 | | - | |
1555 | | - | |
1556 | | - | |
1557 | | - | |
1558 | | - | |
1559 | | - | |
1560 | | - | |
| 1549 | + | |
| 1550 | + | |
1561 | 1551 | | |
1562 | 1552 | | |
1563 | 1553 | | |
| |||
1638 | 1628 | | |
1639 | 1629 | | |
1640 | 1630 | | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
1641 | 1636 | | |
1642 | 1637 | | |
1643 | | - | |
1644 | | - | |
1645 | | - | |
1646 | | - | |
1647 | | - | |
1648 | | - | |
1649 | | - | |
1650 | | - | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
1651 | 1651 | | |
1652 | | - | |
1653 | | - | |
1654 | 1652 | | |
1655 | 1653 | | |
1656 | 1654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1181 | 1181 | | |
1182 | 1182 | | |
1183 | 1183 | | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
1187 | | - | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
1188 | 1201 | | |
1189 | | - | |
| 1202 | + | |
1190 | 1203 | | |
1191 | 1204 | | |
1192 | 1205 | | |
| |||
1246 | 1259 | | |
1247 | 1260 | | |
1248 | 1261 | | |
1249 | | - | |
1250 | | - | |
| 1262 | + | |
1251 | 1263 | | |
1252 | 1264 | | |
1253 | 1265 | | |
| |||
0 commit comments