Skip to content

WASM incremental build drops edges (442 missing vs full build) #932

@carlos-alm

Description

@carlos-alm

Description

When running a WASM incremental build with 5 changed files, the resulting graph has 442 fewer edges than a full build of the same codebase. This means incremental rebuilds silently produce an incomplete graph.

Reproduction

# Full build baseline
codegraph build src --engine wasm --no-incremental
# Output: 10,695 nodes, 21,461 edges

# Touch 5 files
echo "// change" >> src/cli.ts
echo "// change" >> src/domain/parser.ts
echo "// change" >> src/db/index.ts
echo "// change" >> src/domain/queries.ts
echo "// change" >> src/domain/graph/builder.ts

# Incremental rebuild
codegraph build src --engine wasm
# Output: 10,695 nodes, 21,019 edges  ← 442 edges MISSING

Expected

Incremental build should produce the same edge count as a full build (21,461 edges).

Observed

  • Full build: 21,461 edges
  • Incremental (5 files): 21,019 edges (-442)

Context

  • Native engine does NOT have this bug — incremental produces 21,534 edges (slight increase from comment lines is expected)
  • WASM incremental also reparses 87 reverse-dep files beyond the 5 changed (see WASM incremental reparses reverse-dep files unnecessarily (92 vs 5) #933), which may be related — edges from those files may not be correctly re-inserted
  • Version: 3.9.4-dev.8, Windows 11, Node 22.18.0

Impact

Users relying on WASM incremental builds get silently degraded query results — missing call edges, broken impact analysis, incorrect dead-code detection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions