Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ def test_correctness_only_mode_stops_after_d_review(self):
root = Path(td)
state_dir = root / "state"
store = StateStore(state_dir)
store.init_or_resume(task_id="bounded", task_type=TASK_TYPE)
store.init_or_resume(task_id="bounded")
cfg = OrchestratorConfig(
workdir=state_dir,
repo_root=root,
Expand Down Expand Up @@ -738,7 +738,7 @@ def test_optimize_mode_stops_after_measured_target_and_review(self):
root = Path(td)
state_dir = root / "state"
store = StateStore(state_dir)
store.init_or_resume(task_id="target", task_type=TASK_TYPE)
store.init_or_resume(task_id="target")
cfg = OrchestratorConfig(
workdir=state_dir,
repo_root=root,
Expand Down
4 changes: 2 additions & 2 deletions metainfer/tasks/harness_evolve/tests/test_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
publish_kernels,
)

_DCU_SEED = Path("/root/zth_agent/MetaInfer/metainfer/tasks/"
"dcu_kernel_auto_opt/harness_default")
_DCU_SEED = (Path(__file__).resolve().parents[2]
/ "dcu_kernel_auto_opt" / "harness_default")


def _fake_experiment(tmp_path, *, verdict="PROMOTE", held="PASS"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ def _map_one(
confidence = "low"
elif layer is None:
confidence = "medium"
else:
# Call stack present and the layer was resolved from it.
confidence = "high"

return {
"kernel_name": kernel_name,
Expand Down
3 changes: 2 additions & 1 deletion metainfer/tests/e2e/test_admin_force_kill.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def test_force_release_endpoint_frees_slot(tmp_path: Path) -> None:
assert body["was_held"] is True

# Slot must be gone.
claims = scoreboard.list_claims()
# list_claims() reports every GPU (free or held); only held rows count.
claims = [c for c in scoreboard.list_claims() if c["status"] == "held"]
assert all(not (c["node_id"] == "w0" and c["gpu_idx"] == 0) for c in claims)

# cancel.marker must be present in the job_dir so the worker sees it.
Expand Down
3 changes: 2 additions & 1 deletion metainfer/tests/e2e/test_pp2_contention.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ def run_round(round_idx: int) -> None:
assert len(winners_per_round) == rounds, \
"all rounds must complete (no deadlock)"
# After all rounds done, no slots remain held.
remaining = scoreboard.list_claims()
# list_claims() reports every GPU (free or held); only held rows count.
remaining = [c for c in scoreboard.list_claims() if c["status"] == "held"]
assert remaining == [], f"no slot should remain held, got {remaining}"
5 changes: 3 additions & 2 deletions metainfer/tests/e2e/test_remote_job_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def test_full_remote_job_flow_acquire_release_result(tmp_path: Path) -> None:
def handler(handle: JobHandle, own_node_id: str) -> JobResult:
# While the job is running, the slot must be held.
claims = scoreboard.list_claims()
acquired = [c for c in claims if c["node_id"] == "w0" and c["gpu_idx"] == 0]
acquired = [c for c in claims if c["node_id"] == "w0" and c["gpu_idx"] == 0
and c["status"] == "held"]
captured["acquired_during_run"] = len(acquired) == 1
# Write some stdout so tail-readers can verify
(Path(handle.job_dir) / "stdout.log").write_text("hello e2e\n")
Expand Down Expand Up @@ -69,7 +70,7 @@ def handler(handle: JobHandle, own_node_id: str) -> JobResult:
"GPU slot must be held while job is running"

# Slot must be released after job.
claims_after = scoreboard.list_claims()
claims_after = [c for c in scoreboard.list_claims() if c["status"] == "held"]
assert all(not (c["node_id"] == "w0" and c["gpu_idx"] == 0)
for c in claims_after), "slot must be released"

Expand Down
2 changes: 1 addition & 1 deletion metainfer/tests/e2e/test_worker_crash.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ def test_worker_dead_surfaces_and_slot_reaped(tmp_path: Path) -> None:
assert result.status == "worker_dead", \
f"expected worker_dead, got {result.status}"
# Slot must be released (RemoteJob's finally calls release_gpus).
claims = scoreboard.list_claims()
claims = [c for c in scoreboard.list_claims() if c["status"] == "held"]
assert all(not (c["node_id"] == "w0" and c["gpu_idx"] == 0) for c in claims), \
f"slot leaked: {claims}"