Spaces:
Running
Running
fix(tuning): a boosted laggard never runs through zero
Browse filesHumpty Dump replayed on test-mcp d02d82c (2026-10-20): the insight
repair_unit_utilization_drag promised 0.18x. _boost_weak_insights scales the
distance from 1.0 linearly, so two rounds took the magnitude to -1.1x and the
report said "needed <= -0.05x to pass". A multiplier below zero is a sign
error, not a weaker segment. Boosted laggards now floor at LAGGARD_FLOOR
(0.05x of baseline).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
demoprep_app/pipeline/build_demo.py
CHANGED
|
@@ -44,6 +44,8 @@ MAX_TUNING_ROUNDS = 3
|
|
| 44 |
# When an insight is too weak, multiply its distance-from-1.0 by this.
|
| 45 |
BOOST_FACTOR = 1.6
|
| 46 |
# A BOUNDED measure (a rate, a score, a share) is pushed in its band instead:
|
|
|
|
|
|
|
| 47 |
# PlantedInsight.drive_boost grows by BOOST_FACTOR per round up to this.
|
| 48 |
MAX_DRIVE_BOOST = 4.0
|
| 49 |
# The share of a band's theoretical delivery (position 0.5 -> 0.5 +/-
|
|
@@ -506,7 +508,12 @@ def _boost_weak_insights(blueprint: DemoBlueprint, report: ValidationReport) ->
|
|
| 506 |
deliverable = _deliverable_band_ratio(blueprint, insight)
|
| 507 |
if deliverable is None:
|
| 508 |
distance = insight.magnitude - 1.0
|
| 509 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 510 |
else:
|
| 511 |
floor, cap = deliverable
|
| 512 |
laggard = insight.magnitude < 1.0
|
|
|
|
| 44 |
# When an insight is too weak, multiply its distance-from-1.0 by this.
|
| 45 |
BOOST_FACTOR = 1.6
|
| 46 |
# A BOUNDED measure (a rate, a score, a share) is pushed in its band instead:
|
| 47 |
+
# A boosted laggard never goes below this multiple of its baseline.
|
| 48 |
+
LAGGARD_FLOOR = 0.05
|
| 49 |
# PlantedInsight.drive_boost grows by BOOST_FACTOR per round up to this.
|
| 50 |
MAX_DRIVE_BOOST = 4.0
|
| 51 |
# The share of a band's theoretical delivery (position 0.5 -> 0.5 +/-
|
|
|
|
| 508 |
deliverable = _deliverable_band_ratio(blueprint, insight)
|
| 509 |
if deliverable is None:
|
| 510 |
distance = insight.magnitude - 1.0
|
| 511 |
+
# A laggard's distance is negative, and scaling it linearly
|
| 512 |
+
# runs through zero: Humpty Dump on test-mcp d02d82c (2026-10-20)
|
| 513 |
+
# promised 0.18x, two boosts made it -1.1x, and the report read
|
| 514 |
+
# "needed <= -0.05x". A multiplier below LAGGARD_FLOOR is not a
|
| 515 |
+
# weaker segment, it is a sign error.
|
| 516 |
+
insight.magnitude = max(round(1.0 + distance * BOOST_FACTOR, 3), LAGGARD_FLOOR)
|
| 517 |
else:
|
| 518 |
floor, cap = deliverable
|
| 519 |
laggard = insight.magnitude < 1.0
|
tests/test_build_abort_policy.py
CHANGED
|
@@ -1106,6 +1106,21 @@ def test_the_tuning_boost_does_not_raise_the_pass_bar():
|
|
| 1106 |
assert laggard.direction == "below baseline"
|
| 1107 |
|
| 1108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1109 |
def test_a_missing_account_is_a_plain_instruction_naming_user_and_cluster():
|
| 1110 |
from thoughtspot_errors import trusted_auth_failure_message
|
| 1111 |
|
|
|
|
| 1106 |
assert laggard.direction == "below baseline"
|
| 1107 |
|
| 1108 |
|
| 1109 |
+
def test_a_laggard_boost_never_runs_through_zero():
|
| 1110 |
+
"""Humpty Dump on test-mcp d02d82c (2026-10-20): a 0.18x laggard boosted
|
| 1111 |
+
twice became -1.1x and the report said "needed <= -0.05x"."""
|
| 1112 |
+
import types
|
| 1113 |
+
|
| 1114 |
+
bp = _bp()
|
| 1115 |
+
insight = bp.insights[0]
|
| 1116 |
+
insight.magnitude = 0.18
|
| 1117 |
+
report = types.SimpleNamespace(failed_insights=lambda: [types.SimpleNamespace(insight_id=insight.id)])
|
| 1118 |
+
for _ in range(3):
|
| 1119 |
+
build_demo_module._boost_weak_insights(bp, report)
|
| 1120 |
+
assert insight.authored_magnitude == 0.18
|
| 1121 |
+
assert build_demo_module.LAGGARD_FLOOR <= insight.magnitude < 0.18
|
| 1122 |
+
|
| 1123 |
+
|
| 1124 |
def test_a_missing_account_is_a_plain_instruction_naming_user_and_cluster():
|
| 1125 |
from thoughtspot_errors import trusted_auth_failure_message
|
| 1126 |
|