Skip to content

Observe the sources on every process at run! start, and put each process's token in its .done - #55

Merged
sotashimozono merged 1 commit into
mainfrom
observe-at-run-start
Sep 22, 2026
Merged

sotashimozono merged 1 commit into
mainfrom
observe-at-run-start

Conversation

@sotashimozono

Copy link
Copy Markdown
Member

Stage C of per-point provenance, SweepRunner side. Needs DataVault 0.8.4 (observe_sources, mark_done!(…; observation), QAtlasHub/DataVault.jl#54).

Why per process. A point's marker must name the observation of the process that computed it. Under pmap that is the worker, and its loaded code need not be the master's: a closure runs the master's body while the named functions it calls resolve on the worker (checked).

What changes

  • run!(…; observe = true): before any key is dispatched, the master observes for itself and each worker observes for itself (remotecall_fetch, in parallel). Events observed / observe_failed record each process's outcome.
  • _run_one_with_retry! — which runs on the computing process — passes that process's token to mark_done!, so every .done carries observation=<token>.
  • Tokens are kept per vault identity (outdir, project, run), so two run!s sharing a process never hand each other's token to a marker.
  • An observation that fails does not stop the run: its process's markers read observation=unknown, and the event log says why. observe = false does the same, and forgets any earlier token rather than reusing it.
  • run_loop! forwards observe.

Tests — test/run/test_run_observe.jl (14), locally against DataVault at the merged commit:

  • sequential: every marker names the master's observation; its snapshot exists;
  • observe = false writes unknown even when an earlier token was left in the process;
  • a snapshot store that cannot be written: the run completes, markers are unknown, observe_failed is logged;
  • 2 real workers: every marker's token belongs to a worker whose myid is among the workers; one master and two worker observations are recorded.

test_run_result_digest.jl, test_run_minimal.jl, test_run_worker_load.jl (45) pass unchanged. DataVault floor 0.8.4; version 0.6.6.

CI will not resolve until DataVault 0.8.4 is in General — JuliaRegistries/General#169056 is open.

🤖 Generated with Claude Code

…ess's token in its .done

A point's marker must name the observation of the process that computed it: under pmap that is
the worker, whose loaded code need not be the master's (a closure runs the master's body while the
named functions it calls resolve on the worker). run! now has the master observe for itself and
each worker observe for itself, through DataVault.observe_sources, before any key is dispatched;
_run_one_with_retry!, running on that same process, passes that process's token to mark_done!.

Tokens are kept per vault identity, so two run!s sharing a process never hand each other's token
to a marker. An observation that fails does not stop the run: the event log records
observe_failed with the error, and that process's markers read observation=unknown, as they do
with observe=false (which also forgets any earlier token rather than reusing it).

DataVault floor 0.8.4. Version 0.6.6.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Observe.jl 97.14% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

📚 Docs preview: https://qatlashub.github.io/SweepRunner.jl/previews/PR55/

(updates on each push to this PR)

@sotashimozono
sotashimozono merged commit 5b28406 into main Sep 22, 2026
20 of 28 checks passed
@sotashimozono
sotashimozono deleted the observe-at-run-start branch September 22, 2026 09:11
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