atvrager / factorilog
commit 44b6c0f (2026-11-13) · 6C/12T AMD Ryzen 5 7600X 6-Core Processor

Foundry PDK & EDA Physical Compiler for Factorio

Factorilog synthesizes balanced production graphs from live Factorio prototype data via LP optimization, places macros across a 94×94 tile city-block chassis using analytical quadratic wirelength minimization and OpenROAD, routes multi-layer underground belts and fluids with a 3D PathFinder maze router, and verifies zero-cheat execution directly against Factorio C++ internals and live UDP multiplayer lockstep.

1200×1200
7-Science Chassis Die (tiles)
3,824
DEF Macro Instances (51 PDK cells)
188,786
Placed Blueprint Entities
0 DRC
Physical Overlap Violations
1.64s / 86.6s
PnR / 3D Maze Route Time
60 SPM × 7
All Base Science Packs
Download science_chassis.blueprint

Interactive 7-Science Die & Layer Inspector (science_chassis)

LIVE GEOMETRY + SPRITE OVERLAY
Loading geometry from data/die_science_chassis.json...

Game-Sprite Renderings & SystemVerilog Telemetry

RENDERED FROM FACTORIO PROTOTYPE ASSETS
Full 1200x1200 science_chassis factory die rendering

Full 7-Science Chassis Die (1200×1200 tiles)

Global die view showing 12×12 100-tile pitch city blocks, 6-tile perimeter street channels, perimeter substations/lamps, West raw bus pins, and East rocket silo complex.

32 px/tile street-straddling detail crop of science_chassis

Native 32 px/tile Street-Straddling Detail Crop

Zoomed extract directly from the decoded 188,786-entity blueprint showing assembling machines, inserters, splitter trees, surface M1 belts, and underground tunnel transitions crossing a street channel.

Automation science factory controlled by synthesized Verilog FSM

SystemVerilog Power Sequencer (power_sequencer.v)

1-science factory paired with synthesized arithmetic/decider combinators, backup pump control, hysteresis FSM states, and seven-segment I/O telemetry panels.

IC-to-Factorio PDK Mapping

VLSI ConceptFactorio Equivalent
Standard CellBuilding + recipe footprint (tech.lef)
Cell Delayenergy_required / crafting_speed (tech.lib)
M1 / M2 / M3 LayersSurface belts / underground tunnels / pipes
Clock / RTL FSMpyslang Verilog → combinator graph
PDN GridBig pole & substation Minimum Spanning Tree
DRC / LVS SignoffNative C++ ELF TransportLine simulation

Click any sprite image or pipeline diagram to zoom full screen.

Compiler Architecture & Algorithmics

DETERMINISTIC VECTOR DIAGRAMS FROM REAL ARTIFACTS
Stage 1 LP Solver DAG and science_chassis treemap

1. Synthesis & Rate Solver (foundry/solve.py, netbuild.py): Solves a SciPy linear program over the game prototype dump with zero mass-balance error, then lowers fractional demand into integer machines, balanced 2-to-2 binary splitter/merger trees, Liberty timing stubs, and LEF macros.

Stage 2 Naive Rank Placement vs Analytical Quadratic Placement and City-Block Legalization

2. Analytical Placement & Legalization (analytical_placer.py, flow/factorilog.tcl): Condenses strongly connected recipe cycles (Tarjan SCC) to enforce acyclic West-to-East topological ordering, minimizes continuous quadratic wirelength with boundary anchors, and legalizes macros into 94×94 city-block cores around 6-tile street channels.

Stage 3 Hierarchical 3D Multi-Layer Maze Router

3. Hierarchical 3D Maze Router (def2bp.py, foundry/router/): Routes intra-block nets inside each 94×94 core before promoting cross-block nets onto highway street channels. Negotiated PathFinder congestion cost (base + history × present) allocates underground belt and pipe jumps using exact prototype spans with zero DRC violations.

Stage 4 SystemVerilog FSM, Native ELF Verification, and UDP Freeplay Campaign

4. RTL Controllers, Native ELF Signoff & Autonomous Agent: Compiles power_sequencer.v into Factorio combinators, validates throughput against patched dlopen symbols in Factorio's own binary (TransportLine::move, FluidBuffer::getFlowRate), and drives a live unmodded multiplayer game over UDP.

Zero-Cheat Autonomous Freeplay Starter Base

LIVE UDP LOCKSTEP VERIFIED
Autonomous starter_base rendered blueprint

Procedural Terrain to Red-Science Mall

Synthesized directly from scanned Freeplay terrain coordinates (foundry/campaign/cartographer.py, foundry/patch_router.py, foundry/mp_proxy.py) without Lua command cheats or fixed map seeds.

End-to-End Lockstep Pipeline

Instead of pasting cheat blueprints with elevated Lua permissions, the agent spawns as an ordinary engineer in headless multiplayer Freeplay, classifies water shorelines and resource clusters from map packets, navigates A* paths around cliffs and water, mines initial ore, crafts drills and boilers, and builds every entity manually over UDP.

  • Cartographer: Detects water, resource patches, cliffs, rocks, and trees dynamically.
  • Patch Router: Synthesizes shoreline steam power and patch-to-smelter belt topologies.
  • Anti-Cheat Enforced: Tested statically by //tools:no_bot_cheats_test.
Download .blueprint

Factory Scaling & Compile Benchmarks (60 SPM per Pack)

0 DRC ACROSS ALL TARGETS
Measurement Provenance: Built and timed at commit 44b6c0f (2026-11-13) on AMD Ryzen 5 7600X 6-Core Processor (6 physical cores / 12 logical threads).
synth: 1 thread (Python LP solver and netlister) pnr: 12 threads (OpenROAD set_thread_count [exec nproc]) bp: 1 thread (Python 3D maze router and MST power grid) render: 1 thread (Python Pillow sprite compositor) save: 1 thread (Headless Factorio save serializer)
Click any column header to sort
Target Packs Die Size Macros PDK Cells BP Entities DRC Synth (s) PnR (s) Route+BP (s) Compile (s)
automation_science1202×1203891,64200.511.432.274.21
automation_controlled_science1248×12256141,81001.131.012.464.61
automation_science_chassis1300×3004692,50300.941.052.084.08
automation_logistic_chassis2300×300119146,48805.700.773.7310.21
automation_logistic_military_chassis3300×3002442111,38606.160.756.3013.20
automation_logistic_military_chemical_chassis4400×4005803026,22700.850.3417.6718.87
automation_logistic_military_chemical_production_chassis5700×7001,5213568,22407.161.1126.9635.22
automation_logistic_military_chemical_production_utility_chassis6900×9002,43943116,339016.050.95104.41121.41
science_chassis71200×12003,82451188,7860111.231.6486.61199.48