Skip to content

Support multiple data products per unfold child #1062

Open

Description

@coderabbitai

Summary

The unfold design allows a generator to populate each child data cell with multiple data products. The current implementation supports one product per child.

In phlex/core/unfold_node.hpp, the generator result is unpacked as (next_value, prods). The review discussion reports that a std::tuple<next_type, T1, ..., Tn> fails to compile because the structured binding has only two names. A std::pair<next_type, std::tuple<T1, T2>> instead registers one tuple-valued product, and number_output_objects counts it as one output. As a result, output_product_suffixes(...) accepts only one suffix.

Requested change

Extend the unfold implementation to support multiple independently selectable products per child, consistent with the intended design. Review the generator return contract, output type and suffix accounting, and child product insertion. Preserve existing single-product behavior, including tuple-valued products where applicable.

Affected areas include phlex/core/unfold_node.hpp, output registration and type deduction, test/unfold_test.cpp, and docs/source/guide/unfolds.rst.

Acceptance criteria

  • An unfold generator can return a next value and at least two products using the supported interface.
  • Each child contains the products as separate outputs, with the corresponding suffixes, and downstream algorithms can select them independently.
  • Tests cover multi-product unfolds, suffix handling, and existing single-product behavior.
  • The unfold documentation describes the supported return format and product behavior.

Requested by @knoepfel.

Pull request: #1028
Review discussion: #1028 (comment)

Activity

  1. coderabbitai commented on Nov 12, 2026

    @coderabbitai
    ContributorAuthor
    🔗 Related PRs

    #1028 - docs: document unfolds [open]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. removed their assignment
    on Nov 12, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions