dsh-eval-guard 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/assets/neural-cpp/workspace.zip +0 -0
- package/eval/neural-cpp.py +13 -4
- package/lib/index.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
- 3 个长时单任务:Commit0 单库实现、SWE-Bench Pro 单任务、FeatureBench 单 feature。
|
|
35
35
|
- 1 个纯 C++ 项目:Neural-CPP 张量运算与反向传播后端。
|
|
36
36
|
|
|
37
|
-
Neural-CPP
|
|
37
|
+
Neural-CPP 安装时自动把 workspace.zip 解压到工作区根目录,并在完成后移除 setup.sh;agent 从根目录的 CMakeLists.txt 开始。工作区只包含 TASK.md、CMakeLists.txt 和 include/nn/nn.hpp;实现在 src/ 中从零完成,纯 C++17,无 Python/OpenCL/第三方库。
|
|
38
|
+
|
|
39
|
+
评测器同时兼容旧安装留下的嵌套布局:若根目录没有 CMakeLists.txt,会自动改用 workspace/CMakeLists.txt,避免已经产出的工作区无法评测。
|
|
38
40
|
|
|
39
41
|
评测时在临时目录独立构建,然后从 assets/neural-cpp/hidden/ 注入 C++ 测试源码;测试数据由固定种子在进程内生成,不依赖或复制外部数据文件。
|
|
40
42
|
|
|
Binary file
|
package/eval/neural-cpp.py
CHANGED
|
@@ -36,7 +36,16 @@ def main() -> int:
|
|
|
36
36
|
root = Path(td)
|
|
37
37
|
candidate = root / 'candidate'
|
|
38
38
|
clean_copy(workspace, candidate)
|
|
39
|
-
|
|
39
|
+
# The first task installation copied workspace.zip into the session
|
|
40
|
+
# root; some agents extracted it into workspace/ instead of the root.
|
|
41
|
+
# Accept both layouts so already-produced workspaces remain evaluable.
|
|
42
|
+
source = candidate
|
|
43
|
+
if not (source / 'CMakeLists.txt').is_file() and (candidate / 'workspace' / 'CMakeLists.txt').is_file():
|
|
44
|
+
source = candidate / 'workspace'
|
|
45
|
+
if not (source / 'CMakeLists.txt').is_file():
|
|
46
|
+
return fail({'task': 'neural-cpp', 'ok': False, 'error': 'CMakeLists.txt missing',
|
|
47
|
+
'output': 'Expected CMakeLists.txt at workspace root or workspace/CMakeLists.txt'})
|
|
48
|
+
build = source / 'build'
|
|
40
49
|
if build.exists():
|
|
41
50
|
shutil.rmtree(build, ignore_errors=True)
|
|
42
51
|
build.mkdir()
|
|
@@ -46,11 +55,11 @@ def main() -> int:
|
|
|
46
55
|
if cmake is None or compiler is None:
|
|
47
56
|
return fail({'task': 'neural-cpp', 'ok': False, 'error': 'cmake/g++ not available'})
|
|
48
57
|
|
|
49
|
-
cfg = run([cmake, '-S', '.', '-B', 'build', '-DCMAKE_BUILD_TYPE=Release'],
|
|
58
|
+
cfg = run([cmake, '-S', '.', '-B', 'build', '-DCMAKE_BUILD_TYPE=Release'], source, 180)
|
|
50
59
|
if cfg.returncode != 0:
|
|
51
60
|
return fail({'task': 'neural-cpp', 'ok': False, 'error': 'cmake configure failed',
|
|
52
61
|
'output': (cfg.stdout + cfg.stderr)[-5000:]})
|
|
53
|
-
bld = run([cmake, '--build', 'build', '-j4'],
|
|
62
|
+
bld = run([cmake, '--build', 'build', '-j4'], source, 1800)
|
|
54
63
|
if bld.returncode != 0:
|
|
55
64
|
return fail({'task': 'neural-cpp', 'ok': False, 'error': 'build failed',
|
|
56
65
|
'output': (bld.stdout + bld.stderr)[-5000:]})
|
|
@@ -60,7 +69,7 @@ def main() -> int:
|
|
|
60
69
|
|
|
61
70
|
exe = root / 'test_neural'
|
|
62
71
|
cc = run([compiler, '-std=c++17', '-O3', '-pthread',
|
|
63
|
-
'-I', str(
|
|
72
|
+
'-I', str(source / 'include'), str(hidden), str(lib),
|
|
64
73
|
'-lm', '-o', str(exe)], root, 300)
|
|
65
74
|
if cc.returncode != 0:
|
|
66
75
|
return fail({'task': 'neural-cpp', 'ok': False, 'error': 'hidden test compile failed',
|
package/lib/index.js
CHANGED
|
@@ -1680,7 +1680,7 @@ const TASKS = [
|
|
|
1680
1680
|
description: "从零实现纯 C++ 张量运算与反向传播后端;隐藏测试统计正确性与速度。",
|
|
1681
1681
|
timeLimitMinutes: 1440,
|
|
1682
1682
|
timeLimitEnabled: false,
|
|
1683
|
-
needsSetup:
|
|
1683
|
+
needsSetup: true
|
|
1684
1684
|
}
|
|
1685
1685
|
];
|
|
1686
1686
|
/** The tank task definition (original prompt; only halftime mechanics removed). */
|
|
@@ -1909,12 +1909,12 @@ const NEURAL_CPP_DEFINITION = {
|
|
|
1909
1909
|
asset: path.join(packageRoot(), "assets", "neural-cpp", "workspace.zip"),
|
|
1910
1910
|
timeLimitMinutes: 1440,
|
|
1911
1911
|
timeLimitEnabled: false,
|
|
1912
|
-
needsSetup:
|
|
1912
|
+
needsSetup: true,
|
|
1913
1913
|
prompt() {
|
|
1914
1914
|
return [
|
|
1915
1915
|
"这是一个纯 C++ 张量运算后端任务:从零实现 DType、Tensor、视图/切片、逐元素与矩阵运算、自动求导和线程池;不提供 Python 或 OpenCL 支持。",
|
|
1916
1916
|
"",
|
|
1917
|
-
"
|
|
1917
|
+
"当前 workspace 已经由安装器准备好:包含 TASK.md、CMakeLists.txt 和 include/nn/nn.hpp。请阅读 TASK.md 和公开头文件,按接口约定实现 src/ 下的静态库,并用 CMake 构建。",
|
|
1918
1918
|
"",
|
|
1919
1919
|
"要求:",
|
|
1920
1920
|
"- 仅使用 Linux + GCC + C++17 标准库;不允许引入第三方依赖;",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-eval-guard",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Evaluation guard for DSH: workspace-only filesystem, no network/subagents, wall-clock limits, and task installation for the meow-ai-arena tank task.",
|
|
6
6
|
"license": "MIT",
|