Heterogeneous Stress Driven by Environmental Filtering Maintains Plant Diversity Along an Arid Riparian Gradient

Environmental stress is generally expected to suppress biodiversity, yet how heterogeneous environmental filtering regulates plant community assembly in arid riparian ecosystems remains poorly understood. Here, we investigated herbaceous plant communities and associated soil factors along riparian environmental gradients of the Ulungur River in arid northwestern China, aiming to assess whether and how severe but spatially heterogeneous stress conditions can maintain high local diversity. Non-metric multidimensional scaling (NMDS), generalized linear models (GLM), and random forest regression were used to disentangle the relative contributions of spatial location and soil stress in shaping species turnover and diversity patterns. Our results showed that local plant alpha diversity unexpectedly peaked in downstream river segments characterized by severe soil salinization-alkalization and phosphorus limitation (pH up to 8.88, total phosphorus as low as 0.70 g/kg), challenging the widespread negative stress-diversity relationship. NMDS ordination revealed pronounced species turnover along the riparian gradient, with the greatest spatial dispersion observed in upstream plots (mean Bray-Curtis dissimilarity = 0.569) due to high habitat heterogeneity. GLM further revealed that elevation was the strongest common negative factor for all diversity metrics (standardized coefficients beta < -0.5, all p < 0.001), whereas soil organic carbon (SOC) and cation exchange capacity (CEC) had independent positive effects on halophyte richness. The random forest results corroborated the GLM findings and suggested that pH and total phosphorus influence diversity through non-linear or interactive effects. Functional group analyses demonstrated that downstream communities were predominantly assembled from a distinct pool of stress-tolerant halophytic species. Together, these findings suggest that multidimensional and spatially heterogeneous stress landscapes can maintain high local plant diversity by selectively filtering species with specific tolerance strategies while enhancing spatial species turnover. Our study highlights the critical role of environmental filtering in sustaining biodiversity under severe conditions and provides new insights into community assembly processes in arid riparian ecosystems.