New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GIE/Runtime] Support Entry
Trait in GIE/Runtime
#2300
Conversation
…mon used type. Fix CI Tests.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2300 +/- ##
=======================================
Coverage 39.95% 39.95%
=======================================
Files 88 88
Lines 9757 9757
=======================================
Hits 3898 3898
Misses 5859 5859 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments in Entry
definitions.
|
||
#[derive(Debug)] | ||
pub enum EntryDataType { | ||
Vid, // A vertex global id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not assume Vid
. Id
is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Vid
here since we may need to specify whether it is a Vid
or Eid
when getting properties in Auxilia
. It would be modified as an Id
once we separate GetVProp
and GetEProp
from Auxilia
.
fn eq(&self, other: &Self) -> bool { | ||
match (self, other) { | ||
(EntryDataType::Vid, EntryDataType::Vid) | ||
| (EntryDataType::Vid, EntryDataType::V) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why V
and Vid
should be compared to equal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vid
(for now) denotes an IdOnlyVertex
, and can be compared with a V
. Later, it can also be reffered as an IdOnlyEdge
, etc.
|
||
pub trait Entry: Debug + Send + Sync + AsAny + Element { | ||
fn get_type(&self) -> EntryDataType; | ||
fn as_vid(&self) -> Option<ID> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similarly as_id()
impl Eq for DynEntry {} | ||
|
||
// demanded when need to group (ToSum) the entry; | ||
impl std::ops::Add for DynEntry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like we should not implement Add
for entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Move this logic into the implementation of Accumulator
.
P, | ||
Obj, | ||
Intersect, | ||
Collection, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment these entry options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub struct IDEntry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IdEntry
. BTW, for the next a few definitions, can put VertexEntry
, EdgeEntry
, PathEntry
, IntersectionEntry
and CollectionEntry
. Anyway, if we already have DynEntry
, why we should have so many different entry definitions?
29b2674
to
dbf83dc
Compare
} | ||
} | ||
|
||
impl From<Vertex> for DynEntry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not implement
impl<E: Entry + 'static> From<E> for DynEntry { ... }
Then the new()
function in DynEntry
can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot do this since DynEntry
is also an Entry
, and we'll get the error:
error[E0119]: conflicting implementations of trait `std::convert::From<process::entry::DynEntry>` for type `process::entry::DynEntry`
--> runtime/src/process/entry.rs:574:1
|
574 | impl<E: Entry + 'static> From<E> for DynEntry {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `core`:
- impl<T> From<T> for T;
f4761fb
to
a315854
Compare
pub struct Intersection { | ||
vertex_vec: Vec<Vertex>, | ||
pub struct IntersectionEntry { | ||
vertex_vec: Vec<ID>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also comment in details for what the IntersectionEntry
is, and how it will be used.
What do these changes do?
As titled.
A test of PatternMatch on LDBC.30 shows a 10-40% acceleration in time cost (when using a
IdEntry
inExpandItersect
).Related issue number
Fixes #2317