Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[FEATURE] Improve Error handling for semantic analysis

Đang mở
#11 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
18/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
compilers

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?
Ngôn ngữ chính
Python
Star
29
Fork
33
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của qBraid/pyqasm

Tất cả issue của qBraid/pyqasm

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.