Building long-horizon SWE environments on Hugging Face: Frontier SWE × OpenEnv
rycerzes
• • 3Error code: StreamingRowsError
Exception: CastError
Message: Couldn't cast
episode_id: int64
reward: double
frozen_scores: struct<S1: double, S2: double, S3: double, S4: double, S5: double>
child 0, S1: double
child 1, S2: double
child 2, S3: double
child 3, S4: double
child 4, S5: double
dense_rewards_used: bool
num_steps: int64
num_subtasks_covered: int64
subtask_reward_range: list<item: double>
child 0, item: double
steps: list<item: struct<mean_logprob: double, action_token_count: int64, total_action_tokens: int64, skipp (... 216 chars omitted)
child 0, item: struct<mean_logprob: double, action_token_count: int64, total_action_tokens: int64, skipped_action_t (... 204 chars omitted)
child 0, mean_logprob: double
child 1, action_token_count: int64
child 2, total_action_tokens: int64
child 3, skipped_action_tokens: int64
child 4, logprob_start_len: int64
child 5, step_index: int64
child 6, message_index: int64
child 7, subtask_id: string
child 8, subtask_reward: double
child 9, phase: string
child 10, pi_hind: double
child 11, rho: double
child 12, q_h: double
child 13, q_h_smoothed: double
pi_hind_mean: double
hyperparams: struct<t_temp: double, gamma: double, c_min: double, c_max: double, alpha: double, smooth: bool, den (... 44 chars omitted)
child 0, t_temp: double
child 1, gamma: double
child 2, c_min: double
child 3, c_max: double
child 4, alpha: double
child 5, smooth: bool
child 6, dense_rewards: bool
child 7, max_logprob_tokens: int64
total_episodes: int64
failed_episodes: int64
successful_episodes: int64
reward_stats: struct<min: double, max: double, mean: double, median: double, top_quartile_min: double, bottom_quar (... 17 chars omitted)
child 0, min: double
child 1, max: double
child 2, mean: double
child 3, median: double
child 4, top_quartile_min: double
child 5, bottom_quartile_max: double
episodes: list<item: struct<episode_id: int64, reward: double, phase: string, turns: int64, elapsed_s: double, (... 31 chars omitted)
child 0, item: struct<episode_id: int64, reward: double, phase: string, turns: int64, elapsed_s: double, has_jsonl: (... 19 chars omitted)
child 0, episode_id: int64
child 1, reward: double
child 2, phase: string
child 3, turns: int64
child 4, elapsed_s: double
child 5, has_jsonl: bool
child 6, error: null
elapsed_s: double
elapsed_min: double
to
{'total_episodes': Value('int64'), 'elapsed_s': Value('float64'), 'elapsed_min': Value('float64'), 'episodes': List({'episode_id': Value('int64'), 'reward': Value('float64'), 'phase': Value('string'), 'turns': Value('int64'), 'elapsed_s': Value('float64'), 'has_jsonl': Value('bool'), 'error': Value('null')}), 'successful_episodes': Value('int64'), 'failed_episodes': Value('int64'), 'reward_stats': {'min': Value('float64'), 'max': Value('float64'), 'mean': Value('float64'), 'median': Value('float64'), 'top_quartile_min': Value('float64'), 'bottom_quartile_max': Value('float64')}}
because column names don't match
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/utils.py", line 99, in get_rows_or_raise
return get_rows(
^^^^^^^^^
File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/src/services/worker/src/worker/utils.py", line 77, in get_rows
rows_plus_one = list(itertools.islice(ds, rows_max_number + 1))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2690, in __iter__
for key, example in ex_iterable:
^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2227, in __iter__
for key, pa_table in self._iter_arrow():
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2251, in _iter_arrow
for key, pa_table in self.ex_iterable._iter_arrow():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 494, in _iter_arrow
for key, pa_table in iterator:
^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 384, in _iter_arrow
for key, pa_table in self.generate_tables_fn(**gen_kwags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 295, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 128, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2281, in table_cast
return cast_table_to_schema(table, schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2227, in cast_table_to_schema
raise CastError(
datasets.table.CastError: Couldn't cast
episode_id: int64
reward: double
frozen_scores: struct<S1: double, S2: double, S3: double, S4: double, S5: double>
child 0, S1: double
child 1, S2: double
child 2, S3: double
child 3, S4: double
child 4, S5: double
dense_rewards_used: bool
num_steps: int64
num_subtasks_covered: int64
subtask_reward_range: list<item: double>
child 0, item: double
steps: list<item: struct<mean_logprob: double, action_token_count: int64, total_action_tokens: int64, skipp (... 216 chars omitted)
child 0, item: struct<mean_logprob: double, action_token_count: int64, total_action_tokens: int64, skipped_action_t (... 204 chars omitted)
child 0, mean_logprob: double
child 1, action_token_count: int64
child 2, total_action_tokens: int64
child 3, skipped_action_tokens: int64
child 4, logprob_start_len: int64
child 5, step_index: int64
child 6, message_index: int64
child 7, subtask_id: string
child 8, subtask_reward: double
child 9, phase: string
child 10, pi_hind: double
child 11, rho: double
child 12, q_h: double
child 13, q_h_smoothed: double
pi_hind_mean: double
hyperparams: struct<t_temp: double, gamma: double, c_min: double, c_max: double, alpha: double, smooth: bool, den (... 44 chars omitted)
child 0, t_temp: double
child 1, gamma: double
child 2, c_min: double
child 3, c_max: double
child 4, alpha: double
child 5, smooth: bool
child 6, dense_rewards: bool
child 7, max_logprob_tokens: int64
total_episodes: int64
failed_episodes: int64
successful_episodes: int64
reward_stats: struct<min: double, max: double, mean: double, median: double, top_quartile_min: double, bottom_quar (... 17 chars omitted)
child 0, min: double
child 1, max: double
child 2, mean: double
child 3, median: double
child 4, top_quartile_min: double
child 5, bottom_quartile_max: double
episodes: list<item: struct<episode_id: int64, reward: double, phase: string, turns: int64, elapsed_s: double, (... 31 chars omitted)
child 0, item: struct<episode_id: int64, reward: double, phase: string, turns: int64, elapsed_s: double, has_jsonl: (... 19 chars omitted)
child 0, episode_id: int64
child 1, reward: double
child 2, phase: string
child 3, turns: int64
child 4, elapsed_s: double
child 5, has_jsonl: bool
child 6, error: null
elapsed_s: double
elapsed_min: double
to
{'total_episodes': Value('int64'), 'elapsed_s': Value('float64'), 'elapsed_min': Value('float64'), 'episodes': List({'episode_id': Value('int64'), 'reward': Value('float64'), 'phase': Value('string'), 'turns': Value('int64'), 'elapsed_s': Value('float64'), 'has_jsonl': Value('bool'), 'error': Value('null')}), 'successful_episodes': Value('int64'), 'failed_episodes': Value('int64'), 'reward_stats': {'min': Value('float64'), 'max': Value('float64'), 'mean': Value('float64'), 'median': Value('float64'), 'top_quartile_min': Value('float64'), 'bottom_quartile_max': Value('float64')}}
because column names don't matchNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
This dataset holds raw episode trajectories for the Frontier SWE (FSWE) postgres task: implement a PostgreSQL wire protocol server that fronts SQLite (see task config in the upstream frontier-swe-openenv repo under frontier_swe_env/tasks/pg.py). This run is referred to as pg-01 in tooling and job names.
Rollouts and agent behavior were produced with Qwen/Qwen3.6-27B (Qwen 3.6 27B). Hindsight scoring (compute_hindsight_scores.py) uses the same family of stack configured for that script (e.g. SGLang /generate for log-probabilities).
collect_trajectories.py — Runs parallel Docker workers, one Frontier SWE episode per episode_NNN/ directory (NNN is zero-padded). After each episode it writes result.json, then pulls pi_session.jsonl from the Pi session path inside the container (docker exec + find + docker cp) and container_logs.txt from docker logs (stdout + stderr).backfill_rewards.py — Batch pass to fill missing episode_reward (and related fields) when episodes ended without a server-side reward.compute_hindsight_scores.py — For each assistant step, builds a hindsight prompt with the final outcome (reward, phase, subtask scores), queries the inference API for log-probs of the original action tokens, and computes HCAPO hindsight Q_H / importance ratios (paper 2603.08754). Writes hindsight_scores.json per episode.trajectories/
episode_000/
result.json
pi_session.jsonl
container_logs.txt
hindsight_scores.json # present after compute_hindsight_scores
episode_001/
...
| File | Role |
|---|---|
result.json |
Episode summary: turns, phase, scores, episode_reward, metadata. |
pi_session.jsonl |
Full Pi agent trace (tool calls, model output). |
container_logs.txt |
Combined container stdout/stderr for debugging / scoring. |
hindsight_scores.json |
Per-step hindsight Q values for HCAPO training (not from collection alone). |