Skip to content

controlSet() keeps the shipped-data digest - #74

Open
eliotmcintire wants to merge 1 commit into
developmentfrom
fix/controlSetKeepsObjsDigest
Open

eliotmcintire wants to merge 1 commit into
developmentfrom
fix/controlSetKeepsObjsDigest

Conversation

@eliotmcintire

Copy link
Copy Markdown
Contributor

Fits that go through controlSet() were all saved under the same cache entry, so a second fit on different data loaded the first fit's answer instead of fitting. In the MPB project, every training window of three study areas got the same single fit.

Affects: fits whose control passes through controlSet() (mpbRedTopSpread does this) now fit their own data. A fit cached under the old shared key is not reused.

Technical details

controlSet() (R/DEoptim.R:676) rebuilds control with DEoptim.control() when it has fewer than 20 elements. That drops the objsDigest attribute clusterSetup() sets, so DEoptimIterative() got shippedDigest = NULL and keyed each generation on the objective's arguments only. The fix saves the digest before rebuilding control and puts it back after. controlSet() also now calls DEoptim::DEoptim.control instead of the string "DEoptim.control", which only worked with DEoptim attached.

Two new tests in test-DEoptimShippedDataKey.R: controlSet() keeps the digest, and two fits through controlSet() that differ only in the shipped data converge to their own targets. Without the fix 3 tests fail; with it 9/9 pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lx3DXhV7osHiZpUPDww2xs

DEoptim.control() rebuilt control and dropped clusterSetup()'s objsDigest,
so every fit through controlSet() had one cache key (MPB: all windows of
B, C and D loaded the first fit). Also call DEoptim::DEoptim.control.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhV7osHiZpUPDww2xs
@eliotmcintire eliotmcintire added bug Something isn't working backwards compatible Existing code and results keep working unchanged labels Dec 5, 2026
@codecov

codecov Bot commented Dec 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.53%. Comparing base (e919431) to head (5882dfd).

Additional details and impacted files
@@               Coverage Diff               @@
##           development      #74      +/-   ##
===============================================
+ Coverage        76.23%   76.53%   +0.30%     
===============================================
  Files               24       24              
  Lines             2146     2148       +2     
===============================================
+ Hits              1636     1644       +8     
+ Misses             510      504       -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Existing code and results keep working unchanged bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant