8000 zdxsv replay: download on a worker thread, cancel at VM shutdown by inada-s-ai[bot] · Pull Request #682 · inada-s/pcsx2 · GitHub
[go: up one dir, main page]

Skip to content

zdxsv replay: download on a worker thread, cancel at VM shutdown - #682

Merged
inada-s merged 1 commit into
zdxsv-masterfrom
ai/replay-fetch-worker
Nov 19, 2026
Merged

inada-s merged 1 commit into
zdxsv-masterfrom
ai/replay-fetch-worker

Conversation

@inada-s-ai
@inada-s-ai inada-s-ai Bot commented Nov 18, 2026 •
Copy link
Copy Markdown

Description of Changes

A replay's downloads (the .pb, the lobby's /lbs/replay answer, a common state not yet in the cache) now run on a worker thread. When they finish, the replay start continues on the CPU thread. A VM shutdown or reset cancels them (HTTPDownloader's progress-callback cancel), joins the worker and drops the queued continuation. A broken cached common state is still downloaded again once per URL per run, now also on the worker. docs/zdxsv/replay.md says so.

Rationale behind Changes

The downloads ran on the CPU thread, with a timeout of up to 120 s each. Until they ended, the emulator could not pause or shut down.

Suggested Testing Steps

Verified on Windows x64 (MSVC build, private rig): a replay over a slow local HTTP server (8 s per answer) played and matched its recorded trace. The VM kept running during the downloads. Closing the window during a slow download cancelled the request and exited at once. Control on the unfixed build: the shutdown waited for the HTTP request to end. Local-file replay and a re-download of a truncated cached common state: PASS. Merged with PR 669, PR 663 and PR 661: clean, builds, HTTP replay PASS.
Not run: Linux, macOS, arm64, a live (live:) battle, a point-of-view switch. No rig script committed (the slow-server rig lives outside the repo).
ReplayLoad.cpp grows past the 800-line split guideline (it was 944 lines before). Splitting out the download code is left for its own PR.

Did you use AI to help find, test, or implement this issue or feature?

Yes: written and tested by Claude Code.

🤖 Generated with Claude Code

…read, cancel at VM shutdown

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@inada-s
inada-s merged commit e31fbce into zdxsv-master Nov 19, 2026
3 of 4 checks passed
@inada-s
inada-s deleted the ai/replay-fetch-worker branch November 19, 2026 04:44
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

0