Op::ControlBarrier requires full lockstep when being simulated

Lockstep before executing the instruction
Lockstep after executing the instruction
This commit is contained in:
Jake Turner
2025-09-27 14:18:58 +01:00
parent 357102fd3f
commit 1ccdf7f4f4
+12 -2
View File
@@ -5387,10 +5387,20 @@ bool ThreadState::CanRunAnotherStep() const
if(IsPendingResultPending())
return false;
// current instructions that require full lockstep
ConstIter it = debugger.GetIterForInstruction(nextInstruction - 1);
OpDecoder opdata(it);
switch(opdata.op)
{
// no thread can continue until all threads execute the barrier
case Op::ControlBarrier: return false;
default: break;
}
// Next instructions that prevent running another step:
// any instruction that requires threads in the tangle to be in lockstep
ConstIter it = debugger.GetIterForInstruction(nextInstruction);
OpDecoder opdata(it);
it = debugger.GetIterForInstruction(nextInstruction);
opdata = it;
switch(opdata.op)
{
// thread barriers require threads in the tangle to be in lockstep