Repository navigation
Releases
XinRefinement v1.7.0 — Amorphous hump component + recipe-path fixes
XinRefinement v1.7.0 — Release Notes
Released: 2026-11-14
Highlights
Amorphous hump component (opt-in)
Samples that contain a genuinely amorphous fraction (glass, fumed silica)
scatter a broad hump that a Bragg-only model cannot carry. The common
workaround — a denser background — silently eats intensity from overlapping
peaks. v1.7.0 adds a physical broad component instead:
RefineConfig.amorphous = ((center_deg, fwhm_deg), ...)andamorphous_eta
(pseudo-Voigt mixing, default 0.5); CLI--amorphous 22:9(repeatable /
comma-separated) and--amorphous-eta; the GUI background dialog gains an
"amorphous hump" group.- The hump amplitude is solved in the linear layer together with phase
scales and background, so it adds zero nonlinear parameters and cannot
steal degrees of freedom from the peak model. Center and FWHM are
user-supplied and intentionally not refined. - Disabled by default; with
amorphous=()every code path is bit-identical
to v1.6.4 (golden CLI Rwp still3.4074156640940005).
Recipe-path fixes
refine_asymis now a real switch (conclusion 7).RefineStep.config_for()
used to hard-coderefine_asym=(key == "profile")and ignore
RefineConfig.refine_asym, so passingrefine_asym=FalsetoRecipeRunner
still refined the asymmetry term (Rwp identical to the flag being on). The
field is now tri-state:None(default — reproduces the old numerical
path bit-for-bit),True(force on),False(force off). CLI gains
--no-refine-asym.- K30 fixed —
refine_etawas a dead parameter on the anisotropy path.
When Popa LB anisotropy is active,forward._accumulate_peaks()took η from
tch_eta()and ignoredProfileParams.eta, yet theprofilerecipe step
still refined it (sweeping η 0→1 changed Rwp by exactly 0 pt; all 7
benchmark samples run 100% through that TCH branch, and the GUI ships with
aniso_autoenabled, so the dead parameter sat on the product default
path).nonlinear.eta_is_active()now probes the cached peak list at
refine()entry and clearsrefine_etawhen no scalar-branch peak exists.
The computed pattern, Rwp and every refined parameter are bit-identical on
all 7 samples; onlyn_paramsdrops by one, which correctsRexp
(previously low by 0.0007–0.0015).
Honest benchmark notes (sample 7)
All of the following experiments were negative and are documented for
transparency rather than shipped as wins:
- Adding the amorphous hump at its known 22°/9° position: +0.109 pt Rwp
with QPA drifting 2.7 vol% → not adopted as a benchmark improvement. - A two-component "sharp core + broad wing" profile adds no expressive power
beyond a single pseudo-Voigt using only existing knobs (global FWHM ×0.85
plus η +0.3 reaches −1.379 pt). Rejected. ka_ratioscans top out at −0.142 pt (at 0.6); locking QPA retains 98% of
the dual-shape gain — so neither the Kα doublet nor phase-scale freedom is
the bottleneck.- Fixed-QPA + peak-shape check: free QPA 13.2234% → fixed QPA
14.9871% (constraint costs +1.7637 pt) → fixed QPA + η +0.2
13.9907% (shape gains −0.9964 pt). Net +0.7673 pt → fails.
QPA freedom (1.76 pt) is worth more than any profile knob can return, so
this family is structurally unviable while phase fractions stay free.
The remaining explanation for sample 7 is the structural model (the
bundled fluorite reference is an ideal CaF₂ CIF while the literature phase is
an anion-excess defect structure) — an input-data problem, not an engine
problem.
Quality
- Test suite: 596 passed / 0 failed / 0 skipped.
- Cross-checked against MAUD on 7 real samples; mean Rwp 11.030% vs MAUD
11.203%, every sample within tolerance.
Download
XinRefinement-1.7.0-setup.exe— Windows x64 installer (zh/en/ja).
Upgrade notes
- Registration: the production registration key is embedded in the release
build, so previously issued registration codes remain valid. - Only the installer is published; portable / internal evaluation builds are
not released.
XinRefinement v1.6.4 — Audit remediation batch 3 (robustness and read performance)
XinRefinement v1.6.4 — Audit remediation batch 3 (robustness + read performance)
Baseline
v1.6.3| Theme: the five findings from the 2026-11-11 global audit that
could be fixed without touching any numerical path — bounded recycling of the
project extraction directory, no more silent loss of a corrupt embedded result,
pattern loading reduced from 2–3 reads to 1, repeated e.s.d. evaluation collapsed
into one call, and stale step records no longer accumulating on a reused runner.Zero numerical change: engine and numerical paths untouched; the golden 50/50
case is still3.4074156640940005, CLI/API bit-for-bit unchanged.
Download
| File | Size | SHA256 |
|---|---|---|
XinRefinement-1.6.4-setup.exe |
75.3 MB | 258afa309558adfc18ca4a9bed3193213c2982b56006460291fae0a6f5b90701 |
Release installer (offline registration, zh/en/ja installer UI).
The internal portable build is for internal acceptance only and is not published.
What changed at a glance
| v1.6.3 | v1.6.4 | |
|---|---|---|
| Temp directory | one new directory per project revision under %TEMP%\xinrefinement_projects, never cleaned up |
bounded recycling: keep the newest 8 / 7 days / 512 MB; the directory currently in use is never removed |
| Corrupt embedded result | result panel silently went blank | status bar reports "result/refine.json could not be parsed and was ignored" |
| Opening a large pattern | the same file was read 2–3 times | read once (Shimadzu .txt 5 → 1, FullProf .dat 3 → 1) |
| Save project / export report | each recomputed e.s.d. (≈4p full-profile evaluations each, on the main thread) | computed once per refinement; failures are cached too |
| Reusing one runner | state.records accumulated, record count doubled |
cleared before the run, record count equals the step count |
Details
A07 · Bounded recycling of the .xinr extraction directory
Extraction directories are still named <stem>_<mtime> and still reused for the same
mtime; recycling runs after each extraction with three limits: newest 8 entries,
7 days, 512 MB total for the set. protect (the directory in use) is the only
absolute guarantee; keep is a count threshold only, so an entry inside the newest
8 but older than 7 days is still removed. Every OSError during cleanup is swallowed —
cleanup is a side job and must never break opening a project. A recycled project is
simply extracted again the next time it is opened (expected behaviour).
A08 · A corrupt result/refine.json is no longer silent
load_project() now returns a warnings list (the legacy .xrp path exposes the same
key with an empty list), and apply_project() appends each warning to the status bar
instead of showing a modal dialog. The caught exception set is still
UnicodeDecodeError / JSONDecodeError — it was not widened to Exception.
B07 · Single-read loading for legacy text patterns
.xy/.txt/.dat/.csv used to be read 2–3 times (text decode, a 4096-byte header sniff,
then another full read inside the vendored reader). Now the raw bytes are read once and
threaded down through four optional, defaulted arguments — head= / full_text= /
raw= / key= — so default call behaviour is bit-identical. Pattern.meta keys and
values, and the type and text of every parse error, are unchanged (verified by running
the HEAD implementation side by side, not by letting the tests grade themselves).
B02 · e.s.d. computed once instead of three times
MainWindow._esd_for() caches on id(res) + rwp + iters + id(_phases) + phase
names and cells. A failed None is cached as well — the failure path also costs 4p
full-profile evaluations, so retrying it is pointless. new_project() clears the cache.
The arguments and the numbers produced by estimate_esd() are untouched.
records · run_all() clears state.records before running
Re-running a single RecipeRunner accumulated the previous run's StepRecords
(record count doubled, rollback indices shifted). The list is now cleared in place, which
preserves the existing semantics of run_all returning the same list that rollback()
slices.
Upgrade notes
- Project files: the
.xinrformat is unchanged; v1.6.3 projects open directly.
warningsis a new key, and older versions simply ignore unknown keys. - Long-term use: stale session directories under
%TEMP%\xinrefinement_projects
older than 7 days or beyond the newest 8 are removed automatically. Your.xinr
files are never touched. - Known limits: when two processes open projects at the same time, the recycling
in process B may treat process A's session directory as "the 9th oldest" and remove
it (protectis only effective within its own process); and re-saving a project does
not carry over thewarningsseen when it was opened (a warning is a fact about that
particular load).
Build and reproducibility
- Build environment: Python 3.10.11 + PyInstaller 6.22.3.
SOURCE_DATE_EPOCHis taken
from commit7973d98(1794479509). - The executables are reproducible: same epoch, same source →
XinRefinement.exe
andXinRefinementCLI.exeare byte-identical across builds. - The installer is not reproducible: ISCC honours
SOURCE_DATE_EPOCHfor embedded
file times, but the PE header keeps the compiler stub timestamp, so two packagings of
the same input have the same size and different bytes. The published hash is
therefore the hash of the uploaded artifact — do not re-upload to chase the HEAD
timestamp. - The registration key is not in version control. Release builds inject it from
XR_REG_SECRETorxinrefinement/registration_secret.txt(gitignored) so that
previously issued registration codes keep validating; without a key the build falls
back to the community placeholder, which is the path taken by source builds and the
internal variant.
Verify
sha256sum XinRefinement-1.6.4-setup.exe
# 258afa309558adfc18ca4a9bed3193213c2982b56006460291fae0a6f5b90701Full regression: 579 passed / 0 failed / 0 skipped (v1.6.3 baseline 553; this
release adds 26 cases).
Note for developers: do not put pytest's
--basetempinside the repository working
tree.tmp_pathreuses and prunes numbered subdirectories, which in restricted
environments can trip a bulk-delete guard and raiseSystemExit: 1during fixture
setup, showing up as a wall of bogus ERRORs. Use--basetemp="$TEMP/xinr_...".
XinRefinement v1.6.3 — e.s.d. report value column fix and low-risk audit fixes
XinRefinement v1.6.3
Fix: e.s.d. report "Value" column (A11)
- Root cause:
EsdResultdid not store the true parameter values, so the "Value" column in text/JSON reports was incorrectly filled with e.s.d. - Fix: added a
valuesfield (concat(x_final, c), in strict same order aslabels); the text table now useszip(labels, values, esd), and JSON gainsvalues. The e.s.d. / covariance / correlation / content e.s.d. computation paths are all untouched.
Low-risk audit fixes (F01–F06, from the previous round of global code review)
- F01: the phase display name
name_mineralwas lost duringstructure_with_cell/ xyz step rebuild → display name degradation - F02: legacy
_unpackrebuild ofProfileParamsomittedsize_strain - F03:
_solve_rawinapi.report()omittedrefine_po, inconsistent withapi.refine() - F04:
.xinr/.xinmpattern serialization%.10g → %.17g, bit-for-bit identical on save/reopen - F05: CLI
-onow auto-creates a missing parent directory;to_reporttexture completion formodel/degree/coeffs - F06: step buttons still showed Chinese after a language switch → now uses
tr(f'step.{key}')
Tests
- De-flaked the cancellation run test: the cancellation predicate changed from an absolute wall clock
>0.15sto a residual checkpoint count, asserting the real contract (cancellation is not recorded as failed, and the unpromised precondition "at least one step completed" is no longer appended)
UI
- Splash screen shrunk to 800×600, and the version number text removed
Verification
- Full regression: 547 passed / 0 failed / 6 skipped (the 6 skips are due to environment tier differences — missing COD archive / gemmi / xinmatch on this machine — not a regression)
- golden CLI Rwp =
3.4074156640940005bit-for-bit unchanged - installer size 75.0 MB, sha256
184695ec1238773e1aedc7547e5b4072bdacadfd52025c968fe77839e3456ae4