Skip to content

test_same_argument_types_and_overload: dtype parametrization does not exercise float32 overload #355

Description

@coderabbitai

Summary

The test test_same_argument_types_and_overload in numbast/src/numbast/experimental/mlir/static/tests/test_function_static_bindings.py is parametrized over ["int32", "float32"], but its kernel always calls add(int32(1), int32(2)) regardless of the dtype parameter. As a result, the float32 overload of add is never dispatched or verified.

Location

File: numbast/src/numbast/experimental/mlir/static/tests/test_function_static_bindings.py
Lines: ~112–127

Expected Behavior

Each parametrized case should invoke add with arguments matching the declared dtype, so the float32 run calls add(float32(1.0), float32(2.0)) and exercises the float overload path.

Suggested Fix

Select the argument constructor based on dtype before defining the kernel:

ctor = int32 if dtype == "int32" else float32
@cuda.jit(link=[impl])
def kernel(arr):
    arr[0] = add(ctor(1), ctor(2))

References

/cc @isVoid

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions