Skip to content

Parser/Semantics: strict config parser semantics absent (Holoscan keeps reflect-cpp test-only; triaged in #131) #151

Not planned

Description

@clockblocker

Part of #138
Popularity: 1/7 corpus consumers (holoscan-sdk)

Problem

nvidia-holoscan/holoscan-sdk evaluated reflect-cpp (v0.25.0) for its configuration I/O layer (holoscan::config_io), but deliberately keeps reflect-cpp test-only as a differential validator (verify_reflect_generic) over already-canonicalized JSON bytes rather than using it on the production parse path. Holoscan's configuration specification requires five strict parser/semantic guarantees that reflect-cpp does not provide out of the box:

  1. Explicit i64/u64/f64 lexical numeric-kind model (no inferred number coercion; rejecting JSON integers into floats and distinguishing 1 vs 1.0, signed vs unsigned 64-bit, and out-of-range literals via YYJSON_READ_NUMBER_AS_RAW).
  2. Decoded duplicate-key rejection (e.g. rejecting {"plain":0,"\u0070lain":1} as kDuplicateKey).
  3. Caller-supplied resource limits (max_source_bytes, max_depth, max_nodes, max_string_bytes, max_container_entries).
  4. Lossless source spans (tracking raw byte ranges for surgical in-place replace() preserving unchanged formatting/escapes).
  5. Structured machine-readable errors (ConfigErrorCode, ConfigOperationStage, byte offset / path) instead of flat error().what() strings.

Observed Downstream Workarounds

nvidia-holoscan/holoscan-sdk (358c772f)

  • CMakeLists.txt#L507-L518: gates holoscan_add_dependency(reflectcpp) strictly behind if(HOLOSCAN_BUILD_TESTS AND BUILD_TESTING):

    reflect-cpp is differential test evidence for the MR !4537 typed-backend direction. It is neither a production parse pass nor a production package/build dependency.

  • src/config/reflect_backend.cpp#L16-L31: feeds only Holoscan-owned canonical JSON into rfl::json::read<rfl::Generic> and maps any failure to a generic kCodecFailure wrapping parsed.error().what():
    // The Holoscan lexer has already frozen duplicate-key, numeric-kind, reserved-escape, and
    // resource-limit semantics. reflect-cpp is intentionally a secondary generic/typed backend:
    // parsing only Holoscan-owned canonical bytes prevents its inferred number model from becoming
    // public configuration authority while still exercising the MR !4537 integration path.
  • src/config/json_yyjson.cpp#L400-L413: production JSON parser calls yyjson_read_opts directly with YYJSON_READ_NUMBER_AS_RAW, maps yyjson_read_err to structured ConfigErrorCode + error.pos, and builds LosslessScalarSpan records.
  • tests/config/test_io.cpp:
    • #L135-L160: canonical envelope typing (u64/i64/f64) + detail::verify_reflect_generic differential check.
    • #L162-L168: decoded duplicate key rejection ({"plain":0,"\u0070lain":1}).
    • #L202-L242: raw number kind preservation (i64, u64, f64, -0.0 normalization, out-of-range kOutOfRange).
    • #L244-L276: lossless byte-span round-trip with RFC 6901 decoded paths.
    • #L278-L312: caller-supplied parse limits (max_source_bytes, max_depth, max_nodes, max_string_bytes, max_container_entries).

Triage Status & Related Fork Work

Upstream Overlap

Activity

  1. added
    wontfix
    known-downstream-workarounds
    on Nov 29, 2026
  2. clockblocker commented on Nov 29, 2026

    @clockblocker
    OwnerAuthor

    Triage decision: closing as wontfix (not planned) — already triaged wontfix in #131.

    Rationale: Holoscan's strict YAML 1.2 scalar / lexical-numeric / lossless-span / reserved-envelope / DOM resource-budget layer belongs in a dedicated configuration parser, not inside reflect-cpp.

    Tracking for extracted slices:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    known-downstream-workaroundswontfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions