feat(core): a cable carries one frame after the other, as in Java
Java's SimplexVerbindung sleeps a cable's delay with the port's buffer locked: frames on one cable leave one after the other, and a frame shows in the packet log when it leaves. The engine now queues a frame in the output buffer until the one before has arrived (ethernetLinkDeparture). Swift sends a cable's frames at once; the option swiftCables keeps that for the Swift comparison, which goes on checking everything else trace by trace. With the queue, the Java comparisons match within 120 ms (was 200); a state of the TCP stories within 250 ms, where the engine's calls block one after the other. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -72,7 +72,8 @@ function observationJson(item: IcmpObservation): Record<string, unknown> {
|
||||
}
|
||||
|
||||
function run(scenario: Scenario): Record<string, unknown> {
|
||||
const engine = new NetworkRuntimeEngine(scenario.seed);
|
||||
// Swift's cables carry all frames at once; everything else is compared as it is.
|
||||
const engine = new NetworkRuntimeEngine(scenario.seed, undefined, { swiftCables: true });
|
||||
if (scenario.speedPercent !== undefined) engine.setSimulationSpeed(scenario.speedPercent);
|
||||
engine.handle({ type: 'start', snapshot: snapshotOf(scenario), seed: scenario.seed, initialTimeMilliseconds: 0 });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user