Skip to content

Commit 601f6ae

Browse files
authored
chore: bump operon pin to include NSGA2 reinserter fixes (#71)
* fix(bindings): shim OptimizerSummary over operon's tl::expected FitOutcome operon's OptimizerSummary -> tl::expected<FitResult, FitFailure> (PR #122) has no nanobind caster; flattens it back into the same field-level Python API. * test(optimizer): cover CoefficientOptimizer success/failure via FitOutcome Locks down the OptimizerSummary shim on both outcomes - success (fit improves, coefficients applied) and failure (max_iter=0, matching the Iterations()==0 contract GrammarEnumerationAlgorithm's C++ test depends on). * build: bump operon pin to include the FitOutcome API in wheel builds script/dependencies.py (linux/macos wheels) and the vcpkg port (windows wheels) each hardcode their own operon rev, separate from flake.lock - both were still on the pre-#122 API and failed to compile against this PR's OptimizerSummary shim. * fix(vcpkg): update MSVC patch context for the bumped operon rev gaussian_likelihood.hpp gained a leading #include <algorithm> upstream, shifting the patch's context lines enough that git apply rejected the hunk. * build: bump operon pin, drop now-redundant <random> patch hunks operon 79566dd7 adds the missing <random> includes upstream (was previously patched in downstream); keeps only the /bigobj MSVC compile-flag hunk. * chore: bump operon pin to include NSGA2 reinserter fixes Picks up heal-research/operon#123 (reinserter delegation + two bug fixes) and #124 (elitism as a ReinserterBase property); verified building cleanly against the new pin. * build: align vcpkg/wheel operon pins with flake.lock's final rev ports/operon/portfile.cmake and script/dependencies.py were still pinned to 79566dd7 (the intermediate bump), one commit behind flake.lock's 78409afd; Windows and wheel builds were missing the NSGA2 reinserter fixes this PR bumps to. SHA512 verified against the GitHub archive tarball for the new ref. * test(optimizer): assert Iterations == 0 on the early-return failure path The failure-path test's own comment names this as the exact contract GrammarEnumerationAlgorithm's C++ test depends on, but the test never asserted it.
1 parent 7168e1a commit 601f6ae

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ports/operon/portfile.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
vcpkg_from_github(
22
OUT_SOURCE_PATH SOURCE_PATH
33
REPO heal-research/operon
4-
REF 79566dd7ba95f6795e26c63557f8c4236a6c8ba7
5-
SHA512 5f54b0cadabf0d7d8a870a93c1f4edc17a719a8300c8a467ae094d6e1b0e6e39ecd085e8be24bbf08946adc0dd1b87d04dd4a964b615b3718449ccfd10fa7f26
4+
REF 78409afd29e4a992b122412f3590a6ec2a776a2e
5+
SHA512 5f1ac42267220ad153c52fbe4e89c991811cbeb3729628176fcd108cfda99ca8bb33c2f225d2cd8351ca9d00d47d2896b8ca04ba69b638e7e0a1c91521db80af
66
HEAD_REF main
77
PATCHES
88
add-msvc-support.patch

script/dependencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def format_time(seconds):
8282
('ndsort', 'https://github.com/foolnotion/ndsort', 'd94c58a1eb3e08e1cd026c565ab63276ea6bc62a', default_cmake_args + ['-DBUILD_EXAMPLES=OFF']),
8383
('small_vector', 'https://github.com/gharveymn/small_vector', 'v0.10.2', default_cmake_args + ['-DGCH_SMALL_VECTOR_ENABLE_TESTS=OFF', '-DGCH_SMALL_VECTOR_ENABLE_BENCHMARKS=OFF']),
8484
('pappus', 'https://github.com/heal-research/pappus', '3fef62ae2c650407fbf4412f8949780f76b6bafd', default_cmake_args),
85-
('operon', 'https://github.com/heal-research/operon', '79566dd7ba95f6795e26c63557f8c4236a6c8ba7', default_cmake_args + ['--preset', operon_build_preset, '-DBUILD_CLI_PROGRAMS=OFF', '-DBUILD_SHARED_LIBS=OFF', '-DCMAKE_POSITION_INDEPENDENT_CODE=ON']),
85+
('operon', 'https://github.com/heal-research/operon', '78409afd29e4a992b122412f3590a6ec2a776a2e', default_cmake_args + ['--preset', operon_build_preset, '-DBUILD_CLI_PROGRAMS=OFF', '-DBUILD_SHARED_LIBS=OFF', '-DCMAKE_POSITION_INDEPENDENT_CODE=ON']),
8686
]
8787

8888
total = len(dependencies)

tests/test_optimizer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,6 @@ def test_failure_path_leaves_tree_untouched(self, linear_fixture):
8282
# this is exactly the case the FitOutcome shim has to get right
8383
assert summary.FinalParameters == []
8484
assert summary.InitialCost == 0.0
85+
assert summary.Iterations == 0
8586
# never applied since the fit never ran
8687
assert optimized_tree.GetCoefficients() == pytest.approx([1.0])

0 commit comments

Comments
 (0)