Divided a long run into chunks, and first few runs go through fine until a call down the line breaks with “Canister exceeded the limit” error.
Steps to reproduce is as follows:
The full error says something like “Canister exceeded the limit of 42949672960 instructions for single message execution”, right? Normally I’d suggest looking into using canbench to see where your canister is using many instructions - is there any support for something similar in icpp (@icpp)?
Here’s a sample run. I’ve made the simulation so that it runs the number of seconds I send in the play_match call (as seen in the screenshot, the second parameter is set to 2 seconds).
When I make the call a few times, it runs fine, until it breaks at some point. Does the instruction limit accumulate across several calls, or should it count only a single call?
Yep this is correct. Is there anything changing in the state that would cause longer runs to use more instructions?
You can try using the performance_counter API directly to see how many instructions you’re using. It could be that there’s slight variation between the calls and most are just under the limit, but some go just over.
@abk@icpp you were absolutely right, the simulation was running differently on chain as agent was untrained producing different results than the ones produced by running natively which caused an endless loop 15 seconds into the simulation. Good news simulation with nn agents is running fine now and next i’ll try training on chain.
Thanks a lot for the valuable input.