qsharp-runtime icon indicating copy to clipboard operation
qsharp-runtime copied to clipboard

Having multiple resource estimation tests still causes nondeterministic failures related to concurrency

Open Strilanc opened this issue 3 years ago • 2 comments

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

Strilanc avatar Mar 17 '22 03:03 Strilanc

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.

swernli avatar Mar 24 '22 18:03 swernli

+1, I've also encountered this in my recent work.

tanujkhattar avatar May 10 '22 21:05 tanujkhattar