Error exploded when I moved to wmf.9
FWIW, the constant does seem to be defined:
hphpd> var_dump(constant('NS_MODULE'));
var_dump(constant('NS_MODULE'));
int(828)Not sure what's happening, needs more investigation.