Skip to content

fix(eval): bind UniGenBench cached results to a validated run manifest - #457

Open
kane-vln wants to merge 1 commit into
mainfrom
fix/unigenbench-scorer-run-manifest
Open

kane-vln wants to merge 1 commit into
mainfrom
fix/unigenbench-scorer-run-manifest

Conversation

@kane-vln

@kane-vln kane-vln commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Validate inputs and output paths before cache reuse or scoring (NVIDIA/cosmos#363): check --benchmark_prompt_json, --image_folder, judge settings, duplicate sample output keys, and output path aliasing (refusing to overwrite prompt files, image folders/images, or scorer files even with --overwrite) before inspecting --output_score_json or constructing GatewayVLM.
  • Bind run_manifest to exact scored bytes: parse the prompt file once from its hashed bytes (supporting both {"benchmark": [...]} and [...] schemas), hash resolved expected images, and re-verify per-sample image SHA-256 on every batch read and retry so mid-run mutations abort cleanly while closing GatewayVLM in finally after construction.
  • Complete credential-free judge routing & scorer identity: separate query parameters into AsyncOpenAI(..., default_query=...) in GatewayVLM so query-bearing gateway URLs build valid /chat/completions?... request URLs, preserve meaningful path differences (/v1/ vs /v1//) in the canonical endpoint identity, require an explicit non-secret --judge_deployment (wired via UNIGENBENCH_JUDGE_DEPLOYMENT in run_with_cosmos_framework.ipynb) when --gateway_url carries query parameters, and hash ugb_scorer.py, utils.py, rubric constants, and max_retry; strictly validate JSON and stats payloads on cache hits and add --overwrite for intentional recomputation.
  • CPU & mock-transport tests: add pure-CPU unittest/pytest regressions across every identity field, duplicate-row/output-alias guards, and real GatewayVLM + AsyncOpenAI mock HTTP transport verification.

Closes NVIDIA/cosmos#363

Verification

  • python3 -m unittest discover -s .agents/skills/evaluation/cosmos3/generator/unigenbench/tests -p '*_test.py' -v
  • python3 -m pytest --noconftest -c /dev/null -v .agents/skills/evaluation/cosmos3/generator/unigenbench/tests/ugb_scorer_test.py
  • Notebook JSON/schema & Ruff lint checks matching validate-cookbooks.yml

@kane-vln
kane-vln requested a review from lfengad December 4, 2026 10:11
lfengad
lfengad previously approved these changes Dec 5, 2026

@lfengad lfengad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that score aggregation still uses the existing metric functions and that the notebook documents how to recompute a legacy cache. The new input validator accepted all 1,170 rows in the shipped prompt file. The 10 CPU tests passed locally, using the SDK test double for the gateway check.

…t and breakdown

Binds cached score files to a validated run manifest (prompt and image SHA-256 digests, credential-free judge identity, and scorer/rubric digests), rejects empty testpoint rows consistently at input resolution and cache reuse, and validates every cached breakdown entry, success_count, and recomputed totals/accuracy before reuse.

Signed-off-by: Kane <153349620+kane-vln@users.noreply.github.com>
@kane-vln
kane-vln force-pushed the fix/unigenbench-scorer-run-manifest branch from 5867a89 to 4b41772 Compare December 6, 2026 07:53

This branch has not been deployed

No deployments
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.

UniGenBench silently reuses stale results for different inputs

2 participants