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

❌ Patch coverage is 37.77778% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.16%. Comparing base (58df797) to head (adaaa94).

Files with missing lines Patch % Lines
devito/types/array.py 35.48% 19 Missing and 1 partial ⚠️
devito/types/basic.py 50.00% 3 Missing ⚠️
devito/passes/clusters/buffering.py 0.00% 2 Missing ⚠️
devito/types/dense.py 33.33% 1 Missing and 1 partial ⚠️
devito/passes/iet/linearization.py 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (58df797) and HEAD (adaaa94). Click for more details.

HEAD has 27 uploads less than BASE
Flag BASE (58df797) HEAD (adaaa94)
18 1
pytest-gpu-gcc- 6 1
pytest-gpu-icx- 3 0
pytest-gpu-nvc-nvidiaX 1 0
pytest-gpu-aomp-amdgpuX 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2950       +/-   ##
===========================================
- Coverage   83.47%   59.16%   -24.32%     
===========================================
  Files         249      195       -54     
  Lines       52276    33783    -18493     
  Branches     4503     3945      -558     
===========================================
- Hits        43638    19988    -23650     
- Misses       7880    12842     +4962     
- Partials      758      953      +195     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX ?
pytest-gpu-gcc- 55.39% <37.77%> (-22.83%) ⬇️
pytest-gpu-icx- ?
pytest-gpu-nvc-nvidiaX ?

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 Outdated
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.

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.

I think so yes

@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 4 times, most recently from 53763c1 to adaaa94 Compare June 18, 2026 23:53
@mloubout mloubout force-pushed the fix-buffer-stride-runtime-mismatch branch from adaaa94 to e561c21 Compare June 19, 2026 00:14
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