Repository navigation
Conversation
…t#215) randint() used int(), which truncates toward zero, so randint(-2, 2) never returned -2 and randint(-5, -1) could return 0; past 2**31 it went negative. Same one-line fix as glowscript b8a6fa1 / upstream rapydscript-ng#193: return a + randbelow(b - a + 1). lib/rapydscript/compiler.js and lib/compiling/GScompiler.js are copied from glowscript b8a6fa1 (both were identical to glowscript before the fix). package/RScompiler.3.2.min.js is rebuilt with build_package.py; glow, RSrun and compiler rebuild byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNw6KLiif2r9zSoSQug4iL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNw6KLiif2r9zSoSQug4iL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports vpython/glowscript#215 (merged as b8a6fa1). This runner serves trinket's Web VPython 3.2.3, and webvpython.org for every program that isn't marked
wasm, so both sites have the randint bug until this is deployed.randint()usedint(), which truncates toward zero:randint(-2, 2)randint(-5, -1)randint(0, 10**10)(100,000 calls each, through the GlowScriptOffline compile-and-run pipeline, with this branch's
package/RScompiler.3.2.min.jsswapped in.)What changed
lib/rapydscript/compiler.jsandlib/compiling/GScompiler.jsare copied from glowscript b8a6fa1. Both were byte-identical to glowscript's versions before the fix.package/RScompiler.3.2.min.jsis rebuilt withbuild_package.py.glow,RSrunandcompilerrebuild byte-identical, so only the RapydScript compiler changes..gitignoreto.env,.env.*and*.pem.Note:
mainwas behind the live deployThe June deploy to
gs://rswvprunnerwas built from6db610b(the lazy$('body')print fix), which was only on thelazy-body-evalbranch. I fast-forwardedmainto it before branching. Rebuildingmainnow reproduces every live file exactly (glow15877990…, RScompilerada77756…, RSrun2735844b…).Deploying
do_build.sh(TRUSTED_HOST frombuild.env).package/RScompiler.3.2.min.jshas sha256 starting6376aa0899c68a2a.RSCOMPILER_SHA256andGLOWSCRIPT_PACKAGE_BUILDto match.🤖 Generated with Claude Code