qsharp-runtime
qsharp-runtime copied to clipboard
Having multiple resource estimation tests still causes nondeterministic failures related to concurrency
All I did was have two resource estimation tests. And then pretty often (>10% of the time) I get failures like this one:
Unhandled exception. System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
---> Microsoft.Quantum.Diagnostics.AllowAtMostNCallsCA on [...]bin/Debug/netcoreapp3.1/D:\a\1\s\submodules\QuantumLibraries\Standard\src\Diagnostics\Allows.qs:line 0
at Test.test_repro on test/test.qs:line 0
I've transferred this issue from qsharp-language to qsharp-runtime and updated the label to bug. We need to investigate whether the resource estimator is expected to support parallel access to these data structures. Our other local simulator targets support parallel execution, so resource estimator likely should too.
+1, I've also encountered this in my recent work.