Skip to content

DPL: preparing for SlotArena migration - #15673

Open
ktf wants to merge 4 commits into
AliceO2Group:devfrom
ktf:pr15673
Open

DPL: preparing for SlotArena migration#15673
ktf wants to merge 4 commits into
AliceO2Group:devfrom
ktf:pr15673

Conversation

@ktf

@ktf ktf commented Aug 10, 2026

Copy link
Copy Markdown
Member

Improve tests and benchmarks so that the upcoming migration from vector<vector<Message>> to SlotArena is minimal and well covered.

@ktf
ktf requested a review from a team as a code owner August 10, 2026 10:50
@ktf ktf changed the title DPL: assert an allocation budget for a relay/consume cycle DPL: improve DataRelayer tests in preparation for moving to SlotArena Aug 10, 2026
ktf added 4 commits August 10, 2026 13:23
The existing sections assert part counts and pointer nullness, never payload
contents, so any change to how a slot's messages are stored can shuffle them
between inputs without a single test noticing.

Stamp every payload and check it comes back on the right input, in the order it
was relayed. Two arrangements that a shared per-slot buffer makes interesting:
arrivals interleaved across three inputs, so a cell is no longer the last one
written when its second part shows up; and an expiring input materialised into a
slot the other inputs already occupy, which leaves the cells out of input order.
Contents are also re-checked after the slot has been refilled, which pins that
consuming really does hand the messages over.
A timing benchmark cannot tell a storage-layout regression from a busy machine.
Count allocations instead: with eight inputs, relaying every input plus the
consume costs 18 allocations, and that number must not grow when the way a slot
holds its messages changes. The messages are built before the counter is armed,
so what is measured is the relayer rather than fair::mq.

The global operator new replacement only counts while a test arms it, so the
rest of the binary is unaffected.
The relayer tests and benchmarks reach into the consumed record with .size() and
.at(), which pins them to the record being a vector. Both operator[] and a
count_inputs pipe work on anything the relayer might hand back -- a vector of
per-input sets, or an arena holding them in one buffer -- so a change of storage
leaves this code untouched instead of rewriting thirty call sites.
Every existing benchmark here uses one or two inputs, which is exactly the
regime where per-input storage costs nothing to speak of, so none of them can
see a change to how a slot holds its messages. Sweep 1/8/32/128 instead.

Note this is the only benchmark using consumeWhenAll, which looks the
TimesliceIndex up in the service registry (CompletionPolicyHelpers). The others
use consumeWhenAny and never do, which is why BenchmarkServices does not
register it and why it has to be registered here -- without it the benchmark
throws at every input count, including one.
@ktf ktf changed the title DPL: improve DataRelayer tests in preparation for moving to SlotArena DPL: benchmark a relay/consume cycle across many inputs Aug 10, 2026
@ktf ktf changed the title DPL: benchmark a relay/consume cycle across many inputs DPL: preparing for SlotArena migration Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant