[WASM] SChunk.__getitem__/get_slice raises RuntimeError on Pyodide 0.29.4 (works on 0.29.3 and 314.0.0)
- Ngôn ngữ chính
- Python
- Star
- 211
- Fork
- 62
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 6
Mô tả
## 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`:
```python
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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với tests/test_open.py::test_load_schunk_returns_in_memory_copy và tái hiện lỗi trên Pyodide 0.29.4, sau đó kiểm tra đường dẫn get_slice/__getitem__ trong schunk.py và entry point blosc2_ext.pyx được nêu trong traceback. Kiểm tra cách xử lý phiên bản Pyodide trong .github/workflows/cibuildwheels.yml và wasm.yml. Được xem là hoàn tất khi thao tác slicing SChunk đã được tải vào bộ nhớ hoạt động trên 0.29.4 mà không gây hồi quy trong các môi trường 0.29.3 và 314.0.0 đang vượt qua.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python, wasm
- Lĩnh vực
- build-system, testing-qa
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100