found the actual bug — multiple issues stacking. L...
Erstellt am: 26. März 2026
Beantwortet mit GPT-5.4 Thinking von Chat01
Erstellt am: 26. März 2026
Beantwortet mit GPT-5.4 Thinking von Chat01
found the actual bug — multiple issues stacking. Let me lay it out precisely from the code.
Here's what the script actually does, traced line by line:
BUG 1 — The real source of ctx.holdA / ctx.holdB (lines 30968–30973)
var hA_eff = _effMk.hA_eff;
var hB_eff = _effMk.hB_eff;
_totCtx.holdA = hA_eff;
_totCtx.holdB = hB_eff;
_effMk.hA_eff traces back to line 4383 — it's a straight pass-through of whatever hold rate the simulation used to build the matchup model. The MC simulation (lines 28322–28323) uses _effSIM.hA_eff which comes from SPW-derived serve parameters — Barnett-Clarke adjusted SPW, not game-level hold rates. Zverev's SPW is 74.0% and Halys's is 69.8% (shown explicitly in the output under [Barnett-Clarke adj.]).
Both are under 0.80. So at Stage 4b:
// Line 20479–20480
var _ehPMCBothElite = (_ehPMCHoldA >= 0.80 && _ehPMCHoldB >= 0.80);
// → 0.740 >= 0.80? FALSE. Stage 4b correction: NEVER FIRES.
The correction that's supposed to flip pMC from 43% UNDER to 52% OVER silently never executes.
BUG 2 — Stage 8's elite hold shift also doesn't fire (lines 20946–20964)
Same ctx.holdA / ctx.holdB check, same values (0.74, 0.70):
var _ehBothElite = (_ehHoldA >= 0.80 && _ehHoldB >= 0.80); // FALSE
var _ehShift = 0; // No shift
var _med2Eff = med2; // 20.0 — unchanged
So _stage8aMed2 = med2 = 20.0, _sd2setEliteInflated = false. The CDF blend in Stage 8a uses raw med2 = 20.0g, giving P(over 22.5) = 18.6% — exactly what the output shows.
BUG 3 — The display flag uses a completely different hold source
The "⚡ elite mutual hold — upper-tail bias likely" text in your output uses the Efron-Morris adjusted hold rates (Zverev 86.4%, Halys 81.4%), which ARE both ≥ 0.80. The display check and the engine correction check use two different variables pointing to two different hold rate sources. The display fires. The correction doesn't. The output is therefore internally contradictory — it says "elite mutual hold detected" at the top and then picks UNDER because the engine never saw that condition.
BUG 4 — _bimodalCDFEdge uses raw med2, not _stage8aMed2 (line 21121)
Even if Bugs 1/2 were fixed, Stage 8a still calls:
var _cdfResult = _bimodalCDFEdge(_bP3, med2, med3, line, _sig2, _sig3, tourK);
// ^^^^ raw med2, not _stage8aMed2
var _cdfPOver = _cdfResult.pOver; // 18.6% — strongly UNDER
The FULL-DECAY-8 threshold (Markov crosscheck 50.3%) fires because _cdfPOver = 0.186 < 0.502. The CDF blend is discarded, and the correction has no CDF validation support behind it even in a fixed version.
Summary of root cause:
The ctx.holdA / ctx.holdB values stored for the totals context are SPW-derived serve parameters (~74%, ~70%), not game-level hold rates. All four elite hold correction paths (Stage 4b bias correction, Stage 8 shift, Stage 8a CDF adjustment, SD inflation) gate on >= 0.80 against those SPW values. None of them fire. The display flag uses Efron-Morris adjusted hold rates separately and correctly identifies elite hold, but there is no code bridge connecting that calculation to _totCtx.holdA / _totCtx.holdB.
The fix is to wire the Efron-Morris adjusted hold rates (stored on the player stats objects as 0.864 and 0.814) into _totCtx.holdA and _totCtx.holdB before getTotalsPick is called, so that all downstream elite hold gates see the same values the display already uses
Update my script then send it as a downloadable txt link
Done — I patched the uploaded script into v19.4.27. The update does two core things: it routes _totCtx.holdA/_totCtx.holdB to the game-level hold source (hA/hB when available) while preserving the SPW/Markov-effective values separately as _totCtx.holdA_markov/_totCtx.holdB_markov, and it changes the Stage 8a CDF call to use _stage8aMed2 / med2Eff when elite hold fires instead of raw med2. (TennisLocks_v19.4.26.js)
TXT download: TennisLocks_v19.4.27.txt
JS copy too: TennisLocks_v19.4.27.js