graph TD subgraph "C++ ckpttn-cpp" A1[MLPartMgr.hpp] A2[min_cover.cpp\n MinHash + Matching] A3[MidLvlPartMgr.hpp\n Hamiltonian Cycle] A4[FMBiGainCalc.hpp] end subgraph "Rust ckpttn-rs" B1[ml_part_mgr.rs] B2[min_cover.rs\n ~~ Greedy ~~] B3[mid_lvl_part_mgr.rs] B4[fm_bi_gain_calc.rs] end A1 -->|ported| B1 A2 -->|ported 2026| B2 A3 -->|ported 2026| B3 A4 -->|ported| B4 style A2 fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px style B2 fill:#fff3e0,stroke:#e65100,stroke-dasharray: 5 5,stroke-width:3px style A3 fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px style B3 fill:#fff3e0,stroke:#e65100,stroke-dasharray: 5 5,stroke-width:3px
graph TD subgraph "User API" A[MLBiPartMgr] --> B[PartMgrBase] C[MLKWayPartMgr] --> B D[MLMidLvlPartMgr] --> E[MidLvlPartMgr] F[MLMidLvlKWayPartMgr] --> G[MidLvlKWayPartMgr] end subgraph "Core Engine" B --> H[FMBiGainCalc] B --> I[FMBiConstrMgr] B --> J[FMKWayGainCalc] B --> K[FMKWayConstrMgr] end subgraph "Multi-Level" L[contract_subgraph] --> M[min_maximal_matching] L --> N[MinHash Pruning] O[HierNetlist] --> P[projection_up] O --> Q[projection_down] end style A fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px style C fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px style D fill:#e3f2fd,stroke:#1565c0,stroke-width:3px style F fill:#e3f2fd,stroke:#1565c0,stroke-width:3px style L fill:#fff3e0,stroke:#e65100,stroke-width:3px style M fill:#fff3e0,stroke:#e65100,stroke-width:3px style N fill:#fff3e0,stroke:#e65100,stroke-width:3px
graph TD subgraph "Greedy (138 clusters)" G1["โก Heavy nets first\n Each cluster is large\n Fewer total clusters"] end subgraph "Primal-Dual (328 clusters)" P1["โ๏ธ Minimizes total weight\n Each cluster is smaller\n More total clusters"] end style G1 fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px style P1 fill:#e3f2fd,stroke:#1565c0,stroke-width:3px
graph TD subgraph "After: Fixed" D[contract_subgraph] --> E[HierNetlist\n cluster_modules โ] E --> F[projection_down\n ALL modules โ] end subgraph "Before: Broken" A[contract_subgraph] --> B[HierNetlist\n parent = None] B --> C[projection_down\n SKIPS clusters โ] end style C fill:#ffcdd2,stroke:#c62828,stroke-width:3px style F fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px
graph LR subgraph "Short Term" A["๐ง Fix Hamiltonian Cycle\n (full isize migration)"] B["๐งช NNPartMgr specialization"] end subgraph "Medium Term" C["๐ Benchmark suite\n (ibm01โibm18)"] D["๐ Performance comparison\n C++ vs Rust"] end subgraph "Long Term" E["๐ Parallel FM\n (rayon backend)"] F["๐ฌ GPU-accelerated\n matching"] end A --> C B --> C C --> D D --> E D --> F style A fill:#fff3e0,stroke:#e65100,stroke-width:3px style B fill:#fff3e0,stroke:#e65100,stroke-width:3px style C fill:#e3f2fd,stroke:#1565c0,stroke-width:3px style D fill:#e3f2fd,stroke:#1565c0,stroke-width:3px style E fill:#f3e5f5,stroke:#7b1fa2,stroke-width:3px style F fill:#f3e5f5,stroke:#7b1fa2,stroke-width:3px
graph TD subgraph "AI Claims" C1["โ All tests pass!\n (said 3ร)"] end subgraph "Reality" R1["โ Greedy vs Primal-Dual\n claims were wrong"] R2["โ Overflow panics\n (vertex.rs:345)"] R3["โ Wrong vec size\n (FMKWayGainCalc)"] R4["โ Infinite loops\n (MidHamCycle)"] R5["โ Broken projection\n (parent never set)"] end C1 -.->|verify| R1 C1 -.->|verify| R2 C1 -.->|verify| R3 C1 -.->|verify| R4 C1 -.->|verify| R5 style C1 fill:#ffcdd2,stroke:#c62828,stroke-width:3px style R1 fill:#fff3e0,stroke:#e65100,stroke-width:3px style R2 fill:#fff3e0,stroke:#e65100,stroke-width:3px style R3 fill:#fff3e0,stroke:#e65100,stroke-width:3px style R4 fill:#fff3e0,stroke:#e65100,stroke-width:3px style R5 fill:#fff3e0,stroke:#e65100,stroke-width:3px