The same lab replays identically, and now something says so (#1419) #1420
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1420
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "test/replay-identical"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #1419.
Three engine modules compute with the simulator's own
steprather than a clock, and say so in a comment (engine/flow.js:177,engine/nat.js:15,engine/dhcp.js:15). Nothing enforced it - the same shape as the six drifts already landed in this repository.The failure it protects against is silent. One
Date.now()in a newly written module and two servers running the same document publish different payloads: an unreproducible test, or a diff between two boards that reads as a real difference.Two guards, because each catches what the other cannot
Statically - no
Math.random(,Date.now(,new Date(,performance.now(,crypto.randomUUID(orprocess.hrtimeinengine/*.js, comment- and string-aware (the modules discuss every one of them in prose, so a scan that flagged its own documentation would be switched off within a week). The scanner is itself checked against a source that does contain them, so it cannot quietly stop working.Behaviourally -
showoutput on every device plusserialize());vlan, a static route, an address change, two pings), publishes a byte-identical state payload - 12 KB of runtime, counters, MAC/ARP/LLDP rows, routes and cable verdicts;fullState().A guard that cannot fail is not a guard
counters.counted, packets counted, a forwarding table learned. Two empty boards are byte-identical too.Evidence. 25 checks. Planting
Math.random()inengine/lag.jsfails the static guard by name (lag.js: Math.random()); addings.generatedAt = Date.now()tofullState()fails both the two-server comparison and the second-later read, quoting the first differing byte. Restored: 25/25. Suite: 210 suites, 8,046 assertions, 0 failed; syntax 278 files OK. Docs:docs/ARCHITECTURE.md, "The same lab replays identically" - including where wall-clock time is allowed (server side of the socket, a request log,Last-Modified).