Skip to content

Conversation

@xywei
Copy link
Owner

@xywei xywei commented Sep 19, 2025

parallel to inducer#233

@xywei
Copy link
Owner Author

xywei commented Sep 19, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines 109 to +112
class LineTaylorLocalExpansion(LocalExpansionBase):
def __init__(self, kernel, order, tau=1, use_rscale=None, m2l_translation=None):
super().__init__(kernel, order, use_rscale, m2l_translation)
self.tau = tau

Choose a reason for hiding this comment

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

[P1] Include τ in LineTaylor expansion identity

The constructor now stores a tau parameter, but LineTaylorLocalExpansion still relies on LocalExpansionBase’s default init_arg_names, __eq__, and persistent-hash implementation, which only look at the kernel, order, and use_rscale. As a result, two expansions constructed with different τ values compare equal and generate identical cache keys, so enabling kernel caching (or calling copy()/with_kernel()) will reuse code compiled with the wrong τ and silently produce incorrect matrices. Please add τ to the expansion’s init args and hashing/equality so that different τ values generate distinct kernels and survive copy().

Useful? React with 👍 / 👎.

Comment on lines +192 to +205
def __init__(self,
kernel,
asymptotic,
order,
tau=1,
use_rscale=None,
m2l_translation=None):
super().__init__(kernel, order, use_rscale, m2l_translation)
self.asymptotic = asymptotic
self.tau = tau

Choose a reason for hiding this comment

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

[P1] Distinguish asymptotic line expansions by asymptotic/tau

The new AsymptoticDividingLineTaylorExpansion captures both asymptotic and tau, yet the class inherits __eq__/persistent hashing from LocalExpansionBase, which ignore these attributes. When the kernel cache or copy() is used, two expansions with different asymptotic functions or τ values will be treated as identical and the first compiled kernel will be reused for the second, yielding coefficients for the wrong asymptotic form. Include asymptotic and tau in the expansion’s init arg list and persistent hash/equality so cache keys reflect these parameters.

Useful? React with 👍 / 👎.

Add AsymptoticDividingLineTaylorExpansion class, todo: add test case

documentaions + autoclass + rename
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