Skip to content

Commit deed8c2

Browse files
author
edfink234
committed
Adding linSpace, logSpace, and arange prototypes
[RFHS3] Remove mention of RapidYML backend, which is not supported. Due to lack of time, only one RooFit backend can be supported. On CMake configure, it, however, looked like RapidYML should be found. Here, the corresponding YML messages and mentions throughout the documentation are removed. If the backend should be revived, this commit can be reverted. Fix #18128. Introduce TObject::SavePrimitiveVector Save array of doubles in C++ macro as std::vector<Double_t>. Should replace in code use of SavePrimitiveArray - while stack has limited memory and therefore plain arrays in macro can exhaust resources Use SavePrimitiveVector for TH1/TProfile classes Use SavePrimitiveVector in TGraph classes Use SavePrimitiveVector for TCutG/TScatter/TEfficiency Use SavePrimitiveVector for TF1/TF2 Use SavePrimitiveVector in TGraph2D Use SavePrimitiveVector in TPolyLine/Mraker/3D classes Remove SavePrimitiveArray Was replaced by SavePrimitiveVector. No longer used in the code, was not in released code [ntuple] Move RNTupleView out of Experimental No constraints to torch version in `requirements.txt` Now that pytorch/pytorch#138333 is fixed, commit 24fd0d8 can be reverted. [tree] check for return values in WriteBaskets Fixes https://its.cern.ch/jira/browse/ROOT-5137 [nfc] clangformat [nfc] modernize Co-authored-by: Philippe Canal <[email protected]> [core] escape pluses in TRegexp::MakeWildcard Fixes https://its.cern.ch/jira/browse/ROOT-7626 [Python] Format `rdf_filter_pyz.py` to pass ruff checks [Python] Fix RDF Pythonization tests with `builtin_llvm=OFF` On my machine, the RDF pythonization tests don't run when I build ROOT with `builtin_llvm=OFF`. There is a crash unless I do `import numba` in the beginning. I guess it's not a priority to understand the underlying problem because not many people build ROOT like this and the workaround is easy, but at least the tests should be green. We do the same "magically ordered imports" also in other Python tests where ROOT doesn't work together with xgboost because of `std::regexp` symbol clashes, unless you do the import in a certain order: #15183 [hist] fix red highlight box in log mode Fixes #12497 [ci] Disable TMVA on Alma8 [RF] Fix implementation of HS3 importers Fix by @guitargeek. The RooWSFactoryTool expression handler was not correctly matching branckets, leading to failures when importing valid JSON filed with RooProdPdf objects. [df] Avoid bad integer substitution in string formatting The '%lu' token used in RLoopManager::RunDataSource does not correspond to the correct integer representation of `std::uint64_t` on all platforms. We use a stringstream instead to construct the warning message. Introduce TObject::SavePrimitiveDraw method Store typical object->Draw() invocation. Correctly handle "nodraw" arguments in options Also replace special symbols if option string is not empty Use SavePrimitiveDraw in graf2d/graf classes Improve TGraphStruct::SavePrimitive Use new method to store constructor and attributes Simplify loops over nodes and edges Use fixed variable name for TGraphEdge Use SavePrimitiveDraw in hist classes Use SavePrimitiveDraw in other classes Fix TPave::SavePrimitive for web case In case when canvas created in the batch mode, it never rendered on server side. And thus coordinates of TPave object remains not-initialized. But there are macros where coordinates of TPaveStats are modified. Such modification stored in NDC coordinates and should be taken into account when TPave stored in C macro Adjust stressGraphics_web.ref after TPave adjustments Now positions of stats box modified in batch stored correctly [RF] fix segfault in fillLegacyCorrMatrix shown in https://root-forum.cern.ch/t/extracting-global-correlation-causes-a-seg-fault-with-sumw2error/55138 Implementing changes requested by @dpiparo [webgeom] resize workaround for qt6 Rendering inside qt5/qt6 does not provide correct size, therefore add resize handler in both cases Do not use `source_dir` in widgets This is location of JSROOT scripts, but normally one should use `import {something } from 'jsroot'` statement Now jsroot_importmap used in all widgets anyway Reduce source_dir usage in eve7 [ntuple] Move RNTupleWriter out of Experimental [hist] revert changes to v5 GetExpFormula fl_format Since it breaks backward compatibility Fixes #18214 thanks guitargeek for finding out [skip-ci] cleaner docu Implementing changes requested by @dpiparo Move qt5web classes to qt6webdisplay They were used by both qt5 and qt6, now only for qt6 Completely delete qt5webdisplay sources Delete/deprecate qt5web build option Qt5 web engine no longer works with newest JSROOT and makes no sence to support. Everybody should be able to switch to comparable qt6 version Remove kQt5 from RWebDsiaplayArgs It was display kind for --web=qt5 argument Adjust tutorials/visualisation/webgui/qtweb Only support qt6 for building this tutorial Remove qt5 workaround in THttpServer For usage of qt5 webengine importmap has to be emulated Now such emulation is no longer necessary Introduce RWebDisplayArgs::GetQtEmbedQualifier Keep old GetQt5EmbedQualifier to backward compatibility, but prefer to use newer approach Use GetQtEmbedQualifier in qtweb tutorial Last place where qt5 was checked Remove qt5 from documentation and comments Update README/ReleaseNotes/v636/index.md Co-authored-by: Jonas Rembser <[email protected]> Use view framework with newest CEF Latest CEF 134 shows URL/tabs with native widgets Therefore switch to use of view framework starting from CEF 131 Update CEF readme with current CEF version Let configure usage of CEF views framework via rootrc parameter Use "WebGui.CefUseViews" parameter for this. Default is platform-dependent Mention CEF parameters in documentation [jsroot] dev 1/04/2025 1. Introduce `settings.FilesTimeout` to configure global timeout for file reading operations 2. Introduce `settings.FilesRemap` to let provide fallback address for http server, used for `root.cern` 3. Remove support of qt5 webengine, only qt6web is supported 4. Fix - correct axis range in `TScatter` drawing More use of RWebWindowWSHandler::GetBoolEnv Update docu Fix warning caused by RPadLength arithmetic operators Use `const` references as one should for `operator+` and `operator-`. This fixes the following warning I get when building ROOT with tests: ```txt In file included from /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/x86_64-unknown-linux-gnu/bits/c++allocator.h:33, from /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/allocator.h:46, from /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/memory:65, from /nix/store/qf61vad876jgyd4vnn147cz2jyvy23vl-gtest-1.16.0-dev/include/gtest/gtest.h:55, from /home/rembserj/code/root/root_src/graf2d/gpadv7/test/coords.cxx:12: In member function ‘void std::__new_allocator<_Tp>::deallocate(_Tp*, size_type) [with _Tp = double]’, inlined from ‘static void std::allocator_traits<std::allocator<_Tp1> >::deallocate(allocator_type&, pointer, size_type) [with _Tp = double]’ at /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/alloc_traits.h:544:23, inlined from ‘void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp = double; _Alloc = std::allocator<double>]’ at /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/stl_vector.h:389:19, inlined from ‘void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp = double; _Alloc = std::allocator<double>]’ at /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/stl_vector.h:385:7, inlined from ‘std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = double; _Alloc = std::allocator<double>]’ at /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/stl_vector.h:368:15, inlined from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = double; _Alloc = std::allocator<double>]’ at /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/stl_vector.h:738:7, inlined from ‘ROOT::Experimental::RPadLength::~RPadLength()’ at /home/rembserj/code/root/root_src/graf2d/gpadv7/inc/ROOT/RPadLength.hxx:31:7, inlined from ‘virtual void PadCoord_AddSubtract_Test::TestBody()’ at /home/rembserj/code/root/root_src/graf2d/gpadv7/test/coords.cxx:36:26: /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/new_allocator.h:172:33: warning: ‘void operator delete(void*, std::size_t)’ called on pointer ‘<unknown>’ with nonzero offset [1, 9223372036854775800] [-Wfree-nonheap-object] 172 | _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n)); | ^ In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = double]’, inlined from ‘static _Tp* std::allocator_traits<std::allocator<_Tp1> >::allocate(allocator_type&, size_type) [with _Tp = double]’ at /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/alloc_traits.h:509:28, inlined from ‘std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = double; _Alloc = std::allocator<double>]’ at /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/stl_vector.h:380:33, inlined from ‘void std::_Vector_base<_Tp, _Alloc>::_M_create_storage(std::size_t) [with _Tp = double; _Alloc = std::allocator<double>]’ at /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/stl_vector.h:398:44, inlined from ‘std::_Vector_base<_Tp, _Alloc>::_Vector_base(std::size_t, const allocator_type&) [with _Tp = double; _Alloc = std::allocator<double>]’ at /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/stl_vector.h:334:26, inlined from ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = double; _Alloc = std::allocator<double>]’ at /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/stl_vector.h:603:61, inlined from ‘ROOT::Experimental::RPadLength::RPadLength(const ROOT::Experimental::RPadLength&)’ at /home/rembserj/code/root/root_src/graf2d/gpadv7/inc/ROOT/RPadLength.hxx:31:7, inlined from ‘virtual void PadCoord_AddSubtract_Test::TestBody()’ at /home/rembserj/code/root/root_src/graf2d/gpadv7/test/coords.cxx:36:26: /nix/store/aw0qxjd1phf16qhlwpdb4x87yymfv9rp-gcc-14-20241116/include/c++/14-20241116/bits/new_allocator.h:151:55: note: returned from ‘void* operator new(std::size_t)’ 151 | return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp))); | ^ ``` Update WebDisplay.md file Modify RGeomViewer::SaveAsMacro Do not use RDirectory::Heap(). Just create shared_ptr variable outside of function scope Use "\n" instead of std::endl [Python] Correctly manage NumPy dependencey in pythonization tests The dependency on Python libraries like NumPy needs to be declared in the CMakeLists.txt, such that the test gets disabled when the library is not available. In some cases, the dependency on NumPy could be avoided by using the builtin "array" library. [Python] Apply suggestions by ruff [CPyCppyy] Don't use deprecated `PyErr_Fetch` and `PyErr_Restore` API Also, in some places the same logic could be implemented with just `PyErr_Clear()`. [Python] Update `sync-upstream` script for cppyyy syncups SearchInstalledSoftware.cmake: correctly report name of option to disable [skip-ci] cpu backend specify it's single threaded See #17344 [DF] Retrieve RDatasetSpec for RDF built from JSON [CPyCppyy] Drop `__array__` from std::vector pythonizations The addition of the __array__ utility to std::vector Python proxies causes a bug where the resulting array is a single dimension, causing loss of data when converting to numpy arrays, for >1dim vectors. The recursive nature of this function, passes each subarray (pydata) to the next call and only the final buffer is cast to a lowlevel view and resized (in VectorData), resulting in only the first 1D array to be returned. See #17729 Since this C++ pythonization was added with the upgrade in 6.32, and is only defined and used recursively, the safe option is to disable this function and no longer add it. It is temporarily removed to prevent errors due to -Wunused-function Revert "[ci] Disable TMVA on Alma8" This reverts commit ebab348. Protect PyMva tutorials for a failurte in importing tensorflow Disable also batchgenerator tests for Python version less than 3.9 since tensorflow is not working for these lower python versions Fix build issue on macOS 15.4 / XCode 16.3 `less` is defined in functional according to the C++ standard. cling: Add ROOT lock to LookupHelper::findType This fixes #18236 As seen in cms-sw/cmssw#47763 (comment) there are cases where the ROOT global lock is taken too late: In the stack trace below the lock is requested on frame #7 where as it should really be (also) requested on frame #12 as soon as the transaction is being generated. ``` #6 0x00001501421f55ea in ROOT::TVirtualRWMutex::Lock() () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCore.so #7 0x0000150133a680ca in TCling::HandleNewTransaction(cling::Transaction const&) () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCling.so #8 0x0000150133a85778 in TCling::UpdateListsOnCommitted(cling::Transaction const&) () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCling.so #9 0x0000150133b60018 in cling::MultiplexInterpreterCallbacks::TransactionCommitted(cling::Transaction const&) () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCling.so #10 0x0000150133bec069 in cling::IncrementalParser::commitTransaction(llvm::PointerIntPair<cling::Transaction*, 2u, cling::IncrementalParser::EParseResult, llvm::PointerLikeTypeTraits<cling::Transaction*>, llvm::PointerIntPairInfo<cling::Transaction*, 2u, llvm::PointerLikeTypeTraits<cling::Transaction*> > >&, bool) () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCling.so #11 0x0000150133b5663a in cling::Interpreter::PushTransactionRAII::~PushTransactionRAII() () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCling.so #12 0x0000150133b6b883 in cling::LookupHelper::findType(llvm::StringRef, cling::LookupHelper::DiagSetting) const () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCling.so #13 0x00001501339b6b06 in ROOT::TMetaUtils::TClingLookupHelper::GetPartiallyDesugaredNameWithScopeHandling(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool) () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCling.so #14 0x00001501422f1458 in ResolveTypedefProcessType(char const*, unsigned int, unsigned int, bool, unsigned int, unsigned int, unsigned int, bool&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) [clone .constprop.0] () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCore.so #15 0x00001501422f1a0f in ResolveTypedefImpl(char const*, unsigned int, unsigned int&, bool&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCore.so #16 0x00001501422f2ef3 in TClassEdit::ResolveTypedef[abi:cxx11](char const*, bool) () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCore.so #17 0x00001501422f5c20 in TClassEdit::TSplitType::ShortType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int) () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCore.so #18 0x00001501422f6888 in TClassEdit::GetNormalizedName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string_view<char, std::char_traits<char> >) () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCore.so #19 0x000015014232e795 in ROOT::Internal::GetDemangledTypeName[abi:cxx11](std::type_info const&) () from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02883/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_15_1_RNTUPLE_X_2025-03-31-2300/external/el8_amd64_gcc12/lib/libCore.so ``` [ntuple] Add tests and a warning for projected Real32(Quant|Trunc) Setting a projected field to quantized or truncated works and read proper data but it doesn't do what one would probably expect. The projected field can correctly read values from any fields that can be read as float, but the value range and bits of precision set on the projected field are silently ignored (since they only make sense for physical columns that are actually stored on disk). To reduce confusion, we now emit a warning if a user tries to call AddProjectedField with a quantized or truncated field. Remove current RHist prototype For a number of reasons, it is not what we want for the future generation of histogram classes in ROOT: * It is templated on the DIMENSIONS, the PRECISION, and optional bin statistics. This makes it hard(er) to use for IO. * The RHist interface has a pointer to an abstract, polymorphic RHistImplBase. * The concrete RHistImpl is templated on the processed axis types. * The polymorphic pointer makes the current prototype incompatible with RNTuple (unless using streamer fields). * It also takes minutes to compile for higher dimensions because concrete RHistImpl have to be generated for all combinations of axis types, which grows exponentially. The plan is to remove the current prototype now, in time for the next ROOT release v6.36, and then add a new implementation after. [hist] reset kAxisRange bit when fully unzooming (#18226) When unzoom with mouse wheel, properly reset kAxisRange bit. Adjust documentation [graf] Patch libAsimage: fp.h is now part of math.h Thanks to @ktf (ALICE) for this fix. [runtime-cxxmodules] Adapt the darwin modulemaps to sdk 15.4. (#18231) * [runtime-cxxmodules] Adapt the darwin modulemaps to sdk 15.4. * [runtime-cxmodules] Use separate modulemap for macOS15.2 * [runtime-cxxmodules] Add overlay entry for MacOSX15.2 --------- Co-authored-by: Devajith Valaparambil Sreeramaswamy <[email protected]> [skip-CI][cling] Refine build and usage guide (#18161) * [cling] Refine build and usage guide Clarified standalone and LLVM-integrated build methods, along with usage instructions. Improved installation steps to ensure successful execution. * [cling] Fix broken link to web page in README Updated the "See also" link in the README to point to the latest version of Cling's web page on GitHack. The previous link referenced a specific commit, which could become outdated. Now, it directly points to the master branch for a more up-to-date reference. * [cling] Improve Cling standalone build instruction Refined the README to provide clearer instructions for building Cling as a standalone project. Updated CMake configuration details, clarified dependency setup, and provided an example command to help users correctly specify LLVM build paths. These improvements aim to make the build process more comprehensible and reduce potential confusion. * [skip-ci] update link to binaries * [skip-ci] fix jupyter link Fixes root-project/cling#527 * [skip-ci] also mention jupyter notebook option see root-project/cling#537 --------- Co-authored-by: ferdymercury <[email protected]> [ntuple] Move RNTupleReader out of Experimental [rfile] Remove current RFile prototype It will replaced by a new prototype after 6.36. The new prototype will go in a different direction by removing the shared ownership between RFile and the application and it won't have RFile inherit from RDirectory. [hist] Add function to get sum of weights including under/overflows Fix #8951 Co-authored-by: Stephan Hageboeck <[email protected]> [cling][JIT] Inject compiler-rt complex division symbols on macOS Clang may emit calls to compiler-rt symbols such as __divdc3 for std::complex<T> division. These may not be resolved during JIT'ing on macOS when using Cling. This patch forward-declares the relevant symbols and explicitly injects them into the JIT symbol table. Similar to: 4b6075b [rbrowser] do not allow to select text in items list [rbrowser] implement items drag and drop Drop handler behaves very similar to drawing with append flag, but does not try to create new widget [rbrowser] let switch between double-click and plain click handler Double-click is ROOT-like style of drawing while single-click is openui5. In last case one also can use keyboard navigation for drawing [rbrowser] Change columns context menu Old functionality deprecated, one need to have something else. Assign to each column headmenu instead [rbrowser] let resize columns via context menu Add 'Resize colums' to context menu [jsroot] dev 4/04/2025 1. Set 'user-select: none' style in drawings to exclude text selection, using `settings.UserSelect` value 2. Better handling of remap of file URL [cmake] Update the version of VDT to 0.4.6 to address the new behaviour of the compiler shipped with XCode 16.3 Properly format the preprocessor if clause following pnggroup/libpng@893b811 [interop] Upgrade to latest, add tag file for diff workflow [ntuple] Mark some CreateEntry const RNTupleReader::CreateEntry() needs to call GetModel(), which is not const. [ntuple] Move RFieldToken out of REntry It will also be used by RRawPtrWriteEntry. [ntuple] Refactor RNTupleFillContext::Fill* ... to avoid code duplication when adding RRawPtrWriteEntry. [ntuple] Implement Detail::RRawPtrWriteEntry It is a container of const raw pointers that can be used to write constant data products in frameworks. Closes #17900 [ntuple] Demonstrate RRawPtrWriteEntry in ntpl014_framework.C [ntuple] Amend documentation on model ID check [tmva][sofie] memory optimization in convK and imcol for ConvTranspose (#18168) * feat: add convK and imcol to memory optimization for ConvTranspose * fix: follow root naming convention for convK and imcol [tmva][sofie] Optimize LayerNormalization operator Do square operation do not use std::pow with base 2 since it is slower than simple multiplication This speeds up evaluation on ATLAS GNN tracking model by 40% Also avoids allocating a small shape vector in LayerNorm and improve indentation of sigmoid operator [TMVA] Disable relevant PyMVA tests if BLAS is not found This commit makes sure that the tests of PyMVA that require BLAS (indirectly via SOFIE) are not run when BLAS is not available. Following up on this PR, which did the same change already for the SOFIE tests: #18065 [CMake] Veto tutorials depending on BLAS if it was not found Closes #16720. Fix a warning when compiling quartz on macos 15.4 with clt 16.3 [tree] Avoid reading from nullptr in TTreeReader. When a TTreeReaderValue is not initialised correctly, it generates an error message. It could, however, inadvertently read a nullptr in doing that. Fix memory leak identified with valgrind in HistFactory histogram reading Apply clang-format [core] improve TDirectory::DecodeNameCycle - avoid scanning the string twice - allow `name` to be null if one only wants the cycle - return the actual name length so the caller can know whether the name was truncated or not - improve function documentation [cppyy] Disable warnings for invalid function casts Some C++ functions defined in CPyCppyy are passed to CPython API, e.g. to build Python methods that use some C++ functionality. This is done by creating a instance of a PyMethodDef struct (https://docs.python.org/3/c-api/structures.html#c.PyMethodDef). One data member of this struct is of type PyCFunction (https://docs.python.org/3/c-api/structures.html#c.PyCFunction), a typedef of a function with signature ``` PyObject *PyCFunction(PyObject *self, PyObject *args); ``` In many cases, the C++ functions that are used as the data member of the PyMethodDef are not directly implemented as PyCFunction, thus need to be cast. This cast is often invalid, since many of such functions do not really respect the function signature prescribed by the API. This pattern is actually encouraged for CPython extension implementations by the official CPython docs (https://docs.python.org/3/extending/extending.html#keyword-parameters-for-extension-functions). As such, the compiler warnings that are generated becausee of the invalid function casts, for example ``` root/bindings/pyroot/cppyy/CPyCppyy/src/Pythonize.cxx:1949:50: warning: cast from 'PyObject *(*)(PyObject *)' (aka '_object *(*)(_object *)') to 'PyCFunction' (aka '_object *(*)(_object *, _object *)') converts to incompatible function type [-Wcast-function-type-mismatch] 1949 | Utility::AddToClass(pyclass, "__repr__", (PyCFunction)ComplexRepr, METH_NOARGS); ``` cannot be avoided and have to be suppressed. This is also done upstream, see wlav/CPyCppyy@33d4a6e Implementing requested changes by @vepadulano [tree] Reset missing proxies list when changing trees. When changing trees while the missing value feature of RDF was in use, the proxies for branches could not get recreated, since TTreeReader refuses the registration when fProxiesSet == true. This lead to the TTreeReaderValue being in a broken state. [tree] Refactor vector of missing proxies to a set. When running over multiple trees, the list of missing proxies in TTreeReader will grow indefinitely. Here, it is refactored to a set, which also shortens the code that looks up the missing proxies. [tree] Include branch name in an error message. Pointed out by Philippe in #18259. [tree] Make test of error messages a bit more rigid. In debugging a UB in TTreeReaderValueBase, it would have been easier to have an explicit note of the expected error messages of that test. Instead of globally suppressing all errors, the three expected message were added here. [tree] Don't dereference a nullptr in TTreeReaderValue test. On mac15 beta, this generated a SIGTRAP, while it was OK on all other platforms, because the reference was never used. But retrieving the pointer instead of dereferencing, the problem seems to go away. [CMake] Restore Python tutorial dependencies. Due to a missing quote, dependencies on Mac15 beta seemed to have gotten deleted. [ntuple] apply I/O rules also to persistent members [ntuple] test I/O rule of persistent member [json] check if map class has dictionary When stream directly std::map object in macro like: ``` std::map<int,string> m; m[1] = "number 1"; m[2] = "number 2"; auto json = TBufferJSON::ToJSON(&m); ``` Real dictionary class for std::map is required. It checked automatically when map is member of user class, but was not checked when map object intself streamed [json] check map dictionary also when read object Same when write object, reading is not possible for std::map<> object without dictionary [json] mention GenerateDictionary for map classes in documentation While std::map uses in TBufferJSON in documentaiton, mention gInterpreter->GenerateDictionary [CMake] Improve handling of RPATH options Some improvements to the handling of RPATH options, which are necessary on my system because I need to add a custom RPATH to make my CUDA package from nix packages findable. 1. Don't set CMake variables to `FALSE` if the default is `FALSE` already. This makes it impossible to change these variables from the CMake user configuration, unnecessarily taking flexibility out of the build system. 2. If `rpath=ON`, ROOT adds the relative path from the binary directory to the lib directory to the RPATH. But it doesn't append it, overriding any `CMAKE_INSTALL_RPATH` that the user might set in the CMake configuration. This commit suggests to append instead. 3. If `rpath=OFF`, ROOT sets `CMAKE_SKIP_INSTALL_RPATH` to `TRUE` without any apparent reason, again, preventing the user from defining the RPATH via `CMAKE_INSTALL_RPATH`. This commit suggests to remove that line. [cppyy] Do not use non-C++ GCC warning Although `bad-function-cast` is present for both Clang and GCC, on the latter it is only used for C and Objective-C code. Using `no-cast-function-type` seems to already disable the PyCFunction-cast-related warnings seen with AppleClang. [ntuple] update RNTupleModel's documentation [math] Ignore vla-cxx-extension in case veccore is active Reintroduce rcanvas_mt.cxx demo with TH1 classes Old macro was used RH1D classes But RCanvas multithreading can be tested without it [rbrowser] reintroduce provider for RCanvas class RBrowser has to know about RCanvas class and which library to load to get access to that class [jsroot] dev 4/04/2025 with RPad fix Fix redraw of RPad primitives Adjust RAxis drawing Adding suggestions from @ferdymercury
1 parent 7f0ac28 commit deed8c2

File tree

360 files changed

+6265
-12936
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

360 files changed

+6265
-12936
lines changed

.github/CODEOWNERS

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ interpreter/cling/tools/packaging @vgvassilev
6161
/js/ @linev
6262
/gui/webdisplay/ @linev
6363
/gui/cefdisplay/ @linev
64-
/gui/qt5webdisplay/ @linev
6564
/gui/qt6webdisplay/ @linev
6665
/gui/webgui6/ @linev
6766
/gui/fitpanelv7/ @linev

.github/workflows/cppinterop-diff.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ jobs:
1212
uses: actions/checkout@v4
1313
with:
1414
path: root
15+
- name: Determine tag that CppInterOp in ROOT is based
16+
id: determine-tag
17+
run: |
18+
tag_file=root/interpreter/CppInterOp/cppinterop-version.tag
19+
echo "tag=$(cat $tag_file)" >> $GITHUB_OUTPUT
20+
rm $tag_file
1521
- name: Check out CppInterOp
1622
uses: actions/checkout@v4
1723
with:
1824
repository: compiler-research/CppInterOp
19-
ref: 33bfa391c9322bd7cb79f954e54eedef486c999a
25+
ref: ${{ steps.determine-tag.outputs.tag }}
2026
path: CppInterOp
2127
- name: Drop directories that are not added to ROOT
2228
working-directory: CppInterOp

.github/workflows/root-ci-config/buildconfig/global.txt

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ mpi=OFF
6767
opengl=ON
6868
pyroot=ON
6969
pythia8=ON
70-
qt5web=OFF
7170
qt6web=OFF
7271
r=OFF
7372
roofit=ON

README/ReleaseNotes/v636/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ The following people have contributed to this new version:
3838
* The `RooDataSet` constructors to construct a dataset from a part of an existing dataset are deprecated and will be removed in ROOT 6.38. This is to avoid interface duplication. Please use `RooAbsData::reduce()` instead, or if you need to change the weight column, use the universal constructor with the `Import()`, `Cut()`, and `WeightVar()` arguments.
3939
* The ROOT splash screen was removed for Linux and macOS
4040
* Proof support has been completely removed form RooFit and RooStats, after it was already not working anymore for several releases
41-
* The build options `mysql`, `odbc`, `pgsql` and `qt5web` have been deprecated. Please complain with [email protected] should you still need one!
42-
* The build option `html` has been removed.
41+
* The build options `mysql`, `odbc`, `pgsql` have been deprecated. Please complain with [email protected] should you still need one!
42+
* The build options `html` and `qt5web` have been removed.
4343
* The ClassImp macro and derived macros have no effect now and will be deprecated in ROOT 6.38.
4444
* The default TTreeFormula constructor (without arguments) is now deleted, since it lead to an unusable and unsafe object. Instead, this implementation has been reserved now for ROOT I/O exclusively via the TRootIOCtor argument tag.
4545
* The `RooStats::HLFactory` class was deprecated will be removed in ROOT 6.38. It provided little advantage over using the RooWorkspace directly or any of the other higher-level frameworks that exist in the RooFit ecosystem.

bindings/pyroot/cppyy/CPyCppyy/CMakeLists.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ if(NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND NOT MSVC)
7373
-Wno-unused-but-set-parameter)
7474
endif()
7575

76-
# Disables warnings coming from PyCFunction casts
77-
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL 8)
76+
# Avoid warnings due to invalid function casts from C++ functions in CPyCppyy
77+
# to CPython API function typedefs (e.g. PyCFunction). This is a common pattern
78+
# in CPython extension implementations, explicitly encouraged by the official
79+
# CPython docs for C/C++ extensions. see
80+
# https://docs.python.org/3/extending/extending.html#keyword-parameters-for-extension-functions
81+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
7882
target_compile_options(${libname} PRIVATE -Wno-cast-function-type)
7983
endif()
8084

bindings/pyroot/cppyy/CPyCppyy/src/CPPOperator.cxx

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "CPyCppyy.h"
33
#include "CPPOperator.h"
44
#include "CPPInstance.h"
5+
#include "Utility.h"
56

67

78
//- constructor --------------------------------------------------------------
@@ -49,17 +50,14 @@ PyObject* CPyCppyy::CPPOperator::Call(CPPInstance*& self,
4950
return result;
5051
}
5152

52-
PyObject* pytype = 0, *pyvalue = 0, *pytrace = 0;
53-
PyErr_Fetch(&pytype, &pyvalue, &pytrace);
53+
// fetch the current error, resetting the error buffer
54+
auto error = CPyCppyy::Utility::FetchPyError();
5455

5556
result = fStub((PyObject*)self, CPyCppyy_PyArgs_GET_ITEM(args, idx_other));
5657

57-
if (!result)
58-
PyErr_Restore(pytype, pyvalue, pytrace);
59-
else {
60-
Py_XDECREF(pytype);
61-
Py_XDECREF(pyvalue);
62-
Py_XDECREF(pytrace);
58+
// if there was still a problem, restore the Python error buffer
59+
if (!result) {
60+
CPyCppyy::Utility::RestorePyError(error);
6361
}
6462

6563
return result;

bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx

+1-4
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,6 @@ static PyObject* mp_call(CPPOverload* pymeth, PyObject* args, PyObject* kwds)
712712
}
713713
}
714714

715-
// clear collected errors
716-
if (!errors.empty())
717-
std::for_each(errors.begin(), errors.end(), Utility::PyError_t::Clear);
718715
return HandleReturn(pymeth, im_self, result);
719716
}
720717

@@ -758,7 +755,7 @@ static PyObject* mp_call(CPPOverload* pymeth, PyObject* args, PyObject* kwds)
758755
// first summarize, then add details
759756
PyObject* topmsg = CPyCppyy_PyText_FromFormat(
760757
"none of the %d overloaded methods succeeded. Full details:", (int)nMethods);
761-
SetDetailedException(errors, topmsg /* steals */, PyExc_TypeError /* default error */);
758+
SetDetailedException(std::move(errors), topmsg /* steals */, PyExc_TypeError /* default error */);
762759

763760
// report failure
764761
return nullptr;

bindings/pyroot/cppyy/CPyCppyy/src/CPPScope.cxx

+1-2
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,6 @@ static PyObject* meta_getattro(PyObject* pyclass, PyObject* pyname)
504504
}
505505

506506
if (attr) {
507-
std::for_each(errors.begin(), errors.end(), Utility::PyError_t::Clear);
508507
PyErr_Clear();
509508
} else {
510509
// not found: prepare a full error report
@@ -518,7 +517,7 @@ static PyObject* meta_getattro(PyObject* pyclass, PyObject* pyname)
518517
topmsg = CPyCppyy_PyText_FromFormat("no such attribute \'%s\'. Full details:",
519518
CPyCppyy_PyText_AsString(pyname));
520519
}
521-
SetDetailedException(errors, topmsg /* steals */, PyExc_AttributeError /* default error */);
520+
SetDetailedException(std::move(errors), topmsg /* steals */, PyExc_AttributeError /* default error */);
522521
}
523522

524523
return attr;

bindings/pyroot/cppyy/CPyCppyy/src/Converters.cxx

+4-7
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,9 @@ bool CPyCppyy::Converter::ToMemory(PyObject*, void*, PyObject* /* ctxt */)
535535
if (val == (type)-1 && PyErr_Occurred()) { \
536536
static PyTypeObject* ctypes_type = nullptr; \
537537
if (!ctypes_type) { \
538-
PyObject* pytype = 0, *pyvalue = 0, *pytrace = 0; \
539-
PyErr_Fetch(&pytype, &pyvalue, &pytrace); \
538+
auto error = CPyCppyy::Utility::FetchPyError(); \
540539
ctypes_type = GetCTypesType(ct_##ctype); \
541-
PyErr_Restore(pytype, pyvalue, pytrace); \
540+
CPyCppyy::Utility::RestorePyError(error); \
542541
} \
543542
if (Py_TYPE(pyobject) == ctypes_type) { \
544543
PyErr_Clear(); \
@@ -1258,16 +1257,14 @@ bool CPyCppyy::CStringConverter::SetArg(
12581257
const char* cstr = CPyCppyy_PyText_AsStringAndSize(pyobject, &len);
12591258
if (!cstr) {
12601259
// special case: allow ctypes c_char_p
1261-
PyObject* pytype = 0, *pyvalue = 0, *pytrace = 0;
1262-
PyErr_Fetch(&pytype, &pyvalue, &pytrace);
1260+
auto error = CPyCppyy::Utility::FetchPyError();
12631261
if (Py_TYPE(pyobject) == GetCTypesType(ct_c_char_p)) {
12641262
SetLifeLine(ctxt->fPyContext, pyobject, (intptr_t)this);
12651263
para.fValue.fVoidp = (void*)((CPyCppyy_tagCDataObject*)pyobject)->b_ptr;
12661264
para.fTypeCode = 'V';
1267-
Py_XDECREF(pytype); Py_XDECREF(pyvalue); Py_XDECREF(pytrace);
12681265
return true;
12691266
}
1270-
PyErr_Restore(pytype, pyvalue, pytrace);
1267+
CPyCppyy::Utility::RestorePyError(error);
12711268
return false;
12721269
}
12731270

bindings/pyroot/cppyy/CPyCppyy/src/PyException.cxx

+13-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,17 @@ CPyCppyy::PyException::PyException()
2828
PyGILState_STATE state = PyGILState_Ensure();
2929
#endif
3030

31+
#if PY_VERSION_HEX >= 0x030c0000
32+
PyObject *pyvalue = PyErr_GetRaisedException();
33+
PyObject *pytype = pyvalue ? (PyObject *)Py_TYPE(pyvalue) : nullptr;
34+
PyObject* traceback = pyvalue ? PyException_GetTraceback(pyvalue) : nullptr;
35+
#else
3136
PyObject* pytype = nullptr, *pyvalue = nullptr, *pytrace = nullptr;
3237
PyErr_Fetch(&pytype, &pyvalue, &pytrace);
38+
PyObject* traceback = pytrace; // to keep the original unchanged
39+
Py_XINCREF(traceback);
40+
#endif
41+
3342
if (pytype && pyvalue) {
3443
const char* tname = PyExceptionClass_Name(pytype);
3544
if (tname) {
@@ -46,9 +55,6 @@ CPyCppyy::PyException::PyException()
4655
}
4756
}
4857

49-
PyObject* traceback = pytrace; // to keep the original unchanged
50-
Py_XINCREF(traceback);
51-
5258
std::string locName;
5359
std::string locFile;
5460
int locLine = 0;
@@ -88,7 +94,11 @@ CPyCppyy::PyException::PyException()
8894

8995
Py_XDECREF(traceback);
9096

97+
#if PY_VERSION_HEX >= 0x030c0000
98+
PyErr_SetRaisedException(pyvalue);
99+
#else
91100
PyErr_Restore(pytype, pyvalue, pytrace);
101+
#endif
92102

93103
if (fMsg.empty())
94104
fMsg = "python exception";

bindings/pyroot/cppyy/CPyCppyy/src/Pythonize.cxx

+15-1
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,13 @@ PyObject* VectorData(PyObject* self, PyObject*)
527527
}
528528

529529

530+
// This function implements __array__, added to std::vector python proxies and causes
531+
// a bug (see explanation at Utility::AddToClass(pyclass, "__array__"...) in CPyCppyy::Pythonize)
532+
// The recursive nature of this function, passes each subarray (pydata) to the next call and only
533+
// the final buffer is cast to a lowlevel view and resized (in VectorData), resulting in only the
534+
// first 1D array to be returned. See https://github.com/root-project/root/issues/17729
535+
// It is temporarily removed to prevent errors due to -Wunused-function, since it is no longer added.
536+
#if 0
530537
//---------------------------------------------------------------------------
531538
PyObject* VectorArray(PyObject* self, PyObject* args, PyObject* kwargs)
532539
{
@@ -537,7 +544,7 @@ PyObject* VectorArray(PyObject* self, PyObject* args, PyObject* kwargs)
537544
Py_DECREF(pydata);
538545
return newarr;
539546
}
540-
547+
#endif
541548

542549
//-----------------------------------------------------------------------------
543550
static PyObject* vector_iter(PyObject* v) {
@@ -1810,8 +1817,15 @@ bool CPyCppyy::Pythonize(PyObject* pyclass, const std::string& name)
18101817
Utility::AddToClass(pyclass, "__real_data", "data");
18111818
Utility::AddToClass(pyclass, "data", (PyCFunction)VectorData);
18121819

1820+
// The addition of the __array__ utility to std::vector Python proxies causes a
1821+
// bug where the resulting array is a single dimension, causing loss of data when
1822+
// converting to numpy arrays, for >1dim vectors. Since this C++ pythonization
1823+
// was added with the upgrade in 6.32, and is only defined and used recursively,
1824+
// the safe option is to disable this function and no longer add it.
1825+
#if 0
18131826
// numpy array conversion
18141827
Utility::AddToClass(pyclass, "__array__", (PyCFunction)VectorArray, METH_VARARGS | METH_KEYWORDS /* unused */);
1828+
#endif
18151829

18161830
// checked getitem
18171831
if (HasAttrDirect(pyclass, PyStrings::gLen)) {

bindings/pyroot/cppyy/CPyCppyy/src/TemplateProxy.cxx

+4-11
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,7 @@ static int tpp_doc_set(TemplateProxy* pytmpl, PyObject *val, void *)
437437
//= CPyCppyy template proxy callable behavior ================================
438438

439439
#define TPPCALL_RETURN \
440-
{ if (!errors.empty()) \
441-
std::for_each(errors.begin(), errors.end(), Utility::PyError_t::Clear);\
440+
{ errors.clear(); \
442441
return result; }
443442

444443
static inline std::string targs2str(TemplateProxy* pytmpl)
@@ -645,7 +644,7 @@ static PyObject* tpp_call(TemplateProxy* pytmpl, PyObject* args, PyObject* kwds)
645644
PyObject* topmsg = CPyCppyy_PyText_FromFormat(
646645
"Could not find \"%s\" (set cppyy.set_debug() for C++ errors):", CPyCppyy_PyText_AsString(pyfullname));
647646
Py_DECREF(pyfullname);
648-
Utility::SetDetailedException(errors, topmsg /* steals */, PyExc_TypeError /* default error */);
647+
Utility::SetDetailedException(std::move(errors), topmsg /* steals */, PyExc_TypeError /* default error */);
649648

650649
return nullptr;
651650
}
@@ -686,7 +685,7 @@ static PyObject* tpp_call(TemplateProxy* pytmpl, PyObject* args, PyObject* kwds)
686685
// error reporting is fraud, given the numerous steps taken, but more details seems better
687686
if (!errors.empty()) {
688687
PyObject* topmsg = CPyCppyy_PyText_FromString("Template method resolution failed:");
689-
Utility::SetDetailedException(errors, topmsg /* steals */, PyExc_TypeError /* default error */);
688+
Utility::SetDetailedException(std::move(errors), topmsg /* steals */, PyExc_TypeError /* default error */);
690689
} else {
691690
PyErr_Format(PyExc_TypeError, "cannot resolve method template call for \'%s\'",
692691
pytmpl->fTI->fCppName.c_str());
@@ -853,17 +852,11 @@ static PyObject* tpp_overload(TemplateProxy* pytmpl, PyObject* args)
853852
}
854853

855854
// else attempt instantiation
856-
PyObject* pytype = 0, *pyvalue = 0, *pytrace = 0;
857-
PyErr_Fetch(&pytype, &pyvalue, &pytrace);
858-
859855
if (!cppmeth) {
860-
PyErr_Restore(pytype, pyvalue, pytrace);
861856
return nullptr;
862857
}
863858

864-
Py_XDECREF(pytype);
865-
Py_XDECREF(pyvalue);
866-
Py_XDECREF(pytrace);
859+
PyErr_Clear();
867860

868861
// TODO: the next step should be consolidated with Instantiate()
869862
PyCallable* meth = nullptr;

0 commit comments

Comments
 (0)