Graphical abstract Highlights • Structural variations are diverse between wild buckwheat and landraces • The presence of FtRNH in wild accessions is associated with high-altitude adaptability • Structural variations in FtPLATZ are linked to seed-size variations • An ideal highland buckwheat is developed by integrating superior alleles Correspondence heyuqi@caas.cn (Y.H.), liuxu03@caas.cn (X.L.), rajeev.varshney@murdoch.edu.au (R.K.V.), liujq@nwipb.cas.cn (J.L.), zhoumeiliang@caas.cn (M.Z.) In brief A Tartary buckwheat pangenome is constructed, allowing identification of the wild-specific gene FtRNH conferring high-altitude adaptation, as well as FtPLATZ structural variants controlling seed size. By combining these superior alleles, buckwheat lines are developed with enhanced high-altitude adaptability and improved field yields. Himalayan Wild buckwheat Landrace High-altitude ideal buckwheat + +++ + ++ +++ +++ High-altitude Low-altitude PLATZ copy-number variation RNH RNH without RNH Himalayan Wild Low-altitude Landrace Himalayan Wild Low-altitude Landrace UV-B Cold 994 NGS resequenced accessions HW SL NL ZK3 Structural variation Pangenome Crop improvement