You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_relations in src/morphobricks_preprocessing/mask_scan.py marks a parent link direct=False whenever a two-edge path exists (transitive reduction), which assumes an acyclic graph. Cycle detection (hierarchy_cycles) runs only afterwards, on the direct edges.
For a dense or chorded cycle (for example every pair among A, B, C is inside the other), every edge has an alternate two-step path, so every edge becomes direct=False. MaskReport.hierarchy then has no edges, no mask_hierarchy_cycle warning is emitted, and the masks silently appear as separate roots.
Reproduced on current main through _relations with a complete directed 3-cycle and with a 3-cycle plus a chord: no edge is direct.
Fix: find strongly connected components on the full nested-relation graph before choosing direct edges; edges inside a component stay direct (so the cycle is reported), and the transitive reduction runs only between components. Acyclic hierarchies keep exactly the same direct edges.
Activity