Repository navigation
[ntuple] Fix zero pages for encoded and deferred columns - #23742
Draft
Elvand-Lie wants to merge 1 commit into
Draft
Elvand-Lie wants to merge 1 commit into
Elvand-Lie wants to merge 1 commit into
Conversation
Union merges synthesize default pages when a source lacks a field. Packed byte sizes do not give the number of in-memory elements for bit and low-precision columns, and recreating elements without the stored bit width and value range can produce invalid pages. Configure destination elements from their descriptors and split default pages by element count. Report packing failures with the field name through RResult rather than throwing out of Merge. Convert deferred first-element indices to entries before filling gaps, using the same field repetition calculation as zero-page generation. Fix both paths together because their errors cancel for some bitsets. Cover missing encoded fields, quantized ranges excluding zero, and deferred arrays, bitsets and bools across one or two clusters. Assisted-by: codex:gpt-6.1-sol Assisted-by: claude-code:opus
Elvand-Lie
marked this pull request as draft
October 16, 2026 15:02
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull request:
Fix incorrect default pages written by RNTupleMerger for a field missing from a later source (Union mode), and for a field that a later source added through late model extension (any merging mode, including the default one used by
hadd).Changes or fixes:
Zero-page generation used packed byte counts as if they were in-memory element counts and recreated column elements without their stored bit widths or quantization ranges. Missing bool, bitset and half-precision fields consequently received too few elements; truncated and quantized fields received incorrectly encoded pages.
Generate default pages by element count, using the destination column's bit width and value range. Return packing errors, including a quantization range that excludes zero, as a failed RResult identifying the field.
Deferred columns also compared their first element index with a cluster entry index and applied repetitions again when filling the gap. Convert the first element index to entries using the shared repetition calculation before comparing or filling. Both defects must be fixed together: for deferred bitsets, the incorrect packed-byte conversion previously canceled the extra repetition factor.
Tests cover a missing middle source for bool, bitset<8>, half-precision float, truncated float and quantized float; a quantized range excluding zero; and deferred array<float,3>, bitset<8> and bool fields with one or two clusters. Successful merges check every value and each cluster's column element count.
Validation
Base: upstream master
fbcf83fe9a58e65f36ba55bdc3821a7983f4799a. Candidate:a81947c7fdb915c3bef2644833ea279d3ae7108f.tree/ntuple/test/all tree/ntupleutil/test/allwith-j3.ntuple_merger: 352 tests passed, including all 12 new regression cases.ctest -R "ntuple|hadd" -E "largefile|largevector|tutorial" -j2 --output-on-failure:std::array<float,3>setup throughTFileMergerwith no merge options, ashadddoes: master reports success but writes 6 instead of 10 bool elements and 60 instead of 30 float elements in the second cluster, and the values read back are wrong; with this change all values match.git diff --checkpassed.The separate recompression path still constructs source column elements without their low-precision parameters. Recompression of Real32Trunc/Real32Quant with a different output compression is outside this change and is not addressed here.
AI assistance: Codex (gpt-6.1-sol) implemented the change and regressions, and Claude Code (opus) discovered the defects and independently validates the work.
Checklist:
This PR fixes incorrect zero-page generation and deferred-column filling in RNTupleMerger.