  Bulk solid state synthesis of nitride materials usually leads to
thermodynamically stable, cation-ordered crystal structures, whereas thin film
synthesis tends to favor disordered, metastable phases. This dichotomy is
inconvenient both for basic materials discovery, where non-equilibrium thin
film synthesis methods can be useful to overcome reaction kinetic barriers, and
for practical technology applications where stable ground state structures are
sometimes required. Here, we explore the uncharted Mg-W-N chemical phase space,
using rapid thermal annealing to reconcile the differences between thin film
and bulk powder syntheses. Combinatorial co-sputtering synthesis from Mg and W
targets in a N$_2$ environment yielded cation-disordered Mg-W-N phases in the
rocksalt (0.1< Mg/(Mg+W) <0.9), and hexagonal boron nitride (0.7< Mg/(Mg+W)
<0.9) structure types. In contrast, bulk synthesis produced a cation-ordered
polymorph of MgWN$_2$ that consists of alternating layers of rocksalt-like
[MgN$_6$] octahedra and nickeline-like [WN$_6$] trigonal prisms (denoted
"rocksaline"). Thermodynamic calculations corroborate these observations,
showing rocksaline MgWN$_2$ is stable while other polymorphs are metastable. We
also show that rapid thermal annealing can convert disordered rocksalt films to
this cation-ordered polymorph near the MgWN$_2$ stoichiometry. Electronic
structure calculations suggest that this rocksalt-to-rocksaline structural
transformation should also drive a metallic-to-semiconductor transformation. In
addition to revealing three new phases (rocksalt MgWN$_2$ and Mg$_3$WN$_4$,
hexagonal boron nitride Mg$_3$WN$_4$, and rocksaline MgWN$_2$), these findings
highlight how rapid thermal annealing can control polymorphic transformations,
adding a new strategy for exploration of thermodynamic stability in uncharted
phase spaces.
