inducer / inducer/loopy

None is no longer allowed in argument shape tuples

Open
#1,039 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
636
Forks
81
Avg merge
1d 19h
Merged PRs (30d)
7

Description

The following code passes using release 2025.2 but fails on `main`:
```py
import loopy as lp

knl = lp.make_kernel(
"{ [i]: 0 <= i < 5 }",
"x[i, 0] = 5",
[lp.GlobalArg("x", dtype=float, shape=(None, 2))],
target=lp.CTarget(),
)
print(lp.generate_code_v2(knl).device_code())
```
with the error:
```
File "/home/connor/Code/firedrake-dev/release/venv-firedrake-release-py314/lib/python3.14/site-packages/pymbolic/mapp
er/__init__.py", line 422, in map_foreign
raise ValueError(
"{} encountered invalid foreign object: {}".format(
self.__class__, repr(expr)))
ValueError: encountered invalid foreign object: None
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Run the reproducer using lp.make_kernel, GlobalArg with shape=(None, 2), lp.CTarget(), and generate_code_v2, then trace how the argument shape reaches DependencyMapperWithReductionInames. Compare main with release 2025.2; done means the example accepts None in the shape tuple and device_code() generation succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.