Skip to content

fix(eval): enforce finite scores and scorer identity in PAIBench-G motion runner - #456

Open
kane-vln wants to merge 1 commit into
mainfrom
fix/paibench-g-motion-smoothness-integrity
Open

kane-vln wants to merge 1 commit into
mainfrom
fix/paibench-g-motion-smoothness-integrity

Conversation

@kane-vln

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

Copy link
Copy Markdown
Collaborator

Summary

  • Reject non-finite motion-smoothness scores (NVIDIA/cosmos#362): validate worker scores, resumed shard checkpoints, and merged means with parse_finite_score (rejecting bool, NaN, and ±Inf), parse saved JSON via strict_json_loads (parse_constant rejecting NaN/Infinity/-Infinity), and serialize atomic outputs with allow_nan=False before creating temporary files.
  • Prevent cross-version score mixing and stale bytecode loading (NVIDIA/cosmos#361): upgrade manifest.json (runner_version=3) to a shared ScoringIdentitySpec + Python 3.10-compatible streaming SHA-256 fingerprint covering the effective evaluator_root source tree (including symlink target bytes and any sourceless bytecode), external AMT-S.yaml config and amt-s.pth checkpoint digests, patch files, pyproject.toml / uv.lock / scorer_environment.freeze.txt, exclusion-filtered Git status, and a startup-isolated (-s / PYTHONNOUSERSITE=1) Python environment; redirect per-worker bytecode lookup/writes into a fresh temporary sys.pycache_prefix so pre-existing __pycache__/*.pyc files with matching size/mtime cannot serve stale code.
  • Enforce end-to-end shard provenance and safe output paths: stamp evaluator_digest on every worker checkpoint record, reject --result-file / --output-dir layouts that overlap or alias manifest.json, worker_*.json, input videos, configs, checkpoints, or scorer scripts, and enforce manifest-authoritative paths and live identity verification during write_merged_result (with an explicit verify_live=False path for offline archival inspection).
  • Migration guidance & CPU tests: document -s / PYTHONNOUSERSITE=1 and pre-v3 shard cleanup in README.md and run_with_cosmos_framework.ipynb, and add pure-CPU spawn + unittest/pytest regressions covering Python 3.10 and Python 3.12.

Closes NVIDIA/cosmos#361
Closes NVIDIA/cosmos#362

Verification

  • python3.10 -s -m unittest discover -s .agents/skills/evaluation/cosmos3/generator/paibench_g/tests -p '*_test.py' -v
  • python3 -s -m unittest discover -s .agents/skills/evaluation/cosmos3/generator/paibench_g/tests -p '*_test.py' -v
  • PYTHONNOUSERSITE=1 python3 -s -m pytest --noconftest -c /dev/null -v .agents/skills/evaluation/cosmos3/generator/paibench_g/tests/run_motion_smoothness_sharded_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.

The runner still uses the same AMT-S scoring call. The notebook sets the required Python startup isolation, and the README explains how to migrate old shards. All 13 CPU regression tests passed in my review.

…nce in PAIBench-G motion runner

Rejects non-finite (NaN/±Inf) and boolean motion smoothness scores, binds resumed shards and merged outputs to a verified evaluator/config/checkpoint/environment manifest with isolated bytecode caching and user-site startup isolation, and includes ordered Python import search-path and per-path distribution precedence in the evaluator fingerprint so reversed import paths reject stale shard reuse.

Signed-off-by: Kane <153349620+kane-vln@users.noreply.github.com>
@kane-vln
kane-vln force-pushed the fix/paibench-g-motion-smoothness-integrity branch from d5a4cd8 to b4d24c2 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.

PAIBench treats NaN motion scores as completed results PAIBench resume can mix scores from different evaluator versions

2 participants