Conversation
`arrange_core` and `reduce_with_tactic` construct their trace with `Trace::new` and move it into a `TraceAgent`, after which the only way to reach the trace instance is `TraceAgent::trace_box_unstable`. A caller whose trace shares state with something outside the operator, for example a handle through which other threads observe its batches, has no stable way to obtain that state. `arrange_core_with_trace` and `reduce_with_tactic_and_trace` take a factory with the signature of `Trace::new` and call it once, where the operator builds its trace. The caller can take a handle from the trace before returning it. `arrange_core` and `reduce_with_tactic` delegate with `Trace::new`, so existing callers are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015tLhSbZdXrTSK2KwSocT59
This branch has not been deployed
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.
arrange_coreandreduce_with_tacticconstruct their trace withTrace::newand move it into aTraceAgent. From then on the only way to reach the trace instance isTraceAgent::trace_box_unstable, which is documented as unstable and makes mutating the box undefined behavior. A trace that shares state with something outside the operator, such as a handle through which other threads observe its batches, has no stable way to hand that state to its caller.This adds
arrange_core_with_traceandreduce_with_tactic_and_trace, which take a factory with the signature ofTrace::newand call it once where the operator builds its trace. The caller takes a handle from the trace before returning it.arrange_coreandreduce_with_tacticdelegate withTrace::new, so existing callers are unchanged.arrange_from_upserthas the same construction pattern and is left as is, since nothing needs it yet.Posted by Claude Code.
🤖 Generated with Claude Code
https://claude.ai/code/session_015tLhSbZdXrTSK2KwSocT59