From 2a1e2dd71c41e0273545f8e2c3c64dc13442685b Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Sun, 15 Nov 2026 08:33:16 +0100 Subject: [PATCH] results: slice 3 test and mutation logs (#18) --- results/mutation.log | 181 ++++++++++++++++++++++++++++++++++++---- results/nimble-test.log | 34 ++++++++ 2 files changed, 198 insertions(+), 17 deletions(-) diff --git a/results/mutation.log b/results/mutation.log index f4f2ea6..6968236 100644 --- a/results/mutation.log +++ b/results/mutation.log @@ -39,6 +39,12 @@ [OK] revokePlayer returns every live connection of that player and nothing else [OK] remove works by conn id; an unknown id is a no-op [OK] connForWs finds the registered socket (mummy hands the same value back) + [OK] the frame counter starts at 1 on each connection and is never global + [OK] a removed connection has no next frame number; the caller sends closing with frameNo + [OK] the intent bucket is per connection: draining one leaves the other full + [OK] the malformed window is per connection and fires on the tenth frame + [OK] a Pong is recorded on the right connection + [OK] a snapshot hands out every live connection without holding the lock afterwards [OK] FIPS 180-4 known answers [OK] padding boundaries: 55, 56 and 64 byte messages differ and are stable [OK] 20 symbols in 5 groups of 4, no look-alike characters @@ -156,6 +162,27 @@ [OK] P3 negative control: a wall inside the disc IS visible through replies (the harness can fail) [OK] P4: probing cannot unflag or move a blocked token [OK] doors beyond the bound: opening or closing them changes no reply + [OK] a well-formed intent parses and keeps its reqId and node + [OK] reqId boundaries: 0 and 2^31-1 pass, 2^31 and -1 are malformed + [OK] every unreadable frame is malformed, never an ack + [OK] a payload that is not UTF-8 is malformed even when it parses as JSON bytes + [OK] the catalogue is the 29 intents of 6.1 and the built set is a subset + [OK] role classes: the GM-only set never swallows the intents both roles may send + [OK] only this slice's intents answer with a real handler + [OK] a fresh bucket allows exactly the burst, then refuses + [OK] refill is continuous at 30/s, capped at the burst + [OK] the refill never exceeds the burst, however long the connection idles + [OK] the bucket is per connection and starts full: no shared state + [OK] nine malformed frames are tolerated, the tenth closes + [OK] a frame slower than the window does not count: 9 fast + 1 slow is not a flood + [OK] the window slides: the flood fires again only on a fresh ten inside it + [OK] a second connection has its own window + [OK] hello carries proto, role, me and n; an unnamed player's name is null + [OK] ack ok carries its result fields and never a code + [OK] a refusal is a static code and no state + [OK] the uniform move refusal carries pos and no code (5.5, T9) + [OK] error and closing frames have no reqId + [OK] the close-code table of 6.5 is the app range plus 1008 [OK] exactly n walls, deterministic per seed, seeds differ [OK] doors are every 10th wall, all closed; walls stay inside the world (+- jitter) [OK] walls are non-degenerate and axis-ish segments of room-edge length @@ -200,7 +227,7 @@ control: exit=0 expected_failed=0 ok [FAILED] prototype scene, all tokens, doors closed and opened [FAILED] random wall fields, cell 32 and 25 [OK] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/a/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/a/w/tests/tgeometry' # test exit=1; expected tests failed: 1 [FAILED] rays nudged past a corner: area just beyond a wall end is visible @@ -244,7 +271,7 @@ a: exit=1 expected_failed=1 ok [OK] prototype scene, all tokens, doors closed and opened [OK] random wall fields, cell 32 and 25 [OK] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/b/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/b/w/tests/tgeometry' # test exit=1; expected tests failed: 2 [FAILED] '<' apex: ray through the shared tip must not leak [FAILED] every segment endpoint is a polygon vertex (lower and upper end inclusive) @@ -289,7 +316,7 @@ b: exit=1 expected_failed=2 ok [FAILED] prototype scene, all tokens, doors closed and opened [OK] random wall fields, cell 32 and 25 [OK] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/c/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/c/w/tests/tgeometry' # test exit=1; expected tests failed: 2 [FAILED] '<' apex: ray through the shared tip must not leak [FAILED] every segment endpoint is a polygon vertex (lower and upper end inclusive) @@ -334,7 +361,7 @@ c: exit=1 expected_failed=2 ok [OK] prototype scene, all tokens, doors closed and opened [OK] random wall fields, cell 32 and 25 [OK] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/d1/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/d1/w/tests/tgeometry' # test exit=1; expected tests failed: 1 [FAILED] shared vertex: both arms required (mutation d1/d2) @@ -378,7 +405,7 @@ d1: exit=1 expected_failed=1 ok [OK] prototype scene, all tokens, doors closed and opened [OK] random wall fields, cell 32 and 25 [OK] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/d2/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/d2/w/tests/tgeometry' # test exit=1; expected tests failed: 1 [FAILED] shared vertex: both arms required (mutation d1/d2) @@ -420,7 +447,7 @@ d2: exit=1 expected_failed=1 ok [FAILED] prototype scene, all tokens, doors closed and opened [FAILED] random wall fields, cell 32 and 25 [FAILED] negative control: the oracle notices a missing and an invented cell -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/e/w/tests/tgeometry' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/e/w/tests/tgeometry' # test exit=1; expected tests failed: 4 [FAILED] random visibility polygons: identical cell lists [FAILED] random simple polygons (star-shaped, concave): identical cell lists @@ -485,7 +512,7 @@ e: exit=1 expected_failed=4 ok [FAILED] GM manual clear inside a wall: player escapes sideways, cannot cross [OK] an unrelated wall change elsewhere does not re-block a GM-cleared token [OK] no escape hatch: a player cannot walk through any wall of a boxed room -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/f/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/f/w/tests/tmoverules' # test exit=1; expected tests failed: 1 [FAILED] overlapping 10 px off: may leave away from the wall, not cross it, not stay overlapped @@ -547,7 +574,7 @@ f: exit=1 expected_failed=1 ok [FAILED] GM manual clear inside a wall: player escapes sideways, cannot cross [OK] an unrelated wall change elsewhere does not re-block a GM-cleared token [OK] no escape hatch: a player cannot walk through any wall of a boxed room -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/g/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/g/w/tests/tmoverules' # test exit=1; expected tests failed: 1 [FAILED] GM: ignores walls, step cap and blocked; bounds still apply @@ -609,7 +636,7 @@ g: exit=1 expected_failed=1 ok [OK] GM manual clear inside a wall: player escapes sideways, cannot cross [OK] an unrelated wall change elsewhere does not re-block a GM-cleared token [OK] no escape hatch: a player cannot walk through any wall of a boxed room -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/h/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/h/w/tests/tmoverules' # test exit=1; expected tests failed: 2 [FAILED] corner clipping: path passes the wall end closer than r though both ends are clear [FAILED] leg of the path inside r of a non-start wall blocks even if start and end are clear @@ -670,13 +697,13 @@ h: exit=1 expected_failed=2 ok [OK] GM manual clear inside a wall: player escapes sideways, cannot cross [OK] an unrelated wall change elsewhere does not re-block a GM-cleared token [OK] no escape hatch: a player cannot walk through any wall of a boxed room -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/i/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/i/w/tests/tmoverules' [FAILED] P1: probes longer than the cap get one fixed nack regardless of the scene [OK] P2: scenes differing only beyond the bound give identical replies over 3000 probes [OK] P3 negative control: a wall inside the disc IS visible through replies (the harness can fail) [OK] P4: probing cannot unflag or move a blocked token [OK] doors beyond the bound: opening or closing them changes no reply -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/i/w/tests/tprobing' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/i/w/tests/tprobing' # test exit=1; expected tests failed: 2 [FAILED] step cap = scene default without vision, token vision radius with it [FAILED] P1: probes longer than the cap get one fixed nack regardless of the scene @@ -739,7 +766,7 @@ i: exit=1 expected_failed=2 ok [FAILED] GM manual clear inside a wall: player escapes sideways, cannot cross [OK] an unrelated wall change elsewhere does not re-block a GM-cleared token [OK] no escape hatch: a player cannot walk through any wall of a boxed room -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/j/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/j/w/tests/tmoverules' # test exit=1; expected tests failed: 2 [FAILED] wall added within r of the circle (centre not on it) sets blocked; exactly r does not [FAILED] Q14: a door closed 10 px from a token: pushed to its side, clear by r, not blocked; GM-owned too @@ -802,7 +829,7 @@ j: exit=1 expected_failed=2 ok [OK] GM manual clear inside a wall: player escapes sideways, cannot cross [OK] an unrelated wall change elsewhere does not re-block a GM-cleared token [OK] no escape hatch: a player cannot walk through any wall of a boxed room -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/k/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/k/w/tests/tmoverules' # test exit=1; expected tests failed: 2 [FAILED] KEEP: opening one door / removing one wall while another overlaps -> still blocked; last one frees [FAILED] KEEP: wall update away from one of two overlapping walls keeps blocked @@ -863,7 +890,7 @@ k: exit=1 expected_failed=2 ok [FAILED] GM manual clear inside a wall: player escapes sideways, cannot cross [OK] an unrelated wall change elsewhere does not re-block a GM-cleared token [OK] no escape hatch: a player cannot walk through any wall of a boxed room -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/l/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/l/w/tests/tmoverules' # test exit=1; expected tests failed: 3 [FAILED] GM moves a stuck token clear -> free; to another wall-overlapping spot -> still blocked [FAILED] GM drops a token inside a wall -> blocked; a door counts only while closed @@ -927,7 +954,7 @@ l: exit=1 expected_failed=3 ok [OK] GM manual clear inside a wall: player escapes sideways, cannot cross [OK] an unrelated wall change elsewhere does not re-block a GM-cleared token [OK] no escape hatch: a player cannot walk through any wall of a boxed room -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/m/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/m/w/tests/tmoverules' # test exit=1; expected tests failed: 3 [FAILED] Q14: a door closed 10 px from a token: pushed to its side, clear by r, not blocked; GM-owned too [FAILED] push: centre on the door line -> side of the previous position; no history -> left of a->b @@ -991,7 +1018,7 @@ m: exit=1 expected_failed=3 ok [OK] GM manual clear inside a wall: player escapes sideways, cannot cross [OK] an unrelated wall change elsewhere does not re-block a GM-cleared token [OK] no escape hatch: a player cannot walk through any wall of a boxed room -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/n/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/n/w/tests/tmoverules' # test exit=1; expected tests failed: 2 [FAILED] push: one side blocked by another wall -> the other side; out of bounds -> the other side [FAILED] push: both sides invalid -> blocked in place; door open -> free; GM can still move it @@ -1054,9 +1081,129 @@ n: exit=1 expected_failed=2 ok [OK] GM manual clear inside a wall: player escapes sideways, cannot cross [OK] an unrelated wall change elsewhere does not re-block a GM-cleared token [OK] no escape hatch: a player cannot walk through any wall of a boxed room -Error: execution of an external program failed: '/tmp/fffmut.h50GP1/o/w/tests/tmoverules' +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/o/w/tests/tmoverules' # test exit=1; expected tests failed: 1 [FAILED] push: centre on the door line -> side of the previous position; no history -> left of a->b o: exit=1 expected_failed=1 ok +## p: token bucket never refills +# diff server/protocol.nim -> mutated copy: +# 195d194 +# < r.tokens = min(r.burst, r.tokens + float(elapsed) * r.perSecond / 1000.0) + [OK] a well-formed intent parses and keeps its reqId and node + [OK] reqId boundaries: 0 and 2^31-1 pass, 2^31 and -1 are malformed + [OK] every unreadable frame is malformed, never an ack + [OK] a payload that is not UTF-8 is malformed even when it parses as JSON bytes + [OK] the catalogue is the 29 intents of 6.1 and the built set is a subset + [OK] role classes: the GM-only set never swallows the intents both roles may send + [OK] only this slice's intents answer with a real handler + [OK] a fresh bucket allows exactly the burst, then refuses + [FAILED] refill is continuous at 30/s, capped at the burst + [FAILED] the refill never exceeds the burst, however long the connection idles + [OK] the bucket is per connection and starts full: no shared state + [OK] nine malformed frames are tolerated, the tenth closes + [OK] a frame slower than the window does not count: 9 fast + 1 slow is not a flood + [OK] the window slides: the flood fires again only on a fresh ten inside it + [OK] a second connection has its own window + [OK] hello carries proto, role, me and n; an unnamed player's name is null + [OK] ack ok carries its result fields and never a code + [OK] a refusal is a static code and no state + [OK] the uniform move refusal carries pos and no code (5.5, T9) + [OK] error and closing frames have no reqId + [OK] the close-code table of 6.5 is the app range plus 1008 +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/p/w/tests/tprotocol' +# test exit=1; expected tests failed: 1 + [FAILED] refill is continuous at 30/s, capped at the burst + +p: exit=1 expected_failed=1 ok +## q: reqId upper bound dropped +# diff server/protocol.nim -> mutated copy: +# 129c129 +# < if reqId < 0 or reqId > MaxReqId: return +# --- +# > if reqId < 0: return + [OK] a well-formed intent parses and keeps its reqId and node + [FAILED] reqId boundaries: 0 and 2^31-1 pass, 2^31 and -1 are malformed + [OK] every unreadable frame is malformed, never an ack + [OK] a payload that is not UTF-8 is malformed even when it parses as JSON bytes + [OK] the catalogue is the 29 intents of 6.1 and the built set is a subset + [OK] role classes: the GM-only set never swallows the intents both roles may send + [OK] only this slice's intents answer with a real handler + [OK] a fresh bucket allows exactly the burst, then refuses + [OK] refill is continuous at 30/s, capped at the burst + [OK] the refill never exceeds the burst, however long the connection idles + [OK] the bucket is per connection and starts full: no shared state + [OK] nine malformed frames are tolerated, the tenth closes + [OK] a frame slower than the window does not count: 9 fast + 1 slow is not a flood + [OK] the window slides: the flood fires again only on a fresh ten inside it + [OK] a second connection has its own window + [OK] hello carries proto, role, me and n; an unnamed player's name is null + [OK] ack ok carries its result fields and never a code + [OK] a refusal is a static code and no state + [OK] the uniform move refusal carries pos and no code (5.5, T9) + [OK] error and closing frames have no reqId + [OK] the close-code table of 6.5 is the app range plus 1008 +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/q/w/tests/tprotocol' +# test exit=1; expected tests failed: 1 + [FAILED] reqId boundaries: 0 and 2^31-1 pass, 2^31 and -1 are malformed + +q: exit=1 expected_failed=1 ok +## r: malformed flood never fires +# diff server/protocol.nim -> mutated copy: +# 216c216 +# < result = f.count >= MalformedFloodLimit and (nowMs - oldest) <= MalformedFloodWindowMs +# --- +# > result = f.count > MalformedFloodLimit and (nowMs - oldest) <= MalformedFloodWindowMs + [OK] a well-formed intent parses and keeps its reqId and node + [OK] reqId boundaries: 0 and 2^31-1 pass, 2^31 and -1 are malformed + [OK] every unreadable frame is malformed, never an ack + [OK] a payload that is not UTF-8 is malformed even when it parses as JSON bytes + [OK] the catalogue is the 29 intents of 6.1 and the built set is a subset + [OK] role classes: the GM-only set never swallows the intents both roles may send + [OK] only this slice's intents answer with a real handler + [OK] a fresh bucket allows exactly the burst, then refuses + [OK] refill is continuous at 30/s, capped at the burst + [OK] the refill never exceeds the burst, however long the connection idles + [OK] the bucket is per connection and starts full: no shared state + [FAILED] nine malformed frames are tolerated, the tenth closes + [OK] a frame slower than the window does not count: 9 fast + 1 slow is not a flood + [FAILED] the window slides: the flood fires again only on a fresh ten inside it + [OK] a second connection has its own window + [OK] hello carries proto, role, me and n; an unnamed player's name is null + [OK] ack ok carries its result fields and never a code + [OK] a refusal is a static code and no state + [OK] the uniform move refusal carries pos and no code (5.5, T9) + [OK] error and closing frames have no reqId + [OK] the close-code table of 6.5 is the app range plus 1008 +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/r/w/tests/tprotocol' +# test exit=1; expected tests failed: 1 + [FAILED] nine malformed frames are tolerated, the tenth closes + +r: exit=1 expected_failed=1 ok +## s: the frame counter never advances +# diff server/conns.nim -> mutated copy: +# 143c143 +# < inc c.active[i].frames +# --- +# > discard + [OK] 16 reservations succeed, the 17th is refused + [OK] a cancelled reservation gives the slot back + [OK] activated connections keep the total cap; removing one frees a slot + [OK] the 5th connection of one player evicts that player's oldest + [OK] another player's connections are never evicted + [OK] the GM is capped like anyone else (caps are per player, not per role) + [OK] revokePlayer returns every live connection of that player and nothing else + [OK] remove works by conn id; an unknown id is a no-op + [OK] connForWs finds the registered socket (mummy hands the same value back) + [FAILED] the frame counter starts at 1 on each connection and is never global + [FAILED] a removed connection has no next frame number; the caller sends closing with frameNo + [OK] the intent bucket is per connection: draining one leaves the other full + [OK] the malformed window is per connection and fires on the tenth frame + [OK] a Pong is recorded on the right connection + [OK] a snapshot hands out every live connection without holding the lock afterwards +Error: execution of an external program failed: '/tmp/fffmut.Fly4Fe/s/w/tests/tconns' +# test exit=1; expected tests failed: 1 + [FAILED] the frame counter starts at 1 on each connection and is never global + +s: exit=1 expected_failed=1 ok exit=0 diff --git a/results/nimble-test.log b/results/nimble-test.log index 8105b6b..a6b481d 100644 --- a/results/nimble-test.log +++ b/results/nimble-test.log @@ -55,6 +55,13 @@ ... [OK] revokePlayer returns every live connection of that player and nothing else ... [OK] remove works by conn id; an unknown id is a no-op ... [OK] connForWs finds the registered socket (mummy hands the same value back) + ... [Suite] per-connection wire state (#18) + ... [OK] the frame counter starts at 1 on each connection and is never global + ... [OK] a removed connection has no next frame number; the caller sends closing with frameNo + ... [OK] the intent bucket is per connection: draining one leaves the other full + ... [OK] the malformed window is per connection and fires on the tenth frame + ... [OK] a Pong is recorded on the right connection + ... [OK] a snapshot hands out every live connection without holding the lock afterwards Success: Execution finished Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tcrypto (from package fff_vtt) using c backend Nim Output [Suite] sha256 @@ -212,6 +219,33 @@ ... [OK] P4: probing cannot unflag or move a blocked token ... [OK] doors beyond the bound: opening or closing them changes no reply Success: Execution finished + Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tprotocol (from package fff_vtt) using c backend + Nim Output [Suite] envelope (6.5 step 2) + ... [OK] a well-formed intent parses and keeps its reqId and node + ... [OK] reqId boundaries: 0 and 2^31-1 pass, 2^31 and -1 are malformed + ... [OK] every unreadable frame is malformed, never an ack + ... [OK] a payload that is not UTF-8 is malformed even when it parses as JSON bytes + ... [OK] the catalogue is the 29 intents of 6.1 and the built set is a subset + ... [OK] role classes: the GM-only set never swallows the intents both roles may send + ... [OK] only this slice's intents answer with a real handler + ... [Suite] intent rate limit (6.4: 30/s, burst 100) + ... [OK] a fresh bucket allows exactly the burst, then refuses + ... [OK] refill is continuous at 30/s, capped at the burst + ... [OK] the refill never exceeds the burst, however long the connection idles + ... [OK] the bucket is per connection and starts full: no shared state + ... [Suite] malformed flood (6.5 row 8: 10 inside any 10 s) + ... [OK] nine malformed frames are tolerated, the tenth closes + ... [OK] a frame slower than the window does not count: 9 fast + 1 slow is not a flood + ... [OK] the window slides: the flood fires again only on a fresh ten inside it + ... [OK] a second connection has its own window + ... [Suite] server frames (6.1) + ... [OK] hello carries proto, role, me and n; an unnamed player's name is null + ... [OK] ack ok carries its result fields and never a code + ... [OK] a refusal is a static code and no state + ... [OK] the uniform move refusal carries pos and no code (5.5, T9) + ... [OK] error and closing frames have no reqId + ... [OK] the close-code table of 6.5 is the app range plus 1008 + Success: Execution finished Compiling /home/davide/Projects/GDR/FFF_vtt/tests/tscenegen (from package fff_vtt) using c backend Nim Output [Suite] scenegen (bench scenes) ... [OK] exactly n walls, deterministic per seed, seeds differ