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

Move over our integration with Private Aggregation into our spec. #1312

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

morlovich
Copy link
Collaborator

@morlovich morlovich commented Oct 24, 2024

This largely follows how things were done when Private Aggregation was patching us, with a few notable differences:

  1. It uses reporting context for state (the patches inside P.Agg. overloaded auction config for that). This did require
    adding a separate reporting context for top-level so that the batching stuff doesn't get confused. (forDebugOnly
    doesn't care, it's just one more context to merge stuff from).
  2. reporting bid key is used for winner computations; using origins was incorrect.
  3. PA contributions aren't recorded instantly, since we generally have to discard them for non-k-anon runs (and for
    generateBid we don't know that in advance); so we buffer them and only collect them later;
    ... in a follow up we need to monkey-patch regular contributeToHistogram in a follow so it also doesn't update
    instantly.
  4. Exception throwing for not enabled is timed differently, and the handling of top-level run is closer to what we
    implement; though still slightly off (the property just... isn't there before the script run).

A lot of stuff about how metrics are evaluated remains hand-wavy. I suspect I'll implement my new metrics first, and then re-build the old ones on top of whatever gets developed.


Preview | Diff

@morlovich morlovich changed the title Sketching move over of PA (WIP) Move over our integration with Private Aggregation into our spec. Oct 25, 2024
@morlovich morlovich changed the title (WIP) Move over our integration with Private Aggregation into our spec. Move over our integration with Private Aggregation into our spec. Oct 28, 2024
@morlovich
Copy link
Collaborator Author

FYI @alexmturner

@JensenPaul JensenPaul added the spec Relates to the spec label Oct 28, 2024
Copy link
Collaborator

@qingxinwu qingxinwu left a comment

Choose a reason for hiding this comment

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

do we send PAgg contributions to PAgg host somewhere?

(I'll not pay much attention to those moved algorithms at this moment, since this PR may not be a good place to fix them anyways. Will take another look sometime in the future. Won't let that block this PR).

[=environment settings object=] |settings|, perform the following steps. They return a failure if
failing to fetch the script or wasm, otherwise a [=tuple=] of ([=list=] of [=generated bids=],
[=bid debug reporting info=], [=list=] of [=real time reporting contributions=]).
|multiBidLimit|, an [=interest group=] |ig|, a [=reporting context=] |reportingContext| and a
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit

Suggested change
|multiBidLimit|, an [=interest group=] |ig|, a [=reporting context=] |reportingContext| and a
|multiBidLimit|, an [=interest group=] |ig|, a [=reporting context=] |reportingContext|, a

spec.bs Show resolved Hide resolved
@morlovich
Copy link
Collaborator Author

do we send PAgg contributions to PAgg host somewhere?

(I'll not pay much attention to those moved algorithms at this moment, since this PR may not be a good place to fix them anyways. Will take another look sometime in the future. Won't let that block this PR).

The "process the Private Aggregation contributions for an auction" algorithm eventually calls "Process contributions for a batching scope" from P.Agg. which does stuff like that. The wiring of that got changed quite a bit in this version, though.

@qingxinwu
Copy link
Collaborator

qingxinwu commented Oct 31, 2024

do we send PAgg contributions to PAgg host somewhere?
(I'll not pay much attention to those moved algorithms at this moment, since this PR may not be a good place to fix them anyways. Will take another look sometime in the future. Won't let that block this PR).

The "process the Private Aggregation contributions for an auction" algorithm eventually calls "Process contributions for a batching scope" from P.Agg. which does stuff like that. The wiring of that got changed quite a bit in this version, though.

Private aggregation contributions are also only sent to PAgg host after navigated to winning ad if there's one, right?

@morlovich
Copy link
Collaborator Author

Private aggregation contributions are also only sent to PAgg host after navigated to winning ad if there's one, right?

Good point (and at end if there is no winner). I guess I need to save leaderInfo for that somehow. Probably just stick it into the reporting context, and then have a helper walk the reportingContextMap and call Process contributions for auction on each one...

Need to be careful not to get the reserved.win/non-reserved handling wrong for losing component auctions, though.

@qingxinwu
Copy link
Collaborator

https://wicg.github.io/turtledove/#asynchronously-finish-reporting handles other reports after navigation when there's a winner.
https://github.com/WICG/turtledove/blob/main/spec.bs#L847 handles no winner for debug loss report and RTR reports.
It'll be good and easier to wire PAgg to these places as well, if possible.

@morlovich
Copy link
Collaborator Author

https://wicg.github.io/turtledove/#asynchronously-finish-reporting handles other reports after navigation when there's a winner. https://github.com/WICG/turtledove/blob/main/spec.bs#L847 handles no winner for debug loss report and RTR reports. It'll be good and easier to wire PAgg to these places as well, if possible.

Done, I think.

Copy link
Collaborator

@qingxinwu qingxinwu left a comment

Choose a reason for hiding this comment

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

generally LGTM.
I'll take a look at the moved algorithms in the near future when I get more time (I've reviewed most of them when they were added to PAgg spec, so should be fine for now, and this PR is not a good place to fix anything if there is any problem anyways).

@@ -859,10 +859,13 @@ The <dfn for=Navigator method>runAdAuction(|config|)</dfn> method steps are:
1. [=Send report=] with |reportUrl| and |settings|.
1. [=Send real time reports=] with |auctionReportInfo|'s
[=auction report info/real time reporting contributions map=] and |settings|.
1. [=Process the Private Aggregation contributions for an auction tree=] given |auctionConfig|,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: is there a better name for this, or simply call it "process private aggregation contributions"? not a fan of introducing another new term for auctions.

@@ -1050,7 +1054,8 @@ To <dfn>fill in a pending fenced frame config</dfn> given a [=fenced frame confi
<div algorithm>

To <dfn>asynchronously finish reporting</dfn> given a
[=fencedframetype/fenced frame reporting map=] |reportingMap|, [=leading bid info=] |leadingBidInfo|,
[=fencedframetype/fenced frame reporting map=] |reportingMap|, [=auction config=] |auctionConfig|,
[=reporting context map=] |reportingContextMap|, [=leading bid info=] |leadingBidInfo|,
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe possible to combine |reportingContextMap| and |auctionReportInfo| in some way. But won't be a request for this PR. We can think about that in the future.

@@ -3610,6 +3618,13 @@ A <dfn>reporting context</dfn> is a [=struct=] with the following [=struct/items
contribution entries=].
: <dfn>private aggregation allowed</dfn>
:: A [=boolean=], initially false.
: <dfn>local leader info</dfn>
:: A [=leading bid info=], describing information on what, if anything, won this particular
subauction.
Copy link
Collaborator

Choose a reason for hiding this comment

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

component auction?

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.

3 participants