Repository navigation
Conversation
alexfikl
force-pushed
the
kernel-rewrite
branch
2 times, most recently
from
September 4, 2026 08:04
c2abca1 to
a9f5083
Compare
This was referenced Sep 4, 2026
Merged
alexfikl
force-pushed
the
kernel-rewrite
branch
3 times, most recently
from
September 12, 2026 16:31
8e21ddf to
6065fb6
Compare
inducer
reviewed
Sep 18, 2026
alexfikl
force-pushed
the
kernel-rewrite
branch
from
September 18, 2026 14:32
167e884 to
db038c5
Compare
alexfikl
force-pushed
the
kernel-rewrite
branch
from
October 16, 2026 13:10
db038c5 to
8e1e6fe
Compare
alexfikl
marked this pull request as ready for review
October 16, 2026 13:14
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved fallback failures, rejected constant-only rewrites, and parameter-symbol mismatches break supported behavior and existing tests.
5 open findings
What changed in this PR
Adds kernel rewriting to express target kernels as constant-coefficient combinations of base-kernel derivatives.
Changes:
- Implements symbolic Fourier and numerical LU rewriting.
- Standardizes spatial-constant parameters in kernel PDEs.
- Adds rewrite tests and documentation.
| File | Description |
|---|---|
| sumpy/tools.py | Adds multi-index differentiation. |
| sumpy/test/test_misc.py | Updates PDE tests for spatial constants. |
| sumpy/test/test_kernel_rewrite.py | Adds rewriting and conditioning tests. |
| sumpy/kernel.py | Updates PDE parameters and marks unsupported system PDEs. |
| sumpy/kernel_rewrite.py | Implements rewrite representations and algorithms. |
| doc/kernel.rst | Includes kernel rewriting documentation. |
| .basedpyright/baseline.json | Updates type-checking diagnostics. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| target_system_kernel, idx = None, None | ||
|
|
||
| if target_system_kernel is None: | ||
| pde_target = target_kernel.get_pde_as_diff_op() |
Collaborator
Author
There was a problem hiding this comment.
Not sure we want to support that.
alexfikl
force-pushed
the
kernel-rewrite
branch
from
October 16, 2026 13:38
8e1e6fe to
0f32c9c
Compare
alexfikl
commented
Oct 16, 2026
alexfikl
commented
Oct 16, 2026
inducer
reviewed
Oct 16, 2026
|
|
||
|
|
||
| def rewrite_using_base_kernel( | ||
| target_kernel: ScalarKernel, |
inducer
reviewed
Oct 16, 2026
inducer
reviewed
Oct 16, 2026
inducer
approved these changes
Oct 16, 2026
alexfikl
force-pushed
the
kernel-rewrite
branch
4 times, most recently
from
October 17, 2026 12:09
7228321 to
82ef0cd
Compare
alexfikl
force-pushed
the
kernel-rewrite
branch
from
October 18, 2026 18:40
82ef0cd to
d617de5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This implements rewriting a target kernel (e.g. Stokeslet) in terms of a base kernel (e.g. biharmonic) as a linear constant-coefficient combination of derivatives.
Currently, it just hoists
get_deriv_relation_kernelfrom inducer/pytential#162 with some minimal changes:TODO:
pytential).Implement a hopefully better (but likely slower?) purely-symbolic version.Needs
cc @isuruf