-
Notifications
You must be signed in to change notification settings - Fork 199
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
ibid mechanism broken #161
Comments
Can you make this into a unit test? I just tried a simple set of arrays ( The test should probably go into test-marshal.js in "serialize exports". If you can write a test that fails and post it here (or put it on a branch), I'll try to find the fix. |
Sure, sounds good!
…On Mon, May 6, 2019, 9:01 AM Brian Warner ***@***.***> wrote:
Can you make this into a unit test? I just tried a simple set of arrays (
serialize([a1,a2,a3,a3,a2,a1])) and it seems to serialize correctly, but
that case isn't introducing any new objects in the post-replacer data, and
it sounds like that's the core problem.
The test should probably go into test-marshal.js in "serialize exports".
If you can write a test that fails and post it here (or put it on a
branch), I'll try to find the fix.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/Agoric/SwingSet/issues/30#issuecomment-489674970>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAST63PEOH2HU7K3YGDWJ6DPUBI4NANCNFSM4HKXWUPQ>
.
|
I added a unit test here: Agoric/SwingSet@e6c6350 |
Ah, yeah, this will be tricky. We're saving a lot of code by relying upon the built-in JSON serialization features. But the Worst case we'll have to write our own deserializer. It might also be possible to serialize the data, unserialize it (without a reviver), then re-serialize it with a replacer that changes the |
I have some ideas here, to talk about when we're next in at the same time. In the meantime, Agoric/SwingSet@508982d safely turns ibids off in a way that should work well enough in the absence of cycles. However, it will expand pass-by-copy dags into trees. |
That quick fix sounds good, and our marshalling layer will already combine multiple refs to the same import/export slot into a single index (even without the ibid mechanism). I'll land that now, and then we can defer the full fix until later. |
Can you use a path rather than an index, a la cycle? |
Perhaps. Opened https://github.com/Agoric/SwingSet/issues/66 to track. Closing this one though, since ibids with indexes are no longer broken. |
in the old repo. this was SwingSet issue 30 |
* add simple exchange
I came across an issue when I was trying to return an array that contains the same presence twice. It errors with the message, 'ibid out of range'.
When notifyFulfillToData (line 409 of liveSlots.js on my branch) is called, it has the following as arguments:
MarkM says: "The ibid mechanism is broken because the replacer during serialization assigns ibid indices in preorder whereas the JSON reviver only sees objects in post order, and therefore has different ibid indices."
The text was updated successfully, but these errors were encountered: