Skip to content

Commit

Permalink
Revert "[Backport 3.8] Control systems resources exceeded (#281)" (#295)
Browse files Browse the repository at this point in the history
This reverts commit e99ff5c.

This reverts the addition of the `QSSControlSystemResourcesExceeded`
error class as the code to actually emit that type of error has not been
back ported to release_v3.8.

After discussions with the author @mbhealy it is our recommendation to
not back port the code to emit the error as it was developed after the
LLVM 17 update and associated refactors making the back port difficult.
  • Loading branch information
bcdonovan authored Mar 14, 2024
1 parent 3b575f4 commit 5ab8549
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 53 deletions.
1 change: 0 additions & 1 deletion include/API/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ enum class ErrorCategory {
QSSLinkSignatureNotFound,
QSSLinkArgumentNotFoundWarning,
QSSLinkInvalidPatchTypeError,
QSSControlSystemResourcesExceeded,
UncategorizedError,
};

Expand Down
3 changes: 0 additions & 3 deletions lib/API/errors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ static std::string_view getErrorCategoryAsString(ErrorCategory category) {
case ErrorCategory::QSSLinkInvalidPatchTypeError:
return "Invalid patch point type";

case ErrorCategory::QSSControlSystemResourcesExceeded:
return "Control system resources exceeded";

case ErrorCategory::UncategorizedError:
return "Compilation failure";
}
Expand Down
8 changes: 0 additions & 8 deletions python_lib/qss_compiler/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,6 @@ def _do_compile(
return_diagnostics=return_diagnostics,
)

for diag in diagnostics:
if diag.category == ErrorCategory.QSSControlSystemResourcesExceeded:
raise exceptions.QSSControlSystemResourcesExceeded(
diag.message,
diagnostics,
return_diagnostics=self.return_diagnostics,
)

if not success:
raise exceptions.QSSCompilationFailure(
"Failure during compilation",
Expand Down
4 changes: 0 additions & 4 deletions python_lib/qss_compiler/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,5 @@ class QSSLinkInvalidArgumentError(QSSLinkingFailure):
"""Raised when argument is invalid"""


class QSSControlSystemResourcesExceeded(QSSCompilerError):
"""Raised when control system resources (such as instruction memory) are exceeded."""


class OpenQASM3ParseFailure(QSSCompilerError):
"""Raised when a parser failure is received"""
49 changes: 18 additions & 31 deletions python_lib/qss_compiler/lib_enums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,24 @@
namespace py = pybind11;

void addErrorCategory(py::module &m) {
py::enum_<qssc::ErrorCategory>(m, "ErrorCategory", py::arithmetic())
.value("OpenQASM3ParseFailure",
qssc::ErrorCategory::OpenQASM3ParseFailure)
.value("QSSCompilerError", qssc::ErrorCategory::QSSCompilerError)
.value("QSSCompilerNoInputError",
qssc::ErrorCategory::QSSCompilerNoInputError)
.value("QSSCompilerCommunicationFailure",
qssc::ErrorCategory::QSSCompilerCommunicationFailure)
.value("QSSCompilerEOFFailure",
qssc::ErrorCategory::QSSCompilerEOFFailure)
.value("QSSCompilerNonZeroStatus",
qssc::ErrorCategory::QSSCompilerNonZeroStatus)
.value("QSSCompilationFailure",
qssc::ErrorCategory::QSSCompilationFailure)
.value("QSSLinkerNotImplemented",
qssc::ErrorCategory::QSSLinkerNotImplemented)
.value("QSSLinkSignatureWarning",
qssc::ErrorCategory::QSSLinkSignatureWarning)
.value("QSSLinkSignatureError",
qssc::ErrorCategory::QSSLinkSignatureError)
.value("QSSLinkAddressError", qssc::ErrorCategory::QSSLinkAddressError)
.value("QSSLinkSignatureNotFound",
qssc::ErrorCategory::QSSLinkSignatureNotFound)
.value("QSSLinkArgumentNotFoundWarning",
qssc::ErrorCategory::QSSLinkArgumentNotFoundWarning)
.value("QSSLinkInvalidPatchTypeError",
qssc::ErrorCategory::QSSLinkInvalidPatchTypeError)
.value("QSSControlSystemResourcesExceeded",
qssc::ErrorCategory::QSSControlSystemResourcesExceeded)
.value("UncategorizedError", qssc::ErrorCategory::UncategorizedError)
.export_values();
py::enum_<qssc::ErrorCategory>(m, "ErrorCategory", py::arithmetic())
.value("OpenQASM3ParseFailure",
qssc::ErrorCategory::OpenQASM3ParseFailure)
.value("QSSCompilerError", qssc::ErrorCategory::QSSCompilerError)
.value("QSSCompilerNoInputError", qssc::ErrorCategory::QSSCompilerNoInputError)
.value("QSSCompilerCommunicationFailure", qssc::ErrorCategory::QSSCompilerCommunicationFailure)
.value("QSSCompilerEOFFailure", qssc::ErrorCategory::QSSCompilerEOFFailure)
.value("QSSCompilerNonZeroStatus", qssc::ErrorCategory::QSSCompilerNonZeroStatus)
.value("QSSCompilationFailure", qssc::ErrorCategory::QSSCompilationFailure)
.value("QSSLinkerNotImplemented", qssc::ErrorCategory::QSSLinkerNotImplemented)
.value("QSSLinkSignatureWarning", qssc::ErrorCategory::QSSLinkSignatureWarning)
.value("QSSLinkSignatureError", qssc::ErrorCategory::QSSLinkSignatureError)
.value("QSSLinkAddressError", qssc::ErrorCategory::QSSLinkAddressError)
.value("QSSLinkSignatureNotFound", qssc::ErrorCategory::QSSLinkSignatureNotFound)
.value("QSSLinkArgumentNotFoundWarning", qssc::ErrorCategory::QSSLinkArgumentNotFoundWarning)
.value("QSSLinkInvalidPatchTypeError", qssc::ErrorCategory::QSSLinkInvalidPatchTypeError)
.value("UncategorizedError", qssc::ErrorCategory::UncategorizedError)
.export_values();
}

void addSeverity(py::module &m) {
Expand Down

This file was deleted.

0 comments on commit 5ab8549

Please sign in to comment.