Skip to content

Non-Silent Exit if Wrong Subroutine is Given - #8665

Merged
alexreinking merged 3 commits into
halide:mainfrom
FabianSchuetze:verbose-exit-linear-algebra
Aug 9, 2026
Merged

Non-Silent Exit if Wrong Subroutine is Given#8665
alexreinking merged 3 commits into
halide:mainfrom
FabianSchuetze:verbose-exit-linear-algebra

Conversation

@FabianSchuetze

Copy link
Copy Markdown
Contributor

The change notify users that a wrong subroutine argument is given. Currently class such as halide_benchmarks sgemm 1024 return immediately without a message.

@alexreinking

Copy link
Copy Markdown
Member

Happy to merge this, but I'm curious how you encountered it? Normally, we run these tests via CTest.

@FabianSchuetze

Copy link
Copy Markdown
Contributor Author

Thanks, @alexreinking, for the encouragement.

I think Halide's apps are a gem, and I use them often.

After building the linalg app, I just typed halide_benchmarks sgemm 1024 and forgot to _notrans specifier. The app then outputs nothing, and I would have appreciated short feedback (especially as the main function of the app already provides feedback).

@mcourteaux

Copy link
Copy Markdown
Contributor

Shouldn't we print to cerr to catch this in ctest, or at least exit with status code 1?

@FabianSchuetze

Copy link
Copy Markdown
Contributor Author

Good point about the output stream. My first inclination was to use cerr, but I did otherwise to keep symmetry with the main function.

The return code would also be interesting. I didn't do it to avoid refactoring too many functions in the call stack.

Happy to implement any of your suggestions, Martijn, though.

@alexreinking

alexreinking commented Jul 2, 2025

Copy link
Copy Markdown
Member

Shouldn't we print to cerr to catch this in ctest, or at least exit with status code 1?

Yeah, I think printing to std::cerr and calling abort(); is the right behavior here. While we're looking at this, why don't we also validate the char type value in main? There should be a final else branch down there.

@alexreinking alexreinking self-assigned this Aug 13, 2025

@alexreinking alexreinking left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry this took so long to get in. Our buildbots have been on fire for a while

@alexreinking
alexreinking force-pushed the verbose-exit-linear-algebra branch from b9394e2 to 510a67a Compare August 8, 2026 19:46
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.05%. Comparing base (63fbef0) to head (510a67a).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8665      +/-   ##
==========================================
+ Coverage   69.93%   70.05%   +0.11%     
==========================================
  Files         257      257              
  Lines       77537    77537              
  Branches    18884    18884              
==========================================
+ Hits        54229    54320      +91     
+ Misses      17679    17655      -24     
+ Partials     5629     5562      -67     

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

@alexreinking
alexreinking merged commit 5dacbcd into halide:main Aug 9, 2026
24 checks passed
@alexreinking

Copy link
Copy Markdown
Member

@FabianSchuetze - to my great shame, it took me this long to realize this was approved but never merged. Fixing that now.

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.

3 participants