From 4a17d0aaa4d2b5638357ae10e3c0567c6326b669 Mon Sep 17 00:00:00 2001 From: Ajay Date: Mon, 16 Mar 2026 00:26:33 -0400 Subject: [PATCH 1/2] feat: add min_repeats option to peak_cache Used an optional because we want to default CacheManager constructors default. --- SeQuant/core/eval/cache_manager.cpp | 5 +++-- SeQuant/core/eval/cache_manager.hpp | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/SeQuant/core/eval/cache_manager.cpp b/SeQuant/core/eval/cache_manager.cpp index 756636cd56..a544808ccc 100644 --- a/SeQuant/core/eval/cache_manager.cpp +++ b/SeQuant/core/eval/cache_manager.cpp @@ -35,14 +35,15 @@ void max_cache(Node const& node, // } // namespace -AsyCost peak_cache(Sum const& expr) { +AsyCost peak_cache(Sum const& expr, std::optional min_repeats) { // Materialize into a vector so that nodes have stable addresses for // pointer-based scanning in cache_manager() auto const nodes_vec = expr | ranges::views::transform([](const auto& expr) { return binarize(expr); }) | ranges::to_vector; - auto cm = cache_manager(nodes_vec); + auto cm = min_repeats ? cache_manager(nodes_vec, min_repeats.value()) + : cache_manager(nodes_vec); auto max = AsyCost::zero(); auto curr = AsyCost::zero(); for (auto const& n : nodes_vec) max_cache(n, cm, curr, max); diff --git a/SeQuant/core/eval/cache_manager.hpp b/SeQuant/core/eval/cache_manager.hpp index 89deb5330a..6ce8f54b2e 100644 --- a/SeQuant/core/eval/cache_manager.hpp +++ b/SeQuant/core/eval/cache_manager.hpp @@ -9,8 +9,10 @@ #include #include -#include #include + +#include +#include #include namespace sequant { @@ -235,11 +237,14 @@ auto cache_manager(meta::eval_node_range auto const& nodes, /// \note Reordering the terms in a Sum affects the peak cache memory. /// /// \param expr A Sum whose terms will be evaluated by reusing intermediates. +/// \param min_repeats Minimum number of repeats for a node to be cached. If not +/// provided, will use the default of \c cache_manager(). /// \return AsyCost object that represents the memory in terms of powers of /// active occupied and active unoccupied index extents of stored /// tensor. /// -AsyCost peak_cache(Sum const& expr); +AsyCost peak_cache(Sum const& expr, + std::optional min_repeats = std::nullopt); } // namespace sequant From b3ba893fa9ad1ddef077475328642a46c0d8e1f1 Mon Sep 17 00:00:00 2001 From: Ajay Date: Mon, 16 Mar 2026 00:53:07 -0400 Subject: [PATCH 2/2] ci: bump macOS version --- .github/workflows/cmake.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 17380046f7..286dfca43e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: build_type : [ Release, Debug ] - os : [ macos-15, ubuntu-24.04 ] + os : [ macos-26, ubuntu-24.04 ] valgrind: [ true, false ] sanitize: [ true, false ] exclude: @@ -25,15 +25,15 @@ jobs: valgrind : true - build_type : Release sanitize : true - - os: macos-15 + - os: macos-26 sanitize: true - - os: macos-15 + - os: macos-26 valgrind: true include: - os: ubuntu-24.04 cxx: /usr/bin/g++-14 sanitize_flags: -fsanitize=address -fsanitize=leak -fsanitize=undefined -fno-omit-frame-pointer -fno-var-tracking - - os: macos-15 + - os: macos-26 cxx: clang++ sanitize_flags: -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -fno-var-tracking