Skip to content

Providers#180

Merged
knoepfel merged 47 commits intomainfrom
providers
Dec 11, 2025
Merged

Providers#180
knoepfel merged 47 commits intomainfrom
providers

Conversation

@sabasehrish
Copy link
Member

@sabasehrish sabasehrish commented Dec 10, 2025

This PR introduces the first prototype of the provider nodes to the Phlex framework.

Key changes include:

  • Added declared_provider class and provider_node template for implementing provider functionality
  • Introduced provide() API in the glue interface for registering providers with the framework
  • Updated edge_maker to automatically wire provider outputs to consumer inputs based on product labels and families
  • Modified multiplexer to route level-based messages to provider nodes during execution
  • Enhanced node_catalog to track provider execution counts
  • Added caching to providers to prevent unnecessary re-execution of identical requests
  • Simplified multiplexing logic by removing unnecessary product_store functionality that became redundant with providers
  • Updated all tests and benchmarks to use the new provider system

@knoepfel knoepfel linked an issue Dec 10, 2025 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 85.51724% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
phlex/core/declared_provider.cpp 36.36% 5 Missing and 2 partials ⚠️
phlex/core/edge_maker.cpp 77.27% 2 Missing and 3 partials ⚠️
phlex/core/node_catalog.cpp 33.33% 1 Missing and 1 partial ⚠️
phlex/core/product_query.cpp 66.66% 2 Missing ⚠️
phlex/core/product_query.hpp 33.33% 2 Missing ⚠️
phlex/core/declared_fold.hpp 80.00% 0 Missing and 1 partial ⚠️
phlex/core/message.cpp 0.00% 1 Missing ⚠️
phlex/core/multiplexer.cpp 92.30% 0 Missing and 1 partial ⚠️
@@            Coverage Diff             @@
##             main     #180      +/-   ##
==========================================
+ Coverage   81.00%   81.13%   +0.13%     
==========================================
  Files         114      116       +2     
  Lines        2037     2083      +46     
  Branches      328      332       +4     
==========================================
+ Hits         1650     1690      +40     
- Misses        254      255       +1     
- Partials      133      138       +5     
Flag Coverage Δ
unittests 81.13% <85.51%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
phlex/app/load_module.cpp 75.00% <ø> (ø)
phlex/core/declared_provider.hpp 100.00% <100.00%> (ø)
phlex/core/declared_transform.hpp 91.48% <100.00%> (ø)
phlex/core/declared_unfold.cpp 60.00% <100.00%> (ø)
phlex/core/detail/filter_impl.cpp 95.23% <100.00%> (ø)
phlex/core/edge_creation_policy.cpp 79.06% <100.00%> (+1.02%) ⬆️
phlex/core/edge_maker.hpp 100.00% <100.00%> (ø)
phlex/core/framework_graph.cpp 86.36% <100.00%> (+0.15%) ⬆️
phlex/core/framework_graph.hpp 100.00% <100.00%> (ø)
phlex/core/glue.hpp 98.36% <100.00%> (+0.24%) ⬆️
... and 15 more

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7640bdf...18f824b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a provider node mechanism to the Phlex framework, which fundamentally changes how data products are created and injected into the processing graph. Instead of embedding data products directly into product_store objects at the source level, providers generate products on-demand when they are needed, based on the data_cell_index.

Key Changes

  • Introduced declared_provider class and provider_node template for implementing lazy, on-demand data generation
  • Added provide() API to framework_graph and glue interfaces for registering provider functions
  • Modified edge_maker to automatically wire provider outputs to consumer inputs based on product labels and families
  • Implemented caching in providers to avoid redundant computation for the same data_cell_index
  • Simplified product_store by removing parent tracking methods (make_child, make_continuation, parent(), etc.)
  • Changed framework_driver from async_driver<product_store_ptr> to async_driver<data_cell_index_ptr>

Reviewed changes

Copilot reviewed 70 out of 70 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
phlex/core/declared_provider.{hpp,cpp} New provider node implementation with caching and flush handling
phlex/core/registration_api.hpp Added provider_api class for fluent registration interface
phlex/core/edge_maker.{hpp,cpp} Added make_provider_edges() to wire providers to consumers automatically
phlex/core/multiplexer.{hpp,cpp} Modified to route messages to provider nodes based on data layer
phlex/core/node_catalog.{hpp,cpp} Added provider tracking and execution counts
phlex/core/concepts.hpp Added is_provider_like concept for provider function validation
phlex/core/framework_graph.{hpp,cpp} Integrated provider API and changed driver to use data_cell_index
phlex/core/glue.hpp Added provide() method for provider registration
phlex/model/product_store.{hpp,cpp} Simplified by removing parent relationship methods
test/* Updated all tests to use provider pattern instead of direct product injection
test/demo-giantdata/* Removed logging infrastructure, simplified data flow with providers
test/benchmarks/* Added benchmarks_provider module and updated configurations

@greenc-FNAL
Copy link
Contributor

@copilot What would it take to improve the test coverage of C++ code in this change to 100%? According to Codecov, 21 lines have partial or missing coverage.

Copy link
Contributor

Copilot AI commented Dec 11, 2025

@greenc-FNAL I've opened a new pull request, #182, to work on those changes. Once the pull request is ready, I'll request review from you.

sabasehrish and others added 19 commits December 11, 2025 10:03
Implement give_me_vertices provider algorithm that returns
toy::VertexCollection struct instead of fundamental type.
Wire stub provider into framework_graph with unlimited concurrency.
Update VertexCollection::data to use std::size_t.
- Add provide() member to glue class for provider
  registration
- Document glue class template with comprehensive
  description of its role in flow graph registration
- Document make_glue() helper explaining void_tag
  behavior and state management
- Update provider_test to use provide() instead of
  provider() for consistency with other node types
Introduce declared_provider class and provider_node template for
handling data input into the graph. Providers accept level_id
and generate products.

Add provider registration to node_catalog and glue interface.
Register providers using input_family syntax for consistent
product association.

Update provider_test to use level_id reference and specified_label
syntax for provider registration.
Add provider_node template class that creates data products
on-demand from level IDs. Providers are registered via the
provide() API and wired into the graph by edge_maker, which
matches provider outputs to consumer inputs based on product
labels and families.

Modify multiplexer to route messages to provider nodes based
on level information. Update node_catalog to track provider
execution counts.

Add provider_test.cpp demonstrating provider registration
and execution with a toy VertexCollection example.

This development is not yet complete. All the libraries compile
and link, and all the tests compile and link. But most tests that
use a graph fail, because they have not yet been updated to
include the providers needed to work with this version of the
infrastructure.
Copy link
Contributor

@pcanal pcanal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From random sampling, the code looks self consistent, so LGTM.

@knoepfel
Copy link
Member

@greenc-FNAL I've opened a new pull request, #182, to work on those changes. Once the pull request is ready, I'll request review from you.

Unfortunately, PR #182 will not address the code coverage problems. Those will have to be solved gradually as we move forward.

@knoepfel knoepfel merged commit 7c11a93 into main Dec 11, 2025
36 checks passed
@knoepfel knoepfel deleted the providers branch December 11, 2025 21:04
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.

Introduce C++ data-product providers according to CDR

7 participants