Skip to content

fix(corpus): replace hardcoded .corpus/ paths with VMAF_CORPUS_DIR env var - #122

Closed
lusoris wants to merge 1 commit into
masterfrom
fix/corpus-path-hardcoding
Closed

lusoris wants to merge 1 commit into
masterfrom
fix/corpus-path-hardcoding

Conversation

@lusoris

@lusoris lusoris commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • .gitignore: add .corpus/ so the exclusion is visible to all contributors (was only in .git/info/exclude)
  • ai/scripts/calibrate_nr_threshold.py: _DEFAULT_CORPUS now reads VMAF_CORPUS_DIR env var (falling back to .corpus/netflix), matching the pattern already used by validate_ensemble_seeds.py; adds missing import os
  • tools/vmaf-tune/tests/test_bbb_e2e_v5_bug_cluster.py: BBB corpus path inside the dev-mcp container now reads VMAF_CORPUS_DIR (falling back to /workspace/.corpus/bbb_e2e) instead of a hardcoded prefix

Audit findings (full scan of tracked files)

File Status
ai/scripts/validate_ensemble_seeds.py GOOD — already uses os.environ.get("VMAF_NETFLIX_CORPUS_DIR", ...)
ai/scripts/calibrate_nr_threshold.py FIXED — was _REPO_ROOT / ".corpus" / "netflix" hardcoded
tools/vmaf-tune/tests/test_bbb_e2e_v5_bug_cluster.py FIXED — was /workspace/.corpus/bbb_e2e/... hardcoded
.gitignore FIXED — .corpus/ added (was only in .git/info/execute)
dev/docker-compose.yml, dev/Containerfile narrative/mount refs only, not path resolution — OK
All docs/ADRs/changelog refs narrative only — OK
.corpus/chug/*.sh lives inside .corpus/ itself (gitignored) — not tracked

Test plan

  • VMAF_CORPUS_DIR=/my/corpus python ai/scripts/calibrate_nr_threshold.py --dry-run resolves corpus from env var
  • Unset VMAF_CORPUS_DIR, script falls back to .corpus/netflix as before
  • git check-ignore -v .corpus/ now resolves from .gitignore (not only .git/info/exclude)
  • python -m ruff check ai/scripts/calibrate_nr_threshold.py tools/vmaf-tune/tests/test_bbb_e2e_v5_bug_cluster.py — all checks passed

Deliverables checklist

  • research digest: no digest needed: trivial path-source audit
  • decision matrix: no alternatives: only-one-way fix (env-var pattern already established by validate_ensemble_seeds.py)
  • AGENTS.md invariant note: no rebase-sensitive invariants
  • reproducer: VMAF_CORPUS_DIR=/tmp/fake python ai/scripts/calibrate_nr_threshold.py --dry-run — exits cleanly reading from env
  • changelog fragment: changelog.d/fixed/corpus-path-hardcoding.md
  • rebase-notes.md: no rebase impact: pure path-source hygiene, no logic changes

🤖 Generated with Claude Code

@lusoris
lusoris marked this pull request as draft May 29, 2026 11:50
…v var

Three brittleness fixes:

1. .gitignore: add .corpus/ so the exclusion is repo-visible to all
   contributors, not only locally via .git/info/exclude.
2. ai/scripts/calibrate_nr_threshold.py: _DEFAULT_CORPUS now reads
   VMAF_CORPUS_DIR (falling back to .corpus/netflix), matching the
   pattern already used by validate_ensemble_seeds.py. Added missing
   import os.
3. tools/vmaf-tune/tests/test_bbb_e2e_v5_bug_cluster.py: BBB container
   corpus path now reads VMAF_CORPUS_DIR (falling back to
   /workspace/.corpus/bbb_e2e) instead of a hardcoded prefix.

no rebase impact: path-source hygiene only, no logic changes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lusoris
lusoris force-pushed the fix/corpus-path-hardcoding branch from 611672f to 765be6e Compare May 29, 2026 12:08
lusoris added a commit that referenced this pull request May 29, 2026
…s with env-var overrides (ADR-0792)

Four scripts carried absolute paths valid only on a single developer
machine, breaking every other checkout and CI worktree silently:

- testdata/test_all_backends.sh: VMAF_BIN, VMAF_YUVDIR, VMAF_TESTDATA
- testdata/bench_quick.py:       VMAF_BIN, VMAF_TESTDATA
- testdata/compare_combined.py:  VMAF_TESTDATA
- ai/tests/test_e2e_frame_to_score.py: VMAF_BIN, VMAF_YUVDIR
  (also fixes stale libvmaf/build-cpu path; renamed to core/ in ADR-0700)

Each script falls back to a repo-root-relative default so existing
no-arg invocations from the repo root continue to work unchanged.
Follows the established VMAF_YUVDIR/VMAF_BIN convention from
testdata/benchmark_netflix.py (PR #122) and bench_all.sh.

no rebase impact: testdata-only + AI test; no C-API or public surface change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lusoris

lusoris commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #212 — this branch was an orphan commit carrying the entire repository tree (5,146 files, 867k LOC). PR #212 is a clean reconstruction from master with only the 4 intended files changed (+19/-2 LOC).

@lusoris lusoris closed this May 29, 2026
lusoris added a commit that referenced this pull request May 29, 2026
…rides (ADR-0792)

Four scripts carried absolute paths valid only on a single developer
machine, breaking every other checkout and CI worktree silently:

- testdata/test_all_backends.sh: VMAF_BIN, VMAF_YUVDIR, VMAF_TESTDATA
- testdata/bench_quick.py:       VMAF_BIN, VMAF_TESTDATA
- testdata/compare_combined.py:  VMAF_TESTDATA
- ai/tests/test_e2e_frame_to_score.py: VMAF_BIN, VMAF_YUVDIR
  (also fixes stale libvmaf/build-cpu path; renamed to core/ in ADR-0700)

Each script falls back to a repo-root-relative default so existing
no-arg invocations from the repo root continue to work unchanged.
Follows the established VMAF_YUVDIR/VMAF_BIN convention from
testdata/benchmark_netflix.py (PR #122) and bench_all.sh.

no rebase impact: testdata-only + AI test; no C-API or public surface change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lusoris
lusoris deleted the fix/corpus-path-hardcoding branch June 4, 2026 10:25
lusoris added a commit that referenced this pull request Jun 4, 2026
…s with env-var overrides (ADR-0792) (#686)

Four scripts carried absolute paths valid only on a single developer
machine, breaking every other checkout and CI worktree silently:

- testdata/test_all_backends.sh: VMAF_BIN, VMAF_YUVDIR, VMAF_TESTDATA
- testdata/bench_quick.py:       VMAF_BIN, VMAF_TESTDATA
- testdata/compare_combined.py:  VMAF_TESTDATA
- ai/tests/test_e2e_frame_to_score.py: VMAF_BIN, VMAF_YUVDIR
  (also fixes stale libvmaf/build-cpu path; renamed to core/ in ADR-0700)

Each script falls back to a repo-root-relative default so existing
no-arg invocations from the repo root continue to work unchanged.
Follows the established VMAF_YUVDIR/VMAF_BIN convention from
testdata/benchmark_netflix.py (PR #122) and bench_all.sh.

no rebase impact: testdata-only + AI test; no C-API or public surface change

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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