From aa250c4e22f0d91da860808dd5b6494050d59163 Mon Sep 17 00:00:00 2001 From: Joe DiPrima Date: Sun, 9 Aug 2026 17:09:15 -0500 Subject: [PATCH] #149: [segperf] telemetry DEFAULT ON for every player (BT_PERF_LOG=0 opts out) Operator call: an opt-in flag on the one machine we most need data from is the silent-diagnostic mistake this project's doctrine exists to prevent. Every session log now carries [segperf] beside every [rstat] window, so the next playtest gives the 817->857 stall hunt cross-machine baselines for free -- Oracle's stalling rig and Sauron's clean one, same night, same build. Cost: ~2 QPC reads per segment query, microseconds per second. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_018SgmXGNMXavXiafKXf9MDC --- engine/MUNGA/JMOVER.cpp | 5 ++++- engine/MUNGA_L4/L4VIDEO.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/MUNGA/JMOVER.cpp b/engine/MUNGA/JMOVER.cpp index 5fad336..bc35236 100644 --- a/engine/MUNGA/JMOVER.cpp +++ b/engine/MUNGA/JMOVER.cpp @@ -135,7 +135,10 @@ void ) { Check(this); - static const int sPerf = getenv("BT_PERF_LOG") ? 1 : 0; + // DEFAULT ON (operator, 2026-08-09): every player's session log should + // carry this -- cross-machine comparison is the point. BT_PERF_LOG=0 + // opts out. Cost: ~2 QPC reads per call, microseconds per second. + static const int sPerf = !(getenv("BT_PERF_LOG") && *getenv("BT_PERF_LOG") == '0'); LARGE_INTEGER t0, t1, fq; ++gBTSegWCalls; if (sPerf) QueryPerformanceCounter(&t0); diff --git a/engine/MUNGA_L4/L4VIDEO.cpp b/engine/MUNGA_L4/L4VIDEO.cpp index a8d118a..cfc7570 100644 --- a/engine/MUNGA_L4/L4VIDEO.cpp +++ b/engine/MUNGA_L4/L4VIDEO.cpp @@ -9039,7 +9039,7 @@ void DPLRenderer::ExecuteImplementation(RendererComplexity, RendererOrigin::Inte // invalidation passes (the expensive arm the #141 sweep may have // multiplied); ms = time inside the accessor for the whole window. { - static const int sSegPerf = getenv("BT_PERF_LOG") ? 1 : 0; + static const int sSegPerf = !(getenv("BT_PERF_LOG") && *getenv("BT_PERF_LOG") == '0'); extern int gBTSegWCalls, gBTSegWDirty; extern double gBTSegWMs; if (sSegPerf)