Skip to content

[ntuple] Preserve trunc/quant params of late-merged fields - #23646

Merged
silverweed merged 1 commit into
root-project:masterfrom
Elvand-Lie:fix/ntuple-merger-late-trunc-params
Oct 13, 2026
Merged

silverweed merged 1 commit into
root-project:masterfrom
Elvand-Lie:fix/ntuple-merger-late-trunc-params

Conversation

@Elvand-Lie

@Elvand-Lie Elvand-Lie commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

This Pull request:

Changes or fixes:

Late model extension in RNTupleMerger recreates a missing field from its descriptor but pins only the column type, losing the truncation/quantization bit width and value range. This can produce an invalid truncation width or decode copied quantized pages with the wrong range. Restore those parameters before extending the destination schema, including nested subfields, using the existing field setters. Restoration failures propagate through RResult; setter exceptions are converted to failures. Reconstructed class members absent from the source descriptor are skipped because they have no source column parameters to restore.

The regression RNTupleMerger.MergeLateExtensionReal32TruncQuant checks float and double fields, a nested vector item, stored widths and ranges, earlier-entry defaults, and read-back values.

Validation:

Tested published head 4b32efb on Ubuntu WSL with GCC 13.3.0, RelWithDebInfo, testing enabled, and C++ modules disabled:

  • All 54 configured RNTuple and RNTuple utility gtest executables pass, covering 993 enabled cases.
  • All 340 merger tests pass, including the new regression.
  • The same regression fails against the pre-fix merger at the invalid storage-width assertion; three existing control tests pass against that baseline.
  • Changed-line formatting passes with clang-format 20.

Upstream-disabled tests retained their defaults. Native Windows, C++ modules enabled, tutorials, the remaining ROOT test suite, and CI were not run.

Checklist:

  • tested changes locally
  • updated the docs (if necessary) (no documentation change needed)

No existing issue tracks this bug. Before opening the PR, open and closed issues, open PRs, and recent merger commits were searched for truncation, quantization, and ExtendDestinationModel; no competing fix was found.

AI disclosure: implementation assistance from Muse Spark (Meta) via OpenCode, code review by Opus 5.5, and build recovery, test validation, and review-follow-up verification by Codex:gpt-6.1-sol. Final review and decisions remain with the author.

@silverweed silverweed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. A few minor comments

Comment thread tree/ntuple/src/RNTupleMerger.cxx
Comment thread tree/ntuple/src/RNTupleMerger.cxx
Comment thread tree/ntuple/src/RNTupleMerger.cxx
Comment thread tree/ntuple/src/RNTupleMerger.cxx
Comment thread tree/ntuple/test/ntuple_merger.cxx Outdated
Comment thread tree/ntuple/test/ntuple_merger.cxx Outdated
@Elvand-Lie
Elvand-Lie force-pushed the fix/ntuple-merger-late-trunc-params branch from 6567a9d to 830706e Compare October 7, 2026 14:59
Union merging a late low-precision field recreates it from the
descriptor and pins only the column type. Truncation parameters
live in the in-memory field, so the destination column got default
(and for kReal32Trunc out-of-range) values, failing the merge or
corrupting quantized data. Restore them from the source descriptor,
recursing into subfields by on-disk ID. Add a merger regression
checking descriptor parameters, zero-filled earlier entries and
read-back values.

Assisted-by: Muse Spark (Meta) via OpenCode
@Elvand-Lie

Elvand-Lie commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi @silverweed, ready for another look. I've picked up your error-handling suggestions and run the tests locally.

I kept the invalid-ID check since that ID can be invalid with an evolved class dictionary. Asserting there would crash a merge. While checking this, I found a separate schema-mismatch bug and opened #23684 to fix it.

@github-actions

Copy link
Copy Markdown

Test Results

    24 files      24 suites   4d 4h 53m 17s ⏱️
 3 885 tests  3 883 ✅ 0 💤 2 ❌
83 158 runs  83 155 ✅ 0 💤 3 ❌

For more details on these failures, see this check.

Results for commit 4b32efb.

@silverweed silverweed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@silverweed
silverweed merged commit 1f3103a into root-project:master Oct 13, 2026
31 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants