CartesianFusion
This openEnv is a prototype where the stellarator community can look at it as a reference for how to build a RL env for stellarator parameters optimization.
Core trick
A PDE solver verifies stellarator designs, and a two-phase reward first drives feasibility violations to zero, then rewards improving elongation.
Tags
Description
This openEnv is a prototype where the stellarator community can look at it as a reference for how to build a RL env for stellarator parameters optimization. Some experts in the industry use a 'black-box' optimizer to tune the parameters. Sometimes that optimizer can hit a ceiling. This env has a definite verifier (a PDE solver) and a reward system aimed to push the boundary. From my limited research, there's not been a RL paper on stellarator optimization. Fortunately, the trained model performed better than the baseline. Our reward works like a game score for reactor design: it first gives points for fixing the design until it satisfies all the required physics rules, where P1 feasibility is just a “how far from valid” number and 0 means the design finally meets every rule. Once the design is valid, the reward shifts to giving points for making it better, while subtracting points for wasting moves, getting stuck in loops, or ending with a weak result.
README excerpt
--- title: Fusion Design Lab sdk: docker app_port: 8000 short_description: OpenEnv stellarator design optimization environment --- # Fusion Design Lab Fusion Design Lab is an environment-first [OpenEnv](https://openenv.dev) hackathon project for the `P1` stellarator benchmark. **Live Environment**: [HF Space](https://huggingface.co/spaces/CreativeEngineer/fusion-design-lab) **Training Notebook**: [Repository Notebook (GRPO + HF TRL)](training/notebooks/fusion_design_lab_training.ipynb) ## What It Does An RL environment where agents optimize stellarator fusion reactor designs by adjusting 4 geometric knobs of a low-dimensional boundary family, aiming to **minimize max elongation** while satisfying 3 hard physics constraints: | Constraint | Bound | |---|---| | `aspect_ratio` | ≤ 4.0 | | `average_triangularity` | ≤ -0.5 | | `abs(edge_iota_over_nfp)` | ≥ 0.3 | The environment uses [`constellaration`](https://pypi.org/project/constellaration/) as the live low-fidelity physics verifier (~0.6s) for every in-environment evaluation. The live environment still exposes **26 discrete actions** (4 parameters × 2 directions × 3 magnitudes + restore_best + submit), and `submit` remains an explicit terminal action on that same reward surface rather than a separate high-fidelity mode. ## Architecture - **Environment server** (`server/`): FastAPI app with `/reset`, `/step`, `/health`, `/task` endpoints - **Physics engine** (`server/physics.py`): `constellaration` VMEC-backed boundary