Playground: `exit of N` returns rc 1 from eigs_run_source instead of N

Aperta Adatta ai principianti
#2,311 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c, wasm
Ambito
cli

Direzione di ricerca

Il valore di ritorno viene calcolato in eigs_run_source in web/eigs_wasm.c, che restituisce g_has_error ? 1 : 0 senza leggere g_exit_code. Inizia da lì e verifica come exit of N imposta g_exit_code. È completato quando exit of 3 restituisce 3, exit of 0 restituisce 0, gli errori di runtime restituiscono ancora 1 e la riga exit of 3 in tests/test_playground_wasm_2301.sh fissa il valore invece di accettare null.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs-triage

Found while fixing #2301 (PR #2302, hq#58 ES-OWF-1).

Problem

In the browser playground, exit of N does not propagate N. eigs_run_source (web/eigs_wasm.c) returns g_has_error ? 1 : 0 and never reads g_exit_code, so:

program CLI exit status playground eigs_run_source rc
exit of 3 3 1
exit of 0 0 not pinned (expected 0)

(rc 1 measured on a real emcc 3.1.74 build in PR #2302's CI.) The playground cannot distinguish exit of 3 from a runtime error. tests/test_playground_wasm_2301.sh accepts any number for this row (wantRc null), so nothing pins the value.

Done when

  • eigs_run_source("exit of 3") returns 3, and eigs_run_source("exit of 0") returns 0, in a real emcc build of web/build.sh.
  • A runtime error still returns 1, and a plain run after any of these in the same module still returns 0 with its output.
  • The exit of 3 row in the playground test pins the rc (no null wildcard). The test runs in pages.yml before the receipt and goes red on the current g_has_error ? 1 : 0 return.
  • web/app.js shows the exit code if the UI surfaces rc. If it does not, the PR says so.

Generated by Claude Code

Lingua principale
C
Stelle
3
Fork
7
Merge medio
6h 21m
PR unite (30g)
323

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di InauguralSystems/EigenScript

Tutte le issue di InauguralSystems/EigenScript

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.