test(core): RIP measured with Java FILIUS
RipRun runs rip-chain's three routers in Java FILIUS, each router's random set by reflection to the core's ripSeed, and writes the frames, every change of each RIP table and the calls. converge: the tables fill, a ping at 45 s. expire: R3 falls silent at 10 s; R2 marks its network 16 hops only at its own next beacon, R1 passes it on at once, the ping gets ICMP 3/0. Both match: per sending card the same messages at the same times, every table through the same states. The first 5 s are compared by the state the tables reach, since Java's routers start one after the other. Measured on the JDK: Java's pause divides nextFloat() by 3 in float; the core does too now (a millisecond off in one draw of about 10,000 before). Scenarios name their RIP routers in the new field rip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -55,9 +55,13 @@ export class JavaCompatibleRandom {
|
||||
return (this.next(26) * 2 ** 27 + this.next(27)) / 2 ** 53;
|
||||
}
|
||||
|
||||
/** Java RIP: 30 s · (f/3 + 0.84), truncated — somewhere between 25.2 s and 35.2 s. */
|
||||
/**
|
||||
* Java RIP: 30 s · (f/3 + 0.84), truncated — somewhere between 25.2 s and
|
||||
* 35.2 s. f/3 divides a float by an int, in float (JLS 5.6.2): one draw in
|
||||
* about 10,000 comes out a millisecond apart from dividing in double
|
||||
* (measured on OpenJDK 21).
|
||||
*/
|
||||
nextRipJitterMilliseconds(): number {
|
||||
const javaFloat = this.nextFloat();
|
||||
return Math.trunc(30_000.0 * (javaFloat / 3.0 + 0.84));
|
||||
return Math.trunc(30_000 * (Math.fround(this.nextFloat() / 3) + 0.84));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user