OriGent: Post-Training Hardware Engineering Agents through Scalable Environment Synthesis

Fan Cui, Kexing Zhou, Youwei ZhuoarXiv 2026

TL;DR

While AI coding agents are getting remarkably good at fixing software bugs, hardware engineering has lagged behind because chip designs require complex, finicky simulation environments that are scarce in public datasets. OriGent bridges this gap by automatically turning historical pull requests from public hardware repositories into over 18,000 playable, verified "training gyms." Using these synthesized environments to train an open-weight model via supervised fine-tuning and reinforcement learning boosts its bug-fixing rate by 33.4 percentage points, closing over half the gap to giant proprietary frontier models.

What Problem Does This Paper Address?

Imagine writing code that compiles cleanly without a single warning, only to watch the system fail because a digital handshake fired one clock cycle too late. Welcome to hardware engineering. Fixing a single bug often requires touching circuit descriptions—known as Register-Transfer Level (RTL) code—alongside build scripts and verification harnesses, all checked via cycle-accurate simulators and Electronic Design Automation (EDA) tools.

To teach AI agents how to navigate this world, they need interactive, executable environments where they can edit code, run simulations, inspect waveforms or logs, and try again. In standard software, researchers build these gyms from GitHub issues and existing unit tests. Hardware breaks that playbook in three ways:

  1. Extreme data scarcity: Hardware languages like Verilog and SystemVerilog make up just ~0.10% of public code datasets.
  2. Fragile toolchains: Old commits rarely build out-of-the-box because projects rely on tightly coupled eras of simulators, compilers, and libraries.
  3. Missing tests and leaky descriptions: Over half of substantive hardware pull requests (PRs) don't modify test files, and raw PR descriptions either leave out crucial interface specs or accidentally spoil the exact fix.

Methods

OriGent tackles both environment creation and agent training through a two-part pipeline:

Figure 2: Environment synthesis in OriGent. (a) Merged pull requests from hardware repositories are screened to select candidate changes, each providing a base state and a reference repair. (b) Us- ing reusable toolchain environments, construction agents restore repository states and validate tests before generating problem statements aligned with the tested behavior. The resulting executable tasks feed post-training (Figure 4).

1. Scalable Environment Synthesis: Instead of building a Docker container from scratch for every single commit, OriGent separates multi-era toolchain profiles from per-task setup. A "profile agent" inspects a repository to build reusable base images for distinct historical eras of its build stack. Then, for each merged PR, a "task agent" restores the pre-fix code (stripping .git history so future agents can't peek at the answer) and writes two test suites: target tests (which must fail before the fix and pass after) and regression tests (which must pass on both). Finally, a generation agent drafts a clean problem statement, and an independent review agent cross-checks it to ensure no implementation spoilers leaked through—revising 51.7% of drafts in the process.

2. Two-Stage Agent Post-Training: Starting from the open-weight Mixture-of-Experts (MoE) model Qwen3.6-35B-A3B, the authors train inside the OpenCode agent harness:

  • Long-Context Supervised Fine-Tuning (SFT): Trained on verified bug-fixing trajectories from a teacher model (DeepSeek-V4.1 Flash). Crucially, they mask out malformed tool calls and rambling loops, except when a turn triggers a compiler or simulation error—leaving those unmasked so the model learns how to diagnose and recover from failures.
  • Online Reinforcement Learning (RL): Using Group Relative Policy Optimization (GRPO) with binary pass/fail test rewards. Because hardware debugging easily blows past a 256K-token context window, the agent periodically summarizes its progress ("context compaction") and keeps working. OriGent directly supervises these summaries under the final episode reward, while freezing MoE routers and replaying token routing to keep multi-hour training runs numerically stable.

Datasets

  • OriGent Synthesis Pool (New): 18,257 executable tasks across 90 public repositories spanning EDA software (36.4%), firmware/embedded (32.6%), RTL design (11.4%), simulation/verification (10.7%), and hardware DSLs (9.0%). These patches are hefty—modifying a median of 133 lines across four files, roughly twice the patch size of comparable software benchmarks. From this pool, the authors open-source 11,024 sanitized tasks (8,861 for SFT, and 2,163 difficulty-screened tasks from disjoint repos for RL).
  • HWE-Bench v1.1 (Evaluation): An existing benchmark of 417 real-world hardware bug-repair tasks across six completely held-out repositories (Ibex, CVA6, Caliptra, Rocket Chip, XiangShan, and OpenTitan).
Figure 3: Dataset overview. (a) Tasks by repository area; each tile is one of the 90 repositories, sized by its task count. (b) Reference patch sizes (added plus deleted lines) on a log scale; the shaded band marks the interquartile range.

Key Insights and Ideas

  • SFT teaches the tools; RL teaches grit: The base model frequently gives up after an initial edit or failed build (averaging just 24.5 turns). SFT teaches repository-specific build and simulation habits, expanding interaction depth fivefold. Online RL then nearly doubles interaction turns again (to 222.4 mean turns) and triples context compactions, driving deep fault-localization across coupled System-on-Chip (SoC) modules.
  • Context compaction isn't an edge case—it's survival: On hard hardware tasks, agents routinely hit context limits multiple times per episode (averaging 2.71 compactions per task in RL). Treating intermediate progress summaries as first-class actions supervised by task rewards allows agents to debug across hundreds of turns without losing their train of thought.
  • Synthesized tests don't force memorization: Passing solver patches on the SFT set reuse a median of just 11.7% of the reference patch's added lines, proving the synthesized behavioral tests genuinely check what the circuit or tool does rather than forcing a carbon copy of the original author's code.

Key Results

On HWE-Bench v1.1, post-training transforms Qwen3.6-35B-A3B:

  • Base model: 40.8% resolve rate.
  • OriGent-SFT: 66.8% (+26.0 percentage points), lifting performance across every single repository.
  • OriGent-RL: 74.2% (+33.4 points overall), concentrating its biggest gains over SFT on sprawling processor and SoC codebases like OpenTitan (+9.8 points), Ibex (+6.6), XiangShan (+5.6), and Rocket Chip (+5.2).
Figure 1: HWE-Bench v1.1 performance. Overall resolve rates on 417 tasks. Error bars on OriGent-SFT and OriGent-RL show the min–max range across three independent evaluation runs.

This closes more than half the gap between the 35B-total-parameter (3B active) base model and top proprietary frontier systems (which score 90.4%–99.0%).

Limitations and Future Work

  • Compute burn on failed tasks: Because RL optimizes purely for passing tests without a length penalty, the agent gets very stubborn. While solved tasks average 142.7K output tokens, unsolved tasks balloon to a mean of 297.6K tokens—often grinding away until they hit the 6-hour wall-clock timeout.
  • Simulation-only scope: During candidate screening, changes requiring physical hardware (such as FPGAs or lab boards) to verify were explicitly excluded, restricting the pipeline to software-simulatable behavior.
  • Deferred ecosystems: Massive outliers like the Zephyr embedded OS were deferred during repository selection so a single project wouldn't dominate the training distribution.

Summary updated

BibTeX
@misc{cui2026origent,
  author = {Fan Cui and Kexing Zhou and Youwei Zhuo},
  title = {{OriGent: Post-Training Hardware Engineering Agents through Scalable Environment Synthesis}},
  year = {2026},
  eprint = {2611.38637},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.38637},
}
Figure