Skip to content

Pr566 slim - #569

Draft
Vindaar wants to merge 5 commits into
cris_preserve_streamerinfosfrom
pr566-slim
Draft

Pr566 slim#569
Vindaar wants to merge 5 commits into
cris_preserve_streamerinfosfrom
pr566-slim

Conversation

@Vindaar

@Vindaar Vindaar commented Sep 7, 2026

Copy link
Copy Markdown
Member

Vindaar Large: 808 Powered by Pull Request Badge

This is a reimplementation of the ideas from PR #566, but in a much more focused and succinct way.

The recovery workflow that is added now fully embraces that it is entirely specific to the vector<float> -> vector<double> schema change and nothing else. And instead of building a full blown REST ROOT file copy mechanism that iterates a file to copy everything, we now essentially make an opaque copy and only mutate the parts of the file that actually changed.

This PR depends on some minor additions to detectorlib for the CI to make sure the changes are actually working as expected. That is PR rest-for-physics/detectorlib#132.

For the moment this also targets the branch of #567, because this code now depends on that. So either way, we should focus on merging 567 first now.

I'll update the description at a later point.

Vindaar and others added 5 commits August 25, 2026 20:42
… data

Add a deliberately narrow restRoot command for TRestDetectorSignal versions 1 through 3, whose time and charge vectors were stored as Float_t before the modern version-4 Double_t schema. A plain-ROOT child process uses replica legacy classes to extract only the affected event branch into a private, source-identified intermediate, avoiding coexistence of old and current dictionaries.

Build the result from a byte-for-byte local candidate, open it through the safe writable ROOT handle introduced by the PR 567 base, disable the incompatible signal branch, and use TTree fast cloning to preserve every unaffected branch as raw baskets. Refill only the current detector signal branch, leave unrelated keys in place without deserializing them, and validate source identity, structure, counts, and every converted signal value before atomically publishing a new output.

The command rejects unsupported schemas, ROOT URLs, in-place and existing outputs, and mismatched intermediates. It never modifies the original and provides no generic, partial, or rollback modes. Update the detectorlib pin to current v4 code plus the focused opaque-data integration tests.
Add a user guide for the one-command local recovery, its default and explicit output naming, supported v1-v3 scope, provenance, validation, and failure guarantees. Link the command from the REST program inventory and expose it in restRoot help through the implementation commit.

Record the developer architecture and the ROOT 6.26/10 fast-clone experiments that determined the process boundary. Explain why legacy extraction runs under plain ROOT, why raw cloning runs only after REST dictionaries are loaded, which unrelated content is preserved opaquely, and why generic CopyTree, ReadObj, or manual key and basket rewriting were rejected.
Record the concrete failure found in the canonical R00236 file: StreamerInfo produces a non-null emulated class for the removed zS2Raw process, yet TKey::ReadObj still segfaults while ROOT attempts to instantiate an abstract compiled base.

The narrow recovery avoids that failure by retaining unrelated top-level keys in its initial byte-for-byte copy and never deserializing them. Advance the detectorlib test commit to assert this emulated-class precondition and exercise the shipped leading -l restRoot invocation.
Inspect the split detector-signal branch as soon as TRestRun opens a file. When current v4 dictionaries encounter an on-disk v1-v3 signal schema without its matching StreamerInfo, stop before metadata or event setup and direct the user to the one-time restRoot recovery command. Files carrying valid historical StreamerInfo continue through ROOT's normal schema evolution.

Document the fail-fast boundary and the deliberate absence of partial-read support. Hide the recovery option from restRoot help in detector-free builds, and update the detectorlib test fixture to cover unsafe, naturally readable, and recovered legacy files.
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