[WASM] SChunk.__getitem__/get_slice raises RuntimeError on Pyodide 0.29.4 (works on 0.29.3 and 314.0.0)

Aperta
#664 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python, wasm

Direzione di ricerca

Inizia da tests/test_open.py::test_load_schunk_returns_in_memory_copy e riproduci il problema con Pyodide 0.29.4, quindi esamina il percorso get_slice/getitem di schunk.py e l’entry point blosc2_ext.pyx indicato nel traceback. Controlla la gestione della versione di Pyodide in .github/workflows/cibuildwheels.yml e wasm.yml. Il lavoro è completato quando lo slicing di SChunk caricati in memoria funziona su 0.29.4 senza introdurre regressioni negli ambienti 0.29.3 e 314.0.0, che superano i test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

On the WASM/Pyodide build, slicing an in-memory SChunk that was loaded from
a frame fails with RuntimeError: Error while getting the slice — but only
under Pyodide 0.29.4
. The same code passes on Pyodide 0.29.3 (cp313) and
314.0.0 (cp314).

The wheel tag is pyemscripten_2025_0_wasm32 (ABI-level), so a wheel built/tested
against 0.29.3 still runs on a user's 0.29.4 runtime — meaning this is a genuine
runtime failure for 0.29.4 users, not just a CI artifact.

Reproducer

tests/test_open.py::test_load_schunk_returns_in_memory_copy:

urlpath = tmp_path / "schunk.b2frame"
data = np.arange(20, dtype=np.int32)
blosc2.SChunk(data=data, urlpath=urlpath, mode="w",
              cparams={"typesize": data.dtype.itemsize})
loaded = blosc2.load(urlpath)          # in-memory copy, urlpath is None
assert loaded[:] == data.tobytes()     # <-- RuntimeError here

Traceback

schunk.py:1114 getitem -> get_slice(item.start, item.stop)
schunk.py:1058 get_slice -> super().get_slice(start, stop, out)
blosc2_ext.pyx:2058 -> RuntimeError: Error while getting the slice

Environment matrix

│        Python / ABI         │ Pyodide │     Result      │
│ cp313 / pyemscripten_2025_0 │ 0.29.3  │ ✅ pass         │
│ cp313 / pyemscripten_2025_0 │ 0.29.4  │ ❌ RuntimeError │
│ cp314 / pyemscripten_2026_0 │ 314.0.0 │ ✅ pass         │

Current workaround

.github/workflows/cibuildwheels.yml pins CIBW_PYODIDE_VERSION: 0.29.3 for the
cp313 wasm job (cibuildwheel 4.1's default is 0.29.4). This keeps CI green and
matches the wheels wasm.yml already ships, but does not fix the runtime for
0.29.4 users.

Lingua principale
Python
Stelle
211
Fork
63
Merge medio
1g 7h
PR unite (30g)
5

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Blosc/python-blosc2

Tutte le issue di Blosc/python-blosc2

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.