Hash Table based RzGraph - #6152
Conversation
notxvilka
left a comment
There was a problem hiding this comment.
Please fix the failing CI jobs (except old Debians - this seems unrelated to these changes)
|
Yes, I still work on moving the private structures to a private header and add getters for the struct members. |
| /** | ||
| * \brief Returns the index of the node in the internal vector. | ||
| * | ||
| * DO NOT USE! | ||
| * | ||
| * It only exists for compatibility reasons and because refactoring is | ||
| * more effort than currently acceptable. | ||
| * | ||
| * Justification: | ||
| * The old implementations had exactly two identifiers for nodes. | ||
| * The pointer to the node itself, or its index into the internal list storing it. | ||
| * I skip the part how what a not good design decision this was. | ||
| * But in the new graph this data is considered private (index into lists/hash table) | ||
| * or are not expected by the graph user to be tracked (the individual node pointers). | ||
| * | ||
| * Sadly the json output of the graph still uses the vector indices as "ids". | ||
| * We can't replace them with the actual hash_id of a node. Because most graphs don't implement a hash function. | ||
| * For these cases the pointer is used internally as node hash. | ||
| * And printing it in json output would not be stable. | ||
| * Hence this hack. | ||
| */ |
There was a problem hiding this comment.
@notxvilka Resolve here? Or open an issue about it and fix later?
There was a problem hiding this comment.
@Rot127 depends on the effort needed. If it's something that could be done quickly - here, if not - in a separate PRs.
There was a problem hiding this comment.
Let's better do it in a separated PR.
The fix requires all the graphs we have (see rz_core_graph()) to define a hash function.
This affects some tests and is hence easier to review in isolation.
This comment was marked as resolved.
This comment was marked as resolved.
Good idea, but it requires the change in |
|
Also useful for |
Add comments Basic support for list and matrix based graph refactor Add rz_graph_*_new node and edge API Modify calling for rz graph edge data Add dfs and visitor mode Add new get nth neighbours Add unit test and wrapper for get edges Bug fixed and unit test Solve TODO about better semantic of get nodes Doc RZ_API and other functions, split impl to new files [cannot build] remove old graph impl and rename new graph API
Update Wrapper for graph identifier Ordered Nodes in graph drawable Fix icfg and several agraph refactor issues Use kahn to get topo sort in assign_layers Introduce khan for assign_layer and find DAG cycle and backedges in algorithm
04febc0 to
9e8d29e
Compare
9e8d29e to
6a64b2a
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files
... and 12 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
* Basic implement of list based and matrix based graph Add comments Basic support for list and matrix based graph refactor Add rz_graph_*_new node and edge API Modify calling for rz graph edge data Add dfs and visitor mode Add new get nth neighbours Add unit test and wrapper for get edges Bug fixed and unit test Solve TODO about better semantic of get nodes Doc RZ_API and other functions, split impl to new files [cannot build] remove old graph impl and rename new graph API * Rewrite and replace agrach, cgraph, drawable_graph, il_graph with new API * Refactor graph API and fix unit test and multiple leaks Update Wrapper for graph identifier Ordered Nodes in graph drawable Fix icfg and several agraph refactor issues Use kahn to get topo sort in assign_layers Introduce khan for assign_layer and find DAG cycle and backedges in algorithm * Fix self loop and update db test * Solve request changes * Fix cbpf db * Fix test graph warning in testing NULL deletion * Fix mismatched rz_agraph_compute_layout nonnull * Fix memleak * Clean and fix code * Fix memleak in graph free * Fix memleak in matrix implement * Add bindgen doc * Fix memleak in early exit * Fix rz-bindgen warning comments * Make graph structures private. * Fix Windows C2036 * Fix typo in type annotation. * Add new type annotations for RzGraph and HtPP --------- Co-authored-by: Heersin <teablearcher@gmail.com>
Your checklist for this pull request
RZ_APIfunction and struct this PR changes.RZ_API).Detailed description
rz_core_graph().RZ_DEPRECATEDfunctions can be removed.Test plan
...
Closing issues
...