You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AODBcRewriter: restore BC sort in Stage 0, keep track regrouping
Commit 28b44ef replaced the Stage 0 BC sort with an order-preserving
dedup that std::abort()s unless the input BC table is already
globalBC-sorted. That contradicts the tool's purpose (PURPOSE (a):
repairing non-monotonic fGlobalBC in merged AO2Ds), so it aborted on
exactly the files it exists to fix -- the "doesn't run to completion"
regression.
Revert only that Stage 0 change (restore stage0_sortBCs, drop the
abort). Keep 28b44ef's Stage 1b track regrouping and the fIndexTracks*
remaps: that mechanism is the correct fix for the -1-group split from
b11cd3d (track fIndexCollisions values were remapped but rows left in
input order, so per-collision groups -- including the -1 ambiguous
group -- were no longer contiguous, tripping
ArrowTableSlicingCache::validateOrder downstream). It only ever failed
because the aborting Stage 0 stopped it running. Sorting BCs implies a
BC -> collisions (Stage 1) -> tracks (Stage 1b) reorder cascade, which
those stages now handle completely.
Add a validator check (checkCollisionGroupContiguity) mirroring O2's
slicing invariant: every fIndexCollisions group must be one contiguous
run. Added a history note in Stage 0 against re-introducing the
order-preserving abort.
Not yet validated against a real merged AO2D / analysis task.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mirrors O2's slicing invariant — flags any `fIndexCollisions` group split
46
+
into >1 run. Runs over every collision-grouped track table.
47
+
48
+
**Design note / cascade:** sorting BCs is unavoidable for non-monotonic input
49
+
and forces a reorder cascade **BC (Stage 0) → collisions (Stage 1) → tracks
50
+
(Stage 1b)**, propagated to paste-join children and all track references. Do
51
+
**not** re-introduce an "assert already sorted / order-preserving" Stage 0 — it
52
+
is a known dead end (see the history note in the Section 4 code comment).
53
+
54
+
### Not done yet / next steps for whoever picks this up
55
+
56
+
-**UNVALIDATED on real data.** Parses cleanly in cling (`.L AODBcRewriter.C`),
57
+
but has *not* been run on a real merged AO2D, nor through the analysis task
58
+
that crashed. The macro is interpreter-only; `.L AODBcRewriter.C+` (ACLiC)
59
+
fails on missing std includes — pre-existing, not a regression.
60
+
Test sequence: `AODBcRewriter("AO2D.root","out.root")` →
61
+
`AODBcRewriterValidate("out.root")` (expect no `[FAIL]`) → then the **real**
62
+
`o2-analysis-event-selection` on `out.root` (ground truth).
63
+
-**Known fragility (whack-a-mole):** the `fIndexTracks*` reference remap is a
64
+
hardcoded enumeration in `processPasteJoinTables` and the validator's
65
+
`kIndexBranchToTable`. A missed reference into a reordered track table = silent
66
+
corruption. Longer term, *derive* index→referent relationships from the AO2D
67
+
column-name conventions instead of enumerating.
68
+
-**Biggest gap:** there is no executable analysis-level CI for this tool, so
69
+
regressions are only found in production with delay. Building a reproducer
70
+
(merged AO2D that triggers the split/abort) + a CI check that runs the real
71
+
task is the agreed top priority after this fix lands.
72
+
73
+
---
74
+
3
75
## What this tool does
4
76
5
77
`AODBcRewriter.C` is a ROOT macro that fixes structural integrity problems in
@@ -87,7 +159,8 @@ order strictly follow its paste-join parent.
87
159
| 5 |`stage0_copyBCFlags`| Copy BC flags table following BC row selection |
88
160
| 6 |`MCCollKey`, `MCCollKeyHash`, `stage1_BCindexedTables`| Process all BC-indexed tables; deduplicate MCCollisions |
89
161
| 7 |`stage2_MCCollIndexedTables`| Process all MCCollision-indexed tables; drop rows whose parent was deduped |
90
-
| 8 |`rowOrderFromPerm`, `findPermByPrefix`, `processPasteJoinTables`| Reorder paste-joined tables to follow their parent (1:1 row count guaranteed); remap any of their own index columns value-wise; copy unrelated tables verbatim |
162
+
| 9b |`isCollGroupedTrackTable`, `stage1b_reorderTrackTables`|**Stage 1b**: regroup collision-grouped track tables (`O2track_iu`, `O2mfttrack`, `O2fwdtrack`) by remapped `fIndexCollisions` (`-1` sinks to a contiguous tail); publish track perms so children/references follow. Restores the O2 slicing invariant after the BC→collision reorder cascade |
163
+
| 8 |`rowOrderFromPerm`, `findPermByPrefix`, `processPasteJoinTables`| Reorder paste-joined tables to follow their parent (1:1 row count guaranteed); remap any of their own index columns value-wise (incl. `fIndexTracks*` via the Stage 1b track perms); copy unrelated tables verbatim |
91
164
| 9 |`copyNonTreeObjects`| Copy TMap metadata and other non-TTree objects |
92
165
| 10 |`processDF`| Orchestrates all stages for one `DF_*` directory |
0 commit comments