oqc-community / rasqal

A dynamically executed quantum-classical hybrid runtime.
Other
20 stars 5 forks source link

Allow LLVM/QIR instruction limits to be placed #16

Closed chemix-lunacy closed 8 months ago

chemix-lunacy commented 9 months ago

Currently by default we run absolutely everything we get given, which means you can get into infinite loops if the code is written that way. This is fine, it's being truthful to what's given and can be dealt with by an external timeout or process kill, but it would be useful if a more nuanced restriction could be set in place.

Create an API where someone can define very specifically what LLVM and QIR instructions should be allowed to be parsed and it will throw if these are seen. This should only affect primary statements, things like GEP should just be allowed in general.

By default all instructions should be allowed.

chemix-lunacy commented 8 months ago

Step limit has been added which supersedes this. Limitations on instructions aren't that helpful, but you do want to be able to give it a limit on how long it runs in certain situations.