# nyu-mlda/abc-rl architecture

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

- Interactive diagram: https://gitdiagram.com/nyu-mlda/abc-rl
- Repository: https://github.com/nyu-mlda/abc-rl

## Overview

ABC-RL trains and evaluates reinforcement-learning agents that optimize logic-synthesis sequences for benchmark AIG circuits, targeting area-delay improvement over a resyn2 baseline. The user supplies a benchmark split and technology library; the training entry point coordinates circuit environments, MCTS experience collection, replay, and policy updates. The repository has ICLR GCN and DAGNN model variants. The README also documents pretrained evaluation and synergy/embedding analyses. Some wiring is supported only by the SOURCE INDEX; unsampled implementation details are not inferred.

Main entry points: [`ABC-RL_ICLR/src/main.py`](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/main.py) (ICLR runner), [`ABC-RL_DAGNN/src/main.py`](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/main.py) (DAGNN runner), [`ABC-RL_DAGNN/src/LogicSynthesisPolicy.py`](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/LogicSynthesisPolicy.py) (DAGNN policy), [`ABC-RL_ICLR/src/evaluate_synergy.py`](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/evaluate_synergy.py) (ICLR evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Training and search"]
  node_iclr_main["ICLR runner<br/>[main.py]"]
  node_dag_main["DAGNN runner<br/>[main.py]"]
  node_iclr_mcts["ICLR MCTS<br/>[mcts.py]"]
  node_dag_mcts["DAGNN MCTS<br/>[mcts.py]"]
  node_iclr_replay[("ICLR replay memory<br/>[replay_memory.py]")]
  node_dag_replay[("DAGNN replay memory<br/>[replay_memory.py]")]
  node_iclr_trainer["ICLR trainer<br/>[trainer.py]"]
  node_dag_trainer["DAGNN trainer<br/>[trainer.py]"]
end

subgraph group_environment["Circuit environment"]
  node_iclr_env["ICLR synthesis env"]
  node_dag_env["DAGNN synthesis env"]
  node_iclr_static["ICLR static env<br/>[static_env.py]"]
  node_dag_static["DAGNN static env<br/>[static_env.py]"]
  node_dag_utils["DAG utilities<br/>[dag_utils.py]"]
end

subgraph group_models["Graph policies"]
  node_iclr_policy["ICLR GCN policy"]
  node_dag_policy["DAGNN policy"]
  node_dag_gcn["GCN convolution<br/>[gcn_conv.py]"]
  node_dag_gat["GAT convolution<br/>[gat_conv.py]"]
  node_dag_deepset["DeepSets convolution<br/>[deepset_conv.py]"]
  node_dag_gated["Gated-sum convolution<br/>[gated_sum_conv.py]"]
  node_dag_mlp["MLP layers<br/>[mlp.py]"]
end

subgraph group_analysis["Evaluation and analysis"]
  node_dag_fr["FR logits metrics<br/>[basic_FR_logits.py]"]
  node_iclr_fr["FR logits metrics<br/>[basic_FR_logits.py]"]
  node_iclr_energy["Energy scoring<br/>[energy.py]"]
  node_iclr_softmax["Softmax scoring"]
  node_iclr_eval["ICLR evaluation"]
  node_dag_eval["DAGNN evaluation"]
  node_tsne["Embedding analysis"]
end

node_user(("Experimenter"))
node_benchmarks["AIG benchmarks"]
node_abc["ABC synthesis"]
node_library["Tech library"]

node_user -->|"starts training"| node_iclr_main
node_user -->|"starts training"| node_dag_main
node_benchmarks -->|"provides circuits"| node_iclr_main
node_benchmarks -->|"provides circuits"| node_dag_main
node_library -->|"configures synthesis"| node_iclr_main
node_library -->|"configures synthesis"| node_dag_main
node_iclr_main -->|"creates trainer"| node_iclr_trainer
node_iclr_main -->|"creates memory"| node_iclr_replay
node_iclr_main -->|"runs episodes"| node_iclr_env
node_iclr_main -->|"uses search"| node_iclr_mcts
node_dag_main -->|"creates trainer"| node_dag_trainer
node_dag_main -->|"creates memory"| node_dag_replay
node_dag_main -.->|"runs episodes"| node_dag_env
node_dag_main -.->|"uses search"| node_dag_mcts
node_iclr_trainer -->|"constructs policy"| node_iclr_policy
node_dag_trainer -->|"constructs policy"| node_dag_policy
node_iclr_env -->|"executes synthesis"| node_abc
node_iclr_env -->|"imports dynamics"| node_iclr_static
node_dag_env -->|"imports dynamics"| node_dag_static
node_dag_env -->|"uses graph utilities"| node_dag_utils
node_dag_policy -->|"uses graph utilities"| node_dag_utils
node_dag_policy -->|"uses convolution"| node_dag_gcn
node_dag_policy -->|"uses convolution"| node_dag_gat
node_dag_policy -->|"uses convolution"| node_dag_deepset
node_dag_policy -->|"uses convolution"| node_dag_gated
node_dag_deepset -->|"uses layers"| node_dag_mlp
node_iclr_eval -->|"evaluates agent"| node_iclr_main
node_dag_eval -->|"evaluates trained agent"| node_iclr_main
node_tsne -->|"extracts embeddings"| node_iclr_policy
node_dag_fr -.->|"scores logits"| node_iclr_eval
node_iclr_fr -.->|"scores logits"| node_iclr_eval
node_iclr_energy -.->|"scores logits"| node_iclr_eval
node_iclr_softmax -.->|"scores logits"| node_iclr_eval

click node_benchmarks "https://github.com/nyu-mlda/abc-rl/tree/main/arithmetic"
click node_library "https://github.com/nyu-mlda/abc-rl/tree/main/lib"
click node_iclr_main "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/main.py"
click node_dag_main "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/main.py"
click node_iclr_mcts "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/mcts.py"
click node_dag_mcts "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/mcts.py"
click node_iclr_replay "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/replay_memory.py"
click node_dag_replay "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/replay_memory.py"
click node_iclr_trainer "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/trainer.py"
click node_dag_trainer "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/trainer.py"
click node_iclr_env "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/LogicSynthesisEnv.py"
click node_dag_env "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/LogicSynthesisEnv.py"
click node_iclr_static "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/static_env.py"
click node_dag_static "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/static_env.py"
click node_dag_utils "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/dag_utils.py"
click node_iclr_policy "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/LogicSynthesisPolicy.py"
click node_dag_policy "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/LogicSynthesisPolicy.py"
click node_dag_gcn "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/gcn_conv.py"
click node_dag_gat "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/gat_conv.py"
click node_dag_deepset "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/deepset_conv.py"
click node_dag_gated "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/gated_sum_conv.py"
click node_dag_mlp "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/mlp.py"
click node_dag_fr "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/basic_FR_logits.py"
click node_iclr_fr "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/basic_FR_logits.py"
click node_iclr_energy "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/energy.py"
click node_iclr_softmax "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/softmax_response.py"
click node_iclr_eval "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/evaluate_synergy.py"
click node_dag_eval "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/evaluate_pretrained.py"
click node_tsne "https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/generateTSNEplot.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_iclr_main,node_dag_main,node_iclr_mcts,node_dag_mcts,node_iclr_replay,node_dag_replay,node_iclr_trainer,node_dag_trainer toneBlue
class node_iclr_env,node_dag_env,node_iclr_static,node_dag_static,node_dag_utils toneAmber
class node_iclr_policy,node_dag_policy,node_dag_gcn,node_dag_gat,node_dag_deepset,node_dag_gated,node_dag_mlp toneMint
class node_dag_fr,node_iclr_fr,node_iclr_energy,node_iclr_softmax,node_iclr_eval,node_dag_eval,node_tsne toneRose
class node_user,node_abc toneIndigo
class node_benchmarks,node_library toneTeal
```

## Components

### Training and search

- [ICLR runner](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/main.py): `ABC-RL_ICLR/src/main.py`
- [DAGNN runner](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/main.py): `ABC-RL_DAGNN/src/main.py`
- [ICLR MCTS](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/mcts.py): `ABC-RL_ICLR/src/mcts.py`
- [DAGNN MCTS](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/mcts.py): `ABC-RL_DAGNN/src/mcts.py`
- [ICLR replay memory](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/replay_memory.py): `ABC-RL_ICLR/src/replay_memory.py`
- [DAGNN replay memory](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/replay_memory.py): `ABC-RL_DAGNN/src/replay_memory.py`
- [ICLR trainer](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/trainer.py): `ABC-RL_ICLR/src/trainer.py`
- [DAGNN trainer](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/trainer.py): `ABC-RL_DAGNN/src/trainer.py`

### Circuit environment

- [ICLR synthesis env](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/LogicSynthesisEnv.py): `ABC-RL_ICLR/src/LogicSynthesisEnv.py`
- [DAGNN synthesis env](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/LogicSynthesisEnv.py): `ABC-RL_DAGNN/src/LogicSynthesisEnv.py`
- [ICLR static env](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/static_env.py): `ABC-RL_ICLR/src/static_env.py`
- [DAGNN static env](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/static_env.py): `ABC-RL_DAGNN/src/static_env.py`
- [DAG utilities](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/dag_utils.py): `ABC-RL_DAGNN/src/dag_utils.py`

### Graph policies

- [ICLR GCN policy](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/LogicSynthesisPolicy.py): `ABC-RL_ICLR/src/LogicSynthesisPolicy.py`
- [DAGNN policy](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/LogicSynthesisPolicy.py): `ABC-RL_DAGNN/src/LogicSynthesisPolicy.py`
- [GCN convolution](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/gcn_conv.py): `ABC-RL_DAGNN/src/gcn_conv.py`
- [GAT convolution](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/gat_conv.py): `ABC-RL_DAGNN/src/gat_conv.py`
- [DeepSets convolution](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/deepset_conv.py): `ABC-RL_DAGNN/src/deepset_conv.py`
- [Gated-sum convolution](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/gated_sum_conv.py): `ABC-RL_DAGNN/src/gated_sum_conv.py`
- [MLP layers](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/mlp.py): `ABC-RL_DAGNN/src/mlp.py`

### Evaluation and analysis

- [FR logits metrics](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/basic_FR_logits.py): `ABC-RL_DAGNN/src/basic_FR_logits.py`
- [FR logits metrics](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/basic_FR_logits.py): `ABC-RL_ICLR/src/basic_FR_logits.py`
- [Energy scoring](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/energy.py): `ABC-RL_ICLR/src/energy.py`
- [Softmax scoring](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/softmax_response.py): `ABC-RL_ICLR/src/softmax_response.py`
- [ICLR evaluation](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_ICLR/src/evaluate_synergy.py): `ABC-RL_ICLR/src/evaluate_synergy.py`
- [DAGNN evaluation](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/evaluate_pretrained.py): `ABC-RL_DAGNN/src/evaluate_pretrained.py`
- [Embedding analysis](https://github.com/nyu-mlda/abc-rl/blob/main/ABC-RL_DAGNN/src/generateTSNEplot.py): `ABC-RL_DAGNN/src/generateTSNEplot.py`

### Other components

- **Experimenter**
- [AIG benchmarks](https://github.com/nyu-mlda/abc-rl/tree/main/arithmetic): `arithmetic`
- **ABC synthesis**
- [Tech library](https://github.com/nyu-mlda/abc-rl/tree/main/lib): `lib`

## Connections

- Experimenter → ICLR runner: starts training (evidence: `README.md`)
- Experimenter → DAGNN runner: starts training (evidence: `README.md`)
- AIG benchmarks → ICLR runner: provides circuits (evidence: `README.md`)
- AIG benchmarks → DAGNN runner: provides circuits (evidence: `README.md`)
- Tech library → ICLR runner: configures synthesis (evidence: `README.md`)
- Tech library → DAGNN runner: configures synthesis (evidence: `README.md`)
- ICLR runner → ICLR trainer: creates trainer (evidence: `ABC-RL_ICLR/src/main.py`)
- ICLR runner → ICLR replay memory: creates memory (evidence: `ABC-RL_ICLR/src/main.py`)
- ICLR runner → ICLR synthesis env: runs episodes (evidence: `ABC-RL_ICLR/src/main.py`)
- ICLR runner → ICLR MCTS: uses search (evidence: `ABC-RL_ICLR/src/main.py`)
- DAGNN runner → DAGNN trainer: creates trainer (evidence: `ABC-RL_DAGNN/src/main.py`)
- DAGNN runner → DAGNN replay memory: creates memory (evidence: `ABC-RL_DAGNN/src/main.py`)
- DAGNN runner → DAGNN synthesis env: runs episodes
- DAGNN runner → DAGNN MCTS: uses search
- ICLR trainer → ICLR GCN policy: constructs policy (evidence: `ABC-RL_ICLR/src/trainer.py`)
- DAGNN trainer → DAGNN policy: constructs policy (evidence: `ABC-RL_DAGNN/src/trainer.py`)
- ICLR synthesis env → ABC synthesis: executes synthesis (evidence: `ABC-RL_ICLR/src/LogicSynthesisEnv.py`)
- ICLR synthesis env → ICLR static env: imports dynamics (evidence: `ABC-RL_ICLR/src/LogicSynthesisEnv.py`)
- DAGNN synthesis env → DAGNN static env: imports dynamics (evidence: `ABC-RL_DAGNN/src/LogicSynthesisEnv.py`)
- DAGNN synthesis env → DAG utilities: uses graph utilities (evidence: `ABC-RL_DAGNN/src/LogicSynthesisEnv.py`)
- DAGNN policy → DAG utilities: uses graph utilities (evidence: `ABC-RL_DAGNN/src/LogicSynthesisPolicy.py`)
- DAGNN policy → GCN convolution: uses convolution (evidence: `ABC-RL_DAGNN/src/LogicSynthesisPolicy.py`)
- DAGNN policy → GAT convolution: uses convolution (evidence: `ABC-RL_DAGNN/src/LogicSynthesisPolicy.py`)
- DAGNN policy → DeepSets convolution: uses convolution (evidence: `ABC-RL_DAGNN/src/LogicSynthesisPolicy.py`)
- DAGNN policy → Gated-sum convolution: uses convolution (evidence: `ABC-RL_DAGNN/src/LogicSynthesisPolicy.py`)
- DeepSets convolution → MLP layers: uses layers (evidence: `ABC-RL_DAGNN/src/deepset_conv.py`)
- ICLR evaluation → ICLR runner: evaluates agent (evidence: `ABC-RL_ICLR/src/evaluate_synergy.py`)
- DAGNN evaluation → ICLR runner: evaluates trained agent (evidence: `ABC-RL_DAGNN/src/evaluate_pretrained.py`)
- Embedding analysis → ICLR GCN policy: extracts embeddings (evidence: `ABC-RL_DAGNN/src/generateTSNEplot.py`)
- FR logits metrics → ICLR evaluation: scores logits
- FR logits metrics → ICLR evaluation: scores logits
- Energy scoring → ICLR evaluation: scores logits
- Softmax scoring → ICLR evaluation: scores logits
