v2: document test.sh reward-recording fix
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667---language:- enlicense: apache-2.0task_categories:- text-generationsize_categories:- 1K<n<10Ktags:- agent- code- code-contests- harbor- reinforcement-learning- rlvr---
# code-contests-noblock
Harbor-format competitive-programming RL tasks (8,728 tasks) derived from CodeContests.Each task is a Harbor task binary (gzip tar) stored in `tasks.parquet` with columns`path` (str, `<task_id>.tar.gz`) and `task_binary` (binary). Each tar contains`instruction.md`, `task.toml`, `environment/Dockerfile`, and a `tests/` verifier(`test.sh`, `test_state.py`, `test_data.json`).
## v2 (current) — verifier reward-recording fix
> **Resolves a silent reward-distribution bias.** All 8,728 task verifiers are updated;> task content (instructions, environments, tests, test data) is otherwise byte-identical to v1.
The v1 `tests/test.sh` ran pytest under `set -euo pipefail`:
```bashset -euo pipefailpytest --ctrf /logs/verifier/ctrf.json /tests/test_state.py -rA # aborts the script on test failureif [ $? -eq 0 ]; then echo 1 > /logs/verifier/reward.txt; else echo 0 > /logs/verifier/reward.txt; fi```
Under `set -e`, a failing solution makes pytest exit non-zero and the script **dies before`reward.txt` is written**. Harbor then finds the verifier dir (with `ctrf.json`) but no rewardfile and raises `RewardFileNotFoundError`. The net effect:
- Failed solutions (legitimate `reward=0`) **crash instead of recording 0**, so they are dropped from generated trace sets rather than counted.- The surviving reward distribution collapses to a single `1.0` bucket — useless for any config that needs the success/failure signal — and reported mean reward is inflated.
v2 wraps pytest so the script never dies on a test failure and **always** records a reward:
```bashset +epytest --ctrf /logs/verifier/ctrf.json /tests/test_state.py -rAPYTEST_EXIT=$?set -eif [ $PYTEST_EXIT -eq 0 ]; then echo 1 > /logs/verifier/reward.txt; else echo 0 > /logs/verifier/reward.txt; fi```
This matches the correct pattern already used by the Nemotron task verifiers (which had zero`RewardFileNotFoundError`s for exactly this reason).
The buggy original remains resolvable at the [`v1`](https://huggingface.co/datasets/DCAgent/code-contests-noblock/tree/v1) tag.
```pythonfrom huggingface_hub import hf_hub_downloadhf_hub_download("DCAgent/code-contests-noblock", "tasks.parquet", repo_type="dataset") # v2 (fixed)hf_hub_download("DCAgent/code-contests-noblock", "tasks.parquet", repo_type="dataset", revision="v1") # original```README.mdAdded+67