sots-engine/src/shim
alex 2a9b97dcee Z: per-call-site draw ledger -- seven entry points, keyed by return address
The boundary ledger says which phase spends a turn's words; this says which
call site. Each entry point is detoured with its verified prototype and records
__builtin_return_address(0) plus the word cost from left before/after -- two
4-byte reads, no record per draw, since NextFloat alone has 109 call sites.

Each draw is tagged with WHICH generator it came from. That is not a detail:
the first build counted every Mars::RNG instance in the process and reported 44
words against a bracket of 18. The StrategyClient's generator at +0x134 draws 8
times a turn and must not be in the strategic total.

Also hooks EncounterDetect::AssignContacts, lane I's one inlined-draw site in
ProcessTurn's closure -- invisible to both a call-graph sweep and to the entry-
point detours, so only a boundary hook can see it. It did not fire on this
workload, which is consistent with the site sums reconciling exactly.
2026-09-08 10:42:05 -04:00
..
hooks Z: per-call-site draw ledger -- seven entry points, keyed by return address 2026-09-08 10:42:05 -04:00
trace harness: compile-time Coverage on every descriptor, guard regions, replace-mode records; audit of 23 undeclared side effects 2026-09-08 01:28:35 -04:00
binkw32.def m0: binkw32 proxy shim, minhook, trace hook on Application::Initialize; build/deploy tooling 2026-09-07 17:22:15 -04:00
fpu_force.cpp Z: measure the strategic RNG, do not assume it 2026-09-08 09:16:24 -04:00
fpu_force.h shim: force and verify the x87 control word around the turn gate 2026-09-08 05:09:16 -04:00
main.cpp Z: per-call-site draw ledger -- seven entry points, keyed by return address 2026-09-08 10:42:05 -04:00
shim.cfg b3: research hook + RNG-snapshot compare design; fix draw mapping to y/(2^32-1), NextInt inclusive, float32 odds, spend floor, decay constants 2026-09-07 23:14:08 -04:00
shim.cfg.b4compare b4: colony + movement hooks; 22 formula corrections (growth curve has no capacity term, range margin +0.05f, ties-to-even rounding); 3 verified signatures 2026-09-08 00:57:55 -04:00
shim.cfg.b4scout b4: colony + movement hooks; 22 formula corrections (growth curve has no capacity term, range margin +0.05f, ties-to-even rounding); 3 verified signatures 2026-09-08 00:57:55 -04:00
shim.cfg.b4trace b4: colony + movement hooks; 22 formula corrections (growth curve has no capacity term, range margin +0.05f, ties-to-even rounding); 3 verified signatures 2026-09-08 00:57:55 -04:00
shim.cfg.fpu1a7f shim: force and verify the x87 control word around the turn gate 2026-09-08 05:09:16 -04:00
shim.cfg.fpu007f shim: force and verify the x87 control word around the turn gate 2026-09-08 05:09:16 -04:00
shim.cfg.fpu027f shim: force and verify the x87 control word around the turn gate 2026-09-08 05:09:16 -04:00
shim.cfg.fpu127f shim: force and verify the x87 control word around the turn gate 2026-09-08 05:09:16 -04:00
shim.cfg.fpu137f shim: force and verify the x87 control word around the turn gate 2026-09-08 05:09:16 -04:00
shim.cfg.fpuoff shim: force and verify the x87 control word around the turn gate 2026-09-08 05:09:16 -04:00
shim.cfg.recapb1 recapture: golden traces with guards on the live game 2026-09-08 03:04:34 -04:00
shim.cfg.recapb3 recapture: golden traces with guards on the live game 2026-09-08 03:04:34 -04:00
shim.cfg.recapmisc recapture: golden traces with guards on the live game 2026-09-08 03:04:34 -04:00
shim.cfg.recaptrace recapture: golden traces with guards on the live game 2026-09-08 03:04:34 -04:00
shim.cfg.tturn T: hook for Game::ServerPlayer::ProcessTurn, with the prediction committed first 2026-09-08 08:08:47 -04:00
shim.cfg.tturncmp T: hook for Game::ServerPlayer::ProcessTurn, with the prediction committed first 2026-09-08 08:08:47 -04:00
shim.cfg.zledger Z: per-call-site draw ledger -- seven entry points, keyed by return address 2026-09-08 10:42:05 -04:00