Skip to content

[Solvergraph] add dynamically typed version of set_edges - #2158

Draft
tdavidcl wants to merge 5 commits into
Shamrock-code:mainfrom
tdavidcl:claude/inode-generic-set-edges-ykwf47
Draft

[Solvergraph] add dynamically typed version of set_edges#2158
tdavidcl wants to merge 5 commits into
Shamrock-code:mainfrom
tdavidcl:claude/inode-generic-set-edges-ykwf47

Conversation

@tdavidcl

Copy link
Copy Markdown
Member
  • Finalize API
  • Testing methodology?

Nodes wire their edges through EXPAND_NODE_EDGES-generated typed
setters that require exact shared_ptr<T> per slot, which isn't
expressible from Python bindings. Generate an additional set_edges
overload taking plain vectors of IEdge shared_ptr, dynamic_cast each
slot to the type the node actually expects, and raise a clear
std::invalid_argument naming the slot, edge name, and expected/actual
type on any mismatch (missing edge, null edge, wrong type, or wrong
edge count). Optional slots accept a null entry as "no value".

Assisted-by: Claude Code
Building shammodels_sph surfaced the warning on typeid(*edge).name();
bind a reference first, the same workaround INode::print_node_info()
already uses for the identical typeid(*edge) pattern.

Assisted-by: Claude Code
Assisted-by: Claude Code
@tdavidcl tdavidcl added the draft label Aug 22, 2026
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

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

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 77932c75-2685-4cd2-bce8-0fc8d1973cf3

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

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

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks @tdavidcl for opening this PR!

You can do multiple things directly here:
1 - Comment pre-commit.ci run to run pre-commit checks.
2 - Comment pre-commit.ci autofix to apply fixes.
3 - Add label autofix.ci to fix authorship & pre-commit for every commit made.
4 - Add label full-ci to run the full test suite (default is light CI; full CI also runs on Mergify merge-queue branches).
5 - Add label profile-build to run the compile-time build profile job even in light CI.
6 - Add label trigger-ci to create an empty commit to trigger the CI.

Once the workflow completes a message will appear displaying informations related to the run.

Also the PR gets automatically reviewed by gemini, you can:
1 - Comment /gemini review to trigger a review
2 - Comment /gemini summary for a summary
3 - Tag it using @gemini-code-assist either in the PR or in review comments on files

Split the generic vector-based set_edges() into a three-tier chain
instead of duplicating the per-slot casting logic:
set_edges(vector, vector) picks each slot in order and forwards to
set_edges_from_edges(shared_ptr<IEdge>...), which casts each slot to
its concrete type via __node_edge_cast_checked(_optional) and forwards
to the existing typed set_edges(shared_ptr<T>...).

set_edges_from_edges() needed a distinct name from set_edges(): for a
node whose edge type already is IEdge (NodeFreeAlloc), the typed and
untyped overloads would otherwise be identical and fail to compile.
Vector slots are also bound to named local variables before the
forwarding call, since argument evaluation order between call
arguments is unspecified in C++ and the previous ro_idx++/rw_idx++
per-argument pattern relied on left-to-right order.

Assisted-by: Claude Code
@github-actions

Copy link
Copy Markdown
Contributor

Workflow report

workflow report corresponding to commit 6d96dd1
Commiter email is timothee.davidcleris@proton.me

Light CI is enabled (the default for pull requests). This will only run the basic tests and not the full tests.
Full CI runs if the full-ci label is set, or automatically on Mergify merge-queue branches (mergify/merge-queue/*).
The merge gate job "on PR / all" is skipped in this case. Queue entry uses "on PR / all_light"; full CI runs in the merge queue.

Pre-commit check report

Pre-commit check: ✅

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check for merge conflicts................................................Passed
check that executables have shebangs.....................................Passed
check that scripts with shebangs are executable..........................Passed
check for added large files..............................................Passed
check for case conflicts.................................................Passed
check for broken symlinks................................................Passed
check yaml...............................................................Passed
detect private key.......................................................Passed
No-tabs checker..........................................................Passed
Tabs remover.............................................................Passed
cmake-format.............................................................Passed
Validate GitHub Workflows................................................Passed
clang-format.............................................................Passed
ruff check...............................................................Passed
ruff format..............................................................Passed
Check doxygen headers....................................................Passed
Check license headers....................................................Passed
Check #pragma once.......................................................Passed
Check SYCL #include......................................................Passed
No ssh in git submodules remote..........................................Passed
No UTF-8 in files (except for authors)...................................Passed

Test pipeline can run.

Clang-tidy diff report

No relevant changes found.
Well done!

You should now go back to your normal life and enjoy a hopefully sunny day while waiting for the review.

Doxygen diff with main

Removed warnings : 22
New warnings : 30
Warnings count : 8218 → 8226 (0.1%)

Detailed changes :
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:278: warning: Member INODE_DECL_RO(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:279: warning: Member INODE_DECL_RW(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:280: warning: Member INODE_PARAM_RO(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:281: warning: Member INODE_PARAM_RW(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:282: warning: Member INODE_PUSH_RO1(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:283: warning: Member INODE_PUSH_RW1(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:284: warning: Member INODE_PUSH_RO2(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:285: warning: Member INODE_PUSH_RW2(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:286: warning: Member INODE_GET_RO(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:287: warning: Member INODE_GET_RW(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:289: warning: Member INODE_DECL_RO_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:291: warning: Member INODE_DECL_RW_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:292: warning: Member INODE_PARAM_RO_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:293: warning: Member INODE_PARAM_RW_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:294: warning: Member INODE_PUSH_RO1_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:295: warning: Member INODE_PUSH_RW1_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:296: warning: Member INODE_PUSH_RO2_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:297: warning: Member INODE_PUSH_RW2_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:298: warning: Member INODE_GET_RO_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:299: warning: Member INODE_GET_RW_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:301: warning: Member EXPAND_NODE_EDGES(EDGES) (macro definition) of file INode.hpp is not documented.
- src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:321: warning: Member EXPAND_NODE_EDGES_OPTIONAL(EDGES) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:326: warning: Member INODE_DECL_RO(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:327: warning: Member INODE_DECL_RW(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:328: warning: Member INODE_PARAM_RO(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:329: warning: Member INODE_PARAM_RW(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:330: warning: Member INODE_PUSH_RO1(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:331: warning: Member INODE_PUSH_RW1(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:332: warning: Member INODE_PUSH_RO2(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:333: warning: Member INODE_PUSH_RW2(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:334: warning: Member INODE_GET_RO(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:335: warning: Member INODE_GET_RW(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:344: warning: Member INODE_CHECK_RO_ARG(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:346: warning: Member INODE_CHECK_RW_ARG(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:354: warning: Member INODE_COUNT_RW(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:355: warning: Member INODE_DECLARE_PICK_RO(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:356: warning: Member INODE_DECLARE_PICK_RW(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:357: warning: Member INODE_FORWARD_ARG(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:359: warning: Member INODE_DECL_RO_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:361: warning: Member INODE_DECL_RW_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:362: warning: Member INODE_PARAM_RO_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:363: warning: Member INODE_PARAM_RW_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:364: warning: Member INODE_PUSH_RO1_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:365: warning: Member INODE_PUSH_RW1_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:366: warning: Member INODE_PUSH_RO2_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:367: warning: Member INODE_PUSH_RW2_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:368: warning: Member INODE_GET_RO_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:369: warning: Member INODE_GET_RW_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:371: warning: Member INODE_CHECK_RO_ARG_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:373: warning: Member INODE_CHECK_RW_ARG_OPTIONAL(type, name) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:376: warning: Member EXPAND_NODE_EDGES(EDGES) (macro definition) of file INode.hpp is not documented.
+ src/shamsolvergraph/include/shamsolvergraph/node/INode.hpp:423: warning: Member EXPAND_NODE_EDGES_OPTIONAL(EDGES) (macro definition) of file INode.hpp is not documented.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant