Skip to content

Conversation

@dolio
Copy link
Contributor

@dolio dolio commented Aug 7, 2025

This fixes an oversight that was preventing loading of serialized values in the new format.

During loading, we check if we know all the references necessary to make sense of the values as values. So, for example, if you are loading a Code, you just need to know the Code reference.

Version 5 has all the references mentioned anywhere in the value lifted out to the top. At some point, I thought I could just return those, but this is wrong. For instance, a Code value will have all the references mentioned in the code there. And a term link value will have the reference from the term link, which you do not need to have loaded in the runtime just to talk about the link (it would be impossible to ever load new code if this were the case).

So, I've changed it back to doing the correct traversal and collecting the necessary references.

I also changed the random-deserial transcript to randomize the order we load different versions in. Those are the tests designed to catch problems like this, but since v4 was always loaded before v5, the references would always be known (because the v4 loading would add them).

dolio added 2 commits August 7, 2025 14:50
This was covering for problems in the implementation. v5 would only
work after v4 was already loaded.
The 'what do I need to load' checker was erroneously returning all
the references mentioned in the values, rather than just the ones
actually needed to load.
Copy link
Member

@pchiusano pchiusano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍😎

Copy link
Contributor

@ceedubs ceedubs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've validated that this fixes the issue that the Unison Cloud integration tests encountered 🎉

@aryairani aryairani merged commit f5dc99f into trunk Aug 7, 2025
31 checks passed
@aryairani aryairani deleted the fix/v5-loading branch August 7, 2025 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants