Skip to content

compiler: Attach staggering metadata to IndexDerivative - #3024

Open
FabioLuporini wants to merge 1 commit into
mainfrom
ideriv-enrichment
Open

compiler: Attach staggering metadata to IndexDerivative#3024
FabioLuporini wants to merge 1 commit into
mainfrom
ideriv-enrichment

Conversation

@FabioLuporini

Copy link
Copy Markdown
Contributor

I need this info for CIRE in PRO (so that we can be more surgical about "what derivatives to catch" during a CIRE round)

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.82%. Comparing base (33c3b12) to head (e93685d).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3024      +/-   ##
==========================================
+ Coverage   83.77%   83.82%   +0.04%     
==========================================
  Files         257      257              
  Lines       55007    55134     +127     
  Branches     4708     4719      +11     
==========================================
+ Hits        46083    46215     +132     
+ Misses       8109     8105       -4     
+ Partials      815      814       -1     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.58% <63.63%> (+<0.01%) ⬆️
pytest-gpu-gcc- 78.46% <100.00%> (+0.05%) ⬆️
pytest-gpu-icx- 78.40% <100.00%> (+0.06%) ⬆️
pytest-gpu-nvc-nvidiaX 69.09% <63.63%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Comment on lines +1125 to +1133
"""
The requested evaluation staggering relative to the input lattice:
`centered` on that lattice, `staggered` halfway between its points,
or None for other or unknown evaluation locations.

This classification is independent of differential order, stencil bias,
and transposition. In particular, `centered` does not imply symmetric
weights, and interpolation is identified separately by `deriv_order == 0`.
"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick: excessively verbose docstring.

Comment on lines +297 to +302
if (mid % 1).is_zero:
staggering = 'centered'
elif ((mid - S.Half) % 1).is_zero:
staggering = 'staggered'
else:
staggering = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems oddly convoluted? Can this really not be simplified at all?

@mloubout mloubout left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't understand the need or utility of this. THe staggering doesn't matter, x0 does and is already attached.

@FabioLuporini

Copy link
Copy Markdown
Contributor Author

I don't understand the need or utility of this. THe staggering doesn't matter, x0 does and is already attached.

@mloubout how do I know if an IndexDerivative represents a staggered derivative, a centered derivative, or, fwiw, an interpolation ?

for the latter I guess I might look at the deriv_order and infer it if it's 0 ? (this is me speculating...)

what about staggered vs centered?

if I'm missing something, happy to close this;
if there's a neater way, happy to do it

I honestly cooked the simplest thing that came to mind

@mloubout

Copy link
Copy Markdown
Contributor

how do I know if an IndexDerivative represents a staggered derivative, a centered derivative

Again, this has nothing to do with the staggering of the equation but with the difference betwenn x0 and expr.indices_ref. The staggering by itself does not matter, or we wouldn't need _eval_at, the only thing staggering does is define which grid an expr is defined. On top of it if the expr is e.g an Add, such as div(v) the staggering will only be the one of highest priority (so v_x) so not only the information isn't useful it wil not be correct since each term will have a different x0 at evaluation.

@FabioLuporini

Copy link
Copy Markdown
Contributor Author

@mloubout I need a way to distinguish centered derivatives from staggered derivatives, because they tend to represent two similarly balanced sets of derivatives , in terms of total number, type and number of underlying objects they're applied to, and so on.

I could use the set of coefficients I guess, but not ideal

other ways?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants