Repository navigation
refactor(core): cpp23 Wave 4 — output writers (ADR-0733) - #56
Merged
Merged
Conversation
lusoris
marked this pull request as ready for review
May 28, 2026 17:28
lusoris
enabled auto-merge (squash)
May 28, 2026 17:28
lusoris
force-pushed
the
feat/cpp23-wave4-output-writers-20260528
branch
2 times, most recently
from
May 28, 2026 19:36
7f5aff0 to
8aeab24
Compare
This was referenced May 28, 2026
Convert core/src/output.c → output.cpp as Wave 4 of the ADR-0708 C++23 internals migration. All four format writers (XML, JSON, CSV, MicroDVD subtitle) compiled under std=c++23 via an isolated static_library with override_options=['cpp_std=c++23'], matching the Wave 1/3 pattern. C++23 idioms applied: - LocaleGuard RAII: vmaf_thread_locale_pop runs on destruction, removing the manual push/pop pair and guarding against future early returns. - std::string_view: score-format parameter threaded through all helpers, eliminating implicit strlen per write call. - [[nodiscard]] on all four public entry points. - constexpr pool_method_name / DEFAULT_SCORE_FORMAT. - static_cast<VmafPoolingMethod> for the unsigned→enum loop variable. - extern "C" wrapper in output.cpp for the internal C headers that lack their own guards (feature/alias.h, feature_collector.h, thread_locale.h). Public C ABI and output bytes are bit-identical (test_output pass, 49/49 fast suite pass, XML/JSON smoke test against Netflix golden YUV). Also removes stale test_ansnr_simd entries from core/test/meson.build that blocked meson setup after the ansnr feature drop (ADR-0720). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lusoris
force-pushed
the
feat/cpp23-wave4-output-writers-20260528
branch
from
May 28, 2026 21:57
8aeab24 to
f7e7100
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
core/src/output.c→output.cppas Wave 4 of the ADR-0708 C++23 internals migration-std=c++23via isolatedstatic_library+override_options=['cpp_std=c++23']test_ansnr_simdmeson.build entries blockingmeson setupafter the ADR-0720 ansnr dropC++23 idioms applied
LocaleGuardRAII:vmaf_thread_locale_popruns on destruction — cleanup guaranteed on all exit pathsstd::string_view: score-format parameter threaded through all helpers, eliminating implicitstrlenper write call[[nodiscard]]: all four public entry points annotatedconstexpr:pool_method_name[]andDEFAULT_SCORE_FORMATstatic_cast<VmafPoolingMethod>: explicit enum cast replacing implicit C unsigned→enum conversionsextern "C"wrapper:feature/alias.h,feature_collector.h,thread_locale.hwrapped at include site (they lack their own guards)Deep-dive deliverables
no digest needed: Wave 4 continues ADR-0708 playbook## Alternatives considered(per-file split vs bundle;std::ofstreamvsFILE*;std::formatvsprintf-style)core/AGENTS.mdinvariant: Wave 4 RAII pattern +extern "C"wrapper note + upstream rebase guidancechangelog.d/changed/cpp23-wave4.mddocs/rebase-notes.mdentryPer-surface docs
no user-discoverable surface change — internal refactor; output schema bit-equivalent (verified via smoke test below)Smoke test
docs/state.mdno bug opened/closed/ruled-out — pure internal refactorMerge-train note
Waves 1–3 in flight (PRs #41, #43, #44, #45, #48, #51, #54). This PR is independent of all of them (touches only
output.c/.cpp,output.h,meson.build, and test/meson.build). No Vulkan-drop (#47) overlap confirmed (gh pr diff 47 --name-only | grep output→ no output).🤖 Generated with Claude Code