{"data":{"kind":"file","path":"README.md","version_id":"w4db50flhut59tj4ke79abps","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":2916,"modified_at":"2026-05-24T16:18:56.298000","content_hash":"4c232b895645961b0612abf7920138d61825e0b523f891dc050998e6760b0096"},"entries":[],"content":"# Math-To-Manim Visual Repair\n\nMath-To-Manim turns short educational text prompts into rendered Manim\nanimations: typed planning artifacts, generated Python scenes, validation\nreports, and MP4/GIF outputs.\n\nThis Prime Intellect environment closes the improvement loop. Instead of\ntraining on abstract coding tasks, it trains models on real Math-To-Manim run\nbundles: the original prompt, scene specification, generated Manim code,\nrender/validation evidence, and review signals. The model's job is to repair or\nimprove the already-working output so future generations become more correct,\nmore readable, and more visually robust.\n\nIn short:\n\n```text\ntext prompt\n  -> Math-To-Manim pipeline\n  -> generated Manim scene\n  -> MP4/GIF output + validation evidence\n  -> Prime RL repair task\n  -> better generated animation code\n```\n\nThe current environment focuses on fast generated-code repair rewards because\nfull video rendering is too slow for every RL rollout. It rewards valid\n`GeneratedCode` JSON, parseable and safe Manim Python, expected scene structure,\npreserved math intent, and static layout improvements that reduce crowded text\nand formulas before expensive render audits.\n\n## Environment\n\n- Hub ID: `harleycooper/math-to-manim`\n- Package: `math-to-manim`\n- Import package: `m2m2_visual_repair`\n- Task: single-turn generated-code repair for text-prompt-to-animation runs\n\nThe model receives an M2M2 prompt, scene spec, current generated code, and\nvalidation/render/review evidence. It must return exactly one\n`<generated_code>...</generated_code>` block containing JSON with at least\n`scene_name` and `code`.\n\nThe default dataset includes a QED/Minkowski layout-repair task from the README\nGIF. Its reward includes static text-crowding checks for long formulas without\n`scale_to_fit_width`, dense text grouping, and excessive fixed-frame overlays.\nFull rendering remains an eval/audit step, not the per-rollout reward.\n\n## Local Use\n\n```bash\nuv pip install -e environments/math_to_manim\nuv run python -c \"from verifiers import load_environment; env = load_environment('math-to-manim'); print(len(env.dataset))\"\nuv run vf-eval math-to-manim -n 2\n```\n\n## Export M2M2 Runs\n\nFrom the Math-To-Manim repo:\n\n```bash\npython -m math_to_manim.cli pi-export-runs \\\n  --runs-dir runs \\\n  --output environments/math_to_manim/m2m2_visual_repair/data/repair_tasks.jsonl\n```\n\n## Publish\n\nRun from an authenticated Prime environment:\n\n```bash\nprime env push --path environments/math_to_manim --name math-to-manim --visibility PUBLIC\n```\n\nInside Codex's workspace sandbox, use the writable-home wrapper:\n\n```bash\nprime-codex env push --path environments/math_to_manim --name math-to-manim --visibility PUBLIC\n```\n\n## Training Templates\n\nConfig snippets are bundled under `m2m2_visual_repair/configs/`.\n\n- Smoke: `Qwen/Qwen3.5-0.8B`\n- Practical repair: `Qwen/Qwen3-30B-A3B-Instruct-2507`\n- Follow-up: `Qwen/Qwen3.5-397B-A17B`\n","encoding":"utf-8","truncated":false,"total_bytes":2916},"status":null}