Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[FEATURE] Improve Error handling for semantic analysis

Aperta
#11 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
compilers

Direzione di ricerca

The payload names no files, so start by finding where the semantic analyser raises and reports its first error in the pyqasm package. The open design questions are how to collect errors up to a threshold, what state to give an invalid variable like a in the example, and how to format codes such as OSA_ERR_123. The issue has no comments or linked work and needs maintainer decisions before any patch. Treat it as a discussion starter, not a first task.

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

Descrizione

enhancement
Feature Description
Error Emission
  • Currently, the semantic analyser stops at the first error and emits out an error message to the user about the about location and the error.
  • This might be good for a small number of semantic errors but for a lot of errors, the user experience would degrade. They would have to run the analyser as many times as the number of errors which is not desirable.
  • Moreover, if the user has a very large number of errors, spitting out all errors at once could be confusing.
  • A good feature would be to add an error threshold in the analyser. With this, we can keep a list of errors and as soon as the number of errors reach this predefined threshold, we stop and emit all of these errors.
Error Codes
  • Adding unique identifiers to the messages would help locate the line of code quicker than parsing through the python traceback. Eg - OSA_ERR_123: <<error message>> ( OSA: openqasm semantic analyser )
Implementation (Optional)
OPENQASM 3.0;
array[int[32], 2, 2] my_arr = { {1,2}, {3,4}};
int[32] a = my_arr[0]; // this is semantically incorrect 

qubit q;
if( a == 4) { // what do we refer as "a" here? 
    for int[32] i in [:a] {
         rx(pi * i ) q;
    }
}

In the above example, do we treat a as undefined or invalid? What does "invalid" exactly mean here? How to continue semantic analysis in this erroneous state?

  • What is a good threshold level for errors?
Lingua principale
Python
Stelle
29
Fork
33
Merge medio
2g 4h
PR unite (30g)
15

Preparare l'ambiente

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 qBraid/pyqasm

Tutte le issue di qBraid/pyqasm

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.