Open
Description
If a task does not have dependencies, it's obviously a root task.
However, is_rootish
currently requires that the task also have > 2 * total_nthreads
other tasks in its TaskGroup. (The 2x is its own problem: #7273.)
This means some tasks which are clearly root tasks don't go down root-task code paths.
The consequences of this aren't obvious. They may not be particularly noticeable as a user. See #7221 (comment) for discussion of practical implications. My main concern so far is that this could be hiding untested and possibly incorrect behavior. (So there might be practical implications, we just haven't noticed them yet.)
- Many of our tests don't use root-task code paths, even when queuing is enabled, because they don't submit enough tasks. So whatever situations they're testing for (which presumably could happen with more tasks too) are un-tested with queuing on. At least 12 tests fail with queuing on when this problem is fixed; we don't know how many pass in both cases, but were not using the queuing code path and would not have caught a regression.
- More codepaths make reasoning harder. Combined with the fact that not all tests may be running, it's harder to avoid incorrect behavior at edge cases. Specifically, the round-robin code path doesn't get much explicit testing, is something we've already wanted to remove Simplify decide_worker #6974, and does not interact well with worker-saturation Round-robin worker selection makes poor choices with
worker-saturation > 1.0
#7197 — something CI didn't show until we tried changing the default.