MCPcopy Create free account
hub / github.com/NVIDIA/SOL-ExecBench / _load_evil_sample

Function _load_evil_sample

tests/sol_execbench/test_e2e.py:148–154  ·  view source on GitHub ↗

Load evil solution with kernel content inlined from the sample directory.

(sample: str)

Source from the content-addressed store, hash-verified

146
147
148def _load_evil_sample(sample: str) -> Solution:
149 """Load evil solution with kernel content inlined from the sample directory."""
150 sample_dir = _SAMPLES_DIR / sample
151 sol_dict = json.loads((sample_dir / "solution.json").read_text())
152 kernel_content = (sample_dir / "kernel.py").read_text()
153 sol_dict["sources"] = [{"path": "kernel.py", "content": kernel_content}]
154 return Solution(**sol_dict)
155
156
157def _run_subprocess(cmd: list[str], cwd: Path) -> subprocess.CompletedProcess:

Callers 1

test_reward_hack_e2eFunction · 0.85

Calls 1

SolutionClass · 0.90

Tested by

no test coverage detected