Repository navigation
XinMatch v1.7.1 — Code review follow-up
v1.7.1 — Code review remediation (maintenance release)
Version 1.7.0 → 1.7.1, no API breakage, no data migration. Full acceptance see docs/ACCEPTANCE-v1.7.1-20261018.md, item-by-item review and implementation plan see docs/CODE_REVIEW-20261018.md.
Defect fixes
- GUI search connection leak: every SQLite connection opened per search is now closed in
finally; when re-entering the busy window is rejected, the caller closes it as well. Long sessions no longer accumulate handles or hold the reference DB, which previously caused "rebuild/replace library" to fail. - High-angle peaks crashing search: when
d ≤ λ/2(backscatter limit, e.g. Mo/Ag-target data paired with Cu wavelength)math.asingoes out of range; now the peak is skipped and logged, and both 2θ window bounds are clamped. recall_max_candidatesfailed in restraints mode: broad constraints (e.g. "must contain O") scored tens of thousands of candidates in full; now it truncates consistently with other recall modes (intersected with d-value recall, then best selected).- Package unusable after
pip install: the wheel previously lackedschema.sqland the 3D-view resources (3dmol), failing at import; package data is now declared and read viaimportlib.resources, and CI added a packaging assertion. - Import failure with no dist metadata:
__version__gained a fallback constant. - Stale curve records after clearing pattern:
PatternView.clear()was shadowed by pyqtgraph's same-named instance attribute (a real bug), now fixed —patterns()no longer returns deleted curves.
Performance
- Candidate fetch N+1 → batched chunks: SQL round-trips for 3000 candidates dropped from 3000 to 7.
- Hanawalt top-K intensity cache now keyed by library fingerprint (mtime/size + lock + LRU(2)): rebuilding or replacing the reference DB no longer hits stale rankings.
- Result assembly normalized: added
fpfm.to_candidates(), GUI / batch / CLI now share the sameraw → CandidateResultmapping.
UX
- Opening large data files (
.raw/.brml/ large ASCII) no longer freezes the UI. - Long tasks are cancellable: FPFM full-profile fitting and similar operations show a "Cancel" button (cooperative interrupt, threads not force-killed).
- 5 placeholder toolbar actions are now functional: background subtraction / smoothing / Kα2 stripping / reset raw data / peak detection.
Engineering
- Added GitHub Actions CI (ubuntu + windows × Python 3.10/3.12: ruff + mypy + default tests + wheel resource assertions), with a local equivalent entry
tools/ci.ps1. slowmarkers completed and excluded by default:pytestnow runs directly; full numerical cases viapytest -m slow.- Removed the hardcoded
D:\Project\...default library path; SQLite URI and LIKE wildcard escaping; GSAS-II gpx backfill exceptions now logged, withGSAS2_HOMEoverride support. - Docs index
docs/README.md; data-backup cleanup scripttools/clean_data_backups.ps1(dry-run by default).
Acceptance numbers
ruff: All checks passed;mypy: 113 source files, 0 errors.- Default regression suite: 1297 items / 0 failures / 7 skipped (13.2 min, excluding slow).
- Frozen binary:
XinMatch.exe import --helpexit 0; internal variant registration self-check JSON correct.
Install
- Download
XinMatch-Setup-1.7.1.exeand install (install location selectable). - Download
xinmatch-cod-db-1.7.1.zip, extract into the install directory so the reference DB is atdata/cod_inorganics.db(the installer does not bundle the database, ~700 MB). - The internal evaluation build (no registration) is
XinMatch-Internal-1.7.1.zip, extract-and-use.
Known limitations
- The
slowsuite (turn-on least squares, GSAS-II real refinement, L3 acceptance) was not run this time; re-run separately withpytest -m slow. - The release variant's GUI self-check is blocked by the startup registration dialog in non-interactive sessions (same environment limitation as the v1.7.0 acceptance record), confirmed covered via variant markers + unit tests.
- Registration codes remain an HMAC "obfuscation-level" scheme (security boundary in
docs/PACKAGING.md); upgrading to asymmetric signing requires re-issuing codes.