Skip to content

Fix binary callees/callers/flow always empty: route id >= bin_base to… - #31

Merged
hungpham10 merged 2 commits into
mainfrom
fix/issue-binary-graph-cannot-trace-inside-graph
Sep 12, 2026
Merged

Fix binary callees/callers/flow always empty: route id >= bin_base to…#31
hungpham10 merged 2 commits into
mainfrom
fix/issue-binary-graph-cannot-trace-inside-graph

Conversation

@hungpham10

Copy link
Copy Markdown
Owner

… BinaryGraph (#26 regression)

After the storage split, binary symbols live only in binary.sqlite (id range bin_base = 2e9) while codegraph_callees/callers/flow still queried the main GraphIndex, so every binary returned empty results. Now those tools route to BinaryGraph when the node id falls in the binary range, with a fallback to the old path if the binary DB is unavailable.

  • BinaryGraph: add callees (call records resolved by name within the same binary), callers (BFS over a new caller_of:{name} reverse index built at ingest) and flow (chain render with CFG markers + call sites, same shape as GraphIndex::flow).
  • Ingest: stop corrupting chain entries — CFG markers (id < SYMBOL_BASE) and unresolved-call placeholders (0) are kept as-is; only real symbol ids are remapped into the bin_base range.
  • MCP: dispatch_binary_graph routes callees/callers/impact/flow for binary ids.
  • Config template: document the [bingraph] section (enabled/bin_base/storage) with a warning against overlapping id ranges.
  • Docs: binary-analysis.md updated for the split-storage architecture.
  • Tests: bingraph unit tests extended + end-to-end test compiling a real shared library and running it through r2 extraction and queries.

… BinaryGraph (#26 regression)

After the storage split, binary symbols live only in binary.sqlite (id range
bin_base = 2e9) while codegraph_callees/callers/flow still queried the main
GraphIndex, so every binary returned empty results. Now those tools route to
BinaryGraph when the node id falls in the binary range, with a fallback to the
old path if the binary DB is unavailable.

- BinaryGraph: add callees (call records resolved by name within the same
  binary), callers (BFS over a new caller_of:{name} reverse index built at
  ingest) and flow (chain render with CFG markers + call sites, same shape as
  GraphIndex::flow).
- Ingest: stop corrupting chain entries — CFG markers (id < SYMBOL_BASE) and
  unresolved-call placeholders (0) are kept as-is; only real symbol ids are
  remapped into the bin_base range.
- MCP: dispatch_binary_graph routes callees/callers/impact/flow for binary ids.
- Config template: document the [bingraph] section (enabled/bin_base/storage)
  with a warning against overlapping id ranges.
- Docs: binary-analysis.md updated for the split-storage architecture.
- Tests: bingraph unit tests extended + end-to-end test compiling a real
  shared library and running it through r2 extraction and queries.
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 20e72596-b41b-40ad-b6aa-ae01179e72d3


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hungpham10
hungpham10 merged commit 650194a into main Sep 12, 2026
17 of 18 checks passed
@codspeed-hq

codspeed-hq Bot commented Sep 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 28 untouched benchmarks


Comparing fix/issue-binary-graph-cannot-trace-inside-graph (2fe1a52) with main (457db80)

Open in CodSpeed

@hungpham10
hungpham10 deleted the fix/issue-binary-graph-cannot-trace-inside-graph branch September 13, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant