Skip to content

Commit f5f2695

Browse files
SnoopLawgclaude
andcommitted
cb #36: hp_burn force-tick count + Geo deflect bug fix — team total -3.0% -> +0.36%
Two un-stacked fixes (cb_sim.py), validated by cb_component_diff on 090946: 1. HP-BURN FORCE-TICK COUNT: activate_hp_burns fired flat once-per-cast; now once PER activate_hp_burns effect (count derived from the skill's kind-9002 ForceStatusEffectTick effects via load_game_profiles — Ninja A2/62002 has 3, one per hit). Burn stays GLOBALLY SINGULAR on the bar (per-effect force-tick count, NOT coexistence — which ballooned to +78% and was ruled out). Venom A1's 2 activate_poisons still share one budget (separate handler, untouched). hp_burn -31.6% -> +3.1% (Ninja -33% -> +7.6%); did NOT balloon (under +20% gate). 2. GEO STONEGUARD DEFLECT BUG: base deflect used buff_mult("strengthen_15", 0.15) which resolves to the Strengthen DR factor 0.85 (the 0.15 default never used) -> reflected 85% of team damage (~5.7x over). Fixed to the literal 0.15 the comment always intended. passive +25.7% -> +0.4% (Geo +40.8% -> -53.5% per-hero). TEAM TOTAL -3.0% -> +0.36%. Survival green (Magic/Spirit/Void T50, Force wipes); 22 tests pass. Re-baseline LOCKED_TOTAL_DMG 8,628,236.84 -> 10,187,844.20. HONEST residuals (documented, NOT fitted): Geo per-hero passive now -53.5% under (the 0.85 bug masked Geo's deeper WM/burn/DEF-mit unders — #32 territory); spurious small Maneater/Venom passives (Phantom-Touch attribution) offset it at team level; bonus-proc under-fire left as-is (forcing it makes team passive worse, +6.6%). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCKiWFsFcWRBkL4kWf1q6b
1 parent 46a035e commit f5f2695

2 files changed

Lines changed: 54 additions & 12 deletions

File tree

tests/test_cb_sim_regression.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,25 @@ class TestCBSimDeterministicSmoke(unittest.TestCase):
130130
# owned heroes (Demytha A1 3.2x Count2 -> 6.4 total): Demytha direct
131131
# -54.5% -> -8.9% on 090946. (Multi-effect heroes Venom/Ninja were already
132132
# summed by load_game_profiles.) Minimal-team total rises accordingly.
133+
# Re-baselined 2026-06-29 — task #36 (HP-burn force-tick COUNT +
134+
# Geo deflect bug). TWO game-truth fixes, net +1.56M on this synthetic
135+
# (crit-off) minimal team; cb_turns unchanged at 23 (both fixes only
136+
# touch OUTGOING boss damage, not hero HP/cadence):
137+
# (1) activate_hp_burns now fires once PER kind=9002 ForceStatusEffectTick
138+
# effect (Ninja A2 = 3 distinct per-hit burns) instead of a flat
139+
# once-per-cast dedupe. Burn stays GLOBALLY singular on the bar; this
140+
# is per-effect force-tick COUNT, NOT coexistence. Closed hp_burn
141+
# -31.6% -> +3.1% on Spirit fixture 090946. (Venom A1's two
142+
# activate_POISONS still collapse to one shared budget — only the
143+
# burn path is per-effect.)
144+
# (2) Geo Stoneguard deflect base was `team_taken *
145+
# buff_mult("strengthen_15", 0.15)` — but that registry entry
146+
# resolves to the Strengthen damage-reduction factor 0.85 (the 0.15
147+
# fallback was never used), so the base reflected 85% of team damage
148+
# (~5.7x over). Now the literal 0.15 (15% deflect). Un-stacks team
149+
# passive +25.7% -> +0.4% and team TOTAL -3.0% -> +0.36% on 090946.
133150
LOCKED_CB_TURNS = 23
134-
LOCKED_TOTAL_DMG = 8_628_236.84 # +multi-hit owned parser (Demytha 6.4x)
151+
LOCKED_TOTAL_DMG = 10_187_844.20 # task #36: burn force-tick count + deflect 0.15 fix
135152
LOCKED_TOTAL_TOL = 20.0 # widened for additive arithmetic noise
136153

137154
def _build_men_team(self):

tools/cb_sim.py

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,7 +1796,17 @@ def _cb_turn(self, tick: int):
17961796
# under on T50 (real ramps 37K->78K/event as the boss
17971797
# damage ramps). Grounded: Geo deflect was the biggest
17981798
# remaining per-hero gap (Geo -53.8% @ Spirit 090946).
1799-
base_deflect = team_aoe_dmg_taken * buff_mult("strengthen_15", 0.15)
1799+
# Deflect 15% of the actual aoe damage allies took.
1800+
# NOTE: must be the LITERAL 0.15 — a prior version used
1801+
# `buff_mult("strengthen_15", 0.15)`, but that registry
1802+
# entry resolves to the Strengthen DAMAGE-REDUCTION
1803+
# factor 0.85 (take 85% damage), NOT the 0.15 fallback,
1804+
# so the base deflect reflected 85% of team damage (~5.7x
1805+
# over). Grounded on 090946: real Geo deflect = 24 events
1806+
# / 1.37M; the 0.85 bug put sim base alone at 1.57M.
1807+
# Fixed -> team passive +25.7% -> ~0% (task #36).
1808+
STONEGUARD_DEFLECT_FRAC = 0.15
1809+
base_deflect = team_aoe_dmg_taken * STONEGUARD_DEFLECT_FRAC
18001810
# Reflect bonus (skill 48805 Effects 488055/488056,
18011811
# "0.03*TRG_HP" capped at the CB 75K DoT cap): ONE 30%
18021812
# roll per boss AoE while a Geo-placed burn is on the
@@ -2792,11 +2802,11 @@ def _glance_dampen(sig: str) -> float:
27922802
return 1.0 - WEAK_HIT_GLANCE_CHANCE
27932803
return 0.0 if glance_this_cast else 1.0
27942804

2795-
# HP-Burn activation is once PER SKILL (game-truth: effect 9002 fires
2796-
# once/skill, not per hit). load_game_profiles emits one activate
2797-
# effect per hit, so dedupe to a single activation per cast — otherwise
2798-
# Ninja A2 (3 hits) triggers each burn 3x, ~3x over-attributing burn.
2799-
_burns_activated_this_cast = False
2805+
# HP-Burn activation fires once PER activate_hp_burns effect (game-truth
2806+
# FORCE-TICK COUNT, task #36): a multi-hit attack that places+ticks a
2807+
# fresh burn each hit (Ninja A2 = 3) produces N distinct instant ticks
2808+
# per cast. load_game_profiles emits one activate_hp_burns per kind=9002
2809+
# effect, so the burn handler below does NOT dedupe — see its comment.
28002810
# Same once-per-cast guard for poison activation: Venom A1 loads TWO
28012811
# activate_poisons effects (one per hit) but "activate up to 2 poisons"
28022812
# is ONE budget per cast, not per hit. Grounded (090946): sim 22 vs real
@@ -2971,11 +2981,26 @@ def _glance_dampen(sig: str) -> float:
29712981
if s.debuff_type != "poison_5pct"]
29722982

29732983
elif eff.effect_type == "activate_hp_burns":
2974-
# Once per skill cast (see _burns_activated_this_cast above) —
2975-
# NOT once per hit.
2976-
if _burns_activated_this_cast:
2977-
continue
2978-
_burns_activated_this_cast = True
2984+
# FORCE-TICK COUNT is per-skill game-truth, NOT once-per-cast.
2985+
# load_game_profiles emits one activate_hp_burns per kind=9002
2986+
# ForceStatusEffectTick effect, and a multi-hit attack that
2987+
# places + ticks a fresh burn EACH hit produces N distinct burn
2988+
# ticks per cast (Ninja A2 skill 62002 = 3 ApplyDebuff(HP Burn)
2989+
# +ForceStatusEffectTick pairs -> 3 instant ticks/cast). The
2990+
# burn stays GLOBALLY SINGULAR on the bar (each hit re-places +
2991+
# ticks the same one slot), so this is NOT coexistence — the
2992+
# natural boss-turn tick still credits one slot. We simply fire
2993+
# one force-tick PER activate effect (no dedupe), deriving the
2994+
# count from the skill's effects (task #36). This closes the
2995+
# burn-under (-32%): real Ninja = 83 ticks (~21 A2 casts x3
2996+
# force + natural), sim previously fired 1 force/cast.
2997+
#
2998+
# NOTE: Venom A1's TWO activate_poisons are a SHARED single
2999+
# budget ("activate up to 2 poisons"), NOT distinct per-hit
3000+
# ticks, so the poison path below KEEPS its once-per-cast
3001+
# dedupe (_poisons_activated_this_cast). Only the burn path
3002+
# is per-effect.
3003+
#
29793004
# Ninja A2 / Sicia A2: instantly trigger all HP Burn debuffs
29803005
# (1 tick each). GAME-TRUTH (clean2 tick log, kind 3014):
29813006
# activated tick damage credits the BURN'S OWNER (placer =

0 commit comments

Comments
 (0)