Skip to content

Preserve concurrent judge results across modes - #223

Open
GoldArowana wants to merge 2 commits into
google-research:mainfrom
GoldArowana:fix/serialize-selected-judge-cache
Open

GoldArowana wants to merge 2 commits into
google-research:mainfrom
GoldArowana:fix/serialize-selected-judge-cache

Conversation

@GoldArowana

Copy link
Copy Markdown
Contributor

Running harness2-judge in parallel and sequential modes can produce two successful commands but leave only one mode in judged.json. Each command reads the old cache before writing its new result. A failed write can also leave an incomplete cache and require rejudging work that already finished.

Hold a short sidecar lock while loading, merging, and publishing selected judge results. Serialize to a temporary sibling file, then atomically replace the cache so readers can keep using the last complete result while a write is in progress. Scoring happens before the lock, and the existing per-selection merge rules and JSON format still apply.

Validation on Python 3.12.14

  • An offline two-process CLI fixture returned exit code 0 from both base commands but persisted only the last writer. The same fixture retained both rows on this commit.
  • An injected I/O failure preserved the previous cache and released the lock. Serial invocation, file permissions, and retry were also checked.
  • python -m unittest discover -s tests -v passed all 74 tests. Scoped Ruff lint/format and git diff --check passed. Independent review and reruns covered the final commit.

Prepared with OpenAI Codex. Validation used offline local scores, with no model or provider calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant