#82 peers see a limping mech SKATING: the mech erased its own gimp cell every frame

The binary's one mech+0x40 IS Simulation::simulationState, which rides EVERY
update record header -- so in 1995 a peer's replicant learned the gimp level on
every packet and its gait limped with no gimp-specific replication anywhere.
The port's Mech::PerformAndWatch wrote SetMovementMode(1) every frame ("ground,
non-death, non-airborne"), which erased the level once it was mirrored in for
the warning voice (#78): the wire carried 1, bystanders walked while sliding at
limp speed, and the voice sequence restarted on every damage event (1->4 edge
per tick) instead of announcing once.

- mech4: that per-frame write now writes the AUTHORITATIVE level
  (gimped ? 3/4 : 1) via a new alarm-only bridge BTMechGimpAlarmLevel -- which
  deliberately never consults the cell it feeds, so a respawn-cleared alarm
  cannot re-latch stale gimp out of it.
- BTMechGimpLevel: falls back to the replicated cell, with ONE-CELL precedence
  (a fall/death/limbo state wins, so the normal drivers and their death latch
  run -- what the binary's single cell enforced structurally).
- Reverted the #78 record guard: on a replicant the master's records are
  authoritative, so pinning 3/4 against them would keep a peer limping through
  a respawn.  Fixed at the writer instead.
- [simstomp] trap now scoped to the watched mech with a module-relative return
  address (symcrash-able) -- that is what named the writer.
- Also learned + recorded: zone damage levels replicate only when the EXPLOSION
  TABLE's tier is crossed (peer measured at 0.428 vs master 0.857), so peer-side
  damage state must never be inferred from them.

Verified two-node (scratchpad/night6/mp_skate.sh): the observer's replicant gets
sim=4 and its gait runs 23 -> 25 (wgr entry -> ggl limp cycle).  Field clue that
cracked it: "after respawning a peer DID see the limp" (epilectrik/SAURON).
KB: locomotion.md + gotcha #25.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Joe DiPrima
2026-07-29 22:29:03 -05:00
co-authored by Claude Fable 5
parent 98907f45af
commit e1c15eb806
6 changed files with 180 additions and 35 deletions
+38 -5
View File
@@ -2439,6 +2439,27 @@ void
extern int BTMechGimpLevel(void *mech_v);
const int replGl = BTMechGimpLevel(this);
const bool replGimp = (replGl == 3 || replGl == 4) && hasGimpClips;
// #82 probe: what does this REPLICANT actually know? gl, the
// zone-derived level, sim cell, and every leg zone's level.
if (getenv("BT_REPL_LOG"))
{
static float s_ga = 0.0f; s_ga += dt;
if (s_ga >= 1.0f)
{
s_ga = 0.0f;
DEBUG_STREAM << "[replgimp] ent=" << (int)GetEntityID()
<< " gl=" << replGl
<< " sim=" << (int)GetSimulationState()
<< " hasClips=" << hasGimpClips << " zones:";
for (int zi = 0; zi < damageZoneCount; ++zi)
{
Mech__DamageZone *z = Zone(zi);
if (z != 0 && z->damageLevel > 0.0f)
DEBUG_STREAM << " " << zi << "=" << z->damageLevel;
}
DEBUG_STREAM << "\n" << std::flush;
}
}
const Scalar replLegAdv = s_peerLegCh
? (replGimp ? AdvanceLegAnimationGimp(dt) // FUN_004a71f4
: AdvanceLegAnimation(dt)) // old: re-derived leg SM
@@ -3805,12 +3826,24 @@ void
// the authentic MaxAcceleration reads directly since the task #4
// record-layout fix (madcat: 30 u/s^2); the old floor-25 block
// and its one-shot log are retired.
// (#78 note: the gimp states live on graphicAlarm, NOT this
// engine simulationState cell -- the port carries the
// binary's one mech+0x40 as two members; see the split-brain
// note in combat-damage.md. This write never touches them.)
// #78/#82: this cell IS the binary's one mech+0x40, so it must
// carry the GIMP LEVEL too -- writing a blind 1 here erased it
// every frame (the old note claiming "this write never touches
// them" stopped being true the moment the gimp level was
// mirrored in for the warning voice). Two consequences of the
// erasure, both field-reported: the "reverse disabled" sequence
// restarted on every damage event (1->4 edge per tick), and --
// because simulationState rides EVERY update record header --
// peers received 1 and their replicant walked instead of
// limping (#82, "peers see a limping mech skating"). Write the
// authoritative level: gimped -> 3/4, else 1. Alarm-only read
// (never the cell we feed), via the mechdmg bridge (gotcha #23).
if (!IsMechDestroyed()) // a dead mech keeps its death movementMode
SetMovementMode(1); // ground, non-death, non-airborne
{
extern int BTMechGimpAlarmLevel(void *mech_v);
const int gl = BTMechGimpAlarmLevel(this);
SetMovementMode((gl == 3 || gl == 4) ? gl : 1); // ground, non-death, non-airborne
}
// reverseSpeedMax2@0x7a0 is the run-cycle bodyCycleSpeed CLAMP (AdvanceBody
// Animation case 12/13); LoadLocomotionClips does not set it -> it reads
// 0xCDCDCDCD (-4.3e8) and the clamp clobbers bodyCycleSpeed -> the run cycle