arXiv:2608.22400cond-mat.mtrl-sciAug 2026

Manuscript Offprint

arXiv:2608.22400

Diagnosing and narrowing the simulation-to-real gap in powder X-ray diffraction with a wet-dry agentic loop

Shaoguang Wang, Weiyu Guo, Ben Fei, Xiaohong Shao, Zhihui Wang, Wanli Ouyang

Shaoguang Wang, 1^{1} Weiyu Guo, 1^{1} Ben Fei, 2^{2}

Xiaohong Shao, 3^{3} Zhihui Wang, 4,5^{4,5} Wanli Ouyang 2^{2}

1^{1}The Hong Kong University of Science and Technology (Guangzhou), Guangzhou, China.

2^{2}The Chinese University of Hong Kong, Hong Kong SAR, China.

3^{3}Suzhou National Laboratory, Suzhou, China.

4^{4}Shenzhen Loop Area Institute, Shenzhen, China.

5^{5}Dalian University of Technology, Dalian, China.

Powder X-ray diffraction (PXRD) is the routine probe of crystalline matter, yet its analysis is the rate-limiting step as laboratories automate acquisition. Deep-learning analyzers excel on simulated patterns and degrade on measured ones. This simulation-to-real gap is structural, not additive: synthetic denoising gives no measurable lift on real spectra, whereas correcting a small peak-position drift more than doubles median retrieval correlation. Real-spectrum fine-tuning, peak-aligned reranking, and recalibration narrow what remains and restore the coverage synthetic anchors lose. Xtalyst integrates these in an agent-orchestrated system spanning phase identification, refinement, and calibrated property prediction. On a frozen held-out partition (n=534) each module measured on both splits reproduces its development finding—including the synthetic-anchor under-coverage, whose magnitude differs between the two pools—while held-out refinement converges and preserves symmetry without reaching profile-quality fits, and on a diffractometer its wet-dry recommend-rescan-reanalyze loop flips a blinded silicon standard to a gated PASS and changes which minor phase is resolved on a multi-metal alloy.

Powder X-ray diffraction (PXRD) is the predominant routine probe of crystalline matter, supplying phase identity, lattice parameters, microstructure, and, when coupled with full-profile refinement (1, 2), quantitative phase composition for materials chemistry, metallurgy, mineralogy, pharmaceuticals, and energy storage. Yet the value locked in a powder pattern is released only through an analytical workflow that begins with phase identification, proceeds to Rietveld refinement of lattice parameters and atomic positions (as implemented in established packages such as GSAS-II (3), FullProf (4), and TOPAS (5)), and ends in downstream property estimation. This workflow has historically been operator-intensive, with expert time dominating both interpretation and quality control (6). Laboratory automation has accelerated the acquisition of powder patterns far faster than their interpretation, so that analysis, still manual, time-consuming, error-prone, and difficult to scale, is now widely identified as the rate-limiting human step in high-throughput and autonomous-laboratory campaigns (7, 8). The bottleneck is acute on multi-phase samples, on broader-chemistry minerals where chemical-system (chemsys)-restricted libraries do not pin down a unique phase, and on low-symmetry triclinic or monoclinic cells whose refinement loss landscape is shallow and populated by local minima.

An automated PXRD analysis that is deployable on real measured spectra, calibrated with quantified uncertainty, and traceable end-to-end would remove this bottleneck, turning a laboratory scan, optionally accompanied by a composition or crystal-system prior, into a vetted structure-and-property answer. The obstacle to that goal is not any single algorithm but the reliability of the whole analysis chain on measured, rather than simulated, data.

Deep learning has rapidly entered every stage of this workflow. End-to-end convolutional and attention models now address phase identification on single and multi-phase patterns (7–13); crystal-system and space-group classifiers operate on stick patterns or full profiles (14–17); and a growing body of generative models attempts direct PXRD-to-structure mappings (18–25). Substantial progress on simulated test splits is well documented: correlations against synthetic targets routinely exceed 0.9, and per-class accuracy on synthetic crystal-system tests exceeds 90% for the most common systems. Performance on measured spectra decays sharply. On a representative subset of the recently released opXRD corpus of measured minerals (26), the median peak-aligned Pearson correlation (a pattern-to-pattern match scored after correcting a small rigid 2θ2\theta peak-position offset) between top-1 retrieval candidates and the observed pattern is 0.21 before any of the interventions reported here, and a synthetic-trained crystal-system classifier (a one-dimensional convolutional neural network trained on Materials Project stick patterns, our own pre-fine-tuning checkpoint) scores 27.5% on real RRUFF spectra (27) against 44.1% on clean simulated patterns rendered from held-out structures through the same code path (n=399), its own simulated ceiling; the > 90% values quoted above are reported by larger models on their own simulated splits and are not reproduced here (Fig. 1). This simulation-to-real gap, not any individual model’s accuracy, is the dominant source of unreliability in a deployed PXRD deep-learning pipeline, yet it is rarely quantified end-to-end on real measured spectra.

This work makes three contributions, each established on real measured spectra: two concern the nature of the simulation-to-real gap, and the third is the end-to-end system that operationalizes them. First, we show that the gap is structural rather than additive. A one-dimensional denoiser that performs as designed on its synthetic task yields no measurable lift on real opXRD spectra (statistically equivalent to zero within a ±0.05\pm0.05 correlation margin), whereas correcting a small rigid peak-position drift is the single largest correctable component and more than doubles the median retrieval correlation (the full intervention sequence is summarized in fig. S1). This finding redirects effort away from noise removal and toward alignment and real-data adaptation. Second, we find that the uncertainty layer inherits the same gap. A conformal calibration built on synthetic anchors under-covers measured spectra, on held-out as well as development data, and recalibrating on real spectra recovers near-nominal coverage on a disjoint development calibration. This calibration failure on real spectra, to our knowledge not previously quantified end-to-end in a deployed PXRD pipeline, is the most transferable of our findings: it applies to any spectroscopic pipeline that ships synthetic-calibrated conformal intervals. Third, turning these findings into a deployable capability, we build Xtalyst, an end-to-end multi-agent PXRD pipeline that—to our knowledge, the first to do so—closes the loop from a raw measured spectrum through phase identification, full-profile refinement, quantitative phase analysis, and calibrated property prediction under cross-stage reliability gates, with every design choice reported against the quantified negative result it displaced (the system and its newly introduced components are detailed below).

The mismatch between simulated training distributions and measured deployment distributions is not unique to PXRD. Spectroscopy domains adjacent to ours have named the phenomenon explicitly and built it into the design loop: radiation spectroscopy reports a synthetic-trained source classifier improving from 75% to 96% after a 64-spectrum real-data fine-tune (28); foundation models for stellar spectra fine-tune on real observational data to bridge a synthetic gap (29); magnetic-resonance spectroscopy narrows a simulation-to-real gap through physics-informed augmentation of the simulated training distribution (30); reconstructive spectroscopy reports the same trend (31); and seismic imaging deploys explicit synthetic-to-real domain adaptation (32). The remedy that recurs across these domains is real-data adaptation, whether by fine-tuning or by augmentation, of synthetic-pre-trained models. PXRD has lacked an equivalent systematic study that quantifies the gap on real measured spectra, identifies its dominant cause, and demonstrates what intervention most narrows it.

Three further gaps limit the PXRD deep-learning evidence base. First, most reported systems address a single task, whether crystal-system classification (15–17), phase identification (9, 12, 13), or generative structure proposal (18, 19, 22, 24). End-to-end pipelines that combine identification, refinement, quantitative analysis, and property estimation in a single tested system are rare. The closest concurrent work, Dara (33), automates multiple-hypothesis phase identification by adjudicating candidate phase combinations against real refinement residuals rather than against a learned classifier, and demonstrates it at scale in an autonomous synthesis laboratory; it stops deliberately short of detailed structural refinement. It therefore supports, independently, the principle our profile gate applies—that a refinement residual rather than a classifier score should arbitrate whether a phase assignment is trustworthy—while sitting upstream of the refinement and property layers evaluated here. Second, calibrated reliability with formal coverage guarantees on real measured spectra is correspondingly rare. The dominant uncertainty mechanism reported in PXRD deep-learning work is Bayesian or Monte-Carlo-dropout ensembling (17); distribution-free conformal prediction, which wraps any predictor with a finite-sample coverage guarantee (34–37), is widely used in adjacent scientific domains but, to our knowledge, has not been calibrated on real-mineral PXRD with the explicit question of whether the calibration itself transfers across the synthetic-real domain shift (38–40). Third, multi-agent and large-language-model (LLM)-orchestrated systems for chemistry and materials (41–43) have had limited uptake in PXRD, and we are aware of no published PXRD-specific multi-agent system that closes the loop from raw spectrum to evaluated structure and property. A concurrent agentic platform for electron microscopy, EMSeek (44), adopts a similar high-level design (autonomous microservices, provenance tracking, and a gated mixture-of-experts (MoE) predictor) for a different modality. Our primary contribution is the diagnosis of the simulation-to-real gap and the finding that the calibrated-uncertainty layer inherits it; our system contribution is distinct from EMSeek in both modality and design, comprising PXRD-specific chemistry-aware tiered retrieval, cross-stage reliability gates, and a recommend-rescan-reanalyze loop closed on a real diffractometer.

Integrating these stages into a single multi-agent system, rather than running the individual tools independently, is a deliberate design choice with concrete value on real measured data. An integrated chain enforces end-to-end reliability that no isolated tool can: three separately reported cross-stage reliability gates, namely a symmetry gate (space-group preservation), a profile-quality gate ( Rwp/RpR_{wp}/R_{p}), and an energy-plausibility gate (formation energy within a conformal interval), are checked across stage boundaries, and a bounded replan loop reacts to a failed gate before the result is reported. We report these gates separately because they can disagree; a refinement can converge and preserve symmetry yet still fit the profile poorly. The chain also makes the analysis traceable: an append-only provenance trace records every tool call, validator decision, and rationale for a given spectrum, so a downstream conclusion can be audited back to its inputs. And it reduces operator burden by converting raw outputs into vetted, gated decisions and operator-facing recommendations rather than leaving cross-tool reconciliation to manual expert effort. These are reliability, provenance, and human-effort arguments. We do not optimize for or benchmark throughput; as an order-of-magnitude characterization only, end-to-end analysis of a single-phase pattern runs in minutes on a single CPU host, dominated almost entirely by the full-profile refinement (phase identification and formation-energy inference are sub-second to a few seconds each), so we make no state-of-the-art speed claim.

We address these gaps with a system that operationalizes the two findings above. Xtalyst is a multi-agent end-to-end PXRD pipeline covering tiered phase identification, whole-pattern lattice-parameter refinement, quantitative per-phase abundance analysis, formation-energy prediction with conformal uncertainty, and post-chain agents for polymorph disambiguation and experiment recommendation. It integrates established components for property prediction (CHGNet (45)) and refinement (PyWPEM (46)), and augments the open intensity-only phase identifier CPICANN (12) with a peak-aligned reranker that lifts its development median Pearson by +74%; XtalCS, our real-RRUFF fine-tuned crystal-system classifier, lifts accuracy from 26.5% (synthetic pre-training) to 49.8% on the same development split (n=313) and 49.4% on a frozen held-out split (n=251). Throughout, where we build on existing components we cite and credit them; where we extend them, through peak-aligned reranking, real-spectrum fine-tuning, and real-spectrum conformal recalibration, we report the extension and its measurable effect on the same frozen held-out data used for the rest of the evaluation. Each negative result we report is presented as the evidence for the production choice it determined, with sample sizes stated throughout; we deliberately do not pursue single-algorithm state of the art.

Results