How etdloauldaol/optimizer-and-legalizer-co-optimization works
Project type and purpose
• This is a monorepo of related CLI and web tools for “optimizer and legalizer co-optimization” lab tasks.
• Key components:
– Multiple Python scripts (CLI utilities) for analyses and conversions
– Video/GIF generators
– Two web front-ends (Node.js “WebCanvas” and Flask “web4MP4”)
– A shared “testcase” directory containing canonical input files (.lg, .opt)
File structure
Top-level folders:
• DieUtilRate – Python tool to compute utilization rates
• GenMP4 – Python + ffmpeg pipeline for MP4 generation
• GifAnimation – Python script to turn logs into GIFs
• Evaluator – (empty or placeholder for future evaluation code)
• WebCanvas – Node.js front-end that visualizes logs on HTML5 canvas
• web4MP4 – Flask app serving generated MP4s via a web UI
• testcase – shared inputs and a Python test harness
Notice pattern: CLI→data→visualization→web service.
README for extra clues
• README is minimal—no internal architecture docs. All insights must come from folder names, file types, and standard conventions (e.g. environment.yml → Conda Python).
Main components and interactions
A. Inputs (testcase/*.lg, testcase/*.opt)
B. CLI analyzers (Python scripts in DieUtilRate/, Evaluator/, testcase/testcase_checker.py)
– Produce .lg_post or .json analysis artifacts
C. Visualization pipelines:
1. GifAnimation/main.py
→ reads .lg/.opt → writes GIFs
2. GenMP4/main.py
→ reads .lg/.opt → calls ffmpeg → writes MP4s in GenMP4/mp4
D. Web front-ends:
1. WebCanvas (Node.js)
– Serves static HTML/JS
– Loads raw log data and video assets
2. web4MP4 (Flask/Python)
– Serves an index.html template
– Exposes static MP4s under /static
– Dependencies listed in requirements.txt
Architectural patterns & design principles
– Separation of concerns:
• Data processing (Python CLI)
• Asset generation (videos/GIFs)
• Presentation/UI (Node.js + Flask)
– File-based data flow: each stage reads/writes to disk
– Reusability: shared testcase folder as single source of truth
– Modular: each tool has its own directory, env spec, and CI potential