  We initiate a systematic study of non-planar on-shell diagrams in N=4 SYM and
develop powerful technology for doing so. We introduce canonical variables
generalizing face variables, which make the dlog form of the on-shell form
explicit. We make significant progress towards a general classification of
arbitrary on-shell diagrams by means of two classes of combinatorial objects:
generalized matching and matroid polytopes. We propose a boundary measurement
that connects general on-shell diagrams to the Grassmannian. Our proposal
exhibits two important and non-trivial properties: positivity in the planar
case and it matches the combinatorial description of the diagrams in terms of
generalized matroid polytopes. Interestingly, non-planar diagrams exhibit novel
phenomena, such as the emergence of constraints on Plucker coordinates beyond
Plucker relations when deleting edges, which are neatly captured by the
generalized matching and matroid polytopes. This behavior is tied to the
existence of a new type of poles in the on-shell form at which combinations of
Plucker coordinates vanish. Finally, we introduce a prescription, applicable
beyond the MHV case, for writing the on-shell form as a function of minors
directly from the graph.
