Conversation
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
…ulse into improved_tracing
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
This was referenced Mar 5, 2026
Merged
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.
This PR introduces a major enhancement to execution tracing. Now when tracing is enabled, every time a message is sent, a session changes state, or a buffer is viewed or modified, a tracing event will be emitted. Downstream users can add a world
Observerfor theTracedEventevent to handle these events as they happen. If no observer is added, the overhead of tracing will be minimal, especially if message tracing (serializing the messages to record them) is turned off.When tracing is turned off, it has virtually no overhead at all. If the
"trace"feature is turned off at compilation time, then there will be no overhead at all from tracing, but it will also be impossible to enable tracing at runtime.Migration Guide
Working on this feature took me on a long tour through the whole crossflow codebase, and gave me an opportunity to reevaluate the implementations of many modules. I saw some opportunities to improve other aspects of the library along the way. This PR introduces some API improvements, which for better or worse also mean API breakages.
In<BlockingService<T, S>>BlockingService<T, S>BlockingServiceInput<T, S>BlockingService<T, S>In<AsyncService<T, S>>AsyncService<T, S>AsyncServiceInput<T, S>AsyncService<T, S>In<ContinuousService<T, S>>ContinuousService<T, S>ContinuousServiceInput<T, S>ContinuousService<T, S>In<BlockingCallback<T, S>>Blocking<T, S>BlockingCallbackInput<T, S>Blocking<T, S>In<AsyncCallback<T, S>>Async<T, S>AsyncCallbackInput<T, S>Async<T, S>BlockingMap<T, S>Blocking<T, S>AsyncMap<T, S>Async<T, S>In<T>Blocking<T>orAsync<T>.into_blocking_service()Blockingas function argument).into_async_service()Asyncas function argument).into_blocking_callback().into_callback()(useBlockingas function argument).into_async_callback().into_callback()(useAsyncas function argument).as_map().into_map().as_callback().into_callback()The overall theme is we've reduced all of the above input parameters into these:
BlockingServiceBlockingAsyncServiceAsyncContinuousServiceBlockingandAsynccan be used across services, callbacks, and maps. They are the same asBlockingServiceandAsyncServiceexcept they don't have aprovider: Entityfield because callbacks and maps are not associated with any Entity. Functions that don't care about having aprovidercan be used to implement a service or callback by usingBlockingorAsync. Functions that useBlockingorAsyncand have no other arguments can be used across all three types: services, callbacks, and maps.Buffer access
To facilitate tracing, some API changes were made to
BufferAccessandBufferAccessMut. For buffer tracing to be effective, we need to know what operation is accessing the buffer. TheBufferKeyalone doesn't tell us this since it can be freely passed around between operations and has no way of knowing which operation is using it.Instead we add a new
RequestIdargument toBufferAccess::get(~)andBufferAccessMut::get_mut(~). Each request sent to each operation has a unique ID used for tracing. To obtain that ID, every operation argument has a newid: RequestIdfield. Simply pass thatidfield along toget(id, &key)orget_mut(id, &key)so that the access can be traced.Note that
BufferAccess::getnow requires a mutable borrow ofBufferAccesseven though its buffer operations are read-only. This is because the tracing does require some mutability. This does not affect the ability of systems that useBufferAccessto be run in parallel.If you want to use
BufferAccessin a pure read-only, you can choose to useBufferAccess::get_untraced(&key), but as the name implies there will be no ability to track that access.Additional issues fixed by this PR: