Skip to content

Fix resume mixing evaluator versions in PAIBench motion smoothness (evaluator identity fingerprint) - #375

Open
JIN-strong wants to merge 5 commits into
NVIDIA:mainfrom
JIN-strong:feat/paibench-evaluator-identity
Open

JIN-strong wants to merge 5 commits into
NVIDIA:mainfrom
JIN-strong:feat/paibench-evaluator-identity

Conversation

@JIN-strong

Copy link
Copy Markdown

What

The PAIBench-G motion-smoothness runner (run_motion_smoothness_sharded.py) recorded only evaluator_root (a path) in its resume manifest. After the scorer checkout, its compatibility patches, or the scoring environment change, resuming silently mixed scores computed by different evaluator versions into one aggregated result.

This PR fingerprints the effective evaluator into the resume manifest and hard-fails resume when it changes:

  • build_evaluator_identity() computes an identity from the scorer git HEAD plus a git status --porcelain hash (captures in-place edits and untracked files), content hashes of the checked-in compatibility patches, and the scorer_environment.freeze.txt hash.
  • The manifest gains an evaluator_identity key and RUNNER_VERSION bumps 2 → 3.
  • prepare_manifest() hard-fails with an actionable message when the previous identity differs. Legacy (pre-evaluator_identity) manifests get a dedicated message pointing to a new output directory.
  • Soft degradation: a non-git scorer records status: "unavailable" with a warning, and a missing freeze or patches directory records status: "missing", so resume protection degrades to the previous path+mtime baseline instead of crashing.

Why

Resuming a sharded run after a scorer upgrade could merge scores from the old and new evaluator versions without any signal, producing results that no single evaluator version had actually computed.

Fixes #361.

Validation

  • python -m pytest test_run_motion_smoothness_sharded.py -q in evaluation/cosmos3/generator/paibench_g → 14 passed, covering fingerprint determinism, rejection of changed patches or a changed scorer source, legacy-manifest rejection, and the degradation paths. Git-dependent tests skip cleanly where git is absent.
  • python -m py_compile run_motion_smoothness_sharded.py → clean.
  • grep -n "evaluator-root" run_with_cosmos_framework.ipynb → only the existing --evaluator-root "$PAIBENCH_SCORER_DIR" invocation; no new CLI arguments are required (patches_dir defaults from __file__).
  • No GPU, AMT-S, or scorer checkout was used.

Part of NVIDIA#361. Adds pure helpers to fingerprint the effective scorer source (git HEAD + worktree state), checked-in patches, and the environment freeze, with soft degradation when git or freeze are absent.

Signed-off-by: JIN-strong <[email protected]>
Resume now hard-fails when the effective scorer (git source, applied patches, environment freeze) differs from the manifest, so merged scores can no longer mix evaluator versions. Fixes NVIDIA#361.

Signed-off-by: JIN-strong <[email protected]>
Verifies evaluator identity reports unavailable/missing and resume still works under the degraded baseline, and skips git-dependent tests where git is absent.

Signed-off-by: JIN-strong <[email protected]>
- legacy RUNNER_VERSION=2 manifests now raise a dedicated message ('legacy manifest without evaluator identity') instead of a misleading 'restore the previous evaluator' error, since no identity was recorded and the evaluator itself may be unchanged; the evaluator-identity mismatch path is preserved for when the key exists but differs.
- hash_patches now folds filename and length into the digest so different patch sets cannot collide (e.g. {a:AB,b:C} vs {a:A,b:BC}).
- add a legacy-manifest rejection test and a collision-regression test.
- README: add git status diagnostic hint for unexpected resume failures.

Signed-off-by: JIN-strong <[email protected]>
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.

PAIBench resume can mix scores from different evaluator versions

1 participant