Skip to content

[don't merge] Time-skipping POC for CHASM with SAA#10799

Open
feiyang3cat wants to merge 13 commits into
temporalio:mainfrom
feiyang3cat:ts-chasm-framework
Open

[don't merge] Time-skipping POC for CHASM with SAA#10799
feiyang3cat wants to merge 13 commits into
temporalio:mainfrom
feiyang3cat:ts-chasm-framework

Conversation

@feiyang3cat

@feiyang3cat feiyang3cat commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

for discussion only
feature API branch: temporalio/api#802

@feiyang3cat feiyang3cat requested review from a team as code owners June 22, 2026 02:53
@feiyang3cat feiyang3cat changed the title [don't merge] time-skipping POC for CHASM with SAA [don't merge] Time-skipping POC for CHASM with SAA Jun 22, 2026
_, err = mutableState.AddWorkflowExecutionTimeSkippingTransitionedEvent(
ctx, time.Time{}, true)
if err != nil {
// Disable time skipping through the archetype-aware sink: workflows record a history event; CHASM

@feiyang3cat feiyang3cat Jun 22, 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.

not related to this chasm-pr, but have detected a refinement point for the whole project here that this task is also a part of what offers by the history substrate and it only turns off the TS and doesn't need regeneration of timer tasks

@feiyang3cat feiyang3cat force-pushed the ts-chasm-framework branch 9 times, most recently from 472df9c to 4ed50b4 Compare July 1, 2026 04:04
@feiyang3cat feiyang3cat force-pushed the ts-chasm-framework branch from 4ed50b4 to 390149c Compare July 1, 2026 05:23
// TODO(time-skipping/chasm): emit the fast-forward wake as a ChasmTaskPure on the root component and
// anchor its staleness check on the VersionedTransition (as ChasmTaskInfo does) rather than an
// event ID.
const chasmNoEventID int64 = -1

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.

this is just for the PoC to work, another PR is removing the dependence of eventID in time skipping

return ms
}

// TestTimeSkipping_StartDelayAndRetryBackoff verifies that a standalone activity, which opts into

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.

need to add more functional test cases in real code PR (like ff timer fired correctly

Comment thread chasm/tree.go

for _, pureTask := range componentAttr.GetPureTasks() {
pureTask.PhysicalTaskStatus = physicalTaskStatusNone
if firstPureTask == nil || comparePureTasks(pureTask, firstPureTask) < 0 {

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.

pure task is backed by one physical task, so here find the earliest one

Comment thread chasm/timeskippping.go

// TimeSkippingTransition is a time-skipping decision and is shared between the CHASM framework and
// the history substrate.
type TimeSkippingTransition struct {

@feiyang3cat feiyang3cat Jul 1, 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.

temporary redundancy to avoid moving the same data structure from service/history to this folder

@feiyang3cat feiyang3cat force-pushed the ts-chasm-framework branch from 390149c to 9674980 Compare July 1, 2026 06:02
ctx context.Context,
transactionPolicy historyi.TransactionPolicy,
) (needRegenTasks bool) {
// This is the workflow (history-event) time-skipping path. CHASM executions (e.g. standalone

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.

this should be fixed in another PR that all workflow-specific paths should check this flag

@feiyang3cat feiyang3cat force-pushed the ts-chasm-framework branch from a59298d to 6cf4bc3 Compare July 1, 2026 06:37
@feiyang3cat feiyang3cat force-pushed the ts-chasm-framework branch from 6cf4bc3 to 6e5972a Compare July 1, 2026 15:59
Comment thread chasm/timeskippping.go
IsExecutionSkippable(ctx Context) bool
}

// TimeSkippingRuntimeTargetProvider is the optional, by default the framework scans the tree's

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.

save this for later, just delete it

Comment thread chasm/tree.go
// one (e.g. bare test mocks).
//
// TODO: Now() could be different for components after we support Pause for CHASM components.
if np, ok := n.backend.(nowProvider); ok {

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.

always be backend

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.

1 participant