Large valid WASM functions exceed the JavaScript translator call-argument limit
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- node.js, typescript, wasm
Direzione di ricerca
Read packages/compiler/src/wasm/translate.test.ts and the linked pull request #1575, which contains the standalone regression and proposed fix. Run pnpm exec vitest run packages/compiler/src/wasm/translate.test.ts in the prepared scriptc checkout. Done means the valid module translates with all 100,000 additions and the return instruction, and the regression passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
We are experimenting with compiling the complete Sentry CLI with scriptc, retaining its SQLite and debug-file processing dependencies, before comparing it with the existing Node SEA build. Large dependency WASM modules exposed a size limit in the JavaScript-hosted WASM translator.
Observed behavior
A valid WASM function with enough generated instructions fails during translation with:
RangeError: Maximum call stack size exceeded
The translator appends the function body with out.push(...this.lines.lines). Every generated line becomes a separate JavaScript call argument, so sufficiently large functions exceed the host engine's argument limit. This is a host call limit, rather than recursive WASM execution or invalid WASM input.
Reproduction and expected behavior
The standalone regression in #1575 constructs a valid module exporting sum, with one i32 local and 100,000 repeated additions of one. Node instantiates the module and returns 100000; the unpatched translator at 18400d0 throws while appending its generated body. Validation used Node 24.22.0 on Darwin arm64.
Translation should finish, retaining all 100,000 additions and the return instruction. The regression can be run from a prepared scriptc checkout containing the test:
pnpm exec vitest run packages/compiler/src/wasm/translate.test.ts
Proposed fix and scope
#1575 appends the generated lines in order with a loop. It removes the argument-count limit without changing translation semantics or the emitted IR. The issue concerns the JavaScript-hosted translator/API; it does not establish that the native compiler has the same host argument limit.
The regression fails before the fix and passes after it. Local validation also passed all 48 WASM tests and a 32-workload comparison with byte-identical IR, LLVM, and release executables. This fix removes one compilation blocker; the complete Sentry CLI still has other compatibility blockers, so no full CLI performance improvement is claimed.
- Lingua principale
- TypeScript
- Stelle
- 6.4k
- Fork
- 204
- Merge medio
- 7h 45m
- PR unite (30g)
- 845
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vercel-labs/scriptc
-
`process.execPath` uses the ANSI API on Windows, so non-ASCII paths are garbled when the ANSI code page is not UTF-8Forse già presa @ctate l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
vercel-labs/scriptc#2910 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
vercel-labs/scriptc#3048 ·
I maintainer di solito rispondono entro 1 giorno
-
Object-shape and declaration-assignment diagnostics describe the wrong JavaScript behaviorForse già presa @MathurAditya724 l’ha presa 1 giorno fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
vercel-labs/scriptc#3037 ·
I maintainer di solito rispondono entro 1 giorno
-
Optional setter JSDoc is mistaken for optional executable syntaxForse già presa @MathurAditya724 l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
vercel-labs/scriptc#3036 ·
I maintainer di solito rispondono entro 1 giorno
-
Valid legacy regex fragments are rejected before native compilationForse già presa @MathurAditya724 l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
vercel-labs/scriptc#3035 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vercel-labs/scriptc
Issue simili
-
Navbar avatar and name stay stale after saving profile changesForse già presa @alexechoi l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
marmelab/atomic-crm#416 ·
I maintainer di solito rispondono entro 1 giorno
-
feature-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
bluesky-social/social-app#12343 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
lucide-icons/lucide#5165 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature] Preferences - Keep the theme selection popover open after selection for quick previewAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
marktext/marktext#6033 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:desktop bug has repro platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
anthropics/claude-code#107903 ·