Feature #554
open
Detect infinite recursion when evaluating requirements
Added by Alina Lenk 7 months ago.
Updated 3 months ago.
Description
Detect recursion with the same requirement in tri_req_present(), log it as a warning and return TRI_MAYBE. This addresses a number of requirement recursion issues, see OSDN #45974.
Targeting this to S3_2 d3f since the status of self-provided goods (OSDN #43724) relies on addressing those issues.
Files
Related issues
1 (1 open — 0 closed)
- Blocks Tasks #397: S3_2 datafileformat freeze (d3f) added
Still a couple of questions that might be worth thinking about:
This breaks if requirements are ever evaluated in a multithreaded context. I feel like this could be a problem with threaded AI? Haven't tested that.
There's an argument to be made that this should be an error rather than a warning. The reason I went with warning is to provide leeway for reasonable behavior that only becomes self-referential when evaluating RPT_POSSIBLE with partial information (example).
Yes, Tex AI can evaluate tiles for autoworkers actions while the main thread does whatever requirement evaluations. Might also do movement (action enabler requirements) related evaluations in the thread.
- Status changed from In Review to New
Right. Since there isn't any forking happening during req evaluation, just making it thread-local should work; but it doesn't look like we have (implementation-agnostic) thread-local storage? So we'll either need that, or use a more heavyweight mutex-based solution that would probably cost us quite a bit of the efficiency we're using threads for in the first place.
Adding thread-local storage functionality to fcthreads should not be too hard, if we avoid over-engineering it (something just for our specific use-case)
New patch for main branch rebased onto #613. This is still preliminary and not thread-safe.
- Target version changed from 3.2.0-d3f to 3.2.0
Stopping blocking d3f with this. This does not require changes to the format, but is a bug inside specific format. We hope that the bug will get fixed before final 3.2.0 release, but let's not hold d3f by it.
- Blocks deleted (Tasks #397: S3_2 datafileformat freeze (d3f))
Also available in: Atom
PDF