Skip to content

Feature / save long-running sim outputs to cache. Manager preempts sending identical work in favor of pulling from cache - #1585

Merged
jlnav merged 40 commits into
developfrom
feature/shelve_sims
Oct 2, 2026
Merged

jlnav merged 40 commits into
developfrom
feature/shelve_sims

Conversation

@jlnav

@jlnav jlnav commented Aug 29, 2025 •

Copy link
Copy Markdown
Member

Cache generated based on the hashed specs dicts + source codes of included callables

@jlnav jlnav changed the title [WIP] Feature/shelve sims Feature / save long-running sim outputs to cache. Manager preempts sending identical work in favor of pulling from cache Sep 19, 2025
@jlnav
jlnav marked this pull request as ready for review September 19, 2025 20:57
@jlnav
jlnav requested review from jmlarson1 and shuds13 September 19, 2025 20:57
@codecov

codecov Bot commented Oct 22, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.94083% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.77%. Comparing base (6fc2376) to head (6753d43).
⚠️ Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
libensemble/history.py 88.67% 5 Missing and 7 partials ⚠️
libensemble/manager.py 88.67% 7 Missing and 5 partials ⚠️
libensemble/utils/misc.py 95.00% 2 Missing and 3 partials ⚠️
libensemble/specs.py 76.92% 3 Missing ⚠️
libensemble/libE.py 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1585      +/-   ##
===========================================
+ Coverage    88.43%   88.77%   +0.33%     
===========================================
  Files           73       73              
  Lines         8353     8658     +305     
  Branches      1330     1402      +72     
===========================================
+ Hits          7387     7686     +299     
+ Misses         731      725       -6     
- Partials       235      247      +12     

☔ 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.

@jlnav
jlnav force-pushed the feature/shelve_sims branch from 8762847 to e88228e Compare September 8, 2026 15:48
@jlnav
jlnav force-pushed the feature/shelve_sims branch from 68dbe87 to f8e727d Compare September 24, 2026 20:35
jlnav added 23 commits October 1, 2026 12:53
… and then seeing if values exist in that cache before sending sims...
…he cache being created. iterate over the cache_keys corresponding to those in gen_specs out, then check if they're close to a cache entry. grab those indexes so we can slot in the corresponding data into the manager's H later on
…istory_f on/with those indexes and the associated cache values, pretending that the array of cache-values are a worker message
…rrides .recv, and in _send_work_order that forms a buffer from corresponding cache entries
- Combined HEAD's early return with incoming worker-specific cache retrieval
- Moved cache handling to top of _receive_from_workers
- Added workerID, calc_status, and calc_type to cache D_recv
Use _update_state_from_cache helper method from incoming commit
Add self.cache_index initialization in __init__
- Added self.use_cache from libE_specs cache_long_sims
- Moved cache init into use_cache conditional
- Removed duplicate cache_index initialization
- Added calc_status_strings import alongside existing imports
…nce we're comparing to returned calc statuses
jlnav added 15 commits October 1, 2026 12:53
…opying the cache values into the manager's local record
…nstead of saving/loading each sim. move cache location to HOME/.cache/libensemble. Fix init issue. Fix redundant uniqueness checking
- Removed unused imports (launcher, Timer, os) since TCP was removed from base
- Kept cache hashing logic (compute_config_hash, spec_hash)
- Kept GC-only block from HEAD
- Kept cache_name=None, cache_dir defaults from f268eda
…alues, callable-instance state, VOCS, and structured H0 data. The automatically generated filename uses the full SHA-256 hash.

Fixed cache-hit bookkeeping and dispatch so multiple hits are retained, only matching rows are filtered, and remaining rows are sent normally.
Added cache_tolerances, a field-name-to-absolute-tolerance dictionary. Unspecified numeric fields match exactly; relative tolerance is zero.
Expanded test_cache_sims.py to check cached values, runtimes, and invalidation after changing the simulator. Updated the cache settings documentation.
Fixed the cache-scan crash when the cache has no prior hits, and fixed cached results being filled from the outbound input fields instead of the cached result fields.
@jlnav
jlnav force-pushed the feature/shelve_sims branch from 9716c03 to 673d62c Compare October 1, 2026 18:00
@jlnav
jlnav merged commit 794133c into develop Oct 2, 2026
31 of 32 checks passed
@jlnav
jlnav deleted the feature/shelve_sims branch October 2, 2026 13:05
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