sots-re/verify/results/state-checksum/chain-turn1-3.json
alex fdd0b72b7a state-checksum: whole-state diagnostic checksum harness (lane C)
The complement to the per-function compare harness. Instead of "did this
function's declared outputs match", it asks "is the entire simulation state
still identical" -- so no region-declaration mistake can hide from it.

Coverage is PROVED, not declared: the digest tree is re-serialised and compared
byte-for-byte against the inflated save on every run. When that reconstruction
reproduces the stream, the whole file is a function of the digest's inputs. A
run that cannot account for the file says so and exits non-zero. This is the
direct answer to B4's three hooks that printed "0 diverged" over an empty
region set.

It localises. The root is the fold of a per-subsystem / per-object tree with
named objects, so the known load->re-save delta reports as exactly five leaves
-- /Summary/Checksum and four /Sim/players/Player[...]/Status 4->0 -- naming the
two Singularity players by id where the raw byte diff could only say "1st of
two". One real End Turn reports as 108 fully attributed differences.

Float-parity policy is explicit and strict by default (STATE_CHECKSUM.md 3):
raw IEEE-754 bits; a `canonical` policy for signed zero and NaN payloads only;
and deliberately NO tolerant hashing mode, because quantisation moves the cliff
rather than removing it and destroys the roll-up. Tolerance lives in the differ
as --ulps, applied after localisation. Corpus census: 0 NaN, 0 -0.0, 0
subnormals across 4,474 float leaves, so the strict default costs nothing today
and a test fails the day that changes.

Validated on the real saves (verify/results/state-checksum/): 10 files, 4
distinct contents, all STABLE + COVERED; chain record/verify works on the real
turn1-3 saves. The VM-driven replay loop is designed (section 5) but UNRUN.

Section 3.5 names the one question the host side cannot settle -- whether the
turn pipeline depends on x87 intermediate precision -- and the experiment that
would: force fpu_cw to 0x027f / 0x127f / 0x137f across End Turn and checksum
the three autosaves.

Also recorded: Summary.Checksum is NOT a byte sum over the inflated stream nor
a sum over the int leaves (both ruled out), so nobody repeats those two.

38 tests; sots-engine untouched, clean_room_check.sh OK.
2026-09-08 03:46:34 -04:00

74 lines
No EOL
2.7 KiB
JSON

{
"format": "sots-state-chain/1",
"policy": {
"floats": "bits",
"mask": "none",
"digest": "blake2b-128",
"readerFingerprint": "fe5a6f7cd4ae7910"
},
"turns": [
{
"name": "turn1-state.sav",
"turn": 1,
"root": "9bbcbd4945cd8319b65d7d7958772ee0",
"coverage": true,
"subsystems": {
"/Summary": "c601faf8435ca9dd13f0d76f790d6447",
"/CreateParams": "68913c619976ba5f4fa719a7126156aa",
"/Sim/RNG": "0a82080734aaa2d4f3e986036f147963",
"/Sim/Attrib": "cea50f5077af4e42ee02fbbe7b2f8ffd",
"/Sim/turnstats": "b3e7593a4742ebc40a97000159063905",
"/Sim/players": "5c843fefbf911315288f059986c5f7e5",
"/Sim/systems": "8391940f1bb84af6ad3260fdf4390892",
"/Sim/fleets": "db0c730bfa7e21b0b449c1bb66d7fbf7",
"/Sim/NdGr2": "7771763e19ec2652c8c11864ad8e4a10",
"/Sim/trdmgr": "a1139ab953664ab1543ff42faa59aba6",
"/Sim/spymgr": "99c457b5334248e71d063f948ebd7f0c",
"/Sim/SvSctOb": "f9e074a56abb0d1ce82432fa2e1d2215",
"/CDT": "a3f7780ee36905117987374012d1586d"
}
},
{
"name": "turn2-state.sav",
"turn": 2,
"root": "aa85fe76d412cdb3a0e7e52c8f0ca9e2",
"coverage": true,
"subsystems": {
"/Summary": "42b2094efe6e285a3eddc0518a842c69",
"/CreateParams": "68913c619976ba5f4fa719a7126156aa",
"/Sim/RNG": "e9625f2b86f93f8ccf84dcd1b1833d6a",
"/Sim/Attrib": "cea50f5077af4e42ee02fbbe7b2f8ffd",
"/Sim/turnstats": "c32bab57e99cdf797510872b170243f9",
"/Sim/players": "fa7f5ad40afed20848714e38cfd360fb",
"/Sim/systems": "1a36f0d18f0d8babfb3b48c0c273c3f4",
"/Sim/fleets": "666872a3ce06721807e0487e2801f0b7",
"/Sim/NdGr2": "7771763e19ec2652c8c11864ad8e4a10",
"/Sim/trdmgr": "a1139ab953664ab1543ff42faa59aba6",
"/Sim/spymgr": "99c457b5334248e71d063f948ebd7f0c",
"/Sim/SvSctOb": "6cd7196a38f53574292b3bde3ee424a8",
"/CDT": "a3f7780ee36905117987374012d1586d"
}
},
{
"name": "turn3-state.sav",
"turn": 3,
"root": "5ac4a24197e82de49f3077cd8dd25fad",
"coverage": true,
"subsystems": {
"/Summary": "b375baaf6aab9da5202f30fd4dc85104",
"/CreateParams": "68913c619976ba5f4fa719a7126156aa",
"/Sim/RNG": "0978fdf34ff7962f76c2de810dc93e0a",
"/Sim/Attrib": "cea50f5077af4e42ee02fbbe7b2f8ffd",
"/Sim/turnstats": "f067f6b95f21ed0ea0d9844a48caa78f",
"/Sim/players": "8a0bf16b7166f7e30b170284ad26ae36",
"/Sim/systems": "ef4caa2237b49b2384bc9ee7cd733a96",
"/Sim/fleets": "0f65b7f9ccb245f6ff105be5d1f69dd1",
"/Sim/NdGr2": "7771763e19ec2652c8c11864ad8e4a10",
"/Sim/trdmgr": "a1139ab953664ab1543ff42faa59aba6",
"/Sim/spymgr": "99c457b5334248e71d063f948ebd7f0c",
"/Sim/SvSctOb": "d30210dd844215010d68c7d013fa4da0",
"/CDT": "a3f7780ee36905117987374012d1586d"
}
}
]
}