exp_rpt_nemotron-junit-v2
收藏资源简介:
Nemotron JUnit — Verifier-Fixed (v2) 是一个修复版本的数据集,旨在解决原始数据集 `DCAgent/exp_rpt_nemotron-junit` 中验证脚本存在的严重缺陷。原验证脚本 `tests/test.sh` 因管道屏蔽、JUnit零测试判定为成功以及退出陷阱默认值三个复合错误,导致即使在未对工作区进行任何修改(如缺少 `pom.xml` 文件)的情况下,也会错误地返回奖励值1.0。本修复版本遵循了 `laion/exp_rpt_nemotron-cpp-v2` 的模式,实施了多项关键改进:预先设置默认奖励为0(失败),仅当验证通过时才覆盖为1;强制要求存在 `pom.xml` 文件;直接运行 `mvn test` 并捕获其真实退出码,避免输出管道干扰;在Maven输出中验证实际运行的测试数量(N>0),以防止零测试通过的情况;新增了 `tests/test_state.py` 脚本,通过 `pytest` 来断言奖励文件内容,并生成可解析的通过率输出。数据集包含5,000个样本,每个样本由两列数据构成:`path`(字符串类型)和 `task_binary`(经过gzip压缩的tar字节流)。每个任务包内包含定义任务所需的完整文件集:`task.toml`(任务配置)、`instruction.md`(任务说明)、`metadata.json`(元数据)、`tests/test.sh`(测试脚本)、`tests/test_state.py`(新增的Python验证脚本)、`tests/TestSolution.java`(测试用例)以及 `environment/Dockerfile`(环境定义)。所有任务共享一个统一的基础Docker镜像快照,该镜像基于 `eclipse-temurin:17-jdk`,并预装了Maven和Python3的pytest包。该数据集主要用于文本生成任务,特别关注Java编程、JUnit测试、软件测试以及强化学习相关的场景,其规模属于1K到10K的中等范围。
Nemotron JUnit — Verifier-Fixed (v2) is a fixed version dataset aimed at addressing the severe flaws in the verification script of the original dataset `DCAgent/exp_rpt_nemotron-junit`. The original verification script `tests/test.sh` had three compound errors: pipe masking, JUnit zero-test judged as success, and default exit trap value, causing it to incorrectly return a reward of 1.0 even when no modifications were made to the workspace (e.g., missing `pom.xml` file). This fixed version follows the pattern of `laion/exp_rpt_nemotron-cpp-v2` and implements several key improvements: pre-setting the default reward to 0 (failure) and overwriting to 1 only when verification passes; mandating the existence of the `pom.xml` file; directly running `mvn test` and capturing its real exit code to avoid output pipe interference; verifying the number of actually executed tests (N>0) in the Maven output to prevent zero-test passing; adding a new `tests/test_state.py` script that uses `pytest` to assert the reward file content and generate a parseable pass rate output. The dataset contains 5,000 samples, each consisting of two columns: `path` (string type) and `task_binary` (gzip-compressed tar byte stream). Each task package contains the complete set of files needed to define the task: `task.toml` (task configuration), `instruction.md` (task description), `metadata.json` (metadata), `tests/test.sh` (test script), `tests/test_state.py` (new Python verification script), `tests/TestSolution.java` (test cases), and `environment/Dockerfile` (environment definition). All tasks share a unified base Docker image snapshot based on `eclipse-temurin:17-jdk` with pre-installed Maven and Python3s pytest package. The dataset is primarily used for text generation tasks, with a focus on Java programming, JUnit testing, software testing, and reinforcement learning scenarios, and its scale is in the medium range of 1K to 10K.
数据集概述
- 数据集名称: Nemotron JUnit — Verifier-Fixed (v2)
- 语言: 英文 (
en) - 任务类别: 文本生成 (
text-generation) - 标签:
java,junit,testing,rl,verified - 数据规模: 1,000 - 10,000 条 (
1K<n<10K)
背景与改进
该数据集是 DCAgent/exp_rpt_nemotron-junit 的修正版本。原始版本中的 tests/test.sh 验证器存在缺陷,会为未修改的工作空间返回奖励 1.0。具体问题包括:
- 管道掩码:
javac ... | tee未使用set -o pipefail,导致tee的退出码(0)掩盖了javac的失败。 - JUnit 0 测试视为成功: 当
javac失败时,无.class文件生成,JUnit 扫描到 0 个测试后退出码为 0。 - EXIT 陷阱默认奖励 1: 陷阱检查
$?= 0(JUnit 的“成功”),并写入奖励 1。
修正方案(遵循 laion/exp_rpt_nemotron-cpp-v2 模式):
- 默认失败: 预先将
echo 0 > reward.txt写入,仅验证通过后覆盖为 1。 - 要求
pom.xml: 任务指令明确要求提供,缺失则奖励为 0。 - 运行
mvn test: 不使用tee,捕获真实退出码。 - 输出验证: 在 Maven 输出中检查
Tests run: N(N > 0),防止 Maven 在 0 测试时退出码为 0。 - 添加测试: 包含
tests/test_state.py,通过python3 -m pytest断言reward.txt == "1",以生成可解析的pass_ratio。 - Dockerfile: 添加了
python3-pytest。
Docker 验证结果
| 场景 | 奖励 | pytest 输出 |
|---|---|---|
| 空的 /app(无 pom.xml) | 0 | 1 failed → pass_ratio = 0.0 |
| 正确解决方案(mvn test 通过) | 1 | 1 passed → pass_ratio = 1.0 |
原始验证器对同一空工作空间返回奖励 1(通过并排 Docker 测试确认)。
数据结构
- 行数: 5,000
- 列:
path(字符串),task_binary(gzip-tar 字节) - 每个任务包含文件:
task.toml,instruction.md,metadata.json,tests/test.sh,tests/test_state.py,tests/TestSolution.java,environment/Dockerfile - 共享快照:
eclipse-temurin:17-jdk+ maven + python3-pytest




