Skip to content

fix(spu): clear abandoned drain return points on driver restarts - #761

Open
tekulvw wants to merge 1 commit into
sp00nznet:masterfrom
tekulvw:codex/upstream-spu-restart-ret
Open

tekulvw wants to merge 1 commit into
sp00nznet:masterfrom
tekulvw:codex/upstream-spu-restart-ret

Conversation

@tekulvw

@tekulvw tekulvw commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

A guest stack reset or task resume longjmps back to the driver at host depth zero. That discards every drain frame, but the old innermost drain_ret_pc survives. If a later interpreter fallback reaches that stale address, it can stop immediately and leave the run outside its intended continuation.

Clear the abandoned drain return point when handling the driver restart. This is the minimal generic part of the validated fork fix fb89f51e; no diagnostic fields, environment switches, or policy changes are added upstream.

The existing synthetic lifted-thread launch fixture now leaves a nonzero drain return point before nested reset, direct reset, and task resume. On current upstream de4f0903, all three new assertions fail (164 passed, 3 failed). With the clear, the full fixture passes 167 checks, including the existing host-depth and obsolete-caller-continuation checks. The existing macOS and Linux workflows already compile and run this fixture. Local validation used nice 15, manufactured guest memory/code only, and no GUI/GPU work.

A depth-zero restart discards every drain frame. Clear its saved return PC as well so a later interpreter fallback cannot stop at an obsolete boundary. Extend the existing synthetic fixture for nested reset, direct reset, and task resume; all three fail on upstream master without the clear.
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