r3051: give pipeline stages context

should make hazards easier to deal with.