Skip to content

Collect all element errors in YAML sequences (honoring rfl::FailFast) - #43

Closed
clockblocker wants to merge 1 commit into
wave-base-13from
yaml-sequence-error-aggregation
Closed

clockblocker wants to merge 1 commit into
wave-base-13from
yaml-sequence-error-aggregation

Conversation

@clockblocker

@clockblocker clockblocker commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Part 2 of 4 (split from #40; stacked on #42).

Summary

  • Updates rfl::yaml::Reader::read_array to collect all failing sequence element errors via to_single_error() (stopping at the first error when rfl::FailFast is passed), matching object field error aggregation.
  • Tracks num_failed_ only on the [[unlikely]] error path in VectorReader (keeping zero extra instructions on the std::vector happy path for JSON/binary formats) and guards std::inplace_vector so excess elements report a single capacity error rather than spamming duplicates.
  • Tracks num_failed_ alongside num_set_ in ArrayReader and TupleReader so error indices stay accurate and partial destruction remains safe.
  • Updates docs/content/processors.md (under rfl::FailFast) and docs/content/supported_formats/yaml.md, and adds sequence aggregation, FailFast, and container tests in tests/yaml/test_error_details.cpp.

Why YAML first?

Human-authored YAML config files benefit most from seeing all invalid list entries (with line/column locations) in a single pass. Preparing VectorReader, ArrayReader, and TupleReader with zero-overhead happy-path error-index tracking allows other formats (such as JSON or TOML) to opt in incrementally in follow-up PRs without changing existing fast-format behavior today.

Verification

  • Verified full shared-library CMake suite (-DREFLECTCPP_BUILD_SHARED=ON -DREFLECTCPP_JSON=ON -DREFLECTCPP_YAML=ON -DREFLECTCPP_STRICT_WARNINGS=ON with -fvisibility=hidden): 631/631 passed, plus C++20/C++23 header checks.

@clockblocker
clockblocker force-pushed the yaml-error-source-locations branch from fdea5d6 to a7e7ccd Compare November 25, 2026 11:39
@clockblocker
clockblocker force-pushed the yaml-sequence-error-aggregation branch 2 times, most recently from 0278569 to b6856f7 Compare November 25, 2026 12:06
@clockblocker
clockblocker force-pushed the yaml-error-source-locations branch from a7e7ccd to 3e01422 Compare November 25, 2026 12:06
@clockblocker
clockblocker changed the base branch from yaml-error-source-locations to wave-base-13 November 25, 2026 12:07
@clockblocker
clockblocker force-pushed the yaml-sequence-error-aggregation branch from b6856f7 to 44034c7 Compare November 25, 2026 12:08
Update rfl::yaml::Reader::read_array to continue past failing elements and
aggregate all element errors via to_single_error(), matching object field
error aggregation while stopping at the first error under rfl::FailFast.

Track num_failed_ only on the error path in VectorReader (keeping zero extra
instructions on the std::vector happy path for JSON and binary formats),
guard std::inplace_vector against emitting duplicate capacity errors on
excess elements, and track num_failed_ alongside num_set_ in ArrayReader
and TupleReader so indices stay accurate and partial destruction remains
safe.
@clockblocker

Copy link
Copy Markdown
Owner Author

Branch is preserved on fork and showcase/all-lanes (d0f1fca1) as a reference artifact and parked in #117 (Moonshots & Possible Scope Creep).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant