Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Upstream PR Queue (sorted by mergeability score) - #191

Draft
clockblocker wants to merge 36 commits into
mainfrom
upstream-queue
Draft

clockblocker wants to merge 36 commits into
mainfrom
upstream-queue

Conversation

@clockblocker

@clockblocker clockblocker commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Upstream PR Queue (upstream-queue)

Canonical, single-branch queue of self-contained, reviewable PRs intended to be drip-fed upstream to munich-data-engineering/reflect-cpp 1–2 PRs at a time against upstream/main, ordered strictly from easiest / highest mergeability score at the bottom (closest to main) to hardest at the top while honoring parent-before-child dependencies. The queue shrinks as PRs merge upstream and grows whenever a standalone, landable fix is added or extracted from speculative work.

Speculative / design-heavy work (currently discuss/ssot) stacks directly on top of upstream-queue so new features automatically inherit all queued fixes and compile-time wins without constant branch reshaping. When speculative development uncovers a standalone bugfix, it drops into upstream-queue (as done for items #2, #14, #23, #30, #34 below) and discuss/ssot rebases cleanly on top. CMake/build onboarding work lives separately on upstream-queue-for-build-cmake and is intentionally not mixed into this branch.

Note: This Draft PR targets clockblocker/reflect-cpp:main as a living mission-control overview. Do not merge this branch wholesale; cherry-pick individual commits from the bottom up onto upstream/main when opening upstream PRs.


Mergeability Scoring Rubric (0–100, Cutline >= 65)

Every candidate (and every commit in discuss/ssot) was evaluated by an isolated fresh Maintainer-Judge calibrated against upstream review history (docs/maintainer-review-guide.md) and verified against pinned real-world OSS consumers from the #138 corpus (NVIDIA/cuda-quantum, nvidia-holoscan/holoscan-sdk, openmoq/moqx, hudson-trading/slang-server, games-on-whales/wolf, munich-data-engineering/sqlgen, FANUC-CORPORATION/fanuc_driver):

Axis Points Criteria
S — Size & Blast Radius 0–30 Prod LOC, file count, header/core coupling, isolation from unrelated subsystems.
M — Maintainer Buy-In 0–30 Open upstream issue/endorsement, direct precedent PRs, alignment with maintainer priorities (compile time, zero-throw Result, backwards compat, one problem per PR).
D — Downstream Pain / Evidence 0–25 Verified real-world consumer workarounds, live bugs, or measured N=3 interleaved A/B compile-time / runtime wins.
R — API & Maintenance Risk 0–15 Backwards compatibility, header hygiene (CHECK_HEADERS), strict-warning cleanliness, future maintenance footprint.

Ordered Queue (Bottom → Top, Easiest → Hardest)

Rank Commit PR / Chunk Title Status Prod LOC Score (S+M+D+R) Parent Value Prop TL;DR Key Citations
1 d1f84224 fix(reflection): fix dangling string_view in rfl::internal::get_type_name_str_view Open upstream #804 +14/-6 (2f) 98 (30+30+24+14) — Fixes v0.26.1 use-after-free where get_type_name_str_view<T>() returns a string_view to a destroyed temporary StringLiteral. PR #804, #145, cuda-quantum
2 e5c60531 fix(validation): fix rfl::OneOf broken .and_then().or_else() composition Ready (extracted) +12/-21 (1f) 95 (est.) — Fixes rfl::OneOf rejecting valid inputs when a non-last branch passes, accepting invalid inputs when multiple branches pass, and use-after-move on _errors. Extracted from discuss/ssot
3 89c36611 fix(json): reject uint64 > INT64_MAX instead of silently wrapping into signed integers Ready +12/-4 (1f) 93 (29+29+20+15) — Returns an error instead of silently wrapping JSON integers > INT64_MAX into negative int64_t values. #746, #617, slang-server
4 b9dc1e93 feat(json-schema): emit oneOf for rfl::TaggedUnion in JSON Schema (#375) Ready +19/-5 (3f) 92 (29+29+22+12) — Emits JSON Schema oneOf (not anyOf) for mutually-exclusive rfl::TaggedUnion discriminators. #375, wolf
5 07ef2b6e fix(headers): eliminate -Wextra, -Wextra-semi, -Wsign-conversion, and -Wunused-parameter warnings Open upstream #803 +22/-18 (14f) 92 (29+25+23+15) — Eliminates strict warning noise in public headers so downstream -Wall -Wextra -Werror builds need fewer suppressions. PR #803, #140 (partial), slang-server, wolf, sqlgen
6 4879f7e2 fix(parsing): gate <expected> include behind <version> feature test to avoid MSVC STL4038 Ready +3/-1 (1f) 92 (29+28+21+14) — Eliminates MSVC /std:c++20 warning STL4038 (and /WX breaks) on every TU including <rfl.hpp> via <version> + __cpp_lib_expected >= 202202L while preserving C++23 std::expected on GCC 12/13+, Clang/libc++, and MSVC. #716, #570, #140 (partial), MSVC 19.44 /std:c++20
7 d9ae7120 feat(enums): accept std::string_view in rfl::string_to_enum (#565) Open upstream #802 +49/-20 (4f) 92 (29+28+23+12) — Accepts std::string_view in rfl::string_to_enum and replaces std::stoi with std::from_chars + full underlying-width parsing. PR #802, #565, #150, cuda-quantum
8 b14e27d8 perf(headers): trim <functional>, <sstream>, and unused <map> from thin headers Ready +79/-49 (6f) 92 (28+29+22+13) — Removes <functional>, <sstream>, and unused <map> from hot public headers (Result.hpp, Variant.hpp, enums.hpp, etc.), cutting ~40k preprocessed lines. #641, #519, #185 (partial), slang-server
9 6b4a388a fix(yaml): guard rfl::yaml::Reader against recursive aliases and out-of-bounds literal marks Open upstream #801 (2 tiny nits noted) +79/-2 (3f) 91 (29+28+22+12) — Prevents stack-overflow DoS on cyclic YAML aliases and OOB yaml_str_[Mark().pos] reads on programmatic nodes. PR #801, moqx
10 489eba42 fix(yaml): reject negative-to-unsigned wraparound, narrow integer overflow, and uint64_t write wraparound Ready (polished) +64/-18 (2f) 91 (29+28+23+11, ~93 post-polish) — (after #9) Fixes YAML negative-to-unsigned wraparound, narrow integer truncation, uint64_t > INT64_MAX read failure, and companion yaml::Writer uint64_t wraparound (parity with JSON #746/#617). #682 / #746, #615 / #617, #161, moqx
11 79b12685 fix(xml): fix get_field_from_array index increment and write() indent forwarding Open upstream #800 +3/-3 (2f) 89 (30+29+15+15) — Fixes infinite-loop / wrong-index bug in xml::Reader::get_field_from_array and dropped _indent in xml::write(ostream). PR #800
12 4e258590 fix(env): use getenv_s and _dupenv_s under _MSC_VER in rfl::env::Reader Ready (polished) +32/-5 (1f) 89 (29+28+18+14) — Replaces MSVC-deprecated std::getenv with zero-alloc ::getenv_s (probe) and ::_dupenv_s (read) under _MSC_VER in include/rfl/env/Reader.hpp, eliminating 80 public-header C4996 / -Wdeprecated-declarations warnings on Windows MSVC & clang-cl. #140 (partial), #694, env/Writer.cpp (_putenv_s), Timestamp.hpp (gmtime_s), clang-cl 19.1.5 & MSVC 19.44
13 c7aa574c fix(yaml): return error on non-scalar mapping keys instead of silently skipping Ready (polished) +11/-4 (1f) 88 (29+24+22+13) #9 (#801) Stops yaml::Reader::read_object from silently swallowing sequence/map/collection-alias keys (which bypassed NoExtraFields), using zero-copy Scalar() views while preserving null/~/: val, scalar aliases, and <<. #160 (non-scalar fix), moqx
14 970f78f0 fix(parsing): prevent std::terminate() at noexcept validation, map-key, and default boundaries Ready (extracted) +70/-21 (7f) 88 (est.) — Adds missing try/catch in AllOf::validate, switches MapReader Validator keys to from_value(), and adds catch (...) across noexcept boundaries. Extracted from discuss/ssot; #674
15 f49d6c8d fix(parsing): capture input keys matching ExtraFields member name Ready (split 1/5 of #118) +13/-0 (2f) 88 (split) — Constrains assign_if_field_matches<i> via requires(i != ViewType::pos_extra_fields()) (zero-lambda, 0-byte standalone .o overhead) so keys matching the ExtraFields member name are captured instead of colliding. Split from parser-symbol-isolation
16 d8892d9c docs(licensing): add THIRD_PARTY_NOTICES for vendored dependencies Ready (polished) +324/-0 (2f docs) 87 (28+25+22+12) — Adds centralized THIRD_PARTY_NOTICES.md (linked from README.md) with SPDX tags, verbatim licenses (yyjson, CTRE 3.10.0, enchantum MIT + copyright), and exact CMake/header inclusion conditions. #144, cuda-quantum, holoscan-sdk
17 ff639f32 fix(enums): backport enchantum MSVC 64-bit enum cast suffix fix Ready (polished) +3/-2 (1f) 86 (30+22+22+12) — (before #26, #35) Fixes silent MSVC 19.44 wire-format corruption stripping the first character of every enumerator name on 64-bit enums lacking a 0 enumerator via verbatim backport of ZXShady/enchantum@66acc35f, aligning bundled enchantum with vcpkg/Conan. ZXShady/enchantum@66acc35f, #519, #669, #762, MSVC 19.44
18 04495b88 fix(json-schema): flatten nested anyOf for optional variants and rfl::Generic Ready (polished) +23/-2 (1f) 86 (29+24+21+12) — Flattens redundant {"anyOf":[{"anyOf":[...]},{"type":"null"}]} into one anyOf while preserving annotated schemas via structured-binding check. #180 (partial), moqx, slang-server
19 b9081d02 feat(cli): add rfl::cli::usage to generate usage and help text (#692) Ready (polished) +452/-0 (2f) 86 (28+28+19+11) — Generates --help / usage strings directly from any rfl::cli::read struct (preserving cv-qualifiers and guarding root std::map). #692 (maintainer: "A PR is very welcome!")
20 fc9f041d feat(json): add first-class rfl::json read and write flag constants Ready +88/-2 (2f) 85 (29+23+22+11) — Exposes version-guarded inline constexpr rfl::json::read_* / write_* constants so users stop leaking raw YYJSON_* macros. #63, #404 / #425, #651, #169, slang-server (10 sites)
21 54c89d2d perf(parsing): isolate per-field helpers in NamedTupleParser, destructors, and flatten Ready (split 2/5 of #118) +298/-227 (3f) 85 (split) — Lifts per-field write/schema/missing/destructor helpers out of NamedTupleParser<FieldTypes...> to kill $O(N^2)$ symbol & DWARF bloat; skips trivial destructors. #795, #799, #185 (partial), Wave 1 A/B
22 a2d46af1 perf(internal): add apply_to_fields and avoid NamedTuple in HasDefaultVal Ready (polished) +89/-21 (4f) 84 (28+28+15+13) — Zero-API rfl::internal::apply_to_fields removes redundant named_tuple_t<T> + field_names_t<T> materialization inside HasDefaultVal<T>. #799, #641, #185 (partial)
23 dc6fcc62 fix(error): preserve structured Error::details() paths in FieldVariantReader and ParserTaggedUnion Ready (extracted) +13/-5 (2f) 84 (est.) — Preserves nested Error::details() paths in FieldVariantReader::try_one and adds discriminator segment in ParserTaggedUnion failures. Follow-up to #766
24 76da80df perf(internal): use O(log N) exponential + binary search in cpp20::num_fields Ready +49/-4 (1f) 83 (28+26+16+13) — Reduces C++20 num_fields constructibility probes from $O(N)$ to $O(\log N)$ on wide structs (zero API change). #799, #185 (partial), slang-server, moqx
25 0ac0ee21 perf(parsing): isolate per-field helpers in ViewReader and ViewReaderWithDefault Ready (split 3/5 of #118) +468/-209 (2f) 83 (split) #15 Lifts per-field read/move/error helpers out of ViewReader & ViewReaderWithDefault with lambda-free dispatch (bool matched, size_ == 0 guard) and zero [[maybe_unused]]. #795, #582, #185 (partial), Wave 1 A/B
26 9a5ee9b4 feat(enums): add rfl::TransformEnumNames processors (#731) Ready (split 1/2 of #123) +427/-42 (7f) 83 (split) #7 (#802) Opt-in whole-enum casing processors (EnumSnakeCaseToKebabCase, EnumCamelCaseToSnakeCase, etc.) with out-of-line RFL_API transform and cached tables. #731, #148, cuda-quantum, moqx, sqlgen, wolf
27 950382b1 feat(reflection): add public rfl::type_name<T>() and rfl::type_name_v<T> Ready (polished) +28/-0 (2f) 82 (28+21+23+10) #1 (#804) Exposes zero-allocation consteval std::string_view rfl::type_name<T>() / type_name_v<T> so consumers stop reaching into rfl::internal::. #451, #145, cuda-quantum, sqlgen, wolf
28 8bc0da9a perf(schema): fast-path scalar defaults in NamedTupleParser::to_schema Ready (split 4/5 of #118) +39/-1 (1f) 82 (split) #21 Avoids instantiating rfl::generic::Writer for scalar / optional-scalar DefaultVal schema defaults (cleanly drops consumer-specific vector<string> case). #641, #185 (partial)
29 8bb958f2 feat(json-schema): add rfl::IntegerBounds opt-in processor (#683) Ready (polished) +127/-4 (9f) 80 (23+24+22+11) — Opt-in processor emitting minimum/maximum JSON Schema bounds for fixed-width integers (excluding char types), using std::uint64_t maximum_. #683, #180 (partial), moqx, slang-server
30 5d8a8355 fix(schema): cast char to unsigned char for std::isalnum and add missing includes in make_type_name.hpp Ready (extracted) +4/-1 (1f) 80 (est.) — Fixes sole remaining uncast std::isalnum(char) UB / MSVC Debug CRT assert and adds missing <cctype> / <string> includes. Extracted from discuss/ssot
31 68161ed0 feat(reflection): expose public rfl::StringLiteral header and constexpr helpers Ready (polished) +100/-59 (4f, net +41) 80 (26+23+23+8) — Promotes rfl::StringLiteral<N> to <rfl/StringLiteral.hpp> (preserving using rfl::StringLiteral; in rfl::internal), adds constexpr operator+, and adds zero-alloc rfl::Literal::name_view() for single-value literals. #451, #465, #688, #174, sqlgen (41 headers), moqx
32 698a6226 feat(json-schema): add rfl::VariantsAsOneOf opt-in processor (#375) Ready (polished) +121/-6 (8f) 74 (28+14+22+10) #4 Opt-in processor emitting oneOf for rfl::Variant / std::variant schemas via clean remove_variants_as_one_of_t (no post-hoc _definitions AST mutation). #375, moqx
33 c8405697 perf(parsing): add FieldNameLookup cursor-hint and binary-search field dispatch Ready (split 5/5 of #118) +229/-32 (3f) 72 (split) #25 Adds lambda-free FieldNameLookup<Literal<...>> (O(1) sequential cursor hint + RFL_COLD linear <=8 / constexpr-heapsort binary search >8) shared across wrappers & formats. #537, #675, #185 (partial), Wave 1 A/B
34 66486788 fix(schema): unwrap Type::Description and Type::Deprecated in Avro and Cap'n Proto helpers Ready (extracted) +31/-12 (3f) 72 (est.) — Unwraps Type::Description / Type::Deprecated in Avro is_named_type and Cap'n Proto is_named_type / is_literal_type (+ missing <type_traits>). Extracted from discuss/ssot
35 d7c8d1c8 feat(enums): add rfl::EnumNames<E> per-enum wire-name trait (#106) Ready (split 2/2 of #123) +183/-12 (3f) 71 (split) #26 (+ #17 on MSVC) Per-enum rfl::EnumNames<E> specialization (overrides + transform) and variadic rfl::get_enum_wire_names<E, Ps...>() for non-identifier / out-of-range wire names. #106, #148, cuda-quantum, moqx
36 abc8516e feat(json): add rfl::json::Raw for passthrough raw JSON values (#368) Ready (polished) +328/-0 (6f) 71 (post-polish) — JSON-only passthrough raw value (Raw::from_string validated default + explicit from_trusted_string, yyjson_val_write_opts errors, standard accessors, zero core edits). #368, slang-server, wolf

Per-Item Upstream-Ready Descriptions

Tier 1 — Top Slam Dunks (Scores 89+, including open upstream munich-data-engineering#800–munich-data-engineering#804)

1. d1f84224 — Fix dangling string_view in rfl::internal::get_type_name_str_view (Score 98, Open upstream #804)

  • Why: Upstream commit 433795b4 (v0.26.1) returned get_type_name_str_lit<T>().string_view(), which creates a dangling std::string_view into a destroyed temporary StringLiteral (UB under ASan/UBSan and broken in constexpr evaluation).
  • Fix: Route get_type_name_str_view<T>() directly to the static/compile-time cpp20::get_type_name_str_view<T>() / cpp26::get_type_name_str_view<T>() buffer (zero heap allocation, valid consteval lifetime).
  • Downstream: #145; NVIDIA/cuda-quantum calls rfl::internal::get_type_name_str_view<T>() directly. Upstream CI on #804: 176/176 green.

2. e5c60531 — Fix rfl::OneOf broken .and_then().or_else() composition (Score 95, Extracted)

  • Why: OneOf::validate_impl chained Head::validate(_value).and_then(...).or_else(...), which (1) rejected valid inputs whenever an earlier branch passed and the last branch failed (even printing "Expected exactly 1 out of 2 validations to pass, but 1 of them did"), (2) accepted invalid inputs when multiple branches passed, and (3) caused use-after-move on _errors and $O(2^N)$ re-evaluation.
  • Fix: Replace with a clean ~12-line imperative check in include/rfl/OneOf.hpp and expand tests/json/test_one_of.cpp to cover first-branch-passes, multiple-branches-pass, and zero-branches-pass.

3. 89c36611 — Reject uint64 > INT64_MAX instead of wrapping into signed integers (Score 93)

  • Why: rfl::json::Reader::to_basic_type<SignedInt> called yyjson_get_sint / cast unsigned yyjson integers without checking overflow, silently turning JSON values > INT64_MAX into negative signed integers.
  • Fix: Return an explicit rfl::Error when an unsigned JSON integer exceeds the target signed range (consistent with #746 / #617).
  • Downstream: Protects unsigned/signed config fields in slang-server and moqx.

4. b9dc1e93 — Emit oneOf for rfl::TaggedUnion in JSON Schema (Score 92, Refs #375)

  • Why: rfl::TaggedUnion alternatives carry disjoint discriminator literals, yet JSON Schema emitted anyOf instead of oneOf, weakening schema validation and OpenAPI codegen.
  • Fix: Mark Type::AnyOf::mutually_exclusive_ = true for ParserTaggedUnion::to_schema and emit schema::Type::OneOf in src/rfl/json/to_schema.cpp (only 19 prod LOC across 3 files).
  • Downstream: games-on-whales/wolf (RunnerTypes emitted as anyOf at 4 OpenAPI sites).

5. 07ef2b6e — Eliminate strict warnings in public headers (Score 92, Open upstream #803)

  • Why: Eliminates -Wextra (-Wmissing-field-initializers), -Wextra-semi, -Wsign-conversion, and -Wunused-parameter (using unnamed parameters per #582) across 14 headers.
  • Downstream: #140 (partial); corpus consumers either wrap reflect-cpp in -w / SYSTEM or disable warnings: slang-server, wolf, sqlgen, moqx, fanuc_driver.

6. 4879f7e2 — Gate <expected> include behind <version> feature test to avoid MSVC STL4038 (Score 92)

  • Why: Upstream #716 used bare #if __has_include(<expected>) in include/rfl/parsing/ParserExpected.hpp (transitively included by <rfl.hpp>) and tests/{generic,json}/test_expected.cpp. On MSVC /std:c++20, <expected> exists on disk so __has_include(<expected>) evaluates true and emits warning STL4038 ("The contents of <expected> are available only with C++23 or later.") on every translation unit, breaking /WX builds.
  • Fix: Include standard C++20 <version> (macro-only, zero runtime/compile-time overhead) and guard #include <expected> with #if defined(__cpp_lib_expected) && __cpp_lib_expected >= 202202L && __has_include(<expected>) across all 3 sites (+3/-1 prod LOC in 1 file). Unlike a raw __cplusplus >= 202302L check, this preserves C++23 std::expected on GCC 13 -std=c++23 (which defines __cplusplus == 202100L, per #570) and MSVC /std:c++latest / /std:c++23preview. Kept standalone from open upstream #803 per one-problem-per-PR.
  • Downstream: Caught directly in Windows MSVC 19.44 /std:c++20 battle-testing; addresses #140 (partial) for Windows strict-warning consumers.

7. d9ae7120 — Accept std::string_view in rfl::string_to_enum (Score 92, Open upstream #802, Closes #565)

  • Why: Eliminates heap allocation when parsing enums from std::string_view, replaces std::stoi with std::from_chars supporting full underlying integer widths, and serves as the clean foundation for #26 (TransformEnumNames).
  • Downstream: #150; NVIDIA/cuda-quantum, sqlgen.

8. b14e27d8 — Trim <functional>, <sstream>, and unused <map> from thin headers (Score 92)

  • Why: Removes heavy <functional>, <sstream>, and unused <map> includes from thin public headers (Result.hpp, Variant.hpp, enums.hpp, etc.), cutting ~40k preprocessed lines per TU while staying 100% CHECK_HEADERS self-contained.
  • Downstream: #185 (partial); every consumer TU including <rfl/Result.hpp> / <rfl/Variant.hpp> (e.g., slang-server/include/Config.h, sqlgen/include/sqlgen/Result.hpp). Directly serves maintainer compile-time priority (#641).

9. 6b4a388a — Guard rfl::yaml::Reader against recursive aliases & OOB literal marks (Score 91, Open upstream #801)

10. 489eba42 — Reject YAML negative-to-unsigned wraparound, narrow integer overflow, and uint64_t write wraparound (Score 91, ~93 post-polish)

  • Why: Upstream fixed narrow-integer truncation (#682 / #746) and negative-to-unsigned wraparound (#615 / #617) in rfl::json::Reader, leaving rfl::yaml::Reader parsing every integral via as<int64_t>() + unchecked static_cast<T> and rfl::yaml::Writer casting every integral via static_cast<int64_t>.
  • Fix & Judge polish applied: Dispatches signed vs. unsigned integrals in rfl::yaml::Reader::to_basic_type (matching json::Reader error messages and bounds checks, plus explicit static_cast<uint64_t> in the if constexpr comparison for MSVC /W4), AND fixes both rfl::yaml::Writer::insert_value overloads to emit unsigned integrals via static_cast<uint64_t>(_var) so uint64_t > INT64_MAX round-trips cleanly instead of emitting -1. Added full write_and_read round-trip, non-scalar, quoted-negative, and char/signed char/unsigned char tests in tests/yaml/test_integers.cpp.
  • Downstream: #161; openmoq/moqx explicitly comments "The YAML reader wraps a negative uint64_t; the resolver's upper bound rejects it" (ConfigResolver.cpp:1386-1390). Non-overlapping hunks with #9 (#801).

11. 79b12685 — Fix XML get_field_from_array index increment & write(_indent) forwarding (Score 89, Open upstream #800)

  • Why: Fixes two 1-line bugs in rfl::xml: get_field_from_array forgot to increment the iterator counter, and xml::write(const T&, std::ostream&, const std::string& _indent) dropped _indent.

12. 4e258590 — Use getenv_s and _dupenv_s under _MSC_VER in rfl::env::Reader (Score 89, Polished)

  • Why: include/rfl/env/Reader.hpp contained the only two std::getenv calls in include/ and src/, emitting MSVC C4996 / clang-cl -Wdeprecated-declarations on every Windows TU including <rfl/env.hpp> (80 public-header warnings across tests/env's 40 TUs; breaking /W4 /WX and -Werror consumers that do not define _CRT_SECURE_NO_WARNINGS). Matches existing same-module precedent (_putenv_s in src/rfl/env/Writer.cpp and gmtime_s in include/rfl/Timestamp.hpp).
  • Fix & Judge polish applied: Replaces std::getenv under #ifdef _MSC_VER (keeping MinGW on std::getenv) with zero-allocation ::getenv_s in has_env_var and ::_dupenv_s + std::free in get_value (zero <memory> header bloat). Judge polishes applied: added #include <cstddef> + std::size_t for strict self-containment, added defensive if (_name == nullptr || *_name == '\0') return false; guard in has_env_var, and reconciled commit/PR description to accurately report 80 public-header warnings fixed (leaving 48 test-only std::getenv calls in tests/env/ untouched to keep the PR 1-file minimal).
  • Downstream: Caught in Windows clang-cl 19.1.5 & MSVC 19.44 battle-testing; addresses #140 (partial).
Tier 2 — High-Confidence Fixes, Compliance Docs, Features, and Compile-Time Wins (Scores 83–88)

13. c7aa574c — Return error on non-scalar YAML mapping keys instead of silently skipping (Score 88, Polished)

  • Parent: #9 (6b4a388a — open upstream #801 in rfl::yaml::Reader::read_object).
  • Why: rfl::yaml::Reader::read_object wrapped p.first.as<std::string>() and _object_reader.read(...) in catch (std::exception& e) { continue; } (a vestige from pre-v0.8 non-Error signatures), silently dropping sequence/map/collection-alias mapping keys in maps/rfl::Generic and bypassing rfl::NoExtraFields.
  • Judge polish applied: Moved IsScalar()/IsNull() checks inside try (guarding noexcept read_object from YAML::InvalidNode), passed zero-copy std::string_view directly from p.first.Scalar() (or "null" for null/~/: val), moved _object_reader.read(...) outside try (matching all other readers and preserving ViewReaderWithDefault noexcept invariants), fixed *s : alias syntax in tests/yaml/test_non_scalar_keys.cpp with explicit "scalar" message assertions, and added NoExtraFields, empty-key, map-alias, and scalar-alias tests.
  • Downstream: #160 (standalone non-scalar bugfix; NoDuplicateKeys remains parked on discuss/ssot); openmoq/moqx (LoaderTest.cpp:542-650).

14. 970f78f0 — Prevent std::terminate() at noexcept validation, map-key, and default boundaries (Score 88, Extracted)

  • Why: AllOf::validate was noexcept with zero try/catch (a throwing custom validator worked in Validator<T, V> but called std::terminate() in Validator<T, V1, V2>). Also switches MapReader Validator keys to non-throwing KeyType::from_value() and adds catch (...) across Validator, MapReader, TupleReader, Parser_default, ParserTimePoint, and Timestamp (following #674).

15. f49d6c8d — Capture input keys matching ExtraFields member name (Score 88, Split 1/5 of parser-symbol-isolation)

  • Why: ViewReader and ViewReaderWithDefault matched incoming keys against ViewType::Fields without excluding ViewType::pos_extra_fields(), so an input key literally named "extra_fields" (matching the C++ member name) failed to be routed into ExtraFields.
  • Scope: Standalone 13-line bugfix using constrained requires(i != ViewType::pos_extra_fields()) overloads on assign_if_field_matches<i> (zero capture-lambda wrapper, empirically verified 0-byte compile_stress_wide.cpp.o overhead on Clang 23 Release) + tests/json/test_extra_fields_key_collision.cpp. Parent of #25.

16. d8892d9c — Add THIRD_PARTY_NOTICES.md for vendored dependencies (Score 87, Polished)

  • Why: reflect-cpp vendors yyjson (MIT), CTRE (Apache-2.0 WITH LLVM-exception), and enchantum (MIT) under include/rfl/thirdparty/ and src/yyjson.c without a consolidated license notice manifest, forcing enterprise redistributors to scrape embedded headers and CMakeLists.txt manually.
  • Judge polish applied: Added verbatim Copyright (c) 2025 ZXShady above enchantum's MIT text (verified against upstream LICENSE), standardized CTRE version to 3.10.0 (matching vcpkg.json & upstream v3.10.0), explicitly documented that <rfl.hpp> / format umbrella headers / PCH unconditionally include PatternValidator.hpp (CTRE), and tightened REFLECTCPP_USE_BUNDLED_DEPENDENCIES / BUILD_INTERFACE / __has_include / REFLECTCPP_INSTALL accuracy against CMakeLists.txt.
  • Downstream: #144; NVIDIA/cuda-quantum (NOTICE:275-321), nvidia-holoscan/holoscan-sdk.

17. ff639f32 — Backport enchantum MSVC 64-bit enum cast suffix fix (Score 86, Polished)

  • Why: On Windows MSVC, __FUNCSIG__ formats an out-of-enumerator zero cast of an 8-byte enum (int64_t/uint64_t) as (enum T)0x00 (5-byte suffix) rather than (enum T)0x0 (4-byte suffix). In vendored include/rfl/thirdparty/enchantum/details/enchantum_msvc.hpp, removing only 4 bytes left a trailing ) on the computed type prefix and silently stripped the first character of every enumerator name on any 64-bit enum lacking a 0 enumerator (e.g., WideWireEnum::small_val -> "mall_val").
  • Fix & Maintainer-policy framing (#669): Verbatim 2-line backport of upstream ZXShady/enchantum@66acc35f ("Fix 64 bit msvc parsing"). Unlike a divergent local patch, this eliminates divergence between vendored enchantum (pre-0.5.0 from #441) and external vcpkg/Conan enchantum >= 0.5.0 (#762), follows surgical enchantum precedent (#519), avoids the 22-file churn of a full vendor refresh, and drops away cleanly on the next vendor bump. Ordered before #26 / #35 (#106) so #106 stays free of thirdparty/ diffs; leaves THIRD_PARTY_NOTICES.md untouched (100% independent of #16).
  • Judge polish applied: Replaced unchecked *rfl::string_to_enum<...>() dereferences in tests/generic/test_enum.cpp (violated #463) with checked ASSERT_TRUE(res.has_value()) << res.error().what(); EXPECT_EQ(*res, ...); assertions and added unscoped 64-bit non-zero enums (UnscopedSigned64NoZero, UnscopedUnsigned64NoZero) so both scoped and unscoped patched branches in enchantum_msvc.hpp are tested in Windows MSVC CI.
  • Downstream: Caught in Windows MSVC 19.44 battle-testing under default REFLECTCPP_USE_BUNDLED_DEPENDENCIES=ON (WideWireEnum::small_val -> "mall-val").

18. 04495b88 — Flatten nested anyOf for optional variants and rfl::Generic (Score 86, Polished)

  • Why: std::optional<rfl::Variant<...>> and rfl::Generic currently emit double-nested {"anyOf":[{"anyOf":[...]},{"type":"null"}]}. Flattening inside src/rfl/json/to_schema.cpp (only 23 prod LOC) keeps parsing::schema::Type untouched.
  • Judge polish applied: Uses a structured-binding has_annotations(schema::Type::Annotations) helper so any future annotation field triggers a compile error if unchecked.
  • Downstream: #180 (partial); moqx/config.schema.json:510-557, slang-server/include/lsp/LspTypes.h:3892-3969.

19. b9081d02 — Add rfl::cli::usage to generate usage and help text (Score 86, Refs #692)

  • Why: Explicitly invited by maintainer on #692 ("A PR is very welcome!"). Builds directly on merged #790/#798 CLI option-table helpers.
  • Judge polish applied: Preserved cv-qualifiers in add_usage_field_meta, guarded path_separator on root std::map schemas, replaced unused processed_t.hpp with direct to_generic.hpp.

20. fc9f041d — Add first-class rfl::json read and write flag constants (Score 85)

  • Why: Extends existing rfl::json::pretty (#63, cited positively by maintainer on #651; flag passing to read() endorsed on #404 / merged in #425) with version-guarded inline constexpr read_* and write_* constants.
  • Downstream: #169; slang-server currently mixes rfl::json::pretty | YYJSON_WRITE_PRETTY_TWO_SPACES and uses raw YYJSON_* macros across 10 call sites in 6 files (Config.cpp:21, Logging.h:30-31, SlangServer.cpp:929-984).

21. 54c89d2d — Isolate per-field helpers in NamedTupleParser, destructors, and flatten (Score 85, Split 2/5 of parser-symbol-isolation)

  • Why: Lifts per-field serialization, schema building, missing-field handling, and destructor helpers out of NamedTupleParser<..., FieldTypes...> into free function templates parameterized only on each field's type (never the enclosing NamedTuple pack), and skips destructor calls on trivially destructible fields/arrays. Zero public API change. Parent of #28. Addresses #185 (partial).
  • Benchmarks (combined Wave 1 N=3 interleaved medians vs main): slang-server SlangServer.cpp Debug -6.1% wall / -15.0% .o (Clang), -9.6% .o (GCC); moqx Loader.cpp Debug -4.4% wall / -17.5% .o (Clang); fanuc-libs serialization.cpp Debug -9.9% wall / -27.1% .o (Clang); wolf unix_socket_server.cpp Release -19.4% .o (Clang).

22. a2d46af1 — Add apply_to_fields and avoid NamedTuple in HasDefaultVal (Score 84, Polished)

  • Why: Zero-API internal building block (rfl::internal::apply_to_fields) avoiding redundant named_tuple_t<T> + field_names_t<T> + value NamedTuple instantiations inside HasDefaultVal<T> on every reflected aggregate. Addresses #185 (partial).
  • Judge polish applied: Qualified calls against ADL, added !is_named_tuple_spec<T>::value guard, stripped single pointer indirection in HasDefaultVal<NamedTuple<...>>, and renamed internal helper to has_default_val_field.

23. dc6fcc62 — Preserve structured Error::details() paths in FieldVariantReader and ParserTaggedUnion (Score 84, Extracted)

  • Why: Direct follow-up to merged #766: FieldVariantReader::try_one discarded nested details by constructing a fresh Error(stream.str()) instead of calling wrap_error, and ParserTaggedUnion omitted the discriminator path segment on missing/non-string/unknown discriminator errors. Preserves Error::what() byte-for-byte.

24. 76da80df — Use $O(\log N)$ exponential + binary search in cpp20::num_fields (Score 83)

Tier 3 — Split Follow-Ups, Processors, and Additive Features (Scores 65–83)

25. 0ac0ee21 — Isolate per-field helpers in ViewReader and ViewReaderWithDefault (Score 83, Split 3/5 of parser-symbol-isolation)

  • Parent: #15 (f49d6c8d — fix(parsing): capture input keys matching ExtraFields member name). Parent of #33.
  • Why: Lifts per-field parsing, placement-move, move-assign, error-recording, and extra-field helpers out of ViewReader<..., ViewType, ...> and ViewReaderWithDefault<..., ViewType, ...> while keeping lambda-free linear field-name dispatch (size_ == 0 guard in read(), <= 4 inline, > 4 out-of-line, plain bool matched with zero out-of-line capture lambdas) and zero [[maybe_unused]] annotations (per #582). Addresses #185 (partial).

26. 9a5ee9b4 — Add rfl::TransformEnumNames processors (Score 83, Split 1/2 of enum-names, Refs #731)

  • Parent: #7 (d9ae7120 — open upstream #802 string_to_enum(std::string_view)). Parent of #35.
  • Why: Maintainer's stated instinct on #731 ("My first instinct would be a processor"). Adds opt-in rfl::TransformEnumNames<...> + aliases (EnumSnakeCaseToKebabCase, EnumSnakeCaseToCamelCase, EnumSnakeCaseToPascalCase, EnumCamelCaseToSnakeCase, EnumToLowerCase, EnumToUpperCase) across read, write, enum_to_string, string_to_enum, and JSON Schema.
  • Judge polish applied: Out-of-line RFL_API apply_enum_name_transform in src/rfl/TransformEnumNames.cpp (wired via src/reflectcpp.cpp), dedicated include/rfl/internal/enum_name_transform_v.hpp, added EnumCamelCaseToSnakeCase, variadic class... Ps, guarded enum_descriptions so untransformed enums allocate nothing.
  • Downstream: #148; solves 4 OSS consumers immediately — NVIDIA/cuda-quantum, moqx, sqlgen, wolf.

27. 950382b1 — Add public rfl::type_name<T>() and rfl::type_name_v<T> (Score 82, Polished)

  • Parent: #1 (d1f84224 — open upstream #804 fixing dangling get_type_name_str_view).
  • Why: Exposes zero-allocation consteval std::string_view rfl::type_name<T>() / type_name_v<T> in <rfl/type_name.hpp>. Dropped redundant num_fields_v<T> per judge feedback (public rfl::num_fields<T> already exists via #465).
  • Downstream: #145; NVIDIA/cuda-quantum ("Unfortunately, this has to use a private API of reflect-cpp"), sqlgen, wolf.

28. 8bc0da9a — Fast-path scalar defaults in NamedTupleParser::to_schema (Score 82, Split 4/5 of parser-symbol-isolation)

  • Parent: #21 (54c89d2d — perf(parsing): isolate per-field helpers in NamedTupleParser, destructors, and flatten).
  • Why: Avoids instantiating rfl::generic::Writer / rfl::to_generic<ProcessorsType> for scalar and std::optional<Scalar> DefaultVal schema defaults (dropped consumer-specific std::vector<std::string> special case per judge review). Addresses #185 (partial).

29. 8bb958f2 — Add rfl::IntegerBounds opt-in processor (Score 80, Polished, Refs #683)

  • Why: Maintainer endorsed opt-in processor on #683. Emits minimum/maximum JSON Schema bounds for fixed-width integers while excluding platform-dependent char types.
  • Judge polish applied: Replaced rfl::Variant<int64_t, uint64_t> with std::uint64_t maximum_, added std::remove_cvref_t + sizeof <= int64_t guard, std::-qualified fixed-width types, documented in docs/content/processors.md, added DefaultVal<Description<..., uint16_t>> test.
  • Downstream: #180 (partial); moqx, slang-server, wolf.

30. 5d8a8355 — Cast char to unsigned char for std::isalnum in make_type_name.hpp (Score 80, Extracted)

  • Why: Fixes the sole remaining uncast <cctype> call in include/ / src/ (UB on negative char / MSVC Debug CRT assertion) and adds missing <cctype> and <string> includes for header self-containment.

31. 68161ed0 — Expose public rfl::StringLiteral header and constexpr helpers (Score 80, Polished)

  • Why: StringLiteral is already part of reflect-cpp's public template signature surface (rfl::Field, rfl::Literal, rfl::Rename, rfl::Description, rfl::Timestamp, rfl::Pattern), forcing downstream wrapper libraries and partial specializations to reach into <rfl/internal/StringLiteral.hpp> and rfl::internal::StringLiteral. Follows #451 / #465 thin public header precedent while preserving the Clang 21/22 C++26 workaround (#688) and 100% backwards compatibility via using rfl::StringLiteral; in rfl::internal. Also adds constexpr operator+ concatenation and zero-allocation static constexpr std::string_view rfl::Literal::name_view() noexcept (backed by static-storage LiteralHelper<_name>::name_).
  • Judge polish applied: Added static_assert(N >= 1) and requires(N1 >= 1 && N2 >= 1) on operator+ (preventing N == 0 underflow), clamped StringLiteral(std::string_view) copy length to std::min(_str.size(), N - 1) and operator+ second copy to N2 - 1 (preserving the #445/#538 null-termination invariant), switched to std::size_t, added Doxygen docstring on operator+, corrected title (constexpr vs consteval), and expanded tests/json/test_string_literal.cpp for clamping and null-termination.
  • Downstream: #174; munich-data-engineering/sqlgen (still references rfl::internal::StringLiteral in 41 headers + custom GetNameFromLiteral even after sqlgen#144), openmoq/moqx (hand-rolled str_concat for rfl::Description). Verified 96/96 PASS on sqlgen (Clang 23 & GCC 13).

32. 698a6226 — Add rfl::VariantsAsOneOf opt-in processor (Score 74, Polished, Refs #375)

  • Parent: #4 (b9dc1e93 — feat(json-schema): emit oneOf for rfl::TaggedUnion in JSON Schema (#375)).
  • Why: Opt-in counterpart to #4 for untagged rfl::Variant / std::variant schemas.
  • Judge polish applied: Replaced post-hoc _definitions AST mutation with clean remove_variants_as_one_of_t<ProcessorsType> when lowering rfl::Generic (keeping rfl::Generic as anyOf), added direct header includes, and added multi-processor composition tests.
  • Downstream: moqx (5 mutually-exclusive object rfl::Variants emitted as anyOf in config.schema.json:1188-1203, 1977-2001).

33. c8405697 — Add FieldNameLookup cursor-hint and binary-search field dispatch (Score 72, Split 5/5 of parser-symbol-isolation)

  • Parent: #25 (0ac0ee21 — perf(parsing): isolate per-field helpers in ViewReader and ViewReaderWithDefault).
  • Why: Keyed solely on ViewType::Names (rfl::Literal<...>), FieldNameLookup shares one lookup table across wrappers and formats, hits $O(1)$ via sequential cursor hint when keys arrive in declaration order, and falls back (RFL_COLD) to linear scan (<= 8) or constexpr-heapsorted binary search (> 8). Uses plain bool matched dispatch (zero out-of-line try_assign capture lambdas) and explicit FieldNameLookup<Literal<>> specialization with zero [[maybe_unused]] annotations. Addresses #185 (partial).
  • Verified compile-time & runtime benchmarks vs origin/main:
    • Synthetic wide structs (compile_stress_wide.cpp, 32/64/128 fields): Clang Release -74.94% .o (4.44M -> 1.11M) / -12.29% RSS / -20.0% wall; Clang Debug -17.0% wall / -14.9% RSS / -32.4% .o; GCC Debug -9.2% wall / -26.2% .o; GCC Release -7.7% wall / -31.4% .o.
    • Real OSS targets: slang-server SlangServer.cpp -6.1% wall / -15.0% .o (Clang Debug), -8.6% wall / -8.0% RSS (GCC Release), Config.cpp -46.1% .o (Clang Release); moqx Loader.cpp -17.5% .o (Clang Debug), -5.4% wall (GCC Release); fanuc-libs serialization.cpp -9.9% wall / -27.1% .o (Clang Debug); wolf unix_socket_server.cpp -19.4% .o (Clang Release).
    • Runtime (quiet-period Release vs origin/main, 0 out-of-line dispatch lambdas):
      • Clang 23 (best-of-5): Record2 +10.15%, Record2, true +2.52%, citm_read +4.54%, BM_person_read -0.24%.
      • GCC 13 (N=3 medians): Record2 +22.76%, Record2, true +18.56%, Record16 +14.20%, BM_licenses -12.01%, BM_person_read -0.25%.

34. 66486788 — Unwrap Type::Description and Type::Deprecated in Avro and Cap'n Proto helpers (Score 72, Extracted)

  • Why: Custom types with ReflectionType / Reflector<T>::ReflType wrapped in rfl::Description or rfl::Deprecated store Type::Description / Type::Deprecated directly in _definitions[name]. Unwrapping them in avro::is_named_type, capnproto::is_named_type (also adding missing <type_traits>), and capnproto::is_literal_type prevents anonymous unnamed_N records in Avro and invalid generic Map(Enum) in Cap'n Proto.

35. d7c8d1c8 — Add rfl::EnumNames<E> per-enum wire-name trait (Score 71, Split 2/2 of enum-names, Refs #106)

  • Parent: #26 (9a5ee9b4 — feat(enums): add rfl::TransformEnumNames processors (#731)). (Also relies on #17 ff639f32 on Windows MSVC default bundled builds for 64-bit non-zero enums.)
  • Why: Handles non-identifier wire strings ("c++20", "nvq++", "*"), C++ keyword collisions, and enumerators outside the default reflected range via opt-in rfl::EnumNames<E> (overrides + transform) and variadic rfl::get_enum_wire_names<E, Ps...>(). Throwing custom transforms return rfl::Error in both ParserEnum::read and public rfl::string_to_enum.
  • Open review question to surface upstream: Whether the specialization trait should live at rfl::EnumNames<E> (matching rfl::Reflector<T>) or rfl::config::enum_names<E> (matching rfl::config::enum_range<E> / enum_descriptions<E>).
  • Downstream: #148; NVIDIA/cuda-quantum, moqx/src/auth/Action.h.

36. abc8516e — Add rfl::json::Raw for passthrough raw JSON values (Score 71 post-polish, Refs #368)

  • Why: Passes JSON subtrees through read/write without materializing rfl::Generic C++ ASTs or modifying any core parser header (out-of-line RFL_API in src/rfl/json/Raw.cpp, Generic bridge for DefaultVal / to_schema, compile-time static_assert on unsupported formats).
  • Judge polish applied: Made unchecked string constructors private (Raw::from_string strict RFC 8259 validated default + explicit Raw::from_trusted_string opt-in); added const-only get()/operator*()/operator()(); switched from_json_obj to yyjson_val_write_opts(..., &err) for descriptive errors; handled moved-from/empty Raw::to_generic(); updated static_assert message to mention rfl::Generic.
  • Downstream: slang-server (double-reflecting JSON-RPC params through rfl::Generic), wolf (escaped JSON string + openapi.cpp:17-69).

Items Parked on discuss/ssot (Below < 65 Cutline)

None of these belong in upstream-queue without upstream maintainer design sign-off; they remain preserved and cleanly restacked on top of upstream-queue on discuss/ssot:

Item Score Why Parked on discuss/ssot
rfl::DefaultTag<Discriminator, Tag> 60 No upstream issue; #455 precedent preferred std::variant<TaggedUnion<...>, Fallback>; global discriminator collision & cli/env/msgpack contract gaps.
rfl::Int64AsString 58 Design questions: processor-wide vs per-field wrapper, strict bare-number rejection, LP64 vs LLP64 sizeof(long) >= 8 portability trap, validator schema interaction.
rfl::NoDuplicateKeys 55 No upstream issue; 77-line hand-rolled FNV-1a table in json/Reader.hpp, unapproved Reader-vs-ObjectReader contract, toml++ mismatch. (Standalone YAML non-scalar key bugfix from #160 extracted into #13.)
rfl::AddNullFields 52 Overlaps existing rfl::NoOptionals (write-side explicit nulls) and rfl::Nullable<T>; undocumented in processors.md.
rfl::ErrorKind + Error::code() 50 / 45 41 + 18 files, enum taxonomy & 28 hardcoded wire codes, implicit static V::code opt-in, changes ErrorDetail::operator==. (Standalone OneOf, noexcept, and Error::details() bugfixes extracted into #2, #14, #23.)
<rfl/nlohmann.hpp> 50 Second JSON backend adding third-party dependency across CMake/vcpkg/Conan/CI matrices.
rfl::MaxDepth<N> 50 thread_local global counter (DLL/coroutine/nested-read hazards), NTTP template bloat, silent non-enforcement on recursive 3P parsers (yaml-cpp, pugixml, toml++).
rfl::Metadata<T> + SchemaName<T> / SchemaExtension<T> 45 / 40 Three out-of-band specialization traits, silent typo misses, new shared schema IR node (Annotated), ExtraFields on every JSON schema subtype. (Standalone isalnum UB & Avro/Cap'n Proto unwrap bugfixes extracted into #30, #34.)
rfl::Alias 45 31 files across case-transform processors & C++20/C++26 reflection; wrapper vs trait/processor design needs sign-off.
DefaultIfMissing schema defaults (#396) 41 Maintainer flagged #396 as "tricky" and suggested rfl::Generic on #680; 971-LOC dual wrapper-walking traits + breaking output change on DefaultIfMissing.
rfl::Nullable<T> / rfl::TriState<T> 40 435-LOC new vocabulary wrappers overlapping std::optional / NoOptionals / AddNullFields.
rfl::DefaultIfNull (#796) 33 Zero maintainer comments on #796, 19 prod files, 3rd wrapper-walking trait (is_nullable.hpp), #786-class sibling-field behavior cliff.
is_safe_default_constructible 32 481-line zero-caller wrapper walker + 10 public wrapper default-ctor template rewrites.

Verification

  • upstream-queue (abc8516e):
    • Clang 23.1.6 (-DREFLECTCPP_STRICT_WARNINGS=ON, -DREFLECTCPP_JSON=ON, -DREFLECTCPP_YAML=ON, -DREFLECTCPP_BUILD_TESTS=ON): 0 warnings, 772/772 passed (1 locale test skipped; includes new generic.test_enum_64bit_nonzero).
    • GCC 13.4.0 (-DREFLECTCPP_STRICT_WARNINGS=ON, -DREFLECTCPP_JSON=ON, -DREFLECTCPP_YAML=ON, -DREFLECTCPP_BUILD_TESTS=ON): 0 warnings, 772/772 passed (1 locale test skipped; includes new generic.test_enum_64bit_nonzero).
    • Standalone header self-containment & C++20/C++23 macro gating: ParserExpected.hpp, env/Reader.hpp, and enchantum.hpp verified on both Clang 23 and GCC 13 in both -std=c++20 and -std=c++23 (-Wall -Wextra -Wextra-semi -Werror, EXPECTED_INACTIVE in C++20 / EXPECTED_ACTIVE in C++23); GCC 13 -std=c++23 tests/{generic,json}/test_expected.cpp passed 7/7, 0 warnings (__cplusplus == 202100L preserved).
    • Standalone Rank #15 (f49d6c8d): test_extra_fields_key_collision passes on Clang 23 & GCC 13 (-Wall -Wextra -Wextra-semi -Werror); 0-byte compile_stress_wide.cpp.o delta vs #14 (4,419,640 B == 4,419,640 B) and 0 assign_to_matching lambdas.
    • Downstream sqlgen compatibility (rfl::internal::StringLiteral forwarding across 41 headers): 96/96 passed on both Clang 23.1.6 and GCC 13.4.0.
  • discuss/ssot (0eede77c, restacked cleanly on top of upstream-queue):
    • Clang 23.1.6 (-DREFLECTCPP_STRICT_WARNINGS=ON, -DREFLECTCPP_JSON=ON, -DREFLECTCPP_YAML=ON): 0 warnings, 877/877 passed (1 locale test skipped).
    • GCC 13.4.0 (-DREFLECTCPP_STRICT_WARNINGS=ON, -DREFLECTCPP_JSON=ON, -DREFLECTCPP_YAML=ON): 0 warnings, 877/877 passed (1 locale test skipped).

This was referenced Nov 29, 2026
@clockblocker clockblocker changed the title Upstream PR Queue (29 PRs, sorted by mergeability score 98 → 71) Upstream PR Queue (sorted by mergeability score) Nov 29, 2026
@clockblocker
clockblocker force-pushed the upstream-queue branch 2 times, most recently from b974204 to fcf8d4e Compare November 29, 2026 15:25
…name_str_view

Fixes a v0.26.1 regression (433795b) where `rfl::internal::get_type_name_str_view<T>()`
returned a `std::string_view` pointing into a destroyed temporary `StringLiteral<N>`,
failing constant evaluation on every call. Dispatches directly to
`cpp20::get_type_name_str_view<T>()` and `cpp26::get_type_name_str_view<T>()`.

Upstream PR: munich-data-engineering#804 (176/176 CI green)
Downstream receipts:
- NVIDIA/cuda-quantum calls `rfl::internal::get_type_name_str_view<T>()` in a constexpr
  context: https://github.com/NVIDIA/cuda-quantum/blob/81ef20d9d4a1e0912a6dbc68637ece017e8fd324/cudaq/lib/Target/Reflection.h#L27-L31
- munich-data-engineering/sqlgen carries its own copy to avoid the dangling view:
  https://github.com/munich-data-engineering/sqlgen/blob/265b0a174b661c5905b874f97b064aecb4cded70/include/sqlgen/internal/get_type_name.hpp#L13-L44
Replaces the chained `.and_then(...).or_else(...)` recursion in
`rfl::OneOf::validate_impl` with an explicit check so each branch is evaluated
exactly once.

Previously:
1. When any non-last branch passed and a later branch failed, the inner error
   fell into the outer `.or_else()` handler, rejecting valid values (even
   printing "Expected exactly 1 out of 2 validations to pass, but 1 of them did").
2. When multiple branches passed simultaneously, the terminal failure fell into
   the outer `.or_else()`, appending to a moved-from `_errors` vector and
   wrongly accepting invalid inputs.
3. Passing `std::move(_errors)` into `.and_then()` and then mutating `_errors`
   in `.or_else()` caused use-after-move and O(2^N) re-evaluation.

Also removes a stray inline review comment left in `OneOf.hpp` and adds
regression tests for first-branch match, multi-branch overlap, and zero-branch
failure in `tests/json/test_one_of.cpp`.
…o signed integers

In yyjson, non-negative integers in [0, UINT64_MAX] have subtype
`YYJSON_SUBTYPE_UINT` (`uni.u64`), yet `yyjson_is_int()` matches both `UINT`
and `SINT` and `yyjson_get_sint()` reads `uni.i64` directly. Values in
`(INT64_MAX, UINT64_MAX]` therefore read an inactive union member and silently
wrapped to negative `int64_t` (e.g. `UINT64_MAX` became `-1`), bypassing the
narrow integer range check added in munich-data-engineering#746 and corrupting `rfl::Generic`.

Check `yyjson_is_uint()` first with an unsigned upper-bound comparison against
`std::numeric_limits<Target>::max()` before checking `yyjson_is_sint()`.

Follow-up to: munich-data-engineering#746
Downstream context: mixed signed/unsigned 64-bit JSON schemas in
- hudson-trading/slang-server: https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/include/Config.h#L59-L60
- openmoq/moqx: https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/src/config/loader/ParsedConfig.h
…nich-data-engineering#375)

Alternatives of an `rfl::TaggedUnion` carry mutually exclusive discriminator
tags, so a valid document can match at most one branch. Marks the internal
`schema::Type::AnyOf` node with a defaulted `mutually_exclusive_ = false` flag
and emits `oneOf` in `src/rfl/json/to_schema.cpp` for `rfl::TaggedUnion`
(including under `rfl::AddTagsToVariants`). Untagged `rfl::Variant`,
`std::variant`, `std::optional`, Avro, and Cap'n Proto schemas remain unchanged.

Refs: munich-data-engineering#375
(Maintainer: "you are right that oneOf is more accurate. We should change it.")
Downstream receipt:
- games-on-whales/wolf defines `RunnerTypes = rfl::TaggedUnion<"type", AppCMD, AppDocker>`
  (https://github.com/games-on-whales/wolf/blob/ac2461f68feda41fdc7a7c8e812b9ab4b80520b7/src/moonlight-server/events/events.hpp#L46)
  and its committed OpenAPI 3.1 spec currently emits inaccurate `anyOf` at 4 sites:
  https://github.com/games-on-whales/wolf/blob/ac2461f68feda41fdc7a7c8e812b9ab4b80520b7/docs/modules/dev/partials/spec.json#L939-L948
… -Wunused-parameter warnings

Cleans compiler warnings across 14 public headers (+22/-18 LOC) using unnamed
unused parameters (matching munich-data-engineering#582) with zero API or behavioral changes so
consumers building with strict flags (`-Wall -Wextra -Werror -pedantic
-Wconversion -Wsign-conversion -Wextra-semi`) get clean builds.

Upstream PR: munich-data-engineering#803
Downstream receipts:
- hudson-trading/slang-server suppresses reflect-cpp warnings in 4 places:
  https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/CMakeLists.txt#L317-L321
- games-on-whales/wolf wraps FetchContent(reflect-cpp) with `add_compile_options(-w)`:
  https://github.com/games-on-whales/wolf/blob/ac2461f68feda41fdc7a7c8e812b9ab4b80520b7/src/moonlight-server/CMakeLists.txt#L38-L45
- munich-data-engineering/sqlgen, openmoq/moqx, and FANUC-CORPORATION/fanuc_driver
  all compile with `-Wall -Wextra -Wpedantic`.
…o avoid MSVC STL4038

On MSVC in C++20 mode (/std:c++20), <expected> exists on disk so bare
`#if __has_include(<expected>)` evaluates true and emits warning
STL4038 ("The contents of <expected> are available only with C++23 or
later.") on every translation unit.

Include the C++20 standard <version> header and check
`defined(__cpp_lib_expected) && __cpp_lib_expected >= 202202L` before
including <expected>. Unlike a raw `__cplusplus >= 202302L` check,
this avoids STL4038 under MSVC C++20 while still enabling std::expected
on GCC 13 -std=c++23 (which defines __cplusplus == 202100L) and MSVC
/std:c++latest / /std:c++23preview.
…ata-engineering#565)

Updates `rfl::string_to_enum` and `rfl::internal::enums::from_string` (C++20
and C++26) to accept `std::string_view` instead of `const std::string&`,
replaces the exception-throwing `std::stoi` numeric fallback with allocation-free
`std::from_chars` enforcing full-string consumption, and drops unused `<sstream>`.

Upstream PR: munich-data-engineering#802
Closes: munich-data-engineering#565
Downstream receipts:
- NVIDIA/cuda-quantum hand-loops `rfl::get_enumerator_array<E>()` just to parse
  a `std::string_view`:
  https://github.com/NVIDIA/cuda-quantum/blob/81ef20d9d4a1e0912a6dbc68637ece017e8fd324/cudaq/lib/Target/Reflection.h#L61-L65
- munich-data-engineering/sqlgen calls `rfl::string_to_enum` directly:
  https://github.com/munich-data-engineering/sqlgen/blob/265b0a174b661c5905b874f97b064aecb4cded70/include/sqlgen/parsing/Parser_default.hpp#L52-L57
…in headers

Cuts ~40k preprocessed lines (~350 ms cold compile time per TU) from thin
schema/wrapper headers without any public API changes:
- Remove `<functional>` from `include/rfl/internal/cpp20/Result.hpp`.
- Remove `<sstream>` from `comparisons.hpp`, `AnyOf.hpp`, `OneOf.hpp`, and
  `PatternValidator.hpp` (using `std::snprintf` / `std::to_string`; note that
  `signed char`/`unsigned char` (`int8_t`/`uint8_t`) comparison errors now
  format as decimal integers rather than raw ASCII characters, while plain
  `char` stays formatted as a character).
- Remove unused `<map>` from `include/rfl/Size.hpp` and add explicit `<cstddef>`.

Downstream receipts:
- hudson-trading/slang-server intentionally isolates thin rfl headers in
  `include/Config.h` (included across 13 TUs without `<rfl/json.hpp>`):
  https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/include/Config.h#L9-L16
- munich-data-engineering/sqlgen includes thin headers like `<rfl/Result.hpp>`
  and `<rfl/PatternValidator.hpp>`:
  https://github.com/munich-data-engineering/sqlgen/blob/265b0a174b661c5905b874f97b064aecb4cded70/include/sqlgen/Result.hpp
…of-bounds literal marks

Tracks active ancestor YAML nodes via a thread-local RAII guard across
`read_object` and `read_array` so cyclic YAML aliases return an `rfl::Error`
instead of overflowing the stack (while preserving non-cyclic DAG aliases and
`const Reader` thread safety), and bounds-checks `YAML::Mark::pos` before
indexing `_yaml_str`.

Upstream PR: munich-data-engineering#801
Downstream receipts:
- openmoq/moqx explicitly documents self-referencing YAML alias infinite
  recursion and tests adversarial cyclic YAML configs:
  https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/src/config/YamlDuplicateKeys.cpp#L23-L24
  https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/test/config/LoaderTest.cpp#L605-L625
- FANUC-CORPORATION/fanuc_driver parses YAML configs via `rfl::yaml::load`:
  https://github.com/FANUC-CORPORATION/fanuc_driver/blob/da5db3f611cdc9dffe687e056c4e79bea584bf5c/fanuc_libs/gpio_config/src/gpio_config.cpp#L18
…rflow, and uint64_t write wraparound

`rfl::yaml::Reader::to_basic_type` previously parsed every integral type
via `node.as<int64_t>()` followed by an unchecked `static_cast<T>`, and
`rfl::yaml::Writer::insert_value` cast every integral type via
`static_cast<int64_t>(_var)`, causing four bugs:
1. Negative YAML values silently wrapped into unsigned integers (e.g. `-1`
   became `UINT64_MAX` / `255`).
2. Out-of-range values silently truncated when narrowed into `int8_t`,
   `uint8_t`, `int16_t`, `uint16_t`, `int32_t`, or `uint32_t`.
3. Valid `uint64_t` values above `INT64_MAX` (up to `UINT64_MAX`) failed
   `as<int64_t>()` on read.
4. Writing `uint64_t` values above `INT64_MAX` wrapped to negative YAML
   scalars (e.g. `UINT64_MAX` emitted `-1`), breaking round-trips once the
   reader rejects negative-to-unsigned wraparound.

Bring `rfl::yaml::Reader` and `rfl::yaml::Writer` into parity with
`rfl::json` (following munich-data-engineering#746):
- In `rfl::yaml::Reader::to_basic_type`, dispatch unsigned and signed
  integral targets separately: verify `IsScalar()`, reject leading `'-'`
  for unsigned targets, parse via `as<uint64_t>()` / `as<int64_t>()`, and
  range-check against `std::numeric_limits<Target>`.
- In both `rfl::yaml::Writer::insert_value` overloads, emit unsigned
  integrals via `static_cast<uint64_t>(_var)`.

Eliminates a documented downstream workaround in `openmoq/moqx`
(`test/config/LoaderTest.cpp:331-359`, `src/config/ConfigResolver.cpp:1386-1390`).
… forwarding

Fixes two bugs in `rfl::xml`:
1. `rfl::xml::Reader::get_field_from_array` never incremented `i` in its
   sibling loop, causing any `_idx > 0` to always fail out-of-bounds (also
   fixes the `"of of bounds."` typo).
2. `rfl::xml::write(obj, _indent)` dropped `_indent` when forwarding to the
   `std::ostream&` overload.

Upstream PR: munich-data-engineering#800
Replaces MSVC-deprecated `std::getenv` in public header
`include/rfl/env/Reader.hpp` with zero-allocation `::getenv_s` (for
existence probes) and `::_dupenv_s` (for value reads) under `#ifdef _MSC_VER`
(matching `_putenv_s` in `src/rfl/env/Writer.cpp` and `gmtime_s` in
`include/rfl/Timestamp.hpp`), guarding empty/null variable names and using
`std::size_t` from `<cstddef>`.

Eliminates C4996 / `-Wdeprecated-declarations` warnings emitted from the
public header on every Windows MSVC and `clang-cl` TU including `<rfl/env.hpp>`
(80 public-header warnings across `tests/env`'s 40 TUs).
…y skipping

Parent: munich-data-engineering#801 (`yaml::Reader::read_object` recursive alias guard).

`rfl::yaml::Reader::read_object` previously wrapped `p.first.as<std::string>()`
and `_object_reader.read(...)` in `catch (std::exception& e) { continue; }`,
silently dropping mapping entries whose keys were sequences, maps, or aliases
to collections (e.g. `[1, 2]: foo` or `{a: 1}: bar`). This caused silent data
loss in maps / `rfl::Generic` and silently bypassed `rfl::NoExtraFields`.

Validate the mapping key inside the `try` block and return an explicit
`rfl::Error` ("YAML mapping key must be a scalar.") whenever a key is
neither a scalar nor YAML null, propagating any `yaml-cpp` exception as an
`rfl::Error` instead of skipping. Move `_object_reader.read(...)` outside
the `try` block (matching all other structured readers) and pass a zero-copy
`std::string_view` directly from `p.first.Scalar()` (or `"null"` for YAML
null keys `~` / `null` / empty `: val`). Scalar aliases and merge keys (`<<`)
continue to work identically.

Addresses downstream workaround in `openmoq/moqx`
(`src/config/YamlDuplicateKeys.cpp:23-111`, `test/config/LoaderTest.cpp:542-650`).
…y, and default boundaries

Hardens noexcept parsing and validation boundaries so exceptions always return
`rfl::Error` instead of calling `std::terminate()`:
- `AllOf::validate_impl` was marked `noexcept` with no `try`/`catch` at all, so
  a custom validator throwing even `std::runtime_error` worked in
  `rfl::Validator<T, V>` but terminated in `rfl::Validator<T, V1, V2>`.
- Routes `MapReader` validated keys through non-throwing `KeyType::from_value()`
  and catches `const std::exception&` + `catch (...)` across both validator and
  non-validator key paths.
- Adds `const std::exception&` and `catch (...)` to `Validator::from_value`,
  `TupleReader::handle_missing_fields_impl`, `Parser_default`,
  `ParserTimePoint::from_string`, and `Timestamp::from_string` (marking the
  `const std::string&` overload `noexcept` as well).

Follow-up to: munich-data-engineering#776, munich-data-engineering#778, munich-data-engineering#779, munich-data-engineering#782
(Maintainer guide: report failures through `rfl::Result`, never by terminating.)
Constrains `ViewReader::assign_if_field_matches<i>` and
`ViewReaderWithDefault::assign_if_field_matches<i>` via
`requires(i != ViewType::pos_extra_fields())` (with a no-op overload for
`i == ViewType::pos_extra_fields()`) so an input key literally named after
the C++ `rfl::ExtraFields<T>` member (e.g. `"extra_fields"`) is captured
into `ExtraFields` instead of colliding with the member slot and failing to
parse as `Object<T>`, without introducing a capture-lambda wrapper in the
hot `assign_to_matching_field` fold expression.

Split from the parser-symbol-isolation work as an independent bugfix so
behavioral fixes are not buried inside a compile-time refactor.
Document all third-party libraries vendored under `include/rfl/thirdparty/`
and `src/yyjson.c` (`yyjson`, `CTRE`, and `enchantum`) in a dedicated
`THIRD_PARTY_NOTICES.md` at the repository root, linked from `README.md`:

- Component table with vendored paths, versions (`yyjson` 0.12.0, `CTRE`
  3.10.0, `enchantum` vendored from PR munich-data-engineering#441), upstream URLs, SPDX license
  expressions (`MIT`, `Apache-2.0 WITH LLVM-exception`), and exact
  CMake/header inclusion conditions (including clarifying that bundled
  `yyjson` is only compiled when `REFLECTCPP_USE_BUNDLED_DEPENDENCIES=ON`
  and JSON/Avro/CBOR/UBJSON is enabled, that `<rfl.hpp>` and format
  umbrella headers unconditionally include `PatternValidator.hpp` / CTRE,
  and how `BUILD_INTERFACE` include paths interact with `__has_include`).
- Full verbatim license texts for `yyjson`, `CTRE`, and `enchantum`
  (including `Copyright (c) 2025 ZXShady` from upstream `LICENSE`).

Addresses manual third-party license auditing workarounds in enterprise
downstream consumers (`NVIDIA/cuda-quantum` `LICENSES/README.md`, `NOTICE`;
`nvidia-holoscan/holoscan-sdk` `NOTICE.txt`).
In MSVC __FUNCSIG__, an out-of-enumerator zero cast of an 8-byte enum
(int64_t / uint64_t) formats as `(enum T)0x00` (5-byte suffix) rather
than `(enum T)0x0` (4-byte suffix). In vendored
`enchantum_msvc.hpp::enum_in_array_name<E{}>()`, removing only 4 bytes
left a trailing `)` on the computed enum type prefix, causing
`get_elements()` to strip 1 extra character from every enumerator name
of any 64-bit enum lacking a 0 enumerator (for example,
`WideWireEnum::small_val` -> "mall_val").

Backports upstream `ZXShady/enchantum@66acc35f` ("Fix 64 bit msvc
parsing") verbatim so vendored enchantum aligns with external vcpkg/Conan
enchantum >= 0.5.0 (munich-data-engineering#762) rather than diverging (munich-data-engineering#669), avoids the 22-file
churn of a full vendor refresh, and drops away cleanly on the next vendor
bump. Adds regression tests covering both scoped and unscoped non-zero-based
`int64_t` and `uint64_t` enums.
…:Generic

Flattens redundant `{"anyOf":[{"anyOf":[...]},{"type":"null"}]}` into a single
`anyOf` containing `{"type":"null"}` whenever the inner `AnyOf` carries no
annotations (preserving annotated inner schemas intact, and avoiding duplicate
`null` branches for nested optionals). Uses a structured-binding helper over
`schema::Type::Annotations` so future annotation fields cannot silently drift.

Downstream receipts:
- openmoq/moqx committed `config.schema.json` emits double-nested `anyOf` at
  2 live sites (`namespace_match`, `track_match`):
  https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/config.schema.json#L510-L557
- hudson-trading/slang-server defines dozens of `std::optional<rfl::Variant<...>>`
  LSP fields:
  https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/include/lsp/LspTypes.h#L3892-L3969
…h-data-engineering#692)

Adds `rfl::cli::usage<T, Ps...>(program_name, with_details)` in an isolated
header (`include/rfl/cli/usage.hpp`) to render command-line usage lines and
aligned argument descriptions directly from `rfl::cli`'s option table and
format-agnostic schema, matching `rfl::cli::read<T, Ps...>`.

Judge polish applied:
- Preserves cv-qualification in `add_usage_field_meta` so `const rfl::DefaultVal<T>`
  inside `rfl::NamedTuple` is accurately reported as required.
- Guards `path_separator` for root `std::map<std::string, V>` so keys render
  `--<key>=<value>` instead of `--.<key>=<value>`.
- Drops unused `<rfl/internal/processed_t.hpp>` and includes `<rfl/to_generic.hpp>`
  for standalone `<rfl/cli/usage.hpp>` builds.

Closes: munich-data-engineering#692
(Maintainer: "A PR is very welcome!")
Refs: munich-data-engineering#347
Exposes version-guarded `inline constexpr` flag constants in `rfl::json`
(combinable with `|`) for common yyjson read and write options — including
`allow_comments`, `allow_trailing_commas`, `jsonc`, `pretty_two_spaces`,
`newline_at_end`, `allow_bom`, and JSON5 flags — matching the existing
`rfl::json::pretty` convention and guarded by `YYJSON_VERSION_HEX` for Conan
yyjson/0.10.0 compatibility.

Downstream receipt:
- hudson-trading/slang-server passes raw `YYJSON_*` macros at 10 sites across
  6 files, including literally mixing `rfl::json::pretty` with raw
  `YYJSON_WRITE_PRETTY_TWO_SPACES`:
  https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/src/gen_config_main.cpp#L43
  https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/src/Config.cpp#L21
  https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/src/SlangServer.cpp#L929-L984
…tors, and flatten

Moves per-field serialization, schema building, missing-field handling, and
destructor helpers out of `NamedTupleParser<..., FieldTypes...>` into free
templates parameterized only on each field's type (never the enclosing
`NamedTuple` pack), and skips instantiating destructors for trivially
destructible fields/arrays. Eliminates O(N^2) symbol-table and DWARF growth on
wide structs with zero public API changes.

Split from parser-symbol-isolation (#118) into an independent, reviewable chunk
(no lookup algorithm changes; `to_default_generic` fast-path and `ViewReader`
isolation follow in separate commits).

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
Downstream receipts (combined Wave 1 N=3 interleaved medians vs main):
- hudson-trading/slang-server (`SlangServer.cpp` Debug): -15.0% `.o` Clang, -9.6% GCC, -6.1% wall
- openmoq/moqx (`Loader.cpp` Debug): -17.5% `.o` Clang, -13.5% GCC, -4.4% wall
- FANUC-CORPORATION/fanuc_driver (`serialization.cpp` Debug): -27.1% `.o` Clang, -9.9% wall
- games-on-whales/wolf (`unix_socket_server.cpp` Release): -19.4% `.o` Clang
…tVal

Adds `rfl::internal::apply_to_fields` (C++20 and C++26) to invoke a visitor
directly on structured-binding field references without materializing
`rfl::Tuple` or `rfl::NamedTuple`, and rewrites `HasDefaultVal<T>` on top of it
(dropping `#include "../NamedTuple.hpp"` in favor of a forward declaration and
fixing a raw-pointer false positive).

Judge polish applied:
- Qualifies `rfl::internal::apply_to_fields(...)` and `cpp20::apply_to_fields_impl<...>`
  to prevent ADL ambiguity when user namespaces define `apply_to_fields`.
- Guards `HasDefaultVal<T>`'s `requires` clause with `!is_named_tuple_spec<T>::value`
  before `std::is_aggregate_v<T>` so forward-declared `NamedTuple<...>` stays
  well-formed without including `NamedTuple.hpp`.
- Uses `is_default_val` in `HasDefaultVal<NamedTuple<Fields...>>` so it strips
  one pointer level as documented (instead of two), and renames function
  template `has_default_val_type_v` to `has_default_val_field`.

Downstream validation:
- Verified 0 warnings and 96/96 PASS on munich-data-engineering/sqlgen
  (metaprogramming canary) plus slang-server, moqx, fanuc-libs, and wolf.
…tReader and ParserTaggedUnion

Direct follow-up to munich-data-engineering#766 (`Error::details()`):
- `FieldVariantReader::try_one` constructed a fresh `Error(stream.str())`
  instead of calling `wrap_error(stream.str(), std::string(_disc_value), std::move(_e))`,
  discarding nested field paths and collapsing multi-error detail vectors for
  externally-tagged `rfl::Variant<rfl::Field<...>, ...>`.
- `ParserTaggedUnion` dropped the discriminator path segment (`_discriminator`
  or index `0` under `NoFieldNames`) from `Error::details()` on missing,
  non-string, or unknown discriminator values.

Preserves `Error::what()` byte-for-byte with zero API changes.

Follow-up to: munich-data-engineering#766
…m_fields

Replaces the O(N) linear SFINAE recursion in `rfl::internal::cpp20::num_fields`
with an O(log N) exponential probe + binary search, cutting wide-struct C++20
reflection compile time and bounding template instantiation depth in +49/-4 LOC
with zero public API changes.

Downstream wide-struct / `num_fields` consumers:
- openmoq/moqx invokes `num_fields` 27x in one TU:
  https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/test/config/ConfigSerializerTest.cpp#L26-L128
- hudson-trading/slang-server defines 376 LSP structs up to 36 fields:
  https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/include/lsp/LspTypes.h#L3816-L3976
- FANUC-CORPORATION/fanuc_driver has 23-field packet structs:
  https://github.com/FANUC-CORPORATION/fanuc_driver/blob/da5db3f611cdc9dffe687e056c4e79bea584bf5c/fanuc_libs/rmi/include/rmi/packets.hpp#L641-L666
…WithDefault

Lifts per-field parsing, placement-move, move-assign, error-recording, and
extra-field helpers out of `ViewReader<..., ViewType, ...>` and
`ViewReaderWithDefault<..., ViewType, ...>` into free function templates
parameterized only by each field's type (never the enclosing `ViewType`),
keeping linear field-name dispatch (inline for `size_ <= 4`, out-of-line for
wider structs) and the compile-time positional read fast path.

Parent: depends on `fix(parsing): capture input keys matching ExtraFields member name`
(preserving the `is != ViewType::pos_extra_fields()` guard). Independent of
`NamedTupleParser` helper isolation; wide-struct `FieldNameLookup` follows in
a dedicated child commit.

Judge polish applied:
- Zero `[[maybe_unused]]` annotations (per munich-data-engineering#582): unmatched-name handling
  dispatches directly into `handle_extra_field*` / `handle_no_extra_fields_error`
  with only the parameters used by each branch.

Follow-up to: munich-data-engineering#795, munich-data-engineering#799
…neering#731)

Adds opt-in whole-enum wire-name casing transform processors
(`rfl::TransformEnumNames<...>` plus aliases `EnumSnakeCaseToKebabCase`,
`EnumSnakeCaseToCamelCase`, `EnumSnakeCaseToPascalCase`,
`EnumCamelCaseToSnakeCase`, `EnumToLowerCase`, `EnumToUpperCase`) across read,
write, `rfl::enum_to_string`, `rfl::string_to_enum`, and JSON Schema generation.
Resolved wire-name tables are cached once per `(EnumType, EnumNameTransform)`.

Parent: depends on `feat(enums): accept std::string_view in rfl::string_to_enum (munich-data-engineering#565)`
(open upstream PR munich-data-engineering#802). Per-enum overrides/trait (`rfl::EnumNames<E>`, #106)
is split into a separate child commit on top of this processor seam.

Judge polish applied:
- Moves non-template `apply_enum_name_transform` out-of-line into
  `src/rfl/TransformEnumNames.cpp` (`RFL_API`, wired via `src/reflectcpp.cpp`).
- Places `enum_name_transform_v` in `include/rfl/internal/enum_name_transform_v.hpp`
  (mirroring `enum_names_only_v.hpp` with `std::remove_pointer_t`).
- Adds `EnumCamelCaseToSnakeCase` for parity with `rfl::CamelCaseToSnakeCase` (munich-data-engineering#588).
- Accepts variadic `class... Ps` on `rfl::enum_to_string` and `rfl::string_to_enum`,
  strips `std::remove_cvref_t<EnumType>`, and guards `config::enum_descriptions`
  so untransformed enums avoid static heap caches.

Refs: munich-data-engineering#731
(Maintainer: "My first instinct would be a processor, but I need to give it some thought.")
Downstream receipts:
- NVIDIA/cuda-quantum maintains 4 hand-written `rfl::Reflector<E>` switch tables
  for `snake_case` -> `kebab-case` YAML enums:
  https://github.com/NVIDIA/cuda-quantum/blob/81ef20d9d4a1e0912a6dbc68637ece017e8fd324/cudaq/lib/Target/Yaml/TargetConfigYamlAdapters.h#L27-L75
  https://github.com/NVIDIA/cuda-quantum/blob/81ef20d9d4a1e0912a6dbc68637ece017e8fd324/cudaq/lib/Target/Yaml/v2/QuakeUnmappedProfileYaml.h#L16-L53
- openmoq/moqx duplicates `enum class QuicStack` as `rfl::Literal` + switch mapper:
  https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/src/config/loader/ParsedConfig.h#L291
- munich-data-engineering/sqlgen post-processes `enum_to_string` across all 4 SQL backends:
  https://github.com/munich-data-engineering/sqlgen/blob/265b0a174b661c5905b874f97b064aecb4cded70/src/sqlgen/sqlite/to_sql.cpp#L338-L340
- games-on-whales/wolf lowercases `enum_to_string`:
  https://github.com/games-on-whales/wolf/blob/ac2461f68feda41fdc7a7c8e812b9ab4b80520b7/src/moonlight-server/api/openapi.cpp#L92
Exposes `rfl::type_name<T>()` and `rfl::type_name_v<T>` via a thin,
self-contained public header (`<rfl/type_name.hpp>`, mirroring `<rfl/num_fields.hpp>`
from munich-data-engineering#451/munich-data-engineering#465) returning a compile-time `std::string_view` directly from
`rfl::internal::get_type_name_str_view<T>()` without instantiating
`rfl::Literal` or `rfl::internal::StringLiteral`.

Parent: depends on `fix(reflection): fix dangling string_view in rfl::internal::get_type_name_str_view`
(open upstream PR munich-data-engineering#804).

Judge polish applied:
- Drops redundant `rfl::num_fields_v<T>` (`rfl::num_fields<T>` is already a
  public variable template since munich-data-engineering#465).
- Uses munich-data-engineering#804's `internal::get_type_name_str_view<T>()` directly to avoid
  `StringLiteral<N>` / `make_index_sequence<N>` bloat.

Precedent: munich-data-engineering#451
Downstream receipts:
- NVIDIA/cuda-quantum calls private `rfl::internal::get_type_name_str_view<T>()`
  with comment "Unfortunately, this has to use a private API of reflect-cpp":
  https://github.com/NVIDIA/cuda-quantum/blob/81ef20d9d4a1e0912a6dbc68637ece017e8fd324/cudaq/lib/Target/Reflection.h#L27-L31
- munich-data-engineering/sqlgen hand-rolled `sqlgen::internal::get_type_name_str_view`:
  https://github.com/munich-data-engineering/sqlgen/blob/265b0a174b661c5905b874f97b064aecb4cded70/include/sqlgen/internal/get_type_name.hpp#L13-L44
- games-on-whales/wolf instantiates `rfl::type_name_t<...>().str()`:
  https://github.com/games-on-whales/wolf/blob/ac2461f68feda41fdc7a7c8e812b9ab4b80520b7/src/moonlight-server/api/api.cpp#L26
Adds `rfl::parsing::to_default_generic` so scalar and `std::optional<scalar>`
default values (`bool`, plain integers, floating-point, `std::string`) construct
`rfl::Generic` directly during JSON Schema emission instead of instantiating
`rfl::to_generic<ProcessorsType>` / `rfl::generic::Writer`, while keeping
complex types on `rfl::to_generic` with identical semantics.

Parent: depends on `perf(parsing): isolate per-field helpers in NamedTupleParser,
destructors, and flatten` for `build_named_tuple_field_schema`.

Judge polish applied:
- Drops the consumer-specific `std::vector<std::string>` special case (falls
  back cleanly to `rfl::to_generic`) and documents parity with
  `rfl::generic::Writer::to_generic`.
…ta-engineering#683)

Adds the opt-in `rfl::IntegerBounds` processor emitting C++ integer width
`minimum`/`maximum` keywords in JSON Schema (`Type::BoundedInteger` handled
across JSON, Avro, and Cap'n Proto schema emitters), excluding `bool` and
character types to prevent x86_64 vs ARM64 signedness drift.

Judge polish applied:
- Simplifies `BoundedInteger::maximum_` and `json::schema::Type::Integer::maximum`
  from `rfl::Variant<int64_t, uint64_t>` to `std::uint64_t`, removing `.visit()`
  boilerplate in Avro and Cap'n Proto schema emitters.
- Strips `std::remove_cvref_t<T>` and guards `sizeof(U) <= sizeof(std::int64_t)`
  in `is_bounded_integer_v`, uses `inline constexpr bool`, qualifies `std::`
  fixed-width types, and documents `rfl::IntegerBounds` in `docs/content/processors.md`.

Closes: munich-data-engineering#683
(Maintainer: "sorry, I misunderstood the issue. I think this is very possible.")
Downstream receipts (bare `"type": "integer"` with zero bounds today):
- openmoq/moqx: https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/config.schema.json#L256-L259
- hudson-trading/slang-server: https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/clients/vscode/resources/config.schema.json#L29-L33
- games-on-whales/wolf: https://github.com/games-on-whales/wolf/blob/ac2461f68feda41fdc7a7c8e812b9ab4b80520b7/src/moonlight-server/api/api.hpp#L55-L56
…ing includes in make_type_name.hpp

Fixes Undefined Behavior in `rfl::parsing::replace_non_alphanumeric` where
`std::isalnum(ch)` was called on a plain `char` (triggering UB and MSVC Debug
CRT assertions on negative/UTF-8 bytes; sole remaining uncast `<cctype>` call
in `include/` and `src/`). Also adds missing `#include <cctype>` and
`#include <string>` for header self-containment.
…pr helpers

`StringLiteral` is already part of reflect-cpp's public template signature
surface (`rfl::Field`, `rfl::Literal`, `rfl::Rename`, `rfl::Description`,
`rfl::Timestamp`, `rfl::Pattern`), forcing downstream consumers writing
wrappers, partial specializations, or composed compile-time names to depend
on `<rfl/internal/StringLiteral.hpp>` and `rfl::internal::StringLiteral`.

- Promote `rfl::StringLiteral<N>` to a self-contained public header
  `<rfl/StringLiteral.hpp>` (included from `<rfl.hpp>`), preserving the
  Clang 21/22 C++26 `std::same_as<char>...` constructor workaround (munich-data-engineering#688),
  marking `string_view()`, `operator==`, and `operator!=` `noexcept`,
  guarding `N >= 1` via `static_assert`, using `std::size_t`, and clamping
  `StringLiteral(std::string_view)` to `N - 1` so `arr_[N - 1] == '\0'`
  always holds.
- Keep `<rfl/internal/StringLiteral.hpp>` as a backwards-compatible
  forwarding header with `using rfl::StringLiteral;` so CTAD NTTPs,
  partial specializations, and existing includes remain 100% compatible.
- Add `constexpr` `operator+` concatenation on `rfl::StringLiteral<N1>` +
  `rfl::StringLiteral<N2>` returning null-terminated
  `rfl::StringLiteral<N1 + N2 - 1>`.
- Add `static constexpr std::string_view name_view() noexcept` on
  single-value `rfl::Literal<_name>`, returning a `string_view` backed by
  static storage duration.

Addresses downstream workarounds in `munich-data-engineering/sqlgen` (41
headers still referencing `rfl::internal::StringLiteral` plus custom
`GetNameFromLiteral`) and `openmoq/moqx` (`src/config/loader/StringLiteral.h`).
…data-engineering#375)

Adds opt-in `rfl::VariantsAsOneOf` so `rfl::json::to_schema` emits `oneOf`
instead of `anyOf` for `rfl::Variant`, `std::variant`, and `FieldVariantParser`
while preserving the backwards-compatible `anyOf` default (for overlapping
alternatives) and keeping `std::optional` and `rfl::Generic` as `anyOf`.
(Note: `std::expected` delegates schema generation to `rfl::Variant`, so it
also emits `oneOf` under `VariantsAsOneOf`.)

Parent: depends on `feat(json-schema): emit oneOf for rfl::TaggedUnion in JSON Schema (munich-data-engineering#375)`
for `schema::Type::AnyOf::mutually_exclusive_` and `OneOf` emission in
`src/rfl/json/to_schema.cpp`.

Judge polish applied:
- Replaces post-hoc `_definitions` AST mutation for `rfl::Generic` with
  `internal::remove_variants_as_one_of_t<ProcessorsType>`, delegating cleanly
  to `Parser<R, W, Generic, ...>::to_schema`.
- Adds direct `<rfl/Generic.hpp>` and `<rfl/internal/variants_as_one_of_v.hpp>`
  includes in `Parser_default.hpp` plus multi-processor composition tests.

Refs: munich-data-engineering#375
Downstream receipt:
- openmoq/moqx defines 5 mutually-exclusive `rfl::Variant` config schemas
  currently forced to emit `anyOf` in committed `config.schema.json`:
  https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/config.schema.json#L510-L557
  https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/config.schema.json#L1188-L1203
  https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/config.schema.json#L1977-L2001
…d dispatch

Parent: `perf(parsing): isolate per-field helpers in ViewReader and ViewReaderWithDefault`

Adds `rfl::parsing::FieldNameLookup<rfl::Literal<_names...>>` in
`include/rfl/parsing/find_field_index.hpp` and wires it into `ViewReader`
and `ViewReaderWithDefault` for structs with > 4 fields:

- Lookup tables are keyed solely on `ViewType::Names` (`rfl::Literal<...>`),
  so field wrappers like `rfl::Description` or different formats/processors
  share the same lookup table without duplicating instantiations.
- Sequential-key cursor hint (`find_with_hint`) hits O(1) when keys arrive in
  declaration order; `RFL_COLD` fallback uses a linear scan for <= 8 fields
  and a constexpr-heapsorted binary search for > 8 fields (avoiding reliance
  on constexpr `std::sort` in older libc++ releases).
- Keeps the small-struct (<= 4 fields) inline fold path and positional
  compile-time index path unchanged, and preserves exact `ExtraFields` /
  `NoExtraFields` / duplicate-key semantics with zero `[[maybe_unused]]`
  annotations.
- Adds focused tests in `tests/json/test_field_name_lookup.cpp` covering
  small, medium (5..8), wide (> 8), out-of-order, duplicate-key, varied key
  lengths, and empty `Literal<>` instantiations.

Benchmarks (N=3 interleaved Wave 1 vs upstream/main, Clang 23.1.6 / GCC 13.4.0):
- Synthetic wide structs (`compile_stress_wide.cpp`, 32/64/128 fields):
  -17.0% wall / -14.9% RSS / -32.4% .o (Clang Debug); -20.0% wall / -13.0% RSS /
  -74.8% .o (Clang Release); -9.2% wall / -26.2% .o (GCC Debug); -7.7% wall /
  -31.4% .o (GCC Release).
- Real OSS consumers: `slang-server` `SlangServer.cpp` -6.1% wall / -15.0% .o
  (Clang Debug), -8.6% wall / -8.0% RSS (GCC Release), `Config.cpp` -46.1% .o
  (Clang Release); `moqx` `Loader.cpp` -17.5% .o (Clang Debug), -5.4% wall
  (GCC Release); `fanuc-libs` `serialization.cpp` -9.9% wall / -27.1% .o
  (Clang Debug); `wolf` `unix_socket_server.cpp` -19.4% .o (Clang Release).
- Runtime parity (`reflect-cpp-bench-json` Release): `BM_licenses` -11.1%
  faster GCC (+0.9% Clang), `Record2` +22.8% faster GCC (-2.3% Clang),
  `Record16` +11.0% faster GCC (-1.8% Clang / +0.1% FailFast), `BM_person_read`
  -2.5% faster Clang (+0.7% GCC).
…d Cap'n Proto helpers

When a custom type exposes a `ReflectionType` (or `rfl::Reflector<T>::ReflType`)
wrapped in `rfl::Description` or `rfl::Deprecated`, `Parser_default::make_reference`
stores `Type::Description` or `Type::Deprecated` directly in `_definitions[name]`.

While `type_to_avro_schema_type` and `type_to_capnproto_schema_type` already
unwrapped both wrappers, three schema helper predicates did not:

- `rfl::avro::is_named_type` (`src/rfl/avro/to_schema.cpp`): failed to
  recognize wrapped records/enums as named types, emitting duplicated
  anonymous `unnamed_N` definitions instead of named references.
- `rfl::capnproto::is_named_type` (`include/rfl/capnproto/is_named_type.hpp`):
  failed to recognize wrapped structs/enums/unions/maps as named types (and
  was missing `#include <type_traits>` for standalone compilation).
- `rfl::capnproto::string_map_to_capnproto_schema_type`
  (`src/rfl/capnproto/to_schema.cpp`): failed to detect wrapped `Type::Literal`
  values via `is_literal_type`, emitting invalid generic `Map(Enum)` instead
  of `ScalarMap`.

Adds focused Avro and Cap'n Proto regression tests for `Description`- and
`Deprecated`-wrapped custom `ReflectionType` definitions.
Parent: `feat(enums): add rfl::TransformEnumNames processors (munich-data-engineering#731)`

Adds the opt-in `rfl::EnumNames<E>` specialization trait and
`rfl::get_enum_wire_names<E, Ps...>()` utility so enums with non-identifier
wire strings (e.g., `"c++20"`, `"nvq++"`, `"*"`), C++ keyword clashes, or
enumerators outside the default reflected range can declare custom wire names
across JSON, CLI, YAML, XML, Generic, and JSON Schema without duplicating
enumerators as `rfl::Literal<...>`:

- Supports static `overrides` (array or borrowed `overrides()` returning
  `std::span`, with `static_assert` rejecting dangling by-value containers)
  and per-enum `transform` (`EnumNameTransform` constant or custom callable).
- `overrides` takes precedence over `transform`; when only `overrides` is
  specified, non-overridden enumerators still inherit any
  `rfl::TransformEnumNames<...>` processor passed to `read`/`write`/`to_schema`.
- Zero-overhead `if constexpr` fast path when neither `EnumNames<E>` nor
  `TransformEnumNames` is active; resolved tables are cached per
  `(EnumType, EnumNameTransform)`.
- Public `rfl::get_enum_wire_names<E, Ps...>()` accepts variadic processors,
  and throwing custom `transform` callbacks are caught into `rfl::Error` across
  both `ParserEnum::read` and direct `rfl::string_to_enum`.

Open design question for upstream review: whether the trait should live at
`rfl::EnumNames<E>` (matching `rfl::Reflector<T>`) or `rfl::config::enum_names<E>`
(matching `rfl::config::enum_range<E>` / `rfl::config::enum_descriptions<E>`).

Refs: munich-data-engineering#106
(Maintainer: "something along these lines is possible")
Downstream receipts:
- NVIDIA/cuda-quantum hand-written Reflector tables for non-identifier wire
  strings (e.g., `c++20`, `nvq++`):
  https://github.com/NVIDIA/cuda-quantum/blob/81ef20d9d4a1e0912a6dbc68637ece017e8fd324/cudaq/lib/Target/Yaml/TargetConfigYamlAdapters.h#L27-L75
  https://github.com/NVIDIA/cuda-quantum/blob/81ef20d9d4a1e0912a6dbc68637ece017e8fd324/cudaq/lib/Target/Yaml/v2/QuakeReferenceSemanticsProfileYaml.h#L16-L32
- openmoq/moqx custom action wire strings (`"*"` / domain verbs) & config enums:
  https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/src/auth/Action.h#L24-L102
  https://github.com/openmoq/moqx/blob/60bab7f13925acbaf578670223e660d71e891547/src/config/ConfigResolver.cpp#L35-L48
…h-data-engineering#368)

Adds `rfl::json::Raw` so JSON subtrees can be read and written verbatim
without materializing intermediate `rfl::Generic` C++ ASTs or touching core
parser headers:

- Out-of-line `RFL_API` implementation in `src/rfl/json/Raw.cpp` (wired via
  `src/reflectcpp_json.cpp`) plus additive raw-emission methods on
  `rfl::json::Writer` (`yyjson_mut_rawncpy`).
- `Parser<generic::Reader, generic::Writer, json::Raw>` bridging so
  `rfl::DefaultVal<rfl::json::Raw>`, `rfl::to_generic`, `rfl::from_generic`,
  and `rfl::json::to_schema` work seamlessly.
- Non-JSON formats fail cleanly at compile time via `static_assert`.

Judge polish applied:
- Tightened unchecked string constructors to private; `Raw::from_string()`
  (strict RFC 8259 validated, returning `Result<Raw>`) is the safe default,
  with explicit `Raw::from_trusted_string()` opt-in for pre-serialized JSON.
- Added standard const-only reflect-cpp accessors `get()`, `operator*()`,
  and `operator()()`.
- Switched `Raw::from_json_obj` to `yyjson_val_write_opts(..., &err)` so
  serialization failures (e.g., `NaN`/`Infinity`) include `err.msg`.
- Handled empty/moved-from `value_` in `Raw::to_generic()` (returning null
  `Generic`) and added `catch (...)` in `noexcept` `Raw::from_generic()`.
- Updated `static_assert` message to mention both `rfl::json` and `rfl::Generic`.

Refs: munich-data-engineering#368
Downstream receipts:
- hudson-trading/slang-server double-reflects JSON-RPC params via `rfl::Generic`:
  https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/include/lsp/JsonRpc.h#L23-L43
  https://github.com/hudson-trading/slang-server/blob/1b413a4655877a55b3f8a450c23e4ba6c2bf4267/include/lsp/JsonRpcServer.h#L53-L132
- games-on-whales/wolf stores raw Docker JSON as escaped `std::string` and
  re-parses `to_schema` output into `rfl::Object<rfl::Generic>`:
  https://github.com/games-on-whales/wolf/blob/ac2461f68feda41fdc7a7c8e812b9ab4b80520b7/src/moonlight-server/state/serialised_config.hpp#L98
  https://github.com/games-on-whales/wolf/blob/ac2461f68feda41fdc7a7c8e812b9ab4b80520b7/src/moonlight-server/api/openapi.cpp#L17-L69
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.

string_to_enum does not support std::string_view

1 participant