-
Notifications
You must be signed in to change notification settings - Fork 12
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
PDB Serialization (Pt. 2) #71
Conversation
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.
I'll try to debug why this doesn't work. I hope you don't mind that I use the review function to ask questions about specific parts of the code.
src/pdb/mod.rs
Outdated
test_roundtrip_with_args( | ||
&[ | ||
0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 7, 64, 0, |
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.
Where did you get this from? Just exporting from rekordbox?
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.
Yes, IIRC It's a page from the rekordbox export in this repo. I should've documented this in a comment.
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.
I'll add a comment when I open the PR with the solution.
Don't worrry and thanks for looking into this. |
I think I've gotten closer to the solution. One problem is that the export we generate has the rows in reverse. The other one is that rekordbox has additional padding between each row. I'll try to find a reason or a pattern to emulate. |
src/pdb/mod.rs
Outdated
#[br(offset = page_heap_offset, args { count: num_rows.into(), inner: (page_type,) })] | ||
rows: Vec<FilePtr16<Row>>, | ||
#[br(offset = page_heap_offset, parse_with = FilePtr16::parse, args { count: num_rows.into(), inner: (page_type,) })] | ||
rows: Vec<Row>, |
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.
This is not the same and thus this branch also broke plain reading unfortunately. The proper implementation is a vector of pointers while the new one is a pointer of a vector.
Also, since the manual write implementation RowGroup::write_options_and_get_row_offset
is already quite complex I'm questioning it makes sense to continue down this path. In the end it comes down to requiring some sort of FilePtr
serialization IMO. Also, some sort of abstract heap would be nice too (since Pages are also essentially just heap allocated too).
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.
Well, that would require computing the offsets beforehand (to instantiate FilePtr32
), which would make it hard to create a PDB file from scratch. The user likely does not care about the offsets. This is why I chose this approach, but I'm open to ideas.
6a7e25d
to
0b11bcd
Compare
0b11bcd
to
3f90b88
Compare
Removed the broken code so that we can get the working changes in. Other stuff will go into a later PR. |
Currently not working correctly, as the unittest fails. I'm currently a bit busy and don't have too much time to debug it. If anyone else wants to start working on it or give feedback, I'd appreciate it.
Related issue: #68