Skip to content
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

fix(xsnap)!: upgrade to latest XS #3906

Merged
merged 1 commit into from
Sep 30, 2021
Merged

fix(xsnap)!: upgrade to latest XS #3906

merged 1 commit into from
Sep 30, 2021

Conversation

warner
Copy link
Member

@warner warner commented Sep 29, 2021

Note that this breaks snapshot compatibility, and probably metering
compatibility.

closes #3889

@dckc a few questions:

  • The swingset unit test needed to be changed because the snapshot format has changed. I added a "do two new runs get the same hash" test, which is nominally redundant with the "does this new run have the same hash as some previous run" test, to emphasize the property we expect, and so that when we change the format, we should expect to see the same-as-past test fail but the same-as-two-now test pass. Let me know if that makes sense.
  • Similarly, the "is the compressed snapshot between 10% and 20% of the uncompressed size" test seemed brittle, I changed it to just <50%.
  • I didn't change any metering tests, and nothing failed, which either means the XS changes didn't change metering behavior (which is entirely possible), or we don't have any tests which are picky enough about metering to tell (also possible). Do you think I should bump the metering version? And if so, is that an xsnap-pub change? And if that's true, any idea how we should coordinate making changes in the xsnap-pub repo in reaction to changes in the xs repo?
  • I haven't tried to update xsnap-pub yet, I'll look at that separately. Tests passed, so I'm guessing that the XS changes didn't really require e.g. additions to the callback table that xsnap has to manage (one big/obvious reason for snapshot incompatibility). Does that seem likely?

@warner warner added the xsnap the XS execution tool label Sep 29, 2021
@warner warner requested a review from dckc September 29, 2021 16:34
@warner warner self-assigned this Sep 29, 2021
@dckc
Copy link
Member

dckc commented Sep 29, 2021

  • The swingset unit test needed to be changed because the snapshot format has changed.

I hadn't thought of that as a breaking change. Perhaps change the comment above the 'XS + SES snapshots are long-term deterministic' test to emphasize that?

... I added a "do two new runs get the same hash" test

sure, that's fine.

  • Similarly, the "is the compressed snapshot between 10% and 20% of the uncompressed size" test seemed brittle, I changed it to just <50%.

yeah, I guess that's plenty to detect whether gzip is doing something or not; the exact ratio doesn't matter.

  • I didn't change any metering tests, and nothing failed, which either means the XS changes didn't change metering behavior (which is entirely possible), or we don't have any tests which are picky enough about metering to tell (also possible). Do you think I should bump the metering version?

I'm a little surprised that neither the xsnap nor Zoe metering tests are failing. I would much prefer to see metering changes detected by tests. So I think not changing the metering version is OK.

But I also think it's OK to change it just to be conservative.

And if so, is that an xsnap-pub change?

No.

  • ... I'm guessing that the XS changes didn't really require e.g. additions to the callback table ... Does that seem likely?

yes.

@dckc
Copy link
Member

dckc commented Sep 29, 2021

My habit is to put changes to submodule versions in their own commit.

I can't think of any reason that it's critical, though. Maybe it only matters when I'm rebasing stuff in my local tree.

@dckc
Copy link
Member

dckc commented Sep 29, 2021

"latest" isn't likely to be helpful down some weeks / months. I prefer to see something like "fix a major memory leak" in the commit headline.

Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

Good stuff.

I have some suggestions, but nothing critical.

We upgrade the XS submodule to the latest version:
Moddable-OpenSource/moddable@10cc52e

This fixes a major memory leak: 64 bytes per Map `delete()`, 32 per Set
`delete()`. We believe this should: closes #3839

Unfortunately Map/Set deletion is now O(N) not O(1).

This version of XS also fixes a bug that might be the cause of #3877 "cannot
read (corrupted?) snapshot", but we're not sure.

Note that this breaks snapshot compatibility (snapshots created before this
version cannot be loaded by code after this version). It might also
break metering compatibility, but the chances seem low enough that we decided
to leave the metering version alone.

closes #3889
@warner
Copy link
Member Author

warner commented Sep 30, 2021

Ok, updated the comments a bit, will land when CI finishes.

@warner warner merged commit 9a70831 into master Sep 30, 2021
@warner warner deleted the 3889-update-xs branch September 30, 2021 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
xsnap the XS execution tool
Projects
None yet
2 participants