spindle: the blind-cone score compiles on MSVC, and the report version test says 7
Build Packages / build:rugnux:aarch64 (cross) (push) Successful in 8m33s
Build Packages / build:windows:nocuda (push) Successful in 17m35s
Build Packages / build:rugnux-tgz (x86_64) (push) Successful in 18m20s
Build Packages / build:windows:cuda (push) Successful in 20m2s
Build Packages / build:viewer-tgz:cpu (push) Successful in 20m44s
Build Packages / build:viewer-tgz:cuda (push) Successful in 22m50s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 22m54s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 27m16s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 28m0s
Build Packages / build:rugnux:windows (push) Successful in 11m0s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 21m4s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 21m53s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 27m49s
Build Packages / build:rpm (rocky9) (push) Successful in 24m33s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 23m32s
Build Packages / Generate python client (push) Successful in 30s
Build Packages / build:rpm (rocky8) (push) Successful in 30m22s
Build Packages / Create release (push) Skipped
Build Packages / Build documentation (push) Successful in 1m4s
Build Packages / XDS test (durin plugin) (push) Successful in 11m14s
Build Packages / DIALS test (push) Successful in 25m29s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 28m20s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 10m17s
Build Packages / XDS test (neggia plugin) (push) Successful in 9m2s
Build Packages / Unit tests (push) Successful in 1h28m14s

Two CI failures from the spindle series, both self-inflicted.

The severity used M_PI, which is not standard and which MSVC does not define, in a
file under image_analysis - a tree the Windows viewer builds. common/JFJochMath.h
exists for exactly this and is now included. The same defect was found and fixed in
the post-refinement residual earlier in the day; the grep that confirmed it looked at
a worktree that did not yet carry this file, so the second instance survived.

The report-version test pins the version deliberately - adding a key to the report is
a contract change and that line is where it has to be acknowledged - but the key added
with the spindle report keys bumped the constant to 7 without the test following.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
This commit is contained in:
leonarski_fandClaude Opus 5 committed 2026-09-04 20:00:20 +02:00
1 parent 77a8a07c51
commit 7e7103f49f
2 files changed
+9 -6

No files matched your search

@@ -6,6 +6,8 @@
#include "SpindleBlindFraction.h"
#include "../../common/JFJochMath.h" // PI - M_PI is not standard, and MSVC does not define it
namespace {
// Only rows short enough to be a plausible symmetry axis count. The cut is relative to the
// crystal's own shortest row, not an absolute length, so it works the same for a 40 A cell and
@@ -32,7 +34,7 @@ float SpindleThetaMax_deg(float wavelength_A, float d_min_A) {
if (wavelength_A <= 0 || d_min_A <= 0)
return 0;
const float sin_theta = std::min(1.0f, wavelength_A / (2.0f * d_min_A));
return static_cast<float>(std::asin(sin_theta) * 180.0 / M_PI);
return static_cast<float>(std::asin(sin_theta) * 180.0 / PI);
}
float BlindConeSelfOverlap(float x) {
@@ -40,7 +42,7 @@ float BlindConeSelfOverlap(float x) {
return 0.0f;
if (x <= 0.0f)
return 1.0f;
return static_cast<float>(2.0 / M_PI) *
return static_cast<float>(2.0 / PI) *
(std::acos(x) - x * std::sqrt(1.0f - x * x));
}
@@ -91,7 +93,7 @@ std::optional<SpindleSeverity> SpindleBlindFraction(const std::vector<Coord> &ro
const auto consider = [&](const Coord &direction, float row_length_A) {
const float len = direction.Length();
const float cos_beta = std::min(1.0f, std::fabs(direction * axis) / len);
const float beta_deg = static_cast<float>(std::acos(cos_beta) * 180.0 / M_PI);
const float beta_deg = static_cast<float>(std::acos(cos_beta) * 180.0 / PI);
// A direction PERPENDICULAR to the spindle is as damaging as one along it, and far more
// common: a lone 2-fold about it carries the blind cone onto the cone's opposite lobe, which
// the same sweep leaves equally unmeasured. That is Friedel's rescue, which is no rescue -
@@ -159,7 +161,7 @@ std::optional<SpindleSeverity> SpindleBlindFractionFromLattice(const CrystalLatt
[](const Coord &a, const Coord &b) { return a.Length() < b.Length(); });
constexpr size_t MAX_LATTICE_ROWS = 6;
const float cos_5_deg = std::cos(5.0f * static_cast<float>(M_PI) / 180.0f);
const float cos_5_deg = std::cos(5.0f * static_cast<float>(PI) / 180.0f);
std::vector<Coord> rows;
for (const auto &r : all) {
if (rows.size() >= MAX_LATTICE_ROWS
+3 -2
View File
@@ -68,8 +68,9 @@ TEST_CASE("ResultReport_Render", "[Diagnostics]") {
const auto text = RenderResultReport("prefix", "in.h5", x, result);
// The stable keys a consumer greps for.
CHECK(text.find("\nREPORT_VERSION= 6\n") != std::string::npos);
// The stable keys a consumer greps for. The version is pinned on purpose: a key added to the
// report is a contract change, and this line is where it has to be acknowledged.
CHECK(text.find("\nREPORT_VERSION= 7\n") != std::string::npos);
CHECK(text.find("\nOUTPUT_PREFIX= prefix\n") != std::string::npos);
CHECK(text.find("\nINDEXING_RATE= 0.8700\n") != std::string::npos);
CHECK(text.find("\nSPACE_GROUP_NUMBER= 96\n") != std::string::npos);