# fz920722/ft-dag architecture

> Architecture diagram of the GitHub repository fz920722/ft-dag, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fz920722/ft-dag
- Repository: https://github.com/fz920722/ft-dag

## Overview

FT-DAG is a Python toolkit for generating directed acyclic task graphs. Its primary workflow is to configure topology constraints, enumerate shape/layer candidates, and generate DAGs; it also provides four alternative generators for comparison. FT_DAG.py includes database-backed reuse as well as graph construction, but the excerpt does not establish how its data file is populated or how callers invoke the generator. The map preserves those documented alternatives and shared interval/shape logic; connections are limited to imports and calls visible in the supplied source.

Main entry points: [`src/_Interval.py`](https://github.com/fz920722/ft-dag/blob/main/src/_Interval.py) (Interval constraints), [`src/FT_DAG.py`](https://github.com/fz920722/ft-dag/blob/main/src/FT_DAG.py) (FT-DAG engine), [`src/_Shape.py`](https://github.com/fz920722/ft-dag/blob/main/src/_Shape.py) (Shape enumeration), [`src/LBL.py`](https://github.com/fz920722/ft-dag/blob/main/src/LBL.py) (Layer-by-layer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Full-topology generator"]
  node_engine["FT-DAG engine<br/>[FT_DAG.py]"]
  node_cache[("DAG cache<br/>[DATA.db]")]
end

subgraph group_alternatives["Comparison generators"]
  node_sota["SoTA generator<br/>[SoTA.py]"]
  node_lbl["Layer-by-layer<br/>[LBL.py]"]
  node_fio["Fan-in/fan-out<br/>[FIO.py]"]
  node_gnm["GNM generator<br/>[GNM.py]"]
end

subgraph group_shared["Shared primitives"]
  node_shapes["Shape enumeration<br/>[_Shape.py]"]
  node_intervals["Interval constraints<br/>[_Interval.py]"]
end

node_engine -->|"reads/writes"| node_cache
node_engine -.->|"uses"| node_shapes
node_engine -->|"uses"| node_intervals
node_lbl -->|"uses"| node_shapes
node_lbl -->|"uses"| node_intervals
node_fio -->|"uses"| node_intervals
node_sota -->|"uses"| node_intervals
node_shapes -->|"uses"| node_intervals

click node_engine "https://github.com/fz920722/ft-dag/blob/main/src/FT_DAG.py"
click node_cache "https://github.com/fz920722/ft-dag/blob/main/data/DATA.db"
click node_sota "https://github.com/fz920722/ft-dag/blob/main/src/SoTA.py"
click node_lbl "https://github.com/fz920722/ft-dag/blob/main/src/LBL.py"
click node_fio "https://github.com/fz920722/ft-dag/blob/main/src/FIO.py"
click node_gnm "https://github.com/fz920722/ft-dag/blob/main/src/GNM.py"
click node_shapes "https://github.com/fz920722/ft-dag/blob/main/src/_Shape.py"
click node_intervals "https://github.com/fz920722/ft-dag/blob/main/src/_Interval.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_engine,node_cache toneBlue
class node_sota,node_lbl,node_fio,node_gnm toneAmber
class node_shapes,node_intervals toneMint
```

## Components

### Full-topology generator

- [FT-DAG engine](https://github.com/fz920722/ft-dag/blob/main/src/FT_DAG.py): `src/FT_DAG.py`
- [DAG cache](https://github.com/fz920722/ft-dag/blob/main/data/DATA.db): `data/DATA.db`

### Comparison generators

- [SoTA generator](https://github.com/fz920722/ft-dag/blob/main/src/SoTA.py): `src/SoTA.py`
- [Layer-by-layer](https://github.com/fz920722/ft-dag/blob/main/src/LBL.py): `src/LBL.py`
- [Fan-in/fan-out](https://github.com/fz920722/ft-dag/blob/main/src/FIO.py): `src/FIO.py`
- [GNM generator](https://github.com/fz920722/ft-dag/blob/main/src/GNM.py): `src/GNM.py`

### Shared primitives

- [Shape enumeration](https://github.com/fz920722/ft-dag/blob/main/src/_Shape.py): `src/_Shape.py`
- [Interval constraints](https://github.com/fz920722/ft-dag/blob/main/src/_Interval.py): `src/_Interval.py`

## Connections

- FT-DAG engine → DAG cache: reads/writes (evidence: `src/FT_DAG.py`)
- FT-DAG engine → Shape enumeration: uses (evidence: `src/FT_DAG.py`)
- FT-DAG engine → Interval constraints: uses (evidence: `src/FT_DAG.py`)
- Layer-by-layer → Shape enumeration: uses (evidence: `src/LBL.py`)
- Layer-by-layer → Interval constraints: uses (evidence: `src/LBL.py`)
- Fan-in/fan-out → Interval constraints: uses (evidence: `src/FIO.py`)
- SoTA generator → Interval constraints: uses (evidence: `src/SoTA.py`)
- Shape enumeration → Interval constraints: uses (evidence: `src/_Shape.py`)
