Summary
When a race is decided, a losing arm that is a plain block or a <suspends> method call is cancelled at its next suspension point as documented. A losing arm that contains a sync or race written inline is not: the nested arms keep running after the outer race has completed and their side effects appear seconds later. Moving the same sync into a <suspends> method and calling it from the arm restores cancellation, so the behavior depends on whether the nested concurrency expression is inline or behind a call.
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
- Create a Scene Graph entity in any level and attach the Verse component below.
- Build Verse and start a session.
- Read the editor log for the lines tagged
[VZ_GLP_Z1.
using { /Verse.org/SceneGraph }
using { /Verse.org/Simulation }
race_probe_component<public> := class<final_super>(component) {
OnSimulate<override>()<suspends>: void = {
# V1: a sync written inline in the losing arm.
race {
block {
Sleep(0.5)
Print("[VZ_GLP_Z1 V1] fast arm finished")
}
block {
sync {
SlowStep("V1 nested sync arm one", 3.0)
SlowStep("V1 nested sync arm two", 4.0)
}
}
}
Sleep(6.0)
Print("[VZ_GLP_Z1 V1] wait finished")
# V5: the same sync behind a method call.
race {
block {
Sleep(0.5)
Print("[VZ_GLP_Z1 V5] fast arm finished")
}
SlowPair("V5 method sync")
}
Sleep(6.0)
Print("[VZ_GLP_Z1 V5] wait finished")
}
SlowStep(Label: string, Seconds: float)<suspends>: void = {
Print("[VZ_GLP_Z1] {Label} entered")
Sleep(Seconds)
Print("[VZ_GLP_Z1] {Label} finished")
}
SlowPair(Label: string)<suspends>: void = {
sync {
SlowStep("{Label} arm one", 3.0)
SlowStep("{Label} arm two", 4.0)
}
}
}
Expected Result
After [VZ_GLP_Z1 V1] fast arm finished, no V1 nested sync arm ... finished line appears, because the losing arm and everything it started were cancelled; the same for V5.
Observed Result
V1 prints V1 nested sync arm one finished about 2.5 seconds and V1 nested sync arm two finished about 3.5 seconds after the fast arm won; V5 prints no finished line for its arms. The inline sync (and an inline race in the same position) survives the outer race, the called method does not.
Platform(s)
PC (Windows)
Additional Notes
Reproduced in UEFN 6.0.0-57316517 (Fortnite Release 42.00); first seen on 6.0.0-56878558 in a single-shape run. The full five-variant probe (plain block, sibling method, inline sync, inline race, method running a sync) is available on request; only the two inline forms fail to cancel. Internal bug database reference, for matching any follow-up to our records: K3RC7Q.