Repository navigation
dagui: read a call the same when later lazy evaluations link the first one - #14874
Merged
Merged
Conversation
A lazy result can be evaluated more than once, for example first for its metadata and later in full. Each evaluation is a hidden span with cause links to the call that returned the result. Test that the call reads the same when only the first evaluation links the call and later ones link the first: its pending state, failure, running and active time, waiting time and rows, and the activity of the calls that started each evaluation. Cover later evaluations that succeed, fail or still run, and the first evaluation arriving in a later batch. Signed-off-by: Erik Sipsma <[email protected]>
A later evaluation of a lazy result may link an earlier evaluation rather than the call that returned the result. Read the call the same as if every evaluation linked it directly: - a complete evaluation anywhere in the chain resolves the call's pending state; - the waits of every evaluation in the chain are the call's, and a blocker resolves through the chain to the call; - status, activity and rollup counts pass through evaluations in the chain to the call, not to an earlier evaluation or the call that started it; - when an evaluation arrives after later ones that link it, their status is propagated again through it. Only lazy evaluations are followed. Today's engines link every evaluation to the call, so their traces read as before. Signed-off-by: Erik Sipsma <[email protected]>
grouville
self-requested a review
October 27, 2026 07:08
grouville
approved these changes
Oct 27, 2026
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.
What changes
Nothing visible with today's engines. Their traces read exactly as before.
When the engine runs deferred work for a lazy result, such as a
withExecthat only runs once its output is read, it starts a hidden "resume …" or "open stored part (…)" span. Today every such span carries cause links to the call that returned the result and to every span that installed it. The UI uses those links to show the call's pending state, failure, running time and waiting time.With this change, the UI also reads the call correctly when only the result's first evaluation carries those links, and later evaluations link that first one instead:
Only lazy evaluation spans are followed. Released engines link every evaluation to the call, and none of them puts a cause link on a lazy evaluation span, so their traces take the same paths through the reader as before.
Why
A result's evaluations each carry the same, often long, list of links. On large module workloads, each part of a remote-cached result is evaluated as its own span, and the repeated links grow engine memory and telemetry upload volume considerably. A follow-up engine change will put the full list only on a result's first evaluation per session, and have later ones link that first evaluation. This reader change ships first, so CLIs reading traces from that engine show the same thing.
Tests
TestResumeChainReadsLikeDirectResumes(dagql/dagui) records the same lazy evaluation in both shapes and requires identical readings:All 18 cases fail without the change. Each of the four reader changes, reverted alone, fails exactly the cases it covers. The test runs in the
test-split/test-packagescheck.Known limit
Rollup counts (the collapsed-row density dots) are kept incrementally. They don't move to ancestry discovered after a span was counted. If a later evaluation arrives before the first one, its counts don't reach the call. This already happens today whenever a span arrives before its parent. It doesn't affect pending state, failure, activity or timing.