Geometry shaders not passing flat data properly

First and foremost, if somebody could take the time (on non mesa intel w/ dri drivers) to verify the behavior I’m getting, that might save a whole lot of debugging and discussion. This code gives me a red triangle and a purple line, where it should be giving me a green triangle and purple line. It sometimes looks as though it gets it right for a few frames. (FYI I’m compiling with gcc -ggdb -lGL -lSDL2).

The color of the triangle is determined by a uint specified in the vertex shader, which is also entirely responsible for laying out the vertices on the screen (based on gl_VertexID). My geometry shaders aren’t passing the flat uint data through properly - sometimes. I’ve annotated several unexpected spots in the code where changes cause the behavior to become seemingly-correct (the annotations are comments containing “the triangle renders green”).

If somebody could help me figure out first of all whether this is a graphics driver bug, and if not, help me figure out why my geometry shaders are so belligerent, I’ll love you forever. Days have been spent just getting it down to this “minimal” repro.