From 50399e016ef603ba3872e71d5e4b3807f1d210c1 Mon Sep 17 00:00:00 2001 From: Cyd Date: Tue, 11 Aug 2026 23:12:35 -0500 Subject: [PATCH] The board repeats what the tick decided Cyd's screenshot: the commit board's LAUNCH button lit - which requires the local pod to be staged - while the host's own row read 'connecting', which is the word for a state of -1. Two reads of the same fact from two places, disagreeing: the tick read the application state and armed on it, and the paint handler read it AGAIN, separately, and got something else. Why the paint's read returned -1 is not proven, and it does not need to be: re-deriving state at paint time was the mistake, the same one that broke five instruments in one night of the render-tick hunt. The tick already stores every state it acted on in gShownStates, for change detection - the paint now draws those values and reads nothing else. The board and the arming can no longer disagree, because they are the same read. Co-Authored-By: Claude Opus 5 (1M context) --- RP_L4/RPL4CONSOLE.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/RP_L4/RPL4CONSOLE.cpp b/RP_L4/RPL4CONSOLE.cpp index 85ecdbb..7421e59 100644 --- a/RP_L4/RPL4CONSOLE.cpp +++ b/RP_L4/RPL4CONSOLE.cpp @@ -566,15 +566,24 @@ namespace // [pilots] order. READY rows bright, the rest dim, so // who the room is waiting on reads at a glance. // + // Every state on this board comes from gShownStates - + // the values the TICK stored when it decided whether to + // arm - and nothing is re-read at paint time. The first + // version re-read application->GetApplicationState() + // here, and the host's own row said 'connecting' under + // a lit LAUNCH button: two reads of one fact from two + // places, disagreeing - the exact mistake behind five + // broken instruments in one night of this project. One + // frame of reference: the tick decides, the paint + // repeats what it decided. + // char text[96]; - int local_state = (application != NULL) - ? application->GetApplicationState() : -1; sprintf(text, "%-14s %s", (gPilotNameCount > 0) ? gPilotNames[0] : "HOST", - StateWord(local_state)); + StateWord(gShownStates[0])); SetTextColor(mem, - (local_state == Application::WaitingForLaunch) + (gShownStates[0] == Application::WaitingForLaunch) ? kBoardGreen : kBoardGreenDim); DrawTextA(mem, text, -1, &line, DT_LEFT | DT_VCENTER | DT_SINGLELINE); @@ -588,9 +597,9 @@ namespace ? gPilotNames[i + 1] : gRemotePods[i].address; sprintf(text, "%-14s %s", name, - StateWord(gRemotePods[i].state)); + StateWord(gShownStates[i + 1])); SetTextColor(mem, - (gRemotePods[i].state == Application::WaitingForLaunch) + (gShownStates[i + 1] == Application::WaitingForLaunch) ? kBoardGreen : kBoardGreenDim); DrawTextA(mem, text, -1, &line, DT_LEFT | DT_VCENTER | DT_SINGLELINE);