Repository navigation
feat: schedule around artifacts — defer a key whose artifact is mid-build, group keys by artifact - #53
Merged
Conversation
…uild, group keys by artifact DataVault 0.8.2's `artifact!` builds an intermediate result once and reuses it. This adds the scheduling half: - `work_fn` throwing `DataVault.ArtifactBusy` (artifact! with wait=false) is a DEFERRAL, not a failure: logged as `:artifact_busy`, no attempt spent, and `run!` re-dispatches the deferred keys once the pass drains (`:deferred_round`, waiting `RunOpts(defer_poll)` after a pass that finished nothing). A key still deferred at stop is counted with `busy`. - `artifact_affinity(vault, name)`: an `affinity` that groups keys by the artifact they need. Compat floors: DataVault 0.8.2, ParamIO 0.4.11. 0.6.3 → 0.6.4 (0.6.3 is #52). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sotashimozono
force-pushed
the
feat/artifacts
branch
from
September 22, 2026 05:04
b862b98 to
37c2b96
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
📚 Docs preview: https://qatlashub.github.io/SweepRunner.jl/previews/PR53/ (updates on each push to this PR) |
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.
Why
This is the scheduling half of intermediate-artifact reuse. The other halves are QAtlasHub/ParamIO.jl#40, which defines what an artifact is, and QAtlasHub/DataVault.jl#52, which provides
artifact!to store it once and reuse it. With those alone, a worker that needs an artifact another worker is still building can only block. That is fine when there are no more keys than workers. When keys outnumber workers, the worker should take a different key instead.What
Deferral. If
work_fnthrowsDataVault.ArtifactBusy(fromartifact!(...; wait=false)), the key is treated as deferred, not failed::artifact_busy;run!re-dispatches the deferred keys once the pass drains, logging:deferred_round;run!first waitsRunOpts(defer_poll=30.0), because the builder is then another job;busy.run!handles this itself, so a driver that callsrun!once (notrun_loop!) still completes the deferred keys.artifact_affinity(vault, name): anaffinitythat groups keys by the artifact they need. Keys that share an artifact stay on one worker, and distinct artifacts start on distinct workers.The README gets a "Shared setup without a barrier" section, and the event-kind table in
EventLog.jlgets the two new kinds.Compat floors are DataVault
0.8.2and ParamIO0.4.11. CI needs both registered first. Version: 0.6.3 → 0.6.4, which is additive (0.6.3 is #52, which this PR is rebased onto);RunOptsgains a keyword-only field.Tests
test/run/test_artifacts.jlhas 3 testsets. All are deterministic: they use counters, not timers. The first draft used aTimerand passed vacuously because the first compile took longer than the timer.ArtifactBusy. Withmax_attempts=1, all 6 keys finish witherr == 0andbusy == 0. An implementation that spent an attempt would end them as:error. The test also checks that the log containsartifact_busy≥ 3 times and adeferred_round.busy, nothing is an error, and no U = 0.2 key is marked done.Existing
test_run_minimal,test_affinity,test_run_stop_flag,test_prerequisiteandtest_run_adversarialpass unchanged locally with-t 2.🤖 Generated with Claude Code
Rebased onto #52
This PR now sits on #52 (
d8a6e5e). Two conflicts and one API change:Project.toml: the DataVault floor is0.8.2. The comment fix: complete the keys a killed sibling held, and stop waiting to find out it is dead #52 wrote about why 0.8.1 was the floor (the owner-stamped.runningAPI) is kept alongside the new reason.EventLog.jl: fix: complete the keys a killed sibling held, and stop waiting to find out it is dead #52'sworker_died/worker_lostrows are kept, withartifact_busy/deferred_roundadded after them._is_stoppedno longer exists. fix: complete the keys a killed sibling held, and stop waiting to find out it is dead #52 folded it into_stop_reason, so the deferral loop now breaks on_stop_reason(opts) !== nothing.A deferred key is counted with
busy. #52'srun_loop!rule, which does not count a busy round as empty untilstale_after, therefore also keeps a loop alive while an artifact is being built elsewhere.Run locally after the rebase with
-t 2, all passing:test_artifacts,test_liveness,test_run_loop_busyandtest_run_deadlinetest_run_stop_flag,test_run_minimal,test_prerequisiteandtest_affinitytest_run_adversarialandtest_eventlog