Skip to content

fix(rust): a resume goes on with the slice's stretch and the CPU clock's backstops - #195

Merged
kommander merged 1 commit into
devfrom
fix/slice-across-resume
Dec 2, 2026
Merged

kommander merged 1 commit into
devfrom
fix/slice-across-resume

Conversation

@kommander

Copy link
Copy Markdown
Contributor

Limits::slice_ms restarted its stretch on every resume, and Clock::ThreadCpu's backstops (CPU time with host calls, waits) restarted at zero, so a run suspended and resumed often enough never ended. The header's budget now saves stretchUs, stretchTotalUs, totalUs and waitedUs (only where they apply; a missing field reads as 0; FORMAT unchanged), and a resume goes on from them. The round-trip test mode restores through the same fields, and the VM it swaps in now enters the CPU meter, so PSYCHOSCRIPT_ROUNDTRIP=1 cargo test -p psychoscript --test clock finishes. Rust only: TS has no slice or CPU clock.

…k's backstops

Limits::slice_ms started a new stretch on every resume, and Clock::ThreadCpu's backstops (CPU time with host calls,
waits) started again from zero, so a run suspended and resumed often enough never ended. The header's budget saves
them (stretchUs, stretchTotalUs, totalUs, waitedUs, only where they apply; missing reads as zero), and a resume goes
on from there. The round-trip test mode restores through them too, and its swapped-in VM now enters the CPU meter.
@kommander
kommander merged commit f3fdc47 into dev Dec 2, 2026
2 checks passed
@kommander
kommander deleted the fix/slice-across-resume branch December 2, 2026 22:43
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