Skip to content

Record alignment of class in dictionary and use in TStreamerInfo#231

Open
smuzaffar wants to merge 244 commits intocms-sw:cms/master/c7a2f850099from
pcanal:tclass-alignof
Open

Record alignment of class in dictionary and use in TStreamerInfo#231
smuzaffar wants to merge 244 commits intocms-sw:cms/master/c7a2f850099from
pcanal:tclass-alignof

Conversation

@smuzaffar
Copy link
Copy Markdown

testing root-project#21669 for CMSSW

guitargeek and others added 30 commits March 23, 2026 08:45
The `PyBuffer_Release` function has its current interface since Python
3.1, which is long end-of-life, so we don't need to be backwards
compatible for that. This also makes the code easier to understand
because no unused arguments are passed around.
Add a dedicated converter for `std::span` (C++20) to enable passing Python
buffer-compatible objects to C++ functions expecting `std::span<T>`.

The new StdSpanConverter supports:
- Python buffer protocol (e.g. NumPy arrays, array.array)
- Existing C++ objects (passed through as-is)
- Automatic conversion from other C++ classes like `std::vector`
- Both `std::span<T>` and `std::span<const T>`

A typecode mapping utility is introduced to validate buffer formats
against the expected C++ value type. Incompatible buffers now raise a
descriptive TypeError indicating the expected and actual formats.

A new unit test to validate these conversions is also implemented.
When the pdf is cloned for a specific normalization set, the
"recursiveFraction" argument should not be set, because the original
input coefficients have already been transformed into regular
linear coefficients in the original RooAddPdf constructor.

Follows up on 4ebe103, fixing the regression reports root-project#21635
and root-project#21644.
Move from plain array to unordered_map.
So pointer on XWindow_t will not change if new window will be created later.
Idea to use this pointer later as main handle for graphics operation -
while using window id will costs locking of the mutex which need to be
introduced later for threads safety
First provide window context for each active window.
Window context should allow access per-window functionality fully independent from each other

As a first interfaces declare methods to change attributes.
So one can set different drawing attributes independently for each window.
Allows to use native X11 types without casting.
List of windows now defined as:
```
std::unordered_map<Int_t,std::unique_ptr<XWindow_t>> fWindows
```
In TCanvas::Feedback() method first select fCanvasID before
changing draw mode. Only becase of global GC attributes it was possible before.
If GC allocated per window - one should do it correctly
Only window-specific contexts are used
Remove unused method CopyWindowtoPixmap
So setting line/fill style to TGX11 will change attributes for
currently selected window.
Comment out most of members
Allocate marker attributes per window,
comment aout global gMarker structures
Where it make sense - use XDrawSegments for markerS
Without TTF support X11 fonts are used.
Move text attributes handling to XWindow_t structure,
keep only global gTextFont for text size handling.
One can add hook there to allocate and initialize there TTF structures.
For now keep global members
Last place was PutImage method - used either special window GC or just temporary created GC
PutImage is not used at all
Now only window-special contexts are used
Use when TGX11TTF instance must be created.
Copy constructor it too complicated.
So one can specify window where drawing operation is performed
Old signatures redirects to new methods
Remember context of selected window and use this context
when performing drawing on the pad
Provide protected methods to return window, GC and textAlign for selected window context.
And use context in TTF rendering methods.

So now TGX11TTF also correctly implementes API,
but not yet thread-safe because of TTF global states.
Instead set individiual line or fill attributes use new
methods with TAtt... object as instance.
In TPadPainter it is redirected to selected window context
So even if there are several canvases displayed - attributes will be modified in the correct window context.
While some objects painters analyze attributes
like gVirtualX->GetLineWidth(), provide such getters.
But only for transition phase - later one can dismiss methods again
line width and fill style used in drawing.
While attributes set anyway via pad painter interface,
just remember them to avoid need provide getters from TVirtualX
To avoid complication with derived classes
linev and others added 28 commits April 2, 2026 10:11
Now each window uses own list of GC objects
There is no reason to define it in header
Also avoid duplication of kNone constant
Without `-DCMAKE_INSTALL_LIBDIR=lib` lib path in
FREETYPE_LIBRARY can be lib64 or something else
A unit test covering the reported issue is also implemented.

Closes root-project#21732
Since align is a power of 2 the modulo may be written as (offset & (align - 1)) (assuming offset is non-negative)

Co-authored-by: silverweed <giacomo.parolini@cern.ch>
The compression factor the TTree is changed due the fact that
the numerical value record for `TBranch::fOffset` are changed.
Wrong now that we took base class alignment in consideration.

This reverts commit 37eba5a.
@cmsbuild
Copy link
Copy Markdown

cmsbuild commented Apr 2, 2026

This PR contains too many commits (244 >= 240) and will not be processed.
Please ensure you have selected the correct target branch and consider squashing unnecessary commits.
The processing of this PR will resume once the commit count drops below the limit.

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.