A single fprintf(stderr,...) each turn reduces occurrence of timeouts

I have not tested this in multiple games, but at least in Tron I had the problem of timeouts, that reliably went away when I introduced a single fprintf(stderr, “Some text.\n”). I don’t know if it is caused by the system trying to subtract the time spent on logging, or something?

Interesting. @_CG_XorMode is currently investigating on reccurent timeout issues in multiple puzzles : https://www.codingame.com/forum/t/timeouts-with-c-in-csb-might-be-more-general/70689

This information could be helpful.

1 Like

There is also a chance that my code, counterintuitively, suffers from getting more time to spend. That could, for instance be the case if more time gave it more time to leak memory or search beyond the end of the game or something like that.

My bot was trying to search beyond the end of the game. I think I managed to close that “leak”, but there are still timeouts. Even though I have a fprintf in every turn. I guess my hypothesis is rather weak now.

1 Like