Skip to content

Workflow fixes, documentation reorganization, and LibTorch integration - #560

Merged
bHimes merged 24 commits into
timothygrant80:masterfrom
StochasticAnalytics:workflow_fix_and_tooling_updates
Oct 2, 2025
Merged

Workflow fixes, documentation reorganization, and LibTorch integration#560
bHimes merged 24 commits into
timothygrant80:masterfrom
StochasticAnalytics:workflow_fix_and_tooling_updates

Conversation

@bHimes

@bHimes bHimes commented Sep 30, 2025

Copy link
Copy Markdown
Collaborator

Description

This PR contains multiple improvements to cisTEM organized into three main areas:

1. Workflow System Fixes (GUI Stability)

Critical bug fix: Resolved workflow switching crashes and state management issues in the GUI.

Problem: Switching between workflows (SPA ↔ Template Matching) caused crashes due to improper panel state management and event handling.

Solution:

  • Fixed MatchTemplatePanel::FillGroupComboBox() crash by checking for null pointers before accessing workflow state
  • Improved workflow state tracking in MainFrame to ensure panels receive proper updates
  • Added comprehensive documentation of workflow architecture in src/gui/CLAUDE.md
  • Template matching results now correctly display in results panel after workflow switch

Impact: Users can now reliably switch between workflows without crashes.

2. Documentation Reorganization

Restructured CLAUDE.md documentation into hierarchical structure for better maintainability:

  • Root CLAUDE.md: Project overview and Claude Code persona
  • src/core/CLAUDE.md: Core library development guidelines
  • src/gui/CLAUDE.md: GUI development patterns and wxWidgets best practices
  • src/programs/CLAUDE.md: Command-line program development
  • scripts/CLAUDE.md: Build system and container management

Added comprehensive documentation on:

  • wxWidgets modern C++ practices (STL containers vs legacy wxArray)
  • Workflow system architecture and state management
  • Template matching panel implementation details

3. LibTorch Integration (ML Infrastructure)

Added optional LibTorch (PyTorch C++ API) support for implementing machine learning-based tools such as the blush regularization method for cryo-EM density map denoising.

Motivation: The blush tool (PR #541) requires LibTorch for running trained neural networks. Rather than requiring all users to have LibTorch installed, this PR implements LibTorch as an opt-in dependency that can be enabled at build time with --enable-libtorch.

Key Design Decisions

  1. Opt-in, not opt-out: LibTorch is disabled by default and must be explicitly enabled with --enable-libtorch
  2. Clean build system integration: Follows the FastFFT pattern with dedicated flags (LIBTORCH_CXX_FLAGS, LIBTORCH_LIBS) rather than modifying global compiler flags
  3. RPATH-based distribution: Uses $ORIGIN RPATH to support bundling LibTorch .so files with binaries for easy distribution
  4. Macro conflict resolution: Created include/libtorch/cistem_torch_helper.h wrapper to handle conflicts between cisTEM/wxWidgets macros and LibTorch headers

Technical Implementation

Build System (m4/libtorch.m4)

  • Autoconf macro AX_LIBTORCH detects LibTorch at /opt/libtorch or $LIBTORCH_ROOT
  • Sets AM_CONDITIONAL([ENABLE_LIBTORCH_AM]) for conditional compilation in Makefiles
  • Defines cisTEM_USING_LIBTORCH preprocessor macro for conditional code
  • Configures RPATH: $ORIGIN/lib, $ORIGIN/../lib, /opt/libtorch/lib

Container Infrastructure

  • LibTorch 2.5.0 CPU-only (cxx11 ABI) installed to /opt/libtorch
  • Added Python 3.10 venv with scientific computing packages (numpy, scipy, mrcfile, etc.)
  • Added documentation tooling (sphinx, doxygen, breathe)

Code Integration

  • include/libtorch/cistem_torch_helper.h: Wrapper header that handles macro conflicts using #pragma push_macro/#pragma pop_macro
  • Console test added to verify LibTorch linking and basic tensor operations
  • Test only compiled when LibTorch enabled (no skip logic needed)

Development Tools

  • New VS Code task: "BUILD cisTEM DEBUG with LibTorch"
  • Task automatically copies required .so files to build/dir/src/lib/ after build
  • Libraries copied: libtorch.so, libtorch_cpu.so, libc10.so, libgomp.so

Additional Changes

Build System Improvements

  • Moved autoconf m4 macros to m4/ directory for better organization
  • Files moved: ax_cuda.m4, additional_programs.m4, submodule_FastFFT.m4
  • Updated .gitignore with whitelist pattern for m4/ directory
  • Improved build system robustness

Template Matching Utilities

  • Added shell scripts for filtering and analyzing template matching results
  • scripts/filter_template_matches_to_group.sh: Filter matches to specific groups
  • scripts/list_template_match_info.sh: List template match information
  • Documentation in scripts/README_template_filtering.md

Fixes # (workflow switching crashes)
Related to PR #541 (blush tool - depends on LibTorch infrastructure)

I have rebased my feature branch to be current with the master branch

  • yes - branch is up to date with master
  • no

Which compilers were tested

  • g++
  • icpc (Intel C++ Compiler)
  • clang
  • other (please specify)

These changes are isolated to the

  • gui (workflow switching fixes, MainFrame, MatchTemplatePanel, ActionsPanels)
  • core library (include/libtorch/, src/Makefile.am)
  • gpu core library
  • program it modifies (console_test, match_template, projectx)
  • Build system (m4/, configure.ac, tasks.json)
  • Container infrastructure (scripts/containers/)
  • Documentation (CLAUDE.md files, template matching scripts README)

How has the functionality been tested?

  • Tested manually from GUI
    • Verified workflow switching between SPA and Template Matching works without crashes
    • Confirmed template matching results display correctly in results panel
    • Tested multiple workflow switches to ensure stability
  • Tested manually from CLI
    • Built with --enable-libtorch flag
    • Verified LibTorch detection and configuration
    • Confirmed RPATH configuration with ldd and readelf
    • Tested library bundling in build/src/lib/
    • Tested template matching utility scripts
  • Passed console tests
    • LibTorch test creates tensor [1,2,3,4], squares it, verifies result [1,4,9,16]
    • Test passes when LibTorch enabled
    • Test correctly excluded when LibTorch disabled
    • All existing console tests still pass
  • Passed samples functional testing (not yet run for this branch)
  • other:
    • Verified build without --enable-libtorch (default behavior unchanged)
    • Confirmed GUI stability improvements across multiple sessions
    • Tested that documentation changes don't affect builds

Checklist:

  • I have not changed anything that did not need to be changed
  • I have performed a self-review of my own code
  • I have commented my code, (w.r.t. why), particularly in hard-to-understand areas
    • Macro conflict handling documented in cistem_torch_helper.h
    • RPATH rationale explained in libtorch.m4
    • Build system patterns documented following FastFFT example
  • I have made corresponding changes to the documentation {Ok to pass for now}
    • TODO: User guide should document --enable-libtorch flag and LibTorch requirements
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Testing Instructions

Build with LibTorch (opt-in)

./regenerate_project.b
mkdir -p build/debug-libtorch && cd build/debug-libtorch
CC=icc CXX=icpc ../../configure --enable-debugmode --enable-libtorch
make -j16

# Copy libraries for distribution
mkdir -p src/lib
cp /opt/libtorch/lib/libtorch*.so* src/lib/
cp /opt/libtorch/lib/libc10.so* src/lib/
cp /opt/libtorch/lib/libgomp*.so* src/lib/

# Run console tests
./src/console_test

Build without LibTorch (default)

./regenerate_project.b
mkdir -p build/debug && cd build/debug
CC=icc CXX=icpc ../../configure --enable-debugmode
make -j16
./src/console_test  # LibTorch test will not appear

Verify RPATH

ldd src/console_test | grep torch  # Should show libraries from ../lib/
readelf -d src/console_test | grep RPATH  # Should show $ORIGIN paths

Future Work

  • Distribution bundling script to create relocatable packages
  • Documentation for users on LibTorch requirements and installation
  • Additional programs that use LibTorch (blush_regularization, etc.)
  • GPU version of LibTorch as optional alternative to CPU-only

Related PRs

bHimes and others added 13 commits September 29, 2025 18:27
… to unblur to make Decolace alignment work. I am going to immediately reset these files in the next commit, but wanted to stage them here for easy comparison/retrieval.
- Modernize additional_programs.m4 with reusable CISTEM_OPTIONAL_PROGRAM macro
- Fix calculate_template_pvalue to only build when Eigen library is present
- Improve tasks.json with absolute path error messages for IDE navigation
- Update CUDA configuration for newer architectures (sm_86, sm_89, sm_90)
- Enhance configure.ac with better MKL threading options

This fixes compilation issues in master where calculate_template_pvalue
required Eigen but was built unconditionally.
…This is not a sustainable solution, suggesting state be tracked only by main_frame.
…ation

After hours of debugging a tricky segfault during workflow switching, this commit:

Removes temporary debug code:
- Remove all wxPrintf debug statements used during troubleshooting
- Remove resolved FIXME comments
- Clean up unnecessary TODO comments

Adds comprehensive documentation explaining the fixes:
- Document why panel destructors must nullify global pointers
- Explain the critical sequence in SwitchWorkflowPanels
- Detail why null checks in Dirty*() methods prevent crashes
- Document global pointer lifecycle in workflow headers

The segfault was caused by dangling pointers after panel destruction during
workflow switching. The fix involves proper pointer nullification in destructors
and defensive null checks before any pointer access.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace debug assertion with graceful early return when no project is open.
This prevents crashes when switching from Single Particle to Template Matching
workflow, where the constructor is called during workflow transition when
the project state may be temporarily inconsistent.

Also fix syntax error in TemplateMatchQueueLogger.h QM_TRACE_DB_SCHEMA define.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Document comprehensive guidelines for using STL containers vs wxWidgets legacy containers,
memory management patterns for GUI vs non-GUI objects, and smart pointer usage.
Key findings from wxWidgets documentation research:
- Use STL containers (std::vector, std::deque) for all new code
- Use raw pointers for wxWindow-derived objects (parent-child model)
- Use smart pointers for non-GUI data structures
- Static members for persistent state across dialog instances

Also added build system clarifications and emphasis on reading full documentation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Split the monolithic root CLAUDE.md into context-specific files:
- src/gui/CLAUDE.md: wxWidgets safety, memory patterns, database access
- src/core/CLAUDE.md: Core library, image processing, mathematical ops
- src/programs/CLAUDE.md: CLI program patterns, independence from GUI/DB
- scripts/CLAUDE.md: Build system and utility script guidance

Root CLAUDE.md now focuses on high-level project guidance while
detailed technical documentation lives closer to relevant code.
This improves discoverability and reduces cognitive load when
working in specific areas of the codebase.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit implements LibTorch (PyTorch C++ API) integration as an
optional dependency for machine learning features such as the blush
regularization tool.

Key changes:

Build system:
- Add m4/libtorch.m4 autoconf macro for LibTorch detection
- LibTorch is opt-in via --enable-libtorch configure flag
- Set AM_CONDITIONAL and AC_DEFINE for conditional compilation
- Use LIBTORCH_CXX_FLAGS pattern (not direct CPPFLAGS modification)
- Configure RPATH with $ORIGIN for bundled library distribution
- Update src/Makefile.am to link LibTorch for enabled programs

Container infrastructure:
- Add LibTorch 2.5.0 CPU installation to top_image Dockerfile
- Add Python 3.10 venv and scientific computing packages
- Add documentation tooling (sphinx, doxygen)
- Update container version tags

Development tools:
- Add VS Code task for LibTorch-enabled debug builds
- Task automatically copies required .so files to build/src/lib/
- Include libtorch.so, libtorch_cpu.so, libc10.so, libgomp.so

Code infrastructure:
- Add include/libtorch/cistem_torch_helper.h wrapper header
- Helper handles macro conflicts (N_, NONE, TEXT, INTEGER, etc.)
- Clean interface for including torch headers in cisTEM code
- Add LibTorch test to console_test.cpp (only when enabled)

Build system reorganization:
- Move m4 macros to m4/ directory (ax_cuda, additional_programs, etc.)
- Update .gitignore for m4/ with whitelist pattern
- Simplify regenerate_project.b

The LibTorch integration uses dynamic linking with RPATH configuration
to support easy distribution bundling. Libraries are found via
$ORIGIN/lib, $ORIGIN/../lib, and /opt/libtorch/lib paths.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bHimes
bHimes requested a review from twagner9 September 30, 2025 15:02

@twagner9 twagner9 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this looks good, and I'm interested to see how well the persona specifications will improve the copilot output with Claude.

I just had a couple of questions as I was reviewing, once those are cleared up I'm good to approve!

Comment thread CLAUDE.md
@@ -0,0 +1,150 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that you can specify the persona and provide important context to the AI agent is very neat. Based on the other CLAUDE.md files, is it safe to assume that the is required to be CLAUDE.md to be picked up?

I know the placement of each is relevant to the persona set within the file, I was just wondering if it's possible to add details to the name of the .md so it's more clear what it specifies at a glance.

Comment on lines +17 to +49
#pragma push_macro("N_")
#pragma push_macro("NONE")
#pragma push_macro("TEXT")
#pragma push_macro("INTEGER")
#pragma push_macro("FLOAT")
#pragma push_macro("BOOL")
#pragma push_macro("LONG")
#pragma push_macro("DOUBLE")
#pragma push_macro("CHAR")

// Undefine conflicting macros
#undef N_
#undef NONE
#undef TEXT
#undef INTEGER
#undef FLOAT
#undef BOOL
#undef LONG
#undef DOUBLE
#undef CHAR

// Include LibTorch headers
#include <torch/torch.h>

// Restore all macros for use in cisTEM code
#pragma pop_macro("CHAR")
#pragma pop_macro("DOUBLE")
#pragma pop_macro("LONG")
#pragma pop_macro("BOOL")
#pragma pop_macro("FLOAT")
#pragma pop_macro("INTEGER")
#pragma pop_macro("TEXT")
#pragma pop_macro("NONE")

@twagner9 twagner9 Sep 30, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure I understand correctly, this is storing the cisTEM macros in a stack, un-defing them to avoid the conflicts in the LibTorch version, and then "re-defing" by popping them back off the stack.

Will this cause potential undefined behavior at runtime or compiler errors because the cisTEM defs will be present again, or do the macros that are brought in from the libtorch include become the only ones available because they were the first defined for the source file in which it's included?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. This is what should happen:

  1. the precompiled objects in the dynamic library are obv unaffected
  2. the precompileR will set aside those defines, then begin parsing the included statment, basically copy/pasting each line from the torch header into the top of console_test.cpp (well, a copy of that.) and as it goes it swaps out the defines for strings, just like if you typed it in.
  3. after the pc is done with its copy paste it resets those macros in whatever environment it uses to track defines.

Comment on lines +130 to +131
"chat.tools.terminal.autoApprove": {
"mkdir": true,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am assuming that this only prevents having to individually approve a series of actions, rather than default approving all changes made by the agent?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approves specific tools, and specifically blocks others. So non-destructive actions like grep are good to approve so you don't have to babysit as much. These rules are for github copilot chat specifically, so they can probably be deprecated. I doubt I'll be switching back. Happy to wait to see what you think of claude code first.

@@ -0,0 +1,170 @@
#!/bin/bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice modularity for the installation of tools/kits needed in the container; makes it very clear to follow.

Comment on lines +10 to +29
ActionsPanelSpa::~ActionsPanelSpa( ) {
// CRITICAL: Nullify all global panel pointers to prevent segfaults during workflow switching.
//
// When switching workflows (e.g., from Single Particle to Template Matching), the following sequence occurs:
// 1. The current ActionsPanelSpa and all its child panels are destroyed
// 2. These panels are wxWidgets children of ActionsBook, so they're automatically deleted
// 3. However, global pointers to these panels persist and become dangling pointers
// 4. Various MainFrame::Dirty*() methods may be called during or after workflow switch
// 5. These methods check panel pointers and try to set dirty flags if non-null
// 6. Without nullifying here, they would dereference freed memory → segfault
//
// This issue was particularly tricky because:
// - The segfault was inconsistent (depended on memory reuse patterns)
// - It often occurred several UI operations after the actual workflow switch
// - The crash location varied (any Dirty*() method could trigger it)
//
// By explicitly nullifying these pointers in the destructor, we ensure that:
// - Dirty*() methods safely skip destroyed panels (null check fails)
// - The new workflow can create fresh panel instances without conflicts
// - Memory access violations are prevented during the transition period

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I had noticed this error after the merge and was going to spend some time on it. I knew it was erroneous pointer management but hadn't spent enough time to track it down. I'm glad you were able to identify the problem despite the inconsistency, as that was what was throwing me.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the robot and I had a few shouting matches over it, but we sorted it out : )

Comment thread src/Makefile.am
Comment on lines +1 to +12
# cisTEM Makefile for src directory
#
# LibTorch Support:
# -----------------
# Programs requiring LibTorch (e.g., blush regularization) should add to their LDADD:
# program_LDADD = libcore.a $(WX_LIBS_BASE) $(MKL_LIBS) $(LIBTORCH_LIBS)
#
# And add RPATH flags to their LDFLAGS:
# program_LDFLAGS = $(LIBTORCH_RPATH)
#
# The LIBTORCH_RPATH setting enables bundling of .so files with the distribution.
# See m4/libtorch.m4 for configuration details.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice comment, this would be good practice going forward in case any other third-party limited scope libraries are used.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wasn't sure if it made more sense at the top or to have it near programs that rely on libtorch, but at the end of the day, it is there for a ctrl+shift+f (or better yet for an agent to find.)

@bHimes

bHimes commented Sep 30, 2025

Copy link
Copy Markdown
Collaborator Author

@twagner9 we could expand the console test, but i figured a simple tensor multiplication was sufficient for now.

twagner9
twagner9 previously approved these changes Sep 30, 2025
This commit implements a three-layer formatting enforcement system:

1. Pre-commit hook that checks C++/CUDA file formatting before commits
   - Installed via scripts/install_clang_format_hook.sh
   - Generates convenience script in /tmp to fix all issues at once
   - Excludes wxFormBuilder files and third-party headers

2. Auto-installation in regenerate_containers.sh
   - All developers get the hook automatically

3. CI workflow for final safety net
   - Checks all PRs and pushes to master/*_with_ci branches
   - Same exclusion rules as pre-commit hook

Excluded from formatting checks:
- include/ directory (third-party headers)
- src/gui/wxformbuilder/ (wxFormBuilder input files)
- Files with ProjectX_gui in name (wxFormBuilder generated)
- Files with "DO NOT EDIT" warning in headers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
bHimes and others added 8 commits October 1, 2025 11:56
…weren't caught locally because I cherry-picked the commit and did not run regenerate_containers.sh to actually add the hook locally)
Adds concurrency control to all workflow files to automatically cancel
in-progress runs when new commits are pushed to the same branch. This
prevents wasting CI resources on outdated builds.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updates all build workflows to run only after the formatting check passes,
preventing wasted CI resources on improperly formatted code. Changes include:

- Switch build workflows to use workflow_run trigger that waits for
  "Check C++ Formatting" to complete
- Add conditional to skip builds if formatting check fails
- Replace manual clang-format-14 installation with
  RafikFarhad/clang-format-github-action@v3 for faster execution
- Simplify check_formatting.yml by using pre-built action

This ensures formatting issues are caught immediately and prevents all
build jobs from running unnecessarily when formatting fails.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Apply clang-format-14 to files with formatting violations detected by
CI workflow. Changes include alignment adjustments and whitespace
normalization. Includes projectx.cpp which had persistent unformatted
changes that were never committed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Build workflows previously only triggered via workflow_run on push events
to master and *_with_ci branches. This caused builds to not run for pull
requests, even after formatting checks passed.

Add pull_request triggers to all build workflows to enable CI builds on
PRs targeting master or *_with_ci branches.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Build workflows were being skipped on pull_request events because the
conditional 'if: github.event.workflow_run.conclusion == success' only
evaluates true for workflow_run events.

Update conditional to run on either pull_request events OR successful
workflow_run events, enabling builds to run on PRs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Convert all build workflows from independent triggers to callable workflows
that are orchestrated by check_formatting.yml. This ensures formatting
always runs first and creates a clean dependency chain.

Changes:
- Convert all build workflows to use 'workflow_call' trigger
- Remove workflow_run and pull_request triggers from build workflows
- Update check_formatting.yml to call all build workflows after format check
- Remove conditional logic that's no longer needed

This fixes the issue where workflow_run triggers don't work on feature
branches and eliminates duplicate workflow runs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Remove concurrency groups from build workflows that are now called
as reusable workflows. These were causing deadlocks when the parent
workflow (check_formatting) tried to call multiple child workflows
with the same concurrency group pattern.

The concurrency control is now managed entirely by the parent workflow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bHimes

bHimes commented Oct 1, 2025

Copy link
Copy Markdown
Collaborator Author

Hey @twagner9

This string of commits just affects CI (and local git hooks). The files outside of those that are changed are just those that had escaped formatting with clang-format as we normally do. This is safe to re-approve, but happy to take any suggestions.

One of the reasons I've pushed to get a unified build env in vscode is to make sure tooling (like clang-format) is consistent. This commit drew attention to the fact that edits outside vscode escape the format on save. Small changes have been building up, but Claude's EDIT() task made this really come to light.

I've done the following in the last string of commits (it took quite a few to sort out an issue with the CI)

  1. Added a git hook that enforces the formatting on commit (locally) for appropriate files, ignoring include/ and wxFormbuilder files.
  2. Added a script to create that hook since it is not version controlled, and call that script from regenerate_containers.sh so other dev's (hopefully) automatically inherit the hook. This also gives you the command/files to fix.
  3. Added a GH action to act as a backstop to also check the formatting
  4. Re-worked the call tree so that all builds are children of check formatting, that way they do not run if the formatting fails.

The formatting fix script generated by the pre-commit hook now uses
absolute paths instead of relative paths, making it work correctly
from any directory location.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@twagner9

twagner9 commented Oct 2, 2025

Copy link
Copy Markdown
Collaborator

Hey @bHimes,

What you've laid out makes sense and I reviewed these changes and they look good.

Just to make sure I understand, the changes in .github/workflows/check_formatting.yml only apply to the CI on GitHub, while the script created in scripts actually implements and installs the logic in bash for the local pre-commit hook? This way the formatting is checked and applied where appropriate to avoid instances where clang-format didn't execute for whatever reason?

Overall this makes sense, only want to clarify since I haven't dug into CI logic too much at this point.

@bHimes

bHimes commented Oct 2, 2025 via email

Copy link
Copy Markdown
Collaborator Author

@bHimes
bHimes merged commit 1a39ccb into timothygrant80:master Oct 2, 2025
7 checks passed
twagner9 added a commit to twagner9/cisTEM that referenced this pull request Oct 8, 2025
-Rebased onto timothygrant80#560 to take advantage of some of the dev environment changes.
-Added submodule_Blush.m4 for conditional compilation of LibTorch/Blush routines.
-configure.ac: moved libtorch/blush conditions to submodule_Blush. Added submodule_Blush to configure.ac.
-Split cistem_torch_helper.h logic into two headers to allow for multiple includes from torch headers.
-refine3d.cpp: WIP; put blush in the refinement rather than the merge logic -- may give better results, and spares users from having to run generate 3D on a volume to get the non-blushed form.
-merge3d.cpp: remove blush logic
-GUI Panels: shifting blush around to the refine3d logic rather than merge3d; includes arguments changes in the IPC via the JobPackage class.
-Files in src/programs/blush_refinement: added the new format for splitting the logic for avoiding macro conflicts.
-console_test.cpp: added new format for splitting the logic for avoiding macro conflicts.
-Deleted blush_weights.dat
twagner9 added a commit to twagner9/cisTEM that referenced this pull request Oct 13, 2025
-Rebased onto timothygrant80#560 to take advantage of some of the dev environment changes.
-Added submodule_Blush.m4 for conditional compilation of LibTorch/Blush routines.
-configure.ac: moved libtorch/blush conditions to submodule_Blush. Added submodule_Blush to configure.ac.
-Split cistem_torch_helper.h logic into two headers to allow for multiple includes from torch headers.
-refine3d.cpp: WIP; put blush in the refinement rather than the merge logic -- may give better results, and spares users from having to run generate 3D on a volume to get the non-blushed form.
-merge3d.cpp: remove blush logic
-GUI Panels: shifting blush around to the refine3d logic rather than merge3d; includes arguments changes in the IPC via the JobPackage class.
-Files in src/programs/blush_refinement: added the new format for splitting the logic for avoiding macro conflicts.
-console_test.cpp: added new format for splitting the logic for avoiding macro conflicts.
-Deleted blush_weights.dat
@bHimes
bHimes deleted the workflow_fix_and_tooling_updates branch October 14, 2025 10:37
twagner9 added a commit to twagner9/cisTEM that referenced this pull request May 28, 2026
-Rebased onto timothygrant80#560 to take advantage of some of the dev environment changes.
-Added submodule_Blush.m4 for conditional compilation of LibTorch/Blush routines.
-configure.ac: moved libtorch/blush conditions to submodule_Blush. Added submodule_Blush to configure.ac.
-Split cistem_torch_helper.h logic into two headers to allow for multiple includes from torch headers.
-refine3d.cpp: WIP; put blush in the refinement rather than the merge logic -- may give better results, and spares users from having to run generate 3D on a volume to get the non-blushed form.
-merge3d.cpp: remove blush logic
-GUI Panels: shifting blush around to the refine3d logic rather than merge3d; includes arguments changes in the IPC via the JobPackage class.
-Files in src/programs/blush_refinement: added the new format for splitting the logic for avoiding macro conflicts.
-console_test.cpp: added new format for splitting the logic for avoiding macro conflicts.
-Deleted blush_weights.dat
twagner9 added a commit to twagner9/cisTEM that referenced this pull request May 28, 2026
-Rebased onto timothygrant80#560 to take advantage of some of the dev environment changes.
-Added submodule_Blush.m4 for conditional compilation of LibTorch/Blush routines.
-configure.ac: moved libtorch/blush conditions to submodule_Blush. Added submodule_Blush to configure.ac.
-Split cistem_torch_helper.h logic into two headers to allow for multiple includes from torch headers.
-refine3d.cpp: WIP; put blush in the refinement rather than the merge logic -- may give better results, and spares users from having to run generate 3D on a volume to get the non-blushed form.
-merge3d.cpp: remove blush logic
-GUI Panels: shifting blush around to the refine3d logic rather than merge3d; includes arguments changes in the IPC via the JobPackage class.
-Files in src/programs/blush_refinement: added the new format for splitting the logic for avoiding macro conflicts.
-console_test.cpp: added new format for splitting the logic for avoiding macro conflicts.
-Deleted blush_weights.dat
twagner9 added a commit to twagner9/cisTEM that referenced this pull request Jun 16, 2026
-Rebased onto timothygrant80#560 to take advantage of some of the dev environment changes.
-Added submodule_Blush.m4 for conditional compilation of LibTorch/Blush routines.
-configure.ac: moved libtorch/blush conditions to submodule_Blush. Added submodule_Blush to configure.ac.
-Split cistem_torch_helper.h logic into two headers to allow for multiple includes from torch headers.
-refine3d.cpp: WIP; put blush in the refinement rather than the merge logic -- may give better results, and spares users from having to run generate 3D on a volume to get the non-blushed form.
-merge3d.cpp: remove blush logic
-GUI Panels: shifting blush around to the refine3d logic rather than merge3d; includes arguments changes in the IPC via the JobPackage class.
-Files in src/programs/blush_refinement: added the new format for splitting the logic for avoiding macro conflicts.
-console_test.cpp: added new format for splitting the logic for avoiding macro conflicts.
-Deleted blush_weights.dat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants