Skip to content

Commit fa2ab71

Browse files
committed
fix(comments): correct inaccurate WASM-parity claims in runPostNativeCha (#1514)
The comments said the confidence formula "mirrors the WASM path" but the WASM path (runChaPostPass in helpers.ts) still uses hardcoded 0.8, not computeConfidence - CHA_DISPATCH_PENALTY. Correct both comments to accurately describe the native formula and cross-reference the TODO in helpers.ts for the pending alignment.
1 parent 9d4aea2 commit fa2ab71

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/domain/graph/builder/stages/native-orchestrator.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ function runPostNativeCha(
561561

562562
// Find existing call edges targeting qualified methods (e.g., 'IWorker.doWork').
563563
// Include the caller node's file so confidence can be computed file-pair-aware,
564-
// matching the WASM path's computeConfidence(callerFile, targetFile, null) - CHA_DISPATCH_PENALTY formula.
564+
// using computeConfidence(callerFile, targetFile, null) - CHA_DISPATCH_PENALTY.
565+
// (The WASM path in runChaPostPass still uses a hardcoded 0.8 — see TODO there.)
565566
// When scopeToChangedFiles is true, restrict to call sites in the changed files
566567
// (safe because no hierarchy or RTA evidence changed outside those files).
567568
let callToMethods: Array<{ source_id: number; method_name: string; caller_file: string | null }>;
@@ -658,7 +659,8 @@ function runPostNativeCha(
658659
const key = `${source_id}|${methodNode.id}`;
659660
if (seen.has(key)) continue;
660661
seen.add(key);
661-
// Compute confidence file-pair-aware (mirrors WASM path: computeConfidence - CHA_DISPATCH_PENALTY)
662+
// Compute confidence file-pair-aware using computeConfidence - CHA_DISPATCH_PENALTY.
663+
// (WASM path runChaPostPass uses 0.8; alignment tracked in helpers.ts TODO.)
662664
// Skip zero-confidence edges to match buildFileCallEdges / buildChaPostPass behaviour.
663665
const conf =
664666
computeConfidence(caller_file ?? '', methodNode.method_file ?? '', null) -

0 commit comments

Comments
 (0)