Skip to content

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

Open
vepadulano wants to merge 1 commit intoroot-project:masterfrom
vepadulano:rdf-vary-jit-implicit-rvec
Open

[df] Lift requirement to provide explicit return type in Vary expression#22028
vepadulano wants to merge 1 commit 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 10h 48m 33s ⏱️
 3 850 tests  3 848 ✅  1 💤 1 ❌
76 910 runs  76 891 ✅ 18 💤 1 ❌

For more details on these failures, see this check.

Results for commit 2d2f03a.

♻️ 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
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 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")
*/

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.

3 participants