Refinement restraints: n_slots, not slots - Qt defines slots as a macro, which broke the viewer's build through Rugnux.h
Build Packages / Create release (push) Successful in 8s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 5m21s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 10m42s
Build Packages / build:portable:linux-x86_64:cuda (push) Failing after 14m59s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 20m37s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 23m21s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 23m43s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 27m30s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 28m21s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 29m50s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 32m0s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 24m33s
Build Packages / Generate python client (push) Successful in 32s
Build Packages / Build documentation (push) Successful in 1m8s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 27m31s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 28m26s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 28m6s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 22m30s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 28m12s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 25m20s
Build Packages / Unit tests (push) Successful in 1h36m6s
Build Packages / Validation Battery (push) Successful in 34m44s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-25 10:22:02 +01:00
1 parent d3673d17fc
commit f077320efa
5 files changed
+11 -11

No files matched your search

@@ -204,7 +204,7 @@ public:
}
void SetRestraints(int which, const RestraintSet &set) override {
engine_->SetRestraints(which, set.records, set.plane_atoms, set.slot_start, set.slot_index, set.slots);
engine_->SetRestraints(which, set.records, set.plane_atoms, set.slot_start, set.slot_index, set.n_slots);
}
double EvaluateRestraints(int which, const std::vector<std::array<double, 4>> &xyzb,
@@ -625,7 +625,7 @@ double RefinementGPUEngine::Evaluate(std::vector<std::array<float, 4>> *grad) {
void RefinementGPUEngine::SetRestraints(int which, const std::vector<RestraintRecord> &records,
const std::vector<int> &plane_atoms, const std::vector<int> &slot_start,
const std::vector<int> &slot_index, int slots) {
const std::vector<int> &slot_index, int n_slots) {
RefinementGPUEngineImpl &e = *impl_;
DeviceGuard guard(e.device);
RefinementGPUEngineImpl::Restraints &r = e.restraints[which];
@@ -639,7 +639,7 @@ void RefinementGPUEngine::SetRestraints(int which, const std::vector<RestraintRe
Ensure(r.plane_atoms, r.cap_planes, plane_atoms.size());
Ensure(r.slot_start, r.cap_start, slot_start.size());
Ensure(r.slot_index, r.cap_index, slot_index.size());
Ensure(r.contrib, r.cap_slots, static_cast<size_t>(slots));
Ensure(r.contrib, r.cap_slots, static_cast<size_t>(n_slots));
Ensure(r.xyzb, r.cap_xyzb, r.atoms);
Ensure(r.grad, r.cap_atoms, r.atoms);
if (!r.sum)
@@ -65,7 +65,7 @@ public:
// Restraint set `which` (0 or 1), as RestraintSet holds it.
void SetRestraints(int which, const std::vector<RestraintRecord> &records, const std::vector<int> &plane_atoms,
const std::vector<int> &slot_start, const std::vector<int> &slot_index, int slots);
const std::vector<int> &slot_start, const std::vector<int> &slot_index, int n_slots);
// The sum of E of set `which` at `xyzb` (x, y, z, B per atom) and dE/d(x, y, z, B) per atom.
double EvaluateRestraints(int which, const std::vector<std::array<float, 4>> &xyzb,
std::vector<std::array<float, 4>> *grad);
@@ -96,25 +96,25 @@ V3<double> FromImage(const RestraintRecord &r, V3<double> g) {
} // namespace
void RestraintSet::Add(RestraintRecord r, int n_atoms_of_r) {
r.slot = slots;
slots += n_atoms_of_r;
r.slot = n_slots;
n_slots += n_atoms_of_r;
records.push_back(r);
}
void RestraintSet::Append(const RestraintSet &other) {
const int plane_offset = static_cast<int>(plane_atoms.size());
for (RestraintRecord r : other.records) {
r.slot += slots;
r.slot += n_slots;
if (r.kind == static_cast<int>(RestraintKind::Plane))
r.atom[0] += plane_offset;
records.push_back(r);
}
plane_atoms.insert(plane_atoms.end(), other.plane_atoms.begin(), other.plane_atoms.end());
slots += other.slots;
n_slots += other.n_slots;
}
void RestraintSet::Finalize(size_t n_atoms) {
slot_atom.assign(slots, -1);
slot_atom.assign(n_slots, -1);
for (const RestraintRecord &r : records) {
if (r.kind == static_cast<int>(RestraintKind::Plane)) {
for (int k = 0; k < r.atom[1]; k++)
@@ -136,7 +136,7 @@ void RestraintSet::Finalize(size_t n_atoms) {
slot_start[a + 1] += slot_start[a];
slot_index.assign(slot_start[n_atoms], 0);
std::vector<int> fill(slot_start.begin(), slot_start.end() - 1);
for (int s = 0; s < slots; s++)
for (int s = 0; s < n_slots; s++)
if (slot_atom[s] >= 0)
slot_index[fill[slot_atom[s]]++] = s;
}
@@ -26,7 +26,7 @@
struct RestraintSet {
std::vector<RestraintRecord> records;
std::vector<int> plane_atoms;
int slots = 0;
int n_slots = 0;
std::vector<int> slot_start; // n_atoms + 1
std::vector<int> slot_index;