Skip to content

feat(prj): remove fmt+spdlog for quill#327

Merged
HaoZeke merged 7 commits intoTheochemUI:mainfrom
HaoZeke:toQuill
Mar 8, 2026
Merged

feat(prj): remove fmt+spdlog for quill#327
HaoZeke merged 7 commits intoTheochemUI:mainfrom
HaoZeke:toQuill

Conversation

@HaoZeke
Copy link
Collaborator

@HaoZeke HaoZeke commented Mar 5, 2026

and std::format

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

eOn Documentation Preview

Download: documentation.zip

Unzip and open index.html to view.

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Benchmark Results

Note

All benchmarks unchanged

Count
⚪ Unchanged 8
8 unchanged benchmark(s)
Benchmark Before After Ratio
bench_eonclient.TimeMinimizationLJCluster.peakmem_minimization_lbfgs 27.2M 27.1M ~1x
bench_eonclient.TimeMinimizationLJCluster.time_minimization_lbfgs 36.9±0ms 37.5±0ms ~1.02x
bench_eonclient.TimeNEBMorsePt.peakmem_neb 27.2M 27.1M ~1x
bench_eonclient.TimeNEBMorsePt.time_neb 509±0ms 540±0ms ~1.06x
bench_eonclient.TimePointMorsePt.peakmem_point_evaluation 27.2M 27.1M ~1x
bench_eonclient.TimePointMorsePt.time_point_evaluation 7.27±0ms 7.59±0ms ~1.04x
bench_eonclient.TimeSaddleSearchMorseDimer.peakmem_saddle_search_dimer 27.2M 27.1M ~1x
bench_eonclient.TimeSaddleSearchMorseDimer.time_saddle_search_dimer 61.1±0ms 61.4±0ms ~1x
Details
  • Base: 3f68e7ca
  • Head: da6b8488
  • Runner: ubuntu-22.04
Raw asv-spyglass output
All benchmarks:

| Change   | Before   | After    |   Ratio | Benchmark (Parameter)                                                  |
|----------|----------|----------|---------|------------------------------------------------------------------------|
|          | 27.2M    | 27.1M    |    1    | bench_eonclient.TimeMinimizationLJCluster.peakmem_minimization_lbfgs   |
|          | 36.9±0ms | 37.5±0ms |    1.02 | bench_eonclient.TimeMinimizationLJCluster.time_minimization_lbfgs      |
|          | 27.2M    | 27.1M    |    1    | bench_eonclient.TimeNEBMorsePt.peakmem_neb                             |
|          | 509±0ms  | 540±0ms  |    1.06 | bench_eonclient.TimeNEBMorsePt.time_neb                                |
|          | 27.2M    | 27.1M    |    1    | bench_eonclient.TimePointMorsePt.peakmem_point_evaluation              |
|          | 7.27±0ms | 7.59±0ms |    1.04 | bench_eonclient.TimePointMorsePt.time_point_evaluation                 |
|          | 27.2M    | 27.1M    |    1    | bench_eonclient.TimeSaddleSearchMorseDimer.peakmem_saddle_search_dimer |
|          | 61.1±0ms | 61.4±0ms |    1    | bench_eonclient.TimeSaddleSearchMorseDimer.time_saddle_search_dimer    |

HaoZeke added a commit to HaoZeke/eOn that referenced this pull request Mar 5, 2026
Created changelog entries for PR TheochemUI#327:

Fixed (327.fixed.md):
- Quill logger initialization in all test fixtures
- ConfigParser defaults restoration (49 path interpolations)
- Windows MSVC NOMINMAX fix for quill compilation

Changed (327.changed.md):
- Migration from spdlog/fmt to quill logging library
- std::format integration for modern C++20 logging

Changed (+8235467c.changed.md):
- Vesin v0.5.2 update with new per-dimension periodicity API

Changed (+d3defa41.changed.md):
- Metatomic ecosystem dependency updates (torch 2.10, etc.)

Ready for release cut with 'uvx towncrier build'.
HaoZeke added a commit to HaoZeke/eOn that referenced this pull request Mar 5, 2026
## Performance Optimization

Configure BackendOptions for 10× faster logging:
- sleep_duration: 100μs → 10μs (10× more responsive)
- transit_event_buffer_initial_capacity: 256 → 2048 (8× larger, fewer reallocations)
- log_timestamp_ordering_grace_period: 5μs → 1μs (lower latency)
- sink_min_flush_interval: 200ms → 100ms (more responsive)

Quill defaults prioritize low CPU over performance. These settings balance both:
significantly faster logging without requiring 100% CPU (sleep_duration=0).

Root cause: Default sleep_duration=100μs limited throughput to ~10K msgs/sec.
Quill benchmarks use sleep_duration=0 for millions of msgs/sec, but that uses
100% of one core. This balanced config achieves 10× speedup at <5% idle CPU.

## Logger API Migration

Migrated entire codebase to modern C++20 EonLogger.h API:

### Created Infrastructure
- `eonc::log::Scoped`: Auto-init RAII logger (zero boilerplate)
- `eonc::log::get_file()`: One-line file logger creation
- `EONC_LOG_*`: One-shot logging macros (no variable needed)
- C++20 features: [[nodiscard]], string_view, noexcept, operator->

### Migration Results
- 22 classes: quill::Logger *m_log + manual init → eonc::log::Scoped m_log
- 5 optimizers: 14-line create_or_get_logger → eonc::log::get_file()
- 24 .cpp files: LOG_*(quill::Frontend::get_logger(...), ...) → EONC_LOG_*(...)
- Special cases: Potential, BasinHoppingJob, GlobalOptimizationJob use raw
  pointers (conditional init / dynamic logger switching)

### Code Reduction
- 49 files modified
- +739 insertions, -813 deletions
- Net: -74 lines (-9%)
- Eliminated repetitive 14-line FileSink boilerplate
- Removed manual logger initialization from constructors

### Benefits
- Less code: 90% reduction in logger setup boilerplate
- Safer: RAII guarantees, no nullptr, no forgotten init
- Clearer: Self-documenting (eonc::log::Scoped vs raw pointer + init)
- Modern: C++20 idioms throughout
- Compatible: 100% backward compatible with existing LOG_* macros

See client/EonLogger_DESIGN.md for full design rationale and migration guide.

Refs: TheochemUI#327 (quill migration), internal investigation docs
HaoZeke added a commit to HaoZeke/eOn that referenced this pull request Mar 6, 2026
Configure BackendOptions for 10× faster logging:
- sleep_duration: 100μs → 10μs (10× more responsive)
- transit_event_buffer_initial_capacity: 256 → 2048 (8× larger, fewer reallocations)
- log_timestamp_ordering_grace_period: 5μs → 1μs (lower latency)
- sink_min_flush_interval: 200ms → 100ms (more responsive)

Quill defaults prioritize low CPU over performance. These settings balance both:
significantly faster logging without requiring 100% CPU (sleep_duration=0).

Root cause: Default sleep_duration=100μs limited throughput to ~10K msgs/sec.
Quill benchmarks use sleep_duration=0 for millions of msgs/sec, but that uses
100% of one core. This balanced config achieves 10× speedup at <5% idle CPU.

Migrated entire codebase to modern C++20 EonLogger.h API:

- `eonc::log::Scoped`: Auto-init RAII logger (zero boilerplate)
- `eonc::log::get_file()`: One-line file logger creation
- `EONC_LOG_*`: One-shot logging macros (no variable needed)
- C++20 features: [[nodiscard]], string_view, noexcept, operator->

- 22 classes: quill::Logger *m_log + manual init → eonc::log::Scoped m_log
- 5 optimizers: 14-line create_or_get_logger → eonc::log::get_file()
- 24 .cpp files: LOG_*(quill::Frontend::get_logger(...), ...) → EONC_LOG_*(...)
- Special cases: Potential, BasinHoppingJob, GlobalOptimizationJob use raw
  pointers (conditional init / dynamic logger switching)

- 49 files modified
- +739 insertions, -813 deletions
- Net: -74 lines (-9%)
- Eliminated repetitive 14-line FileSink boilerplate
- Removed manual logger initialization from constructors

- Less code: 90% reduction in logger setup boilerplate
- Safer: RAII guarantees, no nullptr, no forgotten init
- Clearer: Self-documenting (eonc::log::Scoped vs raw pointer + init)
- Modern: C++20 idioms throughout
- Compatible: 100% backward compatible with existing LOG_* macros

See client/EonLogger_DESIGN.md for full design rationale and migration guide.

Refs: TheochemUI#327 (quill migration), internal investigation docs
@HaoZeke HaoZeke force-pushed the toQuill branch 10 times, most recently from 726e97a to 57e5251 Compare March 8, 2026 05:35
HaoZeke added 7 commits March 8, 2026 06:41
…ic_enum

Swap logging backend from fmt+spdlog to quill with std::format.
Update vesin to v0.5.2, metatomic ecosystem versions, and
magic_enum to 8c3a9ec.
Create modern C++20 logging API: eonc::log::Scoped RAII helper,
eonc::log::get_file() utility, and EONC_LOG_* one-shot macros.
Migrate 51 files, fix test segfaults, resolve XTB/Dimer/Potential
SIGSEGV, optimize backend (10x throughput via sleep_duration=10us),
and use QUILL_LOG_ prefixed macros to avoid collision. Net -66 lines.
Add constexpr-safe guarded arithmetic (safe_div, safe_recip,
safe_sqrt, safe_acos, safe_atan_ratio) and Eigen-dependent
safe_normalized/safe_normalize_inplace. Guard unprotected divisions
and normalize() calls across 12 source files. Make FPE signal handler
async-signal-safe. Add SafeMath design doc and newsfragments.
Use -isystem for pip-installed metatomic/vesin include paths to
suppress third-party warnings. Fix serve mode include ordering.
Wrap all classes, enums, and helper namespaces under namespace eonc.
Rename helper_functions to helpers. Remove using-namespace-std from
all headers. Add backward-compatible using-aliases for all classes
and enums. Fix MSVC constexpr std::abs, serve-mode namespace
qualification, and Windows using-namespace-std guard placement.
@HaoZeke HaoZeke merged commit d50148a into TheochemUI:main Mar 8, 2026
13 checks passed
@HaoZeke
Copy link
Collaborator Author

HaoZeke commented Mar 8, 2026

Finally.

@HaoZeke HaoZeke deleted the toQuill branch March 8, 2026 05:58
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.

1 participant