Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmturner committed Apr 15, 2024
1 parent 0806f2b commit 8247f28
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ are:
1. If |preSpecifiedParamsMap|[|batchingScope|] [=map/exists=]:
1. Set |filteringIdByteSize| to |preSpecifiedParamsMap|[|batchingScope|]'s
[=pre-specified report parameters/filtering ID byte size=].
1. If |contribution|["{{PAHistogramContribution/filteringId}}] is not in the
1. If |contribution|["{{PAHistogramContribution/filteringId}}"] is not in the
range [0, 256<sup>|filteringIdByteSize|</sup>−1], [=exception/throw=] a
{{RangeError}}.
1. Let |entry| be a new [=contribution cache entry=] with the items:
Expand Down Expand Up @@ -856,7 +856,7 @@ error.
enabled=] is true:
1. [=list/For each=] |contribution| of |report|'s [=aggregatable report/
contributions=]:
1. If |contribution|[{{PAHistogramContribution/filteringId}}] [=map/
1. If |contribution|["{{PAHistogramContribution/filteringId}}"] [=map/
exists=]:
1. Set |shouldUseNewReportVersion| to true.
1. [=iteration/Break=].
Expand Down Expand Up @@ -975,12 +975,16 @@ To <dfn>obtain the plaintext payload</dfn> given an [=aggregatable report=]
|contribution|["{{PAHistogramContribution/value}}"] and 32.
1. Let |filteringIdBitSize| be the product of 8 and |report|'s
[=aggregatable report/filtering id byte size=].
1. [=Assert=]: |contribution|["{{PAHistogramContribution/filteringId}}"] is
in the range [0, 2<sup>|filteringIdBitSize|</sup>−1].
1. Let |filteringId| be 0.
1. If |contribution|["{{PAHistogramContribution/filteringId}}"]
[=map/exists=]:
1. [=Assert=]: |contribution|["{{PAHistogramContribution/filteringId}}"]
is in the range [0, 2<sup>|filteringIdBitSize|</sup>−1].
1. Set |filteringId| to
|contribution|["{{PAHistogramContribution/filteringId}}"].
1. If |shouldUseNewReportVersion|:
1. [=map/Set=] |contributionData|["`id`"] to the result of [=encoding an
integer for the payload=] given
|contribution|["{{PAHistogramContribution/filteringId}}"] and
integer for the payload=] given |filteringId| and
|filteringIdBitSize|.

Issue: Be consistent about bytes or bits as units here.
Expand Down Expand Up @@ -1352,6 +1356,7 @@ dictionary PASignalValue {
dictionary PAExtendedHistogramContribution {
required (PASignalValue or bigint) bucket;
required (PASignalValue or long) value;
bigint filteringId;
};

[Exposed=InterestGroupScriptRunnerGlobalScope, SecureContext]
Expand Down Expand Up @@ -1419,8 +1424,10 @@ event, PAExtendedHistogramContribution contribution)</dfn> method steps are:
throw=] a {{TypeError}}.
1. Otherwise, if |contribution|["{{PAHistogramContribution/value}}"] is
negative, [=exception/throw=] a {{TypeError}}.
1. If |contribution|["{{PAHistogramContribution/filteringId}}] is not in the
range [0, 255], [=exception/throw=] a {{TypeError}}.
1. If |contribution|["{{PAExtendedHistogramContribution/filteringId}}"]
[=map/exists=] and
|contribution|["{{PAExtendedHistogramContribution/filteringId}}"] is not in
the range [0, 255], [=exception/throw=] a {{TypeError}}.

Issue: Make the error types on validation issues here and above consistent
with {{PrivateAggregation/contributeToHistogram(contribution)}}.
Expand Down Expand Up @@ -2049,7 +2056,10 @@ an <a spec="turtledove">auction config</a> |auctionConfig| and a
:: |bucket|
: {{PAHistogramContribution/value}}
:: |value|
: {{PAHistogramContribution/filteringId}}
:: 0

Issue: Consider allowing the filtering ID to be set here.
1. [=map/For each=] |ig| of the [=user agent=]'s <a spec="turtledove">
interest group set</a> whose
<a spec="turtledove" for="interest group">owner</a> is
Expand Down Expand Up @@ -2104,11 +2114,18 @@ following steps. They return a {{PAHistogramContribution}}.
1. Let |value| be |contribution|["{{PAExtendedHistogramContribution/value}}"].
1. If |value| is a {{PASignalValue}}, set |value| to the result of [=filling in
the signal value=] given |value|, 2<sup>31</sup>−1 and |leadingBidInfo|.
1. Return a new {{PAHistogramContribution}} with the items:
1. Let |filledInContribution| be a new {{PAHistogramContribution}} with the
items:
: {{PAHistogramContribution/bucket}}
:: |bucket|
: {{PAHistogramContribution/value}}
:: |value|
1. If |contribution|["{{PAExtendedHistogramContribution/filteringId}}"]
[=map/exists=]:
1. [=map/Set=]
|filledInContribution|["{{PAHistogramContribution/filteringId}}"] to
|contribution|["{{PAExtendedHistogramContribution/filteringId}}"].
1. Return |filledInContribution|.

To <dfn>fill in the signal value</dfn> given a {{PASignalValue}} |value|, an
integer |maxAllowed| and a <a spec="turtledove">leading bid info</a>
Expand Down

0 comments on commit 8247f28

Please sign in to comment.