FAILURE MAP
← Case archive

FA-11656 / Game simulation rules / Open access

Reapplying poison extends a nonstacking effect additively · case 01

Reapplying poison extends a nonstacking effect additively.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Refresh adds duration instead of taking the longer remaining duration.

VERIFIED REPAIR

On apply retain max(remaining,new duration); tick deals damage only while positive then decrements.

Unsuccessful approach: Replacing remaining duration shortens a longer active effect.

Case contract

Events are [apply,duration] or [tick,0]. Durations are nonnegative. Return [poison damage ticks,remaining duration]; refresh is nonstacking and never shortens.

Why this case matters

A deterministic game-rule model isolates this rule interaction for regression testing.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    r=d=0
    for kind,n in events:
     if kind=='apply': r+=n
     elif r>0: d+=1; r-=1
    return [d,r]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('short refresh',solve([['apply',N+3],['apply',1]]),[0,N+3])
check('long refresh',solve([['apply',1],['apply',N+3]]),[0,N+3])
check('expiration',solve([['apply',N]]+[['tick',0]]*(N+2)),[N,0])
check('empty',solve([]),[0,0])
check('zero refresh',solve([['apply',N],['apply',0]]),[0,N])
check('partial duration',solve([['apply',N+2],['tick',0]]),[1,N+1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
short refresh[0, 5][0, 4]Failed
long refresh[0, 5][0, 4]Failed
expiration[1, 0][1, 0]Passed
empty[0, 0][0, 0]Passed
zero refresh[0, 1][0, 1]Passed
partial duration[1, 2][1, 2]Passed

SHA-256 / 2f2d3367c926afd99266350b7086967b1b3e0f338c794b56ad49edabda76cdae

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    r=d=0
    for kind,n in events:
     if kind=='apply': r=n
     elif r>0: d+=1; r-=1
    return [d,r]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('short refresh',solve([['apply',N+3],['apply',1]]),[0,N+3])
check('long refresh',solve([['apply',1],['apply',N+3]]),[0,N+3])
check('expiration',solve([['apply',N]]+[['tick',0]]*(N+2)),[N,0])
check('empty',solve([]),[0,0])
check('zero refresh',solve([['apply',N],['apply',0]]),[0,N])
check('partial duration',solve([['apply',N+2],['tick',0]]),[1,N+1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
short refresh[0, 1][0, 4]Failed
long refresh[0, 4][0, 4]Passed
expiration[1, 0][1, 0]Passed
empty[0, 0][0, 0]Passed
zero refresh[0, 0][0, 1]Failed
partial duration[1, 2][1, 2]Passed

SHA-256 / b44ab09fb5f1a428ee67ebd8814b911564397011d17463c94e75870e04f11335

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    r=d=0
    for kind,n in events:
     if kind=='apply': r=max(r,n)
     elif r>0: d+=1; r-=1
    return [d,r]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('short refresh',solve([['apply',N+3],['apply',1]]),[0,N+3])
check('long refresh',solve([['apply',1],['apply',N+3]]),[0,N+3])
check('expiration',solve([['apply',N]]+[['tick',0]]*(N+2)),[N,0])
check('empty',solve([]),[0,0])
check('zero refresh',solve([['apply',N],['apply',0]]),[0,N])
check('partial duration',solve([['apply',N+2],['tick',0]]),[1,N+1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
short refresh[0, 4][0, 4]Passed
long refresh[0, 4][0, 4]Passed
expiration[1, 0][1, 0]Passed
empty[0, 0][0, 0]Passed
zero refresh[0, 1][0, 1]Passed
partial duration[1, 2][1, 2]Passed

SHA-256 / 9b50d6ef1a470d9fa636f5f43e37526eac361af40e1d3523fca46f145dee08cc

Verification & scope

Controlled rules-only simulation; not a complete game engine. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:49.868047+00:00.

Case digest / fcd6468909d247579aa3a31124c98c6699d7847e95f573c5f7654f0487993841