test_runner: introduce NODE_TEST_WORKER_ID for improved concurrent te… by 0hmX · Pull Request #56091 · nodejs/node
I'm concerned this has too much cross-over with threadId, for which the lack of sequentiality guarantee is likely reasoned—sequentiality likely would have been trivial to facilitate. I don't know who within our collaborators has that context though (maybe Anna?).
If there is a good reason behind making threadId non-sequential, I suspect this will be subject to that same rationale.
If there is not a particular rationale for the non-sequentiality of threadId, perhaps it would be better to guarantee that instead of creating a quasi-redundant mechanism.
The problem described in the cited issue is well handled via threadId when a complementary design is applied (which, IMO, is better than the attempted design the OP is trying to facilitate—which may well have been necessary in the environment in which it was created).
If we're merely trying to facilitate migration, I think we should first consider that point and whether there is a way to ease that migration without redundancy.
Without seeing the OP's code, I can only imagine what it looks like, but I suspect perhaps less than 20% would need to be adjusted. Likely the biggest hindrance is knowledge, which can be provided (ex a Learn article).