From 7148d90400f6e1fb2b0bea7f690d0eb7bc6d6293 Mon Sep 17 00:00:00 2001 From: Maks Orlovich Date: Fri, 8 Mar 2024 13:11:15 -0500 Subject: [PATCH 1/9] Explicitly spec out how non-k-anon auction works. ... This is a prereq to specing how it works with targetNumAdComponents. --- spec.bs | 117 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 36 deletions(-) diff --git a/spec.bs b/spec.bs index a293fac54..70e030390 100644 --- a/spec.bs +++ b/spec.bs @@ -666,12 +666,12 @@ The runAdAuction(|config|) method steps are: [=auction config/interest group buyers=]. 1. Let |queue| be the result of [=starting a new parallel queue=]. 1. [=parallel queue/enqueue steps|Enqueue the following steps=] to |queue|: - 1. Let |generatedBids| be a new [=list=] of [=generated bids=]. + 1. Let |generatedBidsForDebuggingReports| be a new [=list=] of [=generated bids=]. 1. Let |winnerInfo| be the result of running [=generate and score bids=] with |auctionConfig|, - null, |global|, |settings|'s [=environment/top-level origin=], |bidIgs|, and |generatedBids|. + null, |global|, |settings|'s [=environment/top-level origin=], |bidIgs|, and |generatedBidsForDebuggingReports|. 1. Let |auctionReportInfo| be a new [=auction report info=]. 1. If |winnerInfo| is not failure, then set |auctionReportInfo| to the result of running - [=collect forDebuggingOnly reports=] with |generatedBids| and |winnerInfo|. + [=collect forDebuggingOnly reports=] with |generatedBidsForDebuggingReports| and |winnerInfo|. 1. If |winnerInfo| is failure, then [=queue a global task=] on [=DOM manipulation task source=], given |global|, to [=reject=] |p| with a "{{TypeError}}". 1. Otherwise if |winnerInfo| is null or |winnerInfo|'s [=leading bid info/leading bid=] is null: @@ -852,17 +852,9 @@ To fill in a pending fenced frame config given a [=fenced frame confi To asynchronously finish reporting given a [=fencedframetype/fenced frame reporting map=] |reportingMap|, [=leading bid info=] |leadingBidInfo|, and [=auction report info=] |auctionReportInfo|. -1. Let |winner| be |leadingBidInfo|'s [=leading bid info/leading bid=]. -1. [=Increment ad k-anonymity count=] given |winner|'s [=generated bid/interest group=] and - |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. -1. If |winner|'s [=generated bid/ad component descriptors=] is not null: - 1. [=set/For each=] |adComponentDescriptor| in |winner|'s - [=generated bid/ad component descriptors=]: - 1. [=Increment component ad k-anonymity count=] given |adComponentDescriptor|'s - [=ad descriptor/url=]. -1. [=Increment reporting ID k-anonymity count=] given |winner|'s - [=generated bid/interest group=] and |winner|'s [=generated bid/ad descriptor=]'s - [=ad descriptor/url=]. +1. [=Increment a winning bid's k-anonymity count=] given |leadingBidInfo|'s [=leading bid info/leading bid=]. +1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=] is not null: + 1. [=Increment a winning bid's k-anonymity count=] given |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=]. 1. Let |buyerDone|, |sellerDone|, and |componentSellerDone| be [=booleans=], initially false. 1. If |leadingBidInfo|'s [=leading bid info/component seller=] is null, set |componentSellerDone| to true. @@ -1412,7 +1404,7 @@ and a [=moment=] |auctionStartTime|: To generate and score bids given an [=auction config=] |auctionConfig|, an [=auction config=]-or-null |topLevelAuctionConfig|, a [=global object=] |global|, an [=origin=] |topLevelOrigin|, a [=list=] of [=interest groups=] |bidIgs|, and a [=list=] of [=generated bids=] -|generatedBids|: +|generatedBidsForDebuggingReports|: 1. [=Assert=] that these steps are running [=in parallel=]. 1. Let |auctionStartTime| be the [=current wall time=]. 1. Let |decisionLogicScript| be the result of [=fetching script=] with |auctionConfig|'s @@ -1434,7 +1426,7 @@ To generate and score bids given an [=auction config=] |auctionConfig 1. [=list/For each=] |component| in |auctionConfig|'s [=auction config/component auctions=], [=parallel queue/enqueue steps|enqueue the following steps=] to |queue|: 1. Let |compWinnerInfo| be the result of running [=generate and score bids=] with |component|, - |auctionConfig|, |global|, |topLevelOrigin|, |bidIgs|, and |generatedBids|. + |auctionConfig|, |global|, |topLevelOrigin|, |bidIgs|, and |generatedBidsForDebuggingReports|. 1. If |compWinnerInfo| is failure, return failure. 1. If [=recursively wait until configuration input promises resolve=] given |auctionConfig| returns failure, return failure. @@ -1449,6 +1441,10 @@ To generate and score bids given an [=auction config=] |auctionConfig [=score and rank a bid=] with |auctionConfig|, |compWinnerInfo|'s [=leading bid info/leading bid=], |leadingBidInfo|, |decisionLogicScript|, null, "top-level-auction", null, and |topLevelOrigin|. + 1. If |compWinnerInfo|'s [=leading bid info/leading non-k-anon bid=] is not null, then run + [=score and rank a bid=] with |auctionConfig|, |compWinnerInfo|'s + [=leading bid info/leading non-k-anon bid=], |leadingBidInfo|, |decisionLogicScript|, null, + "top-level-auction", null, and |topLevelOrigin|. 1. Decrement |pendingComponentAuctions| by 1. 1. Wait until |pendingComponentAuctions| is 0. 1. If |leadingBidInfo|'s [=leading bid info/leading bid=] is null, return null. @@ -1593,29 +1589,35 @@ To generate and score bids given an [=auction config=] |auctionConfig |auctionSignals|, a [=map/clone=] of |browserSignals|, |perBuyerSignals|, |directFromSellerSignalsForBuyer|, |perBuyerTimeout|, |expectedCurrency|, |ig|, and |auctionStartTime|. - 1. Set |generatedBid|'s [=generated bid/id=] to |generatedBids|'s [=list/size=]. - 1. [=list/Append=] |generatedBid| to |generatedBids|. - - Issue: Instead of inserting to |generatedBids| in each component auction that runs in - parallel, create a strucure InterestGroupAuction that holds data for each auction - separately (WICG/turtledove#1021). 1. Let |generateBidDuration| be the [=duration from=] |generateBidStartTime| to |settings|'s [=environment settings object/current monotonic time=], in milliseconds. 1. If |perBuyerCumulativeTimeout| is not null, decrement |perBuyerCumulativeTimeout| by |generateBidDuration|. - 1. If |generatedBid|'s [=generated bid/no bid=] is true, [=iteration/continue=]. - 1. If [=query generated bid k-anonymity count=] given |generatedBid| returns false: - + 1. If |generatedBid|'s [=generated bid/no bid=] is true: + 1. [=Register a bid for forDebuggingOnly reports=] given |generatedBid| and + |generatedBidsForDebuggingReports|. + 1. [=iteration/continue=]. + 1. Let |bidsToScore| be a new [=list=] of [=generated bids=] + 1. If [=query generated bid k-anonymity count=] given |generatedBid| returns true: + 1. Let |bidCopy| be a copy of |generatedBid|. + 1. Set |bidCopy|'s [=generated bid/for k-anon auction=] to false. + 1. [=list/Append=] |bidCopy| to |bidsToScore|. + 1. [=list/Append=] |generatedBid| to |bidsToScore|. + + Note: conceptually, a bid that's already k-anonymous is considered for both + the k-anonymous and non-k-anonymous leadership + + 1. [=Register a bid for forDebuggingOnly reports=] given |generatedBid| and + |generatedBidsForDebuggingReports|. + 1. Otherwise: Note: [=Generate a bid=] is now rerun with only k-anonymous [=interest group/ads=] to give the buyer a chance to [=generate a bid=] for k-anonymous [=interest group/ads=]. Allowing the buyer to first [=generate a bid=] for non-k-anonymous [=interest group/ads=] provides a mechanism to bootstrap the k-anonymity count, otherwise no [=interest group/ads=] would ever trigger [=increment k-anonymity count=] and all ads would fail [=query k-anonymity count=]. - 1. TODO: Run [=score and rank a bid=] on |generatedBid| to find the highest scoring bid - that isn't k-anonymous. After the auction, if the highest scoring bid that isn't - k-anonymous has a higher score than the highest scoring k-anonymous bid, then call - [=increment ad k-anonymity count=] on it. + 1. Set |generatedBid|'s [=generated bid/for k-anon auction=] to false. + 1. [=list/Append=] |generatedBid| to |bidsToScore|. 1. Let |originalAds| be |ig|'s [=interest group/ads=]. 1. If |originalAds| is not null: 1. Set |ig|'s [=interest group/ads=] to a new [=list=] of [=interest group ad=]. @@ -1644,11 +1646,17 @@ To generate and score bids given an [=auction config=] |auctionConfig |settings|'s [=environment settings object/current monotonic time=], in milliseconds. 1. If |perBuyerCumulativeTimeout| is not null, then decrement |perBuyerCumulativeTimeout| by |generateBidDuration|. - 1. If |generatedBid| is failure, [=iteration/continue=]. - 1. [=list/Insert=] |generatedBid|'s [=generated bid/interest group=] in |bidIgs|. - 1. [=Score and rank a bid=] with |auctionConfig|, |generatedBid|, |leadingBidInfo|, - |decisionLogicScript|, |directFromSellerSignalsForSeller|, |dataVersion|, |auctionLevel|, - |componentAuctionExpectedCurrency|, and |topLevelOrigin|. + 1. If |generatedBid| is not a failure: + 1. [=Assert=] that [=query generated bid k-anonymity count=] given |generatedBid| returns true. + 1. [=list/Append=] |generatedBid| to |bidsToScore|. + 1. [=Register a bid for forDebuggingOnly reports=] given |generatedBid| and + |generatedBidsForDebuggingReports|. + 1. [=list/For each=| |bidToScore| of |bidsToScore|: + 1. If |bidToScore|'s [=generated bid/for k-anon auction=] is true, + [=list/Insert=] |bidToScore|'s [=generated bid/interest group=] in |bidIgs|. + 1. [=Score and rank a bid=] with |auctionConfig|, |bidToScore|, |leadingBidInfo|, + |decisionLogicScript|, |directFromSellerSignalsForSeller|, |dataVersion|, |auctionLevel|, + |componentAuctionExpectedCurrency|, and |topLevelOrigin|. 1. Decrement |pendingBuyers| by 1. 1. Wait until both |pendingBuyers| and |pendingAdditionalBids| are 0. 1. If |leadingBidInfo|'s [=leading bid info/leading bid=] is null, return null. @@ -1847,8 +1855,14 @@ or "component-auction", a [=currency tag=] |componentAuctionExpectedCurrency|, a then set |generatedBid|'s [=generated bid/bid in seller currency=] to |scoreAdOutput|["{{ScoreAdOutput/incomingBidInSellerCurrency}}"]. 1. Let |score| be |scoreAdOutput|["{{ScoreAdOutput/desirability}}"]. +1. If |generatedBid|'s [=generated bid/for k-anon auction=] is false: + 1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=] is null, or + |score| > |leadingBidInfo|'s [=leading bid info/top non-k-anon score=]: + 1. Set |leadingBidInfo|'s [=leading bid info/top non-k-anon score=] to |score| + 1. Set |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=] to |generatedBid| + 1. Return. 1. Let |updateLeadingBid| be false. -1. If |leadingBidInfo|'s [=leading bid info/leading bid=] is null, or |score| is greater than +1. If |leadingBidInfo|'s [=leading bid info/leading bid=] is null, or |score| > |leadingBidInfo|'s [=leading bid info/top score=]: 1. Set |updateLeadingBid| to true. 1. Set |leadingBidInfo|'s [=leading bid info/top bids count=] to 1. @@ -2499,6 +2513,17 @@ methods for event-level forDebuggingOnly reports for winning and losi 1. Return |auctionReportInfo|. +
+ To register a bid for forDebuggingOnly reports given a [=generated bid=] + |generatedBid| and a [=list=] of [=generated bids=] |generatedBidsForDebuggingReports|: + 1. Set |generatedBid|'s [=generated bid/id=] to |generatedBidsForDebuggingReports|'s [=list/size=]. + 1. [=list/Append=] |generatedBid| to |generatedBidsForDebuggingReports|. + + Issue: Instead of inserting to |generatedBidsForDebuggingReports| in each component auction that runs in + parallel, create a structure InterestGroupAuction that holds data for each auction + separately (WICG/turtledove#1021). +
+ ### Downsampling ### {#downsampling-header} *This first introductory paragraph is non-normative.* @@ -3106,6 +3131,19 @@ threshold when responding to [=query k-anonymity count=]. 1. [=Increment k-anonymity count=] given |keyHash|. +
+ To increment a winning bid's k-anonymity count given a [=generated bid=] |winner|: + 1. [=Increment ad k-anonymity count=] given |winner|'s [=generated bid/interest group=] and + |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. + 1. If |winner|'s [=generated bid/ad component descriptors=] is not null: + 1. [=list/For each=] |adComponentDescriptor| in |winner|'s [=generated bid/ad component descriptors=]: + 1. [=Increment component ad k-anonymity count=] given |adComponentDescriptor|'s + [=ad descriptor/url=]. + 1. [=Increment reporting ID k-anonymity count=] given |winner|'s + [=generated bid/interest group=] and |winner|'s [=generated bid/ad descriptor=]'s + [=ad descriptor/url=]. +
+ # Script Runners # {#script-runners} *This introduction sub-section is non-normative*. @@ -5088,6 +5126,9 @@ result of [=evaluating a bidding script=], or an [=additional bid=] provided by : no bid :: A [=boolean=], initially false. True if there was a failure generating a bid, or the bidder chose not to bid. When true, [=generated bid/bidder debug loss report url=] is still considered. + : for k-anon auction + :: A [=boolean=], initially true. If this is false, the bid is only used to determine the hypothetical + winner with no k-anonymity constraints, which would be used to update k-anonymity counts only. : bid :: A [=bid with currency=]. If the [=bid with currency/value=] is zero or negative, then this [=interest group=] will not participate in the auction. @@ -5309,13 +5350,17 @@ scored bids. It's a [=struct=] with the following [=struct/items=]:
: top score :: A {{double}}, initially 0.0. The highest score so far. + : top non-k-anon score + :: A {{double}}, initially 0.0. The highest score so far when disregarding k-anonymity. : top bids count :: An integer, initially 0. The number of bids with the same `top score`. : at most one top bid owner :: A [=boolean=], initially true. Whether all bids of `top score` are from the same interest group owner. : leading bid - :: Null or a [=generate bid=], initially null. The leading bid of the auction so far. + :: Null or a [=generated bid=], initially null. The leading bid of the auction so far. + : leading non-k-anon bid + :: Null or a [=generated bid=], initially null. The leading bid of the auction disregarding k-anonymity so far. : auction config :: An [=auction config=]. The auction config of the auction which generated this [=leading bid info/leading bid=]. From 740a93d2327c195cf8affd018c816986efc9266b Mon Sep 17 00:00:00 2001 From: Maks Orlovich Date: Fri, 8 Mar 2024 13:22:01 -0500 Subject: [PATCH 2/9] Fix various formatting mishaps --- spec.bs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec.bs b/spec.bs index 70e030390..ffc5d6eda 100644 --- a/spec.bs +++ b/spec.bs @@ -1604,18 +1604,20 @@ To generate and score bids given an [=auction config=] |auctionConfig 1. [=list/Append=] |bidCopy| to |bidsToScore|. 1. [=list/Append=] |generatedBid| to |bidsToScore|. - Note: conceptually, a bid that's already k-anonymous is considered for both - the k-anonymous and non-k-anonymous leadership + Note: Conceptually, a bid that's already k-anonymous is considered for both + the k-anonymous and non-k-anonymous leadership. 1. [=Register a bid for forDebuggingOnly reports=] given |generatedBid| and |generatedBidsForDebuggingReports|. 1. Otherwise: + Note: [=Generate a bid=] is now rerun with only k-anonymous [=interest group/ads=] to give the buyer a chance to [=generate a bid=] for k-anonymous [=interest group/ads=]. Allowing the buyer to first [=generate a bid=] for non-k-anonymous [=interest group/ads=] provides a mechanism to bootstrap the k-anonymity count, otherwise no [=interest group/ads=] would ever trigger [=increment k-anonymity count=] and all ads would fail [=query k-anonymity count=]. + 1. Set |generatedBid|'s [=generated bid/for k-anon auction=] to false. 1. [=list/Append=] |generatedBid| to |bidsToScore|. 1. Let |originalAds| be |ig|'s [=interest group/ads=]. @@ -1651,9 +1653,9 @@ To generate and score bids given an [=auction config=] |auctionConfig 1. [=list/Append=] |generatedBid| to |bidsToScore|. 1. [=Register a bid for forDebuggingOnly reports=] given |generatedBid| and |generatedBidsForDebuggingReports|. - 1. [=list/For each=| |bidToScore| of |bidsToScore|: + 1. [=list/For each=] |bidToScore| of |bidsToScore|: 1. If |bidToScore|'s [=generated bid/for k-anon auction=] is true, - [=list/Insert=] |bidToScore|'s [=generated bid/interest group=] in |bidIgs|. + [=list/insert=] |bidToScore|'s [=generated bid/interest group=] in |bidIgs|. 1. [=Score and rank a bid=] with |auctionConfig|, |bidToScore|, |leadingBidInfo|, |decisionLogicScript|, |directFromSellerSignalsForSeller|, |dataVersion|, |auctionLevel|, |componentAuctionExpectedCurrency|, and |topLevelOrigin|. From 5b6b0c16ab224d9347af68ce24da25418ef050d0 Mon Sep 17 00:00:00 2001 From: Maks Orlovich Date: Wed, 13 Mar 2024 09:38:51 -0400 Subject: [PATCH 3/9] Some easy parts of feedback --- spec.bs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec.bs b/spec.bs index ffc5d6eda..67d8ec169 100644 --- a/spec.bs +++ b/spec.bs @@ -853,8 +853,8 @@ To asynchronously finish reporting given a [=fencedframetype/fenced frame reporting map=] |reportingMap|, [=leading bid info=] |leadingBidInfo|, and [=auction report info=] |auctionReportInfo|. 1. [=Increment a winning bid's k-anonymity count=] given |leadingBidInfo|'s [=leading bid info/leading bid=]. -1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=] is not null: - 1. [=Increment a winning bid's k-anonymity count=] given |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=]. +1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=] is not null, + [=increment a winning bid's k-anonymity count=] given |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=]. 1. Let |buyerDone|, |sellerDone|, and |componentSellerDone| be [=booleans=], initially false. 1. If |leadingBidInfo|'s [=leading bid info/component seller=] is null, set |componentSellerDone| to true. @@ -1599,7 +1599,7 @@ To generate and score bids given an [=auction config=] |auctionConfig 1. [=iteration/continue=]. 1. Let |bidsToScore| be a new [=list=] of [=generated bids=] 1. If [=query generated bid k-anonymity count=] given |generatedBid| returns true: - 1. Let |bidCopy| be a copy of |generatedBid|. + 1. Let |bidCopy| be a clone of |generatedBid|. 1. Set |bidCopy|'s [=generated bid/for k-anon auction=] to false. 1. [=list/Append=] |bidCopy| to |bidsToScore|. 1. [=list/Append=] |generatedBid| to |bidsToScore|. @@ -1859,12 +1859,12 @@ or "component-auction", a [=currency tag=] |componentAuctionExpectedCurrency|, a 1. Let |score| be |scoreAdOutput|["{{ScoreAdOutput/desirability}}"]. 1. If |generatedBid|'s [=generated bid/for k-anon auction=] is false: 1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=] is null, or - |score| > |leadingBidInfo|'s [=leading bid info/top non-k-anon score=]: - 1. Set |leadingBidInfo|'s [=leading bid info/top non-k-anon score=] to |score| - 1. Set |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=] to |generatedBid| + |score| > |leadingBidInfo|'s [=leading bid info/top non-k-anon score=]: + 1. Set |leadingBidInfo|'s [=leading bid info/top non-k-anon score=] to |score|. + 1. Set |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=] to |generatedBid|. 1. Return. 1. Let |updateLeadingBid| be false. -1. If |leadingBidInfo|'s [=leading bid info/leading bid=] is null, or |score| > +1. If |leadingBidInfo|'s [=leading bid info/leading bid=] is null, or |score| > |leadingBidInfo|'s [=leading bid info/top score=]: 1. Set |updateLeadingBid| to true. 1. Set |leadingBidInfo|'s [=leading bid info/top bids count=] to 1. From c5404fc6f5dea3ce2f557bece6a0ed236ea3f24f Mon Sep 17 00:00:00 2001 From: Maks Orlovich Date: Wed, 13 Mar 2024 09:52:37 -0400 Subject: [PATCH 4/9] non-k-anon => non-k-anon-enforced --- spec.bs | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/spec.bs b/spec.bs index 67d8ec169..65e7fda1a 100644 --- a/spec.bs +++ b/spec.bs @@ -853,8 +853,9 @@ To asynchronously finish reporting given a [=fencedframetype/fenced frame reporting map=] |reportingMap|, [=leading bid info=] |leadingBidInfo|, and [=auction report info=] |auctionReportInfo|. 1. [=Increment a winning bid's k-anonymity count=] given |leadingBidInfo|'s [=leading bid info/leading bid=]. -1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=] is not null, - [=increment a winning bid's k-anonymity count=] given |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=]. +1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon-enforced bid=] is + not null, [=increment a winning bid's k-anonymity count=] given + |leadingBidInfo|'s [=leading bid info/leading non-k-anon-enforced bid=]. 1. Let |buyerDone|, |sellerDone|, and |componentSellerDone| be [=booleans=], initially false. 1. If |leadingBidInfo|'s [=leading bid info/component seller=] is null, set |componentSellerDone| to true. @@ -1439,12 +1440,13 @@ To generate and score bids given an [=auction config=] |auctionConfig 1. Set |topLevelDirectFromSellerSignalsRetrieved| to true. 1. If |compWinnerInfo|'s [=leading bid info/leading bid=] is not null, then run [=score and rank a bid=] with |auctionConfig|, |compWinnerInfo|'s - [=leading bid info/leading bid=], |leadingBidInfo|, |decisionLogicScript|, null, - "top-level-auction", null, and |topLevelOrigin|. - 1. If |compWinnerInfo|'s [=leading bid info/leading non-k-anon bid=] is not null, then run - [=score and rank a bid=] with |auctionConfig|, |compWinnerInfo|'s - [=leading bid info/leading non-k-anon bid=], |leadingBidInfo|, |decisionLogicScript|, null, - "top-level-auction", null, and |topLevelOrigin|. + [=leading bid info/leading bid=], |leadingBidInfo|, |decisionLogicScript|, + null, "top-level-auction", null, and |topLevelOrigin|. + 1. If |compWinnerInfo|'s [=leading bid info/leading non-k-anon-enforced bid=] + is not null, then run [=score and rank a bid=] with |auctionConfig|, + |compWinnerInfo|'s [=leading bid info/leading non-k-anon-enforced bid=], + |leadingBidInfo|, |decisionLogicScript|, null, "top-level-auction", null, + and |topLevelOrigin|. 1. Decrement |pendingComponentAuctions| by 1. 1. Wait until |pendingComponentAuctions| is 0. 1. If |leadingBidInfo|'s [=leading bid info/leading bid=] is null, return null. @@ -1604,8 +1606,8 @@ To generate and score bids given an [=auction config=] |auctionConfig 1. [=list/Append=] |bidCopy| to |bidsToScore|. 1. [=list/Append=] |generatedBid| to |bidsToScore|. - Note: Conceptually, a bid that's already k-anonymous is considered for both - the k-anonymous and non-k-anonymous leadership. + Note: Conceptually, a bid that's already k-anonymous is considered + for both the k-anonymous and non-enforcing-k-anonymity leadership. 1. [=Register a bid for forDebuggingOnly reports=] given |generatedBid| and |generatedBidsForDebuggingReports|. @@ -1858,10 +1860,11 @@ or "component-auction", a [=currency tag=] |componentAuctionExpectedCurrency|, a |scoreAdOutput|["{{ScoreAdOutput/incomingBidInSellerCurrency}}"]. 1. Let |score| be |scoreAdOutput|["{{ScoreAdOutput/desirability}}"]. 1. If |generatedBid|'s [=generated bid/for k-anon auction=] is false: - 1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=] is null, or - |score| > |leadingBidInfo|'s [=leading bid info/top non-k-anon score=]: - 1. Set |leadingBidInfo|'s [=leading bid info/top non-k-anon score=] to |score|. - 1. Set |leadingBidInfo|'s [=leading bid info/leading non-k-anon bid=] to |generatedBid|. + 1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon-enforced bid=] + is null, or |score| > |leadingBidInfo|'s [=leading bid info/top non-k-anon-enforced score=]: + 1. Set |leadingBidInfo|'s [=leading bid info/top non-k-anon-enforced score=] + to |score|. + 1. Set |leadingBidInfo|'s [=leading bid info/leading non-k-anon-enforced bid=] to |generatedBid|. 1. Return. 1. Let |updateLeadingBid| be false. 1. If |leadingBidInfo|'s [=leading bid info/leading bid=] is null, or |score| > @@ -5352,7 +5355,7 @@ scored bids. It's a [=struct=] with the following [=struct/items=]:
: top score :: A {{double}}, initially 0.0. The highest score so far. - : top non-k-anon score + : top non-k-anon-enforced score :: A {{double}}, initially 0.0. The highest score so far when disregarding k-anonymity. : top bids count :: An integer, initially 0. The number of bids with the same `top score`. @@ -5361,7 +5364,7 @@ scored bids. It's a [=struct=] with the following [=struct/items=]: group owner. : leading bid :: Null or a [=generated bid=], initially null. The leading bid of the auction so far. - : leading non-k-anon bid + : leading non-k-anon-enforced bid :: Null or a [=generated bid=], initially null. The leading bid of the auction disregarding k-anonymity so far. : auction config :: An [=auction config=]. The auction config of the auction which generated this From e7263f9cb748a52fb26d69c4b67992a6bad53566 Mon Sep 17 00:00:00 2001 From: Maks Orlovich Date: Wed, 13 Mar 2024 10:00:10 -0400 Subject: [PATCH 5/9] Link update algo --- spec.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.bs b/spec.bs index 65e7fda1a..2a40046ba 100644 --- a/spec.bs +++ b/spec.bs @@ -3137,7 +3137,7 @@ threshold when responding to [=query k-anonymity count=].
- To increment a winning bid's k-anonymity count given a [=generated bid=] |winner|: + To increment a winning bid's k-anonymity count given a [=generated bid=] |winner|: 1. [=Increment ad k-anonymity count=] given |winner|'s [=generated bid/interest group=] and |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. 1. If |winner|'s [=generated bid/ad component descriptors=] is not null: @@ -5133,7 +5133,7 @@ result of [=evaluating a bidding script=], or an [=additional bid=] provided by chose not to bid. When true, [=generated bid/bidder debug loss report url=] is still considered. : for k-anon auction :: A [=boolean=], initially true. If this is false, the bid is only used to determine the hypothetical - winner with no k-anonymity constraints, which would be used to update k-anonymity counts only. + winner with no k-anonymity constraints, which would be used to [=update k-anonymity counts=] only. : bid :: A [=bid with currency=]. If the [=bid with currency/value=] is zero or negative, then this [=interest group=] will not participate in the auction. From 9340c7d9972471d3d9695c8ae41c14b2bcd5ebdb Mon Sep 17 00:00:00 2001 From: Maks Orlovich Date: Mon, 18 Mar 2024 11:25:43 -0400 Subject: [PATCH 6/9] Don't double-count duplicates. --- spec.bs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index 558b2f440..b6cf6d837 100644 --- a/spec.bs +++ b/spec.bs @@ -861,7 +861,9 @@ To asynchronously finish reporting given a and [=auction report info=] |auctionReportInfo|. 1. [=Increment a winning bid's k-anonymity count=] given |leadingBidInfo|'s [=leading bid info/leading bid=]. 1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon-enforced bid=] is - not null, [=increment a winning bid's k-anonymity count=] given + not null, and |leadingBidInfo|'s [=leading bid info/leading non-k-anon-enforced bid=]'s [=generated bid/id=] + ≠ |leadingBidInfo|'s [=leading bid info/leading bid=]'s [=generated bid/id=], + [=increment a winning bid's k-anonymity count=] given |leadingBidInfo|'s [=leading bid info/leading non-k-anon-enforced bid=]. 1. Let |buyerDone|, |sellerDone|, and |componentSellerDone| be [=booleans=], initially false. 1. If |leadingBidInfo|'s [=leading bid info/component seller=] is null, set |componentSellerDone| From da739c3be895aff0d8c77b53999359fd1c5a8e7c Mon Sep 17 00:00:00 2001 From: Maks Orlovich Date: Mon, 18 Mar 2024 15:03:47 -0400 Subject: [PATCH 7/9] Fix k-anon auction tie break; list-append --- spec.bs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index b6cf6d837..028d04b10 100644 --- a/spec.bs +++ b/spec.bs @@ -1700,7 +1700,7 @@ To generate and score bids given an [=auction config=] |auctionConfig |generatedBidsForDebuggingReports|. 1. [=list/For each=] |bidToScore| of |bidsToScore|: 1. If |bidToScore|'s [=generated bid/for k-anon auction=] is true, - [=list/insert=] |bidToScore|'s [=generated bid/interest group=] in |bidIgs|. + [=list/append=] |bidToScore|'s [=generated bid/interest group=] in |bidIgs|. 1. [=Score and rank a bid=] with |auctionConfig|, |bidToScore|, |leadingBidInfo|, |decisionLogicScript|, |directFromSellerSignalsForSeller|, |dataVersion|, |auctionLevel|, |componentAuctionExpectedCurrency|, and |topLevelOrigin|. @@ -1914,8 +1914,17 @@ or "component-auction", a [=currency tag=] |componentAuctionExpectedCurrency|, a |scoreAdOutput|["{{ScoreAdOutput/incomingBidInSellerCurrency}}"]. 1. Let |score| be |scoreAdOutput|["{{ScoreAdOutput/desirability}}"]. 1. If |generatedBid|'s [=generated bid/for k-anon auction=] is false: + 1. Let |updateLeadingNonKAnonEnforcedBid| be false. 1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon-enforced bid=] is null, or |score| > |leadingBidInfo|'s [=leading bid info/top non-k-anon-enforced score=]: + 1. Set |updateLeadingNonKAnonEnforcedBid| to true. + 1. Set |leadingBidInfo|'s [=leading bid info/top non-k-anon-enforced bids count=] to 1. + 1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon-enforced bid=] is not null and + |score| = |leadingBidInfo|'s [=leading bid info/top non-k-anon-enforced score=]: + 1. Increment |leadingBidInfo|'s by [=leading bid info/top non-k-anon-enforced bids count=] 1. + 1. Set |updateLeadingNonKAnonEnforcedBid| to true with 1 in |leadingBidInfo|'s + [=leading bid info/top non-k-anon-enforced bids count=] chance. + 1. If |updateLeadingNonKAnonEnforcedBid| is true: 1. Set |leadingBidInfo|'s [=leading bid info/top non-k-anon-enforced score=] to |score|. 1. Set |leadingBidInfo|'s [=leading bid info/leading non-k-anon-enforced bid=] to |generatedBid|. @@ -5430,6 +5439,8 @@ scored bids. It's a [=struct=] with the following [=struct/items=]: :: A {{double}}, initially 0.0. The highest score so far when disregarding k-anonymity. : top bids count :: An integer, initially 0. The number of bids with the same `top score`. + : top non-k-anon-enforced bids count + :: Number of bids that are tied for leadership when disregarding k-anonymity thus far. : at most one top bid owner :: A [=boolean=], initially true. Whether all bids of `top score` are from the same interest group owner. From 5a5f96d1f690fe5156805dce37a3c7e37d475536 Mon Sep 17 00:00:00 2001 From: Maks Orlovich Date: Mon, 18 Mar 2024 15:10:38 -0400 Subject: [PATCH 8/9] correctly I can order word. --- spec.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index 028d04b10..7c7973730 100644 --- a/spec.bs +++ b/spec.bs @@ -1921,7 +1921,7 @@ or "component-auction", a [=currency tag=] |componentAuctionExpectedCurrency|, a 1. Set |leadingBidInfo|'s [=leading bid info/top non-k-anon-enforced bids count=] to 1. 1. If |leadingBidInfo|'s [=leading bid info/leading non-k-anon-enforced bid=] is not null and |score| = |leadingBidInfo|'s [=leading bid info/top non-k-anon-enforced score=]: - 1. Increment |leadingBidInfo|'s by [=leading bid info/top non-k-anon-enforced bids count=] 1. + 1. Increment |leadingBidInfo|'s [=leading bid info/top non-k-anon-enforced bids count=] by 1. 1. Set |updateLeadingNonKAnonEnforcedBid| to true with 1 in |leadingBidInfo|'s [=leading bid info/top non-k-anon-enforced bids count=] chance. 1. If |updateLeadingNonKAnonEnforcedBid| is true: From c021fb7cbaf1018d990121868f81d5a5d6b8c811 Mon Sep 17 00:00:00 2001 From: Maks Orlovich Date: Mon, 18 Mar 2024 15:44:57 -0400 Subject: [PATCH 9/9] to -> in --- spec.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index 7c7973730..751a9b770 100644 --- a/spec.bs +++ b/spec.bs @@ -1700,7 +1700,7 @@ To generate and score bids given an [=auction config=] |auctionConfig |generatedBidsForDebuggingReports|. 1. [=list/For each=] |bidToScore| of |bidsToScore|: 1. If |bidToScore|'s [=generated bid/for k-anon auction=] is true, - [=list/append=] |bidToScore|'s [=generated bid/interest group=] in |bidIgs|. + [=list/append=] |bidToScore|'s [=generated bid/interest group=] to |bidIgs|. 1. [=Score and rank a bid=] with |auctionConfig|, |bidToScore|, |leadingBidInfo|, |decisionLogicScript|, |directFromSellerSignalsForSeller|, |dataVersion|, |auctionLevel|, |componentAuctionExpectedCurrency|, and |topLevelOrigin|.