Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3892e7d
chore: gitignore napi-generated artifacts in crates/codegraph-core
carlos-alm Jun 13, 2026
ef8ea4f
chore(tests): remove unused biome suppression in visitor.test.ts
carlos-alm Jun 13, 2026
a372b82
fix(titan-run): sync --start-from enum and phase-timestamp list with …
carlos-alm Jun 13, 2026
9a52c7c
fix(hooks): track Bash file modifications via before/after git status…
carlos-alm Jun 13, 2026
85a26df
chore(native): remove dead code (unused var, method, variant, fields)
carlos-alm Jun 13, 2026
184d221
refactor(native): extract emit_pts_alias_edges params into PtsAliasCt…
carlos-alm Jun 13, 2026
909e1df
fix(wasm): sort call targets by confidence before emit to match nativ…
carlos-alm Jun 13, 2026
66fc899
fix(bench): add 2 warmup runs and raise INCREMENTAL_RUNS to 5 for inc…
carlos-alm Jun 13, 2026
84e1a5f
ci(bench): add per-PR perf canary for extractor/graph/native changes
carlos-alm Jun 13, 2026
d07b358
fix(perf): plumb symbolsOnly through parseFilesWasmInline to skip ana…
carlos-alm Jun 13, 2026
3db5d8c
fix(perf): scope runPostNativeCha to changed files on incremental builds
carlos-alm Jun 13, 2026
8b3aa3d
fix(native): add post-pass phase timings to result.phases
carlos-alm Jun 13, 2026
fd4ffd1
fix(perf): correct INLINE_BACKFILL_THRESHOLD docstring; raise thresho…
carlos-alm Jun 13, 2026
498ee21
fix(perf): guard post-native passes against unnecessary work on 1-fil…
carlos-alm Jun 13, 2026
61a9839
chore(types): remove dead protoMethodsMs field and stale comment
carlos-alm Jun 13, 2026
5f5d4d2
fix: class-scope field annotation typeMap keys to prevent cross-class…
carlos-alm Jun 13, 2026
29dd101
fix(bench): update elixir/julia/objc expected-edges to module-qualifi…
carlos-alm Jun 13, 2026
9320ed2
fix(wasm): emit receiver edges for declaration-typed locals in C++/CUDA
carlos-alm Jun 13, 2026
7313330
fix(native): resolve Go factory and Python constructor receiver types…
carlos-alm Jun 13, 2026
f93d0cb
fix: align enclosing-caller attribution for variable bindings (haskel…
carlos-alm Jun 13, 2026
1915e5e
chore(lint): fix unused import and formatting in cpp/cuda extractors …
carlos-alm Jun 13, 2026
7095ffe
fix: align Java interface dispatch across wasm/native/hybrid
carlos-alm Jun 13, 2026
1875c7f
fix(wasm): align typed-receiver CHA dispatch confidence to 0.8
carlos-alm Jun 13, 2026
4aced08
fix: use setTypeMapEntry in cpp/cuda extractors and extract CHA_DISPA…
carlos-alm Jun 13, 2026
1b7e25e
refactor: extract CHA_TYPED_DISPATCH_CONFIDENCE named constant
carlos-alm Jun 13, 2026
2a955b5
merge: sync with fix/java-interface-dispatch-1469 base
carlos-alm Jun 13, 2026
2b964ba
fix: resolve merge conflicts with main
carlos-alm Jun 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/domain/graph/builder/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ export const BUILTIN_RECEIVERS: Set<string> = new Set([
'require',
]);

/** Phase 8.5: confidence penalty applied to CHA-dispatch edges. */
export const CHA_DISPATCH_PENALTY = 0.1;
/** Phase 8.5: fixed confidence for typed-receiver (interface/CHA) dispatch edges.
* File proximity is not meaningful for virtual dispatch — all three engine paths
* (WASM inline, WASM post-pass, native post-pass) must agree on this value. */
export const CHA_TYPED_DISPATCH_CONFIDENCE = 0.8;

/** Check if a directory entry should be skipped (ignored dirs, dotfiles). */
function shouldSkipEntry(entry: fs.Dirent, extraIgnore: Set<string> | null): boolean {
if (entry.name.startsWith('.') && entry.name !== '.') {
Expand Down Expand Up @@ -517,7 +524,14 @@ export function runChaPostPass(db: BetterSqlite3Database): number {
const key = `${source_id}|${methodNode.id}`;
if (seen.has(key)) continue;
seen.add(key);
newEdges.push([source_id, methodNode.id, 'calls', CHA_DISPATCH_CONFIDENCE, 0, 'cha']);
newEdges.push([
source_id,
methodNode.id,
'calls',
CHA_TYPED_DISPATCH_CONFIDENCE,
0,
'cha',
]);
}
}

Expand Down
27 changes: 14 additions & 13 deletions src/domain/graph/builder/stages/build-edges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ import {
import type { ChaContext } from '../cha.js';
import { buildChaContext, resolveChaTargets, resolveThisDispatch } from '../cha.js';
import type { PipelineContext } from '../context.js';
import { BUILTIN_RECEIVERS, batchInsertEdges, runChaPostPass } from '../helpers.js';
import {
BUILTIN_RECEIVERS,
batchInsertEdges,
CHA_DISPATCH_PENALTY,
CHA_TYPED_DISPATCH_CONFIDENCE,
runChaPostPass,
} from '../helpers.js';
import { getResolved, isBarrelFile, resolveBarrelExportCached } from './resolve-imports.js';

// ── Local types ──────────────────────────────────────────────────────────
Expand Down Expand Up @@ -101,9 +107,6 @@ interface NativeEdge {
dynamic: number;
}

/** Phase 8.5: confidence penalty applied to CHA-dispatch edges. */
export const CHA_DISPATCH_PENALTY = 0.1;

// ── Node lookup setup ───────────────────────────────────────────────────

function makeGetNodeIdStmt(db: BetterSqlite3Database): NodeIdStmt {
Expand Down Expand Up @@ -735,13 +738,12 @@ function buildChaPostPass(
for (const t of chaTargets) {
const edgeKey = `${caller.id}|${t.id}`;
if (t.id !== caller.id && !seenByPair.has(edgeKey)) {
// Typed-receiver (interface/CHA) dispatch: use the same hardcoded 0.8 that
// runChaPostPass (helpers.ts) and runPostNativeCha (native-orchestrator.ts)
// use — file proximity is not meaningful for virtual dispatch confidence.
// Typed-receiver (interface/CHA) dispatch: use CHA_TYPED_DISPATCH_CONFIDENCE
// — file proximity is not meaningful for virtual dispatch confidence.
// this/super dispatch keeps computeConfidence-based proximity scoring to
// match runPostNativeThisDispatch (native-orchestrator.ts).
const conf = isTypedReceiverDispatch
? 0.8
? CHA_TYPED_DISPATCH_CONFIDENCE
: computeConfidence(relPath, t.file, null) - CHA_DISPATCH_PENALTY;
if (conf > 0) {
seenByPair.add(edgeKey);
Expand Down Expand Up @@ -1327,13 +1329,12 @@ function buildFileCallEdges(
for (const t of chaTargets) {
const edgeKey = `${caller.id}|${t.id}`;
if (t.id !== caller.id && !seenCallEdges.has(edgeKey) && !ptsEdgeRows.has(edgeKey)) {
// Typed-receiver (interface/CHA) dispatch: use the same hardcoded 0.8 that
// runChaPostPass (helpers.ts) and runPostNativeCha (native-orchestrator.ts)
// use — file proximity is not meaningful for virtual dispatch confidence.
// Typed-receiver (interface/CHA) dispatch: use CHA_TYPED_DISPATCH_CONFIDENCE
// — file proximity is not meaningful for virtual dispatch confidence.
// this/super dispatch keeps computeConfidence-based proximity scoring to
// match runPostNativeThisDispatch (native-orchestrator.ts line 906).
// match runPostNativeThisDispatch (native-orchestrator.ts).
const conf = isTypedReceiverDispatch
? 0.8
? CHA_TYPED_DISPATCH_CONFIDENCE
: computeConfidence(relPath, t.file, null) - CHA_DISPATCH_PENALTY;
if (conf > 0) {
seenCallEdges.add(edgeKey);
Expand Down
16 changes: 4 additions & 12 deletions src/domain/graph/builder/stages/native-orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ import type { PipelineContext } from '../context.js';
import {
batchInsertEdges,
batchInsertNodes,
CHA_DISPATCH_CONFIDENCE,
CHA_DISPATCH_PENALTY,
CHA_TYPED_DISPATCH_CONFIDENCE,
collectFiles as collectFilesUtil,
fileHash,
fileStat,
readFileSafe,
} from '../helpers.js';
import { NativeDbProxy } from '../native-db-proxy.js';
import { CHA_DISPATCH_PENALTY } from './build-edges.js';
import { closeNativeDb } from './native-db-lifecycle.js';

// ── Native orchestrator types ──────────────────────────────────────────
Expand Down Expand Up @@ -572,7 +572,7 @@ function runPostNativeCha(

// Find existing call edges targeting qualified methods (e.g., 'IWorker.doWork').
// Include caller_file and method_file so affectedFiles can be populated for
// incremental role reclassification; confidence is CHA_DISPATCH_CONFIDENCE matching runChaPostPass.
// incremental role reclassification; confidence uses CHA_TYPED_DISPATCH_CONFIDENCE matching runChaPostPass.
// When scopeToChangedFiles is true, restrict to call sites in the changed files
// (safe because no hierarchy or RTA evidence changed outside those files).
let callToMethods: Array<{ source_id: number; method_name: string; caller_file: string | null }>;
Expand Down Expand Up @@ -668,7 +668,7 @@ function runPostNativeCha(
const key = `${source_id}|${methodNode.id}`;
if (seen.has(key)) continue;
seen.add(key);
const conf = CHA_DISPATCH_CONFIDENCE;
const conf = CHA_TYPED_DISPATCH_CONFIDENCE;
newEdges.push([source_id, methodNode.id, 'calls', conf, 0, 'cha']);
newEdgeCount++;
if (caller_file) affectedFiles.add(caller_file);
Expand Down Expand Up @@ -955,14 +955,6 @@ interface PostPassTimings {
techniqueBackfillMs: number;
}

interface PostPassTimings {
gapDetectMs: number;
chaMs: number;
thisDispatchMs: number;
reclassifyMs: number;
techniqueBackfillMs: number;
}

/** Format timing result from native orchestrator phases + JS post-processing. */
function formatNativeTimingResult(
p: Record<string, number>,
Expand Down
Loading