Skip to content

Conversation

@mloubout
Copy link
Contributor

API up to debate, but need something within these line to allow for the MFE (see test)

@mloubout mloubout added compiler API api (symbolics, types, ...) labels Jan 28, 2026
@mloubout mloubout force-pushed the multi-cond-buffering branch from c4cd3ac to cb9731e Compare January 28, 2026 18:20
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.97%. Comparing base (e40fe22) to head (1c123cf).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2838      +/-   ##
==========================================
+ Coverage   78.94%   78.97%   +0.02%     
==========================================
  Files         248      248              
  Lines       50877    50901      +24     
  Branches     4394     4395       +1     
==========================================
+ Hits        40167    40197      +30     
+ Misses       9912     9905       -7     
- Partials      798      799       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mloubout mloubout force-pushed the multi-cond-buffering branch from cb9731e to e1a2dfb Compare January 29, 2026 00:15
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@mloubout mloubout force-pushed the multi-cond-buffering branch from e1a2dfb to 51a7df1 Compare January 29, 2026 02:05
"metadata": {},
"outputs": [
{
"name": "stderr",
Copy link
Contributor

@EdCaunt EdCaunt Jan 29, 2026

Choose a reason for hiding this comment

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

Leftover NUMA domain count autodetection failed, assuming 1 from running notebook on Mac


Reply via ReviewNB

Copy link
Contributor

@EdCaunt EdCaunt left a comment

Choose a reason for hiding this comment

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

What's the reasoning behind this change?

factor = 2
ntmod = (nt - 1) * factor + 1

ct1 = ConditionalDimension(name="ct1", parent=grid.time_dim,
Copy link
Contributor

Choose a reason for hiding this comment

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

This API is pretty unintuitive imo - it isn't really clear to me what the relation keyword does to the condition/factor without digging into documentation

exprs[i] = e.func(*e.args, conditionals=conditionals)

guards = {d: sympy.And(*v, evaluate=False) for d, v in guards.items()}
# Combination mode is And by default and Or if all conditions are
Copy link
Contributor

Choose a reason for hiding this comment

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

"Combination mode is And by default. If all conditions are Or then Or combination mode is used." may be less ambiguous

Copy link
Contributor

Choose a reason for hiding this comment

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

(nitpicking, with backtips ` around mode)

index into arrays. A typical use case is when arrays are accessed
indirectly via the ``condition`` expression.
relation: Or/And, default=And
How this ConditionalDimension will be combined with other ones.
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems slightly unintuitive to specify this here? Surely it would make more sense to specify how ConditionalDimensions are combined at the point of combination?

Perhaps with an API like cdim.and(other) and cdim.or(other) which returns a new ConditionalDimension which combines the conditions of its constituent ConditionalDimensions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Surely it would make more sense to specify how ConditionalDimensions are combined at the point of combination?

You cannot so that's not relvant. A Function a defined dimension. It will be combined with any indices and implicit_dims at lowering. Combinining it by hand won't do anything as it will be combined yet again at lowering with And making it useless

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok, so this is to do with how it's handled during lowering and the combination is not exposed at the API level? It might be worth adding a note to the notebook explaining when you would want to change relation?

@mloubout
Copy link
Contributor Author

What's the reasoning behind this change?

The test/MFE

eqs.append(Eq(f.forward, T+1, implicit_dims=ctend))

# run operator with buffering
op = Operator(eqs, opt=('streaming', 'buffering'))
Copy link
Contributor

Choose a reason for hiding this comment

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

you don't need or want "streaming" here

@mloubout mloubout force-pushed the multi-cond-buffering branch from 87a50a3 to 1c123cf Compare January 29, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API api (symbolics, types, ...) compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants