Repository navigation
feat(model): store concept translator registrations - #1002
marcpaterno wants to merge 5 commits into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
| Layer / File(s) | Summary |
|---|---|
Translator registration contract phlex/model/data_product_concept.hpp |
Adds result_storage and translator_registration, plus APIs to register and find translators. The concept stores registrations by ordered type pair. Equality compares the concept name and concrete types, excluding translators. |
Registration and lookup implementation phlex/model/data_product_concept.cpp |
Registration rejects identical types, types outside the concept, and duplicate pairs. Lookup returns the registration or nullptr. |
Translator registration tests test/data_product_concept_test.cpp |
Adds translator fixtures and tests for lookup, callable and storage metadata, ordered pairs, invalid registrations, and duplicate registration. Updates existing concrete-type tests to use the new fixtures. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Possibly related PRs
- Framework-R-D/phlex#1001: Introduces
data_product_conceptand its concrete-type set, which translator registration uses. - Framework-R-D/phlex#999: Establishes the concept-registry work that this change extends.
Suggested reviewers: knoepfel
Merge Risk: 
Minimal · previous review 7c02e
-
No merge-blocking issue was established; the change is ready for normal merge checks.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title "feat(model): store concept translator registrations" matches the main change. The changeset adds translator registration records to data_product_concept, keyed by ordered concrete type pairs, with validation and lookup via find_translator. The title is short, specific, and in conventional commit style. It names the scope (model) and the primary change (storing translator registrations), so a teammate scanning history would understand the main point.
-
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.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1002 +/- ##
==========================================
+ Coverage 91.45% 91.63% +0.17%
==========================================
Files 185 185
Lines 6073 6106 +33
Branches 973 979 +6
==========================================
+ Hits 5554 5595 +41
+ Misses 331 325 -6
+ Partials 188 186 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
2f108b1 to
67942f7
Compare
71e72a8 to
c25209d
Compare
f8c0211 to
7c02e20
Compare
7c02e20 to
26a1b83
Compare
26a1b83 to
58c272d
Compare
58c272d to
6e1c96f
Compare
7e9140e to
cb2f7aa
Compare
fee70d4 to
2010772
Compare
2010772 to
73800a5
Compare
73800a5 to
2da3a40
Compare
756fb02 to
746982a
Compare
746982a to
d423ab5
Compare
Add result storage metadata and type-erased conversion functions to data product concepts, with validation for concrete types, identical types, and duplicate ordered pairs. Add tests covering registration lookup, conversion round-tripping, storage semantics, and validation failures.
- Add missing <any> and <cstdint> includes - Set std::uint8_t as the underlying type of result_storage - Use designated initializers for translator_registration - Separate the registry source's own header include group
Replace the concept factory helper with add_both_types, which populates a caller-owned concept because data_product_concept is neither movable nor assignable. Use the soa_vertices and aos_vertices types in the add_concrete_types self-insertion test, and make the translator input const.
- Split the unknown-type case into sections for an empty registry and a registry whose concepts all lack the queried type. - Add a non-matching distractor concept to the multi-concept lookup test so an implementation that returns an arbitrary concept fails. Require a non-null result and check that it contains the queried type and is not the distractor.
The get_concept_for_type method has already been removed from data_product_concept_registry, so its test cases are removed with it.
d423ab5 to
8f3aeb8
Compare
Summary
PR 4 of the concept-registry stack. Review against
main; the preceding change merged in #1068.Concept equality still compares only name and concrete types. Duplicate-name registry insertion merges concrete types, not translator records.
This PR stores and retrieves registrations. It does not check whether the payload is callable or matches the declared pair, enforce storage lifetimes, or wire the records into graph execution. Discovery and input metadata are unchanged.
Evidence
d423ab52,git diff --checkpassed againstmain. The test source contains 17 test cases and 41 assertion sites; these are source counts, not runtime results. The build, CTests, and hooks were not rerun at this revision for this update.Merge Danger
Door: Two-way
Additive in-memory APIs with no persisted-format change. Reverting after downstream adoption would require removing or adapting callers.
Blast Radius: Model
A missing or incorrectly typed callable can fail when retrieved or used. A borrowed result refers to input storage; callers must keep the source alive for as long as they use the result.
Stack created with GitHub Stacks CLI • Give Feedback 💬