wakeOffset

fun wakeOffset(front: Rational, vRaw: Rational, weight: Weight, sleeperCredit: Long): Int128

The forward clamp applied when a child transitions idle→demanding (design §7.2): max(0, front − vRaw − sleeperCredit / weight), on the waker's own grid: max(0, ⌈front · w · G⌉ − p − sleeperCredit · G) ticks. Adding this offset to virtualService clamps the waker up to the current front (with default sleeperCredit = 0, to the front rounded up to its grid), so it cannot claim a backlog of idle virtual time. The result is the clamp a caller stores, PolicyEdge.offsetTicks: ticks on the waker's grid, wide and never saturated (#3353), so it feeds back into a PolicyEdge as it is.

Parameters

front

the parent's virtual time at the moment of waking — front, with the waker itself (and any co-waker) excluded.

vRaw

the edge's raw virtualService.

weight

the edge's weight.

sleeperCredit

bounded credit the waker may keep (default 0).


fun wakeOffset(front: VirtualTime, vRaw: VirtualTime, weight: Weight, sleeperCredit: Long): Int128

wakeOffset over VirtualTimes: the front read on the waker's grid rounded up, its own time rounded down, so the offset can only overshoot the front (§10.5).

Throws

when the front on the waker's grid passes the position limit, where no clamp can land (design §7.1).