ok so you have spark , but still no start , ok so next you need to check is there high pressure fuel at the fuel rail , disconnect the fuel hose at the reg end and crank it over .
if fuel is there , are the fuel injectors ticking when you crank the engine ??
you may have spark but is it in time ? check with a timing light ?
is it being over fuelled ? black smoke ?
when it stalls , bang the ecu box with handle of a screw driver ? so if it starts ?
did you check the distance from the flywheel trigger to the crank sensor (the rear one)
is the trigger solid mounted to the flywheel , not cracked welds etc