[FEATURE] Improve Error handling for semantic analysis
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 18/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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?
- Lenguaje dominante
- Python
- Estrellas
- 29
- Forks
- 33
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 15
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de qBraid/pyqasm
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
Los mantenedores suelen responder en 1 día
-
enhancement error-handling program-validation
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Move the QASM 2 printer and its branch pre-processing out of qasm2.pyPosiblemente ocupada @danielgaskins la tomó hace 8 días. Abiertoenhancement qasm2
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
qBraid/pyqasm#447 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[BUG] dumps() emits extern calls without a semicolon, producing unparsable QASMPosiblemente ocupada @Jah-yee la tomó hace 17 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
qBraid/pyqasm#438 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Parse failures raise ValidationError with an empty message; the ANTLR diagnostic is lostPosiblemente ocupada @tonycoder-hub la tomó hace 10 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 22/100
qBraid/pyqasm#436 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de qBraid/pyqasm
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
CLIMADA-project/climada_python#1337 ·
Los mantenedores suelen responder en 3 días
-
tail without reverseAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
8go/matrix-commander#233 ·
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
documentation enhancement priority:high size:M
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Validate non-divisible effective batch sizes in the Unsloth LoRA backendPosiblemente ocupada @debesh-biswas la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100