{"data":{"kind":"file","path":"README.md","version_id":"w6vdajg6pgmyr58xhj98omkd","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":2386,"modified_at":"2026-09-12T01:57:12.891000","content_hash":"ce8cd49050b3e1994678dd96d6cfbf371f3eb3477ade04df17ba581b4092975d"},"entries":[],"content":"# CUDA Kernel Optimization V1\n\nAgentForge-Bench reinforcement-learning environment for long-horizon CUDA kernel optimization.\n\n## Objective\n\nThe agent must optimize a CUDA kernel while preserving correctness and improving measured performance.\n\n## Horizon\n\nThe task contains 20 logical stages.\n\nThe logical stages are not a fixed number of agent actions.\n\nAn episode may require additional actions for:\n\n- inspection\n- diagnosis\n- compilation\n- correctness checks\n- benchmarking\n- analysis\n- recovery\n- re-validation\n\n## Canonical Workflow\n\n1. Inspect\n2. Identify optimization target\n3. Inspect implementation\n4. Modify candidate\n5. Compile\n6. Check correctness\n7. Benchmark\n8. Analyze results\n9. Modify again\n10. Compile\n11. Check correctness\n12. Benchmark\n13. Analyze\n14. Detect regression\n15. Recover\n16. Re-validate correctness\n17. Benchmark again\n18. Confirm performance\n19. Prepare final candidate\n20. Final verification\n\n## Reward\n\nReward components include:\n\n- progress\n- milestones\n- recovery\n- correctness\n- performance\n- efficiency\n- final success\n\nFinal success is intentionally dominant.\n\n## Evaluation\n\nThe environment separates scenario categories:\n\n- train\n- eval\n- hidden\n\nThe hidden scenario is not intended to be exposed to training logic.\n\n## Current Implementation Status\n\nThis first implementation establishes the Prime V1 taskset and the benchmark contracts.\n\nThe actual CUDA compilation, runtime benchmarking, randomized correctness testing, and sandboxed kernel execution are added only after the taskset contract passes baseline validation.\n\nThis prevents CUDA infrastructure failures from being confused with task-design failures.\n\n## Execution Reporting and Gymnasium\n\nTask 001 exposes a runtime execution reporting layer through\n`EpisodeReporter` and `AgentEpisodeReport`.\n\nReports capture:\n\n- task and scenario identity\n- seed and episode identity\n- action trajectory\n- logical stages reached\n- rewards\n- failures\n- decisions\n- recovery events\n- wall-clock execution time\n- input/output/total token usage\n- derived efficiency metrics\n- verifier result\n- oracle result\n- final success status\n\nGymnasium integration is provided through\n`CudaKernelOptimizationGymEnv`.\n\nThe Gymnasium adapter is intentionally separate from the native\nAgentForge environment so the AgentForge environment remains the\nsource of truth for state transitions and reward semantics.\n","encoding":"utf-8","truncated":false,"total_bytes":2386},"status":null}