Skip to content

fix(step): Return round-tripped result on first run#543

Open
ayushiahjolia wants to merge 3 commits into
mainfrom
fix/step-serdes-round-trip-first-run
Open

fix(step): Return round-tripped result on first run#543
ayushiahjolia wants to merge 3 commits into
mainfrom
fix/step-serdes-round-trip-first-run

Conversation

@ayushiahjolia

Copy link
Copy Markdown
Contributor

Issue #, if available: #407

Description of changes:
A step serialized its result for the checkpoint but returned the raw in-memory value on the first run, while replay returned the value deserialized from the checkpoint. With a non-identity custom SerDes the first-run and replay results diverged, breaking the durability guarantee that a step yields the same value on every run.

Serialize then deserialize the result before returning it on the first run so the value matches what replay produces.

Added unit, integration, and example coverage for the first-run/replay equality with a non-identity SerDes.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ayushiahjolia
ayushiahjolia force-pushed the fix/step-serdes-round-trip-first-run branch from 604e309 to 59835d5 Compare July 16, 2026 22:54
@ayushiahjolia
ayushiahjolia marked this pull request as ready for review July 16, 2026 23:09
# which reconstructs the result by deserializing the checkpoint.
# A None payload is returned as-is, mirroring the replay path.
if serialized_result is None:
return None # type: ignore[return-value]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why we didn't add Optional[T] to the return type

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.

2 participants