Skip to content

PERF: Prepare scenarios on the backend event loop - #3046

Open
Richard Lundeen (richlundeen) wants to merge 7 commits into
microsoft:mainfrom
richlundeen:richlundeen-single-loop-scenario-preparation
Open

Richard Lundeen (richlundeen) wants to merge 7 commits into
microsoft:mainfrom
richlundeen:richlundeen-single-loop-scenario-preparation

Conversation

@richlundeen

Copy link
Copy Markdown
Contributor

Prepare and execute scenarios on one backend event loop so async memory resources stay valid and the backend remains responsive.

We removed the preparation executor, temporary event loop, and per-launch memory disposal while preserving serialized preparation and FIFO execution. We moved blocking construction off-loop and retained cleanup for requests cancelled before scheduler admission, without changing HTTP disconnect shielding or runs already owned by the scheduler. We added regression coverage for cancellation during admission, construction responsiveness, shared SQLite loop resources, and shutdown ordering.

Retain serialized preparation and abandoned admission cleanup, offload blocking construction, and preserve runtime shutdown ownership.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8fabc130-e568-4583-9ff0-ec26491a6414
Keep upstream statistics and async-generator typing while removing the preparation executor.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8fabc130-e568-4583-9ff0-ec26491a6414
@richlundeen Richard Lundeen (richlundeen) changed the title FIX: Prepare scenarios on the backend event loop PERF: Prepare scenarios on the backend event loop Oct 8, 2026
@romanlutz Roman Lutz (romanlutz) self-assigned this Oct 9, 2026
Comment thread pyrit/backend/services/scenario_run_service.py
Preserve external parameter validation and off-loop scenario discovery.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8fabc130-e568-4583-9ff0-ec26491a6414
Offload matrix, template, and converter construction while keeping async dataset reads and persistence on the backend loop. Cover a real seven-dataset RapidResponse launch and template reads for ManyShot, Crescendo, TAP, and Skeleton Key.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8fabc130-e568-4583-9ff0-ec26491a6414
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8fabc130-e568-4583-9ff0-ec26491a6414
Comment thread pyrit/backend/services/scenario_run_service.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8fabc130-e568-4583-9ff0-ec26491a6414
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8fabc130-e568-4583-9ff0-ec26491a6414
@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Oct 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 10, 2026

This branch has not been deployed

No deployments
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