Skip to content

chore(dnn): T7-12 — remove VMAF_MAX_MODEL_BYTES env override#193

Merged
lusoris merged 1 commit intomasterfrom
chore/t7-12-remove-model-bytes-env-override
Apr 29, 2026
Merged

chore(dnn): T7-12 — remove VMAF_MAX_MODEL_BYTES env override#193
lusoris merged 1 commit intomasterfrom
chore/t7-12-remove-model-bytes-env-override

Conversation

@lusoris
Copy link
Copy Markdown
Owner

@lusoris lusoris commented Apr 29, 2026

Summary

Backlog item T7-12: remove the historical VMAF_MAX_MODEL_BYTES
environment-variable override that let callers raise (or, for tests,
lower) the tiny-AI ONNX file-size cap. Two release cycles have passed
without a shipped model approaching the 50 MB cap, so the testing-hatch
is retired in favour of the compile-time VMAF_DNN_DEFAULT_MAX_BYTES
constant in libvmaf/src/dnn/model_loader.h
as the single source of truth.

Code changes:

  • vmaf_dnn_session_open() and vmaf_use_tiny_model() no longer
    read the env var; both pin max_bytes to VMAF_DNN_DEFAULT_MAX_BYTES.
  • Two env-driven unit tests (test_session_open_respects_max_bytes_env,
    test_session_open_ignores_invalid_max_bytes_env) and their Windows
    _putenv_s shim are removed. Other size-cap coverage (oversize fixture
    rejection, S_ISREG, allowlist) stays intact.

Docs (every prose mention of the env knob updated to the compile-time
constant + a "retired in T7-12" pointer): libvmaf/include/libvmaf/dnn.h,
libvmaf/src/dnn/model_loader.h, libvmaf/src/dnn/README.md,
docs/ai/security.md, docs/ai/benchmarks.md, docs/ai/roadmap.md,
docs/api/dnn.md.

Deep-dive deliverables (ADR-0108)

  • no research digest needed: trivial cleanup of a documented-as-retiring testing hatch; no investigation required.
  • no alternatives: only-one-way fix (the env override was already documented as a temporary testing hatch; removal is the documented end-state).
  • no rebase-sensitive AGENTS invariants in this PR (touched files are 100% fork-additions; upstream Netflix has no DNN session surface to conflict with).
  • Reproducer / smoke-test command
    meson setup build-cpu -Denable_cuda=false -Denable_sycl=false libvmaf
    ninja -C build-cpu
    meson test -C build-cpu                # 37/37 pass
    VMAF_MAX_MODEL_BYTES=1 ./build-cpu/tools/vmaf --help >/dev/null
    # env value silently ignored; loader uses 50 MB cap.
  • CHANGELOG.md entry — Unreleased § Removed.
  • no rebase note needed: all touched C/H files are fork-only; dnn_api.c, dnn_attach_api.c, and model_loader.h are not in upstream Netflix/vmaf, so no upstream-merge conflict surface exists.

Test plan

  • `meson setup build-cpu -Denable_cuda=false -Denable_sycl=false libvmaf`
  • `ninja -C build-cpu`
  • `meson test -C build-cpu` → 37/37 pass.
  • `pre-commit run --files ` → all hooks pass.
  • `clang-tidy -p build-cpu` on touched C files: no new warnings.
  • `bash scripts/ci/assertion-density.sh` → PASS.

🤖 Generated with Claude Code

Two release cycles passed without a shipped tiny-AI model
approaching the 50 MB cap, so the historical
`VMAF_MAX_MODEL_BYTES` env override is retired. The
compile-time `VMAF_DNN_DEFAULT_MAX_BYTES` constant in
`libvmaf/src/dnn/model_loader.h` becomes the single source of
truth; callers that genuinely need a larger envelope must bump
the constant and rebuild.

Code:
- `vmaf_dnn_session_open()` and `vmaf_use_tiny_model()` no
  longer read the env var; both now hard-pin `max_bytes` to
  `VMAF_DNN_DEFAULT_MAX_BYTES` before calling
  `vmaf_dnn_validate_onnx()`. Reduces branch count and shaves a
  few lines off `vmaf_use_tiny_model`'s function-size warning.
- The two env-driven unit tests
  (`test_session_open_respects_max_bytes_env`,
  `test_session_open_ignores_invalid_max_bytes_env`) and their
  Windows `_putenv_s` shim are removed. All other size-cap
  coverage (oversize fixture rejection, `S_ISREG` check,
  allowlist) stays intact via `test_model_loader.c`.

Docs touched: `libvmaf/include/libvmaf/dnn.h`,
`libvmaf/src/dnn/model_loader.h`, `libvmaf/src/dnn/README.md`,
`docs/ai/security.md`, `docs/ai/benchmarks.md`,
`docs/ai/roadmap.md`, `docs/api/dnn.md`. Each one now points at
the compile-time constant and notes that the env override was
retired in T7-12.

CHANGELOG: new "Removed" entry under the lusoris-fork unreleased
section.

Verification:
- `meson test -C build-cpu` → 37/37 pass.
- `pre-commit run --files <touched>` → all hooks pass.
- `clang-tidy -p build-cpu` on the three touched C files: no new
  warnings introduced (function-size warning on
  `vmaf_use_tiny_model` shrank from 68 to 62 lines; remaining
  pre-existing debt is scoped to T7-5).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lusoris lusoris merged commit f87384f into master Apr 29, 2026
51 of 52 checks passed
@lusoris lusoris deleted the chore/t7-12-remove-model-bytes-env-override branch April 29, 2026 09:16
@github-actions github-actions Bot mentioned this pull request Apr 29, 2026
lusoris pushed a commit that referenced this pull request May 1, 2026
…-1a Netflix Public dataset row)

Update docs/state.md `_Updated:` stamp to 2026-04-29 and rewrite the
"Tiny-AI C1 baseline `fr_regressor_v1.onnx`" deferral row's reopen-trigger
to TRIGGERED — the Netflix Public training corpus that gated C1 is now
locally available at `.workingdir2/netflix/` (9 ref + 70 dis YUVs, ~37 GB,
gitignored; provided by lawrence 2026-04-27), unblocking BACKLOG T6-1a.

Verified the rest of state.md against the 2026-04-29-session merged PR
set (#193#205, #209). Every merged PR was feature / chore / docs / perf
with no bug-status delta to record per CLAUDE §12 rule 13:
- #193 chore(dnn) T7-12 env override removal — chore.
- #194 docs(research) T7-9 NPU digest — research.
- #195 feat(mcp) T5-2 embedded scaffold — feature.
- #196 feat(vulkan) T7-36 cambi integration — feature.
- #197 feat(motion) Netflix b949ceb port — upstream port.
- #198 chore(backlog) T7-32 micro-investigations — verify-only.
- #199 feat(ai) T6-9 model registry — feature.
- #200 feat(hip) T7-10 HIP scaffold — feature.
- #201 feat(simd) T7-38 SVE2 ports — feature.
- #202 feat(ci) T6-8 parity matrix — feature.
- #203 feat(ai) T6-7 FastDVDnet — feature.
- #205 docs(audit) T7-4 quarterly audit — explicitly notes "no
  state.md changes (no upstream commit ruled in/out a fork bug)".
- #209 perf(sycl) T7-17 fp64-less device — perf.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris pushed a commit that referenced this pull request May 1, 2026
…-1a Netflix Public dataset row)

Update docs/state.md `_Updated:` stamp to 2026-04-29 and rewrite the
"Tiny-AI C1 baseline `fr_regressor_v1.onnx`" deferral row's reopen-trigger
to TRIGGERED — the Netflix Public training corpus that gated C1 is now
locally available at `.workingdir2/netflix/` (9 ref + 70 dis YUVs, ~37 GB,
gitignored; provided by lawrence 2026-04-27), unblocking BACKLOG T6-1a.

Verified the rest of state.md against the 2026-04-29-session merged PR
set (#193#205, #209). Every merged PR was feature / chore / docs / perf
with no bug-status delta to record per CLAUDE §12 rule 13:
- #193 chore(dnn) T7-12 env override removal — chore.
- #194 docs(research) T7-9 NPU digest — research.
- #195 feat(mcp) T5-2 embedded scaffold — feature.
- #196 feat(vulkan) T7-36 cambi integration — feature.
- #197 feat(motion) Netflix b949ceb port — upstream port.
- #198 chore(backlog) T7-32 micro-investigations — verify-only.
- #199 feat(ai) T6-9 model registry — feature.
- #200 feat(hip) T7-10 HIP scaffold — feature.
- #201 feat(simd) T7-38 SVE2 ports — feature.
- #202 feat(ci) T6-8 parity matrix — feature.
- #203 feat(ai) T6-7 FastDVDnet — feature.
- #205 docs(audit) T7-4 quarterly audit — explicitly notes "no
  state.md changes (no upstream commit ruled in/out a fork bug)".
- #209 perf(sycl) T7-17 fp64-less device — perf.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris pushed a commit that referenced this pull request May 1, 2026
…-1a Netflix Public dataset row)

Update docs/state.md `_Updated:` stamp to 2026-04-29 and rewrite the
"Tiny-AI C1 baseline `fr_regressor_v1.onnx`" deferral row's reopen-trigger
to TRIGGERED — the Netflix Public training corpus that gated C1 is now
locally available at `.workingdir2/netflix/` (9 ref + 70 dis YUVs, ~37 GB,
gitignored; provided by lawrence 2026-04-27), unblocking BACKLOG T6-1a.

Verified the rest of state.md against the 2026-04-29-session merged PR
set (#193#205, #209). Every merged PR was feature / chore / docs / perf
with no bug-status delta to record per CLAUDE §12 rule 13:
- #193 chore(dnn) T7-12 env override removal — chore.
- #194 docs(research) T7-9 NPU digest — research.
- #195 feat(mcp) T5-2 embedded scaffold — feature.
- #196 feat(vulkan) T7-36 cambi integration — feature.
- #197 feat(motion) Netflix b949ceb port — upstream port.
- #198 chore(backlog) T7-32 micro-investigations — verify-only.
- #199 feat(ai) T6-9 model registry — feature.
- #200 feat(hip) T7-10 HIP scaffold — feature.
- #201 feat(simd) T7-38 SVE2 ports — feature.
- #202 feat(ci) T6-8 parity matrix — feature.
- #203 feat(ai) T6-7 FastDVDnet — feature.
- #205 docs(audit) T7-4 quarterly audit — explicitly notes "no
  state.md changes (no upstream commit ruled in/out a fork bug)".
- #209 perf(sycl) T7-17 fp64-less device — perf.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lusoris added a commit that referenced this pull request May 1, 2026
…-1a Netflix Public dataset row) (#245)

Update docs/state.md `_Updated:` stamp to 2026-04-29 and rewrite the
"Tiny-AI C1 baseline `fr_regressor_v1.onnx`" deferral row's reopen-trigger
to TRIGGERED — the Netflix Public training corpus that gated C1 is now
locally available at `.workingdir2/netflix/` (9 ref + 70 dis YUVs, ~37 GB,
gitignored; provided by lawrence 2026-04-27), unblocking BACKLOG T6-1a.

Verified the rest of state.md against the 2026-04-29-session merged PR
set (#193#205, #209). Every merged PR was feature / chore / docs / perf
with no bug-status delta to record per CLAUDE §12 rule 13:
- #193 chore(dnn) T7-12 env override removal — chore.
- #194 docs(research) T7-9 NPU digest — research.
- #195 feat(mcp) T5-2 embedded scaffold — feature.
- #196 feat(vulkan) T7-36 cambi integration — feature.
- #197 feat(motion) Netflix b949ceb port — upstream port.
- #198 chore(backlog) T7-32 micro-investigations — verify-only.
- #199 feat(ai) T6-9 model registry — feature.
- #200 feat(hip) T7-10 HIP scaffold — feature.
- #201 feat(simd) T7-38 SVE2 ports — feature.
- #202 feat(ci) T6-8 parity matrix — feature.
- #203 feat(ai) T6-7 FastDVDnet — feature.
- #205 docs(audit) T7-4 quarterly audit — explicitly notes "no
  state.md changes (no upstream commit ruled in/out a fork bug)".
- #209 perf(sycl) T7-17 fp64-less device — perf.

Co-authored-by: Lusoris <lusoris@pm.me>
Co-authored-by: Claude Opus 4.7 (1M context) <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