Skip to content

AODBcRewriter: fix paste-join children after row reorder/dedup#2360

Open
sawenzel wants to merge 1 commit into
AliceO2Group:masterfrom
sawenzel:swenzel/O2-6937
Open

AODBcRewriter: fix paste-join children after row reorder/dedup#2360
sawenzel wants to merge 1 commit into
AliceO2Group:masterfrom
sawenzel:swenzel/O2-6937

Conversation

@sawenzel
Copy link
Copy Markdown
Contributor

Fixing a bug in AODBcRewriter: The previous code did not consider tables which are paste-joinable by convention rather via an explicit index. This is now the case. Fixes https://its.cern.ch/jira/browse/O2-6937

Paste-joined ("implicit-join") tables — row N of the child matches row
N of the parent — must keep equal row counts and have embedded index
columns remapped when the parent is reordered or deduped.

Two bugs fixed:

1. O2mccollisionlabel was routed through Stage 2 because it carries
   fIndexMcCollisions; Stage 2 then sorted and dropped rows whose MC
   collision was dedup'd, breaking the 1:1 join with O2collision and
   crashing downstream consumers on the misaligned tables.

2. The SOA SLICE_INDEX_COLUMN fIndexSliceBCs[2]/I — present only on
   O2ambiguous{track,mfttr,fwdtr}, which Stage 1 does not touch —
   was never remapped after BC dedup, so slice endpoints pointed past
   the compacted BC table.

Stage 2 now defers paste-join children to the paste-join handler,
which preserves the parent's row order and applies value-wise remaps
for fIndexMcCollisions / fIndexCollisions / fIndexSliceBCs /
fIndexBCs / fIndexBC via the existing ExtraRemap path. bcPerm is
passed as an explicit argument to avoid an unordered_map iteration-
order side effect that broke O2mccalolabel -> O2calo prefix lookup.

kPasteJoins extended to all pairs documented in AnalysisDataModel.h
(adds O2bcflag/O2bc, O2mccalolabel/O2calo, O2trackcov_iu/O2track_iu,
O2trackextra/O2track_iu, O2fwdtrackcov/O2fwdtrack).

AODBcRewriterValidate gains paste-join row-count parity checks and a
generic fIndex* range check (kIndexBranchToTable) that handles scalar,
fixed-size, and VLA branches uniformly. CLAUDE.md updated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@sawenzel sawenzel requested a review from jackal1-66 as a code owner May 19, 2026 16:44
@github-actions
Copy link
Copy Markdown

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass4
async-2023-pp-apass4
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0
async-2024-PbPb-apass1
async-2024-ppRef-apass1
async-2024-PbPb-apass2
async-2023-PbPb-apass5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant