sots-engine/src/app
alex a1910becb0 lane E3: the per-system visibility record, the explored sweep and the system observed-stamp
Three phases, one input. A star system carries four per-player masks and three of
them agree on nearly every system of every save the corpus holds, so a model built
on the wrong one looks right until it does not. The gate is the DERIVED
active-presence mask -- fleet-here OR gate-here OR owner, recomputed on every
arrival and departure -- not the sticky one and not the explored one.

  S29 SystemObservedStamp   the system's own last-observed turn (whole function)
  T17 RebuildPlayerViewTree the per-(system, player) observation record: who saw
                            the system, on what turn, and what encounter was there
  T21 UpdateSurveyAndStats  the explored sweep: seen this turn implies surveyed

game/sim/visibility is pure and knows nothing about save shapes; app/visibility_phase
wires it to them. The mask is READ FROM THE SAVE and never rebuilt: neither reference
pair moves a mask leaf, so the loaded value is the value these phases would see, and
rebuilding it from an unmodelled movement pass would be a change with no evidence.

Measured, closed and regressed reported separately and never netted:

  turn1-state -> turn2-state    209 -> 158   closed 51, regressed 0
  turn2-state -> turn3-state    108 ->  87   closed 21, regressed 0

of which this lane closed 46 and 16 (the rest were already closed at main). The 46
are the brief's 32-leaf target in full -- 8 record counts, 8 player ids, 8 turn
stamps, 8 encounter ids -- plus 8 system stamps and 6 explored masks.

Three further pairs the model was never fitted to, all zero regressions:

  human-turn2 -> human-turn3    353 -> 311   closed 42   (a different game, 21 systems)
  zuul15 -> zuul16              276 -> 264   closed 12
  zuul16 -> zuul17              341 -> 329   closed 12

The corpus's one discriminating row is a host test rather than a comment: a system
whose last visiting fleet has gone carries the sticky and explored bits set, the
active bit clear, and a stamp frozen a turn behind. The test asserts the freeze AND
asserts what the wrong gate would have produced, so a future edit that swaps the
mask fails loudly instead of quietly agreeing with five saves.

Labelled hypothesis, with the workload named in the header: the encounter id is
recovered from the encounter fleet at the system, because the field the original
reads is set once at map generation and is not on the wire. It agrees on all six
encounter fleets in the corpus and no save can separate it -- none kills an
encounter while leaving its system visible.

Not written, deliberately: the colony-ownership stamp that moves beside these.
Its gate is demonstrably NOT the active mask (one system in the corpus has a zero
mask and moves it anyway), the formula is not held, so it is reported, not written.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARBgSooAfokKUy6wKUKEyZ
2026-09-08 13:38:12 -04:00
..
alliance.cpp lane A2: S04, the alliance mask -- 80 player-records, 560 fields, 0 mismatches 2026-09-08 12:44:00 -04:00
alliance.h lane A2: S04, the alliance mask -- 80 player-records, 560 fields, 0 mismatches 2026-09-08 12:44:00 -04:00
CMakeLists.txt lane E3: the per-system visibility record, the explored sweep and the system observed-stamp 2026-09-08 13:38:12 -04:00
main.cpp src/app: the standalone -- load a save, run a turn, write a save 2026-09-08 10:35:45 -04:00
phase_catalog.cpp lane E3: the per-system visibility record, the explored sweep and the system observed-stamp 2026-09-08 13:38:12 -04:00
phase_catalog.h src/app: the standalone -- load a save, run a turn, write a save 2026-09-08 10:35:45 -04:00
report.cpp Y: model the turn's dominant generator cost, and the tail's turn record 2026-09-08 11:33:36 -04:00
report.h src/app: the standalone -- load a save, run a turn, write a save 2026-09-08 10:35:45 -04:00
trade_raid.cpp Y: model the turn's dominant generator cost, and the tail's turn record 2026-09-08 11:33:36 -04:00
trade_raid.h Y: model the turn's dominant generator cost, and the tail's turn record 2026-09-08 11:33:36 -04:00
turn.cpp lane E3: the per-system visibility record, the explored sweep and the system observed-stamp 2026-09-08 13:38:12 -04:00
turn.h Y: model the turn's dominant generator cost, and the tail's turn record 2026-09-08 11:33:36 -04:00
turn_record.cpp lane A2: S04, the alliance mask -- 80 player-records, 560 fields, 0 mismatches 2026-09-08 12:44:00 -04:00
turn_record.h lane A2: S04, the alliance mask -- 80 player-records, 560 fields, 0 mismatches 2026-09-08 12:44:00 -04:00
visibility_phase.cpp lane E3: the per-system visibility record, the explored sweep and the system observed-stamp 2026-09-08 13:38:12 -04:00
visibility_phase.h lane E3: the per-system visibility record, the explored sweep and the system observed-stamp 2026-09-08 13:38:12 -04:00