Skip to content

Comments

General wasm32 fixes#586

Merged
lshaw8317 merged 56 commits intomainfrom
tcc-jit-wasm32-fixes
Feb 20, 2026
Merged

General wasm32 fixes#586
lshaw8317 merged 56 commits intomainfrom
tcc-jit-wasm32-fixes

Conversation

@FrancescAlted
Copy link
Member

No description provided.

FrancescAlted and others added 30 commits February 18, 2026 07:11
- Restrict wasm cibuildwheel test command to tests/ndarray/test_wasm_dsl_jit.py
- Update wasm handoff notes to reflect current status and scoped next steps
- Remove unused noqa on fill_chunk_operands to satisfy Ruff (RUF100)

Context:
- cp313 pyodide_2025_0_wasm32 wheel builds successfully on Linux
- test_wasm_dsl_jit.py passes (_WASM_MINIEXPR_ENABLED=True)
- Broad lazyexpr/reductions wasm failures are tracked separately
FrancescAlted and others added 14 commits February 19, 2026 12:59
  Use platform-stable dtype translation for miniexpr in `_set_pref_expr` by mapping
  NumPy dtypes via `(kind, itemsize)` instead of `dtype.num`, which differs on
  Pyodide/wasm32 and caused DSL int-cast compilation/execution failures.

  Changes:
  - `src/blosc2/blosc2_ext.pyx`
    - add `_me_dtype_from_numpy_dtype(...)` helper
    - use helper for operand/output dtype setup in miniexpr compile path
    - raise clear `TypeError` for unsupported dtypes
    - include `me_get_last_error_message()` details in compile errors
  - `CMakeLists.txt`
    - pin `miniexpr` to `f5e276a151025f9307819c329a033f3f5293a714`
  - `tests/ndarray/test_dsl_kernels.py`
    - remove wasm-only expected `RuntimeError` in
      `test_dsl_kernel_index_symbols_int_cast_matches_expected_ramp`
  - `plans/wasm32-todo.md`
    - mark item 7 as done and record retest result

  Result:
  - wasm32/Pyodide now evaluates DSL `int(...)` index-ramp kernel correctly
    (`int64` ramp output), and DSL kernel test module passes locally.
- add contains/startswith/endswith support to eval-safe globals and dtype inference
- quote string/bytes scalars when building lazy expressions
- fix _numpy_eval_expr dummy handling for string predicates on wasm
- allow string scalar specialization in DSL miniexpr input rewriting
- map NumPy unicode to ME_STRING and pass validated itemsize in _set_pref_expr
- register startswith/endswith in elementwise funcs
- add wasm-only strict-miniexpr regression test for string predicates including lazyexpr(..., operands=...)
@FrancescAlted
Copy link
Member Author

This overrides #584

@FrancescAlted
Copy link
Member Author

FWIW, I double checked that using pyodide 0.29.3 is fully ABI compatible with pydodide 0.29.0 (the version that we have in production in cat2.cloud), so we should be safe here.

@FrancescAlted
Copy link
Member Author

Fixed most of @lshaw8317 comments here. The only open question is the update of safe_blosc2_globals. I'd happy if you provide a good fix for that.

@lshaw8317
Copy link
Collaborator

Since blosc2 now supports an internal contains (not from numexpr), and safe_numpy_globals also has a contains function, it is no longer necessary to recur to ne_evaluate when the expression has ''contains''.

@lshaw8317 lshaw8317 merged commit 1519833 into main Feb 20, 2026
17 checks passed
@lshaw8317 lshaw8317 deleted the tcc-jit-wasm32-fixes branch February 20, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants