A wall cause change (endpoint move, thickness/position, player_marker off, no longer window) committed the wall row in the FULL transaction while its marker_seen deletes rode the later NORMAL derived-memory transaction. A crash between them left the stale row, and restart restored the marker with the anchor recomputed from the NEW geometry, revealing a position the player never saw (DESIGN 5.8). updateWall now deletes the affected rows in the same FULL transaction as the replaced row, exactly as the composite FK cascade already does for wall.remove. The live del frames are unchanged and marker inserts stay in the derived transaction: wall+deletes commit, derived inserts, then ack. The marker cause signature moves to world.markerSig so the write-time delete and the online retraction cannot drift. Proof: a leakfault-only markerCrash hook quits between the wall commit and the derived write; tools/markers.test.mjs covers all four causes and restarts on a clean build, asserting no marker for the changed wall (no new anchor) and restoring the untouched window's marker as the positive control. Ref #60
21 lines
950 B
Nim
21 lines
950 B
Nim
## Test-only fault injection for the negative controls of the leak harness (DESIGN 10.1, 10.3).
|
|
## The hook is compiled in only with `-d:leakfault`, and every fault checks
|
|
## `LEAK_FAULT=<name>` from the environment: a normal build cannot fault, it contains no `LEAK_FAULT`
|
|
## string, and tools/fault.test.mjs asserts that the shipped binary's bytes lack it.
|
|
when defined(leakfault):
|
|
import std/os
|
|
|
|
proc faultActive*(name: string): bool =
|
|
## True only in a `-d:leakfault` build whose LEAK_FAULT equals `name`. Without the define this is
|
|
## the constant false, so the shipped server has no fault path at all.
|
|
when defined(leakfault):
|
|
getEnv("LEAK_FAULT") == name
|
|
else:
|
|
false
|
|
|
|
proc crashNow*() =
|
|
## `-d:leakfault` only: die at a chosen point with no shutdown, modelling a hard kill between two
|
|
## transactions (the `markerCrash` hook, TESTING 10.3, #60). A shipped build has no death path.
|
|
when defined(leakfault):
|
|
quit(70)
|