Skip to content

Fix why SVG/DOT subgraph pruning#103

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
dims:fix-why-svg-otel-timeout
Feb 11, 2026
Merged

Fix why SVG/DOT subgraph pruning#103
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
dims:fix-why-svg-otel-timeout

Conversation

@dims
Copy link
Copy Markdown
Member

@dims dims commented Feb 11, 2026

Summary

  • avoid dropping same-depth edges by removing only cycle back-edges in SVG/DOT subgraph
  • report unreachable targets based on main-module reachability
  • add regression test for same-depth edge retention

Testing

  • not run (not requested)

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 11, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 11, 2026
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 11, 2026
For SVG/DOT output, compute the path subgraph directly in O(V+E) using
bidirectional BFS reachability instead of enumerating individual paths
via DFS (which is exponentially slow on dense transitive graphs).

This fixes `depstat why go.opentelemetry.io/otel --svg` hanging for
16-38+ minutes on Kubernetes, etcd, and containerd — now completes
in under 1 second.

Key changes:
- Add computeReachableToTarget() for backward BFS pruning
- Add computePathSubgraph() for O(V+E) node/edge set extraction
- SVG/DOT renderers use pre-computed NodeSet/EdgeSet when available
- Add --max-depth flag for DFS depth limiting on text/JSON output
- Add safety iteration cap in assignLayers() for defense-in-depth
- Filter cycle back-edges using BFS depth ordering to ensure DAG

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
@dims dims force-pushed the fix-why-svg-otel-timeout branch from 5169435 to 45eb8b4 Compare February 11, 2026 21:37
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 11, 2026
@dims dims added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 11, 2026
@k8s-ci-robot k8s-ci-robot merged commit cb7a774 into kubernetes-sigs:main Feb 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants