Skip to content

Detect illegal reorderings in Stage::fuse#9186

Open
stevenraphael wants to merge 1 commit into
halide:mainfrom
stevenraphael:fuse_fix
Open

Detect illegal reorderings in Stage::fuse#9186
stevenraphael wants to merge 1 commit into
halide:mainfrom
stevenraphael:fuse_fix

Conversation

@stevenraphael

Copy link
Copy Markdown
Contributor

Stage::fuse erases an outer dimension from the dim list and combines it with an inner dimension. Since the dimension indices are arbitrary, Stage::fuse essentially reorders the dimensions to be next to each other in the list, but prior to this PR it did not verify that the reordering is safe. For example, Halide should throw an error when compiling this program that swaps the inner and outer RVars:

Func f;
RDom r(0, 3, 0, 2);
RVar fused;
f() = 1;
f() = f() * 2 + r.x * 2 + r.y;

f.fuse(r.y, r.x, fused);
  • Tests added or updated (not required for docs, CI config, or typo fixes)
  • Commits include AI attribution where applicable (see Code of Conduct)

…ed by: Claude Sonnet 4.6 <no-reply@anthropic.com>
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.45455% with 13 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@7e2ecf2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/Func.cpp 70.45% 8 Missing and 5 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9186   +/-   ##
=======================================
  Coverage        ?   69.37%           
=======================================
  Files           ?      254           
  Lines           ?    78283           
  Branches        ?    18731           
=======================================
  Hits            ?    54306           
  Misses          ?    18468           
  Partials        ?     5509           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants