Skip to content

Commit afaedb1

Browse files
authored
📝 document timeout handling (#478)
## Description This small PR adds some documentation on how QCEC handles timeouts. Resolves #477 ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines. --------- Signed-off-by: burgholzer <burgholzer@me.com>
1 parent 318178b commit afaedb1

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

docs/source/library/configuration/Execution.rst

+15
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@ Execution
44
.. autoclass:: mqt.qcec::Configuration.Execution
55
:members:
66
:undoc-members:
7+
8+
Timeout Handling
9+
----------------
10+
11+
Timeouts in QCEC work by checking an atomic flag in between the application of gates (for DD-based checkers) or rewrite rules (for the ZX-based checkers).
12+
Unfortunately, this means that an operation needs to be fully applied before a timeout can set in.
13+
If a certain operation during the equivalence check takes a very long time (e.g., because the DD is becoming very large), the timeout will not be triggered until that operation is finished.
14+
Thus, it is possible that the timeout is not triggered at the expected time, and it might seem like the timeout is being ignored.
15+
16+
Unfortunately, there is no clean way to kill a thread without letting it finish its computation.
17+
That's something that could be made possible by switching from multi-threading to multi-processing, but the overhead of processes versus threads is huge on certain platforms and that would not be a good trade-off.
18+
In addition, more fine-grained abortion checks would significantly decrease the overall performance due to all the branching that would be necessary.
19+
20+
Consequently, timeouts in QCEC are a best-effort feature, and they should not be relied upon to always work as expected.
21+
From experience, they tend to work reliably well for the ZX-based checkers, but they are less reliable for the DD-based checkers.

noxfile.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,18 @@ def docs(session: nox.Session) -> None:
104104
extra_installs = ["sphinx-autobuild"] if serve else []
105105
session.install(*BUILD_REQUIREMENTS, *extra_installs)
106106
session.install("--no-build-isolation", "-ve.[docs]")
107+
session.chdir("docs")
107108

108109
if args.builder == "linkcheck":
109-
session.run("sphinx-build", "-b", "linkcheck", "docs", "docs/_build/linkcheck", *posargs)
110+
session.run("sphinx-build", "-b", "linkcheck", "source", "_build/linkcheck", *posargs)
110111
return
111112

112113
shared_args = (
113114
"-n", # nitpicky mode
114115
"-T", # full tracebacks
115116
f"-b={args.builder}",
116-
"docs",
117-
f"docs/_build/{args.builder}",
117+
"source",
118+
f"_build/{args.builder}",
118119
*posargs,
119120
)
120121

0 commit comments

Comments
 (0)