From 64a99cec61ab3088d266f561db28ded34ea8b115 Mon Sep 17 00:00:00 2001 From: Maks Orlovich Date: Mon, 2 Dec 2024 09:40:39 -0500 Subject: [PATCH] Spec various P.Agg. storage usage base values. (#1349) * Reserved.once specification. * Some metrics stuff, but it's a bit off for re-run, so need to think some more. Actually implement the get. * Fix handwaveyness of fetch metrics. * Fix the re-run thing, and a bit of prep for later. * Fix formatting. * Fix bug + misc found in feedback. * Typo fix. * Wire timeout from most script helpers. * Start on actual computation. * k-anon only. The impl gets it wrong. * generateBid computation. * report* * And add the base value itself. * Fix participating IG count computation. * Back to always. * Fix the reportAdditionalWin case. * Improve report-win enum at suggestion. * Fix edit mishap * Spec various P.Agg. storage usage base values. * Woops, forgot some descriptions. * Apply feedback * Apply feedback * + PA contributions type * More feedback * More phrasing tweaks. * More add -> increment * Some feedback * Fix the error case Qingxin pointed out. * Explain 110% * Fix the parse error case Qingxin pointed out, lack of timeout on top-level run is orthogonal. * Fix the lack of timeout on ScriptExecution. * More feedback * Switchify * FIx weird wrap. --------- Co-authored-by: Maks Orlovich --- spec.bs | 176 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 121 insertions(+), 55 deletions(-) diff --git a/spec.bs b/spec.bs index 5b77ccafd..779306208 100644 --- a/spec.bs +++ b/spec.bs @@ -1985,6 +1985,10 @@ and a [=real time reporting contributions map=] |realTimeContributionsMap|: 1. [=map/For each=] slotSizeQueryParam → |perSignalsUrlGenerator| of |perSlotSizeQueryParam|: 1. [=map/For each=] joiningOrigin → |groups| of |perSignalsUrlGenerator|: 1. [=list/Extend=] |igs| with |groups|. + 1. [=Update storage metrics=] given |metrics| and |igs|. + + Note: This is done before any filtering, since it represents storage resource usage. + 1. [=list/Sort in descending order=] |igs|, with |a| being less than |b| if |a|'s [=interest group/priority=] is less than |b|'s [=interest group/priority=]. 1. [=list/Remove=] the first |buyerGroupLimit| items from |igs|. @@ -4208,6 +4212,21 @@ A signal base value is one of the following: : "percent-scripts-timeout" :: The numeric value is percentage of executions of this script that hit their individual timeout, out of all executions that were expected to happen. +: "regular-igs-count" +:: Number of [=regular interest groups=] for the given buyer. (0 if this is used by a seller). +: "percent-regular-ig-count-quota-used" +:: Ratio of number of [=regular interest groups=] for the given buyer and [=Max regular interest + groups per owner=] expressed as a percentage, capped to 110. +: "negative-igs-count" +:: Number of [=negative interest groups=] for the given buyer. (0 if this is used by a seller). +: "percent-negative-ig-count-quota-used" +:: Ratio of number of [=negative interest groups=] for the given buyer and [=Max negative interest + groups per owner=] expressed as a percentage, capped to 110. +: "ig-storage-used" +:: Bytes of storage used by the given buyer. (0 if this is used by a seller). +: "percent-ig-storage-quota-used" +:: Percentage of [=max interest groups total size per owner=] used by the given buyer, + capped to 110. @@ -4312,6 +4331,12 @@ representing metrics aggregated over a particular participant (e.g. bidder or se :: A {{long}}, initially 0. : script executions attempted :: A {{long}}, initially 0. + : regular interest group count + :: A {{long}}, initially 0. + : negative interest group count + :: A {{long}}, initially 0. + : storage quota used + :: A {{long}}, initially 0.

Private Aggregation contributions

@@ -4606,19 +4631,20 @@ They return a {{double}}. |reportingContext|, |onEventEntry|'s [=on event contribution entry/origin=], and the result of [=find corresponding bid and score phase function=] given [=on event contribution entry/worklet function=]. -1. If |signalBaseValue| is "[=signal base value/winning-bid=]": - 1. If |leadingBidInfo|'s [=leading bid info/leading bid=] is null, return 0. - 1. Otherwise, return |leadingBidInfo|'s [=leading bid info/leading bid=]'s [=generated bid/bid=]. -1. If |signalBaseValue| is - "[=signal base value/highest-scoring-other-bid=]": - 1. If |leadingBidInfo|'s [=leading bid info/highest scoring other bid=] is null, return 0. - 1. Otherwise, return |leadingBidInfo|'s [=leading bid info/highest scoring other bid=]'s - [=generated bid/bid=]. -1. If |signalBaseValue| is "[=signal base value/script-run-time=]": - 1. Return the number of milliseconds of CPU time that the calling function +1. If |signalBaseValue| is: +
+ : "[=signal base value/winning-bid=]" + :: 1. If |leadingBidInfo|'s [=leading bid info/leading bid=] is null, return 0. + 1. Otherwise, return |leadingBidInfo|'s [=leading bid info/leading bid=]'s [=generated bid/bid=]. + : "[=signal base value/highest-scoring-other-bid=]": + :: 1. If |leadingBidInfo|'s [=leading bid info/highest scoring other bid=] is null, return 0. + 1. Otherwise, return |leadingBidInfo|'s [=leading bid info/highest scoring other bid=]'s + [=generated bid/bid=]. + : "[=signal base value/script-run-time=]" + :: Return the number of milliseconds of CPU time that the calling function (e.g. `generateBid()`) took to run. -1. If |signalBaseValue| is "[=signal base value/signals-fetch-time=]": - Switch on the associated [=worklet function=]: + : "[=signal base value/signals-fetch-time=]" + :: Switch on the associated [=worklet function=]:
: [=worklet function/generate-bid=] :: Return the number of milliseconds it took for the trusted bidding signals @@ -4631,53 +4657,80 @@ They return a {{double}}. :: Return 0.
-1. If |signalBaseValue| is "[=signal base value/bid-reject-reason=]": - 1. If the bid did not succeed purely because it didn't meet the required - k-anonymity threshold, return 8. - 1. Let |bidRejectReason| be "`not-available`". - 1. If the seller provided a reject reason, set |bidRejectReason| to that - value. - 1. If |bidRejectReason| is: -
- : "`not-available`" - :: Return 0. - : "`invalid-bid`" - :: Return 1. - : "`bid-below-auction-floor`" - :: Return 2. - : "`pending-approval-by-exchange`" - :: Return 3. - : "`disapproved-by-exchange`" - :: Return 4. - : "`blocked-by-publisher`" - :: Return 5. - : "`language-exclusions`" - :: Return 6. - : "`category-exclusions`" - :: Return 7. - : None of the above values - :: [=Assert=]: false - - Note: this enum value is validated in `scoreAd()`. - - Issue: Verify this once - WICG/turtledove#627 is resolved. - - Issue: There are some automatically generated values that are not described here. - - Issue: Verify handling when the bid was not rejected. - -
-1. If |signalBaseValue| is "[=signal base value/average-code-fetch-time=]": - 1. Return the result of [=getting the value to report from an averager=] given |metrics|'s [=per + : "[=signal base value/bid-reject-reason=]" + :: 1. If the bid did not succeed purely because it didn't meet the required + k-anonymity threshold, return 8. + 1. Let |bidRejectReason| be "`not-available`". + 1. If the seller provided a reject reason, set |bidRejectReason| to that + value. + 1. If |bidRejectReason| is: +
+ : "`not-available`" + :: Return 0. + : "`invalid-bid`" + :: Return 1. + : "`bid-below-auction-floor`" + :: Return 2. + : "`pending-approval-by-exchange`" + :: Return 3. + : "`disapproved-by-exchange`" + :: Return 4. + : "`blocked-by-publisher`" + :: Return 5. + : "`language-exclusions`" + :: Return 6. + : "`category-exclusions`" + :: Return 7. + : None of the above values + :: [=Assert=]: false + + Note: this enum value is validated in `scoreAd()`. + + Issue: Verify this once + WICG/turtledove#627 is resolved. + + Issue: There are some automatically generated values that are not described here. + + Issue: Verify handling when the bid was not rejected. + +
+ : "[=signal base value/average-code-fetch-time=]" + :: Return the result of [=getting the value to report from an averager=] given |metrics|'s [=per participant metrics/code fetch time averager=]. -1. If |signalBaseValue| is "[=signal base value/participating-ig-count=]": - 1. Return |bidAndScoreMetrics|'s [=per participant metrics/participating interest group count=]. -1. If |signalBaseValue| is "[=signal base value/percent-scripts-timeout=]": - 1. Return the result of [=computing a percentage metric=] given |metrics|'s [=per participant + + : "[=signal base value/participating-ig-count=]" + :: Return |bidAndScoreMetrics|'s [=per participant metrics/participating interest group count=]. + + : "[=signal base value/percent-scripts-timeout=]" + :: Return the result of [=computing a percentage metric=] given |metrics|'s [=per participant metrics/script timeouts occurred=] and |metrics|'s [=per participant metrics/script executions attempted=]. + : "[=signal base value/regular-igs-count=]" + :: Return |bidAndScoreMetrics|'s [=per participant metrics/regular interest group count=]. + + : "[=signal base value/percent-regular-ig-count-quota-used=]" + :: Return the result of [=computing a percentage metric=] given |bidAndScoreMetrics|'s [=per + participant metrics/regular interest group count=] and [=max regular interest groups per + owner=]. + + : "[=signal base value/negative-igs-count=]" + :: Return |bidAndScoreMetrics|'s [=per participant metrics/negative interest group count=]. + + : "[=signal base value/percent-negative-ig-count-quota-used=]": + :: Return the result of [=computing a percentage metric=] given |bidAndScoreMetrics|'s [=per + participant metrics/negative interest group count=] and [=max negative interest groups per + owner=]. + + : "[=signal base value/ig-storage-used=]": + :: Return |bidAndScoreMetrics|'s [=per participant metrics/storage quota used=]. + + : "[=signal base value/percent-ig-storage-quota-used=]": + :: Return the result of [=computing a percentage metric=] given |bidAndScoreMetrics|'s [=per + participant metrics/storage quota used=] and [=max interest groups total size per owner=]. + +
+
@@ -4696,6 +4749,19 @@ To compute a percentage metric given {{long}}s |numerator| and |denom
+
+To update storage metrics given [=per participant metrics=] |metrics| and a [=list=] of +[=interest groups=] |igs|: +1. [=list/For each=] |ig| of |igs|: + 1. If [=interest group/additional bid key=] is null, increment |metrics|'s [=per participant + metrics/regular interest group count=] by 1. + 1. Otherwise, increment |metrics|'s [=per participant metrics/negative interest group count=] + by 1. + 1. Increment |metrics|'s [=per participant metrics/storage quota used=] by |ig|'s [=interest + group/estimated size=] + +
+ ## Get storage interest groups for owner ## {#get-storage-interest-groups-for-owner-header} *This first introductory paragraph is non-normative.*