Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ description = "VMAF-specific false positives"
paths = [
'''^subprojects/''',
'''^python/test/resource/''',
# Pre-ADR-0700 layout: YUV fixtures lived at resource/yuv/ before the
# libvmaf/ -> core/ + python/ layout change. Binary YUV byte patterns
# in old commits (e.g. c35b50e4de) trip generic-api-key and
# sourcegraph-access-token as false positives.
'''^resource/yuv/''',
'''^testdata/.*\.(yuv|y4m|mp4|json)$''',
'''^model/.*\.(json|pkl|onnx)$''',
'''^ai/src/vmaf_train/data/manifests/README\.md$''',
Expand Down
2 changes: 1 addition & 1 deletion ai/data/feature_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"motion2",
)

DEFAULT_VMAF_BINARY = Path("libvmaf") / "build-cpu" / "tools" / "vmaf"
DEFAULT_VMAF_BINARY = Path("core") / "build-cpu" / "tools" / "vmaf"

# Full feature set the fork's extractors can produce (per Research-0026,
# extended by ADR-0559 to include SpEED chroma/temporal features).
Expand Down
2 changes: 1 addition & 1 deletion ai/scripts/bvi_dvc_to_full_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ def main(argv: list[str] | None = None) -> int:
ap.add_argument(
"--vmaf-bin",
type=Path,
default=REPO_ROOT / "libvmaf" / "build-cpu" / "tools" / "vmaf",
default=REPO_ROOT / "core" / "build-cpu" / "tools" / "vmaf",
help="Path to the libvmaf CLI binary.",
)
ap.add_argument(
Expand Down
6 changes: 3 additions & 3 deletions ai/scripts/extract_k150k_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ def main() -> int:
ap.add_argument(
"--vmaf-bin",
type=Path,
default=REPO_ROOT / "libvmaf" / "build-cpu" / "tools" / "vmaf",
default=REPO_ROOT / "core" / "build-cpu" / "tools" / "vmaf",
help=(
"Path to the fork vmaf binary (built with ssimulacra2 + motion_v2). "
"Default: core/build-cpu/tools/vmaf. Passing a CUDA-capable binary "
Expand All @@ -1123,7 +1123,7 @@ def main() -> int:
ap.add_argument(
"--cpu-vmaf-bin",
type=Path,
default=REPO_ROOT / "libvmaf" / "build-cpu" / "tools" / "vmaf",
default=REPO_ROOT / "core" / "build-cpu" / "tools" / "vmaf",
help=(
"CPU vmaf binary used for residual CPU-only feature passes when "
"--vmaf-bin points at a CUDA-capable binary. Default: "
Expand Down Expand Up @@ -1234,7 +1234,7 @@ def main() -> int:
print(
f"error: vmaf binary not found: {args.vmaf_bin}\n"
"Build the fork vmaf binary with:\n"
" meson setup core/build-cpu libvmaf -Denable_cuda=false "
" meson setup core/build-cpu core -Denable_cuda=false "
"--buildtype=release && ninja -C core/build-cpu\n"
"Then re-run with --vmaf-bin core/build-cpu/tools/vmaf",
file=sys.stderr,
Expand Down
2 changes: 1 addition & 1 deletion ai/scripts/konvid_to_vmaf_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def main(argv: list[str] | None = None) -> int:
ap.add_argument(
"--vmaf-bin",
type=Path,
default=REPO_ROOT / "libvmaf" / "build-cpu" / "tools" / "vmaf",
default=REPO_ROOT / "core" / "build-cpu" / "tools" / "vmaf",
help="Path to the libvmaf CLI binary.",
)
ap.add_argument(
Expand Down
5 changes: 0 additions & 5 deletions ai/src/aiutils/jsonl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from __future__ import annotations

import json
<<<<<<< HEAD
import math
from pathlib import Path
from typing import Any, Iterator
Expand Down Expand Up @@ -44,10 +43,6 @@ def dumps_jsonl_row(obj: dict, **kwargs: Any) -> str:
sanitised = _sanitize_nonfinite(obj)
kwargs.setdefault("sort_keys", True)
return json.dumps(sanitised, **kwargs) + "\n"
=======
from pathlib import Path
from typing import Iterator
>>>>>>> 24bb5daf89 (docs: post-merge-train sweep — VMAFx + core/ path refs, ADR index, state.md)


def iter_jsonl(path: Path) -> Iterator[tuple[int, dict]]:
Expand Down
2 changes: 1 addition & 1 deletion ai/src/vmaf_train/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

app = typer.Typer(add_completion=False, no_args_is_help=True)
console = Console()
DEFAULT_VMAF_BINARY = Path("libvmaf") / "build-cpu" / "tools" / "vmaf"
DEFAULT_VMAF_BINARY = Path("core") / "build-cpu" / "tools" / "vmaf"


def _write_cli_report_json(
Expand Down
2 changes: 1 addition & 1 deletion ai/src/vmaf_train/data/feature_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _normalize_pixfmt(fmt: str) -> str:
"motion2",
)

DEFAULT_VMAF_BINARY = Path("libvmaf") / "build-cpu" / "tools" / "vmaf"
DEFAULT_VMAF_BINARY = Path("core") / "build-cpu" / "tools" / "vmaf"

# vmaf's CLI takes feature-extractor names (``adm``, ``vif``, ``motion``) while
# the JSON output labels individual metrics (``adm2``, ``vif_scale0``, …).
Expand Down
6 changes: 0 additions & 6 deletions ai/src/vmaf_train/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

import hashlib
import json
<<<<<<< HEAD
import math
=======
>>>>>>> 24bb5daf89 (docs: post-merge-train sweep — VMAFx + core/ path refs, ADR index, state.md)
from dataclasses import asdict, dataclass, field
from pathlib import Path
from typing import Any
Expand Down Expand Up @@ -117,7 +114,6 @@ def register(
def load(sidecar_path: Path) -> ModelMetadata:
doc: dict[str, Any] = json.loads(sidecar_path.read_text())
return ModelMetadata(**doc)
<<<<<<< HEAD


def _sanitize_nonfinite(obj: Any) -> Any:
Expand Down Expand Up @@ -168,5 +164,3 @@ def write_registry_json(path: Path, payload: dict, **kwargs: Any) -> None:
**kwargs: Forwarded to :func:`dumps_registry_json` / :func:`json.dumps`.
"""
path.write_text(dumps_registry_json(payload, **kwargs) + "\n", encoding="utf-8")
=======
>>>>>>> 24bb5daf89 (docs: post-merge-train sweep — VMAFx + core/ path refs, ADR index, state.md)
2 changes: 1 addition & 1 deletion ai/tests/test_chug_extract_features_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _resolve_vmaf_binary() -> Path | None:
return Path(env)
for candidate in (
_REPO_ROOT / "build" / "tools" / "vmaf",
_REPO_ROOT / "libvmaf" / "build-cpu" / "tools" / "vmaf",
_REPO_ROOT / "core" / "build-cpu" / "tools" / "vmaf",
):
if candidate.is_file():
return candidate
Expand Down
2 changes: 1 addition & 1 deletion ai/tests/test_e2e_frame_to_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from vmaf_train.data.feature_dump import DEFAULT_FEATURES, Entry, dump_features # noqa: E402

REPO_ROOT = Path(__file__).resolve().parents[2]
VMAF_BIN = REPO_ROOT / "libvmaf" / "build-cpu" / "tools" / "vmaf"
VMAF_BIN = REPO_ROOT / "core" / "build-cpu" / "tools" / "vmaf"
YUV_DIR = REPO_ROOT / "python" / "test" / "resource" / "yuv"
REF_YUV = YUV_DIR / "src01_hrc00_576x324.yuv"
DIS_YUV = YUV_DIR / "src01_hrc01_576x324.yuv"
Expand Down
4 changes: 2 additions & 2 deletions ai/tests/test_feature_extractor_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_default_vmaf_binary_uses_fork_cpu_build(monkeypatch) -> None:
monkeypatch.delenv("VMAF_BIN", raising=False)

assert feature_extractor.default_vmaf_binary() == (
Path("libvmaf") / "build-cpu" / "tools" / "vmaf"
Path("core") / "build-cpu" / "tools" / "vmaf"
)


Expand All @@ -25,4 +25,4 @@ def test_default_vmaf_binary_respects_env(monkeypatch) -> None:


def test_vmaf_train_feature_dump_default_uses_fork_cpu_build() -> None:
assert (Path("libvmaf") / "build-cpu" / "tools" / "vmaf") == feature_dump.DEFAULT_VMAF_BINARY
assert (Path("core") / "build-cpu" / "tools" / "vmaf") == feature_dump.DEFAULT_VMAF_BINARY
2 changes: 1 addition & 1 deletion ai/tests/test_train_konvid_mos_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ def test_smoke_run_produces_allowlist_conformant_onnx(tmp_path: Path) -> None:
model = onnx_pkg.load(str(onnx_path))
onnx_pkg.checker.check_model(model)
ops = {n.op_type for n in model.graph.node}
allowlist_text = (REPO_ROOT / "libvmaf" / "src" / "dnn" / "op_allowlist.c").read_text()
allowlist_text = (REPO_ROOT / "core" / "src" / "dnn" / "op_allowlist.c").read_text()
for op in ops:
assert f'"{op}"' in allowlist_text, f"op {op} missing from op_allowlist.c"

Expand Down
16 changes: 16 additions & 0 deletions changelog.d/fixed/master-unblock-legacy-runner-dnn-path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### Fixed

- Add `VmafLegacyQualityRunner` deprecation stub to `compat/python-vmaf/core/quality_runner.py`
so that `from vmaf.core.quality_runner import VmafLegacyQualityRunner` succeeds (import
was failing with `ImportError` and blocking the Netflix CPU golden-data CI gate). The class
raises `NotImplementedError` on instantiation with a pointer to the replacement
(`VmafQualityRunner`). Removed in ADR-0749 / PR #87. (Unblocks PR #181 Required Checks
Aggregator.)
- Fix stale post-ADR-0700 `libvmaf/` path references in `ai/` — `ai/tests/test_train_konvid_mos_head.py`
(`libvmaf/src/dnn/op_allowlist.c` → `core/src/dnn/op_allowlist.c`), and seven
`libvmaf/build-cpu` → `core/build-cpu` references across `ai/scripts/extract_k150k_features.py`,
`ai/scripts/konvid_to_vmaf_pairs.py`, `ai/scripts/bvi_dvc_to_full_features.py`,
`ai/data/feature_extractor.py`, `ai/src/vmaf_train/data/feature_dump.py`,
`ai/src/vmaf_train/cli.py`, `ai/tests/test_chug_extract_features_smoke.py`, and
`ai/tests/test_e2e_frame_to_score.py`. Updates corresponding test assertions in
`ai/tests/test_feature_extractor_defaults.py`.
18 changes: 18 additions & 0 deletions compat/python-vmaf/core/quality_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,24 @@ def _get_feature_key_for_score(self):
return "speed_temporal"


class VmafLegacyQualityRunner:
"""Removed stub — do not use.

VmafLegacyQualityRunner was retired in ADR-0749 / PR #87 (legacy ANSNR
sunset). The class is kept here as a stub so that ``import`` statements
do not raise ``ImportError``; any attempt to *instantiate* it raises
``NotImplementedError`` with a pointer to the replacement.

Use :class:`VmafQualityRunner` instead.
"""

def __init__(self, *args, **kwargs):
raise NotImplementedError(
"VmafLegacyQualityRunner was removed in ADR-0749 / PR #87; "
"use VmafQualityRunner instead."
)


if __name__ == "__main__":
import doctest

Expand Down
32 changes: 32 additions & 0 deletions docs/rebase-notes.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,42 @@
# Rebase notes

<!-- markdownlint-disable MD001 MD004 MD012 MD013 MD022 MD023 MD024 MD025 MD026 MD031 MD032 MD033 MD034 MD037 MD038 MD040 MD046 MD050 MD053 MD058 -->

Single ledger of fork-local changes that need attention when this fork
syncs from `upstream/master` (Netflix/vmaf). Required by
[ADR-0108](adr/0108-deep-dive-deliverables-rule.md): every fork-local

---

## master-unblock-legacy-runner-dnn-path (2026-05-29, no ADR — bug fix)

**Files touched:**
`compat/python-vmaf/core/quality_runner.py`,
`ai/tests/test_train_konvid_mos_head.py`,
`ai/scripts/extract_k150k_features.py`,
`ai/scripts/konvid_to_vmaf_pairs.py`,
`ai/scripts/bvi_dvc_to_full_features.py`,
`ai/data/feature_extractor.py`,
`ai/src/vmaf_train/data/feature_dump.py`,
`ai/src/vmaf_train/cli.py`,
`ai/tests/test_chug_extract_features_smoke.py`,
`ai/tests/test_e2e_frame_to_score.py`,
`ai/tests/test_feature_extractor_defaults.py`

**Rebase impact:** Post-ADR-0700 stragglers. The `libvmaf/` directory was
renamed to `core/` by ADR-0700; path references in `ai/` scripts still used
the old name. Any upstream sync that adds further `ai/` scripts or tests
should check for `libvmaf/build-cpu` or `libvmaf/src/dnn` references and
update them to `core/build-cpu` and `core/src/dnn` respectively. The
`VmafLegacyQualityRunner` stub is fork-local and does not conflict with
upstream.

**Periodic check:** After any `sync-upstream` that touches `ai/` or
`python/test/`, run `grep -rn 'libvmaf/src/dnn\|libvmaf.*build-cpu' ai/ scripts/`
to catch new post-ADR-0700 stragglers before they break CI.

---

## cuda-ms-ssim-vert-lcs-horiz-ldg (2026-05-29, ADR-0757)

**Files touched:**
Expand All @@ -20,6 +51,7 @@ The change is a pure performance annotation: `__launch_bounds__(128)`,
loads. If upstream Netflix ever adds their own ms_ssim CUDA port, this file
will need to be re-reviewed against theirs; the F3 pattern should carry
forward.

## cpp23 orphan .c sweep — metadata_handler.c (2026-05-29)

**Files touched:** `core/src/metadata_handler.c` (deleted)
Expand Down
2 changes: 2 additions & 0 deletions docs/state.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_Updated: 2026-05-29 (T-MASTER-UNBLOCK-LEGACY-RUNNER-DNN-PATH-20260529 closed — `VmafLegacyQualityRunner` import stub added; 9 stale `libvmaf/` path references in `ai/` updated to `core/`. Unblocks PR #181 aggregator. Row added to Recently closed.)
_Updated: 2026-05-29 (MT-1 + MT-2 Metal PR #117 audit findings fixed — MT-1: `g_metal_features[]` in `dispatch_strategy.c` lacked `"float_ms_ssim_metal"`, causing `vmaf_metal_dispatch_supports()` to return 0 for the float MS-SSIM Metal extractor (ADR-0490 / T-VULKAN-METAL-DEAD-SCAFFOLDS-2026-05-18 wiring already landed); entry added. MT-2: `vmaf_metal_state_init_external` in `picture_import.mm` applied `CFRetain` + `__bridge_retained` (+2 retains) against a single `__bridge_transfer` (-1) in `vmaf_metal_state_free`, leaking one Obj-C reference per init/close cycle for both `device` and `queue`; `CFRetain` calls removed. No ADR per CLAUDE §12 r8; bug fixes. Rows added to Recently closed.)
_Updated: 2026-05-29 (Research-0755 HIP backend audit completed. Findings: P0 — no extern "C" mangling bugs, no pinned-host leaks. P1 — AdmBufferHip struct passed by value (~272 bytes) in integer_adm/adm_csf.hip and adm_cm.hip kernel signatures (recommend pointer-passing, mirrors PR #93 F3). P2 — dispatch_strategy.c remains a full stub; cross-backend ULP gate runs not confirmed for newer extractors (integer_ssim_hip, integer_adm_hip, integer_cambi_hip, ssimulacra2_hip, speed_*_hip); CAMBI HIP terminus (ADR-0345 Phase 3) confirmed landed. 20 of 20 registered extractors have real hipModuleLoadData paths under HAVE_HIPCC. See docs/research/0755-hip-backend-audit-20260529.md. Audit-only; no code changes.)
_Updated: 2026-05-29 (T-CUDA-READBACK-HOST-PINNED-LEAK-20260529 closed — `vmaf_cuda_kernel_readback_free` in `core/src/cuda/kernel_template.h` now calls `vmaf_cuda_buffer_host_free` to release the pinned host readback buffer. Previously the helper only NULLed `rb->host_pinned` without calling `cuMemFreeHost`, leaking one `cuMemHostAlloc` allocation per init/close cycle across all 9 template-using feature extractors: integer_psnr, integer_ssim/float_ssim, ssim, float_psnr, float_motion, integer_ciede, integer_moment, integer_motion_v2, integer_cambi. PR #93 follow-up sweep. Bug fix; no ADR per CLAUDE §12 r8.)_
Expand Down Expand Up @@ -223,6 +224,7 @@ landed fix yet._

## Recently closed

| **T-MASTER-UNBLOCK-LEGACY-RUNNER-DNN-PATH-20260529** | Netflix CPU golden-data CI gate failing with `ImportError: cannot import name 'VmafLegacyQualityRunner'` (removed by ADR-0749 / PR #87), and Tiny-AI CI failing with `FileNotFoundError` on `libvmaf/src/dnn/op_allowlist.c` (stale post-ADR-0700 path). Fix 1: added `VmafLegacyQualityRunner` deprecation stub to `compat/python-vmaf/core/quality_runner.py` — import now succeeds; instantiation raises `NotImplementedError` pointing to `VmafQualityRunner`. Fix 2: corrected 9 stale `libvmaf/src/dnn` and `libvmaf/build-cpu` path references across `ai/` to `core/src/dnn` and `core/build-cpu`. Unblocks PR #181 Required Checks Aggregator. | no ADR (bug fix per CLAUDE §12 r8) | fix/master-unblock-legacy-runner-and-dnn-path-20260529 | `python3 -c "from vmaf.core.quality_runner import VmafLegacyQualityRunner; print('import OK')"` + `grep -rn 'libvmaf/src/dnn\|libvmaf.*build-cpu' ai/ scripts/` returns empty. | (2026-05-29) |
| **T-METAL-MT1-DISPATCH-FLOAT-MS-SSIM-2026-05-29** | `g_metal_features[]` in `core/src/metal/dispatch_strategy.c` lacked `"float_ms_ssim_metal"`. `vmaf_metal_dispatch_supports()` returned 0 for the float MS-SSIM Metal extractor even after ADR-0490 / T-VULKAN-METAL-DEAD-SCAFFOLDS-2026-05-18 wired the TU into meson. Callers routing through the dispatch table (ADR-0420 gate, ADR-0421 consumer) silently fell back to CPU on every Apple Silicon run. Fixed by adding the entry in the table, adjacent to `"float_ms_ssim"`. | no ADR: only-one-way fix | fix/metal-pr117-actionable-findings-20260529 | Smoke: `vmaf_metal_dispatch_supports(ctx, "float_ms_ssim_metal") == 1` on Apple Silicon. | (2026-05-29) |
| **T-METAL-MT2-ARC-RETAIN-BALANCE-2026-05-29** | `vmaf_metal_state_init_external` in `core/src/metal/picture_import.mm` called `CFRetain((__bridge CFTypeRef)device)` (or `queue`) followed immediately by `(__bridge_retained void *)device` — accumulating +2 retain counts. `vmaf_metal_state_free` releases via a single `__bridge_transfer` (-1 retain), leaving one reference permanently live per init/close cycle for both `device` and `queue`. On an external-device path called by the FFmpeg `libvmaf_metal` filter, every filter graph teardown leaked the `id<MTLDevice>` and `id<MTLCommandQueue>` references. Fixed by removing both `CFRetain` calls; `__bridge_retained` alone is the correct single ownership transfer. | no ADR: only-one-way fix | fix/metal-pr117-actionable-findings-20260529 | Smoke: `leaks --atExit -- vmaf --backend metal ...` returns 0 Metal object leaks per init/teardown cycle. macOS CI smoke required; Linux host: static-analysis only. | (2026-05-29) |
| **T-PERF-BENCH-BASELINE-MISSING** — No versioned multi-resolution performance baseline existed; per-PR performance numbers were generated ad-hoc in incompatible formats | CLOSED — `scripts/perf/bench-multi-resolution.sh` + `testdata/perf_multi_resolution.json` added in PR feat/perf-bench-multi-resolution-20260529 ([ADR-0752](adr/0752-perf-bench-multi-resolution.md)) | — | [Research-0752](research/research-0752-perf-bench-multi-resolution-baseline.md) |
Expand Down
Loading