-
Notifications
You must be signed in to change notification settings - Fork 212
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(swingset): initializeKindHandleKind early enough to support durables #4944
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.
One minor possible typo. Otherwise, seems legit.
Oh, I mixed up this PR with another one. Which is to say, the review above is a real review & assessment, but I haven't looked into the mysterious test changes yet. |
62e0906
to
3e5b090
Compare
@FUDCo figured out the first of the two questions I had: the N-1 version of I'll add a proper numerical sort to that test. |
9e0a722
to
d70dbbe
Compare
d70dbbe
to
404ca15
Compare
4bba6ac
to
e897bff
Compare
404ca15
to
bcfd68d
Compare
I think I figured out the second weird test difference. It's driven by the same root cause (different vrefs being generated and then sorted) but via completely different paths. In the previous version of the code the difference between the single- and multi-facet tests had to do with the order of operations -- basically, when in the sequence of things the various VOs got scanned for possibly being dead. This order, however, is sensitive to the vref strings themselves. The list of vrefs that |
e897bff
to
1a24b54
Compare
bcfd68d
to
be91ff7
Compare
Previously, `kindIDID` (the ID of the virtual object Kind that is used to hold the KindHandles we need for durable kinds) was allocated on-demand, the first time `makeKindHandle()` was called. The ID it received (and the ID of everything allocate afterwards) thus depended upon if/when userspace decided to use `makeKindHandle()`. In addition, `vrm.registerKind()` for the KindHandle kind was not called until `kindIDID` itself was allocated. This doesn't necessarily happen at all in the version-2 of a vat (i.e. if v2 doesn't define any additional durable kinds), and can't be relied upon to happen before v2 needs to deserialize the KindHandles that live in the 'baggage'. So this commit changes liveslots to factor out the initialization and registration into a new `initializeKindHandleKind` function, and arranges to call it during `startVat()`. Several "fake" test harnesses in `tools/` were updated to call it as they build their stuff. test-gc-kernel.js was updated to sort the extracted vrefs numerically, which was allowing the previous version of this test to pass despite having the wrong object IDs. refs #1848
be91ff7
to
ae91fff
Compare
Previously,
kindIDID
(the ID of the virtual object Kind that is usedto hold the KindHandles we need for durable kinds) was allocated
on-demand, the first time
makeKindHandle()
was called. The ID itreceived (and the ID of everything allocate afterwards) thus depended
upon if/when userspace decided to use
makeKindHandle()
.In addition,
vrm.registerKind()
for the KindHandle kind was notcalled until
kindIDID
itself was allocated. This doesn't necessarilyhappen at all in the version-2 of a vat (i.e. if v2 doesn't define any
additional durable kinds), and can't be relied upon to happen before
v2 needs to deserialize the KindHandles that live in the 'baggage'.
So this commit changes liveslots to factor out the initialization and
registration into a new
initializeKindHandleKind
function, andarranges to call it during
startVat()
. Several "fake" test harnessesin
tools/
were updated to call it as they build their stuff.Many unit tests were updated to deal with the change in allocated IDs,
but they ought to be somewhat more stable now. Two of these updates
puzzled me:
test-gc-kernel.js
, I understand why doomedExport1Vref changedfrom o+9 to o+10, and I'm not surprised that doomedExport2Vref is
now o+11, but I don't understand why doomedExport2Vref was o+9
before instead of o+10.
multi- facet test cases start behaving the same way? Why were
they different before?
refs #1848