Skip to content

Fix buffer stride runtime mismatch#2950

Open
mloubout wants to merge 2 commits into
mainfrom
fix-buffer-stride-runtime-mismatch
Open

Fix buffer stride runtime mismatch#2950
mloubout wants to merge 2 commits into
mainfrom
fix-buffer-stride-runtime-mismatch

Conversation

@mloubout

Copy link
Copy Markdown
Contributor

Make sure mapped array use symbolic padding so that it always matches the runtime mapped function and can safely reuse the Function's strydes.

@mloubout mloubout added compiler bug-C bug in the generated code labels Jun 17, 2026
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.49%. Comparing base (58df797) to head (4503028).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2950      +/-   ##
==========================================
+ Coverage   83.47%   83.49%   +0.01%     
==========================================
  Files         249      249              
  Lines       52276    52302      +26     
  Branches     4503     4504       +1     
==========================================
+ Hits        43638    43667      +29     
+ Misses       7880     7878       -2     
+ Partials      758      757       -1     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.60% <70.37%> (+<0.01%) ⬆️
pytest-gpu-gcc- 78.23% <100.00%> (+0.01%) ⬆️
pytest-gpu-icx- 78.16% <100.00%> (-0.02%) ⬇️
pytest-gpu-nvc-nvidiaX 69.11% <70.37%> (-0.01%) ⬇️

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.

@mloubout mloubout force-pushed the fix-buffer-stride-runtime-mismatch branch 2 times, most recently from dd74d3c to 87857e3 Compare June 18, 2026 02:50
pad_key = f.__padding_dtype__
else:
pad_key = None
pad_key = f.__padding_dtype__ if d is f.dimensions[-1] else 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.

random thought: do we need a dimensions_padded property rather than just [-1]? thinking about what we recently doing in PRO with all those "special" Arrays.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

At some point yes would be good to have

Comment thread devito/types/array.py Outdated
Comment thread devito/types/array.py
padding = kwargs.get('padding')
if padding is None:
padding = ((0, 0),)*self.ndim
if self.is_autopaddable:

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.

@FabioLuporini FabioLuporini 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.

some questions, but it's a great catch, and a great cleanup too

@EdCaunt EdCaunt 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.

Approved pending Fabio's comments

@mloubout mloubout force-pushed the fix-buffer-stride-runtime-mismatch branch 2 times, most recently from 4503028 to 0520dc7 Compare June 18, 2026 13:11
@mloubout mloubout force-pushed the fix-buffer-stride-runtime-mismatch branch from 0520dc7 to 53763c1 Compare June 18, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-C bug in the generated code compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants