Repository navigation
♻️ Return owned errors at native boundaries - #2545
burgholzer wants to merge 2 commits into
Conversation
18f186e to
e95a1ee
Compare
c5bdf1b to
46025a6
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
f410460 to
bb0ae82
Compare
bb0ae82 to
f7553f5
Compare
0e7e58b to
501b3b9
Compare
1a125ca to
c5f0dd5
Compare
8c8deda to
f33d8d8
Compare
Will try to get through this either today or tomorrow (more likely). |
They were not supported before as well, but probably still makes sense to have that guard. |
d741493 to
45409bd
Compare
6bf57c8 to
753428e
Compare
2ed02a6 to
ab2a1e4
Compare
d9c02f6 to
97c8326
Compare
|
@simon1hofmann @denialhaag I have extracted quite a few things from here to separate PRs and have tried to continuously updated the implementation here with regard to main. |
Sounds good to me! Also helps us to push out some more improvement from 4.1 to 4.2 😄 |
|
Agreed! |
Build on the LLVM JSON and separate QDMI/DD I/O changes. Use Expected and Error for recoverable native failures, factories for fallible construction, and common nanobind conversion for Python exceptions. Keep MLIR diagnostics local and preserve QDMI C status boundaries. Remove diagnostic forwarding and follow LLVM's exception/RTTI policy where native algorithms no longer throw. Keep driver allocation recovery and worker host boundaries. Preserve DD text grammar and Python numeric syntax, range and structural error categories. Windows DLL LLVM error identity remains a merge requirement; this commit does not add a custom runtime to conceal that unresolved boundary. Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Signed-off-by: Lukas Burgholzer <burgholzer@me.com> Assisted-by: GPT-6 via Codex
Link DD algorithms and the QDMI C++ client statically so errors retain the LLVM type identity of their handlers. Share only canonical DD constants between Python modules. Keep MSVC regex exception layouts compatible and use nonthrowing shortest QIR floating-point formatting. Avoid inline ErrorList RTTI in the DD regression test and cover exact floating-point records, including a precision mutation check. Assisted-by: GPT-6 via Codex
🤖 AI text below 🤖
Description
Return owned
llvm::Expected<T>andllvm::Errorfor recoverable native failures. Factories replace fallible constructors; infallible operations retain values orvoid, and successful absence usesoptional<T>. MLIR keeps context diagnostics, captured as owned errors at native compiler boundaries. Python preserves exception categories through a common nanobind adapter; QDMI C interfaces preserve status codes and local logging.Based directly on main after #2839, #2840, and #2846 merged. This PR contains the remaining DD, QDMI, compiler, and QIR error APIs, their consumers, and exception/RTTI policy. It preserves DD parsing grammar and numeric error categories, uses the merged LLVM I/O paths, and adds no shared diagnostic runtime or forced shared-Core build. Driver allocation recovery and worker host exception boundaries remain where needed.
DD algorithms, the QDMI C++ client, and benchmarks link statically into consumers so LLVM error type IDs stay with their handlers. Python shares only the canonical DD constant objects. On MSVC, DD retains exception support for
std::regexbecause_HAS_EXCEPTIONSchanges STL exception vtable layouts. QIR floating-point records use nonthrowing shortest formatting.Validation
Commits are signed and verified. Windows/macOS execution still requires hosted validation; no hardware jobs or performance claims.
AI assistance: Codex implemented and locally validated the refactor. Human review remains required.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).