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

source-academy / py-slang / 28822804975
78%

Build:
DEFAULT BRANCH: main
Ran 06 Jul 2026 09:02PM UTC
Jobs 1
Files 86
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

06 Jul 2026 08:58PM UTC coverage: 77.557% (+0.08%) from 77.481%
28822804975

push

github

web-flow
feat(cse-machine): serialize globalNames onto call frames + fix premature return-frame transition (#196)

* feat(cse-machine): serialize globalNames onto call frames

Expose Closure.globalVariables (already computed at function-def time
and already used by the interpreter to route `global`-declared name
lookups straight to the global frame) via the new optional
CseSerializedEnvFrame.globalNames field, so the visualizer can
annotate call frames the moment they're created.

Depends on the globalNames field added to
@sourceacademy/common-cse-machine in the companion source-academy/plugins
PR; the runtime behavior here is safe regardless (extra JSON property),
but the test file casts at the read site until py-slang's dependency
on that package is bumped past the version declaring the field.

Part of source-academy/frontend#4041.

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

* fix(cse): defer environment restoration on return to the ENVIRONMENT instruction

RESET's handler called popEnvironment(context) directly, redundant
with the ENVIRONMENT instruction always pushed immediately below it
by APPLICATION (envInstr then resetInstr, per every function call).
js-slang's real CSE machine never pops the environment in RESET —
only ENVIRONMENT does, via a while loop restoring to the target env.

Popping in RESET made the frame transition happen one step early, at
the return statement itself, instead of at the ENVIRONMENT instruction
where the CSE machine visualizer's EnvironmentAnimation is meant to
animate it (by the time ENVIRONMENT ran, its while loop was already a
no-op since RESET had already restored the environment).

Added a regression test asserting the callee frame is still active
immediately after the return step, and only stops being active once
the ENVIRONMENT instruction's step has run. Full suite (2449 tests)
passes unaffected.

* chore: bump common-cse-machine to 0.2.0, drop the globalNames read-site cast

Now that @sourceacademy/comm... (continued)

2483 of 3481 branches covered (71.33%)

Branch coverage included in aggregate %.

5980 of 7431 relevant lines covered (80.47%)

13481.56 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28822804975.1 06 Jul 2026 09:02PM UTC 86
77.56
GitHub Action Run
Source Files on build 28822804975
  • Tree
  • List 86
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #28822804975
  • 801ef1ab on github
  • Prev Build on main (#28806044086)
  • Next Build on main (#28831537578)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc