fix: Topology Spec with the switch hierarchy#246
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #246 +/- ##
=======================================
Coverage 68.46% 68.46%
=======================================
Files 82 82
Lines 4842 4842
=======================================
Hits 3315 3315
Misses 1395 1395
Partials 132 132 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Greptile SummaryThis PR fixes topology spec generation for tree-based topologies by replacing the immediate-parent-only switch reference with the full ancestor switch hierarchy. Previously, The lookup strategy in Confidence Score: 5/5Safe to merge — logic is correct, tests pass for all code paths including cluster-wide and per-partition topologies. No P0/P1 issues found. The ancestor-chain construction in both initTree and getTreeTopologyUnit is correctly ordered and handles the empty-root-ID convention. The O(depth) map lookup in getTopologySpec is a strict improvement. All updated test expectations align with the traced execution paths. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[BFS over topology.Vertex tree] -->|leaf node found| B["nodeInfo.switches = parentMap[v.ID]"]
A -->|non-leaf vertex v| C{"len(v.ID) != 0?"}
C -->|yes| D["parentMap[w.ID] = parentMap[v.ID] + [v.ID]"]
C -->|no root vertex| E[skip — root excluded from path]
D --> A
F[getTreeTopologyUnit / getBlockTopologyUnit] -->|build partition tree| G["tu.Tree.parents[key] = ancestors + [v.ID]"]
G -->|leaf uses w.Name as key| H["parents['Node201'] = ['IB2','S1','S3']"]
G -->|switch uses w.ID as key| I["parents['S3'] = ['IB2','S1']"]
J[GetNodeTopologySpec] -->|cluster-wide tree| K["strings.Join(nodeInfo.switches, ':')"]
J -->|per-partition| L["getTopologySpec → parents map lookup O(depth)"]
K --> M["default:S1:S2"]
L --> N["topo1:IB2:S1:S3"]
Reviews (2): Last reviewed commit: "fix: Topology Spec with the switch hiera..." | Re-trigger Greptile |
Signed-off-by: Ravi Shankar <ravish@nvidia.com>
No description provided.