Skip to content

[df] Lift requirement to provide explicit return type in Vary expression#22028

Merged
vepadulano merged 3 commits intoroot-project:masterfrom
vepadulano:rdf-vary-jit-implicit-rvec
Apr 27, 2026
Merged

[df] Lift requirement to provide explicit return type in Vary expression#22028
vepadulano merged 3 commits intoroot-project:masterfrom
vepadulano:rdf-vary-jit-implicit-rvec

Conversation

@vepadulano
Copy link
Copy Markdown
Member

@vepadulano vepadulano commented Apr 23, 2026

While working on the presentation about systematic variations for the ATLAS columnar hackathon https://indico.cern.ch/event/1661946/, I had an idea on how to simplify the user experience of using Vary with JIT-ted expressions.

The expression gets a trailing return type injected of the equivalent necessary RVec type, only in case the user is not already providing it. As long as the expression returns a sequence of characters that is a valid way to instantiate an RVec constructor, the expression will compile.

The condition that triggers the injection of the trailing return type is if the user expression is of type '{...}', which could be a potential candidate constructor for an RVec.

@vepadulano vepadulano requested a review from hageboeck April 23, 2026 13:01
@vepadulano vepadulano self-assigned this Apr 23, 2026
@vepadulano vepadulano requested a review from martamaja10 as a code owner April 23, 2026 13:01
@vepadulano vepadulano force-pushed the rdf-vary-jit-implicit-rvec branch from 4f9a9f4 to 6034471 Compare April 23, 2026 13:56
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

Test Results

    22 files      22 suites   3d 11h 25m 24s ⏱️
 3 852 tests  3 851 ✅  1 💤 0 ❌
76 949 runs  76 931 ✅ 18 💤 0 ❌

Results for commit 5d046ff.

♻️ This comment has been updated with latest results.

@dpiparo dpiparo self-requested a review April 24, 2026 04:47
@vepadulano vepadulano force-pushed the rdf-vary-jit-implicit-rvec branch from 6034471 to 17eb96f Compare April 24, 2026 07:04
Comment thread tree/dataframe/src/RDFInterfaceUtils.cxx Outdated
@vepadulano vepadulano force-pushed the rdf-vary-jit-implicit-rvec branch from 17eb96f to 2d2f03a Compare April 24, 2026 08:25
Copy link
Copy Markdown
Member

@hageboeck hageboeck left a comment

Choose a reason for hiding this comment

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

This is really great to have!

Let's also add a bit of docs, because otherwise it might go unnoticed. Something to the effect of:

/**
df.Vary(
  std::vector<std::string>{"x", "y", "z"},
  "{
    {-1*entry, 2, 3},              // x variations
    {41, 43*entry, 44},            // y variations
    {500-entry, 600, 700 + entry}  // z variations
  }",
  {"down", "up", "other"},
  "xyz")
*/

The expression gets a trailing return type injected of the equivalent necessary RVec type, only in case the user is not already providing it. As long as the expression returns a sequence of characters that is a valid way to instantiate an RVec constructor, the expression will compile.

The condition that triggers the injection of the trailing return type is if the user expression is of type '{...}', which could be a potential candidate constructor for an RVec.
@vepadulano vepadulano force-pushed the rdf-vary-jit-implicit-rvec branch from 2d2f03a to 0ff0b99 Compare April 24, 2026 15:39
@vepadulano vepadulano force-pushed the rdf-vary-jit-implicit-rvec branch from 0ff0b99 to 5d046ff Compare April 27, 2026 09:29
@vepadulano vepadulano merged commit 1dc6621 into root-project:master Apr 27, 2026
30 checks passed
@vepadulano
Copy link
Copy Markdown
Member Author

/backport to 6.40

@root-project-bot
Copy link
Copy Markdown

Preparing to backport PR #22028 to branch 6.40 requested by vepadulano

@root-project-bot
Copy link
Copy Markdown

This PR has been backported to branch 6.40: #22077

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.

4 participants