WIP: make directive order deterministic for directives with same priority