Repository navigation
Write the host-speed and fit-memory ledgers at rebalance and fit end, not every generation - #70
Merged
Merged
Conversation
…very generation Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #70 +/- ##
===============================================
+ Coverage 77.16% 77.30% +0.14%
===============================================
Files 24 24
Lines 2238 2252 +14
===============================================
+ Hits 1727 1741 +14
Misses 511 511 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
eliotmcintire
added a commit
that referenced
this pull request
Nov 7, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fits were stalling every generation while the master re-saved two large shared files that record how fast each host is, with all workers idle. They now save them every 100 generations and when the fit ends.
Affects: Fit speed only: about 2.9 s saved per generation with today's ledger (8 s at a full 30-day window); results and cached generations are unchanged.
Technical details
Defect:
R/DEoptim.R:420-422called.recordHostSpeed()and.recordFitMemory()after every generation, and each went through.replaceRecords()(R/hostSpeed.R:20-27), which reads and rewrites the wholehostSpeed.rds(8.3 MB, 367k rows) andfitMemory.rdsunder the lock. On a copy of the live ledger this cost 2.90 s per generation before, and 0.02 s after (plus one 2.8 s flush per 100 generations, 0.049 s per generation on average).Fix:
DEoptimIterative()passes apendingenvironment;.replaceRecords()keeps the rows there, and the new.flushRecords()writes them in one locked read-modify-write per file, before each rebalance (which reads them) and inon.exit(). File names, columns and record semantics are unchanged, so older clusters versions keep sharing the files. A fit that is killed loses its records since the last flush (at most 100 generations).Tests (
tests/testthat/test-hostSpeed.R): a flushed buffer gives the same ledgers as per-record writes, and an 8-generation fit with rebalance every 3 writes each ledger at most ceiling(8/3)+1 times (8 on base) with data visible at each rebalance; the second fails on base. Full suite: 1368 pass, 0 fail on the branch; 1361 pass, 0 fail on base.R CMD check --no-manual(scratch library, DT absent so_R_CHECK_FORCE_SUGGESTS_=false): 0 errors, 0 warnings, 3 existing notes.🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6