Skip to content

Lower spatial constants for Loopy - #312

Closed
ShawnL00 wants to merge 2 commits into
inducer:mainfrom
ShawnL00:spatialconstant
Closed

ShawnL00 wants to merge 2 commits into
inducer:mainfrom
ShawnL00:spatialconstant

Conversation

@ShawnL00

@ShawnL00 ShawnL00 commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Sumpy can pass SpatialConstant nodes to Loopy. Loopy’s domain-aware simplifier first handles them through map_variable. It then looks for map_spatial_constant on the parent mapper. That method is missing, causing an AttributeError.

As @inducer recommended, this converts spatial constants to ordinary variables after Sumpy’s symbolic transformations.

ChatGPT 6.1 Sol generated the implementation.

@alexfikl

Copy link
Copy Markdown
Collaborator

I thought mappers look through the MRO specifically for this? From inducer/pymbolic#64

Which mapper in loopy is upset about it?

@ShawnL00

ShawnL00 commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator Author

I thought mappers look through the MRO specifically for this? From inducer/pymbolic#64

Which mapper in loopy is upset about it?

@alexfikl You’re right about the MRO fallback. We hit this on a private Loopy development branch (cc @a-alveyblanc). Its helper bypasses the fallback. Sorry, I should have clarified the branch context!

@inducer, would you prefer I submit the Loopy fixes to the development repository first?

@ShawnL00
ShawnL00 marked this pull request as draft October 12, 2026 20:16
@ShawnL00 ShawnL00 closed this Oct 12, 2026
@inducer

inducer commented Oct 12, 2026

Copy link
Copy Markdown
Owner

I'd forgotten about the MRO fallback; thanks @alexfikl. 😁

I'm not yet super familiar with @a-alveyblanc's ongoing development. Which code path hits this? Within compute or outside of it? If outside, would it be productive to add a test to upstream Loopy verifying that SpatialConstants are usable?

@ShawnL00

Copy link
Copy Markdown
Collaborator Author

@inducer This happens within compute. I talked to @a-alveyblanc, and he will help me get this fixed in the private branch.

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