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

spec: update bid counts and previous wins #638

Merged
merged 3 commits into from
Jun 22, 2023
Merged

Conversation

JensenPaul
Copy link
Collaborator

@JensenPaul JensenPaul commented Jun 16, 2023

@JensenPaul JensenPaul added the spec Relates to the spec label Jun 16, 2023
spec.bs Outdated
1. If |config|["{{AuctionAdConfig/signal}}"] [=map/exists=], then:
1. Let |signal| be |config|["{{AuctionAdConfig/signal}}"].
1. If |signal| is [=AbortSignal/aborted=], then [=reject=] |p| with |signal|'s
[=AbortSignal/abort reason=] and return |p|.
1. [=AbortSignal/Add|Add the following abort steps=] to |signal|:
1. [=Reject=] |p| with |signal|’s [=AbortSignal/abort reason=].
1. TODO: Update bidCount for interest groups that participated in the auction.
1. Evaluate [=update bid counts=] with |bidIgs|.
Copy link
Collaborator

Choose a reason for hiding this comment

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

At this point bidIgs might still be being mutated by the steps running in parallel, right? Whenever this sort of thing comes up in spec code review I find myself asking how this works in the implementation? Just from reading the spec I'd have to imagine that (1) the browser process is continually sending IPCs to the render process, telling it to update its local copy of bidIgs, and (2) whenever runAdAuction() gets aborted, the renderer calls this update, bid count algorithm with its copy of bidIgs that it currently has at the time.

Is that actually what happens? I feel like it isn't, just because update bid counts is also at least sometimes called "in parallel" by the parallel queue steps below. Is this meant to be called exclusively in parallel? Do we really need this main-thread invocation here?

Separate question: Do we have some sort of cancellation mechanism such that when runAdAuction gets aborted, the in parallel steps know to stop running? Do we need one? It might be good to document this and the effects of it either way in a Note: in the spec.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

bidIgs shouldn't be mutated in parallel. The auction should have completed by now (i.e. either aborted or completed successfully). I don't think we have spec'd a mechanism to actually stop the script runner execution yet in the case of an abort. In the successful case I think it should have have finished previously on line 506 before we use bidIgs on line 531.

spec.bs Outdated Show resolved Hide resolved
@JensenPaul JensenPaul merged commit 5e23bfa into main Jun 22, 2023
@JensenPaul JensenPaul deleted the JensenPaul-patch-3 branch June 22, 2023 18:54
github-actions bot added a commit that referenced this pull request Jun 22, 2023
SHA: 5e23bfa
Reason: push, by JensenPaul

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec Relates to the spec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants