seedfall

seedfall-gym: RL environments for crash bugs and cluster operations

Fix the storage code or run the cluster, get rewarded by seeds you never see

November 2026 · Kunal Roy Choudhury

Abstract. Each task hands an agent a small Go system that loses acknowledged writes or breaks consistency when it crashes. The agent edits the code, and the reward is the share of hidden fault seeds the fixed system survives, replayed through seedfall. Because a seed replays byte for byte, anyone can recompute a reward from the submission. Every one of the 42 tasks is validated the same way: the reference fix scores 1.0, the buggy code scores below 0.5, a scripted cheat scores 0, and doing nothing gives exactly the buggy score. A second environment asks a model to plan a rolling upgrade of a raft cluster without breaking availability. Training Qwen3-1.7B on it with GRPO took three runs: one learned little, one found a hole in the grader, and the third, on the fixed grader, went from 0.06 to 0.70 against a scripted oracle at 0.79.

Index terms. reinforcement learning environments, GRPO, reward hacking, automated program repair, fault injection, crash consistency.

git clone https://github.com/kunalgoesbyken/seedfall && cd seedfall/gym

The task

The agent gets a workspace with the buggy server, a symptom written the way a user would report it, and one tool that matters: run_seeds, which runs up to four visible seeds and returns pass or fail, the reason and the last 20 trace lines. It can't see the hidden seeds, the salt or the guard report. When it submits, the grader builds the workspace for GOOS=wasip1, runs it on 64 hidden seeds and returns the share that pass. Like SWE-bench [1], the reward comes from running the code, not from a judge model.

The agent sends a submission to the grader and gets failures on visible seeds back. The grader replays visible and hidden seeds and runs the checks, and the reward is the share of seeds that pass.
Fig. 1. The agent can run the visible seeds as often as its budget allows. The hidden seeds come from an HMAC of a secret salt, and only they count.

A typical symptom, for kvlog-torn-tail: "Under repeated crashes and restarts, including crashes in the middle of a disk write, a client that stored keys and was told OK later reads some of them back as NONE." It never names the bug class or the fix.

1.00.50task, sorted by buggy reward reference fix, every taskvalidation cutoff aikv-haiku-1-tail: 0.000aikv-sonnet-1-base-unsynced: 0.000aikv-sonnet-3-compact-unsynced: 0.000etcdraft-snapshot-data-unsynced: 0.000etcdraft-wal-unsynced: 0.000httpkv-nofsync-heavy: 0.000kvlog-fsync-error-swallowed: 0.000kvlog-no-reread: 0.000kvlog-sync-wrong-handle: 0.000kvlog-truncate-off-by-one: 0.000ledger-nofsync-heavy: 0.000liveness-redial: 0.000metapage-append-offset-off-by-one: 0.000metapage-meta-unsynced: 0.000symswap-fsync-wrong-dir: 0.000symswap-gen-unsynced: 0.000symswap-no-publish-sync: 0.000httpkv-torn-tail-kept: 0.016liveness-backup-error-ignored: 0.016ledger-torn-tail-kept: 0.031liveness-apply-before-replicate: 0.031liveness-log-unsynced: 0.031kvlog-sync-before-write: 0.062kvlog-rollback-truncates-log: 0.078kvlog-write-error-ignored: 0.078ledger-nofsync: 0.094httpkv-nofsync: 0.125kvlog-ack-before-fsync: 0.141kvlog-fsyncgate: 0.156httpkv-sync-before-write: 0.172kvlog-torn-tail: 0.172liveness-dedupe: 0.203aikv-opus-1-fsync-error-ignored: 0.250ledger-sync-before-write: 0.266kvlog-no-dir-sync: 0.281httpkv-no-dir-sync: 0.297raftkv-log-unsynced: 0.312kvlog-no-checksum: 0.344symswap-dir-fsync: 0.344symswap-gc-before-publish: 0.359metapage-single-meta-slot: 0.391liveness-applied-not-recovered: 0.438
Fig. 2. Reward of the buggy code on each of the 42 tasks, from gym/validation.json. 17 tasks score 0 (five of them because the progress guard trips on a server that never recovers), none reaches the 0.5 cutoff, and the reference fix scores 1.0 on all of them, so the reward separates a fix from no fix on every task.

Keeping the reward honest

An RL reward is only useful if the cheapest way to raise it is to fix the bug [3]. Every grade goes through four guards:

A task only ships if it passes all four validation rules:

Table 1. Validation rules, checked on every task.
SubmissionRequired rewardWhy
Reference fixexactly 1.0The task is solvable, and a perfect fix gets full marks.
Buggy codebelow 0.5The seeds actually hit the bug.
Scripted cheat0Rejecting every write, forging reads or refusing writes after a restart can't pass.
No changesame hash as buggyThe grade is deterministic.

Where the tasks come from

Tasks 13 to 42 were made the way SWE-smith makes its tasks [2]: take a seedfall example that's correct, then break exactly one durability mechanism by hand. That means a dropped or misdirected fsync, a missing directory fsync, an ignored I/O error, a step in the wrong order or an offset off by one. Four tasks use key-value stores that Claude models wrote from one prompt, so some of the bugs are bugs a model actually made.

17 candidates didn't make it, and the reasons are listed in the README. Some were reward hacks, where deleting an assertion scored 1.0. Others had a crash window of one disk operation, so the buggy code passed nearly every seed, or a Raft library that wasn't deterministic run to run.

The split is 31 train and 11 held-out tasks. Tasks are grouped by system and bug class, and no group straddles the split, so the held-out set tests bugs the agent hasn't trained on.

Baselines

Two episodes per task on 12 tasks, graded on 64 hidden seeds. Everything ran on free tiers except Haiku, which cost $0.076 in total.

  1. 1claude-haiku-5-51.000
  2. 2reference fix1.000
  3. 3gemini-3.1-flash-lite0.864
  4. 4gemini-3.5-flash-lite0.807
  5. 5no change0.132
Fig. 3. Mean reward on 12 tasks. 24 episodes per model row. The runs were re-graded on the fixed grader on 2026-11-17, with the public dev salt instead of the original secret one.

Haiku solved all 24 episodes in about five turns each, so with this prompt the set doesn't separate strong agents yet. Haiku also found a stricter fix than my reference on kvlog-no-checksum, which is how I found out the reference solution was wrong. The flash-lite models struggled on the same three tasks: fsyncgate, the missing checksum and a model-written store.

Training on the operator environment

The gym has a second, smaller environment built on seedfall's operator mode. A model reads a raft cluster with some nodes on an old version and writes a JSON plan of set_args and restart actions. The reward is the share of 16 hidden fault seeds on which the replayed plan rolls every node by the deadline, keeps client availability above the SLO in every one-second window and stays linearizable. I trained Qwen3-1.7B on it with GRPO [4] and LoRA on Kaggle's free T4. It took three runs.

Run 1 raised the mean reward, but none of its plans passed every seed any more, and with no validation split and only eight seeds I couldn't say what it had learned. Run 2 added a validation split, sixteen seeds and a penalty for touching up-to-date nodes, and the test reward rose from 0.545 to 0.682. Then I read the plans. All 112 restarted the stale nodes together at exactly the deadline. The clients stopped measuring at the deadline and the grader checked the versions with nobody watching, so an outage there was free. The model had found a hole in my grader and made it its whole strategy, which is the textbook reward hack [3].

The fix measures availability through a grace period after the deadline, fails empty windows, forbids actions in the unmeasured first second and requires the exact node arguments. The same holes were closed in the public example. Run 3 trained on the fixed grader for 120 steps.

  1. 1oracle rolling restart0.786
  2. 2GRPO model, run 30.703
  3. 3stale nodes together0.545
  4. 4stale nodes at the deadline0.496
  5. 5every node together0.107
  6. 6base model0.058
  7. 7idle0.000
Fig. 4. Mean reward on 28 held-out scenarios, 16 hidden seeds. 4 plans per scenario for the models, scripted plans otherwise.

The trained model now writes a real rolling restart: one stale node at a time, the shortest allowed downtime, nothing near the deadline and nothing on nodes already up to date. It beats restarting the stale nodes together by 0.158 (paired bootstrap 95% CI 0.075 to 0.244) and the deadline restart by 0.207. It stays 0.083 below the oracle, because it always starts at 1000ms, the earliest the prompt allows, and most of its failures are the SLO in that first measured window. The oracle waits until 1500ms. The base model's 0.058 is low mostly because 41% of its plans break a rule in the prompt. The code, all three runs and the per-plan samples are in gym/rl.

Limits

References

  1. C. E. Jimenez et al. SWE-bench: Can Language Models Resolve Real-World GitHub Issues? ICLR 2024.
  2. J. Yang et al. SWE-smith: Scaling Data for Software Engineering Agents. 2025.
  3. J. Skalse et al. Defining and Characterizing Reward Hacking. NeurIPS 2022.
  4. Z. Shao et al. DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models. 2024.

Code · seedfall · Docs