Repository navigation
perf(planner): the climate bake runs its spatial chunks on every core - #2741
Merged
Merged
Conversation
… and reads each chunk once `climate` bakes each spatial chunk in a worker process, one per core. The workers fork from the bake and read the source and region without a copy. Each chunk fills its own cells, so the order in which the chunks end does not change the archive. `Source.read` no longer hashes the chunk again. The SHA-256 in the name of a cached chunk goes into the fingerprint when `Source.path` finds or downloads it: the download and the store of `obc data` check that hash already. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…, and fit the cores and memory - A worker hashes each chunk that it reads against the SHA-256 in its name, as before the pool, so a damaged cached chunk stops the bake. - The parent gives each worker the chunk paths that it resolved and put in the fingerprint. - `tools/step_pool.py` holds the pool of snow, now shared: one worker per core that the step may use and per free GB, workers that end with the bake (PR_SET_PDEATHSIG), and threads off Linux. The climate pool has at most one worker per spatial chunk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
timohueser
added a commit
that referenced
this pull request
Oct 18, 2026
…hreads to its cores, and tests its bands - `terrain_grid` reads the directories of each grid archive and refuses a tile that is not in the archive of its zoom-11 tile, as the rebuild did: `Tiles.get` looks only there. - The thread pools use the cores that the process may use (`step_pool.cores`). The terrain cache of the index bake holds the 25 tiles of each index tile in flight. - A test bakes bowl terrain, where every ray reads heights to its full distance, with bands of one tile row and with one band, and compares the archives. A halo of 2 pixels fails it. - The step test again checks that the grid archives hold no other tile, and that a tile in another archive stops the step. `tools/step_pool.py` is the same file as in #2741. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
tools/planner_climate.pybakes each spatial chunk in a worker process. Before, the chunks ran one after the other on one core.tools/step_pool.pynow holds the pool that the snow bake used: one worker per core that the step may use (sched_getaffinity) and at most one per GB of free memory, workers that end with the bake (PR_SET_PDEATHSIG), and threads off Linux, where a fork is not safe. The snow bake uses the same module. The climate pool has at most one worker per spatial chunk.downloadkeeps its 8 threads and now returns the paths.tools/step_pool.pytriggers theobc-data-stepstests, astools/step_request.pydoes.Why
On the DACH bake of 2026-10-17 (
runs/2026-10-17-071235),planner/climateused 281 s of CPU in 259 s of wall time on one core, for about 400 independent spatial chunks.Estimate, not measured on DACH. On 12 cores with enough free memory, about 259 / 12 s: under 30 s.
This is the climate part of the bake system review.
Memory note
Each worker holds the hourly series of one chunk, at most 32 cells for the ten years. A review measured 277 MB per full-chunk worker. The parent holds the region grids, as before.
Tests
FakeSourceof the tests) for the box 8.0,48.0,9.0,48.5: 9 spatial chunks. The archives have the same SHA-256,0963e63f…, with 2 tiles at zoom 8 and 4 at zoom 9.kill -9of the parent, no worker was alive 2 s later.tools/testssuite, as CI runs it (--group dev --group planner-snow --group planner-sun): 331 tests OK.test_planner_climateandtest_planner_snowalso pass with-W error::DeprecationWarning.obc suites check: OK.SourceTestcallspathand thenread(path); its "damaged" case stays.FakeSourcerecords its digests inpath, becausereadruns in a worker.Not run: a real climate bake, because the machine runs other work.
Public docs: no change.
Requirements: none
🤖 Generated with Claude Code