@@ -84,6 +84,11 @@ const argv = yargsParser(process.argv.slice(2), {
84
84
// previous syscalls for the same metadata were recorded.
85
85
'simulateVcSyscalls' ,
86
86
87
+ // Deliver all syscall responses in lockstep between concurrent workers.
88
+ // When this option is disabled, concurrent workers are only synchronized
89
+ // at delivery boundaries.
90
+ 'synchronizeSyscalls' ,
91
+
87
92
// Use a simplified snapstore which derives the snapshot filename from the
88
93
// transcript and doesn't compress the snapshot
89
94
'useCustomSnapStore' ,
@@ -137,6 +142,7 @@ const argv = yargsParser(process.argv.slice(2), {
137
142
keepWorkerTransactionNums : [ ] ,
138
143
skipExtraVcSyscalls : true ,
139
144
simulateVcSyscalls : true ,
145
+ synchronizeSyscalls : false ,
140
146
useCustomSnapStore : false ,
141
147
recordXsnapTrace : false ,
142
148
useXsnapDebug : false ,
@@ -542,7 +548,7 @@ async function replay(transcriptFile) {
542
548
543
549
/**
544
550
* @param {WorkerData } workerData
545
- * @returns {import('../src/kernel/vat-loader/transcript.js').CompareSyscalls }
551
+ * @returns {import('../src/kernel/vat-loader/transcript.js').CompareSyscalls<boolean> }
546
552
*/
547
553
const makeCompareSyscalls = workerData => {
548
554
const doCompare = (
@@ -618,8 +624,16 @@ async function replay(transcriptFile) {
618
624
originalSyscall,
619
625
newSyscall,
620
626
} ) ;
621
- workerData . timeOfLastCommand = performance . now ( ) ;
622
- return result ;
627
+ const finish = ( ) => {
628
+ workerData . timeOfLastCommand = performance . now ( ) ;
629
+ return result ;
630
+ } ;
631
+ if ( argv . synchronizeSyscalls && result !== missingSyscall ) {
632
+ completeWorkerStep ( workerData ) ;
633
+ return workersSynced . then ( finish ) ;
634
+ } else {
635
+ return finish ( ) ;
636
+ }
623
637
} ;
624
638
return compareSyscalls ;
625
639
} ;
0 commit comments