Skip to content

Fix large graph resolution collapse - #240

Merged
forhappy merged 1 commit into
mainfrom
codex/large-graph-resolution-resilience
Aug 14, 2026
Merged

Fix large graph resolution collapse#240
forhappy merged 1 commit into
mainfrom
codex/large-graph-resolution-resilience

Conversation

@forhappy

Copy link
Copy Markdown
Contributor

What changed

  • compact unreferenced low-inference leaf declarations before project-wide resolution
  • project retained declarations independently of relationship index construction
  • use deterministic bounded exact-only partitions if aggregate evidence remains oversized
  • publish a typed resolution report and universal_resolution_partial graph diagnostic for omissions
  • return a nonzero CLI outcome for degraded collection resolution while retaining the useful partial graph
  • persist degradation state across incremental builds and use an explicit bounded Rayon worker stack

Root cause

On stablyai/orca at commit ee8dd4796e39d77b1c2c19d6962430e901244bea, Compass collected 1,274,411 universal declarations, exceeding the resolver hard limit of 1,000,000. The resolver stored the error on the intermediate extraction, but the build pipeline still published success with mostly file scaffolding: 135,071 nodes and 2,377 edges.

Impact

A default-low Orca qualification after this change completed without degraded resolution and produced 866,633 nodes and 1,785,277 edges. It compacted 542,848 unused leaf declarations while preserving referenced parameters and properties. If a still-larger repository cannot fit the aggregate resolver after compaction, Compass now keeps all retained declarations, resolves only adapter-proven exact relationships in deterministic partitions, records omissions, and exits nonzero instead of silently presenting a collapsed graph as complete.

The successful Orca run took 320.60 seconds total: 258.3 seconds deterministic extraction and 58.2 seconds publication. Build and query latency were not optimization criteria for this fix.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --lib --bins --locked -- -D warnings
  • cargo test --workspace --lib --bins --locked
  • full compass-resolve integration test suite
  • compass-core and compass-cli unit suites
  • sh scripts/check_product_boundary.sh
  • ./scripts/qualify_code_graph_v1.sh --fixtures-only: 57 languages, all semantic assertions and deterministic byte comparisons passed
  • full release-mode Orca extraction at default low inference: 866,633 nodes, 1,785,277 edges, resolution_degraded: false

@forhappy
forhappy marked this pull request as ready for review August 14, 2026 00:37
@forhappy
forhappy merged commit e2355b4 into main Aug 14, 2026
14 checks passed
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