From e7e99db739babb06a213914890d9325695006ab8 Mon Sep 17 00:00:00 2001 From: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> Date: Sun, 1 Nov 2026 21:13:00 +0530 Subject: [PATCH 1/3] fix(benchmark): qualify non-finite native feedback source Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- benchmark/edgebench/source-default.json | 2 +- benchmark/tests/test_checkpoint_judge.py | 71 ++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/benchmark/edgebench/source-default.json b/benchmark/edgebench/source-default.json index 8aee0f341a..10a9bd1eae 100644 --- a/benchmark/edgebench/source-default.json +++ b/benchmark/edgebench/source-default.json @@ -1,6 +1,6 @@ { "repository": "https://github.com/huangruiteng/EdgeBench.git", - "ref": "e278cda3f4d2da3cf06aabf2df4daa99b9749501", + "ref": "2e29d24f44fece91dc240fc5459d17cad19c5fcd", "compatibility_patch": { "id": "nonfinite-checkpoint-v2", "relative_path": "compatibility/nonfinite-checkpoint-v2.patch", diff --git a/benchmark/tests/test_checkpoint_judge.py b/benchmark/tests/test_checkpoint_judge.py index 3025d6f1ca..7fcb0edae4 100644 --- a/benchmark/tests/test_checkpoint_judge.py +++ b/benchmark/tests/test_checkpoint_judge.py @@ -39,6 +39,77 @@ def test_disabled_extension_preserves_the_native_route_surface(native_config): second.state.judge.close() +@pytest.mark.parametrize("score,wire_score", [ + (float("inf"), "Infinity"), (float("-inf"), "-Infinity"), + (float("nan"), "NaN"), (0.0, 0.0), (None, None), +]) +def test_ordinary_feedback_keeps_failure_zero_and_missing_scores_distinct( + native_config, monkeypatch, score, wire_score): + import requests + from benchmark.edgebench.checkpoint_judge import create_app + from benchmark.edgebench.source import active_source_receipt + from benchmark.tests.test_checkpoint_controller import server + from sforge.harness.feedback_transport import JOURNAL_FILE, payload_sha256 + + active_source_receipt() + # Exercise ordinary solver feedback, not the checkpoint-only JSON codec. + # A broken proxy cannot explain an in-process Judge serialization failure. + monkeypatch.setenv("HTTP_PROXY", "http://127.0.0.1:1") + monkeypatch.setenv("HTTPS_PROXY", "http://127.0.0.1:1") + app = create_app(native_config) + state = app.state.judge + try: + with server(app) as url, requests.Session() as client: + client.trust_env = False + token = state.register_session( + "fixture", "source", max_agent_submissions=3, submission_cooldown=3600) + state.consume_round(token) + report = {"score": score, "pass_rate": .5, "valid": False, + "metrics": {"nested": [score, 0.0, None]}} + state._record_submission("source", "accepted", "fixture", "agent-1", report, None) + state.submissions["accepted"] = { + "run_id": "source", "task_id": "fixture", "round": "agent-1", + "status": "completed", "report": report, "error": None} + before = state.resolve_token(token) + original = json.dumps(report, sort_keys=True) + relay = before["feedback_relay_id"] + delivered = [] + for operation in ("result/accepted", "history"): + host = client.get(url + "/api/v1/" + operation, + params={"token": token}, timeout=5) + response = client.get(url + "/api/v1/feedback/" + relay + "/" + operation, + timeout=5) + assert host.status_code == response.status_code == 200 + payload = response.json() + json.dumps(payload, allow_nan=False) + delivered.append(payload) + if operation.startswith("result/"): + assert host.json() == payload + assert payload["report"]["score"] == wire_score + assert payload["report"]["metrics"]["nested"] == [wire_score, 0.0, None] + else: + assert host.json()["entries"] == payload["entries"] + assert host.json()["best_score"] == payload["best_score"] + assert payload["entries"][0]["score"] == wire_score + for history in (host.json(), payload): + availability = history["agent_submission_availability"] + assert availability["remaining_submissions"] == 2 + assert 0 < availability["cooldown_remaining_seconds"] <= 3600 + + # Reading feedback must not consume another evaluation or rewrite + # the native numeric state used by ranking and checkpoint capture. + assert state.resolve_token(token) == before + assert json.dumps(state.submissions["accepted"]["report"], sort_keys=True) == original + records = [json.loads(line) for line in ( + native_config.log_dir / "runs/source/fixture" / JOURNAL_FILE + ).read_text().splitlines()] + responses = [row for row in records if row["record_kind"] == "response"] + assert [row["payload_sha256"] for row in responses] == [ + payload_sha256(payload) for payload in delivered] + finally: + state.close() + + def test_capture_retains_consumed_round_history_and_cooldown_without_mutation(native_config): from fastapi.testclient import TestClient from benchmark.edgebench.checkpoint_judge import create_app, ROUTE From b9f697468420e6d4c4ff3c6f0494379d4f097909 Mon Sep 17 00:00:00 2001 From: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> Date: Sun, 1 Nov 2026 21:37:02 +0530 Subject: [PATCH 2/3] fix(benchmark): isolate feedback source from game lifecycle changes Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- benchmark/edgebench/README.md | 6 ++++-- benchmark/edgebench/source-default.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/benchmark/edgebench/README.md b/benchmark/edgebench/README.md index 8086b67f9c..3d75a0430e 100644 --- a/benchmark/edgebench/README.md +++ b/benchmark/edgebench/README.md @@ -24,12 +24,14 @@ never repin an active or historical cohort. For a **new cohort with no explicit source options**, `source-default.json` selects the reviewed integration commit -[`e278cda3f4d2da3cf06aabf2df4daa99b9749501`](https://github.com/huangruiteng/EdgeBench/commit/e278cda3f4d2da3cf06aabf2df4daa99b9749501) +[`2f9f16cfe724aca6efe63d690ac77ca955395748`](https://github.com/huangruiteng/EdgeBench/commit/2f9f16cfe724aca6efe63d690ac77ca955395748) and the versioned [`nonfinite-checkpoint-v2` compatibility patch](compatibility/nonfinite-checkpoint-v2.patch). This LoopX-owned patch fixes the native checkpoint representation of nonfinite released scores and metrics. Native scoring, report values and selection remain -unchanged. Preparation verifies the asset digest and each touched file's exact +unchanged. The upstream revision fixes ordinary HTTP feedback serialization; +checkpoint encoding is a separate boundary and still requires this patch. +Preparation verifies the asset digest and each touched file's exact upstream blob and mode, applies the patch before provider import/installation, and creates a clean, reproducible Git commit with the fetched commit as its parent. The snapshot uses an explicit LoopX compatibility identity and the diff --git a/benchmark/edgebench/source-default.json b/benchmark/edgebench/source-default.json index 10a9bd1eae..6cb5689919 100644 --- a/benchmark/edgebench/source-default.json +++ b/benchmark/edgebench/source-default.json @@ -1,6 +1,6 @@ { "repository": "https://github.com/huangruiteng/EdgeBench.git", - "ref": "2e29d24f44fece91dc240fc5459d17cad19c5fcd", + "ref": "2f9f16cfe724aca6efe63d690ac77ca955395748", "compatibility_patch": { "id": "nonfinite-checkpoint-v2", "relative_path": "compatibility/nonfinite-checkpoint-v2.patch", From 068b5073e4741e50f081cd354daa62f559b5e657 Mon Sep 17 00:00:00 2001 From: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> Date: Sun, 1 Nov 2026 21:56:14 +0530 Subject: [PATCH 3/3] fix(benchmark): retain checkpoint codec with cleanup-safe native provider Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- benchmark/edgebench/README.md | 4 ++-- benchmark/edgebench/source-default.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/edgebench/README.md b/benchmark/edgebench/README.md index 3d75a0430e..551032bacc 100644 --- a/benchmark/edgebench/README.md +++ b/benchmark/edgebench/README.md @@ -23,8 +23,8 @@ before model/container entry. Use a new log directory to adopt a newer source; never repin an active or historical cohort. For a **new cohort with no explicit source options**, `source-default.json` -selects the reviewed integration commit -[`2f9f16cfe724aca6efe63d690ac77ca955395748`](https://github.com/huangruiteng/EdgeBench/commit/2f9f16cfe724aca6efe63d690ac77ca955395748) +selects the reviewed provider commit +[`118f9257d39c71d0805bb5b9cd4eb85d13a1e6d2`](https://github.com/huangruiteng/EdgeBench/commit/118f9257d39c71d0805bb5b9cd4eb85d13a1e6d2) and the versioned [`nonfinite-checkpoint-v2` compatibility patch](compatibility/nonfinite-checkpoint-v2.patch). This LoopX-owned patch fixes the native checkpoint representation of nonfinite diff --git a/benchmark/edgebench/source-default.json b/benchmark/edgebench/source-default.json index 6cb5689919..793b91f255 100644 --- a/benchmark/edgebench/source-default.json +++ b/benchmark/edgebench/source-default.json @@ -1,6 +1,6 @@ { "repository": "https://github.com/huangruiteng/EdgeBench.git", - "ref": "2f9f16cfe724aca6efe63d690ac77ca955395748", + "ref": "118f9257d39c71d0805bb5b9cd4eb85d13a1e6d2", "compatibility_patch": { "id": "nonfinite-checkpoint-v2", "relative_path": "compatibility/nonfinite-checkpoint-v2.patch",