Skip to content

Fix physics_iq scoring result reuse across tasks and validate staged artifacts - #379

Closed
JIN-strong wants to merge 1 commit into
NVIDIA:mainfrom
JIN-strong:fix/physics-iq-scoring-isolation
Closed

JIN-strong wants to merge 1 commit into
NVIDIA:mainfrom
JIN-strong:fix/physics-iq-scoring-isolation

Conversation

@JIN-strong

Copy link
Copy Markdown

What

The scoring cell defaulted RESULTS_DIR to one shared directory for every task, and the official scorer keys its cached CSV by the input folder's basename — which is staged for both the I2V and V2V sweeps. Scoring V2V after I2V therefore found a complete cached CSV and republished the I2V metrics as the V2V score.

This PR isolates the results per task and hardens the staged artifacts:

  • RESULTS_DIR now defaults to $PHYSICSIQ_OUTPUT_ROOT/scoring/$(basename "$(dirname "$STAGED_DIR")"), so i2v_full, v2v_full, and demo runs each own their scoring cache.
  • The staging helpers (stage_i2v_last120, stage_v2v_omit73, prepare_v2v_conditioning) write through a temp file that is renamed into place only after the frame count probes back as expected, so an interrupted encode can never leave a truncated clip at the final path.
  • An existing artifact is re-staged instead of trusted when it no longer probes as exactly 120 frames (staged clips) or 73 frames (padded conditioning) — previously the frame-count asserts ran only on the create path, so resume reused whatever was on disk.

Why

A truncated clip from a killed run could silently enter V2V conditioning or scoring, and the second task's scoring could silently republish the first task's metrics.

Validation

  • python3 test_run_with_cosmos_framework.py → 8 tests pass. The test extracts the real staging function definitions from the notebook and drives them with fake ffmpeg/ffprobe pairs (frame counts embedded in the file bytes), covering the temp-file write path, valid reuse without a second encode, re-staging of corrupted artifacts for all three producers, and rejection of an unexpected source frame count. No GPU, network, ffmpeg, or venv is needed.
  • Every code cell in the notebook passes compile(), and the bash cells pass bash -n.

… artifacts

The scoring cell defaulted RESULTS_DIR to one shared directory for every task, and the official scorer keys its cached CSV by the input folder's basename — which is "staged" for both the I2V and V2V sweeps. Scoring V2V after I2V therefore found a complete cached CSV and republished the I2V metrics as the V2V score.

Results are now namespaced by the staged folder's parent (i2v_full, v2v_full, or the demo case id), so each task owns its own cache. The staging helpers also write through a temp file that is renamed into place only after the frame count probes back as expected, and an existing artifact is re-staged instead of trusted when it no longer probes as exactly 120 frames (staged clips) or 73 frames (padded conditioning) — a run killed mid-encode previously left a truncated clip that resume would reuse for conditioning or scoring.

test_run_with_cosmos_framework.py extracts the real staging functions from the notebook and drives them with fake ffmpeg/ffprobe pairs: it covers the temp-file write path, valid reuse without a second encode, re-staging of corrupted artifacts for all three producers, and rejection of an unexpected source frame count.

Signed-off-by: JIN-strong <1228766517@qq.com>
@yaoxu-crypto

Copy link
Copy Markdown
Collaborator

@JIN-strong , we have migrated the eval folder to cosmos-framework, please submit your PR here: https://github.com/NVIDIA/cosmos-framework/tree/main/.agents/skills/evaluation/cosmos3/generator/physics_iq

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.

2 participants