graph TB subgraph ckpttn-rs A1["fm_bi_gain_calc.rs\nfm_bi_gain_mgr.rs"] A2["part_mgr_base.rs\nml_part_mgr.rs"] A3["fm_kway_gain_calc.rs"] end subgraph ckpttn-cpp B1["FMBiGainCalc.hpp\nFMBiGainMgr.hpp"] B2["PartMgrBase.hpp\nMLPartMgr.hpp"] B3["FMKWayGainCalc.hpp"] end subgraph ckpttnpy D1["FMBiGainCalc.py\nFMBiGainMgr.py"] D2["PartMgrBase.py\nMLPartMgr.py"] D3["FMKWayGainCalc.py"] end A1 -.->|"same algorithm"| B1 A1 -.->|"same algorithm"| D1 A2 -.->|"same algorithm"| B2 A2 -.->|"same algorithm"| D2 A3 -.->|"same algorithm"| B3 A3 -.->|"same algorithm"| D3
graph LR R[🦀 Rust 28 files238 tests] C[⚡ C++ 106 filesstress-tested] P[🐍 Python 19 files23 tests] C -->|"fastest"| M{{"FM Algorithm\nIdentical Logic"}} R -->|"balanced"| M P -->|"prototyping"| M style R fill:#b48ead,stroke:#5e81ac style C fill:#a3be8c,stroke:#5e81ac style P fill:#88c0d0,stroke:#5e81ac style M fill:#5e81ac,stroke:#5e81ac
graph LR A["Rust 238 ✅"] --> D["262 Total\nAll Passing"] B["C++ large suite ✅"] --> D C["Python 23 ✅"] --> D style A fill:#b48ead,stroke:#5e81ac style B fill:#a3be8c,stroke:#5e81ac style C fill:#88c0d0,stroke:#5e81ac style D fill:#5e81ac,stroke:#5e81ac
graph LR subgraph p1["p1 Runtime (log scale, ms)"] CPP["C++ 3.42 ms 🥇"] --> RUST["Rust 51.2 ms 🥈"] RUST --> PY["Python 202 ms 🥉"] end style CPP fill:#a3be8c,stroke:#5e81ac style RUST fill:#b48ead,stroke:#5e81ac style PY fill:#88c0d0,stroke:#5e81ac
graph LR subgraph ibm03["ibm03 Runtime (ms, log scale)"] CPP2["C++ 262 ms 🥇"] --> RUST2["Rust 1,467 ms 🥈"] RUST2 --> PY2["Python 9,691 ms 🥉"] end style CPP2 fill:#a3be8c,stroke:#5e81ac style RUST2 fill:#b48ead,stroke:#5e81ac style PY2 fill:#88c0d0,stroke:#5e81ac
graph LR subgraph scaling["Scaling Factor (p1 → ibm03)"] CScale["C++ 76× 🐌"] --> RScale["Rust 29× 🚀"] RScale --> PScale["Python 48× 🐢"] end style CScale fill:#a3be8c,stroke:#5e81ac style RScale fill:#b48ead,stroke:#5e81ac style PScale fill:#88c0d0,stroke:#5e81ac
graph TB subgraph legend["Legend"] L1["🥇 Fastest"] --- L2["🥈 Middle"] --- L3["🥉 Slowest"] end subgraph p1res["p1 (833 modules)"] P1C["C++ 3.42 ms 🥇"] P1R["Rust 51.2 ms 🥈"] P1P["Python 202 ms 🥉"] end subgraph ibmres["ibm03 (23k modules)"] I1C["C++ 262 ms 🥇"] I1R["Rust 1,467 ms 🥈"] I1P["Python 9,691 ms 🥉"] end P1C --> I1C P1R --> I1R P1P --> I1P style P1C fill:#a3be8c,stroke:#5e81ac style P1R fill:#b48ead,stroke:#5e81ac style P1P fill:#88c0d0,stroke:#5e81ac style I1C fill:#a3be8c,stroke:#5e81ac style I1R fill:#b48ead,stroke:#5e81ac style I1P fill:#88c0d0,stroke:#5e81ac
graph LR subgraph done["✅ Done"] A["delta_gain_w rename"] B["Cross-validation tests"] C["Criterion benchmarks"] D["Head-to-head comparison"] end subgraph next["🚀 Next"] E["Python rename PR\n(totalcost → total_cost)"] F["Flat Vec storage\nin Rust hot paths"] G["Benchmark\nFMKWay (k-way)"] end A --> E B --> F C --> G style done fill:#a3be8c,stroke:#5e81ac style next fill:#88c0d0,stroke:#5e81ac