• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / py-slang / 40162275128
88%

Build:
DEFAULT BRANCH: main
Ran 25 Oct 2026 04:54AM UTC
Jobs 1
Files 182
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Oct 2026 04:32AM UTC coverage: 87.969% (-0.02%) from 87.986%
40162275128

push

github

web-flow
Pyodide: let a module's .sync fast path accept opaque/closure arguments (#622)

* Pyodide: let a module's .sync fast path accept opaque/closure arguments

A module function's .sync twin was only tried when every argument was a
number, boolean or string. An opaque/closure argument (e.g. the dest image
handed to a pix_n_flix filter) made the call fall back to run_sync, which
fails with "Cannot stack switch because the Python entrypoint was a
synchronous function" whenever the student code was invoked by the module
itself (a plain JS->Python call, not via callPromising) - such as an
installed filter running on each camera frame.

Pass _SaOpaque/_SaClosure through by their identifier in the synchronous
path, as pythonToModule already does. Adds a regression test that fires a
stored student callback from JS after the chunk has finished.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Pyodide: classify opaque/closure args in Python on the .sync fast path

The first version of the fix made JS call back into Python (isinstance),
build a PyProxy for the handle and read two attributes through it, on every
module call - ~3us of the ~4us a pix_n_flix set_pixel_value(dest, ...) cost.

_SaClosure.__call__ now flattens each handle into one scalar
(sa_value * 64 + sa_type) before crossing into JS, with a bitmask marking
which arguments are handles, so no PyProxy is created and nothing calls back
into Python. Per-call cost drops ~4.0us -> ~1.9us; a 400x300 per-pixel
filter frame ~2950ms -> ~1500ms.

Also fixes two @typescript-eslint/require-await errors in the new test
fixtures (the PR's build check was failing on lint) and applies prettier.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

7195 of 8620 branches covered (83.47%)

Branch coverage included in aggregate %.

1 of 8 new or added lines in 1 file covered. (12.5%)

14668 of 16233 relevant lines covered (90.36%)

311265.96 hits per line

Uncovered Changes

Lines Coverage ∆ File
7
9.24
0.25% src/engines/pyodide/moduleInterop.ts
Jobs
ID Job ID Ran Files Coverage
1 40162275128.1 25 Oct 2026 04:54AM UTC 182
87.97
GitHub Action Run
Source Files on build 40162275128
  • Tree
  • List 182
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #40162275128
  • 8a99c4fa on github
  • Prev Build on main (#39877615924)
  • Next Build on main (#40172809934)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc