The current shard-level cache invalidation strategy fails when multiple rooms need a matrix recalculated. The first room to need a new matrix gets one, but subsequent rooms that need a new matrix in the same tick are stuck with a cached result that should be invalidated but won't be, because all rooms are sharing the same invalidation variable. This change gives each room its own cache invalidation variable.
The current shard-level cache invalidation strategy fails when multiple rooms need a matrix recalculated. The first room to need a new matrix gets one, but subsequent rooms that need a new matrix in the same tick are stuck with a cached result that should be invalidated but won't be, because all rooms are sharing the same invalidation variable. This change gives each room its own cache invalidation variable.