Skip to content

feat(core): integrate translator nodes into the graph - #1003

Open
marcpaterno wants to merge 3 commits into
stack/concept-registry/04-conversion-recordsfrom
stack/concept-registry/05-translator-integration
Open

marcpaterno wants to merge 3 commits into
stack/concept-registry/04-conversion-recordsfrom
stack/concept-registry/05-translator-integration

Conversation

@marcpaterno

@marcpaterno marcpaterno commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

PR 5 of the concept-registry stack; review against
stack/concept-registry/04-conversion-records.

Add explicit translate registration for one-input/one-output algorithms using
the existing runtime-base and typed-node architecture.

framework_graph / graph_proxy.translate
  -> registration builder -> typed translator_node
  -> runtime declared_translator (consumer + independent producer)
  -> retrieve selected input -> invoke callable -> emit produced result

result metadata
  creator = translator algorithm       suffix = registered output suffix
  index   = input data-cell index      stage  = translator execution stage
  • Constrain translator callables to exactly one input parameter and one output
    object; expose registration through the framework graph and typed graph proxy.
  • Add translator storage/registration, consumer and producer collection,
    predicate-edge wiring, execution counting, and build entries.
  • Emit a new product store containing the produced result, reusing the input
    index and message ID, with translator output specifications and execution stage.
  • Add an end-to-end provider -> translator -> observer regression checking value,
    creator, suffix, layer, distinct input/output stages, index-pointer identity,
    and execution counts.

This does not connect execution to concept conversion records or enforce concept
membership. It does not add discovery, registration-only conversion, module-level
translate exposure, input creator/suffix/stage inheritance, or borrowed-source
lifetime retention. Existing upstream producer/selector behavior is preserved;
Python, FORM, and naming-consumer implementations are unchanged.

Evidence

  • Before: The parent has concept conversion records but no explicitly
    registered executable translator node in the computational graph.
    After: function_registration passes 26 assertions in 2 cases, including
    translation to 1.5, downstream consumption, and all metadata/count checks.
  • Full configured build passed, including Python and FORM targets.
  • Focused graph/catalog/selector/Python/FORM selection: 43/43 CTests passed.
    Configured py:phlex: 11 pytest cases passed, none skipped.
  • Full boundary suite: 119/119 CTests passed. Whole-stack reconciliation subsequently
    reran the final-tip build and all 119 CTests successfully.
  • All 13 changed files passed hooks and whitespace checks. Runtime and typed
    translator implementations match the preserved original source exactly.

The before/after is the feature delta, not a failing-parent test claim. Evidence
is local macOS/AppleClang with Python and FORM ROOT_TTREE; no Linux, sanitizer,
cppyy, coverage-instrumentation, or RNTuple claim. Predicate wiring is inspected,
but no dedicated translator predicate-filter or resource-arbitration regression
is claimed.

Merge Danger

Door: Two-way

No persisted-format migration. Reversion requires removing translator registrations
and dependent workflows; this is the broadest runtime change in the stack.

Blast Radius: Graph

Translators affect product routing, catalog participation, predicate edges, and
execution accounting. Outputs have the translator's identity and execution stage,
not the input's identity/stage. A conversion returning a borrowed view is not made
safe by this node: its new store does not retain the input store for that purpose.


Stack created with GitHub Stacks CLI • Give Feedback 💬

  • Code: Added translator registration through framework_graph, graph_proxy, and glue. Translator nodes consume one input, produce one output, and connect to product routing and predicate-filter edges.
  • Runtime: Added translator catalog entries for producer and consumer discovery, plus execution counts and per-layer product counts.
  • Test coverage: Added an end-to-end provider → translator → observer regression. It checks the translated value, product metadata, shared data-cell index, and execution counts.
  • Validation: The author reports passing local build, test, and hook checks. Linux, sanitizer, cppyy, coverage-instrumentation, and RNTuple were not tested. No dedicated translator predicate-filter or resource-arbitration regression is reported.

@marcpaterno
marcpaterno added this pull request to stack #1004 October 21, 2026 17:45
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 749a4774-685b-4dfd-ab6b-16cf4ededb51

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The change adds translator registration to the graph API. It defines one-input, one-output translator callables, executes them as flow-graph nodes, and includes them in graph catalogs and predicate-filter connections.

Changes: Translator flow

Layer / File(s) Summary
Translator callable and consumer contract
phlex/core/concepts.hpp, phlex/core/declared_translator.hpp, phlex/core/declared_translator.cpp, phlex/core/CMakeLists.txt
New concepts define the translator callable shape. The declared translator class combines consumer and producer behavior and requires a product count.
Translator flow-graph execution
phlex/core/translator_node.hpp, phlex/core/registration_api.hpp, phlex/core/CMakeLists.txt
The translator node invokes the callable, wraps its result in a product store, forwards the input message ID, and tracks calls and per-layer product counts.
Graph registration and catalog integration
phlex/core/framework_graph.hpp, phlex/core/graph_proxy.hpp, phlex/core/glue.hpp, phlex/core/framework_graph.cpp, phlex/core/node_catalog.hpp, phlex/core/node_catalog.cpp, test/function_registration_test.cpp
The graph APIs register translators. Node catalogs include translator consumers and producers, execution counts include translator calls, and predicate filters connect to translators. The test checks translated output and execution counts.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant framework_graph
  participant glue
  participant translator_node
  participant translator_callable
  participant downstream_observer
  framework_graph->>glue: register translator
  glue->>translator_node: construct and register node
  translator_node->>translator_callable: invoke with input
  translator_callable-->>translator_node: return output
  translator_node->>downstream_observer: forward output with input message ID
Loading

Suggested reviewers: knoepfel, sabasehrish

Merge Risk: Low · previous review d9e39

The change is mergeable with a known limitation: translators should return owned results, because a result that borrows from its input can become invalid before an observer uses it.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(core): integrate translator nodes into the graph" matches the main change. The PR adds translator registration through framework_graph and graph_proxy, a new translator_node flow-graph…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "feat(core): integrate translator nodes into the graph" matches the main change. The PR adds translator registration through framework_graph and graph_proxy, a new translator_node flow-graph node, a declared_translator class, and node_catalog wiring. The title is short, specific, and follows a conventional-commit style. It does not mention the end-to-end test, but that is expected.

Finishing Touches

🧪 Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.10345% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
phlex/core/translator_node.hpp 87.87% 4 Missing ⚠️
@@                               Coverage Diff                                @@
##           stack/concept-registry/04-conversion-records    #1003      +/-   ##
================================================================================
- Coverage                                         91.63%   91.49%   -0.14%     
================================================================================
  Files                                               185      188       +3     
  Lines                                              6106     6164      +58     
  Branches                                            979      981       +2     
================================================================================
+ Hits                                               5595     5640      +45     
- Misses                                              325      336      +11     
- Partials                                            186      188       +2     
Flag Coverage Δ
amd64 91.49% <93.10%> (-0.14%) ⬇️
arm64 91.49% <93.10%> (-0.14%) ⬇️

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

Files with missing lines Coverage Δ
phlex/core/declared_translator.cpp 100.00% <100.00%> (ø)
phlex/core/declared_translator.hpp 100.00% <100.00%> (ø)
phlex/core/framework_graph.cpp 100.00% <100.00%> (ø)
phlex/core/framework_graph.hpp 100.00% <100.00%> (ø)
phlex/core/glue.hpp 100.00% <100.00%> (ø)
phlex/core/graph_proxy.hpp 100.00% <ø> (ø)
phlex/core/node_catalog.cpp 95.74% <100.00%> (+0.39%) ⬆️
phlex/core/node_catalog.hpp 100.00% <100.00%> (ø)
phlex/core/registration_api.hpp 100.00% <ø> (ø)
phlex/core/translator_node.hpp 87.87% <87.87%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

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

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

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Clang-Tidy Check Results

Clang-tidy found the following issue(s) on lines changed by this pull request:

/__w/phlex/phlex/phlex-src/phlex/core/translator_node.hpp:39: warning: redundant 'typename'
/__w/phlex/phlex/phlex-src/phlex/core/translator_node.hpp:40: warning: redundant 'typename'

Download clang-tidy artifacts

@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch from 97aff1d to 1c48cee Compare October 22, 2026 15:46
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch 2 times, most recently from 4110bb2 to d9e39e0 Compare October 28, 2026 15:56
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch 2 times, most recently from 371d585 to b9bc87c Compare October 28, 2026 16:38
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch 2 times, most recently from 149057f to b5ac35e Compare November 2, 2026 21:59
@knoepfel
knoepfel force-pushed the stack/concept-registry/05-translator-integration branch from b5ac35e to e976ca1 Compare November 3, 2026 16:06
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch from e976ca1 to 07ce22f Compare November 3, 2026 16:18
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch 2 times, most recently from 523c5aa to 13e8258 Compare November 3, 2026 21:58
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch 2 times, most recently from bebccfe to a69a88d Compare November 4, 2026 15:17
Comment thread phlex/core/declared_translator.cpp Fixed
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch from a69a88d to c29b8d7 Compare November 4, 2026 16:18
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch 3 times, most recently from 66cce08 to 2ef2856 Compare November 12, 2026 19:43
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch from 2ef2856 to 2437b67 Compare November 12, 2026 19:59
@knoepfel
knoepfel force-pushed the stack/concept-registry/05-translator-integration branch from 2437b67 to 1c753de Compare November 12, 2026 20:14
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch from 1c753de to 3685208 Compare November 14, 2026 16:04
@marcpaterno
marcpaterno removed this pull request from stack #1004 November 14, 2026 16:12
@marcpaterno
marcpaterno added this pull request to stack #1069 November 14, 2026 16:12
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch 4 times, most recently from 88a77a6 to 83f005d Compare November 14, 2026 23:59
@marcpaterno

Copy link
Copy Markdown
Member Author

@phlexbot format

@github-actions

Copy link
Copy Markdown
Contributor

Format Fixes Applied

❌ clang-format workflow failure
❌ cmake-format workflow failure
❌ header-guards workflow failure
❌ jsonnetfmt workflow failure
❌ markdownlint workflow failure
❌ ruff workflow failure
❌ YAML formatter workflow failure

⚠️ Note: Some issues may require manual review.

@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch 8 times, most recently from 8bd04fb to c0d8ef6 Compare November 20, 2026 22:20
@knoepfel
knoepfel force-pushed the stack/concept-registry/05-translator-integration branch from c0d8ef6 to c5ce994 Compare November 20, 2026 22:34
Register one-input, one-output translators as consumers and independent
producers on the runtime/typed-node architecture.

Preserve translator creator, registered suffix, input data-cell index,
and execution stage, with end-to-end observer regression coverage.
The translator registration test named its stages "translator-test" and
"input-stage". Identifiers may now contain only ASCII letters, digits,
and underscores, so the test threw std::invalid_argument when this
layer is stacked on the identifier validation change.

Rename the two stages to "translator_test" and "input_stage".
@marcpaterno
marcpaterno force-pushed the stack/concept-registry/05-translator-integration branch from c5ce994 to 8dfc792 Compare November 24, 2026 18:20

This branch has not been deployed

No deployments
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.

2 participants