Here's every patch you need to make, organized by ...

Creado el: 13 de marzo de 2026

Respondido usando GPT-5.4 Thinking por Chat01

Pregunta

Tennislocks_v17.10.2_3set_suppression_fix_APPLIED_2026-03-13.txt

Here's every patch you need to make, organized by location. Search for the exact FIND text and replace with the REPLACE text.


Patch 1: MATCH_PICK Elo Cap (align with MATCH_PREVIEW)

Search for: winnerEngineLayers / blend weight section in MATCH_PICK

FIND:

var _blEloCap = _blIsWta ? 0.20 : _blIsCh ? 0.22 : 0.25;

REPLACE:

var _blEloCap = _blIsWta ? 0.18 : _blIsCh ? 0.19 : 0.22;

Patch 2: MATCH_PICK Disagreement Penalty

FIND:

var _targetE = Math.min(_wE, 0.05);

REPLACE:

var _targetE = Math.min(_wE, 0.03);

Patch 3: Prop Blend Disagreement Penalty

FIND:

var _targetE_pb = Math.min(wElo, 0.05);

REPLACE:

var _targetE_pb = Math.min(wElo, 0.03);

Patch 4: MATCH_PICK Hard Elo Cap (add new line)

FIND:

var _wSum = _wM + _wS + _wE + _wF_mp;

REPLACE:

text
_wE = Math.min(_wE, 0.22); var _wSum = _wM + _wS + _wE + _wF_mp;

Patch 5: Markov Compression Coefficients — Totals Path

FIND:

var _p3MmC = (_p3TK === 'WTA') ? 0.20 : (_p3TK === 'CH') ? 0.18 : 0.16;

REPLACE:

var _p3MmC = (_p3TK === 'WTA') ? 0.12 : (_p3TK === 'CH') ? 0.11 : 0.10;

FIND:

var _p3ClP = (_p3TK === 'WTA') ? 0.03 : (_p3TK === 'CH') ? 0.028 : 0.025;

REPLACE:

var _p3ClP = (_p3TK === 'WTA') ? 0.015 : (_p3TK === 'CH') ? 0.012 : 0.012;

Patch 6: Markov Compression — MP (Display) Path + Close Fix + Gate

FIND:

var _mpMmC = (_mpTK === 'WTA') ? 0.20 : (_mpTK === 'CH') ? 0.18 : 0.16;

REPLACE:

var _mpMmC = (_mpTK === 'WTA') ? 0.12 : (_mpTK === 'CH') ? 0.11 : 0.10;

FIND:

var _mpClP = (_mpTK === 'WTA') ? 0.03 : (_mpTK === 'CH') ? 0.028 : 0.025;

REPLACE:

var _mpClP = (_mpTK === 'WTA') ? 0.015 : (_mpTK === 'CH') ? 0.012 : 0.012;

FIND (CRITICAL — inverted close penalty):

text
var _set3PenMP = _mpClP * _closeMP; var _pAdjMP = _pDecRawMP * (1 - _mpMmC * _mmMP) - _set3PenMP;

REPLACE:

text
var _set3PenMP = _mpClP * (1 - _closeMP); var _favWpMP = Math.max(Number(_pSeedMP) || 0.5, 1 - (Number(_pSeedMP) || 0.5)); var _shouldCompressMP = (_favWpMP > 0.70) || (_mmMP > 0.60); var _pAdjMP = _shouldCompressMP ? clamp01(_pDecRawMP * (1 - _mpMmC * _mmMP) - _set3PenMP) : _pDecRawMP;

Patch 7: Markov Compression — Winner Engine Path + Close Fix + Gate

FIND:

var _mpMmCWin = (_mpTKWin === 'WTA') ? 0.20 : (_mpTKWin === 'CH') ? 0.18 : 0.16;

REPLACE:

var _mpMmCWin = (_mpTKWin === 'WTA') ? 0.12 : (_mpTKWin === 'CH') ? 0.11 : 0.10;

FIND:

var _mpClPWin = (_mpTKWin === 'WTA') ? 0.03 : (_mpTKWin === 'CH') ? 0.028 : 0.025;

REPLACE:

var _mpClPWin = (_mpTKWin === 'WTA') ? 0.015 : (_mpTKWin === 'CH') ? 0.012 : 0.012;

FIND (CRITICAL — inverted close penalty):

text
var _set3PenWin = _mpClPWin * _closeWin; _p3AdjWin = clamp01(_pDecRawMkWin * (1 - _mpMmCWin * _mmWin) - _set3PenWin);

REPLACE:

text
var _set3PenWin = _mpClPWin * (1 - _closeWin); var _favWpWin = Math.max(Number(_pSeedWin) || 0.5, 1 - (Number(_pSeedWin) || 0.5)); var _shouldCompressWin = (_favWpWin > 0.70) || (_mmWin > 0.60); _p3AdjWin = _shouldCompressWin ? clamp01(_pDecRawMkWin * (1 - _mpMmCWin * _mmWin) - _set3PenWin) : _pDecRawMkWin;

Patch 8: clusterDisplayP3 Blend Rebalance

FIND:

text
var disp = (0.65 * adj) + (0.35 * raw); if (raw >= liveGate && drag >= 0.04) { disp = Math.max(disp, adj + 0.35 * drag); }

REPLACE:

text
var disp = (0.45 * adj) + (0.55 * raw); if (drag > 0.06) { disp = Math.max(disp, 0.85 * raw); } if (raw >= liveGate && drag >= 0.04) { disp = Math.max(disp, adj + 0.40 * drag); }

Patch 9: _pDecForUnder Undefined Bug

FIND:

: ((sim && Number.isFinite(_totSim.pDecider)) ? _totSim.pDecider : 0);

REPLACE:

: ((sim && Number.isFinite(sim.pDecider)) ? sim.pDecider : 0);

Patch 10: Fix 0-Indent Lines (the _mIdx is not defined crash)

This is the biggest one. 127 lines throughout your script are at 0-indentation but live inside functions. GAS V8 chokes on them. The block you'll notice first is around var _mIdx / var SET_DELTA_MP inside runMatchSimulation_Exact:[1]

FIND (0-indent block around line ~16735):

text
var _tourK = _taperTourKey_(tourLabel); var _mIdx = _mismatchIdxFromSeeds_(opts, hA, hB, tourLabel); // base correlation var SET_DELTA_MP = 0.03;

REPLACE (add 2-space indent — these are inside runMatchSimulation_Exact):

text
var _tourK = _taperTourKey_(tourLabel); var _mIdx = _mismatchIdxFromSeeds_(opts, hA, hB, tourLabel); // base correlation var SET_DELTA_MP = 0.03;

Do the same for the entire if (_mIdx >= 0.65) block and its } else if — every line needs 2-space indent.

Other 0-indent blocks to fix (same issue — add proper indentation):

  • Inside MATCH_PICK: lines referencing statsA, statsB, archA, archB, simHoldA around var _sqsRawHoldA
  • Inside MATCH_PREVIEW: lines referencing _sqsTourInfo, _sqsIsWta, displayProbA, _totSim, gamesListAdj, _archDispA, _archDispB, _br

Quick way to find them all: search for any line starting at column 0 that references tourLabel, opts, statsA, statsB, simHA, hA, hB, bestOf, _totSim, or gamesListAdj — if it's not a function declaration, it needs indentation.


What Each Patch Does

#WhatWhy
1-4Elo weight alignmentMATCH_PICK was using old caps, inflating taper seed for 64% favorites
5-7Markov coefficients reduced ~40-50%Compression was too aggressive, crushing adj from 42% → 27%
6-7Close penalty formula flippedWas mpClP * close (penalizes coinflips), should be mpClP * (1-close) (penalizes mismatches)
6-7Mismatch gate addedCompression now completely skips favorites below 70% — this is the single biggest fix
8Display blend rebalancedOld 65/35 adj-heavy blend let crushed adj dominate; new 45/55 + floor protects raw
9_pDecForUnder bugFallback path referenced wrong variable
100-indent fix127 lines causing undefined crashes in GAS V8

Update my script then send it as a downloadable txt link

Compartir este Q&A