Skip to content

Don't wrap lambdas pointlessly#9138

Open
abadams wants to merge 2 commits into
mainfrom
abadams/mystery_lambda_in_local_laplacian
Open

Don't wrap lambdas pointlessly#9138
abadams wants to merge 2 commits into
mainfrom
abadams/mystery_lambda_in_local_laplacian

Conversation

@abadams
Copy link
Copy Markdown
Member

@abadams abadams commented May 14, 2026

repeat_edge(imageparam) has two wrapper Funcs around it, not even counting the repeat_edge Func. The imageparam comes with one (accessible via its implicit cast to Func operator), and then because it's not exactly a Func, the boundary condition helper func_like_to_func adds another one. This commit changes the boundary condition helper to use a class's existing implicit conversion to a Func if there is one, avoiding the pointless extra Func.

The else case is still necessary because a Halide::Buffer can be accessed like a Func, but not implicitly cast to a Func.

repeat_edge(imageparam) has *two* wrapper Funcs around it. The
imageparam comes with one (accessible via its implicit cast to Func
operator), and then because it's not exactly a Func, the boundary
condition helper adds another one. This commit changes the boundary
condition helper to use a class's existing implicit conversion to a Func
if there is one, avoiding the pointless extra Func.

The else case is still necessary because a Halide::Buffer can be
accessed like a Func, but not implicitly cast to a Func.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@d58798a). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9138   +/-   ##
=======================================
  Coverage        ?   69.86%           
=======================================
  Files           ?      254           
  Lines           ?    77525           
  Branches        ?    18534           
=======================================
  Hits            ?    54166           
  Misses          ?    17951           
  Partials        ?     5408           

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