Borrowed Uint8Array.prototype.set.call hits a runtime fence in WASM binding code
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 15/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, typescript, wasm
Direzione di ricerca
Start with the linked pull request #1580, which proposes recognizing the borrowed typed-array call and routing it through a checked runtime helper. Review the two linked differential programs for typed and overlapping views and for checked-dynamic receivers and coercion order, then run the ordinary and sanitizer checks and the source-library feature matrix described in the issue. Done means the direct borrowed-call form matches Node's required semantics; the issue notes that broader CLI parity is outside scope.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
We are experimenting with compiling the complete Sentry CLI with scriptc, including its existing SQLite and debug-file processing dependencies, before benchmarking against the current Node SEA build. Generated WASM binding code uses a borrowed typed-array builtin to copy host bytes into linear memory; preserving that behavior is necessary to retain those dependencies.
Reproduction and expected behavior
Save as repro.mjs:
let cached = null;
function memory() {
if (cached === null) cached = new Uint8Array(4);
return cached;
}
function copy(target, source, offset) {
return Uint8Array.prototype.set.call(target, source, offset);
}
console.log(copy(memory(), new Uint8Array([3, 4]), 1));
console.log(String(memory()));
Node prints:
undefined
0,3,4,0
On unpatched main at 1ee5c84, the JavaScript-hosted compiler's analyze API reports no compile diagnostics or preflight failure for this example, but records one SC1090 runtime fence at the borrowed call:
Function.prototype.call on a function whose signature cannot cross the checked-value boundary (call 'Uint8Array.prototype.set(...)' directly) is not supported yet
This distinction matters: a build can succeed while execution is refused at the fence. Both statically known and checked-dynamic receivers need a supported path that produces the same result as Node. Replacing the borrowed builtin with target.set(...) is not equivalent when the receiver has its own set override.
Required semantics
Calling the builtin through .call must not look up a receiver's own set override. It must validate the receiver before offset coercion, preserve source access order, handle overlapping typed-array views and destination element conversion, enforce bounds, and return undefined. A DataView is invalid as the receiver; a plain DataView source has no length and copies zero elements. Primitive sources and offsets must retain their JavaScript behavior.
Proposed implementation and evidence
#1580 recognizes this exact builtin call and sends it to a checked runtime helper that reuses the existing typed-array copy/conversion implementation. The helper is a separate optional runtime unit, selected consistently for packaged and source-built executables and libraries under the existing dynamic-invocation feature.
The PR includes two self-contained Node/native differential programs: typed and overlapping views and checked-dynamic receivers and coercion order. Local ordinary and sanitizer runs pass, as does the four-way source-library feature matrix. A 33-workload comparison produces byte-identical IR, LLVM, and release executables without allow patterns.
This request is scoped to the direct borrowed-call form and the existing fixed-size view representation. The complete CLI still has other compatibility blockers; these checks do not establish full CLI parity or a runtime performance improvement.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 183
- Merge medio
- 3h 22m
- PR unite (30g)
- 868
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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
vercel-labs/scriptc#1797 ·
I maintainer di solito rispondono entro 1 giorno
-
Large valid WASM functions exceed the JavaScript translator call-argument limitForse già presa @MathurAditya724 l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
vercel-labs/scriptc#1796 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 32/100
vercel-labs/scriptc#1777 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
vercel-labs/scriptc#1679 ·
I maintainer di solito rispondono entro 1 giorno
-
String-literal element access on the right of an any destructuring declaration is refusedForse già presa @jlucaso1 l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
vercel-labs/scriptc#1677 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vercel-labs/scriptc
Issue simili
-
[Feature]: 建议导入源后,自动切换到新导入的源Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
lyswhut/lx-music-desktop#3026 ·
-
area: ci type: test
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
schlessera/brain-kit#2769 ·
I maintainer di solito rispondono entro 1 giorno
-
Read a vector index's quantization back on Neo4j 2026.10, which reports vector.quantization.typeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
liberation-data/drivine#231 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
alveusgg/alveusgg#2502 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno