Skip to content

Passing None to Python task triggers Future error #1016

@elliottslaughter

Description

@elliottslaughter

I accidentally passed a None through to one of my Python tasks and observed the following error. Presumably this means some error checking is missing at the call site.

To be clear: I don't expect this to work but it could be more ergonomic:

  1. The error message doesn't match what the user is doing
  2. The backtrace is a C++ backtrace, but the error could have been caught in Python (resulting in a Python backtrace) before calling into C++

Reproducer:

import numpy as np
import cupynumeric as cpn

from legate.core import VariantCode, broadcast
from legate.core.task import task, InputArray

@task(variants=(VariantCode.CPU,), constraints=(broadcast("x"),))
def asdf(x: InputArray):
    x = np.asarray(x)

asdf(None)
$ legate --cpus=1 --omps=0 --gpus=0 --sysmem=30000 ../../helios/test_ret_none.py
[0 - 1548100a8740]    0.623558 {5}{runtime}: LEGION ERROR: Future size mismatch! Expected non-empty future for making an accessor but future has a payload of
0 bytes. (UID 0) (from file /tmp/conda-croot/legate/work/arch-conda/skbuild_core/_deps/legion-src/runtime/legion/runtime.cc:1217)
Signal 6 received by node 0, process 1204856 (thread 1548100a8740) - obtaining backtrace
Signal 6 received by process 1204856 (thread 1548100a8740) at:

Version:

$ legate-issue 
System info:
  Python      :  3.13.5 | packaged by conda-forge | (main, Jun 16 2025, 08:27:50) [GCC 13.3.0]
  Platform    :  Linux-4.18.0-553.71.1.el8_10.x86_64-x86_64-with-glibc2.28
  GPU driver  :  (failed to detect)
  GPU devices :  (failed to detect)

Package versions:
  legion      :  25.8.0 (commit: 16441d05a66bdf0f21e271b943a60315f113a55e)
  legate      :  25.09.00.dev0
  cupynumeric :  25.09.00.dev+8.gd1f6b2e4
  numpy       :  2.3.2
  scipy       :  1.16.1
  numba       :  (failed to detect)

Package details:
  cuda-version : (conda missing)
  legate       : (conda missing)
  cupynumeric  : (conda missing)

Legate build configuration:
  build_type        : Release
  use_openmp        : True
  use_cuda          : False
  networks          : ucx
  conduit           : 
  configure_options : --LEGATE_ARCH=arch-conda;--with-python;--with-cc=/tmp/conda-croot/legate/_build_env/bin/x86_64-conda-linux-gnu-cc;--with-cxx=/tmp/conda-croot/legate/_build_env/bin/x86_64-conda-linux-gnu-c++;--build-march=x86-64;--cmake-generator=Ninja;--with-openmp;--with-cuda=0;--build-type=release;--with-ucx

LANL/SLAC low priority.

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