Skip to content

add time skipping to chasm framework - #10934

Open
feiyang3cat wants to merge 2 commits into
mainfrom
fx/vts-chasm-framework
Open

add time skipping to chasm framework#10934
feiyang3cat wants to merge 2 commits into
mainfrom
fx/vts-chasm-framework

Conversation

@feiyang3cat

@feiyang3cat feiyang3cat commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What changed?

add time skipping to chasm framework

Stack

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

@feiyang3cat
feiyang3cat requested review from a team as code owners July 6, 2026 17:25
@feiyang3cat
feiyang3cat force-pushed the fx/vts-chasm-framework branch 2 times, most recently from ecc8e5e to e1b71ce Compare July 6, 2026 17:38
Comment thread chasm/timeskipping.go
@@ -0,0 +1,95 @@
package chasm

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

for reviewers:

  1. this is the base branch for a stack of small PRs that makes things easy to be reviewed
  2. the whole pr doesn't include execution implementation, and it is chasm framework only

Comment thread chasm/timeskipping.go Outdated
// signal. Nil-safe. A transition without a current time is never valid — every meaningful field is
// derived relative to the current time, so without it there is nothing to apply.
func (t *TimeSkippingTransition) IsValid() bool {
return t != nil && !t.CurrentTime.IsZero() && (!t.TargetTime.IsZero() || t.DisabledAfterFastForward)

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.

Based on these condition, NewTimeSkippingTransition returns an invalid transition. Is this the desired behavior?

@feiyang3cat feiyang3cat Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, it returns an empty transition for users to set a target time in the future. I feel isValid or this New method is not a name good enough to indicate this the transition has been correctly set.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

solved by rebasing the newest main

Comment thread chasm/timeskipping.go Outdated
// present by TrackEarliestFutureTime) and disable time skipping — the budget is reached.
// This is what lets the budget cap a chain of runs: a run with no earlier candidate
// consumes the remaining budget by skipping to the fast-forward and disabling.
t.TrackEarliestFutureTime(ffTargetTime)

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.

TrackEarliestFutureTime already does the checks in L86.
Wouldn't it be better if TrackEarliestFutureTime returned a bool indicating if TargetTime was replaced, and then here you could replace L86-L94 with if t.TrackEarliestFutureTime(...) { t.DisableAfterFastForward = true }

Also, based on this code, if ffTargetTime is already the same time as t.TargetTime, the function t.TrackEarliestFutureTime replaces t.TargetTime (which is no-op), and you are setting t.DisableAfterFastForward = true. Is this what you want?

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.

for the second point, if they are equal, fastforward should be disabled, also mentioned above, the allowed budget has been reached right?

@feiyang3cat feiyang3cat Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if they are equal, fastforward should be disabled

yes

@feiyang3cat feiyang3cat Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe the first version TrackEarliestFutureTime returned a boolean, but I removed it as this method may become one needed by component users (whenever a component user wants to override the default handler of findNextTargetTime) and I don't want users to think about how to handle the result and they just set all possible time points. Compared to that benefit, I think adding this two lines are trivial redundancy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

solved by rebasing the newest main

if ms.executionInfo.GetTimeSkippingInfo() == nil {
// init/update only return an error when their init-or-not precondition is violated,
// which the dispatch below already guarantees; the error is redundant here.
_ = ms.initTimeSkippingInfo(config, nil, 0)

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.

Do we have any guarantees that no other kind of error could be returned? What if initTimeSkippingInfo implementation changes? ditto below with updateTimeSkippingInfo

@feiyang3cat feiyang3cat Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually I am thinking to remove the errors returned by init/update completely after I change in workflows to use the SetTSI as well once this is merged. And have added a todo for it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

solved by rebasing the newest main

@awln-temporal
awln-temporal self-requested a review July 8, 2026 15:25
@feiyang3cat
feiyang3cat requested a review from a team as a code owner July 9, 2026 21:12
@feiyang3cat
feiyang3cat force-pushed the fx/vts-chasm-framework branch 3 times, most recently from e0719b1 to 22c69cb Compare July 14, 2026 00:38
@feiyang3cat
feiyang3cat requested a review from a team as a code owner July 14, 2026 18:35
@feiyang3cat
feiyang3cat force-pushed the fx/vts-chasm-framework branch from 59fb047 to cf53df6 Compare August 23, 2026 18:14
@feiyang3cat
feiyang3cat requested a review from a team August 23, 2026 18:14
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.

3 participants