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

Continued implementation of resolved promise pruning #930

Merged
merged 13 commits into from
May 18, 2020

Conversation

FUDCo
Copy link
Contributor

@FUDCo FUDCo commented Apr 15, 2020

These changes implement the c-list cleanup and liveslots table cleanup portions of getting rid of resolved promises.

@FUDCo FUDCo added enhancement New feature or request SwingSet package: SwingSet performance Performance related issues labels Apr 15, 2020
@FUDCo FUDCo requested a review from warner April 15, 2020 06:40
@warner warner self-assigned this Apr 15, 2020
Copy link
Member

@warner warner left a comment

Choose a reason for hiding this comment

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

Please move the kernel-side retirement one step earlier as noted. I'll look at the tests and see if there's an easy way to add an assertion for this (it'll mean getting control in the middle of a dispatch and checking the kernel tables at that point).

packages/SwingSet/src/kernel/vatManager.js Outdated Show resolved Hide resolved
packages/SwingSet/test/test-vpid-liveslots.js Outdated Show resolved Hide resolved
warner added a commit that referenced this pull request Apr 15, 2020
We need an additional assertion: the upcoming promise-retirement change
should remove the kernel c-list entries *before* the vat is notified about
incoming resolutions, not afterwards. This adds a test which looks at the
c-lists during that notification, so we have a place to update when the
change lands.

refs #930
warner added a commit that referenced this pull request Apr 15, 2020
We need an additional assertion: the upcoming promise-retirement change
should remove the kernel c-list entries *before* the vat is notified about
incoming resolutions, not afterwards. This adds a test which looks at the
c-lists during that notification, so we have a place to update when the
change lands.

refs #930
@@ -300,52 +303,24 @@ async function doVatResolveCase23(t, which, mode) {
// now it sends three() with the promise. For now, we expect the same vpid
Copy link
Member

Choose a reason for hiding this comment

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

I think this comment is stale: once promises are retired, we expect a new vpid in the post-resolution messages

warner added a commit that referenced this pull request Apr 16, 2020
We need an additional assertion: the upcoming promise-retirement change
should remove the kernel c-list entries *before* the vat is notified about
incoming resolutions, not afterwards. This adds a test which looks at the
c-lists during that notification, so we have a place to update when the
change lands.

refs #930
warner added a commit that referenced this pull request Apr 16, 2020
We need an additional assertion: the upcoming promise-retirement change
should remove the kernel c-list entries *before* the vat is notified about
incoming resolutions, not afterwards. This adds a test which looks at the
c-lists during that notification, so we have a place to update when the
change lands.

refs #930
warner added a commit that referenced this pull request Apr 16, 2020
We need an additional assertion: the upcoming promise-retirement change
should remove the kernel c-list entries *before* the vat is notified about
incoming resolutions, not afterwards. This adds a test which looks at the
c-lists during that notification, so we have a place to update when the
change lands.

refs #930
warner added a commit that referenced this pull request May 7, 2020
rewrite liveslots use of HandledPromise, remove deliver() stall

refs #894
refs #930 (should unblock, although rewrites will be needed)
refs #767 refs #766 (should unblock)
closes #1053 (includes rebased form of the PR)
closes #769 (incidentally)
@warner warner assigned FUDCo and unassigned warner May 7, 2020
@warner
Copy link
Member

warner commented May 7, 2020

with #1068 landed, this should be unblocked.. you'll need to rewrite things, but the core HandledPromise stale-vpid problem should be fixed

@FUDCo FUDCo force-pushed the 675-prune-resolved-promises branch from 3b73783 to 3a5a6db Compare May 12, 2020 03:05
@FUDCo FUDCo requested a review from warner May 12, 2020 03:07
Copy link
Member

@warner warner left a comment

Choose a reason for hiding this comment

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

everything looks great, but I'd feel better if we have those extra tests on the kernel side (test-vpid-kernel for the promise-data/promise-reject cases) as we land this

packages/SwingSet/src/kernel/liveSlots.js Show resolved Hide resolved
packages/SwingSet/src/kernel/liveSlots.js Show resolved Hide resolved
packages/SwingSet/test/test-vpid-kernel.js Outdated Show resolved Hide resolved
packages/SwingSet/test/test-vpid-liveslots.js Outdated Show resolved Hide resolved
packages/SwingSet/test/test-vpid-liveslots.js Outdated Show resolved Hide resolved
packages/SwingSet/test/test-vpid-liveslots.js Outdated Show resolved Hide resolved
packages/SwingSet/test/test-vpid-liveslots.js Outdated Show resolved Hide resolved
[p2, r2] = makePR();
return p2;
},
usePromises(pa, pb) {
Copy link
Member

Choose a reason for hiding this comment

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

these demos are great.. do we have a test of cyclic resolution in swingset proper?

Copy link
Member

Choose a reason for hiding this comment

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

I think we still need a unit test for this in swingset

@FUDCo FUDCo force-pushed the 675-prune-resolved-promises branch from 2ed0876 to cad4119 Compare May 16, 2020 07:39
@FUDCo FUDCo requested a review from warner May 16, 2020 07:39
@FUDCo
Copy link
Contributor Author

FUDCo commented May 16, 2020

@warner Most of the touchups from your review were straightforward, but the revisions and additions to test-vpid-kernel.js could probably benefit from a closer look.

packages/SwingSet/test/test-vpid-kernel.js Show resolved Hide resolved
packages/SwingSet/test/test-vpid-kernel.js Outdated Show resolved Hide resolved
packages/SwingSet/test/test-vpid-kernel.js Show resolved Hide resolved
packages/SwingSet/test/test-vpid-kernel.js Outdated Show resolved Hide resolved
[p2, r2] = makePR();
return p2;
},
usePromises(pa, pb) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we still need a unit test for this in swingset

packages/SwingSet/test/test-vpid-liveslots.js Outdated Show resolved Hide resolved
Copy link
Member

@warner warner left a comment

Choose a reason for hiding this comment

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

New tests are great. I still want a resolve-to-cycle test in swingset proper. Minor changes otherwise:

  • test-vpid-kernel should check both sides of the expectedRetirement case
  • call tests in a loop

Copy link
Member

@warner warner left a comment

Choose a reason for hiding this comment

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

get rid of that one test.only and we're good to go!

@FUDCo FUDCo force-pushed the 675-prune-resolved-promises branch from e1e6c9a to c8d870b Compare May 18, 2020 22:29
@FUDCo FUDCo force-pushed the 675-prune-resolved-promises branch from c8d870b to e98d720 Compare May 18, 2020 22:30
@FUDCo FUDCo merged commit d4f5f0f into master May 18, 2020
@FUDCo FUDCo deleted the 675-prune-resolved-promises branch May 18, 2020 23:10
@FUDCo FUDCo mentioned this pull request May 21, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance Performance related issues SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants