Skip to content

List, tuple constants with more than about 350 entries lead to "RuntimeError: pystack exhausted" #4516

@vahanm01

Description

@vahanm01

Hello,

With Raspberry Pi Pico: installed firmware using UF2 is Adafruit CircuitPython 6.2.0-beta.4 on 2021-03-18; Raspberry Pi Pico with rp2040.

In Thonny, when trying to create a ULAB array that is 1024 length, I receive "RuntimeError: pystack exhausted".

import ulab test_array=ulab.array([0, 0.00000943077, 0.0000377227, ... 0.00000943077, 0])

I did not want to include the large array here, but its 1024 length of float64...basically a hanning window array.
I also tried just values 1-1024 int and it gave the same error.

I am unsure how to adjust the pystack value with a UF2 setup and Windows 10. I cannot find any core files.
I apologize if this is a limitation of Circuitpython and/or RP2040, but I can't imagine an array of that length is pretty much a bottleneck...at least I hope not.

A workaround I found was to save the hanning values into a text file, import them into a list, and then convert them to a ulab array. Also if I create a loop at 1024 and populated a list by appending to it, there are no issues. It seems that having the raw values in a script for the interpreter to determine causes the pystack issue.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions