-
Notifications
You must be signed in to change notification settings - Fork 237
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
Splitting KV calls in smaller batches issue #1335
Comments
On that topic, I have one additional question. Could you please confirm that the order of the tbsKeys we receive in the KV server is determined by the priority vector as stated here: https://github.com/WICG/turtledove/blob/main/PA_implementation_overview.md#phase-1-load-interest-groups
|
Hi, I can't answer your questions but I would like you ask you on this one if you only care about the order of keys between interest groups, not within the same interest group? It seems to me to be the case since the priority is on IG level. |
Hello @peiwenhu we do care about the order of keys between interest groups (and not within the same interest group) |
I'm not sure what you mean by "independently" here. generateBid() is called once per InterestGroup (modulo an extra call for k-anonymity reasons), and each call only gets the signals values for keys in that were in that interest group. Those values all come from a single network fetch for the signals data. In the case of group-by-origin execution mode, all those calls may or may not share a Javascript execution context, including requests that received their signals from different fetches. We run each generateBid() call as soon as we have all the data we need to run it.
If you're using "enableBiddingSignalsPrioritization" for any of your interest groups, we can't determine the relatively priority of Interest Groups until we've received signals, so we have to wait until all trusted signals fetches for all Interest Groups with the same owner to complete, so we can determine the order to generate the bids, and apply any limits to the number of interest groups for that origin to generate bids. This performance cost is the reason "enableBiddingSignalsPrioritization" exists in the first place. We also have to wait for all promises that affect the generateBid() calls to resolve before we can start running scripts.
Network latency can vary, some requests may be served from the network disk cache, and even latency within Chrome may affect order we send requests over the network (e.g., if we have a cache entry that we may be able to use for the first request, and none for the second, even if it turns out we can't use the cache for the first request, checking that may make it hit the network after the second request). So you cannot rely on request order. While we attempt to send trusted signals requests in priority order for all interest groups with the same order, it's best-effort only. Whether we run scripts in priority order, or in the order the signals results are received, can also vary (if enableBiddingSignalsPrioritization is true, we run in priority order, otherwise, I believe we run in order we receive the responses). There are enough processes and asynchronous events that execution order is very much best-effort. If there are limits on number of interest groups in an auction, we do perfectly respect those, it's just when things are being done in parallel that order of execution may change. |
Lets take examples to illustrate better my questions : KV call split
Say KV2 returns first. So we should have two calls to generateBid Order of TBSKeys in the KV server |
Might this PA Implementation Overview caveat apply...
|
Yes, without
There's no guarantee of the order of keys when sent to the server. I think we currently sort them in lexical order, since we sort them to remove duplicates, but that's not guaranteed. |
I think that is actually no longer true - there's an unconditional process hop when the signals are received back to the browser process, and those aren't guaranteed to preserve order. I think even without |
Cancel the request if it's negative means not call generateBid when an IG's signals response contains a |
Correct - should have used clearer language there. |
When we set a value for
maxTrustedBiddingSignalsURLLength
we do observe a split in the KV calls in smaller batches (for the ones with many tbs keys). And this is expected.We would then expect that
generateBid()
is called for each of these batches independently of the others as they return.Is this assumption correct?
This seems to be described here: https://github.com/WICG/turtledove/blob/main/PA_implementation_overview.md#trusted-signals-fetches--reprioritization ( we are setting
enableBiddingSignalsPrioritization
to false)However we conducted a test and it does seems to wait for all the calls to the KV server to finish before starting
generateBid()
Could you please advise on the expected behaviour?
The text was updated successfully, but these errors were encountered: