Skip to content

CPU device: passing a Python list to a float[N] param segfaults in array-parameter marshalling #1138

Description

@nv-slang-bot

Summary

On DeviceType.cpu, calling a Slang function that takes a fixed-size array parameter (e.g. float x[3]) with a Python list segfaults (SIGSEGV) during array-parameter marshalling. This is a distinct, pre-existing CPU-backend defect that was unmasked by the #1136 dispatch-limits fix: previously the "Device reports zero compute dispatch groups in X" throw (#1136) fired first, so this code path was never reached on CPU. GPU backends (Vulkan / CUDA / D3D12 / Metal) handle the same call correctly.

Repro

Requires a build where the #1136 regression is fixed (PR #1137, or slang-rhi#854 + a submodule bump) — otherwise the #1136 throw fires first and this path is unreachable.

import slangpy as spy

dev = spy.create_device(type=spy.DeviceType.cpu)
mod = spy.Module.load_from_source(dev, "m", "float first(float x[3]) { return x[0]; }")
mod.first([3.0, 4.0, 5.0])   # SIGSEGV during array-parameter marshalling

This is the DeviceType.cpu case of the existing slangpy/tests/slangpy_tests/test_simple_function_call.py::test_pass_float_array (which passes on all GPU backends).

Context / provenance

Environment

Layer (to be pinned by triage)

Candidate layers for the fault: slangpy_ext array-parameter marshalling (src/slangpy_ext/), the slang-rhi CPU backend, or the slang compiler's CPU (host-callable) target. Triage to follow. Suggested priority: P2 (CPU backend was already entirely unusable before the #1136 fix, so this is not a fresh regression).


Related: #1136 (dispatch-limits regression; durable root fix in shader-slang/slang-rhi#854), #1137 (the fix that unmasked this). This issue is intentionally not linked as Fixes #1136.

🤖 Generated by an automated SlangPy coworker — may be inaccurate. A human maintainer should verify.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions