-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Change to deterministic 64 bit type_ids for cross-binary serialisation #2949
Conversation
This commit changes to using 64 deterministic type_ids for 64 bit platforms. NOTE: 32 bit platforms inherit most of the changes except for the deterministic 64 bit type_ids (mainly due to serialisation / deserialisation issues due to pointers on 32 bit platforms being only 32 bits). Fixing this requires changing the serialisation format for 32 bit platforms to not match the in-memory format for types. This change is left as future work due to time constraints. Hashing the AST tree for a type to generate its type_id has also been left as future work due to time constraints. Changes include: * changing to 64 bit type_ids * changing all compile time and run time tests based on type_id numbering to now use `descriptor` based checks instead (the `descriptor` now holds additional information accoridngly). This change will likely had a performance impact which I have not quantified. * remove numeric size table (the info is now part of the type descriptor) * hashes the reach_type_t->name to generate the 64 bit type_id for 64 bit platforms; 32 bit platforms get sequential numbers for type_id's * changes the `key` for siphash to be based on the `md5` of the pony version
Instead of changing the meaning of the |
@jemc I have not. That's a good idea. I'll think about it and see how that might work. |
7f2981c
to
1aa0ea3
Compare
1aa0ea3
to
3b9c8bb
Compare
// twiddles. | ||
// See TODO in pony_deserialise_offset for related issue | ||
|
||
// If we are not in the map, we are an untraced primitive. Return the |
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.
@sylvanc would you be able to provide input on when this code path might be taken? (it would also be great if you were able to review this PR overall)
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.
The high bit is set when serialising a primitive. In pony_deserialise_offset
we use that to know that we can return the constant instance for the primitive type. So this can definitely happen.
The debug builds on Windows appear to be failing. |
There's an LLVM type assertion that's thrown at
I'm investigating this... Also, the changes to wscript need Python 3 support:
|
The reason the CI fails is that Windows usually pops up a dialog for assertions in debug mode. This is actually fixed in master, but it's fortuitous in this case :-) |
@dipinhora the following patch fixes Windows builds for me:
|
Did you intend to close this @dipinhora?
…On Sun, May 19, 2019, 15:10 Dipin Hora ***@***.***> wrote:
Closed #2949 <#2949>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2949?email_source=notifications&email_token=AABPIPGGCI34525R3J2W6R3PWGX4TA5CNFSM4GG67R62YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGORQVMEJI#event-2351612453>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABPIPD33NNV44XN2ROKFPTPWGX4TANCNFSM4GG67R6Q>
.
|
@SeanTAllen yes. Might get reopened or a new one created at some point in the future if I get back to this again. |
Was there a bug in it other than the Windows issue that Gordon came up with
a patch for?
…On Mon, May 20, 2019, 01:46 Dipin Hora ***@***.***> wrote:
@SeanTAllen <https://github.com/SeanTAllen> yes. Might get reopened or a
new one created at some point in the future if I get back to this again.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2949?email_source=notifications&email_token=AABPIPD3RYUHYVGNJQYOQLDPWJCLBA5CNFSM4GG67R62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVX26BA#issuecomment-493858564>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABPIPEP6BQXK53LXFDKAELPWJCLBANCNFSM4GG67R6Q>
.
|
There's the windows thing. And there are the open questions I listed in the original comment when I opened this PR. Aside from the progress Gordon made regarding Windows, there hasn't been much progress or clarification around the open questions. Given that I am not likely to look at this in the near future, it seemed best to close the PR rather than leave it sitting stale but open. |
The goal of this PR/change is to make cross binary serialisation between different programs built using the same Pony compiler version possible via deterministic 64 bit
type_id
s.This PR has the following open questions:
type_id
numbering and bitwise operations ontype_id
s but is now based on a field in thetype descriptor
pony_serialise_offset
(seeTODO
added into that function)type_id
s are currently based on a hash of thereach_type_t->name
but should ideally be based on the AST of the type insteadI've marked this as
DO NOT MERGE
until the open questions have been addressed.