Skip to content

Framework: key HIST() names by a fixed-string template argument - #16045

Open
ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16045
Open

ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16045

Conversation

@ktf

@ktf ktf commented Nov 4, 2026

Copy link
Copy Markdown
Member

HIST()/CONST_STR() created, at every call site, a lambda, a local struct, an
index_sequence expansion over the characters and a ConstStr<'a','b',...> type.
They now produce ConstStr<"ab">: one type per distinct name, the hash still a
static member computed once per name, and concatenation still at the type
level, so names passed as function parameters keep working. Hashes are
unchanged.

2,000 distinct names (a quarter concatenated with a directory) in a template
instantiated twice, -O2: clang 21 3.76 s -> 1.90 s and 591 -> 238 MB peak;
GCC 16 6.41 s -> 3.04 s and 602 -> 366 MB. Object size +6%.

Needs AliceO2Group/O2Physics#18584, which updates the helpers that spelled out
ConstStr<chars...>.

HIST()/CONST_STR() created, at every call site, a lambda, a local struct, an
index_sequence expansion over the characters and a ConstStr<'a','b',...> type.
They now produce ConstStr<"ab">: one type per distinct name, the hash still a
static member computed once per name, and concatenation still at the type
level, so names passed as function parameters keep working. Hashes are
unchanged.

2,000 distinct names (a quarter concatenated with a directory) in a template
instantiated twice, -O2: clang 21 3.76 s -> 1.90 s and 591 -> 238 MB peak;
GCC 16 6.41 s -> 3.04 s and 602 -> 366 MB. Object size +6%.

Needs AliceO2Group/O2Physics#18584, which updates the helpers that spelled out
ConstStr<chars...>.
@ktf
ktf requested a review from a team as a code owner November 4, 2026 12:42
@alibuild

alibuild commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Error while checking build/O2/fullCI_slc9 for 6fd6d9d at 2026-11-05 09:30:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowPtEfficiency.cxx:275:87: error: class template argument deduction failed:
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowPtEfficiency.cxx:275:87: error: no matching function for call to 'FixedString(char)'
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowPtEfficiency.cxx:284:22: error: no matching function for call to 'o2::framework::HistogramRegistry::fill(const int&, const double&, double&, double&)'
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowTask.cxx:841:76: error: class template argument deduction failed:
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowTask.cxx:841:76: error: no matching function for call to 'FixedString(char)'
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowTask.cxx:857:127: error: class template argument deduction failed:
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowTask.cxx:857:127: error: no matching function for call to 'FixedString(char)'
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowTask.cxx:857:162: error: class template argument deduction failed:
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowTask.cxx:857:162: error: no matching function for call to 'FixedString(char)'
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowTask.cxx:850:22: error: no matching function for call to 'o2::framework::HistogramRegistry::fill(const int&, const double&, double&, double&)'
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowTask.cxx:867:22: error: no matching function for call to 'o2::framework::HistogramRegistry::fill(const int&, const double&, double&, double)'
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowTask.cxx:868:22: error: no matching function for call to 'o2::framework::HistogramRegistry::fill(const int&, const double&, double, double)'
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGCF/Flow/Tasks/flowTask.cxx:1571:22: error: no matching function for call to 'FlowTask::fillpTvnProfile(__gnu_cxx::__alloc_traits<std::allocator<GFW::CorrConfig>, GFW::CorrConfig>::value_type&, double&, double&, ConstStr<FixedString<15>{"c22_gap08_Weff"}>, ConstStr<FixedString<22>{"c22_gap08_trackMeanPt"}>, float&)'
ninja: build stopped: subcommand failed.


## sw/BUILD/o2checkcode-latest/log
--
========== List of errors found ==========
++ echo 'Found 0 errors and 0 warnings.'
Found 0 errors and 0 warnings.
++ [[ 0 -gt 0 ]]
++ [[ 0 -gt 0 ]]
++ [[ 0 -gt 0 ]]
++ mkdir -p /sw/INSTALLROOT/e7b0ede6135fed7db79186977e6a73d3cba72b56/slc9_x86-64/o2checkcode/1.0-local79/etc/modulefiles
++ alibuild-generate-module
+ HAS_BIN=
+ HAS_LIB=
+ HAS_CMAKE=
+ HAS_ROOT=
+ '[' 0 '!=' 0 ']'
+ cat
+ printf 'if ![ is-loaded '\''BASE/1.0'\'' ] {\n module load BASE/1.0\n}'
+ echo 'BUILD_REQUIRES=CMake alibuild-recipe-tools defaults-release'
BUILD_REQUIRES=CMake alibuild-recipe-tools defaults-release
+ FULL_BUILD_REQUIRES='defaults-release UUID json-c bz2 ninja-fortran FairCMakeModules safe_int googlebenchmark pytorch_cpuinfo Alice-GRID-Utils Python-modules-list MPFR date alibuild-recipe-tools CMake double-conversion ninja O2-customization'
+ echo 'FULL_BUILD_REQUIRES=defaults-release UUID json-c bz2 ninja-fortran FairCMakeModules safe_int googlebenchmark pytorch_cpuinfo Alice-GRID-Utils Python-modules-list MPFR date alibuild-recipe-tools CMake double-conversion ninja O2-customization'
FULL_BUILD_REQUIRES=defaults-release UUID json-c bz2 ninja-fortran FairCMakeModules safe_int googlebenchmark pytorch_cpuinfo Alice-GRID-Utils Python-modules-list MPFR date alibuild-recipe-tools CMake double-conversion ninja O2-customization
++ env
++ cut -f1 -d=
++ grep -v '^DEFAULT_'
++ grep -v PKGREVISION
++ grep -v ALIBUILD_RECIPE_TOOLS
++ grep REVISION
++ sed -e s/_REVISION//
+ for x in $(env | cut -f1 -d= | grep -v "^DEFAULT_" | grep -v PKGREVISION | grep -v ALIBUILD_RECIPE_TOOLS | grep REVISION | sed -e 's/_REVISION//')
++ eval 'echo $LIBFFI_REVISION'
+++ echo 14
[0 more errors; see full log]

Full log here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants