Repository navigation
refactor(core): cpp23 Wave 3 part B — psnr_tools, luminance_tools, mkdirp (ADR-0731) - #51
Merged
Merged
Conversation
lusoris
marked this pull request as ready for review
May 28, 2026 16:26
lusoris
enabled auto-merge (squash)
May 28, 2026 16:26
6 tasks done
lusoris
force-pushed
the
feat/cpp23-wave3-part-b-20260528
branch
2 times, most recently
from
May 28, 2026 19:35
3cd3e9e to
4e55c59
Compare
This was referenced May 28, 2026
…dirp (ADR-0731) Convert three small feature utility TUs from C to C++23 following the ADR-0708 isolated-static-library playbook: - psnr_tools.cpp: constexpr lookup table replaces strcmp chain; std::string_view dispatch eliminates repeated strlen traversals. - luminance_tools.cpp: std::max/std::clamp replace MAX() macro; BT.1886/PQ constants become constexpr; EOTF dispatch uses std::string_view; [[nodiscard]] on internal helpers; extern "C" guards added to luminance_tools.h and log.h. - mkdirp.cpp: std::string RAII replaces goto-fail cleanup; strdup+free pairs eliminated; MIT-licensed original logic preserved. Each TU is compiled as an isolated static_library (psnr_tools_cpp23_lib, luminance_tools_cpp23_lib, mkdirp_cpp23_lib) with override_options=['cpp_std=c++23'] and extracted into libvmaf and all test binaries that directly link libvmaf_feature_static_lib (via new feature_cpp23_objects helper list). Also removes stale test_ansnr_simd entries from core/test/meson.build left over from the ansnr drop (commit 70ed8b3). Six deliverables: no digest needed (bulk Wave 3 part B continues ADR-0708 playbook); ADR-0731 alternatives matrix; core/AGENTS.md invariant note; reproducer: meson test --suite=fast (50/50); changelog.d/changed/cpp23-wave3-part-b.md; rebase-notes.md entry. No user-discoverable surface change (internal refactor). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lusoris
force-pushed
the
feat/cpp23-wave3-part-b-20260528
branch
from
May 28, 2026 21:57
4e55c59 to
60be4ad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
psnr_tools.c,luminance_tools.c, andmkdirp.cto C++23 following the ADR-0708 isolated-static-library playbookstatic_librarywithoverride_options=['cpp_std=c++23']; objects extracted intolibvmafand all tests viafeature_cpp23_objectshelpertest_ansnr_simdentries incore/test/meson.buildleft over from the ansnr drop (commit70ed8b3)C++23 idioms applied
psnr_tools.cppconstexpr std::arraylookup table,std::string_viewdispatch,std::optionalreturnluminance_tools.cppstd::max/std::clampreplacingMAX(),constexprconstants,std::string_viewEOTF dispatch,[[nodiscard]]mkdirp.cppstd::stringRAII replacinggoto fail+ dualfree(),constexprpath separatorSix deep-dive deliverables (ADR-0108)
## Alternatives consideredcore/AGENTS.mdinvariant:feature_cpp23_objectswiring rule addedmeson setup core/build-wave3b core -Denable_cuda=false -Denable_sycl=false -Denable_vulkan=disabled && ninja -C core/build-wave3b && meson test -C core/build-wave3b --suite=fast— 50/50 passchangelog.d/changed/cpp23-wave3-part-b.mddocs/rebase-notes.mdentryPer-surface docs
no user-discoverable surface change: internal refactor —
.c→.cpp, no API delta, no new CLI flags or public headersdocs/state.md
no state.md update needed: no bugs opened, closed, or ruled not-affecting
ffmpeg-patches
no ffmpeg-patches update needed: no public C-API or public header changes
ADR
ADR-0731
Test outcome