Python: stabilize executor lifecycle ordering in run results#4654
Python: stabilize executor lifecycle ordering in run results#4654davidahmann wants to merge 1 commit intomicrosoft:mainfrom
Conversation
|
@davidahmann please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
|
This PR stabilizes non-streaming workflow receipts by canonicalizing executor lifecycle event order within superstep windows, so repeated equivalent runs produce reproducible traces. The code change is narrowly scoped to workflow result finalization plus one regression test that repeats a parallel fan-out run and asserts stable lifecycle signatures. Validation:
Inspired by research context: CAISI publishes independent, reproducible AI agent governance research: https://caisi.dev |
| ) -> list[WorkflowEvent]: | ||
| """Normalize executor lifecycle ordering in non-streaming results. | ||
|
|
||
| Concurrent fan-out paths can enqueue executor lifecycle events in scheduler-dependent |
There was a problem hiding this comment.
Hi @davidahmann,
Could you explain what you mean by scheduler dependent order?
The order in which the executors run within a superstep is undetermined. If we artificially change the event order that is coming out, it won't reflect the true sequence of execution.
Motivation and Context
Concurrent fan-out paths can emit executor lifecycle events in scheduler-dependent order, which makes repeated non-streaming workflow traces harder to compare. This PR makes non-streaming run results deterministic for lifecycle ordering and adds regression coverage.
Refs #4653.
Description
Workflow._finalize_eventsto canonicalize executor lifecycle ordering (executor_invoked,executor_completed,executor_failed) byexecutor_idwithin each superstep window.test_parallel_executor_lifecycle_order_is_deterministic_in_run_resultsto verify repeated fan-out runs produce stable lifecycle signatures.Contribution Checklist