Skip to content

Make Func::in / Func::clone_in transitive#9117

Open
abadams wants to merge 1 commit intomainfrom
abadams/transitive_clone_in
Open

Make Func::in / Func::clone_in transitive#9117
abadams wants to merge 1 commit intomainfrom
abadams/transitive_clone_in

Conversation

@abadams
Copy link
Copy Markdown
Member

@abadams abadams commented May 1, 2026

When the Func passed to in()/clone_in() does not directly call the wrapped Func, walk down the call graph and wrap the first direct caller found along each branch. This makes it possible to schedule wrappers across anonymous intermediates (e.g. helper Funcs returned from free-standing C++ functions like the downsamplers in local_laplacian), without needing a handle on every Func in between.

Funcs that already directly call the target pass through unchanged, and Funcs with no static path to the target are left alone so existing sequences of in()/clone_in() that rely on later substitution still work.

Includes a new correctness test (transitive_in) and uses the new feature in apps/local_laplacian to clone gPyramid[0] into gPyramid[1] (~10% speedup).

This has been a long-standing annoyance that I'm finally fixing. Feature implemented by claude. I just did the change to local_laplacian to use it.

When the Func passed to in()/clone_in() does not directly call the
wrapped Func, walk down the call graph and wrap the first direct caller
found along each branch. This makes it possible to schedule wrappers
across anonymous intermediates (e.g. helper Funcs returned from
free-standing C++ functions like the downsamplers in local_laplacian),
without needing a handle on every Func in between.

Funcs that already directly call the target pass through unchanged, and
Funcs with no static path to the target are left alone so existing
sequences of in()/clone_in() that rely on later substitution still work.

Includes a new correctness test (transitive_in) and uses the new feature
in apps/local_laplacian to clone gPyramid[0] into gPyramid[1] (~10%
speedup).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant