Now generating dag graphs using a filter - visual inspection shows this is working correctly. Have temporarily disabled graph rendering in order to do profiling experiments.
Back to rendering dag graphs again - the proposed optimisation turned out to be a slight pessimisation, so I'll stick with the main line.