Skip to content

benchmarking/sweperf: honor --lifecycle-mode for suspend - #3068

Merged
Tim Hockin (thockin) merged 2 commits into
agent-substrate:mainfrom
pmandewalkar:sweperf-lifecycle-mode
Oct 21, 2026
Merged

Tim Hockin (thockin) merged 2 commits into
agent-substrate:mainfrom
pmandewalkar:sweperf-lifecycle-mode

Conversation

@pmandewalkar

@pmandewalkar Parnika Mandewalkar (pmandewalkar) commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

sweperf always sent a synchronous SuspendActor and ignored the shared --lifecycle-mode flag that agentsession, ateenv and glutton honor. Lifecycle v2 defaults to async suspend, so sweperf couldn't measure the path most users take without a code change.

sweperf now embeds dynconfig.Lifecycle like the other classes. With --lifecycle-mode pause, it sends an asynchronous SuspendActor, recorded as SuspendActorAsync. The default (suspend) keeps today's behavior, so existing runs are unchanged. --lifecycle-mode none and --resume-mode implicit are refused, since every sweperf cycle ends in a suspend and resumes with ResumeActor.

note: pause is the existing --lifecycle-mode value for async SuspendActor according to how the other benchmarks do it; was wondering if we should change the naming for all since PauseActor is gone per #2813

AI use: AI-assisted, I reviewed and tested it.

  • Tests pass
  • Docs updated

@pmandewalkar Parnika Mandewalkar (pmandewalkar) changed the title benchmarking/sweperf: honor --lifecycle-mode for lifecyclev2 benchmarking/sweperf: honor --lifecycle-mode for suspend Oct 21, 2026
@pmandewalkar

Copy link
Copy Markdown
Contributor Author

PTAL when possible Haowei Cai (Roy) (@roycaihw) , Max Smythe (@maxsmythe), thank you!!

…pend

sweperf always sent a synchronous SuspendActor, ignoring the shared
--lifecycle-mode flag that agentsession, ateenv and glutton honor. sweperf
now embeds dynconfig.Lifecycle like those classes. With lifecycle_mode=pause
it sends an asynchronous SuspendActor, recorded as SuspendActorAsync like the
other classes. The default (suspend) keeps today's behavior. lifecycle_mode
none and resume_mode implicit are refused, since every sweperf cycle ends in
a suspend and resumes with ResumeActor.

pause is the existing --lifecycle-mode value for async SuspendActor;
PauseActor itself was removed in agent-substrate#2813.
err := u.tracedCall(ctx, "SuspendActor", func(callCtx context.Context, tr *metadata.MD) error {
name, mode := "SuspendActor", ateapipb.DurabilityMode_DURABILITY_MODE_SYNCHRONOUS
if dynconfig.Get[knobs](u.cfg.Dyn).LifecycleMode == dynconfig.LifecycleModePause {
name, mode = "SuspendActorAsync", ateapipb.DurabilityMode_DURABILITY_MODE_ASYNCHRONOUS

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.

Should this just be enforced always? Is substrate still recommending sync mode? What are other tests doing? I thought the sync mode was going away.

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.

The default (suspend) keeps today's behavior, so existing runs are unchanged

Do we still care about sync behavior's performance? I thought it's more like an anti-pattern than a feature now.

@pmandewalkar

Copy link
Copy Markdown
Contributor Author

Hmm good question! I modeled this after how all the other tests have implemented the flag (it's just adding the same porting for the most part that glutton and agent session have done). From this it seems like as of now sync isn't going away yet. The lifecycle-mode defaults to sync for all of the benchmark loads, so if we want to make sweperf default async, I'd like input from Max Smythe (@maxsmythe) and we can do that for all the test workloads?

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.

I'm okay with this change assuming it's following the pattern with other tests. Maybe we should switch the default so the default is async instead of sync

@pmandewalkar

Copy link
Copy Markdown
Contributor Author

Committed your suggestion! Discussed offline that if the sync implementation matches the other benchmarks it's okay. The async default question is still open and we can do that in another pr for all benchmarks if we want that.

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.

LGTM

@thockin
Tim Hockin (thockin) added this pull request to the merge queue Oct 21, 2026
Merged via the queue into agent-substrate:main with commit 4b3e000 Oct 21, 2026
15 checks passed
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