 #Requires AutoHotkey v2.0
 #NoTrayIcon
 ; Extracted only after an explicit diagnostic Run click.
 ; Isolated child: no live state, user INIs, game input, audio or HTTP.
 Suspend(true)
 SOPHIE_TEST_HARNESS := true
 IRIS_V48_TEST_ENTRY := V48RunTests
 #Include %A_ScriptDir%\Iris_Test_Runtime.ahk
 
 V48Assert(condition, message)
 {
     global V48Checks
     V48Checks += 1
     if !condition
         throw Error("Assertion " V48Checks ": " message)
 }
 
 V48Setup(phase := 1)
 {
     global Audio, NBCandle, NBOrder, NBOrderOptions, NBToonBindings, NahutProfiles, NahutAssignments
     global Roster, playerTankRoles, testClock, CurrentRecord, inputMode, activeBoss, audioOutputMode
     global AUDIO_MODE_KENKU_BRIDGE_TTS, soundboardsEnabled, autoBossCalloutsEnabled, chatOpen
     global BridgeTextById, RouteStates, NBCandleOptions, Preview, LogClock, NBOrderRecordings
     testClock := 100000
     Audio.Queue := [], Audio.Current := "", Audio.Http := "", Audio.Epoch += 1
     Audio.Events := Map(), Audio.LastAccepted := Map()
     RouteStates := Map(), Preview := {Gui: "", Items: [], Visible: false, Message: ""}
     NBCandle := NewNBCandleState(NBCandle.Generation + 1)
     NBOrder := NewNBOrderState(NBCandle.Generation)
     NBOrderOptions := {Enabled: true, Phases: [true,true,true], NextEnabled: true, Corrections: true, NoneEnabled: true}
     NBOrderRecordings := Map()
     NahutProfiles := NewNahutProfileState()
     NahutProfiles.Active := "p1", NahutProfiles.Order := ["p1"], NahutProfiles.NextId := 2
     NahutAssignments := NewNahutAssignments()
     NBToonBindings := Map("p1", NewNahutAssignments())
     Roster := {Members: Map(), Snapshot: -1, LastFight: 100000, ContextAt: -1}
     playerTankRoles := Map()
     for i, slot in NBCandlePriority() {
         actor := "@" slot "#" (100+i)
         NahutAssignments[slot] := slot
         NBToonBindings["p1"][slot] := slot
         role := InStr(slot,"Tank") = 1 ? "Tank" : (InStr(slot,"Healer") = 1 ? "Healer" : "DPS")
         Roster.Members[actor] := {RoleAt: 0, Snapshot: -1, Role: role}
         playerTankRoles[actor] := role = "Tank"
         p := NBCandlePlayer(actor, 0)
         p.Battery := 1, p.BatteryAt := 0
         p.Pos := {Token: actor, X: 0, Y: 0, Z: 0, Hp: 100, MaxHp: 100, At: testClock}
     }
     NahutProfiles.Items["p1"] := {Name: "Self-test", Assignments: NahutAssignments.Clone()}
     NBCandle.Boss := {Token: "Nahut {4122949560827904}:999", X: 0, Y: 0, Z: 0, Hp: 900, MaxHp: 1000, At: testClock}
     NBCandle.BossInstance := "999", NBCandle.WasDamaged := true
     NBCandle.LiveAt := testClock, NBCandle.LiveTick := testClock, NBCandle.CombatAt := testClock
     NBOrder.LiveAt := testClock, NBOrder.LiveTick := testClock, NBOrder.ActivityAt := testClock
     NBOrder.At := testClock, NBOrder.Started := true, NBOrder.Config := NBOrderConfigKey()
     if phase > 0
         NBOrderSetPhase(phase, testClock, "synthetic test phase")
     inputMode := "CombatLog", activeBoss := "GFTM - Nahut", audioOutputMode := AUDIO_MODE_KENKU_BRIDGE_TTS
     soundboardsEnabled := true, autoBossCalloutsEnabled := true, chatOpen := false
     BridgeTextById := BuildDefaultBridgePhrases()
     NBCandleOptions.Enabled := true
     CurrentRecord := ""
     LogClock := {Day: 0, Raw: -1, Dated: false, LastWall: 0, LastTick: 0, Status: "test", Age: -1, Latest: -1}
 }
 
 V48Actor(slot)
 {
     global testClock
     return ResolveNBCandleActor(slot, testClock)
 }
 
 V48Time(at, fresh := true)
 {
     global testClock, NBOrder, NBCandle
     testClock := at
     if fresh {
         for actor, p in NBCandle.Players
             p.Pos.At := at
         NBCandle.Boss.At := at
     }
     NBOrder.LiveAt := at, NBOrder.LiveTick := at, NBOrder.ActivityAt := at
     NBCandle.LiveAt := at, NBCandle.LiveTick := at, NBCandle.CombatAt := at
 }
 
 V48Field(slot, hp := 100)
 {
     global NBCandle
     a := V48Actor(slot), p := NBCandle.Players[a].Pos
     return a "|(" p.X "," p.Y "," p.Z ",0)|(" hp "/100)"
 }
 
 V48Event(at, source, target, ability, action, effect, tail := "")
 {
     global CurrentRecord
     V48Time(at)
     stamp := Format("{:02d}:{:02d}:{:02d}.{:03d}", Floor(at/3600000), Mod(Floor(at/60000),60), Mod(Floor(at/1000),60), Mod(at,1000))
     line := "[" stamp "] [" source "] [" target "] [x {" ability "}] [x {" action "}: x {" effect "}]" tail
     CurrentRecord := {Line: line, At: at, Age: 0, ReadTick: at, Allow: true}
     TrackNBCandle(line, true)
     SafeTrackNBOrder(line, true)
     CurrentRecord := ""
     return line
 }
 
 V48Pass(slot, at)
 {
     return V48Event(at, V48Field(slot), "=", "4132016236789760", "836045448945477", "4132016236789760")
 }
 
 V482BatteryPickup(slot, at)
 {
     return V48Event(at, V48Field(slot), "=", "4180987453898752", "836045448945477", "4180987453899014")
 }
 
 V482AssertChosen(expected, message)
 {
     actual := V48Chosen()
     V48Assert(actual = expected, message " (expected=" expected ", actual=" actual ")")
 }
 
 V48Use(slot, at, strong := true)
 {
     return V48Event(at, V48Field(slot), "=", strong ? "4181850742325248" : "4180987453898752",
         strong ? "836045448945477" : "836045448945478", strong ? "4181850742325528" : "4180987453899014")
 }
 
 V48Lock(slot, at)
 {
     return V48Event(at, "Nahut {4122949560827904}:999|(0,0,0,0)|(900/1000)", V48Field(slot),
         "4132626122145792", "836045448945477", "4132626122145792")
 }
 
 V48Chosen()
 {
     global NBOrder, testClock
     c := NBOrderReconcile(testClock)
     return IsObject(c) ? c.Slot : ""
 }
 
 V48DoneThrough(count)
 {
     global NBOrder
     Loop count
         NBOrder.Turns[A_Index].Done := true
     NBOrder.Choice := 0
 }
 
 V48TestP1()
 {
     global NBOrder, NBCandle, testClock
     V48Setup()
     V48Assert(NBOrder.Turns.Length = 11, "ten P1 turns plus free-tank emergency")
     V48Assert(V48Chosen() = "Tank1", "P1 opens with T1")
     V48Pass("Tank1",100100)
     V48Assert(!NBOrder.Turns[1].Done && V48Chosen() = "Tank1", "receipt does not complete reveal")
     V48Use("Tank1",100700)
     V48Assert(NBOrder.Turns[1].Done && V48Chosen() = "Tank2", "actual opener advances to T2")
     V48Use("Tank1",100701,false)
     V48Assert(NBCandle.Step = 1 && V48Chosen() = "Tank2", "personal effect plus cell loss counts once")
     V48Use("Tank2",110000)
     V48Pass("DoubleCloseDPS",110100)
     V48Assert(V48Chosen() = "Healer1" && NBOrder.Mispass, "wrong receipt does not skip healers")
     V48Use("DoubleCloseDPS",110700)
     V48Assert(NBOrder.Turns[5].Done && !NBOrder.Turns[3].Done, "early use credited to the correct future occurrence")
     V48Assert(V48Chosen() = "Healer1", "early use returns to earliest unfinished turn")
     V48Use("Healer1",120000)
     V48Use("Healer2",130000)
     V48Assert(V48Chosen() = "DoubleFarDPS", "already-used double close turn not requested twice")
     V48Assert(!NBOrder.Turns[9].Done && !NBOrder.Turns[10].Done, "second healer turns remain distinct")
 }
 
 V48TestException()
 {
     global NBOrder, NBCandle
     V48Setup(), V48DoneThrough(8)
     mara := V48Actor("Mara"), h1 := V48Actor("Healer1")
     NBCandle.Holder := mara, NBOrder.LastUseActor := mara
     NBCandle.Players[h1].LastUse := 50000
     V48Assert(V48Chosen() = "Healer1" && NBOrder.GraceH1, "exactly 10s remaining allowed from Mara")
     V48Pass("Healer1",100100)
     V48Assert(V48Chosen() = "Healer1" && !NBOrder.Mispass, "accepted cooldown hold is not an incorrect pass")
     V48Assert(!NBOrder.Turns[9].Done, "allowed receipt still does not complete second turn")
     V48Time(110001)
     V48Assert(NBOrderEligibility(9,110001,true).WaitMs = 0, "wait uses actual remaining cooldown")
     V48Setup(), V48DoneThrough(8)
     NBCandle.Holder := V48Actor("Mara"), NBOrder.LastUseActor := NBCandle.Holder
     NBCandle.Players[V48Actor("Healer1")].LastUse := 50001
     V48Assert(V48Chosen() = "Healer2", "10.001 seconds is not allowed")
     V48Setup(), V48DoneThrough(8)
     NBCandle.Holder := V48Actor("Mara"), NBOrder.LastUseActor := NBCandle.Holder
     NBCandle.Players[V48Actor("Healer1")].LastUse := 50000
     V48Chosen()
     V48Pass("DoubleCloseDPS",100100)
     V48Assert(!NBOrder.GraceH1 && V48Chosen() = "Healer2", "exception cannot transfer to a different passer")
 }
 
 V48TestEmergency()
 {
     global NBCandle, NBOrder
     V48Setup(), V48DoneThrough(10)
     NBCandle.Target := V48Actor("Tank2"), NBCandle.TargetAt := 100000
     V48Assert(V48Chosen() = "Tank1", "free-tank emergency is not always T2")
     V48Pass("Tank1",100100), V48Use("Tank1",100700)
     V48Assert(NBOrder.Turns[11].Done && V48Chosen() = "", "emergency is one turn, not an invented loop")
     V48Setup(), V48DoneThrough(10)
     NBCandle.Target := ""
     V48Assert(V48Chosen() = "", "unknown boss tank does not select either tank")
 }
 
 V48TestP2(h1GetsBattery := true, finalSnipe := true)
 {
     global NBCandle, NBOrder
     V48Setup()
     V48Pass("Healer1",100100)
     NBCandle.Players[V48Actor("Healer1")].Battery := 0
     NBCandle.Players[V48Actor("Healer1")].LastUse := 100000
     V48Event(101000,"Power Coupling {4131857322999808}:700|(0,0,0,0)|(100/100)","", "0", "836045448945472", "836045448953668")
     V48Assert(NBOrder.Phase = 2 && V48Chosen() = "Healer1", "coupling entry immediately overrides P1")
     V48Assert(NBCandle.Players[V48Actor("Healer1")].LastUse = 100000, "P2 does not clear P1 cooldown")
     V48Assert(!NBOrder.Turns[1].Done, "H1 hold does not finish on receipt")
     V48Lock("Healer1",102000)
     V48Assert(V48Chosen() = "Healer2", "H1 pass at lock, without waiting for damage")
     V48Pass("Healer2",102100), V48Lock("Healer2",103000)
     V48Pass("Tank1",103100), V48Lock("Tank1",104000)
     V48Assert(V48Chosen() = "Tank1" && !NBOrder.Turns[3].Done, "tank lock alone cannot release pass")
     V48Pass("Tank2",104100)
     V48Assert(V48Chosen() = "Tank1" && NBOrder.Mispass, "premature tank pass directs it back")
     V48Use("Tank1",104700,false)
     V48Assert(!NBOrder.Turns[3].Done, "bare cell loss does not prove the tank completed its reveal")
     V48Use("Tank1",104701,true)
     V48Assert(NBOrder.Turns[3].Done && V48Chosen() = "Tank2", "positive proof upgrades same use and completes handoff")
     V48Use("Tank2",105000,true)
     V48Assert(V48Chosen() = "Tank2" && !NBOrder.Turns[4].Done, "reveal-first tank still needs its lock")
     V48Assert(NBOrderEligibility(4,105000).Ok, "already-completed tank reveal does not require another battery")
     V48Lock("Tank2",106000)
     V48Assert(V48Chosen() = "DoubleCloseDPS", "reverse action order also releases tank correctly")
     V48Use("DoubleCloseDPS",106500)
     V48Assert(!NBOrder.Turns[5].Done, "accidental hold-turn reveal does not replace snipe lock")
     V48Lock("DoubleCloseDPS",107000), V48Pass("DoubleFarDPS",107100)
     V48Assert(NBOrder.TerminalArmed && V48Chosen() = "DoubleFarDPS", "terminal hold armed after current tasks")
     if finalSnipe
         V48Lock("DoubleFarDPS",108000)
     V48Assert(NBOrder.Phase = 2 && !NBOrder.Turns[6].Done, "final lock or its absence cannot pass or start P3")
     V48Time(170000)
     V48Assert(V48Chosen() = "DoubleFarDPS", "long hold has no timeout")
     h1 := NBCandle.Players[V48Actor("Healer1")]
     V48Assert(h1.Battery = 0 && h1.LastUse = 100000, "waiting through P2 does not create H1's battery or erase use history")
     ; v48.2 fixture repair: the P2 bait test deliberately spent H1's cell.
     ; Only the eligible-H1 variant observes a new battery before the P3 reveal.
     ; Cooldown elapsed alone is NOT battery availability.
     if h1GetsBattery {
         V482BatteryPickup("Healer1",170001)
         V48Assert(h1.Battery = 1 && h1.BatteryAt = 170001, "H1 battery pickup reaches the real shared tracker")
         V48Assert(h1.LastUse = 100000, "battery pickup preserves H1's real reveal timestamp")
     }
     V48Use("DoubleFarDPS",170100,false)
     V48Assert(NBOrder.Phase = 2, "bare loss cannot start P3")
     V48Use("DoubleFarDPS",170101,true)
     V48Assert(NBOrder.Phase = 3 && NBOrder.Turns[1].Done, "same completed reveal both starts P3 and credits opener")
     if h1GetsBattery
         V482AssertChosen("Healer1", "next person after opening reveal is eligible H1")
     else {
         V482AssertChosen("Healer2", "batteryless H1 is skipped for the next eligible P3 revealer")
         V48Assert(NBOrder.Turns[2].Skipped && !NBOrder.Turns[2].Done
             && NBOrder.Turns[2].SkipReason = "No battery", "H1 is skipped for no battery, not credited with a reveal")
         V48Assert(h1.Battery = 0 && h1.LastUse = 100000, "P3 transition does not create a battery or reset H1 cooldown history")
     }
     V48Assert(!NBOrder.Turns[7].Skipped && !NBOrder.Turns[7].Done, "H1's later P3 occurrence remains independent")
     V48Assert(NBCandle.Players[V48Actor("DoubleFarDPS")].LastUse = 170100, "opening use retains original cooldown timestamp")
     V48Use("DoubleFarDPS",170102,true)
     V48Assert(!NBOrder.Turns[10].Done, "duplicate opener does not credit emergency DF turn")
 }
 
 V482TestP2NoBattery()
 {
     V48TestP2(false, true)
 }
 
 V482TestP2NoFinalSnipe()
 {
     V48TestP2(true, false)
 }
 
 V482TestP3EntryCooldown()
 {
     global NBCandle, NBOrder
     V48Setup(2), V48DoneThrough(5)
     h1 := NBCandle.Players[V48Actor("Healer1")]
     h1.LastUse := 90000 ; known pre-transition use, only 10 seconds ago
     V48Pass("DoubleFarDPS",100100)
     V48Assert(NBOrder.TerminalArmed && V48Chosen() = "DoubleFarDPS", "final P2 hold is armed without a last snipe")
     V48Use("DoubleFarDPS",100700,true)
     V48Assert(NBOrder.Phase = 3 && NBOrder.Turns[1].Done, "completed terminal reveal starts and credits P3 once")
     V482AssertChosen("Healer2", "H1 with a battery but active cooldown is still skipped in P3")
     V48Assert(h1.Battery = 1 && h1.LastUse = 90000, "P3 entry preserves battery and cooldown as separate facts")
     V48Assert(NBOrder.Turns[2].Skipped && !NBOrder.Turns[2].Done
         && InStr(NBOrder.Turns[2].SkipReason, "Reveal cooldown") = 1, "H1 is skipped for cooldown, not missing battery")
     V48Assert(!NBOrder.Turns[7].Skipped && !NBOrder.Turns[7].Done, "skipping first H1 does not discard second H1")
 }
 
 V48TestP3Branches()
 {
     global NBCandle, NBOrder
     V48Setup(3), V48DoneThrough(4)
     V48Assert(V48Chosen() = "Tank2" && NBOrder.Branch = "Tank2ThenMara", "near T2 first")
     V48Use("Tank2",100600)
     V48Assert(V48Chosen() = "Mara", "Mara follows T2 once")
     V48Setup(3), V48DoneThrough(4)
     NBCandle.Players[V48Actor("Tank2")].Pos.X := 50
     V48Assert(V48Chosen() = "Mara" && NBOrder.Branch = "MaraThenTank2", "away T2 defers behind Mara")
     NBCandle.Players[V48Actor("Tank2")].Pos.X := 10
     V48Assert(V48Chosen() = "Mara", "return does not retroactively change selected Mara pass")
     V48Use("Mara",100600)
     V48Assert(V48Chosen() = "Tank2", "returned T2 gets second opportunity")
     V48Use("Tank2",110600)
     V48Assert(V48Chosen() = "Healer1", "middle block finishes after both once")
     V48Setup(3), V48DoneThrough(4)
     NBCandle.Players[V48Actor("Tank2")].Pos.X := 50
     V48Chosen(), V48Use("Mara",100600)
     V48Assert(V48Chosen() = "Healer1" && NBOrder.Turns[6].Skipped, "still-away T2 skipped after Mara")
     NBCandle.Players[V48Actor("Tank2")].Pos.X := 0
     V48Assert(V48Chosen() = "Healer1", "late return cannot rewind to skipped T2")
     V48Assert(NBCandle.Players[V48Actor("Tank2")].LastUse = -1, "skip does not invent use/cooldown")
     V48Setup(3), V48DoneThrough(4)
     NBCandle.Players[V48Actor("Tank2")].Pos.At := 87999
     V48Assert(V48Chosen() = "Mara", "stale T2 position cannot establish return")
 }
 
 V48TestGuards()
 {
     global NBOrder, NBCandle, CurrentRecord, testClock, NBToonBindings
     V48Setup(2)
     V48Pass("DoubleFarDPS",100100), V48Use("DoubleFarDPS",100700)
     V48Assert(NBOrder.Phase = 2 && !NBOrder.TerminalArmed, "out-of-order DF use cannot start P3")
     V48Setup()
     V48Pass("Tank1",100100)
     V48Event(100300,V48Field("Tank1"),"=","4181850742325248","836045448945472","836045448945479")
     V48Assert(!NBOrder.Turns[1].Done, "cast start does not finish turn")
     V48Event(100400,V48Field("Tank1"),"=","4181850742325248","836045448945472","836045448945481")
     V48Assert(NBCandle.Players[V48Actor("Tank1")].LastUse = -1, "interruption does not start full cooldown")
     V48Setup(2)
     V48Event(100100,"Rail Turret {4132441438543872}:888|(0,0,0,0)|(100/100)",V48Field("Healer1"),"4132626122145792","836045448945477","4132626122145792")
     V48Assert(!NBOrder.Turns[1].Done, "similar turret attack is not Nahut's lock")
     V48Event(100200,"Nahut {4122949560827904}:999|(0,0,0,0)|(900/1000)",V48Field("Healer1"),"4132626122145792","836045448945477","836045448945501"," (100)")
     V48Assert(!NBOrder.Turns[1].Done, "snipe damage is not lock evidence")
     V48Setup(), V48Pass("Tank1",100100)
     V48Event(100200,V48Field("Tank1",0),"=","4180987453898752","836045448945478","4180987453899014")
     V48Assert(!NBOrder.Turns[1].Done, "death cell cleanup cannot finish a reveal")
     V48Setup(), V48Chosen()
     NBToonBindings["p1"]["Tank1"] := "DifferentToon"
     V48Event(100100,"Nahut {4122949560827904}:999|(0,0,0,0)|(900/1000)","","0","836045448945472","836045448945479")
     V48Assert(NBOrder.Suspended, "mid-pull binding changes cannot relabel completed turns")
 }
 
 V48TestQueueAndBurn()
 {
     global NBOrder, NBCandle, Audio, testClock, NBOrderOptions, NBFloor
     V48Setup(), V48Pass("Tank1",100100), V48Use("Tank1",100700), PollNBOrder()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].NOData.Kind = "Pass", "actual pass instruction enters existing queue")
     item := Audio.Queue.RemoveAt(1)
     V48Assert(!NBOrder.Delivery.Completed, "queued/submitted does not mean completed")
     Audio.Current := item
     FinishAudio("stopped: higher priority")
     V48Assert(!NBOrder.Delivery.Completed, "interrupted speech not marked delivered")
     V48Time(102800), PollNBOrder()
     V48Assert(Audio.Queue.Length = 1 && NBOrder.Delivery.Attempts = 2, "one bounded retry")
     item := Audio.Queue.RemoveAt(1), Audio.Current := item
     FinishAudio("stopped: higher priority")
     V48Time(104900), PollNBOrder()
     V48Assert(Audio.Queue.Length = 0, "no endless retry after two attempts")
     V48Setup(), V48Pass("Tank1",100100), V48Use("Tank1",100700), PollNBOrder()
     V48Pass("Tank2",100900)
     V48Assert(Audio.Queue.Length = 0, "correct receipt cancels waiting pass instruction")
     V48Setup(3), V48DoneThrough(9)
     V48Pass("DoubleFarDPS",100100), V48Use("DoubleFarDPS",100700)
     old := NBCandle.Players[V48Actor("DoubleFarDPS")].LastUse
     V48Event(101000,"Singularity Core {4122580193640448}:555|(0,0,0,0)|(100/100)",V48Field("Healer1"),"4133502295474176","836045448945477","4133502295474475")
     V48Assert(NBOrder.Phase = 4 && NBCandle.Burn, "Oppressive Gravity hands over to existing burn system")
     V48Assert(NBCandle.Players[V48Actor("DoubleFarDPS")].LastUse = old, "burn retains P3 cooldown")
     V48Assert(!NBOrderLive(), "ordered adviser cannot compete with burn")
     V48Event(102000,"Power Coupling {4131857322999808}:700|(0,0,0,0)|(100/100)","","0","836045448945472","836045448953668")
     V48Assert(NBOrder.Phase = 4, "late coupling cannot rewind burn")
 }
 
 V48TestResetAndTiming()
 {
     global NBOrder, NBCandle, LogClock, rejectOldLogAudio, testClock, NBFloor
     V48Setup()
     V48Pass("Tank1",100100), V48Use("Tank1",100700)
     generation := NBCandle.Generation
     before := NBCandle.Players[V48Actor("Tank1")].LastUse
     LogClock.Dated := true, LogClock.LastWall := 100700, LogClock.LastTick := 100700
     rejectOldLogAudio := false
     rec := ObserveLogRecord("[00:01:41.000] [] [] [] []", 120000, 101000, true)
     V48Assert(rec.Allow, "wall-clock correction does not block when rejection OFF")
     V48Assert(NBCandle.Generation = generation && NBOrder.Turns[1].Done, "wall-clock correction preserves encounter/turn ledger")
     V48Assert(NBCandle.Players[V48Actor("Tank1")].LastUse = before, "wall-clock correction preserves cooldown")
     ResetNBCandleState("synthetic new pull")
     V48Assert(NBOrder.Phase = 0 && NBOrder.Uses.Count = 0, "actual reset clears old turn ledger")
     V48Setup()
     V48Time(115001,false)
     NBOrder.LiveTick := 100000
     V48Assert(!NBOrderLive(), "15s input heartbeat pauses unsupported live advice")
     V48Assert(NBOrder.Phase = 1, "stale input does not reset phase")
 }
 
 V48TestPreBossOpener()
 {
     global NBOrder, NBCandle, CurrentRecord
     V48Setup(0)
     NBOrder.Started := false, NBOrder.Config := "", NBOrder.At := -1
     NBCandle.Boss := "", NBCandle.BossInstance := "", NBCandle.WasDamaged := false
     ; V48Event's clock refresher expects a boss object, so feed explicitly.
     line := "[00:01:40.000] [" V48Field("Tank1") "] [=] [Candle {4132016236789760}] [ApplyEffect {836045448945477}: Candle {4132016236789760}]"
     CurrentRecord := {Line: line, At: 100000, Age: 0, ReadTick: 100000, Allow: true}
     TrackNBCandle(line,true), SafeTrackNBOrder(line,true)
     line := "[00:01:40.600] [" V48Field("Tank1") "] [=] [Suppression Burst {4181850742325248}] [ApplyEffect {836045448945477}: Candle Suppressed {4181850742325528}]"
     CurrentRecord := {Line: line, At: 100600, Age: 0, ReadTick: 100600, Allow: true}
     TrackNBCandle(line,true), SafeTrackNBOrder(line,true)
     V48Assert(NBOrder.Phase = 1 && NBOrder.Turns[1].Done, "opener is retained before Nahut's first health record")
     line := "[00:01:40.601] [Nahut {4122949560827904}:999|(0,0,0,0)|(1000/1000)] [] [x {0}] [Event {836045448945472}: TargetSet {836045448953668}]"
     CurrentRecord := {Line: line, At: 100601, Age: 0, ReadTick: 100601, Allow: true}
     TrackNBCandle(line,true), SafeTrackNBOrder(line,true)
     CurrentRecord := ""
     V48Assert(NBOrder.Turns[1].Done && V48Chosen() = "Tank2", "first boss health does not request a second opener")
 }
 
 V48RunTests(*)
 {
     global V48Checks
     V48Checks := 0
     report := "Iris v0.78.112 - native AutoHotkey test report`r`nAHK: " A_AhkVersion "`r`nSource SHA-256: " IrisSourceHash() "`r`n"
     failed := 0
     tests := [V78124FreshAbilityDefaults,V48TestP1, V48TestException, V48TestEmergency, V48TestP2, V48TestP3Branches,
         V48TestGuards, V48TestQueueAndBurn, V48TestResetAndTiming, V48TestPreBossOpener,
         V482TestP2NoBattery, V482TestP2NoFinalSnipe, V482TestP3EntryCooldown,
         V49TestP1FixedAndSkips, V49TestReseedDuringOldCast, V49TestP2SilentAndOpener, V49TestP3Numbering, V49TestFifthAdvanceWhileCooling, V49TestCloseReturn, V49TestBurnPriority, V49TestBurnPriorityCombinations, V49TestQuietUseTracking, V49TestCloakDedupAndReversed, V49TestTransitionThenGravity, V49TestGravityBeforeTransitionEnd, V49TestMissingTransitionMarker, V49TestNoDoubleAssignmentOnUse, V49TestAudioExpiryAndMute, V49TestMissingOutcomeAndEmptySource, V49TestResetAndStaleReturn, V49TestPayloadsAndPreviewIsolation,
         V491TestBurnDirectedPhrase, V491TestUnknownHolderFallback, V491TestSelfPassSuppressed, V491TestCorrectReceiptCancelsPass, V491TestChangedHolderRetiresSpeech, V491TestBurnEligibilityPreserved, V491TestDirectedRecordingReuse, V491TestBurnPreviewIsolation, V491TestBurnPassSwitches,
         V492TestOpeningOnly, V492TestNoLateFirstWarning, V492TestQueuedAndActiveRetired, V492TestTakeoverWithoutRecast, V492TestMutedAndHydrated, V492TestResetRearms, V492TestDedupAndDecay, V492TestRoleAndSourceGuards, V492TestMissingFirstCast, V492TestOtherStackWarnings, V492TestExistingWordingAndRoutes, V492TestSeptember21LogExcerpt,
         IBTestInactive, IBTestHistogram, IBTestThresholds, IBTestEmptyCapture, IBTestAudioLifecycle, IBTestQueueRemoval, IBTestRetry, IBTestCarryIn, IBTestSessionIsolation, IBTestPrivacy, IBTestResources, IBTestBatchAccounting, IBTestStopBoundary, IBTestPreviewsAndFailures, IBTestSaveProtection, IBTestRealQueueHooks,
         V501TestSpeechPolicyMatrix, V501TestWrongPassInEveryQuietPhase, V501TestRoutineCallsStayQuiet, V501TestOutOfOrderRevealRecovery, V501TestRevealWithoutReceiptEvidence, V501TestCorrectReceiptEndsRecovery, V501TestCorrectionsOffDoesNotFallBack, V501TestP2PrematureTankPass, V501TestP2RevealCannotReplaceLock, V501TestP2OutOfOrderLock, V501TestPhaseChangeRetiresCorrections, V501TestQueuedPolicyRevalidation, V501TestMasterAndLiveSafeguards, V501TestBoundedCorrectionRetries, V501TestNoEligibleDuringRecovery, V501TestWaitClassification, V501TestBurnResetAndTerminalHold, V501TestPayloadAndIdentity, V501TestSavedChoicesPreserved,
         V502TestDefaultsAndKeys, V502TestVisibilityPolicy, V502TestInputClamping, V502TestMonitorPlacement, V502TestSnapshotAllowlist, V502TestRateAndDelay, V502TestGenerationAndRewind, V502TestDisplayTruthfulness, V502TestMissingSamples, V502TestQueueFiltering, V502TestHideKeepsCapture, V502TestElapsedAndTestIsolation, V502TestSavedOverlayPreferences,
         V51TestLineGrammar, V51TestNumericIdsNotLabels, V51TestMalformedAndValues, V51TestDamageAndRates, V51TestHealingIsRaw, V51TestZeroEffectiveKnown, V51TestIncomingAndSelfDamage, V51TestZeroDuration, V51TestSimultaneousResults, V51TestGapGrouping, V51TestExitAndDeathDoNotResetRaid, V51TestDeathDedupAndReturn, V51TestMidnightAndOrdering, V51TestAttachmentBoundary, V51TestPlayersAndNpcInstances, V51TestCompanionKeptSeparate, V51TestAbilityAndTargetFilters, V51TestEventRingBounded, V51TestSessionLimits, V51TestOutsideHealing, V51TestImportStateIsolation, V51TestMutedSpeechDoesNotMuteStats, V51TestQueueAndInactiveHook, V51TestHideIsNotStop, V51TestSummaryAndCsv, V51TestExportPathProtection, V51TestDemoArithmetic, V51TestBlankAndUnicodeActors, V51TestImportByteBoundaries, V51TestImportSnapshotDoesNotReadAppend,
         V52TestDefaults, V52TestKeysDisjoint, V52TestLatestLiveIndependent, V52TestSelectedView, V52TestStoppedHistory, V52TestEmptyAndDemoStates, V52TestPartialAndHalted, V52TestSnapshotIsolation, V52TestRankingAndTies, V52TestTopRowsBound, V52TestMetricDirections, V52TestCompanionsSeparate, V52TestZeroRowsAndRates, V52TestFormatting, V52TestBarScaling, V52TestLayoutBounds, V52TestHidePreservesEngines, V52TestNoStartupOrTestTimer, V52TestDurationNoWallClock, V52TestLateDamageBoundary, V52TestRealDummyRecords, V52TestUpdatingFence,
         V521TestDragDefaults, V521TestDragOwnership, V521TestDragGuards, V521TestDragCoordinates, V521TestDragCleanupIsolation, V521TestHiddenWindowLockStyles, V521TestHiddenPositionRetention, V521TestNoMouseCaptureInHarness,
         V522TestSingleWindowDefaults, V522TestMetricCycle, V522TestMigrationMatrix, V522TestLegacySettings, V522TestNewSettingsPrecedence, V522TestSettingsRoundtrip, V522TestCycleKeepsData, V522TestHiddenCycleDoesNotShow, V522TestInvalidAndBusySelection, V522TestAdaptiveHeight, V522TestCompactLayout, V522TestStatusWarnings, V522TestTabsNotDragTargets, V522TestHiddenSameWindow, V522TestHiddenMetricRendering, V522TestHiddenResizeAndPosition,
         V53TestPersonalIdentity, V53TestPersonalUnknown, V53TestPersonalAmounts, V53TestPersonalEffective, V53TestPersonalNoInventedStats, V53TestSnapshotFields, V53TestBriefTitles, V53TestResizeEdges, V53TestResizeRightBottom, V53TestResizeLeftTop, V53TestResizeBounds, V53TestResizeSignedCoordinates, V53TestFixedHeightAndColumns, V53TestSmallScreenAndDpi, V53TestSplitOwnership, V53TestActiveViewPolicies, V53TestSplitHiddenWindows, V53TestSplitSettingsRoundtrip, V53TestNoRollbackWrites, V53TestBadges, V53TestNoEngineChangesOnSplitHide, V53TestManualResizeHidden, V53TestCompactNumbers, V53TestTimeLabels, V53TestPersonalHiddenRendering, V53TestSplitCycleIsNotAHide, V53TestResetGeometryPersistence,
         V531TestDefaults, V531TestLockedClickPolicy, V531TestClickGuards, V531TestSurfaceVisibilityMatrix, V531TestTabOwnership, V531TestTabCoordinates, V531TestHiddenSurfaceStyles, V531TestHiddenSurfaceGeometry, V531TestNonActivationMessages, V531TestPreferenceRoundtrip, V531TestHideDestroyLifecycle, V531TestEditAndSplitIsolation, V531TestNoVisibleOrInputWorkInHarness, V531TestViewSelectionKeepsTotals,
         V532TestExplicitEffective, V532TestModernEqualHealing, V532TestFullOverhealAndZero, V532TestLegacyUnknown, V532TestMalformedEffective, V532TestRoundingBound, V532TestAggregationAndProvenance, V532TestUnknownQuality, V532TestEffectiveRanking, V532TestUnknownAndZeroRanking, V532TestSnapshotAndRawPreserved, V532TestPersonalHeadline, V532TestEffectiveBreakdown, V532TestExportDefinitions, V532TestDamageTimingUntouched, V532TestHiddenEffectiveDisplay,
         V533TestTargetMatrix, V533TestBothNoExtras, V533TestDuplicateMetricDrag, V533TestBothDragGuards, V533TestHiddenWindows, V533TestDuplicateMetricRendering, V533TestCycleIsolation, V533TestBothTabPolicy, V533TestBothInputSurface, V533TestGeometryChoices, V533TestGeometryControls, V533TestIndependentResize, V533TestSettingsRoundtrip, V533TestSwitchBack, V533TestLegacyLayoutPreserved, V533TestHideIsolation, V533TestDestroyLifecycle, V533TestInitialPlacement, V533TestNoAutomaticWork, V533TestEffectiveMatchesBoth,
         V54TestThreatNumbers, V54TestThreatEligibility, V54TestThreatInvalid, V54TestThreatTotals, V54TestThreatNegativeAndMissing, V54TestThreatOutsideAndReset, V54TestThreatSort, V54TestCompanionThreat, V54TestHealthValidation, V54TestHPActorIsolation, V54TestHPTimestamps, V54TestHPMaxChange, V54TestHPStale, V54TestHPKnownBosses, V54TestHPMultiBoss, V54TestHPPins, V54TestHPFallback, V54TestSnapshotIsolation, V54TestCapacity, V54TestExtraPanelsDefault, V54TestExtraPanelsModes, V54TestHiddenPanels, V54TestExtraDragging, V54TestExtraSettings, V54TestUploadLinks, V54TestUploadResult, V54TestUploadUnsafeXML, V54TestUploadJobEscaping, V54TestUploadWorkerInert, V54TestUploadBase64, V54TestUploadWorkerValidation, V54TestHPDenominatorRegression, V54TestThreatTailInterval,
         V55TestEntryCatalogue, V55TestDefaultChecks, V55TestNoPhantomPanels, V55TestBothWithAllPanels, V55TestRemoveTabbedOnly, V55TestRestoreTabbed, V55TestExtrasOnly, V55TestAllUnchecked, V55TestInvalidChoice, V55TestSelectionMatrix, V55TestGeometryPreserved, V55TestPreviewPolicy, V55TestPreviewNotPersisted, V55TestSelectionRoundTrip, V55TestHiddenMenuChecks, V55TestMenuHostDedup, V55TestCheckedWhileHidden, V55TestDirectLock, V55TestHideKeepsParser, V55TestLastChoiceLockStyles, V55TestClickTargetsPreserved, V55TestMenuDataIsolation,
         V551TestHPAloneSilent, V551TestTransitionThenPrep, V551TestOlderFourWaveFirst, V551TestNoInterveningWaveRequired, V551TestMissingHistory, V551TestUnresolvedPriorWave, V551TestStalePreparationHistory, V551TestSourceAndEventFields, V551TestDuplicateAndOldRecords, V551TestMutedOpportunities, V551TestUnmuteBeforeNewPrep, V551TestHealingDoesNotRearm, V551TestNewAddsRetireQueuedAndActive, V551TestOldAddsDoNotCancel, V551TestClockAndLogExpiry, V551TestSupersededAndInterrupted, V551TestResetAndBossDeath, V551TestPlayerDeathAndRageUnaffected, V551TestBoundedIdentityHistory, V551TestPreviewsAndPayloadPreserved, V551TestIndependentDataUntouched, V551TestReferenceLog, V551TestMissedPrepCannotShift, V551TestMidnightSequence, V551TestSameInstanceReset, V56TestExitFreezesHealing, V56TestLateHitRestoresIncludedHealing, V56TestDeathBeforeFinalHit, V56TestLaterMissDoesNotExtend, V56TestImmunePositiveDoesNotExtend, V56TestFixedDeadline, V56TestNewEntryFreshTotals, V56TestNewEnemyIsNotLateHit, V56TestCorpseDamageAfterCloseIgnored, V56TestKnownBossKillsPlayerNotCompletion, V56TestGroupContinuesAfterLocalExitDeath, V56TestDeadThenRevivedEntrySplits, V56TestKnownBossResurrectionKeepsPull, V56TestKnownBossResetSplits, V56TestReentryMissingEvidenceIsPartial, V56TestInCombatGapDoesNotSplit, V56TestPeerExitIgnored, V56TestSistersBothOrders, V56TestOverlayPinsNotCompletionRules, V56TestOverkillIncomingOnly, V56TestNoInferredOverkill, V56TestJournalRowsAndRing, V56TestJournalExistingHealingRow, V56TestJournalThreatRollback, V56TestReorderedPositiveDoesNotCommitFutureHeal, V56TestReorderedIncludedHealingSurvives, V56TestPendingFuturePartition, V56TestSameTimestampResultsPreserved, V56TestNoDamageHealingSegment, V56TestSourceContextReset, V56TestAreaContextReset, V56TestRawEventOverkillPreserved, V56TestPendingBound, V56TestManualEndIsNotClaimedKill, V56TestTrashReadyKeepsHistory, V56TestDelayedBossResetEvidence, V56TestNewIncomingEnemyDoesNotReopenOldPull, V56TestMetadataClockRollsBackAtEnd, V561TestTythCleanup, V561TestSistersEsneFirst, V561TestSistersAivelaFirst, V561TestFirstSisterKeepsFighting, V561TestNewPullAfterCleanup, V561TestFinalAllowanceFixed, V561TestScyvaFinalHeal, V561TestScyvaPostExitExcluded, V561TestScyvaNoExitNoExtraHealing, V561TestScyvaNoDoubleHeal, V561TestScyvaThreatDenominator, V561TestTythNoScyvaHealPolicy, V561TestOverkillAfterDeath, V561TestOverkillAfterRevival, V561TestIncomingLifeRollback, V561TestThreatOnlyExcluded, V561TestEarlierThreatBecomesRelevant, V561TestGeneratedHealingThreatStays, V561TestThreatEvidenceRollback, V561TestIzaxObjectHealingScope, V561TestIzaxFullSequence, V561TestIzaxMissingStage, V561TestIzaxMissingOneHP, V561TestIzaxAreaModeScope, V561TestIzaxDeadRecorderExit, V561TestIzaxRelayWithoutExit, V561TestIzaxMissingRelayFallback, V561TestIzaxHealthResetDisarms, V561TestIzaxSourceClearsScope, V561TestIzaxSameMillisecondTail, V562TestClosedResultRetained, V562TestIdleDoesNotClearOrStretch, V562TestNextEntryReplacesResult, V562TestEntryDuringFinishingReplacesResult, V562TestRetainedDisplayAcceptsFinalHit, V562TestHeldSnapshotAcrossViews, V562TestSourceAndHistoryStayIndependent, V562TestExplicitClearAndStatusPreserved, V563TestMeterGapDoesNotInventHistory, V563TestDuplicateEntryDoesNotInventHistory, V563TestPeerExitDoesNotInventHistory, V564TestKnownEntryDuringFinish, V564TestUnknownEntryDuringFinish, V564TestKnownDelayedPeer, V564TestUnknownDelayedPeer, V564TestUnknownDeadQuietGap, V564TestExitDeathOrders, V564TestPendingHealingRecovered, V564TestRepeatedResurrections, V564TestUnknownResetEvidence, V564TestKnownNewInstance, V564TestDifferentPhaseGroup, V564TestUnclassifiedPhaseIsPartial, V564TestConfirmedKillStaysClosed, V564TestResetBeforeVitalsOverwrite, V564TestSourceClearsContinuation, V564TestUnresolvedSnapshotIsPartial, V564TestDeadPendingBound, V564TestMidnightContinuation, V564TestResetRetainsActiveDeathAndHealing, V564TestUnclassifiedActiveTransitionIsPartial, V565TestLivingRecorder, V565TestDeadRecorderLivingPeer, V565TestExactlyOneSurvivor, V565TestAllObservedDead, V565TestNoSurvivalEvidence, V565TestOutsidePlayerIsNotWitness, V565TestCompanionIsNotWitness, V565TestReviveAfterResolution, V565TestReviveMarkerWithoutDeath, V565TestReorderedResolutionDeath, V565TestDeathAtWitnessTimestamp, V565TestOtherPlayerDeathDoesNotWipe, V565TestDuplicateCastDoesNotRearm, V565TestDuplicateResolution, V565TestReversedSameMillisecondPair, V565TestMissingCast, V565TestMissingFlame, V565TestMissingTargetClear, V565TestMissingRemoval, V565TestMissingFailure, V565TestUnrelatedFailedEffect, V565TestOtherBossInstanceFailure, V565TestInterruptedDyingLight, V565TestFullHealthResetInvalidates, V565TestCastStartNotCompletion, V565TestLivingExitDuringCast, V565TestReentryDuringCast, V565TestEOFAtResolutionIsUnconfirmed, V565TestNextEnemyDoesNotMerge, V565TestHealingDoesNotExtend, V565TestLateOldBossHitDoesNotExtend, V565TestDelayedFreshSurvivor, V565TestStaleSurvivorIsUnconfirmed, V565TestAreaBoundaryClosesPending, V565TestReorderedFutureHealExcluded, V565TestCommittedFutureDamageDisclosed, V565TestRevivedBeforeResolutionCanSurvive, V565TestAcrossMidnight, V565TestWrongDifficulty, V565TestWrongArea, V565TestLocalizedLabels, V57TestProfileScope, V57TestMalformedBracketStillRejected, V57TestProfile_ECZT, V57TestProfile_ECZTReverse, V57TestProfile_ECTK, V57TestProfile_ECTKReverse, V57TestProfile_ECVO, V57TestProfile_ECKE, V57TestProfile_DFNE, V57TestProfile_DFDR, V57TestProfile_DFGR, V57TestProfile_DFCZ, V57TestProfile_DFBR, V57TestProfile_TFBWH, V57TestProfile_TFBDG, V57TestProfile_TFBDGReverse, V57TestProfile_TFBOP, V57TestProfile_TFBKE, V57TestProfile_DXRE, V57TestProfile_DXHV, V57TestProfile_DXAP, V57TestProfile_XR53, V57TestProfile_SNVDA, V57TestProfile_SNVTI, V57TestProfile_SNVTH, V57TestProfile_SNVOC, V57TestProfile_SNVOL, V57TestProfile_SNVCW, V57TestProfile_SNVCWReverse, V57TestProfile_SNVST, V57TestProfile_KPBO, V57TestProfile_KPFC, V57TestProfile_KPFA, V57TestProfile_KPKA, V57TestProfile_EVXR, V57TestProfile_EVGH, V57TestProfile_EVSO, V57TestProfile_RAVSP, V57TestProfile_KPJS, V57TestProfile_KPJSReverse, V57TestProfile_RAVTO, V57TestProfile_RAVMB, V57TestProfile_TOSMA, V57TestProfile_TOSUL, V57TestProfile_MONO, V57TestProfile_XENO, V57TestProfile_TOSSS, V57TestProfile_TOSSSReverse, V57TestProfile_TOSRE, V57TestProfile_QUEEN, V57TestProfile_GTY, V57TestProfile_GAE, V57TestProfile_GAEReverse, V57TestProfile_GNA, V57TestProfile_R4IP, V57TestProfile_R4WD, V57TestProfile_R4KN, V57TestProfile_R4LD, V57TestProfile_RAVBU, V57TestBrontesNewSphereBeforeFinalHit, V57TestPhaseCoreCannotExtendOperator, V57TestNextCombatAndRetiredBoss, V57TestInternalTransition_ECZT, V57TestInternalTransition_SNVOL, V57TestReportingMarker_DXE1, V57TestReportingMarker_DXE2, V57TestReportingMarker_DPBE, V57TestReportingMarker_DPTY, V57TestReportingMarker_DPCA, V57TestReportingMarker_DPRA, V57TestReportingMarker_DPCO, V57TestReportingMarker_TOSCO, V57TestTerrorScriptedEnd, V57TestWrongTerrorAbility, V57TestWrongTerrorHealth, V57TestQueenImmuneFinalResult, V57TestXRDamageThreatIncomingSeparate, V57TestHazardEvidenceNotIncomingSummary, V57TestRaptusChallengeHealingSeparate, V57TestLethalZeroHP, V57TestLethalStalePositiveHP, V57TestLethalOneMillisecond, V57TestLethalTwoMilliseconds, V57TestLethalMultiResultBurst, V57TestNonlethalAbsorptionPreserved, V57TestNoDeath, V57TestUnrelatedKiller, V57TestDistantDeath, V57TestPostDeathZeroResultNotClipped, V57TestActualRevivalRearmsLethalSequence, V57TestSpeculativeLethalCorrectionRollsBack, V57TestIdenticalLookingDamageNotDeduplicated, V57TestNestedBracketLabels, V57TestLocalizedNPCLabels, V57TestAcrossMidnightProfile, V57TestRuugarArmExitReward, V57TestRuugarInternalRewardEntry, V57TestRuugarWrongArm, V57TestRuugarNoArm, V57TestRuugarWrongChest, V57TestRuugarStaleLoot, V57TestRuugarCastAloneNotCompletion, V57TestHuntmasterZeroHPWithoutPriorAlive, V57TestHuntmasterPositiveHPNotEnding, V57TestHuntmasterNoPriorEncounterEvidence, V57TestHuntmasterOtherModeNotPromoted, V57TestCouncilRequiresAllFinalActors, V57TestObjectiveRequiresExitSequence, V57TestCompletionBatchBoundary_DPBE, V57TestRejectDelayedManualLoot_DPBE, V57TestCompletionBatchBoundary_DXE1, V57TestRejectDelayedManualLoot_DXE1, V57TestRewardLaterExitBatch, V57TestRewardLateMarkerNeedsExitBatch, V57TestChunkedLethalMultiResultBurst, V57TestChunkedAcrossMidnightProfile, V57TestChunkedNestedBracketLabels, V571TestDefaults, V571TestStartStopPlan, V571TestBusyPlan, V571TestImportAndDrainPlan, V571TestLockedPolicy, V571TestClickGuards, V571TestRapidClickAndStaleLabel, V571TestSurfaceVisibilityMatrix, V571TestHeaderGeometry, V571TestOwnership, V571TestPreferenceRoundtrip, V571TestHeaderToggleDoesNotStart, V571TestActualStartAndStop, V571TestDispatchRefusesInvalidOrStale, V571TestDispatchImportAndBusyGuards, V571TestHiddenSurfacesAllPanels, V571TestHiddenSurfaceGeometry, V571TestHeaderStateUpdatesWithoutData, V571TestNonActivationAndDoubleClick, V571TestHideAndDestroyLifecycle, V571TestEditAndDisabledStyles, V571TestNoUiActionInHarness, V571TestTargetSelection, V571TestNativeMenuCheckbox, V572TestDefaults, V572TestWarningRequirement, V572TestWarningRoundtrip, V572TestWarningToggleIsolation, V572TestWarningToggleCancelsPending, V572TestWarningMenuChecks, V572TestFirstStartStillDirect, V572TestRestartArmsOnly, V572TestConfirmedRestart, V572TestInvalidConfirmationTokens, V572TestCancelPreservesResults, V572TestExpiredConsent, V572TestForegroundScope, V572TestDataMutationInvalidatesConsent, V572TestDifferentSessionInvalidatesConsent, V572TestPendingAndImportInvalidate, V572TestWarningOffOneClickRestart, V572TestDesktopHonorsWarningOff, V572TestWarningOffStillHonorsBusyGuards, V572TestConfirmationBusyDoesNotErase, V572TestCommitProtectsExpectedData, V572TestConfirmClickDebounce, V572TestHiddenHeaderAndCancel, V572TestRightClickCancellation, V572TestHideCancelsConsentNotCapture, V572TestContextAndPreferenceCancellation, V572TestAllPanelTitlesAndWarningOff, V572TestWarningOffPlanIgnoresStalePending, V573TestDefaults, V573TestWidthLeft, V573TestWidthRight, V573TestCornerHorizontalOnly, V573TestTopHeight, V573TestBottomHeight, V573TestCornerBothAxes, V573TestFixedWidthPreserved, V573TestResizeDpi, V573TestEightRowGrowth, V573TestSixteenRowGrowth, V573TestFixedHeightHonored, V573TestAllSizeChoices, V573TestThreatSettings, V573TestBossSettings, V573TestHeightControlStates, V573TestEightPreview, V573TestSixteenPreview, V573TestInvalidPreviewCount, V573TestSampleObjectsIndependent, V573TestPreviewGuardMatrix, V573TestStoredDataAllowsPreview, V573TestPreviewSetIsolation, V573TestActiveParserRejectsPreview, V573TestDisabledDisplaysRejectPreview, V573TestPreviewEndRestoresData, V573TestHideCancelsPreview, V573TestPreviewNotPersisted, V573TestRealWorkEndsPreview, V573TestPreviewParserActionsBlocked, V573TestWarningConsentCleared, V573TestHiddenRaidRendering, V573TestHiddenThreatBossRendering, V573TestHiddenPersonalRendering, V573TestPreviewRespectsRowCap, V58TestInertState, V58TestTabCatalogue, V58TestMetricRouting, V58TestLayoutBounds, V58TestActorIdentity, V58TestMissingActor, V58TestSummaryArithmetic, V58TestEffectiveSummary, V58TestUnknownSummary, V58TestThreatClock, V58TestTargetTotals, V58TestSameNameTargets, V58TestTopAbilityLimit, V58TestEventCopies, V58TestEventRingOrder, V58TestEventFilters, V58TestHiddenBuild, V58TestHiddenTabs, V58TestHiddenEffectiveTab, V58TestHiddenRaid, V58TestEventSnapshotFreeze, V58TestTabDataIsolation, V58TestSavedLiveIndependence, V58TestWindowHideKeepsData, V58TestWorkspacePreferences, V58TestNoPrefsWriteInDiagnostics, V58TestResizeKeepsSelections, V58TestMinimizeKeepsGeometry, V58TestDropGuard, V58TestPinnedFight, V58TestSortPersists, V58TestNoPhantomParse, V58TestClearStaleView, V58TestFilteredTargetRetention, V58TestMainWarningPreserved, V59TestInertState, V59TestEmptySourceKey, V59TestSourceMetadata, V59TestNoObserverOnNormalSession, V59TestPrivateJournal, V59TestJournalRollback, V59TestDemoTotals, V59TestDemoHealing, V59TestDemoTanking, V59TestRangePartition, V59TestInvalidRanges, V59TestZeroDuration, V59TestBucketConservation, V59TestUnknownCurve, V59TestBucketLimit, V59TestEventRangeOrder, V59TestFullMetricTail, V59TestUnionOverlap, V59TestEffectRefresh, V59TestEffectRange, V59TestEffectIdentity, V59TestMissingEffectEdges, V59TestSourceCaptureLimit, V59TestPrePullEffect, V59TestAbsorbArithmetic, V59TestTankShieldNotHealing, V59TestAmbiguousAbsorb, V59TestAbsorbSingleCandidate, V59TestAbsorbOverlap, V59TestAbsorbUnknownEffect, V59TestAdjacentRemovalCredit, V59TestConsumedWitnessNotReused, V59TestStaleRemovalRejected, V59TestUnknownClassification, V59TestMetadataInput, V59TestMetadataNoExecution, V59TestRotationCycles, V59TestAbsentAnchor, V59TestTargetScope, V59TestTargetOverrideLocal, V59TestSearchOr, V59TestRawFilter, V59TestCSVProtection, V59TestFileSnapshot, V59TestNoCompleteLine, V59TestMidnight, V59TestChartCoordinates, V59TestLeakyComparisonRejected, V59TestZeroUnknownEffectNotInvented, V59TestHiddenAnalysisWindow, V59TestHiddenDemoRendering, V59TestHiddenNativeChart, V59TestHiddenGeometry, V59TestHiddenTabs, V59TestSortNumeric, V59TestNoMainMutation, V59TestPrePullRefreshFreshness, V59TestPrePullDeathClearsEffect, V59TestChargePeakClippedToRange, V59TestBackwardCycleRejected, V59TestAuxiliaryExportSelection, V591TestCatalogue, V591TestSavedAnalysisTab, V591TestHostRectangle, V591TestLayoutBounds, V591TestChartLayout, V591TestSummaryLayout, V591TestLazyConstruction, V591TestChildHost, V591TestHiddenConstruction, V591TestSingleInstance, V591TestMainSelectionPreserved, V591TestReviewRangeRetained, V591TestEmbeddedPages, V591TestSummaryValues, V591TestNativeGeometry, V591TestOpenDoesNotLoad, V591TestActiveHostSelection, V591TestHideReleasesBrush, V591TestContextLabels, V591TestCloseReturnsRaid, V591TestHideMainPreservesReview, V591TestMenuRoutesToTab, V591TestLiveGuardRetained, V591TestSummaryExportSelection, V592TestInitialStacking, V592TestObscuringSibling, V592TestFirstShowSize, V592TestEmptyToolbar, V592TestShowHideReuse, V592TestReturnToAnalysis, V592TestResizeStacking, V592TestNoActivation, V592TestReviewPreserved, V592TestManualSuiteStaysHidden, V592TestReportPrivacy, V592TestNoImplicitAnalysis, V593TestEmptyHandles, V593TestThrowingHandle, V593TestNativeHandleLifetime, V593TestDeadButtonLookup, V593TestDeadTabLookup, V593TestDeadParserSurfaceLookup, V593TestDeadTabSurfaceLookup, V593TestDeadPositionPreserved, V593TestPositionDisappearsDuringRead, V593TestLiveErrorsRemainVisible, V593TestMixedPositionSaving, V593TestDetachPreservesPreferences, V593TestDetachBeforeDestroy, V593TestRepeatedTeardown, V593TestBodyRecreation, V593TestHeaderSurfaceRecreation, V593TestTabSurfaceRecreation, V593TestOwnerDestroyedFirst, V593TestUpdatingCallbackGuards, V593TestBusyCallbackGuards, V593TestDeadCallbackLookup, V593TestStaleControlObject, V593TestFirstHeaderKeepsAction, V593TestRepeatedRaidPreviews, V593TestApplyWhilePreviewing, V593TestHideAndLockDeadPanels, V595TestGroupedNumbers, V595TestSignedRoundedNumbers, V595TestExactIntegerNumbers, V595TestUnknownNumbers, V595TestBitmapHandleContract, V595TestChartResizeHandle, V595TestEmbeddedLiteralSummary, V595TestEmbeddedChartHandle, V595TestStandaloneVisibilityOracle, V595TestEmbeddedVisibilityOracle, V596TestDefaults, V596TestPeriodIdle, V596TestPeriodVisible, V596TestPeriodLive, V596TestPeriodQueued, V596TestPeriodImport, V596TestPeriodFinish, V596TestPolicyDesktop, V596TestPolicyGame, V596TestClock, V596TestTimingCounts, V596TestTimingFrozen, V596TestTimingZero, V596TestReportPrivacy, V596TestBatchEquivalence, V596TestUTF8ChunkBoundary, V596TestTrailingFragment, V596TestAppendExcluded, V596TestDeferredCancel, V596TestImmediateCancel, V596TestCancelPreservesPrefix, V596TestLimitPreservesLive, V596TestErrorPreservesLive, V596TestHiddenImport, V596TestNoAutomaticTimers, V596TestEmptyFile, V596TestByteIdenticalSource, V596TestActualPumpImport, V597TestDefaults, V597TestRunningTimerOff, V597TestTimerRestoration, V597TestUncappedSinglePass, V597TestUTF8ReadBoundary, V597TestOldBatchEquivalence, V597TestCancelBeforeFirst, V597TestCancelAtCheckpoint, V597TestFinalRecordCancel, V597TestReentryAndReplacementGuards, V597TestRetiredRunCannotFinalizeReplacement, V597TestCapacityLimit, V597TestReadError, V597TestCheckpointError, V597TestEmptyFile, V597TestIncompleteTail, V597TestOverlongRecord, V597TestAppendedDataExcluded, V597TestReadOnlyFile, V597TestHideKeepsImport, V597TestLiveStatisticsPreserved, V597TestReportNoFakeBudget, V597TestTimingFrozen, V597TestCheckpointNotTimedSleep, V597TestSmallFileNeedsNoCheckpoint, V597TestCallerBusyRestored, V597TestActualPumpUsesContinuousPath, V597TestMidnightOrder, V597TestMissingGuiPaintSafe, V597TestHiddenViewFrozenAndRestored, V597TestHiddenCancelRestoresControls, V597TestHiddenPainterDoesNotTouchData, V598TestTimingDefault, V598TestTimingPhases, V598TestTimingPrivacy, V598TestOwnerAndGeneration, V598TestLoadOneInvocation, V598TestLoadCancel, V598TestLoadMismatchRejected, V598TestLoadReaderFailure, V598TestLoadGuard, V598TestQueryOneInvocation, V598TestQueryCancel, V598TestQuerySuperseded, V598TestQueryFailure, V598TestDeferredLog, V598TestRangeSearchEquivalence, V598TestRawSearchOneInvocation, V598TestRawCancel, V598TestRawFiltersAndPage, V598TestCancelBeforePump, V598TestNoDiagnosticTimers, V598TestSignedWheel, V598TestPartialWheel, V598TestWheelReset, V598TestAnalysisLogScroll, V598TestAnalysisDamageScroll, V598TestAnalysisTargetsScroll, V598TestAnalysisRotationScroll, V598TestAnalysisCyclesScroll, V598TestMainLogScroll, V598TestScrollSettings, V598TestHiddenWheelIgnored, V598TestDestroyedScrollControl, V598TestRenderVisibility, V598TestBackgroundLogStaysHidden, V598TestMainSnapshotScrollStable, V598TestSmallLogViewport, V598TestScrollReportPrivacy, V599TestPositiveWheelRemainder, V599TestNegativeWheelRemainder, V599TestWheelBoundaries, V599TestWheelDirectionChanges, V599TestWheelPacketSplitting, V599TestWheelIntegerTypes, V5910TestLogPickerMasks, V5910TestLogPickerNames, V5910TestUploadFilterPreserved, V60TestInertState, V60TestPageCatalogue, V60TestLegacyRouting, V60TestStartupGuard, V60TestF10Policy, V60TestHiddenSettingsBuild, V60TestGeneralControls, V60TestVoiceControls, V60TestYourControls, V60TestCotankControls, V60TestTythControls, V60TestManualControls, V60TestReliabilityControls, V60TestBossControls, V60TestAEControls, V60TestSettingsBounds, V60TestOpenDoesNotParse, V60TestHideRetainsControls, V60TestDraftRetention, V60TestMenusRetained, V60TestVoiceMenuSynchronization, V60TestRemoteRoute, V60TestLegacyPageEntry, V60TestNoTrayOrF10InTests, V601TestDefaults, V601TestThemeKeys, V601TestPaletteValues, V601TestColorConversion, V601TestChartPalette, V601TestIconPathPolicy, V601TestMissingIcon, V601TestIcoLoading, V601TestPngLoading, V601TestMalformedIcon, V601TestSaveGuard, V601TestStartupGuard, V601TestTrayGuard, V601TestHiddenTheme, V601TestTableColors, V601TestControlStatePreserved, V601TestVisibilityPreserved, V601TestClassicRoundTrip, V601TestMainWorkspace, V601TestEmbeddedAnalysis, V601TestDeadWindowPruning, V601TestNativeIconAttachment, V61TestRaidFirst, V61TestTabRoundtrip, V61TestInertState, V61TestBobbyBaseline, V61TestDeltaSigns, V61TestNoDeathReached, V61TestFirstDeathReached, V61TestEqualPullWeight, V61TestObservedAttendance, V61TestAllDeathsAfterThird, V61TestDuplicateDeath, V61TestRepeatedLife, V61TestSameTimestampTie, V61TestOutOfOrderDeaths, V61TestNPCAndCompanionExcluded, V61TestTailRollback, V61TestRingIndependent, V61TestMissingTiming, V61TestPartialKeepsDeaths, V61TestZeroDuration, V61TestEndpointRange, V61TestUnknownDefault, V61TestEncounterScope, V61TestManualExclusion, V61TestNoOpenPulls, V61TestIdentityNotName, V61TestCopiedSummary, V61TestTimeFormat, V61TestRollingRetention, V61TestRollingCurrentKept, V61TestRollingLimit, V61TestRosterFreeze, V61TestMigration, V61TestHiddenDefault, V61TestHiddenSwitch, V61TestHiddenDemo, V61TestHiddenSelection, V61TestHiddenScrollRouting, V61TestHiddenLayout, V61TestHiddenNoRefreshReset, V61TestHiddenExclusions, V61TestScanBusyGuards, V61TestStableDemoObjects, V61TestLifetimeSortIsolation, V61TestEmptySummary, V61TestFullSourceScan, V61TestScanCancelRetainsReport, V61TestModeLabels, V61TestCanceledLoadedSubset, V61TestCompactStorageBound, V61TestDeathHistoryBound, V611TestVisibilityPolicy, V611TestNoEmptyMainContainer, V611TestNoEmptyAnalysisContainer, V611TestParentClipping, V611TestSiblingClipping, V611TestBackgroundOrderRepair, V611TestInactiveBulkRedraw, V611TestHiddenRootNotShown, V611TestNoFocusChange, V611TestRepeatedRepairKeepsData, V611TestResizeRepairsOrder, V611TestPlayerSelectionDraw, V611TestRaidModeSwitch, V611TestThemeRoundtrip, V611TestNoWorkspaceCreated, V611TestDeadHandles, V611TestReportPrivacy, V611TestScanStateUnchanged, V611TestExclusionsAndSortPreserved, V611TestAnalysisStateIndependent, V611TestAnalysisAllPageLayers, V611TestAnalysisBackgroundRepair, V611TestAnalysisBulkRefreshPages, V611TestAnalysisStaleInactiveTable, V611TestAnalysisResizeLayers, V611TestAnalysisPaletteLayers, V611TestAnalysisPaintKeepsBitmap, V611TestAnalysisPaintDoesNotShow, V611TestAnalysisDiagnosticPrivacy, V611TestStandaloneAnalysisLayers, V612TestLedgerInert, V612TestRegistry, V612TestOneGCD, V612TestFullGCDCoverage, V612TestIdleNotCredited, V612TestOverlapUnion, V612TestBoundaryClipping, V612TestOffGCDZero, V612TestOffGCDWeave, V612TestDeathClipAndRez, V612TestDeathSameTime, V612TestDeadHP, V612TestChannelSpan, V612TestChannelWeave, V612TestChannelInterruptedGCD, V612TestDeathAfterChannelStop, V612TestMissingChannelEnd, V612TestResultWithoutActivation, V612TestWrongActorAndAbility, V612TestCastFirstResultOnly, V612TestInstantProcCast, V612TestStaleEndpoint, V612TestOrderingAndDuplicates, V612TestConfigChoices, V612TestSessionWeighted, V612TestMissingExcluded, V612TestAcceptedCapture, V612TestLifecycleCapture, V612TestDeathCountsPreserved, V612TestJournalRollback, V612TestLimitDisclosed, V612TestCacheInvalidation, V612TestPartialAndZero, V612TestPerPlayerGCD, V612TestDemoAndReport, V612TestHiddenColumns, V612TestHiddenPullActivity, V612TestHiddenPaintPreserved, V612TestHiddenLayout, V612TestNoSettingsInHarness, V612TestFullSourceActivity, V613TestRaidHeaders, V613TestPlayerHeaders, V613TestFirstAndLater, V613TestTies, V613TestNoRecordedDeath, V613TestIncompleteTiming, V613TestContext, V613TestCopiedLabels, V613TestLabelPurity, V613TestHiddenInitialHeaders, V613TestHiddenPlayerSwitch, V613TestHiddenColumnWidths, V613TestHiddenContextLayout, V613TestHiddenExclusionScope, V614TestDefault, V614TestChoices, V614TestValidation, V614TestSavedSelection, V614TestSavedFollow, V614TestLiveWins, V614TestDraining, V614TestStoppedHistory, V614TestManualModes, V614TestMissingData, V614TestPartialLabels, V614TestDemoLabels, V614TestPersonalIdentity, V614TestResolverPurity, V614TestPersistence, V614TestLegacyMigration, V614TestSettingsApply, V614TestSettingsRoster, V614TestRaidToolSync, V614TestRealStartStop, V614TestBlockedStart, V614TestBlockedImport, V614TestPreviewIsolation, V614TestPersonalNativeRender, V614TestManualPreferenceStable, V614TestAutoMatrix, V615TestPhaseScope, V615TestPhaseDeathNotVictory, V615TestEightDeathsReset, V615TestStalePositiveHP, V615TestFinalTickRetained, V615TestDeathsAndActivityRetained, V615TestRunbackExcluded, V615TestNextPullSeparate, V615TestSevenDeathsContinue, V615TestLocalDeathAloneContinues, V615TestMissingRoster, V615TestExtraParticipant, V615TestRevivalPreventsClose, V615TestNoResetNoClose, V615TestUnengagedResetIgnored, V615TestUninjuredResetIgnored, V615TestChangedMaxIgnored, V615TestWrongAreaWipeIgnored, V615TestWrongModeWipeIgnored, V615TestResetBeforeDeathsIgnored, V615TestClosedLabel, V615TestNoAreaEntryPersonalRecovery, V615TestLateOwnerLearning, V615TestPersonalMissingCalloutToken, V615TestPersonalStaleCalloutToken, V615TestExplicitPinPreserved, V615TestSavedSelectionPreserved, V615TestHistoricalIdentityPreserved, V615TestPersonalUnknownStillUnknown, V615TestSnapshotIsReadOnly, V615TestReaderInert, V615TestReaderAreaCapture, V615TestReaderEntryWithoutArea, V615TestReaderNoPeerGuess, V615TestReaderCopyOnChange, V615TestReaderSourceChange, V615TestReaderSeedGuards, V615TestQueuedSourceSeed, V615TestSeededLiveWipe, V615TestInactiveMetadataCapture, V615TestStartUsesReaderContext, V621TestDefaults, V621TestButtonsOnly, V621TestNativePalette, V621TestNativeStructureOffsets, V621TestPaintStagePolicy, V621TestFaceStates, V621TestRadiusBounds, V621TestHiddenSetup, V621TestRepeatedAttachment, V621TestDetachReapply, V621TestDestroyCleanup, V621TestNativeTabStyles, V621TestIgnoredNotifications, V621TestButtonPixels, V621TestDisabledButtonPixels, V621TestHiddenTables, V621TestThemeRoundtrip, V621TestPaintResourceCleanup, V621TestScopedShutdown, V621TestPaintDoesNotTouchTabs, V621TestWorkspaceTabMatrix, V621TestAnalysisTabMatrix, V621TestDiagnosticPrivacy, V621TestPreferenceGuard, V621TestCustomDrawNotification, V621TestDrawFailureFallsBack, V622TestRoleDefaults, V622TestRoleCatalogue, V622TestRoleIdPriority, V622TestRoleAnnotation, V622TestRoleRejectsNpc, V622TestRoleWrongRecord, V622TestRoleRecordedWithoutActor, V622TestRoleDuplicates, V622TestRoleRollback, V622TestRoleCapacity, V622TestRoleBeforePull, V622TestRolePullIsolation, V622TestRoleDatasetIsolation, V622TestRoleTotalsUnchanged, V622TestRoleCompaction, V622TestRoleSessionMixture, V622TestRolePartialCoverage, V622TestRoleDemo, V622TestRoleContrast, V622TestRoleOffsets, V622TestRoleNativeRegistration, V622TestRoleNativeColors, V622TestRoleNativeSelection, V622TestRoleDestroyedControls, V622TestDropdownPolicy, V622TestDropdownSelectionPreserved, V622TestRoleColumns, V622TestRoleSorting, V623TestDropdownType, V623TestTypeExclusions, V623TestTintReachesControl, V623TestNativeColorResponse, V623TestTintOffRestores, V623TestPaletteOrder, V623TestDropdownScope, V623TestDestroyedDropdown, V623TestRoleDispatch, V623TestSelectionStillNative, V623TestAppearanceReport, V623TestRoleCounterReset, V624TestAlwaysRequestCells, V624TestFalseSelectedFlag, V624TestSelectionMissingFlag, V624TestTrueSelectionFlag, V624TestFocusWithoutSelection, V624TestFalseDisabledFlag, V624TestDisabledTableNative, V624TestRoleColorsOff, V624TestSessionColumnReorder, V624TestRaidColumnReorder, V624TestAllRoleColors, V624TestCountersExplainSkips, V624TestCriticalRestored, V624TestNativeRoleBitmap, V624TestNativeSelectionBitmap, V624TestReportPrivacyAndOrder, V625TestInertDefaults, V625TestFilterOff, V625TestRecognizedOnly, V625TestEmptySources, V625TestPinnedSelection, V625TestFollowSelection, V625TestHiddenSelection, V625TestLateRecognition, V625TestFilterNoMutation, V625TestSavedOverlayRouting, V625TestLiveOverlayUnchanged, V625TestEmptyOverlayFilter, V625TestManualSourcePreserved, V625TestPlayerSchema, V625TestPlayerValues, V625TestCopiedSummary, V625TestHiddenFightFilter, V625TestHiddenRowSelection, V625TestHiddenEmptyRestore, V625TestHiddenPinPreserved, V625TestHiddenLiveRecognition, V625TestIndependentSession, V625TestHiddenPlayerSorting, V625TestHiddenRoleRegistration, V625TestHiddenLayout, V625TestImportFilterGuard, V625TestPreferenceLoad, V625TestNoWritesInDiagnostics, V625TestRetiredSourceSelection, V625TestAnalysisReviewRetained, V63TestScopeProfiles, V63TestCouncilOpening, V63TestCouncilApparitions, V63TestCouncilReturn, V63TestCouncilBurn, V63TestCouncilLowest, V63TestDefeatedSeparate, V63TestUnknownRemainder, V63TestNoPhaseRewind, V63TestHealthReset, V63TestHealthScaleChange, V63TestNoMadeUpHealth, V63TestSameNameNotBoss, V63TestKillNotZero, V63TestNahutPhaseTwo, V63TestNahutPhaseThree, V63TestNahutSliceNotPhaseAlone, V63TestNahutBurn, V63TestScyvaBackground, V63TestScyvaEngagement, V63TestSnapshotCopies, V63TestStageRanking, V63TestSpecificPullTotals, V63TestDemoFinalLabel, V63TestHistoryRoundTrip, V63TestUnicodeJSON, V63TestHistoryBadShape, V63TestHistoryBadBounds, V63TestHistoryIdentity, V63TestHistoryResave, V63TestCharacterTeamFilter, V63TestHistoryStableOrder, V63TestHistoryFileRoundTrip, V63TestFightCard, V63TestHiddenPullWindow, V63TestHiddenGraphWindow, V63TestNativeFightListBackings, V631TestEmptyPlot, V631TestSinglePlot, V631TestLowerFurther, V631TestBestPlateau, V631TestPhaseMilestones, V631TestUnknownGap, V631TestMappingNotMixed, V631TestKillBottom, V631TestClickBounds, V631TestScaledPlot, V631TestCompactLayout, V631TestExpandedLayout, V631TestTeamAndCharacter, V631TestExclusions, V631TestExactPointLabel, V631TestRepeatedNamesSeparate, V631TestGraphNativeBitmap, V631TestSelectDoesNotFilterSession, V631TestCurrentSourceFreshness, V631TestGraphCloseReleasesHook, V631TestCharacterOpensSpecificDeaths, V632TestShutdownWithoutWindows, V632TestShutdownReachesGraphAndFightList, V632TestShutdownAfterFightWindowDestroyed, V633TestUnlimitedDefaults, V633TestMoreThanSixtyPulls, V633TestOrdinaryImporterPastSixty, V633TestCumulativeRowsDisabled, V633TestExplicitSegmentBudget, V633TestExplicitRowBudget, V633TestScanBeyond4096, V633TestScanCumulativeCounters, V633TestExplicitScanBudgets, V633TestCurrentPullNotEvicted, V633TestFilterKeepsAllStoredFights, V633TestPartialStillDisclosed, V633TestHistoryOver12000, V633TestModeLabelsAgree, V633TestModeUnknownNotGuessed, V633TestModeCardLabels, V633TestAgeDoesNotRejectImport, V633TestSixteenModeScopePreserved, V634TestSistersScoped, V634TestUserComparison, V634TestWeightedMaxima, V634TestNoForcedPushThreshold, V634TestOrderIndependent, V634TestMissingSister, V634TestMissingMaximum, V634TestUnengagedSnapshots, V634TestOtherNPCExcluded, V634TestSameScaleReset, V634TestNotIndependentMinima, V634TestStaleSnapshot, V634TestScaleChangeUnknown, V634TestDuplicateInstanceUnknown, V634TestOneSisterDeath, V634TestDeathWithoutHP, V634TestDeadStalePositiveHP, V634TestZeroNotKill, V634TestNoDefeatedPriority, V634TestCompactIsolation, V634TestRollback, V634TestLabelBothSisters, V634TestHistoryRoundTrip, V634TestLegacyHistoryGap, V634TestLegacyKillPreserved, V634TestCouncilHistoryUnchanged, V634TestCombinedAxis, V634TestSingleBossAxis, V634TestMultiTargetNotPercent, V634TestPhaseAxis, V634TestAxisDPIAndSizes, V634TestCombinedBestCurve, V634TestAxisEmptyAndUnknown, V634TestParserIntegration, V634TestNativeAxisPixels, V634TestDemoComparison, V634TestDemoNotSavedAsReal, V635TestInertState, V635TestCalendarDate, V635TestDateQualifiedIdentity, V635TestChronologicalMidnight, V635TestOverlapMidnight, V635TestNoOverlapAdjacent, V635TestCombineNights, V635TestRepeatedLogNoDoubleCount, V635TestExistingPullUpdate, V635TestCompleteNotDowngraded, V635TestAlternateRecorderSkipped, V635TestModeAndTeamStaySeparate, V635TestNoUnknownTrashSaved, V635TestExactPullDetailsRetained, V635TestSistersHistoryRetained, V635TestHistoryTokenDetectsEdits, V635TestViewRoundTrip, V635TestViewDefaults, V635TestDemoViewDistinction, V635TestBatchReadsAndSaves, V635TestBatchRerun, V635TestBatchPastOldFightLimit, V635TestBatchCancelIsAtomic, V635TestBatchReadFailureAtomic, V635TestQueuedCancel, V635TestConcurrentHistoryEdit, V635TestCorruptHistoryNotOverwritten, V635TestReopenWithoutRawLogs, V635TestBusyGuards, V635TestShutdownDoesNotSave, V635TestGraphButtonsAndNativeTabs, V635TestUnknownFileDate, V635TestInvalidFileType, V635TestDuplicateSelectedPaths, V635TestSavedSelectionTeam, V635TestEmptyBatchRefused, V635TestLegacyCustomSessionUpgrade, V636TestDateLabels, V636TestMidnightLabels, V636TestUnknownDate, V636TestInvalidDateOrTime, V636TestDateSpan, V636TestGraphTickDates, V636TestDateTickLayout, V636TestEmptyAndSingleDates, V636TestDateDoesNotChangeProgress, V636TestChronologicalDates, V636TestPointDateAndCharacter, V636TestNoSourceMutation, V636TestHiddenGraphDates, V636TestNativeDatePixels, V636TestFirstKillWindow, V636TestAllPullsRestored, V636TestNoKillYet, V636TestEmptyKillHistory, V636TestReclearCycles, V636TestConsecutiveKills, V636TestZeroHPIsNotKill, V636TestExcludedKillAndTrash, V636TestChronologicalKillCutoff, V636TestNoNightlyReset, V636TestCycleIdentityStable, V636TestTeamsDoNotMixKillBoundaries, V636TestCharacterAttendanceKeepsTeamBoundary, V636TestCharacterAbsentWholeCycle, V636TestKillFilterDoesNotMutateHistory, V636TestTythAxisExplicit, V636TestTythNoDataAxis, V636TestTythScoreMatchesAxis, V636TestOtherAxesPreserved, V636TestViewAndCycleSettings, V636TestNewViewDefault, V636TestGraphFilterLayout, V636TestHiddenKillWorkflow, V636TestNativeTythAxisPixels, V636TestGraphReportPrivacy, V636TestClearEndDateAcrossMidnight, V637TestNumericTicksWithoutCalendar, V637TestRepeatedDatesInHover, V637TestNumericAxisInKillViews, V638TestLoadDeadline, V638TestLogicStartupDeadline, V638TestHealthyLongSuite, V638TestStalledGroup, V638TestProgressResetsDeadline, V638TestRepeatedReadNotHeartbeat, V638TestNoiseNotHeartbeat, V638TestOverallSafetyLimit, V638TestWideMonotonicClock, V638TestFinishedAndCurrentCounts, V638TestFailureRetained, V638TestPrematureCompletionRejected, V638TestMissingCompletionRejected, V638TestInvalidOrderingRejected, V638TestPartialLineIgnored, V638TestIncrementalJournalFile, V638TestCaptureAfterCancellation, V638TestLiveReportComposition, V638TestEmptyReportNeverPasses, V638TestCompleteReport, V638TestDuplicateCompletionRejected, V638TestNewRunIsClean, V639TestScalars, V639TestContainers, V639TestWhitespace, V639TestNumberForms, V639TestNumberCursor, V639TestNumberNoSkip, V639TestMalformedNumbers, V639TestTrailing, V639TestTruncated, V639TestEscapes, V639TestInvalidEscapes, V639TestControls, V639TestUnicode, V639TestDepth, V639TestInputImmutable, V639TestSerializerEquivalent, V639TestPullRoundTrip, V639TestSistersRoundTrip, V639TestHistoryFileRoundTrip, V639TestHistorySchemaStillChecked, V639TestStageNotesNotProgress, V6310TestBulkFixtureInRange, V6310TestRangeBoundariesStayStrict, V6310TestPartialPositionNotApplied, V6310TestLegacyNoChangeAfterReload, V6310TestRepeatedFightListCleanup, V6310TestFailedCleanupNotReportedSuccessful]
     ; dev.51: restore omitted regression registrations.
     tests.Push(V7424LogoPaint,V7424LogoLifetime,V7424LogoFallback,V7426VoiceFreshInstall,V7426VoiceLegacyMigration,V7426VoiceSavedTTS)
     tests.Push(V7426VoiceUnknownMigration,V7426VoicePages,V7426VoiceUseLocal,V7426VoicePreview,V7426RetiredEditorsOpen,V7426RetiredPreviewSelectors)
     tests.Push(V7426ManualPhrasePersistence,V779PreparationCancel,V779PreparationGuards,V779SourceChoices,V779SourceUndo,V779SourceConflict)
     tests.Push(V779CalloutNavigation,V779ReviewReuse,V779MenuRoutes,V7710PathAliases,V7710StartupFailure,V7710EightLive)
     tests.Push(V7710ReadyProtocol,V7710MessageSharing,V7710LockedControl,V7711Policy,V7711Parity,V7711Burst)
     tests.Push(V7711ProgressionFailure,V7711AckRecovery,V7711MemoryBound,V7711BossDeadline,V7711QueueAliases,V7712ProgressLocks)
     tests.Push(V7712NativeLock,V7712HealthyWorkers,V7712RepeatedFailures,V7712WorkerStatus,V7713CachePreferences,V7713CacheManyEntries)
     tests.Push(V7713CacheRecentUse,V7713CacheLockedEviction,V7713CacheDialog,V7713CacheDisabled,V7714JsonNumbers,V7714LazyPages)
     tests.Push(V7714UnchangedLibrary,V7714CacheCompatibility,V7714HistoryMemo,V7715LibraryView,V7715LibraryViewMismatch,V7715LibraryViewOwnership)
     tests.Push(V7716BrowseParity,V7716BrowseRecaps,V7716BrowseLegacy,V7716BrowseInvalid,V7716BrowseSnapshot,V7716BrowseWindow)
     tests.Push(V7716ArchiveIdentity,V7716ArchiveOpen,V7716ArchiveQueue,V7716ReindexPriority,V7814FreshScreens,V7815LibraryDuplicates)
     tests.Push(V7814ReviewAudioIsolation)
     tests.Push(V7815LibraryBrowseParity,V7850Sisters,V7850Mechanics,V7850Evidence,V7850Isolation,V7852IgniteShortfall)
     tests.Push(V7852IgniteBoundaries,V7852NahutTiming,V7852NahutShieldReset,V7852NahutCouplings,V7860ManualCatalogue,V7860RetiredManualRoutes)
     tests.Push(V7861Storage,V7861Invalid,V7861Nahut,V7861Handoff,V7861Burn,V7861Izax)
     tests.Push(V7861Window,V7868DropdownRetirement,V7868ProgressionOpen,V7868CoratanniScope,V7875TeamPickerSummaries,V7875TeamPickerReadFailure)
     tests.Push(V7875TeamPickerCache,V7875TeamPickerBackground,V7875BetaCompression,V7875BetaVersions,V7878XOSavedSelection,V7878XOReviewParity)
     tests.Push(V7878XOReviewGuards,V7878FHTyth,V7878FHSisters,V7878FHScyva,V7878FHIzax,V7878FHNahut)
     tests.Push(V7878FHSource,V7881CloseInputs,V7881BetaStop,V7881BusyProgressionExit,V7881XRDroidHP,V7881ParselyBossTargets)
     tests.Push(V7881ParselyBossPipeline,V7881RepublicMappings,V7881RepublicDispatch,V7881RepublicGates,V7881RepublicPhrases,V7881RepublicSettings)
     tests.Push(V78124RecklessnessRoles,V78124RecklessnessQueue,V78124AbilityPreferences,V78124AbilityControls)
     tests.Push(V7846PvPEstimate,V7846PvPCapacity,V7846PvPNative,V7846QuietWorker,V7847PvPResume,V7847PvPQueueGuards)
     tests.Push(V7847PvPQueueMerge,V7847PvPQueueLarge,V7850IzaxCompletion,V7850InductionDebuff)
     tests.Push(V7851ImportJournalPrefix,V7851RaidPhaseStatus)
     tests.Push(V7851ImportRetry,V7851ImportCrashWindow,V7851ImportForcePreserved,V7851MergedHealthPreview,V7851ProgressionDemoHealth)
     tests.Push(V7839Displays),tests.Push(V7839Tools),tests.Push(V7839Checks),tests.Push(V7844ToolSelection)
     tests.Push(V7853ChallengeHeader)
     tests.Push(V7878ClosePreferences,V7878CloseHides)
     tests.Push(V7878BRWipe,V7878BRGuards,V7878BRBurn)
     tests.Push(V7880LiveRetry,V7880LiveConcurrent,V7880LiveRecovery,V7880LiveCorruptRecovery,V7880LiveExit,V7880LiveJournalRetry,V7880LiveRecoveryMerge)
     tests.Push(V7880MechanicsOtherBoss,V7880MechanicsLiveSwitch,V7880MechanicsIdlePreview)
     tests.Push(V7880CatalystHP,V7880CatalystMissing,V7880CatalystBoundary)
     tests.Push(V7880BossHPCatalogue,V7880BossHPXR,V7880BossHPHands,V7880BossHPPins,V7880BossHPFallback)
     tests.Push(V7859DeathFeedbackSelection,V7859DeathFilterIdentity)
     tests.Push(V7845NotesAutosave),tests.Push(V7845CompareMarks),tests.Push(V7845LibraryReview),tests.Push(V7845IndexedReview),tests.Push(V7845SourcesPaging),tests.Push(V7845HotsSettings),tests.Push(V7845CleanMenus)
     tests.Push(V7845Catalogue)
     tests.Push(V7864PhaseLoading,V7864PhaseGuards)
     tests.Push(V7866PhaseReader,V7866PhaseIndex,V7866PhaseIntegrity,V7866PhaseCancel,V7866PhaseCache)
     tests.Push(V7867PhaseLoadingBar,V7867PhaseLoadingGuards)
     tests.Push(V7875RaidTargets,V7875RaidTargetPhases,V7875RaidTargetLayout)
     tests.Push(V7875BossOverlayData,V7875BossOverlaySettings,V7875BossOverlayRender)
     tests.Push(V7865ShieldReset,V7865ShieldRecovery,V7865ShieldGuards)
     tests.Push(V7849PreviewFill,V7863UtilityPreview,V7863EffectsPreview,V7863EnemyPreview)
    tests.Push(V7868PvPDuplicateSources,V7868PvPLibraryLocale)
    tests.Push(V7868ArenaUnevenTeams,V7868ArenaResetInference,V7868ArenaReplacement,V7868ArenaPostmatch,V7868ArenaDepartureBoundaries)
    tests.Push(V7869StatsContext,V7869StatsLiveContext,V7869StatsSavedWorker)
    tests.Push(V7869HistoryClockSource,V7869HistoryClockQueue,V7869HistoryClockFileStart)
    tests.Push(V7871DisciplineEvidence,V7871DisciplineGuards,V7871DisciplineUI)
    tests.Push(V7873SessionStreak,V7873SessionSummary,V7873SessionLayout)
    tests.Push(V7875ServerCapture,V7875ServerReader,V7875ServerCache,V7875PvPLibraryRoles,V7875LibraryFields,V7875LibrarySorting,V7875PvPRoleCapture,V7875PvPRoleNative)
    tests.Push(V7872PvPMigration,V7869PvPStatsSelection,V7869PvPStatsSettings,V7869PvPStatsNative,V7870PvPScopeInput)
    tests.Push(V7869CurrentRosterPreparation,V7869CurrentRosterReplacement,V7869CurrentRosterPostmatch,V7869CurrentRosterCopies)
    tests.Push(V7869HistoryIdentityScope,V7869HistoryDedup,V7869HistoryUnknown,V7869HistorySelected,V7869HistoryLive,V7869HistoryCache)
    tests.Push(V7838ArenaSession,V7842PvPStates,V7842PvPNative,V7843PvPSaved,V7843PvPWorker,V7844PvPLibrary,V7844PvPLibraryUI)
    tests.Push(V7848PvPUnknownTime)
    tests.Push(V7849LibraryRestart)
     tests.Push(V7845PreservedEdits)
     tests.Push(V7845SavedPack)
     tests.Push(V7845CustomIssues)
     tests.Push(V7845WardRecords)
     tests.Push(V7845DomRecords)
     tests.Push(V7845ApexRecords)
     tests.Push(V7845Advanced)
    tests.Push(V7832TrandosEnding)
    tests.Push(V7872DropdownLifetime,V7872CompareLifetime,V7872BetaExport,V07872DiagnosticSidecar)
    tests.Push(V7875FullLogOpen,V7875FullLogGuards,V7875FullLogIdentity,V7875FullLogCancel,V7875FullLogSources)
    tests.Push(V7877RecoveryRequests,V7877RecoveryPatches,V7877RecoveryCommit,V7877RecoveryNative)
    tests.Push(V7876XRConflictSuppression,V7876XRConflictPositionGuards,V7876XRConflictTargetGuards,V7876XRConflictLifeGuards,V7876XRConflictSourceOrder,V7876XRConflictParity)
    tests.Push(V7875XRUsefulReport,V7875XRCandidates,V7875XRAimEvidence,V7875XRTargetBaseline,V7875XROpeningTarget)
    tests.Push(V7875XRReviewStop)
    tests.Push(V7875XRThreatHandoff,V7875XRThreatEvidence,V7875XRThreatLife,V7875XRDeathTargets,V7875XRTargetLife,V7875XRTauntRedirect,V7875XRImpactPoseGuards,V7875XRFacingHistory,V7875XRHeadings,V7875XRCollection,V7875XRHitEvidence)
    tests.Push(V7875XRAchievementKillBoundary)
    tests.Push(V7878XFFeedbackParity,V7878XFFeedbackLifecycle,V7878XFFeedbackRollback,V7878XFFeedbackDroids,V7878XFFeedbackUI)
    tests.Push(V7875XRMarinatedLife,V7876XRMarinatedPeaks,V7875XRDroidHits,V7875XRDroidGuards,V7875XRDroidAchievement,V7875XRDroidIntegration)
    tests.Push(V7875XRDroidJumpFilter)
    tests.Push(V7875XRInferredExplosions,V7875XRInferenceRollback)
    tests.Push(V7875XRDroidLateKills,V7875XRDroidDelayedSelfDeath)
    tests.Push(V7875XRJumpPaths,V7875XRJumpPathGuards)
    tests.Push(V7875XRHealthInference,V7875XRHealthPrecedence,V7875XRHealthRollback)
    tests.Push(V7875XRTrackingGap,V7875XRTrackingDisplay)
    tests.Push(V7875XRMarks,V7875XRGeometry,V7875XRTargets,V7875XRIncomplete,V7875XRWindow)
    tests.Push(V7875OpacityPanels,V7875OpacityTimers,V7875OpacitySettings,V7875OpaqueText,V7875TextTimerRecovery)
    tests.Push(V7871ReviewStop,V7871ReviewGuards,V7871ReviewCancel,V7871IntercedeIcon)
    tests.Push(V7870TrandosHealth)
    tests.Push(V7870TrandosEnding)
     tests.Push(V7834PerformanceSelectors)
    tests.Push(V7835WipePerformance)
    tests.Push(V7838LibraryControls,V7838MenuRoutes)
     tests.Push(V7833RaidStatistics)
     tests.Push(V7833TimerWording)
     tests.Push(V7831RunTrace,V7831CallbackReturn,V7831CallbackExceptions)
     tests.Push(V7830LibraryBrowse)
     tests.Push(V7829HelpMenus)
     tests.Push(V7828DropdownState,V7828HiddenLibrary,V7828RefreshChoices)
     tests.Push(V7827Opening,V7827Passes,V7827Recovery,V7827PlaybackPolicy,V7827Practice)
     tests.Push(V64TestInertDefaults, V64TestTabAppend, V64TestWindowBounds, V64TestFrozenIndependentOfRing, V64TestCompactIsolation, V64TestSeparateRepeatedDeaths, V64TestDuplicateDeathCount, V64TestKnownFinalHit, V64TestCauseDoesNotAssignBlame, V64TestAmbiguousBatch, V64TestMissingLethalHealth, V64TestWrongDeathSource, V64TestMissingDamage, V64TestImmuneNotKiller, V64TestAbsorbedNotKiller, V64TestZeroDamageNotKiller, V64TestEffectiveHealNotRaw, V64TestUnknownHealPreserved, V64TestHealthNoDamageArithmetic, V64TestHealthGaps, V64TestHealthShortLinks, V64TestHealthMaxChange, V64TestNoHealthGraph, V64TestGraphScaling, V64TestSortedEvents, V64TestDistinctHitsRetained, V64TestLateSameTimestamp, V64TestAfterDeathHealExcluded, V64TestUndoWindowAndCase, V64TestUndoLateAmendment, V64TestShortPullWindow, V64TestCaptureErrorsDisclosed, V64TestFallingDamage, V64TestSelfHeal, V64TestNpcNotPlayerContext, V64TestPlayerFilterKeepsOrder, V64TestHistoryContextRoundTrip, V64TestLegacyHistoryContextUnknown, V64TestHistoryRejectWrongDeath, V64TestHistoryRejectOutOfWindow, V64TestHistoryRejectInvalidHP, V64TestHistoryFileCompatibility, V64TestHistoryMergeAddsRecap, V64TestTextExport, V64TestLayoutBounds, V64TestHiddenPage, V64TestHiddenMissingContext, V64TestExactPullRouteIsolation, V64TestDetailedPopupRoute, V64TestDeathPagePrefs, V64TestClosedRollingBuffersReleased, V64TestEarlierDeathInWindow, V64TestZeroToAliveNotJoined)
     tests.Push(V641TestStyleDefaults, V641TestInvalidStyles, V641TestPreferenceRoundtrip, V641TestNoPersonalPreferenceWrites, V641TestEmptyAndZero, V641TestSingleBucket, V641TestPartialBucketTiming, V641TestBucketRatesAndTotals, V641TestUnknownEffectiveHealing, V641TestInvalidSampleGap, V641TestMonotoneBounds, V641TestEndpointsAndContinuity, V641TestPlateausAndExtrema, V641TestInvalidNodeOrder, V641TestStraightAndStepped, V641TestPixelBuffer, V641TestScaleGeometry, V641TestColourConversion, V641TestNativeUnavailableGuard, V641TestLayoutBounds, V641TestNativeAntialiasing, V641TestNativeRepeatedDrawing, V641TestHiddenChartStyleIsolation, V641TestHiddenTabsAndControls, V641TestChartNotes)
     tests.Push(V642TestGapsHaveGuides, V642TestShortSamplesRemainSolid, V642TestTwoSecondBoundary, V642TestMaxHPGuide, V642TestGapAndMaximumReasons, V642TestMissingRecordBetweenSamples, V642TestAllHPUnknown, V642TestZeroReturnNotBridged, V642TestRecordedDeathWithoutZero, V642TestOtherPlayerDeathIgnored, V642TestSameTimestampLifeOrder, V642TestFinalDeathNotSample, V642TestEndpointClipping, V642TestReadOnlyChartModel, V642TestHoverExactSample, V642TestHoverGuideUnknown, V642TestHoverMaximumReason, V642TestHoverOutside, V642TestDashGeometry, V642TestDegenerateDash, V642TestExportHealthEvidence, V642TestNoBackwardLine, V642TestHiddenGapRendering, V642TestHoverLeaveClearsDetails)
     tests.Push(V643TestChartBufferAllocation, V643TestChartBufferOwnership, V643TestSeparateTabCatalogues, V643TestHiddenChartStatusAndBitmap)
     tests.Push(V644ParserFinalizationParity,V644ParserCancellationScope,V644ParserCompletedFinalization,V644ParserCancellationEdges,V644ParserManualStop,V644ParserQualityOutsidePull,V644ParserQualityInsidePull,V644ParserQualityWithoutBoundary,V644ParserQualityValuesAndClock,V644ParserRepeatedDeathAfterRevival,V644ParserRevivalRollback,V644ParserAnalysisRevival,V644CandleAcceptanceAndCompletion,V644CandleTransportRetry,V644CandlePreemptionBudget,V644CandleStaleCompletion,V644CandleMuteGuard,V644CandleMissingPayload,V644CandleNoneRetry,V644CandleExpiredQueue,V644TestEqualTimeSort,V644TestTeamCaseIdentity,V644TestOverlappingOrderIndependent,V644TestOverlapConflictNoKill,V644TestOverlapIdentityConflict,V644TestSameSourceHistoryRefresh,V644TestTeamCaseCycles,V644TestHistoryAlternativeRoundtrip,V644TestPhaseCrossingReorder,V644TestSamePhaseReorder,V644TestLateOpeningCannotAdvancePhase,V644TestSamePhaseEarlierEvidence,V644TestHistoryConflictDisclosure,V644TestHistoryThreeSourcePermutations,V644TestHistoryAdjacentAndIndependent,V644TestHistoryTransitiveConflict,V644TestAlternativeCharacterAttendance,V644TestHiddenHistoryConflict,V644StorageMigration,V644StorageIntegrity,V644StorageCancellation,V644StorageStaleWriter,V644StorageCopyFolder,V644StorageSchemaValidation,V644StorageLargeRecaps,V644StorageCrossProcess,V644CacheReusesClosedPull,V644CacheViewIsolation,V644CacheInvalidation,V644CacheRollbackRevision,V644CacheNativeFightRows,V644CacheBenchmark,V644CleanupSuccess,V644CleanupRetainsAndRetries,V644CleanupBudgetAndCapacity,V644CleanupDestroyedOwner,V644AuxiliaryErrorPrivacy,V644AuxiliaryErrorBound,V644DeathErrorContainment,V644ProgressErrorContainment,V644DrawErrorEvidence)

     tests.Push(V645HistoryGroups,V645HistorySelectionValidation,V645HistoryAlternativesAndCycles,V645HistorySavedRemoval,V645HistoryRemoveAll,V645HistoryStaleGeneration,V645HistoryBackupFailure,V645ManagerLayoutAndList,V645ManagerCancelAndUndo,V645ManagerStaleAndEmpty,V645ManagerLifecycle)
     tests.Push(V646ProgressionPhaseTransitions,V646ProgressionMergeCancellation,V646ProgressionPostCommitDisplayError,V646ProgressionTimingPrivacy,V646ProgressionUnchangedOutcome)
     tests.Push(V647BossRecapRoundtrip,V647BossRecapValidation,V647BossRecapClone,V647BossRecapSidecar,V647BossCheckHiddenUI,V647BossCheckLegacyUI,V647BossEvidenceRetirement)
     tests.Push(V647BossRawAnnotations,V647BossDelayedCleave,V647BossInstanceScope,V647BossOrdinaryKillCompetition,V647BossAvoidanceAndContact,V647BossChronology,V647BossSharedGain,V647BossGraceEvidence,V647BossLateEvidence,V647BossRollback,V647BossLimitsAndPartial,V647BossIsolation,V647BossSameLife,V647BossProfileScope,V647BossUnknownAndClipped,V647BossPayloadValidation)
     tests.Push(V647LiveCleaveAfterDeathDamage,V647LiveCleaveDamageAmbiguity,V647LiveCleaveDeathVictim,V647LiveCleavePendingSurvivor,V647LiveCleavePendingBoundAndMute,V647LiveCleaveRealDeathCleanup)
     tests.Push(V648RageHistoryPlainText,V648RageHistoryChanges,V648RageHistoryCombined,V648RageHistoryUnknown,V648RageHistoryGrace,V648BossHistoryDefaultUI,V648BossHistoryDebugUI,V648BossHistoryDebugLifecycle)
     tests.Push(V648ReductionRawMarkers,V648ReductionActorScope,V648ReductionNonCompletion,V648ReductionLegacyRoundtrip,V648ReductionPayloadValidation,V648ReductionLateRollback)
     tests.Push(V649BossWindowBoundary,V649BossWindowDelayedDeath,V649BossWindowLateAndRollback,V649BossWindowLegacySchema,V649BossWindowAssociationLimit,V649BossWindowPlayerRecap)
     tests.Push(V6410ActorIdentityCache,V6410NpcIdentityCache,V6410IdentityCacheEviction,V6410ParserDecodeParity,V6410RetiredEventGuard,V6410RecapMetadataRollback)
     tests.Push(V6410InactiveProgressHealth,V6410MetricLifeFastPath,V6410HealthJournalFastPath)
     tests.Push(V6410IntensifyCapture,V6410IntensifyRealPairs,V6410IntensifyMatching,V6410IntensifyStops,V6410IntensifyBudget,V6410IntensifyPersistence)
     tests.Push(V6411WaveCapture,V6411WaveCleave,V6411WaveAvoidance,V6411WaveCompetition,V6411WaveOverlapBudget,V6411WavePersistence,V6411WaveLateRollback)
     tests.Push(V6411LiveWaveContacts,V6411LiveWaveRejections,V6411LiveWaveAvoidance,V6411LiveWaveGuards,V6411LiveWaveMuteAndDedup)
     tests.Push(V6412LiveMeleeContacts,V6412LiveMeleeRejections,V6412LiveMeleeGuards,V6412LiveMeleeOverlap,V6412LiveMeleeMute)
     tests.Push(V6413PlatformCapture,V6413PlatformGuards,V6413PlatformContacts,V6413PlatformBoundaries,V6413PlatformPersistence,V6413PlatformRawEvidence,V6413CounterCapture,V6413CounterInitial,V6413CounterInitialGuards,V6413CounterReapply,V6413CounterPersistence,V6413CounterRollback,V6413CounterRawEvidence,V6413KillAssignmentBounds,V6413KillAssignmentAmbiguity,V6413KillAssignmentGuards,V6413KillAssignmentFacts,V6413KillAssignmentBudgets,V6413KillAssignmentLimits,V6413KillAssignmentNativeReport)
     tests.Push(V6412MeleeCapture,V6412MeleeCleave,V6412MeleeGuards,V6412MeleeSharedDeath,V6412MeleePersistence,V6412RageContextBoundary,V6412PairedGraceHeals,V6412PairedGraceGuards,V6412RageLateRollback,V6412RageRawEvidence,V6412OverloadCastAssociation)
     tests.Push(V6414ImmutableFieldDecode,V6414FieldDecodeEviction,V6414MutableDecodeIsolation,V6414HealthAllocationParity,V6414IncomingExtremaSnapshot,V6414ProgressOpeningGuards,V6414ProgressLateOpening,V6414ProgressHealthSides,V6414ProgressContextChange,V6414ProgressUndo,V6414RecapPlayerSides,V6414RecapPlayerLateRollback,V6414BossUnneededReturn,V6414BossRecordedReturnRollback,V6414BossSameAddSides)
     tests.Push(V6414LazyMetricParity,V6414ActorInsertJournal)
     tests.Push(V6415ChallengePhaseWindow,V6415ChallengeScopeAndMarker,V6415ChallengeSameTimeOrder,V6415ChallengeReorderedBoundary,V6415ChallengeDuplicates,V6415ChallengeHealing,V6415ChallengeExistingExclusions,V6415ChallengeRollback,V6415ChallengeRepeatTotals,V6415ChallengeSnapshotIsolation,V6415ChallengeWindowBounds)
     tests.Push(V6415ChallengeUICatalogue,V6415ChallengeUIRanks,V6415ChallengeUIHiddenRender,V6415ChallengeUILayout,V6415ChallengeUISettings,V6415ChallengeUILifecycle,V6415ChallengeUIContext,V6415ChallengeUIOptions,V6415ChallengeUIPreview)
     tests.Push(V6415ChallengeLateRepeatStart,V6415ChallengeLateRepeatEnd,V6415ChallengeIndependentTargets,V6415ChallengeRepairRollback,V6415ChallengeUnknownHealing,V6415ChallengeEndInstance,V6415ChallengePendingEndInstance,V6415ChallengeOrdinalRouting,V6415ChallengeClosedSharedDuration,V6415ChallengeManifestCorpseGuard,V6415ChallengeManifestMissingOpening,V6415ChallengeManifestMissingEnd,V6415ChallengeManifestUndo,V6415ChallengeOrdinalObserved,V6415ChallengePursuitObserved,V6415ChallengeZeroHPMarkerGuard)
     tests.Push(V6416NahutRailTurretRecords,V6416NahutTargetWindowEdges)
     tests.Push(V65TimerIdentityAndEvents,V65TimerRestartAndIgnore,V65TimerSourcesAndCancellation,V65TimerHelperChain,V65TimerRepeatAndCompletion,V65TimerCombatScope,V65TimerSilenceAndSuspend,V65TimerGainAndModeFilters,V65TimerCycleGuard,V65TimerStorageRoundtrip)
     tests.Push(V65TimerImportSafeXML,V65TimerImportMetadata,V65TimerImportBuiltinOverrides,V65TimerImportRoundTrip,V65TimerImportDependencies,V65TimerImportMerge,V65TimerImportUnsupportedRetained)
     tests.Push(V65BuiltinCatalogue,V65BuiltinContext,V65BuiltinTyth,V65BuiltinTerrorGates,V65BuiltinFixedSchedules,V65BuiltinCouncilPhases,V65BuiltinApex,V65BuiltinRevan,V65BuiltinStyrak,V65BuiltinQueenAndRuugar,V65BuiltinDisabledAndSilent)
     tests.Push(V65TimerUIDefaults,V65TimerUISnapshot,V65TimerUIWarningExpiry,V65TimerUIBoundedRows,V65TimerUIPreviewIsolation,V65TimerUILayout,V65TimerUIHiddenRender,V65TimerUIWindowRecovery,V65TimerUIPreferenceIsolation,V65TimerUIHiddenManager,V65TimerUIOptionValidation,V65TimerUIImportReport)
     tests.Push(V65TimerUIIndependentViews)
     tests.Push(V651TimerPreviewSelection,V651TimerPreviewCountdown,V651TimerPreviewVisualModes,V651TimerPreviewNativeIsolation)
     tests.Push(V651TimerEditAvailability,V651TimerEditNativeStyles,V651TimerEditOwnership,V651TimerEditGeometry,V651TimerEditNoTickSnap,V651TimerEditSaveIsolation,V651TimerEditSharedButtons,V651TimerEditCleanupGuards)
     tests.Push(V652TimerOverlayPolicy,V652TimerOverlaySharedMenus,V652TimerOverlayHidePreview,V652TimerOverlayToggleSelection,V652TimerOverlayHotkeyAndDesktop,V652TimerOverlayLastOrdinaryView,V652TimerOverlayPreviewMenu)
     tests.Push(V652TimerDefaultsEmbedded,V652TimerDefaultsFirstLoad,V652TimerDefaultsSavedOverrides,V652TimerDefaultsCorruptSaved)
     tests.Push(V653TimerIdleBossSelection,V653TimerBossTargetAcquisition,V653TimerSelectionContinuity)
     tests.Push(V653TimerDeferredEntryCarry,V653TimerCarryScopeAndOrigin)
     tests.Push(V658MenuNativeIdentity,V658MenuNativeDispatch,V658MenuDynamicState,V658MenuPolicyAndLabels,V658MenuRestore,V658MenuMeasureDpi,V658MenuPaintBounds,V658MenuSharedOwner,V658MenuRepeatLifecycle,V658MenuWorkspaceIdentity)
     tests.Push(V658MenuMnemonicDispatch,V658MenuInvalidHandles,V658MenuFreshStatePaint,V658MenuSuspendedThemeRoundtrip)
     tests.Push(V659HeaderBrandIdentity,V659HeaderNativeLayout,V659HeaderThemeOwnership,V659HeaderForeignBitmap,V659HeaderOwnerPruning)
     tests.Push(V6510RunUIOverlay,V6510RunUIIsolation,V6510RunUILayout,V6510RunUIOptions,V6510RunUIInput,V6510RunCatalog,V6510RunAutomatic,V6510RunScope,V6510RunHostileEvidence,V6510RunFreshLiveOnly,V6510RunBufferedTime,V6510RunWipesAndTravel,V6510RunSleepAndClockChanges,V6510RunManualAndRemaining,V6510RunInvalidInputs,V6510RunExpiryAndRearm,V6510RunDedupAcrossReset,V6510RunFinish,V6510RunPersistence,V6510RunPersistenceReset,V6510RunPersistenceCorruption,V6510RunSavedWallShift,V6510RunEvidenceBounds,V6510RunLateAttach,V6510RunDiagnosticSaveGuard)
     tests.Push(V6510RunBestiaOpener)
     tests.Push(StaleRunBestia,StaleRunGuards,StaleRunHistory,StaleRunPrefilter)
     ; V661_NEW_TESTS_BEGIN
     tests.Push(V661AuthRoundTrip,V661AuthInputValidation,V661AuthTamperAndTruncation,V661AuthFileLifecycle,V661AuthFailureKeepsPrevious,V661AuthMalformedFile,V661AuthDotNetCompatibility,V661AccountJobEnvelope)
     tests.Push(V661AccountSessionUI,V661AccountRememberUI,V661AccountDamagedStorage,V661AccountBusyAndGeometry,V661AccountWorkerSuccess,V661AccountWorkerAnonymous,V661AccountWorkerInvalidLogin,V661AccountWorkerUnexpectedReply)
     tests.Push(V661AccountWorkerBrokenEnvelope)
     ; V661_NEW_TESTS_END
     ; v69.1: real isolated child-process exits, including a vetoing negative control.
     tests.Push(V691ExitVetoControl,V691ExitNoTimeline,V691ExitOpenTimeline,V691ExitBusyTimeline)
    ; V692_TESTS_BEGIN
    tests.Push(V692IconDeletedCache)
    tests.Push(V692IconRetryCache)
    tests.Push(V692RotationIconRecovery)
    tests.Push(V692UnknownIconFallback)
    tests.Push(V692RotationWholeFightPage)
    tests.Push(V692RotationWholeFightDensity)
    tests.Push(V692RotationWholeFightNative)
    tests.Push(V692IconsExpansion)
    tests.Push(V692IconsAllBundled)
    tests.Push(V692IconsRecordedActivations)
    tests.Push(V692TestAnalysisCutoffParity)
    tests.Push(V692TestAnalysisReuse)
    tests.Push(V692TestAnalysisCacheInvalidation)
    tests.Push(V692TestAnalysisCutoffGuards)
    tests.Push(V692TestAnalysisBackdatedFallback)
    tests.Push(V692TestAnalysisReuseCancellation)
    tests.Push(V692TestAnalysisRollbackParity)
    ; V692_TESTS_END
    ; V693_TESTS_BEGIN
    tests.Push(V693TestImportAnalysisParity)
    tests.Push(V693TestImportAnalysisFallback)
    tests.Push(V693TestImportAnalysisSourceGuards)
    tests.Push(V693TestImportAnalysisCancel)
    tests.Push(V693TestImportAnalysisLimits)
    tests.Push(V693TestImportAnalysisSeedSnapshots)
    tests.Push(V693TestImportAnalysisMidnightLate)
    tests.Push(V693TestImportAnalysisAnsi)
    tests.Push(V693RotationAnchorIdentity)
    tests.Push(V693RotationSequenceCoverage)
    tests.Push(V693RotationSequenceViewport)
    tests.Push(V693RotationUtilityRows)
    tests.Push(V693RotationCyclesNative)
    ; V693_TESTS_END
    ; V694_TESTS_BEGIN
    tests.Push(V694RotationEmbeddedLayout)
    tests.Push(V694RotationEmbeddedRouting)
    tests.Push(V694RotationEmbeddedCleanup)
    tests.Push(V694WorkspaceRotationLoad)
    tests.Push(V694WorkspaceRotationCancel)
    tests.Push(V694WorkspaceRotationSelection)
    tests.Push(V694WorkspaceRotationHost)
    tests.Push(V694AutoStartDefaults)
    tests.Push(V694AutoStartGuards)
    tests.Push(V694AutoStartPreferences)
    tests.Push(V694AutoStartSelfTest)
    tests.Push(V694StoryMonolithRecognized)
    tests.Push(V694StoryMonolithScope)
    tests.Push(V694StoryMonolithVeteran)
    tests.Push(V694JuggIconsArtwork)
    tests.Push(V694JuggIconsNativeRotation)
    tests.Push(V694LateRecoveryHandoff)
    tests.Push(V694LateRecoveryCancel)
    tests.Push(V694LateRecoveryBoundary)
    tests.Push(V694LateRecoverySourceChange)
    ; V694_TESTS_END
    ; V695_TESTS_BEGIN
    tests.Push(V695ClassIconsArtwork)
    tests.Push(V695ClassIconsEffectIdentity)
    tests.Push(V695ClassIconsNoGuessing)
    tests.Push(V695ClassIconsNativeRotation)
    ; V695_TESTS_END
    ; V70_TESTS_BEGIN
    tests.Push(V70TestCacheBinary,V70TestCacheImportReuse,V70TestCacheAnalysisReuse)
    tests.Push(V70TestCacheInvalidation,V70TestCacheCancellation,V70TestCacheAtomicAndBounds)
    tests.Push(V70RunSplitsProof,V70RunSplitsAdmission,V70RunSplitsComparison)
    tests.Push(V70RunSplitsPersistence,V70RunSplitsUI)
    tests.Push(V70SnvMasterScope,V70SnvMasterBossDeaths,V70SnvMasterWarlords,V70SnvMasterPhaseDeaths)
    tests.Push(V73SectionPersistence)
    tests.Push(V73SectionJournal)
    tests.Push(V73SectionLateBoundary)
    tests.Push(V73SectionConsistency)
    tests.Push(V73SectionAnalysis)
    tests.Push(V73RecordedSequence1)
    tests.Push(V73RecordedSequence2)
    tests.Push(V73RecordedSequence3)
    tests.Push(V73RecordedSequence4)
    tests.Push(V73RecordedSequence5)
    tests.Push(V73RecordedSequence6)
    tests.Push(V73RecordedSequence7)
    tests.Push(V73RecordedSequence8)
    tests.Push(V73RecordedSequence9)
    tests.Push(V73RecordedSequence10)
    tests.Push(V73RecordedSequence11)
    tests.Push(V73RecordedSequence12)
    tests.Push(V73RecordedSequence13)
    tests.Push(V73RecordedSequence14)
    tests.Push(V73RecordedSequence15)
    tests.Push(V73RecordedSequence16)
    tests.Push(V73RecordedSequence17)
    tests.Push(V73RecordedSequence18)
    tests.Push(V73RecordedSequence19)
    tests.Push(V73RecordedSequence20)
    tests.Push(V73RecordedSequence21)
    tests.Push(V73RecordedSequence22)
    tests.Push(V73RecordedSequence23)
    tests.Push(V73RecordedSequence24)
    tests.Push(V73RecordedSequence25)
    tests.Push(V73RecordedSequence26)
    tests.Push(V73RecordedSequence27)
    tests.Push(V73RecordedSequence28)
    tests.Push(V73RecordedSequence29)
    tests.Push(V73RecordedSequence30)
    tests.Push(V73RecordedSequence31)
    tests.Push(V73RecordedSequence32)
    tests.Push(V73RecordedSequence33)
    tests.Push(V73RecordedSequence34)
    tests.Push(V73RecordedSequence35)
    tests.Push(V73RecordedSequence36)
    tests.Push(V73RecordedSequence37)
    tests.Push(V73RecordedSequence38)
    tests.Push(V73RecordedSequence39)
    tests.Push(V73RecordedSequence40)
    tests.Push(V73RecordedSequence41)
    tests.Push(V73RecordedSequence42)
    tests.Push(V73RecordedSequence43)
    tests.Push(V73RecordedSequence44)
    tests.Push(V73RecordedSequence45)
    tests.Push(V73RecordedSequence46)
    tests.Push(V73RecordedSequence47)
    tests.Push(V73RecordedSequence48)
    tests.Push(V73RecordedSequence49)
    tests.Push(V73RecordedSequence50)
    tests.Push(V73RecordedSequence51)
    tests.Push(V73RecordedSequence52)
    tests.Push(V73RecordedSequence53)
    tests.Push(V73RecordedSequence54)
    tests.Push(V73RecordedSequence55)
    tests.Push(V73RecordedSequence56)
    tests.Push(V73RecordedSequence57)
    tests.Push(V73RecordedSequence58)
    tests.Push(V73RecordedSequence59)
    tests.Push(V73RecordedSequence60)
    tests.Push(V73RecordedSequence61)
    tests.Push(V73RecordedSequence62)
    tests.Push(V73RecordedSequence63)
    tests.Push(V73RecordedSequence64)
    tests.Push(V73RecordedSequence65)
    tests.Push(V73RecordedSequence66)
    tests.Push(V73RecordedSequence67)
    tests.Push(V73RecordedSequence68)
    tests.Push(V73RecordedSequence69)
    tests.Push(V73RecordedSequence70)
    tests.Push(V73RecordedSequence71)
    tests.Push(V73RecordedSequence72)
    tests.Push(V73RecordedSequence73)
    tests.Push(V73RecordedSequence74)
    tests.Push(V73RecordedSequence75)
    tests.Push(V73RecordedSequence76)
    tests.Push(V73RecordedSequence77)
    tests.Push(V73RecordedSequence78)
    tests.Push(V73RecordedSequence79)
    tests.Push(V73RecordedSequence80)
    tests.Push(V73RecordedSequence81)
    tests.Push(V73RecordedSequence82)
    tests.Push(V73RecordedSequence83)
    tests.Push(V73RecordedSequence84)
    tests.Push(V73RecordedSequence85)
    tests.Push(V73RecordedSequence86)
    tests.Push(V73RecordedSequence87)
    tests.Push(V73RecordedSequence88)
    tests.Push(V73RecordedWindowRule1)
    tests.Push(V73RecordedWindowRule2)
    tests.Push(V73RecordedWindowRule3)
    tests.Push(V73RecordedWindowRule4)
    tests.Push(V73RecordedWindowRule5)
    tests.Push(V73RecordedWindowRule6)
    tests.Push(V73RecordedWindowRule7)
    tests.Push(V73RecordedWindowRule8)
    tests.Push(V73RecordedWindowRule9)
    tests.Push(V73RecordedWindowRule10)
    tests.Push(V73RecordedWindowRule11)
    tests.Push(V73RecordedWindowRule12)
    tests.Push(V73RecordedWindowRule13)
    tests.Push(V73RecordedWindowRule14)
    tests.Push(V73RecordedWindowRule15)
    tests.Push(V73RecordedWindowRule16)
    tests.Push(V73RecordedWindowRule17)
    tests.Push(V73RecordedWindowRule18)
    tests.Push(V73RecordedWindowRule19)
    tests.Push(V73RecordedWindowRule20)
    tests.Push(V73RecordedWindowRule21)
    tests.Push(V73RecordedWindowRule22)
    tests.Push(V73RecordedWindowRule23)
    tests.Push(V73RecordedWindowRule24)
    tests.Push(V73RecordedWindowRule25)
    tests.Push(V73RecordedWindowRule26)
    tests.Push(V73RecordedWindowRule27)
    tests.Push(V73RecordedWindowRule28)
    tests.Push(V73RecordedWindowRule29)
    tests.Push(V73RecordedWindowRule30)
    tests.Push(V73RecordedWindowRule31)
    tests.Push(V73RecordedWindowRule32)
    tests.Push(V73RecordedWindowRule33)
    tests.Push(V73RecordedWindowRule34)
    tests.Push(V73RecordedWindowRule35)
    tests.Push(V73RecordedWindowRule36)
    tests.Push(V73RecordedWindowRule37)
    tests.Push(V73RecordedWindowRule38)
    tests.Push(V73RecordedWindowRule39)
    tests.Push(V73RecordedWindowRule40)
    tests.Push(V73RecordedWindowRule41)
    tests.Push(V73RecordedWindowRule42)
    tests.Push(V73RecordedWindowRule43)
    tests.Push(V73RecordedWindowRule44)
    tests.Push(V73RecordedWindowRule45)
    tests.Push(V73RecordedWindowRule46)
    tests.Push(V73RecordedWindowRule47)
    tests.Push(V73RecordedWindowRule48)
    tests.Push(V73RecordedWindowRule49)
    tests.Push(V73RecordedWindowRule50)
    tests.Push(V73RecordedWindowRule51)
    tests.Push(V73RecordedWindowRule52)
    tests.Push(V73RecordedWindowRule53)
    tests.Push(V73RecordedWindowRule54)
    tests.Push(V73RecordedWindowRule55)
    tests.Push(V73RecordedWindowRule56)
    tests.Push(V73RecordedWindowRule57)
    tests.Push(V73RecordedWindowRule58)
    tests.Push(V73RecordedWindowRule59)
    tests.Push(V73RecordedWindowRule60)
    tests.Push(V73RecordedWindowRule61)
    tests.Push(V73RecordedWindowRule62)
    tests.Push(V73RecordedWindowRule63)
    tests.Push(V73RecordedWindowRule64)
    tests.Push(V73RecordedWindowRule65)
    tests.Push(V73RecordedWindowRule66)
    tests.Push(V73RecordedWindowRule67)
    tests.Push(V73RecordedWindowRule68)
    tests.Push(V73RecordedWindowRule69)
    tests.Push(V73RecordedWindowRule70)
    tests.Push(V73RecordedWindowRule71)
    tests.Push(V73RecordedWindowRule72)
    tests.Push(V73RecordedWindowRule73)
    tests.Push(V73RecordedWindowRule74)
    tests.Push(V73RecordedWindowRule75)
    tests.Push(V73RecordedWindowRule76)
    tests.Push(V73RecordedWindowRule77)
    tests.Push(V73RecordedWindowRule78)
    tests.Push(V73RecordedWindowRule79)
    tests.Push(V73RecordedWindowRule80)
    tests.Push(V73RecordedWindowRule81)
    tests.Push(V73RecordedWindowRule82)
    tests.Push(V73RecordedWindowRule83)
    tests.Push(V73RecordedWindowRule84)
    tests.Push(V73RecordedWindowRule85)
    tests.Push(V73RecordedWindowRule86)
    tests.Push(V73RecordedWindowRule87)
    tests.Push(V73RecordedWindowRule88)
    tests.Push(V73RecordedWindowRule89)
    tests.Push(V73RecordedWindowRule90)
    tests.Push(V73RecordedWindowRule91)
    tests.Push(V73RecordedWindowRule92)
    tests.Push(V73RecordedWindowRule93)
    tests.Push(V73RecordedWindowRule94)
    tests.Push(V73RecordedWindowRule95)
    tests.Push(V73RecordedWindowRule96)
    tests.Push(V73RecordedWindowRule97)
    tests.Push(V73RecordedWindowRule98)
    tests.Push(V73RecordedWindowRule99)
    tests.Push(V73RecordedWindowRule100)
    tests.Push(V73RecordedWindowRule101)
    tests.Push(V73RecordedWindowRule102)
    tests.Push(V73RecordedWindowRule103)
    tests.Push(V73RecordedWindowRule104)
    tests.Push(V73RecordedWindowRule105)
    tests.Push(V73RecordedWindowRule106)
    tests.Push(V73RecordedWindowRule107)
    tests.Push(V73RecordedWindowRule108)
    tests.Push(V73RecordedWindowRule109)
    tests.Push(V73RecordedWindowRule110)
    tests.Push(V73RecordedWindowRule111)
    tests.Push(V73RecordedWindowRule112)
    tests.Push(V73RecordedWindowRule113)
    tests.Push(V73RecordedWindowRule114)
    tests.Push(V73RecordedWindowRule115)
    tests.Push(V73RecordedWindowRule116)
    tests.Push(V73RecordedWindowRule117)
    tests.Push(V73RecordedWindowRule118)
    tests.Push(V73RecordedWindowRule119)
    tests.Push(V73RecordedWindowRule120)
    tests.Push(V73RecordedWindowRule121)
    tests.Push(V73RecordedWindowRule122)
    tests.Push(V73RecordedWindowRule123)
    tests.Push(V73RecordedWindowRule124)
    tests.Push(V73RecordedWindowRule125)
    tests.Push(V73RecordedWindowRule126)
    tests.Push(V73RecordedWindowRule127)
    tests.Push(V73RecordedWindowRule128)
    tests.Push(V73RecordedWindowRule129)
    tests.Push(V73RecordedWindowRule130)
    tests.Push(V73RecordedWindowRule131)
    tests.Push(V73RecordedWindowRule132)
    tests.Push(V73RecordedWindowRule133)
    tests.Push(V73RecordedWindowRule134)
    tests.Push(V73RecordedWindowRule135)
    tests.Push(V73RecordedWindowRule136)
    tests.Push(V73RecordedWindowRule137)
    tests.Push(V73RecordedWindowRule138)
    tests.Push(V73RecordedWindowRule139)
    tests.Push(V73RecordedWindowRule140)
    tests.Push(V73RecordedWindowRule141)
    tests.Push(V73RecordedWindowRule142)
    tests.Push(V73RecordedWindowRule143)
    tests.Push(V73RecordedWindowRule144)
    tests.Push(V73RecordedWindowRule145)
    tests.Push(V73RecordedWindowRule146)
    tests.Push(V73RecordedWindowRule147)
    tests.Push(V73RecordedWindowRule148)
    tests.Push(V73RecordedWindowRule149)
    tests.Push(V73RecordedWindowRule150)
    tests.Push(V73RecordedWindowRule151)
    tests.Push(V73RecordedWindowRule152)
    tests.Push(V73RecordedWindowRule153)
    tests.Push(V73RecordedWindowRule154)
    tests.Push(V73RecordedWindowRule155)
    tests.Push(V73RecordedWindowRule156)
    tests.Push(V73RecordedWindowRule157)
    tests.Push(V73RecordedWindowRule158)
    tests.Push(V73RecordedWindowRule159)
    tests.Push(V73RecordedWindowRule160)
    tests.Push(V73RecordedWindowRule161)
    tests.Push(V73RecordedWindowRule162)
    tests.Push(V73RecordedWindowRule163)
    tests.Push(V73RecordedWindowRule164)
    tests.Push(V73RecordedWindowRule165)
    tests.Push(V73RecordedWindowRule166)
    tests.Push(V73RecordedWindowRule167)
    tests.Push(V73RecordedWindowRule168)
    tests.Push(V73RecordedWindowRule169)
    tests.Push(V73RecordedWindowRule170)
    tests.Push(V73RecordedWindowRule171)
    tests.Push(V73RecordedWindowRule172)
    tests.Push(V73RecordedWindowRule173)
    tests.Push(V73RecordedWindowRule174)
    tests.Push(V73RecordedWindowRule175)
    tests.Push(V73RecordedWindowRule176)
    tests.Push(V73RecordedWindowRule177)
    tests.Push(V73RecordedWindowRule178)
    tests.Push(V73RecordedWindowRule179)
    tests.Push(V73RecordedWindowRule180)
    tests.Push(V73RecordedWindowRule181)
    tests.Push(V73RecordedWindowRule182)
    tests.Push(V73RecordedWindowRule183)
    tests.Push(V73RecordedWindowRule184)
    tests.Push(V73RecordedWindowRule185)
    tests.Push(V73RecordedWindowRule186)
    tests.Push(V73RecordedWindowRule187)
    tests.Push(V73RecordedWindowRule188)
    tests.Push(V73RecordedWindowRule189)
    tests.Push(V73RecordedWindowRule190)
    tests.Push(V73RecordedWindowRule191)
    tests.Push(V73RecordedWindowRule192)
    tests.Push(V73RecordedWindowRule193)
    tests.Push(V73RecordedWindowRule194)
    tests.Push(V73RecordedWindowRule195)
    tests.Push(V73RecordedWindowRule196)
    tests.Push(V73RecordedWindowRule197)
    tests.Push(V73RecordedWindowRule198)
    tests.Push(V73RecordedWindowRule199)
    tests.Push(V73RecordedWindowRule200)
    tests.Push(V73RecordedWindowRule201)
    tests.Push(V73RecordedWindowRule202)
    tests.Push(V73RecordedWindowRule203)
    tests.Push(V73RecordedWindowRule204)
    tests.Push(V73RecordedWindowRule205)
    tests.Push(V73RecordedWindowRule206)
    tests.Push(V73RecordedWindowRule207)
    tests.Push(V73RecordedWindowRule208)
    tests.Push(V73RecordedWindowRule209)
    tests.Push(V73RecordedWindowRule210)
    tests.Push(V73RecordedWindowRule211)
    tests.Push(V73RecordedWindowRule212)
    tests.Push(V73RecordedWindowRule213)
    tests.Push(V73RecordedWindowRule214)
    tests.Push(V73RecordedWindowRule215)
    tests.Push(V73RecordedWindowRule216)
    tests.Push(V73RecordedWindowRule217)
    tests.Push(V73RecordedWindowRule218)
    tests.Push(V73RecordedWindowRule219)
    tests.Push(V73RecordedWindowRule220)
    tests.Push(V73RecordedWindowRule221)
    tests.Push(V73RecordedWindowRule222)
    tests.Push(V73RecordedWindowRule223)
    tests.Push(V73RecordedWindowRule224)
    tests.Push(V73RecordedWindowRule225)
    tests.Push(V73RecordedWindowRule226)
    tests.Push(V73RecordedWindowRule227)
    tests.Push(V73RecordedWindowRule228)
    tests.Push(V73RecordedWindowRule229)
    tests.Push(V73RecordedWindowRule230)
    tests.Push(V73RecordedWindowRule231)
    tests.Push(V73RecordedWindowRule232)
    tests.Push(V73RecordedWindowRule233)
    tests.Push(V73RecordedWindowRule234)
    tests.Push(V73RecordedWindowRule235)
    tests.Push(V73RecordedWindowRule236)
    tests.Push(V73RecordedWindowRule237)
    tests.Push(V73RecordedWindowRule238)
    tests.Push(V73RecordedWindowRule239)
    tests.Push(V73RecordedWindowRule240)
    tests.Push(V73RecordedWindowRule241)
    tests.Push(V73RecordedWindowRule242)
    tests.Push(V73RecordedWindowRule243)
    tests.Push(V73RecordedWindowRule244)
    tests.Push(V73RecordedWindowRule245)
    tests.Push(V73RecordedWindowRule246)
    tests.Push(V73RecordedWindowRule247)
    tests.Push(V73RecordedWindowRule248)
    tests.Push(V73RecordedWindowRule249)
    tests.Push(V73RecordedWindowRule250)
    tests.Push(V73RecordedWindowRule251)
    tests.Push(V73RecordedWindowRule252)
    tests.Push(V73RecordedWindowRule253)
    tests.Push(V73RecordedWindowRule254)
    tests.Push(V73RecordedWindowRule255)
    tests.Push(V73RecordedWindowRule256)
    tests.Push(V73RecordedWindowRule257)
    tests.Push(V73RecordedWindowRule258)
    tests.Push(V73RecordedWindowRule259)
    tests.Push(V73RecordedWindowRule260)
    tests.Push(V73RecordedWindowRule261)
    tests.Push(V73ModernWindow01)
    tests.Push(V73ModernWindow02)
    tests.Push(V73ModernWindow03)
    tests.Push(V73ModernWindow04)
    tests.Push(V73ModernWindow05)
    tests.Push(V73ModernWindow06)
    tests.Push(V73ModernWindow07)
    tests.Push(V73ModernWindow08)
    tests.Push(V73ModernWindow09)
    tests.Push(V73ModernWindow10)
    tests.Push(V73ModernWindow11)
    tests.Push(V73ModernWindow12)
    tests.Push(V73ModernWindow13)
    tests.Push(V73ModernWindow14)
    tests.Push(V73ModernWindow15)
    tests.Push(V73ModernWindow16)
    tests.Push(V73ModernWindow17)
    tests.Push(V73ModernWindow18)
    tests.Push(V73ModernWindow19)
    tests.Push(V73ModernWindow20)
    tests.Push(V73ModernWindow21)
    tests.Push(V73ModernWindow22)
    tests.Push(V73ModernWindow23)
    tests.Push(V73ModernWindow24)
    tests.Push(V73ModernWindow25)
    tests.Push(V73WORefresh)
    tests.Push(V73WOLateEnd)
    tests.Push(V73WOOrphanIdentities)
    tests.Push(V73WOJournal)
    tests.Push(V73WOAnalysisFence)
    tests.Push(V73WOReverseCycles)
    tests.Push(V73WOAllOrders)
    tests.Push(V73WOOrdinal)
    tests.Push(L73DraxusOldAndNew)
    tests.Push(L73DraxusMissingGuardian)
    tests.Push(L73DraxusJournal)
    tests.Push(L73WarlordsOrderDuplicateStale)
    tests.Push(L73WarlordsInvalidEngagement)
    tests.Push(L73WarlordsJournal)
    tests.Push(V73WOHorizon)
    tests.Push(V73WOOverflow)
    tests.Push(V73WOInstanceStream)
    tests.Push(V73WOSameClock)
    tests.Push(V74PVNewImportHealth)
    tests.Push(V74PEArrivalOrder)
    tests.Push(V74PEExpiredBoundary)
    tests.Push(V74PENewInstanceReorder)
    tests.Push(V74PEUndo)
    tests.Push(V74PERepeatCapacity)
    tests.Push(V74PEFactCapacity)
    tests.Push(V74PEActorCapacity)
    tests.Push(V74PVIntegratedViews)
    tests.Push(V74PVHealthFallback)
    tests.Push(V74PhaseHistoryRoundTrip)
    tests.Push(V74PhaseHistoryCompatibility)
    tests.Push(V74PhaseHistoryInvalid)
    tests.Push(V74PhaseAnalysisIntegration)
    tests.Push(V74PhaseAnalysisAcceptance)
    tests.Push(V74PhaseParselyBoundaries)
    tests.Push(V74GodsParsely01)
    tests.Push(V74GodsParsely02)
    tests.Push(V74GodsParsely03)
    tests.Push(V74GodsParsely04)
    tests.Push(V74GodsParsely05)
    tests.Push(V74GodsParsely06)
    tests.Push(V74GodsParselyWrongScopes)
    tests.Push(V74GodsParselyMarkerGuards)
    tests.Push(V74GodsParselySettledDamage)
    tests.Push(V74LegacyParselyProfiles)
    tests.Push(V74LegacyMasterStyrakOpening)
    tests.Push(V74LegacyMasterStyrakSiteTransitions)
    tests.Push(V74ModernParsely01)
    tests.Push(V74ModernParsely02)
    tests.Push(V74ModernParsely03)
    tests.Push(V74ModernParsely04)
    tests.Push(V74ModernParsely05)
    tests.Push(V74ModernParsely06)
    tests.Push(V74ModernParsely07)
    tests.Push(V74ModernParsely08)
    tests.Push(V74ModernParsely09)
    tests.Push(V74ModernParsely10)
    tests.Push(V74ModernParsely11)
    tests.Push(V74ModernParselyScopes)
    tests.Push(V74ModernParselyCoreAndShield)
    tests.Push(V74ModernParselyActorGuards)
    tests.Push(V74ModernParselyMarkerGuards)
    tests.Push(V74PVRecordedOrder)
    tests.Push(V74PVPartialAndLegacy)
    tests.Push(V74PVFiltersAndOrderConflict)
    tests.Push(V74PVMergePrefixAndValidate)
    tests.Push(V74PVPhaseGraph)
    tests.Push(V7411TabIconWorkspace)
    tests.Push(V7412ListIconsNative)
    tests.Push(V7412ListIconsLifecycle)
    tests.Push(V7412MainAbilityRows)
    tests.Push(V7412OverviewAbilityIcons)
    tests.Push(V7412MainIconFallback)
    tests.Push(V787RefreshDeferral)
    tests.Push(V7813PerformanceSorting,V7813EncounterBoundaries,IC214CodexResets,IC214NahutOpeners,ITL215Sides,ITL215Choices,IPP216References,IPP216Guards,IPP216UI,V7813ReindexFragments,V7812StatisticsSorting)
    tests.Push(V7817HelpPace,V7817HelpTiming,V7817HelpPolicy,V7817HelpUI)
    tests.Push(V7824NahutRoster,V7824IzaxRoster,V7824RosterGuards)
    tests.Push(V7824Early,V7824EarlyLifetime)
    tests.Push(V7826Sources,V7826Views,V7826Range,V7826Layout,V7826Directory,V7826DirectorySave,V7826DirectoryWindow,V7826SettingsUI)
    tests.Push(V7825Migration,V7825Storage,V7825Roles,V7825Readiness,V7825Window,V7825Sequence,V7825Playback)
    tests.Push(V7823PreviewNavigation,V7823PreviewNames)
    tests.Push(V7822Sequence,V7822Resets,V7822Tethers,V7822Safety,V7822Settings)
    tests.Push(V7821Shield,V7821Order,V7821Scope,V7821Audio,V7821Recovery,V7821Settings,V7821Overlay)
    tests.Push(V7820Induction,V7820First,V7820Respawn,V7820Scope,V7820Lifetime,V7820Policy,V7820Settings,V7820Recovery)
    tests.Push(V7819Sequence,V7819Partial,V7819Lifetime,V7819Policy,V7819Settings)
    tests.Push(V7818FirstOnly,V7818LateCycle,V7818Under,V7818Lifecycle,V7818Audio,V7818Settings)
    tests.Push(V7817Pairs,V7817Windows,V7817Lifecycle,V7817AudioPolicy,V7817ScopeUI,V7817LateAttachment)
    tests.Push(V7816Schedule,V7816Cadence,V7816Lifecycle,V7816Gates,V7816ScopeAndUI,V7816BacklogAndPolicy)
    tests.Push(V7811StatisticsModel)
    tests.Push(V7811StatisticsNative)
    tests.Push(V7811RecoveryProgress)
    tests.Push(V7811AccountModel)
    tests.Push(V7811AccountNative)
    tests.Push(V7811AccountBests)
    tests.Push(V7810DeferredTable)
    tests.Push(V7810SharedPhases)
    tests.Push(V786ResumePaint)
    tests.Push(V7412MainNativePaint)
    tests.Push(V7412AnalysisIconRendering)
    tests.Push(V7412AnalysisIconSorting)
    tests.Push(V7412AnalysisIconRerender)
    tests.Push(V7412AnalysisEffectIconIdentity)
    tests.Push(V7412AnalysisIconPaint)
    tests.Push(V7412PlayerIconCatalog)
    tests.Push(V7412PlayerIconMetadata)
    tests.Push(V7412PlayerIconPictures)
    tests.Push(V7412PlayerIconWorkspace)
    tests.Push(V7414TableNotifications)
    tests.Push(V7414TableNativePaint)
    tests.Push(V7414TableLifecycle)
    tests.Push(V7414TableClassNames)
    tests.Push(V7414DropdownPolicy)
    tests.Push(V7414DropdownBehavior)
    tests.Push(V7414DropdownPaint)
    tests.Push(V7414DropdownLifetime)
    tests.Push(V7418IzaxSavedHP)
    tests.Push(V7418IzaxHPGuards)
    tests.Push(V7418IzaxNewImport)
    tests.Push(V7418IzaxNativeGraph)
    tests.Push(V7416BossPanels)
    tests.Push(V7415BossCropCatalog)
    tests.Push(V7415BossCropPixels)
    tests.Push(V7415BossCropLifetime)
    tests.Push(V7414BossPortraitCatalog)
    tests.Push(V7414BossPortraitPictures)
    tests.Push(V7414BossPortraitWorkspace)
    tests.Push(V7414BossPortraitAnalysis)
    tests.Push(V7412PlayerIconAnalysis)
    tests.Push(V7411TabIconCatalog)
    tests.Push(V7411TabIconNative)
    tests.Push(V7411TabIconLifecycle)
    tests.Push(V7411TabIconLayout)
    tests.Push(V7410UtilityIconIdentities)
    tests.Push(V7410UtilityIconEvidence)
    tests.Push(V7410UtilityIconControls)
    tests.Push(V7410UtilityIconLayout)
    tests.Push(V7410EffectIconsData)
    tests.Push(V7410EffectsIconsNative)
    tests.Push(V7410HealerIconsNative)
    tests.Push(V7410EffectsIconsBounds)
    tests.Push(V7410EffectsIconsMissingArt)
    tests.Push(V7428DeathViewOwnership)
    tests.Push(V7428DeathViewSwitch)
    tests.Push(V7428SessionRecapRoute)
    tests.Push(V7428DeathViewRefreshIsolation)
    tests.Push(V7428DeathViewLayout)
    tests.Push(V7428RaidMetricPage)
    tests.Push(V7428RaidArithmetic)
    tests.Push(V7428RaidUnknownValues)
    tests.Push(V7428RaidSignedThreat)
    tests.Push(V7428RaidIdentityAndSorting)
    tests.Push(V7428RaidResponsiveLayout)
    tests.Push(V7428RaidHeaderAlignment)
    tests.Push(V7428RaidViewIsolation)
    tests.Push(V7428RaidCapture, V7881RaidRoleIcons, V7881RaidRoleLifecycle)
    tests.Push(MergedHPNames,MergedHPSettings,MergedHPLive,MergedHPPreview)
    tests.Push(DarkControls, DarkMenus, DarkWorkspace, DarkAnalysis)
    tests.Push(V7430TabTrace)
    tests.Push(V7431SubclassReentrancy)
    tests.Push(V7432ProgressionImageModel)
    tests.Push(V7432ProgressionImageRender)
    tests.Push(V7433OverlayIconSymbols)
    tests.Push(V7433OverlayIconControls)
    tests.Push(V7433OverlayIconLayout)
    tests.Push(V7433TimerIconIdentity)
    tests.Push(V7433TimerIconNative)
    tests.Push(V7434UtilityOptionalPower)
    tests.Push(V7434UtilityObservationScope)
    tests.Push(V7434UtilityBattleRezPriority)
    tests.Push(V7434UtilityPriorityUI)
    tests.Push(V7435HPLegacyBudget)
    tests.Push(V7436UtilityGroupedRows)
    tests.Push(V7436UtilityGroupedUI)
    tests.Push(V7438FontNative)
    tests.Push(V7438FontScope)
    tests.Push(V7439InterfaceFonts)
    tests.Push(V7439DropdownFonts)
    tests.Push(V7439WorkspaceFonts)
    tests.Push(V7440FontPreference)
    tests.Push(V7440FontSwitch)
    tests.Push(V7440FontAppearance)
    tests.Push(V7441SessionTabState)
    tests.Push(V7441SessionTabCapture)
    tests.Push(V7435PhaseCacheData)
    tests.Push(V7435SectionCacheData)
    tests.Push(V7435HPAllAxes)
    tests.Push(V7435HPNahutCapture)
    tests.Push(V7435HPLegacyPrimary)
    tests.Push(V7435HPRoundTrip)
    tests.Push(V7435HPWeighted)
    tests.Push(V7435HPJournal)
    tests.Push(V7435HPGuards)
    tests.Push(V7435HPPrimaryCatalogue)
    tests.Push(V7435HPSequential)

    tests.Push(V749ProgressionTabs)
    tests.Push(V749ProgressionHost)
    tests.Push(V749ProgressionLayout)
    tests.Push(V749ProgressionRetention)
    tests.Push(V749ProgressionHiddenWork)
    tests.Push(IQPH181Text,IQPH181RaidCells,IQPH181RaidGuards,IQPH181Phase,IQPH181TTK,IQPH181OverlayRegistry,IQPH181OverlaySources,IQPH181TipLifecycle,IQPH181OverlayOverlap)
    tests.Push(IQPH101Preferences,IQPH101Menus,IQPH101TooltipToggle,IQPH101OverlayToggle)
    tests.Push(V748PhaseLegacyAvailability)
    tests.Push(V748PhaseMixedAvailability)
    tests.Push(V748PhaseAvailabilityGuards)
    tests.Push(V748PhaseImageAvailability)
    tests.Push(V746RIFontFamily)
    tests.Push(V746RIFontCleanup)
    tests.Push(V745RIObservedMilestones)
    tests.Push(V745RICompactPreview)
    tests.Push(V744RITextAtPixelSizes)
    tests.Push(V744RITextLiteralAmpersand)
    tests.Push(V743RIPreviewPixels)
    tests.Push(V742HPReimportedTyth)
    tests.Push(V742HPWeightedSisters)
    tests.Push(V742HPMissingAndGuards)
    tests.Push(V742HPNativeAndImage)
    tests.Push(V741SavedDuplicateTyth)
    tests.Push(V741SavedTyth13)
    tests.Push(V741SavedSisters14)
    tests.Push(V741SavedMissingEvidence)
    tests.Push(V741SavedMixedPhases)
    tests.Push(V741SavedEligibility)
    tests.Push(V741SavedNoMutation)
    tests.Push(V741SavedNativeGraph)
    tests.Push(V74RIResolution)
    tests.Push(V74RITextQuality)
    tests.Push(V74RILongLayout)
    tests.Push(V74RIScaleAndResources)
    tests.Push(V74RIPngEncoding)
    tests.Push(V74RavParsely01)
    tests.Push(V74RavParsely02)
    tests.Push(V74RavParselyScopeAndGap)
    tests.Push(V72PhaseCatalogue)
    tests.Push(V72PhaseExactMarkers)
    tests.Push(V72PhaseJournal)
    tests.Push(V72PhaseHistoryGraph)
    tests.Push(V72PhaseHealth)
    tests.Push(V72PhaseSequences)
    tests.Push(V72PhaseInactiveTargets)
    tests.Push(V72PhaseOpeningBinding)
    tests.Push(V72RecordedWitness01)
    tests.Push(V72RecordedWitness02)
    tests.Push(V72RecordedWitness03)
    tests.Push(V72RecordedWitness04)
    tests.Push(V72RecordedWitness05)
    tests.Push(V72RecordedWitness06)
    tests.Push(V72RecordedWitness07)
    tests.Push(V72RecordedWitness08)
    tests.Push(V72RecordedWitness09)
    tests.Push(V72RecordedWitness10)
    tests.Push(V72RecordedWitness11)
    tests.Push(V72RecordedWitness12)
    tests.Push(V72RecordedWitness13)
    tests.Push(V72RecordedWitness14)
    tests.Push(V72RecordedWitness15)
    tests.Push(V72RecordedWitness16)
    tests.Push(V72RecordedWitness17)
    tests.Push(V72RecordedWitness18)
    tests.Push(V72RecordedWitness19)
    tests.Push(V72RecordedWitness20)
    tests.Push(V72RecordedWitness21)
    tests.Push(V72RecordedWitness22)
    tests.Push(V72RecordedWitness23)
    tests.Push(V72RecordedWitness24)
    tests.Push(V72RecordedWitness25)
    tests.Push(V72RecordedWitness26)
    tests.Push(V72RecordedWitness27)
    tests.Push(V72RecordedWitness28)
    tests.Push(V72RecordedWitness29)
    tests.Push(V72RecordedWitness30)
    tests.Push(V72RecordedWitness31)
    tests.Push(V72RecordedWitness32)
    tests.Push(V72RecordedWitness33)
    tests.Push(V72RecordedWitness34)
    tests.Push(V72RecordedWitness35)
    tests.Push(V72RecordedWitness36)
    tests.Push(V72RecordedWitness37)
    tests.Push(V72RecordedWitness38)
    tests.Push(V72RecordedWitness39)
    tests.Push(V72RecordedWitness40)
    tests.Push(V72RecordedWitness41)
    tests.Push(V72RecordedWitness42)
    tests.Push(V72RecordedWitness43)
    tests.Push(V72RecordedWitness44)
    tests.Push(V72RecordedWitness45)
    tests.Push(V72RecordedWitness46)
    tests.Push(V72RecordedWitness47)
    tests.Push(V72RecordedWitness48)
    tests.Push(V72RecordedWitness49)
    tests.Push(V72RecordedWitness50)
    tests.Push(V72RecordedWitness51)
    tests.Push(V72RecordedWitness52)
    tests.Push(V72RecordedWitness53)
    tests.Push(V72RecordedWitness54)
    tests.Push(V72RecordedWitness55)
    tests.Push(V72RecordedWitness56)
    tests.Push(V72RecordedWitness57)
    tests.Push(V72RecordedWitness58)
    tests.Push(V72RecordedWitness59)
    tests.Push(V72RecordedWitness60)
    tests.Push(V72RecordedWitness61)
    tests.Push(V72RecordedWitness62)
    tests.Push(V72RecordedWitness63)
    tests.Push(V72RecordedWitness64)
    tests.Push(V72RecordedWitness65)
    tests.Push(V72RecordedWitness66)
    tests.Push(V72RecordedWitness67)
    tests.Push(V72RecordedWitness68)
    tests.Push(V72RecordedWitness69)
    tests.Push(V72RecordedWitness70)
    tests.Push(V72RecordedWitness71)
    tests.Push(V72RecordedWitness72)
    tests.Push(V72RecordedWitness73)
    tests.Push(V72RecordedWitness74)
    tests.Push(V72RecordedWitness75)
    tests.Push(V72RecordedWitness76)
    tests.Push(V72RecordedWitness77)
    tests.Push(V72RecordedWitness78)
    tests.Push(V72RecordedWitness79)
    tests.Push(V72RecordedWitness80)
    tests.Push(V72RecordedWitness81)
    tests.Push(V72RecordedWitness82)
    tests.Push(V72RecordedWitness83)
    tests.Push(V72RecordedWitness84)
    tests.Push(V72RecordedWitness85)
    tests.Push(V72RecordedWitness86)
    tests.Push(V72RecordedWitness87)
    tests.Push(V72RecordedWitness88)
    tests.Push(V72RecordedWitness89)
    tests.Push(V72RecordedWitness90)
    tests.Push(V72RecordedWitness91)
    tests.Push(V72RecordedWitness92)
    tests.Push(V72RecordedWitness93)
    tests.Push(V72RecordedWitness94)
    tests.Push(V72RecordedWitness95)
    tests.Push(V72RecordedWitness96)
    tests.Push(V72RecordedWitness97)
    tests.Push(V72RecordedWitness98)
    tests.Push(V72RecordedWitness99)
    tests.Push(V72RecordedWitness100)
    tests.Push(V72RecordedWitness101)
    tests.Push(V72RecordedWitness102)
    tests.Push(V72RecordedWitness103)
    tests.Push(V72RecordedWitness104)
    tests.Push(V72RecordedWitness105)
    tests.Push(V72RecordedWitness106)
    tests.Push(V72RecordedWitness107)
    tests.Push(V72RecordedWitness108)
    tests.Push(V72RecordedWitness109)
    tests.Push(V72RecordedWitness110)
    tests.Push(V72RecordedWitness111)
    tests.Push(V72RecordedWitness112)
    tests.Push(V72RecordedWitness113)
    tests.Push(V72RecordedWitness114)
    tests.Push(V72RecordedWitness115)
    tests.Push(V72RecordedWitness116)
    tests.Push(V72RecordedWitness117)
    tests.Push(V72RecordedWitness118)
    tests.Push(V72RecordedWitness119)
    tests.Push(V72RecordedWitness120)
    tests.Push(V72RecordedWitness121)
    tests.Push(V72RecordedWitness122)
    tests.Push(V72RecordedWitness123)
    tests.Push(V72RecordedWitness124)
    tests.Push(V72RecordedWitness125)
    tests.Push(V72RecordedWitness126)
    tests.Push(V72RecordedWitness127)
    tests.Push(V72RecordedWitness128)
    tests.Push(V72RecordedWitness129)
    tests.Push(V72RecordedWitness130)
    tests.Push(V72RecordedWitness131)
    tests.Push(V72RecordedWitness132)
    tests.Push(V72RecordedWitness133)
    tests.Push(V72RecordedWitness134)
    tests.Push(V72RecordedWitness135)
    tests.Push(V72RecordedWitness136)
    tests.Push(V72RecordedWitness137)
    tests.Push(V72RecordedWitness138)
    tests.Push(V72RecordedWitness139)
    tests.Push(V72RecordedWitness140)
    tests.Push(V72RecordedWitness141)
    tests.Push(V72RecordedWitness142)
    tests.Push(V72RecordedWitness143)
    tests.Push(V72RecordedWitness144)
    tests.Push(V72RecordedWitness145)
    tests.Push(V72RecordedWitness146)
    tests.Push(V72RecordedWitness147)
    tests.Push(V72RecordedWitness148)
    tests.Push(V72RecordedWitness149)
    tests.Push(V72RecordedWitness150)
    tests.Push(V72RecordedWitness151)
    tests.Push(V72RecordedWitness152)
    tests.Push(V72RecordedWitness153)
    tests.Push(V72RecordedWitness154)
    tests.Push(V72RecordedWitness155)
    tests.Push(V72RecordedWitness156)
    tests.Push(V72RecordedWitness157)
    tests.Push(V72RecordedWitness158)
    tests.Push(V72RecordedWitness159)
    tests.Push(V72RecordedWitness160)
    tests.Push(V72RecordedWitness161)
    tests.Push(V72RecordedWitness162)
    tests.Push(V72RecordedWitness163)
    tests.Push(V72RecordedWitness164)
    tests.Push(V72RecordedWitness165)
    tests.Push(V72RecordedWitness166)
    tests.Push(V72RecordedWitness167)
    tests.Push(V72RecordedWitness168)
    tests.Push(V72RecordedWitness169)
    tests.Push(V72RecordedWitness170)
    tests.Push(V72RecordedWitness171)
    tests.Push(V72RecordedWitness172)
    tests.Push(V72RecordedWitness173)
    tests.Push(V72RecordedWitness174)
    tests.Push(V72RecordedWitness175)
    tests.Push(V72RecordedWitness176)
    tests.Push(V72PVEligibility)
    tests.Push(V72PVConsistency)
    tests.Push(V72PVHistoryCompatibility)
    tests.Push(V72PVAnalysisStages)
    tests.Push(V72PVAnalysisAcceptance)
    tests.Push(V72PVNativeViews)
    tests.Push(V72PWRecords)
    tests.Push(V72PWGuards)
    tests.Push(V72PWBoundaries)
    tests.Push(V72PWOriginalPairs1)
    tests.Push(V72PWOriginalPairs2)
    tests.Push(V71PCCounts,V71PCUnknowns,V71PCScope,V71PCBurnMarkers,V71PCFiltersAndDuplicates,V71PCConflicts,V71PCSnapshotIsolation,V71PCNativeWindow)
    tests.Push(V71ALIdentity,V71ALAttendance,V71ALCycles,V71ALStorage,V71ALChoices,V71ALNativeWindow)
    tests.Push(V71RunBreakdownPartition,V71RunBreakdownCoverage,V71RunBreakdownLive,V71RunBreakdownComparison,V71RunBreakdownStorage,V71RunBreakdownUI)
    tests.Push(V71RIModel,V71RIFilterAndUnknown,V71RIRunSelection,V71RIRenderBounds,V71RIPngRoundTrip,V71RINativePreview)
    tests.Push(V71TestBookmarkStorage,V71TestBookmarkIdentity,V71TestBookmarkLive,V71TestBookmarkVerification,V71TestBookmarkJump,V71TestBookmarkEditor)
    ; V70_TESTS_END
    ; V69_NEW_TESTS_BEGIN
     tests.Push(V75LibraryImportSelection)
     tests.Push(V751SharedImport,V751SharedBatch,V751AssignTeams)
     tests.Push(V771Recovery,V771Continuity,V771Guards,V771FinalEvents,V771AnalysisMembership)
     tests.Push(V771RosterReset,V771SavedRefresh)
     tests.Push(V778BackgroundLive,V778BackgroundPause,V778BackgroundFailure,V778BackgroundLiveSave,V778BackgroundGuards,V778BackgroundProtocol,V778BackgroundAck)
     tests.Push(V777LibraryBusySearch,V777LibraryPages,V777LibraryDebounce,V777LibraryQueueSearch,V777LibraryLargeSearch)
     tests.Push(V776ArchiveQueueCapacity, V776ArchiveFolderFiles)
    tests.Push(V775BossBrowse, V775ProgressionSearch, V775BrowsePreferences)
    tests.Push(V775BlankQueue,V775BlankMigration,V775BlankRetry,V775BlankDisplay)
     tests.Push(V774LibraryResults,V774SharedSave)
     tests.Push(V773JsonSpans,V773ReadCheckpoints,V773LibraryCheckpoints,V773HistoryCheckpoints)
     tests.Push(V77SavedPhases,V77ArchiveMechanicScan,V77BuiltinSetup,V77TitleScopes)
     tests.Push(V77UtilityEvidence,V77UtilityWindow,V77RotationAlignment,V77RotationWindow,V77ArchiveModel,V77ArchiveWindow,V77SetupRoundtrip,V77SetupRejects,V77SetupStorage,V77SetupWindow,V77Titles,V77TitleWindow)
     tests.Push(V7610PullLengths,V7610PullLengthChanges,V7610PullLengthPreferences,V7610PullOpeningSpeech)
     tests.Push(V769LibraryTeamModel,V769LibraryTeamSave,V769LibraryTeamGuards,V769LibraryTeamWindow,V769LibraryTeamBusy,V769LibraryTeamEmpty)
     tests.Push(V767JournalBatch,V767JournalPartialBatch,V767CheckedAckConflict)
     tests.Push(V768WorkerParity,V768WorkerPause,V768WorkerFailure,V768WorkerChangedSource,V768WorkerCorruptResult,V768WorkerBuildGuard,V768WorkerControls,V768WorkerEight,V768WorkerParentClosed)
     tests.Push(V766QueueFlushEdges,V766QueueFlushDeadline)
     tests.Push(V766LibraryBatchAtomic,V766QueueBatch,V766QueuePauseFlush,V766QueueSaveFailure,V766QueueCrashRecovery,V766QueueDirectRow)
     tests.Push(V765LibraryEntry,V765LibraryEntryConflicts,V765LibraryArchiveCapacity,V765NoBossQueue)
     tests.Push(V764QueueAutoPause,V764QueuePauseDrain,V764QueueGuards,V764QueueNewWork,V764QueueRoutes)
     tests.Push(V763QueueJournalRecovery,V763QueueJournalConflict,V763QueueCheckpointRecovery,V763QueueRowUpdates,V763QueueEstimates)
     tests.Push(V762AutoStopLibrary,V762AutoStopOpenRoutes,V762AutoStopCancel,V762AutoStopRecovery)
     tests.Push(V761LibraryOpenGuards,V761LibraryOpenImport,V761LibraryOpenCancel)
     tests.Push(V76QueueStorage,V76QueueWorkflow,V76AddConsumables,V76PersonalBests,V76PhaseTotals,V76ReviewWindow,V76QueueWindow)
     tests.Push(V751LibraryHost,V751CalendarLabels,V751LiveLibrary,V751EmptyNightMechanics)
     tests.Push(V75LibraryStorage,V75LibraryDedupAndCalendar,V75LibraryPerformance,V75LibraryScan,V75LibraryWindow,V75MechanicCatalog)
     tests.Push(V69MechanicBuiltins,V69MechanicScope,V69MechanicCustom,V69MechanicInterruptIdentity,V69MechanicNahut,V69MechanicCoverage)
     tests.Push(V69MechanicPhases,V69MechanicBatch,V69MechanicMismatch,V69MechanicCancel,V69MechanicPersistence,V69MechanicWindow)
     tests.Push(V69MechanicOpenBusy,V69PlannerStorage,V69PlannerRecordedCasts,V69PlannerUnknowns,V69PlannerMechanicAnchor,V69PlannerReminders)
     tests.Push(V69PlannerNoCatchup,V69PlannerAlertOwnership,V69PlannerHiddenEditor,V69RotationRecordedCasts,V69RotationPageEdges,V69RotationCollisionLayout)
     tests.Push(V69RotationEffectEdges,V69RotationNativeWindow,V69RotationSelection,V69IconsExactIdentity,V69IconsIntegrity,V69IconsNativePicture)
     tests.Push(V69EnemyIdentity,V69EnemyFilters,V69EnemyLifecycle,V69EnemyEstimates,V69EnemyBounds,V69EnemyNativeOverlay)
     ; V69_NEW_TESTS_END
     ; V681_NEW_TESTS_BEGIN
     tests.Push(V681ReviewLoading,V681LoadingMainImport,V681LoadingAnalysisImport,V681LoadingLayout,V681BatchLoadingLifecycle,V681BatchLoadingCancelError)
     tests.Push(V681BatchLoadingLayout)
     ; V681_NEW_TESTS_END
     ; V68_NEW_TESTS_BEGIN
     tests.Push(V68ReviewLoadExact,V68ReviewRejectMismatch,V68ReviewCancelAndConflict,V68ReviewLongSession,V68ReviewRaidPlayersOnly,V68ReviewEqualWindow)
     tests.Push(V68ReviewSequenceAndEffects,V68ReviewSourceIdentity,V68ReviewArchiveCandidates,V68ReviewPreemption,V68TimelineReceived,V68TimelineUnknownHealing)
     tests.Push(V68TimelineEffects,V68TimelineLife,V68TimelineSameMillisecond,V68TimelineLateRecords,V68TimelineRangeAndCasts,V68TimelineNativeBitmap)
     tests.Push(V68TimelineParserJournal,V68TimelineRevivalEvidence,V68TimelineCancellation,V68TimelinePhaseEdge,V68ReviewUIEntryPoints,V68ReviewUILayout)
     tests.Push(V68ReviewUISelections,V68ReviewUICachedComparison,V68ReviewUITimelineFocus,V68ReviewUIPhaseFocus,V68ReviewUIPaging,V68ReviewUILifecycle)
     tests.Push(V68ReviewUIFormatting)
     ; V68_NEW_TESTS_END
     ; V673_NEW_TESTS_BEGIN
     tests.Push(V673DispatchEmptyActors,V673DispatchBlankBossDamage,V673DispatchFailureContainment,V673DispatchSilentAndSameStamp,V673TythPostKillGrace,V673TythGraceNextPull)
     tests.Push(V673LifecycleDeathSnapshot,V673LifecycleRevive,V673LifecycleBareIdentity,V673LifecycleSingleDeath,V673LifecycleWipe,V673LifecycleWipeNegatives)
     tests.Push(V673LifecycleTailReset,V673LifecycleManualStop,V673OrderBatchBattery,V673OrderFinalSkip,V673OrderBatchRecovery,V673OrderBatchTerminal)
     tests.Push(V673OrderBatchTankProof,V673OrderBatchP3Branch,V673OrderBatchH1Allowance,V673OrderDeadHolder,V673OrderRepublicRebounder,V673OrderPendingLifecycle)
     tests.Push(V673RecordedBlankIzax,V673RecordedNahutCleanup)
     ; V673_NEW_TESTS_END
     ; V672_NEW_TESTS_BEGIN
     tests.Push(V672LibraryCatalogue,V672LibraryTargetedSwitch,V672LibraryParentRetention,V672LibraryLegacySync,V672LibraryFloorStop,V672LibraryStatus)
     tests.Push(V672LibraryPersistence,V672LibraryUIHidden,V672LibraryUIPausedChecks,V672LibraryUIFilterSelection,V672LibraryUIBulkFilter,V672LibraryUICheckIdentity)
     tests.Push(V672LibraryUILegacyPoll,V672LibraryUIPreviewLinks,V672LibraryUILayout)
     ; V672_NEW_TESTS_END
     ; V671_NEW_TESTS_BEGIN
     tests.Push(V671FloorReceiptAnchor,V671FloorZeroAndPhase,V671FloorCadenceAndPriority,V671FloorExpiryAndSkip,V671FloorStalePause,V671FloorResumeWithoutCatchup,V671FloorStalledPollResume,V671FloorMissingPulse)
     tests.Push(V671FloorUnrelatedOrOldInput,V671FloorManualStopLatch,V671FloorOldResetCannotRearm,V671FloorNewEncounter,V671FloorBossDeath,V671FloorWipeCleanup,V671FloorCleanupRequiresCorroboration,V671FloorSpreadCleanupAndPersonalDeath)
     tests.Push(V671FloorSilentReplayAndParserOff,V671FloorMidnightOrdering,V671FloorLogMarchClear,V671FloorLogAprilMissingPulse,V671FloorLogJuneClear,V671FloorLogAugustClear,V671FloorLogSeptemberClear,V671FloorLogOctoberWipe)
     ; V671_NEW_TESTS_END
     ; V67_NEW_TESTS_BEGIN
     tests.Push(V67UtilityCatalog,V67UtilityInitialUnknown,V67UtilityRezCompletion,V67UtilityRezFailures,V67UtilityReboundEvidence,V67UtilityReboundAmbiguity,V67UtilityPredation,V67UtilitySharedBuffLockout)
     tests.Push(V67UtilityLockoutSnapshots,V67UtilityActiveSnapshots,V67UtilityDeathAndPulls,V67UtilityBoundaries,V67UtilityLateAndDuplicate,V67UtilityBoundedRoster,V67UtilitySourceIsolation,V67UtilityUICatalogue)
     tests.Push(V67UtilityUIHidden,V67UtilityUIPreview,V67UtilityUIStatus,V67UtilityUILayout,V67UtilityUIOptions,V67UtilityUIProfile)
     ; V67_NEW_TESTS_END
     ; V66_NEW_TESTS_BEGIN
     tests.Push(V66PositionRecordedArrivals,V66PositionBounds,V66PositionActors,V66PositionScopeAndAge,V66PositionHistoryAndStop,V66PositionPersistence,V66PositionPrefilter,V66PositionHiddenUI)
     tests.Push(V66RunManualArmModel,V66RunManualArmUI,V66RunManualArmRestore,V66AnalysisPhaseAllTargets,V66AnalysisPhaseChallengeTargets,V66AnalysisPhaseBoundaries,V66AnalysisPhaseProgression,V66AnalysisPhaseRepeatsAndScope)
     tests.Push(V66AnalysisPhaseHiddenUI,V66AnalysisPhaseManualBookmark,V66AnalysisPhaseEventOverride,V66AnalysisPhaseSavedIsolation,V66TimerEditorDefaults,V66TimerEditorValidation,V66TimerEditorRename,V66TimerEditorDependencies)
     tests.Push(V66TimerEditorExportClosure,V66TimerEditorExportGuards,V66TimerEditorMetadata,V66TimerEditorBuiltin,V66TimerEditorNativeDraft,V66TimerEditorNativeSave,V66TimerEditorStaleSave,V66TimerEditorFailedSave)
     tests.Push(V66TimerEditorNativeBuiltin,V66TimerEditorFileRoundtrip,V66LayoutRoundTrip,V66LayoutStorage,V66LayoutHiddenUI,V66LayoutOpenControls,V66UploadSelectionUI,V66UploadScope)
     tests.Push(V66UploadNativeExtraction,V66UploadTerminalRange,V66UploadAnsiEncoding,V66EffectsApplyRemove,V66EffectsCharges,V66EffectsUnknownAndEstimate,V66EffectsFilters,V66EffectsBoundaries)
     tests.Push(V66EffectsOutOfOrder,V66EffectsGridOwnership,V66EffectsGridAmbiguity,V66EffectsLimitAndPrune,V66EffectsNotesModel,V66EffectsUIHidden,V66EffectsUIPreview,V66EffectsUILayout)
     tests.Push(V66EffectsUIOptions,V66EffectsUINotes,V66EffectsUILayoutProfile,V66ShieldArithmetic,V66ShieldPrepullCredit,V66ShieldOverlap,V66ShieldUnsupportedAndTank,V66ShieldAdjacentRemoval)
     tests.Push(V66ShieldRemovalBounds,V66ShieldDeathAndRefresh,V66ShieldAreaAndSource,V66ShieldExpiry,V66ShieldRollback,V66ShieldPhysicalSnapshot,V66ShieldActorCap,V66ShieldUnknownHealing)
     tests.Push(V66ShieldAnalysisParity,V66ShieldSnapshotIsolation,V66ShieldRemovalThenNewSource,V66ShieldNativeDetails)
     ; V66_NEW_TESTS_END
     tests.Push(V6511InstanceRecordedAreas,V6511InstanceCatalogModes,V6511InstanceReaderTransitions,V6511InstanceReaderBoundary,V6511InstanceUntrustedRecords,V6511InstanceSavedIsolation,V6511RunAutoSafeZone,V6511RunUnknownAndMode,V6511RunTravelPreservesClock,V6511RunStopDisarms,V6511RunHeaderStaleAndPreview,V6511RunManualOverride)
     tests.Push(V657PullSequence,V657PullLateTicks,V657PullCancelAndRestart,V657PullCurrentExpiry,V657PullContextCancellation,V657PullStartGuards,V657PullManualIndependence,V657PullPreviewIsolation,V657PullBusyWorker)
     tests.Push(V657PullShortcutChoices,V657PullShortcutPolicy,V657PullPreferenceIsolation,V657PullHiddenUI,V657PullBindingIsolation)
     tests.Push(V656TitaxEstimateTemplates,V656TitaxEstimateLiveWarnings,V656TitaxEstimatePreview,V656TitaxEstimateCustomRules,V656TitaxEstimateRoundtrip,V656TitaxEstimateSavedLibrary)
     tests.Push(V655TimerAlertsSimultaneous,V655TimerAlertUpdatesInPlace,V655TimerAlertDistinctSources,V655TimerAlertCapacityAndExpiry,V655TimerAlertSuppressionAndLegacy)
     tests.Push(V655WarningSnapshotRows,V655WarningLayoutBounds,V655WarningNativeStack,V655WarningNativeLongText)
     tests.Push(V654WDMigration,V654WDSequence,V654WDWipeAndNewPull,V654WDModeAndCustom,V654WDSilentAndPause)
     tests.Push(V65ContinuityNahutAfterTrash,V65ContinuityTerrorReset,V7717NahutReviveBatch)
     tests.Push(V270CouncilOverlay,V270WatchdogOverlay)
     tests.Push(V654LiveBufferedFirstBatch,V654LiveMidnightAndProcessingTime,V654LiveFutureJitter,V654LiveStaleBatchAndChunkContinuity,V654LiveRecorderAndFallback,V654LiveRealClockDiscontinuity)
     tests.Push(V654PersonalBuffDefinitions,V654PersonalBuffOct1Records,V654PersonalBuffPrePullAndExit,V654PersonalBuffEarlyRemoval,V654PersonalBuffIdentity,V654PersonalBuffLateRemoval,V654PersonalBuffWarningClassification,V654RepairPreferences,V654RepairCustomRules,V654RepairSavedLibrary,V654RepairCleanseAndMine,V654RepairTitaxModes)
     tests.Push(V65TimerCombatBoundaries)
     tests.Push(V65TimerIntegratedReentry)
     tests.Push(V65TimerImportRealApex)
     tests.Push(V65ContinuityNewInstance,V65ContinuityBattleRez,V65ContinuitySameInstanceReset,V65ContinuityAmbiguousAndAdds,V65ContinuityPhaseAndRepeat,V65ContinuityDuplicateAndRemote)
     tests.Push(V7717WipeRespawn,V7717BattleRez,V7717ResetTail,V7717ResetGuards,V7717FreshInstance,V7717PendingExit)
     tests.Push(PAFTestFullPull,PAFTestScrollUI)
     tests.Push(IPLRTestPrefs,IPLRTestGuards,IPLRTestRestore)
     tests.Push(PAFTestAssignments,PAFTestTyth,PAFTestSisters,PAFTestNahut,PAFTestScyva,PAFTestIzax)
     path := A_ScriptDir "\Iris_v48_Native_Test_Report.txt"
     ; dev.65: include all release regressions in the manual full suite.
     tests.Push(PANTTestDeadlines,PANTTestAssignments,PANTTestGapsAndRollback,PANTTestNativeAndOrder,PAS56Early,PAS56Ignite)
     tests.Push(PAS56Lifecycle,PAS57Persistence,PAS57Damage,PAS57Ordering,IUN58Format,IUN58Raid)
     tests.Push(IUN58Analysis,IUN58Settings,PANTTestTwoSecondView,PANTTestFifthChoice,PANTTestFifthChoiceFallbacks,PANTTestFifthChoiceRollback)
     tests.Push(PANTTestSnipeFailure,PANTTestSnipePersistence,PANTTestSnipeLifecycle,PANTTestSameMillisecondOpening,PANTTestOpeningPositionGuards,IAC63Start)
     tests.Push(IAC63Preferences,IAC63Controls,IAC63CompactRaid,IAC63CompactFormat,PAI64Ignite,PAI64IgniteGuards)
     tests.Push(PAI64Turrets,PAI64Ordering,V7865PvPLoadRetry,PAF65MixedRoles,PAF65TimerCaption,PAF65RunCaption)
     tests.Push(IUI65XRCachedLocale)
     tests.Push(V78AuditAnalysisMitigation,V78AuditDeflectedCleave,V78AuditLibraryCaseGuard,V78AuditLibraryCaseFallback,V78AuditSourceCaseGuard,V78AuditTeamCaseGuard,V78AuditDeadHolderPolicy,V78AuditCaseCooldown,V78AuditCaseSplits,V78AuditCaseRunDetails,V78AuditCaseAliases,V78AuditCaseTeamSetup,V78AuditCaseBookmarks)
     tests.Push(V7879RecoveryLiveRequests,V7879RecoveryLivePatches,V7879RecoveryLiveSnapshotRoundtrip,V7879RecoveryLiveNative)
     tests.Push(SavedHPReset,SavedHPResetGuards,SavedHPResetRollback)
     IrisTestWriteText(path,report "Groups registered: " tests.Length "`r`n")
     suiteStart := IrisTestNow()
     tests.Push(RaptusPersonalTiming,RaptusPersonalTargets,RaptusPersonalBoundaries,RaptusPersonalReorder,RaptusPersonalStorage)
     tests.Push(V7885QueueClear, V7885RoleRefresh, V7885TyransEnding)
     tests.Push(V7888PublicDST)
     tests.Push(I93TimerSelection,I94TimerRouting,I94TimerPanels)
     tests.Push(NBC98ActualPair,NBC98PersistedClocks,NBC98Settings)
     tests.Push(IOS109Lifecycle,IOS109Deferred,IOS109Preferences,IOS109Controls,IOS109Timers)
     tests.Push(I115EvidenceRoundTrip,I115EvidenceLegacy,I115EvidenceStorage,I115BookmarkSort,I115TeamDates,I115TeamDateGuards,I115TeamDateFallback,I115TeamDateWindow,V78114TeamRepeat,V78114TeamService)
     tests.Push(V7886TitleArchiveCommand,V7894TitlePublicPackage)
     tests.Push(IWS87Commands,IWS87Preferences,IWS91Ready,I93StartupPriority,PTG97Labels,PTG97Guards,PTG97Replay,PTG108Summary,PTG108Overlay,I95TimerPanelEditor)
     tests.Push(I129WorkspaceResume)
     tests.Push(Audit132TimerChainContext,Audit132TimerChainLifecycle,Audit132UtilityDeathVictim,Audit132TeamOrderIdentity,Audit132DiagnosticToolIdentity)
     tests.Push(V7895LiveCompletion,V7895LiveCompletionSave)
     tests.Push(IRT148TimerLabelFit,IRT148TimerLabelPanels)
     tests.Push(IRH150OperatorCores)
     tests.Push(VDev136LoadedLog)
tests.Push(VDev136SessionTriggers)
tests.Push(VDev136SessionGuards)
tests.Push(VDev136SessionStop)
tests.Push(VDev136UploadLedger)
tests.Push(VDev136LedgerGuards)
tests.Push(VDev136AutoQueue)
tests.Push(VDev136UploadUI)
tests.Push(VDev136HistoryUI)
tests.Push(IQT138Buckets)
tests.Push(IQT138Reference)
tests.Push(IQT138Context)
tests.Push(IQT138Raid)
tests.Push(IQV139Page)
tests.Push(IQV139SourceIsolation)
tests.Push(IQV139Overlay)
tests.Push(IQV139ColorChoice)
tests.Push(IQO140Unified)
tests.Push(IQO140Input)
tests.Push(IQO140Migration)
tests.Push(IQO140Readability)
tests.Push(IQT141BoldNative)
tests.Push(IQP143Math)
tests.Push(IQP143Ties)
tests.Push(IQP143References)
tests.Push(IQP143Sorting)
tests.Push(IQR145RetiredTab)
tests.Push(IQR145UnavailableReason)
tests.Push(IQR145RecoveredCoverage)
tests.Push(IQP146References)
tests.Push(IQP146Difficulty)
tests.Push(IQP146RaidAndOverlay)
tests.Push(IQP147References)
tests.Push(IQP147ScopeRouting)
tests.Push(IQP147RaidAndOverlay)
tests.Push(IQH148References)
tests.Push(IQH148Metrics)
tests.Push(IQH148RaidAndOverlay)
tests.Push(IQH149LockedHealingInput)
tests.Push(IQA159Periods)
tests.Push(IQA159References)
tests.Push(IQA159Raid)
tests.Push(IQA159Challenge)
tests.Push(IQE161Settings)
tests.Push(IQE161Header)
tests.Push(IQF162Cards)
tests.Push(IQF162Paint)
tests.Push(IQC164References)
tests.Push(IQC164Mapping)
tests.Push(IQC164UI)
tests.Push(IQC165Rows)
tests.Push(IQC165Guards)
tests.Push(IQC165RaidUI)
tests.Push(IRP166HoldingMenu)
tests.Push(IRP166HoldingReplay)
tests.Push(IQS167Default)
tests.Push(IQS167Manual)
tests.Push(IQS167TTK)
tests.Push(IQW167Combat)
tests.Push(IQW167Missing)
tests.Push(IQW167Challenge)
tests.Push(IQA168Expanded)
tests.Push(ITR169Reset)
tests.Push(IHW170Filtering)
tests.Push(IHW170Sources)
tests.Push(IHW170UI)
tests.Push(IHW170Prefs)
tests.Push(IQO172Health)
tests.Push(IQO172Gate)
tests.Push(IQO172Scope)
tests.Push(IQO172Rollback)
tests.Push(IPM175LoadedNahut)
tests.Push(IPM175SourceAndStale)
tests.Push(IPM175ZeroAndRun)
tests.Push(IPM175EmptyAndGuards)
tests.Push(IGV176RestartControls)
tests.Push(IGV176RestartScope)
tests.Push(IGV176RestartStandalone)
tests.Push(IPF180RaidMenu)
tests.Push(IPF180RaidGrowth)
tests.Push(IPF180Context)
tests.Push(IPF180Breakdown)
tests.Push(IPF180ActorMenu)
tests.Push(IPF180Headers)
tests.Push(IMP179PaintLifetime)
tests.Push(IMP179Selection)
tests.Push(IMP179DisabledTheme)
tests.Push(IMP179Bounds)
tests.Push(IMP179Reregister)
tests.Push(IMP179NativePaint)
     tests.Push(V763QueueCommittedJournalFailure,IAF187EmptyRefresh,IAF187FilteredRefresh)
    tests.Push(V210KeybindDefaults,V210KeybindValidation,V210KeybindStorage,V210KeybindRegistry,V210KeybindRollback,V210KeybindUI,V210KeybindExtensions,V104KeybindPublic)
    tests.Push(I96VoiceScheduler,I96VoiceWorker,I96VoiceOptions,I220AlarmLifecycle,I220AlarmWorker,I220ImportedAudio,I220AudioEditor)
   tests.Push(I221MasterPlan,I221MasterPreferences,I221MasterImport,I221MasterFailure)
   tests.Push(I224ExclusionPersistence,I224ExclusionMaster,I224ExclusionCountdown,I224ExclusionAlarm,I224ExclusionEditor,I224ExclusionFailure)
   tests.Push(I226ModePersistence,I226IndividualCountdown,I226IndividualAlarm,I226IndividualMaster,I226IndividualEditor,I226IndividualFailure,I226IndividualImport)
   tests.Push(I227BundledClips,I227VoiceOverrides,I227FolderSelection,I227BundledPreferences,I227BundledOptions)
   tests.Push(I228SearchFiltering,I228SearchIdentity,I228SearchIsolation)
   tests.Push(V231OverlayGrid)
   tests.Push(V236SnapGuides)
    tests.Push(I106AudioOptIn)
    tests.Push(V237IPGrenadeSequence,V237IPGrenadeGuards,V237IPGrenadeLibrary,V237IPGrenadeArchive)
    tests.Push(V239IPBombDeadlines,V239IPBombDeadlineGuards)
    tests.Push(V240KephessBoundaries)
    tests.Push(V243IPCPFeedback,V243IPCPFourthSet,V243IPCPNativeColor)
    tests.Push(I246RatingMath,I246RatingFight)
    tests.Push(V247IPCPIncomplete)
    tests.Push(V249IPCleanse)
    tests.Push(V252IPCPStackDeaths)
    tests.Push(V253IPCPExposureDeaths)
    tests.Push(V254IPCPGrenadeSplash)
    for index,test in tests {
         IrisTestJournalWrite(path,"RUN " index "/" tests.Length " " test.Name "`r`n")
         began := IrisTestNow()
         try {
             test.Call()
             line := "PASS " test.Name " | " (IrisTestNow()-began) " ms`r`n"
         }
         catch Error as err {
             failed += 1
             message := StrReplace(StrReplace(err.Message,"`r"," "),"`n"," / ")
             line := "FAIL " test.Name ": " message " (line " err.Line ") | " (IrisTestNow()-began) " ms`r`n"
         }
         IrisTestJournalWrite(path,line)
     }
     report := "Assertions executed: " V48Checks " | Failed scenarios: " failed "`r`n"
     report .= "These tests do not test Windows audio, Kenku, physical keys, or an actual SWTOR raid.`r`n"
     report .= "Groups completed: " tests.Length "/" tests.Length " | Suite elapsed: " Format("{:.2f}",(IrisTestNow()-suiteStart)/1000) " s`r`n"
     report .= "IRIS-V48-TESTS-COMPLETE`r`n"
     IrisTestJournalWrite(path,report)
     ; The parent UI displays the UTF-8 report. No child message box or audio.
     ExitApp(failed ? 1 : 0)
 }
 ; v49 test source: embedded as comment data in the delivered runtime.
 V49Setup(phase := 1)
 {
     global NBRebounder, NBRebounderOptions, NBRebounderRecordings, NBCandle, NBOrder
     global Roster, testClock, logReadBusy, inLogDispatch, BridgeTextById
     V48Setup(phase)
     logReadBusy := false, inLogDispatch := false
     NBRebounder := NewNBRebounderState(NBCandle.Generation)
     NBRebounderOptions := {Enabled: true, P1: true, P3: true, Burn: true, Opener: false,
         TankReminders: false, TankFallback: true, DoubleCloseDPS: true, DoubleFarDPS: true,
         FifthDPS: true, Cooldown: 35, ReturnRadius: 30, PositionAge: 3}
     NBRebounderRecordings := Map()
     for actor, m in Roster.Members {
         m.DisciplineName := m.Role = "Tank" ? "Darkness" : (m.Role = "DPS" ? "Pyrotech" : "Corruption")
         m.DisciplineId := ""
         NBRebounder.Observed[actor] := 0
     }
     NBRebounder.Instance := NBCandle.BossInstance
     NBRebounder.Config := NBOrderConfigKey()
     NBRebounder.Started := true
     NBRebounder.LiveAt := testClock, NBRebounder.LiveTick := testClock
     NBRebounder.Target := V48Actor("Tank1"), NBRebounder.TargetAt := testClock
     NBCandle.Target := NBRebounder.Target, NBCandle.TargetAt := testClock
     NBCandle.Burn := phase = 4
     NBRebounderEnterPhase(phase, testClock, true, "synthetic phase")
     BridgeTextById := BuildDefaultBridgePhrases()
 }
 
 V49Boss()
 {
     return "NAHUT {4122949560827904}:999|(0,0,0,0)|(900/1000)"
 }
 
 V49Feed(at, source, target, ability, action, effect, tail := "", live := true)
 {
     global CurrentRecord, NBRebounder
     V48Time(at)
     stamp := Format("{:02d}:{:02d}:{:02d}.{:03d}", Floor(at/3600000), Mod(Floor(at/60000),60), Mod(Floor(at/1000),60), Mod(at,1000))
     line := "[" stamp "] [" source "] [" target "] [x {" ability "}] [x {" action "}: x {" effect "}]" tail
     CurrentRecord := {Line: line, At: at, Age: 0, ReadTick: at, Allow: live}
     TrackNBCandle(line, live)
     SafeTrackNBOrder(line, live)
     SafeTrackNBRebounder(line, live)
     CurrentRecord := ""
     V48Assert(!NBRebounder.Suspended, "Rebounder parser remained active: " NBRebounder.Status)
     return line
 }
 
 V49Slice(at, cloak := false, emptySource := false)
 {
     V49Feed(at-1, V49Boss(), V48Field("Tank1"), "0", "836045448945472", "836045448953668")
     V49Feed(at, V49Boss(), "=", "4137075708264448", "836045448945472", "836045448945479")
     if cloak {
         V49Feed(at+499, V49Boss(), V48Field("Tank2"), "0", "836045448945472", "836045448953668")
         V49Feed(at+500, V48Field("Tank1"), "=", "2271329029980518", "836045448945472", "836045448945479")
         return V49Feed(at+501, V49Boss(), "", "4137075708264448", "836045448945472", "836045448945482")
     }
     return V49Feed(at+1000, emptySource ? "" : V49Boss(), V48Field("Tank1"), "4137075708264448", "836045448945477", "836045448945501", " (0 -resist {836045448945507}) <1.0>")
 }
 
 V49Use(at, slot := "DoubleCloseDPS", live := true)
 {
     return V49Feed(at, V48Field(slot), "=", "880189122805760", "836045448945472", "836045448945479", "", live)
 }
 
 V49Gravity(at)
 {
     return V49Feed(at, "Singularity Chamber {4122580193640448}:998|(0,0,0,0)|(1000/1000)", V48Field("Tank1"),
         "4133502295474176", "836045448945477", "4133502295474475")
 }
 
 V49TestP1FixedAndSkips()
 {
     global NBRebounder, Audio
     V49Setup()
     V49Use(100100)
     V49Slice(101000)
     V48Assert(NBRebounder.Pending.Number = 1 && NBRebounder.Pending.Slot = "DoubleCloseDPS", "P1 #0 -> close #1")
     PollNBRebounder()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].NRData.Choice.Slot = "DoubleCloseDPS", "P1 readiness assumed despite recent use")
     V49Slice(140000)
     V48Assert(NBRebounder.Pending.Number = 2 && NBRebounder.Pending.Slot = "DoubleFarDPS", "P1 #1 -> far #2")
     V49Feed(150000, V49Boss(), "=", "4182177159839744", "836045448945472", "836045448945479")
     V48Assert(NBRebounder.P1Next = 3 && NBRebounder.Pending.Number = 3, "Reseed skips #2 without renumbering #3")
     V49Slice(168000)
     V48Assert(NBRebounder.Pending.Number = 4 && NBRebounder.Pending.Slot = "DoubleFarDPS", "P1 #3 -> far #4")
     V49Feed(169001,"Power Coupling {4131870207901696}:888|(0,0,0,0)|(100/100)",V48Field("Tank1"),"0","836045448945472","836045448953668")
     V48Assert(NBRebounder.Phase = 2 && !IsObject(NBRebounder.Pending), "P2 cancels optional #4")
 }
 
 V49TestReseedDuringOldCast()
 {
     global NBRebounder
     V49Setup()
     NBRebounder.P1Next := 2
     V49Feed(101000,V49Boss(),"=","4137075708264448","836045448945472","836045448945479")
     V49Feed(101100,V49Boss(),"=","4182177159839744","836045448945472","836045448945479")
     V49Feed(102000,V49Boss(),V48Field("Tank1"),"4137075708264448","836045448945477","836045448945501"," (0 -)")
     V48Assert(NBRebounder.P1Next = 3 && NBRebounder.Pending.Number = 3, "late pre-Reseed outcome cannot consume post-Reseed #3")
 }
 
 V49TestP2SilentAndOpener()
 {
     global NBRebounder, NBOrder, Audio
     V49Setup(2)
     V49Use(100500,"DoubleFarDPS")
     PollNBRebounder()
     V48Assert(Audio.Queue.Length = 0, "P2 does not speak Rebounders")
     used := NBRebounder.Uses[V48Actor("DoubleFarDPS")]
     NBOrderSetPhase(3,101000,"synthetic completed Double-far reveal")
     V49Feed(101001,V49Boss(),V48Field("Tank1"),"0","836045448945472","836045448953668")
     PollNBRebounder()
     V48Assert(NBRebounder.Phase = 3 && NBRebounder.Pending.Number = 1, "P3 starts numbering at #1")
     V48Assert(NBRebounder.Pending.Choice.Slot = "DoubleFarDPS", "P3 opener assigns Double far even with paired reveal duty")
     V48Assert(NBRebounder.Uses[V48Actor("DoubleFarDPS")] = used, "phase change preserves uses")
     V49Setup(2)
     V49Feed(101000,"",V48Field("Tank1"),"4137075708264448","836045448945477","836045448945501"," (0 -)")
     V48Assert(NBRebounder.Phase = 3 && NBRebounder.P3Count = 1, "P3 counter recovers a first empty-source tank outcome without a late opener call")
 }
 
 V49TestP3Numbering()
 {
     global NBRebounder, Audio
     V49Setup(3)
     Loop 8 {
         i := A_Index
         V49Slice(101000+(i-1)*13000, i = 7)
         next := i+1
         V48Assert(NBRebounder.P3Count = i, "P3 handled counter includes stealthed #7")
         V48Assert(NBRebounder.Pending.Number = next, "advance assignment is for following P3 Slice")
         expected := next = 4 || next = 7 ? "Next" : "Mit"
         V48Assert(NBRebounder.Pending.Kind = expected, "P3 fixed coverage/mitigation pattern")
         if expected = "Next"
             V48Assert(NBRebounder.Pending.Slot = "FifthDPS", "only Fifth assigned #4/#7")
     }
 }
 
 V49TestFifthAdvanceWhileCooling()
 {
     global NBRebounder, Audio
     V49Setup(3)
     NBRebounder.P3Count := 5
     V49Use(101000,"FifthDPS")
     V49Slice(125000)
     PollNBRebounder()
     V48Assert(!NBRebounderReady(V48Actor("FifthDPS"),126000), "Fifth still cooling when #7 advance warning is made")
     V48Assert(NBRebounder.Pending.Choice.Slot = "FifthDPS", "fixed #7 is still called in advance")
 }
 
 V49TestCloseReturn()
 {
     global NBRebounder, Audio, NBCandle
     V49Setup(3)
     NBRebounder.P3Count := 7
     V49Slice(101000)
     V48Assert(NBRebounder.Pending.Kind = "Mit", "initial proximity is not a proved return")
     V49Setup(3)
     NBRebounder.P3Count := 7
     NBRebounder.CloseAway := true
     V49Slice(101000)
     V48Assert(NBRebounder.Pending.Kind = "LateClose" && NBRebounder.Pending.Number = 9, "return then handled #8 assigns #9")
     PollNBRebounder()
     V48Assert(NBRebounder.Pending.Choice.Slot = "DoubleCloseDPS", "late return picks only close")
     V49Slice(114000)
     V48Assert(NBRebounder.Pending.Kind = "Mit", "no automatic consecutive close use; #10 is mitigation")
     V49Setup(3)
     NBRebounder.P3Count := 7, NBRebounder.CloseAway := true
     NBCandle.Players[V48Actor("DoubleCloseDPS")].Pos.X := 80
     V49Slice(101000)
     V48Assert(NBRebounder.Pending.Kind = "Mit", "distant close not assigned")
     NBCandle.Players[V48Actor("DoubleCloseDPS")].Pos.X := 0
     V49Slice(114000)
     V48Assert(NBRebounder.Pending.Kind = "LateClose" && NBRebounder.Pending.Number = 10, "later return assigns #10, not a fixed return number")
 }
 
 V49TestBurnPriority()
 {
     global NBRebounder, NBCandle, Roster
     V49Setup(4)
     now := 100000
     for actor, p in NBCandle.Players
         p.Battery := 0
     c := NBRebounderChooseBurn(now)
     V48Assert(c.Slot = "DoubleCloseDPS", "burn close first")
     close := V48Actor("DoubleCloseDPS"), far := V48Actor("DoubleFarDPS"), fifth := V48Actor("FifthDPS")
     NBCandle.Holder := close, NBCandle.HolderAt := now
     V48Assert(NBRebounderChooseBurn(now).Slot = "DoubleFarDPS", "complete nonrevealer search beats revealing close")
     NBRebounder.Uses[far] := now, NBRebounder.Uses[fifth] := now
     V48Assert(NBRebounderChooseBurn(now).Slot = "DoubleCloseDPS", "revealer fallback only after whole first pass fails")
     NBRebounder.Uses[close] := now
     V48Assert(NBRebounderChooseBurn(now).Kind = "Shroud", "no ready PT -> current sin tank Shroud")
     Roster.Members[V48Actor("Tank1")].DisciplineName := "Shield Tech"
     V48Assert(NBRebounderChooseBurn(now).Kind = "EP", "current PT tank gets Emergency Power")
     NBRebounder.Target := ""
     V48Assert(!IsObject(NBRebounderChooseBurn(now)), "unknown boss tank never guessed")
 }
 
 V49TestBurnPriorityCombinations()
 {
     global NBRebounder, NBCandle
     V49Setup(4)
     slots := ["DoubleCloseDPS","DoubleFarDPS","FifthDPS"]
     Loop 8 {
         available := A_Index-1
         Loop 8 {
             busy := A_Index-1
             for i, slot in slots {
                 a := V48Actor(slot)
                 NBRebounder.Uses[a] := available & (1 << (i-1)) ? 0 : 100000
                 NBCandle.Players[a].CastUntil := busy & (1 << (i-1)) ? 101000 : -1
             }
             wanted := "Tank1"
             for allowBusy in [false,true] {
                 for i, slot in slots {
                     if (available & (1 << (i-1))) && (allowBusy || !(busy & (1 << (i-1)))) {
                         wanted := slot
                         break
                     }
                 }
                 if wanted != "Tank1"
                     break
             }
             V48Assert(NBRebounderChooseBurn(100000).Slot = wanted, "burn readiness/reveal mask " available "/" busy)
         }
     }
 }
 
 V49TestQuietUseTracking()
 {
     global NBRebounder, NBRebounderOptions, autoBossCalloutsEnabled, Audio
     V49Setup(2)
     NBRebounderOptions.Enabled := false, autoBossCalloutsEnabled := false
     V49Use(101000,"DoubleCloseDPS",false)
     V49Feed(101001,V48Field("DoubleFarDPS"),"=","880189122805760","836045448945477","880189122806067","",false)
     V48Assert(NBRebounder.Uses.Has(V48Actor("DoubleCloseDPS")), "muted/history actual activation recorded")
     V48Assert(!NBRebounder.Uses.Has(V48Actor("DoubleFarDPS")), "buff recipient did not spend a cooldown")
     V48Assert(Audio.Queue.Length = 0, "quiet tracking produces no audio")
     V48Assert(!NBRebounderReady(V48Actor("DoubleCloseDPS"),135999), "35s not ready 1ms early")
     V48Assert(NBRebounderReady(V48Actor("DoubleCloseDPS"),136000), "35s exact boundary ready")
 }
 
 V49TestCloakDedupAndReversed()
 {
     global NBRebounder
     V49Setup(3)
     line := V49Slice(101000,true)
     count := NBRebounder.P3Count
     SafeTrackNBRebounder(line,true)
     V48Assert(count = 1 && NBRebounder.P3Count = 1, "cloak plus repeated interrupt counts once")
     V49Setup(3)
     V49Feed(101000,V49Boss(),V48Field("Tank1"),"0","836045448945472","836045448953668")
     V49Feed(101001,V49Boss(),"=","4137075708264448","836045448945472","836045448945479")
     V49Feed(101501,V49Boss(),"","4137075708264448","836045448945472","836045448945482")
     V48Assert(NBRebounder.P3Count = 0, "unexplained interrupt alone not promoted to DCD handling")
     V49Feed(101501,V48Field("Tank1"),"=","2271329029980518","836045448945472","836045448945479")
     V48Assert(NBRebounder.P3Count = 1, "reversed same-time cloak/interrupt records correlate")
 }
 
 V49TestTransitionThenGravity()
 {
     global NBRebounder, NBCandle
     V49Setup(3)
     V49Feed(110000,V49Boss(),"=","4133047028940800","836045448945472","836045448945479")
     V49Slice(111000)
     V48Assert(!NBRebounder.BurnReady && !NBCandle.Burn, "transition candidate/outcome does not manufacture P4")
     V49Gravity(115000)
     V48Assert(NBRebounder.BurnReady && NBRebounder.Pending.Kind = "Burn", "earlier handled transition plus P4 opens following assignment")
     old := NBRebounder.Pending.After
     V49Slice(123000)
     V48Assert(NBRebounder.Pending.Kind = "Burn" && NBRebounder.Pending.After > old, "later burn outcomes keep creating assignments")
 }
 
 V49TestGravityBeforeTransitionEnd()
 {
     global NBRebounder
     V49Setup(3)
     V49Feed(110000,V49Boss(),"=","4133047028940800","836045448945472","836045448945479")
     V49Feed(110001,V49Boss(),V48Field("Tank1"),"0","836045448945472","836045448953668")
     V49Feed(111000,V49Boss(),"=","4137075708264448","836045448945472","836045448945479")
     V49Gravity(111200)
     V48Assert(!NBRebounder.BurnReady && IsObject(NBRebounder.Active), "P4 marker retains active transition cast")
     V49Feed(112000,V49Boss(),V48Field("Tank1"),"4137075708264448","836045448945477","836045448945501"," (0 -)")
     V48Assert(NBRebounder.BurnReady && NBRebounder.Pending.Kind = "Burn", "no extra skipped Slice from reversed transition event order")
 }
 
 V49TestMissingTransitionMarker()
 {
     global NBRebounder
     V49Setup(3)
     V49Gravity(110000)
     V48Assert(!NBRebounder.BurnReady && !IsObject(NBRebounder.Pending), "burn flag alone never assigns")
     V49Slice(111000,true)
     V48Assert(NBRebounder.BurnReady, "first post-marker handled Slice covers conservative missing-marker transition")
 }
 
 V49TestNoDoubleAssignmentOnUse()
 {
     global NBRebounder, Audio
     V49Setup(4)
     NBRebounder.BurnReady := true
     V49Slice(101000)
     PollNBRebounder()
     ticket := NBRebounder.Ticket, chosen := NBRebounder.Pending.Choice.Actor
     V49Use(105000)
     PollNBRebounder()
     V48Assert(NBRebounder.Ticket = ticket && NBRebounder.Pending.Choice.Actor = chosen, "assigned use does not select a second PT")
     V48Assert(Audio.Queue.Length = 1, "only one queued assignment per opportunity")
 }
 
 V49TestAudioExpiryAndMute()
 {
     global NBRebounder, Audio, soundboardsEnabled
     V49Setup(3)
     V49Slice(101000)
     NBRebounderOffer("Next","FifthDPS",4,102000,true,"test warning")
     PollNBRebounder()
     item := Audio.Queue[1]
     V48Time(106000)
     V48Assert(!NBRebounderAudioItemEnabled(item), "expired queue entry cannot start late")
     V49Setup()
     soundboardsEnabled := false
     V49Slice(101000)
     soundboardsEnabled := true
     PollNBRebounder()
     V48Assert(Audio.Queue.Length = 0, "unmuting does not replay an old assignment")
 }
 
 V49TestMissingOutcomeAndEmptySource()
 {
     global NBRebounder
     V49Setup(3)
     V49Slice(101000,false,true)
     V48Assert(NBRebounder.P3Count = 1, "known-context empty-source outcome counts")
     V49Feed(113000,V49Boss(),"=","4137075708264448","836045448945472","836045448945479")
     V49Feed(126000,V49Boss(),"=","4137075708264448","836045448945472","836045448945479")
     V48Assert(!NBRebounder.P3Synced, "unresolved prior Slice pauses unsafe numbered calls rather than guessing")
     V49Setup()
     V49Feed(101000,V49Boss(),"=","4137075708264448","836045448945472","836045448945479")
     V49Feed(114000,V49Boss(),"=","4137075708264448","836045448945472","836045448945479")
     V48Assert(!NBRebounder.P1Synced, "unresolved P1 Slice pauses fixed calls")
     V49Feed(120000,V49Boss(),"=","4182177159839744","836045448945472","836045448945479")
     V48Assert(NBRebounder.P1Synced && NBRebounder.P1Next = 3, "Reseed independently restores the known #3 slot")
 }
 
 V49TestResetAndStaleReturn()
 {
     global NBRebounder, NBCandle
     V49Setup(3)
     V49Use(101000)
     V48Time(105000,false)
     NBRebounder.TargetAt := 105000
     V48Assert(NBRebounderCloseDistance(105000) < 0, "stale coordinates do not prove close returned")
     before := NBRebounder.Uses[V48Actor("DoubleCloseDPS")]
     NBRebounderEnterPhase(4,105000,false,"synthetic phase")
     V48Assert(NBRebounder.Uses[V48Actor("DoubleCloseDPS")] = before, "burn handover preserves actual uses")
     ResetNBCandleState("synthetic new pull")
     V48Assert(NBRebounder.Phase = 0 && NBRebounder.Uses.Count = 0, "real encounter reset clears rebounder ledger")
 }
 
 V49TestPayloadsAndPreviewIsolation()
 {
     global NBRebounder, NBRebounderRecordings, AUDIO_MODE_KENKU_BRIDGE_TTS, AUDIO_MODE_KENKU_SOUNDBOARD
     V49Setup()
     for key in NBRebounderRecordKeys() {
         p := NBRebounderPreviewPayload({Key:key,Label:key},"Test",AUDIO_MODE_KENKU_BRIDGE_TTS)
         V48Assert(p.Ok && p.Phrase != "", "TTS preview resolves " key)
     }
     p := NBRebounderPreviewPayload({Key:"Next|FifthDPS",Label:"Fifth"},"Test",AUDIO_MODE_KENKU_SOUNDBOARD)
     V48Assert(!p.Ok, "recording route never silently switches to TTS")
     V48Assert(NBRebounder.P1Next = 0 && NBRebounder.Uses.Count = 0, "preview does not advance gameplay or spend cooldown")
 }
 ; v49.1 burn pass speech regressions. Extracted only by the manual Run button.
 V491Setup()
 {
     global NBCandleOptions, NBNextSoundIds, Audio
     V49Setup(4)
     NBCandleOptions.NextEnabled := true, NBCandleOptions.NoneEnabled := true, NBCandleOptions.Radius := 30
     NBNextSoundIds := Map()
     V48Pass("Tank2", 100100)
     Audio.Queue := []
 }
 
 V491TestBurnDirectedPhrase()
 {
     global NBCandle, Audio, BridgeTextById
     V491Setup(), PollNBCandle()
     V48Assert(Audio.Queue.Length = 1, "burn pass is queued once")
     item := Audio.Queue[1]
     V48Assert(item.Phrase = "Tank2, pass to Mara.", "burn uses holder-to-recipient wording")
     V48Assert(item.SoundId = "NAHUT_ORDER_PASS", "burn reuses P1-P3 phrase key")
     V48Assert(NBCandle.Choice.Slot = "Mara", "wording does not change burn priority")
     BridgeTextById["NAHUT_CANDLE_NEXT"] := "Old recipient-only edit: {Name}."
     BridgeTextById["NAHUT_ORDER_PASS"] := "{Actual}, candle to {Name}."
     V48Assert(RefreshNBCandleAudioItem(item), "pending directed phrase can be refreshed")
     V48Assert(item.Phrase = "Tank2, candle to Mara.", "same saved P1-P3 customization is used")
 }
 
 V491TestUnknownHolderFallback()
 {
     global NBCandle, Audio, testClock
     V491Setup()
     NBCandle.Holder := "" ; LastHolder is deliberately still Tank2; do not guess.
     PollNBCandle()
     V48Assert(Audio.Queue.Length = 1, "unknown holder retains one recipient fallback")
     old := Audio.Queue[1]
     V48Assert(old.Phrase = "Mara, candle next.", "fallback does not name the former holder")
     V48Assert(old.NBData.Instruction.Kind = "Next", "fallback explicitly records unknown holder")
     V48Pass("Tank1", 100200)
     V48Assert(!NBCandleAudioItemEnabled(old), "new holder invalidates queued fallback")
     PollNBCandle()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Phrase = "Tank1, pass to Mara.", "new holder gets the directed call")
 }
 
 V491TestSelfPassSuppressed()
 {
     global NBCandle, Audio
     V491Setup(), V48Pass("Mara", 100200), PollNBCandle()
     V48Assert(IsObject(NBCandle.Choice) && NBCandle.Choice.Slot = "Mara", "eligible holder remains selected")
     V48Assert(Audio.Queue.Length = 0, "no pass-to-self or reveal-now announcement")
     V48Assert(NBCandle.Step = 0 && NBCandle.Players[V48Actor("Mara")].LastUse = -1, "holding does not invent a use")
     V48Time(102300), PollNBCandle()
     V48Assert(Audio.Queue.Length = 0, "correct holder remains quiet on later polls")
     V48Use("Mara", 103000, true), PollNBCandle()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Phrase = "Mara, pass to DoubleCloseDPS.", "real use advances and names existing holder")
 }
 
 V491TestCorrectReceiptCancelsPass()
 {
     global NBCandle, Audio
     V491Setup(), PollNBCandle()
     old := Audio.Queue[1], step := NBCandle.Step
     V48Pass("Mara", 100200)
     V48Assert(Audio.Queue.Length = 0, "correct receipt immediately cancels pending pass speech")
     V48Assert(!NBCandleAudioItemEnabled(old), "old instruction cannot play after delivery of candle")
     V48Assert(!RefreshNBCandleAudioItem(old), "dispatch refresh also rejects fulfilled pass")
     V48Assert(NBCandle.Step = step, "receipt does not advance reveal use counter")
     PollNBCandle()
     V48Assert(Audio.Queue.Length = 0, "receipt does not produce another next call")
 }
 
 V491TestChangedHolderRetiresSpeech()
 {
     global NBCandle, Audio, testClock, NahutAssignments
     V491Setup(), PollNBCandle()
     old := Audio.Queue.RemoveAt(1)
     NBCandleSubmitted(old)
     V48Assert(NBCandle.Delivery.Accepted && !NBCandle.Choice.Delivered, "submitted initial call is accepted, not completed")
     actor := NBCandle.Choice.Actor, ticket := NBCandle.Ticket
     V48Time(100200)
     ObserveNBCandlePass(V48Actor("Tank2"), testClock, "836045448945478")
     V48Assert(!NBCandleInstructionMatches(old.NBData, testClock), "holder removal invalidates addressed speech immediately")
     PollNBCandle()
     V48Assert(NBCandle.Choice.Actor = actor && NBCandle.Ticket > ticket, "speech changes without repicking eligible recipient")
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Phrase = "Mara, candle next.", "unknown holder uses fallback after removal")
     V48Pass("Tank1", 100300), PollNBCandle()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Phrase = "Tank1, pass to Mara.", "replacement instruction names actual new holder")
     V48Assert(NBCandle.Step = 0, "holder changes preserve reveal counter")
     old := Audio.Queue.RemoveAt(1)
     NBCandleSubmitted(old)
     NahutAssignments["Tank1"] := "TANK1"
     V48Assert(!NBCandleAudioItemEnabled(old), "holder nickname changes invalidate addressed speech")
     PollNBCandle()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Phrase == "TANK1, pass to Mara.", "case-only holder nickname edits refresh submitted wording")
 }
 
 V491TestBurnEligibilityPreserved()
 {
     global NBCandle, Audio
     V491Setup()
     for actor, p in NBCandle.Players
         p.Battery := 0
     NBCandle.Players[V48Actor("Mara")].Battery := 1
     NBCandle.Players[V48Actor("Mara")].Pos.X := 60
     NBCandle.Players[V48Actor("Healer1")].Battery := 1
     PollNBCandle()
     V48Assert(NBCandle.Choice.Slot = "Healer1", "in-range healer still beats distant Mara")
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Phrase = "Tank2, pass to Healer1.", "directed call uses eligible in-range recipient")
     NBCandle.Players[V48Actor("Healer1")].Battery := 0
     V48Time(102300), PollNBCandle()
     V48Assert(NBCandle.Choice.Slot = "Mara" && NBCandle.Choice.RangeFallback, "full failed in-range search still enables fallback")
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Phrase = "Tank2, pass to Mara.", "range fallback also uses directed wording")
     NBCandle.Players[V48Actor("Mara")].Battery := 0
     V48Time(104500), PollNBCandle()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Phrase = "No eligible candle player.", "none warning is unchanged")
 }
 
 V491TestDirectedRecordingReuse()
 {
     global NBOrderRecordings, NBNextSoundIds, testClock
     V491Setup()
     candidate := PickNBCandle(testClock), want := NBCandleDesired(candidate, testClock)
     directedId := "11111111-1111-1111-1111-111111111111"
     legacyId := "22222222-2222-2222-2222-222222222222"
     NBOrderRecordings["Pass|Tank2|Mara"] := directedId
     NBNextSoundIds["Mara"] := legacyId
     p := NBCandlePayload("NahutCandleNext", candidate.Name, candidate.Slot, "KenkuSoundboard", want)
     V48Assert(p.Id = directedId && p.Phrase = "Tank2, pass to Mara.", "configured P1-P3 pair recording is reused")
     NBOrderRecordings.Delete("Pass|Tank2|Mara")
     p := NBCandlePayload("NahutCandleNext", candidate.Name, candidate.Slot, "KenkuSoundboard", want)
     V48Assert(p.Id = legacyId && p.Phrase = "Mara, candle next.", "legacy recipient recording survives missing pair")
     V48Assert(NBNextSoundIds["Mara"] = legacyId, "reading payload never overwrites recording settings")
 }
 
 V491TestBurnPreviewIsolation()
 {
     global NBCandle, Audio, AUDIO_MODE_KENKU_BRIDGE_TTS
     V491Setup()
     holder := NBCandle.Holder, ticket := NBCandle.Ticket, step := NBCandle.Step
     for slot in NBCandlePriority() {
         p := NBCandlePreviewPayload({Key: slot, Label: "preview"}, "", AUDIO_MODE_KENKU_BRIDGE_TTS)
         from := slot = "Tank1" ? "Tank2" : "Tank1"
         V48Assert(p.Ok && p.Phrase = from ", pass to " slot ".", "burn preview uses a different sample holder for " slot)
     }
     V48Assert(NBCandle.Holder = holder && NBCandle.Ticket = ticket && NBCandle.Step = step, "preview leaves real holder, ticket and use history alone")
     V48Assert(Audio.Queue.Length = 0 && !IsObject(NBCandle.Choice), "preview payload does not queue a live assignment")
 }
 
 V491TestBurnPassSwitches()
 {
     global NBCandleOptions, Audio
     V491Setup()
     NBCandleOptions.Enabled := false
     PollNBCandle()
     V48Assert(Audio.Queue.Length = 0, "burn master off remains silent")
     NBCandleOptions.Enabled := true, NBCandleOptions.NextEnabled := false
     PollNBCandle()
     V48Assert(Audio.Queue.Length = 0, "next/pass switch off remains silent")
     NBCandleOptions.NextEnabled := true
     V48Time(102300), PollNBCandle()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Phrase = "Tank2, pass to Mara.", "re-enabled pass uses new wording")
 }
 
 ; v49.2: manual A&E handoff regressions. Only the isolated Run-button child executes these.
 V492Setup()
 {
     global AEStacks, AEStackDefinitions, AE_MASTER_ENABLED, activeBoss, AE_PROFILE_NAME
     global Roster, inLogDispatch, logReadBusy, dispatchAudioAllowed, Audio
     V48Setup(0)
     AEStackDefinitions := BuildAEStackDefinitions()
     AE_MASTER_ENABLED := true
     activeBoss := AE_PROFILE_NAME
     AEStacks := NewAEStackState(AEStacks.Generation + 1)
     inLogDispatch := false, logReadBusy := false, dispatchAudioAllowed := true
     for slot in ["Mara", "DoubleCloseDPS", "DoubleFarDPS", "FifthDPS", "Healer1", "Tank1"]
         V48Assert(Roster.Members.Has(V48Actor(slot)), "A&E regression roster contains " slot)
 }
 
 V492Nexus(instance := "49201")
 {
     return "Nexus {4101564918661120}:" instance "|(486,2790.5,317.41,0)|(2374632/7131026)"
 }
 
 V492Line(at, source, target, ability, action, effect, tail := "")
 {
     stamp := Format("{:02d}:{:02d}:{:02d}.{:03d}", Floor(at/3600000), Mod(Floor(at/60000),60), Mod(Floor(at/1000),60), Mod(at,1000))
     return "[" stamp "] [" source "] [" target "] [x {" ability "}] [x {" action "}: x {" effect "}]" tail
 }
 
 V492Feed(line, emit := true)
 {
     global testClock, CurrentRecord, Roster
     at := LogStampMs(line)
     testClock := at, Roster.ContextAt := at
     CurrentRecord := {Line: line, At: at, Age: 0, ReadTick: at, Allow: emit}
     try
         return TrackAEStacks(line, emit)
     finally
         CurrentRecord := ""
 }
 
 V492Start(at, instance := "49201", emit := true)
 {
     return V492Feed(V492Line(at, V492Nexus(instance), "=", "4111769760956416", "836045448945472", "836045448945479"), emit)
 }
 
 V492Stacks(at, slot, count, apply := false, emit := true, instance := "49201")
 {
     action := count < 0 ? "836045448945478" : (apply ? "836045448945477" : "836045448953666")
     tail := count < 0 ? "" : " (" count " charges {836045448953667})"
     return V492Feed(V492Line(at, V492Nexus(instance), V48Field(slot), "4111769760956416", action, "4111769760956750", tail), emit)
 }
 
 V492Opening(emit := true)
 {
     V492Start(100000, "49201", emit)
     V492Stacks(101000, "Mara", 1, true, emit)
     V492Stacks(101001, "DoubleCloseDPS", 1, true, emit)
     V492Stacks(123000, "Mara", 23, false, emit)
     V492Stacks(124000, "Mara", 24, false, emit)
 }
 
 V492TestOpeningOnly()
 {
     global Audio, AEStacks
     V492Setup(), V492Opening()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Phrase = "2nd dps soak now.", "opening 24-stack handoff remains at 24")
     V492Stacks(124001, "DoubleCloseDPS", 24)
     V48Assert(Audio.Queue.Length = 1, "two opening-side 24 records produce one shared call")
     V492Start(132500)
     V48Assert(AEStacks.Soak.Called && !AEStacks.Soak.HandoffOpen, "recast preserves consumed handoff and closes speech window")
     V48Assert(Audio.Queue.Length = 0, "second channel retires unplayed first handoff")
     V492Stacks(133500, "FifthDPS", 1, true)
     V492Stacks(133501, "DoubleFarDPS", 1, true)
     V492Stacks(156500, "FifthDPS", 24)
     V492Stacks(156501, "DoubleFarDPS", 24)
     V48Assert(Audio.Queue.Length = 0, "second DPS reaching 24 never asks second DPS to soak again")
     V48Assert(AEStackCount(V48Actor("FifthDPS"), "4111769760956750") = 24, "later group stacks remain tracked")
     V492Start(165000), V492Stacks(189000, "Mara", 25)
     V48Assert(Audio.Queue.Length = 0 && AEStacks.Soak.Channel = 3, "third channel cannot reopen second-group instruction")
 }
 
 V492TestNoLateFirstWarning()
 {
     global Audio, AEStacks
     V492Setup(), V492Start(100000)
     V492Stacks(101000, "Mara", 1, true), V492Stacks(120000, "Mara", 20)
     V492Start(132500), V492Stacks(133500, "FifthDPS", 1, true)
     V492Stacks(156500, "FifthDPS", 24)
     V48Assert(!AEStacks.Soak.Called && !AEStacks.Soak.HandoffOpen, "missing first threshold does not move its warning to later group")
     V48Assert(Audio.Queue.Length = 0, "late group stays silent even if first group never reached 24")
 }
 
 V492TestQueuedAndActiveRetired()
 {
     global Audio
     V492Setup(), V492Opening()
     item := Audio.Queue.RemoveAt(1)
     V48Assert(AEStackAudioItemEnabled(item), "opening handoff is initially valid")
     Audio.Current := item
     V492Start(132500)
     V48Assert(item.Cancel && !AEStackAudioItemEnabled(item), "second channel requests stop of obsolete current speech")
     V48Assert(!RefreshAEStackAudioItem(item), "obsolete handoff fails pre-playback validation")
     Audio.Current := ""
 }
 
 V492TestTakeoverWithoutRecast()
 {
     global Audio, AEStacks
     V492Setup(), V492Opening()
     item := Audio.Queue[1]
     V492Stacks(125000, "FifthDPS", 1, true)
     V48Assert(!AEStacks.Soak.HandoffOpen && AEStacks.Soak.ClosedAt = 125000, "new DPS after opening pair closes handoff when cast is missing")
     V48Assert(Audio.Queue.Length = 0 && !AEStackAudioItemEnabled(item), "takeover removes queued instruction and invalidates detached copy")
     V492Stacks(148000, "FifthDPS", 24)
     V48Assert(Audio.Queue.Length = 0, "replacement 24 stacks do not rearm same-channel handoff")
     V492Setup(), V492Start(100000)
     V492Stacks(101000, "Mara", 1, true), V492Stacks(101001, "DoubleCloseDPS", 1, true)
     V492Stacks(120000, "Mara", 20), V492Stacks(121000, "FifthDPS", 1, true)
     V492Stacks(124000, "Mara", 24)
     V48Assert(Audio.Queue.Length = 0, "already-started replacement prevents even a delayed opening threshold call")
 }
 
 V492TestMutedAndHydrated()
 {
     global Audio, AEStacks, AE_MASTER_ENABLED, AEStackDefinitions
     V492Setup(), V492Opening(false)
     V48Assert(AEStacks.Soak.Called && Audio.Queue.Length = 0, "silent hydration consumes opening threshold without speech")
     V492Start(132500), V492Stacks(133500, "FifthDPS", 1, true), V492Stacks(156500, "FifthDPS", 24)
     V48Assert(Audio.Queue.Length = 0, "hydrated first group never replays at second group")
     V492Setup(), AE_MASTER_ENABLED := false
     V492Opening()
     AE_MASTER_ENABLED := true
     V492Stacks(125000, "Mara", 25)
     V48Assert(AEStacks.Soak.Called && Audio.Queue.Length = 0, "master mute changes no sequence history")
     V492Setup(), AEStackDefinitions["AESoakNext"].Enabled := false
     V492Opening()
     AEStackDefinitions["AESoakNext"].Enabled := true
     V492Start(132500), V492Stacks(156500, "FifthDPS", 24)
     V48Assert(Audio.Queue.Length = 0, "individual toggle cannot resurrect completed handoff")
 }
 
 V492TestResetRearms()
 {
     global Audio, AEStacks
     V492Setup(), V492Opening()
     old := Audio.Queue[1], generation := AEStacks.Generation
     ResetAEStackState("synthetic next pull")
     V48Assert(Audio.Queue.Length = 0 && AEStacks.Generation = generation + 1, "genuine reset clears only encounter stack state and stale stack audio")
     V492Start(200000), V492Stacks(224000, "Mara", 24)
     V48Assert(Audio.Queue.Length = 1 && !AEStackAudioItemEnabled(old), "new pull can give a fresh handoff while old item remains invalid")
     V492Start(300000, "49202"), V492Stacks(324000, "Mara", 1, true, true, "49202")
     V492Stacks(347000, "Mara", 24, false, true, "49202")
     V48Assert(Audio.Queue.Length = 1 && AEStacks.Soak.Nexus = "49202", "new Nexus sequence rearms as before")
 }
 
 V492TestDedupAndDecay()
 {
     global Audio, AEStacks
     V492Setup(), V492Start(100000), V492Start(100000)
     V48Assert(AEStacks.Soak.Channel = 1 && AEStacks.Soak.HandoffOpen, "duplicate activation at same timestamp is not a second channel")
     V492Stacks(101000, "Mara", 1, true), V492Stacks(124000, "Mara", 24)
     serial := AEStacks.Serial
     V492Stacks(124000, "Mara", 24)
     V492Stacks(125000, "Mara", 25), V492Stacks(126000, "Mara", 24)
     V492Stacks(127000, "Mara", -1), V492Stacks(128000, "Mara", 24, true)
     V48Assert(AEStacks.Serial = serial && Audio.Queue.Length = 1, "duplicate, decay, removal and reapplication do not repeat consumed handoff")
     V492Start(120000)
     V48Assert(AEStacks.Soak.Channel = 1, "old out-of-order cast cannot close or reset the current channel")
 }
 
 V492TestRoleAndSourceGuards()
 {
     global Audio, AEStacks, Roster
     V492Setup(), V492Start(100000)
     V492Stacks(124000, "Tank1", 24), V492Stacks(124001, "Healer1", 24)
     Roster.Members[V48Actor("FifthDPS")].Role := ""
     V492Stacks(124002, "FifthDPS", 24)
     V48Assert(!AEStacks.Soak.Called && AEStacks.Soak.OpeningDps.Count = 0, "tank, healer and unknown roles do not qualify or invent a DPS replacement")
     bad := V492Line(124003, V48Field("Mara"), "=", "4111769760956416", "836045448953666", "4111769760956750", " (24 charges {836045448953667})")
     V492Feed(bad)
     V48Assert(Audio.Queue.Length = 0, "player-source System Shock is not accepted as Nexus evidence")
     V492Stacks(124004, "Mara", 24)
     V48Assert(Audio.Queue.Length = 1, "known DPS with exact Nexus ability still triggers opening call")
 }
 
 V492TestMissingFirstCast()
 {
     global Audio, AEStacks
     V492Setup()
     V492Stacks(101000, "Mara", 1, true), V492Stacks(101001, "DoubleCloseDPS", 1, true)
     V492Stacks(124000, "Mara", 24)
     V48Assert(AEStacks.Soak.Channel = 1 && Audio.Queue.Length = 1, "existing stack-based first-session fallback retained")
     V492Start(132500), V492Stacks(156500, "FifthDPS", 24)
     V48Assert(AEStacks.Soak.Channel = 2 && Audio.Queue.Length = 0, "later explicit cast does not reopen inferred consumed session")
 }
 
 V492TestOtherStackWarnings()
 {
     global Audio, AEStackDefinitions
     V492Setup()
     dps := V48Field("Mara"), healer := V48Field("Healer1")
     aivela := "Aivela {4088525397950464}:49220|(486,2803,317.41,0)|(100/100)"
     V492Feed(V492Line(100000, aivela, dps, "4109583622602752", "836045448945477", "4109583622603019", " (5 charges {836045448953667})"))
     V48Assert(Audio.Queue.Length = 0, "Radiance remains silent at 5")
     V492Feed(V492Line(100100, aivela, dps, "4109583622602752", "836045448953666", "4109583622603019", " (6 charges {836045448953667})"))
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Key = "AERadianceHigh", "Radiance still warns any known player at 6")
     V492Feed(V492Line(100200, healer, "=", "4114162057740288", "836045448945477", "4114162057740686", " (51 charges {836045448953667})"))
     V48Assert(Audio.Queue.Length = 2 && Audio.Queue[2].Key = "AECountermeasureHigh", "healer Countermeasure warning remains at 51")
     V492Feed(V492Line(100300, dps, "=", "4114162057740288", "836045448945477", "4114162057740686", " (51 charges {836045448953667})"))
     V48Assert(Audio.Queue.Length = 2, "DPS Countermeasure stacks still do not produce healer call")
     V492Start(100400), V492Start(132900)
     V48Assert(Audio.Queue.Length = 2, "closing soak handoff does not cancel other A&E stack warnings")
 }
 
 V492TestExistingWordingAndRoutes()
 {
     global Audio, BridgeTextById, AEStackDefinitions, AUDIO_MODE_KENKU_SOUNDBOARD
     V492Setup()
     BridgeTextById["AE_SECOND_DPS_SOAK"] := "Second group, your turn."
     V492Opening()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].Phrase = "Second group, your turn.", "saved custom handoff wording is retained")
     id := "11111111-1111-1111-1111-111111111111"
     AEStackDefinitions["AESoakNext"].SoundId := id
     payload := AEStackPayload("AESoakNext", "Sample", AUDIO_MODE_KENKU_SOUNDBOARD)
     V48Assert(payload.Id = id, "original Kenku recording route retains its configured ID")
     V48Assert(AEStackDefinitions["AESoakNext"].Threshold = 24, "handoff threshold is unchanged")
 }
 
 V492TestSeptember21LogExcerpt()
 {
     global Audio, Roster, AEStacks
     V492Setup()
     for actor in ["@Tarric Zyder#690126701907528", "@Zassaliss Sarengo#689196368116662", "@Jalapeño Popper#690131692070407", "@Cleanse'me Daddy#689159161822134"]
         Roster.Members[actor] := {RoleAt: 73800000, Snapshot: -1, Role: "DPS"}
     ; Exact supplied records, trimmed only after complete log lines (not invented events).
     lines := [
         "[20:30:21.612] [Nexus {4101564918661120}:84327000232541|(486.00,2790.50,317.41,179.90)|(2374632/7131026)] [=] [Synergy Protocol {4111769760956416}] [Event {836045448945472}: AbilityActivate {836045448945479}]"
         , "[20:30:22.611] [Nexus {4101564918661120}:84327000232541|(486.00,2790.50,317.41,179.90)|(2374632/7131026)] [@Tarric Zyder#690126701907528|(486.23,2796.21,317.41,178.03)|(430185/440620)] [Synergy Protocol {4111769760956416}] [ApplyEffect {836045448945477}: System Shock {4111769760956750}] (1 charges {836045448953667})"
         , "[20:30:22.611] [Nexus {4101564918661120}:84327000232541|(486.00,2790.50,317.41,179.90)|(2374632/7131026)] [@Zassaliss Sarengo#689196368116662|(486.18,2782.71,317.41,-26.24)|(443782/443782)] [Synergy Protocol {4111769760956416}] [ApplyEffect {836045448945477}: System Shock {4111769760956750}] (1 charges {836045448953667})"
         , "[20:30:45.621] [Nexus {4101564918661120}:84327000232541|(486.00,2790.50,317.41,179.90)|(2374632/7131026)] [@Tarric Zyder#690126701907528|(486.23,2796.21,317.41,178.03)|(150819/440620)] [Synergy Protocol {4111769760956416}] [ModifyCharges {836045448953666}: System Shock {4111769760956750}] (24 charges {836045448953667})"
         , "[20:30:45.621] [Nexus {4101564918661120}:84327000232541|(486.00,2790.50,317.41,179.90)|(2374632/7131026)] [@Zassaliss Sarengo#689196368116662|(486.18,2782.71,317.41,2.22)|(305140/443782)] [Synergy Protocol {4111769760956416}] [ModifyCharges {836045448953666}: System Shock {4111769760956750}] (24 charges {836045448953667})"
         , "[20:30:54.025] [Nexus {4101564918661120}:84327000232541|(486.00,2790.50,317.41,179.90)|(2374632/7131026)] [=] [Synergy Protocol {4111769760956416}] [Event {836045448945472}: AbilityActivate {836045448945479}]"
         , "[20:30:55.132] [Nexus {4101564918661120}:84327000232541|(486.00,2790.50,317.41,179.90)|(2374632/7131026)] [@Jalapeño Popper#690131692070407|(486.16,2796.96,317.41,178.47)|(418630/443604)] [Synergy Protocol {4111769760956416}] [ApplyEffect {836045448945477}: System Shock {4111769760956750}] (1 charges {836045448953667})"
         , "[20:30:55.132] [Nexus {4101564918661120}:84327000232541|(486.00,2790.50,317.41,179.90)|(2374632/7131026)] [@Cleanse'me Daddy#689159161822134|(485.73,2780.98,317.41,-6.05)|(425168/443782)] [Synergy Protocol {4111769760956416}] [ApplyEffect {836045448945477}: System Shock {4111769760956750}] (1 charges {836045448953667})"
         , "[20:31:18.033] [Nexus {4101564918661120}:84327000232541|(486.00,2790.50,317.41,179.90)|(2374632/7131026)] [@Jalapeño Popper#690131692070407|(486.16,2796.96,317.41,178.47)|(158603/443604)] [Synergy Protocol {4111769760956416}] [ModifyCharges {836045448953666}: System Shock {4111769760956750}] (24 charges {836045448953667})"
         , "[20:31:18.034] [Nexus {4101564918661120}:84327000232541|(486.00,2790.50,317.41,179.90)|(2374632/7131026)] [@Cleanse'me Daddy#689159161822134|(485.73,2780.98,317.41,-6.06)|(148163/443782)] [Synergy Protocol {4111769760956416}] [ModifyCharges {836045448953666}: System Shock {4111769760956750}] (24 charges {836045448953667})"
     ]
     for i, line in lines {
         V492Feed(line)
         if i = 4 || i = 5
             V48Assert(Audio.Queue.Length = 1, "real first group produces only the valid handoff")
         if i >= 6
             V48Assert(Audio.Queue.Length = 0, "real second channel/soaker/24 event cannot repeat handoff")
     }
     V48Assert(AEStacks.Soak.Called && AEStacks.Soak.Channel = 2 && !AEStacks.Soak.HandoffOpen, "real-log sequence ends consumed, not rearmed")
 }
 ; IrisBench tests are extracted only by the existing manual Run button.
 IBTestSetup()
 {
     global IrisBench
     generation := IrisBench.Generation + 1
     IrisBench := {Active: true, Finalizing: false, Visible: false, Gui: "", Generation: generation,
         Session: IBNewSession(generation), Report: "", Status: "isolated test"}
     s := IrisBench.Session
     frequency := 0
     DllCall("QueryPerformanceFrequency", "Int64*", &frequency)
     s.Frequency := frequency
     s.Start := IBQpc() - frequency * 10
     s.End := IBQpc()
     s.Started := "synthetic test"
     s.Config := IBConfig()
     return s
 }
 
 IBTestItem(key := "Taunt", kind := "Player", priority := 3)
 {
     return {Key: key, Kind: kind, Priority: priority, Cancel: false,
         Actor: "@PRIVATE_PLAYER#123", Phrase: "PRIVATE_PHRASE", SoundId: "PRIVATE_RECORDING",
         Created: ClockMs(), Expires: ClockMs() + 1000}
 }
 
 IBTestInactive()
 {
     global IrisBench
     s := IBTestSetup()
     IrisBench.Active := false
     IBEnqueue({}), IBDispatch({}), IBDrop({}), IBFinished({}, "speech completed")
     IBPollTick(), IBDiagnostic("handler-error"), IBSampleTimer()
     V48Assert(!IsObject(IBBatchBegin("live")), "off has no batch token")
     V48Assert(!s.Queued && !s.Errors.Count && !s.HookErrors && !s.LastSample, "off hooks do not sample")
 }
 
 IBTestHistogram()
 {
     m := IBNewMetric()
     for value in [0, 0.01, 0.25, 20, 50, 100, 100.01, 1000, 1000.01, 10000, 60000, 60001]
         IBMetricAdd(m, value)
     V48Assert(m.N = 12 && m.Min = 0 && m.Max = 60001, "histogram tracks count and extrema")
     V48Assert(IBPercentile(m, 50) = 100, "nearest-rank median upper bound")
     V48Assert(IBPercentile(m, 99) = 60001, "overflow uses observed maximum")
     V48Assert(IBBucket(20) = 80 && IBBucketUpper(80, 100) = 20, "20ms boundary is exact")
     V48Assert(IBBucketUpper(IBBucket(100.01), 1000) = 101, "conservative bucket upper bound")
     V48Assert(IBBucket(1e12) = 2701, "extreme durations cannot grow histogram key range")
     IBMetricAdd(m, -1)
     V48Assert(m.N = 12, "negative sample is not treated as zero")
 }
 
 IBTestThresholds()
 {
     m := IBNewMetric()
     V48Assert(InStr(IBTimingVerdict(m, 20, 50), "INCOMPLETE"), "no sample is not a pass")
     Loop 99
         IBMetricAdd(m, 20)
     V48Assert(InStr(IBTimingVerdict(m, 20, 50), "INCOMPLETE"), "small-sample guard")
     IBMetricAdd(m, 20)
     V48Assert(InStr(IBTimingVerdict(m, 20, 50), "WITHIN"), "inclusive threshold")
     IBMetricAdd(m, 51), IBMetricAdd(m, 51)
     V48Assert(InStr(IBTimingVerdict(m, 20, 50), "REVIEW"), "p99 exceedance surfaced")
 }
 
 IBTestEmptyCapture()
 {
     s := IBTestSetup(), text := IBReport(s)
     V48Assert(InStr(text, "INCOMPLETE WORKLOAD") && InStr(text, "INCOMPLETE AUDIO SAMPLE"), "idle not a pass")
     V48Assert(InStr(text, "Standard replay: NOT RUN") && InStr(text, "Engine headroom / score: NOT RUN"), "unrun modes explicit")
     V48Assert(InStr(text, "arrival: NOT MEASURED") && InStr(text, "NOT CHECKED"), "no invented audio/correctness result")
 }
 
 IBTestAudioLifecycle()
 {
     s := IBTestSetup(), item := IBTestItem()
     IBEnqueue(item), IBDispatch(item), IBDispatch(item), IBFinished(item, "speech completed")
     IBFinished(item, "speech completed")
     V48Assert(s.Queued = 1 && s.Dispatched = 1 && s.Completed = 1 && !s.Pending.Count, "dispatch and finish are idempotent")
     V48Assert(s.QueueWait.N = 1 && s.ImportantWait.N = 1, "one measured important dispatch")
     V48Assert(item.Actor = "@PRIVATE_PLAYER#123" && item.Phrase = "PRIVATE_PHRASE", "instrumentation preserves payload")
 }
 
 IBTestQueueRemoval()
 {
     s := IBTestSetup(), a := IBTestItem(), b := IBTestItem("NahutFloor", "Boss", 0)
     IBEnqueue(a), IBEnqueue(b)
     IBDrop(a, "expired"), IBFiltered([a,b], [b]), IBFiltered([a,b], [b])
     V48Assert(s.Dropped = 1 && s.Expired = 1 && s.ImportantExpired = 1 && s.Context = 0, "explicit and filter hooks do not double-count")
     IBCapacityRejected(a)
     V48Assert(s.RejectedCapacity = 1 && s.ImportantRejectedCapacity = 1, "capacity rejection before queue is separate")
     IBFiltered([b], [])
     V48Assert(s.Dropped = 2 && s.Context = 1 && !s.Pending.Count, "selective clear is accounted")
 }
 
 IBTestRetry()
 {
     s := IBTestSetup(), item := IBTestItem("TythBurnSoon", "Boss", 2)
     IBEnqueue(item), IBDispatch(item)
     clone := item.Clone()
     original := item.IBRecord.Origin
     IBEnqueue(clone, true)
     V48Assert(clone.IBRecord.Id != item.IBRecord.Id && clone.IBRecord.Origin = original, "retry has distinct attempt but original timing origin")
     IBStopRequested(item), IBStopRequested(item)
     item.Cancel := true
     IBFinished(item, "stopped: higher priority"), IBDispatch(clone), IBFinished(clone, "speech completed")
     V48Assert(s.Queued = 2 && s.Retries = 1 && s.StopRequests = 1, "retry and stop requests counted once")
     V48Assert(s.Stopped = 1 && s.Completed = 1 && !s.Pending.Count, "retry lifecycle balances")
 }
 
 IBTestCarryIn()
 {
     s := IBTestSetup(), item := IBTestItem()
     IBDispatch(item), IBDrop(item)
     V48Assert(!s.Dispatched && !s.Dropped, "uncaptured carry-in not invented")
     IBEnqueue(item, true), IBDispatch(item)
     V48Assert(s.Dispatched = 1 && s.UnknownWait = 1 && !s.QueueWait.N, "unknown retry origin is not zero wait")
     IBFinished(item, "speech completed")
 }
 
 IBTestSessionIsolation()
 {
     old := IBTestSetup(), item := IBTestItem()
     IBEnqueue(item)
     fresh := IBTestSetup()
     IBDispatch(item), IBDrop(item), IBFinished(item, "speech completed")
     V48Assert(!fresh.Dispatched && !fresh.Dropped && !fresh.Completed, "old generation cannot contaminate new capture")
     V48Assert(old.Pending.Count = 1, "old capture history remains unchanged")
 }
 
 IBTestPrivacy()
 {
     s := IBTestSetup(), item := IBTestItem()
     item.FilePath := "C:\Users\PRIVATE_USER\PRIVATE_FILE.txt"
     IBEnqueue(item), IBDispatch(item), IBFinished(item, "speech completed")
     IBDiagnostic("handler-error")
     text := IBReport(s)
     for secret in ["PRIVATE_PLAYER", "PRIVATE_PHRASE", "PRIVATE_RECORDING", "PRIVATE_USER", "PRIVATE_FILE"]
         V48Assert(!InStr(text, secret), "report excludes " secret)
     V48Assert(InStr(text, "Mechanic event handler errors: 1"), "error category without free-text payload")
 }
 
 IBTestResources()
 {
     s := IBTestSetup()
     s.Frequency := 1000, s.CPU0 := 100, s.CPU1 := 24000100, s.CPUAt0 := 10000, s.CPUAt1 := 70000
     V48Assert(Abs(IBCpuPercent(s) - 4) < 0.000001, "2.4 CPU seconds / 60s = 4% of one logical CPU")
     s.CPU0 := -1
     V48Assert(IBCpuPercent(s) = -1, "failed CPU sample not interpreted as zero")
     size := 8 + 9 * A_PtrSize
     V48Assert(size = (A_PtrSize = 8 ? 80 : 44), "memory structure size follows pointer width")
     memory := IBMemory()
     V48Assert(IsObject(memory) && memory.Private >= 0 && memory.Working >= 0, "Windows process-memory API returns readable fields")
     V48Assert(IBCpuTime() >= 0, "Windows process CPU API returns a sample")
 }
 
 IBTestBatchAccounting()
 {
     s := IBTestSetup(), batch := IBBatchBegin("live")
     batch.Lines := 2, batch.Fresh := 1, batch.Before := 500, batch.After := 100, batch.Bytes := 400
     IBBatchEnd(batch)
     history := IBBatchBegin("history"), history.Lines := 3
     IBBatchEnd(history)
     V48Assert(s.Lines = 2 && s.FreshLines = 1 && s.Bytes = 400, "live lines/bytes accounted")
     V48Assert(s.Batch.N = 1 && s.History.N = 1 && s.HistoryLines = 3, "history does not inflate live timing count")
     V48Assert(s.MaxBefore = 500 && s.MaxAfter = 100 && s.LastAfter = 100 && !s.OpenBatches, "snapshot remainder, not inferred latency")
     empty := IBBatchBegin("live"), empty.Before := 0, empty.After := 0
     IBBatchEnd(empty)
     V48Assert(s.EmptyReads = 1 && s.Batch.N = 1, "idle read cannot improve active-batch percentile")
 }
 
 IBTestStopBoundary()
 {
     global IrisBench
     s := IBTestSetup(), batch := IBBatchBegin("live")
     batch.Lines := 50
     IrisBench.Active := false
     IBBatchEnd(batch)
     V48Assert(!s.Lines && s.OpenBatches = 1, "partial batch excluded at Stop boundary")
     V48Assert(InStr(IBReport(s), "Stop boundary (excluded): 1"), "excluded in-flight batch disclosed")
 }
 
 IBTestPreviewsAndFailures()
 {
     s := IBTestSetup(), preview := IBTestItem("Preview", "Test", 1)
     IBEnqueue(preview), IBDispatch(preview)
     V48Assert(s.Previews = 1 && !s.Queued && !s.Dispatched, "audio preview excluded")
     item := IBTestItem()
     IBEnqueue(item), IBDispatch(item), IBFinished(item, "TTS setup or playback failed")
     V48Assert(s.Failed = 1 && !s.Completed && !s.Pending.Count, "dispatch failure not a completed call")
 }
 
 IBTestSaveProtection()
 {
     global COMBAT_LOG_FOLDER
     V48Assert(IBReportPathAllowed(A_Temp "\IrisBench_Report.txt"), "normal txt report accepted")
     V48Assert(!IBReportPathAllowed(A_Temp "\SophieBot.ahk"), "main script cannot be overwritten by report")
     V48Assert(!IBReportPathAllowed(A_Temp "\settings.ini"), "settings cannot be overwritten by report")
     V48Assert(!IBReportPathAllowed(A_Temp "\combat_2026.txt"), "combat filename protected")
     V48Assert(!IBReportPathAllowed(COMBAT_LOG_FOLDER "\custom.txt"), "combat-log folder protected")
 }
 
 IBTestRealQueueHooks()
 {
     global Audio, IrisBench
     V49Setup(3)
     s := IBTestSetup(), a := IBTestItem()
     Audio.Queue := [a], Audio.Current := ""
     IBEnqueue(a)
     a.Expires := ClockMs() - 1
     PruneAudioQueue()
     V48Assert(!Audio.Queue.Length && s.Expired = 1 && s.Dropped = 1, "actual prune path accounts expiration once")
     b := IBTestItem()
     Audio.Queue := [b]
     IBEnqueue(b)
     epoch := Audio.Epoch
     CancelAllAudio("isolated benchmark hook test")
     V48Assert(!Audio.Queue.Length && s.Context = 1 && Audio.Epoch = epoch + 1, "actual global clear retains normal behavior and accounts removals")
     V48Assert(InStr(IBReport(s), "Accounting: BALANCED"), "real queue hooks balance report")
     IrisBench.Active := false
 }
 ; v50.1 corrections-only policy and recovery lifecycle regressions.
 ; This entire payload is inert in the normal Iris process.
 V501Setup(phase := 1, done := 0)
 {
     global NBOrderOptions, logReadBusy, inLogDispatch, IrisBench
     V48Setup(phase)
     logReadBusy := false, inLogDispatch := false
     IrisBench.Active := false, IrisBench.Session := ""
     NBOrderOptions.Phases := [false, false, false]
     NBOrderOptions.NextEnabled := false, NBOrderOptions.NoneEnabled := false
     if done > 0
         V48DoneThrough(done)
     V48Chosen()
 }
 
 V501TestSpeechPolicyMatrix()
 {
     global NBOrderOptions, NBOrder
     for phase in [1,2,3] {
         V501Setup(phase)
         Loop 32 {
             mask := A_Index - 1
             master := !!(mask & 1), normal := !!(mask & 2), next := !!(mask & 4)
             corrections := !!(mask & 8), none := !!(mask & 16)
             NBOrderOptions.Enabled := master, NBOrderOptions.Phases[phase] := normal
             NBOrderOptions.NextEnabled := next, NBOrderOptions.Corrections := corrections
             NBOrderOptions.NoneEnabled := none
             for kind in ["Next", "Pass", "Wait", "PassWait", "None"] {
                 ordinary := {Kind: kind, Correction: false}
                 recovery := {Kind: kind, Correction: true}
                 expected := kind != "Next" && master && normal && (kind = "None" ? none : next)
                 V48Assert(NBOrderSpeechEnabled(ordinary) = expected, "normal policy matrix P" phase " " mask " " kind)
                 V48Assert(NBOrderSpeechEnabled(recovery) = (master && corrections), "recovery policy matrix P" phase " " mask " " kind)
             }
             for kind in ["Incorrect", "IncorrectWait"]
                 V48Assert(NBOrderSpeechEnabled({Kind: kind}) = (master && corrections), "incorrect kind honors corrections only")
         }
     }
     for phase in [0,4,5] {
         V501Setup(), NBOrder.Phase := phase
         V48Assert(!NBOrderSpeechEnabled({Kind: "Pass", Correction: true}), "no P1-P3 override outside P1-P3")
     }
 }
 
 V501TestWrongPassInEveryQuietPhase()
 {
     global Audio, NBOrder
     for phase in [1,2,3] {
         V501Setup(phase)
         V48Pass("Tank2",100100), PollNBOrder()
         V48Assert(NBOrder.Recovery && NBOrder.Mispass, "wrong receipt recorded in quiet P" phase)
         V48Assert(Audio.Queue.Length = 1, "correction queued in quiet P" phase)
         item := Audio.Queue[1]
         V48Assert(item.NOData.Kind = "Incorrect" && item.NOData.Correction, "wrong-pass classification retained")
         V48Assert(NBOrderAudioItemEnabled(item), "quiet phase cannot reject correction at playback")
     }
 }
 
 V501TestRoutineCallsStayQuiet()
 {
     global Audio, NBOrderOptions, NBOrder
     V501Setup()
     PollNBOrder()
     V48Assert(Audio.Queue.Length = 0, "no routine opener in quiet phase")
     V48Pass("Tank1",100100), V48Use("Tank1",100700), PollNBOrder()
     V48Assert(NBOrder.Turns[1].Done && V48Chosen() = "Tank2", "normal ledger advances silently")
     V48Assert(!NBOrder.Recovery && Audio.Queue.Length = 0, "routine completed reveal is not correction")
     NBOrderOptions.Phases[1] := true
     PollNBOrder()
     V48Assert(Audio.Queue.Length = 0, "global normal switch still silences normal call")
     NBOrderOptions.NextEnabled := true
     PollNBOrder()
     V48Assert(Audio.Queue.Length = 1 && !Audio.Queue[1].NOData.Correction, "normal switches restore normal call")
 }
 
 V501TestOutOfOrderRevealRecovery()
 {
     global NBOrder, NBCandle, Audio
     V501Setup(1,2)
     V48Pass("DoubleCloseDPS",100100), V48Use("DoubleCloseDPS",100700)
     V48Assert(NBOrder.Turns[5].Done && !NBOrder.Turns[3].Done && !NBOrder.Turns[4].Done, "future reveal does not erase healers")
     V48Assert(NBOrder.Recovery && !NBOrder.Mispass, "recovery survives clearing incorrect-pass wording")
     PollNBOrder()
     V48Assert(Audio.Queue.Length = 1, "recovery after early reveal is audible while quiet")
     item := Audio.Queue[1]
     V48Assert(item.NOData.Kind = "Pass" && item.NOData.Correction && item.Key = "NahutOrderWrong", "ordinary pass wording carries correction metadata")
     V48Assert(item.NOData.Actor = V48Actor("Healer1") && NBOrderAudioItemEnabled(item), "recovery returns to H1")
     old := NBCandle.Players[V48Actor("DoubleCloseDPS")].LastUse
     ticket := NBOrder.Ticket
     V48Use("DoubleCloseDPS",100701,false)
     V48Assert(NBOrder.Ticket = ticket && NBCandle.Players[V48Actor("DoubleCloseDPS")].LastUse = old, "duplicate evidence cannot restart recovery or cooldown")
 }
 
 V501TestRevealWithoutReceiptEvidence()
 {
     global Audio, NBOrder, NBCandle
     V501Setup(1,2)
     ; A future user's completed use is evidence even when the receipt line was missed.
     NBCandle.Holder := V48Actor("DoubleCloseDPS")
     V48Use("DoubleCloseDPS",100700), PollNBOrder()
     V48Assert(NBOrder.Recovery && Audio.Queue.Length = 1 && Audio.Queue[1].NOData.Correction, "out-of-order use can initiate recovery without a prior mispass flag")
     V48Assert(V48Chosen() = "Healer1", "earliest unfinished eligible turn retained")
 }
 
 V501TestCorrectReceiptEndsRecovery()
 {
     global Audio, NBOrder
     V501Setup(1,2)
     V48Pass("DoubleCloseDPS",100100), V48Use("DoubleCloseDPS",100700), PollNBOrder()
     old := Audio.Queue[1]
     V48Pass("Healer1",100900), PollNBOrder()
     V48Assert(!NBOrder.Recovery && !NBOrder.Mispass && Audio.Queue.Length = 0, "correct recipient resolves recovery and cancels pending speech")
     V48Assert(!NBOrderAudioItemEnabled(old), "old correction invalid after fix")
     V48Use("Healer1",101500), PollNBOrder()
     V48Assert(V48Chosen() = "Healer2" && Audio.Queue.Length = 0, "next routine pass stays quiet again")
 }
 
 V501TestCorrectionsOffDoesNotFallBack()
 {
     global Audio, NBOrderOptions, NBOrder
     V501Setup(1,2)
     NBOrderOptions.Phases[1] := true, NBOrderOptions.NextEnabled := true
     NBOrderOptions.Corrections := false
     V48Pass("DoubleCloseDPS",100100), PollNBOrder()
     V48Assert(Audio.Queue.Length = 0 && NBOrder.Recovery, "corrections OFF keeps wrong pass silent despite normal ON")
     V48Use("DoubleCloseDPS",100700), PollNBOrder()
     V48Assert(Audio.Queue.Length = 0, "recovery Pass cannot leak through normal calls")
     NBOrderOptions.Corrections := true
     PollNBOrder()
     V48Assert(Audio.Queue.Length = 1, "enabling corrections permits unresolved recovery")
 }
 
 V501TestP2PrematureTankPass()
 {
     global NBOrder, Audio
     V501Setup(2,2)
     V48Pass("Tank1",100100), V48Lock("Tank1",100200)
     V48Pass("Tank2",100300), PollNBOrder()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].NOData.Actor = V48Actor("Tank1"), "return premature P2 pass to tank missing reveal")
     V48Use("Tank1",100800,false)
     V48Assert(!NBOrder.Turns[3].Done && NBOrder.Recovery, "weak reveal proof cannot erase correction")
     V48Use("Tank1",100801,true), PollNBOrder()
     V48Assert(NBOrder.Turns[3].Done && V48Chosen() = "Tank2", "both tank requirements still required")
     V48Assert(!NBOrder.Recovery && Audio.Queue.Length = 0, "late completion makes existing T2 holder correct; stop recovery")
 }
 
 V501TestP2RevealCannotReplaceLock()
 {
     global NBOrder, Audio
     V501Setup(2)
     V48Pass("Tank1",100100), V48Use("Tank1",100700), PollNBOrder()
     V48Assert(!NBOrder.Turns[1].Done && NBOrder.Turns[3].UseAt >= 0 && !NBOrder.Turns[3].Done, "out-of-order tank reveal preserves H1 lock and T1 lock requirements")
     V48Assert(NBOrder.Recovery && Audio.Queue.Length = 1 && Audio.Queue[1].NOData.Actor = V48Actor("Healer1"), "recover to uncompleted H1 bait turn while quiet")
 }
 
 V501TestP2OutOfOrderLock()
 {
     global NBOrder, NBCandle, Audio
     V501Setup(2)
     NBCandle.Holder := V48Actor("Healer2")
     V48Lock("Healer2",100100), PollNBOrder()
     V48Assert(!NBOrder.Turns[1].Done && NBOrder.Turns[2].Done, "future lock credited without replacing missing H1 lock")
     V48Assert(NBOrder.Recovery && Audio.Queue.Length = 1 && Audio.Queue[1].NOData.Correction, "out-of-order P2 lock creates recovery even without receipt evidence")
     V48Assert(Audio.Queue[1].NOData.Actor = V48Actor("Healer1"), "return to earlier unfinished bait turn")
 }
 
 V501TestPhaseChangeRetiresCorrections()
 {
     global Audio, NBOrder, NBCandle
     V501Setup()
     V48Pass("DoubleCloseDPS",100100), V48Use("DoubleCloseDPS",100700), PollNBOrder()
     item := Audio.Queue[1]
     lastUse := NBCandle.Players[V48Actor("DoubleCloseDPS")].LastUse
     NBOrderSetPhase(2,101000,"test phase supersedes recovery")
     V48Time(101000), PollNBOrder()
     V48Assert(!NBOrder.Recovery && !NBOrder.Mispass && Audio.Queue.Length = 0, "phase change clears old recovery; next phase remains quiet")
     V48Assert(!NBOrderAudioItemEnabled(item), "queued old-phase correction rejected")
     V48Assert(NBCandle.Players[V48Actor("DoubleCloseDPS")].LastUse = lastUse, "phase keeps reveal cooldown")
 }
 
 V501TestQueuedPolicyRevalidation()
 {
     global Audio, NBOrderOptions
     V501Setup()
     V48Pass("Tank2",100100), PollNBOrder()
     item := Audio.Queue[1]
     V48Assert(NBOrderAudioItemEnabled(item), "correction valid with phase and normal calls OFF")
     NBOrderOptions.Corrections := false
     V48Assert(!NBOrderAudioItemEnabled(item), "turning corrections OFF also blocks queued item")
     NBOrderOptions.Corrections := true, NBOrderOptions.Enabled := false
     V48Assert(!NBOrderAudioItemEnabled(item), "controller master blocks queued correction")
     V501Setup()
     NBOrderOptions.Phases[1] := true, NBOrderOptions.NextEnabled := true
     V48Pass("Tank1",100100), V48Use("Tank1",100700), PollNBOrder(), item := Audio.Queue[1]
     NBOrderOptions.Phases[1] := false
     V48Assert(!NBOrderAudioItemEnabled(item), "normal queued item is invalidated by phase quiet")
 }
 
 V501TestMasterAndLiveSafeguards()
 {
     global Audio, soundboardsEnabled, autoBossCalloutsEnabled, NBOrderOptions, NBOrder
     global inputMode, activeBoss, NBToonBindings
     for guard in ["F11", "bossMaster", "controller", "mode", "boss", "suspended", "heartbeat", "binding"] {
         V501Setup(), V48Pass("Tank2",100100)
         switch guard {
             case "F11": soundboardsEnabled := false
             case "bossMaster": autoBossCalloutsEnabled := false
             case "controller": NBOrderOptions.Enabled := false
             case "mode": inputMode := "Hotkey"
             case "boss": activeBoss := "GFTM - Tyth"
             case "suspended": NBOrder.Suspended := true
             case "heartbeat": NBOrder.LiveTick := 0
             case "binding": NBToonBindings["p1"]["Tank1"] := "Changed"
         }
         PollNBOrder()
         V48Assert(Audio.Queue.Length = 0, "quiet override must not bypass " guard)
     }
 }
 
 V501TestBoundedCorrectionRetries()
 {
     global Audio, NBOrder
     V501Setup(), V48Pass("Tank2",100100), PollNBOrder()
     item := Audio.Queue.RemoveAt(1), Audio.Current := item
     FinishAudio("stopped: higher priority")
     V48Time(102300), PollNBOrder()
     V48Assert(Audio.Queue.Length = 1 && NBOrder.Delivery.Attempts = 2, "one correction retry while quiet")
     item := Audio.Queue.RemoveAt(1), Audio.Current := item
     FinishAudio("stopped: higher priority")
     V48Time(104500), PollNBOrder()
     V48Assert(Audio.Queue.Length = 0, "no unbounded recovery spam")
     V501Setup(), V48Pass("Tank2",100100), PollNBOrder()
     item := Audio.Queue.RemoveAt(1), Audio.Current := item
     FinishAudio("speech completed")
     V48Time(102300), PollNBOrder()
     V48Assert(Audio.Queue.Length = 0 && NBOrder.Delivery.Completed, "completed correction does not repeat while same mistake persists")
 }
 
 V501TestNoEligibleDuringRecovery()
 {
     global NBCandle, Audio, NBOrder
     V501Setup(), V48Pass("Tank2",100100)
     for actor, p in NBCandle.Players
         p.Battery := 0
     PollNBOrder()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].NOData.Kind = "None" && Audio.Queue[1].NOData.Correction, "no-candidate recovery overrides normal no-eligible switch")
     V48Assert(NBOrderAudioItemEnabled(Audio.Queue[1]), "recovery None valid at playback")
     V501Setup()
     for actor, p in NBCandle.Players
         p.Battery := 0
     PollNBOrder()
     V48Assert(!NBOrder.Recovery && Audio.Queue.Length = 0, "ordinary shortage not automatically a mistake")
 }
 
 V501TestWaitClassification()
 {
     global NBOrder, NBCandle, Audio, NBOrderOptions
     V501Setup(1,8)
     ; Reset selection before installing the original narrowly scoped Mara->H1 allowance.
     NBOrder.Choice := 0, NBOrder.GraceH1 := false
     NBCandle.Holder := V48Actor("Mara"), NBOrder.LastUseActor := NBCandle.Holder
     NBCandle.Players[V48Actor("Healer1")].LastUse := 50000
     V48Chosen(), V48Pass("Healer1",100100), PollNBOrder()
     V48Assert(NBOrder.GraceH1 && !NBOrder.Recovery && Audio.Queue.Length = 0, "normal allowed cooldown hold is not a mistake")
     ; Exercise the recovery follow-through path without broadening eligibility.
     NBOrderMarkRecovery("synthetic recovery hold")
     PollNBOrder()
     V48Assert(Audio.Queue.Length = 1 && Audio.Queue[1].NOData.Kind = "Wait" && Audio.Queue[1].NOData.Correction, "recovery wait bypasses normal quiet")
     item := Audio.Queue[1]
     V48Time(110001), PollNBOrder()
     V48Assert(!NBOrder.Recovery && Audio.Queue.Length = 0 && !NBOrderAudioItemEnabled(item), "ready correct holder ends recovery wait")
 }
 
 V501TestBurnResetAndTerminalHold()
 {
     global NBOrder, NBCandle, Audio
     V501Setup(2,5)
     V48Pass("DoubleFarDPS",100100), V48Time(170000), PollNBOrder()
     V48Assert(NBOrder.TerminalArmed && !NBOrder.Recovery && Audio.Queue.Length = 0, "quiet terminal P2 hold neither nags nor invents error")
     V48Use("DoubleFarDPS",170700), PollNBOrder()
     V48Assert(NBOrder.Phase = 3 && NBOrder.Turns[1].Done && Audio.Queue.Length = 0, "quiet P2->P3 credits one opener and keeps normal handoff silent")
     V48Pass("Tank1",171000), PollNBOrder()
     V48Assert(Audio.Queue.Length = 1, "P3 mistake still audible")
     old := Audio.Queue[1]
     V48Event(171500,"Singularity Core {4122580193640448}:555|(0,0,0,0)|(100/100)",V48Field("Healer1"),"4133502295474176","836045448945477","4133502295474475")
     V48Assert(NBOrder.Phase = 4 && NBCandle.Burn && !NBOrder.Recovery && Audio.Queue.Length = 0, "burn takes over without ordered correction leakage")
     V48Assert(!NBOrderAudioItemEnabled(old), "pre-burn correction is obsolete")
     ResetNBCandleState("synthetic new pull")
     V48Assert(NBOrder.Phase = 0 && !NBOrder.Recovery, "new pull has no recovery carry-over")
 }
 
 V501TestPayloadAndIdentity()
 {
     global NBOrder, NBOrderOptions, NBCandle, AUDIO_MODE_KENKU_BRIDGE_TTS, NBOrderRecordings
     V501Setup(1,2), V48Pass("DoubleCloseDPS",100100), V48Use("DoubleCloseDPS",100700)
     want := NBOrderDesired(NBOrderReconcile(100700),100700)
     corrected := NBOrderMessageKey(want)
     ordinary := want.Clone(), ordinary.Correction := false
     V48Assert(corrected != NBOrderMessageKey(ordinary), "same wording reclassified as correction has different delivery identity")
     p := NBOrderPayload(want.Kind,want.From,want.Slot,want.ActualName,want.Name,AUDIO_MODE_KENKU_BRIDGE_TTS)
     V48Assert(p.Phrase = "DoubleCloseDPS, pass to Healer1.", "recovery uses unchanged directed pass phrase")
     NBOrderRecordings[p.RecordingKey] := "11111111-1111-1111-1111-111111111111"
     recording := NBOrderPayload(want.Kind,want.From,want.Slot,want.ActualName,want.Name,"KenkuSoundboard")
     V48Assert(recording.Id = NBOrderRecordings[p.RecordingKey], "recovery reuses existing kind/from/to recording mapping")
 }
 
 V501TestSavedChoicesPreserved()
 {
     global SETTINGS_FILE, NBOrderOptions, NBOrderRecordings, persistenceTestMode
     V501Setup()
     previousFile := SETTINGS_FILE, previousMode := persistenceTestMode
     path := A_Temp "\Iris_v501_correction_settings_" DllCall("GetCurrentProcessId") ".ini"
     try {
         SETTINGS_FILE := path, persistenceTestMode := false
         NBOrderOptions.Phases := [false,true,false], NBOrderOptions.NextEnabled := false
         NBOrderOptions.Corrections := true, NBOrderOptions.NoneEnabled := false
         SaveNBOrderSettings()
         NBOrderOptions.Phases := [true,false,true], NBOrderOptions.NextEnabled := true
         NBOrderOptions.Corrections := false, NBOrderOptions.NoneEnabled := true
         LoadNBOrderSettings()
         V48Assert(!NBOrderOptions.Phases[1] && NBOrderOptions.Phases[2] && !NBOrderOptions.Phases[3], "saved per-phase choices retained")
         V48Assert(!NBOrderOptions.NextEnabled && NBOrderOptions.Corrections && !NBOrderOptions.NoneEnabled, "saved independent speech switches retained")
     }
     finally {
         SETTINGS_FILE := previousFile, persistenceTestMode := previousMode
         if FileExist(path)
             FileDelete(path)
     }
 }
 
 ; v50.2: overlay policy / numeric display tests. No window or game required.
 V502TestDefaultsAndKeys()
 {
     state := IBONewState()
     V48Assert(!state.Wanted && !state.Editing && !state.TimerOn && !IsObject(state.Gui), "overlay startup stays inactive")
     pairs := IBOKeyPairs()
     V48Assert(pairs[1].Show = "^+F10" && pairs[1].Capture = "^+F9", "documented default chords")
     seen := Map()
     for pair in pairs {
         for key in [pair.Show,pair.Capture] {
             if key = ""
                 continue
             V48Assert(!seen.Has(key) && !InStr(key,"F11") && !InStr(key,"F12"), "distinct chords do not take F11 or F12")
             V48Assert(RegExMatch(key,"^\^[+!]F[0-9]+$"), "only deliberate two-modifier function chords")
             seen[key] := true
         }
     }
     V48Assert(IBOKeyText("^+F10") = "Ctrl+Shift+F10", "readable overlay chord")
     V48Assert(IBOKeyText("^!F7") = "Ctrl+Alt+F7", "readable alternative chord")
     V48Assert(IBOKeyText("") = "tray or buttons", "disabled keys do not imply a shortcut")
 }
 
 V502TestVisibilityPolicy()
 {
     for wanted in [false,true] {
         for editing in [false,true] {
             for focused in [false,true] {
                 expected := editing || (wanted && focused)
                 V48Assert(IBOShouldDraw(wanted,editing,focused) = expected, "focus and manual visibility truth table")
             }
         }
     }
     V48Assert(!IBOShouldDraw(false,false,true), "returning to game does not unhide a manually hidden overlay")
     V48Assert(IBOShouldDraw(true,false,true), "wanted overlay resumes on returning to game")
 }
 
 V502TestInputClamping()
 {
     V48Assert(IBOInt("bad",10,9,18) = 10 && IBOInt("10.5",10,9,18) = 10, "malformed inputs use default")
     V48Assert(IBOInt(-1,10,9,18) = 9 && IBOInt(99,10,9,18) = 18, "font limits")
     V48Assert(IBOInt(999,220,80,255) = 255 && IBOInt(0,220,80,255) = 80, "cannot save invisible opacity")
 }
 
 V502TestMonitorPlacement()
 {
     monitors := [{L:0,T:0,R:1920,B:1080},{L:-1920,T:-100,R:0,B:980}]
     p := IBOClampPosition(-1800,30,420,260,monitors)
     V48Assert(p.X = -1800 && p.Y = 30, "negative-coordinate monitor placement retained")
     p := IBOClampPosition(1800,900,420,260,[monitors[1]])
     V48Assert(p.X = 1500 && p.Y = 820, "right and bottom clamped inside screen")
     p := IBOClampPosition(50000,-50000,420,260,[monitors[1]])
     V48Assert(p.X = 1500 && p.Y = 0, "removed/offscreen layout made reachable")
     p := IBOClampPosition(0,0,4000,3000,[monitors[1]])
     V48Assert(p.X = 0 && p.Y = 0, "oversized overlay remains anchored on screen")
 }
 
 V502SnapshotSetup()
 {
     s := IBNewSession(502)
     s.Start := 1000, s.Frequency := 1000, s.LastSample := 9000
     s.CPURecent := 5.5, s.Private1 := 100 * 1048576, s.MemoryLatestOK := true
     s.Lines := 100, s.Dispatched := 2
     IBMetricAdd(s.QueueWait,100), IBMetricAdd(s.QueueWait,300)
     IBMetricAdd(s.Batch,5)
     s.Expired := 1, s.Capacity := 2, s.RejectedCapacity := 3
     return s
 }
 
 V502TestSnapshotAllowlist()
 {
     s := V502SnapshotSetup()
     s.Config := "PRIVATE_TOON PRIVATE_PATH PRIVATE_PHRASE"
     snapshot := IBOSnapshot(s,10000)
     V48Assert(snapshot.Elapsed = 9 && snapshot.Capacity = 5, "numeric capture counters mapped correctly")
     for name,value in snapshot.OwnProps()
         V48Assert(IsNumber(value), "overlay snapshot contains only numeric values: " name)
     V48Assert(!snapshot.HasOwnProp("Config") && !snapshot.HasOwnProp("Players"), "no names or config strings carried to overlay")
 }
 
 V502TestRateAndDelay()
 {
     s := V502SnapshotSetup(), a := IBOSnapshot(s,10000)
     s.Lines := 500
     IBMetricAdd(s.QueueWait,200), IBMetricAdd(s.QueueWait,400)
     b := IBOSnapshot(s,12000), d := IBODeltas(b,a)
     V48Assert(d.Seconds = 2 && d.LinesPerSecond = 200, "rate uses actual elapsed interval, not assumed one second")
     V48Assert(d.DispatchN = 2 && d.DispatchMean = 300, "new dispatch mean excludes prior session samples")
     d := IBODeltas(IBOSnapshot(s,13000),b)
     V48Assert(d.LinesPerSecond = 0 && d.DispatchN = 0 && d.DispatchMean = -1, "idle rates may be zero; absent dispatch sample is unknown")
 }
 
 V502TestGenerationAndRewind()
 {
     s := V502SnapshotSetup(), a := IBOSnapshot(s,10000)
     V48Assert(IBODeltas(a,"").LinesPerSecond = -1, "first render warms up rather than inventing rate")
     V48Assert(IBODeltas(a,a).LinesPerSecond = -1, "zero elapsed time never divides by zero")
     s.Generation += 1
     b := IBOSnapshot(s,11000)
     V48Assert(IBODeltas(b,a).LinesPerSecond = -1, "capture restart does not mix counters")
     s.Generation -= 1, s.Lines := 50
     V48Assert(IBODeltas(IBOSnapshot(s,11000),a).LinesPerSecond = -1, "counter rewind is not a negative throughput")
 }
 
 V502TestDisplayTruthfulness()
 {
     s := V502SnapshotSetup(), snapshot := IBOSnapshot(s,10000)
     d := {LinesPerSecond:200,DispatchMean:300}
     text := IBOFormat(snapshot,d,2)
     V48Assert(InStr(text,"5.5%") && InStr(text,"100.0 MiB") && InStr(text,"200/s"), "display renders explicit units")
     V48Assert(InStr(text,"300.0 ms") && InStr(text,"not heard"), "dispatch age is not presented as audible delay")
     V48Assert(InStr(text,"Capacity lost 5") && InStr(text,"Expired 1"), "loss counters remain visible")
     stale := IBOSnapshot(s,14000)
     text := IBOFormat(stale,d,0)
     V48Assert(!InStr(text,"5.5%") && !InStr(text,"100.0 MiB") && InStr(text,"stale"), "stale resource samples not presented as current")
 }
 
 V502TestMissingSamples()
 {
     s := V502SnapshotSetup()
     s.CPURecent := -1, s.MemoryLatestOK := false
     snapshot := IBOSnapshot(s,10000), d := IBODeltas(snapshot,"")
     text := IBOFormat(snapshot,d,0)
     V48Assert(!InStr(text,"100.0 MiB") && InStr(text,"no new samples") && InStr(text,"warming up"), "API failure and missing deltas disclosed")
     V48Assert(!InStr(text,"PASS") && !InStr(text,"FPS"), "overlay does not invent benchmark pass or game FPS")
 }
 
 V502TestQueueFiltering()
 {
     a := {Kind:"Boss",Cancel:false}, b := {Kind:"Test",Cancel:false}, c := {Kind:"Player",Cancel:true}
     V48Assert(IBOQueueDepth([a,b,c]) = 1 && IBOQueueDepth([]) = 0, "only waiting uncanceled non-preview calls counted")
     V48Assert(!a.Cancel && !b.Cancel && c.Cancel, "counting does not modify audio items")
 }
 
 V502TestHideKeepsCapture()
 {
     global IrisBench, Audio
     s := IBTestSetup()
     IrisBench.Visible := true
     queue := Audio.Queue
     IBOHideReport()
     V48Assert(IrisBench.Active && !IrisBench.Visible && IrisBench.Session = s, "report Hide does not stop or reset capture")
     V48Assert(Audio.Queue = queue, "hiding report does not touch queued audio")
     IrisBench.Active := false
 }
 
 V502TestElapsedAndTestIsolation()
 {
     global IBO, IrisBench
     V48Assert(IBOElapsed(3661) = "01:01:01" && IBOElapsed(-1) = "00:00:00", "elapsed clock formatting")
     V48Assert(IBOElapsed(360000) = "100:00:00", "long captures do not wrap hours")
     old := IBO
     try {
         IBO := IBONewState(), IBO.Wanted := true
         IBOSyncTimer(), IBOPoll()
         V48Assert(!IBO.TimerOn && !IsObject(IBO.Gui), "self-test does not start focus watcher or create overlay")
         V48Assert(!IBOBindKeys(1), "self-test never registers gameplay hotkeys")
     }
     finally
         IBO := old
 }
 
 V502TestSavedOverlayPreferences()
 {
     global IBO, SETTINGS_FILE, persistenceTestMode
     oldState := IBO, oldFile := SETTINGS_FILE, oldMode := persistenceTestMode
     path := A_Temp "\Iris_v502_overlay_" DllCall("GetCurrentProcessId") ".ini"
     try {
         SETTINGS_FILE := path, persistenceTestMode := false
         IBO := IBONewState()
         IBO.X := -500, IBO.Y := 110, IBO.Font := 14, IBO.Opacity := 190, IBO.KeyChoice := 3
         IBO.Wanted := true, IBO.Editing := true
         IBOSaveSettings()
         IBO := IBONewState()
         IBOLoadSettings()
         V48Assert(IBO.X = -500 && IBO.Y = 110 && IBO.Font = 14 && IBO.Opacity = 190 && IBO.KeyChoice = 3, "only layout and key preferences restored")
         V48Assert(!IBO.Wanted && !IBO.Editing && !IBO.TimerOn, "saved choices never auto-show or start capture")
     }
     finally {
         IBO := oldState, SETTINGS_FILE := oldFile, persistenceTestMode := oldMode
         if FileExist(path)
             FileDelete(path)
     }
 }
 ; v51 tests: extracted with the existing button-only isolated harness.
 V51Source()
 {
     return "@Example Player#101|(1,2,3,0)|(500/1000)"
 }
 
 V51Target()
 {
     return "Example NPC {990000000000001}:9|(1,2,3,0)|(999/1000)"
 }
 
 V51Feed(s, at, kind, amount := 0, source := "", target := "", crit := false, effective := -1, abilityId := "900000000000001")
 {
     source := source = "" ? V51Source() : source
     target := target = "" ? V51Target() : target
     line := IPDemoLine(at, source, target, kind, amount, crit, effective, "Example", abilityId)
     IPFeedLine(s, line)
     return line
 }
 
 V51TestLineGrammar()
 {
     e := IPParseLine(IPDemoLine(1000,V51Source(),V51Target(),"Damage",1234,true))
     V48Assert(IsObject(e) && e.Kind = "Damage" && e.Amount = 1234 && e.Crit, "numeric damage and star parsed")
     V48Assert(e.Source.Name = "Example Player" && e.Source.Kind = "Player", "player identity independent of position")
     V48Assert(e.AbilityId = "900000000000001" && e.RawMs = 1000, "ability identity and time")
     line := "[00:00:01.000] [@Player#7] [=] [] [Event {836045448945472}: EnterCombat {836045448945489}] ()"
     e := IPParseLine(line)
     V48Assert(e.Kind = "Enter" && e.Target.Key = e.Source.Key, "empty ability and equals target")
 }
 
 V51TestNumericIdsNotLabels()
 {
     line := IPDemoLine(1000,V51Source(),V51Target(),"Damage",123)
     line := StrReplace(line,"Damage {","LocalisedLabel {")
     e := IPParseLine(line)
     V48Assert(e.Kind = "Damage", "effect ID determines kind, not translated text")
     line := StrReplace(line,"836045448945501","999999999999999")
     V48Assert(IPParseLine(line).Kind = "Other", "an unknown effect is not invented damage")
 }
 
 V51TestMalformedAndValues()
 {
     s := IPNewData()
     IPFeedLine(s,"not a combat log")
     IPFeedLine(s,"[25:00:00.000] [@A#1] [] [] [x]")
     line := IPDemoLine(1000,V51Source(),V51Target(),"Damage",100)
     IPFeedLine(s,StrReplace(line,"(100 ","(oops "))
     V48Assert(s.Malformed = 2 && s.BadValues = 1, "malformed lines and bad numbers disclosed")
     V48Assert(s.Segments.Length = 0, "bad numeric result does not invent a segment")
 }
 
 V51TestDamageAndRates()
 {
     s := IPNewData()
     V51Feed(s,1000,"Enter",0,V51Source(),"=")
     V51Feed(s,2000,"Damage",100)
     V51Feed(s,11000,"Damage",300,"","",true)
     seg := s.Current, t := seg.Totals[IPActor(V51Source()).Key]
     V48Assert(t.Damage = 400 && IPDuration(seg) = 10 && IPRate(t.Damage,10) = "40.0", "common segment duration and DPS")
     rows := IPBreakdown(seg,IPActor(V51Source()).Key,"Damage")
     r := rows["900000000000001"]
     V48Assert(r.N = 2 && r.Critical = 1 && r.Total = 400 && r.Max = 300, "ability result stats")
 }
 
 V51TestHealingIsRaw()
 {
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V51Source(),"=")
     V51Feed(s,1000,"Heal",500,V51Source(),"=",false,200)
     V51Feed(s,2000,"Heal",700,"@Example Player#101","=")
     t := s.Current.Totals[IPActor(V51Source()).Key]
     V48Assert(t.Heal = 1200 && t.Received = 1200, "raw healing sums unchanged by effective amount")
     V48Assert(t.Effective = 200 && t.HealKnown = 1 && t.HealRecords = 2, "legacy heal without effective value stays unknown")
     V48Assert(InStr(IPSummary(s,s.Current),"NOT FULLY KNOWN") > 0, "no invented complete effective total")
 }
 
 V51TestZeroEffectiveKnown()
 {
     e := IPParseLine(IPDemoLine(1000,V51Source(),"=","Heal",500,false,0))
     V48Assert(e.ValueOK && e.Effective = 0, "explicit zero effective is known, not absent")
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V51Source(),"=")
     V51Feed(s,1000,"Heal",500,V51Source(),"=",false,0)
     V48Assert(s.Current.Totals[IPActor(V51Source()).Key].HealKnown = 1, "zero counted in effective coverage")
 }
 
 V51TestIncomingAndSelfDamage()
 {
     s := IPNewData()
     V51Feed(s,1000,"Damage",200,V51Target(),V51Source())
     V51Feed(s,2000,"Damage",50,V51Source(),"=")
     t := s.Current.Totals[IPActor(V51Source()).Key]
     V48Assert(t.Taken = 250 && t.Damage = 0, "self damage counted only on incoming side")
     V48Assert(IPBreakdown(s.Current,IPActor(V51Source()).Key,"Taken").Count = 1, "incoming abilities can aggregate across sources")
 }
 
 V51TestZeroDuration()
 {
     s := IPNewData()
     V51Feed(s,1000,"Damage",123)
     V48Assert(IPDuration(s.Current) = 0 && IPRate(123,0) = "--", "one instant has no fabricated duration/rate")
 }
 
 V51TestSimultaneousResults()
 {
     s := IPNewData()
     line := V51Feed(s,1000,"Damage",100)
     IPFeedLine(s,line)
     V48Assert(s.Current.Totals[IPActor(V51Source()).Key].Damage = 200, "two physical simultaneous results are both retained")
     V48Assert(s.Current.DamageEvents = 2, "no destructive broad timestamp dedup")
 }
 
 V51TestGapGrouping()
 {
     s := IPNewData("test",15000)
     V51Feed(s,1000,"Damage",100)
     V51Feed(s,16000,"Damage",100)
     V48Assert(s.Segments.Length = 1, "gap equality remains same segment")
     V51Feed(s,31001,"Damage",100)
     V48Assert(s.Segments.Length = 2 && s.Segments[1].End = 16000, "large gap closes at last data not timeout")
     V48Assert(s.Segments[1].EndReason = "activity gap (inferred)", "inferred boundary disclosed")
 }
 
 V51TestExitAndDeathDoNotResetRaid()
 {
     s := IPNewData()
     V51Feed(s,1000,"Damage",100)
     V51Feed(s,2000,"Exit",0,V51Source(),"=")
     V51Feed(s,2500,"Death",0,V51Source(),"=")
     V51Feed(s,3000,"Damage",200,"@Teammate#200",V51Target())
     V48Assert(s.Segments.Length = 1 && s.Current.DamageEvents = 2, "one player exit/death does not split active group")
     V48Assert(s.Current.Totals[IPActor(V51Source()).Key].Deaths = 1, "explicit death retained")
 }
 
 V51TestDeathDedupAndReturn()
 {
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V51Source(),"=")
     V51Feed(s,1000,"Death",0,V51Source(),"=")
     V51Feed(s,1001,"Death",0,V51Source(),"=")
     V51Feed(s,2000,"Activate",0,V51Source(),"=")
     V51Feed(s,3000,"Death",0,V51Source(),"=")
     V48Assert(s.Current.Totals[IPActor(V51Source()).Key].Deaths = 2, "duplicate death suppressed; observed activity permits later death")
     V51Feed(s,4000,"Heal",100,"@Healer#2","@Example Player#101")
     V51Feed(s,4100,"Death",0,V51Source(),"=")
     V48Assert(s.Current.Totals[IPActor(V51Source()).Key].Deaths = 2, "raw healing alone does not prove revival")
     V51Feed(s,5000,"Heal",100,"@Healer#2",V51Source())
     V51Feed(s,6000,"Death",0,V51Source(),"=")
     V48Assert(s.Current.Totals[IPActor(V51Source()).Key].Deaths = 3, "explicit positive target HP permits a later death")
 }
 
 V51TestMidnightAndOrdering()
 {
     s := IPNewData()
     V51Feed(s,86399000,"Damage",100)
     V51Feed(s,1000,"Damage",100)
     V48Assert(s.Current.Last = 86401000 && IPDuration(s.Current) = 2, "midnight rollover handled")
     V51Feed(s,500,"Damage",50)
     V48Assert(s.Late = 1 && s.Current.Last = 86401000, "small late record accepted without reducing duration")
     V51Feed(s,86390000,"Damage",999)
     V48Assert(s.ClockBack = 1 && s.Current.Totals[IPActor(V51Source()).Key].Damage = 250, "older data excluded and counted")
 }
 
 V51TestAttachmentBoundary()
 {
     s := IPNewData()
     line := IPDemoLine(1000,V51Source(),V51Target(),"Damage",100)
     IPFeedLine(s,line,"file-a")
     IPFeedLine(s,line,"file-b")
     V48Assert(s.Segments.Length = 2 && s.Segments[1].EndReason = "log source changed", "new file never merges with previous source")
 }
 
 V51TestPlayersAndNpcInstances()
 {
     a := IPActor("@Nefra#101|(0,0,0,0)|(100/100)")
     b := IPActor("Nefra {99999}:1|(0,0,0,0)|(100/100)")
     c := IPActor("Nefra {99999}:2")
     V48Assert(a.Kind = "Player" && b.Kind != "Player" && a.Key != b.Key, "boss-named player is still a player")
     V48Assert(b.Key != c.Key, "same NPC type keeps separate instances")
     e := IPActor("@Player#101/Companion {123}:99")
     V48Assert(e.Kind = "Companion" && e.Key != a.Key, "qualified pet not merged into owner")
 }
 
 V51TestCompanionKeptSeparate()
 {
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V51Source(),"=")
     pet := "@Example Player#101/Companion {123}:99"
     V51Feed(s,1000,"Damage",500,pet,V51Target())
     V48Assert(s.Current.Totals[IPActor(pet).Key].Damage = 500, "qualified companion damage retained")
     V48Assert(s.Current.Totals[IPActor(V51Source()).Key].Damage = 0, "owner not given unverified pet damage")
 }
 
 V51TestAbilityAndTargetFilters()
 {
     s := IPNewData()
     V51Feed(s,1000,"Damage",100)
     second := "Example NPC {990000000000001}:10"
     V51Feed(s,2000,"Damage",200,V51Source(),second)
     V51Feed(s,3000,"Damage",300,V51Source(),second,false,-1,"900000000000002")
     all := IPBreakdown(s.Current,IPActor(V51Source()).Key,"Damage")
     one := IPBreakdown(s.Current,IPActor(V51Source()).Key,"Damage",IPActor(V51Target()).Key)
     V48Assert(all.Count = 2 && all["900000000000001"].Total = 300, "whole ability aggregation")
     V48Assert(one.Count = 1 && one["900000000000001"].Total = 100, "target instance filter")
 }
 
 V51TestEventRingBounded()
 {
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V51Source(),"=")
     s.Current.EventCap := 4
     Loop 10
         V51Feed(s,A_Index*1000,"Damage",100)
     seg := s.Current
     V48Assert(seg.Events.Length = 4 && seg.EventCount = 10, "event history bounded")
     V48Assert(seg.Events[seg.EventNext].At = 7000, "oldest retained entry index correct")
     V48Assert(seg.Totals[IPActor(V51Source()).Key].Damage = 1000, "ring eviction does not erase aggregate totals")
 }
 
 V51TestSessionLimits()
 {
     s := IPNewData("test",5000), s.MaxSegments := 1
     V51Feed(s,1000,"Damage",100)
     V51Feed(s,10000,"Damage",100)
     V48Assert(s.Halted && s.Partial && s.Segments.Length = 1, "segment limit disclosed")
     s := IPNewData(), s.MaxRows := 1
     V51Feed(s,1000,"Damage",100)
     V48Assert(s.Halted && s.Partial, "row limit stops incomplete processing explicitly")
 }
 
 V51TestOutsideHealing()
 {
     s := IPNewData()
     V51Feed(s,0,"Heal",100,V51Source(),"=")
     V48Assert(s.Segments.Length = 0 && s.OutsideHeals = 1, "precombat healing counted as excluded")
     V51Feed(s,1000,"Enter",0,V51Source(),"=")
     V51Feed(s,2000,"Heal",100,V51Source(),"=")
     V48Assert(s.Current.Totals[IPActor(V51Source()).Key].Heal = 100, "healing in an entered segment counts")
 }
 
 V51TestImportStateIsolation()
 {
     global Audio, NBCandle, NBOrder, NBRebounder, IP
     oldPhase := NBOrder.Phase, oldBurn := NBCandle.Burn, oldEpoch := Audio.Epoch, oldQueue := Audio.Queue.Length
     oldActive := IP.Active
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V51Source(),"=")
     V51Feed(s,1000,"Damage",100)
     IPCloseSegment(s,"test import end")
     V48Assert(NBOrder.Phase = oldPhase && NBCandle.Burn = oldBurn && Audio.Epoch = oldEpoch && Audio.Queue.Length = oldQueue, "parser feed never touches encounter/audio")
     V48Assert(IP.Active = oldActive, "offline data feed does not start live parser")
 }
 
 V51TestMutedSpeechDoesNotMuteStats()
 {
     global soundboardsEnabled, inputMode
     oldMaster := soundboardsEnabled, oldMode := inputMode
     try {
         soundboardsEnabled := false, inputMode := "Hotkey"
         s := IPNewData()
         V51Feed(s,1000,"Damage",123)
         V48Assert(s.Current.Totals[IPActor(V51Source()).Key].Damage = 123, "parser math independent of speech/detection switches")
     }
     finally soundboardsEnabled := oldMaster, inputMode := oldMode
 }
 
 V51TestQueueAndInactiveHook()
 {
     global IP
     old := IP
     try {
         IP := IPNewApp(), IP.Live := IPNewData()
         line := IPDemoLine(1000,V51Source(),V51Target(),"Damage",100)
         IPEnqueue(line)
         V48Assert(IP.Queue.Length = 0, "inactive hook does no collection")
         IP.Active := true, IP.QueueCap := 2
         IPEnqueue(line), IPEnqueue(line), IPEnqueue(line)
         V48Assert(IP.Queue.Length = 2 && !IP.Active && IP.Live.Halted, "queue overflow is bounded and disclosed")
         IP.Queue := []
         Loop 5000
             IP.Queue.Push("")
         IP.Head := 4999
         IPCompactQueue()
         V48Assert(IP.Head = 1 && IP.Queue.Length = 2, "consumed prefix compacted")
     }
     finally IP := old
 }
 
 V51TestHideIsNotStop()
 {
     global IP
     old := IP
     try {
         IP := IPNewApp(), IP.Active := true, IP.Visible := true
         IPHide() ; timer setup is guarded in the isolated test harness
         V48Assert(IP.Active, "visibility is separate state from collection")
         V48Assert(!IsObject(IP.Gui) && !IsObject(IP.ImportFile), "inert state creates no window/file")
         IP.Live := IPNewData()
         V51Feed(IP.Live,0,"Enter",0,V51Source(),"=")
         V51Feed(IP.Live,1000,"Damage",100)
         IPStop()
         V48Assert(!IP.Active && IP.Live.Finished && !IsObject(IP.Live.Current), "hidden drained Stop finalizes without waiting for another timer")
     }
     finally IP := old
 }
 
 V51TestSummaryAndCsv()
 {
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V51Source(),"=")
     V51Feed(s,1000,"Damage",100)
     report := IPSummary(s,s.Current), csv := IPCsvData(s,s.Current)
     V48Assert(InStr(report,"Player`tDamage`tDPS") && InStr(report,"RawDamageTaken"), "summary retains explicit metric columns")
     V48Assert(InStr(csv,"LoggedTotal") && InStr(csv,"KnownEffectiveSum"), "export uses explicit metric names")
     V48Assert(IPCsv("=2+2") = Chr(34) "'=2+2" Chr(34), "spreadsheet formula neutralized")
     V48Assert(IPCsv('a"b') = '"a""b"', "CSV quote escaping")
     V48Assert(InStr(report,"Example Player"), "summary retains player names")
 }
 
 V51TestExportPathProtection()
 {
     global COMBAT_LOG_FOLDER
     old := COMBAT_LOG_FOLDER
     try {
         COMBAT_LOG_FOLDER := "C:\Game\CombatLogs"
         V48Assert(!IPExportPathAllowed("C:\Game\CombatLogs\stats.csv"), "combat directory protected")
         V48Assert(!IPExportPathAllowed("C:\Temp\combat_2026.csv"), "combat filename protected")
         V48Assert(!IPExportPathAllowed("C:\Temp\SophieBot.ahk"), "main script extension rejected")
         V48Assert(IPExportPathAllowed("C:\Temp\IrisStats.csv"), "normal report path accepted")
     }
     finally COMBAT_LOG_FOLDER := old
 }
 
 V51TestDemoArithmetic()
 {
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V51Source(),"=")
     Loop 10 {
         V51Feed(s,A_Index*1000,"Damage",1000)
         V51Feed(s,A_Index*1000,"Damage",300,V51Target(),V51Source())
         V51Feed(s,A_Index*1000,"Heal",500,"@Healer#300",V51Source(),false,300,"900000000000002")
     }
     seg := s.Current, own := seg.Totals[IPActor(V51Source()).Key], healer := seg.Totals["@Healer#300"]
     V48Assert(IPDuration(seg) = 10 && IPRate(own.Damage,10) = "1000.0", "demo DPS")
     V48Assert(IPRate(own.Taken,10) = "300.0" && IPRate(healer.Heal,10) = "500.0", "demo DTPS/raw HPS")
     V48Assert(healer.Effective = 3000 && healer.HealKnown = 10, "explicit heal sample coverage")
 }
 
 V51TestBlankAndUnicodeActors()
 {
     e := IPParseLine("[01:02:03.004] [] [@Zoë Player#77] [Tick {10}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (25 kinetic {1})")
     V48Assert(IsObject(e) && e.Source.Kind = "Unknown" && e.Target.Name = "Zoë Player", "blank environment source and Unicode actor")
     s := IPNewData()
     IPFeedLine(s,"[01:02:03.004] [] [@Zoë Player#77] [Tick {10}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (25 kinetic {1})")
     V48Assert(s.Current.Totals["@Zoë Player#77"].Taken = 25, "environmental damage retained")
     V48Assert(!IPParseLine("[01:02:03.004] [] [@A#1] [Tick {10}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (25 kinetic {1}").ValueOK, "unfinished numeric result rejected")
 }
 
 V51TestImportByteBoundaries()
 {
     global IP
     old := IP, path := A_ScriptDir "\IrisParser_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount ".txt"
     try {
         line := IPDemoLine(1000,"@Zoë#7",V51Target(),"Damage",123)
         f := FileOpen(path,"w","UTF-8-RAW")
         f.Write(line "`r`n" line), f.Close()
         IP := IPNewApp(), IP.Offline := IPNewData()
         IP.ImportFile := FileOpen(path,"r","UTF-8"), IP.ImportEnd := IP.ImportFile.Length
         IPReadImportChunk()
         V48Assert(IP.ImportLines.Length = 1 && IP.ImportLines[1] = line, "UTF-8 line committed at newline byte boundary")
         IPReadImportChunk()
         V48Assert(IP.ImportLines.Length = 0 && IP.Offline.Partial && IP.Offline.Malformed = 1, "unterminated final line disclosed and excluded")
         IP.ImportFile.Close(), IP.ImportFile := ""
     }
     finally {
         if IsObject(IP.ImportFile)
             IP.ImportFile.Close()
         if FileExist(path)
             FileDelete(path)
         IP := old
     }
 }
 
 V51TestImportSnapshotDoesNotReadAppend()
 {
     global IP
     old := IP, path := A_ScriptDir "\IrisParserSnapshot_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount ".txt"
     try {
         line := IPDemoLine(1000,V51Source(),V51Target(),"Damage",123)
         f := FileOpen(path,"w","UTF-8-RAW"), f.Write(line "`n"), f.Close()
         IP := IPNewApp(), IP.Offline := IPNewData()
         IP.ImportFile := FileOpen(path,"r","UTF-8"), IP.ImportEnd := IP.ImportFile.Length
         f := FileOpen(path,"a","UTF-8-RAW"), f.Write(line "`n"), f.Close()
         IPReadImportChunk()
         V48Assert(IP.ImportLines.Length = 1 && IP.ImportFile.Pos = IP.ImportEnd, "snapshot excludes later appended record")
         IP.ImportFile.Close(), IP.ImportFile := ""
     }
     finally {
         if IsObject(IP.ImportFile)
             IP.ImportFile.Close()
         if FileExist(path)
             FileDelete(path)
         IP := old
     }
 }
 ; v52 tests: pure meter projections plus existing parser fixtures. No GUI/audio.
 V52Fixture()
 {
     s := IPNewData("Meter test")
     V51Feed(s,1000,"Enter",0,"@A#1","=")
     V51Feed(s,11000,"Damage",10000,"@A#1")
     V51Feed(s,11000,"Damage",4000,"@B#2")
     V51Feed(s,11000,"Heal",5000,"@Healer#3","@A#1",false,2000)
     V51Feed(s,11000,"Damage",3000,V51Target(),"@A#1")
     return s
 }
 
 V52TestDefaults()
 {
     m := IPMNewState()
     V48Assert(!m.Wanted && !m.Editing && !m.TimerOn,"display dormant at launch")
     V48Assert(m.Enabled && m.Metric="Personal" && m.Mode=1,"one tabbed window with Personal selected")
     V48Assert(m.Source=3 && m.MaxRows=8 && m.Refresh=500,"automatic source and bounded display defaults")
 }
 
 V52TestKeysDisjoint()
 {
     seen := Map()
     for choice in IPMKeyChoices() {
         if choice.Key = ""
             continue
         V48Assert(!seen.Has(choice.Key), "meter hotkeys distinct")
         seen[choice.Key] := true
         V48Assert(!InStr(choice.Key,"F11") && !InStr(choice.Key,"F12"), "audio mute/screenshots untouched")
         for pair in IBOKeyPairs()
             V48Assert(choice.Key != pair.Show && choice.Key != pair.Capture, "no IrisBench hotkey collision")
     }
 }
 
 V52TestLatestLiveIndependent()
 {
     app := IPNewApp(), app.Live := V52Fixture(), app.Offline := IPNewData("Saved")
     ; v56.3: create two actual combats; a quiet gap alone must not split one.
     V51Feed(app.Live,12000,"Exit",0,"@A#1","=")
     V51Feed(app.Live,40000,"Enter",0,"@A#1","=")
     V51Feed(app.Live,50000,"Damage",20000,"@A#1")
     V48Assert(app.Live.Segments.Length=2 && app.Live.Segments[1].End=11000 && app.Live.Current.Start=40000,"latest-live fixture contains a closed first combat and a new combat")
     V48Assert(app.Live.Segments[1].Totals["@A#1"].Damage=10000 && app.Live.Current.Totals["@A#1"].Damage=20000,"latest-live fixture totals are separate before resolving the display")
     app.Active := true, app.View := "Imported", app.Selected := 1, app.Follow := false
     r := IPMResolve(app,1)
     V48Assert(r.Data = app.Live && r.Segment.Id = 2, "default ignores offline/old window selection")
     V48Assert(r.State = "LIVE LOG", "active collection labelled")
 }
 
 V52TestSelectedView()
 {
     app := IPNewApp(), app.Live := V52Fixture(), app.Offline := V52Fixture()
     app.View := "Imported", app.Selected := 1, app.Follow := false
     r := IPMResolve(app,2)
     V48Assert(r.Data = app.Offline && r.State = "IMPORTED", "explicit imported source")
     ; v56.3: explicitly finish the recorder's first fight and start the next.
     V51Feed(app.Offline,12000,"Exit",0,"@A#1","=")
     V51Feed(app.Offline,40000,"Enter",0,"@A#1","=")
     V51Feed(app.Offline,40000,"Damage",10000,"@C#4")
     V48Assert(app.Offline.Segments.Length=2 && app.Offline.Segments[1].End=11000 && app.Offline.Current.Start=40000,"imported-view fixture contains two genuine combats")
     V48Assert(app.Live.Segments.Length=1 && app.Live.Current.Totals["@A#1"].Damage=10000,"imported fixture setup does not modify live data")
     V48Assert(IPMResolve(app,2).Segment.Id = 1, "pinned selection preserved")
     app.Follow := true
     V48Assert(IPMResolve(app,2).Segment.Id = 2, "latest selection follows while parser window hidden")
 }
 
 V52TestStoppedHistory()
 {
     app := IPNewApp(), app.Live := V52Fixture()
     V48Assert(IPMResolve(app,1).State = "STOPPED", "stopped totals never labelled live")
     app.Queue := ["pending"], app.Head := 1
     V48Assert(IPMResolve(app,1).State = "DRAINING", "pending work disclosed")
     app.Queue := [], app.Active := true, app.Selected := 1, app.Follow := false
     ; v56.3: a history selection requires an actual older combat.
     V51Feed(app.Live,12000,"Exit",0,"@A#1","=")
     V51Feed(app.Live,40000,"Enter",0,"@A#1","=")
     V51Feed(app.Live,40000,"Damage",1,"@B#2")
     V48Assert(app.Live.Segments.Length=2 && app.Live.Segments[1].End=11000 && app.Live.Current.Start=40000,"history fixture contains a completed first fight and a fresh second fight")
     V48Assert(app.Live.Segments[1].Totals["@B#2"].Damage=4000 && app.Live.Current.Totals["@B#2"].Damage=1,"history fixture keeps prior and current damage separate")
     V48Assert(IPMResolve(app,2).State = "LIVE HISTORY", "older selection is history while collection continues")
 }
 
 V52TestEmptyAndDemoStates()
 {
     app := IPNewApp()
     snap := IPMSnapshot(IPMResolve(app,1))
     V48Assert(snap.Id = 0 && snap.Actors.Length = 0 && snap.Duration = 0, "no fake idle results")
     app.Offline := V52Fixture(), app.Offline.Label := "SYNTHETIC DEMO - test", app.View := "Imported"
     V48Assert(IPMResolve(app,2).State = "SYNTHETIC DEMO", "demo explicitly marked")
     app.ImportFile := {}
     V48Assert(IPMResolve(app,2).State = "IMPORTING", "unfinished import labelled")
 }
 
 V52TestPartialAndHalted()
 {
     app := IPNewApp(), app.Live := V52Fixture(), app.Active := true
     app.Live.Segments[1].Partial := true
     V48Assert(IPMSnapshot(IPMResolve(app,1)).Partial, "segment partial exposed")
     app.Live.Halted := true
     V48Assert(IPMResolve(app,1).State = "STOPPED: INCOMPLETE", "halted collection not shown healthy")
 }
 
 V52TestSnapshotIsolation()
 {
     s := V52Fixture(), seg := s.Segments[1]
     snap := IPMSnapshot({Data:s, Segment:seg, State:"STOPPED", Pending:0})
     V48Assert(snap.Duration = IPDuration(seg) && snap.Start = 1000 && snap.Last = 11000, "same recorded interval")
     snap.Actors[1].Damage := 999999
     V48Assert(seg.Totals["@A#1"].Damage = 10000, "snapshot cannot mutate parser totals")
     V48Assert(!snap.HasOwnProp("Rows") && !snap.HasOwnProp("Events"), "no full-event/breakdown copies")
 }
 
 V52TestRankingAndTies()
 {
     actors := [{Key:"@B#2",Name:"Same",Kind:"Player",Damage:5}, {Key:"@A#1",Name:"Same",Kind:"Player",Damage:5},
         {Key:"@C#3",Name:"C",Kind:"Player",Damage:10}]
     r := IPMRank(actors,"Damage",8)
     V48Assert(r.Rows[1].Key = "@C#3" && r.Rows[2].Key = "@A#1", "descending amounts with deterministic identity tiebreak")
     V48Assert(r.Rows.Length = 3 && r.Total = 20 && r.Peak = 10, "same-name actors never merged")
     V48Assert(actors[1].Key = "@B#2", "ranking does not reorder source")
 }
 
 V52TestTopRowsBound()
 {
     actors := []
     Loop 512
         actors.Push({Key:"@" A_Index,Name:"Player",Kind:"Player",Damage:A_Index})
     r := IPMRank(actors,"Damage",8)
     V48Assert(r.Rows.Length = 8 && r.Count = 512 && r.Total = 131328, "top-N display retains full observed count")
     V48Assert(r.Rows[1].Amount = 512 && r.Rows[8].Amount = 505, "highest eight ranked")
     V48Assert(IPMRank(actors,"Damage",999).Rows.Length = 24, "hard display row cap")
 }
 
 V52TestMetricDirections()
 {
     s := V52Fixture()
     snap := IPMSnapshot({Data:s, Segment:s.Current, State:"LIVE LOG", Pending:0})
     d := IPMRank(snap.Actors,"Damage",8), h := IPMRank(snap.Actors,"Heal",8), t := IPMRank(snap.Actors,"Taken",8)
     V48Assert(d.Peak = 10000 && d.Total = 14000, "damage excludes NPC attackers")
     V48Assert(h.Peak = 2000 && h.Rows[1].Key = "@Healer#3", "effective healing is the leaderboard amount")
     V48Assert(t.Peak = 3000 && t.Rows[1].Key = "@A#1", "taken not outgoing damage")
     V48Assert(IPMRowText(h.Rows[1],10).Rate = "200.0", "EHPS correct")
 }
 
 V52TestCompanionsSeparate()
 {
     actors := [{Key:"@A",Name:"A",Kind:"Player",Damage:500},
         {Key:"C:A",Name:"Pet [companion]",Kind:"Companion",Damage:700},
         {Key:"N:B",Name:"Boss",Kind:"NPC / companion",Damage:99999}]
     r := IPMRank(actors,"Damage",8,true)
     V48Assert(r.Count = 2 && r.Total = 1200 && r.Rows[1].Kind = "Companion", "known companion separate, NPC excluded")
     r := IPMRank(actors,"Damage",8,false)
     V48Assert(r.Count = 1 && r.Total = 500, "hiding companion never credits owner")
 }
 
 V52TestZeroRowsAndRates()
 {
     r := IPMRank([{Key:"A",Name:"A",Kind:"Player",Damage:0}],"Damage",8)
     V48Assert(r.Count = 0 && r.Rows.Length = 0 && r.Peak = 0, "zero metric has no invented bar")
     t := IPMRowText({Name:"A",Amount:100},0)
     V48Assert(t.Rate = "--" && t.Total = "100", "positive amount/zero interval gives unknown rate")
 }
 
 V52TestFormatting()
 {
     V48Assert(IPMNumber("34186.4") = "34,186.4", "precise DPS with thousands separators")
     V48Assert(IPMNumber("2031116") = "2,031,116", "full total, no abbreviated guess")
     V48Assert(IPMNumber("0.0") = "0.0" && IPMNumber("--") = "--", "zero and unavailable distinct")
     V48Assert(IPMRowText({Name:"Zoë & A",Amount:10000},10).Name = "Zoë & A", "name not rewritten")
 }
 
 V52TestBarScaling()
 {
     V48Assert(IPMBarValue(100,100) = 1000 && IPMBarValue(25,100) = 250, "bar relative to top, not percent-of-raid")
     V48Assert(IPMBarValue(100,0) = 0 && IPMBarValue(-1,100) = 0 && IPMBarValue(200,100) = 1000, "bar bounds")
 }
 
 V52TestLayoutBounds()
 {
     for dpi in [96,120,144,192] {
         for font in [8,10,18] {
             for n in [1,8,24] {
                 l := IPMCleanLayout(246,220,font,dpi,1920,1080,false,true,true,n,n)
                 V48Assert(l.W<=1896 && l.H<=1056 && l.N>=1 && l.N<=n,"clean layout fits screen and row cap")
                 V48Assert(l.NameW>0 && l.RateW>0 && l.TotalW>0,"numeric/name columns remain nonzero")
             }
         }
     }
 }
 
 V52TestHidePreservesEngines()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     oldM := IPM, oldP := IP, oldB := IrisBench, oldAudio := soundboardsEnabled
     try {
         IPM := IPMNewState(), IP := IPNewApp(), IrisBench := {Active:true}
         IP.Active := true, IP.Live := V52Fixture(), IPM.Wanted := true
         soundboardsEnabled := false
         IPMHide()
         V48Assert(!IPM.Wanted && !IPM.TimerOn && !IPM.Editing, "meter hiding settles visibility")
         V48Assert(IP.Active && IrisBench.Active && !soundboardsEnabled, "parsing, bench, mute unchanged")
         V48Assert(IP.Live.Segments[1].Totals["@A#1"].Damage = 10000, "hiding retains data")
     }
     finally IPM := oldM, IP := oldP, IrisBench := oldB, soundboardsEnabled := oldAudio
 }
 
 V52TestNoStartupOrTestTimer()
 {
     global IPM
     old := IPM
     try {
         IPM := IPMNewState(), IPM.Wanted := true
         IPMSyncTimer(), IPMPoll()
         V48Assert(!IPM.TimerOn && !IsObject(IPM.Panel.Gui), "test harness cannot start overlay timer or GUI")
         V48Assert(!IPMBindKey(1), "test harness cannot register gameplay shortcut")
     }
     finally IPM := old
 }
 
 V52TestDurationNoWallClock()
 {
     global testClock
     s := V52Fixture(), app := IPNewApp(), app.Live := s, app.Active := true
     before := testClock
     a := IPMSnapshot(IPMResolve(app,1))
     try {
         testClock += 3600000
         b := IPMSnapshot(IPMResolve(app,1))
         V48Assert(a.Duration = b.Duration && b.Duration = 10, "idle/wall clock never inflates denominator")
         V48Assert(IPMRowText(IPMRank(b.Actors,"Damage",8).Rows[1],b.Duration).Rate = "1,000.0", "no decaying DPS while log silent")
     }
     finally testClock := before
 }
 
 V52TestLateDamageBoundary()
 {
     s := IPNewData("Boundary regression",120000)
     V51Feed(s,14680113,"Enter",0,"@A#1","=")
     V51Feed(s,14738120,"Damage",1972333,"@A#1")
     V51Feed(s,14739125,"Exit",0,"@A#1","=")
     V51Feed(s,14739526,"Damage",58783,"@A#1")
     V51Feed(s,14739526,"Death",0,"@A#1")
     V51Feed(s,14754034,"Activate",0,"@A#1","=")
     snap := IPMSnapshot({Data:s, Segment:s.Segments[1], State:"STOPPED", Pending:0})
     row := IPMRank(snap.Actors,"Damage",8).Rows[1]
     V48Assert(Abs(snap.Duration-59.413) < 0.000001 && row.Amount = 2031116, "final hit time included, cleanup excluded")
     V48Assert(IPMRowText(row,snap.Duration).Rate = "34,186.4", "approved dummy convention, not combat-exit-only time")
 }
 
 V52TestRealDummyRecords()
 {
     s := IPNewData("Sanitized September 24 dummy regression")
     lines := []
     lines.Push("[04:04:40.113] [@Audit Player#5201] [] [] [Event {836045448945472}: EnterCombat {836045448945489}]")
     lines.Push("[04:04:40.978] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8679 energy {836045448940874}) <8679.0>")
     lines.Push("[04:04:41.624] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4169 kinetic {836045448940873}) <4169.0>")
     lines.Push("[04:04:42.617] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8184* kinetic {836045448940873}) <8184.0>")
     lines.Push("[04:04:43.104] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Raging Burst {3434638101970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (52954* kinetic {836045448940873}) <52954.0>")
     lines.Push("[04:04:43.525] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4542 kinetic {836045448940873}) <4542.0>")
     lines.Push("[04:04:44.425] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (28968* kinetic {836045448940873}) <28968.0>")
     lines.Push("[04:04:44.851] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (66373* energy {836045448940874}) <66373.0>")
     lines.Push("[04:04:46.218] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (70872* energy {836045448940874}) <70872.0>")
     lines.Push("[04:04:47.854] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Obliterate {1009763991158784}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24949 energy {836045448940874}) <24949.0>")
     lines.Push("[04:04:48.620] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12681* internal {836045448940876}) <12681.0>")
     lines.Push("[04:04:49.021] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (63178* energy {836045448940874}) <63178.0>")
     lines.Push("[04:04:50.569] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Sundering Assault {807806038966272}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13059 energy {836045448940874}) <13059.0>")
     lines.Push("[04:04:51.422] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5771 internal {836045448940876}) <5771.0>")
     lines.Push("[04:04:51.460] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Raging Burst {3434638101970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (53591* ~53592 kinetic {836045448940873}) <53591.0>")
     lines.Push("[04:04:53.216] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (60749* energy {836045448940874}) <60749.0>")
     lines.Push("[04:04:54.823] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Obliterate {1009763991158784}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (42559* energy {836045448940874}) <42559.0>")
     lines.Push("[04:04:55.618] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11743* internal {836045448940876}) <11743.0>")
     lines.Push("[04:04:56.079] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Retaliation {1582223002173440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (17959 energy {836045448940874}) <17959.0>")
     lines.Push("[04:04:56.616] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Lash {3452354842066944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2470 energy {836045448940874}) <2470.0>")
     lines.Push("[04:04:57.315] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Scream {998270658674688}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (37771* kinetic {836045448940873}) <37771.0>")
     lines.Push("[04:04:58.426] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5771 internal {836045448940876}) <5771.0>")
     lines.Push("[04:04:58.427] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4258 kinetic {836045448940873}) <4258.0>")
     lines.Push("[04:04:59.414] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7513* kinetic {836045448940873}) <7513.0>")
     lines.Push("[04:04:59.864] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Raging Burst {3434638101970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (49861* kinetic {836045448940873}) <49861.0>")
     lines.Push("[04:05:00.322] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4169 kinetic {836045448940873}) <4169.0>")
     lines.Push("[04:05:01.221] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11498* internal {836045448940876}) <11498.0>")
     lines.Push("[04:05:01.221] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (26081* kinetic {836045448940873}) <26081.0>")
     lines.Push("[04:05:01.619] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (57539* energy {836045448940874}) <57539.0>")
     lines.Push("[04:05:03.015] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (56901* energy {836045448940874}) <56901.0>")
     lines.Push("[04:05:04.626] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Obliterate {1009763991158784}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (40576* energy {836045448940874}) <40576.0>")
     lines.Push("[04:05:05.420] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6417 internal {836045448940876}) <6417.0>")
     lines.Push("[04:05:05.820] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (62782* energy {836045448940874}) <62782.0>")
     lines.Push("[04:05:07.366] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Sundering Assault {807806038966272}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14416 energy {836045448940874}) <14416.0>")
     lines.Push("[04:05:08.218] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6617 internal {836045448940876}) <6617.0>")
     lines.Push("[04:05:08.246] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Raging Burst {3434638101970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (61609* kinetic {836045448940873}) <61609.0>")
     lines.Push("[04:05:10.018] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35976 energy {836045448940874}) <35976.0>")
     lines.Push("[04:05:11.630] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Obliterate {1009763991158784}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (45478* energy {836045448940874}) <45478.0>")
     lines.Push("[04:05:12.422] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5890 internal {836045448940876}) <5890.0>")
     lines.Push("[04:05:12.883] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Retaliation {1582223002173440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (34616* energy {836045448940874}) <34616.0>")
     lines.Push("[04:05:13.411] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Lash {3452354842066944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4697* energy {836045448940874}) <4697.0>")
     lines.Push("[04:05:14.114] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Scream {998270658674688}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (19212 kinetic {836045448940873}) <19212.0>")
     lines.Push("[04:05:15.218] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5651 internal {836045448940876}) <5651.0>")
     lines.Push("[04:05:15.219] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4169 kinetic {836045448940873}) <4169.0>")
     lines.Push("[04:05:16.215] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4169 kinetic {836045448940873}) <4169.0>")
     lines.Push("[04:05:16.658] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Raging Burst {3434638101970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (49787* kinetic {836045448940873}) <49787.0>")
     lines.Push("[04:05:17.119] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4169 kinetic {836045448940873}) <4169.0>")
     lines.Push("[04:05:18.019] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11498* internal {836045448940876}) <11498.0>")
     lines.Push("[04:05:18.020] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (26081* kinetic {836045448940873}) <26081.0>")
     lines.Push("[04:05:18.416] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (30048 energy {836045448940874}) <30048.0>")
     lines.Push("[04:05:19.822] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (57941* energy {836045448940874}) <57941.0>")
     lines.Push("[04:05:21.427] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Obliterate {1009763991158784}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (40236* energy {836045448940874}) <40236.0>")
     lines.Push("[04:05:22.219] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11498* internal {836045448940876}) <11498.0>")
     lines.Push("[04:05:22.622] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (58091* energy {836045448940874}) <58091.0>")
     lines.Push("[04:05:24.173] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Sundering Assault {807806038966272}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11678 energy {836045448940874}) <11678.0>")
     lines.Push("[04:05:25.019] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10183* internal {836045448940876}) <10183.0>")
     lines.Push("[04:05:25.052] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Raging Burst {3434638101970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (53712* ~53713 kinetic {836045448940873}) <53712.0>")
     lines.Push("[04:05:26.818] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (30482 energy {836045448940874}) <30482.0>")
     lines.Push("[04:05:28.430] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Obliterate {1009763991158784}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (20120 energy {836045448940874}) <20120.0>")
     lines.Push("[04:05:29.220] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13464* internal {836045448940876}) <13464.0>")
     lines.Push("[04:05:29.819] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Vicious Throw {2145542322782208}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (62203* energy {836045448940874}) <62203.0>")
     lines.Push("[04:05:30.917] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Scream {998270658674688}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22047 kinetic {836045448940873}) <22047.0>")
     lines.Push("[04:05:32.023] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6617 internal {836045448940876}) <6617.0>")
     lines.Push("[04:05:32.024] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4882 kinetic {836045448940873}) <4882.0>")
     lines.Push("[04:05:33.020] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4882 kinetic {836045448940873}) <4882.0>")
     lines.Push("[04:05:33.460] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Raging Burst {3434638101970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (57965* kinetic {836045448940873}) <57965.0>")
     lines.Push("[04:05:33.926] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4169 kinetic {836045448940873}) <4169.0>")
     lines.Push("[04:05:34.821] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Bleeding (Cauterized Coronary) {4302797021380876}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11498* internal {836045448940876}) <11498.0>")
     lines.Push("[04:05:34.821] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (26081* kinetic {836045448940873}) <26081.0>")
     lines.Push("[04:05:35.215] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (58885* energy {836045448940874}) <58885.0>")
     lines.Push("[04:05:36.621] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (60255* energy {836045448940874}) <60255.0>")
     lines.Push("[04:05:38.120] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (56774* energy {836045448940874}) <56774.0>")
     lines.Push("[04:05:39.125] [@Audit Player#5201] [] [] [Event {836045448945472}: ExitCombat {836045448945490}]")
     lines.Push("[04:05:39.526] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (58783* ~27670 energy {836045448940874}) <58783.0>")
     lines.Push("[04:05:39.526] [@Audit Player#5201] [Operations Training Dummy {2857785339412480}:2699005259546] [] [Event {836045448945472}: Death {836045448945493}]")
     for line in lines
         IPFeedLine(s,line)
     snap := IPMSnapshot({Data:s, Segment:s.Segments[1], State:"IMPORTED", Pending:0})
     result := IPMRank(snap.Actors,"Damage",8)
     V48Assert(s.Segments.Length = 1 && s.Segments[1].DamageEvents = 72, "all 72 real-log damage records retained")
     V48Assert(result.Count = 1 && result.Rows[1].Amount = 2031116, "independently audited raw damage total")
     V48Assert(Abs(snap.Duration-59.413) < 0.000001, "real final-hit denominator")
     V48Assert(IPMRowText(result.Rows[1],snap.Duration).Rate = "34,186.4", "real-log overlay agrees with parser convention")
     V48Assert(!s.Partial, "fixture grammar fully parsed")
 }
 
 V52TestUpdatingFence()
 {
     global IPM
     old := IPM
     try {
         IPM := IPMNewState(), IPM.Busy := true
         V48Assert(!IPMBeginChange() && IPM.Updating = 0, "UI changes cannot destroy a render in progress")
         IPM.Busy := false
         V48Assert(IPMBeginChange() && IPMBeginChange() && IPM.Updating = 2, "nested control actions supported")
         IPMEndChange(), IPMEndChange()
         V48Assert(IPM.Updating = 0 && !IPM.TimerOn, "control fence releases without startup timer")
     }
     finally IPM := old
 }
 
 V521TestDragDefaults()
 {
     s := IPMNewState()
     V48Assert(!s.Editing && !s.DragHooks && !IsObject(s.Drag), "dragging and mouse hooks start disabled")
     V48Assert(!IsObject(s.Panel.Gui), "no startup meter window")
 }
 
 V521TestDragOwnership()
 {
     s := IPMNewState(), s.Editing := true
     s.Panel.Gui := {Hwnd:52101}, s.Panel.Drawn := true
     V48Assert(IPMDragPanel(s,52101)="Personal","owned Personal window resolves")
     s.Metric := "Heal"
     V48Assert(IPMDragPanel(s,52101)="Heal","same HWND owns changed tab")
     V48Assert(IPMDragPanel(s,0)="" && IPMDragPanel(s,52102)="","unowned HWNDs rejected")
 }
 
 V521TestDragGuards()
 {
     s := IPMNewState(), p := s.Panel, p.Gui := {Hwnd:52101}, p.Drawn := true
     V48Assert(IPMDragPanel(s,52101)="","locked mode never accepts drag")
     s.Editing := true, s.Enabled := false
     V48Assert(IPMDragPanel(s,52101)="","disabled window rejected")
     s.Enabled := true, p.Drawn := false
     V48Assert(IPMDragPanel(s,52101)="","hidden window rejected")
     p.Drawn := true, s.Busy := true
     V48Assert(IPMDragPanel(s,52101)="","render owner protected")
     s.Busy := false, s.Updating := 1
     V48Assert(IPMDragPanel(s,52101)="","configuration recreation protected")
     s.Updating := 0
     V48Assert(IPMDragPanel(s,52101)="Personal","visible unlocked idle window accepted")
 }
 
 V521TestDragCoordinates()
 {
     d := {X:100, Y:200, MouseX:160, MouseY:235}
     p := IPMDragPoint(d,260,335)
     V48Assert(p.X = 200 && p.Y = 300, "grab offset preserved")
     p := IPMDragPoint(d,160,235)
     V48Assert(p.X = 100 && p.Y = 200, "stationary cursor never jumps to corner")
     p := IPMDragPoint(d,-400,-120)
     V48Assert(p.X = -460 && p.Y = -155, "negative monitor coordinates retained")
     d := {X:-1700, Y:-900, MouseX:-1650, MouseY:-875}
     p := IPMDragPoint(d,300,120)
     V48Assert(p.X = 250 && p.Y = 95, "moving across displays uses one screen-coordinate system")
 }
 
 V521TestDragCleanupIsolation()
 {
     global IPM, IP, IrisBench, soundboardsEnabled, SETTINGS_FILE
     oldM := IPM, oldP := IP, oldB := IrisBench, oldAudio := soundboardsEnabled, oldSettings := SETTINGS_FILE
     temp := A_Temp "\IrisV521_Drag_" DllCall("GetCurrentProcessId", "UInt") "_" A_TickCount ".ini"
     if FileExist(temp)
         throw Error("Drag test temporary file already exists.")
     try {
         SETTINGS_FILE := temp
         IPM := IPMNewState(), IP := IPNewApp(), IP.Active := true
         IrisBench := {Active:true}, soundboardsEnabled := true
         IPM.Editing := true, IPM.Wanted := true
         IPM.Drag := {Kind:"Damage", Hwnd:0}
         IPMDragStop(), IPMDragStop()
         V48Assert(!IsObject(IPM.Drag), "stop is safe and idempotent in the harness")
         V48Assert(IP.Active && IrisBench.Active && soundboardsEnabled, "drag cleanup never stops parsing/capture/audio")
         IPMHide()
         V48Assert(!IPM.Editing && !IPM.Wanted && !IPM.DragHooks, "hide relocks and disables drag hooks")
         V48Assert(IP.Active && IrisBench.Active && soundboardsEnabled, "hide still does not stop engines")
     }
     finally {
         IPM := oldM, IP := oldP, IrisBench := oldB, soundboardsEnabled := oldAudio, SETTINGS_FILE := oldSettings
         if FileExist(temp)
             FileDelete(temp)
     }
 }
 
 V521TestHiddenWindowLockStyles()
 {
     global IPM
     old := IPM
     try {
         IPM := IPMNewState(), IPM.Opacity := 180
         IPMEnsureGui("Damage") ; explicit hidden test window, not live display
         p := IPM.Panel, hwnd := p.Gui.Hwnd
         ex := DllCall("User32\GetWindowLongW","Ptr",hwnd,"Int",-20,"UInt")
         V48Assert((ex & 0x08000020) = 0x08000020, "locked window is noactivate plus click-through")
         IPM.Editing := true, IPMStyle(p)
         ex := DllCall("User32\GetWindowLongW","Ptr",hwnd,"Int",-20,"UInt")
         V48Assert((ex & 0x08000020) = 0, "edit mode clears both interaction blockers")
         V48Assert((ex & 0x80000) != 0, "layered display retained")
         alpha := Buffer(1,0)
         V48Assert(DllCall("User32\GetLayeredWindowAttributes","Ptr",hwnd,"Ptr",0,"Ptr",alpha,"Ptr",0,"Int"), "read edit opacity")
         V48Assert(NumGet(alpha,0,"UChar") = 180, "edit mode previews the saved opacity while allowing interaction")
         IPM.Editing := false, IPMStyle(p)
         ex := DllCall("User32\GetWindowLongW","Ptr",hwnd,"Int",-20,"UInt")
         V48Assert((ex & 0x08000020) = 0x08000020, "locking restores both guards")
         DllCall("User32\GetLayeredWindowAttributes","Ptr",hwnd,"Ptr",0,"Ptr",alpha,"Ptr",0,"Int")
         V48Assert(NumGet(alpha,0,"UChar") = 180, "saved opacity restored")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int"), "style check never shows window")
     }
     finally {
         IPMDestroyPanels()
         IPM := old
     }
 }
 
 V521TestHiddenPositionRetention()
 {
     global IPM
     old := IPM
     try {
         IPM := IPMNewState(), IPM.Editing := true
         IPMEnsureGui("Damage")
         p := IPM.Panel
         p.Gui.GetPos(&x,&y)
         p.Gui.Move(x-80,y+40)
         IPMRememberPositions()
         V48Assert(p.X = x-80 && p.Y = y+40, "remember actual moved position, not original settings")
         beforeX := p.X, beforeY := p.Y
         IPM.Editing := false, IPMStyle(p)
         p.Gui.GetPos(&afterX,&afterY)
         V48Assert(afterX = beforeX && afterY = beforeY, "locking does not snap back")
         V48Assert(!IPM.TimerOn && !IPM.DragHooks, "hidden style/position tests do not start watchers")
     }
     finally {
         IPMDestroyPanels()
         IPM := old
     }
 }
 
 V521TestNoMouseCaptureInHarness()
 {
     global IPM
     old := IPM
     try {
         IPM := IPMNewState(), IPM.Editing := true
         IPMSyncDragHooks(), IPMSyncTimer()
         V48Assert(!IPM.DragHooks && !IPM.TimerOn, "harness cannot subscribe mouse hooks/timers")
         V48Assert(IPMDragMessage(1,0,0x0201,0) = "" && !IsObject(IPM.Drag), "harness cannot capture a real mouse")
         IPMDragPoll()
         V48Assert(!IsObject(IPM.Drag), "harness poll cannot move windows")
     }
     finally IPM := old
 }
 
 ; v52.2 single-window tests. Native GUI tests create hidden windows only.
 V522Isolated(action)
 {
     global IPM, IP, IrisBench, soundboardsEnabled, SETTINGS_FILE, persistenceTestMode
     oldM := IPM, oldP := IP, oldB := IrisBench, oldAudio := soundboardsEnabled
     oldFile := SETTINGS_FILE, oldMode := persistenceTestMode
     path := A_Temp "\IrisV522_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount ".ini"
     if FileExist(path)
         throw Error("Test temporary INI already exists.")
     try {
         SETTINGS_FILE := path, persistenceTestMode := false
         IPM := IPMNewState(), IP := IPNewApp(), IrisBench := {Active:true}, soundboardsEnabled := false
         action.Call()
     }
     finally {
         try IPMDestroyPanels()
         IPM := oldM, IP := oldP, IrisBench := oldB, soundboardsEnabled := oldAudio
         SETTINGS_FILE := oldFile, persistenceTestMode := oldMode
         if FileExist(path)
             FileDelete(path)
     }
 }
 
 V522TestSingleWindowDefaults()
 {
     s := IPMNewState()
     V48Assert(s.Mode=1 && IPMActiveViews(s).Length=1,"one active view by default, not four windows")
     V48Assert(s.Width=246 && s.Font=10 && s.MaxRows=8,"compact default dimensions")
     V48Assert(s.Metric="Personal" && !s.Wanted && !s.Editing && !s.TimerOn,"Personal selected without automatic startup")
     for p in IPMAllPanels(s)
         V48Assert(!IsObject(p.Gui),"unused split panels have no windows")
 }
 
 V522TestMetricCycle()
 {
     V48Assert(IPMNextMetric("Personal")="Damage" && IPMNextMetric("Damage")="Heal" && IPMNextMetric("Heal")="Taken" && IPMNextMetric("Taken")="Personal","four tabs wrap")
     V48Assert(IPMMetricIndex("Personal")=1 && IPMMetricIndex("Damage")=2 && IPMMetricIndex("Heal")=3 && IPMMetricIndex("Taken")=4,"Personal first tab")
     seen := Map()
     for choice in IPMKeyChoices() {
         for key in [choice.Key,choice.Cycle] {
             if key=""
                 continue
             V48Assert(!seen.Has(key) && !InStr(key,"F11") && !InStr(key,"F12"),"unique protected-key-safe chord")
             seen[key] := true
             for pair in IBOKeyPairs()
                 V48Assert(key!=pair.Show && key!=pair.Capture,"no IrisBench chord collision")
         }
     }
 }
 
 V522TestMigrationMatrix()
 {
     Loop 8 {
         flags := A_Index-1
         r := IPMLegacyChoice(Map("Damage",(flags & 1) != 0,"Heal",(flags & 2) != 0,"Taken",(flags & 4) != 0))
         expected := flags & 1 ? "Damage" : (flags & 2 ? "Heal" : (flags & 4 ? "Taken" : "Damage"))
         V48Assert(r.Metric = expected && r.Enabled = (flags != 0), "legacy multiple flags become exactly one selected view")
     }
 }
 
 V522TestLegacySettings()
 {
     V522Isolated(V522LegacySettingsCase)
 }
 
 V522LegacySettingsCase()
 {
     global IPM, SETTINGS_FILE
     IniWrite(1,SETTINGS_FILE,"IrisParseMeters","DamageEnabled")
     IniWrite(-800,SETTINGS_FILE,"IrisParseMeters","DamageX")
     IniWrite(120,SETTINGS_FILE,"IrisParseMeters","DamageY")
     IniWrite(700,SETTINGS_FILE,"IrisParseMeters","Width")
     IniWrite(200,SETTINGS_FILE,"IrisParseMeters","Opacity")
     IniWrite(3,SETTINGS_FILE,"IrisParseMeters","Key")
     IPMLoadSettings()
     V48Assert(IPM.Metric="Personal" && IPM.Enabled && IPM.Panel.X=-800 && IPM.Panel.Y=120,"new Personal view keeps prior position")
     V48Assert(IPM.Width=246 && IPM.Opacity=200 && IPM.KeyChoice=3,"compact new width, preserved old opacity/key")
     V48Assert(IniRead(SETTINGS_FILE,"IrisParseMeters","Width")="700" && !IsObject(IPM.Panel.Gui),"old settings retained and no window started")
 }
 
 V522TestNewSettingsPrecedence()
 {
     V522Isolated(V522NewSettingsCase)
 }
 
 V522NewSettingsCase()
 {
     global IPM, SETTINGS_FILE
     IniWrite(1,SETTINGS_FILE,"IrisParseMeter","Enabled")
     IniWrite("Taken",SETTINGS_FILE,"IrisParseDisplay","Metric")
     IniWrite(0,SETTINGS_FILE,"IrisParseDisplay","Enabled")
     IniWrite(400,SETTINGS_FILE,"IrisParseDisplay","CombinedWidth")
     IniWrite(-500,SETTINGS_FILE,"IrisParseDisplay","CombinedX")
     IniWrite(-300,SETTINGS_FILE,"IrisParseDisplay","CombinedY")
     IPMLoadSettings()
     V48Assert(!IPM.Enabled && IPM.Metric="Taken" && IPM.Width=400,"new display choices override migration")
     V48Assert(IPM.Panel.X=-500 && IPM.Panel.Y=-300,"new coordinates win")
     IniWrite("nonsense",SETTINGS_FILE,"IrisParseDisplay","Metric")
     IPMLoadSettings()
     V48Assert(IPM.Metric="Personal","invalid metric returns Personal")
 }
 
 V522TestSettingsRoundtrip()
 {
     V522Isolated(V522RoundtripCase)
 }
 
 V522RoundtripCase()
 {
     global IPM, SETTINGS_FILE
     IniWrite("retained",SETTINGS_FILE,"Unrelated","Value")
     IniWrite(1,SETTINGS_FILE,"IrisParseMeters","HealEnabled")
     IPM.Metric := "Heal", IPM.Panel.X := -1000, IPM.Panel.Y := 70
     IPM.Font := 11, IPM.Width := 410, IPM.Panel.Width := 410, IPM.Opacity := 181, IPM.MaxRows := 5
     IPM.Panel.Height := 330, IPM.Panel.AutoHeight := false
     IPM.Source := 2, IPM.Wanted := true, IPM.Editing := true
     IPMSaveSettings()
     IPM := IPMNewState(), IPMLoadSettings()
     V48Assert(IPM.Metric="Heal" && IPM.Width=410 && IPM.Font=11 && IPM.MaxRows=5 && IPM.Opacity=181,"appearance restored")
     V48Assert(IPM.Panel.X=-1000 && IPM.Panel.Y=70 && IPM.Panel.Height=330 && !IPM.Panel.AutoHeight,"position and resized shape restored")
     V48Assert(IPM.Source=2 && !IPM.Wanted && !IPM.Editing && !IPM.TimerOn,"source policy restored without startup capture/display action")
     V48Assert(IniRead(SETTINGS_FILE,"Unrelated","Value")="retained" && IniRead(SETTINGS_FILE,"IrisParseMeters","HealEnabled")="1","unrelated settings retained")
 }
 
 V522TestCycleKeepsData()
 {
     V522Isolated(V522CycleCase)
 }
 
 V522CycleCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     IP.Live := V52Fixture(), IP.Active := true, IPM.Wanted := true
     before := IP.Live, seg := IP.Live.Current, start := seg.Start, last := seg.Last
     IPM.Panel.X := -100, IPM.Panel.Y := 200
     Loop 4
         V48Assert(IPMCycle(),"next tab available without live game")
     V48Assert(IPM.Metric="Personal" && IPM.Panel.X=-100 && IPM.Panel.Y=200,"cycle preserves location")
     V48Assert(IP.Live=before && seg.Start=start && seg.Last=last && seg.Totals["@A#1"].Damage=10000,"no data/timing changes")
     V48Assert(IP.Active && IrisBench.Active && !soundboardsEnabled && IPM.Wanted,"engines untouched")
 }
 
 V522TestHiddenCycleDoesNotShow()
 {
     V522Isolated(V522HiddenCycleCase)
 }
 
 V522HiddenCycleCase()
 {
     global IPM, IP
     IP.Active := false
     V48Assert(IPMCycle() && IPM.Metric="Damage","hidden next tab selected")
     V48Assert(!IPM.Wanted && !IPM.Editing && !IPM.TimerOn && !IsObject(IPM.Panel.Gui) && !IP.Active,"no automatic showing or parsing")
     V48Assert(!IPMBindKey(1),"harness cannot register shortcuts")
 }
 
 V522TestInvalidAndBusySelection()
 {
     V522Isolated(V522InvalidCase)
 }
 
 V522InvalidCase()
 {
     global IPM
     V48Assert(!IPMSelectMetric("Bad") && IPM.Metric="Personal","invalid view rejected")
     IPM.Busy := true
     V48Assert(!IPMSelectMetric("Heal") && IPM.Metric="Personal","render fence respected")
     IPM.Busy := false
     V48Assert(IPMSelectMetric("Heal") && IPM.Updating=0,"valid selection releases fence")
 }
 
 V522TestAdaptiveHeight()
 {
     a := IPMCleanLayout(246,220,10,96,1920,1080,false,true,true,1,8)
     b := IPMCleanLayout(246,220,10,96,1920,1080,false,true,true,8,8)
     c := IPMCleanLayout(246,220,10,96,1920,1080,false,true,true,0,8)
     V48Assert(a.H=c.H && a.H<b.H,"auto height follows contributor count")
     a := IPMCleanLayout(246,330,10,96,1920,1080,false,true,false,1,8)
     b := IPMCleanLayout(246,330,10,96,1920,1080,false,true,false,8,8)
     V48Assert(a.H=b.H && a.H=330,"manual height never auto-snaps")
 }
 
 V522TestCompactLayout()
 {
     l := IPMCleanLayout(246,220,10,96,1920,1080,false,true,true,1,8)
     V48Assert(l.W=246 && l.H<=90,"compact solo leaderboard")
     l := IPMCleanLayout(246,220,10,96,1920,1080,true,true,true,1,8)
     V48Assert(l.H<=230 && l.Header+6*l.RowH+l.Footer<=l.H,"all Personal rows fit compact view")
 }
 
 V522TestStatusWarnings()
 {
     snap := {Partial:true,Pending:72,State:"SYNTHETIC DEMO"}
     text := IPMBadge(snap)
     V48Assert(InStr(text,"!") && InStr(text,"...") && InStr(text,"Demo"),"brief badges preserve quality and provenance")
     snap.Partial := false, snap.Pending := 0, snap.State := "STOPPED"
     V48Assert(IPMBadge(snap)="Stopped","stopped data never silently presented live")
 }
 
 V522TestTabsNotDragTargets()
 {
     p := {Tabs:Map("Damage",{Hwnd:10},"Heal",{Hwnd:11},"Taken",{Hwnd:12})}
     V48Assert(IPMIsTab(p,10) && IPMIsTab(p,11) && IPMIsTab(p,12), "all metric buttons excluded from drag initiation")
     V48Assert(!IPMIsTab(p,0) && !IPMIsTab(p,13), "unrelated text/background is not classified as a tab")
 }
 
 V522TestHiddenSameWindow()
 {
     V522Isolated(V522SameWindowCase)
 }
 
 V522SameWindowCase()
 {
     global IPM
     IPMEnsureGui("Personal"), hwnd := IPM.Panel.Gui.Hwnd
     for kind in IPMViews() {
         IPMSelectMetric(kind), IPMEnsureGui(kind)
         V48Assert(IPM.Panel.Gui.Hwnd=hwnd,"tabs reuse same HWND")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int"),"hidden test never shows")
     }
     V48Assert(IPM.Panel.Tabs.Count=4 && !IPM.TimerOn && !IPM.DragHooks,"four tabs without watchers")
 }
 
 V522TestHiddenMetricRendering()
 {
     V522Isolated(V522RenderCase)
 }
 
 V522RenderCase()
 {
     global IPM
     s := V52Fixture(), snap := IPMSnapshot({Data:s,Segment:s.Current,State:"STOPPED",Pending:0})
     IPMEnsureGui("Damage"), hwnd := IPM.Panel.Gui.Hwnd
     for kind in IPMKinds() {
         IPMSelectMetric(kind), IPMRender(kind,snap), p := IPM.Panel
         V48Assert(p.Gui.Hwnd=hwnd && p.RenderedMetric=kind && InStr(p.Heading.Text,IPMDefinition(kind).Title),"correct leaderboard in same window")
         first := IPMRank(snap.Actors,kind,p.Layout.N,true).Rows[1]
         V48Assert(p.Rows[1].Value.Text=IPMRowText(first,snap.Duration).Rate,"original rate calculation used")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int"),"render never shows hidden test")
     }
     IPMSelectMetric("Heal"), IPMRender("Heal",snap)
     V48Assert(IPM.Panel.Rows[1].Value.Text="200.0" && IPM.Panel.VisibleRows=1,"healer row correct")
     V48Assert(!IPM.Panel.Rows[2].Name.Visible,"old damage row hidden")
 }
 
 V522TestHiddenResizeAndPosition()
 {
     V522Isolated(V522PositionCase)
 }
 
 V522PositionCase()
 {
     global IPM
     IPMEnsureGui("Damage"), p := IPM.Panel, hwnd := p.Gui.Hwnd
     p.Gui.Move(-120,110), p.X := -120, p.Y := 110
     s := V52Fixture(), snap := IPMSnapshot({Data:s,Segment:s.Current,State:"STOPPED",Pending:0})
     IPMRender("Damage",snap), p.Gui.GetPos(&x,&y,,&h1)
     V48Assert(x = -120 && y = 110 && p.VisibleRows = 2, "two contributors rendered without changing coordinates")
     IPMSelectMetric("Heal"), IPMRender("Heal",snap), p.Gui.GetPos(&x,&y,,&h2)
     V48Assert(x = -120 && y = 110 && h2 < h1 && p.Gui.Hwnd = hwnd, "one-row view shrinks same HWND in place")
     IPM.Editing := true, IPMStyle(p), IPMRememberPositions()
     V48Assert(p.X = -120 && p.Y = 110, "drag/edit position remains one shared location")
     IPM.Editing := false, IPMStyle(p)
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int"), "resize/style never made a test window visible")
 }
 
 V53Snapshot()
 {
     s := V52Fixture()
     return IPMSnapshot({Data:s,Segment:s.Current,State:"STOPPED",Pending:0})
 }
 
 
 V53TestPersonalIdentity()
 {
     snap := V53Snapshot()
     a := IPMPersonalActor(snap,"","@A#1","",true)
     V48Assert(a.Key="@A#1","live identity selects local player")
     a := IPMPersonalActor(snap,"@B#2","@A#1","",true)
     V48Assert(a.Key="@B#2","explicit player choice used, name remains visible")
     a := IPMPersonalActor(snap,"","@A#1","@Healer#3",false)
     V48Assert(a.Key="@Healer#3","saved view uses selected saved player, not live toon")
 }
 
 
 V53TestPersonalUnknown()
 {
     snap := V53Snapshot(),snap.RecorderKey := "" ; neither tracker identifies the recorder
     V48Assert(!IsObject(IPMPersonalActor(snap,"","","",true)),"unknown local identity never picks top DPS")
     V48Assert(!IsObject(IPMPersonalActor(snap,"@Missing#7","@A#1","",true)),"missing explicit identity stays missing")
     V48Assert(!IsObject(IPMPersonalActor(snap,"","","",false)),"multi-player saved log requires choice")
     only := {Actors:[snap.Actors[1]]}
     V48Assert(IsObject(IPMPersonalActor(only,"","","",false)),"single-player saved log is unambiguous")
     V48Assert(!IsObject(IPMPersonalActor({Actors:[{Kind:"Companion",Key:"C:Pet"}]},"","","",false)),"companion is not user")
 }
 
 
 V53TestPersonalAmounts()
 {
     snap := V53Snapshot(), a := IPMPersonalActor(snap,"@A#1")
     rows := IPMPersonalRows(snap,a)
     V48Assert(rows[1].Total="10,000" && rows[1].Rate="1,000.0","personal DPS original totals")
     V48Assert(rows[4].Total="3,000" && rows[4].Rate="300.0","incoming damage distinct")
     V48Assert(rows[5].Total="5,000" && rows[5].Rate="500.0","healing received distinct")
     V48Assert(rows[6].Total="0" && rows[6].Rate="","death count not fictitious per-second metric")
 }
 
 
 V53TestPersonalEffective()
 {
     snap := V53Snapshot(), a := IPMPersonalActor(snap,"@Healer#3")
     rows := IPMPersonalRows(snap,a)
     V48Assert(rows[2].Label="EHPS" && rows[2].Total="2,000" && rows[2].Rate="200.0","effective throughput is the primary healing row")
     V48Assert(rows[3].Total="40%" && rows[3].Rate="","efficiency retained without duplicate rate")
     a.HealKnown := 0
     rows := IPMPersonalRows(snap,a)
     V48Assert(rows[2].Total="--" && rows[2].Rate="--" && rows[3].Total="--","partial effective data not zero or estimated")
     a.HealKnown := a.HealRecords, a.Effective := 0
     rows := IPMPersonalRows(snap,a)
     V48Assert(rows[2].Total="0" && rows[2].Rate="0.0" && rows[3].Total="0%","known zero differs from missing")
 }
 
 
 V53TestPersonalNoInventedStats()
 {
     snap := V53Snapshot(), rows := IPMPersonalRows(snap,"")
     V48Assert(rows.Length=6,"only supported personal metrics")
     for r in rows {
         V48Assert(r.Label!="APM" && r.Label!="TPS" && r.Label!="Abs","unsupported metric not fabricated")
         V48Assert(r.Total="--" && r.Rate="--","unknown player has no fabricated zero stats")
     }
     a := IPMPersonalActor(snap,"@A#1")
     rows := IPMPersonalRows(snap,a)
     V48Assert(rows[3].Total="--","no healing has undefined efficiency")
     snap.Duration := 0
     rows := IPMPersonalRows(snap,a)
     V48Assert(rows[1].Rate="--" && rows[1].Total="10,000","zero-duration unknown rate")
 }
 
 
 V53TestSnapshotFields()
 {
     s := V52Fixture(), snap := IPMSnapshot({Data:s,Segment:s.Current,State:"STOPPED",Pending:0})
     a := IPMPersonalActor(snap,"@A#1")
     V48Assert(a.Received=5000 && a.Deaths=0 && a.HealRecords=0,"personal copies appropriate counters")
     a.Received := 0
     V48Assert(s.Current.Totals["@A#1"].Received=5000,"personal copy cannot mutate aggregate")
     V48Assert(!snap.HasOwnProp("Events") && !snap.HasOwnProp("Rows"),"no heavy history copied per redraw")
 }
 
 
 V53TestBriefTitles()
 {
     V48Assert(IPMDefinition("Personal").Title="Personal" && IPMDefinition("Damage").Title="Raid Damage","screenshot-style concise headers")
     V48Assert(IPMDefinition("Heal").Title="Raid Healing~","healing leaderboard marks included shield estimates")
     for kind in IPMViews()
         V48Assert(!InStr(IPMDefinition(kind).Title,"IRIS /") && StrLen(IPMDefinition(kind).Title)<25,"no instructions in title")
 }
 
 
 V53TestResizeEdges()
 {
     V48Assert(IPMResizeEdge(1,100,246,220)="L" && IPMResizeEdge(245,100,246,220)="R","horizontal edges")
     V48Assert(IPMResizeEdge(100,1,246,220)="T" && IPMResizeEdge(100,219,246,220)="B","vertical edges")
     V48Assert(IPMResizeEdge(1,1,246,220)="LT" && IPMResizeEdge(245,219,246,220)="RB","corners")
     V48Assert(IPMResizeEdge(245,1,246,220)="RT" && IPMResizeEdge(1,219,246,220)="LB","opposite corners")
     V48Assert(IPMResizeEdge(100,100,246,220)="" && IPMResizeEdge(-1,100,246,220)="","body/outside are not resize targets")
 }
 
 
 V53ResizeFixture(edge)
 {
     return {X:100,Y:200,W:250,H:250,MouseX:350,MouseY:450,Edge:edge,MinW:196,MinH:200,MaxW:1200,MaxH:1000}
 }
 
 
 V53TestResizeRightBottom()
 {
     d := V53ResizeFixture("RB"), p := IPMResizePoint(d,400,550)
     V48Assert(p.X=100 && p.Y=200 && p.W=300 && p.H=350,"right/bottom expands without moving origin")
     d.Edge := "R", p := IPMResizePoint(d,400,550)
     V48Assert(p.W=300 && p.H=250,"right edge changes width only")
     d.Edge := "B", p := IPMResizePoint(d,400,550)
     V48Assert(p.W=250 && p.H=350,"bottom edge changes height only")
 }
 
 
 V53TestResizeLeftTop()
 {
     d := V53ResizeFixture("LT"), p := IPMResizePoint(d,300,400)
     V48Assert(p.X=50 && p.Y=150 && p.W=300 && p.H=300,"left/top keeps opposite corner fixed")
     V48Assert(p.X+p.W=d.X+d.W && p.Y+p.H=d.Y+d.H,"opposite edge invariant")
 }
 
 
 V53TestResizeBounds()
 {
     d := V53ResizeFixture("LT"), p := IPMResizePoint(d,2000,2000)
     V48Assert(p.W=196 && p.H=200 && p.X+p.W=350 && p.Y+p.H=450,"minimum size clamps without drifting anchor")
     d.Edge := "RB", p := IPMResizePoint(d,10000,10000)
     V48Assert(p.W=1200 && p.H=1000,"maximum resize bounds")
 }
 
 
 V53TestResizeSignedCoordinates()
 {
     d := V53ResizeFixture("LT"), d.X := -900, d.Y := -500, d.MouseX := -900, d.MouseY := -500
     p := IPMResizePoint(d,-1000,-600)
     V48Assert(p.X=-1000 && p.Y=-600 && p.W=350 && p.H=350,"negative-monitor resize works without unsigned wrap")
 }
 
 
 V53TestFixedHeightAndColumns()
 {
     for personal in [false,true] {
         a := IPMCleanLayout(310,350,10,96,1920,1080,personal,true,false,1,8)
         b := IPMCleanLayout(310,350,10,96,1920,1080,personal,true,false,24,8)
         V48Assert(a.W=310 && a.H=350 && b.H=350,"fixed geometry unaffected by contributor count")
         V48Assert(a.NameW+a.TotalW+a.RateW+2*a.Margin<=a.W,"columns never overlap outside panel")
         if personal
             V48Assert(a.Header+6*a.RowH+a.Footer<=a.H,"all personal metrics visible")
     }
 }
 
 
 V53TestSmallScreenAndDpi()
 {
     for dpi in [96,120,144,192] {
         for kind in IPMViews() {
             for w in [196,246,420,1200] {
                 l := IPMCleanLayout(w,220,18,dpi,1280,720,kind="Personal",true,true,24,24)
                 V48Assert(l.W<=1256 && l.H<=696 && l.Font>=8 && l.Font<=18,"bounded geometry/fonts")
                 V48Assert(l.NameW>30 && l.RateW>0 && l.TotalW>0,"columns stay present")
             }
         }
     }
 }
 
 
 V53TestSplitOwnership()
 {
     s := IPMNewState(), s.Mode := 2, s.Editing := true
     s.Panels["Damage"].Gui := {Hwnd:5301}, s.Panels["Damage"].Drawn := true
     s.Panels["Heal"].Gui := {Hwnd:5302}, s.Panels["Heal"].Drawn := true
     V48Assert(IPMDragPanel(s,5301)="Damage" && IPMDragPanel(s,5302)="Heal","separate windows have independent drag ownership")
     s.Shown["Heal"] := false
     V48Assert(IPMDragPanel(s,5302)="","disabled separate panel cannot be dragged")
     s.Mode := 1
     V48Assert(IPMDragPanel(s,5301)="","dormant split HWND rejected in tabbed mode")
 }
 
 
 V53TestActiveViewPolicies()
 {
     s := IPMNewState()
     V48Assert(IPMActiveViews(s).Length=1 && IPMActiveViews(s)[1]="Personal","tabbed one view")
     s.Mode := 2
     V48Assert(IPMActiveViews(s).Length=3,"separate default Personal damage healing")
     for k in IPMViews()
         s.Shown[k] := false
     V48Assert(IPMActiveViews(s).Length=0,"no selected panels yields none")
     s.Shown["Taken"] := true
     V48Assert(IPMActiveViews(s).Length=1 && IPMActiveViews(s)[1]="Taken","independent taken toggle")
     s.Enabled := false
     V48Assert(IPMActiveViews(s).Length=0,"global display master wins")
 }
 
 
 V53TestSplitHiddenWindows()
 {
     V522Isolated(V53SplitWindowsCase)
 }
 
 
 V53SplitWindowsCase()
 {
     global IPM
     IPM.Mode := 2
     seen := Map()
     for kind in ["Personal","Damage","Heal"] {
         IPMEnsureGui(kind), p := IPM.Panels[kind]
         V48Assert(!seen.Has(p.Gui.Hwnd) && p.Tabs.Count=0,"split panels distinct, no tab chrome")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"split test hidden")
         seen[p.Gui.Hwnd] := true
     }
     V48Assert(!IsObject(IPM.Panel.Gui),"no redundant combined window in split mode")
 }
 
 
 V53TestSplitSettingsRoundtrip()
 {
     V522Isolated(V53SplitSettingsCase)
 }
 
 
 V53SplitSettingsCase()
 {
     global IPM
     IPM.Mode := 2, IPM.Panels["Heal"].X := -600, IPM.Panels["Heal"].Y := 250
     IPM.Panels["Heal"].Width := 360, IPM.Panels["Heal"].Height := 420, IPM.Panels["Heal"].AutoHeight := false
     IPM.Shown["Personal"] := false, IPM.Shown["Taken"] := true, IPM.PersonalKey := "@Test#9"
     IPMSaveSettings(), IPM := IPMNewState(), IPMLoadSettings()
     V48Assert(IPM.Mode=2 && IPM.Shown["Taken"] && !IPM.Shown["Personal"],"split mode and individual choices restored")
     p := IPM.Panels["Heal"]
     V48Assert(p.X=-600 && p.Y=250 && p.Width=360 && p.Height=420 && !p.AutoHeight,"independent resized geometry restored")
     V48Assert(IPM.PersonalKey="" && !IPM.Wanted && !IPM.TimerOn,"identity and live visibility not silently restored")
 }
 
 
 V53TestNoRollbackWrites()
 {
     V522Isolated(V53RollbackCase)
 }
 
 
 V53RollbackCase()
 {
     global SETTINGS_FILE
     IniWrite("old",SETTINGS_FILE,"IrisParseMeter","Metric")
     IniWrite("old",SETTINGS_FILE,"IrisParseMeters","Width")
     IniWrite("old",SETTINGS_FILE,"IrisBenchOverlay","Font")
     IPMSaveSettings()
     V48Assert(IniRead(SETTINGS_FILE,"IrisParseMeter","Metric")="old" && IniRead(SETTINGS_FILE,"IrisParseMeters","Width")="old","rollback layouts untouched")
     V48Assert(IniRead(SETTINGS_FILE,"IrisBenchOverlay","Font")="old","Bench settings untouched")
 }
 
 
 V53TestBadges()
 {
     for pair in [["IMPORTED","Saved"],["SYNTHETIC DEMO","Demo"],["STOPPED","Stopped"],["LIVE HISTORY","History"],["LIVE LOG",""]] {
         snap := {State:pair[1],Partial:false,Pending:0}
         V48Assert(IPMBadge(snap)=pair[2],"concise source badge " pair[1])
     }
     snap := {State:"IMPORTED",Partial:true,Pending:0}
     V48Assert(InStr(IPMBadge(snap),"!") && InStr(IPMBadge(snap),"Saved"),"incomplete data keeps source too")
 }
 
 
 V53TestNoEngineChangesOnSplitHide()
 {
     V522Isolated(V53SplitHideCase)
 }
 
 
 V53SplitHideCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     IPM.Mode := 2, IPM.Wanted := true, IP.Active := true, IP.Live := V52Fixture()
     original := IP.Live, duration := IPDuration(IP.Live.Current)
     IPMHide()
     V48Assert(IP.Active && IrisBench.Active && !soundboardsEnabled,"split hide never stops parser, capture or changes mute")
     V48Assert(IP.Live=original && IPDuration(IP.Live.Current)=duration,"totals/interval unchanged")
     V48Assert(!IPM.TimerOn && !IPM.DragHooks,"hide leaves no edit/focus watchers")
 }
 
 
 V53TestManualResizeHidden()
 {
     V522Isolated(V53ManualResizeCase)
 }
 
 
 V53ManualResizeCase()
 {
     global IPM
     snap := V53Snapshot()
     IPMEnsureGui("Damage"), p := IPM.Panel
     p.Width := 400, IPM.Width := 400, p.Height := 350, p.AutoHeight := false
     IPMRender("Damage",snap), p.Gui.GetPos(&x,&y,&w,&h)
     V48Assert(w=p.Layout.W && h=p.Layout.H,"explicit width/height applied to HWND")
     oldH := h
     IPMSelectMetric("Heal"), IPMRender("Heal",snap), p.Gui.GetPos(&x,&y,&w,&h)
     V48Assert(h=oldH,"manual height not reset on leaderboard switch")
     p.AutoHeight := true, IPMRender("Heal",snap), p.Gui.GetPos(&x,&y,&w,&h)
     V48Assert(h<oldH,"Fit height can be restored deliberately")
 }
 
 
 V53TestCompactNumbers()
 {
     V48Assert(IPMShortNumber(2031116)="2.03 m" && IPMShortNumber(10000)="10.0 k","narrow totals abbreviate")
     V48Assert(IPMShortNumber(99)="99" && IPMShortNumber(0)="0","small totals remain exact")
     V48Assert(IPMNumber(IPRate(2031116,59.413))="34,186.4","display does not change approved DPS formula")
 }
 
 
 V53TestTimeLabels()
 {
     V48Assert(IPMTime(59.413)="00:59" && IPMTime(69)="01:09" && IPMTime(3600)="1:00:00","compact time label")
     V48Assert(IPMTime(0)="00:00","zero interval label")
 }
 
 
 V53TestPersonalHiddenRendering()
 {
     V522Isolated(V53PersonalRenderingCase)
 }
 
 
 V53PersonalRenderingCase()
 {
     global IPM, localPlayerToken
     oldLocal := localPlayerToken
     try {
         localPlayerToken := "@A#1"
         snap := V53Snapshot(), IPMEnsureGui("Personal"), IPMRender("Personal",snap)
         p := IPM.Panel
         V48Assert(InStr(p.Heading.Text,"Personal") && p.Meta.Text="A" && p.Scope.Text="00:10","Personal header, actual identity and time")
         V48Assert(p.PersonalRows[1].Value.Text="1,000.0" && p.PersonalRows[4].Value.Text="300.0","Personal numbers rendered")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"personal test hidden")
         IPMSelectMetric("Damage"), IPMRender("Damage",snap)
         V48Assert(p.RenderedMetric="Damage" && !p.PersonalRows[1].Name.Visible,"personal rows disappear for leaderboard")
     }
     finally localPlayerToken := oldLocal
 }
 
 
 V53TestSplitCycleIsNotAHide()
 {
     V522Isolated(V53SplitCycleCase)
 }
 
 
 V53SplitCycleCase()
 {
     global IPM
     IPM.Mode := 2, IPM.Wanted := true
     V48Assert(!IPMCycle() && IPM.Wanted && IPM.Metric="Personal","next-tab key has no unwanted split-panel effect")
 }
 
 
 V53TestResetGeometryPersistence()
 {
     V522Isolated(V53ResetGeometryCase)
 }
 
 
 V53ResetGeometryCase()
 {
     global IPM, SETTINGS_FILE
     IniWrite(-500,SETTINGS_FILE,"IrisParseMeter","X")
     IniWrite(180,SETTINGS_FILE,"IrisParseMeter","Y")
     IPM.Panel.X := 900, IPM.Panel.Y := 120
     IPM.Panel.Width := 490, IPM.Panel.Height := 470, IPM.Panel.AutoHeight := false
     IPM.Panels["Damage"].X := 700, IPM.Panels["Damage"].Y := 310
     IPMSaveSettings()
     IPMResetPositions()
     IPM := IPMNewState(), IPMLoadSettings()
     V48Assert(IPM.Panel.X="" && IPM.Panel.Y="", "reset does not resurrect combined or legacy coordinates")
     V48Assert(IPM.Panels["Damage"].X="" && IPM.Panels["Damage"].Y="", "reset clears split coordinates")
     V48Assert(IPM.Panel.Width=246 && IPM.Panel.Height=220 && IPM.Panel.AutoHeight,"reset shape persists")
     V48Assert(IniRead(SETTINGS_FILE,"IrisParseMeter","X")="-500","rollback coordinates remain untouched")
 }
 
 ; v53.1 clickable tab tests. No real mouse input or visible test windows.
 V531TestDefaults()
 {
     s := IPMNewState()
     V48Assert(s.ClickTabs && !s.TabHooks && !s.Wanted && !s.TimerOn,"clickable preference does not auto-show or start work")
     for p in IPMAllPanels(s)
         V48Assert(!IsObject(p.TabGui) && !p.TabDrawn && p.TabButtons.Count=0,"no input surfaces at startup")
 }
 
 V531TestLockedClickPolicy()
 {
     s := IPMNewState(), s.Wanted := true
     V48Assert(IPMTabAllowed(s,"locked",true,true),"locked tabs usable without edit")
     V48Assert(!IPMTabAllowed(s,"edit",true,true),"old underlying controls cannot bypass locked policy")
     s.ClickTabs := false
     V48Assert(!IPMTabAllowed(s,"locked",true,true),"full click-through option respected")
     s.Editing := true
     V48Assert(IPMTabAllowed(s,"edit",true,false),"explicit editing still allows tabs with preference off")
     V48Assert(!IPMTabAllowed(s,"locked",true,true),"invisible duplicate surface not active in edit")
 }
 
 V531TestClickGuards()
 {
     s := IPMNewState(), s.Wanted := true
     V48Assert(!IPMTabAllowed(s,"locked",false,true) && !IPMTabAllowed(s,"locked",true,false),"hidden and unfocused clicks rejected")
     s.Wanted := false
     V48Assert(!IPMTabAllowed(s,"locked",true,true),"hidden request respected")
     s.Wanted := true, s.Enabled := false
     V48Assert(!IPMTabAllowed(s,"locked",true,true),"master respected")
     s.Enabled := true, s.Mode := 2
     V48Assert(!IPMTabAllowed(s,"locked",true,true),"split layout has no tab action")
     s.Mode := 1, s.Busy := true
     V48Assert(!IPMTabAllowed(s,"locked",true,true),"render fence respected")
     s.Busy := false, s.Updating := 1
     V48Assert(!IPMTabAllowed(s,"locked",true,true),"settings fence respected")
     s.Updating := 0, s.Drag := {Hwnd:1}
     V48Assert(!IPMTabAllowed(s,"locked",true,true),"drag cannot also select a view")
 }
 
 V531TestSurfaceVisibilityMatrix()
 {
     Loop 128 {
         n := A_Index-1, s := IPMNewState()
         s.Enabled := (n & 1)!=0, s.Mode := (n & 2) ? 1 : 2
         s.ClickTabs := (n & 4)!=0, s.Wanted := (n & 8)!=0, s.Editing := (n & 16)!=0
         body := (n & 32)!=0, game := (n & 64)!=0
         expected := s.Enabled && s.Mode=1 && s.ClickTabs && s.Wanted && !s.Editing && body && game
         V48Assert(IPMTabSurfaceNeeded(s,body,game)=expected,"tab input visible only over requested locked game meter")
     }
 }
 
 V531TestTabOwnership()
 {
     p := IPMNewPanel(), p.Gui := {Hwnd:101}, p.TabGui := {Hwnd:201}
     p.Tabs["Damage"] := {Hwnd:102}, p.TabButtons["Damage"] := {Hwnd:202}
     V48Assert(IPMTabClickOrigin(p,"Damage",102)="edit" && IPMTabClickOrigin(p,"Damage",202)="locked","exact control routing")
     V48Assert(IPMTabClickOrigin(p,"Heal",202)="" && IPMTabClickOrigin(p,"Damage",999)="","stale/mismatched controls rejected")
     V48Assert(IPMTabSurfaceOwns(p,201) && IPMTabSurfaceOwns(p,202),"owned surface and child recognized")
     V48Assert(!IPMTabSurfaceOwns(p,101) && !IPMTabSurfaceOwns(p,102) && !IPMTabSurfaceOwns(p,0),"body and other windows are not nav surface")
 }
 
 V531TestTabCoordinates()
 {
     for dpi in [96,120,144,192] {
         for w in [196,246,421,1199] {
             l := IPMCleanLayout(w,330,10,dpi,2560,1440,false,true,false,8,8)
             r := IPMTabRect(-1700,-100,l)
             V48Assert(r.X=-1700 && r.Y=-100+l.Head && r.W=l.W && r.H=l.TabH,"signed coordinates and no double DPI scale")
             edge := 0
             Loop 4 {
                 left := Floor((A_Index-1)*r.W/4), right := Floor(A_Index*r.W/4)
                 V48Assert(left=edge && right>left,"no gaps/overlap in tab click cells")
                 edge := right
             }
             V48Assert(edge=r.W && r.Y+r.H<=-100+l.Header,"input never extends into body")
         }
     }
 }
 
 V531TestHiddenSurfaceStyles()
 {
     V522Isolated(V531HiddenStylesCase)
 }
 
 V531HiddenStylesCase()
 {
     global IPM
     IPMEnsureGui("Personal"), p := IPM.Panel
     V48Assert(IPMEnsureTabSurface(p),"create hidden surface")
     body := DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt")
     tabs := DllCall("User32\GetWindowLongW","Ptr",p.TabGui.Hwnd,"Int",-20,"UInt")
     V48Assert((body & 0x08000020)=0x08000020,"body remains click-through and noactivate")
     V48Assert((tabs & 0x08000000)!=0 && (tabs & 0x20)=0 && (tabs & 0x80000)!=0,"input surface receives clicks without activating")
     V48Assert(DllCall("User32\GetWindow","Ptr",p.TabGui.Hwnd,"UInt",4,"Ptr")=p.Gui.Hwnd,"surface owned by meter")
     alpha := Buffer(1,0)
     V48Assert(DllCall("User32\GetLayeredWindowAttributes","Ptr",p.TabGui.Hwnd,"Ptr",0,"Ptr",alpha,"Ptr",0,"Int"),"read alpha")
     V48Assert(NumGet(alpha,0,"UChar")=1 && p.TabButtons.Count=4,"only four nonzero-alpha click cells")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int") && !DllCall("User32\IsWindowVisible","Ptr",p.TabGui.Hwnd,"Int"),"tests never show windows")
     V48Assert(!IPM.TabHooks && !IPM.TimerOn && !IPM.DragHooks,"no active hooks or polling in test")
 }
 
 V531TestHiddenSurfaceGeometry()
 {
     V522Isolated(V531HiddenGeometryCase)
 }
 
 V531HiddenGeometryCase()
 {
     global IPM
     IPMEnsureGui("Damage"), p := IPM.Panel, snap := V53Snapshot()
     IPMRender("Damage",snap), IPMEnsureTabSurface(p)
     p.Gui.Move(-400,75)
     V48Assert(IPMPlaceTabSurface(p),"position hidden surface")
     p.TabGui.GetPos(&x,&y,&w,&h)
     V48Assert(x=-400 && y=75+p.Layout.Head && w=p.Layout.W && h=p.Layout.TabH,"actual parent location not stale saved coordinates")
     parent := p.Gui.Hwnd, nav := p.TabGui.Hwnd
     p.Width := 470, p.Height := 390, p.AutoHeight := false
     IPMRender("Personal",snap), IPMPlaceTabSurface(p)
     p.TabGui.GetPos(&x,&y,&w,&h)
     V48Assert(w=p.Layout.W && h=p.Layout.TabH && p.Gui.Hwnd=parent && p.TabGui.Hwnd=nav,"resize reuses and aligns same surfaces")
     for i,kind in IPMViews() {
         p.TabButtons[kind].GetPos(&cx,&cy,&cw,&ch)
         V48Assert(cx=Floor((i-1)*w/4) && cy=0 && cw=Floor(i*w/4)-cx && ch=h,"cells match visual tab geometry")
     }
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",nav,"Int"),"geometry never shows window")
 }
 
 V531TestNonActivationMessages()
 {
     V522Isolated(V531MessagesCase)
 }
 
 V531MessagesCase()
 {
     global IPM
     IPMEnsureGui("Personal"), p := IPM.Panel, IPMEnsureTabSurface(p)
     p.TabDrawn := true ; synthetic visibility flag, actual window remains hidden
     V48Assert(IPMTabMessage(0,0,0x21,p.TabGui.Hwnd)=3,"MA_NOACTIVATE does not eat click")
     V48Assert(IPMTabMessage(0,0,0x21,p.TabButtons["Damage"].Hwnd)=3,"child guard too")
     V48Assert(IPMTabMessage(0,0,0x21,p.Gui.Hwnd)="","body message not intercepted")
     V48Assert(IPMTabMessage(0,0,0x203,p.TabButtons["Damage"].Hwnd)=0,"double-click default clipboard action suppressed")
     p.TabDrawn := false
     V48Assert(IPMTabMessage(0,0,0x21,p.TabGui.Hwnd)="","hidden surface inert")
 }
 
 V531TestPreferenceRoundtrip()
 {
     V522Isolated(V531PreferencesCase)
 }
 
 V531PreferencesCase()
 {
     global IPM, SETTINGS_FILE
     IniWrite("keep",SETTINGS_FILE,"Other","Value")
     IPMLoadSettings()
     V48Assert(IPM.ClickTabs,"missing preference defaults clickable")
     IPM.ClickTabs := false, IPMSaveSettings(), IPM := IPMNewState(), IPMLoadSettings()
     V48Assert(!IPM.ClickTabs && IniRead(SETTINGS_FILE,"Other","Value")="keep","saved full click-through wins; other settings retained")
     IPM.ClickTabs := true, IPMSaveSettings(), IPM := IPMNewState(), IPMLoadSettings()
     V48Assert(IPM.ClickTabs && !IPM.Wanted && !IPM.TimerOn && !IPM.TabHooks,"preference restore does not start display")
 }
 
 V531TestHideDestroyLifecycle()
 {
     V522Isolated(V531LifecycleCase)
 }
 
 V531LifecycleCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     IPMEnsureGui("Personal"), p := IPM.Panel, IPMEnsureTabSurface(p)
     hwnd := p.TabGui.Hwnd, IP.Active := true, p.TabDrawn := true, IPM.Wanted := true
     IPMHide()
     V48Assert(!p.TabDrawn && !IPM.Wanted && !IPM.TabHooks,"hide retires surface and hooks")
     V48Assert(IP.Active && IrisBench.Active && !soundboardsEnabled,"stats/bench/audio untouched")
     IPMDestroyPanels()
     V48Assert(!IsObject(p.TabGui) && !IsObject(p.Gui) && !DllCall("User32\IsWindow","Ptr",hwnd,"Int"),"destroy disposes owned surface before body")
     V48Assert(p.TabButtons.Count=0 && !p.TabDrawn,"no stale click control handles")
 }
 
 V531TestEditAndSplitIsolation()
 {
     V522Isolated(V531EditSplitCase)
 }
 
 V531EditSplitCase()
 {
     global IPM
     IPMEnsureGui("Damage"), p := IPM.Panel, IPMEnsureTabSurface(p), p.TabDrawn := true
     IPM.Editing := true, IPMStyle(p)
     V48Assert(!p.TabDrawn && !IPMEnsureTabSurface(p),"edit retires locked surface and uses original tabs")
     IPM.Editing := false, IPMDestroyPanels(), IPM.Mode := 2
     for kind in IPMViews() {
         IPMEnsureGui(kind), other := IPM.Panels[kind]
         V48Assert(!IPMEnsureTabSurface(other) && !IsObject(other.TabGui),"separate panels remain fully click-through when locked")
     }
 }
 
 V531TestNoVisibleOrInputWorkInHarness()
 {
     V522Isolated(V531HarnessCase)
 }
 
 V531HarnessCase()
 {
     global IPM
     IPMEnsureGui("Personal"), p := IPM.Panel, p.Drawn := true, IPM.Wanted := true
     IPMSyncTabSurface(p,true), IPMSyncTabHooks()
     V48Assert(!IsObject(p.TabGui) && !p.TabDrawn && !IPM.TabHooks,"normal sync cannot create visible test input surface")
     V48Assert(!IPMTabClicked("Damage") && IPM.Metric="Personal","no anonymous click injection")
     IPMEnsureTabSurface(p)
     V48Assert(!IPMTabClicked("Damage",p.TabButtons["Damage"]) && IPM.Metric="Personal","hidden control cannot select even when explicitly invoked")
 }
 
 V531TestViewSelectionKeepsTotals()
 {
     V522Isolated(V531TotalsCase)
 }
 
 V531TotalsCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     IP.Live := V52Fixture(), IP.Active := true, IPM.Wanted := true
     s := IP.Live, seg := s.Current, first := seg.Start, last := seg.Last
     before := IPSummary(s,seg)
     for kind in IPMViews() {
         V48Assert(IPMTabAllowed(IPM,"locked",true,true),"locked policy permits view")
         V48Assert(IPMSelectMetric(kind) && IPM.Metric=kind,"existing selection handles tab")
     }
     V48Assert(s=IP.Live && first=seg.Start && last=seg.Last && before=IPSummary(s,seg),"all totals and timing remain identical")
     V48Assert(IP.Active && IrisBench.Active && !soundboardsEnabled && !IPM.Editing,"no engine or edit-mode changes")
 }
 
 ; v53.2 effective-healing regressions. All fixtures are synthetic and silent.
 V532Actor(key, raw, effective, known := 1, records := 1)
 {
     t := IPNewTotals()
     t.Key := key, t.Name := key, t.Kind := "Player"
     t.Heal := raw, t.Effective := effective, t.HealKnown := known, t.HealRecords := records
     return t
 }
 
 V532Fixture()
 {
     s := IPNewData("Effective-healing regression")
     V51Feed(s,0,"Enter",0,"@HealerA#501","=")
     a := "@HealerA#501|(0,0,0,0)|(900/1000)"
     b := "@HealerB#502|(0,0,0,0)|(900/1000)"
     target := "@Tank#503|(0,0,0,0)|(500/1000)"
     V51Feed(s,1000,"Heal",8000,a,target,false,1000,"900000000000011")
     V51Feed(s,2000,"Heal",4000,a,target,false,0,"900000000000012")
     V51Feed(s,3000,"Heal",5000,b,target,true,4000,"900000000000011")
     V51Feed(s,10000,"Heal",2000,b,target,false,-1,"900000000000012")
     return s
 }
 
 V532TestExplicitEffective()
 {
     e := IPHealResult(" (12000* ~3500) <1575.0>",true)
     V48Assert(e.ValueOK && e.Amount=12000 && e.Effective=3500 && e.Crit,"explicit actual heal instead of raw result")
     V48Assert(e.Source="explicit","explicit amount provenance")
     e := IPHealResult("(12000 ~3500)",false)
     V48Assert(e.Effective=3500,"explicit effective value works without guessing legacy threat")
 }
 
 V532TestModernEqualHealing()
 {
     for text in ["(500)"," (500*) <225.0>","(500.0) "] {
         e := IPHealResult(text,true)
         V48Assert(e.ValueOK && e.Effective=500 && e.Source="same","absent tilde in modern format is full effectiveness")
     }
     line := IPDemoLine(1000,V51Source(),"=","Heal",500)
     V48Assert(IPParseLine(line).Effective=500,"modern actor fields route same-value heals")
     V48Assert(IPModernHealFields(V51Source(),"=") && !IPModernHealFields("@Legacy#1","@Legacy#2"),"format detection is not an HP delta")
 }
 
 V532TestFullOverhealAndZero()
 {
     e := IPHealResult("(9000 ~0)",true)
     V48Assert(e.Effective=0 && e.Amount=9000 && e.Source="explicit","full overheal contributes no effective healing")
     V48Assert(IPHealResult("(0)",false).Effective=0,"known zero does not require a fabricated estimate")
     t := V532Actor("A",9000,0)
     V48Assert(IPEffectiveTotal(t)=0,"complete zero is not unknown")
 }
 
 V532TestLegacyUnknown()
 {
     e := IPParseLine(IPDemoLine(1000,"@Legacy#1","=","Heal",500))
     V48Assert(e.ValueOK && e.Amount=500 && e.Effective=-1,"legacy no-tilde heal is not assumed fully effective")
     V48Assert(IPHealResult("(500) <225.0>",false).Effective=-1,"no threat-based estimate")
     t := V532Actor("A",500,0,0)
     V48Assert(IPEffectiveTotal(t)=-1,"missing coverage does not fall back to raw")
 }
 
 V532TestMalformedEffective()
 {
     for text in ["(500 ~oops)","(500 ~-20)","(500 ~)","(500 ~999)","(500 ~20 ~30)","(500 ~20) garbage"] {
         e := IPHealResult(text,true)
         V48Assert(e.ValueOK && e.Amount=500 && e.Effective=-1 && e.Source="invalid","bad effective field retains raw without fabricating full healing")
     }
     V48Assert(!IPHealResult("(oops)",true).ValueOK && !IPHealResult("(1000000000001)",true).ValueOK,"invalid raw or unreasonable raw rejected")
 }
 
 V532TestRoundingBound()
 {
     e := IPHealResult("(500 ~501)",true)
     V48Assert(e.Effective=500 && e.Source="rounded","one-point display rounding difference bounded to raw")
     V48Assert(IPHealResult("(500 ~502)",true).Effective=-1,"larger impossible effective amount not silently capped")
 }
 
 V532TestAggregationAndProvenance()
 {
     s := V532Fixture(), seg := s.Current, a := seg.Totals["@HealerA#501"], b := seg.Totals["@HealerB#502"]
     V48Assert(a.Heal=12000 && a.Effective=1000 && b.Heal=7000 && b.Effective=6000,"both raw and effective totals retained")
     V48Assert(s.ExplicitHeals=3 && s.SameHeals=1 && s.MissingEffective=0,"field provenance tracked without omitting full-effective heals")
     V48Assert(IPDuration(seg)=10 && IPRate(b.Effective,10)="600.0","same recorded denominator")
 }
 
 V532TestUnknownQuality()
 {
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V51Source(),"=")
     line := IPDemoLine(1000,V51Source(),"=","Heal",500,false,200)
     IPFeedLine(s,StrReplace(line,"~200","~bad"))
     t := s.Current.Totals[IPActor(V51Source()).Key]
     V48Assert(t.Heal=500 && IPEffectiveTotal(t)=-1,"broken effective field never makes a complete total")
     V48Assert(s.BadEffective=1 && s.MissingEffective=1 && InStr(IPQuality(s),"malformed effective fields=1"),"unknown effective accounting disclosed")
 }
 
 V532TestEffectiveRanking()
 {
     s := V532Fixture(), snap := IPMSnapshot({Data:s,Segment:s.Current,State:"STOPPED",Pending:0})
     rows := IPMRank(snap.Actors,"Heal",8)
     V48Assert(rows.Rows[1].Key="@HealerB#502" && rows.Rows[1].Amount=6000,"effective leader wins despite lower raw healing")
     V48Assert(rows.Rows[2].Key="@HealerA#501" && rows.Total=7000 && rows.Peak=6000,"bars and totals use effective healing")
     V48Assert(IPMRowText(rows.Rows[1],snap.Duration).Rate="600.0","leaderboard EHPS")
 }
 
 V532TestUnknownAndZeroRanking()
 {
     actors := [V532Actor("@Unknown",100000,3000,1,2),V532Actor("@Zero",5000,0),V532Actor("@Known",1000,500)]
     r := IPMRank(actors,"Heal",8)
     V48Assert(r.Rows[1].Key="@Known" && r.Rows[2].Key="@Zero" && r.Rows[3].Key="@Unknown","unknown never outranks complete totals")
     V48Assert(r.Total=500 && r.Unknown=1 && r.Peak=500,"partial known subtotal not added to complete displayed totals")
     V48Assert(IPMRowText(r.Rows[3],10).Rate="--" && IPMBarValue(r.Rows[3].Amount,r.Peak)=0,"unknown not a fake number or bar")
     V48Assert(IPMRank([V532Actor("Empty",0,0,0,0)],"Heal",8).Count=0,"no-heal players do not fill the board")
 }
 
 V532TestSnapshotAndRawPreserved()
 {
     s := V532Fixture(), snap := IPMSnapshot({Data:s,Segment:s.Current,State:"STOPPED",Pending:0})
     a := IPMPersonalActor(snap,"@HealerA#501")
     a.Effective := 0
     V48Assert(s.Current.Totals["@HealerA#501"].Effective=1000 && a.Heal=12000,"snapshot changes cannot alter raw or effective aggregates")
     V48Assert(IPMDefinition("Heal").Rate="EHPS~" && InStr(IPMDefinition("Heal").Scope,"estimated shields"),"effective label distinguishes additional shield estimates without changing saved metric identity")
 }
 
 V532TestPersonalHeadline()
 {
     s := V532Fixture(), snap := IPMSnapshot({Data:s,Segment:s.Current,State:"STOPPED",Pending:0})
     a := IPMPersonalActor(snap,"@HealerB#502"), rows := IPMPersonalRows(snap,a)
     V48Assert(rows[2].Label="EHPS" && rows[2].Total="6,000" && rows[2].Rate="600.0","personal primary healing is effective")
     V48Assert(rows[3].Total="86%" && rows[3].Rate="","efficiency retained as separate percentage")
     a.HealKnown := 0
     V48Assert(IPMPersonalRows(snap,a)[2].Total="--","unknown personal value not zero or raw")
 }
 
 V532TestEffectiveBreakdown()
 {
     s := V532Fixture(), seg := s.Current
     raw := IPBreakdown(seg,"@HealerB#502","Heal")
     eff := IPBreakdown(seg,"@HealerB#502","EffectiveHeal","@Tank#503")
     V48Assert(raw["900000000000011"].Total=5000 && eff["900000000000011"].Total=4000,"raw and effective ability views distinct")
     V48Assert(eff["900000000000011"].Max=4000 && eff["900000000000011"].Critical=1,"effective max and result metadata correct")
     V48Assert(eff["900000000000012"].Total=2000,"fully effective heal included in ability breakdown")
     V48Assert(IPBreakdown(seg,"@HealerB#502","EffectiveHeal","@Wrong#9").Count=0,"counterpart filter remains effective")
 }
 
 V532TestExportDefinitions()
 {
     s := V532Fixture(), text := IPSummary(s,s.Current), csv := IPCsvData(s,s.Current)
     V48Assert(InStr(text,"EffectiveHealing`tEHPS`tRawHealing`tRawHPS`tOverheal"),"summary labels raw/effective independently")
     V48Assert(InStr(text,"6000`t600.0`t7000`t700.0`t1000"),"summary has effective, raw, and overheal")
     V48Assert(InStr(csv,"EffectiveHealing,EHPS,Overheal") && InStr(csv,"KnownEffectiveSum"),"CSV explicit independent metric columns")
     defs := IPDefinitions()
     V48Assert(InStr(defs,"estimated Static or Sonic Barrier") && InStr(defs,"Unknown or overlapping shield sources stay unassigned") && InStr(defs,"Raid Challenges retain direct healing"),"shield estimates and direct-only challenge/export metrics are distinguished")
 }
 
 V532TestDamageTimingUntouched()
 {
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V51Source(),"=")
     V51Feed(s,1000,"Damage",100)
     V51Feed(s,9000,"Exit",0,V51Source(),"=")
     V51Feed(s,10000,"Damage",900)
     V51Feed(s,12000,"Activate",0,V51Source(),"=")
     V48Assert(IPDuration(s.Current)=10 && s.Current.Totals[IPActor(V51Source()).Key].Damage=1000,"late hit includes its timestamp; cleanup cannot stretch the denominator")
     e := IPParseLine(IPDemoLine(13000,V51Source(),V51Target(),"Damage",500,false,200))
     V48Assert(e.Amount=500 && e.Effective=200,"damage numerator is still raw logged damage")
 }
 
 V532TestHiddenEffectiveDisplay()
 {
     V522Isolated(V532HiddenDisplayCase)
 }
 
 V532HiddenDisplayCase()
 {
     global IPM
     s := V532Fixture(), snap := IPMSnapshot({Data:s,Segment:s.Current,State:"STOPPED",Pending:0})
     IPMEnsureGui("Heal"), p := IPM.Panel
     IPMRender("Heal",snap)
     V48Assert(p.Rows[1].Name.Text="HealerB" && p.Rows[1].Value.Text="600.0","real renderer uses effective leader")
     V48Assert(p.Tabs["Heal"].Text="EHPS~","tab advertises effective HPS with estimated shield credit")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"hidden diagnostic never displays a game overlay")
 }
 ; v53.3: mixed layout; all GUI fixtures below remain hidden and isolated.
 V533TestTargetMatrix()
 {
     for mode in [1,2,3] {
         Loop 16 {
             flags := A_Index-1
             for metric in IPMViews() {
                 for enabled in [false,true] {
                     s := IPMNewState(), s.Mode := mode, s.Metric := metric, s.Enabled := enabled
                     n := 0
                     for i,k in IPMViews() {
                         s.Shown[k] := (flags & (1 << (i-1))) != 0
                         n += s.Shown[k] ? 1 : 0
                     }
                     targets := IPMDisplayTargets(s), seen := Map()
                     expected := !enabled ? 0 : (mode=1 ? 1 : (mode=2 ? n : n+1))
                     V48Assert(targets.Length=expected,"layout/master/panel flags choose the exact window count")
                     for t in targets {
                         V48Assert(!seen.Has(t.Panel.Key),"each window appears only once, even with duplicate metrics")
                         seen[t.Panel.Key] := true
                         V48Assert(t.Panel=IPMPanelByKey(t.Panel.Key,s),"target keeps exact window identity")
                         V48Assert(t.Panel.Key="Combined" ? t.Kind=metric : t.Kind=t.Panel.Key,"tabbed metric never repurposes a standalone window")
                     }
                 }
             }
         }
     }
 }
 
 V533TestBothNoExtras()
 {
     s := IPMNewState(), s.Mode := 3
     for k in IPMViews()
         s.Shown[k] := false
     t := IPMDisplayTargets(s)
     V48Assert(t.Length=1 && t[1].Panel=s.Panel,"unchecking all extras does not hide the tabbed window")
     s.Mode := 2
     V48Assert(IPMDisplayTargets(s).Length=0,"separate-only mode still respects all unchecked panels")
 }
 
 V533TestDuplicateMetricDrag()
 {
     s := IPMNewState(), s.Mode := 3, s.Metric := "Damage", s.Editing := true
     s.Panel.Gui := {Hwnd:53301}, s.Panel.Drawn := true
     s.Panels["Damage"].Gui := {Hwnd:53302}, s.Panels["Damage"].Drawn := true
     a := IPMDragTarget(s,53301), b := IPMDragTarget(s,53302)
     V48Assert(a.Kind="Damage" && b.Kind="Damage" && a.Panel!=b.Panel,"same DPS metric has distinct drag owners")
     V48Assert(a.Panel=s.Panel && b.Panel=s.Panels["Damage"],"grabbed HWND, not metric name, selects the moving window")
     s.Shown["Damage"] := false
     V48Assert(!IsObject(IPMDragTarget(s,53302)) && IsObject(IPMDragTarget(s,53301)),"disabling standalone does not disable matching tab")
 }
 
 V533TestBothDragGuards()
 {
     s := IPMNewState(), s.Mode := 3, s.Editing := true
     s.Panel.Gui := {Hwnd:53303}, s.Panel.Drawn := true
     V48Assert(!IsObject(IPMDragTarget(s,0)) && !IsObject(IPMDragTarget(s,9999)),"foreign HWNDs rejected")
     for prop in ["Busy","Updating"] {
         s.%prop% := 1
         V48Assert(!IsObject(IPMDragTarget(s,53303)),"concurrent display/config changes reject drag")
         s.%prop% := 0
     }
     s.Editing := false
     V48Assert(!IsObject(IPMDragTarget(s,53303)),"locked remains non-draggable")
     s.Editing := true, s.Enabled := false
     V48Assert(!IsObject(IPMDragTarget(s,53303)),"master disabled rejects drag")
 }
 
 V533TestHiddenWindows()
 {
     V522Isolated(V533HiddenWindowsCase)
 }
 V533HiddenWindowsCase()
 {
     global IPM
     IPM.Mode := 3
     for k in IPMViews()
         IPM.Shown[k] := true
     seen := Map()
     for t in IPMDisplayTargets() {
         IPMEnsureGui(t.Kind,0,t.Panel), p := t.Panel
         V48Assert(!seen.Has(p.Gui.Hwnd),"all five displays use distinct HWNDs")
         seen[p.Gui.Hwnd] := true
         V48Assert(p.Tabs.Count=(p.Key="Combined" ? 4 : 0),"tabs are created only in combined window")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"diagnostic window stays hidden")
     }
     V48Assert(seen.Count=5 && !IPM.TimerOn && !IPM.DragHooks && !IPM.TabHooks,"no watchers or input hooks started")
 }
 
 V533TestDuplicateMetricRendering()
 {
     V522Isolated(V533DuplicateRenderingCase)
 }
 V533DuplicateRenderingCase()
 {
     global IPM
     IPM.Mode := 3, IPM.Metric := "Damage", snap := V53Snapshot()
     for p in [IPM.Panel,IPM.Panels["Damage"]] {
         IPMEnsureGui("Damage",0,p), IPMRender("Damage",snap,p)
         V48Assert(p.Rows[1].Value.Text="1,000.0" && p.RenderedMetric="Damage","both copies render the same existing rate")
     }
     V48Assert(IPM.Panel.Gui.Hwnd!=IPM.Panels["Damage"].Gui.Hwnd,"rendering does not reuse the wrong HWND")
     V48Assert(IPM.Panel.Layout.TabH>0 && IPM.Panels["Damage"].Layout.TabH=0,"only combined reserves tab-strip space")
 }
 
 V533TestCycleIsolation()
 {
     V522Isolated(V533CycleIsolationCase)
 }
 V533CycleIsolationCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     IPM.Mode := 3, IPM.Metric := "Personal", IPM.Wanted := true, IP.Active := true, IP.Live := V52Fixture()
     snap := IPMSnapshot(IPMResolve(IP,1)), data := IP.Live, last := IP.Live.Current.Last
     for t in IPMDisplayTargets()
         IPMEnsureGui(t.Kind,0,t.Panel), IPMRender(t.Kind,snap,t.Panel)
     damage := IPM.Panels["Damage"], h := damage.Gui.Hwnd, signature := damage.Signature
     V48Assert(IPMCycle() && IPM.Metric="Damage","next-view works in both layout")
     for t in IPMDisplayTargets()
         IPMEnsureGui(t.Kind,0,t.Panel), IPMRender(t.Kind,snap,t.Panel)
     V48Assert(damage.Gui.Hwnd=h && damage.Signature=signature && damage.RenderedMetric="Damage","cycling leaves standalone metric/HWND/rows unchanged")
     V48Assert(IP.Live=data && data.Current.Last=last && IP.Active && IrisBench.Active && !soundboardsEnabled,"cycling preserves engines and recorded interval")
 }
 
 V533TestBothTabPolicy()
 {
     Loop 64 {
         n := A_Index-1, s := IPMNewState(), s.Mode := 3
         s.Enabled := (n&1)!=0, s.ClickTabs := (n&2)!=0, s.Wanted := (n&4)!=0, s.Editing := (n&8)!=0
         visible := (n&16)!=0, game := (n&32)!=0
         expected := s.Enabled && s.ClickTabs && s.Wanted && !s.Editing && visible && game
         V48Assert(IPMTabSurfaceNeeded(s,visible,game)=expected,"both layout retains complete tab visibility guards")
         V48Assert(IPMTabAllowed(s,"locked",visible,game)=expected,"same guards on locked clicks")
     }
 }
 
 V533TestBothInputSurface()
 {
     V522Isolated(V533InputSurfaceCase)
 }
 V533InputSurfaceCase()
 {
     global IPM
     IPM.Mode := 3
     for t in IPMDisplayTargets() {
         IPMEnsureGui(t.Kind,0,t.Panel), p := t.Panel
         ok := IPMEnsureTabSurface(p)
         V48Assert(ok=(p.Key="Combined"),"separate panels never get hidden click-capture strips")
     }
     p := IPM.Panel, IPMPlaceTabSurface(p)
     V48Assert(p.TabButtons.Count=4 && !p.TabDrawn,"four cells ready, never shown by diagnostic")
     style := DllCall("User32\GetWindowLongW","Ptr",p.TabGui.Hwnd,"Int",-20,"UInt")
     V48Assert((style&0x08000000)!=0 && (style&0x20)=0,"only tab input accepts nonactivating clicks")
 }
 
 V533TestGeometryChoices()
 {
     keys := IPMSizeKeys()
     for metric in IPMViews() {
         for choice,key in keys {
             for mode in [1,2,3]
                 V48Assert(IPMGeometryChoice(mode,metric,choice)=key,"explicit size picker owns the same panel in every layout")
         }
     }
 }
 
 V533TestGeometryControls()
 {
     V522Isolated(V533GeometryControlsCase)
 }
 V533GeometryControlsCase()
 {
     global IPM
     ; Property-only controls: no UI is displayed by this settings-routing test.
     IPM.ConfigGui := {}, IPM.ModeControl := {Value:3}, IPM.MetricControl := {Value:1}
     IPM.GeometryControl := {Value:3}, IPM.WidthControl := {Value:0}, IPM.HeightControl := {Value:0}
     IPM.AutoControl := {Value:0}, IPM.ClickTabsControl := {Enabled:false}, IPM.ShowControls := Map()
     for k in IPMViews()
         IPM.ShowControls[k] := {Enabled:false}
     p := IPM.Panels["Damage"], p.Width := 333, p.Height := 444
     IPMLoadGeometryControls()
     V48Assert(IPM.GeometryKey="Damage" && IPM.WidthControl.Value=333,"both-layout fields read standalone selected by size picker")
     IPM.WidthControl.Value := 410, IPM.HeightControl.Value := 510, IPM.AutoControl.Value := 2
     IPMReadGeometryControls()
     V48Assert(p.Width=410 && p.Height=510 && !p.AutoHeight && IPM.Panel.Width=246,"editing standalone dimensions cannot resize combined")
     IPM.GeometryControl.Value := 1, IPMLoadGeometryControls()
     V48Assert(IPM.GeometryKey="Combined" && IPM.WidthControl.Value=246,"returning to tabbed geometry loads its own dimensions")
     V48Assert(IPM.GeometryControl.Enabled && IPM.ClickTabsControl.Enabled && IPM.ShowControls["Heal"].Enabled,"both sets of controls available")
 }
 
 V533TestIndependentResize()
 {
     V522Isolated(V533IndependentResizeCase)
 }
 V533IndependentResizeCase()
 {
     global IPM
     IPM.Mode := 3, snap := V53Snapshot(), a := IPM.Panel, b := IPM.Panels["Damage"]
     IPMEnsureGui("Damage",0,a), IPMEnsureGui("Damage",0,b)
     IPMRender("Damage",snap,a), IPMRender("Damage",snap,b)
     a.Gui.GetPos(&ax,&ay,&aw,&ah), b.Gui.GetPos(&bx,&by,&bw,&bh)
     b.Width := 450, b.Height := 390, b.AutoHeight := false
     IPMRender("Damage",snap,b), a.Gui.GetPos(&x,&y,&w,&h)
     V48Assert(x=ax && y=ay && w=aw && h=ah,"resizing independent DPS leaves tabbed rectangle untouched")
     b.Gui.GetPos(&bx,&by,&bw,&bh)
     a.Width := 360, IPM.Width := 360, a.Height := 420, a.AutoHeight := false
     IPMRender("Personal",snap,a), b.Gui.GetPos(&x,&y,&w,&h)
     V48Assert(x=bx && y=by && w=bw && h=bh,"resizing/changing combined leaves standalone rectangle untouched")
 }
 
 V533TestSettingsRoundtrip()
 {
     V522Isolated(V533SettingsCase)
 }
 V533SettingsCase()
 {
     global IPM, SETTINGS_FILE
     IniWrite("keep",SETTINGS_FILE,"Unrelated","Value")
     IPM.Mode := 3, IPM.Metric := "Heal", IPM.Shown["Personal"] := false, IPM.Shown["Taken"] := true
     for i,p in IPMAllPanels() {
         p.X := -1100+i*130, p.Y := i*80, p.Width := 300+i*10, p.Height := 350+i*10, p.AutoHeight := false
     }
     IPM.Width := IPM.Panel.Width, IPMSaveSettings()
     V48Assert(IniRead(SETTINGS_FILE,"IrisParseDisplay","Mode")="1" && IniRead(SETTINGS_FILE,"IrisParseDisplay","TabbedWithPanels")="1","older rollback sees valid tabbed-only mode")
     IPM := IPMNewState(), IPMLoadSettings()
     V48Assert(IPM.Mode=3 && IPM.Metric="Heal" && !IPM.Shown["Personal"] && IPM.Shown["Taken"],"both layout and individual flags restored")
     for i,p in IPMAllPanels()
         V48Assert(p.X=-1100+i*130 && p.Y=i*80 && p.Width=300+i*10 && p.Height=350+i*10 && !p.AutoHeight,"each of five independent rectangles survives restart")
     V48Assert(IniRead(SETTINGS_FILE,"Unrelated","Value")="keep","unrelated configuration untouched")
 }
 
 V533TestSwitchBack()
 {
     V522Isolated(V533SwitchBackCase)
 }
 V533SwitchBackCase()
 {
     global IPM, SETTINGS_FILE
     IPM.Mode := 3, IPMSaveSettings()
     for mode in [2,1] {
         IPM.Mode := mode, IPMSaveSettings(), IPM := IPMNewState(), IPMLoadSettings()
         V48Assert(IPM.Mode=mode && IniRead(SETTINGS_FILE,"IrisParseDisplay","TabbedWithPanels")="0","leaving both mode clears extra flag")
     }
 }
 
 V533TestLegacyLayoutPreserved()
 {
     V522Isolated(V533LegacyLayoutCase)
 }
 V533LegacyLayoutCase()
 {
     global IPM, SETTINGS_FILE
     for mode in [1,2] {
         IniWrite(mode,SETTINGS_FILE,"IrisParseDisplay","Mode")
         IniWrite(-450,SETTINGS_FILE,"IrisParseDisplay","CombinedX")
         IniWrite(200,SETTINGS_FILE,"IrisParseDisplay","CombinedY")
         IPM := IPMNewState(), IPMLoadSettings()
         V48Assert(IPM.Mode=mode && IPM.Panel.X=-450 && IPM.Panel.Y=200,"new both mode does not silently replace an old saved layout")
     }
 }
 
 V533TestHideIsolation()
 {
     V522Isolated(V533HideCase)
 }
 V533HideCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     IPM.Mode := 3, IPM.Wanted := true, IP.Active := true, IP.Live := V52Fixture()
     before := IP.Live, time := IPDuration(IP.Live.Current)
     for t in IPMDisplayTargets() {
         IPMEnsureGui(t.Kind,0,t.Panel)
         t.Panel.Drawn := true ; flag only, real HWND never shown
     }
     IPMHide()
     for p in IPMAllPanels()
         V48Assert(!p.Drawn && !p.TabDrawn,"hide retires every body and click surface")
     V48Assert(IP.Active && IrisBench.Active && !soundboardsEnabled && IP.Live=before && IPDuration(before.Current)=time,"hide does not change collection/capture/audio or rates")
     V48Assert(!IPM.TimerOn && !IPM.DragHooks && !IPM.TabHooks,"hide keeps harness inert")
 }
 
 V533TestDestroyLifecycle()
 {
     V522Isolated(V533DestroyCase)
 }
 V533DestroyCase()
 {
     global IPM
     IPM.Mode := 3, handles := []
     for k in IPMViews()
         IPM.Shown[k] := true
     for t in IPMDisplayTargets() {
         IPMEnsureGui(t.Kind,0,t.Panel), handles.Push(t.Panel.Gui.Hwnd)
         if IPMEnsureTabSurface(t.Panel)
             handles.Push(t.Panel.TabGui.Hwnd)
     }
     V48Assert(handles.Length=6,"five displays plus exactly one owned tab input surface")
     IPMDestroyPanels()
     for h in handles
         V48Assert(!DllCall("User32\IsWindow","Ptr",h,"Int"),"all bodies and input HWNDs destroyed")
     for p in IPMAllPanels()
         V48Assert(!IsObject(p.Gui) && !IsObject(p.TabGui),"no stale GUI references")
 }
 
 V533TestInitialPlacement()
 {
     mon := {L:0,T:0,R:1920,B:1080}, layout := {W:246,Scale:1}, seen := Map()
     for key in ["Combined","Personal","Damage","Heal","Taken"] {
         p := IPMInitialPosition(key,layout,mon,3), id := p.X "|" p.Y
         V48Assert(!seen.Has(id),"new both-layout windows do not start at identical coordinates")
         seen[id] := true
     }
     mon := {L:-1920,T:-200,R:0,B:880}
     p := IPMInitialPosition("Combined",layout,mon,3)
     V48Assert(p.X<0 && p.Y=-120,"negative-coordinate display placement retained")
 }
 
 V533TestNoAutomaticWork()
 {
     V522Isolated(V533NoAutomaticCase)
 }
 V533NoAutomaticCase()
 {
     global IPM, IP
     IPM.Mode := 3, IPM.Wanted := true, IPM.Editing := true, IPMSaveSettings()
     IPM := IPMNewState(), IPMLoadSettings(), IPMSyncTimer()
     V48Assert(IPM.Mode=3 && !IPM.Wanted && !IPM.Editing && !IPM.TimerOn && !IPM.DragHooks && !IPM.TabHooks,"saved both preference starts no display/input work")
     V48Assert(!IP.Active,"settings never start parser")
     for p in IPMAllPanels()
         V48Assert(!IsObject(p.Gui) && !IsObject(p.TabGui),"loading layout creates no windows")
 }
 
 V533TestEffectiveMatchesBoth()
 {
     V522Isolated(V533EffectiveCase)
 }
 V533EffectiveCase()
 {
     global IPM
     IPM.Mode := 3, IPM.Metric := "Heal", s := V532Fixture()
     snap := IPMSnapshot({Data:s,Segment:s.Current,State:"STOPPED",Pending:0})
     for p in [IPM.Panel,IPM.Panels["Heal"]] {
         IPMEnsureGui("Heal",0,p), IPMRender("Heal",snap,p)
         V48Assert(p.Rows[1].Name.Text="HealerB" && p.Rows[1].Value.Text="600.0","both windows rank effective healing, never raw healing")
     }
     V48Assert(IPM.Panel.Tabs["Heal"].Text="EHPS~" && IPM.Panels["Heal"].Tabs.Count=0,"same estimated-inclusive statistic, different display roles")
 }
 ; v54: source-level fixtures, hidden GUI checks, and upload validation only.
 ; No test calls IPUStart/IPUSpawn or contacts Parsely.
 V54Line(at,source,target,effect,tail := "",action := "836045448945472")
 {
     return "[" IPStamp(at) "] [" source "] [" target "] [Example {900000000000001}] [Action {" action "}: Effect {" effect "}] " tail
 }
 
 V54Fixture()
 {
     s := IPNewData("Raid tools fixture")
     tank := "@Tank#1|(0,0,0,0)|(100/100)",boss := "Operations Training Dummy {2857785339412480}:99|(0,0,0,0)|(900/1000)"
     IPFeedLine(s,V54Line(1000,tank,"","836045448945489"))
     IPFeedLine(s,V54Line(2000,tank,boss,"836045448945501","(100 energy {836045448940874}) <150.0>","836045448945477"))
     IPFeedLine(s,V54Line(3000,tank,boss,"836045448945483","<-50.0>"))
     IPFeedLine(s,V54Line(4000,"@DPS#2|(0,0,0,0)|(100/100)",boss,"836045448945501","(80 energy {836045448940874}) <80.0>","836045448945477"))
     return s
 }
 
 V54Snapshot(s)
 {
     return IPMSnapshot({Data:s,Segment:s.Current,State:"STOPPED",Pending:0})
 }
 
 V54TestThreatNumbers()
 {
     for v in [0,100,-250,1.5,-0.25] {
         r := IRThreatField("<" v ">","836045448945472","836045448945483")
         V48Assert(r.Known && r.Value=v && !r.Invalid,"signed threat decoded without damage inference")
     }
 }
 
 V54TestThreatEligibility()
 {
     V48Assert(!IRThreatField("<v7.0.0b>","","137438953622").Expected,"version metadata not threat")
     V48Assert(!IRThreatField("<42>","836045448945472","836045448945479").Expected,"activation not invented threat")
     V48Assert(IRThreatField("<100>","836045448945477","836045448945501").Known,"damage threat")
     V48Assert(IRThreatField("<50>","836045448945477","836045448945500").Known,"heal threat")
     V48Assert(IRThreatField("<123>","836045448945477","836045448945488").Known,"taunt threat")
 }
 
 V54TestThreatInvalid()
 {
     for value in ["<oops>","<NaN>","<1e40>","<1000000000001>","<12"] {
         r := IRThreatField(value,"836045448945472","836045448945483")
         V48Assert(!r.Known && r.Invalid,"bad numeric suffix not counted")
     }
     r := IRThreatField("","836045448945472","836045448945483")
     V48Assert(r.Expected && !r.Known && !r.Invalid,"absent field distinct from invalid")
 }
 
 V54TestThreatTotals()
 {
     s := V54Fixture(),r := s.Current.Raid,t := r.Threat["@Tank#1"]
     V48Assert(t.Total=100 && t.Gained=150 && t.Reduced=50 && t.Known=2,"sum including recorded threat dump")
     V48Assert(r.Threat["@DPS#2"].Total=80 && r.Threat.Count=2,"raid participants separate")
     V48Assert(s.Current.Totals["@Tank#1"].Damage=100 && IPDuration(s.Current)=3,"threat does not replace damage or duration")
 }
 
 V54TestThreatNegativeAndMissing()
 {
     s := V54Fixture()
     IPFeedLine(s,V54Line(4500,"@Tank#1","=","836045448945483","<-200>"))
     IPFeedLine(s,V54Line(4600,"@Tank#1","=","836045448945483",""))
     t := s.Current.Raid.Threat["@Tank#1"]
     V48Assert(t.Total=-100 && t.Missing=1,"negative total retained and missing values disclosed")
     V48Assert(IPDuration(s.Current)=3,"threat-only tail does not change DPS denominator")
 }
 
 V54TestThreatOutsideAndReset()
 {
     s := IPNewData()
     IPFeedLine(s,V54Line(1000,"@Tank#1","=","836045448945483","<999>"))
     V48Assert(s.Segments.Length=0,"prepull threat does not create combat")
     s := V54Fixture()
     V51Feed(s,5000,"Exit",0,"@Tank#1","=")
     V51Feed(s,29999,"Enter",0,"@Tank#1","=")
     V51Feed(s,30000,"Damage",5,"@New#3")
     V48Assert(s.Segments.Length=2 && !s.Current.Raid.Threat.Has("@Tank#1"),"segment state does not carry threat across pulls")
 }
 
 V54TestThreatSort()
 {
     rows := [{Key:"b",Name:"B",Kind:"Player",Total:100,Known:3},
         {Key:"a",Name:"A",Kind:"Player",Total:100,Known:1},
         {Key:"c",Name:"C",Kind:"Player",Total:-10,Known:2},
         {Key:"d",Name:"D",Kind:"Player",Total:0,Known:0}]
     r := IRRankThreat(rows)
     V48Assert(r.Rows[1].Key="a" && r.Rows[2].Key="b" && r.Rows[3].Key="c" && r.Rows[4].Key="d","stable amount ranking, unknown last")
     V48Assert(r.Peak=100 && r.Count=4,"positive bar peak without hiding negative rows")
 }
 
 V54TestCompanionThreat()
 {
     rows := [{Key:"p",Name:"Player",Kind:"Player",Total:5,Known:1},
         {Key:"c",Name:"Pet",Kind:"Companion",Total:10,Known:1}]
     V48Assert(IRRankThreat(rows,false).Count=1 && IRRankThreat(rows,true).Count=2,"companion display filter does not merge owners")
 }
 
 V54TestHealthValidation()
 {
     for pair in [[0,100],[55,100],[100,100]] {
         r := IRHealthField("Dummy {1}:1|(0,0,0,0)|(" pair[1] "/" pair[2] ")")
         V48Assert(r.Known && r.Current=pair[1] && r.Maximum=pair[2],"zero and positive health snapshots")
     }
     for text in ["Dummy {1}:1","|(101/100)","|(0/0)","|(-1/100)","|(1/1000000000001)"]
         V48Assert(!IRHealthField(text).Known,"invalid health not invented")
 }
 
 V54TestHPActorIsolation()
 {
     r := IRNewMetrics(),hp := {Known:true,Current:10,Maximum:100}
     IRRecordHealth(r,IPActor("@Tyth#1"),hp,1000)
     IRRecordHealth(r,IPActor("Same {10}:1"),hp,1000)
     IRRecordHealth(r,IPActor("Same {10}:2"),hp,1000)
     V48Assert(r.Health.Count=2,"player names not bosses; same-name instances separate")
 }
 
 V54TestHPTimestamps()
 {
     r := IRNewMetrics(),a := IPActor("Boss {10}:1")
     IRRecordHealth(r,a,{Known:true,Current:25,Maximum:100},2000)
     IRRecordHealth(r,a,{Known:true,Current:90,Maximum:100},1900)
     V48Assert(r.Health[a.Key].Current=25 && r.Health[a.Key].At=2000,"older HP never overwrites newer")
     IRRecordHealth(r,a,{Known:false,Current:0,Maximum:0},2100)
     V48Assert(!r.Health[a.Key].Known,"new invalid snapshot does not masquerade as current health")
 }
 
 V54TestHPMaxChange()
 {
     s := V54Fixture(),a := "Operations Training Dummy {2857785339412480}:99|(0,0,0,0)|(0/30828700)"
     IPFeedLine(s,V54Line(5000,a,"","836045448945493"))
     r := V54Snapshot(s).Raid.Health[1]
     V48Assert(r.Current=0 && r.Maximum=30828700 && r.Percent=0,"reported max change retained, no damage subtraction")
 }
 
 V54TestHPStale()
 {
     s := V54Fixture()
     IPFeedLine(s,V54Line(17000,"@Tank#1","=","123456789",""))
     r := V54Snapshot(s).Raid.Health[1]
     V48Assert(r.Stale && r.Age=13000 && InStr(IRHealthText(r).Name,"~"),"old snapshots visibly stale")
     V48Assert(IPDuration(s.Current)=3,"HP metadata does not stretch statistics")
 }
 
 V54TestHPKnownBosses()
 {
     V48Assert(IRKnownBoss("2857785339412480") && IRKnownBoss("4088525397950464") && IRKnownBoss("4088538282852352"),"dummy and both sisters identified")
     V48Assert(!IRKnownBoss("4109905745149952") && !IRKnownBoss("123"),"adds and unknown IDs not labelled bosses")
 }
 
 V54TestHPMultiBoss()
 {
     s := V54Fixture()
     IPFeedLine(s,V54Line(4500,"Aivela {4088525397950464}:10|(0,0,0,0)|(25/100)","@Tank#1","836045448953668"))
     IPFeedLine(s,V54Line(4600,"Esne {4088538282852352}:11|(0,0,0,0)|(70/100)","@DPS#2","836045448953668"))
     V48Assert(V54Snapshot(s).Raid.Health.Length=3,"multiple known NPC bars not collapsed into one average")
 }
 
 V54TestHPPins()
 {
     pins := IRParsePins("123, 456; 123`n789")
     V48Assert(pins.Count=3 && pins.Has("456"),"ID list normalized and deduplicated")
     for text in ["1x","123/foo","<5>"] {
         failed := false
         try IRParsePins(text)
         catch Error
             failed := true
         V48Assert(failed,"bad pin ID rejected")
     }
 }
 
 V54TestHPFallback()
 {
     global IR
     old := IR
     try {
         IR := IRNewUI(),s := V52Fixture(),r := V54Snapshot(s).Raid
         V48Assert(r.Fallback && r.Health.Length=1,"unrecognized target shown explicitly as fallback")
         IR.PinSet := IRParsePins("990000000000001")
         r := V54Snapshot(s).Raid
         V48Assert(!r.Fallback && r.Health[1].Pinned,"explicit ID makes target tracked")
     }
     finally IR := old
 }
 
 V54TestSnapshotIsolation()
 {
     s := V54Fixture(),r := V54Snapshot(s).Raid
     r.Threat[1].Total := 123456,r.Health[1].Current := 123
     V48Assert(s.Current.Raid.Threat["@Tank#1"].Total=100,"display copy cannot change threat history")
     V48Assert(s.Current.Raid.Health["N:2857785339412480:99:Operations Training Dummy"].Current=900,"display copy cannot change HP state")
 }
 
 V54TestCapacity()
 {
     r := IRNewMetrics(),hp := {Known:true,Current:1,Maximum:1}
     Loop 513
         IRRecordHealth(r,IPActor("NPC {123}:" A_Index),hp,A_Index)
     V48Assert(r.Health.Count=512 && r.Limit,"health storage bounded with incomplete marker")
 }
 
 V54TestExtraPanelsDefault()
 {
     m := IPMNewState(),u := IPUNewState(),r := IRNewUI()
     V48Assert(!m.Shown["Threat"] && !m.Shown["BossHP"] && !m.Wanted && !m.TimerOn,"new overlays do not auto-show")
     V48Assert(!u.Busy && !u.Handle && !IsObject(u.Gui) && !r.Visible,"no automatic upload or extra UI")
 }
 
 V54TestExtraPanelsModes()
 {
     for mode in [1,2,3] {
         m := IPMNewState(),m.Mode := mode
         before := IPMDisplayTargets(m).Length
         m.Shown["Threat"] := true,m.Shown["BossHP"] := true
         targets := IPMDisplayTargets(m)
         V48Assert(targets.Length=before+2 && targets[-1].Panel=m.Panels["BossHP"] && targets[-2].Panel=m.Panels["Threat"],"both extras available in all layouts")
         m.Enabled := false
         V48Assert(!IPMDisplayTargets(m).Length,"master hides extras too")
     }
 }
 
 V54TestHiddenPanels()
 {
     V522Isolated(V54HiddenPanelsCase)
 }
 
 V54HiddenPanelsCase()
 {
     global IPM
     snap := V54Snapshot(V54Fixture()),IPM.Shown["Threat"] := true,IPM.Shown["BossHP"] := true
     for kind in IRPanelKinds() {
         p := IPM.Panels[kind]
         IPMEnsureGui(kind,0,p),IPMRender(kind,snap,p)
         V48Assert(p.Rows[1].Name.Text!="" && p.RenderedMetric=kind,"actual renderer populated")
         V48Assert(!p.Tabs.Count && !DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"extra window has no tabs and remains hidden in test")
     }
     V48Assert(IPM.Panels["Threat"].Rows[1].Value.Text="33.3","TPS uses shared 3-second denominator")
     V48Assert(IPM.Panels["BossHP"].Rows[1].Value.Text="90.0%","HP percent from snapshot")
 }
 
 V54TestExtraDragging()
 {
     m := IPMNewState(),m.Editing := true,m.Shown["Threat"] := true
     p := m.Panels["Threat"],p.Gui := {Hwnd:54001},p.Drawn := true
     t := IPMDragTarget(m,54001)
     V48Assert(IsObject(t) && t.Panel=p && t.Kind="Threat","extra panel owns its move/resize")
     m.Editing := false
     V48Assert(!IsObject(IPMDragTarget(m,54001)),"locked threat body remains non-draggable")
 }
 
 V54TestExtraSettings()
 {
     V522Isolated(V54ExtraSettingsCase)
 }
 
 V54ExtraSettingsCase()
 {
     global IPM
     IPM.Shown["Threat"] := true,IPM.Shown["BossHP"] := true
     p := IPM.Panels["BossHP"],p.X := -900,p.Y := 150,p.Width := 320,p.Height := 160,p.AutoHeight := false
     IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings()
     p := IPM.Panels["BossHP"]
     V48Assert(IPM.Shown["Threat"] && IPM.Shown["BossHP"] && p.X=-900 && p.Width=320 && !p.AutoHeight,"extra visibility preferences and geometry persist")
     V48Assert(!IPM.Wanted && !IPM.Editing && !IPM.TimerOn,"prefs do not start display on launch")
 }
 
 V54TestUploadLinks()
 {
     V48Assert(IPUValidatedLink("http://parsely.io/parser/view/123/0")="https://parsely.io/parser/view/123/0","legacy link upgraded")
     for link in ["file:///C:/test.exe","https://parsely.io.evil.test/parser/view/1","https://evil.test/parser/view/1","https://parsely.io/parser/view/1?command=x","javascript:alert(1)","https://user@parsely.io/parser/view/1"]
         V48Assert(IPUValidatedLink(link)="","unapproved response target rejected")
 }
 
 V54TestUploadResult()
 {
     r := IPUResult("<result><status>success</status><message>OK</message><url>https://parsely.io/parser/view/123</url></result>")
     V48Assert(r.Success && r.Url!="","successful XML decoded without opening anything")
     r := IPUResult("<result><status>error</status><message>No combat</message></result>")
     V48Assert(!r.Success && r.Url="" && r.Message="No combat","server failure not reported as success")
 }
 
 V54TestUploadUnsafeXML()
 {
     for text in ['<!DOCTYPE x [<!ENTITY e SYSTEM "file:///C:/Windows/win.ini">]><result/>',"<html>Not a result</html>","<result><status>success</status><url>file:///bad</url></result>"] {
         failed := false
         try IPUResult(text)
         catch Error
             failed := true
         V48Assert(failed,"invalid/unsafe XML rejected without resolving entities")
     }
 }
 
 V54TestUploadJobEscaping()
 {
     info := {Path:"C:\some & folder\combat_test.txt",Size:123,Stamp:"20260924120000"}
     text := IPUJobXml(info,'test <tag> & "quote"')
     V48Assert(InStr(text,"&amp;") && InStr(text,"&lt;tag&gt;") && InStr(text,"<visibility>1</visibility>"),"job data is escaped, public mode explicit")
     V48Assert(!InStr(text,"<password>") && !InStr(text,"<username>"),"job contains no account credentials")
 }
 
 V54TestUploadWorkerInert()
 {
     source := FileRead(A_ScriptDir "\Iris_Test_Runtime.ahk","UTF-8")
     code := IPUExtractWorker(source)
     V48Assert(InStr(code,"https://parsely.io/api/upload2") && InStr(code,"GZipStream"),"embedded transport present")
     V48Assert(InStr(code,"AllowAutoRedirect=$false") && InStr(code,"DtdProcessing"),"redirect and XML safeguards present")
     V48Assert(InStr(code,"FileShare]::ReadWrite") && InStr(code,"The log changed while preparing"),"log writes not locked; changed source rejected")
     ; Extraction only. No PowerShell process and no network request are started.
 }
 
 V54TestUploadBase64()
 {
     V48Assert(IPUBase64("test")="dABlAHMAdAA=","PowerShell command uses UTF-16LE base64")
     V48Assert(!InStr(IPUBase64("a'b`nc"),"'") && !InStr(IPUBase64("a'b`nc"),"`n"),"no path metacharacters in encoded command")
 }
 
 V54TestUploadWorkerValidation()
 {
     failed := false
     try IPUExtractWorker("not an embedded worker")
     catch Error
         failed := true
     V48Assert(failed,"missing worker refuses launch")
     V48Assert(!IPUNewState().Handle && !IPUNewState().Busy,"upload initialization has no process")
 }
 
 V54TestHPDenominatorRegression()
 {
     s := V54Fixture(),before := IPDuration(s.Current)
     IPFeedLine(s,V54Line(8000,"Operations Training Dummy {2857785339412480}:99|(0,0,0,0)|(800/1000)","=","123456789",""))
     IPFeedLine(s,V54Line(8100,"@Tank#1","=","836045448945483","<300>"))
     V48Assert(IPDuration(s.Current)=before && s.Current.Totals["@Tank#1"].Damage=100,"new metadata leaves damage calculation intact")
     V48Assert(V54Snapshot(s).Raid.Health[1].Current=800 && s.Current.Raid.Threat["@Tank#1"].Total=400,"new observations still update")
 }
 
 V54TestThreatTailInterval()
 {
     s := V54Fixture()
     IPFeedLine(s,V54Line(6000,"@Tank#1","=","836045448945483","<100>"))
     snap := V54Snapshot(s)
     V48Assert(snap.Duration=3 && snap.Raid.ThreatDuration=5,"late threat gets its own extended interval without changing DPS")
     V48Assert(IPRate(s.Current.Raid.Threat["@Tank#1"].Total,snap.Raid.ThreatDuration)="40.0","TPS includes the late event and its time")
 }
 ; v55 menu tests; the surrounding harness is isolated and never runs automatically.
 V55Isolated(action)
 {
     global IIF, IR
     oldI := IIF, oldR := IR
     try {
         IIF := IIFNewState(), IR := IRNewUI()
         V522Isolated(action)
     }
     finally {
         IIF := oldI, IR := oldR
     }
 }
 
 V55Keys(s)
 {
     out := ""
     for t in IPMDisplayTargets(s)
         out .= "|" t.Panel.Key "|"
     return out
 }
 
 V55TestEntryCatalogue()
 {
     entries := IIFEntries(), seen := Map()
     for e in entries {
         V48Assert(e.Label != "" && !seen.Has(e.Key),"unique supported overlay choice")
         seen[e.Key] := true
     }
     V48Assert(entries.Length=18 && seen.Has("PvP") && !seen.Has("PvPStats") && seen.Has("FightFeedback") && seen.Has("BossDamage") && seen.Has("Achievements") && !seen.Has("BossMechanics") && seen.Has("EnemyDebuffs") && seen.Has("RaidUtility") && seen.Has("Combined") && seen.Has("Threat") && seen.Has("BossHP") && seen.Has("Challenges") && seen.Has("RunTimer") && seen.Has("Effects") && seen.Has("HealerGrid") && seen.Has("RaidNotes"),"supported independent panels including progression assistance")
     V48Assert(!seen.Has("Timers"),"unimplemented timers are not advertised")
 }
 
 V55TestDefaultChecks()
 {
     m := IPMNewState(), s := IIFSnapshot(m)
     V48Assert(s.Count=1 && s.Selected["Combined"],"only tabbed Personal selected by default")
     V48Assert(!s.Selected["Personal"] && !s.Selected["Heal"],"dormant split choices are not displayed")
     V48Assert(!s.Visible && s.Locked && !s.Desktop,"no display or desktop auto-start")
 }
 
 V55TestNoPhantomPanels()
 {
     m := IPMNewState()
     IIFSetChoice(m,"Damage",true)
     s := IIFSnapshot(m)
     V48Assert(m.Mode=3 && s.Count=2 && s.Selected["Damage"] && s.Selected["Combined"],"one new leaderboard")
     V48Assert(!s.Selected["Heal"] && !s.Selected["Personal"] && !s.Selected["Taken"],"not all former default boxes")
 }
 
 V55TestBothWithAllPanels()
 {
     m := IPMNewState()
     for e in IIFEntries()
         IIFSetChoice(m,e.Key,true)
     V48Assert(IIFSnapshot(m).Count=18 && IPMDisplayTargets(m).Length=18 && IIFSnapshot(m).Selected["BossDamage"],"all eighteen panels independently available")
     seen := Map()
     for t in IPMDisplayTargets(m) {
         V48Assert(!seen.Has(t.Panel.Key),"one window per identity")
         seen[t.Panel.Key] := true
     }
 }
 
 V55TestRemoveTabbedOnly()
 {
     m := IPMNewState()
     IIFSetChoice(m,"Damage",true), IIFSetChoice(m,"Heal",true)
     IIFSetChoice(m,"Combined",false)
     V48Assert(m.Mode=2 && IIFSnapshot(m).Count=2,"remove only the tabbed window")
     V48Assert(V55Keys(m)="|Damage||Heal|","fixed raid views remain")
 }
 
 V55TestRestoreTabbed()
 {
     m := IPMNewState(), m.Mode := 2, m.Metric := "Taken"
     for k in IPMViews()
         m.Shown[k] := k="Heal"
     IIFSetChoice(m,"Combined",true)
     V48Assert(m.Mode=3 && m.Metric="Taken","restore without changing current tab")
     V48Assert(V55Keys(m)="|Combined||Heal|","no extra defaults")
 }
 
 V55TestExtrasOnly()
 {
     m := IPMNewState()
     IIFSetChoice(m,"Combined",false), IIFSetChoice(m,"Threat",true), IIFSetChoice(m,"BossHP",true)
     V48Assert(V55Keys(m)="|Threat||BossHP|","threat and HP need no other visible meter")
 }
 
 V55TestAllUnchecked()
 {
     m := IPMNewState()
     for e in IIFEntries()
         IIFSetChoice(m,e.Key,false)
     V48Assert(IIFSnapshot(m).Count=0 && !IPMDisplayTargets(m).Length,"no compulsory Personal panel")
     IIFSetChoice(m,"Personal",true)
     V48Assert(V55Keys(m)="|Personal|","plain Personal independent of tabbed Personal")
 }
 
 V55TestInvalidChoice()
 {
     m := IPMNewState(), before := V55Keys(m), failed := false
     try IIFSetChoice(m,"BadPanel",true)
     catch ValueError
         failed := true
     V48Assert(failed && V55Keys(m)=before && m.Mode=1,"invalid choice rejected before mutation")
 }
 
 V55TestSelectionMatrix()
 {
     for mode in [1,2,3] {
         Loop 64 {
             bits := A_Index-1
             for e in IIFEntries() {
                 for value in [false,true] {
                     m := IPMNewState(), m.Mode := mode
                     i := 0
                     for k in ["Personal","Damage","Heal","Taken","Threat","BossHP"]
                         m.Shown[k] := !!(bits & (1 << i++))
                     expected := IIFSnapshot(m).Selected
                     expected[e.Key] := value
                     got := IIFSetChoice(m,e.Key,value).Selected
                     for k,v in expected
                         V48Assert(got[k]=v,"only the requested menu choice changed")
                 }
             }
         }
     }
 }
 
 V55TestGeometryPreserved()
 {
     m := IPMNewState(), m.Metric := "Heal", m.Source := 2, m.PersonalKey := "@Chosen#1"
     refs := Map()
     for i,p in IPMAllPanels(m) {
         p.X := -1000+i*20, p.Y := 60+i*30, p.Width := 230+i*10, p.Height := 180+i*10, p.AutoHeight := false
         refs[p.Key] := p
     }
     for e in IIFEntries()
         IIFSetChoice(m,e.Key,true)
     for i,p in IPMAllPanels(m)
         V48Assert(p=refs[p.Key] && p.X=-1000+i*20 && p.Width=230+i*10 && !p.AutoHeight,"same geometry and object")
     V48Assert(m.Metric="Heal" && m.Source=2 && m.PersonalKey="@Chosen#1","tab/source/player not overwritten")
 }
 
 V55TestPreviewPolicy()
 {
     for game in [false,true] {
         for desktop in [false,true]
             V48Assert(IIFDisplayContext(game,desktop)=(game || desktop),"desktop preview is explicit")
     }
     m := IPMNewState(), m.Wanted := true
     V48Assert(IPMTabAllowed(m,"locked",true,IIFDisplayContext(false,true)),"tabs usable in opted-in desktop preview")
     V48Assert(!IPMTabAllowed(m,"locked",true,IIFDisplayContext(false,false)),"no default off-game tab surface")
 }
 
 V55TestPreviewNotPersisted()
 {
     V55Isolated(V55PreviewSettingsCase)
 }
 
 V55PreviewSettingsCase()
 {
     global IPM
     IPM.DesktopPreview := true, IPM.Wanted := true, IPM.Editing := true
     IPMSaveSettings(), IPM := IPMNewState(), IPMLoadSettings()
     V48Assert(!IPM.DesktopPreview && !IPM.Wanted && !IPM.Editing && !IPM.TimerOn,"preferences do not start work")
 }
 
 V55TestSelectionRoundTrip()
 {
     V55Isolated(V55RoundTripCase)
 }
 
 V55RoundTripCase()
 {
     global IPM
     for key in ["Damage","Heal","Threat","BossHP"]
         IIFSetChoice(IPM,key,true)
     before := V55Keys(IPM)
     IPMSaveSettings(), IPM := IPMNewState(), IPMLoadSettings()
     V48Assert(V55Keys(IPM)=before && IPM.Mode=3,"menu choices use existing version-compatible keys")
     V48Assert(!IPM.Wanted && !IPM.TimerOn,"restoring selection is not starting collection")
 }
 
 V55MenuChecked(m,label)
 {
     for item in V658MenuSnapshot(m.Handle) {
         if item.Text=label {
             V48Assert(item.State != 0xFFFFFFFF,"valid native menu item found by label")
             return !!(item.State & 8)
         }
     }
     throw Error("Test menu label missing: " label)
 }
 
 V55TestHiddenMenuChecks()
 {
     V55Isolated(V55MenuChecksCase)
 }
 
 V55MenuChecksCase()
 {
     global IPM,IIF
     a := IIFCreateMenu(), b := IIFCreateMenu()
     V48Assert(V55MenuChecked(a,"Personal Stats (tabs)") && !V55MenuChecked(a,"Raid Healing"),"native checks match defaults")
     IIFApplyChoice("Heal",true)
     V48Assert(V55MenuChecked(a,"Raid Healing") && V55MenuChecked(b,"Raid Healing"),"all menu copies stay in sync")
     V48Assert(IPM.Mode=3 && !IsObject(IPM.Panel.Gui) && !IPM.TimerOn && !IPM.TabHooks,"menu test shows no meter or input hooks")
 }
 
 V55TestMenuHostDedup()
 {
     V55Isolated(V55HostCase)
 }
 
 V55HostCase()
 {
     global IIF
     g := Gui()
     try {
         IIFAttach(g), IIFAttach(g)
         V48Assert(IIF.Hosts.Count=1 && IIF.Menus.Length=1,"attach once per existing window")
         V48Assert(IsObject(g.MenuBar) && !DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"real menubar on a hidden host")
     }
     finally g.Destroy()
 }
 
 V55TestCheckedWhileHidden()
 {
     m := IPMNewState()
     IIFSetChoice(m,"Damage",true)
     m.Wanted := false, m.Enabled := false
     s := IIFSnapshot(m)
     V48Assert(s.Selected["Damage"] && s.Selected["Combined"] && !s.Visible,"Hide remembers selection; master controls visibility")
     V48Assert(!IPMDisplayTargets(m).Length,"master disable still blocks rendering")
 }
 
 V55TestDirectLock()
 {
     V55Isolated(V55LockCase)
 }
 
 V55LockCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     before := IP, bench := IrisBench
     IIFToggleLock()
     V48Assert(IPM.Editing && IPM.Wanted && !IsObject(IPM.ConfigGui),"unlock needs no settings window")
     IIFToggleLock()
     V48Assert(!IPM.Editing && IIFSnapshot(IPM).Locked,"same menu action locks again")
     V48Assert(IP=before && IrisBench=bench && IrisBench.Active && !soundboardsEnabled,"no engine or mute changes")
 }
 
 V55TestHideKeepsParser()
 {
     V55Isolated(V55HideCase)
 }
 
 V55HideCase()
 {
     global IP,IPM,IrisBench,IPU
     beforeP := IP, beforeU := IPU
     IIFApplyChoice("Damage",true), IIFToggleShow()
     V48Assert(!IPM.Wanted && !IPM.Editing && IIFSnapshot(IPM).Selected["Damage"],"hide keeps selection")
     IIFToggleShow()
     V48Assert(IPM.Wanted && IP=beforeP && IPU=beforeU && IrisBench.Active,"show has no parser/capture/upload action")
 }
 
 V55TestLastChoiceLockStyles()
 {
     V55Isolated(V55LastChoiceCase)
 }
 
 V55LastChoiceCase()
 {
     global IPM
     IIFToggleLock(), IPMEnsureGui("Personal")
     p := IPM.Panel, hwnd := p.Gui.Hwnd
     ex := DllCall("User32\GetWindowLongW","Ptr",hwnd,"Int",-20,"UInt")
     V48Assert(!(ex & 0x08000020),"unlocked hidden fixture")
     IIFApplyChoice("Combined",false)
     ex := DllCall("User32\GetWindowLongW","Ptr",hwnd,"Int",-20,"UInt")
     V48Assert((ex & 0x08000020)=0x08000020,"last unchecked restores lock styles for future reuse")
     V48Assert(!IPM.Editing && !IPM.Wanted && !IPMAnyEnabled(),"empty selection ends editing and visibility")
     IIFApplyChoice("Combined",true), IPMEnsureGui("Personal")
     V48Assert(IPM.Panel.Gui.Hwnd=hwnd && !DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int"),"hidden reusable window not destroyed or shown by tests")
 }
 
 V55TestClickTargetsPreserved()
 {
     m := IPMNewState(), m.Wanted := true
     for key in ["Damage","Heal","Threat","BossHP"]
         IIFSetChoice(m,key,true)
     V48Assert(IPMTabSurfaceNeeded(m,true,true),"tabbed panel stays clickable alongside leaderboards")
     m.Metric := "Heal"
     targets := IPMDisplayTargets(m)
     V48Assert(targets[1].Panel=m.Panel && targets[1].Kind="Heal","only combined follows current tab")
     V48Assert(targets[2].Panel=m.Panels["Damage"] && targets[2].Kind="Damage","fixed DPS retains identity")
     V48Assert(targets[3].Panel=m.Panels["Heal"] && targets[3].Kind="Heal","two healing views share numbers but not windows")
 }
 
 V55TestMenuDataIsolation()
 {
     s := V54Fixture(), before := V54Snapshot(s)
     m := IPMNewState()
     for e in IIFEntries() {
         IIFSetChoice(m,e.Key,true)
         IIFSetChoice(m,e.Key,false)
     }
     after := V54Snapshot(s)
     V48Assert(before.Duration=after.Duration && before.Raid.ThreatDuration=after.Raid.ThreatDuration,"identical denominators")
     V48Assert(before.Actors[1].Damage=after.Actors[1].Damage && before.Raid.Health[1].Current=after.Raid.Health[1].Current,"menu has no data writes")
     V48Assert(IRDefinition("Threat").Color="CD8B28","amber threat theme")
 }
 V551Setup()
 {
     global TythRecordOrder, tythCalloutsEnabled, tyth65CalloutEnabled, tyth8CalloutEnabled
     global tythRageReportsEnabled, TythExtraAlerts, TythGraceAlertDefinitions, IrisBench
     global inputMode, activeBoss, rejectOldLogAudio, inLogDispatch, dispatchAudioAllowed
     V48Setup(0)
     IrisBench.Active := false
     inputMode := "CombatLog", activeBoss := "GFTM - Tyth", rejectOldLogAudio := false
     inLogDispatch := false, dispatchAudioAllowed := true
     TythRecordOrder := {At:-1,Seen:Map()}
     tythCalloutsEnabled := true, tyth65CalloutEnabled := true
     tyth8CalloutEnabled := false, tythRageReportsEnabled := false
     for key, definition in TythExtraAlerts
         definition.Enabled := false
     for key, definition in TythGraceAlertDefinitions
         definition.Enabled := false
     ResetTythState("", "isolated wave regression")
 }
 
 V551Boss(hp := 900, instance := "999")
 {
     return "TYTH {4078423634870272}:" instance "|(0,0,0,0)|(" hp "/1000)"
 }
 
 V551Add(instance := "100", npc := "4078445109706752")
 {
     return "Add {" npc "}:" instance "|(0,0,0,0)|(100/100)"
 }
 
 V551Line(at, source, target, ability := "", action := "[Event {836045448945472}: TargetSet {836045448953668}]")
 {
     return "[" IPStamp(Mod(at,86400000)) "] [" source "] [" target "] [" ability "] " action
 }
 
 V551Feed(line, at := -1, emit := true)
 {
     global CurrentRecord, testClock
     if at < 0
         at := LogStampMs(line)
     testClock := at
     CurrentRecord := {Line:line,At:at,Age:0,ReadTick:at,Allow:emit}
     try {
         TrackTythState(line,emit)
         SafeTrackTythWave8Adds(line)
     }
     finally CurrentRecord := ""
 }
 
 V551Sample(at, hp := 640, instance := "999")
 {
     V551Feed(V551Line(at,V551Boss(hp,instance),"@TestPlayer#1|(0,0,0,0)|(100/100)"),at)
 }
 
 V551Marker(at, which := "prep", hp := 640, emit := true, canceled := false)
 {
     id := which="prep" ? "4076168777039872" : "4076190251876352"
     action := canceled ? "[Event {836045448945472}: AbilityInterrupt {836045448945482}]"
         : "[Event {836045448945472}: AbilityActivate {836045448945479}]"
     V551Feed(V551Line(at,V551Boss(hp),"="," {" id "}",action),at,emit)
 }
 
 V551ObserveAdd(at, instance := "100", target := false)
 {
     a := V551Add(instance), player := "@TestPlayer#1|(0,0,0,0)|(100/100)"
     V551Feed(V551Line(at,target ? player : a,target ? a : player),at)
 }
 
 V551Prior(shift := 0)
 {
     V551Sample(100000+shift,1000)
     V551Marker(101000+shift,"prep",900)
     V551ObserveAdd(117000+shift,"100")
 }
 
 V551Arm(shift := 0)
 {
     V551Prior(shift)
     V551Sample(120000+shift,650)
     V551Marker(121000+shift,"transition",640)
 }
 
 V551Queue()
 {
     V551Arm()
     V551Marker(133000)
     return V551Item()
 }
 
 V551Count()
 {
     global Audio
     n := 0
     for item in Audio.Queue {
         if item.Kind="Boss" && item.Key="TythWave8"
             n += 1
     }
     return n
 }
 
 V551Item()
 {
     global Audio
     V48Assert(V551Count()=1,"exactly one queued late-eight warning")
     for item in Audio.Queue {
         if item.Key="TythWave8"
             return item
     }
     throw Error("Missing wave queue item")
 }
 
 V551TestHPAloneSilent()
 {
     global TythWave8,tyth65Called
     V551Setup(), V551Prior()
     V551Sample(120000,650), V551Sample(120100,640)
     V48Assert(TythWave8.CrossAt=120000 && !tyth65Called && V551Count()=0,"65% only arms, no spoken prediction")
     V551Marker(133000,"prep",600)
     V48Assert(V551Count()=0,"no transition means no fallback on subsequent prep")
 }
 
 V551TestTransitionThenPrep()
 {
     global TythWave8,tyth65Called
     V551Setup(), V551Arm()
     V48Assert(TythWave8.TransitionAt=121000 && !tyth65Called && V551Count()=0,"transition does not immediately speak")
     V551Marker(133000)
     item := V551Item()
     V48Assert(item.TW8Data.At=133000 && tyth65Called && TythWave8.Open,"warning bound to exact later prep")
     V48Assert(AudioItemEnabled(item),"fresh selected-window warning is eligible")
 }
 
 V551TestOlderFourWaveFirst()
 {
     global TythWave8
     V551Setup(), V551Prior()
     V551Marker(133000,"prep",660)
     V551Sample(134000,650), V551Marker(135000,"transition")
     V48Assert(V551Count()=0,"do not warn about pending ordinary wave")
     Loop 4
         V551ObserveAdd(149000+A_Index,"200" A_Index)
     V48Assert(V551Count()=0,"intervening four adds do not trigger a delayed HP warning")
     V551Marker(165000)
     V48Assert(V551Item().TW8Data.At=165000 && TythWave8.Open,"next prep owns later eight-wave warning")
 }
 
 V551TestNoInterveningWaveRequired()
 {
     V551Setup(), V551Arm(), V551Marker(133000)
     V48Assert(V551Count()=1,"first physical group after crossing may already be eight")
     V551ObserveAdd(149000,"200")
     V48Assert(V551Count()=0,"first new actor retires warning without requiring another wave")
 }
 
 V551TestMissingHistory()
 {
     global tyth65Called,TythWave8
     V551Setup(), V551Sample(100000,640)
     V551Marker(101000,"prep"),V551ObserveAdd(117000),V551Marker(121000,"transition"),V551Marker(133000)
     V48Assert(tyth65Called && V551Count()=0,"missing above-threshold history consumes silently")
     V551Sample(134000,700),V551Sample(135000,640)
     V551ObserveAdd(149000,"200"),V551Marker(165000)
     V48Assert(V551Count()=0,"later history cannot resurrect a missed opportunity")
 }
 
 V551TestUnresolvedPriorWave()
 {
     global tyth65Called,TythWave8
     V551Setup(),V551Sample(100000,900),V551Marker(101000,"prep",800)
     V551Sample(120000),V551Marker(121000,"transition"),V551Marker(133000)
     V48Assert(tyth65Called && V551Count()=0 && !TythWave8.Open,"unresolved earlier wave makes NEXT ambiguous")
     V551ObserveAdd(149000),V551Marker(165000)
     V48Assert(V551Count()=0,"do not shift missed opportunity onto later ordinary wave")
 }
 
 V551TestStalePreparationHistory()
 {
     global tyth65Called
     V551Setup(),V551Arm(),V551Marker(181001)
     V48Assert(tyth65Called && V551Count()=0,"stale transition/prep history fails quiet")
 }
 
 V551TestSourceAndEventFields()
 {
     global TythWave8
     V551Setup(),V551Prior(),V551Sample(120000)
     action := "[Event {836045448945472}: AbilityActivate {836045448945479}]"
     V551Feed(V551Line(121000,"@TestPlayer#1|(0,0,0,0)|(100/100)",V551Boss(640),"{4076190251876352}",action))
     V48Assert(TythWave8.TransitionAt<0,"player-source mention of Tyth cannot arm boss marker")
     V551Feed(V551Line(121001,V551Boss(640),"=","{4076190251876352}","[ApplyEffect {836045448945477}: AbilityActivate {836045448945479}]"))
     V48Assert(TythWave8.TransitionAt<0,"ApplyEffect is not boss AbilityActivate")
     V48Assert(TythWave8Event("{4076190251876352}",action)="transition-start","numeric event matching")
     V48Assert(TythWave8Event("{4076190251876352} suffix",action)="","incidental ability ID is not exact field")
     V551Marker(121002,"transition"),V551Marker(133000)
     V48Assert(V551Count()=1,"actual boss-source activation works")
 }
 
 V551TestDuplicateAndOldRecords()
 {
     global TythWave8
     V551Setup(),V551Arm()
     V551Marker(121000,"transition"),V551Marker(120500,"transition")
     V48Assert(TythWave8.TransitionAt=121000,"duplicate/older marker does not move origin")
     V551Marker(133000),V551Marker(133000),V551Marker(132999)
     V48Assert(V551Count()=1 && TythWave8.PendingSerial=2,"duplicate/older preparations do not double-advance")
 }
 
 V551TestMutedOpportunities()
 {
     global soundboardsEnabled,tyth65CalloutEnabled,tythCalloutsEnabled,autoBossCalloutsEnabled,inputMode,tyth65Called
     for gate in ["master","switch","tyth","automatic","mode","history"] {
         V551Setup(),V551Arm()
         switch gate {
             case "master": soundboardsEnabled := false
             case "switch": tyth65CalloutEnabled := false
             case "tyth": tythCalloutsEnabled := false
             case "automatic": autoBossCalloutsEnabled := false
             case "mode": inputMode := "Hotkey"
         }
         V551Marker(133000,"prep",640,gate!="history")
         V48Assert(tyth65Called && V551Count()=0,"silent opportunity consumed: " gate)
         soundboardsEnabled := true,tyth65CalloutEnabled := true,tythCalloutsEnabled := true
         autoBossCalloutsEnabled := true,inputMode := "CombatLog"
         V551Marker(133000),V551ObserveAdd(149000,"200"),V551Marker(165000)
         V48Assert(V551Count()=0,"no replay after reenable: " gate)
     }
 }
 
 V551TestUnmuteBeforeNewPrep()
 {
     global soundboardsEnabled
     V551Setup(),V551Prior()
     soundboardsEnabled := false
     V551Sample(120000),V551Marker(121000,"transition")
     soundboardsEnabled := true
     V551Marker(133000)
     V48Assert(V551Count()=1,"unmuting BEFORE real prep permits this new warning, not old HP audio")
 }
 
 V551TestHealingDoesNotRearm()
 {
     global TythWave8
     V551Setup(),V551Arm()
     V551Sample(122000,720),V551Marker(133000,"prep",700)
     V48Assert(V551Count()=1,"healing above65 does not erase observed phase marker")
     V551ObserveAdd(149000,"200"),V551Sample(150000,640)
     V551Marker(151000,"transition"),V551Marker(165000)
     V48Assert(V551Count()=0 && TythWave8.TransitionAt=121000,"recrossing and duplicate markers cannot rearm")
 }
 
 V551TestNewAddsRetireQueuedAndActive()
 {
     global Audio,TythWave8
     V551Setup(),item := V551Queue()
     unrelated := item.Clone(),unrelated.Key := "UnrelatedBoss",Audio.Queue.Push(unrelated)
     Audio.Current := item.Clone()
     V551ObserveAdd(149000,"200",true)
     V48Assert(!TythWave8.Open && V551Count()=0 && Audio.Current.Cancel,"new target add cancels queued and requests stop of active warning")
     V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Key="UnrelatedBoss","other queued call preserved")
 }
 
 V551TestOldAddsDoNotCancel()
 {
     global TythWave8
     V551Setup(),item := V551Queue()
     V551ObserveAdd(140000,"100"),V551ObserveAdd(140001,"100",true)
     V48Assert(V551Count()=1 && AudioItemEnabled(item),"known surviving add does not retire pending wave")
     V551ObserveAdd(132999,"300")
     V48Assert(V551Count()=1,"out-of-order new actor does not rewind pending sequence")
 }
 
 V551TestClockAndLogExpiry()
 {
     global testClock,TythWave8
     V551Setup(),item := V551Queue()
     testClock := TythWave8.PendingTick+15000
     V48Assert(!AudioItemEnabled(item),"15-second queue deadline rejects wall-clock-stale wave")
     testClock := TythWave8.PendingTick+1,TythWave8.At := TythWave8.PendingAt+15000
     V48Assert(!AudioItemEnabled(item),"compressed/backlog processing still observes elapsed log-time ceiling")
     PruneAudioQueue()
     V48Assert(V551Count()=0,"expired window pruned")
 }
 
 V551TestSupersededAndInterrupted()
 {
     global TythWave8
     V551Setup(),item := V551Queue()
     V551Marker(134000,"prep",640,true,true)
     V48Assert(V551Count()=0 && !AudioItemEnabled(item),"interrupted selected preparation closes warning")
     V551Marker(165000)
     V48Assert(V551Count()=0,"interruption cannot defer to later prep")
     V551Setup(),item := V551Queue()
     V551Marker(134000)
     V48Assert(V551Count()=0 && !AudioItemEnabled(item),"later preparation supersedes old queue window")
     V551Setup(),V551Arm()
     V551Marker(122000,"transition",640,true,true),V551Marker(133000)
     V48Assert(TythWave8.Halted && V551Count()=0,"transition interruption is ambiguous and fails quiet")
 }
 
 V551TestResetAndBossDeath()
 {
     global TythWave8,tyth65Called,tythEnded,tythGeneration
     V551Setup(),item := V551Queue(),gen := tythGeneration
     ResetTythState("888","synthetic new pull")
     V48Assert(tythGeneration=gen+1 && !tyth65Called && TythWave8.SeenAdds.Count=0 && V551Count()=0,"actual reset clears only relevant sequence history")
     V48Assert(!AudioItemEnabled(item),"old generation cannot play")
     V551Setup(),item := V551Queue()
     V551Feed(V551Line(140000,"@TestPlayer#1|(0,0,0,0)|(100/100)",V551Boss(0),"","[Event {836045448945472}: Death {836045448945493}]"))
     V48Assert(tythEnded && V551Count()=0 && !TythWave8.Open,"boss death retires pending warning")
 }
 
 V551TestPlayerDeathAndRageUnaffected()
 {
     global tythEnded,tythRageStacks,TythWave8
     V551Setup(),item := V551Queue()
     V551Feed(V551Line(134000,V551Boss(600),"@TestPlayer#1|(0,0,0,0)|(0/100)","","[Event {836045448945472}: Death {836045448945493}]"))
     V48Assert(!tythEnded && TythWave8.Open,"player death is not Tyth death")
     V551Feed(V551Line(135000,V551Boss(600),"=","Rage {4086833180836195}","[ModifyCharges {836045448953666}: Rage {4086833180836195}] (9 charges)"))
     V48Assert(tythRageStacks=9 && TythWave8.Open,"Rage counting independent of wave warning")
 }
 
 V551TestBoundedIdentityHistory()
 {
     global TythWave8
     V551Setup(),V551Sample(100000,900),V551Marker(101000,"prep",900)
     Loop 513
         V551ObserveAdd(104000+A_Index,"9" A_Index)
     V48Assert(TythWave8.Halted && TythWave8.SeenAdds.Count=512 && !TythWave8.Open,"bounded map fails quiet instead of forgetting old adds")
 }
 
 V551TestPreviewsAndPayloadPreserved()
 {
     global TYTH_65_EIGHT_WAVE_SOUND_ID,Audio
     V551Setup(),item := V551Queue()
     V48Assert(item.SoundId=TYTH_65_EIGHT_WAVE_SOUND_ID && item.Priority=2 && item.Expires-item.Created=15000,"original sound ID, priority and queue limit retained")
     raw := item.Clone(),raw.DeleteProp("TW8Data")
     V48Assert(!AudioItemEnabled(raw),"context-free live wave prediction cannot bypass sequence")
     raw.Kind := "Test"
     CloseTythWave8("synthetic complete")
     V48Assert(AudioItemEnabled(raw),"explicit sound previews remain independent of encounter trigger")
 }
 
 V551TestIndependentDataUntouched()
 {
     global IP,IR,IPU,IPM,NBCandle,NBOrder,NBRebounder,IrisBench
     V551Setup()
     ip := IP,ir := IR,u := IPU,meters := IPM,nb := NBCandle,no := NBOrder,nr := NBRebounder
     V551Queue(),V551ObserveAdd(149000,"200")
     V48Assert(IP=ip && IR=ir && IPU=u && IPM=meters,"wave tracking does not replace parser, threat/HP, upload or overlay state")
     V48Assert(NBCandle=nb && NBOrder=no && NBRebounder=nr && !IrisBench.Active,"Nahut/capture not started or reset")
 }
 
 V551TestReferenceLog()
 {
     global Audio
     V551Setup()
     calls := []
     for line in StrSplit(V551ReferenceLog(),"`n","`r") {
         if line=""
             continue
         prior := Audio.Serial
         V551Feed(line)
         if Audio.Serial>prior {
             item := V551Item()
             calls.Push(item.TW8Data.At)
         }
     }
     expected := [70255191,70717256,70963882,71260889]
     V48Assert(calls.Length=4,"all six observed pulls give exactly four late-eight warning opportunities")
     for i,at in expected
         V48Assert(calls[i]=at,"reference pull preparation timestamp " i)
     V48Assert(V551Count()=0,"all reference warnings retired by their actual new-add observations")
 }
 
 V551ReferenceLog()
 {
     return "
 (
 [19:24:18.727] [@Player#100|(0,0,0,0)|(443782/443782)] [TYTH {4078423634870272}:231000030275|(0,0,0,0)|(19989636/19989636)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:25:56.341] [TYTH {4078423634870272}:231000030275|(0,0,0,0)|(18327006/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:26:12.569] [Guardian {4078445109706752}:231000170118|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:26:12.569] [Grace {4078440814739456}:231000170285|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:26:12.569] [Guardian {4078445109706752}:231000170440|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:26:12.569] [Grace {4078440814739456}:231000170607|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:26:12.569] [Lance {4078449404674048}:231000170762|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:26:12.569] [Justice {4078432224804864}:231000170923|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:26:12.569] [Lance {4078449404674048}:231000171119|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:26:12.569] [Justice {4078432224804864}:231000171280|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:28:15.907] [@Player#100|(0,0,0,0)|(483839/483839)] [TYTH {4078423634870272}:231000173453|(0,0,0,0)|(19989636/19989636)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:28:44.940] [TYTH {4078423634870272}:231000173453|(0,0,0,0)|(18449146/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:29:01.075] [Justice {4078432224804864}:231000195847|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:01.075] [Guardian {4078445109706752}:231000196043|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:01.075] [Justice {4078432224804864}:231000196210|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:01.169] [Guardian {4078445109706752}:231000196406|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:01.169] [Grace {4078440814739456}:231000196573|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:01.169] [Lance {4078449404674048}:231000196728|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:01.169] [Grace {4078440814739456}:231000196889|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:01.169] [Lance {4078449404674048}:231000197044|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:17.505] [TYTH {4078423634870272}:231000173453|(0,0,0,0)|(16895790/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:29:33.617] [Guardian {4078445109706752}:231000210490|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(372813/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:33.745] [Lance {4078449404674048}:231000210657|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(372813/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:33.746] [Guardian {4078445109706752}:231000210818|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(372813/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:33.746] [Lance {4078449404674048}:231000210985|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(372813/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:29:49.834] [TYTH {4078423634870272}:231000173453|(0,0,0,0)|(15714065/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:30:06.847] [Guardian {4078445109706752}:231000224629|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443604/443604)] [Guardian Blast {4071487262687232}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>
 [19:30:06.930] [Guardian {4078445109706752}:231000224951|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443604/443604)] [Guardian Blast {4071487262687232}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>
 [19:30:08.141] [Grace {4078440814739456}:231000224796|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(370312/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:30:08.345] [Lance {4078449404674048}:231000224468|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(282508/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:30:22.063] [TYTH {4078423634870272}:231000173453|(0,0,0,0)|(13033825/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:30:22.962] [@Player#100|(0,0,0,0)|(443604/443604)] [TYTH {4078423634870272}:231000173453|(0,0,0,0)|(12956846/19989636)] [Combustible Gas Cylinder {2020687623487488}] [ApplyEffect {836045448945477}: Burning {2020687623487746}]
 [19:30:23.566] [TYTH {4078423634870272}:231000173453|(0,0,0,0)|(12942760/19989636)] [=] [ {4076190251876352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:30:38.701] [Guardian {4078445109706752}:231000237572|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(409790/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:30:38.799] [Justice {4078432224804864}:231000237739|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(417482/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:30:38.800] [Guardian {4078445109706752}:231000237935|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(417482/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:30:38.800] [Guardian {4078445109706752}:231000238102|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(417482/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:30:55.191] [TYTH {4078423634870272}:231000173453|(0,0,0,0)|(11385746/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:31:11.288] [Guardian {4078445109706752}:231000251430|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:31:11.288] [Grace {4078440814739456}:231000251597|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:31:11.288] [Guardian {4078445109706752}:231000251752|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:31:11.398] [Grace {4078440814739456}:231000251919|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:31:11.398] [Lance {4078449404674048}:231000252074|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:31:11.398] [Justice {4078432224804864}:231000252235|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:31:11.398] [Lance {4078449404674048}:231000252431|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:31:11.398] [Justice {4078432224804864}:231000252592|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:32:20.041] [@Player#100|(0,0,0,0)|(443782/443782)] [TYTH {4078423634870272}:231000258439|(0,0,0,0)|(19989636/19989636)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:33:40.119] [TYTH {4078423634870272}:231000258439|(0,0,0,0)|(18156112/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:33:56.299] [Guardian {4078445109706752}:231000282340|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:33:56.299] [Grace {4078440814739456}:231000282507|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:33:56.299] [Guardian {4078445109706752}:231000282662|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:33:56.300] [@Player#100|(0,0,0,0)|(462996/480873)] [Lance {4078449404674048}:231000282984|(0,0,0,0)|(340388/340388)] [Mass Mind Control {2522790775226368}] [ApplyEffect {836045448945477}: Taunt {2522790775226628}]
 [19:33:56.401] [Grace {4078440814739456}:231000282829|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:33:56.401] [Justice {4078432224804864}:231000283145|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:33:56.401] [Lance {4078449404674048}:231000283341|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:33:56.402] [Justice {4078432224804864}:231000283502|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:34:12.612] [TYTH {4078423634870272}:231000258439|(0,0,0,0)|(15915340/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:34:28.730] [Justice {4078432224804864}:231000297123|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(394560/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:34:28.731] [Guardian {4078445109706752}:231000297319|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(394560/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:34:28.731] [Guardian {4078445109706752}:231000297486|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(394560/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:34:28.731] [Guardian {4078445109706752}:231000297653|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(394560/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:34:46.567] [TYTH {4078423634870272}:231000258439|(0,0,0,0)|(14727790/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:35:44.410] [@Player#100|(0,0,0,0)|(483839/483839)] [TYTH {4078423634870272}:231000307887|(0,0,0,0)|(19989636/19989636)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:36:59.654] [TYTH {4078423634870272}:231000307887|(0,0,0,0)|(18248232/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:37:15.834] [Grace {4078440814739456}:231000330007|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:37:15.834] [Lance {4078449404674048}:231000330162|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:37:15.834] [Grace {4078440814739456}:231000330323|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:37:15.838] [TYTH {4078423634870272}:231000307887|(0,0,0,0)|(17015010/19989636)] [Justice {4078432224804864}:231000331002|(0,0,0,0)|(340388/340388)] [Sweep {4080279060742144}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)
 [19:37:15.927] [Lance {4078449404674048}:231000330478|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:37:15.927] [Justice {4078432224804864}:231000330639|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:37:15.927] [Guardian {4078445109706752}:231000330835|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:37:15.927] [Guardian {4078445109706752}:231000331198|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:37:32.263] [TYTH {4078423634870272}:231000307887|(0,0,0,0)|(16019399/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:37:48.094] [TYTH {4078423634870272}:231000307887|(0,0,0,0)|(15913156/19989636)] [Justice {4078432224804864}:231000345526|(0,0,0,0)|(340388/340388)] [Melee Attack {4080283355709440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)
 [19:37:48.361] [Guardian {4078445109706752}:231000345192|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:37:48.472] [Guardian {4078445109706752}:231000345359|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:37:48.472] [Guardian {4078445109706752}:231000345722|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:38:04.583] [TYTH {4078423634870272}:231000307887|(0,0,0,0)|(14760998/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:38:20.520] [@Player#100|(0,0,0,0)|(443782/443782)] [TYTH {4078423634870272}:231000307887|(0,0,0,0)|(12986056/19989636)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6656 internal {836045448940876}) <6656.0>
 [19:38:21.346] [Guardian {4078445109706752}:231000359896|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:38:21.346] [Grace {4078440814739456}:231000360063|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:38:21.346] [Lance {4078449404674048}:231000360218|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:38:21.523] [Guardian {4078445109706752}:231000359729|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(432268/443604)] [Guardian Blast {4071487262687232}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23273 ~23274 kinetic {836045448940873}) <23273.0>
 [19:38:23.142] [TYTH {4078423634870272}:231000307887|(0,0,0,0)|(12875408/19989636)] [=] [ {4076190251876352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:38:37.256] [TYTH {4078423634870272}:231000307887|(0,0,0,0)|(12883866/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:38:53.442] [Justice {4078432224804864}:231000372646|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(435650/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:38:53.442] [Guardian {4078445109706752}:231000372842|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(435650/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:38:53.442] [Justice {4078432224804864}:231000373009|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(435650/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:38:53.529] [Guardian {4078445109706752}:231000373205|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(435650/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:38:53.529] [Grace {4078440814739456}:231000373372|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(435650/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:38:53.532] [Lance {4078449404674048}:231000373527|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(435650/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:38:53.532] [Grace {4078440814739456}:231000373688|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(435650/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:38:53.532] [Lance {4078449404674048}:231000373843|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(435650/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:39:10.766] [TYTH {4078423634870272}:231000307887|(0,0,0,0)|(11989744/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:40:21.074] [@Player#100|(0,0,0,0)|(480873/480873)] [TYTH {4078423634870272}:231000384196|(0,0,0,0)|(19989636/19989636)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:41:04.616] [TYTH {4078423634870272}:231000384196|(0,0,0,0)|(17977812/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:41:20.788] [Guardian {4078445109706752}:231000406574|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:41:20.893] [Grace {4078440814739456}:231000406741|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:41:20.893] [Lance {4078449404674048}:231000406896|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:41:20.894] [Justice {4078432224804864}:231000407057|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:41:20.897] [Lance {4078449404674048}:231000407253|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:41:20.897] [Justice {4078432224804864}:231000407414|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:41:21.079] [@Player#100|(0,0,0,0)|(399643/443782)] [Guardian {4078445109706752}:231000406252|(0,0,0,0)|(340388/340388)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:41:21.395] [Grace {4078440814739456}:231000406419|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:41:37.032] [TYTH {4078423634870272}:231000384196|(0,0,0,0)|(15557172/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:41:53.257] [@Player#100|(0,0,0,0)|(426382/443782)] [Lance {4078449404674048}:231000421121|(0,0,0,0)|(340388/340388)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:41:53.940] [Guardian {4078445109706752}:231000421449|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(352864/443158)] [Guardian Blast {4071487262687232}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (51777 kinetic {836045448940873}) <51777.0>
 [19:41:53.949] [Guardian {4078445109706752}:231000421282|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(352864/443158)] [Guardian Blast {4071487262687232}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (51777 kinetic {836045448940873}) <51777.0>
 [19:41:58.759] [Lance {4078449404674048}:231000420960|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443782/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:42:11.372] [TYTH {4078423634870272}:231000384196|(0,0,0,0)|(14087205/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:42:25.381] [@Player#100|(0,0,0,0)|(318270/443782)] [TYTH {4078423634870272}:231000384196|(0,0,0,0)|(12948493/19989636)] [Deadly Saber {1259666663276544}] [ModifyCharges {836045448953666}: Bleeding (Deadly Saber) {1259666663276824}] (3 charges {836045448953667})
 [19:42:28.064] [Guardian {4078445109706752}:231000436342|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(307933/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:42:28.064] [Grace {4078440814739456}:231000436509|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(307933/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:42:28.065] [Justice {4078432224804864}:231000436664|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(307933/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:42:28.065] [Guardian {4078445109706752}:231000436860|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(307933/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:42:31.272] [TYTH {4078423634870272}:231000384196|(0,0,0,0)|(12451208/19989636)] [=] [ {4076190251876352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:42:43.882] [TYTH {4078423634870272}:231000384196|(0,0,0,0)|(11501477/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:43:00.259] [@Player#100|(0,0,0,0)|(414300/443782)] [Justice {4078432224804864}:231000450944|(0,0,0,0)|(340388/340388)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:00.656] [Justice {4078432224804864}:231000450587|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:00.656] [Lance {4078449404674048}:231000450783|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:00.656] [Guardian {4078445109706752}:231000451140|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:00.656] [Grace {4078440814739456}:231000451307|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:00.656] [Guardian {4078445109706752}:231000451462|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:00.656] [Grace {4078440814739456}:231000451629|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:00.856] [Lance {4078449404674048}:231000450426|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:16.269] [TYTH {4078423634870272}:231000384196|(0,0,0,0)|(11182712/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:43:33.011] [Guardian {4078445109706752}:231000464703|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:33.011] [Justice {4078432224804864}:231000464870|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:33.088] [Guardian {4078445109706752}:231000465066|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:33.088] [Justice {4078432224804864}:231000465233|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:43:49.420] [TYTH {4078423634870272}:231000384196|(0,0,0,0)|(13327389/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:44:55.316] [@Player#100|(0,0,0,0)|(483839/483839)] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(19989636/19989636)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:02.528] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(18585600/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:46:18.679] [Grace {4078440814739456}:231000499310|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(248826/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:18.679] [Lance {4078449404674048}:231000499465|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(248826/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:18.679] [Grace {4078440814739456}:231000499626|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(248826/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:18.783] [Lance {4078449404674048}:231000499781|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(248826/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:18.783] [Justice {4078432224804864}:231000499942|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(248826/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:18.783] [Guardian {4078445109706752}:231000500138|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(248826/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:18.784] [Justice {4078432224804864}:231000500305|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(248826/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:18.786] [Guardian {4078445109706752}:231000500501|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(248826/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:34.597] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(16542218/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:46:50.706] [Lance {4078449404674048}:231000514410|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(393074/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:50.811] [Guardian {4078445109706752}:231000514571|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(393074/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:50.811] [Guardian {4078445109706752}:231000514738|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(393074/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:46:50.811] [Guardian {4078445109706752}:231000514905|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(393074/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:47:08.347] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(14908181/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:47:24.742] [@Player#100|(0,0,0,0)|(439140/443782)] [Grace {4078440814739456}:231000529687|(0,0,0,0)|(340388/340388)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:47:25.040] [Lance {4078449404674048}:231000529359|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:47:25.040] [Guardian {4078445109706752}:231000529520|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:47:25.147] [Guardian {4078445109706752}:231000529842|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:47:27.342] [@Player#100|(0,0,0,0)|(443782/443782)] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(12993263/19989636)] [Deadly Saber {1259666663276544}] [ModifyCharges {836045448953666}: Bleeding (Deadly Saber) {1259666663276824}] (3 charges {836045448953667})
 [19:47:28.348] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(12959385/19989636)] [=] [ {4076190251876352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:47:40.889] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(12532974/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:47:56.934] [@Player#100|(0,0,0,0)|(409353/480873)] [Grace {4078440814739456}:231000543788|(0,0,0,0)|(300117/340388)] [Lacerate {975129374883840}] [ApplyEffect {836045448945477}: Trauma (Physical) {975129374884136}]
 [19:47:57.021] [Lance {4078449404674048}:231000543943|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(401818/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:47:57.021] [Grace {4078440814739456}:231000544104|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(401818/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:47:57.123] [Lance {4078449404674048}:231000544259|(0,0,0,0)|(294163/340388)] [@Player#100|(0,0,0,0)|(401818/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:47:57.124] [Justice {4078432224804864}:231000544420|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(401818/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:47:57.124] [Guardian {4078445109706752}:231000544616|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(401818/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:47:57.124] [Justice {4078432224804864}:231000544783|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(401818/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:47:57.124] [Guardian {4078445109706752}:231000544979|(0,0,0,0)|(307886/340388)] [@Player#100|(0,0,0,0)|(401818/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:48:14.275] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(12225934/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:48:30.445] [Lance {4078449404674048}:231000559757|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443782/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:48:30.445] [Guardian {4078445109706752}:231000559918|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443782/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:48:30.545] [Lance {4078449404674048}:231000560085|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443782/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:48:30.546] [Guardian {4078445109706752}:231000560246|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443782/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:48:47.211] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(11804513/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:49:03.310] [Guardian {4078445109706752}:231000574507|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:49:03.312] [@Player#100|(0,0,0,0)|(367679/443782)] [Justice {4078432224804864}:231000574829|(0,0,0,0)|(340388/340388)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:49:03.415] [Grace {4078440814739456}:231000574674|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:49:03.415] [Guardian {4078445109706752}:231000575025|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443158/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:49:22.793] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(9876845/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:49:38.894] [Guardian {4078445109706752}:231000589615|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(409034/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:49:38.996] [Guardian {4078445109706752}:231000589782|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(409034/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:49:38.996] [Lance {4078449404674048}:231000589949|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(409034/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:49:38.996] [Justice {4078432224804864}:231000590110|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(409034/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:50:00.089] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(8312525/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:50:16.144] [@Player#100|(0,0,0,0)|(480873/480873)] [Guardian {4078445109706752}:231000605066|(0,0,0,0)|(336155/340388)] [Lacerate {975129374883840}] [ApplyEffect {836045448945477}: Trauma (Physical) {975129374884136}]
 [19:50:16.304] [Grace {4078440814739456}:231000605233|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:50:16.305] [Grace {4078440814739456}:231000605388|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:50:16.305] [Guardian {4078445109706752}:231000605543|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443634/443634)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:50:37.120] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(6335000/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:50:53.639] [@Player#100|(0,0,0,0)|(483839/483839)] [Guardian {4078445109706752}:231000620696|(0,0,0,0)|(340388/340388)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:50:53.825] [Guardian {4078445109706752}:231000620333|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(436125/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:50:53.826] [Justice {4078432224804864}:231000620500|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(436125/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:50:53.929] [Justice {4078432224804864}:231000620863|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(436125/443158)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:51:09.156] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(4227155/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:51:25.050] [@Player#100|(0,0,0,0)|(410886/480873)] [Guardian {4078445109706752}:231000634750|(0,0,0,0)|(335762/340388)] [Lacerate {975129374883840}] [ApplyEffect {836045448945477}: Trauma (Physical) {975129374884136}]
 [19:51:25.268] [Guardian {4078445109706752}:231000634583|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443782/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:51:25.366] [Justice {4078432224804864}:231000634917|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443782/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:51:25.366] [Lance {4078449404674048}:231000635113|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443782/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:51:25.366] [Grace {4078440814739456}:231000635274|(0,0,0,0)|(340388/340388)] [@Player#100|(0,0,0,0)|(443782/443782)] [] [Event {836045448945472}: TargetSet {836045448953668}]
 [19:51:42.083] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(292711/19989636)] [=] [ {4076168777039872}] [Event {836045448945472}: AbilityActivate {836045448945479}]
 [19:51:45.097] [@Player#100|(0,0,0,0)|(443782/443782)] [TYTH {4078423634870272}:231000476891|(0,0,0,0)|(0/19989636)] [] [Event {836045448945472}: Death {836045448945493}]
 )"
 }
 V551TestMissedPrepCannotShift()
 {
     global tyth65Called
     V551Setup(),V551Arm()
     ; Deliberately omit the selected prep at 133000, but retain new adds.
     V551ObserveAdd(149000,"200"),V551Marker(165000)
     V48Assert(tyth65Called && V551Count()=0,"missing prep produces a stale history gap, not a later ordinary-wave warning")
 }
 
 V551TestMidnightSequence()
 {
     V551Setup()
     shift := 86400000-125000
     V551Arm(shift),V551Marker(133000+shift)
     item := V551Item()
     V48Assert(item.TW8Data.At=86408000 && AudioItemEnabled(item),"unwrapped midnight sequence is not a negative/stale interval")
     V551ObserveAdd(149000+shift,"200")
     V48Assert(V551Count()=0,"midnight add arrival retires correct window")
 }
 
 V551TestSameInstanceReset()
 {
     global tyth65Called,TythWave8
     V551Setup(),V551Queue()
     V551Feed(V551Line(140000,V551Boss(1000),"","","[Event {836045448945472}: TargetCleared {836045448953669}]"))
     V48Assert(!tyth65Called && TythWave8.TransitionAt<0 && V551Count()=0,"full-health boss target-clear rearms same-instance repull")
     V551Marker(141000,"prep",900),V551ObserveAdd(157000,"300")
     V551Sample(160000),V551Marker(161000,"transition"),V551Marker(173000)
     V48Assert(V551Count()=1,"fresh same-instance pull can announce its own later eight")
 }
 ; v56 synthetic boundary regressions; these are not full real-log replays.
 V56Who(hp := 1000)
 {
     return "@Boundary Tester#5601|(0,0,0,0)|(" hp "/1000)"
 }
 V56Boss(hp := 900, id := "4494700455133184", instance := 56)
 {
     return "Test NPC {" id "}:" instance "|(0,0,0,0)|(" hp "/1000)"
 }
 V56Fixture()
 {
     s := IPNewData("v56 synthetic")
     V51Feed(s,0,"Enter",0,V56Who(),"=")
     V51Feed(s,1000,"Damage",100,V56Who(),V56Boss())
     return s
 }
 V56Finish(s, at := 2000)
 {
     V51Feed(s,at,"Death",0,V56Who(),V56Boss(0))
 }
 V56Drain(s)
 {
     V51Feed(s,10000,"Activate",0,V56Who(),"=")
     IPCloseSegment(s,"test end")
     return s.Segments[1]
 }
 V56TestExitFreezesHealing()
 {
     s := V56Fixture()
     V51Feed(s,1500,"Heal",200,V56Who(),"=",false,100)
     V51Feed(s,1600,"Exit",0,V56Who(),"=")
     V48Assert(s.Current.FinishAt=1600 && s.Current.Last=1000,"exit freezes at the last qualifying hit")
     V48Assert(s.Current.Totals[IPActor(V56Who()).Key].Heal=0,"speculative post-hit healing removed exactly")
     V51Feed(s,1800,"Heal",500,V56Who(),"=",false,500)
     V48Assert(s.Current.Totals[IPActor(V56Who()).Key].Effective=0,"positive out-of-combat healing cannot prolong a result")
 }
 V56TestLateHitRestoresIncludedHealing()
 {
     s := V56Fixture()
     V51Feed(s,1500,"Heal",200,V56Who(),"=",false,100)
     V51Feed(s,1600,"Exit",0,V56Who(),"=")
     V51Feed(s,1900,"Damage",50,V56Who(),V56Boss(0))
     seg := V56Drain(s), t := seg.Totals[IPActor(V56Who()).Key]
     V48Assert(t.Damage=150 && t.Heal=200 && t.Effective=100,"late hit retains events inside the extended interval")
     V48Assert(seg.Last=1900 && IPDuration(seg)=1.9,"accepted damage and its timestamp stay together")
 }
 V56TestDeathBeforeFinalHit()
 {
     s := V56Fixture(), V56Finish(s)
     V51Feed(s,2709,"Damage",77,V56Who(),V56Boss(0))
     seg := V56Drain(s)
     V48Assert(seg.Terminal && seg.Last=2709 && seg.Totals[IPActor(V56Who()).Key].Damage=177,"0.709-second late result retained")
 }
 V56TestLaterMissDoesNotExtend()
 {
     s := V56Fixture(), V56Finish(s)
     V51Feed(s,2412,"Damage",50,V56Who(),V56Boss(0))
     line := IPDemoLine(3400,V56Who(),V56Boss(0),"Damage",0)
     IPFeedLine(s,StrReplace(line," kinetic"," -miss {836045448945502} kinetic"))
     seg := V56Drain(s)
     V48Assert(seg.Last=2412 && seg.DamageEvents=2,"a later zero result does not extend a completed fight")
 }
 V56TestImmunePositiveDoesNotExtend()
 {
     s := V56Fixture(), V56Finish(s)
     line := IPDemoLine(2300,V56Who(),V56Boss(0),"Damage",900,false,0)
     IPFeedLine(s,StrReplace(line," kinetic"," -immune {836045448945506} kinetic"))
     seg := V56Drain(s)
     V48Assert(seg.Last=1000 && seg.Totals[IPActor(V56Who()).Key].Damage=100,"positive leading immune amount is not a late killing result")
 }
 V56TestFixedDeadline()
 {
     s := V56Fixture(), V56Finish(s)
     V51Feed(s,3499,"Damage",50,V56Who(),V56Boss(0))
     V51Feed(s,3501,"Damage",999,V56Who(),V56Boss(0))
     seg := V56Drain(s)
     V48Assert(seg.FinishDeadline=3500 && seg.Last=3499,"late hit does not renew the fixed deadline")
     V48Assert(seg.Totals[IPActor(V56Who()).Key].Damage=150,"out-of-window result excluded")
 }
 V56TestNewEntryFreshTotals()
 {
     s := V56Fixture(), V56Finish(s)
     V51Feed(s,2100,"Enter",0,V56Who(),"=")
     V51Feed(s,2200,"Damage",30,V56Who(),V56Boss(900,,57))
     V48Assert(s.Segments.Length=2 && s.Current.Start=2100,"new actual entry always splits a finishing segment")
     V48Assert(s.Current.Totals[IPActor(V56Who()).Key].Damage=30,"new pull never inherits damage")
 }
 V56TestNewEnemyIsNotLateHit()
 {
     s := V56Fixture(), V56Finish(s)
     V51Feed(s,2200,"Damage",30,V56Who(),"Trash {123456}:7|(0,0,0,0)|(700/1000)")
     V48Assert(s.Segments.Length=2 && s.Current.Start=2200,"different enemy starts a disclosed partial pull")
 }
 V56TestCorpseDamageAfterCloseIgnored()
 {
     s := V56Fixture(), V56Finish(s)
     V51Feed(s,8000,"Damage",600,V56Boss(0),V56Who(0))
     V48Assert(s.Segments.Length=1 && !IsObject(s.Current),"lingering corpse damage cannot reopen the finished boss")
 }
 V56TestKnownBossKillsPlayerNotCompletion()
 {
     s := V56Fixture()
     V51Feed(s,2000,"Death",0,V56Boss(),V56Who(0))
     V48Assert(s.Current.FinishAt<0 && !s.Current.Terminal,"victim identity, not presence of the boss name, determines a kill")
 }
 V56TestGroupContinuesAfterLocalExitDeath()
 {
     s := V56Fixture()
     V51Feed(s,1800,"Exit",0,V56Who(0),"=")
     V51Feed(s,1801,"Death",0,V56Boss(),V56Who(0))
     V51Feed(s,2200,"Damage",50,"@Other Player#5602",V56Boss(800))
     V48Assert(s.Segments.Length=1 && s.Current.FinishAt<0,"living-enemy combat contradicts an isolated local exit")
     V48Assert(s.Current.Totals[IPActor(V56Who()).Key].Deaths=1,"local death retained when continuing the group")
 }
 V56TestDeadThenRevivedEntrySplits()
 {
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V56Who(),"=")
     V51Feed(s,1000,"Damage",100,V56Who(),V56Boss(900,"123456"))
     V51Feed(s,2000,"Death",0,V56Boss(900,"123456"),V56Who(0))
     V51Feed(s,2100,"Heal",100,"@Healer#5603",V56Who(100),false,100)
     V51Feed(s,30000,"Enter",0,V56Who(),"=")
     V48Assert(s.Segments.Length=1 && IsObject(s.Reentry),"unrecognized re-entry waits for continuation/reset evidence")
     V51Feed(s,30001,"Activate",0,V56Boss(1000,"123456"),"=")
     V51Feed(s,30100,"Damage",10,V56Who(),V56Boss(900,"123456"))
     V48Assert(s.Segments.Length=2 && s.Current.Start=30000,"actual full-health reset separates this attempt")
 }
 V56TestKnownBossResurrectionKeepsPull()
 {
     s := V56Fixture()
     V51Feed(s,2000,"Death",0,V56Boss(600),V56Who(0))
     V51Feed(s,20000,"Heal",100,"@Healer#5603",V56Who(100),false,100)
     V51Feed(s,30000,"Enter",0,V56Who(),"=")
     V48Assert(IsObject(s.Reentry),"known boss waits briefly for re-entry evidence")
     V51Feed(s,30001,"Damage",10,V56Who(),V56Boss(500))
     V48Assert(s.Segments.Length=1 && s.Current.Start=0,"same injured boss after resurrection keeps original start")
     V48Assert(s.Current.Totals[IPActor(V56Who()).Key].Damage=110,"pre-death and post-res damage remain in the same pull")
 }
 V56TestKnownBossResetSplits()
 {
     for instance in [56,57] {
         s := V56Fixture()
         V51Feed(s,2000,"Death",0,V56Boss(600),V56Who(0))
         V51Feed(s,30000,"Enter",0,V56Who(),"=")
         V51Feed(s,30001,"Activate",0,V56Boss(1000,,instance),"=")
         V51Feed(s,30100,"Damage",10,V56Who(),V56Boss(900,,instance))
         V48Assert(s.Segments.Length=2 && s.Current.Start=30000,"full-HP reset or new boss instance confirms a fresh pull")
         V48Assert(s.Current.Totals[IPActor(V56Who()).Key].Damage=10,"fresh confirmed pull excludes old totals")
     }
 }
 V56TestReentryMissingEvidenceIsPartial()
 {
     s := V56Fixture()
     V51Feed(s,2000,"Death",0,V56Boss(600),V56Who(0))
     V51Feed(s,30000,"Enter",0,V56Who(),"=")
     V51Feed(s,46000,"Activate",0,V56Who(),"=")
     V48Assert(!IsObject(s.Reentry) && s.Segments.Length=2 && s.Current.Partial,"unresolved re-entry becomes a disclosed partial boundary, not a claimed kill")
 }
 V56TestInCombatGapDoesNotSplit()
 {
     s := V56Fixture()
     V51Feed(s,45000,"Damage",200,V56Who(),V56Boss(700))
     V48Assert(s.Segments.Length=1 && IPDuration(s.Current)=45,"explicit in-combat mechanic downtime is not an inferred new pull")
 }
 V56TestPeerExitIgnored()
 {
     s := V56Fixture()
     V51Feed(s,1800,"Exit",0,"@Other Player#5602","=")
     V48Assert(s.Current.FinishAt<0 && s.InCombat=1,"another player exit is not the recorder exit")
 }
 V56TestSistersBothOrders()
 {
     for order in [["4088525397950464","4088538282852352"],["4088538282852352","4088525397950464"]] {
         s := IPNewData()
         V51Feed(s,0,"Enter",0,V56Who(),"=")
         V51Feed(s,1000,"Damage",100,V56Who(),V56Boss(900,order[1],71))
         V51Feed(s,1100,"Damage",100,V56Who(),V56Boss(900,order[2],72))
         V51Feed(s,1200,"Death",0,V56Who(),V56Boss(0,order[1],71))
         V48Assert(s.Current.FinishAt<0,"first sister never satisfies both required groups")
         V51Feed(s,40000,"Damage",100,V56Who(),V56Boss(0,order[2],72))
         V51Feed(s,40000,"Death",0,V56Who(),V56Boss(0,order[2],72))
         V48Assert(s.Current.Terminal && s.Current.Last=40000,"both sisters end in either order across a long gap")
     }
 }
 V56TestOverlayPinsNotCompletionRules()
 {
     V48Assert(!IsObject(IPBRule(IPActor("@Watchdog#66"))),"boss-named player is not a terminal NPC")
     V48Assert(!IsObject(IPBRule(IPActor("Shelleigh {12345}:6"))),"display name alone is not a terminal ID")
     V48Assert(!IsObject(IPBRule(IPActor("Temple Vault {3604589957873664}:3"))),"loot-cache death is not a parser completion rule")
     V48Assert(!IsObject(IPBRule(IPActor("Revan {3431605855059968}:3"))) && IsObject(IPBRule(IPActor("Machine Core {3447583133401088}:4"))),"core, not Revan, is the final target")
 }
 V56TestOverkillIncomingOnly()
 {
     s := V56Fixture()
     V51Feed(s,1500,"Damage",1123726,V56Boss(),V56Who(0),false,446587)
     V51Feed(s,1500,"Death",0,V56Boss(),V56Who(0))
     t := s.Current.Totals[IPActor(V56Who()).Key]
     V48Assert(t.Taken=446587 && t.RawTaken=1123726 && t.Overkill=677139,"explicit death-linked overkill is separated from incoming damage")
     V51Feed(s,1700,"Damage",1000,V56Who(),V56Boss(0),false,80)
     V48Assert(s.Current.Totals[IPActor(V56Who()).Key].Damage=1100,"outgoing damage is not capped to effective HP")
 }
 V56TestNoInferredOverkill()
 {
     a := IPParseLine(IPDemoLine(1000,V56Boss(),V56Who(0),"Damage",1000))
     b := IPParseLine(IPDemoLine(1000,V56Boss(),V56Who(10),"Damage",1000,false,100))
     V48Assert(IPBTaken(a)=1000 && IPBTaken(b)=1000,"no subtraction guessed from HP or ordinary absorbed records")
 }
 V56TestJournalRowsAndRing()
 {
     s := V56Fixture(), seg := s.Current
     seg.EventCap := 2
     V51Feed(s,1100,"Heal",900,V56Who(),"=",true,800)
     V51Feed(s,1200,"Heal",300,V56Who(),"=",false,200)
     V51Feed(s,1300,"Activate",0,V56Who(),"=")
     V56Finish(s,1400)
     V48Assert(seg.Events.Length=1 && seg.EventCount=1 && seg.EventNext=1,"rollback restores overwritten event-ring entries and indices")
     V48Assert(seg.Rows.Count=2 && s.Rows=2 && seg.HealEvents=0,"new speculative rows and row count roll back together")
     V48Assert(seg.Totals[IPActor(V56Who()).Key].HealRecords=0,"effective-heal coverage counters also roll back")
 }
 V56TestJournalExistingHealingRow()
 {
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V56Who(),"=")
     V51Feed(s,500,"Heal",100,V56Who(),"=",false,80)
     V51Feed(s,1000,"Damage",100,V56Who(),V56Boss())
     V51Feed(s,1500,"Heal",999,V56Who(),"=",true,999)
     V56Finish(s,1600)
     who := IPActor(V56Who()).Key
     key := who Chr(30) "Heal" Chr(30) "900000000000001" Chr(30) who
     r := s.Current.Rows[key]
     V48Assert(r.Total=100 && r.Max=100 && r.Min=100 && r.N=1 && r.Critical=0,"rollback restores an existing row's min/max/count/critical metadata")
 }
 V56TestJournalThreatRollback()
 {
     s := V54Fixture()
     IPFeedLine(s,V54Line(5000,"@Tank#1","=","836045448945483","<-500>"))
     V51Feed(s,5500,"Exit",0,"@Tank#1","=")
     V48Assert(s.Current.Raid.Threat["@Tank#1"].Total=100,"post-end signed threat rolls back with the other totals")
     V48Assert(s.Current.Raid.LastThreatAt=4000,"post-end threat does not retain a longer TPS interval")
 }
 V56TestReorderedPositiveDoesNotCommitFutureHeal()
 {
     s := V56Fixture()
     V51Feed(s,1800,"Heal",500,V56Who(),"=",false,500)
     V51Feed(s,1700,"Damage",50,V56Who(),V56Boss())
     V56Finish(s,2000)
     V48Assert(s.Current.Last=1700 && s.Current.Totals[IPActor(V56Who()).Key].Heal=0,"reordered hit cannot commit a heal with a later timestamp")
 }
 V56TestReorderedIncludedHealingSurvives()
 {
     s := V56Fixture()
     V51Feed(s,1800,"Heal",500,V56Who(),"=",false,500)
     V51Feed(s,900,"Heal",100,V56Who(),"=",false,100)
     V56Finish(s,2000)
     V48Assert(s.Current.Totals[IPActor(V56Who()).Key].Heal=100,"included late record survives rollback of a later heal")
 }
 V56TestPendingFuturePartition()
 {
     s := V56Fixture(), V56Finish(s)
     V51Feed(s,2600,"Heal",600,V56Who(),"=",false,600)
     V51Feed(s,2500,"Damage",50,V56Who(),V56Boss(0))
     V48Assert(s.Current.Last=2500 && s.Current.Totals[IPActor(V56Who()).Key].Heal=0,"future pending heal stays outside a reordered finishing hit")
 }
 V56TestSameTimestampResultsPreserved()
 {
     s := V56Fixture()
     line := IPDemoLine(2000,V56Who(),V56Boss(0),"Damage",50)
     IPFeedLine(s,line), V56Finish(s,2000), IPFeedLine(s,line)
     V48Assert(s.Current.Totals[IPActor(V56Who()).Key].Damage=200 && s.Current.DamageEvents=3,"separate same-ms records remain separate")
 }
 V56TestNoDamageHealingSegment()
 {
     s := IPNewData()
     V51Feed(s,0,"Enter",0,V56Who(),"=")
     V51Feed(s,1000,"Heal",100,V56Who(),"=",false,100)
     V51Feed(s,1200,"Exit",0,V56Who(),"=")
     V48Assert(s.Current.Last=1000 && s.Current.Totals[IPActor(V56Who()).Key].Effective=100,"healing-only entered segment has a defined fallback")
 }
 V56TestSourceContextReset()
 {
     s := V56Fixture(), V56Finish(s)
     IPFeedLine(s,IPDemoLine(0,"@New Reader#5","=","Enter"),"different-source")
     V48Assert(s.Segments.Length=2 && s.Owner="@New Reader#5" && s.BlockedEnemies.Count=0,"source rotation resets recorder and corpse guards only for the parser")
 }
 V56TestAreaContextReset()
 {
     s := V56Fixture(), V56Finish(s)
     IPFeedLine(s,"[00:00:03.000] [@New Reader#5] [] [] [AreaEntered {836045448953664}: Area {123}] (server)")
     V48Assert(!IsObject(s.Current) && s.Owner="@New Reader#5" && s.InCombat=0,"area exit clears the previous context")
 }
 V56TestRawEventOverkillPreserved()
 {
     s := V56Fixture()
     V51Feed(s,1500,"Damage",1000,V56Boss(),V56Who(0),false,100)
     V51Feed(s,1500,"Death",0,V56Boss(),V56Who(0))
     ev := s.Current.Events[s.Current.Events.Length-1]
     V48Assert(ev.Amount=1000 && ev.TakenAmount=100,"recent-event raw amount and adjusted incoming value remain distinct")
 }
 V56TestPendingBound()
 {
     s := V56Fixture(), V56Finish(s)
     Loop 8192
         V51Feed(s,2100,"Heal",1,V56Who(),"=",false,1)
     V51Feed(s,2100,"Heal",1,V56Who(),"=",false,1)
     V48Assert(s.Halted && s.Partial,"bounded final-result buffer fails explicitly instead of losing data silently")
 }
 V56TestManualEndIsNotClaimedKill()
 {
     s := V56Fixture()
     V51Feed(s,1500,"Heal",100,V56Who(),"=",false,100)
     IPCloseSegment(s,"manual snapshot")
     V48Assert(!s.Segments[1].Terminal && s.Segments[1].Last=1500,"manual partial snapshot is not silently converted to a boss kill")
 }
 V56TestTrashReadyKeepsHistory()
 {
     app := IPNewApp(), app.Live := IPNewData(), app.Active := true
     V51Feed(app.Live,0,"Enter",0,V56Who(),"=")
     V51Feed(app.Live,1000,"Damage",100,V56Who(),V56Boss(900,"123456",7))
     V51Feed(app.Live,1500,"Exit",0,V56Who(),"=")
     view := IPMResolve(app,1)
     V48Assert(view.State="ENDED" && IsObject(view.Segment) && view.Segment.Id=1,"latest-live trash result stays visible until next combat")
     V48Assert(app.Live.Segments.Length=1 && app.Live.Segments[1].Totals[IPActor(V56Who()).Key].Damage=100,"saved trash history is retained")
 }
 
 V56TestDelayedBossResetEvidence()
 {
     s := V56Fixture()
     V51Feed(s,2000,"Death",0,V56Boss(600),V56Who(0))
     V51Feed(s,30000,"Enter",0,V56Who(),"=")
     V51Feed(s,35000,"Activate",0,V56Who(),"=")
     V48Assert(IsObject(s.Reentry),"delayed boss appearance is not resolved prematurely")
     V51Feed(s,40700,"Activate",0,V56Boss(1000,,57),"=")
     V51Feed(s,41000,"Damage",50,V56Who(),V56Boss(900,,57))
     V48Assert(s.Segments.Length=2 && s.Current.Start=30000,"new boss evidence retains the actual entry time")
 }
 
 V56TestNewIncomingEnemyDoesNotReopenOldPull()
 {
     s := V56Fixture()
     V51Feed(s,1600,"Exit",0,V56Who(),"=")
     V51Feed(s,1900,"Damage",30,V56Boss(900,"123456",99),V56Who())
     V48Assert(s.Segments.Length=2 && s.Current.Start=1900,"a different living enemy starts a new partial encounter, not old-pull continuation")
 }
 
 V56TestMetadataClockRollsBackAtEnd()
 {
     s := V54Fixture()
     IPFeedLine(s,V54Line(17000,"@Tank#1","=","123456789",""))
     V48Assert(s.Current.Raid.LastAt=17000,"non-statistical records still age an ongoing HP snapshot")
     V51Feed(s,18000,"Exit",0,"@Tank#1","=")
     V48Assert(s.Current.Raid.LastAt=4000 && s.Current.Last=4000,"finished metrics and observation clock roll back together")
 }
 ; v56.1 synthetic scenarios, extracted only by the existing manual test runner.
 V561Fixture(id := "4078423634870272")
 {
     s := IPNewData("v56.1 synthetic")
     V51Feed(s,0,"Enter",0,V56Who(),"=")
     V51Feed(s,1000,"Damage",100,V56Who(),V56Boss(900,id))
     return s
 }
 V561Death(s, id, at := 2000)
 {
     V51Feed(s,at,"Death",0,V56Who(),V56Boss(0,id))
 }
 V561End(s)
 {
     IPCloseSegment(s,"synthetic snapshot")
     return s.Segments[1]
 }
 V561T(s)
 {
     return s.Segments[1].Totals[IPActor(V56Who()).Key]
 }
 V561Sisters(reverse := false)
 {
     first := reverse ? "4088525397950464" : "4088538282852352"
     last := reverse ? "4088538282852352" : "4088525397950464"
     s := V561Fixture(first)
     V51Feed(s,1200,"Damage",100,V56Who(),V56Boss(900,last))
     V51Feed(s,1300,"Damage",20,V56Who(),V56Boss(900,"4109905745149952"))
     V561Death(s,first,2000)
     V48Assert(!s.Current.Terminal && s.Current.FinishAt<0,"first sister alone does not end the parse")
     V51Feed(s,2100,"Damage",50,V56Who(),V56Boss(0,last))
     V561Death(s,last,2100)
     V51Feed(s,2200,"Damage",30,V56Who(),V56Boss(0,"4109905745149952"))
     V51Feed(s,2300,"Damage",10,V56Who(),V56Boss(0,last))
     V51Feed(s,2400,"Damage",500,V56Who(),V56Boss(0,"4109905745149952"))
     seg := V561End(s)
     V48Assert(seg.Terminal && seg.Last=2300 && V561T(s).Damage=310,"only final sister hits extend; in-window Countermeasure results retained")
 }
 V561Izax(stage := true, one := true, mode := "836045448953655", area := "833571547775765")
 {
     s := IPNewData("Izax synthetic")
     IPFeedLine(s,"[00:00:00.000] [" V56Who() "] [] [] [AreaEntered {836045448953664}: Area {" area "} 8 Player Master {" mode "}]")
     V51Feed(s,100,"Enter",0,V56Who(),"=")
     V51Feed(s,1000,"Damage",100,V56Who(),V56Boss(900,"4108097563918336"))
     if stage
         V51Feed(s,2000,"Activate",0,V56Boss(100,"4108097563918336"),"=",false,-1,"4168751092072448")
     hp := one ? 1 : 100
     V51Feed(s,2100,"Damage",10,V56Who(),V56Boss(hp,"4108097563918336"))
     IPFeedLine(s,V54Line(2300,V56Who(),V56Boss(hp,"4108097563918336"),"836045448945501","(50 ~0 energy {836045448940874} -immune {836045448945506}) <50>","836045448945477"))
     return s
 }
 V561Relay(s, at := 3066)
 {
     V51Feed(s,at,"Death",0,V56Who(),"Relay {4163128979881984}:561|(0,0,0,0)|(0/1)")
 }
 V561TestTythCleanup()
 {
     s := V561Fixture()
     V51Feed(s,1500,"Damage",40,V56Who(),V56Boss(900,"4078445109706752"))
     V51Feed(s,1900,"Damage",100,V56Who(),V56Boss(0,"4078423634870272"))
     V561Death(s,"4078423634870272")
     V51Feed(s,2200,"Damage",50,V56Who(),V56Boss(900,"4078445109706752"))
     V51Feed(s,2300,"Damage",10,V56Who(),V56Boss(0,"4078423634870272"))
     V51Feed(s,2400,"Damage",500,V56Who(),V56Boss(900,"4078445109706752"))
     seg := V561End(s)
     V48Assert(seg.Last=2300 && V561T(s).Damage=300,"Tyth endpoint is final Tyth hit, not later surviving adds")
 }
 V561TestSistersEsneFirst()
 {
     V561Sisters(false)
 }
 V561TestSistersAivelaFirst()
 {
     V561Sisters(true)
 }
 V561TestFirstSisterKeepsFighting()
 {
     s := V561Fixture("4088525397950464")
     V51Feed(s,1500,"Damage",50,V56Who(),V56Boss(900,"4088538282852352"))
     V561Death(s,"4088525397950464")
     V51Feed(s,3000,"Damage",40,V56Who(),V56Boss(700,"4088538282852352"))
     V48Assert(s.Current.FinishAt<0 && V561T(s).Damage=190,"surviving sister keeps a real encounter active")
 }
 V561TestNewPullAfterCleanup()
 {
     s := V561Fixture(), V561Death(s,"4078423634870272")
     V51Feed(s,5000,"Enter",0,V56Who(),"=")
     V51Feed(s,6000,"Damage",70,V56Who(),V56Boss(900,"4078423634870272",57))
     V48Assert(s.Segments.Length=2 && s.Current.Start=5000 && s.Current.Totals[IPActor(V56Who()).Key].Damage=70,"new entry resets totals and instance state")
 }
 V561TestFinalAllowanceFixed()
 {
     s := V561Fixture(), V561Death(s,"4078423634870272")
     V51Feed(s,3400,"Damage",10,V56Who(),V56Boss(0,"4078423634870272"))
     V51Feed(s,3600,"Damage",100,V56Who(),V56Boss(0,"4078423634870272"))
     seg := V561End(s)
     V48Assert(seg.Last=3400 && V561T(s).Damage=110,"last boss hit does not renew the fixed 1500-ms allowance")
 }
 V561TestScyvaFinalHeal()
 {
     s := V561Fixture("4108140513591296"), V561Death(s,"4108140513591296")
     V51Feed(s,2200,"Heal",100,V56Who(),"=",false,60)
     V51Feed(s,2300,"Exit",0,V56Who(),"=")
     seg := V561End(s)
     V48Assert(seg.Last=1000 && V561T(s).Heal=100 && V561T(s).Effective=60,"pre-exit Scyva heal retained without increasing DPS duration")
 }
 V561TestScyvaPostExitExcluded()
 {
     s := V561Fixture("4108140513591296"), V561Death(s,"4108140513591296")
     V51Feed(s,2300,"Exit",0,V56Who(),"=")
     V51Feed(s,2400,"Heal",100,V56Who(),"=",false,100)
     V561End(s)
     V48Assert(V561T(s).Effective=0,"ordinary post-exit effective heals stay out")
 }
 V561TestScyvaNoExitNoExtraHealing()
 {
     s := V561Fixture("4108140513591296"), V561Death(s,"4108140513591296")
     V51Feed(s,2200,"Heal",100,V56Who(),"=",false,100)
     V561End(s)
     V48Assert(V561T(s).Effective=0,"missing exit is not invented to keep Scyva healing")
 }
 V561TestScyvaNoDoubleHeal()
 {
     s := V561Fixture("4108140513591296"), V561Death(s,"4108140513591296")
     V51Feed(s,2200,"Heal",100,V56Who(),"=",false,60)
     V51Feed(s,2250,"Damage",10,V56Who(),V56Boss(0,"4108140513591296"))
     V51Feed(s,2300,"Exit",0,V56Who(),"=")
     seg := V561End(s)
     V48Assert(seg.Last=2250 && V561T(s).Effective=60 && V561T(s).HealRecords=1,"already committed final heal is not counted twice")
 }
 V561TestScyvaThreatDenominator()
 {
     s := V561Fixture("4108140513591296"), V561Death(s,"4108140513591296")
     IPFeedLine(s,V54Line(2200,V56Who(),"=","836045448945500","(100 ~60) <25>","836045448945477"))
     V51Feed(s,2300,"Exit",0,V56Who(),"=")
     seg := V561End(s), snap := IRSnapshot({Segment:seg,State:"IMPORTED"})
     V48Assert(snap.ThreatDuration=IPDuration(seg) && seg.Raid.Threat[IPActor(V56Who()).Key].Total>=25,"final heal contributes threat, not extra TPS time")
 }
 V561TestTythNoScyvaHealPolicy()
 {
     s := V561Fixture(), V561Death(s,"4078423634870272")
     V51Feed(s,2200,"Heal",100,V56Who(),"=",false,100)
     V51Feed(s,2300,"Exit",0,V56Who(),"=")
     V561End(s)
     V48Assert(V561T(s).Effective=0,"Scyva-specific acceptance is not applied to Tyth cleanup")
 }
 V561TestOverkillAfterDeath()
 {
     s := V561Fixture(), victim := "@Victim#561|(0,0,0,0)|(0/1000)"
     V51Feed(s,1500,"Damage",200,V56Boss(),victim,false,50)
     V51Feed(s,1500,"Death",0,V56Boss(),victim)
     V51Feed(s,1500,"Damage",200,V56Boss(),victim,false,0)
     t := s.Current.Totals[IPActor(victim).Key]
     V48Assert(t.Taken=250 && t.RawTaken=400 && t.Overkill=150,"only lethal packet is capped; post-Death raw packet retained")
 }
 V561TestOverkillAfterRevival()
 {
     s := V561Fixture(), victim := "@Victim#561|(0,0,0,0)|(0/1000)"
     V51Feed(s,1500,"Death",0,V56Boss(),victim)
     V51Feed(s,1600,"Heal",200,V56Who(),"@Victim#561|(0,0,0,0)|(200/1000)",false,200)
     V51Feed(s,1601,"Activate",0,"@Victim#561|(0,0,0,0)|(200/1000)","=")
     V51Feed(s,1700,"Damage",500,V56Boss(),victim,false,200)
     V51Feed(s,1701,"Death",0,V56Boss(),victim)
     V48Assert(s.Current.Totals[IPActor(victim).Key].Taken=200,"positive-HP activation plus a subsequent Death rearms overkill clipping")
 }
 V561TestIncomingLifeRollback()
 {
     s := V561Fixture(), victim := "@Victim#561|(0,0,0,0)|(0/1000)"
     V51Feed(s,1500,"Death",0,V56Boss(),victim)
     V48Assert(s.Current.IncomingDead.Has(IPActor(victim).Key),"speculative Death observed")
     V51Feed(s,1600,"Exit",0,V56Who(),"=")
     V48Assert(!s.Current.IncomingDead.Has(IPActor(victim).Key),"rollback restores metric-local life state too")
 }
 V561TestThreatOnlyExcluded()
 {
     s := V561Fixture("4108140513591296")
     IPFeedLine(s,V54Line(1500,V56Who(),V56Boss(900,"123456",9),"836045448945483","<100>"))
     V51Feed(s,1800,"Damage",20,V56Who(),V56Boss(0,"4108140513591296"))
     before := s.Current.Raid.Threat[IPActor(V56Who()).Key].Total
     V561Death(s,"4108140513591296"), seg := V561End(s)
     V48Assert(seg.Raid.Threat[IPActor(V56Who()).Key].Total=before-100 && seg.ExcludedThreatRecords=1,"unused NPC threat-only event excluded on finalization")
 }
 V561TestEarlierThreatBecomesRelevant()
 {
     s := V561Fixture("4108140513591296"), add := V56Boss(900,"123456",9)
     IPFeedLine(s,V54Line(1500,V56Who(),add,"836045448945483","<100>"))
     V51Feed(s,1600,"Damage",20,V56Who(),add)
     before := s.Current.Raid.Threat[IPActor(V56Who()).Key].Total
     V561Death(s,"4108140513591296"), seg := V561End(s)
     V48Assert(seg.Raid.Threat[IPActor(V56Who()).Key].Total=before && seg.ExcludedThreatRecords=0,"later damage makes earlier threat relevant")
 }
 V561TestGeneratedHealingThreatStays()
 {
     s := V561Fixture("4108140513591296")
     IPFeedLine(s,V54Line(1500,V56Who(),V56Boss(900,"123456",9),"836045448945500","(100 ~0) <40>","836045448945477"))
     V51Feed(s,1800,"Damage",20,V56Who(),V56Boss(0,"4108140513591296"))
     before := s.Current.Raid.Threat[IPActor(V56Who()).Key].Total
     V561Death(s,"4108140513591296"), seg := V561End(s)
     V48Assert(seg.Raid.Threat[IPActor(V56Who()).Key].Total=before,"healing-generated threat is not a threat-only change")
 }
 V561TestThreatEvidenceRollback()
 {
     s := V561Fixture("4108140513591296")
     IPFeedLine(s,V54Line(1500,V56Who(),V56Boss(900,"123456",9),"836045448945483","<100>"))
     V561Death(s,"4108140513591296"), seg := V561End(s)
     V48Assert(seg.ExcludedThreatRecords=0 && seg.ThreatOnly.Count=0,"rolled-back threat is not subtracted twice")
 }
 V561TestIzaxObjectHealingScope()
 {
     s := V561Fixture("4108097563918336")
     V51Feed(s,1500,"Heal",100,V56Who(),V56Boss(900,"4159851919835136"),false,0)
     V51Feed(s,1600,"Heal",50,V56Who(),V56Boss(900,"4164761067454464"),false,10)
     V51Feed(s,1700,"Heal",30,V56Who(),V56Boss(900,"123456"),false,30)
     V48Assert(V561T(s).Heal=80 && V561T(s).Effective=40 && s.Current.ExcludedObjectHeals=1,"only specified zero-effective object heals excluded; real NPC healing retained")
 }
 V561TestIzaxFullSequence()
 {
     s := V561Izax()
     V51Feed(s,3000,"Exit",0,V56Who(),"=")
     V51Feed(s,3040,"Heal",20,V56Who(),"=",false,20)
     V561Relay(s)
     V51Feed(s,3100,"Heal",500,V56Who(),"=",false,500)
     seg := V561End(s)
     V48Assert(seg.ScriptClosedAt=3066 && seg.Last=3066 && V561T(s).Damage=160,"scoped animation raw amounts and relay endpoint retained")
     V48Assert(V561T(s).Effective=20,"same terminal interval healing retained, later healing excluded")
 }
 V561TestIzaxMissingStage()
 {
     s := V561Izax(false)
     V51Feed(s,3000,"Exit",0,V56Who(),"=")
     V561Relay(s)
     V48Assert(s.Current.ScriptExitAt<0,"1 HP and relay without final-stage evidence cannot activate compatibility")
 }
 V561TestIzaxMissingOneHP()
 {
     s := V561Izax(true,false)
     V51Feed(s,3000,"Exit",0,V56Who(),"=")
     V561Relay(s)
     V48Assert(s.Current.ScriptExitAt<0,"final-stage cast without 1 HP cannot activate compatibility")
 }
 V561TestIzaxAreaModeScope()
 {
     for input in [["836045448953653","833571547775765"],["836045448953655","123456"]] {
         s := V561Izax(true,true,input[1],input[2])
         V51Feed(s,3000,"Exit",0,V56Who(),"=")
         V48Assert(s.Current.ScriptExitAt<0,"other mode or area does not inherit 8M GODS compatibility")
     }
 }
 V561TestIzaxDeadRecorderExit()
 {
     s := V561Izax()
     V51Feed(s,3000,"Exit",0,V56Who(0),"=")
     V561Relay(s)
     V48Assert(s.Current.ScriptExitAt<0,"dead recorder exit is not living-survival completion evidence")
 }
 V561TestIzaxRelayWithoutExit()
 {
     s := V561Izax()
     V561Relay(s)
     V48Assert(s.Current.ScriptExitAt<0 && !s.Current.Terminal,"relay alone cannot certify an Izax kill")
 }
 V561TestIzaxMissingRelayFallback()
 {
     s := V561Izax()
     V51Feed(s,3000,"Exit",0,V56Who(),"=")
     V561Relay(s,5000)
     seg := V561End(s)
     V48Assert(seg.ScriptClosedAt<0 && seg.Last=3000 && InStr(seg.EndReason,"unconfirmed"),"late/missing relay cannot extend exit fallback indefinitely")
 }
 V561TestIzaxHealthResetDisarms()
 {
     s := V561Izax()
     V51Feed(s,2600,"Damage",10,V56Who(),V56Boss(900,"4108097563918336"))
     V51Feed(s,3000,"Exit",0,V56Who(),"=")
     V48Assert(s.Current.ScriptExitAt<0 && s.Current.ScriptOneAt<0,"return to positive health clears stale 1-HP evidence")
 }
 V561TestIzaxSourceClearsScope()
 {
     s := V561Izax()
     IPBSourceBoundary(s,"another source")
     V48Assert(s.AreaId="" && s.ModeId="" && !IsObject(s.Current),"source changes cannot inherit GODS area/mode or final-phase state")
 }
 V561TestIzaxSameMillisecondTail()
 {
     s := V561Izax()
     V51Feed(s,3000,"Exit",0,V56Who(),"=")
     V51Feed(s,3066,"Heal",20,V56Who(),"=",false,20)
     V561Relay(s)
     V51Feed(s,3066,"Heal",30,V56Who(),"=",false,30)
     V51Feed(s,3067,"Heal",100,V56Who(),"=",false,100)
     V561End(s)
     V48Assert(V561T(s).Effective=50,"terminal timestamp is inclusive before/after marker; next millisecond is not included")
 }
 ; v56.2: display-only hold-until-next-combat checks; no GUI, timers or audio.
 V562OverlayFixture(id := "123456")
 {
     app := IPNewApp(), app.Live := IPNewData("Overlay hold fixture"), app.Active := true
     who := V56Who(), npc := V56Boss(900,id,7)
     V51Feed(app.Live,0,"Enter",0,who,"=")
     V51Feed(app.Live,1000,"Damage",100,who,npc)
     V51Feed(app.Live,1000,"Heal",50,who,"=",false,40)
     V51Feed(app.Live,1000,"Damage",30,npc,who)
     IPFeedLine(app.Live,V54Line(1000,who,npc,"836045448945483","<150.0>"))
     V51Feed(app.Live,1500,"Exit",0,who,"=")
     return app
 }
 V562TestClosedResultRetained()
 {
     for id in ["123456","4494700455133184"] {
         app := V562OverlayFixture(id)
         V51Feed(app.Live,10000,"Activate",0,V56Who(),"=")
         view := IPMResolve(app,1), snap := IPMSnapshot(view)
         V48Assert(!IsObject(app.Live.Current) && IsObject(view.Segment),"closed trash and boss results stay selected")
         V48Assert(view.State="ENDED" && snap.Id=1 && snap.Closed,"finished result is not labelled as active combat")
         V48Assert(snap.Duration=1 && snap.Actors[1].Damage=100,"retained result keeps its final interval and damage")
     }
 }
 V562TestIdleDoesNotClearOrStretch()
 {
     app := V562OverlayFixture()
     V51Feed(app.Live,2000,"Heal",500,V56Who(),"=",false,500)
     V51Feed(app.Live,10000,"Activate",0,V56Who(),"=")
     V51Feed(app.Live,600000,"Heal",700,V56Who(),"=",false,700)
     Loop 20 {
         snap := IPMSnapshot(IPMResolve(app,1))
         V48Assert(snap.Id=1 && snap.Duration=1 && snap.Actors[1].Damage=100,"idle display refresh cannot erase or stretch the finished result")
         V48Assert(snap.Actors[1].Effective=40,"post-fight healing does not enter the retained result")
     }
     V48Assert(app.Live.Segments.Length=1 && !IsObject(app.Live.Current),"keeping the display does not reopen parsing")
 }
 V562TestNextEntryReplacesResult()
 {
     app := V562OverlayFixture()
     V51Feed(app.Live,10000,"Activate",0,V56Who(),"=")
     old := app.Live.Segments[1]
     V51Feed(app.Live,20000,"Enter",0,V56Who(),"=")
     snap := IPMSnapshot(IPMResolve(app,1))
     V48Assert(snap.Id=2 && snap.Duration=0 && !snap.Closed && snap.State="LIVE LOG","the next combat entry replaces the old display before the first hit")
     V48Assert(snap.Actors[1].Damage=0 && snap.Actors[1].Effective=0 && snap.Actors[1].Taken=0,"new fight starts with zero totals")
     V51Feed(app.Live,21000,"Damage",35,V56Who(),V56Boss(900,"123456",8))
     snap := IPMSnapshot(IPMResolve(app,1))
     V48Assert(snap.Id=2 && snap.Actors[1].Damage=35,"new damage does not include the previous fight")
     V48Assert(old.Totals[IPActor(V56Who()).Key].Damage=100 && old.Last=1000,"previous result remains intact in history")
 }
 V562TestEntryDuringFinishingReplacesResult()
 {
     app := V562OverlayFixture()
     V51Feed(app.Live,1700,"Enter",0,V56Who(),"=")
     snap := IPMSnapshot(IPMResolve(app,1))
     V48Assert(snap.Id=2 && snap.Start=1700 && snap.Duration=0,"next combat does not wait for the previous finishing deadline")
     V48Assert(snap.Actors[1].Damage=0 && app.Live.Segments[1].End=1000,"old final-hit handling does not leak totals into the new display")
 }
 V562TestRetainedDisplayAcceptsFinalHit()
 {
     app := V562OverlayFixture()
     V51Feed(app.Live,1800,"Damage",25,V56Who(),V56Boss(0,"123456",7))
     V51Feed(app.Live,10000,"Activate",0,V56Who(),"=")
     snap := IPMSnapshot(IPMResolve(app,1))
     V48Assert(snap.Id=1 && snap.Closed && snap.Duration=1.8,"legitimate late result still settles the held display")
     V48Assert(snap.Actors[1].Damage=125,"final hit remains included instead of freezing prematurely")
 }
 V562TestHeldSnapshotAcrossViews()
 {
     app := V562OverlayFixture()
     V51Feed(app.Live,10000,"Activate",0,V56Who(),"=")
     snap := IPMSnapshot(IPMResolve(app,1))
     V48Assert(IPMRank(snap.Actors,"Damage",8).Total=100,"held raid damage data present")
     V48Assert(IPMRank(snap.Actors,"Heal",8).Total=40,"held raid effective-healing data present")
     V48Assert(IPMRank(snap.Actors,"Taken",8).Total=30,"held raid damage-taken data present")
     V48Assert(snap.Raid.Threat.Length=1 && snap.Raid.Threat[1].Total=150,"held threat snapshot is retained")
     V48Assert(snap.Raid.Health.Length=1 && snap.Raid.ThreatDuration=1,"held health and threat interval are retained")
     for mode in [1,2,3] {
         state := IPMNewState(), state.Enabled := true, state.Mode := mode
         for kind in ["Personal","Damage","Heal","Taken","Threat","BossHP"]
             state.Shown[kind] := true
         for metric in ["Personal","Damage","Heal","Taken"] {
             state.Metric := metric
             targets := IPMDisplayTargets(state)
             V48Assert(targets.Length=(mode=1 ? 3 : (mode=2 ? 6 : 7)),"all tabbed/separate/both display choices remain available")
             V48Assert(IPMSnapshot(IPMResolve(app,1)).Id=1,"changing view/layout never clears the held result")
         }
     }
 }
 V562TestSourceAndHistoryStayIndependent()
 {
     app := V562OverlayFixture(), app.Offline := V52Fixture()
     V51Feed(app.Live,10000,"Activate",0,V56Who(),"=")
     app.View := "Imported", app.Follow := false, app.Selected := 1
     V48Assert(IPMResolve(app,1).Segment=app.Live.Segments[1],"latest-live stays on the held live result while reviewing an import")
     V48Assert(IPMResolve(app,2).Segment=app.Offline.Segments[1] && IPMResolve(app,2).State="IMPORTED","explicit imported selection is not replaced by the held live result")
     app.View := "Live"
     V51Feed(app.Live,20000,"Enter",0,V56Who(),"=")
     V48Assert(IPMResolve(app,1).Segment.Id=2,"latest-live follows the next combat")
     V48Assert(IPMResolve(app,2).Segment.Id=1 && IPMResolve(app,2).State="LIVE HISTORY","deliberately pinned history remains pinned")
 }
 V562TestExplicitClearAndStatusPreserved()
 {
     app := V562OverlayFixture()
     V51Feed(app.Live,10000,"Activate",0,V56Who(),"=")
     app.Active := false
     V48Assert(IPMResolve(app,1).State="STOPPED" && IsObject(IPMResolve(app,1).Segment),"stopping collection retains results without labelling them live")
     app.Active := true, app.Live.Halted := true
     V48Assert(IPMResolve(app,1).State="STOPPED: INCOMPLETE" && IsObject(IPMResolve(app,1).Segment),"halted status and last available result remain visible")
     app.Live := IPNewData("explicitly cleared session")
     snap := IPMSnapshot(IPMResolve(app,1))
     V48Assert(snap.Id=0 && snap.Actors.Length=0,"explicit session clearing does not resurrect cached old totals")
 }
 ; v56.3: protect the opposite cases too. None has an actual recorder exit.
 V563TestMeterGapDoesNotInventHistory()
 {
     app := IPNewApp(), app.Live := V52Fixture(), app.Active := true
     app.Selected := 1, app.Follow := false
     V51Feed(app.Live,40000,"Damage",1,"@B#2")
     V48Assert(app.Live.Segments.Length=1 && app.Live.Current.FinishAt<0,"quiet in-combat gap is not a completed fight")
     V48Assert(app.Live.Current.Start=1000 && app.Live.Current.Totals["@B#2"].Damage=4001,"same combat retains its original start and accumulated damage")
     for source in [1,2] {
         view := IPMResolve(app,source)
         V48Assert(view.Segment.Id=1 && view.State="LIVE LOG","one ongoing combat is not labelled as older history")
     }
 }
 V563TestDuplicateEntryDoesNotInventHistory()
 {
     app := IPNewApp(), app.Live := V52Fixture(), app.Active := true
     app.Selected := 1, app.Follow := false
     V51Feed(app.Live,40000,"Enter",0,"@A#1","=")
     V51Feed(app.Live,50000,"Damage",20000,"@A#1")
     V48Assert(app.Live.Segments.Length=1 && app.Live.Current.Start=1000,"repeated entry without end or reset evidence does not create a second fight")
     V48Assert(app.Live.Current.Totals["@A#1"].Damage=30000,"repeated entry does not clear the ongoing combat's damage")
     for source in [1,2] {
         view := IPMResolve(app,source)
         V48Assert(view.Segment.Id=1 && view.State="LIVE LOG","duplicate entry cannot manufacture live history")
     }
 }
 V563TestPeerExitDoesNotInventHistory()
 {
     app := IPNewApp(), app.Live := V52Fixture(), app.Active := true
     app.Selected := 1, app.Follow := false
     V51Feed(app.Live,12000,"Exit",0,"@B#2","=")
     V48Assert(app.Live.InCombat=1 && app.Live.Current.FinishAt<0,"another player's exit is not the recorder's combat end")
     V51Feed(app.Live,40000,"Enter",0,"@A#1","=")
     V51Feed(app.Live,50000,"Damage",20000,"@A#1")
     V48Assert(app.Live.Segments.Length=1 && app.Live.Current.Totals["@A#1"].Damage=30000,"peer exit does not clear or split the recorder's fight")
     for source in [1,2] {
         view := IPMResolve(app,source)
         V48Assert(view.Segment.Id=1 && view.State="LIVE LOG","peer exit cannot manufacture a past fight for the overlay")
     }
 }
 ; v56.4 parser continuity regressions. Loaded ONLY by manual diagnostics.
 V564Base(known := true, includeExit := true)
 {
     s := IPNewData("v56.4 synthetic continuity")
     id := known ? "2017170045272064" : "9999999999999999"
     V51Feed(s,0,"Enter",0,V56Who(),"=")
     V51Feed(s,1000,"Damage",100,V56Who(),V56Boss(900,id))
     V51Feed(s,1500,"Death",0,V56Boss(900,id),V56Who(0))
     if includeExit
         V51Feed(s,1600,"Exit",0,V56Who(0),"=")
     return s
 }
 V564Damage(s)
 {
     total := 0
     for key, actor in s.Current.Actors {
         if actor.Kind = "Player"
             total += s.Current.Totals[key].Damage
     }
     return total
 }
 V564TestKnownEntryDuringFinish()
 {
     s := V564Base()
     V51Feed(s,2000,"Enter",0,V56Who(),"=")
     V48Assert(IsObject(s.Reentry) && s.Segments.Length=1,"death-linked entry waits before destructive closure")
     V51Feed(s,2100,"Damage",50,V56Who(),V56Boss(850,"2017170045272064"))
     V48Assert(!IsObject(s.Reentry) && s.Segments.Length=1 && s.Current.Start=0,"same injured boss resumes the original pull")
     V48Assert(V564Damage(s)=150 && s.Current.FinishAt<0,"old and new damage retained once")
 }
 V564TestUnknownEntryDuringFinish()
 {
     s := V564Base(false)
     V51Feed(s,2000,"Enter",0,V56Who(),"=")
     V51Feed(s,2100,"Damage",50,V56Who(),V56Boss(850,"9999999999999999"))
     V48Assert(s.Segments.Length=1 && V564Damage(s)=150,"unknown same-instance injured enemy also preserves continuity")
 }
 V564TestKnownDelayedPeer()
 {
     for delay in [6000,20000,120000] {
         s := V564Base()
         V51Feed(s,5000,"Activate",0,"@Peer#5642","=")
         V51Feed(s,delay,"Damage",50,"@Peer#5642",V56Boss(850,"2017170045272064"))
         V48Assert(s.Segments.Length=1 && s.Current.FinishAt<0 && V564Damage(s)=150,"delayed peer evidence is examined before closure/suppression")
     }
 }
 V564TestUnknownDelayedPeer()
 {
     for delay in [6000,20000,120000] {
         s := V564Base(false)
         V51Feed(s,5000,"Activate",0,"@Peer#5642","=")
         V51Feed(s,delay,"Damage",50,"@Peer#5642",V56Boss(850,"9999999999999999"))
         V48Assert(s.Segments.Length=1 && V564Damage(s)=150,"catalogue absence does not discard delayed peer combat")
     }
 }
 V564TestUnknownDeadQuietGap()
 {
     s := V564Base(false,false)
     V51Feed(s,120000,"Damage",50,"@Peer#5642",V56Boss(850,"9999999999999999"))
     V48Assert(s.Segments.Length=1 && s.Current.Start=0 && V564Damage(s)=150,"death plus a quiet phase is not encounter completion")
 }
 V564TestExitDeathOrders()
 {
     for reverse in [false,true] {
         s := V56Fixture()
         if reverse {
             V51Feed(s,1500,"Exit",0,V56Who(0),"=")
             V51Feed(s,1501,"Death",0,V56Boss(),V56Who(0))
         }
         else {
             V51Feed(s,1500,"Death",0,V56Boss(),V56Who(0))
             V51Feed(s,1501,"Exit",0,V56Who(0),"=")
         }
         V51Feed(s,7000,"Damage",50,"@Peer#5642",V56Boss(850))
         V48Assert(s.Segments.Length=1 && V564Damage(s)=150,"both exit/death orders retain continuing combat")
         V48Assert(s.Current.Totals[IPActor(V56Who()).Key].Deaths=1,"pending death is restored exactly once")
     }
 }
 V564TestPendingHealingRecovered()
 {
     s := V564Base()
     V51Feed(s,4500,"Heal",200,"@Healer#5643",V56Who(100),false,100)
     V48Assert(s.Current.Last=1000,"waiting or post-exit healing alone does not extend displayed time")
     V51Feed(s,6000,"Damage",50,"@Peer#5642",V56Boss(850,"2017170045272064"))
     V48Assert(s.Current.Totals["@Healer#5643"].Heal=200 && s.Current.Totals["@Healer#5643"].Effective=100,"later combat restores the buffered in-fight healing")
     V48Assert(s.Current.Last=6000 && V564Damage(s)=150,"restoration does not duplicate damage or manufacture idle time")
 }
 V564TestRepeatedResurrections()
 {
     s := V564Base()
     Loop 3 {
         at := 10000*A_Index
         V51Feed(s,at,"Enter",0,V56Who(),"=")
         V51Feed(s,at+100,"Damage",10,V56Who(),V56Boss(800-A_Index*100,"2017170045272064"))
         V51Feed(s,at+200,"Activate",0,V56Who(),"=")
         V51Feed(s,at+300,"Death",0,V56Boss(800-A_Index*100,"2017170045272064"),V56Who(0))
         V51Feed(s,at+400,"Exit",0,V56Who(0),"=")
     }
     V48Assert(s.Segments.Length=1 && V564Damage(s)=130,"repeated deaths/re-entries retain exactly one accumulated result")
 }
 V564TestUnknownResetEvidence()
 {
     s := V564Base(false)
     V51Feed(s,6000,"Enter",0,V56Who(),"=")
     V51Feed(s,6001,"Activate",0,V56Boss(1000,"9999999999999999"),"=")
     V51Feed(s,6100,"Damage",50,V56Who(),V56Boss(950,"9999999999999999"))
     V48Assert(s.Segments.Length=2 && s.Current.Start=6000 && V564Damage(s)=50,"full-health reset of previously injured unknown instance separates attempts")
     V48Assert(s.Segments[1].Totals[IPActor(V56Who()).Key].Damage=100,"old reset attempt is still available in history")
 }
 V564TestKnownNewInstance()
 {
     s := V564Base()
     V51Feed(s,6000,"Enter",0,V56Who(),"=")
     V51Feed(s,6100,"Damage",50,V56Who(),V56Boss(950,"2017170045272064",57))
     V48Assert(s.Segments.Length=2 && s.Current.Start=6000 && V564Damage(s)=50,"new instance of an already observed boss group is a separate attempt")
 }
 V564TestDifferentPhaseGroup()
 {
     s := V561Fixture("4088525397950464")
     V51Feed(s,1500,"Death",0,V56Boss(900,"4088525397950464"),V56Who(0))
     V51Feed(s,1600,"Exit",0,V56Who(0),"=")
     V51Feed(s,2000,"Enter",0,V56Who(),"=")
     V51Feed(s,2100,"Damage",50,V56Who(),V56Boss(950,"4088538282852352",57))
     V48Assert(s.Segments.Length=1 && s.Current.BossKey="G-AE" && V564Damage(s)=150,"new group within the same encounter is not treated as a reset instance")
 }
 V564TestUnclassifiedPhaseIsPartial()
 {
     s := V564Base(false)
     V51Feed(s,20000,"Damage",50,"@Peer#5642",V56Boss(850,"9999999999999998",57))
     V48Assert(s.Segments.Length=1 && V564Damage(s)=150 && s.Current.Partial,"unknown phase transition after death preserves evidence but discloses uncertainty")
 }
 V564TestConfirmedKillStaysClosed()
 {
     s := V564Base()
     V51Feed(s,1700,"Death",0,"@Peer#5642",V56Boss(0,"2017170045272064"))
     V51Feed(s,9000,"Damage",999,"@Peer#5642",V56Boss(0,"2017170045272064"))
     V48Assert(s.Segments.Length=1 && !IsObject(s.Current),"proven completion still rejects late corpse activity")
     V48Assert(s.Segments[1].Totals[IPActor(V56Who()).Key].Damage=100,"continuity is not unconditional reopening")
 }
 V564TestResetBeforeVitalsOverwrite()
 {
     s := V564Base()
     V51Feed(s,2000,"Activate",0,V56Boss(1000,"2017170045272064"),"=")
     V51Feed(s,6000,"Enter",0,V56Who(),"=")
     V51Feed(s,6001,"Activate",0,V56Boss(1000,"2017170045272064"),"=")
     V51Feed(s,6100,"Damage",50,V56Who(),V56Boss(950,"2017170045272064"))
     V48Assert(s.Segments.Length=2 && V564Damage(s)=50,"passive full-HP observation cannot erase the prior-injury reset evidence")
 }
 V564TestSourceClearsContinuation()
 {
     s := V564Base()
     IPBSourceBoundary(s,"different physical file")
     V48Assert(!IsObject(s.Current) && !IsObject(s.Reentry) && !s.DiedSinceEntry,"source boundary clears recoverable death context")
     V51Feed(s,0,"Enter",0,V56Who(),"=")
     V51Feed(s,1000,"Damage",50,V56Who(),V56Boss(850,"2017170045272064"))
     V48Assert(s.Segments.Length=2 && V564Damage(s)=50,"new log source never inherits prior damage")
 }
 V564TestUnresolvedSnapshotIsPartial()
 {
     s := V564Base()
     V51Feed(s,6000,"Enter",0,V56Who(),"=")
     IPCloseSegment(s,"explicit snapshot")
     V48Assert(s.Segments.Length=1 && !IsObject(s.Current) && s.Segments[1].Partial,"missing re-entry evidence is labelled partial at explicit closure")
     V48Assert(!s.Segments[1].Terminal,"unresolved resurrection is not fabricated as a kill")
 }
 V564TestDeadPendingBound()
 {
     s := V564Base()
     remaining := 8193-s.Current.PendingEnd.Length
     Loop remaining
         V51Feed(s,6000,"Heal",1,"@Healer#5643",V56Who(0),false,0)
     V48Assert(s.Halted && s.Partial && s.Current.PendingEnd.Length=8192,"uncertain-exit retention remains bounded and fails visibly, not silently")
 }
 V564TestMidnightContinuation()
 {
     s := IPNewData("midnight continuity")
     V51Feed(s,86397000,"Enter",0,V56Who(),"=")
     V51Feed(s,86398000,"Damage",100,V56Who(),V56Boss(900,"2017170045272064"))
     V51Feed(s,86399000,"Death",0,V56Boss(900,"2017170045272064"),V56Who(0))
     V51Feed(s,86399100,"Exit",0,V56Who(0),"=")
     V51Feed(s,6000,"Damage",50,"@Peer#5642",V56Boss(850,"2017170045272064"))
     V48Assert(s.Segments.Length=1 && s.Current.Last=86406000 && V564Damage(s)=150,"midnight unwrap does not discard delayed continuation")
 }
 
 V564TestResetRetainsActiveDeathAndHealing()
 {
     s := V564Base(false,false)
     V51Feed(s,1700,"Heal",200,"@Healer#5643",V56Who(100),false,100)
     V51Feed(s,6000,"Enter",0,V56Who(),"=")
     V51Feed(s,6001,"Activate",0,V56Boss(1000,"9999999999999999"),"=")
     V51Feed(s,6100,"Damage",50,V56Who(),V56Boss(950,"9999999999999999"))
     old := s.Segments[1]
     V48Assert(s.Segments.Length=2,"supported reset still separates attempts without requiring a local exit")
     V48Assert(old.Totals[IPActor(V56Who()).Key].Deaths=1,"reset resolution must not roll away the observed death of the prior active attempt")
     V48Assert(old.Totals["@Healer#5643"].Heal=200 && old.Totals["@Healer#5643"].Effective=100,"previous active-attempt healing remains inspectable")
     V48Assert(V564Damage(s)=50,"preserving the old result does not contaminate the next attempt")
 }
 
 V564TestUnclassifiedActiveTransitionIsPartial()
 {
     s := V564Base(false,false)
     V51Feed(s,20000,"Damage",50,"@Peer#5642",V56Boss(850,"9999999999999998",57))
     V48Assert(s.Segments.Length=1 && V564Damage(s)=150,"unknown active phase preserves evidence without a fabricated reset")
     V48Assert(s.Current.Partial,"missing final/phase evidence is disclosed even when no local exit was recorded")
 }
 ; v56.5: raw-log regression fixtures. Inert until manual diagnostics are run.
 V565Check(lines, resolved, survived, damage, segments, endpoint, partial := -1)
 {
     s := IPNewData("Trandos synthetic")
     for line in lines
         IPFeedLine(s,line)
     IPCloseSegment(s,"end of synthetic snapshot")
     V48Assert(!s.Halted && s.Malformed=0 && s.BadValues=0 && s.BadEffective=0,"valid Trandos fixture parsed without failure")
     V48Assert(s.Segments.Length=segments,"Trandos and subsequent encounter are grouped separately")
     seg := s.Segments[1], td := seg.Trandos
     actual := IsObject(td) && td.ResolveAt >= 0
     won := IsObject(td) && td.Status = "survived"
     V48Assert(actual=resolved && won=survived,"resolution and survival are independent requirements")
     if resolved {
         V48Assert(seg.Last=endpoint && seg.End=endpoint,"statistics stop at Dying Light resolution")
         total := 0
         for key, actor in seg.Actors {
             if actor.Kind="Player"
                 total += seg.Totals[key].Damage
         }
         V48Assert(total=damage,"after-ending damage excluded, legitimate fight damage retained")
         V48Assert(seg.Totals["@Healer#3"].Heal=40,"later healing never extends or enters the result")
     }
     if partial >= 0
         V48Assert(seg.Partial=partial,"missing or conflicting evidence is disclosed")
 }
 
 V565TestLivingRecorder()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestDeadRecorderLivingPeer()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:03.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Recorder#1|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:03.100] [@Recorder#1|(1,2,3,0)|(0/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945490}]",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestExactlyOneSurvivor()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Recorder#1|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Healer#3|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestAllObservedDead()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Recorder#1|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Peer#2|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Healer#3|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (999 kinetic {836045448940873}) <999.0>",
         "[00:00:09.301] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999) <0.0>",
         "[00:00:22.001] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,0,200,1,9000,1)
 }
 
 V565TestNoSurvivalEvidence()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Peer#2|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:22.001] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,0,200,1,9000,1)
 }
 
 V565TestOutsidePlayerIsNotWitness()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Outside#9|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:22.001] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,0,200,1,9000,1)
 }
 
 V565TestCompanionIsNotWitness()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Recorder#1/Companion {999}:99|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:22.001] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,0,200,1,9000,1)
 }
 
 V565TestReviveAfterResolution()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Recorder#1|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Peer#2|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Healer#3|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.200] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945494}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:22.001] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,0,200,1,9000,1)
 }
 
 V565TestReviveMarkerWithoutDeath()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.200] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945494}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:22.001] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,0,200,1,9000,1)
 }
 
 V565TestReorderedResolutionDeath()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Recorder#1|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Healer#3|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Peer#2|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:22.001] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,0,200,1,9000,1)
 }
 
 V565TestDeathAtWitnessTimestamp()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Recorder#1|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Healer#3|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:09.300] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Peer#2|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:22.001] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,0,200,1,9000,1)
 }
 
 V565TestOtherPlayerDeathDoesNotWipe()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Recorder#1|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestDuplicateCastDoesNotRearm()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestDuplicateResolution()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestReversedSameMillisecondPair()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestMissingCast()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestMissingFlame()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestMissingTargetClear()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestMissingRemoval()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestMissingFailure()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestUnrelatedFailedEffect()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {123456}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestOtherBossInstanceFailure()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:124|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestInterruptedDyingLight()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945482}]",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestFullHealthResetInvalidates()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(1000/1000)] [=] [Ability {123}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestCastStartNotCompletion()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:10.000] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestLivingExitDuringCast()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:04.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945490}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestReentryDuringCast()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:03.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Recorder#1|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:03.100] [@Recorder#1|(1,2,3,0)|(0/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945490}]",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:06.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestEOFAtResolutionIsUnconfirmed()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]"]
     V565Check(lines,1,0,200,1,9000,1)
 }
 
 V565TestNextEnemyDoesNotMerge()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:10.000] [@Peer#2|(1,2,3,0)|(500/1000)] [Trash {77777}:456|(1,2,3,0)|(900/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (999 kinetic {836045448940873}) <999.0>"]
     V565Check(lines,1,0,200,2,9000,1)
 }
 
 V565TestHealingDoesNotExtend()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:09.301] [@Healer#3|(1,2,3,0)|(500/1000)] [@Peer#2|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (500 ~500) <0.0>",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestLateOldBossHitDoesNotExtend()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:09.500] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (333 kinetic {836045448940873}) <333.0>",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestDelayedFreshSurvivor()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:18.000] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:20.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestStaleSurvivorIsUnconfirmed()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:20.000] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:22.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,0,200,1,9000,1)
 }
 
 V565TestAreaBoundaryClosesPending()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:09.400] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestReorderedFutureHealExcluded()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.301] [@Healer#3|(1,2,3,0)|(500/1000)] [@Peer#2|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (500 ~500) <0.0>",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.400] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestCommittedFutureDamageDisclosed()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (333 kinetic {836045448940873}) <333.0>",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,1)
 }
 
 V565TestRevivedBeforeResolutionCanSurvive()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:03.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [@Peer#2|(1,2,3,0)|(0/1000)] [Ability {99}] [Action {836045448945472}: Effect {836045448945493}]",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.000] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945494}]",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 
 V565TestAcrossMidnight()
 {
     lines := [
         "[23:59:55.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[23:59:55.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[23:59:56.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[23:59:56.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[23:59:56.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[23:59:59.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:01.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:02.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:03.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:04.300] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,86404000,0)
 }
 
 V565TestWrongDifficulty()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953651}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestWrongArea()
 {
     lines := [
         "[00:00:00.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {123456} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Recorder#1|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Recorder#1|(1,2,3,0)|(500/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Ability {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Ability {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Ability {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Recorder#1|(1,2,3,0)|(500/1000)] [=] [Ability {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Ability {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,0,0,0,1,9000,-1)
 }
 
 V565TestLocalizedLabels()
 {
     lines := [
         "[00:00:00.000] [@Andere#1|(1,2,3,0)|(500/1000)] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
         "[00:00:00.100] [@Andere#1|(1,2,3,0)|(500/1000)] [=] [Lokalisierte Fähigkeit {99}] [Action {836045448945472}: Effect {836045448945489}]",
         "[00:00:01.000] [@Andere#1|(1,2,3,0)|(500/1000)] [Bossübersetzung {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Lokalisierte Fähigkeit {99}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100.0>",
         "[00:00:01.100] [@Peer#2|(1,2,3,0)|(500/1000)] [Bossübersetzung {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Lokalisierte Fähigkeit {99}] [Action {836045448945477}: Effect {836045448945501}] (75 kinetic {836045448940873}) <75.0>",
         "[00:00:01.200] [@Healer#3|(1,2,3,0)|(500/1000)] [@Andere#1|(1,2,3,0)|(500/1000)] [Lokalisierte Fähigkeit {99}] [Action {836045448945477}: Effect {836045448945500}] (40 ~40) <0.0>",
         "[00:00:04.000] [Bossübersetzung {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Lokalisierte Fähigkeit {4381085685252096}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:06.000] [Bossübersetzung {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Lokalisierte Fähigkeit {4381085685252096}] [Action {836045448945477}: Effect {4381085685252434}]",
         "[00:00:07.000] [@Peer#2|(1,2,3,0)|(500/1000)] [Bossübersetzung {4381150109761536}:123|(1,2,3,0)|(100/1000)] [Lokalisierte Fähigkeit {99}] [Action {836045448945477}: Effect {836045448945501}] (25 kinetic {836045448940873}) <25.0>",
         "[00:00:08.990] [Bossübersetzung {4381150109761536}:123|(1,2,3,0)|(100/1000)] [] [Lokalisierte Fähigkeit {99}] [Action {836045448945472}: Effect {836045448953669}]",
         "[00:00:09.000] [Bossübersetzung {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Lokalisierte Fähigkeit {4381085685252096}] [Action {836045448945478}: Effect {4381085685252434}]",
         "[00:00:09.000] [Bossübersetzung {4381150109761536}:123|(1,2,3,0)|(100/1000)] [=] [Lokalisierte Fähigkeit {4381085685252096}] [Action {836045448945472}: Effect {836045448945499}]",
         "[00:00:09.300] [@Andere#1|(1,2,3,0)|(500/1000)] [=] [Lokalisierte Fähigkeit {99}] [Action {836045448945472}: Effect {836045448945479}]",
         "[00:00:11.501] [@Peer#2|(1,2,3,0)|(500/1000)] [=] [Lokalisierte Fähigkeit {123}] [Action {836045448945477}: Effect {123}]"]
     V565Check(lines,1,1,200,1,9000,0)
 }
 ; v57 regression requirements. Stored as inactive comment data in the main file.
 V57Check(lines, want, chunkSize := 0)
 {
     s := IPNewData("v57 declared synthetic reference")
     if chunkSize > 0 {
         content := "", pending := ""
         for i, line in lines
             content .= (i=1 ? "" : "`r`n") line
         offset := 1
         while offset <= StrLen(content) {
             pending .= SubStr(content,offset,chunkSize), offset += chunkSize
             while pos := InStr(pending,"`n") {
                 IPFeedLine(s,RTrim(SubStr(pending,1,pos-1),"`r"))
                 pending := SubStr(pending,pos+1)
             }
         }
         if pending != ""
             IPFeedLine(s,RTrim(pending,"`r"))
     }
     else {
         for line in lines
             IPFeedLine(s,line)
     }
     IPCloseSegment(s,"end of synthetic snapshot")
     V48Assert(!s.Halted && s.Malformed=0 && s.BadValues=0 && s.ClockBack=0,"v57: no parser rejection")
     V48Assert(s.Segments.Length=want["segments"],"v57: encounter count")
     seg := s.Segments[1], t := seg.Totals.Get("@Tester#57",IPNewTotals())
     if want.Has("start")
         V48Assert(seg.Start=want["start"],"v57: start record")
     if want.Has("end")
         V48Assert(seg.Last=want["end"] && seg.End=want["end"],"v57: reported endpoint")
     if want.Has("terminal")
         V48Assert(seg.Terminal=want["terminal"],"v57: completion state")
     if want.Has("partial")
         V48Assert(seg.Partial=want["partial"],"v57: incomplete evidence remains disclosed")
     if want.Has("profile")
         V48Assert(IsObject(seg.Profile) && seg.Profile.Key=want["profile"],"v57: scoped profile")
     for field, prop in Map("damage","Damage","taken","Taken","raw_taken","RawTaken","overkill","Overkill",
         "excluded_taken","ExcludedTaken","deaths","Deaths","heal","Heal") {
         if want.Has(field)
             V48Assert(t.%prop%=want[field],"v57: " field)
     }
     if want.Has("threat") {
         actual := seg.HasOwnProp("Raid") && seg.Raid.Threat.Has("@Tester#57") ? seg.Raid.Threat["@Tester#57"].Total : 0
         V48Assert(actual=want["threat"],"v57: per-metric signed threat")
     }
     if want.Has("other_damage")
         V48Assert(seg.Totals.Get("@Peer#57",IPNewTotals()).Damage=want["other_damage"],"v57: mechanic is not outgoing peer DPS")
     if want.Has("second_damage")
         V48Assert(s.Segments[2].Totals.Get("@Tester#57",IPNewTotals()).Damage=want["second_damage"],"v57: no retired actor leakage")
     if want.Has("row_min") {
         found := 0
         for key, r in seg.Rows {
             if r.Actor="@Tester#57" && r.Kind="Taken" {
                 V48Assert(r.Min=want["row_min"] && r.Max=want["row_max"],"v57: corrected burst row extrema")
                 found += 1
             }
         }
         V48Assert(found=1,"v57: expected incoming row")
     }
     V57CheckRows(s)
 }
 
 V57CheckRows(s)
 {
     rows := 0
     for seg in s.Segments {
         sums := Map()
         for key, r in seg.Rows {
             k := r.Actor Chr(30) r.Kind
             sums[k] := sums.Get(k,0)+r.Total
             V48Assert(r.N>=r.Critical && r.Min<=r.Max,"v57: breakdown metadata remains consistent")
         }
         for actor,t in seg.Totals {
             for pair in [["Damage",t.Damage],["Taken",t.Taken],["Heal",t.Heal],["Received",t.Received]]
                 V48Assert(sums.Get(actor Chr(30) pair[1],0)=pair[2],"v57: row/total reconciliation")
             V48Assert(t.RawTaken=t.Taken+t.Overkill+t.ExcludedTaken,"v57: incoming original amount is conserved")
         }
         rows += seg.Rows.Count
     }
     V48Assert(rows=s.Rows,"v57: global row count")
 }
 
 V57TestProfileScope()
 {
     for key,p in IPXProfiles() {
         good := {AreaId:p.Area,ModeId:p.Mode}
         wrongArea := {AreaId:"unrelated",ModeId:p.Mode}
         wrongMode := {AreaId:p.Area,ModeId:"unrelated"}
         V48Assert(IsObject(IPXScopedProfile(good,key)),"profile scope supported")
         V48Assert(!IsObject(IPXScopedProfile(wrongArea,key)) && !IsObject(IPXScopedProfile(wrongMode,key)),"profile cannot redefine unknown mode or PvP")
         for id, group in p.Actors {
             a := IPActor("Localized NPC {" id "}:99")
             r := IPXActorRule(a,good)
             V48Assert(IsObject(r) && r.Key=key && r.Group=group,"numeric actor identity")
         }
     }
 }
 
 V57TestMalformedBracketStillRejected()
 {
     line := IPDemoLine(1000,V56Who(),V56Boss(),"Damage",100,false,-1,"[HIDDEN]Hands Cleared")
     ev := IPParseLine(line)
     V48Assert(IsObject(ev) && ev.Ability="[HIDDEN]Hands Cleared","nested bracket label parses")
     bad := StrReplace(line,"[HIDDEN]","[HIDDEN")
     V48Assert(!IsObject(IPParseLine(bad)),"malformed bracket input is not concealed")
 }
 
 V57TestProfile_ECZT()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775688} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857544821243904}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857549116211200}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:12|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857544821243904}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857549116211200}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:04.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:09.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",9000, "damage",37, "segments",1, "profile","EC-ZT", "terminal",true))
 }
 
 V57TestProfile_ECZTReverse()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775688} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857549116211200}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857544821243904}:12|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857549116211200}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:04.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857544821243904}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:09.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857544821243904}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",1200, "damage",30, "segments",1, "profile","EC-ZT", "terminal",true))
 }
 
 V57TestProfile_ECTK()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775688} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876434087411712}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876438382379008}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876434087411712}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876438382379008}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:08.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876438382379008}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",8000, "damage",27, "segments",1, "profile","EC-TK", "terminal",true))
 }
 
 V57TestProfile_ECTKReverse()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775688} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876438382379008}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876434087411712}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876438382379008}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876434087411712}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:08.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876434087411712}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",8000, "damage",27, "segments",1, "profile","EC-TK", "terminal",true))
 }
 
 V57TestProfile_ECVO()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775688} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2854117437341696}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2854117437341696}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2854117437341696}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","EC-VO", "terminal",true))
 }
 
 V57TestProfile_ECKE()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775688} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876528576692224}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876528576692224}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2876528576692224}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","EC-KE", "terminal",true))
 }
 
 V57TestProfile_DFNE()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","DF-NE", "terminal",true))
 }
 
 V57TestProfile_DFDR()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303392491339776}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303392491339776}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303392491339776}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","DF-DR", "terminal",true))
 }
 
 V57TestProfile_DFGR()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3302559267684352}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3302559267684352}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3302559267684352}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","DF-GR", "terminal",true))
 }
 
 V57TestProfile_DFCZ()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303534225260544}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303534225260544}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303534225260544}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","DF-CZ", "terminal",true))
 }
 
 V57TestProfile_DFBR()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303529930293248}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303529930293248}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303529930293248}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","DF-BR", "terminal",true))
 }
 
 V57TestProfile_TFBWH()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438992720} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3010424182145024}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3010424182145024}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3010424182145024}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","TFB-WH", "terminal",true))
 }
 
 V57TestProfile_TFBDG()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438992720} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013327580037120}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013336169971712}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013331875004416}:12|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013327580037120}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013336169971712}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:04.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013331875004416}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:09.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013331875004416}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",9000, "damage",37, "segments",1, "profile","TFB-DG", "terminal",true))
 }
 
 V57TestProfile_TFBDGReverse()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438992720} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013331875004416}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013336169971712}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013327580037120}:12|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013331875004416}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013336169971712}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:04.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013327580037120}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:09.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013327580037120}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",9000, "damage",37, "segments",1, "profile","TFB-DG", "terminal",true))
 }
 
 V57TestProfile_TFBOP()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438992720} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2994837745827840}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2994837745827840}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2994837745827840}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","TFB-OP", "terminal",true))
 }
 
 V57TestProfile_TFBKE()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438992720} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013121421606912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013121421606912}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3013121421606912}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","TFB-KE", "terminal",true))
 }
 
 V57TestProfile_DXRE()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330233272467456}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330233272467456}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330233272467456}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","DX-RE", "terminal",true))
 }
 
 V57TestProfile_DXHV()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330237567434752}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330237567434752}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330237567434752}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","DX-HV", "terminal",true))
 }
 
 V57TestProfile_DXAP()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4350020186800128}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4350020186800128}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4350020186800128}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","DX-AP", "terminal",true))
 }
 
 V57TestProfile_XR53()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {945872057669657} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4847325860069376}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4847325860069376}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4847325860069376}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","XR-53", "terminal",true))
 }
 
 V57TestProfile_SNVDA()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993037} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3153558262251520}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3153558262251520}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3153558262251520}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","SNV-DA", "terminal",true))
 }
 
 V57TestProfile_SNVTI()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993037} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3152458750623744}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3152458750623744}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3152458750623744}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","SNV-TI", "terminal",true))
 }
 
 V57TestProfile_SNVTH()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993037} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3154563284598784}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3154563284598784}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3154563284598784}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","SNV-TH", "terminal",true))
 }
 
 V57TestProfile_SNVOC()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993037} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3157548286869504}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3157548286869504}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3157548286869504}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","SNV-OC", "terminal",true))
 }
 
 V57TestProfile_SNVOL()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993037} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3154662068846592}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3154662068846592}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3154662068846592}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","SNV-OL", "terminal",true))
 }
 
 V57TestProfile_SNVCW()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993037} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054400352288768}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054404647256064}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054408942223360}:12|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.300] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3156895451840512}:13|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054400352288768}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054404647256064}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:04.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054408942223360}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:05.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3156895451840512}:13|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:10.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3156895451840512}:13|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",10000, "damage",47, "segments",1, "profile","SNV-CW", "terminal",true))
 }
 
 V57TestProfile_SNVCWReverse()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993037} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3156895451840512}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054408942223360}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054404647256064}:12|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.300] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054400352288768}:13|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3156895451840512}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054408942223360}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:04.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054404647256064}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:05.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054400352288768}:13|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:10.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3054400352288768}:13|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",10000, "damage",47, "segments",1, "profile","SNV-CW", "terminal",true))
 }
 
 V57TestProfile_SNVST()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993037} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3152407211016192}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3152407211016192}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3152407211016192}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",10, "segments",1, "profile","SNV-ST", "terminal",true))
 }
 
 V57TestProfile_KPBO()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775669} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2271801476382720}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2271801476382720}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2271801476382720}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","KP-BO", "terminal",true))
 }
 
 V57TestProfile_KPFC()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775669} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739875602235392}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739875602235392}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739875602235392}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","KP-FC", "terminal",true))
 }
 
 V57TestProfile_KPFA()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775669} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2747344550363136}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2747344550363136}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2747344550363136}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","KP-FA", "terminal",true))
 }
 
 V57TestProfile_KPKA()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775669} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2740043105959936}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2740043105959936}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2740043105959936}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","KP-KA", "terminal",true))
 }
 
 V57TestProfile_EVXR()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775670} Mode {836045448953653}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2017165750304768}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2017165750304768}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2017165750304768}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","EV-XR", "terminal",true))
 }
 
 V57TestProfile_EVGH()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775670} Mode {836045448953653}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2016946706972672}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2016946706972672}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2016946706972672}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","EV-GH", "terminal",true))
 }
 
 V57TestProfile_EVSO()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775670} Mode {836045448953653}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2017170045272064}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2017170045272064}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2017170045272064}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","EV-SO", "terminal",true))
 }
 
 V57TestProfile_RAVSP()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367421863788544} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3367555007774720}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3367555007774720}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3367555007774720}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","RAV-SP", "terminal",true))
 }
 
 V57TestProfile_KPJS()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775669} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739437515571200}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739441810538496}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739437515571200}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739441810538496}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:08.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739441810538496}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",8000, "damage",27, "segments",1, "profile","KP-JS", "terminal",true))
 }
 
 V57TestProfile_KPJSReverse()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775669} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739441810538496}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739437515571200}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739441810538496}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739437515571200}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:08.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2739437515571200}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",8000, "damage",27, "segments",1, "profile","KP-JS", "terminal",true))
 }
 
 V57TestProfile_RAVTO()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367421863788544} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3397005598523392}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3397005598523392}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3397005598523392}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","RAV-TO", "terminal",true))
 }
 
 V57TestProfile_RAVMB()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367421863788544} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3391095723524096}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3391095723524096}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3391095723524096}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",10, "segments",1, "profile","RAV-MB", "terminal",true))
 }
 
 V57TestProfile_TOSMA()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367426158755840} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3469277013213184}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3469277013213184}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3469277013213184}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","TOS-MA", "terminal",true))
 }
 
 V57TestProfile_TOSUL()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367426158755840} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3462263331618816}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3462263331618816}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3462263331618816}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","TOS-UL", "terminal",true))
 }
 
 V57TestProfile_MONO()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3541801830973440} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3570947479044096}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3570947479044096}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3570947479044096}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","MONO", "terminal",true))
 }
 
 V57TestProfile_XENO()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993300} Mode {836045448953654}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3213928322564096}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3213928322564096}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3213928322564096}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","XENO", "terminal",true))
 }
 
 V57TestProfile_TOSSS()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367426158755840} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3468765912104960}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3447789291831296}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3468765912104960}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3447789291831296}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:08.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3447789291831296}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",8000, "damage",27, "segments",1, "profile","TOS-SS", "terminal",true))
 }
 
 V57TestProfile_TOSSSReverse()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367426158755840} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3447789291831296}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3468765912104960}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3447789291831296}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3468765912104960}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:08.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3468765912104960}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",8000, "damage",27, "segments",1, "profile","TOS-SS", "terminal",true))
 }
 
 V57TestProfile_TOSRE()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367426158755840} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3447583133401088}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3447583133401088}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3447583133401088}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","TOS-RE", "terminal",true))
 }
 
 V57TestProfile_QUEEN()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {945872057669593} Mode {836045448953654}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4204772982784000}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4204772982784000}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4204772982784000}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","QUEEN", "terminal",true))
 }
 
 V57TestProfile_GTY()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775765} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4078419339902976}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4078419339902976}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4078419339902976}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","G-TY", "terminal",true))
 }
 
 V57TestProfile_GAE()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775765} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4088525397950464}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4088538282852352}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4088525397950464}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4088538282852352}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:08.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4088538282852352}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",8000, "damage",27, "segments",1, "profile","G-AE", "terminal",true))
 }
 
 V57TestProfile_GAEReverse()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775765} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4088538282852352}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4088525397950464}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4088538282852352}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4088525397950464}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:08.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4088525397950464}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",8000, "damage",27, "segments",1, "profile","G-AE", "terminal",true))
 }
 
 V57TestProfile_GNA()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775765} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4122949560827904}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4122949560827904}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4122949560827904}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","G-NA", "terminal",true))
 }
 
 V57TestProfile_R4IP()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775799} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4467247024177152}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4467247024177152}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4467247024177152}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","R4-IP", "terminal",true))
 }
 
 V57TestProfile_R4WD()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775799} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4466177577320448}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4466177577320448}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4466177577320448}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","R4-WD", "terminal",true))
 }
 
 V57TestProfile_R4KN()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775799} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4466190462222336}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4466190462222336}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4466190462222336}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","R4-KN", "terminal",true))
 }
 
 V57TestProfile_R4LD()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775799} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4466199052156928}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4466199052156928}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4466199052156928}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","R4-LD", "terminal",true))
 }
 
 V57TestProfile_RAVBU()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367421863788544} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371446248144896}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371446248144896}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371446248144896}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",7000, "damage",17, "segments",1, "profile","RAV-BU", "terminal",true))
 }
 
 V57TestBrontesNewSphereBeforeFinalHit()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303529930293248}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [NPC {3303529930293248}:10|(0,0,0,0)|(0/1000)] [NPC {3303529930293248}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.200] [NPC {3303718908854272}:91|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (20 kinetic {836045448940873})",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303529930293248}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (50 kinetic {836045448940873})",
         "[00:00:09.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303718908854272}:91|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (999 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2500, "damage",150, "segments",1, "profile","DF-BR", "terminal",true, "taken",20))
 }
 
 V57TestPhaseCoreCannotExtendOperator()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438992720} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2994867810598912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2994867810598912}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2994837745827840}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2994837745827840}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:06.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2994867810598912}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (999 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",1200, "damage",110, "segments",1, "profile","TFB-OP", "terminal",true))
 }
 
 V57TestNextCombatAndRetiredBoss()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3302559267684352}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3302559267684352}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3302559267684352}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (5 kinetic {836045448940873})",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:03.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {123456}:99|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (20 kinetic {836045448940873})",
         "[00:00:03.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3302559267684352}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (999 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2500, "damage",105, "segments",2, "terminal",true, "second_damage",20))
 }
 
 V57TestInternalTransition_ECZT()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775688} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857544821243904}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:01.700] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.800] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (50 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",1800, "damage",150, "segments",1, "profile","EC-ZT"))
 }
 
 V57TestInternalTransition_SNVOL()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993037} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3061057551597568}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:01.700] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.800] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3154662068846592}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (50 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",1800, "damage",150, "segments",1, "profile","SNV-OL"))
 }
 
 V57TestReportingMarker_DXE1()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4245686841245696}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:02.800] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4340614208421888}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.900] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999)"]
     V57Check(lines,Map("start",100, "end",2800, "damage",10, "segments",1, "profile","DX-E1", "terminal",true, "heal",0))
 }
 
 V57TestReportingMarker_DXE2()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4390577562976256}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:02.800] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330061473775616}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.900] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999)"]
     V57Check(lines,Map("start",100, "end",2800, "damage",10, "segments",1, "profile","DX-E2", "terminal",true, "heal",0))
 }
 
 V57TestReportingMarker_DPBE()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273941900591104}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273941900591104}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:02.700] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3313339635597312}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (999 kinetic {836045448940873}) <999>",
         "[00:00:02.800] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3313339635597312}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.900] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999)"]
     V57Check(lines,Map("start",100, "end",2800, "damage",10, "segments",1, "profile","DP-BE", "terminal",true, "heal",0))
 }
 
 V57TestReportingMarker_DPTY()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273954785492992}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273954785492992}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:02.700] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3312845714358272}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (999 kinetic {836045448940873}) <999>",
         "[00:00:02.800] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3312845714358272}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.900] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999)"]
     V57Check(lines,Map("start",100, "end",2800, "damage",10, "segments",1, "profile","DP-TY", "terminal",true, "heal",0))
 }
 
 V57TestReportingMarker_DPCA()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273946195558400}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273946195558400}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:02.700] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3312987448279040}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (999 kinetic {836045448940873}) <999>",
         "[00:00:02.800] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3312987448279040}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.900] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999)"]
     V57Check(lines,Map("start",100, "end",2800, "damage",10, "segments",1, "profile","DP-CA", "terminal",true, "heal",0))
 }
 
 V57TestReportingMarker_DPRA()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3302902865068032}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3302902865068032}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:02.700] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3313283801022464}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (999 kinetic {836045448940873}) <999>",
         "[00:00:02.800] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3313283801022464}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.900] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999)"]
     V57Check(lines,Map("start",100, "end",2800, "damage",10, "segments",1, "profile","DP-RA", "terminal",true, "heal",0))
 }
 
 V57TestReportingMarker_DPCO()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273984850264064}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273989145231360}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273993440198656}:12|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.300] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273997735165952}:13|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273984850264064}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273989145231360}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273993440198656}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.300] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273997735165952}:13|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:02.700] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303422556110848}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (999 kinetic {836045448940873}) <999>",
         "[00:00:02.800] [NPC {3303422556110848}:88|(0,0,0,0)|(0/1000)] [NPC {3303422556110848}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945479}] ()",
         "[00:00:02.900] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999)"]
     V57Check(lines,Map("start",100, "end",2800, "damage",40, "segments",1, "profile","DP-CO", "terminal",true, "heal",0))
 }
 
 V57TestReportingMarker_TOSCO()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367426158755840} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3456890327531520}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3456894622498816}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3456898917466112}:12|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3456890327531520}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3456894622498816}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3456898917466112}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:02.800] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3483025203527680}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.900] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999)"]
     V57Check(lines,Map("start",100, "end",2800, "damage",30, "segments",1, "profile","TOS-CO", "terminal",true, "heal",0))
 }
 
 V57TestTerrorScriptedEnd()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438992720} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3025233229381632}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [NPC {3025233229381632}:10|(0,0,0,0)|(40/1000)] [] [Example {3019211685232640}] [Action {836045448945472}: Effect {836045448945479}] ()",
         "[00:00:02.001] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999)"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "terminal",true, "heal",0))
 }
 
 V57TestWrongTerrorAbility()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438992720} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3025233229381632}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [NPC {3025233229381632}:10|(0,0,0,0)|(40/1000)] [] [Example {999}] [Action {836045448945472}: Effect {836045448945479}] ()",
         "[00:00:02.001] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999)"]
     V57Check(lines,Map("start",100, "end",2001, "damage",100, "segments",1, "terminal",false, "heal",999))
 }
 
 V57TestWrongTerrorHealth()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438992720} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3025233229381632}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [NPC {3025233229381632}:10|(0,0,0,0)|(400/1000)] [] [Example {3019211685232640}] [Action {836045448945472}: Effect {836045448945479}] ()",
         "[00:00:02.001] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (999 ~999)"]
     V57Check(lines,Map("start",100, "end",2001, "damage",100, "segments",1, "terminal",false, "heal",999))
 }
 
 V57TestQueenImmuneFinalResult()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {945872057669593} Mode {836045448953654}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4204772982784000}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4204772982784000}:10|(0,0,0,0)|(1/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4204772982784000}:10|(0,0,0,0)|(1/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 ~0 kinetic {836045448940873} -immune {836045448945506})"]
     V57Check(lines,Map("start",100, "end",3000, "damage",107, "segments",1, "terminal",true))
 }
 
 V57TestXRDamageThreatIncomingSeparate()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {945872057669657} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4847325860069376}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873}) <100>",
         "[00:00:01.100] [@Peer#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {4825043569738028}] [Action {836045448945477}: Effect {836045448945501}] (50 kinetic {836045448940873}) <123>",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4847325860069376}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873}) <1>"]
     V57Check(lines,Map("start",100, "end",1200, "damage",101, "segments",1, "taken",50, "threat",101, "other_damage",0))
 }
 
 V57TestHazardEvidenceNotIncomingSummary()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4245686841245696}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {4250600283832602}] [Action {836045448945477}: Effect {836045448945501}] (50 kinetic {836045448940873}) <123>",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4245686841245696}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",1200, "damage",101, "segments",1, "taken",0, "raw_taken",50, "excluded_taken",50, "threat",0))
 }
 
 V57TestRaptusChallengeHealingSeparate()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3302902865068032}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3289335063379968}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (50 ~50) <123>",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3302902865068032}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",1200, "damage",101, "segments",1, "heal",0, "threat",0))
 }
 
 V57TestLethalZeroHP()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "taken",40, "raw_taken",100, "overkill",60, "deaths",1))
 }
 
 V57TestLethalStalePositiveHP()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(87/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(87/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "taken",40, "raw_taken",100, "overkill",60, "deaths",1))
 }
 
 V57TestLethalOneMillisecond()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:01.501] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "taken",40, "raw_taken",100, "overkill",60, "deaths",1))
 }
 
 V57TestLethalTwoMilliseconds()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:01.502] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "taken",40, "raw_taken",100, "overkill",60, "deaths",1))
 }
 
 V57TestLethalMultiResultBurst()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:01.501] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (70 ~10 kinetic {836045448940873})",
         "[00:00:01.502] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "taken",50, "raw_taken",170, "overkill",120, "deaths",1, "row_min",10, "row_max",40))
 }
 
 V57TestNonlethalAbsorptionPreserved()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.200] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (55 ~0 kinetic {836045448940873} (55 absorbed {836045448945511}))",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:01.501] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "taken",95, "raw_taken",155, "overkill",60, "deaths",1))
 }
 
 V57TestNoDeath()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:02.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "taken",100, "overkill",0))
 }
 
 V57TestUnrelatedKiller()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:01.501] [NPC {777}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "taken",100, "overkill",0))
 }
 
 V57TestDistantDeath()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:02.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",3000, "damage",100, "segments",1, "taken",100, "overkill",0))
 }
 
 V57TestPostDeathZeroResultNotClipped()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~0 kinetic {836045448940873})",
         "[00:00:02.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "taken",140, "raw_taken",200, "overkill",60, "deaths",1))
 }
 
 V57TestActualRevivalRearmsLethalSequence()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:01.700] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945479}] ()",
         "[00:00:01.800] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (50 ~10 kinetic {836045448940873})",
         "[00:00:01.801] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "taken",50, "raw_taken",150, "overkill",100, "deaths",2))
 }
 
 V57TestSpeculativeLethalCorrectionRollsBack()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:01.600] [@Tester#57|(0,0,0,0)|(0/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "taken",0, "raw_taken",0, "overkill",0, "deaths",0))
 }
 
 V57TestIdenticalLookingDamageNotDeduplicated()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (17 kinetic {836045448940873})",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (17 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",1000, "damage",34, "segments",1))
 }
 
 V57TestNestedBracketLabels()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303529930293248}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.100] [NPC {3303529930293248}:10|(0,0,0,0)|(900/1000)] [] [[HIDDEN]Hands Cleared {123}] [Action {836045448945472}: Effect {12345}] ()",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303529930293248}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",1200, "damage",101, "segments",1))
 }
 
 V57TestLocalizedNPCLabels()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775688} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [Uebersetzter Gegner {2857544821243904}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [Uebersetzter Gegner {2857549116211200}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [Uebersetzter Gegner {2855809654456320}:12|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [Uebersetzter Gegner {2857544821243904}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:03.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [Uebersetzter Gegner {2857549116211200}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:04.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [Uebersetzter Gegner {2855809654456320}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:09.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [Uebersetzter Gegner {2855809654456320}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",9000, "damage",37, "segments",1, "profile","EC-ZT", "terminal",true))
 }
 
 V57TestAcrossMidnightProfile()
 {
     lines := [
         "[23:59:58.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775688} Mode {836045448953655}]",
         "[23:59:58.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[23:59:59.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857544821243904}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[23:59:59.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857549116211200}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[23:59:59.700] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:12|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:00.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857544821243904}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:01.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857549116211200}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     V57Check(lines,Map("start",86398600, "end",86407500, "damage",37, "segments",1, "profile","EC-ZT", "terminal",true))
 }
 
 V57TestRuugarArmExitReward()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367421863788544} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [] [Example {3502391211065344}] [Action {836045448945472}: Effect {836045448945479}] ()",
         "[00:00:02.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (50 ~0 kinetic {836045448940873} (50 absorbed {836045448945511}))",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3443983950807040}:99|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.650] [@Tester#57|(0,0,0,0)|(1000/1000)] [@Tester#57|(0,0,0,0)|(1000/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945500}] (99 ~99)"]
     V57Check(lines,Map("start",100, "end",2600, "damage",150, "segments",1, "terminal",true, "partial",false, "heal",0))
 }
 
 V57TestRuugarInternalRewardEntry()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367421863788544} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [] [Example {3502391211065344}] [Action {836045448945472}: Effect {836045448945479}] ()",
         "[00:00:02.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (50 ~0 kinetic {836045448940873} (50 absorbed {836045448945511}))",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:02.700] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.710] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3443983950807040}:99|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",2710, "damage",150, "segments",1, "terminal",true, "partial",false))
 }
 
 V57TestRuugarWrongArm()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367421863788544} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [] [Example {88888}] [Action {836045448945472}: Effect {836045448945479}] ()",
         "[00:00:02.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (50 ~0 kinetic {836045448940873} (50 absorbed {836045448945511}))",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3443983950807040}:99|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "terminal",false, "partial",true))
 }
 
 V57TestRuugarNoArm()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367421863788544} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (50 ~0 kinetic {836045448940873} (50 absorbed {836045448945511}))",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3443983950807040}:99|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "terminal",false, "partial",true))
 }
 
 V57TestRuugarWrongChest()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367421863788544} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [] [Example {3502391211065344}] [Action {836045448945472}: Effect {836045448945479}] ()",
         "[00:00:02.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (50 ~0 kinetic {836045448940873} (50 absorbed {836045448945511}))",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {55555}:99|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "terminal",false, "partial",true))
 }
 
 V57TestRuugarStaleLoot()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367421863788544} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [] [Example {3502391211065344}] [Action {836045448945472}: Effect {836045448945479}] ()",
         "[00:00:02.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (50 ~0 kinetic {836045448940873} (50 absorbed {836045448945511}))",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:06.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3443983950807040}:99|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "terminal",false, "partial",true))
 }
 
 V57TestRuugarCastAloneNotCompletion()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {3367421863788544} Mode {836045448953651}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [] [Example {3502391211065344}] [Action {836045448945472}: Effect {836045448945479}] ()",
         "[00:00:02.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3371441953177600}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (50 ~0 kinetic {836045448940873} (50 absorbed {836045448945511}))"]
     V57Check(lines,Map("start",100, "end",2200, "damage",150, "segments",1, "terminal",false, "partial",true))
 }
 
 V57TestHuntmasterZeroHPWithoutPriorAlive()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4265104388390912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330237567434752}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {12345}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4265104388390912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (999 kinetic {836045448940873})"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "terminal",true, "partial",true, "profile","DX-HMM"))
 }
 
 V57TestHuntmasterPositiveHPNotEnding()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4265104388390912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330237567434752}:11|(0,0,0,0)|(10/1000)] [Example {123}] [Action {836045448945472}: Effect {12345}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "terminal",false, "partial",true))
 }
 
 V57TestHuntmasterNoPriorEncounterEvidence()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330237567434752}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330237567434752}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {12345}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "terminal",false, "partial",true))
 }
 
 V57TestHuntmasterOtherModeNotPromoted()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953652}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4265104388390912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4330237567434752}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {12345}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "terminal",false, "profile","DX-HV"))
 }
 
 V57TestCouncilRequiresAllFinalActors()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273984850264064}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [NPC {3303422556110848}:99|(0,0,0,0)|(0/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945479}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "terminal",false, "partial",true))
 }
 
 V57TestObjectiveRequiresExitSequence()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4245686841245696}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4340614208421888}:99|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "terminal",false, "partial",true))
 }
 
 V57TestCompletionBatchBoundary_DPBE()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273941900591104}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273941900591104}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:04.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3313339635597312}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",4000, "damage",100, "segments",1, "terminal",true, "partial",false))
 }
 
 V57TestRejectDelayedManualLoot_DPBE()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273941900591104}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273941900591104}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3313339635597312}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "terminal",true, "partial",true))
 }
 
 V57TestCompletionBatchBoundary_DXE1()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4245686841245696}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:04.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4340614208421888}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",4500, "damage",100, "segments",1, "terminal",true, "partial",false))
 }
 
 V57TestRejectDelayedManualLoot_DXE1()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775792} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4245686841245696}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:07.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {4340614208421888}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "terminal",false, "partial",true))
 }
 
 V57TestRewardLaterExitBatch()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273941900591104}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273941900591104}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.010] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.470] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:04.080] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:04.086] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3313339635597312}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",4086, "damage",100, "segments",1, "terminal",true, "partial",false))
 }
 
 V57TestRewardLateMarkerNeedsExitBatch()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273941900591104}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:02.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3273941900591104}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.010] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945490}] ()",
         "[00:00:02.470] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:04.086] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3313339635597312}:88|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()"]
     V57Check(lines,Map("start",100, "end",1000, "damage",100, "segments",1, "terminal",true, "partial",true))
 }
 
 V57TestChunkedLethalMultiResultBurst()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.500] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 ~40 kinetic {836045448940873})",
         "[00:00:01.501] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (70 ~10 kinetic {836045448940873})",
         "[00:00:01.502] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [@Tester#57|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.000] [@Peer#57|(0,0,0,0)|(1000/1000)] [NPC {3303031714086912}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     for n in [1,7,257]
         V57Check(lines,Map("start",100, "end",2000, "damage",100, "segments",1, "taken",50, "raw_taken",170, "overkill",120, "deaths",1, "row_min",10, "row_max",40),n)
 }
 
 V57TestChunkedAcrossMidnightProfile()
 {
     lines := [
         "[23:59:58.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775688} Mode {836045448953655}]",
         "[23:59:58.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[23:59:59.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857544821243904}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[23:59:59.600] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857549116211200}:11|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[23:59:59.700] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:12|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (10 kinetic {836045448940873})",
         "[00:00:00.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857544821243904}:10|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:01.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2857549116211200}:11|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:02.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945472}: Effect {836045448945493}] ()",
         "[00:00:07.500] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {2855809654456320}:12|(0,0,0,0)|(0/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (7 kinetic {836045448940873})"]
     for n in [1,7,257]
         V57Check(lines,Map("start",86398600, "end",86407500, "damage",37, "segments",1, "profile","EC-ZT", "terminal",true),n)
 }
 
 V57TestChunkedNestedBracketLabels()
 {
     lines := [
         "[00:00:00.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {137438993402} Mode {836045448953655}]",
         "[00:00:00.100] [@Tester#57|(0,0,0,0)|(1000/1000)] [] [Example {123}] [Action {836045448945472}: Effect {836045448945489}] ()",
         "[00:00:01.000] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303529930293248}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (100 kinetic {836045448940873})",
         "[00:00:01.100] [NPC {3303529930293248}:10|(0,0,0,0)|(900/1000)] [] [[HIDDEN]Hands Cleared {123}] [Action {836045448945472}: Effect {12345}] ()",
         "[00:00:01.200] [@Tester#57|(0,0,0,0)|(1000/1000)] [NPC {3303529930293248}:10|(0,0,0,0)|(900/1000)] [Example {123}] [Action {836045448945477}: Effect {836045448945501}] (1 kinetic {836045448940873})"]
     for n in [1,7,257]
         V57Check(lines,Map("start",100, "end",1200, "damage",101, "segments",1),n)
 }
 ; v57.1 manual-only overlay parser-control tests. Native GUI cases stay hidden.
 V571Isolated(action)
 {
     global logReadBusy, inLogDispatch, IrisTests
     oldReader := logReadBusy, oldDispatch := inLogDispatch, oldTests := IrisTests.Busy
     try {
         logReadBusy := false, inLogDispatch := false, IrisTests.Busy := false
         V522Isolated(action)
     }
     finally logReadBusy := oldReader, inLogDispatch := oldDispatch, IrisTests.Busy := oldTests
 }
 
 V571TestDefaults()
 {
     s := IPMNewState(), app := IPNewApp()
     V48Assert(s.ParserControls && !s.ParserHooks && !s.ParserActionBusy,"button preference does not install hooks")
     V48Assert(!s.Wanted && !s.TimerOn && !app.Active,"no auto-show or auto-start")
     for p in IPMAllPanels(s)
         V48Assert(!IsObject(p.ParserGui) && !IsObject(p.ParserButton) && !p.ParserDrawn,"all seven panes are inert")
 }
 
 V571TestStartStopPlan()
 {
     app := IPNewApp()
     V48Assert(IPMParserPlan(app).Action="Start" && IPMParserPlan(app).Text="Start","off offers Start")
     app.Active := true
     V48Assert(IPMParserPlan(app).Action="Stop" && IPMParserPlan(app).Text="Stop","on offers Stop even before first combat")
     app.View := "Offline", app.Offline := {Label:"SYNTHETIC DEMO"}
     V48Assert(IPMParserPlan(app).Action="Stop","shown dataset does not stand in for collection state")
     app.Active := false, app.Live := {Halted:true}
     V48Assert(IPMParserPlan(app).Action="Start","halted session can use ordinary explicit restart")
 }
 
 V571TestBusyPlan()
 {
     for active in [false,true] {
         app := IPNewApp(), app.Active := active
         V48Assert(IPMParserPlan(app,true).Action="","reader fence")
         V48Assert(IPMParserPlan(app,false,true).Action="","diagnostics fence")
         V48Assert(IPMParserPlan(app,false,false,true).Action="","another UI action fence")
         app.Busy := true
         V48Assert(IPMParserPlan(app).Text="Wait","parser pump fence")
         app.Busy := false, app.Rendering := true
         V48Assert(IPMParserPlan(app).Action="","parser render fence")
     }
 }
 
 V571TestImportAndDrainPlan()
 {
     app := IPNewApp(), app.ImportFile := {Fake:true}
     V48Assert(IPMParserPlan(app).Text="Import" && IPMParserPlan(app).Action="","does not expose import cancellation")
     app.ImportFile := "", app.Queue := ["queued"], app.Head := 1
     V48Assert(IPMParserPlan(app).Action="" && IPMParserPlan(app).Text="Wait","no restart over undrained events")
     app.Active := true
     V48Assert(IPMParserPlan(app).Action="Stop","queued live capture can be explicitly stopped")
     app.Active := false, app.Head := 2
     V48Assert(IPMParserPlan(app).Action="Start","drained queue permits ordinary Start")
 }
 
 V571TestLockedPolicy()
 {
     s := IPMNewState(), s.Wanted := true
     for mode in [1,2,3] {
         s.Mode := mode, s.ClickTabs := false
         V48Assert(IPMParserAllowed(s,"locked",true,true),"parser button independent of tab preference and layout")
         V48Assert(!IPMParserAllowed(s,"locked",true,false),"hidden on ordinary Alt+Tab")
         V48Assert(!IPMParserAllowed(s,"edit",true,true),"body label cannot activate locked pane")
     }
     s.Wanted := false
     V48Assert(!IPMParserAllowed(s,"locked",true,true),"no action from manually hidden panel")
     s.Editing := true
     V48Assert(IPMParserAllowed(s,"edit",true,false),"editing on desktop uses visible body button")
     V48Assert(!IPMParserAllowed(s,"locked",true,true),"retired locked surface cannot act while editing")
 }
 
 V571TestClickGuards()
 {
     for prop in ["Busy","ParserActionBusy"] {
         s := IPMNewState(), s.Wanted := true, s.%prop% := true
         V48Assert(!IPMParserAllowed(s,"locked",true,true),"busy guard " prop)
     }
     s := IPMNewState(), s.Wanted := true, s.Updating := 1
     V48Assert(!IPMParserAllowed(s,"locked",true,true),"settings mutation fence")
     s.Updating := 0, s.Drag := {Hwnd:1}
     V48Assert(!IPMParserAllowed(s,"locked",true,true),"no action during a drag")
     s.Drag := "", s.ParserControls := false
     V48Assert(!IPMParserAllowed(s,"locked",true,true),"disabled control is inert")
     s.ParserControls := true, s.Enabled := false
     V48Assert(!IPMParserAllowed(s,"locked",true,true),"disabled overlays are inert")
     s.Enabled := true
     V48Assert(!IPMParserAllowed(s,"locked",false,true),"hidden input is inert")
 }
 
 V571TestRapidClickAndStaleLabel()
 {
     V48Assert(IPMParserClickFresh("Start","Start",1000,0),"deliberate Start accepted")
     V48Assert(!IPMParserClickFresh("Stop","Stop",1500,1000),"fast second click cannot stop new collection")
     V48Assert(!IPMParserClickFresh("Start","Start",1800,1000,900),"honors longer system double-click interval")
     V48Assert(IPMParserClickFresh("Start","Start",2000,1000,900),"a later deliberate action is allowed")
     V48Assert(!IPMParserClickFresh("Stop","Start",2000,0),"stale Start label cannot Stop")
     V48Assert(!IPMParserClickFresh("Start","Stop",2000,0),"stale Stop label cannot replace previous data")
     V48Assert(!IPMParserClickFresh("","",2000,0) && !IPMParserClickFresh("Other","Other",2000,0),"busy/unknown actions rejected")
 }
 
 V571TestSurfaceVisibilityMatrix()
 {
     Loop 64 {
         bits := A_Index-1, s := IPMNewState()
         s.Enabled := (bits&1)!=0, s.ParserControls := (bits&2)!=0, s.Wanted := (bits&4)!=0
         s.Editing := (bits&8)!=0, drawn := (bits&16)!=0, context := (bits&32)!=0
         expected := s.Enabled && s.ParserControls && s.Wanted && !s.Editing && drawn && context
         for mode in [1,2,3] {
             s.Mode := mode
             V48Assert(IPMParserSurfaceNeeded(s,drawn,context)=expected,"all layout input-visibility combinations")
         }
     }
 }
 
 V571TestHeaderGeometry()
 {
     for dpi in [72,96,120,144,192] {
         for width in [196,246,480,1200] {
             l := IPMCleanLayout(width,260,10,dpi,2560,1440,false,true,false,8,8)
             r := IPMParserRect(-1700,-100,l)
             V48Assert(r.X+r.W=-1700+l.W && r.Y=-100 && r.H=l.Head,"right aligned in physical screen coordinates")
             V48Assert(r.W>0 && r.W<=l.W/3 && r.X>-1700,"button occupies only part of header")
             V48Assert(r.Y+r.H<=-100+l.Header,"input does not cover tab/data rows")
         }
     }
 }
 
 V571TestOwnership()
 {
     p := IPMNewPanel(), p.Gui := {Hwnd:10}, p.ParserButton := {Hwnd:11}
     p.ParserGui := {Hwnd:20}, p.ParserHit := {Hwnd:21}
     V48Assert(IPMParserClickOrigin(p,11)="edit" && IPMParserClickOrigin(p,21)="locked","exact button routing")
     V48Assert(IPMParserClickOrigin(p,20)="" && IPMParserClickOrigin(p,99)="","no anonymous/stale HWND actions")
     V48Assert(IPMParserSurfaceOwns(p,20) && IPMParserSurfaceOwns(p,21),"owned root and child")
     V48Assert(!IPMParserSurfaceOwns(p,10) && !IPMParserSurfaceOwns(p,11),"body not part of locked input surface")
     V48Assert(IPMParserIsButton(p,11) && !IPMParserIsButton(p,10),"only action excluded from drag")
 }
 
 V571TestPreferenceRoundtrip()
 {
     V571Isolated(V571PreferenceCase)
 }
 V571PreferenceCase()
 {
     global IPM, SETTINGS_FILE, IP
     IniWrite("keep",SETTINGS_FILE,"Other","Value")
     IPMLoadSettings()
     V48Assert(IPM.ParserControls,"missing preference enables visible control, not parsing")
     IPM.ParserControls := false, IPMSaveSettings(), IPM := IPMNewState(), IPMLoadSettings()
     V48Assert(!IPM.ParserControls && IniRead(SETTINGS_FILE,"Other","Value")="keep","saved off and unrelated INI preserved")
     IPM.ParserControls := true, IPMSaveSettings(), IPM := IPMNewState(), IPMLoadSettings()
     V48Assert(IPM.ParserControls && !IP.Active && !IPM.TimerOn && !IPM.ParserHooks,"load does not run anything")
 }
 
 V571TestHeaderToggleDoesNotStart()
 {
     V571Isolated(V571ToggleCase)
 }
 V571ToggleCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     IPM.Mode := 3, IPM.Source := 2, IPM.Metric := "Heal"
     before := IIFSnapshot(IPM)
     V48Assert(IPMParserToggleControls() && !IPM.ParserControls,"menu can remove controls")
     V48Assert(IPMParserToggleControls() && IPM.ParserControls,"menu can restore controls")
     V48Assert(!IP.Active && !IPM.Wanted && !IPM.TimerOn && !IPM.ParserHooks,"preferences never start capture or show panels")
     V48Assert(IPM.Mode=3 && IPM.Source=2 && IPM.Metric="Heal" && IIFSnapshot(IPM).Count=before.Count,"layout/data choices preserved")
     V48Assert(IrisBench.Active && !soundboardsEnabled,"no benchmark/audio change")
 }
 
 V571TestActualStartAndStop()
 {
     V571Isolated(V571StartStopCase)
 }
 V571StartStopCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     IPM.AutoShowOnParse := false
     V48Assert(IPMParserRun("Start") && IP.Active,"calls actual IPStart")
     V48Assert(!IsObject(IP.Gui) && !IP.Visible && !IP.Timer,"no parser window or test timer")
     V51Feed(IP.Live,0,"Enter",0,V51Source(),"=")
     V51Feed(IP.Live,1000,"Damage",123)
     data := IP.Live
     V48Assert(IPMParserRun("Stop") && !IP.Active && IP.Live.Finished,"calls actual IPStop and finalizes drained data")
     V48Assert(IP.Live=data && IP.Live.Segments[1].Totals[IPActor(V51Source()).Key].Damage=123,"Stop retains collected result")
     V48Assert(IrisBench.Active && !soundboardsEnabled && !IPM.Wanted,"audio, benchmark and visibility untouched")
 }
 
 V571TestDispatchRefusesInvalidOrStale()
 {
     V571Isolated(V571InvalidCase)
 }
 V571InvalidCase()
 {
     global IP
     V48Assert(!IPMParserRun("Stop") && !IPMParserRun("bad") && !IP.Active,"invalid actions do nothing")
     V48Assert(IPMParserRun("Start"),"first start")
     data := IP.Live
     V48Assert(!IPMParserRun("Start") && IP.Live=data,"repeated Start cannot replace live session")
     IPMParserRun("Stop")
     V48Assert(!IPMParserRun("Stop") && IP.Live=data,"repeated Stop is inert")
 }
 
 V571TestDispatchImportAndBusyGuards()
 {
     V571Isolated(V571DispatchGuardsCase)
 }
 V571DispatchGuardsCase()
 {
     global IP, logReadBusy, inLogDispatch, IrisTests
     IP.ImportFile := {Fake:true}, marker := IP.ImportFile
     V48Assert(!IPMParserRun("Start") && !IPMParserRun("Stop") && IP.ImportFile=marker,"overlay never cancels import")
     IP.ImportFile := "", IP.Queue := ["queued"]
     V48Assert(!IPMParserRun("Start") && IP.Queue.Length=1,"queued work preserved")
     IP.Queue := [], logReadBusy := true
     V48Assert(!IPMParserRun("Start"),"busy reader checked again before dispatch")
     logReadBusy := false, inLogDispatch := true
     V48Assert(!IPMParserRun("Start"),"in-dispatch gate")
     inLogDispatch := false, IrisTests.Busy := true
     V48Assert(!IPMParserRun("Start") && !IP.Active,"diagnostic gate")
 }
 
 V571TestHiddenSurfacesAllPanels()
 {
     V571Isolated(V571HiddenStylesCase)
 }
 V571HiddenStylesCase()
 {
     global IPM
     for p in IPMAllPanels() {
         kind := p.Key="Combined" ? "Personal" : p.Key
         IPMEnsureGui(kind,0,p)
         V48Assert(IPMParserEnsureSurface(p),"hidden action surface for " p.Key)
         body := DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt")
         hit := DllCall("User32\GetWindowLongW","Ptr",p.ParserGui.Hwnd,"Int",-20,"UInt")
         V48Assert((body&0x08000020)=0x08000020,"body click-through/noactivate preserved")
         V48Assert((hit&0x08000000)!=0 && (hit&0x20)=0 && (hit&0x80000)!=0,"input clickable and nonactivating")
         V48Assert(DllCall("User32\GetWindow","Ptr",p.ParserGui.Hwnd,"UInt",4,"Ptr")=p.Gui.Hwnd,"owned by correct pane")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int") && !DllCall("User32\IsWindowVisible","Ptr",p.ParserGui.Hwnd,"Int"),"tests never show windows")
     }
     V48Assert(!IPM.ParserHooks && !IPM.TimerOn,"no normal hooks or timer in tests")
 }
 
 V571TestHiddenSurfaceGeometry()
 {
     V571Isolated(V571GeometryCase)
 }
 V571GeometryCase()
 {
     global IPM
     IPMEnsureGui("Personal"), p := IPM.Panel
     IPMRender("Personal",V53Snapshot()), IPMParserEnsureSurface(p)
     p.Gui.Move(-400,75)
     V48Assert(IPMParserPlaceSurface(p),"hidden positioning succeeds")
     p.ParserGui.GetPos(&x,&y,&w,&h), r := IPMParserRect(-400,75,p.Layout)
     V48Assert(x=r.X && y=r.Y && w=r.W && h=r.H,"actual parent location, not saved coordinates")
     p.ParserButton.GetPos(&bx,&by,&bw,&bh), p.Heading.GetPos(&hx,&hy,&hw,&hh)
     V48Assert(hx+hw=bx && bx+bw=p.Layout.W && by=0 && bh=hh,"heading and action do not overlap")
     original := p.ParserGui.Hwnd, p.Width := 410
     IPMRender("Damage",V53Snapshot()), IPMParserPlaceSurface(p)
     V48Assert(p.ParserGui.Hwnd=original && !DllCall("User32\IsWindowVisible","Ptr",original,"Int"),"resize reuses hidden surface")
 }
 
 V571TestHeaderStateUpdatesWithoutData()
 {
     V571Isolated(V571CaptionCase)
 }
 V571CaptionCase()
 {
     global IPM, IP
     IPMEnsureGui("Personal"), p := IPM.Panel
     V48Assert(p.ParserButton.Text="Start" && p.ParserAction="Start","initial caption")
     IP.Active := true, IPMParserUpdate(p)
     V48Assert(p.ParserButton.Text="Stop" && p.ParserAction="Stop","caption changes without damage or render changes")
     IP.Active := false, IP.ImportFile := {Fake:true}, IPMParserUpdate(p)
     V48Assert(p.ParserButton.Text="Import" && p.ParserAction="","import state not mislabeled as startable")
     IP.ImportFile := "", IP.Queue := ["queued"], IPMParserUpdate(p)
     V48Assert(p.ParserButton.Text="Wait" && p.ParserAction="","draining caption")
 }
 
 V571TestNonActivationAndDoubleClick()
 {
     V571Isolated(V571MessageCase)
 }
 V571MessageCase()
 {
     global IPM
     IPMEnsureGui("Personal"), p := IPM.Panel, IPMParserEnsureSurface(p), p.ParserDrawn := true
     V48Assert(IPMParserMessage(0,0,0x21,p.ParserGui.Hwnd)=3,"root MA_NOACTIVATE")
     V48Assert(IPMParserMessage(0,0,0x21,p.ParserHit.Hwnd)=3,"child MA_NOACTIVATE")
     V48Assert(IPMParserMessage(0,0,0x21,p.Gui.Hwnd)="","body messages untouched")
     V48Assert(IPMParserMessage(0,0,0x203,p.ParserHit.Hwnd)=0,"double-click swallowed")
     p.ParserDrawn := false
     V48Assert(IPMParserMessage(0,0,0x21,p.ParserGui.Hwnd)="","hidden surface inert")
 }
 
 V571TestHideAndDestroyLifecycle()
 {
     V571Isolated(V571LifetimeCase)
 }
 V571LifetimeCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     IPMEnsureGui("Personal"), p := IPM.Panel, IPMParserEnsureSurface(p)
     handle := p.ParserGui.Hwnd, p.ParserDrawn := true, p.Drawn := true, IPM.Wanted := true, IP.Active := true
     IPMHide()
     V48Assert(!p.ParserDrawn && !IPM.ParserHooks && !IPM.Wanted,"hide retires invisible input")
     V48Assert(IP.Active && IrisBench.Active && !soundboardsEnabled,"hide is not stop")
     IPMDestroyPanels()
     V48Assert(!IsObject(p.ParserGui) && !IsObject(p.ParserHit) && !IsObject(p.ParserButton),"destroy clears all handles")
     V48Assert(!DllCall("User32\IsWindow","Ptr",handle,"Int"),"owned input actually destroyed")
 }
 
 V571TestEditAndDisabledStyles()
 {
     V571Isolated(V571EditCase)
 }
 V571EditCase()
 {
     global IPM
     IPMEnsureGui("Personal"), p := IPM.Panel, IPMParserEnsureSurface(p), p.ParserDrawn := true
     IPM.Editing := true, IPMStyle(p)
     V48Assert(!p.ParserDrawn && !IPMParserEnsureSurface(p),"edit retires locked input")
     V48Assert(IPMParserIsButton(p,p.ParserButton.Hwnd),"body action has exact drag exclusion")
     IPM.ParserControls := false, IPMParserArrange(p,p.Layout)
     p.Heading.GetPos(&x,&y,&w,&h)
     V48Assert(x+w=p.Layout.W,"disabled controls restore the full remaining header beside its icon")
     V48Assert((DllCall("User32\GetWindowLongW","Ptr",p.ParserButton.Hwnd,"Int",-16,"UInt")&0x10000000)=0,"button style hidden")
 }
 
 V571TestNoUiActionInHarness()
 {
     V571Isolated(V571HarnessCase)
 }
 V571HarnessCase()
 {
     global IPM, IP
     IPMEnsureGui("Personal"), p := IPM.Panel, p.Drawn := true, IPM.Wanted := true
     IPMParserSyncSurface(p,true), IPMParserSyncHooks()
     V48Assert(!IsObject(p.ParserGui) && !IPM.ParserHooks && !p.ParserDrawn,"normal path cannot show input in test mode")
     V48Assert(!IPMParserClicked("Combined") && !IPMParserClicked("Combined",p.ParserButton) && !IP.Active,"test cannot synthesize parser click")
 }
 
 V571TestTargetSelection()
 {
     s := IPMNewState()
     V48Assert(IPMParserTargetSelected(s,"Combined") && !IPMParserTargetSelected(s,"Damage"),"only selected tabbed window, not dormant split pane")
     s.Mode := 2, s.Shown["Threat"] := true
     V48Assert(!IPMParserTargetSelected(s,"Combined") && IPMParserTargetSelected(s,"Damage") && IPMParserTargetSelected(s,"Threat"),"split-only and raid-tool controls")
     s.Mode := 3
     V48Assert(IPMParserTargetSelected(s,"Combined") && IPMParserTargetSelected(s,"Damage"),"combined and split simultaneously")
     s.Shown["Damage"] := false
     V48Assert(!IPMParserTargetSelected(s,"Damage") && !IPMParserTargetSelected(s,"unknown"),"unselected/stale key rejected")
     s.Enabled := false
     V48Assert(!IPMParserTargetSelected(s,"Combined"),"master disable excludes every control")
 }
 
 V571TestNativeMenuCheckbox()
 {
     V55Isolated(V571MenuCase)
 }
 V571MenuCase()
 {
     global IPM, IP
     a := IIFCreateMenu(), b := IIFCreateMenu()
     V48Assert(V55MenuChecked(a,"Parser Controls on Overlays"),"default checkbox")
     IPMParserToggleControls()
     V48Assert(!V55MenuChecked(a,"Parser Controls on Overlays") && !V55MenuChecked(b,"Parser Controls on Overlays"),"all menus synchronize")
     V48Assert(!IP.Active && !IPM.Wanted && !IPM.ParserHooks,"menu check cannot start capture or input hooks")
 }
 ; v57.2 manual-only restart/warning preference tests. No visible dialogs or game input.
 V572Isolated(action)
 {
     global IIF, IR, testClock
     oldI := IIF, oldR := IR, oldClock := testClock
     try {
         IIF := IIFNewState(), IR := IRNewUI(), testClock := 10000
         V571Isolated(action)
     }
     finally IIF := oldI, IR := oldR, testClock := oldClock
 }
 
 V572SeedStopped()
 {
     global IP
     IP.Live := IPNewData("Synthetic prior live session")
     V51Feed(IP.Live,0,"Enter",0,V51Source(),"=")
     V51Feed(IP.Live,1000,"Damage",123)
     IP.Active := true
     IPStop()
     return IP.Live
 }
 
 V572TestDefaults()
 {
     app := IPNewApp(), s := IPMNewState()
     V48Assert(s.ParserWarnRestart && !IsObject(s.ParserRestart) && s.ParserRestartSerial=0,"safe warning default; no consent at launch")
     V48Assert(!app.Active && !s.Wanted && !s.TimerOn && !s.ParserHooks,"preference does not start parser/display/hooks")
     V48Assert(!IPMParserRestartRequired(app,s),"empty first Start needs no confirmation")
 }
 
 V572TestWarningRequirement()
 {
     app := IPNewApp(), s := IPMNewState(), app.Live := IPNewData()
     V48Assert(!IPMParserRestartRequired(app,s),"empty data has no destructive warning")
     app.Live.Lines := 1
     V48Assert(IPMParserRestartRequired(app,s),"nonempty live data warns by default")
     s.ParserWarnRestart := false
     V48Assert(!IPMParserRestartRequired(app,s) && app.Live.Lines=1,"opt-out changes policy, not data")
     s.ParserWarnRestart := true, app.Live.Lines := 0, app.Live.Segments.Push({Id:1})
     V48Assert(IPMParserRestartRequired(app,s),"retained segment cannot be erased via a zero-line counter")
 }
 
 V572TestWarningRoundtrip()
 {
     V572Isolated(V572RoundtripCase)
 }
 V572RoundtripCase()
 {
     global IPM, IP, SETTINGS_FILE
     IniWrite("keep",SETTINGS_FILE,"Other","Value")
     IPMLoadSettings()
     V48Assert(IPM.ParserWarnRestart,"missing setting defaults on")
     for value in [false,true,false] {
         IPM.ParserWarnRestart := value, IPMSaveSettings(), IPM := IPMNewState(), IPMLoadSettings()
         V48Assert(IPM.ParserWarnRestart=value,"saved choice restored")
         V48Assert(IniRead(SETTINGS_FILE,"Other","Value")="keep","unrelated preference not overwritten")
         V48Assert(!IP.Active && !IPM.Wanted && !IPM.ParserHooks,"loading preference has no runtime side effects")
     }
 }
 
 V572TestWarningToggleIsolation()
 {
     V572Isolated(V572ToggleCase)
 }
 V572ToggleCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled, SETTINGS_FILE
     data := V572SeedStopped(), IPM.Mode := 3, IPM.Source := 2, IPM.Metric := "Heal"
     V48Assert(IPMParserToggleRestartWarning() && !IPM.ParserWarnRestart,"menu disables warning")
     V48Assert(IniRead(SETTINGS_FILE,"IrisParseDisplay","ParserWarnRestart")="0","menu writes only the requested saved choice")
     V48Assert(!IP.Active && IP.Live=data && IPM.Mode=3 && IPM.Source=2 && IPM.Metric="Heal","no restart, layout or data-source change")
     V48Assert(IrisBench.Active && !soundboardsEnabled && !IPM.Wanted,"benchmark/audio/visibility independent")
     IPM.Busy := true
     V48Assert(!IPMParserToggleRestartWarning() && !IPM.ParserWarnRestart,"display mutation fence")
     IPM.Busy := false
 }
 
 V572TestWarningToggleCancelsPending()
 {
     V572Isolated(V572TogglePendingCase)
 }
 V572TogglePendingCase()
 {
     global IPM, IP
     data := V572SeedStopped()
     IPMParserRun("Start"), token := IPM.ParserRestart.Serial
     IPMParserToggleRestartWarning()
     V48Assert(!IsObject(IPM.ParserRestart) && !IP.Active && IP.Live=data,"opting out cancels pending consent, does not execute it")
     V48Assert(!IPMParserRun("Confirm",token) && IP.Live=data,"old Confirm cannot act after option change")
     V48Assert(IPMParserRun("Start") && IP.Active && IP.Live!=data,"next explicit Start uses new warning preference")
 }
 
 V572TestWarningMenuChecks()
 {
     V572Isolated(V572MenuCase)
 }
 V572MenuCase()
 {
     global IPM, IP
     a := IIFCreateMenu(), b := IIFCreateMenu()
     V48Assert(V55MenuChecked(a,"Warn Before Parser Restart") && V55MenuChecked(b,"Warn Before Parser Restart"),"all menus default checked")
     IPMParserToggleRestartWarning()
     V48Assert(!V55MenuChecked(a,"Warn Before Parser Restart") && !V55MenuChecked(b,"Warn Before Parser Restart"),"menu checkmarks synchronize off")
     IPMParserToggleRestartWarning()
     V48Assert(V55MenuChecked(a,"Warn Before Parser Restart") && !IP.Active,"on does not start anything")
 }
 
 V572TestFirstStartStillDirect()
 {
     V572Isolated(V572FirstCase)
 }
 V572FirstCase()
 {
     global IPM, IP
     V48Assert(IPMParserRun("Start") && IP.Active && !IsObject(IPM.ParserRestart),"first start skips empty warning")
     V48Assert(!IsObject(IP.Gui) && !IP.Visible && !IP.Timer,"overlay does not open parser or run timers in test mode")
 }
 
 V572TestRestartArmsOnly()
 {
     V572Isolated(V572ArmCase)
 }
 V572ArmCase()
 {
     global IPM, IP
     data := V572SeedStopped()
     V48Assert(!IPMParserRun("Start") && !IP.Active && IP.Live=data,"first restart click only arms consent")
     V48Assert(IsObject(IPM.ParserRestart) && IPM.ParserRestart.Live=data && IPM.ParserRestart.Serial>0,"consent tied to exact previous session")
     plan := IPMParserOverlayPlan(IP,IPM,ClockMs(),DllCall("User32\GetForegroundWindow","Ptr"))
     V48Assert(plan.Action="Confirm" && plan.State="Replace live stats?" && plan.Request=IPM.ParserRestart.Serial,"header offers explicit confirmation")
 }
 
 V572TestConfirmedRestart()
 {
     V572Isolated(V572ConfirmCase)
 }
 V572ConfirmCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     data := V572SeedStopped(), offline := IPNewData("Saved view"), IP.Offline := offline
     IPMParserRun("Start"), token := IPM.ParserRestart.Serial
     V48Assert(IPMParserRun("Confirm",token) && IP.Active && IP.Live!=data,"confirmed restart replaces only the stopped live session")
     V48Assert(IP.Live.Lines=0 && IP.Offline=offline && data.Segments.Length=1,"fresh live totals; offline dataset and original object untouched")
     V48Assert(!IsObject(IPM.ParserRestart) && IrisBench.Active && !soundboardsEnabled,"consent cleared; benchmark and audio unchanged")
     V48Assert(!IPMParserRun("Confirm",token),"cannot confirm the same restart twice")
 }
 
 V572TestInvalidConfirmationTokens()
 {
     V572Isolated(V572TokenCase)
 }
 V572TokenCase()
 {
     global IPM, IP
     data := V572SeedStopped()
     V48Assert(!IPMParserRun("Confirm",1),"unarmed confirmation rejected")
     IPMParserRun("Start"), token := IPM.ParserRestart.Serial
     for bad in [0,-1,token+1]
         V48Assert(!IPMParserRun("Confirm",bad) && IP.Live=data && !IP.Active,"wrong generation rejected")
     V48Assert(!IPMParserRun("Start") && IP.Live=data,"stale Start cannot act as Confirm")
     IPMParserCancelRestart(), IPMParserRun("Start")
     V48Assert(IPM.ParserRestart.Serial!=token && !IPMParserRun("Confirm",token),"rearming uses fresh serial")
 }
 
 V572TestCancelPreservesResults()
 {
     V572Isolated(V572CancelCase)
 }
 V572CancelCase()
 {
     global IPM, IP
     data := V572SeedStopped(), IPMParserRun("Start")
     V48Assert(IPMParserCancelRestart() && !IPMParserCancelRestart(),"cancel is idempotent")
     V48Assert(IP.Live=data && !IP.Active && data.Segments[1].Totals[IPActor(V51Source()).Key].Damage=123,"cancel retains collected statistics")
 }
 
 V572TestExpiredConsent()
 {
     app := IPNewApp(), app.Live := IPNewData(), app.Live.Lines := 1
     p := IPMParserNewRestart(app,1,10000,42)
     V48Assert(IPMParserRestartMatches(app,p,10000,42) && IPMParserRestartMatches(app,p,17999,42),"valid inside bounded consent window")
     V48Assert(!IPMParserRestartMatches(app,p,18000,42) && !IPMParserRestartMatches(app,p,9999,42),"expiry and clock rewind reject consent")
 }
 
 V572TestForegroundScope()
 {
     app := IPNewApp(), app.Live := IPNewData(), app.Live.Lines := 1
     p := IPMParserNewRestart(app,1,10000,42)
     V48Assert(!IPMParserRestartMatches(app,p,10001,43),"switching foreground retires consent")
     V48Assert(IPMParserRestartMatches(app,p,10001,42),"same foreground permits confirmation")
 }
 
 V572TestDataMutationInvalidatesConsent()
 {
     for prop in ["Lines","Changed","SourceKey"] {
         app := IPNewApp(), app.Live := IPNewData(), app.Live.Lines := 1
         p := IPMParserNewRestart(app,1,10000,42)
         app.Live.%prop% := prop="SourceKey" ? "other source" : app.Live.%prop%+1
         V48Assert(!IPMParserRestartMatches(app,p,10001,42),"changed data invalidates " prop)
     }
     app := IPNewApp(), app.Live := IPNewData(), app.Live.Lines := 1
     p := IPMParserNewRestart(app,1,10000,42), app.Live.Segments.Push({Id:1})
     V48Assert(!IPMParserRestartMatches(app,p,10001,42),"different segment count rejects stale consent")
 }
 
 V572TestDifferentSessionInvalidatesConsent()
 {
     app := IPNewApp(), app.Live := IPNewData(), app.Live.Lines := 1
     p := IPMParserNewRestart(app,1,10000,42)
     app.Live := IPNewData(), app.Live.Lines := 1
     V48Assert(!IPMParserRestartMatches(app,p,10001,42),"equal counters in a replacement object are not the same live session")
 }
 
 V572TestPendingAndImportInvalidate()
 {
     for state in ["active","queue","import"] {
         app := IPNewApp(), app.Live := IPNewData(), app.Live.Lines := 1
         p := IPMParserNewRestart(app,1,10000,42)
         if state="active"
             app.Active := true
         else if state="queue"
             app.Queue.Push("pending")
         else
             app.ImportFile := {Synthetic:true}
         V48Assert(!IPMParserRestartMatches(app,p,10001,42),"new work invalidates consent: " state)
     }
 }
 
 V572TestWarningOffOneClickRestart()
 {
     V572Isolated(V572OffCase)
 }
 V572OffCase()
 {
     global IPM, IP
     data := V572SeedStopped(), IPM.ParserWarnRestart := false
     V48Assert(IPMParserRun("Start") && IP.Active && IP.Live!=data,"warning-off allows direct explicit restart")
     V48Assert(!IsObject(IPM.ParserRestart) && IP.Live.Lines=0,"no popup/inline warning state created")
     newData := IP.Live
     V48Assert(!IPMParserRun("Start") && IP.Live=newData,"warning-off cannot replace an already active session")
 }
 
 V572TestDesktopHonorsWarningOff()
 {
     V572Isolated(V572DesktopCase)
 }
 V572DesktopCase()
 {
     global IPM, IP
     data := V572SeedStopped(), IPM.ParserWarnRestart := false
     V48Assert(IPStart() && IP.Active && IP.Live!=data,"desktop wrapper shares explicit saved opt-out; no modal expected")
 }
 
 V572TestWarningOffStillHonorsBusyGuards()
 {
     V572Isolated(V572OffGuardsCase)
 }
 V572OffGuardsCase()
 {
     global IPM, IP, logReadBusy, inLogDispatch, IrisTests
     data := V572SeedStopped(), IPM.ParserWarnRestart := false
     for prop in ["Busy","Rendering"] {
         IP.%prop% := true
         V48Assert(!IPMParserRun("Start") && IP.Live=data,"warning preference does not bypass " prop)
         IP.%prop% := false
     }
     IP.Queue := ["pending"]
     V48Assert(!IPMParserRun("Start") && IP.Live=data,"pending work protected even with warning off")
     IP.Queue := [], IP.ImportFile := {Fake:true}
     V48Assert(!IPMParserRun("Start") && IsObject(IP.ImportFile),"import protected")
     IP.ImportFile := "", logReadBusy := true
     V48Assert(!IPMParserRun("Start"),"reader busy protected")
     logReadBusy := false, inLogDispatch := true
     V48Assert(!IPMParserRun("Start"),"dispatch protected")
     inLogDispatch := false, IrisTests.Busy := true
     V48Assert(!IPMParserRun("Start"),"diagnostics protected")
     IrisTests.Busy := false
 }
 
 V572TestConfirmationBusyDoesNotErase()
 {
     V572Isolated(V572ConfirmBusyCase)
 }
 V572ConfirmBusyCase()
 {
     global IPM, IP, logReadBusy
     data := V572SeedStopped(), IPMParserRun("Start"), token := IPM.ParserRestart.Serial
     logReadBusy := true
     V48Assert(!IPMParserRun("Confirm",token) && IP.Live=data,"busy reader blocks commit")
     logReadBusy := false
     V48Assert(IPMParserRun("Confirm",token),"deliberate retry can commit when guard clears")
 }
 
 V572TestCommitProtectsExpectedData()
 {
     V572Isolated(V572CommitCase)
 }
 V572CommitCase()
 {
     global IP
     data := V572SeedStopped(), IP.Live := IPNewData("Replacement")
     V48Assert(!IPStartCommit(data) && !IP.Active,"stale expected dataset cannot erase a replacement")
 }
 
 V572TestConfirmClickDebounce()
 {
     V48Assert(!IPMParserClickFresh("Confirm","Start",1000,0),"old caption is not confirmation")
     V48Assert(!IPMParserClickFresh("Confirm","Confirm",1500,1000),"double click cannot arm and confirm")
     V48Assert(!IPMParserClickFresh("Confirm","Confirm",1800,1000,900),"long system double-click guard retained")
     V48Assert(IPMParserClickFresh("Confirm","Confirm",2000,1000,900),"separate deliberate confirmation allowed")
 }
 
 V572TestHiddenHeaderAndCancel()
 {
     V572Isolated(V572HeaderCase)
 }
 V572HeaderCase()
 {
     global IPM, IP
     V572SeedStopped(), IPMEnsureGui("Personal"), p := IPM.Panel
     IPMRender("Personal",V53Snapshot()), normal := p.Heading.Text
     IPMParserRun("Start"), IPMParserUpdate(p)
     V48Assert(p.Heading.Text="Replace live stats?" && p.ParserButton.Text="Confirm","confirmation lives inside existing header")
     V48Assert(p.ParserRequest=IPM.ParserRestart.Serial && !DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"test stays hidden with exact request identity")
     IPMParserCancelRestart(), IPMParserUpdate(p)
     V48Assert(p.Heading.Text=normal && p.ParserButton.Text="Start","cancel restores title and Start")
 }
 
 V572TestRightClickCancellation()
 {
     V572Isolated(V572RightClickCase)
 }
 V572RightClickCase()
 {
     global IPM, IP
     data := V572SeedStopped(), IPMEnsureGui("Personal"), p := IPM.Panel
     IPMParserEnsureSurface(p), p.ParserDrawn := true
     IPMParserRun("Start")
     V48Assert(IPMParserMessage(0,0,0x205,p.ParserHit.Hwnd)=0,"right-click handled only by owned input")
     V48Assert(!IsObject(IPM.ParserRestart) && IP.Live=data && !IP.Active,"right click cancels without replacing statistics")
     V48Assert(IPMParserMessage(0,0,0x21,p.ParserHit.Hwnd)=3,"MA_NOACTIVATE remains for locked header")
 }
 
 V572TestHideCancelsConsentNotCapture()
 {
     V572Isolated(V572HideCase)
 }
 V572HideCase()
 {
     global IPM, IP
     data := V572SeedStopped(), IPM.Wanted := true, IPMParserRun("Start")
     IPMHide()
     V48Assert(!IsObject(IPM.ParserRestart) && IP.Live=data,"hiding cancels pending restart")
     IPM.ParserWarnRestart := false, IPMParserRun("Start"), IPM.Wanted := true, IPMHide()
     V48Assert(IP.Active && !IPM.Wanted,"hiding still does not stop collection")
 }
 
 V572TestContextAndPreferenceCancellation()
 {
     V572Isolated(V572ContextCase)
 }
 V572ContextCase()
 {
     global IPM, IP
     data := V572SeedStopped(), IPM.Wanted := true, IPMParserRun("Start")
     V48Assert(IPMParserCheckRestart(false) && !IsObject(IPM.ParserRestart),"leaving display context cancels pending request")
     IPMParserRun("Start"), IPM.ParserWarnRestart := false
     V48Assert(IPMParserCheckRestart(true) && IP.Live=data,"warning opt-out never auto-confirms existing request")
 }
 
 V572TestAllPanelTitlesAndWarningOff()
 {
     V572Isolated(V572AllPanelsCase)
 }
 V572AllPanelsCase()
 {
     global IPM, IP
     V572SeedStopped(),normal := Map()
     for p in IPMAllPanels() {
         kind := p.Key="Combined" ? "Personal" : p.Key
         IPMEnsureGui(kind,0,p), IPMRender(kind,V53Snapshot(),p)
         normal[p.Key] := p.Heading.Text
     }
     runPanel := IPM.Panels["RunTimer"],runText := runPanel.ParserButton.Text,runHeading := runPanel.Heading.Text
     IPMParserRun("Start")
     for p in IPMAllPanels() {
         IPMParserUpdate(p)
         if p.Key="RunTimer"
             V48Assert(p.ParserButton.Text=runText && p.Heading.Text=runHeading,"raid timer remains independent of parser restart confirmation")
         else
             V48Assert(p.ParserButton.Text="Confirm" && p.Heading.Text="Replace live stats?","same confirmation on " p.Key)
     }
     IPMParserToggleRestartWarning()
     for p in IPMAllPanels() {
         IPMParserUpdate(p)
         if p.Key="RunTimer"
             V48Assert(p.ParserButton.Text=runText && p.Heading.Text=runHeading,"parser warning preference cannot change the raid timer action")
         else
             V48Assert(p.ParserButton.Text="Start" && p.Heading.Text=normal[p.Key],"opt-out restores normal " p.Key)
     }
 }
 
 V572TestWarningOffPlanIgnoresStalePending()
 {
     app := IPNewApp(), app.Live := IPNewData(), app.Live.Lines := 1
     s := IPMNewState(), s.ParserRestart := IPMParserNewRestart(app,1,10000,42)
     s.ParserWarnRestart := false
     V48Assert(IPMParserOverlayPlan(app,s,10001,42).Action="Start","disabled warning never offers stale Confirm")
     V48Assert(IPMParserOverlayPlan(app,s,10001,42,true).Action="","disabled warning still observes busy fence")
 }
 ; v57.3 manual tests. Hidden GUI only; no synthetic game input or parser uploads.
 V573Panel(auto := true, scale := 1)
 {
     p := IPMNewPanel("Damage")
     p.AutoHeight := auto, p.Height := 400, p.Layout := {Scale:scale}
     return p
 }
 
 V573TestDefaults()
 {
     s := IPMNewState()
     V48Assert(!IPMPreviewActive(s) && !IsObject(s.PreviewSnapshot),"preview does not start on launch")
     V48Assert(!s.Wanted && !s.Editing && !s.TimerOn && s.MaxRows=8,"existing launch and row defaults retained")
     for p in IPMAllPanels(s)
         V48Assert(p.AutoHeight,"every new panel defaults to auto height")
 }
 
 V573TestWidthLeft()
 {
     p := V573Panel(), g := IPMResizeGeometry(p,{Edge:"L",H:60},{W:330,H:60})
     V48Assert(g.AutoHeight && g.Width=330 && g.Height=400,"left edge changes width, keeps auto and remembered fixed height")
 }
 
 V573TestWidthRight()
 {
     p := V573Panel(), g := IPMResizeGeometry(p,{Edge:"R",H:60},{W:390,H:60})
     V48Assert(g.AutoHeight && g.Width=390 && g.Height=400,"right edge does not freeze a solo-height window")
 }
 
 V573TestCornerHorizontalOnly()
 {
     for edge in ["LT","LB","RT","RB"] {
         p := V573Panel(), g := IPMResizeGeometry(p,{Edge:edge,H:60},{W:350,H:60})
         V48Assert(g.AutoHeight && g.Height=400,"corner horizontal motion alone preserves automatic height")
     }
 }
 
 V573TestTopHeight()
 {
     p := V573Panel(), g := IPMResizeGeometry(p,{Edge:"T",H:60},{W:999,H:150})
     V48Assert(!g.AutoHeight && g.Height=150 && g.Width=p.Width,"top vertical resize makes only height fixed")
 }
 
 V573TestBottomHeight()
 {
     p := V573Panel(), g := IPMResizeGeometry(p,{Edge:"B",H:60},{W:999,H:180})
     V48Assert(!g.AutoHeight && g.Height=180 && g.Width=p.Width,"bottom vertical resize makes only height fixed")
 }
 
 V573TestCornerBothAxes()
 {
     for edge in ["LT","LB","RT","RB"] {
         g := IPMResizeGeometry(V573Panel(),{Edge:edge,H:60},{W:390,H:200})
         V48Assert(!g.AutoHeight && g.Width=390 && g.Height=200,"both dimensions change on real corner resizing")
     }
 }
 
 V573TestFixedWidthPreserved()
 {
     g := IPMResizeGeometry(V573Panel(false),{Edge:"R",H:400},{W:390,H:400})
     V48Assert(!g.AutoHeight && g.Height=400,"width does not undo intentionally fixed height")
 }
 
 V573TestResizeDpi()
 {
     for scale in [0.75,1,1.25,1.5,2] {
         p := V573Panel(true,scale), g := IPMResizeGeometry(p,{Edge:"R",H:60*scale},{W:360*scale,H:60*scale})
         V48Assert(g.Width=360 && g.Height=400 && g.AutoHeight,"screen to saved units converts width once")
         g := IPMResizeGeometry(p,{Edge:"RB",H:60*scale},{W:360*scale,H:300*scale})
         V48Assert(g.Width=360 && g.Height=300 && !g.AutoHeight,"vertical saved units scale once")
     }
 }
 
 V573TestEightRowGrowth()
 {
     a := IPMCleanLayout(360,60,10,96,1920,1080,false,false,true,1,8)
     b := IPMCleanLayout(360,60,10,96,1920,1080,false,false,true,8,8)
     V48Assert(a.N=1 && b.N=8 && b.H>a.H,"a solo automatic panel grows to eight real rows")
 }
 
 V573TestSixteenRowGrowth()
 {
     for dpi in [96,120,144,192] {
         a := IPMCleanLayout(360,60,10,dpi,3840,2160,false,false,true,1,16)
         b := IPMCleanLayout(360,60,10,dpi,3840,2160,false,false,true,16,16)
         V48Assert(a.N=1 && b.N=16 && b.H>a.H,"sixteen contributors fit automatically on a sufficient monitor")
     }
 }
 
 V573TestFixedHeightHonored()
 {
     a := IPMCleanLayout(360,100,10,96,1920,1080,false,false,false,1,16)
     b := IPMCleanLayout(360,100,10,96,1920,1080,false,false,false,16,16)
     V48Assert(a.H=b.H && b.N<16,"intentional fixed dimensions remain fixed")
 }
 
 V573TestAllSizeChoices()
 {
     keys := IPMSizeKeys(), labels := IPMSizeLabels()
     expected := ["Combined","Personal","Damage","Heal","Taken","Threat","BossHP","Challenges","RunTimer","Effects","HealerGrid","RaidNotes","RaidUtility","EnemyDebuffs","Achievements","BossDamage","FightFeedback","PvP"]
     V48Assert(keys.Length=expected.Length && labels.Length=expected.Length,"all eighteen independent overlay choices are addressable")
     for i,key in expected
         V48Assert(keys[i]=key && labels[i]!="","every overlay retains its distinct sizing target: " key)
     for mode in [1,2,3] {
         for view in IPMViews() {
             for i,key in keys
                 V48Assert(IPMGeometryChoice(mode,view,i)=key,"size target independent of active tab and layout")
         }
     }
     V48Assert(keys[6]="Threat" && keys[7]="BossHP","extra raid panels are not omitted")
 }
 
 V573GeometryFixture(choice)
 {
     global IPM
     IPM.ConfigGui := {}, IPM.ModeControl := {Value:1}, IPM.MetricControl := {Value:1}
     IPM.GeometryControl := {Value:choice}, IPM.WidthControl := {Value:0}, IPM.HeightControl := {Value:0}
     IPM.AutoControl := {Value:1}, IPM.ClickTabsControl := {Enabled:false}, IPM.ShowControls := Map()
 }
 
 V573TestThreatSettings()
 {
     V572Isolated(V573ThreatSettingsCase)
 }
 V573ThreatSettingsCase()
 {
     global IPM
     V573GeometryFixture(6)
     p := IPM.Panels["Threat"], p.Width := 388, p.Height := 160, p.AutoHeight := false
     IPMLoadGeometryControls()
     V48Assert(IPM.GeometryKey="Threat" && IPM.WidthControl.Value=388 && IPM.AutoControl.Value=2,"threat size and fixed mode load")
     IPM.AutoControl.Value := 1, IPMWidth := IPM.Panel.Width
     IPMReadGeometryControls(), IPMHeightModeChanged()
     V48Assert(p.AutoHeight && !IPM.HeightControl.Enabled && IPM.Panel.Width=IPMWidth,"threat auto restored without changing personal window")
 }
 
 V573TestBossSettings()
 {
     V572Isolated(V573BossSettingsCase)
 }
 V573BossSettingsCase()
 {
     global IPM
     V573GeometryFixture(7)
     IPM.ModeControl.Value := 2
     IPMLoadGeometryControls()
     IPM.AutoControl.Value := 2, IPM.HeightControl.Value := 200, IPMReadGeometryControls()
     V48Assert(IPM.GeometryKey="BossHP" && !IPM.Panels["BossHP"].AutoHeight && IPM.Panels["BossHP"].Height=200,"boss HP can be sized in separate-only layout")
 }
 
 V573TestHeightControlStates()
 {
     V572Isolated(V573HeightControlCase)
 }
 V573HeightControlCase()
 {
     global IPM
     V573GeometryFixture(1)
     for choice in [1,2,1,2] {
         IPM.AutoControl.Value := choice, IPMHeightModeChanged()
         V48Assert(IPM.HeightControl.Enabled=(choice=2),"numeric height usable only in fixed mode")
     }
 }
 
 V573CheckSample(count)
 {
     snap := IPMCreateRaidPreview(count), seen := Map()
     V48Assert(snap.LayoutPreview && snap.State="LAYOUT PREVIEW" && IPMBadge(snap)="PREVIEW","sample identity explicit")
     V48Assert(snap.Actors.Length=count && snap.Raid.Threat.Length=count && snap.Raid.Health.Length=2,"bounded sample roster and multi-boss example")
     for a in snap.Actors {
         V48Assert(!seen.Has(a.Key) && InStr(a.Name,"Sample ")=1,"unique visibly synthetic names")
         seen[a.Key] := true
         V48Assert(IPEffectiveTotal(a)>=0 && a.Effective<a.Heal,"preview uses direct EHPS not raw HPS")
     }
     for kind in ["Damage","Heal","Taken"]
         V48Assert(IPMRank(snap.Actors,kind,24).Count=count,"every sample player visible as a contributor")
     V48Assert(IRRankThreat(snap.Raid.Threat).Count=count,"threat has full sample roster")
 }
 
 V573TestEightPreview()
 {
     V573CheckSample(8)
 }
 
 V573TestSixteenPreview()
 {
     V573CheckSample(16)
 }
 
 V573TestInvalidPreviewCount()
 {
     for n in [0,1,7,9,15,17,100000] {
         threw := false
         try IPMCreateRaidPreview(n)
         catch ValueError
             threw := true
         V48Assert(threw,"invalid preview size rejected before generating any rows")
     }
 }
 
 V573TestSampleObjectsIndependent()
 {
     a := IPMCreateRaidPreview(8), b := IPMCreateRaidPreview(8)
     a.Actors[1].Damage := 0
     V48Assert(a!=b && a.Actors!=b.Actors && b.Actors[1].Damage>0,"different preview snapshots never share mutable actor rows")
     V48Assert(!a.HasOwnProp("Segments") && !a.HasOwnProp("Rows") && !a.HasOwnProp("Events"),"preview is not a parser dataset")
 }
 
 V573TestPreviewGuardMatrix()
 {
     Loop 128 {
         f := A_Index-1, a := IPNewApp()
         a.Active := (f&1)!=0, a.Busy := (f&2)!=0, a.Rendering := (f&4)!=0
         a.ImportFile := f&8 ? {} : ""
         a.Queue := f&16 ? ["pending"] : [], a.Head := 1
         V48Assert(IPMPreviewCanStart(a,(f&32)!=0,(f&64)!=0)=(f=0),"active, busy, queued, reader, import and test work block preview")
     }
 }
 
 V573TestStoredDataAllowsPreview()
 {
     a := IPNewApp(), live := IPNewData(), offline := IPNewData()
     live.Lines := 50, offline.Lines := 100
     a.Live := live, a.Offline := offline
     V48Assert(IPMPreviewCanStart(a) && a.Live=live && a.Offline=offline,"stopped stored data is not a preview blocker or deleted")
 }
 
 V573TestPreviewSetIsolation()
 {
     V572Isolated(V573SetIsolationCase)
 }
 V573SetIsolationCase()
 {
     global IPM, IP, IrisBench, soundboardsEnabled
     live := V572SeedStopped(), off := IPNewData("retained offline"), IP.Offline := off
     IPM.Source := 2, IPM.Metric := "Heal", IPM.Wanted := false
     V48Assert(IPMPreviewSet(8) && IPMPreviewActive(IPM),"explicit preview enters edit display")
     V48Assert(IP.Live=live && IP.Offline=off && !IP.Active && live.Lines>0,"real live and offline datasets retained")
     V48Assert(IPM.Source=2 && IPM.Metric="Heal" && !IPM.Wanted,"source, tab and normal visibility retained")
     V48Assert(IrisBench.Active && !soundboardsEnabled && !IPM.TimerOn,"no audio/capture/timer start from isolated tests")
 }
 
 V573TestActiveParserRejectsPreview()
 {
     V572Isolated(V573ActiveRejectCase)
 }
 V573ActiveRejectCase()
 {
     global IPM, IP
     IP.Active := true, live := IPNewData(), IP.Live := live
     V48Assert(!IPMPreviewSet(8) && !IPMPreviewActive(IPM) && IP.Active && IP.Live=live,"preview cannot stop or hide an active parser")
 }
 
 V573TestDisabledDisplaysRejectPreview()
 {
     V572Isolated(V573DisabledRejectCase)
 }
 V573DisabledRejectCase()
 {
     global IPM
     IPM.Enabled := false
     V48Assert(!IPMPreviewSet(8) && !IPMPreviewActive(IPM) && !IPM.Editing,"no preview with disabled display master")
 }
 
 V573TestPreviewEndRestoresData()
 {
     V572Isolated(V573EndCase)
 }
 V573EndCase()
 {
     global IPM, IP
     live := V572SeedStopped(), IPM.Wanted := true
     V48Assert(IPMPreviewSet(8),"enter preview")
     IPM.LastSnapshot := IPM.PreviewSnapshot, IPM.Panels["Damage"].X := -500
     IPMEndRaidPreview()
     V48Assert(!IPMPreviewActive(IPM) && !IsObject(IPM.LastSnapshot) && !IPM.Editing,"end discards only sample cache and locks")
     V48Assert(IP.Live=live && !IP.Active && IPM.Wanted && IPM.Panels["Damage"].X=-500,"normal visibility, data and chosen location kept")
     V48Assert(IPMSnapshot(IPMResolve(IP,1)).State!="LAYOUT PREVIEW","actual source remains actual")
 }
 
 V573TestHideCancelsPreview()
 {
     V572Isolated(V573HideCase)
 }
 V573HideCase()
 {
     global IPM, IP
     live := V572SeedStopped(), IPM.Wanted := true
     IPMPreviewSet(16), IPMHide()
     V48Assert(!IPMPreviewActive(IPM) && !IPM.Wanted && !IPM.Editing && IP.Live=live,"hiding cancels preview without changing collected data")
 }
 
 V573TestPreviewNotPersisted()
 {
     V572Isolated(V573PersistenceCase)
 }
 V573PersistenceCase()
 {
     global IPM, SETTINGS_FILE
     IPMPreviewSet(16), IPM.Panels["Threat"].Width := 410, IPM.Panels["Threat"].AutoHeight := false
     IPM.ParserWarnRestart := false, IPMSaveSettings()
     V48Assert(IniRead(SETTINGS_FILE,"IrisParseDisplay","PreviewCount","missing")="missing","sample mode is never an INI preference")
     IPM := IPMNewState(), IPMLoadSettings()
     V48Assert(!IPMPreviewActive(IPM) && !IPM.Wanted && !IPM.Editing,"no preview restart on load")
     V48Assert(IPM.Panels["Threat"].Width=410 && !IPM.Panels["Threat"].AutoHeight && !IPM.ParserWarnRestart,"real geometry and warning opt-out still save")
 }
 
 V573TestRealWorkEndsPreview()
 {
     a := IPNewApp()
     V48Assert(!IPMPreviewMustEnd(a),"idle preview remains")
     a.Active := true
     V48Assert(IPMPreviewMustEnd(a),"desktop live start ends preview")
     a.Active := false, a.ImportFile := {}
     V48Assert(IPMPreviewMustEnd(a),"desktop import ends preview")
     a.ImportFile := "", a.Queue := ["queued"]
     V48Assert(IPMPreviewMustEnd(a),"real queued collection ends preview")
 }
 
 V573TestPreviewParserActionsBlocked()
 {
     V572Isolated(V573ParserGuardCase)
 }
 V573ParserGuardCase()
 {
     global IPM, IP
     live := V572SeedStopped()
     IPMPreviewSet(8), IPM.ParserWarnRestart := false
     plan := IPMParserOverlayPlan(IP,IPM,10000,0)
     V48Assert(plan.Action="" && plan.Text="Preview","preview never advertises live Start")
     for action in ["Start","Stop","Confirm"]
         V48Assert(!IPMParserRun(action) && IP.Live=live && !IP.Active,"stale header action cannot replace/stop real data")
     V48Assert(!IPMParserAllowed(IPM,"edit",true,true) && !IPMParserSurfaceNeeded(IPM,true,true),"no live parser input in sample windows")
 }
 
 V573TestWarningConsentCleared()
 {
     V572Isolated(V573ConsentCase)
 }
 V573ConsentCase()
 {
     global IPM, IP
     live := V572SeedStopped(), IPM.ParserWarnRestart := true
     IPMParserRun("Start")
     V48Assert(IsObject(IPM.ParserRestart),"old stopped data starts with pending warning")
     IPMPreviewSet(8)
     V48Assert(!IsObject(IPM.ParserRestart) && IPM.ParserWarnRestart && IP.Live=live,"preview clears stale consent, keeps warning choice and data")
 }
 
 V573TestHiddenRaidRendering()
 {
     V572Isolated(V573HiddenRaidCase)
 }
 V573HiddenRaidCase()
 {
     global IPM
     IPM.Mode := 3, IPM.MaxRows := 16
     for kind in ["Damage","Heal","Taken"] {
         p := IPM.Panels[kind]
         IPMEnsureGui(kind,0,p)
         IPMRender(kind,IPMCreateRaidPreview(16),p)
         V48Assert(p.VisibleRows=Min(16,p.Layout.N) && p.HeaderStatus="Preview" && InStr(p.Heading.Text,"(Preview)"),"actual raid renderer labels and draws sample rows")
         V48Assert(InStr(p.Rows[1].Name.Text,"Sample ")=1,"sample name visible")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"native diagnostics never expose preview windows")
     }
 }
 
 V573TestHiddenThreatBossRendering()
 {
     V572Isolated(V573HiddenExtrasCase)
 }
 V573HiddenExtrasCase()
 {
     global IPM
     IPM.MaxRows := 16, snap := IPMCreateRaidPreview(16)
     blocked := IPMPreviewPanel("BossHP",snap)
     V48Assert(!blocked.HasOwnProp("LayoutPreview") || !blocked.LayoutPreview,"encounter samples require explicit preview mode")
     V48Assert(IPMPreviewSet(16),"explicit preview enables the merged boss-health and mechanic examples")
     for kind in ["Threat","BossHP"] {
         p := IPM.Panels[kind]
         IPMEnsureGui(kind,0,p), IPMRender(kind,snap,p)
         want := kind="Threat" ? 16 : 4
         V48Assert(p.VisibleRows=Min(want,p.Layout.N) && p.HeaderStatus="Preview" && InStr(p.Heading.Text,"(Preview)"),"extra metrics use the same explicit preview and sizing")
         if kind="BossHP" {
             V48Assert(p.VisibleRows=4 && p.Rows[1].Name.Text="Sample Boss A" && p.Rows[2].Name.Text="Sample Boss B","both sample bosses remain visible above the merged mechanics")
             V48Assert(p.Rows[3].Name.Text="Izax shield" && p.Rows[3].Value.Text="~45%" && p.Rows[4].Name.Text="Next interrupt" && p.Rows[4].Value.Text="Sophie","shield and next-interrupt examples share the preview panel")
         }
         else
             V48Assert(p.Rows[1].Name.Text="Sample 01" && p.VisibleRows<=16 && snap.Raid.Threat.Length=16 && IPM.MaxRows=16,"threat keeps the requested sixteen-player preview and saved row cap")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"extra diagnostic windows remain hidden")
     }
 }
 
 V573TestHiddenPersonalRendering()
 {
     V572Isolated(V573HiddenPersonalCase)
 }
 V573HiddenPersonalCase()
 {
     global IPM
     IPM.PersonalKey := "@A real selected player#1", IPM.PreviewCount := 8
     snap := IPMCreateRaidPreview(8), p := IPM.Panel
     IPMEnsureGui("Personal",0,p), IPMRender("Personal",snap,p), IPMParserUpdate(p)
     V48Assert(p.Meta.Text="Sample 01" && p.ParserButton.Text="Preview" && p.ParserAction="","personal preview uses its synthetic identity, not a real-player guess")
     V48Assert(IPM.PersonalKey="@A real selected player#1" && p.Tabs.Count=4,"real personal selection and clickable tabs retained")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"personal preview test stays hidden")
 }
 
 V573TestPreviewRespectsRowCap()
 {
     V572Isolated(V573RowCapCase)
 }
 V573RowCapCase()
 {
     global IPM
     IPM.Mode := 3, IPM.MaxRows := 8, snap := IPMCreateRaidPreview(16), p := IPM.Panels["Damage"]
     IPMEnsureGui("Damage",0,p), IPMRender("Damage",snap,p)
     V48Assert(p.VisibleRows=Min(8,p.Layout.N) && p.Layout.RowCountText=p.VisibleRows " of 16 shown","preview makes eight-of-sixteen clipping explicit")
     V48Assert(p.Meta.Text=p.VisibleRows " of 16 shown" && V58ChildVisible(p.Meta),"the native overlay visibly discloses the clipped rows")
     V48Assert(IPM.MaxRows=8 && snap.Actors.Length=16,"preview never silently changes saved row limit or sample count")
 }
 ; v58 tests: manual-only, synthetic parser data and HIDDEN main-window controls.
 V58Isolated(action)
 {
     V572Isolated(V58IsolatedInner.Bind(action))
 }
 V58IsolatedInner(action)
 {
     global IP
     try action.Call()
     finally {
         if IsObject(IP.Gui)
             IP.Gui.Destroy()
         IP.Gui := ""
     }
 }
 V58Seed()
 {
     s := IPNewData("SYNTHETIC UI FIXTURE"), who := V51Source(), target := V51Target()
     V51Feed(s,0,"Enter",0,who,"=")
     V51Feed(s,1000,"Damage",1000,who,target,false,-1,"101")
     V51Feed(s,2000,"Damage",300,who,target,true,-1,"102")
     V51Feed(s,2000,"Damage",150,target,who)
     V51Feed(s,2000,"Heal",500,"@Healer#300|(0,0,0,0)|(1000/1000)",who,false,300,"103")
     return s
 }
 V58UseFixture()
 {
     global IP
     IP.Live := V58Seed(),IP.Selected := 1,IP.Actor := IPActor(V51Source()).Key
     IP.Follow := false,IP.View := "Live"
     IPRState().Mode := "pull"
     IPWBuild(),IPRefresh()
 }
 V58SelectTab(n)
 {
     u := IPWState(),u.Controls["Tabs"].Choose(IPWTabPosition(n))
     IPWTabChanged()
 }
 V58ChildVisible(c)
 {
     return (DllCall("User32\GetWindowLongW","Ptr",c.Hwnd,"Int",-16,"UInt") & 0x10000000)!=0
 }
 V58TestInertState()
 {
     s := IPWNewState()
     V48Assert(s.Tab=7 && s.Width=1220 && !s.Opened && s.EventRows.Length=0,"inert workspace defaults")
     V48Assert(s.Groups.Count=0 && s.Controls.Count=0,"no windows from state construction")
 }
 V58TestTabCatalogue()
 {
     t := IPWTabs()
     V48Assert(t.Length=13 && t[1]="Log Library" && t[2]="Raid" && t[3]="Progression" && t[IPWTabPosition(1)]="Overview" && t[IPWTabPosition(6)]="Combat Log" && t[IPWTabPosition(8)]="Analysis","native tab catalogue retains stable page identities with Progression beside Raid")
 }
 V58TestMetricRouting()
 {
     V48Assert(IPWMetric(2)="Damage" && IPWMetric(3)="EffectiveHeal" && IPWMetric(3,true)="Heal","healing defaults effective")
     V48Assert(IPWMetric(4)="Taken" && IPWMetric(5)="Received","incoming directions")
     for n in [0,1,6,7,8]
         V48Assert(IPWMetric(n)="","non-detail tabs do not invent a metric")
 }
 V58TestLayoutBounds()
 {
     for w in [980,1024,1220,1600,1920] {
         for h in [650,720,780,1080] {
             l := IPWLayout(w,h)
             V48Assert(l.Right+l.RightW=w-12 && l.InnerX+l.InnerW=w-24,"right margin")
             V48Assert(l.FightY+l.FightH<h-82 && l.BodyY+l.BodyH<h-42,"tables clear footer")
             V48Assert(l.OverviewTableH>=100 && l.InnerW>=664,"usable minimum content")
         }
     }
 }
 V58TestActorIdentity()
 {
     s := V58Seed(),key := IPActor(V51Source()).Key
     c := IPWActorChoices(s.Current,"",key)
     V48Assert(c.Key=key && c.Keys.Length=2,"owner selected by key, not damage ranking")
     c := IPWActorChoices(s.Current,"@Healer#300",key)
     V48Assert(c.Key="@Healer#300","explicit selection overrides owner")
 }
 V58TestMissingActor()
 {
     s := V58Seed(),c := IPWActorChoices(s.Current,"@Missing#999","")
     V48Assert(c.Choice>=1 && c.Keys.Length=2,"select an observed player; header does not claim this is me")
     c := IPWActorChoices("")
     V48Assert(c.Choice=0 && c.Key="","no fabricated player on empty data")
 }
 V58TestSummaryArithmetic()
 {
     s := V58Seed(),key := IPActor(V51Source()).Key,rows := IPWSummary(s.Current,key)
     V48Assert(rows[1].Total="1,300" && rows[1].Rate="650.0","damage uses existing totals/rate")
     V48Assert(rows[5].Total="150" && rows[5].Rate="75.0","taken uses existing totals/rate")
     V48Assert(rows[6].Total="500" && rows[6].Rate="250.0","received is explicitly raw")
 }
 V58TestEffectiveSummary()
 {
     s := V58Seed(),rows := IPWSummary(s.Current,"@Healer#300")
     V48Assert(rows[2].Total="300" && rows[2].Rate="150.0","direct effective rather than raw")
     V48Assert(rows[3].Total="60.0%","efficiency from effective/raw")
 }
 V58TestUnknownSummary()
 {
     s := V58Seed(),key := IPActor(V51Source()).Key
     s.Current.Totals[key].Heal := 500,s.Current.Totals[key].HealRecords := 1,s.Current.Totals[key].HealKnown := 0
     rows := IPWSummary(s.Current,key)
     V48Assert(rows[2].Total="--" && rows[3].Total="--","unknown effective does not become raw")
     rows := IPWSummary(s.Current,"@NoSuch#1")
     V48Assert(rows[1].Total="--","absent identity is not known zero")
 }
 V58TestThreatClock()
 {
     s := V58Seed(),seg := s.Current
     seg.Raid.LastThreatAt := 4500
     before := IRSnapshot({Segment:seg,State:"HISTORY"})
     V48Assert(IPWThreatDuration(seg)=before.ThreatDuration,"same live threat interval")
     seg.End := seg.Last
     after := IRSnapshot({Segment:seg,State:"HISTORY"})
     V48Assert(IPWThreatDuration(seg)=after.ThreatDuration,"same completed threat interval")
 }
 V58TestTargetTotals()
 {
     s := V58Seed(),key := IPActor(V51Source()).Key,targets := IPWTargets(s.Current,key)
     V48Assert(targets.Total=1300 && targets.Rows.Count=1,"target aggregation uses damage only")
     V48Assert(s.Current.Totals[key].Taken=150,"display does not mutate totals")
 }
 V58TestSameNameTargets()
 {
     s := V58Seed(),key := IPActor(V51Source()).Key
     V51Feed(s,2500,"Damage",45,V51Source(),"Example NPC {990000000000001}:10|(1,2,3,0)|(900/1000)")
     targets := IPWTargets(s.Current,key),names := Map()
     for _,r in targets.Rows
         names[r.Name] := true
     V48Assert(targets.Rows.Count=2 && names.Count=2 && targets.Total=1345,"same-named instances remain separate")
 }
 V58TestTopAbilityLimit()
 {
     rows := Map()
     Loop 12
         rows[A_Index] := {Name:"Ability " A_Index,Total:A_Index*100}
     top := IPWTopAbilities(rows)
     V48Assert(top.Length=6 && top[1].Total=1200 && top[6].Total=700,"bounded descending contribution bars")
     V48Assert(rows.Count=12,"input not sorted/mutated in place")
 }
 V58TestEventCopies()
 {
     s := V58Seed(),seg := s.Current,rows := IPWCaptureEvents(seg)
     V48Assert(rows.Length=seg.Events.Length && rows.Length>0,"copies retained events")
     old := seg.Events[1].Ability
     rows[1].Ability := "Changed only in copy"
     V48Assert(seg.Events[1].Ability=old,"event snapshot has independent values")
 }
 V58TestEventRingOrder()
 {
     s := V58Seed(),s.Current.EventCap := 3,s.Current.Events := [],s.Current.EventCount := 0,s.Current.EventNext := 1
     Loop 7
         V51Feed(s,3000+A_Index,"Damage",A_Index)
     rows := IPWCaptureEvents(s.Current)
     V48Assert(rows.Length=3 && rows[1].Amount=5 && rows[3].Amount=7,"ring snapshot remains chronological")
 }
 V58TestEventFilters()
 {
     ev := {SourceKey:"a",TargetKey:"b",Source:"Zoë",Target:"Boss",Kind:"Damage",Ability:"Flame Burst",Id:"101"}
     V48Assert(IPWEventMatches(ev,"a",false,"Damage","flame"),"case-insensitive text and actor")
     V48Assert(IPWEventMatches(ev,"b",false,"All events","101"),"target and ID")
     V48Assert(!IPWEventMatches(ev,"c",false,"All events",""),"other player filtered")
     V48Assert(!IPWEventMatches(ev,"a",false,"Heal",""),"kind filtered")
     V48Assert(IPWEventMatches(ev,"c",true,"All events","Zoë"),"all participants supports Unicode")
 }
 V58TestHiddenBuild()
 {
     V58Isolated(V58HiddenBuildCase)
 }
 V58HiddenBuildCase()
 {
     global IP,IPM,IrisBench,soundboardsEnabled
     IPWBuild(),IPRefresh()
     V48Assert(IsObject(IP.Gui) && !DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"build never displays a test window")
     V48Assert(!IP.Active && !IP.Timer && !IP.Visible,"no collection or polling started")
     V48Assert(!IPM.Wanted && IrisBench.Active && !soundboardsEnabled,"other systems preserved")
     V48Assert(IP.InfoText.Text="No fight selected" && InStr(IP.Subtitle.Text,"Press Parse"),"empty Raid home is informative: " IP.InfoText.Text " / " IP.Subtitle.Text)
 }
 V58TestHiddenTabs()
 {
     V58Isolated(V58HiddenTabsCase)
 }
 V58HiddenTabsCase()
 {
     global IP
     V58UseFixture(),u := IPWState()
     for n in [1,2,3,4,5,6,7] {
         V58SelectTab(n)
         V48Assert(!InStr(IP.Status,"error",false),"tab refresh did not fail: " n)
         V48Assert(V58ChildVisible(IP.AbilitiesLV)=(n>=2 && n<=5),"only detail tabs show ability table")
         V48Assert(V58ChildVisible(IP.PlayersLV)=(n=7),"raid table only in Raid")
         V48Assert(V58ChildVisible(u.Controls["Events"])=(n=6),"event table only in Combat Log")
     }
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"all test tabs remain hidden")
 }
 V58TestHiddenEffectiveTab()
 {
     V58Isolated(V58EffectiveTabCase)
 }
 V58EffectiveTabCase()
 {
     global IP
     V58UseFixture(),IP.Actor := "@Healer#300"
     V58SelectTab(3)
     V48Assert(IP.Metric="EffectiveHeal" && IP.AbilitiesLV.GetText(1,2)="300","effective default table")
     IP.MetricChoice.Choose(2),IPWHealingChanged()
     V48Assert(IP.Metric="Heal" && IP.AbilitiesLV.GetText(1,2)="500","raw remains explicit detail choice")
 }
 V58TestHiddenRaid()
 {
     V58Isolated(V58RaidCase)
 }
 V58RaidCase()
 {
     global IP
     V58UseFixture(),V58SelectTab(7)
     V48Assert(IP.PlayersLV.GetCount()=2 && IP.PlayersLV.GetText(1,3)="650.0","raid values use original rates")
     key := IP.PlayersLV.GetText(2,9)
     IPWRaidDetail(IP.PlayersLV,2)
     V48Assert(IP.Actor=key && IPWState().Tab=2,"double-click navigates by hidden identity key")
 }
 V58TestEventSnapshotFreeze()
 {
     V58Isolated(V58EventFreezeCase)
 }
 V58EventFreezeCase()
 {
     global IP
     V58UseFixture(),V58SelectTab(6),u := IPWState(),n := u.EventRows.Length
     V51Feed(IP.Live,3000,"Damage",23),IPRefresh()
     V48Assert(u.EventRows.Length=n,"event tab does not pretend its snapshot is live")
     IPWRecaptureEvents()
     V48Assert(u.EventRows.Length>n,"explicit refresh captures newly retained events")
     V48Assert(InStr(u.Controls["EventInfo"].Text,"Not the complete raw log"),"retention disclosure")
 }
 V58TestTabDataIsolation()
 {
     V58Isolated(V58TabIsolationCase)
 }
 V58TabIsolationCase()
 {
     global IP,IPM,NBOrder,NBRebounder
     V58UseFixture(),s := IP.Live,seg := s.Current
     before := IPCsvData(s,seg),state := IPM.Mode,order := ObjPtr(NBOrder),bounder := ObjPtr(NBRebounder)
     for n in [7,2,6,4,3,5,1]
         V58SelectTab(n)
     V48Assert(before=IPCsvData(s,seg) && IP.Live=s,"view changes do not alter parser results")
     V48Assert(IPM.Mode=state && ObjPtr(NBOrder)=order && ObjPtr(NBRebounder)=bounder,"overlay and callout identities untouched")
 }
 V58TestSavedLiveIndependence()
 {
     V58Isolated(V58SavedLiveCase)
 }
 V58SavedLiveCase()
 {
     global IP,IPM
     V58UseFixture(),live := IP.Live,IPM.Source := 1 ; explicitly test manual latest-live mode
     IP.Offline := V58Seed(),IP.Offline.Label := "Saved fixture",IP.Active := true
     IP.ViewChoice.Choose(2),IPChangeView()
     V48Assert(IP.View="Imported" && IP.Active && IP.Live=live,"reviewing saved data keeps live collection")
     V48Assert(IPM.Source=1 && InStr(IP.Footer.Text,"SAVED LOG"),"overlays keep independent latest-live choice")
 }
 V58TestWindowHideKeepsData()
 {
     V58Isolated(V58HideCase)
 }
 V58HideCase()
 {
     global IP
     V58UseFixture(),live := IP.Live,IP.Active := true
     IPHide()
     V48Assert(IP.Active && IP.Live=live && !IP.Visible,"Hide is not Stop")
 }
 V58TestWorkspacePreferences()
 {
     V58Isolated(V58PrefsCase)
 }
 V58PrefsCase()
 {
     global SETTINGS_FILE
     IniWrite("1440",SETTINGS_FILE,"IrisWorkspace","Width")
     IniWrite("860",SETTINGS_FILE,"IrisWorkspace","Height")
     IniWrite(1,SETTINGS_FILE,"IrisWorkspace","RaidHomeVersion")
     IniWrite("3",SETTINGS_FILE,"IrisWorkspace","Tab")
     IPWLoadPrefs(),u := IPWState()
     V48Assert(u.Width=1440 && u.Height=860 && u.Tab=3,"saved workspace dimensions and tab")
     IniWrite("invalid",SETTINGS_FILE,"IrisWorkspace","Width")
     IPWLoadPrefs()
     V48Assert(u.Width=1220,"invalid geometry fallback")
 }
 V58TestNoPrefsWriteInDiagnostics()
 {
     V58Isolated(V58NoWriteCase)
 }
 V58NoWriteCase()
 {
     global SETTINGS_FILE
     IniWrite("keep",SETTINGS_FILE,"Unrelated","Value")
     before := FileRead(SETTINGS_FILE)
     IPWState(),IPWSavePrefs()
     V48Assert(FileRead(SETTINGS_FILE)=before,"self-test cannot persist main-window preferences")
 }
 V58TestResizeKeepsSelections()
 {
     V58Isolated(V58ResizeCase)
 }
 V58ResizeCase()
 {
     global IP
     V58UseFixture(),V58SelectTab(3),actor := IP.Actor
     for size in [[980,650],[1220,780],[1600,1000]]
         IPResize(IP.Gui,0,size[1],size[2])
     V48Assert(IP.Actor=actor && IPWState().Tab=3 && IP.Selected=1,"resizing does not select fights/players")
     V48Assert(!InStr(IP.Status,"error",false),"layout resize succeeds")
 }
 V58TestMinimizeKeepsGeometry()
 {
     V58Isolated(V58MinimizeCase)
 }
 V58MinimizeCase()
 {
     global IP
     V58UseFixture(),u := IPWState(),w := u.Width,h := u.Height
     IPResize(IP.Gui,-1,0,0)
     V48Assert(u.Width=w && u.Height=h,"minimize not saved as zero size")
 }
 V58TestDropGuard()
 {
     V58Isolated(V58DropCase)
 }
 V58DropCase()
 {
     global IP
     V58UseFixture(),s := IP.Live,IP.Active := true
     IPWDropFiles(IP.Gui,"",[A_Temp "\missing-drop-" A_TickCount ".txt"],0,0)
     V48Assert(IP.Active && IP.Live=s && !IsObject(IP.ImportFile) && InStr(IP.Status,"No file was opened"),"invalid drag-drop preserves live collection")
     IP.Active := false
     IPWDropFiles(IP.Gui,"",["one.txt","two.txt"],0,0)
     V48Assert(!IsObject(IP.ImportFile) && InStr(IP.Status,"Drop one"),"multiple drops do not load arbitrary file")
 }
 V58TestPinnedFight()
 {
     V58Isolated(V58PinnedFightCase)
 }
 V58PinnedFightCase()
 {
     global IP
     V58UseFixture()
     V51Feed(IP.Live,2100,"Exit",0,V51Source(),"=")
     V51Feed(IP.Live,6000,"Enter",0,V51Source(),"=")
     V51Feed(IP.Live,7000,"Damage",42,V51Source(),"New target {990000000000002}:11")
     IP.Selected := 1,IP.Follow := false,IPRefresh()
     V48Assert(IP.Selected=1 && IP.SegmentsLV.GetCount()=2,"pinned history does not jump to latest")
     IP.FollowBox.Value := 1,IPSetFollow()
     V48Assert(IP.Selected=2,"explicit Follow returns to latest")
 }
 V58TestSortPersists()
 {
     V58Isolated(V58SortCase)
 }
 V58SortCase()
 {
     global IP
     V58UseFixture(),V58SelectTab(2)
     IPWSort("Abilities",IP.AbilitiesLV,2)
     V48Assert(IP.AbilitiesLV.GetText(1,2)="300","ascending user sort")
     IPWState().BreakdownSignature := "",IPRefresh()
     V48Assert(IP.AbilitiesLV.GetText(1,2)="300","refresh preserves chosen sort")
 }
 V58TestNoPhantomParse()
 {
     V58Isolated(V58NoPhantomCase)
 }
 V58NoPhantomCase()
 {
     global IP,IPM,IrisBench,soundboardsEnabled
     V58UseFixture()
     for i in [1,2,3,4,5,6,7]
         V58SelectTab(i)
     V48Assert(!IP.Active && !IP.Timer && IP.Queue.Length=0,"UI never starts parser or enqueues events")
     V48Assert(IrisBench.Active && !soundboardsEnabled && !IPM.Wanted,"capture/audio/display flags preserved")
 }
 V58TestClearStaleView()
 {
     V58Isolated(V58ClearCase)
 }
 V58ClearCase()
 {
     global IP
     V58UseFixture(),V58SelectTab(6)
     IP.Live := "",IPRefresh(),u := IPWState()
     V48Assert(IP.SegmentsLV.GetCount()=0 && IP.PlayersLV.GetCount()=0 && u.Controls["Events"].GetCount()=0,"missing dataset clears old content")
     V48Assert(u.StatRows[1].Total.Text="--" && !IP.CopyButton.Enabled,"no stale totals/actions")
 }
 V58TestFilteredTargetRetention()
 {
     V58Isolated(V58FilterRetentionCase)
 }
 V58FilterRetentionCase()
 {
     global IP
     V58UseFixture(),V58SelectTab(2)
     IP.OtherChoice.Choose(2),IPChangeOther(),other := IP.Other
     V58SelectTab(3),V58SelectTab(2)
     V48Assert(other!="" && IP.Other=other,"returning to a metric keeps its target filter")
 }
 V58TestMainWarningPreserved()
 {
     V58Isolated(V58WarningCase)
 }
 V58WarningCase()
 {
     global IPM,IP
     V58UseFixture(),IPM.ParserWarnRestart := false
     for n in [7,3,1]
         V58SelectTab(n)
     V48Assert(!IPM.ParserWarnRestart,"workspace must not restore the unwanted warning")
     V48Assert(!IPMParserRestartRequired(IP,IPM),"existing restart opt-out still used")
 }
 ; These tests are extracted only by the existing explicit manual diagnostics.
 ; No live log, settings, network, audio or simulated gameplay input is used.
 V59Parsed(line,at := -1,seq := 1,accepted := true)
 {
     ev := IPParseLine(line)
     V48Assert(IsObject(ev),"synthetic line decodes")
     ev.Analysis := IAExtra(ev,line,at<0 ? ev.RawMs : at,seq)
     ev.Analysis.Accepted := accepted
     return ev
 }
 V59ExpectError(action)
 {
     caught := false
     try action.Call()
     catch Error
         caught := true
     V48Assert(caught,"invalid input is rejected explicitly")
 }
 V59EffectData(lines,start := 0,last := 10000)
 {
     d := {Start:start,Last:last,Rows:[],Seed:Map(),Effects:[],Credits:[],Unassigned:0}
     for i,line in lines
         d.Rows.Push(V59Parsed(line,-1,i))
     IAEffectsBuild(d),IAShieldsBuild(d)
     return d
 }
 V59TestInertState()
 {
     a := IAState()
     V48Assert(!IsObject(a.Gui) && !a.Busy && !IsObject(a.Work),"analysis opens only on an explicit action")
 }
 V59TestEmptySourceKey()
 {
     s := IPNewData(),seg := IPNewSegment(s,0,"synthetic")
     V48Assert(seg.SourcePath="" && !seg.HasOwnProp("AnalysisAccepted"),"normal segments without a source remain safe and uncaptured")
 }
 V59TestSourceMetadata()
 {
     s := IPNewData(),s.SourcePath := "C:\synthetic.txt",s.SourceEncoding := "UTF-8"
     seg := IPNewSegment(s,0,"synthetic")
     V48Assert(seg.SourcePath=s.SourcePath && seg.SourceEncoding="UTF-8","source metadata propagates without opening a file")
 }
 V59TestNoObserverOnNormalSession()
 {
     s := IPNewData()
     for line in IADemoLines()
         IPFeedLine(s,line)
     V48Assert(!s.Current.HasOwnProp("AnalysisAccepted"),"normal parser does not retain the new full-event journal")
 }
 V59TestPrivateJournal()
 {
     s := IPNewData(),w := IACaptureNew(0,2000),s.AnalysisCapture := w
     IPNewSegment(s,0,"journal test")
     ev := V59Parsed(IPDemoLine(1000,"@A#1","Target {900000000000001}:9","Damage",100),1000)
     IACaptureAccepted(s,s.Current,ev,1000)
     V48Assert(s.Current.AnalysisAccepted.Count=1,"private event membership recorded")
     IACaptureAccepted(s,s.Current,ev,1000)
     V48Assert(s.Current.AnalysisAccepted.Count=1,"same source record is not duplicated")
 }
 V59TestJournalRollback()
 {
     s := IPNewData(),s.AnalysisCapture := IACaptureNew(0,2000),seg := IPNewSegment(s,0,"journal")
     IPBBeginUndo(s,seg)
     ev := V59Parsed(IPDemoLine(1000,"@A#1","Target {900000000000001}:9","Damage",100),1000)
     IACaptureAccepted(s,seg,ev,1000),IPBRollbackTail(s,seg)
     V48Assert(seg.AnalysisAccepted.Count=0,"tail rollback removes speculative accepted membership")
 }
 V59TestDemoTotals()
 {
     d := IADemoData(),r := IAQuery(d,IANewQuery(d,"@Demo DPS#102"))
     V48Assert(r.D=30000 && r.Duration=20 && r.Casts=25,"complete demo DPS, time and activations")
     V48Assert(r.BossD=24000 && r.AddD=6000,"boss and add accounting partition the whole")
 }
 V59TestDemoHealing()
 {
     d := IADemoData(),r := IAQuery(d,IANewQuery(d,"@Demo Healer#103"))
     V48Assert(r.H=16000 && r.E=10000 && r.UnknownHeal=0,"raw and direct healing remain separate")
     V48Assert(r.AbsGiven=800,"supported pre-pull shield credited separately")
 }
 V59TestDemoTanking()
 {
     d := IADemoData(),r := IAQuery(d,IANewQuery(d,"@Demo Tank#101"))
     V48Assert(r.T=10600 && r.AbsTaken=800 && r.AbsTank=400,"tank stat absorption is not healer absorption")
     V48Assert(r.Shielded=1 && r.Hits=20,"outcome counts")
 }
 V59TestRangePartition()
 {
     d := IADemoData(),a := IAQuery(d,IANewQuery(d,"@Demo DPS#102",0,10)),b := IAQuery(d,IANewQuery(d,"@Demo DPS#102",10,20))
     V48Assert(a.D=9000 && b.D=21000 && a.D+b.D=30000,"adjacent ranges do not double count the shared timestamp")
 }
 V59TestInvalidRanges()
 {
     d := IADemoData()
     for pair in [[-1,2],[2,1],[0,21],[1,1]]
         V59ExpectError(IANewQuery.Bind(d,"",pair[1],pair[2]))
 }
 V59TestZeroDuration()
 {
     d := {Start:0,Last:0},q := IANewQuery(d),r := IANewResult(d,q)
     V48Assert(r.Duration=0 && IARate(100,0)="--","zero duration never divides by zero")
 }
 V59TestBucketConservation()
 {
     d := IADemoData(),q := IANewQuery(d,"@Demo DPS#102",0,20,"All targets",3),r := IAQuery(d,q)
     v := IAChartValues(r,q,1),sum := 0
     for b in v.Rows
         sum += b.Value*(b.End-b.Start)
     V48Assert(Abs(sum-r.D)<0.00001 && v.Rows[v.Rows.Length].End-v.Rows[v.Rows.Length].Start=2,"short final bucket uses its true duration")
 }
 V59TestUnknownCurve()
 {
     r := {Duration:2,Bins:Map(),UnknownHeal:1},q := {Bin:1}
     V48Assert(IAChartValues(r,q,3).Unknown && !IAChartValues(r,q,1).Unknown,"missing effective values suppress complete EHPS curve only")
 }
 V59TestBucketLimit()
 {
     V59ExpectError(IANewQuery.Bind({Start:0,Last:15000000},"",0,15000,"All targets",1))
 }
 V59TestEventRangeOrder()
 {
     d := {Start:0,Last:2000},q := IANewQuery(d,"",0,2),q.FirstSeq := 2,q.LastSeq := 3
     for i in [1,2,3,4] {
         ev := {Analysis:{At:1000,Seq:i,Accepted:true}}
         V48Assert(IAInRange(ev,q,d)=(i=2 || i=3),"same-time records retain explicit source order")
     }
 }
 V59TestFullMetricTail()
 {
     d := {Start:0,Last:1000},q := IANewQuery(d)
     ev := {Analysis:{At:1020,Seq:3,Accepted:true}}
     V48Assert(IAInRange(ev,q,d),"whole-fight review retains accepted metric-specific final records")
     q.Full := false
     V48Assert(!IAInRange(ev,q,d),"time subrange does not pretend a later event occurred earlier")
 }
 V59TestUnionOverlap()
 {
     V48Assert(IAUnion([[10,20],[0,15],[20,25],[30,40]])=35,"overlapping effect intervals are unioned")
     V48Assert(IAUnion([])=0 && IAOverlap(0,10,20,30)=0,"empty and disjoint intervals")
 }
 V59TestEffectRefresh()
 {
     d := IADemoData(),q := IANewQuery(d,"@Demo DPS#102"),r := IAQuery(d,q),found := false
     for e in r.Effects {
         if e.Id="990000000000021" {
             found := true
             V48Assert(e.Applications=2 && e.Refreshes=1 && e.ChargeUpdates=1 && e.MaxCharges=3,"applications, refreshes and charge changes distinct")
             V48Assert(e.Seconds=11 && e.Percent=55,"union uptime is clipped to fight")
         }
     }
     V48Assert(found,"effect row exists")
 }
 V59TestEffectRange()
 {
     d := IADemoData(),q := IANewQuery(d,"@Demo DPS#102",4,8),rows := IAEffectQuery(d,q)
     V48Assert(rows.Length=1 && rows[1].Seconds=4 && rows[1].Applications=0 && rows[1].ChargeUpdates=1,"active before range but only in-range counts")
 }
 V59TestEffectIdentity()
 {
     d := V59EffectData([IAEffectLine(1000,"@A#1","@T#3","Shared","11"),IAEffectLine(1000,"@B#2","@T#3","Shared","11"),
         IAEffectLine(4000,"@A#1","@T#3","Shared","11","remove"),IAEffectLine(6000,"@B#2","@T#3","Shared","11","remove")])
     V48Assert(d.Effects.Length=2,"same named effect from different casters stays separate")
 }
 V59TestMissingEffectEdges()
 {
     d := V59EffectData([IAEffectLine(1000,"@A#1","@T#3","Unknown start","11","remove"),IAEffectLine(2000,"@A#1","@T#3","Open end","12")])
     V48Assert(d.Effects.Length=2 && d.Effects[1].MissingStart && d.Effects[2].OpenEnd,"missing/open effect edges explicitly flagged")
 }
 V59TestSourceCaptureLimit()
 {
     w := IACaptureNew(0,1000,1),line := IPDemoLine(500,"@A#1","@B#2","Damage",1),ev := IPParseLine(line)
     IACaptureRaw(w,ev,line,500,1)
     V59ExpectError(IACaptureRaw.Bind(w,ev,line,500,2))
 }
 V59TestPrePullEffect()
 {
     w := IACaptureNew(1000,2000)
     line := IAEffectLine(0,"@A#1","@B#2","Static Barrier","3411286364782592"),ev := IPParseLine(line)
     IACaptureRaw(w,ev,line,0,1)
     line := IPDemoLine(1000,"@B#2","=","Enter"),ev := IPParseLine(line)
     IACaptureRaw(w,ev,line,1000,2)
     V48Assert(w.Seed.Count=1 && w.Rows.Length=1,"pre-pull active effect retained without counting pre-pull results")
 }
 V59TestAbsorbArithmetic()
 {
     ev := V59Parsed(IAAbsorbLine(1000,"NPC {99}:1","@T#1",1000,200,800))
     V48Assert(ev.Analysis.AbsMode="ability" && ev.Analysis.Abs=800,"matching explicit ability absorption")
     ev := V59Parsed(IAAbsorbLine(1000,"NPC {99}:1","@T#1",1000,200,799))
     V48Assert(ev.Analysis.AbsMode="ability","one-unit displayed rounding tolerance")
 }
 V59TestTankShieldNotHealing()
 {
     ev := V59Parsed(IAAbsorbLine(1000,"NPC {99}:1","@T#1",600,-1,400,true))
     V48Assert(ev.Analysis.AbsMode="tank" && ev.Analysis.Mit="Shield","shield-stat mitigation separated")
 }
 V59TestAmbiguousAbsorb()
 {
     ev := V59Parsed(IAAbsorbLine(1000,"NPC {99}:1","@T#1",1000,200,600))
     V48Assert(ev.Analysis.AbsMode="ambiguous","inconsistent components do not create a credit")
 }
 V59TestAbsorbSingleCandidate()
 {
     d := V59EffectData([IAEffectLine(0,"@H#1","@T#2","Static Barrier","3411286364782592"),IAAbsorbLine(1000,"NPC {99}:1","@T#2",1000,200,800)])
     V48Assert(d.Credits.Length=1 && d.Credits[1].Source="@H#1" && InStr(d.Credits[1].Confidence,"Inferred"),"one supported effect gives explicitly inferred source")
 }
 V59TestAbsorbOverlap()
 {
     d := V59EffectData([IAEffectLine(0,"@H#1","@T#2","Static Barrier","3411286364782592"),IAEffectLine(0,"@T#2","@T#2","Sonic Barrier","2308471907155968"),
         IAAbsorbLine(1000,"NPC {99}:1","@T#2",1000,200,800)])
     V48Assert(d.Credits[1].Source="" && d.Unassigned=800,"multiple supported sources remain unassigned")
 }
 V59TestAbsorbUnknownEffect()
 {
     d := V59EffectData([IAEffectLine(0,"@H#1","@T#2","Power Barrier","3394793690365952"),IAAbsorbLine(1000,"NPC {99}:1","@T#2",1000,200,800)])
     V48Assert(d.Credits[1].Source="","barrier-like name is not absorb evidence")
 }
 V59TestAdjacentRemovalCredit()
 {
     d := V59EffectData([IAEffectLine(0,"@H#1","@T#2","Static Barrier","3411286364782592"),IAEffectLine(1000,"@H#1","@T#2","Static Barrier","3411286364782592","remove"),
         IAAbsorbLine(1001,"NPC {99}:1","@T#2",1000,200,800)])
     V48Assert(d.Credits[1].Source="@H#1" && InStr(d.Credits[1].Confidence,"adjacent"),"narrow remove-before-damage association")
 }
 V59TestConsumedWitnessNotReused()
 {
     d := V59EffectData([IAEffectLine(0,"@H#1","@T#2","Static Barrier","3411286364782592"),IAEffectLine(1000,"@H#1","@T#2","Static Barrier","3411286364782592","remove"),
         IAAbsorbLine(1001,"NPC {99}:1","@T#2",1000,200,800),IAAbsorbLine(1002,"NPC {99}:1","@T#2",1000,200,800)])
     V48Assert(d.Credits[1].Source="@H#1" && d.Credits[2].Source="","consumed removal witness not recycled")
 }
 V59TestStaleRemovalRejected()
 {
     d := V59EffectData([IAEffectLine(0,"@H#1","@T#2","Static Barrier","3411286364782592"),IAEffectLine(1000,"@H#1","@T#2","Static Barrier","3411286364782592","remove"),
         IAAbsorbLine(1003,"NPC {99}:1","@T#2",1000,200,800)])
     V48Assert(d.Credits[1].Source="","stale removal does not assign a healer")
 }
 V59TestUnknownClassification()
 {
     d := IADemoData(),IAApplyMetadata(d,Map()),r := IAQuery(d,IANewQuery(d,"@Demo Tank#101"))
     V48Assert(r.Attacks.Has("Unknown") && r.Attacks["Unknown"]=r.T,"no attack-category guess from school or name")
     for ev in r.Rotation
         V48Assert(ev.Analysis.GCD="Unknown","no GCD guess from action gaps")
 }
 V59TestMetadataInput()
 {
     m := IAMetadataParse("ability_id`tattack_type`tgcd_class`tsource`n11`tTech`tOn-GCD`tsynthetic evidence")
     V48Assert(m.Count=1 && m["11"].Attack="Tech" && m["11"].Source="synthetic evidence","typed imported classification keeps provenance")
     V59ExpectError(IAMetadataParse.Bind("11`tTech`tOn-GCD`t"))
     V59ExpectError(IAMetadataParse.Bind("11`tSpace Magic`tOn-GCD`tS"))
     V59ExpectError(IAMetadataParse.Bind("11`tTech`tMaybe`tS"))
     V59ExpectError(IAMetadataParse.Bind("11`tTech`tOn-GCD`tS`n11`tTech`tOn-GCD`tS"))
 }
 V59TestMetadataNoExecution()
 {
     V59ExpectError(IAMetadataParse.Bind("Run('evil')`tTech`tOff-GCD`tS"))
     m := IAMetadataParse("11`tUnknown`tUnknown`tLiteral notes: do not execute")
     V48Assert(m.Count=1,"metadata is data, not executed source")
 }
 V59TestRotationCycles()
 {
     d := IADemoData(),q := IANewQuery(d,"@Demo DPS#102"),r := IAQuery(d,q),cycles := IACycles(d,q,r,"990000000000011")
     V48Assert(cycles.Length=20 && cycles[1].Complete && !cycles[20].Complete,"anchor-to-anchor cycles plus marked final partial")
     total := 0
     for c in cycles
         total += c.Damage
     V48Assert(total=30000 && cycles[20].End=cycles[20].Start,"final-time hit stays in zero-duration final partial without dividing by zero")
 }
 V59TestAbsentAnchor()
 {
     d := IADemoData(),q := IANewQuery(d,"@Demo DPS#102"),r := IAQuery(d,q)
     V48Assert(IACycles(d,q,r,"999999").Length=0,"missing anchor does not fabricate a rotation")
 }
 V59TestTargetScope()
 {
     d := IADemoData(),r := IAQuery(d,IANewQuery(d,"@Demo DPS#102",0,20,"Bosses"))
     V48Assert(r.D=24000 && r.Duration=20,"boss filter does not shorten denominator")
     r := IAQuery(d,IANewQuery(d,"@Demo DPS#102",0,20,"Adds"))
     V48Assert(r.D=6000,"explicit add scope")
 }
 V59TestTargetOverrideLocal()
 {
     d := IADemoData(),before := d.Totals["@Demo DPS#102"].Damage
     for key,cls in d.TargetClasses {
         if cls="Add"
             d.TargetClasses[key] := "Unclassified"
     }
     r := IAQuery(d,IANewQuery(d,"@Demo DPS#102"))
     V48Assert(r.UnknownD=6000 && r.AddD=0 && d.Totals["@Demo DPS#102"].Damage=before,"review classification does not change parser totals")
 }
 V59TestSearchOr()
 {
     V48Assert(IAMatchText("Rapid Shots and heat","heal OR rapid"),"case-insensitive OR")
     V48Assert(!IAMatchText("Rapid Shots","Flame OR heal"),"nonmatching OR false")
     V48Assert(IAMatchText("text","") && IAMatchText("text OR","text OR "),"empty query and empty OR branch safe")
 }
 V59TestRawFilter()
 {
     ev := V59Parsed(IPDemoLine(1000,"@A#1","@B#2","Damage",10))
     j := {Search:"",Type:"Damage",Actor:"@A#1"}
     V48Assert(IARawMatches(ev,ev.Analysis.Raw,j),"actor and event match")
     j.Actor := "@Missing#99"
     V48Assert(!IARawMatches(ev,ev.Analysis.Raw,j),"other actor not included")
     j.Type := "Unparsed",j.Actor := ""
     V48Assert(IARawMatches("","broken original record",j),"unparsed source retained in whole-file mode")
 }
 V59TestCSVProtection()
 {
     V48Assert(IACsvCell("=SUM(A1)")=Chr(34) "'=SUM(A1)" Chr(34),"CSV does not execute formula-like labels")
     V48Assert(IACsvCell(-123)=Chr(34) "-123" Chr(34),"negative numeric values remain numeric content")
     V48Assert(InStr(IACsvCell('a"b'),'""'),"quotes escaped")
 }
 V59TestFileSnapshot()
 {
     path := A_Temp "\iris_v59_" A_TickCount ".txt"
     try {
         f := FileOpen(path,"w","UTF-8-RAW"),f.Write("first`nsecond`npartial"),f.Close()
         s := IASnapshotFile(path,"UTF-8")
         V48Assert(s.End=13 && s.Length=20,"partial trailing line excluded from fixed snapshot")
         s.File.Close()
     }
     finally {
         if FileExist(path)
             FileDelete(path)
     }
 }
 V59TestNoCompleteLine()
 {
     path := A_Temp "\iris_v59_none_" A_TickCount ".txt"
     try {
         f := FileOpen(path,"w","UTF-8-RAW"),f.Write("partial"),f.Close()
         V59ExpectError(IASnapshotFile.Bind(path,"UTF-8"))
     }
     finally {
         if FileExist(path)
             FileDelete(path)
     }
 }
 V59TestMidnight()
 {
     c := IPNewData(),c.LastStamp := 86399500
     V48Assert(IPUnwrap(c,200)=86400200,"analysis raw browser uses inherited midnight unwrapping")
     d := {Start:86399000,Last:86402000},q := IANewQuery(d,"",1,3)
     V48Assert(q.From=86400000 && q.To=86402000,"selected seconds remain correct across midnight")
 }
 V59TestChartCoordinates()
 {
     r := {L:60,R:960}
     V48Assert(IAChartFraction(60,r)=0 && IAChartFraction(960,r)=1 && IAChartFraction(510,r)=0.5,"graph mouse positions map to source interval")
     V48Assert(IAChartFraction(-200,r)=0 && IAChartFraction(1400,r)=1,"drag is clamped")
 }
 V59TestLeakyComparisonRejected()
 {
     d := IADemoData(),seg := {Totals:d.Totals},errors := IAEventTotalsCheck(d,seg)
     V48Assert(errors.Length=0,"all contribution streams reconcile before display")
     for ev in d.Rows {
         if ev.Analysis.D>0 {
             ev.Analysis.D += 1
             break
         }
     }
     V48Assert(IAEventTotalsCheck(d,seg).Length>0,"missing or duplicated contributions block trusted analysis")
 }
 V59TestZeroUnknownEffectNotInvented()
 {
     d := V59EffectData([IAEffectLine(5000,"@A#1","@T#2","Missing","99","remove")])
     q := {From:0,To:10000,Actor:"@T#2",EffectDirection:"Received",Full:true,FirstSeq:0,LastSeq:0}
     r := IAEffectQuery(d,q)
     V48Assert(r.Length=1 && r[1].Seconds=0 && r[1].Partial,"orphan removal does not fabricate pre-pull uptime")
 }
 V59Hidden(action)
 {
     V58Isolated(V59HiddenInner.Bind(action))
 }
 V59HiddenInner(action)
 {
     try {
         IAOpen(true)
         action.Call()
     }
     finally IACleanup()
 }
 V59TestHiddenAnalysisWindow()
 {
     V59Hidden(V59WindowCase)
 }
 V59WindowCase()
 {
     a := IAState()
     V48Assert(IsObject(a.Gui) && !a.Visible && !DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd),"test window stays physically hidden")
     expected := ["AddPeople","Adds","Buckets","ConsumableUses","Consumables","Cycles","Damage","Effects","Healing","Log","Rotation","Shields","TankSummary","Tanking","Targets"]
     V48Assert(a.Tables.Count=expected.Length && a.Groups.Count=9,"all current analysis tables and tab groups are constructed")
     for key in expected
         V48Assert(a.Tables.Has(key) && a.Tables[key].Gui=a.Gui,"analysis table belongs to its hidden window: " key)
 }
 V59TestHiddenDemoRendering()
 {
     V59Hidden(V59RenderCase)
 }
 V59RenderCase()
 {
     a := IAState(),a.Data := IADemoData(),a.Query := IANewQuery(a.Data,"@Demo DPS#102")
     a.Result := IAQuery(a.Data,a.Query),a.Selected := a.Query.Actor
     IARender(false)
     V48Assert(a.Tables["Targets"].GetCount()=2 && a.Tables["Rotation"].GetCount()=25,"native tables render actual demo rows")
     V48Assert(a.Controls["Summary"].GetText(2,2)="30,000","left summary retains expected full total")
 }
 V59TestHiddenNativeChart()
 {
     V59Hidden(V59ChartCase)
 }
 V59ChartCase()
 {
     a := IAState(),a.Data := IADemoData(),a.Query := IANewQuery(a.Data,"@Demo DPS#102")
     a.Result := IAQuery(a.Data,a.Query),a.Tab := 1
     IAChartChanged()
     V48Assert(IsObject(a.ChartRect) && a.ChartRect.R>a.ChartRect.L,"hidden GDI chart has usable plot geometry")
     ; Picture.Value returns the original filename, which is empty here.
     ; Test the attached native bitmap instead, and reject missing/invalid images.
     info := V595BitmapInfo(a.Controls["Chart"])
     V48Assert(info.Handle!=0 && info.Type=7 && info.Bytes>0,"native bitmap set on picture control")
     V48Assert(info.Width>0 && info.Height>0,"native chart bitmap has usable dimensions")
 }
 V59TestHiddenGeometry()
 {
     V59Hidden(V59GeometryCase)
 }
 V59GeometryCase()
 {
     a := IAState()
     for w in [1020,1220,1600] {
         for h in [700,780,1000] {
             IAResize(a.Gui,0,w,h)
             a.Controls["LogNext"].GetPos(&x,&y,&cw,&ch)
             V48Assert(x+cw<=w-12 && y+ch<h-46,"search controls remain inside client layout")
             a.Controls["RawDetail"].GetPos(&x,&y,&cw,&ch)
             V48Assert(y+ch<=h-90,"raw detail clears action/footer rows")
         }
     }
 }
 V59TestHiddenTabs()
 {
     V59Hidden(V59TabsCase)
 }
 V59TabsCase()
 {
     a := IAState()
     Loop 7 {
         ; Inner For loops have their own A_Index. Preserve the selected tab.
         selected := A_Index
         V7826SelectReviewPage(selected)
         for group,controls in a.Groups {
             for c in controls
                 V48Assert(V58ChildVisible(c)=(group=selected),"only selected analysis group marked visible; tab=" selected " group=" group)
         }
     }
 }
 V59TestSortNumeric()
 {
     rows := [["a","9,500"],["b","12,000"],["c","2"]]
     V48Assert(IASortCompare(rows,2,false,"1","2",0)<0 && IASortCompare(rows,2,true,"1","3",0)<0,"formatted totals sort numerically")
 }
 V59TestNoMainMutation()
 {
     V58Isolated(V59MainMutationCase)
 }
 V59MainMutationCase()
 {
     global IP
     before := IP.Live,offline := IP.Offline,active := IP.Active
     d := IADemoData(),IAQuery(d,IANewQuery(d,"@Demo DPS#102",3,12))
     V48Assert(IP.Live=before && IP.Offline=offline && IP.Active=active,"analysis replay and ranges do not replace main datasets or active state")
 }
 V59TestPrePullRefreshFreshness()
 {
     w := IACaptureNew(41000,42000)
     for i,at in [0,40000] {
         line := IAEffectLine(at,"@H#1","@T#2","Static Barrier","3411286364782592")
         IACaptureRaw(w,IPParseLine(line),line,at,i)
     }
     line := IPDemoLine(41000,"@T#2","=","Enter")
     IACaptureRaw(w,IPParseLine(line),line,41000,3)
     for key,ev in w.Seed
         V48Assert(ev.Analysis.At=0 && ev.Analysis.EffectLastAt=40000,"uptime start and last shield refresh are distinct")
 }
 V59TestPrePullDeathClearsEffect()
 {
     w := IACaptureNew(2000,3000)
     for i,line in [IAEffectLine(0,"@H#1","@T#2","Static Barrier","3411286364782592"),IPDemoLine(1000,"@T#2","=","Death"),IPDemoLine(2000,"@T#2","=","Enter")]
         IACaptureRaw(w,IPParseLine(line),line,(i-1)*1000,i)
     V48Assert(w.Seed.Count=0,"an effect on the previous dead life is not seeded into the new pull")
 }
 V59TestChargePeakClippedToRange()
 {
     d := IADemoData(),q := IANewQuery(d,"@Demo DPS#102",3,4),r := IAEffectQuery(d,q)
     V48Assert(r.Length=1 && r[1].MaxCharges=-1,"future charge peak is not copied into an earlier range")
     q := IANewQuery(d,"@Demo DPS#102",6,8),r := IAEffectQuery(d,q)
     V48Assert(r.Length=1 && r[1].MaxCharges=3 && r[1].ChargeUpdates=0,"known charge state at range start retained without a fake new update")
 }
 V59TestBackwardCycleRejected()
 {
     d := IADemoData(),q := IANewQuery(d,"@Demo DPS#102"),r := IAQuery(d,q)
     r.Rotation[2].Analysis.At := r.Rotation[1].Analysis.At-1
     V59ExpectError(IACycles.Bind(d,q,r,"990000000000011"))
 }
 V59TestAuxiliaryExportSelection()
 {
     IAFocusedTable("Shields")
     V48Assert(IAState().ExportTable="Shields","auxiliary table can be selected for export")
 }
 ; v59.1 manual-only tests. Windows controls remain hidden throughout.
 V591Isolated(action)
 {
     global Audio
     oldAudio := Audio
     try {
         ; Review fixtures start with independent transient audio state, just
         ; as V58/V522 supply an independent parser. Never clear outer queues.
         Audio := Audio.Clone(),Audio.Queue := [],Audio.Current := "",Audio.Http := ""
         Audio.Events := Map(),Audio.LastAccepted := Map()
         Audio.Busy := false,Audio.Fault := "",Audio.Paused := false
         Audio.NetFailures := 0,Audio.RetryAt := 0,Audio.PollAt := 0
         V58Isolated(V591Inner.Bind(action))
     }
     finally Audio := oldAudio
 }
 V591Inner(action)
 {
     a := IAState()
     IACleanup(),a.Data := "",a.Query := "",a.Result := "",a.Brush := "",a.Tab := 1
     try action.Call()
     finally IACleanup()
 }
 V591Ready()
 {
     V58UseFixture()
     V58SelectTab(8)
 }
 V591Data()
 {
     a := IAState(),a.Data := IADemoData(),a.Selected := "@Demo DPS#102"
     a.Query := IANewQuery(a.Data,a.Selected,3,12)
     a.Result := IAQuery(a.Data,a.Query)
     IARender(false)
     return a
 }
 V591TestCatalogue()
 {
     t := IPWTabs(),at := IAEmbeddedTabs()
     V48Assert(t.Length=13 && t[1]="Log Library" && t[2]="Raid" && t[3]="Progression" && t[IPWTabPosition(8)]="Analysis","Library first; detailed Analysis remains available")
     V48Assert(at.Length=5 && at[1]="Charts" && at[2]="Effects" && at[3]="Summary","review tabs and relocated summary remain discoverable")
 }
 V591TestSavedAnalysisTab()
 {
     V591Isolated(V591PrefsCase)
 }
 V591PrefsCase()
 {
     global SETTINGS_FILE
     IniWrite(1,SETTINGS_FILE,"IrisWorkspace","RaidHomeVersion")
     IniWrite(8,SETTINGS_FILE,"IrisWorkspace","Tab")
     IPWLoadPrefs()
     V48Assert(IPWState().Tab=8,"eighth tab can be restored")
     IniWrite(7,SETTINGS_FILE,"IrisWorkspace","Tab")
     IPWLoadPrefs()
     V48Assert(IPWState().Tab=7,"existing Raid preference retains its index")
 }
 V591TestHostRectangle()
 {
     for w in [980,1024,1220,1600,1920] {
         for h in [650,720,780,1080] {
             l := IPWLayout(w,h),r := IPWAnalysisRect(l)
             V48Assert(r.X=l.InnerX && r.Y=l.ContentY && r.W=l.InnerW,"host uses actual content rectangle")
             V48Assert(r.X+r.W=w-24 && r.Y+r.H=h-58,"host clears main tabs and footer")
         }
     }
 }
 V591TestLayoutBounds()
 {
     for w in [664,708,904,1284,1604] {
         for h in [428,498,558,758,858] {
             l := IAEmbeddedLayout(w,h)
             for name,r in l.Rects
                 V48Assert(r[1]>=0 && r[2]>=0 && r[3]>0 && r[4]>=0 && r[1]+r[3]<=w && r[2]+r[4]<=h,"embedded control stays inside host: " name)
             for name in ["Buckets","Damage","Targets","Healing","Shields","Effects","Tanking","Rotation","Log"]
                 V48Assert(l.Rects[name][4]>=40,"scrollable table remains usable: " name)
         }
     }
 }
 V591TestChartLayout()
 {
     l := IAEmbeddedLayout(664,428),r := l.Rects
     V48Assert(r["Chart"][2]+r["Chart"][4]<r["ChartInfo"][2],"chart clears its explanation")
     V48Assert(r["ChartInfo"][2]+r["ChartInfo"][4]<r["Buckets"][2],"bucket table clears graph note")
     V48Assert(r["Buckets"][2]+r["Buckets"][4]<r["Status"][2],"table clears status")
 }
 V591TestSummaryLayout()
 {
     for size in [[664,428],[904,558]] {
         r := IAEmbeddedLayout(size[1],size[2]).Rects
         V48Assert(r["Summary"][1]+r["Summary"][3]<r["Coverage"][1],"summary and source provenance separated")
         V48Assert(r["Source"][2]+r["Source"][4]<r["Copy"][2],"source label does not collide with actions")
         V48Assert(r["Copy"][2]+r["Copy"][4]<r["Export"][2],"copy and export separated")
     }
 }
 V591TestLazyConstruction()
 {
     V591Isolated(V591LazyCase)
 }
 V591LazyCase()
 {
     V58UseFixture()
     V48Assert(!IsObject(IAState().Gui),"ordinary main tabs do not construct the analysis view")
     V58SelectTab(8)
     V48Assert(IsObject(IAState().Gui),"explicit eighth tab builds the view")
 }
 V591TestChildHost()
 {
     V591Isolated(V591HostCase)
 }
 V591HostCase()
 {
     global IP
     V591Ready(),a := IAState()
     V48Assert(a.Parent=IP.Gui.Hwnd && DllCall("User32\GetParent","Ptr",a.Gui.Hwnd,"Ptr")=IP.Gui.Hwnd,"actual child belongs to main parser")
     style := DllCall("User32\GetWindowLongW","Ptr",a.Gui.Hwnd,"Int",-16,"UInt")
     V48Assert((style&0x40000000)!=0 && (style&0x80000000)=0 && (style&0x00C00000)=0,"embedded child is not a captioned popup")
     V48Assert(DllCall("User32\GetMenu","Ptr",a.Gui.Hwnd,"Ptr")=0,"child has no separate desktop menu bar")
 }
 V591TestHiddenConstruction()
 {
     V591Isolated(V591HiddenCase)
 }
 V591HiddenCase()
 {
     global IP
     V591Ready(),a := IAState()
     V48Assert(!a.Visible && !IP.Visible,"manual diagnostics do not expose either GUI")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd) && !DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd),"actual windows stay hidden")
 }
 V591TestSingleInstance()
 {
     V591Isolated(V591SingleCase)
 }
 V591SingleCase()
 {
     V591Ready(),a := IAState(),hwnd := a.Gui.Hwnd
     Loop 3 {
         V58SelectTab(7),V58SelectTab(8)
         V48Assert(a.Gui.Hwnd=hwnd,"tab switches reuse one analysis view")
     }
 }
 V591TestMainSelectionPreserved()
 {
     V591Isolated(V591SelectionCase)
 }
 V591SelectionCase()
 {
     global IP,IPM,NBOrder,NBRebounder
     V58UseFixture(),data := IP.Live,seg := IPSelectedSegment(),actor := IP.Actor,selected := IP.Selected
     csv := IPCsvData(data,seg),source := IPM.Source,order := NBOrder,bounder := NBRebounder
     V58SelectTab(8),V58SelectTab(7)
     V48Assert(IP.Live=data && IP.Selected=selected && IP.Actor=actor && IPCsvData(data,seg)=csv,"main fight and player preserved")
     V48Assert(IPM.Source=source && NBOrder=order && NBRebounder=bounder,"overlay and callout identities untouched")
 }
 V591TestReviewRangeRetained()
 {
     V591Isolated(V591RangeCase)
 }
 V591RangeCase()
 {
     V591Ready(),a := V591Data(),d := a.Data,q := a.Query,r := a.Result
     V58SelectTab(7),V58SelectTab(2),V58SelectTab(8)
     V48Assert(a.Data=d && a.Query=q && a.Result=r && a.Selected="@Demo DPS#102","frozen review and player remain the same")
     V48Assert(q.From=d.Start+3000 && q.To=d.Start+12000,"selected interval is not reset by navigation")
 }
 V591TestEmbeddedPages()
 {
     V591Isolated(V591PagesCase)
 }
 V591PagesCase()
 {
     V591Ready(),a := IAState()
     Loop 8 {
         n := A_Index,V7826SelectReviewPage(n)
         for group,controls in a.Groups {
             for c in controls {
                 if c=a.Controls["ClassNote"]
                     continue
                 V48Assert(V58ChildVisible(c)=(group=n),"only active review group marked visible")
             }
         }
         V48Assert(V58ChildVisible(a.Controls["Summary"])=(n=8),"summary has an explicit page")
         V48Assert(!V58ChildVisible(a.Controls["Title"]),"duplicate desktop title stays hidden")
     }
 }
 V591TestSummaryValues()
 {
     V591Isolated(V591SummaryCase)
 }
 V591SummaryCase()
 {
     V591Ready(),a := V591Data(),V7826SelectReviewPage(8)
     V48Assert(a.Controls["Summary"].GetCount()=14,"complete original range-summary metrics retained")
     V48Assert(a.Controls["Summary"].GetText(1,2)="9.000 s","summary uses the selected interval")
     V48Assert(V58ChildVisible(a.Controls["Copy"]) && V58ChildVisible(a.Controls["Export"]),"summary actions remain visible")
 }
 V591TestNativeGeometry()
 {
     V591Isolated(V591GeometryCase)
 }
 V591GeometryCase()
 {
     global IP
     V591Ready(),a := IAState()
     for size in [[980,650],[1220,780],[1600,1000]] {
         IPResize(IP.Gui,0,size[1],size[2]),r := IPWAnalysisRect(IPWState().Layout)
         a.Gui.GetClientPos(,,&cw,&ch)
         V48Assert(Abs(cw-r.W)<=1 && Abs(ch-r.H)<=1,"native child dimensions follow main workspace / DPI")
         a.Controls["LogNext"].GetPos(&x,&y,&w,&h)
         V48Assert(x+w<=r.W && y+h<r.H-36,"raw browser navigation fits host")
         V48Assert(!InStr(a.LastStatus,"layout:",false),"no native layout error")
     }
 }
 V591TestOpenDoesNotLoad()
 {
     V591Isolated(V591NoLoadCase)
 }
 V591NoLoadCase()
 {
     global IP
     V591Ready(),a := IAState()
     V48Assert(!IP.Active && !a.Busy && !IsObject(a.Work) && !IsObject(a.QueryJob) && !IsObject(a.RawJob),"opening the tab is not a replay, import or parse command")
 }
 V591TestActiveHostSelection()
 {
     V48Assert(IAActiveWindow({Parent:123,Gui:""})=123,"graph uses the top-level host for foreground checking")
     V48Assert(IAActiveWindow({Parent:0,Gui:{Hwnd:456}})=456,"legacy hidden standalone test still uses its own GUI")
 }
 V591TestHideReleasesBrush()
 {
     V591Isolated(V591BrushCase)
 }
 V591BrushCase()
 {
     V591Ready(),a := V591Data(),q := a.Query
     a.Brush := {Start:0.1,Last:0.5}
     V58SelectTab(7)
     V48Assert(!IsObject(a.Brush) && a.Query=q,"leaving page cancels unfinished graph drag without changing range")
 }
 V591TestContextLabels()
 {
     data := {Demo:false,Path:"C:\example.log",Start:10,Last:20}
     seg := {SourcePath:"C:\example.log",Start:10,Last:20}
     V48Assert(InStr(IAContextText(data,seg),"selected fight"),"same-source review identified")
     seg.Start := 11
     V48Assert(InStr(IAContextText(data,seg),"Different fight"),"changed selection does not relabel an old review")
     V48Assert(InStr(IAContextText({Demo:true},seg),"SYNTHETIC"),"demo cannot masquerade as current real fight")
     V48Assert(InStr(IAContextText("",seg),"Analyze selected fight"),"empty state gives visible next action")
 }
 V591TestCloseReturnsRaid()
 {
     V591Isolated(V591CloseCase)
 }
 V591CloseCase()
 {
     V591Ready(),a := V591Data(),data := a.Data,result := a.Result
     IAClose()
     V48Assert(IPWState().Tab=7 && !a.Visible,"close returns to Raid rather than leaving an empty selected page")
     V48Assert(a.Data=data && a.Result=result,"last completed review is retained")
 }
 V591TestHideMainPreservesReview()
 {
     V591Isolated(V591HideCase)
 }
 V591HideCase()
 {
     global IP
     V591Ready(),a := V591Data(),data := a.Data,result := a.Result,live := IP.Live
     IPHide()
     V48Assert(!a.Visible && a.Data=data && a.Result=result && IP.Live=live,"hiding main window preserves both datasets")
 }
 V591TestMenuRoutesToTab()
 {
     V591Isolated(V591MenuCase)
 }
 V591MenuCase()
 {
     V58UseFixture(),IPWAnalysisOpen(),a := IAState(),hwnd := a.Gui.Hwnd
     V48Assert(IPWState().Tab=8,"existing menu destination selects new Analysis tab")
     V58SelectTab(7),IAOpen()
     V48Assert(IPWState().Tab=8 && a.Gui.Hwnd=hwnd,"public analysis open reuses same embedded view")
 }
 V591TestLiveGuardRetained()
 {
     V591Isolated(V591GuardCase)
 }
 V591GuardCase()
 {
     global IP
     V591Ready(),IP.Live.Label := "Unavailable analysis source fixture",IP.Active := true,IAOpenSelected(),a := IAState()
     V48Assert(IP.Active && !IsObject(a.Work) && !a.Busy,"invalid selected source does not stop live collection or invent analysis")
     V48Assert(InStr(a.LastStatus,"Select a completed fight"),"an incomplete fight is rejected before live collection stops")
     IPSelectedSegment().End := IPSelectedSegment().Last
     IAOpenSelected()
     V48Assert(IP.Active && !IsObject(a.Work) && !a.Busy,"a completed fight without a source also leaves live collection intact")
     V48Assert(InStr(a.LastStatus,"original source file is unavailable"),"source validation explains why analysis did not start")
 }
 V591TestSummaryExportSelection()
 {
     V591Isolated(V591ExportCase)
 }
 V591ExportCase()
 {
     V591Ready(),a := V591Data(),V7826SelectReviewPage(8)
     IAFocusedTable("Summary")
     V48Assert(a.ExportTable="Summary" && a.Controls["Summary"].GetCount()=14,"summary export target is a real populated table")
 }
 ; v59.2 manual-only display regression tests. The TOP-LEVEL parent stays hidden.
 ; These check real HWND stacking/initialization when run locally, not pixels.
 V592TopChild()
 {
     global IP
     return DllCall("User32\GetWindow","Ptr",IP.Gui.Hwnd,"UInt",5,"Ptr")=IAState().Gui.Hwnd
 }
 V592PresentHidden()
 {
     global IP
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"test parent must be hidden before presenting child")
     IAEmbeddedPresent()
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"test never exposes the parent")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IAState().Gui.Hwnd,"Int"),"child cannot appear through hidden parent")
 }
 V592TestInitialStacking()
 {
     V591Isolated(V592InitialCase)
 }
 V592InitialCase()
 {
     V591Ready()
     V48Assert(V592TopChild(),"embedded page is above the native main Tab3 background even before display")
 }
 V592TestObscuringSibling()
 {
     V591Isolated(V592CoverCase)
 }
 V592CoverCase()
 {
     global IP
     V591Ready(),a := IAState(),l := IPWState().Layout,r := IPWAnalysisRect(l)
     cover := IP.Gui.AddText("x" r.X " y" r.Y " w" r.W " h" r.H,"SYNTHETIC COVER")
     DllCall("User32\SetWindowPos","Ptr",cover.Hwnd,"Ptr",0,"Int",0,"Int",0,"Int",0,"Int",0,"UInt",0x13)
     V48Assert(!V592TopChild(),"counterexample places another native sibling over the embedded page")
     IPWAnalysisPlace(l)
     V48Assert(V592TopChild(),"placement repairs sibling stacking rather than retaining SWP_NOZORDER")
 }
 V592TestFirstShowSize()
 {
     V591Isolated(V592FirstShowCase)
 }
 V592FirstShowCase()
 {
     global IP
     V591Ready(),a := IAState()
     for size in [[980,650],[1220,780],[1600,1000]] {
         IPResize(IP.Gui,0,size[1],size[2]),r := IPWAnalysisRect(IPWState().Layout)
         V592PresentHidden()
         a.Gui.GetClientPos(,,&w,&h)
         V48Assert(Abs(w-r.W)<=1 && Abs(h-r.H)<=1,"first and later native Show preserve the intended child client size")
         a.Gui.Hide()
     }
 }
 V592TestEmptyToolbar()
 {
     V591Isolated(V592ToolbarCase)
 }
 V592ToolbarCase()
 {
     V591Ready(),a := IAState()
     V592PresentHidden()
     V48Assert(!IsObject(a.Data),"no loaded fight is needed to expose analysis controls")
     for name in ["Load","Demo","Browse","Tools","Player","Tabs","Context","Status"] {
         c := a.Controls[name]
         c.GetPos(&x,&y,&w,&h)
         V48Assert(V58ChildVisible(c),"empty toolbar/control remains marked visible: " name)
         V48Assert(x>=0 && y>=0 && x+w<=a.Width+1 && y+h<=a.Height+1,"empty toolbar/control fits client: " name)
     }
 }
 V592TestShowHideReuse()
 {
     V591Isolated(V592ReuseCase)
 }
 V592ReuseCase()
 {
     V591Ready(),a := IAState(),hwnd := a.Gui.Hwnd
     Loop 3 {
         V592PresentHidden(),a.Gui.Hide()
         V48Assert(a.Gui.Hwnd=hwnd,"hide/show does not destroy or rebuild the page")
     }
 }
 V592TestReturnToAnalysis()
 {
     V591Isolated(V592ReturnCase)
 }
 V592ReturnCase()
 {
     V591Ready()
     for n in [1,2,6,7] {
         V58SelectTab(n),V58SelectTab(8)
         V48Assert(V592TopChild(),"returning to Analysis restores native stacking after main-tab changes")
     }
 }
 V592TestResizeStacking()
 {
     V591Isolated(V592ResizeCase)
 }
 V592ResizeCase()
 {
     global IP
     V591Ready()
     for size in [[980,650],[1600,1000],[1220,780]] {
         IPResize(IP.Gui,0,size[1],size[2])
         V48Assert(V592TopChild(),"resizing keeps the analysis page above the main tab")
     }
 }
 V592TestNoActivation()
 {
     V591Isolated(V592NoActivationCase)
 }
 V592NoActivationCase()
 {
     V591Ready(),before := DllCall("User32\GetForegroundWindow","Ptr")
     V592PresentHidden()
     V48Assert(DllCall("User32\GetForegroundWindow","Ptr")=before,"presenting embedded page does not activate a new foreground window")
 }
 V592TestReviewPreserved()
 {
     V591Isolated(V592ReviewCase)
 }
 V592ReviewCase()
 {
     global IP
     V591Ready(),a := V591Data(),data := a.Data,q := a.Query,result := a.Result,live := IP.Live
     V592PresentHidden(),a.Gui.Hide(),V592PresentHidden()
     V48Assert(a.Data=data && a.Query=q && a.Result=result && IP.Live=live,"display repair preserves both datasets and range")
     V48Assert(q.From=data.Start+3000 && q.To=data.Start+12000,"display repair does not reset selected review interval")
 }
 V592TestManualSuiteStaysHidden()
 {
     V591Isolated(V592SuiteHiddenCase)
 }
 V592SuiteHiddenCase()
 {
     global IP
     V591Ready(),a := IAState()
     IPWAnalysisVisible(true)
     V48Assert(!IP.Visible && !a.Visible,"normal test entry still suppresses showing the page")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd,"Int"),"native suite remains hidden")
 }
 V592TestReportPrivacy()
 {
     V591Isolated(V592ReportCase)
 }
 V592ReportCase()
 {
     V591Ready(),a := V591Data()
     a.Controls["Source"].Text := "C:\PRIVATE_PLAYER_SENTINEL\private.log"
     text := IPWAnalysisDisplayReport()
     V48Assert(InStr(text,"Iris v0.78.112") && InStr(text,"highest sibling: 1"),"report describes actual display state")
     V48Assert(!InStr(text,"PRIVATE_PLAYER_SENTINEL") && !InStr(text,"Demo DPS"),"display report excludes path and player contents")
     V48Assert(InStr(text,"Load: visible=") && InStr(text,"Tabs: visible="),"report exposes toolbar/inner-tab native state")
 }
 V592TestNoImplicitAnalysis()
 {
     V591Isolated(V592NoWorkCase)
 }
 V592NoWorkCase()
 {
     global IP
     V591Ready(),a := IAState(),live := IP.Live
     V592PresentHidden(),text := IPWAnalysisDisplayReport()
     V48Assert(!IP.Active && !a.Busy && !IsObject(a.Work) && !IsObject(a.QueryJob) && !IsObject(a.RawJob),"show and report start no parsing or heavy analysis")
     V48Assert(IP.Live=live && !IsObject(a.Data),"empty review and live data unchanged")
 }
 ; v59.3 manual regressions. Real Gui/GuiControl objects, kept invisible.
 ; These tests are inert comment data until the user runs the diagnostic suite.
 V593NativePanel(kind := "Damage")
 {
     global IPM
     p := kind="Combined" ? IPM.Panel : IPM.Panels[kind]
     IPMEnsureGui(kind="Combined" ? "Personal" : kind,0,p)
     return p
 }
 
 V593ThrowHwnd(*)
 {
     throw Error("The control is destroyed.")
 }
 
 V593Poison()
 {
     obj := {}
     obj.DefineProp("Hwnd",{Get:V593ThrowHwnd})
     return obj
 }
 
 V593TestEmptyHandles()
 {
     for obj in ["",0,false,{}, {Hwnd:0}, {Hwnd:-1}, {Hwnd:"bad"}]
         V48Assert(IPMUiHandle(obj)=0,"absent or invalid handles are rejected")
     V48Assert(IPMUiHandle({Hwnd:17})=17,"pure ownership matching remains deterministic")
 }
 
 V593TestThrowingHandle()
 {
     V48Assert(IPMUiHandle(V593Poison())=0,"destroyed-control getter cannot escape")
 }
 
 V593TestNativeHandleLifetime()
 {
     g := Gui(),c := g.AddText(,"Lifetime probe")
     try {
         V48Assert(IPMGuiAlive(g) && IPMUiHandle(c)>0,"native window and control exist")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"probe is hidden")
         g.Destroy()
         V48Assert(IsObject(g) && IsObject(c),"objects survive native destruction")
         V48Assert(!IPMGuiAlive(g) && IPMUiHandle(c)=0,"dead references are not live controls")
     }
     finally IPMDisposeGui(g)
 }
 
 V593TestDeadButtonLookup()
 {
     p := IPMNewPanel(),g := Gui(),p.ParserButton := g.AddText(,"Start")
     h := p.ParserButton.Hwnd
     g.Destroy()
     V48Assert(!IPMParserIsButton(p,h) && IPMParserClickOrigin(p,h)="","dead body button is rejected")
 }
 
 V593TestDeadTabLookup()
 {
     p := IPMNewPanel(),g := Gui(),p.Tabs["Damage"] := g.AddText(,"DPS")
     h := p.Tabs["Damage"].Hwnd
     g.Destroy()
     V48Assert(!IPMIsTab(p,h) && IPMTabClickOrigin(p,"Damage",h)="","dead visual tab is rejected")
 }
 
 V593TestDeadParserSurfaceLookup()
 {
     p := IPMNewPanel(),p.ParserGui := Gui(),p.ParserHit := p.ParserGui.AddText(,"Start")
     root := p.ParserGui.Hwnd,child := p.ParserHit.Hwnd
     p.ParserGui.Destroy()
     V48Assert(!IPMParserSurfaceOwns(p,root) && !IPMParserSurfaceOwns(p,child),"dead owned input is rejected")
     V48Assert(IPMParserClickOrigin(p,child)="","dead locked hit cannot restart parsing")
     IPMParserHideSurface(p),IPMParserDestroySurface(p),IPMParserDestroySurface(p)
     V48Assert(!IsObject(p.ParserGui) && !IsObject(p.ParserHit),"surface cleanup is idempotent")
 }
 
 V593TestDeadTabSurfaceLookup()
 {
     p := IPMNewPanel(),p.TabGui := Gui(),p.TabButtons["Damage"] := p.TabGui.AddText(,"DPS")
     root := p.TabGui.Hwnd,child := p.TabButtons["Damage"].Hwnd
     p.TabGui.Destroy()
     V48Assert(!IPMTabSurfaceOwns(p,root) && !IPMTabSurfaceOwns(p,child),"dead tab surface cannot capture input")
     V48Assert(IPMTabClickOrigin(p,"Damage",child)="","dead locked tab is rejected")
     IPMHideTabSurface(p)
 }
 
 V593TestDeadPositionPreserved()
 {
     p := IPMNewPanel(),p.X := -713,p.Y := 92,p.Gui := Gui()
     p.Gui.Destroy()
     V48Assert(!IPMRememberPanel(p) && p.X=-713 && p.Y=92,"missing window preserves saved position")
 }
 
 V593PositionRace(g,&x,&y)
 {
     g.Destroy()
     throw Error("Gui has no window.")
 }
 
 V593TestPositionDisappearsDuringRead()
 {
     p := IPMNewPanel(),p.X := 315,p.Y := -87,p.Gui := Gui()
     p.Gui.DefineProp("GetPos",{Call:V593PositionRace})
     V48Assert(!IPMRememberPanel(p) && p.X=315 && p.Y=-87,"disappearance between check/read is harmless")
 }
 
 V593BadPosition(g,&x,&y)
 {
     throw Error("Deliberate live-window failure")
 }
 
 V593TestLiveErrorsRemainVisible()
 {
     p := IPMNewPanel(),p.Gui := Gui(),caught := false
     p.Gui.DefineProp("GetPos",{Call:V593BadPosition})
     try {
         try IPMRememberPanel(p)
         catch Error as err
             caught := err.Message="Deliberate live-window failure"
         V48Assert(caught && IPMGuiAlive(p.Gui),"a genuine live error is not hidden")
     }
     finally IPMDisposeGui(p.Gui)
 }
 
 V593TestMixedPositionSaving()
 {
     V572Isolated(V593MixedPositionCase)
 }
 V593MixedPositionCase()
 {
     global IPM
     IPM.Editing := true
     dead := V593NativePanel("Damage"),live := V593NativePanel("Heal")
     dead.X := -450,dead.Y := 73,dead.Gui.Destroy()
     live.Gui.Move(-200,180),live.Gui.GetPos(&x,&y)
     IPMRememberPositions()
     V48Assert(dead.X=-450 && dead.Y=73,"dead panel did not abort/overwrite geometry")
     V48Assert(live.X=Round(x) && live.Y=Round(y),"other panels still save their actual position")
 }
 
 V593TestDetachPreservesPreferences()
 {
     p := IPMNewPanel("Threat"),p.X := -600,p.Y := 50,p.Width := 375,p.Height := 290,p.AutoHeight := false
     p.Gui := Gui(),p.ParserButton := p.Gui.AddText(,"Start"),p.Heading := p.Gui.AddText(,"Threat")
     g := p.Gui,h := g.Hwnd,windows := IPMDetachPanel(p)
     try {
         V48Assert(!IsObject(p.Gui) && !IsObject(p.ParserButton) && !IsObject(p.Heading),"published owners cleared first")
         V48Assert(windows[3]=g && DllCall("User32\IsWindow","Ptr",h,"Int"),"local owner retained until disposal")
         V48Assert(p.X=-600 && p.Y=50 && p.Width=375 && p.Height=290 && !p.AutoHeight,"user layout preserved")
         V48Assert(!p.Drawn && !p.ParserDrawn && !p.TabDrawn && !p.ParserRequest,"no old click authorization")
     }
     finally IPMDisposeGui(g)
 }
 
 V593ObserveDestroy(info,g)
 {
     global IPM
     V48Assert(IPM.Updating>0,"destruction happens inside UI transaction")
     for p in IPMAllPanels() {
         V48Assert(!IsObject(p.Gui) && !IsObject(p.ParserButton) && !IsObject(p.TabGui) && !IsObject(p.ParserGui),"all panels detached before native destruction")
         V48Assert(!p.Drawn && !p.TabDrawn && !p.ParserDrawn,"all draw flags cleared before native destruction")
     }
     V48Assert(IPMParserMessage(0,1,0x20,info.OldButton)="","nested mouse message cannot access retired controls")
     info.Count += 1
     Gui.Prototype.Destroy.Call(g)
 }
 
 V593TestDetachBeforeDestroy()
 {
     V572Isolated(V593DetachBeforeDestroyCase)
 }
 V593DetachBeforeDestroyCase()
 {
     p := V593NativePanel("Combined"),other := V593NativePanel("Damage")
     info := {Count:0,OldButton:p.ParserButton.Hwnd}
     p.Gui.DefineProp("Destroy",{Call:V593ObserveDestroy.Bind(info)})
     IPMDestroyPanels()
     V48Assert(info.Count=1,"observed real destruction after detachment")
 }
 
 V593TestRepeatedTeardown()
 {
     V572Isolated(V593RepeatedTeardownCase)
 }
 V593RepeatedTeardownCase()
 {
     global IPM
     p := V593NativePanel(),p.Gui.Destroy()
     IPMDestroyPanels(),IPMDestroyPanels(),IPMDestroyPanels()
     V48Assert(IPM.Updating=0 && !IsObject(p.Gui) && !IsObject(p.ParserButton),"repeated cleanup restores transaction state")
 }
 
 V593TestBodyRecreation()
 {
     V572Isolated(V593BodyRecreationCase)
 }
 V593BodyRecreationCase()
 {
     p := V593NativePanel("Damage"),g := p.Gui,oldButton := p.ParserButton
     p.Width := 342,p.Height := 276,p.AutoHeight := false,p.X := 113,p.Y := 79
     g.Destroy()
     IPMEnsureGui("Damage",0,p)
     V48Assert(IPMGuiAlive(p.Gui) && p.Gui!=g && p.ParserButton!=oldButton,"stale body is rebuilt")
     V48Assert(p.Width=342 && p.Height=276 && !p.AutoHeight,"rebuild is not a layout reset")
     V48Assert(!IPMUiHandle(oldButton),"old button remains invalid even after rebuild")
 }
 
 V593TestHeaderSurfaceRecreation()
 {
     V572Isolated(V593HeaderSurfaceCase)
 }
 V593HeaderSurfaceCase()
 {
     p := V593NativePanel("Combined")
     V48Assert(IPMParserEnsureSurface(p),"create input surface")
     old := p.ParserGui,oldHit := p.ParserHit,old.Destroy()
     V48Assert(IPMParserEnsureSurface(p) && p.ParserGui!=old && IPMGuiAlive(p.ParserGui),"dead header surface recreated")
     V48Assert(!IPMUiHandle(oldHit),"retired control never becomes valid again")
 }
 
 V593TestTabSurfaceRecreation()
 {
     V572Isolated(V593TabSurfaceCase)
 }
 V593TabSurfaceCase()
 {
     p := V593NativePanel("Combined")
     V48Assert(IPMEnsureTabSurface(p),"create locked tab surface")
     old := p.TabGui,old.Destroy()
     V48Assert(IPMEnsureTabSurface(p) && p.TabGui!=old && p.TabButtons.Count=4,"dead tab input recreated")
     V48Assert(IPMPlaceTabSurface(p),"rebuilt input can be placed")
 }
 
 V593TestOwnerDestroyedFirst()
 {
     V572Isolated(V593OwnerDestroyedCase)
 }
 V593OwnerDestroyedCase()
 {
     p := V593NativePanel("Combined")
     IPMParserEnsureSurface(p),IPMEnsureTabSurface(p)
     input := p.ParserGui,tabs := p.TabGui
     p.Gui.Destroy()
     V48Assert(!IPMGuiAlive(input) && !IPMGuiAlive(tabs),"owned windows destroyed with body")
     IPMParserHideSurface(p),IPMHideTabSurface(p),IPMDestroyPanels()
     IPMEnsureGui("Personal",0,p)
     V48Assert(IPMGuiAlive(p.Gui),"owner-first cleanup does not poison next build")
 }
 
 V593TestUpdatingCallbackGuards()
 {
     V572Isolated(V593CallbackGuardCase.Bind(false))
 }
 V593TestBusyCallbackGuards()
 {
     V572Isolated(V593CallbackGuardCase.Bind(true))
 }
 V593CallbackGuardCase(busy)
 {
     global IPM
     p := IPM.Panel,p.Drawn := true,p.TabDrawn := true,p.ParserDrawn := true,IPM.Editing := true
     p.Gui := V593Poison(),p.ParserButton := V593Poison(),p.ParserHit := V593Poison(),p.ParserGui := V593Poison()
     p.TabGui := V593Poison(),p.TabButtons["Damage"] := V593Poison()
     IPM.Busy := busy,IPM.Updating := busy ? 0 : 1
     try {
         for msg in IPMParserMessages()
             V48Assert(IPMParserMessage(0,1,msg,123)="","changing display ignores header callback")
         for msg in IPMTabMessages()
             V48Assert(IPMTabMessage(0,1,msg,123)="","changing display ignores tab callback")
         V48Assert(!IPMTabClicked("Damage",V593Poison()),"queued old tab click rejected before getter")
     }
     finally IPM.Busy := false,IPM.Updating := 0
 }
 
 V593TestDeadCallbackLookup()
 {
     V572Isolated(V593DeadCallbackCase)
 }
 V593DeadCallbackCase()
 {
     global IPM
     p := V593NativePanel("Combined"),h := p.ParserButton.Hwnd
     IPM.Editing := true,p.Drawn := true,p.Gui.Destroy()
     V48Assert(IPMParserMessage(0,1,0x20,h)="","destroyed button cannot throw outside teardown")
     V48Assert(!IsObject(IPMDragTarget(IPM,h)),"retired window cannot become a drag target")
 }
 
 V593TestStaleControlObject()
 {
     V572Isolated(V593StaleControlCase)
 }
 V593StaleControlCase()
 {
     global IPM
     p := V593NativePanel("Combined"),old := p.Tabs["Damage"]
     IPMDestroyPanels(),IPMEnsureGui("Personal",0,p),IPM.Editing := true
     metric := IPM.Metric
     V48Assert(!IPMTabClicked("Damage",old) && IPM.Metric=metric,"queued old control cannot change a rebuilt tab")
 }
 
 V593TestFirstHeaderKeepsAction()
 {
     V572Isolated(V593FirstHeaderCase)
 }
 V593FirstHeaderCase()
 {
     p := V593NativePanel("Combined"),p.ParserAction := "Start",p.ParserRequest := 0
     V48Assert(IPMParserEnsureSurface(p) && p.ParserAction="Start","first surface creation preserves freshly rendered action")
 }
 
 V593TestRepeatedRaidPreviews()
 {
     V572Isolated(V593RaidPreviewsCase)
 }
 V593RaidPreviewsCase()
 {
     global IPM,IP,IrisBench,soundboardsEnabled
     live := V572SeedStopped(),IPM.Mode := 3,IPM.MaxRows := 16
     for k in IPM.Shown
         IPM.Shown[k] := true
     IPM.ParserWarnRestart := false
     Loop 6 {
         count := Mod(A_Index,2) ? 8 : 16
         V48Assert(IPMPreviewSet(count),"preview starts explicitly")
         snap := IPM.PreviewSnapshot
         for target in IPMDisplayTargets() {
             p := target.Panel
             IPMEnsureGui(target.Kind,0,p),IPMRender(target.Kind,snap,p),IPMParserUpdate(p)
             V48Assert(InStr(p.Heading.Text,"PREVIEW")>0 && p.ParserAction="","sample has no parser action")
             V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"test windows remain hidden")
         }
         ; Reproduce a stale reference before the next save/apply cycle.
         IPM.Panels["Threat"].Gui.Destroy()
         IPMRememberPositions(),IPMDestroyPanels()
     }
     IPMEndRaidPreview()
     V48Assert(IP.Live=live && !IP.Active && !IPMPreviewActive(IPM),"real results remain intact")
     V48Assert(!IPM.ParserWarnRestart && IrisBench.Active && !soundboardsEnabled,"prefs and audio/capture unchanged")
 }
 
 V593SettingsControls()
 {
     global IPM
     g := Gui(),IPM.ConfigGui := g
     IPM.EnableControl := g.AddCheckbox(,"Enable"),IPM.EnableControl.Value := 1
     IPM.AutoShowOnParseControl := g.AddCheckbox(,"Auto show"),IPM.AutoShowOnParseControl.Value := IPM.AutoShowOnParse
     IPM.AutoHideOnStopControl := g.AddCheckbox(,"Auto hide"),IPM.AutoHideOnStopControl.Value := IPM.AutoHideOnStop
     IPM.ModeControl := g.AddDropDownList(,["Tabs","Separate","Both"]),IPM.ModeControl.Choose(3)
     IPM.MetricControl := g.AddDropDownList(,IPMViews()),IPM.MetricControl.Choose(1)
     IPM.GeometryControl := g.AddDropDownList(,["Combined","Personal","Damage","Heal","Taken","Threat","BossHP"]),IPM.GeometryControl.Choose(3)
     IPM.GeometryKey := "Damage"
     IPM.SourceControl := g.AddDropDownList(,["Live","Saved"]),IPM.SourceControl.Choose(1)
     IPM.WidthControl := g.AddEdit(,"380"),IPM.HeightControl := g.AddEdit(,"280")
     IPM.AutoControl := g.AddDropDownList(,["Auto","Fixed"]),IPM.AutoControl.Choose(1)
     IPM.ClickTabsControl := g.AddCheckbox(,"Tabs"),IPM.ClickTabsControl.Value := 1
     IPM.ParserControlsControl := g.AddCheckbox(,"Parser controls"),IPM.ParserControlsControl.Value := 1
     IPM.ParserWarnRestartControl := g.AddCheckbox(,"Warn"),IPM.ParserWarnRestartControl.Value := 0
     IPM.CompanionControl := g.AddCheckbox(,"Companions"),IPM.CompanionControl.Value := 1
     IPM.FontControl := g.AddEdit(,"10"),IPM.RowControl := g.AddEdit(,"16"),IPM.OpacityControl := g.AddEdit(,"225")
     IPM.RefreshControl := g.AddDropDownList(,["500","1000"]),IPM.RefreshControl.Choose(1)
     IPM.NoticeControl := g.AddText(,""),IPM.PreviewEndControl := g.AddButton(,"End preview")
     IPM.ShowControls := Map()
     for k in IPMViews() {
         c := g.AddCheckbox(,k),c.Value := 1,IPM.ShowControls[k] := c
     }
     return g
 }
 
 V593TestApplyWhilePreviewing()
 {
     V572Isolated(V593ApplyPreviewCase)
 }
 V593ApplyPreviewCase()
 {
     global IPM,IP
     live := V572SeedStopped(),g := V593SettingsControls()
     try {
         IPM.Mode := 3
         V48Assert(IPMPreviewSet(8),"initial preview")
         for target in IPMDisplayTargets()
             IPMEnsureGui(target.Kind,0,target.Panel)
         IPM.Panels["Damage"].Gui.Destroy()
         V48Assert(IPMApplySettings(),"Apply succeeds despite a stale body reference")
         V48Assert(IPMPreviewSet(16),"switch to 16 after Apply")
         V48Assert(IPM.Panels["Damage"].AutoHeight && IPM.Panels["Damage"].Width=380,"chosen sizing retained")
         IPMLock()
         V48Assert(IP.Live=live && !IP.Active && !IPM.Editing && !IPMPreviewActive(IPM),"locking keeps real data")
     }
     finally {
         IPM.ConfigGui := ""
         IPMDisposeGui(g)
     }
 }
 
 V593TestHideAndLockDeadPanels()
 {
     V572Isolated(V593HideLockCase)
 }
 V593HideLockCase()
 {
     global IPM,IP
     live := V572SeedStopped(),IPM.Wanted := true
     V48Assert(IPMPreviewSet(8),"preview available")
     p := V593NativePanel(),p.X := -399,p.Y := 85,p.Gui.Destroy()
     IPMHide(),IPMLock(),IPMDestroyPanels()
     V48Assert(!IPM.Wanted && !IPM.Editing && p.X=-399 && p.Y=85,"hide/lock preserve last saved geometry")
     V48Assert(IP.Live=live && !IP.Active,"hide/lock do not start or replace parsing")
 }
 ; v59.5: explicit formatting values and native chart/tab test contracts.
 ; Embedded comment payload only. No startup action, visible GUI or gameplay input.
 V595BitmapInfo(ctrl)
 {
     ; Picture.Value is the original filename, not the currently attached bitmap.
     image := DllCall("User32\SendMessageW","Ptr",ctrl.Hwnd,"UInt",0x0173,"Ptr",0,"Ptr",0,"Ptr")
     bm := Buffer(A_PtrSize=8 ? 32 : 24,0)
     bytes := image ? DllCall("Gdi32\GetObjectW","Ptr",image,"Int",bm.Size,"Ptr",bm,"Int") : 0
     return {Handle:image,Bytes:bytes,Width:NumGet(bm,4,"Int"),Height:NumGet(bm,8,"Int"),
         Type:image ? DllCall("Gdi32\GetObjectType","Ptr",image,"UInt") : 0}
 }
 V595AssertChart(a)
 {
     info := V595BitmapInfo(a.Controls["Chart"])
     V48Assert(info.Handle!=0 && info.Type=7 && info.Bytes>0,"a live GDI bitmap is attached to the chart")
     V48Assert(info.Width>0 && info.Height>0,"the attached chart bitmap has positive dimensions")
     V48Assert(!InStr(a.HasOwnProp("LastStatus") ? a.LastStatus : "","Chart:",false),"chart drawing did not report an error")
 }
 V595VisibilityMatches(a,tab)
 {
     for group,controls in a.Groups {
         for c in controls {
             expected := group=tab
             if a.Parent && c=a.Controls["ClassNote"]
                 expected := false ; Intentionally suppressed duplicate embedded chrome.
             if V58ChildVisible(c)!=expected
                 return false
         }
     }
     if a.Parent {
         for name in ["Summary","Coverage","Source","Copy","Export"] {
             if V58ChildVisible(a.Controls[name])!=(tab=8)
                 return false
         }
     }
     return true
 }
 V595TestGroupedNumbers()
 {
     for sample in [[0,"0"],[12,"12"],[999,"999"],[1000,"1,000"],[30000,"30,000"],
         [1000000,"1,000,000"],[1234567890,"1,234,567,890"]]
         V48Assert(IANumber(sample[1])=sample[2],"literal grouped-number output: " sample[2])
 }
 V595TestSignedRoundedNumbers()
 {
     for sample in [[-1000,"-1,000"],[-1234567,"-1,234,567"],[999.4,"999"],[999.6,"1,000"],
         [-999.6,"-1,000"],[0.4,"0"],[-0.4,"0"],[0.6,"1"],[-0.6,"-1"],[1234567.25,"1,234,567"]]
         V48Assert(IANumber(sample[1])=sample[2],"signed/rounded display: " sample[2])
 }
 V595TestExactIntegerNumbers()
 {
     V48Assert(IANumber(9007199254740993)="9,007,199,254,740,993","integer above 2^53 does not pass through a float")
     V48Assert(IANumber(-9007199254740993)="-9,007,199,254,740,993","large signed integer remains exact")
     V48Assert(IANumber(9223372036854775807)="9,223,372,036,854,775,807","maximum signed 64-bit integer remains exact")
     V48Assert(IANumber("30000")="30,000","numeric string is formatted")
 }
 V595TestUnknownNumbers()
 {
     for value in ["","Unknown","--",{},[]]
         V48Assert(IANumber(value)="--","missing/non-numeric values are not invented as zero")
 }
 V595TestBitmapHandleContract()
 {
     g := Gui(),ctrl := g.AddPicture("x0 y0 w180 h90 +0x100","")
     p := ""
     try {
         V48Assert(V595BitmapInfo(ctrl).Handle=0,"an unpainted picture fails the bitmap-presence check")
         p := IAPaintBegin(ctrl)
         IALine(p,5,5,150,60,0x123456,2)
         IAPaintEnd(p),p := ""
         info := V595BitmapInfo(ctrl)
         V48Assert(info.Handle!=0 && info.Bytes>0 && info.Type=7,"committed chart has a valid native bitmap")
         rect := Buffer(16),DllCall("User32\GetClientRect","Ptr",ctrl.Hwnd,"Ptr",rect)
         V48Assert(info.Width=NumGet(rect,8,"Int") && info.Height=NumGet(rect,12,"Int"),"native bitmap matches physical control dimensions at the current DPI")
         V48Assert(ctrl.Value="","original empty filename is not evidence that the bitmap is absent")
     }
     finally {
         if IsObject(p) && !p.HasOwnProp("Closed")
             IAPaintEnd(p,false)
         g.Destroy()
     }
 }
 V595TestChartResizeHandle()
 {
     V59Hidden(V595ResizeCase)
 }
 V595ResizeCase()
 {
     a := IAState(),a.Data := IADemoData(),a.Query := IANewQuery(a.Data,"@Demo DPS#102")
     a.Result := IAQuery(a.Data,a.Query),V7826SelectReviewPage(1)
     for size in [[1020,700],[1220,780],[1600,1000]] {
         IAResize(a.Gui,0,size[1],size[2])
         IAChartChanged(),V595AssertChart(a)
         rect := Buffer(16),DllCall("User32\GetClientRect","Ptr",a.Controls["Chart"].Hwnd,"Ptr",rect)
         info := V595BitmapInfo(a.Controls["Chart"])
         V48Assert(info.Width=NumGet(rect,8,"Int") && info.Height=NumGet(rect,12,"Int"),"chart bitmap tracks physical resize/DPI")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd,"Int"),"chart test never shows its GUI")
     }
 }
 V595TestEmbeddedLiteralSummary()
 {
     V591Isolated(V595SummaryCase)
 }
 V595SummaryCase()
 {
     V591Ready(),a := IAState(),a.Data := IADemoData()
     for sample in [["@Demo DPS#102",2,"30,000"],["@Demo Healer#103",4,"10,000"],["@Demo Tank#101",7,"10,600"]] {
         a.Query := IANewQuery(a.Data,sample[1]),a.Selected := sample[1],a.Result := IAQuery(a.Data,a.Query)
         IARender(false),V7826SelectReviewPage(8)
         V48Assert(a.Controls["Summary"].GetText(sample[2],2)=sample[3],"embedded summary has literal expected text " sample[3])
         V48Assert(V58ChildVisible(a.Controls["Summary"]),"the summary page remains selected")
     }
 }
 V595TestEmbeddedChartHandle()
 {
     V591Isolated(V595EmbeddedChartCase)
 }
 V595EmbeddedChartCase()
 {
     V591Ready(),a := V591Data()
     V7826SelectReviewPage(1),IAChartChanged(),V595AssertChart(a)
     V7826SelectReviewPage(8)
     V48Assert(!V58ChildVisible(a.Controls["Chart"]),"Summary hides Charts")
     V7826SelectReviewPage(1),V595AssertChart(a)
     V48Assert(V58ChildVisible(a.Controls["Chart"]),"returning to Charts restores its control")
 }
 V595TestStandaloneVisibilityOracle()
 {
     V59Hidden(V595StandaloneVisibilityCase)
 }
 V595StandaloneVisibilityCase()
 {
     a := IAState()
     for selected in [7,1,4,2,6,3,5,1] {
         V7826SelectReviewPage(selected)
         V48Assert(V595VisibilityMatches(a,selected),"standalone tab visibility uses the selected tab, not a nested loop index")
     }
     V7826SelectReviewPage(4)
     a.Controls["ChartHint"].Visible := true
     V48Assert(!V595VisibilityMatches(a,4),"visibility check detects an incorrectly exposed inactive control")
     IATabChanged()
     V48Assert(V595VisibilityMatches(a,4),"tab handler restores the intended visibility")
 }
 V595TestEmbeddedVisibilityOracle()
 {
     V591Isolated(V595EmbeddedVisibilityCase)
 }
 V595EmbeddedVisibilityCase()
 {
     V591Ready(),a := IAState()
     for selected in [8,7,1,4,2,6,3,5,8] {
         V7826SelectReviewPage(selected)
         V48Assert(V595VisibilityMatches(a,selected),"embedded tabs preserve group and summary visibility")
     }
     a.Controls["ChartHint"].Visible := true
     V48Assert(!V595VisibilityMatches(a,8),"embedded visibility check also rejects stray inactive controls")
     IATabChanged()
     V48Assert(V595VisibilityMatches(a,8),"embedded tab handler restores the intended visibility")
 }
 ; v59.6 manual-only import scheduling, delivery, cancellation and timing checks.
 ; Temporary files are confined to the isolated test process. No GUI/audio/network.
 V596TestDefaults()
 {
     p := IPNewApp()
     V48Assert(!p.Timer && p.PumpPeriod=0 && !p.ImportCancelRequested && !IsObject(p.ImportTiming),"new import fields inert")
 }
 V596TestPeriodIdle()
 {
     V48Assert(IPDesiredPumpPeriod(IPNewApp())=0,"no startup import timer")
 }
 V596TestPeriodVisible()
 {
     p := IPNewApp(),p.Visible := true
     V48Assert(IPDesiredPumpPeriod(p)=50,"ordinary visible workspace keeps cadence")
 }
 V596TestPeriodLive()
 {
     p := IPNewApp(),p.Active := true
     V48Assert(IPDesiredPumpPeriod(p)=50,"live pump period preserved")
 }
 V596TestPeriodQueued()
 {
     p := IPNewApp(),p.Queue := ["a","b"]
     V48Assert(IPDesiredPumpPeriod(p)=50,"draining live queue retains period")
     p.Head := 3
     V48Assert(IPDesiredPumpPeriod(p)=0,"drained hidden pump stops")
 }
 V596TestPeriodImport()
 {
     p := IPNewApp(),p.ImportFile := {}
     V48Assert(IPDesiredPumpPeriod(p)=10,"saved-file work uses shorter requested period")
 }
 V596TestPeriodFinish()
 {
     p := IPNewApp(),p.ImportFile := {},p.Visible := true
     V48Assert(IPDesiredPumpPeriod(p)=10,"import takes scheduling precedence")
     p.ImportFile := ""
     V48Assert(IPDesiredPumpPeriod(p)=50,"completion restores visible cadence")
     p.Visible := false
     V48Assert(IPDesiredPumpPeriod(p)=0,"completion stops hidden cadence")
 }
 V596TestPolicyDesktop()
 {
     p := IPImportLimits(false)
     V48Assert(p.Lines=2048 && p.Ms=12 && p.Mode="desktop","bounded desktop throughput policy")
 }
 V596TestPolicyGame()
 {
     p := IPImportLimits(true)
     V48Assert(p.Lines=200 && p.Ms=4 && p.Mode="game-focused","smaller game-foreground budget")
 }
 V596TestClock()
 {
     a := IPImportNow(),b := IPImportNow()
     V48Assert(IsNumber(a) && a>0 && b>=a,"monotonic import stopwatch")
 }
 V596TestTimingCounts()
 {
     s := IPNewData(),s.Lines := 200,s.Malformed := 2,s.Partial := true
     t := IPNewImportTiming(10000,3,1000),p := IPImportLimits(false)
     IPRecordImportBatch(t,s,9000,6,p),IPRecordImportBatch(t,s,10000,8,p)
     V48Assert(t.Records=200 && t.ReadBytes=10000 && t.Batches=2,"line count is a snapshot, not double counted")
     V48Assert(t.BatchMs=14 && t.PeakBatchMs=8 && t.Malformed=2 && t.Partial,"batch totals and exclusions retained")
 }
 V596TestTimingFrozen()
 {
     s := IPNewData(),s.Lines := 1000
     t := IPNewImportTiming(5000,0,1000)
     IPCompleteImportTiming(t,s,5000,"COMPLETE",3000)
     V48Assert(IPImportElapsed(t,99999)=2 && t.Outcome="COMPLETE","completed elapsed time stays frozen")
     IPCompleteImportTiming(t,s,5000,"ERROR",99999)
     V48Assert(t.Stopped=3000 && t.Outcome="COMPLETE","completion report cannot be restamped")
 }
 V596TestTimingZero()
 {
     t := IPNewImportTiming(0,0,1000)
     V48Assert(IPImportElapsed(t,1000)=0,"zero-time guard")
     V48Assert(InStr(IPImportTimingShort(t,1000),"-- records/s"),"no fake speed for no input")
 }
 V596TestReportPrivacy()
 {
     t := IPNewImportTiming(5000,0,1000),t.Path := "C:\secret\private.txt",t.Player := "SecretPlayer"
     r := IPImportTimingReport(t,2000)
     V48Assert(!InStr(r,"private.txt") && !InStr(r,"SecretPlayer") && !InStr(r,"C:\"),"allowlisted report omits paths and names")
     V48Assert(InStr(r,"wall time") && InStr(r,"read-ahead") && InStr(r,"RUNNING"),"measurement limits explicit")
 }
 V596Text(n := 340)
 {
     text := IPDemoLine(1000,"@Zoë Test#1","=","Enter") "`r`n"
     boss := "Training target {2857785339412480}:9|(0,0,0,0)|(10000000/10000000)"
     Loop n {
         text .= IPDemoLine(1000+A_Index*10,"@Zoë Test#1",boss,"Damage",100+Mod(A_Index,7)) "`r`n"
         if Mod(A_Index,20)=0
             text .= IPDemoLine(1000+A_Index*10,"@Healer#2","@Zoë Test#1","Heal",80,false,50) "`r`n"
     }
     return text
 }
 V596Direct(text)
 {
     s := IPNewData("IMPORT TEST")
     rows := StrSplit(text,"`n","`r")
     if rows.Length && rows[rows.Length]=""
         rows.Pop()
     for line in rows
         IPFeedLine(s,line)
     IPFinalizeData(s,"end of selected snapshot")
     return s
 }
 V596Signature(s)
 {
     text := s.Lines "|" s.Parsed "|" s.Malformed "|" s.BadValues "|" s.ClockBack "|" s.Late "|" s.Rows "|" s.Partial "|" s.Segments.Length
     for seg in s.Segments {
         text .= "`n" seg.Start "|" seg.Last "|" seg.End "|" seg.EndReason "|" seg.EventCount "|" seg.Events.Length
         text .= "`n" IPSummary(s,seg) "`n" IPCsvData(s,seg)
         for ev in seg.Events
             text .= "`n" ev.At "|" ev.Source "|" ev.Target "|" ev.Id "|" ev.Kind "|" ev.Amount
     }
     return text
 }
 V596WithImport(text,action)
 {
     global IP
     static serial := 0
     serial += 1
     old := IP,path := A_ScriptDir "\Iris596_" DllCall("GetCurrentProcessId","UInt") "_" serial ".txt"
     V48Assert(!FileExist(path),"test never overwrites an existing file")
     try {
         f := FileOpen(path,"w","UTF-8-RAW"),f.Write(text),f.Close()
         IP := IPNewApp(),IP.Offline := IPNewData("IMPORT TEST"),IP.Live := IPNewData("LIVE CONTROL")
         IPFeedLine(IP.Live,IPDemoLine(1000,"@Retained#99",V51Target(),"Damage",777))
         IPCloseSegment(IP.Live,"stopped control"),IP.Live.Finished := true
         IP.ImportFile := FileOpen(path,"r","UTF-8"),IP.ImportEnd := IP.ImportFile.Length
         IP.ImportTiming := IPNewImportTiming(IP.ImportEnd,IP.ImportFile.Pos)
         IP.Busy := true
         action.Call(path)
     }
     finally {
         if IsObject(IP.ImportFile)
             try IP.ImportFile.Close()
         IP := old
         if FileExist(path)
             FileDelete(path)
     }
 }
 V596Drain(lines := 2048, ms := 1000)
 {
     global IP
     Loop 3000 {
         if !IsObject(IP.ImportFile)
             return
         IPImportBatch({Lines:lines,Ms:ms,Mode:"isolated test"})
     }
     throw Error("Synthetic import failed to terminate.")
 }
 V596TestBatchEquivalence()
 {
     V596WithImport(V596Text(60),V596EquivalenceCase)
 }
 V596EquivalenceCase(path)
 {
     global IP
     expected := V596Direct(FileRead(path,"UTF-8"))
     V596Drain(7)
     V48Assert(V596Signature(IP.Offline)=V596Signature(expected),"batched import equals sequential core parser including events and rows")
     V48Assert(IP.ImportTiming.Outcome="COMPLETE" && IP.ImportDone,"normal completion distinct from cancellation")
 }
 V596TestUTF8ChunkBoundary()
 {
     V596WithImport(V596Text(),V596ChunkCase)
 }
 V596ChunkCase(path)
 {
     global IP
     V48Assert(IP.ImportEnd>65536,"fixture crosses physical read chunk")
     expected := V596Direct(FileRead(path,"UTF-8"))
     V596Drain(2048)
     V48Assert(V596Signature(IP.Offline)=V596Signature(expected),"UTF-8 names and ordered rows survive read and scheduling boundaries")
 }
 V596TestTrailingFragment()
 {
     V596WithImport(V596Text(3) "incomplete tail",V596TailCase)
 }
 V596TailCase(path)
 {
     global IP
     V596Drain()
     V48Assert(IP.Offline.Malformed=1 && IP.Offline.Partial,"unterminated tail remains disclosed, not silently counted")
     V48Assert(IP.Offline.Lines=4 && IP.ImportTiming.Records=4,"only complete source lines fed")
 }
 V596TestAppendExcluded()
 {
     V596WithImport(V596Text(3),V596AppendCase)
 }
 V596AppendCase(path)
 {
     global IP
     expected := V596Direct(FileRead(path,"UTF-8")),end := IP.ImportEnd
     f := FileOpen(path,"a","UTF-8-RAW"),f.Write(IPDemoLine(5000,"@Late#9",V51Target(),"Damage",999) "`n"),f.Close()
     V596Drain()
     V48Assert(V596Signature(IP.Offline)=V596Signature(expected) && IP.ImportTiming.ReadBytes=end,"later append never enters the selected snapshot")
 }
 V596TestDeferredCancel()
 {
     V596WithImport(V596Text(3),V596DeferredCase)
 }
 V596DeferredCase(path)
 {
     global IP
     f := IP.ImportFile,s := IP.Offline,live := IP.Live
     IPStop()
     V48Assert(IP.ImportCancelRequested && IP.ImportFile=f && !s.Finished,"busy Cancel is a request, not mid-record file destruction")
     V596Drain()
     V48Assert(!IsObject(IP.ImportFile) && s.Finished && s.Partial && s.Lines=0,"request handled before next record")
     V48Assert(IP.ImportTiming.Outcome="CANCELED" && IP.Live=live && !live.Partial,"cancel does not alter retained live data")
 }
 V596TestImmediateCancel()
 {
     V596WithImport(V596Text(3),V596ImmediateCase)
 }
 V596ImmediateCase(path)
 {
     global IP
     IP.Busy := false,IPStop()
     V48Assert(!IsObject(IP.ImportFile) && IP.Offline.Finished && IP.Offline.Partial,"idle Cancel completes without another timer")
     V48Assert(!IP.ImportCancelRequested && IP.ImportTiming.Outcome="CANCELED","cancel state reset")
 }
 V596TestCancelPreservesPrefix()
 {
     V596WithImport(V596Text(15),V596PrefixCase)
 }
 V596PrefixCase(path)
 {
     global IP
     IPImportBatch({Lines:5,Ms:1000,Mode:"isolated test"})
     V48Assert(IP.Offline.Lines=5,"line-count boundary exact")
     IPStop(),V596Drain()
     V48Assert(IP.Offline.Lines=5 && IP.ImportTiming.Records=5 && IP.Offline.Partial,"cancel commits prefix only, without dropping accepted data")
 }
 V596TestLimitPreservesLive()
 {
     V596WithImport(V596Text(3),V596LimitCase)
 }
 V596LimitCase(path)
 {
     global IP
     live := IP.Live,sig := V596Signature(live)
     IP.Offline.Halted := true,IP.Offline.HaltReason := "synthetic capacity limit"
     V596Drain()
     V48Assert(IP.ImportTiming.Outcome="LIMIT" && IP.Offline.Partial,"capacity limits not bypassed to improve speed")
     V48Assert(IP.Live=live && V596Signature(live)=sig,"import limit preserves live control")
 }
 V596TestErrorPreservesLive()
 {
     V596WithImport(V596Text(3),V596ErrorCase)
 }
 V596ErrorCase(path)
 {
     global IP
     live := IP.Live,sig := V596Signature(live)
     IP.ImportFile.Close()
     V596Drain()
     V48Assert(IP.ImportTiming.Outcome="ERROR" && IP.Offline.Partial,"read errors remain visible and incomplete")
     V48Assert(IP.Live=live && V596Signature(live)=sig && !live.Halted,"offline error does not halt or replace stopped live data")
 }
 V596TestHiddenImport()
 {
     V596WithImport(V596Text(3),V596HiddenCase)
 }
 V596HiddenCase(path)
 {
     global IP
     IP.Visible := false,IPHide(),V596Drain()
     V48Assert(IP.ImportDone && IP.Offline.Lines=4 && !IP.Visible && !IsObject(IP.Gui),"hiding workspace neither cancels nor shows import")
 }
 V596TestNoAutomaticTimers()
 {
     global IP
     old := IP
     try {
         IP := IPNewApp(),IP.ImportFile := {},IP.Visible := true
         IPSetTimer()
         V48Assert(!IP.Timer && IP.PumpPeriod=0,"SELF_TEST does not schedule import/refresh callbacks")
     }
     finally IP := old
 }
 V596TestEmptyFile()
 {
     V596WithImport("",V596EmptyCase)
 }
 V596EmptyCase(path)
 {
     global IP
     V596Drain()
     V48Assert(IP.ImportDone && IP.Offline.Lines=0 && IP.Offline.Segments.Length=0,"empty file completes without fabricated encounter")
     V48Assert(InStr(IPImportTimingShort(IP.ImportTiming),"-- records/s"),"empty file does not claim throughput")
 }
 V596TestByteIdenticalSource()
 {
     V596WithImport(V596Text(3),V596UnmodifiedCase)
 }
 V596UnmodifiedCase(path)
 {
     original := FileRead(path,"UTF-8")
     V596Drain()
     V48Assert(FileRead(path,"UTF-8")=original,"read-only import does not rewrite source")
 }
 V596TestActualPumpImport()
 {
     V596WithImport(V596Text(3),V596PumpCase)
 }
 V596PumpCase(path)
 {
     global IP,logReadBusy,IrisTests
     oldRead := logReadBusy,oldTestBusy := IrisTests.Busy
     live := IP.Live,sig := V596Signature(live)
     try {
         logReadBusy := false,IrisTests.Busy := false,IP.Busy := false
         Loop 20 {
             if !IsObject(IP.ImportFile)
                 break
             IPPump()
         }
         V48Assert(IP.ImportDone && !IP.Busy && !IP.Timer && IP.PumpPeriod=0,"real pump completes import without test timers")
         V48Assert(V596Signature(live)=sig && IP.Live=live,"actual pump retains stopped live statistics")
     }
     finally logReadBusy := oldRead,IrisTests.Busy := oldTestBusy
 }
 ; v59.7 manual-only continuous-import tests. Temporary files and hidden GUI only.
 ; The production runner services no live messages in SELF_TEST. Test callbacks
 ; deterministically exercise the same between-record control boundary.
 V597TestDefaults()
 {
     p := IPNewApp()
     V48Assert(!p.ImportRunning && p.ImportDisplayData="" && !p.Timer,"continuous state is inert at startup")
 }
 V597TestRunningTimerOff()
 {
     p := IPNewApp(),p.ImportFile := {},p.ImportRunning := {},p.Visible := true
     V48Assert(IPDesiredPumpPeriod(p)=0,"continuous owner suppresses its kickoff timer")
     p.ImportRunning := false
     V48Assert(IPDesiredPumpPeriod(p)=10,"pending not-yet-started import retains a retryable kickoff")
 }
 V597TestTimerRestoration()
 {
     p := IPNewApp(),p.ImportFile := {},p.ImportRunning := {}
     p.ImportFile := "",p.ImportRunning := false,p.Visible := true
     V48Assert(IPDesiredPumpPeriod(p)=50,"ordinary desktop cadence restored after continuous import")
     p.Visible := false
     V48Assert(IPDesiredPumpPeriod(p)=0,"no idle timer needed after hidden import")
 }
 V597TextRows(n)
 {
     text := ""
     Loop n
         text .= IPDemoLine(1000+A_Index*10,"@Preview Léa#101",V51Target(),"Damage",100+Mod(A_Index,7)) "`r`n"
     return text
 }
 V597TestUncappedSinglePass()
 {
     V596WithImport(V597TextRows(2113),V597SinglePassCase)
 }
 V597SinglePassCase(path)
 {
     global IP
     expected := V596Signature(V596Direct(FileRead(path,"UTF-8"))),live := IP.Live
     IPImportRun()
     V48Assert(IP.ImportDone && IP.Offline.Lines=2113 && IP.ImportTiming.Batches=1,"more than old 2048-row cap completes in one invocation")
     V48Assert(V596Signature(IP.Offline)=expected,"all segments/totals/rows/events equal sequential core parser")
     V48Assert(IP.Live=live && !IP.ImportRunning && IP.Busy,"run restores the caller's existing busy state")
     V48Assert(IP.ImportTiming.Mode="throughput-first" && IP.ImportTiming.Outcome="COMPLETE","explicit continuous mode and successful end")
     V48Assert(IP.LastDraw=-10000,"completion requests immediate result refresh rather than another one-second wait")
 }
 V597TestUTF8ReadBoundary()
 {
     V596WithImport(V596Text(),V597UTF8Case)
 }
 V597UTF8Case(path)
 {
     global IP
     expected := V596Signature(V596Direct(FileRead(path,"UTF-8")))
     V48Assert(IP.ImportEnd>65536,"fixture crosses unchanged byte-reader boundary")
     IPImportRun()
     V48Assert(V596Signature(IP.Offline)=expected,"Unicode and read-chunk order conserved without timer batches")
 }
 V597ResetJob(path)
 {
     global IP
     if IsObject(IP.ImportFile)
         IP.ImportFile.Close()
     IP.Offline := IPNewData("IMPORT TEST"),IP.ImportFile := FileOpen(path,"r","UTF-8")
     IP.ImportEnd := IP.ImportFile.Length,IP.ImportBytes := IP.ImportFile.Pos
     IP.ImportLines := [],IP.ImportHead := 1,IP.ImportSkip := false
     IP.ImportDone := false,IP.ImportCancelRequested := false
     IP.ImportTiming := IPNewImportTiming(IP.ImportEnd,IP.ImportBytes)
 }
 V597TestOldBatchEquivalence()
 {
     V596WithImport(V596Text(95),V597BatchCompareCase)
 }
 V597BatchCompareCase(path)
 {
     global IP
     V596Drain(7),expected := V596Signature(IP.Offline)
     V597ResetJob(path),IPImportRun()
     V48Assert(V596Signature(IP.Offline)=expected,"actual old 7-row batch helper and continuous runner agree")
 }
 V597TestCancelBeforeFirst()
 {
     V596WithImport(V596Text(3),V597CancelBeforeCase)
 }
 V597CancelBeforeCase(path)
 {
     global IP
     IP.ImportCancelRequested := true,IPImportRun()
     V48Assert(IP.Offline.Lines=0 && IP.Offline.Partial && IP.Offline.Finished,"cancel before first record is retained as empty partial")
     V48Assert(IP.ImportTiming.Outcome="CANCELED" && !IP.ImportRunning,"cancel resets ownership")
 }
 V597CancelAtCheckpoint(app,run)
 {
     IPStop()
 }
 V597TestCancelAtCheckpoint()
 {
     V596WithImport(V597TextRows(160),V597CancelAtCase)
 }
 V597CancelAtCase(path)
 {
     global IP
     IPImportRun(V597CancelAtCheckpoint)
     V48Assert(IP.Offline.Lines=64 && IP.ImportTiming.Records=64,"cancel stops before the next record without dropping prefix")
     V48Assert(IP.ImportTiming.Outcome="CANCELED" && IP.Offline.Partial,"checkpoint cancellation not reported as completion")
     V48Assert(!IP.ImportCancelRequested && !IsObject(IP.ImportFile),"file closed only after current record and request cleared")
 }
 V597TestFinalRecordCancel()
 {
     V596WithImport(V597TextRows(64),V597FinalCancelCase)
 }
 V597FinalCancelCase(path)
 {
     global IP
     IPImportRun(V597CancelAtCheckpoint)
     V48Assert(IP.Offline.Lines=64 && IP.ImportTiming.Outcome="CANCELED" && IP.Offline.Partial,"last-record cancellation wins before finalization")
 }
 V597GuardCheckpoint(app,run)
 {
     before := app.Offline.Lines
     IPImportRun(),IPPump(),IPBeginImport("Z:\not-a-real-import.txt")
     app.TestGuard := app.Offline.Lines=before && app.ImportFile=run.File
         && !IPStartCanCommit(app,app.Live)
 }
 V597TestReentryAndReplacementGuards()
 {
     V596WithImport(V597TextRows(80),V597GuardCase)
 }
 V597GuardCase(path)
 {
     global IP
     IPImportRun(V597GuardCheckpoint)
     V48Assert(IP.TestGuard && IP.Offline.Lines=80 && IP.ImportTiming.Outcome="COMPLETE","nested pump/start/import do not replace or duplicate active run")
     V48Assert(IP.ImportTiming.Batches=1,"reentrant runner creates no second processing pass")
 }
 V597DropOwnership(app,run)
 {
     app.Offline := IPNewData("REPLACEMENT CONTROL")
 }
 V597TestRetiredRunCannotFinalizeReplacement()
 {
     V596WithImport(V597TextRows(80),V597RetiredCase)
 }
 V597RetiredCase(path)
 {
     global IP
     oldData := IP.Offline,t := IP.ImportTiming
     IPImportRun(V597DropOwnership)
     V48Assert(IP.Offline!=oldData && IP.Offline.Lines=0 && !IP.Offline.Finished && !IP.Offline.Partial,"retired owner leaves replacement data untouched")
     V48Assert(t.Records=64 && t.Outcome="RETIRED" && !IP.ImportRunning,"retired timing describes only former job")
 }
 V597TestCapacityLimit()
 {
     V596WithImport(V596Text(3),V597LimitCase)
 }
 V597LimitCase(path)
 {
     global IP
     IP.Offline.Halted := true,IP.Offline.HaltReason := "synthetic capacity limit"
     IPImportRun()
     V48Assert(IP.ImportTiming.Outcome="LIMIT" && IP.Offline.Partial && IP.Offline.Lines=0,"uncapped scheduling does not disable data caps")
 }
 V597TestReadError()
 {
     V596WithImport(V596Text(3),V597ReadErrorCase)
 }
 V597ReadErrorCase(path)
 {
     global IP
     live := IP.Live,sig := V596Signature(live)
     IP.ImportFile.Close(),IPImportRun()
     V48Assert(IP.ImportTiming.Outcome="ERROR" && IP.Offline.Partial,"closed-file read error remains explicit")
     V48Assert(IP.Live=live && V596Signature(live)=sig && !IP.ImportRunning,"read failure leaves live data and clears ownership")
 }
 V597ThrowCheckpoint(app,run)
 {
     throw Error("Synthetic checkpoint failure")
 }
 V597TestCheckpointError()
 {
     V596WithImport(V597TextRows(80),V597CheckpointErrorCase)
 }
 V597CheckpointErrorCase(path)
 {
     global IP
     IPImportRun(V597ThrowCheckpoint)
     V48Assert(IP.ImportTiming.Outcome="ERROR" && IP.Offline.Lines=64 && IP.Offline.Partial,"checkpoint error preserves imported prefix as partial")
     V48Assert(InStr(IP.Status,"Synthetic checkpoint failure") && !IP.ImportRunning,"error is visible; runner ownership released")
 }
 V597TestEmptyFile()
 {
     V596WithImport("",V597EmptyCase)
 }
 V597EmptyCase(path)
 {
     global IP
     IPImportRun()
     V48Assert(IP.ImportDone && IP.Offline.Lines=0 && IP.Offline.Segments.Length=0,"empty snapshot completes without an encounter")
     V48Assert(IP.ImportTiming.Outcome="COMPLETE" && InStr(IPImportTimingShort(IP.ImportTiming),"-- records/s"),"no invented speed for empty source")
 }
 V597TestIncompleteTail()
 {
     V596WithImport(V596Text(3) "unfinished fragment",V597TailCase)
 }
 V597TailCase(path)
 {
     global IP
     IPImportRun()
     V48Assert(IP.Offline.Lines=4 && IP.Offline.Malformed=1 && IP.Offline.Partial,"unfinished bytes are disclosed identically to old reader")
 }
 V597TestOverlongRecord()
 {
     long := "x"
     Loop 17
         long .= long
     V596WithImport(long "`n" V596Text(3),V597OverlongCase)
 }
 V597OverlongCase(path)
 {
     global IP
     V596Drain(7),expected := V596Signature(IP.Offline)
     V597ResetJob(path),IPImportRun()
     V48Assert(IP.ImportDone && V596Signature(IP.Offline)=expected,"rowless chunks and overlong records terminate with the same exclusions")
 }
 V597TestAppendedDataExcluded()
 {
     V596WithImport(V596Text(3),V597AppendCase)
 }
 V597AppendCase(path)
 {
     global IP
     expected := V596Signature(V596Direct(FileRead(path,"UTF-8"))),last := IP.ImportEnd
     f := FileOpen(path,"a","UTF-8-RAW"),f.Write(V597TextRows(3)),f.Close()
     IPImportRun()
     V48Assert(V596Signature(IP.Offline)=expected && IP.ImportTiming.ReadBytes=last,"continuously importing still respects initial snapshot length")
 }
 V597TestReadOnlyFile()
 {
     V596WithImport(V596Text(3),V597ReadOnlyCase)
 }
 V597ReadOnlyCase(path)
 {
     original := FileRead(path,"UTF-8")
     IPImportRun()
     V48Assert(FileRead(path,"UTF-8")=original,"source log remains unchanged")
 }
 V597HideCheckpoint(app,run)
 {
     IPHide()
 }
 V597TestHideKeepsImport()
 {
     V596WithImport(V597TextRows(80),V597HideCase)
 }
 V597HideCase(path)
 {
     global IP
     IPImportRun(V597HideCheckpoint)
     V48Assert(IP.ImportTiming.Outcome="COMPLETE" && IP.Offline.Lines=80 && !IP.Visible,"hiding does not cancel continuous import")
     V48Assert(!IsObject(IP.Gui) && !IP.Timer && IP.PumpPeriod=0,"no implicit window or test timer")
 }
 V597TestLiveStatisticsPreserved()
 {
     V596WithImport(V596Text(20),V597LivePreservedCase)
 }
 V597LivePreservedCase(path)
 {
     global IP
     live := IP.Live,sig := V596Signature(live)
     IPImportRun()
     V48Assert(IP.Live=live && V596Signature(live)=sig && !IP.Active,"continuous saved-file input does not feed retained live data")
 }
 V597TestReportNoFakeBudget()
 {
     V596WithImport(V596Text(3),V597ReportCase)
 }
 V597ReportCase(path)
 {
     global IP
     IPImportRun(),r := IPImportTimingReport(IP.ImportTiming)
     V48Assert(InStr(r,"continuous throughput-first") && !InStr(r,"Last requested budget"),"report identifies uncapped loop, not zero-ms throttling")
     V48Assert(InStr(r,"read-ahead") && InStr(r,"wall time") && InStr(r,"not hard deadlines"),"timing limitations retained")
     V48Assert(!InStr(r,path) && !InStr(r,"Zoë") && !InStr(r,"Retained"),"timing report excludes source and actor identities")
 }
 V597TestTimingFrozen()
 {
     V596WithImport(V596Text(3),V597TimingCase)
 }
 V597TimingCase(path)
 {
     global IP
     IPImportRun(),t := IP.ImportTiming,ended := t.Stopped
     V48Assert(IPImportElapsed(t,ended+99999)=IPImportElapsed(t,ended+1),"completed continuous duration stays frozen")
     V48Assert(t.Records=IP.Offline.Lines && t.ReadBytes=IP.ImportEnd && t.Batches=1,"end report refreshes exact counts even without a checkpoint")
 }
 V597CountCheckpoint(app,run)
 {
     app.TestCount := app.HasOwnProp("TestCount") ? app.TestCount+1 : 1
 }
 V597TestCheckpointNotTimedSleep()
 {
     V596WithImport(V597TextRows(130),V597CheckpointCase)
 }
 V597CheckpointCase(path)
 {
     global IP
     IPImportRun(V597CountCheckpoint)
     V48Assert(IP.TestCount=2 && IP.ImportTiming.Checkpoints=2,"explicit checkpoints only after complete 64-record groups")
     V48Assert(IP.ImportTiming.MessageChecks=0 && IP.ImportTiming.ProgressUpdates=0,"manual suite services no real message queue and shows no window")
     V48Assert(IP.ImportTiming.Outcome="COMPLETE" && IP.Offline.Lines=130,"checkpoint returns to same continuous pass")
 }
 V597TestSmallFileNeedsNoCheckpoint()
 {
     V596WithImport(V597TextRows(3),V597SmallCase)
 }
 V597SmallCase(path)
 {
     global IP
     IPImportRun(V597CountCheckpoint)
     V48Assert(!IP.HasOwnProp("TestCount") && IP.ImportTiming.Checkpoints=0,"small import has no mandatory checkpoint or pause")
 }
 V597TestCallerBusyRestored()
 {
     V596WithImport(V596Text(3),V597BusyCase)
 }
 V597BusyCase(path)
 {
     global IP
     IP.Busy := false,IPImportRun()
     V48Assert(!IP.Busy && !IP.ImportRunning && IP.ImportDone,"direct continuous call acquires and releases its own busy guard")
 }
 V597TestActualPumpUsesContinuousPath()
 {
     V596WithImport(V597TextRows(80),V597PumpCase)
 }
 V597PumpCase(path)
 {
     global IP,logReadBusy,IrisTests
     oldRead := logReadBusy,oldTests := IrisTests.Busy
     try {
         logReadBusy := false,IrisTests.Busy := false,IP.Busy := false
         IPPump()
         V48Assert(IP.ImportDone && IP.ImportTiming.Continuous && IP.ImportTiming.Batches=1,"normal pump calls continuous runner")
         V48Assert(!IP.Busy && !IP.ImportRunning && !IP.Timer,"pump leaves clean state without starting test timers")
     }
     finally logReadBusy := oldRead,IrisTests.Busy := oldTests
 }
 V597TestMidnightOrder()
 {
     text := IPDemoLine(86399000,"@Midnight#1","=","Enter") "`n"
     text .= IPDemoLine(86399500,"@Midnight#1",V51Target(),"Damage",100) "`n"
     text .= IPDemoLine(86399500,"@Midnight#1",V51Target(),"Damage",101) "`n"
     text .= IPDemoLine(500,"@Midnight#1",V51Target(),"Damage",102) "`n"
     V596WithImport(text,V597OrderCase)
 }
 V597OrderCase(path)
 {
     global IP
     expected := V596Signature(V596Direct(FileRead(path,"UTF-8")))
     IPImportRun()
     V48Assert(V596Signature(IP.Offline)=expected,"same-millisecond duplicate-looking records and midnight retain original order")
 }
 V597TestMissingGuiPaintSafe()
 {
     p := IPNewApp(),p.Visible := true
     V48Assert(!IPImportPaint(p) && !p.Rendering,"no GUI means no progress paint, not a crash")
 }
 V597TestHiddenViewFrozenAndRestored()
 {
     V58Isolated(V597HiddenViewOuter)
 }
 V597HiddenViewOuter()
 {
     V596WithImport(V596Text(3),V597HiddenViewCase)
 }
 V597HiddenViewCase(path)
 {
     global IP
     try {
         IP.View := "Imported",IPWBuild(),IPRefresh(),u := IPWState()
         V48Assert(IP.InfoText.Text="Importing saved log" && IP.SegmentsLV.GetCount()=0,"previous rows cleared and import labelled")
         V48Assert(!u.Controls["Tabs"].Enabled && !u.Controls["PlayerChoice"].Enabled && !IP.CopyButton.Enabled,"review controls frozen during import")
         IPImportRun(),IPRefresh()
         V48Assert(u.Controls["Tabs"].Enabled && u.Controls["PlayerChoice"].Enabled && IP.SegmentsLV.GetCount()>0,"complete result restores browsing")
         V48Assert(!IsObject(IP.ImportDisplayData) && !DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"no leftover view lock and hidden test window")
     }
     finally {
         if IsObject(IP.Gui)
             IP.Gui.Destroy()
         IP.Gui := ""
     }
 }
 V597TestHiddenCancelRestoresControls()
 {
     V58Isolated(V597HiddenCancelOuter)
 }
 V597HiddenCancelOuter()
 {
     V596WithImport(V597TextRows(80),V597HiddenCancelCase)
 }
 V597HiddenCancelCase(path)
 {
     global IP
     try {
         IP.View := "Imported",IPWBuild(),IPRefresh()
         IPImportRun(V597CancelAtCheckpoint),IPRefresh(),u := IPWState()
         V48Assert(u.Controls["Tabs"].Enabled && IP.Offline.Partial && IP.ImportTiming.Outcome="CANCELED","partial cancel result restores review controls")
         V48Assert(IP.SegmentsLV.GetCount()>0 && !InStr(IP.Status,"display error"),"canceled prefix remains browsable without UI exception")
     }
     finally {
         if IsObject(IP.Gui)
             IP.Gui.Destroy()
         IP.Gui := ""
     }
 }
 V597TestHiddenPainterDoesNotTouchData()
 {
     p := IPNewApp(),p.Offline := IPNewData("unchanged"),p.Visible := false
     s := p.Offline
     V48Assert(!IPImportPaint(p) && p.Offline=s && s.Lines=0 && !p.Rendering,"hidden heartbeat neither renders nor changes data")
 }
 ; v59.8 tests run only in the existing isolated manual harness.
 V598Ready()
 {
     V591Ready()
     a := IAState()
     a.LoadTiming := "",a.QueryTiming := "",a.SearchTiming := "",a.LogPending := false
     a.CancelRequested := false,a.PerfRun := "",a.Pumping := false,a.Busy := false
     return a
 }
 V598WithReview(action)
 {
     V591Isolated(V598ReviewInner.Bind(action))
 }
 V598ReviewInner(action)
 {
     a := V598Ready()
     d := IADemoData()
     IAInstallData(d,"@Demo DPS#102")
     IAQueryPump()
     action.Call(a,d)
 }
 V598SourceText()
 {
     text := ""
     Loop 1500
         text .= "; synthetic prefix " A_Index "`n"
     for line in IADemoLines()
         text .= line "`n"
     return text
 }
 V598WithSource(action)
 {
     V591Isolated(V598SourceInner.Bind(action))
 }
 V598SourceInner(action)
 {
     global IP
     static serial := 0
     serial += 1
     path := A_ScriptDir "\Iris598_" DllCall("GetCurrentProcessId","UInt") "_" serial ".txt"
     V48Assert(!FileExist(path),"source test never overwrites a file")
     a := V598Ready(),text := V598SourceText()
     try {
         f := FileOpen(path,"w","UTF-8-RAW"),f.Write(text),f.Close()
         s := V596Direct(text),IP.Offline := s,IP.View := "Imported",IP.Selected := s.Segments.Length
         IP.Actor := "@Demo DPS#102",IP.ImportPath := path,IP.Encoding := "UTF-8",IP.Follow := false
         seg := IPSelectedSegment(),seg.SourcePath := path,seg.SourceEncoding := "UTF-8"
         seg.SourceSnapshotEnd := FileGetSize(path)
         action.Call(a,s,seg,path,text)
     }
     finally {
         IACancel()
         if FileExist(path)
             FileDelete(path)
     }
 }
 V598LargeQuery(a,d)
 {
     ; Demo times are absolute log milliseconds, not seconds from the pull.
     at := d.Start+19000
     V48Assert(at>=d.Start && at<=d.Last,"large-query fixture timestamp belongs to the demo fight")
     ev := V59Parsed(IPDemoLine(Mod(at,86400000),"@Demo DPS#102",V51Target(),"Damage",1),at,90000)
     ev.Analysis.D := 1
     Loop 3000
         d.Rows.Push(ev)
     IAApplyRange()
     return a.QueryJob
 }
 V598CancelCheckpoint(kind,job)
 {
     IACancel()
     V48Assert(IAState().Pumping && IAState().CancelRequested,"cancel is a request inside the owned invocation")
     if job.HasOwnProp("Snapshot")
         V48Assert(IsObject(job.Snapshot.File),"file remains owned until the safe checkpoint unwinds")
 }
 V598FaultCheckpoint(kind,job)
 {
     throw Error("Synthetic checkpoint failure")
 }
 V598LiveCheckpoint(kind,job)
 {
     global IP
     IP.Active := true
 }
 V598SupersedeCheckpoint(kind,job)
 {
     IAState().Generation += 1
 }
 V598TestTimingDefault()
 {
     t := IAOpTiming("Range query",32,1000)
     V48Assert(t.Started=1000 && t.Stopped=-1 && t.Total=32 && t.Phases.Count=0,"timing construction is inert")
 }
 V598TestTimingPhases()
 {
     t := IAOpTiming("Analysis load",0,1000)
     IAOpStage(t,"Source replay",1100),IAOpStage(t,"Effects",1600),IAOpStop(t,"COMPLETE",2000)
     V48Assert(t.Phases["Queued"]=100 && t.Phases["Source replay"]=500 && t.Phases["Effects"]=400,"stage times partition elapsed wall time")
     IAOpStop(t,"ERROR",3000)
     V48Assert(t.Stopped=2000 && t.Outcome="COMPLETE","completion is frozen")
 }
 V598TestTimingPrivacy()
 {
     t := IAOpTiming("Analysis load",0,0),t.Records := 123,IAOpStop(t,"COMPLETE",1500)
     t.PrivatePath := "C:\SecretUser\SecretLog.txt"
     text := IAAnalysisTimingReport(t,"","",5000)
     V48Assert(InStr(text,"1.500") && InStr(text,"123") && !InStr(text,"SecretUser"),"report contains operation counters without local identity")
     V48Assert(!InStr(text,"C:\") && !InStr(text,"@Demo"),"report omits paths and players")
 }
 V598TestOwnerAndGeneration()
 {
     job := {Generation:5},state := {Work:job,Generation:5,CancelRequested:false}
     V48Assert(IAOpCurrent(state,"Work",job),"exact generation and job match")
     state.Generation := 6
     V48Assert(!IAOpCurrent(state,"Work",job),"older generation rejected")
     state.Generation := 5,state.CancelRequested := true
     V48Assert(!IAOpCurrent(state,"Work",job),"pending cancellation rejected")
 }
 V598TestLoadOneInvocation()
 {
     V598WithSource(V598LoadCase)
 }
 V598LoadCase(a,s,seg,path,text)
 {
     original := V596Signature(s)
     IAOpenSelected(),j := a.Work
     V48Assert(IsObject(j) && a.Busy,"explicit load creates private job")
     IALoadPump()
     V48Assert(!IsObject(a.Work) && a.LoadTiming.Outcome="COMPLETE" && a.LoadTiming.Records>1500,"source replay finishes beyond former 120-record batch")
     V48Assert(IsObject(a.Data) && a.Data.BaseVerified && a.Data.Path=path,"fully reconciled source is installed")
     V48Assert(V596Signature(s)=original,"original parsed data remains unchanged")
     IAQueryPump()
     V48Assert(a.Result.D=30000 && a.Result.Rotation.Length=25,"native observer and query retain demo results")
     V48Assert(FileRead(path,"UTF-8")=text,"source file remains unmodified")
 }
 V598TestLoadCancel()
 {
     V598WithSource(V598LoadCancelCase)
 }
 V598LoadCancelCase(a,s,seg,path,text)
 {
     previous := IADemoData(),a.Data := previous
     IAOpenSelected(),j := a.Work
     IALoadPump(V598CancelCheckpoint)
     V48Assert(a.Data=previous && a.LoadTiming.Outcome="CANCELED","canceled replay does not replace prior review")
     V48Assert(!IsObject(j.Snapshot.File) && !a.Pumping && !a.Busy,"canceled replay closes resources after unwinding")
 }
 V598TestLoadMismatchRejected()
 {
     V598WithSource(V598MismatchCase)
 }
 V598MismatchCase(a,s,seg,path,text)
 {
     previous := IADemoData(),a.Data := previous
     IAOpenSelected()
     a.Work.Target.Last += 7
     IALoadPump()
     V48Assert(a.Data=previous && a.LoadTiming.Outcome="ERROR","wrong boundary is not replaced with an approximate fight")
 }
 V598TestLoadReaderFailure()
 {
     V598WithSource(V598ReaderCase)
 }
 V598ReaderCase(a,s,seg,path,text)
 {
     previous := IADemoData(),a.Data := previous
     IAOpenSelected(),a.Work.Snapshot.File.Close()
     IALoadPump()
     V48Assert(a.LoadTiming.Outcome="ERROR" && a.Data=previous && !a.Busy,"reader failure stays inside analysis")
 }
 V598TestLoadGuard()
 {
     V598WithSource(V598LoadGuardCase)
 }
 V598LoadGuardCase(a,s,seg,path,text)
 {
     global IP
     IAOpenSelected(),j := a.Work
     IALoadPump(V598LiveCheckpoint)
     V48Assert(IP.Active && a.LoadTiming.Outcome="CANCELED" && !IsObject(j.Snapshot.File),"new live collection preempts analysis without being stopped")
     IP.Active := false
 }
 V598TestQueryOneInvocation()
 {
     V598WithReview(V598QueryCase)
 }
 V598QueryCase(a,d)
 {
     j := V598LargeQuery(a,d),expected := IAQuery(d,j.Query)
     IAQueryPump()
     r := a.Result
     V48Assert(a.QueryTiming.Outcome="COMPLETE" && a.QueryTiming.Records=d.Rows.Length,"range query is not capped at 250 records")
     V48Assert(r.D=expected.D && r.T=expected.T && r.H=expected.H && r.E=expected.E && r.Rotation.Length=expected.Rotation.Length,"continuous query matches synchronous calculator")
     V48Assert(r.Effects.Length=expected.Effects.Length && r.Bins.Count=expected.Bins.Count,"effects and buckets retained")
 }
 V598TestQueryCancel()
 {
     V598WithReview(V598QueryCancelCase)
 }
 V598QueryCancelCase(a,d)
 {
     previous := a.Result,j := V598LargeQuery(a,d)
     IAQueryPump(V598CancelCheckpoint)
     V48Assert(a.Result=previous && a.QueryTiming.Outcome="CANCELED" && !a.Busy,"cancel retains previous completed numeric result")
 }
 V598TestQuerySuperseded()
 {
     V598WithReview(V598QuerySupersededCase)
 }
 V598QuerySupersededCase(a,d)
 {
     previous := a.Result,j := V598LargeQuery(a,d)
     IAQueryPump(V598SupersedeCheckpoint)
     V48Assert(a.Result=previous && a.QueryTiming.Outcome="CANCELED","stale query cannot commit")
 }
 V598TestQueryFailure()
 {
     V598WithReview(V598QueryFailureCase)
 }
 V598QueryFailureCase(a,d)
 {
     previous := a.Result,j := V598LargeQuery(a,d)
     IAQueryPump(V598FaultCheckpoint)
     V48Assert(a.Result=previous && a.QueryTiming.Outcome="ERROR" && !a.Pumping,"query failure releases its owner")
 }
 V598TestDeferredLog()
 {
     V598WithReview(V598DeferredCase)
 }
 V598DeferredCase(a,d)
 {
     V48Assert(a.LogPending && !IsObject(a.RawJob) && !a.Busy,"chart completion does not start event search")
     V7826SelectReviewPage(7)
     V48Assert(IsObject(a.RawJob) && !a.LogPending,"opening the log starts exactly the pending search")
     IARawPump()
     V48Assert(a.SearchTiming.Outcome="COMPLETE" && a.Matches.Length>0,"range log finishes in one native invocation")
 }
 V598TestRangeSearchEquivalence()
 {
     V598WithReview(V598RangeSearchCase)
 }
 V598RangeSearchCase(a,d)
 {
     V598LargeQuery(a,d),IAQueryPump()
     a.Controls["LogAll"].Value := 1,a.Controls["LogSearch"].Value := "",a.Page := 1
     IABrowseStart(false),j := a.RawJob
     IARawPump()
     count := 0
     for ev in d.Rows {
         if IAInRange(ev,a.Query,d) && IARawMatches(ev,ev.Analysis.Raw,j)
             count += 1
     }
     V48Assert(count>=3000,"bulk fixture supplies at least 3,000 eligible range records")
     V48Assert(j.Count=count,"continuous search matches the independent eligible-record count")
     V48Assert(a.Matches.Length=Min(a.PageSize,count),"native page limit remains without losing the full match count")
 }
 V598TestRawSearchOneInvocation()
 {
     V598WithSource(V598RawCase)
 }
 V598RawCase(a,s,seg,path,text)
 {
     a.RawPath := path,a.RawEncoding := "UTF-8",a.Controls["LogAll"].Value := 1
     a.Controls["LogType"].Choose(1),a.Controls["LogSearch"].Value := "",a.Page := 1
     IABrowseStart(true),j := a.RawJob
     IARawPump()
     V48Assert(a.SearchTiming.Outcome="COMPLETE" && j.Count=s.Lines && j.Count>1500,"whole-file scan retains malformed and out-of-fight records")
     V48Assert(a.Matches.Length=a.PageSize && !IsObject(j.Snapshot.File),"page storage bounded and file closed")
     V48Assert(a.Matches[1].Seq=1 && a.Matches[a.PageSize].Seq=a.PageSize,"original record order retained")
 }
 V598TestRawCancel()
 {
     V598WithSource(V598RawCancelCase)
 }
 V598RawCancelCase(a,s,seg,path,text)
 {
     a.RawPath := path,a.RawEncoding := "UTF-8",old := a.Matches
     IABrowseStart(true),j := a.RawJob
     IARawPump(V598CancelCheckpoint)
     V48Assert(a.Matches=old && a.SearchTiming.Outcome="CANCELED" && !IsObject(j.Snapshot.File),"cancel does not install an incomplete log page")
 }
 V598TestRawFiltersAndPage()
 {
     V598WithSource(V598RawFilterCase)
 }
 V598RawFilterCase(a,s,seg,path,text)
 {
     a.RawPath := path,a.RawEncoding := "UTF-8",a.Controls["LogAll"].Value := 1
     a.Controls["LogType"].Choose(9),a.Controls["LogSearch"].Value := "synthetic prefix",a.Page := 2
     IABrowseStart(true),j := a.RawJob
     IARawPump()
     V48Assert(j.Count=1500 && a.Matches.Length=300,"filter searches the complete source, not just the requested page")
     V48Assert(a.Matches[1].Seq=301 && a.Matches[300].Seq=600,"second page starts after first 300 matches")
 }
 V598TestCancelBeforePump()
 {
     V598WithReview(V598CancelQueuedCase)
 }
 V598CancelQueuedCase(a,d)
 {
     previous := a.Result
     IAApplyRange(),IACancel(),IAQueryPump()
     V48Assert(a.Result=previous && !a.Busy && !IsObject(a.QueryJob),"queued cancellation never runs a query")
 }
 V598TestNoDiagnosticTimers()
 {
     V598WithReview(V598NoTimerCase)
 }
 V598NoTimerCase(a,d)
 {
     V48Assert(!IWScrollState().Installed,"hidden native tests do not install wheel message monitors")
     IAApplyRange(),j := a.QueryJob
     Sleep(25)
     V48Assert(a.QueryJob=j && j.Index=1,"diagnostics require explicit pump calls rather than automatic timer execution")
 }
 V598TestSignedWheel()
 {
     V48Assert(IWScrollSigned16(0xFF88)=-120 && IWScrollSigned16(120)=120,"signed wheel delta decoded")
     V48Assert(IWScrollSigned16(0xFFF0)=-16 && IWScrollSigned16(32767)=32767,"negative monitor coordinates decoded")
 }
 V598TestPartialWheel()
 {
     p := IWScrollTicks(0,30)
     Loop 3
         p := IWScrollTicks(p.Remainder,30)
     V48Assert(p.Ticks=1 && p.Remainder=0,"four partial notches produce one notch")
     p := IWScrollTicks(-30,-100)
     V48Assert(p.Ticks=-1 && p.Remainder=-10,"negative partial notch retained")
     p := IWScrollTicks(30,-30)
     V48Assert(p.Ticks=0 && p.Remainder=0,"opposite motion cancels residual")
 }
 V598TestWheelReset()
 {
     s := IWScrollState(),s.Control := 123,s.Axis := "V",s.Remainder := 80
     IWScrollReset()
     V48Assert(s.Control=0 && s.Axis="" && s.Remainder=0,"tab changes cannot carry partial wheel input to a new table")
 }
 V598FillTable(lv,count := 500)
 {
     lv.Opt("-Redraw Count" count),lv.Delete()
     Loop count
         lv.Add("",A_Index,"Synthetic row " A_Index)
     lv.ModifyCol(1,180),lv.ModifyCol(2,1400),lv.Opt("+Redraw")
 }
 V598AssertScrollable(lv)
 {
     before := IWScrollMetrics(lv)
     V48Assert(before.Rows=500 && before.Page>=1 && before.RowHeight>0,"native table has a complete row viewport")
     V48Assert(IWScrollMove(lv,3,false,3),"native vertical scroll accepted")
     after := IWScrollMetrics(lv)
     V48Assert(after.Top>before.Top,"top index advances downward")
     IWScrollMove(lv,-3,false,3)
     V48Assert(IWScrollMetrics(lv).Top=before.Top,"reverse scroll restores top index")
     IWScrollMove(lv,2,true,3)
     V48Assert(IWScrollMetrics(lv).Horizontal>before.Horizontal,"native horizontal scroll exposes off-screen columns")
 }
 V598TestAnalysisLogScroll()
 {
     V598WithReview(V598ScrollCase.Bind(7,"Log"))
 }
 V598TestAnalysisDamageScroll()
 {
     V598WithReview(V598ScrollCase.Bind(2,"Damage"))
 }
 V598TestAnalysisTargetsScroll()
 {
     V598WithReview(V598ScrollCase.Bind(2,"Targets"))
 }
 V598TestAnalysisRotationScroll()
 {
     V598WithReview(V598ScrollCase.Bind(6,"Rotation"))
 }
 V598TestAnalysisCyclesScroll()
 {
     V598WithReview(V598ScrollCase.Bind(6,"Cycles"))
 }
 V598ScrollCase(tab,key,a,d)
 {
     a.LogPending := false,V7826SelectReviewPage(tab)
     lv := a.Tables[key],V598FillTable(lv),IAApplyPageVisibility()
     V598AssertScrollable(lv)
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd),"test never shows the parent window")
 }
 V598TestMainLogScroll()
 {
     V598WithReview(V598MainScrollCase)
 }
 V598MainScrollCase(a,d)
 {
     V58SelectTab(6),u := IPWState(),lv := u.Controls["Events"]
     V598FillTable(lv),V598AssertScrollable(lv)
 }
 V598TestScrollSettings()
 {
     V598WithReview(V598ScrollSettingCase)
 }
 V598ScrollSettingCase(a,d)
 {
     V7826SelectReviewPage(6),lv := a.Tables["Rotation"]
     V598FillTable(lv),IAApplyPageVisibility(),m := IWScrollMetrics(lv)
     IWScrollMove(lv,1,false,0)
     V48Assert(IWScrollMetrics(lv).Top=m.Top,"zero Windows line preference does not scroll")
     IWScrollMove(lv,1,false,0xFFFFFFFF)
     V48Assert(IWScrollMetrics(lv).Top>m.Top,"page-scroll setting is honored")
 }
 V598TestHiddenWheelIgnored()
 {
     V598WithReview(V598HiddenWheelCase)
 }
 V598HiddenWheelCase(a,d)
 {
     global IP
     V48Assert(!IsObject(IWScrollAt(10,10,0)),"no foreground host means no scroll capture")
     V48Assert(!IsObject(IWScrollAt(10,10,123)),"unrelated application is not captured")
     V48Assert(!IsObject(IWScrollAt(10,10,IP.Gui.Hwnd)),"hidden Iris table is not a hit target")
 }
 V598TestDestroyedScrollControl()
 {
     g := Gui(),lv := g.AddListView("w200 h100",["One","Two"])
     g.Destroy()
     V48Assert(!IWScrollMove(lv,1) && IWScrollMetrics(lv).Rows=0,"destroyed controls are safely ignored")
 }
 V598TestRenderVisibility()
 {
     V598WithReview(V598RenderVisibilityCase)
 }
 V598RenderVisibilityCase(a,d)
 {
     for tab in [1,2,3,4,5,6,7,8] {
         a.LogPending := false,V7826SelectReviewPage(tab)
         IARender(false)
         for group,controls in a.Groups {
             for c in controls {
                 if c.Type="ListView"
                     V48Assert(V58ChildVisible(c)=(group=tab),"redraw preserves only the active page's table visibility")
             }
         }
         V48Assert(V58ChildVisible(a.Controls["Summary"])=(tab=8),"summary remains on its own page after redraw")
     }
 }
 V598TestBackgroundLogStaysHidden()
 {
     V598WithReview(V598BackgroundLogCase)
 }
 V598BackgroundLogCase(a,d)
 {
     IABrowseStart(false),IARawPump()
     V48Assert(a.Tab=1 && !V58ChildVisible(a.Tables["Log"]),"background event rendering cannot cover Charts")
     V48Assert(V58ChildVisible(a.Tables["Buckets"]),"active chart table remains visible")
 }
 V598TestMainSnapshotScrollStable()
 {
     V598WithReview(V598MainStableCase)
 }
 V598MainStableCase(a,d)
 {
     global IP
     V58SelectTab(6),u := IPWState(),seg := IPSelectedSegment(),sample := u.EventRows[1]
     u.EventRows := []
     Loop 500
         u.EventRows.Push(sample)
     u.AllEvents := true,u.EventTotal := 500,u.EventSignature := "",IPWEvents(seg)
     lv := u.Controls["Events"],IWScrollMove(lv,3,false,3),top := IWScrollMetrics(lv).Top
     V48Assert(top>0,"snapshot is scrolled before periodic refresh")
     IPRefresh()
     V48Assert(IWScrollMetrics(lv).Top=top,"unchanged main snapshot does not snap back on refresh")
 }
 V598TestSmallLogViewport()
 {
     for w in [664,904,1604] {
         for h in [428,458,498,508,758] {
             r := IAEmbeddedLayout(w,h).Rects
             V48Assert(r["Log"][4]>=90,"minimum log height includes header, scrollbars and data rows")
             V48Assert(r["Log"][2]+r["Log"][4]<=r["RawDetail"][2],"log does not overlap raw-line detail")
             V48Assert(r["Rotation"][2]+r["Rotation"][4]<h-40,"rotation remains inside page")
         }
     }
 }
 V598TestScrollReportPrivacy()
 {
     V598WithReview(V598ReportCase)
 }
 V598ReportCase(a,d)
 {
     text := IWScrollReport()
     V48Assert(InStr(text,"Analysis tab:") && InStr(text,"visible capacity="),"report includes useful table geometry")
     V48Assert(!InStr(text,"Demo DPS") && !InStr(text,"C:\") && !InStr(text,"@"),"scroll report omits personal data and log contents")
 }
 ; v59.9: pure wheel arithmetic; manual diagnostic harness only.
 V599TestPositiveWheelRemainder()
 {
     for total in [0,1,30,60,90,119] {
         p := IWScrollTicks(0,total)
         V48Assert(p.Ticks=0 && p.Remainder=total,"positive partial notch stays pending")
     }
 }
 V599TestNegativeWheelRemainder()
 {
     for total in [-1,-30,-60,-90,-119] {
         p := IWScrollTicks(0,total)
         V48Assert(p.Ticks=0 && p.Remainder=total,"negative partial notch must not round down to a whole tick")
     }
 }
 V599TestWheelBoundaries()
 {
     for sample in [[119,0,119],[120,1,0],[121,1,1],[239,1,119],[240,2,0],[241,2,1],
         [-119,0,-119],[-120,-1,0],[-121,-1,-1],[-239,-1,-119],[-240,-2,0],[-241,-2,-1],
         [32767,273,7],[-32768,-273,-8]] {
         p := IWScrollTicks(0,sample[1])
         V48Assert(p.Ticks=sample[2] && p.Remainder=sample[3],"exact tick boundary preserves signed remainder")
     }
 }
 V599TestWheelDirectionChanges()
 {
     p := IWScrollTicks(90,-30)
     V48Assert(p.Ticks=0 && p.Remainder=60,"opposite movement reduces the accumulated remainder")
     p := IWScrollTicks(p.Remainder,-90)
     V48Assert(p.Ticks=0 && p.Remainder=-30,"crossing zero does not emit a premature tick")
     p := IWScrollTicks(p.Remainder,-90)
     V48Assert(p.Ticks=-1 && p.Remainder=0,"complete negative notch is emitted once")
     p := IWScrollTicks(0,90)
     p := IWScrollTicks(p.Remainder,-90)
     V48Assert(p.Ticks=0 && p.Remainder=0,"equal opposing partial movements cancel")
     p := IWScrollTicks(-119,240)
     V48Assert(p.Ticks=1 && p.Remainder=1,"reversal with a multi-notch packet retains the excess")
 }
 V599TestWheelPacketSplitting()
 {
     for step in [1,2,3,5,10,15,20,30,40,60,120] {
         for direction in [-1,1] {
             remainder := 0,ticks := 0
             Loop 120//step {
                 p := IWScrollTicks(remainder,direction*step)
                 ticks += p.Ticks,remainder := p.Remainder
             }
             V48Assert(ticks=direction && remainder=0,"split same-direction wheel packets produce exactly one tick")
         }
     }
 }
 V599TestWheelIntegerTypes()
 {
     for remainder in [-119,-60,-1,0,1,60,119] {
         for delta in [-32768,-240,-120,-1,0,1,120,240,32767] {
             p := IWScrollTicks(remainder,delta),total := remainder+delta
             V48Assert(Type(p.Ticks)="Integer" && Type(p.Remainder)="Integer","integer wheel input produces integer tick and remainder values")
             V48Assert(p.Ticks*120+p.Remainder=total && Abs(p.Remainder)<120,"wheel movement is conserved with bounded remainder")
             V48Assert(p.Remainder=0 || (p.Remainder>0)=(total>0),"remainder retains the accumulated direction")
         }
     }
 }
 ; v59.10: test the real shared picker filters without showing file dialogs.
 V5910PickerMasks(filter)
 {
     if !RegExMatch(filter,"^[^()]+\(([^()]+)\)$",&m)
         throw Error("Unexpected file-filter grammar in diagnostic fixture.")
     return StrSplit(m[1],";"," `t")
 }
 
 V5910PickerMatches(name,filter)
 {
     ; Windows shell wildcard matching, not a parser or upload operation.
     for pattern in V5910PickerMasks(filter) {
         if DllCall("Shlwapi\PathMatchSpecW","Str",name,"Str",pattern,"Int")
             return true
     }
     return false
 }
 
 V5910TestLogPickerMasks()
 {
     filter := IPLogFileFilter(),masks := V5910PickerMasks(filter)
     V48Assert(filter=="Combat logs (*.txt; *.log)","default log picker uses semicolon-separated extensions")
     V48Assert(masks.Length=2 && masks[1]="*.txt" && masks[2]="*.log","text and log patterns are independent")
     V48Assert(IPLogFileFilter(false)==filter,"explicit import scope matches default")
 }
 
 V5910TestLogPickerNames()
 {
     filter := IPLogFileFilter()
     for name in ["combat_2026-09-27_03_12_10_123456.txt","combat_2026-09-27_03_12_10_123456.log", "Archive-combat_sample.txt", "raid recording (1).TXT", "raid recording.LOG", "sample.with.dots.log"]
         V48Assert(V5910PickerMatches(name,filter),"ordinary log filename visible: " name)
     for name in ["combat_sample.zip","combat_sample.txt.gz","combat_sample.txt.bak","SophieBot.ahk","SWTOR_Kenku_Settings.ini","report.csv"]
         V48Assert(!V5910PickerMatches(name,filter),"unrelated file hidden by default: " name)
 }
 
 V5910TestUploadFilterPreserved()
 {
     filter := IPLogFileFilter(true),masks := V5910PickerMasks(filter)
     V48Assert(filter=="Combat logs (*.txt)" && masks.Length=1 && masks[1]="*.txt","upload picker remains aligned with txt-only validation")
     for name in ["combat_sample.txt","Archive-combat_sample.TXT","raid recording (1).txt"]
         V48Assert(V5910PickerMatches(name,filter),"ordinary text log remains visible for upload: " name)
     for name in ["combat_sample.log","combat_sample.zip","combat_sample.txt.bak","SophieBot.ahk","settings.ini"]
         V48Assert(!V5910PickerMatches(name,filter),"upload filter does not advertise unsupported files: " name)
 }
 ; v61 manual-only parser-home and focused-settings regression groups.
 V60FixtureGlobals()
 {
     return ["IC","AEControls","CoTankAbilityCheckboxes","DarknessAbilityCheckboxes",
         "TythManualCheckboxes","TythExtraCheckboxes","TythGraceCheckboxes","RouteStates",
         "MasterAudioCheckbox","UniversalCalloutsCheckbox","AutoBossCheckbox","BossNumpadCheckbox",
         "AudioModeChoice","BridgeVoiceChoice","BridgeOutputChoice","BridgeTestButton",
         "BridgePhrasesButton","BridgeReloadButton","BridgeSetupNote","TauntCheckbox",
         "AOETauntCheckbox","ShieldAdrenalCheckbox","ExplosiveFuelCheckbox","EnergyYieldCheckbox",
         "OilSlickCheckbox","EnergyShieldCheckbox","KoltoOverloadCheckbox","CarbonizeCheckbox",
         "CoTankTauntCheckbox","RecklessnessTankOnlyCheckbox","TythMasterCheckbox","TythReportCheckbox","Tyth8Checkbox","Tyth65Checkbox",
         "TythStatusText","TythManualStatusText","BackgroundLogCheckbox","StaleLogCheckbox",
         "PrepullSecondsEdit","EventAgeSecondsEdit","ClockOffsetEdit","ReliabilityStatusText",
         "BossChoice","AutoBossProfileCheckbox","BossAutoStatusText","TythMouseChoice","TythSlot1PhraseEdit"]
 }
 V60WithSettings(action) => V672LibraryUIInner(V60SettingsInner.Bind(action))

 V60SettingsInner(action)
 {
     global
     local old := Map(),name,value,page
     for name in V60FixtureGlobals()
         old[name] := IsSet(%name%) ? %name% : ""
     try {
         IC := ICNewState(),AEControls := {},RouteStates := Map()
         CoTankAbilityCheckboxes := Map(),DarknessAbilityCheckboxes := Map()
         TythManualCheckboxes := Map(),TythExtraCheckboxes := Map(),TythGraceCheckboxes := Map()
         ICBuildSettings(),SyncCalloutCheckboxes()
         action.Call()
     }
     finally {
         for name,page in IC.Pages
             try page.Gui.Destroy()
         for name,value in old
             %name% := value
     }
 }
 V60TestInertState()
 {
     c := ICNewState()
     V48Assert(!c.Ready && !c.TrayInstalled && c.Pages.Count=0 && !IsObject(c.ModeText),"settings state has no windows, timers or startup work")
 }
 V60TestPageCatalogue()
 {
     keys := ICPageKeys(),seen := Map()
     for key in keys {
         V48Assert(!seen.Has(key),"unique settings page")
         seen[key] := true
     }
     V48Assert(keys.Length=10 && seen.Has("General") && seen.Has("Reliability") && seen.Has("Boss") && seen.Has("AE") && seen.Has("AudioAdvanced"),"all remaining settings have direct pages")
 }
 V60TestLegacyRouting()
 {
     expected := ["Voice","Your","Cotank","Tyth","Manual","Reliability","Boss","AE","Nahut","Parser"]
     for i,key in expected
         V48Assert(ICLegacyPage(i)=key,"legacy entry route retained without legacy tab control")
     V48Assert(ICLegacyPage(0)="" && ICLegacyPage(11)="","invalid route is inert")
 }
 V60TestStartupGuard()
 {
     global IP,IC
     before := IP.Gui,ready := IC.Ready
     V48Assert(!IPLaunchWorkspace() && IP.Gui=before && IC.Ready=ready,"manual test mode never launches or constructs the main window")
 }
 V60TestF10Policy()
 {
     V48Assert(IPWorkspaceTogglePlan(false,false)="show","hidden parser opens")
     V48Assert(IPWorkspaceTogglePlan(true,false)="show","background parser is brought back")
     V48Assert(IPWorkspaceTogglePlan(true,true)="hide","focused parser toggles away")
     V48Assert(IPWorkspaceTogglePlan(false,true)="show","visibility wins over stale focus")
 }
 V60TestHiddenSettingsBuild()
 {
     V60WithSettings(V60HiddenBuildCase)
 }
 V60HiddenBuildCase()
 {
     global IC
     V48Assert(IC.Ready && IC.Pages.Count=10,"ten focused forms created")
     for key,page in IC.Pages {
         V48Assert(!page.Visible && !DllCall("User32\IsWindowVisible","Ptr",page.Gui.Hwnd,"Int"),"settings remain physically hidden")
         for c in page.Gui
             V48Assert(!InStr(c.Type,"Tab"),"no retired tabbed hub is recreated")
     }
 }
 V60TestGeneralControls()
 {
     V60WithSettings(V60GeneralCase)
 }
 V60GeneralCase()
 {
     global IC,MasterAudioCheckbox,UniversalCalloutsCheckbox,AutoBossCheckbox,BossNumpadCheckbox
     global soundboardsEnabled,universalCalloutsEnabled,autoBossCalloutsEnabled,bossNumpadCalloutsEnabled
     for c in [MasterAudioCheckbox,UniversalCalloutsCheckbox,AutoBossCheckbox]
         V48Assert(c.Gui=IC.Pages["General"].Gui,"general master switches remain together")
     V48Assert(BossNumpadCheckbox.Gui=IC.Pages["Boss"].Gui,"manual boss control belongs to boss setup")
     V48Assert(MasterAudioCheckbox.Value=!!soundboardsEnabled && UniversalCalloutsCheckbox.Value=!!universalCalloutsEnabled,"master preferences loaded, not reset")
     V48Assert(AutoBossCheckbox.Value=!!autoBossCalloutsEnabled && BossNumpadCheckbox.Value=!!bossNumpadCalloutsEnabled,"automatic/manual switches retained")
 }
 V60TestVoiceControls()
 {
     V60WithSettings(V60VoiceCase)
 }
 V60VoiceCase()
 {
     global IC,BridgeVoiceChoice,BridgeOutputChoice,BridgeSetupNote
     global bridgeVoiceName,bridgeOutputName
     for c in [BridgeVoiceChoice,BridgeOutputChoice,BridgeSetupNote,IC.LocalVoiceButton]
         V48Assert(c.Gui=IC.Pages["Voice"].Gui,"voice/device settings available without a boss selector")
     V48Assert(BridgeVoiceChoice.Text=bridgeVoiceName && BridgeOutputChoice.Text=bridgeOutputName,"saved speech voice and output selections preserved")
     V48Assert(IC.Pages.Has("AudioAdvanced"),"optional Discord setup has its own advanced page")
 }
 V60TestYourControls()
 {
     V60WithSettings(V60YourCase)
 }
 V60YourCase()
 {
     global IC,DarknessAbilityCheckboxes,TauntCheckbox,AOETauntCheckbox,EnergyYieldCheckbox
     V48Assert(DarknessAbilityCheckboxes.Count=6,"all six Darkness switches retained")
     for key,c in DarknessAbilityCheckboxes
         V48Assert(c.Gui=IC.Pages["Your"].Gui,"personal Darkness control parent")
     V48Assert(TauntCheckbox.Gui=IC.Pages["Your"].Gui && AOETauntCheckbox.Gui=TauntCheckbox.Gui && EnergyYieldCheckbox.Gui=TauntCheckbox.Gui,"shared and PT settings retained")
 }
 V60TestCotankControls()
 {
     V60WithSettings(V60CotankCase)
 }
 V60CotankCase()
 {
     global IC,CoTankAbilityCheckboxes,CoTankTauntCheckbox
     V48Assert(CoTankAbilityCheckboxes.Count=14,"two shared, six PT and six Darkness cotank settings")
     for key,c in CoTankAbilityCheckboxes
         V48Assert(c.Gui=IC.Pages["Cotank"].Gui,"cotank controls remain independent")
     V48Assert(CoTankTauntCheckbox.Gui=IC.Pages["Cotank"].Gui,"separate cotank taunt retained")
 }
 V60TestTythControls()
 {
     V60WithSettings(V60TythCase)
 }
 V60TythCase()
 {
     global IC,TythGraceCheckboxes,TythExtraCheckboxes,TythMasterCheckbox,Tyth65Checkbox
     V48Assert(TythGraceCheckboxes.Count=3 && TythExtraCheckboxes.Count=5,"all Grace and cleave/burn switches retained")
     V48Assert(TythMasterCheckbox.Gui=IC.Pages["Tyth"].Gui && Tyth65Checkbox.Gui=TythMasterCheckbox.Gui,"Tyth master and corrected eight-wave controls available")
 }
 V60TestManualControls()
 {
     V60WithSettings(V60ManualCase)
 }
 V60ManualCase()
 {
     global IC,TythManualCheckboxes,AEControls
     V48Assert(TythManualCheckboxes.Count=1 && TythManualCheckboxes.Has("Slot1"),"only the finished Tyth manual call is available")
     for key,c in TythManualCheckboxes
         V48Assert(c.Gui=IC.Pages["Manual"].Gui,"Tyth manual controls on manual form")
     V48Assert(AEControls.Manual.Gui=IC.Pages["Manual"].Gui,"A&E manual enable remains accessible")
 }
 V60TestReliabilityControls()
 {
     V60WithSettings(V60ReliabilityCase)
 }
 V60ReliabilityCase()
 {
     global IC,StaleLogCheckbox,BackgroundLogCheckbox,PrepullSecondsEdit,ClockOffsetEdit
     global rejectOldLogAudio,allowBackgroundLogAudio,coTankPrepullMs,logClockOffsetMs
     V48Assert(StaleLogCheckbox.Gui=IC.Pages["Reliability"].Gui && StaleLogCheckbox.Value=!!rejectOldLogAudio,"timestamp-rejection setting is not reset")
     V48Assert(BackgroundLogCheckbox.Value=!!allowBackgroundLogAudio && PrepullSecondsEdit.Value=coTankPrepullMs//1000,"background and prepull preferences retained")
     V48Assert(ClockOffsetEdit.Value=logClockOffsetMs,"clock offset retained")
 }
 V60TestBossControls()
 {
     V60WithSettings(V60BossCase)
 }
 V60BossCase()
 {
     global IC,BossChoice,AutoBossProfileCheckbox,TythMouseChoice,activeBossIndex,autoBossProfileEnabled
     V48Assert(BossChoice.Gui=IC.Pages["Boss"].Gui && TythMouseChoice.Gui=BossChoice.Gui,"profile and mouse setup now reachable together")
     V48Assert(BossChoice.Value=activeBossIndex && AutoBossProfileCheckbox.Value=!!autoBossProfileEnabled,"profile preferences not changed by construction")
 }
 V60TestAEControls()
 {
     V60WithSettings(V60AECase)
 }
 V60AECase()
 {
     global IC,AEControls
     for prop in ["Master","Notice","Swap","Status"]
         V48Assert(AEControls.%prop%.Gui=IC.Pages["AE"].Gui,"A&E remote callouts have a focused form")
     V48Assert(!AEControls.HasOwnProp("NoticeId") && !AEControls.HasOwnProp("SwapId"),"retired recording IDs are not exposed as speech settings")
 }
 V60TestSettingsBounds()
 {
     V60WithSettings(V60BoundsCase)
 }
 V60BoundsCase()
 {
     global IC
     for key,page in IC.Pages {
         V48Assert(page.Width=512 && page.Height>100 && page.Height<=640,"focused forms including boss setup remain within compact bounds")
         for c in page.Gui {
             c.GetPos(&x,&y,&w,&h)
             if c.Type="DropDownList" || c.Type="ComboBox"
                 h := 28
             V48Assert(x>=0 && y>=0 && x+w<=page.Width+2 && y+h<=page.Height+2,"control lies within focused page: " key)
         }
     }
 }
 V60TestOpenDoesNotParse()
 {
     V60WithSettings(V60NoParseCase)
 }
 V60NoParseCase()
 {
     global IP,IC,soundboardsEnabled,inputMode,activeBoss,NBOrder,NBRebounder
     before := [IP.Live,IP.Offline,IP.Active,IP.Selected,IP.Actor,soundboardsEnabled,inputMode,activeBoss,NBOrder,NBRebounder]
     for key in ICPageKeys() {
         ICOpenPage(key)
         if key="General" || key="Tyth" || key="AE" {
             s := ICLUState(),group := key="Tyth" ? "Tyth" : key="AE" ? "Aivela and Esne" : "All callouts"
             V48Assert(IPMGuiAlive(s.Gui) && s.Group.Text=group,"consolidated callout route selects its library group")
             V48Assert(!DllCall("User32\IsWindowVisible","Ptr",s.Gui.Hwnd,"Int"),"library route stays physically hidden in diagnostics")
         } else {
             V48Assert(IC.Current=key,"explicit focused page route works")
             V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IC.Pages[key].Gui.Hwnd,"Int"),"manual test does not show page")
         }
     }
     after := [IP.Live,IP.Offline,IP.Active,IP.Selected,IP.Actor,soundboardsEnabled,inputMode,activeBoss,NBOrder,NBRebounder]
     for i,v in before
         V48Assert(after[i]=v,"settings navigation preserves engines and main selection")
 }
 V60TestHideRetainsControls()
 {
     V60WithSettings(V60HideCase)
 }
 V60HideCase()
 {
     global IC
     handles := Map()
     for key,page in IC.Pages
         handles[key] := page.Gui.Hwnd,page.Visible := true
     ICHideAll()
     for key,page in IC.Pages
         V48Assert(!page.Visible && page.Gui.Hwnd=handles[key],"hide retains controls instead of destroying them")
     V48Assert(IC.Current="","no active settings form after hiding")
 }
 V60TestDraftRetention()
 {
     V60WithSettings(V60DraftCase)
 }
 V60DraftCase()
 {
     global IC,BossChoice
     IC.Pages["Boss"].Visible := true,BossChoice.Text := "unsaved partial query"
     ICOpenPage("Boss")
     V48Assert(BossChoice.Text="unsaved partial query","reopening a visible editor does not reset the draft")
 }
 V60TestMenusRetained()
 {
     V58Isolated(V60MenusCase)
 }
 V60MenusCase()
 {
     global IP
     IPWBuild(),u := IPWState()
     V48Assert(u.HasOwnProp("CalloutsMenu") && u.HasOwnProp("InterfaceMenu") && u.HasOwnProp("AnalysisMenu"),"parser menus are reusable by tray")
     for label in ["Audio callouts...","Boss && ability timers...","Pull countdown...","Raid time limit...","Enable voice (F11)","Stop preview"]
         V48Assert(V7829HelpItem(u.CalloutsMenu,label).Text=label,"current callout settings and preview action remain accessible: " label)
     V48Assert(DllCall("User32\GetMenuItemCount","Ptr",u.SettingsMenu.Handle,"Int")>=9,"settings including Advanced remain accessible")
     V48Assert(!IP.Active && !IP.Visible && !IP.Timer,"menu construction does not start work")
 }
 V60TestVoiceMenuSynchronization()
 {
     V58Isolated(V60VoiceMenuCase)
 }
 V60VoiceMenuCase()
 {
     global soundboardsEnabled
     IPWBuild(),u := IPWState(),old := soundboardsEnabled
     try {
         for on in [false,true,false] {
             soundboardsEnabled := on,ICSyncStatus()
             state := V7829HelpItem(u.CalloutsMenu,"Enable voice (F11)").State
             V48Assert((state & 8)!=0 ? on : !on,"voice menu check reflects saved master state")
         }
     }
     finally soundboardsEnabled := old
 }
 V60TestRemoteRoute()
 {
     V60WithSettings(V60RemoteCase)
 }
 V60RemoteCase()
 {
     global IC
     OpenAERemoteControls()
     s := ICLUState(),hwnd := s.Gui.Hwnd
     V48Assert(IPMGuiAlive(s.Gui) && s.Group.Text="Aivela and Esne","existing A&E entry selects the unified library group")
     OpenCalloutControls()
     V48Assert(s.Gui.Hwnd=hwnd && s.Masters.Count=4 && s.Group.Text="Aivela and Esne","all-controls callback reuses the library, retaining its filter and master switches")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int"),"legacy routes remain hidden in native diagnostics")
 }
 V60TestLegacyPageEntry()
 {
     V60WithSettings(V60LegacyCase)
 }
 V60LegacyCase()
 {
     global IC
     for tab in [1,2,3,4,5,6,7,8] {
         IPWOpenCalloutTab(tab)
         key := ICLegacyPage(tab)
         if key="Tyth" || key="AE" {
             s := ICLUState()
             V48Assert(IPMGuiAlive(s.Gui) && s.Group.Text=(key="Tyth" ? "Tyth" : "Aivela and Esne"),"old boss callbacks select the consolidated library group")
         } else
             V48Assert(IC.Current=key,"old callbacks route without a ControlTabs instance")
     }
 }
 V60TestNoTrayOrF10InTests()
 {
     global IP,IC
     gui := IP.Gui,tray := IC.TrayInstalled
     IPToggleWorkspace()
     V48Assert(!ICInstallTray() && IP.Gui=gui && IC.TrayInstalled=tray,"diagnostics never change global tray or display a main window")
 }
 ; v61 appearance and user-supplied icon tests. Inert until manual diagnostics.
 V601Isolated(action)
 {
     global IUB
     old := IUB
     IUB := IUBNewState()
     try action.Call()
     finally {
         IUBShutdown()
         IUB := old
     }
 }
 V601WithGui(action)
 {
     g := Gui()
     try action.Call(g)
     finally {
         IUBShutdown()
         g.Destroy()
     }
 }
 V601Error(action)
 {
     failed := false
     try action.Call()
     catch Error
         failed := true
     V48Assert(failed,"invalid appearance input must fail explicitly")
 }
 V601Fixture(ext)
 {
     path := A_Temp "\Iris_appearance_test_" DllCall("Kernel32\GetCurrentProcessId","UInt") "." ext
     hex := ext="ico" ? V601IcoHex() : V601PngHex()
     b := Buffer(StrLen(hex)//2)
     Loop b.Size
         NumPut("UChar",Integer("0x" SubStr(hex,(A_Index-1)*2+1,2)),b,A_Index-1)
     f := FileOpen(path,"w")
     try f.RawWrite(b)
     finally f.Close()
     return path
 }
 V601TestDefaults()
 {
     b := IUBNewState()
     V48Assert(b.Theme="iris" && b.IconPath="" && !b.Ready && !b.Small && !b.Large,"lavender default; no invented logo or asset loading")
     V48Assert(b.Windows.Count=0 && !IsObject(b.Gui),"default state creates no window or timer")
 }
 V601TestThemeKeys()
 {
     for value in ["iris","", "future", "night"]
         V48Assert(IUBThemeKey(value)="iris","unknown palette safely chooses Iris")
     V48Assert(IUBThemeKey("classic")="classic","classic opt-out retained")
 }
 V601TestPaletteValues()
 {
     for key in ["iris","classic"] {
         p := IUBPalette(key)
         for name in ["Background","Field","Text","Muted","Accent","Track","Header","HeaderText","HeaderMuted","Grid","GridMinor","Axis","Plot","PlotText","Selection","Effect"]
             V48Assert(RegExMatch(p.%name%,"i)^[0-9a-f]{6}$"),"valid RGB palette field")
         V48Assert(p.Stats.Length=7 && p.Curve.Length=5,"all metric and graph colors defined")
         V48Assert(p.Text!=p.Background && p.Text!=p.Field,"text is not background color")
     }
 }
 V601TestColorConversion()
 {
     V48Assert(IUBColorRef("123456")=0x563412 && IUBColorRef("FF0000")=0x0000FF,"COLORREF swaps red/blue")
     V48Assert(IUBColorRef("000000")=0 && IUBColorRef("FFFFFF")=0xFFFFFF,"RGB extremes")
     V601Error(IUBColorRef.Bind("12345")),V601Error(IUBColorRef.Bind("GGGGGG"))
 }
 V601TestChartPalette()
 {
     V601Isolated(V601ChartCase)
 }
 V601ChartCase()
 {
     global IUB
     IUB.Theme := "classic"
     V48Assert(IUBPlotColor("Curve",1)=0xB06C39 && IUBPlotColor("Plot")=0xF4F4F4,"classic chart colors match baseline")
     IUB.Theme := "iris"
     V48Assert(IUBPlotColor("Curve",1)=IUBColorRef("7951B0"),"Iris chart accent")
     V48Assert(IUBPlotColor("Curve",0)=IUBPlotColor("Curve",1) && IUBPlotColor("Curve",99)=IUBPlotColor("Curve",5),"metric palette range bounded")
 }
 V601TestIconPathPolicy()
 {
     V48Assert(IUBResolveIcon("*",A_Temp)="","explicit default icon does not rediscover a sidecar logo")
     for path in ["C:\Icons\Iris.ico","C:\Icons\iris.PNG","C:\Icons\Logo with spaces.ico"]
         V48Assert(IUBIconPathAllowed(path),"local image extensions supported")
     for path in ["https://example.com/logo.png","C:\run.exe","C:\look.ico.exe","\\server\share\logo.ico","file://local/logo.png"]
         V48Assert(!IUBIconPathAllowed(path),"URL, UNC and executable paths rejected")
 }
 V601TestMissingIcon()
 {
     V601Error(IUBLoadIcons.Bind(A_Temp "\Iris_nonexistent_appearance_fixture.ico"))
 }
 V601TestIcoLoading()
 {
     path := V601Fixture("ico"),pair := ""
     try {
         pair := IUBLoadIcons(path)
         V48Assert(pair.Small>0 && pair.Large>0,"ICO produces two real icon handles")
     }
     finally {
         if IsObject(pair)
             IUBFreeIcons(pair)
         FileDelete(path)
     }
 }
 V601TestPngLoading()
 {
     path := V601Fixture("png"),pair := ""
     try {
         pair := IUBLoadIcons(path)
         V48Assert(pair.Small>0 && pair.Large>0,"PNG converted with Icon1, not passed as a bitmap to WM_SETICON")
     }
     finally {
         if IsObject(pair)
             IUBFreeIcons(pair)
         FileDelete(path)
     }
 }
 V601TestMalformedIcon()
 {
     path := A_Temp "\Iris_bad_appearance_fixture.ico"
     f := FileOpen(path,"w")
     try f.Write("not an image")
     finally f.Close()
     try V601Error(IUBLoadIcons.Bind(path))
     finally FileDelete(path)
 }
 V601TestSaveGuard()
 {
     global IUB
     before := IUB.Theme,path := IUB.IconPath
     V48Assert(!IUBSave() && IUB.Theme=before && IUB.IconPath=path,"native diagnostics never write appearance preferences")
 }
 V601TestStartupGuard()
 {
     global IUB
     before := IUB.Ready
     V48Assert(!IUBInitialize() && IUB.Ready=before,"no startup asset discovery or tray change in diagnostics")
 }
 V601TestTrayGuard()
 {
     global IUB
     before := A_IconFile,path := IUB.IconPath
     V48Assert(!IUBSetIconPath("C:\missing\Iris.ico",true),"manual diagnostics cannot install a tray icon")
     V48Assert(A_IconFile=before && IUB.IconPath=path,"tray and saved icon identity retained")
 }
 V601TestHiddenTheme()
 {
     V601Isolated(V601WithGui.Bind(V601HiddenCase))
 }
 V601HiddenCase(g)
 {
     t := g.AddText("x10 y10 w100 h24","Hello")
     V48Assert(IUBApplyWindow(g),"hidden form accepts palette")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int") && t.Text="Hello","theming never displays a hidden window")
 }
 V601TestTableColors()
 {
     V601Isolated(V601WithGui.Bind(V601TableCase))
 }
 V601TableCase(g)
 {
     lv := g.AddListView("w300 h120",["Name","Value"])
     lv.Add(,"Test",123)
     IUBApplyWindow(g)
     p := IUBPalette()
     V48Assert(SendMessage(0x1000,0,0,lv)=IUBColorRef(p.Field),"native ListView background matches palette")
     V48Assert(SendMessage(0x1023,0,0,lv)=IUBColorRef(p.Text),"native ListView text matches palette")
     V48Assert(lv.GetText(1,2)="123","theming preserves cell text")
 }
 V601TestControlStatePreserved()
 {
     V601Isolated(V601WithGui.Bind(V601ControlCase))
 }
 V601ControlCase(g)
 {
     e := g.AddEdit("x10 y10 w120 h25","draft")
     cb := g.AddCheckbox("x10 y42 w120 Checked","enabled")
     ddl := g.AddDropDownList("x10 y73 w120 Choose2",["one","two"])
     b := g.AddButton("x10 y106 w120 Disabled","Cancel")
     e.GetPos(&x,&y,&w,&h)
     IUBApplyWindow(g)
     e.GetPos(&nx,&ny,&nw,&nh)
     V48Assert(e.Value="draft" && cb.Value=1 && ddl.Value=2 && !b.Enabled,"values, selections and enable state retained")
     V48Assert(x=nx && y=ny && w=nw && h=nh,"control rectangle unchanged")
 }
 V601TestVisibilityPreserved()
 {
     V601Isolated(V601WithGui.Bind(V601VisibilityCase))
 }
 V601VisibilityCase(g)
 {
     tab := g.AddTab3("w400 h200",["One","Two"]),tab.UseTab()
     lv := g.AddListView("x10 y40 w300 h100 Hidden",["Not active"])
     IUBApplyWindow(g)
     V48Assert(!V58ChildVisible(lv),"style application cannot revive a hidden table")
     V48Assert(tab.Value=1,"selected tab unchanged")
 }
 V601TestClassicRoundTrip()
 {
     V601Isolated(V601WithGui.Bind(V601ClassicCase))
 }
 V601ClassicCase(g)
 {
     global IUB
     lv := g.AddListView("w300 h120",["Value"]),lv.Add(,"retained")
     IUBApplyWindow(g)
     IUB.Theme := "classic",IUBApplyWindow(g)
     V48Assert(g.BackColor="E6E6E6" && SendMessage(0x1000,0,0,lv)=0xF3F3F3,"classic surfaces restored")
     IUB.Theme := "iris",IUBApplyWindow(g)
     V48Assert(g.BackColor=IUBPalette().Background && lv.GetText(1)="retained","switching back preserves data")
 }
 V601TestMainWorkspace()
 {
     V601Isolated(V591Isolated.Bind(V601MainCase))
 }
 V601MainCase()
 {
     global IP
     V591Ready()
     data := IPSelectedData(),seg := IPSelectedSegment(),actor := IP.Actor,u := IPWState(),before := u.Tab
     IUBApplyWindow(IP.Gui,"main")
     V48Assert(u.Controls.Has("BrandBand") && u.Tab=before,"brand band keeps active Analysis tab")
     V48Assert(IPSelectedData()=data && IPSelectedSegment()=seg && IP.Actor=actor,"theme does not change parser identity")
     V48Assert(!IP.Visible && !IP.Active,"hidden diagnostic workspace does not start parsing or show")
 }
 V601TestEmbeddedAnalysis()
 {
     V601Isolated(V591Isolated.Bind(V601AnalysisCase))
 }
 V601AnalysisCase()
 {
     V591Ready(),a := V591Data(),q := a.Query,r := a.Result,count := a.Tables["Rotation"].GetCount()
     IUBApplyWindow(a.Gui,"analysis")
     V48Assert(a.Query=q && a.Result=r && a.Tables["Rotation"].GetCount()=count,"same review, range, result and table rows")
     V48Assert(a.Parent!=0 && !DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd,"Int"),"embedded child stays hidden in test")
 }
 V601TestDeadWindowPruning()
 {
     V601Isolated(V601PruneCase)
 }
 V601PruneCase()
 {
     global IUB
     g := Gui(),IUBApplyWindow(g),hwnd := g.Hwnd
     V48Assert(IUB.Windows.Has(hwnd),"tracked live GUI")
     g.Destroy(),IUBPruneWindows()
     V48Assert(!IUB.Windows.Has(hwnd) && !IUBApplyWindow(g),"destroyed window removed without accessing dead controls")
 }
 V601TestNativeIconAttachment()
 {
     V601Isolated(V601WithGui.Bind(V601AttachCase))
 }
 V601AttachCase(g)
 {
     global IUB
     path := V601Fixture("ico")
     try {
         pair := IUBLoadIcons(path),IUB.Small := pair.Small,IUB.Large := pair.Large
         IUBApplyWindow(g)
         V48Assert(SendMessage(0x7F,0,0,g)=pair.Small && SendMessage(0x7F,1,0,g)=pair.Large,"both window-specific icons attached")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"icon attachment does not show a GUI")
     }
     finally FileDelete(path)
 }
 
 V601IcoHex()
 {
     ; Tiny synthetic pixel fixture, NOT the Iris logo.
     return "0000010001001010000001002000680400001600000028000000100000002000000001002000000000000004000000000000000000000000000000000000aa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ffaa5577ff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
 }
 
 V601PngHex()
 {
     ; Tiny synthetic pixel fixture, NOT the Iris logo.
     return "89504e470d0a1a0a0000000d494844520000000200000002080600000072b60d240000001449444154789c632c0f5df59f8181818189010a0025550279949b789b0000000049454e44ae426082"
 }
 
 ; v61 manual-only tests: new raid home and compact progression summaries.
 V61Base()
 {
     s := IPNewData("SYNTHETIC PROGRESSION FIXTURE")
     seg := IPNewSegment(s,0,"synthetic start")
     seg.BossKey := "G-TY",seg.BossName := "Tyth",seg.ModeId := "test-mode",seg.AreaId := "test-area"
     return s
 }
 V61Apply(s,at,kind,source := "@Bobby#101",target := "=",amount := 0)
 {
     ev := IPParseLine(IPDemoLine(at,source,target,kind,amount))
     IPApplyEvent(s,ev,at)
     return ev
 }
 V61Finish(s,end := 10000)
 {
     seg := s.Current,seg.Last := end
     IPCloseSegment(s,"synthetic ended pull")
     s.Finished := true
     return IPRCompact(seg)
 }
 V61OnePull(death := -1,end := 10000)
 {
     s := V61Base()
     V61Apply(s,0,"Activate")
     if death>=0
         V61Apply(s,death,"Death")
     d := IPRNewData("synthetic",true),d.Pulls.Push(V61Finish(s,end))
     return d
 }
 V61Hidden(action)
 {
     V591Isolated(V61HiddenInner.Bind(action))
 }
 V61HiddenInner(action)
 {
     try action.Call()
     finally IPRCleanup()
 }
 V61Ready()
 {
     global IP
     if !IsObject(IP.Gui)
         IPWBuild()
     p := IPRState(),p.Mode := "session"
     u := IPWState(),u.Controls["Tabs"].Choose(IPWTabPosition(12))
     IPWTabChanged()
 }
 V61TestRaidFirst()
 {
     t := IPWTabs()
     V48Assert(t.Length=13 && t[1]="Log Library" && t[2]="Raid" && t[3]="Progression" && t[IPWTabPosition(1)]="Overview" && t[IPWTabPosition(8)]="Analysis","Library is first, existing data pages remain")
     V48Assert(IPWNewState().Tab=7,"new logical default is Raid")
 }
 V61TestTabRoundtrip()
 {
     seen := Map()
     Loop 13 {
         id := IPWTabLogical(A_Index),seen[id] := true
         V48Assert(IPWTabPosition(id)=A_Index,"display/logic mappings invert")
     }
     V48Assert(seen.Count=13 && IPWTabLogical(1)=13 && IPWTabPosition(2)=9,"all original routes survive reordered labels")
 }
 V61TestInertState()
 {
     p := IPRNewState()
     V48Assert(p.Mode="pull" && p.Source="loaded" && !p.Busy && !IsObject(p.Job),"selected-pull death view is inert; no scan or file from construction")
 }
 V61TestBobbyBaseline()
 {
     d := IPRDemoData(),r := IPRSummary(d),b := r.Players["@Little Bobby#101"]
     V48Assert(r.Pulls.Length=17 && b.Pulls=17 && b.Deaths=28 && b.Delta=11,"28 minus 17 is +11")
     V48Assert(b.TimedPulls=17 && b.Reached>=0 && b.Reached<=100,"survival denominator is explicit")
 }
 V61TestDeltaSigns()
 {
     V48Assert(IPRDelta(11)="+11" && IPRDelta(0)="0" && IPRDelta(-2)="-2","negative baseline kept, no clamp")
 }
 V61TestNoDeathReached()
 {
     r := IPRSummary(V61OnePull()),b := r.Players["@Bobby#101"]
     V48Assert(b.Deaths=0 && b.Pulls=1 && b.Delta=-1 && b.Reached=100 && b.NoDeath=1,"death-free observed complete pull is 100, negative baseline")
 }
 V61TestFirstDeathReached()
 {
     b := IPRSummary(V61OnePull(2500)).Players["@Bobby#101"]
     V48Assert(b.Reached=25 && b.Firsts=1 && b.NoDeath=0,"first death timestamp yields quarter-pull survival")
 }
 V61TestEqualPullWeight()
 {
     a := V61OnePull(5000,10000),b := V61OnePull(-1,1000).Pulls[1]
     b.Id := 2,a.Pulls.Push(b)
     x := IPRSummary(a).Players["@Bobby#101"]
     V48Assert(x.Reached=75 && x.TimedPulls=2,"mean percentages, not duration-weighted total")
 }
 V61TestObservedAttendance()
 {
     d := IPRDemoData(),key := "@Sample Healer#103"
     d.Pulls[1].Players.Delete(key)
     r := IPRSummary(d)
     V48Assert(r.Players[key].Pulls=16 && r.Players["@Little Bobby#101"].Pulls=17,"per-player attendance instead of session-wide subtraction")
 }
 V61TestAllDeathsAfterThird()
 {
     s := V61Base()
     V61Apply(s,1000,"Death","@First#1")
     V61Apply(s,2000,"Death","@Second#2")
     V61Apply(s,3000,"Death")
     V61Apply(s,4000,"Activate")
     V61Apply(s,9000,"Death")
     d := IPRNewData("late death fixture",true),d.Pulls.Push(V61Finish(s))
     r := IPRSummary(d),b := r.Players["@Bobby#101"]
     V48Assert(b.Deaths=2 && b.Delta=1 && b.Firsts=0 && b.Reached=30,"third and later deaths count; revival cannot erase first death")
 }
 V61TestDuplicateDeath()
 {
     s := V61Base()
     V61Apply(s,1000,"Death"),V61Apply(s,1001,"Death")
     p := V61Finish(s)
     V48Assert(p.TotalDeaths=1 && p.Deaths.Length=1 && p.TimingComplete,"existing duplicate suppression and compact journal agree")
 }
 V61TestRepeatedLife()
 {
     s := V61Base()
     V61Apply(s,1000,"Death"),V61Apply(s,2000,"Activate"),V61Apply(s,3000,"Death")
     p := V61Finish(s)
     V48Assert(p.TotalDeaths=2 && p.Deaths.Length=2 && p.Players["@Bobby#101"].First=1000,"each recorded death after new life counts")
 }
 V61TestSameTimestampTie()
 {
     s := V61Base()
     V61Apply(s,1000,"Death","@Alice#102"),V61Apply(s,1000,"Death")
     d := IPRNewData("tie",true),p := V61Finish(s),d.Pulls.Push(p)
     r := IPRSummary(d)
     V48Assert(p.First.Length=2 && p.Deaths[1].Order=1 && p.Deaths[2].Order=1,"ties share rank")
     V48Assert(r.Players["@Bobby#101"].Firsts=1 && r.Players["@Alice#102"].Firsts=1,"both receive tied first-death count")
 }
 V61TestOutOfOrderDeaths()
 {
     records := Map(1,{At:2000,Record:1,Name:"A"},2,{At:1000,Record:2,Name:"B"})
     sorted := IPRSortDeaths(records)
     V48Assert(sorted[1].Name="B" && sorted[1].Order=1 && sorted[2].Order=2,"timestamp not arrival order determines first death")
 }
 V61TestNPCAndCompanionExcluded()
 {
     s := V61Base()
     V61Apply(s,1000,"Death",V51Target())
     V61Apply(s,2000,"Activate","@Bobby#101")
     p := V61Finish(s)
     V48Assert(p.TotalDeaths=0 && p.Deaths.Length=0 && p.Players.Count=1,"NPC deaths do not become raid deaths")
 }
 V61TestTailRollback()
 {
     s := V61Base(),seg := s.Current
     V61Apply(s,0,"Activate")
     IPBBeginUndo(s,seg)
     V61Apply(s,1000,"Death"),V61Apply(s,1100,"Activate","@New#2")
     V48Assert(seg.Progression.Deaths.Count=1,"tail death initially captured")
     IPBRollbackTail(s,seg)
     V48Assert(seg.Progression.Deaths.Count=0 && !seg.Progression.Players.Has("@New#2") && seg.Totals["@Bobby#101"].Deaths=0,"death and participant history roll back with totals")
 }
 V61TestRingIndependent()
 {
     s := V61Base(),s.Current.EventCap := 2
     V61Apply(s,100,"Death")
     Loop 12
         V61Apply(s,200+A_Index,"Activate","@Other#2")
     p := V61Finish(s)
     V48Assert(s.Segments[1].Events.Length=2 && p.Deaths.Length=1 && p.FirstAt=100,"old death survives recent-event eviction")
 }
 V61TestMissingTiming()
 {
     s := V61Base()
     V61Apply(s,1000,"Death"),s.Current.Progression.Deaths.Clear()
     d := IPRNewData("missing timing",true),d.Pulls.Push(V61Finish(s))
     b := IPRSummary(d).Players["@Bobby#101"]
     V48Assert(b.Deaths=1 && b.TimedPulls=0 && b.Reached=-1 && b.Firsts=0,"counts retained but missing times not invented")
 }
 V61TestPartialKeepsDeaths()
 {
     d := V61OnePull(1000),d.Pulls[1].Partial := true
     b := IPRSummary(d).Players["@Bobby#101"]
     V48Assert(b.Deaths=1 && b.Pulls=1 && b.TimedPulls=0 && b.Reached=-1,"partial observed deaths visible; survival unknown")
 }
 V61TestZeroDuration()
 {
     V48Assert(IPRProgress(-1,1000,1000)=-1 && IPRProgress(1000,1000,1000)=-1,"zero-length pull is not fabricated 100 percent")
 }
 V61TestEndpointRange()
 {
     V48Assert(IPRProgress(1000,1000,5000)=0 && IPRProgress(5000,1000,5000)=100,"inclusive endpoints")
     V48Assert(IPRProgress(999,1000,5000)=-1 && IPRProgress(5001,1000,5000)=-1,"invalid timestamps rejected")
 }
 V61TestUnknownDefault()
 {
     d := V61OnePull(1000),d.Pulls[1].Boss := ""
     V48Assert(IPRSummary(d).Players.Count=0 && IPRSummary(d,"",true).Players.Count=1,"unknown/trash opt-in")
 }
 V61TestEncounterScope()
 {
     d := IPRDemoData(),group := d.Pulls[1].Group
     d.Pulls[1].Group := "other-mode"
     V48Assert(IPRSummary(d,group).Pulls.Length=16 && IPRSummary(d,"other-mode").Pulls.Length=1,"variant key keeps filters distinct")
 }
 V61TestManualExclusion()
 {
     d := IPRDemoData(),d.Pulls[1].Included := false
     b := IPRSummary(d).Players["@Little Bobby#101"]
     V48Assert(b.Pulls=16 && b.Deaths=26 && b.Delta=10,"exclusions change numerator and denominator together")
 }
 V61TestNoOpenPulls()
 {
     s := V61Base(),V61Apply(s,1000,"Death")
     d := IPRFromLoaded(s)
     V48Assert(d.Pulls.Length=0 && d.OpenPulls=1 && !d.Complete,"active pull excluded until end")
 }
 V61TestIdentityNotName()
 {
     s := V61Base()
     V61Apply(s,1000,"Death","@Same#1"),V61Apply(s,2000,"Death","@Same#2")
     p := V61Finish(s)
     V48Assert(p.Players.Count=2 && p.Deaths.Length=2,"same display name does not merge actor IDs")
 }
 V61TestCopiedSummary()
 {
     d := IPRDemoData(),text := IPRReport(d,IPRSummary(d))
     V48Assert(InStr(text,"Little Bobby`t17`t28`t11") && InStr(text,"No automatic wipe cutoff"),"export retains deaths and first-death counts without the removed metric")
     V48Assert(InStr(text,"SYNTHETIC DEMO") && !InStr(text,"C:\"),"demo labelled, no source path emitted")
 }
 V61TestTimeFormat()
 {
     V48Assert(IPRTime(0)="0:00.000" && IPRTime(78420)="1:18.420" && IPRTime(-1)="--","precise relative death times")
 }
 V61TestRollingRetention()
 {
     s := V61Base(),j := {State:s,Data:IPRNewData(),MaxPulls:4096}
     V61Apply(s,1000,"Death"),V61Finish(s)
     Loop 75 {
         seg := IPNewSegment(s,A_Index*20000,"next synthetic")
         seg.BossKey := "G-TY",seg.BossName := "Tyth"
         IPRDrain(j)
         V61Apply(s,seg.Start+1000,"Death")
         seg.Last := seg.Start+10000,IPCloseSegment(s,"ended")
     }
     IPRDrain(j,true)
     V48Assert(j.Data.Pulls.Length=76 && !s.Halted && s.Segments.Length=0,"compact scan covers more than 60 pulls without raising original detailed cap")
 }
 V61TestRollingCurrentKept()
 {
     s := V61Base(),cur := s.Current,j := {State:s,Data:IPRNewData(),MaxPulls:4096}
     IPRDrain(j,true)
     V48Assert(s.Current=cur && s.Segments.Length=1 && j.Data.Pulls.Length=0,"active detailed state never released")
 }
 V61TestRollingLimit()
 {
     s := V61Base(),j := {State:s,Data:IPRNewData(),MaxPulls:1},raised := false
     V61Finish(s),IPRDrain(j,true)
     seg := IPNewSegment(s,20000,"explicit scan budget test")
     seg.Last := 21000,IPCloseSegment(s,"synthetic ended")
     try IPRDrain(j,true)
     catch
         raised := true
     V48Assert(raised && j.Data.Pulls.Length=1 && s.Segments.Length=1,"explicit nonzero budget rejects without deleting uncommitted source state")
 }
 V61TestRosterFreeze()
 {
     s := V61Base(),V61Apply(s,1000,"Death"),p := V61Finish(s)
     s.Segments[1].Totals["@Bobby#101"].Deaths := 99
     V48Assert(p.Players["@Bobby#101"].Deaths=1,"compact summaries copy scalar data")
 }
 V61TestMigration()
 {
     V61Hidden(V61MigrationCase)
 }
 V61MigrationCase()
 {
     global SETTINGS_FILE
     IniWrite(6,SETTINGS_FILE,"IrisWorkspace","Tab")
     try IniDelete(SETTINGS_FILE,"IrisWorkspace","RaidHomeVersion")
     IPWLoadPrefs()
     V48Assert(IPWState().Tab=7,"first v61 launch prioritizes Raid")
     IniWrite(1,SETTINGS_FILE,"IrisWorkspace","RaidHomeVersion")
     IPWLoadPrefs()
     V48Assert(IPWState().Tab=6 && IPWTabPosition(6)=13,"subsequent saved logical Combat Log selection retained")
 }
 V61TestHiddenDefault()
 {
     V61Hidden(V61DefaultCase)
 }
 V61DefaultCase()
 {
     global IP
     V61Ready(),V58SelectTab(7),u := IPWState()
     V48Assert(u.Controls["Tabs"].Value=2 && u.Tab=7,"Raid retains its logical identity after the first-position Log Library")
     V48Assert(!V58ChildVisible(u.Controls["SessionPlayers"]) && V58ChildVisible(IP.PlayersLV),"Raid metrics visible; session death table not overlapping")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"diagnostic GUI remains hidden")
 }
 V61TestHiddenSwitch()
 {
     V61Hidden(V61SwitchCase)
 }
 V61SwitchCase()
 {
     global IP
     V61Ready(),u := IPWState(),p := IPRState()
     V58SelectTab(9)
     V48Assert(p.Mode="pull" && V58ChildVisible(u.Controls["DeathList"]) && !V58ChildVisible(u.Controls["SessionPlayers"]),"selected-pull recap remains available")
     V58SelectTab(2)
     V48Assert(u.Controls["Tabs"].Value=IPWTabPosition(2) && IP.Metric="Damage","damage routing survives reorder")
 }
 V61TestHiddenDemo()
 {
     V61Hidden(V61DemoCase)
 }
 V61DemoCase()
 {
     global IP
     V61Ready(),old := IP.Live
     IPRDemo(),u := IPWState(),lv := u.Controls["SessionPlayers"]
     V48Assert(lv.GetCount()=8 && u.Controls["SessionPulls"].GetCount()=17,"session demo fills eight players and seventeen pulls")
     V48Assert(lv.GetText(1,1)="Little Bobby" && lv.GetText(1,3)="28" && lv.GetText(1,4)="11","default death sort puts Bobby at top with deaths and times died first")
     V48Assert(IP.Live=old && !IP.Active,"session sample does not enter parser collection")
 }
 V61TestHiddenSelection()
 {
     V61Hidden(V61SelectionCase)
 }
 V61SelectionCase()
 {
     global IP
     V61Ready(),IPRDemo(),u := IPWState(),old := IP.Actor
     IPRSelectPlayer(u.Controls["SessionPlayers"],1,true)
     V48Assert(IPRState().Selected="@Little Bobby#101" && u.Controls["SessionPulls"].GetCount()=17,"player selection filters pull details")
     V48Assert(IP.Actor=old,"session player selection independent of selected-pull stats")
     IPRAllPlayers()
     V48Assert(IPRState().Selected="","all players restores raid first-death view")
 }
 V61TestHiddenScrollRouting()
 {
     V61Hidden(V61ScrollCase)
 }
 V61ScrollCase()
 {
     V61Ready(),seen := Map()
     for row in IWScrollTables()
         seen[row.Name] := true
     V48Assert(seen.Has("Main SessionPlayers") && seen.Has("Main SessionPulls") && !seen.Has("Main Raid"),"session tables included in wheel-routing registry")
 }
 V61TestHiddenLayout()
 {
     V61Hidden(V61LayoutCase)
 }
 V61LayoutCase()
 {
     global IP
     V61Ready(),u := IPWState()
     for size in [[980,650],[1220,780],[1920,1080]] {
         IPResize(IP.Gui,0,size[1],size[2])
         for name in ["SessionPlayers","SessionPulls","SessionNote","SessionCopy","SessionRestore"] {
             u.Controls[name].GetPos(&x,&y,&w,&h)
             V48Assert(x>=280 && y>=160 && w>0 && h>0 && x+w<=size[1] && y+h<size[2]-42,"session controls clear footer: " name)
         }
     }
 }
 V61TestHiddenNoRefreshReset()
 {
     V61Hidden(V61NoRefreshCase)
 }
 V61NoRefreshCase()
 {
     V61Ready(),IPRDemo(),p := IPRState(),before := p.Result
     IPRRefresh()
     V48Assert(p.Result=before,"frozen report not rebuilt every parser refresh")
 }
 V61TestHiddenExclusions()
 {
     V61Hidden(V61ExclusionCase)
 }
 V61ExclusionCase()
 {
     V61Ready(),IPRDemo(),p := IPRState(),lv := IPWState().Controls["SessionPulls"]
     lv.Modify(1,"Select"),IPRTogglePull()
     V48Assert(p.Result.Pulls.Length=16 && lv.GetCount()=17,"excluded row remains accessible for reinclude")
     IPRRestorePulls()
     V48Assert(p.Result.Pulls.Length=17,"restore all reverses manual deselection")
 }
 V61TestScanBusyGuards()
 {
     V61Hidden(V61BusyCase)
 }
 V61BusyCase()
 {
     global IP
     V61Ready(),p := IPRState(),p.Busy := true
     V48Assert(!IPStartCanCommit(IP,IP.Live) && IAIsBusy() && !IPRScanAllowed(),"scan excludes import/live/analysis starts")
     IPRCancel()
     V48Assert(!p.Busy && !IsObject(p.Job),"cancel before work restores inactive state")
 }
 V61TestStableDemoObjects()
 {
     a := IPRDemoData(),b := IPRDemoData()
     a.Pulls[1].Included := false
     V48Assert(b.Pulls[1].Included && a!=b,"demo data not shared mutable state")
 }
 V61TestLifetimeSortIsolation()
 {
     records := Map(1,{At:1,Record:1,Name:"A"})
     out := IPRSortDeaths(records)
     out[1].Name := "B"
     V48Assert(records[1].Name="A" && !records[1].HasOwnProp("Order"),"sorting cannot modify preserved event evidence")
 }
 V61TestEmptySummary()
 {
     r := IPRSummary("")
     V48Assert(r.Players.Count=0 && r.Pulls.Length=0 && r.Deaths=0,"empty state no fabricated actors or sample stats")
 }
 V61ScanFixture(pulls := 70)
 {
     path := A_Temp "\Iris_v61_session_fixture_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount ".txt",text := ""
     Loop pulls {
         base := A_Index*20000,boss := "Tyth {4078419339902976}:" A_Index
         text .= IPDemoLine(base,"@Recorder#9","=","Enter") "`r`n"
         text .= IPDemoLine(base+100,"@Bobby#101",boss,"Damage",1000) "`r`n"
         text .= IPDemoLine(base+200,boss,"@Bobby#101","Death") "`r`n"
         text .= IPDemoLine(base+300,"@Bobby#101","=","Activate") "`r`n"
         text .= IPDemoLine(base+400,"@Bobby#101",boss,"Damage",100) "`r`n"
         text .= IPDemoLine(base+500,boss,"@Bobby#101","Death") "`r`n"
         text .= IPDemoLine(base+600,"@Recorder#9",boss,"Damage",1000) "`r`n"
         text .= IPDemoLine(base+700,"@Recorder#9",boss,"Death") "`r`n"
         text .= IPDemoLine(base+800,"@Recorder#9","=","Exit") "`r`n"
     }
     if FileExist(path)
         throw Error("Synthetic fixture path already exists.")
     FileAppend(text,path,"UTF-8")
     return path
 }
 V61TestFullSourceScan()
 {
     V61Hidden(V61FullScanCase)
 }
 V61FullScanCase()
 {
     global IP
     V61Ready(),path := V61ScanFixture(70),old := IP.Live
     try {
         IPRScanPrepare(path,"UTF-8"),IPRScanPump(),p := IPRState()
         V48Assert(p.Source="scanned" && p.Data.Pulls.Length=70 && p.Data.Complete,"one private scan gets all seventy actual synthetic pulls")
         b := IPRSummary(p.Data).Players["@Bobby#101"]
         V48Assert(b.Pulls=70 && b.Deaths=140 && b.Delta=70,"all rebirth deaths retained beyond detailed-view cap")
         V48Assert(p.ScanRecords=630 && IP.Live=old && !IP.Active,"source read once; main collection not replaced")
     }
     finally {
         IPRCancel()
         if FileExist(path)
             FileDelete(path)
     }
 }
 V61CancelScan(p,j)
 {
     IPRCancel()
 }
 V61TestScanCancelRetainsReport()
 {
     V61Hidden(V61CancelScanCase)
 }
 V61CancelScanCase()
 {
     V61Ready(),IPRDemo(),p := IPRState(),old := p.Data,path := V61ScanFixture(12)
     try {
         IPRScanPrepare(path,"UTF-8"),IPRScanPump(V61CancelScan)
         V48Assert(!p.Busy && !p.Pumping && !IsObject(p.Job) && p.Data=old && p.Source="demo","canceled scan leaves previous report and releases resources")
     }
     finally {
         IPRCancel()
         if FileExist(path)
             FileDelete(path)
     }
 }
 V61TestModeLabels()
 {
     V48Assert(IPRModeLabel("836045448953651")="8-player Story" && IPRModeLabel("836045448953655")="8-player Master","mode labels follow archived records")
     V48Assert(IPRModeLabel("")="mode not recorded" && IPRModeLabel("123")="mode 123","unknown mode not guessed")
 }
 V61TestCanceledLoadedSubset()
 {
     s := V61Base(),V61Apply(s,1000,"Death"),V61Finish(s)
     s.ProgressionComplete := false
     V48Assert(!IPRFromLoaded(s).Complete,"canceled import is not labelled a complete session")
     s.ProgressionComplete := true,s.BeganMidstream := true
     V48Assert(!IPRFromLoaded(s).Complete,"capture started partway through file is not full-file coverage")
 }
 
 V61TestCompactStorageBound()
 {
     s := V61Base(),V61Apply(s,1000,"Death"),V61Finish(s)
     d := IPRNewData(),d.StoredDeaths := 100000
     j := {State:s,Data:d,MaxPulls:4096,MaxDeaths:100000},raised := false
     try IPRDrain(j,true)
     catch
         raised := true
     V48Assert(raised && d.Pulls.Length=0 && s.Segments.Length=1,"aggregate cap rejects before committing or releasing a pull")
 }
 V61TestDeathHistoryBound()
 {
     s := V61Base(),seg := s.Current,ev := IPParseLine(IPDemoLine(1000,"@Bobby#101","=","Death"))
     Loop 4096
         seg.Progression.Deaths["fixture" A_Index] := {Key:"@Other#2",Name:"Other",At:A_Index,Record:A_Index,Clock:""}
     IPRRecord(seg,ev,1000)
     V48Assert(seg.Progression.Deaths.Count=4096 && seg.Progression.Flags.Has("Limited"),"per-pull history is bounded and explicitly incomplete")
 }
 ; v61.1 manual-only native topology tests. Parent windows stay hidden.
 ; These verify styles/ordering/contents, NOT screenshots or on-screen paint.
 V611With(action)
 {
     V61Hidden(V611Inner.Bind(action))
 }
 V611Inner(action)
 {
     V61Ready(),IPRDemo()
     action.Call()
 }
 V611Above(front,back)
 {
     fh := IPMUiHandle(front),bh := IPMUiHandle(back)
     if !fh || !bh
         return false
     parent := DllCall("User32\GetParent","Ptr",fh,"Ptr")
     if parent!=DllCall("User32\GetParent","Ptr",bh,"Ptr")
         return false
     h := DllCall("User32\GetWindow","Ptr",parent,"UInt",5,"Ptr")
     Loop 2048 {
         if !h || h=bh
             return false
         if h=fh
             return true
         h := DllCall("User32\GetWindow","Ptr",h,"UInt",2,"Ptr")
     }
     return false
 }
 V611CheckRaid()
 {
     u := IPWState()
     for name in ["SessionHeading","SessionSource","SessionFilter","SessionPlayers","SessionPulls","SessionCopy","SessionNote"] {
         V48Assert(V58ChildVisible(u.Controls[name]),"Raid control visible: " name)
         V48Assert(V611Above(u.Controls[name],u.Controls["Tabs"]),"Raid control above page background: " name)
     }
 }
 V611TestVisibilityPolicy()
 {
     for tab in [1,2,3,4,5,6,7,8,9,10,11,12] {
         for mode in ["session","pull"] {
             V48Assert(IPWGroupVisible("Always",tab,mode),"always-visible controls")
             V48Assert(!IPWGroupVisible("RaidNav",tab,mode),"retired shared selector stays absent")
             V48Assert(IPWGroupVisible("RaidSession",tab,mode)=(tab=12),"session page ownership")
             V48Assert(IPWGroupVisible("Raid",tab,mode)=(tab=7),"Raid metrics page ownership")
             V48Assert(IPWGroupVisible("Healing",tab,mode)=(tab=3),"healing options remain scoped")
             V48Assert(!IPWGroupVisible("not-a-group",tab,mode),"unknown group stays hidden")
         }
     }
 }
 V611TestNoEmptyMainContainer()
 {
     V611With(V611MainContainerCase)
 }
 V611MainContainerCase()
 {
     h := IPWState().Controls["Tabs"].Hwnd
     V48Assert(!DllCall("User32\GetPropW","Ptr",h,"Str","ahk_dlg","Ptr"),"manual workspace deck has no unused Tab3 dialog")
     V611CheckRaid()
 }
 V611TestNoEmptyAnalysisContainer()
 {
     V611With(V611AnalysisContainerCase)
 }
 V611AnalysisContainerCase()
 {
     V58SelectTab(8),a := IAState(),h := a.Controls["Tabs"].Hwnd
     V48Assert(!DllCall("User32\GetPropW","Ptr",h,"Str","ahk_dlg","Ptr"),"manual Analysis deck has no unused Tab3 dialog")
     V48Assert(DllCall("User32\GetParent","Ptr",a.Tables["Damage"].Hwnd,"Ptr")=a.Gui.Hwnd,"analysis controls stay with correct host")
 }
 V611TestParentClipping()
 {
     V611With(V611ClippingCase)
 }
 V611ClippingCase()
 {
     global IP
     V48Assert((DllCall("User32\GetWindowLongW","Ptr",IP.Gui.Hwnd,"Int",-16,"UInt") & 0x02000000)!=0,"main background excludes child controls")
     V58SelectTab(8),a := IAState()
     V48Assert((DllCall("User32\GetWindowLongW","Ptr",a.Gui.Hwnd,"Int",-16,"UInt") & 0x02000000)!=0,"embedded background excludes child controls")
 }
 V611TestSiblingClipping()
 {
     V611With(V611SiblingCase)
 }
 V611SiblingCase()
 {
     u := IPWState()
     V48Assert((DllCall("User32\GetWindowLongW","Ptr",u.Controls["BrandBand"].Hwnd,"Int",-16,"UInt") & 0x04000000)!=0,"toolbar background clipped against text and buttons")
     V48Assert((DllCall("User32\GetWindowLongW","Ptr",u.Controls["Tabs"].Hwnd,"Int",-16,"UInt") & 0x04000000)!=0,"main navigation clipped against foreground controls")
     V58SelectTab(8)
     V48Assert((DllCall("User32\GetWindowLongW","Ptr",IAState().Controls["Tabs"].Hwnd,"Int",-16,"UInt") & 0x04000000)!=0,"analysis navigation clipped against foreground controls")
 }
 V611TestBackgroundOrderRepair()
 {
     V611With(V611OrderCase)
 }
 V611OrderCase()
 {
     u := IPWState(),tab := u.Controls["Tabs"]
     DllCall("User32\SetWindowPos","Ptr",tab.Hwnd,"Ptr",0,"Int",0,"Int",0,"Int",0,"Int",0,"UInt",0x13,"Int")
     V48Assert(!V611Above(u.Controls["SessionPlayers"],tab),"counterexample actually raises background above table")
     IPWRepaintPage(),V611CheckRaid()
 }
 V611TestInactiveBulkRedraw()
 {
     V611With(V611InactiveCase)
 }
 V611InactiveCase()
 {
     V58SelectTab(2),u := IPWState(),lv := u.Controls["SessionPlayers"]
     lv.Opt("-Redraw"),lv.Opt("+Redraw")
     ; Also model explicit stale visibility, independent of common-control version.
     lv.Visible := true
     V48Assert(V58ChildVisible(lv),"counterexample has inactive session table visible")
     IPWRepaintPage()
     V48Assert(!V58ChildVisible(lv) && V58ChildVisible(u.Controls["Abilities"]),"actual page restored after stale redraw")
 }
 V611TestHiddenRootNotShown()
 {
     V611With(V611HiddenCase)
 }
 V611HiddenCase()
 {
     global IP
     IP.Gui.Hide(),IP.Visible := false
     IPWRepaintPage()
     V48Assert(!IWRepaintWindow(IP.Gui),"manual suite never triggers real painting")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int") && !IP.Visible,"repair cannot show parent")
 }
 V611TestNoFocusChange()
 {
     V611With(V611FocusCase)
 }
 V611FocusCase()
 {
     before := DllCall("User32\GetForegroundWindow","Ptr")
     IPWRepaintPage()
     V48Assert(DllCall("User32\GetForegroundWindow","Ptr")=before,"repair does not activate any window")
 }
 V611TestRepeatedRepairKeepsData()
 {
     V611With(V611RepeatedCase)
 }
 V611RepeatedCase()
 {
     p := IPRState(),data := p.Data,result := p.Result,u := IPWState(),count := u.Controls["SessionPlayers"].GetCount()
     Loop 5
         IPWRepaintPage()
     V48Assert(p.Data=data && p.Result=result && u.Controls["SessionPlayers"].GetCount()=count,"paint is not rereading or rebuilding data")
     V611CheckRaid()
 }
 V611TestResizeRepairsOrder()
 {
     V611With(V611ResizeCase)
 }
 V611ResizeCase()
 {
     global IP
     u := IPWState(),p := IPRState(),data := p.Data
     for size in [[980,650],[1220,780],[1920,1080]] {
         DllCall("User32\SetWindowPos","Ptr",u.Controls["Tabs"].Hwnd,"Ptr",0,"Int",0,"Int",0,"Int",0,"Int",0,"UInt",0x13,"Int")
         IPResize(IP.Gui,0,size[1],size[2])
         V611CheckRaid()
         V48Assert(u.Width=size[1] && u.Height=size[2] && p.Data=data,"resize keeps layout and session")
     }
 }
 V611TestPlayerSelectionDraw()
 {
     V611With(V611PlayerCase)
 }
 V611PlayerCase()
 {
     u := IPWState(),p := IPRState()
     IPRSelectPlayer(u.Controls["SessionPlayers"],1,true)
     V48Assert(p.Selected="@Little Bobby#101" && u.Controls["SessionPulls"].GetCount()=17,"selected-player detail still populated")
     V611CheckRaid()
     IPWRepaintPage()
     V48Assert(p.Selected="@Little Bobby#101","paint retains player selection")
 }
 V611TestRaidModeSwitch()
 {
     V611With(V611ModeCase)
 }
 V611ModeCase()
 {
     global IP
     u := IPWState(),p := IPRState(),data := p.Data
     V58SelectTab(9),IPWRepaintPage()
     V48Assert(p.Mode="pull" && V58ChildVisible(u.Controls["DeathList"]) && !V58ChildVisible(u.Controls["SessionPlayers"]),"only selected-pull recap visible")
     V58SelectTab(12),V611CheckRaid()
     V48Assert(p.Data=data && p.Mode="session","mode switch retains full session")
 }
 V611TestThemeRoundtrip()
 {
     V611With(V611ThemeCase)
 }
 V611ThemeCase()
 {
     global IUB,IP
     old := IUB.Theme,p := IPRState(),data := p.Data
     try {
         for theme in ["classic","iris"] {
             IUB.Theme := theme,IUBApplyAll()
             V611CheckRaid()
             V48Assert(IP.Gui.BackColor=IUBPalette().Background && p.Data=data,"palette changes color, not session")
         }
     }
     finally IUB.Theme := old
 }
 V611TestNoWorkspaceCreated()
 {
     V58Isolated(V611NoWorkspaceCase)
 }
 V611NoWorkspaceCase()
 {
     global IP
     IP := IPNewApp()
     V48Assert(!IPWRepaintPage() && !IsObject(IP.Gui) && !IP.HasOwnProp("Workspace"),"inert repair does not construct UI")
     text := IWWorkspaceDisplayReport()
     V48Assert(InStr(text,"not constructed") && !IP.HasOwnProp("Workspace"),"report stays read-only")
 }
 V611TestDeadHandles()
 {
     g := Gui(),c := g.AddTab2(,["Only"])
     g.Destroy()
     V48Assert(!IWPageDeckBack(c) && !IWRepaintWindow(g),"destroyed handles are skipped")
     V48Assert(!IWPageDeckBack("") && !IWRepaintWindow(""),"missing handles are skipped")
 }
 V611TestReportPrivacy()
 {
     V611With(V611PrivacyCase)
 }
 V611PrivacyCase()
 {
     p := IPRState(),p.Data.Label := "SECRET_SESSION_LABEL",p.Data.Path := "C:\SECRET_LOG_PATH.txt"
     text := IWWorkspaceDisplayReport()
     V48Assert(InStr(text,"workspace display diagnostics") && InStr(text,"rows=8"),"report contains layout/count facts")
     V48Assert(!InStr(text,"Little Bobby") && !InStr(text,"SECRET") && !InStr(text,"C:\"),"report omits names, labels, contents and paths")
 }
 V611TestScanStateUnchanged()
 {
     V611With(V611ScanCase)
 }
 V611ScanCase()
 {
     global IP
     p := IPRState(),p.Busy := true,p.Cancel := false,u := IPWState(),live := IP.Live
     IPRBusyControls(),IPWRepaintPage()
     V48Assert(p.Busy && !p.Cancel && u.Controls["SessionCancel"].Enabled && !u.Controls["SessionScan"].Enabled,"paint never cancels scan or overrides button policy")
     V48Assert(IP.Live=live && !IP.Active,"paint never starts or replaces parser")
     p.Busy := false
 }
 V611TestExclusionsAndSortPreserved()
 {
     V611With(V611ExclusionsCase)
 }
 V611ExclusionsCase()
 {
     u := IPWState(),p := IPRState(),lv := u.Controls["SessionPulls"]
     lv.Modify(1,"Select"),IPRTogglePull()
     data := p.Data,result := p.Result,col := p.SortCol,desc := p.SortDesc
     IPWRepaintPage()
     V48Assert(p.Data=data && p.Result=result && p.Result.Pulls.Length=16,"excluded pull does not return during paint")
     V48Assert(p.SortCol=col && p.SortDesc=desc && lv.GetCount()=17,"sort and excluded-row access retained")
 }
 V611TestAnalysisStateIndependent()
 {
     V611With(V611AnalysisStateCase)
 }
 V611AnalysisStateCase()
 {
     p := IPRState(),session := p.Data
     V58SelectTab(8),a := V591Data(),data := a.Data,query := a.Query,result := a.Result
     ; Session Deaths moved to logical tab 12; Raid (7) now shows raid totals.
     V58SelectTab(12),IPWRepaintPage(),V611CheckRaid(),V58SelectTab(8)
     V48Assert(a.Data=data && a.Query=query && a.Result=result && p.Data=session,"both session and detailed review survive tab/paint transitions")
 }
 
 ; Additional coverage for the user's report that Analysis is painted over too.
 V611AnalysisReady()
 {
     V58SelectTab(8)
     return V591Data()
 }
 V611CheckAnalysis(a,tab)
 {
     V48Assert(V595VisibilityMatches(a,tab),"only selected Analysis page stays visible")
     deck := a.Controls["Tabs"]
     for group,controls in a.Groups {
         for c in controls {
             if V58ChildVisible(c)
                 V48Assert(V611Above(c,deck),"visible Analysis control is above its background")
         }
     }
     for name in ["Load","Demo","Browse","Tools","Heading","Player","From","To","Scope","Context","Status"] {
         V48Assert(V58ChildVisible(a.Controls[name]),"Analysis toolbar/label visible: " name)
         V48Assert(V611Above(a.Controls[name],deck),"Analysis toolbar/label above background: " name)
     }
     if tab=8
         V48Assert(V611Above(a.Controls["Summary"],deck),"Summary is not behind the Analysis background")
 }
 V611TestAnalysisAllPageLayers()
 {
     V611With(V611AnalysisPagesCase)
 }
 V611AnalysisPagesCase()
 {
     a := V611AnalysisReady()
     Loop 8 {
         tab := A_Index
         V7826SelectReviewPage(tab)
         V611CheckAnalysis(a,tab)
     }
 }
 V611TestAnalysisBackgroundRepair()
 {
     V611With(V611AnalysisOrderCase)
 }
 V611AnalysisOrderCase()
 {
     a := V611AnalysisReady(),V7826SelectReviewPage(2)
     deck := a.Controls["Tabs"]
     DllCall("User32\SetWindowPos","Ptr",deck.Hwnd,"Ptr",0,"Int",0,"Int",0,"Int",0,"Int",0,"UInt",0x13,"Int")
     V48Assert(!V611Above(a.Controls["DamageHint"],deck),"counterexample covers a label, not only a table")
     IAApplyPageVisibility(),V611CheckAnalysis(a,2)
 }
 V611TestAnalysisBulkRefreshPages()
 {
     V611With(V611AnalysisBulkCase)
 }
 V611AnalysisBulkCase()
 {
     a := V611AnalysisReady(),data := a.Data,query := a.Query
     for tab in [2,3,4,5,6,7,8] {
         V7826SelectReviewPage(tab)
         IARender(false)
         V611CheckAnalysis(a,tab)
         V48Assert(a.Data=data && a.Query=query,"bulk redraw keeps the current review and time range")
     }
 }
 V611TestAnalysisStaleInactiveTable()
 {
     V611With(V611AnalysisStaleCase)
 }
 V611AnalysisStaleCase()
 {
     a := V611AnalysisReady(),V7826SelectReviewPage(6)
     a.Tables["Damage"].Opt("-Redraw"),a.Tables["Damage"].Opt("+Redraw")
     a.Tables["Damage"].Visible := true
     V48Assert(V58ChildVisible(a.Tables["Damage"]),"counterexample shows the wrong Analysis table")
     IAApplyPageVisibility()
     V48Assert(!V58ChildVisible(a.Tables["Damage"]),"inactive table hidden after redraw recovery")
     V611CheckAnalysis(a,6)
 }
 V611TestAnalysisResizeLayers()
 {
     V611With(V611AnalysisResizeCase)
 }
 V611AnalysisResizeCase()
 {
     a := V611AnalysisReady(),V7826SelectReviewPage(7)
     query := a.Query,result := a.Result
     for size in [[664,428],[904,558],[1284,758]] {
         DllCall("User32\SetWindowPos","Ptr",a.Controls["Tabs"].Hwnd,"Ptr",0,"Int",0,"Int",0,"Int",0,"Int",0,"UInt",0x13,"Int")
         IAEmbeddedResize(size[1],size[2]),V611CheckAnalysis(a,7)
         V48Assert(a.Query=query && a.Result=result,"resize does not calculate another interval")
     }
 }
 V611TestAnalysisPaletteLayers()
 {
     V611With(V611AnalysisPaletteCase)
 }
 V611AnalysisPaletteCase()
 {
     global IUB
     a := V611AnalysisReady(),V7826SelectReviewPage(2)
     theme := IUB.Theme,query := a.Query
     try {
         for value in ["classic","iris"] {
             IUB.Theme := value,IUBApplyAll()
             V611CheckAnalysis(a,2)
             V48Assert(a.Gui.BackColor=IUBPalette().Background && a.Query=query,"palette retains review and correct background")
         }
     }
     finally IUB.Theme := theme
 }
 V611TestAnalysisPaintKeepsBitmap()
 {
     V611With(V611AnalysisBitmapCase)
 }
 V611AnalysisBitmapCase()
 {
     a := V611AnalysisReady(),before := V595BitmapInfo(a.Controls["Chart"])
     V48Assert(before.Handle && before.Width>0 && before.Height>0,"test starts with an attached chart")
     data := a.Data,query := a.Query,result := a.Result
     Loop 4
         IAApplyPageVisibility()
     after := V595BitmapInfo(a.Controls["Chart"])
     V48Assert(after.Handle=before.Handle && after.Width=before.Width && after.Height=before.Height,"paint recovery does not recreate or erase chart")
     V48Assert(a.Data=data && a.Query=query && a.Result=result,"paint recovery never replays or queries data")
 }
 V611TestAnalysisPaintDoesNotShow()
 {
     V611With(V611AnalysisHiddenCase)
 }
 V611AnalysisHiddenCase()
 {
     global IP
     a := V611AnalysisReady(),before := DllCall("User32\GetForegroundWindow","Ptr")
     IP.Gui.Hide(),a.Gui.Hide(),a.Visible := false
     IAApplyPageVisibility()
     V48Assert(!IWRepaintWindow(a.Gui) && !a.Visible,"hidden analysis does not initiate painting or change visible state")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd,"Int"),"hidden child remains hidden")
     V48Assert(DllCall("User32\GetForegroundWindow","Ptr")=before,"Analysis repair does not take focus")
 }
 V611TestAnalysisDiagnosticPrivacy()
 {
     V611With(V611AnalysisPrivacyCase)
 }
 V611AnalysisPrivacyCase()
 {
     a := V611AnalysisReady(),a.Data.Name := "SECRET_BOSS",a.Data.Path := "C:\SECRET_LOG.txt"
     a.Controls["Heading"].Text := "SECRET_PLAYER_OR_BOSS"
     text := IWWorkspaceDisplayReport()
     V48Assert(InStr(text,"Analysis constructed: 1") && InStr(text,"Analysis/Damage: ") && InStr(text,"Analysis/Chart: "),"diagnostics cover Analysis tables and non-table controls")
     V48Assert(!InStr(text,"SECRET") && !InStr(text,"Demo DPS") && !InStr(text,"C:\"),"Analysis diagnostic has no names, contents or file paths")
 }
 V611TestStandaloneAnalysisLayers()
 {
     V59Hidden(V611StandaloneCase)
 }
 V611StandaloneCase()
 {
     a := IAState(),V7826SelectReviewPage(2)
     deck := a.Controls["Tabs"]
     V48Assert(!a.Parent && !DllCall("User32\GetPropW","Ptr",deck.Hwnd,"Str","ahk_dlg","Ptr"),"standalone diagnostic host also has no unused page dialog")
     V48Assert(V595VisibilityMatches(a,2),"standalone native page ownership preserved")
     for name in ["DamageHint","Damage","Targets","SetAdd","ClassNote","Summary"]
         V48Assert(V58ChildVisible(a.Controls[name]) && V611Above(a.Controls[name],deck),"standalone controls remain above background: " name)
 }
 ; v61.2: manual-only Active % tests. Synthetic players/events, no live log/audio.
 V612Event(kind,at,seq := 1,key := "@A#1",ability := "90001",mode := "assumed")
 {
     return {Kind:kind,At:at,Seq:seq,Key:key,Ability:ability,Mode:mode,HPDead:false}
 }
 V612Calculate(rows,finish := 10000,start := 0)
 {
     events := Map()
     for i,e in rows
         events["e" i] := e
     return IPABuildActivity(events,start,finish)
 }
 V612Apply(s,at,kind := "Activate",ability := "90001",key := "@A#1")
 {
     ev := IPParseLine(IPDemoLine(at,key,"=",kind,kind="Damage" || kind="Heal" ? 10 : 0))
     ev.AbilityId := ability,ev.Ability := "Synthetic activity"
     IPApplyEvent(s,ev,at)
     return ev
 }
 V612Other(s,at,ability,code := "836045448945481",key := "@A#1")
 {
     ev := IPParseLine(IPDemoLine(at,key,"=","Activate"))
     ev.Kind := "Other",ev.AbilityId := ability,ev.EffectId := code,ev.ActionId := "836045448945472"
     IPApplyEvent(s,ev,at)
     return ev
 }
 V612TestLedgerInert()
 {
     a := IPANewLedger()
     V48Assert(a.Events.Count=0 && a.Flags.Count=0 && !IsObject(a.Cache) && a.Max=40000,"bounded empty ledger, no GUI or timer")
 }
 V612TestRegistry()
 {
     V48Assert(IPAMode("975760735076352")="off" && IPAMode("3408949902573568")="channel","verified numeric IDs")
     V48Assert(IPAMode("1416815221669888")="cast" && IPAMode("90001")="assumed","unknown stays explicitly assumed")
     V48Assert(IPAMode("2306869884354560")="assumed","NPC Deadly Saber ID is not the player off-GCD rule")
 }
 V612TestOneGCD()
 {
     p := V612Calculate([V612Event("start",0)])["@A#1"]
     V48Assert(p.Values[5]=1400 && IPAValue(p)=14 && p.Assumed=1,"one assumed GCD in ten seconds")
 }
 V612TestFullGCDCoverage()
 {
     rows := []
     Loop 100
         rows.Push(V612Event("start",(A_Index-1)*1400,A_Index))
     p := V612Calculate(rows,140000)["@A#1"]
     V48Assert(IPAValue(p)=100 && p.Values[5]=140000,"continuous actions cover but cannot exceed full pull")
 }
 V612TestIdleNotCredited()
 {
     p := V612Calculate([V612Event("start",0),V612Event("start",6000,2)])["@A#1"]
     V48Assert(p.Values[5]=2800 && IPAValue(p)=28,"idle gap not counted as casting")
 }
 V612TestOverlapUnion()
 {
     p := V612Calculate([V612Event("start",0),V612Event("start",700,2)])["@A#1"]
     V48Assert(p.Values[5]=2100,"overlapping GCD windows count once")
 }
 V612TestBoundaryClipping()
 {
     p := V612Calculate([V612Event("start",9500),V612Event("start",10000,2)])["@A#1"]
     V48Assert(p.Values[5]=500 && p.Seen=1,"last action clipped; endpoint start earns no time")
 }
 V612TestOffGCDZero()
 {
     p := V612Calculate([V612Event("start",0,1,"@A#1","975760735076352","off")])["@A#1"]
     V48Assert(p.Values[5]=0 && p.Off=1 && p.Valid,"known off-GCD only is valid zero occupied GCD time")
 }
 V612TestOffGCDWeave()
 {
     p := V612Calculate([V612Event("start",0),V612Event("start",800,2,"@A#1","975760735076352","off")])["@A#1"]
     V48Assert(p.Values[5]=1400 && p.Off=1,"off-GCD does not inflate or truncate prior action")
 }
 V612TestDeathClipAndRez()
 {
     p := V612Calculate([V612Event("start",0),V612Event("death",500,2),V612Event("start",6000,3)])["@A#1"]
     V48Assert(p.Values[5]=1900,"death clips window; later activation credits only later activity")
 }
 V612TestDeathSameTime()
 {
     p := V612Calculate([V612Event("start",1000),V612Event("death",1000,2),V612Event("start",1000,3)])["@A#1"]
     V48Assert(p.Values[5]=0 && p.DeadStarts=1,"same-time death clips old action and does not fabricate resurrection")
 }
 V612TestDeadHP()
 {
     e := V612Event("start",0),e.HPDead := true
     p := V612Calculate([e])["@A#1"]
     V48Assert(!p.Valid && p.DeadStarts=1 && IPAValue(p)=-1,"zero-HP activation not activity evidence")
 }
 V612TestChannelSpan()
 {
     p := V612Calculate([V612Event("start",0,1,"@A#1","C","channel"),
         V612Event("result",1000,2,"@A#1","C","channel"),V612Event("stop",2800,3,"@A#1","C","channel")])["@A#1"]
     V48Assert(p.Values[5]=2800 && p.Missing=0,"channel occupies measured span beyond one GCD")
 }
 V612TestChannelWeave()
 {
     p := V612Calculate([V612Event("start",0,1,"@A#1","C","channel"),
         V612Event("start",800,2,"@A#1","O","off"),V612Event("stop",3000,3,"@A#1","C","channel")])["@A#1"]
     V48Assert(p.Values[5]=3000 && p.Off=1,"known off-GCD weave does not break channel")
 }
 V612TestChannelInterruptedGCD()
 {
     p := V612Calculate([V612Event("start",0,1,"@A#1","C","channel"),
         V612Event("stop",400,2,"@A#1","C","channel"),V612Event("result",6000,3,"@A#1","C","channel")])["@A#1"]
     V48Assert(p.Values[5]=1400,"interruption stops channel span, retains assumed GCD; late result cannot extend")
 }
 V612TestDeathAfterChannelStop()
 {
     p := V612Calculate([V612Event("start",0,1,"@A#1","C","channel"),
         V612Event("stop",100,2,"@A#1","C","channel"),V612Event("death",500,3)])["@A#1"]
     V48Assert(p.Values[5]=500,"death after early channel stop still clips outstanding GCD")
 }
 V612TestMissingChannelEnd()
 {
     p := V612Calculate([V612Event("start",0,1,"@A#1","C","channel"),
         V612Event("result",2300,2,"@A#1","C","channel")])["@A#1"]
     V48Assert(p.Values[5]=2300 && p.Missing=1,"no presumed full channel duration or idle tail")
 }
 V612TestResultWithoutActivation()
 {
     p := V612Calculate([V612Event("result",2300,1,"@A#1","C","channel")])["@A#1"]
     V48Assert(p.Values[5]=0 && !p.Valid && IPAValue(p)=-1,"passive damage/healing is not button activity")
 }
 V612TestWrongActorAndAbility()
 {
     p := V612Calculate([V612Event("start",0,1,"@A#1","C","channel"),
         V612Event("stop",2800,2,"@Other#2","C","channel"),V612Event("result",3000,3,"@A#1","other","channel")])["@A#1"]
     V48Assert(p.Values[5]=1400 && p.Missing=1,"matching requires exact actor and ability")
 }
 V612TestCastFirstResultOnly()
 {
     p := V612Calculate([V612Event("start",0,1,"@A#1","H","cast"),
         V612Event("result",2000,2,"@A#1","H","cast"),V612Event("result",6000,3,"@A#1","H","cast"),
         V612Event("stop",7000,4,"@A#1","H","cast")])["@A#1"]
     V48Assert(p.Values[5]=2000,"first matched cast result only; later periodic healing cannot extend")
 }
 V612TestInstantProcCast()
 {
     p := V612Calculate([V612Event("start",0,1,"@A#1","H","cast"),V612Event("result",30,2,"@A#1","H","cast")])["@A#1"]
     V48Assert(p.Values[5]=1400,"instant proc does not inherit a configured long cast time")
 }
 V612TestStaleEndpoint()
 {
     p := V612Calculate([V612Event("start",0,1,"@A#1","C","channel"),V612Event("stop",15000,2,"@A#1","C","channel")],20000)["@A#1"]
     V48Assert(p.Values[5]=1400 && p.Missing=1,"stale matching cancellation does not turn waiting into uptime")
 }
 V612TestOrderingAndDuplicates()
 {
     p := V612Calculate([V612Event("start",2800,3),V612Event("start",0,1),V612Event("start",0,2)])["@A#1"]
     V48Assert(p.Values[5]=2800 && p.Duplicate=1,"source order stable after timestamp sorting; duplicate start does not inflate")
 }
 V612TestConfigChoices()
 {
     p := V612Calculate([V612Event("start",0)])["@A#1"]
     Loop 6
         V48Assert(p.Values[A_Index]=900+100*A_Index,"independent GCD assumptions")
     V48Assert(IPAValue(p,900)=-1 && IPAValue(p,1450)=-1 && IPAValue(p,1500)=15,"unsupported GCD values rejected")
 }
 V612TestSessionWeighted()
 {
     one := V612Calculate([V612Event("start",0)],10000)["@A#1"]
     two := V612Calculate([V612Event("start",0)],20000)["@A#1"]
     t := {},IPAAddSummary(t,{Active:one},1400),IPAAddSummary(t,{Active:two},1400)
     V48Assert(t.ActiveMs=2800 && t.ActiveTime=30000 && Abs(t.ActivePct-9.333333333)<0.00001,"duration-weighted, not mean of 14 and 7")
 }
 V612TestMissingExcluded()
 {
     a := V612Calculate([V612Event("start",0)])["@A#1"],b := a.Clone(),b.Valid := false
     t := {},IPAAddSummary(t,{Active:a},1400),IPAAddSummary(t,{Active:b},1400),IPAAddSummary(t,{},1400)
     V48Assert(t.ActivePulls=1 && t.ActivePct=14,"partial/missing not silently added as zero")
 }
 V612TestAcceptedCapture()
 {
     s := V61Base(),V612Apply(s,0),p := V61Finish(s)
     V48Assert(p.Players.Has("@A#1") && IPAValue(p.Players["@A#1"].Active)=14,"accepted pipeline feeds compact activity")
 }
 V612TestLifecycleCapture()
 {
     s := V61Base(),V612Apply(s,0,"Activate","3408949902573568"),before := s.Current.EventCount
     V612Other(s,2800,"3408949902573568"),p := V61Finish(s)
     V48Assert(IPAValue(p.Players["@A#1"].Active)=28 && s.Segments[1].EventCount=before,"Other marker affects activity only, not retained metric-event count")
 }
 V612TestDeathCountsPreserved()
 {
     s := V61Base(),V612Apply(s,0),V612Apply(s,500,"Death"),V612Apply(s,6000),V612Apply(s,9000,"Death")
     p := V61Finish(s),a := p.Players["@A#1"]
     V48Assert(a.Deaths=2 && a.First=500 && IPAValue(a.Active)=19,"death bookkeeping unchanged by activity capture")
 }
 V612TestJournalRollback()
 {
     s := V61Base(),seg := s.Current,V612Apply(s,0)
     IPBBeginUndo(s,seg)
     V612Apply(s,6000)
     V48Assert(seg.Activity.Events.Count=2 && seg.Undo.Maps.Has("ActiveEvents"),"activity changes participate in original undo journal")
     IPBRollbackTail(s,seg)
     p := V61Finish(s)
     V48Assert(IPAValue(p.Players["@A#1"].Active)=14,"rolled-back activation cannot leak into active seconds")
 }
 V612TestLimitDisclosed()
 {
     s := V61Base(),s.Current.Activity.Max := 1,V612Apply(s,0),V612Apply(s,3000)
     p := V61Finish(s)
     V48Assert(!s.Halted && p.Players["@A#1"].Active.Reason="activity storage limit" && IPAValue(p.Players["@A#1"].Active)=-1,"activity cap withholds this metric only")
 }
 V612TestCacheInvalidation()
 {
     s := V61Base(),seg := s.Current,V612Apply(s,0),p := V61Finish(s),a := IPACompact(seg),b := IPACompact(seg)
     V48Assert(a=b,"completed compact result reused")
     s.Current := seg,V612Apply(s,6000),c := IPACompact(seg)
     V48Assert(c!=a && IPAValue(c["@A#1"])=28,"accepted new evidence invalidates cache")
     seg.Last := 6500,d := IPACompact(seg)
     V48Assert(d!=c && d["@A#1"].Values[5]=1900,"endpoint change invalidates cache and clips result")
     s.Current := ""
 }
 V612TestPartialAndZero()
 {
     s := V61Base(),V612Apply(s,0),s.Current.Partial := true,p := V61Finish(s)
     V48Assert(IPAValue(p.Players["@A#1"].Active)=-1,"known partial pull does not get an apparently complete rate")
     V48Assert(IPAValue("")=-1 && IPAText(-1)="--" && IPAText(0)="0.0","missing and genuine zero distinct")
 }
 V612TestPerPlayerGCD()
 {
     c := {Default:1400,Players:Map("@A#1",1300)}
     V48Assert(IPAGCD("@A#1",c)=1300 && IPAGCD("@A#2",c)=1400,"same display name with different actor key not merged")
 }
 V612TestDemoAndReport()
 {
     d := IPRDemoData(),r := IPRSummary(d),b := r.Players["@Little Bobby#101"]
     V48Assert(b.Deaths=28 && b.Delta=11 && b.Firsts=11,"Bobby death fixture preserved")
     V48Assert(b.ActivePulls=17 && Abs(b.ActivePct-77.0588235294)<0.00001,"demo weighted activity")
     a := d.Pulls[1].Players["@Little Bobby#101"].Active
     V48Assert(IPAValue(a,1300)<IPAValue(a,1400),"demo responds to shorter GCD assumption")
     text := IPADetails(r)
     V48Assert(InStr(text,"ESTIMATE") && InStr(text,"Assumed GCD actions") && InStr(text,"not a percentile"),"definition and assumptions included with exported numbers")
 }
 V612TestHiddenColumns()
 {
     V61Hidden(V612ColumnsCase)
 }
 V612ColumnsCase()
 {
     V61Ready(),IPRDemo(),u := IPWState(),lv := u.Controls["SessionPlayers"]
     V48Assert(lv.GetCount("Col")=10 && lv.GetText(1,8)!="" && lv.GetText(1,9)!="","key routing retained and visible activity values")
     b := Buffer(40,0)
     V48Assert(SendMessage(0x103B,10,b.Ptr,lv) && NumGet(b,20,"Int")=8,"Active visually follows first deaths")
     V48Assert(u.Controls.Has("SessionActive") && V58ChildVisible(u.Controls["SessionActive"]),"setup visible on Raid")
 }
 V612TestHiddenPullActivity()
 {
     V61Hidden(V612PullCase)
 }
 V612PullCase()
 {
     V61Ready(),IPRDemo(),p := IPRState(),p.Selected := "@Little Bobby#101",IPRDrawPulls()
     lv := IPWState().Controls["SessionPulls"]
     V48Assert(lv.GetText(1,9)="1" && lv.GetText(1,10)="70.0","per-pull activity alongside death timing")
     p.Selected := "",IPRDrawPulls()
     V48Assert(lv.GetText(1,10)="--","all-player row does not invent an individual activity rate")
 }
 V612TestHiddenPaintPreserved()
 {
     V61Hidden(V612PaintCase)
 }
 V612PaintCase()
 {
     V61Ready(),IPRDemo(),u := IPWState()
     u.Controls["Tabs"].Choose(IPWTabPosition(1)),IPWTabChanged(),IPWRepaintPage()
     V48Assert(!V58ChildVisible(u.Controls["SessionPlayers"]) && !V58ChildVisible(u.Controls["SessionActive"]),"Raid controls cannot paint over another page")
 }
 V612TestHiddenLayout()
 {
     V61Hidden(V612LayoutCase)
 }
 V612LayoutCase()
 {
     global IP
     V61Ready(),u := IPWState()
     for size in [[980,650],[1220,780],[1920,1080]] {
         IPResize(IP.Gui,0,size[1],size[2]),u.Controls["SessionActive"].GetPos(&x,&y,&w,&h)
         V48Assert(x>=280 && x+w<=size[1]-12 && y+h<size[2]-42,"Active setup fits minimum and larger layouts")
     }
 }
 V612TestNoSettingsInHarness()
 {
     global IP
     old := IP
     try {
         IP := IPNewApp(),c := IPAConfig()
         V48Assert(c.Default=1400 && c.Players.Count=0 && !IsObject(c.Gui),"isolated default does not read personal INI")
         IPAOpen(),IPAApplySettings(),IPACopyDetails()
         V48Assert(!IsObject(c.Gui) && c.Default=1400,"no visible UI, clipboard, or settings writes in diagnostics")
     }
     finally IP := old
 }
 
 V612TestFullSourceActivity()
 {
     V61Hidden(V612FullScanCase)
 }
 V612FullScanCase()
 {
     global IP
     V61Ready(),path := V61ScanFixture(70),original := IP.Live
     try {
         IPRScanPrepare(path,"UTF-8"),IPRScanPump(),p := IPRState(),r := IPRSummary(p.Data)
         b := r.Players["@Bobby#101"]
         V48Assert(b.ActivePulls=70 && b.ActiveMs>0 && b.ActiveMs<b.ActiveTime,"compact activity retained beyond 60 detailed fights")
         V48Assert(b.Pulls=70 && b.Deaths=140 && IP.Live=original,"whole-source activity does not replace main data or death counts")
     }
     finally {
         IPRCancel()
         if FileExist(path)
             FileDelete(path)
     }
 }
 ; v61.3 manual-only tests for labels, contextual rows and unchanged values.
 V613TwoPlayers(first := 1000,other := 500)
 {
     s := V61Base()
     V61Apply(s,0,"Activate"),V61Apply(s,0,"Activate","@Other#2")
     if other>=0
         V61Apply(s,other,"Death","@Other#2")
     if first>=0
         V61Apply(s,first,"Death")
     return V61Finish(s)
 }
 
 V613TestRaidHeaders()
 {
     h := IPRDeathHeaders(false)
     V48Assert(h[4]="First to die" && h[5]="First death at" && h[6]="Raid deaths","raid columns identify a player, a relative time and raid total")
     V48Assert(h[8]="Death order" && h.Count=4,"only presentation headers supplied")
 }
 V613TestPlayerHeaders()
 {
     h := IPRDeathHeaders(true)
     V48Assert(h[4]="Death status" && h[5]="First death at" && h[6]="Player deaths","selected-player scope is explicit")
     V48Assert(!InStr(h[4],"/"),"not a fraction or ambiguous slash label")
 }
 V613TestFirstAndLater()
 {
     p := V613TwoPlayers(),b := p.Players["@Bobby#101"],o := p.Players["@Other#2"]
     V48Assert(IPRDeathLabel(p)="Other" && IPRDeathLabel(p,o)="Died first","raid first death label follows existing chronology")
     V48Assert(IPRDeathLabel(p,b)="Died later" && b.First=1000 && b.FirstOrder=2,"personal first death can be second raid death; numbers unchanged")
 }
 V613TestTies()
 {
     p := V613TwoPlayers(1000,1000)
     V48Assert(InStr(IPRDeathLabel(p),"Bobby") && InStr(IPRDeathLabel(p),"Other") && InStr(IPRDeathLabel(p),"(tie)"),"all simultaneous first victims named")
     for key,r in p.Players
         V48Assert(IPRDeathLabel(p,r)="Died first (tie)" && r.FirstOrder=1,"each first-death tie labelled without arbitrarily choosing one")
 }
 V613TestNoRecordedDeath()
 {
     p := V613TwoPlayers(-1,-1)
     V48Assert(IPRDeathLabel(p)="No recorded death","raid no-death row is not blank")
     V48Assert(IPRDeathLabel(p,p.Players["@Bobby#101"])="No recorded death","no claim of a recorded first death when none exists")
 }
 V613TestIncompleteTiming()
 {
     p := V613TwoPlayers(),b := p.Players["@Bobby#101"]
     p.TimingComplete := false
     V48Assert(IPRDeathLabel(p)="Timing incomplete" && IPRDeathLabel(p,b)="Died; order unknown","missing raid chronology cannot name a sole first death")
     b.TimingComplete := false
     V48Assert(IPRDeathLabel(p,b)="Died; time unknown" && b.Deaths=1,"available count retained while time is unknown")
     b.TimingComplete := true,b.First := -1
     V48Assert(IPRDeathLabel(p,b)="Died; time unknown","inconsistent missing first timestamp never shown as died later")
 }
 V613TestContext()
 {
     r := IPRSummary(IPRDemoData())
     V48Assert(InStr(IPRDeathContext(r),"Raid overview") && InStr(IPRDeathContext(r),"pull start"),"raid context defines the time origin")
     text := IPRDeathContext(r,"@Little Bobby#101")
     V48Assert(InStr(text,"Little Bobby") && InStr(text,"Not necessarily the raid's first") && InStr(text,"17/17"),"personal context states whose first death and coverage")
     V48Assert(InStr(IPRDeathContext(r,"@Missing#9"),"Raid overview"),"stale selection has safe neutral context")
 }
 V613TestCopiedLabels()
 {
     d := IPRDemoData(),r := IPRSummary(d),text := IPRReport(d,r)
     V48Assert(InStr(text,"Times died first") && InStr(text,"First to die") && InStr(text,"First death at (from pull start)"),"copy uses explicit labels")
     V48Assert(InStr(text,"Little Bobby`t17`t28`t11") && r.Players["@Little Bobby#101"].Firsts=11,"total deaths and times died first are unchanged")
 }
 V613TestLabelPurity()
 {
     d := IPRDemoData(),r := IPRSummary(d),before := IPRReport(d,r),p := d.Pulls[1]
     for key,person in p.Players
         IPRDeathLabel(p,person)
     IPRDeathLabel(p),IPRDeathHeaders(true),IPRDeathContext(r,"@Little Bobby#101")
     V48Assert(before=IPRReport(d,IPRSummary(d)),"label helpers do not mutate pull, death or activity evidence")
 }
 V613TestHiddenInitialHeaders()
 {
     V61Hidden(V613InitialCase)
 }
 V613InitialCase()
 {
     V61Ready(),u := IPWState(),c := u.Controls
     V48Assert(c["SessionPlayers"].GetText(0,4)="Times died first","upper count column has a count label")
     V48Assert(c["SessionPulls"].GetText(0,4)="First to die" && c["SessionPulls"].GetText(0,6)="Raid deaths","empty initial view is explicitly raid scoped")
     V48Assert(c["SessionAll"].Text="Raid overview","return action names its destination")
 }
 V613TestHiddenPlayerSwitch()
 {
     V61Hidden(V613SwitchCase)
 }
 V613SwitchCase()
 {
     V61Ready(),IPRDemo(),u := IPWState(),p := IPRState(),lv := u.Controls["SessionPulls"]
     IPRSelectPlayer(u.Controls["SessionPlayers"],1,true)
     V48Assert(p.Selected="@Little Bobby#101" && lv.GetText(0,4)="Death status" && lv.GetText(0,6)="Player deaths","selecting player updates headers with rows")
     V48Assert(lv.GetText(1,4)="Died first" && lv.GetText(12,4)="Died later","first and later deaths have distinct plain-language outcomes")
     V48Assert(lv.GetText(1,5)="0:45.000" && lv.GetText(1,6)="2" && lv.GetText(1,8)="1" && lv.GetText(1,9)="1" && lv.GetText(1,10)="70.0","times, counts, order, hidden keys and activity retained")
     IPRAllPlayers()
     V48Assert(lv.GetText(0,4)="First to die" && lv.GetText(0,6)="Raid deaths" && lv.GetText(1,4)="Little Bobby" && lv.GetText(1,6)="9","raid overview restores raid identities and death totals")
 }
 V613TestHiddenColumnWidths()
 {
     V61Hidden(V613WidthsCase)
 }
 V613WidthsCase()
 {
     V61Ready(),IPRDemo(),p := IPRState(),lv := IPWState().Controls["SessionPulls"]
     widths := Map()
     for col in [4,5,6,8] {
         lv.ModifyCol(col,170+col*3)
         widths[col] := SendMessage(0x101D,col-1,0,lv)
     }
     p.Selected := "@Little Bobby#101",IPRDrawPulls()
     for col,width in widths
         V48Assert(SendMessage(0x101D,col-1,0,lv)=width,"header change does not auto-size columns")
     p.Selected := "",IPRDrawPulls()
     for col,width in widths
         V48Assert(SendMessage(0x101D,col-1,0,lv)=width,"return to raid keeps manual widths")
     V48Assert(SendMessage(0x101D,8,0,lv)=0,"hidden identity column stays hidden")
 }
 V613TestHiddenContextLayout()
 {
     V61Hidden(V613LayoutCase)
 }
 V613LayoutCase()
 {
     global IP
     V61Ready(),IPRDemo(),u := IPWState()
     for size in [[980,650],[1220,780],[1920,1080]] {
         IPResize(IP.Gui,0,size[1],size[2])
         u.Controls["SessionDetail"].GetPos(&x,&y,&w,&h)
         u.Controls["SessionPulls"].GetPos(&tx,&ty,&tw,&th)
         u.Controls["SessionCopy"].GetPos(&bx,&by)
         V48Assert(h>=38 && y+h<ty && ty+th<by,"two-line context clears pull table and footer at every supported size")
     }
 }
 V613TestHiddenExclusionScope()
 {
     V61Hidden(V613ExclusionCase)
 }
 V613ExclusionCase()
 {
     V61Ready(),IPRDemo(),p := IPRState(),lv := IPWState().Controls["SessionPulls"]
     p.Selected := "@Little Bobby#101",IPRDrawPulls(),lv.Modify(1,"Select"),IPRTogglePull()
     V48Assert(lv.GetCount()=17 && lv.GetText(1,9)="1" && lv.GetText(1,4)="Died first","excluded rows retain identity and can be restored")
     V48Assert(lv.GetText(0,6)="Player deaths" && p.Result.Players[p.Selected].Pulls=16,"filtering does not silently relabel personal deaths as raid deaths")
     IPRRestorePulls()
     V48Assert(p.Result.Players[p.Selected].Pulls=17 && p.Result.Players[p.Selected].Deaths=28,"restoration uses unchanged summary arithmetic")
 }
 ; v61.4: manual-only source routing, persistence and existing import/live guards.
 V614App()
 {
     app := IPNewApp(),app.Live := V52Fixture(),app.Offline := V52Fixture()
     V51Feed(app.Offline,12000,"Exit",0,"@A#1","=")
     V51Feed(app.Offline,40000,"Enter",0,"@A#1","=")
     V51Feed(app.Offline,40000,"Damage",22222,"@C#4")
     app.View := "Imported",app.Selected := 1,app.Follow := false,app.Actor := "@B#2"
     return app
 }
 V614TestDefault()
 {
     m := IPMNewState()
     V48Assert(m.Source=3 && !m.Wanted && !m.TimerOn && !m.Editing,"automatic is a policy, not startup collection/visibility")
 }
 V614TestChoices()
 {
     c := IPMSourceChoices()
     V48Assert(c.Length=3 && c[1]="Latest live segment" && InStr(c[2],"Parser selection"),"manual indexes retained")
     V48Assert(InStr(c[3],"Automatic") && InStr(c[3],"recommended"),"automatic is discoverable in the same picker")
 }
 V614TestValidation()
 {
     for v in [1,2,3,"1","2","3"]
         V48Assert(IPMSourceValue(v)=Integer(v),"valid numeric mode retained")
     for v in ["",0,4,-1,"banana",1.5]
         V48Assert(IPMSourceValue(v)=3,"invalid mode has automatic fallback")
 }
 V614TestSavedSelection()
 {
     app := V614App(),r := IPMResolve(app,3)
     V48Assert(r.Data=app.Offline && r.Segment=app.Offline.Segments[1] && r.State="IMPORTED","saved selection reaches overlay resolver")
     app.Selected := 2,r := IPMResolve(app,3)
     V48Assert(r.Segment=app.Offline.Segments[2] && r.Segment.Totals["@C#4"].Damage=22222,"changing selected fight changes overlay data")
 }
 V614TestSavedFollow()
 {
     app := V614App(),app.Follow := true
     V48Assert(IPMResolve(app,3).Segment=app.Offline.Segments[2],"Follow latest retained for saved source")
     app.Follow := false,app.Selected := 999
     V48Assert(IPMResolve(app,3).Segment=app.Offline.Segments[2],"out-of-range selection remains safely bounded")
 }
 V614TestLiveWins()
 {
     app := V614App(),app.Active := true
     V48Assert(IPMEffectiveSource(app,3)=1 && IPMResolve(app,3).Data=app.Live,"collecting uses live even if an already-loaded saved view is browsed")
     V48Assert(app.View="Imported" && app.Selected=1,"routing does not change the desktop selection")
 }
 V614TestDraining()
 {
     app := V614App(),app.Queue := ["pending"],app.Head := 1,r := IPMResolve(app,3)
     V48Assert(r.Data=app.Live && r.State="DRAINING" && r.Pending=1,"unfinished live records cannot be mistaken for saved data")
     app.Head := 2
     V48Assert(IPMResolve(app,3).Data=app.Offline,"finished queue returns to selected source when stopped")
 }
 V614TestStoppedHistory()
 {
     app := V614App(),app.Live := app.Offline,app.Offline := "",app.View := "Live"
     r := IPMResolve(app,3)
     V48Assert(r.Segment=app.Live.Segments[1] && r.State="STOPPED HISTORY","stopped history selection available automatically")
 }
 V614TestManualModes()
 {
     app := V614App()
     V48Assert(IPMResolve(app,1).Data=app.Live,"manual latest live ignores saved selection")
     app.Active := true
     V48Assert(IPMResolve(app,2).Data=app.Offline,"manual parser selection retains its explicit override")
 }
 V614TestMissingData()
 {
     app := IPNewApp(),r := IPMResolve(app,3)
     V48Assert(!IsObject(r.Segment) && r.State="PARSER OFF: NO DATA","fresh automatic startup has no invented data")
     app.Live := V52Fixture(),app.View := "Imported",r := IPMResolve(app,3)
     V48Assert(!IsObject(r.Data) && r.State="NO IMPORTED DATA","missing saved source does not silently fall back to old live")
 }
 V614TestPartialLabels()
 {
     app := V614App(),app.Offline.Partial := true,snap := IPMSnapshot(IPMResolve(app,3))
     V48Assert(snap.Partial && InStr(IPMBadge(snap),"Saved") && InStr(IPMBadge(snap),"!"),"partial imported results remain saved and incomplete")
     app.ImportFile := {},r := IPMResolve(app,3)
     V48Assert(r.State="IMPORTING" && r.Data=app.Offline,"in-progress source is never labelled live")
 }
 V614TestDemoLabels()
 {
     app := V614App(),app.Offline.Label := "SYNTHETIC DEMO",snap := IPMSnapshot(IPMResolve(app,3))
     V48Assert(InStr(snap.State,"DEMO") && IPMBadge(snap)="Demo","parser sample remains explicitly synthetic")
 }
 V614TestPersonalIdentity()
 {
     app := V614App(),snap := IPMSnapshot(IPMResolve(app,3)),live := IPMSourceUsesLive(app,3)
     who := IPMPersonalActor(snap,"","@A#1",app.Actor,live)
     V48Assert(!live && who.Key="@B#2","automatic personal follows selected saved player")
     app.Active := true,snap := IPMSnapshot(IPMResolve(app,3)),live := IPMSourceUsesLive(app,3)
     who := IPMPersonalActor(snap,"","@A#1",live ? "" : app.Actor,live)
     V48Assert(live && who.Key="@A#1","automatic personal uses local live identity when collecting")
     V48Assert(!IsObject(IPMPersonalActor(snap,"@Missing#9","@A#1","",true)),"explicit missing pin not replaced by another person")
 }
 V614TestResolverPurity()
 {
     app := V614App(),live := app.Live,off := app.Offline,seg := off.Segments[1]
     before := IPCsvData(off,seg)
     for m in [1,2,3,0] {
         r := IPMResolve(app,m),snap := IPMSnapshot(r)
         IPMSourceUsesLive(app,m)
     }
     V48Assert(IPCsvData(off,seg)=before && app.Live=live && app.Offline=off,"resolution never recalculates/mutates stored values")
     V48Assert(app.Selected=1 && app.Actor="@B#2" && !app.Active && app.View="Imported" && !app.Follow,"selection/collection unchanged")
 }
 V614TestPersistence()
 {
     V572Isolated(V614PersistenceCase)
 }
 V614PersistenceCase()
 {
     global IPM,SETTINGS_FILE
     IniWrite("keep",SETTINGS_FILE,"Unrelated","Sentinel")
     for mode in [3,1,2] {
         IPM.Source := mode,IPM.ParserWarnRestart := false,IPM.Panel.X := -440,IPM.Panel.Y := 180
         IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings()
         V48Assert(IPM.Source=mode && IniRead(SETTINGS_FILE,"IrisParseDisplay","SourceMode")=mode,"all three source preferences persist")
         V48Assert(!IPM.Wanted && !IPM.TimerOn && !IPM.Editing,"preference load keeps displays dormant")
         V48Assert(!IPM.ParserWarnRestart,"preference load preserves restart-warning choice")
         V48Assert(IPM.Panel.X=-440 && IPM.Panel.Y=180,"complete signed coordinate pair survives preference load")
     }
     V48Assert(IniRead(SETTINGS_FILE,"Unrelated","Sentinel")="keep","unrelated INI entries preserved")
 }
 V614TestLegacyMigration()
 {
     V572Isolated(V614LegacyCase)
 }
 V614LegacyCase()
 {
     global IPM,SETTINGS_FILE
     IniWrite(1,SETTINGS_FILE,"IrisParseDisplay","LayoutSaved")
     IniWrite(385,SETTINGS_FILE,"IrisParseDisplay","CombinedWidth")
     IPMLoadSettings()
     V48Assert(IPM.Source=3 && IPM.Panel.Width=385,"missing new preference defaults automatic without resetting old geometry")
     for value in ["",0,4,"garbled"] {
         IniWrite(value,SETTINGS_FILE,"IrisParseDisplay","SourceMode")
         IPMLoadSettings()
         V48Assert(IPM.Source=3,"invalid persisted mode has explicit automatic fallback")
     }
 }
 V614TestSettingsApply()
 {
     V572Isolated(V614SettingsCase)
 }
 V614SettingsCase()
 {
     global IPM,IP,SETTINGS_FILE
     IP := V614App(),g := V593SettingsControls()
     try {
         IPM.SourceControl.Delete(),IPM.SourceControl.Add(IPMSourceChoices()),IPM.SourceControl.Choose(3)
         V48Assert(IPMApplySettings() && IPM.Source=3,"actual Apply path accepts automatic rather than coercing to live")
         V48Assert(IniRead(SETTINGS_FILE,"IrisParseDisplay","SourceMode")="3","actual Apply saves policy")
         V48Assert(IPMResolve(IP,IPM.Source).Data=IP.Offline,"applied mode displays imported source")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int") && !IP.Active,"hidden diagnostic did not show window or start collection")
     }
     finally IPM.ConfigGui := "",IPMDisposeGui(g)
 }
 V614TestSettingsRoster()
 {
     V572Isolated(V614RosterCase)
 }
 V614RosterCase()
 {
     global IP,IPM
     IP := V614App(),g := Gui(),IPM.ConfigGui := g
     try {
         IPM.SourceControl := g.AddDropDownList(,IPMSourceChoices()),IPM.SourceControl.Choose(3)
         IPM.PlayerControl := g.AddDropDownList(,["Automatic"])
         IPM.PersonalKey := "@B#2",IPMRefreshPlayerChoices()
         V48Assert(IPM.PlayerKeys.Length=4 && IPM.PersonalKey="@B#2","automatic roster drawn from selected saved fight")
         IP.Selected := 2,IPMRefreshPlayerChoices()
         V48Assert(IPM.PlayerKeys[-1]="@B#2","missing manual identity retained rather than silently swapped")
     }
     finally IPM.ConfigGui := "",IPMDisposeGui(g)
 }
 V614TestRaidToolSync()
 {
     V572Isolated(V614RaidToolCase)
 }
 V614RaidToolCase()
 {
     global IPM,IP,IR,SETTINGS_FILE
     IP := V614App(),g := Gui(),cfg := Gui(),IPM.ConfigGui := cfg
     try {
         ctrl := g.AddDropDownList(,IPMSourceChoices()),ctrl.Choose(3)
         IPM.Source := 1,IPM.SourceControl := cfg.AddDropDownList(,IPMSourceChoices()),IPM.SourceControl.Choose(1)
         IPM.PlayerControl := cfg.AddDropDownList(,["Automatic"])
         IPM.PersonalKey := "@B#2",IRSourceChanged(ctrl)
         V48Assert(IPM.Source=3 && IPM.SourceControl.Value=3 && IPM.PersonalKey="","raid tool updates shared source and automatic identity")
         V48Assert(IniRead(SETTINGS_FILE,"IrisParseDisplay","SourceMode")="3" && !IP.Active,"source choice saves without starting anything")
         IPM.Busy := true,ctrl.Choose(2),IRSourceChanged(ctrl)
         V48Assert(IPM.Source=3 && ctrl.Value=3,"busy display rejects change and restores shown choice")
         IPM.Busy := false
     }
     finally IPM.Busy := false,IPM.ConfigGui := "",IPMDisposeGui(cfg),IPMDisposeGui(g)
 }
 V614TestRealStartStop()
 {
     V572Isolated(V614StartCase)
 }
 V614StartCase()
 {
     global IP,IPM,IrisBench,soundboardsEnabled
     IP := V614App(),old := IP.Live,off := IP.Offline,IPM.Source := 3,IPM.AutoShowOnParse := false
     V48Assert(IPMResolve(IP,3).Data=off,"starts in saved review")
     V48Assert(IPStartCommit(old) && IP.Active,"explicit live commit succeeds through unchanged start logic")
     V48Assert(IPM.Source=3 && IPMResolve(IP,3).Data=IP.Live && IP.Offline=off && IP.View="Live","new live session switches display without overwriting saved results or preference")
     V51Feed(IP.Live,1000,"Enter",0,"@A#1","="),V51Feed(IP.Live,2000,"Damage",345,"@A#1")
     data := IP.Live,IPStop()
     V48Assert(!IP.Active && IPMResolve(IP,3).Data=data && IPMResolve(IP,3).Segment.Totals["@A#1"].Damage=345,"Stop retains latest live values")
     V48Assert(!IPM.Wanted && !IPM.TimerOn && IrisBench.Active && !soundboardsEnabled,"source routing does not show overlays or change bench/audio")
 }
 V614TestBlockedStart()
 {
     V572Isolated(V614BlockedStartCase)
 }
 V614BlockedStartCase()
 {
     global IP,IPM
     IP := V614App(),old := IP.Live,off := IP.Offline,IP.ImportFile := {}
     V48Assert(!IPStartCommit(old) && !IP.Active && IP.Live=old && IP.View="Imported","import in progress prevents live start")
     V48Assert(IPM.Source=3 && IPMResolve(IP,3).Data=off,"failed start does not switch away from saved data")
     IP.ImportFile := ""
     V48Assert(!IPStartCommit(IPNewData()) && IPMResolve(IP,3).Data=off,"stale commit token cannot switch data")
 }
 V614TestBlockedImport()
 {
     V572Isolated(V614BlockedImportCase)
 }
 V614BlockedImportCase()
 {
     global IP
     IP := V614App(),IP.Active := true,IP.Busy := true,live := IP.Live,off := IP.Offline
     IPBeginImport(A_Temp "\IrisV614_NOT_OPENED.txt")
     V48Assert(IP.Active && IP.Live=live && IP.Offline=off && !IsObject(IP.ImportFile),"busy live parser cannot be replaced from a reentrant callback")
     IP.Active := false,IP.Busy := false,IP.ImportFile := {},file := IP.ImportFile
     IPBeginImport(A_Temp "\IrisV614_NOT_OPENED.txt")
     V48Assert(IP.ImportFile=file && IP.Offline=off,"existing import remains protected")
     IP.ImportFile := ""
 }
 V614TestPreviewIsolation()
 {
     V572Isolated(V614PreviewCase)
 }
 V614PreviewCase()
 {
     global IP,IPM
     IP := V614App(),off := IP.Offline,IPM.Source := 3
     V48Assert(IPMPreviewSet(8),"layout preview starts explicitly")
     V48Assert(IPM.PreviewSnapshot.LayoutPreview && IPMBadge(IPM.PreviewSnapshot)="PREVIEW","sample source label retained")
     V48Assert(IPM.Source=3 && IP.Offline=off && !IP.Active,"preview does not replace automatic source or real data")
     IPMEndRaidPreview()
     V48Assert(IPMResolve(IP,3).Data=off && IPM.Source=3,"end preview returns to selected saved fight")
 }
 V614TestPersonalNativeRender()
 {
     V572Isolated(V614PersonalRenderCase)
 }
 V614PersonalRenderCase()
 {
     global IP,IPM,localPlayerToken
     old := localPlayerToken
     try {
         IP := V614App(),IPM.Source := 3,localPlayerToken := "@A#1",IPMEnsureGui("Personal")
         IPMRender("Personal",IPMSnapshot(IPMResolve(IP,3)))
         V48Assert(IPM.Panel.Meta.Text="B" && IPM.Panel.HeaderStatus="Saved" && IPM.Panel.Heading.Text="Personal","rendered personal saved name matches selection")
         IP.Active := true,IPMRender("Personal",IPMSnapshot(IPMResolve(IP,3)))
         V48Assert(IPM.Panel.Meta.Text="A" && IPM.Panel.HeaderStatus="" && IPM.Panel.Heading.Text="Personal","live identity and internal source state switch without a redundant caption")
     }
     finally localPlayerToken := old
 }
 V614TestManualPreferenceStable()
 {
     app := V614App()
     for mode in [1,2] {
         for active in [false,true,false] {
             app.Active := active
             V48Assert(IPMEffectiveSource(app,mode)=mode,"manual mode never autochanges")
         }
     }
 }
 V614TestAutoMatrix()
 {
     app := V614App()
     for view in ["Live","Imported"] {
         for active in [false,true] {
             for pending in [false,true] {
                 app.View := view,app.Active := active,app.Queue := pending ? ["pending"] : [],app.Head := 1
                 for mode in [1,2,3] {
                     expected := mode=3 ? (active || pending ? 1 : 2) : mode
                     V48Assert(IPMEffectiveSource(app,mode)=expected,"source truth table")
                     V48Assert(IPMSourceUsesLive(app,mode)=(expected=1 || view="Live"),"personal identity and aggregate source agree")
                 }
             }
         }
     }
 }
 ; v64.3 regressions: synthetic data only, no network/audio/game input.
 V615Player(i,hp := 1000)
 {
     return "@Recovery Player " i "#" (61500+i) "|(0,0,0,0)|(" hp "/1000)"
 }
 V615NPC(which := "rail",hp := 8000,instance := 6151)
 {
     id := which="opd" ? "4126527268585472" : (which="rail2" ? "4126522973618176" : "4126518678650880")
     return "Synthetic phase {" id "}:" instance "|(0,0,0,0)|(" hp "/10000)"
 }
 V615Feed(s,at,kind,amount := 0,src := "",dst := "",ability := "900000006150001")
 {
     IPFeedLine(s,IPDemoLine(at,src,dst,kind,amount,false,-1,"Synthetic test",ability))
 }
 V615Fixture()
 {
     s := IPNewData("Synthetic recovery test")
     IPFeedLine(s,"[00:00:00.100] [" V615Player(1) "] [] [] [AreaEntered {836045448953664}: Example {833571547775765} 8 Player Master {836045448953655}]")
     V615Feed(s,1000,"Enter",0,V615Player(1),"=")
     Loop 8
         V615Feed(s,1000+A_Index,"Damage",100,V615Player(A_Index),V615NPC("opd"))
     V615Feed(s,1100,"Damage",100,V615Player(1),V615NPC())
     return s
 }
 V615Deaths(s,number := 8,positiveHP := false)
 {
     Loop number
         V615Feed(s,2000+A_Index,"Death",0,"Synthetic catalyst {4126553038389248}:6159|(0,0,0,0)|(0/10000)",V615Player(A_Index,positiveHP ? 25 : 0))
 }
 V615ResetLine(at := 2100,which := "rail",hp := 10000,instance := 6151)
 {
     return "[" IPStamp(at) "] [" V615Player(1,25) "] [" V615NPC(which,hp,instance) "] [Example {900000006150001}] [RemoveEffect {836045448945478}: Example {900000006150001}]"
 }
 V615Snapshot(s)
 {
     return IPMSnapshot({Data:s,Segment:s.Segments[s.Segments.Length],State:"LIVE LOG",Pending:0})
 }
 V615TestPhaseScope()
 {
     s := V615Fixture(),seg := s.Current
     V48Assert(seg.BossKey="G-SC" && seg.Required.Length=1 && seg.Required[1]="boss","phase actors identify Scyva without becoming final bosses")
     actor := IPActor(V615NPC("opd"))
     V48Assert(IsObject(IPScyvaPhaseRule(actor,s)),"supported 8M phase ID")
     for mode in ["","836045448953654","836045448953656"] {
         s.ModeId := mode
         V48Assert(!IsObject(IPScyvaPhaseRule(actor,s)),"wrong/unknown difficulty not promoted")
     }
     s.ModeId := "836045448953655",s.AreaId := "different"
     V48Assert(!IsObject(IPScyvaPhaseRule(actor,s)),"different area not promoted")
     V48Assert(!IsObject(IPScyvaPhaseRule(actor,"")),"missing context safe")
 }
 V615TestPhaseDeathNotVictory()
 {
     s := V615Fixture()
     V615Feed(s,1800,"Death",0,V615Player(1),V615NPC("opd",0))
     V48Assert(!s.Current.Terminal && s.Current.FinishAt<0,"defeated OPD is not defeated Scyva")
 }
 V615TestEightDeathsReset()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s),IPFeedLine(s,V615ResetLine())
     V48Assert(!IsObject(s.Current) && seg.End=2008 && seg.WipeEnded,"all deaths plus phase reset close without ExitCombat")
     V48Assert(!seg.Terminal && InStr(seg.EndReason,"wipe"),"wipe is not a successful boss defeat")
     V48Assert(s.InCombat=0,"encounter combat state ends")
 }
 V615TestStalePositiveHP()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s,8,true),IPFeedLine(s,V615ResetLine())
     V48Assert(!IsObject(s.Current) && seg.End=2008,"explicit Death wins over stale positive HP snapshots")
 }
 V615TestFinalTickRetained()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s)
     V615Feed(s,2050,"Damage",17,V615Player(2,0),V615NPC())
     IPFeedLine(s,V615ResetLine())
     V48Assert(seg.End=2050 && seg.Totals[IPActor(V615Player(2)).Key].Damage=117,"recorded final tick before reset remains in total and duration")
 }
 V615TestDeathsAndActivityRetained()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s),IPFeedLine(s,V615ResetLine())
     p := IPRCompact(seg)
     V48Assert(p.TotalDeaths=8 && p.Deaths.Length=8 && p.Players.Count=8,"all eight deaths survive speculative-tail reconciliation")
     V48Assert(p.TimingComplete && p.End=2008,"death timing and compact pull endpoint agree")
 }
 V615TestRunbackExcluded()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s),IPFeedLine(s,V615ResetLine())
     V615Feed(s,6000,"Heal",700,V615Player(2),V615Player(1))
     V615Feed(s,7000,"Activate",0,V615Player(1),"=")
     V48Assert(seg.End=2008 && seg.Totals[IPActor(V615Player(2)).Key].Heal=0,"runback healing and actions cannot extend ended wipe")
     V48Assert(!IsObject(s.Current),"runback does not silently open combat")
 }
 V615TestNextPullSeparate()
 {
     s := V615Fixture(),old := s.Current
     V615Deaths(s),IPFeedLine(s,V615ResetLine())
     V615Feed(s,6000,"Enter",0,V615Player(1),"=")
     V615Feed(s,6010,"Damage",70,V615Player(1),V615NPC("opd",8000,6152))
     V48Assert(s.Segments.Length=2 && s.Current!=old && s.Current.Start=6000,"next true combat creates a new pull")
     V48Assert(s.Current.Totals[IPActor(V615Player(1)).Key].Damage=70,"previous attempt does not leak into new totals")
 }
 V615TestSevenDeathsContinue()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s,7),IPFeedLine(s,V615ResetLine())
     V48Assert(s.Current=seg && seg.End<0,"a remaining living player prevents wipe confirmation")
 }
 V615TestLocalDeathAloneContinues()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s,1),IPFeedLine(s,V615ResetLine())
     V615Feed(s,2500,"Damage",50,V615Player(8),V615NPC("opd"))
     V48Assert(s.Current=seg && seg.End<0,"recorder death alone does not stop teammate parsing")
 }
 V615TestMissingRoster()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s)
     key := IPActor(V615Player(8)).Key,seg.Actors.Delete(key)
     IPFeedLine(s,V615ResetLine())
     V48Assert(s.Current=seg,"seven observed identities are not assumed to be a full eight-person raid")
 }
 V615TestExtraParticipant()
 {
     s := V615Fixture(),seg := s.Current
     V615Feed(s,1200,"Damage",12,V615Player(9),V615NPC())
     V615Deaths(s),IPFeedLine(s,V615ResetLine())
     V48Assert(s.Current=seg,"ambiguous enlarged roster cannot be treated as eight dead")
 }
 V615TestRevivalPreventsClose()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s)
     IPFeedLine(s,"[00:00:02.050] [" V615Player(8) "] [=] [] [Event {836045448945472}: Revived {836045448945494}]")
     IPFeedLine(s,V615ResetLine())
     V48Assert(s.Current=seg,"actual resurrection invalidates all-dead evidence")
 }
 V615TestNoResetNoClose()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s),IPFeedLine(s,V615ResetLine(2100,"rail",8000))
     V48Assert(s.Current=seg,"all recorded deaths alone do not invoke an unproven timeout")
 }
 V615TestUnengagedResetIgnored()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s),IPFeedLine(s,V615ResetLine(2100,"rail",10000,9999))
     V48Assert(s.Current=seg,"unrelated/full-health instance is not reset evidence")
 }
 V615TestUninjuredResetIgnored()
 {
     s := V615Fixture(),seg := s.Current
     key := IPActor(V615NPC()).Key,seg.EnemyVitals[key].Current := 10000,seg.EnemyVitals[key].Injured := false
     V615Deaths(s),IPFeedLine(s,V615ResetLine())
     V48Assert(s.Current=seg,"already full health is not a reset transition")
 }
 V615TestChangedMaxIgnored()
 {
     s := V615Fixture(),seg := s.Current
     key := IPActor(V615NPC()).Key,seg.EnemyVitals[key].Max := 12000
     V615Deaths(s),IPFeedLine(s,V615ResetLine())
     V48Assert(s.Current=seg,"different maximum cannot masquerade as a same-health reset")
 }
 V615TestWrongAreaWipeIgnored()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s),s.AreaId := "other",IPFeedLine(s,V615ResetLine())
     V48Assert(s.Current=seg,"wipe rule is area scoped")
 }
 V615TestWrongModeWipeIgnored()
 {
     s := V615Fixture(),seg := s.Current
     V615Deaths(s),s.ModeId := "other",IPFeedLine(s,V615ResetLine())
     V48Assert(s.Current=seg,"wipe rule is difficulty and raid-size scoped")
 }
 V615TestResetBeforeDeathsIgnored()
 {
     s := V615Fixture(),seg := s.Current
     IPFeedLine(s,V615ResetLine(1900)),V615Deaths(s)
     V48Assert(s.Current=seg,"a reset-like observation before deaths is not later wipe evidence")
 }
 V615TestClosedLabel()
 {
     app := IPNewApp(),app.Live := V615Fixture(),app.Active := true
     V615Deaths(app.Live),IPFeedLine(app.Live,V615ResetLine())
     r := IPMResolve(app,1),snap := IPMSnapshot(r)
     V48Assert(r.State="WIPED" && snap.Closed && IPMBadge(snap)="Wipe","closed result is not still labelled as an active encounter")
     V48Assert(app.Active,"overall collection remains enabled for the next pull")
 }
 V615TestNoAreaEntryPersonalRecovery()
 {
     s := IPNewData()
     V615Feed(s,1000,"Enter",0,V615Player(1),"="),V615Feed(s,1100,"Damage",55,V615Player(1),V615NPC())
     snap := V615Snapshot(s),who := IPMPersonalActor(snap,"","","",true)
     V48Assert(IsObject(who) && who.Key=IPActor(V615Player(1)).Key && who.Damage=55,"recorder Enter works without Area metadata/callout identity")
 }
 V615TestLateOwnerLearning()
 {
     s := IPNewData()
     V615Feed(s,1000,"Damage",70,V615Player(1),V615NPC())
     V48Assert(s.Current.RecorderKey="","damage alone does not guess the recorder")
     V615Feed(s,1100,"Enter",0,V615Player(1),"=")
     V48Assert(s.Current.RecorderKey=IPActor(V615Player(1)).Key,"late owner evidence is attached to the existing segment")
 }
 V615TestPersonalMissingCalloutToken()
 {
     s := V615Fixture(),snap := V615Snapshot(s)
     who := IPMPersonalActor(snap,"","","",true)
     V48Assert(IsObject(who) && who.Key=s.Owner,"empty legacy callout identity does not blank Personal")
 }
 V615TestPersonalStaleCalloutToken()
 {
     s := V615Fixture(),snap := V615Snapshot(s)
     who := IPMPersonalActor(snap,"",IPActor(V615Player(2)).Key,"",true)
     V48Assert(who.Key=s.Owner,"source-owned identity beats an unrelated stale callout token")
 }
 V615TestExplicitPinPreserved()
 {
     snap := V615Snapshot(V615Fixture()),key := IPActor(V615Player(2)).Key
     V48Assert(IPMPersonalActor(snap,key,"","",true).Key=key,"intentional Personal player pin remains authoritative")
     V48Assert(!IsObject(IPMPersonalActor(snap,"@Absent#61599","","",true)),"absent explicit pin is not replaced with another person")
 }
 V615TestSavedSelectionPreserved()
 {
     snap := V615Snapshot(V615Fixture()),key := IPActor(V615Player(2)).Key
     V48Assert(IPMPersonalActor(snap,"","",key,false).Key=key,"saved review uses the selected player rather than the recorder")
 }
 V615TestHistoricalIdentityPreserved()
 {
     s := V615Fixture(),old := s.Current,owner := s.Owner
     IPCloseSegment(s,"test end"),IPBSourceBoundary(s,"synthetic-next-file|2")
     V615Feed(s,4000,"Enter",0,V615Player(2),"="),V615Feed(s,4010,"Damage",5,V615Player(2),V615NPC())
     snap := IPMSnapshot({Data:s,Segment:old,State:"LIVE HISTORY",Pending:0})
     V48Assert(snap.RecorderKey=owner && IPMPersonalActor(snap,"",s.Owner,"",true).Key=owner,"a newer source's recorder does not relabel a historical segment")
 }
 V615TestPersonalUnknownStillUnknown()
 {
     snap := V615Snapshot(V615Fixture()),snap.RecorderKey := ""
     V48Assert(!IsObject(IPMPersonalActor(snap,"","","",true)),"no owner and no local token never picks the highest DPS")
     key := IPActor(V615Player(2)).Key
     V48Assert(IPMPersonalActor(snap,"",key,"",true).Key=key,"valid old local identity remains a fallback")
 }
 V615TestSnapshotIsReadOnly()
 {
     s := V615Fixture(),owner := s.Owner,seg := s.Current,snap := V615Snapshot(s)
     snap.RecorderKey := "@Other#123"
     V48Assert(s.Owner=owner && seg.RecorderKey=owner,"editing the display copy cannot change encounter or recorder state")
 }
 V615AreaLine(player := 1,at := 100)
 {
     return "[" IPStamp(at) "] [" V615Player(player) "] [] [] [AreaEntered {836045448953664}: Synthetic area {833571547775765} 8 Player Master {836045448953655}]"
 }
 V615TestReaderInert()
 {
     c := IPReaderNew()
     V48Assert(c.Key="" && c.Owner="" && c.AreaId="" && c.ModeId="","new metadata cache contains no identity or encounter guess")
 }
 V615TestReaderAreaCapture()
 {
     c := IPReaderNext(IPReaderNew(),V615AreaLine(),"fixture|identity")
     V48Assert(c.Owner=IPActor(V615Player(1)).Key && c.AreaId="833571547775765" && c.ModeId="836045448953655","recorder and scope from exact area record")
 }
 V615TestReaderEntryWithoutArea()
 {
     line := IPDemoLine(1000,V615Player(1),"=","Enter",0)
     c := IPReaderNext(IPReaderNew(),line,"fixture|identity")
     V48Assert(c.Owner=IPActor(V615Player(1)).Key && c.AreaId="" && c.ModeId="","entry identifies recorder without inventing absent area or mode")
 }
 V615TestReaderNoPeerGuess()
 {
     line := IPDemoLine(1000,V615Player(2),V615NPC(),"Damage",99)
     c := IPReaderNext(IPReaderNew(),line,"fixture|identity")
     V48Assert(c.Owner="","first/strongest actor is not recorder evidence")
     line := "[00:00:01.000] [" V615Player(2) "] [] [] [DisciplineChanged {836045448953665}: Class {1}/Discipline {2}]"
     c := IPReaderNext(c,line,"fixture|identity")
     V48Assert(c.Owner="","raid discipline rows do not steal ownership")
 }
 V615TestReaderCopyOnChange()
 {
     old := IPReaderNext(IPReaderNew(),V615AreaLine(),"fixture|identity")
     next := IPReaderNext(old,V615AreaLine(2,200),"fixture|identity")
     V48Assert(old.Owner=IPActor(V615Player(1)).Key && next.Owner=IPActor(V615Player(2)).Key,"queued snapshot cannot be rewritten by a later area's owner")
     V48Assert(next!=old,"metadata changes replace immutable snapshot")
 }
 V615TestReaderSourceChange()
 {
     old := IPReaderNext(IPReaderNew(),V615AreaLine(),"old|one")
     next := IPReaderNext(old,IPDemoLine(1000,V615Player(2),"=","Enter",0),"new|two")
     V48Assert(next.Owner=IPActor(V615Player(2)).Key && next.AreaId="" && next.ModeId="","new source cannot inherit old raid scope")
     V48Assert(old.Owner=IPActor(V615Player(1)).Key && old.AreaId!="","old snapshot remains valid for queued old records")
 }
 V615TestReaderSeedGuards()
 {
     c := IPReaderNext(IPReaderNew(),V615AreaLine(),"fixture|identity"),s := IPNewData()
     s.SourceKey := "other|identity"
     V48Assert(!IPSeedReaderContext(s,c,s.SourceKey) && s.Owner="","wrong source cache refused")
     s.SourceKey := c.Key
     V48Assert(IPSeedReaderContext(s,c,c.Key) && s.Owner=c.Owner,"exact attachment metadata seeds an empty parser")
     V48Assert(s.Segments.Length=0 && s.Lines=0 && s.Parsed=0 && s.InCombat=-1,"seeding adds no events or assumed current combat state")
     V48Assert(!IPSeedReaderContext(s,c,c.Key),"already established owner not overwritten")
     empty := IPNewData(),empty.SourceKey := "|"
     V48Assert(!IPSeedReaderContext(empty,IPReaderNew("|"),"|"),"missing attachment identity is not trusted")
 }
 V615TestQueuedSourceSeed()
 {
     s := IPNewData(),s.SourceKey := "old|one"
     V615Feed(s,1000,"Enter",0,V615Player(1),"=")
     V615Feed(s,1100,"Damage",40,V615Player(1),V615NPC())
     before := s.Current
     c := IPReaderNext(IPReaderNew(),V615AreaLine(2),"new|two")
     IPFeedLine(s,IPDemoLine(2000,V615Player(2),"=","Enter",0),c.Key,c)
     V48Assert(before.End=1100 && s.Current!=before && s.Current.RecorderKey=c.Owner,"file boundary closes prior fight then seeds new recorder")
     V48Assert(s.AreaId=c.AreaId && s.ModeId=c.ModeId,"source scope is available before phase detection")
 }
 V615TestSeededLiveWipe()
 {
     c := IPReaderNext(IPReaderNew(),V615AreaLine(),"fixture|identity"),s := IPNewData()
     s.SourceKey := c.Key,IPSeedReaderContext(s,c,c.Key)
     ; No AreaEntered is fed into the live session itself: this is a manual
     ; Parse start after the silent reader already consumed the file header.
     V615Feed(s,1000,"Enter",0,V615Player(1),"=")
     Loop 8
         V615Feed(s,1000+A_Index,"Damage",100,V615Player(A_Index),V615NPC("opd"))
     V615Feed(s,1100,"Damage",100,V615Player(1),V615NPC())
     seg := s.Current,V615Deaths(s),IPFeedLine(s,V615ResetLine())
     V48Assert(seg.BossKey="G-SC" && seg.WipeEnded && seg.End=2008,"live header seeding enables the scoped wipe path, not only full-file import")
 }
 V615TestInactiveMetadataCapture()
 {
     global IP,currentLogPath,currentLogIdentity
     old := IP,oldPath := currentLogPath,oldIdentity := currentLogIdentity
     try {
         IP := IPNewApp(),IP.Live := IPNewData(),currentLogPath := "C:\SyntheticRecovery.txt",currentLogIdentity := "fixture"
         IPEnqueue(V615AreaLine())
         V48Assert(!IP.Active && IP.Queue.Length=0 && IP.Live.Lines=0 && IP.Live.Owner="","inactive reader captures no parser statistics")
         V48Assert(IP.ReaderContext.Owner=IPActor(V615Player(1)).Key,"minimal metadata remains available before user starts Parse")
         IP.Active := true
         IPEnqueue(IPDemoLine(1000,V615Player(1),"=","Enter",0))
         prior := IP.Queue[1].Context
         IPEnqueue(V615AreaLine(2,2000))
         V48Assert(prior.Owner=IPActor(V615Player(1)).Key && IP.Queue[2].Context.Owner=IPActor(V615Player(2)).Key,"queued source records retain their own context snapshot")
     }
     finally IP := old,currentLogPath := oldPath,currentLogIdentity := oldIdentity
 }
 V615TestStartUsesReaderContext()
 {
     V571Isolated(V615StartContextCase)
 }
 V615StartContextCase()
 {
     global IP,currentLogPath,currentLogIdentity
     oldPath := currentLogPath,oldIdentity := currentLogIdentity
     try {
         currentLogPath := "C:\SyntheticRecovery.txt",currentLogIdentity := "fixture"
         IP.ReaderContext := IPReaderNext(IPReaderNew(),V615AreaLine(),currentLogPath "|" currentLogIdentity)
         before := IP.Live
         V48Assert(IPStartCommit(before),"explicit valid live start succeeds")
         V48Assert(IP.Active && IP.Live.Owner=IPActor(V615Player(1)).Key && IP.Live.AreaId="833571547775765","started live parser receives recorder and area independently of callouts")
         V48Assert(IP.Live.Lines=0 && IP.Live.Segments.Length=0,"start does not reimport earlier damage")
     }
     finally currentLogPath := oldPath,currentLogIdentity := oldIdentity
 }
 ; v64.3 isolated tests: native tabs are deliberately NOT painted by IUS.
 ; Synthetic hidden windows and private bitmap DCs only. Never sends game input.
 V621With(action)
 {
     global IUB
     old := IUB,IUB := IUBNewState(),g := Gui()
     try {
         g.SetFont("s9","Segoe UI"),g.BackColor := IUBPalette().Background
         t := g.AddTab2("x8 y8 w430 h260 -Wrap +0x04000000",["Raid","Damage","Healing","Combat Log","Analysis"])
         t.UseTab(),t.Choose(2)
         lv := g.AddListView("x18 y60 w310 h150",["Player","Value"])
         lv.Add(,"Synthetic row",123),lv.Modify(1,"Select")
         b := g.AddButton("x8 y280 w144 h30","&Apply")
         hidden := g.AddButton("x165 y280 w100 h30 Hidden","Hidden")
         g.Show("Hide w450 h330")
         f := {Gui:g,Tab:t,List:lv,Button:b,Hidden:hidden}
         IUSApplyWindow(g,"analysis")
         action.Call(f)
     }
     finally {
         if IPMUiHandle(g)
             g.Destroy()
         IUSPrune(),IUB := old
     }
 }
 
 V621Entry(c)
 {
     s := IUSState(),h := IPMUiHandle(c)
     V48Assert(h && s.Controls.Has(h),"button-only drawing registered")
     return s.Controls[h]
 }
 
 V621Surface(w,h,action)
 {
     desktop := DllCall("User32\GetDC","Ptr",0,"Ptr"),dc := 0,bmp := 0,old := 0
     try {
         dc := DllCall("Gdi32\CreateCompatibleDC","Ptr",desktop,"Ptr")
         bmp := DllCall("Gdi32\CreateCompatibleBitmap","Ptr",desktop,"Int",w,"Int",h,"Ptr")
         V48Assert(dc && bmp,"private bitmap available")
         old := DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",bmp,"Ptr")
         IUSFill(dc,0,0,w,h,"FF00FF")
         action.Call(dc)
     }
     finally {
         if old
             DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",old)
         if bmp
             DllCall("Gdi32\DeleteObject","Ptr",bmp)
         if dc
             DllCall("Gdi32\DeleteDC","Ptr",dc)
         if desktop
             DllCall("User32\ReleaseDC","Ptr",0,"Ptr",desktop)
     }
 }
 
 V621Notification(hwnd,dc := 0,stage := 1,state := 0)
 {
     off := IUSDrawOffsets(),b := Buffer(off.Size,0)
     NumPut("Ptr",hwnd,b,0),NumPut("Int",-12,b,A_PtrSize*2)
     NumPut("UInt",stage,b,off.Stage),NumPut("Ptr",dc,b,off.DC)
     NumPut("UInt",state,b,off.State)
     return b
 }
 
 V621TestDefaults()
 {
     b := IUBNewState()
     V48Assert(b.Rounded && b.Theme="iris" && !b.Ready && b.Windows.Count=0,"inert defaults; no windows or scans")
     V48Assert(!IsObject(b.RoundChoice) && b.IconPath="","no automatic icon change")
 }
 
 V621TestButtonsOnly()
 {
     for role in ["main","analysis"] {
         V48Assert(IUSEligible("Button",role),"push buttons eligible")
         for type in ["Tab","Tab2","Tab3","ListView","Picture","DropDownList","CheckBox","Text","TreeView"]
             V48Assert(!IUSEligible(type,role),"tabs and data controls excluded")
     }
     for role in ["dialog","overlay","preview",""]
         V48Assert(!IUSEligible("Button",role),"unrelated windows not modified")
 }
 
 V621TestNativePalette()
 {
     V601Isolated(V621PaletteCase)
 }
 V621PaletteCase()
 {
     global IUB
     for key in ["classic","iris"] {
         IUB.Theme := key,IUB.Rounded := true,a := IUBPalette()
         IUB.Rounded := false,b := IUBPalette()
         V48Assert(a.Background=b.Background && a.Field=b.Field && a.Header=b.Header,"rounding does not recolor tabs/pages")
     }
     V48Assert(IUBPalette("iris").Background="EEE8F6" && IUBPalette("iris").Field="FCFAFF","v61.5 palette restored exactly")
 }
 
 V621TestNativeStructureOffsets()
 {
     x86 := IUSDrawOffsets(4),x64 := IUSDrawOffsets(8)
     V48Assert(x86.Stage=12 && x86.DC=16 && x86.Rect=20 && x86.State=40 && x86.Size=48,"Win32 structure alignment")
     V48Assert(x64.Stage=24 && x64.DC=32 && x64.Rect=40 && x64.State=64 && x64.Size=80,"Win64 structure alignment")
 }
 
 V621TestPaintStagePolicy()
 {
     V48Assert(IUSCanDraw(1,true,false,false,false),"only normal prepaint handled")
     for stage in [0,2,3,4,0x10001,0x10002]
         V48Assert(!IUSCanDraw(stage,true,false,false,false),"other stages delegated")
     V48Assert(!IUSCanDraw(1,false,false,false,false) && !IUSCanDraw(1,true,true,false,false),"disabled setting and high contrast native")
     V48Assert(!IUSCanDraw(1,true,false,true,false) && !IUSCanDraw(1,true,false,false,true),"recursive/failed draw falls back")
 }
 
 V621TestFaceStates()
 {
     for key in ["classic","iris"] {
         p := IUBPalette(key)
         for primary in [false,true]
             for pressed in [false,true]
                 for hover in [false,true]
                     for enabled in [false,true] {
                         c := IUSControlColors(p,primary,pressed,hover,enabled)
                         for name in ["Top","Bottom","Border","Text"]
                             V48Assert(RegExMatch(c.%name%,"i)^[0-9a-f]{6}$"),"valid colors for every button state")
                         V48Assert(c.Text!=c.Bottom,"button text differs from face")
                     }
     }
 }
 
 V621TestRadiusBounds()
 {
     for scale in [1,1.25,1.5,2,3]
         for size in [[1,1],[40,20],[144,30],[250,54]]
             V48Assert(IUSRadius(size[1],size[2],scale)>=1 && IUSRadius(size[1],size[2],scale)<=Max(1,Floor(Min(size[1],size[2])/3)),"compact bounded corner radius")
 }
 
 V621TestHiddenSetup()
 {
     V621With(V621HiddenCase)
 }
 V621HiddenCase(f)
 {
     V621Entry(f.Button)
     V48Assert(!IUSState().Controls.Has(f.Tab.Hwnd) && !IUSState().Controls.Has(f.List.Hwnd),"tab/table not registered")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",f.Gui.Hwnd,"Int") && !V58ChildVisible(f.Hidden),"hidden parent and button stay hidden")
     V48Assert(f.Tab.Value=2,"tab selection unchanged")
 }
 
 V621TestRepeatedAttachment()
 {
     V621With(V621RepeatedCase)
 }
 V621RepeatedCase(f)
 {
     entry := V621Entry(f.Button),n := IUSState().Controls.Count
     Loop 10
         IUSApplyWindow(f.Gui,"analysis")
     V48Assert(V621Entry(f.Button)=entry && IUSState().Controls.Count=n,"no duplicate callback registrations")
     V48Assert(!IUSState().Controls.Has(f.Tab.Hwnd),"tabs never gain drawing registrations")
 }
 
 V621TestDetachReapply()
 {
     V621With(V621DetachCase)
 }
 V621DetachCase(f)
 {
     global IUB
     IUB.Rounded := false,IUSApplyWindow(f.Gui,"analysis")
     V48Assert(!IUSState().Controls.Has(f.Button.Hwnd),"rounding off detaches only its notification")
     V48Assert(f.Tab.Value=2 && f.List.GetText(1,2)="123" && f.Button.Text="&Apply","identity and values preserved")
     IUB.Rounded := true,IUSApplyWindow(f.Gui,"analysis"),V621Entry(f.Button)
 }
 
 V621TestDestroyCleanup()
 {
     V621With(V621DestroyCase)
 }
 V621DestroyCase(f)
 {
     hwnd := f.Button.Hwnd,f.Gui.Destroy(),IUSPrune()
     V48Assert(!IUSState().Controls.Has(hwnd) && !IUSDetach(hwnd),"stale controls retired; repeat cleanup safe")
 }
 
 V621TestNativeTabStyles()
 {
     V621With(V621NativeStyleCase)
 }
 V621NativeStyleCase(f)
 {
     hwnd := f.Tab.Hwnd,procFn := A_PtrSize=8 ? "GetWindowLongPtrW" : "GetWindowLongW"
     proc := DllCall("User32\" procFn,"Ptr",hwnd,"Int",-4,"Ptr")
     style := DllCall("User32\GetWindowLongW","Ptr",hwnd,"Int",-16,"UInt")
     f.Tab.GetPos(&x,&y,&w,&h)
     IUSApplyWindow(f.Gui,"analysis")
     f.Tab.GetPos(&nx,&ny,&nw,&nh)
     V48Assert(DllCall("User32\" procFn,"Ptr",hwnd,"Int",-4,"Ptr")=proc,"native tab window procedure untouched")
     V48Assert(DllCall("User32\GetWindowLongW","Ptr",hwnd,"Int",-16,"UInt")=style && x=nx && y=ny && w=nw && h=nh,"tab style and rectangle unchanged")
     V48Assert(!DllCall("User32\GetPropW","Ptr",hwnd,"Str","ahk_dlg","Ptr"),"no Tab3 page introduced")
 }
 
 V621TestIgnoredNotifications()
 {
     V621With(V621IgnoredCase)
 }
 V621IgnoredCase(f)
 {
     before := IUSState().Paints
     b := V621Notification(f.Tab.Hwnd)
     V48Assert(IUSButtonNotify(f.Tab,b.Ptr)=0,"tabs always ignored")
     b := V621Notification(f.Button.Hwnd,0,2)
     V48Assert(IUSButtonNotify(f.Button,b.Ptr)=0,"postpaint ignored")
     b := V621Notification(f.Button.Hwnd)
     V48Assert(IUSButtonNotify(f.Button,b.Ptr)=0 && IUSButtonNotify(f.Button,0)=0,"missing drawing surface ignored")
     b := V621Notification(f.Tab.Hwnd,0,1)
     V48Assert(IUSButtonNotify(f.Button,b.Ptr)=0,"wrong notification sender ignored")
     V48Assert(IUSState().Paints=before,"ignored callbacks report no fictional paint")
 }
 
 V621TestButtonPixels()
 {
     V621With(V621PixelCase)
 }
 V621PixelCase(f)
 {
     rc := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",f.Button.Hwnd,"Ptr",rc)
     w := NumGet(rc,8,"Int"),h := NumGet(rc,12,"Int")
     V621Surface(w+20,h+20,V621Pixels.Bind(f,w,h))
 }
 V621Pixels(f,w,h,dc)
 {
     V48Assert(IUSPaint(f.Button.Hwnd,V621Entry(f.Button),dc),"button drawn")
     bg := IUBColorRef(IUBPalette().Background)
     V48Assert(DllCall("Gdi32\GetPixel","Ptr",dc,"Int",0,"Int",0,"UInt")=bg,"rounded corner exposes original background")
     V48Assert(DllCall("Gdi32\GetPixel","Ptr",dc,"Int",Floor(w/2),"Int",h-4,"UInt")!=bg,"face is populated")
     V48Assert(DllCall("Gdi32\GetPixel","Ptr",dc,"Int",w+5,"Int",h-4,"UInt")=0xFF00FF,"nothing painted right of button")
     V48Assert(DllCall("Gdi32\GetPixel","Ptr",dc,"Int",8,"Int",h+8,"UInt")=0xFF00FF,"nothing painted below button")
 }
 
 V621TestDisabledButtonPixels()
 {
     V621With(V621DisabledCase)
 }
 V621DisabledCase(f)
 {
     f.Button.Enabled := false,V621PixelCase(f)
     V48Assert(!f.Button.Enabled,"painting never enables a disabled action")
 }
 
 V621TestHiddenTables()
 {
     V621With(V621HiddenTableCase)
 }
 V621HiddenTableCase(f)
 {
     f.List.Visible := false,IUSApplyWindow(f.Gui,"analysis"),V621PixelCase(f)
     V48Assert(!V58ChildVisible(f.List) && !V58ChildVisible(f.Hidden),"button painting does not reveal inactive content")
     V48Assert(f.List.GetText(1,2)="123","data untouched")
 }
 
 V621TestThemeRoundtrip()
 {
     V621With(V621ThemeCase)
 }
 V621ThemeCase(f)
 {
     global IUB
     for theme in ["classic","iris"] {
         IUB.Theme := theme,IUSApplyWindow(f.Gui,"analysis"),V621PixelCase(f)
         V48Assert(f.Tab.Value=2 && f.List.GetCount()=1,"theme does not select a different tab or alter rows")
     }
 }
 
 V621TestPaintResourceCleanup()
 {
     V621With(V621ResourceCase)
 }
 V621ResourceCase(f)
 {
     V621PixelCase(f),proc := DllCall("Kernel32\GetCurrentProcess","Ptr")
     before := DllCall("User32\GetGuiResources","Ptr",proc,"UInt",0,"UInt")
     Loop 20
         V621PixelCase(f)
     after := DllCall("User32\GetGuiResources","Ptr",proc,"UInt",0,"UInt")
     V48Assert(after<=before+2,"no accumulated GDI drawing resources")
 }
 
 V621TestScopedShutdown()
 {
     V621With(V621ShutdownCase)
 }
 V621ShutdownCase(f)
 {
     IUSShutdown(Map(123,true)),V621Entry(f.Button)
     IUSShutdown(Map(f.Gui.Hwnd,true))
     V48Assert(!IUSState().Controls.Has(f.Button.Hwnd) && IPMUiHandle(f.Button),"cleanup detaches, not destroys")
 }
 
 V621TestPaintDoesNotTouchTabs()
 {
     V621With(V621NoTabPixelsCase)
 }
 V621NoTabPixelsCase(f)
 {
     forged := {Type:"Tab2",Control:f.Tab,Role:"analysis"}
     V621Surface(450,300,V621NoTabPixels.Bind(f,forged))
 }
 V621NoTabPixels(f,entry,dc)
 {
     V48Assert(!IUSPaint(f.Tab.Hwnd,entry,dc),"even a direct accidental tab draw is refused")
     V48Assert(DllCall("Gdi32\GetPixel","Ptr",dc,"Int",20,"Int",20,"UInt")=0xFF00FF,"native heading area untouched")
     V48Assert(DllCall("Gdi32\GetPixel","Ptr",dc,"Int",20,"Int",120,"UInt")=0xFF00FF,"native page area untouched")
 }
 
 V621TestWorkspaceTabMatrix()
 {
     V601Isolated(V611With.Bind(V621WorkspaceCase))
 }
 V621WorkspaceCase()
 {
     global IP,IUB,IPM,NBOrder,NBRebounder
     u := IPWState(),p := IPRState(),data := p.Data,live := IP.Live,source := IPM.Source,order := NBOrder,bounder := NBRebounder
     for rounded in [true,false,true] {
         IUB.Rounded := rounded,IUBApplyWindow(IP.Gui,"main")
         for n in [7,1,2,3,4,5,6,8,7] {
             V58SelectTab(n)
             V48Assert(u.Tab=n && u.Controls["Tabs"].Value=IPWTabPosition(n),"native tab maps to expected page")
             V48Assert(!IUSState().Controls.Has(u.Controls["Tabs"].Hwnd),"main navigation excluded")
             visibility := Map()
             for group,controls in u.Groups {
                 show := IPWGroupVisible(group,n,p.Mode)
                 for c in controls {
                     visible := V58ChildVisible(c),visibility[c.Hwnd] := {Control:c,Visible:visible}
                     if !show
                         V48Assert(!visible,"inactive main group stays hidden")
                 }
             }
             IUBApplyWindow(IP.Gui,"main")
             for h,item in visibility
                 V48Assert(V58ChildVisible(item.Control)=item.Visible,"styling preserves active-page visibility including optional icons")
         }
     }
     V48Assert(p.Data=data && IP.Live=live && IPM.Source=source && NBOrder=order && NBRebounder=bounder,"UI does not change parser or calls")
 }
 
 V621TestAnalysisTabMatrix()
 {
     V601Isolated(V611With.Bind(V621AnalysisCase))
 }
 V621AnalysisCase()
 {
     global IUB
     a := V611AnalysisReady(),query := a.Query,data := a.Data
     for rounded in [true,false,true] {
         IUB.Rounded := rounded,IUBApplyWindow(a.Gui,"analysis")
         Loop 8 {
             chosen := A_Index,V7826SelectReviewPage(chosen)
             V611CheckAnalysis(a,chosen)
             V48Assert(!IUSState().Controls.Has(a.Controls["Tabs"].Hwnd),"analysis navigation excluded")
         }
     }
     V48Assert(a.Query=query && a.Data=data,"review/player/range retained")
 }
 
 V621TestDiagnosticPrivacy()
 {
     V621With(V621PrivacyCase)
 }
 V621PrivacyCase(f)
 {
     report := IUSReport()
     V48Assert(InStr(report,"button style") && InStr(report,"must be 0): 0"),"report identifies restricted scope")
     V48Assert(!InStr(report,"Synthetic row") && !InStr(report,"&Apply") && !InStr(report,A_ScriptDir),"no names, labels or paths")
 }
 
 V621TestPreferenceGuard()
 {
     V601Isolated(V621GuardCase)
 }
 V621GuardCase()
 {
     global IUB
     IUB.Rounded := false
     V48Assert(!IUBSave() && !IUBApplyAppearance() && !IUB.Rounded,"self tests cannot persist or apply user preferences")
 }
 
 V621TestCustomDrawNotification()
 {
     V621With(V621NotifyCase)
 }
 V621NotifyCase(f)
 {
     V621Surface(220,70,V621NotifyPixels.Bind(f))
 }
 V621NotifyPixels(f,dc)
 {
     n := V621Notification(f.Button.Hwnd,dc),before := IUSState().Paints
     result := IUSButtonNotify(f.Button,n.Ptr)
     if IUSHighContrast()
         V48Assert(result=0 && IUSState().Paints=before,"high contrast leaves notification native")
     else
         V48Assert(result=4 && IUSState().Paints=before+1,"successful prepaint alone skips default button face")
     V48Assert(!V621Entry(f.Button).Painting,"notification releases reentrancy guard")
 }
 
 V621TestDrawFailureFallsBack()
 {
     V621With(V621FallbackCase)
 }
 V621FallbackCase(f)
 {
     f.Button.Move(,,,600)
     V621Surface(220,70,V621FallbackNotify.Bind(f))
 }
 V621FallbackNotify(f,dc)
 {
     n := V621Notification(f.Button.Hwnd,dc),before := IUSState().Failures
     V48Assert(IUSButtonNotify(f.Button,n.Ptr)=0,"failed face never suppresses native rendering")
     e := V621Entry(f.Button)
     if !IUSHighContrast() {
         V48Assert(e.Failed && !e.Painting && IUSState().Failures=before+1,"failure contained to this button")
         V48Assert(IUSButtonNotify(f.Button,n.Ptr)=0 && IUSState().Failures=before+1,"no repeating error loop")
     }
     V48Assert(!IUSState().Controls.Has(f.Tab.Hwnd) && f.Tab.Value=2,"fallback cannot change native tab selection")
 }
 ; v64.3 role metadata and native presentation checks. Hidden/synthetic only.
 V622RoleLine(at,name := "Pyrotech",id := "2031339142381602",actor := "@RolePlayer#101")
 {
     return "[" IPStamp(at) "] [" actor "] [] [] [DisciplineChanged {836045448953665}: Combat Style {1}/" name " {" id "}]"
 }
 
 V622Data(name := "Pyrotech",id := "2031339142381602")
 {
     s := IPNewData("synthetic roles")
     V51Feed(s,1000,"Enter",0,"@RolePlayer#101","=")
     IPFeedLine(s,V622RoleLine(1000,name,id))
     V51Feed(s,2000,"Damage",1000,"@RolePlayer#101")
     return s
 }
 
 V622TestRoleDefaults()
 {
     s := IUBNewState()
     V48Assert(s.RoleColors && s.DropdownTint && !s.Ready,"presentation defaults are inert")
     V48Assert(IURLabel(0)="Unknown" && IURLabel(8)="Unknown","unknown is not DPS")
 }
 
 V622TestRoleCatalogue()
 {
     for pair in [["Shield Tech",1],["Shield Specialist",1],["Darkness",1],["Kinetic Combat",1],["Defense",1],["Immortal",1],
         ["Bodyguard",4],["Medicine",4],["Corruption",4],["Seer",4],["Combat Medic",4],["Sawbones",4],
         ["Pyrotech",2],["Engineering",2],["Lightning",2],["Vengeance",2],["Annihilation",2],["Tactics",2]]
         V48Assert(IURDiscipline("0",pair[1])=pair[2],"existing English discipline catalogue")
 }
 
 V622TestRoleIdPriority()
 {
     V48Assert(IURDiscipline("2031339142381582","Localized")=1,"known tank ID works without English name")
     V48Assert(IURDiscipline("2031339142381631","Localized")=4,"known healer ID")
     V48Assert(IURDiscipline("2031339142381602","Localized")=2,"known DPS ID")
     V48Assert(IURDiscipline("999","Localized")=8,"unsupported ID/name remains unknown")
 }
 
 V622TestRoleAnnotation()
 {
     e := IPParseLine(V622RoleLine(1000))
     V48Assert(e.Kind="Other" && e.DisplayRole=2 && e.Amount=0,"metadata stays a non-statistical event")
     e := IPParseLine(StrReplace(V622RoleLine(1000),"DisciplineChanged","Localized label"))
     V48Assert(e.DisplayRole=2,"event ID, not event label, identifies role metadata")
 }
 
 V622TestRoleRejectsNpc()
 {
     e := IPParseLine(V622RoleLine(1000,"Pyrotech","2031339142381602","Example {9001}:1"))
     V48Assert(!e.HasOwnProp("DisplayRole"),"NPC never becomes DPS")
     e := IPParseLine(V622RoleLine(1000,"Pyrotech","2031339142381602","@RolePlayer#101/Companion"))
     V48Assert(!e.HasOwnProp("DisplayRole"),"companion does not receive owner role")
 }
 
 V622TestRoleWrongRecord()
 {
     e := IPParseLine(StrReplace(V622RoleLine(1000),"836045448953665","836045448945477"))
     V48Assert(!e.HasOwnProp("DisplayRole"),"wrong event category rejected")
     e := IPParseLine("[00:00:01.000] [@RolePlayer#101] [] [] [DisciplineChanged {836045448953665}: Unknown]")
     V48Assert(!e.HasOwnProp("DisplayRole"),"malformed metadata cannot fabricate role")
 }
 
 V622TestRoleRecordedWithoutActor()
 {
     s := IPNewData(),seg := IPNewSegment(s,1000,"synthetic")
     e := IPParseLine(V622RoleLine(1000))
     IPApplyEvent(s,e,1000)
     V48Assert(IURMask(seg,"@RolePlayer#101")=2,"accepted role retained")
     V48Assert(seg.Actors.Count=0 && seg.Totals.Count=0 && seg.Events.Length=0,"metadata never creates participation or metric rows")
 }
 
 V622TestRoleDuplicates()
 {
     s := V622Data(),seg := s.Current
     IPFeedLine(s,V622RoleLine(2000))
     IPFeedLine(s,V622RoleLine(2000))
     V48Assert(seg.DisplayRoles.Count=1 && IURMask(seg,"@RolePlayer#101")=2,"duplicates do not become mixed or grow storage")
 }
 
 V622TestRoleRollback()
 {
     s := V622Data(),seg := s.Current
     IPBBeginUndo(s,seg)
     IURRecord(seg,IPParseLine(V622RoleLine(2500,"Darkness","2031339142381582")),2500)
     V48Assert(IURLabel(IURMask(seg,"@RolePlayer#101"))="Mixed","speculative role update visible in its journal")
     IPBRollbackTail(s,seg)
     V48Assert(IURMask(seg,"@RolePlayer#101")=2,"tail rollback restores original role")
 }
 
 V622TestRoleCapacity()
 {
     s := IPNewData(),seg := IPNewSegment(s,1000,"synthetic")
     Loop 513 {
         e := IPParseLine(V622RoleLine(1000,"Pyrotech","2031339142381602","@Role" A_Index "#" A_Index))
         IURRecord(seg,e,1000)
     }
     V48Assert(seg.DisplayRoles.Count=512 && !s.Halted && seg.Totals.Count=0,"bounded metadata does not halt parser or add actors")
     V48Assert(IURMask(seg,"@Role513#513")=8,"missing role stays unknown")
 }
 
 V622TestRoleBeforePull()
 {
     s := IPNewData(),seg := IPNewSegment(s,1000,"synthetic")
     V48Assert(!IURRecord(seg,IPParseLine(V622RoleLine(999)),999) && seg.DisplayRoles.Count=0,"earlier role rejected")
 }
 
 V622TestRolePullIsolation()
 {
     s := V622Data(),one := s.Current
     IPCloseSegment(s,"synthetic end"),two := IPNewSegment(s,5000,"synthetic second")
     V48Assert(IURMask(two,"@RolePlayer#101")=8,"new pull starts without guessed role")
     IURRecord(two,IPParseLine(V622RoleLine(5000,"Darkness","2031339142381582")),5000)
     V48Assert(IURMask(one,"@RolePlayer#101")=2 && IURMask(two,"@RolePlayer#101")=1,"later role cannot overwrite historical pull")
 }
 
 V622TestRoleDatasetIsolation()
 {
     a := V622Data(),b := V622Data("Darkness","2031339142381582")
     V48Assert(IURMask(a.Current,"@RolePlayer#101")=2 && IURMask(b.Current,"@RolePlayer#101")=1,"same character key in two data sources remains independent")
 }
 
 V622TestRoleTotalsUnchanged()
 {
     a := V622Data(),b := IPNewData()
     V51Feed(b,1000,"Enter",0,"@RolePlayer#101","=")
     V51Feed(b,2000,"Damage",1000,"@RolePlayer#101")
     V48Assert(a.Current.Totals["@RolePlayer#101"].Damage=b.Current.Totals["@RolePlayer#101"].Damage && IPDuration(a.Current)=IPDuration(b.Current),"role metadata cannot alter damage or duration")
     V48Assert(a.Current.Progression.Players.Count=b.Current.Progression.Players.Count,"role metadata cannot fabricate participation")
 }
 
 V622TestRoleCompaction()
 {
     s := V622Data(),seg := s.Current
     IPCloseSegment(s,"synthetic end"),p := IPRCompact(seg)
     V48Assert(p.Players["@RolePlayer#101"].RoleMask=2,"full scan compact results retain role")
     seg.DisplayRoles["@RolePlayer#101"] := 1
     V48Assert(p.Players["@RolePlayer#101"].RoleMask=2,"compact role is a value, not a live reference")
 }
 
 V622TestRoleSessionMixture()
 {
     d := IPRDemoData(),key := "@Little Bobby#101"
     d.Pulls[1].Players[key].RoleMask := 1
     r := IPRSummary(d)
     V48Assert(IURLabel(r.Players[key].RoleMask)="Mixed" && r.Players[key].Deaths=28 && r.Players[key].Delta=11,"mixed-role label does not change death statistics")
     d.Pulls[1].Included := false,r := IPRSummary(d)
     V48Assert(IURLabel(r.Players[key].RoleMask)="DPS","exclusion also filters role aggregation")
 }
 
 V622TestRolePartialCoverage()
 {
     d := IPRDemoData(),key := "@Little Bobby#101"
     d.Pulls[1].Players[key].DeleteProp("RoleMask")
     r := IPRSummary(d)
     V48Assert(IURLabel(r.Players[key].RoleMask)="DPS ?","missing pull metadata disclosed rather than filled from another pull")
     V48Assert(IURLabel(3)="Mixed" && IURLabel(12)="Healer ?","labels distinguish changes from missing coverage")
 }
 
 V622TestRoleDemo()
 {
     r := IPRSummary(IPRDemoData())
     V48Assert(IURLabel(r.Players["@Sample Tank#102"].RoleMask)="Tank","demo tank")
     V48Assert(IURLabel(r.Players["@Sample Healer#103"].RoleMask)="Healer","demo healer")
     V48Assert(IURLabel(r.Players["@Little Bobby#101"].RoleMask)="DPS","demo DPS")
 }
 
 V622Luminance(hex)
 {
     rgb := Integer("0x" hex),sum := 0.0
     for pair in [[16,0.2126],[8,0.7152],[0,0.0722]] {
         c := ((rgb>>pair[1])&255)/255.0
         sum += (c<=0.04045 ? c/12.92 : ((c+0.055)/1.055)**2.4)*pair[2]
     }
     return sum
 }
 
 V622TestRoleContrast()
 {
     for role in ["Tank","DPS","Healer","Unknown","Mixed","Tank ?"] {
         c := IURColors(role),ratio := 1.05/(V622Luminance(c.Background)+0.05)
         V48Assert(c.Text="FFFFFF" && ratio>=4.5,"white role text exceeds minimum normal-text contrast")
     }
 }
 
 V622TestRoleOffsets()
 {
     a := IURDrawOffsets(4),b := IURDrawOffsets(8)
     V48Assert(a.Item=36 && a.Text=48 && a.Background=52 && a.SubItem=56 && a.Size=104,"32-bit NMLVCUSTOMDRAW")
     V48Assert(b.Item=56 && b.Text=80 && b.Background=84 && b.SubItem=88 && b.Size=136,"64-bit NMLVCUSTOMDRAW")
 }
 
 V622With(action)
 {
     global IUB
     old := IUB,IUB := IUBNewState(),g := Gui()
     try {
         g.SetFont("s9","Segoe UI")
         tab := g.AddTab2("w400 h100",["Raid","Analysis"]),tab.UseTab(),tab.Choose(2)
         lv := g.AddListView("x10 y40 w380 h80",["Player","Role"])
         lv.Add(,"Sample","Tank"),lv.Add(,"Second","DPS")
         ddl := g.AddDropDownList("x10 y140 w200 Choose2",["First","Second","Third"])
         g.Show("Hide w420 h200")
         action.Call({Gui:g,Tab:tab,List:lv,DDL:ddl})
     }
     finally {
         if IPMUiHandle(g)
             g.Destroy()
         IURPrune(),IUB := old
     }
 }
 
 V622Notification(c,stage,column := 2,state := 0)
 {
     o := IURDrawOffsets(),b := Buffer(o.Size,0)
     NumPut("Ptr",c.Hwnd,b,0),NumPut("UInt",stage,b,o.Stage)
     NumPut("UPtr",0,b,o.Item),NumPut("UInt",state,b,o.State),NumPut("Int",column-1,b,o.SubItem)
     return b
 }
 
 V622TestRoleNativeRegistration()
 {
     V622With(V622RegistrationCase)
 }
 V622RegistrationCase(f)
 {
     V48Assert(!IURRegister(f.Tab,1) && !IURRegister(f.DDL,1),"tabs and dropdowns never enter role painter")
     V48Assert(IURRegister(f.List,2) && IURRegister(f.List,2),"repeat registration is safe")
     V48Assert(f.List.GetText(1,1)="Sample" && f.Tab.Value=2,"registration preserves text and tab")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",f.Gui.Hwnd,"Int"),"registration cannot reveal a hidden GUI")
 }
 
 V622TestRoleNativeColors()
 {
     V622With(V622ColorCase)
 }
 V622ColorCase(f)
 {
     IURRegister(f.List,2),o := IURDrawOffsets(),b := V622Notification(f.List,0x30001)
     result := IURNotify(f.List,b.Ptr)
     if IUSHighContrast() {
         V48Assert(result=0,"high contrast delegates native colors")
         return
     }
     V48Assert(result=2 && NumGet(b,o.Text,"UInt")=0xFFFFFF,"native cell text white")
     V48Assert(NumGet(b,o.Background,"UInt")=IUBColorRef("205A96"),"Tank cell blue")
     b := V622Notification(f.List,0x30001,1),IURNotify(f.List,b.Ptr)
     V48Assert(NumGet(b,o.Text,"UInt")=IUBColorRef(IUBPalette().Text),"normal name text remains dark")
 }
 
 V622TestRoleNativeSelection()
 {
     V622With(V622SelectionCase)
 }
 V622SelectionCase(f)
 {
     f.List.Modify(1,"Select")
     IURRegister(f.List,2)
     for stage in [0x10001,0x30001] {
         b := V622Notification(f.List,stage,2,1)
         V48Assert(IURNotify(f.List,b.Ptr)=(stage=0x10001 && !IUSHighContrast() ? 0x20 : 0),"selected rows keep native coloring; item stage still requests cells")
     }
     b := V622Notification(f.List,7)
     V48Assert(IURNotify(f.List,b.Ptr)=0,"unrelated notification stage ignored")
 }
 
 V622TestRoleDestroyedControls()
 {
     V622With(V622DestroyedCase)
 }
 V622DestroyedCase(f)
 {
     IURRegister(f.List,2),hwnd := f.List.Hwnd
     f.Gui.Destroy(),IURPrune()
     V48Assert(!IURState().Tables.Has(hwnd),"destroyed handles retired")
 }
 
 V622TestDropdownPolicy()
 {
     p := IUBPalette("iris"),c := IUDColors(true,false,p)
     V48Assert(c.Tint && c.Text="352943" && (V622Luminance(c.Background)+0.05)/(V622Luminance(c.Text)+0.05)>=4.5,"light lavender dropdown fields keep dark text legible")
     V48Assert(!IUDColors(false,false,p).Tint && !IUDColors(true,false,IUBPalette("classic")).Tint,"disabled or classic uses native light fields")
     c := IUDColors(true,true,p)
     V48Assert(!c.Tint && c.Background="Default" && c.Text="Default","high contrast respects system colors")
 }
 
 V622TestDropdownSelectionPreserved()
 {
     V622With(V622DropdownCase)
 }
 V622DropdownCase(f)
 {
     global IUB
     ; Normalize the selected font before testing tint-only geometry invariance.
     ITQApply(f.DDL)
     f.DDL.GetPos(&x,&y,&w,&h),hwnd := f.DDL.Hwnd
     tabStyle := DllCall("User32\GetWindowLongW","Ptr",f.Tab.Hwnd,"Int",-16,"UInt")
     IUDApplyWindow(f.Gui,"analysis")
     V48Assert(f.DDL.Value=2 && f.DDL.Text="Second" && SendMessage(0x146,0,0,f.DDL)=3,"native choices and selection survive tint")
     f.DDL.GetPos(&x2,&y2,&w2,&h2)
     V48Assert(x=x2 && y=y2 && w=w2 && h=h2 && hwnd=f.DDL.Hwnd,"no replacement selector or geometry change")
     V48Assert(f.Tab.Value=2 && DllCall("User32\GetWindowLongW","Ptr",f.Tab.Hwnd,"Int",-16,"UInt")=tabStyle,"dropdown coloring never touches tabs")
     IUB.DropdownTint := false,IUDApplyWindow(f.Gui,"analysis")
     V48Assert(f.DDL.Value=2 && f.DDL.Text="Second","restoring native appearance keeps selection")
 }
 
 V622TestRoleColumns()
 {
     V61Hidden(V622ColumnsCase)
 }
 V622ColumnsCase()
 {
     global IP
     V61Ready(),IPRDemo(),lv := IPWState().Controls["SessionPlayers"]
     V48Assert(lv.GetCount("Col")=10 && lv.GetText(0,10)="Role","Role column uses revised schema")
     V48Assert(IP.PlayersLV.GetCount("Col")=12 && IP.PlayersLV.GetText(0,12)="Role","selected-pull Role appended")
     b := Buffer(40,0)
     V48Assert(SendMessage(0x103B,10,b.Ptr,lv) && NumGet(b,4,"Int")=9,"Role visually next to player")
     V48Assert(lv.GetText(1,8)!="" && lv.GetText(1,9)!="","key and activity data use the revised logical columns")
 }
 
 V622TestRoleSorting()
 {
     V61Hidden(V622SortingCase)
 }
 V622SortingCase()
 {
     V61Ready(),IPRDemo(),lv := IPWState().Controls["SessionPlayers"]
     IPRSort(lv,10)
     V48Assert(IPRState().SortCol=10 && lv.GetText(1,8)!="","text role sorting retains row identity")
     IPRDraw()
     V48Assert(lv.GetText(1,10)!="" && lv.GetText(1,9)!="","refresh retains role sort and activity")
 }
 ; v64.3: these checks use real controls and native dispatch, but not screen pixels.
 V623With(action)
 {
     try V622With(action)
     finally IUDPrune()
 }
 
 V623Colors(control)
 {
     hwnd := control.Hwnd,dc := DllCall("User32\GetDC","Ptr",hwnd,"Ptr")
     if !dc
         throw Error("No private color-query DC.")
     try {
         parent := DllCall("User32\GetParent","Ptr",hwnd,"Ptr")
         brush := SendMessage(0x138,dc,hwnd,parent) ; WM_CTLCOLORSTATIC, as used by DDL
         return {Brush:brush,Text:DllCall("Gdi32\GetTextColor","Ptr",dc,"UInt"),
             Background:DllCall("Gdi32\GetBkColor","Ptr",dc,"UInt")}
     }
     finally DllCall("User32\ReleaseDC","Ptr",hwnd,"Ptr",dc)
 }
 
 V623Dispatch(control,stage,column := 2,state := 0)
 {
     b := V622Notification(control,stage,column,state)
     id := DllCall("User32\GetDlgCtrlID","Ptr",control.Hwnd,"Int")
     NumPut("UPtr",id,b,A_PtrSize),NumPut("Int",-12,b,2*A_PtrSize)
     result := SendMessage(0x4E,id,b.Ptr,control.Gui.Hwnd)
     return {Result:result,Buffer:b}
 }
 
 V623TestDropdownType()
 {
     V623With(V623TypeCase)
 }
 V623TypeCase(f)
 {
     V48Assert(f.DDL.Type="DDL","AHK exposes the native DDL type, not its Add alias")
     V48Assert(IUDIsDropdownType(f.DDL.Type),"actual native dropdown reaches the tint predicate")
 }
 
 V623TestTypeExclusions()
 {
     V48Assert(IUDIsDropdownType("DDL") && IUDIsDropdownType("DropDownList"),"native type and construction alias accepted")
     for kind in ["Tab","Tab2","Tab3","Button","ListView","Pic","Edit","ComboBox","TreeView"]
         V48Assert(!IUDIsDropdownType(kind),"only noneditable dropdowns are targeted")
 }
 
 V623TestTintReachesControl()
 {
     V623With(V623TintCase)
 }
 V623TintCase(f)
 {
     V48Assert(IUDApplyWindow(f.Gui,"analysis")=1,"one real native DDL is processed")
     e := IUDState().Controls[f.DDL.Hwnd]
     V48Assert(e.ErrorType="none","tint application has no swallowed failure")
     V48Assert(e.Tint=!IUSHighContrast(),"system high contrast remains a native fallback")
     V48Assert(f.DDL.Value=2 && f.DDL.Text="Second" && f.Tab.Value=2,"tint never selects another item or tab")
 }
 
 V623TestNativeColorResponse()
 {
     V623With(V623ColorResponseCase)
 }
 V623ColorResponseCase(f)
 {
     IUDApplyWindow(f.Gui,"analysis"),colors := V623Colors(f.DDL)
     V48Assert(colors.Brush!=0,"native DDL color request returns a brush")
     if !IUSHighContrast()
         V48Assert(colors.Text=IUBColorRef("352943") && colors.Background=IUBColorRef("F8F5FC"),"native color response matches the light lavender dropdown face")
 }
 
 V623TestTintOffRestores()
 {
     V623With(V623OffCase)
 }
 V623OffCase(f)
 {
     global IUB
     IUDApplyWindow(f.Gui,"analysis"),IUB.DropdownTint := false
     V48Assert(IUDApplyWindow(f.Gui,"analysis")=1,"turning tint off also reaches the real dropdown")
     V48Assert(!IUDState().Controls[f.DDL.Hwnd].Tint && f.DDL.Value=2,"native selection survives restoration")
     if !IUSHighContrast() {
         colors := V623Colors(f.DDL),p := IUBPalette()
         V48Assert(colors.Text=IUBColorRef(p.Text) && colors.Background=IUBColorRef(p.Field),"old light field colors restored")
     }
 }
 
 V623TestPaletteOrder()
 {
     V623With(V623OrderCase)
 }
 V623OrderCase(f)
 {
     IUBApplyWindow(f.Gui,"analysis")
     style := DllCall("User32\GetWindowLongW","Ptr",f.Tab.Hwnd,"Int",-16,"UInt")
     Loop 2
         IUBApplyWindow(f.Gui,"analysis")
     V48Assert(f.Tab.Value=2 && DllCall("User32\GetWindowLongW","Ptr",f.Tab.Hwnd,"Int",-16,"UInt")=style,"reapplying the palette leaves native tab style and selection alone")
     V48Assert(IUDState().Controls[f.DDL.Hwnd].ErrorType="none","dropdown pass runs after each generic palette pass")
     if !IUSHighContrast() {
         colors := V623Colors(f.DDL)
         V48Assert(colors.Background=IUBColorRef("F8F5FC") && colors.Text=IUBColorRef("352943"),"generic palette cannot overwrite the final light dropdown tint")
     }
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",f.Gui.Hwnd,"Int"),"tests never show the sample window")
 }
 
 V623TestDropdownScope()
 {
     V623With(V623ScopeCase)
 }
 V623ScopeCase(f)
 {
     IUDPrune()
     V48Assert(IUDApplyWindow(f.Gui,"dialog")=0 && !IUDState().Controls.Has(f.DDL.Hwnd),"other settings dialogs are not newly tinted")
     IUDApplyWindow(f.Gui,"analysis")
     V48Assert(!IUDState().Controls.Has(f.Tab.Hwnd) && !IUDState().Controls.Has(f.List.Hwnd),"tabs and tables never enter dropdown registry")
 }
 
 V623TestDestroyedDropdown()
 {
     V623With(V623DestroyedCase)
 }
 V623DestroyedCase(f)
 {
     IUDApplyWindow(f.Gui,"analysis"),hwnd := f.DDL.Hwnd
     f.Gui.Destroy(),IUDPrune()
     V48Assert(!IUDState().Controls.Has(hwnd),"destroyed selector references are retired")
 }
 
 V623TestRoleDispatch()
 {
     V623With(V623DispatchCase)
 }
 V623DispatchCase(f)
 {
     IURRegister(f.List,2),e := IURState().Tables[f.List.Hwnd]
     pre := e.PrePaints,items := e.Items,roles := e.RoleRequests
     first := V623Dispatch(f.List,1)
     if IUSHighContrast() {
         V48Assert(first.Result=0,"native high contrast delegates role drawing")
         return
     }
     V48Assert(first.Result=0x20 && e.PrePaints=pre+1,"real WM_NOTIFY dispatch requests per-row notifications")
     second := V623Dispatch(f.List,0x10001)
     V48Assert(second.Result=0x20 && e.Items=items+1,"real WM_NOTIFY dispatch requests subitems")
     third := V623Dispatch(f.List,0x30001),o := IURDrawOffsets()
     V48Assert(third.Result=2 && e.RoleRequests=roles+1,"real dispatch reaches role color assignment")
     V48Assert(NumGet(third.Buffer,o.Text,"UInt")=0xFFFFFF && NumGet(third.Buffer,o.Background,"UInt")=IUBColorRef("205A96"),"role notification still requests white-on-blue")
 }
 
 V623TestSelectionStillNative()
 {
     V623With(V623SelectionCase)
 }
 V623SelectionCase(f)
 {
     f.List.Modify(1,"Select")
     IURRegister(f.List,2),e := IURState().Tables[f.List.Hwnd],before := e.RoleRequests
     for stage in [0x10001,0x30001] {
         result := V623Dispatch(f.List,stage,2,1)
         V48Assert(result.Result=(stage=0x10001 && !IUSHighContrast() ? 0x20 : 0),"selected cells still use native highlight; item stage requests cells")
     }
     V48Assert(e.RoleRequests=before && !e.Failed,"diagnostic counters do not change selected-row policy")
 }
 
 V623TestAppearanceReport()
 {
     V61Hidden(V623ReportCase)
 }
 V623ReportCase()
 {
     global IP
     V61Ready(),IPRDemo(),p := IPRState(),u := IPWState()
     data := p.Data,result := p.Result,tab := u.Tab,active := IP.Active
     before := u.Controls["SessionPlayers"].GetCount(),text := IURAppearanceReport()
     V48Assert(InStr(text,"v0.78.112") && InStr(text,"SessionPlayers:") && InStr(text,"Dropdowns processed:"),"one report identifies the two appearance paths")
     for secret in ["Little Bobby","@Little Bobby#101",A_ScriptFullPath]
         V48Assert(!InStr(text,secret),"report omits names, identities and source path")
     V48Assert(p.Data=data && p.Result=result && u.Tab=tab && IP.Active=active && u.Controls["SessionPlayers"].GetCount()=before,"report neither reloads, renders, changes selection nor starts collection")
 }
 
 V623TestRoleCounterReset()
 {
     V623With(V623ResetCase)
 }
 V623ResetCase(f)
 {
     IURRegister(f.List,2),e := IURState().Tables[f.List.Hwnd]
     e.Failed := true,e.ErrorType := "SyntheticFailure",e.RoleRequests := 19
     V48Assert(IURRegister(f.List,2) && !e.Failed && e.ErrorType="none","explicit re-registration rearms an earlier drawing fallback")
     V48Assert(e.RoleRequests=19 && f.List.GetText(1,2)="Tank","counters and role labels survive re-registration")
 }
 ; v64.3: actual native selection vs transient custom-draw flags.
 ; Manual suite only: all test windows hidden, all pixels in private bitmaps.
 V624Dispatch(control,stage,column := 2,state := 0,row := 1)
 {
     b := V622Notification(control,stage,column,state),off := IURDrawOffsets()
     NumPut("UPtr",row-1,b,off.Item)
     id := DllCall("User32\GetDlgCtrlID","Ptr",control.Hwnd,"Int")
     NumPut("UPtr",id,b,A_PtrSize),NumPut("Int",-12,b,2*A_PtrSize)
     return {Result:SendMessage(0x4E,id,b.Ptr,control.Gui.Hwnd),Buffer:b}
 }
 
 V624TestAlwaysRequestCells()
 {
     V623With(V624RequestCase)
 }
 V624RequestCase(f)
 {
     IURRegister(f.List,2),f.List.Modify(1,"Select")
     for flag in [0,1,4,5,0x10,0x40] {
         r := V624Dispatch(f.List,0x10001,2,flag)
         V48Assert(r.Result=(IUSHighContrast() ? 0 : 0x20),"item paint flags never prematurely suppress subitem dispatch")
     }
 }
 
 V624TestFalseSelectedFlag()
 {
     V623With(V624FalseSelectedCase)
 }
 V624FalseSelectedCase(f)
 {
     f.List.Modify(0,"-Select"),IURRegister(f.List,2)
     V48Assert(SendMessage(0x102C,0,2,f.List)=0,"real row is not selected")
     r := V624Dispatch(f.List,0x30001,2,1),e := IURState().Tables[f.List.Hwnd],o := IURDrawOffsets()
     if IUSHighContrast() {
         V48Assert(r.Result=0,"system high contrast stays native")
         return
     }
     V48Assert(r.Result=2 && e.RoleRequests=1,"false selected paint flag cannot hide an unselected role")
     V48Assert(e.SelectionMismatches=1 && NumGet(r.Buffer,o.Text,"UInt")=0xFFFFFF,"mismatch observed; text stays white")
 }
 
 V624TestSelectionMissingFlag()
 {
     V623With(V624SelectionMissingCase)
 }
 V624SelectionMissingCase(f)
 {
     f.List.Modify(1,"Select"),IURRegister(f.List,2)
     V48Assert(SendMessage(0x102C,0,2,f.List)=2,"native row is actually selected")
     r := V624Dispatch(f.List,0x30001,2,0),e := IURState().Tables[f.List.Hwnd]
     V48Assert(r.Result=0 && e.RoleRequests=0,"selection highlight retained even when paint selected flag is absent")
 }
 
 V624TestTrueSelectionFlag()
 {
     V623With(V624TrueSelectionCase)
 }
 V624TrueSelectionCase(f)
 {
     f.List.Modify(1,"Select"),IURRegister(f.List,2)
     r := V624Dispatch(f.List,0x30001,2,1),e := IURState().Tables[f.List.Hwnd]
     V48Assert(r.Result=0 && e.RoleRequests=0 && e.SelectionMismatches=0,"confirmed selection delegates without false mismatch")
 }
 
 V624TestFocusWithoutSelection()
 {
     V623With(V624FocusCase)
 }
 V624FocusCase(f)
 {
     f.List.Modify(0,"-Select"),f.List.Modify(1,"Focus"),IURRegister(f.List,2)
     V48Assert((SendMessage(0x102C,0,3,f.List) & 3)=1,"focused-only native row is not selected")
     r := V624Dispatch(f.List,0x30001,2,0x10)
     V48Assert(r.Result=(IUSHighContrast() ? 0 : 2),"focus rectangle is not mistaken for selected-row suppression")
 }
 
 V624TestFalseDisabledFlag()
 {
     V623With(V624FalseDisabledCase)
 }
 V624FalseDisabledCase(f)
 {
     f.List.Modify(0,"-Select"),IURRegister(f.List,2)
     V48Assert(f.List.Enabled,"fixture is enabled")
     r := V624Dispatch(f.List,0x30001,2,4)
     V48Assert(r.Result=(IUSHighContrast() ? 0 : 2),"actual enabled state wins over transient disabled paint flag")
 }
 
 V624TestDisabledTableNative()
 {
     V623With(V624DisabledCase)
 }
 V624DisabledCase(f)
 {
     f.List.Modify(0,"-Select"),IURRegister(f.List,2),f.List.Enabled := false
     r := V624Dispatch(f.List,0x30001),e := IURState().Tables[f.List.Hwnd]
     V48Assert(r.Result=0 && e.RoleRequests=0,"disabled table retains native treatment")
 }
 
 V624TestRoleColorsOff()
 {
     V623With(V624OffCase)
 }
 V624OffCase(f)
 {
     global IUB
     f.List.Modify(0,"-Select"),IURRegister(f.List,2),IUB.RoleColors := false
     r := V624Dispatch(f.List,0x30001)
     V48Assert(r.Result=0 && IURState().Tables[f.List.Hwnd].RoleRequests=0,"appearance switch still disables colors")
     IUB.RoleColors := true,r := V624Dispatch(f.List,0x30001)
     V48Assert(r.Result=(IUSHighContrast() ? 0 : 2),"reenabling colors needs no metadata reload")
 }
 
 V624WithWide(count,roleColumn,action)
 {
     global IUB
     old := IUB,IUB := IUBNewState(),g := Gui(),columns := [],order := [0,roleColumn-1]
     try {
         g.SetFont("s9","Segoe UI")
         Loop count
             columns.Push(A_Index=1 ? "Player" : (A_Index=roleColumn ? "Role" : "Metric " A_Index))
         lv := g.AddListView("x8 y8 w740 h150 -Multi BackgroundFCFAFF c352943",columns)
         for index,label in ["Tank","DPS","Healer"] {
             values := []
             Loop count
                 values.Push(A_Index=1 ? "Synthetic " index : (A_Index=roleColumn ? label : index*10))
             lv.Add("",values*)
         }
         Loop count {
             col := A_Index
             lv.ModifyCol(col,col=1 ? 115 : (col=roleColumn ? 78 : 48))
             if col!=1 && col!=roleColumn
                 order.Push(col-1)
         }
         lv.ModifyCol(9,0)
         V48Assert(IPAColumnOrder(lv,order),"wide native Role column reordered next to name")
         g.Show("Hide w760 h180"),lv.Modify(0,"-Select")
         IURRegister(lv,roleColumn)
         action.Call({Gui:g,List:lv,Column:roleColumn,Count:count})
     }
     finally {
         if IPMUiHandle(g)
             g.Destroy()
         IURPrune(),IUB := old
     }
 }
 
 V624TestSessionColumnReorder()
 {
     V624WithWide(11,11,V624WideCase)
 }
 V624TestRaidColumnReorder()
 {
     V624WithWide(12,12,V624WideCase)
 }
 V624WideCase(f)
 {
     V48Assert(IURColumnPosition(f.List,f.Column)=2,"Role is display position two but retains original logical index")
     r := V624Dispatch(f.List,0x30001,f.Column,1),o := IURDrawOffsets()
     V48Assert(r.Result=(IUSHighContrast() ? 0 : 2),"reordered logical role receives colors despite misleading paint selection")
     if !IUSHighContrast()
         V48Assert(NumGet(r.Buffer,o.Background,"UInt")=IUBColorRef("205A96"),"reordered tank field is blue")
     V48Assert(f.List.GetText(1,f.Column)="Tank" && f.List.GetText(1,9)="10","hidden key and logical columns preserved")
 }
 
 V624TestAllRoleColors()
 {
     V624WithWide(11,11,V624AllColorsCase)
 }
 V624AllColorsCase(f)
 {
     o := IURDrawOffsets()
     for row,label in ["Tank","DPS","Healer"] {
         r := V624Dispatch(f.List,0x30001,f.Column,1,row),colors := IURColors(label)
         if !IUSHighContrast()
             V48Assert(r.Result=2 && NumGet(r.Buffer,o.Text,"UInt")=0xFFFFFF
                 && NumGet(r.Buffer,o.Background,"UInt")=IUBColorRef(colors.Background),"correct white-on-role colors for every row")
         V48Assert(f.List.GetText(row,f.Column)=label,"coloring never changes role labels")
     }
 }
 
 V624TestCountersExplainSkips()
 {
     V623With(V624CountersCase)
 }
 V624CountersCase(f)
 {
     f.List.Modify(0,"-Select"),IURRegister(f.List,2)
     V624Dispatch(f.List,0x30001,1,0),V624Dispatch(f.List,0x30001,2,1)
     V624Dispatch(f.List,0x30001,99,0),V624Dispatch(f.List,0x30001,2,0,99)
     f.List.Modify(1,"Select"),V624Dispatch(f.List,0x30001,2,0)
     e := IURState().Tables[f.List.Hwnd]
     if !IUSHighContrast() {
         V48Assert(e.RoleVisits=2 && e.RoleRequests=1 && e.NativeCells=1,"visits, color requests and selected-cell delegation are distinct")
         V48Assert(e.InvalidRows=1 && e.InvalidColumns=1 && e.SelectionMismatches=2,"invalid indices and disagreeing flags separately counted")
         V48Assert(e.ColumnsSeen.Has(1) && e.ColumnsSeen.Has(2),"only numeric logical columns retained in diagnostics")
     }
 }
 
 V624TestCriticalRestored()
 {
     V623With(V624CriticalCase)
 }
 V624CriticalCase(f)
 {
     old := A_IsCritical
     try {
         IURRegister(f.List,2)
         for setting in [0,75] {
             Critical(setting)
             b := V622Notification(f.List,1),before := A_IsCritical
             IURNotify(f.List,b.Ptr)
             V48Assert(A_IsCritical=before,"draw guard restores caller critical setting on success")
             IURNotify(f.List,0)
             V48Assert(A_IsCritical=before,"draw guard restores caller setting on early return")
         }
     }
     finally Critical(old)
 }
 
 V624CellRect(lv,row,column)
 {
     r := Buffer(16,0)
     NumPut("Int",0,r,0),NumPut("Int",column-1,r,4)
     V48Assert(SendMessage(0x1038,row-1,r.Ptr,lv),"native subitem rectangle available")
     return {L:NumGet(r,0,"Int"),T:NumGet(r,4,"Int"),R:NumGet(r,8,"Int"),B:NumGet(r,12,"Int")}
 }
 V624ColorCount(dc,rect,color)
 {
     found := 0,x := rect.L+3,stepX := Max(1,Floor((rect.R-rect.L-6)/12))
     while x<rect.R-2 {
         y := rect.T+2
         while y<rect.B-1 {
             if DllCall("Gdi32\GetPixel","Ptr",dc,"Int",x,"Int",y,"UInt")=color
                 found += 1
             y += 2
         }
         x += stepX
     }
     return found
 }
 V624PrintTable(f,selected := false)
 {
     rect := Buffer(16,0)
     V48Assert(DllCall("User32\GetClientRect","Ptr",f.List.Hwnd,"Ptr",rect,"Int"),"private print uses physical client dimensions")
     V621Surface(NumGet(rect,8,"Int"),NumGet(rect,12,"Int"),V624PrintPixels.Bind(f,selected))
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",f.Gui.Hwnd,"Int"),"private render did not show a window")
 }
 V624PrintPixels(f,selected,dc)
 {
     e := IURState().Tables[f.List.Hwnd],before := e.RoleRequests
     ; Ask the real ListView to render its client into a private bitmap. Unlike
     ; earlier tests, Windows supplies the entire draw sequence and item states.
     SendMessage(0x318,dc,4,f.List) ; WM_PRINTCLIENT, PRF_CLIENT (no CHECKVISIBLE)
     if IUSHighContrast() {
         V48Assert(e.RoleRequests=before,"high-contrast private render stays native")
         return
     }
     V48Assert(e.SubItems>0 && e.RoleRequests>before && !e.Failed,"real native render reaches role cells, not just fabricated buffers")
     for row,label in ["Tank","DPS","Healer"] {
         rect := V624CellRect(f.List,row,f.Column),color := IUBColorRef(IURColors(label).Background)
         count := V624ColorCount(dc,rect,color)
         V48Assert(selected && row=2 ? count=0 : count>0,"private bitmap shows role fill only on unselected cells")
     }
 }
 
 V624TestNativeRoleBitmap()
 {
     V624WithWide(11,11,V624PrintTable)
 }
 
 V624TestNativeSelectionBitmap()
 {
     V624WithWide(12,12,V624SelectedPrintCase)
 }
 V624SelectedPrintCase(f)
 {
     f.List.Modify(2,"Select"),V624PrintTable(f,true)
 }
 
 V624TestReportPrivacyAndOrder()
 {
     V61Hidden(V624ReportCase)
 }
 V624ReportCase()
 {
     global IP
     V61Ready(),IPRDemo(),p := IPRState(),u := IPWState()
     data := p.Data,result := p.Result,tab := u.Tab,active := IP.Active
     text := IURAppearanceReport()
     V48Assert(InStr(text,"v0.78.112") && InStr(text,"role display position=2"),"report verifies actual Role display position")
     V48Assert(InStr(text,"logical columns seen=") && InStr(text,"selection flag mismatches="),"report reveals the previously hidden decision path")
     for secret in ["Little Bobby","@Little Bobby#101",A_ScriptFullPath]
         V48Assert(!InStr(text,secret),"no names, player identifiers or paths in appearance report")
     V48Assert(p.Data=data && p.Result=result && u.Tab=tab && IP.Active=active,"report is read-only")
 }
 ; v64.3: manual-only filter/schema tests. Every native GUI remains hidden.
 V625Data()
 {
     s := IPNewData("SYNTHETIC FILTER FIXTURE"),s.Finished := true
     for i,key in ["","G-TY","","G-SC",""] {
         source := V58Seed(),seg := source.Segments[1]
         seg.Id := i*10,seg.BossKey := key,seg.BossName := key="" ? "" : (i=2 ? "Tyth" : "Scyva")
         seg.Opponent := seg.BossName!="" ? seg.BossName : "Unrecognized encounter"
         seg.End := seg.Last
         s.Segments.Push(seg)
     }
     return s
 }
 
 V625Ready()
 {
     global IP
     IP.Offline := V625Data(),IP.View := "Imported",IP.Selected := 5,IP.Follow := true
     IPRState().Mode := "pull"
     IPWBuild(),IPRefresh()
     return IPWState()
 }
 
 V625Toggle(enabled)
 {
     c := IPWState().Controls["HideTrash"]
     c.Value := enabled ? 1 : 0
     IPWFilterFights(c)
 }
 
 V625TestInertDefaults()
 {
     s := IPWNewState()
     V48Assert(!s.HideTrash && !s.FightUpdating && s.FightRows.Length=0,"filter starts off without data, controls or timers")
 }
 
 V625TestFilterOff()
 {
     s := V625Data(),r := IPWFightIndices(s,false)
     V48Assert(r.Length=5 && r[1]=1 && r[5]=5,"all original indices remain visible with filter off")
 }
 
 V625TestRecognizedOnly()
 {
     s := V625Data(),r := IPWFightIndices(s,true)
     V48Assert(r.Length=2 && r[1]=2 && r[2]=4,"filter retains recognized encounters, not highest damage or name matches")
     s.Segments[1].Opponent := "Tyth"
     V48Assert(IPWFightIndices(s,true).Length=2,"a boss-looking label alone cannot classify an unknown fight")
 }
 
 V625TestEmptySources()
 {
     V48Assert(IPWFightIndices("").Length=0 && IPWFightIndices(IPNewData(),true).Length=0,"empty inputs return no rows")
     V48Assert(IPWFightSelection([],3,true)=0,"all-hidden input returns no substitute fight")
 }
 
 V625TestPinnedSelection()
 {
     V48Assert(IPWFightSelection([2,4],2,false)=2,"a visible historical fight stays pinned")
     V48Assert(IPWFightSelection([2,4],4,false)=4,"last visible pinned fight stays selected")
 }
 
 V625TestFollowSelection()
 {
     V48Assert(IPWFightSelection([2,4],2,true)=4,"follow chooses last visible, not last raw index")
     V48Assert(IPWFightSelection([1,2,3,4,5],2,true)=5,"filter-off follow retains prior behavior")
 }
 
 V625TestHiddenSelection()
 {
     for index in [0,1,3,5,99]
         V48Assert(IPWFightSelection([2,4],index,false)=4,"hidden or unavailable selection falls back to last visible")
 }
 
 V625TestLateRecognition()
 {
     s := V625Data(),n := s.Segments.Length
     V48Assert(IPWFightIndices(s,true).Length=2,"unrecognized opening phase initially hidden")
     s.Segments[5].BossKey := "G-SC"
     r := IPWFightIndices(s,true)
     V48Assert(r.Length=3 && r[3]=5 && s.Segments.Length=n,"new recognition appears without a new segment")
 }
 
 V625TestFilterNoMutation()
 {
     s := V625Data(),ptr := ObjPtr(s.Segments),before := IPCsvData(s,s.Segments[1]),end := s.Segments[1].End
     Loop 20
         IPWFightSelection(IPWFightIndices(s,Mod(A_Index,2)=1),2,true)
     V48Assert(ObjPtr(s.Segments)=ptr && s.Segments.Length=5 && s.Segments[1].End=end,"no deletion, reclosing or replacement of segments")
     V48Assert(IPCsvData(s,s.Segments[1])=before,"filter never modifies source statistics")
 }
 
 V625TestSavedOverlayRouting()
 {
     app := IPNewApp(),app.Offline := V625Data(),app.View := "Imported",app.Selected := 5,app.Follow := true
     app.Workspace := IPWNewState(),app.Workspace.HideTrash := true
     V48Assert(IPMResolve(app,3).Segment=app.Offline.Segments[4],"automatic saved display follows the last visible fight")
     app.Selected := 2,app.Follow := false
     V48Assert(IPMResolve(app,2).Segment=app.Offline.Segments[2],"explicit parser source retains visible pin")
     V48Assert(app.Selected=2 && !app.Follow && app.Offline.Segments.Length=5,"resolving a display is read-only")
 }
 
 V625TestLiveOverlayUnchanged()
 {
     app := IPNewApp(),app.Live := V625Data(),app.Offline := V625Data(),app.View := "Imported"
     app.Workspace := IPWNewState(),app.Workspace.HideTrash := true,app.Active := true
     V48Assert(IPMResolve(app,3).Segment=app.Live.Segments[5],"automatic live keeps current combat even when unrecognized")
     V48Assert(IPMResolve(app,1).Segment=app.Live.Segments[5],"manual latest-live also ignores the sidebar filter")
 }
 
 V625TestEmptyOverlayFilter()
 {
     app := IPNewApp(),app.Offline := V625Data(),app.View := "Imported",app.Follow := true
     app.Workspace := IPWNewState(),app.Workspace.HideTrash := true
     for seg in app.Offline.Segments
         seg.BossKey := ""
     r := IPMResolve(app,3)
     V48Assert(r.Data=app.Offline && !IsObject(r.Segment),"all-hidden review does not show the last trash pull on the meters")
 }
 
 V625TestManualSourcePreserved()
 {
     app := IPNewApp(),app.Live := V625Data(),app.Offline := V625Data(),app.View := "Imported",app.Follow := true
     app.Workspace := IPWNewState()
     V48Assert(IPMResolve(app,3).Segment=app.Offline.Segments[5],"off-by-default filtering preserves saved behavior")
     app.Workspace.HideTrash := true
     V48Assert(IPMResolve(app,1).Segment=app.Live.Segments[5],"manual live source is not changed to saved")
 }
 
 V625TestPlayerSchema()
 {
     c := IPRPlayerColumns(),seen := Map()
     V48Assert(c.Titles.Length=10 && c.Widths.Length=10 && c.Order.Length=10,"one column actually removed, not merely hidden")
     for title in c.Titles
         V48Assert(!InStr(title,"Deaths - pulls"),"no ambiguous baseline label in schema")
     for col in c.Order {
         V48Assert(col>=0 && col<10 && !seen.Has(col),"valid unique native column order")
         seen[col] := true
     }
     V48Assert(c.Widths[c.Key]=0 && c.Order[2]=c.Role-1 && c.Order[6]=c.Active-1,"key hidden, role by player, Active after first deaths")
 }
 
 V625TestPlayerValues()
 {
     r := IPRSummary(IPRDemoData()),p := r.Players["@Little Bobby#101"],v := IPRPlayerValues(p,p.Key),c := IPRPlayerColumns()
     V48Assert(v.Length=c.Titles.Length && v[3]=28 && v[c.Firsts]=11,"actual deaths and first-death counts retained")
     V48Assert(v[c.Key]=p.Key && v[c.Role]="DPS" && v[c.Active]="77.1","identity, role and activity map to correct columns")
 }
 
 V625TestCopiedSummary()
 {
     d := IPRDemoData(),text := IPRReport(d,IPRSummary(d))
     V48Assert(!InStr(text,"Deaths - pulls") && !InStr(text,"`t+11`t"),"removed metric is absent from clipboard report too")
     V48Assert(InStr(text,"Little Bobby`t17`t28`t11") && InStr(text,"Times died first"),"report still provides attendance, total deaths and first deaths")
 }
 
 V625TestHiddenFightFilter()
 {
     V61Hidden(V625FightFilterCase)
 }
 V625FightFilterCase()
 {
     global IP
     u := V625Ready(),data := IP.Offline
     V625Toggle(true)
     V48Assert(u.HideTrash && IP.SegmentsLV.GetCount()=2 && IP.Selected=4,"checkbox filters rows and follows visible fight")
     V48Assert(IP.SegmentsLV.GetText(1,1)="20" && IP.SegmentsLV.GetText(2,1)="40","original numbering is not renumbered")
     V48Assert(u.Controls["FightCount"].Text="2 / 5 fights" && IP.Offline=data && data.Segments.Length=5,"hidden count shown, all data retained")
 }
 
 V625TestHiddenRowSelection()
 {
     V61Hidden(V625RowSelectionCase)
 }
 V625RowSelectionCase()
 {
     global IP
     u := V625Ready(),V625Toggle(true)
     IPChooseSegment(IP.SegmentsLV,1,true)
     V48Assert(IP.Selected=2 && !IP.Follow && IPSelectedSegment().Id=20,"first displayed row maps to original array index, not displayed ID")
     IPChooseSegment(IP.SegmentsLV,2,true)
     V48Assert(IP.Selected=4 && IPSelectedSegment().Id=40,"second filtered row selects correct original fight")
     before := IP.Selected
     IPChooseSegment(IP.SegmentsLV,3,true)
     V48Assert(IP.Selected=before,"out-of-range stale row is ignored")
 }
 
 V625TestHiddenEmptyRestore()
 {
     V61Hidden(V625EmptyRestoreCase)
 }
 V625EmptyRestoreCase()
 {
     global IP
     u := V625Ready()
     for seg in IP.Offline.Segments
         seg.BossKey := ""
     V58SelectTab(2),V625Toggle(true)
     V48Assert(IP.Selected=0 && IP.SegmentsLV.GetCount()=0 && u.Controls["FightCount"].Text="0 / 5 fights","all-hidden list retains truthful count")
     V48Assert(InStr(IP.InfoText.Text,"No recognized boss") && !IP.CopyButton.Enabled,"empty state explains filter, no stale selected-fight export")
     V625Toggle(false)
     V48Assert(IP.SegmentsLV.GetCount()=5 && IP.Selected=5 && IP.CopyButton.Enabled,"one click restores all original fights")
 }
 
 V625TestHiddenPinPreserved()
 {
     V61Hidden(V625PinCase)
 }
 V625PinCase()
 {
     global IP
     V625Ready(),IPChooseSegment(IP.SegmentsLV,2,true),V625Toggle(true)
     V48Assert(IP.Selected=2 && !IP.Follow,"toggling does not move a visible pinned boss")
     V625Toggle(false)
     V48Assert(IP.Selected=2 && !IP.Follow,"restoring hidden fights keeps pinned boss")
 }
 
 V625TestHiddenLiveRecognition()
 {
     V61Hidden(V625RecognitionCase)
 }
 V625RecognitionCase()
 {
     global IP
     u := V625Ready(),V625Toggle(true)
     IP.Offline.Segments[5].BossKey := "G-SC",IP.Offline.Segments[5].Opponent := "Scyva"
     IPRefresh()
     V48Assert(IP.SegmentsLV.GetCount()=3 && IP.Selected=5,"membership refreshes when an existing segment is recognized")
     IP.Offline.Segments[2].BossKey := "",IP.Offline.Segments[3].BossKey := "G-TY"
     IPRefresh()
     V48Assert(IP.SegmentsLV.GetCount()=3 && IP.SegmentsLV.GetText(1,1)="30","same row count with different members still rebuilds correctly")
 }
 
 V625TestIndependentSession()
 {
     V61Hidden(V625IndependentCase)
 }
 V625IndependentCase()
 {
     global IP
     V625Ready(),IPRDemo(),p := IPRState(),data := p.Data,report := IPRReport(data,p.Result)
     p.Data.Pulls[1].Included := false,p.Dirty := true,IPRDraw()
     report := IPRReport(p.Data,p.Result)
     V625Toggle(true),V625Toggle(false)
     V48Assert(p.Data=data && !data.Pulls[1].Included && IPRReport(data,p.Result)=report,"sidebar filter does not exclude raid-summary pulls or reset session data")
 }
 
 V625TestHiddenPlayerSorting()
 {
     V61Hidden(V625SortingCase)
 }
 V625SortingCase()
 {
     V61Ready(),IPRDemo(),p := IPRState(),lv := IPWState().Controls["SessionPlayers"],c := IPRPlayerColumns()
     for col in [3,c.Firsts,c.Active,c.Role] {
         IPRSort(lv,col),IPRDraw()
         key := lv.GetText(1,c.Key)
         V48Assert(p.Result.Players.Has(key) && lv.GetText(1,1)=p.Result.Players[key].Name,"sort preserves hidden player identity")
         IPRSelectPlayer(lv,1,true)
         V48Assert(p.Selected=key,"sorted row opens correct player's pull details")
     }
 }
 
 V625TestHiddenRoleRegistration()
 {
     V61Hidden(V625RoleRegistrationCase)
 }
 V625RoleRegistrationCase()
 {
     global IP,IUB
     V61Ready(),IPRDemo(),lv := IPWState().Controls["SessionPlayers"],c := IPRPlayerColumns()
     V48Assert(lv.GetCount("Col")=10 && lv.GetText(0,c.Role)="Role","native role column has correct new index")
     if IUB.RoleColors && !IUSHighContrast()
         V48Assert(IURState().Tables[lv.Hwnd].Column=c.Role,"existing color handler registered to new role column")
     V48Assert(IP.PlayersLV.GetCount("Col")=12,"selected-pull statistics columns are untouched")
 }
 
 V625TestHiddenLayout()
 {
     V61Hidden(V625LayoutCase)
 }
 V625LayoutCase()
 {
     global IP
     u := V625Ready()
     for size in [[980,650],[1220,780],[1600,1000]] {
         IPResize(IP.Gui,0,size[1],size[2])
         u.Controls["HideTrash"].GetPos(&x,&y,&w,&h)
         IP.FollowBox.GetPos(&fx,&fy,&fw,&fh)
         IP.SegmentsLV.GetPos(&lx,&ly,&lw,&lh)
         V48Assert(y>=fy+fh && ly>=y+h && x+w<=268 && lh>100,"filter row clears Follow, list and window edge in logical DPI units")
     }
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"native test does not display a window")
 }
 
 V625TestImportFilterGuard()
 {
     V61Hidden(V625ImportGuardCase)
 }
 V625ImportGuardCase()
 {
     global IP
     u := V625Ready(),IP.ImportRunning := true
     try {
         V625Toggle(true)
         V48Assert(!u.HideTrash && !u.Controls["HideTrash"].Value,"filter cannot mutate during a continuous import")
         IPImportReviewControls(u,false)
         V48Assert(!u.Controls["HideTrash"].Enabled,"import disables filter with other browsing controls")
     }
     finally {
         IP.ImportRunning := false,IPImportReviewControls(u,true)
     }
     V48Assert(u.Controls["HideTrash"].Enabled,"filter restores after import")
 }
 
 V625TestPreferenceLoad()
 {
     V61Hidden(V625PreferenceCase)
 }
 V625PreferenceCase()
 {
     global SETTINGS_FILE
     IniWrite(1,SETTINGS_FILE,"IrisWorkspace","HideTrash")
     IPWLoadPrefs()
     V48Assert(IPWState().HideTrash,"saved filter on restored")
     IniWrite(0,SETTINGS_FILE,"IrisWorkspace","HideTrash")
     IPWLoadPrefs()
     V48Assert(!IPWState().HideTrash,"saved filter off restored")
     IniDelete(SETTINGS_FILE,"IrisWorkspace","HideTrash")
     IPWLoadPrefs()
     V48Assert(!IPWState().HideTrash,"missing preference keeps existing all-fights default")
 }
 
 V625TestNoWritesInDiagnostics()
 {
     V61Hidden(V625NoWriteCase)
 }
 V625NoWriteCase()
 {
     global SETTINGS_FILE
     V625Ready(),IniWrite("keep",SETTINGS_FILE,"Unrelated","Value")
     before := FileRead(SETTINGS_FILE)
     V625Toggle(true)
     V48Assert(FileRead(SETTINGS_FILE)=before,"manual diagnostics do not persist workspace preference changes")
 }
 
 V625TestRetiredSourceSelection()
 {
     V61Hidden(V625RetiredCase)
 }
 V625RetiredCase()
 {
     global IP
     V625Ready(),V625Toggle(true),IP.Offline := V625Data(),IP.Selected := 4,IP.Follow := true
     IPChooseSegment(IP.SegmentsLV,1,true)
     V48Assert(IP.Selected=4 && IP.Follow,"old displayed rows cannot select into a replaced data object")
     IPRefresh(),IPChooseSegment(IP.SegmentsLV,1,true)
     V48Assert(IP.Selected=2 && !IP.Follow,"freshly rebuilt rows select normally")
 }
 
 V625TestAnalysisReviewRetained()
 {
     V61Hidden(V625AnalysisCase)
 }
 V625AnalysisCase()
 {
     global IP
     V625Ready(),V58SelectTab(8),a := V591Data(),data := a.Data,query := a.Query,result := a.Result,tab := a.Tab
     V625Toggle(true),V625Toggle(false)
     V48Assert(a.Data=data && a.Query=query && a.Result=result && a.Tab=tab,"list filtering neither rereads nor resets loaded Analysis")
     V48Assert(IPWState().Tab=8,"main navigation remains on Analysis")
 }
 ; v63 tests: pure metadata, native hidden review controls and temporary-file history.
 V63Segment(key := "DP-CO")
 {
     s := IPNewData("Synthetic phase test"),seg := IPNewSegment(s,0,"synthetic")
     seg.BossKey := key,seg.BossName := key,seg.AreaId := key="DP-CO" ? "137438993410" : "833571547775765"
     seg.ModeId := "836045448953655",seg.Last := 10000,seg.End := 10000
     return seg
 }
 
 V63Event(kind,id,hp := 80,at := 1000,ability := "900000000000001",playerTarget := false)
 {
     npc := "Fixture NPC {" id "}:99",player := "@Fixture Player#1"
     ev := IPParseLine(IPDemoLine(at,playerTarget ? player : npc,playerTarget ? npc : player,kind,kind="Damage" ? 100 : 0,false,-1,"Fixture ability",ability))
     ev.SourceHP := {Known:true,Current:playerTarget ? 100 : hp,Maximum:100}
     ev.TargetHP := {Known:true,Current:playerTarget ? hp : 100,Maximum:100}
     return ev
 }
 
 V63TestScopeProfiles()
 {
     seg := V63Segment(),V48Assert(IGPProfile(seg).Kind="Council","scoped Council")
     seg.ModeId := "other",V48Assert(IGPProfile(seg).Kind="HP","unsupported difficulty is HP-only")
     seg := V63Segment("G-NA"),V48Assert(IGPProfile(seg).Phases.Length=4,"Nahut has four explicit phases")
 }
 V63TestCouncilOpening()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Damage","3273993440198656"),1000)
     V48Assert(IGPCompact(s).Stage=1,"recorded council engagement")
 }
 V63TestCouncilApparitions()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Damage","3274019210002432"),1000)
     V48Assert(IGPCompact(s).Stage=2,"principal apparition opens phase two")
 }
 V63TestCouncilReturn()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Activate","3273993440198656",80,1000,"3321757771497472"),1000)
     V48Assert(IGPCompact(s).Stage=3 && !IGPCompact(s).Burn,"Fury identifies return without inventing burn")
 }
 V63TestCouncilBurn()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Activate","3273993440198656",12,1000,"3322475031035904"),1000)
     p := IGPCompact(s)
     V48Assert(p.Stage=3 && p.Burn && p.Hp=12,"recorded burn keeps phase-three identity and health")
 }
 V63TestCouncilLowest()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Activate","3273993440198656",12,1000,"3321757771497472"),1000)
     e := V63Event("Damage","3273984850264064",40,2000),e.Source.Key := "N:3273984850264064:88"
     IGPObserve(s,e,2000)
     V48Assert(IGPCompact(s).Hp=12,"lowest remaining member drives label")
 }
 V63TestDefeatedSeparate()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Activate","3273993440198656",12,1000,"3321757771497472"),1000)
     e := V63Event("Death","3273993440198656",0,2000,"900000000000001",true),IGPObserve(s,e,2000)
     IGPObserve(s,V63Event("Damage","3273984850264064",40,3000),3000)
     p := IGPCompact(s),V48Assert(p.Dead=1 && p.Hp=40 && !p.Kill,"dead member not permanent zero-percent remaining target")
 }
 V63TestUnknownRemainder()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Damage","3273993440198656"),1000)
     IGPObserve(s,V63Event("Death","3273993440198656",0,2000,"900000000000001",true),2000)
     p := IGPCompact(s),V48Assert(p.Hp<0 && !p.Comparable,"one dead member does not stand for unobserved surviving members")
 }
 V63TestNoPhaseRewind()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Activate","3273993440198656",50,1000,"3321757771497472"),1000)
     IGPObserve(s,V63Event("Damage","3274019210002432",10,2000),2000)
     V48Assert(IGPCompact(s).Stage=3,"old-phase actor cannot rewind progress")
 }
 V63TestHealthReset()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Damage","3273993440198656",12),1000)
     IGPObserve(s,V63Event("Damage","3273993440198656",100,2000),2000)
     V48Assert(IGPCompact(s).Hp=12,"same-scale wipe reset does not erase progress")
 }
 V63TestHealthScaleChange()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Damage","3273993440198656",12),1000)
     e := V63Event("Damage","3273993440198656",80,2000),e.SourceHP.Maximum := 200
     IGPObserve(s,e,2000)
     V48Assert(IGPCompact(s).Hp=40,"changed maximum starts a compatible health scale")
 }
 V63TestNoMadeUpHealth()
 {
     s := V63Segment(),e := V63Event("Damage","3273993440198656"),e.SourceHP.Known := false
     IGPObserve(s,e,1000),V48Assert(IGPCompact(s).Hp<0,"unreported health is unknown")
 }
 V63TestSameNameNotBoss()
 {
     s := V63Segment(),e := V63Event("Damage","999999999999999"),e.Source.Name := "Dread Master Raptus"
     IGPObserve(s,e,1000),V48Assert(IGPCompact(s).Stage=0,"display name is not an identity rule")
 }
 V63TestKillNotZero()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Damage","3273993440198656",0),1000)
     V48Assert(!IGPCompact(s).Kill,"zero snapshot alone is not completion")
     s.Terminal := true,s.FinishAt := 10000,V48Assert(IGPCompact(s).Kill,"existing completed encounter establishes kill")
 }
 V63TestNahutPhaseTwo()
 {
     s := V63Segment("G-NA"),IGPObserve(s,V63Event("Activate","4122949560827904",70,1000,"4131990466985984"),1000)
     V48Assert(IGPCompact(s).Stage=2,"Blackout advances supported Nahut")
 }
 V63TestNahutPhaseThree()
 {
     s := V63Segment("G-NA"),IGPObserve(s,V63Event("Damage","4131857322999808",30),1000)
     IGPObserve(s,V63Event("Activate","4122949560827904",12,2000,IGPNahutSliceId()),2000)
     V48Assert(IGPCompact(s).Stage=3 && IGPCompact(s).Hp=12,"post-coupling Slice establishes P3")
 }
 V63TestNahutSliceNotPhaseAlone()
 {
     s := V63Segment("G-NA"),IGPObserve(s,V63Event("Activate","4122949560827904",70,1000,IGPNahutSliceId()),1000)
     V48Assert(IGPCompact(s).Stage=1,"opening Slice cannot invent completed coupling phase")
 }
 V63TestNahutBurn()
 {
     s := V63Segment("G-NA"),e := V63Event("Activate","4122580193640448",80,1000,"4133502295474176")
     e.ActionId := "836045448945477",e.EffectId := "4133502295474475"
     IGPObserve(s,e,1000),V48Assert(IGPCompact(s).Stage=4,"exact gravity application establishes burn")
 }
 V63TestScyvaBackground()
 {
     s := V63Segment("G-SC"),IGPObserve(s,V63Event("Activate","4108140513591296"),1000)
     V48Assert(IGPCompact(s).Stage=0,"background Scyva cast cannot skip OPD and railguns")
 }
 V63TestScyvaEngagement()
 {
     s := V63Segment("G-SC"),IGPObserve(s,V63Event("Damage","4126527268585472"),1000)
     V48Assert(IGPCompact(s).Stage=1,"OPD")
     IGPObserve(s,V63Event("Damage","4126518678650880",50,2000),2000),V48Assert(IGPCompact(s).Stage=2,"railguns")
     IGPObserve(s,V63Event("Damage","4108140513591296",80,3000,"900000000000001",true),3000)
     V48Assert(IGPCompact(s).Stage=3,"recorded damage into vulnerable Scyva")
 }
 V63TestSnapshotCopies()
 {
     s := V63Segment(),IGPObserve(s,V63Event("Damage","3273993440198656",40),1000),p := IGPCompact(s)
     IGPObserve(s,V63Event("Damage","3273993440198656",12,2000),2000)
     V48Assert(p.Hp=40 && p.Targets[1].Low=40,"compact progress does not mutate with later records")
 }
 V63TestStageRanking()
 {
     d := IGVDemoData(),a := d.Pulls[5].Progress,b := d.Pulls[6].Progress
     V48Assert(IGPScore(b)>IGPScore(a),"later phase outranks lower earlier-phase HP")
     b.Comparable := false,V48Assert(IGPScore(b)<0,"unknown comparison creates a graph gap")
 }
 V63TestSpecificPullTotals()
 {
     d := IGVDemoData(),text := IPRDetailText(d.Pulls[1])
     V48Assert(InStr(text,"Little Bobby") && InStr(text,"Pull 1") && d.Pulls[1].Players["@Little Bobby#Prog5"].Deaths=2,"one pull, not 28-death session")
     V48Assert(d.Pulls[12].Players["@Little Bobby#Prog5"].Deaths=1,"different pull has independent deaths")
 }
 V63TestDemoFinalLabel()
 {
     d := IGVDemoData(),label := IGPLabel(d.Pulls[17].Progress)
     V48Assert(InStr(label,"P3") && InStr(label,"Raptus 12.0%") && InStr(label,"burn"),"user's example is directly inspectable")
 }
 V63TestHistoryRoundTrip()
 {
     p := IGVDemoData().Pulls[1],restored := IGVUnpackPull(ParseJson(IGVJson(IGVPackPull(p))))
     V48Assert(restored.Id=1 && restored.Players.Count=8 && restored.Deaths.Length=9,"history round trip preserves one pull")
     V48Assert(IPAPullText(restored.Players["@Little Bobby#Prog5"],"@Little Bobby#Prog5",restored)=IPAPullText(p.Players["@Little Bobby#Prog5"],"@Little Bobby#Prog5",p),"activity uses retained existing compact data")
 }
 V63TestUnicodeJSON()
 {
     input := ["Raïd \" Chr(34) " Α","紫",[1,12.5]],parsed := ParseJson(IGVJson(input))
     V48Assert(parsed[1]=input[1] && parsed[2]=input[2] && parsed[3][2]=12.5,"Unicode and escaping round trip")
 }
 V63TestHistoryBadShape()
 {
     caught := false
     try IGVUnpackPull([1,2,3])
     catch Error
         caught := true
     V48Assert(caught,"truncated history is rejected")
 }
 V63TestHistoryBadBounds()
 {
     packed := IGVPackPull(IGVDemoData().Pulls[1]),packed[7] := packed[6]-1,caught := false
     try IGVUnpackPull(packed)
     catch Error
         caught := true
     V48Assert(caught,"backward history interval rejected")
 }
 V63TestHistoryIdentity()
 {
     a := IGVSourceIdentity("C:\logs\combat_2026-09-27_21_00_17_956183.txt")
     b := IGVSourceIdentity("D:\copy\Archive-combat_2026-09-27_21_00_17_956183.txt")
     V48Assert(a.Date="20260927" && a.Session=b.Session,"archive/copy does not create a new recording")
 }
 V63TestHistoryResave()
 {
     p := IGVDemoData().Pulls[1],h := IGVAddHistory(Map(),[p],"fixture","20260927","Team A")
     h := IGVAddHistory(h,[p],"fixture","20260927","Team A")
     V48Assert(h.Count=1,"same pull updates, not duplicates")
 }
 V63TestCharacterTeamFilter()
 {
     d := IGVDemoData(),rows := []
     for i,p in d.Pulls
         rows.Push({Key:i "",Date:"20260927",Team:i<=9 ? "A" : "B",Pull:p})
     V48Assert(IGVSelectEntries(rows,d.Pulls[1].Group,"@Little Bobby#Prog5","A").Length=9,"explicit team plus participating character")
     V48Assert(IGVSelectEntries(rows,d.Pulls[1].Group,"@Absent#0","*").Length=0,"absent character excluded")
 }
 V63TestHistoryStableOrder()
 {
     d := IGVDemoData(),rows := [{Key:"b",Date:"20260927",Team:"",Pull:d.Pulls[2]},{Key:"a",Date:"20260927",Team:"",Pull:d.Pulls[1]}]
     ordered := IGVSort(rows),V48Assert(ordered[1].Pull.Id=1 && rows[1].Pull.Id=2,"chronological sort without mutating source")
 }
 V63TestHistoryFileRoundTrip()
 {
     path := A_Temp "\Iris_v63_history_fixture_" A_TickCount ".json",p := IGVDemoData().Pulls[1]
     try {
         h := IGVAddHistory(Map(),[p],"fixture","20260927","Explicit test team")
         IGVWriteHistory(h,path),V48Assert(IGVReadHistory(path).Count=1,"temporary history validates")
         IGVWriteHistory(h,path),V48Assert(FileExist(path ".bak"),"previous valid snapshot backed up")
     }
     finally {
         for f in [path,path ".bak"] {
             if FileExist(f)
                 FileDelete(f)
         }
     }
 }
 V63TestFightCard()
 {
     s := V63Segment(),s.BossName := "Dread Council",s.Start := 495000,s.Last := 655000
     card := IGFCard(s)
     V48Assert(InStr(card.Title,"Dread Council") && InStr(card.Title,"8 NiM") && InStr(card.Detail,"00:08:15"),"two-line card uses recorded identity/time")
 }
 V63TestHiddenPullWindow()
 {
     V61Hidden(V63HiddenPullCase)
 }
 V63HiddenPullCase()
 {
     IPWBuild(),p := IPRState(),data := IGVDemoData()
     IPROpenPull(data.Pulls[1])
     V48Assert(p.DetailPlayers.GetCount()=8 && p.DetailTable.GetCount()=9,"all players and repeat deaths in exact-pull window")
     V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.DetailGui.Hwnd),"diagnostic never shows the review")
     p.DetailPlayer := "@Little Bobby#Prog5",IPRDetailDeathRows()
     V48Assert(p.DetailTable.GetCount()=2,"selected player gets only their own deaths")
     IPRCloseDetails()
 }
 V63TestHiddenGraphWindow()
 {
     V61Hidden(V63HiddenGraphCase)
 }
 V63HiddenGraphCase()
 {
     oldDetail := IGVState().DetailVisible
     IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IGVDemoData(),IGVOpen(),v := IGVState()
     try {
         v.DetailVisible := false,IGVRefresh()
         V48Assert(v.Rows.Length=17 && !v.TableReady && v.Controls["Rows"].GetCount()=0,"collapsed table stays lazy without discarding graph pulls")
         v.DetailVisible := true,IGVRefresh()
         V48Assert(v.Rows.Length=17 && v.Controls["Rows"].GetCount()=17,"all synthetic pulls have graph rows")
         V48Assert(v.Controls["Rows"].GetText(17,3)="5.0% combined HP remaining","native table shows the last pull's observed weighted boss health")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",v.Gui.Hwnd),"hidden graph in diagnostics")
     }
     finally IGVClose(),v.DetailVisible := oldDetail
 }
 V63TestNativeFightListBackings()
 {
     V61Hidden(V63FightListCase)
 }
 V63FightListCase()
 {
     global IP
     IPWBuild(),s := IPNewData("card fixture"),a := IPNewSegment(s,1000,"synthetic"),a.BossKey := "A",a.BossName := "First"
     a.Last := 2000,a.End := 2000,s.Current := "",b := IPNewSegment(s,3000,"synthetic"),b.BossKey := "B",b.BossName := "Second",b.Last := 4000,b.End := 4000
     IPWUpdateFights(s,[1,2])
     V48Assert(IP.SegmentsLV.GetCount("Col")=3 && IP.SegmentsLV.GetText(2,1)=b.Id,"native backing schema and original IDs preserved")
 }
 
 ; v64.3: geometry and data policy tests for the compact plot (no real log needed).
 V631Entries()
 {
     out := []
     for i,p in IGVDemoData().Pulls
         out.Push({Key:"demo|" i,Date:"20260927",Team:i<=9 ? "A" : "B",Pull:p})
     return out
 }
 V631Signature(entries)
 {
     rows := []
     for e in entries
         rows.Push([e.Key,e.Date,e.Team,IGVPackPull(e.Pull,false)])
     return IGVJson(rows)
 }
 V631TestEmptyPlot()
 {
     m := IGVPlotModel([],900,250)
     V48Assert(m.Count=0 && m.Points.Length=0 && m.Ticks.Length=0 && IGVHitIndex(m,400)=0,"empty chart has no invented pull")
 }
 V631TestSinglePlot()
 {
     rows := [V631Entries()[1]],m := IGVPlotModel(rows,900,250)
     V48Assert(m.Points[1].X=(m.Left+m.Right)/2 && m.Ticks.Length=1,"single pull centered")
     V48Assert(IGVHitIndex(m,m.Points[1].X,m.Points[1].Y)=1,"single point hit")
 }
 V631TestLowerFurther()
 {
     m := IGVPlotModel(V631Entries(),900,250)
     V48Assert(m.Points[6].Y>m.Points[5].Y && m.Points[14].Y>m.Points[13].Y,"lower observed boss HP travels downward")
     V48Assert(m.Points[17].Y>m.Points[14].Y && Abs(m.Points[17].Y-(m.Top+0.95*(m.Bottom-m.Top)))<0.001,"5 percent boss HP plots below 19 percent despite the same recorded Burn phase")
 }
 V631TestBestPlateau()
 {
     m := IGVPlotModel(V631Entries(),900,250)
     V48Assert(m.Points[8].Score<m.Points[7].Score && m.Points[8].Best=m.Points[7].Best,"higher remaining HP does not move best backwards")
     V48Assert(m.Points[16].Best=m.Points[15].Best && m.BestIndex=17,"17 percent retains the earlier 13 percent best until the last 5 percent pull improves it")
 }
 V631TestPhaseMilestones()
 {
     rows := V631Entries(),before := V631Signature(rows),m := IGVPlotModel(rows,900,250),phase := IGPCBuild(rows,rows[1].Pull.Group)
     V48Assert(m.Milestones.Length=0 && m.Axis.Percent,"mechanic-stage milestones are not added to the HP scale")
     V48Assert(phase.Rows.Length=4 && phase.Rows[1].Name="Council" && phase.Rows[2].Name="Brontes and Styrak" && phase.Rows[3].Name="Council 2" && phase.Rows[4].Name="Burn","recorded repeated phases remain independently available in the phase summary")
     V48Assert(V631Signature(rows)=before,"both views preserve recorded phase and health evidence")
 }
 V631TestUnknownGap()
 {
     rows := V631Entries(),rows[7].Pull.Progress.Health.Comparable := false,m := IGVPlotModel(rows,900,250)
     V48Assert(!m.Points[7].Known && m.Points[7].Y=-1 && m.Unknown=1,"invalid current health is a gap despite old phase-local HP and recorded phases")
     V48Assert(m.Points[7].Best=m.Points[6].Best && m.Points[8].Known,"best retained through gap, later valid point survives")
 }
 V631TestMappingNotMixed()
 {
     rows := V631Entries(),rows[5].Pull.Progress.Health.Targets[1].Npc := "9999999999999999",before := V631Signature(rows),m := IGVPlotModel(rows,900,250)
     V48Assert(!m.Points[5].Known && m.MappingMismatch=1 && m.Unknown=1,"health from a different boss target cannot share the encounter scale")
     V48Assert(m.Points[4].Known && m.Points[6].Known && V631Signature(rows)=before,"one invalid identity neither hides other pulls nor rewrites evidence")
 }
 V631TestKillBottom()
 {
     rows := V631Entries(),rows[17].Pull.Progress.Kill := true,m := IGVPlotModel(rows,900,250)
     V48Assert(m.Points[17].Kill && Abs(m.Points[17].Y-m.Bottom)<0.001,"confirmed kill is bottom milestone")
 }
 V631TestClickBounds()
 {
     m := IGVPlotModel(V631Entries(),900,250)
     V48Assert(IGVHitIndex(m,m.Left-1,m.Top)=0 && IGVHitIndex(m,m.Right+1,m.Top)=0,"outside left/right ignored")
     V48Assert(IGVHitIndex(m,m.Left,m.Top-1)=0 && IGVHitIndex(m,m.Right,m.Bottom+1)=0,"outside top/bottom ignored")
     for point in m.Points
         V48Assert(IGVHitIndex(m,point.X,point.Y)=point.Index,"each point resolves to its exact pull")
 }
 V631TestScaledPlot()
 {
     for z in [1,1.5,2] {
         m := IGVPlotModel(V631Entries(),Round(920*z),Round(257*z),z)
         V48Assert(m.Left<m.Right && m.Top<m.Bottom && m.Bottom<m.Height,"DPI-scaled plot region")
         for point in m.Points
             V48Assert(point.X>=m.Left && point.X<=m.Right && point.Y>=m.Top && point.Y<=m.Bottom,"scaled points remain inside bitmap")
     }
 }
 V631TestCompactLayout()
 {
     for size in [[900,490],[960,510],[1220,800]] {
         l := IGVLayout(size[1],size[2],false)
         V48Assert(137+l.ChartH<l.SelectedY && l.SelectedY+38<l.ButtonY,"chart, label and actions do not overlap")
         V48Assert(l.ButtonY+41<=size[2],"compact actions fit client")
     }
 }
 V631TestExpandedLayout()
 {
     for size in [[900,560],[960,670],[1220,900]] {
         l := IGVLayout(size[1],size[2],true)
         V48Assert(l.RowsY>=l.ButtonY+43 && l.RowsY+l.RowsH<=size[2],"expanded table stays below actions and inside client")
     }
 }
 V631TestTeamAndCharacter()
 {
     rows := V631Entries(),key := "@Little Bobby#Prog5",group := rows[1].Pull.Group
     V48Assert(IGVSelectEntries(rows,group,key,"B").Length=8,"team B contains eight attended attempts")
     rows[10].Pull.Players.Delete(key)
     V48Assert(IGVSelectEntries(rows,group,key,"B").Length=7,"absent player never inherits an extra attempt")
     V48Assert(IGVSelectEntries(rows,group,"","B").Length=8,"whole team still sees that pull")
 }
 V631TestExclusions()
 {
     rows := V631Entries(),rows[1].Pull.Included := false
     V48Assert(IGVSelectEntries(rows).Length=16 && rows.Length=17,"exclusion only projects data, never deletes source")
 }
 V631TestExactPointLabel()
 {
     label := IGVPointLabel(V631Entries()[1],1,"@Little Bobby#Prog5")
     V48Assert(InStr(label,"Pull 1") && InStr(label,"2 deaths") && InStr(label,"77.1"),"one-pull labels are not session totals")
 }
 V631TestRepeatedNamesSeparate()
 {
     rows := V631Entries(),p := rows[1].Pull
     person := p.Players["@Little Bobby#Prog5"].Clone(),person.Key := "@Little Bobby#Other"
     p.Players[person.Key] := person
     V48Assert(IGVSelectEntries(rows,p.Group,person.Key).Length=1,"identical labels do not merge characters")
 }
 V631TestGraphNativeBitmap()
 {
     V61Hidden(V631GraphBitmapCase)
 }
 V631GraphBitmapCase()
 {
     IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IGVDemoData(),IGVOpen(),v := IGVState()
     try {
         before := v.DrawFailures,IGVDraw()
         bitmap := SendMessage(0x172,0,0,v.Controls["Chart"])
         V48Assert(bitmap!=0 && DllCall("Gdi32\GetObjectType","Ptr",bitmap,"UInt")=7,"actual HBITMAP attached to compact graph")
         V48Assert(v.DrawFailures=before && v.Plot.Count=17,"native graph render did not fall back")
         V48Assert(!v.DetailVisible && !v.Controls["Rows"].Visible,"table initially collapsed")
     }
     finally IGVClose()
 }
 V631TestSelectDoesNotFilterSession()
 {
     V61Hidden(V631SelectCase)
 }
 V631SelectCase()
 {
     IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IGVDemoData(),p.Filter := "",p.Selected := "",IGVOpen()
     try {
         IGVSelect(3),v := IGVState()
         V48Assert(v.Selected=3 && InStr(v.Controls["Selected"].Text,"Pull 3"),"selected point label")
         V48Assert(p.Filter="" && p.Selected="" && p.Data.Pulls.Length=17,"point selection does not rewrite raid summary")
     }
     finally IGVClose()
 }
 V631TestCurrentSourceFreshness()
 {
     V61Hidden(V631FreshCase)
 }
 V631FreshCase()
 {
     global IP
     p := IPRState(),p.Source := "loaded",p.Data := IGVDemoData()
     IP.View := "Imported",IP.Offline := IPNewData("replacement source"),d := IGVCurrentData()
     V48Assert(d.Pulls.Length=0 && !d.Demo,"current graph does not display old session under a new source label")
 }
 V631TestGraphCloseReleasesHook()
 {
     V61Hidden(V631CloseCase)
 }
 V631CloseCase()
 {
     IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IGVDemoData(),IGVOpen(),v := IGVState()
     V48Assert(v.HoverHook,"graph mouse observers installed only for open window")
     IGVClose()
     V48Assert(!v.HoverHook && !IsObject(v.Gui) && !IsObject(v.Plot),"closing graph retires pointer targets and mouse observers")
 }
 V631TestCharacterOpensSpecificDeaths()
 {
     V61Hidden(V631CharacterPullCase)
 }
 V631CharacterPullCase()
 {
     IPWBuild(),p := IPRState(),d := IGVDemoData()
     try {
         IPROpenPull(d.Pulls[1],"@Little Bobby#Prog5")
         V48Assert(p.DetailPlayer="@Little Bobby#Prog5" && p.DetailTable.GetCount()=2,"graph's selected character opens only their deaths on that one pull")
         V48Assert(p.DetailPull.Id=1 && p.DetailPlayers.GetCount()=8,"whole roster remains available within selected pull")
     }
     finally IPRCloseDetails()
 }
 
 ; v64.3 regression tests. Executed only by the existing isolated diagnostic suite.
 V632TestShutdownWithoutWindows()
 {
     V61Hidden(V632ShutdownWithoutWindowsCase)
 }
 
 V632ShutdownWithoutWindowsCase()
 {
     global IP
     IGFShutdown()
     live := IP.Live, offline := IP.Offline
     IP.Active := true, IP.Timer := true, IP.PumpPeriod := 10, IP.ImportCancelRequested := true
     V48Assert(IPShutdown()=0,"shutdown permits subsequent OnExit callbacks")
     V48Assert(!IP.Active && !IP.Timer && IP.PumpPeriod=0 && !IP.ImportCancelRequested && !IsObject(IP.ImportFile),"parser work flags cleared")
     V48Assert(IGFState().Lists.Count=0 && !IsObject(IGVState().Gui) && !IGVState().HoverHook,"unused graph and list cleanup is inert")
     V48Assert(IP.Live=live && IP.Offline=offline,"shutdown does not erase retained datasets")
     V48Assert(IPShutdown()=0,"repeated shutdown remains safe without windows")
 }
 
 V632TestShutdownReachesGraphAndFightList()
 {
     V61Hidden(V632ShutdownResourcesCase)
 }
 
 V632ShutdownResourcesCase()
 {
     global IP
     IGFShutdown()
     try {
         IPWBuild()
         p := IPRState(), p.Source := "demo", p.Data := IGVDemoData()
         IGVOpen()
         v := IGVState(), lv := IP.SegmentsLV, hwnd := lv.Hwnd
         V48Assert(IGFState().Lists.Has(hwnd) && IsObject(v.Gui) && v.HoverHook,"fixture has a real styled fight list and hidden graph with mouse observers")
         entry := IGFState().Lists[hwnd], bold := entry.Bold, normal := entry.Normal, oldImages := entry.OldImages, graphHwnd := v.Gui.Hwnd
         V48Assert(DllCall("Gdi32\GetObjectType","Ptr",bold,"UInt")=6 && DllCall("Gdi32\GetObjectType","Ptr",normal,"UInt")=6,"fixture owns actual native font handles")
         V48Assert(IPShutdown()=0,"shutdown reaches cleanup then returns zero")
         V48Assert(IGFState().Lists.Count=0,"fight-list cleanup is reached through IPShutdown, not only called directly in the test")
         V48Assert(SendMessage(0x1002,1,0,lv)=oldImages,"previous small image list restored before spacer destruction")
         V6310AssertCleanup(entry,"workspace shutdown")
         V48Assert(!DllCall("User32\IsWindow","Ptr",graphHwnd,"Int") && !IsObject(v.Gui),"open graph window destroyed")
         V48Assert(!v.HoverHook && !IsObject(v.Plot) && v.Controls.Count=0 && v.Rows.Length=0,"graph pointer targets and mouse observers retired")
         V48Assert(IPShutdown()=0 && IGFState().Lists.Count=0,"resource shutdown can be repeated")
     }
     finally IGFShutdown()
 }
 
 V632TestShutdownAfterFightWindowDestroyed()
 {
     V61Hidden(V632ShutdownDestroyedCase)
 }
 
 V632ShutdownDestroyedCase()
 {
     IGFShutdown()
     g := ""
     try {
         g := Gui(), lv := g.AddListView("w240 h140 -Multi",["Fight","Seconds","Origin","Key"])
         V48Assert(IGFRegister(lv),"private hidden fight-list fixture registered")
         hwnd := lv.Hwnd, entry := IGFState().Lists[hwnd]
         g.Destroy(), g := ""
         V48Assert(IPShutdown()=0 && !IGFState().Lists.Has(hwnd),"shutdown releases registration after the window is already gone")
         V6310AssertCleanup(entry,"already-destroyed window shutdown")
     }
     finally {
         IGFShutdown()
         if IsObject(g)
             g.Destroy()
     }
 }
 
 ; v64.3: manual-only session capacity regressions; synthetic data, no gameplay.
 V633TestUnlimitedDefaults()
 {
     s := IPNewData()
     V48Assert(s.MaxSegments=0 && s.MaxRows=0,"zero disables cumulative session budgets")
     V48Assert(s.Segments.Length=0 && !s.Halted && !s.Partial,"unlimited is not preallocated storage or a running parser")
 }
 
 V633TestMoreThanSixtyPulls()
 {
     path := V61ScanFixture(80)
     try {
         s := V596Direct(FileRead(path,"UTF-8"))
         V48Assert(s.Segments.Length=80 && s.Lines=720 && !s.Halted,"ordinary parser retains eighty parsed encounters without eviction")
         d := IPRFromLoaded(s),b := IPRSummary(d).Players["@Bobby#101"]
         V48Assert(b.Pulls=80 && b.Deaths=160,"all pulls and resurrection deaths survive past old cutoff")
         V48Assert(s.Segments[1].Id=1 && s.Segments[80].Id=80,"first and last identities remain available")
     }
     finally {
         if FileExist(path)
             FileDelete(path)
     }
 }
 
 V633TestOrdinaryImporterPastSixty()
 {
     path := V61ScanFixture(80)
     try V596WithImport(FileRead(path,"UTF-8"),V633ImportCase)
     finally {
         if FileExist(path)
             FileDelete(path)
     }
 }
 
 V633ImportCase(path)
 {
     global IP
     oldLive := IP.Live,original := FileRead(path,"UTF-8")
     IPImportRun()
     V48Assert(IP.ImportDone && IP.ImportTiming.Outcome="COMPLETE" && !IP.Offline.Halted,"normal continuous importer reaches snapshot EOF")
     V48Assert(IP.Offline.Segments.Length=80 && IP.Offline.Lines=720,"normal importer reads beyond sixty encounters")
     V48Assert(IP.Live=oldLive && FileRead(path,"UTF-8")=original,"live data and original log unchanged")
 }
 
 V633TestCumulativeRowsDisabled()
 {
     s := V61Base(),seg := s.Current,s.Rows := 60000
     ev := IPParseLine(IPDemoLine(1000,"@Budget Test#6331",V51Target(),"Damage",100))
     IPAggregate(s,seg,ev.Source,ev.Target,"Damage",ev)
     V48Assert(s.Rows=60001 && seg.Rows.Count=1 && !s.Halted,"counter-boundary fixture crosses old aggregate row budget")
     for key,row in seg.Rows
         V48Assert(row.Total=100 && row.N=1,"crossing budget does not change aggregation")
     IPAggregate(s,seg,ev.Source,ev.Target,"Damage",ev)
     V48Assert(s.Rows=60001 && seg.Rows.Count=1,"repeated ability still aggregates rather than creates raw event rows")
 }
 
 V633TestExplicitSegmentBudget()
 {
     s := IPNewData(),s.MaxSegments := 1
     first := IPNewSegment(s,0,"test"),first.Last := 10,IPCloseSegment(s,"test")
     second := IPNewSegment(s,20,"test")
     V48Assert(!IsObject(second) && s.Halted && s.Partial && s.Segments.Length=1,"explicit diagnostic budget still fails visibly without eviction")
 }
 
 V633TestExplicitRowBudget()
 {
     s := V61Base(),seg := s.Current,s.MaxRows := 1
     a := IPParseLine(IPDemoLine(1000,"@Budget Test#6331",V51Target(),"Damage",100))
     IPAggregate(s,seg,a.Source,a.Target,"Damage",a)
     a.AbilityId := "633000000000002"
     IPAggregate(s,seg,a.Source,a.Target,"Damage",a)
     V48Assert(s.Halted && s.Partial && seg.Partial && s.Rows=1,"explicit test row budget remains available")
 }
 
 V633TestScanBeyond4096()
 {
     s := IPNewData(),j := {State:s,Data:IPRNewData(),MaxPulls:0}
     ; Small complete synthetic segments exercise real compaction, not a fake array length.
     Loop 4097 {
         seg := IPNewSegment(s,A_Index*20,"synthetic retention fixture")
         seg.Last := seg.Start+10,IPCloseSegment(s,"synthetic closed")
         IPRDrain(j,true)
     }
     V48Assert(j.Data.Pulls.Length=4097 && s.Segments.Length=0 && !s.Halted,"compact scanning has no default pull-count ceiling")
     V48Assert(j.Data.Pulls[1].Id=1 && j.Data.Pulls[4097].Id=4097,"compaction retains first and last entries")
 }
 
 V633TestScanCumulativeCounters()
 {
     s := V61Base(),V61Apply(s,1000,"Death"),V61Finish(s)
     d := IPRNewData(),d.StoredDeaths := 100000,d.StoredParticipants := 100000
     j := {State:s,Data:d,MaxPulls:0}
     IPRDrain(j,true)
     V48Assert(d.Pulls.Length=1 && d.StoredDeaths=100001 && d.StoredParticipants=100001,"counter-boundary fixture has no implicit cumulative scan ceiling")
     V48Assert(s.Segments.Length=0,"successful compact result is committed before detail released")
 }
 
 V633TestExplicitScanBudgets()
 {
     for field in ["MaxDeaths","MaxParticipants"] {
         s := V61Base(),V61Apply(s,1000,"Death"),V61Finish(s)
         d := IPRNewData(),d.StoredDeaths := 1,d.StoredParticipants := 1
         j := {State:s,Data:d,MaxPulls:0},j.%field% := 1,caught := false
         try IPRDrain(j,true)
         catch Error
             caught := true
         V48Assert(caught && d.Pulls.Length=0 && s.Segments.Length=1,"explicit " field " rejects before source release")
     }
 }
 
 V633TestCurrentPullNotEvicted()
 {
     s := V61Base(),cur := s.Current,j := {State:s,Data:IPRNewData(),MaxPulls:0}
     IPRDrain(j,true)
     V48Assert(s.Current=cur && s.Segments.Length=1 && !j.Data.Pulls.Length,"uncapped scan cannot discard a live current segment")
 }
 
 V633TestFilterKeepsAllStoredFights()
 {
     s := IPNewData()
     Loop 100 {
         seg := IPNewSegment(s,A_Index*20,"synthetic filter test")
         if Mod(A_Index,2)=0
             seg.BossKey := "G-TY"
         seg.Last := seg.Start+10,IPCloseSegment(s,"test")
     }
     all := IPWFightIndices(s,false),bosses := IPWFightIndices(s,true)
     V48Assert(all.Length=100 && bosses.Length=50 && s.Segments.Length=100,"trash filter does not alter uncapped storage")
     V48Assert(bosses[50]=100 && IPWFightSelection(bosses,62,false)=62,"filtered selection beyond sixty maps to real original segment")
 }
 
 V633TestPartialStillDisclosed()
 {
     s := V61Base(),V61Apply(s,1000,"Death"),V61Finish(s)
     s.ProgressionComplete := false
     V48Assert(!IPRFromLoaded(s).Complete,"unlimited retention does not claim canceled data is complete")
     s.ProgressionComplete := true,s.Halted := true
     V48Assert(!IPRFromLoaded(s).Complete,"actual parser halt remains incomplete")
 }
 
 V633TestHistoryOver12000()
 {
     ; Optional-history count is uncapped, but byte-size/schema/atomic-write checks remain.
     path := A_Temp "\Iris_v633_history_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount ".json"
     s := IPNewData(),seg := IPNewSegment(s,0,"synthetic small history"),seg.Last := 1
     IPCloseSegment(s,"synthetic"),pull := IPRCompact(seg),h := Map()
     Loop 12001 {
         key := "fixture-" A_Index
         h[key] := {Key:key,Session:"synthetic",Date:"20260928",Team:"",Pull:pull}
     }
     V639HistoryStage("12,001 synthetic entries ready; writing and verifying temporary history.")
     try {
         began := IrisTestNow()
         IGVWriteHistory(h,path)
         V639HistoryStage("Write / verification returned in " (IrisTestNow()-began) " ms; starting explicit reread.")
         loaded := IGVReadHistory(path)
         V639HistoryStage("Explicit reread returned; checking all 12,001 entries.")
         V48Assert(loaded.Count=12001,"compact local history can round-trip beyond old count ceiling")
     }
     finally {
         for f in [path,path ".bak",path ".tmp-" DllCall("GetCurrentProcessId","UInt")] {
             if FileExist(f)
                 FileDelete(f)
         }
     }
 }
 
 ; Labels only: no new encounter, phase, completion or role rules are implied.
 V633TestModeLabelsAgree()
 {
     for row in [["836045448953651","8-player Story","8 SM"],
         ["836045448953652","8-player Veteran","8 HM"],
         ["836045448953653","16-player Story","16 SM"],
         ["836045448953654","16-player Veteran","16 HM"],
         ["836045448953655","8-player Master","8 NiM"]] {
         V48Assert(IPRModeLabel(row[1])=row[2],"existing recorded area-mode label")
         V48Assert(IGFMode(row[1])=row[3],"fight card agrees with raid summary")
     }
 }
 
 V633TestModeUnknownNotGuessed()
 {
     for id in ["836045448953649","836045448953650","unknown-mode"]
         V48Assert(IGFMode(id)=IPRModeLabel(id),"unsupported mode stays explicit rather than inferred from neighbouring IDs")
     V48Assert(IGFMode("")="","absent mode does not get a default raid size")
     V48Assert(IGFMode("836045448953656")="16 NiM","retain pre-existing sixteen-player Master card label")
 }
 
 V633TestModeCardLabels()
 {
     seg := V63Segment(),seg.BossName := "Fixture",seg.ModeId := "836045448953652"
     card := IGFCard(seg)
     V48Assert(InStr(card.Title,"(8 HM)") && !InStr(card.Title,"16 HM"),"eight-player Veteran is not labelled sixteen-player")
     seg.ModeId := "836045448953653"
     V48Assert(InStr(IGFCard(seg).Title,"(16 SM)"),"sixteen-player Story is a recognized display mode")
 }
 
 V633TestAgeDoesNotRejectImport()
 {
     s := IPNewData("combat_2014-01-01_00_00_00_000001.txt")
     IPFeedLine(s,IPDemoLine(1000,"@Legacy#6332",V51Target(),"Damage",100))
     IPCloseSegment(s,"synthetic file end")
     V48Assert(s.Segments.Length=1 && s.Segments[1].Totals["@Legacy#6332"].Damage=100,"old filename does not age-reject otherwise supported records")
     V48Assert(!s.Halted,"this is a supported-line fixture, not certification of every historical log format")
 }
 
 V633TestSixteenModeScopePreserved()
 {
     ; Existing sixteen-player profiles remain supported; missing ones are not fabricated.
     c := {AreaId:"945872057669593",ModeId:"836045448953654"}
     rule := IPXActorRule(IPActor("Queen {4204772982784000}:6333"),c)
     V48Assert(IsObject(rule) && rule.Key="QUEEN","existing sixteen-player Veteran Queen recognition retained")
     c := {AreaId:"137438993402",ModeId:"836045448953656"}
     V48Assert(!IsObject(IPXScopedProfile(c,"DF-NE")),"label correction does not apply eight-player-only completion rules to sixteen-player Master")
 }
 
 ; v64.3 tests are inert comment data until the user runs the existing diagnostics.
 V634Event(name,hp,maximum := 1000,at := 1000,kind := "Damage",instance := "99")
 {
     id := name="Aivela" ? "4088525397950464" : "4088538282852352"
     actor := name " {" id "}:" instance "|(0,0,0,0)|(" hp "/" maximum ")"
     ev := IPParseLine(IPDemoLine(at,"@Fixture Player#1|(0,0,0,0)|(1000/1000)",actor,kind="Other" ? "Activate" : kind,kind="Damage" ? 10 : 0))
     if kind="Other"
         ev.Kind := "Other"
     return ev
 }
 V634Pair(a,e,maxA := 1000,maxE := 1000)
 {
     seg := V63Segment("G-AE")
     IGPObserve(seg,V634Event("Aivela",a,maxA,1000),1000)
     IGPObserve(seg,V634Event("Esne",e,maxE,1100),1100)
     return seg
 }
 V634Entries(progress)
 {
     p := IGVDemoData().Pulls[1],p.Boss := "G-AE",p.Name := "Aivela and Esne"
     p.Area := "833571547775765",p.Group := p.Boss "|" p.Area "|" p.Mode,p.Progress := progress
     return [{Key:"fixture",Date:"20260927",Team:"Test team",Pull:p}]
 }
 V634TestSistersScoped()
 {
     s := V63Segment("G-AE"),V48Assert(IGPProfile(s).Kind="Sisters" && IGPExpected(IGPProfile(s),1)=2,"Sisters has its own supported two-target profile")
     s.ModeId := "836045448953656",V48Assert(IGPProfile(s).Kind="HP","sixteen-player coverage is not silently broadened")
     s.ModeId := "836045448953655",s.AreaId := "wrong",V48Assert(IGPProfile(s).Kind="HP","area guard retained")
 }
 V634TestUserComparison()
 {
     good := IGPCompact(V634Pair(150,150)),bad := IGPCompact(V634Pair(140,370))
     V48Assert(Abs(good.Hp-15)<0.000001 && Abs(bad.Hp-25.5)<0.000001,"equal maxima: 15/15 beats 14/37")
     V48Assert(IGPScore(good)>IGPScore(bad),"both sisters determine progression rank")
 }
 V634TestWeightedMaxima()
 {
     q := IGPCompact(V634Pair(200,150,2000,1000))
     V48Assert(Abs(q.Hp-100*350/3000)<0.000001,"combine raw HP with unequal recorded maxima")
 }
 V634TestNoForcedPushThreshold()
 {
     a := IGPCompact(V634Pair(140,140)),b := IGPCompact(V634Pair(150,150))
     V48Assert(a.Hp=14 && IGPScore(a)>IGPScore(b),"14 percent is not clamped to the strategy's 15 percent")
 }
 V634TestOrderIndependent()
 {
     a := V634Pair(150,370),b := V63Segment("G-AE")
     IGPObserve(b,V634Event("Esne",370),1000),IGPObserve(b,V634Event("Aivela",150,1000,1100),1100)
     V48Assert(IGPCompact(a).Hp=IGPCompact(b).Hp,"either target can be observed first")
 }
 V634TestMissingSister()
 {
     s := V63Segment("G-AE"),IGPObserve(s,V634Event("Aivela",150),1000),q := IGPCompact(s)
     V48Assert(!q.Comparable && q.Hp<0 && IGPScore(q)<0,"one known sister does not make a combined sample")
 }
 V634TestMissingMaximum()
 {
     s := V63Segment("G-AE"),e := V634Event("Aivela",150),e.TargetHP := {Known:false,Current:0,Maximum:0}
     IGPObserve(s,e,1000),IGPObserve(s,V634Event("Esne",150,1000,1100),1100)
     V48Assert(!IGPCompact(s).Comparable,"no invented 100 percent for missing data")
 }
 V634TestUnengagedSnapshots()
 {
     s := V63Segment("G-AE")
     IGPObserve(s,V634Event("Aivela",150,1000,1000,"Other"),1000)
     IGPObserve(s,V634Event("Esne",150,1000,1100,"Other"),1100)
     V48Assert(IGPCompact(s).Stage=0 && !IGPCompact(s).Comparable,"pre-engagement snapshots do not create progress")
 }
 V634TestOtherNPCExcluded()
 {
     s := V634Pair(150,150),before := IGPCompact(s).Hp
     IGPObserve(s,V63Event("Damage","4101564918661120",1,1200),1200)
     V48Assert(IGPCompact(s).Hp=before && IGPCompact(s).Targets.Length=2,"countermeasures are not a third sister")
 }
 V634TestSameScaleReset()
 {
     s := V634Pair(150,150)
     IGPObserve(s,V634Event("Aivela",1000,1000,1200),1200)
     IGPObserve(s,V634Event("Esne",1000,1000,1300),1300)
     V48Assert(IGPCompact(s).Hp=15,"same-scale reset retains best paired observation")
 }
 V634TestNotIndependentMinima()
 {
     s := V634Pair(100,800)
     IGPObserve(s,V634Event("Aivela",700,1000,1200),1200)
     IGPObserve(s,V634Event("Esne",100,1000,1300),1300)
     q := IGPCompact(s)
     V48Assert(q.Hp=40 && q.Targets[1].Last=70 && q.Targets[2].Last=10,"not a fictional 10/10 pair")
 }
 V634TestStaleSnapshot()
 {
     s := V634Pair(500,500)
     IGPObserve(s,V634Event("Aivela",10,1000,900),900)
     V48Assert(IGPCompact(s).Hp=50,"older same-actor snapshot cannot replace newer state")
 }
 V634TestScaleChangeUnknown()
 {
     s := V634Pair(150,150)
     IGPObserve(s,V634Event("Aivela",100,2000,1200),1200)
     q := IGPCompact(s),V48Assert(!q.Comparable && q.Partial && InStr(q.Evidence,"maximum HP changed"),"different health scales do not share a false baseline")
 }
 V634TestDuplicateInstanceUnknown()
 {
     s := V634Pair(150,150)
     IGPObserve(s,V634Event("Aivela",10,1000,1200,"Damage","100"),1200)
     V48Assert(!IGPCompact(s).Comparable && IGPSistersName("4088525397950464")="Aivela","two instances are not merged")
 }
 V634TestOneSisterDeath()
 {
     s := V634Pair(150,370)
     IGPObserve(s,V634Event("Aivela",150,1000,1200,"Death"),1200)
     q := IGPCompact(s),V48Assert(q.Hp=18.5 && q.Dead=1 && !q.Kill,"first death reduces only that sister's share")
 }
 V634TestDeathWithoutHP()
 {
     s := V634Pair(150,370),e := V634Event("Aivela",150,1000,1200,"Death")
     e.TargetHP := {Known:false,Current:0,Maximum:0},IGPObserve(s,e,1200)
     V48Assert(IGPCompact(s).Hp=18.5,"death can reuse that actor's recorded maximum without inventing one")
 }
 V634TestDeadStalePositiveHP()
 {
     s := V634Pair(150,370)
     IGPObserve(s,V634Event("Aivela",150,1000,1200,"Death"),1200)
     IGPObserve(s,V634Event("Aivela",150,1000,1300,"Other"),1300)
     IGPObserve(s,V634Event("Esne",150,1000,1400),1400)
     V48Assert(IGPCompact(s).Hp=7.5,"cleanup snapshots do not revive a defeated sister")
 }
 V634TestZeroNotKill()
 {
     s := V634Pair(0,0),q := IGPCompact(s)
     V48Assert(q.Hp=0 && q.Comparable && !q.Kill,"zero health alone cannot certify completion")
     s.Terminal := true,s.FinishAt := 9000,k := IGPCompact(s)
     V48Assert(k.Kill && IGPScore(k)>IGPScore(q),"actual parser completion wins the rank")
 }
 V634TestNoDefeatedPriority()
 {
     s := V634Pair(150,500)
     IGPObserve(s,V634Event("Aivela",150,1000,1200,"Death"),1200)
     a := IGPCompact(s),b := IGPCompact(V634Pair(150,150))
     V48Assert(IGPScore(b)>IGPScore(a),"one defeated sister cannot outrank lower combined HP by a separate bonus")
 }
 V634TestCompactIsolation()
 {
     s := V634Pair(150,150),q := IGPCompact(s),q.Targets[1].Last := 99
     V48Assert(IGPCompact(s).Targets[1].Last=15,"display copy cannot mutate captured pair")
 }
 V634TestRollback()
 {
     state := IPNewData("Synthetic rollback"),s := IPNewSegment(state,0,"synthetic")
     s.BossKey := "G-AE",s.AreaId := "833571547775765",s.ModeId := "836045448953655"
     IGPObserve(s,V634Event("Aivela",500),1000),IGPObserve(s,V634Event("Esne",500,1000,1100),1100)
     IPBBeginUndo(state,s),IGPObserve(s,V634Event("Aivela",100,1000,1200),1200)
     V48Assert(IGPCompact(s).Hp=30,"speculative observation exists before rollback")
     IPBRollbackTail(state,s),V48Assert(IGPCompact(s).Hp=50,"combined best and latest sister restore together")
 }
 V634TestLabelBothSisters()
 {
     text := IGPLabel(IGPCompact(V634Pair(150,150)))
     V48Assert(InStr(text,"Combined 15.0%") && InStr(text,"Aivela 15.0%") && InStr(text,"Esne 15.0%"),"both components remain visible")
 }
 V634TestHistoryRoundTrip()
 {
     q := IGPCompact(V634Pair(150,370)),p := V634Entries(q)[1].Pull,r := IGVUnpackPull(IGVPackPull(p))
     V48Assert(r.Progress.Profile=IGPSistersKey() && r.Progress.Hp=26 && r.Progress.Targets[2].Last=37,"paired metric uses existing validated history shape")
 }
 V634TestLegacyHistoryGap()
 {
     p := V634Entries(IGPCompact(V634Pair(150,370)))[1].Pull,p.Progress.Profile := "hp-only-v1",p.Progress.Hp := 15
     r := IGVUnpackPull(IGVPackPull(p))
     V48Assert(r.Progress.Profile=IGPSistersKey() && !r.Progress.Comparable && r.Progress.Hp<0,"old lowest-target history is not mislabeled as combined HP")
     V48Assert(r.Players.Count=8 && r.TotalDeaths=p.TotalDeaths,"legacy conversion retains pull analysis")
 }
 V634TestLegacyKillPreserved()
 {
     p := V634Entries(IGPCompact(V634Pair(150,370)))[1].Pull,p.Progress.Profile := "hp-only-v1",p.Progress.Kill := true
     r := IGVUnpackPull(IGVPackPull(p))
     V48Assert(r.Progress.Kill && r.Progress.Comparable,"confirmed legacy kill remains a kill despite missing combined snapshots")
 }
 V634TestCouncilHistoryUnchanged()
 {
     p := IGVDemoData().Pulls[17],a := IGVJson(IGVPackPull(p)),b := IGVJson(IGVPackPull(IGVUnpackPull(IGVPackPull(p))))
     V48Assert(a=b,"Council saved metrics are not migrated or replaced")
 }
 V634TestCombinedAxis()
 {
     rows := V634Entries(IGPCompact(V634Pair(150,150))),m := IGPYHPGraphModel(rows,900,250)
     V48Assert(m.Axis.Percent && m.Axis.Kind="combined" && InStr(m.Axis.Title,"Combined HP remaining"),"direct combined-HP fallback names its actual scale")
     V48Assert(m.YTicks.Length=5 && m.YTicks[1].Label="100%" && m.YTicks[5].Label="0%","percentage fallback ticks span the whole scale")
     V48Assert(Abs(m.Points[1].Y-(m.Top+0.85*(m.Bottom-m.Top)))<0.001,"combined fallback retains exact 15 percent remaining")
     primary := IGVPlotModel(rows,900,250)
     V48Assert(primary.Axis.Kind="combined" && primary.Points[1].Known && primary.Points[1].Label="15.0% combined HP remaining","production Sisters graph preserves weighted health despite recorded phase metadata")
 }
 V634TestSingleBossAxis()
 {
     q := IGPCompact(V634Pair(500,500)),q.Profile := "hp-only-v1",q.Expected := 1,q.Phases := ["HP only"]
     rows := V634Entries(q),p := rows[1].Pull,p.Boss := "DF-DR",p.Area := "137438993402",p.Group := p.Boss "|" p.Area "|" p.Mode
     m := IGVPlotModel(rows,900,250)
     V48Assert(m.Axis.Kind="hp" && InStr(m.Axis.Title,"Boss HP"),"encounter without verified Parsely phases uses true boss HP")
     V48Assert(Abs(m.Points[1].Y-(m.Top+m.Bottom)/2)<0.001,"50 percent is halfway down")
 }
 V634TestMultiTargetNotPercent()
 {
     q := IGPCompact(V634Pair(500,500)),q.Profile := "hp-only-v1",q.Phases := ["HP only"]
     rows := V634Entries(q),p := rows[1].Pull,p.Boss := "DF-DR",p.Area := "137438993402",p.Group := p.Boss "|" p.Area "|" p.Mode
     m := IGVPlotModel(rows,900,250)
     V48Assert(!m.Points[1].Known && m.Points[1].Y=-1 && m.Unknown=1,"old multi-target ordinal value stays unknown on an HP fallback")
     V48Assert(q.Expected=2 && q.Hp=50,"view does not rewrite stored ordinal evidence")
 }
 V634TestPhaseAxis()
 {
     m := IGVPlotModel(V631Entries(),900,250)
     V48Assert(m.Axis.Percent && m.Axis.Kind="combined" && m.YTicks.Length=5 && m.YTicks[1].Label="100%" && m.YTicks[3].Label="50%" && m.YTicks[5].Label="0%","weighted Council health has a fixed percentage scale independent of repeated phases")
     V48Assert(m.Axis.Title="Combined HP remaining (%)","multi-boss axis names the observed metric")
 }
 V634TestAxisDPIAndSizes()
 {
     for z in [1,1.5,2] {
         for h in [190,237,257,450] {
             m := IGVPlotModel(V634Entries(IGPCompact(V634Pair(150,150))),Round(900*z),Round(h*z),z)
             last := -1
             for tick in m.YTicks {
                 V48Assert(tick.Y>=m.Top && tick.Y<=m.Bottom && (last<0 || tick.Y-last>=19*z),"tick labels have room at compact/expanded DPI sizes")
                 last := tick.Y
             }
             V48Assert(m.Left<m.Right && m.Top<m.Bottom,"axis gutters leave a usable plot")
         }
     }
 }
 V634TestCombinedBestCurve()
 {
     rows := [],values := [[140,370],[150,150],[100,600]]
     for i,pair in values {
         e := V634Entries(IGPCompact(V634Pair(pair[1],pair[2])))[1],e.Pull.Id := i,rows.Push(e)
     }
     m := IGPYHPGraphModel(rows,900,250)
     V48Assert(m.BestIndex=2 && m.Points[2].Y>m.Points[1].Y && m.Points[3].BestY=m.Points[2].BestY,"direct HP fallback retains weighted combined best and does not regress")
     for e in rows
         IGPYDemoPhases(e.Pull,["codex","twins"])
     primary := IGPYGraphModel(rows,900,250)
     V48Assert(primary.BestIndex=1 && primary.Points[2].Score=primary.Points[1].Score && primary.Points[3].BestY=primary.Points[1].BestY,"same recorded primary phase ties despite different combined HP")
 }
 V634TestAxisEmptyAndUnknown()
 {
     m := IGVPlotModel([],900,250),V48Assert(m.Points.Length=0 && m.Axis.Title="Boss HP remaining (%)","empty unscoped graph has a labelled scale and no invented point")
     s := V63Segment("G-AE"),IGPObserve(s,V634Event("Aivela",150),1000)
     m := IGVPlotModel(V634Entries(IGPCompact(s)),900,250)
     V48Assert(m.Axis.Kind="combined" && !m.Points[1].Known && m.Points[1].Y=-1 && !IGPCompact(s).Comparable,"one observed sister cannot replace unavailable combined HP with a phase position")
 }
 V634TestParserIntegration()
 {
     s := IPNewData("Synthetic full-path Sisters")
     IPFeedLine(s,"[00:00:00.000] [@Fixture Player#1|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {833571547775765} 8 Player Master {836045448953655}]")
     IPFeedLine(s,IPDemoLine(100,"@Fixture Player#1|(0,0,0,0)|(1000/1000)","=","Enter"))
     for item in [["4088525397950464",150,1000],["4088538282852352",150,1100]]
         IPFeedLine(s,IPDemoLine(item[3],"@Fixture Player#1|(0,0,0,0)|(1000/1000)","NPC {" item[1] "}:99|(0,0,0,0)|(" item[2] "/1000)","Damage",10))
     q := IGPCompact(s.Current)
     V48Assert(s.Current.BossKey="G-AE" && q.Hp=15 && q.Comparable,"normal parser observer captures combined HP")
     V48Assert(s.Current.Totals["@Fixture Player#1"].Damage=20 && !s.Halted,"existing damage total is unchanged")
 }
 V634BrightPixels(p,x,y,w,h)
 {
     count := 0
     Loop Max(0,Round(h)) {
         row := Round(y)+A_Index-1
         Loop Max(0,Round(w)) {
             color := DllCall("Gdi32\GetPixel","Ptr",p.DC,"Int",Round(x)+A_Index-1,"Int",row,"UInt")
             if color!=0xFFFFFFFF && (color&255)>150 && ((color>>8)&255)>150 && ((color>>16)&255)>150
                 count += 1
         }
     }
     return count
 }
 V634TestNativeAxisPixels()
 {
     V61Hidden(V634AxisPixelCase)
 }
 V634AxisPixelCase()
 {
     g := Gui(),pic := g.AddPicture("w900 h250 +0x100"),paint := ""
     try {
         paint := IAPaintBegin(pic),z := A_ScreenDPI/96
         m := IGVPlotModel(V634Entries(IGPCompact(V634Pair(150,150))),paint.W,paint.H,z)
         IAFill(paint,0,0,paint.W,paint.H,IUBColorRef("18131F"))
         V48Assert(V634BrightPixels(paint,8*z,m.Top-8*z,m.Left-20*z,m.Bottom-m.Top+19*z)=0,"blank negative control has no axis text pixels")
         IGVPaintPlot(paint,m)
         V48Assert(V634BrightPixels(paint,8*z,m.Top-8*z,m.Left-20*z,m.Bottom-m.Top+19*z)>20,"actual combined-health percentage glyphs appear in private GDI bitmap")
         V48Assert(V634BrightPixels(paint,14*z,30*z,330*z,22*z)>20,"actual axis-title pixels appear")
         IAPaintEnd(paint),paint := ""
         V48Assert(SendMessage(0x172,0,0,pic)!=0,"native bitmap attached to actual Picture")
     }
     finally {
         if IsObject(paint)
             IAPaintEnd(paint,false)
         g.Destroy()
     }
 }
 
 V634TestDemoComparison()
 {
     d := IGVSistersDemoData(),rows := []
     for i,p in d.Pulls
         rows.Push({Key:"demo" i,Date:"",Team:"",Pull:p})
     m := IGPYHPGraphModel(rows,900,250),primary := IGVPlotModel(rows,900,250)
     V48Assert(d.Demo && d.Pulls.Length=3 && d.Pulls[1].Progress.Hp=25.5 && d.Pulls[2].Progress.Hp=15,"explicit fake HP example reproduces requested comparison")
     V48Assert(m.BestIndex=2 && d.Pulls[1].TotalDeaths=9 && d.Pulls[2].Players.Count=8,"HP fallback preserves exact-pull inspection data")
     V48Assert(primary.Axis.Kind="combined" && primary.Unknown=0 && primary.BestIndex=2 && primary.Points[2].Score>primary.Points[1].Score,"production graph retains different combined HP even when both observations share a phase")
 }
 V634TestDemoNotSavedAsReal()
 {
     d := IGVSistersDemoData()
     V48Assert(d.Demo && d.Path="" && InStr(d.Label,"SYNTHETIC") && InStr(d.Pulls[1].Progress.Evidence,"SYNTHETIC"),"demo flags remain visible and cannot be confused with real source")
 }
 
 ; v64.3 manual-only multi-file/history tests. File IO is confined to A_Temp.
 V635Pull(index := 1)
 {
     return IGVUnpackPull(IGVPackPull(IGVDemoData().Pulls[index]))
 }
 
 V635Entry(date,start,duration := 120000,team := "A",key := "test")
 {
     p := V635Pull(),p.Start := start,p.End := start+duration
     return {Key:key,Session:"fixture",Date:date,Team:team,Pull:p}
 }
 
 V635Temp()
 {
     static serial := 0
     serial += 1
     root := A_Temp "\Iris_v635_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount "_" serial
     DirCreate(root)
     return root
 }
 
 V635WithBatch(action)
 {
     V61Hidden(V635BatchInner.Bind(action))
 }
 
 V635BatchInner(action)
 {
     global IP
     root := V635Temp(),temp := "",v := IGVState(),old := v.Clone()
     try {
         V61Ready(),IGVOpen()
         temp := V61ScanFixture(3),one := root "\combat_2026-09-26_00_00_00_001.txt",two := root "\combat_2026-09-27_00_00_00_002.txt"
         FileCopy(temp,one),FileCopy(temp,two),FileDelete(temp),temp := ""
         items := [IGLItem(one),IGLItem(two)]
         action.Call(root,items)
     }
     finally {
         IGLShutdown(),IPRState().Busy := false,IGVState().Busy := false
         IGVClose()
         for name,value in old.OwnProps() {
             if name!="Gui" && name!="Controls" && name!="HoverHook" && name!="Plot" && name!="Rows" && name!="Selected" && name!="Busy"
                 v.%name% := value
         }
         if temp!="" && FileExist(temp)
             FileDelete(temp)
         DirDelete(root,true)
     }
 }
 
 V635TestInertState()
 {
     s := IGLState()
     V48Assert(!s.Busy && !s.Pumping && !IsObject(s.Job),"state construction does not read logs or history or start timers")
 }
 
 V635TestCalendarDate()
 {
     for date in ["20260927","20240229","20000229","20991231"]
         V48Assert(IGLDate(date)=date,"valid explicit calendar date")
     for date in ["","today","20260229","20261301","20260001","20260900","20260931","20260000"] {
         raised := false
         try IGLDate(date)
         catch ValueError
             raised := true
         V48Assert(raised,"invalid dates never become today")
     }
 }
 
 V635TestDateQualifiedIdentity()
 {
     V48Assert(IGLSession("raid.txt","20260926")!=IGLSession("raid.txt","20260927"),"custom filenames across nights cannot overwrite each other")
     V48Assert(IGLSession("20260927_200000_123","20260927")="20260927_200000_123","standard filename identity retained")
     V48Assert(IGLSession("20260927_raid.txt","20260927")="20260927_raid.txt","qualification is idempotent")
 }
 
 V635TestChronologicalMidnight()
 {
     a := V635Entry("20260926",90000000,120000,"A","a"),b := V635Entry("20260927",1800000,120000,"A","b")
     sorted := IGVSort([a,b])
     V48Assert(sorted[1]=b && sorted[2]=a,"next-day half past midnight precedes previous file's unwrapped 1AM")
     V48Assert(IGLEntryTime(a)-IGLEntryTime(b)=1800000,"sort uses calendar plus unwrapped millisecond timestamp")
 }
 
 V635TestOverlapMidnight()
 {
     a := V635Entry("20260926",86430000,120000,"A","a"),b := V635Entry("20260927",30000,120000,"A","b")
     V48Assert(IGLOverlap(a,b),"overlap detected even when filenames have different recording dates")
     b.Team := "B",V48Assert(!IGLOverlap(a,b),"explicit teams independent")
 }
 
 V635TestNoOverlapAdjacent()
 {
     a := V635Entry("20260927",100000,120000,"A","a"),b := V635Entry("20260927",220000,120000,"A","b")
     V48Assert(!IGLOverlap(a,b),"touching intervals are separate pulls")
     b.Pull.Start := a.Pull.Start,b.Pull.End := b.Pull.Start
     V48Assert(!IGLOverlap(a,b),"zero-duration observations do not divide by zero")
 }
 
 V635TestCombineNights()
 {
     d := IGVDemoData(),a := IGLMerge(Map(),d.Pulls,"night","20260926","A")
     b := IGLMerge(a.History,d.Pulls,"night","20260927","A")
     V48Assert(a.History.Count=17 && b.History.Count=34 && b.Added=17,"same clock times from distinct nights stay separate")
 }
 
 V635TestRepeatedLogNoDoubleCount()
 {
     p := V635Pull(),a := IGLMerge(Map(),[p],"session","20260927","A")
     b := IGLMerge(a.History,[p],"session","20260927","A")
     V48Assert(b.History.Count=1 && b.Unchanged=1 && b.Added=0 && b.Updated=0,"exact re-add retains one pull")
 }
 
 V635TestExistingPullUpdate()
 {
     p := V635Pull(),a := IGLMerge(Map(),[p],"session","20260927","A")
     q := V635Pull(),q.Progress.Hp := 55
     b := IGLMerge(a.History,[q],"session","20260927","A")
     V48Assert(b.History.Count=1 && b.Updated=1,"reanalysis updates same identity")
     for key,e in a.History
         V48Assert(e.Pull.Progress.Hp!=55,"staged updates do not mutate prior stored objects")
 }
 
 V635TestCompleteNotDowngraded()
 {
     p := V635Pull(),a := IGLMerge(Map(),[p],"session","20260927","A")
     p.Partial := true,b := IGLMerge(a.History,[p],"session","20260927","A")
     V48Assert(b.KeptComplete=1 && b.Updated=0,"partial rerun cannot replace fuller saved pull")
 }
 
 V635TestAlternateRecorderSkipped()
 {
     p := V635Pull(),a := IGLMerge(Map(),[p],"one","20260927","A")
     q := V635Pull(),q.RecorderKey := "@Different Recorder#22"
     b := IGLMerge(a.History,[q,V635Pull(2)],"two","20260927","A")
     V48Assert(b.Overlaps=1 && b.Added=2 && b.History.Count=3,"alternative recorder and later unique capture both retain their evidence")
     entries := []
     for key,e in b.History
         entries.Push(e)
     view := IGKBuild(entries,"all")
     V48Assert(view.Rows.Length=2 && !view.Conflicts.Length && view.AlternativeCaptures=1,"matching alternative is one plotted attempt with retained provenance")
 }
 
 V635TestModeAndTeamStaySeparate()
 {
     p := V635Pull(),a := IGLMerge(Map(),[p],"one","20260927","A")
     b := IGLMerge(a.History,[p],"two","20260927","B")
     p.Mode := "836045448953652",p.Group := p.Boss "|" p.Area "|" p.Mode
     c := IGLMerge(b.History,[p],"three","20260927","A")
     V48Assert(c.History.Count=3,"different explicit teams/difficulties are not merged")
 }
 
 V635TestNoUnknownTrashSaved()
 {
     a := V635Pull(),b := V635Pull(2),c := V635Pull(3)
     a.Boss := "",b.Included := false,c.Ended := false
     r := IGLMerge(Map(),[a,b,c],"fixture","20260927","A")
     V48Assert(r.Skipped=3 && r.History.Count=0,"unrecognized, excluded and open pulls are not made graph results")
 }
 
 V635TestExactPullDetailsRetained()
 {
     p := V635Pull(),r := IGLMerge(Map(),[p],"fixture","20260927","A")
     for key,e in r.History {
         person := e.Pull.Players["@Little Bobby#Prog5"]
         V48Assert(person.Deaths=2 && e.Pull.Deaths.Length=9,"stored first pull keeps exact deaths, not session total")
         V48Assert(person.Active.Values[5]=92520,"existing estimated activity data preserved")
     }
 }
 
 V635TestSistersHistoryRetained()
 {
     d := IGVSistersDemoData(),r := IGLMerge(Map(),d.Pulls,"sisters","20260927","A")
     for key,e in r.History {
         q := e.Pull.Progress
         V48Assert(q.Profile=IGPSistersKey() && q.Targets.Length=2,"combined HP profile and component snapshots retained")
         V48Assert(q.Hp=d.Pulls[e.Pull.Id].Progress.Hp,"combined scale unchanged by multi-log history")
     }
 }
 
 V635TestHistoryTokenDetectsEdits()
 {
     root := V635Temp(),path := root "\history.json"
     try {
         absent := IGLHistoryText(path),V48Assert(!absent.Exists && IGLHistoryUnchanged(absent,path),"missing history starts as missing, not an empty overwritten file")
         FileAppend("[1,[]]",path,"UTF-8")
         before := IGLHistoryText(path)
         V48Assert(!IGLHistoryUnchanged(absent,path) && IGLHistoryUnchanged(before,path),"creation and matching content detected")
         FileDelete(path),FileAppend("[2,[]]",path,"UTF-8")
         V48Assert(!IGLHistoryUnchanged(before,path),"same-size edit detected by content")
     }
     finally DirDelete(root,true)
 }
 
 V635TestViewRoundTrip()
 {
     root := V635Temp(),path := root "\view.ini"
     try {
         IniWrite("keep",path,"Unrelated","Value")
         v := {Source:"history",Boss:"G-AE|833571547775765|836045448953655",Character:"@Example#27",Team:"Evening team",LastTeam:"Evening team",DetailVisible:true}
         IGLWriteView(v,path),read := IGLReadView(path)
         V48Assert(read.Source=v.Source && read.Boss=v.Boss && read.Character=v.Character && read.Team=v.Team && read.LastTeam=v.LastTeam && read.Detail,"saved filters and expanded state roundtrip")
         V48Assert(IniRead(path,"Unrelated","Value")="keep","unrelated preferences remain")
     }
     finally DirDelete(root,true)
 }
 
 V635TestViewDefaults()
 {
     root := V635Temp(),path := root "\missing.ini"
     try {
         v := IGLReadView(path)
         V48Assert(v.Source="history" && v.Team="*" && v.Character="" && !v.Detail,"prefer saved history without automatically selecting a character/team")
         V48Assert(!FileExist(path),"reading defaults does not create settings")
     }
     finally DirDelete(root,true)
 }
 
 V635TestDemoViewDistinction()
 {
     v := {Source:"current",Current:IGVDemoData(),DemoHistory:false}
     V48Assert(IGLIsDemoView(v),"current demo is never a remembered real source")
     v.Source := "history"
     V48Assert(!IGLIsDemoView(v),"real saved history remains real even if current tab contains a demo")
     v.DemoHistory := true,V48Assert(IGLIsDemoView(v),"synthetic history remains a demo")
 }
 
 V635TestBatchReadsAndSaves()
 {
     V635WithBatch(V635BatchReadCase)
 }
 V635BatchReadCase(root,items)
 {
     global IP
     p := IPRState(),old := p.Data,source := p.Source,live := IP.Live,offline := IP.Offline
     path := root "\history.json",j := IGLBegin(items,"Team A",path)
     V48Assert(IGLBusy() && p.Busy && !IGLCanStart(),"batch locks concurrent parser work")
     V48Assert(IGLPump(),"complete batch returns success")
     h := IGVReadHistory(path)
     V48Assert(h.Count=6 && j.Records=54 && j.Added=6,"two source files parsed once and saved as six pulls")
     V48Assert(IP.Live=live && IP.Offline=offline && p.Data=old && p.Source=source,"normal loaded/live/session datasets are untouched")
     V48Assert(!IGLBusy() && !p.Busy && !IGVState().Busy && !IsObject(j.Snapshot),"file and operation locks released")
     V48Assert(IGVState().Source="history" && IGVState().Rows.Length=6,"combined graph selected on success")
 }
 
 V635TestBatchRerun()
 {
     V635WithBatch(V635BatchRerunCase)
 }
 V635BatchRerunCase(root,items)
 {
     path := root "\history.json"
     IGLBegin(items,"A",path),IGLPump(),before := FileRead(path,"UTF-8")
     j := IGLBegin(items,"A",path)
     V48Assert(IGLPump() && j.Unchanged=6 && j.Added=0 && j.Updated=0,"second batch is idempotent")
     V48Assert(FileRead(path,"UTF-8")==before,"no unnecessary rewrite for identical re-add")
 }
 
 V635TestBatchPastOldFightLimit()
 {
     V635WithBatch(V635PastLimitCase)
 }
 V635PastLimitCase(root,items)
 {
     fixture := V61ScanFixture(70)
     try {
         FileCopy(fixture,items[1].Path,1),j := IGLBegin(items,"A",root "\history.json")
         V48Assert(IGLPump() && j.Added=73 && j.History.Count=73,"no reintroduced sixty-pull cap in multi-file reader")
     }
     finally FileDelete(fixture)
 }
 
 V635CancelAtSecond(job,phase)
 {
     if job.Index=2 && phase="before-file"
         IGLCancel()
 }
 V635TestBatchCancelIsAtomic()
 {
     V635WithBatch(V635CancelCase)
 }
 V635CancelCase(root,items)
 {
     path := root "\history.json",prior := IGLMerge(Map(),[V635Pull()],"older","20260925","A").History
     IGVWriteHistory(prior,path),before := FileRead(path,"UTF-8"),j := IGLBegin(items,"A",path)
     V48Assert(!IGLPump(V635CancelAtSecond) && j.Added=3,"first file staged before second-file cancellation")
     V48Assert(FileRead(path,"UTF-8")==before && !FileExist(path ".bak"),"canceled batch never commits or replaces backup")
     V48Assert(!j.Committed && !IGLBusy() && !IPRState().Busy,"canceled batch reports no success and unlocks")
 }
 
 V635DeleteSecond(job,phase)
 {
     if job.Index=2 && phase="before-file"
         FileDelete(job.Items[2].Path)
 }
 V635TestBatchReadFailureAtomic()
 {
     V635WithBatch(V635ReadFailureCase)
 }
 V635ReadFailureCase(root,items)
 {
     path := root "\history.json",j := IGLBegin(items,"A",path)
     V48Assert(!IGLPump(V635DeleteSecond) && j.Added=3 && !FileExist(path),"second-file read error does not publish a partial batch")
     V48Assert(InStr(IGLState().LastReport,"Batch not saved"),"failure is explicit")
 }
 
 V635TestQueuedCancel()
 {
     V635WithBatch(V635QueuedCancelCase)
 }
 V635QueuedCancelCase(root,items)
 {
     path := root "\history.json",j := IGLBegin(items,"A",path)
     IGLCancel()
     V48Assert(!IGLBusy() && j.Records=0 && !j.Committed && !FileExist(path),"cancel before pump opens no raw log and writes no history")
 }
 
 V635ExternalEdit(job,phase)
 {
     if phase="before-commit"
         FileAppend(" ",job.Path,"UTF-8")
 }
 V635TestConcurrentHistoryEdit()
 {
     V635WithBatch(V635ExternalEditCase)
 }
 V635ExternalEditCase(root,items)
 {
     path := root "\history.json"
     IGVWriteHistory(Map(),path),before := FileRead(path,"UTF-8")
     IGLBegin(items,"A",path)
     V48Assert(!IGLPump(V635ExternalEdit),"external history edit rejects commit")
     V48Assert(FileRead(path,"UTF-8")==before " ","external edit is not overwritten by staged batch")
 }
 
 V635TestCorruptHistoryNotOverwritten()
 {
     V635WithBatch(V635CorruptCase)
 }
 V635CorruptCase(root,items)
 {
     path := root "\history.json",text := "not a history file",raised := false
     FileAppend(text,path,"UTF-8")
     try IGLBegin(items,"A",path)
     catch Error
         raised := true
     V48Assert(raised && !IGLBusy() && FileRead(path,"UTF-8")==text,"invalid history cannot be replaced by a fresh empty store")
 }
 
 V635TestReopenWithoutRawLogs()
 {
     V635WithBatch(V635ReopenCase)
 }
 V635ReopenCase(root,items)
 {
     path := root "\history.json",j := IGLBegin(items,"A",path)
     V48Assert(IGLPump(),"saved fixture")
     for item in items
         FileDelete(item.Path)
     v := IGVState(),v.History := Map(),v.History := IGVReadHistory(path)
     v.Source := "history",v.DemoHistory := false,IGVFillFilters(),IGVRefresh()
     V48Assert(v.Rows.Length=6,"disk reconstruction does not require source recordings")
     IGVOpenRow(v.Controls["Rows"],1)
     V48Assert(IPRState().DetailPull.Players["@Bobby#101"].Deaths=2,"stored point opens original per-pull death count")
     IPRCloseDetails()
 }
 
 V635TestBusyGuards()
 {
     V635WithBatch(V635GuardsCase)
 }
 V635GuardsCase(root,items)
 {
     global IP
     IP.Active := true,V48Assert(!IGLCanStart(),"live parsing prevents batch")
     IP.Active := false,IP.Queue := ["pending"],IP.Head := 1
     V48Assert(!IGLCanStart(),"pending live queue prevents batch")
     IP.Queue := [],IP.Head := 1,IAState().Busy := true
     V48Assert(!IGLCanStart(),"active Analysis prevents batch")
     IAState().Busy := false
     V48Assert(IGLCanStart(),"stopped idle parser can add logs")
 }
 
 V635TestShutdownDoesNotSave()
 {
     V635WithBatch(V635ShutdownCase)
 }
 V635ShutdownCase(root,items)
 {
     path := root "\history.json",j := IGLBegin(items,"A",path)
     IPRCleanup(),IGVState().Busy := false
     V48Assert(!IGLBusy() && !IPRBusy() && !FileExist(path) && !j.Committed,"shutdown abandons queued work without writing incomplete history")
 }
 
 V635TestGraphButtonsAndNativeTabs()
 {
     V635WithBatch(V635GraphButtonsCase)
 }
 V635GraphButtonsCase(root,items)
 {
     v := IGVState(),tabs := IPWState().Controls["Tabs"]
     V48Assert(v.Controls.Has("AddLogs") && v.Controls["AddLogs"].Text="Add logs...","multi-select entry point built")
     V48Assert(tabs.Type="Tab2" && !DllCall("User32\IsWindowVisible","Ptr",v.Gui.Hwnd),"native tabs untouched and test graph hidden")
     j := IGLBegin(items,"A",root "\history.json")
     V48Assert(!v.Controls["AddLogs"].Enabled && v.Controls["Refresh"].Text="Cancel adding logs","clear cancel affordance during batch")
     IGLCancel()
     V48Assert(v.Controls["AddLogs"].Enabled && v.Controls["Refresh"].Text="Refresh source","buttons restored after cancel")
 }
 
 V635TestUnknownFileDate()
 {
     V635WithBatch(V635UnknownDateCase)
 }
 V635UnknownDateCase(root,items)
 {
     path := root "\raid.txt",raised := false
     FileCopy(items[1].Path,path)
     try IGLItem(path)
     catch ValueError
         raised := true
     V48Assert(raised && IGLItem(path,"20260927").Date="20260927","nonstandard filename requires explicit date")
 }
 
 V635TestInvalidFileType()
 {
     V635WithBatch(V635InvalidTypeCase)
 }
 V635InvalidTypeCase(root,items)
 {
     path := root "\fixture.ahk",raised := false
     FileCopy(items[1].Path,path)
     try IGLItem(path,"20260927")
     catch ValueError
         raised := true
     V48Assert(raised,"All files picker cannot turn scripts or JSON into combat logs")
 }
 
 V635TestDuplicateSelectedPaths()
 {
     V635WithBatch(V635DuplicatePathsCase)
 }
 V635DuplicatePathsCase(root,items)
 {
     path := root "\history.json",j := IGLBegin([items[1],items[1]],"A",path)
     V48Assert(j.Items.Length=1 && IGLPump() && j.Added=3,"same selected absolute path scans once")
 }
 
 V635TestSavedSelectionTeam()
 {
     d := IGVDemoData(),h := IGLMerge(Map(),d.Pulls,"night","20260927","A").History
     c := IGLSavedSelection(h,"unrelated boss","@absent#1","A")
     V48Assert(c.Boss=d.Pulls[1].Group && c.Character="","new team displays an available boss rather than a stale empty character filter")
     c := IGLSavedSelection(h,d.Pulls[1].Group,"@Little Bobby#Prog5","A")
     V48Assert(c.Boss=d.Pulls[1].Group && c.Character="@Little Bobby#Prog5","compatible character/boss selection preserved")
 }
 
 V635TestEmptyBatchRefused()
 {
     root := V635Temp(),raised := false
     try {
         try IGLBegin([],"A",root "\history.json")
         catch Error
             raised := true
         V48Assert(raised && !IGLBusy() && !FileExist(root "\history.json"),"empty batch neither starts work nor creates files")
     }
     finally DirDelete(root,true)
 }
 
 V635TestLegacyCustomSessionUpgrade()
 {
     p := V635Pull(),old := IGVAddHistory(Map(),[p],"raid.txt","20260927","A")
     ; IGVAddHistory retains p by reference. Build independent incoming data;
     ; otherwise changing p also changes the expected old saved record.
     previous := IGVJson(IGVPackPull(p)),updated := IGVUnpackPull(IGVPackPull(p))
     updated.Progress.Hp := 50,r := IGLMerge(old,[updated],"raid.txt","20260927","A")
     V48Assert(r.History.Count=1 && r.Updated=1 && r.Overlaps=0,"legacy custom-name source can be updated without being mistaken for another recorder")
     V48Assert(IGVJson(IGVPackPull(p))==previous,"incoming update did not alter the old reference fixture")
     r := IGLMerge(old,[updated],"raid.txt","20260928","A")
     V48Assert(r.History.Count=2 && r.Added=1,"different date does not replace a legacy custom-name source")
 }
 
 ; v64.3: manual-only dates/graph regression checks. These run in the existing isolated child.
 V636Entry(date := "20260927",at := 75909915)
 {
     return {Date:date,Pull:{Start:at}}
 }
 
 V636TestDateLabels()
 {
     s := IGDStamp(V636Entry())
     V48Assert(s.Known && s.Date="20260927" && s.Short="27 Sep" && s.Full="27 Sep 2026","unambiguous English date labels")
     V48Assert(s.Clock="21:05:09" && s.Text="27 Sep 2026 21:05:09","logged clock retained without import date or timezone conversion")
 }
 
 V636TestMidnightLabels()
 {
     for sample in [["20260927",86430000,"20260928","28 Sep 2026"],
         ["20261231",86400000,"20270101","1 Jan 2027"],
         ["20240228",86400000,"20240229","29 Feb 2024"],
         ["20260228",86400000,"20260301","1 Mar 2026"],
         ["20260927",172830000,"20260929","29 Sep 2026"]] {
         s := IGDStamp(V636Entry(sample[1],sample[2]))
         V48Assert(s.Known && s.Date=sample[3] && s.Full=sample[4],"calendar label follows existing midnight/day rollover")
         V48Assert(!InStr(s.Clock,"+"),"known date has rolled forward; clock no longer needs a day-offset prefix")
     }
 }
 
 V636TestUnknownDate()
 {
     s := IGDStamp(V636Entry("",86430000))
     V48Assert(!s.Known && s.Short="Date ?" && s.Full="Date unknown" && s.Clock="+1d 00:00:30","unknown base date remains unknown with explicit relative day")
     V48Assert(!IGDStamp({Pull:{Start:0}}).Known && !IGDStamp("").Known,"absent metadata does not fall back to now")
 }
 
 V636TestInvalidDateOrTime()
 {
     for date in ["bad","20260229","20261301","20260931","20260900","2026-09-27"] {
         s := IGDStamp(V636Entry(date))
         V48Assert(!s.Known && s.Full="Date unknown" && s.Clock="21:05:09","invalid date does not prevent valid clock display or break drawing")
     }
     for at in [-1,"bad",1000000000001] {
         s := IGDStamp(V636Entry("20260927",at))
         V48Assert(!s.Known && s.Clock="Time unknown","invalid pull time never invents a calendar instant")
     }
 }
 
 V636TestDateSpan()
 {
     a := {Calendar:IGDStamp(V636Entry("20260927"))},b := {Calendar:IGDStamp(V636Entry("20260913"))}
     u := {Calendar:IGDStamp(V636Entry(""))}
     V48Assert(IGDDateSpan([])="No pulls" && IGDDateSpan([u])="Date unknown","empty/unknown date span")
     V48Assert(IGDDateSpan([a,a])="27 Sep 2026","single day shown once")
     V48Assert(IGDDateSpan([a,b])="13 Sep 2026 - 27 Sep 2026","range determined from actual dates regardless of entry order")
     V48Assert(InStr(IGDDateSpan([a,b,u]),"undated pulls"),"partly unknown coverage is disclosed")
 }
 
 V636TestGraphTickDates()
 {
     rows := V631Entries()
     for i,e in rows
         e.Date := i<=5 ? "20260913" : (i<=10 ? "20260921" : "20260927")
     m := IGVPlotModel(rows,900,250)
     V48Assert(m.DateRange="13 Sep 2026 - 27 Sep 2026","date range included in chart model")
     V48Assert(m.Ticks[1].Index=1 && m.Ticks[m.Ticks.Length].Index=15,"round labels omit an arbitrary final number while every pull remains plotted")
     for tick in m.Ticks
         V48Assert(!tick.HasOwnProp("Date") && m.Points[tick.Index].Calendar.Short=IGDStamp(rows[tick.Index]).Short,"ticks contain no dates; per-pull calendar metadata remains correct")
     V48Assert(m.Count=17 && m.Points.Length=17 && m.Ticks.Length<=6,"thinned labels never omit a pull")
 }
 
 V636TestDateTickLayout()
 {
     for z in [1,1.25,1.5,2] {
         for width in [900,960,1220,1800] {
             m := IGVPlotModel(V631Entries(),Round(width*z),Round(237*z),z),last := -1
             for tick in m.Ticks {
                 V48Assert(tick.LabelX>=m.Left && tick.LabelX+tick.LabelW<=m.Right+0.001,"numeric tick rectangles stay in the chart")
                 V48Assert(last<0 || tick.LabelX>=last+2*z,"adjacent label rectangles do not overlap")
                 last := tick.LabelX+tick.LabelW
             }
             V48Assert(m.Bottom+41*z<=m.Height+0.001,"number/caption rows fit without reserving a date row")
         }
     }
 }
 
 V636TestEmptyAndSingleDates()
 {
     m := IGVPlotModel([],900,250)
     V48Assert(m.DateRange="No pulls" && !m.Ticks.Length,"empty chart creates no fake date ticks")
     rows := [V631Entries()[1]],m := IGVPlotModel(rows,900,250)
     V48Assert(m.Ticks.Length=1 && !m.Ticks[1].HasOwnProp("Date") && m.Points[1].Calendar.Short="27 Sep" && m.DateRange="27 Sep 2026","one numeric tick retains its pull date in point metadata")
     knownBefore := m.Points[1].Known,rows[1].Date := "",m := IGVPlotModel(rows,900,250)
     V48Assert(!m.Ticks[1].HasOwnProp("Date") && m.Points[1].Calendar.Short="Date ?" && m.DateRange="Date unknown" && m.Points[1].Known=knownBefore,"unknown date creates no axis placeholder or changes the available progress evidence")
 }
 
 V636TestDateDoesNotChangeProgress()
 {
     rows := V631Entries(),a := IGVPlotModel(rows,900,250)
     for e in rows
         e.Date := "20260913"
     b := IGVPlotModel(rows,900,250)
     for i,point in a.Points {
         other := b.Points[i]
         V48Assert(point.Score=other.Score && point.Best=other.Best && point.Y=other.Y && point.X=other.X,"date labels do not change HP, best-so-far or pull spacing")
     }
     V48Assert(a.BestIndex=b.BestIndex,"same best pull across a date-label change")
 }
 
 V636TestChronologicalDates()
 {
     a := V635Entry("20260926",90000000,120000,"A","a"),b := V635Entry("20260927",1800000,120000,"A","b")
     rows := IGVSort([a,b])
     V48Assert(rows[1]=b && rows[2]=a,"sorting still uses recorded chronology")
     V48Assert(IGDStamp(rows[1]).Text="27 Sep 2026 00:30:00" && IGDStamp(rows[2]).Text="27 Sep 2026 01:00:00","labels agree with midnight-aware sort order")
 }
 
 V636TestPointDateAndCharacter()
 {
     e := V631Entries()[1],e.Date := "20260913"
     label := IGVPointLabel(e,1,"@Little Bobby#Prog5")
     V48Assert(InStr(label,"13 Sep 2026") && InStr(label,"Pull 1") && InStr(label,"2 deaths") && InStr(label,"77.1"),"hover/selection text includes date and exact-pull character figures")
     V48Assert(StrSplit(label,"`n").Length=2,"date remains within existing two-line detail area")
 }
 
 V636TestNoSourceMutation()
 {
     e := V631Entries()[1],originalStart := e.Pull.Start,originalProgress := e.Pull.Progress,originalDate := e.Date
     stamp := IGDStamp(e),m := IGVPlotModel([e],900,250),label := IGVPointLabel(e,1)
     V48Assert(e.Date=originalDate && e.Pull.Start=originalStart && e.Pull.Progress=originalProgress,"date presentation never rewrites source fields")
     V48Assert(!e.Pull.HasOwnProp("Calendar") && !e.HasOwnProp("Calendar"),"date cache is owned by the disposable chart model, not stored history")
 }
 
 V636TestHiddenGraphDates()
 {
     V61Hidden(V636HiddenGraphCase)
 }
 V636HiddenGraphCase()
 {
     oldDetail := IGVState().DetailVisible
     IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IGVDemoData(),IGVOpen(),v := IGVState()
     try {
         v.Source := "history",v.DemoHistory := true,v.History := Map()
         for i,e in V631Entries() {
             e.Date := i<=8 ? "20260913" : "20260927",e.Session := "synthetic"
             v.History[e.Key] := e
         }
         v.Team := "*",v.Character := "",v.Boss := p.Data.Pulls[1].Group
         v.DetailVisible := false,IGVFillFilters(),IGVRefresh(),IGVSelect(1)
         V48Assert(v.Plot.DateRange="13 Sep 2026 - 27 Sep 2026","real hidden graph receives multiple-night range")
         V48Assert(v.Plot.Count=17 && !v.DetailVisible,"dates do not expand the table or discard pulls")
         V48Assert(!v.TableReady && v.Controls["Rows"].GetCount()=0,"date selection does not eagerly populate a collapsed table")
         v.DetailVisible := true,IGVRefresh(),IGVSelect(1)
         V48Assert(InStr(v.Controls["Rows"].GetText(1,2),"13 Sep 2026") && InStr(v.Controls["Selected"].Text,"13 Sep 2026"),"expanded table and point label display matching dates")
     }
     finally IGVClose(),v.DetailVisible := oldDetail
 }
 
 V636TestNativeDatePixels()
 {
     V61Hidden(V636DatePixelCase)
 }
 V636DatePixelCase()
 {
     g := Gui(),pic := g.AddPicture("w900 h250 +0x100"),paint := ""
     try {
         paint := IAPaintBegin(pic),z := A_ScreenDPI/96
         m := IGVPlotModel(V631Entries(),paint.W,paint.H,z),tick := m.Ticks[1]
         IAFill(paint,0,0,paint.W,paint.H,IUBColorRef("18131F"))
         V48Assert(V634BrightPixels(paint,tick.LabelX,m.Bottom+23*z,tick.LabelW,18*z)=0,"blank negative control contains no date text")
         IGVPaintPlot(paint,m)
         V48Assert(V634BrightPixels(paint,tick.LabelX,m.Bottom+23*z,tick.LabelW,18*z)=0,"former first-tick date rectangle stays empty; centered caption is elsewhere")
         V48Assert(V634BrightPixels(paint,tick.LabelX,m.Bottom+4*z,tick.LabelW,18*z)>0,"numeric pull glyph remains visible in the private bitmap")
         V48Assert(V634BrightPixels(paint,148*z,7*z,m.Right-383*z,23*z)>20,"date range glyphs appear before the legend")
         IAPaintEnd(paint),paint := ""
         V48Assert(SendMessage(0x172,0,0,pic)!=0,"dated bitmap attached to native Picture")
     }
     finally {
         if IsObject(paint)
             IAPaintEnd(paint,false)
         g.Destroy()
     }
 }
 
 V636KillEntries()
 {
     entries := []
     for i,p in IGKDemoData().Pulls
         entries.Push({Key:"test|" i,Session:"synthetic",Date:i<=6 ? "20260913" : (i<=10 ? "20260921" : "20260927"),Team:"A",Pull:p})
     return entries
 }
 
 V636TestFirstKillWindow()
 {
     e := V636KillEntries(),r := IGKBuild(e,"first")
     V48Assert(r.Completed && r.Rows.Length=6 && r.Rows[6]=e[6] && r.TeamPulls=6,"all attempts through first confirmed kill are included")
     V48Assert(r.FirstKill=e[6] && InStr(r.Note,"6 team pulls"),"first clear is the earliest recorded kill, not best HP or final import")
     V48Assert(e.Length=12 && e[12].Pull.Included,"later history remains available")
 }
 
 V636TestAllPullsRestored()
 {
     e := V636KillEntries(),first := IGKBuild(e,"first"),all := IGKBuild(e,"all")
     V48Assert(first.Rows.Length=6 && all.Rows.Length=12,"all-pulls view retains subsequent farming attempts")
     V48Assert(IGKBuild(e,"invalid").Rows.Length=12,"invalid view has a non-destructive fallback")
 }
 
 V636TestNoKillYet()
 {
     e := V636KillEntries()
     for entry in e
         entry.Pull.Progress.Kill := false
     r := IGKBuild(e,"first")
     V48Assert(!r.Completed && r.Rows.Length=12 && InStr(r.Note,"No recorded kill yet"),"uncleared history keeps all attempts")
     r := IGKBuild(e,"reclear")
     V48Assert(r.Rows.Length=0 && r.Cycles.Length=0 && InStr(r.Note,"No recorded first kill"),"no invented reclear before first observed kill")
 }
 
 V636TestEmptyKillHistory()
 {
     for mode in ["all","first","reclear"] {
         r := IGKBuild([],mode)
         V48Assert(!r.Rows.Length && !r.Completed && !r.Cycles.Length,"empty history is not a clear")
     }
 }
 
 V636TestReclearCycles()
 {
     e := V636KillEntries(),r := IGKBuild(e,"reclear")
     V48Assert(r.Cycles.Length=2 && r.Cycles[1].Rows.Length=4 && r.Cycles[2].Rows.Length=2,"completed and ongoing reclears are distinct")
     V48Assert(!r.Completed && r.Rows[1]=e[11] && r.Rows[2]=e[12],"default is latest ongoing reclear")
     r := IGKBuild(e,"reclear",r.Cycles[1].Key)
     V48Assert(r.Completed && r.Rows[1]=e[7] && r.Rows[4]=e[10],"previous kill excluded; next kill included")
     V48Assert(InStr(r.Note,"4 team pulls to kill"),"reclear attempts include kill attempt")
 }
 
 V636TestConsecutiveKills()
 {
     e := V636KillEntries(),e := [e[6],e[10]],r := IGKBuild(e,"reclear")
     V48Assert(r.Cycles.Length=1 && r.Completed && r.Rows.Length=1,"one-shot reclear counts one pull")
     r := IGKBuild([e[1]],"reclear")
     V48Assert(!r.Rows.Length && !r.Cycles.Length && InStr(r.Note,"No pulls after"),"first kill without more attempts has no phantom reclear")
 }
 
 V636TestZeroHPIsNotKill()
 {
     e := V636KillEntries(),e[3].Pull.Progress.Hp := 0
     r := IGKBuild(e,"first")
     V48Assert(r.Rows.Length=6 && r.FirstKill=e[6],"zero boss HP without confirmed outcome never closes the first-kill window")
     e[6].Pull.Ended := false
     filtered := IGVSelectEntries(e,e[1].Pull.Group,"","A"),r := IGKBuild(filtered,"first")
     V48Assert(r.FirstKill=e[10],"open partial encounter cannot become a completed clear")
 }
 
 V636TestExcludedKillAndTrash()
 {
     e := V636KillEntries(),e[6].Pull.Included := false
     filtered := IGVSelectEntries(e,e[1].Pull.Group,"","A"),r := IGKBuild(filtered,"first")
     V48Assert(r.Rows.Length=9 && r.FirstKill=e[10],"existing user exclusions respected without changing them")
     V48Assert(!e[6].Pull.Included,"filter does not reinclude an excluded pull")
 }
 
 V636TestChronologicalKillCutoff()
 {
     e := V636KillEntries(),reverse := []
     Loop e.Length
         reverse.Push(e[e.Length-A_Index+1])
     r := IGKBuild(reverse,"first")
     V48Assert(r.Rows[1]=e[1] && r.Rows[6]=e[6],"input/import order cannot shift first clear")
 }
 
 V636TestNoNightlyReset()
 {
     e := V636KillEntries(),e[7].Date := "20260914",e[8].Date := "20260915",e[9].Date := "20260920"
     r := IGKBuild(e,"reclear"),r := IGKBuild(e,"reclear",r.Cycles[1].Key)
     V48Assert(r.Completed && r.TeamPulls=4,"attempts after previous kill can span multiple calendar dates")
 }
 
 V636TestCycleIdentityStable()
 {
     e := V636KillEntries(),r := IGKBuild(e,"reclear"),key := r.Cycles[1].Key
     newPull := IGVUnpackPull(IGVPackPull(e[1].Pull)),newPull.Start := 100000,newPull.End := 110000
     e.InsertAt(1,{Key:"older",Session:"older",Date:"20260901",Team:"A",Pull:newPull})
     r := IGKBuild(e,"reclear",key)
     V48Assert(r.Cycle=key && r.Completed && r.TeamPulls=4,"adding older logs keeps the selected prior-kill boundary instead of using cycle index")
     r := IGKBuild(e,"reclear","missing-key")
     V48Assert(!r.Completed && r.TeamPulls=2,"unavailable cycle falls back to latest, not stale rows")
 }
 
 V636TestTeamsDoNotMixKillBoundaries()
 {
     e := V636KillEntries(),e[1].Team := "B"
     r := IGKBuild(e,"first")
     V48Assert(r.NeedsTeam && !r.Rows.Length,"multiple team histories require explicit tag selection for a cutoff")
     V48Assert(IGKBuild(e,"all").Rows.Length=12,"all-tags full-history view still works")
     r := IGKBuild(IGVSelectEntries(e,e[2].Pull.Group,"","A"),"first")
     V48Assert(!r.NeedsTeam && r.TeamPulls=5 && r.FirstKill=e[6],"chosen team's first clear only")
 }
 
 V636TestCharacterAttendanceKeepsTeamBoundary()
 {
     e := V636KillEntries(),key := "@Little Bobby#Prog5"
     e[6].Pull.Players.Delete(key)
     r := IGKBuild(e,"first","",key)
     V48Assert(r.TeamPulls=6 && r.Rows.Length=5 && r.FirstKill=e[6] && !r.CharacterAtKill,"absence at kill does not move team first-clear boundary")
     V48Assert(InStr(r.Note,"absent at kill"),"character absence is explicit")
     r := IGKBuild(e,"reclear"),r := IGKBuild(e,"reclear",r.Cycles[1].Key,key)
     V48Assert(r.TeamPulls=4 && r.Rows.Length=4 && r.Rows[1]=e[7],"reclear still starts after team kill the character missed")
 }
 
 V636TestCharacterAbsentWholeCycle()
 {
     e := V636KillEntries(),r := IGKBuild(e,"first","","@Absent#none")
     V48Assert(r.Completed && r.TeamPulls=6 && !r.Rows.Length && !r.CharacterAtKill,"zero attended pulls is not a fabricated personal clear")
 }
 
 V636TestKillFilterDoesNotMutateHistory()
 {
     e := V636KillEntries(),before := []
     for entry in e
         before.Push(IGVJson(IGVPackPull(entry.Pull)))
     for mode in ["all","first","reclear"]
         IGKBuild(e,mode)
     for i,entry in e
         V48Assert(IGVJson(IGVPackPull(entry.Pull))==before[i],"graph slicing never rewrites counts, flags, activity, HP or inclusion")
 }
 
 V636TestTythAxisExplicit()
 {
     e := V636KillEntries(),m := IGVPlotModel(e,900,250)
     V48Assert(m.Axis.Kind="hp" && m.Axis.Percent && m.Axis.Title="Boss HP remaining (%)","fully new Tyth history uses real boss HP even with phase evidence")
     V48Assert(m.YTicks[1].Label="100%" && m.YTicks[m.YTicks.Length].Label="0%","Tyth percentage endpoints remain explicit")
     V48Assert(Abs(m.Points[1].Y-(m.Top+0.12*(m.Bottom-m.Top)))<0.001 && m.Points[6].Y=m.Bottom,"88 percent remaining and confirmed kill occupy correct health positions")
 }
 
 V636TestTythNoDataAxis()
 {
     m := IGVPlotModel([],900,250,1,"G-TY|833571547775765|836045448953655")
     V48Assert(m.Axis.Kind="hp" && m.YTicks.Length>=3 && m.YTicks[1].Label="100%" && !m.Points.Length,"empty Tyth selection retains an HP axis without fake points")
     e := V636KillEntries(),e[1].Pull.Progress := "",m := IGVPlotModel([e[1]],900,250)
     V48Assert(m.Axis.Kind="hp" && !m.Points[1].Known,"missing Tyth health remains a gap rather than a phase fallback")
 }
 
 V636TestTythScoreMatchesAxis()
 {
     e := V636KillEntries(),a := e[1],b := e[2]
     a.Pull.Progress.Hp := 1,b.Pull.Progress.Hp := 99
     a.Pull.Progress.Health := IGVDemoHealth(a.Pull,1,["4078419339902976"])
     b.Pull.Progress.Health := IGVDemoHealth(b.Pull,99,["4078419339902976"])
     m := IGVPlotModel([a,b],900,250)
     V48Assert(m.BestIndex=1 && m.Points[1].Y>m.Points[2].Y && IGVEntryScore(a)>IGVEntryScore(b),"default score and plot rank true HP even when observed phases would rank the opposite way")
     V48Assert(a.Pull.Progress.Hp=1 && a.Pull.Progress.Parsely.Order.Length=1,"HP choice does not rewrite health or recorded phase metadata")
 }
 
 V636TestOtherAxesPreserved()
 {
     council := IGVPlotModel(V631Entries(),900,250)
     rows := V634Entries(IGPCompact(V634Pair(150,150))),sisters := IGVPlotModel(rows,900,250)
     V48Assert(council.Axis.Kind="combined" && council.Axis.Percent && council.Points[17].Label="5.0% combined HP remaining","Council uses its observed four-boss weighted health")
     V48Assert(sisters.Axis.Kind="combined" && sisters.Points[1].Known && sisters.Points[1].Label="15.0% combined HP remaining","Sisters production view retains weighted combined health")
     V48Assert(Abs(sisters.Points[1].Y-(sisters.Top+0.85*(sisters.Bottom-sisters.Top)))<0.001,"Sisters 15 plus 15 plots at actual 15 percent remaining")
 }
 
 V636TestViewAndCycleSettings()
 {
     root := V635Temp(),path := root "\view.ini",entries := V636KillEntries(),r := IGKBuild(entries,"reclear")
     try {
         v := {Source:"history",Boss:entries[1].Pull.Group,Character:"",Team:"A",LastTeam:"A",DetailVisible:false,
             Window:"reclear",Cycle:r.Cycles[1].Key}
         IGLWriteView(v,path),read := IGLReadView(path)
         V48Assert(read.Window="reclear" && read.Cycle=v.Cycle,"view/cycle saved for next launch")
         restored := IGKBuild(entries,read.Window,read.Cycle)
         V48Assert(restored.Completed && restored.Rows.Length=4,"same saved reclear restored without raw logs")
         IniWrite("invalid",path,"IrisProgressionGraph","PullView"),read := IGLReadView(path)
         V48Assert(read.Window="all","corrupt view label cannot hide history")
     }
     finally DirDelete(root,true)
 }
 
 V636TestNewViewDefault()
 {
     root := V635Temp()
     try {
         read := IGLReadView(root "\missing.ini")
         V48Assert(read.Window="all" && read.Cycle="","existing installations retain full history by default")
     }
     finally DirDelete(root,true)
 }
 
 V636TestGraphFilterLayout()
 {
     for size in [[900,560],[960,570],[960,680],[1220,850]] {
         for detail in [false,true] {
             l := IGVLayout(size[1],size[2],detail)
             V48Assert(l.ChartY=153 && l.ChartY+l.ChartH<l.SelectedY,"chart starts below the compact filters; the retired summary row reserves no blank space")
             V48Assert(l.ChartH>=197 && l.ButtonY+67<=l.H,"chart, buttons and two-line status fit supported window sizes")
             if detail
                 V48Assert(l.RowsY+l.RowsH<=l.H && l.RowsH>=60,"expanded table has a nonoverlapping area")
         }
     }
 }
 
 V636TestHiddenKillWorkflow()
 {
     V61Hidden(V636HiddenKillCase)
 }
 V636HiddenKillCase()
 {
     IPWBuild(),p := IPRState(),p.Data := IGKDemoData(),p.Source := "demo",IGVOpen(),v := IGVState()
     try {
         v.Source := "history",v.DemoHistory := true,v.History := Map()
         for e in V636KillEntries()
             v.History[e.Key] := e
         v.Boss := p.Data.Pulls[1].Group,v.Character := "",v.Team := "*",v.Window := "first"
         IGVFillFilters(),IGVRefresh()
         V48Assert(v.Rows.Length=6 && v.Plot.Axis.Kind="hp","real graph path applies first-kill window and Tyth HP axis")
         v.Controls["Window"].Choose(3),IGKViewChanged("window")
         V48Assert(v.Rows.Length=2 && v.Controls["Cycle"].Enabled && v.CycleKeys.Length=2,"reclear mode selects latest open cycle")
         v.Controls["Cycle"].Choose(1),IGKViewChanged("cycle")
         V48Assert(v.Rows.Length=4 && v.WindowResult.Completed,"completed reclear selected by native control")
         IGVSelect(4),IGVInspectSelected()
         V48Assert(IPRState().DetailPull.Id=10,"drilldown keeps exact ending pull after graph is sliced")
         v.Controls["Window"].Choose(1),IGKViewChanged("window")
         V48Assert(v.Rows.Length=12 && !v.Controls["Cycle"].Enabled,"all pulls restores hidden future attempts")
     }
     finally IPRCloseDetails(),IGVClose()
 }
 
 V636TestNativeTythAxisPixels()
 {
     V61Hidden(V636TythAxisPixelsCase)
 }
 V636TythAxisPixelsCase()
 {
     g := Gui(),pic := g.AddPicture("w900 h250 +0x100"),paint := ""
     try {
         paint := IAPaintBegin(pic),z := A_ScreenDPI/96,e := V636KillEntries()
         m := IGVPlotModel(e,paint.W,paint.H,z)
         V48Assert(m.Axis.Kind="hp" && m.YTicks[1].Label="100%" && m.YTicks[m.YTicks.Length].Label="0%","native renderer receives the actual full HP scale")
         IAFill(paint,0,0,paint.W,paint.H,IUBColorRef("18131F"))
         for tick in m.YTicks
             V48Assert(V634BrightPixels(paint,8*z,tick.Y-8*z,m.Left-20*z,19*z)=0,"blank percentage rectangle is a negative pixel control")
         IGVPaintPlot(paint,m)
         for tick in m.YTicks
             V48Assert(V634BrightPixels(paint,8*z,tick.Y-8*z,m.Left-20*z,19*z)>20,"actual numeric HP glyphs painted: " tick.Label)
         V48Assert(V634BrightPixels(paint,14*z,30*z,330*z,22*z)>20,"actual boss-health title glyphs are painted")
         IAPaintEnd(paint),paint := ""
         V48Assert(SendMessage(0x172,0,0,pic)!=0,"HP-labelled native bitmap is attached to Picture")
     }
     finally {
         if IsObject(paint)
             IAPaintEnd(paint,false)
         g.Destroy()
     }
 }
 
 V636TestGraphReportPrivacy()
 {
     text := IGKGraphReport()
     for word in ["Little Bobby","@Demo","Prog1","C:\\Users","Demo team"]
         V48Assert(!InStr(text,word),"graph diagnostics omit sensitive identities and paths")
     V48Assert(InStr(text,"not verified display pixels"),"diagnostics do not claim verified screen appearance")
 }
 
 
 V636TestClearEndDateAcrossMidnight()
 {
     e := V636KillEntries()[6],e.Date := "20260927",e.Pull.Start := 86340000,e.Pull.End := 86460000
     V48Assert(IGDStamp(e).Text="27 Sep 2026 23:59:00" && IGDEndStamp(e).Text="28 Sep 2026 00:01:00","pull-start date and clear-end date differ correctly across midnight")
     r := IGKBuild([e],"first")
     V48Assert(InStr(r.Note,"28 Sep 2026 00:01:00"),"first-clear banner uses recorded pull end, not start or import date")
 }
 
 ; v64.3: manual-only numeric-axis regression checks; dates remain in pull details.
 V637TestNumericTicksWithoutCalendar()
 {
     points := [{X:164},{X:314},{X:464},{X:614}],ticks := IGDPlotTicks(points,164,614,1)
     V48Assert(ticks.Length=4 && ticks[1].Index=1 && ticks[4].Index=4,"numeric ticks need only point positions, not calendar fields")
     for tick in ticks
         V48Assert(!tick.HasOwnProp("Date") && tick.LabelX>=164 && tick.LabelX+tick.LabelW<=614,"no repeated dates or date placeholders in X-axis tick data")
     points := []
     Loop 1479
         points.Push({X:64+(A_Index-1)*900/1478})
     ticks := IGDPlotTicks(points,64,964,1),labels := []
     for tick in ticks
         labels.Push(tick.Index)
     V48Assert(IPRJoin(labels)=IPRJoin([1,250,500,750,1000,1250]),"1479 pulls use round quarter-thousand labels without rounding data")
     V48Assert(points.Length=1479 && points[1479].X=964,"unlabelled final pull remains at its original position")
     for count in [0,1,2,7,19,101,1479,1500,10000] {
         for z in [1,1.5,2] {
             for span in [120,300,900,1800] {
                 points := []
                 Loop count
                     points.Push({X:64*z+(count=1 ? span*z/2 : (A_Index-1)*span*z/(count-1))})
                 ticks := IGDPlotTicks(points,64*z,(64+span)*z,z),last := -1
                 V48Assert(ticks.Length<=6 && (!count || ticks[1].Index=1),"round labels stay bounded and begin with pull 1")
                 for tick in ticks {
                     V48Assert(tick.Index<=count && tick.X=points[tick.Index].X,"axis labels use exact pull positions")
                     V48Assert(tick.LabelX>=64*z && tick.LabelX+tick.LabelW<=(64+span)*z+0.001 && (last<0 || tick.LabelX>=last+2*z),"round label boxes remain inside the graph and do not overlap")
                     last := tick.LabelX+tick.LabelW
                 }
             }
         }
     }
 }
 
 V637TestRepeatedDatesInHover()
 {
     entries := V636KillEntries(),first := IGVPointLabel(entries[1],1),second := IGVPointLabel(entries[2],2)
     V48Assert(InStr(first,"13 Sep 2026") && InStr(second,"13 Sep 2026"),"two pulls on the same date both retain full hover dates")
     V48Assert(InStr(first,IGDStamp(entries[1]).Clock) && InStr(second,IGDStamp(entries[2]).Clock),"each hover retains its own recorded time")
     m := IGVPlotModel(entries,900,250)
     for tick in m.Ticks
         V48Assert(!tick.HasOwnProp("Date"),"duplicate dates are never repeated along the X-axis")
     V48Assert(entries.Length=12 && m.Points.Length=12,"date cleanup does not drop any pulls")
 }
 
 V637TestNumericAxisInKillViews()
 {
     entries := V636KillEntries(),first := IGKBuild(entries,"first"),ongoing := IGKBuild(entries,"reclear")
     cleared := IGKBuild(entries,"reclear",ongoing.Cycles[1].Key)
     V48Assert(first.Rows.Length=6 && cleared.Rows.Length=4 && ongoing.Rows.Length=2,"first kill and completed/ongoing reclear slices retained")
     for window in [first,cleared,ongoing] {
         for scale in [1,1.5,2] {
             m := IGVPlotModel(window.Rows,Round(900*scale),Round(250*scale),scale)
             V48Assert(m.Axis.Kind="hp" && m.Axis.Percent && m.YTicks.Length>=3,"Tyth keeps labelled HP in every first-kill and reclear view")
             V48Assert(m.Bottom+41*scale<=m.Height+0.001,"numeric tick and caption fit without a separate date row")
             V48Assert(m.Ticks[1].Index=1 && m.Ticks[m.Ticks.Length].Index=window.Rows.Length,"view-relative pull numbering remains intact")
         }
     }
 }
 ; v64.3 regressions: test-runner protocol/policy only; no real 120-second sleeps.
 V638Header(total := 2)
 {
     return "Iris synthetic runner fixture`r`nGroups registered: " total "`r`n"
 }
 
 V638TestLoadDeadline()
 {
     V48Assert(IrisTestTimeout("load",30000,30000)="","load deadline boundary retained")
     V48Assert(InStr(IrisTestTimeout("load",30001,0),"Load check"),"load still has a finite 30-second deadline")
     V48Assert(IrisTestTimeout("preparing",900001,900001)="","no running-child timeout in preparation")
 }
 
 V638TestLogicStartupDeadline()
 {
     V48Assert(IrisTestTimeout("logic",30001,30001)="","logic is not terminated at the old whole-suite deadline")
     V48Assert(IrisTestTimeout("logic",120000,120000)="","startup gets full no-progress allowance")
     V48Assert(InStr(IrisTestTimeout("logic",120001,120001),"120 seconds"),"missing startup progress still stops")
 }
 
 V638TestHealthyLongSuite()
 {
     m := IrisTestNewMonitor(1000),text := V638Header(80)
     Loop 80 {
         text .= "RUN " A_Index "/80 Fixture`r`nPASS Fixture | 1 ms`r`n"
         now := 1000+A_Index*1000,IrisTestObserveProgress(m,text,now)
         V48Assert(IrisTestTimeout("logic",now-1000,now-m.LastProgress)="","genuine group progress continues beyond 30 seconds")
     }
     V48Assert(m.Progress.Done=80 && !m.Progress.Complete,"returned groups alone do not fabricate completion")
 }
 
 V638TestStalledGroup()
 {
     m := IrisTestNewMonitor(0)
     IrisTestObserveProgress(m,V638Header() "RUN 1/2 Fixture`r`n",1000)
     V48Assert(m.Progress.Current="Fixture" && m.Progress.Done=0,"running group retained before it returns")
     V48Assert(InStr(IrisTestTimeout("logic",121001,121001-m.LastProgress),"120 seconds"),"a stuck group is stopped independently of the suite size")
 }
 
 V638TestProgressResetsDeadline()
 {
     m := IrisTestNewMonitor(0),text := V638Header() "RUN 1/2 First`r`n"
     IrisTestObserveProgress(m,text,10)
     text .= "PASS First | 119000 ms`r`nRUN 2/2 Second`r`n"
     IrisTestObserveProgress(m,text,119010)
     V48Assert(m.LastProgress=119010 && m.Progress.Done=1 && m.Progress.Current="Second","new group resets idle deadline")
     V48Assert(IrisTestTimeout("logic",130000,130000-m.LastProgress)="","old group time does not kill the next group")
 }
 
 V638TestRepeatedReadNotHeartbeat()
 {
     m := IrisTestNewMonitor(0),text := V638Header() "RUN 1/2 Fixture`r`n"
     IrisTestObserveProgress(m,text,1000),IrisTestObserveProgress(m,text,120000)
     V48Assert(m.LastProgress=1000,"rereading an unchanged journal is not progress")
 }
 
 V638TestNoiseNotHeartbeat()
 {
     m := IrisTestNewMonitor(0),text := V638Header() "RUN 1/2 Fixture`r`n"
     IrisTestObserveProgress(m,text,1000),IrisTestObserveProgress(m,text "still alive`r`n",120000)
     V48Assert(m.LastProgress=1000,"unrelated text cannot keep a hung group alive")
 }
 
 V638TestOverallSafetyLimit()
 {
     V48Assert(IrisTestTimeout("logic",900000,0)="","overall boundary is inclusive")
     V48Assert(InStr(IrisTestTimeout("logic",900001,0),"15-minute"),"recent progress cannot disable overall ceiling")
 }
 
 V638TestWideMonotonicClock()
 {
     start := 4294967290,m := IrisTestNewMonitor(start)
     IrisTestObserveProgress(m,V638Header() "RUN 1/2 Fixture`r`n",start+10000)
     V48Assert(m.LastProgress=start+10000 && IrisTestTimeout("logic",10001,1)="","watchdog data is not a wrapped 32-bit tick")
     before := IrisTestNow(),after := IrisTestNow()
     V48Assert(after>=before && Type(after)="Integer","native clock is a monotonic integer")
 }
 
 V638TestFinishedAndCurrentCounts()
 {
     p := IrisTestParseProgress(V638Header() "RUN 1/2 First`r`nPASS First | 3 ms`r`nRUN 2/2 Second`r`n")
     V48Assert(p.Valid && p.Total=2 && p.Done=1 && p.Started=2 && p.Current="Second" && p.Last="Second","report separates completed and current groups")
 }
 
 V638TestFailureRetained()
 {
     p := IrisTestParseProgress(V638Header(1) "RUN 1/1 Broken`r`nFAIL Broken: synthetic assertion | 5 ms`r`nIRIS-V48-TESTS-COMPLETE`r`n")
     V48Assert(p.Complete && p.Done=1 && p.Failed=1,"a completed failing suite retains its failure; caller must reject it")
 }
 
 V638TestPrematureCompletionRejected()
 {
     p := IrisTestParseProgress(V638Header() "RUN 1/2 First`r`nPASS First | 1 ms`r`nIRIS-V48-TESTS-COMPLETE`r`n")
     V48Assert(!p.Valid && !p.Complete,"completion cannot hide an unexecuted group")
 }
 
 V638TestMissingCompletionRejected()
 {
     p := IrisTestParseProgress(V638Header(1) "RUN 1/1 First`r`nPASS First | 1 ms`r`n")
     V48Assert(p.Valid && p.Done=1 && !p.Complete,"exit without the final marker is not a pass")
 }
 
 V638TestInvalidOrderingRejected()
 {
     for text in [V638Header() "RUN 2/2 Second`r`n",V638Header() "PASS First | 1 ms`r`n",
         V638Header() "RUN 1/2 First`r`nPASS Other | 1 ms`r`n",V638Header() "RUN 1/3 First`r`n"] {
         p := IrisTestParseProgress(text)
         V48Assert(!p.Valid && !p.Complete,"missing/mismatched group protocol rejected")
     }
 }
 
 V638TestPartialLineIgnored()
 {
     text := V638Header(1) "RUN 1/1 First`r`nPASS First | 1 ms"
     p := IrisTestParseProgress(text)
     V48Assert(p.Done=0 && p.Current="First","partial result line is not counted before newline")
     p := IrisTestParseProgress(text "`r`nIRIS-V48-TESTS-COMPLETE`r`n")
     V48Assert(p.Complete && p.Done=1,"full appended lines become a valid complete result")
 }
 
 V638TestIncrementalJournalFile()
 {
     path := A_ScriptDir "\Iris_v638_journal_fixture.txt"
     if FileExist(path)
         throw Error("Journal test fixture already exists.")
     try {
         IrisTestWriteText(path,V638Header())
         IrisTestJournalWrite(path,"RUN 1/2 First`r`n")
         p := IrisTestParseProgress(FileRead(path,"UTF-8"))
         V48Assert(p.Current="First" && p.Done=0,"RUN reaches the actual file before group completion")
         IrisTestJournalWrite(path,"PASS First | 1 ms`r`nRUN 2/2 Second`r`n")
         p := IrisTestParseProgress(FileRead(path,"UTF-8"))
         V48Assert(p.Done=1 && p.Current="Second" && !p.Complete,"completed prefix survives a later incomplete group")
     }
     finally {
         if FileExist(path)
             FileDelete(path)
     }
 }
 
 V638TestCaptureAfterCancellation()
 {
     global IrisTests
     old := IrisTests,folder := A_ScriptDir "\Iris_v638_capture_fixture"
     if DirExist(folder)
         throw Error("Capture fixture already exists.")
     DirCreate(folder)
     try {
         IrisTestWriteText(folder "\Iris_v48_Native_Test_Report.txt",V638Header() "RUN 1/2 First`r`nPASS First | 1 ms`r`nRUN 2/2 Second`r`n")
         IrisTests := {Stage:"logic",Folder:folder,Report:"TIMEOUT`r`n",Cancelling:true,Monitor:IrisTestNewMonitor(IrisTestNow())}
         V48Assert(!IrisTestCaptureProgress(),"stopped partial suite is incomplete")
         V48Assert(InStr(IrisTests.Report,"PASS First") && InStr(IrisTests.Report,"last started: Second"),"cancel path retains finished results and last group")
         first := IrisTests.Report,IrisTestCaptureProgress()
         V48Assert(IrisTests.Report=first,"finish and cancel cannot append the same report twice")
     }
     finally {
         IrisTests := old
         DirDelete(folder,true)
     }
 }
 
 V638TestLiveReportComposition()
 {
     global IrisTests
     old := IrisTests,m := IrisTestNewMonitor(0)
     try {
         IrisTestObserveProgress(m,V638Header() "RUN 1/2 First`r`n",100)
         IrisTests := {Report:"Parent header`r`n",Monitor:m}
         text := IrisTestReportText()
         V48Assert(InStr(text,"Parent header")=1 && InStr(text,"RUN 1/2 First"),"copy/save can include current progress")
         m.Appended := true,IrisTests.Report .= m.Native
         V48Assert(IrisTestReportText()=IrisTests.Report,"final composed report has no duplicate native tail")
     }
     finally IrisTests := old
 }
 
 V638TestEmptyReportNeverPasses()
 {
     p := IrisTestParseProgress("")
     V48Assert(p.Valid && !p.Complete && p.Done=0 && p.Last="","empty output cannot certify a pass")
     p := IrisTestParseProgress("IRIS-V48-TESTS-COMPLETE`r`n")
     V48Assert(!p.Valid && !p.Complete,"marker without registry/results is rejected")
 }
 
 V638TestCompleteReport()
 {
     p := IrisTestParseProgress(V638Header() "RUN 1/2 First`r`nPASS First | 1 ms`r`nRUN 2/2 Second`r`nPASS Second | 2 ms`r`nIRIS-V48-TESTS-COMPLETE`r`n")
     V48Assert(p.Complete && p.Done=2 && p.Failed=0 && p.Current="","all groups plus marker are required")
 }
 
 V638TestDuplicateCompletionRejected()
 {
     text := V638Header(1) "RUN 1/1 First`r`nPASS First | 1 ms`r`nIRIS-V48-TESTS-COMPLETE`r`n"
     p := IrisTestParseProgress(text "IRIS-V48-TESTS-COMPLETE`r`n")
     V48Assert(!p.Valid && !p.Complete,"duplicate final marker is not accepted")
 }
 
 V638TestNewRunIsClean()
 {
     m := IrisTestNewMonitor(5000)
     V48Assert(m.Native="" && m.Signature="" && !m.Appended && !m.Progress.Complete && m.LastProgress=5000,"new run cannot inherit old results or an old progress clock")
 }
 ; v64.3: history JSON correctness; the 12,001-entry disk roundtrip remains registered.
 V639Equal(a,b)
 {
     if Type(a)!=Type(b)
         return false
     if a is Array {
         if a.Length!=b.Length
             return false
         for i,value in a
             if !V639Equal(value,b[i])
                 return false
         return true
     }
     if a is Map {
         if a.Count!=b.Count
             return false
         for key,value in a
             if !b.Has(key) || !V639Equal(value,b[key])
                 return false
         return true
     }
     return a==b
 }
 V639Reject(text)
 {
     try IGJParse(text)
     catch Error
         return true
     return false
 }
 V639HistoryStage(message)
 {
     ; Informational only: NOTE records do not reset the group-stall watchdog.
     IrisTestJournalWrite(A_ScriptDir "\Iris_v48_Native_Test_Report.txt",
         "NOTE V633TestHistoryOver12000: " message "`r`n")
 }
 V639Clean(path)
 {
     for file in [path,path ".bak",path ".tmp-" DllCall("GetCurrentProcessId","UInt")]
         if FileExist(file)
             FileDelete(file)
 }
 V639TestScalars()
 {
     for text in ['""','"ordinary"','0','-42','12.5','true','false','null']
         V48Assert(V639Equal(IGJParse(text),ParseJson(text)),"history scalar preserves existing decoded value and type")
 }
 V639TestContainers()
 {
     for text in ['[]','{}','[[],{},[1,[2]]]','{"alpha":[1,true,null],"beta":{"x":"y"}}']
         V48Assert(V639Equal(IGJParse(text),ParseJson(text)),"arrays and object nesting retain previous representation")
 }
 V639TestWhitespace()
 {
     text := "`t`r`n" '[ 1 , "x" , [2] ]' "`r`n "
     V48Assert(V639Equal(IGJParse(text),ParseJson(text)),"JSON whitespace is skipped without copying the whole document")
 }
 V639TestNumberForms()
 {
     for text in ['0','-0','123','-123','0.25','-0.25','1e3','1E-3','-4.5e+2','2147483648','9007199254740991']
         V48Assert(V639Equal(IGJParse(text),ParseJson(text)),"integer decimal exponent and large numeric forms agree")
 }
 V639TestNumberCursor()
 {
     text := "[123,-4.5e+2]",pos := 2
     V48Assert(IGJReadNumber(&text,&pos)=123 && pos=5,"first token stops at comma")
     pos := 6
     V48Assert(IGJReadNumber(&text,&pos)=-450 && pos=13,"exponent token stops at closing bracket")
 }
 V639TestNumberNoSkip()
 {
     for text in ["x1","[x1]","[1 x2]","[,,1]","NaN","Infinity"]
         V48Assert(V639Reject(text),"reader does not search forward past an invalid token")
     text := "123,",tail := ""
     Loop 6000
         tail .= "unused"
     text .= tail,pos := 1
     V48Assert(IGJReadNumber(&text,&pos)=123 && pos=4 && SubStr(text,4)="," tail,"number consumes only its own span")
 }
 V639TestMalformedNumbers()
 {
     for text in ["01","-01","1.","1e","1e+","--1","+1",".5","1+2","1e2e3"]
         V48Assert(V639Reject(text),"invalid JSON numeric spelling is rejected")
 }
 V639TestTrailing()
 {
     for text in ['[1]junk','{} []','1 2','truefalse','"x"0']
         V48Assert(V639Reject(text),"trailing values or garbage cannot be silently accepted")
 }
 V639TestTruncated()
 {
     for text in ["","[","{",'[1,','{"x":','"unterminated', '[1,]', '{"x":1,}']
         V48Assert(V639Reject(text),"truncated or trailing-comma input fails rather than looping")
 }
 V639TestEscapes()
 {
     value := Chr(34) Chr(92) "/" Chr(8) Chr(12) "`n`r`t"
     V48Assert(IGJParse(IGVJson(value))==value,"quote slash and escaped controls survive encoding")
     for text in ['"\""','"\\"','"\/"','"\n\r\t\b\f"','"\u0041\u03b1"']
         V48Assert(V639Equal(IGJParse(text),ParseJson(text)),"escape decoding matches existing reader")
 }
 V639TestInvalidEscapes()
 {
     for text in ['"\x41"','"\u12x4"','"\u123"','"\','"\u']
         V48Assert(V639Reject(text),"invalid or truncated escape fails")
 }
 V639TestControls()
 {
     value := ""
     Loop 31 {
         ch := Chr(A_Index),value .= ch
         V48Assert(V639Reject(Chr(34) ch Chr(34)),"unescaped JSON control rejected")
     }
     V48Assert(IGJParse(IGVJson(value))==value,"all 31 supported control escapes still roundtrip")
 }
 V639TestUnicode()
 {
     for value in ["Raïd","Αλφα","紫の翼","Zoë's team",Chr(0x1F33A)]
         V48Assert(IGJParse(IGVJson(value))==value,"literal Unicode preserved")
 }
 V639TestDepth()
 {
     text := "1"
     Loop 32
         text := "[" text "]"
     V48Assert(V639Equal(IGJParse(text),ParseJson(text)),"existing depth boundary accepted")
     V48Assert(V639Reject("[" text "]"),"existing 32-level nesting safeguard retained")
 }
 V639TestInputImmutable()
 {
     text := '[1,"unchanged",[2.5]]',before := text
     parsed := IGJParse(text)
     V48Assert(text==before && parsed[3][1]=2.5,"borrowed text is not modified")
 }
 V639TestSerializerEquivalent()
 {
     values := ["ordinary","",Chr(34),Chr(92),"Raïd",[1,-2.5,"nested"]]
     Loop 31
         values.Push("a" Chr(A_Index) "z")
     for value in values
         V48Assert(IGVJson(value)==V639OldJson(value),"fast escape gate leaves serialized bytes unchanged")
 }
 V639TestPullRoundTrip()
 {
     pull := IGVDemoData().Pulls[17],packed := IGVPackPull(pull)
     restored := IGVUnpackPull(IGJParse(IGVJson(packed)))
     V48Assert(IGVJson(IGVPackPull(restored))==IGVJson(packed),"per-pull deaths activity roles and phase metadata retained")
 }
 V639TestSistersRoundTrip()
 {
     pull := V634Entries(IGPCompact(V634Pair(150,150)))[1].Pull
     restored := IGVUnpackPull(IGJParse(IGVJson(IGVPackPull(pull))))
     V48Assert(restored.Progress.Profile=IGPSistersKey() && Abs(restored.Progress.Hp-15)<0.0001,"combined sisters metadata survives history reader")
 }
 V639TestHistoryFileRoundTrip()
 {
     path := A_Temp "\Iris_v639_small_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount ".json"
     history := Map(),pulls := IGVDemoData().Pulls
     for i,pull in pulls {
         key := "synthetic-" i
         history[key] := {Key:key,Session:"synthetic",Date:"20260928",Team:"Synthetic",Pull:pull}
     }
     try {
         IGVWriteHistory(history,path),loaded := IGVReadHistory(path)
         V48Assert(loaded.Count=17,"actual history IO uses optimized reader")
         for key,entry in history
             V48Assert(IGVJson(IGVPackPull(loaded[key].Pull))==IGVJson(IGVPackPull(entry.Pull)),"stored detailed summaries unchanged")
     }
     finally V639Clean(path)
 }
 V639TestHistorySchemaStillChecked()
 {
     path := A_Temp "\Iris_v639_invalid_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount ".json"
     try {
         for text in ['[9,[]]','[1,{}]','[1,[["","x","20260928","",[]]]]','[1,[]]garbage'] {
             if FileExist(path)
                 FileDelete(path)
             FileAppend(text,path,"UTF-8")
             failed := false
             try IGVReadHistory(path)
             catch Error
                 failed := true
             V48Assert(failed,"syntax optimization does not bypass schema or identity validation")
         }
     }
     finally V639Clean(path)
 }
 V639TestStageNotesNotProgress()
 {
     m := IrisTestNewMonitor(0),text := "Groups registered: 1`nRUN 1/1 V633TestHistoryOver12000`n"
     IrisTestObserveProgress(m,text,10)
     IrisTestObserveProgress(m,text "NOTE V633TestHistoryOver12000: file verified`n",60000)
     V48Assert(m.LastProgress=10 && m.Progress.Done=0 && !m.Progress.Complete,"stage notes cannot hide a stalled group or imply a pass")
 }
 
 V639OldJson(value,depth := 0)
 {
     if depth>16
         throw ValueError("History nesting limit exceeded.")
     if value is Array {
         out := "["
         for i,item in value
             out .= (i>1 ? "," : "") V639OldJson(item,depth+1)
         return out "]"
     }
     if Type(value)="Integer" || Type(value)="Float"
         return Format("{}",value)
     if Type(value)!="String"
         throw TypeError("History contains an unsupported value.")
     slash := Chr(92),text := StrReplace(value,slash,slash slash)
     text := StrReplace(text,Chr(34),slash Chr(34))
     Loop 31
         text := StrReplace(text,Chr(A_Index),Format(slash "u{:04x}",A_Index))
     return Chr(34) text Chr(34)
 }
 
 ; v64.3: diagnostic fixtures and actual cleanup-return regressions.
 ; Only extracted into the existing isolated manual test child.
 V6310AssertCleanup(entry,context)
 {
     V48Assert(entry.HasOwnProp("Cleanup"),context ": cleanup produced native results")
     r := entry.Cleanup
     V48Assert(r.FontAttempts=2,context ": attempted both owned font releases")
     V48Assert(r.Bold!=0,context ": DeleteObject(bold) returned " r.Bold)
     V48Assert(r.Normal!=0,context ": DeleteObject(normal) returned " r.Normal)
     V48Assert(r.ImageAttempts=1 && r.Images!=0,context ": ImageList_Destroy returned " r.Images)
     V48Assert(r.Complete && entry.Bold=0 && entry.Normal=0 && entry.Images=0,context ": successful ownership retired")
 }
 
 V6310TestBulkFixtureInRange()
 {
     V598WithReview(V6310BulkFixtureCase)
 }
 V6310BulkFixtureCase(a,d)
 {
     before := d.Rows.Length,j := V598LargeQuery(a,d),count := 0
     V48Assert(d.Rows.Length=before+3000,"same 3,000-event bulk workload retained")
     Loop 3000 {
         ev := d.Rows[before+A_Index]
         V48Assert(ev.RawMs=Mod(ev.Analysis.At,86400000),"raw clock and analysis timestamp agree")
         if IAInRange(ev,j.Query,d)
             count += 1
     }
     V48Assert(count=3000,"every added bulk-fixture event is inside the queried fight")
     IAQueryPump()
     V48Assert(a.QueryTiming.Outcome="COMPLETE","valid large query actually finishes")
 }
 
 V6310TestRangeBoundariesStayStrict()
 {
     d := {Start:3600000,Last:3620000},q := {Full:true,FirstSeq:0,LastSeq:0}
     for at in [3599999,3620001] {
         ev := {Analysis:{At:at,Accepted:false,Seq:1}}
         V48Assert(!IAInRange(ev,q,d),"out-of-fight records are still rejected")
     }
     for at in [3600000,3610000,3620000] {
         ev := {Analysis:{At:at,Accepted:false,Seq:1}}
         V48Assert(IAInRange(ev,q,d),"whole-fight endpoints and interior remain eligible")
     }
     q := {Full:false,FirstSeq:0,LastSeq:0,From:3600000,To:3610000}
     V48Assert(!IAInRange({Analysis:{At:3610000,Accepted:true,Seq:1}},q,d),"adjacent subranges do not double-count their boundary")
 }
 
 V6310TestPartialPositionNotApplied()
 {
     V572Isolated(V6310PartialPositionCase)
 }
 V6310PartialPositionCase()
 {
     global IPM,SETTINGS_FILE
     for point in [[-440,""],["",180]] {
         IPM := IPMNewState(),IPM.Source := 2,IPM.ParserWarnRestart := false
         IPM.Panel.X := point[1],IPM.Panel.Y := point[2]
         IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings()
         V48Assert(IPM.Panel.X="" && IPM.Panel.Y="","incomplete coordinate pairs are not invented on load")
         V48Assert(IPM.Source=2 && !IPM.ParserWarnRestart,"unrelated valid preferences still load")
         V48Assert(!IPM.Wanted && !IPM.TimerOn && !IPM.Editing,"loading preferences remains dormant")
     }
     IPM.Panel.X := 0,IPM.Panel.Y := 0
     IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings()
     V48Assert(IsInteger(IPM.Panel.X) && IsInteger(IPM.Panel.Y) && IPM.Panel.X=0 && IPM.Panel.Y=0,"complete zero coordinates are not mistaken for missing values")
 }
 
 V6310TestLegacyNoChangeAfterReload()
 {
     path := A_Temp "\Iris_v6310_legacy_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount ".json"
     if FileExist(path) || FileExist(path ".bak")
         throw Error("Private legacy-history test path already exists.")
     p := V635Pull(),h := IGVAddHistory(Map(),[p],"raid.txt","20260927","A")
     key := IGVHistoryKey("raid.txt",p)
     try {
         IGVWriteHistory(h,path),stored := IGVReadHistory(path)
         before := IGVJson(IGVPackPull(stored[key].Pull))
         incoming := IGVUnpackPull(IGVPackPull(p))
         same := IGLMerge(stored,[incoming],"raid.txt","20260927","A")
         V48Assert(same.History.Count=1 && same.Unchanged=1 && same.Updated=0 && same.Overlaps=0,"unchanged legacy reimport stays unchanged after a real file round trip")
         incoming.Progress.Hp := incoming.Progress.Hp=50 ? 40 : 50
         changed := IGLMerge(stored,[incoming],"raid.txt","20260927","A")
         V48Assert(changed.History.Has(key) && changed.History[key].Session="raid.txt","matching legacy key is kept rather than cloned into another recording")
         V48Assert(changed.Updated=1 && changed.Added=0 && changed.Overlaps=0,"independent changed incoming pull is a real update")
         V48Assert(IGVJson(IGVPackPull(stored[key].Pull))==before,"merge leaves the frozen earlier history untouched")
         nextDay := IGLMerge(stored,[incoming],"raid.txt","20260928","A")
         V48Assert(nextDay.History.Count=2 && nextDay.Added=1,"different recording dates remain distinct")
     }
     finally {
         for file in [path,path ".bak",path ".tmp-" DllCall("GetCurrentProcessId","UInt")] {
             if FileExist(file)
                 FileDelete(file)
         }
     }
 }
 
 V6310TestRepeatedFightListCleanup()
 {
     V61Hidden(V6310RepeatedCleanupCase)
 }
 V6310RepeatedCleanupCase()
 {
     IGFShutdown()
     g := ""
     try {
         g := Gui(),lv := g.AddListView("w240 h140 -Multi",["Fight","Seconds","Origin","Key"])
         hwnd := lv.Hwnd
         Loop 16 {
             V48Assert(IGFRegister(lv),"private fight list registers for cleanup cycle")
             entry := IGFState().Lists[hwnd],oldImages := entry.OldImages
             V48Assert(IGFDetach(hwnd),"native cleanup reports success")
             V6310AssertCleanup(entry,"repeat cleanup")
             V48Assert(!IGFState().Lists.Has(hwnd) && SendMessage(0x1002,1,0,lv)=oldImages,"no stale renderer or spacer-list attachment")
             V48Assert(!IGFDetach(hwnd),"second detach does not release a resource twice")
         }
     }
     finally {
         IGFShutdown()
         if IsObject(g)
             g.Destroy()
     }
 }
 
 V6310TestFailedCleanupNotReportedSuccessful()
 {
     V61Hidden(V6310FailedCleanupCase)
 }
 V6310FailedCleanupCase()
 {
     ; Deliberately invalid HGDI_ERROR in an isolated entry. Keep the real font
     ; separately and release it in finally; no user window/state is involved.
     IGFShutdown()
     g := "",normal := 0,entry := "",beforeFailures := IGFState().Failures
     try {
         g := Gui(),lv := g.AddListView("w240 h140 -Multi",["Fight","Seconds","Origin","Key"])
         V48Assert(IGFRegister(lv),"private negative-cleanup fixture registers")
         hwnd := lv.Hwnd,entry := IGFState().Lists[hwnd],normal := entry.Normal
         entry.Normal := -1
         result := IGFDetach(hwnd),r := entry.Cleanup
         V48Assert(!result && !r.Complete && r.Normal=0,"failed native deletion cannot be reported as successful cleanup")
         V48Assert(r.FontAttempts=2 && r.Bold!=0 && r.Images!=0,"failure of one resource does not skip other releases")
         V48Assert(IGFState().Failures=beforeFailures+1,"failed cleanup is recorded")
         V48Assert(entry.Normal=-1 && entry.Bold=0 && entry.Images=0,"only successful releases clear their ownership fields")
     }
     finally {
         if IsObject(entry) && entry.Normal=-1 && normal
             entry.Normal := normal,normal := 0
         IGFShutdown()
         if IsObject(g)
             g.Destroy()
         if normal
             DllCall("Gdi32\DeleteObject","Ptr",normal,"Int")
         IGFState().Failures := beforeFailures
     }
 }
 ; v64.3: manual-only death recap regressions; all UI fixtures are hidden.
 V64Row(at,kind := "Health",hp := 800,maximum := 1000,record := 1)
 {
     return {At:at,Record:record,Kind:kind,Source:"Synthetic boss",SourceKey:"N:6402",Ability:"Synthetic hit",AbilityId:"6402",
         Amount:200,Effective:-1,HP:hp,Maximum:maximum,Immune:false,Absorbed:false,Crit:false}
 }
 V64Recap()
 {
     r := {Key:"@Synthetic Player#641",At:20000,Record:100,From:8000,Source:"Synthetic boss",SourceKey:"N:6402",Partial:false,Rows:[]}
     r.Rows.Push(V64Row(8000,"Health",1000,1000,1),V64Row(12000,"Damage",600,1000,2),V64Row(15000,"Heal",800,1000,3),V64Row(20000,"Damage",0,1000,99))
     r.Rows[3].Effective := 200,r.Rows[3].Amount := 300,r.Rows[4].Amount := 900
     return r
 }
 V64Line(at,source,target,kind := "Damage",amount := 100,hp := -1)
 {
     ev := IPParseLine(IPDemoLine(at,source,target,kind,amount,false,hp,"Synthetic hit","6402"))
     ev.RecordId := at
     return ev
 }
 V64Actor(hp := 1000)
 {
     return "@Recap Tester#641|(0,0,0,0)|(" hp "/1000)"
 }
 V64Boss()
 {
     return "Operations Training Dummy {2857785339412480}:6401|(0,0,0,0)|(900000/1000000)"
 }
 V64Frozen()
 {
     s := IPNewData(),seg := IPNewSegment(s,0,"synthetic")
     ev := V64Line(18000,V64Boss(),V64Actor(100),"Damage",100)
     IDTObserve(seg,ev,18000)
     ev := V64Line(20000,V64Boss(),V64Actor(0),"Damage",200)
     IDTObserve(seg,ev,20000)
     death := {Key:ev.Target.Key,Name:ev.Target.Name,At:20000,Record:20001,Clock:IPStamp(20000)}
     IDTFreeze(seg,ev,death)
     return {State:s,Segment:seg,Death:death,Id:IDTCaseKey(death)}
 }
 V64Reject(action,message)
 {
     bad := false
     try action.Call()
     catch Error
         bad := true
     V48Assert(bad,message)
 }
 V64TestInertDefaults()
 {
     d := IDTNewUI(),c := IDTNewCapture()
     V48Assert(!d.Hook && !d.Busy && !IsObject(d.Pinned) && c.Cases.Count=0 && c.Windows.Count=0,"death UI starts dormant with empty capture")
 }
 V64TestTabAppend()
 {
     tabs := IPWTabs()
     V48Assert(tabs.Length=13 && tabs[1]="Log Library" && tabs[2]="Raid" && tabs[3]="Progression" && tabs[IPWTabPosition(8)]="Analysis" && tabs[IPWTabPosition(10)]="Rotation" && tabs[IPWTabPosition(9)]="Deaths","all pages remain present after navigation reorder")
     for i,id in [13,7,11,9,12,10,8,1,2,3,4,5,6]
         V48Assert(IPWTabLogical(i)=id && IPWTabPosition(id)=i,"stable original logical/physical routes")
 }
 V64TestWindowBounds()
 {
     p := IDTDemoData()
     V48Assert(p.Deaths.Length=2 && p.DeathRecaps.Count=2,"two counted deaths have two recaps")
     for death in p.Deaths {
         r := IDTCase(p,death)
         V48Assert(r.From=Max(p.Start,death.At-12000),"exact twelve-second window")
         for row in r.Rows
             V48Assert(row.At>=r.From && row.At<=r.At && (row.At<r.At || row.Record<=r.Record),"no event beyond death's time/order boundary")
     }
 }
 V64TestFrozenIndependentOfRing()
 {
     f := V64Frozen(),before := f.Segment.DeathCapture.Cases[f.Id].Rows.Length
     Loop 2000 {
         at := 50000+A_Index
         IDTObserve(f.Segment,V64Line(at,V64Boss(),V64Actor(900)),at)
     }
     V48Assert(f.Segment.DeathCapture.Cases[f.Id].Rows.Length=before && f.Segment.DeathCapture.Windows[f.Death.Key][1].At>f.Death.At,"old recap survives rolling-window eviction and old event-ring size")
 }
 V64TestCompactIsolation()
 {
     f := V64Frozen(),copy := IDTCompact(f.Segment,[f.Death])
     copy[f.Id].Rows[1].HP := 777
     V48Assert(f.Segment.DeathCapture.Cases[f.Id].Rows[1].HP=100,"compact rows do not alias live capture rows")
 }
 V64TestSeparateRepeatedDeaths()
 {
     p := IDTDemoData(),a := IDTCase(p,p.Deaths[1]),b := IDTCase(p,p.Deaths[2])
     V48Assert(a.At<b.At && IDTCaseKey(a)!=IDTCaseKey(b),"resurrection does not erase or combine deaths")
     V48Assert(InStr(IDTCause(a).Text,"heavy strike") && InStr(IDTCause(b).Text,"follow-up"),"each death has its own final hit")
 }
 V64TestDuplicateDeathCount()
 {
     s := IPNewData(),boss := V64Boss(),who := V64Actor(0)
     IPFeedLine(s,IPDemoLine(0,V64Actor(),"=","Enter"))
     IPFeedLine(s,IPDemoLine(100,V64Actor(),boss,"Damage",100))
     IPFeedLine(s,IPDemoLine(1000,boss,who,"Damage",1000))
     IPFeedLine(s,IPDemoLine(1000,boss,who,"Death"))
     IPFeedLine(s,IPDemoLine(1001,boss,who,"Death"))
     V48Assert(s.Current.DeathCapture.Cases.Count=1 && s.Current.Progression.Deaths.Count=1,"duplicate death never makes an extra recap")
 }
 V64TestKnownFinalHit()
 {
     result := IDTCause(V64Recap())
     V48Assert(InStr(result.Evidence,"Death-linked") && result.Amount=900,"matching death source and lethal snapshot gives qualified linked hit")
 }
 V64TestCauseDoesNotAssignBlame()
 {
     result := IDTCause(V64Recap())
     V48Assert(InStr(result.Evidence,"not root cause"),"linked damage is not called player fault")
 }
 V64TestAmbiguousBatch()
 {
     r := V64Recap(),other := V64Row(20000,"Damage",0,1000,100)
     other.AbilityId := "other",other.Ability := "Other hit",r.Rows.Push(other)
     V48Assert(IDTCause(r).Text="Multiple death-linked hits","no arbitrary winner among simultaneous lethal abilities")
 }
 V64TestMissingLethalHealth()
 {
     r := V64Recap(),r.Rows[4].HP := -1,r.Rows[4].Maximum := 0
     V48Assert(InStr(IDTCause(r).Evidence,"unconfirmed"),"no lethal HP sample means last damage, not certified final hit")
 }
 V64TestWrongDeathSource()
 {
     r := V64Recap(),r.SourceKey := "different"
     V48Assert(InStr(IDTCause(r).Evidence,"unconfirmed"),"mismatched death source does not confirm the last attacker")
 }
 V64TestMissingDamage()
 {
     r := V64Recap(),r.Rows := [V64Row(19000)]
     V48Assert(IDTCause(r).Text="No damaging hit identified","health loss or death alone does not invent ability")
 }
 V64TestImmuneNotKiller()
 {
     r := V64Recap(),r.Rows[4].Immune := true
     V48Assert(IDTCause(r).Row.At=12000,"immune last record is not lethal damage")
 }
 V64TestAbsorbedNotKiller()
 {
     r := V64Recap(),r.Rows[4].Absorbed := true
     V48Assert(IDTCause(r).Row.At=12000,"fully absorbed last record is not lethal damage")
 }
 V64TestZeroDamageNotKiller()
 {
     r := V64Recap(),r.Rows[4].Amount := 0
     V48Assert(IDTCause(r).Row.At=12000,"zero result is not positive lethal damage")
 }
 V64TestEffectiveHealNotRaw()
 {
     r := V64Recap(),m := IDTPlotModel(r,800,160)
     V48Assert(r.Rows[3].Amount=300 && r.Rows[3].Effective=200 && m.Points[3].Percent=80,"HP is not increased by raw overheal; use recorded 80 percent")
 }
 V64TestUnknownHealPreserved()
 {
     r := V64Recap(),r.Rows[3].Effective := -1
     V48Assert(IDTPlotModel(r,800,160).Points[3].Percent=80 && r.Rows[3].Effective=-1,"missing effective amount stays unknown while recorded HP is usable")
 }
 V64TestHealthNoDamageArithmetic()
 {
     r := V64Recap(),r.Rows[4].Amount := 1e9,r.Rows[4].HP := 200
     V48Assert(IDTPlotModel(r,800,160).Points[4].Percent=20,"large logged amount does not force a fabricated zero HP")
 }
 V64TestHealthGaps()
 {
     r := V64Recap(),m := IDTPlotModel(r,800,160)
     V48Assert(m.Points.Length=4 && m.Lines.Length=0,"long gaps are points, not misleading continuous HP")
 }
 V64TestHealthShortLinks()
 {
     r := V64Recap(),r.Rows := [V64Row(19000),V64Row(20000,"Damage",0,1000,2)]
     V48Assert(IDTPlotModel(r,800,160).Lines.Length=1,"short same-scale sample interval can be joined")
 }
 V64TestHealthMaxChange()
 {
     r := V64Recap(),r.Rows := [V64Row(19000),V64Row(20000,"Heal",1000,2000,2)]
     m := IDTPlotModel(r,800,160)
     V48Assert(m.Lines.Length=0 && m.Points[2].Percent=50,"changed max HP breaks connection and normalizes its own sample")
 }
 V64TestNoHealthGraph()
 {
     r := V64Recap()
     for row in r.Rows
         row.HP := -1,row.Maximum := 0
     V48Assert(IDTPlotModel(r,800,160).Points.Length=0,"missing snapshots give empty HP plot, not a fake full bar")
 }
 V64TestGraphScaling()
 {
     for scale in [1,1.5,2] {
         m := IDTPlotModel(V64Recap(),Round(650*scale),Round(140*scale),scale)
         for point in m.Points
             V48Assert(point.X>=m.Left && point.X<=m.Right && point.Y>=m.Top && point.Y<=m.Bottom,"HP samples inside scaled plot")
         V48Assert(m.Points[1].X=m.Left && m.Points[4].X=m.Right,"fixed negative-12 to death axis")
     }
 }
 V64TestSortedEvents()
 {
     rows := [],a := V64Row(100, "Damage",800,1000,2),b := V64Row(100,"Heal",900,1000,1)
     IDTInsert(rows,a),IDTInsert(rows,b),IDTInsert(rows,V64Row(50))
     V48Assert(rows[1].At=50 && rows[2].Record=1 && rows[3].Record=2,"timestamp then file order, not hit-size sorting")
 }
 V64TestDistinctHitsRetained()
 {
     rows := [],IDTInsert(rows,V64Row(100,"Damage",800,1000,1)),IDTInsert(rows,V64Row(100,"Damage",800,1000,2))
     V48Assert(rows.Length=2,"identical-looking damage records both retained")
 }
 V64TestLateSameTimestamp()
 {
     f := V64Frozen(),ev := V64Line(20000,V64Boss(),V64Actor(0),"Damage",50),ev.RecordId := 19999
     IDTObserve(f.Segment,ev,20000)
     V48Assert(f.Segment.DeathCapture.Cases[f.Id].Rows.Length=3,"late accepted record ordered before death updates frozen recap")
 }
 V64TestAfterDeathHealExcluded()
 {
     f := V64Frozen(),before := f.Segment.DeathCapture.Cases[f.Id].Rows.Length
     ev := V64Line(20000,V64Actor(),V64Actor(900),"Heal",900,900),ev.RecordId := 20002
     IDTObserve(f.Segment,ev,20000)
     V48Assert(f.Segment.DeathCapture.Cases[f.Id].Rows.Length=before,"later file-order heal at death timestamp cannot refill the death graph")
 }
 V64TestUndoWindowAndCase()
 {
     f := V64Frozen(),seg := f.Segment,s := f.State,count := seg.DeathCapture.Cases.Count,rows := seg.DeathCapture.Windows[f.Death.Key].Length
     IPBBeginUndo(s,seg)
     ev := V64Line(21000,V64Boss(),V64Actor(0),"Damage",100)
     IDTObserve(seg,ev,21000)
     death := f.Death.Clone(),death.At := 21000,death.Record := 21001
     IDTFreeze(seg,ev,death),IPBRollbackTail(s,seg)
     V48Assert(seg.DeathCapture.Cases.Count=count && seg.DeathCapture.Windows[f.Death.Key].Length=rows,"tail rollback removes speculative recap and restores rolling observations")
 }
 V64TestUndoLateAmendment()
 {
     f := V64Frozen(),old := f.Segment.DeathCapture.Cases[f.Id],count := old.Rows.Length
     IPBBeginUndo(f.State,f.Segment)
     ev := V64Line(19900,V64Boss(),V64Actor(50)),ev.RecordId := 19900
     IDTObserve(f.Segment,ev,19900)
     V48Assert(old.Rows.Length=count,"late amendment does not mutate the old shallow snapshot")
     IPBRollbackTail(f.State,f.Segment)
     V48Assert(f.Segment.DeathCapture.Cases[f.Id].Rows.Length=count,"late amendment itself rolls back")
 }
 V64TestShortPullWindow()
 {
     f := V64Frozen(),f.Segment.Start := 19000,ev := V64Line(22000,V64Boss(),V64Actor(0),"Death")
     death := f.Death.Clone(),death.At := 22000,death.Record := 22001
     IDTFreeze(f.Segment,ev,death)
     V48Assert(f.Segment.DeathCapture.Cases[IDTCaseKey(death)].From=19000,"short pull window cannot include previous pull")
 }
 V64TestCaptureErrorsDisclosed()
 {
     f := V64Frozen(),f.Segment.DeathCapture.Flags["Error"] := true
     V48Assert(IDTCompact(f.Segment,[f.Death])[f.Id].Partial,"capture failures cannot appear complete")
 }
 V64TestFallingDamage()
 {
     who := V64Actor(0),line := "[00:00:20.000] [" who "] [] [] [Event {836045448945472}: FallingDamage {836045448945484}] (1000.0)"
     ev := IPParseLine(line)
     V48Assert(ev.Kind="Other" && ev.Amount=0 && ev.DeathFall=1000,"environmental annotation does not change old parser kind/totals")
     row := IDTRow(ev.Source,ev,20000)
     V48Assert(row.Kind="Falling" && row.Source="Environment" && row.Amount=1000,"falling damage shown as environment")
 }
 V64TestSelfHeal()
 {
     ev := V64Line(100,V64Actor(900),"=","Heal",200,100),row := IDTRow(ev.Source,ev,100)
     V48Assert(row.Kind="Heal" && row.HP=900 && row.Effective=100,"self-target shorthand is attributed once")
 }
 V64TestNpcNotPlayerContext()
 {
     s := IPNewData(),seg := IPNewSegment(s,0,"synthetic"),ev := V64Line(100,V64Boss(),V64Boss())
     IDTObserve(seg,ev,100)
     V48Assert(seg.DeathCapture.Windows.Count=0,"NPC-to-NPC does not create player HP context")
 }
 V64TestPlayerFilterKeepsOrder()
 {
     p := IDTDemoData(),all := IDTFilteredDeaths(p),one := IDTFilteredDeaths(p,p.Deaths[1].Key)
     V48Assert(all.Length=2 && one.Length=2 && one[2].Order=all[2].Order,"player filter retains raid-wide order")
     V48Assert(IDTFilteredDeaths(p,"absent").Length=0,"absent character never borrows another player's deaths")
 }
 V64TestHistoryContextRoundTrip()
 {
     p := IDTDemoData(),b := IGVPackPull(p),copy := IGVUnpackPull(IGJParse(IGVJson(b)))
     V48Assert(b.Length=16 && copy.DeathRecaps.Count=2,"history extension retains both contexts")
     for death in p.Deaths
         V48Assert(IGVJson(IDTPack(p.DeathRecaps))==IGVJson(IDTPack(copy.DeathRecaps)),"all event/HP/identity fields survive roundtrip")
 }
 V64TestLegacyHistoryContextUnknown()
 {
     p := IDTDemoData(),packed := IGVPackPull(p),packed.Pop(),old := IGVUnpackPull(packed)
     V48Assert(old.Deaths.Length=2 && old.DeathRecaps.Count=0 && !IsObject(IDTCase(old,old.Deaths[1])),"old deaths retained without fabricated timelines")
 }
 V64TestHistoryRejectWrongDeath()
 {
     p := IDTDemoData(),packed := IGVPackPull(p),packed[16][1][3] += 999999
     V64Reject((*)=>IGVUnpackPull(packed),"unbound death record is rejected")
 }
 V64TestHistoryRejectOutOfWindow()
 {
     p := IDTDemoData(),packed := IGVPackPull(p),packed[16][1][8][1][1] := p.Start
     V64Reject((*)=>IGVUnpackPull(packed),"out-of-window record is rejected")
     packed := IGVPackPull(p),recap := packed[16][1],last := recap[8][recap[8].Length]
     last[1] := recap[2],last[2] := recap[3]+1
     V64Reject((*)=>IGVUnpackPull(packed),"same-timestamp post-death record is rejected")
 }
 V64TestHistoryRejectInvalidHP()
 {
     p := IDTDemoData(),packed := IGVPackPull(p),packed[16][1][8][1][10] := 1e12
     V64Reject((*)=>IGVUnpackPull(packed),"HP larger than recorded maximum is rejected")
 }
 V64TestHistoryFileCompatibility()
 {
     path := A_Temp "\Iris_v64_history_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount ".json"
     try {
         FileAppend("[1,[]]",path,"UTF-8")
         V48Assert(IGVReadHistory(path).Count=0,"schema 1 remains readable")
         p := IDTDemoData(),h := Map("synthetic",{Key:"synthetic",Session:"synthetic",Date:"20260929",Team:"Synthetic",Pull:p})
         IGVWriteHistory(h,path),copy := IGVReadHistory(path)
         V48Assert(copy["synthetic"].Pull.DeathRecaps.Count=0 && copy["synthetic"].Pull.HasOwnProp("DeathRecapRef"),"schema 3 details are lazy")
         IHLoadDetails(copy["synthetic"].Pull)
         V48Assert(copy["synthetic"].Pull.DeathRecaps.Count=2 && InStr(FileRead(path,"UTF-8"),"[3,")=1,"schema 3 persisted and details verified")
         V48Assert(FileRead(path ".bak","UTF-8")="[1,[]]","previous schema file backed up")
     }
     finally V639Clean(path)
 }
 V64TestHistoryMergeAddsRecap()
 {
     p := IDTDemoData(),packed := IGVPackPull(p),packed.Pop(),old := IGVUnpackPull(packed)
     first := IGLMerge(Map(),[old],"synthetic.txt","20260929","Synthetic")
     updated := IGLMerge(first.History,[p],"synthetic.txt","20260929","Synthetic")
     V48Assert(updated.Updated=1 && updated.History.Count=1,"re-adding same pull enriches history, not an extra wipe")
     V48Assert(first.History[IGVHistoryKey(IGLSession("synthetic.txt","20260929"),p)].Pull.DeathRecaps.Count=0,"old object not mutated")
 }
 V64TestTextExport()
 {
     p := IDTDemoData(),text := IDTText(p,p.Deaths[1])
     V48Assert(InStr(text,"Effective heal") && InStr(text,"not reconstructed") && InStr(text,"Demo heavy strike"),"export states definitions and final hit")
     V48Assert(!InStr(text,"Demo follow-up"),"first death export excludes second death's damage")
 }
 V64TestLayoutBounds()
 {
     for size in [[980,650],[1220,780],[1920,1080]] {
         l := IPWLayout(size[1],size[2]),r := IDTGeometry(l)
         V48Assert(r.EventsY+r.EventsH<=r.NoteY && r.NoteY+38<=l.H-58,"recap sections do not overlap footer or one another")
         V48Assert(r.ChartH>=76 && r.ListH>=68 && r.EventsH>=60,"minimum review areas preserved below the death-view selector")
     }
 }
 V64TestHiddenPage()
 {
     V61Hidden(V64HiddenPageCase)
 }
 V64HiddenPageCase()
 {
     global IP
     try {
         p := IDTDemoData()
         V48Assert(IDTOpen(p) && IPWState().Tab=9,"exact pull opens deaths tab")
         c := IPWState().Controls
         V48Assert(c["DeathList"].GetCount()=2 && c["DeathEvents"].GetCount()>1,"native death and event tables populated")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"test never shows main window")
         V48Assert(IDTState().Failures=0 && IsObject(IDTState().Plot),"native HP painter completed without fallback")
         V48Assert(SendMessage(0x173,0,0,c["DeathChart"])!=0,"real HP bitmap attached")
         V58SelectTab(7)
         V48Assert(!V58ChildVisible(c["DeathList"]) && !V58ChildVisible(c["DeathChart"]),"new page hides when Raid is selected")
     }
     finally IDTShutdown()
 }
 V64TestHiddenMissingContext()
 {
     V61Hidden(V64HiddenMissingCase)
 }
 V64HiddenMissingCase()
 {
     try {
         p := IDTDemoData(),p.DeathRecaps := Map(),IDTOpen(p)
         c := IPWState().Controls
         V48Assert(InStr(c["DeathNote"].Text,"Re-import") && c["DeathEvents"].GetCount()=0,"missing context does not leave another death's rows on screen")
     }
     finally IDTShutdown()
 }
 V64TestExactPullRouteIsolation()
 {
     V61Hidden(V64RouteCase)
 }
 V64RouteCase()
 {
     global IP
     before := IPSelectedSegment(),selected := IP.Selected,a := IAState(),data := a.Data,query := a.Query
     try {
         p := IDTDemoData(),IDTOpen(p,p.Deaths[2].Key,p.Deaths[2].Record)
         d := IDTState()
         V48Assert(d.Selected=2 && d.Pull=p && d.Recap.At=p.Deaths[2].At,"death record route selects exactly the second death")
         V48Assert(IP.Selected=selected && IPSelectedSegment()=before && a.Data=data && a.Query=query,"opening recap leaves parser selection and deep Analysis unchanged")
         names := IWScrollTables(),found := 0
         for item in names {
             if item.Name="Main DeathList" || item.Name="Main DeathEvents"
                 found += 1
         }
         V48Assert(found=2,"both new native tables have wheel routing")
     }
     finally IDTShutdown()
 }
 V64TestDetailedPopupRoute()
 {
     V61Hidden(V64PopupCase)
 }
 V64PopupCase()
 {
     try {
         p := IDTDemoData(),IPROpenPull(p),detail := IPRState()
         V48Assert(IPMUiHandle(detail.DetailRecap),"pull popup includes Death recap action")
         IDTDetailDouble(detail.DetailTable,2)
         V48Assert(IDTState().Recap.At=p.Deaths[2].At,"double click popup death opens same exact death")
     }
     finally IDTShutdown()
 }
 V64TestDeathPagePrefs()
 {
     V61Hidden(V64PrefsCase)
 }
 V64PrefsCase()
 {
     global SETTINGS_FILE
     IniWrite(1,SETTINGS_FILE,"IrisWorkspace","RaidHomeVersion")
     IniWrite(9,SETTINGS_FILE,"IrisWorkspace","Tab")
     IPWLoadPrefs()
     V48Assert(IPWState().Tab=9,"saved Deaths tab logical ID loads without clamping to Analysis")
 }
 V64TestClosedRollingBuffersReleased()
 {
     f := V64Frozen(),f.Segment.Last := 20000
     IPCloseSegment(f.State,"synthetic complete")
     c := f.Segment.DeathCapture
     V48Assert(c.Windows.Count=0 && c.ByPlayer.Count=0 && c.Cases.Count=1,"closed fight keeps frozen recap, not rolling player queues")
 }
 V64TestEarlierDeathInWindow()
 {
     p := IDTDemoData(),death := p.Deaths[2],rows := IDTEventRows(p,death,IDTCase(p,death)),n := 0
     for row in rows {
         if row.Kind="Death" {
             n += 1
             V48Assert(row.At=p.Deaths[1].At && row.Record=p.Deaths[1].Record,"previous death marker uses exact prior identity")
         }
     }
     V48Assert(n=1,"quick-rez second-death timeline contains earlier death exactly once")
 }
 V64TestZeroToAliveNotJoined()
 {
     r := V64Recap(),r.Rows := [V64Row(19000,"Health",0,1000,1),V64Row(20000,"Health",500,1000,2)]
     V48Assert(IDTPlotModel(r,800,160).Lines.Length=0,"do not interpolate health recovery while previously at zero")
 }
 ; v64.3: manual-only chart presentation checks. No personal logs or online assets.
 V641Rows(values := "")
 {
     if !(values is Array)
         values := [25,80,10,60,0]
     rows := []
     for i,value in values
         rows.Push({Start:i-1,End:i,Value:value})
     return rows
 }
 V641Rect(scale := 1)
 {
     return {L:20*scale,T:10*scale,R:300*scale,B:140*scale}
 }
 V641Bezier(a,b,c,d,t)
 {
     u := 1-t
     return {X:u*u*u*a.X+3*u*u*t*b.X+3*u*t*t*c.X+t*t*t*d.X,
         Y:u*u*u*a.Y+3*u*u*t*b.Y+3*u*t*t*c.Y+t*t*t*d.Y}
 }
 V641TestStyleDefaults()
 {
     styles := IASCStyles()
     V48Assert(styles.Length=3 && styles[1]="Smooth curve" && styles[3]="Stepped","smooth default and exact stepped comparison available")
     V48Assert(IASCLoadStyle()=1,"manual suite never inherits personal style")
 }
 V641TestInvalidStyles()
 {
     for value in ["",0,4,-1,"abc",1.5]
         V48Assert(IASCStyleValue(value)=1,"invalid style uses safe smooth default")
     for value in [1,2,3,"2"]
         V48Assert(IASCStyleValue(value)=value+0,"valid style is stable")
 }
 V641TestPreferenceRoundtrip()
 {
     path := A_Temp "\Iris_v641_chart_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount ".ini"
     try {
         IniWrite("preserved",path,"Other","Sentinel")
         for mode in [3,2,1] {
             V48Assert(IASCSaveStyle(mode,path),"style write accepted for explicit test file")
             V48Assert(IASCLoadStyle(path)=mode,"saved style loaded")
         }
         V48Assert(IniRead(path,"Other","Sentinel")="preserved","unrelated settings untouched")
     }
     finally {
         if FileExist(path)
             FileDelete(path)
     }
 }
 V641TestNoPersonalPreferenceWrites()
 {
     V48Assert(!IASCSaveStyle(2),"manual diagnostics cannot save personal style")
 }
 V641TestEmptyAndZero()
 {
     V48Assert(IASCNodes([],0).Length=0,"zero interval has no fabricated rate")
     V48Assert(IASCNodes([],5).Length=0,"empty curve is empty")
     v := IAChartValues({Duration:0,Bins:Map(),UnknownHeal:0},{Bin:1},1)
     m := IASCModel(v.Rows,0,V641Rect(),1)
     V48Assert(m.Count=0,"zero-duration base bucket stays nonplottable")
 }
 V641TestSingleBucket()
 {
     rows := [{Start:0,End:0.4,Value:250}],n := IASCNodes(rows,0.4),c := IASCBeziers(n)
     V48Assert(n.Length=3 && c.Length=7,"one bucket yields a horizontal supported span")
     for p in c
         V48Assert(p.Y=250 && p.X>=0 && p.X<=0.4,"single bucket does not invent start/end dips")
 }
 V641TestPartialBucketTiming()
 {
     rows := [{Start:0,End:2,Value:30},{Start:2,End:2.5,Value:80}],n := IASCNodes(rows,2.5)
     V48Assert(n[2].X=1 && n[3].X=2.25 && n[4].X=2.5,"partial final bucket uses its actual centre/end")
     V48Assert(n[3].Y=80,"final rate stays unchanged")
 }
 V641TestBucketRatesAndTotals()
 {
     r := {Duration:2.5,Bins:Map(0,{D:200,H:100,E:80,T:60,A:40},1,{D:50,H:25,E:20,T:15,A:10}),UnknownHeal:0}
     q := {Bin:2}
     for metric,want in [250,125,100,75,50] {
         v := IAChartValues(r,q,metric),total := 0
         for b in v.Rows
             total += b.Value*(b.End-b.Start)
         before := IGVJson([[v.Rows[1].Start,v.Rows[1].End,v.Rows[1].Value],[v.Rows[2].Start,v.Rows[2].End,v.Rows[2].Value]])
         for style in [1,2,3]
             IASCModel(v.Rows,r.Duration,V641Rect(),Max(1,v.Peak)*1.08,style)
         after := IGVJson([[v.Rows[1].Start,v.Rows[1].End,v.Rows[1].Value],[v.Rows[2].Start,v.Rows[2].End,v.Rows[2].Value]])
         V48Assert(total=want && before=after,"visualization leaves every source metric and total unchanged")
     }
 }
 V641TestUnknownEffectiveHealing()
 {
     v := IAChartValues({Duration:1,Bins:Map(),UnknownHeal:1},{Bin:1},3)
     V48Assert(v.Unknown,"smoothing must not turn incomplete EHPS into a complete curve")
 }
 V641TestInvalidSampleGap()
 {
     bad := [[{Start:0,End:1,Value:1},{Start:2,End:3,Value:1}],[{Start:0,End:3,Value:1}],[{Start:0,End:1,Value:-1}]]
     for rows in bad {
         rejected := false
         try IASCNodes(rows,2)
         catch ValueError
             rejected := true
         V48Assert(rejected,"invalid/gapped samples do not create a false smooth line")
     }
 }
 V641TestMonotoneBounds()
 {
     for values in [[0,100,0,0,50],[100,80,40,0],[0,1,1000,1001],[9,9,9,9]] {
         n := IASCNodes(V641Rows(values),values.Length),c := IASCBeziers(n)
         Loop n.Length-1 {
             i := A_Index,j := 1+(i-1)*3,low := Min(n[i].Y,n[i+1].Y),high := Max(n[i].Y,n[i+1].Y)
             Loop 41 {
                 p := V641Bezier(c[j],c[j+1],c[j+2],c[j+3],(A_Index-1)/40)
                 V48Assert(p.Y>=low-0.000001 && p.Y<=high+0.000001,"no negative rate or false overshoot between bucket centres")
             }
         }
     }
 }
 V641TestEndpointsAndContinuity()
 {
     n := IASCNodes(V641Rows(),5),c := IASCBeziers(n)
     V48Assert(c.Length=1+3*(n.Length-1),"native Bezier point-count contract")
     for i,p in n
         V48Assert(c[1+(i-1)*3].X=p.X && c[1+(i-1)*3].Y=p.Y,"curve passes through every original centre and range endpoint")
 }
 V641TestPlateausAndExtrema()
 {
     n := [{X:0,Y:0},{X:1,Y:100},{X:2,Y:0},{X:3,Y:0}],s := IASCSlopes(n)
     V48Assert(s[2]=0 && s[3]=0 && s[4]=0,"peaks and zero plateaus have no crossing tangent")
 }
 V641TestInvalidNodeOrder()
 {
     rejected := false
     try IASCBeziers([{X:1,Y:0},{X:1,Y:4}])
     catch ValueError
         rejected := true
     V48Assert(rejected,"duplicate sample times rejected before division")
 }
 V641TestStraightAndStepped()
 {
     rows := V641Rows([10,50]),r := V641Rect(),line := IASCModel(rows,2,r,60,2),step := IASCModel(rows,2,r,60,3)
     V48Assert(line.Count=4 && line.Style=2,"straight line contains endpoints and true centres")
     V48Assert(step.Count=5 && step.Points[3].X=step.Points[4].X && step.Points[3].Y!=step.Points[4].Y,"stepped option retains vertical boundary at bucket change")
 }
 V641TestPixelBuffer()
 {
     m := IASCModel(V641Rows(),5,V641Rect(),100)
     V48Assert(m.Buffer.Size=m.Count*8 && Mod(m.Count-1,3)=0,"PointF vector has correct size/alignment")
     for i,p in m.Points
         V48Assert(Abs(NumGet(m.Buffer,(i-1)*8,"Float")-p.X)<0.0001 && Abs(NumGet(m.Buffer,(i-1)*8+4,"Float")-p.Y)<0.0001,"float buffer preserves screen point")
 }
 V641TestScaleGeometry()
 {
     a := IASCModel(V641Rows(),5,V641Rect(),100)
     for scale in [1,1.5,2] {
         b := IASCModel(V641Rows(),5,V641Rect(scale),100)
         for i,p in a.Points
             V48Assert(Abs(b.Points[i].X-p.X*scale)<0.000001 && Abs(b.Points[i].Y-p.Y*scale)<0.000001,"physical bitmap scaling not applied twice")
     }
 }
 V641TestColourConversion()
 {
     V48Assert(IASCArgb(0x123456)=0xFF563412 && IASCArgb(0x0000FF)=0xFFFF0000,"COLORREF converted to opaque ARGB without red/blue reversal")
 }
 V641TestNativeUnavailableGuard()
 {
     m := IASCModel(V641Rows(),5,V641Rect(),100)
     V48Assert(!IASCNative({DC:0},m,0),"missing target DC returns documented fallback, not a fake native pass")
     V48Assert(InStr(IASCInfo(1,1,1,{Fallback:true}),"fallback"),"fallback is disclosed in chart note")
 }
 V641TestLayoutBounds()
 {
     for w in [664,904,1604] {
         r := IAEmbeddedLayout(w,428).Rects
         for name in ["ChartStyleLabel","ChartStyle","ChartHint"]
             V48Assert(r[name][1]>=0 && r[name][1]+r[name][3]<=w && r[name][2]+r[name][4]<r["Chart"][2],"new chart controls fit above bitmap")
         V48Assert(r["Bin"][1]+r["Bin"][3]<r["ChartStyleLabel"][1] && r["ChartStyle"][1]+r["ChartStyle"][3]<r["ChartHint"][1],"no overlap with existing controls")
     }
 }
 V641TestNativeAntialiasing()
 {
     g := Gui(),paint := ""
     try {
         pic := g.AddPicture("w320 h160"),paint := IAPaintBegin(pic)
         IAFill(paint,0,0,paint.W,paint.H,0xFFFFFF)
         m := IASCModel(V641Rows([25,80,10]),3,V641Rect(),100)
         V48Assert(IASCNative(paint,m,0x804020,2),"GDI+ actually rendered the smooth curve (not fallback)")
         c := m.Points,pos := V641Bezier(c[4],c[5],c[6],c[7],0.37),blended := 0,coloured := 0
         Loop 9 {
             x := Round(pos.X)-4+A_Index-1
             Loop 9 {
                 y := Round(pos.Y)-4+A_Index-1,pixel := DllCall("Gdi32\GetPixel","Ptr",paint.DC,"Int",x,"Int",y,"UInt")
                 if pixel!=0xFFFFFFFF && pixel!=0xFFFFFF {
                     coloured += 1
                     if pixel!=0x804020
                         blended += 1
                 }
             }
         }
         V48Assert(coloured>0 && blended>0,"private bitmap contains curve pixels and antialiased edge shades")
         IAPaintEnd(paint),paint := "",info := V595BitmapInfo(pic)
         V48Assert(info.Handle!=0 && info.Type=7,"picture owns attached copied HBITMAP")
     }
     finally {
         if IsObject(paint)
             IAPaintEnd(paint,false)
         g.Destroy()
     }
 }
 V641TestNativeRepeatedDrawing()
 {
     g := Gui(),paint := ""
     try {
         pic := g.AddPicture("w320 h160")
         Loop 12 {
             paint := IAPaintBegin(pic),mode := Mod(A_Index,2)+1
             m := IASCModel(V641Rows(),5,V641Rect(),100,mode)
             V48Assert(IASCNative(paint,m,0x804020,2),"successive temporary graphics/pen/startup lifetimes work")
             IAPaintEnd(paint),paint := ""
         }
     }
     finally {
         if IsObject(paint)
             IAPaintEnd(paint,false)
         g.Destroy()
     }
 }
 V641TestHiddenChartStyleIsolation()
 {
     V59Hidden(V641HiddenCase)
 }
 V641HiddenCase()
 {
     a := IAState(),a.Data := IADemoData(),a.Query := IANewQuery(a.Data,"@Demo DPS#102")
     a.Result := IAQuery(a.Data,a.Query),a.Tab := 1
     d := a.Data,q := a.Query,r := a.Result,before := r.D
     for style in [1,2,3,1] {
         a.Controls["ChartStyle"].Choose(style),IASCStyleChanged(a.Controls["ChartStyle"])
         V48Assert(a.Data=d && a.Query=q && a.Result=r && r.D=before,"redrawing style cannot rerun or alter analysis")
         V48Assert(V595BitmapInfo(a.Controls["Chart"]).Handle!=0,"all style modes retain chart attachment")
     }
 }
 V641TestHiddenTabsAndControls()
 {
     V591Isolated(V641TabsCase)
 }
 V641TabsCase()
 {
     V591Ready(),a := V591Data()
     V48Assert(a.Controls["ChartStyle"].Value=1,"new chart defaults to smooth")
     V7826SelectReviewPage(6)
     V48Assert(!a.Controls["ChartStyle"].Visible && a.Tables["Rotation"].Visible,"style selector belongs only to Charts")
     V7826SelectReviewPage(1)
     V48Assert(a.Controls["ChartStyle"].Visible && !a.Tables["Rotation"].Visible,"returning to Charts preserves native visibility rules")
 }
 V641TestChartNotes()
 {
     V48Assert(InStr(IASCInfo(1,1,1),"display only") && InStr(IASCInfo(1,1,1),"Totals and range unchanged"),"curve definition is explicit")
     V48Assert(InStr(IASCInfo(3,5,5),"actual duration") && InStr(IASCInfo(3,5,5),"incomplete"),"stepped and absorb limitations retained")
 }
 ; v64.3: display-only gap regressions, executed only in the isolated manual child.
 V642Recap(rows)
 {
     r := V64Recap(),r.Rows := rows
     return r
 }
 
 V642TestGapsHaveGuides()
 {
     m := IDTPlotModel(V64Recap(),800,160)
     V48Assert(m.Points.Length=4 && m.Lines.Length=0 && m.Guides.Length=3,"observed points preserved; long intervals are distinct guides, not solid data")
 }
 V642TestShortSamplesRemainSolid()
 {
     m := IDTPlotModel(V642Recap([V64Row(19000),V64Row(20000,"Damage",300,1000,2)]),800,160)
     V48Assert(m.Lines.Length=1 && m.Guides.Length=0,"ordinary nearby same-scale observations retain their line")
 }
 V642TestTwoSecondBoundary()
 {
     for dt in [1999,2000,2001] {
         r := V642Recap([V64Row(20000-dt),V64Row(20000,"Damage",300,1000,2)])
         m := IDTPlotModel(r,800,160)
         V48Assert(m.Guides.Length=(dt>2000 ? 1 : 0) && m.Lines.Length=(dt<=2000 ? 1 : 0),"two-second policy is disclosed, not secretly widened")
     }
 }
 V642TestMaxHPGuide()
 {
     m := IDTPlotModel(V642Recap([V64Row(19000),V64Row(19500,"Heal",900,2000,2)]),800,160)
     V48Assert(m.Points[2].Percent=45 && m.Lines.Length=0 && m.Guides.Length=1,"different maxima keep their own percentages")
     V48Assert(InStr(m.Guides[1].Reason,"max HP changed"),"short max-HP discontinuity is explained")
 }
 V642TestGapAndMaximumReasons()
 {
     m := IDTPlotModel(V642Recap([V64Row(16000),V64Row(20000,"Heal",900,2000,2)]),800,160)
     text := m.Guides[1].Reason
     V48Assert(InStr(text,"4.000 s") && InStr(text,"max HP changed"),"both reasons retained for one connector")
 }
 V642TestMissingRecordBetweenSamples()
 {
     m := IDTPlotModel(V642Recap([V64Row(19000),V64Row(19500,"Damage",-1,0,2),V64Row(20000,"Heal",900,1000,3)]),800,160)
     V48Assert(m.Points.Length=2 && m.Lines.Length=0 && m.Guides.Length=1,"unknown HP cannot silently become a continuous solid trace")
     V48Assert(InStr(m.Guides[1].Reason,"no usable HP"),"missing recorded HP is explicit")
 }
 V642TestAllHPUnknown()
 {
     m := IDTPlotModel(V642Recap([V64Row(19000,"Damage",-1,0)]),800,160)
     V48Assert(m.Points.Length=0 && m.Guides.Length=0 && m.Lines.Length=0,"missing HP cannot be drawn as full health or death zero")
 }
 V642TestZeroReturnNotBridged()
 {
     m := IDTPlotModel(V642Recap([V64Row(19000,"Damage",0),V64Row(20000,"Heal",900,1000,2)]),800,160)
     V48Assert(m.Points.Length=2 && m.Lines.Length=0 && m.Guides.Length=0 && m.Breaks.Length=1,"no solid OR dashed recovery across zero")
 }
 V642TestRecordedDeathWithoutZero()
 {
     r := V642Recap([V64Row(19000),V64Row(20000,"Health",500,1000,9)])
     p := {Deaths:[{Key:r.Key,At:19500,Record:5}]},m := IDTPlotModel(r,800,160,1,p)
     V48Assert(m.Points.Length=2 && m.Lines.Length=0 && m.Guides.Length=0 && m.Breaks.Length=1,"recorded death breaks lives even when no zero snapshot survived")
 }
 V642TestOtherPlayerDeathIgnored()
 {
     r := V642Recap([V64Row(19000),V64Row(20000,"Health",500,1000,9)])
     m := IDTPlotModel(r,800,160,1,{Deaths:[{Key:"@Other#123",At:19500,Record:5}]})
     V48Assert(m.Lines.Length=1 && m.Breaks.Length=0,"someone else's death does not break this player's HP")
 }
 V642TestSameTimestampLifeOrder()
 {
     r := V642Recap([V64Row(19000,"Health",800,1000,4),V64Row(19000,"Health",600,1000,6)])
     m := IDTPlotModel(r,800,160,1,{Deaths:[{Key:r.Key,At:19000,Record:5}]})
     V48Assert(m.Points.Length=2 && m.Breaks.Length=1 && m.Lines.Length=0,"death within one timestamp follows record order")
 }
 V642TestFinalDeathNotSample()
 {
     m := IDTPlotModel(V642Recap([V64Row(19000)]),800,160)
     V48Assert(m.Points.Length=1 && m.Points[1].Percent=80 && m.Points[1].X<m.DeathX && m.Guides.Length=0,"death marker does not extrapolate HP to zero")
 }
 V642TestEndpointClipping()
 {
     r := V642Recap([V64Row(7999),V64Row(8000,"Health",800,1000,2),V64Row(20000,"Damage",0,1000,100),V64Row(20000,"Heal",500,1000,101),V64Row(20001)])
     m := IDTPlotModel(r,800,160)
     V48Assert(m.Points.Length=2 && m.Points[1].X=m.Left && m.Points[2].X=m.Right,"outside window and post-death same-time records cannot leak in")
 }
 V642TestReadOnlyChartModel()
 {
     r := V64Recap(),before := IGVJson(IDTPack(Map(IDTCaseKey(r),r)))
     IDTPlotModel(r,800,160,1,{Deaths:[{Key:r.Key,At:16000,Record:4}]})
     V48Assert(IGVJson(IDTPack(Map(IDTCaseKey(r),r)))==before,"plot-only death markers do not mutate serialized history or recap rows")
 }
 V642TestHoverExactSample()
 {
     r := V64Recap(),m := IDTPlotModel(r,800,160),p := m.Points[2],hit := IDTPlotProbe(m,r,p.X,p.Y)
     V48Assert(hit.Id=2 && InStr(hit.Text,"60.0%") && InStr(hit.Text,"-8.000"),"dot hover uses original sample rather than guide interpolation")
 }
 V642TestHoverGuideUnknown()
 {
     r := V64Recap(),m := IDTPlotModel(r,800,160),g := m.Guides[1]
     hit := IDTPlotProbe(m,r,(g.A.X+g.B.X)/2,(g.A.Y+g.B.Y)/2)
     V48Assert(hit.Id=-1 && InStr(hit.Text,"Guide only") && InStr(hit.Text,"unknown") && !InStr(hit.Text,"%"),"guide hover gives interval/reason, not an invented intermediate HP")
 }
 V642TestHoverMaximumReason()
 {
     r := V642Recap([V64Row(19000),V64Row(19500,"Heal",900,2000,2)]),m := IDTPlotModel(r,800,160)
     p := m.Points[2],hit := IDTPlotProbe(m,r,p.X,p.Y)
     V48Assert(hit.Id=2 && InStr(hit.Text,"max HP changed") && InStr(hit.Text,"45.0%"),"observed percentage and maximum change are both visible")
 }
 V642TestHoverOutside()
 {
     r := V64Recap(),m := IDTPlotModel(r,800,160)
     for xy in [[-1,0],[801,0],[10,-1],[10,161]]
         V48Assert(IDTPlotProbe(m,r,xy[1],xy[2]).Id=0,"pointer outside chart never returns a stale HP")
 }
 V642TestDashGeometry()
 {
     for scale in [1,1.5,2] {
         m := IDTPlotModel(V64Recap(),Round(800*scale),Round(160*scale),scale)
         for g in m.Guides {
             dashes := IDTGuideDashes(g.A,g.B,scale)
             V48Assert(dashes.Length>0,"guide has drawable dash geometry")
             for d in dashes
                 V48Assert(d.X1>=m.Left && d.X2<=m.Right && d.Y1>=m.Top && d.Y1<=m.Bottom && d.Y2>=m.Top && d.Y2<=m.Bottom,"dash endpoints stay inside the chart at each DPI")
         }
     }
 }
 V642TestDegenerateDash()
 {
     V48Assert(IDTGuideDashes({X:1,Y:1},{X:1,Y:1}).Length=0,"identical endpoints cannot divide by zero")
     V48Assert(IDTGuideDashes({X:1,Y:1},{X:2,Y:1}).Length=1,"short guide remains bounded")
 }
 V642TestExportHealthEvidence()
 {
     r := V64Recap(),text := IDTGraphEvidence({Deaths:[]},r)
     V48Assert(InStr(text,"Recorded HP samples") && InStr(text,"-12.000`t1000`t1000`t100.000`tHealth"),"Copy details includes health-only observations omitted from the event table")
     V48Assert(InStr(text,"4.000 s between"),"copy includes connector reasons without raw log upload")
 }
 V642TestNoBackwardLine()
 {
     r := V642Recap([V64Row(19000),V64Row(18000,"Damage",400,1000,2)]),m := IDTPlotModel(r,800,160)
     V48Assert(m.Lines.Length=0 && m.Guides.Length=0 && m.Breaks.Length=1,"unexpected reversed sample order is disclosed, not joined backward")
 }
 V642TestHiddenGapRendering()
 {
     V61Hidden(V642HiddenGapCase)
 }
 V642HiddenGapCase()
 {
     global IP
     try {
         IDTOpen(IDTDemoData()),d := IDTState(),c := IPWState().Controls
         d.Recap := V64Recap(),IDTDraw()
         V48Assert(d.Failures=0 && d.Plot.Guides.Length=3 && SendMessage(0x173,0,0,c["DeathChart"])!=0,"new native guide bitmap attaches to the existing Deaths page")
         V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"manual test does not reveal the main window")
         V48Assert(InStr(c["DeathProbe"].Text,"3 dashed guides"),"default chart explanation remains visible without hovering")
     }
     finally IDTShutdown()
 }
 V642TestHoverLeaveClearsDetails()
 {
     V61Hidden(V642HoverLeaveCase)
 }
 V642HoverLeaveCase()
 {
     try {
         IDTOpen(IDTDemoData()),d := IDTState(),c := IPWState().Controls
         d.Hover := -1,c["DeathProbe"].Text := "stale guide text"
         IDTMouseMove(0,0,0x200,c["DeathTitle"].Hwnd)
         V48Assert(d.Hover=0 && c["DeathProbe"].Text=IDTPlotSummary(d.Plot),"moving onto another control clears old hover text")
     }
     finally IDTShutdown()
 }
 ; v64.3: manual-only regressions for chart constructor scoping and separate tab catalogues.
 V643TestChartBufferAllocation()
 {
     ; Exercise the real model, including no-data and all three styles. No mock allocator.
     rect := V641Rect()
     for style in [1,2,3] {
         for values in [[],[25],[25,80,10,60,0]] {
             rows := V641Rows(values),duration := values.Length
             m := IASCModel(rows,duration,rect,100,style)
             V48Assert(m.Buffer is Buffer,"real Buffer constructor resolves in every chart style")
             V48Assert(m.Buffer.Size=Max(1,m.Count*8),"returned PointF storage fits every point including an empty chart")
             V48Assert(m.Count=m.Points.Length,"returned point count matches the buffer contract")
             if values.Length=0
                 V48Assert(m.Count=0 && m.Buffer.Size=1,"empty chart has safe storage but no invented point")
             for i,point in m.Points {
                 offset := (i-1)*8
                 V48Assert(Abs(NumGet(m.Buffer,offset,"Float")-point.X)<0.001
                     && Abs(NumGet(m.Buffer,offset+4,"Float")-point.Y)<0.001,"allocated PointF buffer contains both coordinates")
             }
         }
     }
     probe := Buffer(8,0x5A)
     V48Assert(probe is Buffer && NumGet(probe,0,"UChar")=0x5A,"chart allocation never overwrites the global Buffer class")
 }
 
 V643TestChartBufferOwnership()
 {
     rows := V641Rows([25,80,10]),rect := V641Rect()
     first := IASCModel(rows,3,rect,100),second := IASCModel(rows,3,rect,100)
     V48Assert(first.Buffer.Ptr!=second.Buffer.Ptr,"simultaneously retained chart models own different buffers")
     prior := NumGet(second.Buffer,0,"Float")
     NumPut("Float",prior+1,first.Buffer,0)
     V48Assert(NumGet(second.Buffer,0,"Float")=prior,"writing one temporary model cannot alter another model's buffer")
     V48Assert(first.Points[1].X=second.Points[1].X && rows[1].Value=25,"test buffer write leaves geometry and source buckets unchanged")
 }
 
 V643TestSeparateTabCatalogues()
 {
     main := IPWTabs(),analysis := IAEmbeddedTabs()
     wantMain := ["Log Library","Raid","Progression","Deaths","Session Deaths","Rotation","Analysis","Overview","Damage","Healing","Damage Taken","Healing Taken","Combat Log"]
     wantAnalysis := ["Charts","Effects","Summary","Adds","Consumables"]
     V48Assert(main.Length=wantMain.Length && analysis.Length=wantAnalysis.Length,"thirteen main tabs and five focused Analysis subtabs are different catalogues")
     for i,name in wantMain
         V48Assert(main[i]=name,"requested main tab order at position " i)
     for i,name in wantAnalysis
         V48Assert(analysis[i]=name,"Analysis subtab order unchanged at position " i)
 }
 
 V643TestHiddenChartStatusAndBitmap()
 {
     V59Hidden(V643HiddenChartCase)
 }
 
 V643HiddenChartCase()
 {
     a := IAState(),a.Data := IADemoData(),a.Query := IANewQuery(a.Data,"@Demo DPS#102")
     a.Result := IAQuery(a.Data,a.Query),a.Tab := 1
     data := a.Data,query := a.Query,result := a.Result,total := result.D
     for style in [1,2,3,1] {
         a.Controls["ChartStyle"].Choose(style)
         IAStatus("Chart repair test: drawing style " style)
         IAChartChanged()
         status := a.HasOwnProp("LastStatus") ? a.LastStatus : ""
         V48Assert(!InStr(status,"Chart:"),"renderer reported an error in style " style ": " status)
         info := V595BitmapInfo(a.Controls["Chart"])
         V48Assert(info.Handle!=0 && info.Type=7 && info.Bytes>0 && info.Width>0 && info.Height>0,
             "real chart bitmap attached in style " style "; renderer status: " status)
         V48Assert(a.Data=data && a.Query=query && a.Result=result && result.D=total,"bitmap repair does not replace data, range or totals")
     }
 }

V644ParserActors()
{
    return {Owner:"@Recorder#644|(0,0,0,0)|(100/100)",Peer:"@Peer#644|(0,0,0,0)|(0/100)",
        Alive:"@Peer#644|(0,0,0,0)|(50/100)",Boss:"Tyth {4078419339902976}:644|(0,0,0,0)|(800/1000)"}
}

V644ParserRows(base := 0, complete := false, instance := 644)
{
    a := V644ParserActors(),boss := StrReplace(a.Boss,":644|",":" instance "|")
    rows := [IPDemoLine(base,a.Owner,"=","Enter"),IPDemoLine(base+100,a.Owner,boss,"Activate"),
        IPDemoLine(base+100,a.Owner,boss,"Damage",10),IPDemoLine(base+5000,boss,a.Peer,"Death"),
        IPDemoLine(base+10000,a.Owner,boss,"Damage",10)]
    if complete {
        rows.Push(IPDemoLine(base+10000,a.Owner,StrReplace(boss,"800/1000","0/1000"),"Death"))
        rows.Push(IPDemoLine(base+10100,a.Owner,"=","Exit"))
    }
    return rows
}

V644ParserFeed(s, rows)
{
    for row in rows
        IPFeedLine(s,row)
    return s
}

V644ParserPath(rows)
{
    path := A_Temp "\Iris_v644_parser_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount "_" Random(1000,9999) ".txt"
    text := ""
    for row in rows
        text .= row "`r`n"
    FileAppend(text,path,"UTF-8")
    return path
}

V644ParserReset()
{
    global IP,IrisTests,logReadBusy,inLogDispatch
    IP := IPNewApp(),IP.Encoding := "UTF-8"
    IrisTests.Busy := false,logReadBusy := false,inLogDispatch := false
}

V644ParserFinalizationParity()
{
    global IP
    saved := IP,savedGraphBusy := IGVState().Busy,path := V644ParserPath(V644ParserRows())
    try {
        V644ParserReset(),IPBeginImport(path),IPImportRun()
        ordinary := IPRFromLoaded(IP.Offline)
        V48Assert(IP.ImportTiming.Outcome="COMPLETE" && IP.Offline.Finished,"complete snapshot ingestion remains a successful import")
        V644ParserReset(),IPRScanPrepare(path,"UTF-8"),IPRScanPump()
        scanned := IPRState().Data
        V644ParserReset(),item := IGLItem(path,"20260930")
        j := IGLBegin([item],"parser regression",A_Temp "\Iris_v644_parser_history_" DllCall("GetCurrentProcessId","UInt") ".json")
        multi := IGLReadFile(item,j),IGLShutdown()
        for d in [ordinary,scanned,multi] {
            p := d.Pulls[1],summary := IPRSummary(d),owner := summary.Players["@Recorder#644"]
            V48Assert(d.Complete && d.Partial && p.Partial && p.Ended && p.End=10000,"all readers disclose an unfinished final encounter while retaining its observed endpoint")
            V48Assert(p.TotalDeaths=1 && p.TimingComplete && summary.Incomplete=1,"captured death evidence survives an incomplete coverage warning")
            V48Assert(owner.ActivePulls=0 && owner.ActivePct<0 && owner.TimedPulls=0,"unfinished interval cannot enter activity or reached denominators")
            roundtrip := IGVUnpackPull(IGVPackPull(p))
            V48Assert(roundtrip.Partial && !roundtrip.Players["@Recorder#644"].Active.Valid,"serialized quality matches the displayed pull")
        }
    }
    finally {
        IGLShutdown(),IP := saved,IGVState().Busy := savedGraphBusy
        try FileDelete(path)
    }
}

V644ParserCancel(app,run)
{
    IPStop()
}

V644ParserCancellationScope()
{
    global IP
    saved := IP,rows := V644ParserRows(0,true,1),next := V644ParserRows(20000,false,2)
    for row in next
        rows.Push(row)
    a := V644ParserActors()
    Loop 116
        rows.Push(IPDemoLine(30100+A_Index*100,a.Owner,StrReplace(a.Boss,":644|",":2|"),"Damage",10))
    path := V644ParserPath(rows)
    try {
        V644ParserReset(),IPBeginImport(path),IPImportRun(V644ParserCancel)
        d := IPRFromLoaded(IP.Offline)
        V48Assert(IP.Offline.Lines=64 && IP.ImportTiming.Outcome="CANCELED" && d.Partial && !d.Complete,"cancel retains exactly its accepted prefix and reports source interruption")
        V48Assert(d.Pulls.Length=2 && !d.Pulls[1].Partial && d.Pulls[2].Partial,"cancel marks its open pull without invalidating an earlier confirmed result")
        summary := IPRSummary(d)
        V48Assert(summary.Incomplete=1 && summary.Players["@Recorder#644"].ActivePulls=1,"only the complete earlier interval contributes activity")
    }
    finally {
        IP := saved
        try FileDelete(path)
    }
}

V644ParserCompletedFinalization()
{
    for interrupted in [false,true] {
        s := V644ParserFeed(IPNewData(),V644ParserRows(0,true))
        IPFinalizeData(s,"test finalization",interrupted)
        p := IPRCompact(s.Segments[1])
        V48Assert(s.Finished && p.Ended && !p.Partial && p.End=10000,"confirmed terminal endpoint survives ordinary and interrupted finalization")
        V48Assert(p.Players["@Recorder#644"].Active.Valid,"confirmed interval keeps its activity estimate")
        V48Assert(s.Partial=interrupted,"source cancellation warning remains independent of confirmed pull quality")
    }
}

V644ParserCancellationEdges()
{
    global IP
    saved := IP,a := V644ParserActors(),paths := []
    try {
        path := V644ParserPath(V644ParserRows()),paths.Push(path)
        V644ParserReset(),IPBeginImport(path),IPStop()
        V48Assert(IP.Offline.Finished && IP.Offline.Partial && IP.Offline.Segments.Length=0,"cancel before the first record invents no partial encounter")
        for completed in [false,true] {
            rows := [IPDemoLine(0,a.Owner,"=","Enter"),IPDemoLine(100,a.Owner,a.Boss,"Activate")]
            Loop 59
                rows.Push(IPDemoLine(100+A_Index*100,a.Owner,a.Boss,"Damage",10))
            if completed {
                rows.Push(IPDemoLine(6000,a.Owner,StrReplace(a.Boss,"800/1000","0/1000"),"Death"))
                rows.Push(IPDemoLine(6100,a.Owner,"=","Exit"))
                rows.Push(IPDemoLine(6200,a.Owner,"=","Activate"))
            }
            else {
                Loop 3
                    rows.Push(IPDemoLine(6000+A_Index*100,a.Owner,a.Boss,"Damage",10))
            }
            path := V644ParserPath(rows),paths.Push(path)
            V644ParserReset(),IPBeginImport(path),IPImportRun(V644ParserCancel)
            V48Assert(IP.Offline.Lines=64 && IP.ImportTiming.Outcome="CANCELED" && IP.Offline.Partial,"cancel at the last complete record wins over EOF")
            V48Assert(IP.Offline.Segments[1].Partial=!completed,"last-record cancellation preserves only already observed completion")
        }
    }
    finally {
        IP := saved
        for path in paths
            try FileDelete(path)
    }
}

V644ParserManualStop()
{
    global IP
    saved := IP
    try {
        V644ParserReset(),IP.Live := V644ParserFeed(IPNewData(),V644ParserRows()),IP.Active := true
        IPStop()
        V48Assert(!IP.Active && IP.Live.Finished && IP.Live.Segments[1].Partial,"manual stop marks its unfinished interval and drains cleanly")
        V644ParserReset(),IP.Live := V644ParserFeed(IPNewData(),V644ParserRows(0,true)),IP.Active := true
        IPStop()
        V48Assert(IP.Live.Finished && !IP.Live.Segments[1].Partial,"manual stop preserves an already confirmed boss endpoint")
    }
    finally IP := saved
}

V644ParserQualityOutsidePull()
{
    s := IPNewData()
    IPFeedLine(s,"unknown timestamp and malformed record")
    V644ParserFeed(s,V644ParserRows(20000,true,1))
    V644ParserFeed(s,V644ParserRows(40000,true,2))
    IPFinalizeData(s,"fixture complete")
    d := IPRFromLoaded(s),summary := IPRSummary(d)
    V48Assert(s.Partial && s.Malformed=1 && s.BadExamples.Length=1,"source diagnostics retain a malformed pre-boundary record")
    V48Assert(d.Pulls.Length=2 && !d.Pulls[1].Partial && !d.Pulls[2].Partial,"later explicit complete pulls do not inherit a resolved source gap")
    V48Assert(summary.Players["@Recorder#644"].ActivePulls=2 && summary.Players["@Recorder#644"].TimedPulls=2,"clean later pulls remain eligible for timing-derived metrics")
}

V644ParserQualityInsidePull()
{
    s := IPNewData(),rows := V644ParserRows(0,true,1)
    Loop 3
        IPFeedLine(s,rows[A_Index])
    IPFeedLine(s,"malformed within this pull")
    a := V644ParserActors()
    IPFeedLine(s,IPDemoLine(200,a.Owner,"=","Enter"))
    V48Assert(s.Current.Partial && s.Current.QualityReasons.Has("malformed combat record"),"duplicate combat entry cannot erase current-pull damage to coverage")
    Loop rows.Length-3
        IPFeedLine(s,rows[A_Index+3])
    V644ParserFeed(s,V644ParserRows(20000,true,2)),IPFinalizeData(s,"complete")
    d := IPRFromLoaded(s),summary := IPRSummary(d)
    V48Assert(d.Pulls[1].Partial && !d.Pulls[2].Partial && s.Partial,"the affected pull stays partial but a new explicit interval recovers")
    V48Assert(summary.Incomplete=1 && summary.Players["@Recorder#644"].TimedPulls=1,"metric eligibility follows the affected interval only")
}

V644ParserQualityWithoutBoundary()
{
    s := IPNewData(),a := V644ParserActors()
    IPFeedLine(s,"invalid and unresolvable timestamp")
    IPFeedLine(s,IPDemoLine(1000,a.Owner,a.Boss,"Damage",10))
    V48Assert(s.Current.Partial && s.Current.QualityReasons.Has("malformed combat record"),"inferred first damage cannot resolve preceding unknown coverage")
    IPFeedLine(s,IPDemoLine(1200,a.Owner,"=","Enter"))
    V48Assert(s.Current.Partial,"an entry inside an existing inferred pull cannot retroactively certify its start")
}

V644ParserQualityValuesAndClock()
{
    for kind in ["value","clock"] {
        s := IPNewData(),a := V644ParserActors()
        IPFeedLine(s,IPDemoLine(10000,a.Owner,"=","Exit"))
        if kind="value"
            IPFeedLine(s,StrReplace(IPDemoLine(10100,a.Owner,a.Boss,"Damage",10),"(10 kinetic","(broken kinetic"))
        else
            IPFeedLine(s,IPDemoLine(1000,a.Owner,a.Boss,"Damage",10))
        V644ParserFeed(s,V644ParserRows(20000,true)),IPFinalizeData(s,"complete")
        V48Assert(s.Partial && !s.Segments[1].Partial,"valid new entry scopes earlier " kind " warning away from clean pull")
        V48Assert(kind="value" ? s.BadValues=1 : s.ClockBack=1,"source " kind " counter remains available")
    }
}

V644ParserRevivalLines(kind := "revive",positive := true)
{
    a := V644ParserActors(),alive := positive ? a.Alive : a.Peer
    middle := kind="entry" ? IPDemoLine(2000,alive,"=","Enter")
        : "[00:00:02.000] [" a.Owner "] [" alive "] [Revive {900000000000002}] [Event {836045448945472}: Revived {836045448945494}] ()"
    return [IPDemoLine(0,a.Owner,"=","Enter"),IPDemoLine(100,a.Owner,a.Boss,"Damage",10),
        IPDemoLine(1000,a.Boss,a.Peer,"Damage",100),IPDemoLine(1000,a.Boss,a.Peer,"Death"),
        IPDemoLine(1100,a.Owner,a.Boss,"Damage",10),middle,
        IPDemoLine(2100,a.Boss,a.Peer,"Damage",50),IPDemoLine(2100,a.Boss,a.Peer,"Death"),
        IPDemoLine(2200,a.Owner,a.Boss,"Damage",10)]
}

V644ParserRepeatedDeathAfterRevival()
{
    for kind in ["revive","entry"] {
        s := V644ParserFeed(IPNewData(),V644ParserRevivalLines(kind)),seg := s.Current
        V48Assert(seg.Totals["@Peer#644"].Deaths=2 && seg.Progression.Deaths.Count=2,"positive-HP " kind " starts a new counted life before any heal/activation")
        V48Assert(seg.DeathCapture.Cases.Count=2,"both observed deaths receive a separate recap")
    }
    s := V644ParserFeed(IPNewData(),V644ParserRevivalLines("revive",false))
    V48Assert(s.Current.Totals["@Peer#644"].Deaths=1,"zero-HP revive label does not turn duplicate death into an invented new life")
}

V644ParserRevivalRollback()
{
    s := IPNewData(),rows := V644ParserRevivalLines(),a := V644ParserActors()
    Loop 6
        IPFeedLine(s,rows[A_Index])
    V48Assert(!s.Current.Deaths.Has("@Peer#644") && !s.Current.LifeDead.Has("@Peer#644"),"pending revival updates both live-life ledgers")
    IPFeedLine(s,IPDemoLine(2500,a.Owner,"=","Exit"))
    V48Assert(s.Current.Deaths.Has("@Peer#644") && s.Current.LifeDead.Has("@Peer#644"),"excluded trailing revival restores both ledgers through the undo journal")
    V48Assert(s.Current.Totals["@Peer#644"].Deaths=1,"rollback does not alter the earlier committed death")
}

V644ParserAnalysisRevival()
{
    global IP
    saved := IP
    try {
        V644ParserReset(),s := IPNewData(),w := IACaptureNew(0,2200),s.AnalysisCapture := w
        V644ParserFeed(s,V644ParserRevivalLines()),seg := s.Current
        IPFinalizeData(s,"analysis fixture")
        d := IAAssemble(s,seg,w),deaths := 0
        for ev in d.Rows {
            if ev.Target.Key="@Peer#644"
                deaths += ev.Analysis.Death
        }
        V48Assert(deaths=2 && seg.Totals["@Peer#644"].Deaths=2,"Analysis applies the same evidenced life transition as base parsing")
        V48Assert(IAEventTotalsCheck(d,seg).Length=0,"Analysis event totals reconcile after repeated deaths and explicit resurrection")
    }
    finally IP := saved
}

; v64.4 burn-candle delivery regressions. Isolated harness only; no live audio/HTTP.
; Groups: V644CandleAcceptanceAndCompletion, V644CandleTransportRetry,
; V644CandlePreemptionBudget, V644CandleStaleCompletion, V644CandleMuteGuard,
; V644CandleMissingPayload, V644CandleNoneRetry, V644CandleExpiredQueue.

V644CandleSetup(route := "KenkuSoundboard")
{
    global audioOutputMode, NBNextSoundIds, NBCandleOptions
    V491Setup()
    audioOutputMode := route
    NBNextSoundIds["Mara"] := "a7b01e60-a8bc-47bd-a03a-eda2d8020458"
    NBCandleOptions.NoneSound := "a7b01e60-a8bc-47bd-a03a-eda2d8020458"
}

V644CandleDispatch()
{
    global Audio
    item := Audio.Queue.RemoveAt(1)
    Audio.Current := item
    item.Started := ClockMs(), item.Stage := "play-pending"
    OnAudioHttpResponse("play", "")
    return item
}

V644CandleTransportFail()
{
    AudioHttpFailure("status", "synthetic transient transport failure")
    OnAudioHttpResponse("status", '{"sounds":[]}')
    OnAudioHttpResponse("status", '{"sounds":[]}')
}

V644CandleAcceptanceAndCompletion()
{
    global Audio, NBCandle, testClock
    V644CandleSetup(), PollNBCandle(), item := V644CandleDispatch()
    V48Assert(NBCandle.Delivery.Attempts=1 && NBCandle.Delivery.Accepted
        && !NBCandle.Choice.Delivered && !NBCandle.Delivery.Completed,
        "accepted burn request is not completed guidance")
    OnAudioHttpResponse("status", '{"sounds":[{"id":"' item.SoundId '"}]}')
    OnAudioHttpResponse("status", '{"sounds":[]}')
    OnAudioHttpResponse("status", '{"sounds":[]}')
    V48Assert(!IsObject(Audio.Current) && NBCandle.Choice.Delivered && NBCandle.Delivery.Completed,
        "observed successful completion marks current instruction delivered")
    V48Time(testClock+2500), PollNBCandle()
    V48Assert(Audio.Queue.Length=0, "successful unchanged instruction is not repeated")
}

V644CandleTransportRetry()
{
    global Audio, NBCandle, testClock
    V644CandleSetup(), PollNBCandle(), item := V644CandleDispatch()
    V644CandleTransportFail()
    V48Assert(item.Cancel && !NBCandle.Choice.Delivered, "first failed playback remains incomplete")
    V48Time(testClock+2500), PollNBCandle()
    V48Assert(!RouteState().Paused && RouteState().Fault="" && Audio.Queue.Length=1
        && NBCandle.Delivery.Attempts=2, "recovered transport receives exactly one fresh retry")
    V644CandleDispatch(), V644CandleTransportFail()
    V48Time(testClock+2500), PollNBCandle()
    V48Assert(NBCandleAudioActive() && Audio.Queue.Length=0 && !NBCandle.Choice.Delivered
        && NBCandle.Delivery.Attempts=2, "second failure exhausts budget without falsely completing")
}

V644CandlePreempt()
{
    global Audio
    high := Audio.Current.Clone()
    high.Kind := "Player", high.Key := "Taunt", high.Priority := CalloutPriority("Player","Taunt")
    Audio.Queue.Push(high)
    ConsiderAudioPreemption()
    V48Assert(Audio.Current.Cancel && Audio.Queue.Length=1,
        "burn retry is owned by its delivery budget, not generic preemption clone")
    FinishAudio("stopped: higher priority")
    Audio.Queue.RemoveAt(1) ; synthetic taunt completed; no actual playback
}

V644CandlePreemptionBudget()
{
    global Audio, NBCandle, testClock
    V644CandleSetup(), PollNBCandle(), V644CandleDispatch(), V644CandlePreempt()
    V48Time(testClock+2500), PollNBCandle()
    V48Assert(Audio.Queue.Length=1 && NBCandle.Delivery.Attempts=2,
        "interrupted first instruction retries after relevance checks")
    V644CandleDispatch(), V644CandlePreempt()
    V48Time(testClock+2500), PollNBCandle()
    V48Assert(Audio.Queue.Length=0 && !NBCandle.Choice.Delivered,
        "repeated interruption cannot exceed one retry or claim completion")
}

V644CandleStaleCompletion()
{
    global Audio, NBCandle, testClock
    V644CandleSetup(), PollNBCandle(), old := V644CandleDispatch()
    V48Pass("Tank1",testClock+100), PollNBCandle()
    V48Assert(Audio.Queue.Length=1 && NBCandle.Delivery.Attempts=1,
        "new holder instruction has a fresh bounded delivery budget")
    old.Cancel := false ; specifically exercise identity guard, not cancellation guard
    NBCandleAudioFinished(old,"Kenku completion observed")
    V48Assert(!NBCandle.Delivery.Completed && !NBCandle.Choice.Delivered,
        "old ticket completion cannot complete the new holder instruction")
    Audio.Current := "", Audio.Queue := []
}

V644CandleMuteGuard()
{
    global Audio, NBCandle, soundboardsEnabled, testClock
    V644CandleSetup(), PollNBCandle(), item := V644CandleDispatch()
    soundboardsEnabled := false
    NBCandleAudioFinished(item,"Kenku completion observed")
    V48Assert(!NBCandle.Delivery.Completed, "completion callback cannot bypass master mute")
    PurgeBridgeSpeech(), FinishAudio("stopped: mute/chat/mode control")
    V48Time(testClock+2500), PollNBCandle()
    V48Assert(Audio.Queue.Length=0 && NBCandle.Delivery.Attempts=1, "muted poll neither speaks nor spends retry")
    soundboardsEnabled := true
    PollNBCandle()
    V48Assert(Audio.Queue.Length=1 && NBCandle.Delivery.Attempts=2,
        "reenabled still-relevant incomplete instruction can use its single retry")
}

V644CandleMissingPayload()
{
    global Audio, NBCandle, NBNextSoundIds, testClock
    V644CandleSetup(), NBNextSoundIds.Clear(), PollNBCandle()
    V48Assert(Audio.Queue.Length=0 && !IsObject(NBCandle.Delivery), "missing recording consumes no accepted attempt")
    NBNextSoundIds["Mara"] := "a7b01e60-a8bc-47bd-a03a-eda2d8020458"
    V48Time(testClock+2500), PollNBCandle()
    V48Assert(Audio.Queue.Length=1 && NBCandle.Delivery.Attempts=1, "fixed recording configuration gets first attempt")
}

V644CandleNoneRetry()
{
    global Audio, NBCandle, testClock
    V644CandleSetup()
    for actor,p in NBCandle.Players
        p.Battery := 0
    PollNBCandle(), V644CandleDispatch()
    V48Assert(!NBCandle.NoneDone && NBCandle.Delivery.Accepted, "accepted no-eligible warning is not completed")
    V644CandleTransportFail(), V48Time(testClock+2500), PollNBCandle()
    V48Assert(Audio.Queue.Length=1 && NBCandle.Delivery.Attempts=2, "no-eligible warning has one retry too")
    item := V644CandleDispatch()
    OnAudioHttpResponse("status", '{"sounds":[{"id":"' item.SoundId '"}]}')
    OnAudioHttpResponse("status", '{"sounds":[]}')
    OnAudioHttpResponse("status", '{"sounds":[]}')
    V48Assert(NBCandle.NoneDone && NBCandle.Delivery.Completed, "successful no-eligible warning completes")
}

V644CandleExpiredQueue()
{
    global Audio, NBCandle, testClock
    V644CandleSetup(), PollNBCandle()
    V48Time(testClock+9000), PruneAudioQueue(), PollNBCandle()
    V48Assert(Audio.Queue.Length=1 && NBCandle.Delivery.Attempts=2, "expired first queue request uses bounded retry")
    V48Time(testClock+9000), PruneAudioQueue(), PollNBCandle()
    V48Assert(Audio.Queue.Length=0 && NBCandle.Delivery.Attempts=2 && !NBCandle.Choice.Delivered,
        "repeated queue expiry cannot loop forever or claim delivery")
}

; v64.4 history/progression regression functions. Embedded by the release builder.
; Fixtures use native parsing; no real logs, settings, history or audio are used.
V644HistoryCapture(recorder := "A",outcome := "partial",offset := 0)
{
    s := IPNewData("SYNTHETIC v64.4 history")
    who := "@Recorder " recorder "#" (recorder="A" ? 6441 : 6442) "|(0,0,0,0)|(1000/1000)"
    shared := "@Shared Tank#6443|(0,0,0,0)|(1000/1000)"
    boss := "4078423634870272"
    V51Feed(s,offset,"Enter",0,who,"=")
    V51Feed(s,offset+500,"Damage",10,shared,V56Boss(990,boss))
    V51Feed(s,offset+1000,"Damage",90,who,V56Boss(900,boss))
    V51Feed(s,offset+100000,"Damage",899,who,V56Boss(1,boss))
    if outcome="kill" {
        V51Feed(s,offset+101000,"Damage",1,who,V56Boss(0,boss))
        V51Feed(s,offset+101000,"Death",0,who,V56Boss(0,boss))
    }
    else if outcome="wipe"
        V51Feed(s,offset+100001,"Exit",0,who,"=")
    IPFinalizeData(s,"synthetic history EOF")
    return IGVUnpackPull(IGVPackPull(IPRCompact(s.Segments[1])))
}

V644HistoryEntries(history)
{
    entries := []
    for key,entry in history
        entries.Push(entry)
    return entries
}

V644HistoryPair(a,b,reverse := false,teamA := "Raid",teamB := "Raid")
{
    if reverse {
        first := IGLMerge(Map(),[b],"20260927_000000_002","20260927",teamB)
        return IGLMerge(first.History,[a],"20260927_000000_001","20260927",teamA)
    }
    first := IGLMerge(Map(),[a],"20260927_000000_001","20260927",teamA)
    return IGLMerge(first.History,[b],"20260927_000000_002","20260927",teamB)
}

V644TestEqualTimeSort()
{
    p := V644HistoryCapture(),merged := V644HistoryPair(p,p,false,"Raid","Guests")
    entries := V644HistoryEntries(merged.History),forward := IGVSort(entries)
    entries := [entries[2],entries[1]],reverse := IGVSort(entries)
    V48Assert(forward.Length=2 && forward[1].Key==reverse[1].Key,"equal start times use deterministic textual history keys")
    V48Assert(StrCompare(forward[1].Key,forward[2].Key,true)<0,"equal-time tie break is lexical")
}

V644TestTeamCaseIdentity()
{
    a := V644HistoryCapture("A"),b := V644HistoryCapture("B","kill")
    merged := V644HistoryPair(a,b,false,"Raid","raid"),entries := V644HistoryEntries(merged.History)
    V48Assert(merged.History.Count=2 && merged.Overlaps=1,"case changes retain and identify overlapping source evidence")
    selected := IGVSelectEntries(entries,a.Group,"","RAID"),view := IGKBuild(selected,"all")
    V48Assert(selected.Length=2 && view.Rows.Length=1 && view.Rows[1].Variants.Length=2,"case-insensitive filtering counts one matched attempt, with both sources retained")
    V48Assert(IGLBucketKeys(entries[1])[1]==IGLBucketKeys(entries[2])[1],"overlap index and filtering use identical team identity")
}

V644TestOverlappingOrderIndependent()
{
    a := V644HistoryCapture("A"),b := V644HistoryCapture("B","kill")
    V48Assert(a.Partial && !a.Progress.Kill && !b.Partial && b.Progress.Kill,"native fixtures distinguish unfinished capture and observed kill")
    ab := V644HistoryPair(a,b),ba := V644HistoryPair(a,b,true)
    one := IGKBuild(V644HistoryEntries(ab.History),"first"),two := IGKBuild(V644HistoryEntries(ba.History),"first")
    V48Assert(ab.History.Count=2 && ba.History.Count=2 && ab.Overlaps=1 && ba.Overlaps=1,"both input orders retain the original recorder captures")
    V48Assert(one.Completed && two.Completed && one.Rows.Length=1 && two.Rows.Length=1,"matched full capture preserves first-kill evidence in either order")
    V48Assert(one.FirstKill.Key==two.FirstKill.Key && !one.FirstKill.Pull.Partial && one.FirstKill.Pull.Progress.Kill,"deterministic preferred full capture, without combining metrics")
    V48Assert(one.FirstKill.Pull.Players.Count=b.Players.Count && one.FirstKill.Pull.TotalDeaths=b.TotalDeaths,"preferred pull retains one source's own statistics")
    V48Assert(a.Partial && !a.Progress.Kill && !a.HasOwnProp("Conflict"),"resolution does not rewrite original pull evidence")
}

V644TestOverlapConflictNoKill()
{
    a := V644HistoryCapture("A","wipe"),b := V644HistoryCapture("B","kill")
    V48Assert(!a.Partial && !a.Progress.Kill,"explicit exit fixture is a complete no-kill capture")
    for reverse in [false,true] {
        merged := V644HistoryPair(a,b,reverse),entries := V644HistoryEntries(merged.History)
        view := IGKBuild(entries,"all"),first := IGKBuild(entries,"first"),reclear := IGKBuild(entries,"reclear")
        V48Assert(view.Rows.Length=1 && view.Conflicts.Length=1 && view.TeamPulls=0,"disagreeing complete outcomes are explicit unresolved evidence")
        V48Assert(!IGKConfirmed(view.Rows[1]) && IGVEntryScore(view.Rows[1])<0,"conflict cannot become a kill or plotted best-progress point")
        V48Assert(first.NeedsResolution && !first.Completed && !IsObject(first.FirstKill) && reclear.NeedsResolution && !reclear.Cycles.Length,"unresolved outcome cannot establish first-kill/reclear boundaries")
        V48Assert(InStr(first.Note,"unresolved") && InStr(IGVPointLabel(view.Rows[1],1),"conflict"),"uncertainty is visible in both view status and selected graph point")
    }
}

V644TestOverlapIdentityConflict()
{
    a := V644HistoryCapture("A"),b := V644HistoryCapture("B","kill",3000)
    merged := V644HistoryPair(a,b),view := IGKBuild(V644HistoryEntries(merged.History),"all")
    V48Assert(view.Conflicts.Length=1 && !view.Rows[1].Pull.Progress.Kill,"high overlap alone cannot promote a kill with uncertain start identity")
    b := V644HistoryCapture("B","kill"),b.Players := Map("@Separate Player#99",b.Players.Get("@Recorder B#6442"))
    ; A schema-valid independent participation set, deliberately without a shared actor.
    merged := V644HistoryPair(a,b),view := IGKBuild(V644HistoryEntries(merged.History),"all")
    V48Assert(view.Conflicts.Length=1 && InStr(view.Rows[1].Conflict,"identity"),"matching clock/boss alone cannot merge disjoint participation identities")
}

V644TestSameSourceHistoryRefresh()
{
    a := V644HistoryCapture("A"),b := V644HistoryCapture("A","kill")
    first := IGLMerge(Map(),[a],"source","20260927","Raid")
    next := IGLMerge(first.History,[b],"source","20260927","raid")
    V48Assert(next.History.Count=1 && next.Updated=1,"same-source fuller refresh updates rather than creates an alternative")
    again := IGLMerge(next.History,[a],"source","20260927","RAID")
    V48Assert(again.History.Count=1 && again.KeptComplete=1,"partial refresh cannot downgrade full same-source evidence")
}

V644TestTeamCaseCycles()
{
    entries := V636KillEntries()
    for i,entry in entries
        entry.Team := Mod(i,2) ? "Raid" : "raid"
    first := IGKBuild(entries,"first"),reclear := IGKBuild(entries,"reclear")
    V48Assert(!first.NeedsTeam && first.Completed && !reclear.NeedsTeam && reclear.Cycles.Length>0,"team capitalization cannot split first-kill/reclear identity")
}

V644TestHistoryAlternativeRoundtrip()
{
    root := V635Temp(),path := root "\history.json"
    try {
        a := V644HistoryCapture("A"),b := V644HistoryCapture("B","kill")
        merged := V644HistoryPair(a,b),IGVWriteHistory(merged.History,path)
        read := IGVReadHistory(path),view := IGKBuild(V644HistoryEntries(read),"first")
        V48Assert(read.Count=2 && view.Completed && view.FirstKill.Variants.Length=2,"save/reopen preserves alternatives and canonical completion")
        V48Assert(InStr(IGLSourceLabel(view.FirstKill.Variants[1]),"Recorder"),"source provenance remains inspectable after reopening")
    }
    finally DirDelete(root,true)
}

V644TestPhaseCrossingReorder()
{
    seg := V63Segment("G-NA")
    IGPObserve(seg,V63Event("Damage","4131857322999808",30,1000),1000)
    IGPObserve(seg,V63Event("Activate","4122949560827904",100,2000,IGPNahutSliceId()),2000)
    IGPObserve(seg,V63Event("Damage","4122949560827904",10,1900),1900)
    q := IGPCompact(seg)
    V48Assert(q.Stage=3 && q.Hp=100 && q.Targets[1].LowAt=2000,"older pre-transition HP cannot lower the new phase's minimum")
}

V644TestSamePhaseReorder()
{
    seg := V63Segment("G-NA")
    IGPObserve(seg,V63Event("Damage","4131857322999808",30,1000),1000)
    IGPObserve(seg,V63Event("Activate","4122949560827904",100,2000,IGPNahutSliceId()),2000)
    IGPObserve(seg,V63Event("Damage","4122949560827904",80,3000),3000)
    IGPObserve(seg,V63Event("Damage","4122949560827904",70,2500),2500)
    q := IGPCompact(seg)
    V48Assert(q.Stage=3 && q.Hp=70 && q.Targets[1].Last=80 && q.Targets[1].LastAt=3000,"same-phase late HP still contributes without replacing the latest sample")
}

V644TestLateOpeningCannotAdvancePhase()
{
    seg := V63Segment("G-NA")
    IGPObserve(seg,V63Event("Damage","4131857322999808",30,2000),2000)
    IGPObserve(seg,V63Event("Activate","4122949560827904",10,1900,IGPNahutSliceId()),1900)
    q := IGPCompact(seg)
    V48Assert(q.Stage=2 && q.Hp=30,"a delayed opening Slice before the coupling phase cannot invent P3")
    council := V63Segment()
    IGPObserve(council,V63Event("Damage","3274019210002432",50,2000),2000)
    IGPObserve(council,V63Event("Activate","3273993440198656",10,1900,"3322475031035904"),1900)
    q := IGPCompact(council)
    V48Assert(q.Stage=2 && !q.Burn,"rejected pre-boundary Council marker cannot set a later-phase burn label")
}

V644TestSamePhaseEarlierEvidence()
{
    seg := V63Segment("G-NA")
    IGPObserve(seg,V63Event("Damage","4131857322999808",50,2000),2000)
    IGPObserve(seg,V63Event("Damage","4131857322999808",30,1900),1900)
    V48Assert(IGPCompact(seg).Hp=30 && seg.PhaseProgress["StageAt"]=1900,"unambiguous same-phase evidence may establish an earlier phase start")
    IGPObserve(seg,V63Event("Activate","4122949560827904",100,3000,IGPNahutSliceId()),3000)
    IGPObserve(seg,V63Event("Activate","4122949560827904",10,1800,IGPNahutSliceId()),1800)
    q := IGPCompact(seg)
    V48Assert(q.Stage=3 && q.Hp=100 && seg.PhaseProgress["StageAt"]=3000,"current-phase start cannot move before the prior observed phase boundary")
}

V644TestHistoryConflictDisclosure()
{
    a := V644HistoryCapture("A","wipe"),b := V644HistoryCapture("B","kill")
    merged := V644HistoryPair(a,b),view := IGKBuild(V644HistoryEntries(merged.History),"all")
    state := {WindowResult:view,Plot:""}
    V48Assert(InStr(IGVConflictNotice(state),"unresolved") && InStr(IGLEntryProgressLabel(view.Rows[1]),"conflict"),"summary/table helpers disclose unresolved recorder evidence")
    chart := IGVPlotModel(view.Rows,900,250)
    V48Assert(chart.Unknown=1 && chart.BestIndex=0 && !chart.Points[1].Kill,"conflict has no invented HP or kill marker")
    attendance := IGKBuild(V644HistoryEntries(merged.History),"all","","@Shared Tank#6443")
    V48Assert(InStr(attendance.Note,"character attended 0/0"),"conflict attendance is not presented as a confirmed pull")
}

V644TestHistoryThreeSourcePermutations()
{
    captures := [V644HistoryCapture("A"),V644HistoryCapture("B","kill"),V644HistoryCapture("C","partial",1000)]
    winner := ""
    for order in [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] {
        history := Map()
        for i in order
            history := IGLMerge(history,[captures[i]],"source-" i,"20260927","Raid").History
        view := IGKBuild(V644HistoryEntries(history),"first")
        V48Assert(history.Count=3 && view.Rows.Length=1 && view.Completed && !view.Conflicts.Length,"all three-source permutations preserve one matched kill and every capture")
        if winner=""
            winner := view.FirstKill.Key
        V48Assert(view.FirstKill.Key==winner && view.FirstKill.Variants.Length=3,"quality selection is independent of insertion order")
    }
}

V644TestHistoryAdjacentAndIndependent()
{
    a := V644HistoryCapture("A"),b := V644HistoryCapture("B","kill",100002)
    merged := V644HistoryPair(a,b),view := IGKBuild(V644HistoryEntries(merged.History),"first")
    V48Assert(!merged.Overlaps && view.Completed && view.TeamPulls=2 && view.Rows.Length=2,"adjacent attempts are retained and counted separately")
    b := V644HistoryCapture("B","kill")
    merged := V644HistoryPair(a,b,false,"Raid A","Raid B")
    V48Assert(!merged.Overlaps && IGKBuild(V644HistoryEntries(merged.History),"all").Rows.Length=2,"different teams never share a canonical attempt")
    b.Mode := "836045448953655",b.Group := b.Boss "|" b.Area "|" b.Mode
    merged := V644HistoryPair(a,b)
    V48Assert(!merged.Overlaps && IGKBuild(V644HistoryEntries(merged.History),"all").Rows.Length=2,"different modes never share a canonical attempt")
}

V644TestHistoryTransitiveConflict()
{
    captures := [V644HistoryCapture("A"),V644HistoryCapture("B","partial",1500),V644HistoryCapture("C","partial",3000)]
    for order in [[1,2,3],[3,2,1]] {
        history := Map()
        for i in order
            history := IGLMerge(history,[captures[i]],"source-" i,"20260927","Raid").History
        view := IGKBuild(V644HistoryEntries(history),"all")
        V48Assert(view.Conflicts.Length=1 && view.Rows[1].Variants.Length=3 && view.TeamPulls=0,"transitive overlap cannot silently join candidates that fail pairwise identity checks")
    }
}

V644TestAlternativeCharacterAttendance()
{
    a := V644HistoryCapture("A"),b := V644HistoryCapture("B","kill"),merged := V644HistoryPair(a,b)
    entries := IGVSelectEntries(V644HistoryEntries(merged.History),a.Group,"","Raid",false)
    view := IGKBuild(entries,"first","",a.RecorderKey)
    V48Assert(view.Completed && view.CharacterAtKill && view.Rows.Length=1,"alternate source's observed participation survives team-level canonical selection")
    V48Assert(!view.Rows[1].Pull.Players.Has(a.RecorderKey),"attendance does not invent activity or merge player statistics into preferred capture")
}

V644TestHiddenHistoryConflict()
{
    V61Hidden(V644HiddenHistoryConflictCase)
}

V644HiddenHistoryConflictCase()
{
    IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IGVDemoData(),IGVOpen(),v := IGVState()
    try {
        a := V644HistoryCapture("A","wipe"),b := V644HistoryCapture("B","kill")
        v.Source := "history",v.DemoHistory := true,v.History := V644HistoryPair(a,b,false,"Raid","raid").History
        v.Team := "RAID",v.Character := "",v.Boss := a.Group,v.Window := "all"
        v.DetailVisible := true,IGVFillFilters(),IGVRefresh(),IGVSelect(1)
        unknown := IsObject(v.Plot) ? v.Plot.Unknown : "no plot"
        V48Assert(v.Rows.Length=1 && unknown=1 && v.Controls["Rows"].GetCount()=1,"hidden graph/table show one unresolved group as a gap; rows=" v.Rows.Length " unknown=" unknown " table=" v.Controls["Rows"].GetCount() " phase=" v.Window " busy=" v.Busy " A.partial=" a.Partial " B.partial=" b.Partial " A.kill=" a.Progress.Kill " B.kill=" b.Progress.Kill " status=" v.Controls["Status"].Text)
        V48Assert(InStr(v.Controls["Rows"].GetText(1,3),"conflict") && InStr(v.Controls["Selected"].Text,"conflict") && InStr(v.Controls["Status"].Text,"unresolved"),"native table, selection and status disclose uncertainty")
        V48Assert(v.TeamKeys.Length=3 && v.Team="raid","native team dropdown offers one identity for case variants")
        v.Window := "first",IGVRefresh()
        V48Assert(v.WindowResult.NeedsResolution && InStr(v.Controls["Summary"].Text,"unavailable") && !v.Controls["Cycle"].Enabled,"native first-kill view cannot imply a resolved kill boundary")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",v.Gui.Hwnd),"diagnostic conflict view remains hidden")
    }
    finally IGVClose()
}

; v64.4 storage regression groups. Synthetic fixtures and private temp folders only.
V644StorageHistory()
{
    p := IDTDemoData()
    return Map("synthetic",{Key:"synthetic",Session:"synthetic",Date:"20260929",Team:"Unicode Ω 測試",Pull:p})
}

V644StorageMigration()
{
    root := V635Temp(),path := root "\history.json",h := V644StorageHistory(),p := h["synthetic"].Pull
    old := IGVJson([2,[["synthetic","synthetic","20260929","Unicode Ω 測試",IGVPackPull(p)]]])
    try {
        FileAppend(old,path,"UTF-8-RAW"),IGVWriteHistory(h,path)
        loaded := IGVReadHistory(path),copy := loaded["synthetic"].Pull
        V48Assert(loaded.Count=1 && loaded["synthetic"].Team==h["synthetic"].Team,"Unicode summary retained")
        V48Assert(copy.DeathRecaps.Count=0 && copy.HasOwnProp("DeathRecapRef"),"history opens without parsing detail")
        V48Assert(InStr(FileRead(path,"UTF-8"),"[3,")=1,"schema 3 summary committed")
        V48Assert(FileRead(path ".before-v64_4.bak","UTF-8")==old,"original schema 2 preserved exactly")
        recap := IDTCase(copy,copy.Deaths[1])
        V48Assert(IsObject(recap) && IGVJson(IDTPack(copy.DeathRecaps))==IGVJson(IDTPack(p.DeathRecaps)),"lazy detail preserves every row")
        IGVWriteHistory(loaded,path),IGVWriteHistory(loaded,path)
        V48Assert(FileRead(path ".before-v64_4.bak","UTF-8")==old,"ordinary saves never overwrite migration backup")
        V48Assert(IGVJson(IGVPackPull(IGVReadHistory(path)["synthetic"].Pull))==IGVJson(IGVPackPull(p)),"subsequent saves remain exact")
    }
    finally DirDelete(root,true)
}

V644StorageIntegrity()
{
    root := V635Temp(),path := root "\history.json"
    try {
        V48Assert(IHHash("abc")="ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad","native SHA256 matches standard vector")
        IGVWriteHistory(V644StorageHistory(),path),h := IGVReadHistory(path),p := h["synthetic"].Pull,ref := p.DeathRecapRef
        body := FileRead(ref.Path,"UTF-8"),corrupt := StrReplace(body,"Demo","Dema")
        V48Assert(corrupt!=body && StrPut(corrupt,"UTF-8")=StrPut(body,"UTF-8"),"fixture changes content without changing size")
        FileDelete(ref.Path),FileAppend(corrupt,ref.Path,"UTF-8-RAW")
        V64Reject((*)=>IHLoadDetails(p),"same-size detail corruption rejected before display")
        V48Assert(!IsObject(IDTCase(p,p.Deaths[1])) && p.HasOwnProp("DeathRecapError"),"corrupt detail degrades to visible missing evidence without crashing the UI")
        errors := IAuxDiagnosticState().Errors["history|load-recap"].Count
        IDTCase(p,p.Deaths[2])
        V48Assert(IAuxDiagnosticState().Errors["history|load-recap"].Count=errors,"one corrupt recap file is not reread for every displayed death")
        FileDelete(ref.Path)
        V64Reject((*)=>IGVReadHistory(path),"missing sidecar disclosed on history load")
        V64Reject((*)=>IHDetailDirectory(path,"..\escape.details"),"sidecar manifest cannot escape its history folder")
        V64Reject((*)=>IHDetailDirectory(path,"C:\escape.details"),"absolute sidecar path rejected")
    }
    finally DirDelete(root,true)
}

V644StorageCancelAt(wanted,stage)
{
    V48Assert(!A_IsCritical,"history preparation and checkpoints remain interruptible")
    if stage=wanted
        throw Error("Synthetic cancellation")
}

V644StorageCancellation()
{
    root := V635Temp(),path := root "\history.json"
    try {
        IGVWriteHistory(Map(),path),old := FileRead(path,"UTF-8")
        for stage in ["packing","detail-writing","serializing","writing","verifying","before-commit","commit-ready"] {
            h := V644StorageHistory()
            ; Each detail-writing checkpoint needs a fresh destination hash.
            for key,recap in h["synthetic"].Pull.DeathRecaps
                recap.Source := "Synthetic " stage
            V64Reject((*)=>IGVWriteHistory(h,path,"",V644StorageCancelAt.Bind(stage)),"cancel " stage " rejects transaction")
            V48Assert(FileRead(path,"UTF-8")==old,"cancel " stage " keeps prior history bytes")
        }
        V64Reject((*)=>IGVWriteHistory(V644StorageHistory(),path,"",V644StorageCorruptTemporary.Bind(path)),"failed candidate verification rejects publication")
        V48Assert(FileRead(path,"UTF-8")==old,"failed readback keeps original history")
        IGVWriteHistory(V644StorageHistory(),path)
        V48Assert(IGVReadHistory(path).Count=1,"lock released and clean save works after cancellation")
    }
    finally DirDelete(root,true)
    V635WithBatch(V644StorageCommitBoundaryCase)
}

V644StorageCancelOwnerAtCommit(job,stage)
{
    if stage!="commit-ready" && stage!="save-commit-ready"
        return
    V48Assert(!A_IsCritical,"last preparation checkpoint still permits cancellation")
    job.CommitCancelObserved := true
    IGLCancel()
}

V644StorageObserveCommitted(job,value)
{
    first := value && !job.CommitValue
    job.CommitValue := value
    if !first
        return
    ; Test-only property observer at the actual owner's first publication.
    job.CommitWasCritical := !!A_IsCritical
    job.CommitSavedCount := IGVReadHistory(job.Path).Count
    IGLCancel()
    job.CancelAfterPublication := IGLState().Cancel
}

V644StorageCommitBoundaryCase(root,items)
{
    path := root "\commit-boundary.json"
    IGVWriteHistory(Map(),path),before := FileRead(path,"UTF-8")
    job := IGLBegin(items,"Synthetic",path)
    V48Assert(!IGLPump(V644StorageCancelOwnerAtCommit),"batch cancellation at final save checkpoint rejects publication")
    V48Assert(job.CommitCancelObserved && !job.Committed && FileRead(path,"UTF-8")==before,"final checkpoint cancellation preserves prior history and owner status")

    ; Bypass IHBatchCheckpoint's early rejection to exercise the writer's own
    ; final owner-validity check inside the protected publication boundary.
    job := IGLBegin(items,"Synthetic",path),IGLState().Pumping := true
    job.History := V644StorageHistory(),job.Added := 1
    V64Reject((*)=>IGVWriteHistory(job.History,path,job.Original,V644StorageCancelOwnerAtCommit.Bind(job),job),"owned writer rejects cancellation immediately before atomic publication")
    V48Assert(job.CommitCancelObserved && !job.Committed && FileRead(path,"UTF-8")==before,"writer's independent commit guard preserves history")
    IGLState().Pumping := false
    V48Assert(!IGLPump(),"canceled direct-writer owner follows normal batch cleanup")

    job := IGLBegin(items,"Synthetic",path),job.CommitValue := false
    job.DeleteProp("Committed")
    job.DefineProp("Committed",{Get:(this)=>this.CommitValue,Set:V644StorageObserveCommitted})
    V48Assert(IGLPump(),"uncanceled batch publishes normally")
    V48Assert(job.Committed && job.CommitWasCritical && job.CommitSavedCount=6,"owner becomes committed inside Critical after all six captures are on disk")
    V48Assert(!job.CancelAfterPublication && IGVReadHistory(path).Count=6,"cancellation after publication is ignored and saved history remains intact")
}

V644StorageCorruptTemporary(path,stage)
{
    if stage!="verifying"
        return
    Loop Files path ".tmp-" DllCall("GetCurrentProcessId","UInt") "-*","F" {
        FileDelete(A_LoopFileFullPath)
        FileAppend("[3,[",A_LoopFileFullPath,"UTF-8-RAW")
    }
}

V644StorageStaleWriter()
{
    root := V635Temp(),path := root "\history.json",lock := 0,reader := 0
    try {
        IGVWriteHistory(Map(),path),before := IGLHistoryText(path)
        IGVWriteHistory(V644StorageHistory(),path),winner := FileRead(path,"UTF-8")
        V64Reject((*)=>IGVWriteHistory(Map(),path,before),"stale writer rejected")
        V48Assert(FileRead(path,"UTF-8")==winner,"newer additions are not lost")
        lock := IHAcquireLock(path)
        V64Reject((*)=>IGVWriteHistory(Map(),path),"occupied lock rejects another save")
        V48Assert(FileRead(path,"UTF-8")==winner,"lock failure leaves current file intact")
        DllCall("CloseHandle","Ptr",lock),lock := 0
        reader := DllCall("CreateFileW","Str",path,"UInt",0x80000000,"UInt",1,"Ptr",0,"UInt",3,"UInt",0x80,"Ptr",0,"Ptr")
        V48Assert(reader && reader!=-1,"test owns read handle that denies atomic replacement")
        V64Reject((*)=>IGVWriteHistory(Map(),path),"native replacement failure is reported")
        V48Assert(FileRead(path,"UTF-8")==winner,"failed atomic replacement preserves current history")
        DllCall("CloseHandle","Ptr",reader),reader := 0
        IGVWriteHistory(IGVReadHistory(path),path)
        V48Assert(IGVReadHistory(path).Count=1,"subsequent lock acquired and released")
    }
    finally {
        if lock
            DllCall("CloseHandle","Ptr",lock)
        if reader && reader!=-1
            DllCall("CloseHandle","Ptr",reader)
        DirDelete(root,true)
    }
}

V644StorageCopyFolder()
{
    root := V635Temp(),path := root "\history.json",dest := root "\copy\history.json"
    try {
        IGVWriteHistory(V644StorageHistory(),path),DirCreate(root "\copy")
        IGVWriteHistory(IGVReadHistory(path),dest),h := IGVReadHistory(dest)
        V48Assert(IsObject(IDTCase(h["synthetic"].Pull,h["synthetic"].Pull.Deaths[1])),"save-as copies and validates lazy detail")
        FileDelete(path),DirDelete(path ".details",true)
        V48Assert(IsObject(IDTCase(IGVReadHistory(dest)["synthetic"].Pull,h["synthetic"].Pull.Deaths[1])),"new history owns independent details")
    }
    finally DirDelete(root,true)
}

V644StorageSchemaValidation()
{
    root := V635Temp(),path := root "\history.json",h := V644StorageHistory(),p := h["synthetic"].Pull
    try {
        for ref in ["bad",["bad"],["bad",20],[]] {
            row := ["synthetic","synthetic","20260929","T",IGVPackPull(p,false),ref]
            if FileExist(path)
                FileDelete(path)
            FileAppend(IGVJson([3,[row],"history.json.details"]),path,"UTF-8-RAW")
            if ref is Array && ref.Length=0
                V48Assert(IGVReadHistory(path).Count=1,"empty optional detail reference allowed")
            else
                V64Reject((*)=>IGVReadHistory(path),"malformed reference rejected")
        }
    }
    finally DirDelete(root,true)
}

V644StorageLargeRecaps()
{
    root := V635Temp(),path := root "\history.json",p := IDTDemoData(),h := Map()
    try {
        for id,recap in p.DeathRecaps {
            template := recap.Rows[1].Clone(),template.Source := "",template.Ability := ""
            Loop 280
                template.Source .= "S",template.Ability .= "A"
            recap.Rows := []
            Loop 512 {
                row := template.Clone(),row.At := recap.From,row.Record := A_Index
                recap.Rows.Push(row)
            }
        }
        legacyBytes := StrPut(IGVJson(IGVPackPull(p)),"UTF-8")-1
        count := Ceil(34000000/legacyBytes)
        Loop count {
            key := "pull-" A_Index
            h[key] := {Key:key,Session:key,Date:"20260929",Team:"Synthetic",Pull:p}
        }
        V48Assert(legacyBytes*count>33554432,"fixture's inline recap representation exceeds old whole-file limit")
        IGVWriteHistory(h,path),loaded := IGVReadHistory(path)
        V48Assert(loaded.Count=count && FileGetSize(path)<1048576,"all recap-heavy pulls retained in small summary index")
        recap := IDTCase(loaded["pull-1"].Pull,p.Deaths[1])
        V48Assert(IsObject(recap) && recap.Rows.Length=512,"large saved detail validates on demand")
        old := FileRead(path,"UTF-8"),oversized := Map(),row := h["pull-1"].Clone(),row.Team := "X"
        Loop 25
            row.Team .= row.Team
        oversized["oversize"] := row
        V64Reject((*)=>IGVWriteHistory(oversized,path),"summary byte guard checked before publication")
        V48Assert(FileRead(path,"UTF-8")==old,"oversized candidate does not replace valid history")
    }
    finally DirDelete(root,true)
}

V644StorageWaitFile(path,pid)
{
    began := A_TickCount
    while !FileExist(path) && ProcessExist(pid) && A_TickCount-began<10000
        Sleep(10)
    V48Assert(FileExist(path),"isolated writer reached synchronization point")
}

V644StorageCrossProcess()
{
    root := V635Temp(),path := root "\history.json",pid := 0
    ; The child reads the same initial generation, owns a native OS lock, then
    ; attempts its stale save after this process has committed a disjoint row.
    child := '#Requires AutoHotkey v2.0`n#NoTrayIcon`n#Warn All, StdOut`nSuspend(true)`nSOPHIE_TEST_HARNESS := true`nIRIS_V48_TEST_ENTRY := Writer`n'
        . '#Include ' A_ScriptDir '\Iris_Test_Runtime.ahk`n'
        . 'Writer() {`n root := A_Args[1],path := root "\history.json",before := IGLHistoryText(path),lock := IHAcquireLock(path)`n'
        . ' FileAppend("ready",root "\ready")`n started := A_TickCount`n'
        . ' while !FileExist(root "\unlock") && A_TickCount-started<10000`n  Sleep(10)`n'
        . ' DllCall("CloseHandle","Ptr",lock)`n FileAppend("unlocked",root "\unlocked")`n'
        . ' while !FileExist(root "\commit") && A_TickCount-started<10000`n  Sleep(10)`n'
        . ' h := Map("child",{Key:"child",Session:"child",Date:"20260929",Team:"Synthetic",Pull:IDTDemoData()})`n'
        . ' try {`n  IGVWriteHistory(h,path,before)`n  FileAppend("UNEXPECTED",root "\result")`n }`n'
        . ' catch Error as err {`n  FileAppend(err.Message,root "\result")`n }`n ExitApp()`n}`n'
    try {
        IGVWriteHistory(Map(),path),FileAppend(child,root "\writer.ahk","UTF-8")
        Run('"' A_AhkPath '" /ErrorStdOut "' root '\writer.ahk" "' root '"',root,"Hide",&pid)
        V644StorageWaitFile(root "\ready",pid)
        V64Reject((*)=>IGVWriteHistory(V644StorageHistory(),path),"another process holding the OS lock rejects this writer")
        FileAppend("go",root "\unlock"),V644StorageWaitFile(root "\unlocked",pid)
        IGVWriteHistory(V644StorageHistory(),path),winner := FileRead(path,"UTF-8")
        FileAppend("go",root "\commit"),V644StorageWaitFile(root "\result",pid)
        V48Assert(InStr(FileRead(root "\result"),"changed before commit"),"stale second process explicitly rejected")
        V48Assert(FileRead(path,"UTF-8")==winner && IGVReadHistory(path).Has("synthetic"),"first process addition survives competing stale save")
        ProcessWaitClose(pid,2)
    }
    finally {
        if pid && ProcessExist(pid)
            ProcessClose(pid)
        DirDelete(root,true)
    }
}

V644CacheFixture(count := 3, detailRows := 64)
{
    local key
    source := V644ParserFeed(IPNewData("SYNTHETIC cache fixture"),V644ParserRows(0,true))
    IPFinalizeData(source,"synthetic complete")
    prototype := source.Segments[1]
    for key,recap in prototype.DeathCapture.Cases {
        sample := recap.Rows[recap.Rows.Length],recap.Rows := []
        Loop detailRows {
            row := sample.Clone(),row.At := 5000-detailRows+A_Index,row.Record := A_Index
            row.Kind := "Damage",row.Amount := 10,recap.Rows.Push(row)
        }
    }
    result := IPNewData("SYNTHETIC retained-pull benchmark"),result.Finished := true
    Loop count {
        seg := IPRCloneSnapshot(prototype),seg.Id := A_Index
        result.Segments.Push(seg)
    }
    return result
}

V644CacheReusesClosedPull()
{
    s := V644CacheFixture(),one := IPRFromLoaded(s,true),two := IPRFromLoaded(s,true)
    for seg in s.Segments
        V48Assert(seg.CompactBuilds=1,"a repeated private refresh does not recompact a closed pull")
    id := IDTCaseKey(one.Pulls[1].Deaths[1])
    V48Assert(one.Pulls[1].DeathRecaps[id].Rows=two.Pulls[1].DeathRecaps[id].Rows,"private refreshes share immutable retained row storage")
    V48Assert(one.Pulls[1]!=two.Pulls[1] && one.Pulls[1].Players!=two.Pulls[1].Players,"private views have independent mutable pull and player state")
}

V644CacheViewIsolation()
{
    s := V644CacheFixture(1),one := IPRFromLoaded(s,true),who := "@Recorder#644"
    one.Pulls[1].Included := false,one.Pulls[1].Players[who].Name := "edited view"
    one.Pulls[1].Players[who].Active.Values[1] := 999999,one.Pulls[1].Progress.Evidence := "changed view"
    two := IPRFromLoaded(s,true)
    V48Assert(two.Pulls[1].Included && two.Pulls[1].Players[who].Name!="edited view","exclusion/player edits cannot alter the cached source")
    V48Assert(two.Pulls[1].Players[who].Active.Values[1]!=999999 && two.Pulls[1].Progress.Evidence!="changed view","activity and progression objects are independent across views")
    public := IPRFromLoaded(s),id := IDTCaseKey(public.Pulls[1].Deaths[1])
    public.Pulls[1].DeathRecaps[id].Rows[1].Amount := 123456
    public.Pulls[1].DeathRecaps[id].Rows.Pop()
    again := IPRFromLoaded(s)
    V48Assert(again.Pulls[1].DeathRecaps[id].Rows.Length=64 && again.Pulls[1].DeathRecaps[id].Rows[1].Amount!=123456,"public loaded snapshots retain deep independent recap data")
    raw := IPRCompact(s.Segments[1]),raw.Players[who].Active.Values[1] := 123456
    V48Assert(IPRCompact(s.Segments[1]).Players[who].Active.Values[1]!=123456,"public compaction never exposes the activity cache for mutation")
}

V644CacheInvalidation()
{
    s := V644CacheFixture(2),first := IPRFromLoaded(s,true),seg := s.Segments[1],old := seg.SnapshotRevision
    a := V644ParserActors(),s.Current := seg
    ev := IPParseLine(IPDemoLine(10100,a.Owner,a.Boss,"Damage",25))
    seg.End := -1
    IPBFeedFinishing(s,ev,10100),IPCloseSegment(s,"revised synthetic snapshot")
    second := IPRFromLoaded(s,true)
    V48Assert(seg.SnapshotRevision>old && seg.CompactBuilds=2 && s.Segments[2].CompactBuilds=1,"accepted late changes invalidate only their segment")
    V48Assert(second.Pulls[1].End=10100 && first.Pulls[1].End=10000,"the refreshed endpoint changes without mutating an earlier view")
    seg.Partial := true,third := IPRFromLoaded(s,true)
    V48Assert(seg.CompactBuilds=3 && third.Pulls[1].Partial,"a quality-only change cannot reuse old eligibility")
    replacement := V644CacheFixture(2),fourth := IPRFromLoaded(replacement,true)
    V48Assert(replacement.Segments[1].CompactBuilds=1 && !fourth.Pulls[1].Partial,"a new source with the same pull IDs owns separate cache entries")
}

V644CacheRollbackRevision()
{
    s := IPNewData(),a := V644ParserActors()
    IPFeedLine(s,IPDemoLine(0,a.Owner,"=","Enter"))
    IPFeedLine(s,IPDemoLine(100,a.Owner,a.Boss,"Damage",10))
    IPFeedLine(s,IPDemoLine(200,a.Owner,"=","Activate"))
    seg := s.Current,revision := seg.SnapshotRevision
    V48Assert(IsObject(seg.Undo),"fixture includes a speculative trailing event")
    IPBRollbackTail(s,seg)
    V48Assert(seg.SnapshotRevision>revision,"rollback advances the immutable-snapshot revision instead of restoring an old one")
    revision := seg.SnapshotRevision,IPCloseSegment(s,"rollback test")
    IPRFromLoaded(s,true)
    V48Assert(seg.SnapshotRevision>revision && seg.CompactBuilds=1,"final snapshot is built after rollback and closure")
}

V644CacheNativeFightRows()
{
    global IP
    saved := IP,g := Gui(),lv := g.AddListView("w300 h200",["Id","Fight","Duration"])
    try {
        IP := IPNewApp(),IP.SegmentsLV := lv,u := IPWState(),u.Controls["FightCount"] := g.AddText(,""),IP.Selected := 1
        V48Assert(IGFRegister(lv),"hidden native fight list has its card renderer")
        s := V644CacheFixture(3),IPWUpdateFights(s)
        writes := u.FightCellWrites,paints := u.FightPaints,cards := IGFState().Lists[lv.Hwnd].Cards
        card := cards["1"],IPWUpdateFights(s)
        V48Assert(writes=3 && u.FightCellWrites=writes && u.FightPaints=paints,"unchanged native fights produce no row rewrites or redraw cycle")
        V48Assert(cards=IGFState().Lists[lv.Hwnd].Cards && card=cards["1"],"unchanged card map and values are retained")
        IP.Selected := 2,IPWUpdateFights(s)
        V48Assert(u.FightCellWrites=writes && lv.GetNext()=2,"selection updates independently of immutable cell content")
        s.Segments[2].Opponent := "changed display",IPWUpdateFights(s)
        V48Assert(u.FightCellWrites=writes+1 && lv.GetText(2,2)="changed display","only one changed displayed row is rewritten")
        IPWUpdateFights(s,[1,3])
        V48Assert(lv.GetCount()=2 && !cards.Has("2"),"filter rebuild retires removed native rows and card entries")
        replacement := V644CacheFixture(2),before := u.FightCellWrites
        IPWUpdateFights(replacement)
        V48Assert(u.FightCellWrites=before+2 && lv.GetText(2,2)!="changed display","source replacement cannot reuse an old source's native row cache")
    }
    finally {
        try IGFDetach(lv.Hwnd)
        try g.Destroy()
        IP := saved
    }
}

V644CacheBenchmark()
{
    out := A_ScriptDir "\cache_v644_benchmark.txt"
    try FileDelete(out)
    FileAppend("Synthetic retained pulls: one observed death with 64 recap rows each. Three warm refreshes. Milliseconds from QPC; no live-raid timing claim.`n",out)
    for count in [20,200,2000] {
        s := V644CacheFixture(count),began := IPImportNow(),warm := IPRFromLoaded(s,true),cold := IPImportNow()-began
        began := IPImportNow()
        Loop 3
            warm := IPRFromLoaded(s,true)
        cached := (IPImportNow()-began)/3
        began := IPImportNow(),uncached := []
        for seg in s.Segments
            uncached.Push(IPRCompact(seg))
        previous := IPImportNow()-began,builds := 0,ui := V644CacheBenchUI(s)
        for seg in s.Segments
            builds += seg.CompactBuilds
        FileAppend("pulls=" count " recapRows=" count*64 " coldCachedMs=" Round(cold,3)
            " warmCachedMeanMs=" Round(cached,3) " priorFullRecompactMs=" Round(previous,3)
            " compactBuilds=" builds " uiColdMs=" Round(ui.Cold,3) " uiWarmMeanMs=" Round(ui.Warm,3)
            " warmUiRowWrites=" ui.Writes " warmUiRedraws=" ui.Paints "`n",out)
        warm := "",uncached := "",s := ""
    }
}

V644CacheBenchUI(s)
{
    global IP
    saved := IP,g := Gui(),lv := g.AddListView("w300 h200",["Id","Fight","Duration"])
    try {
        IP := IPNewApp(),IP.SegmentsLV := lv,u := IPWState(),u.Controls["FightCount"] := g.AddText(,""),IP.Selected := 1
        if !IGFRegister(lv)
            throw Error("Benchmark fight-list registration failed.")
        began := IPImportNow(),IPWUpdateFights(s),cold := IPImportNow()-began
        writes := u.FightCellWrites,paints := u.FightPaints,began := IPImportNow()
        Loop 3
            IPWUpdateFights(s)
        return {Cold:cold,Warm:(IPImportNow()-began)/3,Writes:u.FightCellWrites-writes,Paints:u.FightPaints-paints}
    }
    finally {
        try IGFDetach(lv.Hwnd)
        try g.Destroy()
        IP := saved
    }
}

; v64.4 auxiliary diagnostics and GDI ownership. Isolated, hidden controls only.
; Groups: V644CleanupSuccess, V644CleanupRetainsAndRetries,
; V644CleanupBudgetAndCapacity, V644CleanupDestroyedOwner,
; V644AuxiliaryErrorPrivacy, V644AuxiliaryErrorBound,
; V644DeathErrorContainment, V644ProgressErrorContainment, V644DrawErrorEvidence.

V644RetiredHas(entry)
{
    for id,e in IGFState().Retired {
        if e=entry
            return true
    }
    return false
}

V644CleanupRestoreFixture(entry,normal)
{
    ; Only this fixture substitutes HGDI_ERROR. Restore the still-owned real
    ; font before cleanup; never retry an already successfully deleted handle.
    if IsObject(entry) && entry.Normal=-1 {
        entry.Normal := normal,entry.Cleanup.Passes := 0
        IGFRetryRetired()
    }
}

V644CleanupSuccess()
{
    g := Gui(),lv := g.AddListView("w240 h140",["Fight"])
    try {
        V48Assert(IGFRegister(lv),"hidden fight-list owner registers")
        hwnd := lv.Hwnd,e := IGFState().Lists[hwnd]
        V48Assert(IGFDetach(hwnd) && !V644RetiredHas(e),"successful releases remove retired ownership")
        attempts := e.Cleanup.FontAttempts
        IGFRetryRetired(), IGFDetach(hwnd)
        V48Assert(e.Bold=0 && e.Normal=0 && e.Images=0 && e.Cleanup.FontAttempts=attempts,
            "successful native handles are cleared and never retried")
    }
    finally {
        IGFDetach(lv.Hwnd)
        g.Destroy()
    }
}

V644CleanupRetainsAndRetries()
{
    g := Gui(),lv := g.AddListView("w240 h140",["Fight"]),e := "",normal := 0
    try {
        V48Assert(IGFRegister(lv),"negative cleanup fixture registers")
        e := IGFState().Lists[lv.Hwnd],normal := e.Normal,e.Normal := -1
        V48Assert(!IGFDetach(lv.Hwnd) && V644RetiredHas(e),"native failed font deletion retains an owner")
        V48Assert(e.Normal=-1 && e.Bold=0 && e.Images=0 && e.Cleanup.FontAttempts=2,
            "failed field retained while successful fields cleared")
        images := e.Cleanup.ImageAttempts
        e.Normal := normal
        IGFRetryRetired()
        V48Assert(e.Cleanup.Complete && e.Normal=0 && !V644RetiredHas(e),"restored releasable resource retires successfully")
        V48Assert(e.Cleanup.FontAttempts=3 && e.Cleanup.ImageAttempts=images,
            "retry touches only failed font, never successful font or image list")
    }
    finally {
        V644CleanupRestoreFixture(e,normal)
        IGFDetach(lv.Hwnd)
        g.Destroy()
    }
}

V644CleanupBudgetAndCapacity()
{
    s := IGFState(),oldLimit := s.RetireLimit,g := Gui(),e := "",normal := 0
    one := g.AddListView("w240 h140",["One"]),two := g.AddListView("w240 h140",["Two"])
    try {
        s.RetireLimit := s.Lists.Count+s.Retired.Count+1
        V48Assert(IGFRegister(one),"one remaining ownership reservation can attach")
        e := s.Lists[one.Hwnd],normal := e.Normal,e.Normal := -1
        IGFDetach(one.Hwnd)
        V48Assert(!IGFRegister(two),"full retired registry blocks another native attachment")
        Loop 5
            IGFRetryRetired()
        attempts := e.Cleanup.FontAttempts
        V48Assert(e.Cleanup.Passes=s.RetryLimit && V644RetiredHas(e),"exhausted owner retained after bounded retries")
        IGFRetryRetired()
        V48Assert(e.Cleanup.FontAttempts=attempts && !IGFRegister(two),"exhaustion does not repeatedly call native deletion or allocate")
    }
    finally {
        s.RetireLimit := oldLimit
        V644CleanupRestoreFixture(e,normal)
        IGFDetach(one.Hwnd),IGFDetach(two.Hwnd)
        g.Destroy()
    }
}

V644CleanupDestroyedOwner()
{
    g := Gui(),lv := g.AddListView("w240 h140",["Fight"])
    V48Assert(IGFRegister(lv),"destroyed-owner fixture registers")
    hwnd := lv.Hwnd,e := IGFState().Lists[hwnd]
    g.Destroy()
    V48Assert(IGFDetach(hwnd) && e.Cleanup.Complete && !V644RetiredHas(e),
        "destroyed control still releases owned shared image list and fonts")
}

V644AuxiliaryWith(action)
{
    d := IAuxDiagnosticState(),old := d.Errors,oldDropped := d.Dropped,oldLimit := d.Limit
    try {
        d.Errors := Map(),d.Dropped := 0
        action.Call()
    }
    finally d.Errors := old,d.Dropped := oldDropped,d.Limit := oldLimit
}

V644AuxiliaryErrorPrivacy()
{
    V644AuxiliaryWith(V644AuxiliaryPrivacyCase)
}

V644AuxiliaryPrivacyCase()
{
    d := IAuxDiagnosticState(),first := ValueError("SECRET_PLAYER C:\\PRIVATE\\raw-log.txt"),first.Line := 12345
    IAuxDiagnosticError("death-recap","observe",first)
    second := TypeError("SECOND_SECRET"),second.Line := 55555
    IAuxDiagnosticError("death-recap","observe",second)
    e := d.Errors["death-recap|observe"],text := IAuxDiagnosticReport()
    V48Assert(e.Count=2 && e.FirstErrorType="ValueError" && e.FirstErrorLine=12345,
        "first error type and line retained while repetitions increment count")
    V48Assert(!InStr(text,"SECRET") && !InStr(text,"PRIVATE") && !InStr(text,"raw-log")
        && !e.HasOwnProp("Message") && !e.HasOwnProp("Error"),"reports retain no error message, path or exception object")
    V48Assert(InStr(IURAppearanceReport(),"death-recap/observe") && InStr(IGKGraphReport(),"death-recap/observe"),
        "existing appearance and progression diagnostics expose auxiliary evidence")
}

V644AuxiliaryErrorBound()
{
    V644AuxiliaryWith(V644AuxiliaryBoundCase)
}

V644AuxiliaryBoundCase()
{
    d := IAuxDiagnosticState(),d.Limit := 2
    Loop 10
        IAuxDiagnosticError("component","operation-" A_Index,Error("private"))
    V48Assert(d.Errors.Count=2 && d.Dropped=8,"diagnostic category storage is bounded")
    Loop 20
        IAuxDiagnosticError("component","operation-1",Error("private"))
    V48Assert(d.Errors.Count=2 && d.Errors["component|operation-1"].Count=21,
        "repeated exceptions count without storing repeated details")
}

V644DeathErrorContainment()
{
    V644AuxiliaryWith(V644DeathErrorCase)
}

V644DeathErrorCase()
{
    s := V61Base(),seg := s.Current
    V61Apply(s,1000,"Damage","@Bobby#101","Synthetic boss {123}:1",400)
    before := seg.Totals["@Bobby#101"].Damage
    IDTSafeObserve(seg,{},2000) ; missing ValueOK causes a real native PropertyError
    IDTSafeFreeze(seg,{}, {}) ; missing death fields exercises independent freeze catch
    d := IAuxDiagnosticState()
    V48Assert(seg.Totals["@Bobby#101"].Damage=before && seg.DeathCapture.Flags.Get("Error",false),
        "auxiliary failures preserve core totals and mark recap incomplete")
    V48Assert(d.Errors.Has("death-recap|observe") && d.Errors.Has("death-recap|freeze")
        && d.Errors["death-recap|observe"].FirstErrorLine>0,
        "actual observe and freeze exceptions retain independent first locations")
}

V644ProgressErrorContainment()
{
    V644AuxiliaryWith(V644ProgressErrorCase)
}

V644ProgressErrorCase()
{
    s := V61Base(),seg := s.Current
    V61Apply(s,1000,"Damage","@Bobby#101","Synthetic boss {123}:1",400)
    before := seg.Totals["@Bobby#101"].Damage
    IGPSafeObserve(seg,{},2000)
    e := IAuxDiagnosticState().Errors["progression|observe"]
    V48Assert(seg.Totals["@Bobby#101"].Damage=before && seg.PhaseProgress.Get("Limited",false)
        && e.FirstErrorLine>0,"progression exception is contained and diagnosed without changing totals")
}

V644DrawErrorEvidence()
{
    V644AuxiliaryWith(V644DrawErrorCase)
}

V644DrawErrorCase()
{
    g := Gui(),lv := g.AddListView("w240 h140",["Fight"])
    try {
        V48Assert(IGFRegister(lv),"drawing-error fixture registers")
        lv.Add("","1"),e := IGFState().Lists[lv.Hwnd],e.Cards := "invalid synthetic map"
        off := IURDrawOffsets(),n := Buffer(128,0)
        NumPut("UInt",0x10001,n,off.Stage),NumPut("UPtr",0,n,off.Item)
        IGFNotify(lv,n.Ptr)
        V48Assert(e.Failed && IAuxDiagnosticState().Errors.Has("fight-list|draw"),
            "native custom draw fallback records first error without crashing")
    }
    finally {
        IGFDetach(lv.Hwnd)
        g.Destroy()
    }
}

; v64.5: recording management tests. Synthetic maps/private temp files only.
V645HistoryEntry(key,session,date := "20260927",team := "Raid",pull := "")
{
    return {Key:key,Session:session,Date:date,Team:team,Pull:IsObject(pull) ? pull : V635Pull()}
}

V645HistoryGroups()
{
    a := V635Pull(),b := V644HistoryCapture("B","kill"),c := V635Pull(3)
    h := Map("a",V645HistoryEntry("a","raid.txt","20260927","Raid",a),
        "b",V645HistoryEntry("b","20260927_raid.txt","20260927","Visitors",b),
        "c",V645HistoryEntry("c","raid.txt","20260928","Raid",c))
    groups := IHMRecordings(h)
    V48Assert(groups.Length=2 && groups[1].Date="20260928","saved recordings group legacy/date-qualified identities while keeping different dates separate and recent first")
    older := groups[2]
    V48Assert(older.Count=2 && older.Keys.Length=2 && older.Id=IHMRecordingId(h["a"]) && older.Id=IHMRecordingId(h["b"]),"group holds exact capture keys across bosses and team tags")
    V48Assert(InStr(older.Teams,"Raid") && InStr(older.Teams,"Visitors") && InStr(older.Encounters,a.Name) && InStr(older.Encounters,b.Name),"recording labels disclose saved teams and different encounters")
    V48Assert(older.Session="20260927_raid.txt" && older.First!="" && older.Last!="","saved identifier and recorded time range are available without inventing a raw-log path")
    h["a"].Pull.RecorderKey := "missing-synthetic-player"
    V48Assert(InStr(IHMRecordings(h)[2].Recorders,"Unknown name [missing-synthetic-player]"),"recorder not present in saved players retains its identifier with unknown name")
    out := IHMRemoval(h,[older.Id])
    V48Assert(out.RemovedRecordings=1 && out.RemovedCaptures=2 && out.History.Count=1 && out.History["c"]=h["c"],"whole-recording selection removes every team/boss capture and preserves other original objects")
    V48Assert(h.Count=3 && h["a"].Pull=a,"list and removal plan never mutate the input history")
    longSession := StrReplace(Format("{:180}","")," ","x"),longHistory := Map("long",V645HistoryEntry("long",longSession))
    longGroup := IHMRecordings(longHistory)[1]
    V48Assert(StrLen(longGroup.Session)=189 && IHMRemoval(longHistory,[longGroup.Id]).History.Count=0 && longHistory["long"].Session==longSession,"long valid legacy session can be grouped and removed without changing its stored identifier")
}

V645HistorySelectionValidation()
{
    h := Map("a",V645HistoryEntry("a","raid.txt")),id := IHMRecordingId(h["a"])
    for ids in [[],"not an array",["missing"],[id,"missing"],[id,id],[123]]
        V64Reject((*)=>IHMRemoval(h,ids),"invalid or stale recording selection must not form a removal plan")
    V48Assert(h.Count=1 && IHMRecordings(Map()).Length=0,"invalid selection preserves input and empty histories remain readable")
    V64Reject((*)=>IHMRemoveSaved({History:h,Original:{Exists:false,Text:""}},[id],A_ScriptFullPath),"diagnostics cannot remove a history outside their private temporary folder")
}

V645HistoryAlternativesAndCycles()
{
    partial := V644HistoryCapture("A"),kill := V644HistoryCapture("B","kill")
    merged := V644HistoryPair(partial,kill),history := merged.History
    view := IGKBuild(V644HistoryEntries(history),"first")
    V48Assert(view.Completed && view.TeamPulls=1,"fixture has one resolved kill from retained alternatives")
    killId := "",partialId := ""
    for key,entry in history {
        if entry.Pull.RecorderKey=kill.RecorderKey
            killId := IHMRecordingId(entry),storedKill := entry.Pull
        else
            partialId := IHMRecordingId(entry),storedPartial := entry.Pull
    }
    removed := IHMRemoval(history,[killId]),after := IGKBuild(V644HistoryEntries(removed.History),"first")
    V48Assert(!after.Completed && after.TeamPulls=1 && after.Rows[1].Pull=storedPartial,"removing the kill recording recomputes first-kill evidence from remaining capture")
    retained := IHMRemoval(history,[partialId]),after := IGKBuild(V644HistoryEntries(retained.History),"first")
    V48Assert(after.Completed && after.Rows[1].Pull=storedKill && history.Count=2,"removing an alternate preserves the original remaining kill without summing or mutating evidence")
    wipe := V644HistoryCapture("A","wipe"),conflicted := V644HistoryPair(wipe,kill).History
    V48Assert(IGKBuild(V644HistoryEntries(conflicted),"first").NeedsResolution,"fixture also represents contradictory original sources")
    removeId := ""
    for key,entry in conflicted {
        if entry.Pull.RecorderKey=wipe.RecorderKey
            removeId := IHMRecordingId(entry)
    }
    resolved := IHMRemoval(conflicted,[removeId])
    V48Assert(IGKBuild(V644HistoryEntries(resolved.History),"first").Completed,"removing the accidentally added conflicting source recomputes the view without altering the other source")
}

V645HistorySavedRemoval()
{
    root := V635Temp(),path := root "\history.json",raw := root "\combat-source.txt"
    try {
        h := V644StorageHistory(),h["synthetic"].Session := "recap-recording"
        h["other"] := V645HistoryEntry("other","other-recording","20260929")
        FileAppend("Synthetic original log remains untouched.",raw,"UTF-8-RAW")
        IGVWriteHistory(h,path),snapshot := IHMRead(path),before := FileRead(path,"UTF-8")
        p := snapshot.History["synthetic"].Pull,detail := p.DeathRecapRef.Path,detailBefore := FileRead(detail,"UTF-8")
        id := IHMRecordingId(snapshot.History["synthetic"])
        out := IHMRemoveSaved(snapshot,[id],path),saved := IHMRead(path)
        V48Assert(saved.History.Count=1 && saved.History.Has("other") && out.RemovedCaptures=1 && out.RemovedRecordings=1,"saved removal publishes only the selected whole recording")
        V48Assert(out.Original.Text==saved.Original.Text && out.Original.Exists,"removal returns its own committed generation for guarded undo")
        V48Assert(FileRead(path ".bak","UTF-8")==before && FileRead(out.BackupPath,"UTF-8")==before,"regular and unique recovery backups preserve the exact pre-removal history")
        V48Assert(FileRead(raw,"UTF-8")=="Synthetic original log remains untouched." && FileRead(detail,"UTF-8")==detailBefore,"removal never deletes or edits the raw recording or immutable recap")
        V48Assert(p.DeathRecaps.Count=0 && snapshot.History.Count=2,"removal does not eagerly load recap detail or change undo snapshot")
        token := IGVWriteHistory(snapshot.History,path,out.Original)
        V48Assert(IGVReadHistory(path).Count=2 && IGLHistoryUnchanged(token,path),"guarded undo restores all original captures")
        V48Assert(FileRead(out.BackupPath,"UTF-8")==before,"later saves never overwrite unique removal backup")
        recover := IGVReadHistory(out.BackupPath),rp := recover["synthetic"].Pull
        V48Assert(IsObject(IDTCase(rp,rp.Deaths[1])),"unique backup still resolves retained recap sidecar after removal and undo")
    }
    finally DirDelete(root,true)
}

V645HistoryRemoveAll()
{
    root := V635Temp(),path := root "\history.json"
    try {
        h := Map("a",V645HistoryEntry("a","a"),"b",V645HistoryEntry("b","b"))
        IGVWriteHistory(h,path),snapshot := IHMRead(path),ids := []
        for group in IHMRecordings(snapshot.History)
            ids.Push(group.Id)
        result := IHMRemoveSaved(snapshot,ids,path),reopened := IHMRead(path)
        V48Assert(result.RemovedRecordings=2 && result.RemovedCaptures=2 && reopened.History.Count=0,"removing every saved recording commits a valid reopenable empty history")
        V48Assert(IHMRecordings(reopened.History).Length=0 && IGVReadHistory(result.BackupPath).Count=2,"empty list still retains recoverable pre-removal history")
    }
    finally DirDelete(root,true)
}

V645HistoryStaleGeneration()
{
    root := V635Temp(),path := root "\history.json"
    try {
        h := Map("a",V645HistoryEntry("a","a")),IGVWriteHistory(h,path),snapshot := IHMRead(path)
        h["b"] := V645HistoryEntry("b","b"),IGVWriteHistory(h,path),newer := FileRead(path,"UTF-8")
        V64Reject((*)=>IHMRemoveSaved(snapshot,[IHMRecordingId(snapshot.History["a"])],path),"concurrent saved-history generation rejects stale removal")
        V48Assert(FileRead(path,"UTF-8")==newer && IGVReadHistory(path).Count=2,"stale removal leaves the complete newer history byte-for-byte intact")
        backups := 0
        Loop Files path ".before-removal-*.bak","F"
            backups += 1
        V48Assert(backups=0,"stale removal is rejected before making a removal backup")
        fresh := IHMRead(path),removed := IHMRemoveSaved(fresh,[IHMRecordingId(fresh.History["a"])],path)
        edited := removed.History.Clone(),edited["c"] := V645HistoryEntry("c","c"),IGVWriteHistory(edited,path),newest := FileRead(path,"UTF-8")
        V64Reject((*)=>IGVWriteHistory(fresh.History,path,removed.Original),"undo after another save cannot clobber a later generation")
        V48Assert(FileRead(path,"UTF-8")==newest,"rejected stale undo leaves newer changes intact")
    }
    finally DirDelete(root,true)
}

V645HistoryBackupFailure()
{
    root := V635Temp(),path := root "\history.json"
    try {
        IGVWriteHistory(Map("a",V645HistoryEntry("a","a")),path),before := IGLHistoryText(path),state := {BackupPath:""}
        service := IHMRemovalBackup.Bind(state,path,{Exists:true,Text:"synthetic mismatch"})
        V64Reject((*)=>IGVWriteHistory(Map(),path,before,service),"failed recovery-backup verification aborts publication")
        V48Assert(IGLHistoryUnchanged(before,path) && IGVReadHistory(path).Count=1,"backup failure preserves prior history and releases the lock")
        snapshot := IHMRead(path),removed := IHMRemoveSaved(snapshot,[IHMRecordingId(snapshot.History["a"])],path)
        V48Assert(removed.History.Count=0 && FileExist(removed.BackupPath),"a valid retry succeeds after failed recovery backup")
    }
    finally DirDelete(root,true)
}

; v64.5 hidden native manager workflow. Original logs/settings are not accessed.
V645ManagerFixture(action)
{
    V61Hidden(V645ManagerInner.Bind(action))
}

V645ManagerInner(action)
{
    root := V635Temp(),path := root "\history.json",v := IGVState(),oldBusy := v.Busy
    try {
        IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IGVDemoData(),v.Busy := false,IGVOpen()
        history := Map("a",V645HistoryEntry("a","wrong-log.txt","20260927","One"),
            "b",V645HistoryEntry("b","20260927_wrong-log.txt","20260927","Two",V635Pull(2)),
            "c",V645HistoryEntry("c","right-log.txt","20260928","Keep",V635Pull(3)))
        IGVWriteHistory(history,path),m := IHMBuild(path)
        action.Call(m,path,history)
    }
    finally {
        IHMUIState().Busy := false,IHMClose(),IGVClose(),v.Busy := oldBusy
        DirDelete(root,true)
    }
}

V645ManagerSelect(session)
{
    m := IHMUIState(),lv := m.Controls["Rows"],lv.Modify(0,"-Select")
    for i,row in m.Rows {
        if InStr(row.Session,session)
            lv.Modify(i,"Select Focus")
    }
    IHMSelectionChanged()
}

V645ManagerLayoutAndList()
{
    V645ManagerFixture(V645ManagerLayoutCase)
}

V645ManagerLayoutCase(m,path,history)
{
    v := IGVState()
    V48Assert(v.Controls.Has("ManageLogs") && m.Rows.Length=2 && m.Controls["Rows"].GetCount()=2,"graph exposes manager and shows source groups across all teams")
    V48Assert(!m.Controls["Remove"].Enabled && !m.Controls["Undo"].Enabled,"opening manager does not preselect destructive action")
    V48Assert(!DllCall("IsWindowVisible","Ptr",m.Gui.Hwnd),"native diagnostic manager remains hidden")
    for size in [[920,480],[1020,600],[1400,850]] {
        IHMResize(m.Gui,0,size[1],size[2])
        m.Controls["Rows"].GetPos(&x,&y,&w,&h),m.Controls["Details"].GetPos(&dx,&dy,&dw,&dh)
        V48Assert(y+h<dy && x+w<=size[1] && dy+dh<size[2]-100,"manager table and full-details panel fit without overlap")
        m.Controls["Close"].GetPos(&cx,&cy,&cw,&ch)
        V48Assert(cx+cw<=size[1] && cy+ch<size[2]-46,"footer buttons fit supported sizes")
    }
    for width in [900,960,1220] {
        IGVResize(v.Gui,0,width,570)
        v.Controls["Team"].GetPos(&tx,&ty,&tw,&th),v.Controls["ManageLogs"].GetPos(&mx,&my,&mw,&mh),v.Controls["Help"].GetPos(&hx,&hy,&hw,&hh)
        V48Assert(tx+tw<mx && mx+mw<hx && hx+hw<=width,"new graph button stays beside team filter and help at minimum width")
    }
    V645ManagerSelect("wrong-log")
    V48Assert(m.Controls["Remove"].Enabled && InStr(m.Controls["Details"].Value,"One") && InStr(m.Controls["Details"].Value,"Two"),"selection discloses every affected team")
}

V645ManagerCancelAndUndo()
{
    V645ManagerFixture(V645ManagerCancelUndoCase)
}

V645ManagerCancelUndoCase(m,path,history)
{
    before := FileRead(path,"UTF-8"),V645ManagerSelect("wrong-log")
    V48Assert(!IHMRemoveSelected((message)=>"No") && FileRead(path,"UTF-8")==before,"declining confirmation keeps exact saved history")
    V48Assert(!IsObject(m.Undo) && !m.Busy && !IGVState().Busy,"cancel restores UI ownership without enabling undo")
    V48Assert(IHMRemoveSelected(V645ManagerConfirm),"confirmed selection completes native manager workflow")
    V48Assert(m.Rows.Length=1 && m.Snapshot.History.Count=1 && IGVReadHistory(path).Has("c"),"only selected source removed across both its teams")
    V48Assert(m.Controls["Undo"].Enabled && FileRead(m.BackupPath,"UTF-8")==before,"visible undo and durable recovery refer to complete pre-removal snapshot")
    v := IGVState()
    V48Assert(v.Source="history" && v.History.Count=1 && v.History.Has("c"),"graph immediately uses updated saved history")
    V48Assert(IHMUndoRemoval() && IGVReadHistory(path).Count=3 && m.Rows.Length=2,"undo restores the exact recordings through the native UI")
    V48Assert(!m.Controls["Undo"].Enabled && v.History.Count=3,"undo is single-use and graph reflects restoration")
}

V645ManagerConfirm(message)
{
    V48Assert(InStr(message,"1 selected recording") && InStr(message,"2 saved capture") && InStr(message,"Original .txt/.log files are kept"),"confirmation discloses exact selected scope and original-file preservation")
    V48Assert(!IHMClose() && IHMUIState().Busy,"close cannot interrupt save/confirmation ownership")
    return "Yes"
}

V645ManagerStaleAndEmpty()
{
    V645ManagerFixture(V645ManagerStaleEmptyCase)
}

V645ManagerStaleEmptyCase(m,path,history)
{
    V645ManagerSelect("wrong-log"),changed := history.Clone(),changed["d"] := V645HistoryEntry("d","new-log.txt","20260929")
    IGVWriteHistory(changed,path),current := FileRead(path,"UTF-8")
    V48Assert(!IHMRemoveSelected((*)=>"Yes") && FileRead(path,"UTF-8")==current,"stale manager never overwrites newer saved recordings")
    V48Assert(InStr(m.Controls["Status"].Text,"No recordings removed") && !IsObject(m.Undo),"stale failure is explicit and does not offer a false undo")
    V48Assert(IHMRefresh() && m.Rows.Length=3,"refresh reads and lists the newer history")
    V645ManagerSelect("wrong-log"),IHMRemoveSelected((*)=>"Yes")
    newer := IGVReadHistory(path),newer["e"] := V645HistoryEntry("e","later-log.txt","20260930"),IGVWriteHistory(newer,path),current := FileRead(path,"UTF-8")
    V48Assert(!IHMUndoRemoval() && FileRead(path,"UTF-8")==current,"undo cannot erase recordings added by another writer")
    IHMRefresh(),m.Controls["Rows"].Modify(0,"Select"),IHMSelectionChanged()
    V48Assert(IHMRemoveSelected((*)=>"Yes") && IGVReadHistory(path).Count=0,"all remaining recordings may be selected and removed explicitly")
    V48Assert(m.Rows.Length=0 && InStr(m.Controls["Details"].Value,"No saved recordings") && !m.Controls["Remove"].Enabled,"empty history is clear and removal is disabled")
    V48Assert(IGVState().Rows.Length=0 && IHMUndoRemoval(),"empty graph can be recovered with undo")
}

V645ManagerLifecycle()
{
    V645ManagerFixture(V645ManagerLifecycleCase)
}

V645ManagerLifecycleCase(m,path,history)
{
    v := IGVState(),hwnd := m.Gui.Hwnd
    V48Assert(IHMBuild(path)=m && m.Gui.Hwnd=hwnd,"reopening an existing manager keeps its selection and window")
    v.Busy := true
    V48Assert(!IHMRefresh() && !IHMRemoveSelected((*)=>"Yes"),"graph save ownership blocks manager mutations")
    v.Busy := false,IGLState().Busy := true,IGLBusyControls()
    V48Assert(!v.Controls["ManageLogs"].Enabled && !IHMRefresh(),"batch import disables manager entry and mutation")
    IGLState().Busy := false,IGLBusyControls()
    IGVClose()
    V48Assert(!IPMUiHandle(IHMUIState().Gui) && !DllCall("IsWindow","Ptr",hwnd),"closing graph cleans up owned manager")
}

; Private synthetic progression files only; registered groups are listed below.
; V646ProgressionPhaseTransitions, V646ProgressionMergeCancellation,
; V646ProgressionPostCommitDisplayError, V646ProgressionTimingPrivacy,
; V646ProgressionUnchangedOutcome.

V646ProgressionPhaseTransitions()
{
    V635WithBatch(V646PhaseCase)
}

V646PhaseProbe(seen,job,phase)
{
    expected := Map("before-file","Opening","reading","Reading","end-file","Finishing file",
        "before-merge","Merging pulls","before-commit","Saving history","save-verifying","Verifying history",
        "refresh-graph","Refreshing graph")
    if expected.Has(phase) {
        status := IGVState().Controls["Status"].Text
        V48Assert(InStr(status,expected[phase]),"phase transition is visible before its work begins: " phase)
        if phase!="reading"
            V48Assert(!InStr(status,"%"),"non-reading stages cannot retain misleading file percentage")
        seen[phase] := true
    }
    job.LastStatus := IPImportNow()+1000000 ; transitions must bypass the interval throttle
}

V646PhaseCase(root,items)
{
    seen := Map(),job := IGLBegin(items,"Synthetic",root "\phase.json")
    job.LastStatus := IPImportNow()+1000000
    V48Assert(IGLPump(V646PhaseProbe.Bind(seen)),"phase-aware batch saves successfully")
    V48Assert(seen.Count=7 && InStr(IGLState().LastReport,"Saved locally"),"all required phases and terminal result are shown")
    V48Assert(IGLState().LastTiming.Stages.Count<=7,"diagnostics retain only bounded stage categories")
}

V646ProgressionMergeCancellation()
{
    V635WithBatch(V646MergeCancelCase)
}

V646CancelMergeAt(wanted,job,phase)
{
    if phase=wanted && (phase!="merge-index" || job.MergeDone>=64)
        IGLCancel()
}

V646MergeCancelCase(root,items)
{
    prior := Map(),p := V635Pull()
    Loop 70 {
        key := "older-" A_Index
        prior[key] := {Key:key,Session:key,Date:"20260925",Team:"Synthetic",Pull:p}
    }
    for phase in ["merge-index","merge-pull"] {
        path := root "\cancel-" phase ".json"
        IGVWriteHistory(prior,path),before := FileRead(path,"UTF-8")
        job := IGLBegin(items,"Synthetic",path)
        V48Assert(!IGLPump(V646CancelMergeAt.Bind(phase)),"cancel during " phase " stops the batch")
        V48Assert(!job.Committed && FileRead(path,"UTF-8")==before && job.History.Count=70,"canceled merge preserves disk bytes and prior history ownership")
        V48Assert(!IGLBusy() && !IPRState().Busy && IGLState().LastTiming.Outcome="CANCELED","merge cancellation releases ownership and records its outcome")
    }
}

V646ProgressionPostCommitDisplayError()
{
    V635WithBatch(V646DisplayErrorCase)
}

V646FailGraphRefresh(job,phase)
{
    if phase!="refresh-graph"
        return
    V48Assert(job.Committed && IGVReadHistory(job.Path).Count=6,"graph refresh happens after publication")
    V48Assert(IGLBusy() && IGLState().Job=job && !IGLCanStart(),"the completing batch retains ownership through graph refresh")
    V48Assert(InStr(IGLState().LastReport,"Saved locally"),"saved result is available before graph refresh")
    IGLCancel()
    throw Error("PRIVATE_PLAYER_AND_PATH_MUST_NOT_ENTER_TIMING")
}

V646DisplayErrorCase(root,items)
{
    path := root "\display-error.json",job := IGLBegin(items,"PRIVATE_TEAM",path)
    V48Assert(IGLPump(V646FailGraphRefresh),"display error cannot convert a committed batch into failure")
    report := IGLState().LastReport,timing := IGLImportTimingReport()
    V48Assert(job.Committed && IGVReadHistory(path).Count=6 && IGVState().History.Count=6,"saved data remains installed when rendering throws")
    V48Assert(InStr(report,"Saved locally") && InStr(report,"graph could not") && !InStr(report,"not saved"),"display warning tells the truth about saved history")
    V48Assert(IGLState().LastTiming.Outcome="SAVED_DISPLAY_ERROR" && !InStr(timing,"PRIVATE_"),"diagnostics retain outcome without private exception text")
}

V646ProgressionTimingPrivacy()
{
    V635WithBatch(V646TimingCase)
}

V646TimingProbe(seen,root,job,phase)
{
    if phase!="before-merge"
        return
    report := IGLImportTimingReport()
    V48Assert(InStr(report,"Outcome: RUNNING") && InStr(report,"Stage: Merging pulls"),"current timing report is available during work")
    V48Assert(!InStr(report,root) && !InStr(report,"PRIVATE_TEAM") && !InStr(report,"combat_"),"current timing contains no paths, team or filenames")
    seen.Count += 1
}

V646TimingCase(root,items)
{
    seen := {Count:0},job := IGLBegin(items,"PRIVATE_TEAM",root "\timing-private.json")
    V48Assert(IGLPump(V646TimingProbe.Bind(seen,root)),"timed batch completed")
    state := IGLState(),t := state.LastTiming,report := IGLImportTimingReport()
    V48Assert(seen.Count=2 && !IsObject(state.CurrentTiming) && t.Outcome="SAVED","current timing becomes the completed report")
    V48Assert(t.Records=54 && t.Files=2 && t.TotalFiles=2 && t.Added=6 && t.Stopped>=t.Started,"timing counters match the actual batch")
    V48Assert(!InStr(report,root) && !InStr(report,"PRIVATE_TEAM") && !InStr(report,"combat_"),"completed timing contains no private identifiers")
    stopped := t.Stopped
    IGLFinishTiming(job,"ERROR",true)
    V48Assert(t.Stopped=stopped && IGLImportTimingReport()==report,"repeated cleanup cannot alter completed timing or outcome")
    for name,value in t.OwnProps()
        V48Assert(!IsObject(value) || name="Stages","timing retains no history, job, pull or file objects")
}

V646ProgressionUnchangedOutcome()
{
    V635WithBatch(V646UnchangedCase)
}

V646UnchangedCase(root,items)
{
    path := root "\unchanged.json"
    IGLBegin(items,"Synthetic",path)
    V48Assert(IGLPump(),"initial batch saved")
    before := FileRead(path,"UTF-8"),job := IGLBegin(items,"Synthetic",path)
    V48Assert(IGLPump() && job.Committed && job.Unchanged=6,"identical reimport is a successful completed operation")
    V48Assert(FileRead(path,"UTF-8")==before && IGLState().LastTiming.Outcome="SAVED","unchanged history is not rewritten and reports success")
}

; All data below is synthetic. No audio, network or real parser state.
; Registered groups are the sixteen V647Boss... functions below.
V647BossFixture()
{
    s := IPNewData("Synthetic boss evidence"),seg := IPNewSegment(s,0,"observed combat entry")
    seg.BossKey := "G-TY",seg.BossActors["N:4078423634870272:700:Tyth"] := "boss"
    seg.DeathCapture := IDTNewCapture()
    return {Data:s,Seg:seg,Next:1,Pull:{Boss:"G-TY",Start:0,End:15000,Partial:false,
        Area:"833571547775765",Mode:"836045448953655"},
        Recap:{Key:"@Victim#1",At:15000,Record:10000,From:3000,Rows:[],Partial:false}}
}

V647BossNPC(id := "4078445109706752",instance := 701,hp := 1000)
{
    name := IBCTythId(id) ? "Tyth" : IBCAddName(id)
    return name " {" id "}:" instance "|(" hp "/1000000)"
}

V647BossFeed(f,at,source,target,ability,action,effect,tail := "")
{
    stamp := Format("{:02d}:{:02d}:{:02d}.{:03d}",Floor(at/3600000),Mod(Floor(at/60000),60),Mod(Floor(at/1000),60),Mod(at,1000))
    line := "[" stamp "] [" source "] [" target "] [Spell {" ability "}] [Action {" action "}: Effect {" effect "}] " tail
    ev := IPParseLine(line)
    V48Assert(IsObject(ev) && ev.ValueOK,"synthetic raw boss event parses")
    ev.RecordId := f.Next,f.Next += 1
    IBCObserve(f.Seg,ev,at)
    return ev
}

V647BossRage(f,at,count)
{
    return V647BossFeed(f,at,V647BossNPC("4078423634870272",700),"=","4086833180836195",
        "836045448953666","4086833180836195","(" count " charges {836045448953667})")
}

V647BossSweep(f,at,instance := 701,id := "4078445109706752",tail := "(0 -)",hp := 1000)
{
    return V647BossFeed(f,at,V647BossNPC("4078423634870272",700),V647BossNPC(id,instance,hp),
        "4080279060742144","836045448945477","836045448945501",tail)
}

V647BossZero(f,at,instance := 701,id := "4078445109706752")
{
    return V647BossFeed(f,at,V647BossNPC(id,instance,0),"=","1","836045448945478","2")
}

V647BossKill(f,at,instance := 701,id := "4078445109706752")
{
    return V647BossFeed(f,at,"@Killer#2|(1000/1000)",V647BossNPC(id,instance,0),"1","836045448945472","836045448945493")
}

V647BossEnd(f,freeze := true)
{
    V647BossFeed(f,14000,V647BossNPC("4078423634870272",700),"=","4086837475803136","836045448945472","836045448945479")
    V647BossFeed(f,14500,V647BossNPC("4078423634870272",700),"@Victim#1|(0/1000)","4086837475803136","836045448945477","836045448945501","(1000)")
    if freeze
        IBCFreeze(f.Seg,f.Recap)
    return f
}

V647BossPositive()
{
    f := V647BossFixture()
    V647BossRage(f,5000,6),V647BossSweep(f,11000)
    V647BossRage(f,13090,9),V647BossZero(f,13100)
    return V647BossEnd(f)
}

V647BossRawAnnotations()
{
    f := V647BossFixture(),e := V647BossRage(f,5000,6)
    V48Assert(e.BossCharges=6,"numeric ModifyCharges is independent of labels")
    for id in ["836045448945502","836045448945503","836045448945504","836045448945505","836045448945507"] {
        e := V647BossSweep(f,5100,701,"4078445109706752","(0 avoidance {" id "})")
        V48Assert(e.BossAvoided,"every documented avoidance ID, including Dodge, is retained")
    }
    e := V647BossSweep(f,5200)
    V48Assert(!e.BossAvoided,"neutral zero is a usable contact rather than a fabricated miss")
    e := V647BossFeed(f,5300,V647BossNPC("4078423634870272",700),"=","1","836045448945478","4086833180836195")
    V48Assert(e.BossCharges=0,"explicit Rage effect removal records zero")
}

V647BossDelayedCleave()
{
    f := V647BossPositive(),check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Summary,"1 possible cleave") && InStr(check.Text,"2.100 s later"),"source-side zero after 2.1 seconds supports the observed delayed cleave")
    V48Assert(InStr(check.Text,"Shared observed Rage +3"),"one possible cleave consumes three total Rage, two extra over an ordinary kill")
    V48Assert(InStr(check.Text,"intentional Justice") && InStr(check.Text,"does not assign blame"),"possible cleaves remain observations, including intentional ones")
    for row in f.Recap.BossEvidence.Rows {
        if row.Kind="rage" && row.Charges=9
            row.Charges := 8
    }
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(!InStr(check.Text,"POSSIBLE Guardian") && InStr(check.Summary,"ambiguous"),"matching Sweep and zero with only observed +2 cannot establish a three-Rage cleave")
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000)
    V647BossFeed(f,11100,"@Killer#2|(1000/1000)",V647BossNPC(,701,990),"1","836045448945477","836045448945501","(10)")
    V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Summary,"1 possible cleave"),"small nonlethal player damage does not discard a possible cleave")
}

V647BossInstanceScope()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000)
    V647BossRage(f,13090,9),V647BossZero(f,13100,702),V647BossEnd(f)
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Summary,"0 possible cleaves"),"another add instance cannot provide the death evidence")
    f := V647BossPositive(),e := f.Recap.BossEvidence
    e.Rows[2].Boss := "N:4078423634870272:999:Tyth"
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Summary,"0 possible cleaves"),"another Tyth instance cannot supply Sweep contact")
}

V647BossOrdinaryKillCompetition()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000)
    V647BossRage(f,13090,8),V647BossZero(f,13100),V647BossKill(f,13101,702),V647BossKill(f,13102,703),V647BossEnd(f)
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(!InStr(check.Text,"POSSIBLE Guardian") && InStr(check.Text,"2 ordinary kill(s)"),"two different ordinary kills can explain all of a shared +2")
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000)
    V647BossRage(f,13090,10),V647BossZero(f,13100),V647BossKill(f,13101,702),V647BossEnd(f)
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Summary,"1 possible cleave"),"one ordinary kill plus one cleave can coexist in observed +4")
    for row in f.Recap.BossEvidence.Rows {
        if row.Kind="rage" && row.Charges=10
            row.Charges := 9
    }
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(!InStr(check.Text,"POSSIBLE Guardian") && InStr(check.Text,"1 ordinary kill(s)"),"observed +3 cannot cover both an evidenced ordinary kill and a three-Rage cleave")
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000)
    V647BossRage(f,13090,9),V647BossKill(f,13100),V647BossEnd(f)
    V48Assert(!InStr(IBCDebugCheck(f.Pull,f.Recap).Text,"POSSIBLE Guardian"),"explicit player kill of the same add disqualifies attribution")
    f := V647BossPositive()
    V647BossFeed(f,13110,"@Killer#2|(1000/1000)",V647BossNPC(,701,0),"1","836045448945477","836045448945501","(5)")
    IBCFreeze(f.Seg,f.Recap),check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(!InStr(check.Text,"POSSIBLE Guardian"),"zero-only evidence does not dismiss a potentially lethal later player hit")
    V647BossFeed(f,13101,V647BossNPC(,701,0),"=","1","836045448945472","836045448945493")
    IBCFreeze(f.Seg,f.Recap),check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Summary,"1 possible cleave") && !InStr(check.Text,"alongside 1 ordinary"),"damage strictly after explicit self-source Death neither invents another kill nor consumes the cleave's total +3")
    V647BossKill(f,13120),IBCFreeze(f.Seg,f.Recap)
    V48Assert(!InStr(IBCDebugCheck(f.Pull,f.Recap).Text,"POSSIBLE Guardian"),"explicit player Death remains competing after independent zero metadata")
    f := V647BossPositive()
    V647BossFeed(f,13110,V647BossNPC(,701,0),"=","1","836045448945472","836045448945493")
    V647BossFeed(f,13110,"@Killer#2|(1000/1000)",V647BossNPC(,701,0),"1","836045448945477","836045448945501","(5)")
    IBCFreeze(f.Seg,f.Recap)
    V48Assert(!InStr(IBCDebugCheck(f.Pull,f.Recap).Text,"POSSIBLE Guardian"),"equal-timestamp damage remains potentially part of the lethal Death batch")
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000),V647BossRage(f,13090,9)
    V647BossFeed(f,13100,"@Killer#2|(1000/1000)",V647BossNPC(,701,0),"1","836045448945477","836045448945501","(1000)")
    V647BossEnd(f)
    V48Assert(!InStr(IBCDebugCheck(f.Pull,f.Recap).Text,"POSSIBLE Guardian"),"first-zero lethal damage still provides a competing kill")
    V647BossRealDeathBatch()
}

V647BossRealDeathBatch()
{
    ; Anonymized Sep24 source lines47397–47532, selected same-add/Rage rows.
    ; This tests evidence classification, without inventing an Overload/death
    ; association for the player. Earlier positive damage totals67,261.
    raw := "
    (
    [20:31:46.014] [TYTH {4078423634870272}:3967000309456|(810.18,2366.20,228.52,-127.21)|(10592614/19989636)] [Grace {4078440814739456}:3967000380620|(821.73,2359.33,228.52,41.40)|(215122/340388)] [Sweep {4080279060742144}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -miss {836045448945502})
    [20:31:46.014] [TYTH {4078423634870272}:3967000309456|(810.18,2366.20,228.52,-127.21)|(10592614/19989636)] [Grace {4078440814739456}:3967000380620|(821.73,2359.33,228.52,41.40)|(215122/340388)] [Sweep {4080279060742144}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)
    [20:31:46.015] [TYTH {4078423634870272}:3967000309456|(810.18,2366.20,228.52,-127.21)|(10592614/19989636)] [Grace {4078440814739456}:3967000380620|(821.73,2359.33,228.52,41.40)|(215122/340388)] [Sweep {4080279060742144}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)
    [20:31:46.094] [@Player02#689906611574629|(823.41,2357.66,228.52,146.59)|(206654/443752)] [Grace {4078440814739456}:3967000380620|(821.73,2359.33,228.52,41.40)|(210199/340388)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4923 elemental {836045448940875}) <4923.0>
    [20:31:46.176] [@Player02#689906611574629|(823.41,2357.66,228.52,143.84)|(206654/443752)] [Grace {4078440814739456}:3967000380620|(821.73,2359.33,228.52,41.40)|(210199/340388)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10233* elemental {836045448940875}) <10233.0>
    [20:31:46.799] [@Player02#689906611574629|(821.12,2356.06,228.52,157.31)|(210015/443752)] [Grace {4078440814739456}:3967000380620|(821.73,2359.33,228.52,41.40)|(204024/340388)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6175 elemental {836045448940875}) <6175.0>
    [20:31:47.501] [@Player02#689906611574629|(820.30,2356.08,228.52,-168.76)|(240768/443752)] [Grace {4078440814739456}:3967000380620|(821.73,2359.33,228.52,41.40)|(158094/340388)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4923 elemental {836045448940875}) <4923.0>
    [20:31:47.502] [@Player02#689906611574629|(820.30,2356.08,228.52,-168.76)|(240768/443752)] [Grace {4078440814739456}:3967000380620|(821.73,2359.33,228.52,41.40)|(158094/340388)] [Rail Shot {814278554681344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (41007* energy {836045448940874}) <41007.0>
    [20:31:47.999] [TYTH {4078423634870272}:3967000309456|(812.24,2367.75,228.52,-154.47)|(10531615/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (2 charges {836045448953667})
    [20:31:48.104] [TYTH {4078423634870272}:3967000309456|(812.24,2367.75,228.52,-154.47)|(10531615/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (5 charges {836045448953667})
    [20:31:48.106] [Grace {4078440814739456}:3967000380620|(821.73,2359.33,228.52,41.40)|(0/340388)] [] [] [Event {836045448945472}: TargetCleared {836045448953669}]
    [20:31:48.111] [Grace {4078440814739456}:3967000380620|(821.73,2359.33,228.52,41.40)|(0/340388)] [=] [] [Event {836045448945472}: Death {836045448945493}]
    [20:31:48.236] [@Player05#686733391435307|(813.60,2355.60,228.52,-124.84)|(369186/443634)] [Grace {4078440814739456}:3967000380620|(821.73,2359.33,228.52,41.40)|(0/340388)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1911 energy {836045448940874}) <1911.0>
    [20:31:48.247] [@Player05#686733391435307|(813.60,2355.60,228.52,-124.02)|(369186/443634)] [Grace {4078440814739456}:3967000380620|(821.74,2359.33,228.52,41.40)|(0/340388)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (156* energy {836045448940874}) <156.0>
    )"
    f := V647BossFixture(),boss := "N:4078423634870272:3967000309456:TYTH"
    f.Seg.BossActors := Map(boss,"boss")
    Loop Parse raw,"`n","`r" {
        ev := IPParseLine(Trim(A_LoopField)),ev.RecordId := f.Next,f.Next += 1
        V48Assert(IsObject(ev) && ev.ValueOK,"anonymized Sep24 raw event parses")
        if f.Seg.Start=0
            f.Seg.Start := ev.RawMs-1000
        IBCObserve(f.Seg,ev,ev.RawMs)
    }
    rows := IBCOrdered(f.Seg.BossCheckState.Rows),gain := ""
    for r in rows {
        if r.Kind="rage" && r.Charges=5
            gain := r
    }
    candidates := IBCCleaveCandidates(rows,boss,f.Seg.Start,ev.RawMs)
    V48Assert(candidates.Length=1 && !candidates[1].Competing && candidates[1].Damage=67261,"real Grace prior damage remains nonlethal; confirmed post-Death hits do not suppress it")
    V48Assert(candidates[1].Zero-candidates[1].At=2092 && candidates[1].DeathAt>candidates[1].Zero,"real source-side zero and later explicit self Death retain their order")
    V48Assert(IBCOrdinaryKills(rows,boss,gain).Count=0,"real post-Death Rapid Shots cannot also be charged as an ordinary kill")
}

V647BossAvoidanceAndContact()
{
    f := V647BossFixture(),V647BossRage(f,5000,6)
    V647BossSweep(f,11000,701,"4078445109706752","(0 miss {836045448945502})")
    V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Text,"avoidance-only"),"a miss-only Sweep cannot become a possible cleave")
    f := V647BossFixture(),V647BossRage(f,5000,6)
    V647BossSweep(f,11000,701,"4078445109706752","(0 miss {836045448945502})"),V647BossSweep(f,11001)
    V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Summary,"1 possible cleave"),"mixed miss and neutral contact produce one candidate")
    f := V647BossFixture(),V647BossRage(f,5000,6)
    V647BossSweep(f,11000,701,"4078445109706752","(0 -)",-1),V647BossZero(f,11001),V647BossSweep(f,11002)
    V647BossRage(f,11003,9),V647BossEnd(f)
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(!InStr(check.Text,"POSSIBLE Guardian") && InStr(check.Text,"no subsequent zero"),"first usable contact replaces unknown HP and earlier timestamp; a preceding zero cannot attach to it")
}

V647BossChronology()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossZero(f,10999),V647BossSweep(f,11000)
    V647BossRage(f,11001,9),V647BossEnd(f)
    V48Assert(!InStr(IBCDebugCheck(f.Pull,f.Recap).Text,"POSSIBLE Guardian"),"zero before Sweep cannot be described as subsequent")
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossZero(f,11000),V647BossSweep(f,11000)
    V647BossRage(f,11001,9),V647BossEnd(f)
    V48Assert(!InStr(IBCDebugCheck(f.Pull,f.Recap).Text,"POSSIBLE Guardian"),"same-ms record order prevents backward causal linkage")
    f := V647BossFixture(),V647BossRage(f,5000,6)
    V647BossFeed(f,10990,"@Killer#2|(1000/1000)",V647BossNPC(,701,1000),"1","836045448945477","836045448945501","(1500)")
    V647BossSweep(f,11000),V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Summary,"1 possible cleave"),"damage before a fresh positive Sweep snapshot is not double-counted against it")
}

V647BossSharedGain()
{
    f := V647BossFixture(),V647BossRage(f,5000,9),V647BossSweep(f,11000)
    V647BossSweep(f,11001,702,"4078449404674048"),V647BossSweep(f,11002,703,"4078432224804864")
    V647BossRage(f,13090,18),V647BossZero(f,13100),V647BossZero(f,13101,702,"4078449404674048"),V647BossEnd(f)
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Summary,"2 possible cleaves") && InStr(check.Text,"Shared observed Rage +9"),"one +9 is reported as shared evidence for two candidates")
    V48Assert(!InStr(check.Text,"POSSIBLE Justice") && InStr(check.Text,"Justice Sweep context"),"contact without Justice death cannot invent a third cleave")
    for row in f.Recap.BossEvidence.Rows {
        if row.Kind="rage" && row.Charges=18
            row.Charges := 11
    }
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Summary,"ambiguous") && !InStr(check.Text,"POSSIBLE Guardian"),"+2 cannot be independently assigned to two candidates")
    for row in f.Recap.BossEvidence.Rows {
        if row.Kind="rage" && row.Charges=11
            row.Charges := 12
    }
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Summary,"ambiguous") && !InStr(check.Text,"POSSIBLE Guardian"),"one total +3 cannot independently explain two simultaneous possible cleaves")
}

V647BossGraceEvidence()
{
    f := V647BossFixture()
    e := V647BossFeed(f,10000,V647BossNPC("4078440814739456",701,0),"=","4071199499878400","836045448945472","836045448945482","(Restoration {4071199499878400})")
    V48Assert(!e.HasOwnProp("BossInterruptedId"),"Restoration interruption is not a Rage reduction interruption")
    e := V647BossFeed(f,11000,V647BossNPC("4078440814739456",701,0),"=","4088443793571840","836045448945472","836045448945482","(Grace {4088443793571840})")
    V48Assert(e.BossInterruptedId="4088443793571840","dead self-source Grace explicitly names DR interruption")
    V647BossEnd(f),check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"Explicit Aivela's Grace") && InStr(check.Text,"possible missed reduction"),"positive interruption evidence is explained without inventing subtraction")
    for row in f.Recap.BossEvidence.Rows {
        if row.Kind="dr-interrupt"
            row.Boss := "N:4078423634870272:999:Tyth"
    }
    V48Assert(!InStr(IBCDebugCheck(f.Pull,f.Recap).Text,"Explicit Aivela's Grace"),"DR context belongs to the selected Tyth instance")
}

V647BossLateEvidence()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000),V647BossRage(f,13090,9),V647BossEnd(f)
    id := IDTCaseKey(f.Recap),f.Seg.DeathCapture.Cases[id] := f.Recap,old := f.Recap.BossEvidence
    V647BossZero(f,13100)
    updated := f.Seg.DeathCapture.Cases[id]
    V48Assert(InStr(IBCDebugCheck(f.Pull,updated).Summary,"1 possible cleave"),"late NPC evidence updates a recent frozen player death")
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Summary,"0 possible cleaves") && old.Rows.Length<updated.BossEvidence.Rows.Length,"previously frozen evidence remains immutable")
}

V647BossRollback()
{
    f := V647BossPositive(),before := IGVJson(IBCPackEvidence(IBCBuildEvidence(f.Seg,f.Recap)))
    IPBBeginUndo(f.Data,f.Seg)
    V647BossRage(f,14900,19),V647BossKill(f,14910,702)
    V48Assert(before!=IGVJson(IBCPackEvidence(IBCBuildEvidence(f.Seg,f.Recap))),"speculative boss evidence actually changed")
    IPBRollbackTail(f.Data,f.Seg)
    V48Assert(before=IGVJson(IBCPackEvidence(IBCBuildEvidence(f.Seg,f.Recap))),"generic map journal restores rows, metadata and health exactly")
}

V647BossLimitsAndPartial()
{
    f := V647BossFixture(),f.Recap.At := 50000,f.Recap.Record := 100000
    Loop 4100
        V647BossRage(f,31000+A_Index,Mod(A_Index,20))
    IBCFreeze(f.Seg,f.Recap)
    V48Assert(f.Seg.BossCheckState.Rows.Count<=4096 && f.Recap.BossEvidence.Limited && f.Recap.BossEvidence.Partial,"hard row cap is visible as partial evidence")
    V647BossRage(f,90000,1)
    V48Assert(f.Seg.BossCheckState.Rows.Count=1 && f.Seg.BossCheckState.Anchors.Count=1,"old rolling evidence retires while retaining one observed Rage baseline")
    f := V647BossPositive(),f.Seg.Partial := true,IBCFreeze(f.Seg,f.Recap)
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Summary,"Partial"),"parser partial coverage propagates to the explanation")
}

V647BossIsolation()
{
    f := V647BossFixture(),f.Seg.BossKey := "OTHER",V647BossRage(f,5000,6)
    V48Assert(!f.Seg.HasOwnProp("BossCheckState"),"other encounters allocate no boss evidence state")
    f := V647BossPositive(),copy := IBCCloneEvidence(f.Recap.BossEvidence),copy.Rows[1].Charges := 999
    V48Assert(f.Recap.BossEvidence.Rows[1].Charges!=999,"public evidence clone never shares mutable rows")
    second := V647BossFixture(),V647BossEnd(second)
    V48Assert(!InStr(IBCDebugCheck(second.Pull,second.Recap).Text,"Rage 6"),"new pull cannot inherit a previous pull's Rage count")
}

V647BossSameLife()
{
    f := V647BossFixture(),V647BossEnd(f,false)
    V647BossFeed(f,14600,V647BossNPC("4078423634870272",700),"@Victim#1|(0/1000)","1","836045448945472","836045448945493")
    V647BossFeed(f,14700,"@Victim#1|(1000/1000)","=","1","836045448945472","836045448945479")
    IBCFreeze(f.Seg,f.Recap),check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Summary,"Earlier-life") && !InStr(check.Text,"Tyth - Rage before"),"a survived Overload from the prior life is not reused")
    V647BossFeed(f,14800,V647BossNPC("4078423634870272",700),"@Victim#1|(0/1000)","4086837475803136","836045448945477","836045448945501","(1000)")
    IBCFreeze(f.Seg,f.Recap),check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"0.200 s before") && InStr(check.Text,"does not establish sole cause"),"new-life hit is associated with its actual gap, not assumed sole cause")
}

V647BossProfileScope()
{
    f := V647BossPositive(),f.Pull.Mode := "different"
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Summary,"observed events only"),"unverified mode keeps observations without claiming a validated cleave rule")
    f.Pull.Mode := "836045448953655"
    for row in f.Recap.BossEvidence.Rows {
        row.Boss := StrReplace(row.Boss,"4078423634870272","4078419339902976")
        row.Source := StrReplace(row.Source,"4078423634870272","4078419339902976")
    }
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Summary,"profile unverified"),"alternate Tyth NPC variant is not silently treated as validated")
}

V647BossUnknownAndClipped()
{
    f := V647BossFixture(),V647BossSweep(f,11000),V647BossRage(f,13090,8),V647BossZero(f,13100),V647BossEnd(f)
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"prior count unknown") && !InStr(check.Text,"POSSIBLE Guardian"),"first count eight is not an inferred increase from zero")
    f.Recap.At := 31000,f.Pull.End := 31000,IBCFreeze(f.Seg,f.Recap)
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"lookback is clipped"),"the pull start limits the requested thirty-second precast history")
    f.Recap.DeleteProp("BossEvidence")
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Text,"Missing evidence is not a clean result"),"legacy absence cannot masquerade as success")
}

V647BossPayloadValidation()
{
    f := V647BossPositive(),packed := IBCPackEvidence(f.Recap.BossEvidence)
    copy := IBCUnpackEvidence(IGJParse(IGVJson(packed)),f.Pull,f.Recap)
    V48Assert(IGVJson(IBCPackEvidence(copy))=IGVJson(packed),"strict evidence payload roundtrips")
    bad := IPRCloneSnapshot(packed),bad[6][2][5] := "junk" bad[6][2][5]
    V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"add identity requires an anchored NPC key")
    bad := IPRCloneSnapshot(packed),bad[5] := 1,bad[4] := 0
    V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"retention-limited evidence cannot claim complete coverage")
    bad := IPRCloneSnapshot(packed),bad[6][1][1] := f.Recap.At+1
    V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"future evidence cannot enter a death case")
}

; v64.7 optional boss evidence persistence and native, hidden death-check UI.
; Groups: V647BossRecapRoundtrip, V647BossRecapValidation, V647BossRecapClone,
; V647BossRecapSidecar, V647BossCheckHiddenUI, V647BossCheckLegacyUI,
; V647BossEvidenceRetirement.

V647BossUIRow(at,record,kind,charges := -1)
{
    boss := "N:4078423634870272:64701:Tyth"
    return {At:at,Record:record,Kind:kind,Boss:boss,Actor:"",ActorId:"",ActorName:"",
        Source:boss,SourceName:"Tyth",HP:-1,Maximum:0,Amount:0,Charges:charges,Avoided:false,
        Ability:kind="rage" ? "4086833180836195" : "4086837475803136",Target:boss}
}

V647BossUIPull(evidence := true)
{
    p := IDTDemoData(),p.Boss := "G-TY",p.Name := "SYNTHETIC Tyth check"
    if evidence {
        r := p.DeathRecaps[IDTCaseKey(p.Deaths[1])]
        r.BossEvidence := {Version:1,Profile:"tyth-rage-v1",From:Max(p.Start,r.At-20000),
            Partial:false,Limited:false,Rows:[],Anchors:[]}
        r.BossEvidence.Rows.Push(V647BossUIRow(r.At-4000,r.Record-4,"rage",7),
            V647BossUIRow(r.At-1000,r.Record-3,"rage",10),
            V647BossUIRow(r.At-900,r.Record-2,"overload-cast"))
    }
    return p
}

V647BossRecapRoundtrip()
{
    p := V647BossUIPull(),packed := IDTPack(p.DeathRecaps)
    V48Assert(packed[1].Length=9 && packed[2].Length=8,"boss evidence is optional per recap, preserving legacy eight fields")
    for recap in packed {
        for row in recap[8]
            V48Assert(row.Length=14,"HP rows retain the existing fourteen-field format")
    }
    copy := IDTUnpack(IGJParse(IGVJson(packed)),p)
    V48Assert(IGVJson(IDTPack(copy))=IGVJson(packed),"new and legacy recap payloads roundtrip exactly together")
    old := packed.Clone(),old[1] := old[1].Clone(),old[1].Pop()
    oldCopy := IDTUnpack(old,p),legacy := oldCopy[IDTCaseKey(p.Deaths[1])]
    V48Assert(!legacy.HasOwnProp("BossEvidence") && legacy.Rows.Length>0,"legacy HP detail stays available without fabricated boss context")
    check := IDTBossCheckFor(p,legacy)
    V48Assert(check.Applicable && InStr(StrLower(check.Text),"re-add"),"old Tyth history explains how to recover missing boss evidence")
}

V647BossRecapValidation()
{
    p := V647BossUIPull(),packed := IDTPack(p.DeathRecaps),packed[1][9] := "invalid"
    V64Reject((*)=>IDTUnpack(packed,p),"a malformed ninth recap field is rejected")
    packed := IDTPack(p.DeathRecaps),packed[1][9][1] := 999
    V64Reject((*)=>IDTUnpack(packed,p),"unknown boss evidence versions are rejected")
    packed := IDTPack(p.DeathRecaps),packed[1].Push("extra")
    V64Reject((*)=>IDTUnpack(packed,p),"recaps cannot silently accept unrecognized trailing fields")
    p.DeathRecaps[IDTCaseKey(p.Deaths[1])].BossEvidence.Rows[1].At := p.End+1
    packed := IDTPack(p.DeathRecaps)
    V64Reject((*)=>IDTUnpack(packed,p),"boss evidence after the death cannot be smuggled into saved history")
}

V647BossRecapClone()
{
    p := V647BossUIPull(),c := IDTNewCapture(),c.Cases := p.DeathRecaps
    seg := {DeathCapture:c,Partial:false},copy := IDTCompact(seg,p.Deaths),id := IDTCaseKey(p.Deaths[1])
    before := IGVJson(IDTPack(p.DeathRecaps))
    copy[id].BossEvidence.Rows[1].Charges := 3
    copy[id].BossEvidence.Rows.Push(V647BossUIRow(copy[id].At,copy[id].Record,"rage",1))
    copy[id].BossEvidence.Anchors.Push(V647BossUIRow(copy[id].BossEvidence.From-1,1,"rage",0))
    copy[id].Rows[1].HP := 1
    V48Assert(IGVJson(IDTPack(p.DeathRecaps))=before,"compact copies isolate HP rows, boss rows and anchor arrays")
    V48Assert(copy[id].BossEvidence.Rows.Length=4 && c.Cases[id].BossEvidence.Rows.Length=3,"snapshot growth cannot modify an already published case")
}

V647BossRecapSidecar()
{
    root := A_Temp "\Iris_v647_boss_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount
    DirCreate(root),path := root "\history.json"
    try {
        p := V647BossUIPull(),h := Map("synthetic",{Key:"synthetic",Session:"synthetic",Date:"20260930",Team:"Synthetic",Pull:p})
        IGVWriteHistory(h,path),loaded := IGVReadHistory(path),q := loaded["synthetic"].Pull
        V48Assert(q.HasOwnProp("DeathRecapRef") && q.DeathRecaps.Count=0,"boss context uses existing lazy detail sidecars")
        recap := IDTCase(q,q.Deaths[1])
        V48Assert(IsObject(recap) && recap.HasOwnProp("BossEvidence"),"opening a saved death hydrates its boss evidence")
        V48Assert(IGVJson(IDTPack(q.DeathRecaps))=IGVJson(IDTPack(p.DeathRecaps)),"schema-three sidecar retains exact boss and HP payloads")
        V48Assert(InStr(FileRead(path,"UTF-8"),"[3,")=1,"optional boss context does not change history schema")
    }
    finally DirDelete(root,true)
}

V647BossEvidenceRetirement()
{
    p := V647BossUIPull(),id := IDTCaseKey(p.Deaths[1]),r := p.DeathRecaps[id]
    seg := {Start:p.Start,Partial:false,BossKey:"G-TY",DeathCapture:IDTNewCapture()}
    state := IBCState(seg)
    for row in r.BossEvidence.Rows
        state.Rows[IBCRowKey(row)] := row.Clone()
    frozen := r.Clone(),frozen.DeleteProp("BossEvidence"),IBCFreeze(seg,frozen)
    seg.DeathCapture.Cases[id] := frozen
    state.Health["synthetic-add"] := {At:r.At,HP:0}
    before := IGVJson(IDTPack(seg.DeathCapture.Cases)),copy := IDTCompact(seg,p.Deaths)
    V48Assert(state.Rows.Count=3 && state.Recent.Count=1 && state.Health.Count=1,"active boss journal contains rolling rows, late-death index and health evidence")
    IDTRetireRolling(seg)
    V48Assert(!seg.HasOwnProp("BossCheckState"),"closed segments release the entire rolling boss journal")
    V48Assert(IGVJson(IDTPack(seg.DeathCapture.Cases))=before && IGVJson(IDTPack(copy))=before,"retirement preserves exact frozen and independently compacted death evidence")
    V48Assert(IDTBossCheckFor(p,frozen).Applicable && InStr(IDTBossCheckFor(p,frozen).Text,"Rage"),"retired evidence remains usable by the boss check")
    IDTRetireRolling(seg)
    V48Assert(!seg.HasOwnProp("BossCheckState") && seg.DeathCapture.Cases.Count=1,"repeated retirement is idempotent and keeps frozen cases")
    noDeath := {Start:p.Start},unused := IBCState(noDeath)
    unused.Rows["synthetic"] := V647BossUIRow(p.Start,1,"rage",0)
    IDTRetireRolling(noDeath)
    V48Assert(!noDeath.HasOwnProp("BossCheckState"),"a closed segment with no player death capture also releases boss state")
}

V647BossCheckHiddenUI()
{
    V61Hidden(V647BossCheckHiddenCase)
}

V647BossCheckHiddenCase()
{
    global IP
    try {
        p := V647BossUIPull(),IDTOpen(p),d := IDTState(),c := IPWState().Controls
        check := IDTBossCheckFor(p,d.Recap)
        V48Assert(c["DeathBoss"].Enabled && c["DeathBossSummary"].Value=check.Summary,"selected Tyth death exposes its boss summary and action")
        V48Assert(IDTBossOpen() && IPMUiHandle(d.BossPopup),"boss check creates a native owned popup")
        popup := d.BossPopup.Hwnd
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",popup,"Int") && !DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"native UI fixtures remain hidden")
        details := d.BossPopupControls["Details"]
        V48Assert(details.Value=check.Text && InStr(IDTText(p,p.Deaths[1]),check.Text),"popup and copied death details contain the same complete boss check")
        V48Assert(DllCall("User32\GetWindowLongW","Ptr",details.Hwnd,"Int",-16,"UInt") & 0x800,"boss check text is read-only")
        for size in [[980,650],[1220,780],[1920,1080]] {
            l := IPWLayout(size[1],size[2]),r := IDTGeometry(l),IDTLayout(l)
            c["DeathBoss"].GetPos(&bx,&by,&bw,&bh)
            c["DeathBossSummary"].GetPos(&sx,&sy,&sw,&sh)
            c["DeathList"].GetPos(&lx,&ly,&lw,&lh)
            V48Assert(bx+bw<=r.X+r.W && by+bh<=sy && sy+sh<=ly,"boss action and summary fit without overlapping death list")
            V48Assert(r.EventsY+r.EventsH<=r.NoteY && r.EventsH>=60,"native boss summary preserves minimum event table and footer bounds")
        }
        IDTBossResize(d.BossPopup,0,620,360),details.GetPos(&x,&y,&w,&h)
        d.BossPopupControls["Close"].GetPos(&cx,&cy,&cw,&ch)
        V48Assert(x+w<=620 && y+h<=cy && cy+ch<=360,"minimum popup layout keeps the complete scrollable report above Close")
        d.Selected := 2,IDTRenderSelected()
        V48Assert(InStr(StrLower(d.BossPopupControls["Details"].Value),"re-add"),"selecting another death replaces the popup report instead of showing stale evidence")
        IDTOpen(IDTDemoData())
        V48Assert(!c["DeathBoss"].Enabled && !DllCall("User32\IsWindow","Ptr",popup,"Int"),"switching to unsupported encounter disables check and retires popup")
    }
    finally IDTShutdown()
}

V647BossCheckLegacyUI()
{
    V61Hidden(V647BossCheckLegacyCase)
}

V647BossCheckLegacyCase()
{
    try {
        p := V647BossUIPull(false),p.DeathRecaps := Map(),IDTOpen(p),d := IDTState(),c := IPWState().Controls
        V48Assert(c["DeathBoss"].Enabled && IDTBossOpen(),"old Tyth deaths still offer an explanation when all detail is missing")
        V48Assert(InStr(StrLower(d.BossPopupControls["Details"].Value),"re-add") && c["DeathEvents"].GetCount()=0,"missing context stays explicit and never borrows another death's rows")
        V48Assert(InStr(StrLower(IDTText(p,p.Deaths[1])),"re-add"),"copy includes recovery guidance for legacy Tyth records")
        IDTShutdown()
        V48Assert(!IPMUiHandle(d.BossPopup),"death UI shutdown destroys its modeless boss check")
    }
    finally IDTShutdown()
}

; Live detection only: no audio worker, HTTP, game input or personal settings.
; Requests are inspected in the actual queue; no playback is started.
; Groups: V647LiveCleaveAfterDeathDamage, V647LiveCleaveDamageAmbiguity,
; V647LiveCleaveDeathVictim, V647LiveCleavePendingSurvivor,
; V647LiveCleavePendingBoundAndMute, V647LiveCleaveRealDeathCleanup.

V647LiveNPC(id,instance,hp := 1000,maximum := 1000)
{
    return "NPC {" id "}:" instance "|(0,0,0,0)|(" hp "/" maximum ")"
}

V647LiveSetup(addId := "4078445109706752",instance := "101",hp := 1000,maximum := 1000)
{
    global tythLastHpPct,tythEnded,tythCalloutsEnabled,TythExtraAlerts,activeBoss,TythRecordOrder
    V48Setup(),ResetTythState("100","synthetic live-cleave test")
    tythLastHpPct := 0.9,tythEnded := false,tythCalloutsEnabled := true,activeBoss := "GFTM - Tyth"
    TythRecordOrder := {At:-1,Seen:Map()}
    for _,definition in TythExtraAlerts
        definition.Enabled := true
    return {Boss:V647LiveNPC("4078423634870272","100",900,1000),
        Add:V647LiveNPC(addId,instance,hp,maximum),Zero:V647LiveNPC(addId,instance,0,maximum),
        Player:"@Synthetic#1|(0,0,0,0)|(100/100)",Instance:instance,Id:addId}
}

V647LiveEvent(at,source,target,ability,action,emit := true)
{
    global testClock
    stamp := Format("{:02d}:{:02d}:{:02d}.{:03d}",Floor(at/3600000),Mod(Floor(at/60000),60),Mod(Floor(at/1000),60),Mod(at,1000))
    line := "[" stamp "] [" source "] [" target "] [" ability "] " action
    testClock := 100000+at
    TrackTythCleave(line,emit)
}

V647LiveRage(f,at,count)
{
    V647LiveEvent(at,f.Boss,"=","Rage {4086833180836195}",
        "[ModifyCharges {836045448953666}: Rage {4086833180836195}] (" count " charges {836045448953667})")
}

V647LiveSweep(f,at,target := "")
{
    V647LiveEvent(at,f.Boss,target!="" ? target : f.Add,"Sweep {4080279060742144}",
        "[ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)")
}

V647LiveZero(f,at)
{
    V647LiveEvent(at,f.Zero,"","","[Event {836045448945472}: TargetCleared {836045448953669}]")
}

V647LiveDeath(f,at,source := "",target := "=")
{
    V647LiveEvent(at,source!="" ? source : f.Zero,target,"","[Event {836045448945472}: Death {836045448945493}]")
}

V647LiveDamage(f,at,amount := 5,target := "")
{
    V647LiveEvent(at,f.Player,target!="" ? target : f.Zero,"Small tick {814282849648640}",
        "[ApplyEffect {836045448945477}: Damage {836045448945501}] (" amount ")")
}

V647LiveHeartbeat(f,at)
{
    V647LiveEvent(at,f.Player,"=","Heartbeat {1}","[Event {2}: Event {3}]")
}

V647LiveCount(key)
{
    global Audio
    count := 0
    for item in Audio.Queue {
        if item.Key=key
            count += 1
    }
    return count
}

V647LiveCleaveAfterDeathDamage()
{
    global TythCleave
    f := V647LiveSetup(),V647LiveRage(f,0,6),V647LiveSweep(f,100)
    V647LiveZero(f,400),V647LiveDeath(f,410),V647LiveRage(f,420,8)
    V647LiveDamage(f,430,5)
    c := TythCleave.Candidates[f.Instance]
    V48Assert(c.ZeroAt=400 && c.DeathAt=410 && !c.Explained && c.Damage=0,"strictly later damage cannot explain an independently recorded prior add death")
    V647LiveHeartbeat(f,1000)
    V48Assert(V647LiveCount("CleaveGuardian")=1,"post-death damage preserves exactly one possible-cleave request")
    V647LiveDamage(f,1100,10),V647LiveHeartbeat(f,4000)
    V48Assert(V647LiveCount("CleaveGuardian")=1,"later corpse records do not duplicate an already classified add")
}

V647LiveCleaveDamageAmbiguity()
{
    for scenario in ["zero-only","same-time-death","first-zero-hit","external-death","alive-after-zero"] {
        f := V647LiveSetup(),V647LiveRage(f,0,6),V647LiveSweep(f,100)
        if scenario="first-zero-hit"
            V647LiveDamage(f,400)
        else
            V647LiveZero(f,400)
        if scenario="external-death"
            V647LiveDeath(f,410,f.Player,f.Zero)
        else if scenario="alive-after-zero" {
            V647LiveDeath(f,410)
            V647LiveEvent(420,f.Add,"=","Metadata {1}","[Event {2}: Event {3}]")
        }
        V647LiveRage(f,420,8)
        if scenario="same-time-death"
            V647LiveDeath(f,430)
        V647LiveDamage(f,430),V647LiveHeartbeat(f,1000)
        V48Assert(V647LiveCount("CleaveGuardian")=0,"uncertainty remains conservative: " scenario)
    }
}

V647LiveCleaveDeathVictim()
{
    global TythCleave
    f := V647LiveSetup(),V647LiveRage(f,0,6),V647LiveSweep(f,100),V647LiveZero(f,400)
    V647LiveDeath(f,410,f.Zero,f.Player)
    V48Assert(TythCleave.Candidates[f.Instance].DeathAt=-1,"a zero-HP add sourcing a player's Death is not itself the death victim")
    V647LiveRage(f,420,8),V647LiveDamage(f,430),V647LiveHeartbeat(f,1000)
    V48Assert(V647LiveCount("CleaveGuardian")=0,"another victim's death cannot exempt a later competing hit")
}

V647LivePendingSetup()
{
    f := V647LiveSetup(),V647LiveRage(f,0,6),V647LiveSweep(f,100)
    V647LiveSweep(f,200,V647LiveNPC("4078432224804864","102"))
    V647LiveZero(f,400),V647LiveRage(f,410,8),V647LiveHeartbeat(f,1000)
    return f
}

V647LiveCleavePendingSurvivor()
{
    global TythCleave
    f := V647LivePendingSetup(),V647LiveHeartbeat(f,3101)
    V48Assert(TythCleave.Candidates.Has(f.Instance) && !TythCleave.Seen.Has(f.Instance),"a settled zero candidate survives while a later-starting candidate holds its eligible gain open")
    V48Assert(V647LiveCount("CleaveGuardian")=0,"group is not classified before the surviving candidate's observation window ends")
    V647LiveHeartbeat(f,3201)
    V48Assert(V647LiveCount("CleaveGuardian")=1 && V647LiveCount("CleaveJustice")=0,"the settled add is reported once and the surviving add is not accused")
    V647LiveHeartbeat(f,10000)
    V48Assert(TythCleave.Candidates.Count=0 && TythCleave.Gains.Length=0,"completed group and consumed gain are retired")
}

V647LiveCleavePendingBoundAndMute()
{
    global TythCleave,soundboardsEnabled
    f := V647LivePendingSetup(),c := TythCleave.Candidates[f.Instance]
    V48Assert(TythCleaveHasPendingGain(c,3101) && !TythCleaveHasPendingGain(c,3661),"retention has a hard gain-relative observation deadline")
    TythCleave.Gains[1].Used := true
    V48Assert(!TythCleaveHasPendingGain(c,3101),"an already consumed gain cannot keep old candidates alive")
    V647LiveHeartbeat(f,3101)
    V48Assert(!TythCleave.Candidates.Has(f.Instance),"no eligible pending gain means normal expiry")
    f := V647LivePendingSetup(),soundboardsEnabled := false,V647LiveHeartbeat(f,3101)
    soundboardsEnabled := true,V647LiveHeartbeat(f,3201)
    V48Assert(V647LiveCount("CleaveGuardian")=0 && TythCleave.Seen.Has(f.Instance),"mute during bounded retention consumes the opportunity instead of replaying it after re-enable")
    for contradiction in ["alive","external-death"] {
        f := V647LivePendingSetup(),V647LiveHeartbeat(f,3101)
        if contradiction="alive"
            V647LiveEvent(3150,f.Add,"=","Metadata {1}","[Event {2}: Event {3}]")
        else
            V647LiveDeath(f,3150,f.Player,f.Zero)
        V647LiveHeartbeat(f,3201)
        V48Assert(V647LiveCount("CleaveGuardian")=0,"bounded retention keeps processing competing evidence: " contradiction)
    }
    f := V647LiveSetup(),V647LiveRage(f,0,6),V647LiveSweep(f,100)
    V647LiveRage(f,2500,8),V647LiveZero(f,2700),V647LiveHeartbeat(f,6000)
    V48Assert(V647LiveCount("CleaveGuardian")=0,"retention does not extend the original2500ms first-zero eligibility")
}

V647LiveCleaveRealDeathCleanup()
{
    ; Reduced Sep24 Grace sequence. Relative times, IDs, HP and damage values
    ; match the raw window; actor labels/positions are synthetic. Full original
    ; window was independently replayed, including unrelated interleaved rows.
    f := V647LiveSetup("4078440814739456","3967000380620",215122,340388)
    V647LiveSweep(f,0)
    for hit in [[80,4923,210199],[162,10233,210199],[785,6175,204024],[1487,4923,158094],[1488,41007,158094]]
        V647LiveDamage(f,hit[1],hit[2],V647LiveNPC(f.Id,f.Instance,hit[3],340388))
    V647LiveRage(f,1985,2),V647LiveRage(f,2090,5)
    V647LiveZero(f,2092),V647LiveDeath(f,2097)
    for hit in [[2222,1911],[2233,156],[2255,1910],[2370,141],[2396,1884],[2517,1756],[2554,171],[2555,1884]]
        V647LiveDamage(f,hit[1],hit[2])
    V647LiveHeartbeat(f,2830)
    V48Assert(V647LiveCount("CleaveGrace")=1,"real Sep24 post-Death Rapid Shots no longer suppress the probable Grace cleave")
    f := V647LiveSetup("4078432224804864"),V647LiveSweep(f,100),V647LiveZero(f,400),V647LiveRage(f,410,1)
    V647LiveHeartbeat(f,3200)
    V48Assert(V647LiveCount("CleaveJustice")=0,"an unknown initial Rage baseline remains unknown rather than becoming an invented +2")
}

; Short user history and corrected mechanic accounting. Synthetic unless noted.
V648RageHistoryPlainText()
{
    f := V647BossPositive(),check := IBCCheck(f.Pull,f.Recap),debug := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"6 " Chr(0x2192) " 9 (+3, possible cleave)"),"one cleave contributes three total, not two")
    V48Assert(InStr(check.Summary,"1 possible cleave") && StrLen(check.Summary)<90,"short selection summary preserves possible status")
    V48Assert(StrLen(check.Text)<600 && !InStr(check.Text,"retained") && !InStr(check.Text,"attribution") && !InStr(check.Text,"Interpretation"),"user history omits technical reasoning")
    V48Assert(check.DebugText=debug.Text && InStr(check.DebugText,"2.100 s later"),"exact technical reasoning remains separately available")
}

V648RageHistoryChanges()
{
    f := V647BossFixture(),V647BossRage(f,5000,9),V647BossRage(f,6000,8),V647BossRage(f,7000,5)
    V647BossRage(f,8000,5),V647BossRage(f,10000,8),V647BossEnd(f)
    check := IBCCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"9 " Chr(0x2192) " 8 (" Chr(0x2212) "1, cause unclear)") && InStr(check.Text,"8 " Chr(0x2192) " 5 (" Chr(0x2212) "3, cause unclear)"),"observed reductions without completion markers keep uncertain causes")
    V48Assert(InStr(check.Text,Chr(0x2212) "1") && !InStr(check.Text,"(+0)"),"minus-one change stays inline while unchanged refreshes are omitted")
    V48Assert(!InStr(check.Text,"should") && !InStr(check.Text,"interrupt") && !InStr(check.Text,"Interpretation"),"no strategy reminder or technical explanation")
    V48Assert(!InStr(check.Text,"several events") && !InStr(check.Text,"cleave"),"a plus-three total alone does not prove one cleave or multiple events")
}

V648RageHistoryCombined()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000),V647BossRage(f,13090,10)
    V647BossZero(f,13100),V647BossKill(f,13101,702),V647BossEnd(f)
    check := IBCCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"6 " Chr(0x2192) " 10 (+4, possible cleave; add kill)"),"one possible cleave plus one ordinary kill explains four total")
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossRage(f,13090,8)
    V647BossKill(f,13100,701),V647BossKill(f,13101,702),V647BossEnd(f)
    check := IBCCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"(+2, 2 add kills)") && !InStr(check.Text,"cleave"),"two ordinary kills are not shown as a cleave")
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000),V647BossRage(f,13090,8)
    V647BossZero(f,13100),V647BossEnd(f),check := IBCCheck(f.Pull,f.Recap)
    V48Assert(!InStr(check.Text,"possible cleave") && InStr(check.Text,"cause unclear"),"net plus-two with no recorded offset stays unresolved")
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossRage(f,13000,7),V647BossRage(f,13100,8)
    V647BossKill(f,13050,701),V647BossEnd(f),check := IBCCheck(f.Pull,f.Recap)
    V48Assert(!InStr(check.Text,"(+1, add kill)"),"one death overlapping two count updates cannot be presented as two definite distinct kills")
}

V648RageHistoryUnknown()
{
    f := V647BossFixture(),V647BossRage(f,5000,8),V647BossEnd(f),check := IBCCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"Rage 8 (first recorded count)") && !InStr(check.Text,"(+8)"),"unknown baseline is not displayed as an increase from zero")
    f.Recap.Partial := true,check := IBCCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"Some of this history is missing."),"missing evidence has one plain explanation")
    f.Recap.DeleteProp("BossEvidence"),check := IBCCheck(f.Pull,f.Recap)
    V48Assert(check.Text="Re-add the original log to see Rage history." && StrLen(check.DebugText)>StrLen(check.Text),"old saved history has concise recovery guidance and separate debugging")
    f := V647BossFixture(),V647BossRage(f,5000,8),V647BossRage(f,14500,7)
    V647BossFeed(f,14500,V647BossNPC("4078423634870272",700),"@Victim#1|(0/1000)","4086837475803136","836045448945477","836045448945501","(1000)")
    V647BossRage(f,14500,0),IBCFreeze(f.Seg,f.Recap),check := IBCCheck(f.Pull,f.Recap)
    V48Assert(check.Summary="Rage 8 " Chr(0x2192) " 7 before Overload.","missing cast uses hit record order: same-time pre-hit change retained, post-hit reset excluded")
    V48Assert(!InStr(check.Text,"7 " Chr(0x2192) " 0") && !InStr(check.DebugText,"Rage 0"),"neither short history nor debug moves a post-hit reset before Overload")
    f.Recap.BossEvidence := IBCUnpackEvidence(IBCPackEvidence(f.Recap.BossEvidence),f.Pull,f.Recap)
    V48Assert(IsObject(f.Recap.BossEvidence) && IBCCheck(f.Pull,f.Recap).Text=check.Text,"hit-only ordering survives saved evidence roundtrip")
}

V648RageHistoryGrace()
{
    f := V647BossFixture()
    V647BossFeed(f,11000,V647BossNPC("4078440814739456",701,0),"=","4088443793571840","836045448945472","836045448945482","(Grace {4088443793571840})")
    V647BossEnd(f),check := IBCCheck(f.Pull,f.Recap)
    V48Assert(!InStr(check.Text,"interrupted") && !InStr(check.Text,"Add / Grace") && !InStr(check.Text,"-3"),"separate add/Grace context is removed from the normal history without inventing a reduction")
    V48Assert(InStr(check.DebugText,"Explicit Aivela's Grace"),"identified ability stays in debug detail")
    for scenario in ["heal","decay","dr","clipped-dr","overlap","refresh-only"] {
        f := V647BossFixture(),before := scenario="clipped-dr" ? 1 : 8
        after := before-(scenario="dr" ? 3 : 1)
        V647BossRage(f,5000,before),V647BossRage(f,10000,after)
        boss := V647BossNPC("4078423634870272",700)
        if scenario="heal" || scenario="overlap"
            V647BossFeed(f,10002,V647BossNPC("4078440814739456",701),boss,"4071199499878400","836045448945477","836045448945500","(100)")
        if scenario="decay" || scenario="overlap" || scenario="refresh-only"
            V647BossFeed(f,10003,boss,"=","4086833180835840","836045448945477",scenario="refresh-only" ? "4086833180836213" : "4086833180836217")
        if scenario="dr" || scenario="clipped-dr"
            V647BossFeed(f,10002,boss,"=","4088443793571840","836045448945477","4088443793572128")
        V647BossEnd(f),check := IBCCheck(f.Pull,f.Recap)
        expected := scenario="heal" ? "Grace heal" : (scenario="decay" ? "natural decay" : ((scenario="dr" || scenario="clipped-dr") ? "Grace DR" : "cause unclear"))
        V48Assert(InStr(check.Text,Chr(0x2212) (before-after) ", " expected ")"),"completed reduction markers label the observed count, including DR stopping at zero: " scenario)
    }
    f := V647BossFixture(),V647BossRage(f,5000,8),V647BossRage(f,13999,7),V647BossEnd(f)
    V647BossFeed(f,14000,V647BossNPC("4078440814739456",701),V647BossNPC("4078423634870272",700),"4071199499878400","836045448945477","836045448945500","(100)")
    IBCFreeze(f.Seg,f.Recap),check := IBCCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,Chr(0x2212) "1, cause unclear)"),"a completion after Overload in same-millisecond record order cannot explain the lead-up")
    f := V649BossWindowFixture(),V647BossRage(f,19800,8),V647BossRage(f,19990,7),V647BossRage(f,20050,6)
    V647BossFeed(f,20030,V647BossNPC("4078440814739456",701),V647BossNPC("4078423634870272",700),"4071199499878400","836045448945477","836045448945500","(100)")
    V649BossWindowEnd(f,50000,50500,69000),check := IBCCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,Chr(0x2212) "1, cause unclear)"),"a nearby reduction outside the thirty-second display still prevents reusing its completion marker")
}

; Compact boss history / explicitly opened technical view. Native windows stay
; hidden. Copy payloads are verified without replacing the user's clipboard.
; Groups: V648BossHistoryDefaultUI, V648BossHistoryDebugUI,
; V648BossHistoryDebugLifecycle.

V648BossUIText(text)
{
    return StrReplace(text,"`r","") ; native multiline Edit.Value normalizes CRLF
}

V648BossHistoryPull()
{
    p := V647BossUIPull(),p.Area := "833571547775765",p.Mode := "836045448953655"
    first := p.DeathRecaps[IDTCaseKey(p.Deaths[1])],second := p.DeathRecaps[IDTCaseKey(p.Deaths[2])]
    hit := V647BossUIRow(first.At-500,first.Record-1,"overload-hit")
    hit.Target := first.Key,hit.Amount := 1000,first.BossEvidence.Rows.Push(hit)
    second.BossEvidence := IBCCloneEvidence(first.BossEvidence)
    second.BossEvidence.From := Max(p.Start,second.At-20000)
    for row in second.BossEvidence.Rows {
        row.At += second.At-first.At,row.Record += second.Record-first.Record
        if row.Kind="rage"
            row.Charges -= 3
        if row.Target=first.Key
            row.Target := second.Key
    }
    return p
}

V648BossHistoryDefaultUI()
{
    V61Hidden(V648BossHistoryDefaultCase)
}

V648BossHistoryDefaultCase()
{
    try {
        p := V648BossHistoryPull(),IDTOpen(p),d := IDTState()
        V48Assert(IDTBossOpen() && !IPMUiHandle(d.BossDebug),"opening the normal boss report never opens technical debug automatically")
        check := d.BossCheck,normal := IDTText(p,p.Deaths[1])
        V48Assert(check.HasOwnProp("DebugText") && check.DebugText!="" && check.DebugText!=check.Text,"compact and technical reports have independent payloads")
        V48Assert(d.BossPopupControls["Details"].Value=V648BossUIText(check.Text) && InStr(normal,check.Text),"main display and normal copied death details contain the compact history")
        V48Assert(!InStr(d.BossPopupControls["Details"].Value,V648BossUIText(check.DebugText)) && !InStr(normal,check.DebugText),"the full technical report is absent from the main view and normal copy payload")
        V48Assert(d.BossPopupControls["Debug"].Enabled,"technical detail is available through an explicit Debug action")
        IDTBossResize(d.BossPopup,0,620,360)
        d.BossPopupControls["Debug"].GetPos(&x,&y,&w,&h)
        d.BossPopupControls["Close"].GetPos(&cx,&cy,&cw,&ch)
        d.BossPopupControls["Details"].GetPos(&tx,&ty,&tw,&th)
        V48Assert(x+w<=cx && ty+th<=y && y+h<=360 && cy+ch<=360,"Debug and Close fit below the compact report at minimum size")
    }
    finally IDTShutdown()
}

V648BossHistoryDebugUI()
{
    V61Hidden(V648BossHistoryDebugCase)
}

V648BossHistoryDebugCase()
{
    try {
        p := V648BossHistoryPull(),IDTOpen(p),IDTBossOpen(),d := IDTState(),main := d.BossPopupControls["Details"].Value
        V48Assert(IDTBossDebugOpen() && IPMUiHandle(d.BossDebug),"explicit Debug action creates its own native window")
        debug := d.BossDebug.Hwnd,details := d.BossDebugControls["Details"]
        V48Assert(DllCall("User32\GetWindow","Ptr",debug,"UInt",4,"Ptr")=d.BossPopup.Hwnd,"technical window is owned by the compact report")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",debug,"Int"),"technical view remains hidden during isolated tests")
        V48Assert(DllCall("User32\GetWindowLongW","Ptr",details.Hwnd,"Int",-16,"UInt") & 0x800,"technical text is read-only")
        V48Assert(details.Value=V648BossUIText(d.BossCheck.DebugText) && IDTBossDebugText()=d.BossCheck.DebugText,"debug display and explicit debug-copy payload contain technical evidence")
        V48Assert(d.BossDebugControls["Copy"].Text="Copy debug" && d.BossPopupControls["Details"].Value=main,"debug has its own copy action and does not replace the compact report")
        V48Assert(IDTBossDebugOpen() && d.BossDebug.Hwnd=debug,"reopening Debug reuses the existing window")
        area := Buffer(40,0),NumPut("UInt",40,area)
        monitor := DllCall("User32\MonitorFromWindow","Ptr",d.BossPopup.Hwnd,"UInt",2,"Ptr")
        DllCall("User32\GetMonitorInfoW","Ptr",monitor,"Ptr",area,"Int")
        d.BossDebug.GetPos(&screenX,&screenY,&screenW,&screenH)
        V48Assert(screenX>=NumGet(area,20,"Int") && screenY>=NumGet(area,24,"Int")
            && screenX+screenW<=NumGet(area,28,"Int") && screenY+screenH<=NumGet(area,32,"Int"),"the actual native debug frame stays in the owner monitor's work area")
        for size in [[520,300],[620,480],[1000,800]] {
            IDTBossDebugResize(d.BossDebug,0,size[1],size[2])
            details.GetPos(&x,&y,&w,&h),d.BossDebugControls["Copy"].GetPos(&bx,&by,&bw,&bh)
            d.BossDebugControls["Close"].GetPos(&cx,&cy,&cw,&ch)
            V48Assert(x+w<=size[1] && y+h<=by && bx+bw<=cx && by+bh<=size[2] && cy+ch<=size[2],"technical view keeps scrollable text and both buttons inside its resized bounds")
        }
        right := IDTBossDebugPlacement(100,50,400,300,300,0,0,1200,800)
        left := IDTBossDebugPlacement(800,50,400,300,300,0,0,1200,800)
        narrow := IDTBossDebugPlacement(300,700,500,620,400,0,0,1000,900)
        negative := IDTBossDebugPlacement(-1100,50,500,620,400,-1280,0,0,900)
        V48Assert(right.X=512 && left.X=488,"debug is placed alongside the owner when either side has room")
        V48Assert(narrow.X>=0 && narrow.X+620<=1000 && narrow.Y+400<=900
            && negative.X>=-1280 && negative.X+620<=0,"fallback positioning stays on the owner's work area, including negative monitor coordinates")
        IDTBossDebugClose()
        V48Assert(!DllCall("User32\IsWindow","Ptr",debug,"Int") && IPMUiHandle(d.BossPopup),"closing debug leaves the compact report open")
    }
    finally IDTShutdown()
}

V648BossHistoryDebugLifecycle()
{
    V61Hidden(V648BossHistoryDebugLifecycleCase)
}

V648BossHistoryDebugLifecycleCase()
{
    try {
        p := V648BossHistoryPull(),IDTOpen(p),IDTBossOpen(),IDTBossDebugOpen(),d := IDTState()
        previous := d.BossDebugControls["Details"].Value,debug := d.BossDebug.Hwnd
        d.Selected := 2,IDTRenderSelected()
        V48Assert(d.BossDebug.Hwnd=debug && d.BossDebugControls["Details"].Value=V648BossUIText(d.BossCheck.DebugText)
            && d.BossDebugControls["Details"].Value!=previous,"an open debug view follows the selected death without keeping the prior report")
        V48Assert(d.BossPopupControls["Details"].Value=V648BossUIText(d.BossCheck.Text)
            && d.BossDebugControls["Title"].Text=d.BossPopupControls["Title"].Text,"both views identify and display the same selected death")
        popup := d.BossPopup.Hwnd,IDTBossClose(),IDTBossClose()
        V48Assert(!DllCall("User32\IsWindow","Ptr",debug,"Int") && !DllCall("User32\IsWindow","Ptr",popup,"Int"),"closing the main report destroys debug too and remains idempotent")
        V48Assert(!IDTBossDebugOpen(),"debug cannot reopen without its owning compact report")
        IDTBossOpen(),IDTBossDebugOpen(),debug := d.BossDebug.Hwnd
        IDTOpen(IDTDemoData())
        V48Assert(!DllCall("User32\IsWindow","Ptr",debug,"Int") && !IPMUiHandle(d.BossPopup),"switching to an unsupported encounter closes both report windows")
        IDTOpen(p),IDTBossOpen(),IDTBossDebugOpen(),debug := d.BossDebug.Hwnd
        IDTShutdown()
        V48Assert(!DllCall("User32\IsWindow","Ptr",debug,"Int") && !IPMUiHandle(d.BossDebug),"death-page shutdown retires all technical UI handles")
    }
    finally IDTShutdown()
}

; Completion capture/persistence only; no live audio or player settings.
; Groups: V648ReductionRawMarkers, V648ReductionActorScope,
; V648ReductionNonCompletion, V648ReductionLegacyRoundtrip,
; V648ReductionPayloadValidation, V648ReductionLateRollback.

V648ReductionRows(f,kind := "")
{
    rows := []
    if !f.Seg.HasOwnProp("BossCheckState")
        return rows
    for r in IBCOrdered(f.Seg.BossCheckState.Rows) {
        if IBCReductionKind(r.Kind) && (kind="" || r.Kind=kind)
            rows.Push(r)
    }
    return rows
}

V648ReductionFeed(f,kind,at := 10000)
{
    boss := V647BossNPC("4078423634870272",700)
    if kind="grace-heal"
        return V647BossFeed(f,at,V647BossNPC("4078440814739456",701),boss,"4071199499878400","836045448945477","836045448945500","(100 ~50)")
    if kind="grace-dr"
        return V647BossFeed(f,at,boss,"=","4088443793571840","836045448945477","4088443793572128")
    return V647BossFeed(f,at,boss,"=","4086833180835840","836045448945477","4086833180836217")
}

V648ReductionFixture()
{
    f := V647BossFixture()
    for i,kind in ["grace-heal","grace-dr","rage-decay"]
        V648ReductionFeed(f,kind,10000+i*10)
    IBCFreeze(f.Seg,f.Recap)
    return f
}

V648ReductionRawMarkers()
{
    ; Exact NPC-only completion rows from Aug11 lines17310,18005,18598.
    raw := [
        "[20:21:47.866] [Grace {4078440814739456}:11204000128503|(792.90,2330.51,228.52,-97.97)|(172128/340388)] [TYTH {4078423634870272}:11204000022469|(808.25,2364.21,228.52,148.94)|(14796705/19989636)] [Aivela's Restoration {4071199499878400}] [ApplyEffect {836045448945477}: Heal {836045448945500}] (355015 ~355016)",
        "[20:21:59.965] [TYTH {4078423634870272}:11204000022469|(809.01,2362.32,228.52,-124.78)|(14563960/19989636)] [=] [Aivela's Grace {4088443793571840}] [ApplyEffect {836045448945477}: Aivela's Grace {4088443793572128}]",
        "[20:22:13.878] [TYTH {4078423634870272}:11204000022469|(818.11,2370.50,228.52,-154.48)|(14225604/19989636)] [=] [ {4086833180835840}] [ApplyEffect {836045448945477}: Rage Decay {4086833180836217}]"
    ]
    kinds := ["grace-heal","grace-dr","rage-decay"]
    for i,line in raw {
        f := V647BossFixture(),ev := IPParseLine(line)
        V48Assert(IsObject(ev) && ev.ValueOK,"real NPC-only completion row parses")
        ev.RecordId := 1,f.Seg.Start := ev.RawMs-1000,f.Pull.Start := f.Seg.Start
        f.Recap.At := ev.RawMs+1,f.Pull.End := f.Recap.At
        IBCObserve(f.Seg,ev,ev.RawMs),IBCFreeze(f.Seg,f.Recap)
        rows := V648ReductionRows(f)
        V48Assert(rows.Length=1 && rows[1].Kind=kinds[i],"only the exact completion kind is retained: " kinds[i])
        V48Assert(rows[1].At=ev.RawMs && rows[1].Record=1 && rows[1].Target=rows[1].Boss,"completion preserves time, order and target boss instance")
        V48Assert(f.Recap.BossEvidence.Version=7 && f.Recap.BossEvidence.Profile="tyth-rage-v7","fresh capture advertises the current evidence version with the expanded window and reduction-completion capability")
        copy := IBCUnpackEvidence(IGJParse(IGVJson(IBCPackEvidence(f.Recap.BossEvidence))),f.Pull,f.Recap)
        V48Assert(copy.Rows[1].Kind=kinds[i],"each real completion survives strict current-version persistence")
    }
}

V648ReductionActorScope()
{
    f := V647BossFixture(),boss := V647BossNPC("4078423634870272",700),other := V647BossNPC("4078423634870272",999)
    grace := V647BossNPC("4078440814739456",701),guardian := V647BossNPC("4078445109706752",702)
    for source in ["@Player#1|(100/100)",guardian,boss]
        V647BossFeed(f,10000,source,boss,"4071199499878400","836045448945477","836045448945500","(100 ~50)")
    for target in ["@Player#1|(100/100)",guardian,grace]
        V647BossFeed(f,10001,grace,target,"4071199499878400","836045448945477","836045448945500","(100 ~50)")
    for source in ["@Player#1|(100/100)",grace]
        V647BossFeed(f,10002,source,boss,"4088443793571840","836045448945477","4088443793572128")
    for target in [other,grace,"@Player#1|(100/100)"] {
        V647BossFeed(f,10003,boss,target,"4088443793571840","836045448945477","4088443793572128")
        V647BossFeed(f,10004,boss,target,"4086833180835840","836045448945477","4086833180836217")
    }
    V48Assert(V648ReductionRows(f).Length=0,"wrong actors and another Tyth target cannot fabricate a completion")
    V647BossFeed(f,10005,grace,other,"4071199499878400","836045448945477","836045448945500","(100 ~50)")
    rows := V648ReductionRows(f)
    V48Assert(rows.Length=1 && rows[1].Boss=IPActor(other).Key && rows[1].Source=IPActor(grace).Key,"valid heal is scoped to its actual target boss, not a guessed active instance")
}

V648ReductionNonCompletion()
{
    f := V647BossFixture(),boss := V647BossNPC("4078423634870272",700),grace := V647BossNPC("4078440814739456",701)
    V647BossFeed(f,10000,grace,boss,"4071199499878400","836045448945472","836045448945479")
    V647BossFeed(f,10001,grace,"=","4088443793571840","836045448945472","836045448945479")
    V647BossFeed(f,10002,grace,"=","4088443793571840","836045448945472","836045448945482","(Aivela's Grace {4088443793571840})")
    V647BossFeed(f,10003,boss,"=","4086833180835840","836045448945477","4086833180836213")
    V647BossFeed(f,10004,boss,"=","4086833180835840","836045448945478","4086833180836213")
    V647BossFeed(f,10005,boss,"=","4086833180835840","836045448945478","4086833180836217")
    V647BossFeed(f,10006,boss,"=","4088443793571840","836045448945478","4088443793572128")
    V647BossFeed(f,10007,boss,"=","1","836045448945477","4086833180836217")
    V48Assert(V648ReductionRows(f).Length=0,"cast starts, interruption, refresh6213, removal and mismatched ability never prove completion")
    foundInterrupt := false
    for row in IBCOrdered(f.Seg.BossCheckState.Rows)
        foundInterrupt := foundInterrupt || row.Kind="dr-interrupt"
    V48Assert(foundInterrupt,"existing interruption evidence remains separately available")
}

V648ReductionLegacyRoundtrip()
{
    f := V647BossPositive(),e := f.Recap.BossEvidence
    e.Version := 1,e.Profile := "tyth-rage-v1"
    before := IGVJson(IBCPackEvidence(e)),copy := IBCUnpackEvidence(IGJParse(before),f.Pull,f.Recap)
    V48Assert(copy.Version=1 && copy.Profile="tyth-rage-v1" && IGVJson(IBCPackEvidence(copy))=before,"version-one evidence stays version one byte-for-byte after roundtrip")
    f := V648ReductionFixture(),before := IGVJson(IBCPackEvidence(f.Recap.BossEvidence))
    copy := IBCUnpackEvidence(IGJParse(before),f.Pull,f.Recap)
    V48Assert(copy.Version=7 && copy.Rows.Length=3 && IGVJson(IBCPackEvidence(copy))=before,"current evidence retains all three completion kinds")
    copy.Version := 3,copy.Profile := "tyth-rage-v3",before := IGVJson(IBCPackEvidence(copy))
    copy := IBCUnpackEvidence(IGJParse(before),f.Pull,f.Recap)
    V48Assert(copy.Version=3 && copy.Rows.Length=3 && IGVJson(IBCPackEvidence(copy))=before,"version-three reduction evidence remains readable and retains its original version")
    copy.Version := 2,copy.Profile := "tyth-rage-v2",before := IGVJson(IBCPackEvidence(copy))
    copy := IBCUnpackEvidence(IGJParse(before),f.Pull,f.Recap)
    V48Assert(copy.Version=2 && copy.Rows.Length=3 && IGVJson(IBCPackEvidence(copy))=before,"version-two reduction evidence remains readable and retains its original version")
}

V648ReductionPayloadValidation()
{
    f := V648ReductionFixture(),packed := IBCPackEvidence(f.Recap.BossEvidence)
    bad := IPRCloneSnapshot(packed),bad[1] := 1,bad[2] := "tyth-rage-v1"
    V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"version-one payload cannot contain reduction completion kinds")
    old := IBCCloneEvidence(f.Recap.BossEvidence),old.Version := 1,old.Profile := "tyth-rage-v1"
    V64Reject((*)=>IBCPackEvidence(old),"packing cannot silently upgrade or mislabel a version-one completion row")
    for wrong in [[8,"tyth-rage-v8"],[7,"tyth-rage-v6"],[6,"tyth-rage-v5"],[5,"tyth-rage-v4"],[4,"tyth-rage-v3"],[1,"tyth-rage-v2"],[2,"tyth-rage-v1"],[3,"tyth-rage-v2"]] {
        bad := IPRCloneSnapshot(packed),bad[1] := wrong[1],bad[2] := wrong[2]
        V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"version and profile must be a supported exact pair")
    }
    bad := IPRCloneSnapshot(packed),bad[6][1][8] := bad[6][1][4]
    V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"Restoration source must be the retained Grace actor")
    bad := IPRCloneSnapshot(packed),bad[6][1][16] := "N:4078423634870272:999:Tyth"
    V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"completed heal target must match the evidence boss instance")
    bad := IPRCloneSnapshot(packed),bad[6][2][15] := "4071199499878400"
    V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"completed DR cannot be relabeled Restoration")
    bad := IPRCloneSnapshot(packed),bad[6][3][13] := 0
    V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"decay completion must not fabricate a Rage count")
    bad := IPRCloneSnapshot(packed),bad[6][3][12] := 1
    V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"decay marker cannot contain a healing amount")
}

V648ReductionLateRollback()
{
    f := V647BossFixture(),V647BossEnd(f),id := IDTCaseKey(f.Recap)
    f.Seg.DeathCapture.Cases[id] := f.Recap,original := IGVJson(IBCPackEvidence(f.Recap.BossEvidence))
    IPBBeginUndo(f.Data,f.Seg)
    V648ReductionFeed(f,"grace-heal",14001)
    revised := f.Seg.DeathCapture.Cases[id]
    V48Assert(revised.BossEvidence.Rows.Length=f.Recap.BossEvidence.Rows.Length+1,"late pre-death completion updates a recent frozen case")
    V48Assert(IGVJson(IBCPackEvidence(f.Recap.BossEvidence))=original,"previously published evidence remains immutable")
    IPBRollbackTail(f.Data,f.Seg)
    V48Assert(IGVJson(IBCPackEvidence(f.Seg.DeathCapture.Cases[id].BossEvidence))=original,"rollback restores the frozen case and rolling completion evidence")
    V48Assert(V648ReductionRows(f).Length=0,"rollback removes speculative reduction rows from the journal")
    V648ReductionFeed(f,"grace-dr",15001)
    V48Assert(IGVJson(IBCPackEvidence(f.Seg.DeathCapture.Cases[id].BossEvidence))=original,"a post-death completion cannot enter this death's explanation")
}

; Thirty-second history, independent of the twenty-second death association
; and the ordinary twelve-second player recap. All records are synthetic.
; Groups: V649BossWindowBoundary, V649BossWindowDelayedDeath,
; V649BossWindowLateAndRollback, V649BossWindowLegacySchema,
; V649BossWindowAssociationLimit, V649BossWindowPlayerRecap.

V649BossWindowFixture()
{
    f := V647BossFixture(),f.Recap.At := 70000,f.Recap.From := 58000,f.Pull.End := 70000
    return f
}

V649BossWindowEnd(f,castAt := 50000,hitAt := 50500,deathAt := 70000)
{
    boss := V647BossNPC("4078423634870272",700)
    if castAt>=0
        f.Cast := V647BossFeed(f,castAt,boss,"=","4086837475803136","836045448945472","836045448945479")
    f.Hit := V647BossFeed(f,hitAt,boss,"@Victim#1|(0/1000)","4086837475803136","836045448945477","836045448945501","(1000)")
    death := V647BossFeed(f,deathAt,boss,"@Victim#1|(0/1000)","1","836045448945472","836045448945493")
    f.Recap.At := deathAt,f.Recap.From := Max(f.Seg.Start,deathAt-12000),f.Recap.Record := death.RecordId,f.Pull.End := deathAt
    IBCFreeze(f.Seg,f.Recap)
    return f
}

V649BossWindowBoundary()
{
    f := V649BossWindowFixture(),V647BossRage(f,19999,6),V647BossRage(f,20000,7)
    V647BossRage(f,20001,8),V647BossRage(f,50000,9),V649BossWindowEnd(f)
    check := IBCDebugCheck(f.Pull,f.Recap),h := check.History
    V48Assert(h.Changes.Length=3 && h.Changes[1].Row.At=20000 && h.Changes[1].Previous=6,"exactly thirty seconds before the cast is included; earlier count supplies only a baseline")
    V48Assert(h.Changes[3].Row.At=50000 && h.Changes[3].Row.Charges=9,"same-time Rage preceding the cast is included by record order")
    V48Assert(!h.Clipped && InStr(IBCCheck(f.Pull,f.Recap).Text,"Last 30 seconds before Overload"),"full thirty-second evidence is reported without a missing-history warning")
    V647BossRage(f,50000,0),IBCFreeze(f.Seg,f.Recap),check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(check.History.Changes.Length=3 && check.History.LastCount=9,"a same-time reset recorded after the cast stays outside the lead-up")
}

V649BossWindowDelayedDeath()
{
    f := V649BossWindowFixture(),V647BossRage(f,19000,4),V647BossRage(f,20000,5)
    V647BossRage(f,25000,6),V649BossWindowEnd(f,50000,50000,70000)
    e := f.Recap.BossEvidence,check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(e.Version=7 && e.Profile="tyth-rage-v7" && e.From=20000,"new evidence covers the entire lead-up even at the twenty-second death-association boundary")
    V48Assert(check.History.HitGap=20000 && !check.History.Clipped && check.History.Changes[1].Row.At=20000,"a delayed death retains the full thirty seconds before its matching Overload")
    V48Assert(InStr(IBCCheck(f.Pull,f.Recap).Text,"25.0s before") && e.Anchors.Length=1 && e.Anchors[1].Charges=4,"earlier count context survives actual rolling trim instead of inventing a starting count")
    roundtrip := IBCUnpackEvidence(IGJParse(IGVJson(IBCPackEvidence(e))),f.Pull,f.Recap)
    f.Recap.BossEvidence := roundtrip
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).Text=check.Text,"saving and reopening preserves the expanded history and its interpretation")
}

V649BossWindowLateAndRollback()
{
    f := V649BossWindowFixture(),V647BossRage(f,20000,8),V647BossRage(f,25000,7),V649BossWindowEnd(f)
    id := IDTCaseKey(f.Recap),f.Seg.DeathCapture.Cases[id] := f.Recap
    before := IGVJson(IBCPackEvidence(f.Recap.BossEvidence))
    V48Assert(InStr(IBCCheck(f.Pull,f.Recap).Text,"cause unclear"),"a reduction twenty-five seconds before Overload begins without an assumed cause")
    IPBBeginUndo(f.Data,f.Seg)
    V648ReductionFeed(f,"grace-heal",25002)
    revised := f.Seg.DeathCapture.Cases[id]
    V48Assert(InStr(IBCCheck(f.Pull,revised).Text,"Grace heal"),"late pre-death completion fills the expanded frozen history while the case is still recent")
    V48Assert(IGVJson(IBCPackEvidence(f.Recap.BossEvidence))=before,"late evidence does not mutate the previously published history")
    IPBRollbackTail(f.Data,f.Seg)
    V48Assert(IGVJson(IBCPackEvidence(f.Seg.DeathCapture.Cases[id].BossEvidence))=before,"tail rollback restores the original frozen thirty-second history")
    V647BossRage(f,72000,2),V648ReductionFeed(f,"grace-heal",25002)
    atBoundary := f.Seg.DeathCapture.Cases[id]
    V48Assert(atBoundary.BossEvidence.Rows[1].At=20000 && InStr(IBCCheck(f.Pull,atBoundary).Text,"Grace heal"),"a rebuild exactly two seconds after death still retains the oldest thirty-second lead-up row")
    before := IGVJson(IBCPackEvidence(atBoundary.BossEvidence))
    V647BossRage(f,72001,1),V648ReductionFeed(f,"grace-heal",25002)
    V48Assert(IGVJson(IBCPackEvidence(f.Seg.DeathCapture.Cases[id].BossEvidence))=before,"the existing two-second late-case update bound is not widened with retention")
}

V649BossWindowLegacySchema()
{
    f := V649BossWindowFixture(),V647BossRage(f,20000,4),V647BossRage(f,55000,7)
    V649BossWindowEnd(f,60000,60500,70000)
    fresh := f.Recap.BossEvidence
    for version in [1,2] {
        old := {Version:version,Profile:"tyth-rage-v" version,From:50000,Partial:false,Limited:false,Rows:[],Anchors:[]}
        for row in fresh.Rows {
            if row.At>=old.From
                old.Rows.Push(row)
            else if row.Kind="rage"
                old.Anchors := [row]
        }
        packed := IGVJson(IBCPackEvidence(old)),restored := IBCUnpackEvidence(IGJParse(packed),f.Pull,f.Recap)
        V48Assert(restored.Version=version && restored.From=50000 && IGVJson(IBCPackEvidence(restored))=packed,"legacy twenty-second evidence retains its exact version and window: " version)
        f.Recap.BossEvidence := restored,check := IBCDebugCheck(f.Pull,f.Recap)
        V48Assert(check.History.Clipped && InStr(IBCCheck(f.Pull,f.Recap).Text,"Some of this history is missing."),"legacy evidence reports its missing thirty-second lead-up honestly")
        bad := IBCPackEvidence(old),bad[3] := 20000
        V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"legacy version cannot claim a wider capture window")
    }
    f.Recap.BossEvidence := fresh,bad := IBCPackEvidence(fresh),bad[3] := 50000
    V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"version three cannot be mislabeled with the old twenty-second From")
    bad := IBCPackEvidence(fresh),bad[1] := 2,bad[2] := "tyth-rage-v2"
    V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"extended evidence cannot silently masquerade as version two")
}

V649BossWindowAssociationLimit()
{
    f := V649BossWindowFixture(),V647BossRage(f,20000,5),V649BossWindowEnd(f,49000,49999,70000)
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(!check.HasOwnProp("History") && InStr(check.Summary,"No same-life"),"keeping older rows cannot associate an Overload hit more than twenty seconds before death")
    f := V649BossWindowFixture(),V647BossRage(f,20000,5),V649BossWindowEnd(f,49999,50000,70000)
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(check.History.Reference=49999 && check.History.ReferenceRecord=f.Cast.RecordId && InStr(check.Text,"recorded Overload cast"),"the accepted hit can use its retained cast just outside the hit-to-death window")
    f := V649BossWindowFixture()
    V647BossFeed(f,49999,V647BossNPC("4078423634870272",700),"@Victim#1|(0/1000)","1","836045448945472","836045448945493")
    V649BossWindowEnd(f,50000,50000,70000),check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(check.HasOwnProp("History"),"retained life-boundary rows outside twenty seconds do not change the previous association criteria")
    f := V649BossWindowFixture()
    V647BossFeed(f,50000,V647BossNPC("4078423634870272",700),"@Victim#1|(0/1000)","1","836045448945472","836045448945493")
    V649BossWindowEnd(f,50500,51000,70000),check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(!check.HasOwnProp("History") && InStr(check.Summary,"Earlier-life"),"a death inside the association window still prevents reusing an unrevived player's later hit")
}

V649BossWindowPlayerRecap()
{
    f := V649BossWindowFixture(),V647BossRage(f,20000,6)
    for at in [20001,57999,58000,69999,70000] {
        stamp := Format("00:{:02d}:{:02d}.{:03d}",Floor(at/60000),Mod(Floor(at/1000),60),Mod(at,1000))
        ending := at=70000
        line := "[" stamp "] [" V647BossNPC("4078423634870272",700) "] [@Victim#1|(" (ending ? 0 : 500) "/1000)] [Spell {1}] ["
            . (ending ? "Event {836045448945472}: Death {836045448945493}]" : "ApplyEffect {836045448945477}: Damage {836045448945501}] (100)")
        ev := IPParseLine(line),ev.RecordId := f.Next,f.Next += 1
        V48Assert(IsObject(ev) && ev.ValueOK,"ordinary player recap boundary record parses")
        IDTObserve(f.Seg,ev,at)
    }
    death := {Key:"@Victim#1",At:70000,Record:ev.RecordId}
    IDTFreeze(f.Seg,ev,death),recap := f.Seg.DeathCapture.Cases[IDTCaseKey(death)]
    V48Assert(recap.From=58000 && recap.Rows.Length=3 && recap.Rows[1].At=58000 && recap.Rows[3].At=70000,"ordinary player damage and HP recap remains exactly twelve seconds, inclusive of its boundary")
    V48Assert(recap.BossEvidence.From=20000 && recap.BossEvidence.Rows[1].At=20000,"the same death separately retains older boss Rage without expanding player HP retention")
}

; Correctness guards for bounded identity memoization and cheap parser guards.
; These are not timing tests and never launch the normal app or play audio.
; Groups: V6410ActorIdentityCache, V6410NpcIdentityCache,
; V6410IdentityCacheEviction, V6410ParserDecodeParity, V6410RetiredEventGuard,
; V6410InactiveProgressHealth, V6410MetricLifeFastPath, V6410HealthJournalFastPath.

V6410Comparable(value)
{
    if !IsObject(value)
        return value
    out := []
    if value is Array {
        for item in value
            out.Push(V6410Comparable(item))
    }
    else {
        for name,item in value.OwnProps()
            out.Push([name,V6410Comparable(item)])
    }
    return out
}

V6410Exact(value)
{
    return IGVJson(V6410Comparable(value))
}

V6410ActorIdentityCache()
{
    fixtures := [
        ["","?","Unknown / environment","Unknown"],
        [" |(1/2)","?","Unknown / environment","Unknown"],
        [" @Identity#6410 |(0,0,0,0)|(1/2)","@Identity#6410","Identity","Player"],
        ["@identity#6410|(2/2)","@identity#6410","identity","Player"],
        ["@Owner#1/Companion {123}:99|(1/2)","C:@Owner#1/Companion {123}:99","Companion [companion]","Companion"],
        ["Alpha {123}:99|(0,0,0,0)|(1/2)","N:123:99:Alpha","Alpha","NPC / companion"],
        ["alpha {123}:99|(2/2)","N:123:99:alpha","alpha","NPC / companion"],
        ["Alpha {123}","N:123::Alpha","Alpha","NPC / companion"],
        ["Alpha {broken}:99|(1/2)","U:Alpha {broken}:99","Alpha {broken}:99","Other"],
        ["@Zoë [Group]#7|(1/2)","@Zoë [Group]#7","Zoë [Group]","Player"]
    ]
    Loop 2 {
        for row in fixtures {
            actor := IPActor(row[1])
            V48Assert(actor.Key==row[2] && actor.Name==row[3] && actor.Kind==row[4],"cold and warm identity decoding preserve exact spelling, companion scope and malformed input")
        }
    }
    a := IPActor("@Identity#6410|(1/2)"),b := IPActor("@Identity#6410|(2/2)")
    a.Key := "changed",a.Name := "changed",a.Kind := "Other",a.Extra := true
    c := IPActor("@Identity#6410|(3/4)")
    V48Assert(ObjPtr(a)!=ObjPtr(b) && ObjPtr(b)!=ObjPtr(c) && b.Key=="@Identity#6410" && c.Name=="Identity" && !c.HasOwnProp("Extra"),"callers cannot mutate cached templates or actors from other records")
    a := IPActor(""),a.Name := "changed"
    V48Assert(IPActor("").Name=="Unknown / environment","environment actors remain independently mutable")
}

V6410NpcIdentityCache()
{
    actor := {Kind:"NPC / companion",Key:"N:4078423634870272:1:Tyth"}
    V48Assert(IPBNpcId(actor)=="4078423634870272" && IPBNpcId(actor)=="4078423634870272","warm NPC identity lookup retains the scalar string")
    actor.Key := "N:4122949560827904:2:Nahut"
    V48Assert(IPBNpcId(actor)=="4122949560827904","changing an existing actor key cannot reuse its old NPC ID")
    actor.Kind := "Player"
    V48Assert(IPBNpcId(actor)=="","changing actor kind invalidates NPC interpretation even for a cached key")
    actor.Kind := "NPC / companion"
    for row in [["N:123:1:Name","123"],["n:123:1:Name",""],["N:00123:1:Name","00123"],["N:0:","0"],["N:123:","123"],["prefixN:123:1:Name",""],["N:notdigits:1:Name",""],["N::1:Name",""]] {
        actor.Key := row[1]
        V48Assert(IPBNpcId(actor)==row[2] && IPBNpcId(actor)==row[2],"NPC cache retains regex validation, leading zeros and case-sensitive prefix behavior")
    }
    actor := IPActor("Tyth {4078423634870272}:1")
    V48Assert(IPBRule(actor).Key="G-TY","rule resolution consumes the cached current NPC identity")
    actor.Key := "N:4122949560827904:2:Nahut"
    V48Assert(IPBRule(actor).Key="G-NA","rule resolution does not retain a rule after actor-key mutation")
    phase := IPActor("Phase {4126527268585472}:9"),context := {AreaId:"833571547775765",ModeId:"836045448953655"}
    V48Assert(IPBRule(phase,context).Key="G-SC" && !IsObject(IPBRule(phase)),"only identity is memoized; encounter context still decides scoped rules")
}

V6410IdentityCacheEviction()
{
    first := IPActor("Original {123}:6410|(1/2)"),before := V6410Exact(first)
    V48Assert(IPBNpcId(first)=="123","prime a scalar lookup before cache churn")
    Loop 2200 {
        actor := IPActor("Cache probe {" (900000+A_Index) "}:" A_Index "|(1/2)")
        id := IPBNpcId(actor)
        if A_Index=2200
            V48Assert(id=="902200","all records still decode across bounded cache eviction")
    }
    V48Assert(V6410Exact(first)=before && V6410Exact(IPActor("Original {123}:6410|(2/2)"))=before && IPBNpcId(first)=="123","eviction neither mutates retained actors nor changes later identity results")
    longName := ""
    Loop 1100
        longName .= "x"
    longActor := IPActor(longName " {321}:9|(1/2)")
    V48Assert(longActor.Name==longName && IPBNpcId(longActor)=="321","long valid identities bypass cache storage without being truncated or rejected")
    longActor.Name := "changed"
    V48Assert(IPActor(longName " {321}:9|(2/2)").Name==longName,"uncached long actors retain ordinary mutation isolation")
}

V6410ParserDecodeParity()
{
    actor := {Key:"@Case#1",Name:"Case",Kind:"Player"},hp := {Known:true,Current:100,Maximum:100}
    expected := {RawMs:3723004,Source:actor,Target:actor,Ability:"Test",AbilityId:"7",Kind:"Heal",Effect:"Heal",Amount:20,
        Effective:10,EffectiveSource:"explicit",Crit:false,ValueOK:true,TargetAlive:true,ActionId:"836045448945477",EffectId:"836045448945500",
        SourceHP:hp,TargetHP:hp.Clone(),Threat:{Expected:true,Known:true,Value:-2,Invalid:false},Immune:false,FullAbsorb:false,AreaId:"",ModeId:""}
    line := "[01:02:03.004] [@Case#1|(0,0,0,0)|(100/100)] [=] [Test {7}] [ApplyEffect {836045448945477}: Heal {836045448945500}] (20 ~10) <-2>"
    a := IPParseLine(line),b := IPParseLine(line)
    V48Assert(V6410Exact(a)=V6410Exact(expected) && V6410Exact(b)=V6410Exact(expected),"cold and warm parsing reproduce the complete expected event, including healing, health and signed threat")
    V48Assert(ObjPtr(a.Source)=ObjPtr(a.Target) && ObjPtr(a.Source)!=ObjPtr(b.Source) && ObjPtr(a.SourceHP)!=ObjPtr(a.TargetHP),"equals target aliases its actor only within one event, while HP objects and later records remain independent")
    a.Source.Name := "changed",a.SourceHP.Current := 0
    V48Assert(a.Target.Name=="changed" && a.TargetHP.Current=100 && V6410Exact(IPParseLine(line))=V6410Exact(expected),"identity memoization cannot leak actor or HP mutations into later records")
    explicitTarget := StrReplace(line,"[=]","[@Case#1|(0,0,0,0)|(100/100)]")
    e := IPParseLine(explicitTarget)
    V48Assert(ObjPtr(e.Source)!=ObjPtr(e.Target) && e.Source.Key==e.Target.Key,"equal explicit actor tokens remain distinct objects unless the target is the equals marker")
    expected.Kind := "Damage",expected.Effect := "Damage",expected.EffectId := "836045448945501",expected.Amount := 25
    expected.Effective := 0,expected.EffectiveSource := "unknown",expected.Crit := true,expected.TargetAlive := false,expected.FullAbsorb := true
    damage := StrReplace(StrReplace(line,"Heal {836045448945500}","Damage {836045448945501}"),"(20 ~10)","(25* ~0 energy {836045448945511})")
    V48Assert(V6410Exact(IPParseLine(damage))=V6410Exact(expected),"damage critical, explicit zero and full absorb fields remain exactly unchanged")
    for row in [
        ["Localized {836045448953664}: Place {123} Mode {456}","Area","123","456"],
        ["Localized {836045448953664}: Place {123} Mode {456} trailing text","Area","123","456"],
        ["AreaEntered {999}","Area","",""],
        ["AreaEntered`t{999}","Area","",""],
        ["areaEntered {999}","Other","",""],
        ["PrefixAreaEntered {999}","Other","",""],
        ["Other {123}: Wrong {836045448953664}","Other","",""],
        ["Localized {836045448953664}: Place {broken}","Other","",""],
        ["AreaEntered {836045448953664}: Place {broken}","Area","",""]
    ] {
        e := IPParseLine("[00:00:00.000] [] [] [] [" row[1] "]")
        V48Assert(IsObject(e) && e.Kind==row[2] && e.AreaId==row[3] && e.ModeId==row[4],"rare-area guards preserve numeric and legacy-label grammar, including invalid inputs")
    }
    for field in ["@Case#1|(1/2)|trailing","@Case#1|(0,0,0,0)|(1/1000000000001)"] {
        e := IPParseLine("[00:00:00.000] [" field "] [=] [Heal {7}] [ApplyEffect {836045448945477}: Heal {836045448945500}] (20)")
        V48Assert(e.TargetAlive && !e.TargetHP.Known,"existing TargetAlive and strict HP validation remain distinct on unusual fields")
    }
    V48Assert(!IsObject(IPParseLine("[24:00:00.000] [] [] [] [AreaEntered {999}]")),"fast guards do not bypass timestamp validation")
}

V6410RetiredEventGuard()
{
    s := IPNewData("guard"),actor := IPActor("Boss {123}:9"),other := IPActor("@Player#1")
    ev := {Source:actor,Target:other,SourceHP:{Known:true,Current:100,Maximum:100},TargetHP:{Known:true,Current:100,Maximum:100},
        Kind:"Damage",ValueOK:true,Amount:10,Immune:false,FullAbsorb:false}
    V48Assert(!IPXRetiredEvent(s,ev) && s.RetiredBosses.Count=0,"empty retired state is a no-op for ordinary damage")
    s.RetiredBosses[actor.Key] := true,ev.SourceHP.Current := 0
    V48Assert(IPXRetiredEvent(s,ev) && s.RetiredBosses.Has(actor.Key),"recorded retired actors still suppress damage without reset evidence")
    ev.SourceHP.Current := 100
    V48Assert(!IPXRetiredEvent(s,ev) && s.RetiredBosses.Count=0,"fresh full-health positive damage still clears a retired source")
    s.RetiredBosses[actor.Key] := true,ev.Immune := true
    V48Assert(IPXRetiredEvent(s,ev),"immune full-health damage is not promoted to a reset")
    ev.Kind := "Activate"
    V48Assert(!IPXRetiredEvent(s,ev) && s.RetiredBosses.Count=0,"recorded activation reset remains available")
    ev.Kind := "Other",s.RetiredBosses[actor.Key] := true
    V48Assert(!IPXRetiredEvent(s,ev) && s.RetiredBosses.Has(actor.Key),"arbitrary metadata neither deletes retired state nor becomes suppressed damage")
}

V6410InactiveProgressHealth()
{
    s := IPNewData("phase guard"),seg := IPNewSegment(s,0,"synthetic"),seg.BossKey := "DUMMY"
    early := V64Line(500,V64Boss(),"=","Activate"),early.Kind := "Other"
    IGPObserve(seg,early,500)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=0,"inactive metadata alone cannot begin an HP-only phase")
    active := V64Line(1000,V64Actor(),V64Boss(),"Damage",100),key := "HP:1:" active.Target.Key
    IGPObserve(seg,active,1000)
    V48Assert(seg.PhaseProgress["Stage"]=1 && seg.PhaseProgress[key].Low=90,"positive damage still establishes the supported default phase")
    IPBBeginUndo(s,seg)
    metadata := V64Line(2000,StrReplace(V64Boss(),"900000/","400000/"),"=","Activate"),metadata.Kind := "Other"
    IGPObserve(seg,metadata,2000)
    V48Assert(seg.PhaseProgress[key].Low=40 && seg.PhaseProgress[key].LastAt=2000 && seg.PhaseProgress["StageAt"]=1000,"inactive records still update phase HP without changing its starting evidence")
    metadata.SourceHP.Current := 300000,metadata.TargetHP.Current := 300000
    IGPObserve(seg,metadata,1500)
    V48Assert(seg.PhaseProgress[key].Low=30 && seg.PhaseProgress[key].Last=40 && seg.PhaseProgress[key].LastAt=2000,"late inactive HP can lower the minimum without replacing the latest observation")
    death := V64Line(3000,V64Actor(),StrReplace(V64Boss(),"900000/","0/"),"Death",0)
    IGPObserve(seg,death,3000)
    V48Assert(seg.PhaseProgress[key].Dead && seg.PhaseProgress[key].Low=0,"explicit NPC death still contributes zero HP on the inactive path")
    IPBRollbackTail(s,seg)
    V48Assert(!seg.PhaseProgress[key].Dead && seg.PhaseProgress[key].Low=90 && seg.PhaseProgress[key].LastAt=1000,"rollback restores active-phase health after inactive metadata and death updates")
}

V6410MetricLifeFastPath()
{
    s := IPNewData("life guard"),seg := IPNewSegment(s,0,"synthetic")
    alive := V64Line(1000,V64Actor(800),V64Boss(),"Activate"),key := alive.Source.Key
    IPBBeginUndo(s,seg),IPBObserveMetricLife(seg,alive)
    V48Assert(seg.IncomingDead.Count=0 && !seg.Undo.Maps.Has("IncomingDead"),"empty non-death life state needs no speculative journal entries")
    death := V64Line(1100,V64Boss(),V64Actor(0),"Death",0)
    IPBObserveMetricLife(seg,death)
    V48Assert(seg.IncomingDead.Has(key),"a death still creates life state after earlier empty-map fast paths")
    IPBRollbackTail(s,seg)
    V48Assert(!seg.IncomingDead.Has(key),"new speculative death state rolls back to empty")
    IPBObserveMetricLife(seg,death),IPBBeginUndo(s,seg)
    zero := V64Line(1200,V64Actor(0),V64Boss(),"Activate")
    IPBObserveMetricLife(seg,zero),zero.SourceHP.Known := false
    IPBObserveMetricLife(seg,zero)
    V48Assert(seg.IncomingDead.Has(key),"zero or unknown HP does not remove an existing incoming-death marker")
    IPBObserveMetricLife(seg,alive)
    V48Assert(!seg.IncomingDead.Has(key),"positive source-player HP still clears an existing marker")
    IPBRollbackTail(s,seg)
    V48Assert(seg.IncomingDead.Has(key),"revival rollback restores the prior incoming-death marker")
    healed := V64Line(1300,"@Healer#6410|(100/100)",V64Actor(800),"Heal",100,100)
    IPBObserveMetricLife(seg,healed)
    V48Assert(!seg.IncomingDead.Has(key),"positive target-player HP preserves the metric life's existing healing behavior")
}

V6410HealthJournalFastPath()
{
    s := IPNewData("health guard"),seg := IPNewSegment(s,0,"synthetic")
    player := V64Line(1000,V64Actor(900),"=","Activate"),playerKey := player.Source.Key
    IRObserve(s,player,1000),IPBBeginUndo(s,seg)
    IRObserve(s,V64Line(1001,V64Actor(800),"=","Activate"),1001)
    V48Assert(seg.Raid.Health.Count=0 && !seg.Undo.Maps.Has("Health"),"player-only observations keep their recap without allocating NPC health undo entries")
    incoming := V64Line(1100,V64Boss(),V64Actor(700),"Damage",100),npcKey := incoming.Source.Key
    IRObserve(s,incoming,1100)
    V48Assert(seg.Raid.Health.Count=1 && seg.Raid.Health.Has(npcKey) && !seg.Raid.Health.Has(playerKey) && seg.Raid.Health[npcKey].Current=900000,"incoming damage still records source-NPC HP independently of the player")
    target := V64Line(1150,V64Boss(),V64Actor(700),"Activate"),target.Kind := "Other",target.EffectId := "836045448953668"
    IRObserve(s,target,1150)
    V48Assert(seg.Raid.Health[npcKey].Target=target.Target.Name,"NPC TargetSet metadata retains its target label")
    outgoing := V64Line(1200,V64Actor(700),StrReplace(V64Boss(),"900000/","500000/"),"Damage",100)
    IRObserve(s,outgoing,1200)
    V48Assert(seg.Raid.Health[npcKey].Current=500000 && seg.Raid.Health[npcKey].At=1200,"outgoing damage still updates target-NPC HP")
    target.EffectId := "836045448953669",IRObserve(s,target,1300)
    V48Assert(seg.Raid.Health[npcKey].Target="" && seg.Raid.Health[npcKey].TargetAt=1300,"NPC TargetCleared metadata still clears the recorded target")
    death := V64Line(1400,V64Actor(700),StrReplace(V64Boss(),"900000/","0/"),"Death",0)
    IRObserve(s,death,1400)
    V48Assert(seg.Raid.Health[npcKey].Dead && seg.Raid.Health[npcKey].Current=0,"explicit target-NPC death remains marked after its final health observation")
    IPBRollbackTail(s,seg)
    V48Assert(seg.Raid.Health.Count=0 && seg.Raid.LastAt=1000 && seg.Raid.Errors=0,"rollback removes speculative NPC health and restores its observation clock")
}

V6410RecapMetadataRollback()
{
    s := IPNewData(),seg := IPNewSegment(s,0,"synthetic")
    ev := V64Line(1000,V64Actor(800),V64Boss(),"Activate")
    IDTObserve(seg,ev,1000),key := ev.Source.Key
    before := seg.DeathCapture.Windows[key][1]
    IPBBeginUndo(s,seg)
    Loop 20
        IDTObserve(seg,V64Line(1000+A_Index,V64Actor(800),V64Boss(),"Activate"),1000+A_Index)
    V48Assert(seg.DeathCapture.Windows[key].Length=1,"unchanged health metadata within one second remains deduplicated")
    IDTObserve(seg,V64Line(1050,V64Boss(),V64Actor(800),"Damage",100),1050)
    IDTObserve(seg,V64Line(1060,V64Boss(),V64Actor(800),"Heal",100,0),1060)
    V48Assert(seg.DeathCapture.Windows[key].Length=3,"identical-HP damage and healing are still retained after repeated metadata")
    IPBRollbackTail(s,seg)
    V48Assert(seg.DeathCapture.Windows[key].Length=1 && seg.DeathCapture.Windows[key][1]=before && before.At=1000 && before.HP=800,"rollback restores the original window when its first actual change follows deduplicated metadata")
    IDTObserve(seg,V64Line(2000,V64Actor(800),V64Boss(),"Activate"),2000)
    IDTObserve(seg,V64Line(1999,V64Actor(800),V64Boss(),"Activate"),1999)
    V48Assert(seg.DeathCapture.Windows[key].Length=3 && seg.DeathCapture.Windows[key][2].At=1999,"one-second refresh and out-of-order health observations are preserved")
}

; Isolated diagnostics. Real NPC-only Aug11 rows are included below;
; all remaining actors/times are synthetic. No live timers/audio/network.
; Groups: V6410IntensifyCapture, V6410IntensifyRealPairs,
; V6410IntensifyMatching, V6410IntensifyStops, V6410IntensifyBudget,
; V6410IntensifyPersistence.

V6410IntensifyRealPairs()
{
    ; Exact NPC-only rows from combat_2026-08-11_20_04_59_448332.txt.
    ; Each set contains the prior count, activation and following observed counts.
    ; The third includes decay between activation and the positive update.
    cases := [
        ; Source lines 45969,46084,46109
        ["[20:31:29.615] [TYTH {4078423634870272}:11204000170710|(819.11,2361.90,228.52,141.42)|(5064621/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (6 charges {836045448953667})",
            "[20:31:32.207] [TYTH {4078423634870272}:11204000170710|(819.11,2361.90,228.52,101.73)|(4945414/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
            "[20:31:33.108] [TYTH {4078423634870272}:11204000170710|(819.11,2361.90,228.52,101.39)|(4924808/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (8 charges {836045448953667})"],
        ; Source lines 46594,46778,46807
        ["[20:31:41.110] [TYTH {4078423634870272}:11204000170710|(826.28,2353.84,228.52,-63.40)|(4008291/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (7 charges {836045448953667})",
            "[20:31:44.618] [TYTH {4078423634870272}:11204000170710|(826.28,2353.84,228.52,-63.40)|(3606844/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
            "[20:31:45.406] [TYTH {4078423634870272}:11204000170710|(826.28,2353.84,228.52,-63.40)|(3508297/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (9 charges {836045448953667})"],
        ; Source lines 72457,72908,72909,72959
        ["[20:43:11.326] [TYTH {4078423634870272}:11204000371170|(805.69,2369.52,228.52,-25.52)|(5451455/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (3 charges {836045448953667})",
            "[20:43:19.430] [TYTH {4078423634870272}:11204000371170|(802.25,2368.07,228.52,80.61)|(4986546/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
            "[20:43:19.528] [TYTH {4078423634870272}:11204000371170|(802.25,2368.07,228.52,80.61)|(4986546/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (2 charges {836045448953667})",
            "[20:43:20.333] [TYTH {4078423634870272}:11204000371170|(802.25,2368.07,228.52,80.61)|(4967725/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (4 charges {836045448953667})"],
        ; Source lines 73533,73800,73852
        ["[20:43:28.643] [TYTH {4078423634870272}:11204000371170|(796.57,2368.23,228.52,232.51)|(4247262/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (8 charges {836045448953667})",
            "[20:43:32.831] [TYTH {4078423634870272}:11204000371170|(807.19,2365.89,228.52,-163.67)|(3690830/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
            "[20:43:33.740] [TYTH {4078423634870272}:11204000371170|(807.19,2365.89,228.52,-160.09)|(3556639/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (10 charges {836045448953667})"],
        ; Source lines 74435,74457,74474
        ["[20:43:44.530] [TYTH {4078423634870272}:11204000371170|(806.61,2364.79,228.52,-139.36)|(3538913/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (5 charges {836045448953667})",
            "[20:43:45.735] [TYTH {4078423634870272}:11204000371170|(806.61,2364.79,228.52,-150.87)|(3506139/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
            "[20:43:46.634] [TYTH {4078423634870272}:11204000371170|(806.61,2364.79,228.52,-168.18)|(3475008/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (7 charges {836045448953667})"],
        ; Source lines 89154,89492,89582
        ["[20:48:54.180] [TYTH {4078423634870272}:11204000545052|(806.17,2324.04,228.52,33.15)|(5519633/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (4 charges {836045448953667})",
            "[20:49:00.890] [TYTH {4078423634870272}:11204000545052|(796.41,2321.17,228.52,68.36)|(4870321/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
            "[20:49:01.691] [TYTH {4078423634870272}:11204000545052|(796.41,2321.17,228.52,60.82)|(4758088/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (6 charges {836045448953667})"],
        ; Source lines 90340,90670,90726
        ["[20:49:14.099] [TYTH {4078423634870272}:11204000545052|(792.90,2323.38,228.52,127.03)|(3126853/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (8 charges {836045448953667})",
            "[20:49:19.934] [TYTH {4078423634870272}:11204000545052|(792.69,2323.57,228.52,73.67)|(2434903/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
            "[20:49:20.819] [TYTH {4078423634870272}:11204000545052|(792.16,2323.75,228.52,88.04)|(2260297/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (10 charges {836045448953667})"],
        ; Source lines 91248,91534,91582
        ["[20:49:28.922] [TYTH {4078423634870272}:11204000545052|(794.10,2324.67,228.52,42.05)|(1367268/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (7 charges {836045448953667})",
            "[20:49:32.818] [TYTH {4078423634870272}:11204000545052|(794.05,2324.56,228.52,16.34)|(720333/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
            "[20:49:33.713] [TYTH {4078423634870272}:11204000545052|(794.05,2324.56,228.52,16.34)|(541608/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (9 charges {836045448953667})"]
    ]
    delays := [901,788,903,909,899,801,885,895]
    for i,lines in cases {
        f := V647BossFixture(),first := IPParseLine(lines[1]),last := IPParseLine(lines[lines.Length])
        f.Seg.Start := first.RawMs-1000,f.Pull.Start := f.Seg.Start
        f.Recap.At := last.RawMs+1000,f.Pull.End := f.Recap.At
        for line in lines {
            ev := IPParseLine(line),ev.RecordId := f.Next,f.Next += 1
            V48Assert(IsObject(ev) && ev.ValueOK,"real Intensify evidence parses")
            IBCObserve(f.Seg,ev,ev.RawMs)
        }
        boss := V647BossNPC("4078423634870272",StrSplit(last.Source.Key,":")[3])
        V647BossFeed(f,last.RawMs+100,boss,"=","4086837475803136","836045448945472","836045448945479")
        V647BossFeed(f,last.RawMs+500,boss,"@Victim#1|(0/1000)","4086837475803136","836045448945477","836045448945501","(1000)")
        IBCFreeze(f.Seg,f.Recap),check := IBCCheck(f.Pull,f.Recap)
        V48Assert(InStr(check.Text,"(+2, Intensify Rage)"),"actual Aug11 plus-two pair " i " is explained")
        V48Assert(InStr(check.DebugText,delays[i] " ms"),"actual observed delay retained: " delays[i])
        f.Recap.BossEvidence := IBCUnpackEvidence(IBCPackEvidence(f.Recap.BossEvidence),f.Pull,f.Recap)
        V48Assert(IBCCheck(f.Pull,f.Recap).Text=check.Text,"real label is identical after saved evidence roundtrip")
    }
}

V6410IntensifyCast(f,at := 12000,instance := 700)
{
    return V647BossFeed(f,at,V647BossNPC("4078423634870272",instance),"=","4076018453184512","836045448945472","836045448945479")
}

V6410IntensifyFixture(delta := 2)
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V6410IntensifyCast(f)
    V647BossRage(f,12800,6+delta),V647BossEnd(f)
    return f
}

V6410IntensifyRows(f,kind)
{
    rows := []
    for row in f.Recap.BossEvidence.Rows {
        if row.Kind=kind
            rows.Push(row)
    }
    return rows
}

V6410IntensifyCapture()
{
    f := V6410IntensifyFixture(),check := IBCCheck(f.Pull,f.Recap)
    V48Assert(V6410IntensifyRows(f,"intensify-cast").Length=1,"exact operation self-cast is retained")
    V48Assert(f.Recap.BossEvidence.Version=7 && f.Recap.BossEvidence.Profile="tyth-rage-v7","new capture declares current Intensify, Wave and Melee capabilities")
    V48Assert(InStr(check.Text,"(+2, Intensify Rage)") && !InStr(check.Text,"cause unclear"),"clean observed plus-two has its mechanic label")
    V48Assert(InStr(check.DebugText,"not a separate completion event"),"debug distinguishes cast/count correlation from explicit completion")
    f := V647BossFixture(),boss := V647BossNPC("4078423634870272",700)
    for source in ["@Player#1|(100/100)",V647BossNPC("4078440814739456",701)]
        V647BossFeed(f,11000,source,"=","4076018453184512","836045448945472","836045448945479")
    V647BossFeed(f,11000,boss,"=","4095826842353664","836045448945472","836045448945479")
    V647BossFeed(f,11000,boss,V647BossNPC("4078423634870272",999),"4076018453184512","836045448945472","836045448945479")
    V647BossFeed(f,11000,boss,"=","4076018453184512","836045448945477","1")
    V647BossEnd(f)
    V48Assert(V6410IntensifyRows(f,"intensify-cast").Length=0,"player ability, wrong actor, wrong target and non-activation do not fabricate operation cast")
}

V6410IntensifyMatching()
{
    for delay in [599,600,800,1200,1201] {
        f := V647BossFixture(),V647BossRage(f,5000,6),V6410IntensifyCast(f,12000)
        V647BossRage(f,12000+delay,8),V647BossEnd(f),check := IBCCheck(f.Pull,f.Recap)
        V48Assert(!!InStr(check.Text,"(+2, Intensify Rage)")=(delay>=600 && delay<=1200),"bounded completion correlation: " delay)
    }
    f := V647BossFixture(),V6410IntensifyCast(f),V647BossRage(f,12800,8),V647BossEnd(f)
    V48Assert(!InStr(IBCCheck(f.Pull,f.Recap).Text,"Intensify Rage"),"unknown prior count cannot invent a two-point increase")
    f := V647BossFixture(),V647BossRage(f,5000,6),V6410IntensifyCast(f,12000,999)
    V647BossRage(f,12800,8),V647BossEnd(f)
    V48Assert(!InStr(IBCCheck(f.Pull,f.Recap).Text,"Intensify Rage"),"another Tyth instance cannot explain this gain")
    f := V647BossFixture(),V647BossRage(f,5000,6),V6410IntensifyCast(f)
    V647BossRage(f,12700,8),V647BossRage(f,12900,10),V647BossEnd(f)
    V48Assert(!InStr(IBCCheck(f.Pull,f.Recap).Text,"Intensify Rage"),"one cast matching two positive gains is not spent twice")
    f := V647BossFixture(),V647BossRage(f,5000,6),V6410IntensifyCast(f),V6410IntensifyCast(f,12100)
    V647BossRage(f,12900,8),V647BossEnd(f)
    V48Assert(!InStr(IBCCheck(f.Pull,f.Recap).Text,"Intensify Rage"),"two cast markers matching one gain remain ambiguous")
    f := V647BossFixture(),V647BossRage(f,5000,6),V6410IntensifyCast(f,13200)
    V647BossEnd(f,false),V647BossRage(f,14000,8),IBCFreeze(f.Seg,f.Recap)
    V48Assert(!InStr(IBCCheck(f.Pull,f.Recap).Text,"Intensify Rage"),"same-timestamp positive update after Overload record is excluded")
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossRage(f,13200,8),V647BossEnd(f,false)
    V6410IntensifyCast(f,14000),IBCFreeze(f.Seg,f.Recap)
    V48Assert(!InStr(IBCCheck(f.Pull,f.Recap).Text,"Intensify Rage"),"post-Overload cast cannot explain an earlier increase")
    f := V647BossFixture(),V647BossRage(f,5000,6),V6410IntensifyCast(f),V647BossRage(f,12800,8)
    V648ReductionFeed(f,"grace-heal",12801),V647BossEnd(f)
    V48Assert(InStr(IBCCheck(f.Pull,f.Recap).Text,"(+2, cause unclear)"),"concurrent reduction prevents an overconfident exact allocation")
    ; Sep01 has an earlier +1 at cast+400ms, then the +2 at +807ms.
    ; Keep the cast matcher bounded even when another death is nearby.
    f := V647BossFixture(),V647BossRage(f,5000,1),V6410IntensifyCast(f)
    early := V647BossRage(f,12400,2),V647BossKill(f,12401),later := V647BossRage(f,12807,4),V647BossEnd(f)
    history := IBCDebugCheck(f.Pull,f.Recap).History
    V48Assert(!history.Intensify.Has(early.RecordId) && history.Intensify.Has(later.RecordId) && !history.Intensify[later.RecordId].Ambiguous,"an earlier +1 does not consume the cast or widen its observed completion window")
    ; Real initial applications can report one even when a later decay
    ; still reports one. Preserve the log; do not invent the hidden stack.
    f := V647BossFixture(),boss := V647BossNPC("4078423634870272",700)
    V647BossFeed(f,5000,boss,"=","4086833180835840","836045448945478","4086833180836195")
    V6410IntensifyCast(f)
    V647BossFeed(f,12800,boss,"=","4086833180835840","836045448945477","4086833180836195","(1 charges {836045448953667})")
    V647BossEnd(f),check := IBCCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"(+1, possible Intensify Rage)") && !InStr(check.Text,"add kill") && !InStr(check.Text,"(+2"),"exact initial one-stack application keeps a qualified cast label without a confirmed kill or invented two-stack gain")
    rageRows := V6410IntensifyRows(f,"rage")
    V48Assert(rageRows[rageRows.Length].Charges=1,"initial stack ambiguity does not rewrite the explicit logged count")
    f.Recap.BossEvidence := IBCUnpackEvidence(IBCPackEvidence(f.Recap.BossEvidence),f.Pull,f.Recap)
    V48Assert(IBCCheck(f.Pull,f.Recap).Text=check.Text,"initial count uncertainty survives save and reload")
}

V6410IntensifyStops()
{
    for scenario in ["self-cancel","self-interrupt","player-tail","other-boss","wrong-ability","unidentified","after-gain","self-failed","failed-other-boss","failed-other-ability","failed-player-interrupt","failed-after-gain"] {
        f := V647BossFixture(),V647BossRage(f,5000,6),V6410IntensifyCast(f)
        boss := V647BossNPC("4078423634870272",scenario="other-boss" ? 999 : 700)
        if scenario="self-failed" || InStr(scenario,"failed-")=1 {
            failedBoss := V647BossNPC("4078423634870272",scenario="failed-other-boss" ? 999 : 700)
            failedAbility := scenario="failed-other-ability" ? "4088443793571840" : "4076018453184512"
            if scenario="failed-player-interrupt"
                V647BossFeed(f,12400,"@Player#1|(100/100)",failedBoss,"1","836045448945472","836045448945499","(Intensify Rage {4076018453184512})")
            else
                V647BossFeed(f,scenario="failed-after-gain" ? 12801 : 12400,failedBoss,"=",failedAbility,"836045448945472","836045448945499")
        } else if scenario="self-cancel" || scenario="self-interrupt"
            V647BossFeed(f,12400,boss,"=","4076018453184512","836045448945472",scenario="self-cancel" ? "836045448945481" : "836045448945482")
        else {
            tail := scenario="wrong-ability" ? "(Other {4088443793571840})" : (scenario="unidentified" ? "" : "(Intensify Rage {4076018453184512})")
            V647BossFeed(f,scenario="after-gain" ? 12801 : 12400,"@Player#1|(100/100)",boss,"1","836045448945472","836045448945482",tail)
        }
        V647BossRage(f,12800,8),V647BossEnd(f),check := IBCCheck(f.Pull,f.Recap)
        blocked := scenario="self-cancel" || scenario="self-interrupt" || scenario="player-tail" || scenario="self-failed"
        V48Assert(!!InStr(check.Text,"(+2, Intensify Rage)")=!blocked,"only an identified same-boss stop before the increase excludes the cast: " scenario)
        if blocked
            V48Assert(V6410IntensifyRows(f,"intensify-stop").Length=1,"explicit stop survives evidence capture")
    }
}

V6410IntensifyBudget()
{
    for delta in [2,3,4,5,6] {
        f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000),V6410IntensifyCast(f,12000)
        V647BossRage(f,12800,6+delta),V647BossZero(f,12810),V647BossEnd(f),check := IBCCheck(f.Pull,f.Recap)
        if delta<5
            V48Assert(!InStr(check.Text,"possible cleave") && InStr(check.Text,"cause unclear"),"two reserved Rage cannot also fund a three-point cleave: " delta)
        else
            V48Assert(InStr(check.Text,"Intensify Rage; possible cleave") && InStr(check.Summary,"1 possible cleave"),"five supports two Intensify plus three cleave: " delta)
    }
    f := V647BossFixture(),V647BossRage(f,5000,6),V6410IntensifyCast(f),V647BossRage(f,12800,9)
    V647BossKill(f,12810),V647BossEnd(f)
    V48Assert(InStr(IBCCheck(f.Pull,f.Recap).Text,"(+3, Intensify Rage; add kill)"),"three can fund Intensify plus one distinct ordinary kill")
    f := V647BossFixture(),V647BossRage(f,5000,6),V6410IntensifyCast(f),V647BossRage(f,12800,8)
    V647BossKill(f,12810),V647BossEnd(f)
    V48Assert(InStr(IBCCheck(f.Pull,f.Recap).Text,"(+2, cause unclear)"),"ordinary kill plus Intensify exceeding the observed net gain stays uncertain")
    f := V647BossFixture(),V647BossRage(f,5000,6),V6410IntensifyCast(f),V647BossRage(f,12800,8)
    V647BossKill(f,13100),V647BossRage(f,13400,9),V647BossEnd(f)
    check := IBCCheck(f.Pull,f.Recap)
    V48Assert(InStr(check.Text,"(+2, cause unclear)") && !InStr(check.Text,"(+2, Intensify Rage)"),"a kill shared by adjacent increases still competes with the first increase's Intensify budget")
    f := V6410IntensifyFixture(1)
    V48Assert(InStr(IBCCheck(f.Pull,f.Recap).Text,"(+1, cause unclear)"),"insufficient net gain never fabricates an Intensify contribution")
}

V6410IntensifyPersistence()
{
    f := V6410IntensifyFixture(),e := f.Recap.BossEvidence,packed := IBCPackEvidence(e)
    text := IGVJson(packed),copy := IBCUnpackEvidence(IGJParse(text),f.Pull,f.Recap)
    V48Assert(copy.Version=7 && IGVJson(IBCPackEvidence(copy))=text,"current cast evidence roundtrips without mutation")
    f.Recap.BossEvidence := copy
    V48Assert(InStr(IBCCheck(f.Pull,f.Recap).Text,"Intensify Rage"),"saved current report retains its explanation")
    legacyFour := IBCCloneEvidence(e),legacyFour.Version := 4,legacyFour.Profile := "tyth-rage-v4"
    legacyText := IGVJson(IBCPackEvidence(legacyFour)),legacyCopy := IBCUnpackEvidence(IGJParse(legacyText),f.Pull,f.Recap)
    V48Assert(legacyCopy.Version=4 && IGVJson(IBCPackEvidence(legacyCopy))=legacyText,"legacy version-four Intensify rows roundtrip unchanged")
    for version in [1,2,3] {
        bad := IPRCloneSnapshot(packed),bad[1] := version,bad[2] := "tyth-rage-v" version
        V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"legacy payload cannot claim a new Intensify kind")
        old := IBCCloneEvidence(e),old.Version := version,old.Profile := "tyth-rage-v" version
        V64Reject((*)=>IBCPackEvidence(old),"packing never hides a new row under an old capability version")
        legacy := V647BossPositive(),legacy.Recap.BossEvidence.Version := version,legacy.Recap.BossEvidence.Profile := "tyth-rage-v" version
        original := IGVJson(IBCPackEvidence(legacy.Recap.BossEvidence))
        copy := IBCUnpackEvidence(IGJParse(original),legacy.Pull,legacy.Recap)
        V48Assert(copy.Version=version && IGVJson(IBCPackEvidence(copy))=original,"old evidence version remains byte-identical: " version)
    }
    for field in [4,8,15,16] {
        bad := IPRCloneSnapshot(packed)
        for row in bad[6] {
            if row[3]="intensify-cast"
                row[field] := field=15 ? "4095826842353664" : "@Wrong#9"
        }
        V64Reject((*)=>IBCUnpackEvidence(bad,f.Pull,f.Recap),"persisted casts require exact boss, source, ability and target")
    }
}

; Energy Wave report regressions. Synthetic unless a test explicitly says otherwise.
V6411BossWave(f,at,instance := 701,id := "4078445109706752",tail := "(0 -)",hp := 1000)
{
    return V647BossFeed(f,at,V647BossNPC("4078423634870272",700),V647BossNPC(id,instance,hp),
        "4081339917664256","836045448945477","836045448945501",tail)
}

V6411WavePositive()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V6411BossWave(f,11000)
    V647BossRage(f,13090,9),V647BossZero(f,13100)
    return V647BossEnd(f)
}

V6411WaveRows(f)
{
    out := []
    for r in IBCOrdered(f.Seg.BossCheckState.Rows) {
        if r.Kind="wave"
            out.Push(r)
    }
    return out
}

V6411WaveCapture()
{
    f := V647BossFixture(),ev := V6411BossWave(f,11000,,,"(400 ~250 energy {836045448940874}) <123.0>")
    row := V6411WaveRows(f)[1]
    V48Assert(row.Kind="wave" && row.Ability="4081339917664256" && row.Source=row.Boss && row.Target=row.Actor,"exact Tyth Wave preserves the scoped actor and operation ability")
    V48Assert(row.Amount=250 && row.Amount=ev.Effective && !row.Avoided,"Wave retains prior effective add-damage amount semantics")
    V647BossFeed(f,11100,"@Killer#2|(1000/1000)",V647BossNPC(),"4081339917664256","836045448945477","836045448945501","(0 -)")
    V647BossFeed(f,11200,V647BossNPC("4078423634870272",700),"@Victim#1|(1000/1000)","4081339917664256","836045448945477","836045448945501","(0 -)")
    V647BossFeed(f,11300,V647BossNPC("4078423634870272",700),V647BossNPC(),"4081339917664257","836045448945477","836045448945501","(0 -)")
    V48Assert(V6411WaveRows(f).Length=1,"player-sourced Wave, player target and adjacent ability ID cannot seed an add cleave")
    V647BossEnd(f)
    V48Assert(f.Recap.BossEvidence.Version=7 && f.Recap.BossEvidence.Profile="tyth-rage-v7","fresh Wave evidence uses current version seven")
}

V6411WaveCleave()
{
    f := V6411WavePositive(),debug := IBCDebugCheck(f.Pull,f.Recap),short := IBCCheck(f.Pull,f.Recap)
    V48Assert(debug.History.Possible=1 && InStr(debug.Text,"cleave: Energy Wave contact at 1000 HP"),"neutral Wave contact plus same-instance delayed zero and observed +3 supports one possible cleave")
    V48Assert(InStr(debug.Text,"2.100 s later") && !InStr(debug.Text,"Sweep contact"),"Wave diagnostic names the recorded attack and actual delay")
    V48Assert(InStr(short.Text,"possible cleave") && !InStr(short.Text,"failure"),"the concise user label stays possible cleave without blame")
    for r in f.Recap.BossEvidence.Rows {
        if r.Kind="rage" && r.Charges=9
            r.Charges := 8
    }
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"observed +2 does not fund a three-total-Rage Wave cleave")
    for hp in [0,-1] {
        f := V647BossFixture(),V647BossRage(f,5000,6)
        if hp=0
            V6411BossWave(f,11000,,,,0)
        else
            V647BossFeed(f,11000,V647BossNPC("4078423634870272",700),"Guardian {4078445109706752}:701","4081339917664256","836045448945477","836045448945501","(0 -)")
        V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
        V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"zero or unknown HP contact cannot establish a living add")
    }
    f := V647BossFixture(),V647BossRage(f,5000,6),V6411BossWave(f,11000),V647BossRage(f,13499,9),V647BossZero(f,13500),V647BossEnd(f)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=1,"Wave zero at the 2500ms contact boundary remains eligible")
    f := V647BossFixture(),V647BossRage(f,5000,6),V6411BossWave(f,11000),V647BossRage(f,13500,9),V647BossZero(f,13501),V647BossEnd(f)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"Wave zero after the 2500ms contact boundary remains ineligible")
    V6411WaveRealEvidence()
}

V6411WaveRealEvidence()
{
    ; Exact anonymized Sep22 records selected from source112699-113520.
    ; The next Overload is outside the 30-second window: this tests contact,
    ; count and add-death evidence without inventing a player death association.
    raw := "
    (
    [19:21:15.242] [TYTH {4078423634870272}:1594000813766|(781.16,2353.26,228.52,158.65)|(10278078/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (4 charges {836045448953667})
    [19:21:19.243] [TYTH {4078423634870272}:1594000813766|(785.15,2353.76,228.52,-89.03)|(10020826/19989636)] [Guardian {4078445109706752}:1594000924720|(782.72,2349.65,228.52,166.81)|(334414/340388)] [Energy Wave {4081339917664256}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)
    [19:21:19.791] [@Player03#690553544437259|(782.07,2365.07,229.00,-104.25)|(170193/443604)] [Guardian {4078445109706752}:1594000924720|(782.58,2349.97,228.52,167.55)|(310947/340388)] [Dual Saber Throw {3066602354376704}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22618* energy {836045448940874}) <16963.0>
    [19:21:19.791] [@Player03#690553544437259|(782.07,2365.07,229.00,-104.25)|(170193/443604)] [Guardian {4078445109706752}:1594000924720|(782.58,2349.97,228.52,167.55)|(310947/340388)] [Dual Saber Throw {3066602354376704}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (849* energy {836045448940874}) <637.0>
    [19:21:20.270] [@Player07#689906611572637|(788.15,2339.69,228.52,171.02)|(186317/443752)] [Guardian {4078445109706752}:1594000924720|(782.58,2349.97,228.52,167.55)|(310947/340388)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5974 elemental {836045448940875}) <4481.0>
    [19:21:21.114] [@Player07#689906611572637|(787.76,2343.38,228.52,161.59)|(154089/443752)] [Guardian {4078445109706752}:1594000924720|(782.58,2349.97,228.52,167.55)|(304179/340388)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6768 elemental {836045448940875}) <5076.0>
    [19:21:21.241] [TYTH {4078423634870272}:1594000813766|(793.35,2352.85,228.52,-90.44)|(9801712/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (7 charges {836045448953667})
    [19:21:21.244] [Guardian {4078445109706752}:1594000924720|(782.58,2349.97,228.52,167.55)|(0/340388)] [] [] [Event {836045448945472}: TargetCleared {836045448953669}]
    [19:21:21.248] [Guardian {4078445109706752}:1594000924720|(782.58,2349.97,228.52,167.55)|(0/340388)] [@Player04#689781712453319|(783.66,2352.05,228.52,-128.18)|(206215/443782)] [Volatile Platform {4176645241962496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (27627 internal {836045448940876}) <27627.0>
    [19:21:21.251] [Guardian {4078445109706752}:1594000924720|(782.58,2349.97,228.52,167.55)|(0/340388)] [=] [] [Event {836045448945472}: Death {836045448945493}]
    )"
    f := V647BossFixture(),boss := "N:4078423634870272:1594000813766:TYTH",f.Seg.BossActors := Map(boss,"boss")
    Loop Parse raw,"`n","`r" {
        ev := IPParseLine(Trim(A_LoopField))
        V48Assert(IsObject(ev) && ev.ValueOK,"exact anonymized Sep22 Wave record parses")
        ev.RecordId := f.Next,f.Next += 1
        if f.Seg.Start=0
            f.Seg.Start := ev.RawMs-1000
        IBCObserve(f.Seg,ev,ev.RawMs)
    }
    rows := IBCOrdered(f.Seg.BossCheckState.Rows),counts := []
    for row in rows {
        if row.Kind="rage"
            counts.Push(row)
    }
    candidates := IBCCleaveCandidates(rows,boss,f.Seg.Start,ev.RawMs),c := candidates[1]
    V48Assert(candidates.Length=1 && c.Attack="Energy Wave" && c.Contact && !c.Competing && c.HP=334414,"real Sep22 Wave provides one living Guardian contact without competing lethal evidence")
    V48Assert(c.Zero-c.At=2001 && c.DeathAt-c.At=2008 && counts[2].At-c.Zero=-3,"real delayed source-zero and self-death retain exact chronology including Rage before zero")
    V48Assert(counts[2].Charges-counts[1].Charges=3 && c.Damage=36209 && IBCOrdinaryKills(rows,boss,counts[2]).Count=0,"real observed +3 is not consumed by 36209 nonlethal player damage or outgoing corpse damage")
}

V6411WaveAvoidance()
{
    for id in ["836045448945502","836045448945503","836045448945504","836045448945505","836045448945507"] {
        f := V647BossFixture(),V647BossRage(f,5000,6)
        ev := V6411BossWave(f,11000,,,"(0 avoided {" id "})")
        V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
        check := IBCDebugCheck(f.Pull,f.Recap)
        V48Assert(ev.BossAvoided && V6411WaveRows(f)[1].Avoided && check.History.Possible=0,"Wave avoidance ID " id " remains non-contact despite nearby Rage/death")
        V48Assert(InStr(check.Text,"avoidance-only Energy Wave"),"avoided Wave is not mislabeled Sweep")
    }
    f := V647BossFixture(),V647BossRage(f,5000,6),V6411BossWave(f,11000,,,"(0 dodge {836045448945505})",500)
    V6411BossWave(f,11020,,,,900),V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(check.History.Possible=1 && InStr(check.Text,"Energy Wave contact at 900 HP") && InStr(check.Text,"2.080 s later"),"usable neutral packet replaces avoidance anchor with its own HP/time")
}

V6411WaveCompetition()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V6411BossWave(f,11000),V647BossRage(f,13090,9),V647BossZero(f,13100,702),V647BossEnd(f)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"another add instance cannot supply Wave death evidence")
    f := V6411WavePositive(),V647BossKill(f,13101),IBCFreeze(f.Seg,f.Recap)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"explicit external killing source disqualifies the Wave candidate")
    f := V6411WavePositive(),V647BossKill(f,13101,702),IBCFreeze(f.Seg,f.Recap)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"ordinary other-add kill reserves one Rage before Wave budget")
    for r in f.Recap.BossEvidence.Rows {
        if r.Kind="rage" && r.Charges=9
            r.Charges := 10
    }
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=1,"observed +4 can support one ordinary kill and one Wave cleave")
    for laterKind in ["wave","sweep"] {
        f := V6411WavePositive(),ev := laterKind="wave" ? V6411BossWave(f,13110,,,,900) : V647BossSweep(f,13110,,,,900)
        ; Strip the independently emitted transition to exercise positive-HP
        ; contact itself, including out-of-order metadata where no transition exists.
        remove := []
        for key,r in f.Seg.BossCheckState.Rows {
            if r.Kind="add-alive"
                remove.Push(key)
        }
        for key in remove
            f.Seg.BossCheckState.Rows.Delete(key)
        IBCFreeze(f.Seg,f.Recap)
        V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"later living " laterKind " contact contradicts prior zero even without a separate transition row")
    }
}

V6411WaveOverlapBudget()
{
    for spacing in [20,100] {
        f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000),V6411BossWave(f,11000+spacing)
        V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f),check := IBCDebugCheck(f.Pull,f.Recap)
        V48Assert(check.History.Possible=1 && InStr(check.Text,"cleave: Energy Wave contact"),"overlapping Sweep/Wave before one death reserve one +3 and name latest usable contact")
        for r in f.Recap.BossEvidence.Rows {
            if r.Kind="rage" && r.Charges=9
                r.Charges := 12
        }
        V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=1,"extra available Rage cannot count the same add death twice")
    }
    f := V647BossFixture(),V647BossRage(f,5000,6),V6411BossWave(f,11000),V647BossSweep(f,11100)
    V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Text,"cleave: Sweep contact"),"reverse overlap names the actual latest Sweep contact")
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000),V6411BossWave(f,11020,702,"4078449404674048")
    V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossZero(f,13101,702,"4078449404674048"),V647BossEnd(f)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"different adds cannot each receive the same single +3")
    for r in f.Recap.BossEvidence.Rows {
        if r.Kind="rage" && r.Charges=9
            r.Charges := 12
    }
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=2,"a shared +6 may support two distinct Sweep/Wave add deaths")
}

V6411WavePersistence()
{
    f := V6411WavePositive(),original := IBCCheck(f.Pull,f.Recap),packed := IBCPackEvidence(f.Recap.BossEvidence)
    restored := f.Recap.Clone(),restored.BossEvidence := IBCUnpackEvidence(packed,f.Pull,f.Recap)
    V48Assert(IGVJson(packed)=IGVJson(IBCPackEvidence(restored.BossEvidence)) && IBCCheck(f.Pull,restored).Text=original.Text,"v5 Wave payload and concise report round-trip exactly")
    rowIndex := 0
    for i,row in packed[6] {
        if row[3]="wave"
            rowIndex := i
    }
    for field,value in Map(4,"N:4078423634870272:999:Tyth",8,"@Fake#2",15,"4080279060742144",16,"N:4078445109706752:999:Guardian") {
        bad := IPRCloneSnapshot(packed),bad[6][rowIndex][field] := value
        V64Reject((*) => IBCUnpackEvidence(bad,f.Pull,f.Recap),"Wave rejects inconsistent source/boss/ability/target field " field)
    }
    bad := IPRCloneSnapshot(packed),bad[1] := 4,bad[2] := "tyth-rage-v4"
    V64Reject((*) => IBCUnpackEvidence(bad,f.Pull,f.Recap),"legacy v4 cannot claim newly annotated Wave evidence")
    old := IBCCloneEvidence(f.Recap.BossEvidence),old.Version := 4,old.Profile := "tyth-rage-v4"
    V64Reject((*) => IBCPackEvidence(old),"packer will not write Wave rows under legacy version four")
    for version in [1,2,3,4] {
        prior := V647BossPositive(),e := IBCCloneEvidence(prior.Recap.BossEvidence),e.Version := version,e.Profile := "tyth-rage-v" version
        p := IBCPackEvidence(e),loaded := IBCUnpackEvidence(p,prior.Pull,prior.Recap)
        V48Assert(IGVJson(p)=IGVJson(IBCPackEvidence(loaded)),"explicit legacy version " version " remains readable and packable")
    }
    ; A v4 Wave was generic add damage without avoided/contact evidence.
    for row in old.Rows {
        if row.Kind="wave"
            row.Kind := "add-damage",row.Avoided := false
    }
    restored.BossEvidence := IBCUnpackEvidence(IBCPackEvidence(old),f.Pull,f.Recap)
    V48Assert(IBCDebugCheck(f.Pull,restored).History.Possible=0,"legacy generic Wave damage is not retroactively treated as a verified neutral contact")
    V48Assert(InStr(IBCCheck(f.Pull,restored).Text,"Re-add this log to check Energy Wave cleaves"),"legacy Wave context explains its missing avoidance evidence without implying a complete check")
    clone := IBCCloneEvidence(f.Recap.BossEvidence),clone.Rows[rowIndex].Avoided := true
    V48Assert(IBCCheck(f.Pull,f.Recap).Text=original.Text,"mutating a public clone cannot corrupt saved Wave evidence")
}

V6411WaveLateRollback()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
    id := IDTCaseKey(f.Recap),f.Seg.DeathCapture.Cases[id] := f.Recap,before := IGVJson(IBCPackEvidence(f.Recap.BossEvidence))
    IPBBeginUndo(f.Data,f.Seg)
    V6411BossWave(f,11000)
    updated := f.Seg.DeathCapture.Cases[id]
    V48Assert(IBCDebugCheck(f.Pull,updated).History.Possible=1,"late pre-death Wave evidence updates a recent frozen death case in chronological order")
    V48Assert(IGVJson(IBCPackEvidence(f.Recap.BossEvidence))=before,"previously published Wave-free case remains immutable")
    IPBRollbackTail(f.Data,f.Seg)
    V48Assert(IGVJson(IBCPackEvidence(f.Seg.DeathCapture.Cases[id].BossEvidence))=before && V6411WaveRows(f).Length=0,"rollback removes speculative Wave and restores the exact frozen case")
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossZero(f,11000),V6411BossWave(f,11000)
    V647BossRage(f,13090,9),V647BossEnd(f)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"same-time zero recorded before Wave is not later death evidence")
}

; Native detection/queue tests only. Uses V647Live* isolation fixtures.
; No audio worker, HTTP, game input, live app or user settings.
; Groups: V6411LiveWaveContacts, V6411LiveWaveRejections,
; V6411LiveWaveAvoidance, V6411LiveWaveGuards, V6411LiveWaveMuteAndDedup.

V6411LiveWave(f,at := 100,tail := "(0 -)",target := "",source := "")
{
    V647LiveEvent(at,source!="" ? source : f.Boss,target!="" ? target : f.Add,
        "Energy Wave {4081339917664256}","[ApplyEffect {836045448945477}: Damage {836045448945501}] " tail)
}

V6411LiveWaveSettle(f,zeroAt := 400,gain := 9)
{
    V647LiveZero(f,zeroAt),V647LiveRage(f,zeroAt+10,gain),V647LiveHeartbeat(f,zeroAt+600)
}

V6411LiveWaveContacts()
{
    global TythCleave,tythBossInstance
    for id,addType in Map("4078445109706752","Guardian","4078440814739456","Grace","4078449404674048","Lance","4078432224804864","Justice") {
        f := V647LiveSetup(id),V647LiveRage(f,0,6),V6411LiveWave(f)
        V48Assert(TythCleave.Candidates.Has(f.Instance) && TythCleave.Candidates[f.Instance].Ability="4081339917664256","Wave anchors a living known " addType)
        V6411LiveWaveSettle(f)
        V48Assert(V647LiveCount("Cleave" addType)=1,"Wave uses the existing possible-" addType "-cleave request")
    }
    f := V647LiveSetup(),V647LiveRage(f,0,6),V6411LiveWave(f,100,"(47 energy {836045448940874})")
    V6411LiveWaveSettle(f,2200,8)
    V48Assert(V647LiveCount("CleaveGuardian")=1,"nonzero contact and delayed zero preserve the historical live +2 policy")
    ; Reduced real Sep22 sequence, source combat_2026-09-22_18_28_01_255106.txt
    ; SHA256 d0b78ec433f5b0276255d71b2cf902773ea1e93a1225d89f7239ec98b858ae40.
    ; Source L112876 is time zero (19:21:15.242). L113114 Wave, four player
    ; damage rows, L113213 Rage, L113214 zero, L113237 self Death preserve
    ; original order/deltas, NPC identities, add HP and damage values.
    f := V647LiveSetup("4078445109706752","1594000924720",334414,340388)
    tythBossInstance := "1594000813766",f.Boss := V647LiveNPC("4078423634870272",tythBossInstance,10278078,19989636)
    V647LiveRage(f,0,4)
    f.Boss := V647LiveNPC("4078423634870272",tythBossInstance,10020826,19989636)
    V6411LiveWave(f,4001)
    for hit in [[4549,310947,"Dual Saber Throw {3066602354376704}","(22618* energy {836045448940874}) <16963.0>"],
        [4549,310947,"Dual Saber Throw {3066602354376704}","(849* energy {836045448940874}) <637.0>"],
        [5028,310947,"Scorch {3384812186370048}","(5974 elemental {836045448940875}) <4481.0>"],
        [5872,304179,"Incendiary Missile {2027022700249088}","(6768 elemental {836045448940875}) <5076.0>"]] {
        V647LiveEvent(hit[1],f.Player,V647LiveNPC(f.Id,f.Instance,hit[2],340388),hit[3],
            "[ApplyEffect {836045448945477}: Damage {836045448945501}] " hit[4])
    }
    V48Assert(TythCleave.Candidates[f.Instance].Damage=36209 && !TythCleave.Candidates[f.Instance].Explained,"real Sep22 intervening player damage is nonlethal and not confused with threat")
    f.Boss := V647LiveNPC("4078423634870272",tythBossInstance,9801712,19989636)
    V647LiveRage(f,5999,7),V647LiveZero(f,6002),V647LiveDeath(f,6009),V647LiveHeartbeat(f,6658)
    V48Assert(V647LiveCount("CleaveGuardian")=1,"real Sep22 Wave-to-zero2001ms sequence requests the existing Guardian cleave call once")
}

V6411LiveWaveRejections()
{
    global TythCleave
    for scenario in ["player-source","other-boss","other-ability","cast-only","zero-contact","unknown-hp","other-npc","player-target"] {
        f := V647LiveSetup(),V647LiveRage(f,0,6)
        if scenario="player-source"
            V6411LiveWave(f,100,"(0 -)",f.Add,f.Player)
        else if scenario="other-boss"
            V6411LiveWave(f,100,"(0 -)",f.Add,V647LiveNPC("4078423634870272","999",900,1000))
        else if scenario="other-ability"
            V647LiveEvent(100,f.Boss,f.Add,"Other {4081339917664257}","[ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)")
        else if scenario="cast-only"
            V647LiveEvent(100,f.Boss,f.Add,"Energy Wave {4081339917664256}","[Event {836045448945472}: AbilityActivate {836045448945479}]")
        else if scenario="zero-contact"
            V6411LiveWave(f,100,"(0 -)",f.Zero)
        else if scenario="unknown-hp"
            V6411LiveWave(f,100,"(0 -)","NPC {4078445109706752}:101")
        else if scenario="other-npc"
            V6411LiveWave(f,100,"(0 -)",V647LiveNPC("12345","101"))
        else
            V6411LiveWave(f,100,"(0 -)",f.Player)
        V48Assert(TythCleave.Candidates.Count=0,"invalid Wave evidence cannot create an anchor: " scenario)
        V6411LiveWaveSettle(f)
        V48Assert(V647LiveCount("CleaveGuardian")=0,"invalid Wave evidence cannot queue a call: " scenario)
    }
}

V6411LiveWaveAvoidance()
{
    for id in ["836045448945502","836045448945503","836045448945504","836045448945505","836045448945507"] {
        f := V647LiveSetup(),V647LiveRage(f,0,6),V6411LiveWave(f,100,"(0 avoidance {" id "})")
        V6411LiveWaveSettle(f)
        V48Assert(V647LiveCount("CleaveGuardian")=0,"exact avoidance ID cannot become Wave contact: " id)
    }
    for label in ["miss","dodge","parry","deflect","resist"] {
        f := V647LiveSetup(),V647LiveRage(f,0,6),V6411LiveWave(f,100,"(0 -" label ")")
        V6411LiveWaveSettle(f)
        V48Assert(V647LiveCount("CleaveGuardian")=0,"untagged avoidance remains excluded: " label)
    }
    f := V647LiveSetup(),V647LiveRage(f,0,6),V6411LiveWave(f,100,"(0 avoidance {836045448945505})")
    V6411LiveWave(f,150),V6411LiveWaveSettle(f)
    V48Assert(V647LiveCount("CleaveGuardian")=1,"a later neutral contact can qualify after an avoided hit")
}

V6411LiveWaveGuards()
{
    for scenario in ["unknown-rage","late-zero","player-lethal","external-death","alive-after-zero"] {
        f := V647LiveSetup()
        if scenario!="unknown-rage"
            V647LiveRage(f,0,6)
        V6411LiveWave(f)
        if scenario="late-zero"
            V6411LiveWaveSettle(f,2700)
        else {
            if scenario="player-lethal"
                V647LiveDamage(f,400,5)
            else
                V647LiveZero(f,400)
            if scenario="external-death"
                V647LiveDeath(f,410,f.Player,f.Zero)
            else if scenario="alive-after-zero"
                V647LiveEvent(410,f.Add,"=","Metadata {1}","[Event {2}: Event {3}]")
            V647LiveRage(f,420,9),V647LiveHeartbeat(f,1000)
        }
        V48Assert(V647LiveCount("CleaveGuardian")=0,"Wave preserves competing evidence and timing guard: " scenario)
    }
    f := V647LiveSetup(),V647LiveRage(f,0,6),V6411LiveWave(f),V647LiveZero(f,400),V647LiveDeath(f,410)
    V647LiveRage(f,420,9),V647LiveDamage(f,430,5),V647LiveHeartbeat(f,1000)
    V48Assert(V647LiveCount("CleaveGuardian")=1,"strictly post-Death corpse damage does not suppress a Wave candidate")
}

V6411LiveWaveMuteAndDedup()
{
    global Audio,TythCleave,TythExtraAlerts,soundboardsEnabled
    for scenario in ["mute-at-contact","mute-during","toggle-during","epoch-change"] {
        f := V647LiveSetup(),V647LiveRage(f,0,6)
        if scenario="mute-at-contact"
            soundboardsEnabled := false
        V6411LiveWave(f)
        if scenario="mute-during"
            soundboardsEnabled := false
        else if scenario="toggle-during"
            TythExtraAlerts["CleaveGuardian"].Enabled := false
        else if scenario="epoch-change"
            Audio.Epoch += 1
        V647LiveHeartbeat(f,200)
        soundboardsEnabled := true,TythExtraAlerts["CleaveGuardian"].Enabled := true
        V6411LiveWaveSettle(f)
        V48Assert(V647LiveCount("CleaveGuardian")=0 && TythCleave.Seen.Has(f.Instance),"a consumed Wave opportunity never replays after audio state changes: " scenario)
    }
    f := V647LiveSetup(),V647LiveRage(f,0,6),V6411LiveWave(f),V647LiveSweep(f,150),V6411LiveWave(f,200)
    V6411LiveWaveSettle(f)
    V6411LiveWave(f,1100),V647LiveSweep(f,1150),V647LiveRage(f,1200,12),V647LiveHeartbeat(f,2000)
    V48Assert(V647LiveCount("CleaveGuardian")=1,"Wave and Sweep contacts share one per-add deduplication lifecycle")
}

; Melee friendly fire, boundary context and distinct simultaneous Grace heals.
; Synthetic unless a fixture explicitly identifies verbatim raw records.
; Groups: V6412MeleeCapture, V6412MeleeCleave, V6412MeleeGuards,
; V6412MeleeSharedDeath, V6412MeleePersistence, V6412RageContextBoundary,
; V6412PairedGraceHeals, V6412PairedGraceGuards, V6412RageLateRollback,
; V6412RageRawEvidence, V6412OverloadCastAssociation.

V6412BossMelee(f,at,instance := 701,id := "4078445109706752",tail := "(0 -)",hp := 1000)
{
    return V647BossFeed(f,at,V647BossNPC("4078423634870272",700),V647BossNPC(id,instance,hp),
        "4080283355709440","836045448945477","836045448945501",tail)
}

V6412MeleeRows(f)
{
    out := []
    for row in IBCOrdered(f.Seg.BossCheckState.Rows) {
        if row.Kind="melee"
            out.Push(row)
    }
    return out
}

V6412MeleePositive()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V6412BossMelee(f,11000)
    V647BossRage(f,13090,9),V647BossZero(f,13100)
    return V647BossEnd(f)
}

V6412MeleeCapture()
{
    f := V647BossFixture(),ev := V6412BossMelee(f,11000,,,"(400 ~250 energy {836045448940874}) <123.0>")
    row := V6412MeleeRows(f)[1]
    V48Assert(row.Kind="melee" && row.Ability="4080283355709440" && row.Source=row.Boss && row.Target=row.Actor,"exact Tyth Melee contact preserves the operation ability and same-add identity")
    V48Assert(row.Amount=250 && row.Amount=ev.Effective && !row.Avoided,"Melee keeps its former effective generic-damage value")
    V647BossFeed(f,11100,"@Killer#2|(1000/1000)",V647BossNPC(),"4080283355709440","836045448945477","836045448945501","(0 -)")
    V647BossFeed(f,11200,V647BossNPC("4078423634870272",700),"@Victim#1|(1000/1000)","4080283355709440","836045448945477","836045448945501","(0 -)")
    V647BossFeed(f,11300,V647BossNPC("4078423634870272",700),V647BossNPC(),"4080283355709441","836045448945477","836045448945501","(0 -)")
    V48Assert(V6412MeleeRows(f).Length=1,"player source, player target and adjacent ability ID cannot create a Melee add-contact")
    V647BossEnd(f)
    V48Assert(f.Recap.BossEvidence.Version=7 && f.Recap.BossEvidence.Profile="tyth-rage-v7","new Melee contact evidence advertises version seven")
}

V6412MeleeCleave()
{
    f := V6412MeleePositive(),debug := IBCDebugCheck(f.Pull,f.Recap),short := IBCCheck(f.Pull,f.Recap)
    V48Assert(debug.History.Possible=1 && InStr(debug.Text,"cleave: Melee Attack contact at 1000 HP"),"neutral Melee contact plus living HP, later same-add zero and +3 supports one possible cleave")
    V48Assert(InStr(short.Text,"(+3, possible cleave)") && !InStr(short.Text,"Melee Attack") && InStr(short.DebugText,"2.100 s later"),"normal wording stays short while debug names the actual attack")
    for delay in [2500,2501] {
        f := V647BossFixture(),V647BossRage(f,5000,6),V6412BossMelee(f,11000)
        V647BossRage(f,11000+delay-1,9),V647BossZero(f,11000+delay),V647BossEnd(f)
        V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=(delay=2500 ? 1 : 0),"Melee keeps the exact existing contact-to-zero boundary: " delay)
    }
    f := V647BossFixture(),V647BossRage(f,5000,6),V6412BossMelee(f,11000,,,"(0 dodge {836045448945505})",500)
    V6412BossMelee(f,11020,,,,900),V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
    V48Assert(InStr(IBCDebugCheck(f.Pull,f.Recap).Text,"Melee Attack contact at 900 HP"),"later usable packet replaces its avoided packet's HP and timestamp")
}

V6412MeleeGuards()
{
    for id in ["836045448945502","836045448945503","836045448945504","836045448945505","836045448945507"] {
        f := V647BossFixture(),V647BossRage(f,5000,6),ev := V6412BossMelee(f,11000,,,"(0 avoided {" id "})")
        V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
        check := IBCDebugCheck(f.Pull,f.Recap)
        V48Assert(ev.BossAvoided && V6412MeleeRows(f)[1].Avoided && check.History.Possible=0 && InStr(check.Text,"avoidance-only Melee Attack"),"Melee avoidance keeps exact numeric ID " id)
    }
    for scenario in ["zero-hp","unknown-hp","different-add","ordinary-kill","later-alive","insufficient-rage","different-mode","different-boss"] {
        f := V647BossFixture(),V647BossRage(f,5000,6)
        if scenario="unknown-hp"
            V647BossFeed(f,11000,V647BossNPC("4078423634870272",700),"Guardian {4078445109706752}:701","4080283355709440","836045448945477","836045448945501","(0 -)")
        else if scenario="different-boss"
            V647BossFeed(f,11000,V647BossNPC("4078423634870272",999),V647BossNPC(),"4080283355709440","836045448945477","836045448945501","(0 -)")
        else
            V6412BossMelee(f,11000,,,,scenario="zero-hp" ? 0 : 1000)
        V647BossRage(f,13090,scenario="insufficient-rage" ? 8 : 9)
        V647BossZero(f,13100,scenario="different-add" ? 702 : 701)
        if scenario="ordinary-kill"
            V647BossKill(f,13101)
        if scenario="later-alive"
            V6412BossMelee(f,13110,,,,900)
        if scenario="different-mode"
            f.Pull.Mode := "836045448953654"
        V647BossEnd(f)
        V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"Melee does not weaken " scenario " protection")
    }
}

V6412MeleeSharedDeath()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossSweep(f,11000),V6411BossWave(f,11020),V6412BossMelee(f,11100)
    V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f),check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(check.History.Possible=1 && InStr(check.Text,"cleave: Melee Attack contact"),"three attack kinds preceding one death share one +3 allocation and latest usable contact")
    for r in f.Recap.BossEvidence.Rows {
        if r.Kind="rage" && r.Charges=9
            r.Charges := 15
    }
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=1,"surplus Rage never counts one death as three cleaves")
    f := V647BossFixture(),V647BossRage(f,5000,6),V6412BossMelee(f,11000),V6411BossWave(f,11100,702,"4078449404674048")
    V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossZero(f,13101,702,"4078449404674048"),V647BossEnd(f)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"different adds cannot spend the same +3 independently")
    for r in f.Recap.BossEvidence.Rows {
        if r.Kind="rage" && r.Charges=9
            r.Charges := 12
    }
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=2,"+6 can support distinct Melee and Wave add deaths")
}

V6412MeleePersistence()
{
    f := V6412MeleePositive(),before := IBCCheck(f.Pull,f.Recap).Text,p := IBCPackEvidence(f.Recap.BossEvidence)
    restored := IBCUnpackEvidence(IGJParse(IGVJson(p)),f.Pull,f.Recap)
    V48Assert(IGVJson(IBCPackEvidence(restored))=IGVJson(p),"version-six Melee evidence survives strict JSON roundtrip")
    f.Recap.BossEvidence := restored
    V48Assert(IBCCheck(f.Pull,f.Recap).Text=before,"reopened Melee report retains its exact short interpretation")
    index := 0
    for i,row in p[6] {
        if row[3]="melee"
            index := i
    }
    for field,value in Map(4,"N:4078423634870272:999:Tyth",8,"@Fake#2",15,"4080279060742144",16,"N:4078445109706752:999:Guardian") {
        bad := IPRCloneSnapshot(p),bad[6][index][field] := value
        V64Reject((*) => IBCUnpackEvidence(bad,f.Pull,f.Recap),"Melee rejects inconsistent boss/source/ability/target field " field)
    }
    bad := IPRCloneSnapshot(p),bad[1] := 5,bad[2] := "tyth-rage-v5"
    V64Reject((*) => IBCUnpackEvidence(bad,f.Pull,f.Recap),"legacy version five cannot claim newly annotated Melee evidence")
    old := IBCCloneEvidence(restored),old.Version := 5,old.Profile := "tyth-rage-v5"
    V64Reject((*) => IBCPackEvidence(old),"packer rejects Melee under a legacy profile")
    for row in old.Rows {
        if row.Kind="melee"
            row.Kind := "add-damage",row.Avoided := false
    }
    legacy := IBCPackEvidence(old),f.Recap.BossEvidence := IBCUnpackEvidence(legacy,f.Pull,f.Recap)
    V48Assert(IGVJson(IBCPackEvidence(f.Recap.BossEvidence))=IGVJson(legacy),"legacy generic Melee remains byte-exact on roundtrip")
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0 && InStr(IBCCheck(f.Pull,f.Recap).Text,"Re-add this log to check Melee Attack cleaves"),"legacy generic damage is not retroactively promoted into known avoidance/contact evidence")
    wave := V6411WavePositive(),e := IBCCloneEvidence(wave.Recap.BossEvidence),e.Version := 5,e.Profile := "tyth-rage-v5"
    p := IBCPackEvidence(e),wave.Recap.BossEvidence := IBCUnpackEvidence(p,wave.Pull,wave.Recap)
    V48Assert(IGVJson(IBCPackEvidence(wave.Recap.BossEvidence))=IGVJson(p) && IBCDebugCheck(wave.Pull,wave.Recap).History.Possible=1,"genuine v5 Wave payload remains readable and attributed")
}

V6412RageContextBoundary()
{
    for kind in ["sweep","wave","melee"] {
        f := V649BossWindowFixture(),V647BossRage(f,18000,6)
        if kind="sweep"
            V647BossSweep(f,19000)
        else if kind="wave"
            V6411BossWave(f,19000)
        else
            V6412BossMelee(f,19000)
        V647BossRage(f,21000,9),V647BossZero(f,21005),V649BossWindowEnd(f,50000,50500,55000)
        debug := IBCDebugCheck(f.Pull,f.Recap),short := IBCCheck(f.Pull,f.Recap)
        V48Assert(debug.History.Possible=1 && debug.History.Changes.Length=1 && debug.History.Changes[1].Row.At=21000,"retained " kind " contact before display start explains the first displayed gain")
        V48Assert(InStr(short.Text,"29.0s before") && !InStr(short.Text,"31.0s before") && !InStr(short.Text,"32.0s before"),"Rage timeline stays thirty seconds while candidate context is wider")
        f.Recap.BossEvidence := IBCUnpackEvidence(IBCPackEvidence(f.Recap.BossEvidence),f.Pull,f.Recap)
        V48Assert(IBCCheck(f.Pull,f.Recap).Text=short.Text,"boundary attribution survives saved evidence reopening")
    }
    f := V649BossWindowFixture(),V647BossRage(f,18000,6),V6412BossMelee(f,17499),V647BossRage(f,20000,9)
    V647BossZero(f,20001),V649BossWindowEnd(f,50000,50500,55000)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"older-than-contact-limit evidence cannot explain the display boundary")
    f := V649BossWindowFixture(),V647BossRage(f,18000,6),V6412BossMelee(f,19000),V647BossRage(f,21000,9)
    V647BossZero(f,21005),V649BossWindowEnd(f,50000,50000,70000)
    V48Assert(f.Recap.BossEvidence.From=20000 && IBCDebugCheck(f.Pull,f.Recap).History.Possible=0,"missing pre-window contact is not invented when the saved retention boundary genuinely clipped it")
    f := V649BossWindowFixture(),V647BossRage(f,17000,0),V6412BossMelee(f,18000)
    V647BossRage(f,19950,3),V647BossZero(f,19951),V647BossRage(f,20050,6),V649BossWindowEnd(f,50000,50500,55000)
    debug := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(debug.History.Possible=0 && debug.History.Changes.Length=1,"retained offscreen gain owns its matching death and cannot fund a second displayed cleave")
    f := V649BossWindowFixture(),V647BossRage(f,16000,0),V6412BossMelee(f,17100)
    V647BossZero(f,19600),V647BossRage(f,20050,3),V649BossWindowEnd(f,50000,50500,55000)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Possible=1,"retained contact padding includes existing2500ms contact-to-zero plus500ms zero-to-gain allowance")
}

V6412GraceHeal(f,at,instance := 701,bossInstance := 700)
{
    return V647BossFeed(f,at,V647BossNPC("4078440814739456",instance),V647BossNPC("4078423634870272",bossInstance),
        "4071199499878400","836045448945477","836045448945500","(100 ~50)")
}

V6412PairedGraceHeals()
{
    for count in [2,3] {
        f := V647BossFixture(),V647BossRage(f,5000,9),V647BossRage(f,10000,9-count)
        Loop count
            V6412GraceHeal(f,10000+A_Index,700+A_Index)
        V647BossEnd(f),before := IBCCheck(f.Pull,f.Recap).Text
        V48Assert(InStr(before,Chr(0x2212) count ", " count " Grace heals)"),"one observed reduction can be explained by " count " distinct completed Grace heals")
        V48Assert(!InStr(before,"should") && !InStr(before,"interrupt") && !InStr(before,"completion"),"paired-heal cause remains a short label without strategy or derivation")
        f.Recap.BossEvidence := IBCUnpackEvidence(IGJParse(IGVJson(IBCPackEvidence(f.Recap.BossEvidence))),f.Pull,f.Recap)
        V48Assert(IBCCheck(f.Pull,f.Recap).Text=before,"multiple distinct Grace sources and the exact reduction survive persistence")
    }
    f := V647BossFixture(),V647BossRage(f,5000,9),V647BossRage(f,10000,7)
    V6412GraceHeal(f,10000,701),V6412GraceHeal(f,10000,702),V647BossEnd(f)
    V48Assert(InStr(IBCCheck(f.Pull,f.Recap).Text,"2 Grace heals"),"different Grace instances at exactly the same timestamp remain two completions")
    h := IBCDebugCheck(f.Pull,f.Recap).History,marker := ""
    for row in h.Rows {
        if row.Kind="grace-heal" {
            marker := row
            break
        }
    }
    h.Rows.Push(marker)
    V48Assert(IBCReductionReason(h.Changes[2],h)="2 Grace heals","one repeated in-memory source/record is not counted twice")
}

V6412PairedGraceGuards()
{
    for scenario in ["same-source","too-small","too-large","clipped-zero","mixed-decay","shared-change","wrong-boss","late-marker","post-overload"] {
        f := V647BossFixture(),before := scenario="clipped-zero" ? 1 : 9
        delta := scenario="too-small" || scenario="clipped-zero" ? 1 : (scenario="too-large" ? 3 : 2)
        V647BossRage(f,5000,before),V647BossRage(f,10000,before-delta),V6412GraceHeal(f,10001,701)
        if scenario="post-overload" {
            V647BossEnd(f,false),V6412GraceHeal(f,14000,702)
        }
        else
            V6412GraceHeal(f,scenario="late-marker" ? 10101 : 10002,scenario="same-source" ? 701 : 702,scenario="wrong-boss" ? 999 : 700)
        if scenario="mixed-decay"
            V648ReductionFeed(f,"rage-decay",10003)
        if scenario="shared-change"
            V647BossRage(f,10050,before-delta-1)
        V647BossEnd(f)
        text := IBCCheck(f.Pull,f.Recap).Text
        V48Assert(!InStr(text,"2 Grace heals") && !InStr(text,"3 Grace heals"),"multi-heal explanation rejects " scenario " instead of over-allocating reductions")
        if scenario="same-source" || scenario="too-small" || scenario="too-large" || scenario="clipped-zero" || scenario="mixed-decay" || scenario="shared-change"
            V48Assert(InStr(text,"cause unclear"),"unresolved combined reduction remains unclear: " scenario)
    }
}

V6412RageLateRollback()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
    id := IDTCaseKey(f.Recap),f.Seg.DeathCapture.Cases[id] := f.Recap,before := IGVJson(IBCPackEvidence(f.Recap.BossEvidence))
    IPBBeginUndo(f.Data,f.Seg),V6412BossMelee(f,11000),updated := f.Seg.DeathCapture.Cases[id]
    V48Assert(IBCDebugCheck(f.Pull,updated).History.Possible=1 && IGVJson(IBCPackEvidence(f.Recap.BossEvidence))=before,"late Melee contact updates frozen copy without mutating published evidence")
    IPBRollbackTail(f.Data,f.Seg)
    V48Assert(IGVJson(IBCPackEvidence(f.Seg.DeathCapture.Cases[id].BossEvidence))=before && V6412MeleeRows(f).Length=0,"rollback restores the precise original case and removes Melee journal row")
    f := V647BossFixture(),V647BossRage(f,5000,9),V647BossRage(f,10000,7),V6412GraceHeal(f,10001,701),V647BossEnd(f)
    id := IDTCaseKey(f.Recap),f.Seg.DeathCapture.Cases[id] := f.Recap,before := IGVJson(IBCPackEvidence(f.Recap.BossEvidence))
    IPBBeginUndo(f.Data,f.Seg),V6412GraceHeal(f,10002,702),updated := f.Seg.DeathCapture.Cases[id]
    V48Assert(InStr(IBCCheck(f.Pull,updated).Text,"2 Grace heals") && IGVJson(IBCPackEvidence(f.Recap.BossEvidence))=before,"late second Grace completion explains the net reduction in a fresh immutable case")
    IPBRollbackTail(f.Data,f.Seg)
    V48Assert(IGVJson(IBCPackEvidence(f.Seg.DeathCapture.Cases[id].BossEvidence))=before && !InStr(IBCCheck(f.Pull,f.Seg.DeathCapture.Cases[id]).Text,"2 Grace heals"),"rollback removes the speculative multi-heal interpretation")
}

V6412RageRawEvidence()
{
    ; Verbatim NPC-only Sep22 source records from the previously retained
    ; f3-l114443 window: no synthetic Overload or player death is appended.
    raw := "
    (
    [19:21:46.266] [TYTH {4078423634870272}:1594000813766|(818.24,2334.09,228.52,10.16)|(8162710/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (7 charges {836045448953667})
    [19:21:50.069] [TYTH {4078423634870272}:1594000813766|(822.01,2337.26,228.52,-127.65)|(8088772/19989636)] [Justice {4078432224804864}:1594000910852|(823.63,2340.89,228.52,-82.60)|(185325/340388)] [Melee Attack {4080283355709440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)
    [19:21:50.070] [TYTH {4078423634870272}:1594000813766|(822.01,2337.26,228.52,-127.65)|(8088772/19989636)] [Justice {4078432224804864}:1594000910852|(823.63,2340.89,228.52,-82.60)|(185325/340388)] [Melee Attack {4080283355709440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)
    [19:21:52.069] [TYTH {4078423634870272}:1594000813766|(822.01,2337.26,228.52,-127.65)|(8067804/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (10 charges {836045448953667})
    [19:21:52.072] [Justice {4078432224804864}:1594000910852|(823.77,2340.91,228.52,-82.12)|(0/340388)] [=] [ {4075653380964352}] [RemoveEffect {836045448945478}: Charge Field {4075653380964719}]
    [19:21:52.073] [Justice {4078432224804864}:1594000910852|(823.77,2340.91,228.52,-82.12)|(0/340388)] [=] [] [Event {836045448945472}: Death {836045448945493}]
    )"
    f := V647BossFixture(),boss := "N:4078423634870272:1594000813766:TYTH",f.Seg.BossActors := Map(boss,"boss")
    Loop Parse raw,"`n","`r" {
        ev := IPParseLine(Trim(A_LoopField))
        V48Assert(IsObject(ev) && ev.ValueOK,"verbatim Sep22 Melee record parses")
        ev.RecordId := f.Next,f.Next += 1
        if f.Seg.Start=0
            f.Seg.Start := ev.RawMs-1000
        IBCObserve(f.Seg,ev,ev.RawMs)
    }
    rows := IBCOrdered(f.Seg.BossCheckState.Rows),candidates := IBCCleaveCandidates(rows,boss,f.Seg.Start,ev.RawMs),counts := []
    for row in rows {
        if row.Kind="rage"
            counts.Push(row)
    }
    V48Assert(candidates.Length=1 && candidates[1].Contact && !candidates[1].Competing && candidates[1].Attack="Melee Attack","real Justice's neutral Melee packet supplies one usable contact")
    c := candidates[1]
    V48Assert(c.HP=185325 && c.Zero-c.At=2003 && c.DeathAt-c.At=2004 && counts[2].Charges-counts[1].Charges=3,"real Melee case preserves living HP, exact two-second delay and observed +3")
    V48Assert(IBCOrdinaryKills(rows,boss,counts[2]).Count=0,"self-death cannot also consume an ordinary kill from the same +3")
    V6412GraceRawEvidence()
}

V6412GraceRawEvidence()
{
    ; Verbatim Sep29 NPC-only lines118422/118522/118523/118524 from
    ; combat_2026-09-29_15_44_44_295454.txt, SHA256
    ; ce1cf0cd561b5714fa62ce9d5b4bce7a0bdc07d7f2ce36f76bea4be98def6a36.
    ; This tests capture and cause matching without inventing a death report.
    raw := "
    (
    [16:44:34.278] [TYTH {4078423634870272}:20051001463432|(789.69,2361.12,228.52,165.09)|(10925783/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (9 charges {836045448953667})
    [16:44:35.974] [TYTH {4078423634870272}:20051001463432|(789.69,2361.12,228.52,164.11)|(11683816/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (7 charges {836045448953667})
    [16:44:35.975] [Grace {4078440814739456}:20051001530433|(783.81,2346.96,228.52,-109.86)|(340388/340388)] [TYTH {4078423634870272}:20051001463432|(789.69,2361.12,228.52,164.11)|(11683816/19989636)] [Aivela's Restoration {4071199499878400}] [ApplyEffect {836045448945477}: Heal {836045448945500}] (443769 ~443770)
    [16:44:35.975] [Grace {4078440814739456}:20051001530749|(828.00,2343.99,228.52,103.97)|(340388/340388)] [TYTH {4078423634870272}:20051001463432|(789.69,2361.12,228.52,164.11)|(11683816/19989636)] [Aivela's Restoration {4071199499878400}] [ApplyEffect {836045448945477}: Heal {836045448945500}] (443769 ~443770)
    )"
    f := V647BossFixture(),boss := "N:4078423634870272:20051001463432:TYTH",f.Seg.BossActors := Map(boss,"boss")
    Loop Parse raw,"`n","`r" {
        ev := IPParseLine(Trim(A_LoopField))
        V48Assert(IsObject(ev) && ev.ValueOK,"verbatim Sep29 paired-heal record parses")
        ev.RecordId := f.Next,f.Next += 1
        if f.Seg.Start=0
            f.Seg.Start := ev.RawMs-1000
        IBCObserve(f.Seg,ev,ev.RawMs)
    }
    rows := IBCOrdered(f.Seg.BossCheckState.Rows),counts := [],heals := []
    for row in rows {
        if row.Kind="rage"
            counts.Push(row)
        else if row.Kind="grace-heal"
            heals.Push(row)
    }
    change := {Row:counts[2],Delta:counts[2].Charges-counts[1].Charges,Previous:counts[1].Charges}
    history := {Boss:boss,Rows:rows,Reference:ev.RawMs,ReferenceRecord:ev.RecordId,ReductionChanges:[change]}
    V48Assert(heals.Length=2 && heals[1].Source!=heals[2].Source && heals[1].At=heals[2].At && change.Delta=-2,"real simultaneous heals keep two distinct Grace sources and the exact observed reduction")
    V48Assert(IBCReductionReason(change,history)="2 Grace heals","real paired-heal cause is no longer discarded only because two markers share a timestamp")
}

V6412OverloadCastAssociation()
{
    f := V649BossWindowFixture(),V647BossRage(f,22000,9),V647BossRage(f,46599,12)
    V647BossRage(f,49998,10),V649BossWindowEnd(f,46600,50000,69999)
    debug := IBCDebugCheck(f.Pull,f.Recap),short := IBCCheck(f.Pull,f.Recap)
    V48Assert(debug.History.HitGap=19999 && debug.History.Reference=46600 && debug.History.ReferenceRecord=f.Cast.RecordId,"accepted late death uses its actual cast3.4seconds before the hit despite the cast falling outside the death window")
    V48Assert(debug.History.LastCount=12 && !InStr(short.Text,"12 " Chr(0x2192) " 10"),"post-cast reset stays out of the Rage lead-up")
    V48Assert(debug.History.Clipped && InStr(short.Text,"Some of this history is missing"),"genuinely unavailable beginning of a cast-based30second history remains disclosed")
    f.Recap.BossEvidence := IBCUnpackEvidence(IGJParse(IGVJson(IBCPackEvidence(f.Recap.BossEvidence))),f.Pull,f.Recap)
    V48Assert(IBCCheck(f.Pull,f.Recap).Text=short.Text,"correct cast association and its partial coverage survive saved evidence")
    f := V649BossWindowFixture(),V649BossWindowEnd(f,46600,50000,70001)
    V48Assert(!IBCDebugCheck(f.Pull,f.Recap).HasOwnProp("History"),"a retained cast cannot rescue a hit beyond the20second death-association limit")
    f := V649BossWindowFixture(),V649BossWindowEnd(f,29999,50000,60000)
    debug := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(debug.History.Reference=50000 && InStr(debug.Text,"cast start not recorded"),"a cast more than20seconds before the accepted hit stays outside the bound")
    f := V649BossWindowFixture(),V649BossWindowEnd(f,30000,50000,60000)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Reference=30000,"exact20second cast-to-hit boundary remains inclusive")
    f := V649BossWindowFixture(),V647BossFeed(f,46600,V647BossNPC("4078423634870272",999),"=","4086837475803136","836045448945472","836045448945479")
    V649BossWindowEnd(f,-1,50000,69999)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.Reference=50000,"another boss instance cannot provide the accepted hit's cast")
    f := V649BossWindowFixture(),V649BossWindowEnd(f,-1,50000,69999)
    V647BossFeed(f,50000,V647BossNPC("4078423634870272",700),"=","4086837475803136","836045448945472","836045448945479"),IBCFreeze(f.Seg,f.Recap)
    V48Assert(IBCDebugCheck(f.Pull,f.Recap).History.ReferenceRecord=f.Hit.RecordId,"same-time cast recorded after the accepted hit cannot be moved before it")
}

; Native detection/queue tests using the V647Live isolation fixtures.
; No audio worker, HTTP, game input, live app or user settings.
; Groups: V6412LiveMeleeContacts, V6412LiveMeleeRejections,
; V6412LiveMeleeGuards, V6412LiveMeleeOverlap, V6412LiveMeleeMute.
; Operation identity/friendly_fire Master branch:
; https://swtor.jedipedia.net/en/abl/melee-attack-301#eff6

V6412LiveMelee(f,at := 100,tail := "(0 -)",target := "",source := "")
{
    V647LiveEvent(at,source!="" ? source : f.Boss,target!="" ? target : f.Add,
        "Melee Attack {4080283355709440}","[ApplyEffect {836045448945477}: Damage {836045448945501}] " tail)
}

V6412LiveMeleeContacts()
{
    global TythCleave,tythBossInstance
    for id,addType in Map("4078445109706752","Guardian","4078440814739456","Grace","4078449404674048","Lance","4078432224804864","Justice") {
        f := V647LiveSetup(id),V647LiveRage(f,0,6),V6412LiveMelee(f)
        V48Assert(TythCleave.Candidates.Has(f.Instance) && TythCleave.Candidates[f.Instance].Ability="4080283355709440","Melee anchors a living known " addType)
        V647LiveZero(f,2100),V647LiveDeath(f,2105),V647LiveRage(f,2110,9),V647LiveHeartbeat(f,2700)
        V48Assert(V647LiveCount("Cleave" addType)=1,"Melee uses the existing possible-" addType "-cleave queue request")
    }
    f := V647LiveSetup(),V647LiveRage(f,0,6),V6412LiveMelee(f,100,"(47 energy {836045448940874})")
    V647LiveZero(f,2200),V647LiveRage(f,2210,8),V647LiveHeartbeat(f,2800)
    V48Assert(V647LiveCount("CleaveGuardian")=1,"Melee retains the historical live +2 threshold and delayed zero window")
    f := V647LiveSetup(),V647LiveRage(f,0,6),V6412LiveMelee(f,100,"(0 avoidance {836045448945505})")
    V6412LiveMelee(f,150),V6411LiveWaveSettle(f)
    V48Assert(V647LiveCount("CleaveGuardian")=1,"a neutral Melee packet after an avoided packet supplies usable contact")
    ; Reduced ordered Sep29 case from combat_2026-09-29_15_44_44_295454.txt.
    ; SHA256 ce1cf0cd561b5714fa62ce9d5b4bce7a0bdc07d7f2ce36f76bea4be98def6a36.
    ; Baseline L8992 (15:55:40.676) is time0. Preserve actual NPC IDs, HP,
    ; contact packet, both intervening damage rows, Rage and first-zero timing.
    ; The zero is a Guardian Volatile Platform source snapshot, NOT a Death.
    f := V647LiveSetup("4078445109706752","20051000701190",233564,340388)
    tythBossInstance := "20051000635207"
    f.Boss := V647LiveNPC("4078423634870272",tythBossInstance,11870253,19989636)
    V647LiveRage(f,0,4)
    f.Boss := V647LiveNPC("4078423634870272",tythBossInstance,11684956,19989636)
    V6412LiveMelee(f,2381),V6412LiveMelee(f,2381,"(0 -miss {836045448945502})"),V6412LiveMelee(f,2381)
    for hit in [["Scorch {3384812186370048}","(10402* elemental {836045448940875}) <10402.0>"],
        ["Burning (Incendiary Missile) {2027022700249344}","(7071* elemental {836045448940875}) <5303.0>"]] {
        V647LiveEvent(2772,f.Player,V647LiveNPC(f.Id,f.Instance,216091,340388),hit[1],
            "[ApplyEffect {836045448945477}: Damage {836045448945501}] " hit[2])
    }
    V48Assert(TythCleave.Candidates[f.Instance].Damage=17473 && !TythCleave.Candidates[f.Instance].Explained,"real Sep29 Melee candidate survives only nonlethal intervening damage")
    f.Boss := V647LiveNPC("4078423634870272",tythBossInstance,11529535,19989636)
    V647LiveRage(f,4473,7)
    V647LiveEvent(4486,f.Zero,f.Player,"Volatile Platform {4176645241962496}",
        "[ApplyEffect {836045448945477}: Damage {836045448945501}] (51971 internal {836045448940876}) <51971.0>")
    V48Assert(TythCleave.Candidates[f.Instance].ZeroAt>=0 && TythCleave.Candidates[f.Instance].DeathAt<0,"real Sep29 first-zero snapshot remains distinct from explicit Death")
    V647LiveHeartbeat(f,5100)
    V48Assert(V647LiveCount("CleaveGuardian")=1,"real Sep29 Melee-only sequence queues one Guardian cleave after2105ms to first zero")
}

V6412LiveMeleeRejections()
{
    global TythCleave
    for scenario in ["player-source","other-boss","wrong-id","cast-only","zero-contact","unknown-hp","other-npc","player-target"] {
        f := V647LiveSetup(),V647LiveRage(f,0,6)
        if scenario="player-source"
            V6412LiveMelee(f,100,"(0 -)",f.Add,f.Player)
        else if scenario="other-boss"
            V6412LiveMelee(f,100,"(0 -)",f.Add,V647LiveNPC("4078423634870272","999",900,1000))
        else if scenario="wrong-id"
            V647LiveEvent(100,f.Boss,f.Add,"Melee Attack {4080283355709441}","[ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)")
        else if scenario="cast-only"
            V647LiveEvent(100,f.Boss,f.Add,"Melee Attack {4080283355709440}","[Event {836045448945472}: AbilityActivate {836045448945479}]")
        else if scenario="zero-contact"
            V6412LiveMelee(f,100,"(0 -)",f.Zero)
        else if scenario="unknown-hp"
            V6412LiveMelee(f,100,"(0 -)","NPC {4078445109706752}:101")
        else if scenario="other-npc"
            V6412LiveMelee(f,100,"(0 -)",V647LiveNPC("12345","101"))
        else
            V6412LiveMelee(f,100,"(0 -)",f.Player)
        V48Assert(TythCleave.Candidates.Count=0,"Melee requires exact source/ability/living-add evidence: " scenario)
        V6411LiveWaveSettle(f)
        V48Assert(V647LiveCount("CleaveGuardian")=0,"invalid Melee evidence stays silent: " scenario)
    }
    for id in ["836045448945502","836045448945503","836045448945504","836045448945505","836045448945507"] {
        f := V647LiveSetup(),V647LiveRage(f,0,6),V6412LiveMelee(f,100,"(0 avoidance {" id "})")
        V6411LiveWaveSettle(f)
        V48Assert(V647LiveCount("CleaveGuardian")=0,"Melee retains conservative exact-ID avoidance rejection: " id)
    }
}

V6412LiveMeleeGuards()
{
    for scenario in ["unknown-rage","only-one-rage","late-zero","player-lethal","external-death","alive-after-zero"] {
        f := V647LiveSetup()
        if scenario!="unknown-rage"
            V647LiveRage(f,0,6)
        V6412LiveMelee(f)
        if scenario="late-zero"
            V6411LiveWaveSettle(f,2700)
        else {
            if scenario="player-lethal"
                V647LiveDamage(f,400,5)
            else
                V647LiveZero(f,400)
            if scenario="external-death"
                V647LiveDeath(f,410,f.Player,f.Zero)
            else if scenario="alive-after-zero"
                V647LiveEvent(410,f.Add,"=","Metadata {1}","[Event {2}: Event {3}]")
            V647LiveRage(f,420,scenario="only-one-rage" ? 7 : 9),V647LiveHeartbeat(f,1000)
        }
        V48Assert(V647LiveCount("CleaveGuardian")=0,"Melee retains existing corroboration and contradiction guard: " scenario)
    }
    f := V647LiveSetup(),V647LiveRage(f,0,6),V6412LiveMelee(f),V647LiveZero(f,400),V647LiveDeath(f,410)
    V647LiveRage(f,420,9),V647LiveDamage(f,430,5),V647LiveHeartbeat(f,1000)
    V48Assert(V647LiveCount("CleaveGuardian")=1,"strictly post-Death corpse damage cannot suppress Melee evidence")
}

V6412LiveMeleeOverlap()
{
    global TythCleave
    for first in ["melee","sweep","wave"] {
        f := V647LiveSetup(),V647LiveRage(f,0,6)
        if first="melee"
            V6412LiveMelee(f)
        else if first="sweep"
            V647LiveSweep(f,100)
        else
            V6411LiveWave(f)
        V6412LiveMelee(f,150),V647LiveSweep(f,175),V6411LiveWave(f,200)
        V48Assert(TythCleave.Candidates.Count=1,"all three attacks share one candidate per add: " first)
        V6411LiveWaveSettle(f)
        V6412LiveMelee(f,1100),V647LiveSweep(f,1150),V6411LiveWave(f,1200)
        V647LiveRage(f,1250,12),V647LiveHeartbeat(f,2000)
        V48Assert(V647LiveCount("CleaveGuardian")=1 && TythCleave.Seen.Has(f.Instance),"all three attacks share one consumed add lifecycle: " first)
    }
    f := V647LiveSetup(),V647LiveRage(f,0,6),V6412LiveMelee(f)
    g := {Boss:f.Boss,Player:f.Player,Add:V647LiveNPC("4078432224804864","102"),Zero:V647LiveNPC("4078432224804864","102",0),Instance:"102",Id:"4078432224804864"}
    V6411LiveWave(g,150),V647LiveZero(f,400),V647LiveZero(g,410),V647LiveRage(f,420,9),V647LiveHeartbeat(f,1000)
    V48Assert(V647LiveCount("CleaveGuardian")=0 && V647LiveCount("CleaveJustice")=0,"one +3 gain does not choose arbitrarily between two candidate deaths")
}

V6412LiveMeleeMute()
{
    global Audio,TythCleave,TythExtraAlerts,soundboardsEnabled
    for scenario in ["mute-at-contact","mute-during","toggle-during","epoch-change"] {
        f := V647LiveSetup(),V647LiveRage(f,0,6)
        if scenario="mute-at-contact"
            soundboardsEnabled := false
        V6412LiveMelee(f)
        if scenario="mute-during"
            soundboardsEnabled := false
        else if scenario="toggle-during"
            TythExtraAlerts["CleaveGuardian"].Enabled := false
        else if scenario="epoch-change"
            Audio.Epoch += 1
        V647LiveHeartbeat(f,200)
        soundboardsEnabled := true,TythExtraAlerts["CleaveGuardian"].Enabled := true
        V6411LiveWaveSettle(f)
        V48Assert(V647LiveCount("CleaveGuardian")=0 && TythCleave.Seen.Has(f.Instance),"Melee consumed opportunities never replay after audio state changes: " scenario)
    }
}

; Exact Volatile Platform ordinary-kill evidence. Synthetic except the raw
; NPC-only Sep29 fixtures identified below. No audio or encounter mutation.
; Groups: V6413PlatformCapture, V6413PlatformGuards, V6413PlatformContacts,
; V6413PlatformBoundaries, V6413PlatformPersistence, V6413PlatformRawEvidence.
V6413PlatformFeed(f,at,kind,hp := 0,tail := "(1000)",instance := 701,id := "4078445109706752")
{
    source := V647BossNPC(id,instance,hp)
    if kind="alive"
        return V647BossFeed(f,at,"@Player#2|(1000/1000)",source,"1","836045448945477","836045448945501","(1)")
    if kind="death"
        return V647BossFeed(f,at,source,"=","1","836045448945472","836045448945493")
    return V647BossFeed(f,at,source,"=","4176645241962496","836045448945477","836045448945501",tail)
}

V6413PlatformFixture()
{
    f := V647BossFixture(),V647BossRage(f,5000,6),V6413PlatformFeed(f,12000,"alive",1000)
    V647BossRage(f,13000,7),V647BossZero(f,13001),V6413PlatformFeed(f,13008,"damage",0,"(1200 ~999) <9999.0>")
    V6413PlatformFeed(f,13010,"death")
    return f
}

V6413PlatformRows(f)
{
    rows := IBCOrdered(f.Seg.BossCheckState.Rows),gain := ""
    for row in rows {
        if row.Kind="rage"
            gain := row
    }
    return {Rows:rows,Gain:gain,Boss:gain.Boss}
}

V6413PlatformCapture()
{
    f := V6413PlatformFixture(),c := V6413PlatformRows(f),damage := ""
    for row in c.Rows {
        if row.Kind="add-damage"
            damage := row
    }
    V48Assert(damage.Source=damage.Actor && damage.Target=damage.Actor && damage.HP=0 && damage.Amount=999,"platform alias resolves to same add and keeps effective damage instead of raw/threat")
    V48Assert(IBCPlatformKills(c.Rows,c.Boss,c.Gain).Count=1,"exact lethal platform plus same-add self-Death explains one ordinary kill with one HP rounding allowance")
    c.Rows.Push(damage),c.Rows.Push(damage)
    V48Assert(IBCPlatformKills(c.Rows,c.Boss,c.Gain).Count=1,"duplicate packet rows cannot count a death twice")
    f := V647BossFixture(),V647BossRage(f,5000,6),V6413PlatformFeed(f,12000,"alive",1000)
    V647BossRage(f,13000,7),V6413PlatformFeed(f,13005,"damage",0,"(600)")
    V6413PlatformFeed(f,13008,"damage",0,"(600 ~400)"),V6413PlatformFeed(f,13010,"death"),c := V6413PlatformRows(f)
    V48Assert(IBCPlatformKills(c.Rows,c.Boss,c.Gain).Count=1,"two distinct platform explosions in one death packet consume the remaining observed HP")
    c.Rows.Push(c.Rows[c.Rows.Length-2])
    V48Assert(IBCPlatformKills(c.Rows,c.Boss,c.Gain).Count=1,"distinct platform packets and duplicate evidence still own only one death")
}

V6413PlatformGuards()
{
    for scenario in ["wrong-ability","wrong-source","wrong-target","unknown-add","no-death","nonlethal","zero-effective","insufficient-damage","no-alive","unknown-maximum","mismatched-alive-maximum","mismatched-zero-maximum","mismatched-damage-maximum","other-boss","corpse","later-alive","early-zero","clipped-context"] {
        f := V6413PlatformFixture(),c := V6413PlatformRows(f),out := []
        for row in c.Rows {
            r := row.Clone()
            if scenario="no-death" && r.Kind="add-death"
                continue
            if scenario="no-alive" && r.HP>0
                continue
            if scenario="clipped-context" && r.At<12000
                continue
            if r.Kind="add-damage" && r.Ability="4176645241962496" {
                if scenario="wrong-ability"
                    r.Ability := "4176645241962497"
                if scenario="wrong-source"
                    r.Source := "@Other#4"
                if scenario="wrong-target"
                    r.Target := "N:4078445109706752:999:Guardian"
                if scenario="nonlethal"
                    r.HP := 1
                if scenario="zero-effective"
                    r.Amount := 0
                if scenario="insufficient-damage"
                    r.Amount := 998
            }
            if scenario="unknown-maximum" && r.HP>0
                r.Maximum := 0
            if (scenario="mismatched-alive-maximum" && r.HP>0)
                || (scenario="mismatched-zero-maximum" && r.Kind="add-zero")
                || (scenario="mismatched-damage-maximum" && r.Kind="add-damage" && r.HP=0)
                r.Maximum += 1000
            if scenario="unknown-add" && r.Actor!=""
                r.ActorId := "1"
            if scenario="other-boss" && r.Actor!=""
                r.Boss := "N:4078423634870272:999:Tyth"
            if scenario="early-zero" && r.Kind="add-zero"
                r.At := 12500
            out.Push(r)
        }
        if scenario="corpse" || scenario="later-alive" {
            for r in c.Rows {
                if (scenario="corpse" && r.Kind="add-death") || (scenario="later-alive" && r.HP>0) {
                    extra := r.Clone(),extra.At := scenario="corpse" ? 12999 : 13011,extra.Record := 999
                    out.Push(extra)
                    break
                }
            }
        }
        V48Assert(IBCPlatformKills(out,c.Boss,c.Gain).Count=0,"platform ordinary-kill proof rejects " scenario)
    }
    f := V6413PlatformFixture(),c := V6413PlatformRows(f),wrong := c.Gain.Clone(),wrong.Boss := "N:4078423634870272:999:Tyth"
    V48Assert(IBCPlatformKills(c.Rows,c.Boss,wrong).Count=0 && IBCPlatformKills(c.Rows,"",c.Gain).Count=0,"platform gain identity must match a known Tyth")
}

V6413PlatformContacts()
{
    for ability in ["4080279060742144","4081339917664256","4080283355709440"] {
        for avoided in [false,true] {
            f := V6413PlatformFixture(),V647BossFeed(f,11010,V647BossNPC("4078423634870272",700),V647BossNPC(),ability,
                "836045448945477","836045448945501",avoided ? "(0 -resist {836045448945507})" : "(0 -)")
            c := V6413PlatformRows(f)
            V48Assert(IBCPlatformKills(c.Rows,c.Boss,c.Gain).Count=0,"recent exact boss contact blocks platform double counting even when avoided: " ability "/" avoided)
            for r in c.Rows {
                if IBCCleaveKind(r.Kind)
                    r.Kind := "add-damage",r.Avoided := false
            }
            V48Assert(IBCPlatformKills(c.Rows,c.Boss,c.Gain).Count=0,"legacy generic boss contact cannot establish the ordinary passive survived: " ability)
        }
    }
    f := V6413PlatformFixture(),V647BossSweep(f,11010,702),c := V6413PlatformRows(f)
    V48Assert(IBCPlatformKills(c.Rows,c.Boss,c.Gain).Count=1,"a different add's cleave does not consume this exact platform death")
    f := V6413PlatformFixture(),V647BossSweep(f,10501),c := V6413PlatformRows(f)
    V48Assert(IBCPlatformKills(c.Rows,c.Boss,c.Gain).Count=0,"boss contact at the2500ms first-zero boundary still blocks when explicit Death follows nine ms later")
    f := V6413PlatformFixture(),V647BossFeed(f,11010,V647BossNPC("4078423634870272",999),V647BossNPC(),"4081339917664256","836045448945477","836045448945501","(0 -)"),c := V6413PlatformRows(f)
    V48Assert(IBCPlatformKills(c.Rows,c.Boss,c.Gain).Count=1,"another Tyth's evidence is not silently merged into the selected boss")
}

V6413PlatformBoundaries()
{
    for delta in [-501,-500,500,501] {
        f := V6413PlatformFixture(),c := V6413PlatformRows(f),gain := c.Gain.Clone(),gain.At := 13010+delta
        V48Assert(IBCPlatformKills(c.Rows,c.Boss,gain).Count=(Abs(delta)<=500 ? 1 : 0),"platform death uses existing half-second Rage allowance: " delta)
    }
    for delta in [100,101] {
        f := V6413PlatformFixture(),c := V6413PlatformRows(f)
        for r in c.Rows {
            if r.Kind="add-zero" || r.Kind="add-damage"
                r.At := 13010-delta
        }
        V48Assert(IBCPlatformKills(c.Rows,c.Boss,c.Gain).Count=(delta=100 ? 1 : 0),"platform self-damage and first-zero retain short death-packet bound: " delta)
    }
    f := V6413PlatformFixture(),c := V6413PlatformRows(f)
    for r in c.Rows {
        if r.HP>0
            r.At := 10509
    }
    V48Assert(IBCPlatformKills(c.Rows,c.Boss,c.Gain).Count=0,"older-than2500ms HP cannot establish this platform packet's living baseline")
}

V6413PlatformPersistence()
{
    f := V6413PlatformFixture(),V647BossEnd(f),before := IBCCheck(f.Pull,f.Recap).Text
    V48Assert(InStr(before,"(+1, add kill)"),"platform helper integrates into short ordinary add-kill wording")
    packed := IBCPackEvidence(f.Recap.BossEvidence),f.Recap.BossEvidence := IBCUnpackEvidence(IGJParse(IGVJson(packed)),f.Pull,f.Recap)
    V48Assert(IBCCheck(f.Pull,f.Recap).Text=before && IGVJson(IBCPackEvidence(f.Recap.BossEvidence))=IGVJson(packed),"existing exact self-damage and self-Death survive save/reopen without rewritten counts")
    h := IBCDebugCheck(f.Pull,f.Recap).History,last := h.Changes[h.Changes.Length]
    V48Assert(IBCPlatformKills(h.Rows,h.Boss,last.Row).Count=1,"reopened evidence retains platform identity and effective damage")
}

V6413PlatformRawEvidence()
{
    ; Raw records from combat_2026-09-29_15_44_44_295454.txt, SHA256
    ; ce1cf0cd561b5714fa62ce9d5b4bce7a0bdc07d7f2ce36f76bea4be98def6a36.
    ; Only two player display names anonymized; all IDs, HP and data preserved.
    ; Guardian source lines69241,69725,69742,69780,69781,69815,69816.
    guardian := "
    (
    [16:22:40.595] [TYTH {4078423634870272}:20051001104957|(808.31,2368.50,228.52,-0.77)|(11175964/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (8 charges {836045448953667})
    [16:22:48.608] [TYTH {4078423634870272}:20051001104957|(809.20,2370.62,228.52,-153.04)|(10678470/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (7 charges {836045448953667})
    [16:22:48.813] [@Player01#690182454699879|(810.04,2348.42,228.52,-22.55)|(435690/435690)] [Guardian {4078445109706752}:20051001156823|(813.63,2346.70,228.52,-82.43)|(31586/340388)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9937* elemental {836045448940875}) <9937.0>
    [16:22:49.754] [TYTH {4078423634870272}:20051001104957|(809.44,2370.86,228.52,-130.59)|(10613962/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (10 charges {836045448953667})
    [16:22:49.755] [Guardian {4078445109706752}:20051001156823|(814.96,2346.67,228.52,-86.04)|(0/340388)] [] [] [Event {836045448945472}: TargetCleared {836045448953669}]
    [16:22:49.765] [Guardian {4078445109706752}:20051001156823|(814.96,2346.67,228.52,-86.04)|(0/340388)] [=] [Volatile Platform {4176645241962496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (32502 ~31585 internal {836045448940876})
    [16:22:49.765] [Guardian {4078445109706752}:20051001156823|(814.96,2346.67,228.52,-86.04)|(0/340388)] [=] [] [Event {836045448945472}: Death {836045448945493}]
    )"
    ; Lance source lines97285,97382,97474,97507,97508,97522,97537,97538.
    lance := "
    (
    [16:35:55.469] [TYTH {4078423634870272}:20051001233395|(810.49,2317.22,228.52,-82.06)|(6128297/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (2 charges {836045448953667})
    [16:35:58.068] [TYTH {4078423634870272}:20051001233395|(809.98,2317.38,228.52,83.47)|(6086392/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (3 charges {836045448953667})
    [16:36:00.178] [@Player02#690552586359805|(825.38,2333.56,228.52,73.39)|(266279/492710)] [Lance {4078449404674048}:20051001356387|(821.27,2332.41,228.52,-97.34)|(82647/340388)] [Lacerate {975129374883840}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6459 energy {836045448940874}) <19376.0>
    [16:36:01.013] [Lance {4078449404674048}:20051001356387|(821.27,2332.41,228.52,-114.98)|(0/340388)] [] [] [Event {836045448945472}: TargetCleared {836045448953669}]
    [16:36:01.015] [TYTH {4078423634870272}:20051001233395|(806.65,2318.45,228.52,34.24)|(6045661/19989636)] [=] [ {4086833180835840}] [ModifyCharges {836045448953666}: Rage {4086833180836195}] (10 charges {836045448953667})
    [16:36:01.022] [Lance {4078449404674048}:20051001356387|(821.27,2332.41,228.52,-114.98)|(0/340388)] [=] [Volatile Platform {4176645241962496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (46225 internal {836045448940876})
    [16:36:01.025] [Lance {4078449404674048}:20051001356387|(821.27,2332.41,228.52,-114.98)|(0/340388)] [=] [Volatile Platform {4176645241962496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (46225 ~36422 internal {836045448940876})
    [16:36:01.025] [Lance {4078449404674048}:20051001356387|(821.27,2332.41,228.52,-114.98)|(0/340388)] [=] [] [Event {836045448945472}: Death {836045448945493}]
    )"
    for sample in [{Text:guardian,Boss:"N:4078423634870272:20051001104957:TYTH",Actor:"N:4078445109706752:20051001156823:Guardian",Amount:31585,Packets:1},
        {Text:lance,Boss:"N:4078423634870272:20051001233395:TYTH",Actor:"N:4078449404674048:20051001356387:Lance",Amount:82647,Packets:2}] {
        f := V647BossFixture(),f.Seg.BossActors := Map(sample.Boss,"boss")
        Loop Parse sample.Text,"`n","`r" {
            ev := IPParseLine(Trim(A_LoopField))
            V48Assert(IsObject(ev) && ev.ValueOK,"exact Sep29 platform record parses after player-name anonymization")
            ev.RecordId := f.Next,f.Next += 1
            if f.Seg.Start=0
                f.Seg.Start := ev.RawMs-1000
            IBCObserve(f.Seg,ev,ev.RawMs)
        }
        c := V6413PlatformRows(f),total := 0,count := 0
        for r in c.Rows {
            if r.Kind="add-damage" && r.Ability="4176645241962496" {
                V48Assert(r.Source=sample.Actor && r.Target=sample.Actor && r.HP=0,"raw platform NPC branch is self-sourced, same-instance and zero HP")
                total += r.Amount,count += 1
            }
        }
        V48Assert(total=sample.Amount && count=sample.Packets,"raw platform packet retains exact effective-damage sum")
        kills := IBCPlatformKills(c.Rows,sample.Boss,c.Gain)
        V48Assert(kills.Count=1 && kills.Has(sample.Actor),"actual Sep29 platform self-Death supplies one ordinary kill, not a generic self-Death rule")
    }
}

; Isolated counter-context diagnostics. Exact raw NPC evidence is identified
; below; synthetic fixtures never start the app, audio, network or live input.
; Groups: V6413CounterCapture, V6413CounterInitial, V6413CounterInitialGuards,
; V6413CounterReapply, V6413CounterPersistence, V6413CounterRollback,
; V6413CounterRawEvidence.
V6413CounterEvent(f,at,kind := "apply",count := 1,source := "",target := "=",ability := "4086833180835840")
{
    if source=""
        source := V647BossNPC("4078423634870272",700)
    return V647BossFeed(f,at,source,target,ability,kind="remove" ? "836045448945478" : "836045448945477",
        "4086833180836195",kind="remove" ? "" : "(" count " charges {836045448953667})")
}

V6413CounterInitialFixture(delay := 800)
{
    f := V647BossFixture(),V6413CounterEvent(f,5000,"remove"),V6410IntensifyCast(f,12000)
    f.Gain := V6413CounterEvent(f,12000+delay),V647BossEnd(f)
    return f
}

V6413CounterCapture()
{
    f := V6413CounterInitialFixture(),history := IBCDebugCheck(f.Pull,f.Recap).History
    V48Assert(V6410IntensifyRows(f,"rage-apply").Length=1 && V6410IntensifyRows(f,"rage-remove").Length=1,"exact manager Apply and Remove retain distinct counter markers")
    V48Assert(V6410IntensifyRows(f,"rage").Length=2,"original observed Rage rows remain alongside counter markers")
    V48Assert(f.Recap.BossEvidence.Version=7 && f.Recap.BossEvidence.Profile="tyth-rage-v7","counter markers declare schema seven")
    for scenario in ["player","add","wrong-boss-target","wrong-ability","modify-only","apply-zero"] {
        f := V647BossFixture(),boss := V647BossNPC("4078423634870272",700)
        if scenario="modify-only"
            V647BossRage(f,12000,1)
        else
            V6413CounterEvent(f,12000,"apply",scenario="apply-zero" ? 0 : 1,
                scenario="player" ? "@Source#1|(100/100)" : (scenario="add" ? V647BossNPC() : boss),
                scenario="wrong-boss-target" ? V647BossNPC("4078423634870272",999) : "=",
                scenario="wrong-ability" ? "4086833180836195" : "4086833180835840")
        V647BossEnd(f)
        V48Assert(V6410IntensifyRows(f,"rage-apply").Length=0,"counter marker capture rejects " scenario)
    }
}

V6413CounterInitial()
{
    for delay in [599,600,800,1200,1201] {
        f := V6413CounterInitialFixture(delay),check := IBCCheck(f.Pull,f.Recap)
        expected := delay>=600 && delay<=1200
        V48Assert(!!InStr(check.Text,"(+1, possible Intensify Rage)")=expected,"initial count correlation respects timing boundary " delay)
        history := IBCDebugCheck(f.Pull,f.Recap).History
        V48Assert(history.LastCount=1 && history.Changes[history.Changes.Length].Delta=1,"initial application remains one observed charge")
        V48Assert(history.Possible=0,"initial-cast explanation never supplies a cleave budget")
    }
    f := V647BossFixture(),V6413CounterEvent(f,5000,"remove"),V6410IntensifyCast(f,10500)
    V6413CounterEvent(f,11300),V6411BossWave(f,11500),V647BossRage(f,13600,5),V647BossZero(f,13610),V647BossEnd(f)
    text := IBCCheck(f.Pull,f.Recap).Text
    V48Assert(InStr(text,"(+1, possible Intensify Rage)") && InStr(text,"(+4, possible cleave; remaining +1 unclear)"),"initial explanation does not invent a hidden stack to spend on the later +4")
}

V6413CounterInitialGuards()
{
    for scenario in ["no-prior","prior-one","modify","no-cast","wrong-cast-boss","duplicate-cast","second-gain","failed-cast","interrupted","heal","decay","death","zero-only","same-ms-after-reference","wrong-mode"] {
        f := V647BossFixture()
        if scenario!="no-prior"
            V647BossRage(f,5000,scenario="prior-one" ? 1 : 0)
        if scenario!="no-cast"
            V6410IntensifyCast(f,scenario="same-ms-after-reference" ? 13200 : 12000,scenario="wrong-cast-boss" ? 999 : 700)
        if scenario="duplicate-cast"
            V6410IntensifyCast(f,12100)
        if scenario="failed-cast" || scenario="interrupted"
            V647BossFeed(f,12400,V647BossNPC("4078423634870272",700),"=","4076018453184512","836045448945472",scenario="failed-cast" ? "836045448945499" : "836045448945482")
        if scenario="same-ms-after-reference"
            V647BossEnd(f,false),V6413CounterEvent(f,14000)
        else if scenario="modify"
            V647BossRage(f,12800,1)
        else
            V6413CounterEvent(f,12800)
        if scenario="second-gain"
            V647BossRage(f,12900,3)
        if scenario="heal" || scenario="decay"
            V648ReductionFeed(f,scenario="heal" ? "grace-heal" : "rage-decay",12801)
        if scenario="death"
            V647BossKill(f,12801)
        if scenario="zero-only"
            V647BossZero(f,12801)
        if scenario="wrong-mode"
            f.Pull.Mode := "836045448953654"
        if scenario="same-ms-after-reference"
            IBCFreeze(f.Seg,f.Recap)
        else
            V647BossEnd(f)
        V48Assert(!InStr(IBCCheck(f.Pull,f.Recap).Text,"possible Intensify Rage"),"initial correlation rejects " scenario)
    }
}

V6413CounterReapply()
{
    for gap in [0,1,5,6] {
        f := V647BossFixture(),V647BossRage(f,5000,1)
        removed := V6413CounterEvent(f,12000,"remove"),V6413CounterEvent(f,12000+gap),V647BossKill(f,12010),V647BossEnd(f)
        text := IBCCheck(f.Pull,f.Recap).Text
        V48Assert(!!InStr(text,"Rage reapplied")=(gap<=5),"bounded exact replacement pair: " gap " ms")
        V48Assert(InStr(text,"(+1, add kill)"),"replacement context leaves the following ordinary kill attribution intact")
        history := IBCDebugCheck(f.Pull,f.Recap).History
        V48Assert(history.Changes[2].Row.Charges=0 && history.Changes[3].Row.Charges=1,"replacement observation preserves zero and one records")
    }
    for scenario in ["missing-apply","missing-remove","modify-apply","intervening-count","duplicate-apply","duplicate-remove","prior-two","apply-two","heal","decay","different-boss","same-ms-after-reference"] {
        f := V647BossFixture(),V647BossRage(f,5000,scenario="prior-two" ? 2 : 1)
        if scenario="missing-remove"
            V647BossRage(f,12000,0)
        else
            V6413CounterEvent(f,scenario="same-ms-after-reference" ? 14000 : 12000,"remove")
        if scenario="same-ms-after-reference"
            V647BossEnd(f,false)
        if scenario="intervening-count"
            V647BossRage(f,12000,3)
        if scenario="duplicate-remove"
            V6413CounterEvent(f,12000,"remove")
        if scenario="modify-apply"
            V647BossRage(f,12001,1)
        else if scenario!="missing-apply"
            V6413CounterEvent(f,scenario="same-ms-after-reference" ? 14000 : 12001,"apply",scenario="apply-two" ? 2 : 1,
                scenario="different-boss" ? V647BossNPC("4078423634870272",999) : "")
        if scenario="duplicate-apply"
            V6413CounterEvent(f,12002)
        if scenario="heal" || scenario="decay"
            V648ReductionFeed(f,scenario="heal" ? "grace-heal" : "rage-decay",12000)
        if scenario="same-ms-after-reference"
            IBCFreeze(f.Seg,f.Recap)
        else
            V647BossEnd(f)
        text := IBCCheck(f.Pull,f.Recap).Text
        V48Assert(!InStr(text,"Rage reapplied"),"replacement observation rejects " scenario)
        if scenario="heal" || scenario="decay"
            V48Assert(InStr(text,scenario="heal" ? "Grace heal" : "natural decay"),"completion marker keeps its established mechanic label")
    }
}

V6413CounterPersistence()
{
    f := V6413CounterInitialFixture(),before := IBCCheck(f.Pull,f.Recap).Text,p := IBCPackEvidence(f.Recap.BossEvidence)
    restored := IBCUnpackEvidence(IGJParse(IGVJson(p)),f.Pull,f.Recap),f.Recap.BossEvidence := restored
    V48Assert(IGVJson(IBCPackEvidence(restored))=IGVJson(p) && IBCCheck(f.Pull,f.Recap).Text=before,"strict saved v7 counter payload and report roundtrip exactly")
    index := 0
    for i,row in p[6] {
        if row[3]="rage-apply"
            index := i
    }
    for field,value in Map(4,"N:4078423634870272:999:Tyth",8,"@Fake#2",13,0,15,"4086833180836195",16,"N:4078423634870272:999:Tyth") {
        bad := IPRCloneSnapshot(p),bad[6][index][field] := value
        V64Reject((*) => IBCUnpackEvidence(bad,f.Pull,f.Recap),"saved counter marker rejects wrong boss/source/charge/ability/target field " field)
    }
    old := IBCCloneEvidence(restored),old.Version := 6,old.Profile := "tyth-rage-v6"
    V64Reject((*) => IBCPackEvidence(old),"legacy writer cannot disguise explicit new counter markers")
    bad := IPRCloneSnapshot(p),bad[1] := 6,bad[2] := "tyth-rage-v6"
    V64Reject((*) => IBCUnpackEvidence(bad,f.Pull,f.Recap),"legacy reader cannot claim explicit counter markers")
    keep := []
    for row in old.Rows {
        if row.Kind!="rage-apply" && row.Kind!="rage-remove"
            keep.Push(row)
    }
    old.Rows := keep,f.Recap.BossEvidence := IBCUnpackEvidence(IBCPackEvidence(old),f.Pull,f.Recap)
    V48Assert(!InStr(IBCCheck(f.Pull,f.Recap).Text,"possible Intensify Rage"),"legacy count one cannot be promoted into an exact initial application")
    f := V6413CounterInitialFixture(),history := IBCDebugCheck(f.Pull,f.Recap).History
    for row in history.Rows {
        if row.Kind="rage-apply" {
            history.Rows.Push(row.Clone())
            break
        }
    }
    V48Assert(IBCRageCounterReasons(history).Count=0,"duplicate marker cannot establish a unique application")
}

V6413CounterRollback()
{
    f := V647BossFixture(),V6413CounterEvent(f,5000,"remove"),V6413CounterEvent(f,12800),V647BossEnd(f)
    id := IDTCaseKey(f.Recap),f.Seg.DeathCapture.Cases[id] := f.Recap,before := IGVJson(IBCPackEvidence(f.Recap.BossEvidence))
    IPBBeginUndo(f.Data,f.Seg),V6410IntensifyCast(f,12000),updated := f.Seg.DeathCapture.Cases[id]
    V48Assert(InStr(IBCCheck(f.Pull,updated).Text,"possible Intensify Rage"),"late accepted cast explains a retained exact initial application")
    V48Assert(IGVJson(IBCPackEvidence(f.Recap.BossEvidence))=before,"late interpretation leaves previously published evidence immutable")
    IPBRollbackTail(f.Data,f.Seg)
    V48Assert(IGVJson(IBCPackEvidence(f.Seg.DeathCapture.Cases[id].BossEvidence))=before && !InStr(IBCCheck(f.Pull,f.Seg.DeathCapture.Cases[id]).Text,"possible Intensify Rage"),"rollback restores evidence and removes speculative initial interpretation")
    f := V647BossFixture(),V647BossRage(f,5000,1),V6413CounterEvent(f,12000,"remove"),V647BossEnd(f)
    id := IDTCaseKey(f.Recap),f.Seg.DeathCapture.Cases[id] := f.Recap,before := IGVJson(IBCPackEvidence(f.Recap.BossEvidence))
    IPBBeginUndo(f.Data,f.Seg),V6413CounterEvent(f,12001),updated := f.Seg.DeathCapture.Cases[id]
    V48Assert(InStr(IBCCheck(f.Pull,updated).Text,"Rage reapplied"),"late exact application completes replacement observation")
    IPBRollbackTail(f.Data,f.Seg)
    V48Assert(IGVJson(IBCPackEvidence(f.Seg.DeathCapture.Cases[id].BossEvidence))=before && !InStr(IBCCheck(f.Pull,f.Seg.DeathCapture.Cases[id]).Text,"Rage reapplied"),"rollback removes both late count and replacement marker")
}

V6413CounterRawEvidence()
{
    ; Verbatim NPC-only Sep29 lines147069/147738/147782 and59827/59878/59879.
    ; Source SHA256 ce1cf0cd561b5714fa62ce9d5b4bce7a0bdc07d7f2ce36f76bea4be98def6a36.
    ; These helper-level replays do not invent an Overload or player death.
    raw := "
    (
    [17:00:10.288] [TYTH {4078423634870272}:20051001633365|(798.12,2367.93,228.52,-98.99)|(5887518/19989636)] [=] [ {4086833180835840}] [RemoveEffect {836045448945478}: Rage {4086833180836195}]
    [17:00:22.901] [TYTH {4078423634870272}:20051001633365|(805.99,2368.62,228.52,-78.83)|(4431265/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]
    [17:00:23.796] [TYTH {4078423634870272}:20051001633365|(805.99,2368.62,228.52,-89.68)|(4409859/19989636)] [=] [ {4086833180835840}] [ApplyEffect {836045448945477}: Rage {4086833180836195}] (1 charges {836045448953667})
    )"
    V6413CounterRawPair(raw,"possible Intensify Rage")
    raw := "
    (
    [16:18:23.668] [TYTH {4078423634870272}:20051001012284|(823.87,2366.02,228.52,-48.72)|(11898017/19989636)] [=] [ {4086833180835840}] [ApplyEffect {836045448945477}: Rage {4086833180836195}] (1 charges {836045448953667})
    [16:18:24.169] [TYTH {4078423634870272}:20051001012284|(826.98,2363.18,228.52,-43.32)|(11898017/19989636)] [=] [ {4086833180835840}] [RemoveEffect {836045448945478}: Rage {4086833180836195}]
    [16:18:24.170] [TYTH {4078423634870272}:20051001012284|(826.98,2363.18,228.52,-43.32)|(11898017/19989636)] [=] [ {4086833180835840}] [ApplyEffect {836045448945477}: Rage {4086833180836195}] (1 charges {836045448953667})
    )"
    V6413CounterRawPair(raw,"Rage reapplied",true)
}

V6413CounterRawPair(raw,expected,reapplied := false)
{
    f := V647BossFixture(),counts := [],changes := [],positives := [],last := ""
    Loop Parse raw,"`n","`r" {
        ev := IPParseLine(Trim(A_LoopField)),ev.RecordId := f.Next,f.Next += 1
        V48Assert(IsObject(ev) && ev.ValueOK,"NPC-only raw counter record parses")
        if f.Seg.Start=0
            f.Seg.Start := ev.RawMs-1000
        f.Seg.BossActors := Map(ev.Source.Key,"boss")
        IBCObserve(f.Seg,ev,ev.RawMs)
    }
    rows := IBCOrdered(f.Seg.BossCheckState.Rows)
    for row in rows {
        if row.Kind!="rage"
            continue
        change := {Row:row,Previous:IsObject(last) ? last.Charges : "",Delta:IsObject(last) ? row.Charges-last.Charges : ""}
        changes.Push(change)
        if change.Delta!="" && change.Delta>0
            positives.Push(change)
        last := row
    }
    history := {Boss:ev.Source.Key,Rows:rows,Changes:changes,PositiveChanges:positives,Verified:true,Reference:ev.RawMs,ReferenceRecord:ev.RecordId}
    reasons := IBCRageCounterReasons(history),reasonRecord := reapplied ? changes[2].Row.Record : ev.RecordId
    V48Assert(reasons.Count=1 && reasons.Get(reasonRecord,"")=expected,"real exact counter sequence receives bounded explanation: " expected)
    V48Assert(changes[changes.Length].Row.Charges=1 && changes[changes.Length].Delta=1,"real count and delta remain unmodified")
}

; Conservative report-only lower bounds. Graph fixtures are synthetic unless
; marked as a reduced raw-log chronology; no callout state or audio is touched.
; Groups: V6413KillAssignmentBounds, V6413KillAssignmentAmbiguity,
; V6413KillAssignmentGuards, V6413KillAssignmentFacts,
; V6413KillAssignmentBudgets, V6413KillAssignmentLimits,
; V6413KillAssignmentNativeReport.

V6413AssignmentHistory()
{
    boss := "N:4078423634870272:700:Tyth"
    return {Boss:boss,Rows:[{Kind:"rage",At:1000,Record:1,Boss:boss,Actor:"",Source:boss,Charges:5}],
        PositiveChanges:[],ReductionChanges:[],Groups:Map(),Intensify:Map(),Verified:true,
        Partial:false,RetainedFrom:0,Reference:50000,ReferenceRecord:1000}
}

V6413AssignmentGain(h,at,delta,record)
{
    row := {Kind:"rage",At:at,Record:record,Boss:h.Boss,Actor:"",Source:h.Boss,Charges:delta}
    h.Rows.Push(row),h.PositiveChanges.Push({Row:row,Delta:delta})
    return row
}

V6413AssignmentDeath(h,at,record,instance,source := "@Killer#1")
{
    row := {Kind:"add-death",At:at,Record:record,Boss:h.Boss,Actor:"N:4078445109706752:" instance ":Guardian",Source:source}
    h.Rows.Push(row)
    return row
}

V6413AssignmentPrepare(h)
{
    rows := Map()
    for i,row in h.Rows
        rows[i] := row
    h.Rows := IBCOrdered(rows)
    return h
}

V6413AssignmentTriple()
{
    h := V6413AssignmentHistory()
    ; Sep29's exact relative chronology. This is a reduced synthetic graph,
    ; not a replacement for the separate full-file native import.
    V6413AssignmentGain(h,13127,2,10),V6413AssignmentDeath(h,13143,11,701)
    V6413AssignmentGain(h,13526,1,20),V6413AssignmentDeath(h,13535,21,702)
    V6413AssignmentGain(h,13725,1,30),V6413AssignmentDeath(h,13731,31,703)
    return V6413AssignmentPrepare(h)
}

V6413KillAssignmentBounds()
{
    h := V6413AssignmentTriple(),counts := IBCOrdinaryKillLowerBounds(h)
    V48Assert(counts.Count=1 && counts[10]=1,"three distinct deaths in overlapping capacities2/1/1 force at least one kill into the initial+2 without guessing which add")
    V48Assert(!counts.Has(20) && !counts.Has(30),"later+1 records keep uncertainty when an alternative complete assignment leaves either unused")
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,2,10)
    V6413AssignmentDeath(h,10001,11,701),V6413AssignmentDeath(h,10002,12,702),V6413AssignmentPrepare(h)
    counts := IBCOrdinaryKillLowerBounds(h)
    V48Assert(counts.Count=1 && counts[10]=2,"two distinct explicit deaths uniquely matched to one+2 provide two supported kills")
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,1,10),V6413AssignmentGain(h,10200,1,20)
    V6413AssignmentDeath(h,10010,11,701),V6413AssignmentDeath(h,10210,21,702),V6413AssignmentPrepare(h)
    counts := IBCOrdinaryKillLowerBounds(h)
    V48Assert(counts.Count=2 && counts[10]=1 && counts[20]=1,"two deaths can prove one kill per full unit-capacity update even while their individual identities are interchangeable")
}

V6413KillAssignmentAmbiguity()
{
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,2,10),V6413AssignmentGain(h,10200,2,20)
    V6413AssignmentDeath(h,10010,11,701),V6413AssignmentDeath(h,10210,21,702),V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Count=0,"two deaths and two spare-capacity updates have no forced per-update count")
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,1,10)
    V6413AssignmentDeath(h,10001,11,701),V6413AssignmentDeath(h,10002,12,702),V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Count=0,"an overfull component cannot force one conveniently selected death into the only observed+1")
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,19950,1,10),V6413AssignmentDeath(h,19951,11,701)
    V6413AssignmentGain(h,20050,1,20),V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Count=0,"one death shared across the30second display boundary is not reused or forced into the displayed gain")
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,1,10),V6413AssignmentGain(h,11000,1,20)
    V6413AssignmentDeath(h,10500,11,701),V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Count=0,"exact500ms edges are both retained instead of selecting a nearest tie")
    h.Rows[2].At := 9999,h.PositiveChanges[1].Row.At := 9999,V6413AssignmentPrepare(h)
    counts := IBCOrdinaryKillLowerBounds(h)
    V48Assert(counts.Count=1 && counts[20]=1,"a501ms edge is excluded while the true500ms alternative remains eligible")
}

V6413KillAssignmentGuards()
{
    for scenario in ["partial","unverified","unknown-retention","capture-start","overload-end","unknown-baseline","negative-update","heal","decay","dr","apply","remove"] {
        h := V6413AssignmentTriple()
        if scenario="partial"
            h.Partial := true
        else if scenario="unverified"
            h.Verified := false
        else if scenario="unknown-retention"
            h.DeleteProp("RetainedFrom")
        else if scenario="capture-start"
            h.RetainedFrom := 12627
        else if scenario="overload-end"
            h.Reference := 14231
        else if scenario="unknown-baseline"
            h.Rows[1].At := 13000
        else {
            kind := scenario="heal" ? "grace-heal" : (scenario="decay" ? "rage-decay" : (scenario="dr" ? "grace-dr" : (scenario="apply" ? "rage-apply" : (scenario="remove" ? "rage-remove" : "rage"))))
            row := {At:13400,Record:15,Kind:kind,Boss:h.Boss,Actor:"",Source:h.Boss}
            h.Rows.Push(row)
            if scenario="negative-update"
                h.ReductionChanges.Push({Row:row,Delta:-1})
        }
        V6413AssignmentPrepare(h)
        V48Assert(IBCOrdinaryKillLowerBounds(h).Count=0,"no forced allocation with " scenario " uncertainty")
    }
    h := V6413AssignmentTriple(),h.Rows.Push({At:13400,Record:15,Kind:"rage-remove",Boss:"N:4078423634870272:999:Tyth",Actor:"",Source:"N:4078423634870272:999:Tyth"})
    V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Get(10,0)=1,"another boss's counter event cannot invalidate this scoped death component")
    h := V6413AssignmentTriple(),h.Rows.Push({At:20000,Record:99,Kind:"grace-heal",Boss:h.Boss,Actor:"",Source:h.Boss})
    V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Get(10,0)=1,"a distant completion outside the connected interval does not erase a proven minimum")
}

V6413KillAssignmentFacts()
{
    for source in ["?","N:4078423634870272:700:Tyth","N:4078445109706752:701:Guardian","N:4078449404674048:702:Lance"] {
        h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,1,10),V6413AssignmentDeath(h,10001,11,701,source),V6413AssignmentPrepare(h)
        V48Assert(IBCOrdinaryKillLowerBounds(h).Count=0,"unknown, boss, self and other NPC death sources are not explicit player-kill facts: " source)
    }
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,2,10)
    death := V6413AssignmentDeath(h,10001,11,701),V6413AssignmentDeath(h,10002,12,701),V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Get(10,0)=1,"duplicate Death records for one add instance remain one fact")
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,2,10)
    death := V6413AssignmentDeath(h,10001,11,701)
    h.Rows.Push({At:10002,Record:12,Kind:"add-alive",Actor:death.Actor,Boss:h.Boss,Source:death.Actor,HP:100})
    V6413AssignmentDeath(h,10003,13,701),V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Get(10,0)=1,"a contradictory positive corpse snapshot cannot rearm a second life or kill")
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,1,10)
    V6413AssignmentDeath(h,9990,9,701,"N:4078445109706752:701:Guardian"),V6413AssignmentDeath(h,10001,11,701),V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Count=0,"a prior self-death prevents a later player Death from claiming an already-dead add")
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,1,10)
    h.Rows.Push({At:10001,Record:11,Kind:"add-damage",Actor:"N:4078445109706752:701:Guardian",Boss:h.Boss,Source:"@Killer#1",HP:0,Amount:100})
    V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Count=0,"first-zero damage remains competing evidence and cannot force a definite death assignment")
}

V6413KillAssignmentBudgets()
{
    for scenario in ["known-intensify","known-cleave","ambiguous-intensify","ambiguous-cleave"] {
        h := V6413AssignmentTriple()
        if scenario="known-intensify"
            h.Intensify[10] := {Ambiguous:false}
        else if scenario="known-cleave"
            h.Groups[10] := {Ambiguous:false,Names:["Guardian"]}
        else if scenario="ambiguous-intensify"
            h.Intensify[10] := {Ambiguous:true}
        else
            h.Groups[10] := {Ambiguous:true,Names:[]}
        V48Assert(IBCOrdinaryKillLowerBounds(h).Count=0,"reserved or ambiguous " scenario " budget cannot be spent again on an ordinary kill")
    }
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,3,10),V6413AssignmentDeath(h,10001,11,701)
    h.Intensify[10] := {Ambiguous:false},V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Get(10,0)=1,"+3 retains one ordinary-kill slot after reserving two for Intensify")
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,4,10),V6413AssignmentDeath(h,10001,11,701)
    h.Groups[10] := {Ambiguous:false,Names:["Lance"]},V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Get(10,0)=1,"+4 retains one ordinary-kill slot after a distinct three-Rage cleave")
}

V6413KillAssignmentLimits()
{
    for count in [24,25] {
        h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,count,10)
        Loop count
            V6413AssignmentDeath(h,10000+A_Index,20+A_Index,700+A_Index)
        V6413AssignmentPrepare(h),result := IBCOrdinaryKillLowerBounds(h)
        V48Assert(count=24 ? result.Get(10,0)=24 : result.Count=0,"bounded component size is conservative at " count " explicit deaths")
    }
    h := V6413AssignmentHistory(),V6413AssignmentGain(h,10000,1000000,10),V6413AssignmentDeath(h,10001,11,701),V6413AssignmentPrepare(h)
    V48Assert(IBCOrdinaryKillLowerBounds(h).Get(10,0)=1,"large Rage values do not allocate a million slots or inflate the one observed death")
    h := V6413AssignmentTriple(),h.PositiveChanges.Push(h.PositiveChanges[1])
    V48Assert(IBCOrdinaryKillLowerBounds(h).Count=0,"duplicate counter-record identity aborts optional proof instead of inflating capacity")
}

V6413KillAssignmentNativeReport()
{
    f := V647BossFixture(),V647BossRage(f,5000,5),first := V647BossRage(f,13127,7),V647BossKill(f,13143,701)
    V647BossRage(f,13526,8),V647BossKill(f,13535,702),V647BossRage(f,13725,9),V647BossKill(f,13731,703)
    V649BossWindowEnd(f,16000,16500,17000)
    h := IBCDebugCheck(f.Pull,f.Recap).History,check := IBCCheck(f.Pull,f.Recap)
    V48Assert(h.OrdinaryCounts.Get(first.RecordId,0)=1 && InStr(check.Text,"(+2, add kill; remaining +1 unclear)"),"native report preserves a forced minimum kill without claiming both deaths belonged to the initial+2")
    V48Assert(!InStr(check.Text,"(+2, 2 add kills)"),"native report does not turn minimum evidence into an exact two-kill claim")
    f.Recap.BossEvidence := IBCUnpackEvidence(IGJParse(IGVJson(IBCPackEvidence(f.Recap.BossEvidence))),f.Pull,f.Recap)
    V48Assert(IBCCheck(f.Pull,f.Recap).Text=check.Text,"saved and reopened evidence retains the global minimum explanation")
    for row in f.Recap.BossEvidence.Rows {
        if row.Kind="add-death" && row.ActorId="4078445109706752"
            row.Source := row.Actor
    }
    V48Assert(!InStr(IBCCheck(f.Pull,f.Recap).Text,"(+2, add kill;"),"removing explicit player deaths removes the forced explanation instead of trusting the old display result")
}

; Saved-import decoder regressions. No timing thresholds or live app startup.
; Groups: V6414ImmutableFieldDecode, V6414FieldDecodeEviction,
; V6414MutableDecodeIsolation, V6414HealthAllocationParity,
; V6414IncomingExtremaSnapshot, V6414LazyMetricParity,
; V6414ActorInsertJournal.

V6414DecodeLine(ability, effect, tail := " (20 ~10) <2>", source := "@Decode#6414|(0,0,0,0)|(80/100)", target := "=")
{
    return "[01:02:03.004] [" source "] [" target "] [" ability "] [" effect "]" tail
}

V6414ImmutableFieldDecode()
{
    abilities := [["","(no ability)",""],[" {7}","(no ability)","7"],
        [" Name {0007}","Name","0007"],["Name {7} ","Name {7}",""],
        ["Nested [Rank] {7}","Nested [Rank]","7"],["Name {broken}","Name {broken}",""],
        ["Name {7}{8}","Name {7}","8"],["Δοκιμή 雪 {99}","Δοκιμή 雪","99"],
        ["ab {1}","ab","1"],["AB {1}","AB","1"]]
    ; Expected fields come from the pre-cache grammar: labels are display text,
    ; IDs select the event, and area grammar intentionally permits a suffix.
    effects := [
        ["ApplyEffect {836045448945477}: Damage {836045448945501}","836045448945477","836045448945501","Damage","Damage","",""],
        ["ApplyEffect {836045448945477}: damage {836045448945501}","836045448945477","836045448945501","damage","Damage","",""],
        ["Localized {836045448945477}: Heál [target] {836045448945500}","836045448945477","836045448945500","Heál [target]","Heal","",""],
        ["Event {836045448945472}: Enter {836045448945489}","836045448945472","836045448945489","Enter","Enter","",""],
        ["Event {836045448945472}: Exit {836045448945490}","836045448945472","836045448945490","Exit","Exit","",""],
        ["Event {836045448945472}: Death {836045448945493}","836045448945472","836045448945493","Death","Death","",""],
        ["Event {836045448945472}: Activate {836045448945479}","836045448945472","836045448945479","Activate","Activate","",""],
        ["Unknown {99}: Unknown {7}","99","7","Unknown","Other","",""],
        ["Localized {836045448953664}: Place {123}","836045448953664","123","Place","Area","123",""],
        ["Localized {836045448953664}: Place {123} Mode {456} trailing text","","","Localized {836045448953664}: Place {123} Mode {456} trailing text","Area","123","456"],
        ["AreaEntered`t{999}","","","AreaEntered`t{999}","Area","",""],
        ["areaEntered {999}","","","areaEntered {999}","Other","",""],
        ["Other {123}: Wrong {836045448953664}","123","836045448953664","Wrong","Other","",""],
        ["Localized {836045448953664}: Place {broken}","","","Localized {836045448953664}: Place {broken}","Other","",""],
        ["AreaEntered {836045448953664}: Place {broken}","","","AreaEntered {836045448953664}: Place {broken}","Area","",""],
        ["ApplyEffect {836045448945477}: Damage {836045448945501} suffix","","","ApplyEffect {836045448945477}: Damage {836045448945501} suffix","Other","",""]]
    Loop 2 {
        for ability in abilities {
            for effect in effects {
                ev := IPParseLine(V6414DecodeLine(ability[1],effect[1]))
                actual := [ev.Ability,ev.AbilityId,ev.ActionId,ev.EffectId,ev.Effect,ev.Kind,ev.AreaId,ev.ModeId]
                wanted := [ability[2],ability[3],effect[2],effect[3],effect[4],effect[5],effect[6],effect[7]]
                V48Assert(V6410Exact(actual)==V6410Exact(wanted),"cold/warm field decoding retains exact labels, IDs, whitespace, nested brackets, case and area grammar")
            }
        }
    }
    V48Assert(!IsObject(IPParseLine(V6414DecodeLine("Nested [too [deep]] {1}",effects[1][1]))),"field caching never bypasses structural bracket validation")
    V48Assert(!IsObject(IPParseLine(StrReplace(V6414DecodeLine("Name {1}",effects[1][1]),"01:02:03.004","24:02:03.004"))),"warm field caching never bypasses timestamp validation")
}

V6414FieldDecodeEviction()
{
    effect := "ApplyEffect {836045448945477}: Damage {836045448945501}"
    line := V6414DecodeLine("Retained 雪 {6414}",effect)
    retained := IPParseLine(line),before := V6410Exact(retained)
    Loop 2200 {
        id := 900000+A_Index
        ev := IPParseLine(V6414DecodeLine("Cache probe {" id "}","Other {99}: Probe {" id "}"))
        if A_Index=2200
            V48Assert(ev.AbilityId=="902200" && ev.EffectId=="902200" && ev.Kind=="Other","both bounded field caches continue decoding after eviction")
    }
    V48Assert(V6410Exact(retained)==before && V6410Exact(IPParseLine(line))==before,"eviction preserves retained events and later re-decoding")
    longName := ""
    Loop 1100
        longName .= "x"
    longEffect := "ApplyEffect {836045448945477}: " longName " {836045448945501}"
    Loop 2 {
        ev := IPParseLine(V6414DecodeLine(longName " {07}",longEffect))
        V48Assert(ev.Ability==longName && ev.AbilityId=="07" && ev.Effect==longName && ev.Kind=="Damage","long fields bypass storage without truncation or a new acceptance limit")
        ev.Ability := "changed",ev.Effect := "changed"
    }
}

V6414MutableDecodeIsolation()
{
    effect := "ApplyEffect {836045448945477}: Heal {836045448945500}"
    line := V6414DecodeLine("Repeat {6414}",effect)
    a := IPParseLine(line),b := IPParseLine(line),expected := V6410Exact(b)
    V48Assert(ObjPtr(a)!=ObjPtr(b) && ObjPtr(a.Source)!=ObjPtr(b.Source)
        && ObjPtr(a.Source)=ObjPtr(a.Target) && ObjPtr(a.SourceHP)!=ObjPtr(a.TargetHP)
        && ObjPtr(a.Threat)!=ObjPtr(b.Threat),"field reuse retains separate mutable events, actors, HP and threat with the original equals alias")
    a.Ability := "changed",a.AbilityId := "1",a.Kind := "Area",a.ActionId := "2",a.EffectId := "3",a.Effect := "changed"
    a.AreaId := "4",a.ModeId := "5",a.Source.Name := "changed",a.SourceHP.Current := 0,a.TargetHP.Current := 1,a.Threat.Value := 999
    V48Assert(V6410Exact(b)==expected && V6410Exact(IPParseLine(line))==expected,"mutable event fields cannot poison cached field templates or other events")
    fresh := IPParseLine(V6414DecodeLine("Repeat {6414}",effect," (31* ~0) <-8>","@Decode#6414|(0,0,0,0)|(0/100)"))
    V48Assert(fresh.RawMs=3723004 && fresh.Amount=31 && fresh.Effective=0 && fresh.Crit && !fresh.TargetAlive
        && fresh.SourceHP.Current=0 && fresh.TargetHP.Current=0 && fresh.Threat.Value=-8,"warm fields still decode this record's amounts, effective healing, critical flag, HP and threat")
    explicit := IPParseLine(V6414DecodeLine("Repeat {6414}",effect," (20 ~10) <2>","@Decode#6414|(0,0,0,0)|(80/100)","@Decode#6414|(0,0,0,0)|(80/100)"))
    V48Assert(explicit.Source.Key==explicit.Target.Key && ObjPtr(explicit.Source)!=ObjPtr(explicit.Target),"explicit same-actor tokens do not acquire the equals-marker alias")
    area := IPParseLine(V6414DecodeLine("Repeat {6414}","Localized {836045448953664}: Place {123} Mode {456}"))
    area.AreaId := "mutated",area.ModeId := "mutated"
    again := IPParseLine(V6414DecodeLine("Repeat {6414}","Localized {836045448953664}: Place {123} Mode {456}"))
    V48Assert(again.AreaId=="123" && again.ModeId=="456","area and difficulty fields remain isolated from prior events")
}

V6414HealthAllocationParity()
{
    fixtures := [["@HP#1|(0/100)",true,0,100],["@HP#1|(100/100)",true,100,100],
        ["@HP#1|(1/1000000000000)",true,1,1000000000000],["@HP#1|(0001/0100)",true,1,100],
        ["@HP#1|(101/100)",false,0,0],["@HP#1|(0/0)",false,0,0],
        ["@HP#1|(1/1000000000001)",false,0,0],["@HP#1|(-1/100)",false,0,0],
        ["@HP#1|(1.5/100)",false,0,0],["@HP#1|(1/100) trailing",false,0,0],["",false,0,0]]
    for fixture in fixtures {
        a := IRHealthField(fixture[1]),b := IRHealthField(fixture[1])
        V48Assert(a.Known=fixture[2] && a.Current=fixture[3] && a.Maximum=fixture[4],"single-allocation health parsing preserves exact valid and invalid boundaries")
        a.Known := !fixture[2],a.Current := 777,a.Maximum := 888
        V48Assert(ObjPtr(a)!=ObjPtr(b) && b.Known=fixture[2] && b.Current=fixture[3] && b.Maximum=fixture[4],"known and unknown HP objects are always independently mutable")
    }
}

V6414IncomingExtremaSnapshot()
{
    s := IPNewData("incoming snapshot"),seg := IPNewSegment(s,0,"synthetic")
    first := V64Line(1000,V64Boss(),V64Actor(900),"Damage",25,25)
    second := V64Line(1100,V64Boss(),V64Actor(800),"Damage",90,90)
    IPApplyEvent(s,first,1000),IPApplyEvent(s,second,1100)
    key := first.Target.Key,priorChain := seg.LastIncoming[key]
    rowkey := priorChain[1].RowKey
    V48Assert(seg.Rows[rowkey].Min=25 && seg.Rows[rowkey].Max=90 && priorChain[1].Before.Min=25 && priorChain[1].Before.Max=25,"a prior aggregate cannot overwrite the independent pre-hit extrema snapshot")
    IPBBeginUndo(s,seg)
    lethal := V64Line(1500,V64Boss(),V64Actor(0),"Damage",100,40)
    follow := V64Line(1501,V64Boss(),V64Actor(0),"Damage",70,10)
    IPApplyEvent(s,lethal,1500),IPApplyEvent(s,follow,1501)
    chain := seg.LastIncoming[key]
    V48Assert(chain.Length=2 && chain[1].Before.Min=25 && chain[1].Before.Max=90 && seg.Rows[rowkey].Max=100,"multi-result lethal bursts retain the extrema before the whole burst")
    IPApplyEvent(s,V64Line(1502,V64Boss(),V64Actor(0),"Death",0),1502)
    totals := seg.Totals[key],row := seg.Rows[rowkey]
    V48Assert(totals.Taken=165 && totals.RawTaken=285 && totals.Overkill=120 && row.Min=10 && row.Max=90,"lethal correction combines the saved extrema with each corrected burst result")
    V48Assert(chain[1].Before.Min=25 && chain[1].Before.Max=90 && priorChain[1].Before.Max=25,"correction does not mutate snapshots retained by previous chains")
    IPBRollbackTail(s,seg)
    totals := seg.Totals[key],row := seg.Rows[rowkey]
    V48Assert(totals.Taken=115 && totals.RawTaken=115 && totals.Overkill=0 && totals.Deaths=0
        && row.Min=25 && row.Max=90 && !seg.TakenOverrides.Has(lethal.RecordId),"rollback restores aggregate extrema, totals and lethal overrides")
    restored := seg.LastIncoming[key]
    V48Assert(restored.Length=1 && restored[1].At=1100 && restored[1].Before.Min=25 && restored[1].Before.Max=25,"rollback restores the original incoming chain and its independent snapshot")
}

; Frozen pre-v64.14 predicate, retained only as a differential test oracle.
V6414OriginalMetricAllowed(seg, ev, metric)
{
    if !IsObject(seg.Profile)
        return true
    p := seg.Profile, key := p.Key, id := ev.AbilityId
    srcPlayer := IPBIsPlayer(ev.Source), dstPlayer := IPBIsPlayer(ev.Target)
    npc := IPBNpcId(ev.Target)
    if ev.Kind = "Damage" {
        if srcPlayer && dstPlayer {
            if key = "XR-53" && id = "4825043569738028"
                return metric != "Damage" && metric != "Threat"
            if key = "TOS-RE" && (id = "3454111483691008" || id = "3968412342550528")
                return metric != "Damage" && metric != "Taken" && metric != "Threat"
            if ev.Source.Key = ev.Target.Key && metric = "Taken" && IPXSelfHazard(key,id)
                return false
            if key = "DX-E1" && IPXSelfHazard(key,id) && metric = "Threat"
                return false
        }
        if p.Marker != "" && npc = p.Marker && p.ReportOnly && (metric = "Damage" || metric = "Threat")
            return false
    }
    if ev.Kind = "Heal" && srcPlayer {
        if (key = "DP-RA" && npc = "3289335063379968") || (key = "SNV-OL" && npc = "3129807093104640")
            return false
        if ev.Effective = 0 && ((key = "DF-GR" && npc = "3286264161763328")
            || (key = "SNV-TI" && npc = "3060993127088128")
            || (key = "DX-AP" && npc = "4384306910724096")
            || (key = "TOS-CO" && npc = "3460270466793472"))
            return false
    }
    return true
}

V6414LazyMetricParity()
{
    cases := []
    for rule in [["XR-53","4825043569738028"],["XR-53","04825043569738028"],["XR-53","0"],
        ["xr-53","4825043569738028"],["TOS-RE","3454111483691008"],["TOS-RE","3968412342550528"],
        ["TOS-RE","0"],["TFB-TF","3246243656499200"],["QUEEN","4205589026570240"],
        ["QUEEN","2473484550668288"],["DX-E1","4250600283832602"],["DX-E1","801140249723176"],
        ["DX-E2","801140249723176"],["EV-GH","2034354209423616"],["EV-GH","4574075745730560"],
        ["DP-CA","3306252939559206"],["RAV-MB","3395476590166277"],["RAV-MB","3420099637674269"],
        ["SNV-TI","3061534292967424"],["SNV-OL","3143100016886018"],["SNV-ST","3226186159227138"],
        ["G-TY","4825043569738028"],["G-NA","3454111483691008"],["Unknown","801140249723176"]]
        cases.Push([rule[1],rule[2],"99","Damage",7])
    for rule in [["DP-RA","3289335063379968"],["SNV-OL","3129807093104640"],
        ["DF-GR","3286264161763328"],["SNV-TI","3060993127088128"],
        ["DX-AP","4384306910724096"],["TOS-CO","3460270466793472"]] {
        for effective in [0,7]
            cases.Push([rule[1],"123",rule[2],"Heal",effective])
    }
    cases.Push(["DX-AP","123","4384306910724096","Heal",-1],
        ["G-TY","123","3289335063379968","Heal",0],["TOS-RE","3454111483691008","99","Other",0])
    player := IPActor("@Metric#6414"),peer := IPActor("@Peer#6414")
    companion := IPActor("@Metric#6414/Companion {12}:1"),otherCompanion := IPActor("@Peer#6414/Companion {12}:2")
    unknown := IPActor(""),otherNpc := IPActor("Other {98}:1")
    count := 0
    for fixture in cases {
        npc := IPActor("Target {" fixture[3] "}:1")
        pairs := [[player,peer],[player,player],[companion,player],[player,companion],
            [companion,companion],[companion,otherCompanion],[npc,player],[player,npc],
            [companion,npc],[unknown,npc],[player,otherNpc],[npc,npc],[otherNpc,npc],[player,unknown]]
        ; Marker combinations only multiply Damage cases, where they matter.
        markers := fixture[4]="Damage" ? [["",false],[fixture[3],true],[fixture[3],false],["97",true]] : [["",false]]
        for marker in markers {
            seg := {Profile:{Key:fixture[1],Marker:marker[1],ReportOnly:marker[2]}}
            for pair in pairs {
                ev := {Kind:fixture[4],AbilityId:fixture[2],Source:pair[1],Target:pair[2],Effective:fixture[5]}
                for metric in ["Damage","Taken","Threat","Heal","Received","Other"] {
                    expected := V6414OriginalMetricAllowed(seg,ev,metric)
                    V48Assert(IPXMetricAllowed(seg,ev,metric)=expected,"lazy metric policy matches the original scoped player/companion/self/marker/heal decision")
                    count += 1
                }
            }
        }
    }
    V48Assert(count=9324,"differential matrix executed every declared rule/actor/metric case")
    ev := {Kind:"Damage",AbilityId:"3454111483691008",Source:player,Target:peer,Effective:0}
    seg := {Profile:{Key:"TOS-RE",Marker:"",ReportOnly:false}}
    V48Assert(!IPXMetricAllowed(seg,ev,"Taken"),"a scoped player-to-player exclusion remains active")
    seg.Profile := ""
    V48Assert(IPXMetricAllowed(seg,ev,"Taken"),"removing encounter context is observed on the very next call")
    seg.Profile := {Key:"TOS-RE",Marker:"",ReportOnly:false},ev.Target := otherNpc
    V48Assert(IPXMetricAllowed(seg,ev,"Taken"),"changing the current target cannot reuse a prior actor decision")
    ev.Target := peer,ev.Kind := "Heal"
    V48Assert(IPXMetricAllowed(seg,ev,"Taken"),"changing event kind cannot reuse a prior damage decision")
}

V6414ActorInsertJournal()
{
    s := IPNewData("actor journal"),seg := IPNewSegment(s,0,"synthetic")
    first := V64Line(1000,V64Actor(),V64Boss(),"Damage",25)
    IPApplyEvent(s,first,1000)
    playerKey := first.Source.Key,bossKey := first.Target.Key
    player := seg.Actors[playerKey],boss := seg.Actors[bossKey]
    IPBBeginUndo(s,seg)
    IPApplyEvent(s,V64Line(1100,V64Actor(),V64Boss(),"Damage",50),1100)
    V48Assert(!seg.Undo.Maps.Has("Actors") && seg.Undo.Maps.Has("Totals"),"existing identities need no speculative clone while changed totals remain journaled")
    freshNpc := V64Line(1200,V64Actor(),"New NPC {2857785339412480}:6414|(900/1000)","Damage",60)
    IPApplyEvent(s,freshNpc,1200)
    V48Assert(seg.Actors.Has(freshNpc.Target.Key) && seg.Undo.Maps["Actors"].Values.Has(freshNpc.Target.Key)
        && !seg.Undo.Maps["Actors"].Values[freshNpc.Target.Key].Exists,"a new target is journaled before its first insertion")
    self := V64Line(1300,"@New Source#6414|(1000/1000)","=","Heal",20,20)
    IPApplyEvent(s,self,1300)
    V48Assert(seg.Actors.Has(self.Source.Key) && seg.Undo.Maps["Actors"].Values.Count=2
        && !seg.Undo.Maps["Actors"].Values[self.Source.Key].Exists,"a new equals-target alias journals its one identity once")
    IPBRollbackTail(s,seg)
    V48Assert(seg.Actors.Count=2 && !seg.Actors.Has(freshNpc.Target.Key) && !seg.Actors.Has(self.Source.Key)
        && !seg.Totals.Has(freshNpc.Target.Key) && !seg.Totals.Has(self.Source.Key),"rollback removes new actors and their totals without losing pre-existing identities")
    V48Assert(ObjPtr(seg.Actors[playerKey])=ObjPtr(player) && ObjPtr(seg.Actors[bossKey])=ObjPtr(boss)
        && seg.Totals[playerKey].Damage=25 && seg.Totals[bossKey].Taken=25,"existing actor aliases stay stable and earlier combat totals are restored")
}

; Progression metadata guards for the v64.14 import optimization.
; These checks use private synthetic segments, not timing or live app state.
; Groups: V6414ProgressOpeningGuards, V6414ProgressLateOpening,
; V6414ProgressHealthSides, V6414ProgressContextChange, V6414ProgressUndo.

V6414ProgressOpeningGuards()
{
    seg := V63Segment("G-TY"),ev := V63Event("Activate","4078423634870272",80),ev.Kind := "Other"
    IGPObserve(seg,ev,1000)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=0,"health metadata alone cannot establish the HP-only phase")
    ev.Kind := "Damage",ev.Amount := 100,ev.Immune := true
    IGPObserve(seg,ev,1100)
    ev.Immune := false,ev.FullAbsorb := true
    IGPObserve(seg,ev,1200)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=0,"immune and fully absorbed damage still cannot establish an HP-only phase")
    ev.FullAbsorb := false,ev.Kind := "Activate",ev.SourceHP.Known := false
    IGPObserve(seg,ev,1300)
    V48Assert(seg.PhaseProgress["Stage"]=1 && seg.PhaseProgress["StageAt"]=1300 && IGPCompact(seg).Hp<0,"a supported activation establishes its phase even without a known HP snapshot")
    ev.Kind := "Other",ev.SourceHP.Known := true,ev.SourceHP.Current := 40
    IGPObserve(seg,ev,1400)
    q := IGPCompact(seg)
    V48Assert(q.Hp=40 && q.Targets[1].LastAt=1400 && seg.PhaseProgress["StageAt"]=1300,"later metadata still supplies HP without changing opening evidence")
}

V6414ProgressLateOpening()
{
    seg := V63Segment("G-TY")
    IGPObserve(seg,V63Event("Damage","4078423634870272",80),2000)
    original := seg.PhaseProgress["Evidence"]
    IGPObserve(seg,V63Event("Damage","4078423634870272",70),3000)
    V48Assert(seg.PhaseProgress["StageAt"]=2000 && seg.PhaseProgress["Evidence"]=original,"later supported damage retains the original phase boundary and evidence")
    IGPObserve(seg,V63Event("Damage","123",5),1500)
    V48Assert(seg.PhaseProgress["StageAt"]=2000,"an earlier unrelated NPC cannot move the supported opening")
    IGPObserve(seg,V63Event("Damage","4078423634870272",10),1800)
    q := IGPCompact(seg)
    V48Assert(seg.PhaseProgress["StageAt"]=1800 && q.Hp=10 && q.Targets[1].LowAt=1800,"earlier same-boss activity can still establish an earlier phase and minimum")
    V48Assert(q.Targets[1].Last=70 && q.Targets[1].LastAt=3000,"an earlier minimum does not replace the latest HP snapshot")
    IGPObserve(seg,V63Event("Damage","4078423634870272",1),-1)
    V48Assert(seg.PhaseProgress["StageAt"]=1800 && IGPCompact(seg).Hp=10,"pre-segment records remain excluded")
}

V6414ProgressHealthSides()
{
    seg := V63Segment("G-TY"),ev := V63Event("Damage","4078423634870272",80)
    ev.Target := ev.Source.Clone(),ev.TargetHP := {Known:true,Current:35,Maximum:100}
    IGPObserve(seg,ev,1000)
    q := IGPCompact(seg)
    V48Assert(q.Targets.Length=1 && q.Hp=35 && q.Targets[1].Last=35,"same-identity source and target snapshots retain source-then-target ordering")
    ev.SourceHP := {Known:false,Current:0,Maximum:0},ev.TargetHP.Current := 60,ev.Kind := "Other"
    IGPObserve(seg,ev,2000)
    q := IGPCompact(seg)
    V48Assert(q.Hp=35 && q.Targets[1].Last=60 && q.Targets[1].LastAt=2000,"unknown source HP cannot block valid target health or erase the prior minimum")
    ev.TargetHP := {Known:true,Current:20,Maximum:0}
    IGPObserve(seg,ev,2200)
    V48Assert(IGPCompact(seg).Targets[1].LastAt=2000,"a zero maximum is not a valid progression health observation")
    ev.TargetHP.Known := false,ev.Kind := "Death"
    IGPObserve(seg,ev,2500)
    q := IGPCompact(seg)
    V48Assert(q.Targets[1].Dead && q.Hp=0 && q.Targets[1].LastAt=2500,"explicit NPC death remains zero progress HP even when both HP snapshots are unknown")
    different := V63Event("Damage","4078423634870272",50)
    different.Source.Key := "N:4078423634870272:100:Other instance"
    IGPObserve(seg,different,2600)
    V48Assert(IGPCompact(seg).Targets.Length=2,"different recorded instances remain independent progression targets")
}

V6414ProgressContextChange()
{
    seg := V63Segment("G-SC"),seg.ModeId := "unsupported"
    IGPObserve(seg,V63Event("Damage","4126527268585472",60),1000)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=0,"an unscoped railgun-phase actor cannot establish Scyva progress")
    seg.ModeId := "836045448953655"
    IGPObserve(seg,V63Event("Damage","4126527268585472",50),2000)
    V48Assert(IGPCompact(seg).Stage=1 && IGPCompact(seg).Hp=50,"newly available Master context still enables its scoped OPD phase")
    seg := V63Segment("G-NA"),seg.ModeId := "unsupported"
    IGPObserve(seg,V63Event("Damage","4122949560827904",80),1000)
    V48Assert(IGPCompact(seg).Profile="hp-only-v1" && IGPCompact(seg).Stage=1,"an unsupported difficulty retains its HP-only profile")
    seg.ModeId := "836045448953655"
    IGPObserve(seg,V63Event("Damage","4131857322999808",30),2000)
    q := IGPCompact(seg)
    V48Assert(q.Profile="nahut-8m-v1" && q.Stage=2 && q.Hp=30,"an established HP-only stage cannot suppress transitions after encounter context changes")
}

V6414ProgressUndo()
{
    data := IPNewData("progression performance rollback"),seg := IPNewSegment(data,0,"synthetic"),seg.BossKey := "DUMMY"
    opening := V64Line(1000,V64Actor(),V64Boss(),"Damage",100)
    IGPObserve(seg,opening,1000),key := "HP:1:" opening.Target.Key
    IPBBeginUndo(data,seg)
    IGPObserve(seg,V64Line(2000,V64Actor(),V64Boss(),"Damage",100),2000)
    V48Assert(seg.PhaseProgress[key].LastAt=2000 && seg.PhaseProgress[key].LowAt=1000,"unchanged HP still records the newer observation time")
    IGPObserve(seg,V64Line(900,V64Actor(),StrReplace(V64Boss(),"900000/","500000/"),"Damage",100),900)
    V48Assert(seg.PhaseProgress["StageAt"]=900 && seg.PhaseProgress[key].Low=50 && seg.PhaseProgress[key].LastAt=2000,"speculative earlier evidence can update the phase boundary and minimum independently")
    death := V64Line(2500,V64Actor(),V64Boss(),"Death",0),death.TargetHP.Known := false
    IGPObserve(seg,death,2500)
    V48Assert(seg.PhaseProgress[key].Dead && seg.PhaseProgress[key].Low=0,"speculative explicit death is still journaled")
    IPBRollbackTail(data,seg)
    V48Assert(seg.PhaseProgress["StageAt"]=1000 && seg.PhaseProgress[key].Low=90 && seg.PhaseProgress[key].Last=90 && seg.PhaseProgress[key].LastAt=1000 && !seg.PhaseProgress[key].Dead,"rollback restores the opening, minimum, latest snapshot and living state together")
}

; Synthetic, manual-only checks for reduced observer allocation/classification.
; No audio, settings, live encounter state or external files.
V6414RecapPlayerSides()
{
    s := IPNewData(),seg := IPNewSegment(s,0,"synthetic")
    ev := V64Line(1000,V64Actor(400),V64Actor(700),"Heal",300,300)
    IDTObserve(seg,ev,1000),key := ev.Source.Key,rows := seg.DeathCapture.Windows[key]
    V48Assert(rows.Length=1 && rows[1].Kind="Heal" && rows[1].HP=700 && rows[1].Effective=300,
        "same player key on both sides keeps one target-HP heal row even with conflicting source HP")
    ev := V64Line(1100,V64Actor(600),"@Other Player#642|(200/1000)","Damage",100)
    IDTObserve(seg,ev,1100)
    V48Assert(seg.DeathCapture.Windows.Count=2 && seg.DeathCapture.Windows[key].Length=2,
        "different player keys retain both source and target context")
    V48Assert(seg.DeathCapture.Windows[key][2].Kind="Health" && seg.DeathCapture.Windows[key][2].HP=600
        && seg.DeathCapture.Windows[ev.Target.Key][1].Kind="Damage" && seg.DeathCapture.Windows[ev.Target.Key][1].HP=200,
        "source metadata and target hit keep their own health values")
    ev := V64Line(1200,V64Actor(650),"=","Heal",50,50),IDTObserve(seg,ev,1200)
    V48Assert(seg.DeathCapture.Windows[key].Length=3 && seg.DeathCapture.Windows[key][3].HP=650,
        "self-target alias remains a single new observed heal")
    ev := V64Line(1300,V64Actor(700),"@recap tester#641|(750/1000)","Heal",50,50)
    IDTObserve(seg,ev,1300)
    V48Assert(seg.DeathCapture.Windows.Count=3 && seg.DeathCapture.Windows.Has(ev.Source.Key)
        && seg.DeathCapture.Windows.Has(ev.Target.Key) && seg.DeathCapture.Windows[ev.Source.Key].Length=4,
        "case-distinct player keys retain both visits, matching the original case-sensitive key map")
}

V6414RecapPlayerLateRollback()
{
    f := V64Frozen(),seg := f.Segment,key := f.Death.Key,original := seg.DeathCapture.Cases[f.Id]
    packed := IGVJson(IDTPack(seg.DeathCapture.Cases)),before := original.Rows.Length
    IPBBeginUndo(f.State,seg)
    ev := V64Line(19900,V64Actor(200),V64Actor(250),"Heal",50,50)
    IDTObserve(seg,ev,19900),copy := seg.DeathCapture.Cases[f.Id]
    V48Assert(copy.Rows.Length=before+1 && original.Rows.Length=before,
        "late same-player heal adds one row without mutating the earlier frozen recap")
    found := 0
    for row in copy.Rows {
        if row.At=19900 && row.Kind="Heal" && row.HP=250
            found += 1
    }
    V48Assert(found=1,"late self heal retains target health exactly once")
    IPBRollbackTail(f.State,seg)
    V48Assert(IGVJson(IDTPack(seg.DeathCapture.Cases))=packed,
        "rolling-window and frozen-case undo restores the exact death recap")
}

V6414BossUnneededReturn()
{
    f := V647BossFixture()
    V647BossFeed(f,500,"@Living#1|(1000/1000)","=","1","836045448945472","836045448945479")
    state := f.Seg.BossCheckState
    V48Assert(state.Rows.Count=0 && state.PlayerDead.Count=0 && state.Meta["Watermark"]=0 && !state.Meta["Error"],
        "a life observation without a recorded death preserves empty lazy state and creates no evidence")
    V647BossRage(f,1000,6),before := IGVJson(IBCPackEvidence(IBCBuildEvidence(f.Seg,f.Recap)))
    V647BossFeed(f,80000,"@Living#1|(1000/1000)","=","1","836045448945472","836045448945479")
    V48Assert(IGVJson(IBCPackEvidence(IBCBuildEvidence(f.Seg,f.Recap)))=before && state.Meta["Watermark"]=1000,
        "unrelated activation does not advance evidence clocks or trim retained Rage")
}

V6414BossRecordedReturnRollback()
{
    f := V647BossFixture(),boss := V647BossNPC("4078423634870272",700),player := "@Returned#1"
    V647BossFeed(f,5000,boss,player "|(0/1000)","1","836045448945472","836045448945493")
    state := f.Seg.BossCheckState,dead := state.PlayerDead[player]
    V647BossFeed(f,4999,player "|(1000/1000)","=","1","836045448945472","836045448945479")
    V48Assert(state.PlayerDead.Has(player) && state.Rows.Count=1,"an earlier positive activation cannot undo a later recorded death")
    before := IGVJson(IBCPackEvidence(IBCBuildEvidence(f.Seg,f.Recap)))
    IPBBeginUndo(f.Data,f.Seg)
    V647BossFeed(f,5000,player "|(1000/1000)","=","1","836045448945472","836045448945479")
    rows := IBCOrdered(state.Rows)
    V48Assert(!state.PlayerDead.Has(player) && rows.Length=2 && rows[2].Kind="player-return"
        && rows[2].At=dead.At && rows[2].Record>dead.Record && rows[2].Target=player,
        "same-time later recorded activation preserves the accepted player-return row")
    V647BossFeed(f,5100,player "|(1000/1000)","=","1","836045448945472","836045448945479")
    V48Assert(state.Rows.Count=2,"further activations cannot duplicate the observed return")
    IPBRollbackTail(f.Data,f.Seg)
    V48Assert(state.PlayerDead.Has(player) && IGVJson(IBCPackEvidence(IBCBuildEvidence(f.Seg,f.Recap)))=before,
        "return rows and pending-death state both restore exactly on rollback")
    V647BossFeed(f,5200,"@Healer#2|(1000/1000)",player "|(1000/1000)","1","836045448945472","836045448945494")
    rows := IBCOrdered(state.Rows)
    V48Assert(!state.PlayerDead.Has(player) && rows[2].Kind="player-return" && rows[2].Target=player,
        "an explicit revived target still consumes its pending recorded death")
}

V6414BossSameAddSides()
{
    f := V647BossFixture(),id := "4078445109706752"
    ev := V647BossFeed(f,1000,V647BossNPC(id,701,0),V647BossNPC(id,701,500),"1","836045448945478","2")
    rows := IBCOrdered(f.Seg.BossCheckState.Rows),key := ev.Source.Key
    zero := 0,alive := 0
    for row in rows {
        if row.Kind="add-zero" && row.HP=0
            zero += 1
        if row.Kind="add-alive" && row.HP=500
            alive += 1
    }
    V48Assert(rows.Length=2 && zero=1 && alive=1,
        "conflicting same-add health is observed source first then target without coalescing transitions")
    V48Assert(f.Seg.BossCheckState.Health[key].HP=500,"later target-side sample remains the final same-time health state")
    before := IGVJson(IBCPackEvidence(IBCBuildEvidence(f.Seg,f.Recap)))
    IPBBeginUndo(f.Data,f.Seg)
    V647BossFeed(f,999,V647BossNPC(id,701,0),"=","1","836045448945478","2")
    V48Assert(f.Seg.BossCheckState.Rows.Count=3 && f.Seg.BossCheckState.Health[key].HP=500,
        "late aliased zero creates one evidence key while preserving the newer health watermark")
    IPBRollbackTail(f.Data,f.Seg)
    V48Assert(IGVJson(IBCPackEvidence(IBCBuildEvidence(f.Seg,f.Recap)))=before,
        "late add-side evidence rolls back without changing previous health transitions")
}

; Native challenge regressions: private parser data only, no audio/settings/UI.
V6415CData()
{
    s := IPNewData("Synthetic challenge regression")
    s.AreaId := "833571547775765",s.ModeId := "836045448953655"
    seg := IPNewSegment(s,0,"observed combat entry"),seg.BossKey := "G-NA"
    return s
}

V6415CEvent(s,at,kind := "Damage",amount := 100,source := "@A#6415",target := "",effective := -1)
{
    if target=""
        target := "NAHUT {4122949560827904}:1|(0,0,0,0)|(100000/200000)"
    ev := IPParseLine(IPDemoLine(at,source,target,kind,amount,false,effective,"Synthetic challenge hit","6415001"))
    s.EventSerial += 1,ev.RecordId := s.EventSerial
    return ev
}

V6415CMarker(s,at)
{
    ev := V6415CEvent(s,at,"Activate",0,"NAHUT {4122949560827904}:1", "=")
    ev.AbilityId := "4133047028940800"
    return ev
}

V6415CSnapshot(s,choice := "auto")
{
    return IRCSnapshot({Data:s,Segment:s.Current,State:"STOPPED",Pending:0},choice)
}

V6415CAmount(s,actor := "@A#6415",field := "Damage",choice := "auto")
{
    for row in V6415CSnapshot(s,choice).Rows {
        if row.Key=actor
            return row.%field%
    }
    return -1
}

V6415ChallengePhaseWindow()
{
    s := V6415CData()
    IPApplyEvent(s,V6415CEvent(s,1000,"Damage",70),1000)
    IPApplyEvent(s,V6415CMarker(s,2000),2000)
    IPApplyEvent(s,V6415CEvent(s,3000,"Damage",100),3000)
    IPApplyEvent(s,V6415CEvent(s,4000,"Damage",200,"@B#6415"),4000)
    q := V6415CSnapshot(s)
    V48Assert(q.Available && q.Name="Nahut Burn" && q.Duration=2,"phase duration starts at recorded burn, not encounter start")
    V48Assert(V6415CAmount(s)=100 && V6415CAmount(s,"@B#6415")=200,"each raid player keeps their own phase damage")
    V48Assert(s.Current.Totals["@A#6415"].Damage=170,"ordinary whole-fight accounting is unchanged")
    V48Assert(q.Rows.Length=2 && q.Options.Length=1,"phase members and selector are independent of raw NPCs")
}

V6415ChallengeScopeAndMarker()
{
    for change in ["ModeId","AreaId","BossKey"] {
        s := V6415CData(),s.Current.%change% := "wrong"
        IPApplyEvent(s,V6415CMarker(s,1000),1000)
        V48Assert(!V6415CSnapshot(s).Available,"wrong encounter variant does not manufacture a challenge")
    }
    s := V6415CData(),ev := V6415CMarker(s,1000),ev.AbilityId := "4133502295474176"
    IPApplyEvent(s,ev,1000)
    V48Assert(!V6415CSnapshot(s).Available,"later gravity/candle marker is not substituted for Parsely burn start")
    ev := V6415CMarker(s,2000),ev.Source := IPActor("Unrelated {9999}:1")
    IPApplyEvent(s,ev,2000)
    V48Assert(!V6415CSnapshot(s).Available,"ability on another NPC is not a phase marker")
}

V6415ChallengeSameTimeOrder()
{
    s := V6415CData()
    IPApplyEvent(s,V6415CEvent(s,1000,"Damage",10),1000)
    IPApplyEvent(s,V6415CMarker(s,1000),1000)
    IPApplyEvent(s,V6415CEvent(s,1000,"Damage",20),1000)
    IPApplyEvent(s,V6415CEvent(s,2000,"Damage",30),2000)
    V48Assert(V6415CAmount(s)=50,"same-ms records before a start stay outside, later records count")
    def := IRCDefinitions(s.Current)[1]
    IRCEnd(s.Current,def,2000,s.EventSerial),IRCReconcile(s.Current)
    V48Assert(V6415CAmount(s)=20,"end-marker record ordering excludes the boundary event and later records")
}

V6415ChallengeReorderedBoundary()
{
    s := V6415CData()
    IPApplyEvent(s,V6415CEvent(s,1200,"Damage",100),1200)
    IPApplyEvent(s,V6415CMarker(s,1000),1000)
    V48Assert(V6415CAmount(s)=100,"a tolerated late start recovers already observed phase damage")
    IPApplyEvent(s,V6415CEvent(s,2200,"Damage",200),2200)
    def := IRCDefinitions(s.Current)[1]
    IRCEnd(s.Current,def,2000,99),IRCReconcile(s.Current)
    V48Assert(V6415CAmount(s)=100,"late end removes only damage beyond the recorded boundary")
    IPApplyEvent(s,V6415CEvent(s,1800,"Damage",50),1800)
    V48Assert(V6415CAmount(s)=150,"late in-window damage still reaches a closed phase")
}

V6415ChallengeDuplicates()
{
    s := V6415CData()
    IPApplyEvent(s,V6415CMarker(s,1000),1000)
    IPApplyEvent(s,V6415CEvent(s,1500,"Damage",100),1500)
    IPApplyEvent(s,V6415CMarker(s,1600),1600)
    IPApplyEvent(s,V6415CEvent(s,2000,"Damage",200),2000)
    V48Assert(s.Current.Challenges.Windows.Count=1 && V6415CAmount(s)=300,"repeat observations do not reset an active challenge")
    q := V6415CSnapshot(s)
    V48Assert(q.Duration=1,"duplicate start preserves original phase clock")
}

V6415ChallengeHealing()
{
    s := V6415CData()
    IPApplyEvent(s,V6415CMarker(s,1000),1000)
    IPApplyEvent(s,V6415CEvent(s,1100,"Heal",100,"@Heal#6415","@A#6415",60),1100)
    IPApplyEvent(s,V6415CEvent(s,1200,"Heal",50,"@Heal#6415","@B#6415",0),1200)
    q := V6415CSnapshot(s)
    V48Assert(V6415CAmount(s,"@Heal#6415","Heal")=150 && V6415CAmount(s,"@Heal#6415","Effective")=60,"raw and effective healing remain distinct")
    V48Assert(V6415CAmount(s,"@Heal#6415","HealKnown")=2 && V6415CAmount(s,"@Heal#6415","HealRecords")=2,"zero-effective overheal is known, not missing")
    V48Assert(V6415CAmount(s,"@A#6415")=0,"observed player with no contribution remains visible")
}

V6415ChallengeExistingExclusions()
{
    s := V6415CData(),seg := s.Current
    seg.Profile := {Key:"DP-RA",Marker:"",ReportOnly:false}
    IPApplyEvent(s,V6415CMarker(s,1000),1000)
    ev := V6415CEvent(s,1200,"Heal",500,"@Heal#6415","Dying Captive {3289335063379968}:1",500)
    IPApplyEvent(s,ev,1200)
    IPApplyEvent(s,V6415CEvent(s,1300,"Damage",100,"@A#6415","@A#6415"),1300)
    V48Assert(V6415CAmount(s,"@Heal#6415","Heal")=0,"ordinary Parsely object-heal policy is retained inside a phase")
    V48Assert(V6415CAmount(s)=0,"self damage does not inflate challenge damage done")
}

V6415ChallengeRollback()
{
    s := V6415CData(),seg := s.Current
    IPApplyEvent(s,V6415CEvent(s,500,"Damage",10),500)
    IPBBeginUndo(s,seg)
    IPApplyEvent(s,V6415CMarker(s,1000),1000)
    IPApplyEvent(s,V6415CEvent(s,1500,"Damage",100),1500)
    V48Assert(V6415CSnapshot(s).Available,"speculative phase is initially visible")
    IPBRollbackTail(s,seg)
    V48Assert(!V6415CSnapshot(s).Available && seg.Challenges.Windows.Count=0,"rolled-back phase leaves no phantom challenge")
    IPApplyEvent(s,V6415CMarker(s,2000),2000)
    IPApplyEvent(s,V6415CEvent(s,2500,"Damage",200),2500)
    IPBBeginUndo(s,seg)
    IRCEnd(seg,IRCDefinitions(seg)[1],2700,999),IRCReconcile(seg)
    IPApplyEvent(s,V6415CEvent(s,3000,"Damage",300),3000)
    IPBRollbackTail(s,seg)
    V48Assert(seg.Challenges.Windows["nahut:1"].End<0 && V6415CAmount(s)=200,"rollback restores phase end and counters together")
}

V6415ChallengeRepeatTotals()
{
    s := V6415CData(),seg := s.Current,seg.Challenges := IRCNewState()
    def := IRCDefinitions(seg)[1].Clone(),def.Repeat := true
    IRCBegin(seg,def,1000,0)
    IPApplyEvent(s,V6415CEvent(s,2000,"Damage",100),2000)
    IRCEnd(seg,def,3000,0)
    IPApplyEvent(s,V6415CEvent(s,4000,"Damage",900),4000)
    IRCBegin(seg,def,5000,0)
    IPApplyEvent(s,V6415CEvent(s,6000,"Damage",200),6000)
    IRCEnd(seg,def,7000,0),seg.Last := 8000
    q := V6415CSnapshot(s,"nahut:total")
    V48Assert(q.Duration=4 && q.Options.Length=3 && V6415CAmount(s,"@A#6415","Damage","nahut:total")=300,"Total sums challenge durations, not gaps between phases")
    V48Assert(V6415CAmount(s,"@A#6415","Damage","nahut:1")=100 && V6415CAmount(s)=200,"individual occurrences remain selectable")
    V48Assert(q.Selected="nahut:total","explicit total selection survives snapshots")
}

V6415ChallengeSnapshotIsolation()
{
    s := V6415CData()
    IPApplyEvent(s,V6415CMarker(s,1000),1000)
    IPApplyEvent(s,V6415CEvent(s,2000,"Damage",100),2000)
    a := V6415CSnapshot(s),a.Rows[1].Damage := 999,a.Options[1].Name := "changed"
    b := V6415CSnapshot(s)
    V48Assert(V6415CAmount(s)=100 && b.Name="Nahut Burn","UI copies cannot mutate parser counters or labels")
    V48Assert(V6415CSnapshot(s,"obsolete:7").Selected="nahut:1","stale choice safely selects current phase")
    s.Current.End := 2000
    V48Assert(V6415CSnapshot(s).Duration=1 && V6415CSnapshot(s).State="Pull ended","finished pull keeps phase results without stretching time")
    s.Current.Terminal := true
    V48Assert(V6415CSnapshot(s).State="Complete","confirmed encounter ending can complete its final challenge")
}

V6415ChallengeWindowBounds()
{
    s := V6415CData(),seg := s.Current,seg.Challenges := IRCNewState()
    def := IRCDefinitions(seg)[1].Clone(),def.Repeat := true
    Loop 65 {
        IRCBegin(seg,def,A_Index*1000,0)
        IRCEnd(seg,def,A_Index*1000+500,0)
    }
    V48Assert(seg.Challenges.Windows.Count=64 && seg.Challenges.Meta["Limited"],"excessive phases stop bounded collection and disclose partial coverage")
    s := V6415CData()
    Loop 4200
        IPApplyEvent(s,V6415CEvent(s,1000,"Damage",1),1000)
    V48Assert(s.Current.Challenges.Recent.Count=4096 && s.Current.Challenges.Meta["Limited"],"reorder repair buffer has a firm bound")
    IPApplyEvent(s,V6415CEvent(s,5000,"Damage",1),5000)
    V48Assert(s.Current.Challenges.Recent.Count<65,"old repair events expire without retaining a raw log")
}


; v64.15 standalone challenge display tests. Hidden native windows, temp INI,
; detached numeric fixtures; no live reader, input capture or audio.

V6415ChallengeUIActor(key,name,damage,heal := 0,effective := 0,known := 0,records := 0)
{
    return {Key:key,Name:name,Kind:"Player",Damage:damage,Heal:heal,Effective:effective,
        HealKnown:known,HealRecords:records}
}

V6415ChallengeUISnapshot()
{
    c := IRCUEmpty(),c.Available := true,c.Name := "Test burn",c.Note := "",c.State := "Complete",
        c.Duration := 10,c.Selected := "burn:1"
    c.Rows := [V6415ChallengeUIActor("B","Beta",1000,400,300,1,1),
        V6415ChallengeUIActor("A","Alpha",3000,100,80,1,1),
        V6415ChallengeUIActor("C","Zero",0)]
    return {State:"STOPPED",Duration:1000,Id:10,Start:0,Last:1000000,Partial:false,Closed:true,
        Pending:0,Actors:[],Challenges:c}
}

V6415ChallengeUICatalogue()
{
    for mode in [1,2,3] {
        s := IPMNewState(),s.Mode := mode,before := IPMDisplayTargets(s).Length
        V48Assert(!s.Shown["Challenges"] && !s.Wanted && !s.TimerOn,"new panel is optional and inert")
        IIFSetChoice(s,"Challenges",true)
        targets := IPMDisplayTargets(s),n := 0
        for t in targets {
            if t.Kind="Challenges" {
                n += 1
                V48Assert(t.Panel=s.Panels["Challenges"] && t.Panel!=s.Panel,"challenge owns its separate window in every layout")
            }
        }
        V48Assert(n=1 && targets.Length=before+1,"exactly one independent challenge panel added")
        IIFSetChoice(s,"Challenges",false)
        V48Assert(IPMDisplayTargets(s).Length=before,"unchecking challenge preserves other selections")
    }
    V48Assert(IPMViews().Length=4 && IRPanelKinds().Length=2,"combined tabs and existing threat/HP catalogue unchanged")
    V48Assert(IPMSizeKeys()[8]="Challenges" && InStr(IPMSizeLabels()[8],"Challenges"),"independent size control appended")
}

V6415ChallengeUIRanks()
{
    rows := V6415ChallengeUISnapshot().Challenges.Rows
    d := IRCURank(rows,"Damage"),h := IRCURank(rows,"Heal")
    V48Assert(d.Count=3 && d.Rows[1].Key="A" && d.Rows[3].Amount=0,"damage ranking includes observed zero contributors")
    V48Assert(d.Total=4000 && d.Peak=3000,"challenge totals contain only supplied phase amounts")
    V48Assert(h.Rows[1].Key="B" && h.Total=380 && h.Rows[3].Amount=0,"healing ranks effective amounts, preserving real zero")
    rows.Push(V6415ChallengeUIActor("D","Missing effective",0,500,20,0,1))
    h := IRCURank(rows,"Heal")
    V48Assert(h.Unknown=1 && h.Rows[-1].Amount=-1,"incomplete effective healing is unavailable, not raw healing")
    rows.Push(V6415ChallengeUIActor("0","Tie",3000))
    V48Assert(IRCURank(rows,"Damage").Rows[1].Key="0","equal contributions have a stable identity tie-break")
    npc := V6415ChallengeUIActor("NPC","NPC",999999),npc.Kind := "NPC / companion",rows.Push(npc)
    V48Assert(IRCURank(rows,"Damage").Rows[1].Key="0","NPC contributions cannot enter player ranking")
}

V6415ChallengeUIHiddenRender()
{
    V522Isolated(V6415ChallengeUIHiddenRenderCase)
}

V6415ChallengeUIHiddenRenderCase()
{
    global IPM,IP
    p := IPM.Panels["Challenges"],snap := V6415ChallengeUISnapshot()
    IPMEnsureGui("Challenges",0,p),IPMRender("Challenges",snap,p)
    V48Assert(p.RenderedMetric="Challenges" && p.VisibleRows=3 && !p.Tabs.Count,"actual standalone renderer creates ranked rows without tabs")
    V48Assert(p.Rows[1].Name.Text="Alpha" && p.Rows[1].Value.Text="300.0" && !InStr(p.Scope.Text,"Percentile"),"default view shows ordinary DPS for a challenge without a percentile reference")
    V48Assert(p.Rows[3].Name.Text="Zero" && p.Rows[3].Value.Text="0.0","zero participant remains visible")
    V48Assert(InStr(p.Meta.Text,"Test burn") && InStr(p.Scope.Text,"00:10"),"challenge and phase time displayed separately")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int") && !IPM.TimerOn,"explicit native rendering remains hidden and timer-free")
    IPM.ChallengeMetric := "Heal",IPMRender("Challenges",snap,p)
    V48Assert(p.Rows[1].Name.Text="Beta" && p.Rows[1].Value.Text="30.0","EHPS uses phase effective healing")
    snap.Challenges.Duration := 0,IPMRender("Challenges",snap,p)
    V48Assert(p.Rows[1].Value.Text="--","zero-duration phase never divides by zero")
    snap.Challenges := IRCUEmpty(),IPMRender("Challenges",snap,p)
    V48Assert(p.VisibleRows=0 && p.Rows[1].Name.Text="" && p.Rows[1].Value.Text="","unsupported/new pull clears prior names and rates")
    V48Assert(!IP.Active && !IsObject(IP.Live),"rendering does not start the parser")
}

V6415ChallengeUILayout()
{
    V522Isolated(V6415ChallengeUILayoutCase)
}

V6415ChallengeUILayoutCase()
{
    global IPM
    p := IPM.Panels["Challenges"],snap := V6415ChallengeUISnapshot()
    IPMEnsureGui("Challenges",0,p)
    for font in [8,10,18] {
        IPM.Font := font
        for width in [196,480] {
            for auto in [true,false] {
                p.Width := width,p.Height := 60,p.AutoHeight := auto
                IPMRender("Challenges",snap,p),l := p.Layout
                p.Meta.GetPos(&mx,&my,&mw,&mh),p.Rows[1].Name.GetPos(&rx,&ry,&rw,&rh)
                V48Assert(my+mh<=ry && ry+rh<=l.H,"phase label and rows fit even at minimum requested height")
                V48Assert(mx>=0 && mx+mw<=l.W && rx+rw<=l.W,"challenge text stays inside independently sized window")
                V48Assert(l.TabH=0 && l.MetaH=l.Line*2,"standalone layout reserves phase information without tab area")
            }
        }
    }
}

V6415ChallengeUISettings()
{
    V522Isolated(V6415ChallengeUISettingsCase)
}

V6415ChallengeUISettingsCase()
{
    global IPM,SETTINGS_FILE
    IPMLoadSettings()
    V48Assert(IPM.ChallengeMetric="DamagePercentile","fresh settings use DPS and estimated percentile")
    IniWrite("Damage",SETTINGS_FILE,"IrisParseDisplay","ChallengeMetric"),IPMLoadSettings()
    V48Assert(IPM.ChallengeMetric="DamagePercentile","old Damage default loads as DPS and estimated percentile")
    IPM.ChallengeMetric := "Damage",IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings()
    V48Assert(IPM.ChallengeMetric="Damage","an explicit damage-only choice survives reload")
    IPM.Shown["Challenges"] := true,IPM.ChallengeMetric := "Heal",IPM.ChallengeChoice := "old:2"
    p := IPM.Panels["Challenges"],p.X := -820,p.Y := 135,p.Width := 460,p.Height := 350,p.AutoHeight := false
    IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings(),p := IPM.Panels["Challenges"]
    V48Assert(IPM.Shown["Challenges"] && IPM.ChallengeMetric="Heal","selection and display metric persist in private settings")
    V48Assert(p.X=-820 && p.Y=135 && p.Width=460 && p.Height=350 && !p.AutoHeight,"independent challenge geometry survives reload")
    V48Assert(IPM.ChallengeChoice="auto" && !IPM.Wanted && !IPM.TimerOn && !IsObject(p.Gui),"no old occurrence, visible window or timer restored")
}

V6415ChallengeUILifecycle()
{
    V522Isolated(V6415ChallengeUILifecycleCase)
}

V6415ChallengeUILifecycleCase()
{
    global IPM
    p := IPM.Panels["Challenges"],p.Width := 350,p.X := 111,p.Y := 222
    IPMEnsureGui("Challenges",0,p),hwnd := p.Gui.Hwnd
    V48Assert((DllCall("User32\GetWindowLongW","Ptr",hwnd,"Int",-20,"UInt") & 0x08000020)=0x08000020,"locked challenge body does not activate or intercept gameplay")
    IPM.Editing := true,IPMStyle(p)
    V48Assert(!(DllCall("User32\GetWindowLongW","Ptr",hwnd,"Int",-20,"UInt") & 0x20),"unlock permits ordinary meter movement")
    IPMHide(),IPMDestroyPanels(),IPMDestroyPanels()
    V48Assert(!DllCall("User32\IsWindow","Ptr",hwnd,"Int") && !IsObject(p.Gui),"hide/destroy retires native challenge owner idempotently")
    V48Assert(p.Width=350 && p.X=111 && p.Y=222,"UI disposal preserves saved layout")
    IPMEnsureGui("Challenges",0,p)
    V48Assert(IPMGuiAlive(p.Gui) && !p.Tabs.Count,"destroyed standalone window recreates safely")
}

V6415ChallengeUIContext()
{
    V522Isolated(V6415ChallengeUIContextCase)
}

V6415ChallengeUIContextCase()
{
    global IPM,IP
    a := {Id:1,Start:1000},b := {Id:2,Start:2000},r := {Segment:a}
    IRCUSelectContext(r),IPM.ChallengeChoice := "burn:2",IRCUSelectContext(r)
    V48Assert(IPM.ChallengeChoice="burn:2","manual occurrence retained within the same pull")
    r.Segment := b,IRCUSelectContext(r)
    V48Assert(IPM.ChallengeChoice="auto","next pull returns to automatic challenge selection")
    IPM.ChallengeChoice := "burn:1",r.Segment := "",IRCUSelectContext(r)
    V48Assert(IPM.ChallengeChoice="auto","clearing or changing source retires stale selection")
    app := IPNewApp(),app.Live := V52Fixture(),app.Offline := V52Fixture(),app.Active := true
    app.View := "Imported",app.Selected := 1,app.Follow := false
    V48Assert(IPMResolve(app,3).Data=app.Live,"automatic challenge source uses live data during parsing")
    app.Active := false
    V48Assert(IPMResolve(app,3).Data=app.Offline,"automatic stopped source follows saved selection")
}

V6415ChallengeUIOptions()
{
    V522Isolated(V6415ChallengeUIOptionsCase)
}

V6415ChallengeUIOptionsCase()
{
    global IPM,IP
    try {
        IRCUOpenOptions(),u := IPM.ChallengeOptions,hwnd := u.Gui.Hwnd
        V48Assert(IPMGuiAlive(u.Gui) && !DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int"),"explicit options fixture is a hidden native window")
        V48Assert(u.Keys[1]="auto" && u.Metric.Value=3,"the native dropdown opens on DPS and estimated percentile")
        u.Metric.Choose(2),IRCUApplyOptions()
        V48Assert(IPM.ChallengeMetric="Heal" && !IP.Active && !IPM.Wanted,"applying metric never starts parser or shows overlay")
        u.Keys.Push("stale:1"),u.Choice.Add(["Previous pull"]),u.Choice.Choose(2),u.Source := "old"
        IRCUApplyOptions()
        V48Assert(IPM.ChallengeChoice="auto","stale options cannot select another pull's occurrence")
        IRCUCloseOptions(),IRCUShutdown(),IRCUShutdown()
        V48Assert(!DllCall("User32\IsWindow","Ptr",hwnd,"Int") && !IsObject(IPM.ChallengeOptions),"options disposal clears native handles idempotently")
    }
    finally IRCUShutdown()
}

V6415ChallengeUIPreview()
{
    V522Isolated(V6415ChallengeUIPreviewCase)
}

V6415ChallengeUIPreviewCase()
{
    global IPM,IP
    for count in [8,16] {
        IPM.Enabled := true,IPM.Shown["Damage"] := true,IPMPreviewSet(count)
        s := IPMCreateRaidPreview(count),p := IPM.Panels["Challenges"]
        IPM.MaxRows := count,IPMEnsureGui("Challenges",0,p),IPMRender("Challenges",s,p)
        V48Assert(s.Challenges.Rows.Length=count && p.VisibleRows=count,"layout preview shows all requested challenge sample rows")
        V48Assert(InStr(p.Heading.Text,"PREVIEW") && InStr(p.Meta.Text,"Sample challenge"),"synthetic preview clearly labelled")
        V48Assert(!IsObject(IP.Live) && !IsObject(IP.Offline) && !IPM.TimerOn,"preview contains no parser data or timer")
    }
}

; Adversarial challenge regressions. Helpers use isolated in-memory parser data.
V6415ChallengeLateRepeatStart()
{
    s := V6415CData(),seg := s.Current,seg.Challenges := IRCNewState()
    def := IRCDefinitions(seg)[1].Clone(),def.Repeat := true
    IRCBegin(seg,def,1000,1)
    IPApplyEvent(s,V6415CEvent(s,1200,"Damage",100),1200)
    IRCEnd(seg,def,1500,50)
    IRCBegin(seg,def,2000,60)
    IPApplyEvent(s,V6415CEvent(s,2200,"Damage",200),2200)
    IRCBegin(seg,def,1100,2),IRCReconcile(seg)
    V48Assert(seg.Challenges.Windows["nahut:2"].Start=2000,"late duplicate from first occurrence cannot move second occurrence backward")
    V48Assert(V6415CAmount(s,"@A#6415","Damage","nahut:total")=300,"late duplicate start cannot count the same hit in two occurrences")
}

V6415ChallengeLateRepeatEnd()
{
    s := V6415CData(),seg := s.Current,seg.Challenges := IRCNewState()
    def := IRCDefinitions(seg)[1].Clone(),def.Repeat := true
    IRCBegin(seg,def,1000,1)
    IPApplyEvent(s,V6415CEvent(s,1200,"Damage",100),1200)
    IPApplyEvent(s,V6415CEvent(s,1400,"Damage",90),1400)
    IRCEnd(seg,def,1500,50)
    IRCBegin(seg,def,2000,60)
    IPApplyEvent(s,V6415CEvent(s,2200,"Damage",200),2200)
    IRCEnd(seg,def,1300,40),IRCReconcile(seg)
    V48Assert(seg.Challenges.Windows["nahut:1"].End=1300,"late earlier end refines its own occurrence after another occurrence starts")
    V48Assert(V6415CAmount(s,"@A#6415","Damage","nahut:total")=300 && seg.Challenges.Windows["nahut:2"].End<0,"late first end excludes its tail without ending current occurrence")
}

V6415ChallengeIndependentTargets()
{
    s := V6415CData(),seg := s.Current,seg.Challenges := IRCNewState()
    def := IRCDefinitions(seg)[1].Clone(),def.DamageTargets := "4122949560827904",def.HealTargets := "7777"
    IRCBegin(seg,def,1000,0)
    IPApplyEvent(s,V6415CEvent(s,1100,"Damage",100),1100)
    IPApplyEvent(s,V6415CEvent(s,1200,"Damage",900,"@A#6415","Other {7777}:2"),1200)
    IPApplyEvent(s,V6415CEvent(s,1300,"Heal",250,"@Heal#6415","Other {7777}:2",125),1300)
    IPApplyEvent(s,V6415CEvent(s,1400,"Heal",900,"@Heal#6415","@A#6415",800),1400)
    V48Assert(V6415CAmount(s)=100 && V6415CAmount(s,"@Heal#6415","Effective")=125,"damage and healing use independent challenge target policies")
    V48Assert(seg.Totals["@A#6415"].Damage=1000 && seg.Totals["@Heal#6415"].Effective=925,"challenge filters never remove ordinary raid damage or healing")
}

V6415ChallengeRepairRollback()
{
    s := V6415CData(),seg := s.Current
    IPApplyEvent(s,V6415CMarker(s,1000),1000)
    IPApplyEvent(s,V6415CEvent(s,1200,"Damage",100),1200)
    IPApplyEvent(s,V6415CEvent(s,1800,"Damage",200),1800)
    IPBBeginUndo(s,seg)
    IRCEnd(seg,IRCDefinitions(seg)[1],1500,40),IRCReconcile(seg)
    V48Assert(V6415CAmount(s)=100,"late boundary repairs previously counted result")
    IPBRollbackTail(s,seg)
    V48Assert(V6415CAmount(s)=300 && seg.Challenges.Windows["nahut:1"].End<0,"rollback restores both repaired row and open boundary")
    IRCEnd(seg,IRCDefinitions(seg)[1],1500,40),IRCReconcile(seg)
    V48Assert(V6415CAmount(s)=100,"rollback must also restore recent assignment lists before the same repair is replayed")
}

V6415ChallengeUnknownHealing()
{
    s := V6415CData()
    IPApplyEvent(s,V6415CMarker(s,1000),1000)
    ev := V6415CEvent(s,1200,"Heal",100,"@Heal#6415","@A#6415",60)
    IPApplyEvent(s,ev,1200)
    ev := V6415CEvent(s,1400,"Heal",100,"@Heal#6415","@A#6415",70),ev.Effective := -1
    IPApplyEvent(s,ev,1400)
    q := V6415CSnapshot(s),ranked := IRCURank(q.Rows,"Heal")
    for row in ranked.Rows {
        if row.Key="@Heal#6415"
            V48Assert(row.Amount<0,"one missing effective result keeps phase EHPS unknown, rather than presenting a partial sum as exact")
    }
}

V6415ChallengeEndInstance()
{
    s := V6415CData(),seg := s.Current,seg.Challenges := IRCNewState()
    def := IRCDefinitions(seg)[1].Clone(),start := V6415CMarker(s,1000)
    IRCBegin(seg,def,1000,start.RecordId,start)
    IPApplyEvent(s,V6415CEvent(s,1300,"Damage",100),1300)
    finish := V6415CMarker(s,1200),finish.Source := IPActor("NAHUT {4122949560827904}:2")
    rule := {MatchStartSource:true}
    IRCEnd(seg,def,1200,finish.RecordId,finish,rule),IRCReconcile(seg)
    V48Assert(seg.Challenges.Windows["nahut:1"].End<0 && V6415CAmount(s)=100,"same NPC type from another instance cannot end the active challenge")
    finish.Source := start.Source
    IRCEnd(seg,def,1200,finish.RecordId,finish,rule),IRCReconcile(seg)
    V48Assert(seg.Challenges.Windows["nahut:1"].End=1200 && V6415CAmount(s)=0,"matching instance end repairs later counted damage")
}

V6415ChallengePendingEndInstance()
{
    for matches in [false,true] {
        s := V6415CData(),seg := s.Current,seg.Challenges := IRCNewState()
        def := IRCDefinitions(seg)[1].Clone(),finish := V6415CMarker(s,1500)
        IRCEnd(seg,def,1500,finish.RecordId,finish,{MatchStartSource:true})
        start := V6415CMarker(s,1000)
        if !matches
            start.Source := IPActor("NAHUT {4122949560827904}:2")
        IRCBegin(seg,def,1000,start.RecordId,start)
        IPApplyEvent(s,V6415CEvent(s,1700,"Damage",100),1700)
        V48Assert((seg.Challenges.Windows["nahut:1"].End>=0)=matches,"end arriving before start must retain its instance requirement")
        V48Assert(V6415CAmount(s)=(matches ? 0 : 100),"pending end instance governs later metric membership")
    }
}

V6415ChallengeOrdinalRouting()
{
    s := V6415CData(),seg := s.Current,seg.Challenges := IRCNewState()
    def := IRCDefinitions(seg)[1].Clone(),def.Repeat := true
    IRCBegin(seg,def,1000,1),IRCEnd(seg,def,1500,50),IRCBegin(seg,def,2000,60)
    V48Assert(IRCOrdinalAllowed({Ordinal:1},seg,def,1400,40,false),"late first-occurrence endpoint still uses first-occurrence rules")
    V48Assert(!IRCOrdinalAllowed({MinOrdinal:2},seg,def,1400,40,false),"second-occurrence endpoint rule cannot close a late first occurrence")
    V48Assert(!IRCOrdinalAllowed({Ordinal:1},seg,def,2200,70,false)
        && IRCOrdinalAllowed({MinOrdinal:2},seg,def,2200,70,false),"current second occurrence switches endpoint rules")
    V48Assert(IRCOrdinalAllowed({MaxOrdinal:1},seg,def,1100,10,true)
        && !IRCOrdinalAllowed({MaxOrdinal:1},seg,def,2100,65,true),"duplicate starts use their own occurrence ordinal")
}

V6415ChallengeClosedSharedDuration()
{
    s := V6415CData(),seg := s.Current
    IPApplyEvent(s,V6415CMarker(s,1000),1000)
    IPApplyEvent(s,V6415CEvent(s,1500,"Damage",100,"@A#6415"),1500)
    IPApplyEvent(s,V6415CEvent(s,3000,"Damage",200,"@B#6415"),3000)
    seg.End := 3000,seg.Raid.LastAt := 99000
    q := V6415CSnapshot(s)
    V48Assert(q.Duration=2 && q.State="Pull ended","finished phase uses accepted encounter time, never a stale later raid clock")
    V48Assert(IPRate(V6415CAmount(s),q.Duration)=50 && IPRate(V6415CAmount(s,"@B#6415"),q.Duration)=100,"players share phase duration regardless of first or final contribution")
    seg.Partial := true
    V48Assert(V6415CSnapshot(s).Note="Partial log","incomplete recorder coverage stays visible with retained results")
}

V6415CManifestData()
{
    s := V6415CData(),seg := s.Current
    seg.AreaId := "137438993037",seg.BossKey := "SV-ST"
    return s
}

V6415CManifestEvent(s,at,kind,instance,amount := 0)
{
    npc := "Chained Manifestation {3147154466013184}:" instance
    return V6415CEvent(s,at,kind,amount,"@A#6415",npc)
}

V6415ChallengeManifestCorpseGuard()
{
    s := V6415CManifestData(),seg := s.Current
    IPApplyEvent(s,V6415CManifestEvent(s,1000,"Damage",1,10),1000)
    IPApplyEvent(s,V6415CManifestEvent(s,1100,"Damage",1,100),1100)
    IPApplyEvent(s,V6415CManifestEvent(s,1200,"Death",1),1200)
    IPApplyEvent(s,V6415CManifestEvent(s,1300,"Damage",1,500),1300)
    IPApplyEvent(s,V6415CManifestEvent(s,1400,"Death",1),1400)
    V48Assert(seg.Challenges.Windows.Count=1 && V6415CAmount(s)=100,"post-death damage and duplicate deaths cannot create another manifestation occurrence")
    IPApplyEvent(s,V6415CManifestEvent(s,2000,"Damage",2,20),2000)
    IPApplyEvent(s,V6415CManifestEvent(s,2100,"Damage",2,200),2100)
    IPApplyEvent(s,V6415CManifestEvent(s,2200,"Damage",1,900),2200)
    IPApplyEvent(s,V6415CManifestEvent(s,2300,"Death",1),2300)
    V48Assert(seg.Challenges.Windows.Count=2 && seg.Challenges.Windows["manifestation:2"].End<0,"old corpse death cannot end the new manifestation instance")
    V48Assert(V6415CAmount(s)=200 && V6415CAmount(s,"@A#6415","Damage","manifestation:total")=300,"individual and total scores never include an older corpse's damage")
}

V6415ChallengeManifestMissingOpening()
{
    s := V6415CManifestData(),seg := s.Current
    IPApplyEvent(s,V6415CManifestEvent(s,1400,"Death",1),1400)
    IPApplyEvent(s,V6415CManifestEvent(s,1500,"Damage",1,500),1500)
    V48Assert(seg.Challenges.Windows.Count=0,"first observed corpse cannot manufacture a challenge with no opening evidence")
    IPApplyEvent(s,V6415CManifestEvent(s,1100,"Damage",1,10),1100)
    IPApplyEvent(s,V6415CManifestEvent(s,1200,"Damage",1,100),1200)
    V48Assert(seg.Challenges.Windows.Count=1 && seg.Challenges.Windows["manifestation:1"].End=1400,"late pre-death evidence recovers the supported occurrence and its recorded ending")
    V48Assert(V6415CAmount(s)=100,"recovered occurrence counts in-window damage and excludes its initiating hit and corpse tail")
}

V6415ChallengeManifestMissingEnd()
{
    s := V6415CManifestData(),seg := s.Current
    IPApplyEvent(s,V6415CManifestEvent(s,1000,"Damage",1,10),1000)
    IPApplyEvent(s,V6415CManifestEvent(s,1100,"Damage",1,100),1100)
    IPApplyEvent(s,V6415CManifestEvent(s,2000,"Damage",2,20),2000)
    IPApplyEvent(s,V6415CManifestEvent(s,2100,"Damage",2,200),2100)
    V48Assert(seg.Challenges.Windows.Count=1 && V6415CSnapshot(s).Note="Partial log","missing prior death is disclosed without inventing an endpoint or overlapping phase clocks")
    V48Assert(V6415CAmount(s)=100,"unresolved new instance cannot inflate the old instance score")
    IPBBeginUndo(s,seg)
    IPApplyEvent(s,V6415CManifestEvent(s,1500,"Death",1),1500)
    V48Assert(seg.Challenges.Windows.Count=2 && seg.Challenges.Windows["manifestation:2"].Start=2000,"late earlier death recovers the saved second start instead of shifting it to a later hit")
    V48Assert(V6415CAmount(s)=200 && V6415CSnapshot(s).Note="","bounded reorder repair recovers phase damage and clears only the resolved missing-end warning")
    IPBRollbackTail(s,seg)
    V48Assert(seg.Challenges.Windows.Count=1 && V6415CSnapshot(s).Note="Partial log","rollback restores the pending start and its unresolved-coverage warning")
    IPApplyEvent(s,V6415CManifestEvent(s,1500,"Death",1),1500)
    V48Assert(seg.Challenges.Windows.Count=2 && V6415CAmount(s)=200,"pending start recovery remains idempotent after rollback and replay")
}

V6415ChallengeManifestUndo()
{
    s := V6415CManifestData(),seg := s.Current
    IPApplyEvent(s,V6415CManifestEvent(s,1000,"Damage",1,10),1000)
    IPBBeginUndo(s,seg)
    IPApplyEvent(s,V6415CManifestEvent(s,1200,"Death",1),1200)
    IPApplyEvent(s,V6415CManifestEvent(s,2000,"Damage",2,20),2000)
    IPApplyEvent(s,V6415CManifestEvent(s,2100,"Damage",2,200),2100)
    IPBRollbackTail(s,seg)
    V48Assert(seg.Challenges.Windows.Count=1 && seg.Challenges.Windows["manifestation:1"].End<0,"undo removes speculative repeated instance and its death fence")
    IPApplyEvent(s,V6415CManifestEvent(s,1200,"Death",1),1200)
    IPApplyEvent(s,V6415CManifestEvent(s,2000,"Damage",2,20),2000)
    IPApplyEvent(s,V6415CManifestEvent(s,2100,"Damage",2,200),2100)
    V48Assert(seg.Challenges.Windows.Count=2 && V6415CAmount(s)=200,"replay accepts the same instance after rollback; no stale seen-instance tombstone remains")
}

V6415ChallengeOrdinalObserved()
{
    ; Personal captive timing supersedes the former portal-clock endpoint test.
    s := RaptusTestData(),RaptusTestSpin(s,1000),RaptusTestSpin(s,1300,true)
    V48Assert(!V6415CSnapshot(s).Available,"portal markers alone do not create personal challenge scores")
    RaptusTestHit(s,10000,100),RaptusTestHit(s,12000,100),RaptusTestSpin(s,13000,true)
    V48Assert(RaptusTestRow(s).DamageDuration=2,"returning from first portal retains captive activity duration")
    RaptusTestSpin(s,100000),RaptusTestHit(s,110000,100),RaptusTestSpin(s,112000,true)
    V48Assert(V6415CSnapshot(s).Selected="raptus-captive:2","next portal groups second personal challenge")
}

V6415ChallengePursuitObserved()
{
    s := V6415CData(),seg := s.Current,seg.AreaId := "833571547775792",seg.BossKey := "DX-E1"
    boss := "Czerka Pursuit Droid {4389417921806336}:1"
    ev := V6415CEvent(s,1000,"Activate",0,boss,"@A#6415")
    ev.Kind := "Other",ev.ActionId := "836045448945477",ev.EffectId := "4389447986577664"
    IPApplyEvent(s,ev,1000)
    IPApplyEvent(s,V6415CEvent(s,1200,"Damage",100,"@A#6415",boss),1200)
    finish := V6415CEvent(s,1400,"Activate",0,"Czerka Pursuit Droid {4389417921806336}:2","="),finish.AbilityId := "4389426511740928"
    IPApplyEvent(s,finish,1400)
    V48Assert(seg.Challenges.Windows["pursuit-droid:1"].End<0,"different pursuit droid's stealth cannot end the observed ambush window")
    finish.Source := ev.Source,IPApplyEvent(s,finish,1500)
    V48Assert(seg.Challenges.Windows["pursuit-droid:1"].End=1500 && V6415CAmount(s)=100,"correct droid closes the ambush fallback window and preserves its raid total")
}

V6415ChallengeZeroHPMarkerGuard()
{
    s := V6415CData(),ev := V6415CEvent(s,1000),rule := {RejectTargetZeroHP:true}
    src := "",dst := "",ready := false
    ev.TargetHP := {Known:true,Current:0,Maximum:100}
    V48Assert(!IRCMatch(rule,ev,&src,&dst,&ready),"pre-death zero-HP removal cannot replace the recorded final death endpoint")
    ev.TargetHP.Current := 1
    V48Assert(IRCMatch(rule,ev,&src,&dst,&ready),"positive-HP removal remains a supported ordinary exposure endpoint")
    ev.TargetHP := {Known:false,Current:0,Maximum:0}
    V48Assert(IRCMatch(rule,ev,&src,&dst,&ready),"unknown HP does not become an invented zero-HP rejection")
}

; v64.16: Nahut's observed leaderboard includes Rail Turret damage in burn.
; Literal records below are from Archive-combat_2026-03-17_18_03_37_653394.txt,
; SHA256 ec09e4638718ce5a5c74fb0e978e9c10d7b9b7150255f90d184d3353973338b0.
; This is a small record regression, not a synthetic claim of full-pull parity.
V6416NahutRailTurretRecords()
{
    s := V6415CData()
    lines := [
        "[19:04:20.474] [NAHUT {4122949560827904}:24799001107908|(-446.15,2562.48,207.91,-144.64)|(15540834/36514284)] [=] [ {4133047028940800}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
        "[19:04:20.869] [@Memster#690525317360130|(-422.66,2561.59,207.91,118.27)|(318328/435260)] [NAHUT {4122949560827904}:24799001107908|(-444.18,2565.18,207.91,-144.12)|(15530525/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10309* elemental {836045448940875}) <10309.0>",
        "[19:04:22.973] [@Memster#690525317360130|(-436.22,2564.27,207.94,124.66)|(318328/435260)] [Rail Turret {4132746381230080}:24799001311082|(-364.62,2600.50,207.91,74.38)|(923268/1260576)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9801* elemental {836045448940875}) <9801.0>",
        "[19:04:25.676] [@Memster#690525317360130|(-440.76,2571.07,207.91,177.96)|(326914/435260)] [Rail Turret {4132746381230080}:24799001311082|(-364.62,2600.50,207.91,68.92)|(435174/1260576)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9075* elemental {836045448940875}) <9075.0>"
    ]
    for line in lines {
        ev := IPParseLine(line)
        V48Assert(IsObject(ev) && ev.ValueOK,"literal Nahut target-policy record decodes in native parser")
        IPApplyEvent(s,ev,ev.RawMs)
    }
    who := "@Memster#690525317360130",expected := 10309+9801+9075
    V48Assert(V6415CAmount(s,who)=expected,"Nahut burn keeps boss damage plus both observed Rail Turret Scorch results")
    V48Assert(s.Current.Totals[who].Damage=expected,"ordinary whole-fight damage still includes the same accepted records")
    V48Assert(V6415CSnapshot(s).Selected="nahut:1" && s.Current.Challenges.Windows.Count=1,"off-target damage contributes to the existing burn rather than creating another phase")
}

V6416NahutTargetWindowEdges()
{
    ; Synthetic sequence controls: the target-policy correction must preserve
    ; exclusive phase bounds, same-ms record order and ordinary self exclusion.
    s := V6415CData(),who := "@A#6415",turret := "Rail Turret {4132746381230080}:1"
    IPApplyEvent(s,V6415CEvent(s,1000,"Damage",10,who,turret),1000)
    IPApplyEvent(s,V6415CMarker(s,1000),1000)
    IPApplyEvent(s,V6415CEvent(s,1000,"Damage",20,who,turret),1000)
    IPApplyEvent(s,V6415CEvent(s,1500,"Damage",900,who,who),1500)
    IPApplyEvent(s,V6415CEvent(s,2000,"Damage",30,who),2000)
    s.EventSerial += 1
    IRCEnd(s.Current,IRCDefinitions(s.Current)[1],2000,s.EventSerial)
    IPApplyEvent(s,V6415CEvent(s,2000,"Damage",40,who,turret),2000)
    IPApplyEvent(s,V6415CEvent(s,2100,"Damage",50,who,turret),2100)
    V48Assert(V6415CAmount(s,who)=50,"only post-start, pre-end target damage counts, including original same-ms order")
    V48Assert(s.Current.Totals[who].Damage=150,"phase bounds do not remove ordinary fight damage and self damage remains excluded")
    V48Assert(V6415CSnapshot(s).Duration=1,"including raid adds cannot change the shared challenge duration")
}

; Detached timer state and synthetic raw records only. No live input or audio.
V65TimerDef(name,interval := 10000,type := "ABILITY_ACTIVATED",ability := "123")
{
    d := IRTDefinition(name,"Test"),d.Enabled := true,d.Interval := interval,d.Color := "FFCC44"
    d.Trigger := IRTCondition(type),d.Trigger.AbilityGuid := ability
    return d
}

V65TimerEvent(kind := "Activate",src := "@Self#1",dst := "@Other#2",aid := "123")
{
    e := {Kind:kind,Source:IPActor(src),Target:IPActor(dst),AbilityId:aid,Ability:"Ability",
        ActionId:"836045448945472",EffectId:"836045448945479",Effect:"AbilityActivate",
        AreaId:"",ModeId:"",Amount:1,ValueOK:true,RawMs:0}
    if kind="Damage"
        e.ActionId := "836045448945477",e.EffectId := "836045448945501",e.Effect := "Damage"
    return e
}

V65TimerState(defs)
{
    s := IRTNewState(defs),s.Enabled := true,s.Self := "@Self#1",s.Now := 100000
    return s
}

V65TimerOnly(s)
{
    for key,inst in s.Active
        return inst
    return ""
}

V65TimerIdentityAndEvents()
{
    d := V65TimerDef("Cîryndà",10000,"DAMAGE","4086837475803136")
    d.Trigger.Source := "@Other",d.Trigger.Target := "@Self"
    s := V65TimerState([d])
    e := V65TimerEvent("Damage","TYTH {4078419339091968}:99","@Self#1","4086837475803136")
    IRTObserve(s,e,100000)
    V48Assert(s.Active.Count=1 && V65TimerOnly(s).Due=110000,"NPC other/self exact ability starts countdown")
    IRTStop(s,d.Id),e.AbilityId := "4086837475803137"
    IRTObserve(s,e,100100)
    V48Assert(s.Active.Count=0,"adjacent large GUID never conflates")
    e.AbilityId := d.Trigger.AbilityGuid,e.Target := IPActor("@Self#2")
    IRTObserve(s,e,100200)
    V48Assert(s.Active.Count=0,"same name another player is not self")
    d.Trigger.Target := "",d.Trigger.Source := "",d.Trigger.SourceGuid := "4078419339091968"
    IRTObserve(s,e,100300)
    V48Assert(s.Active.Count=1,"numeric actor filter uses NPC identity independent of instance")
    V48Assert(IRTDefinition("a","B").Id!==IRTDefinition("A","B").Id,"timer identity is case sensitive")
}

V65TimerRestartAndIgnore()
{
    d := V65TimerDef("Move"),s := V65TimerState([d]),e := V65TimerEvent()
    IRTObserve(s,e,100000),IRTObserve(s,e,102000)
    V48Assert(s.Active.Count=1 && V65TimerOnly(s).Due=112000,"retrigger restarts one instance")
    d.IgnoreRepeated := true
    IRTObserve(s,e,103000)
    V48Assert(V65TimerOnly(s).Due=112000,"ignoreRepeated keeps initial deadline")
    IRTObserve(s,e,101700)
    V48Assert(V65TimerOnly(s).Due=112000,"late repeat cannot rewind deadline")
    short := V65TimerDef("Short",1000),short.IgnoreRepeated := true
    s := V65TimerState([short])
    IRTObserve(s,e,100000),IRTObserve(s,e,101001)
    V48Assert(s.Active.Count=1 && V65TimerOnly(s).Due=102001,"reapplication after expiry works before next display tick")
}

V65TimerSourcesAndCancellation()
{
    d := V65TimerDef("Spread"),d.ShowSource := true
    cancel := IRTCondition("EFFECT_LOST"),cancel.EffectGuid := "999",d.Cancel := cancel
    s := V65TimerState([d])
    IRTObserve(s,V65TimerEvent("Activate","@One#1"),100000)
    IRTObserve(s,V65TimerEvent("Activate","@Two#2"),100001)
    V48Assert(s.Active.Count=2,"showSource keeps distinct owners")
    e := V65TimerEvent(),e.Kind := "Other",e.ActionId := "836045448945478",e.EffectId := "999"
    IRTObserve(s,e,101000)
    V48Assert(s.Active.Count=0 && s.Alerts.Length=0,"cancel stops all source instances without finishing")
}

V65TimerHelperChain()
{
    helper := V65TimerDef("Hidden helper",0),helper.Color := ""
    visible := V65TimerDef("Move away",8000,"TIMER_FINISHED"),visible.Trigger.Timer := helper.Name
    parallel := V65TimerDef("Parallel",9000,"TIMER_STARTED"),parallel.Trigger.Timer := helper.Name
    s := V65TimerState([helper,visible,parallel])
    IRTObserve(s,V65TimerEvent(),100000)
    V48Assert(s.Active.Count=2 && s.Alerts.Length=0,"instant hidden helper starts both chains silently")
    IRTObserve(s,V65TimerEvent(),100100)
    V48Assert(s.Active.Count=2,"chains restart existing instances without duplicates")
    IRTPump(s,103200)
    V48Assert(s.Alerts.Length=1 && InStr(s.Alerts[1].Name,"Move away"),"only visible urgent mechanic alerts")
    sound := V65TimerDef("Fire PING",0),sound.Color := "",sound.Audio := "fire.mp3",sound.ShowCenter := true
    s := V65TimerState([sound])
    IRTObserve(s,V65TimerEvent(),100000)
    V48Assert(s.Active.Count=0 && s.Alerts.Length=1 && s.Alerts[1].Color="F1B847","audio-only import receives center warning without playing audio")
    s := V65TimerState([helper,visible]),s.Now := 103000
    IRTStart(s,helper,100000),IRTPump(s,103000)
    V48Assert(s.Active.Count=1 && V65TimerOnly(s).Due=108000,"late-recognized hidden helper preserves ongoing child deadline")
    fresh := V65TimerDef("Fresh timer",20000),fresh.Cancel := IRTCondition("TIMER_STARTED")
    fresh.Cancel.Timer := helper.Name
    s := V65TimerState([helper,fresh]),s.Now := 102000
    IRTStart(s,fresh,102000),s.Now := 103000
    IRTStart(s,helper,100000),IRTPump(s,103000)
    V48Assert(s.Active.Count=1 && V65TimerOnly(s).Start=102000,"historical linked cancellation cannot erase a newer instance")
}

V65TimerRepeatAndCompletion()
{
    d := V65TimerDef("Repeated",1000),d.Repeat := 3
    next := V65TimerDef("After all",5000,"TIMER_FINISHED"),next.Trigger.Timer := d.Name
    s := V65TimerState([d,next]),s.LeadMs := 0
    IRTObserve(s,V65TimerEvent(),100000),IRTPump(s,101100)
    V48Assert(s.Active.Count=1 && V65TimerOnly(s).Occurrence=2,"repeat expiry advances occurrence only")
    IRTPump(s,102100),IRTPump(s,103100)
    V48Assert(s.Active.Count=1 && V65TimerOnly(s).Def.Name="After all" && V65TimerOnly(s).Due=108000,"finish chain fires once at exact final due time")
    d.Repeat := 99,s := V65TimerState([d]),s.LeadMs := 0
    IRTObserve(s,V65TimerEvent(),100000)
    loop 98
        IRTPump(s,100000+A_Index*1000)
    V48Assert(s.Active.Count=1 && V65TimerOnly(s).Occurrence=99,"explicit repeat99 is supported")
    IRTPump(s,199000)
    V48Assert(s.Active.Count=0,"repeat99 ends after99 occurrences")
}

V65TimerCombatScope()
{
    combat := V65TimerDef("Combat"),combat.Scope := "COMBAT"
    any := V65TimerDef("Long buff"),any.Scope := "ANY"
    s := V65TimerState([combat,any])
    IRTObserve(s,V65TimerEvent(),100000)
    IRTObserve(s,V65TimerEvent("Death"),100100)
    V48Assert(s.Active.Count=2,"recorder death does not end timers")
    IRTObserve(s,V65TimerEvent("Exit","@Other#2"),100200)
    V48Assert(s.Active.Count=2,"another player's exit does not cancel local combat timers")
    IRTObserve(s,V65TimerEvent("Exit"),100300)
    V48Assert(s.Active.Count=1 && V65TimerOnly(s).Def.Name="Long buff","local exit cancels combat scope only")
    IRTObserve(s,V65TimerEvent("Enter"),101000)
    V48Assert(s.Active.Count=1,"any-scope buff survives next entry")
    IRTReset(s,"file changed")
    V48Assert(s.Active.Count=0 && s.Alerts.Length=0,"file reset clears every scope")
}

V65TimerSilenceAndSuspend()
{
    d := V65TimerDef("Old event"),s := V65TimerState([d])
    IRTObserve(s,V65TimerEvent(),100000,false)
    V48Assert(s.Active.Count=0,"blocked backlog cannot start timers")
    IRTStart(s,d,80000)
    V48Assert(s.Active.Count=0,"fully overdue event cannot restart a countdown")
    IRTObserve(s,V65TimerEvent(),100000),IRTPump(s,100100),IRTPump(s,120000)
    V48Assert(s.Active.Count=0 && s.Alerts.Length=0,"sleep gap discards obsolete warnings")
    IRTObserve(s,V65TimerEvent(),130000)
    V48Assert(s.Active.Count=1,"fresh first event after a second pause is not discarded")
    IRTReset(s,"test reset")
    s.Enabled := false
    IRTObserve(s,V65TimerEvent(),120000)
    V48Assert(s.Active.Count=0,"disabled independent master rejects starts")
}

V65TimerGainAndModeFilters()
{
    d := V65TimerDef("On damage effect",10000,"EFFECT_GAINED"),d.Trigger.EffectGuid := "836045448945501"
    d.Trigger.Mode := "NiM",d.Trigger.Size := "Eight"
    s := V65TimerState([d]),e := V65TimerEvent("Damage")
    IRTObserve(s,e,100000)
    V48Assert(s.Active.Count=0,"unknown mode/size cannot satisfy explicit filters")
    s.Mode := "NiM",s.Size := "Eight"
    IRTObserve(s,e,100100)
    V48Assert(s.Active.Count=1,"ApplyEffect Damage supports effect-gained rules")
}

V65TimerCycleGuard()
{
    a := V65TimerDef("a",0,"TIMER_FINISHED"),a.Trigger.Timer := "b",a.Color := ""
    b := V65TimerDef("b",0,"TIMER_FINISHED"),b.Trigger.Timer := "a",b.Color := ""
    s := V65TimerState([a,b])
    IRTStart(s,a,100000),IRTPump(s,100000)
    V48Assert(s.Active.Count=0 && s.Queue.Length=0 && s.Issues.Length=1,"unsafe unvalidated instant loop still bounded at runtime")
    V48Assert(!s.Dispatching,"dispatch guard restored after bounded loop")
}

V65TimerStorageRoundtrip()
{
    path := A_Temp "\iris-timer-store-" ClockMs() ".xml"
    d := V65TimerDef("Unicode: Cîryndà & <test>"),d.Repeat := 99
    try {
        IRTWriteLibrary([d],path)
        raw := FileRead(path,"UTF-8"),r := IRTParseXML(raw)
        V48Assert(r.Definitions.Length=1 && r.Definitions[1].Name==d.Name && r.Definitions[1].Repeat=99,"native UTF8 persistence roundtrips timer semantics")
        d.Enabled := false,IRTWriteLibrary([d],path)
        V48Assert(FileRead(path ".bak","UTF-8")==raw,"replacement preserves exact previous timer library")
        V48Assert(!IRTParseXML(FileRead(path,"UTF-8")).Definitions[1].Enabled,"updated enabled choice persists")
    }
    finally {
        for p in [path,path ".bak"] {
            if FileExist(p)
                FileDelete(p)
        }
    }
}

V65TimerCombatBoundaries()
{
    start := V65TimerDef("Tyth pull",10000,"COMBAT_START"),start.Trigger.Boss := "Tyth"
    end := V65TimerDef("After combat",10000,"COMBAT_END")
    generic := V65TimerDef("Opening helper",0,"COMBAT_START"),generic.Color := ""
    chain := V65TimerDef("Opening chain",20000,"TIMER_STARTED"),chain.Trigger.Timer := generic.Name
    s := V65TimerState([start,end,generic,chain])
    IRTObserve(s,V65TimerEvent("Enter"),100000)
    V48Assert(s.Active.Count=1,"unresolved boss start waits while general start runs")
    e := V65TimerEvent("Enter","TYTH {4078419339902976}:9")
    IRTObserve(s,e,100500)
    V48Assert(s.Active.Count=2 && s.EntryBoss!="","NPC combat-entry can resolve deferred boss start")
    for key,inst in s.Active {
        if inst.Def.Id==start.Id
            V48Assert(inst.Start=100000 && inst.Due=110000,"deferred boss timer retains local entry anchor")
    }
    IRTObserve(s,V65TimerEvent("Enter"),100000)
    for key,inst in s.Active {
        if inst.Def.Id==chain.Id
            V48Assert(inst.Start=100000,"duplicate initial entry cannot restart opening helper chain")
    }
    IRTObserve(s,V65TimerEvent("Exit"),101000)
    IRTObserve(s,V65TimerEvent("Exit"),102000)
    for key,inst in s.Active {
        if inst.Def.Id==end.Id
            V48Assert(inst.Start=101000,"duplicate local exit cannot restart end timer")
    }
    V48Assert(s.LastExit=101000,"exit boundary is recorded once")
}

V65TimerIntegratedReentry()
{
    d := V65TimerDef("Tyth opening",10000,"COMBAT_START"),d.Trigger.Boss := "Tyth"
    s := IRTNewState([d]),s.Enabled := true,s.Self := "@Timer Tester#65",s.Now := 1000
    s.AreaId := "833571547775765",s.ModeId := "836045448953655"
    IRTObserve(s,V65BEv("Enter"),1000),IRTObserve(s,V65CEv(),1100)
    V48Assert(s.Active.Count=1 && V65TimerOnly(s).Due=11000,"first pull begins at local combat entry")
    IRTObserve(s,V65BEv("Death","@Timer Tester#65","="),2000)
    IRTObserve(s,V65BEv("Enter"),3000)
    IRTObserve(s,V65CEv("Damage","4078423634870272","20","990/1000"),3100)
    V48Assert(s.CombatStart=3000 && s.Active.Count=1 && V65TimerOnly(s).Due=13000,"confirmed new boss life restarts opening without an ExitCombat line")
    IRTObserve(s,V65BEv("Death","@Timer Tester#65","="),4000)
    IRTObserve(s,V65BEv("Enter"),5000)
    IRTObserve(s,V65CEv("Damage","4078423634870272","20","800/1000"),5100)
    V48Assert(s.CombatStart=3000 && V65TimerOnly(s).Due=13000,"battle resurrection preserves the existing opening timer")
}

; These are pure XML/library checks. They never touch production files or audio.
V65IWrap(body,version := "")
{
    return "<com.ixale.starparse.domain.ConfigTimers>" (version!="" ? "<irisVersion>" version "</irisVersion>" : "")
        . "<timers>" body "</timers></com.ixale.starparse.domain.ConfigTimers>"
}

V65IXML(name,body := "",folder := "Tests")
{
    return "<com.ixale.starparse.domain.ConfigTimer>" IRTIXMLTag("name",name) IRTIXMLTag("folder",folder)
        . body "</com.ixale.starparse.domain.ConfigTimer>"
}

V65IDef(name,folder := "Tests",linked := "",kind := "TIMER_FINISHED")
{
    def := IRTDefinition(name,folder),def.Color := "AA55CC",def.Interval := 5000
    def.Trigger := IRTCondition(linked!="" ? kind : "ABILITY_ACTIVATED")
    if linked!=""
        def.Trigger.Timer := linked
    else
        def.Trigger.Ability := "Slice"
    return def
}

V65IReject(xml)
{
    rejected := false
    try IRTParseXML(xml)
    catch
        rejected := true
    V48Assert(rejected,"unsafe or malformed timer XML is rejected without partial import")
}

V65TimerImportSafeXML()
{
    V65IReject('<!DOCTYPE x [<!ENTITY y SYSTEM "file:///C:/Windows/win.ini">]><x>&y;</x>')
    V65IReject('<!DOCTYPE x [<!ENTITY y "expansion">]><x>&y;</x>')
    V65IReject("<other><timers/></other>")
    V65IReject("<com.ixale.starparse.domain.configtimers><timers/></com.ixale.starparse.domain.configtimers>")
    V65IReject("<com.ixale.starparse.domain.ConfigTimers><timers>")
    V65IReject(V65IWrap(V65IXML("Duplicate","<name>Changed</name>")))
    V65IReject(V65IWrap(V65IXML("Nested","<audio><script>run</script></audio>")))
    V65IReject(V65IWrap(V65IXML("Attribute",'<enabled action="run">true</enabled>')))
    V65IReject(V65IWrap(V65IXML("Boolean","<enabled>yes</enabled>")))
    V65IReject(V65IWrap(V65IXML("Bad number","<interval>-1</interval>")))
    V65IReject(V65IWrap(V65IXML("NaN","<interval>NaN</interval>")))
    V65IReject(V65IWrap(V65IXML("Bad slot","<slot>D</slot>")))
    V65IReject(V65IWrap(V65IXML("Bad color","<color>red</color>")))
    V65IReject(V65IWrap(V65IXML("GUID","<trigger><type>DAMAGE</type><abilityGuid>123x</abilityGuid></trigger><interval>1</interval>")))
    V65IReject(V65IWrap("","2"))
    V65IReject(V65IWrap(V65IXML("Native fields","<irisSupported>true</irisSupported>")))
    V48Assert(IRTParseXML(V65IWrap("")).Definitions.Length=0,"empty library remains a valid explicit empty library")
}

V65TimerImportMetadata()
{
    fragment := "<trigger><type>EFFECT_GAINED</type><source>@Self</source><target>@Other</target>"
        . "<abilityGuid>9999999999999999999</abilityGuid><effect>Grâce &amp; Ward</effect><boss>TYTH</boss></trigger>"
        . "<cancel><type>COMBAT_END</type></cancel><interval>12.345</interval><repeat>99</repeat>"
        . "<enabled>false</enabled><ignoreRepeated>true</ignoreRepeated><showSource>true</showSource>"
        . "<color>0xAa55CCff</color><slot>C</slot><audio>Alert.mp3</audio><volume>27</volume>"
        . "<soundOffset>3</soundOffset><countdownVoice>Yolo</countdownVoice><countdownCount>5</countdownCount><countdownVolume>41</countdownVolume>"
    parsed := IRTParseXML(V65IWrap(V65IXML("Grâce <Ward>",fragment,"Class & Raid"))),def := parsed.Definitions[1]
    V48Assert(def.Name="Grâce <Ward>" && def.Folder="Class & Raid","Unicode and escaped names survive XML reading")
    V48Assert(def.Trigger.AbilityGuid=="9999999999999999999","large GUID stays exact text, never floating point")
    V48Assert(def.Interval=12345 && def.Repeat=99,"fractional seconds become milliseconds and explicit repeat99 is preserved")
    V48Assert(def.Scope="COMBAT","COMBAT_END cancellation assigns combat scope exactly as StarParse CustomTimer")
    V48Assert(!def.Enabled && def.IgnoreRepeated && def.ShowSource,"enable and repeat/source choices are preserved")
    V48Assert(def.Color="AA55CC" && def.Slot="C","StarParse RGBA becomes the required RGB presentation color")
    V48Assert(def.Audio="Alert.mp3" && def.Volume=27 && def.SoundOffset=3,"sound filename, volume and offset are retained without playback")
    V48Assert(def.CountdownVoice="Yolo" && def.CountdownCount=5 && def.CountdownVolume=41,"countdown metadata is retained")
    V48Assert(parsed.Issues.Length=1 && InStr(parsed.Issues[1],"Timer audio"),"optional audio setup is reported once")
    helper := IRTParseXML(V65IWrap(V65IXML("Bombardment STOP","<trigger><type>EFFECT_LOST</type><effectGuid>4308938824613888</effectGuid></trigger><interval>0.0</interval><repeat>0</repeat><slot>A</slot>"))).Definitions[1]
    V48Assert(helper.Interval=0 && helper.Repeat=1 && helper.Color="" && !helper.ShowCenter && helper.Scope="ANY","zero-duration hidden helper stays hidden; absent combat cancellation keeps any scope")
    trailing := IRTParseXML(V65IWrap(V65IXML("Anchor ","<trigger><type>TIMER_STARTED</type><timer>Next </timer></trigger><interval>1</interval>"))).Definitions[1]
    V48Assert(trailing.Name=="Anchor " && trailing.Trigger.Timer=="Next ","name and dependency trailing spaces remain exact")
    large := IRTParseXML(V65IWrap(V65IXML("Too many","<trigger><type>COMBAT_START</type></trigger><interval>1</interval><repeat>1001</repeat>"))).Definitions[1]
    V48Assert(!large.Supported && large.Repeat=1001 && InStr(large.Reason,"1,000"),"unsupported repeat count is preserved and explained, never silently clamped")
}

V65TimerImportBuiltinOverrides()
{
    builtin := V65IDef("Revan Pull","Built-in: Temple of Sacrifice"),builtin.Builtin := true,builtin.Interval := 15000
    builtin.ExtraMechanic := "preserved",builtin.Enabled := false
    parsed := IRTParseXML(V65IWrap(V65IXML("Revan Pull","<enabled>true</enabled><color>0xb82cb8ff</color><countdownVoice>Nevara</countdownVoice><countdownCount>5</countdownCount><countdownVolume>24</countdownVolume>",builtin.Folder)))
    V48Assert(parsed.Definitions.Length=0 && parsed.Overrides.Length=1,"built-in settings are separated from portable custom rules")
    merged := IRTMergeDefinitions([builtin],parsed),def := merged.Definitions[1]
    V48Assert(merged.Definitions.Length=1 && merged.Added=0 && def.Enabled && def.Color="B82CB8","exact built-in settings update presentation in place")
    V48Assert(def.Interval=15000 && def.Trigger.Ability="Slice" && def.ExtraMechanic="preserved","override cannot replace built-in mechanic, trigger, or duration")
    V48Assert(!builtin.Enabled && builtin.Color="AA55CC","preview merge does not mutate the existing catalogue")
    absent := IRTMergeDefinitions([],parsed)
    V48Assert(absent.Definitions.Length=1 && !absent.Definitions[1].Supported,"unknown built-in settings remain listed with explicit unsupported status")
    caseMismatch := V65IDef("revan pull",builtin.Folder),caseMismatch.Builtin := true
    unmatched := IRTMergeDefinitions([caseMismatch],parsed)
    V48Assert(unmatched.Definitions.Length=2 && !unmatched.Definitions[2].Supported,"built-in name lookup is case-sensitive and never fuzzy")
}

V65TimerImportRoundTrip()
{
    def := V65IDef("Quote ' and `" plus < & > é","Folder & Name")
    def.Enabled := false,def.Interval := 12345,def.RepeatInterval := 6789,def.Repeat := 99
    def.Scope := "ANY",def.ShowCenter := false,def.ShowSource := true,def.IgnoreRepeated := true
    def.Audio := "C:\sounds\Alert & call.mp3",def.Volume := 22,def.SoundOffset := 4
    def.CountdownVoice := "Amy",def.CountdownCount := 3,def.CountdownVolume := 20
    def.Trigger.SourceGuid := "9999999999999999999",def.Cancel := IRTCondition("COMBAT_END")
    xml := IRTSerializeXML([def]),parsed := IRTParseXML(xml),copy := parsed.Definitions[1]
    V48Assert(copy.Id==def.Id && copy.Name==def.Name && copy.Folder==def.Folder,"identity and escaped Unicode names survive normalized sidecar roundtrip")
    V48Assert(copy.Interval=12345 && copy.RepeatInterval=6789 && copy.Repeat=99,"millisecond timing and repeat spacing roundtrip exactly")
    V48Assert(!copy.Enabled && !copy.ShowCenter && copy.ShowSource && copy.IgnoreRepeated && copy.Scope="ANY","all user display and scope choices roundtrip")
    V48Assert(copy.Audio==def.Audio && copy.SoundOffset=4 && copy.Volume=22 && copy.CountdownVoice="Amy" && copy.CountdownCount=3 && copy.CountdownVolume=20,"audio metadata remains untouched")
    V48Assert(copy.Trigger.SourceGuid==def.Trigger.SourceGuid && copy.Cancel.Type="COMBAT_END","condition identifiers and cancellation survive")
    V48Assert(IRTSerializeXML(parsed.Definitions)==xml,"normalized serialization is deterministic after a full parse")
}

V65TimerImportDependencies()
{
    a := V65IDef("A"),b := V65IDef("B","Tests","A"),c := V65IDef("C","Tests","B","TIMER_STARTED")
    V48Assert(IRTValidateDependencies([a,b,c]).Length=0 && c.Supported,"valid start/finish chains are accepted")
    missing := V65IDef("Later","Tests","Absent")
    V48Assert(IRTValidateDependencies([missing]).Length=1 && !missing.Supported,"missing dependency explicitly disables affected rule")
    supplied := V65IDef("Absent")
    V48Assert(IRTValidateDependencies([missing,supplied]).Length=0 && missing.Supported,"adding missing dependency can restore support during full-catalogue validation")
    lower := V65IDef("Lower","Tests","a")
    V48Assert(IRTValidateDependencies([a,lower]).Length=1,"timer names do not match using case folding")
    duplicate := V65IDef("A","Other folder")
    V48Assert(IRTValidateDependencies([a,duplicate,b]).Length=1 && InStr(b.Reason,"Ambiguous"),"same name in different folders makes unqualified linkage ambiguous")
    cycleA := V65IDef("Cycle A","Tests","Cycle B"),cycleB := V65IDef("Cycle B","Tests","Cycle A")
    downstream := V65IDef("Downstream","Tests","Cycle A")
    issues := IRTValidateDependencies([cycleA,cycleB,downstream])
    V48Assert(issues.Length=3 && InStr(cycleA.Reason,"cycle") && InStr(downstream.Reason,"unavailable"),"dependency cycles and downstream invalid chains are reported")
    safe := V65IDef("Safe"),safe.Cancel := IRTCondition("TIMER_STARTED"),safe.Cancel.Timer := "Safe"
    V48Assert(IRTValidateDependencies([safe]).Length=0,"a self cancellation alone is not incorrectly called a trigger cycle")
    cancel := V65IDef("Broken cancel"),cancel.Cancel := IRTCondition("TIMER_STARTED"),cancel.Cancel.Timer := "Nobody"
    V48Assert(IRTValidateDependencies([cancel]).Length=1 && !cancel.Supported,"missing cancellation is not silently discarded")
    chain := []
    loop 1200
        chain.Push(V65IDef("Chain " A_Index,"Long",A_Index<1200 ? "Chain " (A_Index+1) : ""))
    V48Assert(IRTValidateDependencies(chain).Length=0 && chain[1].Supported,"a long valid dependency chain avoids recursive call-stack exhaustion")
}

V65TimerImportMerge()
{
    old := V65IDef("One"),fresh := V65IDef("One"),fresh.Interval := 10000
    skipped := IRTMergeDefinitions([old],[fresh])
    V48Assert(skipped.Conflicts.Length=1 && skipped.Definitions[1].Interval=5000 && skipped.Added=0,"normal import preserves existing timer and reports conflict")
    replaced := IRTMergeDefinitions([old],[fresh],true)
    V48Assert(replaced.Conflicts.Length=0 && replaced.Definitions[1].Interval=10000 && old.Interval=5000,"explicit replacement changes the clone only")
    duplicates := IRTMergeDefinitions([],[fresh,IRTIClone(fresh)],true)
    V48Assert(duplicates.Added=1 && duplicates.Definitions.Length=1 && duplicates.Conflicts.Length=1,"duplicate incoming identities are reported, not order-dependent replacements")
    different := V65IDef("one"),caseNames := IRTMergeDefinitions([old],[different])
    V48Assert(caseNames.Added=1 && caseNames.Definitions.Length=2,"stable IDs retain case-sensitive names")
    builtin := V65IDef("Protected"),builtin.Builtin := true
    collision := IRTMergeDefinitions([builtin],[V65IDef("Protected")],true)
    V48Assert(collision.Conflicts.Length=1 && collision.Definitions[1].Builtin,"custom import cannot overwrite built-in mechanics even in replacement mode")
    child := V65IDef("Child","Tests","Parent")
    V48Assert(child.Supported,"unmerged dependency is not disabled prematurely")
    joined := IRTMergeDefinitions([V65IDef("Parent")],[child])
    V48Assert(joined.Issues.Length=0 && joined.Definitions[2].Supported,"dependencies are validated after existing and incoming catalogues join")
}

V65TimerImportUnsupportedRetained()
{
    keyDef := IRTParseXML(V65IWrap(V65IXML("Key","<trigger><type>HOTKEY</type><hotkeyMod>CTRL</hotkeyMod><hotkeyKey>F9</hotkeyKey></trigger><interval>1</interval>"))).Definitions[1]
    V48Assert(!keyDef.Supported && keyDef.Trigger.HotkeyKey="F9" && keyDef.Trigger.HotkeyMod="CTRL","hotkey metadata is retained without registering gameplay input")
    copy := IRTParseXML(IRTSerializeXML([keyDef])).Definitions[1]
    V48Assert(!copy.Supported && copy.Trigger.Type="HOTKEY" && InStr(copy.Reason,"hotkey"),"unsupported hotkeys stay unsupported after save/reload")
    future := IRTParseXML(V65IWrap(V65IXML("Future","<trigger><type>NEW_EVENT</type><newThing>value</newThing></trigger><interval>2</interval><futureSetting>keep me</futureSetting>"))).Definitions[1]
    V48Assert(!future.Supported && InStr(future.ImportExtraXML,"keep me") && InStr(future.Trigger.ImportExtraXML,"newThing"),"unknown fields are retained and explained instead of silently dropping semantics")
    restored := IRTParseXML(IRTSerializeXML([future])).Definitions[1]
    V48Assert(!restored.Supported && restored.ImportExtraXML==future.ImportExtraXML && restored.Trigger.ImportExtraXML==future.Trigger.ImportExtraXML,"unknown-field data roundtrips as inert escaped XML text")
}

V65TimerImportRealApex()
{
    ; Exact field values from starparse-timers v15.xml entries87/88, SHA256
    ; 0c7f5618e41c5a6a01e70127dc87ff451bb79723d65f04348f2d95084de3b4c5.
    ; Embedded fixtures make this diagnostic independent of the user's files.
    xml := "<com.ixale.starparse.domain.ConfigTimers><timers>"
        . "<com.ixale.starparse.domain.ConfigTimer><name>Bombardment</name><folder>The Nature of Progress</folder>"
        . "<trigger><type>EFFECT_GAINED</type><source>@Other</source><target>@Self</target>"
        . "<abilityGuid>4308938824613888</abilityGuid><effectGuid>4308938824613888</effectGuid></trigger>"
        . "<cancel><type>TIMER_STARTED</type><timer>Bombardment STOP</timer></cancel>"
        . "<interval>32.0</interval><color>0x994d66ff</color><slot>A</slot><enabled>true</enabled>"
        . "<ignoreRepeated>false</ignoreRepeated><showSource>false</showSource></com.ixale.starparse.domain.ConfigTimer>"
        . "<com.ixale.starparse.domain.ConfigTimer><name>Bombardment STOP</name><folder>The Nature of Progress</folder>"
        . "<trigger><type>EFFECT_LOST</type><source>@Other</source><target>@Self</target>"
        . "<abilityGuid>4308938824613888</abilityGuid><effectGuid>4308938824613888</effectGuid></trigger>"
        . "<cancel><type>COMBAT_END</type></cancel><interval>0.0</interval><slot>A</slot><enabled>true</enabled>"
        . "<ignoreRepeated>false</ignoreRepeated><showSource>false</showSource></com.ixale.starparse.domain.ConfigTimer>"
        . "</timers></com.ixale.starparse.domain.ConfigTimers>"
    parsed := IRTParseXML(xml),definitions := parsed.Definitions
    V48Assert(definitions.Length=2 && parsed.Issues.Length=0 && parsed.Overrides.Length=0,"actual Apex XML pair imports without losing a helper or requiring external files")
    V48Assert(IRTValidateDependencies(definitions).Length=0,"actual Bombardment STOP dependency resolves exactly")
    V48Assert(definitions[1].Interval=32000 && definitions[1].Color="994D66" && definitions[1].Scope="ANY"
        && definitions[2].Interval=0 && definitions[2].Color="" && !definitions[2].ShowCenter && definitions[2].Scope="COMBAT",
        "actual visible countdown and hidden zero-duration combat helper retain original semantics")
    ; Literal lines12293,12295,12375 from Archive-combat_2026-07-09_01_12_30_381339.txt,
    ; SHA25659e303499608d5bb5c585d83c289cf954a7e09f908fae097cc589c1bc7559356.
    lines := [
        "[01:28:37.482] [Apex Vanguard {4350020186800128}:2277000033245|(444.01,-257.86,-13.98,-118.26)|(42770804/62726540)] [@Auari#689632371635546|(438.43,-255.08,-13.98,-63.39)|(334598/334598)] [Mass Target Lock {4308938824613888}] [ApplyEffect {836045448945477}: Mass Target Lock {4308938824613888}]",
        "[01:28:37.482] [Apex Vanguard {4350020186800128}:2277000033245|(444.01,-257.86,-13.98,-118.26)|(42770804/62726540)] [@Felshade Reaper#689269730202861|(437.47,-255.60,-13.98,-111.27)|(382011/440738)] [Mass Target Lock {4308938824613888}] [ApplyEffect {836045448945477}: Mass Target Lock {4308938824613888}]",
        "[01:28:38.788] [Apex Vanguard {4350020186800128}:2277000033245|(444.01,-257.86,-13.98,-118.26)|(42604600/62726540)] [@Felshade Reaper#689269730202861|(438.05,-248.32,-13.98,-160.84)|(440738/440738)] [Mass Target Lock {4308938824613888}] [RemoveEffect {836045448945478}: Mass Target Lock {4308938824613888}]"
    ]
    s := IRTNewState(definitions),s.Enabled := true,s.Self := "@Felshade Reaper#689269730202861"
    s.Now := 100000,s.InCombat := true
    first := IPParseLine(lines[1]),own := IPParseLine(lines[2]),removal := IPParseLine(lines[3])
    V48Assert(IsObject(first) && IsObject(own) && IsObject(removal) && removal.RawMs-own.RawMs=1306,"native parser decodes all three literal records and their actual time gap")
    IRTObserve(s,first,100000)
    V48Assert(s.Active.Count=0,"another player's actual Mass Target Lock does not trigger the local timer")
    IRTObserve(s,own,100000),due := 0
    for key,instance in s.Active
        due := instance.Due
    V48Assert(s.Active.Count=1 && due=132000,"local application starts the original imported32-second countdown")
    IRTObserve(s,removal,101306)
    V48Assert(s.Active.Count=0 && s.Alerts.Length=0,"actual removal activates hidden STOP and cancels countdown without a false warning")
}

; Isolated synthetic timer regressions. No global state, GUI, playback or live IO.
V65BPump(s,now)
{
    ; Model ordinary timer ticks. A real >5s scheduler gap correctly suspends
    ; the engine; the fixture must not disable that guard to jump time.
    while s.LastPump>=0 && s.LastPump<now-1000
        IRTPump(s,s.LastPump+1000)
    IRTPump(s,now)
}

V65BObserve(s,ev,at,allow := true)
{
    if s.LastPump>=0 && at>s.LastPump+1000
        V65BPump(s,at-1)
    IRTObserve(s,ev,at,allow)
}

V65BState(mode := "NiM")
{
    s := IRTNewState(IRTBDefinitions())
    s.Enabled := true, s.Self := "@Timer Tester#65", s.Mode := mode, s.Size := "Eight"
    V65BObserve(s,V65BEv("Enter"),1000)
    return s
}

V65BEv(kind := "Other",source := "@Timer Tester#65",target := "=",ability := "",effect := "",action := "")
{
    if action=""
        action := kind="Damage" || kind="Heal" ? "836045448945477" : "836045448945472"
    if effect="" {
        static effects := Map("Enter","836045448945489","Exit","836045448945490","Death","836045448945493",
            "Activate","836045448945479","Damage","836045448945501","Heal","836045448945500")
        effect := effects.Get(kind,"999")
    }
    line := "[00:00:01.000] [" source "] [" target "] [Timer test {" (ability="" ? "1" : ability) "}] [Event {" action "}: Test {" effect "}]"
    if kind="Damage"
        line .= " (100 energy {836045448940874}) <100.0>"
    else if kind="Heal"
        line .= " (100) <100.0>"
    return IPParseLine(line)
}

V65BFind(s,name)
{
    for key, item in s.Active {
        if item.Def.Name==name
            return item
    }
    return ""
}

V65BDue(s,name,due,label := "")
{
    t := V65BFind(s,name)
    V48Assert(IsObject(t) && t.Due=due,label="" ? name " has expected anchored deadline" : label)
}

V65BIdle(s,name,label := "")
{
    V48Assert(!IsObject(V65BFind(s,name)),label="" ? name " remains inactive" : label)
}

V65BuiltinCatalogue()
{
    defs := IRTBDefinitions(), names := Map(), unsupported := 0
    V48Assert(defs.Length=40,"built-in catalogue has 40 unique configurable timer names")
    for d in defs {
        V48Assert(!names.Has(d.Name),"built-in aliases do not duplicate user-facing settings")
        names[d.Name] := d
        if !d.Supported {
            unsupported += 1
            V48Assert(!d.Enabled && d.Reason!="","unavailable presets are disabled with an explanation")
        }
        V48Assert(d.Builtin && d.Scope!="" && d.Interval>0,"all built-ins carry normalized lifecycle fields")
    }
    V48Assert(unsupported=4,"only source-defective/prohibited Slice and nonlocal raid-service presets are unavailable")
    V48Assert(names["Council Deathmark"].Repeat=50 && names["Council Deathmark"].RepeatInterval=63000,"source repeat limit retained")
    V48Assert(names["Bestia Arrives"].Color="","raw invisible StarParse countdown stays invisible by default")
    V48Assert(names["Raid Pull"].CountdownVoice="Amy" && names["Raid Pull"].CountdownCount=5,"unavailable network preset retains presentation metadata")
}

V65BuiltinContext()
{
    s := V65BState()
    V65BObserve(s,V65BEv("Damage","Tyth {999}:1","@Timer Tester#65"),2000)
    V48Assert(s.Boss="","NPC display name cannot impersonate a recognized boss")
    V65BObserve(s,V65BEv("Damage","Anything {4078423634870272}:1","@Timer Tester#65"),2100)
    V48Assert(IRTBBossAlias(s.Boss)="tyth","exact NPC id identifies boss regardless of localization")
    V48Assert(IRTBBossAlias("Dread Master Bestia")=IRTBBossAlias("Bestia"),"imported full boss name matches enum")
    V48Assert(IRTBBossAlias("The Pack Leader")=IRTBBossAlias("Red"),"Pack Leader alias uses recorded Red identity")
    V48Assert(IRTBBossAlias("Grob’Thok, Who Feeds The Forge")="grobthok","Unicode exported boss label maps explicitly")
    V48Assert(IRTBBossAlias("AIVELA & ESNE")=IRTBBossAlias("AivelaAndEsne"),"exported Sisters punctuation maps correctly")
    V48Assert(IRTBBossAlias("Unrelated Boss")!="tyth","unknown boss filters remain unmatched")
    area := V65BEv(), area.Kind := "Area", area.AreaId := "833571547775765", area.ModeId := "836045448953652"
    V65BObserve(s,area,3000)
    V48Assert(s.Mode="HM" && s.Size="Eight" && !s.InCombat && s.Boss="","recorded area updates scope and clears old boss")
    area.ModeId := "unknown"
    V65BObserve(s,area,4000)
    V48Assert(s.Mode="" && s.Size="","unknown mode cannot inherit prior difficulty")
    s := V65BState("")
    s.ModeId := "836045448953655", s.AreaId := "833571547775765"
    V65BObserve(s,V65BEv("Damage","TYTH {4078423634870272}:1","@Timer Tester#65"),2000)
    V48Assert(s.Mode="NiM" && s.Size="Eight","hydrated numeric header resolves difficulty without replaying Area")
    V65BDue(s,"Tyth Inversion",27500,"first live forecast uses hydrated difficulty and original combat anchor")
}

V65BuiltinTyth()
{
    s := V65BState()
    V65BObserve(s,V65BEv("Damage","TYTH {4078423634870272}:1","@Timer Tester#65"),2000)
    V65BDue(s,"Tyth Inversion",27500,"first Inversion stays26.5s after pull, not boss-discovery time")
    other := V65BEv("Other","TYTH {4078423634870272}:1","@Other#66","4071117895499776","4071117895500098","836045448945477")
    V65BObserve(s,other,25000)
    V65BDue(s,"Tyth Inversion",27500,"another player's wave does not reset recorder timer")
    own := V65BEv("Other","TYTH {4078423634870272}:1","@Timer Tester#65","4071117895499776","4071117895500102","836045448945477")
    V65BObserve(s,own,27000)
    V65BDue(s,"Tyth Inversion",64500,"observed long wave resynchronizes next37.5s")
    IRTObserve(s,own,26500)
    V65BDue(s,"Tyth Inversion",64500,"nearby reordered wave cannot move a newer builtin anchor backward")
    V65BObserve(s,V65BEv("Exit"),28000)
    V65BIdle(s,"Tyth Inversion","local combat-end contract clears builtin countdown")
    s := V65BState("SM")
    V65BObserve(s,own,2000)
    V65BIdle(s,"Tyth Inversion","Story mode never gets hard-mode Inversion forecast")
    s := V65BState("")
    V65BObserve(s,own,2000)
    V65BIdle(s,"Tyth Inversion","missing difficulty is not assumed Master")
}

V65BuiltinTerrorGates()
{
    s := V65BState(), s.Boss := "TerrorFromBeyond"
    near := V65BEv("Other","Tentacle {3025258999185408}:1","@Timer Tester#65","7","3025864589574402","836045448945477")
    V65BObserve(s,near,2000)
    V65BDue(s,"Terror First Slam (trigger on nearby)",16000)
    V65BObserve(s,near,14000)
    V65BDue(s,"Terror First Slam (trigger on nearby)",16000,"exact12s repeated nearby stays gated")
    V65BObserve(s,near,14001)
    V65BDue(s,"Terror First Slam (trigger on nearby)",28001,"strictly more than12s resets nearby countdown")
    slam := V65BEv("Damage","Tentacle {3025258999185408}:1","@Timer Tester#65","3025877474476032")
    V65BObserve(s,slam,15000)
    V65BIdle(s,"Terror First Slam (trigger on nearby)")
    V65BDue(s,"Terror Slam",25000)
    V65BObserve(s,slam,23000)
    V65BDue(s,"Terror Slam",25000,"exact8s duplicate slam stays gated")
    V65BObserve(s,slam,23001)
    V65BDue(s,"Terror Slam",33001)
    V65BObserve(s,V65BEv("Other","Boss {3025220344479744}:1","@Timer Tester#65","3009973210578944"),24000)
    V65BIdle(s,"Terror Slam","entering Beyond cancels the slam forecast")
}

V65BuiltinFixedSchedules()
{
    s := V65BState(), s.Boss := "Bestia"
    V65BObserve(s,V65BEv(),2000)
    V65BDue(s,"Bestia Arrives",123000)
    V65BPump(s,123000)
    V65BIdle(s,"Bestia Arrives")
    V65BDue(s,"Bestia Last Monster",364000)
    V65BPump(s,364000)
    V65BIdle(s,"Bestia Last Monster")
    V65BDue(s,"Bestia Soft Enrage",514000)
    V65BObserve(s,V65BEv("Activate","Bestia {3273941900591104}:1","=","3294098182111232"),365000)
    V65BDue(s,"Bestia Despair",390000,"event-driven Despair remains active in burn")
    IRTReset(s)
    V65BPump(s,800000)
    V48Assert(s.Active.Count=0 && s.BuiltinState.Count=0,"reset leaves no timed phase continuation")
    for row in [["Torque","Torque Wookierage",46500,274000,"Torque Enrage",341000],
        ["SwordSquadron","Walkers Shield",31000,334500,"Walkers Enrage",361000],
        ["Underlurker","Underluker Adds",16200,213000,"Underluker Enrage",301000]] {
        s := V65BState("HM"),s.Boss := row[1]
        V65BObserve(s,V65BEv(),2000)
        V65BDue(s,row[2],row[3])
        V65BPump(s,row[4])
        V65BDue(s,row[5],row[6],"late enrage bar uses original combat start")
    }
    s := V65BState("SM"), s.Boss := "SwordSquadron"
    V65BObserve(s,V65BEv(),2000)
    V65BIdle(s,"Walkers Gravity","Walkers Gravity retains explicit HM gate")
}

V65BuiltinCouncilPhases()
{
    s := V65BState(),s.Boss := "Council"
    V65BObserve(s,V65BEv(),2000)
    V65BDue(s,"Council Deathmark",30000)
    V65BDue(s,"Council Tyrans TP",13000)
    V65BObserve(s,V65BEv("Damage","@Timer Tester#65","Brontes {3274019210002432}:9"),20000)
    V65BIdle(s,"Council Deathmark")
    V65BIdle(s,"Council Tyrans TP")
    V65BDue(s,"Council Brontes TP",32250)
    fury := V65BEv("Other","Council {3273984850264064}:1","Tyrans {3273997735165952}:4","3321757771497472","9","836045448945477")
    V65BObserve(s,fury,60000)
    V65BIdle(s,"Council Brontes TP")
    V65BDue(s,"Council Deathmark",84500)
    V65BDue(s,"Council Tyrans TP",73000)
    for d in s.Definitions {
        if d.Name="Council Deathmark"
            V48Assert(d.Interval=29000,"P3 duration clone does not change next pull's P1 option")
    }
    V65BObserve(s,V65BEv("Other","Council {3273984850264064}:1","@Timer Tester#65","3322475031035904"),70000)
    V65BIdle(s,"Council Deathmark")
    V65BIdle(s,"Council Tyrans TP")
    IRTReset(s),s.Enabled := true,s.InCombat := true,s.CombatStart := 1000,s.Boss := "Council",s.Now := 1000
    IRTBObserve(s,V65BEv(),1000)
    V65BDue(s,"Council Deathmark",30000,"fresh pull restores original29s Deathmark")
}

V65BuiltinApex()
{
    s := V65BState(),s.Boss := "ApexVanguard"
    acid := V65BEv("Other","Apex {4350020186800128}:1","@Other#66","7","4305240857772294","836045448945477")
    V65BObserve(s,acid,1900)
    V65BIdle(s,"Apex Acid Blast","puddle contact cannot predict a boss cast")
    cast := V65BEv("Activate","Apex {4350020186800128}:1","=","4305094828883968")
    V65BObserve(s,cast,2000)
    V65BDue(s,"Apex Acid Blast",32000,"observed boss activation arms the next-cast forecast")
    V65BObserve(s,acid,28000)
    V65BDue(s,"Apex Acid Blast",32000,"puddle contact after 26 seconds cannot reanchor the forecast")
    V65BObserve(s,acid,28001)
    V65BDue(s,"Apex Acid Blast",32000,"later puddle contact is still not a cast")
    rocket := V65BEv("Other","Apex {4350020186800128}:1","@Other#66","7","4308741256118272","836045448945477")
    V65BObserve(s,rocket,29000),V65BObserve(s,rocket,29100)
    V65BDue(s,"Apex Rockets",53100,"source's explicit rocket apply branch resynchronizes within4s")
    contagion := V65BEv("Other","Apex {4350020186800128}:1","@Other#66","7","4352726016196922","836045448945477")
    V65BObserve(s,contagion,30000)
    V65BIdle(s,"Apex Contagion","other raider Contagion is not personal timer")
    contagion.Target := IPActor("@Timer Tester#65")
    V65BObserve(s,contagion,31000),V65BObserve(s,contagion,32000)
    V65BDue(s,"Apex Contagion",91000,"Contagion repeated effects leave running countdown intact")
    mass := V65BEv("Other","Apex {4350020186800128}:1","@Timer Tester#65","7","4308938824613888","836045448945477")
    V65BObserve(s,mass,33000)
    V65BDue(s,"Apex Mass Target",63000)
    mass.ActionId := "836045448945478"
    V65BObserve(s,mass,34000)
    V65BIdle(s,"Apex Mass Target","effect loss cancels personal target-lock timer")
    V65BObserve(s,V65BEv("Other","@Timer Tester#65","Transformator {4297557161279488}:2"),35000)
    V65BIdle(s,"Apex Rockets")
    V65BIdle(s,"Apex Acid Blast")
}

V65BuiltinRevan()
{
    s := V65BState("HM"),s.Boss := "Revan"
    V65BObserve(s,V65BEv("Other","Revan {3431605855059968}:1","@Timer Tester#65","3462632698806272"),2000)
    V65BDue(s,"Revan Heave",32500)
    V65BObserve(s,V65BEv("Damage","@Timer Tester#65","HK {3444310368321536}:2"),3000)
    V65BIdle(s,"Revan Heave")
    V65BObserve(s,V65BEv("Damage","@Timer Tester#65","Focus {3440805675008000}:3"),4000)
    V65BObserve(s,V65BEv("Damage","@Timer Tester#65","Revan {3431605855059968}:1"),5000)
    V48Assert(s.BuiltinState["phase"]="Second","recorded HK/Focus/boss damage advances source phase sequence")
    resonance := V65BEv("Other","Revan {3431605855059968}:1","@Timer Tester#65","3447578838433792","9","836045448945477")
    V65BObserve(s,resonance,6000)
    V48Assert(s.BuiltinState["phase"]="Shield","Resonance enters shield phase")
    interruption := V65BEv("Other","Revan {3431605855059968}:1","=","3447578838433792","836045448945482")
    V65BObserve(s,interruption,7000)
    V65BDue(s,"Revan Push",22000)
    V65BPump(s,22000)
    V65BIdle(s,"Revan Push")
    V65BDue(s,"Revan Pull",37000)
    V65BPump(s,37000)
    V65BDue(s,"Revan Push",52000)
    V65BPump(s,127000)
    V48Assert(s.Active.Count=1,"continuous polling keeps only the current push/pull forecast")
    V65BDue(s,"Revan Push",142000)
}

V65BuiltinStyrak()
{
    s := V65BState(),s.Boss := "Styrak"
    pull := V65BEv("Other","Kell Dragon {3067057620910080}:1","@Timer Tester#65","2995606544973824")
    V65BObserve(s,pull,2000)
    V65BDue(s,"Styrak Knockback",26000)
    V65BObserve(s,pull,3000)
    V65BDue(s,"Styrak Knockback",26000,"initial Knockback latch ignores later threat records")
    V65BPump(s,26000)
    V65BDue(s,"Styrak Knockback",86000)
    V65BObserve(s,V65BEv("Damage","@Timer Tester#65","Manifestation {3147154466013184}:9"),30000)
    V65BIdle(s,"Styrak Knockback","leaving Dragon cancels remaining Knockback repeats")
    s := V65BState(),s.Boss := "Styrak"
    V65BObserve(s,V65BEv("Activate","Clone {3294742427205632}:2","=","3294845506420736"),2000)
    V65BDue(s,"Styrak Knockback",62000,"fallback starts next60s cycle without unsafe future timestamp")
    s := V65BState("HM"),s.Boss := "Styrak"
    V65BObserve(s,pull,2000)
    V65BIdle(s,"Styrak Knockback","Knockback source rule remains NiM-only")
}

V65BuiltinQueenAndRuugar()
{
    s := V65BState("HM"),s.Boss := "MutatedGeonosianQueen"
    V65BObserve(s,V65BEv(),2000)
    V65BDue(s,"Queen Royal Summons - Guards",54500)
    V65BPump(s,54500)
    V65BDue(s,"Queen Royal Summons - Caustic",128500)
    V65BPump(s,128500)
    V65BDue(s,"Queen Royal Summons - Guards",176500)
    V65BPump(s,176500)
    V65BDue(s,"Queen Royal Summons - Caustic",250500)
    V65BPump(s,250500)
    V65BDue(s,"Queen Royal Summons - Guards",298500)
    V65BPump(s,298500)
    V48Assert(s.Active.Count=0,"Queen published sequence stops after Guards5")
    s := V65BState("HM"),s.Boss := "Coratanni"
    V65BObserve(s,V65BEv("Damage","Ruugar {3371441953177600}:1","@Timer Tester#65"),2000)
    V65BPump(s,202000)
    V65BIdle(s,"Ruugar Enrage","source Ruugar display threshold is strict greater-than200s")
    V65BPump(s,202001)
    V65BDue(s,"Ruugar Enrage",262000)
}

V65BuiltinDisabledAndSilent()
{
    s := V65BState()
    for d in s.Definitions {
        if d.Name="Tyth Inversion"
            d.Enabled := false
    }
    V65BObserve(s,V65BEv("Damage","TYTH {4078423634870272}:1","@Timer Tester#65"),2000)
    V65BIdle(s,"Tyth Inversion","per-timer disabled flag suppresses builtin entry forecast")
    s := V65BState()
    V65BObserve(s,V65BEv("Damage","TYTH {4078423634870272}:1","@Timer Tester#65"),2000,false)
    V48Assert(s.Boss="" && s.Active.Count=0 && s.Alerts.Length=0,"silent warm-up cannot recognize/start/flash built-ins")
    s := V65BState(),s.Boss := "Nahut"
    V65BObserve(s,V65BEv("Activate","NAHUT {4122949560827904}:1","=","4137075708264448"),2000)
    V65BIdle(s,"Nahut Slice","StarParse estimate cannot reintroduce rejected fixed Slice assignment")
    V65BObserve(s,V65BEv("Death"),3000)
    V48Assert(s.InCombat,"recorder death does not itself end timer combat context")
}

; v65 timer visuals: pure snapshots plus hidden native HWND rendering. No live
; timers, input, game focus changes, audio, imported files or production settings.
V65UITimerFixture()
{
    s := IRTNewState(),s.Enabled := true
    for i,name in ["Later cast","Move away","Invisible helper"] {
        d := IRTDefinition(name,"Test"),d.Enabled := true,d.Color := i=3 ? "" : "AA88E8"
        s.Definitions.Push(d)
        due := i=1 ? 15000 : 4000
        s.Active[d.Id] := {Key:d.Id,Def:d,Name:name,Start:0,Due:due,Interval:15000,
            Occurrence:1,Remaining:due,Warned:false}
    }
    s.Alerts := [{Name:"Move away",Color:"F1B847",At:500,Until:3500}]
    return s
}

V65UITimerIsolated(callback)
{
    global IRT,IRTPrefs,IPM,IIF,SETTINGS_FILE,Persist,IUB,testClock
    before := {IRT:IRT,Prefs:IRTPrefs,IPM:IPM,IIF:IIF,Settings:SETTINGS_FILE,Persist:Persist,IUB:IUB,Clock:testClock}
    path := A_Temp "\Iris_v65_timer_ui_" DllCall("GetCurrentProcessId") "_" A_TickCount ".ini"
    try {
        IRT := V65UITimerFixture(),IRTPrefs := IRTUNewState(),IUB := IUBNewState(),testClock := 1000
        IPM := IPMNewState(),IIF := IIFNewState()
        SETTINGS_FILE := path
        Persist := {Pending:Map(),Last:Map(),Busy:false,Serial:0,Error:"",Status:"test"}
        callback.Call(path)
    }
    finally {
        IRTUShutdown()
        IRT := before.IRT,IRTPrefs := before.Prefs,IPM := before.IPM,IIF := before.IIF,SETTINGS_FILE := before.Settings,
            Persist := before.Persist,IUB := before.IUB,testClock := before.Clock
        try FileDelete(path)
        for suffix in [".timers.xml",".timers.xml.bak"]
            try FileDelete(path suffix)
    }
}

V65TimerUIDefaults()
{
    p := IRTUNewState()
    V48Assert(p.Scale=100 && p.Lead=5,"plain default scale and five-second warning")
    V48Assert(p.ShowBars && p.ShowWarnings,"regular timer window and optional big warning are separate defaults")
    V48Assert(p.BarsX="" && p.AlertY="" && p.BarsGui="" && p.Manager="","no default windows or forced saved position")
    V48Assert(p.PreviewUntil<0 && p.Rows.Length=0,"preview is inactive and cannot start a timer")
    V48Assert(IRTUColor("bad")="F1B847" && IRTUColor("aabbcc")="AABBCC","invalid color falls back; XML colors normalize")
}

V65TimerUISnapshot()
{
    s := V65UITimerFixture(),p := IRTUNewState(),snap := IRTUSnapshot(s,1000,p)
    V48Assert(snap.Rows.Length=2 && snap.Rows[1].Name="Move away","soonest visible event sorts first; helper stays hidden")
    V48Assert(snap.Rows[1].Remaining=3000 && snap.Rows[1].Urgent && !snap.Rows[2].Urgent,"countdowns and urgent state use deadlines")
    snap.Rows[1].Name := "local mutation"
    V48Assert(s.Active[s.Definitions[2].Id].Name="Move away","display snapshot does not alias active timer")
    s.Definitions[1].Supported := false
    V48Assert(IRTUSnapshot(s,1000,p).Rows.Length=1,"unsupported rule cannot appear as active")
    s.Definitions[2].Enabled := false
    V48Assert(IRTUSnapshot(s,1000,p).Rows.Length=0,"disabled rules disappear without waiting for expiry")
    s.Enabled := false
    V48Assert(IRTUSnapshot(s,1000,p).Alert="","master-off suppresses warnings")
}

V65TimerUIWarningExpiry()
{
    s := V65UITimerFixture(),p := IRTUNewState()
    s.Alerts.Push({Name:"Second",Color:"EF7373",At:750,Until:3000},
        {Name:"Second",Color:"EF7373",At:900,Until:3000},
        {Name:"Future",Color:"EF7373",At:9000,Until:12000})
    snap := IRTUSnapshot(s,1000,p)
    V48Assert(snap.Alert="Second`nMove away","duplicate legacy labels collapse while future records stay hidden")
    V48Assert(IRTUSnapshot(s,3500,p).Alert="","expired warnings do not replay after a pause")
    V48Assert(IRTUSnapshot(s,16000,p).Rows.Length=0,"expired timers do not leave frozen bars")
}

V65TimerUIBoundedRows()
{
    s := IRTNewState(),s.Enabled := true,p := IRTUNewState()
    Loop 16 {
        d := IRTDefinition("Timer " A_Index),d.Enabled := true,d.Color := "ABCDEF"
        s.Active[d.Id] := {Key:d.Id,Def:d,Name:d.Name,Start:0,Due:1000+A_Index*1000,Interval:20000,
            Occurrence:1,Remaining:0,Warned:false}
    }
    snap := IRTUSnapshot(s,1000,p)
    V48Assert(snap.Rows.Length=12 && snap.More=4,"display work is bounded while timer model retains all events")
    V48Assert(s.Active.Count=16 && snap.Rows[1].Name="Timer 1","bounded display does not discard timers or urgent priority")
}

V65TimerUIPreviewIsolation()
{
    s := V65UITimerFixture(),p := IRTUNewState(),s.Enabled := false
    p.PreviewStart := 1000,p.PreviewUntil := 16000
    initialCount := s.Active.Count,initialName := s.Alerts[1].Name
    snap := IRTUSnapshot(s,2000,p)
    V48Assert(snap.Preview && snap.Rows.Length=2 && snap.Alert="Move away","fake preview works with live timer master off")
    V48Assert(snap.Rows[1].Remaining=14000 && IRTUSnapshot(s,12000,p).Rows[1].Urgent,"preview animates from its own clock")
    V48Assert(IRTUSnapshot(s,16000,p).Rows.Length=0,"preview expires and does not enable real timers")
    V48Assert(!s.Enabled && s.Active.Count=initialCount && s.Alerts[1].Name=initialName,"preview leaves all real timer data unchanged")
}

V65TimerUILayout()
{
    s := V65UITimerFixture(),p := IRTUNewState(),snap := IRTUSnapshot(s,1000,p)
    mon := {L:-1920,T:-200,R:0,B:880,All:[{L:-1920,T:-200,R:0,B:880}]}
    p.BarsX := -1800,p.BarsY := 0,p.AlertX := -1900,p.AlertY := -150
    l := IRTULayout(p,snap,mon)
    V48Assert(l.X=-1800 && l.AX=-1900,"negative monitor positions are preserved without double DPI scaling")
    V48Assert(l.Rows[1].H>l.Rows[2].H,"urgent bar grows larger than ordinary bar")
    V48Assert(l.X+l.W<=mon.R && l.AX+l.AW<=mon.R,"overlay geometry fits monitor width")
    p.Scale := 200,p.BarsX := 90000,p.BarsY := 90000
    big := IRTULayout(p,snap,mon)
    V48Assert(big.W>=l.W && big.X+big.W<=mon.R && big.Y+big.H<=mon.B,"large display is clamped onto reachable monitor")
}

V65TimerUIHiddenRender()
{
    V65UITimerIsolated(V65TimerUIHiddenRenderCase)
}

V65TimerUIHiddenRenderCase(path)
{
    global IRT,IRTPrefs,Audio
    activeBefore := WinExist("A"),queueBefore := Audio.Queue.Length
    snap := IRTURender(IRT,1000),p := IRTPrefs
    V48Assert(p.LastError="" && IPMGuiAlive(p.BarsGui) && IPMGuiAlive(p.AlertGui),"actual native timer windows construct without errors")
    V48Assert(p.Rows[1].Name.Text="Move away" && p.Rows[1].Time.Text="3.0","native controls display ordered timer and countdown")
    V48Assert(p.AlertText.Text="Move away","native center warning contains concise ability name")
    for g in [p.BarsGui,p.AlertGui] {
        style := DllCall("User32\GetWindowLongW","Ptr",g.Hwnd,"Int",-20,"UInt")
        V48Assert((style & 0x08000020)=0x08000020,"timer window cannot activate or intercept game clicks")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"SELF_TEST always leaves native window hidden")
    }
    V48Assert(!p.BarsShown && !p.AlertShown && WinExist("A")=activeBefore,"hidden rendering does not alter foreground focus")
    IRTUPulseWarning(p.AlertGui,1000)
    colorKey := 0,alpha := 0,flags := 0
    gotLayer := DllCall("User32\GetLayeredWindowAttributes","Ptr",p.AlertGui.Hwnd,"UInt*",&colorKey,"UChar*",&alpha,"UInt*",&flags,"Int")
    V48Assert(gotLayer && (flags & 3)=3 && colorKey=0x010101,"native warning pulse preserves transparent background and alpha together")
    V48Assert(Audio.Queue.Length=queueBefore && !FileExist(path),"drawing submits no audio and writes no settings")
    IRTURender(IRT,4000)
    V48Assert(p.Rows[1].Time.Text="0.0" && p.AlertText.Text="","native warning expires while a due bar reaches zero")
}

V65TimerUIWindowRecovery()
{
    V65UITimerIsolated(V65TimerUIWindowRecoveryCase)
}

V65TimerUIWindowRecoveryCase(path)
{
    global IRT,IRTPrefs
    IRTURender(IRT,1000),old := IRTPrefs.BarsGui,old.Destroy()
    IRTURender(IRT,1100)
    V48Assert(IRTPrefs.LastError="" && IPMGuiAlive(IRTPrefs.BarsGui),"externally destroyed bar window is recreated safely")
    V48Assert(IRTPrefs.Rows[1].Name.Text="Move away" && IRTPrefs.Rows[1].Time.Text="2.9","recreated controls receive fresh content")
    IRTUReset()
    V48Assert(IRTPrefs.AlertText.Text="" && IRTPrefs.Rows[1].Name.Text="","reset clears stale visible warning content")
    V48Assert(IRT.Active.Count=3 && IRT.Enabled,"visual reset never resets the timer engine")
    IRTUShutdown(),IRTUShutdown()
    V48Assert(IRTPrefs.BarsGui="" && IRTPrefs.AlertGui="" && IRTPrefs.Rows.Length=0,"owned cleanup is idempotent")
}

V65TimerUIPreferenceIsolation()
{
    V65UITimerIsolated(V65TimerUIPreferenceIsolationCase)
}

V65TimerUIPreferenceIsolationCase(path)
{
    global IRTPrefs
    IniWrite("keep-me",path,"Unrelated","Value"),IniWrite("0",path,"Audio","Enabled")
    p := IRTPrefs,p.Scale := 135,p.Lead := 7,p.BarsX := -1500,p.BarsY := 30
    IRTUSavePrefs(p)
    V48Assert(IniRead(path,"IrisTimers","Scale")=135 && IniRead(path,"IrisTimers","LeadSeconds")=7,"timer visual preferences roundtrip through existing settings API")
    V48Assert(IniRead(path,"IrisTimers","BarsX")=-1500 && IniRead(path,"IrisTimers","AlertX","missing")="","signed and automatic positions persist")
    V48Assert(IniRead(path,"IrisTimers","ShowBars")=1 && IniRead(path,"IrisTimers","ShowWarnings")=1,"independent regular-window and warning choices persist")
    V48Assert(IniRead(path,"Unrelated","Value")="keep-me" && IniRead(path,"Audio","Enabled")="0","saving visuals preserves unrelated settings and mute")
}

V65TimerUIHiddenManager()
{
    V65UITimerIsolated(V65TimerUIHiddenManagerCase)
}

V65TimerUIHiddenManagerCase(path)
{
    global IRTPrefs,IRT
    d := IRT.Definitions[2],d.Supported := false,d.Reason := "This trigger is not supported."
    g := IRTShowManager()
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"manual manager creation remains hidden in diagnostics")
    V48Assert(IRTPrefs.List.GetCount()=3 && IRTPrefs.Ids.Length=3,"manager shows visible timers and invisible helpers")
    IRTPrefs.List.Modify(2,"Select Focus"),IRTUSelection()
    V48Assert(InStr(IRTPrefs.Detail.Value,"not supported"),"selected unavailable timer explains why")
    V48Assert(!IRTUToggleSelected(true) && !FileExist(path),"unsupported rule cannot be enabled or written by UI")
    V48Assert(IRTPrefs.Controls.Count=6 && IRTPrefs.Replace.Value=0,"display controls exist and imports preserve duplicates by default")
    IRTUCloseManager()
    V48Assert(IRT.Active.Count=3 && IRT.Enabled,"closing manager leaves live model unchanged")
}

V65TimerUIOptionValidation()
{
    V65UITimerIsolated(V65TimerUIOptionValidationCase)
}

V65TimerUIOptionValidationCase(path)
{
    global IRTPrefs,IRT
    IRTShowManager(),p := IRTPrefs
    p.Controls["Scale"].Value := "250"
    V48Assert(!IRTUApplyOptions() && !FileExist(path) && p.Scale=100,"invalid scale is rejected before model or disk changes")
    p.Controls["Scale"].Value := "120",p.Controls["Lead"].Value := "8",p.Controls["BarsX"].Value := "not a position"
    V48Assert(!IRTUApplyOptions() && p.Scale=100,"invalid position cannot partially apply other options")
    p.Controls["BarsX"].Value := "-1400",p.Controls["BarsY"].Value := "50"
    V48Assert(IRTUApplyOptions() && p.Scale=120 && IRT.LeadMs=8000,"valid options update display and pure engine lead time")
    V48Assert(IniRead(path,"IrisTimers","BarsX")=-1400,"native edit accepts a negative monitor coordinate")
}

V65TimerUIImportReport()
{
    text := IRTUReport({Added:2,Conflicts:["Move away"],Issues:["One trigger is unsupported."],Committed:true})
    V48Assert(InStr(text,"Added 2 timers") && InStr(text,"Kept existing") && InStr(text,"Move away"),"import report clearly distinguishes additions and preserved conflicts")
    V48Assert(InStr(text,"unsupported") && InStr(text,"Timer audio"),"unsupported trigger and audio setup remain explicit")
    review := IRTUReport({Added:2,Conflicts:["Move away"],Issues:[],Committed:false})
    V48Assert(InStr(review,"Nothing imported yet") && !InStr(review,"Added 2") && InStr(review,"import the file again"),"conflict review never claims uncommitted timers were saved")
}

V65TimerUIIndependentViews()
{
    V65UITimerIsolated(V65TimerUIIndependentViewsCase)
}

V65TimerUIIndependentViewsCase(path)
{
    global IRT,IRTPrefs
    IRTShowManager(),p := IRTPrefs,count := IRT.Active.Count
    p.WarningBox.Value := 0,IRTUToggleDisplay("ShowWarnings",p.WarningBox)
    V48Assert(!p.ShowWarnings && p.ShowBars && IRT.Active.Count=count,"big warnings can be disabled while timer window and engine remain active")
    V48Assert(IniRead(path,"IrisTimers","ShowWarnings")=0,"warning choice is independently saved")
    p.BarBox.Value := 0,IRTUToggleDisplay("ShowBars",p.BarBox)
    V48Assert(!p.ShowBars && !p.ShowWarnings && IRT.Enabled,"hiding both views does not erase or disable configured timers")
    IRTUOpenTimers()
    V48Assert(p.ShowBars && !p.ShowWarnings && IRT.Active.Count=count,"Interface Timers opens regular view without enabling big warnings or resetting running timers")
    IRT.Active.Clear(),IRT.Alerts := [],IRTURender(IRT,1000)
    V48Assert(IPMGuiAlive(p.BarsGui) && p.Header.Text="Encounter timers" && p.Empty.Text="Waiting for timers","regular timer view keeps a header and waiting state between pulls")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.BarsGui.Hwnd,"Int"),"regular waiting view stays hidden in native diagnostics")
}

; Pure timer-continuity regressions. No shared encounter state or file IO.
V65CState()
{
    s := IRTNewState(),s.Enabled := true,s.Self := "@Timer Tester#65"
    s.InCombat := true,s.CombatStart := 1000,s.AreaId := "833571547775765",s.ModeId := "836045448953655"
    s.Continuity := IRTCNew()
    return s
}

V65CEv(kind := "Damage",npc := "4078423634870272",instance := "10",hp := "800/1000",target := "")
{
    boss := "Boss {" npc "}:" instance "|(0,0,0,0)|(" hp ")"
    return V65BEv(kind,boss,target="" ? "@Timer Tester#65" : target)
}

V65CDeath(s,at := 2000)
{
    ev := V65BEv("Death","@Timer Tester#65","=")
    return IRTCObserve(s,ev,at)
}

V65ContinuityNewInstance()
{
    s := V65CState()
    IRTCObserve(s,V65CEv(),1100)
    V48Assert(!IsObject(V65CDeath(s)),"recorder death does not end the raid or reset timers")
    V48Assert(s.InCombat && s.CombatStart=1000,"death preserves active encounter anchor")
    IRTCObserve(s,V65CEv("Other","4078423634870272","20","1000/1000"),3000)
    V48Assert(s.Continuity.Segment.Enemies.Count=1,"pre-entry respawn snapshot cannot overwrite the injured baseline")
    IRTCObserve(s,V65BEv("Enter"),4000)
    answer := IRTCObserve(s,V65CEv("Damage","4078423634870272","20","990/1000"),4100)
    V48Assert(IsObject(answer) && answer.At=4000 && answer.Event.Kind="Enter","new instance of an observed boss phase confirms new pull at original entry")
    V48Assert(!IsObject(IRTCObserve(s,V65CEv("Damage","4078423634870272","20","980/1000"),4200)),"confirmed entry returned only once")
    s := V65CState()
    IRTCObserve(s,V65CEv(),1100)
    death := V65BEv("Death","@Timer Tester#65","Boss {4078423634870272}:10|(0,0,0,0)|(0/1000)")
    V48Assert(!IsObject(IRTCObserve(s,death,2000)),"boss death alone does not reset a multiphase encounter")
    IRTCObserve(s,V65CEv("Other","4078423634870272","20","1000/1000"),3000)
    V48Assert(s.Continuity.Segment.Enemies.Count=1,"post-kill reset actor before Enter cannot replace the baseline")
    IRTCObserve(s,V65BEv("Enter"),4000)
    answer := IRTCObserve(s,V65CEv("Damage","4078423634870272","20","990/1000"),4100)
    V48Assert(IsObject(answer) && answer.At=4000,"a new pull after a kill is recognized without recorder death or Exit")
}

V65ContinuityBattleRez()
{
    s := V65CState()
    IRTCObserve(s,V65CEv(),1100),V65CDeath(s)
    IRTCObserve(s,V65BEv("Enter"),3000)
    result := IRTCObserve(s,V65CEv("Damage","4078423634870272","10","650/1000"),3100)
    V48Assert(!IsObject(result),"same living injured boss preserves a combat resurrection")
    V48Assert(!s.Continuity.DiedSinceEntry && !IsObject(s.Continuity.Pending),"continued fight clears pending entry")
    V48Assert(s.CombatStart=1000,"combat resurrection cannot restart encounter timers")
}

V65ContinuitySameInstanceReset()
{
    s := V65CState()
    IRTCObserve(s,V65CEv(),1100),V65CDeath(s)
    IRTCObserve(s,V65BEv("Enter"),3000)
    result := IRTCObserve(s,V65CEv("Other","4078423634870272","10","1000/1000"),3100)
    V48Assert(IsObject(result) && result.At=3000,"injured to full HP on the same instance confirms reset")
}

V65ContinuityAmbiguousAndAdds()
{
    s := V65CState()
    IRTCObserve(s,V65CEv(),1100),V65CDeath(s)
    IRTCObserve(s,V65BEv("Enter"),3000)
    V48Assert(!IsObject(IRTCObserve(s,V65CEv("Other","4078423634870272","10","1000/1000"),2950)),"older full HP metadata cannot decide a later pending entry")
    V48Assert(IsObject(s.Continuity.Pending),"reordered pre-entry snapshot retains uncertainty")
    V48Assert(!IsObject(IRTCObserve(s,V65CEv("Damage","4078449404674048","99","400/500"),3100)),"fresh ordinary add does not confirm a reset")
    ev := V65CEv("Other"),ev.DeleteProp("SourceHP"),ev.DeleteProp("TargetHP")
    V48Assert(!IsObject(IRTCObserve(s,ev,3200)),"missing boss HP leaves the reentry uncertain")
    V48Assert(IsObject(s.Continuity.Pending),"uncertain evidence keeps pending entry")
    V48Assert(!IsObject(IRTCObserve(s,V65CEv("Other","4078423634870272","10","0/1000"),3300)),"zero HP alone does not prove a living continuation")
}

V65ContinuityPhaseAndRepeat()
{
    s := V65CState(),s.AreaId := "137438993037",s.ModeId := "836045448953652"
    IRTCObserve(s,V65CEv("Damage","3067057620910080","10","800/1000"),1100),V65CDeath(s)
    IRTCObserve(s,V65BEv("Enter"),3000)
    V48Assert(!IsObject(IRTCObserve(s,V65CEv("Damage","3152407211016192","20","1000/1000"),3100)),"new Styrak phase group is still the same encounter")
    V48Assert(!IsObject(s.Continuity.Pending),"new phase supplies continuity evidence")
    IRTCObserve(s,V65CEv("Damage","3147154466013184","30","800/1000"),3200),V65CDeath(s,4000)
    IRTCObserve(s,V65BEv("Enter"),5000)
    V48Assert(!IsObject(IRTCObserve(s,V65CEv("Damage","3147154466013184","40","1000/1000"),5100)),"profile repeat groups cannot falsely start a new encounter")
}

V65ContinuityDuplicateAndRemote()
{
    s := V65CState()
    IRTCObserve(s,V65CEv(),1100)
    IRTCObserve(s,V65BEv("Death","@Someone Else#77","="),2000)
    IRTCObserve(s,V65BEv("Enter"),3000)
    V48Assert(!s.Continuity.DiedSinceEntry && IsObject(s.Continuity.Pending),"later Enter waits for boss evidence even when recorder did not die")
    result := IRTCObserve(s,V65CEv("Damage","4078423634870272","10","700/1000"),3100)
    V48Assert(!IsObject(result) && !IsObject(s.Continuity.Pending),"later duplicate Enter with the same injured boss preserves the current pull")
    V65CDeath(s,4000)
    IRTCObserve(s,V65BEv("Enter"),1000)
    V48Assert(!IsObject(s.Continuity.Pending),"old duplicate Enter cannot supersede current pull")
    IRTCObserve(s,V65BEv("Enter"),5000)
    IRTCObserve(s,V65BEv("Enter"),5100)
    V48Assert(s.Continuity.Pending.At=5000,"pending entry retains its first actual anchor")
}

V65ContinuityNahutAfterTrash()
{
    s := V65CState()
    slice := IRTDefinition("Energy Slice"),slice.Enabled := true,slice.Interval := 12500
    slice.Scope := "COMBAT",slice.Trigger := IRTCondition("ABILITY_ACTIVATED")
    slice.Trigger.Ability := "Energized Slice",slice.Trigger.Boss := "Nahut"
    opener := IRTDefinition("Nahut entry timer"),opener.Enabled := true,opener.Interval := 15000
    opener.Scope := "COMBAT",opener.Trigger := IRTCondition("COMBAT_START"),opener.Trigger.Boss := "Nahut"
    IRTConfigure(s,[slice,opener])
    IRTObserve(s,V65BEv("Enter"),1000)
    trash := "Trash {4118122017587200}:1|(0,0,0,0)|(900/1000)"
    IRTObserve(s,V65BEv("Damage","@Timer Tester#65",trash),1100)
    IRTObserve(s,V65BEv("Enter"),2500) ; the previous trash Exit was omitted by the game
    nahut := "Nahut {4122949560827904}:214|(0,0,0,0)|(10000/10000)"
    IRTObserve(s,V65BEv("Other","@Timer Tester#65",nahut,"","836045448953668"),2600)
    V48Assert(s.Boss="" && s.Continuity.Pending.At=2500,"selecting Nahut cannot start timers from trash")
    hit := V65BEv("Damage","@Timer Tester#65",nahut),hit.FullAbsorb := true,hit.Effective := 0
    IRTObserve(s,hit,2700)
    V48Assert(s.Boss="Nahut" && s.CombatStart=2500,"the shielded hit opens a fresh Nahut pull after a missing trash exit")
    V65BDue(s,"Nahut entry timer",17500,"a boss start timer uses Nahut's entry rather than the prior trash entry")
    cast := V65BEv("Activate",nahut),cast.Ability := "Energized Slice"
    IRTObserve(s,cast,3100)
    V65BDue(s,"Energy Slice",15600,"the first Slice starts its actual encounter timer")

    IRTObserve(s,V65BEv("Death","","@Timer Tester#65"),3700)
    IRTObserve(s,V65BEv("Enter"),5000)
    newNahut := StrReplace(nahut,":214|",":215|")
    hit := V65BEv("Damage","@Timer Tester#65",newNahut),hit.FullAbsorb := true,hit.Effective := 0
    IRTObserve(s,hit,5100)
    V48Assert(s.Boss="Nahut" && s.CombatStart=5000,"a new shielded boss instance starts another pull after a missing wipe exit")
    V65BIdle(s,"Energy Slice","the earlier attempt's Slice timer is cleared once the wipe reset is proved")
    V65BDue(s,"Nahut entry timer",20000)
}

V65ContinuityTerrorReset()
{
    s := V65CState(),s.AreaId := "137438992720"
    IRTCObserve(s,V65CEv("Damage","3025220344479744","10","800/1000"),1100)
    V65CDeath(s)
    IRTCObserve(s,V65BEv("Enter"),3000)
    answer := IRTCObserve(s,V65CEv("Other","3025220344479744","20","1000/1000"),3100)
    V48Assert(IsObject(answer) && answer.At=3000,"timer evidence supports the shared Terror reset check")
}

; Hidden native timer layout tests. Never toggle SELF_TEST or synthesize mouse
; input; capture and timer registration remain blocked by the real harness guard.
V651TimerEditFixture()
{
    s := IRTNewState(),s.Enabled := true
    d := IRTDefinition("Upcoming cast","Test"),d.Enabled := true,d.Color := "AA88E8",d.Interval := 10000
    s.Definitions := [d]
    s.Active[d.Id] := {Key:d.Id,Def:d,Name:d.Name,Start:0,Due:10000,Interval:10000,
        Occurrence:1,Remaining:10000,Warned:false,Event:""}
    return s
}

V651TimerEditIsolated(callback)
{
    global IRT,IRTPrefs,IPM,IP,IIF,IUB,SETTINGS_FILE,Persist,testClock
    saved := {IRT:IRT,Prefs:IRTPrefs,IPM:IPM,IP:IP,IIF:IIF,IUB:IUB,Settings:SETTINGS_FILE,Persist:Persist,Clock:testClock}
    path := A_Temp "\Iris_v651_timer_edit_" DllCall("GetCurrentProcessId") "_" A_TickCount ".ini"
    try {
        IRT := V651TimerEditFixture(),IRTPrefs := IRTUNewState(),IPM := IPMNewState(),IP := IPNewApp()
        IIF := IIFNewState(),IUB := IUBNewState(),testClock := 1000,SETTINGS_FILE := path
        Persist := {Pending:Map(),Last:Map(),Busy:false,Serial:0,Error:"",Status:"test"}
        IRTPrefs.BarsX := 100,IRTPrefs.BarsY := 100
        callback.Call(path)
    }
    finally {
        IRTUShutdown(),IPMDestroyPanels()
        IRT := saved.IRT,IRTPrefs := saved.Prefs,IPM := saved.IPM,IP := saved.IP,IIF := saved.IIF,
            IUB := saved.IUB,SETTINGS_FILE := saved.Settings,Persist := saved.Persist,testClock := saved.Clock
        try FileDelete(path)
    }
}

V651TimerEditAvailability()
{
    p := IRTUNewState(),s := IRTNewState()
    V48Assert(!IRTUEditAvailable(p,s),"unconfigured timers do not expose edit controls")
    s.Enabled := true
    V48Assert(IRTUEditAvailable(p,s),"enabled timer window can use shared Unlock")
    p.ShowBars := false
    V48Assert(!IRTUEditAvailable(p,s),"big warnings alone do not expose timer-window dragging")
    p.ShowBars := true,s.Enabled := false,p.PreviewUntil := ClockMs()+15000
    V48Assert(IRTUEditAvailable(p,s),"explicit timer preview remains positionable with live master off")
    p.PreviewUntil := ClockMs()-1
    V48Assert(!IRTUEditAvailable(p,s),"expired preview does not leave an editing target")
}

V651TimerEditNativeStyles()
{
    V651TimerEditIsolated(V651TimerEditNativeStylesCase)
}

V651TimerEditNativeStylesCase(path)
{
    global IRT,IRTPrefs,IPM
    IRTURender(IRT,1000),p := IRTPrefs
    IPM.Editing := true,IRTUSyncEditMode()
    style := DllCall("User32\GetWindowLongW","Ptr",p.BarsGui.Hwnd,"Int",-20,"UInt")
    V48Assert((style & 0x08000000)!=0 && (style & 0x20)=0,"unlocked native timer window accepts mouse input without activation")
    key := 0,alpha := 0,flags := 0
    DllCall("User32\GetLayeredWindowAttributes","Ptr",p.BarsGui.Hwnd,"UInt*",&key,"UChar*",&alpha,"UInt*",&flags,"Int")
    V48Assert((flags & 1)=0 && alpha=IPM.Opacity,"edit rectangle previews saved opacity without color-key holes")
    V48Assert(!p.DragHooks && !DllCall("User32\IsWindowVisible","Ptr",p.BarsGui.Hwnd,"Int"),"native style checks stay hidden with no registered input callbacks")
    IPM.Editing := false,IRTUSyncEditMode()
    style := DllCall("User32\GetWindowLongW","Ptr",p.BarsGui.Hwnd,"Int",-20,"UInt")
    V48Assert((style & 0x08000020)=0x08000020,"Lock restores no-activate and full click-through")
    DllCall("User32\GetLayeredWindowAttributes","Ptr",p.BarsGui.Hwnd,"UInt*",&key,"UChar*",&alpha,"UInt*",&flags,"Int")
    V48Assert((flags & 1)=0 && alpha=IPM.Opacity,"locked timer shares the other overlays' opacity without color-key holes")
}

V651TimerEditOwnership()
{
    V651TimerEditIsolated(V651TimerEditOwnershipCase)
}

V651TimerEditOwnershipCase(path)
{
    global IRT,IRTPrefs,IPM
    IPM.Editing := true,IRTURender(IRT,1000),p := IRTPrefs
    V48Assert(IRTUEditTarget(p,p.BarsGui.Hwnd) && IRTUEditTarget(p,p.Header.Hwnd),"timer body and actual native header HWND route to same owned edit window")
    V48Assert(!IRTUEditTarget(p,p.AlertGui.Hwnd) && !IRTUEditTarget(p,0),"warning and absent windows cannot act as timer drag targets")
    oldHeader := p.Header.Hwnd,p.BarsGui.Destroy()
    V48Assert(!IRTUEditTarget(p,oldHeader),"destroyed timer controls lose edit ownership")
    IRTURender(IRT,1100)
    style := DllCall("User32\GetWindowLongW","Ptr",p.BarsGui.Hwnd,"Int",-20,"UInt")
    V48Assert((style & 0x20)=0 && p.Editing,"recreated window receives edit style even when editing mode did not change")
    p.Editing := false
    V48Assert(!IRTUEditTarget(p,p.Header.Hwnd),"locked header cannot initiate a drag")
}

V651TimerEditGeometry()
{
    p := IRTUNewState()
    d := {X:-1500,Y:-100,W:495,H:180,MouseX:-1430,MouseY:-70,Scale:1.5,Edge:"",
        MinW:270,MaxW:1800,MinH:120,MaxH:1600}
    point := IPMDragPoint(d,-1230,80),point.W := d.W,point.H := d.H
    geo := IRTUDragCommitPoint(p,d,point)
    V48Assert(geo.X=-1300 && geo.Y=50 && geo.Width=330 && geo.Height=0,"drag preserves signed-screen grab offset and automatic timer height")
    d.Edge := "R",pos := IPMResizePoint(d,-1230,-70),geo := IRTUDragGeometry(p,d,pos)
    V48Assert(geo.Width=463 && geo.Height=0,"horizontal resize converts pixels once and preserves automatic height")
    d.Edge := "B",pos := IPMResizePoint(d,-1430,80),geo := IRTUDragGeometry(p,d,pos)
    V48Assert(geo.Height=220 && geo.Width=330,"vertical resize saves base-unit minimum height without changing width")
    d.Edge := "LT",pos := IPMResizePoint(d,-1200,200),geo := IRTUDragGeometry(p,d,pos)
    V48Assert(pos.X+pos.W=d.X+d.W && pos.Y+pos.H=d.Y+d.H,"left/top resize keeps opposite corner anchored")
    V48Assert(geo.Width>=180 && geo.Height>=0 && p.GeometryDirty,"geometry limits are enforced and actual move marks persistence pending")
}

V651TimerEditNoTickSnap()
{
    V651TimerEditIsolated(V651TimerEditNoTickSnapCase)
}

V651TimerEditNoTickSnapCase(path)
{
    global IRT,IRTPrefs,IPM
    IPM.Editing := true,IRTURender(IRT,1000),p := IRTPrefs
    DllCall("User32\SetWindowPos","Ptr",p.BarsGui.Hwnd,"Ptr",0,"Int",235,"Int",215,
        "Int",550,"Int",200,"UInt",0x14,"Int")
    p.Drag := {Hwnd:p.BarsGui.Hwnd,Gui:p.BarsGui,Busy:false}
    IRTURender(IRT,1200)
    p.BarsGui.GetPos(&x,&y,&w,&h)
    V48Assert(x=235 && y=215 && w=550 && h=200,"100ms display update cannot undo an in-progress native move/resize")
    IRTPump(IRT,2000)
    V48Assert(IRT.Active[IRT.Definitions[1].Id].Remaining=8000,"timer engine continues while layout movement is held")
    IRTUDragStop()
    V48Assert(!IsObject(p.Drag),"release clears drag state without requiring any synthetic input")
}

V651TimerEditSaveIsolation()
{
    V651TimerEditIsolated(V651TimerEditSaveIsolationCase)
}

V651TimerEditSaveIsolationCase(path)
{
    global IRTPrefs
    p := IRTPrefs
    IniWrite(75,path,"IrisTimers","Scale"),IniWrite(0,path,"IrisTimers","ShowWarnings")
    IniWrite("keep",path,"Unrelated","Value")
    g := Gui("+ToolWindow"),p.Manager := g
    p.Controls["BarsX"] := g.AddEdit("x0 y0 w80 h22","100")
    p.Controls["BarsY"] := g.AddEdit("x90 y0 w80 h22","100")
    p.BarsX := -1250,p.BarsY := 220,p.BarsWidth := 410,p.BarsHeight := 185,p.Scale := 150,p.GeometryDirty := true
    V48Assert(IRTUSaveGeometry(p),"completed drag schedules its geometry save")
    V48Assert(IniRead(path,"IrisTimers","BarsX")=-1250 && IniRead(path,"IrisTimers","BarsWidth")=410
        && IniRead(path,"IrisTimers","BarsHeight")=185,"position and independent dimensions persist")
    V48Assert(IniRead(path,"IrisTimers","Scale")=75 && IniRead(path,"IrisTimers","ShowWarnings")=0
        && IniRead(path,"Unrelated","Value")="keep","drag save does not commit unrelated or unsaved options")
    V48Assert(p.Controls["BarsX"].Value="-1250" && p.Controls["BarsY"].Value="220","manager edits refresh so Apply cannot revert moved coordinates")
    V48Assert(!IRTUSaveGeometry(p),"unchanged layout produces no repeated persistence work")
}

V651TimerEditSharedButtons()
{
    V651TimerEditIsolated(V651TimerEditSharedButtonsCase)
}

V651TimerEditSharedButtonsCase(path)
{
    global IRT,IRTPrefs,IPM,IP,SELF_TEST
    IPM.Mode := 2,IPM.Enabled := false
    for key in IPM.Shown
        IPM.Shown[key] := false
    V48Assert(!IPMAnyEnabled() && IIFSnapshot(IPM).Count=0,"fixture contains only the independent timer view")
    captured := DllCall("User32\GetCapture","Ptr")
    IPMEdit()
    p := IRTPrefs
    V48Assert(IPM.Editing && p.Editing && IPMGuiAlive(p.BarsGui),"actual Displays Unlock button opens timer editing with no ordinary meters enabled")
    d := {X:100,Y:100,W:p.Width,H:p.Height,Scale:p.Layout.Scale,Edge:""}
    IRTUDragCommitPoint(p,d,{X:210,Y:180,W:p.Width,H:p.Height})
    IPMLock()
    V48Assert(!IPM.Editing && !p.Editing && IniRead(path,"IrisTimers","BarsX")=210,"actual Lock/save button commits moved timer position and ends editing")
    V48Assert(IIFToggleLock() && IPM.Editing && p.Editing,"Interface Lock control also unlocks a timer-only layout")
    V48Assert(IIFToggleLock() && !IPM.Editing && !p.Editing,"Interface Lock control toggles back normally")
    IPMEdit(),p.ShowBars := false,IRTUSyncEditMode()
    V48Assert(IIFToggleLock() && !IPM.Editing,"Lock remains reachable if last timer view is hidden while global layout is unlocked")
    V48Assert(SELF_TEST && !p.DragHooks && DllCall("User32\GetCapture","Ptr")=captured,"native integration leaves harness isolation, capture and hook state unchanged")
    V48Assert(!IP.Active && !IP.Timer && IRT.Active.Count=1,"layout controls do not restart parsing or mutate running timer deadlines")
}

V651TimerEditCleanupGuards()
{
    V651TimerEditIsolated(V651TimerEditCleanupGuardsCase)
}

V651TimerEditCleanupGuardsCase(path)
{
    global IRTPrefs,IRT,IPM
    IPM.Editing := true,IRTURender(IRT,1000),p := IRTPrefs
    p.Drag := {Hwnd:p.BarsGui.Hwnd,Gui:p.BarsGui,Busy:false}
    captured := DllCall("User32\GetCapture","Ptr")
    IRTUDragMessage(1,0,0x0201,p.Header.Hwnd)
    V48Assert(DllCall("User32\GetCapture","Ptr")=captured,"SELF_TEST message path never takes mouse capture")
    p.ShowBars := false,IRTUSyncEditMode()
    V48Assert(!p.Editing && !IsObject(p.Drag) && !p.DragHooks,"hiding timer window cancels editing and held drag")
    IRTUEditShutdown(),IRTUEditShutdown()
    V48Assert(!p.Editing && !p.DragHooks,"editing shutdown is idempotent")
    V48Assert(IRT.Active.Count=1,"cleanup preserves independent timer model")
}

; Selected-timer previews use private values and the existing hidden native
; renderer. No live app, physical mouse input, audio, or production INIs.
V651TimerPreviewSelection()
{
    V48Assert(!IRTUSelectedPreview("",1000,5).Ok,"no selection gives a friendly prompt")
    d := IRTDefinition("Private selection"),d.Color := "aabbcc",d.Interval := 12000
    result := IRTUSelectedPreview(d,1000,5),v := result.Preview
    V48Assert(result.Ok && !d.Enabled,"a disabled rule can preview without being enabled")
    V48Assert(v.Name=d.Name && v.Color="AABBCC" && v.Due=13000,"preview keeps selected name, color, and full duration")
    d.Name := "Changed source",d.Interval := 1000,d.Color := "FFFFFF"
    V48Assert(v.Name="Private selection" && v.Interval=12000 && v.Color="AABBCC","preview copies values instead of retaining the rule")
    d.Supported := false,d.Reason := "Needs a raid message."
    result := IRTUSelectedPreview(d,1000,5)
    V48Assert(!result.Ok && InStr(result.Reason,"Needs a raid message."),"unavailable rule explains why it cannot be previewed")
    d.Supported := true,d.Color := "",d.Audio := "",d.CountdownVoice := ""
    result := IRTUSelectedPreview(d,1000,5)
    V48Assert(!result.Ok && InStr(result.Reason,"hidden helper"),"invisible helper does not masquerade as a visible timer")
}

V651TimerPreviewCountdown()
{
    d := IRTDefinition("Move away"),d.Color := "EF7373",d.Interval := 12000
    p := IRTUNewState(),p.SelectedPreview := IRTUSelectedPreview(d,1000,5).Preview
    snap := IRTUPreviewSnapshot(p,1000)
    V48Assert(snap.Preview && snap.Rows.Length=1 && snap.Rows[1].Remaining=12000,"selected preview starts at its real first interval")
    V48Assert(snap.Alert="Move away" && snap.AlertColor="EF7373","initial warning uses selected timer name and color")
    V48Assert(IRTUPreviewSnapshot(p,3199).Alert="Move away" && IRTUPreviewSnapshot(p,3200).Alert="","initial warning is brief")
    snap := IRTUPreviewSnapshot(p,7999)
    V48Assert(snap.Alert="" && !snap.Rows[1].Urgent,"warning does not fire before configured lead")
    snap := IRTUPreviewSnapshot(p,8000)
    V48Assert(snap.Alert="Move away in 5" && snap.Rows[1].Urgent,"lead warning begins at the same deadline as the real display")
    V48Assert(IRTUPreviewSnapshot(p,10199).Alert="Move away in 5" && IRTUPreviewSnapshot(p,10200).Alert="","lead warning lasts briefly instead of occupying the whole lead interval")
    snap := IRTUPreviewSnapshot(p,12250)
    V48Assert(snap.Alert="" && snap.Rows[1].Remaining=750,"countdown retains subsecond timing after the brief warning")
    snap := IRTUPreviewSnapshot(p,13000)
    V48Assert(snap.Alert="Move away" && snap.Rows[1].Remaining=0,"expiry is visible briefly at zero")
    V48Assert(IsObject(IRTUPreviewSnapshot(p,15199)) && !IsObject(IRTUPreviewSnapshot(p,15200)),"preview ends after its short expiry warning")
    V48Assert(!IsObject(IRTUPreviewSnapshot(p,999)),"preview never runs before its own start time")
    snap.Rows[1].Name := "Mutated snapshot"
    V48Assert(p.SelectedPreview.Name="Move away","returned snapshots do not alias preview values")
}

V651TimerPreviewVisualModes()
{
    d := IRTDefinition("Warning only"),d.Interval := 0,d.Audio := "example.wav"
    p := IRTUNewState(),p.SelectedPreview := IRTUSelectedPreview(d,1000,5).Preview
    snap := IRTUPreviewSnapshot(p,1000)
    V48Assert(snap.Rows.Length=0 && snap.Alert="Warning only","audio-only imported rule previews its visual warning without inventing a bar")
    V48Assert(snap.AlertColor="F1B847" && p.SelectedPreview.Interval=0,"instant warning has the runtime fallback color and no fabricated duration")
    d.Name := "Bar only",d.Color := "AA88E8",d.ShowCenter := false,d.Interval := 9000
    p.SelectedPreview := IRTUSelectedPreview(d,1000,0).Preview
    V48Assert(IRTUPreviewSnapshot(p,1000).Alert="" && IRTUPreviewSnapshot(p,9000).Alert="","bar-only definition remains silent visually in the center")
    V48Assert(!IRTUPreviewSnapshot(p,9999).Rows[1].Urgent,"zero-second lead does not mark the bar urgent early")
    d.Interval := 360000,d.Repeat := 50,d.RepeatInterval := 12000
    p.SelectedPreview := IRTUSelectedPreview(d,1000,5).Preview
    V48Assert(p.SelectedPreview.Due=361000 && p.SelectedPreview.Until=363200,"long selected timer uses its full duration and previews only one cycle")
    V48Assert(IRTUPreviewSnapshot(p,101000).Rows[1].Remaining=260000,"long previews retain real elapsed time")
}

V651TimerPreviewNativeIsolation()
{
    V65UITimerIsolated(V651TimerPreviewNativeIsolationCase)
}

V651TimerPreviewNativeIsolationCase(path)
{
    global IRT,IRTPrefs,Audio,testClock
    IRT.Enabled := false,d := IRT.Definitions[1],d.Interval := 12000,d.Color := "55CCAA",d.Enabled := false
    activeBefore := IRT.Active.Count,alertsBefore := IRT.Alerts.Length,generationBefore := IRT.Generation
    queueBefore := Audio.Queue.Length,foregroundBefore := WinExist("A")
    IRTShowManager(),p := IRTPrefs
    p.List.Modify(1,"Select Focus")
    V48Assert(IRTUPreviewSelected(),"manager selection starts a preview")
    V48Assert(IsObject(p.SelectedPreview) && p.SelectedPreview.Name=d.Name,"manager previews the actual selected timer")
    V48Assert(p.Rows[1].Name.Text=d.Name && p.Rows[1].Time.Text="12.0","native bar renders the selected timer name and real duration")
    V48Assert(p.AlertText.Text=d.Name,"native warning previews the same selected timer")
    for g in [p.BarsGui,p.AlertGui,p.Manager]
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"preview regression keeps all native windows hidden")
    V48Assert(!IRT.Enabled && !d.Enabled && IRT.Generation=generationBefore,"preview does not enable or reset the real timer engine")
    V48Assert(IRT.Active.Count=activeBefore && IRT.Alerts.Length=alertsBefore,"preview leaves active timers and alerts intact")
    V48Assert(Audio.Queue.Length=queueBefore && WinExist("A")=foregroundBefore && !FileExist(path),"preview does not play audio, steal focus, or persist settings")
    IRTUStopPreview()
    V48Assert(!IsObject(p.SelectedPreview) && !IRTUSnapshot(IRT,testClock,p).Preview,"stop clears selected preview and restores real display")
    IRTUPreviewSelected(),IRTUPreview()
    V48Assert(!IsObject(p.SelectedPreview) && IRTUSnapshot(IRT,testClock,p).Rows.Length=2,"layout demo replaces the selected preview")
    IRTUPreviewSelected(),IRTUCloseManager()
    V48Assert(!IsObject(p.SelectedPreview) && p.PreviewUntil<0,"closing manager ends selected preview")
    IRTUPreviewSelected(),IRTUReset()
    V48Assert(!IsObject(p.SelectedPreview) && p.PreviewUntil<0,"reset ends selected preview without running its timers")
    IRTUPreviewSelected(),snap := IRTURender(IRT,p.PreviewUntil)
    V48Assert(!IsObject(p.SelectedPreview) && !snap.Preview,"rendering at expiry clears the selected preview and restores real results")
}

; Shared overlay controls tested with private models, hidden native windows,
; temporary settings and the harness's unchanged SELF_TEST input/audio guard.
V652TimerOverlayIsolated(callback)
{
    global IRT,IRTPrefs,IPM,IP,IR,IIF,IUB,SETTINGS_FILE,Persist,testClock
    saved := {IRT:IRT,Prefs:IRTPrefs,IPM:IPM,IP:IP,IR:IR,IIF:IIF,IUB:IUB,
        Settings:SETTINGS_FILE,Persist:Persist,Clock:testClock}
    path := A_Temp "\Iris_v652_timer_overlay_" DllCall("GetCurrentProcessId") "_" A_TickCount ".ini"
    try {
        IRT := IRTNewState(),IRT.Enabled := true,IRTPrefs := IRTUNewState()
        d := IRTDefinition("Upcoming cast","Test"),d.Enabled := true,d.Color := "AA88E8",d.Interval := 10000
        IRT.Definitions := [d]
        IRT.Active[d.Id] := {Key:d.Id,Def:d,Name:d.Name,Start:0,Due:10000,Interval:10000,
            Occurrence:1,Remaining:10000,Warned:false,Event:""}
        IRT.Alerts := [{Name:"Upcoming cast",Color:d.Color,At:500,Until:5000}]
        IPM := IPMNewState(),IP := IPNewApp(),IR := IRNewUI(),IIF := IIFNewState(),IUB := IUBNewState()
        testClock := 1000,SETTINGS_FILE := path
        Persist := {Pending:Map(),Last:Map(),Busy:false,Serial:0,Error:"",Status:"test"}
        IPM.Mode := 2
        for key in IPM.Shown
            IPM.Shown[key] := false
        callback.Call(path)
    }
    finally {
        IRTUShutdown(),IPMDestroyPanels()
        IRT := saved.IRT,IRTPrefs := saved.Prefs,IPM := saved.IPM,IP := saved.IP,IR := saved.IR,
            IIF := saved.IIF,IUB := saved.IUB,SETTINGS_FILE := saved.Settings,Persist := saved.Persist,testClock := saved.Clock
        try FileDelete(path)
    }
}

V652TimerMenuState(menu,label)
{
    count := DllCall("User32\GetMenuItemCount","Ptr",menu.Handle,"Int")
    Loop count {
        text := Buffer(512,0),index := A_Index-1
        DllCall("User32\GetMenuStringW","Ptr",menu.Handle,"UInt",index,"Ptr",text,"Int",256,"UInt",0x400,"Int")
        if StrGet(text,"UTF-16")=label
            return DllCall("User32\GetMenuState","Ptr",menu.Handle,"UInt",index,"UInt",0x400,"UInt")
    }
    throw Error("Native menu item missing: " label)
}

V652TimerOverlayPolicy()
{
    display := IPMNewState(),p := IRTUNewState(),s := IRTNewState(),s.Enabled := true
    snap := {Preview:false,Alert:"Move away"}
    visible := IRTUOverlayVisibility(display,p,s,snap,true)
    V48Assert(!visible.Bars && !visible.Warning,"saved timer master does not auto-show overlays on startup")
    display.Wanted := true
    visible := IRTUOverlayVisibility(display,p,s,snap,false)
    V48Assert(!visible.Bars && !visible.Warning,"Iris or another desktop app cannot trigger timers without desktop preview")
    visible := IRTUOverlayVisibility(display,p,s,snap,true)
    V48Assert(visible.Bars && visible.Warning,"explicit Show Overlays permits both timer views in game")
    display.Enabled := false
    visible := IRTUOverlayVisibility(display,p,s,snap,true)
    V48Assert(!visible.Bars && !visible.Warning,"global display enable applies to both timer views")
    display.Editing := true
    visible := IRTUOverlayVisibility(display,p,s,snap,false)
    V48Assert(visible.Bars && !visible.Warning,"explicit Unlock can position timer bars without flashing desktop warnings")
    display.Editing := false,display.Enabled := true,display.DesktopPreview := true
    visible := IRTUOverlayVisibility(display,p,s,snap,false)
    V48Assert(visible.Bars && visible.Warning,"explicit desktop preview follows shared policy")
    display.DesktopPreview := false,display.PreviewCount := 8
    visible := IRTUOverlayVisibility(display,p,s,snap,false)
    V48Assert(visible.Bars && visible.Warning,"shared layout preview supplies display context")
    display.PreviewCount := 0,display.Wanted := false,s.Enabled := false,snap.Preview := true
    visible := IRTUOverlayVisibility(display,p,s,snap,false)
    V48Assert(visible.Bars && visible.Warning,"explicit timer preview works while normal overlays and timer master are off")
    p.ShowBars := false
    visible := IRTUOverlayVisibility(display,p,s,snap,false)
    V48Assert(!visible.Bars && visible.Warning,"bar selection stays independent from warnings during preview")
    p.ShowWarnings := false
    visible := IRTUOverlayVisibility(display,p,s,snap,false)
    V48Assert(!visible.Bars && !visible.Warning,"disabled individual timer views remain hidden")
    p.ShowWarnings := true,snap.Alert := ""
    V48Assert(!IRTUOverlayVisibility(display,p,s,snap,false).Warning,"no empty warning rectangle is shown")
}

V652TimerOverlaySharedMenus()
{
    V652TimerOverlayIsolated(V652TimerOverlaySharedMenusCase)
}

V652TimerOverlaySharedMenusCase(path)
{
    global IRTPrefs,IPM,IRT
    a := IIFCreateMenu(),b := IIFCreateMenu()
    V48Assert(IIFSnapshot(IPM).Count=0 && (V652TimerMenuState(a,"Encounter timers") & 8),"timer selection is checked with every ordinary display off")
    V48Assert(!(V652TimerMenuState(a,"Show Overlays") & 3) && !(V652TimerMenuState(a,"Show Overlays") & 8),"timer-only Show Overlays starts available and unchecked")
    IIFToggleShow()
    V48Assert(IPM.Wanted && (V652TimerMenuState(a,"Show Overlays") & 8) && (V652TimerMenuState(b,"Show Overlays") & 8),"Show toggles and synchronizes every shared menu for timer-only layout")
    IIFToggleShow()
    V48Assert(!IPM.Wanted && !(V652TimerMenuState(a,"Show Overlays") & 8),"Hide unchecks shared show while preserving timer selection")
    IRTPrefs.ShowBars := false,IIFSyncMenus()
    V48Assert(!(V652TimerMenuState(a,"Encounter timers") & 8) && !(V652TimerMenuState(a,"Show Overlays") & 3),"warnings alone leave global Show usable with bars unchecked")
    IRTPrefs.ShowWarnings := false,IIFSyncMenus()
    V48Assert((V652TimerMenuState(a,"Show Overlays") & 3)!=0,"no selected ordinary or timer views disables Show")
    IRTPrefs.ShowBars := true,IPM.Enabled := false,IPM.Editing := true,IIFSyncMenus()
    V48Assert((V652TimerMenuState(a,"Show Overlays") & 8)!=0,"explicit editing counts as shown even with global display enable off")
    IIFToggleShow()
    V48Assert(!IPM.Editing && !IPM.Wanted && !(V652TimerMenuState(a,"Show Overlays") & 8),"Show toggle hides an unlocked timer-only view with global enable off")
    V48Assert(IRT.Active.Count=1 && IRT.Alerts.Length=1,"menu sync never clears the live timer model")
}

V652TimerOverlayHidePreview()
{
    V652TimerOverlayIsolated(V652TimerOverlayHidePreviewCase)
}

V652TimerOverlayHidePreviewCase(path)
{
    global IRTPrefs,IPM,IRT,SELF_TEST
    engine := IRT,active := IRT.Active,alerts := IRT.Alerts,capture := DllCall("User32\GetCapture","Ptr")
    IRTUPreview(),IPM.Editing := true,IRTUSyncEditMode()
    p := IRTPrefs,p.SelectedPreview := {Name:"Private preview"}
    V48Assert(IRTUOverlayPreviewActive() && IPMGuiAlive(p.BarsGui),"explicit preview creates hidden test windows without changing global Wanted")
    IPMHide()
    V48Assert(!IPM.Wanted && !IPM.Editing && !IRTUOverlayPreviewActive() && !IsObject(p.SelectedPreview),"global Hide ends timer preview and shared editing")
    V48Assert(!p.BarsShown && !p.AlertShown && !p.Editing && !p.DragHooks,"global Hide cancels owned timer surfaces and drag hooks")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.BarsGui.Hwnd,"Int") && !DllCall("User32\IsWindowVisible","Ptr",p.AlertGui.Hwnd,"Int"),"owned native windows remain hidden")
    V48Assert(IRT=engine && IRT.Active=active && IRT.Alerts=alerts && IRT.Active.Count=1 && IRT.Alerts.Length=1,"Hide preserves active timer deadlines and pending alerts")
    V48Assert(SELF_TEST && DllCall("User32\GetCapture","Ptr")=capture && !IPM.TimerOn,"diagnostics keep input capture and native scheduler isolated")
}

V652TimerOverlayToggleSelection()
{
    V652TimerOverlayIsolated(V652TimerOverlayToggleSelectionCase)
}

V652TimerOverlayToggleSelectionCase(path)
{
    global IRTPrefs,IPM,IRT
    active := IRT.Active,alerts := IRT.Alerts
    IRTShowManager(),m := IIFCreateMenu(),IRTUToggleOverlay()
    V48Assert(!IRTPrefs.ShowBars && !IRTPrefs.BarBox.Value && !(V652TimerMenuState(m,"Encounter timers") & 8),"Timers menu hides and unchecks the window in both settings and menu")
    V48Assert(IniRead(path,"IrisTimers","ShowBars")=0 && IRT.Enabled && IRTPrefs.ShowWarnings,"hiding bars saves only their selection and preserves warnings/master")
    IRTUToggleOverlay()
    V48Assert(IRTPrefs.ShowBars && IRTPrefs.BarBox.Value && (V652TimerMenuState(m,"Encounter timers") & 8),"Timers menu toggles the same window back on")
    V48Assert(IPM.Enabled && IPM.Wanted && IniRead(path,"IrisTimers","ShowBars")=1,"explicit Timers selection also requests shared overlays")
    V48Assert(IRT.Active=active && IRT.Alerts=alerts && IRT.Active.Count=1,"individual view selection preserves the running engine")
}

V652TimerOverlayHotkeyAndDesktop()
{
    V652TimerOverlayIsolated(V652TimerOverlayHotkeyAndDesktopCase)
}

V652TimerOverlayHotkeyAndDesktopCase(path)
{
    global IPM,IP,IRT,IRTPrefs
    IPM.Enabled := false,m := IIFCreateMenu()
    IPMToggle()
    V48Assert(IPM.Enabled && IPM.Wanted && !IsObject(IPM.ConfigGui),"actual overlay hotkey callback can show a timer-only layout without opening settings")
    IPMToggle()
    V48Assert(!IPM.Wanted,"same hotkey callback hides timer-only overlays")
    IIFToggleDesktop()
    visible := IRTUOverlayVisibility(IPM,IRTPrefs,IRT,{Preview:false,Alert:"Test"},false)
    V48Assert(IPM.DesktopPreview && IPM.Wanted && visible.Bars && visible.Warning,"desktop opt-in can show timer-only views")
    V48Assert(V652TimerMenuState(m,"Show Overlays") & 8,"desktop preview keeps Show Overlays checked")
    IIFToggleDesktop()
    visible := IRTUOverlayVisibility(IPM,IRTPrefs,IRT,{Preview:false,Alert:"Test"},false)
    V48Assert(!IPM.DesktopPreview && !visible.Bars && !visible.Warning,"turning desktop preview off hides timers on the desktop")
    V48Assert(IPM.Wanted && (V652TimerMenuState(m,"Show Overlays") & 8),"leaving desktop preview preserves Show Overlays for the game")
    V48Assert(!IP.Active && !IP.Timer && IRT.Active.Count=1,"visibility shortcuts do not start parsing or modify active timers")
}

V652TimerOverlayLastOrdinaryView()
{
    V652TimerOverlayIsolated(V652TimerOverlayLastOrdinaryViewCase)
}

V652TimerOverlayLastOrdinaryViewCase(path)
{
    global IPM,IRTPrefs,IRT
    IIFApplyChoice("Damage",true),IIFApplyChoice("Damage",false)
    V48Assert(IIFSnapshot(IPM).Count=0 && IPM.Wanted,"deselecting last ordinary meter preserves selected timer views")
    V48Assert(IRTUOverlayVisibility(IPM,IRTPrefs,IRT,{Preview:false,Alert:""},true).Bars,"timers stay visible in game after last ordinary meter is unchecked")
    V48Assert(IRT.Active.Count=1,"ordinary display selection does not reset active timers")
}

V652TimerOverlayPreviewMenu()
{
    V652TimerOverlayIsolated(V652TimerOverlayPreviewMenuCase)
}

V652TimerOverlayPreviewMenuCase(path)
{
    global IRT,IRTPrefs,IPM
    IRT.Enabled := false,m := IIFCreateMenu(),IRTUPreview()
    V48Assert(!IRTUOverlaySelected() && IRTUOverlayPreviewActive(),"private preview does not turn live timer master on")
    V48Assert((V652TimerMenuState(m,"Show Overlays") & 8) && !(V652TimerMenuState(m,"Show Overlays") & 3),"active explicit preview can be hidden using shared Show Overlays")
    IIFToggleShow()
    V48Assert(!IRTUOverlayPreviewActive() && !IPM.Wanted && !IRT.Enabled,"shared Hide ends preview without enabling engine or overlays")
    V48Assert(!(V652TimerMenuState(m,"Show Overlays") & 8) && (V652TimerMenuState(m,"Show Overlays") & 3),"preview-only Show returns to disabled unchecked state after Hide")
}

; The bundled pack is checked against its exact reviewed UTF-8 source. Library
; loading tests use a private temporary INI/sidecar and never enable live timers.
V652TimerDefaultsHash(text)
{
    bytes := Buffer(StrPut(text,"UTF-8")),StrPut(text,bytes,"UTF-8")
    provider := 0,hash := 0
    try {
        if !DllCall("Advapi32\CryptAcquireContextW","Ptr*",&provider,"Ptr",0,"Ptr",0,"UInt",24,"UInt",0xF0000000,"Int")
            throw OSError()
        if !DllCall("Advapi32\CryptCreateHash","Ptr",provider,"UInt",0x800C,"Ptr",0,"UInt",0,"Ptr*",&hash,"Int")
            throw OSError()
        if !DllCall("Advapi32\CryptHashData","Ptr",hash,"Ptr",bytes.Ptr,"UInt",bytes.Size-1,"UInt",0,"Int")
            throw OSError()
        digest := Buffer(32),size := 32
        if !DllCall("Advapi32\CryptGetHashParam","Ptr",hash,"UInt",2,"Ptr",digest.Ptr,"UInt*",&size,"UInt",0,"Int")
            throw OSError()
        out := ""
        Loop size
            out .= Format("{:02x}",NumGet(digest,A_Index-1,"UChar"))
        return out
    }
    finally {
        if hash
            DllCall("Advapi32\CryptDestroyHash","Ptr",hash,"Int")
        if provider
            DllCall("Advapi32\CryptReleaseContext","Ptr",provider,"UInt",0,"Int")
    }
}

V652TimerDefaultsIndex(defs)
{
    index := IRTMap()
    for d in defs {
        V48Assert(!index.Has(d.Id),"bundled timer identity appears once: " d.Name)
        index[d.Id] := d
    }
    return index
}

V652TimerDefaultsEmbedded()
{
    xml := IRTDefaultXML()
    V48Assert(StrPut(xml,"UTF-8")-1=108762,"embedded XML keeps the complete original source length")
    V48Assert(V652TimerDefaultsHash(xml)="0c7f5618e41c5a6a01e70127dc87ff451bb79723d65f04348f2d95084de3b4c5",
        "native SHA256 proves the embedded XML is byte-for-byte the reviewed personal v15 source")
    parsed := IRTParseXML(xml,IRTBDefinitions()),bundled := IRTDefaultLibrary(),index := V652TimerDefaultsIndex(bundled.Definitions)
    V48Assert(parsed.Definitions.Length=172 && parsed.Overrides.Length=10,"all 182 XML entries include 172 custom rules and 10 built-in preferences")
    V48Assert(index.Count=212,"complete default library combines the personal pack with 40 presets")
    for d in parsed.Definitions
        V48Assert(index.Has(d.Id) && index[d.Id].Name==d.Name && index[d.Id].Interval=d.Interval,
            "default catalogue retains exact custom timer identity and duration: " d.Name)
    for d in parsed.Overrides
        V48Assert(index.Has(d.Id) && index[d.Id].Builtin,"built-in preference remains attached to its preset: " d.Name)
    supported := 0,enabled := 0,unavailableCustom := 0,unavailablePreset := 0
    for d in bundled.Definitions {
        supported += d.Supported ? 1 : 0
        enabled += d.Supported && d.Enabled ? 1 : 0
        if !d.Supported {
            if d.Builtin
                unavailablePreset += 1
            else
                unavailableCustom += 1
        }
    }
    V48Assert(supported=199 && enabled=193,"all four grenade wall warnings are supported and enabled")
    V48Assert(unavailableCustom=9 && unavailablePreset=4,"missing links and unsupported presets stay listed with honest limitations")
    V48Assert(!index["Built-in: Terror From Beyond" Chr(31) "Terror Slam"].Enabled,"personal pack's disabled preset stays disabled")
    firstId := bundled.Definitions[1].Id,bundled.Definitions[1].Name := "local mutation"
    V48Assert(V652TimerDefaultsIndex(IRTDefaultLibrary().Definitions)[firstId].Name!="local mutation","each default library load owns fresh definitions")
}

V652TimerDefaultsIsolated(callback)
{
    V651TimerEditIsolated(V652TimerDefaultsCleanup.Bind(callback))
}

V652TimerDefaultsCleanup(callback,path)
{
    try callback.Call(path)
    finally {
        for suffix in [".timers.xml",".timers.xml.bak"]
            try FileDelete(path suffix)
    }
}

V652TimerDefaultsFirstLoad()
{
    V652TimerDefaultsIsolated(V652TimerDefaultsFirstLoadCase)
}

V652TimerDefaultsFirstLoadCase(path)
{
    global IRT,Audio
    IRT.Enabled := false,queueBefore := Audio.Queue.Length
    IRTLoadLibrary()
    V48Assert(IRT.Definitions.Length=202 && IRT.ById.Count=202,"missing sidecar loads every bundled timer automatically")
    V48Assert(!IRT.Enabled && IRT.Active.Count=0 && IRT.Alerts.Length=0,"loading definitions never turns on timer visuals or starts countdowns")
    V48Assert(Audio.Queue.Length=queueBefore,"bundled source sound choices cannot submit audio during startup")
    V48Assert(!FileExist(path) && !FileExist(path ".timers.xml") && !FileExist(path ".timers.xml.bak"),"default loading is read-only and creates no user settings or sidecar")
    id := "The Nature of Progress" Chr(31) "Bombardment STOP"
    V48Assert(IRT.ById.Has(id) && IRT.ById[id].Interval=0 && IRT.ById[id].Color="","hidden cancellation helpers are included, not filtered from the default pack")
}

V652TimerDefaultsSavedOverrides()
{
    V652TimerDefaultsIsolated(V652TimerDefaultsSavedOverridesCase)
}

V652TimerDefaultsSavedOverridesCase(path)
{
    global IRT,Audio
    bundled := IRTDefaultLibrary(),index := V652TimerDefaultsIndex(bundled.Definitions)
    customId := "Classes - Sage/Sorc" Chr(31) "Insta Benevolence",presetId := "Built-in: Temple of Sacrifice" Chr(31) "Revan Pull"
    custom := IRTIClone(index[customId]),preset := IRTIClone(index[presetId])
    custom.Enabled := false,custom.Color := "123456",custom.Interval := 54321,custom.Name := "Insta Benevolence"
    preset.Enabled := false,preset.Color := "654321"
    IRTWriteLibrary([custom,preset]),sidecar := FileRead(path ".timers.xml","UTF-8")
    FileAppend("keep this backup",path ".timers.xml.bak","UTF-8-RAW")
    IRT.Enabled := false,queueBefore := Audio.Queue.Length
    IRTLoadLibrary(),loaded := IRT.ById
    V48Assert(IRT.Definitions.Length=202 && loaded.Count=202,"saved partial library overrides matching defaults without duplicate identities")
    V48Assert(!loaded[customId].Enabled && loaded[customId].Color="123456" && loaded[customId].Interval=54321,
        "saved disabled state, color, and edited custom duration win over bundled values")
    V48Assert(!loaded[presetId].Enabled && loaded[presetId].Color="654321" && loaded[presetId].Interval=15000,
        "saved preset preferences win while its encounter mechanics remain unchanged")
    V48Assert(index[customId].Enabled && index[customId].Color!="123456","saved overrides do not mutate the independent bundled catalogue")
    V48Assert(FileRead(path ".timers.xml","UTF-8")==sidecar && FileRead(path ".timers.xml.bak","UTF-8")=="keep this backup",
        "startup preserves saved sidecar and previous backup bytes")
    V48Assert(!IRT.Enabled && Audio.Queue.Length=queueBefore && !FileExist(path),"saved preference merge never enables master or writes unrelated settings")
    IRTLoadLibrary()
    V48Assert(IRT.Definitions.Length=202 && !IRT.ById[customId].Enabled,"repeated startup does not duplicate or re-enable the saved timer")
}

V652TimerDefaultsCorruptSaved()
{
    V652TimerDefaultsIsolated(V652TimerDefaultsCorruptSavedCase)
}

V652TimerDefaultsCorruptSavedCase(path)
{
    global IRT
    broken := "<com.ixale.starparse.domain.ConfigTimers><timers><broken",backup := "original backup"
    FileAppend(broken,path ".timers.xml","UTF-8-RAW"),FileAppend(backup,path ".timers.xml.bak","UTF-8-RAW")
    IRT.Enabled := false,IRTLoadLibrary(),reported := false
    for issue in IRT.Issues
        reported := reported || InStr(issue,"Saved timers could not be loaded:")>0
    V48Assert(reported && IRT.Definitions.Length=202,"corrupt saved sidecar is reported while complete bundled defaults remain available")
    V48Assert(FileRead(path ".timers.xml","UTF-8")==broken && FileRead(path ".timers.xml.bak","UTF-8")==backup,
        "failed saved-library parsing does not overwrite either original file")
    V48Assert(!IRT.Enabled && IRT.Active.Count=0 && !FileExist(path),"fallback never enables timers or persists replacement settings")
}

; Regressions from June8 IP-CPT: selecting the idle boss during trash started
; Colors from the trash entry and emitted a warning before the real boss pull.
V653TimerIdleBossSelection()
{
    d := IRTDefinition("IP colors","test"),d.Enabled := true,d.Interval := 72000,d.Color := "FFFFFF"
    d.Trigger := IRTCondition("COMBAT_START"),d.Trigger.Boss := "IP-CPT"
    s := IRTNewState([d]),s.Enabled := true,s.Self := "@Timer Tester#65"
    V65BObserve(s,V65BEv("Enter"),1000)
    V65BObserve(s,V65BEv("Damage","Security Droid {900}:1","@Timer Tester#65"),1100)
    boss := "IP-CPT {4494653210492928}:100|(0,0,0,0)|(1000/1000)"
    for source in ["@Timer Tester#65","@Other Player#66"] {
        for effect in ["836045448953668","836045448953669"]
            V65BObserve(s,V65BEv("Other",source,boss,"",effect),2000)
    }
    V48Assert(s.Boss="" && s.Active.Count=0,"player target changes during trash cannot start boss timers")
    V48Assert(s.Continuity.Segment.BossKey="" && s.Continuity.Segment.Enemies.Count=0,
        "target changes do not populate boss reset evidence")
    V65BObserve(s,V65BEv("Exit"),2500)
    V65BPump(s,69000)
    V48Assert(s.Alerts.Length=0 && s.Active.Count=0,"no false pre-pull warning survives trash exit")
    V65BObserve(s,V65BEv("Enter"),70000)
    V65BObserve(s,V65BEv("Damage","@Other Player#66",boss),70200)
    V48Assert(IRTBBossAlias(s.Boss)="ipcpt","a raid member's real combat hit still identifies IP-CPT")
    V65BDue(s,"IP colors",142000,"first countdown uses actual boss pull entry, not preceding trash")
}

V653TimerBossTargetAcquisition()
{
    s := V65BState("NiM")
    V65BObserve(s,V65BEv("Other","TYTH {4078423634870272}:10|(0,0,0,0)|(1000/1000)",
        "@Timer Tester#65","","836045448953668"),1050)
    V48Assert(IRTBBossAlias(s.Boss)="tyth","NPC boss acquiring a player is preserved")
    V65BDue(s,"Tyth Inversion",27500,"boss-source targeting keeps original pull deadline")
    V65BObserve(s,V65BEv("Other","@Timer Tester#65","TYTH {4078423634870272}:10","","836045448953669"),1100)
    V48Assert(IRTBBossAlias(s.Boss)="tyth" && s.CombatStart=1000,"clearing player target cannot erase a real encounter")
}

V653TimerSelectionContinuity()
{
    s := V65CState()
    IRTCObserve(s,V65CEv(),1100),V65CDeath(s)
    IRTCObserve(s,V65BEv("Enter"),3000)
    idle := "Boss {4078423634870272}:20|(0,0,0,0)|(1000/1000)"
    selected := V65BEv("Other","@Someone Else#77",idle,"","836045448953668")
    V48Assert(!IsObject(IRTCObserve(s,selected,3100)) && IsObject(s.Continuity.Pending),
        "selecting another idle full-health instance cannot confirm a fresh pull")
    V48Assert(s.Continuity.Segment.Enemies.Count=1,"selection cannot replace retained injured-boss evidence")
    V48Assert(!IsObject(IRTCObserve(s,V65CEv("Damage","4078423634870272","10","650/1000"),3200)),
        "same injured boss after revival still confirms continuation")
    V48Assert(!IsObject(s.Continuity.Pending) && s.CombatStart=1000,"battle revival retains original combat anchor")
}

V653TimerCarryDef(name,ability,interval,boss := "")
{
    d := IRTDefinition(name,"test"),d.Enabled := true,d.Interval := interval,d.Color := "FFFFFF",d.Scope := "COMBAT"
    d.Trigger := IRTCondition("ABILITY_ACTIVATED"),d.Trigger.AbilityGuid := ability,d.Trigger.Boss := boss
    return d
}

V653TimerDeferredEntryCarry()
{
    reveal := V653TimerCarryDef("reveal","100",15000,"Tyth")
    child := V653TimerCarryDef("child","",20000,"Tyth")
    child.Trigger.Type := "TIMER_STARTED",child.Trigger.Timer := "reveal"
    old := V653TimerCarryDef("old helper","99",3000)
    oldChild := V653TimerCarryDef("old child","",20000)
    oldChild.Trigger.Type := "TIMER_FINISHED",oldChild.Trigger.Timer := "old helper"
    s := IRTNewState([reveal,child,old,oldChild]),s.Enabled := true,s.Self := "@Timer Tester#65"
    s.AreaId := "833571547775765",s.ModeId := "836045448953655"
    V65BObserve(s,V65BEv("Enter"),1000)
    V65BObserve(s,V65CEv(),1100)
    original := V65BEv("Activate","@Other#99","=","99")
    V65BObserve(s,original,1200)
    V48Assert(!original.HasOwnProp("IRTTriggerAt"),"timer origin metadata never mutates a shared parser event")
    V65BObserve(s,V65BEv("Death"),2000)
    V65BObserve(s,V65BEv("Enter"),4000)
    V65BObserve(s,V65BEv("Activate","@Other#99","=","100"),4100)
    V65BPump(s,4300)
    V48Assert(IsObject(V65BFind(s,"old child")),"old helper has a post-entry child to reject")
    V65BObserve(s,V65CEv("Damage","4078423634870272","20","990/1000"),4500)
    V48Assert(s.CombatStart=4000,"confirmed new pull retains its actual entry timestamp")
    V65BDue(s,"reveal",19100,"direct current-pull timer survives late boss confirmation")
    V65BDue(s,"child",24100,"child of a current-pull event retains its own deadline")
    V65BIdle(s,"old child","old event origin cannot cross the boundary through a later helper")
    V65BPump(s,19100)
    found := false
    for alert in s.Alerts
        found := found || alert.Name="reveal"
    V48Assert(found && !IsObject(V65BFind(s,"reveal")),"retained timer expires once at its original deadline")
}

V653TimerCarryScopeAndOrigin()
{
    d := V653TimerCarryDef("scoped","100",15000,"Nahut")
    s := IRTNewState([d]),s.Enabled := true,s.Now := 5000,s.Boss := "Nahut"
    ev := V65BEv("Activate","@Other#99","=","100")
    ev.IRTTriggerAt := 4100,ev.IRTTriggerBoss := "Nahut"
    IRTStart(s,d,4100,ev)
    kept := IRTPostEntryTimers(s,4000)
    V48Assert(kept.Count=1,"event and instance both after pending entry qualify for recovery")
    s.Active.Clear(),s.Boss := "Scyva"
    IRTRestorePostEntryTimers(s,kept)
    V48Assert(s.Active.Count=0,"a retained old boss filter cannot start a different encounter's timer")
    s.Boss := "Nahut",IRTStart(s,d,4900,ev)
    IRTRestorePostEntryTimers(s,kept)
    V65BDue(s,"scoped",19900,"recovery never replaces an instance already rebuilt for the new pull")
    V48Assert(IRTPostEntryTimers(s,4200).Count=0,"a new instance with pre-entry event origin is not carried")
}

; Personal-buff regressions. These are detached native engine states only.
; No GUI, live input, saved settings, gameplay bindings, or audio are touched.
; Four literal records below come from the user's Oct1 recording, lines
; 4766/4779/5781/5787, SHA256 4b0347a509b08dd2fd1407a2058aa700dee5ce7802954652bf08a1442abadae3.
; Clock-shifted/pre-pull/early-removal variants are explicitly synthetic edge cases.
V654BuffRaw(which)
{
    switch which {
        case "fuel-gain":
            return "[15:45:48.822] [@Kelly#689906611571511|(777.24,2340.00,228.52,-101.17)|(447497/483839)] [=] [Explosive Fuel {986266225082368}] [ApplyEffect {836045448945477}: Explosive Fuel {986266225082368}]"
        case "shield-gain":
            return "[15:45:49.024] [@Kelly#689906611571511|(777.24,2340.00,228.52,-101.17)|(311108/483839)] [=] [Energy Shield {814218425139200}] [ApplyEffect {836045448945477}: Energy Shield {814218425139459}]"
        case "fuel-lost":
            return "[15:46:03.937] [@Kelly#689906611571511|(795.68,2367.59,228.52,-33.21)|(476104/483839)] [=] [Explosive Fuel {986266225082368}] [RemoveEffect {836045448945478}: Explosive Fuel {986266225082368}]"
        case "shield-lost":
            return "[15:46:04.139] [@Kelly#689906611571511|(797.48,2368.67,228.52,-28.23)|(476104/483839)] [=] [Energy Shield {814218425139200}] [RemoveEffect {836045448945478}: Energy Shield {814218425139459}]"
    }
    throw Error("Unknown personal buff fixture")
}

V654BuffDef(name)
{
    defs := IRTDefaultLibrary().Definitions
    IRTRepairBundled(defs)
    for d in defs {
        if d.Folder="Classes - Vang/PT" && d.Name==name
            return d
    }
    throw Error("Missing personal buff definition: " name)
}

V654BuffState()
{
    s := IRTNewState([V654BuffDef("Explosive Fuel"),V654BuffDef("Energy Shield")])
    s.Enabled := true,s.Self := "@Kelly#689906611571511"
    return s
}

V654BuffObserve(s,which,at)
{
    V65BObserve(s,IPParseLine(V654BuffRaw(which)),at)
}

V654PersonalBuffDefinitions()
{
    for row in [["Energy Shield","814218425139200","814218425139459"],
        ["Explosive Fuel","986266225082368","986266225082368"],
        ["Reactive Shield","801329228283904","801329228284194"],
        ["Battle Focus","1003974375243776","1003974375243776"]] {
        d := V654BuffDef(row[1])
        V48Assert(d.Interval=15000 && d.Scope="ANY",row[1] " keeps its reviewed duration across combat boundaries")
        V48Assert(d.Trigger.Type="EFFECT_GAINED" && d.Cancel.Type="EFFECT_LOST",row[1] " follows effect gain and removal")
        V48Assert(d.Trigger.AbilityGuid==row[2] && d.Trigger.EffectGuid==row[3],row[1] " uses recorded ability/effect identifiers")
        V48Assert(d.Cancel.AbilityGuid==row[2] && d.Cancel.EffectGuid==row[3]
            && d.Trigger.Target="@Self" && d.Cancel.Target="@Self",row[1] " removal remains specific to the matching local effect")
        V48Assert(IRTIsBuffDuration(d),row[1] " is classified as an active duration, not a cooldown forecast")
    }
}

V654PersonalBuffOct1Records()
{
    fuel := IPParseLine(V654BuffRaw("fuel-gain")),shield := IPParseLine(V654BuffRaw("shield-gain"))
    fuelLost := IPParseLine(V654BuffRaw("fuel-lost")),shieldLost := IPParseLine(V654BuffRaw("shield-lost"))
    V48Assert(fuelLost.RawMs-fuel.RawMs=15115 && shieldLost.RawMs-shield.RawMs=15115,
        "literal Oct1 effects each lasted 15.115s; no guessed cooldown value")
    s := V654BuffState()
    V65BObserve(s,V65BEv("Enter",s.Self),99000)
    V65BObserve(s,fuel,100000),V65BObserve(s,shield,100000+shield.RawMs-fuel.RawMs)
    V65BDue(s,"Explosive Fuel",115000,"actual Fuel gain anchors its 15s active duration")
    V65BDue(s,"Energy Shield",115202,"actual Shield gain keeps its distinct 202ms offset")
    V65BPump(s,110000)
    found := false
    for a in s.Alerts
        found := found || a.Name="Explosive Fuel ends in 5"
    V48Assert(found,"Fuel lead warning describes buff ending, not becoming available")
    V65BPump(s,115000)
    found := false
    for a in s.Alerts
        found := found || a.Name="Explosive Fuel ended"
    V48Assert(found,"Fuel expiry is labeled as ended")
    V65BObserve(s,fuelLost,115115),V65BObserve(s,shieldLost,115317)
    V48Assert(s.Active.Count=0,"actual effect removals never create another duration")
}

V654PersonalBuffPrePullAndExit()
{
    ; Synthetic boundary placement of the literal gains: this scenario does not
    ; occur in the Oct1 sample, but exposed the old Scope=COMBAT lifecycle defect.
    s := V654BuffState()
    V654BuffObserve(s,"fuel-gain",1000),V654BuffObserve(s,"shield-gain",1202)
    V48Assert(!s.InCombat && s.Active.Count=2,"personal active buffs can begin before combat")
    V65BObserve(s,V65BEv("Enter",s.Self),5000)
    V65BDue(s,"Explosive Fuel",16000,"entering combat does not erase or restart pre-used Fuel")
    V65BDue(s,"Energy Shield",16202,"entering combat retains Shield original deadline")
    V65BObserve(s,V65BEv("Exit",s.Self),6000)
    V48Assert(!s.InCombat && s.Active.Count=2,"combat exit alone is not proof either buff ended")
    V654BuffObserve(s,"fuel-lost",7000)
    V65BIdle(s,"Explosive Fuel","actual removal stops the local Fuel buff outside combat")
    V65BDue(s,"Energy Shield",16202,"Fuel removal cannot remove Shield")
    V654BuffObserve(s,"shield-lost",7100)
    V48Assert(s.Active.Count=0,"both disappear after their own observed removals")
}

V654PersonalBuffEarlyRemoval()
{
    ; Synthetic shortened use proves early removal does not announce a later
    ; expiry or fire a TIMER_FINISHED child as though the duration elapsed.
    d := V654BuffDef("Explosive Fuel")
    child := V65TimerDef("after duration",8000,"TIMER_FINISHED"),child.Trigger.Timer := d.Name
    s := IRTNewState([d,child]),s.Enabled := true,s.Self := "@Kelly#689906611571511"
    V654BuffObserve(s,"fuel-gain",1000)
    V654BuffObserve(s,"fuel-lost",4000)
    V48Assert(s.Active.Count=0 && s.Alerts.Length=0,"early effect removal cancels without firing expiry or linked completion")
    V65BPump(s,16000)
    V48Assert(s.Active.Count=0 && s.Alerts.Length=0,"canceled duration cannot produce a stale expiry warning")
}

V654PersonalBuffIdentity()
{
    s := V654BuffState()
    foreign := IPParseLine(StrReplace(V654BuffRaw("fuel-gain"),"@Kelly#689906611571511","@Other#987"))
    V65BObserve(s,foreign,1000)
    V48Assert(s.Active.Count=0,"another player's Fuel does not start the recorder's personal timer")
    wrong := IPParseLine(V654BuffRaw("shield-gain")),wrong.EffectId := "814218425139460"
    V65BObserve(s,wrong,1100)
    V48Assert(s.Active.Count=0,"same display name with a different effect ID is not Energy Shield")
    V654BuffObserve(s,"shield-gain",1200)
    lostOther := IPParseLine(StrReplace(V654BuffRaw("shield-lost"),"@Kelly#689906611571511","@Other#987"))
    V65BObserve(s,lostOther,1300)
    V65BDue(s,"Energy Shield",16200,"another player's removal cannot cancel the local Shield")
    V654BuffObserve(s,"fuel-lost",1400)
    V65BDue(s,"Energy Shield",16200,"different local buff removal cannot cancel Shield")
}

V654PersonalBuffLateRemoval()
{
    s := V654BuffState()
    V654BuffObserve(s,"fuel-gain",10000)
    ; A delayed removal belonging to an older use must not erase the newer buff.
    V654BuffObserve(s,"fuel-lost",9900)
    V65BDue(s,"Explosive Fuel",25000,"backdated previous-use removal does not cancel a newer duration")
    V654BuffObserve(s,"fuel-gain",9800)
    V65BDue(s,"Explosive Fuel",25000,"older gain cannot rewind the accepted current duration")
    V654BuffObserve(s,"fuel-lost",10100)
    V48Assert(s.Active.Count=0,"current-use removal still cancels normally")
}

V654PersonalBuffWarningClassification()
{
    buff := V654BuffDef("Energy Shield")
    V48Assert(IRTIsBuffDuration(buff),"matching gain/loss conditions identify a buff duration")
    other := IRTIClone(buff),other.Cancel.EffectGuid := "999"
    V48Assert(!IRTIsBuffDuration(other),"canceling on a different effect is not classified as the same buff")
    other := IRTIClone(buff),other.Cancel.Target := "@Other"
    V48Assert(!IRTIsBuffDuration(other),"different target cancellation cannot imply local buff duration")
    forecast := V65TimerDef("Energy Shield",10000)
    V48Assert(!IRTIsBuffDuration(forecast),"an ability name alone never changes forecast semantics")
    s := V65TimerState([forecast])
    IRTObserve(s,V65TimerEvent(),100000),V65BPump(s,105000)
    V48Assert(s.Alerts.Length=1 && s.Alerts[1].Name="Energy Shield in 5","ordinary forecast retains its upcoming-event wording")
    result := IRTUSelectedPreview(buff,1000,5),prefs := {SelectedPreview:result.Preview}
    V48Assert(IRTUPreviewSnapshot(prefs,11000).Alert="Energy Shield ends in 5","selected buff preview uses the same ending warning")
    V48Assert(IRTUPreviewSnapshot(prefs,16000).Alert="Energy Shield ended","selected buff preview identifies expiry")
}

; Guarded library upgrades, exact observed IDs, and difficulty isolation.
V654RepairLibrary()
{
    defs := IRTDefaultLibrary().Definitions
    IRTRepairBundled(defs)
    return V652TimerDefaultsIndex(defs)
}

V654RepairPreferences()
{
    defs := IRTDefaultLibrary().Definitions,index := V652TimerDefaultsIndex(defs)
    d := index["Classes - Vang/PT" Chr(31) "Energy Shield"]
    d.Enabled := false,d.Color := "123456",d.Slot := "C",d.ShowCenter := false
    d.Audio := "custom.wav",d.Volume := 17,d.ShowSource := true
    IRTRepairBundled(defs)
    V48Assert(d.Cancel.Type="EFFECT_LOST" && d.Scope="ANY","original mechanics receive the repair")
    V48Assert(!d.Enabled && d.Color="123456" && d.Slot="C" && !d.ShowCenter
        && d.Audio="custom.wav" && d.Volume=17 && d.ShowSource,"repair preserves every selected presentation preference")
    xml := IRTSerializeXML(defs),count := defs.Length
    IRTRepairBundled(defs)
    V48Assert(IRTSerializeXML(defs)==xml && defs.Length=count,"repeated repair is idempotent")
    parsed := IRTParseXML(xml,IRTBDefinitions()),roundtrip := IRTMergeDefinitions([],parsed,true).Definitions
    IRTRepairBundled(roundtrip)
    found := V652TimerDefaultsIndex(roundtrip)[d.Id]
    V48Assert(found.Cancel.Type="EFFECT_LOST" && !found.Enabled && found.Color="123456","saved upgraded buff keeps its mechanics and preferences")
}

V654RepairCustomRules()
{
    for change in ["Interval","Trigger","Cancel","Scope","Repeat","IgnoreRepeated"] {
        defs := IRTDefaultLibrary().Definitions,index := V652TimerDefaultsIndex(defs)
        d := index["Classes - Vang/PT" Chr(31) "Explosive Fuel"]
        switch change {
            case "Interval": d.Interval := 12345
            case "Trigger": d.Trigger.Target := "@Other"
            case "Cancel": d.Cancel := IRTCondition("EFFECT_LOST"),d.Cancel.EffectGuid := "123"
            case "Scope": d.Scope := "ANY"
            case "Repeat": d.Repeat := 2
            case "IgnoreRepeated": d.IgnoreRepeated := true
        }
        before := IRTSerializeXML([d]),IRTRepairBundled(defs)
        V48Assert(IRTSerializeXML([d])==before,"user-edited " change " cannot be replaced by a template repair")
    }
    defs := IRTDefaultLibrary().Definitions,index := V652TimerDefaultsIndex(defs)
    old := index["The Nature of Progress" Chr(31) "Titax Strike"],old.Enabled := false
    saved := IRTIClone(old),saved.Name := "Titax Strike (NiM)",saved.Id := saved.Folder Chr(31) saved.Name
    saved.Interval := 23456,saved.Enabled := false,defs.Push(saved)
    IRTRepairBundled(defs)
    V48Assert(defs.Length=213 && saved.Interval=23456 && !saved.Enabled,"existing separately edited NiM timer wins without duplication")
}

V654RepairSavedLibrary()
{
    V652TimerDefaultsIsolated(V654RepairSavedLibraryCase)
}

V654RepairSavedLibraryCase(path)
{
    global IRT
    defs := IRTDefaultLibrary().Definitions,index := V652TimerDefaultsIndex(defs)
    id := "Classes - Vang/PT" Chr(31) "Energy Shield"
    index[id].Enabled := false,index[id].Color := "123456"
    IRTWriteLibrary(defs),before := FileRead(path ".timers.xml","UTF-8")
    IRTLoadLibrary()
    V48Assert(IRT.ById[id].Cancel.Type="EFFECT_LOST" && !IRT.ById[id].Enabled && IRT.ById[id].Color="123456",
        "loading an existing original sidecar applies repairs after saved preferences")
    V48Assert(FileRead(path ".timers.xml","UTF-8")==before,"startup never rewrites the saved XML")
    V48Assert(IRT.ById.Has("The Nature of Progress" Chr(31) "Titax Strike (NiM)"),"upgraded mode-specific entry appears in the effective library")
    for issue in IRT.Issues
        V48Assert(!InStr(issue,"Missing linked timer: Degauss.") && !InStr(issue,"Linked timer is unavailable: Trigger - Degauss."),
            "a resolved Watchdog dependency is not still reported as unavailable")
    IRTSaveLibrary(),saved := FileRead(path ".timers.xml","UTF-8"),IRTLoadLibrary()
    V48Assert(IRT.ById.Count=201 && IRT.ById[id].Cancel.Type="EFFECT_LOST","saved curated library reloads without duplicates")
    V48Assert(FileRead(path ".timers.xml","UTF-8")==saved,"subsequent load stays read-only")
}

V654RepairCleanseAndMine()
{
    index := V654RepairLibrary(),d := index["Classes - Scndrl/Op" Chr(31) "Op Cleanse"]
    s := V65TimerState([d]),ev := V65TimerEvent("Activate","@Other#2","@Self#1","992541172301824")
    ev.Ability := "Toxin Scan",IRTObserve(s,ev,100000)
    V65BDue(s,"Op Cleanse",111100,"actual Toxin Scan ID starts the existing cleanse timer")
    IRTStop(s,d.Id),ev.Source := IPActor("@Self#1"),IRTObserve(s,ev,100100)
    V48Assert(s.Active.Count=0,"cleanse remains limited to other players")
    d := index["Dread Fortress" Chr(31) "Mine"],s := V65TimerState([d]),s.Boss := "Corruptor Zero"
    ev := V65TimerEvent("Other","Boss {905}:1","@Self#1","3321882325549056")
    ev.ActionId := "836045448945477",ev.EffectId := "3321882325549056"
    IRTDispatchEvent(s,ev,100000,"EFFECT_GAINED"),IRTPump(s,100000,false)
    V48Assert(s.Alerts.Length=0,"Mine alert does not mislabel the earlier placement as charged")
    ev.EffectId := "3321882325549324",s.Now := 100100
    IRTDispatchEvent(s,ev,100100,"EFFECT_GAINED"),IRTPump(s,100100,false)
    V48Assert(s.Alerts.Length=1 && s.Alerts[1].Name="Mine","recorded charged-mine ability/effect pair emits one alert")
    V48Assert(index["Dread Fortress" Chr(31) "Mine PING"].Trigger.AbilityGuid="3321882325549324",
        "separate mine damage alert keeps its valid damage ID")
}

V654RepairTitaxModes()
{
    index := V654RepairLibrary()
    hm := index["The Nature of Progress" Chr(31) "Titax Strike"]
    nim := index["The Nature of Progress" Chr(31) "Titax Strike (NiM)"]
    ev := V65TimerEvent("Activate","Titax {4256512428212224}:1","@Self#1","4256733497131008")
    for mode in ["NiM","HM","SM",""] {
        s := V65TimerState([hm,nim]),s.Boss := "Trandoshan Squad",s.Mode := mode,s.Size := "Eight"
        IRTDispatchEvent(s,ev,100000,"ABILITY_ACTIVATED")
        if mode="NiM"
            V48Assert(s.Active.Count=1 && V65TimerOnly(s).Due=121000 && V65TimerOnly(s).Def.Id==nim.Id,
                "NiM uses the21s estimate rather than the late40s veteran prediction")
        else if mode="HM"
            V48Assert(s.Active.Count=1 && V65TimerOnly(s).Due=140000 && V65TimerOnly(s).Def.Id==hm.Id,
                "veteran timing is isolated from NiM")
        else
            V48Assert(s.Active.Count=0,"unsupported or unknown difficulty cannot borrow a prediction")
    }
}

; Actual live bridge regressions with a private state and explicit read clocks.
; No scheduling, file reads, UI, audio, or normal application launch.
V654LiveSetup()
{
    global IRT,IP,CurrentRecord,ReadClockSample,testClock,localPlayerToken,LogClock
    prior := {IRT:IRT,Reader:IP.ReaderContext,Record:CurrentRecord,Batch:ReadClockSample,
        Clock:testClock,Local:localPlayerToken,LogClock:LogClock}
    d := V65TimerDef("Live buff",15000,"EFFECT_GAINED","")
    d.Trigger.EffectGuid := "777",d.Trigger.Target := "@Self"
    IRT := IRTNewState([d]),IRT.Enabled := true
    IP.ReaderContext := IPReaderNew("timer-live-test"),IP.ReaderContext.Owner := "@Timer Tester#65"
    localPlayerToken := "@Wrong fallback#99",testClock := 100000
    CurrentRecord := "",ReadClockSample := {Tick:100000,LatestStamp:43208000},LogClock := {Latest:-1}
    return prior
}

V654LiveRestore(prior)
{
    global IRT,IP,CurrentRecord,ReadClockSample,testClock,localPlayerToken,LogClock
    IRT := prior.IRT,IP.ReaderContext := prior.Reader,CurrentRecord := prior.Record
    ReadClockSample := prior.Batch,testClock := prior.Clock,localPlayerToken := prior.Local,LogClock := prior.LogClock
}

V654LiveFeed(stamp,tick,allow := true,effect := "777",source := "@Timer Tester#65")
{
    global CurrentRecord,testClock
    raw := Mod(stamp,86400000),h := raw//3600000,m := Mod(raw//60000,60),sec := Mod(raw//1000,60),ms := Mod(raw,1000)
    line := Format("[{:02}:{:02}:{:02}.{:03}]",h,m,sec,ms)
        . " [" source "] [=] [Buff {888}] [ApplyEffect {836045448945477}: Buff {" effect "}]"
    testClock := tick,CurrentRecord := {Line:line,At:stamp}
    IRTSafeObserveLine(line,allow)
}

V654LiveBufferedFirstBatch()
{
    global IRT
    prior := V654LiveSetup()
    try {
        generation := IRT.Generation
        V654LiveFeed(43200000,100000)
        t := V65BFind(IRT,"Live buff")
        V48Assert(IsObject(t) && t.Start=92000 && t.Due=107000 && t.Remaining=7000,
            "eight buffered seconds count toward the buff instead of restarting fifteen seconds now")
        V654LiveFeed(43208000,100000,true,"999")
        V48Assert(IRT.Generation=generation && V65BFind(IRT,"Live buff").Due=107000,
            "catching up to the same batch tail does not reset the clock or discard the buff")
    }
    finally V654LiveRestore(prior)
}

V654LiveMidnightAndProcessingTime()
{
    global IRT,ReadClockSample
    prior := V654LiveSetup()
    try {
        ReadClockSample := {Tick:100000,LatestStamp:4000}
        V654LiveFeed(86396000,100800)
        t := V65BFind(IRT,"Live buff")
        V48Assert(IRT.AnchorLog=86404000 && IRT.AnchorTick=100000,"batch tail unwraps midnight using the actual record day")
        V48Assert(t.Start=92000 && t.Due=107000 && t.Remaining=6200,
            "time spent processing the buffer does not extend the buff")
    }
    finally V654LiveRestore(prior)
}

V654LiveFutureJitter()
{
    global IRT,ReadClockSample
    prior := V654LiveSetup()
    try {
        IRT.AnchorLog := 43200000,IRT.AnchorTick := 100000
        ReadClockSample := {Tick:101000,LatestStamp:43201200}
        V654LiveFeed(43201200,101000)
        t := V65BFind(IRT,"Live buff")
        V48Assert(IRT.Now=101000 && IRT.LastPump=101000 && t.Start=101000 && t.Due=116000,
            "small clock jitter cannot advance live state into the future or display more than the timer duration")
        IRTPump(IRT,101050)
        V48Assert(t.Remaining=14950,"the next real display tick decreases remaining time normally")
    }
    finally V654LiveRestore(prior)
}

V654LiveStaleBatchAndChunkContinuity()
{
    global IRT,ReadClockSample
    prior := V654LiveSetup()
    try {
        generation := IRT.Generation,ReadClockSample := {Tick:100000,LatestStamp:43220000}
        V654LiveFeed(43200000,100000,false)
        V48Assert(IRT.Active.Count=0 && IRT.Alerts.Length=0,"blocked older records still never create warnings")
        V654LiveFeed(43219000,100000)
        V65BDue(IRT,"Live buff",114000,"fresh suffix uses the same tail anchor even after older blocked records")
        ReadClockSample := {Tick:100200,LatestStamp:43220000}
        V654LiveFeed(43220000,100200,true,"999")
        V48Assert(IRT.Generation=generation && IRT.AnchorTick=100000 && V65BFind(IRT,"Live buff").Due=114000,
            "later chunks of the same buffered tail cannot keep moving a deadline forward")
    }
    finally V654LiveRestore(prior)
}

V654LiveRecorderAndFallback()
{
    global IRT,ReadClockSample
    prior := V654LiveSetup()
    try {
        ReadClockSample := ""
        V654LiveFeed(43200000,100000)
        V48Assert(IRT.Self="@Timer Tester#65" && IRT.Active.Count=1,"live reader identity wins over a stale fallback token")
        V65BDue(IRT,"Live buff",115000,"direct calls without a batch preserve ordinary fresh timing")
        IRTStop(IRT,IRT.Definitions[1].Id)
        V654LiveFeed(43200100,100100,true,"777","@Other Player#66")
        V48Assert(IRT.Active.Count=0,"another player's self buff cannot trigger a personal timer")
    }
    finally V654LiveRestore(prior)
}

V654LiveRealClockDiscontinuity()
{
    global IRT,ReadClockSample
    prior := V654LiveSetup()
    try {
        ReadClockSample := {Tick:100000,LatestStamp:43200000}
        V654LiveFeed(43200000,100000)
        generation := IRT.Generation
        ReadClockSample := {Tick:101000,LatestStamp:43220000}
        V654LiveFeed(43220000,101000)
        V48Assert(IRT.Generation=generation+1 && IRT.AnchorLog=43220000 && IRT.AnchorTick=101000,
            "a genuine large record-clock discontinuity still resets and anchors to the new batch")
        V65BDue(IRT,"Live buff",116000,"new event after a real discontinuity starts at the actual live time")
    }
    finally V654LiveRestore(prior)
}

V654WDDefs()
{
    defs := IRTParseXML(IRTDefaultXML(),IRTBDefinitions()).Definitions
    IRTWDRepair(defs),IRTValidateDependencies(defs),index := V652TimerDefaultsIndex(defs)
    return [index["R4 Anomaly" Chr(31) "WD - 1° Degauss - Watchdog"],
        index["R4 Anomaly" Chr(31) "WD - 2° Degauss - Watchdog"],
        index["Z - Triggers" Chr(31) "Trigger - Degauss"]]
}

V654WDMigration()
{
    defs := IRTParseXML(IRTDefaultXML(),IRTBDefinitions()).Definitions,index := V652TimerDefaultsIndex(defs)
    first := index["R4 Anomaly" Chr(31) "WD - 1° Degauss - Watchdog"]
    helper := index["Z - Triggers" Chr(31) "Trigger - Degauss"]
    first.Enabled := false,first.Color := "123456",first.Audio := "custom.wav",first.Volume := 17
    first.IRTIBaseSupported := false,first.IRTIBaseReason := "Linked timer is unavailable: Trigger - Degauss."
    helper.IRTIBaseSupported := false,helper.IRTIBaseReason := "Missing linked timer: Degauss."
    IRTWDRepair(defs),IRTValidateDependencies(defs)
    V48Assert(first.Supported && helper.Supported && first.Scope="COMBAT","known persisted linked failures are repaired")
    V48Assert(!first.Enabled && first.Color="123456" && first.Audio="custom.wav" && first.Volume=17,"presentation and enabled preferences survive repair")
    xml := IRTSerializeXML(defs),roundtrip := IRTParseXML(xml,IRTBDefinitions()).Definitions
    copy := V652TimerDefaultsIndex(roundtrip)[first.Id]
    V48Assert(!copy.HasOwnProp("IRTV654Watchdog"),"runtime phase marker is not serialized")
    IRTWDRepair(roundtrip),IRTValidateDependencies(roundtrip)
    V48Assert(copy.IRTV654Watchdog="first" && IRTSerializeXML(roundtrip)==xml,"exact upgraded roundtrip regains marker without XML changes")
    for change in ["Interval","Trigger","Cancel","Scope","IgnoreRepeated","Reason"] {
        defs := IRTParseXML(IRTDefaultXML(),IRTBDefinitions()).Definitions
        d := V652TimerDefaultsIndex(defs)[first.Id]
        switch change {
            case "Interval": d.Interval := 65432
            case "Trigger": d.Trigger.Source := "@Other"
            case "Cancel": d.Cancel.Timer := "Someone else's helper"
            case "Scope": d.Scope := "COMBAT"
            case "IgnoreRepeated": d.IgnoreRepeated := true
            case "Reason": d.IRTIBaseSupported := false,d.IRTIBaseReason := "User-defined unsupported reason."
        }
        before := IRTSerializeXML([d]),IRTWDRepair(defs)
        V48Assert(IRTSerializeXML([d])==before && !d.HasOwnProp("IRTV654Watchdog"),"edited " change " remains unchanged and unmarked")
    }
    defs := V654WDDefs(),defs[2].Interval := 111111,IRTWDRepair(defs)
    V48Assert(!defs[2].HasOwnProp("IRTV654Watchdog") && defs[2].Interval=111111,"editing an upgraded countdown removes only its runtime marker")
}

V654WDState(defs := "")
{
    s := IRTNewState(IsObject(defs) ? defs : V654WDDefs()),s.Enabled := true,s.Self := "@Timer Tester#65"
    area := IPParseLine("[00:00:01.000] [@Timer Tester#65] [] [] [AreaEntered {836045448953664}: R-4 Anomaly {833571547775799} (8 Player Veteran {836045448953652})]")
    V65BObserve(s,area,0)
    V65BObserve(s,V65BEv("Enter"),1000)
    V65BObserve(s,V65BEv("Damage","Watchdog {4494700455133184}:100","@Timer Tester#65","4468578464038912"),1100)
    return s
}

V654WDCast(s,at,instance := "100",allow := true)
{
    V65BObserve(s,V65BEv("Activate","Watchdog {4494700455133184}:" instance,"=","4472216301338624"),at,allow)
}

V654WDSequence()
{
    s := V654WDState()
    V65BDue(s,"WD - 1° Degauss - Watchdog",64000,"first Degauss uses original combat entry")
    V654WDCast(s,63700)
    V65BIdle(s,"WD - 1° Degauss - Watchdog","actual first cast clears first estimate")
    V65BDue(s,"WD - 2° Degauss - Watchdog",172200,"first cast starts the second estimate")
    V654WDCast(s,63700)
    V48Assert(s.BuiltinState["v654.watchdog.degauss"].Count=1,"duplicate cast row does not advance phase")
    V654WDCast(s,63699)
    V48Assert(s.BuiltinState["v654.watchdog.degauss"].Count=1,"older repeated row does not advance phase")
    V654WDCast(s,171000)
    V65BIdle(s,"WD - 2° Degauss - Watchdog","second actual cast cancels estimate without restarting it")
    V654WDCast(s,243000)
    V65BIdle(s,"WD - 2° Degauss - Watchdog","third cast cannot create an invalid next-cycle forecast")
}

V654WDWipeAndNewPull()
{
    s := V654WDState()
    V65BObserve(s,V65BEv("Exit"),2000)
    V65BIdle(s,"WD - 1° Degauss - Watchdog","first estimate stops on early wipe")
    V65BPump(s,70000)
    V48Assert(s.Alerts.Length=0,"early wipe leaves no delayed first-Degauss warning")
    V65BObserve(s,V65BEv("Enter"),71000)
    V65BObserve(s,V65BEv("Damage","Watchdog {4494700455133184}:200","@Timer Tester#65","4468578464038912"),71100)
    V65BDue(s,"WD - 1° Degauss - Watchdog",134000,"new combat rearms first estimate")
    V654WDCast(s,133700,"200")
    V65BDue(s,"WD - 2° Degauss - Watchdog",242200,"new combat resets observed cast count")
}

V654WDModeAndCustom()
{
    defs := V654WDDefs(),custom := IRTDefinition("My Degauss","Custom")
    custom.Enabled := true,custom.Interval := 121000,custom.Trigger := defs[2].Trigger.Clone()
    custom.Trigger.Mode := "",custom.Cancel := IRTCondition("COMBAT_END"),custom.Scope := "COMBAT"
    defs.Push(custom),s := V654WDState(defs)
    V654WDCast(s,63700),V654WDCast(s,172300)
    V65BDue(s,"My Degauss",293300,"unmarked custom timer retains repeated behavior")
    s := V654WDState(),s.Mode := "SM",s.ModeId := "836045448953651",s.Active.Clear()
    V654WDCast(s,63700)
    V48Assert(!s.BuiltinState.Has("v654.watchdog.degauss"),"story mode does not use HM phase evidence")
    V65BIdle(s,"WD - 2° Degauss - Watchdog","HM second forecast cannot start in story mode")
}

V654WDSilentAndPause()
{
    s := V654WDState()
    V654WDCast(s,63700,"100",false)
    V48Assert(!s.BuiltinState.Has("v654.watchdog.degauss"),"silent backlog cannot advance phase")
    V654WDCast(s,64000)
    IRTPause(s,65000)
    V654WDCast(s,172600)
    V65BIdle(s,"WD - 2° Degauss - Watchdog","resume preserves phase and does not treat second cast as first")
    s := V654WDState(),V654WDCast(s,63700)
    V654WDCast(s,100000,"999")
    V65BIdle(s,"WD - 2° Degauss - Watchdog","unconfirmed actor replacement cancels forecast")
}

V654WDRun(*)
{
    global V48Checks := 0
    try {
        for fn in [V654WDMigration,V654WDSequence,V654WDWipeAndNewPull,V654WDModeAndCustom,V654WDSilentAndPause]
            fn()
        FileOpen(A_ScriptDir "\watchdog-result.txt","w","UTF-8").Write("PASS: five native Watchdog rule regressions, " V48Checks " assertions`n")
        ExitApp(0)
    }
    catch Error as err {
        FileOpen(A_ScriptDir "\watchdog-result.txt","w","UTF-8").Write("FAIL: " err.Message "`n" err.Stack)
        ExitApp(1)
    }
}

V270CouncilOverlay()
{
    global IPM
    saved := IPM,IPM := IPMNewState()
    try {
        snap := V53Snapshot(),rows := []
        for name in ["Bestia","Tyrans","Calphayus","Raptus","Brontes","Styrak"]
            rows.Push({Name:"Dread Master " name,Known:true,Current:8760000,Maximum:9000000,Percent:97.3,Stale:false})
        duplicate := rows[3].Clone(),duplicate.Name .= " #012345",duplicate.Stale := true
        V48Assert(IRHealthText(duplicate).Name="Calphayus #012345 ~","the display shortens the title and keeps the instance and age markers")
        snap.Raid.Health := rows,p := IPM.Panels["BossHP"],p.Width := 196
        IPMEnsureGui("BossHP",0,p),IPMRender("BossHP",snap,p)
        V48Assert(p.VisibleRows=6 && p.Rows[3].Name.Text="Calphayus","all six names display in automatic height mode")
        Loop p.VisibleRows {
            row := p.Rows[A_Index]
            for cell in [row.Name,row.Total,row.Value] {
                cell.GetPos(,,&width)
                V48Assert(IXFTextWidth(cell,cell.Text)<=width,"Council names and health fit the narrowest HP panel")
            }
        }
        V48Assert(rows[3].Name="Dread Master Calphayus","the parser keeps the full actor name")

        p.Width := 246,p.AutoHeight := false,p.Height := 100
        snap.Raid.Health := rows.Clone(),snap.Raid.Health.RemoveAt(5,2)
        IPMRender("BossHP",snap,p)
        V48Assert(p.VisibleRows=4 && p.Layout.Font>=8 && p.Layout.Font<IPM.Font
            && p.Layout.H=Round(p.Height*p.Layout.Scale),"four rows fit in a short fixed panel with a readable font")
        snap.Raid.Health := [rows[1]],IPMRender("BossHP",snap,p)
        V48Assert(p.Layout.Font=IPM.Font && p.VisibleRows=1,"the configured font returns when fewer rows are needed")

        snap.Raid.Health := rows,p.Height := 60
        IPMRender("BossHP",snap,p)
        V48Assert(p.VisibleRows<6 && p.Layout.RowCountText=p.VisibleRows " of 6 shown","a very short panel still reports how many rows were hidden")
        snap.Raid.Health := rows.Clone(),snap.Raid.Health.Pop()
        IPMRender("BossHP",snap,p)
        V48Assert(p.Meta.Text=p.VisibleRows " of 5 shown","the overflow message updates even when the visible rows are the same")
        p.AutoHeight := true,IPM.MaxRows := 3,snap.Raid.Health := rows
        IPMRender("BossHP",snap,p)
        V48Assert(p.VisibleRows=3 && p.Layout.RowCountText="3 of 6 shown","the saved row limit continues to apply")
    }
    finally IPMDestroyPanels(),IPM := saved
}

V270WatchdogOverlay() => V65UITimerIsolated(V270WatchdogOverlayCase)
V270WatchdogOverlayCase(path)
{
    global IRT,IRTPrefs,IPM
    IRT := V654WDState(),p := IRTPrefs,mon := IPMMonitorBounds(IPM.Panels["BossHP"])
    for phase,at in [1100,63700] {
        if phase=2
            V654WDCast(IRT,at)
        short := "Degauss " phase
        snap := IRTUDataSnapshot(IRT,at,p,true)
        V48Assert(snap.Rows.Length=1 && snap.Rows[1].CompactName=short
            && InStr(snap.Rows[1].Name,"Degauss - Watchdog"),"Watchdog adds a compact label to the current countdown")
        originalDue := snap.Rows[1].Due
        p.BarsWidth := 180,p.Scale := 60
        IRTUDraw(p,snap,IRTULayout(p,snap,mon),at)
        row := p.Rows[1],row.Name.GetPos(,,&nameW),row.Time.GetPos(,,&timeW)
        V48Assert(row.Name.Text=short && IRTUBarNamePixels(row.Name,row.Name.Text)<=nameW,
            "the minimum timer box displays the full Degauss name")
        V48Assert(IRTUBarNamePixels(row.Time,row.Time.Text)<=timeW
            && row.Time.Text=Format("{:.1f}",(originalDue-at)/1000),"the countdown keeps its full number")
        cached := row.LabelFit
        snap := IRTUDataSnapshot(IRT,at+100,p,true),IRTUDraw(p,snap,IRTULayout(p,snap,mon),at+100)
        V48Assert(row.LabelFit=cached && snap.Rows[1].Due=originalDue,"the cached short name stays stable as time ticks")

        p.BarsWidth := 450,p.Scale := 100
        IRTUDraw(p,snap,IRTULayout(p,snap,mon),at+100)
        expected := IRTDisplayText(snap.Rows[1].BarName)
        V48Assert(row.Name.Text=expected && InStr(expected,": " short),"the source shows again when the timer has room")
    }
    snap := IRTUDataSnapshot(V65UITimerFixture(),1000,p,true)
    V48Assert(!snap.Rows[1].HasOwnProp("CompactName") && snap.Rows[1].Name="Move away","ordinary timers keep their label rules")
}

; Hidden native warning controls, detached state and geometry only.
V655WarningFixture()
{
    s := IRTNewState(),s.Enabled := true
    for i,name in ["Energy Shield ends in 5","Predation in 5","Explosive Fuel ends in 5","Move away"]
        s.Alerts.Push({Name:name,Color:["FFCCB3","80FFFF","CCE6FF","EF7373"][i],At:1000,Until:3200})
    return s
}

V655WarningSnapshotRows()
{
    s := V655WarningFixture(),p := IRTUNewState(),snap := IRTUSnapshot(s,1000,p)
    rows := IRTUAlertRows(snap)
    V48Assert(rows.Length=4 && s.Alerts.Length=4,"all four simultaneously active warnings fit without changing their queue")
    V48Assert(rows[1].Name="Move away" && rows[4].Name="Energy Shield ends in 5","warnings retain complete distinct labels")
    V48Assert(rows[1].Color="EF7373" && rows[4].Color="FFCCB3","each warning retains its own color")
    rows[1].Name := "changed"
    V48Assert(s.Alerts[4].Name="Move away","display rows never alias queued events")
    V48Assert(IRTUAlertRows(IRTUSnapshot(s,3200,p)).Length=0,"expired messages cannot leave a stale row")
    snap.AlertLines[1].Name := "Line one`nLine two`t& text"
    V48Assert(IRTUAlertRows(snap)[1].Name="Line one Line two & text","embedded control characters cannot escape an individual row")
}

V655WarningLayoutBounds()
{
    s := V655WarningFixture(),p := IRTUNewState(),snap := IRTUSnapshot(s,1000,p)
    for scale in [60,100,200] {
        p.Scale := scale,p.AlertX := -9999,p.AlertY := 9999
        mon := {L:-1280,T:0,R:0,B:720,All:[{L:-1280,T:0,R:0,B:720}]}
        layout := IRTULayout(p,snap,mon),lastBottom := 0
        for row in layout.AlertRows {
            V48Assert(row.Y>=lastBottom && row.Y+row.H<=layout.AH,"scaled warning rectangles do not overlap or escape the window")
            lastBottom := row.Y+row.H
        }
        V48Assert(layout.AX>=mon.L && layout.AX+layout.AW<=mon.R && layout.AY+layout.AH<=mon.B,
            "warning stack remains reachable on a negative-coordinate monitor")
        for i in [1,2,3,4,5,6,7,8,9,10,11,12]
            snap.Rows.Push({Name:"bar",Remaining:1000,Interval:10000,Color:"FFFFFF",Urgent:true,Due:2000})
        withBars := IRTULayout(p,snap,mon)
        V48Assert(withBars.AW=layout.AW && withBars.AH=layout.AH && withBars.AlertFont=layout.AlertFont,
            "adding timer bars cannot resize or shrink the independent warning text")
        snap.Rows := []
    }
}

V655WarningNativeStack()
{
    V65UITimerIsolated(V655WarningNativeStackCase)
}

V655WarningNativeStackCase(path)
{
    global IRT,IRTPrefs,Audio
    before := WinExist("A"),audioBefore := Audio.Queue.Length
    IRT := V655WarningFixture(),IRTURender(IRT,1000),p := IRTPrefs,lastBottom := 0
    V48Assert(p.LastError="" && p.AlertRows.Length=4,"four native warning controls render without exceptions")
    for i,control in p.AlertRows {
        control.GetPos(&x,&y,&w,&h)
        style := DllCall("User32\GetWindowLongW","Ptr",control.Hwnd,"Int",-16,"UInt")
        V48Assert(y>=lastBottom && y+h<=p.AlertHeight,"native child rectangles are separate and entirely inside the alert window")
        V48Assert(control.Text=IRT.Alerts[5-i].Name && !InStr(control.Text,"`n"),"each HWND receives exactly one complete warning")
        V48Assert((style&0x4000) && (style&0x80),"long names ellipsize within their row and literal ampersands are preserved")
        lastBottom := y+h
    }
    IRT.Alerts := [{Name:"Short",Color:"80FFFF",At:1100,Until:3200}]
    IRTURender(IRT,1100)
    V48Assert(p.AlertRows[1].Text="Short","replacement paints the remaining warning")
    for i,control in p.AlertRows {
        if i=1
            continue
        style := DllCall("User32\GetWindowLongW","Ptr",control.Hwnd,"Int",-16,"UInt")
        V48Assert(control.Text="" && !(style&0x10000000),"unused controls are cleared and hidden when the warning stack shrinks")
    }
    IRTURender(IRT,3200)
    for control in p.AlertRows
        V48Assert(control.Text="","expiry clears every warning control")
    IRTUReset(),old := p.AlertGui,old.Destroy()
    IRT.Alerts := V655WarningFixture().Alerts,IRTURender(IRT,1000)
    V48Assert(p.LastError="" && p.AlertRows.Length=4 && p.AlertRows[4].Text="Energy Shield ends in 5",
        "destroyed warning window recreates every row with fresh content")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.AlertGui.Hwnd,"Int") && WinExist("A")=before,
        "native visual tests stay hidden and cannot steal game focus")
    V48Assert(Audio.Queue.Length=audioBefore && !FileExist(path),"overlapping warnings never play audio or write settings")
}

V655WarningNativeLongText()
{
    V65UITimerIsolated(V655WarningNativeLongTextCase)
}

V655WarningNativeLongTextCase(path)
{
    global IRT,IRTPrefs
    IRT := V655WarningFixture(),IRT.Alerts[4].Name := "Energy Shield ends in 5: a considerably longer player-specific warning"
    IRTURender(IRT,1000),p := IRTPrefs
    V48Assert(p.LastError="" && p.AlertRows[1].Text=IRT.Alerts[4].Name,"long warning remains one control with the full stored text")
    fonts := []
    for control in [p.AlertRows[1],p.AlertRows[2]] {
        font := SendMessage(0x31,0,0,control.Hwnd),info := Buffer(92,0)
        V48Assert(DllCall("Gdi32\GetObjectW","Ptr",font,"Int",92,"Ptr",info,"Int")=92,"native font metrics are available")
        fonts.Push(Abs(NumGet(info,0,"Int")))
    }
    V48Assert(fonts[1]<=fonts[2],"long text fits by shrinking independently of the other warning")
}

; Detached timer models only. No UI, live records, hotkeys, audio or settings.
V655AlertInstance(name,key,due,color := "FFCC44")
{
    d := V65TimerDef(name),d.Color := color
    return {Key:key,Def:d,Name:name,Due:due}
}

V655TimerAlertsSimultaneous()
{
    a := V65TimerDef("Energy Shield",1000),b := V65TimerDef("Predation",1000)
    a.Trigger := IRTCondition("EFFECT_GAINED"),a.Trigger.Target := "@Self",a.Trigger.EffectGuid := "456"
    a.Cancel := IRTIClone(a.Trigger),a.Cancel.Type := "EFFECT_LOST"
    b.Color := "AB77FF",s := V65TimerState([a,b]),s.LeadMs := 1000
    IRTStart(s,a,100000),IRTStart(s,b,100000),IRTPump(s,100000)
    V48Assert(s.Alerts.Length=2,"simultaneous duration and upcoming-event warnings stay separate")
    V48Assert(s.Alerts[1].Name="Energy Shield ends in 1" && s.Alerts[2].Name="Predation in 1","mixed warning wording remains independent")
    V48Assert(s.Alerts[1].Color="FFCC44" && s.Alerts[2].Color="AB77FF","each simultaneous warning retains its own color")
    firstKey := s.Alerts[1].Key,secondKey := s.Alerts[2].Key
    IRTPump(s,101000)
    V48Assert(s.Alerts.Length=2 && s.Alerts[1].Name="Energy Shield ended" && s.Alerts[2].Name="Predation","due messages replace both short lead messages instead of stacking contradictory labels")
    V48Assert(s.Alerts[1].Key==firstKey && s.Alerts[2].Key==secondKey,"lead-to-due updates retain their original row order")
    V48Assert(s.Alerts[1].At=101000 && s.Alerts[1].Until=103200 && s.Alerts[2].At=101000,"replacement is immediate and receives its own brief display lifetime")
}

V655TimerAlertUpdatesInPlace()
{
    s := V65TimerState([]),first := V655AlertInstance("First","first",101000)
    IRTPushAlert(s,first,100000,true)
    for n in ["second","third","fourth"]
        IRTPushAlert(s,V655AlertInstance(n,n,101000),100000,true)
    s.Now := 101000,IRTPushAlert(s,first,101000)
    V48Assert(s.Alerts.Length=4 && s.Alerts[1].Name="First","an existing warning updates in place even when all rows are occupied")
    V48Assert(s.Alerts[2].Key="second" && s.Alerts[3].Key="third" && s.Alerts[4].Key="fourth","updating one timer neither evicts nor reorders unrelated warnings")
    s.Now := 101100,first.Due := 102100,IRTPushAlert(s,first,101100,true)
    V48Assert(s.Alerts.Length=4 && s.Alerts[1].Name="First in 1","a repeated timer refreshes its one existing row")
}

V655TimerAlertDistinctSources()
{
    d := V65TimerDef("Spread",1000),d.ShowSource := true
    s := V65TimerState([d]),s.LeadMs := 1000
    ; Same display name, different actor IDs: never merge their live instances.
    IRTStart(s,d,100000,V65TimerEvent("Activate","@Same#1"))
    IRTStart(s,d,100000,V65TimerEvent("Activate","@Same#2"))
    IRTPump(s,100000)
    V48Assert(s.Alerts.Length=2 && s.Alerts[1].Name=s.Alerts[2].Name,"equal visible names can still represent two independent sources")
    V48Assert(s.Alerts[1].Key!==s.Alerts[2].Key,"ShowSource warnings retain distinct actor identities")
    V48Assert(IRTUAlertRows(IRTUSnapshot(s,100000,IRTUNewState())).Length=2,
        "separate source identities survive the visible snapshot even with identical labels")
    IRTPump(s,101000)
    V48Assert(s.Alerts.Length=2 && s.Alerts[1].Name="Same: Spread" && s.Alerts[2].Name="Same: Spread","each source's due warning replaces only its own lead")
}

V655TimerAlertCapacityAndExpiry()
{
    s := V65TimerState([])
    s.Alerts := [{Name:"Keep first",Key:"first",Color:"FF0000",At:99000,Until:102000},
        {Name:"Expired",Key:"expired",Color:"FFFFFF",At:97000,Until:100000},
        {Name:"Keep second",Key:"second",Color:"00FF00",At:99100,Until:102100},
        {Name:"Keep third",Key:"third",Color:"0000FF",At:99200,Until:102200}]
    IRTPushAlert(s,V655AlertInstance("Fourth","fourth",100000),100000)
    V48Assert(s.Alerts.Length=4 && s.Alerts[1].Name="Keep first","expired rows are removed before applying the four-warning limit")
    V48Assert(s.Alerts[4].Name="Fourth" && s.Alerts[4].At=100000,"the fresh fourth warning displays immediately")
    IRTPushAlert(s,V655AlertInstance("Fifth","fifth",100000),100000)
    V48Assert(s.Alerts.Length=4 && s.Alerts[1].Key="second" && s.Alerts[4].Key="fifth","overflow removes the oldest warning without queuing a delayed alert")
    IRTPump(s,102300)
    V48Assert(s.Alerts.Length=0,"every retained warning expires without replaying overflow")
}

V655TimerAlertSuppressionAndLegacy()
{
    s := V65TimerState([]),inst := V655AlertInstance("Fresh","fresh",100000)
    s.Alerts := [{Name:"Older fixture",Color:"FFAA00",At:99900,Until:102000}]
    IRTPushAlert(s,inst,100000)
    V48Assert(s.Alerts.Length=2 && s.Alerts[1].Name="Older fixture","keyless existing diagnostic alerts remain compatible")
    IRTPushAlert(s,inst,98000)
    V48Assert(s.Alerts.Length=2 && s.Alerts[2].At=100000,"stale events cannot replace or renew current warnings")
    inst.Def.ShowCenter := false,IRTPushAlert(s,inst,100000)
    V48Assert(s.Alerts.Length=2,"center-disabled timers remain silent")
    inst.Def.ShowCenter := true,inst.Def.Color := "",IRTPushAlert(s,inst,100000)
    V48Assert(s.Alerts.Length=2,"hidden helper timers remain silent")
    inst.Def.Audio := "fixture.mp3",s.Now := 100100,IRTPushAlert(s,inst,100100)
    V48Assert(s.Alerts.Length=2 && s.Alerts[2].Color="F1B847" && s.Alerts[2].At=100100,"audio-only metadata still permits a visual warning without creating another row")
}

; Titax is a labelled estimate, not a guaranteed next cast. Detached native
; engine/preview states and private temporary sidecars only; no live input,
; audio, normal app startup, saved user settings, or live raid validation.
V656TitaxDefinitions()
{
    defs := IRTDefaultLibrary().Definitions
    IRTRepairBundled(defs)
    selected := []
    for d in defs {
        if d.Folder=="The Nature of Progress" && (d.Name=="Titax Strike" || d.Name=="Titax Strike (NiM)")
            selected.Push(d)
    }
    return selected
}

V656TitaxEstimateTemplates()
{
    defs := IRTDefaultLibrary().Definitions
    for d in defs {
        if d.Id=="The Nature of Progress" Chr(31) "Titax Strike" {
            d.Enabled := false,d.Color := "123456",d.Slot := "C",d.ShowCenter := true
            d.ShowSource := true,d.Audio := "private.wav",d.Volume := 19
        }
    }
    IRTRepairBundled(defs),count := 0
    for d in defs {
        if !IRTIsTitaxEstimate(d)
            continue
        count += 1
        V48Assert(!d.Enabled && d.Color="123456" && d.Slot="C" && d.ShowCenter
            && d.ShowSource && d.Audio="private.wav" && d.Volume=19,
            "estimate policy preserves disabled, color, slot, source and saved warning/audio choices")
        V48Assert(d.Id==d.Folder Chr(31) d.Name && IRTTimerDisplayName(d)==d.Name " (estimate)",
            "only the display label gains estimate; definition identity and dependency name stay unchanged")
        V48Assert((d.Trigger.Mode="HM" && d.Interval=40000) || (d.Trigger.Mode="NiM" && d.Interval=21000),
            "each estimate keeps its existing mode-specific interval")
    }
    V48Assert(count=2,"only the two exact repaired Titax templates are estimates")
    before := IRTSerializeXML(defs),IRTRepairBundled(defs)
    V48Assert(IRTSerializeXML(defs)==before && defs.Length=213,"reapplying estimate derivation changes no saved fields or library identities")
}

V656TitaxEstimateLiveWarnings()
{
    for d in V656TitaxDefinitions() {
        d.ShowSource := true
        ordinary := V65TimerDef("Ordinary countdown",d.Interval)
        child := V65TimerDef("Linked after Titax",10000,"TIMER_FINISHED")
        child.Trigger.Timer := d.Name,child.Color := "",child.ShowCenter := false
        s := V65TimerState([d,ordinary,child]),s.InCombat := true
        s.Boss := "Trandoshan Squad",s.Mode := d.Trigger.Mode,s.Size := "Eight"
        ev := V65TimerEvent("Activate","Titax {4256512428212224}:1","@Self#1","4256733497131008")
        IRTDispatchEvent(s,ev,100000,"ABILITY_ACTIVATED"),IRTStart(s,ordinary,100000)
        inst := V65BFind(s,d.Name)
        V48Assert(IsObject(inst) && inst.Due=100000+d.Interval && inst.Def.Name==d.Name,
            "observed Titax activation still starts the unchanged estimate and keeps its dependency name")
        snap := IRTUSnapshot(s,100000,IRTUNewState()),found := false
        for row in snap.Rows
            found := found || row.Name=="Titax: " d.Name " (estimate)"
        V48Assert(found && snap.Rows.Length=2,"active estimate keeps its source label beside ordinary timer bars")
        V65BPump(s,inst.Due-5000)
        V48Assert(s.Alerts.Length=1 && s.Alerts[1].Name="Ordinary countdown in 5",
            "Titax lead is silent while a concurrent ordinary timer proves live lead warnings still work")
        due := inst.Due,V65BPump(s,due)
        V48Assert(s.Alerts.Length=1 && s.Alerts[1].Name="Ordinary countdown",
            "Titax expiry is silent while the concurrent ordinary expiry warning still works")
        V48Assert(!IsObject(V65BFind(s,d.Name)) && IsObject(V65BFind(s,child.Name)),
            "estimate expires once and existing TIMER_FINISHED links still match the original name")
        V65BPump(s,due+1000),IRTDispatchEvent(s,ev,due+1000,"ABILITY_ACTIVATED")
        V48Assert(V65BFind(s,d.Name).Due=due+1000+d.Interval,
            "a later actual cast can start a fresh estimate without inventing repeated casts")
    }
}

V656TitaxEstimatePreview()
{
    for d in V656TitaxDefinitions() {
        saved := IRTSerializeXML([d]),result := IRTUSelectedPreview(d,1000,5)
        V48Assert(result.Ok && result.Preview.ShowBar && !result.Preview.ShowCenter,
            "selected Titax preview shows its bar without a big warning")
        p := IRTUNewState(),p.SelectedPreview := result.Preview
        for at in [1000,1000+d.Interval-5000,1000+d.Interval,2000+d.Interval] {
            snap := IRTUPreviewSnapshot(p,at)
            V48Assert(snap.Alert="" && snap.Rows.Length=1 && snap.Rows[1].Name==d.Name " (estimate)",
                "preview stays labelled and center-silent at start, lead, expiry and expiry tail")
        }
        V48Assert(IRTSerializeXML([d])==saved,"preview never rewrites the saved warning preference or timer identity")
        d.Color := "",d.Audio := "private.wav",d.ShowCenter := true
        V48Assert(!IRTUSelectedPreview(d,1000,5).Ok,
            "an estimate without a bar cannot pretend its suppressed center warning is previewable")
    }
}

V656TitaxEstimateCustomRules()
{
    for canonical in V656TitaxDefinitions() {
        for change in ["Interval","Trigger","Cancel","Scope","Repeat","RepeatInterval","IgnoreRepeated","Identity","ExtraXML","ConditionExtraXML"] {
            d := IRTIClone(canonical)
            switch change {
                case "Interval": d.Interval += 1234
                case "Trigger": d.Trigger.Target := "@Self"
                case "Cancel": d.Cancel := IRTCondition("EFFECT_LOST"),d.Cancel.EffectGuid := "999"
                case "Scope": d.Scope := "ANY"
                case "Repeat": d.Repeat := 2
                case "RepeatInterval": d.RepeatInterval := 32100
                case "IgnoreRepeated": d.IgnoreRepeated := true
                case "Identity": d.Name .= " custom",d.Id := d.Folder Chr(31) d.Name
                case "ExtraXML": d.ImportExtraXML := "<privateRule>true</privateRule>"
                case "ConditionExtraXML": d.Trigger.ImportExtraXML := "<privateCondition>true</privateCondition>"
            }
            V48Assert(IRTIsTitaxEstimate(d),"fixture retains a stale marker before reclassification")
            before := IRTSerializeXML([d]),IRTRepairBundled([d])
            V48Assert(!IRTIsTitaxEstimate(d) && IRTTimerDisplayName(d)==d.Name && IRTSerializeXML([d])==before,
                "custom " change " keeps every serialized choice and loses the stale estimate restriction")
        }
        d := IRTIClone(canonical),d.Interval := 23000,IRTRepairBundled([d])
        s := V65TimerState([d]),s.InCombat := true,s.Boss := "Trandoshan Squad"
        s.Mode := d.Trigger.Mode,s.Size := "Eight"
        IRTStart(s,d,100000),V65BPump(s,118000)
        V48Assert(s.Alerts.Length=1 && s.Alerts[1].Name==d.Name " in 5",
            "customized same-name Titax rule retains its own center warning behavior")
    }
}

V656TitaxEstimateRoundtrip()
{
    defs := V656TitaxDefinitions()
    defs[1].ShowCenter := true,defs[1].Color := "987654",defs[1].ShowSource := true
    defs[2].ShowCenter := false,defs[2].Enabled := false
    xml := IRTSerializeXML(defs)
    V48Assert(!InStr(xml,"IRTTitaxEstimate") && !InStr(xml," (estimate)"),
        "derived marker and display suffix never enter the saved XML or dependency identities")
    parsed := IRTParseXML(xml,IRTBDefinitions()).Definitions
    V48Assert(parsed.Length=2 && !IRTIsTitaxEstimate(parsed[1]) && !IRTIsTitaxEstimate(parsed[2]),
        "XML parse owns plain definitions; it cannot import an estimate-policy marker")
    IRTRepairBundled(parsed)
    V48Assert(IRTIsTitaxEstimate(parsed[1]) && IRTIsTitaxEstimate(parsed[2]),
        "already-repaired HM and NiM templates regain estimate behavior after parsing")
    V48Assert(IRTSerializeXML(parsed)==xml && parsed[1].ShowCenter && !parsed[2].ShowCenter,
        "roundtrip reclassification preserves opposite saved center choices and every serialized field")
}

V656TitaxEstimateSavedLibrary()
{
    V652TimerDefaultsIsolated(V656TitaxEstimateSavedLibraryCase)
}

V656TitaxEstimateSavedLibraryCase(path)
{
    global IRT,Audio
    defs := V656TitaxDefinitions(),hmId := defs[1].Id,nimId := defs[2].Id
    defs[1].Enabled := false,defs[1].ShowCenter := true,defs[1].Color := "123456"
    defs[2].ShowCenter := false
    IRTWriteLibrary(defs),saved := FileRead(path ".timers.xml","UTF-8")
    IRT.Enabled := false,queueBefore := Audio.Queue.Length,IRTLoadLibrary()
    V48Assert(IRTIsTitaxEstimate(IRT.ById[hmId]) && IRTIsTitaxEstimate(IRT.ById[nimId]),
        "effective saved-library load restores estimate policy on both persisted repaired templates")
    V48Assert(!IRT.ById[hmId].Enabled && IRT.ById[hmId].ShowCenter && IRT.ById[hmId].Color="123456"
        && !IRT.ById[nimId].ShowCenter,"saved disabled, color and opposite center choices survive library loading")
    V48Assert(FileRead(path ".timers.xml","UTF-8")==saved,
        "startup derives estimate policy without rewriting the sidecar")
    IRT.ById[nimId].Interval := 23456,IRTWriteLibrary(IRT.Definitions)
    customized := FileRead(path ".timers.xml","UTF-8"),IRTLoadLibrary()
    V48Assert(IRTIsTitaxEstimate(IRT.ById[hmId]) && !IRTIsTitaxEstimate(IRT.ById[nimId])
        && IRT.ById[nimId].Interval=23456,"a persisted custom NiM duration wins while the untouched HM template remains an estimate")
    V48Assert(FileRead(path ".timers.xml","UTF-8")==customized && !FileExist(path),
        "custom-library load preserves saved bytes and never creates the production settings file")
    V48Assert(!IRT.Enabled && IRT.Active.Count=0 && IRT.Alerts.Length=0 && Audio.Queue.Length=queueBefore,
        "isolated load never enables timers, starts an encounter, displays warnings or submits audio")
}

; Manual native regressions. Detached audio state and a fake clock only.
; No normal app launch, speech/HTTP, gameplay input, saved settings or raid events.
V657WithPull(callback)
{
    global IPull, Audio, RouteStates, Preview, testClock, soundboardsEnabled
    global audioOutputMode, inputMode, chatOpen, IrisBench, DiagnosticBuffer
    global inLogDispatch, logReadBusy, dispatchAudioAllowed, CurrentRecord
    global bossNumpadCalloutsEnabled, autoBossCalloutsEnabled, universalCalloutsEnabled
    global activeBoss, bridgeVoice, tythCalloutsEnabled
    old := {Pull:IPull,Audio:Audio,Routes:RouteStates,Preview:Preview,Clock:testClock,
        Master:soundboardsEnabled,Route:audioOutputMode,Mode:inputMode,Chat:chatOpen,
        Bench:IrisBench,Diagnostics:DiagnosticBuffer,Dispatch:inLogDispatch,ReadBusy:logReadBusy,
        DispatchAllowed:dispatchAudioAllowed,Record:CurrentRecord,Manual:bossNumpadCalloutsEnabled,
        Auto:autoBossCalloutsEnabled,Universal:universalCalloutsEnabled,Boss:activeBoss,
        Voice:bridgeVoice,Tyth:tythCalloutsEnabled}
    try {
        ; Keep the original five-second regressions explicit; the app defaults to three.
        IPull := IPullNewState(),IPull.Seconds := 5,testClock := 100000
        Audio := {Queue:[],Current:"",Http:"",Serial:0,Epoch:123,Busy:false,
            Fault:"",Paused:false,NetFailures:0,RetryAt:0,PollAt:0,Events:Map(),LastAccepted:Map()}
        RouteStates := Map(),Preview := {Gui:"",Items:[],Visible:false,Message:""}
        IrisBench := {Active:false},DiagnosticBuffer := [],bridgeVoice := ""
        soundboardsEnabled := true,audioOutputMode := "KenkuBridgeTTS",inputMode := "CombatLog",chatOpen := false
        inLogDispatch := false,logReadBusy := false,dispatchAudioAllowed := true,CurrentRecord := ""
        bossNumpadCalloutsEnabled := true,autoBossCalloutsEnabled := true
        universalCalloutsEnabled := true,tythCalloutsEnabled := true,activeBoss := "None"
        callback.Call()
    }
    finally {
        IPull := old.Pull,Audio := old.Audio,RouteStates := old.Routes,Preview := old.Preview
        testClock := old.Clock,soundboardsEnabled := old.Master,audioOutputMode := old.Route
        inputMode := old.Mode,chatOpen := old.Chat,IrisBench := old.Bench,DiagnosticBuffer := old.Diagnostics
        inLogDispatch := old.Dispatch,logReadBusy := old.ReadBusy,dispatchAudioAllowed := old.DispatchAllowed
        CurrentRecord := old.Record,bossNumpadCalloutsEnabled := old.Manual
        autoBossCalloutsEnabled := old.Auto,universalCalloutsEnabled := old.Universal
        activeBoss := old.Boss,bridgeVoice := old.Voice,tythCalloutsEnabled := old.Tyth
    }
}

V657PullQueued()
{
    global Audio
    found := []
    for item in Audio.Queue
        if item.Kind="Pull"
            found.Push(item)
    return found
}

V657PullSequence() => V657WithPull(V657PullSequenceBody)
V657PullSequenceBody()
{
    global IPull,Audio,testClock
    V48Assert(IPullStart(),"manual pull starts on the existing TTS route")
    start := testClock
    for offset,phrase in ["Pulling in 5","4","3","2","1"] {
        testClock := start+(offset-1)*1000,IPullTick(),items := V657PullQueued()
        V48Assert(items.Length=1,"exactly one current number is queued")
        item := items[1]
        V48Assert(Trim(item.Phrase," .")=phrase,"countdown says the requested number at its anchored second")
        V48Assert(item.Expires<=testClock+1000 && item.Expires>testClock,"number has a bounded deadline within its second")
        V48Assert(AudioItemEnabled(item),"fresh countdown item passes the real worker validation")
        IPullTick()
        V48Assert(V657PullQueued().Length=1,"another poll cannot repeat the same number")
        Audio.Queue := []
    }
    testClock := start+5000,IPullTick()
    V48Assert(!IPull.Active && V657PullQueued().Length=0,"five-second completion produces no late number or unrequested extra call")
    testClock += 60000,IPullTick()
    V48Assert(V657PullQueued().Length=0,"finished sequence never replays")
}

V657PullLateTicks() => V657WithPull(V657PullLateTicksBody)
V657PullLateTicksBody()
{
    global IPull,Audio,testClock
    IPullStart(),start := testClock,old := V657PullQueued()[1]
    testClock := start+2351,IPullTick()
    V48Assert(!AudioItemEnabled(old),"old five cannot survive a delayed callback")
    V48Assert(V657PullQueued().Length=0,"a number over 350ms late is skipped without a backlog")
    testClock := start+3000,IPullTick(),items := V657PullQueued()
    V48Assert(items.Length=1 && Trim(items[1].Phrase," .")="2","next punctual beat follows the original clock")
    testClock := start+16000,IPullTick()
    V48Assert(!IPull.Active && V657PullQueued().Length=0,"sleep or a long busy period ends the countdown without catch-up")
    testClock += 1000,IPullTick()
    V48Assert(V657PullQueued().Length=0,"another timer poll cannot resurrect missed numbers")
}

V657PullCancelAndRestart() => V657WithPull(V657PullCancelAndRestartBody)
V657PullCancelAndRestartBody()
{
    global IPull,Audio,testClock
    IPullStart(),old := V657PullQueued()[1],run := IPull.Run
    IPullToggle()
    V48Assert(!IPull.Active && V657PullQueued().Length=0,"same hotkey cancels instead of starting an overlapping pull")
    V48Assert(!AudioItemEnabled(old),"cancel invalidates an already detached old item")
    testClock += 25,IPullToggle(),items := V657PullQueued()
    V48Assert(IPull.Active && items.Length=1 && IPull.Run!=run,"next deliberate press creates exactly one fresh run")
    V48Assert(!AudioItemEnabled(old),"restarting cannot revalidate the previous run")
    unrelated := items[1].Clone(),unrelated.Kind := "Manual",unrelated.Key := "unrelated"
    Audio.Queue.Push(unrelated),Audio.Current := unrelated
    IPullCancel("test stop")
    V48Assert(Audio.Queue.Length=1 && ObjPtr(Audio.Queue[1])=ObjPtr(unrelated),"cancel removes only pull queue items")
    V48Assert(!unrelated.Cancel,"cancel does not stop another callout already speaking")
}

V657PullCurrentExpiry() => V657WithPull(V657PullCurrentExpiryBody)
V657PullCurrentExpiryBody()
{
    global IPull,Audio,testClock
    IPullStart(),start := testClock,PumpAudio(),old := Audio.Current
    V48Assert(IsObject(old) && old.Kind="Pull" && old.Stage="tts","existing native worker dispatches the pull using isolated TTS guard")
    testClock := start+1000
    V48Assert(!AudioItemEnabled(old),"currently speaking previous number becomes invalid at the next second")
    IPullTick(),PumpAudio()
    V48Assert(old.Cancel,"worker requests cancellation of an overlong old number")
    V48Assert(V657PullQueued().Length<=1,"old speech cannot create a queue of countdown numbers")
    PumpAudio()
    V48Assert(!IsObject(Audio.Current) || Trim(Audio.Current.Phrase," .")="4","worker cannot resume the stale five")
    IPullCancel("test stop"),PumpAudio()
    V48Assert(!IPull.Active && V657PullQueued().Length=0,"manual stop invalidates the current sequence")
}

V657PullContextCancellation() => V657WithPull(V657PullContextCancellationBody)
V657PullContextCancellationBody()
{
    global IPull,Audio,testClock,soundboardsEnabled,inputMode,audioOutputMode,chatOpen
    for change in ["mute","epoch","mode","route","chat","fault"] {
        soundboardsEnabled := true,inputMode := "CombatLog",audioOutputMode := "KenkuBridgeTTS",chatOpen := false
        RouteState().Fault := "",RouteState().Paused := false,RouteState().RetryAt := 0
        V48Assert(IPullStart(),"fresh sequence starts before each cancellation scenario")
        old := V657PullQueued()[1]
        switch change {
            case "mute": soundboardsEnabled := false
            case "epoch": Audio.Epoch += 1
            case "mode": inputMode := "Hotkey"
            case "route": audioOutputMode := "KenkuSoundboard"
            case "chat": chatOpen := true
            case "fault": RouteState().Fault := "synthetic transport fault"
        }
        testClock += 100,IPullTick()
        V48Assert(!IPull.Active && V657PullQueued().Length=0,"context loss cancels the countdown: " change)
        V48Assert(!AudioItemEnabled(old),"old item fails worker validation after " change)
        soundboardsEnabled := true,inputMode := "CombatLog",audioOutputMode := "KenkuBridgeTTS",chatOpen := false
        RouteState().Fault := "",RouteState().Paused := false,RouteState().RetryAt := 0
        testClock += 1000,IPullTick()
        V48Assert(!IPull.Active && V657PullQueued().Length=0,"restoring context never resumes an abandoned countdown: " change)
    }
}

V657PullStartGuards() => V657WithPull(V657PullStartGuardsBody)
V657PullStartGuardsBody()
{
    global IPull,Audio,soundboardsEnabled,audioOutputMode,chatOpen,testClock
    V48Assert(IPullInputAllowed(false,true,true,false),"live pull accepts focused game with closed chat")
    V48Assert(!IPullInputAllowed(false,true,false,false),"live pull rejects missing game focus")
    V48Assert(!IPullInputAllowed(false,true,true,true),"live pull rejects typing in game chat")
    V48Assert(IPullInputAllowed(true,true,false,true),"only explicit preview may bypass focus and chat")
    V48Assert(!IPullInputAllowed(true,false,false,false),"preview input policy retains master mute")
    soundboardsEnabled := false
    V48Assert(!IPullStart() && !IPull.Active,"F11 mute prevents starting")
    soundboardsEnabled := true,chatOpen := true
    V48Assert(!IPullStart() && !IPull.Active,"manual shortcut is blocked in chat even in Combat Log mode")
    chatOpen := false,audioOutputMode := "KenkuSoundboard"
    V48Assert(!IPullStart() && !IPull.Active,"soundboard route does not receive an invented recording or silently reroute")
    V48Assert(audioOutputMode="KenkuSoundboard","rejected pull leaves the selected audio route unchanged")
    audioOutputMode := "KenkuBridgeTTS",RouteState().Paused := true
    V48Assert(!IPullStart(),"paused audio cannot accept a timed countdown")
    RouteState().Paused := false,RouteState().Fault := "synthetic fault"
    V48Assert(!IPullStart(),"faulted audio cannot accept a timed countdown")
    RouteState().Fault := "",RouteState().RetryAt := testClock+2000
    V48Assert(!IPullStart(),"transport backoff cannot defer and then replay the beginning")
    RouteState().RetryAt := 0,Audio.Current := {Kind:"Test"}
    V48Assert(!IPullStart(),"existing audio preview prevents a live pull from taking over")
    Audio.Current := ""
    V48Assert(V657PullQueued().Length=0,"every rejected start leaves the queue clean")
}

V657PullBusyWorker() => V657WithPull(V657PullBusyWorkerBody)
V657PullBusyWorkerBody()
{
    global IPull,Audio,testClock,logReadBusy
    IPullStart(),start := testClock,old := V657PullQueued()[1]
    logReadBusy := true,PumpAudio()
    V48Assert(!IsObject(Audio.Current) && V657PullQueued().Length=1,"busy log batch can defer dispatch without creating another stream")
    testClock := start+351,PumpAudio()
    V48Assert(!IsObject(Audio.Current) && V657PullQueued().Length=0,"dispatch deadline removes a queued number before it can be heard late")
    V48Assert(!AudioItemEnabled(old),"detached copy cannot bypass the dispatch deadline")
    logReadBusy := false,testClock := start+1000,IPullTick(),PumpAudio()
    V48Assert(IsObject(Audio.Current) && Trim(Audio.Current.Phrase," .")="4","worker recovery speaks only the current number")
    current := Audio.Current,taunt := current.Clone()
    taunt.Kind := "Player",taunt.Key := "Taunt",taunt.Priority := 3,Audio.Queue := [taunt]
    ConsiderAudioPreemption()
    V48Assert(current.Cancel && Audio.Queue.Length=1 && Audio.Queue[1].Key="Taunt",
        "higher-priority call interrupts a number without requeueing it as boss/manual speech")
    Audio.Current := "",Audio.Queue := [],testClock := start+2000,IPullTick()
    V48Assert(V657PullQueued().Length=1 && Trim(V657PullQueued()[1].Phrase," .")="3",
        "after interruption the next beat retains its original deadline")
}

V657PullManualIndependence() => V657WithPull(V657PullManualIndependenceBody)
V657PullManualIndependenceBody()
{
    global IPull,Audio,inputMode,activeBoss,bossNumpadCalloutsEnabled
    global autoBossCalloutsEnabled,universalCalloutsEnabled,tythCalloutsEnabled
    global NBCandle,NBOrder,IRT
    candle := NBCandle,order := NBOrder,timers := IRT
    activeBoss := "None",bossNumpadCalloutsEnabled := false,autoBossCalloutsEnabled := false
    universalCalloutsEnabled := false,tythCalloutsEnabled := false
    for mode in ["CombatLog","Hotkey"] {
        inputMode := mode
        V48Assert(IPullStart(),"pull is independent of boss and ability callout switches in " mode)
        item := V657PullQueued()[1]
        V48Assert(AudioItemEnabled(item),"worker validates dedicated manual pull without selecting a boss")
        IPullCancel("test stop")
    }
    V48Assert(ObjPtr(NBCandle)=ObjPtr(candle) && ObjPtr(NBOrder)=ObjPtr(order)
        && ObjPtr(IRT)=ObjPtr(timers),"manual countdown does not replace raid or imported timer state")
    V48Assert(Audio.Events.Count=0 && Audio.LastAccepted.Count=0,"manual countdown does not alter log deduplication or ability cooldown history")
}

V657PullPreviewIsolation() => V657WithPull(V657PullPreviewIsolationBody)
V657PullPreviewIsolationBody()
{
    global IPull,Audio,chatOpen,soundboardsEnabled,testClock
    chatOpen := true
    V48Assert(IPullStart(true),"explicit preview may start outside normal chat input policy")
    item := V657PullQueued()[1]
    V48Assert(IPull.Preview && AudioEnvironmentAllowedFor(item) && AudioItemEnabled(item),"preview exception belongs to this explicit pull preview")
    V48Assert(PreviewAudioBusy(),"countdown preview holds the ordinary audio preview gate")
    Audio.Queue := []
    V48Assert(PreviewAudioBusy(),"quiet gap between preview numbers still blocks live callout entry")
    Audio.Current := item,StopCalloutPreview()
    V48Assert(Audio.Current.Cancel,"stopping preview requests stop of its own current audio")
    V48Assert(!AudioItemEnabled(item),"cancelled preview cannot keep speaking or regain validity")
    Audio.Current := "",soundboardsEnabled := false
    V48Assert(!IPullStart(true),"explicit preview never bypasses F11 mute")
    soundboardsEnabled := true,chatOpen := false
    V48Assert(IPullStart(true),"preview can be deliberately restarted after unmute")
    Audio.Epoch += 1,testClock += 50,IPullTick()
    V48Assert(!IPull.Active && V657PullQueued().Length=0,"preview takeover or global cancellation invalidates the whole sequence")
}

; Pull shortcut preferences and hidden native UI. No real hotkey registration,
; gameplay input, live audio, timers, or production settings are exercised.
V657PullUIIsolated(callback)
{
    global IPull,SETTINGS_FILE,Persist,persistenceTestMode,IUB
    before := {Pull:IPull,Settings:SETTINGS_FILE,Persist:Persist,PersistenceTest:persistenceTestMode,IUB:IUB}
    path := A_Temp "\Iris_v657_pull_ui_" DllCall("GetCurrentProcessId") "_" A_TickCount ".ini"
    try {
        IPull := IPullNewState(),SETTINGS_FILE := path,IUB := IUBNewState(),persistenceTestMode := false
        Persist := {Pending:Map(),Last:Map(),Busy:false,Serial:0,Error:"",Status:"test"}
        callback.Call(path)
    }
    finally {
        if IPMGuiAlive(IPull.Gui)
            IPull.Gui.Destroy()
        IPull := before.Pull,SETTINGS_FILE := before.Settings,Persist := before.Persist,
            persistenceTestMode := before.PersistenceTest,IUB := before.IUB
        try FileDelete(path)
    }
}

V657PullShortcutChoices()
{
    choices := IPullKeyChoices(),seen := Map()
    V48Assert(choices.Length=3 && choices[1].Key="^F9" && choices[1].Label="Ctrl+F9","chosen Ctrl+F9 is the default manual pull shortcut")
    V48Assert(choices[2].Key="+F9" && choices[3].Key="","optional Shift+F9 and disabled choices are available")
    for choice in choices {
        V48Assert(choice.Key!="F9" && choice.Key!="^+F9" && !seen.Has(choice.Key),"pull choices cannot replace boss cycling or IrisBench capture")
        seen[choice.Key] := true
    }
    for value in ["",0,-1,4,999,"1.0","abc"]
        V48Assert(IPullKeyChoice(value)=1,"invalid saved shortcut selects the safe default")
    V48Assert(IPullKeyChoice("2")=2 && IPullKeyChoice(3)=3,"valid persisted indices retain their chosen shortcuts")
    choices[1].Key := "F9"
    V48Assert(IPullKeyChoices()[1].Key="^F9","callers cannot mutate the shared shortcut definitions")
}

V657PullShortcutPolicy()
{
    V48Assert(IPullHotkeyPolicy(false,true,false),"manual pull input is accepted when game is focused and chat is closed")
    V48Assert(!IPullHotkeyPolicy(false,true,true),"open chat blocks the manual pull shortcut")
    V48Assert(!IPullHotkeyPolicy(false,false,false),"other applications do not capture the shortcut")
    V48Assert(!IPullHotkeyPolicy(false,false,true),"unfocused chat cannot activate the shortcut")
    V48Assert(!IPullHotkeyPolicy(true,true,false),"self-test mode cannot activate a gameplay shortcut")
    V48Assert(!IPullKeyContext(),"native diagnostics keep the actual hotkey context disabled")
}

V657PullPreferenceIsolation()
{
    V657PullUIIsolated(V657PullPreferenceIsolationCase)
}

V657PullPreferenceIsolationCase(path)
{
    global IPull
    IPullLoadSettings()
    V48Assert(IPull.KeyChoice=1 && !FileExist(path),"reading missing preferences uses Ctrl+F9 without creating settings")
    IniWrite("keep",path,"OtherFeature","Setting")
    IniWrite(2,path,"IrisPullTimer","KeyChoice")
    original := FileRead(path)
    IPullLoadSettings()
    V48Assert(IPull.KeyChoice=2 && FileRead(path)=original,"startup reads a saved shortcut without rewriting the INI")
    IPullSaveKeyPreference(3)
    V48Assert(IniRead(path,"IrisPullTimer","KeyChoice")="3","pull shortcut save writes only its own section and key")
    V48Assert(IniRead(path,"OtherFeature","Setting")="keep","unrelated preferences survive a shortcut change")
    IniWrite("invalid",path,"IrisPullTimer","KeyChoice"),IPullLoadSettings()
    V48Assert(IPull.KeyChoice=1 && IniRead(path,"IrisPullTimer","KeyChoice")="invalid","invalid preference fallback is read-only until Apply")
}

V657PullHiddenUI()
{
    V657PullUIIsolated(V657PullHiddenUICase)
}

V657PullHiddenUICase(path)
{
    global IPull,Audio
    foreground := WinExist("A"),queued := Audio.Queue.Length
    V48Assert(IPullOpen() && IPMGuiAlive(IPull.Gui),"pull settings construct a real native dialog")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IPull.Gui.Hwnd,"Int") && WinExist("A")=foreground,"diagnostic dialog remains hidden and preserves focus")
    V48Assert(IPull.KeyControl.Value=1 && IPull.StatusControl.Text=IPull.Status,"dialog shows the selected shortcut and current countdown status")
    IPull.Status := "Pulling in 3",IPullRefreshStatus()
    V48Assert(IPull.StatusControl.Text="Pulling in 3","status refresh reflects countdown progress")
    original := IPull.Gui.Hwnd,IPullOpen()
    V48Assert(IPull.Gui.Hwnd=original,"reopening settings reuses its existing native dialog")
    IPull.Active := true,IPull.Preview := false,IPullClose()
    V48Assert(IPull.Active,"closing settings does not cancel a live manual countdown")
    IPull.Active := false
    IPull.Gui.Destroy(),IPullOpen()
    V48Assert(IPMGuiAlive(IPull.Gui) && IPull.KeyControl.Value=1,"destroyed settings windows rebuild valid controls")
    V48Assert(Audio.Queue.Length=queued && !FileExist(path) && IPull.Registered=0,"opening settings neither plays audio nor saves preferences nor binds keys")
}

V657PullBindingIsolation()
{
    V657PullUIIsolated(V657PullBindingIsolationCase)
}

V657PullBindingIsolationCase(path)
{
    global IPull,Audio
    queued := Audio.Queue.Length
    IPull.Registered := 2,IPull.KeyChoice := 2
    V48Assert(!IPullBindKey(1) && IPull.Registered=2 && IPull.KeyChoice=2,"self-test refuses physical rebinding without altering selected state")
    IPullOpen(),IPull.KeyControl.Choose(1)
    V48Assert(!IPullApplyKey() && IPull.KeyControl.Value=2,"failed shortcut application restores the saved selector value")
    last := IPull.LastHotkey
    V48Assert(!IPullHotkey() && IPull.LastHotkey=last && !IPull.Active,"self-test hotkey handler cannot start or cancel a countdown")
    V48Assert(!FileExist(path) && Audio.Queue.Length=queued,"blocked diagnostic binding cannot write preferences or submit speech")
}

; Native hidden-menu fixtures only. No menu tracking, keyboard/mouse input,
; live callbacks, audio, application launch or saved-setting changes.
V658MenuCallback(*)
{
    global V658MenuCalls
    V658MenuCalls += 1
}

V658MenuFixture(callback)
{
    global IUM,IUB,V658MenuCalls
    oldMenu := IUM,oldTheme := IUB
    IUM := IUMNewState(),IUB := IUBNewState(),V658MenuCalls := 0
    g := Gui("+ToolWindow -DPIScale"),other := Gui("+ToolWindow -DPIScale")
    bar := MenuBar(),m := Menu(),nested := Menu(),otherBar := MenuBar()
    nested.Add("&Nested action",V658MenuCallback)
    m.Add("&Open`tCtrl+O",V658MenuCallback),m.Add("&Other",V658MenuCallback)
    m.Add("&Disabled",V658MenuCallback),m.Disable("&Disabled")
    m.Add("&Checked",V658MenuCallback),m.Check("&Checked")
    m.Add(),m.Add("Tools && options",nested)
    m.Add("E&xit",V658MenuCallback)
    bar.Add("&File",m),bar.Add("&Help",nested),g.MenuBar := bar
    otherBar.Add("Shared",m),other.MenuBar := otherBar
    f := {Gui:g,Other:other,Bar:bar,Menu:m,Nested:nested,OtherBar:otherBar}
    try callback.Call(f)
    finally {
        IUMShutdown()
        g.Destroy(),other.Destroy()
        IUM := oldMenu,IUB := oldTheme
        if IUM.Hooks {
            IUM.Hooks := false
            IUMInstallHooks()
        }
    }
}

V658MenuSnapshot(menu,seen := unset)
{
    if !IsSet(seen)
        seen := Map()
    rows := []
    if seen.Has(menu)
        return rows
    seen[menu] := true
    Loop DllCall("User32\GetMenuItemCount","Ptr",menu,"Int") {
        row := IUMReadItem(menu,A_Index-1),row.MenuHandle := menu,row.ItemPosition := A_Index-1
        rows.Push(row)
        if row.Submenu
            for child in V658MenuSnapshot(row.Submenu,seen)
                rows.Push(child)
    }
    return rows
}

V658MenuSame(before,after,ignoreOwnerDraw := true,ignoreState := false)
{
    if before.Length!=after.Length
        return false
    fields := ["Id","Submenu","Data","Text","Bitmap","CheckBitmap","UncheckBitmap","MenuHandle","ItemPosition"]
    for i,row in before {
        other := after[i]
        for key in fields {
            if key="Bitmap" && ignoreOwnerDraw && IUMBrandMatch(row.MenuHandle,row.Id)
                continue ; v65.9 owns only this decoration's temporary row-height bitmap.
            if row.%key%!==other.%key%
                return false
        }
        mask := ignoreOwnerDraw ? ~0x100 : -1
        if (row.Type & mask)!=(other.Type & mask) || (!ignoreState && row.State!=other.State)
            return false
    }
    return true
}

V658MenuCanvas(w := 760,h := 100)
{
    dc := DllCall("Gdi32\CreateCompatibleDC","Ptr",0,"Ptr"),info := Buffer(40,0),bits := 0
    NumPut("UInt",40,"Int",w,"Int",-h,"UShort",1,"UShort",32,info)
    bitmap := DllCall("Gdi32\CreateDIBSection","Ptr",dc,"Ptr",info,"UInt",0,"Ptr*",&bits,"Ptr",0,"UInt",0,"Ptr")
    if !dc || !bitmap {
        if bitmap
            DllCall("Gdi32\DeleteObject","Ptr",bitmap)
        if dc
            DllCall("Gdi32\DeleteDC","Ptr",dc)
        throw Error("Unable to allocate hidden menu test canvas")
    }
    old := DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",bitmap,"Ptr")
    return {DC:dc,Bitmap:bitmap,OldBitmap:old,Bits:bits,W:w,H:h}
}

V658MenuCanvasFree(c)
{
    DllCall("Gdi32\SelectObject","Ptr",c.DC,"Ptr",c.OldBitmap)
    DllCall("Gdi32\DeleteObject","Ptr",c.Bitmap),DllCall("Gdi32\DeleteDC","Ptr",c.DC)
}

V658MenuRect(l,t,r,b)
{
    rect := Buffer(16,0),NumPut("Int",l,"Int",t,"Int",r,"Int",b,rect)
    return rect
}

V658MenuNativeIdentity() => V658MenuFixture(V658MenuNativeIdentityBody)
V658MenuNativeIdentityBody(f)
{
    global IUM
    before := V658MenuSnapshot(f.Bar.Handle)
    V48Assert(IUMApply(f.Gui),"native menu fixture accepts the presentation layer")
    after := V658MenuSnapshot(f.Bar.Handle)
    V48Assert(V658MenuSame(before,after),"styling preserves menu handles, IDs, item data, strings, check bitmaps and state")
    V48Assert(DllCall("User32\GetMenu","Ptr",f.Gui.Hwnd,"Ptr")=f.Bar.Handle,"GUI retains its original menu bar")
    V48Assert(IUM.Items.Count>0 && IUM.Menus.Count>=3,"native menubar and nested dropdowns are registered")
    V48Assert((IUMReadItem(f.Menu.Handle,0).Type & 0x100)!=0,"action remains the same native menu item with ownerdraw enabled")
}

V658MenuNativeDispatch() => V658MenuFixture(V658MenuNativeDispatchBody)
V658MenuNativeDispatchBody(f)
{
    global V658MenuCalls
    item := IUMReadItem(f.Menu.Handle,0),IUMApply(f.Gui)
    DllCall("User32\PostMessageW","Ptr",f.Gui.Hwnd,"UInt",0x111,"UPtr",item.Id,"Ptr",0)
    Sleep(20)
    V48Assert(V658MenuCalls=1,"native WM_COMMAND still reaches the original harmless AHK callback after styling")
    IUMRestore()
    DllCall("User32\PostMessageW","Ptr",f.Gui.Hwnd,"UInt",0x111,"UPtr",item.Id,"Ptr",0)
    Sleep(20)
    V48Assert(V658MenuCalls=2,"restoring native style preserves callback dispatch too")
}

V658MenuDynamicState() => V658MenuFixture(V658MenuDynamicStateBody)
V658MenuDynamicStateBody(f)
{
    IUMApply(f.Gui),original := IUMReadItem(f.Menu.Handle,0)
    f.Menu.Check("&Open`tCtrl+O"),f.Menu.Disable("&Open`tCtrl+O")
    changed := IUMReadItem(f.Menu.Handle,0)
    V48Assert((changed.State & 8)!=0 && (changed.State & 3)!=0,"AHK Check and Disable continue to update the styled native item")
    V48Assert(changed.Id=original.Id && changed.Data=original.Data,"dynamic states do not replace the action identity")
    f.Menu.Uncheck("&Open`tCtrl+O"),f.Menu.Enable("&Open`tCtrl+O")
    changed := IUMReadItem(f.Menu.Handle,0)
    V48Assert((changed.State & 11)=0,"AHK Uncheck and Enable restore the actionable state")
    f.Menu.Rename("&Open`tCtrl+O","&Open another log`tCtrl+O"),IUMApply(f.Gui)
    changed := IUMReadItem(f.Menu.Handle,0)
    V48Assert(changed.Text="&Open another log`tCtrl+O" && changed.Id=original.Id,"reapplication retains a renamed label and original callback ID")
}

V658MenuPolicyAndLabels()
{
    V48Assert(IUMShouldStyle("iris",false),"normal Iris theme enables requested menu appearance")
    V48Assert(!IUMShouldStyle("classic",false),"classic theme retains the native menu appearance")
    V48Assert(!IUMShouldStyle("iris",true),"Windows high contrast retains the native menu appearance")
    p := IUMLabelParts("&File`tCtrl+O")
    V48Assert(p.Plain="File" && StrLower(p.Mnemonic)="f" && p.Accelerator="Ctrl+O","mnemonic and shortcut columns retain their meaning")
    p := IUMLabelParts("Timers && Callouts")
    V48Assert(p.Plain="Timers & Callouts" && p.Mnemonic="","escaped ampersand is literal text, not a shortcut")
    p := IUMLabelParts("A && B &menu")
    V48Assert(p.Plain="A & B menu" && StrLower(p.Mnemonic)="m","escaped ampersand cannot swallow a later real mnemonic")
}

V658MenuRestore() => V658MenuFixture(V658MenuRestoreBody)
V658MenuRestoreBody(f)
{
    global IUB
    before := V658MenuSnapshot(f.Bar.Handle),IUMApply(f.Gui)
    f.Menu.Check("&Open`tCtrl+O"),f.Menu.Disable("&Other")
    changed := V658MenuSnapshot(f.Bar.Handle),IUB.Theme := "classic",IUMApply(f.Gui)
    restored := V658MenuSnapshot(f.Bar.Handle)
    V48Assert(V658MenuSame(before,restored,false,true),"classic fallback restores original native item types and keeps identities")
    V48Assert(V658MenuSame(changed,restored,true),"classic fallback retains current enabled/check states instead of reverting the old snapshot")
    IUB.Theme := "iris",IUMApply(f.Gui),IUMRestore()
    V48Assert(V658MenuSame(restored,V658MenuSnapshot(f.Bar.Handle),false),"multiple theme transitions restore the same native menus")
}

V658MenuSuspendedThemeRoundtrip() => V658MenuFixture(V658MenuSuspendedThemeRoundtripBody)
V658MenuSuspendedThemeRoundtripBody(f)
{
    global IUM,IUB,V658MenuCalls
    before := V658MenuSnapshot(f.Bar.Handle),IUMApply(f.Gui)
    IUB.Theme := "classic",IUMThemeMessage(0,0,0x1A,f.Gui.Hwnd)
    V48Assert(V658MenuSame(before,V658MenuSnapshot(f.Bar.Handle),false),
        "system-theme notification restores native menus when custom styling is disabled")
    V48Assert(IUM.Roots.Count=0 && IUM.SuspendedRoots.Count=1 && IUM.Hooks,
        "temporarily restored roots remain available for a later theme notification")
    f.Menu.Check("&Open`tCtrl+O"),f.Menu.Disable("&Other")
    changed := V658MenuSnapshot(f.Bar.Handle)
    IUB.Theme := "iris",IUMThemeMessage(0,0,0x1A,f.Gui.Hwnd)
    V48Assert(IUM.Roots.Count=1 && IUM.SuspendedRoots.Count=0,
        "returning to the styled theme revives suspended roots without reopening the window")
    V48Assert(V658MenuSame(changed,V658MenuSnapshot(f.Bar.Handle)),
        "theme roundtrip keeps checks and disabled states changed during native fallback")
    IUB.Theme := "classic",IUMThemeMessage(0,0,0x1A,f.Gui.Hwnd),IUMShutdown()
    V48Assert(IUM.SuspendedRoots.Count=0 && !IUM.Hooks,
        "shutdown clears suspended roots and cannot revive a closed styling session")
    V48Assert(V658MenuCalls=0,"theme notifications invoke no menu actions")
}

V658MenuMeasureDpi() => V658MenuFixture(V658MenuMeasureDpiBody)
V658MenuMeasureDpiBody(f)
{
    global IUM
    IUMApply(f.Gui),entry := IUM.Items[IUMReadItem(f.Menu.Handle,0).Id]
    small := IUMMetrics(entry,96),large := IUMMetrics(entry,192)
    V48Assert(small.W>small.LabelWidth+small.AccelWidth && small.H>=24,"menu geometry reserves readable padding and separate accelerator space")
    V48Assert(large.W>small.W && large.H>small.H,"menu rows scale with display DPI")
    top := IUM.Items[IUMReadItem(f.Bar.Handle,0).Id],t := IUMMetrics(top,96)
    V48Assert(t.W>0 && t.H>0 && small.H>0,"menubar and dropdown each have valid native measurement")
    b := Buffer(A_PtrSize=8 ? 32 : 24,0)
    NumPut("UInt",1,b,0),NumPut("UInt",entry.Id,b,8)
    DllCall("User32\SendMessageW","Ptr",f.Gui.Hwnd,"UInt",0x2C,"Ptr",0,"Ptr",b)
    V48Assert(NumGet(b,12,"UInt")>0 && NumGet(b,16,"UInt")>0,"real WM_MEASUREITEM hook fills Windows width and height")
}

V658MenuPaintBounds() => V658MenuFixture(V658MenuPaintBoundsBody)
V658MenuPaintBoundsBody(f)
{
    global IUM
    IUMApply(f.Gui),entry := IUM.Items[IUMReadItem(f.Menu.Handle,0).Id],c := V658MenuCanvas()
    try {
        all := V658MenuRect(0,0,c.W,c.H),rect := {L:16,T:16,R:c.W-16,B:72}
        brush := DllCall("Gdi32\CreateSolidBrush","UInt",0xCC33AA,"Ptr")
        DllCall("User32\FillRect","Ptr",c.DC,"Ptr",all,"Ptr",brush),DllCall("Gdi32\DeleteObject","Ptr",brush)
        DllCall("Gdi32\SetTextColor","Ptr",c.DC,"UInt",0x123456)
        DllCall("Gdi32\SetBkMode","Ptr",c.DC,"Int",2)
        font := DllCall("Gdi32\GetCurrentObject","Ptr",c.DC,"UInt",6,"Ptr")
        IUMPaint(entry,c.DC,rect,1,96)
        V48Assert(DllCall("Gdi32\GetPixel","Ptr",c.DC,"Int",2,"Int",2,"UInt")=0xCC33AA
            && DllCall("Gdi32\GetPixel","Ptr",c.DC,"Int",c.W-2,"Int",80,"UInt")=0xCC33AA,
            "owner drawing leaves pixels outside the supplied menu rectangle unchanged")
        V48Assert(DllCall("Gdi32\GetPixel","Ptr",c.DC,"Int",20,"Int",20,"UInt")!=0xCC33AA,
            "the actual production renderer paints the selected menu row")
        V48Assert(DllCall("Gdi32\GetTextColor","Ptr",c.DC,"UInt")=0x123456
            && DllCall("Gdi32\GetBkMode","Ptr",c.DC,"Int")=2
            && DllCall("Gdi32\GetCurrentObject","Ptr",c.DC,"UInt",6,"Ptr")=font,
            "menu rendering restores the caller's text color, background mode and selected font")
    }
    finally V658MenuCanvasFree(c)
}

V658MenuSharedOwner() => V658MenuFixture(V658MenuSharedOwnerBody)
V658MenuSharedOwnerBody(f)
{
    global IUM
    IUMApply(f.Gui),entry := IUM.Items[IUMReadItem(f.Menu.Handle,3).Id],c := V658MenuCanvas()
    try {
        b := Buffer(A_PtrSize=8 ? 64 : 48,0),p := A_PtrSize=8 ? 24 : 20
        NumPut("UInt",1,b,0),NumPut("UInt",entry.Id,b,8),NumPut("UInt",1,b,12),NumPut("UInt",8,b,16)
        NumPut("Ptr",f.Menu.Handle,b,p),NumPut("Ptr",c.DC,b,p+A_PtrSize)
        r := p+2*A_PtrSize
        NumPut("Int",0,"Int",0,"Int",c.W,"Int",64,b,r)
        before := IUM.Paints
        handled := DllCall("User32\SendMessageW","Ptr",f.Other.Hwnd,"UInt",0x2B,"Ptr",0,"Ptr",b,"Ptr")
        V48Assert(handled!=0 && IUM.Paints>before,"shared submenu is drawn under a different native owner, as with the tray")
        V48Assert(IUMReadItem(f.OtherBar.Handle,0).Submenu=f.Menu.Handle,"alternate owner retains the same shared submenu handle")
        V48Assert((IUMReadItem(f.Menu.Handle,3).State & 8)!=0,"shared drawing does not clear a checked setting")
    }
    finally V658MenuCanvasFree(c)
}

V658MenuSendDraw(hwnd,menu,id,c,top,bottom)
{
    b := Buffer(A_PtrSize=8 ? 64 : 48,0),p := A_PtrSize=8 ? 24 : 20
    NumPut("UInt",1,b,0),NumPut("UInt",id,b,8),NumPut("UInt",1,b,12)
    NumPut("Ptr",menu,b,p),NumPut("Ptr",c.DC,b,p+A_PtrSize)
    NumPut("Int",0,"Int",top,"Int",c.W,"Int",bottom,b,p+2*A_PtrSize)
    return DllCall("User32\SendMessageW","Ptr",hwnd,"UInt",0x2B,"Ptr",0,"Ptr",b,"Ptr")
}

V658MenuFreshStatePaint() => V658MenuFixture(V658MenuFreshStatePaintBody)
V658MenuFreshStatePaintBody(f)
{
    global IUM
    IUMApply(f.Gui),id := IUMReadItem(f.Menu.Handle,0).Id,c := V658MenuCanvas(700,200)
    try {
        V48Assert(V658MenuSendDraw(f.Gui.Hwnd,f.Menu.Handle,id,c,0,64)!=0,"native draw message paints original unchecked state")
        f.Menu.Check("&Open`tCtrl+O")
        V48Assert(V658MenuSendDraw(f.Gui.Hwnd,f.Menu.Handle,id,c,64,128)!=0,"native draw refreshes a newly checked item without rebuilding its menu")
        f.Menu.Disable("&Open`tCtrl+O")
        V48Assert(V658MenuSendDraw(f.Gui.Hwnd,f.Menu.Handle,id,c,128,192)!=0,"native draw refreshes a newly disabled item without rebuilding its menu")
        DllCall("Gdi32\GdiFlush")
        checkedChanges := 0,disabledChanges := 0
        Loop 64 {
            y := A_Index-1
            Loop 40 {
                x := A_Index-1
                if NumGet(c.Bits+(y*c.W+x)*4,0,"UInt")!=NumGet(c.Bits+((y+64)*c.W+x)*4,0,"UInt")
                    checkedChanges += 1
            }
            Loop c.W {
                x := A_Index-1
                if NumGet(c.Bits+((y+64)*c.W+x)*4,0,"UInt")!=NumGet(c.Bits+((y+128)*c.W+x)*4,0,"UInt")
                    disabledChanges += 1
            }
        }
        V48Assert(checkedChanges>8,"fresh checked state actually adds a visible glyph in the native check gutter")
        V48Assert(disabledChanges>8 && (IUM.Items[id].State & 3)!=0,"fresh disabled state actually changes the rendered foreground")
    }
    finally V658MenuCanvasFree(c)
}

V658MenuRepeatLifecycle() => V658MenuFixture(V658MenuRepeatLifecycleBody)
V658MenuRepeatLifecycleBody(f)
{
    global IUM
    before := V658MenuSnapshot(f.Bar.Handle),IUMApply(f.Gui)
    first := {Items:IUM.Items.Count,Menus:IUM.Menus.Count,Fonts:IUM.Fonts.Count,Brushes:IUM.Brushes.Count}
    process := DllCall("Kernel32\GetCurrentProcess","Ptr")
    resources := DllCall("User32\GetGuiResources","Ptr",process,"UInt",0,"UInt")
    Loop 8
        IUMApply(f.Gui)
    V48Assert(IUM.Items.Count=first.Items && IUM.Menus.Count=first.Menus,"reapplying appearance does not duplicate menu registrations")
    V48Assert(IUM.Fonts.Count=first.Fonts && IUM.Brushes.Count=first.Brushes,"repeated application reuses cached drawing resources")
    V48Assert(DllCall("User32\GetGuiResources","Ptr",process,"UInt",0,"UInt")<=resources+2,"repeated styling does not grow native GDI resources")
    IUMShutdown()
    V48Assert(!IUM.Hooks && IUM.Items.Count=0 && IUM.Menus.Count=0
        && IUM.Fonts.Count=0 && IUM.Brushes.Count=0,"shutdown releases hooks, menu registrations, fonts and brushes")
    V48Assert(V658MenuSame(before,V658MenuSnapshot(f.Bar.Handle),false),"shutdown leaves original live menu handles and items intact")
    IUMShutdown()
    V48Assert(DllCall("User32\IsMenu","Ptr",f.Bar.Handle,"Int"),"idempotent cleanup never destroys the AHK-owned menubar")
}

V658MenuWorkspaceIdentity() => V658MenuFixture(V658MenuWorkspaceIdentityBody)
V658MenuWorkspaceIdentityBody(f)
{
    global IP,IC,IIF
    oldIP := IP,oldIC := IC,oldIIF := IIF
    realGui := Gui("+ToolWindow")
    try {
        IP := IPNewApp(),IC := ICNewState(),IIF := IIFNewState()
        IPWAttachMenus(realGui),menu := DllCall("User32\GetMenu","Ptr",realGui.Hwnd,"Ptr")
        before := V658MenuSnapshot(menu),IUMApply(realGui),after := V658MenuSnapshot(menu)
        V48Assert(before.Length>80,"snapshot includes the real workspace's full action and submenu tree")
        V48Assert(V658MenuSame(before,after),"actual File, Interface, Timers/Callouts, Settings, Help and Analysis actions are preserved")
        IUMRestore()
        V48Assert(V658MenuSame(before,V658MenuSnapshot(menu),false),"real workspace menu tree restores exactly without invoking its actions")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",realGui.Hwnd,"Int"),"real-menu inspection stays in a hidden fixture window")
    }
    finally {
        IUMRestore(),realGui.Destroy(),IP := oldIP,IC := oldIC,IIF := oldIIF
    }
}

V658MenuMnemonicDispatch() => V658MenuFixture(V658MenuMnemonicDispatchBody)
V658MenuMnemonicDispatchBody(f)
{
    global V658MenuCalls
    IUMApply(f.Gui)
    result := DllCall("User32\SendMessageW","Ptr",f.Gui.Hwnd,"UInt",0x120,"UPtr",Ord("x") | (0x10<<16),"Ptr",f.Menu.Handle,"Ptr")
    V48Assert((result & 0xFFFF)=6 && (result>>16)=2,"unique explicit mnemonic returns the original native item position")
    result := DllCall("User32\SendMessageW","Ptr",f.Gui.Hwnd,"UInt",0x120,"UPtr",Ord("o") | (0x10<<16),"Ptr",f.Menu.Handle,"Ptr")
    V48Assert((result & 0xFFFF)=0 && (result>>16)=3,"duplicate mnemonics select the first candidate without executing it")
    b := Buffer(A_PtrSize=8 ? 80 : 48,0),NumPut("UInt",b.Size,"UInt",1,b)
    state := IUMReadItem(f.Menu.Handle,0).State,NumPut("UInt",state | 0x80,b,12)
    DllCall("User32\SetMenuItemInfoW","Ptr",f.Menu.Handle,"UInt",0,"Int",true,"Ptr",b)
    result := DllCall("User32\SendMessageW","Ptr",f.Gui.Hwnd,"UInt",0x120,"UPtr",Ord("O") | (0x10<<16),"Ptr",f.Menu.Handle,"Ptr")
    V48Assert((result & 0xFFFF)=1 && (result>>16)=3,"repeated duplicate mnemonic cycles from the current native highlight")
    result := DllCall("User32\SendMessageW","Ptr",f.Gui.Hwnd,"UInt",0x120,"UPtr",Ord("d") | (0x10<<16),"Ptr",f.Menu.Handle,"Ptr")
    V48Assert((result>>16)=0,"disabled item cannot be executed by its mnemonic")
    result := DllCall("User32\SendMessageW","Ptr",f.Gui.Hwnd,"UInt",0x120,"UPtr",Ord("&") | (0x10<<16),"Ptr",f.Menu.Handle,"Ptr")
    V48Assert((result>>16)=0,"escaped ampersand is never treated as a mnemonic")
    V48Assert(V658MenuCalls=0,"simulated mnemonic messages only return navigation decisions; no fixture callback is invoked")
}

V658MenuInvalidHandles() => V658MenuFixture(V658MenuInvalidHandlesBody)
V658MenuInvalidHandlesBody(f)
{
    global IUM
    V48Assert(!IUMApply(0),"missing GUI handle is rejected without installing a menu")
    plain := Gui("+ToolWindow")
    try V48Assert(!IUMApply(plain),"window without a menu is an inert no-op")
    finally plain.Destroy()
    IUMApply(f.Gui),before := IUM.Paints,c := V658MenuCanvas()
    try {
        b := Buffer(A_PtrSize=8 ? 64 : 48,0),NumPut("UInt",4,b,0)
        NumPut("UInt",IUMReadItem(f.Menu.Handle,0).Id,b,8)
        p := A_PtrSize=8 ? 24 : 20
        NumPut("Ptr",f.Menu.Handle,b,p),NumPut("Ptr",c.DC,b,p+A_PtrSize)
        NumPut("Int",0,"Int",0,"Int",c.W,"Int",64,b,p+2*A_PtrSize)
        IUMDrawMessage(0,b.Ptr,0x2B,f.Gui.Hwnd)
        V48Assert(IUM.Paints=before,"menu hook ignores non-menu ownerdraw notifications even if an ID matches")
        NumPut("UInt",1,b,0),NumPut("Ptr",0,b,p)
        IUMDrawMessage(0,b.Ptr,0x2B,f.Gui.Hwnd)
        V48Assert(IUM.Paints=before,"menu hook ignores an unknown menu handle")
    }
    finally V658MenuCanvasFree(c)
    g := Gui("+ToolWindow"),bar := MenuBar(),m := Menu()
    m.Add("Temporary",V658MenuCallback),bar.Add("Temp",m),g.MenuBar := bar
    IUMApply(g),g.Destroy(),IUMRestore()
    V48Assert(DllCall("User32\IsMenu","Ptr",f.Bar.Handle,"Int"),"cleanup tolerates a destroyed owner without deleting other native menus")
}

; Isolated native fixtures: hidden windows, synthetic menus, no input or actions.
; The existing v65.8 diagnostics retain dispatch, painting and submenu coverage.
V659HeaderFixture(action) => V658MenuFixture(V659HeaderWorkspace.Bind(action))

V659HeaderWorkspace(action,unused)
{
    global IP,IC,IIF
    oldIP := IP,oldIC := IC,oldIIF := IIF,g := Gui("+ToolWindow")
    try {
        IP := IPNewApp(),IC := ICNewState(),IIF := IIFNewState()
        IPWAttachMenus(g)
        menu := DllCall("User32\GetMenu","Ptr",g.Hwnd,"Ptr")
        action.Call({Gui:g,Menu:menu,Workspace:IPWState()})
    }
    finally {
        IUMRestore(),g.Destroy(),IP := oldIP,IC := oldIC,IIF := oldIIF
    }
}

; Remove only the identified owned decoration, and normalize positions of the
; original top-level entries when it is present. Every action field is retained.
V659HeaderActionSnapshot(menu,brandId:=0)
{
    global IUM
    snapshot := V658MenuSnapshot(menu),rows := [],position := -1
    id := brandId ? brandId : IUM.Brands.Has(menu) ? IUM.Brands[menu].Id : 0
    for row in snapshot {
        if row.MenuHandle=menu && id && row.Id=id {
            position := row.ItemPosition
            continue
        }
        rows.Push(row)
    }
    if position>=0
        for row in rows
            if row.MenuHandle=menu && row.ItemPosition>position
                row.ItemPosition -= 1
    return rows
}

V659HeaderBrandIdentity() => V659HeaderFixture(V659HeaderBrandIdentityBody)
V659HeaderBrandIdentityBody(f)
{
    global IUM
    before := V659HeaderActionSnapshot(f.Menu)
    V48Assert(IUMApply(f.Gui),"the real menu tree accepts the branded native header")
    V48Assert(DllCall("User32\GetMenuItemCount","Ptr",f.Menu,"Int")=7,
        "one decorative brand accompanies the six existing top menus")
    brand := IUMReadItem(f.Menu,0)
    V48Assert(brand.Id=IUM.Brands[f.Menu].Id && brand.Text="IRIS"
        && (brand.State & 3)!=0 && !brand.Submenu,
        "the brand is a disabled non-popup item, not a seventh menu action")
    labels := ["&File","&Interface","&Timers && Callouts","&Settings","&Help","&Analysis"]
    correct := true
    for position,label in labels
        correct := correct && IUMReadItem(f.Menu,position).Text=label
    V48Assert(correct,"all original menu labels retain their order after the brand")
    V48Assert(V658MenuSame(before,V659HeaderActionSnapshot(f.Menu)),
        "branding preserves every original action ID, callback data, submenu, bitmap and state")
    result := IUMMenuChar(Ord("i"),f.Menu,0x120,f.Gui.Hwnd)
    V48Assert((result & 0xFFFF)=2 && (result>>16)=2,
        "the Interface mnemonic still selects Interface rather than the decorative brand")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",f.Gui.Hwnd,"Int"),
        "constructing and inspecting the production menus never shows a window")
}

V659HeaderNativeLayout() => V659HeaderFixture(V659HeaderNativeLayoutBody)
V659HeaderNativeLayoutBody(f)
{
    f.Gui.Show("Hide w980 h650"),IUMApply(f.Gui)
    dpi := IUMDpi(f.Gui.Hwnd),top := 0,bottom := 0,brandWidth := 0,lastRight := 0,aligned := true
    bounds := Buffer(16,0),DllCall("User32\GetWindowRect","Ptr",f.Gui.Hwnd,"Ptr",bounds)
    Loop 7 {
        rect := Buffer(16,0)
        if !DllCall("User32\GetMenuItemRect","Ptr",f.Gui.Hwnd,"Ptr",f.Menu,"UInt",A_Index-1,"Ptr",rect,"Int")
            throw OSError(A_LastError,,"Native header geometry was unavailable")
        l := NumGet(rect,0,"Int"),t := NumGet(rect,4,"Int"),r := NumGet(rect,8,"Int"),b := NumGet(rect,12,"Int")
        if A_Index=1
            top := t,bottom := b,brandWidth := r-l
        aligned := aligned && t=top && b=bottom && r>l && l>=lastRight
        lastRight := r
    }
    V48Assert(aligned,"Windows lays out the brand and all six menus in one aligned row at minimum width")
    V48Assert(bottom-top>=Round(36*dpi/96),
        "the actual native menu row has full header height rather than the old thin menu-strip height")
    V48Assert(brandWidth>=Round(150*dpi/96),
        "Windows reserves a readable brand block instead of collapsing the logo to the bitmap's narrow width")
    V48Assert(lastRight<=NumGet(bounds,8,"Int"),"the full header fits inside the minimum-width window")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",f.Gui.Hwnd,"Int"),
        "native layout measurement keeps the fixture hidden")
}

V659HeaderThemeOwnership() => V659HeaderFixture(V659HeaderThemeOwnershipBody)
V659HeaderThemeOwnershipBody(f)
{
    global IUM,IUB
    before := V659HeaderActionSnapshot(f.Menu),IUMApply(f.Gui)
    brand := IUMReadItem(f.Menu,0)
    V48Assert(brand.Bitmap!=0,"only the decorative brand supplies the owned native row-height bitmap")
    actionBitmaps := true
    Loop 6
        actionBitmaps := actionBitmaps && !IUMReadItem(f.Menu,A_Index).Bitmap
    V48Assert(actionBitmaps,"original top-level actions receive no synthetic bitmap")
    f.Workspace.FileMenu.Check("&Open log...`tCtrl+O")
    changed := V659HeaderActionSnapshot(f.Menu),IUB.Theme := "classic",IUMApply(f.Gui)
    V48Assert(DllCall("User32\GetMenuItemCount","Ptr",f.Menu,"Int")=7
        && V658MenuSame(changed,V659HeaderActionSnapshot(f.Menu)),
        "Classic retains the native brand and all action identities and current checks")
    nativeBrand := IUMReadItem(f.Menu,0)
    V48Assert(nativeBrand.Id=brand.Id && !nativeBrand.Bitmap && !(nativeBrand.Type & 0x100),
        "Classic detaches the owned row-height bitmap and restores the brand's native drawing")
    process := DllCall("Kernel32\GetCurrentProcess","Ptr")
    IUB.Theme := "iris",IUMApply(f.Gui)
    resources := DllCall("User32\GetGuiResources","Ptr",process,"UInt",0,"UInt")
    Loop 6 {
        IUB.Theme := "classic",IUMApply(f.Gui)
        IUB.Theme := "iris",IUMApply(f.Gui)
    }
    V48Assert(DllCall("User32\GetMenuItemCount","Ptr",f.Menu,"Int")=7
        && V658MenuSame(changed,V659HeaderActionSnapshot(f.Menu)),
        "repeated theme switches retain a single brand without replacing or duplicating actions")
    V48Assert(DllCall("User32\GetGuiResources","Ptr",process,"UInt",0,"UInt")<=resources+2,
        "repeated row-height bitmap removal and recreation do not accumulate native drawing resources")
    IUMShutdown()
    V48Assert(DllCall("User32\GetMenuItemCount","Ptr",f.Menu,"Int")=7
        && !IUMReadItem(f.Menu,0).Bitmap
        && V658MenuSame(changed,V659HeaderActionSnapshot(f.Menu,brand.Id),true),
        "shutdown releases the height bitmap while preserving the native brand and current actions")
    V48Assert(IUM.Brands.Count=0,"shutdown releases retained brand ownership records")
}

V659HeaderSetBitmap(menu,position,bitmap)
{
    o := IUMOffsets(),info := Buffer(o.ItemSize,0)
    NumPut("UInt",info.Size,"UInt",0x80,info),NumPut("Ptr",bitmap,info,o.Bitmap)
    if !DllCall("User32\SetMenuItemInfoW","Ptr",menu,"UInt",position,"Int",true,"Ptr",info,"Int")
        throw OSError(A_LastError,,"Could not set the independent fixture bitmap")
}

V659HeaderForeignBitmap() => V659HeaderFixture(V659HeaderForeignBitmapBody)
V659HeaderForeignBitmapBody(f)
{
    global IUB
    bitmap := DllCall("Gdi32\CreateBitmap","Int",2,"Int",2,"UInt",1,"UInt",32,"Ptr",0,"Ptr")
    if !bitmap
        throw Error("Could not allocate the independently owned menu bitmap")
    ; Use a submenu action so decoration insertion/removal never changes its index.
    menu := f.Workspace.FileMenu.Handle
    try {
        V659HeaderSetBitmap(menu,0,bitmap),before := IUMReadItem(menu,0)
        IUMApply(f.Gui),after := IUMReadItem(menu,0)
        V48Assert(after.Bitmap=bitmap && after.Id=before.Id && after.Data=before.Data,
            "native header styling leaves an independently owned action bitmap untouched")
        IUB.Theme := "classic",IUMApply(f.Gui),IUMShutdown(),after := IUMReadItem(menu,0)
        info := Buffer(A_PtrSize=8 ? 32 : 24,0)
        V48Assert(after.Bitmap=bitmap && DllCall("Gdi32\GetObjectW","Ptr",bitmap,"Int",info.Size,"Ptr",info,"Int")>0,
            "theme fallback and shutdown neither detach nor delete another component's bitmap")
    }
    finally {
        V659HeaderSetBitmap(menu,0,0)
        V48Assert(DllCall("Gdi32\DeleteObject","Ptr",bitmap,"Int"),
            "the fixture remains the owner responsible for releasing its independent bitmap")
    }
}

V659HeaderOwnerPruning() => V658MenuFixture(V659HeaderOwnerPruningBody)
V659HeaderOwnerPruningBody(f)
{
    global IUM,IUB,V658MenuCalls
    classicGui := Gui("+ToolWindow"),classicBar := MenuBar(),classicMenu := Menu()
    classicMenu.Add("Harmless fixture",V658MenuCallback),classicBar.Add("File",classicMenu)
    try {
        IUB.Theme := "classic",IUMAttachBrand(classicBar,classicGui.Hwnd),classicGui.MenuBar := classicBar
        classicHandle := classicBar.Handle,classicBrand := IUM.Brands[classicHandle]
        IUMApply(classicGui)
        V48Assert(classicBrand.Hwnd=classicGui.Hwnd && !classicBrand.Bitmap,
            "a Classic-only header records its owner without allocating a styling bitmap")
        classicReplacement := MenuBar(),classicReplacementMenu := Menu()
        classicReplacementMenu.Add("Harmless replacement fixture",V658MenuCallback)
        classicReplacement.Add("File",classicReplacementMenu),IUMAttachBrand(classicReplacement,classicGui.Hwnd)
        classicGui.MenuBar := classicReplacement,IUMApply(classicGui)
        V48Assert(!IUM.Brands.Has(classicHandle) && IUM.Brands.Has(classicReplacement.Handle)
            && IUM.Brands[classicReplacement.Handle].Attached && !IUM.Brands[classicReplacement.Handle].Bitmap,
            "replacing a Classic-only menu on a live window prunes its old brand ownership without allocating a bitmap")
        classicGui.Destroy(),IUMPrune()
        V48Assert(!IUM.Brands.Has(classicReplacement.Handle),
            "pruning releases branding records for owners closed before Iris styling was ever applied")
    }
    finally {
        try classicGui.Destroy()
    }

    IUB.Theme := "iris",IUMAttachBrand(f.Bar,f.Gui.Hwnd)
    oldMenu := f.Bar.Handle,before := V658MenuSnapshot(oldMenu),IUMApply(f.Gui),oldBrand := IUM.Brands[oldMenu]
    V48Assert(oldBrand.Bitmap!=0,"the replacement fixture begins with an owned header bitmap")
    replacement := MenuBar(),replacementMenu := Menu()
    replacementMenu.Add("Replacement fixture action",V658MenuCallback)
    replacement.Add("Replacement",replacementMenu),IUMAttachBrand(replacement,f.Gui.Hwnd)
    f.Gui.MenuBar := replacement,IUMApply(f.Gui)
    V48Assert(!IUM.Brands.Has(oldMenu) && !oldBrand.Bitmap && IUM.Brands.Has(replacement.Handle),
        "replacing a live window's menu releases the old brand bitmap and ownership record")
    V48Assert(V658MenuSame(before,V658MenuSnapshot(oldMenu),false),
        "the detached menu remains alive with its original native item fields restored")
    V48Assert(DllCall("User32\GetMenu","Ptr",f.Gui.Hwnd,"Ptr")=replacement.Handle,
        "pruning does not detach the window's replacement menu")
    action := IUMReadItem(replacementMenu.Handle,0)
    DllCall("User32\PostMessageW","Ptr",f.Gui.Hwnd,"UInt",0x111,"UPtr",action.Id,"Ptr",0),Sleep(20)
    V48Assert(V658MenuCalls=1,"the replacement menu still dispatches its original harmless native callback")
}

; Isolated raid clock model tests. No live log reader, overlay, audio, gameplay
; hotkey or user settings are touched. Persistence uses a private temporary file.
V6510RunFixture(key := "df",age := 0)
{
    s := IRNNewState(),d := s.Catalog[key]
    player := IPActor("@Run Test#1"),boss := IPActor("First Boss {" d.BossIds[1] "}:17")
    return {State:s,Event:{Kind:"Damage",Source:player,Target:boss,Amount:0},
        Context:{AreaId:d.AreaIds[1],ModeId:d.ModeIds[1],AgeMs:age},Utc:13000000000000,Tick:100000,Stamp:400000}
}

V6510RunFeed(f,live := true,fresh := true,source := "private-log")
{
    return IRNObserve(f.State,f.Event,f.Context,f.Stamp,f.Utc,f.Tick,live,fresh,source)
}

V6510RunCatalog()
{
    c := IRNCatalog()
    for key,minutes in Map("ec",120,"tfb",120,"snv",120,"df",60,"dp",60,"gods",90,"dxun",90,"r4",40) {
        V48Assert(c.Has(key) && c[key].Minutes=minutes,"reviewed operation limit is retained for " key)
        V48Assert(c[key].Auto && c[key].PositionStart=(key="gods" || key="dxun" || key="r4"),"modern clocks use position estimates; legacy clocks use boss contact")
    }
}

V6510RunAutomatic()
{
    for key in ["ec","tfb","snv","df","dp"] {
        f := V6510RunFixture(key),s := f.State
        V48Assert(V6510RunFeed(f),"fresh scoped first-boss attack starts " key)
        snap := IRNSnapshot(s,f.Utc,f.Tick)
        V48Assert(snap.Running && snap.Key=key && snap.Remaining=s.Catalog[key].Minutes*60000,"correct run and full limit")
        V48Assert(snap.Estimated && snap.Basis="First boss attack","observed attack start stays clearly estimated")
        f.Stamp += 1000,f.Tick += 1000,f.Utc += 1000
        V48Assert(!V6510RunFeed(f) && IRNSnapshot(s,f.Utc,f.Tick).Remaining=s.Duration-1000,"repeat boss hits do not restart")
    }
}

V6510RunScope()
{
    for mode in ["","836045448953651","836045448953652","836045448953654"] {
        f := V6510RunFixture(),f.Context.ModeId := mode
        V48Assert(!V6510RunFeed(f) && f.State.Status="Armed","unknown/story/veteran/16-player never starts MM clock")
    }
    f := V6510RunFixture(),f.Context.AreaId := "wrong"
    V48Assert(!V6510RunFeed(f),"boss id alone cannot override wrong area")
    f := V6510RunFixture(),f.Event.Target := IPActor("Other {999999}:17")
    V48Assert(!V6510RunFeed(f),"trash cannot trigger first-boss clock")
    f := V6510RunFixture(),IRNArm(f.State,"ec")
    V48Assert(!V6510RunFeed(f),"explicitly armed EC does not start on DF")
}

V6510RunHostileEvidence()
{
    for kind in ["Area","Activate","Heal","Enter","Exit","Death","Effect"] {
        f := V6510RunFixture(),f.Event.Kind := kind
        V48Assert(!V6510RunFeed(f),"non-damage " kind " cannot start the raid clock")
    }
    f := V6510RunFixture(),player := f.Event.Source,f.Event.Source := f.Event.Target,f.Event.Target := player
    V48Assert(V6510RunFeed(f),"boss attacking a player is valid even at zero damage")
    f := V6510RunFixture(),f.Event.Source := IPActor("@Run Test#1/Pet {42}:5")
    V48Assert(!V6510RunFeed(f),"companion-only activity is not assumed to be the pull boundary")
}

V6510RunFreshLiveOnly()
{
    f := V6510RunFixture()
    V48Assert(!V6510RunFeed(f,false,true),"hydration or saved replay cannot invent new runs")
    V48Assert(!V6510RunFeed(f,true,false),"stale acquisition cannot invent a fresh run")
    V48Assert(!V6510RunFeed(f,true,true,""),"unknown source is not eligible")
    f.Context.AgeMs := 30001
    V48Assert(!V6510RunFeed(f),"old buffered trigger cannot start a fresh clock")
    f.Context.AgeMs := -1
    V48Assert(!V6510RunFeed(f),"invalid negative age is rejected")
}

V6510RunBufferedTime()
{
    f := V6510RunFixture("df",8000),s := f.State
    V48Assert(V6510RunFeed(f),"fresh buffered event starts")
    V48Assert(IRNSnapshot(s,f.Utc,f.Tick).Remaining=3592000,"eight seconds of backlog are already spent")
    V48Assert(s.DeadlineUtc=f.Utc+3592000 && s.StartedUtc=f.Utc-8000,"persisted date preserves buffered start")
    f.Stamp := 86400000+1000,f.Tick += 9000,f.Utc += 9000
    V48Assert(!V6510RunFeed(f) && IRNSnapshot(s,f.Utc,f.Tick).Remaining=3583000,"midnight-unwrapped later record cannot restart")
}

V6510RunWipesAndTravel()
{
    f := V6510RunFixture(),s := f.State,V6510RunFeed(f),deadline := s.DeadlineUtc
    for kind in ["Death","Exit","Area","Enter","Damage"] {
        f.Event.Kind := kind,f.Context.AreaId := "other",f.Stamp += 5000,f.Utc += 5000,f.Tick += 5000
        V48Assert(!V6510RunFeed(f,true,true,"next-file"),"wipe/travel/file transition does not change run")
        V48Assert(s.DeadlineUtc=deadline,"original deadline survives " kind)
    }
    V48Assert(IRNSnapshot(s,f.Utc,f.Tick).Remaining=3575000,"out-of-combat travel time is counted")
}

V6510RunSleepAndClockChanges()
{
    s := IRNNewState(),utc := 13000000000000,tick := 100000
    V48Assert(IRNStart(s,"gods",utc,tick),"manual Gods start")
    V48Assert(IRNSnapshot(s,utc+900000,tick+900000).Remaining=4500000,"15 minutes of sleep count")
    V48Assert(IRNSnapshot(s,utc-7200000,tick+900000).Remaining=4500000,"PC clock moving back cannot add runtime")
    V48Assert(IRNSnapshot(s,utc+7200000,tick+900000).Remaining=4500000,"PC clock moving forward cannot erase runtime")
    V48Assert(IRNSnapshot(s,utc+900000,tick-1).Remaining<=s.Duration,"tick regression never exceeds original allowance")
}

V6510RunManualAndRemaining()
{
    for key in ["gods","dxun","r4"] {
        s := IRNNewState(),utc := 13000000000000
        V48Assert(IRNStart(s,key,utc,100000,25*60000,"Entered remaining"),"late manual start supported for " key)
        snap := IRNSnapshot(s,utc+60000,160000)
        V48Assert(snap.Remaining=24*60000 && snap.Elapsed=s.Duration-24*60000,"entered remaining counts down immediately")
        V48Assert(snap.Basis="Entered remaining" && !snap.Estimated,"manual source retained without claiming automatic evidence")
        V48Assert(!IRNStart(s,key,utc,160000),"another manual press cannot restart active clock")
    }
}

V6510RunInvalidInputs()
{
    s := IRNNewState(),utc := 13000000000000
    V48Assert(!IRNStart(s,"missing",utc,0),"unknown operation rejected")
    for remain in [-2,0,5400001,1.5,"abc"]
        V48Assert(!IRNStart(s,"gods",utc,0,remain),"invalid remaining time rejected")
    V48Assert(!IRNStart(s,"gods",-1,0),"invalid date rejected")
    V48Assert(!IRNStart(s,"gods",utc,-1),"invalid monotonic clock rejected")
    V48Assert(!IRNArm(s,"missing"),"unknown arm target rejected")
    V48Assert(s.Status="Armed" && s.Key="","rejected inputs do not mutate idle clock")
}

V6510RunExpiryAndRearm()
{
    f := V6510RunFixture(),s := f.State,V6510RunFeed(f)
    snap := IRNSnapshot(s,f.Utc+4000000,f.Tick+4000000)
    V48Assert(snap.Status="Expired" && snap.Remaining=0,"expiry is shown and clamped")
    f.Utc += 4000000,f.Tick += 4000000,f.Stamp += 4000000
    V48Assert(!V6510RunFeed(f),"first hit after expiry does not restart")
    V48Assert(!IRNStart(s,"gods",f.Utc,f.Tick),"manual restart also requires explicit new run")
    V48Assert(IRNArm(s,"auto") && V6510RunFeed(f),"explicit new run arms future evidence")
}

V6510RunDedupAcrossReset()
{
    f := V6510RunFixture(),s := f.State,V6510RunFeed(f)
    IRNReset(s)
    V48Assert(s.Status="Stopped" && !V6510RunFeed(f),"Reset stops auto observation")
    IRNArm(s,"auto")
    V48Assert(!V6510RunFeed(f),"same consumed timestamp cannot resurrect after arm")
    f.Stamp -= 1
    V48Assert(!V6510RunFeed(f),"earlier replay is also ignored")
    f.Stamp += 2
    V48Assert(V6510RunFeed(f),"future evidence can start an explicitly armed new run")
}

V6510RunFinish()
{
    s := IRNNewState(),utc := 13000000000000,IRNStart(s,"r4",utc,100000)
    V48Assert(IRNFinish(s,utc+1800000,1900000),"explicit confirmed completion latches")
    V48Assert(IRNSnapshot(s,utc+3600000,3700000).Remaining=600000,"completion freezes actual remaining, not whole clock")
    V48Assert(!IRNFinish(s,utc+3600000,3700000),"duplicate completion does not change result")
    V48Assert(!IRNStart(s,"r4",utc+3600000,3700000),"finished run requires explicit new run")
}

V6510RunPrivateFile(callback)
{
    folder := A_Temp "\Iris_Run_Model_" DllCall("GetCurrentProcessId") "_" Random(100000,999999)
    DirCreate(folder)
    try callback.Call(folder "\state.ini")
    finally DirDelete(folder,true)
}

V6510RunPersistence() => V6510RunPrivateFile(V6510RunPersistenceBody)
V6510RunPersistenceBody(path)
{
    f := V6510RunFixture("df",5000),s := f.State,V6510RunFeed(f)
    V48Assert(IRNSaveState(s,path,f.Utc+60000,f.Tick+60000),"private state saved atomically")
    restored := IRNLoadState(path,f.Utc+120000,2000)
    V48Assert(restored.Key="df" && restored.Status="Running","reload restores the same operation: " restored.DebugError)
    V48Assert(IRNSnapshot(restored,f.Utc+120000,2000).Remaining=3475000,"offline time is deducted on restart")
    V48Assert(restored.Seen.Has("private-log") && restored.Seen["private-log"]=f.Stamp,"consumed evidence survives restart")
    V48Assert(!FileExist(path ".tmp"),"successful save leaves no unfinished state file")
    expired := IRNLoadState(path,f.Utc+7200000,2000)
    V48Assert(IRNSnapshot(expired,f.Utc+7200000,2000).Status="Expired","old saved run is expired, never granted a new hour")
}

V6510RunPersistenceReset() => V6510RunPrivateFile(V6510RunPersistenceResetBody)
V6510RunPersistenceResetBody(path)
{
    f := V6510RunFixture(),V6510RunFeed(f),IRNReset(f.State)
    V48Assert(IRNSaveState(f.State,path),"reset state saved")
    restored := IRNLoadState(path,f.Utc,10)
    V48Assert(restored.Status="Stopped","reload cannot rearm a stopped run")
    IRNArm(restored,"auto"),f.State := restored
    V48Assert(!V6510RunFeed(f),"persisted dedup prevents old start after reset/reload/arm")
}

V6510RunPersistenceCorruption() => V6510RunPrivateFile(V6510RunPersistenceCorruptionBody)
V6510RunPersistenceCorruptionBody(path)
{
    utc := 13000000000000
    FileAppend("[RaidRun]`nSchema=999`n",path,"UTF-8")
    s := IRNLoadState(path,utc,1000)
    V48Assert(s.Status="Stopped" && s.Error!="","corrupt schema fails closed instead of silently auto-arming")
    s := IRNNewState(),IRNStart(s,"gods",utc,1000),IRNSaveState(s,path)
    IniWrite(-5,path,"RaidRun","DeadlineUtc")
    bad := IRNLoadState(path,utc,1000)
    V48Assert(bad.Status="Stopped" && bad.Error!="","impossible saved date rejected")
    IRNSaveState(s,path),IniWrite("XYZ",path,"RaidRun","Key")
    bad := IRNLoadState(path,utc,1000)
    V48Assert(bad.Status="Stopped","malformed encoded identity rejected")
}

V6510RunSavedWallShift() => V6510RunPrivateFile(V6510RunSavedWallShiftBody)
V6510RunSavedWallShiftBody(path)
{
    utc := 13000000000000,s := IRNNewState(),IRNStart(s,"gods",utc,100000)
    V48Assert(IRNSaveState(s,path,utc-3600000,100000+600000),"save uses current monotonic remaining despite wall jump")
    restored := IRNLoadState(path,utc-3600000+60000,1000)
    V48Assert(IRNSnapshot(restored,utc,1000).Remaining=4740000,"reload deducts offline minute from saved 80-minute remainder")
}

V6510RunEvidenceBounds()
{
    s := IRNNewState()
    Loop 24
        IRNRemember(s,"source " A_Index,A_Index)
    V48Assert(s.Seen.Count=16,"evidence memory is bounded")
    IRNRemember(s,"source 24",1)
    V48Assert(s.Seen["source 24"]=24,"older evidence cannot lower dedup watermark")
    name := "@Cîryndà | a=b`n[other]"
    V48Assert(IRNUnhex(IRNHex(name))==name,"private persistence encoding preserves Unicode without INI injection")
}

V6510RunLateAttach()
{
    f := V6510RunFixture(),s := f.State
    V48Assert(IRNObserveHistory(s,f.Event,f.Context,"private-log"),"silent history records that the first boss was already fought")
    V48Assert(s.Status="Armed" && s.Key="","history does not start a clock")
    f.Stamp += 1000
    V48Assert(!V6510RunFeed(f),"next fresh hit in an already running boss fight cannot grant a full duration")
    V48Assert(IRNArm(s,"df") && V6510RunFeed(f),"explicit New run clears the late-attach restriction")
}

V6510RunDiagnosticSaveGuard()
{
    s := IRNNewState()
    V48Assert(!IRNSaveState(s,A_ScriptDir "\user-settings-test.ini"),"manual diagnostics refuse writes outside their temp folder")
    V48Assert(!FileExist(A_ScriptDir "\user-settings-test.ini"),"rejected diagnostic save creates no file")
}

V6510RunBestiaOpener()
{
    f := V6510RunFixture("dp"),boss := f.Event.Target
    f.Event := {Kind:"Other",Source:boss,Target:boss.Clone(),ActionId:"836045448945477",
        AbilityId:"3297821918756864",EffectId:"3297821918757137"}
    original := f.Event.Clone()
    V48Assert(V6510RunFeed(f),"recorded exact Bestia opening self effect starts DP before immune damage")
    for field in ["ActionId","AbilityId","EffectId"] {
        f.State := IRNNewState(),f.Event := original.Clone(),f.Event.%field% := "999"
        V48Assert(!V6510RunFeed(f),"wrong Bestia " field " cannot trigger")
    }
    for field in ["Source","Target"] {
        f.State := IRNNewState(),f.Event := original.Clone(),f.Event.%field% := IPActor("Other {999999}:17")
        V48Assert(!V6510RunFeed(f),"Bestia marker requires correct " field)
    }
    f.State := IRNNewState(),f.Event := original.Clone(),f.Event.Target := IPActor("First Boss {3273941900591104}:18")
    V48Assert(!V6510RunFeed(f),"same NPC id on a different instance is not a self effect")
    f.State := IRNNewState(),f.Event := original.Clone(),f.Context.AreaId := "wrong"
    V48Assert(!V6510RunFeed(f),"Bestia opener remains scoped to DP area")
    f.Context.AreaId := f.State.Catalog["dp"].AreaIds[1],f.Context.ModeId := "836045448953652"
    V48Assert(!V6510RunFeed(f),"Bestia opener remains scoped to Master mode")
    f.Context.ModeId := f.State.Catalog["dp"].ModeIds[1]
    V48Assert(IRNObserveHistory(f.State,f.Event,f.Context,"private-log") && !V6510RunFeed(f),
        "silent Bestia opening marker also blocks a false fresh clock after late attach")
}

; Hidden native fixtures; no hotkey registration, live audio or settings writes.
V6510RunUIFixture(fn)
{
    global IRN,IRNU
    oldRun := IRN,oldUI := IRNU
    try {
        IRN := IRNNewState(),IRNU := IRNUNewState(),IRNU.AutoDetect := false ; retained manual-mode fixtures
        V522Isolated(fn)
    }
    finally {
        IRNUShutdown(),IRN := oldRun,IRNU := oldUI
    }
}

V6510RunUIOverlay() => V6510RunUIFixture(V6510RunUIOverlayCase)
V6510RunUIOverlayCase()
{
    global IPM,IP,IRN
    p := IPM.Panels["RunTimer"],IPM.ParserControls := false
    IPMEnsureGui("RunTimer",0,p)
    IPMRender("RunTimer",{State:"IMPORTED",Duration:999999},p),IPMParserUpdate(p)
    V48Assert(p.ParserButton.Text="Start" && p.ParserAction="Start","raid start is independent of parser controls")
    V48Assert(p.Heading.Text="Time remaining in raid" && p.Meta.Text="Gods","waiting manual raid is plainly labelled")
    V48Assert(!p.ParserDrawn && !DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd),"native diagnostics never expose hit surface or overlay")
    V48Assert((DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt") & 0x08000020)=0x08000020,"locked run body is click-through/no activate")
    V48Assert(IRN.Status="Armed" && !IP.Active,"rendering cannot start clock or combat parser")
    IPM.Editing := true,IPMStyle(p)
    V48Assert(!(DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt") & 0x20),"shared unlock enables movement")
}

V6510RunUIIsolation() => V6510RunUIFixture(V6510RunUIIsolationCase)
V6510RunUIIsolationCase()
{
    global IPM,IP,IRN
    IRNStart(IRN,"r4",IRNUtcMs(),ClockMs(),600000),deadline := IRN.DeadlineUtc
    p := IPM.Panels["RunTimer"],IPMEnsureGui("RunTimer",0,p)
    IPMRender("RunTimer",{State:"IMPORTED",Duration:500},p),IPMParserUpdate(p)
    V48Assert(p.Meta.Text="R-4 (manual)" && InStr(p.Empty.Text,"remaining"),"saved selection displays independent live run")
    V48Assert(p.ParserAction="Stop" && p.ParserButton.Text="Stop","running clock offers Stop instead of another Start")
    IPMRender("RunTimer",{LayoutPreview:true},p)
    V48Assert(p.HeaderStatus="Preview" && InStr(p.Heading.Text,"(Preview)") && IRN.DeadlineUtc=deadline,"layout sample does not change real clock")
    IPMRender("RunTimer",{State:"LIVE LOG"},p),IPMHide()
    V48Assert(IRN.DeadlineUtc=deadline && IRN.Status="Running","hide/preview/saved views do not reset the run")
}

V6510RunUILayout() => V6510RunUIFixture(V6510RunUILayoutCase)
V6510RunUILayoutCase()
{
    global IPM
    p := IPM.Panels["RunTimer"],IPMEnsureGui("RunTimer",0,p)
    for width in [196,246,420] {
        p.Width := width
        for font in [8,10,18] {
            IPM.Font := font,p.Signature := "",IPMRender("RunTimer",{State:"LIVE LOG"},p)
            p.Empty.GetPos(&x,&y,&w,&h)
            V48Assert(x>=0 && y>=p.Layout.Head && x+w<=p.Layout.W && y+h<=p.Layout.H,"countdown fits minimum and large native layouts")
            p.ParserButton.GetPos(&bx,&by,&bw,&bh)
            V48Assert(bx>=0 && bx+bw<=p.Layout.W && bh<=p.Layout.Head,"Start remains within header")
        }
    }
}

V6510RunUIOptions() => V6510RunUIFixture(V6510RunUIOptionsCase)
V6510RunUIOptionsCase()
{
    global IRNU,IRN,IPM
    IRNUOpen(),g := IRNU.Gui
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd) && IRNU.Keys.Length=8,"hidden options offer all eight raids")
    V48Assert(InStr(IRNU.Info.Text,"elevator") && !IPM.Wanted,"opening options leaves overlay hidden")
    IRNU.Remaining.Value := "12:34",IRNUSetRemaining()
    s := IRNUView()
    V48Assert(s.Running && s.Remaining<=754000 && s.Remaining>750000,"entered remaining starts synchronized manual countdown")
    deadline := IRN.DeadlineUtc,IRNU.Remaining.Value := "91:00",IRNUSetRemaining()
    V48Assert(IRN.DeadlineUtc=deadline,"invalid adjustment does not discard the active clock")
    IRNU.Remaining.Value := "10:00",IRNUSetRemaining()
    V48Assert(IRNUView().Remaining<=600000 && IRNUView().Remaining>597000,"explicit valid adjustment replaces remaining")
    IRNUNewRun()
    V48Assert(IRN.Status="Armed" && IRN.ArmedKey=IRNU.Selected,"New run re-arms the selected raid while detection is off")
    IRNU.AutoControl.Value := 1,IRNUAutoChanged(),IRNUNewRun()
    V48Assert(IRN.ArmedKey="auto","New run enables automatic raid selection when detection is on")
}

V6510RunUIInput()
{
    V48Assert(IRNUParseRemaining("1:30:00",5400000)=5400000,"hours input")
    V48Assert(IRNUParseRemaining("40:00",2400000)=2400000,"minutes input")
    for value in ["","0:00","90:60","-1:00","91:00","1.5","abc"]
        V48Assert(IRNUParseRemaining(value,5400000)=-1,"invalid or out of range time rejected")
    V48Assert(IRNUTime(5400000)="1:30:00" && IRNUTime(1)="0:01" && IRNUTime(0)="0:00","readable countdown rounding")
    state := IPMNewState(),state.ParserControls := false
    V48Assert(IRNUHeaderState(state,"RunTimer").ParserControls && !state.ParserControls,"run button policy does not mutate other overlay preferences")
    V48Assert(!IRNUHeaderState(state,"Damage").ParserControls,"regular parser controls retain their preference")
    V48Assert(!IRNUClicked("RunTimer",""),"diagnostics cannot activate real header input")
    batch := {LatestStamp:1000,Tick:10000}
    V48Assert(IRNLiveAge("[23:59:59.000] sample",batch,10500)=2500,"backlog age unwraps midnight and includes acquisition delay")
    V48Assert(IRNLiveAge("invalid",batch,10500)=-1 && IRNLiveAge("[00:00:01.000] sample","",10000)=-1,"unanchored records do not start clocks")
}

; Pure location/context fixtures. No live file, gameplay input, UI, audio or INI
; is opened. Event fields below retain the IDs/times from recorded AreaEntered
; lines; recorder names and coordinates are unnecessary for location matching.
V6511InstanceLine(area,mode := "836045448953655",at := "21:13:41.420")
{
    return "[" at "] [@Instance Test#6511] [] [] [AreaEntered {836045448953664}: "
        . "Operation {" area "}" (mode!="" ? " Difficulty {" mode "}" : "") "] ()"
}

V6511InstanceRecordedAreas()
{
    ; Gods Oct1 line60 precedes the user-confirmed21:13:47 elevator start.
    ; Dxun Jul14 line188 and R4 Jun8 line307 establish the other modern IDs.
    for row in [["gods","833571547775765","836045448953655","21:13:41.420"],
        ["dxun","833571547775792","836045448953655","23:50:38.056"],
        ["r4","833571547775799","836045448953652","19:14:26.704"]] {
        c := IPReaderNext(IPReaderNew("fixture"),V6511InstanceLine(row[2],row[3],row[4]),"fixture")
        d := IRNDetectRaid(c),s := IRNNewState()
        V48Assert(d.Known && d.Supported && d.Key=row[1],"recorded operation and mode identify " row[1])
        V48Assert(d.AreaId=row[2] && d.ModeId=row[3] && d.Name=s.Catalog[row[1]].Name,"location evidence is retained")
        ev := IPParseLine(V6511InstanceLine(row[2],row[3],row[4]))
        V48Assert(!IRNObserve(s,ev,c,1000,13000000000000,1000,true,true,"fixture"),"area identity alone is not automatic clock-start evidence")
        V48Assert(s.Status="Armed" && s.DeadlineUtc=0,"location lookup leaves the clock unstarted")
    }
}

V6511InstanceCatalogModes()
{
    catalog := IRNCatalog()
    for key,def in catalog {
        c := {AreaId:def.AreaIds[1],ModeId:def.ModeIds[1]},d := IRNDetectRaid(c,catalog)
        V48Assert(d.Key=key && d.Known && d.Supported,"all eight configured operation locations match")
        for mode in ["","836045448953651","836045448953653","836045448953654","999999"] {
            c.ModeId := mode,d := IRNDetectRaid(c,catalog)
            V48Assert(d.Key=key && d.Known && !d.Supported,"known area does not permit wrong or missing difficulty")
            V48Assert(d.Mode=IPRModeLabel(mode),"reported difficulty comes from explicit mode evidence")
        }
        c.ModeId := key="r4" ? "836045448953655" : "836045448953652"
        V48Assert(!IRNDetectRaid(c,catalog).Supported,"R4 Veteran and other Master timers cannot borrow each other's mode")
    }
}

V6511InstanceReaderTransitions()
{
    key := "private-live|1",c := IPReaderNew(key)
    c := IPReaderNext(c,V6511InstanceLine("833571547775792","836045448953651"),key)
    V48Assert(IRNDetectRaid(c).Known && !IRNDetectRaid(c).Supported,"actual Dxun Story entry remains unsupported")
    story := c
    c := IPReaderNext(c,V6511InstanceLine("833571547775792"),key)
    V48Assert(IRNDetectRaid(c).Supported,"later explicit Master entry updates detected difficulty")
    V48Assert(story.ModeId="836045448953651","queued prior context is immutable on AreaEntered change")
    c := IPReaderNext(c,V6511InstanceLine("137438989504",""),key)
    d := IRNDetectRaid(c)
    V48Assert(!d.Known && !d.Supported && d.Key="","leaving for Fleet clears raid recognition")
    V48Assert(d.AreaId="137438989504" && d.ModeId="","non-operation context is still accurately exposed")
}

V6511InstanceReaderBoundary()
{
    c := IPReaderNext(IPReaderNew("a|1"),V6511InstanceLine("833571547775765"),"a|1")
    unchanged := IPReaderNext(c,"ordinary unrelated line","a|1")
    V48Assert(unchanged=c && IRNDetectRaid(unchanged).Key="gods","ordinary records preserve the attachment's known area")
    next := IPReaderNext(c,"ordinary unrelated line","a|2")
    V48Assert(!IRNDetectRaid(next).Known && next.Key="a|2","replacement identity cannot inherit previous raid")
    V48Assert(IRNDetectRaid(c).Key="gods","source boundary does not rewrite old queued context")
    next := IPReaderNext(next,V6511InstanceLine("833571547775799","836045448953652"),"a|2")
    V48Assert(IRNDetectRaid(next).Key="r4","new file's own location restores recognition")
    V48Assert(!IRNDetectRaid(IPReaderNew("a|2")).Known,"explicit reset clears location even for same source key")
}

V6511InstanceUntrustedRecords()
{
    c := IPReaderNew("fixture")
    line := StrReplace(V6511InstanceLine("833571547775765"),"@Instance Test#6511","NPC {123}:4")
    c := IPReaderNext(c,line,"fixture")
    V48Assert(!IRNDetectRaid(c).Known,"NPC AreaEntered-looking event is not recorder location")
    c := IPReaderNext(c,"[21:13:41.420] malformed {836045448953664}","fixture")
    V48Assert(!IRNDetectRaid(c).Known,"malformed metadata cannot establish a raid")
    for context in ["",0,{}, {AreaId:"833571547775765"}, {ModeId:"836045448953655"}] {
        d := IRNDetectRaid(context)
        V48Assert(!d.Known && !d.Supported && d.Key="","missing context fields are safely unknown")
    }
}

V6511InstanceSavedIsolation()
{
    global IP
    previous := IP
    try {
        IP := IPNewApp(),IP.ReaderContext := IPReaderNext(IPReaderNew("live|1"),V6511InstanceLine("833571547775765"),"live|1")
        before := IP.ReaderContext
        offline := IPNewData("private saved fixture")
        IPFeedLine(offline,V6511InstanceLine("833571547775799","836045448953652"))
        V48Assert(offline.AreaId="833571547775799" && offline.ModeId="836045448953652","saved replay reads its own real area fields")
        V48Assert(IP.ReaderContext=before && IRNDetectRaid(IP.ReaderContext).Key="gods","saved replay cannot change live detected raid")
        IP.Active := false
        V48Assert(IRNDetectRaid(IP.ReaderContext).Supported,"stopped combat-stat collection does not invalidate reader metadata")
    }
    finally IP := previous
}

; Native hidden UI and real model actions. No physical input, live audio, or INI writes.
V6511RunAutoSafeZone() => V6510RunUIFixture(V6511RunAutoSafeZoneCase)
V6511RunAutoSafeZoneCase()
{
    global IRNU,IRN,IP,IPM
    IRNU.AutoDetect := true
    IP.ReaderContext := {AreaId:"833571547775765",ModeId:"836045448953655"}
    s := IRNUView()
    V48Assert(s.Name="Gods" && s.ReadyKey="gods" && !s.HasRun,"Gods entrance selects raid before any pull/elevator")
    V48Assert(IRN.Status="Armed" && IRN.Changed=0,"detection does not start or change a clock")
    p := IPM.Panels["RunTimer"],IPMEnsureGui("RunTimer",0,p),IPMRender("RunTimer",{State:"IMPORTED"},p)
    V48Assert(p.Meta.Text="Gods" && p.ParserAction="Start","live area selects overlay even when reviewing saved fights")
    IRNUOpen()
    IRNU.AutoControl.GetPos(&cx,&cy,&cw,&ch)
    for ctrl in IRNU.Gui {
        if ctrl.Type="Text" && ctrl.Text="Raid Timer" {
            ctrl.GetPos(&tx,&ty,&tw,&th)
            V48Assert(tx+tw<=cx,"options heading cannot cover automatic-detection checkbox")
        }
    }
    V48Assert(IRNU.Selected="gods" && !IRNU.Choice.Enabled && IRNU.AutoControl.Value,"automatic selection visible in options")
    V48Assert(IRNUStart() && IRN.Key="gods","explicit Start uses detected raid")
}

V6511RunUnknownAndMode() => V6510RunUIFixture(V6511RunUnknownAndModeCase)
V6511RunUnknownAndModeCase()
{
    global IRNU,IRN,IP
    IRNU.AutoDetect := true
    IP.ReaderContext := IPReaderNew("new-log")
    V48Assert(IRNUView().ReadyKey="" && !IRNUStart(),"unknown new source cannot reuse default Gods for automatic selection")
    IP.ReaderContext := {AreaId:"833571547775799",ModeId:"836045448953651"}
    s := IRNUView()
    V48Assert(s.Detected.Known && !s.Detected.Supported && s.ReadyKey="" && !IRNUStart(),"R4 Story does not start Veteran timer")
    IP.ReaderContext.ModeId := "836045448953652"
    V48Assert(IRNUView().ReadyKey="r4" && IRNUStart() && IRN.Duration=2400000,"R4 Veteran selects forty-minute clock")
}

V6511RunTravelPreservesClock() => V6510RunUIFixture(V6511RunTravelPreservesClockCase)
V6511RunTravelPreservesClockCase()
{
    global IRNU,IRN,IP
    IRNU.AutoDetect := true,IP.ReaderContext := {AreaId:"833571547775765",ModeId:"836045448953655"}
    IRNUStart(),deadline := IRN.DeadlineUtc,revision := IRN.Changed
    IP.ReaderContext := {AreaId:"833571547775792",ModeId:"836045448953655"}
    s := IRNUView()
    V48Assert(s.Name="Gods" && s.ReadyKey="gods" && s.Detected.Key="dxun","travel updates detection without relabelling active Gods run")
    V48Assert(IRN.DeadlineUtc=deadline && IRN.Changed=revision,"travel cannot reset or replace the clock")
    IRNUOpen()
    V48Assert(!IRNU.Choice.Enabled && !IRNU.AutoControl.Enabled,"active raid cannot be silently switched by options")
    IRNUStop()
    V48Assert(IRNUView().Name="Dxun" && IRNUView().ReadyKey="dxun" && IRN.Status="Stopped","after Stop next Start uses new detected raid, still stopped")
    IP.ReaderContext := IPReaderNew("another-source")
    V48Assert(IRNUView().ReadyKey="" && IRN.Status="Stopped","reset reader loses detection, not the Stop state")
}

V6511RunStopDisarms() => V6510RunUIFixture(V6511RunStopDisarmsCase)
V6511RunStopDisarmsCase()
{
    global IRN,IRNU,IPM
    IRNUStart(),p := IPM.Panels["RunTimer"],IPMEnsureGui("RunTimer",0,p)
    plan := IRNUHeaderPlan(IRNUView())
    V48Assert(plan.Action="Stop","running header offers Stop")
    IRNUStop(),revision := IRN.Changed
    f := V6510RunFixture(),f.State := IRN
    V48Assert(IRN.Status="Stopped" && !V6510RunFeed(f),"Stop disarms later legacy first-boss triggers")
    IPMRender("RunTimer",{State:"LIVE LOG"},p),IPMParserUpdate(p)
    V48Assert(p.Empty.Text="Stopped" && p.ParserAction="Start" && IRN.Changed=revision,"stopped overlay offers explicit Start without auto rearming")
    V48Assert(IRNUStart() && IRN.Status="Running","explicit Start resumes user control with a new clock")
    IRNUStop(),IRNU.AutoDetect := true,IRNUNewRun()
    V48Assert(IRN.Status="Armed" && V6510RunFeed(f),"only explicit New run/reset re-enables legacy automatic start")
}

V6511RunHeaderStaleAndPreview() => V6510RunUIFixture(V6511RunHeaderStaleAndPreviewCase)
V6511RunHeaderStaleAndPreviewCase()
{
    global IRNU,IRN,IP
    IRNU.AutoDetect := true,IP.ReaderContext := {AreaId:"833571547775765",ModeId:"836045448953655"}
    first := IRNUHeaderPlan(IRNUView())
    IP.ReaderContext.AreaId := "833571547775792"
    second := IRNUHeaderPlan(IRNUView())
    V48Assert(first.Action="Start" && second.Action="Start" && first.Token!=second.Token,"old displayed raid cannot start a different detected raid on stale click")
    IRNUStart(),running := IRNUHeaderPlan(IRNUView()),IRNUStop(),IRNUStart()
    V48Assert(running.Token!=IRNUHeaderPlan(IRNUView()).Token,"replaced run retires previous Stop click token")
    deadline := IRN.DeadlineUtc,preview := IRNUHeaderPlan(IRNUView(true),true)
    V48Assert(preview.Action="" && preview.Text="Preview" && IRN.DeadlineUtc=deadline,"preview cannot offer live Start/Stop")
    IRN.AnchorRemaining := 0
    V48Assert(IRNUHeaderPlan(IRNUView()).Action="Stop","expired run can be cleared with Stop")
}

V6511RunManualOverride() => V6510RunUIFixture(V6511RunManualOverrideCase)
V6511RunManualOverrideCase()
{
    global IRNU,IRN,IP
    IRNU.AutoDetect := true,IP.ReaderContext := {AreaId:"833571547775792",ModeId:"836045448953655"}
    IRNUOpen(),IRNU.AutoControl.Value := 0,IRNUAutoChanged()
    V48Assert(!IRNU.AutoDetect && IRNU.Choice.Enabled && IRNU.Selected="dxun","unchecking detect retains current raid as manual choice")
    for i,key in IRNU.Keys {
        if key="r4"
            IRNU.Choice.Choose(i)
    }
    IRNUChoose()
    V48Assert(IRNUView().ReadyKey="r4" && IRN.Status="Armed","manual selection neither starts nor resets the clock")
    IRNU.AutoControl.Value := 1,IRNUAutoChanged()
    V48Assert(IRNUView().ReadyKey="dxun" && !IRNU.Choice.Enabled,"re-enabling detect restores actual live raid")
}

; Private model/native UI only. No live reader, settings, audio or hotkeys.
V66PositionLine(x := 815.3,y := 1841.78,z := 232.88,source := "@Run Test#66",target := "=")
{
    return IPDemoLine(1000,source "|(" x "," y "," z ",90)|(100/100)",target,"Activate",0)
}

V66PositionEvent(line)
{
    ev := IPParseLine(line)
    V48Assert(IsObject(ev),"position fixture decodes as a combat-log event")
    return IRNAnnotatePositions(ev,line)
}

V66PositionFixture(key := "gods")
{
    coords := key="gods" ? [815.3,1841.78,232.88] : (key="dxun" ? [-334.88,141.92,0.35] : [285.89,14.25,427.36])
    s := IRNNewState(),d := s.Catalog[key]
    return {State:s,Event:V66PositionEvent(V66PositionLine(coords*)),
        Context:{AreaId:d.AreaIds[1],ModeId:d.ModeIds[1],AgeMs:0},Utc:13000000000000,Tick:100000,Stamp:400000}
}

V66PositionRecordedArrivals()
{
    for key,rows in Map("gods",[[815.07,1857.04,232.48],[815.24,1842.82,232.44],[815.30,1841.78,232.88]],
        "dxun",[[-334.88,141.92,0.35],[-339.05,136.39,0.37]],"r4",[[285.89,14.25,427.36],[280.64,14.47,427.36]]) {
        for coords in rows {
            f := V66PositionFixture(key),f.Event := V66PositionEvent(V66PositionLine(coords*))
            V48Assert(V6510RunFeed(f),"recorded arrival region starts scoped " key " estimate")
            V48Assert(f.State.Estimated && f.State.Basis="First position past start","position clock remains explicitly estimated")
            V48Assert(f.State.StartedUtc=f.Utc,"no invented elevator/crossing backdating is applied")
        }
    }
    for coords in [[63.84,1553.43,229.61],[103.23,1566.19,233.42],[105.01,1567.43,233.69]] {
        f := V66PositionFixture(),f.Event := V66PositionEvent(V66PositionLine(coords*))
        V48Assert(!V6510RunFeed(f),"Oct1 safe-zone positions before the user's elevator start do not start timer")
    }
}

V66PositionBounds()
{
    for row in [["gods",805,1825,230,true],["gods",825,1860,240,true],["gods",804.99,1840,235,false],
        ["gods",815,1860.01,235,false],["gods",815,1840,229.99,false],
        ["dxun",-343,142,0,false],["dxun",-343,141.99,0,true],["dxun",-364,120,0,true],
        ["dxun",-364,120,3.01,false],["dxun",-320,120,0,false],
        ["r4",288,14,427,false],["r4",287.99,14,427,true],["r4",280,23.01,427,false],["r4",280,14,423.99,false]]
        V48Assert(IRNPositionPastStart(row[1],{X:row[2],Y:row[3],Z:row[4]})=row[5],"entrance bounds respect exact edges for " row[1])
    V48Assert(!IRNPositionPastStart("gods",{X:"missing",Y:1840,Z:235}) && !IRNPositionPastStart("unknown",{X:815,Y:1840,Z:235}),"malformed coordinates and unknown raids fail closed")
}

V66PositionActors()
{
    for token in ["NPC {66}:1","@Owner#7/Companion {66}:1","@NoId","@Zero#0"] {
        f := V66PositionFixture(),f.Event := V66PositionEvent(V66PositionLine(815,1840,235,token))
        V48Assert(!V6510RunFeed(f),"only identified players start timer: " token)
    }
    f := V66PositionFixture(),f.Event := V66PositionEvent(V66PositionLine(104,1566,233,"@Safe#1","@Arrived#2|(815,1840,235,0)|(100/100)"))
    V48Assert(V6510RunFeed(f),"target player position counts even while source player remains in safe zone")
    ev := V66PositionEvent(V66PositionLine())
    V48Assert(ev.RunPositions.Length=1,"self target is not duplicated")
    f := V66PositionFixture(),line := IPDemoLine(1000,"@NoCoordinates#1","=","Activate",0,false,-1,"Fake [@Decoy#9|(815,1840,235,0)|(100/100)]")
    f.Event := V66PositionEvent(line)
    V48Assert(!V6510RunFeed(f),"a coordinate-shaped ability label cannot start a run")
}

V66PositionScopeAndAge()
{
    for key in ["gods","dxun","r4"] {
        f := V66PositionFixture(key)
        V48Assert(!V6510RunFeed(f,false,true) && !V6510RunFeed(f,true,false),"saved/stale replay never starts " key)
        f.Context.ModeId := "836045448953651"
        V48Assert(!V6510RunFeed(f),"story mode cannot start timed run")
        f.Context.ModeId := "836045448953654"
        V48Assert(!V6510RunFeed(f),"16-player context cannot start supported 8-player clock")
        f.Context.ModeId := f.State.Catalog[key].ModeIds[1],f.Context.AgeMs := 30001
        V48Assert(!V6510RunFeed(f),"old buffered position is not a fresh start")
        f.Context.AgeMs := 1234
        V48Assert(V6510RunFeed(f) && f.State.AnchorRemaining=f.State.Duration-1234,"buffer age is deducted from estimated start")
    }
}

V66PositionHistoryAndStop()
{
    f := V66PositionFixture()
    V48Assert(IRNObserveHistory(f.State,f.Event,f.Context,"private-log") && f.State.Status="Armed","historical arrival blocks instead of starting clock")
    V48Assert(!V6510RunFeed(f),"fresh later arrival cannot restart historical run")
    IRNArm(f.State,"gods")
    V48Assert(V6510RunFeed(f),"explicit new run re-enables observation")
    old := f.State.DeadlineUtc,f.Tick += 5000,f.Utc += 5000,f.Stamp += 5000
    V48Assert(!V6510RunFeed(f) && f.State.DeadlineUtc=old,"repeat positions keep existing clock")
    IRNReset(f.State)
    V48Assert(!V6510RunFeed(f) && f.State.Status="Stopped","Stop remains disarmed even on future arrival")
    f := V66PositionFixture(),f.Event := IPParseLine(IPDemoLine(1000,"@P#1","Trash {66}:1","Damage",10))
    V48Assert(!V6510RunFeed(f) && f.State.HistoryBlocked.Count=1,"missing arrival followed by combat blocks a late full timer")
    f.Event := V66PositionEvent(V66PositionLine()),f.Stamp += 1000
    V48Assert(!V6510RunFeed(f),"returning through the entrance after combat cannot manufacture a fresh run")
    f := V66PositionFixture("dxun"),f.Event := IPParseLine(IPDemoLine(1000,"@P#1","Flesh Eating Shriek {4297170614222848}:1","Damage",10))
    V48Assert(!V6510RunFeed(f) && !f.State.HistoryBlocked.Count,"Dxun entrance trash before the line does not suppress the later crossing")
    f.Event := V66PositionEvent(V66PositionLine(-334.88,141.92,0.35)),f.Stamp += 1000
    V48Assert(V6510RunFeed(f),"Dxun can start after pre-line trash cleanup")
    for key in ["dxun","r4"] {
        f := V66PositionFixture(key),id := f.State.Catalog[key].BossIds[1]
        f.Event := IPParseLine(IPDemoLine(1000,"@P#1","First boss {" id "}:1","Damage",10))
        V48Assert(!V6510RunFeed(f) && f.State.HistoryBlocked.Count=1,"first boss blocks a missed modern start, without supplying a false fresh timer")
    }
}

V66PositionPersistence() => V6510RunPrivateFile(V66PositionPersistenceBody)
V66PositionPersistenceBody(path)
{
    f := V66PositionFixture("dxun"),V6510RunFeed(f)
    V48Assert(IRNSaveState(f.State,path,f.Utc,f.Tick),"position estimate saves privately")
    restored := IRNLoadState(path,f.Utc+30000,1000)
    V48Assert(restored.Status="Running" && restored.Estimated && restored.Basis="First position past start","restart retains estimated basis")
    V48Assert(IRNRemaining(restored,f.Utc+30000,1000)=f.State.Duration-30000,"restart deducts elapsed time without resetting")
}

V66PositionPrefilter() => V6510RunUIFixture(V66PositionPrefilterBody)
V66PositionPrefilterBody()
{
    global IP,IRN
    IP.ReaderContext := {AreaId:"833571547775765",ModeId:"836045448953655"}
    V48Assert(IRNMayStartLine(V66PositionLine()),"modern self buff is eligible without damage or boss ID")
    IRN.HistoryBlocked["gods|private-source"] := true
    V48Assert(!IRNMayStartLine(V66PositionLine(),"private-source") && IRNMayStartLine(V66PositionLine(),"different-source"),"already-blocked source avoids redundant warm-up position parsing")
    IRNReset(IRN)
    V48Assert(!IRNMayStartLine(V66PositionLine()),"stopped timer avoids position parsing entirely")
    IRNArm(IRN),IP.ReaderContext.ModeId := "836045448953652"
    V48Assert(!IRNMayStartLine(V66PositionLine()),"unsupported mode avoids position parsing")
}

V66PositionHiddenUI() => V6510RunUIFixture(V66PositionHiddenUIBody)
V66PositionHiddenUIBody()
{
    global IRN,IRNU,IPM
    f := V66PositionFixture(),V6510RunFeed(f),IRN := f.State
    IRNUEnsureUI(),IRNURefreshInfo(),IRNURefresh()
    V48Assert(InStr(IRNU.Info.Text,"It can start late") && InStr(IRNU.Status.Text,"Estimated"),"UI explains uncertainty and offers correction")
    p := IPM.Panels["RunTimer"],IPMEnsureGui("RunTimer",0,p),IPMRender("RunTimer",{State:"IMPORTED"},p)
    V48Assert(p.Meta.Text="Gods (estimated)" && !DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd),"hidden overlay displays estimate even while reviewing a saved log")
}

V66RunManualArmModel()
{
    s := IRNNewState(),s.Seen["prior"] := 1234,s.HistoryBlocked["gods|prior"] := true
    V48Assert(IRNSelectArmedRaid(s,false,"r4") && s.ArmedKey="r4","manual raid narrows pending automatic start")
    V48Assert(s.Seen["prior"]=1234 && s.HistoryBlocked.Has("gods|prior"),"selection preserves consumed and historical start evidence")
    revision := s.Changed
    V48Assert(!IRNSelectArmedRaid(s,false,"r4") && s.Changed=revision,"same selection does not churn state")
    V48Assert(!IRNSelectArmedRaid(s,false,"unknown") && s.ArmedKey="r4","invalid selection cannot broaden automatic scope")
    V48Assert(IRNSelectArmedRaid(s,true,"r4") && s.ArmedKey="auto","detection restores automatic raid selection")
    IRNReset(s)
    V48Assert(!IRNSelectArmedRaid(s,false,"dxun") && s.Status="Stopped" && s.ArmedKey="","changing selection cannot undo Stop")
    IRNStart(s,"gods",13000000000000,1000),deadline := s.DeadlineUtc
    V48Assert(!IRNSelectArmedRaid(s,false,"r4") && s.Key="gods" && s.DeadlineUtc=deadline,"selection cannot replace or restart a running clock")
    IRNFinish(s,13000000001000,2000)
    V48Assert(!IRNSelectArmedRaid(s,true,"r4") && s.Status="Finished","finished run stays latched until explicit reset")
}

V66RunManualArmUI() => V6510RunUIFixture(V66RunManualArmUIBody)
V66RunManualArmUIBody()
{
    global IRNU,IRN,IP
    IRNU.AutoDetect := true,IP.ReaderContext := {AreaId:"833571547775792",ModeId:"836045448953655"}
    IRNUOpen(),IRNU.AutoControl.Value := 0,IRNUAutoChanged()
    V48Assert(IRNU.Selected="dxun" && IRN.ArmedKey="dxun","turning detection off keeps visible current raid and pending scope together")
    for i,key in IRNU.Keys
        if key="r4"
            IRNU.Choice.Choose(i)
    IRNUChoose()
    f := V66PositionFixture("dxun"),f.State := IRN
    V48Assert(IRN.ArmedKey="r4" && IRNUView().ReadyKey="r4" && !V6510RunFeed(f),"other raid's position cannot override manual dropdown choice")
    IRNUNewRun()
    V48Assert(IRN.ArmedKey="r4" && IRN.Status="Armed" && !V6510RunFeed(f),"New run/reset retains manual raid scope")
    r := V66PositionFixture("r4"),r.State := IRN
    V48Assert(V6510RunFeed(r) && IRN.Key="r4","matching actual raid can start the manually selected clock")
    IRNUStop(),IRNU.AutoControl.Value := 1,IRNUAutoChanged()
    V48Assert(IRN.Status="Stopped","re-enabling detection alone does not re-arm Stop")
    IRNUNewRun(),f.Stamp += 1000
    V48Assert(IRN.ArmedKey="auto" && V6510RunFeed(f) && IRN.Key="dxun","explicit reset with detection on resumes actual raid estimates")
}

V66RunManualArmRestore() => V6510RunPrivateFile(V66RunManualArmRestoreBody)
V66RunManualArmRestoreBody(path)
{
    utc := 13000000000000,s := IRNNewState(),IRNRemember(s,"prior",1234)
    V48Assert(IRNSaveState(s,path,utc,1000),"armed scope fixture saves privately")
    restored := IRNLoadState(path,utc,1000)
    V48Assert(IRNSelectArmedRaid(restored,false,"gods") && restored.ArmedKey="gods" && restored.Seen["prior"]=1234,
        "startup preference sync replaces old automatic scope without clearing deduplication")
    IRNSaveState(restored,path,utc,1000),again := IRNLoadState(path,utc,1000)
    V48Assert(again.ArmedKey="gods" && IRNSelectArmedRaid(again,true,"gods") && again.ArmedKey="auto","restored scope follows current detection preference")
}

; Phase review tests share the real parser acceptance journal and hidden UI.
V66PhaseAdd(s,at,kind := "Damage",amount := 100,source := "@Review#66",target := "NAHUT {4122949560827904}:1|(0,0,0,0)|(10000/20000)",ability := "66")
{
    line := IPDemoLine(at,source,target,kind,amount,false,-1,"Test ability",ability)
    return V66PhaseApplyLine(s,line,at)
}

V66PhaseApplyLine(s,line,at)
{
    ev := IPParseLine(line),s.Lines += 1
    IACaptureRaw(s.AnalysisCapture,ev,line,at,s.Lines)
    IPApplyEvent(s,ev,at)
    return ev
}

V66PhaseFixture()
{
    s := V6415CData(),s.AnalysisCapture := IACaptureNew(0,10000)
    V66PhaseAdd(s,1000,"Damage",50)
    V66PhaseAdd(s,2000,"Activate",0,"NAHUT {4122949560827904}:1","=","4133047028940800")
    V66PhaseAdd(s,3000,"Damage",100)
    V66PhaseAdd(s,3500,"Damage",75,"@Review#66","Rail Turret {4124177921474560}:2")
    V66PhaseAdd(s,4000,"Heal",125,"@Review#66","@Friend#67")
    V66PhaseAdd(s,6000,"Damage",200)
    seg := s.Current,d := IAAssemble(s,seg,s.AnalysisCapture)
    IAEffectsBuild(d),IAShieldsBuild(d)
    d.BaseVerified := true,d.Demo := true
    return {State:s,Segment:seg,Data:d}
}

V66PhaseFind(d,name)
{
    for p in d.AutomaticPhases
        if p.Name=name
            return p
    return ""
}

V66PhaseQuery(d,p,actor := "@Review#66")
{
    q := IANewQuery(d,actor,p.From,p.To)
    q.PhaseBoundary := p.Boundary
    return q
}

V66AnalysisPhaseAllTargets()
{
    f := V66PhaseFixture(),d := f.Data,p := V66PhaseFind(d,"Burn")
    V48Assert(IsObject(p) && p.From=2 && p.To=6,"automatic burn uses reconciled recorded window")
    r := IAQuery(d,V66PhaseQuery(d,p))
    V48Assert(r.D=375 && r.H=125,"phase review includes ordinary off-target damage and healing")
    V48Assert(f.Segment.Totals["@Review#66"].Damage=425,"phase construction leaves whole-fight totals unchanged")
    V48Assert(IAEventTotalsCheck(d,f.Segment).Length=0,"accepted review events still reconcile with parser totals")
    whole := IAQuery(d,IANewQuery(d,"@Review#66"))
    V48Assert(whole.D=425 && whole.D-r.D=50,"whole-fight review retains pre-phase damage")
}

V66AnalysisPhaseChallengeTargets()
{
    s := V6415CData(),s.Current.BossKey := "G-SC",s.AnalysisCapture := IACaptureNew(0,10000)
    boss := "SCYVA {4108140513591296}:1|(0,0,0,0)|(10000/20000)"
    V66PhaseAdd(s,1000,"Damage",50,"@Review#66",boss)
    V66PhaseAdd(s,1200,"Activate",0,boss,"=","4127300362698752")
    V66PhaseAdd(s,2000,"Damage",100,"@Review#66",boss)
    V66PhaseAdd(s,2200,"Damage",75,"@Review#66","CFA-Railgun {4126518678650880}:2")
    V66PhaseApplyLine(s,"[00:00:04.000] [" boss "] [=] [Ignite {4131981877051392}] [RemoveEffect {836045448945478}: Ignite {4131981877051728}]",4000)
    V66PhaseAdd(s,4500,"Damage",200,"@Review#66",boss)
    seg := s.Current,d := IAAssemble(s,seg,s.AnalysisCapture),p := V66PhaseFind(d,"Ignite Core")
    V48Assert(IsObject(p) && p.From=1.2 && p.To=4,"repeating Ignite interval uses the real end marker")
    V48Assert(IAQuery(d,V66PhaseQuery(d,p)).D=175,"Analysis phase includes railgun hit in ordinary selected targets")
    snap := IRCSnapshot({Data:s,Segment:seg,State:"STOPPED",Pending:0}),challengeTotal := 0
    for row in snap.Rows
        challengeTotal += row.Damage
    V48Assert(challengeTotal=100,"challenge scoring remains Scyva-only while phase Analysis stays independent")
}

V66AnalysisPhaseBoundaries()
{
    d := {Start:0,Last:5000},b := {Start:2000,StartSeq:20,IncludeStart:false,End:4000,EndSeq:40,OpenEnd:false}
    for row in [[2000,19,false],[2000,20,false],[2000,21,true],[2100,10,true],[1999,30,false],
        [4000,39,true],[4000,40,false],[4000,41,false],[4001,1,false]] {
        ev := {RecordId:row[2],Analysis:{At:row[1],Seq:row[2]+1000,Accepted:true}}
        V48Assert(IAPhaseContains(ev,b,d)=row[3],"same-ms phase bounds preserve record order and accepted late records")
    }
    b.IncludeStart := true,ev := {RecordId:20,Analysis:{At:2000,Seq:2000,Accepted:true}}
    V48Assert(IAPhaseContains(ev,b,d),"progression phase includes the transition hit")
    b.OpenEnd := true,ev.Analysis.At := 5001
    V48Assert(IAPhaseContains(ev,b,d),"accepted terminal bookkeeping matches whole-fight open-tail accounting")
    ev.Analysis.Accepted := false
    V48Assert(!IAPhaseContains(ev,b,d),"unaccepted beyond-end event remains outside")
}

V66AnalysisPhaseProgression()
{
    s := V6415CData(),s.AnalysisCapture := IACaptureNew(0,10000)
    opening := V66PhaseAdd(s,1000)
    V66PhaseAdd(s,2000,"Activate",0,"NAHUT {4122949560827904}:1","=","4131999056920576")
    V66PhaseAdd(s,3000,"Damage",100,"@Review#66","Power Coupling {4131857322999808}:2")
    V66PhaseAdd(s,4000,"Activate",0,"NAHUT {4122949560827904}:1","=","4134120770764800")
    V66PhaseAdd(s,5000)
    d := IAAssemble(s,s.Current,s.AnalysisCapture)
    p1 := V66PhaseFind(d,"Nahut"),p2 := V66PhaseFind(d,"Couplings"),p3 := V66PhaseFind(d,"Turrets")
    V48Assert(IsObject(p1) && IsObject(p2) && IsObject(p3),"verified Nahut phase markers become selectable ranges")
    V48Assert(p1.From=1 && p1.To=2 && p2.From=2 && p2.To=4 && p3.From=4 && p3.To=5,"phase ranges meet at exact observed transitions")
    V48Assert(!IsObject(V66PhaseFind(d,"Burn")),"unobserved later phase is never invented")
    damage := 0
    for p in [p1,p2,p3]
        damage += IAQuery(d,V66PhaseQuery(d,p)).D
    V48Assert(damage+opening.Analysis.D=s.Current.Totals["@Review#66"].Damage,"exclusive opening marker is the only damage omitted by adjoining Parsely phases")
}

V66AnalysisPhaseRepeatsAndScope()
{
    s := V6415CData(),s.Current.BossKey := "G-SC",s.AnalysisCapture := IACaptureNew(0,10000)
    boss := "SCYVA {4108140513591296}:1|(0,0,0,0)|(10000/20000)"
    V66PhaseAdd(s,1000,"Damage",50,"@Review#66",boss)
    for at in [1500,3500] {
        V66PhaseAdd(s,at,"Activate",0,boss,"=","4127300362698752")
        V66PhaseAdd(s,at+500,"Damage",100,"@Review#66",boss)
        V66PhaseApplyLine(s,"[" IPStamp(at+1000) "] [" boss "] [=] [Ignite {4131981877051392}] [RemoveEffect {836045448945478}: Ignite {4131981877051728}]",at+1000)
    }
    V66PhaseAdd(s,5000,"Damage",50,"@Review#66",boss)
    seg := s.Current,d := IAAssemble(s,seg,s.AnalysisCapture),phases := []
    for p in IAAutomaticPhases(d,seg)
        if SubStr(p.Name,1,11)="Ignite Core"
            phases.Push(p)
    V48Assert(phases.Length=2 && phases[1].Name="Ignite Core" && phases[2].Name="Ignite Core 2","each exact repeated phase stays individually selectable")
    V48Assert(phases[1].From=1.5 && phases[1].To=2.5 && phases[2].From=3.5 && phases[2].To=4.5,"repeat boundaries stay distinct")
    fake := {Windows:Map()},seg.Challenges := fake
    for i,at in [1500,3500] {
        fake.Windows[i] := {Name:"Ignite Core",Repeat:true,Ordinal:i,Start:at,End:at+1000,StartSeq:i,EndSeq:i+1}
    }
    seg.BossKey := "unsupported",seg.AreaId := "wrong",seg.ModeId := "wrong"
    phases := IAAutomaticPhases(d,seg)
    V48Assert(phases.Length=0,"challenge windows cannot invent primary phases in an unsupported scope")
    seg.Challenges.Windows.Clear(),phases := IAAutomaticPhases(d,seg)
    V48Assert(phases.Length=0,"unsupported encounters do not invent progression phases")
    V48Assert(!IsObject(IAPhaseRange(d,"Empty",3000,3000,{})),"zero-duration windows are omitted instead of opening an invalid range")
    V48Assert(!IsObject(IAPhaseRange(d,"Outside",7000,8000,{})),"out-of-fight windows are omitted")
}

V66AnalysisPhaseHiddenUI() => V591Isolated(V66AnalysisPhaseHiddenUIBody)
V66AnalysisPhaseHiddenUIBody()
{
    a := V598Ready(),f := V66PhaseFixture(),d := f.Data
    IAInstallData(d,"@Review#66"),IAQueryPump()
    choice := 0
    for i,p in a.Phases
        if p.Name="Burn"
            choice := i
    V48Assert(choice>1 && a.Controls["Phase"].Text="Whole fight","automatic phase appears in the real Analysis selector")
    a.Controls["Phase"].Choose(choice),IAChoosePhase(),IAQueryPump()
    V48Assert(a.Query.From=2000 && a.Query.To=6000 && a.Result.D=375 && a.Result.H=125,"choosing phase recalculates real displayed Analysis query")
    V48Assert(IsObject(a.Query.PhaseBoundary) && a.Controls["From"].Value="2.000","selection retains exact ordering and updates range edits")
    IAFullRange(),IAQueryPump()
    V48Assert(a.Result.D=425 && !IsObject(a.AutomaticPhase),"Whole fight clears automatic boundary and restores all damage")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd),"diagnostic review stays hidden")
}

V66AnalysisPhaseManualBookmark() => V591Isolated(V66AnalysisPhaseManualBookmarkBody)
V66AnalysisPhaseManualBookmarkBody()
{
    a := V598Ready(),f := V66PhaseFixture(),IAInstallData(f.Data,"@Review#66"),IAQueryPump()
    for i,p in a.Phases
        if p.Name="Burn"
            a.Controls["Phase"].Choose(i)
    IAChoosePhase(),IAQueryPump(),a.Controls["PhaseName"].Value := "My burn",IASavePhase()
    saved := a.Phases[a.Phases.Length]
    V48Assert(saved.Kind="Manual" && IsObject(saved.Boundary),"manual bookmark of automatic interval retains exact edges")
    IAFullRange(),IAQueryPump(),a.Controls["Phase"].Choose(a.Phases.Length),IAChoosePhase(),IAQueryPump()
    V48Assert(a.Result.D=375,"saved bookmark returns to identical phase totals")
    a.Controls["From"].Value := "3",IAApplyRange(),IAQueryPump()
    V48Assert(!IsObject(a.AutomaticPhase) && !a.Query.HasOwnProp("PhaseBoundary"),"manual time edits release previous automatic phase bounds")
    IAInstallData(f.Data,"@Review#66"),IAQueryPump()
    V48Assert(!IsObject(a.AutomaticPhase) && a.Controls["Phase"].Text="Whole fight","new review cannot inherit prior phase boundary")
}

V66AnalysisPhaseEventOverride() => V591Isolated(V66AnalysisPhaseEventOverrideBody)
V66AnalysisPhaseEventOverrideBody()
{
    a := V598Ready(),f := V66PhaseFixture(),IAInstallData(f.Data,"@Review#66"),IAQueryPump()
    for i,p in a.Phases
        if p.Name="Burn"
            a.Controls["Phase"].Choose(i)
    IAChoosePhase(),IAQueryPump()
    marker := f.Data.Rows[2]
    a.SelectedEvent := {Whole:false,Event:marker,At:2000,Seq:marker.Analysis.Seq}
    IAEventRange("start"),IAQueryPump()
    V48Assert(!IsObject(a.AutomaticPhase) && !a.Query.HasOwnProp("PhaseBoundary") && a.Query.FirstSeq=marker.Analysis.Seq,
        "choosing an event at the same timestamp explicitly replaces automatic sequence bounds")
}

V66AnalysisPhaseSavedIsolation() => V591Isolated(V66AnalysisPhaseSavedIsolationBody)
V66AnalysisPhaseSavedIsolationBody()
{
    global IP,IRN
    oldRun := IRN
    try {
        a := V598Ready(),f := V66PhaseFixture(),IP.Offline := f.State,IP.View := "Imported",IP.Selected := 1
        IRN := IRNNewState(),IRNStart(IRN,"gods",13000000000000,1000),deadline := IRN.DeadlineUtc
        IAInstallData(f.Data,"@Review#66"),IAQueryPump()
        for i,p in a.Phases
            if p.Name="Burn"
                a.Controls["Phase"].Choose(i)
        IAChoosePhase(),IAQueryPump()
        V48Assert(a.Result.D=375 && IP.Offline=f.State && IP.Offline.Current.Totals["@Review#66"].Damage=425,
            "saved-phase review leaves selected saved parser data and whole-fight overlay totals intact")
        V48Assert(IRN.DeadlineUtc=deadline && IRN.Key="gods" && IRN.Status="Running","saved Analysis phase selection cannot alter live raid timer")
        ; Replace a pending phase query with a different completed review.
        IAChoosePhase(),previous := a.QueryJob,replacement := IADemoData()
        IAInstallData(replacement,"@Demo DPS#102"),IAQueryPump()
        V48Assert(a.Data=replacement && a.Query.Full && !a.Query.HasOwnProp("PhaseBoundary") && !IsObject(a.AutomaticPhase),
            "new saved review supersedes pending automatic phase bounds instead of reusing them")
        V48Assert(a.QueryJob!=previous && a.Controls["Phase"].Text="Whole fight" && a.EventFrom=0 && a.EventTo=0,
            "review replacement resets selector and explicit record endpoints together")
        V48Assert(IP.Offline=f.State && IRN.DeadlineUtc=deadline,"private review replacement leaves main parser and independent run clock unchanged")
    }
    finally IRN := oldRun
}

; v66 editor tests use private definitions and hidden controls. Any persistence
; goes exclusively to the test process's temporary settings sidecar.
V66TEReject(callback,label)
{
    rejected := false
    try callback.Call()
    catch
        rejected := true
    V48Assert(rejected,label)
}

V66TimerEditorDefaults()
{
    d := IRTENewDefinition([]),second := IRTENewDefinition([d])
    V48Assert(d.Enabled && d.Trigger.Source="@Self" && d.Interval=10000,"new custom rule starts with usable defaults")
    V48Assert(second.Name="New timer 2" && second.Id!=d.Id,"new name is unique within the group")
    d.Trigger.AbilityGuid := "12345678901234567890"
    copy := IRTENewDefinition([d],d),copy.Trigger.AbilityGuid := "777"
    V48Assert(copy.Name="New timer copy" && d.Trigger.AbilityGuid="12345678901234567890","duplicate is an independent deep draft")
    V48Assert(IRTEConditionCodes().Length=9 && IRTEConditionCodes(true)[1]="","start and optional cancellation types match supported events")
}

V66TimerEditorValidation()
{
    d := V65IDef("Valid"),good := IRTEPrepare([],"",d)
    V48Assert(good.Definitions.Length=1 && good.Definitions[1].Supported,"valid rule builds without touching original")
    for pair in [["Interval",-1],["Repeat",0],["Color","purple"],["Name",""],["Interval",86400001],["Repeat",1001]] {
        bad := IRTIClone(d),bad.%pair[1]% := pair[2]
        V66TEReject(IRTEPrepare.Bind([],"",bad),"invalid editor value rejected: " pair[1])
    }
    bad := IRTIClone(d),bad.Trigger.AbilityGuid := "123x"
    V66TEReject(IRTEPrepare.Bind([],"",bad),"invalid identifier is not saved")
    bad := IRTIClone(d),bad.Trigger.Type := "HOTKEY"
    V66TEReject(IRTEPrepare.Bind([],"",bad),"unsupported new event cannot become a runnable rule")
    bad := IRTIClone(d),bad.Interval := 0,bad.Repeat := 2
    V66TEReject(IRTEPrepare.Bind([],"",bad),"zero-delay repeated rule is rejected")
    bad := IRTIClone(d),bad.Trigger := ""
    V66TEReject(IRTEPrepare.Bind([],"",bad),"custom rule requires a trigger")
}

V66TimerEditorRename()
{
    a := V65IDef("Anchor"),b := V65IDef("Child","Tests","Anchor")
    b.Cancel := IRTCondition("TIMER_STARTED"),b.Cancel.Timer := "Anchor"
    draft := IRTIClone(a),draft.Name := "Renamed"
    result := IRTEPrepare([a,b],a.Id,draft),out := result.Definitions
    V48Assert(out[1].Name="Renamed" && out[2].Trigger.Timer="Renamed" && out[2].Cancel.Timer="Renamed","rename updates start and cancellation links")
    V48Assert(a.Name="Anchor" && b.Trigger.Timer="Anchor","rename leaves live inputs untouched")
    draft.Folder := "New folder",again := IRTEPrepare([a,b],a.Id,draft)
    V48Assert(again.SelectedId="New folder" Chr(31) "Renamed","moving a timer updates identity together with name")
}

V66TimerEditorDependencies()
{
    a := V65IDef("Anchor"),b := V65IDef("Child","Tests","Anchor")
    missing := V65IDef("New","Tests","Absent")
    V66TEReject(IRTEPrepare.Bind([a,b],"",missing),"missing dependency blocks new rule")
    looped := IRTIClone(a),looped.Trigger := IRTCondition("TIMER_FINISHED"),looped.Trigger.Timer := "Child"
    V66TEReject(IRTEPrepare.Bind([a,b],a.Id,looped),"indirect restart cycle is rejected")
    collision := IRTIClone(a),collision.Name := "Child"
    V66TEReject(IRTEPrepare.Bind([a,b],a.Id,collision),"same-group duplicate is rejected")
    twin := V65IDef("Anchor","Other"),rename := IRTIClone(a),rename.Name := "New anchor"
    V66TEReject(IRTEPrepare.Bind([a,b,twin],a.Id,rename),"ambiguous old name cannot silently redirect a link")
    newTwin := V65IDef("Anchor","Other")
    V66TEReject(IRTEPrepare.Bind([a,b],"",newTwin),"new duplicate name cannot break a supported dependent in another group")
}

V66TimerEditorExportClosure()
{
    a := V65IDef("A","Helpers"),b := V65IDef("B","Timers","A"),c := V65IDef("C","Helpers")
    b.Cancel := IRTCondition("TIMER_STARTED"),b.Cancel.Timer := "C"
    extra := V65IDef("Unrelated","Other"),groupPeer := V65IDef("Peer","Timers")
    defs := [a,b,c,extra,groupPeer],xmlBefore := IRTSerializeXML(defs)
    exported := IRTEExportDefinitions(defs,b.Id)
    V48Assert(exported.Length=3 && exported[1].Name="A" && exported[2].Name="B" && exported[3].Name="C","selected export includes start and stop helper dependencies")
    grouped := IRTEExportDefinitions(defs,b.Id,true)
    V48Assert(grouped.Length=4 && grouped[4].Name="Peer","group export adds peers and helper closure but excludes unrelated groups")
    parsed := IRTMergeDefinitions([],IRTParseXML(IRTSerializeXML(exported)))
    V48Assert(parsed.Definitions.Length=3 && parsed.Issues.Length=0 && parsed.Definitions[2].Cancel.Timer="C","package round-trips with complete links")
    exported[1].Name := "Changed"
    V48Assert(IRTSerializeXML(defs)==xmlBefore,"exported definitions are private deep copies")
}

V66TimerEditorExportGuards()
{
    a := V65IDef("A","Tests","Missing")
    V66TEReject(IRTEExportDefinitions.Bind([a],a.Id),"missing linked helper cannot be exported as a working package")
    a.Trigger.Timer := "B",b := V65IDef("B","Tests","A")
    V66TEReject(IRTEExportDefinitions.Bind([a,b],a.Id),"cyclic package rejected without recursion")
    b.Trigger := IRTCondition("COMBAT_START"),twin := V65IDef("B","Other")
    V66TEReject(IRTEExportDefinitions.Bind([a,b,twin],a.Id),"ambiguous helper cannot be silently chosen")
}

V66TimerEditorMetadata()
{
    xml := V65IWrap(V65IXML("Unknown",'<interval>5</interval><trigger><type>DAMAGE</type><source>@Self</source><futureTrigger>keep</futureTrigger></trigger><future>keep</future><audio>custom.mp3</audio>'))
    d := IRTParseXML(xml).Definitions[1],draft := IRTIClone(d),draft.Color := "ABCDEF"
    out := IRTEPrepare([d],d.Id,draft).Definitions[1]
    V48Assert(!out.Supported && out.ImportExtraXML==d.ImportExtraXML && out.Trigger.ImportExtraXML==d.Trigger.ImportExtraXML,"editing presentation retains unsupported imported details")
    again := IRTParseXML(IRTSerializeXML(IRTEExportDefinitions([out],out.Id))).Definitions[1]
    V48Assert(again.Audio="custom.mp3" && again.Color="ABCDEF" && !again.Supported,"export retains audio notes and unsupported state")
}

V66TimerEditorBuiltin()
{
    d := V65IDef("Built-in","Built-in: Tests"),d.Builtin := true,d.ExtraMechanic := "preserve"
    draft := IRTIClone(d),draft.Interval := 999,draft.Trigger.Ability := "Wrong",draft.Color := "FEDCBA",draft.Enabled := true
    out := IRTEPrepare([d],d.Id,draft).Definitions[1]
    V48Assert(out.Interval=5000 && out.Trigger.Ability="Slice" && out.ExtraMechanic="preserve","built-in mechanics cannot be changed by a draft")
    V48Assert(out.Color="FEDCBA" && out.Enabled,"built-in display and enable choices remain editable")
    V66TEReject(IRTENewDefinition.Bind([d],d),"built-in encounter mechanic cannot be copied as a fake custom rule")
    parsed := IRTMergeDefinitions([d],IRTParseXML(IRTSerializeXML(IRTEExportDefinitions([out],out.Id))))
    V48Assert(parsed.Definitions[1].Enabled && parsed.Definitions[1].Interval=5000,"built-in export shares settings without replacing recipient mechanics")
}

V66TimerEditorNativeDraft()
{
    V65UITimerIsolated(V66TimerEditorNativeDraftCase)
}

V66TimerEditorNativeDraftCase(path)
{
    global IRT,IRTPrefs,Audio
    IRTConfigure(IRT,[V65IDef("Example")]),IRTShowManager()
    signature := IRTSerializeXML(IRT.Definitions),queue := Audio.Queue.Length,active := WinExist("A")
    e := IRTEOpen(IRT.Definitions[1],IRT.Definitions[1].Id)
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",e.Gui.Hwnd,"Int"),"editor remains hidden under native diagnostics")
    V48Assert(e.Controls.Has("PlaySound") && e.Controls.Has("PlayCountdown") && e.Controls["Panel"].Text="Automatic" && e.Controls["TriggerType"].Text="Ability used","general, condition and audio controls build natively")
    e.Controls["Interval"].Value := "12.75",e.Controls["TriggerAbilityGuid"].Value := "12345678901234567890"
    e.Controls["ShowCenter"].Value := 0,draft := IRTEReadDraft(e)
    V48Assert(draft.Interval=12750 && draft.Trigger.AbilityGuid="12345678901234567890" && !draft.ShowCenter,"controls read decimal seconds and exact long identifiers")
    IRTEClose()
    V48Assert(IRTSerializeXML(IRT.Definitions)==signature && !FileExist(path ".timers.xml"),"cancel discards draft with no file or runtime mutation")
    V48Assert(Audio.Queue.Length=queue && WinExist("A")=active,"hidden editor never changes audio or foreground window")
}

V66TimerEditorNativeSave()
{
    V65UITimerIsolated(V66TimerEditorNativeSaveCase)
}

V66TimerEditorNativeSaveCase(path)
{
    global IRT,IRTPrefs
    try {
        IRTConfigure(IRT,[V65IDef("Example")]),IRTShowManager(),IRTEOpen(IRT.Definitions[1],IRT.Definitions[1].Id)
        e := IRTPrefs.RuleEditor,e.Controls["Interval"].Value := "no"
        V48Assert(!IRTESave() && !FileExist(path ".timers.xml"),"invalid input leaves editor open without partial save")
        e.Controls["Interval"].Value := "8.5",e.Controls["TriggerAbility"].Value := "Burst"
        V48Assert(IRTESave() && !IsObject(IRTPrefs.RuleEditor),"valid native save closes the editor")
        V48Assert(IRT.Definitions[1].Interval=8500 && IRT.Definitions[1].Trigger.Ability="Burst","native save commits the new rule")
        parsed := IRTParseXML(FileRead(path ".timers.xml","UTF-8")).Definitions[1]
        V48Assert(parsed.Interval=8500 && parsed.Trigger.Ability="Burst","saved timer sidecar matches runtime draft")
    }
    finally {
        try FileDelete(path ".timers.xml")
        try FileDelete(path ".timers.xml.bak")
    }
}

V66TimerEditorStaleSave()
{
    V65UITimerIsolated(V66TimerEditorStaleSaveCase)
}

V66TimerEditorStaleSaveCase(path)
{
    global IRT
    IRTConfigure(IRT,[V65IDef("Example")]),expected := IRTSerializeXML(IRT.Definitions)
    draft := IRTIClone(IRT.Definitions[1]),draft.Interval := 1000,IRT.Definitions[1].Color := "123456"
    V66TEReject(IRTECommit.Bind(draft.Id,draft,expected),"stale editor cannot overwrite another library change")
    V48Assert(IRT.Definitions[1].Color="123456" && !FileExist(path ".timers.xml"),"stale save keeps newer change and does not write")
}

V66TimerEditorFailedSave()
{
    V65UITimerIsolated(V66TimerEditorFailedSaveCase)
}

V66TimerEditorFailedSaveCase(path)
{
    global IRT,SETTINGS_FILE
    IRTConfigure(IRT,[V65IDef("Example")]),expected := IRTSerializeXML(IRT.Definitions)
    draft := IRTIClone(IRT.Definitions[1]),draft.Interval := 1000
    SETTINGS_FILE := path "\missing\settings.ini"
    V66TEReject(IRTECommit.Bind(draft.Id,draft,expected),"failed staged write cannot commit runtime edits")
    V48Assert(IRTSerializeXML(IRT.Definitions)==expected,"runtime library is unchanged when persistence fails")
    SETTINGS_FILE := path
}

V66TimerEditorNativeBuiltin()
{
    V65UITimerIsolated(V66TimerEditorNativeBuiltinCase)
}

V66TimerEditorNativeBuiltinCase(path)
{
    global IRT
    d := V65IDef("Built-in","Built-in: Tests"),d.Builtin := true
    IRTConfigure(IRT,[d]),IRTShowManager(),e := IRTEOpen(d,d.Id)
    V48Assert(!e.Controls["Interval"].Enabled && !e.Controls["Name"].Enabled,"native built-in mechanics are visibly locked")
    V48Assert(e.Controls["Color"].Enabled && e.Controls["Enabled"].Enabled && e.Controls["ShowCenter"].Enabled,"native built-in presentation controls remain usable")
    e.Tab.Choose(2),IRTEApplyLocks(e)
    V48Assert(!e.Controls["TriggerType"].Enabled,"built-in start controls stay locked when their tab becomes active")
    IRTEClose()
}

V66TimerEditorFileRoundtrip()
{
    V65UITimerIsolated(V66TimerEditorFileRoundtripCase)
}

V66TimerEditorFileRoundtripCase(path)
{
    global IRT
    exportPath := path ".export.xml"
    try {
        a := V65IDef("Anchor"),b := V65IDef("Child","Tests","Anchor")
        IRTConfigure(IRT,[a,b]),expected := IRTSerializeXML(IRT.Definitions),draft := IRTIClone(a),draft.Name := "Renamed"
        IRTECommit(a.Id,draft,expected)
        exported := IRTEExportDefinitions(IRT.Definitions,b.Id),IRTWriteLibrary(exported,exportPath)
        parsed := IRTMergeDefinitions([],IRTParseXML(FileRead(exportPath,"UTF-8")))
        V48Assert(parsed.Definitions[2].Trigger.Timer="Renamed" && parsed.Definitions[1].Name="Renamed","saved rename and exported links agree after reload")
        V48Assert(parsed.Definitions[1].Supported && parsed.Definitions[2].Supported,"saved package reimports without missing dependencies")
        V48Assert(!FileExist(path),"timer editing and export do not touch unrelated INI settings")
    }
    finally {
        for suffix in [".timers.xml",".timers.xml.bak",".export.xml",".export.xml.bak"]
            try FileDelete(path suffix)
    }
}


V66LayoutRoundTrip()
{
    a := IPMNewState(),b := IRTUNewState()
    a.Panels["Damage"].X := -420,a.Panels["Damage"].Width := 345
    a.Mode := 3,a.Shown["Taken"] := true,b.BarsX := 180,b.Scale := 120
    saved := ILPCapture(a,b)
    a.Mode := 1,a.Panels["Damage"].X := 80,b.Scale := 80
    a.Wanted := true,a.Editing := true,a.Source := 2,a.KeyChoice := 3
    ILPApplyModel(a,b,saved)
    V48Assert(a.Mode=3 && a.Panels["Damage"].X=-420 && a.Panels["Damage"].Width=345,"named layout restores panel placement and mode")
    V48Assert(b.Scale=120 && b.BarsX=180 && a.Shown["Taken"],"timer appearance and selected displays restore")
    V48Assert(a.Wanted && a.Editing && a.Source=2 && a.KeyChoice=3,"layout never restores visibility, lock, data source or gameplay hotkeys")
    bad := saved.Clone(),bad["Display.Font"] := "garbage",caught := false
    try ILPApplyModel(a,b,bad)
    catch Error
        caught := true
    V48Assert(caught && a.Mode=3 && b.Scale=120,"bad layout is rejected before mutation")
}

V66LayoutStorage()
{
    path := A_Temp "\Iris-v66-layouts-" A_TickCount ".ini"
    try {
        data := ILPCapture(IPMNewState(),IRTUNewState())
        ILPWrite(path,"Tank",data),ILPWrite(path,"Healer",data)
        data["Display.Opacity"] := 199,ILPWrite(path,"Tank",data)
        V48Assert(ILPNames(path).Length=2 && ILPRead(path,"Tank")["Display.Opacity"]=199,"updating a preset preserves other layouts")
        V48Assert(FileExist(path ".bak") && ILPRead(path ".bak","Tank")["Display.Opacity"]!=199,"prior layout file is backed up")
        for name in ["", "bad]name", "bad`nname", "bad=name"] {
            caught := false
            try ILPWrite(path,name,data)
            catch Error
                caught := true
            V48Assert(caught,"invalid layout section name rejected")
        }
    }
    finally {
        for p in [path,path ".bak",path ".tmp"] {
            if FileExist(p)
                FileDelete(p)
        }
    }
}

V66LayoutHiddenUI()
{
    global IPM,IRTPrefs,IEFU,SETTINGS_FILE,Persist
    oldM := IPM,oldT := IRTPrefs,oldE := IEFU,oldFile := SETTINGS_FILE,oldPersist := Persist
    dir := A_Temp "\Iris-v66-layout-ui-" A_TickCount,DirCreate(dir)
    try {
        IPM := IPMNewState(),IRTPrefs := IRTUNewState(),IEFU := IEFUNewState()
        SETTINGS_FILE := dir "\private.ini"
        ILPOpen(),u := ILPUI(),u.Name.Value := "Tank",IPM.Opacity := 199
        IPM.Panel.Width := 412,IPM.Width := 412
        IEFU.SourceFilter := 2,ILPSaveCurrent()
        IPM.Opacity := 240,IPM.Width := 246,IPM.Panel.Width := 246,IEFU.SourceFilter := 1,ILPLoadSelected()
        V48Assert(IPM.Opacity=199 && IEFU.SourceFilter=2,"real layout controls save and apply presentation preferences")
        V48Assert(InStr(u.Status.Text,"Applied") && !DllCall("IsWindowVisible","Ptr",u.Gui.Hwnd),"layout controls stay hidden in native diagnostics")
        V48Assert(!IPM.Wanted && !IPM.Editing,"applying layout cannot open overlays or unlock them")
        IPMEnsureGui("Personal",0,IPM.Panel)
        V48Assert(IPM.Panel.Width=412 && IPM.Width=412,"recreated tabbed window retains the saved layout width")
    }
    finally {
        u := ILPUI()
        if IPMGuiAlive(u.Gui)
            u.Gui.Destroy()
        u.Gui := ""
        IPMDestroyPanels()
        IPM := oldM,IRTPrefs := oldT,IEFU := oldE,SETTINGS_FILE := oldFile,Persist := oldPersist
        if DirExist(dir)
            DirDelete(dir,true)
    }
}

V66LayoutOpenControls()
{
    global IPM,IP,IRTPrefs,IEFU,IRT,SETTINGS_FILE,Persist
    oldM := IPM,oldIP := IP,oldT := IRTPrefs,oldE := IEFU,oldTimers := IRT,oldFile := SETTINGS_FILE,oldPersist := Persist
    dir := A_Temp "\Iris-v66-layout-controls-" A_TickCount,DirCreate(dir)
    try {
        IPM := IPMNewState(),IP := IPNewApp(),IRTPrefs := IRTUNewState(),IRT := IRTNewState(),IEFU := IEFUNewState()
        SETTINGS_FILE := dir "\private.ini"
        IPM.Mode := 3,IPM.Metric := "Damage",IPM.Font := 14,IPM.MaxRows := 12,IPM.Opacity := 190,IPM.Refresh := 1000
        IPM.Panel.Width := 420,IPM.Width := 420,IPM.Shown["Damage"] := true,IPM.Companions := false
        IRTPrefs.Scale := 130,IRTPrefs.BarsX := -300,IRTPrefs.ShowWarnings := false
        IEFU.SourceFilter := 2,IEFU.TargetFilter := 3,IEFU.NameFilter := "Burn",IEFU.Columns := 4,IEFU.StaleAfter := 60
        ILPOpen(),u := ILPUI(),u.Name.Value := "Raid",ILPSaveCurrent()
        IPM.Mode := 1,IPM.Metric := "Personal",IPM.Font := 8,IPM.MaxRows := 4,IPM.Opacity := 240,IPM.Refresh := 500
        IPM.Panel.Width := 246,IPM.Width := 246,IPM.Shown["Damage"] := false,IPM.Companions := true
        IRTPrefs.Scale := 80,IRTPrefs.BarsX := 10,IRTPrefs.ShowWarnings := true
        IEFU.SourceFilter := 1,IEFU.TargetFilter := 1,IEFU.NameFilter := "Old",IEFU.Columns := 1,IEFU.StaleAfter := 90
        V66LayoutHiddenSettingsFixture()
        ; Unrelated in-progress edits must not be read into the live model or
        ; discarded by the layout's selective widget refresh.
        IPM.SourceControl.Choose(2),IPM.KeyControl.Choose(2),IPM.ParserWarnRestartControl.Value := !IPM.ParserWarnRestart
        warnDraft := IPM.ParserWarnRestartControl.Value,source := IPM.Source,keyChoice := IPM.KeyChoice
        IEFOpenOptions(),c := IEFU.Controls,c["Durations"].Value := "Probe = 18",c["Slots"].Value := "Unsaved Tank"
        IRTShowManager(),IRTPrefs.Controls["Lead"].Value := 17
        ILPLoadSelected()
        V48Assert(IPM.ModeControl.Value=3 && IPM.MetricControl.Value=2 && IPM.FontControl.Value=14 && IPM.RowControl.Value=12,"open display controls reflect restored layout")
        V48Assert(IPM.OpacityControl.Value=190 && IPM.RefreshControl.Value=2 && IPM.ShowControls["Damage"].Value && !IPM.CompanionControl.Value,"display toggles and presentation values cannot undo restored layout")
        V48Assert(IPM.WidthControl.Value=420 && IPM.GeometryKey="Combined","geometry routing uses refreshed layout mode")
        V48Assert(IPM.Source=source && IPM.KeyChoice=keyChoice && IPM.SourceControl.Value=2 && IPM.KeyControl.Value=2 && IPM.ParserWarnRestartControl.Value=warnDraft,"layout preserves unrelated live settings and their unsaved widgets")
        V48Assert(c["SourceFilter"].Value=2 && c["TargetFilter"].Value=3 && c["NameFilter"].Value="Burn" && c["Columns"].Value=3 && c["StaleAfter"].Value=60,"open effects controls reflect restored presentation")
        V48Assert(c["Durations"].Value="Probe = 18" && c["Slots"].Value="Unsaved Tank" && IEFU.Durations="" && IEFU.Slots="","layout retains unsaved effect rules/assignments without applying them")
        V48Assert(IRTPrefs.Controls["Scale"].Value=130 && IRTPrefs.Controls["BarsX"].Value=-300 && !IRTPrefs.WarningBox.Value && IRTPrefs.Controls["Lead"].Value=17,"timer geometry refresh preserves unrelated warning lead draft")
        V48Assert(IPMApplySettings() && IPM.Mode=3 && IPM.Font=14 && IPM.Opacity=190 && IPM.Width=420,"subsequent settings Apply keeps selected layout")
        V48Assert(!DllCall("IsWindowVisible","Ptr",IPM.ConfigGui.Hwnd) && !DllCall("IsWindowVisible","Ptr",IEFU.Gui.Hwnd) && !DllCall("IsWindowVisible","Ptr",IRTPrefs.Manager.Hwnd),"native regression never shows settings windows")
    }
    finally {
        u := ILPUI()
        if IPMGuiAlive(u.Gui)
            u.Gui.Destroy()
        u.Gui := ""
        if IPMGuiAlive(IPM.ConfigGui)
            IPM.ConfigGui.Destroy()
        if IPMGuiAlive(IRTPrefs.Manager)
            IRTPrefs.Manager.Destroy()
        IEFShutdown(),IPMDestroyPanels()
        IPM := oldM,IP := oldIP,IRTPrefs := oldT,IEFU := oldE,IRT := oldTimers,SETTINGS_FILE := oldFile,Persist := oldPersist
        if DirExist(dir)
            DirDelete(dir,true)
    }
}

V66LayoutHiddenSettingsFixture()
{
    global IPM
    g := Gui("+ToolWindow","Private layout regression"),IPM.ConfigGui := g
    for pair in [["EnableControl","Enabled"],["ClickTabsControl","ClickTabs"],["ParserControlsControl","ParserControls"],
        ["ParserWarnRestartControl","ParserWarnRestart"],["CompanionControl","Companions"],["AutoShowOnParseControl","AutoShowOnParse"],
        ["AutoHideOnStopControl","AutoHideOnStop"]]
        IPM.%pair[1]% := g.AddCheckbox("",pair[1]),IPM.%pair[1]%.Value := IPM.%pair[2]%
    IPM.ModeControl := g.AddDropDownList("",["Tabbed","Separate","Both"]),IPM.ModeControl.Choose(IPM.Mode)
    IPM.MetricControl := g.AddDropDownList("",IPMViews()),IPM.MetricControl.Choose(IPMMetricIndex(IPM.Metric))
    IPM.SourceControl := g.AddDropDownList("",["Live","Saved","Automatic"]),IPM.SourceControl.Choose(IPM.Source)
    IPM.KeyControl := g.AddDropDownList("",["None","Choice 2","Choice 3"]),IPM.KeyControl.Choose(1)
    IPM.RefreshControl := g.AddDropDownList("",["500","1000"]),IPM.RefreshControl.Choose(1)
    IPM.GeometryControl := g.AddDropDownList("",IPMSizeLabels()),IPM.GeometryControl.Choose(1)
    IPM.AutoControl := g.AddDropDownList("",["Auto","Fixed"]),IPM.AutoControl.Choose(1)
    for pair in [["FontControl",IPM.Font],["RowControl",IPM.MaxRows],["OpacityControl",IPM.Opacity],
        ["WidthControl",246],["HeightControl",220]]
        IPM.%pair[1]% := g.AddEdit("",pair[2])
    IPM.NoticeControl := g.AddText("w300 h30","")
    IPM.ShowControls := Map()
    for kind in IPMViews()
        IPM.ShowControls[kind] := g.AddCheckbox("",kind),IPM.ShowControls[kind].Value := IPM.Shown[kind]
    g.Show("Hide w360 h900")
}

V66UploadSelectionUI()
{
    global IPU,IP
    oldU := IPU,oldIP := IP,path := A_Temp "\Iris-v66-selected-ui-" A_TickCount ".txt"
    try {
        FileAppend(IPDemoLine(1000,"@Recorder#1","=","Enter") "`r`n" IPDemoLine(2000,"@Recorder#1","Dummy {123}:1","Damage",100) "`r`n",path,"UTF-8")
        IP := IPNewApp(),IPU := IPUNewState(),data := IPNewData("private")
        data.SourcePath := path,data.SourceEncoding := "UTF-8"
        seg := IPNewSegment(data,1000,"test"),seg.Last := 2000,seg.End := 2000,seg.BossName := "Example boss"
        IP.Offline := data,IP.View := "Imported",IP.Selected := 1
        IPUOpenSelected()
        V48Assert(IPU.Scope="pull" && IPU.Selection.Start=1000 && IPU.Selection.Last=2000,"upload selected menu freezes the selected finished fight")
        V48Assert(!IPU.Busy && !IPU.Starting && !IPU.Handle && !IPU.Job,"opening selected upload never starts HTTP or a process")
        V48Assert(InStr(IPU.InfoControl.Text,"Selected fight only") && IPU.StartButton.Enabled,"selected scope is shown beside a ready Upload action")
        V48Assert(!DllCall("IsWindowVisible","Ptr",IPU.Gui.Hwnd),"upload UI diagnostic is hidden")
        seg.End := -1,IPUSelectPull()
        V48Assert(!IPU.Path && !IsObject(IPU.Selection) && !IPU.StartButton.Enabled,"failed fight selection clears the prior upload target")
        seg.End := 2000,IPUSelectPull()
        V48Assert(IPU.Path=path && IPU.Scope="pull" && IPU.StartButton.Enabled,"valid reselection restores upload readiness")
    }
    finally {
        if IPMGuiAlive(IPU.Gui)
            IPU.Gui.Destroy()
        IPU := oldU,IP := oldIP
        if FileExist(path)
            FileDelete(path)
    }
}

V66UploadScope()
{
    info := {Path:"C:\dummy\combat.txt",Name:"combat.txt",Size:100,Stamp:"20261002123456"}
    u := {Scope:"pull",Selection:{Start:1000,Last:2000,Encoding:"UTF-8",Size:100,Stamp:info.Stamp,Name:"Example boss"}}
    xml := IPUScopeXml(info,"<example>",u)
    V48Assert(InStr(xml,"<scope>pull</scope>") && InStr(xml,"<start>1000</start>") && InStr(xml,"&lt;example&gt;"),"selected scope is explicit and XML escaped")
    V48Assert(!InStr(IPUScopeXml(info,"",{Scope:"file"}),"<scope>pull"),"whole-file payload stays compatible")
    info.Size := 101,caught := false
    try IPUScopeXml(info,"",u)
    catch Error
        caught := true
    V48Assert(caught,"changed file is rejected before selected upload")
}

V66UploadNativeExtraction()
{
    dir := A_Temp "\Iris-v66-slice-" A_TickCount,DirCreate(dir)
    source := dir "\combat.txt",dest := dir "\selected.txt",ps := dir "\slice.ps1"
    area := "[23:59:58.000] [@Recorder#1] [=] [] [AreaEntered {836045448953664}: Example {123} Master {456}] ()"
    role := "[23:59:54.100] [@Bõõ#2] [=] [] [DisciplineChanged {836045448953665}: Example {123}] ()"
    otherRole := "[23:59:58.200] [@Unrelated#9] [=] [] [DisciplineChanged {836045448953665}: Example {999}] ()"
    a := "[23:59:59.000] [@Bõõ#2] [Boss {123}:1] [Hit {1}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (100)"
    b := "[00:00:00.000] [@Bõõ#2] [Boss {123}:1] [Hit {1}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (200)"
    c := "[00:00:05.000] [@Other#3] [Next boss {124}:2] [Hit {1}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (300)"
    try {
        FileAppend(role "`r`n" area "`r`n" otherRole "`r`n" a "`r`n" b "`r`n" c "`r`n",source,"UTF-8")
        quotedSource := "'" StrReplace(source,"'","''") "'",quotedDest := "'" StrReplace(dest,"'","''") "'"
        FileAppend(IPUSliceWorkerSource() "`nIrisSliceLog " quotedSource " " quotedDest " 86399000 86400000 'UTF-8'`n",ps,"UTF-8")
        command := "& ([ScriptBlock]::Create([IO.File]::ReadAllText('" StrReplace(ps,"'","''") "',[Text.Encoding]::UTF8)))"
        exe := A_WinDir "\System32\WindowsPowerShell\v1.0\powershell.exe"
        proc := IPUSpawn(exe,Chr(34) exe Chr(34) " -NoLogo -NoProfile -NonInteractive -EncodedCommand " IPUBase64(command))
        try {
            waited := DllCall("Kernel32\WaitForSingleObject","Ptr",proc.Handle,"UInt",15000,"UInt")
            if waited=258
                DllCall("Kernel32\TerminateProcess","Ptr",proc.Handle,"UInt",1)
            V48Assert(waited=0,"private extraction worker completes without network")
        }
        finally DllCall("Kernel32\CloseHandle","Ptr",proc.Handle)
        text := FileRead(dest,"UTF-8")
        V48Assert(InStr(text,area) && InStr(text,role) && InStr(text,a) && InStr(text,b),"selected midnight-crossing fight preserves relevant metadata and Unicode")
        V48Assert(!InStr(text,c) && !InStr(text,otherRole),"other fight and unrelated player header are excluded")
        V48Assert(InStr(text,role)<InStr(text,area),"retained headers keep original order so older discipline does not become an invalid backward clock jump")
        V48Assert(FileRead(source,"UTF-8")=role "`r`n" area "`r`n" otherRole "`r`n" a "`r`n" b "`r`n" c "`r`n","original recording remains byte-content equivalent")
    }
    finally {
        if DirExist(dir)
            DirDelete(dir,true)
    }
}

V66UploadTerminalRange()
{
    data := IPNewData("selected-boundaries"),seg := IPNewSegment(data,1000,"test")
    seg.Last := 1800,seg.End := 1800,seg.FinishAt := 2100,seg.ExitAt := 2200,seg.XPCompleteAt := 2300
    range := IPUSelectionRange(seg,data)
    V48Assert(range.Start=1000 && range.Last=2300,"extraction includes completion and exit records after the last scored output")
    V48Assert(seg.Last=1800 && seg.End=1800,"export range does not change fight duration or metrics")
    next := IPNewSegment(data,2300,"test"),caught := false
    try IPUSelectionRange(seg,data)
    catch Error
        caught := true
    V48Assert(caught,"ambiguous adjacent fights cannot leak into a selected-only upload")
    next.Start := 2200,next.Last := 2800,caught := false
    try IPUSelectionRange(next,data)
    catch Error
        caught := true
    V48Assert(caught,"previous fight completion at this start is also treated as an ambiguous boundary")
}

V66UploadAnsiEncoding()
{
    dir := A_Temp "\Iris-v66-ansi-" A_TickCount,DirCreate(dir)
    source := dir "\ansi.txt",dest := dir "\selected.txt",ps := dir "\slice.ps1"
    try {
        original := IPDemoLine(1000,"@Bõõ#1","=","Enter") "`r`n" IPDemoLine(2000,"@Bõõ#1","Dummy {123}:1","Damage",100) "`r`n"
        FileAppend(original,source,"CP0"),f := FileOpen(source,"r","CP0"),enc := f.Encoding,f.Close()
        info := IPUDescribe(source),u := {Scope:"pull",Selection:{Start:1000,Last:2000,Encoding:enc,Size:info.Size,Stamp:info.Stamp}}
        xml := IPUScopeXml(info,"",u)
        V48Assert(InStr(xml,"<encoding>CP"),"actual native ANSI reader encoding is accepted and normalized")
        FileAppend(IPUSliceWorkerSource() "`nIrisSliceLog '" StrReplace(source,"'","''") "' '" StrReplace(dest,"'","''") "' 1000 2000 '" enc "'`n",ps,"UTF-8")
        command := "& ([ScriptBlock]::Create([IO.File]::ReadAllText('" StrReplace(ps,"'","''") "',[Text.Encoding]::UTF8)))"
        exe := A_WinDir "\System32\WindowsPowerShell\v1.0\powershell.exe"
        proc := IPUSpawn(exe,Chr(34) exe Chr(34) " -NoLogo -NoProfile -NonInteractive -EncodedCommand " IPUBase64(command))
        try {
            waited := DllCall("Kernel32\WaitForSingleObject","Ptr",proc.Handle,"UInt",15000,"UInt")
            if waited=258
                DllCall("Kernel32\TerminateProcess","Ptr",proc.Handle,"UInt",1)
            V48Assert(waited=0,"native ANSI extraction completes offline")
        }
        finally DllCall("Kernel32\CloseHandle","Ptr",proc.Handle)
        V48Assert(FileRead(dest,"UTF-8")=FileRead(source,enc),"ANSI accented player names survive conversion into uploaded UTF-8")
        u.Selection.Encoding := "UTF-16",caught := false
        try IPUScopeXml(info,"",u)
        catch Error
            caught := true
        V48Assert(caught,"unsupported encoding fails before upload")
    }
    finally {
        if DirExist(dir)
            DirDelete(dir,true)
    }
}

V66EffectsFeed(s,at,source,target,name,id,action := "apply",charges := -1,origin := "one")
{
    line := IAEffectLine(at,source,target,name,id,action,charges)
    return IEFObserve(s,IPParseLine(line),at,line,10000,origin,"@Me#1")
}

V66EffectsApplyRemove()
{
    s := IEFNewState()
    V66EffectsFeed(s,1000,"@Me#1","Boss {99001}:1","Burn","90001")
    V66EffectsFeed(s,1001,"@Other#2","Boss {99001}:1","Burn","90001")
    V66EffectsFeed(s,1002,"@Me#1","Boss {99001}:2","Burn","90001")
    V48Assert(s.Active.Count=3,"caster and target instance have independent effect identities")
    V66EffectsFeed(s,2000,"@Me#1","Boss {99001}:1","Burn","90001","remove")
    V48Assert(s.Active.Count=2,"remove affects exactly the matching caster/target/effect")
    for key,item in s.Active
        V48Assert(item.Target.Key!="N:99001:1:Boss" || item.Source.Key!="@Me#1","removed row cannot survive")
}

V66EffectsCharges()
{
    s := IEFNewState()
    V66EffectsFeed(s,1000,"@Me#1","@Tank#3","Kolto Shell","985226842996736","apply",6)
    V66EffectsFeed(s,5000,"@Me#1","@Tank#3","Kolto Shell","985226842996736","charges",5)
    for key,item in s.Active
        V48Assert(item.Start=1000 && item.Last=5000 && item.Charges=5,"charge consumption does not reset application time")
    V66EffectsFeed(s,6000,"@Me#1","@Tank#3","Kolto Shell","985226842996736","charges",0)
    V48Assert(s.Active.Count=0,"zero charges remove current effect")
    V66EffectsFeed(s,7000,"@Me#1","@Tank#3","Kolto Shell","985226842996736","charges",4)
    for key,item in s.Active
        V48Assert(item.Start=-1 && item.Partial && item.Charges=4,"late attach charge record has unknown start")
}

V66EffectsUnknownAndEstimate()
{
    s := IEFNewState()
    V66EffectsFeed(s,1000,"@Me#1","@Tank#3","Probe","90002")
    for key,item in s.Active {
        status := IEFRowState(item,5000,90000,Map())
        V48Assert(status.Time="4s ago" && !status.Estimated && !status.Stale,"without metadata display age, never fabricated remaining")
        status := IEFRowState(item,5000,90000,IEFDurationMap("Probe = 18"))
        V48Assert(status.Time="~14s" && status.Estimated && !status.Stale,"entered duration visibly estimated")
        status := IEFRowState(item,19000,90000,IEFDurationMap("Probe = 18"))
        V48Assert(status.Stale && InStr(status.Time,"?"),"elapsed estimate remains uncertain, not silently active")
        status := IEFRowState(item,100000,90000,Map())
        V48Assert(status.Stale,"old unremoved evidence marked uncertain")
    }
    V48Assert(IEFDurationMap("Probe=18`n985226842996736=30`nBad=0`nLarge=3601`nNo separator").Count=2,"duration input is bounded and validated")
}

V66EffectsFilters()
{
    s := IEFNewState(),p := IEFUNewState()
    V66EffectsFeed(s,1000,"@Me#1","@Tank#3","Barrier","90001")
    V66EffectsFeed(s,2000,"@Other#2","@Tank#3","Barrier","90001")
    V66EffectsFeed(s,3000,"@Me#1","Boss {99001}:1","Burn","90002")
    V48Assert(IEFRows(s,p,5000).Count=2,"default only own effects")
    p.TargetFilter := 2
    V48Assert(IEFRows(s,p,5000).Count=1,"player target filter")
    p.TargetFilter := 3
    V48Assert(IEFRows(s,p,5000).Count=1,"NPC target filter")
    p.TargetFilter := 1,p.SourceFilter := 2,p.NameFilter := "missing, barrier"
    V48Assert(IEFRows(s,p,5000).Count=2,"comma alternatives and case-insensitive name match")
    p.NameFilter := "90002"
    V48Assert(IEFRows(s,p,5000).Count=1,"numeric effect filter")
    p.SourceFilter := 1,s.Owner := ""
    V48Assert(IEFRows(s,p,5000).Count=0,"unknown owner never chooses another player")
}

V66EffectsBoundaries()
{
    s := IEFNewState()
    V66EffectsFeed(s,1000,"@Me#1","@Tank#3","Barrier","90001")
    V66EffectsFeed(s,2000,"@Me#1","@Tank#3","Burn","90002","apply",-1,"two")
    V48Assert(s.Active.Count=1 && s.Source="two","source replacement clears old effects")
    ev := IPParseLine(IAEffectLine(2500,"@Me#1","@Tank#3","Burn","90002"))
    ev.Kind := "Death",IEFObserve(s,ev,2500,"",10000,"two","@Me#1")
    V48Assert(s.Active.Count=0,"target death removes its effects")
    V66EffectsFeed(s,3000,"@Me#1","@Tank#3","Barrier","90001","apply",-1,"two")
    ev.Kind := "Area",IEFObserve(s,ev,4000,"",10000,"two","@Me#1")
    V48Assert(s.Active.Count=0 && s.BossKey="","area boundary clears effects and boss note context")
}

V66EffectsOutOfOrder()
{
    s := IEFNewState()
    V66EffectsFeed(s,5000,"@Me#1","@Tank#3","Probe","90001","apply",2)
    V66EffectsFeed(s,4500,"@Me#1","@Tank#3","Probe","90001","remove")
    V66EffectsFeed(s,4600,"@Me#1","@Tank#3","Probe","90001","charges",1)
    for key,item in s.Active
        V48Assert(item.Start=5000 && item.Charges=2,"older remove/charges cannot erase newer application")
    V66EffectsFeed(s,6000,"@Me#1","@Tank#3","Probe","90001","apply",2)
    for key,item in s.Active
        V48Assert(item.Start=6000,"explicit reapplication refreshes known application time")
    V66EffectsFeed(s,4000,"@Me#1","@Tank#3","Old effect","90002","apply",1)
    death := IPParseLine(IPDemoLine(5500,"@Enemy#4","@Tank#3","Death"))
    IEFObserve(s,death,5500,"",10000,"one","@Me#1")
    V48Assert(s.Active.Count=1,"reordered death removes older effects but preserves a newer application")
    for key,item in s.Active
        V48Assert(item.Id="90001" && item.Start=6000 && item.Charges=2,"newer effect retains its exact source, target, start and charges")
    IEFObserve(s,death,6000,"",10000,"one","@Me#1")
    V48Assert(!s.Active.Count,"a death at the latest effect timestamp still clears it")
}

V66EffectsGridOwnership()
{
    s := IEFNewState(),p := IEFUNewState(),p.Slots := "Tank`nOther`nMissing"
    V66EffectsFeed(s,1000,"@Me#1","@Tank#3","Kolto Probe","90001","apply",2)
    V66EffectsFeed(s,1000,"@Other#2","@Tank#3","Static Barrier","3411286364782592")
    V66EffectsFeed(s,1001,"@Me#1","@Other#2","Kolto Shell","985226842996736","apply",6)
    rows := IEFGridRows(s,p,5000)
    V48Assert(rows.Length=8 && rows[1].Name="Tank" && rows[1].Text="Probe×2","manual slot and own probe stacks")
    V48Assert(!InStr(rows[1].Text,"Barrier") && rows[2].Text="Shell×6","another healer's effects never credited to you")
    V48Assert(rows[3].Text="Not observed","missing players not invented")
    p.Slots := "",rows := IEFGridRows(s,p,5000)
    V48Assert(rows[1].Name="Me" && rows[2].Name="Other" && rows[3].Name="Tank","automatic frames have deterministic alphabetical slots")
}

V66EffectsGridAmbiguity()
{
    s := IEFNewState(),p := IEFUNewState(),p.Slots := "Tank"
    V66EffectsFeed(s,1000,"@Me#1","@Tank#3","Kolto Probe","90001","apply",2)
    V66EffectsFeed(s,1001,"@Me#1","@Tank#4","Kolto Probe","90001","apply",1)
    V48Assert(IEFGridRows(s,p,5000)[1].Text="Choose full @name#ID","same display name is not silently combined")
    p.Slots := "@Tank#4"
    V48Assert(IEFGridRows(s,p,5000)[1].Text="Probe×1","explicit token resolves duplicate name")
}

V66EffectsLimitAndPrune()
{
    s := IEFNewState(),p := IEFUNewState()
    Loop 30
        V66EffectsFeed(s,1000+A_Index,"@Me#1","@Tank#3","Effect " A_Index,90000+A_Index)
    result := IEFRows(s,p,5000,5)
    V48Assert(result.Count=30 && result.Rows.Length=5 && result.Rows[1].Effect.Name="Effect 30","view bounds preserve honest total and newest ordering")
    V66EffectsFeed(s,1900000,"@Me#1","@Tank#3","New","99900")
    V48Assert(s.Active.Count=1 && s.Pruned=30,"half-hour old unremoved evidence pruned separately from parser data")
}

V66EffectsNotesModel()
{
    s := IEFNewState(),p := IEFUNewState(),p.Notes["general"] := "Ready",p.Notes["TYTH"] := "Tank north"
    V48Assert(IEFNotesView(s,p).Text="Ready","general notes between bosses")
    s.BossKey := "TYTH"
    V48Assert(IEFNotesView(s,p).Text="Tank north","detected boss switches its own notes")
    s.BossKey := "unknown"
    V48Assert(IEFNotesView(s,p).Text="Ready","general fallback for missing boss notes")
    p.NoteFollow := false,p.NoteSelected := "TYTH"
    V48Assert(IEFNotesView(s,p).Text="Tank north","manual notes remain pinned")
    text := "100% heal`r`nKeep %0A literal \ path`n漢字 ñ"
    V48Assert(IEFDecode(IEFEncode(text))=text,"INI note encoding preserves multiline, percent sequences and Unicode")
}

V66EffectsUIFixture(fn)
{
    global IEF,IEFU
    oldState := IEF,oldUI := IEFU
    try {
        IEF := IEFNewState(),IEFU := IEFUNewState()
        V522Isolated(fn)
    }
    finally {
        IEFShutdown(),IEF := oldState,IEFU := oldUI
    }
}

V66EffectsUIHidden() => V66EffectsUIFixture(V66EffectsUIHiddenCase)
V66EffectsUIHiddenCase()
{
    global IPM,IP,IEF
    for kind in ["Effects","HealerGrid","RaidNotes"] {
        p := IPM.Panels[kind],IPMEnsureGui(kind,0,p),IPMRender(kind,{State:"IMPORTED"},p)
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd),"effect/notes fixture is hidden")
        V48Assert((DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt") & 0x08000020)=0x08000020,"overlay is click-through and nonactivating")
        V48Assert(!IP.Active && IEF.Active.Count=0,"rendering does not start parser or create effects")
        IPM.Editing := true,IPMStyle(p)
        V48Assert(!(DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt") & 0x20),"shared unlock works")
        IPM.Editing := false
    }
}

V66EffectsUIPreview() => V66EffectsUIFixture(V66EffectsUIPreviewCase)
V66EffectsUIPreviewCase()
{
    global IEF,IEFU,IPM
    V66EffectsFeed(IEF,1000,"@Me#1","@Tank#3","Real effect","90001")
    original := IEF.Active.Count,rev := IEF.Revision
    for kind in ["Effects","HealerGrid","RaidNotes"] {
        p := IPM.Panels[kind],IPMEnsureGui(kind,0,p),IPMRender(kind,{LayoutPreview:true},p)
        V48Assert(InStr(p.Heading.Text,"PREVIEW"),"sample overlay visibly identified")
        V48Assert(IEF.Active.Count=original && IEF.Revision=rev,"preview leaves real evidence untouched")
    }
}

V66EffectsUILayout() => V66EffectsUIFixture(V66EffectsUILayoutCase)
V66EffectsUILayoutCase()
{
    global IPM,IEFU
    for kind in ["Effects","HealerGrid","RaidNotes"] {
        p := IPM.Panels[kind],IPMEnsureGui(kind,0,p)
        for width in [196,360,520] {
            p.Width := width
            for font in [8,12,18] {
                IPM.Font := font,p.Signature := "",IPMRender(kind,{LayoutPreview:true},p)
                p.Meta.GetPos(&x,&y,&w,&h)
                V48Assert(x>=0 && x+w<=p.Layout.W && y+h<=p.Layout.H,"status remains inside panel")
                if kind="RaidNotes" {
                    p.Empty.GetPos(&x,&y,&w,&h)
                    V48Assert(y>=p.Layout.Header && x+w<=p.Layout.W && y+h<=p.Layout.H,"notes body within bounds")
                    V48Assert(!(DllCall("User32\GetWindowLongW","Ptr",p.Empty.Hwnd,"Int",-16,"UInt") & 0x200),"notes must retain real multiline text, not center-image single-line style")
                } else {
                    n := kind="HealerGrid" ? 8 : p.VisibleRows
                    Loop n {
                        r := p.Rows[A_Index]
                        if kind="HealerGrid" {
                            cell := p.EffectCells.Get((A_Index-1)*3+1,"")
                            V48Assert(!(DllCall("User32\GetWindowLongW","Ptr",r.Name.Hwnd,"Int",-16,"UInt") & 0x200)
                                && (InStr(r.Name.Text,"`n") || (IsObject(cell) && cell.Label.Visible)),"healer name and effect content remain separate native lines")
                        }
                        for ctrl in (kind="HealerGrid" ? [r.Name] : [r.Name,r.Total]) {
                            ctrl.GetPos(&x,&y,&w,&h)
                            V48Assert(x>=0 && y>=p.Layout.Header && x+w<=p.Layout.W && y+h<=p.Layout.H,
                                "text controls fit native rows/cells: " kind " width=" width " font=" font " row=" A_Index " box=" x "," y "," w "," h " panel=" p.Layout.W "," p.Layout.H " header=" p.Layout.Header)
                        }
                    }
                }
            }
        }
    }
    p := IPM.Panels["HealerGrid"],p.Width := 520,p.Height := 620,p.AutoHeight := false,IPM.Font := 10
    for columns in [1,2,4] {
        IEFU.Columns := columns,p.Signature := "",IPMRender("HealerGrid",{LayoutPreview:true},p)
        last := p.Rows[8].Name,last.GetPos(&x,&y,&w,&h)
        V48Assert(x+w<=p.Layout.W && y+h<=p.Layout.H,"manual column layouts stay inside resized grid")
        V48Assert(p.Layout.H-(y+h)<p.Layout.RowH,"manual height stretches cells to align operation frames")
    }
}

V66EffectsUIOptions() => V66EffectsUIFixture(V66EffectsUIOptionsCase)
V66EffectsUIOptionsCase()
{
    global IEFU,IEF,IPM
    IEFOpenOptions(),c := IEFU.Controls
    V48Assert(IPMGuiAlive(IEFU.Gui) && !DllCall("User32\IsWindowVisible","Ptr",IEFU.Gui.Hwnd),"options constructed natively without showing")
    c["StaleAfter"].Value := 0
    V48Assert(!IEFApplyOptions() && IEFU.StaleAfter=90,"invalid stale threshold cannot mutate preferences")
    c["StaleAfter"].Value := 60,c["Durations"].Value := "Probe = nonsense"
    V48Assert(!IEFApplyOptions() && IEFU.StaleAfter=90,"invalid duration rejected atomically")
    c["Durations"].Value := "Probe = 18",c["NameFilter"].Value := "Burn",c["Columns"].Choose(3)
    V48Assert(IEFApplyOptions() && IEFU.StaleAfter=60 && IEFU.Columns=4 && IEFU.NameFilter="Burn","valid settings apply in isolated memory")
    V48Assert(IEF.Active.Count=0,"options do not inject samples into live state")
}

V66EffectsUINotes() => V66EffectsUIFixture(V66EffectsUINotesCase)
V66EffectsUINotesCase()
{
    global IEFU,IEF,IPM
    IEFNotesOpen(),c := IEFU.NoteControls
    V48Assert(IPMGuiAlive(IEFU.NoteGui) && !DllCall("User32\IsWindowVisible","Ptr",IEFU.NoteGui.Hwnd),"notes editor hidden in native diagnostics")
    c["Text"].Value := "General note`nsecond line",c["Follow"].Value := 1
    V48Assert(IEFNotesSave() && StrReplace(IEFU.Notes["general"],"`r")="General note`nsecond line","multiline note retained through native edit newline normalization")
    c["Choice"].Choose(2),IEFNotesChoose(),key := IEFU.NoteSelected
    c["Text"].Value := "Boss assignment",IEFNotesSave(),IEF.BossKey := key
    p := IPM.Panels["RaidNotes"],IPMEnsureGui("RaidNotes",0,p),IPMRender("RaidNotes",{},p)
    V48Assert(p.Empty.Text="Boss assignment","automatic boss renders corresponding notes")
    IEF.BossKey := "",IPMRender("RaidNotes",{},p)
    V48Assert(InStr(p.Empty.Text,"General note"),"between bosses shows general note")
}

V66EffectsUILayoutProfile() => V66EffectsUIFixture(V66EffectsUILayoutProfileCase)
V66EffectsUILayoutProfileCase()
{
    global IEFU,IEF
    IEFU.Notes["general"] := "Do not change",IEFU.Slots := "Tank",IEFU.Columns := 4
    profile := IEFLayoutCapture(),IEFU.Columns := 1
    V48Assert(!profile.Has("Notes") && !profile.Has("Slots") && !profile.Has("Active"),"profile includes display preferences only")
    IEFLayoutApply(profile)
    V48Assert(IEFU.Columns=4 && IEFU.Slots="Tank" && IEFU.Notes["general"]="Do not change","layout restore preserves assignment data")
    IEFLayoutApply(Map("Columns",0,"SourceFilter",9,"NameFilter","Probe"))
    V48Assert(IEFU.Columns=4 && IEFU.SourceFilter=1 && IEFU.NameFilter="Probe","invalid profile values bounded independently")
}

; Isolated native streaming and rollback checks. No live file, game input,
; sound, upload, settings changes, or normal overlay is opened.
V66SActors()
{
    return {Tank:"@Tank#1|(0,0,0,0)|(90000/100000)",Healer:"@Healer#2|(0,0,0,0)|(90000/100000)",
        Other:"@Other Healer#3|(0,0,0,0)|(90000/100000)",Boss:"Example boss {990000000000123}:9|(0,0,0,0)|(90000/100000)"}
}

V66SStart(gains := true)
{
    s := IPNewData("Shield diagnostic"),a := V66SActors()
    if gains
        IPFeedLine(s,IAEffectLine(500,a.Healer,a.Tank,"Static Barrier","3411286364782592"))
    IPFeedLine(s,IPDemoLine(1000,a.Tank,"=","Enter"))
    IPFeedLine(s,IPDemoLine(1100,a.Tank,a.Boss,"Damage",100))
    return s
}

V66SAbs(s,at := 2000,amount := 1000,effective := 200,absorbed := 800,shield := false)
{
    a := V66SActors()
    IPFeedLine(s,IAAbsorbLine(at,a.Boss,a.Tank,amount,effective,absorbed,shield))
}

V66SCommit(s,at := 3000)
{
    a := V66SActors()
    IPFeedLine(s,IPDemoLine(at,a.Tank,a.Boss,"Damage",100))
}

V66ShieldArithmetic()
{
    a := V66SActors()
    for args in [[1000,200,800,false,"ability"],[1000,200,799,false,"ability"],[600,-1,400,true,"tank"],
        [1000,200,600,false,"ambiguous"],[1000,0,1000,false,"ability"],[1000,1200,200,false,"ambiguous"]] {
        line := IAAbsorbLine(1000,a.Boss,a.Tank,args[1],args[2],args[3],args[4]),ev := IPParseLine(line)
        legacy := IAExtra(ev,line,1000,1)
        V48Assert(ev.ShieldMode=args[5] && ev.ShieldMode=legacy.AbsMode && ev.ShieldAbsorb=legacy.Abs,"stream arithmetic agrees with Analysis without inventing credit")
    }
    ev := IPParseLine(IPDemoLine(1000,a.Boss,a.Tank,"Damage",1000))
    V48Assert(!ev.HasOwnProp("ShieldAbsorb"),"ordinary damage has no shield annotation")
}

V66ShieldPrepullCredit()
{
    s := V66SStart(),seg := s.Current,V66SAbs(s),V66SCommit(s)
    V48Assert(seg.ShieldCredit.Get("@Healer#2",0)=800 && seg.ShieldSummary.Get("Credit",0)=800,"pre-pull supported bubble receives limited estimated credit")
    V48Assert(seg.Actors.Has("@Healer#2") && seg.Totals["@Healer#2"].Effective=0 && seg.Totals["@Healer#2"].Heal=0,"shield-only source is visible without changing direct totals")
    V48Assert(seg.Totals["@Tank#1"].Damage=200 && seg.Totals["@Tank#1"].Taken=1000,"shielding leaves damage and existing taken calculation unchanged")
    snap := IPMSnapshot({Data:s,Segment:seg,State:"TEST",Pending:0})
    for actor in snap.Actors {
        if actor.Key="@Healer#2"
            V48Assert(actor.Shield=800 && ISHAmount(actor,true)=800 && ISHAmount(actor,false)=0,"display can include estimated shielding or direct-only healing")
    }
    V48Assert(snap.Shields.Available && snap.Shields.Credit=800,"fresh snapshot copies shield summary")
}

V66ShieldOverlap()
{
    s := V66SStart(),a := V66SActors()
    IPFeedLine(s,IAEffectLine(1500,a.Tank,a.Tank,"Sonic Barrier","2308471907155968"))
    V66SAbs(s),V66SCommit(s)
    V48Assert(s.Current.ShieldCredit.Count=0 && s.Current.ShieldSummary["Unassigned"]=800,"overlapping supported effects remain unassigned")
    for key,row in s.Current.ShieldBreakdown
        V48Assert(InStr(row.Reason,"overlapping") && row.Amount=800,"overlap explanation is retained in accessible breakdown")
}

V66ShieldUnsupportedAndTank()
{
    s := V66SStart(false),a := V66SActors()
    IPFeedLine(s,IAEffectLine(1500,a.Healer,a.Tank,"Power Barrier","3394793690365952"))
    V66SAbs(s),V66SAbs(s,2200,600,-1,400,true),V66SAbs(s,2400,1000,200,600),V66SCommit(s)
    summary := s.Current.ShieldSummary
    V48Assert(s.Current.ShieldCredit.Count=0 && summary["Unassigned"]=800,"shield-like names do not create source credit")
    V48Assert(summary["Tank"]=400 && summary["Ambiguous"]=600,"tank mitigation and unclear absorption stay separate from ability credit")
}

V66ShieldAdjacentRemoval()
{
    s := V66SStart(),a := V66SActors()
    IPFeedLine(s,IAEffectLine(2000,a.Healer,a.Tank,"Static Barrier","3411286364782592","remove"))
    V66SAbs(s,2001),V66SAbs(s,2002),V66SCommit(s)
    V48Assert(s.Current.ShieldCredit.Get("@Healer#2",0)=800 && s.Current.ShieldSummary["Unassigned"]=800,"one adjacent removal witness cannot fund two results")
    V48Assert(s.Current.ShieldWitness.Count=1,"consumed witness recorded separately from totals")
}

V66ShieldRemovalBounds()
{
    a := V66SActors(),s := V66SStart()
    IPFeedLine(s,IAEffectLine(2000,a.Healer,a.Tank,"Static Barrier","3411286364782592","remove"))
    V66SAbs(s,2003),V66SCommit(s)
    V48Assert(s.Current.ShieldSummary["Unassigned"]=800,"removal more than two milliseconds old is rejected")
    s := V66SStart()
    IPFeedLine(s,IAEffectLine(2000,a.Healer,a.Tank,"Static Barrier","3411286364782592","remove"))
    loop 17
        IPFeedLine(s,IPDemoLine(2000,a.Tank,"=","Activate",0,false,-1,"Between","900000000000999"))
    V66SAbs(s,2001),V66SCommit(s)
    V48Assert(s.Current.ShieldSummary["Unassigned"]=800,"removal separated by more than sixteen records is rejected")
}

V66ShieldDeathAndRefresh()
{
    s := V66SStart(),a := V66SActors()
    IPFeedLine(s,IPDemoLine(1600,a.Boss,a.Tank,"Death")),V66SAbs(s,1700),V66SCommit(s,1800)
    V48Assert(s.Current.ShieldCredit.Count=0,"target death clears preexisting bubble evidence")
    IPFeedLine(s,IAEffectLine(1900,a.Healer,a.Tank,"Static Barrier","3411286364782592")),V66SAbs(s,2000),V66SCommit(s)
    V48Assert(s.Current.ShieldCredit["@Healer#2"]=800,"fresh effect after death can supply new evidence")
    IPFeedLine(s,IAEffectLine(3100,a.Healer,a.Tank,"Static Barrier","3411286364782592"))
    V48Assert(s.ShieldEvidence.Active.Count=1,"same source/effect refresh does not create an overlap")
}

V66ShieldAreaAndSource()
{
    s := V66SStart(),a := V66SActors()
    IPBSourceBoundary(s,"different-log")
    IPFeedLine(s,IPDemoLine(1000,a.Tank,"=","Enter")),V66SAbs(s),V66SCommit(s)
    V48Assert(s.Current.ShieldCredit.Count=0 && s.Current.ShieldSummary["Unassigned"]=800,"new source cannot inherit old bubble ownership")
    s := V66SStart()
    ev := IPParseLine(IPDemoLine(1500,a.Tank,"=","Enter")),ev.Kind := "Area",ev.AreaId := "test",ev.ModeId := ""
    ISHObserve(s,ev,1500),IPBFeedEvent(s,ev,1500)
    IPFeedLine(s,IPDemoLine(1600,a.Tank,"=","Enter")),V66SAbs(s),V66SCommit(s)
    V48Assert(s.Current.ShieldCredit.Count=0,"area boundary discards prior-instance effect evidence")
}

V66ShieldExpiry()
{
    s := V66SStart(),a := V66SActors()
    V66SAbs(s,30501),V66SCommit(s,31000)
    V48Assert(s.Current.ShieldCredit.Count=0,"effect older than thirty seconds is not guessed active")
    IPFeedLine(s,IAEffectLine(32000,a.Healer,a.Tank,"Static Barrier","3411286364782592","remove")),V66SAbs(s,32001),V66SCommit(s,33000)
    V48Assert(s.Current.ShieldCredit.Count=0,"removing an expired effect cannot revive attribution")
}

V66ShieldRollback()
{
    s := V66SStart(),a := V66SActors(),seg := s.Current
    IPFeedLine(s,IAEffectLine(2000,a.Healer,a.Tank,"Static Barrier","3411286364782592","remove")),V66SAbs(s,2001)
    V48Assert(seg.ShieldCredit["@Healer#2"]=800 && seg.ShieldWitness.Count=1 && IsObject(seg.Undo),"speculative incoming credit participates in the existing reversible tail")
    pending := IPBRollbackTail(s,seg)
    V48Assert(seg.ShieldCredit.Count=0 && seg.ShieldWitness.Count=0 && seg.ShieldBreakdown.Count=0,"rollback restores credit, consumed evidence and detail rows")
    V48Assert(!seg.Actors.Has("@Healer#2"),"shield-only actor added by rolled-back damage is also undone")
    for item in pending
        IPApplyEvent(s,item.Event,item.At)
    V48Assert(seg.ShieldCredit["@Healer#2"]=800 && seg.ShieldWitness.Count=1,"accepted replay reapplies the physical record exactly once")
}

V66ShieldPhysicalSnapshot()
{
    s := V66SStart(),a := V66SActors(),seg := s.Current
    V66SAbs(s,2000),pending := IPBRollbackTail(s,seg)
    IPFeedLine(s,IAEffectLine(2100,a.Other,a.Tank,"Static Barrier","3411286364782592"))
    for item in pending
        IPApplyEvent(s,item.Event,item.At)
    V48Assert(seg.ShieldCredit["@Healer#2"]=800 && !seg.ShieldCredit.Has("@Other Healer#3"),"replay uses event-time evidence rather than newer overlapping bubble")
}

V66ShieldActorCap()
{
    s := V66SStart(),seg := s.Current,seg.ActorCap := seg.Actors.Count
    V66SAbs(s),V66SCommit(s)
    V48Assert(seg.ShieldCredit.Count=0 && seg.ShieldSummary["Unassigned"]=800,"source beyond actor limit remains unassigned instead of bypassing cap")
}

V66ShieldUnknownHealing()
{
    actor := {Heal:100,Effective:0,HealRecords:1,HealKnown:0,Shield:800}
    V48Assert(ISHAmount(actor,true)<0,"positive shields cannot turn unknown direct healing into a claimed total")
    actor.HealKnown := 1,actor.Effective := 75
    V48Assert(ISHAmount(actor,true)=875 && ISHAmount(actor,false)=75,"estimated combined value and direct-only toggle keep separate semantics")
}

V66ShieldAnalysisParity()
{
    d := IADemoData(),s := IPNewData("Streaming comparison")
    for line in d.DemoLines
        IPFeedLine(s,line)
    IPCloseSegment(s,"test complete"),seg := s.Segments[1],expected := 0
    for credit in d.Credits {
        if credit.Source!=""
            expected += credit.Amount
    }
    V48Assert(expected=800 && seg.ShieldSummary["Credit"]=expected,"native streaming estimate matches existing post-fight Analysis fixture")
    V48Assert(seg.ShieldSummary["Tank"]=400,"Analysis tank-shield distinction remains preserved")
}

V66ShieldSnapshotIsolation()
{
    s := V66SStart(),V66SAbs(s),V66SCommit(s)
    snap := IPMSnapshot({Data:s,Segment:s.Current,State:"TEST",Pending:0})
    snap.Shields.Credit := 0
    for actor in snap.Actors
        actor.Shield := 0
    V48Assert(s.Current.ShieldSummary["Credit"]=800 && s.Current.ShieldCredit["@Healer#2"]=800,"display snapshot cannot mutate parser credit")
    old := {Actors:[]},legacy := {}
    ISHSnapshot(legacy,old)
    V48Assert(!old.Shields.Available && old.Shields.Credit=0,"legacy cached data is unavailable, not falsely claimed complete")
}

V66ShieldRemovalThenNewSource()
{
    s := V66SStart(),a := V66SActors()
    IPFeedLine(s,IAEffectLine(2000,a.Healer,a.Tank,"Static Barrier","3411286364782592","remove")),V66SAbs(s,2001)
    IPFeedLine(s,IAEffectLine(2001,a.Other,a.Tank,"Static Barrier","3411286364782592")),V66SAbs(s,2002),V66SCommit(s)
    V48Assert(s.Current.ShieldCredit["@Healer#2"]=800 && s.Current.ShieldCredit["@Other Healer#3"]=800,"spent removal does not obscure a new unique active source")
}

V66ShieldNativeDetails()
{
    V65UITimerIsolated(V66ShieldNativeDetailsCase)
}

V66ShieldNativeDetailsCase(path)
{
    global IP,IPM,Audio
    prior := IP,queue := Audio.Queue.Length,active := WinExist("A")
    try {
        s := V66SStart(),V66SAbs(s),V66SCommit(s),IP := IPNewApp(),IP.Offline := s,IP.View := "Offline",IPM.Source := 2
        IPM.IncludeShieldCredit := true
        g := ISHShowDetails()
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"shield details are hidden in diagnostics")
        V48Assert(InStr(IPM.ShieldDetailStatus.Text,"800"),"native detail summary displays the accepted estimate")
        checkbox := "",list := ""
        for control in g {
            if control.Type="CheckBox"
                checkbox := control
            if control.Type="ListView"
                list := control
        }
        V48Assert(IsObject(list) && list.GetCount()=1 && InStr(list.GetText(1,5),"Estimated"),"native table exposes source and inference reason")
        checkbox.Value := 0,ISHSetIncluded(checkbox)
        V48Assert(!IPM.IncludeShieldCredit && IniRead(path,"IrisParseDisplay","IncludeShieldCredit")="0","direct-only choice saves through isolated settings")
        V48Assert(Audio.Queue.Length=queue && WinExist("A")=active,"shield details do not change audio or foreground focus")
    }
    finally {
        ISHCloseDetails(),IP := prior
    }
}

V661AuthRoundTrip()
{
    username := "  TestÜser<&>" Chr(34) "'  ",password := "  Päss<&>" Chr(34) "'  "
    blob := IPUAuthSeal(username,password),result := IPUAuthOpen(blob)
    V48Assert(result.Username==Trim(username),"DPAPI round trip preserves username case, Unicode and XML entities while trimming edges")
    V48Assert(result.Password==password,"DPAPI round trip preserves password case, Unicode, entities and leading/trailing spaces")
    V48Assert(!InStr(blob,"<account>") && !InStr(blob,Trim(username)) && !InStr(blob,password),"protected payload contains no readable account fields")
    other := IPUAuthSeal(username,password)
    V48Assert(!(other==blob) && IPUAuthOpen(other).Password==password,"DPAPI produces independent ciphertext for repeated protection")
}

V661AuthInputValidation()
{
    for pair in [["","valid"],["   ","valid"],["valid",""],["valid","   "],["bad`nuser","valid"],["valid","bad`tvalue"],["bad" Chr(127),"valid"],["valid","bad" Chr(133)],[V661AuthRepeatFixture("u",255),"valid"],["valid",V661AuthRepeatFixture("p",1025)]] {
        caught := false
        try IPUAuthSeal(pair[1],pair[2])
        catch Error as err
            caught := !InStr(err.Message,pair[1]="" ? "not-present" : pair[1]) && !InStr(err.Message,pair[2]="" ? "not-present" : pair[2])
        V48Assert(caught,"invalid or oversized account fields fail without echoing their values")
    }
    maxUser := V661AuthRepeatFixture("u",254),maxPass := V661AuthRepeatFixture("p",1024)
    restored := IPUAuthOpen(IPUAuthSeal(maxUser,maxPass))
    V48Assert(restored.Username==maxUser && restored.Password==maxPass,"credential limits accept their exact boundaries")
}

V661AuthRepeatFixture(value,count)
{
    text := ""
    Loop count
        text .= value
    return text
}

V661AuthTamperAndTruncation()
{
    blob := IPUAuthSeal("private-test-user","private-test-value")
    raw := IPUAuthDecode(blob)
    at := Floor(raw.Size/2),NumPut("UChar",NumGet(raw,at,"UChar")^0x20,raw,at)
    damaged := IPUAuthEncode(raw.Ptr,raw.Size)
    for invalid in [damaged,SubStr(blob,1,-4),"!" SubStr(blob,2),blob "`n",""] {
        caught := false
        try IPUAuthOpen(invalid)
        catch Error as err
            caught := InStr(err.Message,"could not be opened") && !InStr(err.Message,invalid="" ? "not-present" : invalid)
        V48Assert(caught,"tampered, truncated and noncanonical ciphertext produces a generic safe error")
    }
    V48Assert(IPUAuthOpen(blob).Username=="private-test-user","invalid ciphertext never modifies a valid protected payload")
}

V661AuthFileLifecycle()
{
    dir := V661AuthDirectoryFixture(),path := dir "\account.dpapi"
    try {
        V48Assert(IPUAuthLoad(path)=="","missing account file is treated as no remembered account")
        first := IPUAuthSeal("FirstUser","fake first value"),second := IPUAuthSeal("NextUser","fake next value")
        IPUAuthSave(path,first)
        V48Assert(IPUAuthLoad(path)==first && IPUAuthOpen(IPUAuthLoad(path)).Username=="FirstUser","ciphertext saves and opens from an isolated file")
        IPUAuthSave(path,second)
        V48Assert(IPUAuthLoad(path)==second && FileRead(path,"UTF-8")==second,"atomic update stores only canonical ciphertext")
        extra := 0
        Loop Files dir "\*","F"
            extra += 1
        V48Assert(extra=1,"successful replacement retains neither a plaintext file nor old credential backup")
        V48Assert(IPUAuthDelete(path) && !FileExist(path) && IPUAuthDelete(path),"forget removes the account and is safe when repeated")
    }
    finally {
        if DirExist(dir)
            DirDelete(dir,true)
    }
}

V661AuthFailureKeepsPrevious()
{
    dir := V661AuthDirectoryFixture(),path := dir "\account.dpapi",handle := 0
    try {
        first := IPUAuthSeal("OriginalUser","fake original value"),next := IPUAuthSeal("ReplacementUser","fake replacement value")
        IPUAuthSave(path,first)
        handle := DllCall("CreateFileW","Str",path,"UInt",0x80000000,"UInt",0,"Ptr",0,"UInt",3,"UInt",0x80,"Ptr",0,"Ptr")
        V48Assert(handle!=-1,"failure regression owns an exclusive handle to its private credential file")
        caught := false
        try IPUAuthSave(path,next)
        catch Error as err
            caught := InStr(err.Message,"previous saved account was kept")
        V48Assert(caught,"locked destination rejects replacement safely")
        caught := false
        try IPUAuthLoad(path)
        catch Error as err
            caught := InStr(err.Message,"could not be read")
        V48Assert(caught,"unreadable credential file raises a safe error rather than looking signed out")
        caught := false
        try IPUAuthDelete(path)
        catch Error as err
            caught := InStr(err.Message,"could not be removed")
        V48Assert(caught,"failed forget does not report success")
        DllCall("CloseHandle","Ptr",handle),handle := 0
        V48Assert(IPUAuthLoad(path)==first,"failed save retains the exact prior account ciphertext")
        leftovers := 0
        Loop Files dir "\*.new-*","F"
            leftovers += 1
        V48Assert(leftovers=0,"failed replacement cleans up its temporary ciphertext file")
        caught := false
        try IPUAuthSave(path,"invalid")
        catch Error
            caught := true
        V48Assert(caught && IPUAuthLoad(path)==first,"invalid new ciphertext cannot destroy a remembered account")
    }
    finally {
        if handle && handle!=-1
            DllCall("CloseHandle","Ptr",handle)
        if DirExist(dir)
            DirDelete(dir,true)
    }
}

V661AuthMalformedFile()
{
    dir := V661AuthDirectoryFixture(),path := dir "\account.dpapi"
    try {
        FileAppend("not protected account data",path,"UTF-8-RAW")
        caught := false
        try IPUAuthLoad(path)
        catch Error as err
            caught := InStr(err.Message,"could not be read") && !InStr(err.Message,"not protected account data")
        V48Assert(caught,"malformed disk data is rejected without being reflected in an error")
        caught := false
        try IPUAuthLoad(dir)
        catch Error
            caught := true
        V48Assert(caught,"a directory cannot masquerade as a saved account")
        IPUAuthDelete(path)
        V48Assert(IPUAuthLoad(path)=="","forget also removes malformed account files")
        caught := false
        try IPUAuthSave(dir "\absent\account.dpapi",IPUAuthSeal("AUser","fake value"))
        catch Error
            caught := true
        V48Assert(caught && !DirExist(dir "\absent"),"failed save does not create unrelated parent folders")
    }
    finally {
        if DirExist(dir)
            DirDelete(dir,true)
    }
}

V661AuthDotNetCompatibility()
{
    dir := V661AuthDirectoryFixture(),pid := 0
    try {
        ; Both processes handle fake credentials only. The worker receives just
        ; DPAPI ciphertext; its files and command line never contain a password.
        password := "  Ü<&>  ",blob := IPUAuthSeal("MiXeDÜser",password)
        IPUAuthSave(dir "\input.dpapi",blob)
        script := "
        (
$ErrorActionPreference='Stop'
try {
    Add-Type -AssemblyName System.Security
    $data=[Convert]::FromBase64String([IO.File]::ReadAllText((Join-Path $PSScriptRoot 'input.dpapi')))
    $salt=[Text.Encoding]::UTF8.GetBytes('Iris.Parsely.Account.v1')
    $plain=[Security.Cryptography.ProtectedData]::Unprotect($data,$salt,[Security.Cryptography.DataProtectionScope]::CurrentUser)
    try {
        $doc=New-Object System.Xml.XmlDocument
        $doc.PreserveWhitespace=$true
        $doc.XmlResolver=$null
        $doc.LoadXml([Text.Encoding]::UTF8.GetString($plain))
        if($doc.account.username -cne 'MiXeDÜser' -or $doc.account.password.Length -ne 8 -or [int]$doc.account.password[0] -ne 32 -or [int]$doc.account.password[2] -ne 220 -or [int]$doc.account.password[7] -ne 32) {throw 'Mismatch'}
        $next=[Security.Cryptography.ProtectedData]::Protect($plain,$salt,[Security.Cryptography.DataProtectionScope]::CurrentUser)
        [IO.File]::WriteAllText((Join-Path $PSScriptRoot 'output.dpapi'),[Convert]::ToBase64String($next),[Text.Encoding]::ASCII)
        [IO.File]::WriteAllText((Join-Path $PSScriptRoot 'result.txt'),'PASS',[Text.Encoding]::ASCII)
    } finally {if($null -ne $plain) {[Array]::Clear($plain,0,$plain.Length)}}
    exit 0
} catch {
    [IO.File]::WriteAllText((Join-Path $PSScriptRoot 'result.txt'),'FAIL',[Text.Encoding]::ASCII)
    exit 1
}
        )"
        worker := dir "\interop.ps1",FileAppend(script,worker,"UTF-8")
        executable := A_WinDir "\System32\WindowsPowerShell\v1.0\powershell.exe"
        Run('"' executable '" -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "' worker '"',dir,"Hide",&pid)
        ProcessWaitClose(pid,20)
        V48Assert(!ProcessExist(pid),"private .NET DPAPI compatibility worker finishes within its bound")
        pid := 0
        V48Assert(FileRead(dir "\result.txt","UTF-8")=="PASS",".NET CurrentUser unprotect reads native AHK ciphertext with identical entropy and UTF-8 XML")
        restored := IPUAuthOpen(IPUAuthLoad(dir "\output.dpapi"))
        V48Assert(restored.Username=="MiXeDÜser" && restored.Password==password,"AHK unprotect reads .NET DPAPI ciphertext without altering password whitespace")
    }
    finally {
        if pid && ProcessExist(pid)
            ProcessClose(pid)
        if DirExist(dir)
            DirDelete(dir,true)
    }
}

V661AuthDirectoryFixture()
{
    guid := Buffer(16,0),name := Buffer(78,0)
    if DllCall("ole32\CoCreateGuid","Ptr",guid,"Int")!=0 || !DllCall("ole32\StringFromGUID2","Ptr",guid,"Ptr",name,"Int",39)
        throw Error("Could not create a private regression directory.")
    dir := A_Temp "\Iris-v661-auth-" StrGet(name,"UTF-16")
    DirCreate(dir)
    return dir
}

; Native, offline account-upload regressions. Every credential is fictitious.
; UI/storage fixtures replace SETTINGS_FILE before opening the upload dialog.
V661AccountJobEnvelope()
{
    info := {Path:"C:\dummy\combat.txt",Name:"combat.txt",Size:100,Stamp:"20261002123456"}
    user := "IrisFakeÜser-Case",password := "  Fake<&'" Chr(34) "Pass-雪  "
    u := IPUNewState(),u.AccountBlob := IPUAuthSeal(user,password),u.AccountName := user
    anonymous := IPUAccountJobXml(info,"",u)
    V48Assert(anonymous=IPUScopeXml(info,"",u),"unselected account leaves the existing upload payload unchanged")
    u.UseAccount := true,account := IPUAccountJobXml(info,"",u)
    V48Assert(InStr(account,"<accountMode>account</accountMode>") && InStr(account,u.AccountBlob),"account job includes the explicit mode and protected envelope")
    V48Assert(!InStr(account,user) && !InStr(account,password) && !InStr(account,"<password>"),"job metadata never contains plaintext credentials")
    u.AccountBlob := "",caught := false
    try IPUAccountJobXml(info,"",u)
    catch Error
        caught := true
    V48Assert(caught,"selected account with no credentials cannot fall back to anonymous")
    u.AccountBlob := "not-a-valid-envelope",caught := false
    try IPUAccountJobXml(info,"",u)
    catch Error
        caught := true
    V48Assert(caught,"damaged account envelope refuses the upload before worker launch")
}

V661AccountSessionUI()
{
    V661AccountUIFixture(V661AccountSessionCase)
}

V661AccountSessionCase(dir)
{
    global IPU
    IPUOpen()
    V48Assert(!IPU.UseAccount && !IPU.AccountRemember && !IPU.AccountBlob,"fresh upload stays anonymous until account selection")
    IPUAccountOpen(),password := "  FakePassword-é<&>  "
    IPU.AccountUserControl.Value := "FakeCaseSensitiveUser",IPU.AccountPasswordControl.Value := password
    IPU.AccountRememberControl.Value := 0,IPUAccountSave()
    decoded := IPUAuthOpen(IPU.AccountBlob)
    V48Assert(IPU.UseAccount && decoded.Username="FakeCaseSensitiveUser" && decoded.Password=password,"real account controls preserve login case and password whitespace")
    V48Assert(!FileExist(IPUAccountPath()) && !IPU.AccountRemember,"session-only account does not write credential storage")
    V48Assert(!IPMGuiAlive(IPU.AccountGui) && IPU.StartButton.Enabled,"saving account closes the editor and leaves Upload ready")
    IPUAccountOpen()
    V48Assert(IPU.AccountPasswordControl.Value=password && !DllCall("IsWindowVisible","Ptr",IPU.AccountGui.Hwnd),"session account reopens accurately in an isolated hidden native dialog")
    V48Assert((DllCall("GetWindowLongW","Ptr",IPU.AccountPasswordControl.Hwnd,"Int",-16,"UInt") & 0x20)!=0,"native password input masks its value")
    IPUAccountClose(),IPUAccountOpen(),IPUAccountForget()
    V48Assert(!IPU.UseAccount && !IPU.AccountBlob && !IPU.AccountName,"Forget clears session assignment")
    V48Assert(!IPU.Handle && !IPU.Job && !IPU.Busy && !IPU.Starting,"account UI never starts a process or upload")
}

V661AccountRememberUI()
{
    V661AccountUIFixture(V661AccountRememberCase)
}

V661AccountRememberCase(dir)
{
    global IPU
    IPUOpen(),IPUAccountOpen()
    user := "FakeRememberÜser",password := " FakeRememberPassword雪 "
    IPU.AccountUserControl.Value := user,IPU.AccountPasswordControl.Value := password
    IPU.AccountRememberControl.Value := 1,IPUAccountSave(),saved := IPU.AccountBlob
    V48Assert(FileExist(IPUAccountPath()) && IPU.AccountRemember,"Remember creates protected storage in the private fixture only")
    stored := FileRead(IPUAccountPath(),"UTF-8")
    V48Assert(!InStr(stored,user) && !InStr(stored,password),"remembered credential file contains no plaintext identity or password")
    IPU.Gui.Destroy(),IPU := IPUNewState(),IPUOpen()
    V48Assert(IPU.UseAccount && IPU.AccountRemember && IPU.AccountName=user && IPU.AccountBlob=saved,"a fresh uploader restores the remembered assignment")
    IPUAccountOpen(),IPU.AccountRememberControl.Value := 0,IPUAccountSave()
    V48Assert(IPU.UseAccount && !IPU.AccountRemember && !FileExist(IPUAccountPath()),"turning Remember off preserves this session but removes stored details")
    IPUAccountOpen(),IPU.AccountRememberControl.Value := 1,IPUAccountSave()
    IPUAccountOpen(),IPUAccountForget()
    V48Assert(!FileExist(IPUAccountPath()) && !IPU.UseAccount && !IPU.AccountRemember,"Forget removes remembered storage and assignment")
    IPU.Gui.Destroy(),IPU := IPUNewState(),IPUOpen()
    V48Assert(!IPU.UseAccount && !IPU.AccountBlob,"forgotten account is not resurrected on reopen")
}

V661AccountDamagedStorage()
{
    V661AccountUIFixture(V661AccountDamagedCase)
}

V661AccountDamagedCase(dir)
{
    global IPU
    FileAppend("damaged fake account",IPUAccountPath(),"UTF-8")
    IPUOpen()
    V48Assert(IPU.UseAccount && !IPU.AccountBlob && InStr(IPU.Status,"could not be opened"),"unreadable remembered account fails closed and tells the user")
    V48Assert(IPU.AccountBox.Value=1 && InStr(IPU.AccountBox.Text,"needs attention"),"broken saved account is not displayed as an anonymous upload")
    info := {Path:"C:\dummy\combat.txt",Name:"combat.txt",Size:100,Stamp:"20261002123456"},caught := false
    try IPUAccountJobXml(info,"",IPU)
    catch Error
        caught := true
    V48Assert(caught && !IPU.Handle && !IPU.Job,"damaged saved credentials cannot start an anonymous worker")
    IPUAccountOpen(),IPUAccountForget()
    V48Assert(!IPU.UseAccount && !FileExist(IPUAccountPath()),"Forget recovers from a damaged account file")
}

V661AccountBusyAndGeometry()
{
    V661AccountUIFixture(V661AccountBusyCase)
}

V661AccountBusyCase(dir)
{
    global IPU
    IPUOpen(),IPUAccountOpen()
    IPU.AccountUserControl.Value := "FakeUser",IPU.AccountPasswordControl.Value := "FakePassword"
    IPU.Busy := true,IPUAccountSave()
    V48Assert(!IPU.AccountBlob && IPMGuiAlive(IPU.AccountGui),"account cannot change during an active upload")
    IPU.AccountBox.Value := 1,IPUAccountToggle(IPU.AccountBox)
    V48Assert(!IPU.UseAccount && !IPU.AccountBox.Value,"busy upload rejects account toggle")
    IPU.Busy := false
    IPU.AccountUserControl.GetPos(&ux,&uy,&uw,&uh)
    IPU.AccountPasswordControl.GetPos(&px,&py,&pw,&ph)
    IPU.AccountRememberControl.GetPos(&rx,&ry,&rw,&rh)
    IPU.AccountStatusControl.GetPos(&sx,&sy,&sw,&sh)
    IPU.AccountGui.GetClientPos(,,&gw,&gh)
    V48Assert(uy+uh<=py && py+ph<=ry && ry+rh<=sy,"account edit/remember/status rows do not overlap")
    V48Assert(ux+uw<=gw && px+pw<=gw && sx+sw<=gw && sy+sh<=gh,"account controls fit the native client area")
    IPU.AccountBox.GetPos(&ax,&ay,&aw,&ah),IPU.AccountButton.GetPos(&bx,&by,&bw,&bh)
    IPU.FileControl.GetPos(&fx,&fy,&fw,&fh)
    V48Assert(ax+aw<=bx && Max(ay+ah,by+bh)<=fy,"upload account row fits before file selection without overlap")
    V48Assert(!DllCall("IsWindowVisible","Ptr",IPU.Gui.Hwnd) && !DllCall("IsWindowVisible","Ptr",IPU.AccountGui.Hwnd),"both native dialogs stay hidden")
}

V661AccountUIFixture(callback)
{
    global IPU,IP,SETTINGS_FILE,Persist,Audio
    oldU := IPU,oldIP := IP,oldFile := SETTINGS_FILE,oldPersist := Persist,initialAudio := Audio.Queue.Length
    dir := A_Temp "\Iris-v661-account-ui-" A_TickCount,DirCreate(dir)
    try {
        SETTINGS_FILE := dir "\private.ini",IPU := IPUNewState(),IP := IPNewApp()
        callback.Call(dir)
        V48Assert(Audio.Queue.Length=initialAudio && !IP.Active,"account diagnostics leave audio and encounter state untouched")
    }
    finally {
        IPU.Busy := false,IPU.Starting := false,IPUAccountClose()
        if IPMGuiAlive(IPU.Gui)
            IPU.Gui.Destroy()
        IPU := oldU,IP := oldIP,SETTINGS_FILE := oldFile,Persist := oldPersist
        if DirExist(dir)
            DirDelete(dir,true)
    }
}

V661AccountWorkerSuccess()
{
    V661AccountWorkerFixture("success","account")
}

V661AccountWorkerAnonymous()
{
    V661AccountWorkerFixture("success","anonymous")
}

V661AccountWorkerInvalidLogin()
{
    V661AccountWorkerFixture("invalid","account")
}

V661AccountWorkerUnexpectedReply()
{
    V661AccountWorkerFixture("unexpected","account")
}

V661AccountWorkerBrokenEnvelope()
{
    V661AccountWorkerFixture("success","broken")
}

V661AccountWorkerFixture(replyKind,mode)
{
    dir := A_Temp "\Iris-v661-worker-" A_TickCount,DirCreate(dir)
    user := "IrisFakeÜser-Case",password := "  Fake<&'" Chr(34) "Pass-雪  "
    try {
        log := dir "\combat_fixture.txt",jobPath := dir "\job.xml",ps := dir "\worker.ps1"
        FileAppend(IPDemoLine(1000,"@FakePlayer#1","=","Enter") "`r`n" IPDemoLine(2000,"@FakePlayer#1","Dummy {123}:1","Damage",100) "`r`n",log,"UTF-8")
        info := IPUDescribe(log),u := IPUNewState(),u.UseAccount := mode!="anonymous"
        u.AccountBlob := IPUAuthSeal(user,password),xml := IPUAccountJobXml(info,"offline fixture",u)
        if mode="broken"
            xml := StrReplace(xml,u.AccountBlob,"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
        FileAppend(xml,jobPath,"UTF-8")
        code := IPUSliceWorkerSource() "`n" IPUAccountWorkerSource() "`n" IPUExtractWorker(FileRead(A_ScriptDir "\Iris_Test_Runtime.ahk","UTF-8"))
        send := "$reply=$client.PostAsync('https://parsely.io/api/upload2',$form).GetAwaiter().GetResult()"
        V48Assert(InStr(code,send),"offline harness found the single known send boundary")
        stub := "
        (
        $fields=@{}
        foreach($field in $form) {
            $fieldName=$field.Headers.ContentDisposition.Name.Trim([char]34)
            if($fieldName -eq 'username' -or $fieldName -eq 'password') {
                $bytes=$field.ReadAsByteArrayAsync().GetAwaiter().GetResult()
                $sha=[Security.Cryptography.SHA256]::Create()
                try {$fields[$fieldName]=([BitConverter]::ToString($sha.ComputeHash($bytes))).Replace('-','').ToLowerInvariant()} finally {$sha.Dispose()}
                if($field.Headers.ContentType.CharSet -ne 'utf-8') {throw 'Fixture expected UTF-8 fields.'}
            }
        }
        )"
        if mode="anonymous"
            stub .= "`nif($fields.Count -ne 0 -or $null -ne $auth){throw 'Fixture anonymous upload contained credentials.'}`n"
        else
            stub .= "`nif($fields.Count -ne 2 -or $fields.username -ne '" IHHash(user) "' -or $fields.password -ne '" IHHash(password) "'){throw 'Fixture multipart credential bytes differ.'}`n"
        stub .= "[IO.File]::WriteAllText((Join-Path $dir 'offline-send.txt'),'multipart verified; no HTTP',$utf8)`n"
        stub .= "$reply=New-Object Net.Http.HttpResponseMessage([Net.HttpStatusCode]::OK)`n"
        if replyKind="success"
            stub .= "$reply.Content=New-Object Net.Http.StringContent('<response><status>success</status><file>https://parsely.io/parser/view/123456</file></response>')`n"
        else if replyKind="invalid"
            stub .= "$reply.Content=New-Object Net.Http.StringContent('<response><status>error</status><error>Invalid user</error></response>')`n"
        else
            stub .= "$e=New-Object Xml.XmlDocument;$e.LoadXml('<response><status>error</status><error/></response>');$e.SelectSingleNode('/response/error').InnerText=$auth.Password;$reply.Content=New-Object Net.Http.StringContent($e.OuterXml)`n"
        code := StrReplace(code,send,stub,true,&replacements)
        V48Assert(replacements=1 && !InStr(code,".PostAsync(") && !InStr(code,".SendAsync("),"offline worker has no HTTP send instruction")
        code := "$jobFile='" StrReplace(jobPath,"'","''") "'`n" code
        FileAppend(code,ps,"UTF-8")
        command := "& ([ScriptBlock]::Create([IO.File]::ReadAllText('" StrReplace(ps,"'","''") "',[Text.Encoding]::UTF8)))"
        V48Assert(!InStr(command,password) && !InStr(command,user),"worker command line contains no credentials")
        exe := A_WinDir "\System32\WindowsPowerShell\v1.0\powershell.exe"
        proc := IPUSpawn(exe,Chr(34) exe Chr(34) " -NoLogo -NoProfile -NonInteractive -EncodedCommand " IPUBase64(command))
        try {
            waited := DllCall("Kernel32\WaitForSingleObject","Ptr",proc.Handle,"UInt",15000,"UInt")
            if waited=258
                DllCall("Kernel32\TerminateProcess","Ptr",proc.Handle,"UInt",1)
            V48Assert(waited=0,"private account worker finishes without a network request")
        }
        finally DllCall("Kernel32\CloseHandle","Ptr",proc.Handle)
        resultText := FileRead(dir "\result.xml","UTF-8"),result := IPUResult(resultText)
        if mode="broken"
            V48Assert(!result.Success && !FileExist(dir "\offline-send.txt") && InStr(result.Message,"could not be opened"),"unreadable credentials stop before send with no anonymous fallback")
        else if replyKind="success"
            V48Assert(result.Success && result.Url="https://parsely.io/parser/view/123456" && FileExist(dir "\offline-send.txt"),"offline multipart and simulated success flow complete")
        else if replyKind="invalid"
            V48Assert(!result.Success && InStr(result.Message,"rejected the login") && InStr(result.Message,"No logged-out retry"),"invalid login yields an account-specific failure without fallback")
        else
            V48Assert(!result.Success && InStr(result.Message,"could not confirm") && !InStr(result.Message,password),"unexpected account error cannot echo credentials into status")
        Loop Files dir "\*", "F" {
            if A_LoopFileExt="gz"
                continue
            text := FileRead(A_LoopFileFullPath,"UTF-8")
            V48Assert(!InStr(text,password) && !InStr(text,user),"private worker file has no plaintext credentials: " A_LoopFileName)
        }
    }
    finally {
        if DirExist(dir)
            DirDelete(dir,true)
    }
}

; Pure native utility model regressions; no live source, settings, audio or HTTP.
V67UtilityFeed(s,at,src,dst,ability,effect := "",action := "activate",source := "fixture")
{
    category := action="activate" ? "Event {836045448945472}" : action="remove" ? "RemoveEffect {836045448945478}" : "ApplyEffect {836045448945477}"
    effect := action="activate" ? "836045448945479" : effect
    line := "[" IPStamp(Mod(at,86400000)) "] [" src "] [" dst "] [Utility {" ability "}] [" category ": Example {" effect "}] ()"
    ev := IPParseLine(line)
    V48Assert(IsObject(ev),"fixture uses a valid decoded native combat event")
    IRUObserve(s,ev,at,line,at,source,"@Owner#1")
    return ev
}

V67UtilityMeta(s,at,who,name,id := "9999",source := "fixture")
{
    line := "[" IPStamp(Mod(at,86400000)) "] [" who "] [=] [] [DisciplineChanged {836045448953665}: Example/" name " {" id "}] ()"
    IRUObserve(s,IPParseLine(line),at,line,at,source,"@Owner#1")
}

V67UtilityRow(s,who,key,now)
{
    for row in IRURows(s,IRUUNewState(),now).Rows {
        if row.Key=who Chr(30) key
            return row
    }
    throw Error("Expected utility row missing: " key)
}

V67UtilityCatalog()
{
    defs := IRUCatalog()
    V48Assert(defs.Count=7 && defs["rez"].Abilities.Length=6,"utility catalogue includes all combat-rez mirrors")
    for pair in [["2031339142381587","sorc"],["2031339142381619","sorc"],["2031339142381596","operative"],["2031339142381631","operative"],["2031339142381600","merc"],["2031339142381637","merc"]] {
        p := IRUDiscipline("localized name",pair[1])
        V48Assert(p.Class=pair[2] && p.Healer,"verified numeric discipline identifies healer in localized logs")
    }
    V48Assert(IRUDiscipline("Pyrotech").ReboundMs=35000 && IRUDiscipline("Tactics").ReboundMs=45000,"spec passive controls rebound estimate")
    V48Assert(!IRUDiscipline("Unknown").Healer && IRUDiscipline("Unknown").Class="","unrecognized discipline is not guessed")
    V48Assert(!IRUIndex().Casts.Has("2437999530868736"),"ordinary out-of-combat Revive is excluded")
}

V67UtilityInitialUnknown()
{
    s := IRUNewState()
    V67UtilityMeta(s,1000,"@Healer#2","Corruption")
    row := V67UtilityRow(s,"@Healer#2","rez",1000)
    V48Assert(!row.Unknown && row.Ready && row.Status="Ready ~" && s.Timers.Count=0,"first availability is assumed without inventing a use")
    V67UtilityMeta(s,1100,"@Dps#3","Lightning")
    found := false
    for r in IRURows(s,IRUUNewState(),2000).Rows {
        if r.Key="@Dps#3" Chr(30) "rez"
            found := true
    }
    V48Assert(!found,"known DPS spec has no healer-only rez row")
}

V67UtilityRezCompletion()
{
    for pair in [["808287075303424","808287075303712"],["812826855735296","812826855735572"],["814875555135488","814875555135770"],["807217628446720","807217628447020"],["2940854301884416","2940854301884684"],["2940764107571200","2940764107571466"]] {
        s := IRUNewState(),who := "@Healer#2"
        V67UtilityFeed(s,1000,who,"@Dead#3",pair[1])
        V48Assert(!s.Timers.Has(who Chr(30) "rez"),"rez cast start does not consume cooldown")
        V67UtilityFeed(s,2500,who,"=",pair[1],pair[2],"apply")
        t := s.Timers[who Chr(30) "rez"]
        V48Assert(t.Used=2500 && t.Due=302500,"completed self effect starts five minutes for every mirror")
        row := V67UtilityRow(s,who,"rez",2520)
        V48Assert(row.Status="~5:00" && !row.Ready,"rez countdown begins at completed cast")
        V48Assert(V67UtilityRow(s,who,"rez",302500).Ready,"elapsed estimated cooldown becomes Ready ~")
    }
}

V67UtilityRezFailures()
{
    s := IRUNewState(),who := "@Healer#2",id := "808287075303424",effect := "808287075303712"
    V67UtilityMeta(s,0,who,"Corruption")
    V67UtilityFeed(s,1000,who,"@Dead#3",id)
    V67UtilityFeed(s,2000,who,"@Dead#3",id,"836045448945483","apply")
    V48Assert(V67UtilityRow(s,who,"rez",4000).Ready,"cancelled/no-completion cast does not spend assumed availability")
    V67UtilityFeed(s,9000,who,"=",id,effect,"apply")
    V48Assert(!s.Timers.Has(who Chr(30) "rez"),"late snapshot self effect without a recent cast cannot spend rez")
    V67UtilityFeed(s,10000,who,"=","2437999530868736")
    V48Assert(!s.Timers.Has(who Chr(30) "rez"),"ordinary Revive never consumes battle rez")
    V67UtilityFeed(s,11000,who,"@Dead#3",id)
    V67UtilityFeed(s,12500,who,"@Other#4",id,effect,"apply")
    V48Assert(!s.Timers.Has(who Chr(30) "rez"),"another target's effect is not the completed self marker")
}

V67UtilityReboundEvidence()
{
    s := IRUNewState(),who := "@Pyro#2",id := "880189122805760",effect := "880189122806402"
    V67UtilityMeta(s,0,who,"Pyrotech")
    V67UtilityFeed(s,1000,who,"=",id)
    V48Assert(V67UtilityRow(s,who,"rebounder",1100).Unknown,"ordinary Sonic cast does not prove optional reflect talent")
    V67UtilityFeed(s,1800,"@Tank#3","=",id,effect,"apply")
    t := s.Timers[who Chr(30) "rebounder"]
    V48Assert(t.Confirmed && t.Used=1000 && t.Due=36000,"recipient-self proof credits the unique caster, including projectile delay")
    V48Assert(!s.Timers.Has("@Tank#3" Chr(30) "rebounder") || s.Timers["@Tank#3" Chr(30) "rebounder"].Used<0,"recipient never inherits caster cooldown")
    V67UtilityFeed(s,1810,"@Other#4","=",id,effect,"apply")
    V48Assert(t.Used=1000 && t.Due=36000,"multiple recipients do not restart cooldown")
    V67UtilityMeta(s,2000,who,"Advanced Prototype")
    V48Assert(t.Due=46000,"new verified spec changes estimate without erasing use")
}

V67UtilityReboundAmbiguity()
{
    s := IRUNewState(),id := "880189122805760",effect := "880189122806402"
    V67UtilityFeed(s,1000,"@One#2","=",id)
    V67UtilityFeed(s,1100,"@Receiver#3","=",id,effect,"apply")
    V67UtilityFeed(s,1200,"@Two#4","=",id)
    V67UtilityFeed(s,1300,"@Receiver#3","=",id,effect,"apply")
    V48Assert(!s.Timers["@One#2" Chr(30) "rebounder"].Confirmed && !s.Timers["@Two#4" Chr(30) "rebounder"].Confirmed,"ambiguous simultaneous Sonic casts do not invent optional talent proof")
    s := IRUNewState()
    V67UtilityFeed(s,1000,"@Tank#2","=","880189122806413")
    V67UtilityFeed(s,1300,"@Receiver#3","=",id,effect,"apply")
    V48Assert(s.Timers["@Tank#2" Chr(30) "rebounder"].Confirmed,"tank Sonic variant can supply Rebounder")
}

V67UtilityPredation()
{
    s := IRUNewState(),who := "@Mara#2",id := "2516812180750336"
    V67UtilityMeta(s,0,who,"Fury")
    V67UtilityFeed(s,1000,who,"=",id)
    V67UtilityFeed(s,1020,who,"=",id,id,"apply")
    row := V67UtilityRow(s,who,"predation",2000)
    V48Assert(row.Status="~0:29" && row.Active && row.ActiveStatus="Active ~0:09","duration and cooldown are independent")
    V67UtilityFeed(s,4000,who,"=",id,id,"remove")
    row := V67UtilityRow(s,who,"predation",4000)
    V48Assert(!row.Active && row.Status="~0:27","early buff removal never resets the ability cooldown")
    V48Assert(V67UtilityRow(s,who,"predation",31000).Ready,"quiet intervals can complete the cooldown")
}

V67UtilitySharedBuffLockout()
{
    for key in ["bloodthirst","power","tactical","celerity"] {
        s := IRUNewState(),d := IRUCatalog()[key],src := "@One#2",dst := "@Two#3"
        V67UtilityFeed(s,1000,src,"=",d.CastIds[1])
        V67UtilityFeed(s,1020,src,dst,d.CastIds[1],d.LockIds[1],"apply")
        p := s.Players[dst],p.Class := d.Classes[1]
        ; This recipient is an already observed holder; receiving a lockout
        ; alone no longer reveals the optional Sorcerer/Sage raid buff.
        if key="power"
            p.Observed[key] := true
        row := V67UtilityRow(s,dst,key,2000)
        V48Assert(!row.Ready && row.Status="~4:59","receiving someone else's buff blocks the matching raid utility")
        V48Assert(s.Timers[dst Chr(30) key].Used<0,"recipient is not claimed to have cast the buff")
        V48Assert(V67UtilityRow(s,dst,key,301000).Ready,"shared lockout expires without needing a logged remove")
    }
}

V67UtilityLockoutSnapshots()
{
    s := IRUNewState(),id := "2516846540488704",effect := "2516846540489210",who := "@Mara#2"
    V67UtilityMeta(s,0,who,"Fury")
    V67UtilityFeed(s,1000,who,"=",id,effect,"remove")
    V48Assert(V67UtilityRow(s,who,"bloodthirst",1000).Ready,"removed lockout permits assumed initial readiness")
    V67UtilityFeed(s,2000,who,"=",id,effect,"apply")
    V48Assert(V67UtilityRow(s,who,"bloodthirst",2000).Status="Locked ?","snapshot-only lockout has unknown remaining time")
    V67UtilityFeed(s,10000,who,"=",id,effect,"apply")
    V48Assert(s.Timers[who Chr(30) "bloodthirst"].LockBound=302000,"duplicate snapshot does not keep extending the conservative upper bound")
    V48Assert(V67UtilityRow(s,who,"bloodthirst",302000).Ready,"snapshot lockout cannot stay stuck forever after its maximum lifetime")
    s := IRUNewState(),src := "@Other#3"
    V67UtilityFeed(s,1000,src,"=",id)
    V67UtilityFeed(s,1001,src,who,id,effect,"apply")
    V67UtilityFeed(s,9000,who,"=",id,effect,"apply")
    V48Assert(s.Timers[who Chr(30) "bloodthirst"].LockDue=301000,"re-emitted snapshot preserves known lockout deadline")
    s := IRUNewState()
    V67UtilityMeta(s,0,who,"Fury")
    V67UtilityFeed(s,1000,who,"=",id,effect,"apply")
    V67UtilityFeed(s,250000,who,"=",id)
    row := V67UtilityRow(s,who,"bloodthirst",301000)
    V48Assert(!row.Ready && row.Status="~4:09","expired unknown lockout cannot override a later observed personal cooldown")
}

V67UtilityActiveSnapshots()
{
    s := IRUNewState(),who := "@Mara#2",id := "2516846540488704"
    V67UtilityMeta(s,0,who,"Fury")
    V67UtilityFeed(s,1000,who,"=",id,id,"apply")
    row := V67UtilityRow(s,who,"bloodthirst",2000)
    V48Assert(row.Ready && row.Active && row.ActiveStatus="Active ?","received buff preserves assumed own availability and unknown active duration")
    V67UtilityFeed(s,2000,who,"=",id,id,"apply")
    V48Assert(s.Timers[who Chr(30) "bloodthirst"].ActiveUntil=11000,"duplicate active snapshot does not extend lifetime")
}

V67UtilityDeathAndPulls()
{
    s := IRUNewState(),who := "@Mara#2"
    V67UtilityFeed(s,1000,who,"=","2516812180750336")
    ev := IPParseLine(IPDemoLine(2000,"Boss {900}:1",who,"Death"))
    IRUObserve(s,ev,2000,"",2000,"fixture","@Owner#1")
    V48Assert(V67UtilityRow(s,who,"predation",2000).Status="Dead","death disables availability without erasing cooldown")
    line := "[00:00:03.000] [" who "] [=] [] [Event {836045448945472}: Revived {836045448945494}] ()"
    IRUObserve(s,IPParseLine(line),3000,line,3000,"fixture","@Owner#1")
    V48Assert(V67UtilityRow(s,who,"predation",3000).Status="~0:28","explicit revival removes Dead status while preserving cooldown")
    ev := IPParseLine(IPDemoLine(5000,who,"=","Enter")),IRUObserve(s,ev,5000,"",5000,"fixture","@Owner#1")
    V48Assert(V67UtilityRow(s,who,"predation",5000).Status="~0:26","revival/new pull does not reset cooldown")
}

V67UtilityBoundaries()
{
    s := IRUNewState()
    V67UtilityFeed(s,1000,"@Mara#2","=","2516812180750336")
    V67UtilityFeed(s,2000,"@Other#3","=","2516812180750336",,,"second")
    V48Assert(s.Timers.Count=1 && !s.Players.Has("@Mara#2"),"new file/source clears old team and timers")
    ev := IPParseLine(IPDemoLine(3000,"@Owner#1","=","Enter")),ev.Kind := "Area",ev.AreaId := "1",ev.ModeId := "2"
    IRUObserve(s,ev,3000,"",3000,"second","@Owner#1")
    V48Assert(s.Timers.Count=0 && s.Players.Count=0,"area change clears prior raid evidence")
}

V67UtilityLateAndDuplicate()
{
    s := IRUNewState(),who := "@Mara#2",id := "2516812180750336"
    V67UtilityFeed(s,5000,who,"=",id)
    V67UtilityFeed(s,5000,who,"=",id)
    V67UtilityFeed(s,4500,who,"=",id)
    V48Assert(s.Timers[who Chr(30) "predation"].Used=5000 && s.Timers[who Chr(30) "predation"].Due=35000,"duplicate/older casts cannot move a cooldown backwards or restart it")
    V67UtilityFeed(s,1000,"@Old#3","=",id)
    V48Assert(!s.Players.Has("@Old#3"),"outside reorder window cannot resurrect old roster")
}

V67UtilityBoundedRoster()
{
    s := IRUNewState()
    Loop 80
        V67UtilityMeta(s,A_Index*1000,"@Player" A_Index "#" A_Index,"Corruption")
    V48Assert(s.Players.Count=32 && s.Players.Has("@Player80#80"),"bounded state continues accepting new team members instead of a lifetime cap")
    p := IRUUNewState(),p.BattleRez := false,p.RaidBuffs := false
    V48Assert(IRURows(s,p,80000).Count=0,"display category filtering does not alter stored observations")
    V48Assert(s.Players.Count=32,"filtering does not erase the live roster")
}

V67UtilitySourceIsolation()
{
    global IRU,IP
    old := IRU,oldIP := IP
    try {
        IRU := IRUNewState(),IP := IPNewApp(),IP.Live := IPNewData("private")
        ev := IPParseLine(IPDemoLine(1000,"@Me#1","=","Enter"))
        IRUConsume(IP.Live,ev,"",1000,{LatestStamp:1000,Tick:1000})
        V48Assert(IRU.LastAt<0,"SELF_TEST blocks production adapter even for a live-shaped fixture")
        data := IPNewData("saved")
        IPFeedLine(data,IPDemoLine(1000,"@Me#1","=","Enter"),"offline")
        V48Assert(IRU.LastAt<0,"saved log imports never populate live utility state")
    }
    finally IRU := old,IP := oldIP
}

; Isolated hidden native UI: no reader, game input, audio or saved preferences.
V67UtilityUIFixture(fn)
{
    global IRU,IRUU
    oldState := IRU,oldUI := IRUU
    try {
        IRU := IRUNewState(),IRUU := IRUUNewState()
        V522Isolated(fn)
    }
    finally {
        IRUUShutdown(),IRU := oldState,IRUU := oldUI
    }
}

V67UtilityUICatalogue()
{
    for mode in [1,2,3] {
        s := IPMNewState(),s.Mode := mode,before := IPMDisplayTargets(s).Length
        V48Assert(!s.Shown["RaidUtility"] && !s.Wanted && !s.TimerOn,"utility overlay defaults off without a new display timer")
        IIFSetChoice(s,"RaidUtility",true)
        n := 0
        for t in IPMDisplayTargets(s) {
            if t.Kind="RaidUtility" {
                n += 1
                V48Assert(t.Panel=s.Panels["RaidUtility"] && t.Panel!=s.Panel,"utility owns a separate panel in every layout")
            }
        }
        V48Assert(n=1 && IPMDisplayTargets(s).Length=before+1,"utility appears once without changing existing panels")
        IIFSetChoice(s,"RaidUtility",false)
        V48Assert(IPMDisplayTargets(s).Length=before,"utility can be hidden independently")
    }
}

V67UtilityUIHidden() => V67UtilityUIFixture(V67UtilityUIHiddenCase)
V67UtilityUIHiddenCase()
{
    global IPM,IP,IRU
    p := IPM.Panels["RaidUtility"],IPMEnsureGui("RaidUtility",0,p)
    IPMRender("RaidUtility",{State:"IMPORTED",Duration:999999},p)
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd),"native fixture remains hidden")
    V48Assert((DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt") & 0x08000020)=0x08000020,"locked utility panel is click-through and nonactivating")
    V48Assert(p.Heading.Text="Raid Utility" && p.VisibleRows=0,"saved snapshot cannot fabricate live utility rows")
    V48Assert(!IP.Active && IRU.LastAt<0,"renderer neither starts parser nor creates utility evidence")
    IPM.Editing := true,IPMStyle(p)
    V48Assert(!(DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt") & 0x20),"shared unlock enables dragging")
    IPM.Editing := false,IPMStyle(p)
    V48Assert((DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt") & 0x20),"shared lock restores click-through")
}

V67UtilityUIPreview() => V67UtilityUIFixture(V67UtilityUIPreviewCase)
V67UtilityUIPreviewCase()
{
    global IPM,IRU,IRUU
    original := ObjPtr(IRU),last := IRU.LastAt
    p := IPM.Panels["RaidUtility"],IPMEnsureGui("RaidUtility",0,p)
    IPMRender("RaidUtility",{LayoutPreview:true},p)
    V48Assert(InStr(p.Heading.Text,"PREVIEW") && p.VisibleRows=7,"sample status is visible only in explicitly labelled preview")
    V48Assert(p.Rows[1].Total.Text="Battle rez" && p.Rows[2].Total.Text="Battle rez","preview puts both healer resurrection rows first")
    V48Assert(InStr(p.Rows[5].Value.Text,"Active") && InStr(p.Rows[5].Value.Text,"~0:21"),"active duration and reuse cooldown remain separate display lines")
    V48Assert(ObjPtr(IRU)=original && IRU.LastAt=last,"preview does not replace or timestamp the live observer")
    IRUU.Rebounder := false,IRUU.Predation := false,IRUU.RaidBuffs := false
    IPMRender("RaidUtility",{LayoutPreview:true},p)
    V48Assert(p.VisibleRows=2 && p.Rows[1].Total.Text="Battle rez","preview respects categories without changing real evidence")
    IPMRender("RaidUtility",{State:"LIVE LOG"},p)
    V48Assert(!InStr(p.Heading.Text,"PREVIEW") && p.VisibleRows=0,"ending preview restores empty live state")
}

V67UtilityUIStatus()
{
    ready := {Status:"Ready ~",Ready:true,Unknown:false,Active:false,ActiveStatus:""}
    active := {Status:"~1:42",Ready:false,Unknown:false,Active:true,ActiveStatus:"Active ~0:06"}
    waiting := {Status:"~2:00",Ready:false,Unknown:false,Active:false}
    V48Assert(IRUUVisibleStatus(ready,false).Text="Ready ~","live estimated availability remains labelled")
    V48Assert(IRUUVisibleStatus(ready,true).Text="Unknown","paused readiness cannot be advertised as ready now")
    v := IRUUVisibleStatus(active,true)
    V48Assert(v.Text="Unknown" && v.Active="","paused buff cannot be advertised as currently active")
    V48Assert(IRUUVisibleStatus(waiting,true).Text="~2:00","non-ready countdown can be displayed as last observed")
    V48Assert(ready.Status="Ready ~" && active.ActiveStatus="Active ~0:06","status masking never mutates recorded rows")
    p := IRUUNewState(),p.Rebounder := false,p.Predation := false,p.BattleRez := false,p.RaidBuffs := false
    V48Assert(IRUUPreviewRows(p).Count=0,"empty category selection has no sample rows")
}

V67UtilityUILayout() => V67UtilityUIFixture(V67UtilityUILayoutCase)
V67UtilityUILayoutCase()
{
    global IPM,IRUU,IRU
    p := IPM.Panels["RaidUtility"],IPMEnsureGui("RaidUtility",0,p)
    for width in [196,360,520] {
        p.Width := width
        for font in [8,12,18] {
            IPM.Font := font,p.Signature := "",IPMRender("RaidUtility",{LayoutPreview:true},p)
            p.Meta.GetPos(&x,&y,&w,&h)
            V48Assert(x>=0 && x+w<=p.Layout.W && y+h<=p.Layout.H,"native status fits the panel")
            Loop p.VisibleRows {
                r := p.Rows[A_Index]
                r.Name.GetPos(&nx,&ny,&nw,&nh),r.Total.GetPos(&tx,&ty,&tw,&th),r.Value.GetPos(&vx,&vy,&vw,&vh)
                for ctrl in [r.Name,r.Total,r.Value] {
                    ctrl.GetPos(&x,&y,&w,&h)
                    V48Assert(w>0 && x>=0 && y>=p.Layout.Header && x+w<=p.Layout.W && y+h<=p.Layout.H,"native row stays inside resized panel")
                }
                V48Assert(nx+nw<=vx && tx+tw<=vx,"player/utility labels never overlap countdown")
                V48Assert(ny+nh<=ty || nx+nw<=tx,"player and utility labels are separated vertically or horizontally")
                for line in StrSplit(r.Value.Text,"`n","`r")
                    V48Assert(IUMTextWidth(line,SendMessage(0x31,0,0,r.Value.Hwnd))<=vw,"native countdown text fits without an accidental third line")
            }
        }
    }
    ; Normal wide view uses compact single rows when no active-duration line is needed.
    IRUU.Predation := false,p.Width := 520,IPM.Font := 10
    IPMRender("RaidUtility",{LayoutPreview:true},p)
    V48Assert(!p.Layout.TwoLines,"wide view uses compact single-line rows")
    p.Width := 400,IPMRender("RaidUtility",{LayoutPreview:true},p)
    V48Assert(!p.Layout.TwoLines,"default width keeps compact rows for actual long utility labels")
    Loop p.VisibleRows {
        text := p.Rows[A_Index].Total,text.GetPos(&x,&y,&w,&h)
        V48Assert(IUMTextWidth(text.Text,SendMessage(0x31,0,0,text.Hwnd))<=w,"default width fits the complete observed utility name")
    }
    p.AutoHeight := false,p.Height := 120,IPMRender("RaidUtility",{LayoutPreview:true},p)
    V48Assert(p.VisibleRows<6 && InStr(p.Meta.Text,"of 6 shown"),"fixed-height truncation reports the total rather than hiding omitted utilities silently")
    ; Eight eligible healers each have two utilities. The combat meter's row
    ; preference must not reduce this separate raid-utility list.
    IRU := IRUNewState(),IRU.LastAt := 1000,IRU.LastTick := ClockMs()
    Loop 8 {
        player := IRUPlayer(IRU,{Kind:"Player",Key:"@Healer " A_Index "#" A_Index,Name:"Healer " A_Index},1000,true)
        player.Class := "sorc",player.Healer := true,player.MetaAt := 1000
        ; These eight healers have previously demonstrated the optional buff.
        player.Observed["power"] := true
    }
    p.AutoHeight := true,p.Width := 400,IPM.Font := 8,IPM.MaxRows := 2
    IPMRender("RaidUtility",{State:"LIVE LOG"},p)
    V48Assert(p.VisibleRows=16,"all sixteen observed utility rows fit independently of the combat meter row limit")
    p.Rows[16].Value.GetPos(&x,&y,&w,&h)
    V48Assert(y+h<=p.Layout.H,"last native utility row stays inside the panel")
}

V67UtilityUIOptions() => V67UtilityUIFixture(V67UtilityUIOptionsCase)
V67UtilityUIOptionsCase()
{
    global IRUU,IRU,IPM
    IRUUOpenOptions(),c := IRUU.Controls
    V48Assert(IPMGuiAlive(IRUU.Gui) && !DllCall("User32\IsWindowVisible","Ptr",IRUU.Gui.Hwnd),"options are built natively but hidden in diagnostics")
    for field in IRUUFields()
        c[field].Value := field="BattleRez" ? 1 : 0
    V48Assert(IRUUApplyOptions() && IRUU.BattleRez && !IRUU.Rebounder && !IRUU.Predation && !IRUU.RaidBuffs,"category choices apply in isolated memory")
    V48Assert(!IPM.Wanted && !IPM.TimerOn && IRU.LastAt<0,"opening/applying settings never starts overlays or observers")
    V48Assert(!IRUUPreview() && !IRUUShow() && !IPM.Wanted,"diagnostic preview/show buttons cannot expose windows")
    IRUUClose()
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IRUU.Gui.Hwnd),"options close preserves a hidden native editor")
}

V67UtilityUIProfile() => V67UtilityUIFixture(V67UtilityUIProfileCase)
V67UtilityUIProfileCase()
{
    global IRUU,IRU
    IRUUOpenOptions(),IRUU.Rebounder := false,IRUU.RaidBuffs := false
    profile := IRUULayoutCapture(),IRUU.Rebounder := true,IRUU.RaidBuffs := true
    V48Assert(profile.Count=4 && !profile.Has("Gui") && !profile.Has("LastAt"),"layout data contains preferences only")
    V48Assert(IRUULayoutApply(profile) && !IRUU.Rebounder && !IRUU.RaidBuffs,"captured category preferences restore")
    V48Assert(IRUU.Controls["Rebounder"].Value=0 && IRUU.Controls["RaidBuffs"].Value=0,"open native controls follow restored preferences")
    IRUULayoutApply(Map("Rebounder",2,"BattleRez",0,"Unknown","ignored"))
    V48Assert(!IRUU.Rebounder && !IRUU.BattleRez && IRUU.Predation,"invalid fields cannot corrupt valid categories")
    V48Assert(!IRUULayoutApply("not a map") && IRU.LastAt<0,"malformed layout leaves utility evidence unchanged")
}

; v67.1: native, isolated checks for the approximate Nahut floor reminder.
; These exercise the real observer and queue, never the audio worker, live reader,
; gameplay hotkeys, settings IO, or normal application startup.
V671FloorFixture(fn)
{
    global SELF_TEST,NBFloor,NBFloorOptions,NBFloorUI,Audio,testClock,inputMode,activeBoss
    global audioOutputMode,AUDIO_MODE_KENKU_BRIDGE_TTS,soundboardsEnabled,autoBossCalloutsEnabled
    global chatOpen,BridgeTextById,RouteStates,Preview,ReadClockSample,CurrentRecord
    global inLogDispatch,dispatchAudioAllowed,dispatchLogStamp,dispatchLogSource,IP,IrisBench
    global NBCandle,NBOrder,NBRebounder
    V48Assert(SELF_TEST,"floor regression requires the isolated native harness")
    old := {Floor:NBFloor,Options:NBFloorOptions,UI:NBFloorUI,Audio:Audio,Clock:testClock,Mode:inputMode,Boss:activeBoss,
        Route:audioOutputMode,Master:soundboardsEnabled,BossMaster:autoBossCalloutsEnabled,Chat:chatOpen,
        Phrases:BridgeTextById,Routes:RouteStates,Preview:Preview,Sample:ReadClockSample,Record:CurrentRecord,
        Dispatch:inLogDispatch,Allowed:dispatchAudioAllowed,Stamp:dispatchLogStamp,Source:dispatchLogSource,
        IP:IP,Bench:IrisBench,Candle:NBCandle,Order:NBOrder,Rebounder:NBRebounder}
    try {
        NBFloor := NewNBFloorState(),NBFloorOptions := {Enabled:true,StopKey:true,SoundId:""},NBFloorUI := {Gui:"",Visible:false}
        ; Confirmed floor cleanup also retires the shared Nahut controllers.
        NBCandle := NewNBCandleState(),NBOrder := NewNBOrderState(),NBRebounder := NewNBRebounderState()
        Audio := {Queue:[],Current:"",Http:"",Serial:0,Epoch:1,Busy:false,Fault:"",Paused:false,
            NetFailures:0,RetryAt:0,PollAt:0,Events:Map(),LastAccepted:Map()}
        testClock := 100000,inputMode := "CombatLog",activeBoss := "GFTM - Nahut"
        audioOutputMode := AUDIO_MODE_KENKU_BRIDGE_TTS,soundboardsEnabled := true,autoBossCalloutsEnabled := true
        chatOpen := false,BridgeTextById := BuildDefaultBridgePhrases(),RouteStates := Map()
        Preview := {Gui:"",Items:[],Visible:false,Message:""},ReadClockSample := "",CurrentRecord := ""
        inLogDispatch := false,dispatchAudioAllowed := true,dispatchLogStamp := "",dispatchLogSource := ""
        IP := IPNewApp(),IrisBench := IrisBench.Clone(),IrisBench.Active := false
        fn.Call()
    }
    finally {
        NBFloor := old.Floor,NBFloorOptions := old.Options,NBFloorUI := old.UI,Audio := old.Audio,testClock := old.Clock
        inputMode := old.Mode,activeBoss := old.Boss,audioOutputMode := old.Route
        soundboardsEnabled := old.Master,autoBossCalloutsEnabled := old.BossMaster,chatOpen := old.Chat
        BridgeTextById := old.Phrases,RouteStates := old.Routes,Preview := old.Preview
        ReadClockSample := old.Sample,CurrentRecord := old.Record,inLogDispatch := old.Dispatch
        dispatchAudioAllowed := old.Allowed,dispatchLogStamp := old.Stamp,dispatchLogSource := old.Source
        IP := old.IP,IrisBench := old.Bench
        NBCandle := old.Candle,NBOrder := old.Order,NBRebounder := old.Rebounder
    }
}

V671FloorLine(at,source,target,ability,action,effect,tail := "")
{
    at := Mod(at,86400000)
    stamp := Format("{:02d}:{:02d}:{:02d}.{:03d}",Floor(at/3600000),Mod(Floor(at/60000),60),Mod(Floor(at/1000),60),Mod(at,1000))
    return "[" stamp "] [" source "] [" target "] [x {" ability "}] [x {" action "}: x {" effect "}]" tail
}

V671FloorBoss(hp := 500,instance := "999") => "Nahut {4122949560827904}:" instance "|(0,0,0,0)|(" hp "/1000)"
V671FloorPlayer(n := 1,hp := 100) => "@FloorTester" n "#" (100+n) "|(0,0,0,0)|(" hp "/100)"
V671FloorChamber() => "Singularity Core {4122580193640448}:555|(0,0,0,0)|(100/100)"

V671FloorPulse(at := 100000,tail := " (0)",instance := "999")
{
    return V671FloorLine(at,V671FloorBoss(500,instance),V671FloorPlayer(),"4133906022400000","836045448945477","836045448945501",tail)
}

V671FloorGravity(at,n := 1,remove := false,hp := 100,source := "")
{
    return V671FloorLine(at,remove ? source : V671FloorChamber(),V671FloorPlayer(n,hp),
        "4133502295474176",remove ? "836045448945478" : "836045448945477","4133502295474475")
}

V671FloorArm(pulse := true,roster := 1,at := 100000,instance := "999")
{
    TrackNBFloor(V671FloorLine(at-2000,V671FloorBoss(500,instance),V671FloorPlayer(),"0","836045448945477","836045448945501"," (1)"))
    Loop roster
        TrackNBFloor(V671FloorGravity(at-1000,A_Index))
    if pulse
        TrackNBFloor(V671FloorPulse(at," (0)",instance))
}

V671FloorActivity(at,live := true,instance := "999")
{
    return TrackNBFloor(V671FloorLine(at,V671FloorPlayer(),V671FloorBoss(400,instance),"777","836045448945477","836045448945501"," (1)"),live)
}

V671FloorReceiptAnchor() => V671FloorFixture(V671FloorReceiptAnchorCase)
V671FloorReceiptAnchorCase()
{
    global NBFloor,ReadClockSample,testClock,CurrentRecord
    V671FloorArm(false),ReadClockSample := {Tick:100000,Wall:987654,LatestStamp:100000}
    CurrentRecord := {Age:99000,At:100000,ReadTick:100000,Allow:false},testClock := 102000
    V48Assert(TrackNBFloor(V671FloorPulse()),"qualifying hit arms independently of wall-clock age disagreement")
    V48Assert(NBFloor.Anchor=100000,"reader acquisition tick removes the extra two seconds spent processing the batch")
    ResetNBFloorEncounter("isolated fixture"),ReadClockSample := "",CurrentRecord := ""
    V671FloorArm(false),testClock := 103000
    TrackNBFloor(V671FloorPulse(),true,100500)
    V48Assert(NBFloor.Anchor=100500,"explicit acquisition tick wins over handler time")
    ResetNBFloorEncounter("isolated fixture"),V671FloorArm(false),testClock := 104000
    TrackNBFloor(V671FloorPulse())
    V48Assert(NBFloor.Anchor=104000,"direct observer without reader sample retains receipt-time fallback")
}

V671FloorZeroAndPhase() => V671FloorFixture(V671FloorZeroAndPhaseCase)
V671FloorZeroAndPhaseCase()
{
    global NBFloor,Audio
    TrackNBFloor(V671FloorPulse())
    V48Assert(!NBFloor.Running,"Discharge without the confirmed burn phase cannot arm")
    for tail in [" (0)"," (0 -resist {836045448945507})"," (0 ~100 absorbed {836045448945511})"] {
        ResetNBFloorEncounter("isolated zero-contact case"),V671FloorArm(false)
        V48Assert(TrackNBFloor(V671FloorPulse(100000,tail)) && NBFloor.Running,"emitted zero, resisted or absorbed contact still provides a timing anchor")
        PollNBFloor()
        V48Assert(Audio.Queue.Length=0,"the initial pulse itself is never announced a second time")
    }
    ResetNBFloorEncounter("isolated invalid contact case"),V671FloorArm(false)
    TrackNBFloor(V671FloorLine(100000,V671FloorBoss(),"=","4133906022400000","836045448945472","836045448945479"))
    V48Assert(!NBFloor.Running,"ability activation does not replace the user-approved first-hit anchor")
    TrackNBFloor(V671FloorLine(100001,V671FloorBoss(),"Turret {123}:8|(0,0,0,0)|(5/10)","4133906022400000","836045448945477","836045448945501"," (1)"))
    V48Assert(!NBFloor.Running,"damage to a non-player cannot start the floor reminder")
}

V671FloorCadenceAndPriority() => V671FloorFixture(V671FloorCadenceAndPriorityCase)
V671FloorCadenceAndPriorityCase()
{
    global NBFloor,Audio,testClock
    V671FloorArm(),testClock := 111999,PollNBFloor()
    V48Assert(Audio.Queue.Length=0,"first deadline is not announced early")
    testClock := 112000,PollNBFloor()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Priority=0,"exactly twelve seconds queues one lowest-priority reminder")
    V48Assert(Audio.Queue[1].NBFloorData.Due=112000 && Audio.Queue[1].Expires=113500,"floor lifetime ends 1.5 seconds after the original deadline")
    testClock := 112073,TrackNBFloor(V671FloorPulse(112073)),PollNBFloor()
    V48Assert(NBFloor.Anchor=100000 && Audio.Queue.Length=1,"later recorded pulse does not resync or add another reminder")
    testClock := 124000,V671FloorActivity(124000),PollNBFloor()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].NBFloorData.Cycle=2 && NBFloor.Anchor=100000,"the second deadline keeps the original anchor and replaces the previous queued cycle")
}

V671FloorExpiryAndSkip() => V671FloorFixture(V671FloorExpiryAndSkipCase)
V671FloorExpiryAndSkipCase()
{
    global Audio,testClock,NBFloor
    V671FloorArm(),testClock := 112000,PollNBFloor(),item := Audio.Queue[1]
    testClock := 113500
    V48Assert(NBFloorAudioItemEnabled(item),"queued reminder is eligible at the last allowed millisecond")
    testClock := 113501
    V48Assert(!NBFloorAudioItemEnabled(item),"queued reminder expires immediately after the 1.5-second limit")
    testClock := 125501,V671FloorActivity(125501),PollNBFloor()
    V48Assert(Audio.Queue.Length=0 && NBFloor.LastCycle=2,"late deadline is consumed without a catch-up announcement")
    testClock := 136000,V671FloorActivity(136000),PollNBFloor()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].NBFloorData.Cycle=3,"the next ordinary deadline resumes after a skipped late reminder")
}

V671FloorStalePause() => V671FloorFixture(V671FloorStalePauseCase)
V671FloorStalePauseCase()
{
    global Audio,testClock,NBFloor
    V671FloorArm(),testClock := 112000,PollNBFloor(),item := Audio.Queue[1]
    testClock := 120000,PollNBFloor()
    V48Assert(!NBFloor.Paused && NBFloorInputFresh(),"the full twenty-second freshness allowance is retained")
    testClock := 120001,PollNBFloor()
    V48Assert(NBFloor.Running && NBFloor.Paused && !NBFloor.Blocked,"stale encounter evidence pauses instead of setting the per-pull Stop latch")
    V48Assert(Audio.Queue.Length=0 && !NBFloorAudioItemEnabled(item),"pause removes queued floor work and prevents stale playback")
    testClock := 3700000,PollNBFloor()
    V48Assert(Audio.Queue.Length=0 && NBFloor.Anchor=100000 && NBFloor.LastCycle=300,"an hour without fresh logs produces no endless floor calls or anchor drift")
    V48Assert(NBFloor.AutoUsed,"stale pause preserves the once-per-pull acquisition latch")
}

V671FloorResumeWithoutCatchup() => V671FloorFixture(V671FloorResumeWithoutCatchupCase)
V671FloorResumeWithoutCatchupCase()
{
    global Audio,testClock,NBFloor
    V671FloorArm(),testClock := 124000,PollNBFloor()
    V48Assert(NBFloor.Paused && Audio.Queue.Length=0,"stale deadline is paused")
    testClock := 136100,V671FloorActivity(136100),PollNBFloor()
    V48Assert(!NBFloor.Paused && Audio.Queue.Length=0 && NBFloor.Anchor=100000,"first fresh event resumes the old clock without replaying the just-passed deadline")
    testClock := 136200,TrackNBFloor(V671FloorPulse(136200)),PollNBFloor()
    V48Assert(Audio.Queue.Length=0 && NBFloor.Anchor=100000,"a later pulse cannot revive the already skipped cycle")
    testClock := 148000,V671FloorActivity(148000),PollNBFloor()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].NBFloorData.Cycle=4,"resumed observer waits for the next original twelve-second boundary")
}

V671FloorStalledPollResume() => V671FloorFixture(V671FloorStalledPollResumeCase)
V671FloorStalledPollResumeCase()
{
    global Audio,testClock,NBFloor
    V671FloorArm(),testClock := 136100,V671FloorActivity(136100)
    V48Assert(NBFloor.Paused,"fresh record itself recognizes a stale gap when the polling timer did not run")
    PollNBFloor()
    V48Assert(!NBFloor.Paused && Audio.Queue.Length=0 && NBFloor.LastCycle=3,"a stalled timer thread cannot replay a deadline when the first new record arrives")
    testClock := 148000,V671FloorActivity(148000),PollNBFloor()
    V48Assert(Audio.Queue.Length=1 && NBFloor.Anchor=100000,"original future deadlines survive the stalled polling thread")
}

V671FloorMissingPulse() => V671FloorFixture(V671FloorMissingPulseCase)
V671FloorMissingPulseCase()
{
    global Audio,NBFloor,testClock
    V671FloorArm()
    for at in [112000,124000,136000] {
        testClock := at,V671FloorActivity(at),PollNBFloor()
        V48Assert(!NBFloor.Paused && Audio.Queue.Length=1 && Audio.Queue[1].NBFloorData.Due=at,"ordinary recorded Nahut combat keeps the reminder fresh when a Discharge pulse has no player hit")
    }
    V48Assert(NBFloor.Anchor=100000,"missing whole pulse intervals never move the original anchor")
}

V671FloorUnrelatedOrOldInput() => V671FloorFixture(V671FloorUnrelatedOrOldInputCase)
V671FloorUnrelatedOrOldInputCase()
{
    global Audio,NBFloor,testClock
    V671FloorArm(),testClock := 119000
    TrackNBFloor(V671FloorLine(119000,V671FloorPlayer(),"Other {777}:5|(0,0,0,0)|(5/10)","42","836045448945477","836045448945501"," (5)"))
    V671FloorActivity(99000)
    testClock := 124000,PollNBFloor()
    V48Assert(NBFloor.Paused && Audio.Queue.Length=0,"unrelated activity and old same-boss records cannot keep abandoned burn state alive")
    V48Assert(NBFloor.Anchor=100000 && NBFloor.Hp=500,"an older event does not replace current boss health or timing")
}

V671FloorManualStopLatch() => V671FloorFixture(V671FloorManualStopLatchCase)
V671FloorManualStopLatchCase()
{
    global NBFloor,Audio,testClock
    V671FloorArm(),testClock := 112000,PollNBFloor()
    Audio.Queue.Push({Kind:"Boss",Key:"OtherMechanic"})
    StopNBFloor("isolated manual stop"),testClock := 124000
    V671FloorActivity(124000),TrackNBFloor(V671FloorPulse(124001)),PollNBFloor()
    V48Assert(NBFloor.Blocked && !NBFloor.Running,"manual stop survives new same-pull boss activity and Discharge")
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Key="OtherMechanic","manual floor stop preserves other mechanics' queued callouts")
    SetNBFloorPreference(true),TrackNBFloor(V671FloorPulse(124002))
    V48Assert(NBFloor.Blocked && !NBFloor.Running,"enabling the option does not rearm a stopped pull")
    ResetNBFloorEncounter("isolated pre-pull stop case"),StopNBFloor("before first boss record"),V671FloorArm()
    V48Assert(NBFloor.Blocked && !NBFloor.Running,"stop before the first observed boss record is retained for that pull")
}

V671FloorOldResetCannotRearm() => V671FloorFixture(V671FloorOldResetCannotRearmCase)
V671FloorOldResetCannotRearmCase()
{
    global NBFloor
    V671FloorArm(),StopNBFloor("isolated manual stop"),generation := NBFloor.Generation
    old := V671FloorLine(90000,V671FloorBoss(1000),"","0","836045448945472","836045448953669")
    TrackNBFloor(old,false),TrackNBFloor(V671FloorPulse(100001))
    V48Assert(NBFloor.Blocked && !NBFloor.Running && NBFloor.Generation=generation,"older full-health target-clear cannot erase the current per-pull stop latch")
    V48Assert(NBFloor.Hp=500,"older reset cannot overwrite the known damaged boss snapshot")
}

V671FloorNewEncounter() => V671FloorFixture(V671FloorNewEncounterCase)
V671FloorNewEncounterCase()
{
    global NBFloor,testClock
    V671FloorArm(),StopNBFloor("isolated manual stop")
    testClock := 130000
    TrackNBFloor(V671FloorLine(130000,V671FloorBoss(1000),"","0","836045448945472","836045448953669"))
    V48Assert(!NBFloor.Blocked && !NBFloor.Running && !NBFloor.Burn,"fresh full-health target-clear allows a genuinely new pull")
    V671FloorArm(true,1,140000)
    V48Assert(NBFloor.Running,"a new burn following the explicit reset can arm")
    StopNBFloor("isolated manual stop"),testClock := 150000,V671FloorArm(true,1,150000,"1000")
    V48Assert(NBFloor.Running && NBFloor.Instance="1000","a newly observed boss instance clears the prior pull's stop latch")
}

V671FloorBossDeath() => V671FloorFixture(V671FloorBossDeathCase)
V671FloorBossDeathCase()
{
    global NBFloor,Audio,testClock
    V671FloorArm(),testClock := 112000,PollNBFloor()
    TrackNBFloor(V671FloorLine(112001,"",V671FloorBoss(0),"0","836045448945472","836045448945493"))
    V48Assert(NBFloor.Ended && NBFloor.Blocked && !NBFloor.Running && Audio.Queue.Length=0,"explicit boss death ends and cancels the floor reminder")
    TrackNBFloor(V671FloorPulse(124000)),PollNBFloor()
    V48Assert(!NBFloor.Running,"later residual Discharge cannot restart a defeated boss")
}

V671FloorWipeCleanup() => V671FloorFixture(V671FloorWipeCleanupCase)
V671FloorWipeCleanupCase()
{
    global NBFloor,Audio,testClock
    V671FloorArm(true,7),testClock := 112000,PollNBFloor()
    Loop 6
        TrackNBFloor(V671FloorGravity(112010+A_Index,A_Index,true,A_Index<=2 ? 0 : 10))
    V48Assert(NBFloor.Running,"partial cleanup does not terminate a potentially surviving raid")
    TrackNBFloor(V671FloorGravity(112020,7,true,10))
    V48Assert(NBFloor.Ended && !NBFloor.Running && NBFloor.Blocked,"all known gravity recipients cleaning up together with multiple dead players confirms encounter end")
    V48Assert(Audio.Queue.Length=0,"corroborated wipe cleanup cancels pending floor speech")
    testClock := 124000,TrackNBFloor(V671FloorPulse(124000)),PollNBFloor()
    V48Assert(!NBFloor.Running && Audio.Queue.Length=0,"residual hits after cleanup cannot restart the ended burn")
}

V671FloorCleanupRequiresCorroboration() => V671FloorFixture(V671FloorCleanupRequiresCorroborationCase)
V671FloorCleanupRequiresCorroborationCase()
{
    global NBFloor
    for dead in [0,1] {
        ResetNBFloorEncounter("isolated insufficient death case"),V671FloorArm(true,7)
        Loop 7
            TrackNBFloor(V671FloorGravity(110000+A_Index,A_Index,true,A_Index<=dead ? 0 : 100))
        V48Assert(NBFloor.Running && !NBFloor.Ended,"cleanup without multiple dead-player snapshots is insufficient to call a wipe")
    }
    ResetNBFloorEncounter("isolated short roster case"),V671FloorArm(true,3)
    Loop 3
        TrackNBFloor(V671FloorGravity(110000+A_Index,A_Index,true,0))
    V48Assert(NBFloor.Running,"fewer than four known recipients cannot establish raid-wide cleanup")
    ResetNBFloorEncounter("isolated attributed removal case"),V671FloorArm(true,7)
    Loop 7
        TrackNBFloor(V671FloorGravity(110000+A_Index,A_Index,true,0,V671FloorChamber()))
    V48Assert(NBFloor.Running,"attributed effect removals are not the observed blank-source encounter cleanup signature")
}

V671FloorSpreadCleanupAndPersonalDeath() => V671FloorFixture(V671FloorSpreadCleanupAndPersonalDeathCase)
V671FloorSpreadCleanupAndPersonalDeathCase()
{
    global NBFloor,testClock
    V671FloorArm(true,7)
    Loop 7
        TrackNBFloor(V671FloorGravity(110000+A_Index*2000,A_Index,true,0))
    V48Assert(NBFloor.Running && !NBFloor.Ended,"individual deaths spread over time do not mimic simultaneous wipe cleanup")
    ResetNBFloorEncounter("isolated personal death case"),V671FloorArm(true,7)
    TrackNBFloor(V671FloorGravity(110000,1,true,0))
    TrackNBFloor(V671FloorLine(110001,"",V671FloorPlayer(1,0),"0","836045448945472","836045448945493"))
    TrackNBFloor(V671FloorLine(110002,V671FloorPlayer(1,0),"=","0","836045448945472","836045448945490"))
    TrackNBFloor(V671FloorLine(111000,V671FloorPlayer(1),"=","0","836045448945472","836045448945494"))
    testClock := 112000,V671FloorActivity(112000),PollNBFloor()
    V48Assert(NBFloor.Running && !NBFloor.Blocked && !NBFloor.Ended,"one player's death, combat exit, gravity removal and revive do not stop a surviving raid")
}

V671FloorSilentReplayAndParserOff() => V671FloorFixture(V671FloorSilentReplayAndParserOffCase)
V671FloorSilentReplayAndParserOffCase()
{
    global NBFloor,Audio,IP,testClock
    V671FloorArm(false),TrackNBFloor(V671FloorPulse(),false)
    V48Assert(!NBFloor.Running && !NBFloor.AutoUsed,"hydrated historical Discharge does not start a live receipt-time reminder")
    TrackNBFloor(V671FloorPulse(100001)),testClock := 119000,V671FloorActivity(119000,false)
    testClock := 124000,PollNBFloor()
    V48Assert(NBFloor.Paused && Audio.Queue.Length=0,"silent historical observation does not refresh live activity")
    testClock := 125000,V671FloorActivity(125000),PollNBFloor()
    testClock := 136000,V671FloorActivity(136000),PollNBFloor()
    V48Assert(!IP.Active && NBFloor.Running && Audio.Queue.Length=1,"floor reminder continues with statistics parsing disabled")
    V48Assert(IP.Queue.Length=0 && !IsObject(IP.Live),"floor observer neither starts nor enqueues work into the statistics parser")
}

V671FloorMidnightOrdering() => V671FloorFixture(V671FloorMidnightOrderingCase)
V671FloorMidnightOrderingCase()
{
    global NBFloor,testClock
    V671FloorArm(true,1,86399000),StopNBFloor("isolated midnight stop")
    TrackNBFloor(V671FloorLine(86398000,V671FloorBoss(1000),"","0","836045448945472","836045448953669"),false)
    V48Assert(NBFloor.Blocked,"older reset before midnight remains rejected")
    testClock := 103000
    TrackNBFloor(V671FloorLine(86401000,V671FloorBoss(1000),"","0","836045448945472","836045448953669"))
    V48Assert(!NBFloor.Blocked && !NBFloor.Running,"a genuinely later reset just after midnight is accepted")
}

; Native replay of six recorded8M Nahut burns. Playernames/IDs anonymized.
; Keeps every gravity marker, firstrecipient of each Discharge pulse, observed
; deaths, and actual bossactivity thinned to approximately every2s where present.
; Originalsource ordinals/hashes remain in the local audit manifest. No audio,
; HTTP, gameinputs, savedsettings or normalapp execution. These are filtered
; eventreplays, not full native parser imports or live raid validation.

V671FloorLogMarchClear()
{
    V671FloorLogReplayCase("0317",9,false)
}
V671FloorLogAprilMissingPulse()
{
    V671FloorLogReplayCase("0424",8,false)
}
V671FloorLogJuneClear()
{
    V671FloorLogReplayCase("0609",7,false)
}
V671FloorLogAugustClear()
{
    V671FloorLogReplayCase("0811",7,false)
}
V671FloorLogSeptemberClear()
{
    V671FloorLogReplayCase("0927",7,false)
}
V671FloorLogOctoberWipe()
{
    V671FloorLogReplayCase("1001",10,true)
}

V671FloorLogReplayCase(which,expectedPulses,isWipe)
{
    global NBFloor,NBFloorOptions,Audio,testClock,inputMode,activeBoss
    global autoBossCalloutsEnabled,CurrentRecord,ReadClockSample
    saved := {Floor:NBFloor,Options:NBFloorOptions,Audio:Audio,Clock:testClock,
        Mode:inputMode,Boss:activeBoss,Auto:autoBossCalloutsEnabled,
        Record:CurrentRecord,Read:ReadClockSample}
    try {
        NBFloor := NewNBFloorState()
        NBFloorOptions := {Enabled:true,StopKey:true,SoundId:""}
        Audio := Audio.Clone(),Audio.Queue := [],Audio.Current := "",Audio.Http := ""
        inputMode := "CombatLog",activeBoss := "GFTM - Nahut"
        autoBossCalloutsEnabled := false,CurrentRecord := "",ReadClockSample := ""
        firstAt := -1,firstPulse := -1,anchor := -1,pulses := 0,starts := 0
        gravity := Map(),removed := Map(),closed := false,sawMissing := false,lastPulse := -1
        for line in StrSplit(V671FloorLogFixture(which),"`n","`r") {
            if Trim(line)=""
                continue
            at := LogStampMs(line)
            V48Assert(at>=0,"recorded fixture has native combat timestamp")
            if firstAt<0
                firstAt := at
            receipt := 100000+at-firstAt
            testClock := receipt+350 ; processingtime is intentionally later than acquisition
            f := ""
            V48Assert(RegExMatch(line,"^\[[^\]]+\]\s+\[([^\]]*)\]\s+\[([^\]]*)\]\s+\[([^\]]*)\]\s+\[([^\]]*)\]",&f),"recorded event decodes source/target/effect")
            if InStr(f[4],"{4133502295474475}") {
                actor := AERemoteActorToken(f[2])
                if InStr(f[4],"{836045448945477}")
                    gravity[actor] := true
                else if InStr(f[4],"{836045448945478}")
                    removed[actor] := true
            }
            hit := NBFloorHitSource(f[1],f[2],f[3],"836045448945477",
                InStr(f[4],"{836045448945501}") ? "836045448945501" : "")
            if hit!="" {
                pulses += 1
                if lastPulse>=0 && at-lastPulse>18000
                    sawMissing := true
                lastPulse := at
            }
            if RegExMatch(line,"\{4122949560827904\}:\d+\|[^\]]*\|\(0/\d+\)")
                closed := true
            if isWipe && gravity.Count>=4 && removed.Count=gravity.Count
                closed := true
            started := SafeTrackNBFloor(line,true,receipt)
            if started
                starts += 1
            if hit!="" && firstPulse<0 {
                firstPulse := at,anchor := receipt
                V48Assert(started && NBFloor.Anchor=receipt,"recorded first Discharge anchors at acquisition, not350ms later dispatch")
            }
            PollNBFloor()
            if firstPulse>=0 {
                V48Assert(NBFloor.Anchor=anchor,"later real events never move originalfloor anchor")
                if closed
                    V48Assert(!NBFloor.Running && NBFloor.Blocked,"recorded end blocks the floor timer for this pull")
                else
                    V48Assert(NBFloor.Running && !NBFloor.Blocked && !NBFloor.Paused,"recorded living bossactivity prevents premature stop orpause")
            }
            else
                V48Assert(!NBFloor.Running,"burnmarker/initialcast does not silently change accepted firsthit acquisition")
            if hit!="" && firstPulse>=0 {
                cycle := Round((at-firstPulse)/12000)
                V48Assert(Abs(at-firstPulse-cycle*12000)<=150,"actual pulse remains within150ms of firsthit+12n")
                if cycle>=1 {
                    due := NBFloorDue(anchor,cycle-1,anchor+cycle*12000)
                    V48Assert(due.New && due.Cycle=cycle && due.OnTime,"native twelve-second deadline spans recorded cadence including omitted damage")
                }
            }
            V48Assert(Audio.Queue.Length=0 && !IsObject(Audio.Current),"recorded native replay cannot submit or play audio")
        }
        V48Assert(pulses=expectedPulses && starts=1,"every expected recorded pulse is replayed with exactlyone acquisition")
        V48Assert(closed && !NBFloor.Running && NBFloor.Blocked,"recorded kill orcorroborated wipe ends reminders")
        if which="0424" || which="1001"
            V48Assert(sawMissing,"fixture includes real missingpulse interval")
        if isWipe
            V48Assert(gravity.Count=7 && removed.Count=7,"Octoberwipe uses seven independently tracked gravityrecipients")
    }
    finally {
        NBFloor := saved.Floor,NBFloorOptions := saved.Options,Audio := saved.Audio
        testClock := saved.Clock,inputMode := saved.Mode,activeBoss := saved.Boss
        autoBossCalloutsEnabled := saved.Auto,CurrentRecord := saved.Record,ReadClockSample := saved.Read
    }
}

V671FloorLogFixture(which)
{
    switch which {
        case "0317":
            return "
(
[19:04:32.484] [@Player1#1001|(-452.98,2608.10,207.91,1.41)|(118915/443604)] [NAHUT {4122949560827904}:24799001107908|(-451.69,2574.16,207.91,86.19)|(14693250/36514284)] [] [Event {836045448945472}: TargetSet {836045448953668}]
[19:04:32.798] [Singularity Chamber {4122580193640448}:24799001107787|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player2#1002|(-440.15,2571.62,207.91,131.86)|(275045/443173)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[19:04:32.798] [Singularity Chamber {4122580193640448}:24799001107787|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player1#1001|(-453.03,2606.20,207.91,1.41)|(118915/443604)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[19:04:32.798] [Singularity Chamber {4122580193640448}:24799001107787|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player3#1003|(-446.94,2577.01,207.91,-39.71)|(423521/440738)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[19:04:32.798] [Singularity Chamber {4122580193640448}:24799001107787|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player4#1004|(-446.37,2573.97,207.91,152.39)|(408522/435260)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[19:04:32.799] [Singularity Chamber {4122580193640448}:24799001107787|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player5#1005|(-451.92,2577.24,207.91,-108.00)|(487299/489226)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[19:04:32.799] [Singularity Chamber {4122580193640448}:24799001107787|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player6#1006|(-450.85,2575.43,207.91,57.26)|(423112/443604)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[19:04:32.799] [Singularity Chamber {4122580193640448}:24799001107787|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player7#1007|(-454.44,2578.00,207.91,-34.52)|(365537/443634)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[19:04:32.799] [Singularity Chamber {4122580193640448}:24799001107787|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player8#1008|(-460.72,2573.21,207.91,-102.42)|(354109/502898)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[19:04:32.799] [NAHUT {4122949560827904}:24799001107908|(-454.87,2573.85,207.91,83.90)|(14693250/36514284)] [=] [Discharge {4133906022400000}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[19:04:34.673] [@Player1#1001|(-453.21,2598.84,207.91,1.41)|(118915/443604)] [NAHUT {4122949560827904}:24799001107908|(-456.25,2573.71,207.91,83.77)|(14539664/36514284)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5344 elemental {836045448940875}) <5344.0>
[19:04:36.775] [@Player3#1003|(-451.87,2579.07,207.91,116.33)|(440738/440738)] [NAHUT {4122949560827904}:24799001107908|(-456.25,2573.71,207.91,83.77)|(14335850/36514284)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9967* elemental {836045448940875}) <9967.0>
[19:04:38.891] [@Player5#1005|(-452.26,2581.66,207.91,26.84)|(489226/489226)] [NAHUT {4122949560827904}:24799001107908|(-456.25,2573.71,207.91,83.77)|(13950512/36514284)] [Depredating Volts {3408949902573568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10356 energy {836045448940874}) <32102.0>
[19:04:41.000] [@Player1#1001|(-452.68,2579.70,207.91,30.77)|(331687/443604)] [NAHUT {4122949560827904}:24799001107908|(-456.25,2573.71,207.91,99.45)|(13633246/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3532 elemental {836045448940875}) <3532.0>
[19:04:42.955] [@Player8#1008|(-460.59,2574.44,207.91,-80.42)|(478317/502898)] [NAHUT {4122949560827904}:24799001107908|(-456.25,2573.71,207.91,99.45)|(13275762/36514284)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9400 energy {836045448940874}) <28200.0>
[19:04:44.798] [@Player2#1002|(-452.07,2579.16,207.91,138.71)|(443173/443173)] [NAHUT {4122949560827904}:24799001107908|(-456.25,2573.71,207.91,99.45)|(13007165/36514284)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15777* internal {836045448940876}) <15777.0>
[19:04:44.901] [NAHUT {4122949560827904}:24799001107908|(-456.25,2573.71,207.91,99.45)|(13003486/36514284)] [@Player8#1008|(-460.59,2574.44,207.91,279.57)|(432393/502898)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (69669 internal {836045448940876}) <69669.0>
[19:04:46.799] [NAHUT {4122949560827904}:24799001107908|(-458.05,2575.67,207.91,138.40)|(12748495/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[19:04:48.982] [@Player3#1003|(-457.94,2593.51,207.91,63.78)|(405043/440738)] [NAHUT {4122949560827904}:24799001107908|(-462.09,2583.03,207.91,74.22)|(12499390/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23614* elemental {836045448940875}) <23614.0>
[19:04:50.794] [@Player3#1003|(-454.87,2592.48,207.91,23.96)|(427463/440738)] [NAHUT {4122949560827904}:24799001107908|(-462.04,2582.94,207.91,133.68)|(12155216/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3543 elemental {836045448940875}) <3543.0>
[19:04:52.696] [@Player3#1003|(-457.41,2590.55,207.91,34.52)|(430802/440738)] [NAHUT {4122949560827904}:24799001107908|(-464.21,2592.08,207.91,148.28)|(11821303/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12592* elemental {836045448940875}) <12592.0>
[19:04:54.500] [@Player8#1008|(-467.28,2600.15,207.91,-81.19)|(454472/502898)] [NAHUT {4122949560827904}:24799001107908|(-465.77,2596.15,207.91,160.45)|(11586264/36514284)] [Depredating Volts {3408949902573568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15557* energy {836045448940874}) <48227.0>
[19:04:56.627] [@Player3#1003|(-458.43,2602.24,207.91,82.82)|(440738/440738)] [NAHUT {4122949560827904}:24799001107908|(-464.13,2597.55,207.91,131.99)|(11311388/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7795* elemental {836045448940875}) <7795.0>
[19:04:56.909] [NAHUT {4122949560827904}:24799001107908|(-463.72,2597.20,207.91,131.84)|(11214804/36514284)] [@Player8#1008|(-467.04,2600.18,207.91,-63.83)|(358743/502898)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (60021 internal {836045448940876}) <60021.0>
[19:04:58.797] [@Player1#1001|(-456.90,2598.99,207.91,119.45)|(277715/443604)] [NAHUT {4122949560827904}:24799001107908|(-465.20,2599.54,207.91,157.56)|(10980787/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6249 elemental {836045448940875}) <6249.0>
[19:05:00.649] [@Player8#1008|(-466.76,2609.18,207.91,21.46)|(337817/502898)] [NAHUT {4122949560827904}:24799001107908|(-464.43,2605.22,207.91,157.65)|(10718791/36514284)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10843 kinetic {836045448940873}) <48794.0>
[19:05:02.504] [@Player3#1003|(-457.11,2606.42,207.91,162.53)|(440738/440738)] [NAHUT {4122949560827904}:24799001107908|(-465.21,2605.35,207.91,128.68)|(10395757/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5497 elemental {836045448940875}) <5497.0>
[19:05:04.309] [@Player3#1003|(-455.40,2608.86,207.91,128.65)|(440738/440738)] [NAHUT {4122949560827904}:24799001107908|(-463.47,2612.75,207.91,171.54)|(10055761/36514284)] [Mandalorian Armaments {4574075745730560}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13480* kinetic {836045448940873}) <13480.0>
[19:05:06.210] [@Player3#1003|(-454.24,2616.05,207.91,118.99)|(440738/440738)] [NAHUT {4122949560827904}:24799001107908|(-460.85,2622.20,207.91,-178.31)|(9821937/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16316 elemental {836045448940875}) <16316.0>
[19:05:08.013] [@Player4#1004|(-452.51,2615.72,207.91,-145.83)|(353203/435260)] [NAHUT {4122949560827904}:24799001107908|(-460.83,2622.61,207.91,-176.77)|(9604641/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6460 elemental {836045448940875}) <6460.0>
[19:05:08.822] [NAHUT {4122949560827904}:24799001107908|(-460.83,2622.61,207.91,-178.02)|(9537108/36514284)] [@Player8#1008|(-460.68,2627.13,207.91,-23.79)|(234252/502898)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (70739 internal {836045448940876}) <70739.0>
[19:05:10.648] [NAHUT {4122949560827904}:24799001107908|(-459.85,2624.22,207.91,-147.48)|(9382257/36514284)] [@Player8#1008|(-457.05,2628.50,207.91,-45.00)|(275928/502898)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -parry {836045448945503}) <1.0>
[19:05:12.519] [@Player3#1003|(-450.65,2623.81,207.91,-162.43)|(192446/440738)] [NAHUT {4122949560827904}:24799001107908|(-456.99,2628.22,207.91,-166.71)|(9173168/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1531* energy {836045448940874}) <1531.0>
[19:05:14.327] [@Player5#1005|(-446.72,2626.61,207.91,53.42)|(377546/489226)] [NAHUT {4122949560827904}:24799001107908|(-456.93,2627.52,207.91,155.83)|(8817214/36514284)] [Depredating Volts {3408949902573568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15147* energy {836045448940874}) <46957.0>
[19:05:16.325] [NAHUT {4122949560827904}:24799001107908|(-454.39,2631.74,207.91,-161.01)|(8443718/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[19:05:18.125] [@Player2#1002|(-447.12,2631.34,207.91,-150.50)|(443173/443173)] [NAHUT {4122949560827904}:24799001107908|(-451.04,2635.55,207.91,-163.51)|(8130081/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7790 ~7791 internal {836045448940876}) <7790.0>
[19:05:19.926] [@Player4#1004|(-445.83,2629.83,207.91,-176.83)|(374680/435260)] [NAHUT {4122949560827904}:24799001107908|(-448.65,2636.96,207.91,-181.11)|(7843605/36514284)] [Immolate {814519072849920}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (67332* elemental {836045448940875}) <67332.0>
[19:05:20.836] [NAHUT {4122949560827904}:24799001107908|(-448.65,2636.96,207.91,-181.11)|(7693038/36514284)] [@Player8#1008|(-448.73,2641.38,207.91,-1.02)|(350376/502898)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -resist {836045448945507}) <1.0>
[19:05:22.924] [@Player4#1004|(-442.00,2632.88,207.91,-136.44)|(216571/435260)] [NAHUT {4122949560827904}:24799001107908|(-446.41,2639.74,207.91,-143.00)|(7346306/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14966* elemental {836045448940875}) <14966.0>
[19:05:24.826] [@Player1#1001|(-433.76,2637.96,207.79,-121.97)|(336378/443604)] [NAHUT {4122949560827904}:24799001107908|(-435.95,2646.90,208.16,-106.48)|(7156621/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8802 elemental {836045448940875}) <8802.0>
[19:05:26.722] [@Player3#1003|(-424.94,2642.09,207.91,-161.37)|(386173/440738)] [NAHUT {4122949560827904}:24799001107908|(-427.93,2648.28,207.91,-178.86)|(6972163/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5110 elemental {836045448940875}) <5110.0>
[19:05:28.624] [@Player5#1005|(-426.74,2643.12,207.91,-116.32)|(468515/489226)] [NAHUT {4122949560827904}:24799001107908|(-427.53,2647.55,207.91,163.28)|(6640611/36514284)] [Dark Charge {3421302228516864}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (847* internal {836045448940876}) <2541.0>
[19:05:30.525] [@Player3#1003|(-421.35,2633.95,206.99,-100.83)|(375009/440738)] [NAHUT {4122949560827904}:24799001107908|(-424.47,2649.70,207.91,-134.42)|(6401669/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6561 elemental {836045448940875}) <6561.0>
[19:05:30.862] [Singularity Chamber {4122580193640448}:24799001107787|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player1#1001|(-423.46,2636.68,207.91,-166.65)|(11201/443604)] [] [Event {836045448945472}: Death {836045448945493}]
[19:05:32.390] [NAHUT {4122949560827904}:24799001107908|(-416.34,2651.45,207.91,-94.63)|(6293720/36514284)] [@Player8#1008|(-411.74,2651.67,207.91,-58.81)|(322855/502898)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -parry {836045448945503}) <1.0>
[19:05:32.830] [NAHUT {4122949560827904}:24799001107908|(-416.34,2651.45,207.91,-93.85)|(6249831/36514284)] [@Player8#1008|(-411.68,2651.93,207.91,32.37)|(273338/502898)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (70739 ~49517 internal {836045448940876} (21222 absorbed {836045448945511})) <70739.0>
[19:05:34.728] [@Player8#1008|(-408.54,2651.08,207.91,22.17)|(272289/502898)] [NAHUT {4122949560827904}:24799001107908|(-414.36,2651.31,207.91,-88.80)|(6069500/36514284)] [Depredating Volts {3408949902573568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10048 energy {836045448940874}) <31149.0>
[19:05:36.629] [@Player5#1005|(-405.28,2643.32,207.91,96.43)|(382144/489226)] [NAHUT {4122949560827904}:24799001107908|(-404.49,2649.91,207.91,-79.98)|(5791943/36514284)] [Depredating Volts {3408949902573568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14872* energy {836045448940874}) <46102.0>
[19:05:38.429] [@Player4#1004|(-404.52,2645.02,207.91,-101.48)|(268517/435260)] [NAHUT {4122949560827904}:24799001107908|(-398.01,2647.61,207.91,-90.93)|(5612058/36514284)] [Flaming Fist {3384704812187648}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16301 kinetic {836045448940873}) <16301.0>
[19:05:40.234] [@Player5#1005|(-401.20,2641.81,207.91,211.56)|(437983/489226)] [NAHUT {4122949560827904}:24799001107908|(-398.17,2646.63,207.91,-141.38)|(5428524/36514284)] [Thrash {3413184740327424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3709 ~3710 energy {836045448940874}) <11128.0>
[19:05:42.130] [@Player3#1003|(-398.58,2642.67,207.91,-65.24)|(440738/440738)] [NAHUT {4122949560827904}:24799001107908|(-397.41,2646.81,207.91,-99.94)|(5094705/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10375* ~10376 elemental {836045448940875}) <10375.0>
[19:05:44.007] [@Player3#1003|(-395.63,2642.60,207.91,-65.24)|(440738/440738)] [NAHUT {4122949560827904}:24799001107908|(-395.36,2647.14,207.91,-100.09)|(4936624/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (19129 elemental {836045448940875}) <19129.0>
[19:05:44.837] [NAHUT {4122949560827904}:24799001107908|(-395.36,2647.14,207.91,-100.09)|(4819565/36514284)] [@Player8#1008|(-390.87,2647.93,207.91,80.08)|(183537/502898)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (56805 internal {836045448940876}) <56805.0>
[19:05:46.759] [@Player4#1004|(-391.12,2638.10,207.91,-101.26)|(278332/435260)] [NAHUT {4122949560827904}:24799001107908|(-391.94,2645.83,207.91,-77.80)|(4687217/36514284)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7746 elemental {836045448940875}) <7746.0>
[19:05:48.937] [NAHUT {4122949560827904}:24799001107908|(-378.66,2635.89,207.91,-52.88)|(4409097/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[19:05:50.820] [@Player8#1008|(-369.92,2627.89,207.91,172.44)|(185409/502898)] [NAHUT {4122949560827904}:24799001107908|(-373.21,2630.10,207.91,-50.54)|(4084211/36514284)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8481 energy {836045448940874}) <25443.0>
[19:05:52.630] [@Player3#1003|(-378.71,2629.24,207.91,-33.59)|(333982/440738)] [NAHUT {4122949560827904}:24799001107908|(-373.81,2630.20,207.91,-91.16)|(3878530/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15009 elemental {836045448940875}) <15009.0>
[19:05:54.445] [@Player4#1004|(-378.98,2627.69,207.91,-53.56)|(291560/435260)] [NAHUT {4122949560827904}:24799001107908|(-373.95,2630.16,207.91,-65.55)|(3735058/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5061 elemental {836045448940875}) <5061.0>
[19:05:56.543] [@Player3#1003|(-374.33,2620.38,207.91,-87.55)|(368454/440738)] [NAHUT {4122949560827904}:24799001107908|(-372.54,2629.04,207.91,-50.13)|(3543863/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7795* ~7796 elemental {836045448940875}) <7795.0>
[19:05:56.851] [NAHUT {4122949560827904}:24799001107908|(-372.54,2629.04,207.91,-50.13)|(3543863/36514284)] [@Player8#1008|(-369.08,2626.15,207.91,76.98)|(104440/502898)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (69667 internal {836045448940876}) <69667.0>
[19:05:58.764] [NAHUT {4122949560827904}:24799001107908|(-369.22,2623.77,207.91,-36.16)|(3341877/36514284)] [@Player8#1008|(-366.02,2619.39,207.91,-27.71)|(84863/502898)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -parry {836045448945503}) <1.0>
[19:06:00.749] [@Player4#1004|(-373.60,2617.83,207.91,-43.35)|(71913/435260)] [NAHUT {4122949560827904}:24799001107908|(-365.93,2614.69,207.91,-40.19)|(3118908/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9660 ~9661 elemental {836045448940875}) <9660.0>
[19:06:02.549] [@Player4#1004|(-371.11,2615.02,207.91,-43.36)|(90546/435260)] [NAHUT {4122949560827904}:24799001107908|(-366.17,2610.65,207.91,-74.95)|(2928675/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6998 elemental {836045448940875}) <6998.0>
[19:06:04.356] [@Player2#1002|(-367.60,2607.75,207.91,-75.10)|(359796/443173)] [NAHUT {4122949560827904}:24799001107908|(-366.55,2610.50,207.91,-123.33)|(2722992/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10935* internal {836045448940876}) <10935.0>
[19:06:06.235] [@Player8#1008|(-363.03,2611.40,207.91,11.76)|(169612/502898)] [NAHUT {4122949560827904}:24799001107908|(-366.79,2610.36,207.91,-109.04)|(2470868/36514284)] [Spike {808312845107200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10238 energy {836045448940874}) <30713.0>
[19:06:08.052] [@Player2#1002|(-363.59,2602.71,207.74,78.42)|(405452/443173)] [NAHUT {4122949560827904}:24799001107908|(-365.31,2610.17,207.91,-19.98)|(2323852/36514284)] [Force Rend {3361615068004352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12667* internal {836045448940876}) <12667.0>
[19:06:08.864] [NAHUT {4122949560827904}:24799001107908|(-365.31,2610.17,207.91,-19.98)|(2232336/36514284)] [@Player4#1004|(-364.17,2607.38,208.01,-28.09)|(140535/435260)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (64308 internal {836045448940876}) <64308.0>
[19:06:10.757] [@Player3#1003|(-365.75,2591.24,207.91,-108.96)|(361119/440738)] [NAHUT {4122949560827904}:24799001107908|(-363.85,2605.42,208.09,1.71)|(2164681/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4968 ~4969 elemental {836045448940875}) <4968.0>
[19:06:12.561] [@Player5#1005|(-366.04,2588.66,207.91,119.63)|(327656/489226)] [NAHUT {4122949560827904}:24799001107908|(-364.99,2590.99,207.91,18.77)|(2064286/36514284)] [Dark Charge {3421302228516864}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (847* internal {836045448940876}) <2541.0>
[19:06:14.370] [@Player2#1002|(-368.77,2588.66,207.91,1.85)|(355849/443173)] [NAHUT {4122949560827904}:24799001107908|(-369.05,2579.13,207.91,15.07)|(1946306/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6413 internal {836045448940876}) <6413.0>
[19:06:16.267] [@Player6#1006|(-368.89,2585.36,207.91,34.22)|(440602/443604)] [NAHUT {4122949560827904}:24799001107908|(-369.17,2578.83,207.91,-19.97)|(1758124/36514284)] [Bushwhack {3996475658862592}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11628* internal {836045448940876}) <8721.0>
[19:06:18.164] [@Player3#1003|(-375.26,2573.10,207.91,-134.61)|(421712/440738)] [NAHUT {4122949560827904}:24799001107908|(-369.21,2578.91,207.91,-34.61)|(1473684/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5110 elemental {836045448940875}) <5110.0>
[19:06:20.272] [@Player2#1002|(-372.19,2576.72,207.91,-77.03)|(443173/443173)] [NAHUT {4122949560827904}:24799001107908|(-369.61,2579.29,207.91,-12.64)|(1145509/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16075* internal {836045448940876}) <16075.0>
[19:06:20.880] [NAHUT {4122949560827904}:24799001107908|(-369.63,2578.83,207.91,-2.58)|(1076773/36514284)] [@Player8#1008|(-369.42,2574.33,207.91,153.49)|(334267/502898)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (42872 internal {836045448940876}) <42872.0>
[19:06:22.970] [NAHUT {4122949560827904}:24799001107908|(-370.14,2577.58,207.91,25.80)|(887863/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[19:06:24.772] [@Player3#1003|(-380.14,2566.73,207.91,-81.48)|(391136/440738)] [NAHUT {4122949560827904}:24799001107908|(-377.53,2566.81,207.91,35.45)|(622362/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4700* elemental {836045448940875}) <4700.0>
[19:06:26.652] [NAHUT {4122949560827904}:24799001107908|(-384.10,2559.70,207.91,16.39)|(394873/36514284)] [@Player8#1008|(-385.21,2556.27,207.91,-102.08)|(388988/502898)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16265 kinetic {836045448940873} -shield {836045448945509} (135431 absorbed {836045448945511})) <16265.0>
[19:06:28.455] [@Player2#1002|(-387.33,2559.25,207.91,-25.92)|(443173/443173)] [NAHUT {4122949560827904}:24799001107908|(-383.94,2560.98,207.91,-13.23)|(171299/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13325 energy {836045448940874}) <13325.0>
[19:06:30.510] [] [@Player5#1005|(-390.59,2557.83,207.91,-111.06)|(428695/489226)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[19:06:30.510] [] [@Player8#1008|(-381.54,2557.71,207.91,-158.04)|(372075/502898)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[19:06:30.510] [] [@Player4#1004|(-389.70,2563.44,207.91,8.23)|(211843/435260)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[19:06:30.511] [] [@Player3#1003|(-390.73,2557.00,207.91,-81.51)|(413682/440738)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[19:06:30.511] [] [@Player2#1002|(-388.05,2558.64,207.91,-70.45)|(443173/443173)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[19:06:30.511] [] [@Player7#1007|(-391.75,2557.14,207.91,-119.98)|(295359/443634)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[19:06:30.511] [] [@Player1#1001|(-423.46,2636.68,207.91,-166.65)|(11201/443604)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[19:06:30.511] [] [@Player6#1006|(-381.99,2564.33,207.91,36.43)|(443604/443604)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[19:06:30.590] [@Player8#1008|(-381.54,2557.71,207.91,-179.96)|(372075/502898)] [NAHUT {4122949560827904}:24799001107908|(-384.22,2561.33,207.91,-36.56)|(0/36514284)] [Spike {808312845107200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10498 energy {836045448940874}) <31494.0>
[19:06:30.785] [@Player6#1006|(-382.02,2564.30,207.91,47.19)|(443604/443604)] [NAHUT {4122949560827904}:24799001107908|(-384.22,2561.33,207.91,-36.56)|(0/36514284)] [] [Event {836045448945472}: Death {836045448945493}]
)"
        case "0424":
            return "
(
[17:01:23.275] [@Player1#1001|(-423.16,2559.78,207.91,-79.87)|(443782/443782)] [NAHUT {4122949560827904}:52190000782084|(-420.04,2551.75,207.91,-38.13)|(13449745/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12077 energy {836045448940874}) <9058.0>
[17:01:23.425] [Singularity Chamber {4122580193640448}:52190000782280|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player2#1002|(-411.04,2571.99,206.41,30.16)|(75329/503131)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[17:01:23.425] [Singularity Chamber {4122580193640448}:52190000782280|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player1#1001|(-422.63,2558.92,207.91,-79.87)|(443782/443782)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[17:01:23.425] [Singularity Chamber {4122580193640448}:52190000782280|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player3#1003|(-410.41,2557.62,207.91,75.17)|(358023/443752)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[17:01:23.425] [Singularity Chamber {4122580193640448}:52190000782280|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player4#1004|(-417.78,2557.09,207.91,152.00)|(432676/432676)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[17:01:23.426] [Singularity Chamber {4122580193640448}:52190000782280|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player5#1005|(-413.21,2556.56,207.91,-177.36)|(442565/442565)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[17:01:23.426] [Singularity Chamber {4122580193640448}:52190000782280|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player6#1006|(-409.44,2554.32,207.91,121.88)|(400549/431370)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[17:01:23.426] [Singularity Chamber {4122580193640448}:52190000782280|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player7#1007|(-418.71,2551.65,207.91,-104.96)|(110857/443426)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[17:01:23.426] [Singularity Chamber {4122580193640448}:52190000782280|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player8#1008|(-417.13,2548.13,207.91,-157.71)|(359465/502976)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[17:01:23.713] [NAHUT {4122949560827904}:52190000782084|(-419.58,2551.27,207.91,-42.87)|(13438705/36514284)] [=] [Discharge {4133906022400000}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[17:01:24.520] [Singularity Chamber {4122580193640448}:52190000782280|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player2#1002|(-408.43,2570.59,206.41,-7.52)|(0/503131)] [] [Event {836045448945472}: Death {836045448945493}]
[17:01:25.513] [@Player1#1001|(-419.46,2554.98,207.91,-71.22)|(443782/443782)] [NAHUT {4122949560827904}:52190000782084|(-418.74,2550.43,207.91,-43.78)|(13165224/36514284)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (19121* internal {836045448940876}) <19121.0>
[17:01:27.428] [@Player4#1004|(-412.17,2558.11,207.91,44.65)|(432676/432676)] [NAHUT {4122949560827904}:52190000782084|(-418.74,2550.43,207.91,6.32)|(12988432/36514284)] [Burning (Primed Rail Shot) {4546940142354702}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9551 elemental {836045448940875}) <9551.0>
[17:01:29.516] [@Player1#1001|(-418.00,2554.88,207.91,67.81)|(443782/443782)] [NAHUT {4122949560827904}:52190000782084|(-418.74,2550.43,207.91,-8.09)|(12725212/36514284)] [Force Rend {3361615068004352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10533* internal {836045448940876}) <10533.0>
[17:01:31.411] [@Player4#1004|(-409.26,2558.16,207.91,123.51)|(432676/432676)] [NAHUT {4122949560827904}:52190000782084|(-418.74,2550.43,207.91,-43.86)|(12430576/36514284)] [Burning {1202324554907921}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6193* elemental {836045448940875}) <6193.0>
[17:01:33.710] [@Player3#1003|(-408.34,2566.00,207.35,148.39)|(410838/443752)] [NAHUT {4122949560827904}:52190000782084|(-417.71,2549.59,207.91,-54.33)|(12271669/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9091 elemental {836045448940875}) <6818.0>
[17:01:35.526] [@Player4#1004|(-406.97,2557.37,207.91,21.71)|(432676/432676)] [NAHUT {4122949560827904}:52190000782084|(-417.71,2549.59,207.91,-54.33)|(12201882/36514284)] [Artillery Blitz {3963997116170240}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4202 kinetic {836045448940873}) <4202.0>
[17:01:35.729] [NAHUT {4122949560827904}:52190000782084|(-417.71,2549.59,207.91,-54.33)|(12192738/36514284)] [@Player8#1008|(-413.98,2546.90,207.91,-171.64)|(209779/502976)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (71810 internal {836045448940876}) <71810.0>
[17:01:37.710] [@Player4#1004|(-407.14,2558.45,207.91,16.58)|(369047/432676)] [NAHUT {4122949560827904}:52190000782084|(-415.94,2549.17,207.91,-61.25)|(12104356/36514284)] [Artillery Blitz {3963997116170240}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6106 elemental {836045448940875}) <6106.0>
[17:01:40.014] [@Player8#1008|(-406.12,2547.39,207.91,175.05)|(261997/502976)] [NAHUT {4122949560827904}:52190000782084|(-412.16,2549.24,207.91,-73.59)|(11897598/36514284)] [Cascading Debris {3414228417380352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10062 kinetic {836045448940873}) <31192.0>
[17:01:41.817] [@Player2#1002|(-405.92,2556.06,207.91,-1.29)|(346789/503131)] [NAHUT {4122949560827904}:52190000782084|(-412.28,2549.25,207.91,-55.53)|(11636888/36514284)] [Discharge {4056527891595264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7827 internal {836045448940876}) <35221.0>
[17:01:43.690] [@Player8#1008|(-398.39,2550.11,207.91,165.66)|(284109/502976)] [NAHUT {4122949560827904}:52190000782084|(-402.56,2551.24,207.91,-73.17)|(11437790/36514284)] [Slow Time {981503106351104}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11061 kinetic {836045448940873}) <49776.0>
[17:01:45.497] [@Player1#1001|(-401.18,2556.64,207.91,-10.73)|(443782/443782)] [NAHUT {4122949560827904}:52190000782084|(-396.26,2553.16,207.91,-84.70)|(11183835/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14221 energy {836045448940874}) <14221.0>
[17:01:47.322] [NAHUT {4122949560827904}:52190000782084|(-394.93,2553.89,207.91,-70.81)|(10906141/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[17:01:47.731] [NAHUT {4122949560827904}:52190000782084|(-394.93,2553.89,207.91,-70.81)|(10864642/36514284)] [@Player8#1008|(-390.67,2552.40,207.91,147.04)|(121901/502976)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (57877 internal {836045448940876}) <57877.0>
[17:01:49.613] [@Player4#1004|(-390.72,2562.43,208.66,-42.57)|(256524/432676)] [NAHUT {4122949560827904}:52190000782084|(-392.28,2554.52,207.91,-99.06)|(10585895/36514284)] [Burning (Primed Rail Shot) {4546940142354702}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14631* elemental {836045448940875}) <14631.0>
[17:01:51.422] [@Player7#1007|(-386.86,2566.00,207.91,-108.34)|(180021/443426)] [NAHUT {4122949560827904}:52190000782084|(-382.20,2560.82,207.91,-113.56)|(10400901/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7426 elemental {836045448940875}) <7426.0>
[17:01:59.736] [] [@Player8#1008|(-372.94,2567.69,207.91,133.64)|(118921/502976)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (71810 internal {836045448940876}) <71810.0>
[17:02:01.234] [NAHUT {4122949560827904}:52190000782084|(-376.79,2567.33,207.91,-106.87)|(9905012/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[17:02:03.333] [NAHUT {4122949560827904}:52190000782084|(-369.38,2576.91,207.91,-141.26)|(9788583/36514284)] [@Player8#1008|(-365.98,2581.23,207.91,111.89)|(89852/502976)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -parry {836045448945503}) <1.0>
[17:02:05.148] [@Player3#1003|(-372.61,2583.70,207.91,-19.50)|(265480/443752)] [NAHUT {4122949560827904}:52190000782084|(-368.96,2577.59,207.91,-116.78)|(9633101/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7279 elemental {836045448940875}) <5459.0>
[17:02:07.169] [@Player4#1004|(-374.66,2586.33,207.91,-48.29)|(270804/432676)] [NAHUT {4122949560827904}:52190000782084|(-368.96,2577.59,207.91,-55.22)|(9392280/36514284)] [High Impact Bolt {2021194429628416}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (34293* energy {836045448940874}) <34293.0>
[17:02:09.122] [@Player3#1003|(-373.81,2586.69,207.91,-37.20)|(289242/443752)] [NAHUT {4122949560827904}:52190000782084|(-368.70,2578.53,207.91,-160.06)|(9149605/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16598 elemental {836045448940875}) <12448.0>
[17:02:10.933] [@Player3#1003|(-372.12,2590.85,207.91,-94.14)|(294616/443752)] [NAHUT {4122949560827904}:52190000782084|(-366.05,2588.16,207.91,-143.38)|(8769255/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3931 elemental {836045448940875}) <2948.0>
[17:02:11.750] [NAHUT {4122949560827904}:52190000782084|(-364.81,2590.83,207.91,-164.76)|(8597659/36514284)] [@Player2#1002|(-363.61,2595.24,208.20,-176.15)|(232550/503131)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (68629 internal {836045448940876}) <68629.0>
[17:02:13.835] [@Player3#1003|(-372.60,2604.12,208.01,-161.64)|(241806/443752)] [NAHUT {4122949560827904}:52190000782084|(-364.15,2599.01,207.85,-177.56)|(8330564/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3745 elemental {836045448940875}) <2809.0>
[17:02:15.739] [@Player3#1003|(-372.06,2611.63,207.91,-114.75)|(241806/443752)] [NAHUT {4122949560827904}:52190000782084|(-366.47,2613.17,207.91,161.92)|(8036851/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8618 ~8619 elemental {836045448940875}) <6464.0>
[17:02:17.733] [@Player8#1008|(-374.65,2611.45,207.91,179.76)|(371334/502976)] [NAHUT {4122949560827904}:52190000782084|(-367.96,2614.05,207.91,-91.84)|(7864253/36514284)] [Force Breach {4056656740614144}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7555 internal {836045448940876}) <33995.0>
[17:02:19.547] [@Player4#1004|(-373.19,2616.07,207.91,-122.68)|(220361/432676)] [NAHUT {4122949560827904}:52190000782084|(-368.54,2614.11,207.91,-105.45)|(7607081/36514284)] [Shockstrike {3391447910842368}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (28266* kinetic {836045448940873}) <28266.0>
[17:02:21.410] [@Player2#1002|(-368.87,2621.49,207.91,69.28)|(193190/503131)] [NAHUT {4122949560827904}:52190000782084|(-368.89,2617.09,207.91,-178.33)|(7299209/36514284)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (25996* energy {836045448940874}) <77989.0>
[17:02:23.332] [@Player4#1004|(-378.23,2625.56,207.91,-108.75)|(240026/432676)] [NAHUT {4122949560827904}:52190000782084|(-370.23,2623.51,207.91,162.63)|(6975575/36514284)] [Shoulder Cannon {3066520749998354}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13083* kinetic {836045448940873}) <13083.0>
[17:02:23.753] [NAHUT {4122949560827904}:52190000782084|(-370.23,2623.51,207.91,162.63)|(6926201/36514284)] [@Player2#1002|(-371.59,2627.86,207.91,70.76)|(156467/503131)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (71810 ~59575 internal {836045448940876} (12236 absorbed {836045448945511})) <71810.0>
[17:02:25.633] [@Player1#1001|(-376.34,2623.66,207.91,-160.89)|(239004/443782)] [NAHUT {4122949560827904}:52190000782084|(-372.76,2628.43,207.91,152.30)|(6535293/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (505 energy {836045448940874}) <505.0>
[17:02:27.437] [@Player3#1003|(-383.16,2631.17,209.78,-152.11)|(254629/475905)] [NAHUT {4122949560827904}:52190000782084|(-379.16,2635.73,207.91,135.64)|(6263378/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7271 elemental {836045448940875}) <5453.0>
[17:02:29.240] [@Player7#1007|(-385.08,2635.20,207.91,-136.18)|(284861/475548)] [NAHUT {4122949560827904}:52190000782084|(-384.88,2640.39,207.91,140.76)|(5990943/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6791 elemental {836045448940875}) <6791.0>
[17:02:31.102] [@Player2#1002|(-383.21,2641.18,207.91,76.44)|(509446/539221)] [NAHUT {4122949560827904}:52190000782084|(-385.02,2640.47,207.91,-103.50)|(5734002/36514284)] [Sonic Rebounder {801354998088314}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14395 kinetic {836045448940873}(reflected {836045448953649}))
[17:02:32.981] [@Player4#1004|(-397.30,2642.34,207.91,-144.51)|(267227/463775)] [NAHUT {4122949560827904}:52190000782084|(-386.05,2641.55,207.91,132.68)|(5546796/36514284)] [Plasmatize {3391666954174464}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7080 elemental {836045448940875}) <7080.0>
[17:02:34.844] [@Player4#1004|(-401.92,2643.56,207.91,-126.14)|(295748/463775)] [NAHUT {4122949560827904}:52190000782084|(-386.36,2641.83,207.91,132.17)|(5308117/36514284)] [Burning {1202324554907921}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5220 elemental {836045448940875}) <5220.0>
[17:02:35.752] [NAHUT {4122949560827904}:52190000782084|(-386.36,2641.83,207.91,132.17)|(5195937/36514284)] [@Player2#1002|(-389.76,2644.92,207.91,38.05)|(470817/539221)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (43944 internal {836045448940876}) <43944.0>
[17:02:37.676] [@Player7#1007|(-395.86,2640.16,207.91,-137.25)|(306375/443426)] [NAHUT {4122949560827904}:52190000782084|(-390.41,2644.37,207.91,121.61)|(4935771/36514284)] [Searing Wave {3915721683763200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35741 elemental {836045448940875}) <35741.0>
[17:02:39.749] [@Player7#1007|(-400.30,2642.86,207.91,117.40)|(311712/443426)] [NAHUT {4122949560827904}:52190000782084|(-398.81,2648.56,207.91,111.89)|(4593704/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12594* ~12595 elemental {836045448940875}) <12594.0>
[17:02:41.551] [@Player1#1001|(-404.88,2644.75,207.91,-157.66)|(378561/443782)] [NAHUT {4122949560827904}:52190000782084|(-401.27,2648.51,207.91,184.20)|(4290664/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7251 internal {836045448940876}) <7251.0>
[17:02:43.449] [NAHUT {4122949560827904}:52190000782084|(-402.56,2647.73,207.91,-140.11)|(3993582/36514284)] [@Player2#1002|(-400.64,2650.42,207.91,16.15)|(339689/503131)] [Energized Slice {4137075708264448}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (120076 energy {836045448940874} -shield {836045448945509} (216858 absorbed {836045448945511})) <120076.0>
[17:02:45.330] [@Player2#1002|(-408.60,2651.29,207.91,15.55)|(324509/503131)] [NAHUT {4122949560827904}:52190000782084|(-404.35,2648.79,207.91,-237.66)|(3745527/36514284)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15824* energy {836045448940874}) <47471.0>
[17:02:47.144] [@Player1#1001|(-411.43,2646.08,207.91,-172.67)|(443782/443782)] [NAHUT {4122949560827904}:52190000782084|(-409.34,2650.74,207.91,108.21)|(3370258/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15809* internal {836045448940876}) <15809.0>
[17:02:47.762] [NAHUT {4122949560827904}:52190000782084|(-409.34,2650.74,207.91,107.63)|(3298757/36514284)] [@Player2#1002|(-413.91,2652.18,207.91,6.11)|(243624/503131)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (70739 ~36847 internal {836045448940876} (33892 absorbed {836045448945511})) <70739.0>
[17:02:49.650] [@Player7#1007|(-415.55,2645.90,207.91,111.20)|(387971/443426)] [NAHUT {4122949560827904}:52190000782084|(-414.06,2651.19,207.91,93.68)|(3009048/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5246 elemental {836045448940875}) <5246.0>
[17:02:51.452] [@Player1#1001|(-421.11,2646.04,207.91,178.03)|(430365/443782)] [NAHUT {4122949560827904}:52190000782084|(-423.59,2650.46,207.91,87.58)|(2783436/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (610 energy {836045448940874}) <610.0>
[17:02:53.542] [@Player4#1004|(-428.34,2645.14,207.91,161.81)|(370944/432676)] [NAHUT {4122949560827904}:52190000782084|(-427.37,2648.78,207.91,166.15)|(2498077/36514284)] [Ion Pulse {2199843594305536}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15131 ~15132 elemental {836045448940875}) <15131.0>
[17:02:55.448] [@Player7#1007|(-427.84,2644.74,207.91,170.99)|(427593/443426)] [NAHUT {4122949560827904}:52190000782084|(-427.17,2647.03,207.91,-178.51)|(2140580/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6053 ~6054 elemental {836045448940875}) <6053.0>
[17:02:57.271] [@Player3#1003|(-432.87,2647.24,207.91,-84.60)|(385705/443752)] [NAHUT {4122949560827904}:52190000782084|(-427.48,2647.34,207.91,-231.63)|(1760514/36514284)] [Searing Wave {3915721683763200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (56657* elemental {836045448940875}) <42493.0>
[17:02:59.214] [@Player1#1001|(-429.00,2645.42,207.91,157.15)|(443782/443782)] [NAHUT {4122949560827904}:52190000782084|(-430.77,2649.08,207.91,72.56)|(1478154/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22750* energy {836045448940874}) <22750.0>
[17:02:59.761] [NAHUT {4122949560827904}:52190000782084|(-431.22,2649.16,207.91,70.05)|(1302605/36514284)] [@Player3#1003|(-433.25,2648.00,207.91,155.48)|(339989/443752)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (83493 internal {836045448940876}) <83493.0>
[17:03:01.621] [NAHUT {4122949560827904}:52190000782084|(-437.66,2646.27,207.74,59.77)|(1129685/36514284)] [@Player2#1002|(-444.82,2641.90,208.28,54.74)|(328262/503131)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (32892 kinetic {836045448940873}) <32892.0>
[17:03:07.852] [@Player3#1003|(-450.27,2634.40,207.91,152.10)|(343350/443752)] [NAHUT {4122949560827904}:52190000782084|(-448.32,2635.40,207.89,150.74)|(788685/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5435 elemental {836045448940875}) <4077.0>
[17:03:09.854] [NAHUT {4122949560827904}:52190000782084|(-448.73,2635.94,207.91,25.97)|(632335/36514284)] [=] [Spike {4132149380775936}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[17:03:11.798] [@Player7#1007|(-454.94,2631.03,207.91,-130.71)|(94541/443426)] [NAHUT {4122949560827904}:52190000782084|(-449.05,2635.28,207.91,25.73)|(348642/36514284)] [Close and Personal {3177532769697792}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5300 elemental {836045448940875}) <5300.0>
[17:03:11.802] [NAHUT {4122949560827904}:52190000782084|(-449.05,2635.28,207.91,25.73)|(348642/36514284)] [@Player1#1001|(-451.01,2631.21,207.91,-167.78)|(405219/443782)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (879 ~659 internal {836045448940876} (220 absorbed {836045448945511})) <879.0>
[17:03:11.806] [NAHUT {4122949560827904}:52190000782084|(-449.05,2635.28,207.91,25.73)|(348642/36514284)] [@Player3#1003|(-458.41,2616.02,208.81,-165.60)|(0/443752)] [] [Event {836045448945472}: Death {836045448945493}]
[17:03:19.342] [] [@Player4#1004|(-460.75,2620.65,207.91,100.43)|(42177/432676)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[17:03:19.342] [] [@Player7#1007|(-463.89,2615.97,207.91,-126.22)|(201056/443426)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[17:03:19.342] [] [@Player2#1002|(-465.94,2615.20,207.91,-114.23)|(98157/503131)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[17:03:19.342] [] [@Player3#1003|(-459.09,2614.62,207.91,-165.60)|(0/443752)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[17:03:19.342] [] [@Player5#1005|(-463.04,2609.41,207.91,178.79)|(190714/442565)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[17:03:19.342] [] [@Player6#1006|(-463.19,2613.02,207.91,193.19)|(172490/431370)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[17:03:19.342] [] [@Player8#1008|(-461.26,2613.49,207.91,86.86)|(368890/502976)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[17:03:19.342] [] [@Player1#1001|(-462.55,2612.78,207.91,147.68)|(443782/443782)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[17:03:19.345] [@Player1#1001|(-462.55,2612.78,207.91,147.68)|(443782/443782)] [NAHUT {4122949560827904}:52190000782084|(-463.15,2615.13,207.89,67.54)|(0/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10533* ~519 internal {836045448940876}) <10533.0>
[17:03:19.345] [@Player1#1001|(-462.55,2612.78,207.91,147.68)|(443782/443782)] [NAHUT {4122949560827904}:52190000782084|(-463.15,2615.13,207.89,67.54)|(0/36514284)] [] [Event {836045448945472}: Death {836045448945493}]
)"
        case "0609":
            return "
(
[20:15:45.824] [@Player1#1001|(-444.50,2570.16,207.91,40.19)|(434414/443634)] [NAHUT {4122949560827904}:2214001716219|(-448.11,2566.68,207.91,20.74)|(13547520/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4664 elemental {836045448940875}) <4664.0>
[20:15:45.939] [Singularity Chamber {4122580193640448}:2214001716415|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player2#1002|(-444.76,2576.14,207.91,127.97)|(437695/437695)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[20:15:45.939] [Singularity Chamber {4122580193640448}:2214001716415|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player3#1003|(-446.99,2572.99,207.91,70.02)|(389571/490735)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[20:15:45.939] [Singularity Chamber {4122580193640448}:2214001716415|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player1#1001|(-444.50,2570.16,207.91,40.19)|(434414/443634)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[20:15:45.939] [Singularity Chamber {4122580193640448}:2214001716415|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player4#1004|(-407.79,2558.63,207.91,98.42)|(233018/443322)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[20:15:45.939] [Singularity Chamber {4122580193640448}:2214001716415|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player5#1005|(-449.09,2573.57,207.91,3.93)|(351137/443752)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[20:15:45.939] [Singularity Chamber {4122580193640448}:2214001716415|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player6#1006|(-448.80,2573.80,207.91,-6.85)|(362750/443782)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[20:15:45.939] [Singularity Chamber {4122580193640448}:2214001716415|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player7#1007|(-461.24,2587.99,207.91,-23.05)|(406045/440917)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[20:15:45.939] [Singularity Chamber {4122580193640448}:2214001716415|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player8#1008|(-449.70,2562.49,207.91,-159.18)|(270873/472036)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[20:15:46.235] [NAHUT {4122949560827904}:2214001716219|(-448.23,2566.31,207.91,18.64)|(13475121/36514284)] [=] [Discharge {4133906022400000}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[20:15:48.039] [@Player1#1001|(-445.06,2570.04,207.91,40.34)|(443634/443634)] [NAHUT {4122949560827904}:2214001716219|(-448.23,2566.31,207.91,17.70)|(13239704/36514284)] [Flaming Fist {3384704812187648}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (28983* kinetic {836045448940873}) <28983.0>
[20:15:50.334] [NAHUT {4122949560827904}:2214001716219|(-448.23,2566.31,207.91,17.70)|(12935578/36514284)] [@Player8#1008|(-449.61,2561.96,207.91,-162.53)|(447094/472036)] [Energized Slice {4137075708264448}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <225597.0>
[20:15:52.136] [@Player8#1008|(-453.48,2564.85,207.91,173.02)|(472036/472036)] [NAHUT {4122949560827904}:2214001716219|(-448.23,2566.31,207.91,72.18)|(12707725/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (539 energy {836045448940874}) <1617.0>
[20:15:53.941] [@Player5#1005|(-450.18,2576.32,207.91,97.16)|(398123/443752)] [NAHUT {4122949560827904}:2214001716219|(-454.09,2569.30,207.91,118.58)|(12547274/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6840* elemental {836045448940875}) <6840.0>
[20:15:55.949] [@Player5#1005|(-454.18,2577.46,207.91,90.26)|(422167/443752)] [NAHUT {4122949560827904}:2214001716219|(-457.59,2573.31,207.91,111.36)|(12332800/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13814* elemental {836045448940875}) <13814.0>
[20:15:58.254] [@Player4#1004|(-454.85,2582.16,207.91,5.60)|(281766/443322)] [NAHUT {4122949560827904}:2214001716219|(-457.59,2573.31,207.91,113.62)|(12014547/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12303* elemental {836045448940875}) <9227.0>
[20:15:58.259] [NAHUT {4122949560827904}:2214001716219|(-457.59,2573.31,207.91,113.62)|(12014547/36514284)] [@Player8#1008|(-461.71,2575.12,207.91,48.06)|(330568/472036)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (83600 internal {836045448940876}) <83600.0>
[20:16:00.107] [@Player8#1008|(-463.07,2578.68,207.91,71.14)|(306847/472036)] [NAHUT {4122949560827904}:2214001716219|(-459.64,2575.79,207.91,129.17)|(11768570/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (876* energy {836045448940874}) <2629.0>
[20:16:01.916] [@Player3#1003|(-455.70,2585.56,207.91,68.28)|(465380/490735)] [NAHUT {4122949560827904}:2214001716219|(-460.98,2579.07,207.91,109.97)|(11474914/36514284)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14842* energy {836045448940874}) <44527.0>
[20:16:03.749] [@Player4#1004|(-454.96,2587.38,207.91,40.09)|(347449/443322)] [NAHUT {4122949560827904}:2214001716219|(-461.15,2579.30,207.91,83.92)|(11074837/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5987 elemental {836045448940875}) <4490.0>
[20:16:05.593] [@Player6#1006|(-458.30,2586.50,207.91,85.07)|(443782/443782)] [NAHUT {4122949560827904}:2214001716219|(-462.44,2584.23,207.91,167.15)|(10877925/36514284)] [Slash {947001634062336}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14456 energy {836045448940874}) <10842.0>
[20:16:07.454] [@Player5#1005|(-458.58,2594.54,207.91,104.95)|(443752/443752)] [NAHUT {4122949560827904}:2214001716219|(-465.58,2594.56,207.91,158.32)|(10670811/36514284)] [Rail Shot {814278554681344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33590* energy {836045448940874}) <33590.0>
[20:16:09.356] [@Player4#1004|(-454.15,2597.52,207.91,-169.06)|(366251/443322)] [NAHUT {4122949560827904}:2214001716219|(-465.02,2598.69,207.91,141.59)|(10439081/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10742* elemental {836045448940875}) <8057.0>
[20:16:10.270] [NAHUT {4122949560827904}:2214001716219|(-465.02,2598.69,207.91,141.59)|(10294157/36514284)] [@Player8#1008|(-467.75,2602.12,207.91,90.06)|(141963/472036)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (83600 internal {836045448940876}) <83600.0>
[20:16:12.113] [@Player5#1005|(-457.59,2604.68,207.91,106.75)|(378885/443752)] [NAHUT {4122949560827904}:2214001716219|(-465.68,2602.85,207.91,165.38)|(10067945/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16660 elemental {836045448940875}) <16660.0>
[20:16:13.947] [@Player4#1004|(-445.92,2610.71,206.51,-155.11)|(331215/443322)] [NAHUT {4122949560827904}:2214001716219|(-463.36,2603.69,207.91,87.63)|(9814344/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8230* elemental {836045448940875}) <6173.0>
[20:16:15.853] [@Player5#1005|(-456.59,2610.17,207.91,95.12)|(393446/443752)] [NAHUT {4122949560827904}:2214001716219|(-463.53,2603.65,207.91,78.99)|(9457700/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15048* elemental {836045448940875}) <15048.0>
[20:16:17.696] [@Player8#1008|(-465.22,2609.54,207.91,121.46)|(380425/472036)] [NAHUT {4122949560827904}:2214001716219|(-464.20,2604.92,207.91,167.71)|(9167454/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (719 energy {836045448940874}) <2158.0>
[20:16:19.556] [@Player4#1004|(-456.82,2606.93,207.91,121.12)|(299245/443322)] [NAHUT {4122949560827904}:2214001716219|(-463.62,2612.83,207.91,-170.72)|(8972688/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9939* elemental {836045448940875}) <7455.0>
[20:16:21.358] [@Player4#1004|(-453.89,2612.71,207.91,177.22)|(307405/443322)] [NAHUT {4122949560827904}:2214001716219|(-461.52,2621.26,207.91,-169.27)|(8699633/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4813 elemental {836045448940875}) <3610.0>
[20:16:22.285] [NAHUT {4122949560827904}:2214001716219|(-460.57,2623.27,207.91,-169.67)|(8609389/36514284)] [@Player6#1006|(-458.45,2617.90,207.91,162.54)|(365656/443782)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (81456 ~81457 internal {836045448940876}) <81456.0>
[20:16:24.171] [@Player4#1004|(-452.86,2622.22,207.91,166.92)|(236184/443322)] [NAHUT {4122949560827904}:2214001716219|(-458.21,2627.15,207.91,-164.19)|(8252880/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9170 ~9171 elemental {836045448940875}) <6878.0>
[20:16:26.048] [@Player8#1008|(-458.48,2630.72,207.91,140.96)|(274297/472036)] [NAHUT {4122949560827904}:2214001716219|(-455.13,2628.03,207.91,131.33)|(8099921/36514284)] [Rocket Punch {814300029517824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11404 kinetic {836045448940873}) <34212.0>
[20:16:27.864] [@Player5#1005|(-447.41,2632.10,207.91,133.75)|(422393/443752)] [NAHUT {4122949560827904}:2214001716219|(-455.03,2627.97,207.91,115.29)|(7681454/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12681* elemental {836045448940875}) <12681.0>
[20:16:29.672] [@Player5#1005|(-446.55,2633.55,207.91,109.94)|(432671/443752)] [NAHUT {4122949560827904}:2214001716219|(-454.57,2629.91,207.91,-167.21)|(7409158/36514284)] [Mandalorian Armaments {4574075745730560}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7839 kinetic {836045448940873}) <7839.0>
[20:16:31.569] [@Player6#1006|(-446.01,2632.27,207.91,134.40)|(376227/443782)] [NAHUT {4122949560827904}:2214001716219|(-449.82,2636.70,207.91,-145.03)|(7087758/36514284)] [Burning (Cauterize) {3460841697444169}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6129 ~6130 internal {836045448940876}) <4597.0>
[20:16:33.369] [@Player4#1004|(-442.90,2633.04,207.91,-125.28)|(389576/443322)] [NAHUT {4122949560827904}:2214001716219|(-447.91,2638.84,207.91,-130.85)|(6815435/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15160* elemental {836045448940875}) <11370.0>
[20:16:34.280] [NAHUT {4122949560827904}:2214001716219|(-447.91,2638.84,207.91,-130.85)|(6702804/36514284)] [@Player8#1008|(-444.48,2641.80,208.10,105.48)|(149741/472036)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (83600 internal {836045448940876}) <83600.0>
[20:16:36.134] [@Player1#1001|(-437.52,2635.20,207.77,-127.52)|(404816/443634)] [NAHUT {4122949560827904}:2214001716219|(-441.49,2644.01,207.97,-115.04)|(6387814/36514284)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12635* elemental {836045448940875}) <12635.0>
[20:16:37.965] [@Player6#1006|(-437.26,2636.14,207.84,-132.65)|(307601/443782)] [NAHUT {4122949560827904}:2214001716219|(-429.62,2645.85,207.91,-176.32)|(6192314/36514284)] [Burning (Cauterize) {3460841697444169}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6273 internal {836045448940876}) <4705.0>
[20:16:39.867] [@Player1#1001|(-429.01,2641.14,207.91,-176.71)|(417587/443634)] [NAHUT {4122949560827904}:2214001716219|(-429.62,2645.85,207.91,147.97)|(5984159/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13813* elemental {836045448940875}) <13813.0>
[20:16:41.668] [@Player5#1005|(-426.45,2642.63,207.91,-175.01)|(340426/443752)] [NAHUT {4122949560827904}:2214001716219|(-429.36,2646.22,207.91,218.79)|(5596024/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11565* elemental {836045448940875}) <11565.0>
[20:16:43.468] [@Player5#1005|(-421.33,2643.94,207.91,-148.91)|(340426/443752)] [NAHUT {4122949560827904}:2214001716219|(-420.79,2650.12,207.91,-115.51)|(5258259/36514284)] [Immolate {814519072849920}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (66007* elemental {836045448940875}) <66007.0>
[20:16:45.309] [@Player6#1006|(-414.52,2647.46,207.91,165.35)|(393144/443782)] [NAHUT {4122949560827904}:2214001716219|(-417.81,2651.07,207.91,-116.50)|(5014890/36514284)] [Slash {947001634062336}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13758 energy {836045448940874}) <10318.0>
[20:16:46.287] [NAHUT {4122949560827904}:2214001716219|(-417.81,2651.07,207.91,-116.50)|(4825643/36514284)] [@Player8#1008|(-413.84,2653.04,207.91,173.47)|(222636/472036)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (83600 internal {836045448940876}) <83600.0>
[20:16:48.139] [@Player8#1008|(-408.56,2652.67,207.91,179.16)|(224693/472036)] [NAHUT {4122949560827904}:2214001716219|(-413.78,2651.67,207.91,-101.21)|(4535299/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (737 energy {836045448940874}) <2210.0>
[20:16:50.064] [@Player5#1005|(-404.54,2641.19,207.91,155.59)|(114217/443752)] [NAHUT {4122949560827904}:2214001716219|(-413.17,2650.74,207.91,-138.32)|(4215047/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13031* elemental {836045448940875}) <13031.0>
[20:16:51.865] [@Player4#1004|(-405.85,2643.54,207.91,157.93)|(443322/443322)] [NAHUT {4122949560827904}:2214001716219|(-414.33,2649.50,207.91,-143.19)|(3966383/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8608* elemental {836045448940875}) <6456.0>
[20:16:53.667] [@Player5#1005|(-411.11,2646.02,207.91,93.74)|(188852/443752)] [NAHUT {4122949560827904}:2214001716219|(-413.55,2650.23,207.91,-131.19)|(3617993/36514284)] [Flaming Fist {3384704812187648}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33390* kinetic {836045448940873}) <33390.0>
[20:16:55.473] [@Player5#1005|(-416.35,2646.38,207.91,-105.76)|(188852/443752)] [NAHUT {4122949560827904}:2214001716219|(-407.62,2650.56,207.91,-92.16)|(3317187/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16035* elemental {836045448940875}) <16035.0>
[20:16:57.304] [@Player8#1008|(-394.12,2648.91,207.91,-163.14)|(349251/472036)] [NAHUT {4122949560827904}:2214001716219|(-398.03,2648.69,207.91,-91.92)|(3122531/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (653 energy {836045448940874}) <1960.0>
[20:16:58.279] [NAHUT {4122949560827904}:2214001716219|(-393.10,2646.94,207.91,-93.56)|(2954568/36514284)] [@Player8#1008|(-388.98,2647.20,207.91,-152.70)|(328359/472036)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (80385 internal {836045448940876}) <80385.0>
[20:17:00.270] [@Player6#1006|(-391.50,2638.42,207.91,-147.42)|(387182/443782)] [NAHUT {4122949560827904}:2214001716219|(-390.74,2645.66,207.91,-95.52)|(2596097/36514284)] [Force Melt {3409216190545920}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12408* elemental {836045448940875}) <9306.0>
[20:17:02.073] [@Player4#1004|(-388.41,2636.29,207.91,-124.98)|(322598/443322)] [NAHUT {4122949560827904}:2214001716219|(-385.00,2642.04,207.91,-69.74)|(2336040/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9769 elemental {836045448940875}) <7326.0>
[20:17:03.875] [NAHUT {4122949560827904}:2214001716219|(-384.95,2640.75,207.91,-132.49)|(1926297/36514284)] [=] [Energized Slice {4137075708264448}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[20:17:06.269] [@Player4#1004|(-382.61,2632.51,207.91,158.22)|(322598/443322)] [NAHUT {4122949560827904}:2214001716219|(-384.68,2640.52,207.91,-97.22)|(1688500/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8926* elemental {836045448940875}) <6695.0>
[20:17:08.173] [@Player1#1001|(-382.09,2632.09,207.91,-127.08)|(286691/443634)] [NAHUT {4122949560827904}:2214001716219|(-379.12,2636.39,207.91,-64.10)|(1438610/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5248 elemental {836045448940875}) <5248.0>
[20:17:10.070] [NAHUT {4122949560827904}:2214001716219|(-374.32,2631.50,207.91,-40.33)|(1174513/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[20:17:10.286] [NAHUT {4122949560827904}:2214001716219|(-373.61,2630.74,207.91,-41.82)|(1140799/36514284)] [@Player4#1004|(-377.91,2628.84,207.91,-118.84)|(283935/443322)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (61092 internal {836045448940876}) <61092.0>
[20:17:11.003] [Singularity Chamber {4122580193640448}:2214001716415|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player5#1005|(-379.23,2624.42,207.91,-82.10)|(0/443752)] [] [Event {836045448945472}: Death {836045448945493}]
[20:17:12.102] [NAHUT {4122949560827904}:2214001716219|(-370.40,2626.28,207.91,-38.82)|(943043/36514284)] [@Player8#1008|(-367.53,2622.65,207.91,-111.25)|(186058/472036)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18972 kinetic {836045448940873}) <18972.0>
[20:17:13.972] [@Player1#1001|(-371.58,2617.37,207.91,-109.79)|(269024/443634)] [NAHUT {4122949560827904}:2214001716219|(-368.67,2622.04,207.91,-70.19)|(691582/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5723 elemental {836045448940875}) <5723.0>
[20:17:15.864] [@Player1#1001|(-372.06,2617.67,207.91,-135.41)|(272734/443634)] [NAHUT {4122949560827904}:2214001716219|(-370.38,2621.13,207.91,-135.55)|(441120/36514284)] [Searing Wave {3915721683763200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (60672* elemental {836045448940875}) <60672.0>
[20:17:17.678] [@Player6#1006|(-370.95,2615.51,207.91,-125.89)|(324825/443782)] [NAHUT {4122949560827904}:2214001716219|(-370.38,2621.13,207.91,-106.34)|(110949/36514284)] [Merciless Slash {1261715362676736}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24511 energy {836045448940874}) <18383.0>
[20:17:18.562] [] [@Player8#1008|(-364.62,2619.12,207.91,-114.12)|(272631/472036)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[20:17:18.562] [] [@Player4#1004|(-370.54,2614.67,207.91,172.22)|(261993/443322)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[20:17:18.562] [] [@Player1#1001|(-372.01,2617.58,207.91,-127.49)|(279591/443634)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[20:17:18.562] [] [@Player6#1006|(-369.34,2615.35,207.91,-174.15)|(329507/443782)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[20:17:18.562] [] [@Player5#1005|(-363.63,2607.38,207.96,-82.10)|(110938/443752)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[20:17:18.562] [] [@Player3#1003|(-369.69,2609.71,207.91,208.25)|(387367/490735)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[20:17:18.562] [] [@Player7#1007|(-369.46,2590.86,207.91,170.69)|(394465/440917)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[20:17:18.563] [] [@Player2#1002|(-364.09,2601.93,207.91,179.44)|(194844/437695)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[20:17:18.566] [@Player1#1001|(-372.01,2617.58,207.91,-127.49)|(279591/443634)] [NAHUT {4122949560827904}:2214001716219|(-370.01,2621.09,207.91,-72.70)|(0/36514284)] [] [Event {836045448945472}: Death {836045448945493}]
)"
        case "0811":
            return "
(
[21:18:57.181] [@Player1#1001|(-379.25,2591.37,207.91,123.48)|(439824/441600)] [NAHUT {4122949560827904}:11204001207117|(-377.89,2589.35,207.91,-45.82)|(13025615/36514284)] [Impale {2210507998101504}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (26706 energy {836045448940874}) <26706.0>
[21:18:57.234] [Singularity Chamber {4122580193640448}:11204001207313|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player2#1002|(-382.13,2592.99,206.69,13.11)|(363072/438823)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:18:57.234] [Singularity Chamber {4122580193640448}:11204001207313|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player1#1001|(-379.23,2591.35,207.91,123.48)|(439824/441600)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:18:57.234] [Singularity Chamber {4122580193640448}:11204001207313|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player3#1003|(-375.34,2589.96,207.91,89.10)|(325993/443782)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:18:57.234] [Singularity Chamber {4122580193640448}:11204001207313|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player4#1004|(-376.14,2581.78,207.91,-172.85)|(319349/443752)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:18:57.234] [Singularity Chamber {4122580193640448}:11204001207313|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player5#1005|(-376.73,2582.93,207.91,170.75)|(423599/443634)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:18:57.234] [Singularity Chamber {4122580193640448}:11204001207313|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player6#1006|(-377.02,2579.15,207.91,142.14)|(322985/439833)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:18:57.234] [Singularity Chamber {4122580193640448}:11204001207313|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player7#1007|(-372.18,2583.84,207.91,42.38)|(405260/480157)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:18:57.726] [NAHUT {4122949560827904}:11204001207117|(-374.20,2585.87,207.91,-46.43)|(12970992/36514284)] [=] [Discharge {4133906022400000}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[21:18:59.625] [@Player4#1004|(-375.66,2580.64,207.91,-46.05)|(326072/443752)] [NAHUT {4122949560827904}:11204001207117|(-370.34,2579.53,207.91,-19.97)|(12568555/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7175* elemental {836045448940875}) <7175.0>
[21:19:01.621] [@Player4#1004|(-379.27,2577.05,207.91,-127.06)|(359946/443752)] [NAHUT {4122949560827904}:11204001207117|(-371.16,2579.83,207.91,-66.65)|(12333889/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12664* elemental {836045448940875}) <12664.0>
[21:19:03.421] [@Player3#1003|(-376.47,2581.00,207.91,23.58)|(407602/443782)] [NAHUT {4122949560827904}:11204001207117|(-371.16,2579.83,207.91,-66.65)|(12080907/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6177 internal {836045448940876}) <6177.0>
[21:19:05.222] [@Player1#1001|(-377.04,2579.45,207.91,-142.00)|(441600/441600)] [NAHUT {4122949560827904}:11204001207117|(-370.89,2579.29,207.91,-30.17)|(11853115/36514284)] [Bleeding Offense {4490487092215808}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3949* elemental {836045448940875}) <3949.0>
[21:19:07.032] [@Player6#1006|(-384.89,2570.86,207.91,-124.61)|(418053/439833)] [NAHUT {4122949560827904}:11204001207117|(-370.89,2579.29,207.91,-30.17)|(11681081/36514284)] [Electro Net {3066456325488640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6437* energy {836045448940874}) <6437.0>
[21:19:08.925] [@Player2#1002|(-377.16,2576.67,207.91,-104.86)|(304609/438823)] [NAHUT {4122949560827904}:11204001207117|(-370.89,2579.29,207.91,-30.17)|(11430644/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5122 elemental {836045448940875}) <5122.0>
[21:19:09.833] [NAHUT {4122949560827904}:11204001207117|(-370.81,2579.12,207.91,-24.38)|(11277078/36514284)] [@Player7#1007|(-368.95,2575.00,207.91,127.57)|(117097/480157)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (81708 internal {836045448940876}) <81708.0>
[21:19:11.650] [@Player4#1004|(-378.07,2576.23,207.91,-49.82)|(366278/443752)] [NAHUT {4122949560827904}:11204001207117|(-371.23,2575.58,207.91,9.29)|(11034473/36514284)] [Searing Wave {3915721683763200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31875 elemental {836045448940875}) <31875.0>
[21:19:13.524] [@Player2#1002|(-381.52,2572.89,207.91,-96.47)|(279369/438823)] [NAHUT {4122949560827904}:11204001207117|(-375.94,2568.47,207.91,21.92)|(10663190/36514284)] [Immolate {814519072849920}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (65882* elemental {836045448940875}) <65882.0>
[21:19:15.426] [@Player3#1003|(-380.73,2570.57,207.91,27.42)|(392823/443782)] [NAHUT {4122949560827904}:11204001207117|(-377.66,2566.43,207.91,-38.42)|(10221556/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11349* internal {836045448940876}) <11349.0>
[21:19:17.528] [@Player1#1001|(-382.05,2570.43,207.91,-44.22)|(572768/572768)] [NAHUT {4122949560827904}:11204001207117|(-378.22,2565.73,207.91,31.04)|(10000710/36514284)] [Bleeding (Eviscerate) {3426078232150278}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2464* internal {836045448940876}) <2464.0>
[21:19:19.352] [@Player1#1001|(-385.21,2567.48,207.91,-23.02)|(572768/572768)] [NAHUT {4122949560827904}:11204001207117|(-383.75,2560.08,207.91,43.25)|(9728288/36514284)] [Bleeding (Eviscerate) {3426078232150278}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2464* internal {836045448940876}) <2464.0>
[21:19:21.338] [@Player1#1001|(-389.13,2562.43,207.91,17.58)|(572768/572768)] [NAHUT {4122949560827904}:11204001207117|(-384.70,2559.16,207.91,46.01)|(9452316/36514284)] [Hew {3903554041413632}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (55299* energy {836045448940874}) <55299.0>
[21:19:21.751] [NAHUT {4122949560827904}:11204001207117|(-384.70,2559.16,207.91,46.01)|(9400719/36514284)] [@Player7#1007|(-387.93,2556.03,207.91,192.90)|(276349/480157)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (75606 internal {836045448940876}) <75606.0>
[21:19:23.650] [@Player6#1006|(-395.06,2562.98,207.91,-14.35)|(396617/439833)] [NAHUT {4122949560827904}:11204001207117|(-388.20,2557.12,207.91,47.50)|(9003740/36514284)] [Death from Above {814201245270016}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5856 kinetic {836045448940873}) <5856.0>
[21:19:25.689] [@Player2#1002|(-400.19,2557.90,207.91,-44.02)|(388765/438823)] [NAHUT {4122949560827904}:11204001207117|(-399.46,2552.31,207.91,61.03)|(8787880/36514284)] [Searing Wave {3915721683763200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33252 elemental {836045448940875}) <33252.0>
[21:19:27.552] [@Player2#1002|(-404.34,2558.75,207.91,-13.60)|(427736/438823)] [NAHUT {4122949560827904}:11204001207117|(-401.90,2553.11,207.91,-41.17)|(8426075/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10589* elemental {836045448940875}) <10589.0>
[21:19:29.392] [NAHUT {4122949560827904}:11204001207117|(-401.39,2553.11,207.91,43.34)|(8096633/36514284)] [@Player7#1007|(-404.07,2550.56,207.91,147.01)|(314503/480157)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7289 ~0 kinetic {836045448940873} -shield {836045448945509} (7289 absorbed {836045448945511})) <7289.0>
[21:19:31.315] [@Player8#1008|(-419.72,2556.43,207.91,-7.28)|(371797/507704)] [NAHUT {4122949560827904}:11204001207117|(-407.73,2550.55,207.91,59.72)|(7848790/36514284)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14636* energy {836045448940874}) <43907.0>
[21:19:33.151] [@Player2#1002|(-414.19,2554.40,207.91,-58.41)|(438823/438823)] [NAHUT {4122949560827904}:11204001207117|(-408.79,2550.00,207.91,66.59)|(7605128/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7751* elemental {836045448940875}) <7751.0>
[21:19:33.766] [NAHUT {4122949560827904}:11204001207117|(-408.79,2550.00,207.91,66.59)|(7508413/36514284)] [@Player7#1007|(-413.00,2548.17,207.91,246.35)|(230752/480157)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (81655 internal {836045448940876}) <81655.0>
[21:19:35.594] [NAHUT {4122949560827904}:11204001207117|(-412.83,2549.23,207.91,78.59)|(7230958/36514284)] [@Player7#1007|(-418.28,2548.13,207.91,-172.63)|(291712/480157)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>
[21:19:37.458] [@Player2#1002|(-421.77,2555.81,207.91,-29.27)|(402115/438823)] [NAHUT {4122949560827904}:11204001207117|(-421.14,2549.80,207.91,85.17)|(6957609/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7803* elemental {836045448940875}) <7803.0>
[21:19:39.258] [@Player3#1003|(-421.11,2556.33,207.91,65.80)|(388618/443782)] [NAHUT {4122949560827904}:11204001207117|(-427.52,2551.54,207.91,94.58)|(6611934/36514284)] [Force Rend {3361615068004352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12334* internal {836045448940876}) <12334.0>
[21:19:41.088] [@Player4#1004|(-427.30,2558.96,207.91,10.90)|(426518/443752)] [NAHUT {4122949560827904}:11204001207117|(-427.60,2551.67,207.91,17.26)|(6255094/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (26824* elemental {836045448940875}) <26824.0>
[21:19:44.859] [@Player3#1003|(-436.37,2564.53,207.94,127.56)|(443782/443782)] [NAHUT {4122949560827904}:11204001207117|(-427.70,2551.68,207.89,82.69)|(6006324/36514284)] [Force Rend {3361615068004352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5698 ~5699 internal {836045448940876}) <5698.0>
[21:19:45.768] [NAHUT {4122949560827904}:11204001207117|(-429.89,2552.35,207.91,89.23)|(5939569/36514284)] [@Player1#1001|(-431.28,2553.37,207.91,36.03)|(365241/441600)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (87480 internal {836045448940876}) <87480.0>
[21:19:47.678] [@Player1#1001|(-435.85,2553.85,208.17,25.23)|(365241/441600)] [NAHUT {4122949560827904}:11204001207117|(-433.11,2553.32,207.91,118.21)|(5705748/36514284)] [Shatter {1169953386397696}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13629 internal {836045448940876}) <13629.0>
[21:19:49.644] [@Player7#1007|(-446.78,2571.48,207.91,117.82)|(444831/480157)] [NAHUT {4122949560827904}:11204001207117|(-447.37,2562.76,207.91,134.32)|(5549702/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (962* energy {836045448940874}) <2645.0>
[21:19:51.456] [@Player1#1001|(-446.74,2563.48,207.91,65.34)|(432322/441600)] [NAHUT {4122949560827904}:11204001207117|(-450.61,2566.36,207.91,71.30)|(5262012/36514284)] [Bleeding (Shatter) {1169953386397954}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6340 internal {836045448940876}) <6340.0>
[21:19:53.287] [@Player8#1008|(-452.65,2564.63,207.91,-134.66)|(507704/507704)] [NAHUT {4122949560827904}:11204001207117|(-450.01,2567.25,207.91,45.25)|(5097855/36514284)] [Assassinate {2295741624090624}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14515 energy {836045448940874}) <43545.0>
[21:19:55.261] [@Player1#1001|(-446.67,2571.00,207.91,95.00)|(441600/441600)] [NAHUT {4122949560827904}:11204001207117|(-453.50,2569.20,207.91,123.88)|(4817840/36514284)] [Bleeding (Eviscerate) {3426078232150278}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2259* ~2260 internal {836045448940876}) <2259.0>
[21:19:57.068] [@Player1#1001|(-450.40,2572.53,207.91,96.20)|(441600/441600)] [NAHUT {4122949560827904}:11204001207117|(-455.39,2570.93,207.91,153.11)|(4452296/36514284)] [Bleeding (Eviscerate) {3426078232150278}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2259* ~2260 internal {836045448940876}) <2259.0>
[21:19:57.771] [NAHUT {4122949560827904}:11204001207117|(-455.39,2570.93,207.91,153.11)|(4351019/36514284)] [@Player7#1007|(-454.13,2575.25,207.91,16.50)|(233489/480157)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (81655 internal {836045448940876}) <81655.0>
[21:19:59.757] [@Player4#1004|(-454.94,2576.47,207.91,65.93)|(295664/443752)] [NAHUT {4122949560827904}:11204001207117|(-457.92,2575.54,207.91,150.57)|(4086188/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7127 elemental {836045448940875}) <7127.0>
[21:20:01.563] [@Player4#1004|(-456.78,2588.50,207.91,91.50)|(295664/443752)] [NAHUT {4122949560827904}:11204001207117|(-462.32,2590.42,207.91,180.21)|(3757264/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8248* elemental {836045448940875}) <8248.0>
[21:20:03.390] [@Player2#1002|(-457.44,2591.38,207.91,106.94)|(314346/438823)] [NAHUT {4122949560827904}:11204001207117|(-462.38,2593.11,207.91,76.97)|(3532747/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23919* ~23920 elemental {836045448940875}) <23919.0>
[21:20:05.197] [@Player7#1007|(-458.58,2595.32,207.91,61.08)|(332410/480157)] [NAHUT {4122949560827904}:11204001207117|(-462.38,2593.11,207.91,76.97)|(3174235/36514284)] [Heavy Flamethrower {4502852303060992}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8970 elemental {836045448940875}) <24667.0>
[21:20:07.029] [NAHUT {4122949560827904}:11204001207117|(-462.55,2593.37,207.91,123.29)|(2864144/36514284)] [@Player8#1008|(-466.42,2596.45,207.91,-84.98)|(380294/507704)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12638 kinetic {836045448940873}) <12638.0>
[21:20:08.872] [@Player4#1004|(-460.99,2601.76,207.91,54.07)|(397152/443752)] [NAHUT {4122949560827904}:11204001207117|(-463.76,2595.26,207.91,148.08)|(2559310/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7662 elemental {836045448940875}) <7662.0>
[21:20:09.783] [NAHUT {4122949560827904}:11204001207117|(-463.76,2595.26,207.91,148.08)|(2446889/36514284)] [@Player8#1008|(-466.18,2599.16,207.91,-32.21)|(459966/507704)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (37140 internal {836045448940876}) <37140.0>
[21:20:11.599] [@Player8#1008|(-465.42,2606.08,207.91,-84.80)|(427915/507704)] [NAHUT {4122949560827904}:11204001207117|(-464.57,2599.03,207.91,172.80)|(2172903/36514284)] [Depredating Volts {3408949902573568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15947* energy {836045448940874}) <49436.0>
[21:20:13.409] [NAHUT {4122949560827904}:11204001207117|(-463.34,2612.97,207.91,-167.16)|(1919865/36514284)] [@Player8#1008|(-462.07,2618.25,207.91,-71.78)|(415651/507704)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (17268 kinetic {836045448940873}) <17268.0>
[21:20:15.392] [@Player1#1001|(-459.59,2613.47,207.91,129.60)|(441600/441600)] [NAHUT {4122949560827904}:11204001207117|(-461.71,2618.79,207.91,-227.68)|(1589438/36514284)] [Impale {2210507998101504}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (26160 energy {836045448940874}) <26160.0>
[21:20:17.369] [@Player4#1004|(-456.49,2619.96,207.91,23.40)|(443752/443752)] [NAHUT {4122949560827904}:11204001207117|(-460.56,2617.72,207.91,114.41)|(1204638/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10158* elemental {836045448940875}) <10158.0>
[21:20:19.170] [@Player1#1001|(-456.22,2620.04,207.91,113.69)|(441600/441600)] [NAHUT {4122949560827904}:11204001207117|(-460.56,2617.72,207.91,149.91)|(825717/36514284)] [Ravage {1261367470325760}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8570* energy {836045448940874}) <8570.0>
[21:20:21.064] [@Player3#1003|(-454.84,2620.06,207.91,147.89)|(427168/443782)] [NAHUT {4122949560827904}:11204001207117|(-460.46,2620.93,207.91,197.75)|(554234/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13290* internal {836045448940876}) <13290.0>
[21:20:21.788] [NAHUT {4122949560827904}:11204001207117|(-460.46,2620.93,207.91,197.75)|(412363/36514284)] [@Player5#1005|(-456.26,2622.32,207.91,137.78)|(360702/443634)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (95503 internal {836045448940876}) <95503.0>
[21:20:23.608] [@Player1#1001|(-456.29,2623.58,207.91,117.20)|(257019/441600)] [NAHUT {4122949560827904}:11204001207117|(-458.19,2625.92,207.91,-153.97)|(129187/36514284)] [Sundering Assault {807806038966272}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13065 energy {836045448940874}) <13065.0>
[21:20:24.933] [] [@Player7#1007|(-451.34,2629.56,207.91,126.48)|(480157/480157)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:20:24.933] [] [@Player5#1005|(-455.84,2623.96,207.91,137.78)|(261231/443634)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:20:24.933] [] [@Player1#1001|(-455.91,2627.29,207.91,117.20)|(263512/441600)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:20:24.933] [] [@Player6#1006|(-448.88,2635.75,207.91,53.69)|(361580/439833)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:20:24.933] [] [@Player3#1003|(-456.46,2624.59,207.91,131.59)|(275233/443782)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:20:24.933] [] [@Player2#1002|(-451.73,2629.47,207.91,96.68)|(434008/438823)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:20:24.933] [] [@Player4#1004|(-449.66,2632.29,207.91,104.93)|(377664/443752)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:20:25.636] [@Player1#1001|(-455.35,2628.33,207.91,117.20)|(442215/572768)] [NAHUT {4122949560827904}:11204001207117|(-451.85,2633.20,207.91,-165.16)|(0/36514284)] [Impale {2210507998101504}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31550 ~17044 energy {836045448940874}) <31550.0>
[21:20:25.636] [@Player1#1001|(-455.35,2628.33,207.91,117.20)|(442215/572768)] [NAHUT {4122949560827904}:11204001207117|(-451.85,2633.20,207.91,-165.16)|(0/36514284)] [] [Event {836045448945472}: Death {836045448945493}]
)"
        case "0927":
            return "
(
[01:00:48.597] [@Player1#1001|(-418.95,2557.44,207.91,14.75)|(443752/443752)] [NAHUT {4122949560827904}:10261001171658|(-420.63,2553.14,207.91,171.02)|(13348141/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24143* elemental {836045448940875}) <24143.0>
[01:00:49.044] [Singularity Chamber {4122580193640448}:10261001171854|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player2#1002|(-421.62,2561.10,207.91,-70.26)|(334985/443634)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[01:00:49.044] [Singularity Chamber {4122580193640448}:10261001171854|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player3#1003|(-417.08,2559.00,207.91,-113.62)|(274689/435200)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[01:00:49.044] [Singularity Chamber {4122580193640448}:10261001171854|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player4#1004|(-410.97,2558.88,207.91,111.34)|(453429/453429)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[01:00:49.044] [Singularity Chamber {4122580193640448}:10261001171854|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player5#1005|(-413.12,2557.51,207.91,155.08)|(334017/443782)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[01:00:49.044] [Singularity Chamber {4122580193640448}:10261001171854|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player1#1001|(-418.86,2557.20,207.91,-19.23)|(443752/443752)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[01:00:49.044] [Singularity Chamber {4122580193640448}:10261001171854|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player6#1006|(-415.45,2556.98,207.91,-72.79)|(435260/435260)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[01:00:49.044] [Singularity Chamber {4122580193640448}:10261001171854|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player7#1007|(-412.51,2556.98,207.91,107.80)|(309558/485960)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[01:00:49.044] [Singularity Chamber {4122580193640448}:10261001171854|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player8#1008|(-420.44,2547.59,207.91,100.03)|(425552/483527)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[01:00:49.530] [NAHUT {4122949560827904}:10261001171658|(-420.48,2552.09,207.91,-1.30)|(13284582/36514284)] [=] [Discharge {4133906022400000}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[01:00:51.530] [@Player4#1004|(-416.16,2556.92,207.91,76.74)|(453429/453429)] [NAHUT {4122949560827904}:10261001171658|(-420.45,2551.83,207.91,-5.93)|(13037028/36514284)] [Force in Balance {2157001295527936}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (43375* internal {836045448940876}) <32531.0>
[01:00:53.533] [@Player4#1004|(-416.55,2556.46,207.91,128.94)|(453429/453429)] [NAHUT {4122949560827904}:10261001171658|(-420.45,2551.83,207.91,-5.93)|(12854836/36514284)] [Thrashing Terror {4278105254395904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10072* internal {836045448940876}) <7554.0>
[01:00:55.563] [@Player1#1001|(-412.50,2555.13,207.91,52.38)|(443752/443752)] [NAHUT {4122949560827904}:10261001171658|(-420.45,2551.83,207.91,-5.93)|(12689718/36514284)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5491 elemental {836045448940875}) <5491.0>
[01:00:57.425] [NAHUT {4122949560827904}:10261001171658|(-420.45,2551.83,207.91,-5.93)|(12282181/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[01:00:59.225] [@Player6#1006|(-416.73,2555.84,207.91,2.38)|(435260/435260)] [NAHUT {4122949560827904}:10261001171658|(-420.45,2551.83,207.91,-5.93)|(12012620/36514284)] [Plasmatize {3391666954174464}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6508 elemental {836045448940875}) <4881.0>
[01:01:01.028] [@Player1#1001|(-412.96,2555.27,207.91,11.73)|(443752/443752)] [NAHUT {4122949560827904}:10261001171658|(-420.45,2551.83,207.91,-5.93)|(11751163/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8347 elemental {836045448940875}) <8347.0>
[01:01:01.647] [NAHUT {4122949560827904}:10261001171658|(-420.45,2551.83,207.91,-5.93)|(11626363/36514284)] [@Player8#1008|(-419.99,2547.36,207.91,-156.72)|(575490/627149)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (77463 ~58098 internal {836045448940876} (19366 absorbed {836045448945511})) <77463.0>
[01:01:03.525] [@Player2#1002|(-414.89,2555.23,207.91,-63.43)|(285484/443634)] [NAHUT {4122949560827904}:10261001171658|(-420.25,2551.57,207.91,-44.84)|(11469906/36514284)] [Ravage {1261367470325760}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8766 energy {836045448940874}) <8766.0>
[01:01:05.356] [@Player1#1001|(-413.39,2555.51,207.91,-43.19)|(341465/443752)] [NAHUT {4122949560827904}:10261001171658|(-415.46,2549.19,207.91,-57.69)|(11212643/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15225 elemental {836045448940875}) <15225.0>
[01:01:07.346] [NAHUT {4122949560827904}:10261001171658|(-415.74,2549.23,207.91,-89.41)|(10909955/36514284)] [@Player8#1008|(-410.13,2549.41,207.91,-172.07)|(606109/627149)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -parry {836045448945503}) <1.0>
[01:01:09.322] [@Player1#1001|(-403.04,2557.57,207.91,-14.95)|(380368/443752)] [NAHUT {4122949560827904}:10261001171658|(-406.57,2550.75,207.91,-96.25)|(10672137/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8583 elemental {836045448940875}) <8583.0>
[01:01:11.126] [@Player7#1007|(-398.05,2563.50,207.91,-23.93)|(485960/485960)] [NAHUT {4122949560827904}:10261001171658|(-395.56,2553.23,207.91,-100.11)|(10357444/36514284)] [Cascading Debris {3414228417380352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7985 kinetic {836045448940873}) <24754.0>
[01:01:12.934] [@Player4#1004|(-396.06,2560.50,207.91,-32.16)|(385306/453429)] [NAHUT {4122949560827904}:10261001171658|(-394.19,2553.54,207.91,-107.26)|(10035791/36514284)] [Force in Balance {2157001295527936}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (58860* internal {836045448940876}) <44145.0>
[01:01:13.645] [NAHUT {4122949560827904}:10261001171658|(-393.76,2553.74,207.91,-107.49)|(9870711/36514284)] [@Player8#1008|(-389.40,2555.10,207.91,146.95)|(466812/627149)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (70035 internal {836045448940876}) <70035.0>
[01:01:15.473] [@Player2#1002|(-388.09,2560.10,207.91,-58.90)|(443634/443634)] [NAHUT {4122949560827904}:10261001171658|(-390.88,2555.90,207.91,-114.05)|(9675334/36514284)] [Annihilate {808123866546176}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (923 energy {836045448940874}) <923.0>
[01:01:17.339] [@Player4#1004|(-386.97,2563.52,207.91,-77.34)|(397125/453429)] [NAHUT {4122949560827904}:10261001171658|(-387.69,2558.03,207.91,-88.82)|(9502824/36514284)] [Force Breach {964675424485376}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11160* kinetic {836045448940873}) <8370.0>
[01:01:19.151] [@Player1#1001|(-389.51,2565.39,207.91,-19.89)|(344075/443752)] [NAHUT {4122949560827904}:10261001171658|(-386.85,2558.02,207.91,-65.01)|(9187789/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1028 energy {836045448940874}) <1028.0>
[01:01:21.137] [@Player8#1008|(-379.24,2563.17,207.91,144.69)|(192948/483527)] [NAHUT {4122949560827904}:10261001171658|(-383.40,2560.33,207.91,-124.45)|(8949125/36514284)] [Ravage {1261367470325760}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4269* energy {836045448940874}) <12807.0>
[01:01:23.039] [@Player8#1008|(-374.03,2568.93,207.91,135.91)|(160159/483527)] [NAHUT {4122949560827904}:10261001171658|(-377.10,2566.55,207.91,-127.02)|(8703037/36514284)] [Smash {807801743998976}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10354 kinetic {836045448940873}) <31063.0>
[01:01:24.948] [@Player4#1004|(-377.59,2572.94,207.91,-43.69)|(453429/453429)] [NAHUT {4122949560827904}:10261001171658|(-374.43,2569.25,207.91,-128.85)|(8259493/36514284)] [Crushed (Squelch) {4036075257331980}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8871* kinetic {836045448940873}) <6653.0>
[01:01:25.548] [NAHUT {4122949560827904}:10261001171658|(-374.43,2569.25,207.91,-128.85)|(8194023/36514284)] [@Player2#1002|(-377.38,2572.69,207.91,-39.91)|(404623/443634)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (51996 internal {836045448940876}) <51996.0>
[01:01:27.439] [@Player1#1001|(-376.84,2576.51,207.91,-73.33)|(401788/443752)] [NAHUT {4122949560827904}:10261001171658|(-372.28,2572.24,207.91,-150.02)|(7863955/36514284)] [Shoulder Cannon {3066494980194584}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16736* kinetic {836045448940873}) <16736.0>
[01:01:29.289] [@Player7#1007|(-374.25,2584.35,207.91,-35.16)|(456094/485960)] [NAHUT {4122949560827904}:10261001171658|(-370.15,2575.49,207.91,-134.23)|(7617711/36514284)] [Project {876461091192832}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9480 kinetic {836045448940873}) <28439.0>
[01:01:31.132] [@Player8#1008|(-367.98,2575.29,207.91,117.01)|(340036/483527)] [NAHUT {4122949560827904}:10261001171658|(-371.82,2574.45,207.91,-102.25)|(7256632/36514284)] [Saber Reflect {3126177845739520}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (116010 kinetic {836045448940873}(reflected {836045448953649}))
[01:01:33.041] [@Player3#1003|(-373.34,2592.30,207.91,-167.17)|(420335/435200)] [NAHUT {4122949560827904}:10261001171658|(-368.59,2578.36,207.91,-141.96)|(6996222/36514284)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8017* internal {836045448940876}) <8017.0>
[01:01:34.900] [@Player6#1006|(-373.70,2582.49,207.72,-53.92)|(188194/435260)] [NAHUT {4122949560827904}:10261001171658|(-368.48,2578.59,207.91,-7.72)|(6797287/36514284)] [Storm {3647535335866368}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12428* ~12429 kinetic {836045448940873}) <9321.0>
[01:01:36.723] [@Player1#1001|(-370.59,2585.82,207.91,-28.36)|(443752/443752)] [NAHUT {4122949560827904}:10261001171658|(-367.90,2579.84,207.91,-154.04)|(6490787/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (28216* elemental {836045448940875}) <28216.0>
[01:01:37.545] [NAHUT {4122949560827904}:10261001171658|(-366.84,2584.11,207.91,-160.46)|(6369873/36514284)] [@Player1#1001|(-370.16,2586.63,207.91,-150.77)|(378210/443752)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (90197 internal {836045448940876}) <90197.0>
[01:01:39.631] [@Player7#1007|(-362.88,2598.37,207.76,96.00)|(317339/485960)] [NAHUT {4122949560827904}:10261001171658|(-364.22,2594.64,208.20,-161.37)|(6229165/36514284)] [Cascading Debris {3414228417380352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9982 kinetic {836045448940873}) <30943.0>
[01:01:41.539] [@Player6#1006|(-372.70,2606.55,207.91,-175.91)|(199705/435260)] [NAHUT {4122949560827904}:10261001171658|(-368.29,2609.64,207.91,-110.21)|(5945312/36514284)] [Burning (Incendiary Round) {3391477975613734}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5038 elemental {836045448940875}) <3778.0>
[01:01:43.381] [@Player7#1007|(-363.35,2613.35,207.91,-36.08)|(246751/485960)] [NAHUT {4122949560827904}:10261001171658|(-368.17,2611.15,207.91,-118.61)|(5738374/36514284)] [Double Strike {812728071487488}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3532 energy {836045448940874}) <10596.0>
[01:01:45.209] [@Player7#1007|(-362.34,2611.22,207.91,82.38)|(264362/485960)] [NAHUT {4122949560827904}:10261001171658|(-367.04,2610.53,207.91,-97.85)|(5485151/36514284)] [Project {876461091192832}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8554 kinetic {836045448940873}) <25663.0>
[01:01:47.024] [@Player1#1001|(-374.19,2615.43,207.91,-101.95)|(270675/443752)] [NAHUT {4122949560827904}:10261001171658|(-366.38,2614.26,207.91,-165.22)|(5156005/36514284)] [Searing Wave {3915721683763200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (53372* elemental {836045448940875}) <53372.0>
[01:01:48.932] [@Player2#1002|(-374.87,2620.70,207.91,164.53)|(435053/443634)] [NAHUT {4122949560827904}:10261001171658|(-368.80,2622.90,207.91,174.97)|(4841692/36514284)] [Ravage {1261367470325760}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8749 energy {836045448940874}) <8749.0>
[01:01:49.544] [NAHUT {4122949560827904}:10261001171658|(-368.98,2623.29,207.91,172.67)|(4758877/36514284)] [@Player1#1001|(-374.25,2622.23,207.91,146.13)|(253722/443752)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (90197 internal {836045448940876}) <90197.0>
[01:01:51.552] [NAHUT {4122949560827904}:10261001171658|(-371.26,2626.74,207.91,163.34)|(4491152/36514284)] [@Player7#1007|(-372.86,2631.88,207.91,53.98)|(268926/485960)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2545 kinetic {836045448940873} -shield {836045448945509} (127015 absorbed {836045448945511})) <2545.0>
[01:01:53.360] [@Player2#1002|(-381.23,2631.50,207.91,24.89)|(379486/443634)] [NAHUT {4122949560827904}:10261001171658|(-376.53,2633.52,207.91,143.12)|(4210884/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23384* energy {836045448940874}) <23384.0>
[01:01:55.234] [@Player8#1008|(-384.05,2631.88,207.91,132.31)|(391378/483527)] [NAHUT {4122949560827904}:10261001171658|(-377.52,2633.45,207.91,-166.51)|(3977587/36514284)] [Vicious Throw {2145542322782208}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13976 energy {836045448940874}) <41927.0>
[01:01:57.136] [@Player6#1006|(-382.58,2632.49,207.91,-124.93)|(347535/435260)] [NAHUT {4122949560827904}:10261001171658|(-377.70,2632.94,207.91,-107.71)|(3706969/36514284)] [Ion Wave {4085759439011840}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33733 ~33734 elemental {836045448940875}) <25300.0>
[01:01:58.943] [NAHUT {4122949560827904}:10261001171658|(-377.97,2633.54,207.91,-182.60)|(3394074/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[01:02:00.813] [@Player1#1001|(-387.84,2637.76,207.91,-144.62)|(407321/443752)] [NAHUT {4122949560827904}:10261001171658|(-383.54,2639.81,207.91,159.07)|(3072715/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (950 energy {836045448940874}) <950.0>
[01:02:01.545] [NAHUT {4122949560827904}:10261001171658|(-385.16,2641.98,207.91,151.02)|(3017245/36514284)] [@Player7#1007|(-387.63,2646.10,207.91,37.97)|(316979/485960)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (43507 ~35096 internal {836045448940876} (8411 absorbed {836045448945511})) <43507.0>
[01:02:03.350] [@Player1#1001|(-391.93,2641.53,207.91,-132.95)|(361087/443752)] [NAHUT {4122949560827904}:10261001171658|(-389.35,2644.18,207.91,144.17)|(2647314/36514284)] [Flaming Fist {3384704812187648}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18066 kinetic {836045448940873}) <18066.0>
[01:02:05.441] [@Player2#1002|(-400.00,2645.00,207.91,110.98)|(371076/443634)] [NAHUT {4122949560827904}:10261001171658|(-397.57,2647.69,207.91,107.01)|(2391294/36514284)] [Force Rend {3361615068004352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6636 internal {836045448940876}) <6636.0>
[01:02:07.252] [@Player4#1004|(-404.89,2639.15,207.42,194.84)|(388554/453429)] [NAHUT {4122949560827904}:10261001171658|(-401.40,2648.70,207.91,131.69)|(2183978/36514284)] [Force Breach {964675424485376}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6333 kinetic {836045448940873}) <4750.0>
[01:02:09.132] [@Player6#1006|(-402.75,2643.74,207.91,-164.85)|(239513/435260)] [NAHUT {4122949560827904}:10261001171658|(-401.50,2648.63,207.91,-170.64)|(1949281/36514284)] [Incendiary Round {3391477975613440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11713* elemental {836045448940875}) <8785.0>
[01:02:10.951] [@Player2#1002|(-406.41,2646.15,207.91,165.43)|(443634/443634)] [NAHUT {4122949560827904}:10261001171658|(-402.33,2648.89,207.91,-228.95)|(1673342/36514284)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13803* internal {836045448940876}) <13803.0>
[01:02:12.852] [@Player5#1005|(-415.29,2646.07,207.91,-100.26)|(372907/443782)] [NAHUT {4122949560827904}:10261001171658|(-410.51,2651.14,207.91,102.61)|(1360542/36514284)] [Electro Net {3066456325488640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3400 energy {836045448940874}) <3400.0>
[01:02:13.561] [NAHUT {4122949560827904}:10261001171658|(-410.62,2651.13,207.91,101.04)|(1188614/36514284)] [@Player3#1003|(-410.39,2646.73,207.91,131.43)|(288080/435200)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (87480 internal {836045448940876}) <87480.0>
[01:02:15.445] [@Player1#1001|(-414.67,2646.34,207.91,-164.96)|(378348/443752)] [NAHUT {4122949560827904}:10261001171658|(-414.38,2651.41,207.91,92.68)|(866336/36514284)] [Rail Shot {814278554681344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (34388* ~34389 energy {836045448940874}) <34388.0>
[01:02:17.348] [@Player6#1006|(-419.67,2644.63,207.91,153.67)|(137608/435260)] [NAHUT {4122949560827904}:10261001171658|(-417.97,2650.22,207.91,144.08)|(650937/36514284)] [Burning {1202324554907921}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5103 elemental {836045448940875}) <3827.0>
[01:02:19.150] [NAHUT {4122949560827904}:10261001171658|(-417.93,2649.89,207.91,172.69)|(360620/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[01:02:20.954] [@Player4#1004|(-421.57,2647.17,207.91,-143.73)|(453429/453429)] [NAHUT {4122949560827904}:10261001171658|(-417.93,2649.89,207.91,172.69)|(59696/36514284)] [Crushed (Squelch) {4036075257331980}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4698 kinetic {836045448940873}) <3524.0>
[01:02:21.460] [] [@Player7#1007|(-418.50,2654.30,207.91,-7.42)|(342948/485960)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[01:02:21.460] [] [@Player3#1003|(-420.17,2645.92,207.91,-150.56)|(408681/435200)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[01:02:21.460] [] [@Player4#1004|(-421.58,2647.01,207.91,-141.58)|(453429/453429)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[01:02:21.460] [] [@Player6#1006|(-420.56,2646.54,207.91,-140.68)|(203435/435260)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[01:02:21.460] [] [@Player1#1001|(-418.53,2648.30,207.91,-145.34)|(332985/443752)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[01:02:21.460] [] [@Player5#1005|(-425.54,2648.39,207.91,-119.75)|(386760/443782)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[01:02:21.460] [] [@Player2#1002|(-425.21,2647.44,207.91,-177.81)|(423266/443634)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[01:02:21.460] [] [@Player8#1008|(-421.17,2645.78,207.91,-134.66)|(473725/483527)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[01:02:21.464] [@Player1#1001|(-418.53,2648.30,207.91,-145.34)|(332985/443752)] [NAHUT {4122949560827904}:10261001171658|(-417.93,2649.89,207.91,172.69)|(0/36514284)] [] [Event {836045448945472}: Death {836045448945493}]
)"
        case "1001":
            return "
(
[21:52:18.766] [@Player1#1001|(-399.37,2605.45,206.41,-13.70)|(0/443559)] [NAHUT {4122949560827904}:27200002204875|(-383.53,2594.79,206.41,74.91)|(15163283/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7152* elemental {836045448940875})
[21:52:27.178] [Singularity Chamber {4122580193640448}:27200002204754|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player2#1002|(-389.75,2570.92,207.91,-60.38)|(307656/491621)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:52:27.178] [Singularity Chamber {4122580193640448}:27200002204754|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player3#1003|(-381.12,2575.91,207.91,141.96)|(443634/443634)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:52:27.178] [Singularity Chamber {4122580193640448}:27200002204754|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player4#1004|(-379.52,2578.26,207.91,155.43)|(443752/443752)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:52:27.178] [Singularity Chamber {4122580193640448}:27200002204754|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player5#1005|(-375.21,2582.68,207.91,88.60)|(435022/435022)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:52:27.178] [Singularity Chamber {4122580193640448}:27200002204754|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player6#1006|(-374.46,2582.43,207.91,-1.25)|(441822/441822)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:52:27.178] [Singularity Chamber {4122580193640448}:27200002204754|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player7#1007|(-375.28,2580.60,207.91,-103.99)|(442490/442490)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:52:27.178] [Singularity Chamber {4122580193640448}:27200002204754|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player8#1008|(-367.11,2575.78,207.91,-112.06)|(232114/496956)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]
[21:52:28.769] [@Player6#1006|(-374.04,2580.89,207.91,-40.44)|(441822/441822)] [NAHUT {4122949560827904}:27200002204875|(-369.96,2579.27,207.91,-39.27)|(14899377/36514284)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4637* internal {836045448940876}) <4637.0>
[21:52:30.976] [NAHUT {4122949560827904}:27200002204875|(-369.96,2579.27,207.91,-37.02)|(14846287/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[21:52:33.035] [NAHUT {4122949560827904}:27200002204875|(-369.68,2578.48,207.91,-20.56)|(14744032/36514284)] [@Player8#1008|(-368.07,2574.22,207.91,-69.32)|(267077/496956)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (32892 ~16117 kinetic {836045448940873} (6907 absorbed {836045448945511})) <32892.0>
[21:52:35.205] [@Player5#1005|(-379.67,2576.72,207.91,-99.91)|(435022/435022)] [NAHUT {4122949560827904}:27200002204875|(-369.68,2578.48,207.91,-130.61)|(14599828/36514284)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7664* internal {836045448940876}) <7664.0>
[21:52:37.081] [@Player4#1004|(-375.33,2580.15,207.91,-74.05)|(443752/443752)] [NAHUT {4122949560827904}:27200002204875|(-369.27,2578.78,207.91,-131.08)|(14361455/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4380 elemental {836045448940875}) <4380.0>
[21:52:38.973] [@Player7#1007|(-375.63,2577.77,207.91,-99.04)|(442490/442490)] [NAHUT {4122949560827904}:27200002204875|(-369.86,2578.44,207.91,-117.44)|(14136912/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7851 elemental {836045448940875}) <7851.0>
[21:52:39.892] [NAHUT {4122949560827904}:27200002204875|(-370.22,2578.34,207.91,-107.26)|(14052468/36514284)] [@Player6#1006|(-374.51,2577.99,207.91,-25.50)|(409211/441822)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (45129 internal {836045448940876}) <45129.0>
[21:52:41.774] [@Player4#1004|(-377.39,2576.88,207.91,-101.21)|(379024/443752)] [NAHUT {4122949560827904}:27200002204875|(-370.71,2578.20,207.91,-16.99)|(13758719/36514284)] [Immolate {814519072849920}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (60518* elemental {836045448940875}) <60518.0>
[21:52:43.691] [@Player2#1002|(-373.86,2567.25,207.91,-103.59)|(278224/491621)] [NAHUT {4122949560827904}:27200002204875|(-370.76,2578.10,207.91,17.89)|(13502313/36514284)] [Sonic Rebounder {880189122806402}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (116010 kinetic {836045448940873}(reflected {836045448953649}))
[21:52:45.684] [@Player7#1007|(-379.89,2572.89,207.91,-61.99)|(118001/442490)] [NAHUT {4122949560827904}:27200002204875|(-373.40,2570.61,207.91,20.01)|(13328568/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8266* elemental {836045448940875}) <8266.0>
[21:52:47.587] [@Player7#1007|(-381.75,2570.98,207.91,-61.99)|(161293/442490)] [NAHUT {4122949560827904}:27200002204875|(-379.77,2564.31,207.91,24.14)|(13067615/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4997 elemental {836045448940875}) <4997.0>
[21:52:49.658] [@Player6#1006|(-388.15,2564.74,207.91,-28.63)|(410283/441822)] [NAHUT {4122949560827904}:27200002204875|(-383.93,2559.92,207.91,48.94)|(12907881/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22809* energy {836045448940874}) <22809.0>
[21:52:51.582] [@Player6#1006|(-390.59,2563.66,207.91,4.25)|(421795/441822)] [NAHUT {4122949560827904}:27200002204875|(-385.51,2558.66,207.91,52.37)|(12698066/36514284)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18189* internal {836045448940876}) <18189.0>
[21:52:51.796] [NAHUT {4122949560827904}:27200002204875|(-385.51,2558.66,207.91,52.37)|(12635075/36514284)] [@Player2#1002|(-389.07,2555.92,207.91,-27.61)|(201742/491621)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (71810 internal {836045448940876}) <71810.0>
[21:52:53.683] [@Player4#1004|(-393.61,2563.52,207.91,-22.67)|(328098/443752)] [NAHUT {4122949560827904}:27200002204875|(-389.72,2555.95,207.91,59.16)|(12450865/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5372 elemental {836045448940875}) <5372.0>
[21:52:55.666] [@Player2#1002|(-390.45,2552.64,207.91,173.84)|(200275/491621)] [NAHUT {4122949560827904}:27200002204875|(-392.13,2554.66,207.91,-38.94)|(12245380/36514284)] [Project {876461091192832}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14172* kinetic {836045448940873}) <42517.0>
[21:52:57.793] [@Player4#1004|(-398.87,2559.44,207.91,7.97)|(373109/443752)] [NAHUT {4122949560827904}:27200002204875|(-393.82,2554.05,207.91,57.06)|(11868994/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8155* elemental {836045448940875}) <8155.0>
[21:52:59.596] [@Player4#1004|(-406.10,2558.19,207.91,-5.60)|(417149/443752)] [NAHUT {4122949560827904}:27200002204875|(-400.16,2551.98,207.91,66.80)|(11712159/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9837 elemental {836045448940875}) <9837.0>
[21:53:01.591] [@Player6#1006|(-408.61,2556.74,207.91,-7.83)|(441822/441822)] [NAHUT {4122949560827904}:27200002204875|(-407.53,2550.35,207.91,74.43)|(11491384/36514284)] [Force Rend {3361615068004352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13193* internal {836045448940876}) <13193.0>
[21:53:03.393] [@Player4#1004|(-416.73,2557.40,207.91,20.84)|(443752/443752)] [NAHUT {4122949560827904}:27200002204875|(-408.58,2550.03,207.91,71.68)|(11374278/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7509 elemental {836045448940875}) <7509.0>
[21:53:03.802] [NAHUT {4122949560827904}:27200002204875|(-408.58,2550.03,207.91,71.68)|(11353222/36514284)] [@Player2#1002|(-412.86,2548.62,207.91,-108.22)|(347235/491621)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (70739 internal {836045448940876}) <70739.0>
[21:53:05.602] [@Player6#1006|(-416.38,2554.64,207.91,-6.07)|(360300/441822)] [NAHUT {4122949560827904}:27200002204875|(-414.13,2549.39,207.91,89.32)|(11244358/36514284)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5442* internal {836045448940876}) <5442.0>
[21:53:07.591] [@Player4#1004|(-421.44,2557.11,207.91,14.84)|(397123/443752)] [NAHUT {4122949560827904}:27200002204875|(-421.39,2550.11,207.91,-24.54)|(11017993/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4536 elemental {836045448940875}) <4536.0>
[21:53:09.393] [@Player5#1005|(-431.25,2562.65,208.05,110.11)|(367472/435022)] [NAHUT {4122949560827904}:27200002204875|(-421.38,2550.19,207.91,49.46)|(10875608/36514284)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6735* internal {836045448940876}) <6735.0>
[21:53:11.197] [@Player8#1008|(-424.48,2556.25,207.91,5.44)|(496956/496956)] [NAHUT {4122949560827904}:27200002204875|(-426.59,2551.16,207.91,93.47)|(10720199/36514284)] [Dark Charge {3421302228516864}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (579 internal {836045448940876}) <1736.0>
[21:53:13.144] [@Player5#1005|(-434.85,2563.97,207.94,-46.42)|(367472/435022)] [NAHUT {4122949560827904}:27200002204875|(-429.63,2552.03,207.91,101.64)|(10351856/36514284)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7296* internal {836045448940876}) <7296.0>
[21:53:14.999] [@Player4#1004|(-429.32,2560.85,207.91,26.84)|(443752/443752)] [NAHUT {4122949560827904}:27200002204875|(-429.98,2551.99,207.91,103.34)|(10149465/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5132 elemental {836045448940875}) <5132.0>
[21:53:15.806] [NAHUT {4122949560827904}:27200002204875|(-429.98,2551.99,207.91,103.34)|(10035831/36514284)] [@Player2#1002|(-434.35,2553.03,208.13,-155.83)|(373397/491621)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (43944 internal {836045448940876}) <43944.0>
[21:53:17.730] [@Player6#1006|(-430.73,2561.42,208.05,93.55)|(288822/441822)] [NAHUT {4122949560827904}:27200002204875|(-436.43,2554.05,207.92,122.73)|(9884118/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24249* energy {836045448940874}) <24249.0>
[21:53:19.697] [NAHUT {4122949560827904}:27200002204875|(-448.02,2563.68,207.91,92.77)|(9715021/36514284)] [=] [Energized Slice {4137075708264448}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[21:53:21.651] [@Player6#1006|(-443.69,2567.56,207.91,43.79)|(346587/441822)] [NAHUT {4122949560827904}:27200002204875|(-447.05,2564.31,207.91,80.29)|(9535925/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14504 energy {836045448940874}) <14504.0>
[21:53:23.607] [@Player5#1005|(-451.20,2579.58,207.91,128.64)|(377983/435022)] [NAHUT {4122949560827904}:27200002204875|(-453.31,2567.63,207.91,128.12)|(9301784/36514284)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7023* internal {836045448940876}) <7023.0>
[21:53:25.687] [@Player6#1006|(-450.04,2573.82,207.91,125.37)|(414395/441822)] [NAHUT {4122949560827904}:27200002204875|(-455.34,2570.47,207.91,127.00)|(9059528/36514284)] [Force Rend {3361615068004352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (45645* internal {836045448940876}) <45645.0>
[21:53:27.608] [@Player4#1004|(-453.42,2576.82,207.91,56.94)|(434261/443752)] [NAHUT {4122949560827904}:27200002204875|(-457.16,2572.87,207.91,134.18)|(8746595/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9385* elemental {836045448940875}) <9385.0>
[21:53:27.814] [NAHUT {4122949560827904}:27200002204875|(-457.16,2572.87,207.91,134.18)|(8736641/36514284)] [@Player2#1002|(-460.57,2576.17,207.91,64.49)|(255022/491621)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (70739 internal {836045448940876}) <70739.0>
[21:53:29.712] [@Player7#1007|(-455.03,2581.36,207.91,68.13)|(95765/442490)] [NAHUT {4122949560827904}:27200002204875|(-460.08,2577.12,207.91,150.57)|(8474255/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13720* elemental {836045448940875}) <13720.0>
[21:53:31.646] [@Player6#1006|(-456.59,2584.23,207.91,-12.29)|(378452/441822)] [NAHUT {4122949560827904}:27200002204875|(-458.90,2577.99,207.91,95.90)|(8257805/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13100 energy {836045448940874}) <13100.0>
[21:53:33.582] [@Player2#1002|(-462.92,2581.43,207.91,-107.98)|(233907/491621)] [NAHUT {4122949560827904}:27200002204875|(-459.26,2579.98,207.91,144.14)|(8047985/36514284)] [Project {876461091192832}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18558* kinetic {836045448940873}) <55673.0>
[21:53:35.509] [@Player7#1007|(-457.85,2590.94,207.91,78.53)|(235161/442490)] [NAHUT {4122949560827904}:27200002204875|(-464.61,2591.91,207.91,165.99)|(7784659/36514284)] [Immolate {814519072849920}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35946 ~35947 elemental {836045448940875}) <35946.0>
[21:53:37.336] [@Player8#1008|(-467.62,2600.61,207.91,80.26)|(386206/496956)] [NAHUT {4122949560827904}:27200002204875|(-465.72,2596.49,207.91,155.32)|(7619275/36514284)] [Thrash {3413184740327424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6489* energy {836045448940874}) <19467.0>
[21:53:39.280] [@Player8#1008|(-467.37,2601.50,207.91,-7.69)|(373089/496956)] [NAHUT {4122949560827904}:27200002204875|(-464.71,2597.98,207.91,143.14)|(7402981/36514284)] [Maul {808269895434240}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12820 energy {836045448940874}) <38459.0>
[21:53:39.822] [NAHUT {4122949560827904}:27200002204875|(-464.71,2597.98,207.91,143.14)|(7338229/36514284)] [@Player8#1008|(-467.37,2601.50,207.91,-37.59)|(309558/496956)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (70739 internal {836045448940876}) <70739.0>
[21:53:41.324] [Singularity Chamber {4122580193640448}:27200002204754|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player6#1006|(-457.56,2596.10,207.91,52.75)|(0/441822)] [] [Event {836045448945472}: Death {836045448945493}]
[21:53:41.705] [@Player4#1004|(-459.61,2607.40,207.91,90.17)|(332036/443752)] [NAHUT {4122949560827904}:27200002204875|(-464.99,2601.75,207.91,158.65)|(7088567/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9087* elemental {836045448940875}) <9087.0>
[21:53:43.513] [@Player6#1006|(-457.56,2596.10,207.91,52.75)|(1592/441822)] [NAHUT {4122949560827904}:27200002204875|(-464.84,2605.73,207.91,118.90)|(6940382/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5541 internal {836045448940876})
[21:53:45.590] [@Player2#1002|(-458.94,2608.65,207.91,111.37)|(325014/491621)] [NAHUT {4122949560827904}:27200002204875|(-463.23,2605.54,207.91,72.76)|(6786201/36514284)] [Project {876461091192832}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18798* kinetic {836045448940873}) <56393.0>
[21:53:47.438] [@Player7#1007|(-457.62,2609.90,207.91,106.53)|(355478/442490)] [NAHUT {4122949560827904}:27200002204875|(-463.29,2605.67,207.91,157.00)|(6617812/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15128 ~15129 elemental {836045448940875}) <15128.0>
[21:53:49.313] [NAHUT {4122949560827904}:27200002204875|(-463.58,2612.86,207.91,183.14)|(6419747/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[21:53:51.316] [@Player7#1007|(-455.50,2617.90,207.91,118.43)|(368852/442490)] [NAHUT {4122949560827904}:27200002204875|(-461.25,2621.84,207.91,-170.03)|(6183075/36514284)] [Immolate {814519072849920}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (69691* elemental {836045448940875}) <69691.0>
[21:53:51.822] [NAHUT {4122949560827904}:27200002204875|(-460.47,2623.49,207.91,-164.44)|(6137426/36514284)] [@Player4#1004|(-455.39,2622.94,207.91,123.38)|(295116/443752)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (91103 internal {836045448940876}) <91103.0>
[21:53:53.760] [@Player8#1008|(-457.49,2631.44,207.91,107.86)|(147814/496956)] [NAHUT {4122949560827904}:27200002204875|(-457.60,2626.67,207.91,-179.40)|(5946827/36514284)] [Thrash {3413184740327424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4065 energy {836045448940874}) <12195.0>
[21:53:55.592] [@Player2#1002|(-447.42,2633.31,207.91,123.23)|(333631/491621)] [NAHUT {4122949560827904}:27200002204875|(-455.14,2628.98,207.91,165.42)|(5703455/36514284)] [Project {876461091192832}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15534* ~15535 kinetic {836045448940873}) <46603.0>
[21:53:57.418] [@Player4#1004|(-446.59,2632.67,207.91,128.57)|(326647/443752)] [NAHUT {4122949560827904}:27200002204875|(-454.62,2627.80,207.91,146.74)|(5425816/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9137* ~9138 elemental {836045448940875}) <9137.0>
[21:53:59.243] [NAHUT {4122949560827904}:27200002204875|(-454.76,2628.30,207.91,175.07)|(5274636/36514284)] [@Player8#1008|(-455.05,2633.67,207.91,140.58)|(302504/496956)] [Slash {4124508633956352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -parry {836045448945503}) <1.0>
[21:54:01.126] [@Player6#1006|(-447.76,2635.35,207.91,121.95)|(231988/441822)] [NAHUT {4122949560827904}:27200002204875|(-450.00,2635.48,207.91,-164.19)|(5063971/36514284)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (632 ~633 energy {836045448940874}) <632.0>
[21:54:02.978] [@Player7#1007|(-437.63,2646.56,207.72,154.41)|(351193/442490)] [NAHUT {4122949560827904}:27200002204875|(-448.77,2636.72,207.91,-158.40)|(4938695/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1008 energy {836045448940874}) <1008.0>
[21:54:03.831] [NAHUT {4122949560827904}:27200002204875|(-448.77,2636.72,207.91,-158.40)|(4908583/36514284)] [@Player8#1008|(-447.12,2640.87,207.91,21.72)|(401273/496956)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (72788 internal {836045448940876}) <72788.0>
[21:54:05.717] [@Player5#1005|(-426.87,2648.20,207.91,-2.27)|(284234/435022)] [NAHUT {4122949560827904}:27200002204875|(-447.42,2639.54,207.91,-129.78)|(4795742/36514284)] [Toxic Haze {3991184259153920}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6979 ~6980 internal {836045448940876}) <6979.0>
[21:54:07.689] [@Player5#1005|(-423.49,2647.89,207.91,0.16)|(292718/435022)] [NAHUT {4122949560827904}:27200002204875|(-435.65,2646.46,208.11,-130.32)|(4639853/36514284)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7023* internal {836045448940876}) <7023.0>
[21:54:09.524] [@Player6#1006|(-427.40,2644.72,207.91,-162.24)|(291388/441822)] [NAHUT {4122949560827904}:27200002204875|(-429.72,2648.00,207.91,-260.51)|(4472961/36514284)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13939* internal {836045448940876}) <13939.0>
[21:54:11.324] [@Player2#1002|(-423.04,2648.08,207.91,156.39)|(389699/491621)] [NAHUT {4122949560827904}:27200002204875|(-429.72,2648.00,207.91,104.21)|(4179671/36514284)] [Cascading Debris {3414228417380352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8387 kinetic {836045448940873}) <26000.0>
[21:54:13.127] [@Player4#1004|(-415.71,2646.80,207.91,-18.18)|(341143/443752)] [NAHUT {4122949560827904}:27200002204875|(-427.70,2647.21,207.91,212.27)|(3978676/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (998 energy {836045448940874}) <998.0>
[21:54:15.018] [@Player7#1007|(-412.37,2648.33,207.91,172.76)|(375803/442490)] [NAHUT {4122949560827904}:27200002204875|(-420.24,2650.34,207.91,-120.90)|(3798482/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8023* ~8024 elemental {836045448940875}) <8023.0>
[21:54:15.827] [] [@Player6#1006|(-415.34,2648.08,207.91,-178.04)|(301646/441822)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (87887 internal {836045448940876}) <87887.0>
[21:54:18.065] [@Player5#1005|(-402.46,2647.57,207.91,104.06)|(346035/435022)] [NAHUT {4122949560827904}:27200002204875|(-417.43,2651.53,207.89,-105.89)|(3633644/36514284)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8248* ~8249 internal {836045448940876}) <8248.0>
[21:54:19.998] [@Player2#1002|(-404.72,2647.39,207.91,-174.39)|(403741/491621)] [NAHUT {4122949560827904}:27200002204875|(-411.47,2650.71,207.91,-106.85)|(3426459/36514284)] [Project {876461091192832}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14105* kinetic {836045448940873}) <42315.0>
[21:54:21.884] [@Player6#1006|(-404.83,2646.96,207.91,-166.63)|(381746/441822)] [NAHUT {4122949560827904}:27200002204875|(-410.04,2649.68,207.91,-150.00)|(3201011/36514284)] [Annihilate {808123866546176}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (44362* energy {836045448940874}) <44362.0>
[21:54:23.720] [@Player7#1007|(-401.44,2647.03,207.91,146.86)|(412145/442490)] [NAHUT {4122949560827904}:27200002204875|(-409.81,2649.59,207.91,180.88)|(3039832/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (25812* elemental {836045448940875}) <25812.0>
[21:54:25.822] [@Player7#1007|(-398.92,2646.26,207.91,146.86)|(427472/442490)] [NAHUT {4122949560827904}:27200002204875|(-403.86,2649.66,207.91,-110.23)|(2806164/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5259 elemental {836045448940875}) <5259.0>
[21:54:27.624] [@Player2#1002|(-395.89,2645.34,207.91,-149.64)|(450018/491621)] [NAHUT {4122949560827904}:27200002204875|(-395.47,2647.21,207.91,-99.88)|(2666671/36514284)] [Combat Technique {979806594269184}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (632 internal {836045448940876}) <1897.0>
[21:54:27.832] [NAHUT {4122949560827904}:27200002204875|(-394.44,2647.19,207.91,-94.94)|(2611786/36514284)] [@Player3#1003|(-394.04,2645.56,207.91,-170.04)|(360744/443634)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (88959 internal {836045448940876}) <88959.0>
[21:54:29.653] [@Player3#1003|(-386.40,2643.26,207.91,-137.70)|(371156/443634)] [NAHUT {4122949560827904}:27200002204875|(-388.79,2643.85,207.91,-83.57)|(2431921/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1335 energy {836045448940874}) <1335.0>
[21:54:31.857] [@Player6#1006|(-384.15,2638.63,207.91,-147.08)|(271917/441822)] [NAHUT {4122949560827904}:27200002204875|(-387.60,2643.58,207.91,-75.77)|(2220491/36514284)] [Rupture {3455541707800576}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7553 ~7554 energy {836045448940874}) <7553.0>
[21:54:33.447] [NAHUT {4122949560827904}:27200002204875|(-385.58,2642.44,207.91,-40.88)|(2073156/36514284)] [@Player8#1008|(-379.60,2641.23,207.91,-161.34)|(0/496956)] [] [Event {836045448945472}: Death {836045448945493}]
[21:54:33.825] [@Player4#1004|(-379.77,2637.40,207.91,138.41)|(335714/443752)] [NAHUT {4122949560827904}:27200002204875|(-384.57,2641.40,207.91,-42.80)|(2021942/36514284)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15048* elemental {836045448940875}) <15048.0>
[21:54:36.047] [NAHUT {4122949560827904}:27200002204875|(-384.98,2641.83,207.91,-44.79)|(1911732/36514284)] [@Player4#1004|(-381.19,2638.70,207.91,147.01)|(46328/443752)] [Energized Slice {4137075708264448}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (326433 energy {836045448940874}) <326433.0>
[21:54:36.051] [NAHUT {4122949560827904}:27200002204875|(-384.98,2641.83,207.91,-44.79)|(1911732/36514284)] [@Player7#1007|(-381.02,2637.72,207.91,-123.30)|(11173/442490)] [] [Event {836045448945472}: Death {836045448945493}]
[21:54:36.051] [NAHUT {4122949560827904}:27200002204875|(-384.98,2641.83,207.91,-44.79)|(1911732/36514284)] [@Player6#1006|(-380.75,2635.97,207.91,-162.43)|(0/441822)] [] [Event {836045448945472}: Death {836045448945493}]
[21:54:37.926] [@Player5#1005|(-372.23,2627.54,207.91,142.08)|(151847/435022)] [NAHUT {4122949560827904}:27200002204875|(-384.43,2641.49,207.91,303.40)|(1852949/36514284)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7608* internal {836045448940876}) <7608.0>
[21:54:39.827] [NAHUT {4122949560827904}:27200002204875|(-383.94,2640.90,207.91,-55.57)|(1758607/36514284)] [@Player2#1002|(-386.59,2643.82,207.91,-56.67)|(420595/491621)] [Discharge {4133906022400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (70739 internal {836045448940876}) <70739.0>
[21:54:41.337] [Singularity Chamber {4122580193640448}:27200002204754|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Player5#1005|(-372.08,2627.36,207.91,142.08)|(0/435022)] [] [Event {836045448945472}: Death {836045448945493}]
[21:54:42.123] [@Player4#1004|(-368.25,2627.32,207.91,102.61)|(147298/443752)] [NAHUT {4122949560827904}:27200002204875|(-378.73,2635.59,207.91,-122.71)|(1713673/36514284)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8259* elemental {836045448940875}) <8259.0>
[21:54:42.443] [NAHUT {4122949560827904}:27200002204875|(-378.75,2635.64,207.91,-86.65)|(1694664/36514284)] [@Player3#1003|(-367.82,2626.16,207.91,-142.35)|(0/443634)] [] [Event {836045448945472}: Death {836045448945493}]
[21:54:43.924] [@Player5#1005|(-372.08,2627.36,207.91,142.08)|(0/435022)] [NAHUT {4122949560827904}:27200002204875|(-375.84,2633.10,207.91,-46.60)|(1661354/36514284)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6735* internal {836045448940876})
[21:54:46.023] [NAHUT {4122949560827904}:27200002204875|(-369.26,2623.89,207.91,-47.23)|(1598058/36514284)] [=] [Slash {4124508633956352}] [Event {836045448945472}: AbilityActivate {836045448945479}]
[21:54:47.231] [] [@Player2#1002|(-365.95,2620.84,207.91,-33.56)|(0/491621)] [] [Event {836045448945472}: Death {836045448945493}]
[21:54:47.826] [@Player4#1004|(-366.45,2620.66,207.91,145.17)|(108136/443752)] [NAHUT {4122949560827904}:27200002204875|(-369.26,2623.89,207.91,-41.02)|(1527032/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9468* elemental {836045448940875}) <9468.0>
[21:54:49.189] [] [@Player6#1006|(-380.81,2635.99,207.91,-162.43)|(4772/441822)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.189] [] [@Player5#1005|(-372.08,2627.36,207.91,142.08)|(0/435022)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.189] [] [@Player3#1003|(-367.82,2626.16,207.91,-142.35)|(0/443634)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.190] [] [@Player8#1008|(-379.60,2641.23,207.91,-161.34)|(0/496956)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.190] [] [@Player2#1002|(-365.95,2620.84,207.91,-33.56)|(0/491621)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.190] [] [@Player4#1004|(-367.01,2620.26,207.91,158.39)|(0/443752)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.190] [] [@Player7#1007|(-381.02,2637.72,207.91,-123.30)|(11173/442490)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
)"
    }
    throw Error("Unknown recorded floor fixture: " which)
}

; v67.2 callout library model checks. Hidden controls, private INI, no playback.
V672LibraryCopy(value)
{
    if !IsObject(value)
        return value
    if value is Map {
        result := Map()
        for key,item in value
            result[key] := V672LibraryCopy(item)
        return result
    }
    if value is Array {
        result := []
        for item in value
            result.Push(V672LibraryCopy(item))
        return result
    }
    result := {}
    for key,item in value.OwnProps()
        result.%key% := V672LibraryCopy(item)
    return result
}

V672LibraryFixture(fn) => V671FloorFixture(V672LibraryInner.Bind(fn))
V672LibraryInner(fn)
{
    global
    local names := ["SETTINGS_FILE","persistenceTestMode","Persist","universalCalloutsEnabled","bossNumpadCalloutsEnabled",
        "tauntCalloutEnabled","coTankTauntCalloutEnabled","aoeTauntCalloutEnabled","explosiveFuelCalloutEnabled",
        "energyYieldCalloutEnabled","oilSlickCalloutEnabled","energyShieldCalloutEnabled","koltoOverloadCalloutEnabled",
        "shieldAdrenalCalloutEnabled","carbonizeCalloutEnabled","DarknessAbilityEnabled","CoTankAbilityEnabled","recklessnessTankOnly",
        "tythCalloutsEnabled","tythRageReportsEnabled","tyth8CalloutEnabled","tyth65CalloutEnabled","TythManualEnabled",
        "TythExtraAlerts","TythGraceAlertDefinitions","AE_MASTER_ENABLED","AE_NOTICE_ENABLED","AE_SWAP_ENABLED",
        "AE_MANUAL_ENABLED","AEStackDefinitions","NBCandle","NBOrder","NBRebounder","NBTurrets","NBRepair",
        "NBCandleOptions","NBOrderOptions","NBRebounderOptions","NBTurretOptions","NBFifthOptions","NBRepairOptions",
        "NBCandleUI","NBOrderUI","NBRebounderUI","NBTurretUI","NBFifthUI","NBRepairUI","AEStackUI",
        "NahutProfiles","NahutAssignments","NBToonBindings","SOP","SOPOptions","SOPUI","SCAT","SCATOptions","SCATUI","SCY","SCYOptions","SCYUI","IZT","IZI","IZTOptions","IZTUI","IZP","IZPOptions","IZPUI"]
    local old := Map(),name,value,path
    V48Assert(SELF_TEST && A_IsSuspended,"callout model fixture requires suspended native test mode")
    for name in names
        old[name] := %name%
    path := A_Temp "\IrisV672Library_" DllCall("GetCurrentProcessId") "_" A_TickCount ".ini"
    try {
        SETTINGS_FILE := path,persistenceTestMode := false
        IZT := IZTNew(),IZI := IZINew(),IZTOptions := V672LibraryCopy(old["IZTOptions"]),IZTUI := {Gui:""}
        IZP := IZPNew(),IZPOptions := V672LibraryCopy(old["IZPOptions"]),IZPUI := {Gui:""}
        SCY := SCYNew(),SCYOptions := V672LibraryCopy(old["SCYOptions"]),SCYUI := {Gui:""}
        SCAT := SCATNew(),SCATOptions := V672LibraryCopy(old["SCATOptions"]),SCATUI := {Gui:""}
        SOP := SOPNew(),SOPOptions := V672LibraryCopy(old["SOPOptions"]),SOPUI := {Gui:""}
        Persist := {Pending:Map(),Last:Map(),Busy:false,Serial:0,Error:"",Status:"test"}
        for name in ["DarknessAbilityEnabled","CoTankAbilityEnabled","TythManualEnabled","TythExtraAlerts",
            "TythGraceAlertDefinitions","AEStackDefinitions","NBCandleOptions","NBOrderOptions","NBRebounderOptions",
            "NBTurretOptions","NBFifthOptions","NBRepairOptions"]
            %name% := V672LibraryCopy(old[name])
        for name in ["NBCandleUI","NBOrderUI","NBRebounderUI","NBTurretUI","NBFifthUI","NBRepairUI","AEStackUI"]
            %name% := {Gui:"",Visible:false}
        NBCandle := NewNBCandleState(),NBOrder := NewNBOrderState(),NBRebounder := NewNBRebounderState()
        NBTurrets := NewNBTurretState(),NBRepair := NewNBRepairState()
        NahutProfiles := NewNahutProfileState(),NahutProfiles.Active := "p1"
        NahutProfiles.Order := ["p1"],NahutAssignments := NewNahutAssignments()
        NahutProfiles.Items["p1"] := {Name:"Library test",Assignments:NahutAssignments.Clone()}
        NBToonBindings := Map("p1",NewNahutAssignments())
        universalCalloutsEnabled := true,bossNumpadCalloutsEnabled := true,tythCalloutsEnabled := true
        AE_MASTER_ENABLED := true,AE_NOTICE_ENABLED := true,AE_SWAP_ENABLED := true,AE_MANUAL_ENABLED := true
        V60WithSettings(fn)
    }
    finally {
        SetTimer(FlushSettings,0)
        for name,value in old
            %name% := value
        try FileDelete(path)
    }
}

V672LibraryCatalogue() => V672LibraryFixture(V672LibraryCatalogueCase)
V672LibraryCatalogueCase()
{
    global Audio,IP,NBCandle
    ids := Map(),groups := Map(),before := ObjPtr(NBCandle)
    for d in ICLDefinitions() {
        V48Assert(d.Id!="" && !ids.Has(d.Id),"each stored switch appears under one stable ID")
        V48Assert(d.Label!="" && d.Group!="" && d.HasOwnProp("Description"),"switch has an understandable label, category and detail field")
        ids[d.Id] := true,groups[d.Group] := true
    }
    for id in ["your.EnergyShield","cotank.EnergyShield","tyth.TythRage","ae.AERemoteSwap",
        "nahut.order.Corrections","nahut.rebounder.DoubleCloseDPS","nahut.floor","nahut.opening",
        "nahut.fifth","nahut.repair","manual.TythSlot1"]
        V48Assert(ids.Has(id),"existing independent switch is accessible: " id)
    V48Assert(!ids.Has("voice") && !ids.Has("automatic"),"top-level switches are not duplicated as individual rows")
    V48Assert(Audio.Queue.Length=0 && !IP.Active && ObjPtr(NBCandle)=before,"enumerating library does not play, parse or replace encounter state")
}

V672LibraryTargetedSwitch() => V672LibraryFixture(V672LibraryTargetedSwitchCase)
V672LibraryTargetedSwitchCase()
{
    global energyShieldCalloutEnabled,explosiveFuelCalloutEnabled,CoTankAbilityEnabled,NBCandle,NBOrder,Audio
    energyShieldCalloutEnabled := true,explosiveFuelCalloutEnabled := false,CoTankAbilityEnabled["EnergyShield"] := true
    candle := ObjPtr(NBCandle),order := ObjPtr(NBOrder)
    V48Assert(ICLSet("your.EnergyShield",false),"personal switch accepts explicit change")
    V48Assert(!energyShieldCalloutEnabled && CoTankAbilityEnabled["EnergyShield"] && !explosiveFuelCalloutEnabled,"changing personal shield preserves co-tank shield and another ability")
    V48Assert(ICLSet("cotank.EnergyShield",false) && !CoTankAbilityEnabled["EnergyShield"],"co-tank switch is independently writable")
    ICLSet("your.EnergyShield",true)
    V48Assert(energyShieldCalloutEnabled && !CoTankAbilityEnabled["EnergyShield"],"personal re-enable does not enable co-tank")
    V48Assert(ObjPtr(NBCandle)=candle && ObjPtr(NBOrder)=order && Audio.Queue.Length=0,"switches retain encounter identity and never queue a catch-up call")
}

V672LibraryParentRetention() => V672LibraryFixture(V672LibraryParentRetentionCase)
V672LibraryParentRetentionCase()
{
    global energyShieldCalloutEnabled,CoTankAbilityEnabled,NBOrderOptions,tythRageReportsEnabled
    energyShieldCalloutEnabled := true,CoTankAbilityEnabled["EnergyShield"] := false
    NBOrderOptions.Enabled := true,NBOrderOptions.NextEnabled := false,NBOrderOptions.Corrections := true
    tythRageReportsEnabled := true
    for parent in ["abilities","automatic","manual","voice"] {
        V48Assert(ICLSet(parent,false) && !ICLGet(parent),"master can mute without clearing choices: " parent)
        V48Assert(ICLGet("your.EnergyShield") && !ICLGet("cotank.EnergyShield") && ICLGet("nahut.order.Corrections")
            && !ICLGet("nahut.order.NextEnabled") && ICLGet("tyth.TythRageReport"),"individual choices survive parent mute")
        V48Assert(ICLSet(parent,true) && ICLGet(parent),"master can restore existing selections: " parent)
    }
}

V672LibraryLegacySync() => V672LibraryFixture(V672LibraryLegacySyncCase)
V672LibraryLegacySyncCase()
{
    global EnergyShieldCheckbox,AOETauntCheckbox,energyShieldCalloutEnabled,aoeTauntCalloutEnabled,IC
    energyShieldCalloutEnabled := true,aoeTauntCalloutEnabled := true
    EnergyShieldCheckbox.Value := 1,AOETauntCheckbox.Value := 0 ; deliberately stale old control
    ICLSet("your.EnergyShield",false)
    V48Assert(!energyShieldCalloutEnabled && aoeTauntCalloutEnabled,"targeted change cannot import an unrelated stale legacy checkbox")
    V48Assert(EnergyShieldCheckbox.Value=0 && AOETauntCheckbox.Value=1,"old checkbox view refreshes from authoritative model")
    for key,page in IC.Pages
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",page.Gui.Hwnd),"synchronizing settings does not open a dialog")
}

V672LibraryFloorStop() => V672LibraryFixture(V672LibraryFloorStopCase)
V672LibraryFloorStopCase()
{
    global NBFloor,NBFloorOptions,Audio,testClock
    V671FloorArm(),anchor := NBFloor.Anchor
    V48Assert(NBFloor.Running,"floor fixture has a real observer-created repeating reminder")
    Audio.Queue.Push({Kind:"Boss",Key:"NahutFloor"})
    ICLSet("nahut.floor",false)
    V48Assert(!NBFloorOptions.Enabled && !NBFloor.Running && NBFloor.Blocked && Audio.Queue.Length=0,"disable uses floor stop latch and cancels queued reminder")
    generation := NBFloor.Generation
    ICLSet("nahut.floor",true),testClock += 1000
    TrackNBFloor(V671FloorPulse(101000))
    V48Assert(NBFloorOptions.Enabled && !NBFloor.Running && NBFloor.Blocked,"same-pull off/on cannot rearm the floor reminder")
    V48Assert(NBFloor.Generation=generation && NBFloor.Anchor=anchor,"library toggle does not reset encounter or create a new floor anchor")
}

V672LibraryStatus() => V672LibraryFixture(V672LibraryStatusCase)
V672LibraryStatusCase()
{
    global soundboardsEnabled,universalCalloutsEnabled,autoBossCalloutsEnabled,inputMode,audioOutputMode
    global AUDIO_MODE_KENKU_BRIDGE_TTS,NBOrderOptions,energyShieldCalloutEnabled,DarknessAbilityEnabled
    soundboardsEnabled := true,universalCalloutsEnabled := true,autoBossCalloutsEnabled := true
    inputMode := "CombatLog",audioOutputMode := AUDIO_MODE_KENKU_BRIDGE_TTS
    DarknessAbilityEnabled["ForceShroud"] := true,inputMode := "Hotkey"
    V48Assert(ICLGet("your.ForceShroud") && InStr(ICLStatus("your.ForceShroud"),"Combat Log"),"enabled Darkness ability explains Combat Log requirement instead of implying an available hotkey")
    inputMode := "CombatLog"
    NBOrderOptions.Enabled := true
    V48Assert(InStr(ICLStatus("nahut.order.Enabled"),"binding"),"unbound named advice explains setup needed instead of promising speech")
    energyShieldCalloutEnabled := true,universalCalloutsEnabled := false
    V48Assert(ICLGet("your.EnergyShield") && InStr(ICLStatus("your.EnergyShield"),"off"),"individual choice remains on while effective parent status explains silence")
    soundboardsEnabled := false
    V48Assert(InStr(ICLStatus("your.EnergyShield"),"voice") || InStr(ICLStatus("your.EnergyShield"),"mut"),"voice mute has a plain visible status")
}

V672LibraryPersistence() => V672LibraryFixture(V672LibraryPersistenceCase)
V672LibraryPersistenceCase()
{
    global SETTINGS_FILE,energyShieldCalloutEnabled,CoTankAbilityEnabled,NBFloorOptions,NBRebounderOptions,Audio
    IniWrite("keep",SETTINGS_FILE,"UnrelatedPlugin","Value")
    IniWrite("retained-uuid",SETTINGS_FILE,"NahutRebounderSounds","Next|DoubleCloseDPS")
    IniWrite(0,SETTINGS_FILE,"CoTankAbilities","EnergyShield")
    IniWrite(1,SETTINGS_FILE,"NahutFloorTimer","CtrlNumpad0Stop")
    energyShieldCalloutEnabled := false,CoTankAbilityEnabled["EnergyShield"] := true
    ICLSet("your.EnergyShield",true)
    V48Assert(IniRead(SETTINGS_FILE,"Universal","EnergyShield")="1","selected value persists under its existing rollback-compatible key")
    V48Assert(IniRead(SETTINGS_FILE,"CoTankAbilities","EnergyShield")="0","targeted write does not save unrelated differing in-memory choices")
    V48Assert(IniRead(SETTINGS_FILE,"UnrelatedPlugin","Value")="keep" && IniRead(SETTINGS_FILE,"NahutRebounderSounds","Next|DoubleCloseDPS")="retained-uuid","unrelated sections and recordings survive a switch change")
    before := FileRead(SETTINGS_FILE),queue := Audio.Queue.Length
    V48Assert(!ICLSet("unknown.callout",true) && FileRead(SETTINGS_FILE)=before && Audio.Queue.Length=queue,"unknown stable ID fails closed without persistence or playback")
    V48Assert(IniRead(SETTINGS_FILE,"NahutFloorTimer","CtrlNumpad0Stop")="1","unrelated stop shortcut setting survives")
}

; Hidden native library checks: private settings and controllers supplied by model fixture.
; Never open the normal app, preview dialog, audio transport or gameplay hotkeys.
V672LibraryUIFixture(fn) => V672LibraryFixture(V672LibraryUIInner.Bind(fn))
V672LibraryUIInner(fn)
{
    s := ICLUState(),old := s.Clone()
    try {
        s.Gui := "",s.List := "",s.Group := "",s.Search := "",s.Filter := "",s.Detail := ""
        s.Ids := [],s.Updating := false,s.Masters := Map(),s.Controls := Map()
        s.Signature := "",s.Visible := false,s.Rows := Map()
        fn.Call()
    }
    finally {
        ICLUClose()
        if IPMGuiAlive(s.Gui)
            s.Gui.Destroy()
        for key,value in old.OwnProps()
            s.%key% := value
    }
}

V672LibraryUIRow(id)
{
    for index,key in ICLUState().Ids
        if key=id
            return index
    return 0
}

V672LibraryUIIni()
{
    global SETTINGS_FILE
    return FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "<absent>"
}

V672LibraryUIHidden() => V672LibraryUIFixture(V672LibraryUIHiddenCase)
V672LibraryUIHiddenCase()
{
    global Audio,Persist,IP,Preview,soundboardsEnabled
    before := V672LibraryUIIni(),serial := Persist.Serial,queue := Audio.Queue.Length
    soundboardsEnabled := false
    g := ICLUOpen(),s := ICLUState(),signature := ICLUSignature()
    V48Assert(s.Ids.Length=ICLDefinitions().Length && s.Ids.Length>60,"hidden library exposes the full catalogue")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd) && !s.Visible,"test-mode construction never displays library")
    V48Assert(!IsObject(Preview.Gui),"browsing does not open the audio preview dialog")
    Loop 3 {
        ICLURefresh()
        Sleep(1) ; let queued native checkbox notifications dispatch
    }
    V48Assert(Persist.Serial=serial && V672LibraryUIIni()=before,"refresh and native checkbox notifications never save settings")
    V48Assert(ICLUSignature()=signature && !soundboardsEnabled,"refresh retains muted preferences")
    V48Assert(Audio.Queue.Length=queue && !IP.Active,"browsing never queues audio or starts log parsing")
    V48Assert(!s.Controls["Enable"].Enabled && !s.Controls["Preview"].Enabled,"actions stay disabled without selection")
}

V672LibraryUIPausedChecks() => V672LibraryUIFixture(V672LibraryUIPausedChecksCase)
V672LibraryUIPausedChecksCase()
{
    global energyShieldCalloutEnabled,universalCalloutsEnabled,soundboardsEnabled
    energyShieldCalloutEnabled := true,universalCalloutsEnabled := false,soundboardsEnabled := true
    ICLUOpen(),s := ICLUState(),index := V672LibraryUIRow("your.EnergyShield")
    V48Assert(index && s.List.GetNext(index-1,"Checked")=index,"paused parent does not uncheck an enabled individual choice")
    V48Assert(s.List.GetText(index,3)="Ability calls are off","status explains the paused ability parent")
    V48Assert(s.Masters["abilities"].Value=0 && s.Masters["voice"].Value=1,"master checkboxes reflect authoritative values")
    soundboardsEnabled := false,ICLURefresh()
    V48Assert(s.List.GetNext(index-1,"Checked")=index && s.List.GetText(index,3)="Voice is muted","voice mute preserves choice and gives mute status")
}

V672LibraryUIFilterSelection() => V672LibraryUIFixture(V672LibraryUIFilterSelectionCase)
V672LibraryUIFilterSelectionCase()
{
    ICLUOpen(),s := ICLUState(),index := V672LibraryUIRow("your.EnergyShield")
    s.List.Modify(index,"Select"),ICLUSelection()
    V48Assert(ICLUSelectedIds().Length=1 && ICLUFirstSelected().Id="your.EnergyShield","selection maps to stable catalogue ID")
    s.Search.Value := "  ENERGY SHIELD  ",ICLURefresh()
    V48Assert(s.Ids.Length=2 && ICLUFirstSelected().Id="your.EnergyShield","case-insensitive trimmed search preserves selected identity after row move")
    s.Group.Choose("Co-tank abilities"),ICLURefresh()
    V48Assert(s.Ids.Length=1 && s.Ids[1]="cotank.EnergyShield","category and search compose correctly")
    V48Assert(ICLUSelectedIds().Length=0 && !s.Controls["Disable"].Enabled,"hidden selection cannot silently transfer to the remaining row")
    s.Search.Value := "no such callout 672",ICLURefresh()
    V48Assert(!s.Ids.Length && InStr(s.Detail.Value,"No callouts match"),"empty filter offers a clear recovery message")
}

V672LibraryUIBulkFilter() => V672LibraryUIFixture(V672LibraryUIBulkFilterCase)
V672LibraryUIBulkFilterCase()
{
    global energyShieldCalloutEnabled,explosiveFuelCalloutEnabled,aoeTauntCalloutEnabled,CoTankAbilityEnabled,Audio
    energyShieldCalloutEnabled := true,explosiveFuelCalloutEnabled := true,aoeTauntCalloutEnabled := true
    CoTankAbilityEnabled["EnergyShield"] := true
    ICLUOpen(),s := ICLUState(),s.Group.Choose("Your abilities"),s.Filter.Choose("On"),ICLURefresh()
    s.List.Modify(V672LibraryUIRow("your.EnergyShield"),"Select")
    s.List.Modify(V672LibraryUIRow("your.ExplosiveFuel"),"Select")
    V48Assert(ICLUSelectedIds().Length=2,"two filtered rows can be selected together")
    V48Assert(ICLUToggleSelected(false),"bulk disable completes while selected rows leave the On filter")
    V48Assert(!energyShieldCalloutEnabled && !explosiveFuelCalloutEnabled,"both original IDs change despite moving row indices")
    V48Assert(aoeTauntCalloutEnabled && CoTankAbilityEnabled["EnergyShield"],"bulk operation leaves unselected and hidden categories unchanged")
    V48Assert(!V672LibraryUIRow("your.EnergyShield") && !V672LibraryUIRow("your.ExplosiveFuel"),"newly disabled rows leave the On filter")
    V48Assert(ICLUSelectedIds().Length=0 && Audio.Queue.Length=0,"removed selections clear and changes never play audio")
}

V672LibraryUICheckIdentity() => V672LibraryUIFixture(V672LibraryUICheckIdentityCase)
V672LibraryUICheckIdentityCase()
{
    global energyShieldCalloutEnabled,CoTankAbilityEnabled,Persist
    energyShieldCalloutEnabled := true,CoTankAbilityEnabled["EnergyShield"] := true
    ICLUOpen(),s := ICLUState(),s.Search.Value := "Energy Shield",s.Filter.Choose("On"),ICLURefresh()
    index := V672LibraryUIRow("your.EnergyShield")
    V48Assert(ICLUCheck(s.List,index,false),"checking a filtered row routes through its stable ID")
    V48Assert(!energyShieldCalloutEnabled && CoTankAbilityEnabled["EnergyShield"] && s.Ids.Length=1,"single check changes only the chosen player side")
    serial := Persist.Serial,s.Updating := true
    V48Assert(!ICLUCheck(s.List,1,false),"refresh-originated native check notification is ignored")
    s.Updating := false
    V48Assert(CoTankAbilityEnabled["EnergyShield"] && Persist.Serial=serial,"ignored notification cannot flip a newly shifted row or save")
    V48Assert(!ICLUCheck(s.List,0,false) && !ICLUCheck(s.List,99,false),"invalid native row indices fail closed")
}

V672LibraryUILegacyPoll() => V672LibraryUIFixture(V672LibraryUILegacyPollCase)
V672LibraryUILegacyPollCase()
{
    global energyShieldCalloutEnabled,Persist,soundboardsEnabled
    energyShieldCalloutEnabled := true
    ICLUOpen(),s := ICLUState(),s.Visible := true,serial := Persist.Serial
    energyShieldCalloutEnabled := false,soundboardsEnabled := false,ICLUPoll()
    index := V672LibraryUIRow("your.EnergyShield")
    V48Assert(s.List.GetNext(index-1,"Checked")!=index && s.List.GetText(index,3)="Off","legacy setting edit updates displayed checkbox and status")
    V48Assert(!s.Masters["voice"].Value && Persist.Serial=serial,"poll synchronizes F11-style mute without saving other fields")
    Persist.Error := "Synthetic save failure",Persist.Status := "error",ICLUPoll()
    V48Assert(InStr(s.Controls["Intro"].Text,"could not be saved"),"save failure becomes visible without another user edit")
    V48Assert(DllCall("User32\GetWindowLongW","Ptr",s.Controls["Retry"].Hwnd,"Int",-16,"UInt") & 0x10000000,"failed save exposes retry control within hidden test window")
    Persist.Error := "",Persist.Status := "saved",ICLUPoll()
    V48Assert(!(DllCall("User32\GetWindowLongW","Ptr",s.Controls["Retry"].Hwnd,"Int",-16,"UInt") & 0x10000000),"successful persistence clears retry control")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",s.Gui.Hwnd),"poll never shows the hidden library")
}

V672LibraryUIPreviewLinks() => V672LibraryUIFixture(V672LibraryUIPreviewLinksCase)
V672LibraryUIPreviewLinksCase()
{
    global Audio,Preview
    count := 0
    for row in ICLDefinitions() {
        if row.PreviewKey=""
            continue
        entry := ICLUPreviewEntry(row),count += 1
        V48Assert(IsObject(entry) && entry.Key=row.PreviewKey && entry.Group=row.PreviewGroup,"preview resolves to exact existing sample: " row.Id)
    }
    V48Assert(count>50,"catalogue resolves samples for individual calls")
    V48Assert(Audio.Queue.Length=0 && !IsObject(Preview.Gui),"resolving preview links never opens or plays a preview")
}

V672LibraryUILayout() => V672LibraryUIFixture(V672LibraryUILayoutCase)
V672LibraryUILayoutCase()
{
    g := ICLUOpen(),s := ICLUState()
    for size in [[800,600],[900,650],[1100,760]] {
        w := size[1],h := size[2],g.Show("Hide w" w " h" h),ICLUResize(g,0,w,h)
        for key in ["Enable","Disable","Preview","Stop","Options","Count","Retry","Players","Setup","Voice","Done"] {
            s.Controls[key].GetPos(&x,&y,&cw,&ch)
            V48Assert(x>=0 && y>=0 && x+cw<=w+1 && y+ch<=h+1,"control remains in client area after resize: " key)
        }
        s.List.GetPos(&lx,&ly,&lw,&lh),s.Controls["Enable"].GetPos(&bx,&by,&bw,&bh)
        s.Detail.GetPos(&dx,&dy,&dw,&dh),s.Controls["Done"].GetPos(&fx,&fy,&fw,&fh)
        V48Assert(ly+lh<by && by+bh<dy && dy+dh<fy,"table, action row, description and footer do not overlap")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd),"native resize fixture remains hidden")
    }
    IWScrollMove(s.List,35,false,1)
    before := IWScrollMetrics(s.List).Top,topId := s.Ids[before+1]
    V48Assert(before>10,"native scroll fixture is well below the first row")
    ICLURefresh()
    V48Assert(IWScrollMetrics(s.List).Top=before && s.Ids[before+1]=topId,"preference/status refresh preserves the visible row instead of jumping to the top")
    index := before+2,id := s.Ids[index]
    ICLUCheck(s.List,index,!ICLGet(id))
    V48Assert(IWScrollMetrics(s.List).Top=before,"toggling a visible callout keeps the viewport in place")
    s.Search.Value := "Energy Shield",ICLURefresh()
    V48Assert(s.Ids.Length=2 && IWScrollMetrics(s.List).Top=0,"a new search starts at its matching rows instead of keeping an unrelated scroll offset")
}

; Native full-dispatch and Grace lifecycle regressions. V673RecordFixture owns
; private state/settings; these never start a reader or pump real audio.
V673DispatchFeed(line,emit := true)
{
    global CurrentRecord,testClock
    prior := CurrentRecord,at := LogStampMs(line),testClock := at
    CurrentRecord := {Line:line,At:at,Age:0,ReadTick:at,Allow:emit}
    try ProcessCombatLine(line,emit)
    finally CurrentRecord := prior
}

V673DispatchSetup()
{
    global autoBossProfileEnabled,localPlayerToken,Roster,playerTankRoles,universalCalloutsEnabled,energyShieldCalloutEnabled
    global AbilityPhraseTemplates,tythCalloutsEnabled,tyth8CalloutEnabled,tyth65CalloutEnabled
    global tythRageReportsEnabled,TythExtraAlerts,TythGraceAlertDefinitions,TythRecordOrder
    global activeBoss,Audio,soundboardsEnabled,autoBossCalloutsEnabled,inputMode
    ResetBossAutoContext(),autoBossProfileEnabled := false,localPlayerToken := "@Owner#673"
    Roster := {Members:Map(),Snapshot:-1,LastFight:100000,ContextAt:100000}
    Roster.Members[localPlayerToken] := {RoleAt:100000,Snapshot:-1,Role:"Tank"}
    playerTankRoles[localPlayerToken] := true
    inputMode := "CombatLog",activeBoss := "GFTM - Tyth",soundboardsEnabled := true
    universalCalloutsEnabled := true,energyShieldCalloutEnabled := true,autoBossCalloutsEnabled := true
    AbilityPhraseTemplates := AbilityPhraseTemplates.Clone()
    AbilityPhraseTemplates["YourEnergyShield"] := "{Toon} used Energy Shield."
    tythCalloutsEnabled := true,tyth8CalloutEnabled := false,tyth65CalloutEnabled := false
    tythRageReportsEnabled := false
    for definition in [TythExtraAlerts,TythGraceAlertDefinitions]
        for key,item in definition
            item.Enabled := false
    TythRecordOrder := {At:-1,Seen:Map()},ResetTythState("","isolated v67.3 regression")
    Audio.Queue := [],Audio.LastAccepted := Map()
}

V673DispatchEmptyActors() => V673RecordFixture(V673DispatchEmptyActorsCase)
V673DispatchEmptyActorsCase()
{
    global Roster,localPlayerToken
    V673DispatchSetup()
    for field in ["","=","|"," ","@Unknown#22","IZAX {4108097563918336}:673|(0,0,0,0)|(900/1000)"]
        V48Assert(!BossAutoKnownPlayer(field,100000),"empty, shorthand and unknown actors are not promoted to players")
    V48Assert(BossAutoKnownPlayer(localPlayerToken "|(0,0,0,0)|(100/100)",100000),"validated local player still qualifies")
    Roster.Members["@Other#674"] := {RoleAt:100000,Snapshot:-1,Role:"DPS"}
    V48Assert(BossAutoKnownPlayer("@Other#674|(0,0,0,0)|(100/100)",100001),"fresh known non-tank still qualifies for boss detection")
    V48Assert(!BossAutoKnownPlayer("@Other#674",100000+1800001),"expired role metadata remains excluded")
}

V673DispatchBlankBossDamage() => V673RecordFixture(V673DispatchBlankBossDamageCase)
V673DispatchBlankBossDamageCase()
{
    global tythBossInstance,tythLastHpPct,Audio,inLogDispatch,dispatchLogStamp,dispatchLogSource,BossAuto
    V673DispatchSetup()
    boss := V551Boss(900,"673"),action := "[ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)"
    for pair in [["",boss],[boss,""],[boss,"="],["=",boss]] {
        line := V551Line(100000,pair[1],pair[2],"Electrical effect {4163159044653056}",action)
        V673DispatchFeed(line)
        V48Assert(tythBossInstance="673" && tythLastHpPct=0.9,"valid actorless damage reaches the actual Tyth observer")
        V48Assert(!inLogDispatch && dispatchLogStamp="" && dispatchLogSource="","dispatcher ownership clears after each record")
    }
    V48Assert(BossAuto.Profile="","actorless environmental damage does not invent a player-engaged profile")
    V673DispatchFeed(V551Line(100001,"@Owner#673|(0,0,0,0)|(100/100)","=","Energy Shield {814218425139200}",
        "[Event {836045448945472}: AbilityActivate {836045448945479}] ()"))
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Key="EnergyShield","adjacent real ability activation still queues after empty-actor records")
}

V673DispatchFailureContainment() => V673RecordFixture(V673DispatchFailureContainmentCase)
V673DispatchFailureContainmentCase()
{
    global BossAuto,IrisBench,tythBossInstance,tythLastHpPct,inLogDispatch
    V673DispatchSetup(),BossAuto := {} ; controlled damaged optional observer state
    IrisBench.Active := true,IrisBench.Session := IBNewSession(673)
    action := "[ApplyEffect {836045448945477}: Damage {836045448945501}] (1 energy {836045448940874})"
    V673DispatchFeed(V551Line(100000,V551Boss(900,"674"),"@Owner#673|(0,0,0,0)|(100/100)","Melee {1}",action))
    V48Assert(IrisBench.Session.Errors.Get("Mechanic event handler",0)=1,"contained profile errors remain visible to diagnostics")
    V48Assert(tythBossInstance="674" && tythLastHpPct=0.9 && !inLogDispatch,"optional observer failure cannot discard downstream mechanic evidence")
    ResetBossAutoContext()
    V673DispatchFeed(V551Line(100010,V551Boss(899,"674"),"@Owner#673|(0,0,0,0)|(100/100)","Melee {1}",action))
    V48Assert(BossAuto.Profile="GFTM - Tyth" && tythLastHpPct=0.899,"the next valid record can detect the profile and update combat state")
    V48Assert(IrisBench.Session.Errors.Get("Mechanic event handler",0)=1 && IrisBench.Session.HookErrors=0,"successful next record adds no hidden handler/instrumentation errors")
}

V673DispatchSilentAndSameStamp() => V673RecordFixture(V673DispatchSilentAndSameStampCase)
V673DispatchSilentAndSameStampCase()
{
    global tythLastHpPct,Audio,BossAuto
    V673DispatchSetup()
    action := "[ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)"
    first := V551Line(100000,"",V551Boss(900,"675"),"Effect {1}",action)
    second := V551Line(100000,"",V551Boss(850,"675"),"Effect {2}",action)
    V673DispatchFeed(first),V673DispatchFeed(first),V673DispatchFeed(second)
    V48Assert(tythLastHpPct=0.85,"distinct records at the same millisecond are retained alongside exact duplicates")
    V673DispatchFeed(V551Line(100001,"@Owner#673|(0,0,0,0)|(100/100)",V551Boss(800,"675"),"Ability {1}",action),false)
    V48Assert(tythLastHpPct=0.8 && Audio.Queue.Length=0 && BossAuto.Profile="","silent hydration observes health without selecting a live profile or speaking")
}

V673GraceInterruptLine(at := 100001)
{
    return V551Line(at,"@Owner#673|(0,0,0,0)|(100/100)","","Aivela's Grace {4088443793571840}",
        "[Event {836045448945472}: AbilityInterrupt {836045448945482}]")
}

V673TythPostKillGrace() => V673RecordFixture(V673TythPostKillGraceCase)
V673TythPostKillGraceCase()
{
    global TythGraceAlertDefinitions,Audio,tythEnded,tythGeneration
    V673DispatchSetup(),TythGraceAlertDefinitions["GraceInterrupted"].Enabled := true
    V673DispatchFeed(V551Line(100000,V551Boss(900,"676"),"="))
    V673DispatchFeed(V673GraceInterruptLine())
    V48Assert(Audio.Queue.Length=1 && AudioItemEnabled(Audio.Queue[1]),"explicit DR interrupt still qualifies while Tyth lives")
    oldItem := Audio.Queue[1].Clone()
    V673DispatchFeed(V551Line(100100,V551Boss(0,"676"),"=","","[Event {836045448945472}: Death {836045448945493}]"))
    V48Assert(tythEnded && !AudioItemEnabled(oldItem),"boss death invalidates previously queued Grace speech")
    Audio.Queue := []
    V673DispatchFeed(V673GraceInterruptLine(100800))
    V48Assert(Audio.Queue.Length=0 && !PlayTythGraceAlert("GraceInterrupted"),"a surviving add cannot create a new DR warning after the kill")
    oldItem.TythGeneration := tythGeneration
    V48Assert(!AudioItemEnabled(oldItem),"playback guard rejects post-kill Grace speech independently of generation invalidation")
}

V673TythGraceNextPull() => V673RecordFixture(V673TythGraceNextPullCase)
V673TythGraceNextPullCase()
{
    global TythGraceAlertDefinitions,Audio,tythEnded,soundboardsEnabled
    V673DispatchSetup(),TythGraceAlertDefinitions["GraceInterrupted"].Enabled := true
    V673DispatchFeed(V551Line(100000,V551Boss(0,"677"),"=","","[Event {836045448945472}: Death {836045448945493}]"))
    V673DispatchFeed(V673GraceInterruptLine(100800)),V48Assert(tythEnded && Audio.Queue.Length=0,"post-kill outcome is consumed silently")
    V673DispatchFeed(V551Line(120000,V551Boss(900,"678"),"="))
    V673DispatchFeed(V673GraceInterruptLine(120001))
    V48Assert(!tythEnded && Audio.Queue.Length=1 && AudioItemEnabled(Audio.Queue[1]),"new boss instance restores legitimate DR alerts")
    Audio.Queue := [],soundboardsEnabled := false
    V673DispatchFeed(V673GraceInterruptLine(121000)),soundboardsEnabled := true
    V673DispatchFeed(V673GraceInterruptLine(121000))
    V48Assert(Audio.Queue.Length=0,"mute still consumes outcomes without replaying them when re-enabled")
    TythGraceAlertDefinitions["GraceHeal"].Enabled := true
    V673DispatchFeed(V551Line(121100,V551Boss(0,"678"),"=","","[Event {836045448945472}: Death {836045448945493}]"))
    V48Assert(!PlayTythGraceAlert("GraceHeal"),"post-kill guard also prevents an obsolete direct heal warning")
}

; v67.3 shared native record fixture. No normal startup, audio worker, game input
; or live settings. The enclosing library fixture owns a private INI and restores
; all Nahut preferences/controllers, master switches and the audio queue.
V673RecordFixture(fn) => V672LibraryFixture(V673RecordInner.Bind(fn))
V673RecordInner(fn)
{
    global
    local names := ["Roster","playerTankRoles","localPlayerToken","tauntLocalInCombat","LogClock",
        "ReadClockSample","CurrentRecord","logReadBusy","inLogDispatch","dispatchAudioAllowed",
        "dispatchLogStamp","dispatchLogSource","autoBossProfileEnabled","BossAuto","activeBossIndex",
        "tythGeneration","tythEnded","tythRageWarningsSuppressed","TythRageMonitor","TythRecordOrder",
        "tythBossInstance","tythLastHpPct","tythSeenAboveWave8Threshold","tyth65Called","tythRageStacks",
        "tythEightCalled","tythSeenAboveBurnThreshold","tythBurnWarningCalled","TythCleave","TythWave8",
        "TythGraceLastEventMs","TythGraceDeadCastSeen","AERemote","AEStacks","AEControls",
        "IRT","IRTPrefs","IRN","IRNU","IRU","IRUU","IPull","IPM","IrisBench",
        "TauntPhraseTemplates","AbilityPhraseTemplates","NBOrderRecordings","NBRebounderRecordings",
        "NBTurretRecordings","NBFifthRecordings","NBRepairRecordings","NBNextSoundIds",
        "lastPlayed","rejectOldLogAudio","allowBackgroundLogAudio","logClockOffsetMs","currentLogPath",
        "DiagnosticBuffer"]
    local saved := Map(),name,value,aux := IAuxDiagnosticState(),oldAux := aux.Clone()
    for name in names
        saved[name] := %name%
    try {
        Roster := {Members:Map(),Snapshot:-1,LastFight:-1,ContextAt:-1}
        playerTankRoles := Map(),localPlayerToken := "@ReplayOwner#1001",tauntLocalInCombat := false
        LogClock := {Day:0,Raw:-1,Dated:true,LastWall:0,LastTick:0,Status:"isolated record test",Age:-1,Latest:-1}
        ReadClockSample := "",CurrentRecord := "",logReadBusy := false,inLogDispatch := false
        dispatchAudioAllowed := true,dispatchLogStamp := "",dispatchLogSource := ""
        autoBossProfileEnabled := false,activeBoss := "GFTM - Nahut"
        activeBossIndex := FindArrayTextIndex(BossNames,activeBoss)
        ResetBossAutoContext(),ResetTythState("","isolated record fixture")
        TythRecordOrder := {At:-1,Seen:Map()},AERemote := NewAERemoteState(),AEStacks := NewAEStackState(),AEControls := {}
        IRT := IRTNewState(),IRTPrefs := IRTUNewState(),IRN := IRNNewState(),IRNU := IRNUNewState()
        IRU := IRUNewState(),IRUU := IRUUNewState(),IPull := IPullNewState(),IPM := IPMNewState()
        IP := IPNewApp(),IrisBench := {Active:false,Finalizing:false,Visible:false,Gui:"",Generation:1,Session:IBNewSession(1)}
        TauntPhraseTemplates := Map("YourTaunt","{Toon} used taunt.","CoTankTaunt","{Toon} used taunt.")
        AbilityPhraseTemplates := Map()
        for name,value in TrackedAbilityDefinitions {
            AbilityPhraseTemplates["Your" name] := "{Toon} used " value.Spoken "."
            AbilityPhraseTemplates["CoTank" name] := "{Toon} used " value.Spoken "."
        }
        NBOrderRecordings := Map(),NBRebounderRecordings := Map(),NBTurretRecordings := Map()
        NBFifthRecordings := Map(),NBRepairRecordings := Map(),NBNextSoundIds := Map(),lastPlayed := Map()
        rejectOldLogAudio := false,allowBackgroundLogAudio := false,logClockOffsetMs := 0,currentLogPath := ""
        DiagnosticBuffer := [],aux.Errors := Map(),aux.Dropped := 0
        fn.Call()
    }
    finally {
        for name,value in saved
            %name% := value
        for name,value in oldAux.OwnProps()
            aux.%name% := value
    }
}

V673RecordBenchStart()
{
    global IrisBench
    frequency := 0
    DllCall("Kernel32\QueryPerformanceFrequency","Int64*",&frequency)
    IrisBench.Session := IBNewSession(1),IrisBench.Session.Frequency := frequency
    IrisBench.Session.Start := IBQpc(),IrisBench.Active := true
}

V673RecordFeed(line,allow := true,receiptTick := -1)
{
    global testClock,ReadClockSample,LogClock
    at := UnwrapStamp(LogStampMs(line),LogClock.Latest)
    testClock := receiptTick<0 ? at : receiptTick
    ReadClockSample := {Wall:testClock,Tick:testClock,LatestStamp:at}
    SafeProcessCombatLine(line,allow)
    return at
}

V673RecordAssertHealthy(label := "record")
{
    global IrisBench,NBOrder,NBRebounder,NBTurrets,NBRepair
    V48Assert(IrisBench.Session.Errors.Get("Mechanic event handler",0)=0,label ": full dispatcher has no swallowed mechanic/profile exceptions")
    V48Assert(IrisBench.Session.HookErrors=0,label ": diagnostic accounting has no hook errors")
    V48Assert(!NBOrder.Suspended && !NBRebounder.Suspended && !InStr(NBTurrets.Status,"Tracker error")
        && !InStr(NBRepair.Status,"after an error"),label ": Nahut observers remain healthy")
    V48Assert(IAuxDiagnosticState().Errors.Count=0,label ": auxiliary observers have no errors")
}

; Selected original records: October1 source ordinals 119909, 120099, 120100, 120101, 120102, 120103, 120104, 120105, 126248, 126279, 126614, 126615, 126616, 126618, 126619, 126622, 126623, 126625.
; Names/character IDs and unique NPC instance IDs replaced consistently only.
V673RecordedNahutRows()
{
    return [
        "[21:52:18.766] [@Recorded1#6701|(-399.37,2605.45,206.41,-13.70)|(0/443559)] [NAHUT {4122949560827904}:67300|(-383.53,2594.79,206.41,74.91)|(15163283/36514284)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7152* elemental {836045448940875})",
        "[21:52:27.178] [Singularity Chamber {4122580193640448}:67301|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Recorded2#6702|(-389.75,2570.92,207.91,-60.38)|(307656/491621)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]",
        "[21:52:27.178] [Singularity Chamber {4122580193640448}:67301|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Recorded3#6703|(-381.12,2575.91,207.91,141.96)|(443634/443634)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]",
        "[21:52:27.178] [Singularity Chamber {4122580193640448}:67301|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Recorded4#6704|(-379.52,2578.26,207.91,155.43)|(443752/443752)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]",
        "[21:52:27.178] [Singularity Chamber {4122580193640448}:67301|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Recorded5#6705|(-375.21,2582.68,207.91,88.60)|(435022/435022)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]",
        "[21:52:27.178] [Singularity Chamber {4122580193640448}:67301|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Recorded6#6706|(-374.46,2582.43,207.91,-1.25)|(441822/441822)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]",
        "[21:52:27.178] [Singularity Chamber {4122580193640448}:67301|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Recorded7#6707|(-375.28,2580.60,207.91,-103.99)|(442490/442490)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]",
        "[21:52:27.178] [Singularity Chamber {4122580193640448}:67301|(-414.75,2600.50,206.41,0.00)|(18188932/18188932)] [@Recorded8#6708|(-367.11,2575.78,207.91,-112.06)|(232114/496956)] [Singularity Core {4133502295474176}] [ApplyEffect {836045448945477}: Oppressive Gravity {4133502295474475}]",
        "[21:54:36.051] [NAHUT {4122949560827904}:67300|(-384.98,2641.83,207.91,-44.79)|(1911732/36514284)] [@Recorded7#6707|(-381.02,2637.72,207.91,-123.30)|(11173/442490)] [] [Event {836045448945472}: Death {836045448945493}]",
        "[21:54:36.925] [NAHUT {4122949560827904}:67300|(-384.98,2641.83,207.91,-44.79)|(1880302/36514284)] [@Recorded7#6707|(-381.02,2637.72,207.91,-123.30)|(11173/442490)] [ {4123520791478272}] [ApplyEffect {836045448945477}: Instinctual Fear {4123520791478576}]",
        "[21:54:49.189] [] [@Recorded6#6706|(-380.81,2635.99,207.91,-162.43)|(4772/441822)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]",
        "[21:54:49.189] [] [@Recorded5#6705|(-372.08,2627.36,207.91,142.08)|(0/435022)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]",
        "[21:54:49.189] [] [@Recorded3#6703|(-367.82,2626.16,207.91,-142.35)|(0/443634)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]",
        "[21:54:49.190] [] [@Recorded8#6708|(-379.60,2641.23,207.91,-161.34)|(0/496956)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]",
        "[21:54:49.190] [] [@Recorded2#6702|(-365.95,2620.84,207.91,-33.56)|(0/491621)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]",
        "[21:54:49.190] [] [@Recorded4#6704|(-367.01,2620.26,207.91,158.39)|(0/443752)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]",
        "[21:54:49.190] [] [@Recorded7#6707|(-381.02,2637.72,207.91,-123.30)|(11173/442490)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]",
        "[21:54:49.195] [] [@Recorded4#6704|(-367.01,2620.26,207.91,158.39)|(0/443752)] [Energized Slice {4137075708264448}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (184125 ~108136 energy {836045448940874}) <184125.0>"
    ]
}

V673RecordedBlankIzax() => V673RecordFixture(V673RecordedBlankIzaxCase)
V673RecordedBlankIzaxCase()
{
    global IRT,Audio
    V673RecordBenchStart(),IRT.Enabled := true
    line := "[20:55:11.853] [] [IZAX {4108097563918336}:67302|(101.25,2261.00,792.97,90.00)|(278824256/434767136)] [Electrical Overload {4163159044653056}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)"
    at := V673RecordFeed(line)
    V48Assert(IRT.LastEvent=at,"actual actorless Izax damage reaches downstream processing")
    V673RecordAssertHealthy("recorded actorless Izax")
    V48Assert(Audio.Queue.Length=0,"environmental boss damage does not invent speech")
}

V673RecordedNahutCleanup() => V673RecordFixture(V673RecordedNahutCleanupCase)
V673RecordedNahutCleanupCase()
{
    global NBCandle,NBOrder,NBRebounder,NBFloor,NBFloorOptions,Audio,logReadBusy,CurrentRecord
    V673RecordBenchStart(),NBFloorOptions.Enabled := false,checks := 0
    actor := "@Recorded7#6707"
    for line in V673RecordedNahutRows() {
        at := LogStampMs(line)
        if at>=78889189 && !checks {
            Audio.Queue.Push({Kind:"Boss",Key:"NahutRebounder"})
            checks := 1
        }
        logReadBusy := true
        try V673RecordFeed(line)
        finally logReadBusy := false
        if at=78876051 || at=78876925 {
            p := NBCandle.Players[actor]
            V48Assert(p.Dead && p.DeathAt=78876051 && p.Pos.Hp=11173,"recorded Death stays authoritative through stale positive HP")
        }
    }
    PollNBCandle(),PollNBOrder(),PollNBRebounder()
    V48Assert(checks && NBCandle.Ended && NBOrder.Ended && NBRebounder.Ended && NBFloor.Ended,"all seven recorded Gravity removals end the shared encounter with floor audio off")
    V48Assert(!NBCandle.Burn && !NBRebounderLive() && Audio.Queue.Length=0,"later original blank-source Slice cannot queue a post-wipe assignment")
    V673RecordAssertHealthy("recorded Nahut cleanup")
}

; v67.3: real ordered-candle/Rebounder controllers under isolated fixtures.
; No audio worker, gameplay input, normal startup, or saved-settings mutation.
V673OrderFixture(fn) => V672LibraryFixture(V673OrderInner.Bind(fn))
V673OrderInner(fn)
{
    global Roster,playerTankRoles,LogClock,logReadBusy,NBRebounderRecordings
    old := {Roster:Roster,Roles:playerTankRoles,Clock:LogClock,Busy:logReadBusy,Recordings:NBRebounderRecordings}
    try {
        logReadBusy := false
        fn.Call()
    }
    finally {
        Roster := old.Roster,playerTankRoles := old.Roles,LogClock := old.Clock
        logReadBusy := old.Busy,NBRebounderRecordings := old.Recordings
    }
}

V673OrderBatchBattery() => V673OrderFixture(V673OrderBatchBatteryCase)
V673OrderBatchBatteryCase()
{
    global NBCandle,NBOrder,logReadBusy,inLogDispatch,Audio
    for busyKind in ["read","dispatch"] {
        V48Setup(),V48Pass("Tank1",100000)
        tank2 := V48Actor("Tank2"),NBCandle.Players[tank2].Battery := 0
        logReadBusy := busyKind="read",inLogDispatch := busyKind="dispatch"
        V48Use("Tank1",100500,true)
        V48Assert(NBOrder.Turns[1].Done,"actual use receives its credit during " busyKind)
        V48Assert(!NBOrder.Turns[2].Skipped,"incomplete read cannot permanently skip batteryless T2")
        V482BatteryPickup("Tank2",100501),V48Pass("Tank2",100502)
        PollNBOrder()
        V48Assert(Audio.Queue.Length=0,"no provisional ordered speech while read/dispatch is active")
        logReadBusy := false,inLogDispatch := false
        V48Assert(V48Chosen()="Tank2" && !NBOrder.Turns[2].Skipped,"final same-batch battery and receipt retain T2 turn")
        V48Assert(!NBOrder.Mispass && !NBOrder.Recovery,"valid same-batch handoff creates no false correction")
        V48Assert(!NBOrder.PendingReceipt && NBOrder.PendingRecoveryIndex=0,"deferred bookkeeping consumed exactly once")
    }
}

V673OrderFinalSkip() => V673OrderFixture(V673OrderFinalSkipCase)
V673OrderFinalSkipCase()
{
    global NBCandle,NBOrder,logReadBusy
    V48Setup(),V48Pass("Tank1",100000)
    tank2 := V48Actor("Tank2"),NBCandle.Players[tank2].Battery := 0
    logReadBusy := true,V48Use("Tank1",100500,true)
    V48Assert(!NBOrder.Turns[2].Skipped,"skip remains uncommitted during the batch")
    logReadBusy := false
    V48Assert(V48Chosen()="Healer1" && NBOrder.Turns[2].Skipped,"final unavailable T2 still skipped by agreed strategy")
    V48Assert(!NBOrder.Turns[2].Done && NBCandle.Players[tank2].LastUse=-1,"skip never invents a reveal or cooldown")
    V482BatteryPickup("Tank2",100600)
    V48Assert(V48Chosen()="Healer1","later batch battery does not rewind an already-selected handoff")
}

V673OrderBatchRecovery() => V673OrderFixture(V673OrderBatchRecoveryCase)
V673OrderBatchRecoveryCase()
{
    global NBOrder,logReadBusy,Audio
    V48Setup(),V48Pass("Tank1",100000),logReadBusy := true
    V48Pass("DoubleCloseDPS",100100),V48Use("DoubleCloseDPS",100200,true)
    V48Assert(NBOrder.Turns[5].Done && !NBOrder.Turns[2].Skipped,"early completed use credited without fast-forwarding other turns")
    logReadBusy := false,candidate := NBOrderReconcile(100200)
    V48Assert(candidate.Slot="Tank1" && NBOrder.Recovery && NBOrder.Mispass,"final wrong holder returns to earliest unfinished eligible turn")
    want := NBOrderDesired(candidate,100200)
    V48Assert(want.Kind="Incorrect" && want.Actual=V48Actor("DoubleCloseDPS"),"wrong-pass correction retains actual living sender")
    PollNBOrder()
    V48Assert(Audio.Queue.Length=1 && NBOrderAudioItemEnabled(Audio.Queue[1]),"final corrective instruction eligible in existing queue")
    stale := Audio.Queue[1]
    logReadBusy := true,V48Pass("Tank1",100201),V48Pass("Tank2",100202),V48Pass("Tank1",100203)
    logReadBusy := false,NBOrderReconcile(100203)
    V48Assert(!NBOrder.Mispass && !NBOrder.Recovery && Audio.Queue.Length=0,"correct final receipt cancels intermediate wrong-pass correction")
    V48Assert(!NBOrderAudioItemEnabled(stale),"saved stale correction cannot play after actual recovery")
    V48DoneThrough(4)
    V48Assert(V48Chosen()="DoubleFarDPS" && NBOrder.Turns[5].Done,"early Double Close credit remains consumed once")
}

V673OrderBatchTerminal() => V673OrderFixture(V673OrderBatchTerminalCase)
V673OrderBatchTerminalCase()
{
    global NBCandle,NBOrder,logReadBusy
    V48Setup(2),V48DoneThrough(4),V48Pass("DoubleCloseDPS",100000)
    h1 := NBCandle.Players[V48Actor("Healer1")],h1.Battery := 0
    logReadBusy := true
    V48Lock("DoubleCloseDPS",100100),V48Pass("DoubleFarDPS",100101)
    V48Use("DoubleFarDPS",100102,false)
    V48Assert(NBOrder.Phase=2,"terminal battery loss alone never promotes P3")
    V48Use("DoubleFarDPS",100103,true)
    V48Assert(NBOrder.Phase=3 && NBOrder.Turns[1].Done,"same-batch terminal completed reveal enters P3 and credits opener")
    V48Assert(!NBOrder.Turns[2].Skipped,"P3 selection still waits for remaining batch evidence")
    V482BatteryPickup("Healer1",100104),logReadBusy := false
    V48Assert(V48Chosen()="Healer1" && !NBOrder.Turns[2].Skipped,"P3 uses final battery evidence rather than prematurely skipping H1")
    V48Use("DoubleFarDPS",100105,true)
    V48Assert(!NBOrder.Turns[10].Done,"positive duplicate does not credit Far's second P3 occurrence")
    V48Setup(2),logReadBusy := true,V48Pass("DoubleFarDPS",100100),V48Use("DoubleFarDPS",100101,true)
    logReadBusy := false
    V48Assert(NBOrder.Phase=2 && V48Chosen()="Healer1","early Far use with unfinished eligible P2 tasks cannot manufacture P3")
    V48Setup(2),V48DoneThrough(4)
    close := NBCandle.Players[V48Actor("DoubleCloseDPS")],close.Dead := true
    V48Pass("DoubleFarDPS",100100)
    skipped := NBOrder.Turns[5]
    V48Assert(NBOrder.TerminalArmed && NBOrder.Choice=6 && skipped.Skipped,"unavailable earlier holder retires when terminal Far actually selected")
    logReadBusy := true
    V48Event(100110,V48Field("DoubleCloseDPS"),"=","0","836045448945472","836045448945494")
    V48Use("DoubleFarDPS",100120,true),logReadBusy := false
    V48Assert(!close.Dead && skipped.Skipped && NBOrder.Phase=3 && NBOrder.Turns[1].Done,"revived earlier player cannot rewind accepted terminal hold or block its actual P3 opening use")
}

V673OrderBatchTankProof() => V673OrderFixture(V673OrderBatchTankProofCase)
V673OrderBatchTankProofCase()
{
    global NBOrder,logReadBusy
    for lockFirst in [true,false] {
        V48Setup(2),V48DoneThrough(2),V48Pass("Tank1",100000),logReadBusy := true
        if lockFirst {
            V48Lock("Tank1",100100)
            V48Assert(!NBOrder.Turns[3].Done,"tank snipe lock alone cannot finish reveal task")
            V48Use("Tank1",100101,true)
        }
        else {
            V48Use("Tank1",100100,true)
            V48Assert(!NBOrder.Turns[3].Done,"tank completed reveal alone cannot finish lock task")
            V48Lock("Tank1",100101)
        }
        V48Assert(NBOrder.Turns[3].Done,"both independent proofs credit same tank once during batch")
        logReadBusy := false
        V48Assert(V48Chosen()="Tank2" && !NBOrder.Recovery,"correct tank completion selects next task without false recovery")
    }
}

V673OrderBatchP3Branch() => V673OrderFixture(V673OrderBatchP3BranchCase)
V673OrderBatchP3BranchCase()
{
    global NBCandle,NBOrder,logReadBusy
    for finalNear in [true,false] {
        V48Setup(3),V48DoneThrough(3),V48Pass("FifthDPS",100000)
        tank2 := NBCandle.Players[V48Actor("Tank2")],tank2.Pos.X := 50
        logReadBusy := true,V48Use("FifthDPS",100100,true)
        V48Assert(NBOrder.Branch="","P3 branch does not freeze from provisional mid-batch position")
        tank2.Pos.X := finalNear ? 10 : 50
        V48Event(100101,V48Field("Tank2"),"=","777","836045448945477","888")
        logReadBusy := false
        V48Assert(V48Chosen()=(finalNear ? "Tank2" : "Mara"),"final observed position determines T2/Mara branch")
        V48Assert(NBOrder.Branch=(finalNear ? "Tank2ThenMara" : "MaraThenTank2"),"branch records agreed ordering after complete batch")
    }
}

V673OrderBatchH1Allowance() => V673OrderFixture(V673OrderBatchH1AllowanceCase)
V673OrderBatchH1AllowanceCase()
{
    global NBCandle,NBOrder,logReadBusy
    for wait in [10000,10001] {
        V48Setup(),V48DoneThrough(7),V48Pass("Mara",100000)
        h1 := NBCandle.Players[V48Actor("Healer1")],h1.LastUse := 100200-60000+wait
        logReadBusy := true,V48Use("Mara",100100,true),V48Pass("Healer1",100200)
        logReadBusy := false,candidate := NBOrderReconcile(100200)
        if wait=10000 {
            V48Assert(candidate.Index=9 && candidate.Slot="Healer1" && NBOrder.GraceH1,"same-batch actual Mara-to-second-H1 handoff retains exact ten-second allowance")
            V48Assert(NBOrderDesired(candidate,100200).Kind="Wait" && !NBOrder.Turns[9].Done,"H1 waits for real cooldown and receipt never credits reveal")
            V48Time(110200),candidate := NBOrderReconcile(110200)
            V48Assert(candidate.Index=9 && candidate.WaitMs=0 && !IsObject(NBOrderDesired(candidate,110200)),"accepted H1 hold remains stable and wait ends at actual cooldown boundary")
        }
        else
            V48Assert(candidate.Slot="Healer2" && NBOrder.Turns[9].Skipped,"more than ten seconds at actual receipt cannot gain exception from deferred selection")
        V48Assert(NBOrder.PendingH1Actor="","one-batch allowance evidence is consumed")
    }
    V48Setup(),V48DoneThrough(7),V48Pass("Mara",100000)
    NBCandle.Players[V48Actor("Healer1")].LastUse := 50000
    logReadBusy := true,V48Use("Mara",100100,true),V48Pass("Tank2",100150),V48Pass("Healer1",100200)
    logReadBusy := false
    V48Assert(V48Chosen()="Healer2" && NBOrder.Turns[9].Skipped,"ten-second exception is not extended to an intervening Tank2-to-H1 pass")
}

V673OrderDeadHolder() => V673OrderFixture(V673OrderDeadHolderCase)
V673OrderDeadHolderCase()
{
    global NBCandle,NBOrder,Audio
    V48Setup(),V48Pass("Tank1",100000),V48Use("Tank1",100100,true),PollNBOrder()
    V48Assert(Audio.Queue.Length=1 && NBOrderAudioItemEnabled(Audio.Queue[1]),"living holder pass is queued and initially valid")
    oldItem := Audio.Queue[1],holder := V48Actor("Tank1")
    V48Event(100101,V48Field("Tank1"),"=","0","836045448945472","836045448945493")
    V48Assert(NBCandle.Players[holder].Dead,"explicit death survives its stale positive HP snapshot")
    V48Assert(!NBOrderAudioItemEnabled(oldItem),"queued pass from now-dead holder is rejected before playback")
    candidate := NBOrderReconcile(100101),want := NBOrderDesired(candidate,100101)
    V48Assert(candidate.Slot="Tank2" && want.Kind="Next" && want.Actual="" && want.ActualName="","missing cleanup uses living recipient-next wording without a dead sender")
    V48Assert(NBCandle.Holder=holder,"wording fix does not invent a Candle removal or new holder")
    PollNBOrder()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].NOData.Kind="Next" && NBOrderAudioItemEnabled(Audio.Queue[1]),"recipient-next queues and validates despite retained dead-holder observation")
    nextItem := Audio.Queue[1]
    V48Pass("Tank2",100102)
    V48Assert(!NBOrderAudioItemEnabled(nextItem) && Audio.Queue.Length=0,"real receipt invalidates no-holder next instruction")
}

V673OrderRepublicRebounder() => V673OrderFixture(V673OrderRepublicRebounderCase)
V673OrderRepublicRebounderCase()
{
    global Roster,NBRebounder,NBRebounderOptions,autoBossCalloutsEnabled,Audio
    V49Setup(4),close := V48Actor("DoubleCloseDPS")
    for spec in [{Id:"2031339142381638",Name:"Plasmatech"},{Id:"2031339142381640",Name:"Tactics"}] {
        Roster.Members[close].DisciplineId := spec.Id,Roster.Members[close].DisciplineName := "localized discipline"
        V48Assert(NBRebounderClass(close)="PTDPS" && IsObject(NBRebounderCandidate("DoubleCloseDPS",100000)),"verified numeric Vanguard DPS mirror supports assigned Rebounder slot")
        Roster.Members[close].DisciplineId := "",Roster.Members[close].DisciplineName := spec.Name
        V48Assert(NBRebounderClass(close)="PTDPS","English-name mirror works when discipline ID unavailable")
    }
    NBRebounderOptions.Enabled := false,autoBossCalloutsEnabled := false
    V49Feed(100100,V48Field("DoubleCloseDPS"),"=","801354998087680","836045448945472","836045448945479","",false)
    V48Assert(NBRebounder.Uses[close]=100100,"Sonic Round actual activation recorded while history/muted")
    V48Assert(!NBRebounderReady(close,135099) && NBRebounderReady(close,135100),"configured 35-second cooldown preserved exactly for mirror")
    V49Feed(100101,V48Field("DoubleFarDPS"),"=","801354998087680","836045448945477","801354998088314","",false)
    V48Assert(!NBRebounder.Uses.Has(V48Actor("DoubleFarDPS")),"mirror buff recipient never spends an activation cooldown")
    V49Feed(100102,V48Field("FifthDPS"),"=","880189122806413","836045448945472","836045448945479","",false)
    V48Assert(NBRebounder.Uses[V48Actor("FifthDPS")]=100102,"alternate verified PT activation also shares use tracking")
    tank := V48Actor("Tank1"),Roster.Members[tank].DisciplineId := "2031339142381641",Roster.Members[tank].DisciplineName := "localized discipline"
    for slot in ["DoubleCloseDPS","DoubleFarDPS","FifthDPS"]
        NBRebounder.Uses[V48Actor(slot)] := 100102
    V48Assert(NBRebounderClass(tank)="PTTank" && NBRebounderChooseBurn(100102).Kind="EP","Shield Specialist mirror retains existing tank fallback strategy")
    Roster.Members[tank].DisciplineId := "",Roster.Members[tank].DisciplineName := "Shield Specialist"
    V48Assert(NBRebounderClass(tank)="PTTank" && NBRebounderOptions.Cooldown=35 && Audio.Queue.Length=0,"name fallback supported without changing timer choices or speaking")
}

V673OrderPendingLifecycle() => V673OrderFixture(V673OrderPendingLifecycleCase)
V673OrderPendingLifecycleCase()
{
    global NBCandle,NBOrder,logReadBusy
    V48Setup(),V48DoneThrough(7),V48Pass("Mara",100000)
    NBCandle.Players[V48Actor("Healer1")].LastUse := 50000
    logReadBusy := true,V48Use("Mara",100100,true),V48Pass("Healer1",100200)
    V48Assert(NBOrder.PendingRecoveryIndex=8 && NBOrder.PendingReceipt && NBOrder.PendingH1Actor=V48Actor("Healer1"),"fixture has real uncommitted action, receipt and ten-second handoff evidence")
    NBOrderSetPhase(2,100201,"isolated observed phase transition"),logReadBusy := false
    candidate := NBOrderReconcile(100201)
    V48Assert(candidate.Slot="Healer1" && !NBOrder.Recovery && !NBOrder.Mispass && !NBOrder.GraceH1,"P2 hold-only task does not inherit P1 reveal recovery or cooldown allowance")
    V48Assert(NBOrder.PendingRecoveryIndex=0 && !NBOrder.PendingReceipt && NBOrder.PendingH1Actor="","accepted phase transition discards old-phase deferred evidence")
    V48Setup(),logReadBusy := true,V48Pass("DoubleCloseDPS",100100),V48Use("DoubleCloseDPS",100200,true)
    V48Assert(NBOrder.PendingRecoveryIndex=5 && NBOrder.PendingReceipt,"fixture has a genuine pending early-use correction")
    ResetNBOrder("isolated fresh encounter controller"),logReadBusy := false,V48Pass("Tank1",100300)
    V48Assert(V48Chosen()="Tank1" && !NBOrder.Recovery && !NBOrder.Mispass,"fresh initial receipt does not resurrect earlier pull's pending correction")
    V48Assert(NBOrder.PendingRecoveryIndex=0 && NBOrder.PendingRecoveryReason="" && !NBOrder.PendingReceipt && NBOrder.PendingH1Actor="","fresh controller has no previous batch markers")
}

; v67.3: explicit life evidence and shared Nahut wipe shutdown. Native only,
; silent observers/queue validation. No normal app, reader, audio worker or input.
V673LifecycleFixture(fn) => V672LibraryFixture(V673LifecycleInner.Bind(fn))
V673LifecycleInner(fn)
{
    global Roster,playerTankRoles,LogClock,NBOrderRecordings,NBRebounderRecordings,logReadBusy,inLogDispatch
    old := {Roster:Roster,Roles:playerTankRoles,Clock:LogClock,OrderSounds:NBOrderRecordings,
        RebounderSounds:NBRebounderRecordings,ReadBusy:logReadBusy,Dispatch:inLogDispatch}
    try {
        V49Setup(4)
        fn.Call()
    }
    finally {
        Roster := old.Roster,playerTankRoles := old.Roles,LogClock := old.Clock
        NBOrderRecordings := old.OrderSounds,NBRebounderRecordings := old.RebounderSounds
        logReadBusy := old.ReadBusy,inLogDispatch := old.Dispatch
    }
}

V673LifecycleFeed(line, floor := true)
{
    global CurrentRecord,testClock
    prior := CurrentRecord,at := LogStampMs(line),testClock := Max(testClock,at)
    CurrentRecord := {Line:line,At:at,Age:0,ReadTick:testClock,Allow:true}
    try {
        TrackNBCandle(line,true)
        SafeTrackNBOrder(line,true)
        SafeTrackNBRebounder(line,true)
        if floor
            SafeTrackNBFloor(line,true,testClock)
    }
    finally CurrentRecord := prior
}

V673LifecycleDeathSnapshot() => V673LifecycleFixture(V673LifecycleDeathSnapshotCase)
V673LifecycleDeathSnapshotCase()
{
    global NBCandle,NBRebounder,Roster,testClock
    actor := "@DoubleCloseDPS#102",p := NBCandle.Players[actor]
    p.LastUse := 78850000,p.Battery := 1,p.CastUntil := 78878000
    Roster.Members[actor].RoleAt := 78870000
    V673LifecycleFeed(V673LifecycleRecord("death"))
    V48Assert(p.Dead && p.DeathAt=78876051 && p.Battery=-1 && p.CastUntil<0,"actual positive-HP Death remains authoritative and retires battery/cast evidence")
    V673LifecycleFeed(V673LifecycleRecord("fear"))
    V48Assert(p.Pos.Hp=11173 && p.Dead && NBCandleActorKnownDead(actor),"actual later Instinctual Fear cannot revive the dead PT from stale11173HP")
    V48Assert(p.LastUse=78850000 && !IsObject(NBRebounderCandidate("DoubleCloseDPS",testClock,false)),"death keeps committed cooldown history and cannot be selected for Rebounder")
    V673LifecycleFeed(V671FloorLine(78877000,V48Field("DoubleCloseDPS",100),"=","4180987453898752","836045448945477","4180987453899014"))
    V48Assert(p.Dead && p.Battery=-1,"even a positive-HP battery effect cannot undo explicit Death")
    V673LifecycleFeed(V671FloorLine(78878000,V48Field("DoubleCloseDPS",100),"=","3361615068004352","836045448945477","836045448945500"," (760 ~0)"))
    V48Assert(p.Dead,"posthumous zero-effective healing is not a resurrection")
    V48Assert(!NBCandle.Ended,"one player's death does not end Nahut")
}

V673LifecycleRevive() => V673LifecycleFixture(V673LifecycleReviveCase)
V673LifecycleReviveCase()
{
    global NBCandle,Roster,testClock
    actor := "@DoubleCloseDPS#102",p := NBCandle.Players[actor],p.LastUse := 78850000
    Roster.Members[actor].RoleAt := 78870000
    V673LifecycleFeed(V673LifecycleRecord("death"))
    ; Actual battle-rez form: positive Sprint removal precedes self Revived1ms.
    V673LifecycleFeed(V671FloorLine(78880000,V48Field("DoubleCloseDPS",25),"=","810670782152704","836045448945478","810670782152704"))
    V48Assert(p.Dead,"first positive snapshot of battle rez waits for actual Revived")
    V673LifecycleFeed(V671FloorLine(78880001,V48Field("DoubleCloseDPS",25),"=","0","836045448945472","836045448945494"))
    V48Assert(!p.Dead && p.DeathAt<0 && p.RevivedAt=78880001 && !NBCandleActorKnownDead(actor),"logged self Revived releases explicit-death latch")
    V48Assert(p.Battery=-1 && p.LastUse=78850000 && !NBCandle.Ended,"battle rez neither ends pull nor invents battery or resets reveal cooldown")
    V673LifecycleFeed(V671FloorLine(78880002,V48Field("DoubleCloseDPS",25),"=","4180987453898752","836045448945477","4180987453899014"))
    V48Assert(p.Battery=1 && !p.Dead,"a fresh battery after genuine revival is usable evidence")
    V673LifecycleFeed(V673LifecycleRecord("death"))
    V48Assert(!p.Dead && p.RevivedAt=78880001,"late older Death cannot kill the new life")
}

V673LifecycleBareIdentity() => V673LifecycleFixture(V673LifecycleBareIdentityCase)
V673LifecycleBareIdentityCase()
{
    global NBCandle
    actor := V48Actor("DoubleCloseDPS"),healer := V48Actor("Healer1")
    V673LifecycleFeed(V671FloorLine(101000,V48Field("Healer1"),actor,"0","836045448945472","836045448945493"))
    V48Assert(NBCandleActorKnownDead(actor) && !NBCandleActorKnownDead(healer),"identity-only Death belongs to target, not its named source")
    V673LifecycleFeed(V671FloorLine(101001,actor,"=","0","836045448945472","836045448945494"))
    V48Assert(!NBCandleActorKnownDead(actor) && NBCandle.Players[actor].RevivedAt=101001,"identity-only self Revived is credible without inventing HP")
    V673LifecycleFeed(V671FloorLine(101002,V48Field("Healer1"),actor,"0","836045448945472","836045448945493"))
    V673LifecycleFeed(V671FloorLine(101003,V48Field("Healer1"),actor,"0","836045448945472","836045448945494"))
    V48Assert(!NBCandleActorKnownDead(actor) && !NBCandleActorKnownDead(healer),"targeted Revived releases recipient while leaving healer life unchanged")
    V48Assert(!NBCandleActorKnownDead("@Unknown#9999"),"absence from tracker is unknown, not evidence of death")
}

V673LifecycleSingleDeath() => V673LifecycleFixture(V673LifecycleSingleDeathCase)
V673LifecycleSingleDeathCase()
{
    global NBCandle,NBOrder,NBRebounder
    actor := V48Actor("Tank1")
    V673LifecycleFeed(V671FloorLine(101000,V49Boss(),V48Field("Tank1",0),"0","836045448945477","836045448945501"," (100)"))
    V48Assert(NBCandleActorKnownDead(actor),"zero-HP snapshot rejects the player even without Death event")
    V673LifecycleFeed(V671FloorLine(101001,V48Field("Tank1",20),"=","0","836045448945477","836045448945500"," (20)"))
    V48Assert(!NBCandleActorKnownDead(actor),"snapshot-only zero does not manufacture an explicit-death tombstone")
    V673LifecycleFeed(V671FloorLine(101002,V49Boss(),V48Field("Tank1",20),"0","836045448945472","836045448945493"))
    V673LifecycleFeed(V671FloorLine(101003,V48Field("Tank1",20),"","0","836045448945472","836045448945490"))
    V48Assert(NBCandleActorKnownDead(actor) && !NBCandle.Ended && !NBOrder.Ended && !NBRebounder.Ended,"one player Death and ExitCombat do not end the raid")
}

V673LifecyclePrepareCleanup()
{
    global NBFloorOptions
    NBFloorOptions.Enabled := false ; shared lifecycle must not require floor audio
    V673LifecycleFeed(V671FloorLine(78870000,V49Boss(),"=","0","836045448945477","836045448945501"," (0)"))
    for line in StrSplit(V673LifecycleRecord("cleanup"),"`n","`r") {
        if Trim(line)=""
            continue
        RegExMatch(line,"^\[[^\]]+\] \[\] \[([^\]]+)\]",&m)
        alive := RegExReplace(m[1],"\|\(\d+/\d+\)$","|(100/100)")
        ; Synthetic prior applications establish the seven observed recipients.
        V673LifecycleFeed(V671FloorLine(78870001,V671FloorChamber(),alive,"4133502295474176","836045448945477","4133502295474475"))
    }
}

V673LifecycleWipe() => V673LifecycleFixture(V673LifecycleWipeCase)
V673LifecycleWipeCase()
{
    global NBCandle,NBOrder,NBRebounder,NBFloor,NBFloorOptions,Audio,IP
    V673LifecyclePrepareCleanup()
    V673LifecycleFeed(V673LifecycleRecord("death")),V673LifecycleFeed(V673LifecycleRecord("fear"))
    rows := StrSplit(V673LifecycleRecord("cleanup"),"`n","`r")
    Loop rows.Length-1
        V673LifecycleFeed(rows[A_Index])
    V48Assert(!NBCandle.Ended && !NBFloor.Ended,"six of seven removals are insufficient for confirmed group cleanup")
    Audio.Queue := [{Kind:"Boss",Key:"NahutCandleNext"},{Kind:"Boss",Key:"NahutOrderNext"},
        {Kind:"Boss",Key:"NahutRebounder"},{Kind:"Universal",Key:"Unrelated"}]
    Audio.Current := {Kind:"Boss",Key:"NahutRebounder",Cancel:false}
    NBCandle.Choice := {Actor:"@DoubleCloseDPS#102"},NBOrder.Delivery := {Completed:false}
    NBRebounder.Pending := {Attempted:false},NBRebounder.Active := {Done:true},NBRebounder.Assignment := {}
    V673LifecycleFeed(rows[rows.Length])
    V48Assert(!NBFloorOptions.Enabled && NBFloor.Ended && NBCandle.Ended && NBOrder.Ended && NBRebounder.Ended,"seven-recipient actual cleanup ends all controllers while floor audio is off")
    V48Assert(!NBCandle.Burn && NBCandle.EndAt=78889190 && NBFloor.Blocked,"shared end retains actual cleanup watermark and floor stop latch")
    V48Assert(!IsObject(NBCandle.Choice) && !IsObject(NBOrder.Delivery) && !IsObject(NBRebounder.Pending)
        && !IsObject(NBRebounder.Active) && !IsObject(NBRebounder.Assignment),"wipe retires obsolete choices and pending Slice state")
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Key="Unrelated" && Audio.Current.Cancel,"wipe removes owned queued calls and requests active owned audio stop only")
    V48Assert(!IP.Active,"shared wipe recognition is independent of statistics collection")
}

V673LifecycleWipeNegatives() => V673LifecycleFixture(V673LifecycleWipeNegativesCase)
V673LifecycleWipeNegativesCase()
{
    global NBCandle,NBOrder,NBRebounder,NBFloor
    V673LifecyclePrepareCleanup()
    zeros := 0
    for line in StrSplit(V673LifecycleRecord("cleanup"),"`n","`r") {
        if InStr(line,"|(0/") && ++zeros>1
            line := StrReplace(line,"|(0/","|(1/")
        V673LifecycleFeed(line)
    }
    V48Assert(!NBFloor.Ended && !NBCandle.Ended && !NBOrder.Ended && !NBRebounder.Ended,"whole removal with only one zero-HP recipient cannot establish a wipe")
    before := NBCandle.At
    V48Assert(!EndNBCandleEncounter("wrong instance",before,"other") && !NBCandle.Ended,"another instance cannot close current encounter")
    V48Assert(!EndNBCandleEncounter("late old cleanup",before-1,"999") && !NBCandle.Ended,"older cleanup cannot close a newer observed state")
    V48Assert(NBCandle.At=before,"rejected shared end does not move state watermark")
}

V673LifecycleTailReset() => V673LifecycleFixture(V673LifecycleTailResetCase)
V673LifecycleTailResetCase()
{
    global NBCandle,NBOrder,NBRebounder,NBFloor,Audio
    V673LifecyclePrepareCleanup()
    for line in StrSplit(V673LifecycleRecord("cleanup"),"`n","`r")
        V673LifecycleFeed(line)
    serial := NBRebounder.Serial
    V673LifecycleFeed(V673LifecycleRecord("slice")),V673LifecycleFeed(V673LifecycleRecord("last-death"))
    V673LifecycleFeed(V671FloorLine(78890000,"@DoubleCloseDPS#102|(0,0,0,0)|(100/100)","=","0","836045448945472","836045448945494"))
    PollNBCandle(),PollNBOrder(),PollNBRebounder()
    V48Assert(NBCandle.Ended && NBOrder.Ended && NBRebounder.Ended && NBRebounder.Serial=serial && Audio.Queue.Length=0,"fatal tail Slice and later player revival cannot offer another assignment after wipe")
    V673LifecycleFeed(V671FloorLine(78869000,V671FloorBoss(1000),"=","0","836045448945472","836045448953669"))
    V48Assert(NBCandle.Ended && NBFloor.Ended && NBCandle.BossInstance="999","delayed old full-health target-clear cannot reset ended pull")
    V673LifecycleFeed(V671FloorLine(78900000,V671FloorBoss(1000,"1000"),"@DoubleCloseDPS#102|(0,0,0,0)|(100/100)","0","836045448945472","836045448953668"))
    V48Assert(!NBCandle.Ended && !NBOrder.Ended && !NBRebounder.Ended && !NBFloor.Ended && NBCandle.BossInstance="1000","genuinely newer boss instance starts a fresh encounter")
    V48Assert(!NBCandleActorKnownDead("@DoubleCloseDPS#102") && NBCandle.Players["@DoubleCloseDPS#102"].DeathAt<0,"new encounter cannot inherit former player death latch")
}

V673LifecycleManualStop() => V673LifecycleFixture(V673LifecycleManualStopCase)
V673LifecycleManualStopCase()
{
    global NBCandle,NBOrder,NBRebounder,NBFloor,NBFloorOptions
    V671FloorArm(),StopNBFloor("isolated manual stop")
    V48Assert(NBFloor.Blocked && !NBCandle.Ended && !NBOrder.Ended && !NBRebounder.Ended,"manual floor stop never ends other Nahut controllers")
    SetNBFloorPreference(false),SetNBFloorPreference(true)
    V48Assert(!NBCandle.Ended && !NBOrder.Ended && !NBRebounder.Ended,"floor preference changes retain whole-encounter state")
    V673LifecycleFeed(V671FloorLine(101000,V49Boss(),V48Field("DoubleCloseDPS",10),"0","836045448945472","836045448945493"))
    V673LifecycleFeed(V671FloorLine(102000,V671FloorBoss(1000),"=","0","836045448945472","836045448953669"))
    V48Assert(!NBCandleActorKnownDead("@DoubleCloseDPS#102") && !NBCandle.Ended,"later same-instance full-health reset also discards old life state")
}

V673LifecycleRecord(kind)
{
    ; Original Oct1 records126248,126279,126614–626. Only player names/IDs and
    ; boss instance ID anonymized. Exact timestamps, coordinates, HP and events retained.
    switch kind {
        case "death": return "[21:54:36.051] [NAHUT {4122949560827904}:999|(-384.98,2641.83,207.91,-44.79)|(1911732/36514284)] [@DoubleCloseDPS#102|(-381.02,2637.72,207.91,-123.30)|(11173/442490)] [] [Event {836045448945472}: Death {836045448945493}]"
        case "fear": return "[21:54:36.925] [NAHUT {4122949560827904}:999|(-384.98,2641.83,207.91,-44.79)|(1880302/36514284)] [@DoubleCloseDPS#102|(-381.02,2637.72,207.91,-123.30)|(11173/442490)] [ {4123520791478272}] [ApplyEffect {836045448945477}: Instinctual Fear {4123520791478576}]"
        case "slice": return "[21:54:49.195] [] [@DoubleFarDPS#104|(-367.01,2620.26,207.91,158.39)|(0/443752)] [Energized Slice {4137075708264448}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (184125 ~108136 energy {836045448940874}) <184125.0>"
        case "last-death": return "[21:54:49.195] [] [@DoubleFarDPS#104|(-367.01,2620.26,207.91,158.39)|(0/443752)] [] [Event {836045448945472}: Death {836045448945493}]"
        case "cleanup": return "
(
[21:54:49.189] [] [@Mara#101|(-380.81,2635.99,207.91,-162.43)|(4772/441822)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.189] [] [@Healer1#105|(-372.08,2627.36,207.91,142.08)|(0/435022)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.189] [] [@Healer2#106|(-367.82,2626.16,207.91,-142.35)|(0/443634)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.190] [] [@Tank1#108|(-379.60,2641.23,207.91,-161.34)|(0/496956)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.190] [] [@Tank2#107|(-365.95,2620.84,207.91,-33.56)|(0/491621)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.190] [] [@DoubleFarDPS#104|(-367.01,2620.26,207.91,158.39)|(0/443752)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
[21:54:49.190] [] [@DoubleCloseDPS#102|(-381.02,2637.72,207.91,-123.30)|(11173/442490)] [Singularity Core {4133502295474176}] [RemoveEffect {836045448945478}: Oppressive Gravity {4133502295474475}]
)"
    }
    throw Error("Unknown lifecycle fixture: " kind)
}

; Native v68 timeline checks. Private synthetic records only; no live listeners.
V68TimelineReceived() => V68TimelineReceivedImpl()
V68TimelineUnknownHealing() => V68TimelineUnknownHealingImpl()
V68TimelineEffects() => V68TimelineEffectsImpl()
V68TimelineLife() => V68TimelineLifeImpl()
V68TimelineSameMillisecond() => V68TimelineSameMillisecondImpl()
V68TimelineLateRecords() => V68TimelineLateRecordsImpl()
V68TimelineRangeAndCasts() => V68TimelineRangeAndCastsImpl()
V68TimelineNativeBitmap() => V68TimelineNativeBitmapImpl()
V68TimelineParserJournal() => V68TimelineParserJournalImpl()
V68TimelineRevivalEvidence() => V68TimelineRevivalEvidenceImpl()
V68TimelineCancellation() => V68ReviewRun(V68TimelineCancellationImpl)
V68TimelinePhaseEdge() => V68TimelinePhaseEdgeImpl()

V68TimelineData(last := 10000)
{
    return {Start:0,Last:last,Rows:[],Seed:Map(),Profile:"",BossKey:"",Actors:Map(),Effects:[]}
}

V68TimelineAdd(d,line,accepted := true)
{
    ev := V59Parsed(line,-1,d.Rows.Length+1,accepted),x := ev.Analysis
    if ev.Kind="Damage"
        x.T := ev.Amount
    if ev.Kind="Heal"
        x.H := ev.Amount,x.E := Max(0,ev.Effective),x.HealUnknown := ev.Effective<0
    if ev.Kind="Death"
        x.Death := 1
    d.Rows.Push(ev)
    return ev
}

V68TimelineEffect(at,id := "814218425139459",name := "Energy Shield",action := "apply",ability := "814218425139200",source := "@Tank#68")
{
    mode := action="remove" ? "RemoveEffect {836045448945478}" : "ApplyEffect {836045448945477}"
    return "[" IPStamp(at) "] [" source "|(0,0,0,0)|(100/100)] [@Tank#68|(0,0,0,0)|(100/100)] [" name " {" ability "}] [" mode ": " name " {" id "}] ()"
}

V68TimelineReceivedImpl()
{
    d := V68TimelineData()
    V68TimelineAdd(d,IPDemoLine(1000,"Boss {1}:1","@Tank#68","Damage",100))
    V68TimelineAdd(d,IPDemoLine(1000,"Boss {1}:1","@Tank#68","Damage",100))
    V68TimelineAdd(d,IPDemoLine(2000,"@Healer#69","@Tank#68","Heal",150,false,80))
    V68TimelineAdd(d,IPDemoLine(2000,"@Tank#68","@Healer#69","Heal",800,false,700))
    V68TimelineAdd(d,IPDemoLine(3000,"Boss {1}:1","@Tank#68","Damage",999),false)
    V68TimelineAdd(d,IPDemoLine(3000,"Boss {1}:1","@Other#70","Damage",999))
    m := IADTimeline(d,IANewQuery(d,"@Tank#68"))
    V48Assert(m.TotalTaken=200 && m.TotalHealing=80,"received metrics preserve identical accepted hits, exclude rejected/outgoing/other-player results")
    V48Assert(m.Events.Length=3 && m.Bins[2].Taken=200 && m.Bins[3].Healing=80,"timeline retains event evidence and time buckets")
    V48Assert(d.Rows[1].Analysis.T=100 && d.Rows.Length=6,"timeline leaves analysis data unchanged")
    V59ExpectError((*)=>IADTimeline(d,IANewQuery(d)))
}

V68TimelineUnknownHealingImpl()
{
    d := V68TimelineData(),V68TimelineAdd(d,IPDemoLine(1000,"@Healer#69","@Tank#68","Heal",150,false,-1))
    d.Partial := true
    m := IADTimeline(d,IANewQuery(d,"@Tank#68"))
    V48Assert(m.TotalHealing=0 && m.UnknownHealing=1 && m.Events[1].Unknown,"raw healing never impersonates effective healing when amount is unavailable")
    V48Assert(InStr(m.Events[1].Detail,"150") && m.Bins[2].HealingUnknown=1,"missing-effective event retains raw amount and marks bucket")
    partialNote := false
    for note in m.Notes
        partialNote := partialNote || note="Partial recording: missing events are unknown."
    V48Assert(partialNote,"timeline discloses incomplete source coverage independently of healing availability")
}

V68TimelineEffectsImpl()
{
    d := V68TimelineData()
    seed := V59Parsed(V68TimelineEffect(0),0,1),seed.Analysis.At := -1000
    d.Seed[IAEffectKey(seed)] := seed
    V68TimelineAdd(d,V68TimelineEffect(1000))
    V68TimelineAdd(d,V68TimelineEffect(1000))
    V68TimelineAdd(d,V68TimelineEffect(4000,,,,"999", "@Other#70"))
    V68TimelineAdd(d,V68TimelineEffect(5000,,,"remove"))
    V68TimelineAdd(d,V68TimelineEffect(6000,"123456","Custom Defense","apply","111111"))
    V68TimelineAdd(d,V68TimelineEffect(7000,"654321","Orphan removal","remove","222222"))
    V68TimelineAdd(d,V68TimelineEffect(8000,"555555","Rejected","apply","333333"),false)
    m := IADTimeline(d,IANewQuery(d,"@Tank#68"))
    V48Assert(m.Lanes.Length=1 && m.Lanes[1].Spans.Length=2,"same effect refreshes one span; different caster preserves separate provenance")
    V48Assert(m.Lanes[1].Spans[1].PrePull && m.Lanes[1].Spans[1].Refreshes=2 && m.Lanes[1].Spans[1].Start=-1000,"pre-pull seed and refresh history preserved")
    V48Assert(m.Available.Length=3,"all observed effect identities selectable, rejected application absent")
    custom := IADTimeline(d,IANewQuery(d,"@Tank#68"),"123456")
    V48Assert(custom.Lanes.Length=1 && custom.Lanes[1].Spans[1].OpenEnd,"unrecognized class effect can be selected without an invented duration")
    orphan := IADTimeline(d,IANewQuery(d,"@Tank#68"),"654321")
    V48Assert(orphan.Lanes[1].Spans[1].MissingStart && orphan.Lanes[1].Spans[1].Start=orphan.Lanes[1].Spans[1].End,"orphan removal remains a point, not a made-up uptime bar")
}

V68TimelineLifeImpl()
{
    d := V68TimelineData()
    V68TimelineAdd(d,V68TimelineEffect(1000))
    V68TimelineAdd(d,IPDemoLine(2000,"Boss {1}:1","@Tank#68","Death"))
    V68TimelineAdd(d,V68TimelineEffect(2100)) ; stale positive HP is not a revival
    V68TimelineAdd(d,IPDemoLine(2200,"@Healer#69","@Tank#68|(0,0,0,0)|(100/100)","Heal",20,false,20))
    V68TimelineAdd(d,V68TimelineEffect(2300))
    V68TimelineAdd(d,IPDemoLine(3000,"@Tank#68|(0,0,0,0)|(100/100)","=","Activate",0,false,-1,"Energy Shield","814218425139200"))
    V68TimelineAdd(d,V68TimelineEffect(3100))
    V68TimelineAdd(d,V68TimelineEffect(5000,,,"remove"))
    m := IADTimeline(d,IANewQuery(d,"@Tank#68")),spans := m.Lanes[1].Spans
    V48Assert(spans.Length=2 && spans[1].End=2000 && spans[1].EndedByDeath,"explicit death ends all active defenses")
    V48Assert(spans[2].Start=3100 && spans[2].End=5000,"only actual new-life activation restores later effect tracking, not stale effect/heal snapshots")
    V48Assert(IADActiveAt(m,2400).Length=0 && IADActiveAt(m,4000).Length=1,"life gap never painted as continuous defensive uptime")
    V48Assert(m.Deaths.Length=1 && m.Casts.Length=1,"death and observed defensive cast remain selectable")
}

V68TimelineSameMillisecondImpl()
{
    d := V68TimelineData()
    V68TimelineAdd(d,V68TimelineEffect(1000))
    first := V68TimelineAdd(d,IPDemoLine(2000,"Boss {1}:1","@Tank#68","Damage",100))
    V68TimelineAdd(d,V68TimelineEffect(2000,,,"remove"))
    last := V68TimelineAdd(d,IPDemoLine(2000,"Boss {1}:1","@Tank#68","Damage",100))
    m := IADTimeline(d,IANewQuery(d,"@Tank#68"))
    V48Assert(IADActiveAt(m,2000,first.Analysis.Seq).Length=1 && IADActiveAt(m,2000,last.Analysis.Seq).Length=0,"same-ms removal distinguishes preceding/following hits by sequence")
}

V68TimelinePhaseEdgeImpl()
{
    d := V68TimelineData()
    gain := V68TimelineAdd(d,V68TimelineEffect(4000)),gain.RecordId := 18
    hit := V68TimelineAdd(d,IPDemoLine(4000,"Boss {1}:1","@Tank#68","Damage",80)),hit.RecordId := 19
    after := V68TimelineAdd(d,V68TimelineEffect(4000,"222222","After phase","apply","111111")),after.RecordId := 21
    q := IANewQuery(d,"@Tank#68",2,4)
    q.PhaseBoundary := {Start:2000,StartSeq:10,IncludeStart:true,End:4000,EndSeq:20,OpenEnd:false}
    m := IADTimeline(d,q)
    V48Assert(m.TotalTaken=80 && m.Available.Length=1,"phase end retains earlier same-ms effect/hit while excluding later recorded application")
    V48Assert(IADActiveAt(m,hit.Analysis.At,hit.Analysis.Seq).Length=1,"selected phase's final hit still sees its immediately preceding defense")
    V48Assert(m.Events[1].Seq=2 && m.Events[1].BoundarySeq=19,"focus keeps capture-sequence and phase RecordId as distinct identities")
    plain := IADTimeline(d,IANewQuery(d,"@Tank#68",2,4))
    V48Assert(plain.TotalTaken=0 && plain.Available.Length=0,"ordinary half-open range does not inherit phase-only endpoint inclusion")
}

V68TimelineLateRecordsImpl()
{
    d := V68TimelineData()
    V68TimelineAdd(d,V68TimelineEffect(3000,,,"remove"))
    V68TimelineAdd(d,V68TimelineEffect(1000))
    V68TimelineAdd(d,IPDemoLine(2500,"Boss {1}:1","@Tank#68","Damage",25))
    V68TimelineAdd(d,IPDemoLine(1500,"Boss {1}:1","@Tank#68","Damage",15))
    m := IADTimeline(d,IANewQuery(d,"@Tank#68")),span := m.Lanes[1].Spans[1]
    V48Assert(m.Lanes[1].Spans.Length=1 && span.Start=1000 && span.End=3000,"late application pairs at its actual clock with later removal")
    V48Assert(m.Events[1].At=1500 && m.Events[2].At=2500 && d.Rows[1].Analysis.At=3000,"event table chronological order is private and retains original source sequence")
}

V68TimelineRangeAndCastsImpl()
{
    d := V68TimelineData(5000)
    V68TimelineAdd(d,IPDemoLine(1000,"@Tank#68","=","Activate",0,false,-1,"Energy Shield","814218425139200"))
    V68TimelineAdd(d,IPDemoLine(1000,"@Tank#68","=","Activate",0,false,-1,"Energy Shield","814218425139200"))
    V68TimelineAdd(d,IPDemoLine(2000,"Boss {1}:1","@Tank#68","Damage",20))
    V68TimelineAdd(d,IPDemoLine(3000,"Boss {1}:1","@Tank#68","Damage",30))
    V68TimelineAdd(d,IPDemoLine(5000,"Boss {1}:1","@Tank#68","Damage",50))
    m := IADTimeline(d,IANewQuery(d,"@Tank#68")),part := IADTimeline(d,IANewQuery(d,"@Tank#68",2,3))
    V48Assert(m.Casts.Length=1 && m.Lanes.Length=0,"duplicate activation point has no inferred active duration")
    V48Assert(m.TotalTaken=100 && part.TotalTaken=20,"subrange end is exclusive; actual fight endpoint included")
    draw := IADLayout(m,900,300),x := IADX(m,draw.Rect,2000),hit := IADHitTest(m,draw,x,draw.Rect.T+5)
    V48Assert(hit.Event.At=2000 && hit.Event.Amount=20,"plot click selects exact damage evidence")
    V48Assert(!IsObject(IADHitTest(m,draw,0,0)),"off-plot clicks do not manufacture a timestamp")
}

V68TimelineNativeBitmapImpl()
{
    d := V68TimelineData(),V68TimelineAdd(d,V68TimelineEffect(1000)),V68TimelineAdd(d,IPDemoLine(1500,"Boss {1}:1","@Tank#68","Damage",80))
    m := IADTimeline(d,IANewQuery(d,"@Tank#68"))
    for size in [[900,300,1],[1400,500,1.5],[300,180,1],[1000,170,1],[1500,255,1.5]] {
        draw := IADDraw(m,size[1],size[2],size[3])
        try {
            b := Buffer(A_PtrSize=8 ? 32 : 24),ok := DllCall("Gdi32\GetObjectW","Ptr",draw.Bitmap,"Int",b.Size,"Ptr",b)
            V48Assert(ok && NumGet(b,4,"Int")=size[1] && NumGet(b,8,"Int")=size[2],"native GDI bitmap has requested actual dimensions")
            V48Assert(draw.Rect.L>=0 && draw.Rect.R<=draw.Width && draw.Rect.T<draw.Rect.B && draw.Rect.B<draw.Height,"plot dimensions remain inside the image")
            if size[2]/size[3]>=170
                V48Assert(draw.Lanes.Length>=1,"minimum review-window chart still displays a selected defensive effect lane")
            for hit in draw.Lanes
                V48Assert(hit.T>=draw.Rect.B && hit.B<draw.Height,"effect lanes stay within bitmap bounds")
            dc := DllCall("Gdi32\CreateCompatibleDC","Ptr",0,"Ptr"),old := DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",draw.Bitmap,"Ptr")
            try {
                pixel := DllCall("Gdi32\GetPixel","Ptr",dc,"Int",Round(IADX(m,draw.Rect,1500)),"Int",Round(draw.Rect.T),"UInt")
                V48Assert(pixel=IUBColorRef("C65370"),"native bitmap contains the actual damage peak in its mapped position")
            }
            finally {
                DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",old),DllCall("Gdi32\DeleteDC","Ptr",dc)
            }
        }
        finally DllCall("Gdi32\DeleteObject","Ptr",draw.Bitmap)
    }
}

V68TimelineRevivalEvidenceImpl()
{
    for kind in ["Enter","Revived"] {
        d := V68TimelineData(),V68TimelineAdd(d,V68TimelineEffect(1000))
        V68TimelineAdd(d,IPDemoLine(2000,"Boss {1}:1","@Tank#68","Death"))
        if kind="Enter"
            line := IPDemoLine(3000,"@Tank#68|(0,0,0,0)|(50/100)","=","Enter")
        else
            line := "[00:00:03.000] [@Healer#69] [@Tank#68|(0,0,0,0)|(50/100)] [] [Event {836045448945472}: Revived {836045448945494}] ()"
        V68TimelineAdd(d,line),V68TimelineAdd(d,V68TimelineEffect(3100))
        m := IADTimeline(d,IANewQuery(d,"@Tank#68"))
        V48Assert(m.Lanes[1].Spans.Length=2 && m.Lanes[1].Spans[2].Start=3100,"positive " kind " returns a later life without carrying old defenses across death")
    }
}

V68TimelineCancellationImpl()
{
    d := V68TimelineData(),line := IPDemoLine(1000,"Boss {1}:1","@Tank#68","Damage",1)
    Loop 300
        V68TimelineAdd(d,line)
    control := {Cancel:false},job := IGRBegin("Defensive timeline",V68ReviewCancelAssembly.Bind(control),control)
    result := "previous complete result",failed := false
    try result := IADTimeline(d,IANewQuery(d,"@Tank#68"))
    catch Error as err
        failed := InStr(err.Message,"canceled")>0
    finally IGREnd(job)
    V48Assert(failed && result="previous complete result" && !IGRIsBusy(),"timeline cooperates with the review Cancel job without publishing a partial result")
    V48Assert(d.Rows.Length=300 && d.Rows[1].Analysis.At=1000,"cancellation leaves captured rows intact")
}

V68TimelineParserJournalImpl()
{
    s := V6415CData(),s.AnalysisCapture := IACaptureNew(0,10000)
    V66PhaseAdd(s,1000,"Damage",50,"@Tank#68")
    V66PhaseApplyLine(s,V68TimelineEffect(1500),1500)
    V66PhaseAdd(s,2000,"Damage",100,"Boss {1}:1","@Tank#68")
    V66PhaseApplyLine(s,V68TimelineEffect(3000,,,"remove"),3000)
    V66PhaseAdd(s,4000,"Damage",50,"@Tank#68")
    d := IAAssemble(s,s.Current,s.AnalysisCapture),m := IADTimeline(d,IANewQuery(d,"@Tank#68"))
    V48Assert(m.Lanes.Length=1 && m.Lanes[1].Spans[1].Start=1500 && m.Lanes[1].Spans[1].End=3000,"actual parser acceptance journal includes effect observations")
    V48Assert(m.TotalTaken=s.Current.Totals["@Tank#68"].Taken,"timeline damage reconciles with real parser acceptance")
}

; Native tests use only private synthetic files and parser state.
V68ReviewRun(fn) => V591Isolated(V68ReviewRunBody.Bind(fn))
V68ReviewRunBody(fn)
{
    global IP,COMBAT_LOG_ENCODING
    savedEncoding := COMBAT_LOG_ENCODING,COMBAT_LOG_ENCODING := "UTF-8"
    try fn.Call()
    finally {
        COMBAT_LOG_ENCODING := savedEncoding
        state := IGRModelState(),state.Busy := false,state.Job := ""
    }
}

V68ReviewFile(many := false)
{
    static serial := 0
    serial += 1
    path := A_Temp "\Iris-v68-review-" A_TickCount "-" serial ".txt"
    lines := [],owner := "@Demo Tank#101|(0,0,0,0)|(90000/100000)",enemy := "Test target {990000000009999}:8"
    if many {
        Loop 70 {
            at := A_Index*40000
            lines.Push(IPDemoLine(at,owner,"=","Enter"))
            lines.Push(IPDemoLine(at+1000,owner,enemy,"Damage",25))
            lines.Push(IPDemoLine(at+2000,owner,"=","Exit"))
        }
    }
    for line in IADemoLines()
        lines.Push(line)
    lines.Push(IPDemoLine(3621000,owner,"=","Exit"))
    s := IPNewData("PRIVATE TEST SOURCE"),text := ""
    for line in lines
        IPFeedLine(s,line),text .= line "`r`n"
    IPFinalizeData(s,"progression review snapshot complete")
    p := IPRCompact(s.Segments[s.Segments.Length]),id := IGVSourceIdentity(path)
    FileAppend(text,path,"UTF-8")
    return {Path:path,State:s,Entry:{Key:"private-review-test",Session:id.Session,Date:"20261003",Team:"",Pull:p}}
}

V68ReviewLoadExact() => V68ReviewRun(V68ReviewLoadExactBody)
V68ReviewLoadExactBody()
{
    global IP,Audio
    f := V68ReviewFile(),a := IAState(),beforeData := a.Data,beforeGeneration := a.Generation
    original := IP.Live,queue := Audio.Queue,expected := IGVJson(IGVPackPull(f.Entry.Pull,false))
    try {
        data := IGRLoadEntry(f.Entry,f.Path)
        V48Assert(data.BaseVerified && data.Path=f.Path && data.Rows.Length>100,"exact original produces full accepted private dataset")
        V48Assert(data.Start=f.Entry.Pull.Start && data.Last=f.Entry.Pull.End,"no shifted or nearby boundaries")
        V48Assert(data.Players.Length=3 && data.Phases[1].Name="Whole fight","recorded participants and explicit whole phase available")
        V48Assert(a.Data=beforeData && a.Generation=beforeGeneration && IP.Live=original && Audio.Queue=queue,"loading does not install Analysis, parser or audio state")
        V48Assert(IGVJson(IGVPackPull(f.Entry.Pull,false))=expected,"selected compact history remains byte-identical")
        V48Assert(!IGRIsBusy(),"loader releases ownership after success")
    }
    finally FileDelete(f.Path)
}

V68ReviewRejectMismatch() => V68ReviewRun(V68ReviewRejectMismatchBody)
V68ReviewRejectMismatchBody()
{
    f := V68ReviewFile()
    try {
        wrong := IPRCloneSnapshot(f.Entry),wrong.Pull.Start += 1,failed := false
        try IGRLoadEntry(wrong,f.Path)
        catch Error as err
            failed := InStr(err.Message,"exact selected pull")>0
        V48Assert(failed && !IGRIsBusy(),"one millisecond boundary mismatch rejected without nearest-pull guess")
        wrong := IPRCloneSnapshot(f.Entry),who := "@Demo DPS#102",wrong.Pull.Players[who].Deaths += 1,failed := false
        try IGRLoadEntry(wrong,f.Path)
        catch Error as err
            failed := InStr(err.Message,"death history differs")>0
        V48Assert(failed && !IGRIsBusy(),"compact player death mismatch rejects details")
        wrong := IPRCloneSnapshot(f.Entry),wrong.Pull.Players.Delete(who),failed := false
        try IGRLoadEntry(wrong,f.Path)
        catch Error as err
            failed := InStr(err.Message,"attendance differs")>0
        V48Assert(failed,"missing participant cannot become a plausible matched review")
    }
    finally FileDelete(f.Path)
}

V68ReviewCancelService(control,progress)
{
    if progress.Records>=64
        control.Cancel := true
}
V68ReviewCancelAndConflict() => V68ReviewRun(V68ReviewCancelAndConflictBody)
V68ReviewCancelAndConflictBody()
{
    f := V68ReviewFile(),control := {Cancel:false},a := IAState()
    try {
        failed := false
        try IGRLoadEntry(f.Entry,f.Path,V68ReviewCancelService.Bind(control),control)
        catch Error as err
            failed := InStr(err.Message,"canceled")>0
        V48Assert(failed && !IGRIsBusy(),"cancel stops private loading and releases file/ownership")
        moved := f.Path ".moved",FileMove(f.Path,moved),FileMove(moved,f.Path)
        V48Assert(FileExist(f.Path),"canceled file handle is closed")
        a.Busy := true,failed := false
        try IGRLoadEntry(f.Entry,f.Path)
        catch Error as err
            failed := InStr(err.Message,"Analysis operation")>0
        finally a.Busy := false
        V48Assert(failed && !IGRIsBusy(),"concurrent Analysis blocks private loading without state capture")
        job := IGRBegin("test"),nested := false
        try IGRBegin("nested")
        catch Error
            nested := true
        finally IGREnd(job)
        V48Assert(nested && !IGRIsBusy(),"nested review cannot replace ownership")
    }
    finally FileDelete(f.Path)
}

V68ReviewLongSession() => V68ReviewRun(V68ReviewLongSessionBody)
V68ReviewLongSessionBody()
{
    f := V68ReviewFile(true)
    try {
        data := IGRLoadEntry(f.Entry,f.Path)
        V48Assert(data.Start=3600000 && data.Players.Length=3,"pull after seventy earlier pulls loads by exact identity")
        V48Assert(data.SourceLines>300 && data.Rows.Length<200,"full source replay retains only selected event window")
        V48Assert(!IGRIsBusy(),"long-session private replay releases ownership")
    }
    finally FileDelete(f.Path)
}

V68ReviewRaidPlayersOnly() => V68ReviewRun(V68ReviewRaidPlayersOnlyBody)
V68ReviewRaidPlayersOnlyBody()
{
    d := IADemoData(),phase := IAPhaseChoices(d)[1]
    expectedD := 0,expectedTaken := 0
    for key,t in d.Totals {
        if d.Actors[key].Kind="Player"
            expectedD += t.Damage,expectedTaken += t.Taken
    }
    compare := IGRCompare(d,"",phase,d,"@Demo DPS#102",phase)
    V48Assert(compare.A.D=expectedD && compare.A.T=expectedTaken,"whole raid excludes outgoing NPC damage and incoming boss damage")
    V48Assert(compare.A.D=36000 && compare.B.D=30000,"raid/player comparison uses accepted damage")
    V48Assert(compare.A.Casts=25 && compare.B.Casts=25,"raid casts count players only")
    V48Assert(compare.A.H=16000 && compare.A.E=10000,"direct/effective healing remain distinct")
    V48Assert(compare.Curves.Length=20 && compare.Curves[20].At=19,"stable common one-second chart bins")
    V48Assert(compare.Abilities.Length>=2 && compare.Matched,"stable ability join and matching whole-fight selection")
    wrong := IPRCloneSnapshot(d),wrong.ModeId := "unrelated-mode",failed := false
    try IGRCompare(d,"",phase,wrong,"",phase)
    catch Error
        failed := true
    V48Assert(failed,"unrelated difficulty cannot masquerade as matched comparison")
}

V68ReviewEqualWindow() => V68ReviewRun(V68ReviewEqualWindowBody)
V68ReviewEqualWindowBody()
{
    d := IADemoData(),whole := IAPhaseChoices(d)[1]
    short := {Name:"Whole fight",From:0,To:10,Kind:"Whole",First:0,Last:0}
    c := IGRCompare(d,"@Demo DPS#102",whole,d,"@Demo DPS#102",short)
    V48Assert(c.DurationA=10 && c.DurationB=10 && c.A.D=9000 && c.B.D=9000,"equal-duration clips longer side and excludes shared end record")
    c := IGRCompare(d,"@Demo DPS#102",whole,d,"@Demo DPS#102",short,false)
    V48Assert(c.DurationA=20 && c.DurationB=10 && c.Curves[11].DPSB="","independent duration has missing curve beyond short pull, not artificial zero")
    short.Name := "Different recorded phase",c := IGRCompare(d,"",whole,d,"",short)
    V48Assert(!c.Matched && InStr(c.Warnings[1],"not matched"),"unmatched phase explicitly distinguished")
    unknown := false
    try IGRCompare(d,"@Absent#88",whole,d,"",whole)
    catch Error
        unknown := true
    V48Assert(unknown && !IGRIsBusy(),"nonparticipant yields no fabricated zero metrics")
}

V68ReviewSequenceAndEffects() => V68ReviewRun(V68ReviewSequenceAndEffectsBody)
V68ReviewSequenceAndEffectsBody()
{
    f := V66PhaseFixture(),d := f.Data,p := V66PhaseFind(d,"Burn")
    q := IGRPhaseQuery(d,"@Review#66",p,2),r := IGRQuery(d,q)
    V48Assert(r.D=175 && r.H=0,"clipped phase uses accepted order and half-open end boundary")
    d := IADemoData(),q := IGRPhaseQuery(d,"@Demo DPS#102",IAPhaseChoices(d)[1]),r := IGRQuery(d,q)
    buff := r.Effects["990000000000021"]
    V48Assert(buff.Seconds=11 && buff.Percent=55,"refresh intervals union without double-counting buff uptime")
    r := IGRQuery(d,IGRPhaseQuery(d,"",IAPhaseChoices(d)[1]))
    V48Assert(Abs(r.Effects["990000000000021"].Percent-100*11/60)<0.0001,"raid buff percentage uses participant-seconds denominator")
    d := V68TimelineData(),V68TimelineAdd(d,V68TimelineEffect(1000))
    V68TimelineAdd(d,IPDemoLine(2000,"Boss {1}:1","@Tank#68","Death"))
    V68TimelineAdd(d,V68TimelineEffect(3000)),V68TimelineAdd(d,V68TimelineEffect(5000,,,"remove"))
    effects := IGREffects(d,IANewQuery(d,"@Tank#68"),Map("@Tank#68",true))
    V48Assert(effects["814218425139459"].Seconds=1,"comparison buff uptime closes at death and ignores stale living-HP effects")
}

V68ReviewSourceIdentity() => V68ReviewRun(V68ReviewSourceIdentityBody)
V68ReviewSourceIdentityBody()
{
    e := {Session:"20260929_154444_295454",Date:"20260929"}
    V48Assert(IGRSourceSame(e,"C:\logs\Archive-combat_2026-09-29_15_44_44_295454.txt"),"archive and original names share canonical recording identity")
    V48Assert(!IGRSourceSame(e,"C:\logs\combat_2026-09-29_15_44_45_295454.txt"),"adjacent filename does not resolve as selected recording")
    e := {Session:"20261003_raid.txt",Date:"20261003"}
    V48Assert(IGRSourceSame(e,"C:\logs\raid.txt"),"date-qualified custom filename resolves safely")
}

V68ReviewArchiveCandidates() => V68ReviewRun(V68ReviewArchiveCandidatesBody)
V68ReviewArchiveCandidatesBody()
{
    global COMBAT_LOG_FOLDER,currentLogPath,IP
    oldFolder := COMBAT_LOG_FOLDER,oldCurrent := currentLogPath
    folder := A_Temp "\Iris-v68-candidates-" A_TickCount,one := folder "\archive",deep := one "\deep"
    name := "Archive-combat_2025-01-01_01_02_03_987654.txt",file := one "\" name,duplicate := folder "\" name
    deepFile := deep "\" name,entry := {Session:"20250101_010203_987654",Date:"20250101"}
    DirCreate(deep)
    try {
        COMBAT_LOG_FOLDER := folder,currentLogPath := "",IP.ImportPath := ""
        FileAppend("test`n",file,"UTF-8"),FileAppend("test`n",deepFile,"UTF-8")
        found := IGRSourceCandidates(entry)
        V48Assert(found.Length=1 && found[1]=file,"immediate archive folder resolves by filename; deeper directories are not scanned")
        FileAppend("test`n",duplicate,"UTF-8"),found := IGRSourceCandidates(entry)
        V48Assert(found.Length=2,"multiple files remain explicit candidates instead of guessing")
    }
    finally {
        COMBAT_LOG_FOLDER := oldFolder,currentLogPath := oldCurrent
        for path in [file,duplicate,deepFile]
            if FileExist(path)
                FileDelete(path)
        DirDelete(deep),DirDelete(one),DirDelete(folder)
    }
}

V68ReviewStartLive(progress)
{
    global IP
    if progress.Records>=64
        IP.Active := true
}
V68ReviewCancelAssembly(control,progress)
{
    control.Cancel := true
}
V68ReviewPreemption() => V68ReviewRun(V68ReviewPreemptionBody)
V68ReviewPreemptionBody()
{
    global IP
    f := V68ReviewFile(),oldActive := IP.Active
    try {
        IP.Active := true,failed := false
        try IGRLoadEntry(f.Entry,f.Path)
        catch Error as err
            failed := InStr(err.Message,"Stop live parsing")>0
        V48Assert(failed && IP.Active && !IGRIsBusy(),"live guard is enforced by actual runtime path in self-test")
        IP.Active := false,failed := false
        try IGRLoadEntry(f.Entry,f.Path,V68ReviewStartLive)
        catch Error as err
            failed := InStr(err.Message,"another import started")>0
        V48Assert(failed && IP.Active && !IGRIsBusy(),"live start preempts private replay without stopping live collection")
        IP.Active := false,d := IADemoData(),rows := d.Rows.Clone()
        Loop 4
            for row in rows
                d.Rows.Push(row)
        before := d.Effects,control := {Cancel:false},job := IGRBegin("Effect history",V68ReviewCancelAssembly.Bind(control),control),failed := false
        try IAEffectsBuild(d)
        catch Error as err
            failed := InStr(err.Message,"canceled")>0
        finally IGREnd(job)
        V48Assert(failed && d.Effects=before && !IGRIsBusy(),"cooperative assembly cancellation retains last complete effect history")
    }
    finally {
        IP.Active := oldActive
        FileDelete(f.Path)
    }
}

; v68 hidden native Progression review checks. No real logs, audio or settings.
V68ReviewUIEntryPoints() => V68ReviewUIFixture(V68ReviewUIEntryPointsImpl)
V68ReviewUILayout() => V68ReviewUIFixture(V68ReviewUILayoutImpl)
V68ReviewUISelections() => V68ReviewUIFixture(V68ReviewUISelectionsImpl)
V68ReviewUICachedComparison() => V68ReviewUIFixture(V68ReviewUICachedComparisonImpl)
V68ReviewUITimelineFocus() => V68ReviewUIFixture(V68ReviewUITimelineFocusImpl)
V68ReviewUIPhaseFocus() => V68ReviewUIFixture(V68ReviewUIPhaseFocusImpl)
V68ReviewUIPaging() => V68ReviewUIFixture(V68ReviewUIPagingImpl)
V68ReviewUILifecycle() => V68ReviewUIFixture(V68ReviewUILifecycleImpl)
V68ReviewUIFormatting() => V68ReviewUIFormattingImpl()

V68ReviewUIFixture(action)
{
    V61Hidden(V68ReviewUIInner.Bind(action))
}

V68ReviewUIInner(action)
{
    s := IGRVState(),saved := Map()
    for key,value in s.OwnProps()
        saved[key] := value
    s.Gui := "",s.Controls := Map(),s.Entries := [],s.Keys := [],s.Labels := [],s.Busy := false,s.Updating := false
    s.A := {Key:"",Data:"",DataKey:"",Player:"",PlayerKeys:[],Phase:1}
    s.B := {Key:"",Data:"",DataKey:"",Player:"",PlayerKeys:[],Phase:1}
    s.Mode := "compare",s.Control := "",s.CloseAfter := false,s.ParentCloseAfter := false,s.Comparison := ""
    s.Timeline := "",s.TimelineDraw := "",s.TimelineSide := "A",s.Effect := "",s.EffectKeys := [],s.Focus := ""
    s.Events := [],s.Page := 1,s.PageSize := 200,s.DrawFailures := 0,s.Generation := 0
    try {
        IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IGVDemoData(),IGVOpen()
        v := IGVState(),IGVSelect(2),IGRVOpenFromProgression("compare")
        action.Call(s)
    }
    finally {
        s.Busy := false,IGRVClose(),IGVClose()
        extra := []
        for key,value in s.OwnProps()
            if !saved.Has(key)
                extra.Push(key)
        for key in extra
            s.DeleteProp(key)
        for key,value in saved
            s.%key% := value
    }
}

V68ReviewUIDataset(entry)
{
    lines := [],inserted := false,removed := false,died := false
    for line in IADemoLines() {
        at := LogStampMs(line)
        if !inserted && at>=3602000 {
            lines.Push(IPDemoLine(3601500,"@Demo Tank#101","=","Activate",0,false,-1,"Energy Shield","814218425139200"))
            lines.Push(IAEffectLine(3601500,"@Demo Tank#101","@Demo Tank#101","Energy Shield","814218425139459")),inserted := true
        }
        if !removed && at>=3612000
            lines.Push(IAEffectLine(3611500,"@Demo Tank#101","@Demo Tank#101","Energy Shield","814218425139459","remove")),removed := true
        if !died && at>=3619000
            lines.Push(IPDemoLine(3618500,"Operations Training Dummy {2857785339412480}:990001","@Demo Tank#101","Death")),died := true
        lines.Push(line)
    }
    data := IPNewData("SYNTHETIC PROGRESSION REVIEW"),capture := IACaptureNew(3600000,3620000)
    data.AnalysisCapture := capture
    for line in lines
        IPFeedLine(data,line)
    IPCloseSegment(data,"synthetic review"),seg := data.Segments[1],d := IAAssemble(data,seg,capture)
    d.Demo := true,d.BaseVerified := false,d.Players := [],d.Entry := entry,d.Warnings := [],d.Verification := "SYNTHETIC TEST ONLY"
    d.AutomaticPhases := [{Name:"Opening",From:0,To:10,First:0,Last:0,Kind:"Automatic"},
        {Name:"Burn",From:10,To:20,First:0,Last:0,Kind:"Automatic"}]
    d.Phases := IAPhaseChoices(d)
    for key,actor in d.Actors
        if IPBIsPlayer(actor)
            d.Players.Push({Key:key,Name:actor.Name})
    IAEffectsBuild(d),IAShieldsBuild(d)
    return d
}

; Public test/capture setup: the graph and review windows remain hidden.
V68ReviewUILoadedSetup(s,mode := "compare")
{
    s.A.Data := V68ReviewUIDataset(IGRVCurrentEntry("A")),s.A.DataKey := s.A.Key
    s.B.Data := V68ReviewUIDataset(IGRVCurrentEntry("B")),s.B.DataKey := s.B.Key
    s.A.Player := "@Demo Tank#101",s.B.Player := "@Demo DPS#102",s.Updating := true
    try IGRVSyncSide("A"),IGRVSyncSide("B")
    finally s.Updating := false
    s.Mode := mode,s.TimelineSide := "A",IGRVRefresh()
    return s
}

V68ReviewUIEntryPointsImpl(s)
{
    v := IGVState()
    V48Assert(v.Controls.Has("Compare") && v.Controls.Has("Defensive"),"both new reviews are part of the progression graph")
    V48Assert(v.Controls["Compare"].Enabled && v.Controls["Defensive"].Enabled,"selected graph pull enables review actions")
    V48Assert(s.A.Key=IGRVEntryKey(v.Rows[2]) && s.A.Key!=s.B.Key,"review starts from selected pull and a different filtered attempt")
    V48Assert(!IsObject(s.A.Data) && !IsObject(s.B.Data),"opening selects only; no file loads or parser replacement")
    V48Assert(!DllCall("IsWindowVisible","Ptr",s.Gui.Hwnd),"native diagnostic review remains hidden")
    V48Assert(DllCall("User32\GetWindow","Ptr",s.Gui.Hwnd,"UInt",4,"Ptr")=v.Gui.Hwnd,"review is owned by progression")
    IGVRefresh()
    V48Assert(!v.Controls["Compare"].Enabled && !v.Controls["Defensive"].Enabled,"filter refresh clears stale selected-pull actions")
}

V68ReviewUILayoutImpl(s)
{
    for size in [[1000,700],[1120,760],[1460,900]] {
        IGRVResize(s.Gui,0,size[1],size[2]),c := s.Controls
        c["APull"].GetPos(&x,&y,&w,&h),c["ALoad"].GetPos(&lx,&ly,&lw,&lh),c["ALocate"].GetPos(&fx,&fy,&fw,&fh)
        V48Assert(x+w<lx && lx+lw<fx && fx+fw<size[1],"source selector and both explicit load actions fit minimum width")
        c["Chart"].GetPos(&cx,&cy,&cw,&ch),c["EventFilter"].GetPos(&ex,&ey,&ew,&eh)
        c["Events"].GetPos(&rx,&ry,&rw,&rh),c["Detail"].GetPos(&dx,&dy,&dw,&dh),c["Footer"].GetPos(&tx,&ty,&tw,&th)
        V48Assert(cy+ch<ey && ey+eh<=ry && ry+rh<=ty && dy+dh<=ty,"timeline, event toolbar, rows and footer do not overlap")
        V48Assert(rx+rw<dx && dx+dw<size[1],"event rows and detail panel remain side by side")
        c["Abilities"].GetPos(&ax,&ay,&aw,&ah),c["Effects"].GetPos(&bx,&by,&bw,&bh)
        V48Assert(ax+aw<bx && bx+bw<size[1] && ay+ah<ty,"comparison tables fit without covering footer")
    }
    v := IGVState()
    for size in [[900,560],[960,680],[1220,850]] {
        for detail in [false,true] {
            v.DetailVisible := detail,IGVResize(v.Gui,0,size[1],size[2])
            v.Controls["Compare"].GetPos(&cx,&cy,&cw,&ch),v.Controls["Defensive"].GetPos(&dx,&dy,&dw,&dh)
            v.Controls["Mechanics"].GetPos(&mx,&my,&mw,&mh),v.Controls["Status"].GetPos(&sx,&sy,&sw,&sh)
            v.Controls["Rows"].GetPos(&rx,&ry,&rw,&rh)
            V48Assert(cx+cw<dx && dx+dw<mx && mx+mw<size[1],"all three graph review actions fit the existing minimum width")
            V48Assert(sx=14 && sw=size[1]-28 && sy>my+mh && sh>=34 && sy+sh<size[2],"full-width wrapping status has its own nonoverlapping row below graph actions")
            if detail
                V48Assert(ry>sy+sh && ry+rh<=size[2],"expanded table stays below both lines of status")
        }
    }
    IGLState().Busy := true
    try {
        IGLBusyControls()
        V48Assert(!v.Controls["Mechanics"].Enabled,"night mechanics cannot open while Add logs owns progression")
    }
    finally IGLState().Busy := false,IGLBusyControls()
    V48Assert(v.Controls["Mechanics"].Enabled,"night mechanics becomes available when batch ownership ends")
}

V68ReviewUISelectionsImpl(s)
{
    choices := IGRVChoices(IGVState().Rows),before := s.A.Key
    V48Assert(choices.Keys.Length=choices.Entries.Length && choices.Labels.Length=choices.Keys.Length,"stable identity and label arrays stay aligned")
    s.Controls["APull"].Choose(1),IGRVSelectPull("A")
    V48Assert(s.A.Key=choices.Keys[1] && s.A.Key!=before && !IsObject(s.A.Data),"changing pull selects its exact identity without loading")
    a := choices.Entries[1],b := choices.Entries[2],conflict := a.Clone()
    conflict.Conflict := "Unresolved",conflict.Variants := [a,b]
    split := IGRVChoices([conflict])
    V48Assert(split.Keys.Length=2 && InStr(split.Labels[1],"source 1") && InStr(split.Labels[2],"source 2"),"recorder conflict requires explicit original-source choices")
}

V68ReviewUICachedComparisonImpl(s)
{
    V68ReviewUILoadedSetup(s),a := s.A.Data,b := s.B.Data
    V48Assert(IsObject(s.Comparison) && s.Controls["Metrics"].GetCount()=7 && s.Controls["Abilities"].GetCount()>0,"native comparison presents metrics and casts from private datasets")
    for key in ["APull","BPull","APlayer","BPlayer","APhase","BPhase"]
        V48Assert(s.Controls[key].Text!="","native dropdown has a selected caption: " key)
    V48Assert(s.Comparison.A.D!=s.Comparison.B.D && s.DrawFailures=0,"independent player selections produce different totals and a drawable comparison")
    index := IGRVFindKey(s.Keys,s.A.Key),s.Controls["BPull"].Choose(index),IGRVSelectPull("B")
    V48Assert(s.B.Data=s.A.Data && s.B.DataKey=s.A.DataKey,"same pull reuses existing A dataset for player comparison")
    s.Controls["APhase"].Choose(3),IGRVSelectionChanged("A","phase")
    V48Assert(s.A.Phase=3 && s.B.Phase=3 && s.Comparison.DurationA=10 && s.Comparison.DurationB=10,"matching phase names align both sides with equal elapsed duration")
    IGRVSetMode("timeline"),IGRVSetMode("compare")
    V48Assert(s.A.Data=a && s.B.Data=a,"view and phase changes never reread or replace cached data")
    V48Assert(IGRVLoad("A") && s.A.Data=a,"explicit repeated Load returns cached pull")
}

V68ReviewUIPhaseFocusImpl(s)
{
    V68ReviewUILoadedSetup(s,"timeline"),d := s.A.Data,stamp := d.Start+10000,hit := "",heal := ""
    for ev in d.Rows {
        ; Make raw parsed-record IDs explicitly differ from analysis row sequence.
        ev.RecordId := ev.Analysis.Seq+1000
        if ev.Analysis.At=stamp && ev.Target.Key=s.A.Player {
            if ev.Kind="Damage"
                hit := ev
            if ev.Kind="Heal"
                heal := ev
        }
    }
    V48Assert(IsObject(hit) && IsObject(heal),"same-ms fixture has a hit followed by healing")
    d.Phases[2] := {Name:"Boundary phase",From:10,To:20,First:0,Last:0,Kind:"Automatic",
        Boundary:{Start:stamp,StartSeq:hit.RecordId,IncludeStart:false,End:d.Last,EndSeq:0,OpenEnd:true}}
    s.A.Phase := 2,s.Focus := {At:stamp,Seq:heal.Analysis.Seq,BoundarySeq:heal.RecordId}
    q := IGRVTimelineQuery(s.A),m := IADTimeline(d,q)
    V48Assert(q.PhaseBoundary.StartSeq=hit.RecordId && !q.PhaseBoundary.IncludeStart,"zoom intersecting phase start preserves its raw-record-order boundary")
    V48Assert(q.PhaseBoundary.End=stamp && q.PhaseBoundary.EndSeq=heal.RecordId+1,"focused endpoint uses selected event's raw-record identity")
    V48Assert(m.TotalTaken=0 && m.TotalHealing=500 && m.Events.Length=1,"earlier phase hit is excluded while selected same-ms heal stays included")
}

V68ReviewUITimelineFocusImpl(s)
{
    V68ReviewUILoadedSetup(s,"timeline")
    V48Assert(IsObject(s.Timeline) && s.Timeline.TotalTaken>0 && s.Timeline.TotalHealing>0,"timeline uses selected player's incoming damage and received healing")
    V48Assert(IsObject(s.TimelineDraw) && s.Timeline.Lanes.Length>0 && s.Controls["Events"].GetCount()>0,"known defensive lanes and exact event rows are drawn")
    death := ""
    for event in s.Timeline.Events
        if event.Kind="Death"
            death := event
    V48Assert(IsObject(death),"synthetic fixture has a recorded death")
    IGRVShowEvent(death,true)
    V48Assert(IsObject(s.Focus) && s.Timeline.From=death.At-12000 && s.Timeline.To<=death.At+1,"clicking death isolates its previous twelve seconds")
    V48Assert(InStr(s.Controls["Detail"].Value,"Shown effects active") && InStr(s.Controls["Detail"].Value,"Death"),"event detail names event and recorded effect state without mitigation assumptions")
    s.Controls["EventFilter"].Choose(2),IGRVEventFilterChanged()
    V48Assert(s.Controls["Events"].GetCount()=1 && s.EventRows[1].Kind="Death","death filter uses recorded deaths only")
    IGRVResetFocus()
    V48Assert(!IsObject(s.Focus) && s.Timeline.From=s.A.Data.Start && s.Timeline.To=s.A.Data.Last,"reset restores the whole selected phase")
}

V68ReviewUIPagingImpl(s)
{
    V68ReviewUILoadedSetup(s,"timeline"),sample := s.Timeline.Events[1],s.Events := []
    Loop 405
        s.Events.Push(sample)
    s.Controls["EventFilter"].Choose(1),IGRVFillEvents()
    V48Assert(s.Controls["Events"].GetCount()=200 && s.EventRows.Length=405,"long event list is paginated without dropping events")
    IGRVPage(1),IGRVPage(1)
    V48Assert(s.Page=3 && s.Controls["Events"].GetCount()=5 && IGRVEventAtRow(5)=sample,"last page retains exact event identities")
    IGRVPage(1)
    V48Assert(s.Page=3 && !s.Controls["Next"].Enabled,"paging clamps at last event")
}

V68ReviewUILifecycleImpl(s)
{
    V68ReviewUILoadedSetup(s),data := s.A.Data,window := s.Gui.Hwnd
    s.Busy := true,s.Control := {Cancel:false},IGRVBusyControls()
    V48Assert(!s.Controls["APull"].Enabled && s.Controls["Cancel"].Enabled,"during work input changes are disabled and cancellation stays available")
    V48Assert(!IGRVClose(true) && s.Control.Cancel && s.CloseAfter && s.ParentCloseAfter,"close during loading requests cancellation before destroying owned controls")
    s.Busy := false,s.Control := "",IGRVClose()
    V48Assert(!DllCall("IsWindow","Ptr",window) && s.A.Data=data,"closing releases native window while retaining session cache")
    IGRVOpenFromProgression("timeline")
    V48Assert(IPMUiHandle(s.Gui) && s.A.Data=data && s.Mode="timeline","graph can reopen same cached review")
    IGVClose()
    V48Assert(!IPMUiHandle(s.Gui),"closing progression also closes its review")
}

V68ReviewUIFormattingImpl()
{
    V48Assert(IGRVFormat(1234567)="1,234,567" && IGRVFormat(1234567.125,3)="1,234,567.125","native safe grouping preserves decimals")
    V48Assert(IGRVFormat(-2345.12,1,true)="-2,345.1" && IGRVFormat(34,1,true)="+34.0","positive and negative deltas stay explicit")
}

; Private native load checks: no normal Iris, audio or saved preferences.
V681ReviewLoading() => V68ReviewUIFixture(V681ReviewLoadingBody)
V681ReviewLoadingBody(s)
{
    global IP,COMBAT_LOG_ENCODING
    f := V68ReviewFile(),oldPath := IP.ImportPath,oldEncoding := COMBAT_LOG_ENCODING
    try {
        IP.ImportPath := f.Path,COMBAT_LOG_ENCODING := "UTF-8"
        IGRVOpen([f.Entry],f.Entry)
        V48Assert(IGRVLoad("A") && s.A.Data.BaseVerified,"load bar integrates with actual private source replay")
        V48Assert(s.LoadMode="done" && s.Controls["LoadBar"].Value=1000,"completion publishes data before filling progress")
        loaded := s.A.Data
        wrong := IPRCloneSnapshot(f.Entry),wrong.Key .= "-wrong",wrong.Pull.Start += 1
        IGRVOpen([wrong],wrong)
        V48Assert(!IGRVLoad("A") && s.LoadMode="" && s.Controls["LoadBar"].Value=0,"source mismatch clears progress instead of showing false completion")
        V48Assert(s.A.Data=loaded && !IGRIsBusy(),"failed load retains previous completed dataset and releases ownership")
        IGRVLoadMeter("read",42),s.Generation += 1,token := s.Generation
        IGRVLoadProgress("A",token-1,{Stage:"Review ready",Percent:100,Records:1})
        V48Assert(s.LoadMode="read" && s.Controls["LoadBar"].Value=420,"stale callback cannot finish a new load")
        IGRVLoadProgress("A",token,{Stage:"Review ready",Percent:100,Records:1})
        V48Assert(s.LoadMode="finish","ready callback stays finishing until data publication")
        IGRVLoadMeter("read",42)
        for size in [[1000,700],[1120,760]] {
            IGRVResize(s.Gui,0,size[1],size[2]),c := s.Controls
            c["Status"].GetPos(&sx,&sy,&sw,&sh),c["LoadBar"].GetPos(&px,&py,&pw,&ph)
            c["Cancel"].GetPos(&cx,&cy,&cw,&ch),c["Compare"].GetPos(&bx,&by,&bw,&bh)
            V48Assert(sy+sh<=py && py+ph<by && px+pw<cx,"load bar fits between status, cancel and review buttons")
        }
        IGRVClose(),IGRVOpen([f.Entry],f.Entry)
        V48Assert(s.LoadMode="" && s.Controls["LoadBar"].Value=0,"reopening never resumes old progress or animation")
    }
    finally {
        IP.ImportPath := oldPath,COMBAT_LOG_ENCODING := oldEncoding
        FileDelete(f.Path)
    }
}

; Native hidden-window checks. Synthetic files only, no normal app or audio.
V681LoadingMainImport() => V61Hidden(V681LoadingMainImportBody)
V681LoadingAnalysisImport() => V598WithSource(V681LoadingAnalysisImportBody)
V681LoadingLayout() => V681LoadingMainFixture(V681LoadingLayoutBody)

V681LoadingMainFixture(action)
{
    V61Hidden(V681LoadingMainFixtureInner.Bind(action))
}

V681LoadingMainFixtureInner(action)
{
    global IP
    IPWBuild(),IP.ImportBytes := 430,IP.ImportEnd := 1000,IP.ImportFile := {}
    try {
        IPImportLoadingPaint(IP,"read")
        action.Call(IP)
    }
    finally IP.ImportFile := ""
}

V681LoadingAnalysisFixture(action)
{
    V591Isolated(V681LoadingAnalysisFixtureInner.Bind(action))
}

V681LoadingAnalysisFixtureInner(action)
{
    IPWBuild(),V58SelectTab(8),a := IAState()
    a.Work := {Generation:a.Generation,Snapshot:{File:{Pos:430},End:1000},Timing:IAOpTiming("Analysis load")}
    a.Busy := true,IALoadingPaint("Work",a.Work)
    try action.Call(a)
    finally a.Work := "",a.Busy := false,IALoadingClear()
}

V681LoadingMainImportBody()
{
    V596WithImport(V597TextRows(2000),V681LoadingMainImportCase)
}

V681LoadingMainImportCase(path)
{
    global IP
    IPWBuild(),g := IP.Gui,IP.Visible := true,seen := {Read:false}
    try {
        IPImportRun(V681LoadingMainCheckpoint.Bind(seen))
        V48Assert(seen.Read && IP.ImportTiming.Outcome="COMPLETE","main real import checkpoints update byte progress")
        V48Assert(IP.LoadingBar.LoadingMode="hide" && IP.LoadingBar.Value=0,"completed main import clears loading animation")
        V597ResetJob(path),IPImportLoadingPaint(IP),IPImportRun(V681LoadingMainCancel)
        V48Assert(IP.ImportTiming.Outcome="CANCELED" && IP.LoadingBar.LoadingMode="hide","cancelled main import clears bar after safe unwind")
        V597ResetJob(path),IPImportLoadingPaint(IP),IP.ImportFile.Close(),IPImportRun()
        V48Assert(IP.ImportTiming.Outcome="ERROR" && IP.LoadingBar.LoadingMode="hide","reader failure never leaves a full or moving bar")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd),"main import diagnostic window stays hidden")
    }
    finally {
        IP.Visible := false,IP.Gui := ""
        g.Destroy()
    }
}

V681LoadingMainCheckpoint(seen,app,run)
{
    IPImportPaint(app)
    if app.ImportBytes>0 && app.ImportBytes<app.ImportEnd {
        seen.Read := true
        V48Assert(app.LoadingBar.Value=Round(1000*app.ImportBytes/app.ImportEnd),"main fill follows captured source bytes")
    }
}

V681LoadingMainCancel(app,run)
{
    IPImportPaint(app),app.ImportCancelRequested := true
}

V681LoadingAnalysisImportBody(a,s,seg,path,text)
{
    IAOpenSelected(),seen := {Read:false}
    IALoadPump(V681LoadingAnalysisCheckpoint.Bind(seen))
    V48Assert(seen.Read && a.Data.BaseVerified && a.LoadTiming.Outcome="COMPLETE","native Analysis replay updates source progress and publishes verified data")
    IAQueryPump()
    V48Assert(a.Controls["Loading"].LoadingMode="hide" && a.Controls["Loading"].Value=0,"Analysis completion clears the bar")
    previous := a.Data,IAOpenSelected(),IALoadPump(V598CancelCheckpoint)
    V48Assert(a.Data=previous && a.Controls["Loading"].LoadingMode="hide","Analysis cancellation retains prior data and clears progress")
    IAOpenSelected(),a.Work.Snapshot.File.Close(),IALoadPump()
    V48Assert(a.Data=previous && a.LoadTiming.Outcome="ERROR" && a.Controls["Loading"].LoadingMode="hide","Analysis read failure retains prior data and resets progress")
}

V681LoadingAnalysisCheckpoint(seen,kind,job)
{
    a := IAState(),f := job.Snapshot.File
    IALoadingPaint(kind,job)
    if IsObject(f) && f.Pos>0 && f.Pos<job.Snapshot.End {
        seen.Read := true
        V48Assert(a.Controls["Loading"].Value=Round(1000*f.Pos/job.Snapshot.End),"Analysis fill measures the captured file position")
    }
}

V681LoadingLayoutBody(app)
{
    for size in [[980,650],[1220,800]] {
        IPResize(app.Gui,0,size[1],size[2])
        app.StatusText.GetPos(&sx,&sy,&sw,&sh),app.LoadingBar.GetPos(&bx,&by,&bw,&bh)
        V48Assert(bx=12 && sx=bx+bw+12 && sx+sw<=size[1]-12 && by>=sy && by+bh<=sy+sh,"main loading bar and text stay together on the left at minimum and regular sizes")
    }
    ILBSet(app.LoadingBar,"finish")
    style := DllCall("User32\GetWindowLongW","Ptr",app.LoadingBar.Hwnd,"Int",-16,"UInt")
    V48Assert((style & 8)!=0 && app.LoadingBar.LoadingMode="finish","unknown finishing work uses native marquee")
    ILBSet(app.LoadingBar,"read",43)
    V48Assert(app.LoadingBar.Value=430 && !(DllCall("User32\GetWindowLongW","Ptr",app.LoadingBar.Hwnd,"Int",-16,"UInt") & 8),"next read clears the prior animation and starts at actual progress")
    ILBSet(app.LoadingBar,"hide")
    V48Assert(app.LoadingBar.Value=0 && !app.LoadingBar.Visible,"hiding stops and clears native progress")
    V58SelectTab(8),a := IAState()
    for size in [[664,428],[904,558]] {
        IAEmbeddedResize(size[1],size[2]),c := a.Controls
        c["Loading"].GetPos(&px,&py,&pw,&ph),c["Status"].GetPos(&sx,&sy,&sw,&sh)
        V48Assert(px>=0 && px+pw<=size[1] && py+ph<sy && sy+sh<=size[2],"embedded Analysis bar and status fit without overlap")
    }
}

; Hidden native batch-loading checks use temporary synthetic logs/history only.
V681BatchLoadingLifecycle() => V635WithBatch(V681BatchLoadingLifecycleCase)
V681BatchLoadingCancelError() => V635WithBatch(V681BatchLoadingCancelErrorCase)
V681BatchLoadingLayout() => V635WithBatch(V681BatchLoadingLayoutCase)

V681BatchLoadingLifecycleCase(root,items)
{
    seen := Map(),c := IGVState().Controls
    V48Assert(!c["LoadBar"].Visible && !c["LoadLabel"].Visible && !c["Summary"].Visible && !IGVState().LoadingView,"idle graph uses the image summary and has no loading bar")
    job := IGLBegin(items,"Synthetic",root "\loading.json")
    V48Assert(c["LoadBar"].Visible && c["LoadLabel"].Visible && !c["Summary"].Visible,"queued load immediately shows activity without overwriting the summary")
    V48Assert(IGLPump(V681BatchLoadingProbe.Bind(seen)),"synthetic batch completes through all loading stages")
    for phase in ["before-file","reading","end-file","before-merge","before-commit","save-verifying","refresh-graph"]
        V48Assert(seen.Has(phase),"native loading presentation observed at " phase)
    V48Assert(!c["LoadBar"].Visible && !c["LoadLabel"].Visible && !c["Summary"].Visible && !IGVState().LoadingView,"completed graph restores the full image space and hides loading controls")
    V48Assert(!(ControlGetStyle(c["LoadBar"]) & 0x8) && c["LoadBar"].Value=0,"completion stops marquee and clears old progress")
}

V681BatchLoadingProbe(seen,job,phase)
{
    c := IGVState().Controls,stage := IGLImportStage(phase),reading := stage="Reading"
    V48Assert(c["LoadBar"].Visible && !c["Summary"].Visible,"bar remains visible throughout the active batch")
    V48Assert(((ControlGetStyle(c["LoadBar"]) & 0x8)!=0)=!reading,"known reading progress and unknown finishing have distinct native modes")
    if reading {
        V48Assert(InStr(c["LoadLabel"].Text,"log " job.Index " of " job.Items.Length) && InStr(c["LoadLabel"].Text,"% read"),"current-file percentage is labelled separately from batch count")
        V48Assert(c["LoadBar"].Value=10*Floor(100*job.Snapshot.File.Pos/Max(1,job.Snapshot.End)),"native bar follows snapshot bytes rather than an invented whole-job estimate")
    }
    else
        V48Assert(!InStr(c["LoadLabel"].Text,"%"),"finishing cannot retain a stale file percentage")
    seen[phase] := true,job.LastStatus := IPImportNow()+1000000
}

V681BatchLoadingCancelErrorCase(root,items)
{
    c := IGVState().Controls,summary := c["Summary"].Text
    job := IGLBegin(items,"Synthetic",root "\cancel-loading.json")
    IGLCancel()
    V48Assert(!IGLBusy() && !c["LoadBar"].Visible && !c["Summary"].Visible && !IGVState().LoadingView && c["Summary"].Text=summary,"queued cancellation restores unchanged graph text")
    job := IGLBegin(items,"Synthetic",root "\cancel-finishing.json")
    V48Assert(!IGLPump(V681BatchLoadingCancelProbe) && !job.Committed && !FileExist(job.Path),"cancel during the finishing stage does not publish incomplete history")
    V48Assert(!c["LoadBar"].Visible && !(ControlGetStyle(c["LoadBar"]) & 0x8) && !c["Summary"].Visible && !IGVState().LoadingView,"finishing cancellation stops marquee and restores image space")
    job := IGLBegin(items,"Synthetic",root "\error-loading.json"),FileDelete(items[2].Path)
    V48Assert(!IGLPump() && !job.Committed && !FileExist(job.Path),"read failure keeps original atomic batch behavior")
    V48Assert(!c["LoadBar"].Visible && !(ControlGetStyle(c["LoadBar"]) & 0x8) && !c["Summary"].Visible && !IGVState().LoadingView,"read error cannot leave an animated loading indicator")
    FileCopy(items[1].Path,items[2].Path),IGVClose(),IGVOpen(),c := IGVState().Controls
    V48Assert(!c["LoadBar"].Visible && c["LoadBar"].Value=0 && !c["Summary"].Visible && !IGVState().LoadingView,"reopened graph has no stale progress")
    IGLBegin(items,"Synthetic",root "\restart-loading.json")
    V48Assert(c["LoadBar"].Visible && InStr(c["LoadLabel"].Text,"Opening log 1 of 2"),"a later batch starts from its first file")
    IGLCancel()
}

V681BatchLoadingCancelProbe(job,phase)
{
    if phase="end-file"
        IGLCancel()
}

V681BatchLoadingLayoutCase(root,items)
{
    c := IGVState().Controls
    V681BatchLoadingSetup(root,items)
    for size in [[900,560],[960,680],[1440,900]] {
        IGVResize(IGVState().Gui,0,size[1],size[2])
        c["LoadLabel"].GetPos(&lx,&ly,&lw,&lh),c["LoadBar"].GetPos(&bx,&by,&bw,&bh),c["Chart"].GetPos(&cx,&cy,&cw,&ch)
        V48Assert(lx=14 && bx=14 && lw=size[1]-28 && bw=lw && ly+lh<by && by+bh<cy,"loading label and bar fit above the existing chart at every supported size")
    }
    V48Assert(c["LoadBar"].Value=420 && InStr(c["LoadLabel"].Text,"42% read"),"fractional file progress is rendered in the native control")
    IGLCancel()
}

; Capture entry point: call within V635WithBatch. This queued job never opens
; a raw log; the temporary snapshot object is removed before returning.
V681BatchLoadingSetup(root,items,stage := "Reading",percent := 42)
{
    job := IGLBegin(items,"Synthetic",root "\capture-loading.json")
    job.Index := 1,job.Snapshot := {File:{Pos:percent},End:100}
    try IGLProgress(job,stage)
    finally job.Snapshot := ""
    return job
}

; Native mechanics diagnostics: private fixtures/files, hidden UI, no live audio.
V69MechanicRun(fn) => V68ReviewRun(V69MechanicRunInner.Bind(fn))
V69MechanicRunInner(fn)
{
    s := IGMState(),saved := s.Clone()
    try {
        s.Gui := "",s.Controls := Map(),s.Entries := [],s.Rules := IGMBuiltins(),s.Loaded := true,s.LoadError := ""
        s.Report := "",s.Busy := false,s.Cancel := "",s.Paths := Map(),s.ViewRows := [],s.ViewEvents := [],s.RuleKey := ""
        fn.Call()
    }
    finally {
        if IPMGuiAlive(s.Gui)
            s.Gui.Destroy()
        for key,value in saved.OwnProps()
            s.%key% := value
    }
}

V69MechanicData()
{
    return {Start:0,Last:10000,Rows:[],Partial:false,BossKey:"G-TY",AreaId:"833571547775765",ModeId:"836045448953655"}
}

V69MechanicAdd(d,line,accepted := true)
{
    ev := V59Parsed(line,-1,d.Rows.Length+1,accepted),d.Rows.Push(ev)
    return ev
}

V69MechanicFixture()
{
    d := V69MechanicData(),tyth := "TYTH {4078423634870272}:1|(0,0,0,0)|(900/1000)"
    grace := "Grace {4078440814739456}:2|(0,0,0,0)|(100/100)",deadGrace := "Grace {4078440814739456}:2|(0,0,0,0)|(0/100)"
    V69MechanicAdd(d,IPDemoLine(1000,tyth,"=","Activate",0,false,-1,"Rage Overload","4086837475803136"))
    V69MechanicAdd(d,IPDemoLine(1100,tyth,"@Tank#69","Damage",500,false,-1,"Rage Overload","4086837475803136"))
    V69MechanicAdd(d,IPDemoLine(1100,tyth,"@Other#70","Damage",500,false,-1,"Rage Overload","4086837475803136"))
    V69MechanicAdd(d,IPDemoLine(2000,grace,tyth,"Heal",100,false,-1,"Aivela's Restoration","4071199499878400"))
    V69MechanicAdd(d,"[00:00:03.000] [" tyth "] [=] [Aivela's Grace {4088443793571840}] [ApplyEffect {836045448945477}: Aivela's Grace {4088443793572128}] ()")
    V69MechanicAdd(d,"[00:00:04.000] [@Tank#69] [" grace "] [Quell {123}] [Event {836045448945472}: AbilityInterrupt {836045448945482}] (Aivela's Grace {4088443793571840})")
    V69MechanicAdd(d,"[00:00:05.000] [" deadGrace "] [=] [Aivela's Grace {4088443793571840}] [Event {836045448945472}: AbilityInterrupt {836045448945482}] ()")
    V69MechanicAdd(d,IPDemoLine(6000,"@Tank#69",grace,"Death"))
    V69MechanicAdd(d,"[00:00:06.100] [" deadGrace "] [=] [Aivela's Restoration {4071199499878400}] [Event {836045448945472}: AbilityInterrupt {836045448945482}] ()")
    V69MechanicAdd(d,IPDemoLine(7000,tyth,"=","Activate",0,false,-1,"Intensify Rage","4076018453184512"))
    V69MechanicAdd(d,IPDemoLine(8000,"@Tank#69","=","Activate",0,false,-1,"Rage Overload","4086837475803136"))
    V69MechanicAdd(d,IPDemoLine(9000,tyth,"=","Activate",0,false,-1,"Rage Overload","4086837475803136"),false)
    entry := {Key:"one",Session:"test",Date:"20261003",Team:"",Pull:{Id:1,Name:"Tyth",Boss:"G-TY",Start:0,End:10000}}
    return {Data:d,Entry:entry}
}

V69MechanicBuiltins() => V69MechanicRun(V69MechanicBuiltinsBody)
V69MechanicBuiltinsBody()
{
    f := V69MechanicFixture(),rules := IGMBuiltins(),row := IGMResultFromData(f.Entry,f.Data,rules)
    result := IGMSummary({Rules:rules,Rows:[row]}).Totals
    for pair in [["tyth-overload",1],["tyth-hit",2],["tyth-heal",1],["tyth-dr",1],["tyth-interrupt",2],["tyth-intensify",1]]
        V48Assert(result[pair[1]].Count=pair[2],"confirmed builtin " pair[1] " counts exact accepted evidence")
    V48Assert(row.Events.Length=8 && InStr(row.Events[1].Raw,"Rage Overload"),"compact report retains exact raw evidence; rejected/player-copied casts excluded")
    V48Assert(result["tyth-hit"].Seen=1 && result["tyth-hit"].Count=2,"multi-recipient hits remain hits, not two failed pulls")
}

V69MechanicScope() => V69MechanicRun(V69MechanicScopeBody)
V69MechanicScopeBody()
{
    f := V69MechanicFixture(),r := IGMBuiltins()[1],ev := f.Data.Rows[1]
    f.Data.ModeId := "836045448953652"
    V48Assert(!IGMMatches(r,ev,f.Data) && !IGMRuleApplies(r,f.Data),"built-in 8M Tyth evidence cannot masquerade as VM coverage")
    f.Data.ModeId := "836045448953655",f.Data.BossKey := "G-NA"
    V48Assert(!IGMMatches(r,ev,f.Data),"another encounter cannot reuse Tyth mechanic identity")
    custom := IGMNewCheck("Chosen cast","Casts","4086837475803136",false)
    V48Assert(IGMMatches(custom,ev,f.Data),"explicit all-mode custom check remains usable on user-selected boss")
    custom.MasterOnly := true,f.Data.ModeId := ""
    V48Assert(!IGMRuleApplies(custom,f.Data),"unknown difficulty is not assumed Master")
}

V69MechanicCustom() => V69MechanicRun(V69MechanicCustomBody)
V69MechanicCustomBody()
{
    f := V69MechanicFixture(),ev := f.Data.Rows[1]
    V48Assert(IGMMatches(IGMNewCheck("name","Casts","overLOAD"),ev,f.Data),"custom literal name match is case-insensitive")
    V48Assert(!IGMMatches(IGMNewCheck("id","Casts","408683747580313"),ev,f.Data),"numeric ID matches exactly, never substring")
    V48Assert(!IGMMatches(IGMNewCheck("regex","Casts",".*"),ev,f.Data),"custom names are literal and cannot execute regex")
    V48Assert(IGMMatches(IGMNewCheck("DR effect","Effect applications","4088443793572128"),f.Data.Rows[5],f.Data),"effect matcher uses effect ID, distinct from ability ID")
    V48Assert(!IGMMatches(IGMNewCheck("hits","Hits on players","4086837475803136"),ev,f.Data),"cast is not a damage hit")
    V59ExpectError((*)=>IGMNewCheck("bad","not a type","123"))
    V59ExpectError((*)=>IGMNewCheck("name","Casts",""))
}

V69MechanicInterruptIdentity() => V69MechanicRun(V69MechanicInterruptIdentityBody)
V69MechanicInterruptIdentityBody()
{
    d := V69MechanicData(),grace := "Grace {4078440814739456}:2|(0,0,0,0)|(100/100)"
    dead := "Grace {4078440814739456}:2|(0,0,0,0)|(0/100)",rule := IGMBuiltins()[5]
    V69MechanicAdd(d,IPDemoLine(1000,grace,"=","Activate",0,false,-1,"Aivela's Grace","4088443793571840"))
    player := V69MechanicAdd(d,"[00:00:02.000] [@Tank#69] [" grace "] [Quell {123}] [Event {836045448945472}: AbilityInterrupt {836045448945482}] (Aivela's Grace {4088443793571840})")
    stop := V69MechanicAdd(d,"[00:00:02.001] [" dead "] [] [Aivela's Grace {4088443793571840}] [Event {836045448945472}: AbilityInterrupt {836045448945482}] ()")
    V48Assert(IGMMatches(rule,stop,d),"dead Grace explicit DR interruption allows recorded blank target")
    row := IGMResultFromData(V69MechanicFixture().Entry,d,[rule])
    V48Assert(row.Events.Length=1 && row.Events[1].EvidenceCount=2 && InStr(row.Events[1].Raw,"Corroborating"),"player and death-cancel records for one observed Grace cast share one event with both originals")
    player.BossInterruptedId := "4071199499878400"
    V48Assert(!IGMMatches(rule,player,d),"explicit Restoration interruption ID cannot count as Grace DR")
}

V69MechanicNahut() => V69MechanicRun(V69MechanicNahutBody)
V69MechanicNahutBody()
{
    d := V69MechanicData(),d.BossKey := "G-NA",boss := "NAHUT {4122949560827904}:1",rules := IGMBuiltins()
    hit := V69MechanicAdd(d,IPDemoLine(1000,boss,"@Tank#69","Damage",0,false,-1,"Discharge","4133906022400000"))
    cast := V69MechanicAdd(d,IPDemoLine(2000,boss,"@Tank#69","Activate",0,false,-1,"Slice","4137075708264448"))
    V48Assert(IGMMatches(rules[7],hit,d) && IGMMatches(rules[8],cast,d),"Nahut builtins reuse exact observed floor and Slice IDs including zero-hit outcomes")
    cast.Source := IPActor(""),V48Assert(!IGMMatches(rules[8],cast,d),"blank Slice damage/actor cannot become a fabricated boss cast")
    d.BossKey := "G-TY",V48Assert(!IGMMatches(rules[7],hit,d),"Nahut observations remain encounter-scoped")
}

V69MechanicCoverage() => V69MechanicRun(V69MechanicCoverageBody)
V69MechanicCoverageBody()
{
    f := V69MechanicFixture(),rules := [IGMBuiltins()[1]],one := IGMResultFromData(f.Entry,f.Data,rules)
    partial := IPRCloneSnapshot(one),partial.Partial := true,partial.State := "Partial recording"
    unavailable := IGMUnavailable(f.Entry,"Missing original"),other := IPRCloneSnapshot(one),other.Applicable[rules[1].Key] := false
    report := {Rules:rules,Rows:[one,partial,unavailable,other]},sum := IGMSummary(report).Totals[rules[1].Key]
    V48Assert(sum.Count=2 && sum.Seen=2 && sum.CompleteSeen=1 && sum.Complete=1,"partial observed events included but omitted from complete-pull recurrence denominator")
    V48Assert(sum.Partial=1 && sum.Unavailable=1 && sum.NotApplicable=1,"missing and unscoped pulls remain distinct from zero")
    text := IGMReportText(report)
    V48Assert(InStr(text,"Missing original") && InStr(text,"--") && InStr(text,"not mistakes"),"copied report discloses missing data and observation semantics")
}

V69MechanicPhases() => V69MechanicRun(V69MechanicPhasesBody)
V69MechanicPhasesBody()
{
    f := V69MechanicFixture(),rules := [IGMBuiltins()[1]],row := IGMResultFromData(f.Entry,f.Data,rules)
    row.Phases.Push({Name:"After cast",From:1,To:10,Kind:"Automatic",Boundary:{Start:1000,StartSeq:1,IncludeStart:false,End:10000,EndSeq:0,OpenEnd:true}})
    report := {Rules:rules,Rows:[row]},s := IGMSummary(report,"After cast")
    V48Assert(s.Totals[rules[1].Key].Count=0 && s.Totals[rules[1].Key].Complete=1,"same-ms start marker excluded from phase via source sequence")
    s := IGMSummary(report,"Not reached")
    V48Assert(s.Totals[rules[1].Key].Complete=0 && s.Rows[1].State="Phase not recorded","missing phase is not a perfect zero-event attempt")
}

V69MechanicBatch() => V69MechanicRun(V69MechanicBatchBody)
V69MechanicBatchBody()
{
    global IP,Audio
    f := V68ReviewFile(true),entries := [f.Entry],rules := [IGMNewCheck("Demo casts","Casts","990000000000011",false)]
    for i in [1,65] {
        entry := f.Entry.Clone(),entry.Key := "earlier-" i,entry.Pull := IPRCompact(f.State.Segments[i]),entries.Push(entry)
    }
    paths := Map(f.Entry.Session,f.Path),live := IP.Live,queue := Audio.Queue,a := IAState(),data := a.Data,generation := a.Generation
    try {
        report := IGMBuildReport(entries,rules,paths)
        V48Assert(report.Sources=1 && report.Rows.Length=3,"three selected pulls from one long recording use one private source scan")
        for row in report.Rows
            V48Assert(row.Available,"source scan reproduces exact selected pull beyond sixty attempts")
        summary := IGMSummary(report),total := summary.Totals[rules[1].Key]
        V48Assert(total.Count=20 && total.Seen=1,"exact selected demo activation records counted without borrowing nearby pulls")
        V48Assert(summary.Rows[2].Counts[rules[1].Key]=0 && summary.Rows[3].Counts[rules[1].Key]=0,"reviewed zero-event pulls remain valid distinct zeroes")
        V48Assert(IP.Live=live && Audio.Queue=queue && a.Data=data && a.Generation=generation && !IGRIsBusy(),"night batch preserves live/parser/audio/Analysis state")
    }
    finally FileDelete(f.Path)
}

V69MechanicMismatch() => V69MechanicRun(V69MechanicMismatchBody)
V69MechanicMismatchBody()
{
    f := V68ReviewFile(),rules := [IGMNewCheck("Demo casts","Casts","990000000000011",false)]
    try {
        wrong := IPRCloneSnapshot(f.Entry),wrong.Key := "wrong",wrong.Pull.Start += 1
        missing := IPRCloneSnapshot(f.Entry),missing.Key := "missing",missing.Session := "does-not-exist-69.txt"
        report := IGMBuildReport([f.Entry,wrong,missing],rules,Map(f.Entry.Session,f.Path))
        V48Assert(report.Rows[1].Available && !report.Rows[2].Available && !report.Rows[3].Available,"one incorrect boundary and missing source do not invalidate or falsely fill the valid pull")
        sum := IGMSummary(report).Totals[rules[1].Key]
        V48Assert(sum.Count=20 && sum.Unavailable=2,"unavailable source is excluded, never fabricated as zero occurrences")
    }
    finally FileDelete(f.Path)
}

V69MechanicCancel() => V69MechanicRun(V69MechanicCancelBody)
V69MechanicCancelBody()
{
    global IP
    f := V68ReviewFile(),rules := [IGMNewCheck("Demo casts","Casts","990000000000011",false)],control := {Cancel:false}
    try {
        failed := false
        try IGMBuildReport([f.Entry],rules,Map(f.Entry.Session,f.Path),V68ReviewCancelService.Bind(control),control)
        catch Error as err
            failed := InStr(err.Message,"canceled")>0
        V48Assert(failed && !IGRIsBusy(),"cancel aborts complete batch rather than returning unavailable rows")
        moved := f.Path ".moved",FileMove(f.Path,moved),FileMove(moved,f.Path)
        V48Assert(FileExist(f.Path),"canceled source file is released")
        IP.Active := true,failed := false
        try IGMBuildReport([f.Entry],rules,Map(f.Entry.Session,f.Path))
        catch Error
            failed := true
        finally IP.Active := false
        V48Assert(failed,"private mechanics review never starts over live collection")
    }
    finally FileDelete(f.Path)
}

V69MechanicPersistence() => V69MechanicRun(V69MechanicPersistenceBody)
V69MechanicPersistenceBody()
{
    path := A_Temp "\Iris-mechanic-config-test-" A_TickCount ".json",rules := IGMBuiltins()
    rules[1].Enabled := false,rules.Push(IGMNewCheck("Quoted " Chr(34) " check","Effect applications","123456",false))
    try {
        IGMSaveRules(rules,path),read := IGMReadRules(path)
        V48Assert(read.Length=IGMBuiltins().Length+1 && !read[1].Enabled && read[read.Length].Name=rules[rules.Length].Name && !read[read.Length].MasterOnly,"validated JSON preserves custom checks, quoted labels and enabled/scope settings")
        old := FileRead(path,"UTF-8"),rules[1].Enabled := true,IGMSaveRules(rules,path)
        V48Assert(FileRead(path ".bak","UTF-8")=old,"previous valid mechanic config backed up before replacement")
        FileDelete(path),FileAppend("{broken",path,"UTF-8"),failed := false
        try IGMSaveRules(rules,path)
        catch Error
            failed := true
        V48Assert(failed && FileRead(path,"UTF-8")="{broken","corrupt prior config is preserved rather than silently replaced")
        V59ExpectError((*)=>IGMReadRules(path))
    }
    finally {
        for p in [path,path ".bak",path ".lock"]
            if FileExist(p)
                FileDelete(p)
    }
}

V69MechanicWindow() => V69MechanicRun(V69MechanicWindowBody)
V69MechanicWindowBody()
{
    f := V69MechanicFixture(),s := IGMState(),v := IGVState(),oldRows := v.Rows
    ; Give the normal entry selector a complete compact source identity.
    f.Entry.Pull.Group := "G-TY|833571547775765|836045448953655",f.Entry.Pull.Players := Map(),f.Entry.Pull.Partial := false
    try {
        v.Rows := [f.Entry],IGMOpenFromProgression()
        V48Assert(IPMGuiAlive(s.Gui) && s.Controls["Checks"].GetCount()=IGMBuiltins().Length,"native hidden window exposes all confirmed Tyth/Nahut checks independently")
        rules := IGMBuiltins(),row := IGMResultFromData(f.Entry,f.Data,rules)
        s.Report := {Rules:rules,Rows:[row],Sources:1,Events:8},s.RuleKey := rules[1].Key,IGMRender()
        V48Assert(s.Controls["Summary"].GetCount()=IGMBuiltins().Length && s.Controls["Pulls"].GetCount()=1,"night summary and per-pull evidence surfaces both render")
        IGMChoosePull(s.Controls["Pulls"],1,true),IGMChooseEvidence(s.Controls["Evidence"],1,true)
        V48Assert(s.Controls["Evidence"].GetCount()=1 && InStr(s.Controls["Detail"].Value,"4086837475803136"),"selected pull drills down to exact original event evidence")
        s.Busy := true,s.Cancel := {Cancel:false},IGMBusyControls(),IGMClose()
        V48Assert(s.Cancel.Cancel && !s.Visible,"closing the feature cancels pending work without touching live app state")
        V48Assert(!IGMCloseParent() && s.ParentCloseAfter,"parent destruction is deferred while a read is unwinding")
        s.Busy := false,s.ParentCloseAfter := false
        V48Assert(IGMCloseParent(),"idle child permits parent closure")
        IGMShutdown(),V48Assert(!IPMGuiAlive(s.Gui) && s.Controls.Count=0,"application shutdown retires native controls safely")
    }
    finally v.Rows := oldRows
}

V69MechanicOpenBusy() => V69MechanicRun(V69MechanicOpenBusyBody)
V69MechanicOpenBusyBody()
{
    s := IGMState(),v := IGVState(),batch := IGLState(),oldRows := v.Rows,oldBusy := v.Busy,oldBatch := batch.Busy
    try {
        v.Rows := [V69MechanicFixture().Entry],batch.Busy := true
        IGMOpenFromProgression()
        V48Assert(!IPMGuiAlive(s.Gui) && !s.Entries.Length,"Add logs blocks mechanics entrypoint before any window or frozen selection is created")
        batch.Busy := false,v.Busy := true,IGMOpenFromProgression()
        V48Assert(!IPMGuiAlive(s.Gui) && !s.Entries.Length,"graph refresh busy state also blocks entrypoint")
        v.Busy := false,job := IGRBegin("private competing review")
        try {
            IGMOpenFromProgression()
            V48Assert(!IPMGuiAlive(s.Gui),"existing private review blocks a competing mechanics window")
        }
        finally IGREnd(job)
    }
    finally v.Rows := oldRows,v.Busy := oldBusy,batch.Busy := oldBatch
}

; Private synthetic planner data, hidden windows and temporary files only.
V69PlannerStorage() => V69PlannerStorageCase()
V69PlannerRecordedCasts() => V69PlannerRecordedCase()
V69PlannerUnknowns() => V69PlannerUnknownCase()
V69PlannerMechanicAnchor() => V69PlannerMechanicCase()
V69PlannerReminders() => V69PlannerReminderCase()
V69PlannerNoCatchup() => V69PlannerNoCatchupCase()
V69PlannerAlertOwnership() => V69PlannerAlertOwnershipCase()
V69PlannerHiddenEditor() => V69PlannerFixture(V69PlannerHiddenCase)

V69PlannerPlan(id := "one")
{
    return {Id:id,Boss:"G-TY",Area:"833571547775765",Mode:"836045448953655",Player:"Demo Tank",PlayerKey:"@Demo Tank#101",
        Ability:"Energy Shield",AbilityId:"814218425139200",Anchor:"start",AnchorId:"",AnchorNpc:"",
        Occurrence:1,Offset:1.5,Window:3,Enabled:1,Remind:0}
}

V69PlannerData()
{
    d := V68ReviewUIDataset({}),d.BossKey := "G-TY",d.AreaId := "833571547775765",d.ModeId := "836045448953655"
    d.Name := "Synthetic Tyth",d.Partial := false
    return d
}

V69PlannerEvent(at,kind := "Activate",id := "123456789",source := "Synthetic Tyth {4078419339902976}:900")
{
    ev := IPParseLine(IPDemoLine(at,source,"=",kind,0,false,-1,"Synthetic mechanic",id))
    ev.Analysis := {At:at,Seq:10000+at,Accepted:true}
    return ev
}

V69PlannerStorageCase()
{
    root := V635Temp(),path := root "\plans.json",one := V69PlannerPlan()
    try {
        text := ICPSave([one],path,""),rows := ICPParse(ICPFileText(path))
        V48Assert(rows.Length=1 && rows[1].AbilityId=one.AbilityId && !rows[1].Remind,"saved identity survives native round-trip and reminders default off")
        one.Offset := 12,text2 := ICPSave([one],path,text)
        V48Assert(ICPFileText(path ".bak")=text && ICPParse(text2)[1].Offset=12,"successful replacement retains the previous validated plan as a backup")
        raised := false
        try ICPSave([one],path,text)
        catch Error
            raised := true
        V48Assert(raised && ICPFileText(path)=text2,"stale editor cannot overwrite a newer saved plan")
        for invalid in ['[2,[]]','[1,[["truncated"]]]','[1,{}]'] {
            FileDelete(path),FileAppend(invalid,path,"UTF-8-RAW"),raised := false
            try ICPSave([one],path,invalid)
            catch Error
                raised := true
            V48Assert(raised && ICPFileText(path)=invalid,"unsupported or corrupt saved plan remains untouched")
        }
        invalid := one.Clone(),invalid.Offset := -1,raised := false
        try ICPValidate(invalid)
        catch Error
            raised := true
        V48Assert(raised,"a future mechanic cannot be advertised as a predictable negative-offset reminder")
        raised := false
        try ICPPack([one,one])
        catch Error
            raised := true
        V48Assert(raised,"duplicate assignment identities cannot collapse reminders")
    }
    finally DirDelete(root,true)
}

V69PlannerRecordedCase()
{
    d := V69PlannerData(),p := V69PlannerPlan(),rows := ICPReview([p],d)
    V48Assert(rows.Length=1 && rows[1].Status="Cast recorded" && rows[1].Delta=0,"actual recorded activation matches planned elapsed time")
    p.Offset := 2.5,rows := ICPReview([p],d)
    V48Assert(rows[1].Status="Cast recorded" && rows[1].Delta=-1,"review exposes the signed actual-versus-planned difference")
    duplicate := p.Clone(),duplicate.Id := "two",duplicate.Offset := 3,rows := ICPReview([p,duplicate],d)
    V48Assert(rows[1].Actual>=0 && rows[2].Actual<0,"one actual cast cannot satisfy two different assignments")
    wrong := p.Clone(),wrong.Mode := "836045448953652"
    V48Assert(ICPReview([wrong],d).Length=0,"difficulty-specific plans do not spill into another mode")
    p.Enabled := 0
    V48Assert(ICPReview([p],d).Length=0,"disabled assignment is omitted without changing recorded data")
}

V69PlannerUnknownCase()
{
    d := V69PlannerData(),p := V69PlannerPlan(),p.Offset := 10,p.Window := 1
    V48Assert(ICPReview([p],d)[1].Status="No cast recorded in window","complete recording reports absence without claiming ability readiness or fault")
    d.Partial := true
    V48Assert(ICPReview([p],d)[1].Status="Unknown (partial log)","missing activity remains unknown in a partial recording")
    p.Offset := 60
    V48Assert(ICPReview([p],d)[1].Status="Not reached","planned time beyond the observed pull is not graded as missing")
    p.Offset := 1.5,p.PlayerKey := "@Absent#999"
    V48Assert(ICPReview([p],d)[1].Status="Unknown player","absent exact character identity never falls back to a matching label")
    p.PlayerKey := "",other := IPActor("@Demo Tank#999"),d.Actors[other.Key] := other
    V48Assert(ICPReview([p],d)[1].Status="Unknown player","ambiguous equal player names cannot be combined")
}

V69PlannerMechanicCase()
{
    d := V69PlannerData(),p := V69PlannerPlan(),p.Anchor := "mechanic",p.AnchorId := "123456789",p.AnchorNpc := "4078419339902976"
    p.Offset := 0.5,p.Occurrence := 2
    early := V69PlannerEvent(d.Start+500),later := V69PlannerEvent(d.Start+1000),duplicate := early.Clone()
    duplicate.Analysis := early.Analysis.Clone(),duplicate.Analysis.Seq += 1
    d.Rows.Push(later,early,duplicate) ; deliberately late file order
    row := ICPReview([p],d)[1]
    V48Assert(row.Due=d.Start+1500 && row.Status="Cast recorded","chronological second observed NPC activation anchors the plan despite file order and duplicate record")
    p.AnchorNpc := "999999999"
    V48Assert(ICPReview([p],d)[1].Status="Anchor not recorded","an ability from the wrong NPC cannot start the assigned mechanic")
    p.AnchorNpc := "4078419339902976",p.Occurrence := 3
    V48Assert(ICPReview([p],d)[1].Status="Anchor not recorded","an unobserved future occurrence stays unknown")
}

V69PlannerReminderCase()
{
    d := V69PlannerData(),p := V69PlannerPlan(),p.Remind := 1,s := ICPNewLive(),ev := V69PlannerEvent(d.Start)
    ICPObserve(s,[p],d,ev,d.Start,1000,"synthetic")
    V48Assert(ICPDue(s,2499,d.Actors).Length=0,"fight-start reminder does not trigger early")
    alerts := ICPDue(s,2500,d.Actors)
    V48Assert(alerts.Length=1 && InStr(alerts[1].Name,"Demo Tank, Energy Shield now"),"due assignment produces only a visual reminder payload")
    V48Assert(ICPDue(s,2501,d.Actors).Length=0,"one assignment produces one visual reminder per pull")
    p.Anchor := "mechanic",p.AnchorId := "123456789",p.AnchorNpc := "4078419339902976",p.Occurrence := 2,p.Offset := 1
    s := ICPNewLive(),ICPObserve(s,[p],d,ev,d.Start,1000,"synthetic")
    ICPObserve(s,[p],d,ev,d.Start,1000,"synthetic")
    V48Assert(s.Pending.Count=0,"duplicate mechanic record cannot reach the second occurrence")
    next := V69PlannerEvent(d.Start+1000),ICPObserve(s,[p],d,next,d.Start+1000,2000,"synthetic")
    V48Assert(ICPDue(s,3000,d.Actors).Length=1,"second observed mechanic schedules its nonnegative offset")
}

V69PlannerNoCatchupCase()
{
    d := V69PlannerData(),p := V69PlannerPlan(),p.Remind := 1,s := ICPNewLive(),ev := V69PlannerEvent(d.Start)
    ICPObserve(s,[p],d,ev,d.Start,1000,"synthetic")
    V48Assert(ICPDue(s,9000,d.Actors).Length=0 && s.Pending.Count=0,"overdue reminder is discarded after an interruption")
    s := ICPNewLive(),ICPObserve(s,[p],d,ev,d.Start,1000,"synthetic"),empty := Map()
    V48Assert(ICPDue(s,2500,empty).Length=0,"unobserved assigned player cannot receive a readiness-like reminder")
    p.Remind := 0,s := ICPNewLive(),ICPObserve(s,[p],d,ev,d.Start,1000,"synthetic")
    V48Assert(s.Pending.Count=0,"ordinary planning enables no automatic reminders")
    p.Remind := 1,s := ICPNewLive(),ICPObserve(s,[p],d,ev,d.Start,1000,"source-a")
    ICPObserve(s,[p],d,ev,d.Start,10000,"source-b")
    V48Assert(ICPDue(s,10001,d.Actors).Length=0 && s.Token!="source-a","new source replaces the old pending schedule")
}

V69PlannerAlertOwnershipCase()
{
    global IRT
    old := IRT.Alerts,state := ICPState(),live := state.Live
    try {
        other := {Key:"timer:cooldown-plan:example",Name:"Unrelated timer"},own := {Key:"cooldown-plan:one",Name:"Synthetic plan"}
        IRT.Alerts := [other,own],state.Live := ICPNewLive(),ICPResetLive()
        V48Assert(!IsObject(state.Live) && IRT.Alerts.Length=1 && IRT.Alerts[1]=other,"planner reset removes its own visual warning while preserving an unrelated timer with similar text")
    }
    finally IRT.Alerts := old,state.Live := live
}

V69PlannerFixture(action)
{
    V68ReviewUIFixture(V69PlannerFixtureInner.Bind(action))
}

V69PlannerFixtureInner(action,review)
{
    s := ICPState(),saved := Map()
    for key,value in s.OwnProps()
        saved[key] := value
    s.Gui := "",s.Controls := Map(),s.Plans := [V69PlannerPlan()],s.Loaded := true,s.Original := "",s.Error := "",s.Data := "",s.Live := ""
    try {
        ICPOpen(V69PlannerData()),action.Call(s)
    }
    finally {
        ICPClose()
        for key,value in saved
            s.%key% := value
    }
}

V69PlannerHiddenCase(s)
{
    c := s.Controls
    V48Assert(!DllCall("IsWindowVisible","Ptr",s.Gui.Hwnd) && c["Plans"].GetCount()=1,"native planner is hidden and displays the selected boss assignment")
    V48Assert(InStr(c["Boss"].Text,"Tyth") && c["Anchor"].Text="Fight start","native dropdowns retain real selected captions even when hidden WM_PRINT omits their text")
    V48Assert(c["Review"].GetCount()=1 && c["Review"].GetText(1,6)="Cast recorded","same native window displays plan-versus-recorded-cast result")
    ICPSelect(c["Plans"],1,true),p := ICPFromControls()
    V48Assert(p.PlayerKey="@Demo Tank#101" && p.AbilityId="814218425139200" && !p.Remind,"editor round-trip retains exact identity and opt-in reminder preference")
    V48Assert(!ICPApply() && !ICPRemove(),"hidden diagnostics cannot save to installed planner settings")
    for size in [[1000,750],[1080,760],[1440,900]] {
        ICPResize(s.Gui,0,size[1],size[2]),c["Review"].GetPos(&x,&y,&w,&h),c["Status"].GetPos(&sx,&sy,&sw,&sh)
        V48Assert(x+w<size[1] && y+h<=sy && sy+sh<size[2],"review rows and status fit minimum and large window bounds")
    }
    ICPNew()
    V48Assert(!c["Remind"].Value && !c["Remove"].Enabled,"new assignment cannot inherit prior reminder or delete selection")
}

; v69 private native regressions. Synthetic records and hidden GUI only.
V69RotationRecordedCasts() => V69RotationRecordedCastsImpl()
V69RotationPageEdges() => V69RotationPageEdgesImpl()
V69RotationCollisionLayout() => V69RotationCollisionLayoutImpl()
V69RotationEffectEdges() => V69RotationEffectEdgesImpl()
V69RotationNativeWindow() => V69IconsFixture(V69RotationNativeWindowOuter)
V69RotationSelection() => V69IconsFixture(V69RotationSelectionOuter)

V69RotationNativeWindowOuter(icons)
{
    V68ReviewUIFixture(V69RotationNativeWindowImpl)
}

V69RotationSelectionOuter(icons)
{
    V68ReviewUIFixture(V69RotationSelectionImpl)
}

V69RotationFixture()
{
    d := V68TimelineData(40000)
    for at in [0,1500,1500,9999,10000,20000,40000]
        V68TimelineAdd(d,IPDemoLine(at,"@Tank#68","Boss {1}:1","Activate",0,false,-1,"Energy Shield","814218425139200"))
    return d
}

V69RotationRecordedCastsImpl()
{
    d := V69RotationFixture()
    V68TimelineAdd(d,IPDemoLine(2500,"@Other#69","Boss {1}:1","Activate",0,false,-1,"Other cast","20"))
    V68TimelineAdd(d,IPDemoLine(3000,"@Tank#68","Boss {1}:1","Activate",0,false,-1,"Rejected","21"),false)
    V68TimelineAdd(d,IPDemoLine(3500,"@Tank#68","Boss {1}:1","Damage",200))
    late := V68TimelineAdd(d,IPDemoLine(500,"@Tank#68","Boss {1}:1","Activate",0,false,-1,"Late record","22"))
    m := IAVRModel(d,IANewQuery(d,"@Tank#68"))
    V48Assert(m.Casts.Length=8,"only this player's accepted activation records appear; damage ticks never create casts")
    V48Assert(m.Casts[2].Name="Late record" && m.Casts[2].Gap=500,"late records sort by timestamp before file sequence")
    V48Assert(m.Casts[3].At=1500 && m.Casts[4].At=1500 && m.Casts[4].Gap=0,"same-time activations remain individually selectable")
    V48Assert(m.Casts[3].Seq<m.Casts[4].Seq && m.Casts[3].GCD="Unknown","same-time order follows log order and unknown GCD metadata stays unknown")
    V48Assert(d.Rows[11]=late && d.Rows[2].Analysis.At=1500,"building rotation does not reorder or mutate the captured dataset")
    q := IANewQuery(d,"@Tank#68",1.5,10),q.FirstSeq := 3,q.LastSeq := 4
    selected := IAVRModel(d,q)
    V48Assert(selected.Casts.Length=2 && selected.Casts[1].Seq=3,"Analysis event selections retain their sequence bounds")
    d.Rows[2].RecordId := 18,d.Rows[3].RecordId := 21
    q := IANewQuery(d,"@Tank#68",1,1.5)
    q.PhaseBoundary := {Start:1000,StartSeq:0,IncludeStart:true,End:1500,EndSeq:20,OpenEnd:false}
    selected := IAVRModel(d,q)
    V48Assert(selected.Casts.Length=1 && selected.Casts[1].Seq=2,"phase RecordId edge retains earlier same-ms activation and excludes later one")
    V59ExpectError((*)=>IAVRModel(d,IANewQuery(d)))
}

V69RotationPageEdgesImpl()
{
    m := IAVRModel(V69RotationFixture(),IANewQuery(V69RotationFixture(),"@Tank#68")),seen := Map()
    Loop 4 {
        p := IAVRPage(m,A_Index-1,10000)
        for cast in p.Casts {
            V48Assert(!seen.Has(cast.Index),"adjacent pages do not duplicate boundary casts")
            seen[cast.Index] := true
        }
    }
    V48Assert(seen.Count=m.Casts.Length,"all accepted casts including final endpoint remain reachable")
    V48Assert(IAVRPage(m,999,10000).Index=3 && IAVRPage(m,-5,10000).Index=0,"window paging stays inside the phase")
    p := IAVRPage(m,0,10000)
    V48Assert(p.Casts.Length=4 && p.Casts[4].At=9999,"nonfinal window excludes the exact next-window boundary")
    zero := {From:0,To:0,Casts:[]},p := IAVRPage(zero,5,10000)
    V48Assert(p.Count=1 && p.Duration=1 && !p.Casts.Length,"empty instantaneous source has a stable drawable window")
    d := V69RotationFixture(),V68TimelineAdd(d,IPDemoLine(41000,"@Tank#68","=","Activate",0,false,-1,"Accepted ending action","50"))
    m := IAVRModel(d,IANewQuery(d,"@Tank#68")),p := IAVRPage(m,4,10000)
    V48Assert(m.Tail && m.To=41000 && p.Casts[p.Casts.Length].At=41000,"accepted end bookkeeping remains reachable after nominal fight duration")
}

V69RotationCollisionLayoutImpl()
{
    d := V69RotationFixture(),m := IAVRModel(d,IANewQuery(d,"@Tank#68")),p := IAVRPage(m,0,10000)
    for z in [1,1.5,2] {
        draw := IAVRLayout(m,p,1000*z,320*z,z,"none")
        V48Assert(draw.Items.Length=4 && draw.Hidden=0,"ordinary cast density fits at each display scale")
        a := draw.Items[1],b := draw.Items[2]
        V48Assert(Abs((b.X-a.X)/(draw.R-draw.L)-0.15)<0.0001,"horizontal placement preserves real time gaps")
        for i,item in draw.Items {
            V48Assert(item.L>=0 && item.R<=draw.Width && item.T>=0 && item.B<=draw.Height,"icon rectangles remain inside chart")
            V48Assert(IAVRHit(draw,(item.L+item.R)/2,(item.T+item.B)/2).Index=item.Cast.Index,"every displayed icon returns its precise activation")
            for j,other in draw.Items {
                if i>=j
                    continue
                V48Assert(item.R<other.L || other.R<item.L || item.B<other.T || other.B<item.T,"simultaneous and close casts never overlap")
            }
        }
        V48Assert(!IsObject(IAVRHit(draw,0,0)),"axis whitespace does not select an unrelated cast")
    }
    Loop 20
        V68TimelineAdd(d,IPDemoLine(1500,"@Tank#68","=","Activate",0,false,-1,"Crowded","999"))
    m := IAVRModel(d,IANewQuery(d,"@Tank#68")),p := IAVRPage(m,0,10000),draw := IAVRLayout(m,p,900,220,1,"none")
    V48Assert(draw.Hidden>0 && draw.Items.Length+draw.Hidden=p.Casts.Length,"crowding is disclosed and all casts remain in the complete page list")
}

V69RotationEffectEdgesImpl()
{
    d := V68TimelineData(),V68TimelineAdd(d,V68TimelineEffect(1000))
    before := V68TimelineAdd(d,IPDemoLine(2000,"@Tank#68","=","Activate",0,false,-1,"Before removal","1"))
    V68TimelineAdd(d,V68TimelineEffect(2000,,,"remove"))
    after := V68TimelineAdd(d,IPDemoLine(2000,"@Tank#68","=","Activate",0,false,-1,"After removal","2"))
    V68TimelineAdd(d,V68TimelineEffect(3000,"900","Uncatalogued buff","apply","901"))
    V68TimelineAdd(d,IPDemoLine(4000,"@Tank#68","=","Activate",0,false,-1,"Later","3"))
    m := IAVRModel(d,IANewQuery(d,"@Tank#68"))
    V48Assert(IAVREffectsAt(m,m.Casts[1]).Length=1 && !IAVREffectsAt(m,m.Casts[2]).Length,"same-millisecond gain/removal ordering determines which effects were active")
    V48Assert(IAVREffectsAt(m,m.Casts[3])[1]="Uncatalogued buff (removal not recorded)","unrecorded buff end is explicit rather than a guessed duration")
    V48Assert(IAVRVisibleEffects(m,"").Length=1 && IAVRVisibleEffects(m,"900")[1].Name="Uncatalogued buff","known-effects default and exact arbitrary effect selection both work")
    V48Assert(!IAVRVisibleEffects(m,"none").Length,"effect bands can be turned off")
    V48Assert(m.Effects[1].Start=1000 && m.Effects[1].End=2000,"band length uses actual observed application/removal")
    draw := IAVRLayout(m,IAVRPage(m,0,20000),900,220,1)
    for lane in draw.Lanes {
        V48Assert(lane.T+18<lane.BarT && lane.BarT<lane.B,"buff labels stay above their timed bars")
        for item in draw.Items
            V48Assert(item.B+20<lane.T,"cast timestamps do not overlap effect names at minimum chart height")
    }
}

V69RotationUISetup(s)
{
    V68ReviewUILoadedSetup(s),r := IAVRState(),saved := Map()
    for key,value in r.OwnProps()
        saved[key] := value
    r.Gui := "",r.Controls := Map(),r.Icons := Map(),r.Busy := false,r.Updating := false,r.Failures := 0,r.Closing := false,r.OwnerHwnd := 0
    r.Model := "",r.Draw := "",r.Window := 20000,r.Page := 0
    return saved
}

V69RotationUIRestore(saved)
{
    r := IAVRState(),r.Busy := false,IAVRClose()
    for key,value in saved
        r.%key% := value
}

V69RotationNativeWindowImpl(s)
{
    global IP,Audio
    saved := V69RotationUISetup(s),r := IAVRState(),data := s.A.Data,ia := IAState().Data,queue := Audio.Queue.Length
    try {
        V48Assert(IAVROpenFromReview("A"),"loaded Progression side opens the visual rotation without a new replay")
        V48Assert(!DllCall("IsWindowVisible","Ptr",r.Gui.Hwnd),"manual diagnostics keep the native window hidden")
        V48Assert(r.Data=data && IAState().Data=ia && Audio.Queue.Length=queue,"opening visual review leaves Analysis dataset and audio untouched")
        V48Assert(r.Failures=0 && IsObject(r.Draw),"native GDI chart paints successfully")
        for dims in [[900,600],[1080,720],[1440,900]] {
            IAVRResize(r.Gui,0,dims[1],dims[2]),c := r.Controls
            c["Chart"].GetPos(&x,&y,&w,&h),c["Casts"].GetPos(&tx,&ty,&tw,&th)
            c["Footer"].GetPos(&fx,&fy,&fw,&fh),c["Detail"].GetPos(&dx,&dy,&dw,&dh)
            V48Assert(y+h<ty && ty+th<fy && dx>tx+tw && dx+dw<=dims[1],"chart, table, details and footer fit the resized window")
            bmp := SendMessage(0x173,0,0,c["Chart"].Hwnd),info := Buffer(A_PtrSize=8 ? 32 : 24)
            V48Assert(bmp && DllCall("Gdi32\GetObjectW","Ptr",bmp,"Int",info.Size,"Ptr",info),"native chart has a real bitmap")
        }
        handles := []
        for key,image in r.Icons
            if IsObject(image) {
                handles.Push(image.Handle)
                DllCall("Gdi32\GetObjectW","Ptr",image.Handle,"Int",info.Size,"Ptr",info)
                V48Assert(NumGet(info,18,"UShort")=24,"PNG icons are opaque before mixing with GDI text and buff bands")
            }
        V48Assert(handles.Length>0,"native chart verification includes actual bundled icon artwork")
        hwnd := r.Gui.Hwnd,IAVRCloseForOwner(hwnd)
        V48Assert(IPMUiHandle(r.Gui)=hwnd,"closing another window cannot retire this review")
        IAVRCloseForOwner(r.OwnerHwnd)
        V48Assert(!DllCall("IsWindow","Ptr",hwnd) && !IsObject(r.Data) && r.Icons.Count=0,"closing releases review data and owned icon cache")
        for handle in handles
            V48Assert(!DllCall("Gdi32\GetObjectW","Ptr",handle,"Int",info.Size,"Ptr",info),"cached icon bitmap is released on close")
    }
    finally V69RotationUIRestore(saved)
}

V69RotationSelectionImpl(s)
{
    saved := V69RotationUISetup(s),r := IAVRState()
    try {
        IAVROpenFromReview("A"),d := r.Data
        r.Controls["Phase"].Choose(2),IAVRChanged("phase")
        V48Assert(r.Model.From=d.Start && r.Model.To=d.Start+10000,"phase selector uses the supported exact phase range")
        r.Controls["Window"].Choose(1),IAVRChanged("window")
        V48Assert(r.Window=10000 && r.Page=0,"zoom keeps the current time in a valid page")
        if r.Model.Casts.Length {
            cast := r.Model.Casts[1],IAVRShowCast(cast)
            V48Assert(r.Selected=cast.Index && InStr(r.Controls["Detail"].Value,cast.Name),"cast selection connects icon identity to readable details")
        }
        r.Controls["Player"].Choose(2),IAVRChanged("player")
        for cast in r.Model.Casts
            V48Assert(cast.Event.Source.Key=r.Actor,"changing player never leaves casts from the previous player")
        V48Assert(r.Selected=0 && r.Page=0 && r.Failures=0,"selection resets and redraw remains valid after changing player")
        query := IANewQuery(d,r.Actor,2,8),IAVROpen(d,r.Actor,"",0,query)
        V48Assert(r.Phases[r.Phase].Name="Current Analysis range" && r.Model.From=d.Start+2000 && r.Model.To=d.Start+8000,"Analysis custom range is preserved independently of automatic phases")
    }
    finally V69RotationUIRestore(saved)
}

; Native local artwork tests. Isolate cache paths from the normal application.
V69IconsExactIdentity() => V69IconsFixture(V69IconsExactIdentityImpl)
V69IconsIntegrity() => V69IconsFixture(V69IconsIntegrityImpl)
V69IconsNativePicture() => V69IconsFixture(V69IconsNativePictureImpl)

V69IconsFixture(action)
{
    state := IAIState(),saved := Map(),folder := A_Temp "\Iris69Icons_" DllCall("GetCurrentProcessId") "_" A_TickCount
    for key,value in state.OwnProps()
        saved[key] := value
    state.Catalog := Map(),state.Paths := Map(),state.Root := folder,state.Failures := 0
    try action.Call(state)
    finally {
        ; Only exact generated test files; no recursive deletion or live cache.
        if DirExist(folder) {
            Loop Files folder "\*", "F"
                FileDelete(A_LoopFileFullPath)
            DirDelete(folder)
        }
        for key,value in saved
            state.%key% := value
    }
}

V69IconsExactIdentityImpl(s)
{
    V48Assert(IAICatalog().Count>1500 && s.Paths.Count=0 && !DirExist(s.Root),"reading the ID catalogue does not extract the image collection")
    V48Assert(IAIIconPath("99999999999999999999","Energy Shield")="" && !DirExist(s.Root),"a familiar display name never substitutes for an unknown ID")
    one := IAIIconPath("814218425139200","unrelated label")
    V48Assert(one!="" && FileExist(one) && s.Paths.Count=1,"exact known ID resolves independently of label and extracts one image lazily")
    files := 0
    Loop Files s.Root "\*.png","F"
        files += 1
    V48Assert(files=1,"first icon does not extract hundreds of unused images")
    V48Assert(IAIIconPath("814218425139200","another label")=one && s.Paths.Count=1,"repeated lookup reuses the already resolved icon")
    scorch := IAIIconPath("3384812186370048","Scorch")
    V48Assert(scorch!="" && scorch!=one,"Scorch has its verified distinct effect icon")
}

V69IconsIntegrityImpl(s)
{
    path := IAIIconPath("814218425139200"),file := IAICatalog()["814218425139200"],item := IAIEmbeddedImages()[file]
    V48Assert(IAIBinaryHash(FileRead(path,"RAW"))=item.Hash,"extracted PNG matches embedded digest")
    f := FileOpen(path,"w"),f.Write("corrupt cached image"),f.Close(),s.Paths.Clear()
    repaired := IAIIconPath("814218425139200")
    V48Assert(repaired=path && FileGetSize(path)=item.Bytes && IAIBinaryHash(FileRead(path,"RAW"))=item.Hash,"a corrupt disk image is repaired on a fresh cache lookup")
    V59ExpectError((*)=>IAIDecode("not valid base64"))
    blocker := s.Root "\blocked",f := FileOpen(blocker,"w"),f.Write("test"),f.Close()
    s.Paths.Clear(),s.Root := blocker
    V48Assert(IAIIconPath("814218425139200")="" && s.Failures=1,"unwritable cache falls back without an unhandled error")
    s.Root := SubStr(blocker,1,StrLen(blocker)-8)
}

V69IconsNativePictureImpl(s)
{
    g := Gui("+ToolWindow"),p := g.AddPicture("x0 y0 w64 h64","")
    try {
        V48Assert(IAISetPicture(p,"814218425139200","Energy Shield"),"bundled PNG loads in a real native Picture control")
        bmp := SendMessage(0x173,0,0,p.Hwnd),info := Buffer(A_PtrSize=8 ? 32 : 24)
        V48Assert(bmp && DllCall("Gdi32\GetObjectW","Ptr",bmp,"Int",info.Size,"Ptr",info),"native image is backed by a valid bitmap")
        V48Assert(NumGet(info,4,"Int")>0 && NumGet(info,8,"Int")>0,"loaded icon has nonzero dimensions")
        V48Assert(!IAISetPicture(p,"99999999999999999999","Energy Shield") && !p.Visible,"unknown identity hides only its image, allowing the caller's label fallback")
        V48Assert(!DllCall("IsWindowVisible","Ptr",g.Hwnd),"artwork diagnostic never displays a live window")
    }
    finally g.Destroy()
}

; Isolated enemy-effect tests: no log reader, speech, hotkeys or personal INI.
V69EnemyIdentity() => V69EnemyIdentityImpl()
V69EnemyFilters() => V69EnemyFiltersImpl()
V69EnemyLifecycle() => V69EnemyLifecycleImpl()
V69EnemyEstimates() => V69EnemyEstimatesImpl()
V69EnemyBounds() => V69EnemyBoundsImpl()
V69EnemyNativeOverlay() => V69IconsFixture(V69EnemyUIOuter)

V69EnemyPrefs()
{
    return {SourceFilter:1,NameFilter:"",Durations:"3384812186370048=30",OnlyAffected:true}
}

V69EnemyFeed(s,at,target := "Guardian {99001}:1",source := "@Me#1",id := "3384812186370048",name := "Scorch",action := "apply",origin := "one",segment := "1")
{
    line := IAEffectLine(at,source,target,name,id,action)
    IENObserve(s,IPParseLine(line),at,line,origin,"@Me#1",segment,"",ClockMs())
    return IPParseLine(line)
}

V69EnemyIdentityImpl()
{
    s := IENNewState(),p := V69EnemyPrefs()
    one := V69EnemyFeed(s,1000),two := V69EnemyFeed(s,1100,"Guardian {99001}:2")
    rows := IENRows(s,p,1500)
    V48Assert(rows.Length=2 && rows[1].Name="Guardian #1" && rows[2].Name="Guardian #2","same-named enemies remain separate, stable instance rows")
    V48Assert(rows[1].Key!=rows[2].Key && rows[1].Effects[1].Effect.Target.Key=one.Target.Key,"effect stays keyed to its precise NPC instance")
    taunt := IPDemoLine(1600,"@Other#2","Guardian {99001}:1","Activate",0,false,-1,"Taunt","3718004803043328")
    IENObserve(s,IPParseLine(taunt),1600,taunt,"one","@Me#1","1")
    hit := IPDemoLine(1700,"Guardian {99001}:1","@Other#2","Damage",10)
    IENObserve(s,IPParseLine(hit),1700,hit,"one","@Me#1","1")
    rows := IENRows(s,p,1700)
    V48Assert(rows.Length=2 && rows[1].Key=one.Target.Key && rows[1].Effects[1].Effect.Source.Key="@Me#1","taunt and changed victim never move Scorch to another actor")
    V69EnemyFeed(s,1800,"Guardian {99001}:1",,"3384812186370048","Scorch","remove")
    rows := IENRows(s,p,1800)
    V48Assert(rows.Length=1 && rows[1].Key=two.Target.Key && rows[1].Name="Guardian #2","removal clears only its matching instance without renumbering survivors")
}

V69EnemyFiltersImpl()
{
    s := IENNewState(),p := V69EnemyPrefs(),ev := V69EnemyFeed(s,1000)
    V69EnemyFeed(s,1100,"Guardian {99001}:1","@Other#2")
    V69EnemyFeed(s,1200,"Guardian {99001}:1",,"3384812186370318","Susceptible (Tech)")
    V48Assert(IENRows(s,p,1500)[1].Effects.Length=2,"own filter excludes the other player's identical debuff")
    p.SourceFilter := 2,rows := IENRows(s,p,1500)
    V48Assert(rows[1].Effects.Length=3,"raid filter preserves distinct casters of an identical effect")
    p.NameFilter := "3384812186370318"
    V48Assert(IENRows(s,p,1500)[1].Effects.Length=1,"exact ID filter selects the requested debuff")
    p.NameFilter := "scorch"
    V48Assert(IENRows(s,p,1500)[1].Effects.Length=2,"case-insensitive name filter includes separate matching sources")
    p.NameFilter := "does not exist"
    V48Assert(!IENRows(s,p,1500).Length,"only-affected mode omits rows with no matching effect")
    p.OnlyAffected := false
    V48Assert(IENRows(s,p,1500).Length=1 && !IENRows(s,p,1500)[1].Effects.Length,"show-all-enemies retains an empty row after filtering")
    p.SourceFilter := 1,p.OnlyAffected := true,p.NameFilter := "",s.Owner := ""
    V48Assert(!IENRows(s,p,1500).Length,"unknown local character does not show all-player data as your effects")
    s := IENNewState(),V69EnemyFeed(s,1000,"Companion {99001}",,"9000000000001","Friendly effect")
    V48Assert(s.Actors.Count=0,"NPC entries without an instance identity do not become distinct enemy rows")
}

V69EnemyLifecycleImpl()
{
    s := IENNewState(),p := V69EnemyPrefs(),ev := V69EnemyFeed(s,3000)
    death := IPDemoLine(2500,"@Me#1","Guardian {99001}:1","Death")
    IENObserve(s,IPParseLine(death),2500,death,"one","@Me#1","1")
    V48Assert(!s.Actors[ev.Target.Key].Dead && s.Effects.Active.Count=1,"late death cannot erase newer evidence")
    V69EnemyFeed(s,3500),row := IENRows(s,p,3600)[1].Effects[1].Effect
    V48Assert(s.Effects.Active.Count=1 && row.Start=3500,"recorded reapplication resets its own observed start without duplicating")
    death := IPDemoLine(4000,"@Me#1","Guardian {99001}:1","Death")
    IENObserve(s,IPParseLine(death),4000,death,"one","@Me#1","1")
    V48Assert(s.Actors[ev.Target.Key].Dead && s.Effects.Active.Count=0 && !IENRows(s,p,4000).Length,"observed death removes the enemy and its effects")
    V69EnemyFeed(s,3900),V69EnemyFeed(s,4500)
    V48Assert(s.Effects.Active.Count=0,"late or post-death applies cannot recreate a dead instance's effects")
    V69EnemyFeed(s,5000,"Guardian {99001}:2")
    V48Assert(IENRows(s,p,5000).Length=1,"fresh NPC identity may receive a separately recorded transfer")
    V69EnemyFeed(s,6000,"Guardian {99001}:3",,,,,"one","2")
    V48Assert(s.Actors.Count=1 && s.Effects.Active.Count=1 && s.Segment="2","new pull retires all prior enemy/effect identities")
    V69EnemyFeed(s,7000,"Guardian {99001}:4",,,,,"two","2")
    V48Assert(s.Source="two" && s.Actors.Count=1,"new log source clears previous evidence")
    area := IPParseLine(death),area.Kind := "Area"
    IENObserve(s,area,7500,"","two","@Me#1","2")
    V48Assert(s.Actors.Count=0 && s.Effects.Active.Count=0 && s.LastAt=-1,"area transition clears the overlay")
    s := IENNewState(),death := IPDemoLine(2000,"@Me#1","Guardian {99001}:1","Death")
    IENObserve(s,IPParseLine(death),2000,death,"one","@Me#1","1"),V69EnemyFeed(s,1900)
    V48Assert(!IENRows(s,p,2200).Length && s.Effects.Active.Count=0,"first-seen death also blocks a later-delivered application")
}

V69EnemyEstimatesImpl()
{
    s := IENNewState(),p := V69EnemyPrefs(),V69EnemyFeed(s,1000)
    row := IENRows(s,p,6000)[1].Effects[1]
    V48Assert(row.Status.Time="~25s" && row.Status.Estimated,"configured duration is visibly approximate")
    row := IENRows(s,p,35000)[1].Effects[1]
    V48Assert(row.Status.Stale && InStr(row.Status.Time,"?"),"estimated expiry does not pretend a removal was observed")
    V69EnemyFeed(s,36000),row := IENRows(s,p,37000)[1].Effects[1]
    V48Assert(row.Status.Time="~29s" && !row.Status.Stale,"fresh observed reapply restarts only its own duration")
    p.Durations := "",row := IENRows(s,p,38000)[1].Effects[1]
    V48Assert(row.Status.Time="2s ago" && !row.Status.Estimated,"without a configured duration show observed age rather than guess")
}

V69EnemyBoundsImpl()
{
    s := IENNewState()
    Loop 270 {
        ev := IPParseLine(IPDemoLine(A_Index,"@Me#1","Guardian {99001}:" A_Index,"Damage",1))
        IENObserve(s,ev,A_Index,"","one","@Me#1","1")
    }
    V48Assert(s.Actors.Count=256 && s.Limit,"unusually large encounters keep a bounded enemy index with explicit limit state")
    IENReset(s)
    V48Assert(s.Actors.Count=0 && s.Names.Count=0 && !s.Limit && s.Owner="","reset drops all index, numbering and owner state")
    preview := IENPreview()
    V48Assert(preview.Actors.Count=3 && preview.Effects.Active.Count=4,"preview supplies independent sample enemies and effects")
}

V69EnemyUIOuter(icons)
{
    V522Isolated(V69EnemyNativeOverlayImpl)
}

V69EnemyNativeOverlayImpl()
{
    global IPM,IP,SETTINGS_FILE
    state := IENState(),prefs := IENUState(),savedState := Map(),savedPrefs := Map()
    for key,value in state.OwnProps()
        savedState[key] := value
    for key,value in prefs.OwnProps()
        savedPrefs[key] := value
    fresh := IENNewState()
    for key,value in fresh.OwnProps()
        state.%key% := value
    prefs.Gui := "",prefs.Controls := Map(),prefs.SourceFilter := 1,prefs.NameFilter := "",prefs.OnlyAffected := true
    prefs.Durations := "3384812186370048=30"
    p := IPM.Panels.Has("EnemyDebuffs") ? IPM.Panels["EnemyDebuffs"] : IPM.Panels["Effects"]
    try {
        IPMEnsureGui("Effects",0,p),before := state.Effects.Active.Count
        for width in [196,360,620] {
            p.Width := width,p.Signature := "",IENRender({LayoutPreview:true},p)
            V48Assert(InStr(p.Heading.Text,"PREVIEW") && state.Effects.Active.Count=before,"preview does not change live evidence")
            V48Assert(!DllCall("IsWindowVisible","Ptr",p.Gui.Hwnd),"native overlay diagnostic remains hidden")
            for i,row in p.Rows {
                if i>p.VisibleRows
                    break
                for cell in p.EnemyCells[i] {
                    if !cell.Label.Visible
                        continue
                    cell.Label.GetPos(&x,&y,&w,&h)
                    cell.Time.GetPos(&tx,&ty,&tw,&th)
                    V48Assert(x>=0 && x+w<=p.Layout.W && y>=p.Layout.Header && y+h<=p.Layout.H,"icon labels stay within resized enemy rows")
                    V48Assert(cell.Time.Visible && y+h<=ty && ty+th<=p.Layout.H && tx=x && tw=w && !InStr(cell.Label.Text,"`n"),"effect name and full countdown occupy separate visible lines")
                }
            }
        }
        V69EnemyFeed(state,1000),p.Signature := "",IP.Active := false,IENRender({},p)
        V48Assert(InStr(p.Meta.Text,"Parser stopped") && p.VisibleRows=1,"stopped parser clearly labels retained last-observed effects")
        IP.Active := true,IP.Live := IPNewData("SYNTHETIC LIVE"),p.Signature := "",IENRender({},p)
        V48Assert(p.Meta.Text="Your effects" && p.VisibleRows=1,"active live snapshot uses normal own-effects heading")
        cell := p.EnemyCells[1][1],bitmap := SendMessage(0x173,0,0,cell.Icon.Hwnd)
        state.LastAt += 1000,p.Signature := "",IENRender({},p)
        V48Assert(bitmap && SendMessage(0x173,0,0,cell.Icon.Hwnd)=bitmap && cell.HaveIcon,"countdown redraw reuses the native icon instead of reopening PNG every second")
        g := IENOpenOptions()
        V48Assert(!DllCall("IsWindowVisible","Ptr",g.Hwnd),"options open hidden in diagnostics")
        prefs.Controls["SourceFilter"].Choose(2),prefs.Controls["NameFilter"].Value := "Scorch",IENSaveOptions()
        V48Assert(prefs.SourceFilter=2 && prefs.NameFilter="Scorch" && !FileExist(SETTINGS_FILE),"diagnostic option edits affect memory only")
    }
    finally {
        IENCloseOptions()
        for key,value in savedState
            state.%key% := value
        for key,value in savedPrefs
            prefs.%key% := value
    }
}

; The normal diagnostic harness bypasses startup OnExit registrations.
; Exercise real process termination in private children so a cleanup return value
; cannot silently veto Reload/Exit while ordinary in-process tests still pass.
V691ExitVetoControl() => V691ExitChildCase("control",false,91,false)
V691ExitNoTimeline() => V691ExitChildCase("fixed",false,17,false)
V691ExitOpenTimeline() => V691ExitChildCase("fixed",true,17,false)
V691ExitBusyTimeline() => V691ExitChildCase("fixed",true,17,true)

V7881CloseInputs() => V61Hidden(V7881CloseInputsCase)
V7881CloseInputsCase()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"shutdown test runs only in the suspended private diagnostic")
    foreground := DllCall("GetForegroundWindow","Ptr")
    try {
        Loop 2 {
            IAOpen(true),a := IAState(),hwnd := a.Gui.Hwnd
            V48Assert(a.Hooks && !DllCall("IsWindowVisible","Ptr",hwnd),"analysis opens hidden with its actual input hooks")
            a.Brush := {Start:0},DllCall("SetCapture","Ptr",hwnd)
            IACleanup(),IACleanup()
            V48Assert(!DllCall("IsWindow","Ptr",hwnd) && !a.Hooks && !IsObject(a.Brush),"repeated analysis cleanup destroys the window and retires brush and hooks")
            V48Assert(!DllCall("GetCapture","Ptr"),"analysis teardown releases its mouse capture")
            ; These two installers only register message handlers. Never enable
            ; normal startup, parsing, speech, game hotkeys or saved preferences.
            try SELF_TEST := false,IWScrollInstall(),IAVRInstallScroll()
            finally SELF_TEST := true
            V48Assert(IWScrollState().Installed && IAVRState().ScrollHooks,"scroll input can install again after previous cleanup")
            IWScrollState().Remainder := 60,IWScrollState().Control := hwnd
            V48Assert(IWScrollShutdown()=0 && IAVRShutdown()=0,"input cleanup cannot veto process exit")
            V48Assert(!IWScrollState().Installed && !IWScrollState().Remainder && !IWScrollState().Control && !IAVRState().ScrollHooks,"input cleanup clears registered and pending state")
            g := IPBESTWindow("Private notice"),h := g.Hwnd
            V48Assert(IPBESTState().Hooks && !DllCall("IsWindowVisible","Ptr",h),"personal-best fixture creates no visible notice")
            if A_Index=2
                g.Destroy()
            V48Assert(IPBESTShutdown()=0 && IPBESTShutdown()=0,"notice cleanup handles an open or already-destroyed window repeatedly")
            V48Assert(!DllCall("IsWindow","Ptr",h) && !IPBESTState().Hooks && !IsObject(IPBESTState().Gui),"notice releases its window and message registration")
        }
        V48Assert(DllCall("GetForegroundWindow","Ptr")=foreground,"shutdown fixtures never change the active application")
    }
    finally {
        SELF_TEST := true
        IACleanup(),IWScrollShutdown(),IAVRShutdown(),IPBESTShutdown()
    }
}

V7881BetaStop()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"journal cleanup test requires private diagnostics")
    s := IBRState(),saved := s.Clone(),root := A_ScriptDir "\shutdown-beta-private"
    V48Assert(!s.View,"fixture cannot replace an active journal")
    DirCreate(root)
    try {
        Loop 2 {
            V48Assert(IBRStart(root "\cycle-" A_Index),"private beta journal starts or restarts")
            path := s.Path
            OnError(IBROnError),s.Hooked := true,SetTimer(IBRTick,3000)
            IBRStop(),IBRStop()
            V48Assert(!s.View && !s.Mapping && !s.Hooked,"journal shutdown releases its mapping and observer repeatedly")
            d := IBRRead(path)
            V48Assert(d.Normal=1 && d.Rows[-1].Operation=30,"shutdown preserves a readable normal-exit journal")
            IBRTick()
            V48Assert(IBRRead(path).Last=d.Last,"a stale direct tick cannot append after journal shutdown")
        }
    }
    finally {
        IBRStop()
        for key,value in saved.OwnProps()
            s.%key% := value
        DirDelete(root,true)
    }
}

V7881BusyProgressionExit() => V61Hidden(V7881BusyProgressionExitCase)
V7881BusyProgressionExitCase()
{
    global IP
    IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IGVDemoData()
    IGVOpen(),v := IGVState(),busy := IHMUIState().Busy
    try {
        V48Assert(v.HoverHook,"progression fixture has native mouse observers")
        IHMUIState().Busy := true
        IGVClose()
        V48Assert(v.HoverHook,"ordinary close still defers safely while an edit is busy")
        V48Assert(IPShutdown()=0,"parser shutdown reaches busy progression cleanup")
        V48Assert(!v.HoverHook,"shutdown detaches progression input even when window close is deferred")
        V48Assert(IPShutdown()=0,"busy progression shutdown can repeat")
    }
    finally IHMUIState().Busy := busy,IGVClose()
}

V691ExitChildCase(mode,windows,expected,busy)
{
    runtime := A_ScriptDir "\Iris_Test_Runtime.ahk"
    V48Assert(FileExist(runtime),"isolated child uses the diagnostic runtime copy")
    root := A_Temp "\IrisExit691_" DllCall("GetCurrentProcessId") "_" mode "_" windows "_" busy "_" A_TickCount
    DirCreate(root)
    path := root "\exit-child.ahk",journal := root "\exit.txt",pid := 0,handle := 0
    source := '#Requires AutoHotkey v2.0`n#NoTrayIcon`n#SingleInstance Off`n#Warn VarUnset, StdOut`n'
        . 'Suspend(true)`nSOPHIE_TEST_HARNESS := true`nIRIS_V48_TEST_ENTRY := ProbeMain`n'
        . '#Include ' runtime '`n'
        . 'ProbeMain()`n{`n'
        . '    global ProbeHandles := [], ProbeJournal := A_ScriptDir "\exit.txt"`n'
        . '    FileAppend("started{{IRIS_LF}}",ProbeJournal,"UTF-8")`n'
    if windows {
        source .= '    for state in [IENUState(),ICPState(),IAVRState(),IGMState()] {`n'
            . '        state.Gui := Gui("+ToolWindow","Isolated Iris exit test")`n'
            . '        state.Gui.Show("Hide w100 h100")`n'
            . '        ProbeHandles.Push(state.Gui.Hwnd)`n'
            . '    }`n'
    }
    source .= '    IAVRState().Busy := ' (busy ? 'true' : 'false') '`n'
        . '    OnExit(ProbeBefore)`n'
        . '    OnExit(IENCloseOptions)`n'
        . '    OnExit(ICPShutdown)`n'
        . '    OnExit(' (mode="control" ? 'IAVRClose' : 'IAVRShutdown') ')`n'
        . '    OnExit(IGMShutdown)`n'
        . '    OnExit(ProbeAfter)`n'
        . '    SetTimer(ProbeWatchdog,-1200)`n'
        . '    ExitApp(17)`n'
        . '    FileAppend("returned{{IRIS_LF}}",ProbeJournal,"UTF-8")`n'
        . '}`n'
        . 'ProbeBefore(*)`n{`n    global ProbeJournal`n    FileAppend("before{{IRIS_LF}}",ProbeJournal,"UTF-8")`n    return 0`n}`n'
        . 'ProbeAfter(*)`n{`n    global ProbeHandles,ProbeJournal`n    alive := 0`n'
        . '    for hwnd in ProbeHandles`n        alive += !!DllCall("IsWindow","Ptr",hwnd)`n'
        . '    FileAppend("after:" alive "{{IRIS_LF}}",ProbeJournal,"UTF-8")`n    return 0`n}`n'
        . 'ProbeWatchdog()`n{`n    global ProbeJournal`n'
        . '    FileAppend("watchdog{{IRIS_LF}}",ProbeJournal,"UTF-8")`n'
        . '    OnExit(IAVRClose,0)`n    OnExit(IAVRShutdown,0)`n    ExitApp(91)`n}`n'
    ; Encode child string newlines without interpreting any part of a file path.
    source := StrReplace(source,"{{IRIS_LF}}","``n")
    FileAppend(source,path,"UTF-8")
    try {
        Run('"' A_AhkPath '" /ErrorStdOut=UTF-8 "' path '"',root,"Hide",&pid)
        handle := DllCall("OpenProcess","UInt",0x101000,"Int",false,"UInt",pid,"Ptr")
        V48Assert(handle!=0,"opened only this isolated probe process")
        wait := DllCall("WaitForSingleObject","Ptr",handle,"UInt",10000,"UInt")
        V48Assert(wait=0,"isolated exit probe terminates within its watchdog deadline")
        code := 0
        V48Assert(DllCall("GetExitCodeProcess","Ptr",handle,"UInt*",&code),"read child exit status")
        V48Assert(code=expected,"real ExitApp exit code proves whether cleanup vetoed termination")
        text := FileExist(journal) ? FileRead(journal,"UTF-8") : ""
        V48Assert(InStr(text,"started`nbefore`n"),"registered exit chain actually ran")
        if mode="control" {
            V48Assert(InStr(text,"watchdog`n"),"v69 control remained alive after ExitApp until watchdog removed veto")
            V48Assert(InStr(text,"after:")>InStr(text,"watchdog`n"),"veto prevented later exit handlers until watchdog recovery")
        }
        else {
            V48Assert(!InStr(text,"watchdog") && !InStr(text,"returned"),"fixed shutdown exits on first attempt without deferred execution")
            V48Assert(InStr(text,"after:" (busy ? 1 : 0) "`n"),"later exit handlers run and idle windows are destroyed")
        }
    }
    finally {
        ; Safety cleanup is restricted to the child started by this test.
        if pid && ProcessExist(pid)
            ProcessClose(pid)
        if handle
            DllCall("CloseHandle","Ptr",handle)
        try DirDelete(root,true)
    }
}

; Isolated native cache recovery tests. No normal UI, settings, audio or hotkeys.
V692IconDeletedCache() => V692IconRecoveryFixture(V692IconDeletedCacheImpl)
V692IconRetryCache() => V692IconRecoveryFixture(V692IconRetryCacheImpl)
V692RotationIconRecovery() => V692IconRecoveryFixture(V692RotationIconRecoveryImpl)
V692UnknownIconFallback() => V692IconRecoveryFixture(V692UnknownIconFallbackImpl)

V692IconRecoveryFixture(action)
{
    s := IAIState(),r := IAVRState(),savedIcons := Map(),savedRotation := Map()
    folder := A_Temp "\Iris692IconRecovery_" DllCall("GetCurrentProcessId") "_" A_TickCount
    for key,value in s.OwnProps()
        savedIcons[key] := value
    for key,value in r.OwnProps()
        savedRotation[key] := value
    s.Catalog := Map(),s.Paths := Map(),s.Root := folder,s.Failures := 0,r.Icons := Map()
    try action.Call(s,r)
    finally {
        for key,image in r.Icons
            if IsObject(image)
                DllCall("Gdi32\DeleteObject","Ptr",image.Handle)
        if DirExist(folder) {
            Loop Files folder "\*","F"
                FileDelete(A_LoopFileFullPath)
            DirDelete(folder)
        }
        else if FileExist(folder)
            FileDelete(folder)
        for key,value in savedIcons
            s.%key% := value
        for key,value in savedRotation
            r.%key% := value
    }
}

V692IconDeletedCacheImpl(s,r)
{
    id := "2849362908545024",path := IAIIconPath(id,"Saber Throw")
    V48Assert(path!="" && FileExist(path),"known artwork is extracted before deletion")
    FileDelete(path)
    V48Assert(!FileExist(path) && s.Paths.Count=1,"deleted file leaves the successful in-memory cache entry in place")
    repaired := IAIIconPath(id,"Saber Throw"),item := IAIEmbeddedImages()[IAICatalog()[id]]
    V48Assert(repaired=path && FileExist(path),"next lookup rebuilds a deleted icon without restarting or clearing caches")
    V48Assert(IAIBinaryHash(FileRead(path,"RAW"))=item.Hash && s.Failures=0,"rebuilt image matches the bundled digest without an extraction failure")
}

V692IconRetryCacheImpl(s,r)
{
    id := "2849362908545024",file := IAICatalog()[id]
    f := FileOpen(s.Root,"w"),f.Write("private fixture blocks its own directory"),f.Close()
    V48Assert(IAIIconPath(id)="" && s.Failures=1,"temporary unwritable cache produces a safe missing-image fallback")
    Loop 20
        IAIIconPath(id)
    V48Assert(s.Failures=1 && IsNumber(s.Paths[file]),"repeated lookup during retry delay does not repeat disk extraction")
    FileDelete(s.Root),DirCreate(s.Root)
    V48Assert(IAIIconPath(id)="" && s.Failures=1,"making the cache writable does not bypass its bounded retry delay")
    s.Paths[file] := A_TickCount-1 ; Advance only the isolated retry deadline, with no wall-clock sleep.
    path := IAIIconPath(id)
    V48Assert(path!="" && FileExist(path) && s.Failures=1,"expired retry succeeds after the transient cache failure is removed")
    V48Assert(IAIIconPath(id)=path && !IsNumber(s.Paths[file]),"successful retry replaces the failure deadline with the reusable path")
}

V692RotationIconRecoveryImpl(s,r)
{
    id := "2849362908545024",name := "Saber Throw",key := id Chr(30) name,file := IAICatalog()[id]
    f := FileOpen(s.Root,"w"),f.Write("private fixture blocks its own directory"),f.Close()
    V48Assert(!IsObject(IAVRIcon(id,name)) && s.Failures=1,"rotation tolerates a known image that cannot yet be extracted")
    Loop 20
        IAVRIcon(id,name)
    V48Assert(s.Failures=1 && IsNumber(r.Icons[key]),"rotation failure has a retry deadline and avoids repeated extraction")
    FileDelete(s.Root),DirCreate(s.Root),s.Paths[file] := A_TickCount-1
    V48Assert(!IsObject(IAVRIcon(id,name)) && IsNumber(r.Icons[key]),"rotation honors its own retry delay even after the path cache is ready")
    r.Icons[key] := A_TickCount-1,image := IAVRIcon(id,name),info := Buffer(A_PtrSize=8 ? 32 : 24)
    V48Assert(IsObject(image) && DllCall("Gdi32\GetObjectW","Ptr",image.Handle,"Int",info.Size,"Ptr",info),"rotation recovers a real native bitmap after the delay")
    V48Assert(NumGet(info,4,"Int")=64 && NumGet(info,8,"Int")=64 && NumGet(info,18,"UShort")=24,"recovered icon keeps the opaque 24-bit rendering needed by the chart")
    V48Assert(IAVRIcon(id,name)=image,"recovered successful bitmap stays cached across chart paints")
}

V692UnknownIconFallbackImpl(s,r)
{
    id := "99999999999999999999",name := "Saber Throw",key := id Chr(30) name
    Loop 20 {
        IAIIconPath(id,name)
        IAVRIcon(id,name)
    }
    V48Assert(!DirExist(s.Root) && s.Paths.Count=0 && s.Failures=0,"unknown exact IDs do not write files or create failed extraction retries")
    V48Assert(r.Icons.Has(key) && r.Icons[key]="","unknown rotation IDs retain a cheap stable initials fallback")
    V48Assert(!IsObject(IAVRIcon(id,name)),"a familiar ability name cannot substitute for an unknown exact ID")
}

; Whole-fight rotation review uses synthetic recorded actions and hidden native UI.
V692RotationWholeFightPage() => V692RotationWholeFightPageImpl()
V692RotationWholeFightDensity() => V692RotationWholeFightDensityImpl()
V692RotationWholeFightNative() => V69IconsFixture(V692RotationWholeFightNativeOuter)

V692RotationLongFight()
{
    d := V68TimelineData(840000),d.Name := "Synthetic 14-minute rotation",d.Demo := true
    d.Actors["@Tank#68"] := {Name:"Demo Tank",Kind:"Player"}
    Loop 600
        V68TimelineAdd(d,IPDemoLine((A_Index-1)*1400,"@Tank#68","=","Activate",0,false,-1,"Energy Shield","814218425139200"))
    V68TimelineAdd(d,IPDemoLine(840000,"@Tank#68","=","Activate",0,false,-1,"Final action","814218425139200"))
    V68TimelineAdd(d,V68TimelineEffect(180000))
    V68TimelineAdd(d,V68TimelineEffect(195000,,,"remove"))
    return d
}

V692RotationWholeFightPageImpl()
{
    d := V692RotationLongFight(),m := IAVRModel(d,IANewQuery(d,"@Tank#68")),p := IAVRPage(m,99,0)
    V48Assert(p.Whole && p.Index=0 && p.Count=1,"whole-fight view has one complete range regardless of the old window number")
    V48Assert(p.From=0 && p.To=840000 && p.Duration=840000,"whole-fight view covers all fourteen minutes")
    V48Assert(p.Casts.Length=601 && p.Casts[601].At=840000,"all recorded actions including the final endpoint remain available")
    zoom := IAVRPage(m,20,20000)
    V48Assert(!zoom.Whole && zoom.From=400000 && zoom.To=420000 && zoom.Casts.Length<601,"existing detailed windows retain their exact time bounds")
    last := IAVRPage(m,99,20000)
    V48Assert(last.Casts[last.Casts.Length].At=840000,"detailed final window also includes the exact fight-end action")
    zero := IAVRPage({From:10,To:10,Casts:[]},0,0)
    V48Assert(zero.Whole && zero.Duration=1 && zero.Casts.Length=0,"an empty instantaneous full range remains drawable")
}

V692RotationWholeFightDensityImpl()
{
    d := V692RotationLongFight(),m := IAVRModel(d,IANewQuery(d,"@Tank#68")),p := IAVRPage(m,0,0)
    for z in [1,1.5,2] {
        draw := IAVRLayout(m,p,900*z,220*z,z),plan := draw.Plan,total := 0
        for row in plan.Rows
            for cell in row.Cells
                total += cell.Off.Length+(IsObject(cell.Main) ? 1 : 0)
        V48Assert(draw.Sequence && !draw.Density && draw.Items.Length>0 && draw.Items.Length<601,"long overview now renders readable visible icon rows rather than bars or overlapping icons")
        V48Assert(total=601 && plan.CastRows.Has(601),"every real cast has one reachable position, including the right endpoint")
        overlap := false
        for i,item in draw.Items
            for j,other in draw.Items
                if i<j && !(item.R<=other.L || other.R<=item.L || item.B<=other.T || other.B<=item.T)
                    overlap := true
        V48Assert(!overlap,"visible main and utility icons remain separate at each scale")
    }
    short := IAVRModel(V69RotationFixture(),IANewQuery(V69RotationFixture(),"@Tank#68"))
    draw := IAVRLayout(short,IAVRPage(short,0,0),1080,300)
    V48Assert(!draw.Density && draw.Items.Length=short.Casts.Length,"short sparse full timelines retain readable ability icons")
}

V692RotationWholeFightNativeOuter(icons)
{
    V68ReviewUIFixture(V692RotationWholeFightNativeImpl)
}

V692RotationWholeFightNativeImpl(s)
{
    saved := V69RotationUISetup(s),r := IAVRState(),d := V692RotationLongFight()
    try {
        V48Assert(IAVROpen(d,"@Tank#68","",s.Gui.Hwnd),"fourteen-minute synthetic fight opens in the real native rotation window")
        V48Assert(r.Window=0 && r.Controls["Window"].Value=4 && r.CastRows.Length=601,"newly opened rotation defaults to the whole fight and lists every recorded cast")
        V48Assert(r.Draw.Sequence && !r.Draw.Density && !r.Controls["Previous"].Enabled && !r.Controls["Next"].Enabled,"overview uses scrollable icon rows without forcing dozens of previous/next windows")
        V48Assert(r.Failures=0 && !DllCall("IsWindowVisible","Ptr",r.Gui.Hwnd),"native overview paints successfully without showing a live window")
        for dims in [[900,600],[1080,720],[1440,900]] {
            IAVRResize(r.Gui,0,dims[1],dims[2])
            bitmap := SendMessage(0x173,0,0,r.Controls["Chart"].Hwnd),info := Buffer(A_PtrSize=8 ? 32 : 24)
            V48Assert(bitmap && DllCall("Gdi32\GetObjectW","Ptr",bitmap,"Int",info.Size,"Ptr",info),"resized full-fight chart owns a valid native bitmap")
        }
        V48Assert(IAVRZoomTo(420000) && r.Window=20000 && r.Page=21,"click-position zoom opens the requested twenty-second part of the fight")
        V48Assert(!r.Draw.Density && r.Draw.Items.Length>0 && r.CastRows[1].At>=420000,"zoom returns to individual recorded ability icons at the selected time")
        r.Controls["Window"].Choose(4),IAVRChanged("window")
        V48Assert(r.Window=0 && r.Page=0 && r.CastRows.Length=601,"Whole fight choice returns to all casts in one step")
        finalCast := r.CastRows[601],IAVRShowCast(finalCast)
        found := false
        for item in r.Draw.Items
            found := found || item.Cast.Index=601
        V48Assert(r.Window=0 && r.Page=0 && r.Selected=601 && found,"selecting an overview cast scrolls to its icon while preserving the whole-fight view")
        V48Assert(InStr(r.Controls["Detail"].Value,"Final action") && r.CastRows[r.CastRows.Length].Index=601,"selected final cast keeps its details and remains in the complete list")
        for choice,window in [10000,20000,40000] {
            r.Controls["Window"].Choose(choice),IAVRChanged("window")
            V48Assert(r.Window=window && r.Failures=0,"all existing ten/twenty/forty-second choices remain usable")
        }
    }
    finally V69RotationUIRestore(saved)
}

V692IconsExpansion() => V69IconsFixture(V692IconsExpansionBody)
V692IconsAllBundled() => V69IconsFixture(V692IconsAllBundledBody)
V692IconsRecordedActivations() => V69IconsFixture(V692IconsRecordedActivationsBody)

V692IconsExpansionBody(s)
{
    expected := Map("807788859097427","saberThrowSith.png","2515566640234759","jp694_enrage.png",
        "2515566640234757","jp696_bbb57fd703948784.png","4258833736138752","jp_6_0_adrenals_red.png")
    ; The two activation aliases are different from their older base IDs.
    for id,file in expected {
        V48Assert(IAICatalog().Has(id),"recorded Juggernaut/consumable activation ID is covered: " id)
        V48Assert(IAICatalog()[id]=file,"reviewed exact ability has its correct artwork: " id)
        V48Assert(IAIIconPath(id)!="","recorded ability extracts a usable offline image: " id)
    }
    for id in ["4258842326073344","4258855210975232","4258846621040640","4256329770205184",
        "4256312590336000","4256321180270592","4056523596627968","4516080802332672",
        "4502478640906240","4504089253642240","4498514386092032","4559408432414720","3704525256916992"]
        V48Assert(IAIIconPath(id)!="","verified consumable or modern class ability has an icon: " id)
    V48Assert(IAIIconPath("807788859097429","Saber Throw")="","unreviewed numeric neighbor does not inherit a guessed icon")
}

V692IconsAllBundledBody(s)
{
    seen := Map(),images := IAIEmbeddedImages()
    for id,file in IAICatalog() {
        if seen.Has(file)
            continue
        seen[file] := true,path := IAIIconPath(id)
        V48Assert(path!="" && IAIBinaryHash(FileRead(path,"RAW"))=images[file].Hash,"every bundled image extracts with its expected digest: " file)
        kind := -1,bmp := LoadPicture(path,"w64 h64",&kind)
        try {
            info := Buffer(A_PtrSize=8 ? 32 : 24)
            V48Assert(bmp && kind=0 && DllCall("Gdi32\GetObjectW","Ptr",bmp,"Int",info.Size,"Ptr",info),"Windows can decode every bundled ability icon: " file)
            V48Assert(NumGet(info,4,"Int")=64 && NumGet(info,8,"Int")=64,"loaded icon has real64x64 bitmap dimensions")
        }
        finally {
            if bmp
                DllCall("Gdi32\DeleteObject","Ptr",bmp)
        }
    }
    V48Assert(seen.Count=images.Count && seen.Count>=777,"all embedded images are covered and referenced")
}

V692IconsRecordedActivationsBody(s)
{
    rotation := IAVRState(),saved := rotation.Icons,rotation.Icons := Map()
    try {
        for id,name in Map("807788859097427","Saber Throw","2515566640234757","Bloodrage",
            "2515566640234759","Enrage","4258833736138752","Advanced Polybiotic Attack Adrenal") {
            raw := "[00:01:40.000] [@Example#1001|(0,0,0,0)|(100/100)] [=] [" name " {" id "}] [Event {836045448945472}: AbilityActivate {836045448945479}] ()"
            ev := IPParseLine(raw)
            V48Assert(ev.Kind="Activate" && ev.AbilityId=id,"parser retains the exact activation ID used in real logs")
            item := IAVRIcon(ev.AbilityId,ev.Ability),info := Buffer(A_PtrSize=8 ? 32 : 24)
            V48Assert(IsObject(item) && DllCall("Gdi32\GetObjectW","Ptr",item.Handle,"Int",info.Size,"Ptr",info),"recorded rotation entry resolves to a real native icon")
            V48Assert(NumGet(info,18,"UShort")=24,"rotation keeps its opaque24bit bitmap for visible labels")
        }
    }
    finally {
        for key,item in rotation.Icons {
            if IsObject(item) && item.HasOwnProp("Handle")
                DllCall("Gdi32\DeleteObject","Ptr",item.Handle)
        }
        rotation.Icons := saved
    }
}

; Native, isolated Analysis replay/cache regressions. All source files are fixtures.
V692AnalysisFixture(action,mode := "")
{
    V591Isolated(V692AnalysisFixtureInner.Bind(action,mode))
}

V692AnalysisFixtureInner(action,mode)
{
    global IP
    static serial := 0
    serial += 1
    path := A_ScriptDir "\Iris692Analysis_" DllCall("GetCurrentProcessId","UInt") "_" serial ".txt"
    V48Assert(!FileExist(path),"Analysis fixture never overwrites an existing source")
    a := V598Ready(),lines := IADemoLines(),start := 3600000
    tank := "@Demo Tank#101|(0,0,0,0)|(90000/100000)"
    dps := "@Demo DPS#102|(0,0,0,0)|(100000/100000)"
    healer := "@Demo Healer#103|(0,0,0,0)|(100000/100000)"
    boss := "Operations Training Dummy {2857785339412480}:990001|(0,0,0,0)|(90000/100000)"
    lines.Push(IPDemoLine(start+20500,tank,"=","Exit"))
    if mode="rollback" {
        lines.Push(IPDemoLine(start+20600,healer,tank,"Heal",900,false,600,"Tail heal","990000000000015"))
        lines.Push(IPDemoLine(start+21000,dps,boss,"Damage",1234,false,-1,"Continued hit","990000000000016"))
        lines.Push(IPDemoLine(start+22000,tank,"=","Exit"))
    }
    ; A later encounter remains active across at least one 64-record checkpoint.
    lines.Push(IPDemoLine(start+40000,tank,"=","Enter"))
    Loop 180 {
        at := start+40000+A_Index*100
        lines.Push(IPDemoLine(at,dps,boss,"Damage",10,false,-1,"Later fight","990000000000017"))
    }
    lines.Push(IPDemoLine(start+59000,tank,"=","Exit"))
    Loop 400
        lines.Push(IPDemoLine(start+80000+A_Index*100,dps,"=","Activate",0,false,-1,"Later idle cast","990000000000018"))
    if mode="backdated"
        lines.Push(IAEffectLine(start+10000,dps,dps,"Late diagnostic effect","990000000000019"))
    if mode="partial"
        lines.Push(IPDemoLine(start+130000,dps,boss,"Damage",10000000000001,false,-1,"Invalid later value","990000000000020"))
    text := ""
    for line in lines
        text .= line "`n"
    try {
        f := FileOpen(path,"w","UTF-8-RAW"),f.Write(text),f.Close()
        s := V596Direct(text),s.SourcePath := path,s.SourceLength := FileGetSize(path),s.SourceModified := FileGetTime(path,"M")
        s.ProgressionComplete := true ; set only after the entire fixture was consumed
        IP.Offline := s,IP.View := "Imported",IP.Selected := 1,IP.Actor := "@Demo DPS#102"
        IP.ImportPath := path,IP.Encoding := "UTF-8",IP.Follow := false
        seg := s.Segments[1],seg.SourcePath := path,seg.SourceEncoding := "UTF-8"
        action.Call(a,s,seg,path,text)
    }
    finally {
        IACancel()
        if FileExist(path)
            FileDelete(path)
    }
}

V692AnalysisSignature(d)
{
    text := d.Start ":" d.Last ":" d.Partial ":" d.AcceptedCount "`n"
    for ev in d.Rows {
        x := ev.Analysis
        text .= x.Seq ":" x.At ":" x.Accepted ":" x.D ":" x.T ":" x.H ":" x.E ":" x.Death ":" ev.AbilityId ":" ev.EffectId "`n"
    }
    for key,ev in d.Seed
        text .= "seed:" key ":" ev.Analysis.At ":" ev.Analysis.EffectLastSeq "`n"
    for span in d.Effects
        text .= "effect:" span.Source ":" span.Target ":" span.Id ":" span.Start ":" span.End ":" span.Applications ":" span.Refreshes ":" span.PrePull ":" span.OpenEnd "`n"
    for ev in d.Casts
        text .= "cast:" ev.Analysis.Seq ":" ev.AbilityId "`n"
    for ev in d.Rows
        text .= "shield:" ev.Analysis.Seq ":" ev.Analysis.ShieldCredit ":" ev.Analysis.ShieldSource "`n"
    return text
}

V692AnalysisLoad(a,forceFull := false)
{
    IAOpenSelected()
    V48Assert(IsObject(a.Work),"Analysis creates its normal isolated owned job")
    if forceFull
        a.Work.CanStop := false,a.Work.CachedData := ""
    IALoadPump()
    V48Assert(a.LoadTiming.Outcome="COMPLETE" && IsObject(a.Data),"Analysis completes verified replay/reuse")
    IAQueryPump()
    return a.Data
}

V692TestAnalysisCutoffParity()
{
    V692AnalysisFixture(V692AnalysisParityCase)
    V692AnalysisFixture(V692AnalysisPartialParityCase,"partial")
}

V692AnalysisPartialParityCase(a,s,seg,path,text)
{
    V48Assert(s.ProgressionComplete && s.Partial && !s.ClockBack && !s.Malformed,"complete source fixture has later data-quality warning without clock disorder")
    baseline := V692AnalysisLoad(a,true),signature := V692AnalysisSignature(baseline),V692DropReviewData(a)
    fast := V692AnalysisLoad(a)
    V48Assert(a.LoadTiming.ReplayMode="Stopped after verified fight closure","completed-source provenance permits cutoff despite unrelated quality warnings")
    V48Assert(fast.Partial && V692AnalysisSignature(fast)=signature,"cutoff retains later source-quality warning and exact full-replay fight data")
}

V692AnalysisParityCase(a,s,seg,path,text)
{
    original := V596Signature(s),baseline := V692AnalysisLoad(a,true),signature := V692AnalysisSignature(baseline)
    fullRows := a.LoadTiming.Records,V692DropReviewData(a)
    fast := V692AnalysisLoad(a)
    V48Assert(a.LoadTiming.ReplayMode="Stopped after verified fight closure","clean unchanged full-source provenance permits closed-fight cutoff")
    V48Assert(a.LoadTiming.Records<fullRows && a.LoadTiming.ReadBytes<a.LoadTiming.SnapshotBytes,"cutoff avoids replaying unrelated later source records")
    V48Assert(V692AnalysisSignature(fast)=signature,"raw records, acceptance journal, casts, pre-pull effects and shield credits match full replay")
    V48Assert(!fast.Partial && a.Result.D=30000,"closing only the target does not mark an unrelated active later fight partial")
    V48Assert(V596Signature(s)=original && FileRead(path,"UTF-8")=text,"optimization does not modify imported results or source")
}

V692TestAnalysisReuse()
{
    V692AnalysisFixture(V692AnalysisReuseCase)
}

V692AnalysisReuseCase(a,s,seg,path,text)
{
    global IP
    data := V692AnalysisLoad(a),key := ""
    for actorKey,actor in data.Actors {
        if actor.Kind="NPC / companion" {
            key := actorKey
            break
        }
    }
    data.TargetClasses[key] := "Add",IP.Actor := "@Demo Healer#103"
    reused := V692AnalysisLoad(a)
    V48Assert(reused=data && a.LoadTiming.ReplayMode="Reused verified fight","unchanged selected fight reuses exact verified dataset")
    V48Assert(a.LoadTiming.Records=0 && a.LoadTiming.ReadBytes=0,"cache does not replay source events")
    V48Assert(a.Selected=IP.Actor && a.Result.H=16000,"cache hit honors newly selected player and recalculates query")
    V48Assert(data.TargetClasses[key]="Add","cache preserves explicit target classifications")
    report := IAAnalysisTimingReport(a.LoadTiming)
    V48Assert(InStr(report,"Reused verified fight") && !InStr(report,path),"cache timing is distinguishable without revealing source path")
}

V692TestAnalysisCacheInvalidation()
{
    V692AnalysisFixture(V692AnalysisCacheInvalidationCase)
}

V692AnalysisCacheInvalidationCase(a,s,seg,path,text)
{
    data := V692AnalysisLoad(a),snap := IASnapshotFile(path,"UTF-8"),target := IAFrozenTarget(seg)
    try {
        V48Assert(IACachedFight(data,target,snap),"unchanged verified cache is eligible")
        snap.Modified := "19000101000000"
        V48Assert(!IACachedFight(data,target,snap),"changed source modification time invalidates cache")
        snap.Modified := data.SourceModified,snap.Length += 1
        V48Assert(!IACachedFight(data,target,snap),"changed source length invalidates cache")
        snap.Length := data.SourceLength,snap.End -= 1
        V48Assert(!IACachedFight(data,target,snap),"changed complete-record snapshot boundary invalidates cache")
        snap.End := data.SnapshotEnd,target.Last += 1
        V48Assert(!IACachedFight(data,target,snap),"changed target boundary invalidates cache")
        target.Last -= 1,target.Totals["@Demo DPS#102"].Damage += 1
        V48Assert(!IACachedFight(data,target,snap),"changed target totals invalidate cache")
        target.Totals["@Demo DPS#102"].Damage -= 1,data.BaseVerified := false
        V48Assert(!IACachedFight(data,target,snap),"unverified dataset cannot be reused")
        data.BaseVerified := true
    }
    finally snap.File.Close()
    FileAppend("`n",path,"UTF-8")
    IAOpenSelected()
    V48Assert(!IsObject(a.Work.CachedData) && !a.Work.CanStop,"actual file growth disables cache and old-source cutoff proof")
    IACancel()
}

V692TestAnalysisCutoffGuards()
{
    V692AnalysisFixture(V692AnalysisCutoffGuardCase)
}

V692AnalysisCutoffGuardCase(a,s,seg,path,text)
{
    snap := IASnapshotFile(path,"UTF-8")
    try {
        V48Assert(IAReplayCanStop(s,snap),"complete clean matching source proves reorder bound")
        for field in ["Halted","ClockBack","Malformed"] {
            old := s.%field%,s.%field% := true
            V48Assert(!IAReplayCanStop(s,snap),field " disables cutoff")
            s.%field% := old
        }
        s.Partial := true
        V48Assert(IAReplayCanStop(s,snap),"completed-read provenance is independent of encounter quality")
        s.ProgressionComplete := false
        V48Assert(!IAReplayCanStop(s,snap),"canceled/error source cannot prove complete read")
        s.Partial := false
        V48Assert(!IAReplayCanStop(s,snap),"explicit incomplete provenance cannot use clean-Finished fallback")
        s.DeleteProp("ProgressionComplete")
        V48Assert(IAReplayCanStop(s,snap),"legacy clean finished replay remains eligible without explicit provenance")
        s.Partial := true
        V48Assert(!IAReplayCanStop(s,snap),"legacy partial replay lacks complete-read proof")
        s.Partial := false,s.ProgressionComplete := true
        s.Finished := false
        V48Assert(!IAReplayCanStop(s,snap),"unfinished source cannot prove later ordering")
        s.Finished := true,s.SourceLength += 1
        V48Assert(!IAReplayCanStop(s,snap),"stale source provenance cannot authorize cutoff")
        s.SourceLength -= 1
        target := IAFrozenTarget(seg),probe := {CanStop:true,State:s,Target:target},oldStamp := s.LastStamp
        s.LastStamp := target.Last+10000
        V48Assert(!IsObject(IAReplayClosedTarget(probe)),"capture-tail boundary must be fully passed")
        s.LastStamp := target.Last+10001,oldEnd := seg.End,seg.End := -1
        V48Assert(!IsObject(IAReplayClosedTarget(probe)),"provisional FinishAt cannot substitute for closed End")
        seg.End := oldEnd,s.Current := seg
        V48Assert(!IsObject(IAReplayClosedTarget(probe)),"current encounter cannot be treated as immutable")
        s.Current := "",s.LastStamp := oldStamp
        V48Assert(IAReplayClosedTarget(probe)=seg,"fully closed matching segment is eligible after capture tail")
    }
    finally snap.File.Close()
}

V692TestAnalysisBackdatedFallback()
{
    V692AnalysisFixture(V692AnalysisBackdatedCase,"backdated")
}

V692AnalysisBackdatedCase(a,s,seg,path,text)
{
    V48Assert(s.ClockBack>0 && s.Partial,"fixture contains a late backdated source record")
    baseline := V692AnalysisLoad(a,true),signature := V692AnalysisSignature(baseline),V692DropReviewData(a)
    candidate := V692AnalysisLoad(a),found := false
    for ev in candidate.Rows {
        if ev.EffectId="990000000000019"
            found := true
    }
    V48Assert(a.LoadTiming.ReplayMode="Full snapshot replay" && a.LoadTiming.Records=s.Lines,"backdated source uses full replay")
    V48Assert(found && V692AnalysisSignature(candidate)=signature,"backdated raw effect remains visible exactly as in baseline")
}

V692TestAnalysisReuseCancellation()
{
    V692AnalysisFixture(V692AnalysisReuseCancellationCase)
}

V692AnalysisReuseCancellationCase(a,s,seg,path,text)
{
    previous := V692AnalysisLoad(a)
    IAOpenSelected(),job := a.Work
    V48Assert(job.CachedData=previous,"cancellation test takes verified-cache path")
    IALoadPump(V598CancelCheckpoint)
    V48Assert(a.Data=previous && a.LoadTiming.Outcome="CANCELED" && !a.LoadTiming.Committed,"cancel prevents cache commit")
    V48Assert(!IsObject(job.Snapshot.File) && !a.Pumping && !a.Busy,"canceled cache releases owned snapshot")
    IAOpenSelected(),IALoadPump(V598SupersedeCheckpoint)
    V48Assert(a.Data=previous && a.LoadTiming.Outcome="CANCELED","superseded cache cannot commit")
    IAOpenSelected(),IALoadPump(V692AnalysisTruncateCheckpoint.Bind(path))
    V48Assert(a.Data=previous && a.LoadTiming.Outcome="ERROR","source replacement during cached review prevents commit")
}

V692AnalysisTruncateCheckpoint(path,kind,job)
{
    f := FileOpen(path,"w","UTF-8-RAW"),f.Write("changed fixture`n"),f.Close()
}

V692TestAnalysisRollbackParity()
{
    V692AnalysisFixture(V692AnalysisRollbackCase,"rollback")
}

V692AnalysisRollbackCase(a,s,seg,path,text)
{
    baseline := V692AnalysisLoad(a,true),signature := V692AnalysisSignature(baseline),V692DropReviewData(a)
    candidate := V692AnalysisLoad(a)
    V48Assert(a.LoadTiming.ReplayMode="Stopped after verified fight closure","continued pull is eligible only after shared parser completes closure")
    V48Assert(V692AnalysisSignature(candidate)=signature && a.Result.D=31234,"recorder exit, recovered damage and speculative tail match baseline")
}

; Tests requiring a fresh decode discard every shared review owner, as a restart does.
V692DropReviewData(a)
{
    a.Data := "",IPWRotationState().Data := ""
    v := IGRVState(),v.A.Data := "",v.B.Data := ""
}

; Isolated source fixtures exercise the actual saved-file chunk reader, shared
; first-pass acceptance/rollback and normal Analysis load path.
V693IxFixture(action,mode := "")
{
    V692AnalysisFixture(V693IxFixtureInner.Bind(action),mode)
}

V693IxImport(path,configure := "",encoding := "UTF-8")
{
    global IP
    IP.Offline := IPNewData("IMPORT TEST"),s := IP.Offline
    s.SourcePath := path,s.SourceEncoding := encoding
    s.SourceLength := FileGetSize(path),s.SourceModified := FileGetTime(path,"M")
    IAIxBegin(s),s.AnalysisIndex.Spacing := 0
    if IsObject(configure)
        configure.Call(s.AnalysisIndex)
    IP.ImportFile := FileOpen(path,"r",encoding),IP.ImportEnd := IP.ImportFile.Length
    IP.ImportBytes := IP.ImportFile.Pos,IP.ImportPath := path
    IP.ImportLines := [],IP.ImportHead := 1,IP.ImportSkip := false
    IP.ImportDone := false,IP.ImportCancelRequested := false
    IP.ImportTiming := IPNewImportTiming(IP.ImportEnd,IP.ImportBytes)
    IPImportRun()
    return s
}

V693IxFixtureInner(action,a,prior,oldSeg,path,text)
{
    global IP
    s := V693IxImport(path),IP.Selected := 1,IP.View := "Imported"
    V48Assert(IP.ImportDone && s.ProgressionComplete,"indexed native import reaches captured EOF")
    V48Assert(V596Signature(s)=V596Signature(prior),"first-pass indexing preserves source statistics and encounter boundaries")
    action.Call(a,s,s.Segments[1],path,text)
}

V693IxCompare(a,s,seg,path)
{
    baseline := V692AnalysisLoad(a,true),signature := V692AnalysisSignature(baseline)
    ids := V693IxIds(baseline),original := V596Signature(s),V692DropReviewData(a)
    fast := V692AnalysisLoad(a)
    V48Assert(a.LoadTiming.ReplayMode="Reused import accounting; decoded selected details","first Analysis load shares the completed import acceptance ledger")
    V48Assert(V692AnalysisSignature(fast)=signature,"indexed raw/accepted events, effects, pre-pull seeds, casts and shielding exactly match full replay")
    V48Assert(V693IxIds(fast)=ids,"phase sequence IDs and death-linked taken overrides remain exact")
    V48Assert(V596Signature(s)=original && !seg.HasOwnProp("AnalysisAccepted"),"Analysis neither changes nor attaches replay events to original imported results")
    return fast
}

V693IxIds(data)
{
    text := ""
    for ev in data.Rows
        text .= ev.Analysis.Seq ":" (ev.HasOwnProp("RecordId") ? ev.RecordId : "") "`n"
    for phase in data.AutomaticPhases
        text .= phase.Name ":" phase.From ":" phase.To "`n"
    return text
}

V693TestImportAnalysisParity()
{
    V693IxFixture(V693IxParityCase)
    V693IxFixture(V693IxParityCase,"rollback")
    V693IxFixture(V693IxParityCase,"partial")
}

V693IxParityCase(a,s,seg,path,text)
{
    data := V693IxCompare(a,s,seg,path)
    V48Assert(a.LoadTiming.Records<s.Lines,"selected details avoid unrelated later records")
    V48Assert(data.Seed.Count>0 && data.Credits.Length>0,"parity fixture exercises pre-pull effects and actual shield attribution")
}

V693TestImportAnalysisFallback()
{
    V693IxFixture(V693IxFallbackCase,"backdated")
}

V693IxFallbackCase(a,s,seg,path,text)
{
    snap := IASnapshotFile(path,"UTF-8")
    try V48Assert(!IsObject(IAIxPlan(s,seg,snap)),"backdated records disable index shortcuts")
    finally snap.File.Close()
    baseline := V692AnalysisLoad(a,true),sig := V692AnalysisSignature(baseline),V692DropReviewData(a)
    result := V692AnalysisLoad(a)
    V48Assert(a.LoadTiming.ReplayMode="Full snapshot replay" && V692AnalysisSignature(result)=sig,"backdated raw records remain visible through full replay")
}

V693TestImportAnalysisSourceGuards()
{
    V693IxFixture(V693IxGuardCase)
}

V693IxGuardCase(a,s,seg,path,text)
{
    snap := IASnapshotFile(path,"UTF-8")
    try {
        V48Assert(IsObject(IAIxPlan(s,seg,snap)),"completed unchanged imported source is eligible")
        oldEncoding := s.AnalysisIndex.Encoding,s.AnalysisIndex.Encoding := 1252
        V48Assert(!IsObject(IAIxPlan(s,seg,snap)),"decoder encoding must match the original indexed import")
        s.AnalysisIndex.Encoding := oldEncoding
        s.ProgressionComplete := false
        V48Assert(!IsObject(IAIxPlan(s,seg,snap)),"canceled or errored import cannot authorize reused accounting")
        s.ProgressionComplete := true
        for field in ["Malformed","ClockBack","Halted"] {
            old := s.%field%,s.%field% := 1
            V48Assert(!IsObject(IAIxPlan(s,seg,snap)),field " source falls back")
            s.%field% := old
        }
        snap.Modified := "19000101000000"
        V48Assert(!IsObject(IAIxPlan(s,seg,snap)),"stale source modification time rejects imported accounting")
        snap.Modified := s.SourceModified,snap.Length += 1
        V48Assert(!IsObject(IAIxPlan(s,seg,snap)),"changed source length rejects imported accounting")
        snap.Length -= 1,oldEnd := seg.End,seg.End := -1
        V48Assert(!IsObject(IAIxPlan(s,seg,snap)),"open segment has no settled acceptance ledger")
        seg.End := oldEnd
    }
    finally snap.File.Close()
    a.Data := "",IAOpenSelected(),job := a.Work
    V48Assert(IsObject(job.IndexPlan),"revision invalidation test starts indexed path")
    seg.SnapshotRevision += 1
    IALoadPump()
    V48Assert(a.LoadTiming.Outcome!="COMPLETE" && !IsObject(a.Data),"fight changed after job creation cannot commit indexed analysis")
}

V693TestImportAnalysisCancel()
{
    V693IxFixture(V693IxCancelCase)
}

V693IxCancelCase(a,s,seg,path,text)
{
    previous := V692AnalysisLoad(a,true),IAOpenSelected(),job := a.Work,job.CachedData := ""
    V48Assert(IsObject(job.IndexPlan),"cancellation fixture takes imported-accounting path")
    IALoadPump(V598CancelCheckpoint)
    V48Assert(a.Data=previous && a.LoadTiming.Outcome="CANCELED" && !a.LoadTiming.Committed,"cancel retains previous analysis and blocks index commit")
    V48Assert(!IsObject(job.Snapshot.File) && !a.Pumping && !a.Busy,"canceled indexed reader releases its private source handle")
}

V693TestImportAnalysisLimits()
{
    V693IxFixture(V693IxLimitsCase)
}

V693IxLimit(q)
{
    q.MaxAccepted := 5,q.MaxRecords := 5
}

V693IxLimitsCase(a,s,seg,path,text)
{
    global IP
    expected := V596Signature(s),limited := V693IxImport(path,V693IxLimit)
    IP.Selected := 1,IP.View := "Imported"
    V48Assert(limited.AnalysisIndex.Disabled && !limited.AnalysisIndex.Records.Count && !limited.AnalysisIndex.Points.Length,"bounded index discards retained cache when its journal budget is reached")
    V48Assert(V596Signature(limited)=expected && IP.ImportDone,"index budget never truncates or marks normal imported combat results")
    result := V692AnalysisLoad(a)
    V48Assert(a.LoadTiming.ReplayMode!="Reused import accounting; decoded selected details" && IsObject(result),"index budget falls back to existing verified replay")
    q := limited.AnalysisIndex
    V48Assert(q.Accepted<=q.MaxAccepted && q.Records.Count<=q.MaxRecords,"index journal remains within explicit record limits")
}

V693TestImportAnalysisSeedSnapshots()
{
    s := IPNewData(),IAIxBegin(s),q := s.AnalysisIndex,q.Spacing := 0
    actor := "@Healer#1",line := IAEffectLine(86399000,actor,actor,"Long buff","990000000000777")
    IAIxCheckpoint(s,0),IPFeedLine(s,line),IAIxCheckpoint(s,100)
    old := q.Points[2],key := q.Effects.Count ? IAEffectKey(IPParseLine(line)) : ""
    IPFeedLine(s,IAEffectLine(500,actor,actor,"Long buff","990000000000777"))
    IAIxCheckpoint(s,200)
    V48Assert(s.LastStamp=86400500 && q.Effects[key].LastSeq=2,"index tracks refresh across midnight with physical sequence")
    V48Assert(old.Effects[key].LastSeq=1 && old.Effects[key].At=86399000,"later refresh never mutates a retained checkpoint effect")
    q.MaxPoints := 3,q.MaxPointEntries := 2
    Loop 30
        IAIxCheckpoint(s,200+A_Index)
    V48Assert(q.Points.Length<=3 && q.PointEntries<=2 && q.Points[1].Offset=0,"point eviction bounds retained entries while preserving initial fallback")
    IPFeedLine(s,IPDemoLine(600,actor,"=","Death"))
    V48Assert(!q.Effects.Count && !q.EffectChars,"death removes active carry-in effects and storage charge")
}

V693TestImportAnalysisMidnightLate()
{
    V692AnalysisFixture(V693IxMidnightCase)
}

V693IxMidnightCase(a,prior,oldSeg,path,text)
{
    global IP
    dps := "@Demo DPS#102",healer := "@Demo Healer#103"
    boss := "Operations Training Dummy {2857785339412480}:990001|(0,0,0,0)|(90000/100000)"
    changed := IAEffectLine(85200000,healer,dps,"Long carry-in","990000000000778") "`n"
    Loop 1200
        changed .= IPDemoLine(85800000+A_Index*10,"@Zoë Test#9","=","Activate",0,false,-1,"Idle preparation","990000000000779") "`n"
    addedLate := false,addedLethal := false
    for line in StrSplit(text,"`n","`r") {
        if line=""
            continue
        ev := IPParseLine(line),at := Mod(ev.RawMs+82790000,86400000)
        changed .= "[" IPStamp(at) "]" SubStr(line,15) "`n"
        if !addedLate && ev.RawMs>=3603000 {
            changed .= IAEffectLine(Mod(at-250+86400000,86400000),dps,dps,"Tolerated late buff","990000000000780") "`n"
            addedLate := true
        }
        if !addedLethal && ev.RawMs>=3606000 {
            changed .= IPDemoLine(at,boss,dps,"Damage",500,false,123,"Lethal fixture hit","990000000000781") "`n"
            changed .= IPDemoLine(at,boss,dps,"Death") "`n"
            addedLethal := true
        }
    }
    f := FileOpen(path,"w","UTF-8-RAW"),f.Write(changed),f.Close()
    s := V693IxImport(path),IP.Selected := 1,IP.View := "Imported",seg := s.Segments[1]
    V48Assert(s.Late>0 && s.ClockBack=0 && seg.Start<86400000 && seg.Last>86400000,"fixture spans midnight and includes tolerated reordered records")
    V48Assert(seg.TakenOverrides.Count>0,"fixture uses death-linked incoming amount corrections")
    snap := IASnapshotFile(path,"UTF-8")
    try {
        plan := IAIxPlan(s,seg,snap)
        V48Assert(IsObject(plan) && plan.Point.Offset>0 && plan.Point.Line>500,"UTF-8 chunk checkpoint skips the long earlier prefix")
    }
    finally snap.File.Close()
    result := V693IxCompare(a,s,seg,path),found := false
    for key,ev in result.Seed {
        if ev.EffectId="990000000000778"
            found := true
    }
    V48Assert(found,"long-lived carry-in buff is preserved without arbitrary lookback expiry")
}

V693TestImportAnalysisAnsi()
{
    V692AnalysisFixture(V693IxAnsiCase)
}

V693IxAnsiCase(a,prior,oldSeg,path,text)
{
    global IP
    text := StrReplace(text,"Demo DPS","Bõõsted Pláyer")
    f := FileOpen(path,"w","CP1252"),f.Write(text),f.Close()
    s := V693IxImport(path,"","CP1252"),IP.Selected := 1,IP.View := "Imported"
    seg := s.Segments[1],data := V693IxCompare(a,s,seg,path)
    V48Assert(data.Actors.Has("@Bõõsted Pláyer#102"),"ANSI combat names remain exact in reused-import Analysis")
}

; Compact rotation rows: private synthetic records, native hidden window only.
V693RotationAnchorIdentity() => V693RotationAnchorIdentityImpl()
V693RotationSequenceCoverage() => V693RotationSequenceCoverageImpl()
V693RotationSequenceViewport() => V693RotationSequenceViewportImpl()
V693RotationUtilityRows() => V693RotationUtilityRowsImpl()
V693RotationCyclesNative() => V69IconsFixture(V693RotationCyclesNativeOuter)

V693RotationData()
{
    d := V68TimelineData(840000),d.Name := "Synthetic 14-minute rotation",d.Demo := true
    d.Actors["@Tank#68"] := {Name:"Demo Tank",Kind:"Player"}
    Loop 601 {
        i := A_Index,at := Round((i-1)*840000/600),gcd := "On-GCD"
        if Mod(i,12)=1
            id := "807788859097427",name := "Saber Throw"
        else if Mod(i,12)=2
            id := "814218425139200",name := "Energy Shield",gcd := "Off-GCD"
        else if Mod(i,12)=3
            id := "4258833736138752",name := "Attack Adrenal",gcd := "Off-GCD"
        else if Mod(i,17)=0
            id := "99999999999999999999",name := "Uncatalogued ability",gcd := "Unknown"
        else
            id := "3384812186370048",name := "Scorch"
        ev := V68TimelineAdd(d,IPDemoLine(at,"@Tank#68","=","Activate",0,false,-1,name,id))
        ev.Analysis.GCD := gcd
    }
    return d
}

V693RotationCast(index,id := "1",gcd := "On-GCD",at := -1,name := "Example")
{
    return {At:at>=0 ? at : index*1000,Seq:index,Name:name,Id:id,Target:"Boss",GCD:gcd,Gap:1000,Index:index}
}

V693RotationAnchorIdentityImpl()
{
    m := {From:0,To:10000,Casts:[V693RotationCast(1,"2",,,"Same label"),V693RotationCast(2,"1",,,"Same label"),
        V693RotationCast(3,"2",,,"Same label"),V693RotationCast(4,"1",,4000,"Same label"),
        V693RotationCast(5,"9","Off-GCD",4000,"Utility")],Effects:[],Available:[]}
    cycles := IAVRCycles(m,"1"),choices := IAVRAnchorChoices(m)
    V48Assert(cycles.Length=3 && cycles[1].Opening && cycles[1].Casts[1].Index=1,"actions before the first exact anchor are retained as Opening")
    V48Assert(cycles[2].Casts.Length=2 && cycles[3].Casts.Length=2,"same display name on another ability ID does not start a cycle")
    V48Assert(cycles[3].Casts[1].Index=4 && cycles[3].Casts[2].Index=5,"last cycle and same-time trailing utility retain recorded order")
    V48Assert(choices.Keys.Length=4 && InStr(choices.Labels[2],"[") && InStr(choices.Labels[3],"["),"duplicate labels remain distinguishable exact-ID choices")
    noAnchor := IAVRCycles(m,"missing")
    V48Assert(noAnchor.Length=1 && noAnchor[1].Opening && noAnchor[1].Casts.Length=5,"an absent anchor retains every action rather than discarding the opening")
    V48Assert(IAVRCastGCD(V693RotationCast(1,"814218425139200","On-GCD"))="On-GCD","explicit metadata overrides built-in ability classification")
    V48Assert(IAVRCastGCD(V693RotationCast(1,"99999999999999999999","Unknown",0))="Unknown","a short gap never invents off-GCD classification")
    V48Assert(IAVRKnownGCD("2515566640234759")="Off-GCD" && IAVRKnownGCD("4258842326073344")="Off-GCD","reviewed Enrage activation and adrenal IDs have exact off-GCD metadata")
    V48Assert(IAVRKnownGCD("807788859097088")="Unknown","Saber Throw's zero-second ordinary-GCD metadata is not mistaken for Off-GCD")
}

V693RotationSequenceCoverageImpl()
{
    d := V693RotationData(),m := IAVRModel(d,IANewQuery(d,"@Tank#68"))
    for anchor in ["","807788859097427"] {
        plan := IAVRSequencePlan(m,anchor,360),seen := Map(),previous := 0,continued := false
        for row in plan.Rows {
            continued := continued || row.Continued
            for cell in row.Cells {
                ordered := cell.Off.Clone()
                if IsObject(cell.Main)
                    ordered.Push(cell.Main)
                for cast in ordered {
                    V48Assert(!seen.Has(cast.Index) && cast.Index>previous,"wrapped rows preserve each activation exactly once and in recorded order")
                    seen[cast.Index] := true,previous := cast.Index
                }
            }
        }
        V48Assert(seen.Count=601 && plan.CastRows.Count=601 && previous=601,"all fourteen minutes and the exact endpoint remain reachable")
        V48Assert(continued && plan.Rows.Length>1,"long cycles wrap into explicitly continued rows")
    }
}

V693RotationSequenceViewportImpl()
{
    m := IAVRModel(V693RotationData(),IANewQuery(V693RotationData(),"@Tank#68"))
    for z in [1,1.5,2] {
        plan := IAVRSequencePlan(m,"807788859097427",868)
        for requested in [-500,0,plan.Height/2,plan.Height+9999] {
            draw := IAVRSequenceLayout(plan,868*z,220*z,z,requested),overlap := false
            V48Assert(draw.Scroll>=0 && draw.Scroll<=draw.ScrollMax && draw.Items.Length<601,"viewport clamps scrolling and renders only visible casts")
            for i,item in draw.Items {
                V48Assert(item.L>=0 && item.R<=draw.Width && item.B>0 && item.T<draw.Height,"visible icons stay horizontally inside the viewport and intersect its visible height")
                if item.T>=0 && item.B<=draw.Height
                    V48Assert(IAVRHit(draw,(item.L+item.R)/2,(item.T+item.B)/2).Index=item.Cast.Index,"each visible main or utility icon selects its exact recorded cast")
                for j,other in draw.Items {
                    if i<j && !(item.R<=other.L || other.R<=item.L || item.B<=other.T || other.B<=item.T)
                        overlap := true
                }
            }
            V48Assert(!overlap,"compact main and utility icons do not overlap at supported display scales")
        }
        last := IAVRSequenceLayout(plan,868*z,220*z,z,plan.Height),found := false
        for item in last.Items
            found := found || item.Cast.Index=601
        V48Assert(found,"scrolling to the bottom displays the final recorded action")
    }
}

V693RotationUtilityRowsImpl()
{
    m := {From:0,To:10000,Casts:[],Effects:[],Available:[]}
    for i,gcd in ["Off-GCD","Off-GCD","On-GCD","Unknown","Off-GCD"]
        m.Casts.Push(V693RotationCast(i,"99999999999999999999",gcd,1000))
    plan := IAVRSequencePlan(m,"",868),cells := plan.Rows[1].Cells
    V48Assert(cells[1].Main.Index=3 && cells[1].Off[1].Index=1 && cells[1].Off[2].Index=2,"leading utilities stack above the next main action in recorded order")
    V48Assert(cells[2].Main.Index=4 && !IsObject(cells[3].Main) && cells[3].Off[1].Index=5,"unknown classification remains on the main line and trailing utility is retained")
    m.Casts := []
    Loop 601
        m.Casts.Push(V693RotationCast(A_Index,"1","Off-GCD"))
    plan := IAVRSequencePlan(m,"",868),count := 0,bounded := true
    for row in plan.Rows {
        bounded := bounded && row.Height<=114
        for cell in row.Cells
            count += cell.Off.Length,bounded := bounded && cell.Off.Length<=3
    }
    V48Assert(count=601 && bounded && plan.Rows.Length>1,"an all-utility range wraps bounded stacks instead of creating an enormous single column")
}

V693RotationCyclesNativeOuter(icons)
{
    V68ReviewUIFixture(V693RotationCyclesNativeImpl)
}

V693RotationCyclesNativeImpl(s)
{
    saved := V69RotationUISetup(s),r := IAVRState(),d := V693RotationData()
    try {
        V48Assert(IAVROpen(d,"@Tank#68","",s.Gui.Hwnd),"compact whole-fight rotation opens using native hidden controls")
        V48Assert(r.Window=0 && r.Draw.Sequence && !r.Draw.Density && r.CastRows.Length=601,"whole-fight default displays real icons and keeps the complete cast table")
        V48Assert(r.Controls["Anchor"].Visible && !r.Controls["Effect"].Visible && r.Controls["Scroll"].Enabled,"whole-fight exposes the anchor selector and usable native scrollbar")
        choice := 0
        for i,id in r.AnchorKeys
            if id="807788859097427"
                choice := i
        V48Assert(choice>1,"anchor choices include recorded exact ability IDs")
        r.Controls["Anchor"].Choose(choice),IAVRChanged("anchor")
        V48Assert(r.Anchor="807788859097427" && r.Sequence.Rows[1].Number=1,"selecting an anchor rebuilds chronological cycles")
        first := r.Draw.Items[1].Cast,IAVRShowCast(first)
        V48Assert(r.Window=0 && r.Selected=first.Index && InStr(r.Controls["Detail"].Value,first.Name),"selecting a whole-fight icon shows details without changing to a timed window")
        IAVRScrollTo(0),IAVRWheelDelta(-60)
        V48Assert(r.Scroll=0 && r.Wheel=-60,"partial wheel deltas accumulate without jumping a row")
        IAVRWheelDelta(-60)
        V48Assert(r.Scroll=72 && r.Wheel=0,"a complete wheel notch scrolls the compact rows")
        IAVRScrollMessage(7,r.Controls["Scroll"].Hwnd,0x115,r.Gui.Hwnd)
        V48Assert(r.Scroll=r.Draw.ScrollMax && r.Draw.VisibleRows[r.Draw.VisibleRows.Length].Row.Index=r.Sequence.Rows.Length,"native bottom scrollbar action reaches the final row")
        IAVRScrollMessage(6,r.Controls["Scroll"].Hwnd,0x115,r.Gui.Hwnd)
        V48Assert(r.Scroll=0,"native top scrollbar action returns to the start")
        IAVRSelectCast(r.Controls["Casts"],601,true)
        found := false
        for item in r.Draw.Items
            found := found || item.Cast.Index=601
        V48Assert(r.Window=0 && r.Selected=601 && found,"selecting the last table cast scrolls its icon into view without hiding the whole-fight list")
        info := Buffer(28,0),NumPut("UInt",28,"UInt",7,info)
        V48Assert(DllCall("User32\GetScrollInfo","Ptr",r.Controls["Scroll"].Hwnd,"Int",2,"Ptr",info)
            && NumGet(info,12,"Int")>=NumGet(info,16,"UInt") && NumGet(info,20,"Int")>0,"native scrollbar range and thumb position match the scrolled content")
        for choice,window in [10000,20000,40000] {
            r.Controls["Window"].Choose(choice),IAVRChanged("window")
            V48Assert(r.Window=window && !r.Draw.Sequence && !r.Controls["Anchor"].Visible && r.Controls["Effect"].Visible,"optional timed views preserve their time scale and effect bands")
        }
        r.Controls["Window"].Choose(4),IAVRChanged("window")
        V48Assert(r.Window=0 && r.Anchor="807788859097427" && r.CastRows.Length=601,"returning to Whole fight preserves its chosen anchor and complete list")
        V48Assert(r.Failures=0 && !DllCall("IsWindowVisible","Ptr",r.Gui.Hwnd),"all native rendering stayed hidden and completed without a chart failure")
    }
    finally V69RotationUIRestore(saved)
}

; Hidden native child-window checks. No normal application, audio or saved settings.
V694RotationEmbeddedLayout() => V69IconsFixture(V694RotationEmbedFixture.Bind(V694RotationEmbeddedLayoutImpl))
V694RotationEmbeddedRouting() => V69IconsFixture(V694RotationEmbedFixture.Bind(V694RotationEmbeddedRoutingImpl))
V694RotationEmbeddedCleanup() => V69IconsFixture(V694RotationEmbedFixture.Bind(V694RotationEmbeddedCleanupImpl))

V694RotationEmbedFixture(test,icons)
{
    V68ReviewUIFixture(test)
}

V694RotationEmbeddedLayoutImpl(s)
{
    saved := V69RotationUISetup(s),r := IAVRState(),d := V693RotationData()
    try {
        V48Assert(IAVROpen(d,"@Tank#68","",s.Gui.Hwnd,"",true),"native child rotation opens without another replay")
        V48Assert(r.Embedded && DllCall("User32\GetParent","Ptr",r.Gui.Hwnd,"Ptr")=s.Gui.Hwnd,"embedded rotation belongs to its supplied native parent")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",r.Gui.Hwnd,"Int"),"embedded open never shows a top-level or test window")
        previousChart := 0,previousTable := 0
        for dims in [[640,324],[640,360],[664,386],[904,516],[1600,850]] {
            IAVRResize(r.Gui,0,dims[1],dims[2]),c := r.Controls
            for name in ["Context","PlayerLabel","Player","PhaseLabel","Phase","WindowLabel","Window","Previous","Next",
                "AnchorLabel","Anchor","Chart","Scroll","Caption","Casts","Detail","Footer"] {
                c[name].GetPos(&x,&y,&w,&h)
                V48Assert(x>=0 && y>=0 && w>0 && h>0 && x+w<=dims[1] && y+h<=dims[2],name " fits the embedded page")
            }
            c["Chart"].GetPos(&x,&y,&w,&h),c["Caption"].GetPos(&cx,&cy,&cw,&ch)
            c["Casts"].GetPos(&tx,&ty,&tw,&th),c["Detail"].GetPos(&dx,&dy,&dw,&dh),c["Footer"].GetPos(&fx,&fy,&fw,&fh)
            V48Assert(y+h<=cy && cy+ch<=ty && ty+th<fy && tx+tw<dx,"embedded chart, caption, table and details do not overlap")
            V48Assert(h>=104 && th>=44 && !c["Title"].Visible,"minimum supported layout retains chart and details space without a second title")
            V48Assert(h>=previousChart && th>=previousTable,"chart and table gain space as the embedded page grows")
            previousChart := h,previousTable := th
            bmp := SendMessage(0x173,0,0,c["Chart"].Hwnd),info := Buffer(A_PtrSize=8 ? 32 : 24)
            V48Assert(bmp && DllCall("Gdi32\GetObjectW","Ptr",bmp,"Int",info.Size,"Ptr",info)
                && NumGet(info,4,"Int")>0 && NumGet(info,8,"Int")>0,"embedded chart contains a native bitmap")
        }
        r.Controls["Window"].Choose(2),IAVRChanged("window"),IAVRResize(r.Gui,0,664,386)
        V48Assert(!r.Controls["Anchor"].Visible && r.Controls["Effect"].Visible && r.Window=20000 && r.Failures=0,"timed view remains available in the compact child")
    }
    finally V69RotationUIRestore(saved)
}

V694RotationEmbeddedRoutingImpl(s)
{
    saved := V69RotationUISetup(s),r := IAVRState(),d := V693RotationData(),host := Gui(IAEmbeddedOptions(s.Gui.Hwnd))
    try {
        IAVROpen(d,"@Tank#68","",host.Hwnd,"",true)
        V48Assert(IAVRRootWindow()=s.Gui.Hwnd && IAVRRootWindow()!=host.Hwnd,"wheel ownership resolves through the page host to the main root window")
        V48Assert(r.Draw.ScrollMax>0,"routing fixture has scrollable rotation rows")
        IAVRScrollTo(0),IAVRWheelMessage((-120 & 0xFFFF)<<16,0,0x20A,r.Gui.Hwnd)
        V48Assert(r.Scroll=0,"a hidden embedded page does not consume another page's wheel input")
        old := r.Gui.Hwnd,IAVROpen(d,"@Tank#68","",host.Hwnd)
        V48Assert(!r.Embedded && !DllCall("User32\IsWindow","Ptr",old,"Int") && IAVRRootWindow()=r.Gui.Hwnd,"switching from embedded to standalone creates an independent root window")
        old := r.Gui.Hwnd,IAVROpen(d,"@Tank#68","",host.Hwnd,"",true)
        V48Assert(r.Embedded && !DllCall("User32\IsWindow","Ptr",old,"Int") && IAVRRootWindow()=s.Gui.Hwnd,"switching back destroys the popup and restores native child ownership")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",r.Gui.Hwnd,"Int"),"mode switching never displays diagnostic windows")
    }
    finally {
        V69RotationUIRestore(saved)
        host.Destroy()
    }
}

V694RotationEmbeddedCleanupImpl(s)
{
    saved := V69RotationUISetup(s),r := IAVRState(),d := V693RotationData()
    try {
        IAVROpen(d,"@Tank#68","",s.Gui.Hwnd,"",true),hwnd := r.Gui.Hwnd,handles := [],info := Buffer(A_PtrSize=8 ? 32 : 24)
        for key,image in r.Icons
            if IsObject(image)
                handles.Push(image.Handle)
        V48Assert(handles.Length>0,"embedded cleanup includes actual allocated icon bitmaps")
        r.Busy := true
        V48Assert(!IAVRClose() && r.Closing && DllCall("User32\IsWindow","Ptr",hwnd,"Int"),"close defers safely while child rendering is busy")
        r.Busy := false
        V48Assert(IAVRShutdown()=0,"rotation shutdown never vetoes script exit")
        V48Assert(!DllCall("User32\IsWindow","Ptr",hwnd,"Int") && !r.Embedded && !r.OwnerHwnd && !r.Icons.Count && !IsObject(r.Data),"child close clears owner, mode, data and icon references")
        for handle in handles
            V48Assert(!DllCall("Gdi32\GetObjectW","Ptr",handle,"Int",info.Size,"Ptr",info),"embedded cached icon bitmap is released")
        V48Assert(IAVRRootWindow()=0 && IAVRShutdown()=0,"empty renderer has no wheel root and remains safe to shut down")
    }
    finally V69RotationUIRestore(saved)
}

; Main-tab loading uses fixture logs and hidden native controls only.
V694WorkspaceRotationLoad() => V694RotationPageFixture(V694RotationLoadCase)
V694WorkspaceRotationCancel() => V694RotationPageFixture(V694RotationCancelCase)
V694WorkspaceRotationSelection() => V694RotationPageFixture(V694RotationSelectionCase)
V694WorkspaceRotationHost() => V694RotationPageFixture(V694RotationHostCase)

V694RotationPageFixture(action)
{
    V692AnalysisFixture(V694RotationPageInner.Bind(action))
}

V694RotationPageInner(action,a,source,seg,path,text)
{
    global IP
    try {
        V58SelectTab(10)
        action.Call(a,source,seg,path,text)
    }
    finally {
        IPWRotationCancel(),IAVRClose()
        r := IPWRotationState()
        if IPMUiHandle(r.Gui)
            r.Gui.Destroy()
        IP.RotationPage := ""
    }
}

V694RotationFinish()
{
    IALoadPump(),IAQueryPump(),IPWRotationPoll()
    r := IPWRotationState()
    V48Assert(!r.Pending && IsObject(r.Data),"main Rotation completes its verified load")
    return r.Data
}

V694RotationLoadCase(a,source,seg,path,text)
{
    global IP
    V48Assert(IPWState().Tab=10 && IPWTabs()[IPWTabPosition(10)]="Rotation","Rotation is a stable main tab")
    V48Assert(IPWRotationLoad() && IPWState().Tab=10,"Load fight does not navigate to Analysis")
    r := IPWRotationState(),job := r.Job
    IPWRotationPoll()
    V48Assert(r.Pending && r.Controls["Loading"].LoadingMode!="hide","owned loading has a main-tab progress indicator")
    d := V694RotationFinish(),view := IAVRState()
    V48Assert(d=a.Data && view.Data=d && view.Embedded && view.OwnerHwnd=r.Gui.Hwnd,"main page and Analysis share one verified dataset")
    V48Assert(view.Model.From=d.Start && view.Model.To=d.Last && view.Window=0,"main rotation starts with the whole fight")
    V48Assert(!IsObject(job.Snapshot.File) && r.Controls["Loading"].LoadingMode="hide","completed load closes its source and indicator")
    V48Assert(IPWRotationLoad(),"same-fight reload accepted")
    V48Assert(!r.Pending && !IsObject(r.Job) && r.Data=d,"same-fight navigation immediately reuses verified Analysis details")
    V48Assert(V694RotationFinish()=d,"cached main load keeps the dataset identity")
    V58SelectTab(8),IAOpenSelected()
    V48Assert(a.Work.CachedData=d,"Analysis reuses the dataset opened through Rotation")
    IALoadPump(),IAQueryPump()
}

V694RotationCancelCase(a,source,seg,path,text)
{
    global IP
    IPWRotationLoad(),d := V694RotationFinish(),r := IPWRotationState()
    d.DeleteProp("MainSelection") ; force an actual cancellable read job, rather than the new immediate navigation
    IPWRotationLoad(),job := r.Job,IPWRotationCancel()
    V48Assert(!r.Pending && r.Data=d && !IsObject(job.Snapshot.File),"cancel retains previous rotation and releases reader")
    V48Assert(r.Controls["Load"].Enabled && !r.Controls["Cancel"].Enabled,"cancel restores main controls")
    IPWRotationLoad(),job := r.Job,IP.Selected := 2,IPWRotationRefresh()
    V48Assert(!r.Pending && !IsObject(job.Snapshot.File) && r.Data=d,"changed left fight cancels only the pending request")
    V48Assert(r.Controls["Empty"].Visible && !IPWRotationMatches(r.Selection),"old fight is hidden when left selection changes")
    IP.Selected := 1,IPWRotationRefresh()
    V48Assert(!r.Controls["Empty"].Visible && IAVRState().Data=d,"returning to prior selection restores its completed view")
    oldEnd := seg.End,seg.End := -1
    try V48Assert(!IPWRotationLoad() && !r.Pending,"open encounter cannot start frozen rotation load")
    finally seg.End := oldEnd
}

V694RotationChangeDuringRead(a,job)
{
    global IP
    IP.Selected := 2,IPWRotationRefresh()
}

V694RotationSelectionCase(a,source,seg,path,text)
{
    global IP
    r := IPWRotationState()
    V48Assert(IPWRotationLoad(),"selection regression starts real fixture load")
    job := r.Job
    IALoadPump(V694RotationChangeDuringRead)
    IPWRotationPoll()
    V48Assert(!r.Pending && !IsObject(r.Data) && !IsObject(job.Snapshot.File),"mid-read selection cannot publish old fight under new selection")
    IP.Selected := 1,IPWRotationLoad(),d := V694RotationFinish(),view := IAVRState()
    IP.Actor := "@Demo Healer#103",IPWRotationRefresh()
    V48Assert(view.Actor=IP.Actor && r.Data=d,"main player change updates rotation without reloading source")
    selection := r.Selection
    seg.SnapshotRevision += 1,IPWRotationRefresh()
    V48Assert(!IPWRotationMatches(selection) && r.Controls["Empty"].Visible,"revised fight cannot display stale results as current")
}

V694RotationHostCase(a,source,seg,path,text)
{
    global IP,SETTINGS_FILE
    r := IPWRotationState(),tabs := IPWTabs()
    V48Assert(tabs.Length=13 && IPWTabLogical(6)=10 && IPWTabLogical(4)=9 && IPWTabLogical(5)=12,"Log Library first retains stable Rotation/Deaths logical IDs")
    IniWrite(1,SETTINGS_FILE,"IrisWorkspace","RaidHomeVersion"),IniWrite(10,SETTINGS_FILE,"IrisWorkspace","Tab")
    IPWLoadPrefs()
    V48Assert(IPWState().Tab=10,"Rotation preference round trips in isolated settings")
    IPWRotationLoad(),d := V694RotationFinish(),view := IAVRState(),handle := view.Gui.Hwnd
    for dims in [[980,650],[1220,780],[1600,1000]] {
        ; Exercise native dimensions; a freshly constructed hidden GUI otherwise
        ; has a 176x0 client at 144 DPI. Dispatch pending creation/Size messages
        ; before checking the host layout, without displaying the diagnostic.
        IP.Gui.Show("Hide w" dims[1] " h" dims[2]),Sleep(-1)
        IPResize(IP.Gui,0,dims[1],dims[2]),box := IPWAnalysisRect(IPWLayout(dims[1],dims[2]))
        V48Assert(view.Width=box.W && view.Height=box.H-42,"renderer follows actual main content size")
        V48Assert(DllCall("User32\GetParent","Ptr",view.Gui.Hwnd,"Ptr")=r.Gui.Hwnd,"renderer stays inside main Rotation host")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"native resize diagnostics keep the main window hidden")
    }
    V58SelectTab(8),V58SelectTab(10)
    V48Assert(view.Gui.Hwnd=handle && view.Data=d,"switching tabs retains the rendered fight")
    IAVROpen(d,IP.Actor,"",a.Gui.Hwnd)
    V48Assert(!view.Embedded,"Analysis can still open its separate visual window")
    IPWRotationRefresh()
    V48Assert(!view.Embedded,"periodic main refresh cannot steal an open separate rotation")
    IPWRotationRefresh(true)
    V48Assert(view.Embedded && view.OwnerHwnd=r.Gui.Hwnd && view.Data=d,"main tab can reclaim its completed rotation without loading again")
    IPWRotationVisible(false)
    V48Assert(!r.Visible && !DllCall("User32\IsWindowVisible","Ptr",r.Gui.Hwnd,"Int"),"hiding main also hides Rotation")
    V48Assert(!IP.Active && !IP.Follow && IPWState().Tab=10,"main rotation never starts live collection")
}

; Startup preference tests use private state, a temporary INI and an inert
; SELF_TEST callback. No normal startup, gameplay input, audio or log attachment.
V694AutoStartDefaults() => V694AutoStartDefaultsImpl()
V694AutoStartGuards() => V694AutoStartGuardsImpl()
V694AutoStartPreferences() => V694AutoStartPreferencesImpl()
V694AutoStartSelfTest() => V694AutoStartSelfTestImpl()

V694AutoStartApp()
{
    return {Active:false,Busy:false,Rendering:false,ImportFile:"",Head:1,Queue:[],Live:"",Offline:""}
}

V694AutoStartDefaultsImpl()
{
    state := IPASNewState(),app := V694AutoStartApp()
    V48Assert(!state.Enabled && !IPASArm(state,app) && !state.Pending,"startup is disabled for a missing preference")
    state.Enabled := true
    V48Assert(!IPASArm(state,app,true) && !state.Pending && !state.Attempted,"SELF_TEST cannot arm parser startup")
    V48Assert(IPASArm(state,app) && state.Pending && state.Attempted,"enabled startup arms exactly once after initialization")
    V48Assert(!IPASArm(state,app),"a repeated initializer cannot queue a second startup")
    state.Pending := false
    V48Assert(!IPASArm(state,app),"a cancelled startup never rearms after manual stop")
    state := IPASNewState(),state.Enabled := true,app.Active := true
    V48Assert(!IPASArm(state,app) && state.Attempted,"already-running parsing is not replaced")
    app.Active := false
    for prop in ["Live","Offline"] {
        state := IPASNewState(),state.Enabled := true,app.%prop% := {}
        V48Assert(!IPASArm(state,app),"data loaded before scheduling cancels automatic startup: " prop)
        app.%prop% := ""
    }
}

V694AutoStartGuardsImpl()
{
    state := IPASNewState(),state.Enabled := true,app := V694AutoStartApp()
    IPASArm(state,app)
    V48Assert(IPASDecision(state,app)="Start","ready startup can use the normal parser commit")
    V48Assert(IPASDecision(state,app,true)="Wait","reader hydration defers startup until attachment is ready")
    for prop in ["Busy","Rendering"] {
        app.%prop% := true
        V48Assert(IPASDecision(state,app)="Wait","parser UI or work defers startup: " prop)
        app.%prop% := false
    }
    V48Assert(IPASDecision(state,app,false,true)="Cancel","manual diagnostics cancels a pending startup")
    V48Assert(IPASDecision(state,app,false,false,true)="Cancel","session scan takes precedence over startup")
    for prop in ["ImportFile","Live","Offline"] {
        app.%prop% := {}
        V48Assert(IPASDecision(state,app)="Cancel","new manual work takes precedence: " prop)
        app.%prop% := ""
    }
    app.Queue.Push({})
    V48Assert(IPASDecision(state,app)="Cancel","already queued live records are not replaced")
    app.Queue := [],app.Active := true
    V48Assert(IPASDecision(state,app)="Cancel","manual Parse takes precedence")
    app.Active := false,state.Enabled := false
    V48Assert(IPASDecision(state,app)="Cancel","turning the preference off cancels deferred startup")
    state.Enabled := true,state.Pending := false
    V48Assert(IPASDecision(state,app)="Cancel","manual Stop cancels deferred startup")
}

V694AutoStartPreferencesImpl()
{
    global IPAS,SETTINGS_FILE,persistenceTestMode,IP,Audio
    saved := {State:IPAS,Path:SETTINGS_FILE,Mode:persistenceTestMode}
    path := A_Temp "\Iris694-autostart-" DllCall("GetCurrentProcessId") ".ini"
    beforeActive := IP.Active,beforeLive := IP.Live,beforeAudio := Audio.Queue.Length
    try {
        if FileExist(path)
            FileDelete(path)
        IPAS := IPASNewState(),SETTINGS_FILE := path,persistenceTestMode := false
        IPASLoadPrefs()
        V48Assert(!IPAS.Enabled && !FileExist(path),"loading missing startup preference leaves settings untouched")
        IniWrite("keep",path,"Unrelated","Value")
        popup := Menu(),IPASAttachMenu(popup)
        V48Assert(!IPAS.Pending && IP.Active=beforeActive && IP.Live=beforeLive,"building the startup menu never starts parsing")
        V48Assert(!(DllCall("GetMenuState","Ptr",popup.Handle,"UInt",0,"UInt",0x400,"UInt") & 8),"new native menu item is unchecked for default off")
        IPASSetEnabled(true)
        V48Assert(IniRead(path,"IrisParser","StartOnLaunch",0)="1" && !IPAS.Pending,"enabling saves the next-launch preference without starting now")
        V48Assert(DllCall("GetMenuState","Ptr",popup.Handle,"UInt",0,"UInt",0x400,"UInt") & 8,"native menu checkmark reflects saved on preference")
        IPAS.Enabled := false,IPASLoadPrefs()
        V48Assert(IPAS.Enabled,"saved startup preference loads on the next initialization")
        IPAS.Pending := true,IPASSetEnabled(false)
        V48Assert(!IPAS.Pending && IniRead(path,"IrisParser","StartOnLaunch",1)="0","disabling saves off and clears a queued startup")
        V48Assert(IniRead(path,"Unrelated","Value")="keep","startup preference preserves unrelated settings")
        IniWrite("invalid",path,"IrisParser","StartOnLaunch"),IPASLoadPrefs()
        V48Assert(!IPAS.Enabled,"malformed preference cannot turn parsing on")
        V48Assert(IP.Active=beforeActive && IP.Live=beforeLive && Audio.Queue.Length=beforeAudio,"preference and menu operations preserve parser and audio state")
    }
    finally {
        IPASCancelPending()
        IPAS := saved.State,SETTINGS_FILE := saved.Path,persistenceTestMode := saved.Mode
        if FileExist(path)
            FileDelete(path)
    }
}

V694AutoStartSelfTestImpl()
{
    global IPAS,IP,Audio,SELF_TEST,currentLogPath,currentLogPos
    saved := IPAS,oldLive := IP.Live,oldActive := IP.Active,oldPath := currentLogPath,oldPos := currentLogPos
    audioCount := Audio.Queue.Length
    try {
        V48Assert(SELF_TEST,"startup callback fixture remains in isolated diagnostic mode")
        IPAS := IPASNewState(),IPAS.Enabled := true,IPAS.Pending := true
        V48Assert(!IPASRun() && !IPAS.Pending,"native self-test callback refuses startup even with a forged pending flag")
        IPASSchedule()
        V48Assert(!IPAS.Pending && !IPAS.Attempted,"native self-test scheduling stays inert")
        V48Assert(IP.Live=oldLive && IP.Active=oldActive && currentLogPath=oldPath && currentLogPos=oldPos
            && Audio.Queue.Length=audioCount,"diagnostic callback never attaches logs, changes live data or queues speech")
    }
    finally IPAS := saved
}

; Synthetic records use the exact area, mode, boss and Rift IDs observed in the
; 2026-10-03 04:56 recording. Player identities/amounts below are test-only.
V694StoryMonolithRecognized() => V694StoryMonolithRecognizedImpl()
V694StoryMonolithScope() => V694StoryMonolithScopeImpl()
V694StoryMonolithVeteran() => V694StoryMonolithVeteranImpl()

V694StoryMonolithFixture(mode := "836045448953651",area := "3541801830973440",npc := "3541140406009856")
{
    s := IPNewData("Synthetic Story Monolith"),player := "@Tester#57|(0,0,0,0)|(1000/1000)"
    boss := "Colossal Monolith {" npc "}:18274000003544|(0,0,0,0)|(900/1000)"
    IPFeedLine(s,"[00:00:00.000] [" player "] [] [] [AreaEntered {836045448953664}: Heart of Ruin {" area "} Mode {" mode "}]")
    IPFeedLine(s,IPDemoLine(100,player,"=","Enter"))
    IPFeedLine(s,IPDemoLine(1000,player,boss,"Damage",100,false,-1,"Example","123"))
    return s
}

V694StoryMonolithRecognizedImpl()
{
    s := V694StoryMonolithFixture(),seg := s.Current
    V48Assert(IsObject(seg.Profile) && seg.Profile.Key="MONO-SM" && seg.BossKey="MONO-SM","recorded Story variant binds its own profile")
    V48Assert(seg.BossName="Colossal Monolith" && IPWFightIndices(s,true).Length=1,"Story Monolith is shown with Hide trash enabled")
    V48Assert(seg.AreaId="3541801830973440" && seg.ModeId="836045448953651","recorded raid area and Story difficulty remain exact")
    player := "@Tester#57|(0,0,0,0)|(1000/1000)",boss := "Colossal Monolith {3541140406009856}:18274000003544|(0,0,0,0)|(500/1000)"
    IPFeedLine(s,IPDemoLine(1500,boss,"@Peer#58|(0,0,0,0)|(0/1000)","Death"))
    V48Assert(!seg.Terminal,"a player killed by Monolith does not mark the boss dead")
    deadBoss := StrReplace(boss,"(500/1000)","(0/1000)")
    IPFeedLine(s,IPDemoLine(2000,player,deadBoss,"Death"))
    IPFinalizeData(s,"synthetic snapshot complete")
    V48Assert(seg.Terminal && seg.Totals["@Tester#57"].Damage=100,"recorded boss death completes the Story fight without changing damage totals")
    V48Assert(!s.Malformed && !s.BadValues && !s.ClockBack && !s.Halted,"Story fixture is natively parsed without rejection")
}

V694StoryMonolithScopeImpl()
{
    actor := IPActor("Colossal Monolith {3541140406009856}:42")
    for context in [{AreaId:"3541801830973440",ModeId:"836045448953652"},
        {AreaId:"3541801830973440",ModeId:"836045448953655"},
        {AreaId:"833571547775722",ModeId:"836045448953651"}] {
        V48Assert(!IsObject(IPXActorRule(actor,context)),"Story boss identity does not broaden difficulty or area scope")
    }
    context := {AreaId:"3541801830973440",ModeId:"836045448953651"}
    V48Assert(!IsObject(IPXActorRule(IPActor("Colossal Monolith {999999}:42"),context)),"same display name cannot identify the boss without its recorded NPC ID")
    V48Assert(!IsObject(IPXActorRule(IPActor("Rift {3553286573522944}:42"),context)),"an associated Rift alone does not identify a boss encounter")
}

V694StoryMonolithVeteranImpl()
{
    p := IPXProfiles()["MONO"]
    V48Assert(p.Mode="836045448953652" && p.Actors.Has("3570947479044096") && !p.Actors.Has("3541140406009856"),"existing Veteran registry remains unchanged")
    V57TestProfile_MONO()
}

; These fingerprints pin visually reviewed PRIMARY artwork, not merely an asset
; filename: the older StarParse rage.png was different art under the same name.
V694JuggIconsArtwork() => V69IconsFixture(V694JuggIconsArtworkImpl)
V694JuggIconsNativeRotation() => V69IconsFixture(V694JuggIconsNativeRotationImpl)

V694JuggIconCases()
{
    return [
        {Id:"2515566640234496",Name:"Enrage",File:"jp694_enrage.png",Hash:"bbb57fd70394878439538ae8035e474b17d11b1fda89c5b6ae538f70bc870a85"},
        {Id:"2515566640234759",Name:"Enrage",File:"jp694_enrage.png",Hash:"bbb57fd70394878439538ae8035e474b17d11b1fda89c5b6ae538f70bc870a85"},
        {Id:"3434638101970944",Name:"Raging Burst",File:"jp694_raging_burst.png",Hash:"309577cc9ad317acef44362308ed9a2448348020737835f7d9603f16afc5dca7"},
        {Id:"1582223002173440",Name:"Retaliation",File:"jp694_retaliation.png",Hash:"fcb93d92d5ceae04abad38c9827e6cc6ccb0dacf53c35e78f7ea96709c776802"}]
}

V694JuggIconsArtworkImpl(s)
{
    catalog := IAICatalog(),images := IAIEmbeddedImages()
    for row in V694JuggIconCases() {
        V48Assert(catalog[row.Id]=row.File,"reported exact ability ID uses independently corrected artwork: " row.Name)
        V48Assert(images[row.File].Hash=row.Hash,"embedded image pins the reviewed primary PNG bytes: " row.Name)
        path := IAIIconPath(row.Id,"unrelated display name")
        V48Assert(path!="" && IAIBinaryHash(FileRead(path,"RAW"))=row.Hash,"offline lookup extracts the corrected art independent of label: " row.Name)
    }
    V48Assert(catalog["999864091541504"]="vicious_slash.png"
        && images["vicious_slash.png"].Hash="7e9a126f64a1f1309fca349ca572ddd78922e8656ce6d221f78a8b5c4c0a3e71","correcting Retaliation does not replace shared Vicious Slash art")
    for row in V694JuggIconCases()
        V48Assert(IAIIconPath("99999999999999999999",row.Name)="","a familiar corrected ability label does not enable name guessing")
    V48Assert(IAIIconPath("2515566640234760","Enrage")="","unreviewed Enrage neighbor does not inherit the exact alias correction")
}

V694JuggIconsNativeRotationImpl(s)
{
    rotation := IAVRState(),saved := rotation.Icons,rotation.Icons := Map()
    try {
        for row in V694JuggIconCases() {
            raw := IPDemoLine(100000,"@Icon Fixture#694","=","Activate",0,false,-1,row.Name,row.Id)
            ev := IPParseLine(raw),icon := IAVRIcon(ev.AbilityId,ev.Ability),info := Buffer(A_PtrSize=8 ? 32 : 24)
            V48Assert(ev.Kind="Activate" && ev.AbilityId=row.Id,"raw activation keeps the precise icon identity: " row.Name)
            V48Assert(IsObject(icon) && DllCall("Gdi32\GetObjectW","Ptr",icon.Handle,"Int",info.Size,"Ptr",info),"corrected art produces a real native rotation bitmap: " row.Name)
            V48Assert(NumGet(info,4,"Int")>0 && NumGet(info,8,"Int")>0 && NumGet(info,18,"UShort")=24,"corrected rotation image remains opaque with valid dimensions")
        }
    }
    finally {
        for key,item in rotation.Icons
            if IsObject(item) && item.HasOwnProp("Handle")
                DllCall("Gdi32\DeleteObject","Ptr",item.Handle)
        rotation.Icons := saved
    }
}

; Explicit recovery of private fixture files; no normal log attachment or audio.
V694LateRecoveryHandoff() => V694LateFixture(V694LateHandoffCase)
V694LateRecoveryCancel() => V694LateFixture(V694LateCancelCase)
V694LateRecoveryBoundary() => V694LateFixture(V694LateBoundaryCase)
V694LateRecoverySourceChange() => V694LateFixture(V694LateSourceCase)

V694LateFixture(action) => V58Isolated(V694LateFixtureInner.Bind(action))
V694LateFixtureInner(action)
{
    global IP,currentLogPath,currentLogIdentity,currentLogPos,Audio
    saved := {Path:currentLogPath,Identity:currentLogIdentity,Pos:currentLogPos}
    path := A_Temp "\Iris694-recovery-" DllCall("GetCurrentProcessId") ".txt"
    player := V51Source(),target := V51Target(),lines := []
    ; An older completed pull followed by the active pull being recovered.
    lines.Push(IPDemoLine(1000,player,"=","Enter"))
    lines.Push(IPDemoLine(2000,player,target,"Damage",100))
    lines.Push(IPDemoLine(3000,player,"=","Exit"))
    lines.Push(IPDemoLine(30000,player,"=","Enter"))
    Loop 160
        lines.Push(IPDemoLine(30000+A_Index*10,player,target,"Damage",10))
    text := ""
    for line in lines
        text .= line "`n"
    V48Assert(!FileExist(path),"recovery fixture cannot overwrite an existing file")
    try {
        f := FileOpen(path,"w","UTF-8-RAW"),f.Write(text),f.Close()
        f := FileOpen(path,"r","UTF-8"),currentLogPath := path,currentLogIdentity := FileIdentity(f),currentLogPos := f.Length
        IP.Live := IPNewData("New live session"),IP.Live.SourceKey := path "|" currentLogIdentity
        IP.Active := true,IP.Visible := false,IP.Queue := [],IP.Head := 1
        j := IPLateCreate(IP.Live,f,path,currentLogIdentity,currentLogPos),IP.LateStart := j
        beforeAudio := Audio.Queue.Length
        action.Call(j,lines,player,target)
        V48Assert(Audio.Queue.Length=beforeAudio,"historical recovery never queues audio")
    }
    finally {
        IPLateCancel()
        if IsSet(f)
            try f.Close()
        currentLogPath := saved.Path,currentLogIdentity := saved.Identity,currentLogPos := saved.Pos
        if FileExist(path)
            FileDelete(path)
    }
}

V694LateHandoffCase(j,lines,player,target)
{
    global IP,currentLogPath,currentLogIdentity
    expected := IP.Live,tail := IPDemoLine(32000,player,target,"Damage",77),handle := j.File.Handle
    IPEnqueue(tail)
    IPLatePump(0)
    V48Assert(IPLateBusy() && IP.Live=expected && IP.Head=1,"private recovery cannot publish partial data or drain the live tail")
    V48Assert(IPDesiredPumpPeriod(IP)=10,"recovery uses the responsive pump schedule")
    IPLatePump(10000)
    V48Assert(!IPLateBusy() && IP.Live=j.Data && IP.Live.Segments.Length=1,"only the current pull is published after complete recovery")
    seg := IP.Live.Current,key := IPActor(player).Key
    V48Assert(seg.Start=30000 && seg.Totals[key].Damage=1600,"actual recorded pull start and all earlier damage are recovered")
    V48Assert(IP.Live.Lines=lines.Length && IP.Head=1,"snapshot includes each historical line once and leaves the queued tail untouched")
    IPPump()
    V48Assert(seg.Totals[key].Damage=1677 && IP.Head>IP.Queue.Length,"first post-boundary live record is counted exactly once")
    V48Assert(!IP.Live.HasOwnProp("SourcePath"),"recovered live data does not pin later files to the old source path")
    info := Buffer(52,0)
    V48Assert(!IsObject(j.File) && !DllCall("GetFileInformationByHandle","Ptr",handle,"Ptr",info),"successful recovery closes its private reader")
    V48Assert(seg.SourceEncoding="UTF-8","recovered pull retains its actual decoder without pinning future files")
    V48Assert(!IPLateBegin(IP.Live) && !IPLateBusy(),"SELF_TEST cannot attach a normal combat log")
}

V694LateCancelCase(j,lines,player,target)
{
    global IP
    expected := IP.Live
    IPLatePump(0),IPLateCancel()
    V48Assert(!IPLateBusy() && IP.Live=expected && IP.Live.Partial,"cancel retains the live placeholder and discloses missing earlier records")
    V48Assert(IP.Live.Segments.Length=0,"cancel never installs a partial historical pull")
    IPEnqueue(IPDemoLine(32000,player,target,"Damage",77)),IPPump()
    V48Assert(IP.Live.Current.Totals[IPActor(player).Key].Damage=77,"future queued live records remain usable after cancel")
}

V694LateBoundaryCase(j,lines,player,target)
{
    global IP
    IPLateCancel(),f := FileOpen(j.Path,"r","UTF-8"),rejected := false
    try IPLateCreate(IP.Live,f,j.Path,j.Identity,j.End-1)
    catch
        rejected := true
    finally f.Close()
    V48Assert(rejected,"unterminated byte boundary is rejected before replay")
    f := FileOpen(j.Path,"r","UTF-8")
    try {
        IP.LateStart := IPLateCreate(IP.Live,f,j.Path,j.Identity,j.End)
        IP.Active := false,IPLatePump()
        V48Assert(!IPLateBusy() && IP.Live.Segments.Length=0,"stopped parsing cannot commit a recovery")
    }
    finally f.Close()
}

V694LateSourceCase(j,lines,player,target)
{
    global IP,currentLogIdentity
    expected := IP.Live,IP.Live := IPNewData("Superseding session")
    IPLatePump()
    V48Assert(!IPLateBusy() && IP.Live!=expected && !IP.Live.Partial,"superseded recovery neither replaces nor marks the new session")
    f := FileOpen(j.Path,"r","UTF-8")
    try {
        IP.LateStart := IPLateCreate(IP.Live,f,j.Path,j.Identity,j.End)
        currentLogIdentity := "different file",IPLatePump()
        V48Assert(!IPLateBusy() && IP.Live.Partial && IP.Live.Segments.Length=0,"changed reader identity rejects historical data")
    }
    finally f.Close()
}

; Independent artwork fingerprints from directly sourced game images and
; primary Jedipedia class-tree corroboration. These are not generated from the
; catalogue being tested. Every fixture uses a private cache and hidden native
; bitmap handles; it never starts parsing, audio, overlays or gameplay hotkeys.
V695ClassIconsArtwork() => V69IconsFixture(V695ClassIconsArtworkImpl)
V695ClassIconsEffectIdentity() => V69IconsFixture(V695ClassIconsEffectIdentityImpl)
V695ClassIconsNoGuessing() => V69IconsFixture(V695ClassIconsNoGuessingImpl)
V695ClassIconsNativeRotation() => V69IconsFixture(V695ClassIconsNativeRotationImpl)

V695ClassIconCases()
{
    return [
        {Id:"3433285187272704",Name:"Disruption",Hash:"00b4ace1b3aa57ff7195729801c42595a1c8cff088306b1a6a0864c493eb33d0",Observed:true},
        {Id:"3488183459250176",Name:"Force Camouflage",Hash:"f09602ddb988eec0e31f9141de3574c268d33f0708e2b45f172066640773c907",Observed:true},
        {Id:"1780023426023424",Name:"Guard",Hash:"26a2b7fdc9f09e2f0d941a9239eb0078d0e05bd23b12af3d37d0c9d5dea3c95b",Observed:true},
        {Id:"3588445175808000",Name:"Shadow Stride",Hash:"75bcf81fbdfa372c52bc9dd69181e7a2762bf1a29eb6dcad52a8622ce36693a9",Observed:true},
        {Id:"3178507727273984",Name:"Firestorm",Hash:"d49de8fc61915d1086f5ff40741e350f360842bc5cb01799aec92008a5d2f9e6",Observed:true},
        {Id:"3408202578264064",Name:"Supercharged Cell",Hash:"35a45a2778bce66a2f76febee844ec488710ee3cb055057c2f7fe502420c41b5",Observed:false},
        {Id:"3469564776022016",Name:"Countermeasures",Hash:"0a34d232998f417c48b422c251a79082f28114107574ea447d66e987ab56b199",Observed:true},
        {Id:"3406729404481536",Name:"Brutal Shots",Hash:"011c530130b2148c194110bc0217ecdb6c1cd9b4b394efd05a15651bb5f2ece2",Observed:false},
        {Id:"2515566640234757",Name:"Bloodrage",Hash:"bbb57fd70394878439538ae8035e474b17d11b1fda89c5b6ae538f70bc870a85",Observed:true},
        {Id:"3462357820899622",Name:"Agitated",Hash:"6762c75d5e3996b4c54a64b129bd7e9dbbaaf53babe1cfea93c826858f63c90a",Observed:false},
        {Id:"814875555135770",Name:"Communication Breakdown",Hash:"59b5b839491bf2023cfbbee81a046e20bb9612b798b35f9f28a248a76c0c5f70",Observed:false}]
}

V695ClassIconsArtworkImpl(s)
{
    catalog := IAICatalog(),images := IAIEmbeddedImages()
    for row in V695ClassIconCases() {
        file := "jp696_" SubStr(row.Hash,1,16) ".png"
        V48Assert(catalog.Has(row.Id) && catalog[row.Id]=file,"reviewed exact class/effect identity uses its corrected art: " row.Name)
        V48Assert(images.Has(file) && images[file].Hash=row.Hash,"embedded PNG pins independently reviewed bytes: " row.Name)
        path := IAIIconPath(row.Id,"deliberately unrelated display label")
        V48Assert(path!="" && IAIBinaryHash(FileRead(path,"RAW"))=row.Hash,"offline extraction preserves the reviewed artwork digest: " row.Name)
    }
}

V695ClassIconsEffectIdentityImpl(s)
{
    catalog := IAICatalog(),images := IAIEmbeddedImages()
    ; The ability and its lockout/debuff have separately published icon identities.
    preserved := [
        {Id:"3462357820899328",File:"uti_imp_rep_crit_chance_raid_buff.png",Hash:"bbbcf38a963515d6e16ec634e84e34126d6e35dad2da68fc19aecf55b50a5d20"},
        {Id:"814875555135488",File:"resuscitationprobe.png",Hash:"bb7b0869649b55c5d7e4a75a763605799daeb9103cf49d9048b08666ad65ce60"},
        {Id:"4490439847575552",File:"sw_jk_blade_barrage.png",Hash:"c23e2159418d27a1ddd883a5364fe866318c115edc423a297e7c5b4726e18d66"},
        {Id:"2515566640234759",File:"jp694_enrage.png",Hash:"bbb57fd70394878439538ae8035e474b17d11b1fda89c5b6ae538f70bc870a85"}]
    for row in preserved
        V48Assert(catalog[row.Id]=row.File && images[row.File].Hash=row.Hash,"separately reviewed parent/modifier artwork stays intact: " row.Id)
    V48Assert(catalog["3462357820899622"]="jp696_6762c75d5e3996b4.png"
        && catalog["3462357820899622"]!=catalog["3462357820899328"],"Agitated keeps its own effect art instead of Tactical Superiority's raid buff")
    V48Assert(catalog["814875555135770"]="jp696_59b5b839491bf202.png"
        && catalog["814875555135770"]!=catalog["814875555135488"],"Communication Breakdown keeps its lockout art instead of Resuscitation Probe")
    V48Assert(catalog["2515566640234757"]="jp696_bbb57fd703948784.png"
        && catalog["2515566640234757"]!=catalog["4490439847575552"],"recorded Bloodrage activation uses its exact-ID rage art, not the separate blue modifier art")
    V48Assert(catalog["2515566640234496"]=catalog["2515566640234759"],"the independently corrected Enrage base and observed alias remain consistent")
}

V695ClassIconsNoGuessingImpl(s)
{
    for row in V695ClassIconCases()
        V48Assert(IAIIconPath("99999999999999999999",row.Name)="","familiar class/effect label never grants an unknown ID artwork: " row.Name)
    for id,name in Map("3433285187272705","Disruption","3178507727273985","Firestorm","2515566640234760","Enrage")
        V48Assert(IAIIconPath(id,name)="","unverified numerical neighbor never inherits a class correction: " id)
    V48Assert(!DirExist(s.Root) && s.Paths.Count=0,"unknown-only lookups extract no PNGs or guessed cache entries")
}

V695ClassIconsNativeRotationImpl(s)
{
    rotation := IAVRState(),saved := rotation.Icons,rotation.Icons := Map()
    try {
        for row in V695ClassIconCases() {
            if !row.Observed
                continue
            ; Exact activation IDs were observed in the user's recording corpus.
            ; A synthetic actor keeps the diagnostic independent of encounter state.
            ev := IPParseLine(IPDemoLine(100000,"@Class Icon Fixture#695","=","Activate",0,false,-1,row.Name,row.Id))
            V48Assert(ev.Kind="Activate" && ev.AbilityId=row.Id,"recorded activation identity survives normal line parsing: " row.Name)
            icon := IAVRIcon(ev.AbilityId,ev.Ability),info := Buffer(A_PtrSize=8 ? 32 : 24)
            V48Assert(IsObject(icon) && DllCall("Gdi32\GetObjectW","Ptr",icon.Handle,"Int",info.Size,"Ptr",info),"corrected recorded activation produces a real native rotation bitmap: " row.Name)
            V48Assert(NumGet(info,4,"Int")=64 && NumGet(info,8,"Int")=64 && NumGet(info,18,"UShort")=24,"rotation artwork is a complete opaque64x64 bitmap: " row.Name)
            V48Assert(IAIBinaryHash(FileRead(IAIIconPath(ev.AbilityId),"RAW"))=row.Hash,"native rotation used the independently pinned source artwork: " row.Name)
        }
    }
    finally {
        for key,item in rotation.Icons
            if IsObject(item) && item.HasOwnProp("Handle")
                DllCall("Gdi32\DeleteObject","Ptr",item.Handle)
        rotation.Icons := saved
    }
}

; Disposable disk fixtures only. SELF_TEST never uses the user's cache/settings.
V70CacheFixture(action)
{
    c := IPCState(),old := c.Clone()
    root := A_Temp "\Iris70Cache_" DllCall("GetCurrentProcessId") "_" A_TickCount
    V48Assert(!DirExist(root),"cache fixture cannot replace an existing directory")
    c.TestRoot := root,c.Enabled := true,c.Build := IPCBuild(),c.Hits := 0,c.Writes := 0,c.Last := ""
    try action.Call(root)
    finally {
        c.Enabled := true
        IPCPrune(root,true)
        if DirExist(root) {
            ; Remove only this fixture's known temporary leftovers, never recurse.
            Loop Files root "\*.tmp","F"
                FileDelete(A_LoopFileFullPath)
            try DirDelete(root)
        }
        for key,value in old.OwnProps()
            c.%key% := value
    }
}

V70CacheThrows(action,label)
{
    thrown := false
    try action.Call()
    catch
        thrown := true
    V48Assert(thrown,label)
}

V70TestCacheBinary()
{
    V70CacheFixture(V70CacheBinaryCase)
}

V70CacheBinaryCase(root)
{
    actor := {Name:"Bõõ / Cîryndà",Id:"2515566640234759"},m := Map(),m.CaseSense := "Off"
    m["AbC"] := actor
    value := {Actor:actor,Rows:[actor,actor],Names:m,Empty:"",Number:9223372036854775806,Decimal:0.125}
    copy := IPCDecode(IPCEncode(value))
    V48Assert(copy!=value && copy.Actor=copy.Rows[1] && copy.Rows[1]=copy.Rows[2],"binary cache preserves shared graph identity in a new graph")
    V48Assert(copy.Actor.Name=actor.Name && copy.Names["abc"]=copy.Actor,"Unicode and map case behavior survive disk format")
    V48Assert(copy.Number=value.Number && copy.Decimal=0.125 && Type(copy.Actor.Id)="String","64-bit numbers, floating values and numeric-looking string IDs retain types")
    large := Map()
    Loop 4096
        large[A_Index*3] := 9223372036850000000+A_Index
    packed := IPCEncode(large),unpacked := IPCDecode(packed)
    V48Assert(unpacked.Count=4096 && unpacked[12288]=large[12288] && unpacked[3]=large[3],"large acceptance ledgers use exact native packed integer pairs")
    V70CacheThrows(IPCEncode.Bind(large,V70CacheThrow),"packed-ledger encoding remains cancellable")
    V70CacheThrows(IPCDecode.Bind(packed,V70CacheThrow),"packed-ledger decoding remains cancellable")
    large[12291] := "a distinct string"
    V48Assert(IPCDecode(IPCEncode(large))[12291]="a distinct string","mixed maps use the general typed representation")
    V70CacheThrows(IPCEncode.Bind({Callback:V70CacheBinaryCase}),"callbacks are rejected instead of serialized")
    broken := Buffer(5,0),NumPut("UChar",6,"UInt",0xFFFFFFFF,broken)
    V70CacheThrows(IPCDecode.Bind(broken),"malicious array size is bounded before allocation")
    NumPut("UChar",5,"UInt",999,broken)
    V70CacheThrows(IPCDecode.Bind(broken),"forward and unknown object references are rejected")
    NumPut("UChar",4,"UInt",0xFFFFFFFF,broken)
    V70CacheThrows(IPCDecode.Bind(broken),"malicious string lengths are rejected before StrGet")
    cyclic := Buffer(10),NumPut("UChar",6,"UInt",1,"UChar",5,"UInt",1,cyclic)
    V70CacheThrows(IPCDecode.Bind(cyclic),"cyclic data cannot retain a self-referential cache graph")
    V70CacheThrows(IPCPath.Bind("import","..\source"),"cache keys cannot traverse directories")
    c := IPCState(),c.TestRoot := A_ScriptDir
    V70CacheThrows(IPCRoot,"diagnostics cannot access a normal or arbitrary cache directory")
    c.TestRoot := root,c.Enabled := false
    V48Assert(IPCRoot()="" && !IPCWrite("import",IPCTextHash("off"),value),"disabled cache performs no disk write")
    c.Enabled := true
}

V70CacheImport(path,service := "")
{
    global IP
    IP.Offline := IPNewData("PERSISTENT CACHE FIXTURE"),s := IP.Offline
    s.SourcePath := path,s.SourceEncoding := "UTF-8",s.SourceLength := FileGetSize(path)
    s.SourceModified := FileGetTime(path,"M"),IAIxBegin(s)
    IP.ImportFile := FileOpen(path,"r","UTF-8"),IP.ImportEnd := IP.ImportFile.Length
    IP.ImportBytes := IP.ImportFile.Pos,IP.ImportPath := path,IP.ImportLines := [],IP.ImportHead := 1
    IP.ImportSkip := false,IP.ImportDone := false,IP.ImportCancelRequested := false
    IP.ImportTiming := IPNewImportTiming(IP.ImportEnd,IP.ImportBytes)
    IPImportRun(service)
    return IP.Offline
}

V70TestCacheImportReuse()
{
    V70CacheFixture((root) => V692AnalysisFixture(V70CacheImportCase))
}

V70CacheImportCase(a,original,seg,path,text)
{
    global IP
    first := V70CacheImport(path),signature := V596Signature(first)
    id := IPCIdentity(path,"UTF-8",first.Gap)
    V48Assert(first.ProgressionComplete && FileExist(IPCPath("import",id.Key)),"normal completed import saves an on-disk result")
    V48Assert(V596Signature(original)=signature,"saving leaves original accounting unchanged")
    second := V70CacheImport(path)
    V48Assert(IP.ImportTiming.HasOwnProp("Cache") && IP.ImportTiming.Cache="disk hit","normal import pump reopens saved results without feeding source records")
    V48Assert(second!=first && V596Signature(second)=signature,"disk import reconstructs exact boundaries and every scalar total")
    V48Assert(second.AnalysisIndex.Records.Count=first.AnalysisIndex.Records.Count && second.AnalysisIndex.Points.Length=first.AnalysisIndex.Points.Length,"acceptance IDs and seek checkpoints survive restart-style reuse")
    V48Assert(FileRead(path,"UTF-8")=text && !IP.Active,"cache does not alter the source or enable live collection")
    ; Corruption is a miss followed by normal parsing, not a partially installed graph.
    cachePath := IPCPath("import",id.Key),f := FileOpen(cachePath,"rw"),f.Pos := f.Length-1
    byte := Buffer(1),NumPut("UChar",255,byte),f.RawWrite(byte),f.Close()
    third := V70CacheImport(path)
    V48Assert(!IP.ImportTiming.HasOwnProp("Cache") && V596Signature(third)=signature,"checksum corruption safely falls back to the shared parser")
}

V70TestCacheAnalysisReuse()
{
    V70CacheFixture((root) => V692AnalysisFixture(V70CacheAnalysisCase))
    V70CacheFixture((root) => V692AnalysisFixture(V70CacheAnalysisCase,"rollback"))
    V70CacheFixture((root) => V692AnalysisFixture(V70CacheAnalysisCase,"partial"))
}

V70CacheAnalysisCase(a,original,seg,path,text)
{
    global IP
    firstImport := V70CacheImport(path),IP.Selected := 1,IP.View := "Imported",V692DropReviewData(a)
    baseline := V692AnalysisLoad(a,true),signature := V692AnalysisSignature(baseline)
    V48Assert(a.LoadTiming.ReplayMode="Full snapshot replay","comparison baseline independently replays the source")
    V48Assert(IPCFiles(IPCRoot()).Items.Length=1,"only the reusable imported accounting is persisted")
    ; Drop all imported/review references, then go through the regular UI path.
    V692DropReviewData(a),restored := V70CacheImport(path),IP.Selected := 1
    a.Metadata := Map("990000000000001",{Attack:"Tech",GCD:"On-GCD",Source:"isolated current metadata"})
    data := V692AnalysisLoad(a)
    V48Assert(a.LoadTiming.ReplayMode="Reused import accounting; decoded selected details" && a.LoadTiming.Records<restored.Lines,"Analysis uses the restored accounting index instead of replaying the complete source after restart-style state loss")
    V48Assert(V692AnalysisSignature(data)=signature,"persisted events, casts, effects, seeds and shield credit reproduce native Analysis")
    V48Assert(data.Metadata=a.Metadata,"disk reuse applies current metadata rather than saved settings")
    V48Assert(IAEventTotalsCheck(data,restored.Segments[1]).Length=0,"restored accepted event contributions still reconcile to all player totals")
    again := V692AnalysisLoad(a)
    V48Assert(a.LoadTiming.ReplayMode="Reused verified fight" && again=data && V692AnalysisSignature(again)=signature,"in-session finished Analysis still reuses its verified detail graph")
}

V70TestCacheInvalidation()
{
    V70CacheFixture(V70CacheInvalidationCase)
    V70CacheFixture((root) => V692AnalysisFixture(V70CacheContentEditCase))
}

V70CacheContentEditCase(a,original,seg,path,text)
{
    global IP
    s := V70CacheImport(path),IP.Selected := 1,IP.View := "Imported",V692DropReviewData(a)
    first := V692AnalysisLoad(a),signature := V692AnalysisSignature(first)
    priorTime := FileGetTime(path,"M"),changed := StrReplace(text,"990000000000011","990000000000031")
    V48Assert(changed!=text && StrLen(changed)=StrLen(text),"source-edit fixture changes only equal-length ability IDs")
    f := FileOpen(path,"w","UTF-8-RAW"),f.Write(changed),f.Close(),FileSetTime(priorTime,path,"M")
    V48Assert(!IWFShareRotation(first,true),"explicit Rotation load rejects a same-size same-time content edit")
    entry := {Key:"changed source",Session:IGVSourceIdentity(path).Session,Date:"20261003",Team:"",Pull:IPRCompact(s.Segments[1])}
    reviewed := IGRLoadEntry(entry,path)
    V48Assert(reviewed.Rows!=first.Rows && V692AnalysisSignature(reviewed)!=signature,"comparison checks content before reusing shared details")
    result := V692AnalysisLoad(a)
    V48Assert(a.LoadTiming.ReplayMode="Full snapshot replay" && result!=first,"same-size same-time edit invalidates both in-memory Analysis and the imported acceptance index")
    V48Assert(V692AnalysisSignature(result)!=signature && IAEventTotalsCheck(result,s.Segments[1]).Length=0,"changed raw ability IDs are loaded while unchanged player totals reconcile")
    reopened := V70CacheImport(path)
    V48Assert(!IP.ImportTiming.HasOwnProp("Cache") && reopened.CacheDigest!=s.CacheDigest,"same-size same-time source change cannot restore the old imported graph")
}

V70CacheInvalidationCase(root)
{
    DirCreate(root),path := root "\source.txt",FileAppend("same size A`n",path,"UTF-8-RAW")
    try {
        first := IPCIdentity(path,"UTF-8",15000),mtime := FileGetTime(path,"M")
        f := FileOpen(path,"w","UTF-8-RAW"),f.Write("same size B`n"),f.Close(),FileSetTime(mtime,path,"M")
        second := IPCIdentity(path,"UTF-8",15000)
        V48Assert(first.Length=second.Length && first.Modified=second.Modified && first.Key!=second.Key,"full source digest catches same-size edits even with restored modification time")
        V48Assert(second.Key!=IPCIdentity(path,"UTF-8",10000).Key,"parser gap changes invalidate saved accounting")
        V48Assert(second.Key!=IPCIdentity(path,"CP1252",15000).Key,"decoder changes invalidate saved accounting")
        V48Assert(second.Key=IPCIdentity(path,65001,15000).Key,"equivalent UTF-8 decoder names share the same identity")
        c := IPCState(),old := c.Build,c.Build := "different loaded code"
        V48Assert(second.Key!=IPCIdentity(path,"UTF-8",15000).Key,"loaded parser build changes invalidate every result")
        c.Build := old
    }
    finally FileDelete(path)
}

V70TestCacheCancellation()
{
    V70CacheFixture((root) => V692AnalysisFixture(V70CacheCancellationCase))
}

V70CacheCancelImport(app,run)
{
    app.ImportCancelRequested := true
}

V70CacheStopSaving(app,run)
{
    if !IsObject(app.ImportFile) && app.Offline.Finished
        IPStop()
}

V70CacheCancellationCase(a,original,seg,path,text)
{
    global IP
    first := V70CacheImport(path),hits := IPCState().Hits
    canceled := V70CacheImport(path,V70CacheCancelImport)
    V48Assert(IP.ImportTiming.Outcome="CANCELED" && !canceled.ProgressionComplete && IPCState().Hits=hits,"Cancel during cache verification cannot install cached import results")
    restored := V70CacheImport(path),IP.Selected := 1,IP.View := "Imported",V692DropReviewData(a)
    V692AnalysisLoad(a),V692DropReviewData(a),IAOpenSelected()
    IALoadPump((kind,job) => IACancel())
    V48Assert(a.LoadTiming.Outcome="CANCELED" && !IsObject(a.Data),"Cancel during disk Analysis checks cannot commit a stale review")
    id := IPCIdentity(path,"UTF-8",restored.Gap),cachePath := IPCPath("import",id.Key)
    FileDelete(cachePath)
    complete := V70CacheImport(path,V70CacheStopSaving)
    V48Assert(complete.Finished && complete.ProgressionComplete && IP.ImportTiming.Outcome="COMPLETE","normal Stop during optional final cache save keeps already complete imported statistics")
    V48Assert(!FileExist(cachePath),"normal Stop cancels the final cache write after the import file is closed")
}

V70CacheThrow()
{
    throw Error("intentional cache interruption")
}

V70TestCacheAtomicAndBounds()
{
    V70CacheFixture(V70CacheAtomicCase)
}

V70CacheAtomicCase(root)
{
    key := IPCTextHash("atomic"),V48Assert(IPCWrite("import",key,{Value:10}),"isolated cache writer commits a complete file")
    path := IPCPath("import",key),before := IPCHashFile(path)
    V70CacheThrows(IPCWrite.Bind("import",key,{Value:20},V70CacheThrow),"canceled writes propagate the cancellation checkpoint")
    V48Assert(IPCHashFile(path)=before && IPCRead("import",key).Value=10,"atomic write cancellation retains the prior complete entry")
    c := IPCState(),limit := c.MaxBytes,c.MaxBytes := 32
    V48Assert(!IPCWrite("import",IPCTextHash("oversized"),{Value:Format("{:0100}",0)}),"over-limit results are skipped instead of truncated")
    c.MaxBytes := limit
    keep := root "\not-an-iris-cache.ipc",FileAppend("unrelated",keep)
    try {
        IPCPrune(root,true)
        V48Assert(!FileExist(path) && FileExist(keep),"clear deletes only recognized cache names and preserves unrelated files")
    }
    finally FileDelete(keep)
}

; Native isolated models and hidden GUIs. No runtime adapter, real logs, audio,
; hotkeys, user settings or application launch is used by these fixtures.
V70SplitFixture(key := "gods",basis := "Manual")
{
    timer := IRNNewState(),utc := 13000000000000,tick := 100000
    IRNStart(timer,key,utc,tick,-1,basis),s := IRSNewState(),IRSSync(s,timer)
    return {Timer:timer,State:s,Utc:utc,Tick:tick,Run:s.Active}
}

V70SplitSegment(f,boss := "G-TY",at := 420000)
{
    return {Id:1,Start:200000,End:-1,Last:at,BossKey:boss,Terminal:true,Partial:false,
        AreaId:f.Run.Area,ModeId:f.Run.Mode,Profile:"",XPFixed:false,XPMarkerAt:-1,
        Required:["boss"],RequiredDead:Map("boss",true),BossActors:Map("boss:1","boss"),
        TerminalActors:Map("boss:1",{At:at}),Trandos:"",ScriptStageAt:-1,ScriptOneAt:-1,
        ScriptExitAt:-1,ScriptClosedAt:-1,SourcePath:"private-log",QualityReasons:Map(),
        Origin:"observed combat entry",BadValues:0,FinishReason:"",RequiredDeathAt:at}
}

V70RunSplitsProof()
{
    for key,_ in IRNCatalog() {
        for boss in IRSCatalog(key)
            V48Assert(IRSBossName(boss)!=boss,"every raid milestone uses a friendly boss name")
    }
    f := V70SplitFixture(),seg := V70SplitSegment(f)
    V48Assert(IRSProof(seg).Confirmed && IRSProof(seg).At=420000,"live positive death proof does not wait for statistical tail closure")
    seg.Required := ["aivela","esne"],seg.BossKey := "G-AE",seg.RequiredDead := Map("aivela",true)
    seg.BossActors := Map("a:1","aivela","e:1","esne"),seg.TerminalActors := Map("a:1",{At:410000})
    V48Assert(!IRSProof(seg).Confirmed,"one sister death cannot complete the encounter")
    seg.RequiredDead["esne"] := true,seg.TerminalActors["e:1"] := {At:419123},seg.RequiredDeathAt := 419123
    V48Assert(IRSProof(seg).At=419123,"the final required actor death supplies exact split time")
    seg.Partial := true
    V48Assert(!IRSProof(seg).Confirmed,"partial coverage never automatically creates a split")
    seg := V70SplitSegment(f,"G-SC",420123)
    V48Assert(IRSProof(seg).At=420123,"Scyva works without an XP profile or XPCompleteAt")
    seg := V70SplitSegment(f,"G-IZ"),seg.RequiredDead := Map(),seg.ScriptStageAt := 400000
    seg.ScriptOneAt := 410000,seg.ScriptExitAt := 419000
    V48Assert(!IRSProof(seg).Confirmed,"Izax exit and one HP alone do not certify relay completion")
    seg.ScriptClosedAt := 419066
    V48Assert(IRSProof(seg).Confirmed && IRSProof(seg).At=419066,"Izax exact final relay cleanup supplies a complete Gods split")
    seg.ModeId := "836045448953652"
    V48Assert(!IRSProof(seg).Confirmed,"Izax proof stays scoped to 8-player Master")
    f := V70SplitFixture("dxun"),seg := V70SplitSegment(f,"DX-TR")
    seg.Trandos := {Status:"pending survival",ResolveAt:410000,ConfirmedAt:-1}
    V48Assert(!IRSProof(seg).Confirmed,"Dying Light terminal marker alone is not a kill")
    seg.Trandos.Status := "survived",seg.Trandos.ConfirmedAt := 417000
    V48Assert(IRSProof(seg).Confirmed && IRSProof(seg).At=410000,"survival proof keeps the earlier actual Dying Light endpoint")
    seg := V70SplitSegment(f,"DX-E1"),seg.Profile := {Script:"objective"},seg.XPFixed := true,seg.XPMarkerAt := 421222
    V48Assert(IRSProof(seg).Confirmed && IRSProof(seg).At=421222,"scoped objective completion uses its validated marker time")
    seg := V70SplitSegment(f,"DX-HMM"),seg.Partial := true,seg.Profile := {Script:"shelleigh-observed"}
    seg.XPFixed := true,seg.XPMarkerAt := 422333,seg.FinishReason := "Huntmaster: first zero-HP Shelleigh observation; exact earlier endpoint unconfirmed"
    V48Assert(!IRSProof(seg).Confirmed && IRSProof(seg).Pending,"uncertain Shelleigh timing requires explicit confirmation")
    seg.Profile.Script := "terror",seg.Partial := false
    V48Assert(!IRSProof(seg).Confirmed && IRSProof(seg).Pending,"Terror outcome never silently becomes a victory")
    seg.QualityReasons["malformed combat record"] := true,seg.Partial := true
    V48Assert(!IRSProof(seg).Pending,"malformed or incomplete captures cannot be promoted through manual confirmation")
    ; Exercise the real parser's first all-required-dead transition, including
    ; the unprofiled Scyva path, instead of only constructing a proof object.
    for pair in [["Tyth","4078419339902976"],["Scyva","4108140513591296"]] {
        data := IPNewData(),data.AreaId := "833571547775765",data.ModeId := "836045448953655"
        boss := pair[1] " {" pair[2] "}:17|(1,2,3,0)|(1000/1000)"
        V51Feed(data,1000,"Enter"),V51Feed(data,2000,"Damage",100,V51Source(),boss)
        V51Feed(data,3000,"Death",0,V51Source(),boss),live := data.Current
        V48Assert(live.RequiredDeathAt=3000 && IRSProof(live).At=3000,"native parser captures initial completion for " pair[1])
        V51Feed(data,4000,"Death",0,V51Source(),boss)
        V48Assert(IRSProof(live).At=3000,"native repeated Death cannot renew " pair[1] " completion")
    }
}

V70RunSplitsAdmission()
{
    f := V70SplitFixture(),seg := V70SplitSegment(f),s := f.State
    V48Assert(IRSApplySegment(s,f.Timer,seg,"private-log",425000,2000,f.Tick+327000),"fresh confirmed live endpoint can be admitted")
    V48Assert(f.Run.Splits[1].Elapsed=320000,"processing and proof delays are subtracted from the boss split")
    V48Assert(!IRSApplySegment(s,f.Timer,seg,"private-log",425000,2000,f.Tick+327000),"same segment cannot duplicate its split")
    f := V70SplitFixture(),s := f.State,seg := V70SplitSegment(f)
    V48Assert(!IRSApplySegment(s,f.Timer,seg,"private-log",460001,0,f.Tick+360001),"closing a stale recovered kill cannot add a new split")
    V48Assert(!IRSApplySegment(s,f.Timer,seg,"private-log",425000,-1,f.Tick+327000),"unknown or historical batch age is rejected")
    seg.ModeId := "836045448953654"
    V48Assert(!IRSApplySegment(s,f.Timer,seg,"private-log",425000,2000,f.Tick+327000),"16-player cannot contaminate an 8-player run")
    seg := V70SplitSegment(f)
    V48Assert(!IRSApplySegment(s,f.Timer,seg,"private-log",425000,2000,f.Tick+20000),"starting a timer after the pull began cannot claim that encounter")
    V48Assert(!IRSApplySegment(s,f.Timer,seg,"private-log",425000,2000,f.Tick-1),"monotonic rollback cannot invent elapsed timing")
    data := {SourceKey:"private-log|identity",Segments:[seg],Current:seg}
    V48Assert(!IRSObserveData(s,f.Timer,data,420000,0,f.Tick+320000,{Fresh:false}) && s.Observed.Count=0,"catch-up acquisition is rejected before touching live split state")
    V48Assert(!IRSObserveData(s,f.Timer,data,420000,0,f.Tick+320000,"") && s.Observed.Count=0,"private recovery without a fresh batch cannot add splits")
    V48Assert(!IRSObserveData(s,f.Timer,data,421000,0,f.Tick+321000,{Fresh:true}),"an unrelated fresh line cannot credit an already reconstructed kill")
    seg.TerminalActors["boss:1"].At := 422000
    V48Assert(IRSProof(seg).At=420000 && !IRSObserveData(s,f.Timer,data,422000,0,f.Tick+322000,{Fresh:true}),"duplicate boss Death cannot move a recovered kill into the fresh stream")
    f2 := V70SplitFixture(),seg2 := V70SplitSegment(f2),data2 := {SourceKey:"private-log|identity",Segments:[seg2],Current:seg2}
    seg2.Terminal := false
    V48Assert(!IRSObserveData(f2.State,f2.Timer,data2,200000,0,f2.Tick+100000,{Fresh:true}),"fresh pull activity arms only observation, not a kill")
    seg2.Terminal := true
    V48Assert(IRSObserveData(f2.State,f2.Timer,data2,420000,0,f2.Tick+320000,{Fresh:true}),"a completion reached during the observed fresh stream adds one split")
    V48Assert(!IRSObserveData(f2.State,f2.Timer,data2,420001,0,f2.Tick+320001,{Fresh:true}) && f2.Run.Splits.Length=1,"the still-current terminal tail cannot duplicate the split")
    run := f.Run
    V48Assert(IRSAdmit(run,"G-AE",run.Area,run.Mode,600000,"death","sisters"),"later observed boss can remain visible when first boss is missing")
    V48Assert(IRSPace(s,run)="Earlier splits missing" && !run.Complete,"missing earlier bosses cannot claim pace or a full clear")
    V48Assert(!IRSAdmit(run,"G-TY",run.Area,run.Mode,700000,"death","rollback"),"out-of-order elapsed time cannot fill an earlier boss")
    oldId := run.Id
    IRNArm(f.Timer,"gods"),IRNStart(f.Timer,"gods",f.Utc+700000,f.Tick+700000,4000000,"Entered remaining"),IRSSync(s,f.Timer)
    V48Assert(s.Active.Id!=oldId && s.Active.Splits.Length=0 && s.Runs.Length=1 && s.Runs[1].Stopped,"manual time correction keeps old partial history and starts comparison fresh")
}

V70SplitComplete(s,timer,offset := 0,manualBoss := "")
{
    run := IRSRun(timer)
    for i,boss in IRSCatalog(run.Key)
        IRSAdmit(run,boss,run.Area,run.Mode,i*600000+offset,boss=manualBoss ? "manual estimate" : "death",run.Id "|" boss)
    return run
}

V70RunSplitsComparison()
{
    f := V70SplitFixture(),s := f.State,oldTimer := f.Timer.Clone()
    oldTimer.RunId := "old-fast",fast := V70SplitComplete(s,oldTimer),s.Runs.Push(fast)
    oldTimer.RunId := "old-slow",slow := V70SplitComplete(s,oldTimer,60000),s.Runs.Push(slow)
    V48Assert(IRSBaseline(s,f.Run)=fast,"fastest matching previous clear is the default")
    IRSAdmit(f.Run,"G-TY",f.Run.Area,f.Run.Mode,590000,"death","current-tyth")
    V48Assert(IRSPace(s,f.Run)="0:10 ahead after Tyth","pace is cumulative run elapsed at the same boss")
    f.Run.Baseline := slow.Id
    V48Assert(IRSPace(s,f.Run)="1:10 ahead after Tyth","explicit previous clear selection controls pace")
    slow.Estimated := true
    V48Assert(!IsObject(IRSBaseline(s,f.Run)),"selected mismatched clock never silently switches comparison")
    f.Run.Baseline := "",fast.Basis := "Entered remaining"
    V48Assert(!IsObject(IRSBaseline(s,f.Run)),"different manual clock bases cannot be mixed")
    f := V70SplitFixture("dxun"),r := f.Run
    for i,boss in IRSCatalog(r.Key) {
        if boss="DX-HMM"
            IRSAdmit(r,boss,r.Area,r.Mode,i*600000,"manual estimate","hm",true,"Confirm defeat; time is estimated.")
        else
            IRSAdmit(r,boss,r.Area,r.Mode,i*600000,"death",boss)
    }
    V48Assert(!r.Complete && r.Pending.Length=1,"an unconfirmed Huntmaster prevents completed-clear status")
    f.State.Rows := [{Boss:"DX-HMM",Pending:r.Pending[1]}],f.State.RenderedRun := "old-dialog"
    V48Assert(!IRSCanConfirm(f.State,f.Timer,1),"stale dialog cannot confirm a newer run's pending boss")
    f.State.RenderedRun := r.Id
    V48Assert(IRSCanConfirm(f.State,f.Timer,1),"matching active-run selection can offer confirmation")
    V48Assert(IRSConfirm(r,"DX-HMM") && r.Complete && r.Splits[5].Kind="manual estimate","explicit late confirmation fills the ordered gap and retains timing label")
    V48Assert(IRSFinish(f.Timer,r,f.Tick+4000000) && f.Timer.Status="Finished" && f.Timer.AnchorRemaining=f.Timer.Duration-3600000,"full ordered clear freezes at final endpoint, not delayed confirmation")
    V48Assert(!IRSConfirm(r,"DX-HMM") && !IRSFinish(f.Timer,r,f.Tick+5000000),"repeated confirmation cannot finish or change a run twice")
    f := V70SplitFixture("r4"),r := f.Run
    for i,boss in IRSCatalog(r.Key)
        IRSAdmit(r,boss,r.Area,r.Mode,i*700000,"death",boss)
    V48Assert(r.Complete && IRSFinish(f.Timer,r,f.Tick+2900000) && f.Timer.AnchorRemaining=0,"over-limit clear retains actual splits and finishes the expired timer")
}

V70RunSplitsPersistence()
{
    f := V70SplitFixture("r4"),s := f.State,timer := f.Timer
    s.Active := V70SplitComplete(s,timer),s.Active.Baseline := ""
    text := IGVJson(IRSPack(s)),parsed := IRSParse(text)
    V48Assert(parsed.Active.Complete && parsed.Active.Splits[4].Elapsed=2400000,"complete ordered history round-trips exact millisecond splits")
    bad := IRSPack(s),bad[3][12][2][1] := 1,failed := false
    try IRSParse(IGVJson(bad))
    catch
        failed := true
    V48Assert(failed,"corrupt split order cannot load as a completed clear")
    path := A_Temp "\iris-v70-run-history-" DllCall("GetCurrentProcessId","UInt") ".json"
    try {
        if FileExist(path)
            FileDelete(path)
        saved := IRSSave(s,path,"")
        V48Assert(IRSParse(FileRead(path,"UTF-8")).Active.Complete,"native atomic persistence is validated and readable")
        conflict := false
        try IRSSave(s,path,"")
        catch
            conflict := true
        V48Assert(conflict && FileRead(path,"UTF-8")=saved,"concurrent writer mismatch preserves previous history")
        FileDelete(path),FileAppend("[2,[],[]]",path,"UTF-8-RAW"),failed := false
        try IRSSave(s,path,"[2,[],[]]")
        catch
            failed := true
        V48Assert(failed && FileRead(path,"UTF-8")="[2,[],[]]","unknown history schema is not overwritten")
    }
    finally {
        for file in [path,path ".bak"] {
            if FileExist(file)
                FileDelete(file)
        }
    }
    s := IRSNewState()
    Loop 70 {
        t := timer.Clone(),t.RunId := "bounded-" A_Index,s.Active := V70SplitComplete(s,t)
        IRNReset(t),IRSSync(s,t)
    }
    V48Assert(s.Runs.Length=64 && s.Runs[1].Id="bounded-7","history remains bounded and preserves the newest sixty-four runs")
    ini := A_Temp "\iris-v70-run-clock-" DllCall("GetCurrentProcessId","UInt") ".ini"
    try {
        V48Assert(IRNSaveState(timer,ini,f.Utc+2000,f.Tick+2000),"native clock saves new stable split identity")
        restored := IRNLoadState(ini,f.Utc+3000,f.Tick+3000)
        V48Assert(restored.RunId=timer.RunId && restored.Status="Running","restart preserves split identity independent of saved anchor")
        completed := IRSNewState(),completed.Active := V70SplitComplete(completed,timer,-60000)
        recovered := IRSParse(IGVJson(IRSPack(completed)))
        V48Assert(IRSReconcileClock(recovered,restored,f.Tick+3000)
            && restored.Status="Finished" && restored.AnchorRemaining=60000,
            "completed saved history reconciles the same run's older still-running clock at the recorded final split")
        V48Assert(IRNRemaining(restored,f.Utc+900000,f.Tick+900000)=60000,
            "recovered completion stays frozen rather than counting restart or processing delay")
        other := IRNLoadState(ini,f.Utc+3000,f.Tick+3000),other.RunId .= "-different"
        V48Assert(!IRSReconcileClock(recovered,other,f.Tick+3000) && other.Status="Running",
            "completed history for a different run cannot finish the current timer")
        unfinished := IRSNewState(),unfinished.Active := IRSRun(timer)
        IRSAdmit(unfinished.Active,"R4-IP",unfinished.Active.Area,unfinished.Active.Mode,600000,"death","one-boss")
        other := IRNLoadState(ini,f.Utc+3000,f.Tick+3000)
        V48Assert(!IRSReconcileClock(unfinished,other,f.Tick+3000) && other.Status="Running",
            "incomplete matching history never invents a finished clear")
        other.Basis := "Entered remaining"
        V48Assert(!IRSReconcileClock(recovered,other,f.Tick+3000) && other.Status="Running",
            "same run token cannot override a different saved start method")
        IniDelete(ini,"RaidRun","RunId"),legacy := IRNLoadState(ini,f.Utc+3000,f.Tick+3000)
        V48Assert(legacy.Status="Running" && InStr(legacy.RunId,"legacy-")=1 && IsObject(IRSRun(legacy)),"existing pre-v70 running clocks migrate without resetting the countdown")
    }
    finally {
        if FileExist(ini)
            FileDelete(ini)
    }
}

V70RunSplitsUI() => V6510RunUIFixture(V70RunSplitsUICase)
V70RunSplitsUICase()
{
    global IRN,IPM,IP,ReadClockSample
    state := IRSState(),old := state.Clone()
    oldBatch := ReadClockSample
    try {
        f := V70SplitFixture(),state.Runs := [],state.Active := f.Run,state.Loaded := true,state.Error := ""
        state.Revision += 1,IRN := f.Timer
        priorTimer := f.Timer.Clone(),priorTimer.RunId := "preview-prior",prior := V70SplitComplete(state,priorTimer)
        state.Runs.Push(prior),IRSAdmit(state.Active,"G-TY",f.Run.Area,f.Run.Mode,528000,"death","preview-current")
        g := IRSUOpen()
        V48Assert(!DllCall("IsWindowVisible","Ptr",g.Hwnd) && state.Controls["List"].GetCount()=5,"native splits window stays hidden in diagnostics and shows all Gods bosses")
        V48Assert(InStr(state.Controls["Summary"].Text,"1:12 ahead") && state.Controls["Baseline"].Enabled,"native view exposes pace and matching clear selector")
        for size in [[620,400],[700,474],[920,620]] {
            IRSUResize(g,0,size[1],size[2])
            for name in ["List","Note","Confirm","Close"] {
                state.Controls[name].GetPos(&x,&y,&w,&h)
                V48Assert(x>=0 && y>=0 && x+w<=size[1] && y+h<=size[2],"split controls stay inside compact and resized windows")
            }
        }
        p := IPM.Panels["RunTimer"],IPMEnsureGui("RunTimer",0,p)
        for width in [196,246,420] {
            for font in [8,10,18] {
                p.Width := width,IPM.Font := font,p.Signature := ""
                IPMRender("RunTimer",{LayoutPreview:true},p)
                p.RunPace.GetPos(&x,&y,&w,&h)
                V48Assert(p.RunPace.Text="1:12 ahead" && y+h<=p.Layout.H && x+w<=p.Layout.W,"preview pace fits all supported overlay sizes without changing live history")
            }
        }
        V48Assert(state.Active.Splits.Length=1 && state.Active.Id=f.Run.Id,"preview never creates a new run or split")
        IPMRetirePanels([p]),IPMEnsureGui("RunTimer",0,p),IPMRender("RunTimer",{LayoutPreview:true},p)
        V48Assert(IPMUiHandle(p.RunPace),"pace control is recreated safely after overlay destruction")
        ReadClockSample := {Wall:0,Tick:0,LatestStamp:1000},IP.Active := true,IP.Queue := [],IP.Head := 1
        IPEnqueue(IPDemoLine(1000,V51Source(),V51Target(),"Damage",100),false)
        IPEnqueue(IPDemoLine(1001,V51Source(),V51Target(),"Damage",100),true)
        V48Assert(!IP.Queue[1].Clock.Fresh && IP.Queue[2].Clock.Fresh && !ReadClockSample.HasOwnProp("Fresh"),"queued freshness is copied per line without changing the shared acquisition clock")
        IP.Active := false
    }
    finally {
        IRSUShutdown()
        ReadClockSample := oldBatch
        for name,value in old.OwnProps()
            state.%name% := value
    }
}

; Exact recorded Master actors; synthetic native ending negatives. No file/UI,
; gameplay/audio state, uploads or normal application launch in these checks.
V70SnvStart(mode := "836045448953655",area := "137438993037")
{
    s := IPNewData("ISOLATED Master SnV regression")
    IPFeedLine(s,"[00:00:00.000] [@SnvTest#70|(0,0,0,0)|(1000/1000)] [] [] [AreaEntered {836045448953664}: Area {" area "} Mode {" mode "}]")
    IPFeedLine(s,IPDemoLine(100,"@SnvTest#70|(0,0,0,0)|(1000/1000)","=","Enter"))
    return s
}

V70SnvActor(id,instance := 70,hp := 1000)
{
    return "Localized encounter actor {" id "}:" instance "|(0,0,0,0)|(" hp "/1000)"
}

V70SnvFeed(s,at,kind,id,instance := 70)
{
    actor := V70SnvActor(id,instance,kind="Death" ? 0 : 900)
    IPFeedLine(s,IPDemoLine(at,"@SnvTest#70|(0,0,0,0)|(1000/1000)",actor,kind,kind="Damage" ? 100 : 0))
}

V70SnvMasterScope()
{
    for key in IRSCatalog("snv") {
        original := IPXProfiles()[key]
        mm := IPXScopedProfile({AreaId:"137438993037",ModeId:"836045448953655"},key)
        vm := IPXScopedProfile({AreaId:"137438993037",ModeId:"836045448953652"},key)
        V48Assert(IsObject(mm) && mm.Key=key && mm.Mode="836045448953655","each supported SnV key has an exact 8-player Master profile")
        V48Assert(vm=original && vm.Mode="836045448953652" && mm!=vm,"Master alias never rewrites the original Veteran profile")
        V48Assert(mm.Required=vm.Required && mm.StartNpc=vm.StartNpc && mm.Repeat=vm.Repeat && mm.Tail=vm.Tail,"Master scoping retains exact final groups and phase policy")
        for mode in ["","836045448953651","836045448953654","836045448953656"]
            V48Assert(!IsObject(IPXScopedProfile({AreaId:"137438993037",ModeId:mode},key)),"unknown, Story and 16-player scopes stay excluded")
        V48Assert(!IsObject(IPXScopedProfile({AreaId:"137438993402",ModeId:"836045448953655"},key)),"same NPC outside Darvannis is not promoted")
    }
    V48Assert(!IsObject(IPXScopedProfile({AreaId:"3367426158755840",ModeId:"836045448953655"},"TOS-UL")),"Master alias cannot broaden another raid's Veteran profile")
    s := V70SnvStart("836045448953656"),V70SnvFeed(s,1000,"Damage","3153558262251520")
    V70SnvFeed(s,2000,"Death","3153558262251520")
    V48Assert(s.Current.BossKey="" && !s.Current.Terminal,"actual parser path also rejects the unsupported 16-player variant")
}

V70SnvMasterBossDeaths()
{
    ; First five canonical kills are directly present in the Aug16 Master log.
    ; Styrak uses the same directly engaged main actor; its ending here is a
    ; synthetic exact-Death check, not a claimed recorded Master clear.
    for key,id in Map("SNV-DA","3153558262251520","SNV-TI","3152458750623744",
        "SNV-TH","3154563284598784","SNV-OC","3157548286869504",
        "SNV-OL","3154662068846592","SNV-ST","3152407211016192") {
        s := V70SnvStart(),V70SnvFeed(s,1000,"Damage",id),seg := s.Current
        V48Assert(seg.BossKey=key && seg.Profile.Mode="836045448953655","real Master NPC identity now binds its intended encounter")
        V70SnvFeed(s,1500,"Death",id,999)
        V48Assert(!seg.Terminal && !IRSProof(seg).Confirmed,"an unengaged instance with the same NPC ID is not the boss kill")
        V70SnvFeed(s,2000,"Death",id)
        V48Assert(seg.Terminal && IRSProof(seg).Confirmed && IRSProof(seg).At=2000,"required Master boss Death supplies a timely split without waiting for closure")
        V70SnvFeed(s,2200,"Death",id)
        V48Assert(IRSProof(seg).At=2000,"duplicate Death cannot move the first confirmed endpoint")
        IPCloseSegment(s,"isolated fixture complete"),V57CheckRows(s)
    }
}

V70SnvMasterWarlords()
{
    ids := ["3054400352288768","3054404647256064","3054408942223360","3156895451840512"]
    for order in [[1,4,3,2],[2,3,4,1]] {
        s := V70SnvStart()
        for i,id in ids
            V70SnvFeed(s,1000+i,"Damage",id,i)
        seg := s.Current
        V48Assert(seg.BossKey="SNV-CW" && seg.Required.Length=4,"all four Master Warlords belong to one required group set")
        for n,i in order {
            V70SnvFeed(s,2000+n,"Death",ids[i],i)
            V48Assert(seg.Terminal=(n=4),"neither one nor three Warlord deaths can complete the raid encounter")
        }
        V48Assert(IRSProof(seg).Confirmed && IRSProof(seg).At=2004,"both tested kill orders finish only at the fourth required actor")
        IPCloseSegment(s,"isolated Warlords complete"),V57CheckRows(s)
    }
}

V70SnvMasterPhaseDeaths()
{
    s := V70SnvStart(),V70SnvFeed(s,1000,"Damage","9990000000000000")
    V70SnvFeed(s,2000,"Damage","3067057620910080"),seg := s.Current
    V48Assert(s.Segments.Length=2 && seg.Start=2000 && seg.BossKey="SNV-ST","Master Kell Dragon starts Styrak after a separate prelude")
    V70SnvFeed(s,2500,"Death","3067057620910080")
    for i,id in ["3141665497808896","3140531626442752","3294742427205632","3147154466013184"] {
        V70SnvFeed(s,3000+i*100,"Damage",id,i)
        V70SnvFeed(s,3050+i*100,"Death",id,i)
        V48Assert(!seg.Terminal && !IRSProof(seg).Confirmed,"Kell Dragon and Master projection deaths cannot count as final Styrak")
    }
    V70SnvFeed(s,4000,"Damage","3152407211016192"),V70SnvFeed(s,5000,"Death","3152407211016192")
    V48Assert(IRSProof(seg).Confirmed && IRSProof(seg).At=5000,"only the engaged main Styrak actor can complete the synthetic ending")
    IPCloseSegment(s,"isolated Styrak complete"),V57CheckRows(s)
    s := V70SnvStart()
    for i,id in ["3061057551597568","3067130635354112","3016819388448768","3016870928056320","3016810798514176"] {
        V70SnvFeed(s,1000+i*100,"Damage",id,i)
        V70SnvFeed(s,1050+i*100,"Death",id,i)
        V48Assert(s.Current.BossKey="SNV-OL" && !s.Current.Terminal,"Olok bodyguards, buyer and droids are phase actors rather than final kills")
    }
    V70SnvFeed(s,2000,"Damage","3154662068846592"),V70SnvFeed(s,3000,"Death","3154662068846592")
    V48Assert(IRSProof(s.Current).Confirmed && IRSProof(s.Current).At=3000,"Olok completion still requires the actual boss Death")
    IPCloseSegment(s,"isolated Olok complete"),V57CheckRows(s)
}

; Compact synthetic history and hidden native controls only; no raw-log replay.
V71PCEntry(stage := 1,id := 1,boss := "G-NA",partial := false)
{
    seg := V63Segment(boss),seg.Id := id,seg.Start := id*20000,seg.Last := seg.Start+10000,seg.End := seg.Last
    seg.Partial := partial,seg.PhaseProgress := Map(),IGPAdvance(seg,stage,seg.Start,"Synthetic recorded phase marker")
    p := IPRCompact(seg)
    V71PCSetPrimary(p,stage)
    p.Players["@Present#1"] := {Name:"Present",Deaths:0,First:-1,FirstOrder:0,TimedDeaths:0,TimingComplete:true,RoleMask:0}
    return {Key:"phase|" id,Date:"20261003",Session:"synthetic",Team:"A",Pull:p}
}

V71PCSetPrimary(p,stage)
{
    profile := IGPYViewProfile(p.Group),counts := Map(),order := [],ids := []
    if !IsObject(profile)
        return
    for phase in profile.Phases
        ids.Push(phase.Id)
    ; The six-marker v72 Izax fixture predates the separately recorded Scyva
    ; transition. Preserve that missing observation rather than fill it in.
    if p.Boss="G-IZ"
        ids := ["swipes","anchors","interrupts","augment-droid","missiles","burn"]
    Loop Min(Max(0,stage),ids.Length) {
        id := ids[A_Index],counts[id] := counts.Get(id,0)+1
        order.Push({Id:id,Ordinal:counts[id]})
    }
    data := {Key:profile.Key,Counts:[],Order:order,Limited:false}
    for phase in profile.Phases
        data.Counts.Push({Id:phase.Id,Started:counts.Get(phase.Id,0),Completed:0})
    p.Progress.Parsely := data
}

V71PCCheckSums(model)
{
    for row in model.Rows {
        V48Assert(row.Reached+row.Earlier+row.Unknown=row.Total,"every phase keeps the transparent filtered-attempt denominator")
        V48Assert(row.Known=row.Reached+row.Earlier,"known observations exclude uncertain later phases")
    }
}

V71PCSignature(entries)
{
    rows := []
    for e in entries
        rows.Push([e.Key,e.Date,e.Session,e.Team,e.Pull.Group,e.Pull.Included,IGPCGet(e,"Conflict"),IGVPackPull(e.Pull,false)])
    return IGVJson(rows)
}

V71PCViewSignature(view)
{
    return IGVJson([view.Source,view.Boss,view.Team,view.Window,view.Cycle,view.Character,
        IGPCGet(view,"DemoHistory",false),V71PCSignature(IGPCEntries(view))])
}

V71PCCounts()
{
    e := []
    for i,stage in [1,1,2,2,2,3,3,4,4,4]
        e.Push(V71PCEntry(stage,i))
    m := IGPCBuild(e,e[1].Pull.Group)
    V48Assert(m.Supported && m.Counters.Attempts=10 && m.Counters.Known=10,"all ten compact attempts have usable phase evidence without HP")
    V48Assert(m.Rows[2].Text="8 / 10" && m.Rows[4].Text="3 / 10","phase consistency displays eight reach P2-or-later and three reach burn")
    V48Assert(m.Rows[2].Earlier=2 && m.Rows[4].Earlier=7 && m.Rows[4].Unknown=0,"earlier observed phases remain separate from missing data")
    V48Assert(m.Rows[4].Percent=30 && m.Rows[4].Total=10,"percentage field uses the same visible denominator")
    V71PCCheckSums(m)
    e[1].Pull.Players["@Present#1"].Deaths := 9,e[1].Pull.Players["@Present#1"].First := e[1].Pull.Start
    V48Assert(IGPCBuild(e,e[1].Pull.Group).Rows[2].Reached=8,"character death does not truncate team phase progress")
}

V71PCUnknowns()
{
    a := V71PCEntry(2,1),a.Pull.Progress.Hp := -1,a.Pull.Progress.Comparable := false
    b := V71PCEntry(2,2,"G-NA",true),c := V71PCEntry(0,3),c.Pull.Progress.Kill := true
    d := V71PCEntry(4,4),d.Conflict := "Recorders disagree"
    e := V71PCEntry(4,5),e.Pull.Progress.Parsely.Key := "future-phase-map",f := V71PCEntry(4,6)
    m := IGPCBuild([a,b,c,d,e,f],a.Pull.Group)
    V48Assert(m.Rows[2].Reached=3 && m.Rows[2].Unknown=3,"actual phase observations remain usable with unknown HP and partial coverage")
    V48Assert(m.Rows[3].Reached=1 && m.Rows[3].Earlier=1 && m.Rows[3].Unknown=4,"a partial earlier phase does not become a failed later phase")
    V48Assert(m.Counters.Partial=1 && m.Counters.Conflicts=1 && m.Counters.Known=3,"partial, conflict and missing phase evidence stay visible")
    V48Assert(m.Rows[1].Reached=3,"a confirmed kill with no phase marker cannot silently fill every phase")
    V71PCCheckSums(m)
    b.Pull.Progress.Parsely.Key := "different interpretation"
    V48Assert(IGPCBuild([b],b.Pull.Group).Rows[2].Unknown=1,"changed phase definitions are not silently treated as compatible")
}

V71PCScope()
{
    for boss in ["G-NA","G-SC","DP-CO"] {
        e := V71PCEntry(1,1,boss),m := IGPCBuild([e],e.Pull.Group)
        V48Assert(m.Supported && m.Rows.Length=1 && m.Rows[1].Reached=1,"only actually recorded exact-scope phases provide consistency rows")
        for group in [StrReplace(e.Pull.Group,"836045448953655","836045448953652"),boss "|wrong-area|836045448953655"]
            V48Assert(!IGPCBuild([e],group).Supported,"wrong difficulty or area does not receive a guessed phase map")
    }
    e := V71PCEntry(1,1,"G-TY"),e.Pull.Group := "UNRECORDED|833571547775765|836045448953655",m := IGPCBuild([e],e.Pull.Group)
    V48Assert(!m.Supported && !m.Rows.Length && InStr(m.Note,"No verified Parsely phase history"),"HP-only fights remain explicitly unsupported rather than all-zero phase tables")
    m := IGPCBuild([],""),V48Assert(!m.Supported && InStr(m.Note,"Choose an encounter"),"empty graph has an actionable empty state")
    m := IGPCBuild([],V71PCEntry().Pull.Group)
    V48Assert(m.Supported && m.Rows[1].Total=0 && m.Rows[1].Percent=-1,"empty supported history has no fabricated zero percent")
}

V71PCBurnMarkers()
{
    a := V71PCEntry(2,1,"G-NA"),b := V71PCEntry(4,2,"G-NA")
    a.Pull.Partial := true,a.Pull.Progress.Partial := true
    m := IGPCBuild([a,b],a.Pull.Group)
    V48Assert(m.Rows[4].Reached=1 && m.Rows[4].Unknown=1,"only an explicitly recorded Burn phase contributes to Burn")
    a.Pull.Progress.Kill := true
    V48Assert(IGPCBuild([a,b],a.Pull.Group).Rows[4].Unknown=1,"a completed encounter cannot replace absent Burn phase evidence")
    b.Pull.Partial := true,b.Pull.Progress.Partial := true
    V48Assert(IGPCBuild([b],b.Pull.Group).Rows[4].Reached=1,"an explicitly observed burn remains positive evidence in a partial recording")
    V71PCCheckSums(m)
}

V71PCFiltersAndDuplicates()
{
    e := []
    for i,stage in [1,2,4,2,4,1]
        e.Push(V71PCEntry(stage,i))
    e[3].Pull.Progress.Kill := true,e[5].Pull.Progress.Kill := true
    e[3].Pull.Players.Delete("@Present#1")
    group := e[1].Pull.Group,m := IGPCSelect(e,group,"A","first","","@Present#1")
    V48Assert(m.Counters.Attempts=2 && m.Counters.TeamPulls=3 && m.Rows.Length=2,"absent character at first kill does not move the team boundary or add an unseen Burn phase")
    V48Assert(InStr(m.Scope,"Present | attended attempts"),"shareable scope identifies the selected character")
    cycles := IGKBuild(e,"reclear"),cycle := cycles.Cycles[1].Key
    m := IGPCSelect(e,group,"A","reclear",cycle,"@Present#1")
    V48Assert(m.Counters.Attempts=2 && m.Rows[4].Reached=1,"reclear uses the team's earlier clear even when the character missed it")
    copy := IPRCloneSnapshot(e[2]),copy.Key := "alternate",copy.Session := "other-recorder"
    e.Push(copy)
    m := IGPCSelect(e,group,"A")
    V48Assert(m.Counters.Attempts=6 && m.Counters.AlternativeCaptures=1,"matched alternative recordings cannot inflate the denominator")
    before := V71PCSignature(e),m := IGPCSelect(e,group,"A","first")
    V48Assert(V71PCSignature(e)=before,"phase consistency does not rewrite compact history or attendance")
    e[6].Team := "B",m := IGPCSelect(e,group,"*","first")
    V48Assert(m.Blocked && !m.Counters.Attempts && InStr(m.Note,"Choose one team"),"ambiguous team-cycle scope stays unavailable")
}

V71PCConflicts()
{
    a := V71PCEntry(2,1),b := IPRCloneSnapshot(a),b.Key := "alternate",b.Pull.Progress.Kill := true
    m := IGPCSelect([a,b],a.Pull.Group,"A")
    V48Assert(m.Counters.Attempts=1 && m.Counters.Conflicts=1 && m.Counters.Known=0,"conflicting recorders count as one uncertain attempt")
    for row in m.Rows
        V48Assert(row.Unknown=1 && row.Reached=0 && row.Earlier=0,"conflict is not evidence of either phase success or failure")
    m := IGPCSelect([a,b],a.Pull.Group,"A","first")
    V48Assert(m.Blocked && InStr(m.Note,"unavailable"),"first-kill boundary remains withheld when recorder outcomes conflict")
}

V71PCSnapshotIsolation()
{
    e := V71PCEntry(3),view := {Source:"history",History:Map("one",e),Boss:e.Pull.Group,Team:"A",Window:"all",Cycle:"",Character:"",DemoHistory:true}
    before := V71PCViewSignature(view),m := IGPCSnapshot(view)
    V48Assert(m.Rows[3].Reached=1 && InStr(m.Title,"SYNTHETIC DEMO"),"a fresh history snapshot uses compact observations and labels synthetic data")
    V71PCSetPrimary(e.Pull,1)
    V48Assert(m.Rows[3].Reached=1 && IGPCSnapshot(view).Rows.Length=1,"returned export snapshot does not retain mutable pull references")
    V71PCSetPrimary(e.Pull,3)
    V48Assert(V71PCViewSignature(view)=before,"snapshot leaves filters, history and input fields unchanged")
    view.Source := "current",view.Team := "*",view.Current := {Path:"Z:\does-not-exist\combat_2026-10-03_12_00_00_123456.txt",Pulls:[e.Pull],Demo:false}
    V48Assert(IGPCSnapshot(view).Rows[3].Reached=1,"current compact session needs no original file or raw replay")
}

V71PCNativeWindow()
{
    V58Isolated(V71PCNativeWindowCase)
}

V71PCNativeWindowCase()
{
    global IP,soundboardsEnabled
    IGPCClose()
    try {
        e := V71PCEntry(4),model := IGPCBuild([e],e.Pull.Group),IGPCRender(model),s := IGPCState()
        V48Assert(s.Controls["Rows"].GetCount()=4 && s.Controls["Rows"].GetText(4,2)="1 / 1","hidden native table displays every supported phase and its denominator")
        for dimensions in [[680,450],[720,480],[1000,700]] {
            w := dimensions[1],h := dimensions[2],s.Gui.Show("Hide w" w " h" h),IGPCResize(s.Gui,0,w,h)
            s.Controls["Rows"].GetPos(&rx,&ry,&rw,&rh),s.Controls["Note"].GetPos(&nx,&ny,&nw,&nh)
            s.Controls["Refresh"].GetPos(&bx,&by,&bw,&bh),s.Controls["Close"].GetPos(&cx,&cy,&cw,&ch)
            V48Assert(rx>=0 && rx+rw<=w && ry+rh<ny && ny+nh<by,"table and explanation remain non-overlapping at supported native sizes")
            V48Assert(by+bh<=h && cx+cw<=w && bx+bw<cx,"native buttons remain inside the client area without overlap")
        }
        IGPCRender(IGPCBuild([],"unsupported"))
        V48Assert(s.Controls["Rows"].GetCount()=0 && InStr(s.Controls["Scope"].Text,"No verified Parsely phase history"),"unsupported refresh clears previous phase rows")
        V48Assert(!IP.Active && !soundboardsEnabled,"phase summary does not start parsing or enable audio")
        old := s.Gui.Hwnd,IGPCClose()
        V48Assert(!DllCall("IsWindow","Ptr",old),"close releases the native window")
        IGPCRender(model)
        V48Assert(IPMUiHandle(IGPCState().Gui),"a later open safely creates a new native window")
    }
    finally IGPCClose()
}

; Isolated v71 pull-note and bookmark regressions. No normal user state or hotkeys.
V71BookmarkFixture(action)
{
    b := IBKState(),old := b.Clone(),root := A_Temp "\Iris71Notes_" DllCall("GetCurrentProcessId") "_" A_TickCount
    V48Assert(!DirExist(root),"bookmark fixture does not replace a previous directory"),DirCreate(root)
    b.TestPath := root "\notes.json",b.Loaded := false,b.Existed := false,b.Expected := "",b.Rows := Map()
    b.Choice := "Ctrl+Alt+M",b.Bound := "",b.Gui := "",b.Controls := Map(),b.Editor := "",b.EditorBase := ""
    b.Job := "",b.Live := "",b.Entry := "",b.Origin := "",b.SelectedMark := 0,b.Error := ""
    try action.Call(root)
    finally {
        IBKShutdown()
        ; Only this unique, direct-child fixture directory; no recursive removal.
        Loop Files root "\*","F"
            FileDelete(A_LoopFileFullPath)
        DirDelete(root)
        for key,value in old.OwnProps()
            b.%key% := value
    }
}

V71BookmarkThrows(fn,label)
{
    thrown := false
    try fn.Call()
    catch
        thrown := true
    V48Assert(thrown,label)
}

V71BookmarkPull()
{
    d := {Key:"",Session:"20261002_195935_783403",Date:"20261002",Recorder:"@Exact Recorder#1001",
        Boss:"TYTH",Area:"833571547775765",Mode:"836045448953655",Start:10000,End:40000,
        Name:"A repeated boss name",Path:"C:\fixtures\combat_2026-10-02_19_59_35_783403.txt",Encoding:"UTF-8",
        Note:"",Marks:[],Proof:""}
    d.Key := IBKKey(d)
    return d
}

V71BookmarkWrite(path,text)
{
    f := FileOpen(path,"w","UTF-8-RAW"),f.Write(text),f.Close()
}

V71TestBookmarkStorage()
{
    V71BookmarkFixture(V71BookmarkStorageCase)
}

V71BookmarkStorageCase(root)
{
    b := IBKLoad(),d := V71BookmarkPull(),d.Note := "Tank swaps`nCîryndà / Bõõ`nLine`twith tab"
    d := IBKMark(d,12345,"Check shield","an exact raw record"),IBKStore(d)
    first := b.Expected,path := IBKPath(),b.Loaded := false,b.Rows := Map(),IBKLoad()
    copy := b.Rows[d.Key]
    V48Assert(copy.Note=d.Note && copy.Marks[1].At=12345 && copy.Marks[1].Witness=IHHash("an exact raw record"),"disk reload preserves Unicode notes, timestamps and exact-event witness")
    V48Assert(copy.Recorder=d.Recorder && Type(copy.Mode)="String" && !IsObject(b.Gui) && b.Bound="","storage reload preserves exact IDs without UI or hotkey registration")
    copy.Note := "second revision",IBKStore(copy)
    V48Assert(FileRead(path ".bak","UTF-8")=first && FileRead(path,"UTF-8")=b.Expected,"atomic replacement retains the previous complete file")
    previous := b.Expected
    V71BookmarkWrite(path,previous " ")
    V71BookmarkThrows(IBKStore.Bind(copy),"external edit refuses an optimistic overwrite")
    V48Assert(FileRead(path,"UTF-8")=previous " ","concurrent content remains untouched")
    IBKLoad(true)
    lock := IHAcquireLock(path)
    try V71BookmarkThrows(IBKStore.Bind(copy),"exclusive writer lock prevents competing commits")
    finally DllCall("CloseHandle","Ptr",lock)
    V71BookmarkWrite(path,'[2,"Off",[]]')
    V71BookmarkThrows(IBKLoad.Bind(true),"future schema is refused")
    V71BookmarkThrows(IBKStore.Bind(copy),"a previous loaded state cannot replace future schema")
    V48Assert(FileRead(path,"UTF-8")='[2,"Off",[]]',"future file is preserved byte for byte")
    V71BookmarkWrite(path,"{")
    V71BookmarkThrows(IBKLoad.Bind(true),"corrupt storage fails closed")
    V71BookmarkWrite(path,"")
    V71BookmarkThrows(IBKLoad.Bind(true),"an existing empty file is not silently initialized")
    V71BookmarkWrite(path,previous),IBKLoad(true)
    row := IBKPack(copy),row[1] := IHHash("wrong identity")
    V71BookmarkThrows(IBKUnpack.Bind(row),"tampered identity digest is rejected")
    copy.Note := StrReplace(Format("{:4097}"," ")," ","x")
    V71BookmarkThrows(IBKStore.Bind(copy),"note length is bounded before writing")
    over := V71BookmarkPull()
    Loop 128
        over := IBKMark(over,12000,"same second")
    V71BookmarkThrows(IBKMark.Bind(over,12000),"per-pull bookmark count is bounded")
    b.TestPath := A_ScriptDir "\unsafe-notes.json"
    V71BookmarkThrows(IBKPath,"SELF_TEST cannot select a normal settings folder")
    b.TestPath := root "\notes.json"
}

V71TestBookmarkIdentity()
{
    V71BookmarkFixture((root) => V692AnalysisFixture(V71BookmarkIdentityInner.Bind(root)))
}

V71BookmarkSource(root,a,s,seg,path,text)
{
    global IP
    original := root "\combat_2026-10-02_19_59_35_783403.txt"
    FileCopy(path,original),s.SourcePath := original,s.SourceModified := FileGetTime(original,"M"),s.SourceLength := FileGetSize(original)
    for item in s.Segments
        item.SourcePath := original,item.SourceEncoding := "UTF-8"
    IP.ImportPath := original
    return original
}

V71BookmarkIdentityInner(root,a,s,seg,path,text)
{
    path := V71BookmarkSource(root,a,s,seg,path,text),id := IGVSourceIdentity(path),p := IPRCompact(seg)
    current := IBKFromSegment(s,seg),history := IBKFromPull(p,SubStr(id.Session,10),id.Date,path)
    V48Assert(current.Key=history.Key,"current and saved progression identities converge with or without the canonical date prefix")
    same := IBKCopy(current),same.Name := "Renamed display label",same.Path := root "\Archive-combat_2026-10-02_19_59_35_783403.txt"
    V48Assert(IBKKey(same)=current.Key && IBKSourceMatches(current,same.Path),"display names and archive prefix do not split the recording identity")
    same.End := -1,same.Proof := ""
    V48Assert(IBKKey(same)=current.Key,"live and later completed pull retain the same identity")
    same.Recorder := "@Different Recorder#1002"
    V48Assert(IBKKey(same)!=current.Key,"different exact recorder never merges by boss name")
    same := IBKCopy(current),same.Start += 1
    V48Assert(IBKKey(same)!=current.Key,"adjacent starts remain distinct")
    same := IBKCopy(current),same.Mode := "different mode"
    V48Assert(IBKKey(same)!=current.Key,"difficulty remains part of the identity")
    same := IBKCopy(current),same.Area := "different instance"
    V48Assert(IBKKey(same)!=current.Key,"operation instance remains part of the identity")
    live := IBKCopy(current),live.End := -1,live.Proof := "",live.Note := "saved live"
    live := IBKMark(live,live.Start+1000,"live mark"),IBKStore(live)
    merged := IBKMerge(current)
    V48Assert(merged.End=current.End && merged.Note=live.Note && merged.Marks.Length=1,"completion merges existing notes and marks without changing key")
    IBKStore(merged)
    wrong := IBKCopy(current),wrong.End += 1
    V71BookmarkThrows(IBKMerge.Bind(wrong),"conflicting completed boundaries do not silently replace notes")
    V48Assert(IBKFind(current,s)=1,"original parser graph identifies the exact completed fight")
    wrong := IBKCopy(current),wrong.Recorder := "@Different Recorder#1002",wrong.Key := IBKKey(wrong)
    V48Assert(IBKFind(wrong,s)=0,"same fight timestamps with wrong recording player do not match")
    V48Assert(!IBKSourceMatches(current,root "\combat_2026-10-03_19_59_35_783403.txt"),"different recording date is rejected before opening")
}

V71TestBookmarkLive()
{
    V71BookmarkFixture(V71BookmarkLiveCase)
}

V71BookmarkFeed(s,at,kind,source,target,amount := 0,now := -1,age := 0,fresh := true)
{
    line := V51Feed(s,at,kind,amount,source,target),ev := IPParseLine(line)
    IBKObserve(s,ev,line,at,age,now<0 ? at+1000 : now,fresh)
    return line
}

V71BookmarkLiveCase(root)
{
    global IP
    b := IBKState(),s := IPNewData(),s.SourcePath := root "\combat_2026-10-02_19_59_35_783403.txt"
    V71BookmarkFeed(s,0,"Enter",V56Who(),"=")
    V48Assert(!IBKLiveReady(s,1000),"precontact live marks wait for stable boss identity")
    V71BookmarkFeed(s,1000,"Damage",V56Who(),V56Boss(900),100)
    V48Assert(IBKLiveReady(s,2000) && b.Live.FreshStart,"fresh observed own combat entry admits current boss pull")
    V48Assert(!IBKLiveReady(s,5001),"stale event timestamps cannot be marked as now")
    V71BookmarkFeed(s,2000,"Death",V56Boss(600),V56Who(0))
    V71BookmarkFeed(s,30000,"Enter",V56Who(),"=")
    V48Assert(IsObject(s.Reentry),"native wipe reentry is buffered before confirmation")
    V71BookmarkFeed(s,30001,"Activate",V56Boss(1000),"=")
    V71BookmarkFeed(s,30100,"Damage",V56Who(),V56Boss(900),10)
    V48Assert(s.Segments.Length=2 && s.Current.Start=30000 && IBKLiveReady(s,31100),"fresh buffered Enter survives parser flush and admits the confirmed new pull")
    V48Assert(b.Live.At=30100,"live mark timestamp follows the actual latest record, not wall-clock extrapolation")
    V71BookmarkFeed(s,30200,"Exit",V56Who(0),"=")
    V71BookmarkFeed(s,30201,"Death",V56Boss(800),V56Who(0))
    V71BookmarkFeed(s,35000,"Activate",V56Who(),"=")
    V48Assert(IsObject(s.Current) && s.Current.FinishAt>=0 && !IBKLiveReady(s,36000),"fresh noncombat cast cannot revive a retained uncertain-exit pull for bookmarking")
    ; Identical parser reconstruction without the live observer cannot arm it.
    rebuilt := IPNewData(),rebuilt.SourcePath := s.SourcePath,b.Live := "",b.Entry := ""
    V51Feed(rebuilt,0,"Enter",0,V56Who(),"="),V51Feed(rebuilt,1000,"Damage",100,V56Who(),V56Boss())
    V71BookmarkFeed(rebuilt,2000,"Damage",V56Who(),V56Boss(),50)
    V48Assert(!IBKLiveReady(rebuilt,3000),"first fresh event after a recovered pull does not invent a fresh beginning")
    b.Live := "",b.Entry := ""
    old := IPNewData(),old.SourcePath := s.SourcePath
    V71BookmarkFeed(old,0,"Enter",V56Who(),"=",0,1000,4000,true)
    V71BookmarkFeed(old,1000,"Damage",V56Who(),V56Boss(),50)
    V48Assert(!IBKLiveReady(old,2000),"a stale historical Enter cannot arm a later fresh event")
    other := IPNewData(),other.SourcePath := s.SourcePath
    V71BookmarkFeed(other,0,"Enter",V56Who(),"=",0,1000,0,false)
    V71BookmarkFeed(other,1000,"Damage",V56Who(),V56Boss(),50)
    V48Assert(!IBKLiveReady(other,2000),"nonfresh import batches never arm the live hotkey")
    V48Assert(b.Bound="" && !FileExist(IBKPath()),"pure live observer never registers a key or saves user state")
    b.Live := "",b.Entry := "",IBKInitialize()
    V48Assert(b.Bound="" && !FileExist(IBKPath()),"diagnostic initialization cannot register the normal hotkey")
}

V71TestBookmarkVerification()
{
    V71BookmarkFixture((root) => V692AnalysisFixture(V71BookmarkVerificationInner.Bind(root)))
}

V71BookmarkVerificationInner(root,a,s,seg,path,text)
{
    path := V71BookmarkSource(root,a,s,seg,path,text),d := IBKFromSegment(s,seg),data := V692AnalysisLoad(a)
    ev := data.Rows[Min(5,data.Rows.Length)],at := ev.Analysis.At
    d := IBKMark(d,at,"event",ev.Analysis.Raw),m := d.Marks[1]
    V48Assert(IBKVerifyMoment(d,m,data),"bookmark exact recorded line survives native Analysis replay")
    m := m.Clone(),m.Witness := IHHash("a different raw line")
    V71BookmarkThrows(IBKVerifyMoment.Bind(d,m,data),"same fight and timestamp cannot substitute a different witnessed event")
    m := d.Marks[1].Clone(),m.At := data.Last+1
    V71BookmarkThrows(IBKVerifyMoment.Bind(d,m,data),"out-of-fight mark is rejected")
    wrong := data.Clone(),wrong.Path := root "\combat_2026-10-03_19_59_35_783403.txt"
    V71BookmarkThrows(IBKVerifyMoment.Bind(d,d.Marks[1],wrong),"a different source recording cannot apply a bookmark range")
    wrong := data.Clone(),wrong.Start += 1
    V71BookmarkThrows(IBKVerifyMoment.Bind(d,d.Marks[1],wrong),"nearby start is not rounded into the saved pull")
    changed := IPRCompact(seg),key := ""
    for player in changed.Players {
        key := player
        break
    }
    changed.Players[key].Deaths += 1
    V48Assert(IBKProof(changed)!=d.Proof,"original attendance/death evidence detects changed pull content")
    V48Assert(FileRead(path,"UTF-8")=text,"verification never writes the original combat log")
}

V71TestBookmarkJump()
{
    V71BookmarkFixture((root) => V692AnalysisFixture(V71BookmarkJumpInner.Bind(root)))
}

V71BookmarkJumpInner(root,a,s,seg,path,text)
{
    global IP
    path := V71BookmarkSource(root,a,s,seg,path,text),b := IBKState(),d := IBKFromSegment(s,seg)
    baseline := V692AnalysisLoad(a),row := baseline.Rows[Min(5,baseline.Rows.Length)],at := row.Analysis.At
    d := IBKMark(d,at,"Review",row.Analysis.Raw),m := d.Marks[1],a.Data := ""
    V48Assert(IBKJumpStart(d,m,false,{Kind:"main",Data:s,Segment:seg}),"saved bookmark starts the normal Analysis loader on its exact selected recording")
    V48Assert(IsObject(b.Job) && b.Job.Load=a.Work,"jump retains its specific owned Analysis job")
    IALoadPump(),IAQueryPump(),IBKJumpPoll(),IAQueryPump()
    V48Assert(!IsObject(b.Job) && a.Query.From=Max(seg.Start,at-5000) && a.Query.To=Min(seg.Last,at+5000),"native jump applies a bounded ten-second review range around the exact saved timestamp")
    V48Assert(a.Data.Start=seg.Start && a.Data.Last=seg.Last && FileRead(path,"UTF-8")=text,"jump loads the correct original fight without source writes")
    IP.Selected := 2
    V71BookmarkThrows(IBKJumpStart.Bind(d,m,false,{Kind:"main",Data:s,Segment:seg}),"stale editor selection refuses a jump")
    IP.Selected := 1,IP.Active := true
    try V71BookmarkThrows(IBKJumpStart.Bind(d,m),"live parsing blocks bookmark source loads")
    finally IP.Active := false
    IBKJumpStart(d,m),IP.Selected := 2,IBKJumpPoll()
    V48Assert(!IsObject(b.Job) && InStr(b.Error,"selected fight changed"),"selection change cancels the pending range application")
    IACancel(),IP.Selected := 1
    IBKJumpStart(d,m),IALoadPump(),IAQueryPump()
    a.Controls["From"].Value := "1",a.Controls["To"].Value := "2",IAApplyRange(),IAQueryPump(),IBKJumpPoll()
    V48Assert(!IsObject(b.Job) && InStr(b.Error,"Another Analysis operation") && a.Query.From=seg.Start+1000,
        "a newer user range query is not overwritten by a delayed bookmark poll")
    witnessed := ""
    for ev in a.Data.Rows {
        if ev.AbilityId!="" && ev.Analysis.At>=seg.Start && ev.Analysis.At<=seg.Last {
            witnessed := ev
            break
        }
    }
    V48Assert(IsObject(witnessed),"source edit fixture has an exact ability event to witness")
    oldGraph := a.Data,id := witnessed.AbilityId
    nextId := SubStr(id,1,StrLen(id)-1) (SubStr(id,-1)="7" ? "8" : "7")
    changed := StrReplace(text,"{" id "}","{" nextId "}"),modified := FileGetTime(path,"M")
    V48Assert(changed!=text && StrLen(changed)=StrLen(text),"bookmark source edit retains byte length and changes only an ability ID")
    editedMark := IBKMark(d,witnessed.Analysis.At,"Exact witness",witnessed.Analysis.Raw).Marks[-1]
    cache := IPCState(),enabled := cache.Enabled,cache.Enabled := false
    try {
        V71BookmarkWrite(path,changed),FileSetTime(modified,path,"M")
        IBKJumpStart(d,editedMark)
        V48Assert(!IsObject(a.Work.CachedData),"cache-off bookmark cannot reuse metadata-only Analysis despite identical size and timestamp")
        IALoadPump(),IAQueryPump(),IBKJumpPoll()
        V48Assert(a.Data!=oldGraph && !IsObject(b.Job) && InStr(b.Error,"event is missing or has changed"),
            "native cache-off bookmark reload detects the changed source witness before applying a range")
    }
    finally {
        cache.Enabled := enabled,V71BookmarkWrite(path,text),FileSetTime(modified,path,"M")
    }
}

V71TestBookmarkEditor()
{
    V71BookmarkFixture(V71BookmarkEditorCase)
}

V71BookmarkEditorCase(root)
{
    b := IBKState(),d := V71BookmarkPull(),d := IBKMark(d,15000,"First moment")
    IBKOpen(d),g := b.Gui,c := b.Controls
    V48Assert(!DllCall("IsWindowVisible","Ptr",g.Hwnd) && c["List"].GetCount()=1,"native note editor remains hidden in diagnostics and renders saved marks")
    for dims in [[780,580],[1060,760]] {
        IBKResize(g,0,dims[1],dims[2])
        for name in ["Title","List","Time","Label","Add","Delete","Note","Key","Save","Jump","Rotation","Locate","Status"] {
            c[name].GetPos(&x,&y,&w,&h)
            V48Assert(x>=0 && y>=0 && x+w<=dims[1] && y+h<=dims[2],"bookmark " name " fits " dims[1] "x" dims[2])
        }
    }
    c["Note"].Value := "An editable local note",c["Key"].Choose("Off"),IBKSaveClick()
    V48Assert(b.Rows[d.Key].Note="An editable local note" && b.Choice="Off" && b.Bound="","Save persists note and binding preference without registering a diagnostic hotkey")
    c["Time"].Value := "8.125",c["Label"].Value := "Swap",IBKAddClick()
    V48Assert(b.Rows[d.Key].Marks.Length=2 && b.Rows[d.Key].Marks[2].At=18125,"manual fractional seconds persist relative to the pull start")
    IBKSelect(c["List"],2,true),IBKDeleteClick()
    V48Assert(b.Rows[d.Key].Marks.Length=1 && b.Rows[d.Key].Note="An editable local note","Delete removes only the selected mark and preserves the pull note")
    latest := IBKMark(b.Rows[d.Key],16000,"new live mark"),IBKStore(latest)
    c["Note"].Value := "stale editor"
    V71BookmarkThrows(IBKDraft,"an editor cannot overwrite a live mark added while it was open")
    V48Assert(b.Rows[d.Key].Marks.Length=2,"live mark survives stale-editor refusal")
    b.Controls["Note"].Value := b.Editor.Note
    IBKOpen(d)
    V48Assert(b.Editor.Marks.Length=2 && b.Editor.Note="An editable local note","reopening reloads persisted updates")
    V48Assert(IBKChoices().Count=4 && IBKChoices()["Ctrl+Alt+M"]="^!m","bookmark binding offers unused explicit key choices and Off")
    empty := IBKCopy(b.Editor),empty.Marks := [],empty.Note := "",IBKStore(empty)
    V48Assert(!b.Rows.Has(empty.Key),"clearing note and all moments frees the pull's bounded storage slot")
}

; Native isolated run-time accounting. Persistence uses a private temporary
; sidecar; synthetic fixtures never start the live reader or normal application.
V71BreakdownFixture(key := "gods")
{
    f := V70SplitFixture(key),s := IRBNewState(),d := IRBSync(s,f.Timer,f.Tick)
    return {Timer:f.Timer,Run:f.Run,State:s,Detail:d,Utc:f.Utc,Tick:f.Tick}
}

V71RunBreakdownPartition()
{
    f := V71BreakdownFixture(),d := f.Detail,d.Total := 10000,d.Known := [[0,10000]]
    IRBAttempt(d,"one","G-TY",1000,4000,true,true)
    IRBAttempt(d,"two","G-AE",5000,7000,false,true)
    IRBAttempt(d,"overlap","G-TY",3000,6000,false,true)
    a := IRBSummary(d)
    V48Assert(a.Success=3000 && a.Other=3000 && a.Outside=4000 && a.Unknown=0,
        "overlapping attempts are partitioned once, with successful coverage counted only once")
    d.Known := [[0,4000],[6000,10000]],a := IRBSummary(d)
    V48Assert(a.Success=3000 && a.Other=1000 && a.Outside=4000 && a.Unknown=2000,
        "missing reader coverage is unknown rather than inferred travel or a break")
    V48Assert(a.Success+a.Other+a.Outside+a.Unknown=a.Total,"four categories exactly cover elapsed time")
    a := IRBSummary(d,12000)
    V48Assert(a.Unknown=4000 && a.Total=12000,"a checkpoint newer than persisted detail remains unknown")
    V48Assert(!IRBAttempt(d,"one","G-TY",1000,9500,true,true) && d.Attempts[1].End=4000,
        "later corpse hits cannot extend a confirmed successful attempt")
    V48Assert(!IRBAttempt(d,"wrong","R4-IP",0,1000) && !IRBAttempt(d,"negative","G-TY",5000,1000),
        "wrong raid identities and backward attempt bounds are rejected")
    V48Assert(!IRBSummary("").Available,"old runs without detail stay explicitly unavailable")
    clipped := IRBNewRun(f.Run),clipped.Total := 3000,clipped.Known := [[0,3000]]
    IRBAttempt(clipped,"already started","G-TY",-2000,1000,true,true)
    V48Assert(IRBSummary(clipped).Success=1000 && clipped.Attempts[1].Origin=-2000,
        "a pull crossing manual timer start counts only time after the clock started")
}

V71RunBreakdownCoverage()
{
    f := V71BreakdownFixture(),s := f.State,d := f.Detail
    IRBCover(s,d,0,0,"source",true),IRBCover(s,d,1000,1000,"source",true)
    IRBCover(s,d,5000,5000,"source",true),IRBCover(s,d,6000,6000,"source",true)
    IRBCover(s,d,7000,7000,"source",false),IRBCover(s,d,8000,8000,"source",true)
    IRBCover(s,d,9000,9000,"source",true)
    a := IRBSummary(d)
    V48Assert(a.Outside=3000 && a.Unknown=6000,"sleep and paused-parser gaps are not connected by a continuous-coverage interval")
    IRBCover(s,d,8500,8500,"source",true)
    V48Assert(d.Known.Length=3 && IRBSummary(d).Outside=3000,"out-of-order time does not move the coverage anchor back")
    IRBCover(s,d,10000,10000,"different source",true)
    V48Assert(IRBSummary(d).Unknown=7000,"source changes begin a new observed interval")
    saved := IRBParse(IGVJson(IRBPack(s))),restored := saved.Items[f.Run.Id]
    IRBCover(saved,restored,14000,14000,"different source",true)
    IRBCover(saved,restored,15000,15000,"different source",true)
    a := IRBSummary(restored)
    V48Assert(a.Outside=4000 && a.Unknown=11000,"restart preserves earlier coverage and keeps the missing interval unknown")
    live := {Halted:false,Reentry:"",Current:"",SourceKey:"source",LocalDead:false,DiedSinceEntry:false,InCombat:0}
    app := {Active:true,Head:1,Queue:[],Live:live},s.Sample := {Source:"source",Tick:10000,CaughtUp:true}
    V48Assert(IRBHealthy(s,app,11000),"healthy caught-up live reader can cover silent time between bosses")
    app.Active := false
    V48Assert(!IRBHealthy(s,app,11000),"paused parsing cannot make outside-boss coverage")
    app.Active := true,app.Queue := ["pending"]
    V48Assert(!IRBHealthy(s,app,11000),"a parser backlog cannot claim continuous coverage")
    app.Queue := []
    V48Assert(!IRBHealthy(s,app,13000),"stale reader pulses cannot fabricate coverage during sleep")
}

V71RunBreakdownLive()
{
    f := V71BreakdownFixture(),s := f.State,timer := f.Timer
    seg := V70SplitSegment({Run:f.Run},"G-TY",3000),seg.Start := 1000,seg.Terminal := false
    seg.FinishAt := -1
    data := {Halted:false,Reentry:"",Current:seg,Segments:[seg],SourceKey:"private-log|id",LocalDead:false,DiedSinceEntry:false,InCombat:1}
    V48Assert(!IRBObserve(s,timer,data,1000,0,f.Tick,false) && V71BreakdownAttemptCount(s)=0,
        "historical acquisition never records boss-attempt detail")
    V48Assert(!IRBObserve(s,timer,data,1000,3001,f.Tick,true) && V71BreakdownAttemptCount(s)=0,
        "stale queued events do not establish live coverage")
    V48Assert(IRBObserve(s,timer,data,1000,0,f.Tick,true),"a fresh observed pull starts a bounded attempt")
    IRBObserve(s,timer,data,2000,0,f.Tick+1000,true)
    seg.Terminal := true,IRBObserve(s,timer,data,3000,0,f.Tick+2000,true)
    d := f.Detail
    V48Assert(d.Attempts.Length=1 && d.Attempts[1].Success && d.Attempts[1].End=2000,
        "confirmed final death caps successful time at the observed endpoint")
    IRBObserve(s,timer,data,8000,0,f.Tick+7000,true)
    V48Assert(d.Attempts[1].End=2000,"post-kill statistical tails do not grow boss time")
    other := V71BreakdownFixture(),old := V70SplitSegment({Run:other.Run},"G-TY",3000)
    old.Start := 1000,old.FinishAt := -1
    otherData := {Halted:false,Reentry:"",Current:old,Segments:[old],SourceKey:"private-log|id",LocalDead:false,DiedSinceEntry:false,InCombat:1}
    IRBObserve(other.State,other.Timer,otherData,4000,0,other.Tick+3000,true)
    V48Assert(other.Detail.Attempts.Length=0,"first fresh record after terminal recovery cannot recreate the old boss attempt")
    other.State.Sample := {Source:"private-log|id",Tick:other.Tick+3000,CaughtUp:true}
    app := {Active:true,Head:1,Queue:[],Live:otherData}
    V48Assert(!IRBHealthy(other.State,app,other.Tick+3000),"recovered terminal state stays unknown until fresh encounter context is observed")
    before := IRSPack(IRSState())
    IRBConsume(data,{},"",1000,{Fresh:true})
    V48Assert(IGVJson(IRSPack(IRSState()))=IGVJson(before),"native fixture cannot feed real run history through the runtime adapter")
    V71BreakdownUncertainExit()
}

V71BreakdownParserEvent(f,data,at,kind,source,target,amount := 0)
{
    line := IPDemoLine(at,source,target,kind,amount)
    IPFeedLine(data,line)
    IRBObserve(f.State,f.Timer,data,at,0,f.Tick+at-1000,true)
}

V71BreakdownUncertainExit()
{
    f := V71BreakdownFixture(),data := IPNewData(),data.SourceKey := "private-log|id"
    data.AreaId := f.Run.Area,data.ModeId := f.Run.Mode
    player := V51Source(),dead := "@Example Player#101|(1,2,3,0)|(0/1000)"
    boss := "Tyth {4078419339902976}:17|(1,2,3,0)|(500/1000)"
    V71BreakdownParserEvent(f,data,1000,"Enter",player,"=")
    V71BreakdownParserEvent(f,data,2000,"Damage",player,boss,100)
    V71BreakdownParserEvent(f,data,3000,"Damage",boss,player,100)
    active := IRBSummary(f.Detail)
    V48Assert(data.Current.BossKey="G-TY" && active.Other=2000,"real parser establishes observed boss engagement")
    V71BreakdownParserEvent(f,data,4000,"Death",dead,"=")
    V71BreakdownParserEvent(f,data,5000,"Exit",dead,"=")
    app := {Active:true,Head:1,Queue:[],Live:data}
    for at in [6000,7000,8000,9000,10000,11000,12000] {
        f.State.Sample := {Source:data.SourceKey,Tick:f.Tick+at-1000,CaughtUp:true}
        V48Assert(!IRBPulse(f.State,f.Timer,app,f.Tick+at-1000),"quiet EOF after an uncertain death/exit cannot certify continued fighting")
    }
    V71BreakdownParserEvent(f,data,13000,"Activate",dead,"=")
    after := IRBSummary(f.Detail)
    V48Assert(after.Other=active.Other && after.Outside=active.Outside && after.Unknown=10000,
        "retained post-wipe state and noncombat records stay unknown, not boss time or inferred discussion")
    V71BreakdownParserEvent(f,data,30000,"Enter",player,"=")
    nextBoss := "Tyth {4078419339902976}:18|(1,2,3,0)|(1000/1000)"
    V71BreakdownParserEvent(f,data,31000,"Damage",player,nextBoss,100)
    V71BreakdownParserEvent(f,data,32000,"Damage",nextBoss,player,100)
    after := IRBSummary(f.Detail)
    V48Assert(f.Detail.Attempts.Length=2 && after.Other>active.Other && after.Unknown>=27000,
        "a confirmed new pull resumes observation without relabeling the missing interval: attempts=" f.Detail.Attempts.Length
            . ", other=" after.Other ", unknown=" after.Unknown ", reentry=" IsObject(data.Reentry)
            . ", current=" (IsObject(data.Current) ? data.Current.Start : -1))
    f.State.Sample := {Source:data.SourceKey,Tick:f.Tick+31500,CaughtUp:true}
    V48Assert(IRBPulse(f.State,f.Timer,app,f.Tick+31500),"healthy EOF can extend the freshly observed new attempt")
    ; An alive recorder Exit is uncertain until the parser settles it too.
    V71BreakdownParserEvent(f,data,33000,"Exit",player,"=")
    f.State.Sample := {Source:data.SourceKey,Tick:f.Tick+32500,CaughtUp:true}
    V48Assert(!IRBPulse(f.State,f.Timer,app,f.Tick+32500),"pending living-recorder Exit cannot extend a fight on silent EOF")
}

V71BreakdownAttemptCount(s)
{
    total := 0
    for id,d in s.Items
        total += d.Attempts.Length
    return total
}

V71RunBreakdownComparison()
{
    f := V71BreakdownFixture(),s := f.State,r := f.Run,d := f.Detail
    d.Total := 1000000,d.Known := [[0,1000000]]
    IRBAttempt(d,"private|100|G-TY","G-TY",100000,400000,false,true)
    IRSAdmit(r,"G-TY",r.Area,r.Mode,400000,"manual estimate","private|100|G-TY|99123")
    V48Assert(IRBMarkSplits(d,r) && d.Attempts[1].Success,"explicitly confirmed split updates the exact earlier attempt token")
    priorTimer := f.Timer.Clone(),priorTimer.RunId := "prior-run"
    baseline := V70SplitComplete(IRSNewState(),priorTimer),baseline.Splits[1].Kind := "manual estimate"
    previous := IRBNewRun(baseline),previous.Total := 3000000,previous.Known := [[0,3000000]]
    IRBAttempt(previous,"prior-tyth","G-TY",150000,600000,true,true),s.Items[baseline.Id] := previous
    comparison := IRBComparison(s,r,baseline)
    V48Assert(comparison.Available && comparison.Current.Total=400000 && comparison.Previous.Total=600000,
        "comparison cuts both runs at the same boss, never a partial run against the entire previous clear")
    V48Assert(comparison.Current.Success=300000 && comparison.Previous.Success=450000,
        "same-boss category comparison preserves each run's own observed timing")
    s.Items.Delete(baseline.Id)
    V48Assert(!IRBComparison(s,r,baseline).Available,"previous clear without v71 detail cannot supply guessed categories")
    s.Items[baseline.Id] := previous,baseline.Estimated := !r.Estimated
    V48Assert(!IRBComparison(s,r,baseline).Available,"different start bases cannot supply a time-breakdown comparison")
    full := V70SplitComplete(IRSNewState(),f.Timer),d.Total := 3100000,d.Known := [[0,3100000]]
    V48Assert(IRBMarkSplits(d,full) && d.Finished && d.Total=3000000 && d.Known[-1][2]=3000000,
        "completed run clips coverage to final split rather than delayed confirmation time")
}

V71RunBreakdownStorage()
{
    f := V71BreakdownFixture(),s := f.State,d := f.Detail,d.Total := 2000,d.Known := [[0,2000]]
    IRBAttempt(d,"original","G-TY",0,1500,false,false)
    parsed := IRBParse(IGVJson(IRBPack(s)))
    V48Assert(parsed.Items[f.Run.Id].Attempts[1].End=1500 && parsed.Observed.Count=0 && parsed.LastTick=-1,
        "stored detail restores data but never restores an active coverage anchor")
    bad := IRBPack(s),bad[2][1][8] := [[0,1000],[500,2000]],failed := false
    try IRBParse(IGVJson(bad))
    catch
        failed := true
    V48Assert(failed,"overlapping saved coverage rows are rejected instead of double-counted")
    path := A_Temp "\iris-v71-run-detail-" DllCall("GetCurrentProcessId","UInt") ".json"
    try {
        if FileExist(path)
            FileDelete(path)
        text := IRBSave(s,path,"")
        V48Assert(IRBParse(FileRead(path,"UTF-8")).Items.Count=1,"atomic native detail sidecar round-trips")
        state := IRBState(),prior := state.Clone()
        try {
            for name,value in IRBNewState().OwnProps()
                state.%name% := value
            IRBLoadData(state,path),splits := IRSNewState(),splits.Active := f.Run
            stopped := IRNNewState(),IRSSync(splits,stopped)
            V48Assert(state.Loaded && !state.Initialized && splits.Runs.Length=1
                && splits.Runs[1].Stopped && splits.Runs[1].Id=f.Run.Id,
                "loading the sidecar before split reconciliation preserves a stopped run with detail but no kills")
            V48Assert(state.ActiveId="" && state.LastTick=-1 && state.Observed.Count=0,
                "read-only startup reconciliation never starts live coverage or creates missing detail")
        }
        finally {
            for name,value in prior.OwnProps()
                state.%name% := value
        }
        failed := false
        try IRBSave(s,path,"")
        catch
            failed := true
        V48Assert(failed && FileRead(path,"UTF-8")=text,"concurrent writer conflicts preserve the existing sidecar")
        FileDelete(path),FileAppend("[2,[]]",path,"UTF-8-RAW"),failed := false
        try IRBSave(s,path,"[2,[]]")
        catch
            failed := true
        V48Assert(failed && FileRead(path,"UTF-8")="[2,[]]","unsupported future detail formats are kept unchanged")
    }
    finally {
        for file in [path,path ".bak"] {
            if FileExist(file)
                FileDelete(file)
        }
    }
    splitJSON := IGVJson(IRSPack(IRSNewState()))
    V48Assert(splitJSON="[1,[],[]]" && IRSParse(splitJSON).Runs.Length=0,"existing v70 split-history schema remains unchanged")
}

V71RunBreakdownUI() => V6510RunUIFixture(V71RunBreakdownUICase)
V71RunBreakdownUICase()
{
    global IRN
    b := IRBState(),oldB := b.Clone(),r := IRSState(),oldR := r.Clone()
    try {
        f := V71BreakdownFixture(),IRN := f.Timer,r.Active := f.Run,r.Runs := [],r.Error := ""
        b.Items := f.State.Items,b.ActiveId := f.Run.Id,b.Loaded := true,b.Error := ""
        f.Detail.Total := 10000,f.Detail.Known := [[0,9000]]
        IRBAttempt(f.Detail,"test","G-TY",1000,4000,true,true)
        g := IRBUOpen()
        V48Assert(!DllCall("IsWindowVisible","Ptr",g.Hwnd) && b.Controls["Current"].GetCount()=4,
            "native diagnostic view stays hidden and exposes all four run-time categories")
        for size in [[650,560],[730,604],[1000,740]] {
            IRBUResize(g,0,size[1],size[2])
            for name in ["Current","CompareLabel","Compare","Note","Close"] {
                b.Controls[name].GetPos(&x,&y,&w,&h)
                V48Assert(x>=0 && y>=0 && x+w<=size[1] && y+h<=size[2],"breakdown controls fit compact and expanded windows")
            }
        }
        b.Items := Map(),IRBURefresh()
        V48Assert(InStr(b.Controls["Summary"].Text,"Older runs"),"old history displays unavailable rather than zero downtime")
        IRSUOpen(),r.Controls["Breakdown"].GetPos(&x,&y,&w,&h)
        V48Assert(r.Controls["Breakdown"].Text="Time breakdown" && x+w<=620,
            "Boss splits provides a discoverable breakdown button at its minimum width")
    }
    finally {
        IRBShutdown(),IRSUShutdown()
        for name,value in oldB.OwnProps()
            b.%name% := value
        for name,value in oldR.OwnProps()
            r.%name% := value
    }
}

V71ALGroups()
{
    groups := IALTEdit([],"new","one","One player")
    groups := IALTEdit(groups,"link","one","",[{Key:"@Present#1",Name:"Present"},{Key:"@Alt#2",Name:"Alt"}])
    return groups
}

V71ALIdentity()
{
    groups := V71ALGroups(),keys := IALTKeys(IALTToken("one"),groups)
    V48Assert(keys.Length=2 && keys[1]="@Present#1" && keys[2]="@Alt#2","manual links retain both exact identities")
    V48Assert(IALTKeys("@Present#9",groups)[1]="@Present#9","same display name does not link an unrelated character")
    V48Assert(IALTKeys(IALTToken("deleted"),groups).Length=0,"removed person cannot match every character")
    other := IALTEdit(groups,"new","two","Someone else"),failed := false
    try IALTEdit(other,"link","two","",[{Key:"@Alt#2",Name:"Alt"}])
    catch
        failed := true
    V48Assert(failed && other[2].Members.Length=0 && groups.Length=1,"cross-person duplicate is rejected without mutating either input")
    renamed := IALTEdit(groups,"rename","one","New name")
    V48Assert(renamed[1].Id=groups[1].Id && renamed[1].Name="New name" && groups[1].Name="One player","renaming preserves the stable selection and caller's model")
    unlinked := IALTEdit(groups,"unlink","one","",[{Key:"@Alt#2",Name:"Alt"}])
    V48Assert(unlinked[1].Members.Length=1 && groups[1].Members.Length=2,"unlink removes only selected membership")
}

V71ALAttendance()
{
    s := IALTState(),before := s.Groups
    try {
        s.Groups := V71ALGroups(),first := V71PCEntry(1,1),second := V71PCEntry(2,2),third := V71PCEntry(1,3)
        person := second.Pull.Players["@Present#1"],second.Pull.Players := Map("@Alt#2",person)
        third.Pull.Players := Map("@Present#9",person),selection := IALTToken("one")
        rows := IGVSelectEntries([first,second,third],first.Pull.Group,selection,"A")
        V48Assert(rows.Length=2 && rows[1].Pull=first.Pull && rows[2].Pull=second.Pull,"attendance uses exact linked IDs without combining or copying character results")
        V48Assert(first.Pull.Players.Count=1 && second.Pull.Players.Count=1,"filtering cannot add another character's stats to a pull")
        V48Assert(IALTCharacterForEntry(first,selection)="@Present#1" && IALTCharacterForEntry(second,selection)="@Alt#2","inspection chooses the actual toon recorded in each pull")
        first.Pull.Players["@Alt#2"] := person
        V48Assert(IALTCharacterForEntry(first,selection)="","ambiguous two-toon capture requires explicit character selection")
        third.Variants := [third,second]
        V48Assert(IGLEntryHasCharacter(third,selection),"linked attendance remains visible in an alternative recording")
        V48Assert(IALTCharacterForEntry(third,selection)="","alternative-only attendance does not fabricate preferred-capture activity")
        result := IGLSavedSelection(Map("a",first),first.Pull.Group,selection,"A")
        V48Assert(result.Character=selection,"saved view can restore a person filter")
    }
    finally s.Groups := before
}

V71ALCycles()
{
    s := IALTState(),before := s.Groups
    try {
        s.Groups := V71ALGroups(),a := V71PCEntry(1,1),kill := V71PCEntry(4,2),b := V71PCEntry(2,3)
        kill.Pull.Progress.Kill := true,kill.Pull.Players := Map()
        result := IGKBuild([a,kill,b],"first","",IALTToken("one"))
        V48Assert(result.Rows.Length=1 && result.Rows[1].Pull.Id=a.Pull.Id,"an absent linked person cannot shift the team's first kill to a later attempt")
        result := IGKBuild([a,kill,b],"reclear","",IALTToken("one"))
        V48Assert(result.Rows.Length=1 && result.Rows[1].Pull.Id=b.Pull.Id,"reclear starts after the team kill even when every linked alt was absent")
        V48Assert(IGPCBuild(result.Rows,b.Pull.Group).Counters.Attempts=1,"phase statistics use the same filtered attended attempts")
    }
    finally s.Groups := before
}

V71ALStorage()
{
    groups := V71ALGroups(),text := IGVJson(IALTPack(groups)),roundtrip := IALTParse(text)
    V48Assert(roundtrip[1].Members[2].Key="@Alt#2","manual links round-trip exact IDs")
    for bad in ['[2,[]]','[1,[["a","Name",[["x","X"],["x","X"]]]]]','[1,[["a","Name",[]],["b","name",[]]]]','[1,[["a","Name",[["@iris-person:a","X"]]]]]'] {
        failed := false
        try IALTParse(bad)
        catch
            failed := true
        V48Assert(failed,"invalid or unknown linked-character schema is rejected")
    }
    path := A_Temp "\iris-v71-links-" DllCall("GetCurrentProcessId","UInt") ".json"
    try {
        if FileExist(path)
            FileDelete(path)
        saved := IALTSave(groups,path,"")
        V48Assert(ICPFileText(path)=text && saved=text,"native atomic write stores verified JSON")
        conflict := false
        try IALTSave([],path,"")
        catch
            conflict := true
        V48Assert(conflict && ICPFileText(path)=text,"stale writer cannot replace newer links")
        FileDelete(path),FileAppend("[2,[]]",path,"UTF-8-RAW"),blocked := false
        try IALTSave([],path,"[2,[]]")
        catch
            blocked := true
        V48Assert(blocked && ICPFileText(path)="[2,[]]","future schema remains byte-for-byte intact")
    }
    finally {
        for file in [path,path ".bak",path ".lock"] {
            if FileExist(file)
                FileDelete(file)
        }
    }
}

V71ALChoices()
{
    s := IALTState(),before := s.Groups
    try {
        s.Groups := V71ALGroups(),keys := ["","@Present#1"],labels := ["All","Present"]
        IALTChoices(keys,labels,Map("@Present#1",true))
        V48Assert(keys.Length=3 && keys[2]="@Present#1" && keys[3]=IALTToken("one"),"person choice supplements individual characters")
        keys := [""],labels := ["All"],IALTChoices(keys,labels,Map("@Present#9",true))
        V48Assert(keys.Length=1,"unobserved person is not offered just because a name matches")
        rows := IALTObserved([],s.Groups)
        V48Assert(rows.Length=2,"saved links remain editable without opening their original logs")
    }
    finally s.Groups := before
}

V71ALNativeWindow()
{
    global SELF_TEST
    s := IALTState(),before := s.Clone()
    try {
        s.Groups := V71ALGroups(),s.Selected := "one",s.Error := "",s.Gui := "",s.Controls := Map()
        g := IALTLegacyOpen()
        V48Assert(SELF_TEST && !DllCall("IsWindowVisible","Ptr",g.Hwnd),"native linked-character diagnostics never show a normal app")
        V48Assert(s.Controls["People"].GetCount()=1,"editor lists saved person without creating links from names")
        IALTResize(g,0,760,470)
        s.Controls["Characters"].GetPos(&x,&y,&w,&h)
        V48Assert(x+w<=744 && y+h<400,"character table fits minimum editor size")
        previous := IGVJson(IALTPack(s.Groups)),IALTAction("delete")
        V48Assert(IGVJson(IALTPack(s.Groups))=previous,"self-test UI handlers cannot save or delete live links")
    }
    finally {
        IALTClose()
        for key,value in before.OwnProps()
            s.%key% := value
    }
}

; Explicit isolated PNG writes stay beneath the diagnostic process's TEMP.
V71RIData()
{
    e := []
    for i,stage in [1,2,2,3,4] {
        item := V71PCEntry(stage,i),item.Pull.Progress.Hp := 90-i*10,item.Pull.Progress.Comparable := true
        item.Pull.Progress.Health := IGVDemoHealth(item.Pull,90-i*10,["4122949560827904"])
        e.Push(item)
    }
    e[5].Pull.Progress.Kill := true
    view := {Boss:e[1].Pull.Group,Team:"A",Window:"all",Cycle:"",Character:"",Source:"history",DemoHistory:true,History:Map()}
    for item in e
        view.History[item.Key] := item
    return {Entries:e,View:view}
}

V71RIModel()
{
    f := V71RIData(),before := V71PCViewSignature(f.View),m := ISRISnapshot(f.View)
    V48Assert(m.Attempts=5 && m.Positions=5 && m.Kills=1 && m.BestIndex=5,"image statistics reflect the exact filtered graph attempts and confirmed best pull")
    elapsed := 0
    for e in f.Entries
        elapsed += Max(0,e.Pull.End-e.Pull.Start)
    V48Assert(m.CombatMs=elapsed,"combat-time summary totals observed pull durations without breaks")
    V48Assert(m.Plot.Points.Length=5 && m.Phase.Rows[2].Reached=4 && m.Phase.Rows[4].Reached=1,"image uses the existing progression plot and phase summary model")
    V48Assert(!IsObject(m.Run) && InStr(m.Title,"SYNTHETIC DEMO"),"default image never silently pairs the latest raid run and always labels demos")
    V48Assert(V71PCViewSignature(f.View)=before,"taking a shareable snapshot cannot alter compact history")
    f.Entries[5].Pull.Progress.Kill := false,f.Entries[5].Pull.Progress.Hp := 99
    V48Assert(m.Kills=1 && m.Best="Confirmed kill" && m.Plot.Points[5].Kill,"renderable snapshot retains no mutable input pull references")
}

V71RIFilterAndUnknown()
{
    f := V71RIData(),f.Entries[2].Pull.Progress.Stage := 0,f.Entries[2].Pull.Progress.Comparable := false
    f.Entries[2].Pull.Progress.DeleteProp("Parsely")
    f.Entries[2].Pull.Progress.Health.Comparable := false
    f.Entries[3].Conflict := "different outcomes",f.Entries[3].Pull.Partial := true
    ; Direct model input is resolved again through existing graph rules; real
    ; conflict has two retained recorder variants, rather than an invented flag.
    alternative := IPRCloneSnapshot(f.Entries[3]),alternative.Key := "alt",alternative.Conflict := ""
    f.Entries[3].Conflict := "",f.Entries[3].Pull.Partial := false,alternative.Pull.Partial := false
    alternative.Pull.Progress.Kill := true,f.Entries.Push(alternative)
    m := ISRIBuild(f.Entries,f.View)
    V48Assert(m.Positions=5 && m.Attempts=4 && m.Conflicts=1,"alternative conflicting records remain one graph gap, not extra confirmed attempts")
    V48Assert(m.Unknown=2 && !m.Plot.Points[2].Known && !m.Plot.Points[3].Known,"missing data and conflicting sources stay gaps rather than fabricated zero progress")
    f.View.Window := "first",m := ISRIBuild(f.Entries,f.View)
    V48Assert(m.Blocked && InStr(m.Note,"unavailable"),"ambiguous first-kill scope cannot become a misleading export")
    f := V71RIData(),f.Entries[5].Pull.Players.Delete("@Present#1"),f.View.Character := "@Present#1",f.View.Window := "first"
    m := ISRIBuild(f.Entries,f.View)
    V48Assert(m.Attempts=4 && m.Kills=0 && m.Phase.Counters.TeamPulls=5,"character attendance preserves team boundary while image counts only attended attempts")
}

V71RIRunSelection()
{
    f := V71RIData(),r := V70SplitFixture().Run
    IRSAdmit(r,"G-TY",r.Area,r.Mode,300000,"death","tyth")
    IRSAdmit(r,"G-AE",r.Area,r.Mode,600000,"manual estimate","sisters",true,"Confirm")
    r.Estimated := true,m := ISRIBuild(f.Entries,f.View,r)
    V48Assert(IsObject(m.Run) && m.Run.Id=r.Id && m.Run.Date=IRSUDate(r.StartedUtc),"only an explicitly supplied matching run is included with its actual date")
    V48Assert(m.Run.Rows[1].Time=IRNUTime(300000) && m.Run.Rows[2].Status="Needs confirmation" && m.Run.Rows[3].Time="Not recorded","known, pending and missing raid splits stay distinct")
    V48Assert(InStr(m.Run.Basis,"estimated start"),"uncertain timer start remains labelled in the exported image")
    r.Splits[1].Elapsed := 350000
    V48Assert(m.Run.Rows[1].Time=IRNUTime(300000),"selected run snapshot cannot drift after preview")
    f.View.Character := "@NoLongerAttending#9",f.Entries[1].Pull.Progress.Stage := 4
    changed := ISRIWithRun(m,f.View.Boss,r)
    V48Assert(changed.Positions=5 && changed.Phase.Rows[4].Reached=1 && changed.Run.Rows[1].Time=IRNUTime(350000),"changing a run uses the frozen graph, without re-resolving attendance or new phase observations")
    wrong := V70SplitFixture("dxun").Run,rejected := false
    try ISRIBuild(f.Entries,f.View,wrong)
    catch ValueError
        rejected := true
    V48Assert(rejected,"a different raid cannot be silently included beside the selected graph")
    s := IRSNewState(),s.Runs := [r,wrong],s.Active := IPRCloneSnapshot(r)
    V48Assert(ISRIRunsForGroup(s,f.View.Boss).Length=1,"run dropdown scopes raid/difficulty and deduplicates the same active saved identity")
}

V71RIRenderBounds()
{
    f := V71RIData(),r := V70SplitFixture().Run
    for run in ["",r] {
        m := ISRIBuild(f.Entries,f.View,run),l := m.Layout,image := ISRIRender(m)
        try {
            V48Assert(image.W=m.Width*m.RenderScale && image.H=l.H*m.RenderScale && l.PhaseY+l.PhaseH<l.GraphY,"high-resolution image canvas places compact phase tables above the graph")
            V48Assert(l.GraphY+l.GraphH<l.RunY && l.RunY+l.RunH<l.FooterY && l.FooterY+l.FooterH<=l.H,"phase rows, optional splits and concise quality note cannot overlap or clip")
            object := Buffer(A_PtrSize=8 ? 32 : 24,0)
            V48Assert(DllCall("Gdi32\GetObjectW","Ptr",image.Bitmap,"Int",object.Size,"Ptr",object)>0,"renderer returns a live native bitmap")
            V48Assert(NumGet(object,4,"Int")=image.W && NumGet(object,8,"Int")=image.H && NumGet(object,18,"UShort")=24,"bitmap uses full image dimensions and opaque 24-bit pixels")
        }
        finally DllCall("Gdi32\DeleteObject","Ptr",image.Bitmap)
    }
}

V71RIPngRoundTrip()
{
    root := A_Temp "\IrisV71Image_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount
    DirCreate(root),path := root "\summary.png",f := V71RIData(),image := ISRIRender(ISRIBuild(f.Entries,f.View))
    lib := 0,token := 0,decoded := 0
    try {
        ISRIWritePng(image.Bitmap,path)
        file := FileOpen(path,"r"),header := Buffer(8),file.RawRead(header),file.Close()
        V48Assert(NumGet(header,0,"UInt")=0x474e5089 && NumGet(header,4,"UInt")=0x0a1a0a0d,"saved file is a PNG rather than a renamed bitmap")
        lib := DllCall("LoadLibraryW","WStr","gdiplus.dll","Ptr"),input := Buffer(A_PtrSize=8 ? 24 : 16,0),NumPut("UInt",1,input)
        V48Assert(DllCall("Gdiplus\GdiplusStartup","Ptr*",&token,"Ptr",input,"Ptr",0)=0,"independent native PNG decoder starts")
        V48Assert(DllCall("Gdiplus\GdipLoadImageFromFile","WStr",path,"Ptr*",&decoded)=0,"written PNG decodes successfully")
        width := 0,height := 0,pixel := 0
        DllCall("Gdiplus\GdipGetImageWidth","Ptr",decoded,"UInt*",&width),DllCall("Gdiplus\GdipGetImageHeight","Ptr",decoded,"UInt*",&height)
        V48Assert(width=image.W && height=image.H,"decoded PNG preserves exact full-size dimensions")
        V48Assert(DllCall("Gdiplus\GdipBitmapGetPixel","Ptr",decoded,"Int",1,"Int",1,"UInt*",&pixel)=0 && pixel=0xFF000000,"saved black background has expected RGB and full opacity")
        DllCall("Gdiplus\GdipBitmapGetPixel","Ptr",decoded,"Int",image.W-1,"Int",100,"UInt*",&pixel)
        V48Assert(pixel=0xFF000000,"background stays opaque without alpha blackouts")
        DllCall("Gdiplus\GdipDisposeImage","Ptr",decoded),decoded := 0
        before := FileGetSize(path),failed := false
        try ISRIWritePng(image.Bitmap,root "\missing-folder\never.png")
        catch Error
            failed := true
        V48Assert(failed && FileGetSize(path)=before && !FileExist(root "\missing-folder\never.png"),"failed save leaves the previous completed PNG intact")
        ISRIWritePng(image.Bitmap,path)
        V48Assert(FileGetSize(path)>10000,"explicit overwrite produces a complete nontrivial PNG")
        leftovers := 0
        Loop Files root "\*.tmp","F"
            leftovers += 1
        V48Assert(leftovers=0,"successful and failed writes leave no temporary image files")
    }
    finally {
        if decoded
            DllCall("Gdiplus\GdipDisposeImage","Ptr",decoded)
        if token
            DllCall("Gdiplus\GdiplusShutdown","Ptr",token)
        if lib
            DllCall("FreeLibrary","Ptr",lib)
        DllCall("Gdi32\DeleteObject","Ptr",image.Bitmap)
        if FileExist(path)
            FileDelete(path)
        DirDelete(root)
    }
}

V71RINativePreview()
{
    V58Isolated(V71RINativePreviewCase)
}

V71RINativePreviewCase()
{
    global IP,soundboardsEnabled,SETTINGS_FILE
    ISRIClose(),f := V71RIData(),model := ISRIBuild(f.Entries,f.View)
    v := IGVState(),savedView := Map(),aliases := IALTState(),savedAliases := aliases.Groups
    runs := IRSState(),savedRuns := runs.Runs,savedActive := runs.Active
    for key in ["Source","History","Boss","Team","Window","Cycle","Character","DemoHistory","Current"]
        savedView[key] := v.%key%
    try {
        ISRISetPreview(model),s := ISRIState()
        for size in [[700,620],[940,800],[1200,900]] {
            w := size[1],h := size[2],s.Gui.Show("Hide w" w " h" h),ISRIResize(s.Gui,0,w,h)
            s.Controls["Preview"].GetPos(&x,&y,&pw,&ph)
            V48Assert(x>=0 && y>=120 && x+pw<=w && y+ph<=h,"native scaled preview stays inside the window at each supported size")
            V48Assert(Abs(pw/ph-model.Width/model.Height)<0.01,"preview keeps the PNG's aspect ratio")
        }
        V48Assert(s.Controls["Save"].Enabled && s.Controls["Run"].Value=1,"available image starts with explicit save and no attached run")
        before := DllCall("GetGuiResources","Ptr",DllCall("GetCurrentProcess","Ptr"),"UInt",0,"UInt")
        Loop 6
            ISRISetPreview(model)
        after := DllCall("GetGuiResources","Ptr",DllCall("GetCurrentProcess","Ptr"),"UInt",0,"UInt"),object := Buffer(32,0)
        V48Assert(after<=before+2,"repeated preview replacement does not leak native bitmaps or fonts")
        ISRISave()
        V48Assert(!IP.Active && !soundboardsEnabled && !FileExist(SETTINGS_FILE),"diagnostic Save opens no file dialog, writes no settings and starts no live actions")
        for key in ["Source","History","Boss","Team","Window","Cycle","DemoHistory"]
            v.%key% := f.View.%key%
        v.Current := "",v.Character := IALTToken("image-person")
        aliases.Groups := [{Id:"image-person",Name:"Image person",Members:[{Key:"@Present#1",Name:"Present"}]}]
        runs.Runs := [V70SplitFixture().Run],runs.Active := ""
        ISRIRefresh()
        V48Assert(s.Model.Positions=5 && s.Controls["Run"].Value=1 && s.Controls["Run"].Text="None" && !IsObject(s.Model.Run),"normal refresh captures current filters and resets optional run selection to None")
        V48Assert(InStr(s.Model.Scope,"Person: Image person"),"shared snapshot names its linked-person attendance filter")
        aliases.Groups[1].Members := [],s.Controls["Run"].Choose(2),ISRIRunChanged()
        V48Assert(InStr(s.Controls["Run"].Text,"Gods from the Machine"),"native run selector exposes the chosen raid and date even in a hidden diagnostic window")
        V48Assert(s.Model.Positions=5 && IsObject(s.Model.Run) && IGPCSnapshot(v).Counters.Attempts=0,"editing linked characters after preview cannot silently change its graph when a raid run is chosen")
        ISRIRefresh()
        V48Assert(s.Model.Positions=0 && !s.Controls["Save"].Enabled && s.Controls["Run"].Value=1,"explicit refresh applies changed filters and disables empty-image export")
        old := s.Gui.Hwnd,bitmap := s.Image.Bitmap,ISRIClose()
        V48Assert(!DllCall("IsWindow","Ptr",old) && !DllCall("Gdi32\GetObjectW","Ptr",bitmap,"Int",object.Size,"Ptr",object),"closing preview releases its HWND and owned bitmap")
    }
    finally {
        ISRIClose(),aliases.Groups := savedAliases,runs.Runs := savedRuns,runs.Active := savedActive
        for key,value in savedView
            v.%key% := value
    }
}

; Exact recorded markers plus adversarial scope/order and journal checks.
V72PhaseSegment(boss := "G-IZ")
{
    p := IGPXProfiles()[boss][1],s := IPNewData("Isolated phase fixture")
    s.AreaId := p.Area,s.ModeId := p.Mode,seg := IPNewSegment(s,0,"synthetic phase test")
    seg.BossKey := boss,seg.BossName := p.Name,seg.Last := 10000,seg.End := 10000,seg.PhaseProgress := Map()
    return seg
}

V72PhaseCatalogue()
{
    count := 0
    for boss,profiles in IGPXProfiles() {
        for p in profiles {
            count += 1,seg := V72PhaseSegment(boss),seg.ModeId := p.Mode
            V48Assert(IGPXProfile(seg)=p && p.LinearPhases && p.Phases.Length>=2 && p.Phases.Length<=12,"internal recorded catalogue retains exact scope and bounded linear phases")
            V48Assert(IsObject(IGPYProfile(seg)) ? IGPProfile(seg)=p : IGPProfile(seg).Kind="HP","only verified Parsely scopes retain internal ordinal progress; other fights use boss HP")
            V48Assert(p.Targets.Length=p.Phases.Length && p.Expected.Length=p.Phases.Length,"each stage has a health-target policy")
            seen := Map()
            for r in p.Rules {
                V48Assert(IsInteger(r.Stage) && r.Stage>=1 && r.Stage<=p.Phases.Length,"every marker belongs to a named stage")
                V48Assert(r.HasOwnProp("Source") || r.HasOwnProp("Target") || r.HasOwnProp("Either"),"no unscoped ability-name transition")
                seen[r.Stage] := true
            }
            V48Assert(seen.Count=p.Phases.Length,"every listed phase has recorded evidence")
            for mode in ["836045448953651","836045448953652","836045448953655","836045448953656","unrecorded"] {
                if mode=p.Mode
                    continue
                seg.ModeId := mode
                V48Assert(!IsObject(IGPXProfile(seg)),"other difficulty/size remains outside this verified profile")
            }
            seg.ModeId := p.Mode,seg.AreaId := "wrong-area"
            V48Assert(!IsObject(IGPXProfile(seg)),"same actor outside its raid does not reuse phases")
        }
    }
    V48Assert(count>=6,"expanded catalogue covers multiple independent encounters")
}

V72PhaseExactMarkers()
{
    seg := V72PhaseSegment(),ev := V63Event("Activate","4108097563918336",90,1000,"4161075985514496")
    wrong := V63Event("Activate","999999999999999",90,1000,"4161075985514496")
    IGPObserve(seg,wrong,1000)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=0,"same ability from unrelated NPC cannot establish Izax phase")
    wrong := V63Event("Activate","4108097563918336",90,1000,"4161075985514497")
    IGPObserve(seg,wrong,1000)
    V48Assert(seg.PhaseProgress.Get("Stage",0)<=1,"numeric neighbor cannot advance past opening")
    IGPObserve(seg,ev,2000),IGPObserve(seg,ev,2100)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2 && seg.PhaseProgress.Get("StageAt",0)=2000,"duplicate casts do not invent another phase")
    old := V63Event("Activate","4108097563918336",90,1000,"4168751092072448")
    IGPObserve(seg,old,1000)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"chronologically older record cannot jump ahead of current phase")
    IGPObserve(seg,ev,1900)
    V48Assert(seg.PhaseProgress.Get("StageAt",0)=1900,"late same-phase marker can refine its boundary")
    IGPObserve(seg,old,3000),IGPObserve(seg,ev,3100)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=6,"earlier repeated mechanics cannot move a completed milestone backward")
}

V72PhaseJournal()
{
    seg := V72PhaseSegment(),s := IPNewData("Private phase journal")
    IGPObserve(seg,V63Event("Activate","4108097563918336",90,1000,"4161075985514496"),1000)
    before := IGVJson(IGVPackProgress(IGPCompact(seg)))
    IPBBeginUndo(s,seg)
    IGPObserve(seg,V63Event("Activate","4108097563918336",12,2000,"4168751092072448"),2000)
    V48Assert(IGPCompact(seg).Stage=6,"provisional accepted tail reaches burn")
    IPBRollbackTail(s,seg)
    V48Assert(IGVJson(IGVPackProgress(IGPCompact(seg)))=before,"rollback removes provisional phase and phase-specific HP together")
}

V72PhaseHistoryGraph()
{
    seg := V72PhaseSegment(),IGPObserve(seg,V63Event("Activate","4108097563918336",12,2000,"4168751092072448"),2000)
    p := IPRCompact(seg),fresh := {Key:"new",Pull:p,Date:"20261003",Session:"fixture",Team:""}
    old := IPRCloneSnapshot(fresh),old.Key := "old",old.Pull.Id := 2
    old.Pull.Progress.DeleteProp("Parsely")
    old.Pull.Progress.DeleteProp("Health")
    old.Pull.Progress.Profile := "hp-only-v1",old.Pull.Progress.Phases := ["HP only"],old.Pull.Progress.Stage := 1
    old.Pull.Progress.Kill := true
    q := IGVUnpackProgress(IGVPackProgress(p.Progress))
    V48Assert(IGPXProgressMatches(q,IGPProfile(seg)) && q.Stage=6,"compact storage round-trips expanded phase identity")
    for rows in [[old,fresh],[fresh,old]] {
        m := IGVPlotModel(rows,1000,320,1,p.Group)
        oldIndex := rows[1].Key="old" ? 1 : 2,newIndex := 3-oldIndex
        V48Assert(m.Profile="hp-only-v1" && m.Axis.Percent && m.Axis.Kind="hp" && m.MappingMismatch=0 && m.Unknown=0,"observed whole-boss HP and an independent old confirmed kill share the percentage axis")
        V48Assert(m.Points[oldIndex].Kill && IGVEntryScore(old,m,oldIndex)>IGVEntryScore(fresh,m,newIndex),"best-pull comparison retains confirmed old kill on the same shared graph scale")
    }
    changed := IPRCloneSnapshot(fresh),changed.Pull.Progress.Parsely.Key := "obsolete-primary-map"
    m := IGVPlotModel([fresh,changed],1000,320,1,p.Group)
    V48Assert(m.MappingMismatch=0 && m.Points[1].Score=m.Points[2].Score && m.Points[2].Known,"incompatible phase metadata does not invalidate independent whole-boss health")
    V48Assert(IGPCBuild([fresh,changed],p.Group).Counters.Unknown=1,"incompatible primary metadata remains a gap in the phase summary")
    phase := IGPCBuild([old,fresh],p.Group)
    V48Assert(phase.Rows.Length=1 && phase.Rows[1].Reached=1 && phase.Rows[1].Unknown=1 && phase.Counters.Kills=1,"old kill never fills the missing observed Burn evidence")
    V48Assert(old.Pull.Progress.Profile="hp-only-v1" && old.Pull.Progress.Kill,"compatibility check never overwrites old evidence or kill outcome")
}

V72PhaseHealth()
{
    seg := V72PhaseSegment(),ev := V63Event("Activate","4108097563918336",50,1000,"4168751092072448")
    ev.SourceHP.Known := false,IGPObserve(seg,ev,1000),q := IGPCompact(seg)
    V48Assert(q.Stage=6 && q.Hp<0 && !q.Comparable,"real phase marker without health stays known phase but unknown HP")
    e := V63Event("Damage","4108097563918336",12,900,"1",true),IGPObserve(seg,e,900)
    V48Assert(IGPCompact(seg).Hp<0,"older phase HP cannot fill new phase's health")
    e.Immune := true,late := V72PhaseSegment(),IGPObserve(late,e,1000)
    V48Assert(late.PhaseProgress.Get("Stage",0)=0,"immune hit cannot create damage-based engagement")
    e.Immune := false,e.FullAbsorb := true,IGPObserve(late,e,1001)
    V48Assert(late.PhaseProgress.Get("Stage",0)=0,"fully absorbed hit cannot create damage-based engagement")
    for boss,stage in Map("EC-VO",1,"DP-BE",1,"DP-CA",2) {
        s := V72PhaseSegment(boss),IGPAdvance(s,stage,1000,"Observed phase fixture"),q := IGPCompact(s)
        V48Assert(q.Stage=stage && q.Hp<0 && !q.Comparable,"variable waves or incomplete branches do not fabricate a shared HP percentage")
    }
}

V72PhaseSequences()
{
    seg := V72PhaseSegment("DP-CA"),npc := "3273946195558400"
    IGPObserve(seg,V63Event("Activate",npc,100,1000,"3300648007237632"),1000)
    V48Assert(IGPCompact(seg).Stage=1,"reused return cast without prior vision cannot choose first or second return")
    for row in [[2000,"3305041758781440",2],[3000,"3300648007237632",3],[3100,"3300648007237632",3],
        [4000,"3301386741612544",4],[5000,"3300648007237632",5],[5100,"3300648007237632",5],[6000,"3305046053748736",6]] {
        IGPObserve(seg,V63Event("Activate",npc,80,row[1],row[2]),row[1])
        V48Assert(IGPCompact(seg).Stage=row[3],"same return ID advances only from its recorded prerequisite once")
    }
    seg := V72PhaseSegment("TOS-RE")
    IGPObserve(seg,V63Event("Activate","3431605855059968",100,1000),1000)
    IGPObserve(seg,V63Event("Damage","3444310368321536",100,2000),2000)
    V48Assert(IGPCompact(seg).Stage=1,"HK firing during Revan opening is not the HK damage phase")
    IGPObserve(seg,V63Event("Damage","3444310368321536",90,3000,"1",true),3000)
    V48Assert(IGPCompact(seg).Stage=2,"actual player damage to HK establishes his phase")
}

V72PhaseInactiveTargets()
{
    seg := V72PhaseSegment("DF-BR")
    IGPObserve(seg,V63Event("Activate","3303276527222784",100,1000,"1",true),1000)
    V48Assert(IGPCompact(seg).Stage=0,"player cast targeting inactive late hand cannot imply six-finger phase")
    IGPObserve(seg,V63Event("Damage","3275642707640320",80,2000),2000)
    V48Assert(IGPCompact(seg).Stage=1,"early finger ID never aliases late six fingers")
    IGPObserve(seg,V63Event("Damage","3303276527222784",80,3000),3000)
    IGPObserve(seg,V63Event("Activate","3303529930293248",20,4000,"3309164927385600"),4000)
    V48Assert(IGPCompact(seg).Stage=4,"Supremacy cast does not start burn ten seconds before its applied effect")
}

V72PhaseOpeningBinding()
{
    for npc in ["2876515691790336","2876532871659520"] {
        s := IPNewData("Recorded EC opening fixture"),s.AreaId := "833571547775688",s.ModeId := "836045448953655"
        seg := IPNewSegment(s,0,"synthetic"),ev := V63Event("Damage",npc,90,1000,"1",true)
        IPXBind(s,ev,1000),IGPObserve(seg,ev,1000)
        V48Assert(seg.BossKey="EC-KE" && IGPCompact(seg).Stage=1,"recorded siege/walker damage identifies early Kephess opening")
        V48Assert(seg.Required.Length=1 && seg.Required[1]="boss" && seg.Profile.Actors.Count=1,"opening adds are never new terminal or required kill actors")
        V48Assert(!IsObject(IPXActorRule(ev.Target,s)),"opening recognition does not change the existing final-actor catalogue")
        wrong := s.Clone(),wrong.ModeId := "836045448953652"
        V48Assert(!IsObject(IGPXOpeningRule(ev,wrong)),"opening recognition stays scoped to recorded 8-player Master")
        wrong := s.Clone(),wrong.AreaId := "137438993410"
        V48Assert(!IsObject(IGPXOpeningRule(ev,wrong)),"same NPC identity outside EC cannot bind this encounter")
        ev.Immune := true
        V48Assert(!IsObject(IGPXOpeningRule(ev,s)),"immune activation/attempt is not enough to infer the opening")
    }
}

; Recorded event excerpts: exact IDs/HP/times preserved, player tokens anonymized.
; Evidence/source hashes and original line positions are in the release research report.
V72RecordedWitness01()
{
    seg := V72PhaseSegment("G-IZ"),day := 0,last := -1
    ev := IPParseLine("[21:50:10.898] [@Recorded Player#1|(91.51,2269.83,790.95,-64.32)|(480157/480157)] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(254695568/254712048)] [Shocked {3960050041225514}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (232 ~240 energy {836045448940874}) <2790.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"gods-aug11 original line 266098 reaches expected phase")
    ev := IPParseLine("[21:51:04.326] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(246022048/254712048)] [=] [Deflector Pulse {4161075985514496}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"gods-aug11 original line 269229 reaches expected phase")
    ev := IPParseLine("[21:53:12.078] [IZAX {4108097563918336}:11204001960413|(23.25,2261.25,792.97,-90.00)|(202539184/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"gods-aug11 original line 276108 reaches expected phase")
    ev := IPParseLine("[21:57:06.369] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(152791376/254712048)] [=] [Missile Launcher Damage {4173226447994880}] [ApplyEffect {836045448945477}: Missile Launcher Damage {4173226447994880}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"gods-aug11 original line 286559 reaches expected phase")
    ev := IPParseLine("[21:59:10.392] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(86547032/254712048)] [=] [ {4163854829355008}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"gods-aug11 original line 295554 reaches expected phase")
    ev := IPParseLine("[22:02:37.451] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(5268300/254712048)] [=] [Emergency Override: Fire Omnicannon {4168751092072448}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=6,"gods-aug11 original line 306892 reaches expected phase")
}


V72RecordedWitness02()
{
    seg := V72PhaseSegment("G-IZ"),day := 0,last := -1
    ev := IPParseLine("[13:16:36.490] [@Recorded Player#1|(91.35,2254.03,790.82,-117.63)|(498994/498994)] [IZAX {4108097563918336}:3225001264633|(101.25,2261.00,792.97,90.00)|(254679536/254712048)] [Depredating Volts {3408949902573568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9365* ~9360 energy {836045448940874}) <28094.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"izax-clear-1 original line 12303 reaches expected phase")
    ev := IPParseLine("[13:17:29.715] [IZAX {4108097563918336}:3225001264633|(101.25,2261.00,792.97,90.00)|(246435792/254712048)] [=] [Deflector Pulse {4161075985514496}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"izax-clear-1 original line 15197 reaches expected phase")
    ev := IPParseLine("[13:19:34.302] [IZAX {4108097563918336}:3225001264633|(62.25,2222.25,792.97,180.00)|(202777168/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"izax-clear-1 original line 21725 reaches expected phase")
    ev := IPParseLine("[13:23:36.297] [IZAX {4108097563918336}:3225001264633|(23.25,2261.25,792.97,-90.00)|(152827232/254712048)] [=] [Missile Launcher Damage {4173226447994880}] [ApplyEffect {836045448945477}: Missile Launcher Damage {4173226447994880}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"izax-clear-1 original line 32247 reaches expected phase")
    ev := IPParseLine("[13:25:46.459] [IZAX {4108097563918336}:3225001264633|(62.25,2300.25,792.97,0.00)|(87502288/254712048)] [=] [ {4163854829355008}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"izax-clear-1 original line 40987 reaches expected phase")
    ev := IPParseLine("[13:29:13.340] [IZAX {4108097563918336}:3225001264633|(101.25,2261.00,792.97,90.00)|(5059697/254712048)] [=] [Emergency Override: Fire Omnicannon {4168751092072448}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=6,"izax-clear-1 original line 52028 reaches expected phase")
}


V72RecordedWitness03()
{
    seg := V72PhaseSegment("R4-LD"),day := 0,last := -1
    ev := IPParseLine("[23:17:54.932] [@Recorded Player#1|(-55.25,-17.73,-215.45,-133.72)|(438155/438155)] [Lady Dominique {4608014577303552}:123719000652115|(-39.00,-3.50,-215.45,36.80)|(66253200/66281708)] [Electro Net {3066456325488640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2351 ~2352 energy {836045448940874}) <2351.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"dominique-mar03 original line 86387 reaches expected phase")
    ev := IPParseLine("[23:20:14.126] [Lady Dominique {4608014577303552}:123719000652115|(-39.00,-3.50,-215.45,112.92)|(44684924/66281708)] [=] [Separate {4598093202849792}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"dominique-mar03 original line 95431 reaches expected phase")
    ev := IPParseLine("[23:23:38.537] [Lady Dominique {4608014577303552}:123719000652115|(-9.13,-8.77,-231.25,-133.52)|(25652558/66281708)] [=] [Unify {4598754627813376}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"dominique-mar03 original line 111856 reaches expected phase")
    ev := IPParseLine("[23:25:17.117] [Lady Dominique {4608014577303552}:123719000652115|(-39.00,-3.50,-215.45,122.17)|(16424393/66281708)] [=] [Unify {4606249345744896}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"dominique-mar03 original line 117628 reaches expected phase")
}


V72RecordedWitness04()
{
    seg := V72PhaseSegment("R4-LD"),day := 0,last := -1
    ev := IPParseLine("[22:43:28.605] [@Recorded Player#1|(-44.16,1.97,-215.56,-43.31)|(470907/470907)] [Lady Dominique {4608014577303552}:1924000634191|(-39.00,-3.50,-215.45,-90.00)|(66270168/66281708)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4639 ~4640 kinetic {836045448940873}) <13916.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"dominique-jul08 original line 80196 reaches expected phase")
    ev := IPParseLine("[22:45:48.237] [Lady Dominique {4608014577303552}:1924000634191|(-39.00,-3.50,-215.45,91.55)|(48129500/66281708)] [=] [Separate {4598093202849792}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"dominique-jul08 original line 87152 reaches expected phase")
    ev := IPParseLine("[22:49:05.795] [Lady Dominique {4608014577303552}:1924000634191|(-41.61,-1.23,-215.45,-24.51)|(25459032/66281708)] [=] [Unify {4598754627813376}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"dominique-jul08 original line 101694 reaches expected phase")
    ev := IPParseLine("[22:51:03.779] [Lady Dominique {4608014577303552}:1924000634191|(-39.00,-3.50,-215.45,53.23)|(16329199/66281708)] [=] [Unify {4606249345744896}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"dominique-jul08 original line 107422 reaches expected phase")
}


V72RecordedWitness05()
{
    seg := V72PhaseSegment("R4-IP"),day := 0,last := -1
    ev := IPParseLine("[19:47:31.051] [@Recorded Player#1|(-180.63,-9.78,411.95,-61.93)|(429479/470032)] [IP-CPT {4494653210492928}:23408000004605|(-157.70,-15.90,411.98,0.00)|(21871478/21888378)] [Shocked {3960050041225514}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (362* energy {836045448940874}) <4347.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"r4-jun08 original line 10692 reaches expected phase")
    ev := IPParseLine("[19:53:38.811] [IP-CPT {4494653210492928}:23408000004605|(-157.70,-15.90,411.98,0.00)|(5468454/21888378)] [=] [Disproportionate Intrusion Response {4471730970034176}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"r4-jun08 original line 30333 reaches expected phase")
}


V72RecordedWitness06()
{
    seg := V72PhaseSegment("R4-IP"),day := 0,last := -1
    ev := IPParseLine("[22:50:40.713] [@Recorded Player#1|(-161.11,-17.40,411.96,-101.14)|(467519/498325)] [IP-CPT {4494653210492928}:123719000004104|(-157.70,-15.90,411.98,0.00)|(21879000/21888378)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9379 ~9378 kinetic {836045448940873}) <42205.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"r4-mar03 original line 5438 reaches expected phase")
    ev := IPParseLine("[22:56:49.056] [IP-CPT {4494653210492928}:123719000004104|(-157.70,-15.90,411.98,0.00)|(5446854/21888378)] [=] [Disproportionate Intrusion Response {4471730970034176}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"r4-mar03 original line 24048 reaches expected phase")
}


V72RecordedWitness07()
{
    seg := V72PhaseSegment("DX-HMM"),day := 0,last := -1
    ev := IPParseLine("[00:55:59.841] [@Recorded Player#1|(269.93,-279.20,-11.13,33.23)|(496489/496489)] [Huntmaster {4265104388390912}:23320000032374|(290.62,-291.45,-10.98,120.00)|(30094976/30102682)] [Saber Throw {807788859097088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7706 energy {836045448940874}) <23118.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"huntmaster-aug14 original line 98045 reaches expected phase")
    ev := IPParseLine("[01:00:25.293] [Huntmaster {4265104388390912}:23320000032374|(262.00,-245.50,-9.48,14.06)|(17521918/30102682)] [Shelleigh {4330237567434752}:23320001114764|(259.03,-234.54,-13.05,360.00)|(8838629/11822805)] [Flying Fortress Jet Wash {4387871733580067}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18785 elemental {836045448940875})")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"huntmaster-aug14 original line 113020 reaches expected phase")
}


V72RecordedWitness08()
{
    seg := V72PhaseSegment("DX-TR"),day := 0,last := -1
    ev := IPParseLine("[00:44:15.610] [@Recorded Player#1|(41.92,231.29,35.07,-92.71)|(443752/443752)] [Titax {4245987488956416}:23320000603367|(45.42,231.45,35.07,90.00)|(10683374/10696316)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12942* energy {836045448940874}) <9706.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"trandoshans-aug14 original line 70940 reaches expected phase")
    ev := IPParseLine("[00:48:18.158] [@Recorded Player#1|(55.97,233.36,35.07,-28.68)|(453429/453429)] [The Ultimate Hunter {4381150109761536}:23320000841344|(65.57,231.47,35.07,90.00)|(10543788/10553973)] [Eradicate {4035839034130432}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10185 kinetic {836045448940873}) <7639.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"trandoshans-aug14 original line 86231 reaches expected phase")
}


V72RecordedWitness09()
{
    seg := V72PhaseSegment("DX-HMM"),day := 0,last := -1
    ev := IPParseLine("[22:28:35.599] [@Recorded Player#1|(271.73,-276.78,-11.07,-22.96)|(437131/437131)] [Huntmaster {4265104388390912}:14596000032384|(288.25,-290.06,-11.03,117.67)|(30090500/30102682)] [Saber Throw {807788859097088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12182 energy {836045448940874}) <12182.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"huntmaster-jul13 original line 108432 reaches expected phase")
    ev := IPParseLine("[22:33:16.626] [Huntmaster {4265104388390912}:14596000032384|(262.00,-245.50,-9.48,-77.67)|(17596674/30102682)] [Shelleigh {4330237567434752}:14596001097774|(259.03,-234.54,-13.33,360.00)|(8768537/8876199)] [Firestorm {4274974223237457}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (107662 elemental {836045448940875}) <107662.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"huntmaster-jul13 original line 124722 reaches expected phase")
}


V72RecordedWitness10()
{
    seg := V72PhaseSegment("DX-TR"),day := 0,last := -1
    ev := IPParseLine("[22:18:47.869] [@Recorded Player#1|(41.92,231.64,35.07,-86.89)|(443752/443752)] [Titax {4245987488956416}:14596000605942|(45.42,231.45,35.07,90.00)|(10666983/10696316)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13040* energy {836045448940874}) <9780.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"trandoshans-jul13 original line 79374 reaches expected phase")
    ev := IPParseLine("[22:22:48.719] [@Recorded Player#1|(52.97,231.97,35.07,-87.78)|(498994/498994)] [The Ultimate Hunter {4381150109761536}:14596000833440|(65.57,231.47,35.07,90.00)|(10545413/10553973)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8560 energy {836045448940874}) <25679.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"trandoshans-jul13 original line 94118 reaches expected phase")
}


V72RecordedWitness11()
{
    seg := V72PhaseSegment("R4-KN"),day := 0,last := -1
    ev := IPParseLine("[23:09:34.486] [@Recorded Player#1|(267.41,-121.11,-232.01,17.94)|(434458/434458)] [Lord Kanoth {4494876548792320}:123719000339321|(260.00,-144.00,-232.06,155.34)|(43901592/43909316)] [Serrated Shot {3394707791020032}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7723* ~7724 energy {836045448940874}) <5793.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"kanoth-mar03 original line 59778 reaches expected phase")
    ev := IPParseLine("[23:11:08.148] [Lord Kanoth {4494876548792320}:123719000339321|(248.05,-129.18,-232.09,-73.75)|(31468646/43909316)] [=] [Walled Garden {4498583105568768}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"kanoth-mar03 original line 65947 reaches expected phase")
    ev := IPParseLine("[23:13:03.148] [Lord Kanoth {4494876548792320}:123719000339321|(260.66,-124.51,-231.97,24.21)|(20590612/43909316)] [=] [Choking Growth {4602413939949568}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"kanoth-mar03 original line 73529 reaches expected phase")
    ev := IPParseLine("[23:15:02.412] [Lord Kanoth {4494876548792320}:123719000339321|(257.79,-124.63,-232.01,32.12)|(8558895/43909316)] [=] [Choking Growth {4602413939949568}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"kanoth-mar03 original line 80788 reaches expected phase")
    ev := IPParseLine("[23:15:29.510] [Lord Kanoth {4494876548792320}:123719000339321|(247.96,-117.93,-232.02,117.64)|(7464584/43909316)] [=] [Supreme Garden {4602469774524416}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"kanoth-mar03 original line 82017 reaches expected phase")
}


V72RecordedWitness12()
{
    seg := V72PhaseSegment("R4-KN"),day := 0,last := -1
    ev := IPParseLine("[22:34:13.327] [@Recorded Player#1|(260.58,-139.97,-232.09,8.22)|(470907/470907)] [Lord Kanoth {4494876548792320}:1924000343758|(260.00,-144.00,-232.06,138.22)|(43889720/43909316)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4693 ~4692 kinetic {836045448940873}) <14078.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"kanoth-jul08 original line 55388 reaches expected phase")
    ev := IPParseLine("[22:35:31.399] [Lord Kanoth {4494876548792320}:1924000343758|(254.49,-135.69,-231.98,-143.83)|(31561712/43909316)] [=] [Walled Garden {4498583105568768}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"kanoth-jul08 original line 60179 reaches expected phase")
    ev := IPParseLine("[22:37:25.352] [Lord Kanoth {4494876548792320}:1924000343758|(262.75,-123.86,-231.98,-46.91)|(20809132/43909316)] [=] [Choking Growth {4602413939949568}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"kanoth-jul08 original line 66966 reaches expected phase")
    ev := IPParseLine("[22:39:16.309] [Lord Kanoth {4494876548792320}:1924000343758|(247.71,-112.54,-231.97,203.09)|(7464584/43909316)] [=] [Supreme Garden {4602469774524416}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"kanoth-jul08 original line 73056 reaches expected phase")
}


V72RecordedWitness13()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[01:48:37.907] [Dread Master Brontes {3303529930293248}:62139000549034|(0.00,-838.07,16.27,-169.49)|(20254456/20254456)] [=] [ {3279765876244480}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"brontes-8m-v1 original line 78780 reaches expected phase")
}


V72RecordedWitness14()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[01:48:39.388] [@Recorded Player#1|(-15.21,-787.23,16.31,-94.88)|(481167/481167)] [Right Hand of Brontes {3275625527771136}:62139000585827|(-11.50,-787.00,16.11,-121.94)|(6249925/6260202)] [Aegis Assault {3438288824172544}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2991 energy {836045448940874}) <8972.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"brontes-8m-v1 original line 78814 reaches expected phase")
}


V72RecordedWitness15()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[01:50:13.154] [Dread Master Brontes {3303529930293248}:62139000549034|(0.00,-787.00,16.24,135.04)|(20254456/20254456)] [=] [Arcing Assault {3308920114249728}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 82946 reaches expected phase")
}


V72RecordedWitness16()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[01:50:14.253] [Dread Master Brontes {3303529930293248}:62139000549034|(0.00,-787.00,16.24,135.04)|(20254456/20254456)] [=] [Arcing Assault {3308868574642176}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 82978 reaches expected phase")
}


V72RecordedWitness17()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[01:50:29.666] [Dread Master Brontes {3303529930293248}:62139000549034|(0.00,-787.00,16.24,8.47)|(18231616/20254456)] [=] [Arcing Assault {3308920114249728}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 83911 reaches expected phase")
}


V72RecordedWitness18()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[01:50:30.760] [Dread Master Brontes {3303529930293248}:62139000549034|(0.00,-787.00,16.24,4.11)|(18040670/20254456)] [=] [Arcing Assault {3308868574642176}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 83979 reaches expected phase")
}


V72RecordedWitness19()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[01:51:59.878] [Dread Master Brontes {3303529930293248}:62139000549034|(-0.06,-787.00,16.24,-0.10)|(10126443/20254456)] [=] [Overcharge Beam {3300802626060288}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"brontes-8m-v1 original line 89049 reaches expected phase")
}


V72RecordedWitness20()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[01:52:48.289] [@Recorded Player#1|(-11.15,-803.60,16.11,-177.45)|(408639/434978)] [Hand of Brontes {3303276527222784}:62139000680319|(-20.00,-787.00,16.38,-68.53)|(2081394/6260877)] [Affliction {808192586022912}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3479 internal {836045448940876}) <3479.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"brontes-8m-v1 original line 91614 reaches expected phase")
}


V72RecordedWitness21()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[01:52:48.615] [@Recorded Player#1|(12.16,-787.08,16.24,-117.93)|(443752/443752)] [Hand of Brontes {3303276527222784}:62139000680437|(20.00,-787.00,16.38,-15.50)|(2081141/6260877)] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3731 kinetic {836045448940873}) <2798.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"brontes-8m-v1 original line 91634 reaches expected phase")
}


V72RecordedWitness22()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[01:54:21.465] [Dread Master Brontes {3303529930293248}:62139000549034|(-0.08,-787.11,16.24,34.95)|(11553397/20254456)] [=] [Supremacy {3309164927385600}] [ApplyEffect {836045448945477}: Supremacy {3309164927385600}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"brontes-8m-v1 original line 95962 reaches expected phase")
}


V72RecordedWitness23()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:38:23.884] [Dread Master Brontes {3303529930293248}:9064000582769|(0.00,-838.07,16.27,0.05)|(20254456/20254456)] [=] [ {3279765876244480}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"brontes-8m-v1 original line 1510 reaches expected phase")
}


V72RecordedWitness24()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:38:24.384] [@Recorded Player#1|(-1.78,-792.96,16.24,152.57)|(443634/443634)] [Right Hand of Brontes {3275625527771136}:9064000628087|(-11.50,-787.00,16.11,-90.00)|(6251076/6260202)] [Orbital Strike {2145301804613632}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9126 ~9127 elemental {836045448940875}) <6845.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"brontes-8m-v1 original line 1518 reaches expected phase")
}


V72RecordedWitness25()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:39:54.773] [Dread Master Brontes {3303529930293248}:9064000582769|(0.00,-787.00,16.24,121.57)|(20244578/20254456)] [=] [Arcing Assault {3308920114249728}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 6523 reaches expected phase")
}


V72RecordedWitness26()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:39:55.875] [Dread Master Brontes {3303529930293248}:9064000582769|(0.00,-787.00,16.24,-127.86)|(20215580/20254456)] [=] [Arcing Assault {3308868574642176}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 6578 reaches expected phase")
}


V72RecordedWitness27()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:40:11.188] [Dread Master Brontes {3303529930293248}:9064000582769|(0.00,-787.00,16.24,-1.85)|(18371046/20254456)] [=] [Arcing Assault {3308920114249728}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 7613 reaches expected phase")
}


V72RecordedWitness28()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:40:12.293] [Dread Master Brontes {3303529930293248}:9064000582769|(0.00,-787.00,16.24,-0.81)|(18181266/20254456)] [=] [Arcing Assault {3308868574642176}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 7715 reaches expected phase")
}


V72RecordedWitness29()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:41:15.617] [Dread Master Brontes {3303529930293248}:9064000582769|(-0.06,-787.00,16.24,0.14)|(10111287/20254456)] [=] [Overcharge Beam {3300802626060288}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"brontes-8m-v1 original line 12483 reaches expected phase")
}


V72RecordedWitness30()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:46:01.607] [Dread Master Brontes {3303529930293248}:9064000714360|(0.07,-786.99,16.24,1.25)|(10124428/20254456)] [=] [Overcharge Beam {3300802626060288}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"brontes-8m-v1 original line 25991 reaches expected phase")
}


V72RecordedWitness31()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:46:52.235] [@Recorded Player#1|(25.04,-785.64,16.38,102.35)|(492274/492274)] [Hand of Brontes {3303276527222784}:9064000821615|(20.00,-787.00,16.38,-81.32)|(2076250/6260877)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8622 energy {836045448940874}) <25866.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"brontes-8m-v1 original line 28979 reaches expected phase")
}


V72RecordedWitness32()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:46:52.684] [@Recorded Player#1|(-23.07,-787.25,16.38,-106.13)|(460173/460173)] [Hand of Brontes {3303276527222784}:9064000821497|(-20.00,-787.00,16.38,-90.00)|(2069660/6260877)] [Hammer Shot {801299163512832}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (779 energy {836045448940874}) <2337.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"brontes-8m-v1 original line 28992 reaches expected phase")
}


V72RecordedWitness33()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:48:12.074] [Dread Master Brontes {3303529930293248}:9064000714360|(0.05,-787.02,16.24,44.49)|(11667526/20254456)] [=] [Supremacy {3309164927385600}] [ApplyEffect {836045448945477}: Supremacy {3309164927385600}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"brontes-8m-v1 original line 33590 reaches expected phase")
}


V72RecordedWitness34()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[23:57:01.900] [Dread Master Brontes {3303529930293248}:9064000915886|(0.07,-787.02,16.24,44.17)|(11669887/20254456)] [=] [Supremacy {3309164927385600}] [ApplyEffect {836045448945477}: Supremacy {3309164927385600}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"brontes-8m-v1 original line 60841 reaches expected phase")
}


V72RecordedWitness35()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[00:12:06.971] [@Recorded Player#1|(-542.96,577.53,17.33,-160.99)|(443604/443604)] [Heirad {3013327580037120}:41123000169966|(-534.87,601.14,17.33,181.59)|(12293131/12377724)] [Electrified Railgun {2302776780521472}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1029 elemental {836045448940875}) <772.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"dread-guard-8m-v1 original line 38430 reaches expected phase")
}


V72RecordedWitness36()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[00:12:06.974] [@Recorded Player#1|(-542.96,577.53,17.33,-160.99)|(443604/443604)] [Heirad {3013327580037120}:41123000169966|(-534.87,601.14,17.33,181.59)|(12293131/12377724)] [Snipe {814892735004672}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (25552* energy {836045448940874}) <19164.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"dread-guard-8m-v1 original line 38435 reaches expected phase")
}


V72RecordedWitness37()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[00:14:01.456] [@Recorded Player#1|(-535.46,598.33,17.42,-121.93)|(353961/444510)] [Heirad {3013327580037120}:41123000169966|(-534.87,601.14,17.33,119.64)|(0/12377724)] [] [Event {836045448945472}: Death {836045448945493}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"dread-guard-8m-v1 original line 47206 reaches expected phase")
}


V72RecordedWitness38()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[00:16:21.260] [@Recorded Player#1|(-559.72,589.12,17.48,62.19)|(312551/443782)] [Ciphas {3013336169971712}:41123000169604|(-561.27,588.27,17.38,79.95)|(0/15753466)] [] [Event {836045448945472}: Death {836045448945493}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"dread-guard-8m-v1 original line 56203 reaches expected phase")
}


V72RecordedWitness39()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[00:22:21.162] [@Recorded Player#1|(-483.01,796.06,6.06,-90.30)|(443604/443604)] [Defragmenter {3014487221207040}:41123000011448|(-451.37,790.74,5.90,99.54)|(364645/370647)] [Interrogation Probe {879630777057280}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6002* energy {836045448940874}) <6002.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"operator-ix-8m-v1 original line 71334 reaches expected phase")
}


V72RecordedWitness40()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[00:22:21.823] [@Recorded Player#1|(-459.83,794.13,5.90,-85.30)|(503131/503131)] [Defragmenter {3014487221207040}:41123000011448|(-452.57,790.69,5.90,113.40)|(356259/370647)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8385 energy {836045448940874}) <25155.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"operator-ix-8m-v1 original line 71367 reaches expected phase")
}


V72RecordedWitness41()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[00:23:26.195] [Master Control {2994915055239168}:41123000011514|(-419.93,796.90,6.05,-64.80)|(22504952/22504952)] [=] [Orange Scalene {3036838231015424}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"operator-ix-8m-v1 original line 73799 reaches expected phase")
}


V72RecordedWitness42()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[00:24:05.109] [Master Control {2994915055239168}:41123000011514|(-419.93,796.90,6.05,-9.76)|(22504952/22504952)] [=] [Purple Scalene {3036842525982720}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"operator-ix-8m-v1 original line 75216 reaches expected phase")
}


V72RecordedWitness43()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[00:24:49.050] [Master Control {2994915055239168}:41123000011514|(-419.93,796.90,6.05,-99.93)|(22504952/22504952)] [=] [Yellow Scalene {3036846820950016}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"operator-ix-8m-v1 original line 77042 reaches expected phase")
}


V72RecordedWitness44()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[00:25:23.857] [@Recorded Player#1|(-417.66,791.12,6.05,164.77)|(373156/443604)] [Operator IX {2994837745827840}:41123000547947|(-419.90,797.21,6.05,167.53)|(22499524/22504952)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5427* ~5428 elemental {836045448940875}) <5427.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"operator-ix-8m-v1 original line 78528 reaches expected phase")
}


V72RecordedWitness45()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[00:25:24.686] [@Recorded Player#1|(-417.05,796.84,6.05,97.23)|(249808/443782)] [Operator IX {2994837745827840}:41123000547947|(-419.90,797.21,6.05,64.49)|(22468188/22504952)] [Veiled Strike {3403456639401984}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (17705 ~17704 kinetic {836045448940873}) <17705.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"operator-ix-8m-v1 original line 78563 reaches expected phase")
}


V72RecordedWitness46()
{
    seg := V72PhaseSegment("TFB-TF"),day := 0,last := -1
    ev := IPParseLine("[00:36:48.066] [@Recorded Player#1|(275.73,807.09,0.19,-61.47)|(443604/443604)] [Tunneling Tentacle {3025258999185408}:41123000751745|(290.51,778.35,0.30,-21.54)|(4380240/4384811)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4571* elemental {836045448940875}) <3428.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"terror-8m-v1 original line 103855 reaches expected phase")
}


V72RecordedWitness47()
{
    seg := V72PhaseSegment("TFB-TF"),day := 0,last := -1
    ev := IPParseLine("[00:36:48.716] [@Recorded Player#1|(268.97,813.32,0.16,-55.41)|(435260/435260)] [Tunneling Tentacle {3025271884087296}:41123000751835|(287.97,799.82,0.15,-127.14)|(4372579/4384811)] [Electro Net {3066456325488640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2438 energy {836045448940874}) <2438.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"terror-8m-v1 original line 103887 reaches expected phase")
}


V72RecordedWitness48()
{
    seg := V72PhaseSegment("TFB-TF"),day := 0,last := -1
    ev := IPParseLine("[00:40:50.712] [The Terror From Beyond {3025220344479744}:41123000746075|(333.89,787.31,0.87,90.00)|(21201308/42667136)] [=] [Pulled into the Beyond {3009973210578944}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"terror-8m-v1 original line 116337 reaches expected phase")
}


V72RecordedWitness49()
{
    seg := V72PhaseSegment("TFB-TF"),day := 0,last := -1
    ev := IPParseLine("[00:41:01.108] [@Recorded Player#1|(359.05,871.66,-74.70,0.00)|(410070/503131)] [The Terror From Beyond {3025233229381632}:41123000844451|(358.06,783.70,-195.87,-180.00)|(21330262/42667136)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3306* energy {836045448940874}) <9917.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"terror-8m-v1 original line 116498 reaches expected phase")
}


V72RecordedWitness50()
{
    seg := V72PhaseSegment("TFB-TF"),day := 0,last := -1
    ev := IPParseLine("[00:41:03.075] [@Recorded Player#1|(368.45,841.30,-192.49,-55.67)|(410070/503131)] [The Terror From Beyond {3025233229381632}:41123000844451|(358.06,783.70,-195.87,-180.00)|(21327788/42667136)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2473 ~2474 kinetic {836045448940873}) <11130.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"terror-8m-v1 original line 116523 reaches expected phase")
}


V72RecordedWitness51()
{
    seg := V72PhaseSegment("TFB-TF"),day := 0,last := -1
    ev := IPParseLine("[00:47:42.024] [The Terror From Beyond {3025233229381632}:41123000844451|(358.06,783.70,-195.87,-180.00)|(10878690/42667136)] [=] [ {3041227687591936}] [ApplyEffect {836045448945477}: Tantrum {3041227687592193}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"terror-8m-v1 original line 135313 reaches expected phase")
}


V72RecordedWitness52()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[21:53:17.463] [Dread Master Brontes {3303529930293248}:40760000002726|(0.00,-838.07,16.27,30.47)|(20254456/20254456)] [=] [ {3279765876244480}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"brontes-8m-v1 original line 7039 reaches expected phase")
}


V72RecordedWitness53()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[21:53:18.974] [@Recorded Player#1|(-16.32,-785.81,16.38,-73.31)|(476564/476564)] [Right Hand of Brontes {3275625527771136}:40760000054922|(-11.50,-787.00,17.61,-35.99)|(6236861/6260202)] [Shocked {3963919806759210}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (244 energy {836045448940874}) <2924.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"brontes-8m-v1 original line 7083 reaches expected phase")
}


V72RecordedWitness54()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[21:54:45.741] [Dread Master Brontes {3303529930293248}:40760000002726|(0.00,-787.00,16.24,85.62)|(20254456/20254456)] [=] [Arcing Assault {3308920114249728}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 12065 reaches expected phase")
}


V72RecordedWitness55()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[21:54:46.848] [Dread Master Brontes {3303529930293248}:40760000002726|(0.00,-787.00,16.24,85.62)|(20243326/20254456)] [=] [Arcing Assault {3308868574642176}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 12107 reaches expected phase")
}


V72RecordedWitness56()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[21:55:02.261] [Dread Master Brontes {3303529930293248}:40760000002726|(0.00,-787.00,16.24,-84.17)|(18260022/20254456)] [=] [Arcing Assault {3308920114249728}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 13030 reaches expected phase")
}


V72RecordedWitness57()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[21:55:03.260] [Dread Master Brontes {3303529930293248}:40760000002726|(0.00,-787.00,16.24,-94.19)|(18186120/20254456)] [=] [Arcing Assault {3308868574642176}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"brontes-8m-v1 original line 13083 reaches expected phase")
}


V72RecordedWitness58()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[21:56:14.289] [Dread Master Brontes {3303529930293248}:40760000002726|(0.02,-787.07,16.24,0.73)|(10096480/20254456)] [=] [Overcharge Beam {3300802626060288}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"brontes-8m-v1 original line 17852 reaches expected phase")
}


V72RecordedWitness59()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[21:57:13.254] [@Recorded Player#1|(-8.98,-790.06,16.24,114.63)|(391987/443604)] [Finger of Brontes {3303289412124672}:40760000149367|(-10.00,-787.00,16.14,-18.56)|(698710/709319)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2560 internal {836045448940876}) <2560.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"brontes-8m-v1 original line 21214 reaches expected phase")
}


V72RecordedWitness60()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[21:57:13.948] [@Recorded Player#1|(-8.07,-789.08,16.24,148.85)|(391987/443604)] [Finger of Brontes {3303289412124672}:40760000149367|(-10.00,-787.00,16.14,-76.88)|(672794/709319)] [Rupture {3455541707800576}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7567 energy {836045448940874}) <7567.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"brontes-8m-v1 original line 21239 reaches expected phase")
}


V72RecordedWitness61()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[22:02:14.868] [Dread Master Brontes {3303529930293248}:40760000160681|(0.07,-787.00,16.24,1.27)|(10110018/20254456)] [=] [Overcharge Beam {3300802626060288}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"brontes-8m-v1 original line 34014 reaches expected phase")
}


V72RecordedWitness62()
{
    seg := V72PhaseSegment("DF-BR"),day := 0,last := -1
    ev := IPParseLine("[22:04:26.851] [Dread Master Brontes {3303529930293248}:40760000160681|(0.05,-787.04,16.24,86.09)|(11676305/20254456)] [=] [Supremacy {3309164927385600}] [ApplyEffect {836045448945477}: Supremacy {3309164927385600}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"brontes-8m-v1 original line 41636 reaches expected phase")
}


V72RecordedWitness63()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[23:35:41.940] [@Recorded Player#1|(-528.09,573.39,17.33,170.15)|(440738/440738)] [Heirad {3013327580037120}:33481000195057|(-534.87,601.14,17.33,63.54)|(12358638/12377724)] [Death Field {808433104191488}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (19086 internal {836045448940876}) <19086.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"dread-guard-8m-v1 original line 38314 reaches expected phase")
}


V72RecordedWitness64()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[23:35:41.940] [@Recorded Player#1|(-528.09,573.39,17.33,170.15)|(440738/440738)] [Kel'sara {3013331875004416}:33481000194846|(-539.93,600.48,17.33,57.98)|(13470658/13502971)] [Death Field {808433104191488}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (19247 internal {836045448940876}) <19247.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"dread-guard-8m-v1 original line 38316 reaches expected phase")
}


V72RecordedWitness65()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[23:37:38.860] [@Recorded Player#1|(-535.88,583.27,17.33,-176.77)|(225426/443604)] [Heirad {3013327580037120}:33481000195057|(-534.87,601.14,17.33,-22.60)|(0/12377724)] [] [Event {836045448945472}: Death {836045448945493}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"dread-guard-8m-v1 original line 47755 reaches expected phase")
}


V72RecordedWitness66()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[23:39:45.926] [@Recorded Player#1|(-535.28,570.44,17.33,120.32)|(440738/440738)] [Ciphas {3013336169971712}:33481000194695|(-554.83,581.87,17.72,148.92)|(0/15753466)] [] [Event {836045448945472}: Death {836045448945493}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"dread-guard-8m-v1 original line 56674 reaches expected phase")
}


V72RecordedWitness67()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[23:46:11.159] [@Recorded Player#1|(-421.51,787.14,6.22,-80.76)|(422422/443752)] [Defragmenter {3014487221207040}:33481000008152|(-419.64,784.60,6.22,131.04)|(356285/370647)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14362* energy {836045448940874}) <14362.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"operator-ix-8m-v1 original line 70525 reaches expected phase")
}


V72RecordedWitness68()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[23:46:11.200] [Defragmenter {3014487221207040}:33481000008152|(-419.64,784.60,6.22,140.89)|(356285/370647)] [@Recorded Player#1|(-421.50,787.14,6.22,-80.76)|(422422/443752)] [Ranged Attack {813496870633472}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7302 energy {836045448940874}) <7302.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"operator-ix-8m-v1 original line 70528 reaches expected phase")
}


V72RecordedWitness69()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[23:47:20.917] [Master Control {2994915055239168}:33481000008218|(-419.93,796.90,6.05,-95.94)|(22504952/22504952)] [=] [Orange Scalene {3036838231015424}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"operator-ix-8m-v1 original line 73318 reaches expected phase")
}


V72RecordedWitness70()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[23:47:56.332] [Master Control {2994915055239168}:33481000008218|(-419.93,796.90,6.05,-114.02)|(22504952/22504952)] [=] [Purple Scalene {3036842525982720}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"operator-ix-8m-v1 original line 74676 reaches expected phase")
}


V72RecordedWitness71()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[23:48:48.942] [Master Control {2994915055239168}:33481000008218|(-419.93,796.90,6.05,-41.65)|(22504952/22504952)] [=] [Yellow Scalene {3036846820950016}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"operator-ix-8m-v1 original line 76776 reaches expected phase")
}


V72RecordedWitness72()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[23:49:30.471] [@Recorded Player#1|(-413.97,798.04,6.05,176.38)|(394703/435260)] [Operator IX {2994837745827840}:33481000577001|(-419.90,797.21,6.05,73.85)|(22489842/22504952)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6310* elemental {836045448940875}) <4732.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"operator-ix-8m-v1 original line 78626 reaches expected phase")
}


V72RecordedWitness73()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[23:49:30.525] [@Recorded Player#1|(-425.22,795.67,6.05,-106.18)|(261189/503131)] [Operator IX {2994837745827840}:33481000577001|(-419.90,797.21,6.05,73.85)|(22489842/22504952)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8800 energy {836045448940874}) <26399.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"operator-ix-8m-v1 original line 78630 reaches expected phase")
}


V72RecordedWitness74()
{
    seg := V72PhaseSegment("TFB-TF"),day := 0,last := -1
    ev := IPParseLine("[00:01:16.830] [@Recorded Player#1|(271.04,772.59,0.16,-106.30)|(443604/443604)] [Tunneling Tentacle {3025258999185408}:33481000796691|(290.51,778.35,0.30,44.95)|(4367778/4384811)] [Lightning Flash {3401218961440768}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (17033 energy {836045448940874}) <12774.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"terror-8m-v1 original line 112070 reaches expected phase")
}


V72RecordedWitness75()
{
    seg := V72PhaseSegment("TFB-TF"),day := 0,last := -1
    ev := IPParseLine("[00:01:17.183] [@Recorded Player#1|(269.46,812.23,0.16,-56.14)|(440738/440738)] [Tunneling Tentacle {3025271884087296}:33481000796781|(287.97,799.82,0.15,-133.05)|(4321020/4384811)] [Lightning Burns {3210655557484544}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2320 energy {836045448940874}) <2320.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"terror-8m-v1 original line 112085 reaches expected phase")
}


V72RecordedWitness76()
{
    seg := V72PhaseSegment("TFB-TF"),day := 0,last := -1
    ev := IPParseLine("[00:11:57.840] [@Recorded Player#1|(359.48,863.14,-170.25,-8.98)|(349533/507704)] [The Terror From Beyond {3025233229381632}:33481000981075|(358.06,783.70,-195.87,-180.00)|(21330500/42667136)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3068* energy {836045448940874}) <9204.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"terror-8m-v1 original line 137516 reaches expected phase")
}


V72RecordedWitness77()
{
    seg := V72PhaseSegment("TFB-TF"),day := 0,last := -1
    ev := IPParseLine("[00:11:58.173] [@Recorded Player#1|(359.05,871.86,-74.70,2.46)|(435260/435260)] [The Terror From Beyond {3025233229381632}:33481000981075|(358.06,783.70,-195.87,-180.00)|(21328806/42667136)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (344* energy {836045448940874}) <344.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"terror-8m-v1 original line 137525 reaches expected phase")
}


V72RecordedWitness78()
{
    seg := V72PhaseSegment("TFB-TF"),day := 0,last := -1
    ev := IPParseLine("[00:19:01.062] [The Terror From Beyond {3025233229381632}:33481000981075|(358.06,783.70,-195.87,-180.00)|(9875674/42667136)] [=] [ {3041227687591936}] [ApplyEffect {836045448945477}: Tantrum {3041227687592193}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"terror-8m-v1 original line 159120 reaches expected phase")
}


V72RecordedWitness79()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[19:36:36.494] [@Recorded Player#1|(-539.25,598.19,17.47,163.46)|(485057/485057)] [Kel'sara {3013331875004416}:43592000382247|(-539.93,600.48,17.33,-16.68)|(13498705/13502971)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4266 kinetic {836045448940873}) <12799.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"dread-guard-8m-v1 original line 470823 reaches expected phase")
}


V72RecordedWitness80()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[19:36:36.880] [Kel'sara {3013331875004416}:43592000382247|(-539.93,600.48,17.33,-16.64)|(13498705/13502971)] [=] [Pulverizing Darkness {3014504401076224}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"dread-guard-8m-v1 original line 470850 reaches expected phase")
}


V72RecordedWitness81()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[19:38:31.361] [@Recorded Player#1|(-537.15,599.01,17.33,-133.02)|(430865/450420)] [Heirad {3013327580037120}:43592000382458|(-534.87,601.14,17.33,17.26)|(0/12377724)] [] [Event {836045448945472}: Death {836045448945493}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"dread-guard-8m-v1 original line 478916 reaches expected phase")
}


V72RecordedWitness82()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[19:40:54.743] [@Recorded Player#1|(-551.03,567.32,17.51,168.40)|(182605/432706)] [Ciphas {3013336169971712}:43592000382096|(-551.49,569.37,17.50,-12.58)|(0/15753466)] [] [Event {836045448945472}: Death {836045448945493}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"dread-guard-8m-v1 original line 487205 reaches expected phase")
}


V72RecordedWitness83()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[19:51:49.575] [@Recorded Player#1|(-534.67,599.39,17.33,-177.91)|(442124/443604)] [Heirad {3013327580037120}:43592000618110|(-534.87,601.14,17.33,-7.62)|(0/12377724)] [] [Event {836045448945472}: Death {836045448945493}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"dread-guard-8m-v1 original line 512946 reaches expected phase")
}


V72RecordedWitness84()
{
    seg := V72PhaseSegment("TFB-DG"),day := 0,last := -1
    ev := IPParseLine("[20:16:15.150] [@Recorded Player#1|(-550.32,576.88,17.47,115.20)|(383631/443604)] [Ciphas {3013336169971712}:43592000921286|(-552.07,578.10,17.83,144.97)|(0/15753466)] [] [Event {836045448945472}: Death {836045448945493}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"dread-guard-8m-v1 original line 551023 reaches expected phase")
}


V72RecordedWitness85()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[20:31:55.011] [@Recorded Player#1|(-442.69,825.40,5.90,-125.62)|(485057/485057)] [Defragmenter {3014487221207040}:43592001112153|(-440.45,826.53,5.90,59.42)|(364079/370647)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6568* kinetic {836045448940873}) <19704.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"operator-ix-8m-v1 original line 567763 reaches expected phase")
}


V72RecordedWitness86()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[20:31:55.016] [Defragmenter {3014487221207040}:43592001112153|(-440.45,826.53,5.90,59.69)|(364079/370647)] [@Recorded Player#1|(-442.55,825.49,5.90,-125.62)|(485057/485057)] [Ranged Attack {813496870633472}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4649 energy {836045448940874}) <4649.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"operator-ix-8m-v1 original line 567764 reaches expected phase")
}


V72RecordedWitness87()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[20:33:16.432] [Master Control {2994915055239168}:43592001112285|(-419.93,796.90,6.05,-69.75)|(22504952/22504952)] [=] [Orange Scalene {3036838231015424}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"operator-ix-8m-v1 original line 570840 reaches expected phase")
}


V72RecordedWitness88()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[20:34:10.768] [Master Control {2994915055239168}:43592001112285|(-419.93,796.90,6.05,-126.34)|(22504952/22504952)] [=] [Purple Scalene {3036842525982720}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"operator-ix-8m-v1 original line 573035 reaches expected phase")
}


V72RecordedWitness89()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[20:34:48.387] [Master Control {2994915055239168}:43592001112285|(-419.93,796.90,6.05,88.45)|(22504952/22504952)] [=] [Yellow Scalene {3036846820950016}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"operator-ix-8m-v1 original line 574538 reaches expected phase")
}


V72RecordedWitness90()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[20:35:36.816] [@Recorded Player#1|(-413.67,795.48,6.05,170.65)|(124052/443604)] [Operator IX {2994837745827840}:43592001243630|(-419.90,797.21,6.05,-91.11)|(22480810/22504952)] [Smash {807801743998976}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13010 kinetic {836045448940873}) <13010.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"operator-ix-8m-v1 original line 576357 reaches expected phase")
}


V72RecordedWitness91()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[20:35:36.914] [@Recorded Player#1|(-411.46,797.25,6.22,79.58)|(193285/485057)] [Operator IX {2994837745827840}:43592001243630|(-419.90,797.21,6.05,-90.35)|(22477280/22504952)] [Deadly Onslaught {4085454496333824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3529 ~3530 elemental {836045448940875}) <10588.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"operator-ix-8m-v1 original line 576360 reaches expected phase")
}


V72RecordedWitness92()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[20:48:25.128] [Master Control {2994915055239168}:43592001314898|(-419.93,796.90,6.05,15.90)|(22504952/22504952)] [=] [Orange Scalene {3036838231015424}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"operator-ix-8m-v1 original line 590458 reaches expected phase")
}


V72RecordedWitness93()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[20:57:41.798] [Master Control {2994915055239168}:43592001367858|(-419.93,796.90,6.05,-153.51)|(22504952/22504952)] [=] [Purple Scalene {3036842525982720}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"operator-ix-8m-v1 original line 598263 reaches expected phase")
}


V72RecordedWitness94()
{
    seg := V72PhaseSegment("TFB-OP"),day := 0,last := -1
    ev := IPParseLine("[20:58:19.562] [Master Control {2994915055239168}:43592001367858|(-419.93,796.90,6.05,-109.02)|(22504952/22504952)] [=] [Yellow Scalene {3036846820950016}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"operator-ix-8m-v1 original line 599539 reaches expected phase")
}


V72RecordedWitness95()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[04:04:35.296] [@Recorded Player#1|(-34.51,456.83,59.87,-133.90)|(506585/506585)] [Imperial Siege Droid {2876515691790336}:4969000680837|(-12.32,458.17,59.87,40.32)|(2407431/2414810)] [Saber Throw {807788859097088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7379 energy {836045448940874}) <22137.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"kephess-ec-8m-v1 original line 692 reaches expected phase")
}


V72RecordedWitness96()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[04:04:35.792] [Imperial Siege Droid {2876515691790336}:4969000680917|(0.43,431.71,59.96,125.84)|(2407026/2414810)] [=] [Ranged Attack {2876992433160192}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"kephess-ec-8m-v1 original line 710 reaches expected phase")
}


V72RecordedWitness97()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[04:09:23.229] [@Recorded Player#1|(-3.66,450.57,59.87,-129.29)|(443752/443752)] [Warlord Kephess {2876528576692224}:4969000830825|(0.32,450.16,59.92,-5.66)|(15436167/15442899)] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6732* kinetic {836045448940873}) <6732.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"kephess-ec-8m-v1 original line 17139 reaches expected phase")
}


V72RecordedWitness98()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[04:09:23.880] [@Recorded Player#1|(-12.55,432.91,59.88,-139.48)|(443782/443782)] [Warlord Kephess {2876528576692224}:4969000830825|(0.32,450.16,59.92,-5.66)|(15383076/15442899)] [Demolish {3400617666019328}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12410 kinetic {836045448940873}) <12410.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"kephess-ec-8m-v1 original line 17166 reaches expected phase")
}


V72RecordedWitness99()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[04:11:28.731] [Warlord Kephess {2876528576692224}:4969000830825|(10.87,451.93,59.92,209.93)|(8916162/15442899)] [=] [Gift of the Masters {2877074037538816}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"kephess-ec-8m-v1 original line 23685 reaches expected phase")
}


V72RecordedWitness100()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[21:43:39.877] [@Recorded Player#1|(149.13,-133.02,-9.63,22.15)|(443277/443277)] [Dread Larva {3292079547482112}:7364000457641|(147.37,-139.44,-8.71,-135.00)|(387117/431234)] [Lethal Strike {3403731517308928}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18004 internal {836045448940876}) <18004.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"bestia-8m-v1 original line 8389 reaches expected phase")
}


V72RecordedWitness101()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[21:43:40.376] [@Recorded Player#1|(169.64,-109.10,-10.45,129.86)|(480335/480335)] [Dread Monster {3291675820556288}:7364000457542|(149.50,-97.68,-8.71,-60.56)|(2468770/2475545)] [Shocked {3960050041225514}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (384* energy {836045448940874}) <4609.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"bestia-8m-v1 original line 8402 reaches expected phase")
}


V72RecordedWitness102()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[21:45:25.865] [Dread Master Bestia {3273941900591104}:7364000386183|(169.86,-119.99,-8.72,90.00)|(19129210/19129210)] [=] [Gathering Force {3310668165939200}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"bestia-8m-v1 original line 15335 reaches expected phase")
}


V72RecordedWitness103()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[21:45:28.866] [@Recorded Player#1|(169.72,-118.87,-8.92,-96.12)|(480335/480335)] [Dread Master Bestia {3273941900591104}:7364000386183|(169.86,-119.99,-8.72,-176.42)|(19074148/19129210)] [Shocked {3960050041225514}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (253 ~252 energy {836045448940874}) <3031.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"bestia-8m-v1 original line 15482 reaches expected phase")
}


V72RecordedWitness104()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[21:45:28.866] [@Recorded Player#1|(169.72,-118.87,-8.92,-96.12)|(480335/480335)] [Dread Master Bestia {3273941900591104}:7364000386183|(169.86,-119.99,-8.72,-176.42)|(19074148/19129210)] [Ion Gas Cylinder {3960050041225216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1122 energy {836045448940874}) <3365.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"bestia-8m-v1 original line 15483 reaches expected phase")
}


V72RecordedWitness105()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[21:46:29.319] [Dread Master Bestia {3273941900591104}:7364000386183|(138.75,-120.86,-9.15,85.59)|(11245904/19129210)] [=] [Gathering Force {3310672460906496}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"bestia-8m-v1 original line 19568 reaches expected phase")
}


V72RecordedWitness106()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[21:51:29.509] [Dread Master Bestia {3273941900591104}:7364000559807|(137.22,-118.96,-8.87,96.66)|(11230558/19129210)] [=] [Gathering Force {3310672460906496}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"bestia-8m-v1 original line 35809 reaches expected phase")
}


V72RecordedWitness107()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[22:01:08.693] [@Recorded Player#1|(144.87,-216.28,-9.00,-90.65)|(441347/441347)] [Dread Master Calphayus {3273946195558400}:7364000826536|(169.59,-216.01,-5.90,90.00)|(16866336/16878712)] [Mind Crush {812796790964224}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8799 ~8800 kinetic {836045448940873}) <8799.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"calphayus-8m-v1 original line 62962 reaches expected phase")
}


V72RecordedWitness108()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[22:01:09.051] [@Recorded Player#1|(144.87,-216.28,-9.00,-90.65)|(441347/441347)] [Dread Master Calphayus {3273946195558400}:7364000826536|(169.59,-216.01,-5.90,90.00)|(16866336/16878712)] [Weaken Mind {812861215473664}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3577 ~3576 internal {836045448940876}) <3577.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"calphayus-8m-v1 original line 62972 reaches expected phase")
}


V72RecordedWitness109()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[22:01:29.702] [Dread Master Calphayus {3273946195558400}:7364000826536|(142.86,-219.81,-7.50,53.34)|(13469416/16878712)] [=] [ {3305041758781440}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"calphayus-8m-v1 original line 64107 reaches expected phase")
}


V72RecordedWitness110()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    IGPAdvance(seg,2,0,"Explicit prerequisite fixture")
    ev := IPParseLine("[22:03:35.775] [Dread Master Calphayus {3273946195558400}:7364000826536|(164.79,-216.28,-7.96,-99.16)|(13256614/16878712)] [=] [ {3300648007237632}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"calphayus-8m-v1 original line 71591 reaches expected phase")
}


V72RecordedWitness111()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[22:04:07.283] [Dread Master Calphayus {3273946195558400}:7364000826536|(142.16,-219.21,-8.19,36.25)|(8335930/16878712)] [=] [ {3301386741612544}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"calphayus-8m-v1 original line 73272 reaches expected phase")
}


V72RecordedWitness112()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    IGPAdvance(seg,4,0,"Explicit prerequisite fixture")
    ev := IPParseLine("[22:06:23.628] [Dread Master Calphayus {3273946195558400}:7364000826536|(164.79,-216.23,-7.96,-97.52)|(8103058/16878712)] [=] [ {3300648007237632}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"calphayus-8m-v1 original line 82109 reaches expected phase")
}


V72RecordedWitness113()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[22:06:56.549] [Dread Master Calphayus {3273946195558400}:7364000826536|(142.22,-218.98,-8.23,42.21)|(3212216/16878712)] [=] [ {3305046053748736}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=6,"calphayus-8m-v1 original line 83983 reaches expected phase")
}


V72RecordedWitness114()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[22:41:39.310] [@Recorded Player#1|(155.82,-135.99,-10.00,57.30)|(443634/443634)] [Dread Monster {3291675820556288}:19913000089381|(152.03,-138.70,-9.27,-132.03)|(2464424/2475545)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11122* energy {836045448940874}) <11122.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"bestia-8m-v1 original line 12134 reaches expected phase")
}


V72RecordedWitness115()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[22:41:39.749] [@Recorded Player#1|(174.32,-101.28,-10.47,-142.30)|(479380/479380)] [Dread Monster {3291675820556288}:19913000089781|(187.33,-108.22,-10.39,43.55)|(2471642/2475545)] [Slow Time {981503106351104}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3903* ~3904 kinetic {836045448940873}) <17565.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"bestia-8m-v1 original line 12166 reaches expected phase")
}


V72RecordedWitness116()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[22:43:28.204] [Dread Master Bestia {3273941900591104}:19913000008250|(170.38,-121.09,-8.12,3.37)|(19129210/19129210)] [=] [Gathering Force {3310668165939200}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"bestia-8m-v1 original line 19478 reaches expected phase")
}


V72RecordedWitness117()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[22:43:30.587] [@Recorded Player#1|(170.27,-127.37,-9.02,171.87)|(427064/443559)] [Dread Master Bestia {3273941900591104}:19913000008250|(170.34,-123.43,-8.70,-75.44)|(19095106/19129210)] [Blade Rush {1261711067709440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (25018* energy {836045448940874}) <25018.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"bestia-8m-v1 original line 19576 reaches expected phase")
}


V72RecordedWitness118()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[22:43:30.587] [@Recorded Player#1|(170.27,-127.37,-9.02,171.87)|(427064/443559)] [Dread Master Bestia {3273941900591104}:19913000008250|(170.34,-123.43,-8.70,-75.44)|(19095106/19129210)] [Blade Rush {1261711067709440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1719* ~1720 energy {836045448940874}) <1719.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"bestia-8m-v1 original line 19577 reaches expected phase")
}


V72RecordedWitness119()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[22:44:34.831] [Dread Master Bestia {3273941900591104}:19913000008250|(135.37,-120.90,-8.89,90.80)|(12853234/19129210)] [=] [Gathering Force {3310672460906496}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"bestia-8m-v1 original line 23632 reaches expected phase")
}


V72RecordedWitness120()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[22:59:31.053] [Dread Master Calphayus {3273946195558400}:19913000433287|(169.59,-216.01,-5.90,90.00)|(16869326/16878712)] [=] [Force Charge {3313326750695424}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"calphayus-8m-v1 original line 64122 reaches expected phase")
}


V72RecordedWitness121()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[22:59:31.056] [@Recorded Player#1|(146.01,-218.50,-8.87,-92.99)|(443559/443559)] [Dread Master Calphayus {3273946195558400}:19913000433287|(169.59,-216.01,-5.90,90.00)|(16869326/16878712)] [Twin Saber Throw {3066615239278592}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9026 energy {836045448940874}) <9026.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"calphayus-8m-v1 original line 64131 reaches expected phase")
}


V72RecordedWitness122()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[22:59:52.957] [Dread Master Calphayus {3273946195558400}:19913000433287|(142.32,-219.09,-8.18,46.60)|(13426711/16878712)] [=] [ {3305041758781440}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"calphayus-8m-v1 original line 65583 reaches expected phase")
}


V72RecordedWitness123()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    IGPAdvance(seg,2,0,"Explicit prerequisite fixture")
    ev := IPParseLine("[23:01:55.823] [Dread Master Calphayus {3273946195558400}:19913000433287|(166.26,-215.97,-8.06,-97.27)|(13201738/16878712)] [=] [ {3300648007237632}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"calphayus-8m-v1 original line 73264 reaches expected phase")
}


V72RecordedWitness124()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[23:02:30.523] [Dread Master Calphayus {3273946195558400}:19913000433287|(141.78,-217.88,-8.68,-75.14)|(8284334/16878712)] [=] [ {3301386741612544}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"calphayus-8m-v1 original line 75297 reaches expected phase")
}


V72RecordedWitness125()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    IGPAdvance(seg,4,0,"Explicit prerequisite fixture")
    ev := IPParseLine("[23:04:40.205] [Dread Master Calphayus {3273946195558400}:19913000433287|(166.26,-215.97,-8.06,-94.33)|(8099186/16878712)] [=] [ {3300648007237632}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"calphayus-8m-v1 original line 83530 reaches expected phase")
}


V72RecordedWitness126()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[23:05:13.787] [Dread Master Calphayus {3273946195558400}:19913000433287|(141.84,-219.06,-8.24,26.31)|(3222171/16878712)] [=] [ {3305046053748736}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=6,"calphayus-8m-v1 original line 85574 reaches expected phase")
}


V72RecordedWitness127()
{
    seg := V72PhaseSegment("EC-VO"),day := 0,last := -1
    ev := IPParseLine("[21:25:06.671] [@Recorded Player#1|(161.43,-39.29,-10.10,-124.75)|(441466/441466)] [Defected Imperial Trooper {2854177566883840}:40791000606607|(193.71,-14.56,-10.10,52.53)|(224344/226874)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2530 elemental {836045448940875}) <2530.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"vorgath-8m-v1 original line 88708 reaches expected phase")
}


V72RecordedWitness128()
{
    seg := V72PhaseSegment("EC-VO"),day := 0,last := -1
    ev := IPParseLine("[21:25:07.675] [@Recorded Player#1|(161.43,-39.29,-10.10,-124.16)|(441466/441466)] [Defected Imperial Trooper {2854177566883840}:40791000606652|(191.98,-18.30,-10.10,55.21)|(224344/226874)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2530 elemental {836045448940875}) <2530.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"vorgath-8m-v1 original line 88720 reaches expected phase")
}


V72RecordedWitness129()
{
    seg := V72PhaseSegment("EC-VO"),day := 0,last := -1
    ev := IPParseLine("[21:28:33.879] [@Recorded Player#1|(292.12,-29.03,-1.28,-98.64)|(332745/458540)] [Colonel Vorgath {2854117437341696}:40791000010072|(294.30,-28.70,-1.18,81.54)|(17940532/17947996)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4397 ~4396 kinetic {836045448940873}) <13191.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"vorgath-8m-v1 original line 99807 reaches expected phase")
}


V72RecordedWitness130()
{
    seg := V72PhaseSegment("EC-VO"),day := 0,last := -1
    ev := IPParseLine("[21:28:33.882] [@Recorded Player#1|(283.98,-31.24,-2.09,-91.44)|(441466/441466)] [Colonel Vorgath {2854117437341696}:40791000010072|(294.30,-28.70,-1.18,81.54)|(17940532/17947996)] [Interrogation Probe {879630777057280}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3068 energy {836045448940874}) <3068.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"vorgath-8m-v1 original line 99808 reaches expected phase")
}


V72RecordedWitness131()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[21:33:54.719] [Imperial Siege Droid {2876515691790336}:40791000733952|(0.43,431.71,59.96,69.35)|(2407067/2414810)] [=] [Ranged Attack {2876992433160192}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"kephess-ec-8m-v1 original line 110179 reaches expected phase")
}


V72RecordedWitness132()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[21:33:54.739] [@Recorded Player#1|(-28.29,448.22,59.87,-88.96)|(476564/476564)] [Imperial Siege Droid {2876515691790336}:40791000733872|(-12.32,458.17,59.87,-2.03)|(2402531/2414810)] [Saber Throw {807788859097088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12279* energy {836045448940874}) <36836.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"kephess-ec-8m-v1 original line 110180 reaches expected phase")
}


V72RecordedWitness133()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[21:38:34.829] [@Recorded Player#1|(5.36,448.74,59.92,111.60)|(458540/458540)] [Warlord Kephess {2876528576692224}:40791000863375|(0.32,450.16,59.92,-5.66)|(15437399/15442899)] [Deadly Onslaught {4085454496333824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3163 elemental {836045448940875}) <9488.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"kephess-ec-8m-v1 original line 126391 reaches expected phase")
}


V72RecordedWitness134()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[21:38:34.829] [@Recorded Player#1|(-5.15,440.85,59.87,211.81)|(441466/441466)] [Warlord Kephess {2876528576692224}:40791000863375|(0.32,450.16,59.92,-5.66)|(15437399/15442899)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2337 elemental {836045448940875}) <2337.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"kephess-ec-8m-v1 original line 126393 reaches expected phase")
}


V72RecordedWitness135()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[21:40:34.202] [Warlord Kephess {2876528576692224}:40791000863375|(14.94,447.26,59.92,-165.98)|(9032914/15442899)] [=] [Gift of the Masters {2877074037538816}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"kephess-ec-8m-v1 original line 132927 reaches expected phase")
}


V72RecordedWitness136()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[15:48:10.767] [@Recorded Player#1|(182.39,-137.45,-10.39,-45.28)|(453200/453200)] [Dread Monster {3291675820556288}:46420000081172|(191.42,-143.51,-8.59,125.66)|(2452953/2475545)] [Eradicate {4035839034130432}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10171 kinetic {836045448940873}) <10171.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"bestia-8m-v1 original line 4224 reaches expected phase")
}


V72RecordedWitness137()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[15:48:11.417] [@Recorded Player#1|(187.17,-142.03,-8.71,-70.80)|(443752/443752)] [Dread Monster {3291675820556288}:46420000081172|(191.42,-143.51,-8.59,111.75)|(2446215/2475545)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12422* energy {836045448940874}) <12422.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"bestia-8m-v1 original line 4237 reaches expected phase")
}


V72RecordedWitness138()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[15:49:57.311] [@Recorded Player#1|(162.38,-115.97,-10.53,-66.63)|(437663/442951)] [Dread Master Bestia {3273941900591104}:46420000006659|(167.34,-119.85,-9.75,106.84)|(19063218/19129210)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4444* elemental {836045448940875}) <4444.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"bestia-8m-v1 original line 11090 reaches expected phase")
}


V72RecordedWitness139()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[15:49:57.312] [@Recorded Player#1|(162.38,-115.97,-10.53,-66.63)|(437663/442951)] [Dread Master Bestia {3273941900591104}:46420000006659|(167.34,-119.85,-9.75,106.84)|(19063218/19129210)] [Mag Shot {3394733560823808}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1479* ~1480 energy {836045448940874}) <1479.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"bestia-8m-v1 original line 11092 reaches expected phase")
}


V72RecordedWitness140()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[15:50:55.441] [Dread Master Bestia {3273941900591104}:46420000006659|(140.20,-121.94,-9.39,-161.08)|(11399634/19129210)] [=] [Gathering Force {3310672460906496}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"bestia-8m-v1 original line 14951 reaches expected phase")
}


V72RecordedWitness141()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[15:55:11.096] [Dread Master Bestia {3273941900591104}:46420000195103|(169.86,-119.99,-8.72,90.00)|(19129210/19129210)] [=] [Gathering Force {3310668165939200}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"bestia-8m-v1 original line 27032 reaches expected phase")
}


V72RecordedWitness142()
{
    seg := V72PhaseSegment("DP-BE"),day := 0,last := -1
    ev := IPParseLine("[15:56:11.915] [Dread Master Bestia {3273941900591104}:46420000195103|(147.12,-121.57,-10.42,90.90)|(11234724/19129210)] [=] [Gathering Force {3310672460906496}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"bestia-8m-v1 original line 30898 reaches expected phase")
}


V72RecordedWitness143()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[16:05:23.931] [@Recorded Player#1|(144.91,-218.29,-8.97,-85.98)|(453200/453200)] [Dread Master Calphayus {3273946195558400}:46420000436639|(161.15,-209.35,-7.58,128.50)|(16869774/16878712)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8937* ~8938 internal {836045448940876}) <6703.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"calphayus-8m-v1 original line 55764 reaches expected phase")
}


V72RecordedWitness144()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[16:05:24.163] [Dread Master Calphayus {3273946195558400}:46420000436639|(158.12,-206.97,-8.14,128.50)|(16869774/16878712)] [@Recorded Player#1|(157.03,-206.84,-8.22,45.07)|(265412/443782)] [Force Charge {3313326750695424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (188964 energy {836045448940874}) <188964.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"calphayus-8m-v1 original line 55766 reaches expected phase")
}


V72RecordedWitness145()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[16:07:27.467] [Dread Master Calphayus {3273946195558400}:46420000461144|(143.18,-218.52,-8.57,39.27)|(13389591/16878712)] [=] [ {3305041758781440}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"calphayus-8m-v1 original line 57903 reaches expected phase")
}


V72RecordedWitness146()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    IGPAdvance(seg,2,0,"Explicit prerequisite fixture")
    ev := IPParseLine("[16:09:29.607] [Dread Master Calphayus {3273946195558400}:46420000461144|(164.78,-216.19,-7.96,-96.17)|(13240497/16878712)] [=] [ {3300648007237632}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"calphayus-8m-v1 original line 65142 reaches expected phase")
}


V72RecordedWitness147()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[16:10:02.639] [Dread Master Calphayus {3273946195558400}:46420000461144|(144.80,-219.60,-8.00,73.74)|(8302540/16878712)] [=] [ {3301386741612544}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"calphayus-8m-v1 original line 66957 reaches expected phase")
}


V72RecordedWitness148()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[16:12:08.574] [Dread Master Calphayus {3273946195558400}:46420000556878|(144.37,-219.63,-7.91,-118.18)|(13244749/16878712)] [=] [ {3305041758781440}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"calphayus-8m-v1 original line 72214 reaches expected phase")
}


V72RecordedWitness149()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    IGPAdvance(seg,2,0,"Explicit prerequisite fixture")
    ev := IPParseLine("[16:14:15.886] [Dread Master Calphayus {3273946195558400}:46420000556878|(164.84,-216.27,-7.96,-88.08)|(13099086/16878712)] [=] [ {3300648007237632}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"calphayus-8m-v1 original line 79153 reaches expected phase")
}


V72RecordedWitness150()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[16:14:48.037] [Dread Master Calphayus {3273946195558400}:46420000556878|(145.01,-219.00,-8.44,-115.43)|(8286869/16878712)] [=] [ {3301386741612544}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"calphayus-8m-v1 original line 80876 reaches expected phase")
}


V72RecordedWitness151()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    IGPAdvance(seg,4,0,"Explicit prerequisite fixture")
    ev := IPParseLine("[16:17:09.421] [Dread Master Calphayus {3273946195558400}:46420000556878|(166.26,-215.97,-8.06,90.00)|(8153815/16878712)] [=] [ {3300648007237632}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=5,"calphayus-8m-v1 original line 89755 reaches expected phase")
}


V72RecordedWitness152()
{
    seg := V72PhaseSegment("DP-CA"),day := 0,last := -1
    ev := IPParseLine("[16:17:41.842] [Dread Master Calphayus {3273946195558400}:46420000556878|(143.62,-218.63,-8.68,37.41)|(3298112/16878712)] [=] [ {3305046053748736}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=6,"calphayus-8m-v1 original line 91684 reaches expected phase")
}


V72RecordedWitness153()
{
    seg := V72PhaseSegment("EC-VO"),day := 0,last := -1
    ev := IPParseLine("[15:06:02.787] [@Recorded Player#1|(159.51,-39.97,-10.10,-156.36)|(470180/470180)] [Defected Imperial Trooper {2854177566883840}:27645000483133|(166.88,-22.18,-10.10,30.16)|(211576/226874)] [Saber Throw {807788859097427}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15297* energy {836045448940874}) <45891.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"vorgath-8m-v1 original line 65979 reaches expected phase")
}


V72RecordedWitness154()
{
    seg := V72PhaseSegment("EC-VO"),day := 0,last := -1
    ev := IPParseLine("[15:06:04.189] [@Recorded Player#1|(160.35,-29.65,-10.08,-125.33)|(439432/439432)] [Defected Imperial Trooper {2854177566883840}:27645000483178|(163.75,-29.67,-10.10,36.47)|(202824/226874)] [Bleeding (Retractable Blade) {2029831608860928}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6023* ~6024 internal {836045448940876}) <6023.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"vorgath-8m-v1 original line 65998 reaches expected phase")
}


V72RecordedWitness155()
{
    seg := V72PhaseSegment("EC-VO"),day := 0,last := -1
    ev := IPParseLine("[15:09:41.279] [@Recorded Player#1|(257.49,-28.20,-10.14,-89.96)|(441793/441793)] [Colonel Vorgath {2854117437341696}:27645000010191|(287.83,-26.47,-1.65,95.72)|(17937696/17947996)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2992 internal {836045448940876}) <2992.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"vorgath-8m-v1 original line 76650 reaches expected phase")
}


V72RecordedWitness156()
{
    seg := V72PhaseSegment("EC-VO"),day := 0,last := -1
    ev := IPParseLine("[15:09:42.082] [@Recorded Player#1|(285.44,-26.64,-1.75,-94.94)|(470180/470180)] [Colonel Vorgath {2854117437341696}:27645000010191|(287.83,-26.47,-1.65,95.45)|(17924894/17947996)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5052 energy {836045448940874}) <15155.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"vorgath-8m-v1 original line 76667 reaches expected phase")
}


V72RecordedWitness157()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[15:15:34.086] [@Recorded Player#1|(-3.12,427.70,59.89,-138.67)|(444663/444663)] [Imperial Siege Droid {2876515691790336}:27645000616085|(0.43,431.71,59.96,402.78)|(2390697/2414810)] [Eradicate {4035839034130432}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (17479* ~17480 kinetic {836045448940873}) <17479.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"kephess-ec-8m-v1 original line 87490 reaches expected phase")
}


V72RecordedWitness158()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[15:15:34.185] [@Recorded Player#1|(-27.63,424.64,61.62,-99.79)|(441793/441793)] [Imperial Siege Droid {2876515691790336}:27645000616085|(0.43,431.71,59.96,401.81)|(2362600/2414810)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2707 internal {836045448940876}) <2030.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"kephess-ec-8m-v1 original line 87498 reaches expected phase")
}


V72RecordedWitness159()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[15:20:14.298] [@Recorded Player#1|(2.17,444.14,59.92,160.48)|(439432/439432)] [Warlord Kephess {2876528576692224}:27645000745152|(0.31,450.24,59.92,-5.66)|(15430563/15442899)] [Bleeding (Retractable Blade) {2029831608860928}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3615 internal {836045448940876}) <3615.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"kephess-ec-8m-v1 original line 102820 reaches expected phase")
}


V72RecordedWitness160()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[15:20:14.394] [@Recorded Player#1|(0.23,447.21,59.92,-147.20)|(441793/441793)] [Warlord Kephess {2876528576692224}:27645000745152|(0.31,450.24,59.92,-5.66)|(15407339/15442899)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5507* internal {836045448940876}) <5507.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"kephess-ec-8m-v1 original line 102836 reaches expected phase")
}


V72RecordedWitness161()
{
    seg := V72PhaseSegment("EC-KE"),day := 0,last := -1
    ev := IPParseLine("[15:22:26.675] [Warlord Kephess {2876528576692224}:27645000745152|(0.77,433.11,59.96,50.69)|(8961717/15442899)] [=] [Gift of the Masters {2877074037538816}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=3,"kephess-ec-8m-v1 original line 109472 reaches expected phase")
}


V72RecordedWitness162()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[15:13:47.889] [@Recorded Player#1|(466.18,1060.63,273.23,145.20)|(441614/441614)] [Revan {3431605855059968}:7472001032437|(455.50,1076.00,273.23,-34.90)|(26554556/26578348)] [Halted Offensive  {4484383943688192}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23792 energy {836045448940874}) <23792.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"revan-8v-v1 original line 71250 reaches expected phase")
}


V72RecordedWitness163()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[15:13:48.451] [Revan {3431605855059968}:7472001032437|(455.50,1076.00,273.23,-35.09)|(26544374/26578348)] [=] [Discard {3453359864414208}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"revan-8v-v1 original line 71264 reaches expected phase")
}


V72RecordedWitness164()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[15:14:57.710] [@Recorded Player#1|(447.82,1072.53,273.24,9.76)|(442258/443426)] [HK-47 {3444310368321536}:7472001032640|(447.28,1067.02,273.24,-150.95)|(8069236/8101783)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4579 ~4580 elemental {836045448940875}) <4579.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"revan-8v-v1 original line 75259 reaches expected phase")
}


V72RecordedWitness165()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[15:14:57.710] [@Recorded Player#1|(447.82,1072.53,273.24,9.76)|(442258/443426)] [HK-47 {3444310368321536}:7472001032640|(447.28,1067.02,273.24,-150.95)|(8069236/8101783)] [Flaming Fist {3384704812187648}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11710* elemental {836045448940875}) <11710.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"revan-8v-v1 original line 75260 reaches expected phase")
}


V72RecordedWitness166()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[15:16:53.091] [Revan {3431605855059968}:7472001032437|(479.37,1077.00,296.57,-183.43)|(17016044/26578348)] [=] [Bloodfury {3478850495315968}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"revan-8v-v2 original line 80724 reaches expected phase")
}


V72RecordedWitness167()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[15:19:08.855] [@Recorded Player#1|(484.18,1072.38,320.32,117.62)|(350806/432870)] [Machine Core {3447583133401088}:7472001032236|(469.00,1076.10,317.61,-270.00)|(12102376/12152673)] [Lightning Barrier {3968412342550528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18097* energy {836045448940874}) <18097.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=7,"revan-8v-v2 original line 86759 reaches expected phase")
}


V72RecordedWitness168()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[15:19:09.297] [@Recorded Player#1|(483.92,1071.84,320.33,96.73)|(390301/434965)] [Machine Core {3447583133401088}:7472001032236|(469.00,1076.10,317.61,-270.00)|(12102376/12152673)] [Shatter {1169953386397696}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (21646* internal {836045448940876}) <21646.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=7,"revan-8v-v2 original line 86788 reaches expected phase")
}


V72RecordedWitness169()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[20:36:56.256] [@Recorded Player#1|(451.83,1075.99,273.23,-90.19)|(496979/496979)] [Revan {3431605855059968}:69292001496233|(455.50,1076.00,273.23,-90.00)|(26554298/26578348)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7560* energy {836045448940874}) <22680.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"revan-8v-v1 original line 7463 reaches expected phase")
}


V72RecordedWitness170()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[20:36:56.320] [Revan {3431605855059968}:69292001496233|(455.50,1076.00,273.23,-90.00)|(26554298/26578348)] [=] [Discard {3453359864414208}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=1,"revan-8v-v1 original line 7464 reaches expected phase")
}


V72RecordedWitness171()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[20:40:45.024] [@Recorded Player#1|(450.84,1060.77,273.26,141.25)|(388936/435260)] [HK-47 {3444310368321536}:69292001579796|(447.28,1066.99,273.24,16.52)|(8087116/8101783)] [Mandalorian Armaments {4574075745730560}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14666* ~14667 kinetic {836045448940873}) <14666.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"revan-8v-v1 original line 14906 reaches expected phase")
}


V72RecordedWitness172()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[20:40:45.421] [@Recorded Player#1|(449.44,1062.52,273.27,141.25)|(384836/435260)] [HK-47 {3444310368321536}:69292001579796|(447.28,1066.99,273.24,25.59)|(8074022/8101783)] [Bleeding (Retractable Blade) {2029831608860928}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3800 ~3801 internal {836045448940876}) <3800.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=2,"revan-8v-v1 original line 14915 reaches expected phase")
}


V72RecordedWitness173()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[20:42:42.967] [Revan {3431605855059968}:69292001579593|(483.52,1075.31,296.41,155.96)|(16931000/26578348)] [=] [Bloodfury {3478850495315968}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"revan-8v-v2 original line 20058 reaches expected phase")
}


V72RecordedWitness174()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[20:45:16.291] [@Recorded Player#1|(482.45,1077.52,320.46,70.31)|(178326/418022)] [Machine Core {3447583133401088}:69292001579392|(469.00,1076.10,317.61,-270.00)|(12143283/12152673)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2529 internal {836045448940876}) <2529.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=7,"revan-8v-v2 original line 26234 reaches expected phase")
}


V72RecordedWitness175()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[20:45:16.687] [@Recorded Player#1|(482.88,1077.05,320.44,86.10)|(40920/477297)] [Machine Core {3447583133401088}:69292001579392|(469.00,1076.10,317.61,-270.00)|(12129890/12152673)] [Force Scream {998270658674688}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13393 kinetic {836045448940873}) <40179.0>")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=7,"revan-8v-v2 original line 26238 reaches expected phase")
}


V72RecordedWitness176()
{
    seg := V72PhaseSegment("TOS-RE"),day := 0,last := -1
    ev := IPParseLine("[20:54:39.302] [Revan {3431605855059968}:69292001761987|(481.94,1076.26,296.43,9.51)|(16901100/26578348)] [=] [Bloodfury {3478850495315968}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
    V48Assert(IsObject(ev),"original recorded marker parses natively")
    if last>=0 && ev.RawMs<last-43200000
        day += 86400000
    last := ev.RawMs,at := day+ev.RawMs,IGPObserve(seg,ev,at)
    V48Assert(seg.PhaseProgress.Get("Stage",0)=4,"revan-8v-v2 original line 43204 reaches expected phase")
}


; Isolated compact-history and accepted-event view checks. No user log access.
V72PVEntry(stage := 1,id := 1,partial := false)
{
    e := V71PCEntry(stage,id,"G-IZ",partial),e.Pull.Name := "Izax"
    return e
}

V72PVEligibility()
{
    d := IGPYViewProfile("G-IZ|833571547775765|836045448953655")
    V48Assert(IsObject(d) && d.Name="Izax" && d.Phases.Length=7,"verified Parsely Izax catalogue has seven named phases")
    for group in ["G-IZ|833571547775765|wrong","G-IZ|wrong|836045448953655","wrong|833571547775765|836045448953655"]
        V48Assert(!IsObject(IGPYViewProfile(group)),"unknown exact encounter scope cannot inherit Izax phases")
    p := {Kind:"Recorded",Phases:["First","Second"]}
    V48Assert(!IAPhaseProfileSupported(p),"an arbitrary multiphase array alone does not certify linear progression")
    p.LinearPhases := false
    V48Assert(!IAPhaseProfileSupported(p),"repeated or optional phases remain outside ordinal phase views")
    p.LinearPhases := true
    V48Assert(IAPhaseProfileSupported(p),"explicitly reviewed ordered profiles opt into both views")
    p.Phases := ["Only"]
    V48Assert(!IAPhaseProfileSupported(p),"single HP observations do not masquerade as phase consistency")
    p.Phases := []
    Loop 13
        p.Phases.Push("Phase " A_Index)
    V48Assert(!IAPhaseProfileSupported(p),"phase views stay within the persisted phase-array limit")
}

V72PVConsistency()
{
    a := V72PVEntry(2,1),b := V72PVEntry(4,2,true),c := V72PVEntry(6,3)
    missing := V72PVEntry(0,4),missing.Pull.Progress.Kill := true
    old := V72PVEntry(6,5),old.Pull.Progress.Profile := "hp-only-v1",old.Pull.Progress.Phases := ["HP only"],old.Pull.Progress.Stage := 1,old.Pull.Progress.DeleteProp("Parsely")
    conflict := V72PVEntry(6,6),conflict.Conflict := "recorders disagree"
    entries := [a,b,c,missing,old,conflict],before := V71PCSignature(entries),m := IGPCBuild(entries,a.Pull.Group)
    V48Assert(m.Rows.Length=6 && m.Counters.Known=3 && m.Counters.Unknown=3,"six observed phases retain old missing and conflicting observations as unknown")
    V48Assert(m.Rows[2].Reached=3 && m.Rows[2].Unknown=3,"explicit earlier phase observations remain usable even without HP")
    V48Assert(m.Rows[5].Reached=1 && m.Rows[5].Earlier=1 && m.Rows[5].Unknown=4,"partial earlier progress never becomes a failed later phase")
    V48Assert(m.Rows[6].Text="1 / 6","only the actually recorded final phase contributes to its numerator")
    V71PCCheckSums(m)
    V48Assert(V71PCSignature(entries)=before,"consistency leaves compact history and original phase labels untouched")
    c.Pull.Players["@Present#1"].First := c.Pull.Start,c.Pull.Players["@Present#1"].Deaths := 1
    V48Assert(IGPCBuild([c],c.Pull.Group).Rows[6].Reached=1,"early character death does not erase later team phase evidence")
    c.Pull.Progress.Parsely.Key := "Changed interpretation"
    V48Assert(IGPCBuild([c],c.Pull.Group).Rows[6].Unknown=1,"same key and length with changed labels remains incompatible")
    a.Pull.Progress.Parsely.Order[2].Ordinal := 2.5
    V48Assert(IGPCBuild([a],a.Pull.Group).Counters.Unknown=1,"fractional serialized stage is not accepted as observed phase evidence")
}

V72PVHistoryCompatibility()
{
    e := V72PVEntry(6),e.Pull.Progress.Hp := 20,e.Pull.Progress.Comparable := true
    e.Pull.Progress.Health := IGVDemoHealth(e.Pull,20,["4108097563918336"])
    packed := IGVPackPull(e.Pull),copy := IGVUnpackPull(IGJParse(IGVJson(packed)))
    V48Assert(copy.Progress.Phases.Length=6 && copy.Progress.Stage=6,"new phase history round trips through the existing compact JSON schema")
    V48Assert(IGVJson(IGVPackPull(copy))=IGVJson(packed),"compact round trip preserves all exact phase labels and evidence")
    old := IPRCloneSnapshot(e),old.Key := "old",old.Pull.Id := 2
    old.Pull.Progress.Profile := "hp-only-v1",old.Pull.Progress.Phases := ["HP only"],old.Pull.Progress.Stage := 1
    old.Pull.Progress.DeleteProp("Parsely")
    old.Pull.Progress.DeleteProp("Health")
    old.Pull.Progress.Hp := 1,old.Pull.Progress.Kill := true
    restored := IGVUnpackPull(IGJParse(IGVJson(IGVPackPull(old.Pull))))
    V48Assert(restored.Progress.Profile="hp-only-v1" && restored.Progress.Kill,"older history stays readable without invented phase migration")
    for rows in [[old,e],[e,old]] {
        model := IGVPlotModel(rows,1000,340,1,e.Pull.Group)
        V48Assert(model.Profile="hp-only-v1" && model.Axis.Percent && model.Axis.Kind="hp","mixed old/new history shares the actual boss-health axis")
        oldIndex := rows[1].Key="old" ? 1 : 2,newIndex := 3-oldIndex
        V48Assert(model.Unknown=0 && model.MappingMismatch=0 && model.Points[oldIndex].Kill,"old confirmed kill remains a plotted outcome in either order")
        V48Assert(IGVEntryScore(old,model,oldIndex)>IGVEntryScore(e,model,newIndex) && Abs(model.Points[newIndex].Score-0.792)<0.000001,"confirmed kill wins over the observed20percent wipe on the shared HP scale")
    }
    phase := IGPCBuild([old,e],e.Pull.Group)
    V48Assert(phase.Counters.Kills=1 && phase.Counters.Unknown=1,"confirmed old kill does not invent missing phase evidence")
    wrong := IPRCloneSnapshot(e),wrong.Pull.Progress.Parsely.Key := "Different phase catalogue"
    V48Assert(IGPCBuild([wrong,e],e.Pull.Group).Counters.Unknown=1,"phase summary rejects an incompatible phase catalogue")
    V48Assert(IGVPlotModel([wrong,e],1000,340,1,e.Pull.Group).Unknown=0,"invalid phase labels cannot erase independently valid boss health")
    view := {Boss:e.Pull.Group,Team:"A",Window:"all",Cycle:"",Character:"",Source:"history",DemoHistory:true}
    ; Keep sources at distinct times, so this is compatibility rather than a
    ; conflicting alternate-recorder fixture.
    old.Pull.Start += 20000,old.Pull.End += 20000
    image := ISRIBuild([e,old],view)
    V48Assert(image.Phase.Rows.Length=6 && image.BestIndex=2 && image.Best="Confirmed kill" && image.Unknown=0,"PNG summary retains six observed phases and the independent confirmed old kill")
    V48Assert(image.Layout.PhaseH>0 && image.Layout.RunY>image.Layout.PhaseY+image.Layout.PhaseH,"all observed phase rows fit the actual export layout without overlap")
}

V72PVLines()
{
    ; Event shapes from the 2026-08-11 8-player Master recording, lines266098,
    ; 269229,276108,286559,295554,306892. Names/actor-instance and times are
    ; normalized. Exact NPC, action, effect and ability IDs remain unchanged.
    return [
        "[00:00:01.000] [@Review#66|(0,0,0,0)|(480157/480157)] [IZAX {4108097563918336}:72|(0,0,0,0)|(254695568/254712048)] [Shocked {3960050041225514}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (232 ~240 energy {836045448940874}) <2790.0>",
        "[00:00:02.000] [IZAX {4108097563918336}:72|(0,0,0,0)|(246022048/254712048)] [=] [Deflector Pulse {4161075985514496}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
        "[00:00:03.000] [IZAX {4108097563918336}:72|(0,0,0,0)|(202539184/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",
        "[00:00:04.000] [IZAX {4108097563918336}:72|(0,0,0,0)|(152791376/254712048)] [=] [Missile Launcher Damage {4173226447994880}] [ApplyEffect {836045448945477}: Missile Launcher Damage {4173226447994880}]",
        "[00:00:05.000] [IZAX {4108097563918336}:72|(0,0,0,0)|(86547032/254712048)] [=] [ {4163854829355008}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
        "[00:00:06.000] [IZAX {4108097563918336}:72|(0,0,0,0)|(5268300/254712048)] [=] [Emergency Override: Fire Omnicannon {4168751092072448}] [Event {836045448945472}: AbilityActivate {836045448945479}]"
    ]
}

V72PVAnalysisFixture()
{
    s := V6415CData(),s.Current.BossKey := "G-IZ",s.AnalysisCapture := IACaptureNew(0,10000)
    boss := "IZAX {4108097563918336}:72|(0,0,0,0)|(5268300/254712048)",markers := [],before := [],after := []
    for i,line in V72PVLines() {
        if i>1
            before.Push(V66PhaseAdd(s,i*1000,"Damage",1,"@Review#66",boss))
        markers.Push(V66PhaseApplyLine(s,line,i*1000))
        after.Push(V66PhaseAdd(s,i*1000,"Damage",i*10,"@Review#66",boss))
    }
    V66PhaseAdd(s,7000,"Damage",100,"@Review#66",boss)
    d := IAAssemble(s,s.Current,s.AnalysisCapture),IAEffectsBuild(d),IAShieldsBuild(d)
    d.BaseVerified := true,d.Demo := true
    return {State:s,Segment:s.Current,Data:d,Markers:markers,Before:before,After:after}
}

V72PVAutomatic(phases)
{
    out := []
    for p in phases
        if p.Kind="Parsely"
            out.Push(p)
    return out
}

V72PVAnalysisStages()
{
    f := V72PVAnalysisFixture(),d := f.Data,sum := 0,phases := V72PVAutomatic(d.AutomaticPhases)
    names := ["Swipes","Anchors","Interrupts","Augment Droid","Missiles","Burn"]
    V48Assert(phases.Length=6,"six supplied Izax markers produce six observed Parsely phases")
    V48Assert(d.AutomaticPhases.Length=6,"challenge scoring windows do not create duplicate primary phase choices")
    for i,phase in phases {
        V48Assert(phase.Name=names[i] && phase.From=i && phase.To=i+1,"recorded phases retain exact adjacent transition boundaries")
        sum += IAQuery(d,V66PhaseQuery(d,phase)).D
    }
    V48Assert(sum+f.Markers[1].Analysis.D=IAQuery(d,IANewQuery(d,"@Review#66")).D,"only the exclusive first boundary record is outside the Parsely phase intervals")
    p1 := phases[1],p2 := phases[2]
    V48Assert(IAPhaseContains(f.Before[1],p1.Boundary,d) && !IAPhaseContains(f.Before[1],p2.Boundary,d),"same-millisecond hit preceding the marker remains in the old phase")
    V48Assert(!IAPhaseContains(f.After[2],p1.Boundary,d) && IAPhaseContains(f.After[2],p2.Boundary,d),"same-millisecond hit following the marker enters the new phase")
    V48Assert(IAPhaseContains(f.Markers[2],p1.Boundary,d) && !IAPhaseContains(f.Markers[2],p2.Boundary,d),"Parsely assigns the observed transition record to the preceding phase")
    V48Assert(IAEventTotalsCheck(d,f.Segment).Length=0,"new phase replay does not change reconciled parser accounting")
}

V72PVAnalysisAcceptance()
{
    f := V72PVAnalysisFixture(),d := f.Data,seg := f.Segment,before := IGVJson(IGVPackProgress(IGPCompact(seg)))
    f.Markers[6].Analysis.Accepted := false
    phases := V72PVAutomatic(IAAutomaticPhases(d,seg))
    V48Assert(phases.Length=5 && phases[5].To=7,"unaccepted final marker cannot invent a sixth phase")
    f.Markers[3].Analysis.Accepted := false
    phases := V72PVAutomatic(IAAutomaticPhases(d,seg))
    V48Assert(phases.Length=4 && phases[2].To=4,"a missing intermediate marker has no invented timestamp or interval")
    V48Assert(phases[3].Name="Augment Droid","a later observed phase remains available despite a missing earlier marker")
    V48Assert(IGVJson(IGVPackProgress(IGPCompact(seg)))=before,"private accepted-event phase review never mutates the imported segment")
    f.Markers[3].Analysis.Accepted := true,f.Markers[6].Analysis.Accepted := true
    originalMode := seg.ModeId,seg.ModeId := "unsupported"
    V48Assert(V72PVAutomatic(IAAutomaticPhases(d,seg)).Length=0,"wrong mode never produces guessed ordinal phases")
    seg.ModeId := originalMode
    V48Assert(V72PVAutomatic(IAAutomaticPhases(d,seg)).Length=6,"restoring exact scope recovers all independently observed phases")
}

V72PVNativeViews() => V591Isolated(V72PVNativeViewsBody)
V72PVNativeViewsBody()
{
    global IP,soundboardsEnabled
    IGPCClose()
    try {
        e := V72PVEntry(6),IGPCRender(IGPCBuild([e],e.Pull.Group)),s := IGPCState()
        V48Assert(s.Controls["Rows"].GetCount()=6 && s.Controls["Rows"].GetText(6,1)="Burn" && s.Controls["Rows"].GetText(6,2)="1 / 1","native consistency table keeps only six observed Parsely phases with readable counts")
        for dims in [[680,450],[900,650]] {
            s.Gui.Show("Hide w" dims[1] " h" dims[2]),IGPCResize(s.Gui,0,dims[1],dims[2])
            s.Controls["Rows"].GetPos(&x,&y,&w,&h),s.Controls["Note"].GetPos(&nx,&ny,&nw,&nh)
            V48Assert(x+w<=dims[1] && y+h<ny,"six-row table remains bounded and can scroll at the minimum window size")
        }
        a := V598Ready(),f := V72PVAnalysisFixture(),IAInstallData(f.Data,"@Review#66"),IAQueryPump()
        V48Assert(a.Phases.Length=7 && a.Controls["Phase"].Text="Whole fight","Analysis selector offers six observed Parsely phases and Whole fight")
        a.Controls["Phase"].Choose(7),IAChoosePhase(),IAQueryPump()
        V48Assert(a.Controls["Phase"].Text="Burn" && a.Result.D=160,"selecting final phase displays only its actual accepted damage")
        a.Controls["Phase"].Choose(1),IAChoosePhase(),IAQueryPump()
        V48Assert(a.Result.D=IAQuery(f.Data,IANewQuery(f.Data,"@Review#66")).D && !IsObject(a.AutomaticPhase),"whole-fight selection clears phase bounds and restores full accounting")
        V48Assert(!IP.Active && !soundboardsEnabled,"new phase views do not start parsing or live audio")
    }
    finally IGPCClose()
}

V72PWEvent(action,at,seq,instance := 99)
{
    ; Exact June8 IP-CPT Observation Mode ability/effect identity, normalized time.
    actor := "IP-CPT {4494653210492928}:" instance "|(-157.70,-15.90,411.98,0.00)|(16410480/21888378)"
    raw := "[00:00:01.000] [" actor "] [=] [Observation Mode {4471627890819072}] ["
        . (action="apply" ? "ApplyEffect {836045448945477}" : "RemoveEffect {836045448945478}")
        . ": Observation Mode {4471627890819336}]"
    ev := IPParseLine(raw),ev.Analysis := {Accepted:true,At:at,Seq:seq},ev.RecordId := seq
    return ev
}

V72PWData(rows,last := 7000)
{
    return {Start:0,Last:last,Rows:rows}
}

V72PWRecords()
{
    ; Native raw original pairs are additionally verified in recorded-window-witnesses.
    rows := []
    for pair in [[1000,2000],[3000,4000],[5000,5500]] {
        rows.Push(V72PWEvent("apply",pair[1],rows.Length+1))
        rows.Push(V72PWEvent("remove",pair[2],rows.Length+1))
    }
    d := V72PWData(rows),seg := V72PhaseSegment("R4-IP"),windows := IGPXAnalysisWindows(d,seg)
    V48Assert(windows.Length=3 && windows[1].Name="Droids #1" && windows[3].Name="Droids #3","three observed cycles remain distinct review ranges")
    V48Assert(windows[3].To-windows[3].From=0.5,"brief third preburn section is retained without a guessed minimum duration")
    V48Assert(seg.PhaseProgress.Count=0 && IGPProfile(seg).Phases.Length=2,"repeating windows never mutate furthest-phase progression")
    d.Rows.Pop(),windows := IGPXAnalysisWindows(d,seg)
    V48Assert(windows.Length=3 && InStr(windows[3].Name,"end not recorded") && windows[3].Boundary.OpenEnd,"unclosed captured section is visibly incomplete")
}

V72PWGuards()
{
    seg := V72PhaseSegment("R4-IP"),rows := [V72PWEvent("remove",500,1),V72PWEvent("apply",1000,2),V72PWEvent("apply",1100,3),V72PWEvent("remove",1200,4,100),V72PWEvent("remove",2000,5)]
    windows := IGPXAnalysisWindows(V72PWData(rows),seg)
    V48Assert(windows.Length=1 && windows[1].From=1 && windows[1].To=2,"orphan remove, duplicate apply and another NPC instance cannot corrupt a window")
    rows[2].Analysis.Accepted := false,rows[3].Analysis.Accepted := false
    V48Assert(IGPXAnalysisWindows(V72PWData(rows),seg).Length=0,"rejected or rolled-back applies cannot create review phases")
    rows := [V72PWEvent("apply",1000,1),V72PWEvent("remove",2000,2)],rows[1].EffectId := "4471627890819337"
    V48Assert(IGPXAnalysisWindows(V72PWData(rows),seg).Length=0,"neighboring effect ID cannot start a droid section")
    rows[1].EffectId := "4471627890819336",seg.ModeId := "836045448953651"
    V48Assert(IGPXAnalysisWindows(V72PWData(rows),seg).Length=0,"Story scope cannot inherit Veteran window rules")
}

V72PWBoundaries()
{
    rows := [V72PWEvent("apply",1000,10),V72PWEvent("remove",2000,20)],d := V72PWData(rows),seg := V72PhaseSegment("R4-IP")
    w := IGPXAnalysisWindows(d,seg)[1],before := V72PWEvent("apply",1000,9),inside := V72PWEvent("apply",2000,19),after := V72PWEvent("apply",2000,21)
    V48Assert(!IAPhaseContains(before,w.Boundary,d) && IAPhaseContains(rows[1],w.Boundary,d),"same-time start uses actual record order")
    V48Assert(IAPhaseContains(inside,w.Boundary,d) && !IAPhaseContains(rows[2],w.Boundary,d) && !IAPhaseContains(after,w.Boundary,d),"same-time removal excludes subsequent events exactly once")
}

; Literal recorded Observation Mode pairs; no live files are opened by diagnostics.
V72PWOriginalPairs1()
{
    rows := []
    ev := IPParseLine("[19:48:07.662] [IP-CPT {4494653210492928}:23408000004605|(-157.70,-15.90,411.98,0.00)|(16410480/21888378)] [=] [Observation Mode {4471627890819072}] [ApplyEffect {836045448945477}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:1},ev.RecordId := 1,rows.Push(ev)
    ev := IPParseLine("[19:50:12.506] [IP-CPT {4494653210492928}:23408000004605|(-157.70,-15.90,421.98,0.00)|(16410480/21888378)] [=] [Observation Mode {4471627890819072}] [RemoveEffect {836045448945478}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:2},ev.RecordId := 2,rows.Push(ev)
    ev := IPParseLine("[19:50:57.627] [IP-CPT {4494653210492928}:23408000004605|(-157.70,-15.90,411.98,0.00)|(10905560/21888378)] [=] [Observation Mode {4471627890819072}] [ApplyEffect {836045448945477}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:3},ev.RecordId := 3,rows.Push(ev)
    ev := IPParseLine("[19:52:39.457] [IP-CPT {4494653210492928}:23408000004605|(-157.70,-15.90,421.98,0.00)|(10905560/21888378)] [=] [Observation Mode {4471627890819072}] [RemoveEffect {836045448945478}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:4},ev.RecordId := 4,rows.Push(ev)
    ev := IPParseLine("[19:53:24.915] [IP-CPT {4494653210492928}:23408000004605|(-157.70,-15.90,411.98,0.00)|(5470727/21888378)] [=] [Observation Mode {4471627890819072}] [ApplyEffect {836045448945477}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:5},ev.RecordId := 5,rows.Push(ev)
    ev := IPParseLine("[19:53:37.618] [IP-CPT {4494653210492928}:23408000004605|(-157.70,-15.90,421.98,0.00)|(5470727/21888378)] [=] [Observation Mode {4471627890819072}] [RemoveEffect {836045448945478}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:6},ev.RecordId := 6,rows.Push(ev)
    d := V72PWData(rows,rows[rows.Length].RawMs+1000),windows := IGPXAnalysisWindows(d,V72PhaseSegment("R4-IP"))
    V48Assert(windows.Length=3 && !windows[3].Boundary.OpenEnd,"original recording has three complete observed droid sections")
    for i,w in windows
        V48Assert(w.Boundary.Start=rows[2*i-1].RawMs && w.Boundary.End=rows[2*i].RawMs,"native window agrees with original apply/remove timestamps")
}


V72PWOriginalPairs2()
{
    rows := []
    ev := IPParseLine("[22:51:14.677] [IP-CPT {4494653210492928}:123719000004104|(-157.70,-15.90,411.98,0.00)|(16414063/21888378)] [=] [Observation Mode {4471627890819072}] [ApplyEffect {836045448945477}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:1},ev.RecordId := 1,rows.Push(ev)
    ev := IPParseLine("[22:53:22.438] [IP-CPT {4494653210492928}:123719000004104|(-157.70,-15.90,421.98,0.00)|(16414063/21888378)] [=] [Observation Mode {4471627890819072}] [RemoveEffect {836045448945478}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:2},ev.RecordId := 2,rows.Push(ev)
    ev := IPParseLine("[22:54:00.374] [IP-CPT {4494653210492928}:123719000004104|(-157.70,-15.90,411.98,0.00)|(10918933/21888378)] [=] [Observation Mode {4471627890819072}] [ApplyEffect {836045448945477}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:3},ev.RecordId := 3,rows.Push(ev)
    ev := IPParseLine("[22:55:49.130] [IP-CPT {4494653210492928}:123719000004104|(-157.70,-15.90,421.98,0.00)|(10918933/21888378)] [=] [Observation Mode {4471627890819072}] [RemoveEffect {836045448945478}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:4},ev.RecordId := 4,rows.Push(ev)
    ev := IPParseLine("[22:56:30.841] [IP-CPT {4494653210492928}:123719000004104|(-157.70,-15.90,411.98,0.00)|(5462483/21888378)] [=] [Observation Mode {4471627890819072}] [ApplyEffect {836045448945477}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:5},ev.RecordId := 5,rows.Push(ev)
    ev := IPParseLine("[22:56:47.351] [IP-CPT {4494653210492928}:123719000004104|(-157.70,-15.90,421.98,0.00)|(5462483/21888378)] [=] [Observation Mode {4471627890819072}] [RemoveEffect {836045448945478}: Observation Mode {4471627890819336}]")
    ev.Analysis := {Accepted:true,At:ev.RawMs,Seq:6},ev.RecordId := 6,rows.Push(ev)
    d := V72PWData(rows,rows[rows.Length].RawMs+1000),windows := IGPXAnalysisWindows(d,V72PhaseSegment("R4-IP"))
    V48Assert(windows.Length=3 && !windows[3].Boundary.OpenEnd,"original recording has three complete observed droid sections")
    for i,w in windows
        V48Assert(w.Boundary.Start=rows[2*i-1].RawMs && w.Boundary.End=rows[2*i].RawMs,"native window agrees with original apply/remove timestamps")
}


V73SectionState()
{
    seg := V72PhaseSegment("R4-IP")
    seg.Partial := false
    return seg
}

V73SectionObserve(seg,action,at,seq,instance := 99)
{
    ev := V72PWEvent(action,at,seq,instance)
    IGPObserve(seg,ev,at)
    return ev
}

V73SectionPersistence()
{
    seg := V73SectionState()
    V73SectionObserve(seg,"apply",1000,1),V73SectionObserve(seg,"remove",2000,2)
    V73SectionObserve(seg,"apply",3000,3),V73SectionObserve(seg,"apply",3100,4)
    s := IGPCompact(seg).Sections
    V48Assert(s.Counts[1].Started=2 && s.Counts[1].Completed=1,"duplicate apply never adds a cycle; missing end remains distinct")
    packed := IGVPackProgress(IGPCompact(seg)),copy := IGVUnpackProgress(packed)
    V48Assert(packed.Length=16 && IsObject(copy.Health) && IGWMatches(copy.Sections,IGWProfile(seg)),"section counts coexist with primary-phase and independent boss-health evidence")
    V48Assert(IGVJson(IGWPack(copy.Sections))=IGVJson(IGWPack(s)),"section counts survive exact compact JSON round trip")
    packed.Pop(),phaseOnly := IGVUnpackProgress(packed)
    V48Assert(IsObject(phaseOnly.Parsely) && !phaseOnly.HasOwnProp("Health"),"old 15-field progress retains phases without inventing independent boss health")
    packed.Pop(),previous := IGVUnpackProgress(packed)
    V48Assert(IsObject(previous.Sections) && !previous.HasOwnProp("Parsely"),"old 14-field progress retains section evidence without inventing primary phases")
    packed.Pop(),old := IGVUnpackProgress(packed)
    V48Assert(!old.HasOwnProp("Sections"),"old 13-field progress loads without inventing new evidence")
    for bad in [["x",0,[["d",1.5,0]]],["x",0,[["d",1,2]]],["x",0,[["d",1,1],["d",1,1]]],["x",0,[["d",40,0],["e",40,0]]]] {
        caught := false
        try IGWUnpack(bad)
        catch Error
            caught := true
        V48Assert(caught,"malformed or unbounded compact section data is rejected")
    }
}

V73SectionJournal()
{
    seg := V73SectionState(),state := IPNewData("Isolated section rollback")
    V73SectionObserve(seg,"apply",1000,1)
    before := IGVJson(IGVPackProgress(IGPCompact(seg)))
    IPBBeginUndo(state,seg)
    V73SectionObserve(seg,"remove",2000,2),V73SectionObserve(seg,"apply",3000,3)
    V48Assert(IGPCompact(seg).Sections.Counts[1].Started=2,"provisional accepted tail creates a second interval")
    IPBRollbackTail(state,seg)
    V48Assert(IGVJson(IGVPackProgress(IGPCompact(seg)))=before,"rollback removes window endings and starts without touching previous evidence")
    seg := V73SectionState(),IPBBeginUndo(state,seg)
    V73SectionObserve(seg,"apply",1000,1),IPBRollbackTail(state,seg)
    V48Assert(!IsObject(IGWCompact(seg)),"rolled-back first marker cannot leave a fake zero-observation capture")
}

V73SectionLateBoundary()
{
    seg := V73SectionState()
    V73SectionObserve(seg,"remove",2000,2),V73SectionObserve(seg,"apply",1000,1)
    s := IGWCompact(seg)
    V48Assert(s.Counts[1].Started=1 && s.Counts[1].Completed=1,"ending received before earlier start reconciles by exact source identity")
    seg := V73SectionState()
    V73SectionObserve(seg,"remove",2000,2,100),V73SectionObserve(seg,"apply",1000,1)
    V48Assert(IGWCompact(seg).Counts[1].Completed=0,"another instance's orphan end cannot complete this window")
    V73SectionObserve(seg,"remove",2500,3)
    V48Assert(IGWCompact(seg).Counts[1].Completed=1,"later matching instance end closes the actual interval")
}

V73SectionConsistency()
{
    seg := V73SectionState()
    V73SectionObserve(seg,"apply",1000,1),V73SectionObserve(seg,"remove",2000,2)
    V73SectionObserve(seg,"apply",3000,3)
    internal := IGWCompact(seg)
    V48Assert(internal.Counts[1].Started=2 && internal.Counts[1].Completed=1,"legacy shield-up observations remain exact internal mechanic evidence")
    a := {Key:"sections-a",Pull:IPRCompact(seg),Team:"A",Date:"20261003",Session:"fixture"}
    ; The primary IP-CPT view uses the actual IP CPT/Bombs phase catalogue,
    ; independently of the preserved old shield-up mechanic observations.
    a.Pull.Progress.Parsely := {Key:IGPYProfile(seg).Key,Limited:false,
        Counts:[{Id:"ip",Started:2,Completed:2},{Id:"bombs",Started:2,Completed:1},{Id:"burn",Started:0,Completed:0}],
        Order:[{Id:"ip",Ordinal:1},{Id:"bombs",Ordinal:1},{Id:"ip",Ordinal:2},{Id:"bombs",Ordinal:2}]}
    b := IPRCloneSnapshot(a),b.Key := "sections-b"
    b.Pull.Progress.Parsely.Counts[1].Started := 1,b.Pull.Progress.Parsely.Counts[1].Completed := 0
    b.Pull.Progress.Parsely.Counts[2].Started := 0,b.Pull.Progress.Parsely.Counts[2].Completed := 0
    b.Pull.Progress.Parsely.Order := [{Id:"ip",Ordinal:1}]
    c := IPRCloneSnapshot(b),c.Key := "sections-c",c.Pull.Partial := true
    old := IPRCloneSnapshot(b),old.Key := "sections-old",old.Pull.Progress.DeleteProp("Parsely")
    model := IGPCBuild([a,b,c,old],a.Pull.Group),rows := []
    for row in model.Rows
        if row.Id="bombs"
            rows.Push(row)
    V48Assert(rows.Length=2 && rows[1].Name="Bombs" && rows[2].Name="Bombs 2" && rows[1].Reached=1 && rows[2].Reached=1,"actual primary Bombs occurrences retain their chronological names and counts")
    V48Assert(model.Rows.Length=4 && model.Rows[3].Name="IP CPT 2","old droid/shield mechanics do not append primary phase rows")
    V48Assert(rows[2].Earlier=1 && rows[2].Unknown=2,"complete absence, partial absence and old missing metadata remain distinct")
    V71PCCheckSums(model)
    a.Conflict := "Recorder disagreement"
    model := IGPCBuild([a],a.Pull.Group)
    for row in model.Rows
        V48Assert(row.Reached=0 && row.Unknown=1,"unresolved alternative captures cannot lend primary phase evidence")
}

V73SectionAnalysis()
{
    seg := V73SectionState(),rows := [V72PWEvent("apply",1000,1),V72PWEvent("remove",2000,2),V72PWEvent("apply",3000,3)]
    d := V72PWData(rows),before := IGVJson(IGVPackProgress(IGPCompact(seg)))
    phases := IGWAnalysisWindows(d,seg)
    V48Assert(phases.Length=2 && phases[1].From=1 && phases[1].To=2,"shared rules preserve recorded start/end times")
    V48Assert(phases[2].Boundary.OpenEnd && InStr(phases[2].Name,"end not recorded"),"uncaptured endpoint stays disclosed in phase selector")
    V48Assert(IGVJson(IGVPackProgress(IGPCompact(seg)))=before && !seg.HasOwnProp("PhaseWindows"),"Analysis reconstruction never mutates live/saved encounter state")
    rows[1].Analysis.Accepted := false,rows[3].Analysis.Accepted := false
    V48Assert(IGWAnalysisWindows(d,seg).Length=0,"rejected markers cannot create any review intervals")
}

V73WitnessSegment(boss,area,mode)
{
    state := IPNewData("Isolated recorded marker"),state.AreaId := area,state.ModeId := mode
    seg := IPNewSegment(state,0,"Recorded marker fixture"),seg.BossKey := boss
    seg.PhaseProgress := Map(),seg.Last := 172800000,seg.End := seg.Last,seg.Partial := false
    return seg
}

V73CheckRecordedSequence(c)
{
    seg := V73WitnessSegment(c.Boss,c.Area,c.Mode),day := 0,last := -1
    ; Old raw witnesses still verify their independent mechanic catalogue.
    ; They no longer imply primary phases when Parsely supplies no phase menu.
    fallback := !IsObject(IGPYProfile(seg)),internal := V73WitnessSegment(c.Boss,c.Area,c.Mode)
    ip := IGPXProfile(internal)
    if c.Prior
        IGPAdvance(fallback ? internal : seg,c.Prior,0,"Explicit prerequisite fixture")
    for row in c.Rows {
        ev := IPParseLine(row.Raw)
        V48Assert(IsObject(ev),"recorded phase marker parses natively")
        if last>=0 && ev.RawMs<last-43200000
            day += 86400000
        last := ev.RawMs,at := day+ev.RawMs,ev.RecordId := row.Line
        IGPObserve(seg,ev,at)
        if c.Boss="G-TY" || c.Boss="G-AE" {
            sections := IGWCompact(seg)
            V48Assert(IsObject(sections) && sections.Counts[row.Stage].Started=1,c.Name " line " row.Line " records the exact supplementary section")
            V48Assert(IGPProfile(seg).Kind=(c.Boss="G-AE" ? "Sisters" : "HP"),"section observation preserves existing HP graph semantics")
        }
        else if fallback {
            V48Assert(IGPProfile(seg).Kind="HP" && seg.PhaseProgress.Get("Stage",0)<=1,c.Name " keeps actual boss health instead of custom mechanic stages")
            V48Assert(!IsObject(IGPYCompact(seg)),"unverified primary phases are never fabricated from a recorded mechanic")
            if IsObject(ip) {
                positive := ev.Kind="Damage" && ev.Amount>0 && !ev.Immune && !ev.FullAbsorb
                IGPXObserve(internal,ev,at,ip,IPBNpcId(ev.Source),IPBNpcId(ev.Target),positive)
                V48Assert(internal.PhaseProgress.Get("Stage",0)=row.Stage,c.Name " original line " row.Line " preserves the independent internal rule")
            }
        }
        else
            V48Assert(seg.PhaseProgress.Get("Stage",0)=row.Stage,c.Name " original line " row.Line " reaches expected phase")
    }
}

V73CheckRecordedRule(c)
{
    seg := V73WitnessSegment(c.Boss,c.Area,c.Mode),p := IGWProfile(seg),found := false
    V48Assert(IsObject(p),"recorded window has an exact scoped catalogue")
    ev := IPParseLine(c.Raw),src := "",dst := "",ready := false
    for def in p.Windows {
        if def.Id!=c.Id
            continue
        for rule in def.%c.Side%
            if IGWMatch(rule,ev,&src,&dst,&ready)
                found := true
    }
    V48Assert(found,c.Name " original line " c.Line " matches its actual start/end rule")
    seg.AreaId := "wrong-area"
    V48Assert(!IsObject(IGWProfile(seg)),"same window marker outside the recorded raid is rejected")
}

; Literal recorded markers, with only player tokens anonymized. No user log files are opened.
V73RecordedSequence1()
{
    V73CheckRecordedSequence({Name:"Tyth-Archive-combat_2026-08-18_18_28_21_954963",Boss:"G-TY",Area:"833571547775765",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[18:58:53.790] [@Recorded Player#1|(803.75,2340.52,228.52,-151.68)|(443782/443782)] [TYTH {4078423634870272}:39977000410434|(806.20,2345.08,228.52,-80.14)|(19953132/19989636)] [Force Leap {812105301229568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6637 ~6638 energy {836045448940874}) <4978.0>",Stage:1,Line:50198},{Raw:"[19:00:21.169] [TYTH {4078423634870272}:39977000410434|(792.69,2354.19,228.52,127.75)|(12925263/19989636)] [=] [ {4076190251876352}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:56071},{Raw:"[19:05:13.085] [TYTH {4078423634870272}:39977000410434|(786.19,2349.80,228.52,44.94)|(4937647/19989636)] [=] [ {4079669175386112}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:71617},{Raw:"[19:05:13.177] [TYTH {4078423634870272}:39977000410434|(786.19,2349.80,228.52,44.94)|(4909172/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:71634}]})
}

V73RecordedSequence2()
{
    V73CheckRecordedSequence({Name:"Tyth-Archive-combat_2026-09-16_15_03_39_130001",Boss:"G-TY",Area:"833571547775765",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[15:29:00.632] [@Recorded Player#1|(804.45,2340.40,228.52,-159.50)|(483839/483839)] [TYTH {4078423634870272}:66590000316688|(806.20,2345.08,228.52,20.60)|(19982942/19989636)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6694* kinetic {836045448940873}) <20082.0>",Stage:1,Line:38748},{Raw:"[15:30:49.875] [TYTH {4078423634870272}:66590000316688|(828.17,2352.36,228.52,163.66)|(12953781/19989636)] [=] [ {4076190251876352}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:45215},{Raw:"[15:35:26.248] [TYTH {4078423634870272}:66590000316688|(800.24,2316.05,228.52,123.12)|(4754197/19989636)] [=] [ {4079669175386112}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:59838},{Raw:"[15:35:26.440] [TYTH {4078423634870272}:66590000316688|(800.43,2316.03,228.52,122.82)|(4716422/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:59853}]})
}

V73RecordedSequence3()
{
    V73CheckRecordedSequence({Name:"Sisters-Archive-combat_2026-05-12_18_34_51_434249",Boss:"G-AE",Area:"833571547775765",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[19:08:06.482] [@Recorded Player#1|(486.20,2811.64,317.41,177.90)|(437695/437695)] [Codex {4105254295568384}:113004000830531|(486.00,2821.00,317.61,360.00)|(678132/680777)] [Electro Net {3066456325488640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2645 energy {836045448940874}) <1984.0>",Stage:1,Line:60039},{Raw:"[19:09:19.022] [@Recorded Player#1|(484.77,2782.09,317.41,-21.53)|(443752/443752)] [ESNE {4088538282852352}:113004001140092|(486.00,2778.00,317.41,-90.00)|(18696540/18734600)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4497 ~4498 elemental {836045448940875}) <3373.0>",Stage:2,Line:63948},{Raw:"[19:12:01.435] [AIVELA {4088525397950464}:113004001140219|(486.00,2803.00,317.41,197.02)|(13488913/18734600)] [=] [ {4112143423111168}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:74547},{Raw:"[19:13:19.080] [ESNE {4088538282852352}:113004001140092|(486.00,2778.00,317.41,34.22)|(7999674/18734600)] [=] [ {4112147718078464}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:4,Line:80229},{Raw:"[19:15:12.734] [AIVELA {4088525397950464}:113004001140219|(487.95,2807.06,317.41,133.37)|(2430839/18734600)] [=] [Overdrive Mode {4112572919840768}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:5,Line:89223}]})
}

V73RecordedSequence4()
{
    V73CheckRecordedSequence({Name:"Sisters-Archive-combat_2026-05-19_18_34_57_936611",Boss:"G-AE",Area:"833571547775765",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[19:29:19.188] [@Recorded Player#1|(485.96,2814.18,317.41,-162.28)|(436477/436477)] [Codex {4105254295568384}:136619000850716|(486.00,2821.00,317.61,360.00)|(676266/680777)] [Electro Net {3066473505357824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4511* energy {836045448940874}) <3383.0>",Stage:1,Line:97803},{Raw:"[19:30:31.835] [@Recorded Player#1|(477.17,2784.69,317.41,-60.09)|(400931/472036)] [ESNE {4088538282852352}:136619000882022|(486.00,2778.00,317.41,-125.75)|(18717814/18734600)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (637 ~638 energy {836045448940874}) <1911.0>",Stage:2,Line:101560},{Raw:"[19:32:46.785] [ESNE {4088538282852352}:136619000882022|(486.00,2778.00,317.41,11.06)|(13488913/18734600)] [=] [ {4112143423111168}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:110565},{Raw:"[19:34:02.721] [AIVELA {4088525397950464}:136619000882149|(486.00,2803.00,317.41,-204.02)|(7999674/18734600)] [=] [ {4112147718078464}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:4,Line:116434},{Raw:"[19:36:03.235] [ESNE {4088538282852352}:136619000882022|(483.00,2807.64,317.41,-6.68)|(1456426/18734600)] [=] [Overdrive Mode {4112572919840768}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:5,Line:125835}]})
}

V73RecordedSequence5()
{
    V73CheckRecordedSequence({Name:"Apex-Archive-combat_2026-07-14_23_48_48_134124",Boss:"DX-AP",Area:"833571547775792",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[02:23:52.317] [@Recorded Player#1|(394.73,-274.16,-13.98,176.13)|(488355/488355)] [Apex Vanguard {4350020186800128}:16705004496162|(394.45,-270.11,-13.98,-5.55)|(62683932/62726540)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13137* ~13136 energy {836045448940874}) <39411.0>",Stage:1,Line:357269},{Raw:"[02:24:26.063] [Apex Vanguard {4350020186800128}:16705004496162|(388.33,-304.32,-13.98,70.23)|(57697088/62726540)] [=] [Photogenesis {4297784794546176}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:358838},{Raw:"[02:25:01.582] [Apex Vanguard {4350020186800128}:16705004496162|(375.48,-265.93,-13.98,51.03)|(57437024/62726540)] [=] [Darkness Overdrive {4297819154284544}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:360484}]})
}

V73RecordedSequence6()
{
    V73CheckRecordedSequence({Name:"Apex-Archive-combat_2026-02-08_20_54_14_413966",Boss:"DX-AP",Area:"833571547775792",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[21:51:50.351] [@Recorded Player#1|(390.50,-282.05,-13.98,-138.46)|(521920/521920)] [Apex Vanguard {4350020186800128}:44021000796193|(394.45,-270.11,-13.98,0.25)|(62703964/62726540)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7918 ~7920 energy {836045448940874}) <23755.0>",Stage:1,Line:75701},{Raw:"[21:52:27.390] [Apex Vanguard {4350020186800128}:44021000796193|(388.51,-273.87,-13.98,-149.35)|(57749064/62726540)] [=] [Photogenesis {4297784794546176}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:77759},{Raw:"[21:52:55.005] [Apex Vanguard {4350020186800128}:44021000796193|(376.03,-250.49,-13.98,-150.97)|(57019016/62726540)] [=] [Darkness Overdrive {4297819154284544}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:79180}]})
}

V73RecordedSequence7()
{
    V73CheckRecordedSequence({Name:"Watchdog-Archive-combat_2026-08-20_19_12_36_094389",Boss:"R4-WD",Area:"833571547775799",Mode:"836045448953652",Prior:0,Rows:[{Raw:"[19:55:05.090] [@Recorded Player#1|(-174.52,199.66,339.99,40.08)|(442565/442565)] [Watchdog {4494700455133184}:47058000203232|(-177.98,196.04,339.99,315.00)|(54191780/54258512)] [Lethal Strike {3403731517308928}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (17006 ~17004 internal {836045448940876}) <17006.0>",Stage:1,Line:25994},{Raw:"[19:55:29.908] [Watchdog {4494700455133184}:47058000203232|(-157.41,179.01,340.09,-62.28)|(49520464/54258512)] [=] [Watchdog Protocol {4472272135913472}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:27528},{Raw:"[19:56:14.131] [Watchdog {4494700455133184}:47058000203232|(-141.51,182.38,340.03,-256.40)|(40498032/54258512)] [=] [Stalker Protocol {4472963625648128}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:30261},{Raw:"[19:57:02.755] [Watchdog {4494700455133184}:47058000203232|(-159.97,179.78,340.08,95.76)|(29857990/54258512)] [=] [Polarized Beam {4471709495197696}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:4,Line:33102},{Raw:"[19:59:14.122] [Watchdog {4494700455133184}:47058000203232|(-138.33,160.34,339.99,-46.67)|(6645175/54258512)] [=] [Hair Trigger Protocol {4474290770542592}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:5,Line:40262}]})
}

V73RecordedSequence8()
{
    V73CheckRecordedSequence({Name:"Watchdog-Archive-combat_2026-07-08_21_33_00_286857",Boss:"R4-WD",Area:"833571547775799",Mode:"836045448953652",Prior:0,Rows:[{Raw:"[21:58:21.828] [@Recorded Player#1|(-179.59,191.48,339.99,-139.59)|(291857/443634)] [Watchdog {4494700455133184}:1922000199942|(-177.98,196.04,339.99,315.00)|(54193108/54258512)] [Back Blast {981331307659264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (38146* ~38148 kinetic {836045448940873}) <38146.0>",Stage:1,Line:23321},{Raw:"[21:58:46.057] [Watchdog {4494700455133184}:1922000199942|(-154.87,178.27,340.08,-51.46)|(50201596/54258512)] [=] [Watchdog Protocol {4472272135913472}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:24672},{Raw:"[21:59:30.664] [Watchdog {4494700455133184}:1922000199942|(-152.80,181.16,340.08,-66.78)|(43254704/54258512)] [=] [Stalker Protocol {4472963625648128}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:26969},{Raw:"[22:00:18.922] [Watchdog {4494700455133184}:1922000199942|(-151.51,176.79,340.13,166.38)|(31130458/54258512)] [=] [Polarized Beam {4471709495197696}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:4,Line:29460},{Raw:"[22:01:59.755] [Watchdog {4494700455133184}:1922000199942|(-177.24,198.50,339.99,-185.98)|(6402453/54258512)] [=] [Hair Trigger Protocol {4474290770542592}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:5,Line:34370}]})
}

V73RecordedSequence9()
{
    V73CheckRecordedSequence({Name:"HoldingPens-Archive-combat_2026-09-02_19_02_00_861669",Boss:"DX-E1",Area:"833571547775792",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[19:39:02.460] [@Recorded Player#1|(-338.26,-223.46,0.02,-170.61)|(492212/492212)] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-336.43,-211.81,0.40,9.04)|(10069134/10078924)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9790 kinetic {836045448940873}) <44056.0>",Stage:1,Line:25209},{Raw:"[19:41:16.397] [Czerka Warden Droid {4245686841245696}:20976000093795|(-169.58,-285.75,0.07,59.62)|(0/18188932)] [=] [Data Lock {4345484701335552}] [RemoveEffect {836045448945478}: Data Lock {4345484701335552}]",Stage:2,Line:33624},{Raw:"[19:43:26.033] [Czerka Warden Droid {4245686841245696}:20976000093905|(-2.89,-288.94,-0.04,-18.65)|(0/18188932)] [=] [Data Lock {4345488996302848}] [RemoveEffect {836045448945478}: Data Lock {4345488996302848}]",Stage:3,Line:42956}]})
}

V73RecordedSequence10()
{
    V73CheckRecordedSequence({Name:"HoldingPens-Archive-combat_2026-06-26_21_50_54_357869",Boss:"DX-E1",Area:"833571547775792",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[22:24:37.647] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-326.16,-228.09,0.32,-111.10)|(10078924/10078924)] [@Recorded Player#1|(-325.97,-233.31,0.35,-79.24)|(151853/443752)] [Cleaning Field {4389447986577702}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (297892 elemental {836045448940875}) <297892.0>",Stage:1,Line:23926},{Raw:"[22:26:38.852] [Czerka Warden Droid {4245686841245696}:1040002353464|(-175.37,-294.25,-0.01,14.04)|(0/18188932)] [=] [Data Lock {4345484701335552}] [RemoveEffect {836045448945478}: Data Lock {4345484701335552}]",Stage:2,Line:31212},{Raw:"[22:29:00.221] [Czerka Warden Droid {4245686841245696}:1040002353574|(11.61,-295.68,-0.03,-38.64)|(0/18188932)] [=] [Data Lock {4345488996302848}] [RemoveEffect {836045448945478}: Data Lock {4345488996302848}]",Stage:3,Line:40881}]})
}

V73RecordedSequence11()
{
    V73CheckRecordedSequence({Name:"ControlRoom-Archive-combat_2026-06-26_21_50_54_357869",Boss:"DX-E2",Area:"833571547775792",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[22:30:33.136] [@Recorded Player#1|(8.09,-343.82,0.19,169.75)|(443752/443752)] [Crimson Stalker {4333218274738176}:1040002764382|(7.21,-339.67,0.35,-11.75)|(376856/385536)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8680 energy {836045448940874}) <6510.0>",Stage:1,Line:43297},{Raw:"[22:33:55.833] [@Recorded Player#1|(30.47,-94.04,-0.15,-160.87)|(411044/481433)] [Czerka Warden Enforcer Droid {4338552624119808}:1040002353684|(32.93,-87.50,-0.13,0.00)|(542724/2239761)] [Dark Charge {3421302228516864}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (510 internal {836045448940876}) <1530.0>",Stage:2,Line:54542},{Raw:"[22:34:09.619] [@Recorded Player#1|(42.57,-99.75,-0.15,1.42)|(461520/481433)] [Czerka Sanitizer Droid {4390577562976256}:1040002870965|(48.07,-104.83,-0.13,135.45)|(5014384/5038335)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23951* energy {836045448940874}) <71853.0>",Stage:3,Line:55419}]})
}

V73RecordedSequence12()
{
    V73CheckRecordedSequence({Name:"ControlRoom-Archive-combat_2026-06-10_17_07_41_831486",Boss:"DX-E2",Area:"833571547775792",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[17:41:35.612] [@Recorded Player#1|(17.17,-345.90,-0.33,-165.50)|(443782/443782)] [Crimson Stalker {4333218274738176}:5405000481641|(18.26,-341.65,-0.28,20.78)|(371665/385536)] [Force Leap {812105301229568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13871* energy {836045448940874}) <13871.0>",Stage:1,Line:48124},{Raw:"[17:44:56.859] [@Recorded Player#1|(36.94,-91.15,-0.13,169.78)|(500688/511701)] [Czerka Warden Enforcer Droid {4338552624119808}:5405000031165|(32.93,-87.50,-0.13,0.00)|(2230024/2239761)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9737 kinetic {836045448940873}) <43817.0>",Stage:2,Line:60975},{Raw:"[17:45:13.487] [@Recorded Player#1|(29.37,-107.15,-0.14,55.38)|(443782/443782)] [Czerka Sanitizer Droid {4390577562976256}:5405000594095|(28.82,-110.62,-0.13,94.26)|(5018101/5038335)] [Cauterize {3460841697443840}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11965* energy {836045448940874}) <11965.0>",Stage:3,Line:61698}]})
}

V73RecordedSequence13()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[14:25:58.053] [@Recorded Player#1|(-3.79,-330.65,-2.75,-54.10)|(443604/443604)] [Gate Commander Draxus {3303392491339776}:95826000107052|(0.19,-333.89,-2.75,147.75)|(14554771/14628218)] [Lethal Strike {3403731517308928}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (30412* internal {836045448940876}) <30412.0>",Stage:1,Line:16151},{Raw:"[14:26:13.494] [@Recorded Player#1|(-3.72,-321.65,-2.74,56.29)|(397769/443604)] [Subteroth {3281320654405632}:95826000117360|(21.33,-327.04,-0.98,102.05)|(443377/451385)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8008* internal {836045448940876}) <8008.0>",Stage:2,Line:16985},{Raw:"[14:26:26.100] [@Recorded Player#1|(25.36,-324.14,0.01,-91.17)|(482069/502898)] [Dread Guard Dispatcher {3288141062471680}:95826000126695|(31.92,-322.77,-0.02,78.64)|(391367/403023)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11656 kinetic {836045448940873}) <52451.0>",Stage:3,Line:18241},{Raw:"[14:26:53.244] [@Recorded Player#1|(-18.97,-323.11,-1.70,46.32)|(443604/443604)] [Dread Guard Corrupter {3288136767504384}:95826000137601|(-28.69,-326.42,0.01,-90.00)|(390808/403023)] [Toxic Haze {3987765465186304}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12215* internal {836045448940876}) <12215.0>",Stage:4,Line:19657},{Raw:"[14:27:38.725] [@Recorded Player#1|(-27.85,-323.10,0.01,68.83)|(443752/443752)] [Dread Guard Dismantler {3288029393321984}:95826000158598|(-29.51,-323.20,0.01,-90.00)|(774497/806045)] [Bleeding Offense {4490487092215808}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3467* elemental {836045448940875}) <3467.0>",Stage:5,Line:22536},{Raw:"[14:27:58.412] [@Recorded Player#1|(-2.01,-291.90,-2.74,179.60)|(400106/453429)] [Dread Guard Bulwark {3288145357438976}:95826000166873|(-2.03,-289.40,-2.74,0.00)|(383024/403023)] [Death Field {808433104191488}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (19999 internal {836045448940876}) <19999.0>",Stage:6,Line:23621},{Raw:"[14:28:48.826] [Dread Guard Despoiler {3281324949372928}:95826000194213|(-1.44,-287.82,-2.74,-13.26)|(362720/362720)] [@Recorded Player#1|(7.66,-326.14,-2.75,167.96)|(372512/502898)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1841 ~1289 energy {836045448940874} -shield {836045448945509} (552 absorbed {836045448945511})) <1841.0>",Stage:7,Line:27289},{Raw:"[14:29:23.293] [@Recorded Player#1|(7.51,-312.49,-2.74,-134.46)|(312004/434161)] [Guardian of the Fortress {3317793516683264}:95826000212444|(13.49,-310.13,-2.74,90.00)|(1599208/1612089)] [Vital Shot {2115340112756736}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7411* ~7412 internal {836045448940876}) <7411.0>",Stage:8,Line:29863},{Raw:"[14:29:52.238] [@Recorded Player#1|(-1.98,-304.35,-2.49,163.28)|(502898/502898)] [Dread Guard Despoiler {3281324949372928}:95826000224713|(-3.68,-289.52,-2.74,-7.08)|(341533/362720)] [Depredating Volts {3408949902573568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10794 energy {836045448940874}) <32382.0>",Stage:9,Line:31725},{Raw:"[14:30:11.871] [Gate Commander Draxus {3303392491339776}:95826000107052|(-5.66,-315.90,-2.74,33.12)|(3755672/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:33024},{Raw:"[14:30:43.805] [Gate Commander Draxus {3303392491339776}:95826000107052|(-5.66,-315.90,-2.74,4.86)|(3748543/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:35311}]})
}

V73RecordedSequence14()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[18:54:55.268] [@Recorded Player#1|(0.17,-341.44,-1.54,179.84)|(496474/496474)] [Gate Commander Draxus {3303392491339776}:81855000494845|(0.19,-333.89,-2.75,0.25)|(14609715/14628218)] [Shadow Strike {812839740637184}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11871 energy {836045448940874}) <35613.0>",Stage:1,Line:16345},{Raw:"[18:55:12.300] [@Recorded Player#1|(-6.14,-326.67,-2.75,176.29)|(443604/443604)] [Subteroth {3281320654405632}:81855000502697|(-8.87,-327.13,-2.74,-63.73)|(419544/451385)] [Force Scream {998270658674688}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31841* kinetic {836045448940873}) <31841.0>",Stage:2,Line:17090},{Raw:"[18:55:35.112] [Dread Guard Dispatcher {3288141062471680}:81855000512977|(-30.32,-325.96,0.01,-72.38)|(403023/403023)] [@Recorded Player#1|(-1.51,-335.16,-2.75,181.48)|(489941/496474)] [Force Lightning {3288162537308160}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12556 elemental {836045448940875}) <12556.0>",Stage:3,Line:18562},{Raw:"[18:56:07.532] [@Recorded Player#1|(-27.07,-325.54,0.06,58.47)|(435468/435468)] [Dread Guard Corrupter {3288136767504384}:81855000525655|(-28.69,-326.42,0.01,-63.23)|(391064/403023)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2968 internal {836045448940876}) <2968.0>",Stage:4,Line:20156},{Raw:"[18:56:56.942] [@Recorded Player#1|(24.20,-321.54,-0.19,-84.99)|(413284/449519)] [Dread Guard Dismantler {3281329244340224}:81855000547272|(28.87,-322.45,-0.01,90.00)|(735318/806045)] [Shadow Technique {979819479171072}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13155* internal {836045448940876}) <13155.0>",Stage:5,Line:22998},{Raw:"[18:57:23.704] [@Recorded Player#1|(-1.63,-290.51,-2.74,-178.23)|(435468/435468)] [Dread Guard Bulwark {3288145357438976}:81855000557215|(-2.03,-289.40,-2.74,1.45)|(388275/403023)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2527 internal {836045448940876}) <2527.0>",Stage:6,Line:24478},{Raw:"[18:58:14.546] [Dread Guard Despoiler {3281324949372928}:81855000581814|(-1.67,-289.59,-2.74,-2.69)|(348116/362720)] [@Recorded Player#1|(-0.15,-321.04,-2.74,-174.79)|(496474/496474)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3698 ~3699 energy {836045448940874}) <3698.0>",Stage:7,Line:28125},{Raw:"[18:59:02.615] [@Recorded Player#1|(17.56,-308.55,-1.97,68.72)|(449519/449519)] [Guardian of the Fortress {3317793516683264}:81855000601322|(13.49,-310.13,-2.74,65.91)|(1584156/1612089)] [Psychokinetic Blast {3401425119870976}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16521 kinetic {836045448940873}) <16521.0>",Stage:8,Line:30719},{Raw:"[18:59:39.372] [Dread Guard Despoiler {3281324949372928}:81855000614523|(-3.44,-291.60,-2.74,-5.25)|(358150/362720)] [@Recorded Player#1|(-0.92,-319.34,-2.75,163.04)|(306971/496474)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3698 ~3699 energy {836045448940874}) <3698.0>",Stage:9,Line:32826},{Raw:"[19:00:02.436] [Gate Commander Draxus {3303392491339776}:81855000494845|(-3.93,-315.18,-2.72,-68.86)|(3736590/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:34429},{Raw:"[19:00:43.447] [Gate Commander Draxus {3303392491339776}:81855000494845|(-3.93,-315.18,-2.74,-0.35)|(3719445/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:37297}]})
}

V73RecordedSequence15()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[20:54:44.449] [@Recorded Player#1|(7.63,-309.81,-2.74,14.21)|(439655/439655)] [Gate Commander Draxus {3303392491339776}:99445000489157|(0.19,-333.89,-2.75,140.73)|(14605603/14628218)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2657 elemental {836045448940875}) <1993.0>",Stage:1,Line:25892},{Raw:"[20:54:59.042] [@Recorded Player#1|(17.52,-325.14,-2.01,-96.49)|(455149/498325)] [Subteroth {3281320654405632}:99445000499416|(32.70,-326.76,0.01,105.00)|(439572/451385)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11813 kinetic {836045448940873}) <53158.0>",Stage:2,Line:26825},{Raw:"[20:55:15.567] [@Recorded Player#1|(27.31,-324.11,-0.01,-88.75)|(454076/498325)] [Dread Guard Dispatcher {3288141062471680}:99445000509633|(30.32,-324.90,-0.01,90.00)|(392582/403023)] [Discharge {4056527891595264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10441 internal {836045448940876}) <46984.0>",Stage:3,Line:28182},{Raw:"[20:55:42.786] [@Recorded Player#1|(27.11,-321.89,-0.02,-64.97)|(420999/435468)] [Dread Guard Corrupter {3288136767504384}:99445000520811|(28.65,-323.25,-0.01,90.00)|(393037/403023)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3064 elemental {836045448940875}) <3064.0>",Stage:4,Line:29558},{Raw:"[20:56:31.251] [@Recorded Player#1|(-26.63,-322.22,0.06,35.56)|(307212/443604)] [Dread Guard Dismantler {3288029393321984}:99445000542774|(-29.51,-323.20,0.01,-90.00)|(769521/806045)] [Bleeding Offense {4490487092215808}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3978* elemental {836045448940875}) <3978.0>",Stage:5,Line:32803},{Raw:"[20:56:50.639] [@Recorded Player#1|(27.87,-323.56,-0.01,-81.37)|(442490/442490)] [Dread Guard Bulwark {3288145357438976}:99445000550882|(31.24,-324.04,-0.01,74.19)|(399276/403023)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3746 internal {836045448940876}) <3746.0>",Stage:6,Line:34045},{Raw:"[20:57:39.784] [@Recorded Player#1|(0.31,-300.00,-2.49,165.61)|(443604/443604)] [Dread Guard Despoiler {3281324949372928}:99445000577518|(-1.84,-286.16,-2.74,-12.82)|(327731/362720)] [Saber Throw {807788859097427}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (26859* energy {836045448940874}) <26859.0>",Stage:7,Line:37677},{Raw:"[20:58:13.007] [@Recorded Player#1|(9.62,-312.13,-2.74,-117.30)|(419652/442490)] [Guardian of the Fortress {3317793516683264}:99445000592101|(13.49,-310.13,-2.74,90.00)|(1600520/1612089)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6197* ~6198 internal {836045448940876}) <6197.0>",Stage:8,Line:39784},{Raw:"[20:58:36.034] [@Recorded Player#1|(-2.84,-294.83,-2.49,174.57)|(411495/498325)] [Dread Guard Despoiler {3281324949372928}:99445000602901|(-3.68,-289.52,-2.74,0.00)|(348241/362720)] [Dark Charge {3421302228516864}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (850* internal {836045448940876}) <2551.0>",Stage:9,Line:41350},{Raw:"[20:58:54.766] [Gate Commander Draxus {3303392491339776}:99445000489157|(-2.19,-315.72,-2.72,74.09)|(3673480/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:42639},{Raw:"[20:59:27.175] [Gate Commander Draxus {3303392491339776}:99445000489157|(-2.19,-315.72,-2.74,-15.22)|(3673480/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:44925}]})
}

V73RecordedSequence16()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[21:43:16.202] [@Recorded Player#1|(-2.94,-320.23,-2.74,-4.91)|(484478/484478)] [Gate Commander Draxus {3303392491339776}:20845000932382|(0.19,-333.89,-2.75,88.40)|(14610490/14628218)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (617 energy {836045448940874}) <1850.0>",Stage:1,Line:121134},{Raw:"[21:43:29.591] [@Recorded Player#1|(12.39,-324.30,-2.74,-90.02)|(484478/484478)] [Subteroth {3281320654405632}:20845000943980|(31.39,-323.98,-0.01,88.68)|(446209/451385)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (659 energy {836045448940874}) <1977.0>",Stage:2,Line:121909},{Raw:"[21:43:44.853] [@Recorded Player#1|(29.95,-323.62,-0.01,-98.73)|(315363/435260)] [Dread Guard Dispatcher {3288141062471680}:20845000955062|(31.92,-322.77,-0.02,105.00)|(363906/403023)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4539 elemental {836045448940875}) <4539.0>",Stage:3,Line:123389},{Raw:"[21:44:13.390] [@Recorded Player#1|(-29.34,-324.02,0.01,63.93)|(398080/484478)] [Dread Guard Corrupter {3288136767504384}:20845000966194|(-28.69,-326.42,0.01,164.92)|(392379/403023)] [Flame Sweep {814227015073792}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10644* elemental {836045448940875}) <31931.0>",Stage:4,Line:124820},{Raw:"[21:45:04.695] [@Recorded Player#1|(1.46,-325.20,-2.75,-101.16)|(398585/484478)] [Dread Guard Dismantler {3281329244340224}:20845000987443|(26.50,-322.68,0.01,84.38)|(782965/806045)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1114* energy {836045448940874}) <3342.0>",Stage:5,Line:127807},{Raw:"[21:45:23.755] [@Recorded Player#1|(28.74,-324.11,-0.01,-91.55)|(453246/453246)] [Dread Guard Bulwark {3288145357438976}:20845000997015|(31.24,-324.04,-0.01,88.55)|(397963/403023)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5060 internal {836045448940876}) <5060.0>",Stage:6,Line:129120},{Raw:"[21:46:14.002] [Dread Guard Despoiler {3281324949372928}:20845001020690|(-1.60,-287.60,-2.74,-9.39)|(362720/362720)] [@Recorded Player#1|(4.03,-321.60,-2.74,90.42)|(300741/484478)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1174 energy {836045448940874} -shield {836045448945509} (2925 absorbed {836045448945511})) <1174.0>",Stage:7,Line:132575},{Raw:"[21:46:57.864] [@Recorded Player#1|(10.57,-307.49,-2.74,19.28)|(484478/484478)] [Guardian of the Fortress {3317793516683264}:20845001039195|(13.49,-310.13,-2.74,132.04)|(1604401/1612089)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7687 ~7688 elemental {836045448940875}) <23062.0>",Stage:8,Line:135150},{Raw:"[21:47:25.119] [@Recorded Player#1|(-6.78,-303.20,-2.49,-157.45)|(484478/484478)] [Dread Guard Despoiler {3281324949372928}:20845001050382|(-3.68,-289.52,-2.74,0.00)|(354891/362720)] [Shocked {3960050041225514}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (286 energy {836045448940874}) <3430.0>",Stage:9,Line:136856},{Raw:"[21:47:43.925] [Gate Commander Draxus {3303392491339776}:20845000932382|(-12.65,-315.93,-2.76,64.75)|(4147465/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:138240},{Raw:"[21:48:23.035] [Gate Commander Draxus {3303392491339776}:20845000932382|(-12.18,-314.65,-2.74,29.20)|(4147465/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:140832}]})
}

V73RecordedSequence17()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[23:16:05.796] [@Recorded Player#1|(-0.02,-331.15,-2.74,-4.48)|(443782/443782)] [Gate Commander Draxus {3303392491339776}:9064000106770|(0.19,-333.89,-2.74,-122.33)|(14595419/14628218)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11123* energy {836045448940874}) <11123.0>",Stage:1,Line:269536},{Raw:"[23:16:23.613] [@Recorded Player#1|(-3.97,-314.96,-2.74,-33.60)|(443782/443782)] [Subteroth {3281320654405632}:9064000115560|(18.35,-324.66,-1.77,93.31)|(442184/451385)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9201* internal {836045448940876}) <9201.0>",Stage:2,Line:270376},{Raw:"[23:16:35.101] [@Recorded Player#1|(26.15,-322.65,0.01,-96.75)|(464313/492274)] [Dread Guard Dispatcher {3288141062471680}:9064000125069|(31.92,-322.77,-0.02,105.00)|(396802/403023)] [Chained Volts {4483542130098176}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6220 energy {836045448940874}) <18660.0>",Stage:3,Line:271581},{Raw:"[23:17:02.137] [@Recorded Player#1|(-6.44,-321.29,-2.75,73.27)|(435498/443782)] [Dread Guard Corrupter {3288136767504384}:9064000135945|(-28.69,-326.42,0.01,-91.26)|(395136/403023)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7887* internal {836045448940876}) <7887.0>",Stage:4,Line:272950},{Raw:"[23:17:52.157] [@Recorded Player#1|(7.72,-317.78,-2.74,-78.75)|(413645/456254)] [Dread Guard Dismantler {3281329244340224}:9064000160085|(28.87,-322.45,-0.01,90.00)|(782278/806045)] [Shocked {3963919806759210}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (760* energy {836045448940874}) <9121.0>",Stage:5,Line:276439},{Raw:"[23:18:13.569] [@Recorded Player#1|(-11.52,-321.18,-2.74,77.29)|(421252/443782)] [Dread Guard Bulwark {3288145357438976}:9064000169776|(-30.78,-324.34,0.01,-98.92)|(398278/403023)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4745 internal {836045448940876}) <4745.0>",Stage:6,Line:277910},{Raw:"[23:19:04.056] [Dread Guard Despoiler {3281324949372928}:9064000198217|(-2.51,-288.43,-2.74,29.80)|(362720/362720)] [@Recorded Player#1|(-22.29,-322.33,-0.81,22.87)|(469944/492274)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3503 energy {836045448940874}) <3503.0>",Stage:7,Line:281921},{Raw:"[23:19:35.771] [@Recorded Player#1|(9.37,-310.64,-2.74,-106.70)|(432763/456254)] [Guardian of the Fortress {3317793516683264}:9064000213819|(13.49,-310.13,-2.74,90.00)|(1583792/1612089)] [Shocked {3963919806759210}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (574* energy {836045448940874}) <6892.0>",Stage:8,Line:284052},{Raw:"[23:20:04.088] [@Recorded Player#1|(-4.58,-291.30,-2.74,-153.12)|(456254/456254)] [Dread Guard Despoiler {3281324949372928}:9064000225506|(-3.68,-289.52,-2.74,27.06)|(351551/362720)] [Impact Charge {4559163619278848}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11169* kinetic {836045448940873}) <33508.0>",Stage:9,Line:285866},{Raw:"[23:20:23.738] [Gate Commander Draxus {3303392491339776}:9064000106770|(-2.92,-318.25,-2.75,11.31)|(3609940/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:287356},{Raw:"[23:21:02.865] [Gate Commander Draxus {3303392491339776}:9064000106770|(-2.98,-318.32,-2.74,-59.25)|(3609940/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:290103}]})
}

V73RecordedSequence18()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[00:39:01.514] [@Recorded Player#1|(-15.63,-315.61,0.28,-28.29)|(443173/443173)] [Gate Commander Draxus {3303392491339776}:26448000100945|(0.19,-333.89,-2.74,137.59)|(14586302/14628218)] [Electrified Railgun {2302776780521472}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1215 elemental {836045448940875}) <1215.0>",Stage:1,Line:10507},{Raw:"[00:39:19.121] [@Recorded Player#1|(-2.16,-327.89,-2.75,147.71)|(443752/443752)] [Subteroth {3281320654405632}:26448000108641|(-10.28,-322.11,-2.75,-91.57)|(419069/451385)] [Force Scream {998270658674688}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (32317* kinetic {836045448940873}) <32317.0>",Stage:2,Line:11407},{Raw:"[00:39:47.443] [@Recorded Player#1|(-19.68,-321.87,-1.51,79.88)|(443173/443173)] [Dread Guard Dispatcher {3288141062471680}:26448000119857|(-29.80,-322.40,0.01,-90.00)|(397111/403023)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5912* elemental {836045448940875}) <5912.0>",Stage:3,Line:12781},{Raw:"[00:40:11.753] [@Recorded Player#1|(18.46,-319.65,-1.73,-64.69)|(286030/426949)] [Dread Guard Corrupter {3288136767504384}:26448000130170|(28.65,-323.25,-0.01,71.09)|(398219/403023)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4804 internal {836045448940876}) <4804.0>",Stage:4,Line:14130},{Raw:"[00:40:58.792] [@Recorded Player#1|(26.53,-322.11,0.01,-85.22)|(279844/426949)] [Dread Guard Dismantler {3281329244340224}:26448000152291|(27.35,-322.50,-0.01,88.69)|(797686/806045)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8358* internal {836045448940876}) <8358.0>",Stage:5,Line:17372},{Raw:"[00:41:18.792] [@Recorded Player#1|(0.16,-300.99,-2.49,160.01)|(296375/443782)] [Dread Guard Bulwark {3288145357438976}:26448000161365|(-2.03,-289.40,-2.74,-1.56)|(394382/403023)] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8641* kinetic {836045448940873}) <8641.0>",Stage:6,Line:18545},{Raw:"[00:42:11.528] [@Recorded Player#1|(-6.47,-314.07,-2.74,175.53)|(282626/443173)] [Dread Guard Despoiler {3281324949372928}:26448000185468|(-1.97,-286.60,-2.74,28.96)|(359952/362720)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2768 elemental {836045448940875}) <2768.0>",Stage:7,Line:22019}]})
}

V73RecordedSequence19()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[00:44:02.051] [@Recorded Player#1|(-15.54,-315.45,0.28,-40.92)|(443173/443173)] [Gate Commander Draxus {3303392491339776}:26448000201987|(0.19,-333.89,-2.75,139.76)|(14592457/14628218)] [Electrified Railgun {2302776780521472}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1121 elemental {836045448940875}) <1121.0>",Stage:1,Line:24267},{Raw:"[00:44:17.147] [@Recorded Player#1|(1.17,-324.44,-2.75,132.45)|(575560/575560)] [Subteroth {3281320654405632}:26448000211340|(23.49,-325.23,-0.39,81.21)|(425292/451385)] [Saber Throw {807788859097427}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (26093* energy {836045448940874}) <26093.0>",Stage:2,Line:25116},{Raw:"[00:44:31.649] [@Recorded Player#1|(-15.54,-315.45,0.28,-63.15)|(443173/443173)] [Dread Guard Dispatcher {3288141062471680}:26448000220293|(-29.80,-322.40,0.01,-90.00)|(396338/403023)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2812 elemental {836045448940875}) <2812.0>",Stage:3,Line:26354},{Raw:"[00:44:54.957] [@Recorded Player#1|(-15.54,-315.45,0.28,59.72)|(373055/443173)] [Dread Guard Corrupter {3288136767504384}:26448000230430|(-28.69,-326.42,0.01,-90.00)|(400443/403023)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2579 elemental {836045448940875}) <2579.0>",Stage:4,Line:27532},{Raw:"[00:45:44.875] [@Recorded Player#1|(-5.93,-318.54,-2.74,37.41)|(395908/443173)] [Dread Guard Dismantler {3288029393321984}:26448000252237|(-29.51,-323.20,0.01,-90.00)|(801003/806045)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5042* elemental {836045448940875}) <5042.0>",Stage:5,Line:30585},{Raw:"[00:46:05.987] [@Recorded Player#1|(0.77,-292.56,-2.74,143.43)|(379015/443173)] [Dread Guard Bulwark {3288145357438976}:26448000260652|(-2.03,-289.40,-2.74,-2.52)|(400465/403023)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2558 elemental {836045448940875}) <2558.0>",Stage:6,Line:31675}]})
}

V73RecordedSequence20()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[00:47:55.934] [@Recorded Player#1|(-16.07,-315.73,0.28,-60.88)|(443173/443173)] [Gate Commander Draxus {3303392491339776}:26448000277453|(0.19,-333.89,-2.75,-180.00)|(14610552/14628218)] [Electrified Railgun {2302776780521472}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1036 elemental {836045448940875}) <777.0>",Stage:1,Line:34244},{Raw:"[00:48:11.717] [@Recorded Player#1|(-7.31,-321.54,-2.75,107.02)|(443782/443782)] [Subteroth {3281320654405632}:26448000286568|(-19.30,-323.89,-1.60,-72.79)|(422799/451385)] [Saber Throw {807788859097427}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (28586* energy {836045448940874}) <28586.0>",Stage:2,Line:35024},{Raw:"[00:48:23.054] [@Recorded Player#1|(-5.29,-320.41,-2.74,82.01)|(453429/453429)] [Dread Guard Dispatcher {3288141062471680}:26448000295113|(-30.32,-325.96,0.01,-90.00)|(397085/403023)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5937 internal {836045448940876}) <5937.0>",Stage:3,Line:36167},{Raw:"[00:48:44.859] [@Recorded Player#1|(-16.07,-315.73,0.28,54.45)|(443173/443173)] [Dread Guard Corrupter {3288136767504384}:26448000304824|(-28.69,-326.42,0.01,-90.00)|(400443/403023)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2579 elemental {836045448940875}) <2579.0>",Stage:4,Line:37316},{Raw:"[00:49:35.712] [@Recorded Player#1|(0.75,-320.80,-2.75,88.17)|(323988/453429)] [Dread Guard Dismantler {3288029393321984}:26448000323910|(-28.85,-323.10,0.01,-100.63)|(790182/806045)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8917* internal {836045448940876}) <8917.0>",Stage:5,Line:40051}]})
}

V73RecordedSequence21()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[00:51:13.154] [@Recorded Player#1|(8.31,-330.71,-2.74,56.80)|(453429/453429)] [Gate Commander Draxus {3303392491339776}:26448000333860|(0.19,-333.89,-2.75,-248.04)|(14560747/14628218)] [Eradicate {4035839034130432}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (17276* kinetic {836045448940873}) <17276.0>",Stage:1,Line:41376},{Raw:"[00:51:28.445] [@Recorded Player#1|(-7.94,-320.30,-1.28,167.00)|(256840/443782)] [Subteroth {3281320654405632}:26448000341883|(-20.03,-323.77,-1.40,-77.50)|(435807/451385)] [Saber Throw {807788859097427}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15578 energy {836045448940874}) <15578.0>",Stage:2,Line:42100},{Raw:"[00:51:41.287] [@Recorded Player#1|(-15.54,-315.91,0.28,61.44)|(443173/443173)] [Dread Guard Dispatcher {3288141062471680}:26448000350813|(-29.80,-322.40,0.01,-90.00)|(399724/403023)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3299 elemental {836045448940875}) <2474.0>",Stage:3,Line:43216},{Raw:"[00:52:03.586] [@Recorded Player#1|(-15.54,-315.91,0.28,57.07)|(414253/443173)] [Dread Guard Corrupter {3288136767504384}:26448000360709|(-28.69,-326.42,0.01,-90.00)|(400443/403023)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2579 elemental {836045448940875}) <1934.0>",Stage:4,Line:44420},{Raw:"[00:52:48.407] [@Recorded Player#1|(-15.54,-315.91,0.28,-17.07)|(443173/443173)] [Dread Guard Dismantler {3288029393321984}:26448000380783|(-29.51,-323.20,0.01,-90.00)|(801003/806045)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5042* elemental {836045448940875}) <3782.0>",Stage:5,Line:47238},{Raw:"[00:53:08.458] [@Recorded Player#1|(-1.12,-296.91,-2.49,176.34)|(443173/443173)] [Dread Guard Bulwark {3288145357438976}:26448000389013|(-2.03,-289.40,-2.74,17.87)|(400678/403023)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2345 elemental {836045448940875}) <2345.0>",Stage:6,Line:48281},{Raw:"[00:53:59.366] [Dread Guard Despoiler {3281324949372928}:26448000410671|(-1.84,-286.16,-2.74,0.00)|(362720/362720)] [@Recorded Player#1|(-0.61,-326.10,-2.75,7.52)|(0/443782)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4690 energy {836045448940874}) <4690.0>",Stage:7,Line:51209}]})
}

V73RecordedSequence22()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[00:55:16.862] [@Recorded Player#1|(6.13,-332.01,-2.74,71.34)|(426949/426949)] [Gate Commander Draxus {3303392491339776}:26448000412770|(0.19,-333.89,-2.75,110.41)|(14558841/14628218)] [Eradicate {4035839034130432}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15898* kinetic {836045448940873}) <15898.0>",Stage:1,Line:51541},{Raw:"[00:55:31.052] [@Recorded Player#1|(0.75,-327.63,-2.74,-110.13)|(387789/426949)] [Subteroth {3281320654405632}:26448000421145|(29.09,-324.45,-0.02,83.50)|(446581/451385)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4804 internal {836045448940876}) <4804.0>",Stage:2,Line:52251},{Raw:"[00:55:44.176] [@Recorded Player#1|(-15.63,-315.74,0.28,56.53)|(443173/443173)] [Dread Guard Dispatcher {3288141062471680}:26448000429291|(-29.80,-322.40,0.01,-90.00)|(396908/403023)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6114* elemental {836045448940875}) <4586.0>",Stage:3,Line:53392},{Raw:"[00:56:05.674] [@Recorded Player#1|(26.98,-322.45,-0.01,-64.21)|(321300/443752)] [Dread Guard Corrupter {3288136767504384}:26448000438852|(28.65,-323.25,-0.01,90.00)|(353880/403023)] [Bleeding Offense {4490487092215808}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3459* elemental {836045448940875}) <3459.0>",Stage:4,Line:54554},{Raw:"[00:56:47.802] [@Recorded Player#1|(-23.38,-322.71,-0.52,166.55)|(453429/453429)] [Dread Guard Dismantler {3288029393321984}:26448000458080|(-29.51,-323.20,0.01,-90.00)|(793117/806045)] [Discharge {808235535695872}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9375* energy {836045448940874}) <9375.0>",Stage:5,Line:57204},{Raw:"[00:57:04.380] [@Recorded Player#1|(-3.09,-290.70,-2.74,173.80)|(453429/453429)] [Dread Guard Bulwark {3288145357438976}:26448000465800|(-2.03,-289.40,-2.74,0.00)|(390816/403023)] [Lightning Charge {3421035940544512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3686* energy {836045448940874}) <3686.0>",Stage:6,Line:58103},{Raw:"[00:57:55.188] [@Recorded Player#1|(-3.62,-294.83,-2.49,-174.61)|(321867/443173)] [Dread Guard Despoiler {3281324949372928}:26448000490587|(-1.84,-286.16,-2.74,26.78)|(357720/362720)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5000* elemental {836045448940875}) <3750.0>",Stage:7,Line:61510},{Raw:"[00:58:20.406] [@Recorded Player#1|(9.57,-310.36,-2.74,-23.12)|(320037/453429)] [Guardian of the Fortress {3317793516683264}:26448000501692|(13.49,-310.13,-2.74,90.00)|(1579459/1612089)] [Eradicate {4035839034130432}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (20384* kinetic {836045448940873}) <20384.0>",Stage:8,Line:62939},{Raw:"[00:58:46.962] [Dread Guard Despoiler {3281324949372928}:26448000511658|(-3.82,-291.55,-2.74,3.69)|(362720/362720)] [@Recorded Player#1|(-5.61,-318.63,-2.74,-175.83)|(494872/494872)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3559 energy {836045448940874}) <3559.0>",Stage:9,Line:64427},{Raw:"[00:59:02.539] [Gate Commander Draxus {3303392491339776}:26448000412770|(-3.79,-332.20,-2.77,114.61)|(3832675/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:65674},{Raw:"[00:59:35.542] [Gate Commander Draxus {3303392491339776}:26448000412770|(-2.71,-328.14,-2.75,-93.34)|(3832675/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:67770}]})
}

V73RecordedSequence23()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[11:23:26.029] [Gate Commander Draxus {3303392491339776}:7710000133931|(0.19,-333.89,-2.74,120.23)|(14602450/14628218)] [@Recorded Player#1|(-13.74,-306.98,-2.74,-27.83)|(443782/443782)] [Suppresive Fire {3289034415669248}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35503 ~3945 kinetic {836045448940873} (31559 absorbed {836045448945511})) <35503.0>",Stage:1,Line:186714},{Raw:"[11:23:40.080] [@Recorded Player#1|(-4.97,-325.75,-2.75,121.10)|(451550/451550)] [Subteroth {3281320654405632}:7710000143754|(-30.95,-321.61,0.01,-80.37)|(446300/451385)] [Sever Force {813226287693824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5085 internal {836045448940876}) <3814.0>",Stage:2,Line:187565},{Raw:"[11:23:53.978] [@Recorded Player#1|(18.57,-323.86,-1.73,-89.80)|(459684/500487)] [Dread Guard Dispatcher {3288141062471680}:7710000154939|(31.92,-322.77,-0.02,85.53)|(391444/403023)] [Slow Time {981503106351104}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11578 kinetic {836045448940873}) <52102.0>",Stage:3,Line:188876},{Raw:"[11:24:15.407] [@Recorded Player#1|(12.51,-317.57,-2.74,-89.33)|(443782/443782)] [Dread Guard Corrupter {3288136767504384}:7710000165505|(28.65,-323.25,-0.01,90.00)|(386604/403023)] [Penetrating Blasts {3394699201085440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16418* energy {836045448940874}) <16418.0>",Stage:4,Line:190232},{Raw:"[11:25:04.123] [@Recorded Player#1|(-27.58,-323.72,0.01,86.47)|(443782/443782)] [Dread Guard Dismantler {3288029393321984}:7710000190072|(-29.51,-323.20,0.01,-90.00)|(789273/806045)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2936 internal {836045448940876}) <2936.0>",Stage:5,Line:193750},{Raw:"[11:25:25.099] [@Recorded Player#1|(-22.38,-322.72,-0.79,36.72)|(400948/451550)] [Dread Guard Bulwark {3288145357438976}:7710000198781|(-30.78,-324.34,0.01,-68.81)|(394112/403023)] [Sever Force {813226287693824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8911* internal {836045448940876}) <6683.0>",Stage:6,Line:194989},{Raw:"[11:26:15.664] [Dread Guard Despoiler {3281324949372928}:7710000228182|(-1.75,-288.88,-2.74,-2.17)|(362720/362720)] [@Recorded Player#1|(0.11,-334.13,-2.75,-158.50)|(434280/536336)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2067 energy {836045448940874} -shield {836045448945509} (2595 absorbed {836045448945511})) <2067.0>",Stage:7,Line:199034},{Raw:"[11:26:56.701] [@Recorded Player#1|(-4.60,-310.82,-2.74,115.42)|(451550/451550)] [Guardian of the Fortress {3317793516683264}:7710000248057|(-13.68,-306.85,-2.74,-62.01)|(1606545/1612089)] [Sever Force {813226287693824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5543 internal {836045448940876}) <4157.0>",Stage:8,Line:201697},{Raw:"[11:27:20.850] [@Recorded Player#1|(0.72,-295.38,-2.49,132.96)|(500487/500487)] [Dread Guard Despoiler {3281324949372928}:7710000259848|(-3.68,-289.52,-2.74,-37.00)|(343755/362720)] [Project {876461091192832}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18965* kinetic {836045448940873}) <56896.0>",Stage:9,Line:203390},{Raw:"[11:27:40.129] [Gate Commander Draxus {3303392491339776}:7710000133931|(-3.93,-316.54,-2.74,-63.58)|(4010435/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:204924},{Raw:"[11:28:18.245] [Gate Commander Draxus {3303392491339776}:7710000133931|(-4.48,-318.32,-2.74,-4.58)|(4010435/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:207782}]})
}

V73RecordedSequence24()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[23:52:34.116] [@Recorded Player#1|(-1.27,-331.87,-2.75,-33.88)|(501358/501358)] [Gate Commander Draxus {3303392491339776}:106167000103779|(0.19,-333.89,-2.75,-150.53)|(14602315/14628218)] [Combat Technique {979806594269184}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (532 internal {836045448940876}) <1595.0>",Stage:1,Line:12140},{Raw:"[23:52:52.837] [@Recorded Player#1|(2.70,-325.31,-2.74,-76.24)|(448664/448664)] [Subteroth {3281320654405632}:106167000113528|(8.56,-326.86,-2.75,154.24)|(418049/451385)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8542* internal {836045448940876}) <8542.0>",Stage:2,Line:13115},{Raw:"[23:53:04.099] [@Recorded Player#1|(13.12,-318.68,-2.75,-67.31)|(448664/448664)] [Dread Guard Dispatcher {3288141062471680}:106167000123634|(30.32,-324.90,-0.01,95.96)|(397323/403023)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5699 internal {836045448940876}) <5699.0>",Stage:3,Line:14285},{Raw:"[23:53:27.396] [@Recorded Player#1|(16.86,-324.70,-2.13,-105.20)|(448664/448664)] [Dread Guard Corrupter {3288136767504384}:106167000134629|(28.65,-323.25,-0.01,65.76)|(394481/403023)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8542* internal {836045448940876}) <8542.0>",Stage:4,Line:15730},{Raw:"[23:54:17.319] [@Recorded Player#1|(-17.48,-323.38,-2.07,7.58)|(428456/443782)] [Dread Guard Dismantler {3288029393321984}:106167000155840|(-29.51,-323.20,0.01,-70.33)|(779015/806045)] [Plasmatize {3391666954174464}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9625* elemental {836045448940875}) <7219.0>",Stage:5,Line:18722},{Raw:"[23:54:37.465] [@Recorded Player#1|(-1.75,-291.89,-2.74,173.62)|(430286/430286)] [Dread Guard Bulwark {3288145357438976}:106167000164147|(-2.03,-289.40,-2.74,-6.46)|(393053/403023)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9969 energy {836045448940874}) <9969.0>",Stage:6,Line:19835},{Raw:"[23:55:27.242] [@Recorded Player#1|(-2.18,-288.66,-2.74,-172.19)|(438762/443604)] [Dread Guard Despoiler {3281324949372928}:106167000187722|(-1.84,-286.16,-2.74,0.00)|(335332/362720)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9357 energy {836045448940874}) <9357.0>",Stage:7,Line:22935},{Raw:"[23:55:58.081] [@Recorded Player#1|(-2.19,-311.83,-2.74,120.51)|(315587/448664)] [Guardian of the Fortress {3317793516683264}:106167000199574|(-13.68,-306.85,-2.74,-90.00)|(1557288/1612089)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8542* internal {836045448940876}) <8542.0>",Stage:8,Line:24574},{Raw:"[23:56:24.090] [@Recorded Player#1|(-9.32,-308.33,-2.74,117.73)|(430286/430286)] [Dread Guard Despoiler {3281324949372928}:106167000211014|(-3.68,-289.52,-2.74,16.22)|(346937/362720)] [Saber Throw {807788859097427}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15783 energy {836045448940874}) <15783.0>",Stage:9,Line:26228},{Raw:"[23:56:39.109] [Gate Commander Draxus {3303392491339776}:106167000103779|(2.13,-317.22,-2.73,-76.88)|(3632084/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:27406},{Raw:"[23:57:14.319] [Gate Commander Draxus {3303392491339776}:106167000103779|(2.13,-317.22,-2.74,-92.99)|(3632084/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:29686}]})
}

V73RecordedSequence25()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[11:40:02.749] [@Recorded Player#1|(0.17,-313.13,-2.74,3.89)|(442936/442936)] [Gate Commander Draxus {3303392491339776}:20770000421519|(0.19,-333.89,-2.74,131.15)|(14595601/14628218)] [Burning {1202324554907921}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4419* elemental {836045448940875}) <4419.0>",Stage:1,Line:12596},{Raw:"[11:40:15.943] [@Recorded Player#1|(1.46,-319.01,-2.74,-149.24)|(442951/442951)] [Subteroth {3281320654405632}:20770000432131|(30.69,-326.22,0.01,87.30)|(442694/451385)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8691* elemental {836045448940875}) <8691.0>",Stage:2,Line:13360},{Raw:"[11:40:33.693] [@Recorded Player#1|(28.25,-323.74,-0.01,-95.15)|(361841/526229)] [Dread Guard Dispatcher {3288141062471680}:20770000443246|(31.92,-322.77,-0.02,105.00)|(391603/403023)] [Discharge {4056527891595264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11419 internal {836045448940876}) <51386.0>",Stage:3,Line:14823},{Raw:"[11:41:01.338] [@Recorded Player#1|(23.79,-321.80,-0.33,-73.27)|(442951/442951)] [Dread Guard Corrupter {3288136767504384}:20770000453701|(28.65,-323.25,-0.01,67.31)|(398446/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4577 elemental {836045448940875}) <4577.0>",Stage:4,Line:16162},{Raw:"[11:41:50.837] [@Recorded Player#1|(22.05,-323.81,-0.74,-111.60)|(526229/526229)] [Dread Guard Dismantler {3281329244340224}:20770000475076|(28.87,-322.45,-0.01,112.36)|(793149/806045)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12896 kinetic {836045448940873}) <58032.0>",Stage:5,Line:19075},{Raw:"[11:42:10.143] [@Recorded Player#1|(28.91,-324.21,-0.01,-93.95)|(429827/442951)] [Dread Guard Bulwark {3288145357438976}:20770000483101|(31.24,-324.04,-0.01,67.42)|(395287/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7735* elemental {836045448940875}) <7735.0>",Stage:6,Line:20127},{Raw:"[11:43:01.284] [@Recorded Player#1|(-2.11,-287.59,-2.74,164.18)|(259874/442951)] [Dread Guard Despoiler {3281324949372928}:20770000507272|(-1.84,-286.16,-2.74,-30.14)|(352206/362720)] [Fusion Missile {814235605008384}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10515* kinetic {836045448940873}) <10515.0>",Stage:7,Line:23368},{Raw:"[11:43:29.354] [@Recorded Player#1|(-2.21,-310.81,-2.74,117.82)|(526229/526229)] [Guardian of the Fortress {3317793516683264}:20770000518497|(-13.68,-306.85,-2.74,-122.87)|(1600560/1612089)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11529 kinetic {836045448940873}) <51879.0>",Stage:8,Line:24658},{Raw:"[11:44:04.005] [@Recorded Player#1|(7.92,-291.19,-2.74,95.34)|(330132/526229)] [Dread Guard Despoiler {3281324949372928}:20770000528647|(-3.68,-289.52,-2.74,0.00)|(349832/362720)] [Depredating Volts {3408949902573568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12888 energy {836045448940874}) <38665.0>",Stage:9,Line:26029},{Raw:"[11:44:25.418] [Gate Commander Draxus {3303392491339776}:20770000421519|(-2.80,-309.10,-2.64,7.43)|(3494200/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:27165}]})
}

V73RecordedSequence26()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[11:45:56.735] [Gate Commander Draxus {3303392491339776}:20770000541049|(0.19,-333.89,-2.74,143.32)|(14603232/14628218)] [@Recorded Player#1|(-5.91,-325.74,-2.75,-29.51)|(509974/526229)] [Suppresive Fire {3289034415669248}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16254 kinetic {836045448940873} -shield {836045448945509} (16289 absorbed {836045448945511})) <16254.0>",Stage:1,Line:27911},{Raw:"[11:46:11.238] [@Recorded Player#1|(15.80,-326.88,-2.41,-90.32)|(410197/526229)] [Subteroth {3281320654405632}:20770000552257|(31.31,-326.69,0.01,89.58)|(439611/451385)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11774 kinetic {836045448940873}) <52984.0>",Stage:2,Line:28801},{Raw:"[11:46:26.357] [@Recorded Player#1|(22.39,-324.69,-0.65,-96.59)|(338437/526229)] [Dread Guard Dispatcher {3288141062471680}:20770000563177|(30.32,-324.90,-0.01,106.57)|(386619/403023)] [Discharge {4056527891595264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16403* internal {836045448940876}) <73814.0>",Stage:3,Line:30162},{Raw:"[11:46:51.955] [@Recorded Player#1|(25.39,-323.61,0.01,-56.72)|(303174/442951)] [Dread Guard Corrupter {3288136767504384}:20770000572761|(28.65,-323.25,-0.01,69.52)|(394763/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8260* elemental {836045448940875}) <8260.0>",Stage:4,Line:31373},{Raw:"[11:47:35.806] [@Recorded Player#1|(26.25,-322.03,0.01,-97.56)|(384444/443604)] [Dread Guard Dismantler {3281329244340224}:20770000591482|(28.87,-322.45,-0.01,90.00)|(752668/806045)] [Bleeding Offense {4490487092215808}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3703* elemental {836045448940875}) <3703.0>",Stage:5,Line:33974},{Raw:"[11:47:52.324] [@Recorded Player#1|(27.08,-324.12,-0.01,-109.69)|(380010/442951)] [Dread Guard Bulwark {3288145357438976}:20770000598837|(31.24,-324.04,-0.01,74.66)|(394212/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8810* elemental {836045448940875}) <8810.0>",Stage:6,Line:34958},{Raw:"[11:48:42.549] [Dread Guard Despoiler {3281324949372928}:20770000623524|(-0.84,-287.77,-2.74,-33.22)|(362720/362720)] [@Recorded Player#1|(22.96,-324.20,-0.49,-97.70)|(351678/526229)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2237 energy {836045448940874} -shield {836045448945509} (2342 absorbed {836045448945511})) <2237.0>",Stage:7,Line:38261},{Raw:"[11:49:23.770] [@Recorded Player#1|(-10.92,-309.12,-2.74,-158.03)|(526229/526229)] [Guardian of the Fortress {3317793516683264}:20770000641199|(-13.68,-306.85,-2.74,-18.66)|(1607003/1612089)] [Dark Charge {3421302228516864}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (522 internal {836045448940876}) <1567.0>",Stage:8,Line:40610},{Raw:"[11:49:55.541] [@Recorded Player#1|(-7.10,-300.24,-2.49,-163.10)|(376643/526229)] [Dread Guard Despoiler {3281324949372928}:20770000652495|(-3.68,-289.52,-2.74,17.61)|(347197/362720)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15523* energy {836045448940874}) <46570.0>",Stage:9,Line:42191},{Raw:"[11:50:18.417] [Gate Commander Draxus {3303392491339776}:20770000541049|(-10.09,-315.16,-2.75,-73.61)|(3668981/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:43514},{Raw:"[11:51:02.152] [Gate Commander Draxus {3303392491339776}:20770000541049|(-10.09,-315.16,-2.74,52.36)|(3668981/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:45676}]})
}

V73RecordedSequence27()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[10:18:27.692] [@Recorded Player#1|(-16.12,-315.25,0.28,-41.18)|(443559/443559)] [Gate Commander Draxus {3303392491339776}:76914000110918|(0.19,-333.89,-2.75,-180.00)|(14623284/14628218)] [Serrated Shot {3394707791020032}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4934 energy {836045448940874}) <4934.0>",Stage:1,Line:13183},{Raw:"[10:18:43.873] [@Recorded Player#1|(-8.93,-324.28,-2.75,145.37)|(442951/442951)] [Subteroth {3281320654405632}:76914000119710|(-17.30,-324.61,-2.14,-101.02)|(403794/451385)] [Rail Shot {814278554681344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (47592* energy {836045448940874}) <47592.0>",Stage:2,Line:13922},{Raw:"[10:19:00.318] [@Recorded Player#1|(26.45,-322.13,0.01,-59.82)|(479690/484715)] [Dread Guard Dispatcher {3288141062471680}:76914000130754|(30.32,-324.90,-0.01,104.05)|(374596/403023)] [Discharge {4056527891595264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16232* internal {836045448940876}) <73044.0>",Stage:3,Line:15217},{Raw:"[10:19:23.026] [@Recorded Player#1|(-20.32,-324.53,-1.34,81.50)|(418860/442951)] [Dread Guard Corrupter {3288136767504384}:76914000140945|(-28.69,-326.42,0.01,-90.00)|(380629/403023)] [Bleeding (Retractable Blade) {2029831608860928}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3656 internal {836045448940876}) <3656.0>",Stage:4,Line:16471},{Raw:"[10:20:12.745] [@Recorded Player#1|(-26.11,-324.36,0.06,107.90)|(442951/442951)] [Dread Guard Dismantler {3288029393321984}:76914000161369|(-29.51,-323.20,0.01,-104.09)|(793360/806045)] [Bleeding (Retractable Blade) {2029831608860928}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3363 internal {836045448940876}) <3363.0>",Stage:5,Line:19344},{Raw:"[10:20:30.870] [@Recorded Player#1|(23.27,-321.74,-0.47,-66.40)|(450894/450894)] [Dread Guard Bulwark {3288145357438976}:76914000168890|(31.24,-324.04,-0.01,68.06)|(356605/403023)] [Ball Lightning {3408941312638976}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (30341* energy {836045448940874}) <30341.0>",Stage:6,Line:20352},{Raw:"[10:21:20.541] [Dread Guard Despoiler {3281324949372928}:76914000191427|(-1.70,-286.64,-2.74,-16.10)|(362720/362720)] [@Recorded Player#1|(8.25,-320.82,-2.74,49.71)|(258347/484715)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2320 energy {836045448940874} -shield {836045448945509} (2630 absorbed {836045448945511})) <2320.0>",Stage:7,Line:23400},{Raw:"[10:21:52.971] [@Recorded Player#1|(-15.33,-308.72,-2.68,-138.67)|(443604/443604)] [Guardian of the Fortress {3317793516683264}:76914000205722|(-13.68,-306.85,-2.74,41.43)|(1601950/1612089)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10139 energy {836045448940874}) <10139.0>",Stage:8,Line:25414},{Raw:"[10:22:20.732] [@Recorded Player#1|(-0.87,-300.63,-2.49,-179.07)|(484715/484715)] [Dread Guard Despoiler {3281324949372928}:76914000217153|(-3.68,-289.52,-2.74,0.00)|(355395/362720)] [Depredating Volts {3408949902573568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7326 energy {836045448940874}) <21977.0>",Stage:9,Line:27110},{Raw:"[10:22:44.501] [Gate Commander Draxus {3303392491339776}:76914000110918|(-2.90,-318.97,-2.50,79.12)|(3624123/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:28614},{Raw:"[10:23:23.293] [Gate Commander Draxus {3303392491339776}:76914000110918|(-3.59,-313.35,-2.74,68.41)|(3624123/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:30883}]})
}

V73RecordedSequence28()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[21:32:35.407] [@Recorded Player#1|(0.54,-304.81,-2.49,0.68)|(443782/443782)] [Gate Commander Draxus {3303392491339776}:109026000173284|(0.19,-333.89,-2.75,-180.00)|(14614440/14628218)] [Serrated Shot {3394707791020032}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4851 energy {836045448940874}) <4851.0>",Stage:1,Line:68669},{Raw:"[21:32:52.225] [@Recorded Player#1|(1.00,-316.71,-2.74,-1.69)|(443782/443782)] [Subteroth {3281320654405632}:109026000181225|(11.43,-326.74,-2.75,100.30)|(446995/451385)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4390 elemental {836045448940875}) <4390.0>",Stage:2,Line:69654},{Raw:"[21:33:03.842] [Dread Guard Dispatcher {3288141062471680}:109026000191610|(31.92,-322.77,-0.02,78.53)|(403023/403023)] [@Recorded Player#1|(9.74,-327.93,-2.75,76.00)|(385718/480796)] [Force Lightning {3288162537308160}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12556 elemental {836045448940875}) <12556.0>",Stage:3,Line:70841},{Raw:"[21:33:28.045] [@Recorded Player#1|(20.84,-322.56,-1.09,-83.53)|(394497/453276)] [Dread Guard Corrupter {3288136767504384}:109026000202445|(28.65,-323.25,-0.01,67.42)|(383291/403023)] [Squelch {4036075257331712}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (19731* kinetic {836045448940873}) <19731.0>",Stage:4,Line:72259},{Raw:"[21:33:59.427] [@Recorded Player#1|(10.94,-318.11,-2.74,-46.04)|(346775/443782)] [Dread Guard Dismantler {3281329244340224}:109026000215996|(11.37,-326.13,-2.75,76.97)|(801276/806045)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4769 elemental {836045448940875}) <4769.0>",Stage:5,Line:74393},{Raw:"[21:34:18.444] [@Recorded Player#1|(29.34,-323.85,0.73,-83.91)|(453276/453276)] [Dread Guard Bulwark {3288145357438976}:109026000227754|(31.24,-324.04,-0.01,75.91)|(378520/403023)] [Force Technique {979789414400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3390* kinetic {836045448940873}) <3390.0>",Stage:6,Line:75883},{Raw:"[21:35:08.797] [Dread Guard Despoiler {3281324949372928}:109026000253218|(-1.23,-287.32,-2.74,-27.64)|(356864/362720)] [@Recorded Player#1|(18.10,-323.11,-1.85,-107.20)|(355343/480796)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3503 energy {836045448940874}) <3503.0>",Stage:7,Line:79505},{Raw:"[21:35:31.206] [@Recorded Player#1|(-13.57,-309.03,-2.74,-133.86)|(443604/443604)] [Guardian of the Fortress {3317793516683264}:109026000264855|(-13.68,-306.85,-2.74,-99.69)|(1591252/1612089)] [Sundering Assault {807806038966272}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12386 energy {836045448940874}) <12386.0>",Stage:8,Line:81098},{Raw:"[21:35:58.837] [@Recorded Player#1|(-5.26,-291.78,-2.74,165.31)|(472726/480796)] [Dread Guard Despoiler {3281324949372928}:109026000276237|(-3.68,-289.52,-2.74,34.96)|(353156/362720)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9564 energy {836045448940874}) <28693.0>",Stage:9,Line:82844},{Raw:"[21:36:22.712] [Gate Commander Draxus {3303392491339776}:109026000173284|(2.68,-319.67,-2.75,-79.39)|(3574543/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:84379},{Raw:"[21:37:03.725] [Gate Commander Draxus {3303392491339776}:109026000173284|(2.40,-317.49,-2.74,162.58)|(3574543/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:86770}]})
}

V73RecordedSequence29()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[12:06:29.918] [@Recorded Player#1|(-20.24,-314.43,0.29,-44.66)|(443500/443500)] [Gate Commander Draxus {3303392491339776}:73708000117979|(0.19,-333.89,-2.75,-229.28)|(14609939/14628218)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4082* internal {836045448940876}) <4082.0>",Stage:1,Line:14416},{Raw:"[12:06:45.525] [@Recorded Player#1|(15.82,-326.67,-2.41,-97.32)|(407087/498325)] [Subteroth {3281320654405632}:73708000126743|(28.04,-324.46,-0.01,79.49)|(433054/451385)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18332* kinetic {836045448940873}) <82492.0>",Stage:2,Line:15152},{Raw:"[12:07:00.048] [@Recorded Player#1|(24.83,-323.73,0.00,-93.58)|(415151/498325)] [Dread Guard Dispatcher {3288141062471680}:73708000136480|(30.32,-324.90,-0.01,90.00)|(391250/403023)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11773 kinetic {836045448940873}) <52977.0>",Stage:3,Line:16430},{Raw:"[12:07:35.206] [@Recorded Player#1|(-24.40,-323.30,-0.25,76.32)|(443500/443500)] [Dread Guard Corrupter {3288136767504384}:73708000148414|(-28.69,-326.42,0.01,-81.82)|(376955/403023)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4789* internal {836045448940876}) <4789.0>",Stage:4,Line:17935},{Raw:"[12:08:23.029] [@Recorded Player#1|(-26.96,-323.81,0.06,85.46)|(443500/443500)] [Dread Guard Dismantler {3288029393321984}:73708000168123|(-29.51,-323.20,0.01,-90.00)|(792753/806045)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4967* internal {836045448940876}) <4967.0>",Stage:5,Line:20593},{Raw:"[12:08:47.223] [@Recorded Player#1|(-2.83,-291.77,-2.74,-161.47)|(401605/441956)] [Dread Guard Bulwark {3288145357438976}:73708000176587|(-2.03,-289.40,-2.74,-9.95)|(386794/403023)] [Force Leap {812105301229568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16228* energy {836045448940874}) <16228.0>",Stage:6,Line:21781},{Raw:"[12:09:36.664] [Dread Guard Despoiler {3281324949372928}:73708000200056|(-1.52,-287.94,-2.74,-8.77)|(362720/362720)] [@Recorded Player#1|(4.12,-324.33,-2.74,-96.43)|(298537/498325)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2050 energy {836045448940874} -shield {836045448945509} (2835 absorbed {836045448945511})) <2050.0>",Stage:7,Line:25154},{Raw:"[12:10:09.328] [@Recorded Player#1|(-15.14,-308.42,-2.74,179.21)|(381295/443604)] [Guardian of the Fortress {3317793516683264}:73708000214927|(-13.68,-306.85,-2.74,-55.33)|(1561926/1612089)] [Bleeding Offense {4490487092215808}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4060* elemental {836045448940875}) <3045.0>",Stage:8,Line:27131},{Raw:"[12:10:35.307] [@Recorded Player#1|(-5.63,-294.61,-2.49,-166.25)|(482524/498325)] [Dread Guard Despoiler {3281324949372928}:73708000224921|(-3.68,-289.52,-2.74,0.00)|(345512/362720)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (17208* energy {836045448940874}) <51625.0>",Stage:9,Line:28589},{Raw:"[12:10:54.079] [Gate Commander Draxus {3303392491339776}:73708000117979|(-5.19,-318.65,-2.76,77.80)|(4215535/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:29776},{Raw:"[12:11:27.189] [Gate Commander Draxus {3303392491339776}:73708000117979|(-6.02,-317.53,-2.74,15.94)|(4215535/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:32044}]})
}

V73RecordedSequence30()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[01:28:36.930] [@Recorded Player#1|(-1.61,-330.16,-2.74,-26.62)|(443782/443782)] [Gate Commander Draxus {3303392491339776}:62139000094013|(0.19,-333.89,-2.74,-216.64)|(14604876/14628218)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6503 energy {836045448940874}) <19509.0>",Stage:1,Line:11120},{Raw:"[01:28:54.185] [@Recorded Player#1|(-3.67,-325.51,-2.74,125.26)|(443752/443752)] [Subteroth {3281320654405632}:62139000105683|(-14.18,-323.50,-2.75,-86.02)|(419740/451385)] [Force Scream {998270658674688}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31646* kinetic {836045448940873}) <23734.0>",Stage:2,Line:11832},{Raw:"[01:29:05.358] [Dread Guard Dispatcher {3288141062471680}:62139000114679|(31.92,-322.77,-0.02,105.00)|(403023/403023)] [@Recorded Player#1|(15.99,-321.45,-2.39,-69.54)|(436018/443782)] [Force Lightning {3288162537308160}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14242 elemental {836045448940875}) <14242.0>",Stage:3,Line:12967},{Raw:"[01:29:33.422] [@Recorded Player#1|(25.30,-323.73,0.01,-104.60)|(430102/443782)] [Dread Guard Corrupter {3288136767504384}:62139000126329|(28.65,-323.25,-0.01,80.37)|(376220/403023)] [Aegis Assault {3438288824172544}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8946* energy {836045448940874}) <28626.0>",Stage:4,Line:14546},{Raw:"[01:30:20.610] [@Recorded Player#1|(12.17,-317.67,-2.74,-73.23)|(411227/443634)] [Dread Guard Dismantler {3281329244340224}:62139000148459|(28.87,-322.45,-0.01,90.00)|(801107/806045)] [Suppressive Fire {869606323388416}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4937 energy {836045448940874}) <4937.0>",Stage:5,Line:17295},{Raw:"[01:30:38.690] [@Recorded Player#1|(-6.34,-301.27,-2.48,-165.96)|(434978/434978)] [Dread Guard Bulwark {3288145357438976}:62139000156232|(-2.03,-289.40,-2.74,-18.84)|(398317/403023)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4705 internal {836045448940876}) <4705.0>",Stage:6,Line:18324},{Raw:"[01:31:29.598] [Dread Guard Despoiler {3281324949372928}:62139000181798|(-1.61,-287.99,-2.74,-7.19)|(362720/362720)] [@Recorded Player#1|(2.43,-320.49,-2.75,169.54)|(391517/443782)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3305 energy {836045448940874}) <3305.0>",Stage:7,Line:21513},{Raw:"[01:31:59.779] [@Recorded Player#1|(-13.27,-310.17,-2.74,111.17)|(503131/503131)] [Guardian of the Fortress {3317793516683264}:62139000195824|(-13.68,-306.85,-2.74,-22.13)|(1588375/1612089)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10118 energy {836045448940874}) <30355.0>",Stage:8,Line:23454},{Raw:"[01:32:33.551] [@Recorded Player#1|(-5.00,-296.09,-2.49,-123.84)|(503131/503131)] [Dread Guard Despoiler {3281324949372928}:62139000208615|(-3.68,-289.52,-2.74,11.74)|(347651/362720)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15070* energy {836045448940874}) <45209.0>",Stage:9,Line:25302},{Raw:"[01:32:54.260] [Gate Commander Draxus {3303392491339776}:62139000094013|(0.42,-317.50,-2.73,-77.28)|(3891411/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:26539},{Raw:"[01:33:27.089] [Gate Commander Draxus {3303392491339776}:62139000094013|(0.42,-317.50,-2.75,-14.92)|(3891411/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:28881}]})
}

V73RecordedSequence31()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[12:30:33.885] [Gate Commander Draxus {3303392491339776}:28528000119759|(0.19,-333.89,-2.74,171.88)|(14624029/14628218)] [@Recorded Player#1|(-1.42,-321.81,-2.75,-25.70)|(419963/443634)] [Suppresive Fire {3289034415669248}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (34221 kinetic {836045448940873}) <34221.0>",Stage:1,Line:67298},{Raw:"[12:30:50.767] [@Recorded Player#1|(-8.76,-328.54,-2.75,116.11)|(483839/483839)] [Subteroth {3281320654405632}:28528000156782|(-33.27,-321.06,0.02,-72.93)|(445975/451385)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (746 energy {836045448940874}) <2237.0>",Stage:2,Line:68074},{Raw:"[12:31:21.419] [Dread Guard Dispatcher {3288141062471680}:28528000168755|(30.32,-324.90,-0.01,90.99)|(403023/403023)] [@Recorded Player#1|(10.79,-324.52,-2.75,-93.40)|(417623/483839)] [Force Lightning {3288162537308160}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14617 elemental {836045448940875}) <14617.0>",Stage:3,Line:69726},{Raw:"[12:31:51.151] [@Recorded Player#1|(-26.85,-325.55,0.06,48.33)|(424575/443634)] [Dread Guard Corrupter {3288136767504384}:28528000180775|(-28.69,-326.42,0.01,-117.50)|(393065/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9958* elemental {836045448940875}) <9958.0>",Stage:4,Line:71271},{Raw:"[12:32:41.371] [@Recorded Player#1|(-7.79,-318.92,-2.74,63.96)|(384630/443441)] [Dread Guard Dismantler {3288029393321984}:28528000200077|(-29.51,-323.20,0.01,-67.36)|(764001/806045)] [Force in Balance {2157001295527936}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (42043* internal {836045448940876}) <42043.0>",Stage:5,Line:73899},{Raw:"[12:33:19.778] [@Recorded Player#1|(-29.11,-324.51,0.01,97.85)|(443634/443634)] [Dread Guard Bulwark {3288145357438976}:28528000213735|(-30.78,-324.34,0.01,-77.50)|(393945/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9078* elemental {836045448940875}) <9078.0>",Stage:6,Line:75746},{Raw:"[12:34:10.291] [Dread Guard Despoiler {3281324949372928}:28528000236840|(-1.82,-287.55,-2.74,-0.30)|(362720/362720)] [@Recorded Player#1|(-1.56,-325.59,-2.75,176.62)|(188659/483839)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (907 energy {836045448940874} -shield {836045448945509} (4732 absorbed {836045448945511})) <907.0>",Stage:7,Line:78849}]})
}

V73RecordedSequence32()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[12:37:03.013] [@Recorded Player#1|(-2.13,-332.96,-2.75,-68.20)|(483839/483839)] [Gate Commander Draxus {3303392491339776}:28528000247653|(0.19,-333.89,-2.75,-242.21)|(14616368/14628218)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4268 kinetic {836045448940873}) <12804.0>",Stage:1,Line:80445},{Raw:"[12:37:22.812] [@Recorded Player#1|(-5.97,-319.56,-2.74,-4.87)|(483839/483839)] [Subteroth {3281320654405632}:28528000260086|(-4.77,-317.78,-2.75,24.49)|(445749/451385)] [Flame Sweep {814227015073792}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5636 elemental {836045448940875}) <16908.0>",Stage:2,Line:81421},{Raw:"[12:37:38.335] [Dread Guard Dispatcher {3288141062471680}:28528000271615|(30.32,-324.90,-0.01,120.89)|(403023/403023)] [@Recorded Player#1|(12.10,-314.08,-2.74,-51.31)|(475851/483839)] [Force Lightning {3288162537308160}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14617 elemental {836045448940875}) <14617.0>",Stage:3,Line:82771},{Raw:"[12:37:59.285] [@Recorded Player#1|(-27.24,-326.86,0.06,79.34)|(429595/443634)] [Dread Guard Corrupter {3288136767504384}:28528000281995|(-28.69,-326.42,0.01,-74.56)|(393940/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9082* elemental {836045448940875}) <9082.0>",Stage:4,Line:84141},{Raw:"[12:38:49.268] [@Recorded Player#1|(23.13,-323.24,-0.47,-100.28)|(450207/450207)] [Dread Guard Dismantler {3281329244340224}:28528000303741|(28.87,-322.45,-0.01,90.00)|(797182/806045)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8862* internal {836045448940876}) <8862.0>",Stage:5,Line:87000},{Raw:"[12:39:17.996] [@Recorded Player#1|(28.76,-324.38,-0.01,-97.81)|(433528/436314)] [Dread Guard Bulwark {3288145357438976}:28528000314091|(31.24,-324.04,-0.01,82.02)|(393867/403023)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9155 energy {836045448940874}) <9155.0>",Stage:6,Line:88405},{Raw:"[12:40:07.632] [Dread Guard Despoiler {3281324949372928}:28528000339219|(-2.09,-287.52,-2.74,10.25)|(362720/362720)] [@Recorded Player#1|(-8.64,-323.42,-2.74,169.75)|(335413/483839)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3110 energy {836045448940874}) <3110.0>",Stage:7,Line:91759},{Raw:"[12:40:45.234] [@Recorded Player#1|(-9.99,-314.39,-2.74,158.16)|(483839/483839)] [Guardian of the Fortress {3317793516683264}:28528000354075|(-13.68,-306.85,-2.74,-65.06)|(1604454/1612089)] [Shocked {3960050041225514}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (286 energy {836045448940874}) <3430.0>",Stage:8,Line:93720},{Raw:"[12:41:26.798] [Dread Guard Despoiler {3281324949372928}:28528000368051|(-3.95,-291.53,-2.74,0.48)|(362720/362720)] [@Recorded Player#1|(-3.79,-324.27,-2.75,-179.88)|(483839/483839)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1926 energy {836045448940874} -shield {836045448945509} (2715 absorbed {836045448945511})) <1926.0>",Stage:9,Line:95904},{Raw:"[12:41:54.062] [Gate Commander Draxus {3303392491339776}:28528000247653|(7.01,-313.27,-2.68,68.36)|(3663942/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:97204}]})
}

V73RecordedSequence33()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[12:44:13.096] [@Recorded Player#1|(-1.07,-331.60,-2.74,-28.79)|(483839/483839)] [Gate Commander Draxus {3303392491339776}:28528000393985|(0.19,-333.89,-2.75,151.07)|(14623644/14628218)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4574 kinetic {836045448940873}) <13721.0>",Stage:1,Line:99536},{Raw:"[12:44:31.908] [Subteroth {3281320654405632}:28528000402880|(-6.27,-323.04,-2.75,-144.81)|(451385/451385)] [@Recorded Player#1|(-4.48,-319.77,-2.74,57.55)|(483839/483839)] [Melee Attack {3287844709728256}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2559 energy {836045448940874} -shield {836045448945509} (13543 absorbed {836045448945511})) <2559.0>",Stage:2,Line:100363},{Raw:"[12:44:49.043] [@Recorded Player#1|(28.34,-323.84,-0.01,-62.06)|(450207/450207)] [Dread Guard Dispatcher {3288141062471680}:28528000414698|(30.32,-324.90,-0.01,112.71)|(388324/403023)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5063 internal {836045448940876}) <5063.0>",Stage:3,Line:101777},{Raw:"[12:45:11.685] [@Recorded Player#1|(-26.64,-325.29,0.06,87.27)|(443634/443634)] [Dread Guard Corrupter {3288136767504384}:28528000425421|(-28.69,-326.42,0.01,-118.85)|(397699/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5323 elemental {836045448940875}) <5323.0>",Stage:4,Line:103165},{Raw:"[12:46:00.467] [@Recorded Player#1|(-28.65,-325.06,0.01,115.28)|(283740/443634)] [Dread Guard Dismantler {3288029393321984}:28528000447214|(-29.51,-323.20,0.01,-90.00)|(801719/806045)] [Deadly Onslaught {4085454496333824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4325 kinetic {836045448940873}) <4325.0>",Stage:5,Line:106056},{Raw:"[12:46:27.467] [@Recorded Player#1|(-30.03,-323.72,0.01,89.51)|(342797/443634)] [Dread Guard Bulwark {3288145357438976}:28528000457114|(-30.78,-324.34,0.01,-79.09)|(394421/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8602* elemental {836045448940875}) <8602.0>",Stage:6,Line:107524},{Raw:"[12:47:17.669] [Dread Guard Despoiler {3281324949372928}:28528000481296|(-0.20,-288.19,-2.74,-38.70)|(362720/362720)] [@Recorded Player#1|(12.63,-304.15,-2.74,51.64)|(282167/483839)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (902 energy {836045448940874} -shield {836045448945509} (4732 absorbed {836045448945511})) <902.0>",Stage:7,Line:110705},{Raw:"[12:48:08.021] [@Recorded Player#1|(11.13,-310.97,-2.74,-99.56)|(450207/450207)] [Guardian of the Fortress {3317793516683264}:28528000499800|(6.51,-312.30,-2.74,73.17)|(1602493/1612089)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9595* ~9596 internal {836045448940876}) <9595.0>",Stage:8,Line:112989}]})
}

V73RecordedSequence34()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[12:51:09.231] [@Recorded Player#1|(-2.22,-332.67,-2.75,-63.16)|(483839/483839)] [Gate Commander Draxus {3303392491339776}:28528000503643|(0.19,-333.89,-2.75,116.96)|(14623658/14628218)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4560 kinetic {836045448940873}) <13680.0>",Stage:1,Line:113601},{Raw:"[12:51:27.640] [@Recorded Player#1|(-0.23,-315.55,-2.74,-8.51)|(450207/450207)] [Subteroth {3281320654405632}:28528000516598|(8.47,-324.84,-2.75,106.45)|(442523/451385)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8862* internal {836045448940876}) <8862.0>",Stage:2,Line:114402},{Raw:"[12:51:41.364] [Dread Guard Dispatcher {3288141062471680}:28528000525109|(-30.32,-325.96,0.01,-91.62)|(403023/403023)] [@Recorded Player#1|(30.38,-324.77,-0.00,64.96)|(414791/483839)] [Force Lightning {3288162537308160}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15179 elemental {836045448940875}) <15179.0>",Stage:3,Line:115555},{Raw:"[12:52:12.741] [@Recorded Player#1|(-25.95,-324.72,0.06,80.64)|(443634/443634)] [Dread Guard Corrupter {3288136767504384}:28528000537675|(-28.69,-326.42,0.01,-116.12)|(398175/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4847 elemental {836045448940875}) <4847.0>",Stage:4,Line:117143},{Raw:"[12:53:02.679] [@Recorded Player#1|(2.64,-317.50,-2.74,-76.54)|(440872/440872)] [Dread Guard Dismantler {3281329244340224}:28528000560989|(28.87,-322.45,-0.01,90.00)|(766142/806045)] [Twin Saber Throw {3066615239278592}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (38713* ~38714 energy {836045448940874}) <38713.0>",Stage:5,Line:120400},{Raw:"[12:53:33.156] [@Recorded Player#1|(-28.00,-323.65,0.01,76.11)|(209079/443634)] [Dread Guard Bulwark {3288145357438976}:28528000570781|(-30.78,-324.34,0.01,-90.00)|(393364/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9659* elemental {836045448940875}) <9659.0>",Stage:6,Line:121803}]})
}

V73RecordedSequence35()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[12:59:00.660] [@Recorded Player#1|(-2.12,-332.68,-2.75,-62.28)|(483839/483839)] [Gate Commander Draxus {3303392491339776}:28528000583925|(0.19,-333.89,-2.75,-197.72)|(14623829/14628218)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4389 kinetic {836045448940873}) <13166.0>",Stage:1,Line:123651},{Raw:"[12:59:19.393] [Subteroth {3281320654405632}:28528000600912|(3.78,-328.20,-2.74,90.34)|(435756/451385)] [@Recorded Player#1|(-0.61,-328.04,-2.75,-151.92)|(476320/483839)] [Melee Attack {3287844709728256}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5245 energy {836045448940874}) <5245.0>",Stage:2,Line:124535},{Raw:"[12:59:34.676] [@Recorded Player#1|(28.24,-324.04,-0.01,-67.63)|(450207/450207)] [Dread Guard Dispatcher {3288141062471680}:28528000611145|(30.32,-324.90,-0.01,114.03)|(382373/403023)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5063 internal {836045448940876}) <5063.0>",Stage:3,Line:125928},{Raw:"[12:59:59.718] [@Recorded Player#1|(-24.53,-324.13,-0.18,78.26)|(430226/443634)] [Dread Guard Corrupter {3288136767504384}:28528000623030|(-28.69,-326.42,0.01,-81.42)|(397951/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5072 elemental {836045448940875}) <5072.0>",Stage:4,Line:127474},{Raw:"[13:00:49.257] [@Recorded Player#1|(-30.73,-327.15,0.01,174.88)|(412541/443634)] [Dread Guard Dismantler {3288029393321984}:28528000645409|(-29.51,-323.20,0.01,-90.00)|(786694/806045)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4872 elemental {836045448940875}) <4872.0>",Stage:5,Line:130594},{Raw:"[13:01:15.179] [@Recorded Player#1|(-30.11,-324.05,0.01,25.39)|(483839/483839)] [Dread Guard Bulwark {3288145357438976}:28528000655283|(-30.78,-324.34,0.01,-112.14)|(388923/403023)] [Shocked {3960050041225514}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (432* energy {836045448940874}) <5180.0>",Stage:6,Line:131959},{Raw:"[13:02:06.220] [Dread Guard Despoiler {3281324949372928}:28528000681025|(-1.92,-287.55,-2.74,3.45)|(362720/362720)] [@Recorded Player#1|(-3.56,-313.86,-2.74,-174.59)|(298355/483839)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1860 energy {836045448940874} -shield {836045448945509} (2845 absorbed {836045448945511})) <1860.0>",Stage:7,Line:135389},{Raw:"[13:02:51.641] [@Recorded Player#1|(5.29,-311.10,-2.74,-92.33)|(309143/450207)] [Guardian of the Fortress {3317793516683264}:28528000699747|(13.49,-310.13,-2.74,69.27)|(1607026/1612089)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5063 internal {836045448940876}) <5063.0>",Stage:8,Line:137811},{Raw:"[13:03:18.666] [@Recorded Player#1|(0.29,-317.37,-2.74,-139.29)|(482895/483839)] [Dread Guard Despoiler {3281324949372928}:28528000711363|(-3.68,-289.52,-2.74,-8.21)|(359214/362720)] [Pyro Shield {3391379191365632}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3506 elemental {836045448940875}) <10519.0>",Stage:9,Line:139667},{Raw:"[13:03:41.376] [Gate Commander Draxus {3303392491339776}:28528000583925|(3.41,-311.01,-2.65,55.35)|(3500850/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:141156},{Raw:"[13:04:23.397] [Gate Commander Draxus {3303392491339776}:28528000583925|(1.28,-305.73,-2.49,-47.52)|(3500850/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:143510}]})
}

V73RecordedSequence36()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[11:25:46.854] [@Recorded Player#1|(-12.88,-307.41,-2.74,-26.27)|(339559/442594)] [Gate Commander Draxus {3303392491339776}:6822000157733|(0.19,-333.89,-2.75,-228.56)|(14586145/14628218)] [Lethal Shot {3395639798923264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6373 internal {836045448940876}) <6373.0>",Stage:1,Line:16804},{Raw:"[11:26:01.860] [@Recorded Player#1|(-4.40,-317.80,-1.52,176.20)|(440798/442594)] [Subteroth {3281320654405632}:6822000165502|(-23.24,-324.83,-0.54,-83.36)|(434652/451385)] [Lethal Shot {3395639798923264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6373 internal {836045448940876}) <6373.0>",Stage:2,Line:17609},{Raw:"[11:26:22.304] [@Recorded Player#1|(23.16,-314.75,0.93,-43.29)|(453429/453429)] [Dread Guard Dispatcher {3288141062471680}:6822000176956|(30.32,-324.90,-0.01,90.00)|(379968/403023)] [Surging Charge {948659491438592}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6828 internal {836045448940876}) <6828.0>",Stage:3,Line:19035},{Raw:"[11:26:49.872] [@Recorded Player#1|(-30.88,-326.86,0.01,-62.06)|(434366/453429)] [Dread Guard Corrupter {3288136767504384}:6822000189435|(-28.69,-326.42,0.01,69.99)|(342832/403023)] [Maul {808269895434240}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (50515* energy {836045448940874}) <50515.0>",Stage:4,Line:20695},{Raw:"[11:27:34.438] [@Recorded Player#1|(-27.05,-322.04,0.06,13.95)|(453429/453429)] [Dread Guard Dismantler {3288029393321984}:6822000211465|(-29.51,-323.20,0.01,-90.00)|(764788/806045)] [Surging Charge {948659491438592}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11328* internal {836045448940876}) <11328.0>",Stage:5,Line:23846},{Raw:"[11:27:54.775] [@Recorded Player#1|(-28.28,-324.29,0.01,88.91)|(348442/443782)] [Dread Guard Bulwark {3288145357438976}:6822000219330|(-30.78,-324.34,0.01,-90.00)|(394089/403023)] [Force Leap {812105301229568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8934 energy {836045448940874}) <8934.0>",Stage:6,Line:24980},{Raw:"[11:28:44.678] [@Recorded Player#1|(-0.53,-290.59,-2.74,176.77)|(442683/442683)] [Dread Guard Despoiler {3281324949372928}:6822000244622|(-1.84,-286.16,-2.74,0.00)|(331947/362720)] [Burning Offense {4453958395363328}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3489* ~3490 elemental {836045448940875}) <3489.0>",Stage:7,Line:28531},{Raw:"[11:29:11.724] [@Recorded Player#1|(3.89,-314.73,-2.74,-118.92)|(453429/453429)] [Guardian of the Fortress {3317793516683264}:6822000258785|(13.49,-310.13,-2.74,48.38)|(1583033/1612089)] [Surging Charge {948659491438592}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12257* internal {836045448940876}) <12257.0>",Stage:8,Line:30237},{Raw:"[11:29:39.023] [Dread Guard Despoiler {3281324949372928}:6822000269913|(-4.42,-293.17,-2.49,10.61)|(362720/362720)] [@Recorded Player#1|(-7.28,-308.62,-2.49,-176.97)|(465338/500129)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2102 energy {836045448940874} -shield {836045448945509} (3045 absorbed {836045448945511})) <2102.0>",Stage:9,Line:32026},{Raw:"[11:30:02.871] [Gate Commander Draxus {3303392491339776}:6822000157733|(7.60,-325.53,-2.74,-91.24)|(3906204/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:33617},{Raw:"[11:30:41.784] [Gate Commander Draxus {3303392491339776}:6822000157733|(7.60,-325.53,-2.74,5.69)|(3906204/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:36078}]})
}

V73RecordedSequence37()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[19:11:43.092] [@Recorded Player#1|(0.46,-330.83,-2.71,4.89)|(434933/434933)] [Gate Commander Draxus {3303392491339776}:8764000108588|(0.19,-333.89,-2.75,-180.00)|(14612522/14628218)] [Force Leap {812105301229568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7869 energy {836045448940874}) <7869.0>",Stage:1,Line:13238},{Raw:"[19:11:57.482] [@Recorded Player#1|(-26.32,-322.66,-0.04,101.08)|(564121/564121)] [Subteroth {3281320654405632}:8764000117314|(-28.98,-322.18,-0.00,-79.61)|(442367/451385)] [Force Leap {812105301229568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9018 energy {836045448940874}) <9018.0>",Stage:2,Line:14067},{Raw:"[19:12:10.802] [@Recorded Player#1|(-10.64,-310.69,-2.74,-7.47)|(347979/443604)] [Dread Guard Dispatcher {3288141062471680}:8764000126662|(-30.32,-325.96,0.01,-127.71)|(398513/403023)] [Cloak of Pain {2473484550668288}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4510* energy {836045448940874}) <4510.0>",Stage:3,Line:15206}]})
}

V73RecordedSequence38()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[19:13:18.948] [@Recorded Player#1|(1.19,-331.04,-2.74,17.88)|(434933/434933)] [Gate Commander Draxus {3303392491339776}:8764000129790|(0.19,-333.89,-2.75,164.06)|(14612936/14628218)] [Force Leap {812105301229568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7472 energy {836045448940874}) <7472.0>",Stage:1,Line:15632},{Raw:"[19:13:33.644] [@Recorded Player#1|(-30.02,-321.35,-0.14,95.01)|(564121/564121)] [Subteroth {3281320654405632}:8764000140483|(-33.27,-321.06,0.02,-84.85)|(436179/451385)] [Force Leap {812105301229568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15207* energy {836045448940874}) <15207.0>",Stage:2,Line:16461},{Raw:"[19:13:49.970] [@Recorded Player#1|(12.30,-317.74,-2.74,-64.89)|(443173/443173)] [Dread Guard Dispatcher {3288141062471680}:8764000150913|(31.92,-322.77,-0.02,122.00)|(395608/403023)] [Penetrating Blasts {3394699201085440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7414 energy {836045448940874}) <7414.0>",Stage:3,Line:17823},{Raw:"[19:14:13.191] [@Recorded Player#1|(-7.85,-321.40,-2.74,74.10)|(433003/433003)] [Dread Guard Corrupter {3288136767504384}:8764000160642|(-28.69,-326.42,0.01,-71.83)|(341322/403023)] [Ambush {3394042071089152}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (58165* energy {836045448940874}) <43624.0>",Stage:4,Line:19111},{Raw:"[19:14:57.568] [@Recorded Player#1|(21.11,-320.71,-1.04,-73.77)|(355565/484575)] [Dread Guard Dismantler {3281329244340224}:8764000183199|(28.87,-322.45,-0.01,90.00)|(796793/806045)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9251 energy {836045448940874}) <27753.0>",Stage:5,Line:22149},{Raw:"[19:15:14.043] [@Recorded Player#1|(-4.10,-290.80,-2.74,-165.10)|(433003/433003)] [Dread Guard Bulwark {3288145357438976}:8764000190948|(-2.03,-289.40,-2.74,59.14)|(399487/403023)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3536 internal {836045448940876}) <2652.0>",Stage:6,Line:23208},{Raw:"[19:16:04.016] [Dread Guard Despoiler {3281324949372928}:8764000218226|(-0.77,-287.51,-2.74,-35.27)|(356871/362720)] [@Recorded Player#1|(23.44,-322.72,-0.42,-22.05)|(264770/484575)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3503 energy {836045448940874}) <3503.0>",Stage:7,Line:26635},{Raw:"[19:16:31.999] [@Recorded Player#1|(5.86,-316.73,-2.74,-130.11)|(443173/443173)] [Guardian of the Fortress {3317793516683264}:8764000231228|(13.49,-310.13,-2.74,90.00)|(1563384/1612089)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3640 internal {836045448940876}) <3640.0>",Stage:8,Line:28366},{Raw:"[19:17:02.114] [@Recorded Player#1|(-2.96,-295.71,-2.49,188.02)|(484575/484575)] [Dread Guard Despoiler {3281324949372928}:8764000243474|(-3.68,-289.52,-2.74,0.00)|(358021/362720)] [Overload {808282780336128}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4700* energy {836045448940874}) <14099.0>",Stage:9,Line:30056},{Raw:"[19:17:40.540] [Gate Commander Draxus {3303392491339776}:8764000129790|(-2.48,-316.62,-2.73,52.37)|(3965078/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:31644},{Raw:"[19:18:56.939] [Gate Commander Draxus {3303392491339776}:8764000129790|(-2.48,-316.62,-2.74,7.12)|(3965078/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:34702}]})
}

V73RecordedSequence39()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[16:01:07.819] [@Recorded Player#1|(-2.26,-330.04,-2.74,-32.49)|(480499/480499)] [Gate Commander Draxus {3303392491339776}:105610000105613|(0.19,-333.89,-2.74,147.61)|(14607720/14628218)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7899* energy {836045448940874}) <23696.0>",Stage:1,Line:10199},{Raw:"[16:01:23.225] [@Recorded Player#1|(2.09,-325.77,-2.74,-97.42)|(480499/480499)] [Subteroth {3281320654405632}:105610000114483|(17.32,-327.10,-2.05,95.06)|(441520/451385)] [Saber Throw {807788859097427}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9865 energy {836045448940874}) <29594.0>",Stage:2,Line:11020},{Raw:"[16:01:37.726] [@Recorded Player#1|(-23.42,-324.10,-0.45,82.25)|(342063/443530)] [Dread Guard Dispatcher {3288141062471680}:105610000123090|(-30.32,-325.96,0.01,-90.00)|(379670/403023)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10742* elemental {836045448940875}) <10742.0>",Stage:3,Line:12155},{Raw:"[16:02:04.291] [@Recorded Player#1|(-25.70,-325.09,0.06,61.99)|(428179/434814)] [Dread Guard Corrupter {3288136767504384}:105610000133748|(-28.69,-326.42,0.01,-113.90)|(393763/403023)] [Zealous Strike {996200484438016}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4425 energy {836045448940874}) <4425.0>",Stage:4,Line:13491},{Raw:"[16:02:50.386] [@Recorded Player#1|(23.01,-321.98,-0.51,-90.79)|(327030/433523)] [Dread Guard Dismantler {3281329244340224}:105610000153721|(28.87,-322.45,-0.01,90.00)|(801896/806045)] [Force Crush {1148263801552896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4148 kinetic {836045448940873}) <4148.0>",Stage:5,Line:16370},{Raw:"[16:03:10.550] [@Recorded Player#1|(-28.23,-323.61,0.01,78.40)|(435468/435468)] [Dread Guard Bulwark {3288145357438976}:105610000160492|(-30.78,-324.34,0.01,-72.23)|(398064/403023)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4958 elemental {836045448940875}) <4958.0>",Stage:6,Line:17372},{Raw:"[16:04:04.310] [Dread Guard Despoiler {3281324949372928}:105610000184505|(3.62,-306.24,-2.49,17.43)|(362720/362720)] [@Recorded Player#1|(1.40,-312.75,-2.74,-84.41)|(466850/480499)] [Afflict {3320160043663360}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3305 energy {836045448940874}) <3305.0>",Stage:7,Line:20958},{Raw:"[16:04:30.449] [@Recorded Player#1|(13.19,-310.70,-2.74,-151.10)|(427664/443604)] [Guardian of the Fortress {3317793516683264}:105610000196040|(13.49,-310.13,-2.74,51.23)|(1581260/1612089)] [Bleeding Offense {4490487092215808}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3786* elemental {836045448940875}) <3786.0>",Stage:8,Line:22364},{Raw:"[16:04:56.706] [@Recorded Player#1|(-3.04,-293.43,-2.49,171.98)|(480499/480499)] [Dread Guard Despoiler {3281324949372928}:105610000205558|(-3.68,-289.52,-2.74,0.00)|(349887/362720)] [Aegis Assault {3438288824172544}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4220 energy {836045448940874}) <13503.0>",Stage:9,Line:23822},{Raw:"[16:05:16.579] [Gate Commander Draxus {3303392491339776}:105610000105613|(-4.32,-318.75,-2.76,-76.86)|(3637506/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:25065},{Raw:"[16:05:47.783] [Gate Commander Draxus {3303392491339776}:105610000105613|(-4.32,-318.75,-2.74,-28.44)|(3637506/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:27009}]})
}

V73RecordedSequence40()
{
    V73CheckRecordedSequence({Name:"DF-DR recorded sequence",Boss:"DF-DR",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[15:09:44.820] [Gate Commander Draxus {3303392491339776}:55562000089564|(0.19,-333.89,-2.74,172.81)|(14600193/14628218)] [@Recorded Player#1|(-3.75,-326.49,-2.72,-24.32)|(408771/440664)] [Suppresive Fire {3289034415669248}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31893 kinetic {836045448940873}) <31893.0>",Stage:1,Line:19178},{Raw:"[15:09:58.940] [@Recorded Player#1|(13.15,-327.17,-2.75,-100.97)|(443559/443559)] [Subteroth {3281320654405632}:55562000098937|(34.11,-323.68,0.03,76.81)|(435644/451385)] [Saber Throw {807788859097427}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15741 energy {836045448940874}) <15741.0>",Stage:2,Line:20003},{Raw:"[15:10:12.998] [@Recorded Player#1|(16.98,-321.01,-2.10,-77.86)|(443559/443559)] [Dread Guard Dispatcher {3288141062471680}:55562000107419|(30.32,-324.90,-0.01,90.00)|(359530/403023)] [Force Scream {998270658674688}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (30920* kinetic {836045448940873}) <30920.0>",Stage:3,Line:21006},{Raw:"[15:10:34.923] [@Recorded Player#1|(-28.20,-324.60,0.01,82.89)|(261970/443752)] [Dread Guard Corrupter {3288136767504384}:55562000116223|(-28.69,-326.42,0.01,175.98)|(347920/403023)] [Shatter {1169953386397696}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24410* internal {836045448940876}) <24410.0>",Stage:4,Line:22173},{Raw:"[15:11:19.538] [@Recorded Player#1|(25.74,-322.17,0.01,-95.04)|(324509/443559)] [Dread Guard Dismantler {3281329244340224}:55562000135712|(28.87,-322.45,-0.01,90.00)|(740876/806045)] [Sundering Assault {807806038966272}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (20561* energy {836045448940874}) <20561.0>",Stage:5,Line:24915},{Raw:"[15:11:36.840] [@Recorded Player#1|(-3.13,-295.64,-2.49,172.54)|(443173/443173)] [Dread Guard Bulwark {3288145357438976}:55562000143042|(-2.03,-289.40,-2.74,0.00)|(395269/403023)] [Penetrating Blasts {3394699201085440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7753 energy {836045448940874}) <7753.0>",Stage:6,Line:25952},{Raw:"[15:12:26.876] [@Recorded Player#1|(-3.45,-290.02,-2.74,171.25)|(204602/443173)] [Dread Guard Despoiler {3281324949372928}:55562000165372|(-1.84,-286.16,-2.74,8.11)|(319715/362720)] [Penetrating Blasts {3394699201085440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15036* energy {836045448940874}) <15036.0>",Stage:7,Line:28981},{Raw:"[15:12:46.279] [@Recorded Player#1|(8.75,-305.99,-2.74,-48.60)|(388694/440664)] [Guardian of the Fortress {3317793516683264}:55562000174380|(13.49,-310.13,-2.74,118.38)|(1591611/1612089)] [Vigilant Thrust {3503417708249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (20477 ~20478 energy {836045448940874}) <20477.0>",Stage:8,Line:30125},{Raw:"[15:13:08.117] [@Recorded Player#1|(-5.66,-303.64,-2.49,-178.91)|(435198/486768)] [Dread Guard Despoiler {3281324949372928}:55562000183171|(-4.24,-297.10,-2.49,11.60)|(357135/362720)] [Dark Charge {3421302228516864}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (579 internal {836045448940876}) <1738.0>",Stage:9,Line:31468},{Raw:"[15:13:25.937] [Gate Commander Draxus {3303392491339776}:55562000089564|(-1.33,-321.48,-2.76,80.50)|(3811540/14628218)] [=] [ {3321693346988032}] [ApplyEffect {836045448945477}: Emergency Shielding {3321693346988296}]",Stage:10,Line:32566},{Raw:"[15:13:56.502] [Gate Commander Draxus {3303392491339776}:55562000089564|(-1.33,-321.48,-2.75,-39.76)|(3811540/14628218)] [=] [ {3321693346988032}] [RemoveEffect {836045448945478}: Emergency Shielding {3321693346988296}]",Stage:11,Line:34474}]})
}

V73RecordedSequence41()
{
    V73CheckRecordedSequence({Name:"SNV-CW recorded sequence",Boss:"SNV-CW",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:58:29.196] [@Recorded Player#1|(-762.70,-167.62,-11.48,-46.11)|(442995/442995)] [Captain Horic {3054400352288768}:32161001280728|(-758.96,-166.44,-11.48,0.10)|(8133749/8175070)] [Lethal Strike {3403731517308928}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18522 internal {836045448940876}) <18522.0>",Stage:1,Line:171488},{Raw:"[13:58:30.665] [Tu'chuk {3156895451840512}:32161001280600|(-760.53,-171.32,-11.48,28.71)|(8175070/8175070)] [@Recorded Player#1|(-760.67,-170.70,-11.48,-165.52)|(444029/489451)] [Leap {3127148508348416}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (76981 ~45422 kinetic {836045448940873} (31559 absorbed {836045448945511})) <76981.0>",Stage:1,Line:171568},{Raw:"[13:58:35.327] [Vilus Garr {3054408942223360}:32161001280979|(-735.41,-184.77,-11.48,-38.16)|(8175070/8175070)] [@Recorded Player#1|(-726.98,-195.34,-11.48,21.20)|(474990/523134)] [Pistol Shot {3128737646247936}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3772 energy {836045448940874} -shield {836045448945509} (13682 absorbed {836045448945511})) <3772.0>",Stage:1,Line:171876},{Raw:"[13:58:53.651] [@Recorded Player#1|(-762.18,-187.45,-11.48,-10.25)|(487634/523134)] [Sunder {3054404647256064}:32161001280855|(-765.70,-190.59,-11.48,-133.80)|(8162713/8175070)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12357* ~12358 energy {836045448940874}) <37072.0>",Stage:1,Line:173281},{Raw:"[13:59:31.722] [@Recorded Player#1|(-754.62,-167.07,-11.48,101.53)|(201087/442683)] [Captain Horic {3054400352288768}:32161001280728|(-758.96,-166.44,-11.48,-73.62)|(0/8175070)] [] [Event {836045448945472}: Death {836045448945493}]",Stage:2,Line:176077},{Raw:"[14:00:22.648] [@Recorded Player#1|(-751.48,-170.86,-11.48,124.97)|(438601/443203)] [Tu'chuk {3156895451840512}:32161001280600|(-754.18,-168.46,-11.48,50.01)|(0/8175070)] [] [Event {836045448945472}: Death {836045448945493}]",Stage:3,Line:179072},{Raw:"[14:01:32.568] [@Recorded Player#1|(-754.86,-168.83,-11.48,124.05)|(442995/442995)] [Vilus Garr {3054408942223360}:32161001280979|(-757.37,-171.06,-11.48,128.00)|(0/8175070)] [] [Event {836045448945472}: Death {836045448945493}]",Stage:4,Line:182724},{Raw:"[14:03:10.965] [@Recorded Player#1|(-756.09,-181.30,-11.48,-174.57)|(443752/443752)] [Sunder {3054404647256064}:32161001280855|(-756.47,-179.35,-11.48,208.50)|(0/8175070)] [] [Event {836045448945472}: Death {836045448945493}]",Stage:4,Line:187863}]})
}

V73RecordedSequence42()
{
    V73CheckRecordedSequence({Name:"zorn-toth-8m-v1 rule 0",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[16:01:09.816] [Zorn {2857544821243904}:136196000113562|(-107.96,-643.78,-63.37,14.61)|(13010725/16647415)] [=] [Enrage {2857153979219968}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:21166}]})
}

V73RecordedSequence43()
{
    V73CheckRecordedSequence({Name:"zorn-toth-8m-v1 rule 0",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[20:19:11.235] [Toth {2857549116211200}:8871000830221|(-123.99,-621.75,-63.26,53.71)|(14440792/14455011)] [=] [Baradium Poisoning {3004561551785984}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:291}]})
}

V73RecordedSequence44()
{
    V73CheckRecordedSequence({Name:"zorn-toth-8m-v1 rule 1",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[20:25:14.156] [Handler Murdok {2855809654456320}:8871000949741|(-101.57,-605.97,-62.74,-353.42)|(5550624/5573912)] [=] [ {2951510115745792}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:13124}]})
}

V73RecordedSequence45()
{
    V73CheckRecordedSequence({Name:"zorn-toth-8m-v1 rule 1",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[08:22:54.870] [Handler Murdok {2855809654456320}:35561000234881|(-101.57,-605.97,-62.74,-353.42)|(5563490/5573912)] [=] [Reactive Shield {2878044700147712}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:33279}]})
}

V73RecordedSequence46()
{
    V73CheckRecordedSequence({Name:"kephess-undying-8m-v1 rule 0",Boss:"TFB-KE",Area:"137438992720",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[10:39:38.333] [Kephess the Undying {3013121421606912}:87510000759039|(188.40,785.96,0.54,53.16)|(35537512/35557824)] [=] [Wrist Laser {3012636090302464}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:108467}]})
}

V73RecordedSequence47()
{
    V73CheckRecordedSequence({Name:"kephess-undying-8m-v1 rule 0",Boss:"TFB-KE",Area:"137438992720",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[10:16:38.291] [Kephess the Undying {3013121421606912}:7408000614617|(188.40,785.96,0.54,90.00)|(35531376/35557824)] [=] [Wrist Laser {3012636090302464}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:114798}]})
}

V73RecordedSequence48()
{
    V73CheckRecordedSequence({Name:"kephess-undying-8m-v1 rule 1",Boss:"TFB-KE",Area:"137438992720",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[10:41:35.344] [Kephess the Undying {3013121421606912}:87510000759039|(179.14,805.72,0.02,-147.72)|(17041272/35557824)] [=] [Cascade {3008070540066816}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:115220}]})
}

V73RecordedSequence49()
{
    V73CheckRecordedSequence({Name:"kephess-undying-8m-v1 rule 1",Boss:"TFB-KE",Area:"137438992720",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[10:18:33.692] [Kephess the Undying {3013121421606912}:7408000614617|(168.73,770.18,0.11,-97.93)|(17747422/35557824)] [=] [Cascade {3008070540066816}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:122220}]})
}

V73RecordedSequence50()
{
    V73CheckRecordedSequence({Name:"kephess-undying-8m-v1 rule 2",Boss:"TFB-KE",Area:"137438992720",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[10:43:01.345] [Kephess the Undying {3013121421606912}:87510000759039|(140.48,764.57,0.12,74.56)|(3144243/35557824)] [=] [Fury of the Masters {3011399139721216}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:119494}]})
}

V73RecordedSequence51()
{
    V73CheckRecordedSequence({Name:"kephess-undying-8m-v1 rule 2",Boss:"TFB-KE",Area:"137438992720",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[10:20:11.738] [Kephess the Undying {3013121421606912}:7408000614617|(156.96,756.60,0.44,155.80)|(3161752/35557824)] [=] [Fury of the Masters {3011399139721216}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:126727}]})
}

V73RecordedSequence52()
{
    V73CheckRecordedSequence({Name:"corruptor-zero-8m-v1 rule 0",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[00:16:11.542] [Corruptor Zero {3303534225260544}:106167000560828|(-31.01,-636.68,-15.98,-101.99)|(13214305/27001442)] [=] [Fully Powered Blast {3285538312290304}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:83721}]})
}

V73RecordedSequence53()
{
    V73CheckRecordedSequence({Name:"corruptor-zero-8m-v1 rule 0",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[19:12:16.038] [Corruptor Zero {3303534225260544}:81855000892652|(-27.64,-619.14,-15.97,-90.00)|(26914488/27001442)] [=] [ {3344551162937344}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:73584}]})
}

V73RecordedSequence54()
{
    V73CheckRecordedSequence({Name:"corruptor-zero-8m-v1 rule 1",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[19:15:26.812] [Corruptor Zero {3303534225260544}:81855000892652|(-30.43,-636.13,-15.98,66.89)|(6825934/27001442)] [=] [ {3287793170120704}] [ApplyEffect {836045448945477}: Frenzy {3287793170121044}]",Stage:2,Line:86715}]})
}

V73RecordedSequence55()
{
    V73CheckRecordedSequence({Name:"corruptor-zero-8m-v1 rule 1",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[21:10:56.090] [Corruptor Zero {3303534225260544}:99445000848024|(-30.47,-637.45,-15.98,88.67)|(6515990/27001442)] [=] [ {3287793170120704}] [ApplyEffect {836045448945477}: Frenzy {3287793170121044}]",Stage:2,Line:91149}]})
}

V73RecordedSequence56()
{
    V73CheckRecordedSequence({Name:"corruptor-zero-8m-v1 rule 2",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[19:16:01.007] [Corruptor Zero {3303534225260544}:81855000892652|(-19.71,-657.93,-15.50,66.79)|(6825934/27001442)] [=] [ {3321903800385536}] [RemoveEffect {836045448945478}: Invulnerable {3321903800385792}]",Stage:3,Line:88481}]})
}

V73RecordedSequence57()
{
    V73CheckRecordedSequence({Name:"corruptor-zero-8m-v1 rule 2",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[21:11:30.588] [Corruptor Zero {3303534225260544}:99445000848024|(21.97,-619.01,-15.98,-180.00)|(5218234/27001442)] [=] [ {3321903800385536}] [RemoveEffect {836045448945478}: Invulnerable {3321903800385792}]",Stage:3,Line:92787}]})
}

V73RecordedSequence58()
{
    V73CheckRecordedSequence({Name:"writhing-horror-8m-v1 rule 0",Boss:"TFB-WH",Area:"137438992720",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[00:02:20.768] [The Writhing Horror {3010424182145024}:41123000013922|(-50.52,-181.65,20.70,-107.66)|(32506650/32632180)] [=] [Nasty Bite {3010561621098496}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:7813}]})
}

V73RecordedSequence59()
{
    V73CheckRecordedSequence({Name:"writhing-horror-8m-v1 rule 0",Boss:"TFB-WH",Area:"137438992720",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[00:02:22.267] [The Writhing Horror {3010424182145024}:41123000013922|(-50.52,-181.65,20.70,-147.57)|(32204418/32632180)] [=] [Melee Attack {3010578800967680}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:7889}]})
}

V73RecordedSequence60()
{
    V73CheckRecordedSequence({Name:"writhing-horror-8m-v1 rule 1",Boss:"TFB-WH",Area:"137438992720",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[00:05:52.548] [Twisted Spawn {3020465815683072}:41123000155628|(-21.29,-178.91,20.84,-32.32)|(846344/846344)] [@Recorded Player#1|(-10.19,-196.48,21.09,36.25)|(463132/474129)] [Acidic Corrosion (Physical) {2996620157255938}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9771 internal {836045448940876}) <9771.0>",Stage:2,Line:20323}]})
}

V73RecordedSequence61()
{
    V73CheckRecordedSequence({Name:"writhing-horror-8m-v1 rule 1",Boss:"TFB-WH",Area:"137438992720",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[00:05:53.347] [Twisted Spawn {3020465815683072}:41123000157452|(-24.25,-208.72,21.13,-137.83)|(846344/846344)] [@Recorded Player#1|(-12.79,-196.04,20.76,-1.55)|(433469/443782)] [Acidic Corrosion (Physical) {2996620157255938}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10314 internal {836045448940876}) <10314.0>",Stage:2,Line:20368}]})
}

V73RecordedSequence62()
{
    V73CheckRecordedSequence({Name:"titan-six-8m-v1 rule 0",Boss:"SNV-TI",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[12:38:07.406] [Titan 6 {3152458750623744}:32161000165162|(306.42,-179.98,-5.80,-82.21)|(28123670/28131190)] [=] [ {3064892957392896}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:22570}]})
}

V73RecordedSequence63()
{
    V73CheckRecordedSequence({Name:"titan-six-8m-v1 rule 0",Boss:"SNV-TI",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[12:38:07.887] [Titan 6 {3152458750623744}:32161000165162|(306.42,-179.98,-5.80,-82.21)|(28123670/28131190)] [=] [ {3152119448207360}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:22585}]})
}

V73RecordedSequence64()
{
    V73CheckRecordedSequence({Name:"titan-six-8m-v1 rule 1",Boss:"SNV-TI",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[12:44:30.911] [Titan 6 {3152458750623744}:32161000240837|(337.42,-266.99,-5.93,-32.73)|(3843198/28131190)] [=] [Flame Burst {3154765148061696}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:39176}]})
}

V73RecordedSequence65()
{
    V73CheckRecordedSequence({Name:"titan-six-8m-v1 rule 1",Boss:"SNV-TI",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[12:44:34.021] [Titan 6 {3152458750623744}:32161000240837|(337.42,-266.99,-5.93,-32.73)|(3430137/28131190)] [=] [Flame Burst {3154765148061696}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:39323}]})
}

V73RecordedSequence66()
{
    V73CheckRecordedSequence({Name:"olok-8m-v1 rule 0",Boss:"SNV-OL",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:14:01.776] [@Recorded Player#1|(-72.20,-384.97,-64.98,-115.03)|(442995/442995)] [Bodyguard {3061057551597568}:32161000701649|(-60.40,-380.14,-64.98,-22.28)|(915651/930979)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6321* internal {836045448940876}) <6321.0>",Stage:1,Line:86020}]})
}

V73RecordedSequence67()
{
    V73CheckRecordedSequence({Name:"olok-8m-v1 rule 0",Boss:"SNV-OL",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:14:01.142] [@Recorded Player#1|(-59.80,-382.05,-64.98,-91.51)|(495450/495450)] [Wealthy Buyer {3067130635354112}:32161000701781|(-57.52,-381.99,-64.98,87.76)|(925069/930979)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5910 energy {836045448940874}) <17729.0>",Stage:1,Line:86002}]})
}

V73RecordedSequence68()
{
    V73CheckRecordedSequence({Name:"olok-8m-v1 rule 1",Boss:"SNV-OL",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:17:19.599] [@Recorded Player#1|(-65.81,-418.56,-78.13,-10.33)|(443752/443752)] [IA-82 Artillery Droid {3016870928056320}:32161000705340|(-62.97,-420.05,-78.13,125.28)|(2568617/2598034)] [Bleeding Offense {4490487092215808}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3391* elemental {836045448940875}) <3391.0>",Stage:2,Line:94254}]})
}

V73RecordedSequence69()
{
    V73CheckRecordedSequence({Name:"olok-8m-v1 rule 1",Boss:"SNV-OL",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:16:15.377] [@Recorded Player#1|(-62.85,-398.19,-77.98,39.22)|(480086/495450)] [MA-9 Frontline Droid {3016810798514176}:32161000704892|(-38.98,-407.99,-78.13,113.18)|(1716843/1731983)] [Saber Throw {807788859097427}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15140* energy {836045448940874}) <45419.0>",Stage:2,Line:91618}]})
}

V73RecordedSequence70()
{
    V73CheckRecordedSequence({Name:"olok-8m-v1 rule 2",Boss:"SNV-OL",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:20:29.390] [@Recorded Player#1|(-58.75,-455.38,-78.03,-47.86)|(495450/495450)] [Olok the Shadow {3154662068846592}:32161000816671|(-56.87,-456.60,-78.03,129.70)|(18719860/18755626)] [Aegis Assault {3438288824172544}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4518* energy {836045448940874}) <13553.0>",Stage:3,Line:103913}]})
}

V73RecordedSequence71()
{
    V73CheckRecordedSequence({Name:"olok-8m-v1 rule 2",Boss:"SNV-OL",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:32:18.310] [@Recorded Player#1|(-56.72,-452.77,-78.03,4.33)|(442683/442683)] [Olok the Shadow {3154662068846592}:32161000988415|(-56.87,-456.60,-78.03,251.39)|(18680332/18755626)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3870* elemental {836045448940875}) <3870.0>",Stage:3,Line:127500}]})
}

V73RecordedSequence72()
{
    V73CheckRecordedSequence({Name:"cartel-warlords-8m-v1 rule 0",Boss:"SNV-CW",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:40:09.307] [Tu'chuk {3156895451840512}:32161001034954|(-751.81,-162.54,-11.48,-10.96)|(8152316/8175070)] [=] [Destroy Armor {3283107360800768}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:141668}]})
}

V73RecordedSequence73()
{
    V73CheckRecordedSequence({Name:"cartel-warlords-8m-v1 rule 0",Boss:"SNV-CW",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:40:09.408] [Tu'chuk {3156895451840512}:32161001034954|(-751.81,-162.54,-11.48,-10.96)|(8152316/8175070)] [=] [Brutal Blow {3128101991088128}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:141674}]})
}

V73RecordedSequence74()
{
    V73CheckRecordedSequence({Name:"operations-chief-8m-v1 rule 0",Boss:"SNV-OC",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:05:33.599] [@Recorded Player#1|(-170.92,206.61,-74.77,-110.13)|(442594/442594)] [Red Team Flametech {3131391936036864}:32161000609398|(-162.27,210.03,-75.13,71.46)|(767689/802014)] [Responsive Safeguards {4085553280581632}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (34325 kinetic {836045448940873}(reflected {836045448953649}))",Stage:1,Line:74675}]})
}

V73RecordedSequence75()
{
    V73CheckRecordedSequence({Name:"operations-chief-8m-v1 rule 0",Boss:"SNV-OC",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:05:29.315] [@Recorded Player#1|(-181.54,210.60,-74.64,-110.13)|(442594/442594)] [Red Team Assault Gunner {3131387641069568}:32161000609526|(-163.74,213.51,-75.21,45.00)|(777657/802014)] [Burning (Priming Shot) {4322399252119847}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3563 elemental {836045448940875}) <3563.0>",Stage:1,Line:74619}]})
}

V73RecordedSequence76()
{
    V73CheckRecordedSequence({Name:"operations-chief-8m-v1 rule 1",Boss:"SNV-OC",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[13:11:29.676] [@Recorded Player#1|(-114.98,-132.88,-79.48,-122.70)|(442594/442594)] [Operations Chief {3157548286869504}:32161000644323|(-93.74,-112.87,-79.98,2.54)|(11630673/11702574)] [Burning (Priming Shot) {4322399252119847}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3563 elemental {836045448940875}) <3563.0>",Stage:2,Line:81325}]})
}

V73RecordedSequence77()
{
    V73CheckRecordedSequence({Name:"styrak-early-8m-v1 rule 0",Boss:"SNV-ST",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[14:09:04.376] [@Recorded Player#1|(-1008.47,386.45,-35.33,-37.89)|(442683/442683)] [Kell Dragon {3067057620910080}:32161001384252|(-1001.79,383.15,-35.21,-26.36)|(16852980/16878712)] [Searing Wave {3915721683763200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (25731 ~25732 elemental {836045448940875}) <25731.0>",Stage:1,Line:193262}]})
}

V73RecordedSequence78()
{
    V73CheckRecordedSequence({Name:"styrak-early-8m-v1 rule 0",Boss:"SNV-ST",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[14:11:42.867] [@Recorded Player#1|(-1004.29,392.13,-35.45,177.78)|(435891/493768)] [Kell Dragon {3067057620910080}:32161001452964|(-1007.00,438.35,-25.98,-2.05)|(16854642/16878712)] [Discharge {4056527891595264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24071* ~24070 internal {836045448940876}) <108317.0>",Stage:1,Line:199577}]})
}

V73RecordedSequence79()
{
    V73CheckRecordedSequence({Name:"styrak-early-8m-v1 rule 1",Boss:"SNV-ST",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[14:14:11.623] [Dread Master Styrak {3152407211016192}:32161001452827|(-1015.13,437.21,-25.98,0.00)|(29706534/29706534)] [@Recorded Player#1|(-1003.11,372.71,-35.10,176.21)|(488804/498558)] [Mass Force Storm {3218004246528000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9755 energy {836045448940874} -shield {836045448945509} (15332 absorbed {836045448945511})) <9755.0>",Stage:2,Line:208542}]})
}

V73RecordedSequence80()
{
    V73CheckRecordedSequence({Name:"styrak-early-8m-v1 rule 1",Boss:"SNV-ST",Area:"137438993037",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[14:23:09.052] [Dread Master Styrak {3152407211016192}:32161001560424|(-1015.13,437.21,-25.98,0.00)|(29706534/29706534)] [@Recorded Player#1|(-997.86,369.79,-35.04,-158.27)|(235644/443752)] [Mass Force Storm {3218004246528000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8856 energy {836045448940874}) <8856.0>",Stage:2,Line:227932}]})
}

V73RecordedSequence81()
{
    V73CheckRecordedSequence({Name:"Jarg and Sorno",Boss:"KP-JS",Area:"833571547775669",Mode:"836045448953651",Prior:0,Rows:[{Raw:"[22:41:59.360] [@Recorded Player#1|(-171.57,-18.67,22.57,-4.61)|(425778/443559)] [Sorno {2739441810538496}:60734000427853|(-171.34,-21.52,22.58,175.39)|(6455126/6474028)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10700* energy {836045448940874}) <32099.0>",Stage:1,Line:9829},{Raw:"[22:42:58.436] [@Recorded Player#1|(-171.63,-19.44,22.59,75.21)|(386472/443752)] [Sorno {2739441810538496}:60734000427853|(-190.29,-0.11,34.57,-42.39)|(0/15414350)] [] [Event {836045448945472}: Death {836045448945493}]",Stage:2,Line:12876}]})
}

V73RecordedSequence82()
{
    V73CheckRecordedSequence({Name:"Sparky",Boss:"RAV-SP",Area:"3367421863788544",Mode:"836045448953651",Prior:0,Rows:[{Raw:"[05:09:23.821] [@Recorded Player#1|(28.49,95.93,1.80,15.56)|(498076/498076)] [Sparky {3367555007774720}:151759000007917|(25.50,91.79,1.80,214.45)|(11627254/11637834)] [Spike {808312845107200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10522 ~5261 energy {836045448940874} (5261 absorbed {836045448945511})) <31565.0>",Stage:1,Line:297},{Raw:"[05:09:41.273] [Sparky {3367555007774720}:151759000007917|(43.04,74.52,1.80,-150.49)|(10471467/11637834)] [=] [ {3377222979158016}] [ApplyEffect {836045448945477}: Overloaded Shield Collar {3377222979158312}]",Stage:2,Line:1171},{Raw:"[05:10:44.308] [Sparky {3367555007774720}:151759000007917|(47.59,73.67,1.80,120.25)|(2029957/11637834)] [=] [ {3377222979158016}] [ApplyEffect {836045448945477}: Desperation {3377222979158341}]",Stage:3,Line:4003}]})
}

V73RecordedSequence83()
{
    V73CheckRecordedSequence({Name:"Master and Blaster",Boss:"RAV-MB",Area:"3367421863788544",Mode:"836045448953651",Prior:0,Rows:[{Raw:"[05:19:21.223] [@Recorded Player#1|(909.09,-225.07,496.76,-144.41)|(442873/443752)] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-63.87)|(11370983/11406619)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13482* energy {836045448940874}) <13482.0>",Stage:1,Line:22414},{Raw:"[05:19:56.204] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.77)|(5990273/11406619)] [=] [Calling The Boss {3413408078626816}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:24043},{Raw:"[05:20:51.118] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.70)|(2687485/11406619)] [=] [Rejiggering {3486259313901568}] [ApplyEffect {836045448945477}: Rejiggered {3486259313901846}]",Stage:3,Line:26568}]})
}

V73RecordedSequence84()
{
    V73CheckRecordedSequence({Name:"Coratanni / Ruugar",Boss:"RAV-CR",Area:"3367421863788544",Mode:"836045448953651",Prior:0,Rows:[{Raw:"[05:26:26.709] [@Recorded Player#1|(1335.68,-96.58,380.47,15.93)|(443782/443782)] [Pearl {3374109127868416}:151759000226373|(1334.47,-100.93,380.45,-181.58)|(5539231/5549166)] [Jet Charge {814257079844864}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4384 kinetic {836045448940873}) <4384.0>",Stage:1,Line:34549},{Raw:"[05:27:57.534] [Ruugar {3371441953177600}:151759000226873|(1184.02,-411.36,169.07,176.36)|(10188886/10188886)] [@Recorded Player#1|(1187.60,-406.62,169.09,60.97)|(481577/498076)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23824 ~16499 kinetic {836045448940873} -shield {836045448945509} (7325 absorbed {836045448945511})) <23824.0>",Stage:2,Line:38826}]})
}

V73RecordedSequence85()
{
    V73CheckRecordedSequence({Name:"Revanite Commanders",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Prior:0,Rows:[{Raw:"[15:06:26.504] [Outlaw Revanite {3457818040467456}:7472000876008|(305.75,362.26,5.24,-92.14)|(435264/435264)] [@Recorded Player#1|(320.55,362.88,5.09,122.24)|(364635/441614)] [Three Round Burst {3470629927911424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16780 kinetic {836045448940873}) <16780.0>",Stage:1,Line:50439},{Raw:"[15:10:54.317] [Lord Kurse {3456898917466112}:7472000873557|(348.47,363.00,13.41,90.00)|(1989383/7201585)] [=] [ {3462744367955968}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:2,Line:66280}]})
}

V73RecordedSequence86()
{
    V73CheckRecordedSequence({Name:"Revan / Machine Core",Boss:"TOS-RE",Area:"3367426158755840",Mode:"836045448953652",Prior:0,Rows:[{Raw:"[15:13:47.889] [@Recorded Player#1|(466.18,1060.63,273.23,145.20)|(441614/441614)] [Revan {3431605855059968}:7472001032437|(455.50,1076.00,273.23,-34.90)|(26554556/26578348)] [Halted Offensive  {4484383943688192}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23792 energy {836045448940874}) <23792.0>",Stage:1,Line:71250},{Raw:"[15:14:57.710] [@Recorded Player#1|(447.82,1072.53,273.24,9.76)|(442258/443426)] [HK-47 {3444310368321536}:7472001032640|(447.28,1067.02,273.24,-150.95)|(8069236/8101783)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4579 ~4580 elemental {836045448940875}) <4579.0>",Stage:2,Line:75259},{Raw:"[15:15:58.684] [Revan {3431605855059968}:7472001032437|(479.28,1076.97,296.57,56.26)|(17139990/26578348)] [=] [ {3447467169284096}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:3,Line:78852},{Raw:"[15:16:53.091] [Revan {3431605855059968}:7472001032437|(479.37,1077.00,296.57,-183.43)|(17016044/26578348)] [=] [Bloodfury {3478850495315968}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:4,Line:80724},{Raw:"[15:17:59.216] [Revan {3431605855059968}:7472001032437|(488.00,1076.00,320.06,130.15)|(7211559/26578348)] [=] [Resonance {3447578838433792}] [ApplyEffect {836045448945477}: Resonance {3447578838433792}]",Stage:5,Line:84352},{Raw:"[15:18:40.938] [Revan {3431605855059968}:7472001032437|(487.89,1080.88,320.11,264.12)|(6442756/26578348)] [=] [Unstable Aberration {3449073487052800}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:6,Line:85265},{Raw:"[15:19:08.855] [@Recorded Player#1|(484.18,1072.38,320.32,117.62)|(350806/432870)] [Machine Core {3447583133401088}:7472001032236|(469.00,1076.10,317.61,-270.00)|(12102376/12152673)] [Lightning Barrier {3968412342550528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18097* energy {836045448940874}) <18097.0>",Stage:7,Line:86759}]})
}

V73RecordedSequence87()
{
    V73CheckRecordedSequence({Name:"Propagator Core XR-53",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Prior:0,Rows:[{Raw:"[21:16:15.447] [@Recorded Player#1|(-313.98,467.42,17.52,77.84)|(436893/436893)] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-285.22,458.06,17.50,-86.33)|(65309740/65356840)] [Blazing Speed {2303240636989440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1951* ~1952 elemental {836045448940875}) <1464.0>",Stage:1,Line:2810},{Raw:"[21:24:28.904] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-279.54,451.92,17.50,176.28)|(11020501/65356840)] [=] [ {4832147445645312}] [ApplyEffect {836045448945477}: Depleted {4832147445645576}]",Stage:2,Line:42371}]})
}

V73RecordedSequence88()
{
    V73CheckRecordedSequence({Name:"Sparky",Boss:"RAV-SP-V",Area:"3367421863788544",Mode:"836045448953652",Prior:0,Rows:[{Raw:"[21:53:04.561] [Sparky {3458110098243584}:51144000007172|(33.98,87.84,1.80,-60.01)|(20471146/20479506)] [=] [ {3428212830896128}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Stage:1,Line:20017},{Raw:"[21:53:45.084] [Sparky {3458110098243584}:51144000007172|(53.49,88.45,1.79,-85.67)|(18388238/20479506)] [=] [ {3377222979158016}] [ApplyEffect {836045448945477}: Overloaded Shield Collar {3377222979158312}]",Stage:2,Line:22112},{Raw:"[21:56:02.074] [Sparky {3458110098243584}:51144000007172|(59.87,105.31,2.86,89.90)|(4622484/20479506)] [=] [ {3377222979158016}] [ApplyEffect {836045448945477}: Desperation {3377222979158341}]",Stage:3,Line:29705}]})
}

V73RecordedWindowRule1()
{
    V73CheckRecordedRule({Name:"Frenzy",Boss:"KP-FC",Area:"833571547775669",Mode:"836045448953651",Id:"frenzy",Side:"Starts",Raw:"[22:48:27.746] [Foreman Crusher {2739875602235392}:60734000363471|(-747.78,16.12,-10.01,108.87)|(9865461/14027058)] [=] [ {2772186641203200}] [ApplyEffect {836045448945477}: Frenzy {2772186641203460}] (5 charges {836045448953667})",Line:22065})
}

V73RecordedWindowRule2()
{
    V73CheckRecordedRule({Name:"Frenzy",Boss:"KP-FC",Area:"833571547775669",Mode:"836045448953651",Id:"frenzy",Side:"Ends",Raw:"[22:48:30.766] [Foreman Crusher {2739875602235392}:60734000363471|(-748.85,16.56,-10.01,112.10)|(9503966/14027058)] [=] [ {2772186641203200}] [RemoveEffect {836045448945478}: Frenzy {2772186641203460}]",Line:22222})
}

V73RecordedWindowRule3()
{
    V73CheckRecordedRule({Name:"Frenzy",Boss:"KP-FC",Area:"833571547775669",Mode:"836045448953651",Id:"frenzy",Side:"Starts",Raw:"[22:49:24.376] [Foreman Crusher {2739875602235392}:60734000363471|(-748.45,19.24,-10.01,57.96)|(4681605/14027058)] [=] [ {2772186641203200}] [ApplyEffect {836045448945477}: Frenzy {2772186641203460}] (5 charges {836045448953667})",Line:23752})
}

V73RecordedWindowRule4()
{
    V73CheckRecordedRule({Name:"Frenzy",Boss:"KP-FC",Area:"833571547775669",Mode:"836045448953651",Id:"frenzy",Side:"Ends",Raw:"[22:49:27.481] [Foreman Crusher {2739875602235392}:60734000363471|(-747.34,19.85,-10.01,60.30)|(4395856/14027058)] [=] [ {2772186641203200}] [RemoveEffect {836045448945478}: Frenzy {2772186641203460}]",Line:23850})
}

V73RecordedWindowRule5()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA",Area:"833571547775669",Mode:"836045448953651",Id:"melted-armor",Side:"Starts",Raw:"[22:51:40.270] [G4-B3 Heavy Fabricator {2747344550363136}:60734000562440|(-893.00,7.50,-33.98,-90.00)|(21947500/22042522)] [=] [ {2762084878123008}] [ApplyEffect {836045448945477}: Melted Armor (Damage Vulnerability) {2762084878123275}]",Line:26959})
}

V73RecordedWindowRule6()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA",Area:"833571547775669",Mode:"836045448953651",Id:"melted-armor",Side:"Ends",Raw:"[22:52:00.270] [G4-B3 Heavy Fabricator {2747344550363136}:60734000562440|(-893.21,6.31,-33.98,178.04)|(16196181/22042522)] [=] [ {2762084878123008}] [RemoveEffect {836045448945478}: Melted Armor (Damage Vulnerability) {2762084878123275}]",Line:27605})
}

V73RecordedWindowRule7()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA",Area:"833571547775669",Mode:"836045448953651",Id:"melted-armor",Side:"Starts",Raw:"[22:52:28.100] [G4-B3 Heavy Fabricator {2747344550363136}:60734000562440|(-893.21,6.31,-33.98,178.04)|(12748527/22042522)] [=] [ {2762084878123008}] [ApplyEffect {836045448945477}: Melted Armor (Damage Vulnerability) {2762084878123275}]",Line:28692})
}

V73RecordedWindowRule8()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA",Area:"833571547775669",Mode:"836045448953651",Id:"melted-armor",Side:"Ends",Raw:"[22:52:48.299] [G4-B3 Heavy Fabricator {2747344550363136}:60734000562440|(-893.21,6.31,-33.98,178.04)|(5426195/22042522)] [=] [ {2762084878123008}] [RemoveEffect {836045448945478}: Melted Armor (Damage Vulnerability) {2762084878123275}]",Line:29457})
}

V73RecordedWindowRule9()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA",Area:"833571547775669",Mode:"836045448953651",Id:"melted-armor",Side:"Starts",Raw:"[22:53:15.819] [G4-B3 Heavy Fabricator {2747344550363136}:60734000562440|(-893.21,6.31,-33.98,178.04)|(1781314/22042522)] [=] [ {2762084878123008}] [ApplyEffect {836045448945477}: Melted Armor (Damage Vulnerability) {2762084878123275}]",Line:30501})
}

V73RecordedWindowRule10()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA",Area:"833571547775669",Mode:"836045448953651",Id:"melted-armor",Side:"Ends",Raw:"[22:53:20.466] [G4-B3 Heavy Fabricator {2747344550363136}:60734000562440|(-893.21,6.31,-33.98,178.04)|(0/22042522)] [=] [ {2762084878123008}] [RemoveEffect {836045448945478}: Melted Armor (Damage Vulnerability) {2762084878123275}]",Line:30670})
}

V73RecordedWindowRule11()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA",Area:"833571547775669",Mode:"836045448953651",Id:"tunneling-drill",Side:"Starts",Raw:"[22:56:18.187] [Karagga the Unyielding {2740043105959936}:60734000362908|(-1269.92,-2.78,-11.79,156.21)|(12759268/16647499)] [=] [Tunneling Drill {2741443265298432}] [ApplyEffect {836045448945477}: Tunneling Drill {2741443265298432}]",Line:35451})
}

V73RecordedWindowRule12()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA",Area:"833571547775669",Mode:"836045448953651",Id:"tunneling-drill",Side:"Ends",Raw:"[22:56:24.796] [Karagga the Unyielding {2740043105959936}:60734000362908|(-1269.92,-2.78,-11.79,156.21)|(11624745/16647499)] [=] [Tunneling Drill {2741443265298432}] [RemoveEffect {836045448945478}: Tunneling Drill {2741443265298432}]",Line:35785})
}

V73RecordedWindowRule13()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA",Area:"833571547775669",Mode:"836045448953651",Id:"tunneling-drill",Side:"Starts",Raw:"[22:56:42.995] [Karagga the Unyielding {2740043105959936}:60734000362908|(-1270.66,-3.69,-11.79,179.60)|(8976311/16647499)] [=] [Tunneling Drill {2741443265298432}] [ApplyEffect {836045448945477}: Tunneling Drill {2741443265298432}]",Line:36560})
}

V73RecordedWindowRule14()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA",Area:"833571547775669",Mode:"836045448953651",Id:"tunneling-drill",Side:"Ends",Raw:"[22:56:49.600] [Karagga the Unyielding {2740043105959936}:60734000362908|(-1270.66,-3.69,-11.79,179.60)|(8196737/16647499)] [=] [Tunneling Drill {2741443265298432}] [RemoveEffect {836045448945478}: Tunneling Drill {2741443265298432}]",Line:36779})
}

V73RecordedWindowRule15()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA",Area:"833571547775669",Mode:"836045448953651",Id:"tunneling-drill",Side:"Starts",Raw:"[22:57:07.508] [Karagga the Unyielding {2740043105959936}:60734000362908|(-1272.72,-3.26,-11.79,-140.90)|(5845639/16647499)] [=] [Tunneling Drill {2741443265298432}] [ApplyEffect {836045448945477}: Tunneling Drill {2741443265298432}]",Line:37559})
}

V73RecordedWindowRule16()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA",Area:"833571547775669",Mode:"836045448953651",Id:"tunneling-drill",Side:"Ends",Raw:"[22:57:14.104] [Karagga the Unyielding {2740043105959936}:60734000362908|(-1272.72,-3.26,-11.79,-140.90)|(4759003/16647499)] [=] [Tunneling Drill {2741443265298432}] [RemoveEffect {836045448945478}: Tunneling Drill {2741443265298432}]",Line:37860})
}

V73RecordedWindowRule17()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA",Area:"833571547775669",Mode:"836045448953651",Id:"tunneling-drill",Side:"Starts",Raw:"[22:57:33.622] [Karagga the Unyielding {2740043105959936}:60734000362908|(-1273.04,-3.99,-11.79,-115.75)|(2032627/16647499)] [=] [Tunneling Drill {2741443265298432}] [ApplyEffect {836045448945477}: Tunneling Drill {2741443265298432}]",Line:38748})
}

V73RecordedWindowRule18()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA",Area:"833571547775669",Mode:"836045448953651",Id:"tunneling-drill",Side:"Ends",Raw:"[22:57:40.226] [Karagga the Unyielding {2740043105959936}:60734000362908|(-1273.11,-4.02,-11.79,-114.99)|(985102/16647499)] [=] [Tunneling Drill {2741443265298432}] [RemoveEffect {836045448945478}: Tunneling Drill {2741443265298432}]",Line:39069})
}

V73RecordedWindowRule19()
{
    V73CheckRecordedRule({Name:"Rampage",Boss:"RAV-SP",Area:"3367421863788544",Mode:"836045448953651",Id:"rampage",Side:"Starts",Raw:"[05:09:49.680] [Sparky {3367555007774720}:151759000007917|(43.06,74.45,1.80,-167.41)|(9192778/11637834)] [=] [Rampage! {3380452794564608}] [ApplyEffect {836045448945477}: Rampage! {3380452794564608}]",Line:1556})
}

V73RecordedWindowRule20()
{
    V73CheckRecordedRule({Name:"Rampage",Boss:"RAV-SP",Area:"3367421863788544",Mode:"836045448953651",Id:"rampage",Side:"Ends",Raw:"[05:10:01.688] [Sparky {3367555007774720}:151759000007917|(43.68,81.61,1.80,44.09)|(7812676/11637834)] [=] [Rampage! {3380452794564608}] [RemoveEffect {836045448945478}: Rampage! {3380452794564608}]",Line:2027})
}

V73RecordedWindowRule21()
{
    V73CheckRecordedRule({Name:"Emergency shielding",Boss:"TOS-SS",Area:"3367426158755840",Mode:"836045448953652",Id:"emergency-shielding",Side:"Starts",Raw:"[14:57:27.703] [Sword Squadron Unit 1 {3468765912104960}:7472000606520|(-32.30,-5.09,19.51,101.71)|(11962350/15753466)] [=] [Emergency Shielding {3498933762392064}] [ApplyEffect {836045448945477}: Emergency Shielding {3498933762392064}]",Line:24816})
}

V73RecordedWindowRule22()
{
    V73CheckRecordedRule({Name:"Emergency shielding",Boss:"TOS-SS",Area:"3367426158755840",Mode:"836045448953652",Id:"emergency-shielding",Side:"Ends",Raw:"[14:57:33.714] [Sword Squadron Unit 1 {3468765912104960}:7472000606520|(-32.30,-5.09,19.51,33.40)|(11647281/15753466)] [=] [Emergency Shielding {3498933762392064}] [RemoveEffect {836045448945478}: Emergency Shielding {3498933762392064}]",Line:25189})
}

V73RecordedWindowRule23()
{
    V73CheckRecordedRule({Name:"Emergency shielding",Boss:"TOS-SS",Area:"3367426158755840",Mode:"836045448953652",Id:"emergency-shielding",Side:"Starts",Raw:"[14:58:28.552] [Sword Squadron Unit 1 {3468765912104960}:7472000606520|(-32.30,-5.09,19.51,-200.08)|(5309650/15753466)] [=] [Emergency Shielding {3498933762392064}] [ApplyEffect {836045448945477}: Emergency Shielding {3498933762392064}]",Line:28307})
}

V73RecordedWindowRule24()
{
    V73CheckRecordedRule({Name:"Emergency shielding",Boss:"TOS-SS",Area:"3367426158755840",Mode:"836045448953652",Id:"emergency-shielding",Side:"Ends",Raw:"[14:58:33.851] [Sword Squadron Unit 1 {3468765912104960}:7472000606520|(-32.30,-5.09,19.51,68.52)|(4994580/15753466)] [=] [Emergency Shielding {3498933762392064}] [RemoveEffect {836045448945478}: Emergency Shielding {3498933762392064}]",Line:28633})
}

V73RecordedWindowRule25()
{
    V73CheckRecordedRule({Name:"Emergency shielding",Boss:"TOS-SS",Area:"3367426158755840",Mode:"836045448953652",Id:"emergency-shielding",Side:"Starts",Raw:"[14:59:29.297] [Sword Squadron Unit 1 {3468765912104960}:7472000606520|(-32.30,-5.09,19.51,57.79)|(675161/15753466)] [=] [Emergency Shielding {3498933762392064}] [ApplyEffect {836045448945477}: Emergency Shielding {3498933762392064}]",Line:31788})
}

V73RecordedWindowRule26()
{
    V73CheckRecordedRule({Name:"Emergency shielding",Boss:"TOS-SS",Area:"3367426158755840",Mode:"836045448953652",Id:"emergency-shielding",Side:"Starts",Raw:"[15:00:30.337] [Sword Squadron Unit 1 {3468765912104960}:7472000606520|(-32.30,-5.09,19.51,80.43)|(675161/15753466)] [=] [Emergency Shielding {3498933762392064}] [ApplyEffect {836045448945477}: Emergency Shielding {3498933762392064}]",Line:35055})
}

V73RecordedWindowRule27()
{
    V73CheckRecordedRule({Name:"Emergency shielding",Boss:"TOS-SS",Area:"3367426158755840",Mode:"836045448953652",Id:"emergency-shielding",Side:"Ends",Raw:"[15:00:33.039] [Sword Squadron Unit 1 {3468765912104960}:7472000606520|(-32.30,-5.09,19.51,89.74)|(360092/15753466)] [=] [Emergency Shielding {3498933762392064}] [RemoveEffect {836045448945478}: Emergency Shielding {3498933762392064}]",Line:35175})
}

V73RecordedWindowRule28()
{
    V73CheckRecordedRule({Name:"Emergency shielding",Boss:"TOS-SS",Area:"3367426158755840",Mode:"836045448953652",Id:"emergency-shielding",Side:"Ends",Raw:"[15:00:33.039] [Sword Squadron Unit 1 {3468765912104960}:7472000606520|(-32.30,-5.09,19.51,89.74)|(360092/15753466)] [=] [Emergency Shielding {3498933762392064}] [RemoveEffect {836045448945478}: Emergency Shielding {3498933762392064}]",Line:35176})
}

V73RecordedWindowRule29()
{
    V73CheckRecordedRule({Name:"Collapse",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"collapse",Side:"Starts",Raw:"[15:03:18.328] [The Underlurker {3462263331618816}:7472000774602|(190.52,151.69,-15.30,-31.19)|(13779755/17851740)] [=] [Collapse {3411423803736064}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:41446})
}

V73RecordedWindowRule30()
{
    V73CheckRecordedRule({Name:"Collapse",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"collapse",Side:"Ends",Raw:"[15:03:28.836] [The Underlurker {3462263331618816}:7472000774602|(190.52,151.69,-15.30,-31.25)|(11947033/17851740)] [=] [Rage Storm {3411569832624128}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:42395})
}

V73RecordedWindowRule31()
{
    V73CheckRecordedRule({Name:"Collapse",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"collapse",Side:"Starts",Raw:"[15:04:10.860] [The Underlurker {3462263331618816}:7472000774602|(192.79,157.95,-15.30,12.29)|(5754109/17851740)] [=] [Collapse {3411423803736064}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:45268})
}

V73RecordedWindowRule32()
{
    V73CheckRecordedRule({Name:"Collapse",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"collapse",Side:"Ends",Raw:"[15:04:21.458] [The Underlurker {3462263331618816}:7472000774602|(192.79,157.95,-15.30,12.29)|(3986631/17851740)] [=] [Rage Storm {3411569832624128}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:46262})
}

V73RecordedWindowRule33()
{
    V73CheckRecordedRule({Name:"Rage Storm",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"rage-storm",Side:"Starts",Raw:"[15:03:28.836] [The Underlurker {3462263331618816}:7472000774602|(190.52,151.69,-15.30,-31.25)|(11947033/17851740)] [=] [Rage Storm {3411569832624128}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:42395})
}

V73RecordedWindowRule34()
{
    V73CheckRecordedRule({Name:"Rage Storm",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"rage-storm",Side:"Ends",Raw:"[15:03:37.934] [The Underlurker {3462263331618816}:7472000774602|(190.52,151.69,-15.30,-31.25)|(10984563/17851740)] [=] [Leap {3411574127591424}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:42817})
}

V73RecordedWindowRule35()
{
    V73CheckRecordedRule({Name:"Rage Storm",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"rage-storm",Side:"Starts",Raw:"[15:04:21.458] [The Underlurker {3462263331618816}:7472000774602|(192.79,157.95,-15.30,12.29)|(3986631/17851740)] [=] [Rage Storm {3411569832624128}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:46262})
}

V73RecordedWindowRule36()
{
    V73CheckRecordedRule({Name:"Rage Storm",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"rage-storm",Side:"Ends",Raw:"[15:04:30.448] [The Underlurker {3462263331618816}:7472000774602|(192.79,157.95,-15.30,12.29)|(3081575/17851740)] [=] [Leap {3411574127591424}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:46651})
}

V73RecordedWindowRule37()
{
    V73CheckRecordedRule({Name:"Devastation",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"devastation",Side:"Starts",Raw:"[15:03:41.446] [The Underlurker {3462263331618816}:7472000774602|(181.39,162.60,-15.30,-42.94)|(10468835/17851740)] [=] [Devastation {3413575582351360}] [ApplyEffect {836045448945477}: Devastation {3413575582351360}]",Line:42973})
}

V73RecordedWindowRule38()
{
    V73CheckRecordedRule({Name:"Devastation",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"devastation",Side:"Ends",Raw:"[15:03:48.533] [The Underlurker {3462263331618816}:7472000774602|(181.65,162.33,-15.30,-42.94)|(9360479/17851740)] [=] [Devastation {3413575582351360}] [RemoveEffect {836045448945478}: Devastation {3413575582351360}]",Line:43303})
}

V73RecordedWindowRule39()
{
    V73CheckRecordedRule({Name:"Devastation",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"devastation",Side:"Starts",Raw:"[15:04:33.962] [The Underlurker {3462263331618816}:7472000774602|(207.09,159.82,-15.30,40.00)|(2575019/17851740)] [=] [Devastation {3413575582351360}] [ApplyEffect {836045448945477}: Devastation {3413575582351360}]",Line:46816})
}

V73RecordedWindowRule40()
{
    V73CheckRecordedRule({Name:"Devastation",Boss:"TOS-UL",Area:"3367426158755840",Mode:"836045448953652",Id:"devastation",Side:"Ends",Raw:"[15:04:41.058] [The Underlurker {3462263331618816}:7472000774602|(206.94,159.63,-15.30,40.00)|(1310838/17851740)] [=] [Devastation {3413575582351360}] [RemoveEffect {836045448945478}: Devastation {3413575582351360}]",Line:47189})
}

V73RecordedWindowRule41()
{
    V73CheckRecordedRule({Name:"Deron active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"deron-active",Side:"Starts",Raw:"[15:06:46.365] [Deron Cadoruso {3456890327531520}:7472000873280|(325.00,380.50,5.23,101.38)|(7142092/7201585)] [=] [ {3461713575804928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:51840})
}

V73RecordedWindowRule42()
{
    V73CheckRecordedRule({Name:"Deron active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"deron-active",Side:"Ends",Raw:"[15:07:03.395] [Deron Cadoruso {3456890327531520}:7472000873280|(335.81,356.16,5.16,170.53)|(4365813/7201585)] [=] [ {3476930644934656}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:52834})
}

V73RecordedWindowRule43()
{
    V73CheckRecordedRule({Name:"Deron active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"deron-active",Side:"Starts",Raw:"[15:09:06.357] [Deron Cadoruso {3456890327531520}:7472000873280|(325.00,380.50,5.23,31.78)|(4365813/7201585)] [=] [ {3461713575804928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:59315})
}

V73RecordedWindowRule44()
{
    V73CheckRecordedRule({Name:"Deron active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"deron-active",Side:"Ends",Raw:"[15:09:21.771] [Deron Cadoruso {3456890327531520}:7472000873280|(325.00,380.54,5.23,-45.65)|(2009029/7201585)] [=] [ {3476930644934656}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:60355})
}

V73RecordedWindowRule45()
{
    V73CheckRecordedRule({Name:"Deron active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"deron-active",Side:"Ends",Raw:"[15:10:54.531] [Deron Cadoruso {3456890327531520}:7472000873280|(325.00,378.93,5.21,-46.75)|(2009029/7201585)] [=] [ {3462744367955968}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:66294})
}

V73RecordedWindowRule46()
{
    V73CheckRecordedRule({Name:"Sano active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"sano-active",Side:"Starts",Raw:"[15:07:37.612] [Sano Thrica {3456894622498816}:7472000873418|(307.00,363.00,5.23,-112.07)|(7201585/7201585)] [=] [ {3461713575804928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:54413})
}

V73RecordedWindowRule47()
{
    V73CheckRecordedRule({Name:"Sano active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"sano-active",Side:"Ends",Raw:"[15:07:53.616] [Sano Thrica {3456894622498816}:7472000873418|(313.36,361.10,5.15,-113.51)|(4723373/7201585)] [=] [ {3476930644934656}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:55353})
}

V73RecordedWindowRule48()
{
    V73CheckRecordedRule({Name:"Sano active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"sano-active",Side:"Starts",Raw:"[15:09:52.780] [Sano Thrica {3456894622498816}:7472000873418|(308.45,363.06,5.22,-97.07)|(4709834/7201585)] [=] [ {3461713575804928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:61941})
}

V73RecordedWindowRule49()
{
    V73CheckRecordedRule({Name:"Sano active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"sano-active",Side:"Ends",Raw:"[15:10:09.096] [Sano Thrica {3456894622498816}:7472000873418|(306.04,360.33,5.26,146.18)|(2123701/7201585)] [=] [ {3476930644934656}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:63090})
}

V73RecordedWindowRule50()
{
    V73CheckRecordedRule({Name:"Sano active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"sano-active",Side:"Ends",Raw:"[15:10:54.932] [Sano Thrica {3456894622498816}:7472000873418|(307.00,363.00,5.23,-86.18)|(2123701/7201585)] [=] [ {3462744367955968}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:66329})
}

V73RecordedWindowRule51()
{
    V73CheckRecordedRule({Name:"Kurse active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"kurse-active",Side:"Starts",Raw:"[15:08:21.035] [Lord Kurse {3456898917466112}:7472000873557|(342.50,363.00,5.23,71.66)|(7194397/7201585)] [=] [ {3461713575804928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:56709})
}

V73RecordedWindowRule52()
{
    V73CheckRecordedRule({Name:"Kurse active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"kurse-active",Side:"Ends",Raw:"[15:08:41.524] [Lord Kurse {3456898917466112}:7472000873557|(336.50,359.67,5.08,39.78)|(4697985/7201585)] [=] [ {3476930644934656}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:58049})
}

V73RecordedWindowRule53()
{
    V73CheckRecordedRule({Name:"Kurse active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"kurse-active",Side:"Starts",Raw:"[15:10:32.692] [Lord Kurse {3456898917466112}:7472000873557|(342.50,363.00,5.23,-161.39)|(4697985/7201585)] [=] [ {3461713575804928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:64613})
}

V73RecordedWindowRule54()
{
    V73CheckRecordedRule({Name:"Kurse active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"kurse-active",Side:"Ends",Raw:"[15:10:52.825] [Lord Kurse {3456898917466112}:7472000873557|(345.90,362.25,5.45,27.87)|(1989383/7201585)] [=] [ {3476930644934656}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:66172})
}

V73RecordedWindowRule55()
{
    V73CheckRecordedRule({Name:"Kurse active",Boss:"TOS-CO",Area:"3367426158755840",Mode:"836045448953652",Id:"kurse-active",Side:"Ends",Raw:"[15:10:54.317] [Lord Kurse {3456898917466112}:7472000873557|(348.47,363.00,13.41,90.00)|(1989383/7201585)] [=] [ {3462744367955968}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:66280})
}

V73RecordedWindowRule56()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Starts",Raw:"[15:48:48.413] [Colossal Monolith {3570947479044096}:8368000212128|(920.93,-104.44,35.39,-216.48)|(35657604/47935552)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:132662})
}

V73RecordedWindowRule57()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Ends",Raw:"[15:48:58.019] [Colossal Monolith {3570947479044096}:8368000212128|(921.24,-104.85,35.39,143.42)|(35610256/47935552)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:133075})
}

V73RecordedWindowRule58()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Starts",Raw:"[15:49:59.249] [Colossal Monolith {3570947479044096}:8368000212128|(912.54,-124.21,35.61,57.58)|(29083886/47935552)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:136113})
}

V73RecordedWindowRule59()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Ends",Raw:"[15:50:08.751] [Colossal Monolith {3570947479044096}:8368000212128|(911.38,-124.94,35.57,57.58)|(29082964/47935552)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:136486})
}

V73RecordedWindowRule60()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Starts",Raw:"[15:51:11.319] [Colossal Monolith {3570947479044096}:8368000212128|(921.01,-133.74,35.59,32.04)|(23086958/47935552)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:139504})
}

V73RecordedWindowRule61()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Ends",Raw:"[15:51:17.520] [Colossal Monolith {3570947479044096}:8368000212128|(920.49,-134.67,35.53,32.20)|(23014526/47935552)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:139904})
}

V73RecordedWindowRule62()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Starts",Raw:"[15:52:22.047] [Colossal Monolith {3570947479044096}:8368000212128|(915.39,-110.54,35.13,-268.85)|(14455896/47935552)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:143181})
}

V73RecordedWindowRule63()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Ends",Raw:"[15:52:29.644] [Colossal Monolith {3570947479044096}:8368000212128|(915.21,-110.53,35.14,-268.85)|(14395746/47935552)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:143505})
}

V73RecordedWindowRule64()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Starts",Raw:"[15:53:33.090] [Colossal Monolith {3570947479044096}:8368000212128|(922.76,-121.61,35.49,139.99)|(7404748/47935552)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:146300})
}

V73RecordedWindowRule65()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Ends",Raw:"[15:53:41.002] [Colossal Monolith {3570947479044096}:8368000212128|(922.25,-121.00,35.53,139.99)|(7388638/47935552)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:146656})
}

V73RecordedWindowRule66()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Starts",Raw:"[15:54:44.147] [Colossal Monolith {3570947479044096}:8368000212128|(934.62,-134.78,35.66,-30.78)|(1095950/47935552)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:149165})
}

V73RecordedWindowRule67()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO",Area:"3541801830973440",Mode:"836045448953652",Id:"breaking-the-rift",Side:"Ends",Raw:"[15:54:55.755] [Colossal Monolith {3570947479044096}:8368000212128|(934.66,-134.85,35.65,-30.78)|(1091317/47935552)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:149674})
}

V73RecordedWindowRule68()
{
    V73CheckRecordedRule({Name:"Prime Directive",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"prime-directive",Side:"Starts",Raw:"[21:18:15.128] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-277.95,455.00,17.50,-110.50)|(46968252/65356840)] [=] [Prime Directive {4859643826274304}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:12412})
}

V73RecordedWindowRule69()
{
    V73CheckRecordedRule({Name:"Prime Directive",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"prime-directive",Side:"Ends",Raw:"[21:18:59.746] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-278.41,455.29,17.50,-122.10)|(45249612/65356840)] [=] [Sample Materials {4859540747059200}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:15389})
}

V73RecordedWindowRule70()
{
    V73CheckRecordedRule({Name:"Prime Directive",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"prime-directive",Side:"Starts",Raw:"[21:20:59.704] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-271.01,455.05,17.50,124.32)|(32344604/65356840)] [=] [Prime Directive {4859643826274304}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:24965})
}

V73RecordedWindowRule71()
{
    V73CheckRecordedRule({Name:"Prime Directive",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"prime-directive",Side:"Ends",Raw:"[21:21:44.110] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-280.05,456.59,17.50,114.15)|(28635542/65356840)] [=] [Sample Materials {4859540747059200}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:28782})
}

V73RecordedWindowRule72()
{
    V73CheckRecordedRule({Name:"Prime Directive",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"prime-directive",Side:"Starts",Raw:"[21:23:45.495] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-280.55,451.59,17.50,-50.57)|(12925645/65356840)] [=] [Prime Directive {4859643826274304}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:38626})
}

V73RecordedWindowRule73()
{
    V73CheckRecordedRule({Name:"Prime Directive",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"prime-directive",Side:"Ends",Raw:"[21:24:29.004] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-279.54,451.92,17.50,176.28)|(11020501/65356840)] [=] [Sample Materials {4859540747059200}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:42374})
}

V73RecordedWindowRule74()
{
    V73CheckRecordedRule({Name:"Preservation shield",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"preservation-shield",Side:"Starts",Raw:"[21:19:02.350] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-278.41,455.29,17.50,-121.53)|(45249612/65356840)] [=] [Sample Materials {4859540747059200}] [ApplyEffect {836045448945477}: Preservation Shield {4859540747059512}]",Line:15559})
}

V73RecordedWindowRule75()
{
    V73CheckRecordedRule({Name:"Preservation shield",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"preservation-shield",Side:"Ends",Raw:"[21:19:21.957] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-274.95,461.88,17.50,10.96)|(45249612/65356840)] [=] [Sample Materials {4859540747059200}] [RemoveEffect {836045448945478}: Preservation Shield {4859540747059512}]",Line:17185})
}

V73RecordedWindowRule76()
{
    V73CheckRecordedRule({Name:"Preservation shield",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"preservation-shield",Side:"Starts",Raw:"[21:21:46.622] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-280.05,456.59,17.50,114.15)|(28475206/65356840)] [=] [Sample Materials {4859540747059200}] [ApplyEffect {836045448945477}: Preservation Shield {4859540747059512}]",Line:29025})
}

V73RecordedWindowRule77()
{
    V73CheckRecordedRule({Name:"Preservation shield",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"preservation-shield",Side:"Ends",Raw:"[21:21:54.412] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-279.95,453.66,17.50,-36.77)|(28345808/65356840)] [=] [Sample Materials {4859540747059200}] [RemoveEffect {836045448945478}: Preservation Shield {4859540747059512}]",Line:29662})
}

V73RecordedWindowRule78()
{
    V73CheckRecordedRule({Name:"Preservation shield",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"preservation-shield",Side:"Starts",Raw:"[21:24:31.633] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-279.54,451.92,17.50,176.28)|(11020501/65356840)] [=] [Sample Materials {4859540747059200}] [ApplyEffect {836045448945477}: Preservation Shield {4859540747059514}]",Line:42565})
}

V73RecordedWindowRule79()
{
    V73CheckRecordedRule({Name:"Preservation shield",Boss:"XR-53",Area:"945872057669657",Mode:"836045448953655",Id:"preservation-shield",Side:"Ends",Raw:"[21:25:06.449] [Propagator Core XR-53 {4847325860069376}:54057000002656|(-283.84,457.08,17.51,105.00)|(11011706/65356840)] [=] [Sample Materials {4859540747059200}] [RemoveEffect {836045448945478}: Preservation Shield {4859540747059514}]",Line:45704})
}

V73RecordedWindowRule80()
{
    V73CheckRecordedRule({Name:"Royal guards",Boss:"QUEEN-SM",Area:"945872057669593",Mode:"836045448953651",Id:"royal-guards",Side:"Starts",Raw:"[17:59:49.795] [Mutated Geonosian Queen {4197299739688960}:39918000001769|(5.94,-11.43,50.66,21.81)|(5856937/11607006)] [=] [ {4201659131494400}] [ApplyEffect {836045448945477}: Guarded {4201659131494737}] (1 charges {836045448953667})",Line:8659})
}

V73RecordedWindowRule81()
{
    V73CheckRecordedRule({Name:"Royal guards",Boss:"QUEEN-SM",Area:"945872057669593",Mode:"836045448953651",Id:"royal-guards",Side:"Ends",Raw:"[18:00:08.637] [Mutated Geonosian Queen {4197299739688960}:39918000001769|(5.72,-10.89,50.69,157.22)|(5028548/11607006)] [=] [ {4201659131494400}] [RemoveEffect {836045448945478}: Guarded {4201659131494737}]",Line:9857})
}

V73RecordedWindowRule82()
{
    V73CheckRecordedRule({Name:"Royal guards",Boss:"QUEEN-SM",Area:"945872057669593",Mode:"836045448953651",Id:"royal-guards",Side:"Starts",Raw:"[05:20:35.064] [Mutated Geonosian Queen {4197299739688960}:40232000002290|(-6.97,-24.21,50.54,3.37)|(3320551/11607006)] [=] [ {4201659131494400}] [ApplyEffect {836045448945477}: Guarded {4201659131494737}] (1 charges {836045448953667})",Line:9044})
}

V73RecordedWindowRule83()
{
    V73CheckRecordedRule({Name:"Royal guards",Boss:"QUEEN-SM",Area:"945872057669593",Mode:"836045448953651",Id:"royal-guards",Side:"Ends",Raw:"[05:20:54.422] [Mutated Geonosian Queen {4197299739688960}:40232000002290|(-7.27,-22.78,50.54,-167.70)|(2295825/11607006)] [=] [ {4201659131494400}] [RemoveEffect {836045448945478}: Guarded {4201659131494737}]",Line:10403})
}

V73RecordedWindowRule84()
{
    V73CheckRecordedRule({Name:"Rallying Call",Boss:"QUEEN-SM",Area:"945872057669593",Mode:"836045448953651",Id:"rallying-call",Side:"Starts",Raw:"[18:00:13.163] [Mutated Geonosian Queen {4197299739688960}:39918000001769|(7.68,-16.61,50.54,140.05)|(4471862/11607006)] [=] [Rallying Call {4202509535019008}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:10118})
}

V73RecordedWindowRule85()
{
    V73CheckRecordedRule({Name:"Rallying Call",Boss:"QUEEN-SM",Area:"945872057669593",Mode:"836045448953651",Id:"rallying-call",Side:"Ends",Raw:"[18:00:44.388] [Mutated Geonosian Queen {4197299739688960}:39918000001769|(7.35,-16.32,50.54,-77.43)|(191109/11607006)] [=] [Rallying Call {4202509535019008}] [ApplyEffect {836045448945477}: Rallying Call Recovery {4202509535019277}]",Line:11579})
}

V73RecordedWindowRule86()
{
    V73CheckRecordedRule({Name:"Rallying Call",Boss:"QUEEN-SM",Area:"945872057669593",Mode:"836045448953651",Id:"rallying-call",Side:"Starts",Raw:"[05:20:57.412] [Mutated Geonosian Queen {4197299739688960}:40232000002290|(-3.39,-17.52,50.54,-326.47)|(2035929/11607006)] [=] [Rallying Call {4202509535019008}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:10552})
}

V73RecordedWindowRule87()
{
    V73CheckRecordedRule({Name:"Royal guards",Boss:"QUEEN-VM",Area:"945872057669593",Mode:"836045448953652",Id:"royal-guards",Side:"Starts",Raw:"[20:39:15.102] [Mutated Geonosian Queen {4204764392849408}:49443000001682|(3.66,-6.88,50.56,159.68)|(13471067/21688696)] [=] [ {4201659131494400}] [ApplyEffect {836045448945477}: Guarded {4201659131494737}] (1 charges {836045448953667})",Line:17268})
}

V73RecordedWindowRule88()
{
    V73CheckRecordedRule({Name:"Royal guards",Boss:"QUEEN-VM",Area:"945872057669593",Mode:"836045448953652",Id:"royal-guards",Side:"Starts",Raw:"[20:43:41.686] [Mutated Geonosian Queen {4204764392849408}:49443000140760|(3.42,-3.30,50.52,-219.07)|(12565895/21688696)] [=] [ {4201659131494400}] [ApplyEffect {836045448945477}: Guarded {4201659131494737}] (1 charges {836045448953667})",Line:23453})
}

V73RecordedWindowRule89()
{
    V73CheckRecordedRule({Name:"Royal guards",Boss:"QUEEN-VM",Area:"945872057669593",Mode:"836045448953652",Id:"royal-guards",Side:"Ends",Raw:"[20:44:18.950] [Mutated Geonosian Queen {4204764392849408}:49443000140760|(8.50,3.44,50.72,-85.78)|(11625494/21688696)] [=] [ {4201659131494400}] [RemoveEffect {836045448945478}: Guarded {4201659131494737}]",Line:26010})
}

V73RecordedWindowRule90()
{
    V73CheckRecordedRule({Name:"Rallying Call",Boss:"QUEEN-VM",Area:"945872057669593",Mode:"836045448953652",Id:"rallying-call",Side:"Starts",Raw:"[20:39:38.312] [Mutated Geonosian Queen {4204764392849408}:49443000001682|(-1.28,0.68,50.71,173.48)|(12587554/21688696)] [=] [Rallying Call {4202509535019008}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:19019})
}

V73RecordedWindowRule91()
{
    V73CheckRecordedRule({Name:"Rallying Call",Boss:"QUEEN-VM",Area:"945872057669593",Mode:"836045448953652",Id:"rallying-call",Side:"Starts",Raw:"[20:44:05.243] [Mutated Geonosian Queen {4204764392849408}:49443000140760|(8.33,3.34,50.75,-118.49)|(11916594/21688696)] [=] [Rallying Call {4202509535019008}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:25328})
}

V73RecordedWindowRule92()
{
    V73CheckRecordedRule({Name:"Rallying Call",Boss:"QUEEN-VM",Area:"945872057669593",Mode:"836045448953652",Id:"rallying-call",Side:"Ends",Raw:"[20:44:36.547] [Mutated Geonosian Queen {4204764392849408}:49443000140760|(8.50,3.44,50.72,-154.11)|(9077591/21688696)] [=] [Rallying Call {4202509535019008}] [ApplyEffect {836045448945477}: Rallying Call Recovery {4202509535019277}]",Line:26912})
}

V73RecordedWindowRule93()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[06:30:05.667] [Colossal Monolith {3541140406009856}:32049000005352|(934.97,-93.89,35.80,-151.87)|(17262398/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:21167})
}

V73RecordedWindowRule94()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[06:30:25.689] [Colossal Monolith {3541140406009856}:32049000005352|(935.56,-92.88,35.77,-151.98)|(15572964/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:22110})
}

V73RecordedWindowRule95()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[06:31:19.106] [Colossal Monolith {3541140406009856}:32049000005352|(934.10,-101.49,35.57,-66.48)|(10524501/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:24169})
}

V73RecordedWindowRule96()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[06:31:25.711] [Colossal Monolith {3541140406009856}:32049000005352|(934.87,-101.87,35.56,-66.69)|(10123193/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:24414})
}

V73RecordedWindowRule97()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[06:32:29.845] [Colossal Monolith {3541140406009856}:32049000005352|(911.78,-112.98,35.38,-261.91)|(6612229/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:26435})
}

V73RecordedWindowRule98()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[06:32:34.448] [Colossal Monolith {3541140406009856}:32049000005352|(911.97,-113.01,35.39,97.99)|(6488131/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:26569})
}

V73RecordedWindowRule99()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[06:33:41.478] [Colossal Monolith {3541140406009856}:32049000005352|(923.61,-126.77,35.56,-13.92)|(2577593/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:28356})
}

V73RecordedWindowRule100()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[06:33:50.703] [Colossal Monolith {3541140406009856}:32049000005352|(923.78,-127.19,35.51,-13.62)|(2236829/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:28629})
}

V73RecordedWindowRule101()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[06:06:43.607] [Colossal Monolith {3541140406009856}:32762000001222|(923.53,-114.60,35.19,35.87)|(11300830/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:4833})
}

V73RecordedWindowRule102()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[06:06:47.500] [Colossal Monolith {3541140406009856}:32762000001222|(922.90,-115.28,35.29,35.56)|(10885009/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:5010})
}

V73RecordedWindowRule103()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[05:47:04.940] [Colossal Monolith {3541140406009856}:22214000001222|(897.00,-132.49,35.45,165.54)|(14327296/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:4661})
}

V73RecordedWindowRule104()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[05:47:25.062] [Colossal Monolith {3541140406009856}:22214000001222|(897.12,-133.29,35.46,165.66)|(11733755/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:5846})
}

V73RecordedWindowRule105()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[05:48:15.176] [Colossal Monolith {3541140406009856}:22214000001222|(908.41,-125.51,35.46,-183.26)|(6014007/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:8179})
}

V73RecordedWindowRule106()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[05:48:35.199] [Colossal Monolith {3541140406009856}:22214000001222|(908.41,-125.61,35.45,176.68)|(3850939/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:9037})
}

V73RecordedWindowRule107()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[05:08:33.600] [Colossal Monolith {3541140406009856}:18274000003544|(913.96,-133.09,35.60,14.84)|(16902542/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:3343})
}

V73RecordedWindowRule108()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[05:08:41.605] [Colossal Monolith {3541140406009856}:18274000003544|(913.92,-133.23,35.61,14.94)|(16246558/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:3688})
}

V73RecordedWindowRule109()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[05:09:44.227] [Colossal Monolith {3541140406009856}:18274000003544|(924.57,-103.56,35.49,135.23)|(10124424/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:5898})
}

V73RecordedWindowRule110()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[05:09:50.030] [Colossal Monolith {3541140406009856}:18274000003544|(924.28,-103.26,35.49,135.23)|(9689206/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:6097})
}

V73RecordedWindowRule111()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[05:10:56.154] [Colossal Monolith {3541140406009856}:18274000003544|(924.47,-122.24,35.61,-134.87)|(3536099/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:8483})
}

V73RecordedWindowRule112()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[05:11:00.755] [Colossal Monolith {3541140406009856}:18274000003544|(924.43,-122.24,35.61,-134.86)|(3261441/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:8631})
}

V73RecordedWindowRule113()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[08:01:27.457] [Colossal Monolith {3541140406009856}:8125000001083|(929.15,-117.00,35.32,-64.55)|(19710152/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:9143})
}

V73RecordedWindowRule114()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[08:01:47.561] [Colossal Monolith {3541140406009856}:8125000001083|(929.51,-117.16,35.31,-64.50)|(18318334/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:10023})
}

V73RecordedWindowRule115()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[08:02:38.069] [Colossal Monolith {3541140406009856}:8125000001083|(918.27,-128.83,36.00,-27.97)|(15334389/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:11552})
}

V73RecordedWindowRule116()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[08:02:44.877] [Colossal Monolith {3541140406009856}:8125000001083|(918.35,-128.97,36.03,-27.97)|(15011351/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:11808})
}

V73RecordedWindowRule117()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[08:03:49.898] [Colossal Monolith {3541140406009856}:8125000001083|(910.99,-123.43,35.60,53.97)|(11127784/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:14032})
}

V73RecordedWindowRule118()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[08:03:59.515] [Colossal Monolith {3541140406009856}:8125000001083|(910.56,-123.72,35.57,54.06)|(10624614/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:14388})
}

V73RecordedWindowRule119()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[08:05:01.826] [Colossal Monolith {3541140406009856}:8125000001083|(909.69,-131.76,35.71,3.19)|(6989813/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:16402})
}

V73RecordedWindowRule120()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[08:05:10.435] [Colossal Monolith {3541140406009856}:8125000001083|(909.69,-131.88,35.69,3.29)|(6629737/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:16714})
}

V73RecordedWindowRule121()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[08:06:12.658] [Colossal Monolith {3541140406009856}:8125000001083|(934.03,-114.38,35.41,-174.81)|(3291139/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:18726})
}

V73RecordedWindowRule122()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[08:06:16.947] [Colossal Monolith {3541140406009856}:8125000001083|(934.09,-113.68,35.46,-174.81)|(3198382/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:18836})
}

V73RecordedWindowRule123()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[06:28:32.124] [Colossal Monolith {3541140406009856}:17315000002017|(915.71,-107.28,35.46,158.83)|(15599490/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:8408})
}

V73RecordedWindowRule124()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[06:28:50.929] [Colossal Monolith {3541140406009856}:17315000002017|(915.16,-105.87,35.54,158.83)|(13778977/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:9169})
}

V73RecordedWindowRule125()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Starts",Raw:"[06:29:42.148] [Colossal Monolith {3541140406009856}:17315000002017|(921.46,-113.51,35.32,30.58)|(6921226/26975112)] [=] [Breaking the Rift {3546333021470720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:11422})
}

V73RecordedWindowRule126()
{
    V73CheckRecordedRule({Name:"Breaking the Rift",Boss:"MONO-SM",Area:"3541801830973440",Mode:"836045448953651",Id:"breaking-the-rift",Side:"Ends",Raw:"[06:29:49.946] [Colossal Monolith {3541140406009856}:17315000002017|(921.00,-114.28,35.32,30.58)|(6019668/26975112)] [=] [ {3553398242672640}] [RemoveEffect {836045448945478}: Taunt Immunity {3553398242672907}]",Line:11811})
}

V73RecordedWindowRule127()
{
    V73CheckRecordedRule({Name:"Mass Barrage",Boss:"RAV-BU",Area:"3367421863788544",Mode:"836045448953651",Id:"mass-barrage",Side:"Starts",Raw:"[05:15:33.715] [Quartermaster Bulo {3371446248144896}:151759000052266|(328.75,294.78,-0.00,-128.94)|(3982333/12656723)] [=] [Mass Barrage {3417496887492608}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:14737})
}

V73RecordedWindowRule128()
{
    V73CheckRecordedRule({Name:"Floor vents",Boss:"RAV-TO",Area:"3367421863788544",Mode:"836045448953651",Id:"floor-vents",Side:"Starts",Raw:"[05:18:20.907] [Torque {3397005598523392}:151759000132524|(1110.87,-202.46,165.03,-68.65)|(3837880/7707175)] [=] [Floor Vents {3406488886312960}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:21050})
}

V73RecordedWindowRule129()
{
    V73CheckRecordedRule({Name:"Add wave",Boss:"TOS-MA",Area:"3367426158755840",Mode:"836045448953652",Id:"add-wave",Side:"Starts",Raw:"[14:49:37.494] [Malaphar the Savage {3469277013213184}:7472000502692|(-418.87,-27.72,0.50,112.85)|(13548331/20254456)] [=] [Dispense Adds {3440333228605440}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:7924})
}

V73RecordedWindowRule130()
{
    V73CheckRecordedRule({Name:"Add wave",Boss:"TOS-MA",Area:"3367426158755840",Mode:"836045448953652",Id:"add-wave",Side:"Starts",Raw:"[14:50:23.516] [Malaphar the Savage {3469277013213184}:7472000502692|(-423.65,-26.22,0.62,88.66)|(2203198/20254456)] [=] [Dispense Adds {3440333228605440}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:11260})
}

V73RecordedWindowRule131()
{
    V73CheckRecordedRule({Name:"Rampage",Boss:"RAV-SP-V",Area:"3367421863788544",Mode:"836045448953652",Id:"rampage",Side:"Starts",Raw:"[21:53:54.273] [Sparky {3458110098243584}:51144000007172|(53.44,88.40,1.79,-86.14)|(17391878/20479506)] [=] [Rampage! {3380452794564608}] [ApplyEffect {836045448945477}: Rampage! {3380452794564608}]",Line:22709})
}

V73RecordedWindowRule132()
{
    V73CheckRecordedRule({Name:"Rampage",Boss:"RAV-SP-V",Area:"3367421863788544",Mode:"836045448953652",Id:"rampage",Side:"Ends",Raw:"[21:54:06.300] [Sparky {3458110098243584}:51144000007172|(56.71,85.04,2.00,21.00)|(16526047/20479506)] [=] [Rampage! {3380452794564608}] [RemoveEffect {836045448945478}: Rampage! {3380452794564608}]",Line:23327})
}

V73RecordedWindowRule133()
{
    V73CheckRecordedRule({Name:"Rampage",Boss:"RAV-SP-V",Area:"3367421863788544",Mode:"836045448953652",Id:"rampage",Side:"Starts",Raw:"[21:54:45.635] [Sparky {3458110098243584}:51144000007172|(55.56,92.37,1.80,-90.39)|(11717009/20479506)] [=] [Rampage! {3380452794564608}] [ApplyEffect {836045448945477}: Rampage! {3380452794564608}]",Line:25606})
}

V73RecordedWindowRule134()
{
    V73CheckRecordedRule({Name:"Rampage",Boss:"RAV-SP-V",Area:"3367421863788544",Mode:"836045448953652",Id:"rampage",Side:"Ends",Raw:"[21:54:57.741] [Sparky {3458110098243584}:51144000007172|(49.05,76.18,1.80,-162.57)|(10704112/20479506)] [=] [Rampage! {3380452794564608}] [RemoveEffect {836045448945478}: Rampage! {3380452794564608}]",Line:26273})
}

V73RecordedWindowRule135()
{
    V73CheckRecordedRule({Name:"Rampage",Boss:"RAV-SP-V",Area:"3367421863788544",Mode:"836045448953652",Id:"rampage",Side:"Starts",Raw:"[21:55:47.959] [Sparky {3458110098243584}:51144000007172|(53.35,102.90,1.80,-110.43)|(5874248/20479506)] [=] [Rampage! {3380452794564608}] [ApplyEffect {836045448945477}: Rampage! {3380452794564608}]",Line:29130})
}

V73RecordedWindowRule136()
{
    V73CheckRecordedRule({Name:"Rampage",Boss:"RAV-SP-V",Area:"3367421863788544",Mode:"836045448953652",Id:"rampage",Side:"Ends",Raw:"[21:55:56.974] [Sparky {3458110098243584}:51144000007172|(59.87,105.31,2.86,89.90)|(5113129/20479506)] [=] [Rampage! {3380452794564608}] [RemoveEffect {836045448945478}: Rampage! {3380452794564608}]",Line:29511})
}

V73RecordedWindowRule137()
{
    V73CheckRecordedRule({Name:"Mass Barrage",Boss:"RAV-BU-V",Area:"3367421863788544",Mode:"836045448953652",Id:"mass-barrage",Side:"Starts",Raw:"[22:01:38.214] [Quartermaster Bulo {3468705782562816}:51144000116656|(335.31,309.45,-0.00,172.86)|(13532840/21379704)] [=] [Mass Barrage {3417496887492608}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:47157})
}

V73RecordedWindowRule138()
{
    V73CheckRecordedRule({Name:"Mass Barrage",Boss:"RAV-BU-V",Area:"3367421863788544",Mode:"836045448953652",Id:"mass-barrage",Side:"Starts",Raw:"[22:02:55.079] [Quartermaster Bulo {3468705782562816}:51144000116656|(364.95,293.14,-0.00,-105.72)|(5358733/21379704)] [=] [Mass Barrage {3417496887492608}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:53372})
}

V73RecordedWindowRule139()
{
    V73CheckRecordedRule({Name:"Mass Barrage",Boss:"RAV-BU-V",Area:"3367421863788544",Mode:"836045448953652",Id:"mass-barrage",Side:"Starts",Raw:"[22:04:15.931] [Quartermaster Bulo {3468705782562816}:51144000116656|(335.31,309.45,-0.00,109.03)|(553/21379704)] [=] [Mass Barrage {3417496887492608}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:57856})
}

V73RecordedWindowRule140()
{
    V73CheckRecordedRule({Name:"Floor vents",Boss:"RAV-TO-V",Area:"3367421863788544",Mode:"836045448953652",Id:"floor-vents",Side:"Starts",Raw:"[22:07:38.948] [Torque {3468710077530112}:51144000299087|(1107.32,-197.57,165.03,157.19)|(10742564/14628218)] [=] [Floor Vents {3406488886312960}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:65300})
}

V73RecordedWindowRule141()
{
    V73CheckRecordedRule({Name:"Floor vents",Boss:"RAV-TO-V",Area:"3367421863788544",Mode:"836045448953652",Id:"floor-vents",Side:"Starts",Raw:"[22:08:10.151] [Torque {3468710077530112}:51144000299087|(1117.18,-213.42,165.03,86.42)|(7398006/14628218)] [=] [Floor Vents {3406488886312960}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:66893})
}

V73RecordedWindowRule142()
{
    V73CheckRecordedRule({Name:"Floor vents",Boss:"RAV-TO-V",Area:"3367421863788544",Mode:"836045448953652",Id:"floor-vents",Side:"Starts",Raw:"[22:08:45.479] [Torque {3468710077530112}:51144000299087|(1110.70,-194.71,165.03,274.48)|(3891801/14628218)] [=] [Floor Vents {3406488886312960}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:69148})
}

V73RecordedWindowRule143()
{
    V73CheckRecordedRule({Name:"Floor vents",Boss:"RAV-TO-V",Area:"3367421863788544",Mode:"836045448953652",Id:"floor-vents",Side:"Starts",Raw:"[22:09:16.570] [Torque {3468710077530112}:51144000299087|(1116.17,-197.60,165.03,85.60)|(200309/14628218)] [=] [Floor Vents {3406488886312960}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:71392})
}

V73RecordedWindowRule144()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA-V",Area:"833571547775669",Mode:"836045448953652",Id:"melted-armor",Side:"Starts",Raw:"[09:13:25.567] [G4-B3 Heavy Fabricator {2748401112317952}:7436000006871|(-893.00,7.50,-33.98,-90.00)|(31619458/31619458)] [=] [ {2778629092147200}] [ApplyEffect {836045448945477}: Melted Armor (Damage Vulnerability) {2778629092147481}]",Line:3701})
}

V73RecordedWindowRule145()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA-V",Area:"833571547775669",Mode:"836045448953652",Id:"melted-armor",Side:"Ends",Raw:"[09:13:45.577] [G4-B3 Heavy Fabricator {2748401112317952}:7436000006871|(-893.14,5.41,-33.99,-1.62)|(25918396/31619458)] [=] [ {2778629092147200}] [RemoveEffect {836045448945478}: Melted Armor (Damage Vulnerability) {2778629092147481}]",Line:4465})
}

V73RecordedWindowRule146()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA-V",Area:"833571547775669",Mode:"836045448953652",Id:"melted-armor",Side:"Starts",Raw:"[09:14:32.181] [G4-B3 Heavy Fabricator {2748401112317952}:7436000006871|(-893.14,5.41,-33.99,-1.62)|(21742294/31619458)] [=] [ {2778629092147200}] [ApplyEffect {836045448945477}: Melted Armor (Damage Vulnerability) {2778629092147481}]",Line:6577})
}

V73RecordedWindowRule147()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA-V",Area:"833571547775669",Mode:"836045448953652",Id:"melted-armor",Side:"Ends",Raw:"[09:14:52.384] [G4-B3 Heavy Fabricator {2748401112317952}:7436000006871|(-893.14,5.41,-33.99,-1.62)|(16039147/31619458)] [=] [ {2778629092147200}] [RemoveEffect {836045448945478}: Melted Armor (Damage Vulnerability) {2778629092147481}]",Line:7570})
}

V73RecordedWindowRule148()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA-V",Area:"833571547775669",Mode:"836045448953652",Id:"melted-armor",Side:"Starts",Raw:"[09:15:42.614] [G4-B3 Heavy Fabricator {2748401112317952}:7436000006871|(-893.14,5.41,-33.99,-1.62)|(11866550/31619458)] [=] [ {2778629092147200}] [ApplyEffect {836045448945477}: Melted Armor (Damage Vulnerability) {2778629092147481}]",Line:10056})
}

V73RecordedWindowRule149()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA-V",Area:"833571547775669",Mode:"836045448953652",Id:"melted-armor",Side:"Ends",Raw:"[09:16:02.902] [G4-B3 Heavy Fabricator {2748401112317952}:7436000006871|(-893.24,4.60,-33.98,-5.70)|(6711445/31619458)] [=] [ {2778629092147200}] [RemoveEffect {836045448945478}: Melted Armor (Damage Vulnerability) {2778629092147481}]",Line:10927})
}

V73RecordedWindowRule150()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA-V",Area:"833571547775669",Mode:"836045448953652",Id:"melted-armor",Side:"Starts",Raw:"[09:17:03.528] [G4-B3 Heavy Fabricator {2748401112317952}:7436000006871|(-893.24,4.60,-33.98,-5.70)|(2441829/31619458)] [=] [ {2778629092147200}] [ApplyEffect {836045448945477}: Melted Armor (Damage Vulnerability) {2778629092147481}]",Line:13952})
}

V73RecordedWindowRule151()
{
    V73CheckRecordedRule({Name:"Melted armor",Boss:"KP-FA-V",Area:"833571547775669",Mode:"836045448953652",Id:"melted-armor",Side:"Ends",Raw:"[09:17:11.090] [G4-B3 Heavy Fabricator {2748401112317952}:7436000006871|(-893.24,4.60,-33.98,-5.70)|(0/31619458)] [=] [ {2778629092147200}] [RemoveEffect {836045448945478}: Melted Armor (Damage Vulnerability) {2778629092147481}]",Line:14423})
}

V73RecordedWindowRule152()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Starts",Raw:"[09:23:48.655] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1262.96,0.37,-11.79,-40.19)|(29755286/33082278)] [=] [Tunneling Drill {2778294084698112}] [ApplyEffect {836045448945477}: Tunneling Drill {2778294084698112}]",Line:21714})
}

V73RecordedWindowRule153()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Ends",Raw:"[09:23:55.149] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1262.99,0.43,-11.79,-40.19)|(28920980/33082278)] [=] [Tunneling Drill {2778294084698112}] [RemoveEffect {836045448945478}: Tunneling Drill {2778294084698112}]",Line:21976})
}

V73RecordedWindowRule154()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Starts",Raw:"[09:24:13.256] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1262.96,0.49,-11.79,-46.20)|(26458572/33082278)] [=] [Tunneling Drill {2778294084698112}] [ApplyEffect {836045448945477}: Tunneling Drill {2778294084698112}]",Line:22874})
}

V73RecordedWindowRule155()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Ends",Raw:"[09:24:19.773] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1262.96,0.49,-11.79,-46.20)|(25441694/33082278)] [=] [Tunneling Drill {2778294084698112}] [RemoveEffect {836045448945478}: Tunneling Drill {2778294084698112}]",Line:23233})
}

V73RecordedWindowRule156()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Starts",Raw:"[09:24:39.095] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1259.98,-2.33,-11.64,-30.27)|(23021336/33082278)] [=] [Tunneling Drill {2778294084698112}] [ApplyEffect {836045448945477}: Tunneling Drill {2778294084698112}]",Line:24104})
}

V73RecordedWindowRule157()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Ends",Raw:"[09:24:45.696] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1259.98,-2.33,-11.64,-30.27)|(22366088/33082278)] [=] [Tunneling Drill {2778294084698112}] [RemoveEffect {836045448945478}: Tunneling Drill {2778294084698112}]",Line:24406})
}

V73RecordedWindowRule158()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Starts",Raw:"[09:25:03.708] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1257.87,-9.13,-11.81,32.51)|(20223704/33082278)] [=] [Tunneling Drill {2778294084698112}] [ApplyEffect {836045448945477}: Tunneling Drill {2778294084698112}]",Line:25188})
}

V73RecordedWindowRule159()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Ends",Raw:"[09:25:10.217] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1257.83,-9.08,-11.81,32.51)|(18832222/33082278)] [=] [Tunneling Drill {2778294084698112}] [RemoveEffect {836045448945478}: Tunneling Drill {2778294084698112}]",Line:25528})
}

V73RecordedWindowRule160()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Starts",Raw:"[09:25:29.815] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1255.46,-12.02,-11.81,42.16)|(15580566/33082278)] [=] [Tunneling Drill {2778294084698112}] [ApplyEffect {836045448945477}: Tunneling Drill {2778294084698112}]",Line:26504})
}

V73RecordedWindowRule161()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Ends",Raw:"[09:25:36.413] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1255.46,-12.02,-11.81,42.16)|(14739469/33082278)] [=] [Tunneling Drill {2778294084698112}] [RemoveEffect {836045448945478}: Tunneling Drill {2778294084698112}]",Line:26826})
}

V73RecordedWindowRule162()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Starts",Raw:"[09:25:54.420] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1255.39,-11.17,-11.81,39.18)|(12044173/33082278)] [=] [Tunneling Drill {2778294084698112}] [ApplyEffect {836045448945477}: Tunneling Drill {2778294084698112}]",Line:27690})
}

V73RecordedWindowRule163()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Ends",Raw:"[09:26:00.917] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1255.39,-11.17,-11.81,39.18)|(11243113/33082278)] [=] [Tunneling Drill {2778294084698112}] [RemoveEffect {836045448945478}: Tunneling Drill {2778294084698112}]",Line:27956})
}

V73RecordedWindowRule164()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Starts",Raw:"[09:26:19.227] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1252.36,-17.88,-11.81,-56.66)|(8021522/33082278)] [=] [Tunneling Drill {2778294084698112}] [ApplyEffect {836045448945477}: Tunneling Drill {2778294084698112}]",Line:28878})
}

V73RecordedWindowRule165()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Ends",Raw:"[09:26:25.830] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1252.22,-17.91,-11.81,-56.66)|(7170693/33082278)] [=] [Tunneling Drill {2778294084698112}] [RemoveEffect {836045448945478}: Tunneling Drill {2778294084698112}]",Line:29143})
}

V73RecordedWindowRule166()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Starts",Raw:"[09:26:45.343] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1240.51,-19.20,-11.75,82.73)|(4482059/33082278)] [=] [Tunneling Drill {2778294084698112}] [ApplyEffect {836045448945477}: Tunneling Drill {2778294084698112}]",Line:30048})
}

V73RecordedWindowRule167()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Ends",Raw:"[09:26:51.849] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1240.51,-19.20,-11.75,82.73)|(3465474/33082278)] [=] [Tunneling Drill {2778294084698112}] [RemoveEffect {836045448945478}: Tunneling Drill {2778294084698112}]",Line:30352})
}

V73RecordedWindowRule168()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Starts",Raw:"[09:27:11.472] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1243.56,-18.44,-11.80,79.94)|(560256/33082278)] [=] [Tunneling Drill {2778294084698112}] [ApplyEffect {836045448945477}: Tunneling Drill {2778294084698112}]",Line:31274})
}

V73RecordedWindowRule169()
{
    V73CheckRecordedRule({Name:"Tunneling drill",Boss:"KP-KA-V",Area:"833571547775669",Mode:"836045448953652",Id:"tunneling-drill",Side:"Ends",Raw:"[09:27:17.041] [Karagga the Unyielding {2761191524925440}:7436000004387|(-1243.56,-18.44,-11.80,79.94)|(0/22504952)] [=] [Tunneling Drill {2778294084698112}] [RemoveEffect {836045448945478}: Tunneling Drill {2778294084698112}]",Line:31502})
}

V73RecordedWindowRule170()
{
    V73CheckRecordedRule({Name:"Toth berserk",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"toth-berserk",Side:"Starts",Raw:"[20:21:36.003] [Toth {2857549116211200}:8871000850930|(-105.61,-610.94,-63.40,171.68)|(11278969/14455011)] [=] [Berserk {2857325777911808}] [ApplyEffect {836045448945477}: Berserk {2857325777912065}]",Line:2051})
}

V73RecordedWindowRule171()
{
    V73CheckRecordedRule({Name:"Toth berserk",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"toth-berserk",Side:"Starts",Raw:"[03:27:37.224] [Toth {2857549116211200}:4969000037027|(-106.87,-614.21,-63.40,-170.58)|(11435522/14455011)] [=] [Berserk {2857325777911808}] [ApplyEffect {836045448945477}: Berserk {2857325777912065}]",Line:3618})
}

V73RecordedWindowRule172()
{
    V73CheckRecordedRule({Name:"Toth berserk",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"toth-berserk",Side:"Starts",Raw:"[20:53:36.860] [Toth {2857549116211200}:40791000021150|(-102.24,-611.16,-63.40,176.80)|(11418989/14455011)] [=] [Berserk {2857325777911808}] [ApplyEffect {836045448945477}: Berserk {2857325777912065}]",Line:2488})
}

V73RecordedWindowRule173()
{
    V73CheckRecordedRule({Name:"Toth berserk",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"toth-berserk",Side:"Ends",Raw:"[20:21:53.905] [Toth {2857549116211200}:8871000850930|(-105.16,-614.78,-63.40,-172.93)|(10525648/14455011)] [=] [Berserk {2857325777911808}] [RemoveEffect {836045448945478}: Berserk {2857325777912065}]",Line:2917})
}

V73RecordedWindowRule174()
{
    V73CheckRecordedRule({Name:"Toth berserk",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"toth-berserk",Side:"Ends",Raw:"[03:29:31.280] [Toth {2857549116211200}:4969000061021|(-103.99,-615.41,-63.40,-177.65)|(9899488/14455011)] [=] [Berserk {2857325777911808}] [RemoveEffect {836045448945478}: Berserk {2857325777912065}]",Line:7031})
}

V73RecordedWindowRule175()
{
    V73CheckRecordedRule({Name:"Toth berserk",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"toth-berserk",Side:"Ends",Raw:"[20:53:54.186] [Toth {2857549116211200}:40791000021150|(-101.48,-611.01,-63.40,-161.42)|(10911502/14455011)] [=] [Berserk {2857325777911808}] [RemoveEffect {836045448945478}: Berserk {2857325777912065}]",Line:3500})
}

V73RecordedWindowRule176()
{
    V73CheckRecordedRule({Name:"Zorn emboldened",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"zorn-emboldened",Side:"Starts",Raw:"[20:22:00.029] [Zorn {2857544821243904}:8871000850777|(-107.29,-646.85,-63.37,-34.83)|(15520359/16647415)] [=] [Emboldened {2857171159089152}] [ApplyEffect {836045448945477}: Emboldened {2857171159089414}]",Line:3272})
}

V73RecordedWindowRule177()
{
    V73CheckRecordedRule({Name:"Zorn emboldened",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"zorn-emboldened",Side:"Starts",Raw:"[20:54:04.591] [Zorn {2857544821243904}:40791000020997|(-103.46,-648.17,-63.05,26.86)|(14393377/16647415)] [=] [Emboldened {2857171159089152}] [ApplyEffect {836045448945477}: Emboldened {2857171159089414}]",Line:4065})
}

V73RecordedWindowRule178()
{
    V73CheckRecordedRule({Name:"Zorn emboldened",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"zorn-emboldened",Side:"Starts",Raw:"[23:10:23.862] [Zorn {2857544821243904}:51788000047373|(-108.21,-645.27,-63.38,177.74)|(11479025/16647415)] [=] [Emboldened {2857171159089152}] [ApplyEffect {836045448945477}: Emboldened {2857171159089414}]",Line:10686})
}

V73RecordedWindowRule179()
{
    V73CheckRecordedRule({Name:"Zorn emboldened",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"zorn-emboldened",Side:"Ends",Raw:"[20:22:15.139] [Zorn {2857544821243904}:8871000850777|(-104.62,-648.95,-63.22,-1.71)|(15398707/16647415)] [=] [Emboldened {2857171159089152}] [RemoveEffect {836045448945478}: Emboldened {2857171159089414}]",Line:4113})
}

V73RecordedWindowRule180()
{
    V73CheckRecordedRule({Name:"Zorn emboldened",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"zorn-emboldened",Side:"Ends",Raw:"[20:54:19.604] [Zorn {2857544821243904}:40791000020997|(-103.32,-647.77,-63.01,18.47)|(14308015/16647415)] [=] [Emboldened {2857171159089152}] [RemoveEffect {836045448945478}: Emboldened {2857171159089414}]",Line:4884})
}

V73RecordedWindowRule181()
{
    V73CheckRecordedRule({Name:"Zorn emboldened",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"zorn-emboldened",Side:"Ends",Raw:"[23:10:38.865] [Zorn {2857544821243904}:51788000047373|(-105.65,-643.42,-63.22,25.98)|(11166940/16647415)] [=] [Emboldened {2857171159089152}] [RemoveEffect {836045448945478}: Emboldened {2857171159089414}]",Line:11363})
}

V73RecordedWindowRule182()
{
    V73CheckRecordedRule({Name:"Ground Shatter",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"ground-shatter",Side:"Starts",Raw:"[20:22:16.245] [Toth {2857549116211200}:8871000850930|(-106.04,-612.20,-63.40,-199.37)|(8092598/14455011)] [=] [Ground Shatter {2857368727584768}] [ApplyEffect {836045448945477}: Ground Shatter {2857368727584768}]",Line:4200})
}

V73RecordedWindowRule183()
{
    V73CheckRecordedRule({Name:"Ground Shatter",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"ground-shatter",Side:"Starts",Raw:"[03:29:48.684] [Toth {2857549116211200}:4969000061021|(-103.97,-612.10,-63.40,-181.25)|(7764959/14455011)] [=] [Ground Shatter {2857368727584768}] [ApplyEffect {836045448945477}: Ground Shatter {2857368727584768}]",Line:8091})
}

V73RecordedWindowRule184()
{
    V73CheckRecordedRule({Name:"Ground Shatter",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"ground-shatter",Side:"Starts",Raw:"[20:54:20.401] [Toth {2857549116211200}:40791000021150|(-99.88,-612.18,-63.40,-164.06)|(7923465/14455011)] [=] [Ground Shatter {2857368727584768}] [ApplyEffect {836045448945477}: Ground Shatter {2857368727584768}]",Line:4925})
}

V73RecordedWindowRule185()
{
    V73CheckRecordedRule({Name:"Ground Shatter",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"ground-shatter",Side:"Ends",Raw:"[20:22:36.247] [Toth {2857549116211200}:8871000850930|(-104.97,-639.76,-63.37,-2.18)|(5426560/14455011)] [=] [Ground Shatter {2857368727584768}] [RemoveEffect {836045448945478}: Ground Shatter {2857368727584768}]",Line:5280})
}

V73RecordedWindowRule186()
{
    V73CheckRecordedRule({Name:"Ground Shatter",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"ground-shatter",Side:"Ends",Raw:"[03:30:08.722] [Toth {2857549116211200}:4969000061021|(-101.89,-623.96,-63.06,-9.93)|(7114801/14455011)] [=] [Ground Shatter {2857368727584768}] [RemoveEffect {836045448945478}: Ground Shatter {2857368727584768}]",Line:9318})
}

V73RecordedWindowRule187()
{
    V73CheckRecordedRule({Name:"Ground Shatter",Boss:"EC-ZT",Area:"833571547775688",Mode:"836045448953655",Id:"ground-shatter",Side:"Ends",Raw:"[20:54:40.418] [Toth {2857549116211200}:40791000021150|(-102.46,-638.81,-63.32,5.53)|(5717533/14455011)] [=] [Ground Shatter {2857368727584768}] [RemoveEffect {836045448945478}: Ground Shatter {2857368727584768}]",Line:6080})
}

V73RecordedWindowRule188()
{
    V73CheckRecordedRule({Name:"Firebrand defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"firebrand-defensive-systems",Side:"Starts",Raw:"[20:32:02.330] [Firebrand Battle Tank {2876434087411712}:8871000965441|(-144.33,-229.75,0.21,-81.79)|(13893264/18393906)] [=] [Defensive Systems {2876717555253248}] [ApplyEffect {836045448945477}: Defensive Systems {2876717555253248}]",Line:27491})
}

V73RecordedWindowRule189()
{
    V73CheckRecordedRule({Name:"Firebrand defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"firebrand-defensive-systems",Side:"Starts",Raw:"[03:40:50.213] [Firebrand Battle Tank {2876434087411712}:4969000198558|(-144.33,-229.75,0.21,-81.79)|(14210238/18393906)] [=] [Defensive Systems {2876717555253248}] [ApplyEffect {836045448945477}: Defensive Systems {2876717555253248}]",Line:35412})
}

V73RecordedWindowRule190()
{
    V73CheckRecordedRule({Name:"Firebrand defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"firebrand-defensive-systems",Side:"Starts",Raw:"[21:02:58.384] [Firebrand Battle Tank {2876434087411712}:40791000125252|(-144.33,-229.75,0.21,-81.79)|(13774019/18393906)] [=] [Defensive Systems {2876717555253248}] [ApplyEffect {836045448945477}: Defensive Systems {2876717555253248}]",Line:28564})
}

V73RecordedWindowRule191()
{
    V73CheckRecordedRule({Name:"Firebrand defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"firebrand-defensive-systems",Side:"Ends",Raw:"[20:32:27.352] [Firebrand Battle Tank {2876434087411712}:8871000965441|(-144.33,-229.75,0.21,-81.79)|(13642546/18393906)] [=] [Defensive Systems {2876717555253248}] [RemoveEffect {836045448945478}: Defensive Systems {2876717555253248}]",Line:29039})
}

V73RecordedWindowRule192()
{
    V73CheckRecordedRule({Name:"Firebrand defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"firebrand-defensive-systems",Side:"Ends",Raw:"[03:41:15.244] [Firebrand Battle Tank {2876434087411712}:4969000198558|(-144.33,-229.75,0.21,-81.79)|(14098575/18393906)] [=] [Defensive Systems {2876717555253248}] [RemoveEffect {836045448945478}: Defensive Systems {2876717555253248}]",Line:37061})
}

V73RecordedWindowRule193()
{
    V73CheckRecordedRule({Name:"Firebrand defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"firebrand-defensive-systems",Side:"Ends",Raw:"[21:03:23.482] [Firebrand Battle Tank {2876434087411712}:40791000125252|(-144.33,-229.75,0.21,-81.79)|(13753119/18393906)] [=] [Defensive Systems {2876717555253248}] [RemoveEffect {836045448945478}: Defensive Systems {2876717555253248}]",Line:30179})
}

V73RecordedWindowRule194()
{
    V73CheckRecordedRule({Name:"Stormcaller defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"stormcaller-defensive-systems",Side:"Starts",Raw:"[20:35:08.651] [Stormcaller Blast Tank {2876438382379008}:8871000965598|(-145.76,-261.11,0.33,-102.13)|(7503934/18393906)] [=] [Defensive Systems {2876717555253248}] [ApplyEffect {836045448945477}: Defensive Systems {2876717555253248}]",Line:37366})
}

V73RecordedWindowRule195()
{
    V73CheckRecordedRule({Name:"Stormcaller defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"stormcaller-defensive-systems",Side:"Starts",Raw:"[03:40:51.413] [Stormcaller Blast Tank {2876438382379008}:4969000198715|(-145.76,-261.11,0.33,-102.13)|(17126202/18393906)] [=] [Defensive Systems {2876717555253248}] [ApplyEffect {836045448945477}: Defensive Systems {2876717555253248}]",Line:35467})
}

V73RecordedWindowRule196()
{
    V73CheckRecordedRule({Name:"Stormcaller defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"stormcaller-defensive-systems",Side:"Starts",Raw:"[21:04:01.722] [Stormcaller Blast Tank {2876438382379008}:40791000125409|(-145.76,-261.11,0.33,-102.13)|(16127342/18393906)] [=] [Defensive Systems {2876717555253248}] [ApplyEffect {836045448945477}: Defensive Systems {2876717555253248}]",Line:32333})
}

V73RecordedWindowRule197()
{
    V73CheckRecordedRule({Name:"Stormcaller defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"stormcaller-defensive-systems",Side:"Ends",Raw:"[20:34:30.630] [Stormcaller Blast Tank {2876438382379008}:8871000965598|(-145.76,-261.11,0.33,-102.13)|(9347825/18393906)] [=] [Defensive Systems {2876717555253248}] [RemoveEffect {836045448945478}: Defensive Systems {2876717555253248}]",Line:35648})
}

V73RecordedWindowRule198()
{
    V73CheckRecordedRule({Name:"Stormcaller defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"stormcaller-defensive-systems",Side:"Ends",Raw:"[03:41:16.442] [Stormcaller Blast Tank {2876438382379008}:4969000198715|(-145.76,-261.11,0.33,-102.13)|(14887843/18393906)] [=] [Defensive Systems {2876717555253248}] [RemoveEffect {836045448945478}: Defensive Systems {2876717555253248}]",Line:37116})
}

V73RecordedWindowRule199()
{
    V73CheckRecordedRule({Name:"Stormcaller defensive systems",Boss:"EC-TK",Area:"833571547775688",Mode:"836045448953655",Id:"stormcaller-defensive-systems",Side:"Ends",Raw:"[21:04:26.745] [Stormcaller Blast Tank {2876438382379008}:40791000125409|(-145.76,-261.11,0.33,-102.13)|(16126206/18393906)] [=] [Defensive Systems {2876717555253248}] [RemoveEffect {836045448945478}: Defensive Systems {2876717555253248}]",Line:33897})
}

V73RecordedWindowRule200()
{
    V73CheckRecordedRule({Name:"Melee mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"melee-mode",Side:"Starts",Raw:"[14:45:04.679] [Corruptor Zero {3303534225260544}:95826000501855|(-44.15,-626.24,-15.98,-39.39)|(13495067/27001442)] [=] [ {3284760923209728}] [ApplyEffect {836045448945477}: Melee Mode {3284760923209990}]",Line:79779})
}

V73RecordedWindowRule201()
{
    V73CheckRecordedRule({Name:"Melee mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"melee-mode",Side:"Starts",Raw:"[19:14:13.056] [Corruptor Zero {3303534225260544}:81855000892652|(-30.84,-636.79,-15.98,68.97)|(14665918/27001442)] [=] [ {3284760923209728}] [ApplyEffect {836045448945477}: Melee Mode {3284760923209990}]",Line:81854})
}

V73RecordedWindowRule202()
{
    V73CheckRecordedRule({Name:"Melee mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"melee-mode",Side:"Starts",Raw:"[21:09:53.421] [Corruptor Zero {3303534225260544}:99445000848024|(-30.94,-638.75,-15.98,72.35)|(13550514/27001442)] [=] [ {3284760923209728}] [ApplyEffect {836045448945477}: Melee Mode {3284760923209990}]",Line:86614})
}

V73RecordedWindowRule203()
{
    V73CheckRecordedRule({Name:"Melee mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"melee-mode",Side:"Ends",Raw:"[14:44:04.587] [Corruptor Zero {3303534225260544}:95826000501855|(-38.15,-630.97,-15.91,-4.94)|(21015720/27001442)] [=] [ {3284760923209728}] [RemoveEffect {836045448945478}: Melee Mode {3284760923209990}]",Line:75461})
}

V73RecordedWindowRule204()
{
    V73CheckRecordedRule({Name:"Melee mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"melee-mode",Side:"Ends",Raw:"[19:13:12.949] [Corruptor Zero {3303534225260544}:81855000892652|(-31.84,-636.63,-15.96,96.14)|(21522314/27001442)] [=] [ {3284760923209728}] [RemoveEffect {836045448945478}: Melee Mode {3284760923209990}]",Line:77296})
}

V73RecordedWindowRule205()
{
    V73CheckRecordedRule({Name:"Melee mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"melee-mode",Side:"Ends",Raw:"[21:08:53.320] [Corruptor Zero {3303534225260544}:99445000848024|(-32.42,-638.51,-15.88,250.61)|(21096606/27001442)] [=] [ {3284760923209728}] [RemoveEffect {836045448945478}: Melee Mode {3284760923209990}]",Line:81379})
}

V73RecordedWindowRule206()
{
    V73CheckRecordedRule({Name:"Ranged mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"ranged-mode",Side:"Starts",Raw:"[14:44:04.586] [Corruptor Zero {3303534225260544}:95826000501855|(-38.15,-630.97,-15.91,-4.94)|(21015720/27001442)] [=] [ {3284760923209728}] [ApplyEffect {836045448945477}: Ranged Mode {3284760923209993}]",Line:75460})
}

V73RecordedWindowRule207()
{
    V73CheckRecordedRule({Name:"Ranged mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"ranged-mode",Side:"Starts",Raw:"[19:13:12.949] [Corruptor Zero {3303534225260544}:81855000892652|(-31.84,-636.63,-15.96,96.14)|(21522314/27001442)] [=] [ {3284760923209728}] [ApplyEffect {836045448945477}: Ranged Mode {3284760923209993}]",Line:77295})
}

V73RecordedWindowRule208()
{
    V73CheckRecordedRule({Name:"Ranged mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"ranged-mode",Side:"Starts",Raw:"[21:08:53.320] [Corruptor Zero {3303534225260544}:99445000848024|(-32.42,-638.51,-15.88,250.61)|(21096606/27001442)] [=] [ {3284760923209728}] [ApplyEffect {836045448945477}: Ranged Mode {3284760923209993}]",Line:81378})
}

V73RecordedWindowRule209()
{
    V73CheckRecordedRule({Name:"Ranged mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"ranged-mode",Side:"Ends",Raw:"[14:45:04.680] [Corruptor Zero {3303534225260544}:95826000501855|(-44.15,-626.24,-15.98,-39.39)|(13495067/27001442)] [=] [ {3284760923209728}] [RemoveEffect {836045448945478}: Ranged Mode {3284760923209993}]",Line:79780})
}

V73RecordedWindowRule210()
{
    V73CheckRecordedRule({Name:"Ranged mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"ranged-mode",Side:"Ends",Raw:"[19:14:13.056] [Corruptor Zero {3303534225260544}:81855000892652|(-30.84,-636.79,-15.98,68.97)|(14665918/27001442)] [=] [ {3284760923209728}] [RemoveEffect {836045448945478}: Ranged Mode {3284760923209993}]",Line:81855})
}

V73RecordedWindowRule211()
{
    V73CheckRecordedRule({Name:"Ranged mode",Boss:"DF-CZ",Area:"137438993402",Mode:"836045448953655",Id:"ranged-mode",Side:"Ends",Raw:"[21:09:53.421] [Corruptor Zero {3303534225260544}:99445000848024|(-30.94,-638.75,-15.98,72.35)|(13550514/27001442)] [=] [ {3284760923209728}] [RemoveEffect {836045448945478}: Ranged Mode {3284760923209993}]",Line:86615})
}

V73RecordedWindowRule212()
{
    V73CheckRecordedRule({Name:"Magnet lift",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"magnet-lift",Side:"Starts",Raw:"[14:36:10.396] [Grob'thok, Who Feeds the Forge {3302559267684352}:95826000259590|(139.43,-514.14,5.63,45.50)|(31985432/42759408)] [=] [Electro Magnet {3286745198100480}] [ApplyEffect {836045448945477}: Lifted {3286745198100762}]",Line:46519})
}

V73RecordedWindowRule213()
{
    V73CheckRecordedRule({Name:"Magnet lift",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"magnet-lift",Side:"Starts",Raw:"[19:06:29.644] [Grob'thok, Who Feeds the Forge {3302559267684352}:81855000715518|(141.93,-522.83,5.72,89.20)|(33375470/42759408)] [=] [Electro Magnet {3286745198100480}] [ApplyEffect {836045448945477}: Lifted {3286745198100762}]",Line:52550})
}

V73RecordedWindowRule214()
{
    V73CheckRecordedRule({Name:"Magnet lift",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"magnet-lift",Side:"Starts",Raw:"[21:02:45.602] [Grob'thok, Who Feeds the Forge {3302559267684352}:99445000636318|(140.16,-512.90,5.67,29.10)|(33691588/42759408)] [=] [Electro Magnet {3286745198100480}] [ApplyEffect {836045448945477}: Lifted {3286745198100762}]",Line:54576})
}

V73RecordedWindowRule215()
{
    V73CheckRecordedRule({Name:"Magnet lift",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"magnet-lift",Side:"Ends",Raw:"[14:36:20.407] [Grob'thok, Who Feeds the Forge {3302559267684352}:95826000259590|(139.43,-514.14,5.63,45.85)|(29934194/42759408)] [=] [Electro Magnet {3286745198100480}] [RemoveEffect {836045448945478}: Lifted {3286745198100762}]",Line:47293})
}

V73RecordedWindowRule216()
{
    V73CheckRecordedRule({Name:"Magnet lift",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"magnet-lift",Side:"Ends",Raw:"[19:06:39.624] [Grob'thok, Who Feeds the Forge {3302559267684352}:81855000715518|(141.93,-522.83,5.72,89.20)|(31011164/42759408)] [=] [Electro Magnet {3286745198100480}] [RemoveEffect {836045448945478}: Lifted {3286745198100762}]",Line:53339})
}

V73RecordedWindowRule217()
{
    V73CheckRecordedRule({Name:"Magnet lift",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"magnet-lift",Side:"Ends",Raw:"[21:02:55.698] [Grob'thok, Who Feeds the Forge {3302559267684352}:99445000636318|(140.19,-512.84,5.68,28.72)|(31131196/42759408)] [=] [Electro Magnet {3286745198100480}] [RemoveEffect {836045448945478}: Lifted {3286745198100762}]",Line:55475})
}

V73RecordedWindowRule218()
{
    V73CheckRecordedRule({Name:"Launch",Boss:"SNV-TI",Area:"137438993037",Mode:"836045448953655",Id:"launch",Side:"Starts",Raw:"[12:39:12.720] [Titan 6 {3152458750623744}:32161000165162|(306.42,-179.98,-5.80,32.75)|(17388798/28131190)] [=] [Launch {3152269772062720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:26347})
}

V73RecordedWindowRule219()
{
    V73CheckRecordedRule({Name:"Launch",Boss:"SNV-TI",Area:"137438993037",Mode:"836045448953655",Id:"launch",Side:"Starts",Raw:"[12:42:21.006] [Titan 6 {3152458750623744}:32161000240837|(306.42,-179.98,-5.80,47.64)|(17757762/28131190)] [=] [Launch {3152269772062720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:32643})
}

V73RecordedWindowRule220()
{
    V73CheckRecordedRule({Name:"Launch",Boss:"SNV-TI",Area:"137438993037",Mode:"836045448953655",Id:"launch",Side:"Starts",Raw:"[12:43:43.304] [Titan 6 {3152458750623744}:32161000240837|(280.32,-224.64,-6.36,36.33)|(8674917/28131190)] [=] [Launch {3152269772062720}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:36622})
}

V73RecordedWindowRule221()
{
    V73CheckRecordedRule({Name:"Launch",Boss:"SNV-TI",Area:"137438993037",Mode:"836045448953655",Id:"launch",Side:"Ends",Raw:"[12:38:07.887] [Titan 6 {3152458750623744}:32161000165162|(306.42,-179.98,-5.80,-82.21)|(28123670/28131190)] [=] [ {3152119448207360}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:22585})
}

V73RecordedWindowRule222()
{
    V73CheckRecordedRule({Name:"Launch",Boss:"SNV-TI",Area:"137438993037",Mode:"836045448953655",Id:"launch",Side:"Ends",Raw:"[12:39:30.044] [Titan 6 {3152458750623744}:32161000165162|(280.32,-224.64,-6.36,-48.33)|(16913808/28131190)] [=] [ {3152119448207360}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:26846})
}

V73RecordedWindowRule223()
{
    V73CheckRecordedRule({Name:"Launch",Boss:"SNV-TI",Area:"137438993037",Mode:"836045448953655",Id:"launch",Side:"Ends",Raw:"[12:41:16.091] [Titan 6 {3152458750623744}:32161000240837|(306.42,-179.98,-5.80,-27.42)|(28123216/28131190)] [=] [ {3152119448207360}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:29046})
}

V73RecordedWindowRule224()
{
    V73CheckRecordedRule({Name:"Summoning snipers",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-snipers",Side:"Starts",Raw:"[12:49:41.076] [Thrasher {3154563284598784}:32161000340653|(14.91,214.13,-11.77,109.65)|(14014529/17328812)] [=] [Spawn Adds {3060692479377408}] [ApplyEffect {836045448945477}: Frenzy {3060692479377700}]",Line:49249})
}

V73RecordedWindowRule225()
{
    V73CheckRecordedRule({Name:"Summoning snipers",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-snipers",Side:"Starts",Raw:"[12:52:41.113] [Thrasher {3154563284598784}:32161000431185|(11.88,212.56,-11.97,108.20)|(13900257/17328812)] [=] [Spawn Adds {3060692479377408}] [ApplyEffect {836045448945477}: Frenzy {3060692479377700}]",Line:54475})
}

V73RecordedWindowRule226()
{
    V73CheckRecordedRule({Name:"Summoning snipers",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-snipers",Side:"Starts",Raw:"[12:55:12.279] [Thrasher {3154563284598784}:32161000463390|(8.97,211.83,-11.92,99.29)|(13824818/17328812)] [=] [Spawn Adds {3060692479377408}] [ApplyEffect {836045448945477}: Frenzy {3060692479377700}]",Line:58452})
}

V73RecordedWindowRule227()
{
    V73CheckRecordedRule({Name:"Summoning snipers",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-snipers",Side:"Ends",Raw:"[12:49:51.079] [Thrasher {3154563284598784}:32161000340653|(18.54,212.32,-11.78,235.11)|(11697037/17328812)] [=] [Spawn Adds {3060692479377408}] [RemoveEffect {836045448945478}: Frenzy {3060692479377700}]",Line:49811})
}

V73RecordedWindowRule228()
{
    V73CheckRecordedRule({Name:"Summoning snipers",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-snipers",Side:"Ends",Raw:"[12:52:51.209] [Thrasher {3154563284598784}:32161000431185|(-1.98,202.56,-11.94,37.01)|(11894308/17328812)] [=] [Spawn Adds {3060692479377408}] [RemoveEffect {836045448945478}: Frenzy {3060692479377700}]",Line:55020})
}

V73RecordedWindowRule229()
{
    V73CheckRecordedRule({Name:"Summoning snipers",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-snipers",Side:"Ends",Raw:"[12:55:22.407] [Thrasher {3154563284598784}:32161000463390|(14.01,196.53,-11.91,-26.94)|(11964527/17328812)] [=] [Spawn Adds {3060692479377408}] [RemoveEffect {836045448945478}: Frenzy {3060692479377700}]",Line:58977})
}

V73RecordedWindowRule230()
{
    V73CheckRecordedRule({Name:"Summoning reinforcements",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-reinforcements",Side:"Starts",Raw:"[12:50:26.589] [Thrasher {3154563284598784}:32161000340653|(26.13,203.61,-11.59,-93.12)|(6615962/17328812)] [=] [Spawn Adds {3262208049938432}] [ApplyEffect {836045448945477}: Frenzy {3262208049938744}]",Line:51748})
}

V73RecordedWindowRule231()
{
    V73CheckRecordedRule({Name:"Summoning reinforcements",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-reinforcements",Side:"Starts",Raw:"[12:53:28.014] [Thrasher {3154563284598784}:32161000431185|(-1.93,200.82,-11.99,126.55)|(6460745/17328812)] [=] [Spawn Adds {3262208049938432}] [ApplyEffect {836045448945477}: Frenzy {3262208049938744}]",Line:56793})
}

V73RecordedWindowRule232()
{
    V73CheckRecordedRule({Name:"Summoning reinforcements",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-reinforcements",Side:"Starts",Raw:"[12:55:57.883] [Thrasher {3154563284598784}:32161000463390|(24.17,182.96,-11.67,-39.83)|(6979605/17328812)] [=] [Spawn Adds {3262208049938432}] [ApplyEffect {836045448945477}: Frenzy {3262208049938744}]",Line:60905})
}

V73RecordedWindowRule233()
{
    V73CheckRecordedRule({Name:"Summoning reinforcements",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-reinforcements",Side:"Ends",Raw:"[12:50:34.592] [Thrasher {3154563284598784}:32161000340653|(26.47,205.15,-11.69,-377.70)|(5394785/17328812)] [=] [Spawn Adds {3262208049938432}] [RemoveEffect {836045448945478}: Frenzy {3262208049938744}]",Line:52059})
}

V73RecordedWindowRule234()
{
    V73CheckRecordedRule({Name:"Summoning reinforcements",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-reinforcements",Side:"Ends",Raw:"[12:53:36.022] [Thrasher {3154563284598784}:32161000431185|(-1.02,198.37,-11.89,-35.89)|(5433135/17328812)] [=] [Spawn Adds {3262208049938432}] [RemoveEffect {836045448945478}: Frenzy {3262208049938744}]",Line:57017})
}

V73RecordedWindowRule235()
{
    V73CheckRecordedRule({Name:"Summoning reinforcements",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"summoning-reinforcements",Side:"Ends",Raw:"[12:56:05.887] [Thrasher {3154563284598784}:32161000463390|(24.17,182.96,-11.67,-40.40)|(5328770/17328812)] [=] [Spawn Adds {3262208049938432}] [RemoveEffect {836045448945478}: Frenzy {3262208049938744}]",Line:61335})
}

V73RecordedWindowRule236()
{
    V73CheckRecordedRule({Name:"Insane Roar",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"insane-roar",Side:"Starts",Raw:"[12:50:36.392] [Thrasher {3154563284598784}:32161000340653|(25.54,207.59,-11.73,17.09)|(5147919/17328812)] [=] [Insane Roar {3257350441926656}] [ApplyEffect {836045448945477}: Insane Roar {3257350441926928}]",Line:52144})
}

V73RecordedWindowRule237()
{
    V73CheckRecordedRule({Name:"Insane Roar",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"insane-roar",Side:"Starts",Raw:"[12:53:37.327] [Thrasher {3154563284598784}:32161000431185|(-1.02,198.37,-11.89,-40.69)|(5324628/17328812)] [=] [Insane Roar {3257350441926656}] [ApplyEffect {836045448945477}: Insane Roar {3257350441926928}]",Line:57043})
}

V73RecordedWindowRule238()
{
    V73CheckRecordedRule({Name:"Insane Roar",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"insane-roar",Side:"Starts",Raw:"[12:56:07.191] [Thrasher {3154563284598784}:32161000463390|(24.17,182.96,-11.67,-40.40)|(5098064/17328812)] [=] [Insane Roar {3257350441926656}] [ApplyEffect {836045448945477}: Insane Roar {3257350441926928}]",Line:61400})
}

V73RecordedWindowRule239()
{
    V73CheckRecordedRule({Name:"Insane Roar",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"insane-roar",Side:"Ends",Raw:"[12:50:57.395] [Thrasher {3154563284598784}:32161000340653|(25.53,207.60,-11.73,17.09)|(2706549/17328812)] [=] [Insane Roar {3257350441926656}] [RemoveEffect {836045448945478}: Insane Roar {3257350441926928}]",Line:52983})
}

V73RecordedWindowRule240()
{
    V73CheckRecordedRule({Name:"Insane Roar",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"insane-roar",Side:"Ends",Raw:"[12:56:28.190] [Thrasher {3154563284598784}:32161000463390|(24.17,182.96,-11.67,-40.40)|(3294578/17328812)] [=] [Insane Roar {3257350441926656}] [RemoveEffect {836045448945478}: Insane Roar {3257350441926928}]",Line:62159})
}

V73RecordedWindowRule241()
{
    V73CheckRecordedRule({Name:"Insane Roar",Boss:"SNV-TH",Area:"137438993037",Mode:"836045448953655",Id:"insane-roar",Side:"Ends",Raw:"[12:59:28.253] [Thrasher {3154563284598784}:32161000504688|(-6.48,191.82,-11.93,19.96)|(896918/17328812)] [=] [Insane Roar {3257350441926656}] [RemoveEffect {836045448945478}: Insane Roar {3257350441926928}]",Line:67569})
}

V73RecordedWindowRule242()
{
    V73CheckRecordedRule({Name:"Rail turret wave",Boss:"SNV-OC",Area:"137438993037",Mode:"836045448953655",Id:"rail-turret-wave",Side:"Starts",Raw:"[13:11:40.970] [Operations Chief {3157548286869504}:32161000644323|(-93.74,-112.87,-79.98,117.25)|(9835296/11702574)] [=] [Summon Rail Turrets {3158012143337472}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:81931})
}

V73RecordedWindowRule243()
{
    V73CheckRecordedRule({Name:"Rail turret wave",Boss:"SNV-OC",Area:"137438993037",Mode:"836045448953655",Id:"rail-turret-wave",Side:"Starts",Raw:"[13:12:13.984] [Operations Chief {3157548286869504}:32161000644323|(-106.21,-110.53,-79.75,-57.20)|(5389782/11702574)] [=] [Summon Rail Turrets {3158012143337472}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:83641})
}

V73RecordedWindowRule244()
{
    V73CheckRecordedRule({Name:"Rail turret wave",Boss:"SNV-OC",Area:"137438993037",Mode:"836045448953655",Id:"rail-turret-wave",Side:"Starts",Raw:"[13:12:17.081] [Operations Chief {3157548286869504}:32161000644323|(-106.21,-110.53,-79.75,76.69)|(4296441/11702574)] [=] [Summon Rail Turrets {3158012143337472}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:83856})
}

V73RecordedWindowRule245()
{
    V73CheckRecordedRule({Name:"Pipe Smash",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"pipe-smash",Side:"Starts",Raw:"[14:36:07.286] [Grob'thok, Who Feeds the Forge {3302559267684352}:95826000259590|(139.43,-514.14,5.63,88.64)|(32540540/42759408)] [=] [Pipe Smash {3307601559289856}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:46215})
}

V73RecordedWindowRule246()
{
    V73CheckRecordedRule({Name:"Pipe Smash",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"pipe-smash",Side:"Starts",Raw:"[14:37:11.529] [Grob'thok, Who Feeds the Forge {3302559267684352}:95826000259590|(141.38,-543.97,5.71,-9.08)|(24979444/42759408)] [=] [Pipe Smash {3307601559289856}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:52225})
}

V73RecordedWindowRule247()
{
    V73CheckRecordedRule({Name:"Pipe Smash",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"pipe-smash",Side:"Starts",Raw:"[14:38:15.184] [Grob'thok, Who Feeds the Forge {3302559267684352}:95826000259590|(175.81,-501.80,5.72,167.16)|(16534212/42759408)] [=] [Pipe Smash {3307601559289856}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:57069})
}

V73RecordedWindowRule248()
{
    V73CheckRecordedRule({Name:"Pipe Smash",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"pipe-smash",Side:"Ends",Raw:"[14:36:10.396] [Grob'thok, Who Feeds the Forge {3302559267684352}:95826000259590|(139.43,-514.14,5.63,45.50)|(31985432/42759408)] [=] [Electro Magnet {3286745198100480}] [ApplyEffect {836045448945477}: Lifted {3286745198100762}]",Line:46519})
}

V73RecordedWindowRule249()
{
    V73CheckRecordedRule({Name:"Pipe Smash",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"pipe-smash",Side:"Ends",Raw:"[14:37:14.638] [Grob'thok, Who Feeds the Forge {3302559267684352}:95826000259590|(141.38,-543.97,5.71,-8.14)|(24560688/42759408)] [=] [Electro Magnet {3286745198100480}] [ApplyEffect {836045448945477}: Lifted {3286745198100762}]",Line:52480})
}

V73RecordedWindowRule250()
{
    V73CheckRecordedRule({Name:"Pipe Smash",Boss:"DF-GR",Area:"137438993402",Mode:"836045448953655",Id:"pipe-smash",Side:"Ends",Raw:"[14:38:18.383] [Grob'thok, Who Feeds the Forge {3302559267684352}:95826000259590|(175.81,-501.80,5.72,167.08)|(16116605/42759408)] [=] [Electro Magnet {3286745198100480}] [ApplyEffect {836045448945477}: Lifted {3286745198100762}]",Line:57309})
}

V73RecordedWindowRule251()
{
    V73CheckRecordedRule({Name:"Get Lost",Boss:"SNV-DA",Area:"137438993037",Mode:"836045448953655",Id:"get-lost",Side:"Starts",Raw:"[12:32:42.852] [Dash'Roode {3153558262251520}:32161000052325|(546.28,412.82,-18.51,-98.81)|(25291536/35902148)] [=] [Get Lost {3063857870274560}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:6525})
}

V73RecordedWindowRule252()
{
    V73CheckRecordedRule({Name:"Nightmare Twin Attack",Boss:"DF-NE",Area:"137438993402",Mode:"836045448953655",Id:"nightmare-twin-attack",Side:"Starts",Raw:"[14:22:06.427] [Nefra, Who Bars the Way {3303031714086912}:95826000002208|(-1.45,-2.22,0.06,96.47)|(10324800/19129210)] [=] [Nightmare Twin Attack {3342167456088064}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:8909})
}

V73RecordedWindowRule253()
{
    V73CheckRecordedRule({Name:"Nightmare Twin Attack",Boss:"DF-NE",Area:"137438993402",Mode:"836045448953655",Id:"nightmare-twin-attack",Side:"Starts",Raw:"[18:50:47.242] [Nefra, Who Bars the Way {3303031714086912}:81855000354141|(-17.96,6.05,0.06,-136.63)|(10952217/19129210)] [=] [Nightmare Twin Attack {3342167456088064}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:8835})
}

V73RecordedWindowRule254()
{
    V73CheckRecordedRule({Name:"Nightmare Twin Attack",Boss:"DF-NE",Area:"137438993402",Mode:"836045448953655",Id:"nightmare-twin-attack",Side:"Starts",Raw:"[20:46:29.063] [Nefra, Who Bars the Way {3303031714086912}:99445000303147|(-1.99,-6.00,0.06,111.55)|(10496109/19129210)] [=] [Nightmare Twin Attack {3342167456088064}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:7769})
}

V73RecordedWindowRule255()
{
    V73CheckRecordedRule({Name:"Simplification",Boss:"DP-TY",Area:"137438993410",Mode:"836045448953655",Id:"simplification",Side:"Starts",Raw:"[21:55:38.861] [Dread Master Tyrans {3273954785492992}:26174000003090|(-144.88,-92.00,-8.82,-73.20)|(35866964/38604992)] [=] [Simplification {3349606339444736}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:22433})
}

V73RecordedWindowRule256()
{
    V73CheckRecordedRule({Name:"Simplification",Boss:"DP-TY",Area:"137438993410",Mode:"836045448953655",Id:"simplification",Side:"Starts",Raw:"[20:42:27.610] [Dread Master Tyrans {3273954785492992}:21034000003869|(-143.61,-92.00,-8.82,-56.45)|(35900636/38604992)] [=] [Simplification {3349606339444736}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:25312})
}

V73RecordedWindowRule257()
{
    V73CheckRecordedRule({Name:"Simplification",Boss:"DP-TY",Area:"137438993410",Mode:"836045448953655",Id:"simplification",Side:"Starts",Raw:"[20:20:23.667] [Dread Master Tyrans {3273954785492992}:102493000889319|(-143.00,-68.00,-8.82,-135.71)|(36712968/38604992)] [=] [Simplification {3349606339444736}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:31927})
}

V73RecordedWindowRule258()
{
    V73CheckRecordedRule({Name:"Inferno",Boss:"DP-TY",Area:"137438993410",Mode:"836045448953655",Id:"inferno",Side:"Starts",Raw:"[21:55:57.461] [Dread Master Tyrans {3273954785492992}:26174000003090|(-149.19,-68.43,-8.82,118.28)|(33532050/38604992)] [=] [Inferno {3298934315286528}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:23372})
}

V73RecordedWindowRule259()
{
    V73CheckRecordedRule({Name:"Inferno",Boss:"DP-TY",Area:"137438993410",Mode:"836045448953655",Id:"inferno",Side:"Starts",Raw:"[20:42:46.119] [Dread Master Tyrans {3273954785492992}:21034000003869|(-151.00,-68.00,-8.82,-162.77)|(33244842/38604992)] [=] [Inferno {3298934315286528}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:26329})
}

V73RecordedWindowRule260()
{
    V73CheckRecordedRule({Name:"Inferno",Boss:"DP-TY",Area:"137438993410",Mode:"836045448953655",Id:"inferno",Side:"Starts",Raw:"[20:20:42.885] [Dread Master Tyrans {3273954785492992}:102493000889319|(-151.00,-68.00,-8.82,126.44)|(34214992/38604992)] [=] [Inferno {3298934315286528}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:32793})
}

V73RecordedWindowRule261()
{
    V73CheckRecordedRule({Name:"Manifestation cast",Boss:"SNV-ST",Area:"137438993037",Mode:"836045448953655",Id:"chained-manifestation",Side:"Starts",Raw:"[14:14:43.838] [Dread Master Styrak {3152407211016192}:32161001452827|(-1004.98,374.09,-35.17,-152.86)|(26424432/29706534)] [=] [Chained Manifestation {3144508766158848}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:210095})
}

; Native recorded modern phase-window regressions.
; Player tokens anonymized; exact NPC/event IDs, clocks and instances preserved.
; Original source hashes and excerpts are in the release research evidence.
; Each group creates only a private in-memory segment and uses the native parser.

V73ModernWindow01()
{
    V73ModernWindowCase(V73ModernWindowCases()[1])
}

V73ModernWindow02()
{
    V73ModernWindowCase(V73ModernWindowCases()[2])
}

V73ModernWindow03()
{
    V73ModernWindowCase(V73ModernWindowCases()[3])
}

V73ModernWindow04()
{
    V73ModernWindowCase(V73ModernWindowCases()[4])
}

V73ModernWindow05()
{
    V73ModernWindowCase(V73ModernWindowCases()[5])
}

V73ModernWindow06()
{
    V73ModernWindowCase(V73ModernWindowCases()[6])
}

V73ModernWindow07()
{
    V73ModernWindowCase(V73ModernWindowCases()[7])
}

V73ModernWindow08()
{
    V73ModernWindowCase(V73ModernWindowCases()[8])
}

V73ModernWindow09()
{
    V73ModernWindowCase(V73ModernWindowCases()[9])
}

V73ModernWindow10()
{
    V73ModernWindowCase(V73ModernWindowCases()[10])
}

V73ModernWindow11()
{
    V73ModernWindowCase(V73ModernWindowCases()[11])
}

V73ModernWindow12()
{
    V73ModernWindowCase(V73ModernWindowCases()[12])
}

V73ModernWindow13()
{
    V73ModernWindowCase(V73ModernWindowCases()[13])
}

V73ModernWindow14()
{
    V73ModernWindowCase(V73ModernWindowCases()[14])
}

V73ModernWindow15()
{
    V73ModernWindowCase(V73ModernWindowCases()[15])
}

V73ModernWindow16()
{
    V73ModernWindowCase(V73ModernWindowCases()[16])
}

V73ModernWindow17()
{
    V73ModernWindowCase(V73ModernWindowCases()[17])
}

V73ModernWindow18()
{
    V73ModernWindowCase(V73ModernWindowCases()[18])
}

V73ModernWindow19()
{
    V73ModernWindowCase(V73ModernWindowCases()[19])
}

V73ModernWindow20()
{
    V73ModernWindowCase(V73ModernWindowCases()[20])
}

V73ModernWindow21()
{
    V73ModernWindowCase(V73ModernWindowCases()[21])
}

V73ModernWindow22()
{
    V73ModernWindowCase(V73ModernWindowCases()[22])
}

V73ModernWindow23()
{
    V73ModernWindowCase(V73ModernWindowCases()[23])
}

V73ModernWindow24()
{
    V73ModernWindowCase(V73ModernWindowCases()[24])
}

V73ModernWindow25()
{
    V73ModernWindowCase(V73ModernWindowCases()[25])
}

V73ModernWindowInstance(w)
{
    key := w.StartInstance!="" ? w.StartInstance : (SubStr(w.StartSource,1,2)="N:" ? w.StartSource : w.StartTarget)
    pieces := StrSplit(key,":")
    return pieces.Length>=3 ? pieces[3] : ""
}

V73ModernWindowCase(c)
{
    seg := {BossKey:c.Boss,AreaId:c.Area,ModeId:c.Mode,Start:c.Start},p := IGWProfile(seg),found := ""
    V48Assert(IsObject(p),"Exact scoped section profile exists")
    for def in p.Windows {
        if c.OverrideId!="" ? def.Id=c.OverrideId : def.Name=c.WindowName {
            V48Assert(!IsObject(found),"Window resolves uniquely")
            found := def
        }
    }
    V48Assert(IsObject(found),"Named window exists: " c.WindowName)
    for rec in c.Records {
        ev := IPParseLine(rec.Raw)
        V48Assert(IsObject(ev),"Original raw witness parses at line " rec.Line)
        ev.RecordId := rec.Line
        IGWObserve(seg,ev,rec.At)
    }
    V48Assert(seg.HasOwnProp("PhaseWindows"),"Native section state created")
    state := seg.PhaseWindows,actual := []
    Loop state.Meta.Get("Count:" found.Id,0)
        actual.Push(state.Windows[found.Id ":" A_Index])
    V48Assert(actual.Length=c.Expected.Length,"Window count expected " c.Expected.Length " got " actual.Length)
    result := {Id:found.Id,Windows:[],Records:c.Records.Length}
    for i,exp in c.Expected {
        w := actual[i],instance := V73ModernWindowInstance(w)
        V48Assert(w.Start=exp.Start,"Window " i " start expected " exp.Start " got " w.Start)
        V48Assert(w.End=exp.End,"Window " i " end expected " exp.End " got " w.End)
        V48Assert(w.StartSeq=exp.StartLine,"Window " i " start source line")
        V48Assert(w.EndSeq=exp.EndLine,"Window " i " end source line")
        V48Assert(instance=exp.Instance,"Window " i " exact actor instance")
        if c.Fence>=0
            V48Assert(w.Start<=c.Fence && (w.End<0 || w.End<=c.Fence),"Native boss endpoint fence")
        result.Windows.Push({Start:w.Start,End:w.End,StartLine:w.StartSeq,EndLine:w.EndSeq,Instance:instance,Partial:w.End<0})
    }
    packed := IGWPack(IGWCompact(seg)),round := IGWUnpack(packed)
    V48Assert(IGWMatches(round,p),"Section persistence round trip retains scoped definition")
    for row in round.Counts {
        if row.Id=found.Id {
            V48Assert(row.Started=actual.Length,"Persisted starts")
            done := 0
            for exp in c.Expected
                done += exp.End>=0 ? 1 : 0
            V48Assert(row.Completed=done,"Persisted completed count preserves partials")
        }
    }
    return result
}


V73ModernWindowCases()
{
    static cases := [
{Name:"tyth-inversion-cast-8m-v1-case1",WindowName:"Inversion cast",OverrideId:"",Boss:"G-TY",Area:"833571547775765",Mode:"836045448953655",Start:68332855,Fence:-1,Records:[
{Raw:"[18:59:15.063] [TYTH {4078423634870272}:39977000410434|(808.96,2347.65,228.52,-204.51)|(16792482/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:52042,At:68355063},
{Raw:"[18:59:20.169] [TYTH {4078423634870272}:39977000410434|(808.87,2347.79,228.50,-128.41)|(16269092/19989636)] [@Recorded Player 1#1|(821.33,2349.13,228.52,136.54)|(401612/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52441,At:68360169},
{Raw:"[18:59:20.170] [TYTH {4078423634870272}:39977000410434|(808.87,2347.79,228.50,-128.41)|(16269092/19989636)] [@Recorded Player 2#2|(821.52,2347.61,228.52,111.50)|(311166/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52442,At:68360170},
{Raw:"[18:59:20.170] [TYTH {4078423634870272}:39977000410434|(808.87,2347.79,228.50,-128.41)|(16269092/19989636)] [@Recorded Player 3#3|(798.98,2340.99,228.52,-141.39)|(324158/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52443,At:68360170},
{Raw:"[18:59:20.170] [TYTH {4078423634870272}:39977000410434|(808.87,2347.79,228.50,-128.41)|(16269092/19989636)] [@Recorded Player 4#4|(796.43,2349.93,228.52,36.42)|(309313/437695)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52444,At:68360170},
{Raw:"[18:59:20.170] [TYTH {4078423634870272}:39977000410434|(808.87,2347.79,228.50,-128.41)|(16269092/19989636)] [@Recorded Player 5#5|(804.31,2360.38,228.52,-42.95)|(490735/490735)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52449,At:68360170},
{Raw:"[18:59:20.171] [TYTH {4078423634870272}:39977000410434|(808.87,2347.79,228.50,-128.41)|(16269092/19989636)] [@Recorded Player 6#6|(819.12,2338.91,228.52,-134.08)|(298881/443411)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52450,At:68360171},
{Raw:"[18:59:20.171] [TYTH {4078423634870272}:39977000410434|(808.87,2347.79,228.50,-128.41)|(16269092/19989636)] [@Recorded Player 7#7|(824.20,2360.28,228.52,53.20)|(471372/472036)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:52451,At:68360171},
{Raw:"[18:59:20.171] [TYTH {4078423634870272}:39977000410434|(808.87,2347.79,228.50,-128.41)|(16269092/19989636)] [@Recorded Player 8#8|(788.70,2351.77,228.52,-125.83)|(416212/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:52452,At:68360171},
{Raw:"[18:59:53.620] [TYTH {4078423634870272}:39977000410434|(795.88,2359.99,228.52,128.12)|(13947846/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:54396,At:68393620},
{Raw:"[18:59:58.653] [TYTH {4078423634870272}:39977000410434|(796.49,2359.51,228.50,-79.03)|(13884111/19989636)] [@Recorded Player 8#8|(791.75,2366.19,228.52,15.06)|(385005/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:54625,At:68398653},
{Raw:"[18:59:58.653] [TYTH {4078423634870272}:39977000410434|(796.49,2359.51,228.50,-79.03)|(13884111/19989636)] [@Recorded Player 1#1|(792.92,2371.19,228.52,-14.01)|(443752/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:54626,At:68398653},
{Raw:"[18:59:58.653] [TYTH {4078423634870272}:39977000410434|(796.49,2359.51,228.50,-79.03)|(13884111/19989636)] [@Recorded Player 7#7|(784.66,2364.70,228.52,-65.16)|(411736/472036)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:54628,At:68398653},
{Raw:"[18:59:58.653] [TYTH {4078423634870272}:39977000410434|(796.49,2359.51,228.50,-79.03)|(13884111/19989636)] [@Recorded Player 4#4|(791.60,2371.80,228.52,-18.54)|(437695/437695)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:54629,At:68398653},
{Raw:"[18:59:58.653] [TYTH {4078423634870272}:39977000410434|(796.49,2359.51,228.50,-79.03)|(13884111/19989636)] [@Recorded Player 3#3|(793.39,2372.79,228.52,3.95)|(439324/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:54630,At:68398653},
{Raw:"[18:59:58.653] [TYTH {4078423634870272}:39977000410434|(796.49,2359.51,228.50,-79.03)|(13884111/19989636)] [@Recorded Player 5#5|(816.44,2356.07,228.52,92.83)|(420173/490735)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:54631,At:68398653},
{Raw:"[18:59:58.653] [TYTH {4078423634870272}:39977000410434|(796.49,2359.51,228.50,-79.03)|(13884111/19989636)] [@Recorded Player 6#6|(793.35,2328.87,228.52,78.74)|(351220/443411)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:54632,At:68398653},
{Raw:"[18:59:58.654] [TYTH {4078423634870272}:39977000410434|(796.49,2359.51,228.50,-79.03)|(13884111/19989636)] [@Recorded Player 2#2|(822.53,2336.12,228.52,106.99)|(443634/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:54633,At:68398654},
{Raw:"[19:00:31.763] [TYTH {4078423634870272}:39977000410434|(793.98,2357.51,228.52,-172.52)|(11707516/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:56741,At:68431763},
{Raw:"[19:00:36.776] [TYTH {4078423634870272}:39977000410434|(793.82,2357.04,228.50,-38.35)|(11114096/19989636)] [@Recorded Player 8#8|(788.21,2362.42,228.52,-44.46)|(413991/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:56985,At:68436776},
{Raw:"[19:00:36.776] [TYTH {4078423634870272}:39977000410434|(793.82,2357.04,228.50,-38.35)|(11114096/19989636)] [@Recorded Player 1#1|(788.77,2366.41,228.52,-18.00)|(396638/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:56986,At:68436776},
{Raw:"[19:00:36.776] [TYTH {4078423634870272}:39977000410434|(793.82,2357.04,228.50,-38.35)|(11114096/19989636)] [@Recorded Player 4#4|(786.88,2364.03,228.52,-39.95)|(437695/437695)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:56987,At:68436776},
{Raw:"[19:00:36.776] [TYTH {4078423634870272}:39977000410434|(793.82,2357.04,228.50,-38.35)|(11114096/19989636)] [@Recorded Player 5#5|(788.53,2367.43,228.52,-19.72)|(274230/490735)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:56989,At:68436776},
{Raw:"[19:00:36.776] [TYTH {4078423634870272}:39977000410434|(793.82,2357.04,228.50,-38.35)|(11114096/19989636)] [@Recorded Player 6#6|(786.03,2365.84,228.52,63.66)|(443411/443411)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:56990,At:68436776},
{Raw:"[19:00:36.776] [TYTH {4078423634870272}:39977000410434|(793.82,2357.04,228.50,-38.35)|(11114096/19989636)] [@Recorded Player 2#2|(785.15,2366.38,228.52,-40.01)|(443634/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:56991,At:68436776},
{Raw:"[19:00:36.776] [TYTH {4078423634870272}:39977000410434|(793.82,2357.04,228.50,-38.35)|(11114096/19989636)] [@Recorded Player 3#3|(786.27,2367.60,228.52,-47.04)|(443352/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:56992,At:68436776},
{Raw:"[19:00:36.776] [TYTH {4078423634870272}:39977000410434|(793.82,2357.04,228.50,-38.35)|(11114096/19989636)] [@Recorded Player 7#7|(810.04,2336.54,228.52,161.40)|(343194/472036)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:56993,At:68436776},
{Raw:"[19:01:08.807] [TYTH {4078423634870272}:39977000410434|(823.53,2350.29,228.52,-54.27)|(9571002/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:58746,At:68468807},
{Raw:"[19:01:13.918] [TYTH {4078423634870272}:39977000410434|(823.46,2350.34,228.50,-98.29)|(9295321/19989636)] [@Recorded Player 7#7|(833.10,2351.75,228.52,89.64)|(472036/472036)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:58996,At:68473918},
{Raw:"[19:01:13.918] [TYTH {4078423634870272}:39977000410434|(823.46,2350.34,228.50,-98.29)|(9295321/19989636)] [@Recorded Player 8#8|(830.58,2350.52,228.52,93.07)|(443782/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:58997,At:68473918},
{Raw:"[19:01:13.918] [TYTH {4078423634870272}:39977000410434|(823.46,2350.34,228.50,-98.29)|(9295321/19989636)] [@Recorded Player 1#1|(833.92,2350.10,228.52,93.94)|(443752/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:58998,At:68473918},
{Raw:"[19:01:13.919] [TYTH {4078423634870272}:39977000410434|(823.46,2350.34,228.50,-98.29)|(9295321/19989636)] [@Recorded Player 2#2|(835.39,2351.44,228.52,84.73)|(443634/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:58999,At:68473919},
{Raw:"[19:01:13.919] [TYTH {4078423634870272}:39977000410434|(823.46,2350.34,228.50,-98.29)|(9295321/19989636)] [@Recorded Player 4#4|(835.19,2354.57,228.52,92.06)|(437695/437695)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:59000,At:68473919},
{Raw:"[19:01:13.919] [TYTH {4078423634870272}:39977000410434|(823.46,2350.34,228.50,-98.29)|(9295321/19989636)] [@Recorded Player 3#3|(836.14,2354.02,228.52,73.95)|(443352/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:59001,At:68473919},
{Raw:"[19:01:13.919] [TYTH {4078423634870272}:39977000410434|(823.46,2350.34,228.50,-98.29)|(9295321/19989636)] [@Recorded Player 5#5|(810.71,2336.52,228.52,-117.74)|(454169/490735)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:59002,At:68473919},
{Raw:"[19:01:13.919] [TYTH {4078423634870272}:39977000410434|(823.46,2350.34,228.50,-98.29)|(9295321/19989636)] [@Recorded Player 6#6|(793.12,2362.01,228.52,84.38)|(443411/443411)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:59003,At:68473919},
{Raw:"[19:01:46.861] [TYTH {4078423634870272}:39977000410434|(826.64,2345.16,228.52,-25.77)|(8989605/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:60977,At:68506861},
{Raw:"[19:01:51.865] [TYTH {4078423634870272}:39977000410434|(825.92,2346.68,228.50,104.87)|(8830984/19989636)] [@Recorded Player 8#8|(834.23,2346.85,228.52,88.39)|(442258/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:61157,At:68511865},
{Raw:"[19:01:51.865] [TYTH {4078423634870272}:39977000410434|(825.92,2346.68,228.50,104.87)|(8830984/19989636)] [@Recorded Player 4#4|(835.14,2346.22,228.52,99.72)|(437695/437695)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:61158,At:68511865},
{Raw:"[19:01:51.865] [TYTH {4078423634870272}:39977000410434|(825.92,2346.68,228.50,104.87)|(8830984/19989636)] [@Recorded Player 1#1|(836.14,2346.10,228.52,93.02)|(270250/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:61159,At:68511865},
{Raw:"[19:01:51.865] [TYTH {4078423634870272}:39977000410434|(825.92,2346.68,228.50,104.87)|(8830984/19989636)] [@Recorded Player 5#5|(835.73,2342.90,228.52,111.49)|(294005/490735)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:61161,At:68511865},
{Raw:"[19:01:51.865] [TYTH {4078423634870272}:39977000410434|(825.92,2346.68,228.50,104.87)|(8830984/19989636)] [@Recorded Player 2#2|(836.95,2345.88,228.52,93.74)|(443634/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:61162,At:68511865},
{Raw:"[19:01:51.865] [TYTH {4078423634870272}:39977000410434|(825.92,2346.68,228.50,104.87)|(8830984/19989636)] [@Recorded Player 3#3|(838.64,2350.46,228.52,65.55)|(430305/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:61163,At:68511865},
{Raw:"[19:01:51.866] [TYTH {4078423634870272}:39977000410434|(825.92,2346.68,228.50,104.87)|(8830984/19989636)] [@Recorded Player 6#6|(838.61,2344.28,228.52,-163.73)|(355381/443411)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:61164,At:68511866},
{Raw:"[19:01:51.866] [TYTH {4078423634870272}:39977000410434|(825.92,2346.68,228.50,104.87)|(8830984/19989636)] [@Recorded Player 7#7|(802.69,2352.85,228.52,-67.50)|(278355/472036)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:61165,At:68511866},
{Raw:"[19:02:25.281] [TYTH {4078423634870272}:39977000410434|(781.94,2348.48,228.52,99.89)|(7231374/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:62874,At:68545281},
{Raw:"[19:02:30.416] [TYTH {4078423634870272}:39977000410434|(782.04,2348.47,228.50,104.51)|(7012367/19989636)] [@Recorded Player 8#8|(776.35,2351.61,228.52,-62.48)|(331654/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:63092,At:68550416},
{Raw:"[19:02:30.416] [TYTH {4078423634870272}:39977000410434|(782.04,2348.47,228.50,104.51)|(7012367/19989636)] [@Recorded Player 7#7|(774.94,2350.30,228.52,-64.93)|(392312/472036)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:63094,At:68550416},
{Raw:"[19:02:30.416] [TYTH {4078423634870272}:39977000410434|(782.04,2348.47,228.50,104.51)|(7012367/19989636)] [@Recorded Player 3#3|(773.00,2349.52,228.52,-83.45)|(367308/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:63095,At:68550416},
{Raw:"[19:02:30.416] [TYTH {4078423634870272}:39977000410434|(782.04,2348.47,228.50,104.51)|(7012367/19989636)] [@Recorded Player 1#1|(792.59,2334.95,228.52,-143.73)|(177599/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:63096,At:68550416},
{Raw:"[19:02:30.417] [TYTH {4078423634870272}:39977000410434|(782.04,2348.47,228.50,104.51)|(7012367/19989636)] [@Recorded Player 5#5|(800.71,2328.71,228.52,145.16)|(422129/490735)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:63097,At:68550417},
{Raw:"[19:02:30.417] [TYTH {4078423634870272}:39977000410434|(782.04,2348.47,228.50,104.51)|(7012367/19989636)] [@Recorded Player 4#4|(812.62,2322.33,228.52,135.60)|(437695/437695)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:63098,At:68550417},
{Raw:"[19:02:30.417] [TYTH {4078423634870272}:39977000410434|(782.04,2348.47,228.50,104.51)|(7012367/19989636)] [@Recorded Player 2#2|(817.70,2329.66,228.52,132.87)|(443634/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:63099,At:68550417},
{Raw:"[19:02:30.417] [TYTH {4078423634870272}:39977000410434|(782.04,2348.47,228.50,104.51)|(7012367/19989636)] [@Recorded Player 6#6|(822.46,2333.62,228.52,59.25)|(289763/443411)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:63100,At:68550417},
{Raw:"[19:03:05.294] [TYTH {4078423634870272}:39977000410434|(792.21,2358.36,228.52,104.49)|(7029705/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:64831,At:68585294},
{Raw:"[19:03:10.402] [TYTH {4078423634870272}:39977000410434|(792.21,2358.37,228.50,-21.02)|(6962480/19989636)] [@Recorded Player 4#4|(786.68,2366.07,228.52,17.01)|(264715/437695)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:65083,At:68590402},
{Raw:"[19:03:10.402] [TYTH {4078423634870272}:39977000410434|(792.21,2358.37,228.50,-21.02)|(6962480/19989636)] [@Recorded Player 1#1|(782.29,2358.90,228.52,-142.31)|(279361/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:65084,At:68590402},
{Raw:"[19:03:10.402] [TYTH {4078423634870272}:39977000410434|(792.21,2358.37,228.50,-21.02)|(6962480/19989636)] [@Recorded Player 5#5|(787.90,2368.76,228.52,-24.35)|(361091/490735)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:65086,At:68590402},
{Raw:"[19:03:10.403] [TYTH {4078423634870272}:39977000410434|(792.21,2358.37,228.50,-21.02)|(6962480/19989636)] [@Recorded Player 3#3|(784.69,2365.38,228.52,-121.16)|(357412/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:65088,At:68590403},
{Raw:"[19:03:10.403] [TYTH {4078423634870272}:39977000410434|(792.21,2358.37,228.50,-21.02)|(6962480/19989636)] [@Recorded Player 7#7|(801.66,2334.39,228.52,158.98)|(424161/472036)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:65089,At:68590403},
{Raw:"[19:03:10.403] [TYTH {4078423634870272}:39977000410434|(792.21,2358.37,228.50,-21.02)|(6962480/19989636)] [@Recorded Player 8#8|(798.61,2332.73,228.52,-158.85)|(213568/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:65090,At:68590403},
{Raw:"[19:03:10.403] [TYTH {4078423634870272}:39977000410434|(792.21,2358.37,228.50,-21.02)|(6962480/19989636)] [@Recorded Player 2#2|(813.86,2334.06,228.52,156.37)|(192101/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:65091,At:68590403},
{Raw:"[19:03:43.818] [TYTH {4078423634870272}:39977000410434|(786.33,2341.94,228.52,144.99)|(7448779/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:66848,At:68623818},
{Raw:"[19:03:48.822] [TYTH {4078423634870272}:39977000410434|(786.37,2341.99,228.50,141.65)|(7344596/19989636)] [@Recorded Player 1#1|(778.52,2342.60,228.52,-67.19)|(349259/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:67068,At:68628822},
{Raw:"[19:03:48.822] [TYTH {4078423634870272}:39977000410434|(786.37,2341.99,228.50,141.65)|(7344596/19989636)] [@Recorded Player 8#8|(777.89,2338.96,228.52,-146.05)|(395405/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:67069,At:68628822},
{Raw:"[19:03:48.822] [TYTH {4078423634870272}:39977000410434|(786.37,2341.99,228.50,141.65)|(7344596/19989636)] [@Recorded Player 4#4|(774.70,2340.41,228.52,-81.83)|(353486/437695)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:67070,At:68628822},
{Raw:"[19:03:48.822] [TYTH {4078423634870272}:39977000410434|(786.37,2341.99,228.50,141.65)|(7344596/19989636)] [@Recorded Player 3#3|(774.66,2340.63,228.52,-179.81)|(400775/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:67071,At:68628822},
{Raw:"[19:03:48.822] [TYTH {4078423634870272}:39977000410434|(786.37,2341.99,228.50,141.65)|(7344596/19989636)] [@Recorded Player 7#7|(778.89,2351.48,228.52,-40.55)|(472036/472036)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:67073,At:68628822},
{Raw:"[19:03:48.822] [TYTH {4078423634870272}:39977000410434|(786.37,2341.99,228.50,141.65)|(7344596/19989636)] [@Recorded Player 6#6|(774.16,2338.87,228.52,-152.38)|(435774/443411)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:67074,At:68628822},
{Raw:"[19:03:48.822] [TYTH {4078423634870272}:39977000410434|(786.37,2341.99,228.50,141.65)|(7344596/19989636)] [@Recorded Player 5#5|(813.31,2351.16,228.52,164.22)|(490735/490735)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:67075,At:68628822},
{Raw:"[19:03:48.822] [TYTH {4078423634870272}:39977000410434|(786.37,2341.99,228.50,141.65)|(7344596/19989636)] [@Recorded Player 2#2|(820.58,2347.70,228.52,84.13)|(330275/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:67076,At:68628822},
{Raw:"[19:04:20.830] [TYTH {4078423634870272}:39977000410434|(794.79,2339.79,228.52,281.46)|(5618836/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:68794,At:68660830},
{Raw:"[19:04:25.835] [TYTH {4078423634870272}:39977000410434|(795.25,2339.71,228.50,-88.23)|(5444129/19989636)] [@Recorded Player 1#1|(787.08,2331.84,228.52,-73.92)|(167826/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:69066,At:68665835},
{Raw:"[19:04:25.835] [TYTH {4078423634870272}:39977000410434|(795.25,2339.71,228.50,-88.23)|(5444129/19989636)] [@Recorded Player 4#4|(784.99,2336.12,228.52,-113.10)|(425192/437695)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:69067,At:68665835},
{Raw:"[19:04:25.836] [TYTH {4078423634870272}:39977000410434|(795.25,2339.71,228.50,-88.23)|(5444129/19989636)] [@Recorded Player 8#8|(784.05,2338.38,228.52,-75.64)|(147689/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:69068,At:68665836},
{Raw:"[19:04:25.836] [TYTH {4078423634870272}:39977000410434|(795.25,2339.71,228.50,-88.23)|(5444129/19989636)] [@Recorded Player 6#6|(791.49,2328.35,228.52,-169.54)|(323650/443411)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:69070,At:68665836},
{Raw:"[19:04:25.836] [TYTH {4078423634870272}:39977000410434|(795.25,2339.71,228.50,-88.23)|(5444129/19989636)] [@Recorded Player 2#2|(784.65,2333.50,228.52,123.14)|(291189/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:69071,At:68665836},
{Raw:"[19:04:25.836] [TYTH {4078423634870272}:39977000410434|(795.25,2339.71,228.50,-88.23)|(5444129/19989636)] [@Recorded Player 3#3|(783.01,2335.35,228.52,-107.85)|(260725/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:69073,At:68665836},
{Raw:"[19:04:25.836] [TYTH {4078423634870272}:39977000410434|(795.25,2339.71,228.50,-88.23)|(5444129/19989636)] [@Recorded Player 5#5|(784.01,2332.47,228.52,-121.72)|(201802/490735)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:69075,At:68665836},
{Raw:"[19:04:25.836] [TYTH {4078423634870272}:39977000410434|(795.25,2339.71,228.50,-88.23)|(5444129/19989636)] [@Recorded Player 7#7|(816.22,2338.44,228.52,148.25)|(348565/472036)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:69076,At:68665836},
{Raw:"[19:04:59.353] [TYTH {4078423634870272}:39977000410434|(793.42,2357.62,228.52,166.15)|(6346569/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:70767,At:68699353},
{Raw:"[19:05:04.375] [TYTH {4078423634870272}:39977000410434|(793.45,2357.58,228.50,119.61)|(6047546/19989636)] [@Recorded Player 8#8|(789.54,2364.94,228.52,-28.02)|(390806/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:71020,At:68704375},
{Raw:"[19:05:04.375] [TYTH {4078423634870272}:39977000410434|(793.45,2357.58,228.50,119.61)|(6047546/19989636)] [@Recorded Player 1#1|(787.47,2366.00,228.52,-30.76)|(362574/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:71021,At:68704375},
{Raw:"[19:05:04.375] [TYTH {4078423634870272}:39977000410434|(793.45,2357.58,228.50,119.61)|(6047546/19989636)] [@Recorded Player 7#7|(784.48,2363.69,228.52,-54.91)|(391099/472036)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:71023,At:68704375},
{Raw:"[19:05:04.375] [TYTH {4078423634870272}:39977000410434|(793.45,2357.58,228.50,119.61)|(6047546/19989636)] [@Recorded Player 4#4|(786.45,2366.81,228.52,-41.32)|(420984/437695)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:71024,At:68704375},
{Raw:"[19:05:04.375] [TYTH {4078423634870272}:39977000410434|(793.45,2357.58,228.50,119.61)|(6047546/19989636)] [@Recorded Player 2#2|(785.88,2366.09,228.52,-32.03)|(325228/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:71025,At:68704375},
{Raw:"[19:05:04.375] [TYTH {4078423634870272}:39977000410434|(793.45,2357.58,228.50,119.61)|(6047546/19989636)] [@Recorded Player 3#3|(782.94,2366.46,228.52,-50.22)|(427424/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:71026,At:68704375},
{Raw:"[19:05:04.375] [TYTH {4078423634870272}:39977000410434|(793.45,2357.58,228.50,119.61)|(6047546/19989636)] [@Recorded Player 5#5|(811.53,2346.00,228.52,70.11)|(484589/490735)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:71027,At:68704375},
{Raw:"[19:05:04.375] [TYTH {4078423634870272}:39977000410434|(793.45,2357.58,228.50,119.61)|(6047546/19989636)] [@Recorded Player 6#6|(823.16,2353.65,228.52,90.81)|(327186/443411)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:71028,At:68704375},
{Raw:"[19:05:40.400] [TYTH {4078423634870272}:39977000410434|(803.32,2317.23,228.52,189.52)|(935411/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:73208,At:68740400},
{Raw:"[19:05:45.508] [TYTH {4078423634870272}:39977000410434|(803.32,2317.15,228.50,-159.53)|(690011/19989636)] [@Recorded Player 4#4|(802.62,2314.29,228.52,141.93)|(345163/437695)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:73433,At:68745508},
{Raw:"[19:05:45.508] [TYTH {4078423634870272}:39977000410434|(803.32,2317.15,228.50,-159.53)|(690011/19989636)] [@Recorded Player 1#1|(800.36,2315.31,228.52,-122.93)|(443752/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:73434,At:68745508},
{Raw:"[19:05:45.508] [TYTH {4078423634870272}:39977000410434|(803.32,2317.15,228.50,-159.53)|(690011/19989636)] [@Recorded Player 2#2|(802.57,2313.71,228.52,-168.13)|(431277/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:73435,At:68745508},
{Raw:"[19:05:45.508] [TYTH {4078423634870272}:39977000410434|(803.32,2317.15,228.50,-159.53)|(690011/19989636)] [@Recorded Player 6#6|(804.57,2313.30,228.52,154.99)|(443411/443411)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:73436,At:68745508},
{Raw:"[19:05:45.508] [TYTH {4078423634870272}:39977000410434|(803.32,2317.15,228.50,-159.53)|(690011/19989636)] [@Recorded Player 8#8|(804.45,2312.09,228.52,167.43)|(310272/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:73438,At:68745508},
{Raw:"[19:05:45.508] [TYTH {4078423634870272}:39977000410434|(803.32,2317.15,228.50,-159.53)|(690011/19989636)] [@Recorded Player 3#3|(803.98,2310.90,228.52,173.85)|(443352/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:73439,At:68745508},
{Raw:"[19:05:45.508] [TYTH {4078423634870272}:39977000410434|(803.32,2317.15,228.50,-159.53)|(690011/19989636)] [@Recorded Player 7#7|(814.44,2349.80,228.52,29.22)|(115584/472036)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:73440,At:68745508}
],Expected:[
{Start:68355063,End:68360169,StartLine:52042,EndLine:52441,Instance:"39977000410434"},
{Start:68393620,End:68398653,StartLine:54396,EndLine:54625,Instance:"39977000410434"},
{Start:68431763,End:68436776,StartLine:56741,EndLine:56985,Instance:"39977000410434"},
{Start:68468807,End:68473918,StartLine:58746,EndLine:58996,Instance:"39977000410434"},
{Start:68506861,End:68511865,StartLine:60977,EndLine:61157,Instance:"39977000410434"},
{Start:68545281,End:68550416,StartLine:62874,EndLine:63092,Instance:"39977000410434"},
{Start:68585294,End:68590402,StartLine:64831,EndLine:65083,Instance:"39977000410434"},
{Start:68623818,End:68628822,StartLine:66848,EndLine:67068,Instance:"39977000410434"},
{Start:68660830,End:68665835,StartLine:68794,EndLine:69066,Instance:"39977000410434"},
{Start:68699353,End:68704375,StartLine:70767,EndLine:71020,Instance:"39977000410434"},
{Start:68740400,End:68745508,StartLine:73208,EndLine:73433,Instance:"39977000410434"}
]},
{Name:"tyth-inversion-cast-8m-v1-case2",WindowName:"Inversion cast",OverrideId:"",Boss:"G-TY",Area:"833571547775765",Mode:"836045448953655",Start:55739919,Fence:-1,Records:[
{Raw:"[15:29:21.068] [TYTH {4078423634870272}:66590000316688|(804.64,2346.12,228.52,-178.49)|(18172684/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:40386,At:55761068},
{Raw:"[15:29:26.154] [TYTH {4078423634870272}:66590000316688|(804.64,2346.16,228.50,71.02)|(18048758/19989636)] [@Recorded Player 9#9|(793.29,2350.90,228.52,-67.20)|(429678/483839)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:40664,At:55766154},
{Raw:"[15:29:26.154] [TYTH {4078423634870272}:66590000316688|(804.64,2346.16,228.50,71.02)|(18048758/19989636)] [@Recorded Player 10#10|(797.95,2337.62,228.52,-144.02)|(423501/423501)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:40666,At:55766154},
{Raw:"[15:29:26.154] [TYTH {4078423634870272}:66590000316688|(804.64,2346.16,228.50,71.02)|(18048758/19989636)] [@Recorded Player 11#11|(798.24,2334.63,228.52,-97.32)|(427841/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:40667,At:55766154},
{Raw:"[15:29:26.154] [TYTH {4078423634870272}:66590000316688|(804.64,2346.16,228.50,71.02)|(18048758/19989636)] [@Recorded Player 12#12|(814.38,2336.69,228.52,78.40)|(423204/423204)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:40668,At:55766154},
{Raw:"[15:29:26.154] [TYTH {4078423634870272}:66590000316688|(804.64,2346.16,228.50,71.02)|(18048758/19989636)] [@Recorded Player 13#13|(818.06,2344.01,228.52,98.06)|(443441/443441)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:40669,At:55766154},
{Raw:"[15:29:26.154] [TYTH {4078423634870272}:66590000316688|(804.64,2346.16,228.50,71.02)|(18048758/19989636)] [@Recorded Player 14#14|(815.09,2335.07,228.52,94.15)|(386089/443530)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:40670,At:55766154},
{Raw:"[15:29:26.155] [TYTH {4078423634870272}:66590000316688|(804.64,2346.16,228.50,71.02)|(18048758/19989636)] [@Recorded Player 15#15|(812.31,2332.11,228.52,150.38)|(443782/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:40671,At:55766155},
{Raw:"[15:29:26.155] [TYTH {4078423634870272}:66590000316688|(804.64,2346.16,228.50,71.02)|(18048758/19989636)] [@Recorded Player 16#16|(786.03,2339.76,228.52,-109.22)|(492710/492710)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:40672,At:55766155},
{Raw:"[15:29:59.037] [TYTH {4078423634870272}:66590000316688|(821.97,2329.35,228.52,316.15)|(16101387/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:42587,At:55799037},
{Raw:"[15:30:04.070] [TYTH {4078423634870272}:66590000316688|(821.60,2329.78,228.50,-64.61)|(16032142/19989636)] [@Recorded Player 12#12|(827.15,2325.32,228.52,-166.38)|(414733/423204)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:42812,At:55804070},
{Raw:"[15:30:04.070] [TYTH {4078423634870272}:66590000316688|(821.60,2329.78,228.50,-64.61)|(16032142/19989636)] [@Recorded Player 15#15|(828.86,2324.55,228.52,109.35)|(443782/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:42814,At:55804070},
{Raw:"[15:30:04.071] [TYTH {4078423634870272}:66590000316688|(821.60,2329.78,228.50,-64.61)|(16032142/19989636)] [@Recorded Player 10#10|(827.81,2323.16,228.52,140.95)|(409266/423501)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:42815,At:55804071},
{Raw:"[15:30:04.071] [TYTH {4078423634870272}:66590000316688|(821.60,2329.78,228.50,-64.61)|(16032142/19989636)] [@Recorded Player 14#14|(832.03,2327.72,228.52,64.77)|(443530/443530)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:42816,At:55804071},
{Raw:"[15:30:04.071] [TYTH {4078423634870272}:66590000316688|(821.60,2329.78,228.50,-64.61)|(16032142/19989636)] [@Recorded Player 13#13|(830.68,2324.03,228.52,122.50)|(395864/443441)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:42817,At:55804071},
{Raw:"[15:30:04.071] [TYTH {4078423634870272}:66590000316688|(821.60,2329.78,228.50,-64.61)|(16032142/19989636)] [@Recorded Player 16#16|(833.00,2326.68,228.52,114.88)|(492710/492710)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:42819,At:55804071},
{Raw:"[15:30:04.071] [TYTH {4078423634870272}:66590000316688|(821.60,2329.78,228.50,-64.61)|(16032142/19989636)] [@Recorded Player 11#11|(802.41,2334.23,228.52,-51.75)|(410329/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:42820,At:55804071},
{Raw:"[15:30:04.071] [TYTH {4078423634870272}:66590000316688|(821.60,2329.78,228.50,-64.61)|(16032142/19989636)] [@Recorded Player 9#9|(803.73,2355.92,228.52,-34.37)|(444995/483839)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:42821,At:55804071},
{Raw:"[15:30:36.069] [TYTH {4078423634870272}:66590000316688|(830.11,2337.03,228.52,178.52)|(14014915/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:44581,At:55836069},
{Raw:"[15:30:41.171] [TYTH {4078423634870272}:66590000316688|(830.17,2337.05,228.50,-76.65)|(13487160/19989636)] [@Recorded Player 9#9|(834.64,2335.98,228.52,130.24)|(335605/483839)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:44780,At:55841171},
{Raw:"[15:30:41.172] [TYTH {4078423634870272}:66590000316688|(830.17,2337.05,228.50,-76.65)|(13487160/19989636)] [@Recorded Player 13#13|(836.74,2336.18,228.52,91.38)|(443441/443441)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:44781,At:55841172},
{Raw:"[15:30:41.172] [TYTH {4078423634870272}:66590000316688|(830.17,2337.05,228.50,-76.65)|(13487160/19989636)] [@Recorded Player 11#11|(836.96,2336.02,228.52,-48.44)|(404411/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:44783,At:55841172},
{Raw:"[15:30:41.172] [TYTH {4078423634870272}:66590000316688|(830.17,2337.05,228.50,-76.65)|(13487160/19989636)] [@Recorded Player 10#10|(836.10,2333.48,228.52,108.74)|(423501/423501)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:44784,At:55841172},
{Raw:"[15:30:41.172] [TYTH {4078423634870272}:66590000316688|(830.17,2337.05,228.50,-76.65)|(13487160/19989636)] [@Recorded Player 14#14|(836.97,2335.06,228.52,-137.40)|(443530/443530)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:44785,At:55841172},
{Raw:"[15:30:41.172] [TYTH {4078423634870272}:66590000316688|(830.17,2337.05,228.50,-76.65)|(13487160/19989636)] [@Recorded Player 15#15|(835.78,2332.27,228.52,116.04)|(443782/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:44786,At:55841172},
{Raw:"[15:30:41.172] [TYTH {4078423634870272}:66590000316688|(830.17,2337.05,228.50,-76.65)|(13487160/19989636)] [@Recorded Player 12#12|(838.31,2337.18,228.52,-188.66)|(423204/423204)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:44787,At:55841172},
{Raw:"[15:30:41.172] [TYTH {4078423634870272}:66590000316688|(830.17,2337.05,228.50,-76.65)|(13487160/19989636)] [@Recorded Player 16#16|(820.08,2323.39,228.52,-136.57)|(492710/492710)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:44788,At:55841172},
{Raw:"[15:31:14.784] [TYTH {4078423634870272}:66590000316688|(811.13,2362.00,228.52,134.48)|(11869921/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:46674,At:55874784},
{Raw:"[15:31:19.870] [TYTH {4078423634870272}:66590000316688|(811.18,2361.94,228.50,-174.77)|(12156932/19989636)] [@Recorded Player 11#11|(815.01,2371.35,228.52,157.04)|(441771/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:46950,At:55879870},
{Raw:"[15:31:19.870] [TYTH {4078423634870272}:66590000316688|(811.18,2361.94,228.50,-174.77)|(12156932/19989636)] [@Recorded Player 10#10|(811.41,2371.59,228.52,22.46)|(423501/423501)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:46951,At:55879870},
{Raw:"[15:31:19.870] [TYTH {4078423634870272}:66590000316688|(811.18,2361.94,228.50,-174.77)|(12156932/19989636)] [@Recorded Player 14#14|(812.58,2374.29,228.52,106.03)|(443530/443530)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:46952,At:55879870},
{Raw:"[15:31:19.870] [TYTH {4078423634870272}:66590000316688|(811.18,2361.94,228.50,-174.77)|(12156932/19989636)] [@Recorded Player 13#13|(813.14,2374.95,228.52,33.73)|(437115/443441)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:46953,At:55879870},
{Raw:"[15:31:19.871] [TYTH {4078423634870272}:66590000316688|(811.18,2361.94,228.50,-174.77)|(12156932/19989636)] [@Recorded Player 12#12|(811.91,2372.80,228.52,81.87)|(407481/423204)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:46954,At:55879871},
{Raw:"[15:31:19.871] [TYTH {4078423634870272}:66590000316688|(811.18,2361.94,228.50,-174.77)|(12156932/19989636)] [@Recorded Player 15#15|(813.53,2375.00,228.52,7.52)|(443782/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:46955,At:55879871},
{Raw:"[15:31:19.871] [TYTH {4078423634870272}:66590000316688|(811.18,2361.94,228.50,-174.77)|(12156932/19989636)] [@Recorded Player 16#16|(811.45,2375.52,228.52,-8.33)|(289168/492710)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:46957,At:55879871},
{Raw:"[15:31:19.871] [TYTH {4078423634870272}:66590000316688|(811.18,2361.94,228.50,-174.77)|(12156932/19989636)] [@Recorded Player 9#9|(814.59,2343.13,228.52,-178.14)|(396887/483839)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:46958,At:55879871},
{Raw:"[15:31:51.887] [TYTH {4078423634870272}:66590000316688|(826.03,2363.09,228.52,-18.04)|(11731521/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:48682,At:55911887},
{Raw:"[15:31:56.896] [TYTH {4078423634870272}:66590000316688|(826.00,2363.12,228.50,102.59)|(11603357/19989636)] [@Recorded Player 10#10|(830.47,2360.43,228.52,85.39)|(423501/423501)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:48964,At:55916896},
{Raw:"[15:31:56.896] [TYTH {4078423634870272}:66590000316688|(826.00,2363.12,228.50,102.59)|(11603357/19989636)] [@Recorded Player 9#9|(828.43,2367.24,228.52,92.87)|(212869/483839)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:48966,At:55916896},
{Raw:"[15:31:56.897] [TYTH {4078423634870272}:66590000316688|(826.00,2363.12,228.50,102.59)|(11603357/19989636)] [@Recorded Player 13#13|(827.44,2367.82,228.52,19.85)|(441448/443441)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:48967,At:55916897},
{Raw:"[15:31:56.897] [TYTH {4078423634870272}:66590000316688|(826.00,2363.12,228.50,102.59)|(11603357/19989636)] [@Recorded Player 15#15|(829.97,2366.78,228.52,36.93)|(364863/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:48968,At:55916897},
{Raw:"[15:31:56.897] [TYTH {4078423634870272}:66590000316688|(826.00,2363.12,228.50,102.59)|(11603357/19989636)] [@Recorded Player 14#14|(828.04,2368.24,228.52,17.79)|(443530/443530)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:48969,At:55916897},
{Raw:"[15:31:56.897] [TYTH {4078423634870272}:66590000316688|(826.00,2363.12,228.50,102.59)|(11603357/19989636)] [@Recorded Player 11#11|(826.63,2368.92,228.52,-94.92)|(400229/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:48970,At:55916897},
{Raw:"[15:31:56.897] [TYTH {4078423634870272}:66590000316688|(826.00,2363.12,228.50,102.59)|(11603357/19989636)] [@Recorded Player 12#12|(828.14,2368.96,228.52,-66.60)|(380293/423204)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:48971,At:55916897},
{Raw:"[15:31:56.897] [TYTH {4078423634870272}:66590000316688|(826.00,2363.12,228.50,102.59)|(11603357/19989636)] [@Recorded Player 16#16|(810.02,2370.46,228.52,-94.49)|(262179/492710)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:48972,At:55916897},
{Raw:"[15:32:29.525] [TYTH {4078423634870272}:66590000316688|(817.53,2323.74,228.52,-34.73)|(9978292/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:50650,At:55949525},
{Raw:"[15:32:34.528] [TYTH {4078423634870272}:66590000316688|(817.81,2323.31,228.50,-29.40)|(9796108/19989636)] [@Recorded Player 11#11|(822.37,2318.49,228.52,-1.37)|(415705/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:50898,At:55954528},
{Raw:"[15:32:34.528] [TYTH {4078423634870272}:66590000316688|(817.81,2323.31,228.50,-29.40)|(9796108/19989636)] [@Recorded Player 15#15|(823.85,2318.88,228.52,142.58)|(390038/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:50899,At:55954528},
{Raw:"[15:32:34.529] [TYTH {4078423634870272}:66590000316688|(817.81,2323.31,228.50,-29.40)|(9796108/19989636)] [@Recorded Player 12#12|(824.51,2319.02,228.52,-138.43)|(338907/423204)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:50901,At:55954529},
{Raw:"[15:32:34.529] [TYTH {4078423634870272}:66590000316688|(817.81,2323.31,228.50,-29.40)|(9796108/19989636)] [@Recorded Player 16#16|(822.24,2315.18,228.52,159.10)|(445701/492710)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:50903,At:55954529},
{Raw:"[15:32:34.529] [TYTH {4078423634870272}:66590000316688|(817.81,2323.31,228.50,-29.40)|(9796108/19989636)] [@Recorded Player 13#13|(814.58,2314.13,228.52,171.40)|(389020/443441)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:50904,At:55954529},
{Raw:"[15:32:34.529] [TYTH {4078423634870272}:66590000316688|(817.81,2323.31,228.50,-29.40)|(9796108/19989636)] [@Recorded Player 14#14|(826.80,2319.01,228.52,67.57)|(443530/443530)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:50905,At:55954529},
{Raw:"[15:32:34.529] [TYTH {4078423634870272}:66590000316688|(817.81,2323.31,228.50,-29.40)|(9796108/19989636)] [@Recorded Player 9#9|(804.53,2349.71,228.52,-29.01)|(271603/483839)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:50906,At:55954529},
{Raw:"[15:32:34.529] [TYTH {4078423634870272}:66590000316688|(817.81,2323.31,228.50,-29.40)|(9796108/19989636)] [@Recorded Player 10#10|(782.48,2350.44,228.52,-31.46)|(400523/423501)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:50907,At:55954529},
{Raw:"[15:33:06.874] [TYTH {4078423634870272}:66590000316688|(821.55,2322.40,228.52,-152.24)|(9433794/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:52604,At:55986874},
{Raw:"[15:33:11.874] [TYTH {4078423634870272}:66590000316688|(821.58,2322.41,228.50,-35.70)|(8946020/19989636)] [@Recorded Player 13#13|(819.69,2323.75,228.52,-51.08)|(443441/443441)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52902,At:55991874},
{Raw:"[15:33:11.874] [TYTH {4078423634870272}:66590000316688|(821.58,2322.41,228.50,-35.70)|(8946020/19989636)] [@Recorded Player 10#10|(823.00,2318.46,228.52,160.00)|(423501/423501)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52903,At:55991874},
{Raw:"[15:33:11.874] [TYTH {4078423634870272}:66590000316688|(821.58,2322.41,228.50,-35.70)|(8946020/19989636)] [@Recorded Player 9#9|(824.09,2318.92,228.52,145.23)|(272780/483839)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52905,At:55991874},
{Raw:"[15:33:11.875] [TYTH {4078423634870272}:66590000316688|(821.58,2322.41,228.50,-35.70)|(8946020/19989636)] [@Recorded Player 14#14|(823.72,2318.59,228.52,-136.88)|(443530/443530)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52906,At:55991875},
{Raw:"[15:33:11.875] [TYTH {4078423634870272}:66590000316688|(821.58,2322.41,228.50,-35.70)|(8946020/19989636)] [@Recorded Player 15#15|(823.61,2318.49,228.52,123.47)|(443782/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52907,At:55991875},
{Raw:"[15:33:11.875] [TYTH {4078423634870272}:66590000316688|(821.58,2322.41,228.50,-35.70)|(8946020/19989636)] [@Recorded Player 11#11|(820.90,2317.56,228.52,-112.00)|(351307/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52908,At:55991875},
{Raw:"[15:33:11.875] [TYTH {4078423634870272}:66590000316688|(821.58,2322.41,228.50,-35.70)|(8946020/19989636)] [@Recorded Player 12#12|(825.64,2318.90,228.52,-131.17)|(423204/423204)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:52909,At:55991875},
{Raw:"[15:33:11.875] [TYTH {4078423634870272}:66590000316688|(821.58,2322.41,228.50,-35.70)|(8946020/19989636)] [@Recorded Player 16#16|(806.55,2316.12,228.52,-109.90)|(210565/492710)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:52910,At:55991875},
{Raw:"[15:33:44.660] [TYTH {4078423634870272}:66590000316688|(794.94,2323.30,228.52,53.23)|(7727387/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:54675,At:56024660},
{Raw:"[15:33:49.658] [TYTH {4078423634870272}:66590000316688|(794.64,2323.11,228.50,-168.88)|(7952850/19989636)] [@Recorded Player 13#13|(791.78,2317.15,228.52,-149.68)|(436972/443441)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:54884,At:56029658},
{Raw:"[15:33:49.658] [TYTH {4078423634870272}:66590000316688|(794.64,2323.11,228.50,-168.88)|(7952850/19989636)] [@Recorded Player 11#11|(792.25,2316.21,228.52,-11.89)|(443352/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:54886,At:56029658},
{Raw:"[15:33:49.658] [TYTH {4078423634870272}:66590000316688|(794.64,2323.11,228.50,-168.88)|(7952850/19989636)] [@Recorded Player 10#10|(792.44,2315.18,228.52,-161.66)|(423501/423501)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:54887,At:56029658},
{Raw:"[15:33:49.659] [TYTH {4078423634870272}:66590000316688|(794.64,2323.11,228.50,-168.88)|(7952850/19989636)] [@Recorded Player 14#14|(792.06,2315.15,228.52,110.07)|(328061/443530)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:54888,At:56029659},
{Raw:"[15:33:49.659] [TYTH {4078423634870272}:66590000316688|(794.64,2323.11,228.50,-168.88)|(7952850/19989636)] [@Recorded Player 16#16|(791.15,2314.40,228.52,-145.49)|(492710/492710)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:54890,At:56029659},
{Raw:"[15:33:49.659] [TYTH {4078423634870272}:66590000316688|(794.64,2323.11,228.50,-168.88)|(7952850/19989636)] [@Recorded Player 15#15|(817.82,2331.88,228.52,114.14)|(406072/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:54891,At:56029659},
{Raw:"[15:33:49.659] [TYTH {4078423634870272}:66590000316688|(794.64,2323.11,228.50,-168.88)|(7952850/19989636)] [@Recorded Player 9#9|(800.29,2351.85,228.52,23.01)|(450615/483839)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:54892,At:56029659},
{Raw:"[15:33:49.659] [TYTH {4078423634870272}:66590000316688|(794.64,2323.11,228.50,-168.88)|(7952850/19989636)] [@Recorded Player 12#12|(825.27,2344.34,228.52,25.67)|(167113/423204)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:54893,At:56029659},
{Raw:"[15:34:24.790] [TYTH {4078423634870272}:66590000316688|(815.79,2322.60,228.52,-40.62)|(6051728/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:56631,At:56064790},
{Raw:"[15:34:29.896] [TYTH {4078423634870272}:66590000316688|(815.79,2322.60,228.50,141.75)|(5971178/19989636)] [@Recorded Player 9#9|(819.05,2318.68,228.52,151.61)|(483839/483839)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:56896,At:56069896},
{Raw:"[15:34:29.897] [TYTH {4078423634870272}:66590000316688|(815.79,2322.60,228.50,141.75)|(5971178/19989636)] [@Recorded Player 12#12|(819.39,2317.29,228.52,-48.04)|(417824/423204)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:56897,At:56069897},
{Raw:"[15:34:29.897] [TYTH {4078423634870272}:66590000316688|(815.79,2322.60,228.50,141.75)|(5971178/19989636)] [@Recorded Player 11#11|(819.94,2316.56,228.52,-68.76)|(426956/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:56898,At:56069897},
{Raw:"[15:34:29.897] [TYTH {4078423634870272}:66590000316688|(815.79,2322.60,228.50,141.75)|(5971178/19989636)] [@Recorded Player 13#13|(819.63,2316.34,228.52,153.89)|(409464/443441)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:56899,At:56069897},
{Raw:"[15:34:29.897] [TYTH {4078423634870272}:66590000316688|(815.79,2322.60,228.50,141.75)|(5971178/19989636)] [@Recorded Player 10#10|(797.99,2347.91,228.52,-59.41)|(423501/423501)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:56900,At:56069897},
{Raw:"[15:34:29.897] [TYTH {4078423634870272}:66590000316688|(815.79,2322.60,228.50,141.75)|(5971178/19989636)] [@Recorded Player 14#14|(788.28,2342.61,228.52,221.39)|(394381/443530)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:56901,At:56069897},
{Raw:"[15:34:29.897] [TYTH {4078423634870272}:66590000316688|(815.79,2322.60,228.50,141.75)|(5971178/19989636)] [@Recorded Player 16#16|(794.11,2349.55,228.52,-54.46)|(415317/492710)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:56902,At:56069897},
{Raw:"[15:34:29.897] [TYTH {4078423634870272}:66590000316688|(815.79,2322.60,228.50,141.75)|(5971178/19989636)] [@Recorded Player 15#15|(793.74,2352.65,228.52,-1.74)|(365866/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:56903,At:56069897},
{Raw:"[15:35:01.895] [TYTH {4078423634870272}:66590000316688|(816.20,2325.75,228.52,70.19)|(5567793/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:58720,At:56101895},
{Raw:"[15:35:06.910] [TYTH {4078423634870272}:66590000316688|(816.11,2325.71,228.50,149.93)|(5557967/19989636)] [@Recorded Player 13#13|(818.15,2319.62,228.52,163.27)|(248821/443441)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:58849,At:56106910},
{Raw:"[15:35:06.910] [TYTH {4078423634870272}:66590000316688|(816.11,2325.71,228.50,149.93)|(5557967/19989636)] [@Recorded Player 10#10|(816.81,2319.93,228.52,163.91)|(342712/423501)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:58850,At:56106910},
{Raw:"[15:35:06.910] [TYTH {4078423634870272}:66590000316688|(816.11,2325.71,228.50,149.93)|(5557967/19989636)] [@Recorded Player 11#11|(821.42,2318.15,228.52,-23.71)|(371553/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:58851,At:56106910},
{Raw:"[15:35:06.910] [TYTH {4078423634870272}:66590000316688|(816.11,2325.71,228.50,149.93)|(5557967/19989636)] [@Recorded Player 16#16|(819.54,2316.73,228.52,164.82)|(304095/492710)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:58853,At:56106910},
{Raw:"[15:35:06.910] [TYTH {4078423634870272}:66590000316688|(816.11,2325.71,228.50,149.93)|(5557967/19989636)] [@Recorded Player 14#14|(822.92,2318.63,228.52,42.15)|(264888/443530)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:58854,At:56106910},
{Raw:"[15:35:06.910] [TYTH {4078423634870272}:66590000316688|(816.11,2325.71,228.50,149.93)|(5557967/19989636)] [@Recorded Player 9#9|(803.25,2347.92,228.52,-30.28)|(80103/483839)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:58855,At:56106910},
{Raw:"[15:35:06.910] [TYTH {4078423634870272}:66590000316688|(816.11,2325.71,228.50,149.93)|(5557967/19989636)] [@Recorded Player 15#15|(804.43,2350.86,228.52,-36.93)|(127732/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:58856,At:56106910},
{Raw:"[15:35:39.859] [TYTH {4078423634870272}:66590000316688|(792.74,2320.57,228.52,129.29)|(3161965/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:60565,At:56139859},
{Raw:"[15:35:44.883] [TYTH {4078423634870272}:66590000316688|(792.72,2320.57,228.50,-152.72)|(2485412/19989636)] [@Recorded Player 11#11|(791.04,2318.20,228.52,-67.36)|(378770/443352)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:60846,At:56144883},
{Raw:"[15:35:44.883] [TYTH {4078423634870272}:66590000316688|(792.72,2320.57,228.50,-152.72)|(2485412/19989636)] [@Recorded Player 9#9|(791.65,2317.26,228.52,-136.61)|(237446/483839)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:60848,At:56144883},
{Raw:"[15:35:44.883] [TYTH {4078423634870272}:66590000316688|(792.72,2320.57,228.50,-152.72)|(2485412/19989636)] [@Recorded Player 14#14|(790.96,2316.85,228.52,96.88)|(420169/443530)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:60849,At:56144883},
{Raw:"[15:35:44.883] [TYTH {4078423634870272}:66590000316688|(792.72,2320.57,228.50,-152.72)|(2485412/19989636)] [@Recorded Player 13#13|(792.94,2315.86,228.52,193.39)|(351137/443441)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:60850,At:56144883},
{Raw:"[15:35:44.883] [TYTH {4078423634870272}:66590000316688|(792.72,2320.57,228.50,-152.72)|(2485412/19989636)] [@Recorded Player 15#15|(790.97,2316.19,228.52,-158.22)|(352546/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:60851,At:56144883},
{Raw:"[15:35:44.884] [TYTH {4078423634870272}:66590000316688|(792.72,2320.57,228.50,-152.72)|(2485412/19989636)] [@Recorded Player 10#10|(790.88,2315.81,228.52,-158.95)|(378448/423501)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:60852,At:56144884},
{Raw:"[15:35:44.884] [TYTH {4078423634870272}:66590000316688|(792.72,2320.57,228.50,-152.72)|(2485412/19989636)] [@Recorded Player 12#12|(790.93,2315.43,228.52,110.73)|(357233/423204)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]",Line:60853,At:56144884},
{Raw:"[15:35:44.884] [TYTH {4078423634870272}:66590000316688|(792.72,2320.57,228.50,-152.72)|(2485412/19989636)] [@Recorded Player 16#16|(805.10,2341.39,228.52,-156.21)|(265846/492710)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]",Line:60854,At:56144884},
{Raw:"[15:36:18.568] [TYTH {4078423634870272}:66590000316688|(784.33,2336.84,228.52,-74.61)|(1357145/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:62528,At:56178568}
],Expected:[
{Start:55761068,End:55766154,StartLine:40386,EndLine:40664,Instance:"66590000316688"},
{Start:55799037,End:55804070,StartLine:42587,EndLine:42812,Instance:"66590000316688"},
{Start:55836069,End:55841171,StartLine:44581,EndLine:44780,Instance:"66590000316688"},
{Start:55874784,End:55879870,StartLine:46674,EndLine:46950,Instance:"66590000316688"},
{Start:55911887,End:55916896,StartLine:48682,EndLine:48964,Instance:"66590000316688"},
{Start:55949525,End:55954528,StartLine:50650,EndLine:50898,Instance:"66590000316688"},
{Start:55986874,End:55991874,StartLine:52604,EndLine:52902,Instance:"66590000316688"},
{Start:56024660,End:56029658,StartLine:54675,EndLine:54884,Instance:"66590000316688"},
{Start:56064790,End:56069896,StartLine:56631,EndLine:56896,Instance:"66590000316688"},
{Start:56101895,End:56106910,StartLine:58720,EndLine:58849,Instance:"66590000316688"},
{Start:56139859,End:56144883,StartLine:60565,EndLine:60846,Instance:"66590000316688"},
{Start:56178568,End:-1,StartLine:62528,EndLine:0,Instance:"66590000316688"}
]},
{Name:"aivela-radiance-8m-v1-case1",WindowName:"Aivela Radiance",OverrideId:"",Boss:"G-AE",Area:"833571547775765",Mode:"836045448953655",Start:68886458,Fence:-1,Records:[
{Raw:"[19:12:07.636] [AIVELA {4088525397950464}:113004001140219|(486.00,2803.00,317.41,-176.50)|(13275554/18734600)] [=] [Radiance {4109583622602752}] [ApplyEffect {836045448945477}: Radiance {4109583622602752}]",Line:74819,At:69127636},
{Raw:"[19:13:14.528] [AIVELA {4088525397950464}:113004001140219|(486.00,2803.00,317.41,148.45)|(7999674/18734600)] [=] [Radiance {4109583622602752}] [RemoveEffect {836045448945478}: Radiance {4109583622602752}]",Line:80022,At:69194528},
{Raw:"[19:13:25.378] [AIVELA {4088525397950464}:113004001140219|(486.00,2803.00,317.41,-123.32)|(7256155/18734600)] [=] [Radiance {4109583622602752}] [ApplyEffect {836045448945477}: Radiance {4109583622602752}]",Line:80702,At:69205378},
{Raw:"[19:15:56.498] [AIVELA {4088525397950464}:113004001140219|(487.83,2805.06,317.41,-8.96)|(1405095/18734600)] [=] [Radiance {4109583622602752}] [RemoveEffect {836045448945478}: Radiance {4109583622602752}]",Line:92086,At:69356498}
],Expected:[
{Start:69127636,End:69194528,StartLine:74819,EndLine:80022,Instance:"113004001140219"},
{Start:69205378,End:69356498,StartLine:80702,EndLine:92086,Instance:"113004001140219"}
]},
{Name:"aivela-radiance-8m-v1-case2",WindowName:"Aivela Radiance",OverrideId:"",Boss:"G-AE",Area:"833571547775765",Mode:"836045448953655",Start:70159098,Fence:-1,Records:[
{Raw:"[19:32:54.079] [AIVELA {4088525397950464}:136619000882149|(486.00,2803.00,317.41,-178.83)|(13149918/18734600)] [=] [Radiance {4109583622602752}] [ApplyEffect {836045448945477}: Radiance {4109583622602752}]",Line:110971,At:70374079},
{Raw:"[19:33:58.830] [AIVELA {4088525397950464}:136619000882149|(486.00,2803.00,317.41,-174.59)|(7999674/18734600)] [=] [Radiance {4109583622602752}] [RemoveEffect {836045448945478}: Radiance {4109583622602752}]",Line:116244,At:70438830},
{Raw:"[19:34:08.976] [AIVELA {4088525397950464}:136619000882149|(486.04,2802.91,317.41,-162.87)|(7433678/18734600)] [=] [Radiance {4109583622602752}] [ApplyEffect {836045448945477}: Radiance {4109583622602752}]",Line:116910,At:70448976},
{Raw:"[19:36:38.260] [AIVELA {4088525397950464}:136619000882149|(486.59,2775.90,317.41,104.09)|(1405095/18734600)] [=] [Radiance {4109583622602752}] [RemoveEffect {836045448945478}: Radiance {4109583622602752}]",Line:128152,At:70598260}
],Expected:[
{Start:70374079,End:70438830,StartLine:110971,EndLine:116244,Instance:"136619000882149"},
{Start:70448976,End:70598260,StartLine:116910,EndLine:128152,Instance:"136619000882149"}
]},
{Name:"esne-radiance-8m-v1-case1",WindowName:"Esne Radiance",OverrideId:"",Boss:"G-AE",Area:"833571547775765",Mode:"836045448953655",Start:68886458,Fence:-1,Records:[
{Raw:"[19:12:08.828] [ESNE {4088538282852352}:113004001140092|(486.00,2778.00,317.41,13.74)|(13151488/18734600)] [=] [Radiance {4109587917570048}] [ApplyEffect {836045448945477}: Radiance {4109587917570048}]",Line:74887,At:69128828},
{Raw:"[19:13:14.528] [ESNE {4088538282852352}:113004001140092|(486.00,2778.00,317.41,33.66)|(7999674/18734600)] [=] [Radiance {4109587917570048}] [RemoveEffect {836045448945478}: Radiance {4109587917570048}]",Line:80020,At:69194528},
{Raw:"[19:13:25.377] [ESNE {4088538282852352}:113004001140092|(485.92,2778.06,317.41,-6.15)|(7918987/18734600)] [=] [Radiance {4109587917570048}] [ApplyEffect {836045448945477}: Radiance {4109587917570048}]",Line:80700,At:69205377},
{Raw:"[19:15:18.140] [ESNE {4088538282852352}:113004001140092|(481.04,2777.14,317.41,-42.83)|(1405095/18734600)] [=] [Radiance {4109587917570048}] [RemoveEffect {836045448945478}: Radiance {4109587917570048}]",Line:89523,At:69318140}
],Expected:[
{Start:69128828,End:69194528,StartLine:74887,EndLine:80020,Instance:"113004001140092"},
{Start:69205377,End:69318140,StartLine:80700,EndLine:89523,Instance:"113004001140092"}
]},
{Name:"esne-radiance-8m-v1-case2",WindowName:"Esne Radiance",OverrideId:"",Boss:"G-AE",Area:"833571547775765",Mode:"836045448953655",Start:70159098,Fence:-1,Records:[
{Raw:"[19:32:52.985] [ESNE {4088538282852352}:136619000882022|(486.00,2778.00,317.41,27.75)|(13276003/18734600)] [=] [Radiance {4109587917570048}] [ApplyEffect {836045448945477}: Radiance {4109587917570048}]",Line:110906,At:70372985},
{Raw:"[19:33:58.829] [ESNE {4088538282852352}:136619000882022|(486.00,2778.00,317.41,-18.60)|(7999674/18734600)] [=] [Radiance {4109587917570048}] [RemoveEffect {836045448945478}: Radiance {4109587917570048}]",Line:116242,At:70438829},
{Raw:"[19:34:09.628] [ESNE {4088538282852352}:136619000882022|(486.00,2778.00,317.41,5.68)|(7924917/18734600)] [=] [Radiance {4109587917570048}] [ApplyEffect {836045448945477}: Radiance {4109587917570048}]",Line:116936,At:70449628},
{Raw:"[19:36:09.639] [ESNE {4088538282852352}:136619000882022|(482.88,2807.44,317.41,-31.77)|(1405095/18734600)] [=] [Radiance {4109587917570048}] [RemoveEffect {836045448945478}: Radiance {4109587917570048}]",Line:126228,At:70569639}
],Expected:[
{Start:70372985,End:70438829,StartLine:110906,EndLine:116242,Instance:"136619000882022"},
{Start:70449628,End:70569639,StartLine:116936,EndLine:126228,Instance:"136619000882022"}
]},
{Name:"red-bull-8m-v1-case1",WindowName:"Stampeding Bull",OverrideId:"",Boss:"DX-RE",Area:"833571547775792",Mode:"836045448953655",Start:79031028,Fence:79287336,Records:[
{Raw:"[21:58:22.847] [@Recorded Player 17#17|(-523.11,-101.81,-32.53,-170.08)|(409508/503131)] [Stampeding Bull {4246356856143872}:14596000141916|(-522.49,-95.88,-32.58,7.34)|(1003690/1007893)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4203 energy {836045448940874}) <12609.0>",Line:13226,At:79102847},
{Raw:"[21:58:41.015] [@Recorded Player 18#18|(-527.02,-114.67,-32.16,-125.99)|(431797/443752)] [Stampeding Bull {4246356856143872}:14596000141916|(-525.45,-107.21,-32.19,-103.62)|(0/1007893)] [] [Event {836045448945472}: Death {836045448945493}]",Line:14329,At:79121015},
{Raw:"[21:59:38.716] [@Recorded Player 17#17|(-546.58,-65.12,-30.68,-175.68)|(503131/503131)] [Stampeding Bull {4246356856143872}:14596000173588|(-547.36,-64.60,-30.58,-20.59)|(1001593/1007893)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6301* energy {836045448940874}) <18902.0>",Line:18102,At:79178716},
{Raw:"[22:00:06.462] [@Recorded Player 19#19|(-544.40,-58.08,-31.01,132.48)|(443782/443782)] [Stampeding Bull {4246356856143872}:14596000173588|(-557.19,-52.68,-31.12,-97.97)|(0/1007893)] [] [Event {836045448945472}: Death {836045448945493}]",Line:20074,At:79206462},
{Raw:"[22:00:27.069] [@Recorded Player 20#20|(-566.37,11.33,-24.70,-156.38)|(498994/498994)] [Stampeding Bull {4246356856143872}:14596000205072|(-557.65,15.23,-24.35,-5.48)|(831837/1007893)] [Chained Volts {4483542130098176}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8242* energy {836045448940874}) <24726.0>",Line:21394,At:79227069},
{Raw:"[22:00:40.473] [@Recorded Player 20#20|(-572.05,16.47,-22.89,16.53)|(382673/498994)] [Stampeding Bull {4246356856143872}:14596000205072|(-564.12,7.45,-25.11,55.46)|(0/1007893)] [] [Event {836045448945472}: Death {836045448945493}]",Line:22439,At:79240473},
{Raw:"[22:01:15.035] [@Recorded Player 17#17|(-584.50,60.62,-23.19,-58.65)|(503131/503131)] [Stampeding Bull {4246356856143872}:14596000235252|(-578.59,53.12,-23.40,32.53)|(1006122/1007893)] [Electrocute {808244125630464}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1771 energy {836045448940874}) <5313.0>",Line:24412,At:79275035}
],Expected:[
{Start:79102847,End:79121015,StartLine:13226,EndLine:14329,Instance:"14596000141916"},
{Start:79178716,End:79206462,StartLine:18102,EndLine:20074,Instance:"14596000173588"},
{Start:79227069,End:79240473,StartLine:21394,EndLine:22439,Instance:"14596000205072"},
{Start:79275035,End:-1,StartLine:24412,EndLine:0,Instance:"14596000235252"}
]},
{Name:"red-bull-8m-v1-case2",WindowName:"Stampeding Bull",OverrideId:"",Boss:"DX-RE",Area:"833571547775792",Mode:"836045448953655",Start:62925372,Fence:63169826,Records:[
{Raw:"[17:29:54.596] [@Recorded Player 21#21|(-519.96,-102.50,-32.22,171.32)|(499102/499102)] [Stampeding Bull {4246356856143872}:5405000190169|(-524.67,-75.02,-31.26,-6.32)|(1004004/1007893)] [Saber Throw {812165430771712}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3889 energy {836045448940874}) <11668.0>",Line:14402,At:62994596},
{Raw:"[17:30:25.433] [@Recorded Player 22#22|(-524.74,-73.96,-31.30,-146.73)|(436359/436359)] [Stampeding Bull {4246356856143872}:5405000190169|(-518.71,-86.35,-31.71,96.24)|(0/1007893)] [] [Event {836045448945472}: Death {836045448945493}]",Line:16177,At:63025433},
{Raw:"[17:31:17.155] [@Recorded Player 23#23|(-544.23,-50.19,-30.59,18.13)|(398460/511701)] [Stampeding Bull {4246356856143872}:5405000219594|(-544.43,-55.10,-30.82,-183.01)|(1003851/1007893)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4043 energy {836045448940874}) <12128.0>",Line:19532,At:63077155},
{Raw:"[17:31:48.046] [@Recorded Player 24#24|(-551.97,-53.59,-31.12,54.26)|(443752/443752)] [Stampeding Bull {4246356856143872}:5405000219594|(-546.42,-59.16,-30.89,31.07)|(0/1007893)] [] [Event {836045448945472}: Death {836045448945493}]",Line:21421,At:63108046},
{Raw:"[17:32:03.946] [@Recorded Player 25#25|(-589.06,-3.85,-27.03,-122.42)|(366115/438244)] [Stampeding Bull {4246356856143872}:5405000249231|(-561.01,13.29,-23.87,61.03)|(790105/1007893)] [Sweeping Gunfire {807282052956160}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8020* energy {836045448940874}) <8020.0>",Line:22319,At:63123946},
{Raw:"[17:32:12.056] [@Recorded Player 25#25|(-589.06,-3.85,-27.03,-122.42)|(365958/438244)] [Stampeding Bull {4246356856143872}:5405000249231|(-577.63,2.28,-25.99,228.58)|(0/1007893)] [] [Event {836045448945472}: Death {836045448945493}]",Line:22935,At:63132056}
],Expected:[
{Start:62994596,End:63025433,StartLine:14402,EndLine:16177,Instance:"5405000190169"},
{Start:63077155,End:63108046,StartLine:19532,EndLine:21421,Instance:"5405000219594"},
{Start:63123946,End:63132056,StartLine:22319,EndLine:22935,Instance:"5405000249231"}
]},
{Name:"red-feasting-8m-v1-case1",WindowName:"Feasting",OverrideId:"",Boss:"DX-RE",Area:"833571547775792",Mode:"836045448953655",Start:79031028,Fence:-1,Records:[
{Raw:"[22:00:06.460] [Red {4330233272467456}:14596000031630|(-543.04,-57.86,-30.90,99.82)|(10592854/33970452)] [=] [ {4250102067625984}] [ApplyEffect {836045448945477}: Feasting! {4250102067626330}] (1 charges {836045448953667})",Line:20065,At:79206460},
{Raw:"[22:01:27.334] [Red {4330233272467456}:14596000031630|(-586.30,45.41,-23.83,-159.28)|(0/18188932)] [=] [ {4250102067625984}] [RemoveEffect {836045448945478}: Feasting! {4250102067626330}]",Line:25251,At:79287334}
],Expected:[
{Start:79206460,End:79287334,StartLine:20065,EndLine:25251,Instance:"14596000031630"}
]},
{Name:"red-feasting-8m-v1-case2",WindowName:"Feasting",OverrideId:"",Boss:"DX-RE",Area:"833571547775792",Mode:"836045448953655",Start:75560255,Fence:-1,Records:[
{Raw:"[21:00:45.819] [Red {4330233272467456}:11875000031581|(-523.20,-114.79,-31.93,150.13)|(21005486/33970452)] [=] [ {4250102067625984}] [ApplyEffect {836045448945477}: Feasting! {4250102067626330}] (1 charges {836045448953667})",Line:12102,At:75645819},
{Raw:"[21:03:13.661] [Red {4330233272467456}:11875000031581|(-605.77,3.86,-26.74,133.87)|(0/18188932)] [=] [ {4250102067625984}] [RemoveEffect {836045448945478}: Feasting! {4250102067626330}]",Line:20131,At:75793661}
],Expected:[
{Start:75645819,End:75793661,StartLine:12102,EndLine:20131,Instance:"11875000031581"}
]},
{Name:"holding-pursuit-8m-v1-case1",WindowName:"Pursuit Droid",OverrideId:"pursuit-droid",Boss:"DX-E1",Area:"833571547775792",Mode:"836045448953655",Start:70708083,Fence:-1,Records:[
{Raw:"[19:39:00.706] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-336.43,-211.81,0.24,115.74)|(10078924/10078924)] [@Recorded Player 26#26|(-339.41,-210.89,0.19,40.07)|(443634/443634)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:25160,At:70740706},
{Raw:"[19:39:11.517] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-336.75,-233.77,0.02,-8.69)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:25764,At:70751517},
{Raw:"[19:39:54.329] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-236.20,-372.82,0.32,19.42)|(10078924/10078924)] [@Recorded Player 27#27|(-237.26,-376.15,0.13,-144.47)|(427054/442787)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:27958,At:70794329},
{Raw:"[19:40:06.359] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [Crimson Stalker {4333458792906752}:20976000427268|(-216.62,-368.88,0.97,-106.03)|(117249/385536)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28838,At:70806359},
{Raw:"[19:40:06.359] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [@Recorded Player 26#26|(-214.41,-370.17,2.21,-173.79)|(363481/443634)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28839,At:70806359},
{Raw:"[19:40:06.359] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [@Recorded Player 28#28|(-212.67,-367.53,1.10,72.79)|(370378/370378)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28840,At:70806359},
{Raw:"[19:40:06.360] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [@Recorded Player 29#29|(-212.50,-368.18,1.33,162.96)|(437063/443752)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28844,At:70806360},
{Raw:"[19:40:06.360] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [Crimson Stalker {4333458792906752}:20976000426984|(-213.75,-365.04,0.41,-23.59)|(101446/385536)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28845,At:70806360},
{Raw:"[19:40:06.360] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [@Recorded Player 30#30|(-210.43,-365.57,0.94,150.87)|(443782/443782)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28846,At:70806360},
{Raw:"[19:40:06.360] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [@Recorded Player 31#31|(-210.19,-361.17,0.13,18.71)|(434544/443218)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28847,At:70806360},
{Raw:"[19:40:06.360] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [Crimson Stalker {4333458792906752}:20976000439749|(-209.67,-357.60,-0.15,12.95)|(385536/385536)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28848,At:70806360},
{Raw:"[19:40:06.360] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [@Recorded Player 32#32|(-222.04,-355.47,-0.31,37.74)|(273593/432409)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28849,At:70806360},
{Raw:"[19:40:06.361] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [Incendiary Shriek {4250454254944256}:20976000427809|(-224.03,-355.67,-0.41,-95.57)|(173840/323637)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28851,At:70806361},
{Raw:"[19:40:06.361] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [Incendiary Shriek {4250454254944256}:20976000427942|(-223.21,-353.84,-0.29,-35.64)|(63702/323637)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28852,At:70806361},
{Raw:"[19:40:06.361] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [Crimson Stalker {4333218274738176}:20976000440033|(-194.95,-356.53,-0.85,59.62)|(385536/385536)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28853,At:70806361},
{Raw:"[19:40:06.361] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [Crimson Stalker {4333218274738176}:20976000440175|(-184.49,-359.19,0.04,74.63)|(385536/385536)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28854,At:70806361},
{Raw:"[19:40:06.361] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [Rampaging Charger {4250514384486400}:20976000430413|(-204.77,-344.49,0.05,-210.79)|(731211/1007893)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28855,At:70806361},
{Raw:"[19:40:06.361] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-215.92,-368.54,1.03,-107.16)|(9291150/10078924)] [@Recorded Player 33#33|(-209.18,-340.33,0.05,13.20)|(336720/503131)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:28856,At:70806361},
{Raw:"[19:40:10.886] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-213.55,-368.22,1.42,-116.39)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:29170,At:70810886},
{Raw:"[19:40:52.775] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-182.93,-265.79,-0.02,107.07)|(10078924/10078924)] [@Recorded Player 32#32|(-185.89,-264.21,-0.01,-38.53)|(390565/432409)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:31716,At:70852775},
{Raw:"[19:40:52.775] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-182.93,-265.79,-0.02,107.07)|(10078924/10078924)] [@Recorded Player 27#27|(-178.28,-268.85,0.05,-47.43)|(421904/442787)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:31717,At:70852775},
{Raw:"[19:41:05.773] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9244460/10078924)] [@Recorded Player 28#28|(-161.58,-268.10,-0.01,92.40)|(370378/370378)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:32850,At:70865773},
{Raw:"[19:41:05.773] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9244460/10078924)] [@Recorded Player 26#26|(-159.63,-266.77,-0.01,94.31)|(443634/443634)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:32851,At:70865773},
{Raw:"[19:41:05.773] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9244460/10078924)] [@Recorded Player 29#29|(-159.70,-268.89,-0.01,97.13)|(227129/443752)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:32852,At:70865773},
{Raw:"[19:41:05.773] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9244460/10078924)] [@Recorded Player 27#27|(-166.49,-262.64,-0.01,-15.47)|(314621/442787)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:32853,At:70865773},
{Raw:"[19:41:05.773] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9244460/10078924)] [@Recorded Player 31#31|(-170.05,-272.16,-0.01,-58.21)|(443218/443218)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:32855,At:70865773},
{Raw:"[19:41:05.774] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9244460/10078924)] [@Recorded Player 30#30|(-178.45,-272.36,-0.01,-97.63)|(443782/443782)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:32857,At:70865774},
{Raw:"[19:41:05.774] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9244460/10078924)] [Incendiary Shriek {4250454254944256}:20976000453816|(-172.80,-284.71,0.07,-53.15)|(96657/323637)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:32858,At:70865774},
{Raw:"[19:41:05.774] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9244460/10078924)] [@Recorded Player 33#33|(-170.10,-286.79,0.07,-148.11)|(335015/503131)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:32859,At:70865774},
{Raw:"[19:41:05.774] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9244460/10078924)] [@Recorded Player 32#32|(-185.21,-267.00,-0.01,-98.75)|(238449/432409)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:32860,At:70865774},
{Raw:"[19:41:05.775] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9244460/10078924)] [Incendiary Shriek {4250454254944256}:20976000453540|(-172.44,-287.98,0.07,-106.24)|(126087/323637)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:32862,At:70865775},
{Raw:"[19:41:05.775] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9244460/10078924)] [Crimson Stalker {4333218274738176}:20976000454091|(-172.93,-288.27,0.07,245.91)|(2878/385536)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:32863,At:70865775},
{Raw:"[19:41:08.986] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-164.98,-267.96,0.03,-87.50)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:33106,At:70868986},
{Raw:"[19:41:50.842] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-103.35,-275.80,-0.19,-94.66)|(10078924/10078924)] [@Recorded Player 26#26|(-98.73,-275.43,1.49,-4.64)|(407675/443634)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:36027,At:70910842},
{Raw:"[19:42:02.449] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-110.35,-274.01,-0.44,61.70)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:37217,At:70922449},
{Raw:"[19:42:43.563] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-31.31,-329.43,0.41,-36.58)|(10078924/10078924)] [@Recorded Player 29#29|(-29.99,-328.85,0.65,124.10)|(443752/443752)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:39184,At:70963563},
{Raw:"[19:42:43.563] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-31.31,-329.43,0.41,-36.58)|(10078924/10078924)] [Felshade Hunter {4256042007396352}:20976000506569|(-24.79,-317.27,0.13,26.13)|(747390/1156606)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:39185,At:70963563},
{Raw:"[19:42:56.477] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-19.41,-292.21,-0.01,-41.07)|(9460107/10078924)] [@Recorded Player 28#28|(-17.22,-294.71,-0.01,139.89)|(370378/370378)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:40473,At:70976477},
{Raw:"[19:42:56.477] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-19.41,-292.21,-0.01,-41.07)|(9460107/10078924)] [@Recorded Player 30#30|(-16.21,-293.23,-0.01,158.41)|(443782/443782)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:40474,At:70976477},
{Raw:"[19:42:56.478] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-19.41,-292.21,-0.01,-41.07)|(9460107/10078924)] [@Recorded Player 26#26|(-18.33,-297.24,0.02,149.36)|(418212/443634)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:40475,At:70976478},
{Raw:"[19:42:56.478] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-19.41,-292.21,-0.01,-41.07)|(9460107/10078924)] [@Recorded Player 29#29|(-24.32,-293.95,0.01,-109.96)|(346222/443752)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:40476,At:70976478},
{Raw:"[19:42:56.478] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-19.41,-292.21,-0.01,-41.07)|(9460107/10078924)] [@Recorded Player 27#27|(-25.49,-293.80,-0.00,-106.81)|(421831/442787)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:40477,At:70976478},
{Raw:"[19:42:56.478] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-19.41,-292.21,-0.01,-41.07)|(9460107/10078924)] [@Recorded Player 31#31|(-17.74,-298.38,-0.01,-161.49)|(443218/443218)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:40478,At:70976478},
{Raw:"[19:42:56.478] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-19.41,-292.21,-0.01,-41.07)|(9460107/10078924)] [@Recorded Player 32#32|(-12.95,-290.57,-0.01,-146.84)|(424252/432409)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:40479,At:70976478},
{Raw:"[19:42:56.480] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-19.41,-292.21,-0.01,-41.07)|(9460107/10078924)] [Shadow Reaper {4334133102772224}:20976000516941|(-12.25,-293.83,-0.01,16.41)|(399002/1285140)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:40482,At:70976480},
{Raw:"[19:42:56.480] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-19.41,-292.21,-0.01,-41.07)|(9460107/10078924)] [Shadow Walker {4250686183178240}:20976000506707|(-33.04,-286.05,0.47,-48.50)|(4162/723444)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:40483,At:70976480},
{Raw:"[19:43:02.294] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(-19.40,-291.43,-0.01,-7.76)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:40956,At:70982294},
{Raw:"[19:43:44.922] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(23.25,-269.88,-0.69,138.20)|(10078924/10078924)] [@Recorded Player 27#27|(20.87,-267.29,-0.88,32.00)|(442787/442787)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:44008,At:71024922},
{Raw:"[19:43:55.824] [Czerka Pursuit Droid {4389417921806336}:20976000082198|(11.31,-277.89,-0.63,58.69)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:44470,At:71035824}
],Expected:[
{Start:70740706,End:70751517,StartLine:25160,EndLine:25764,Instance:"20976000082198"},
{Start:70794329,End:70810886,StartLine:27958,EndLine:29170,Instance:"20976000082198"},
{Start:70852775,End:70868986,StartLine:31716,EndLine:33106,Instance:"20976000082198"},
{Start:70910842,End:70922449,StartLine:36027,EndLine:37217,Instance:"20976000082198"},
{Start:70963563,End:70982294,StartLine:39184,EndLine:40956,Instance:"20976000082198"},
{Start:71024922,End:71035824,StartLine:44008,EndLine:44470,Instance:"20976000082198"}
]},
{Name:"holding-pursuit-8m-v1-case2",WindowName:"Pursuit Droid",OverrideId:"pursuit-droid",Boss:"DX-E1",Area:"833571547775792",Mode:"836045448953655",Start:80648430,Fence:-1,Records:[
{Raw:"[22:24:36.754] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-326.16,-228.09,0.24,-112.04)|(10078924/10078924)] [@Recorded Player 34#34|(-325.97,-233.31,0.38,-79.24)|(443752/443752)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:23905,At:80676754},
{Raw:"[22:24:36.754] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-326.16,-228.09,0.24,-112.04)|(10078924/10078924)] [@Recorded Player 35#35|(-322.63,-227.26,0.64,-56.70)|(443277/443277)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:23906,At:80676754},
{Raw:"[22:24:36.754] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-326.16,-228.09,0.24,-112.04)|(10078924/10078924)] [@Recorded Player 36#36|(-333.40,-220.24,0.02,-8.14)|(433449/433449)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:23907,At:80676754},
{Raw:"[22:24:49.575] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-318.96,-235.56,0.75,-210.74)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:24604,At:80689575},
{Raw:"[22:25:31.813] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-187.65,-352.44,-0.63,-123.70)|(10078924/10078924)] [@Recorded Player 36#36|(-184.83,-350.55,-0.36,-167.84)|(433449/433449)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:27014,At:80731813},
{Raw:"[22:25:44.715] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-188.00,-346.96,-0.49,-155.99)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:27935,At:80744715},
{Raw:"[22:26:27.429] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-149.74,-278.97,0.22,-63.31)|(10078924/10078924)] [@Recorded Player 34#34|(-146.95,-280.20,0.45,168.86)|(443752/443752)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:30441,At:80787429},
{Raw:"[22:26:40.633] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-178.76,-287.24,0.07,96.43)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:31336,At:80800633},
{Raw:"[22:27:22.462] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-95.17,-267.16,-0.21,-129.45)|(10078924/10078924)] [@Recorded Player 37#37|(-92.55,-264.99,-0.36,48.27)|(443782/443782)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:34266,At:80842462},
{Raw:"[22:27:33.569] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-91.32,-281.00,-0.05,14.47)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:34877,At:80853569},
{Raw:"[22:28:15.346] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-7.47,-279.00,0.09,142.28)|(10078924/10078924)] [@Recorded Player 35#35|(-9.55,-276.31,0.21,92.01)|(443277/443277)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:36803,At:80895346},
{Raw:"[22:28:15.346] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-7.47,-279.00,0.09,142.28)|(10078924/10078924)] [@Recorded Player 37#37|(-4.54,-287.69,-0.04,-70.46)|(443782/443782)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:36804,At:80895346},
{Raw:"[22:28:15.346] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(-7.47,-279.00,0.09,142.28)|(10078924/10078924)] [@Recorded Player 36#36|(-10.67,-288.14,0.04,-122.39)|(433449/433449)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:36805,At:80895346},
{Raw:"[22:28:29.440] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(17.44,-291.19,0.08,-108.17)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:38169,At:80909440},
{Raw:"[22:29:12.118] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(12.07,-271.00,-0.78,-178.98)|(10078924/10078924)] [@Recorded Player 34#34|(12.13,-267.60,-0.90,21.16)|(408766/443752)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]",Line:41104,At:80952118},
{Raw:"[22:29:20.917] [Czerka Pursuit Droid {4389417921806336}:1040002341867|(16.28,-291.35,0.07,-17.41)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:41545,At:80960917}
],Expected:[
{Start:80676754,End:80689575,StartLine:23905,EndLine:24604,Instance:"1040002341867"},
{Start:80731813,End:80744715,StartLine:27014,EndLine:27935,Instance:"1040002341867"},
{Start:80787429,End:80800633,StartLine:30441,EndLine:31336,Instance:"1040002341867"},
{Start:80842462,End:80853569,StartLine:34266,EndLine:34877,Instance:"1040002341867"},
{Start:80895346,End:80909440,StartLine:36803,EndLine:38169,Instance:"1040002341867"},
{Start:80952118,End:80960917,StartLine:41104,EndLine:41545,Instance:"1040002341867"}
]},
{Name:"huntmaster-fortress-8m-v1-case1",WindowName:"Fortress",OverrideId:"",Boss:"DX-HMM",Area:"833571547775792",Mode:"836045448953655",Start:3359830,Fence:-1,Records:[
{Raw:"[00:57:19.692] [Huntmaster {4265104388390912}:23320000032374|(264.44,-279.75,-11.09,162.60)|(18149396/30102682)] [=] [Fortress {4271405105414144}] [ApplyEffect {836045448945477}: Fortress {4271405105414144}]",Line:102824,At:3439692},
{Raw:"[00:57:49.360] [Huntmaster {4265104388390912}:23320000032374|(264.44,-279.75,-11.09,26.30)|(17931538/30102682)] [=] [Fortress {4271405105414144}] [RemoveEffect {836045448945478}: Fortress {4271405105414144}]",Line:104642,At:3469360}
],Expected:[
{Start:3439692,End:3469360,StartLine:102824,EndLine:104642,Instance:"23320000032374"}
]},
{Name:"huntmaster-fortress-8m-v1-case2",WindowName:"Fortress",OverrideId:"",Boss:"DX-HMM",Area:"833571547775792",Mode:"836045448953655",Start:77961866,Fence:-1,Records:[
{Raw:"[21:40:41.427] [Huntmaster {4265104388390912}:39028000776141|(260.09,-283.33,-10.74,-106.34)|(19135970/30102682)] [=] [Fortress {4271405105414144}] [ApplyEffect {836045448945477}: Fortress {4271405105414144}]",Line:130998,At:78041427},
{Raw:"[21:40:57.453] [Huntmaster {4265104388390912}:39028000776141|(260.16,-283.35,-10.75,-70.13)|(18920662/30102682)] [=] [Fortress {4271405105414144}] [RemoveEffect {836045448945478}: Fortress {4271405105414144}]",Line:131808,At:78057453}
],Expected:[
{Start:78041427,End:78057453,StartLine:130998,EndLine:131808,Instance:"39028000776141"}
]},
{Name:"huntmaster-fortress-8m-v1-case3",WindowName:"Fortress",OverrideId:"",Boss:"DX-HMM",Area:"833571547775792",Mode:"836045448953655",Start:77910483,Fence:-1,Records:[
{Raw:"[21:39:48.704] [Huntmaster {4265104388390912}:8724001014201|(271.66,-275.23,-10.94,-179.52)|(18311624/30102682)] [=] [Fortress {4271405105414144}] [ApplyEffect {836045448945477}: Fortress {4271405105414144}]",Line:112281,At:77988704},
{Raw:"[21:40:05.800] [Huntmaster {4265104388390912}:8724001014201|(271.66,-275.23,-10.94,171.72)|(18242438/30102682)] [=] [Fortress {4271405105414144}] [RemoveEffect {836045448945478}: Fortress {4271405105414144}]",Line:113340,At:78005800},
{Raw:"[21:42:58.147] [Huntmaster {4265104388390912}:8724001014201|(256.92,-286.85,-11.06,-60.91)|(12868677/30102682)] [=] [Fortress {4271405105414144}] [ApplyEffect {836045448945477}: Fortress {4271405105414144}]",Line:120192,At:78178147}
],Expected:[
{Start:77988704,End:78005800,StartLine:112281,EndLine:113340,Instance:"8724001014201"},
{Start:78178147,End:-1,StartLine:120192,EndLine:0,Instance:"8724001014201"}
]},
{Name:"huntmaster-holdout-8m-v1-case1",WindowName:"Holdout Cover",OverrideId:"",Boss:"DX-HMM",Area:"833571547775792",Mode:"836045448953655",Start:3359830,Fence:-1,Records:[
{Raw:"[00:58:09.274] [Huntmaster {4265104388390912}:23320000032374|(262.00,-245.50,-9.48,-13.17)|(16730918/30102682)] [=] [Holdout Cover {4277787426816000}] [ApplyEffect {836045448945477}: Holdout Cover {4277787426816333}]",Line:105838,At:3489274},
{Raw:"[00:58:51.413] [Huntmaster {4265104388390912}:23320000032374|(262.00,-245.50,-9.48,-23.70)|(17700864/30102682)] [=] [Holdout Cover {4277787426816000}] [RemoveEffect {836045448945478}: Holdout Cover {4277787426816333}]",Line:108348,At:3531413}
],Expected:[
{Start:3489274,End:3531413,StartLine:105838,EndLine:108348,Instance:"23320000032374"}
]},
{Name:"huntmaster-holdout-8m-v1-case2",WindowName:"Holdout Cover",OverrideId:"",Boss:"DX-HMM",Area:"833571547775792",Mode:"836045448953655",Start:77961866,Fence:-1,Records:[
{Raw:"[21:41:16.666] [Huntmaster {4265104388390912}:39028000776141|(262.00,-245.50,-9.48,95.25)|(17746330/30102682)] [=] [Holdout Cover {4277787426816000}] [ApplyEffect {836045448945477}: Holdout Cover {4277787426816333}]",Line:132943,At:78076666},
{Raw:"[21:41:58.795] [Huntmaster {4265104388390912}:39028000776141|(262.00,-245.50,-9.48,-16.08)|(16052085/30102682)] [=] [Holdout Cover {4277787426816000}] [RemoveEffect {836045448945478}: Holdout Cover {4277787426816333}]",Line:135270,At:78118795}
],Expected:[
{Start:78076666,End:78118795,StartLine:132943,EndLine:135270,Instance:"39028000776141"}
]},
{Name:"huntmaster-flying-8m-v1-case1",WindowName:"Flying Fortress",OverrideId:"",Boss:"DX-HMM",Area:"833571547775792",Mode:"836045448953655",Start:3359830,Fence:-1,Records:[
{Raw:"[01:00:13.571] [Huntmaster {4265104388390912}:23320000032374|(251.73,-294.43,-11.01,-161.39)|(10214874/30102682)] [=] [Flying Fortress {4387871733579776}] [ApplyEffect {836045448945477}: Flying Fortress {4387871733579776}]",Line:112291,At:3613571},
{Raw:"[01:00:21.291] [Huntmaster {4265104388390912}:23320000032374|(262.00,-245.50,-9.48,37.51)|(14180518/30102682)] [=] [Fortress {4281996494766080}] [ApplyEffect {836045448945477}: Fortress {4281996494766080}]",Line:112669,At:3621291}
],Expected:[
{Start:3613571,End:3621291,StartLine:112291,EndLine:112669,Instance:"23320000032374"}
]},
{Name:"huntmaster-flying-8m-v1-case2",WindowName:"Flying Fortress",OverrideId:"",Boss:"DX-HMM",Area:"833571547775792",Mode:"836045448953655",Start:77961866,Fence:-1,Records:[
{Raw:"[21:43:16.660] [Huntmaster {4265104388390912}:39028000776141|(266.97,-293.78,-10.77,117.10)|(11873773/30102682)] [=] [Flying Fortress {4387871733579776}] [ApplyEffect {836045448945477}: Flying Fortress {4387871733579776}]",Line:138565,At:78196660},
{Raw:"[21:44:00.388] [Huntmaster {4265104388390912}:39028000776141|(262.00,-245.50,-9.48,-7.10)|(13671358/30102682)] [=] [Fortress {4281996494766080}] [ApplyEffect {836045448945477}: Fortress {4281996494766080}]",Line:140583,At:78240388}
],Expected:[
{Start:78196660,End:78240388,StartLine:138565,EndLine:140583,Instance:"39028000776141"}
]},
{Name:"apex-voltinator-8m-v1-case1",WindowName:"Voltinator",OverrideId:"voltinator",Boss:"DX-AP",Area:"833571547775792",Mode:"836045448953655",Start:8631766,Fence:-1,Records:[
{Raw:"[02:28:04.073] [Apex Vanguard {4350020186800128}:16705004496162|(423.35,-304.87,-13.98,-15.08)|(41947428/62726540)] [=] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:370223,At:8884073},
{Raw:"[02:28:14.183] [Apex Vanguard {4350020186800128}:16705004496162|(423.35,-304.87,-13.98,42.47)|(41845976/62726540)] [] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]",Line:370755,At:8894183},
{Raw:"[02:31:05.487] [Apex Vanguard {4350020186800128}:16705004496162|(438.39,-251.44,-13.98,-35.70)|(25692564/62726540)] [=] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:380495,At:9065487},
{Raw:"[02:31:18.697] [Apex Vanguard {4350020186800128}:16705004496162|(438.77,-251.88,-13.98,-83.74)|(25629808/62726540)] [] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]",Line:381183,At:9078697},
{Raw:"[02:32:12.123] [Apex Vanguard {4350020186800128}:16705004496162|(440.67,-289.02,-13.99,48.88)|(21363094/62726540)] [=] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:384320,At:9132123},
{Raw:"[02:32:24.640] [Apex Vanguard {4350020186800128}:16705004496162|(442.06,-287.67,-13.98,40.97)|(21273680/62726540)] [] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]",Line:384841,At:9144640},
{Raw:"[02:34:19.581] [Apex Vanguard {4350020186800128}:16705004496162|(391.01,-235.38,-13.98,180.57)|(12794473/62726540)] [=] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:391036,At:9259581},
{Raw:"[02:34:30.890] [Apex Vanguard {4350020186800128}:16705004496162|(391.01,-235.38,-13.98,-163.57)|(12757387/62726540)] [] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]",Line:391571,At:9270890}
],Expected:[
{Start:8884073,End:8894183,StartLine:370223,EndLine:370755,Instance:"16705004496162"},
{Start:9065487,End:9078697,StartLine:380495,EndLine:381183,Instance:"16705004496162"},
{Start:9132123,End:9144640,StartLine:384320,EndLine:384841,Instance:"16705004496162"},
{Start:9259581,End:9270890,StartLine:391036,EndLine:391571,Instance:"16705004496162"}
]},
{Name:"apex-voltinator-8m-v1-case2",WindowName:"Voltinator",OverrideId:"voltinator",Boss:"DX-AP",Area:"833571547775792",Mode:"836045448953655",Start:78709091,Fence:-1,Records:[
{Raw:"[21:55:58.340] [Apex Vanguard {4350020186800128}:44021000796193|(375.58,-287.37,-13.98,83.61)|(40602524/62726540)] [=] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:88681,At:78958340},
{Raw:"[21:56:08.455] [Apex Vanguard {4350020186800128}:44021000796193|(375.58,-287.37,-13.98,-81.29)|(40546832/62726540)] [] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]",Line:89209,At:78968455},
{Raw:"[21:58:48.113] [Apex Vanguard {4350020186800128}:44021000796193|(397.82,-232.30,-13.98,177.97)|(24901768/62726540)] [=] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:98215,At:79128113},
{Raw:"[21:59:03.414] [Apex Vanguard {4350020186800128}:44021000796193|(397.18,-231.88,-13.98,102.90)|(24850116/62726540)] [] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]",Line:99101,At:79143414},
{Raw:"[22:00:17.684] [Apex Vanguard {4350020186800128}:44021000796193|(375.18,-282.89,-13.98,-9.35)|(18683474/62726540)] [=] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:103305,At:79217684},
{Raw:"[22:00:30.598] [Apex Vanguard {4350020186800128}:44021000796193|(375.18,-282.89,-13.98,-9.35)|(18651378/62726540)] [] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]",Line:104086,At:79230598},
{Raw:"[22:02:00.451] [Apex Vanguard {4350020186800128}:44021000796193|(376.35,-289.30,-13.98,127.19)|(11600364/62726540)] [=] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityActivate {836045448945479}]",Line:109390,At:79320451},
{Raw:"[22:02:12.076] [Apex Vanguard {4350020186800128}:44021000796193|(376.04,-289.21,-13.98,134.77)|(12371975/62726540)] [] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]",Line:110140,At:79332076}
],Expected:[
{Start:78958340,End:78968455,StartLine:88681,EndLine:89209,Instance:"44021000796193"},
{Start:79128113,End:79143414,StartLine:98215,EndLine:99101,Instance:"44021000796193"},
{Start:79217684,End:79230598,StartLine:103305,EndLine:104086,Instance:"44021000796193"},
{Start:79320451,End:79332076,StartLine:109390,EndLine:110140,Instance:"44021000796193"}
]},
{Name:"izax-deflector-down-8m-v1-case1",WindowName:"Deflector Shield down",OverrideId:"",Boss:"G-IZ",Area:"833571547775765",Mode:"836045448953655",Start:81378992,Fence:-1,Records:[
{Raw:"[22:37:14.499] [IZAX {4108097563918336}:19610001536169|(101.25,2261.00,792.97,90.00)|(245611184/254712048)] [=] [Deflector Shield {4160148272578560}] [ApplyEffect {836045448945477}: Deflector Shield {4160148272578560}]",Line:14629,At:81434499},
{Raw:"[22:37:15.706] [IZAX {4108097563918336}:19610001536169|(101.25,2261.00,792.97,90.00)|(245611184/254712048)] [=] [Deflector Shield {4160148272578560}] [RemoveEffect {836045448945478}: Deflector Shield {4160148272578560}]",Line:14644,At:81435706},
{Raw:"[22:37:34.521] [IZAX {4108097563918336}:19610001536169|(62.25,2300.25,792.97,0.00)|(244859232/254712048)] [=] [Deflector Shield {4160148272578560}] [ApplyEffect {836045448945477}: Deflector Shield {4160148272578560}]",Line:15348,At:81454521},
{Raw:"[22:38:33.239] [IZAX {4108097563918336}:19610001536169|(62.25,2300.25,792.97,0.00)|(228590768/254712048)] [=] [Deflector Shield {4160148272578560}] [RemoveEffect {836045448945478}: Deflector Shield {4160148272578560}]",Line:18521,At:81513239},
{Raw:"[22:38:49.162] [IZAX {4108097563918336}:19610001536169|(62.25,2300.25,792.97,0.00)|(223599184/254712048)] [=] [Deflector Shield {4160148272578560}] [ApplyEffect {836045448945477}: Deflector Shield {4160148272578560}]",Line:19449,At:81529162},
{Raw:"[22:38:50.463] [IZAX {4108097563918336}:19610001536169|(62.25,2300.25,792.97,0.00)|(223599184/254712048)] [=] [Deflector Shield {4160148272578560}] [RemoveEffect {836045448945478}: Deflector Shield {4160148272578560}]",Line:19507,At:81530463},
{Raw:"[22:39:09.402] [IZAX {4108097563918336}:19610001536169|(62.25,2222.25,792.97,180.00)|(223455360/254712048)] [=] [Deflector Shield {4160148272578560}] [ApplyEffect {836045448945477}: Deflector Shield {4160148272578560}]",Line:20261,At:81549402},
{Raw:"[22:39:36.967] [IZAX {4108097563918336}:19610001536169|(62.25,2222.25,792.97,180.00)|(207186896/254712048)] [=] [Deflector Shield {4160148272578560}] [RemoveEffect {836045448945478}: Deflector Shield {4160148272578560}]",Line:22136,At:81576967},
{Raw:"[22:39:49.566] [IZAX {4108097563918336}:19610001536169|(62.25,2222.25,792.97,180.00)|(203174448/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:22833,At:81589566},
{Raw:"[22:40:32.573] [IZAX {4108097563918336}:19610001536169|(62.25,2300.25,792.97,0.00)|(189816592/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:24544,At:81632573},
{Raw:"[22:41:25.482] [IZAX {4108097563918336}:19610001536169|(23.25,2261.25,792.97,-90.00)|(175218768/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:26557,At:81685482},
{Raw:"[22:42:23.901] [IZAX {4108097563918336}:19610001536169|(23.25,2261.25,792.97,-90.00)|(173626144/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:28683,At:81743901},
{Raw:"[22:43:01.101] [IZAX {4108097563918336}:19610001536169|(101.25,2261.00,792.97,90.00)|(160170816/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:29941,At:81781101},
{Raw:"[22:43:38.607] [IZAX {4108097563918336}:19610001536169|(101.25,2261.00,792.97,90.00)|(154856240/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:31796,At:81818607}
],Expected:[
{Start:81435706,End:81454521,StartLine:14644,EndLine:15348,Instance:"19610001536169"},
{Start:81513239,End:81529162,StartLine:18521,EndLine:19449,Instance:"19610001536169"},
{Start:81530463,End:81549402,StartLine:19507,EndLine:20261,Instance:"19610001536169"},
{Start:81576967,End:81589566,StartLine:22136,EndLine:22833,Instance:"19610001536169"}
]},
{Name:"izax-deflector-down-8m-v1-case2",WindowName:"Deflector Shield down",OverrideId:"",Boss:"G-IZ",Area:"833571547775765",Mode:"836045448953655",Start:46478098,Fence:-1,Records:[
{Raw:"[12:55:32.320] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(246277760/254712048)] [=] [Deflector Shield {4160148272578560}] [ApplyEffect {836045448945477}: Deflector Shield {4160148272578560}]",Line:78040,At:46532320},
{Raw:"[12:55:33.542] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(246266304/254712048)] [=] [Deflector Shield {4160148272578560}] [RemoveEffect {836045448945478}: Deflector Shield {4160148272578560}]",Line:78070,At:46533542},
{Raw:"[12:55:52.342] [IZAX {4108097563918336}:156458000833530|(62.25,2222.25,792.97,180.00)|(245490416/254712048)] [=] [Deflector Shield {4160148272578560}] [ApplyEffect {836045448945477}: Deflector Shield {4160148272578560}]",Line:78834,At:46552342},
{Raw:"[12:56:24.854] [IZAX {4108097563918336}:156458000833530|(62.25,2222.25,792.97,180.00)|(229221952/254712048)] [=] [Deflector Shield {4160148272578560}] [RemoveEffect {836045448945478}: Deflector Shield {4160148272578560}]",Line:80957,At:46584854},
{Raw:"[12:56:40.749] [IZAX {4108097563918336}:156458000833530|(62.25,2222.25,792.97,180.00)|(224711440/254712048)] [=] [Deflector Shield {4160148272578560}] [ApplyEffect {836045448945477}: Deflector Shield {4160148272578560}]",Line:81626,At:46600749},
{Raw:"[12:56:41.148] [IZAX {4108097563918336}:156458000833530|(62.25,2222.25,792.97,180.00)|(224711440/254712048)] [=] [Deflector Shield {4160148272578560}] [RemoveEffect {836045448945478}: Deflector Shield {4160148272578560}]",Line:81632,At:46601148},
{Raw:"[12:56:59.968] [IZAX {4108097563918336}:156458000833530|(23.25,2261.25,792.97,-90.00)|(224634272/254712048)] [=] [Deflector Shield {4160148272578560}] [ApplyEffect {836045448945477}: Deflector Shield {4160148272578560}]",Line:82270,At:46619968},
{Raw:"[12:57:26.157] [IZAX {4108097563918336}:156458000833530|(23.25,2261.25,792.97,-90.00)|(208365808/254712048)] [=] [Deflector Shield {4160148272578560}] [RemoveEffect {836045448945478}: Deflector Shield {4160148272578560}]",Line:83664,At:46646157},
{Raw:"[12:57:41.963] [IZAX {4108097563918336}:156458000833530|(23.25,2261.25,792.97,-90.00)|(203475696/254712048)] [=] [Deflector Shield {4160148272578560}] [ApplyEffect {836045448945477}: Deflector Shield {4160148272578560}]",Line:84528,At:46661963},
{Raw:"[12:57:42.361] [IZAX {4108097563918336}:156458000833530|(23.25,2261.25,792.97,-90.00)|(203475696/254712048)] [=] [Deflector Shield {4160148272578560}] [RemoveEffect {836045448945478}: Deflector Shield {4160148272578560}]",Line:84533,At:46662361},
{Raw:"[12:57:42.361] [IZAX {4108097563918336}:156458000833530|(23.25,2261.25,792.97,-90.00)|(203475696/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:84534,At:46662361},
{Raw:"[12:59:02.315] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(188329248/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:87619,At:46742315},
{Raw:"[12:59:26.815] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(173087232/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:88640,At:46766815},
{Raw:"[13:00:28.545] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(171582192/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:90871,At:46828545},
{Raw:"[13:02:07.086] [IZAX {4108097563918336}:156458000833530|(62.25,2300.25,792.97,0.00)|(152956224/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:94984,At:46927086}
],Expected:[
{Start:46533542,End:46552342,StartLine:78070,EndLine:78834,Instance:"156458000833530"},
{Start:46584854,End:46600749,StartLine:80957,EndLine:81626,Instance:"156458000833530"},
{Start:46601148,End:46619968,StartLine:81632,EndLine:82270,Instance:"156458000833530"},
{Start:46646157,End:46661963,StartLine:83664,EndLine:84528,Instance:"156458000833530"},
{Start:46662361,End:46662361,StartLine:84533,EndLine:84534,Instance:"156458000833530"}
]},
{Name:"izax-damaged-shield-down-8m-v1-case1",WindowName:"Damaged Deflector Shield down",OverrideId:"",Boss:"G-IZ",Area:"833571547775765",Mode:"836045448953655",Start:81378992,Fence:-1,Records:[
{Raw:"[22:39:49.566] [IZAX {4108097563918336}:19610001536169|(62.25,2222.25,792.97,180.00)|(203174448/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:22833,At:81589566},
{Raw:"[22:40:20.472] [IZAX {4108097563918336}:19610001536169|(62.25,2300.25,792.97,0.00)|(203165424/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]",Line:23981,At:81620472},
{Raw:"[22:40:32.573] [IZAX {4108097563918336}:19610001536169|(62.25,2300.25,792.97,0.00)|(189816592/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:24544,At:81632573},
{Raw:"[22:41:13.485] [IZAX {4108097563918336}:19610001536169|(23.25,2261.25,792.97,-90.00)|(189801776/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]",Line:26019,At:81673485},
{Raw:"[22:41:25.482] [IZAX {4108097563918336}:19610001536169|(23.25,2261.25,792.97,-90.00)|(175218768/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:26557,At:81685482},
{Raw:"[22:42:11.898] [IZAX {4108097563918336}:19610001536169|(23.25,2261.25,792.97,-90.00)|(175195824/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]",Line:28274,At:81731898},
{Raw:"[22:42:23.901] [IZAX {4108097563918336}:19610001536169|(23.25,2261.25,792.97,-90.00)|(173626144/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:28683,At:81743901},
{Raw:"[22:43:01.101] [IZAX {4108097563918336}:19610001536169|(101.25,2261.00,792.97,90.00)|(160170816/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:29941,At:81781101},
{Raw:"[22:43:26.513] [IZAX {4108097563918336}:19610001536169|(101.25,2261.00,792.97,90.00)|(160148928/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]",Line:31165,At:81806513},
{Raw:"[22:43:38.607] [IZAX {4108097563918336}:19610001536169|(101.25,2261.00,792.97,90.00)|(154856240/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:31796,At:81818607},
{Raw:"[22:43:52.817] [IZAX {4108097563918336}:19610001536169|(101.25,2261.00,792.97,90.00)|(154821680/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]",Line:32526,At:81832817},
{Raw:"[22:44:02.733] [IZAX {4108097563918336}:19610001536169|(101.25,2261.00,792.97,90.00)|(152814944/254712048)] [=] [Missile Launcher Damage {4173226447994880}] [ApplyEffect {836045448945477}: Missile Launcher Damage {4173226447994880}]",Line:33072,At:81842733}
],Expected:[
{Start:81620472,End:81632573,StartLine:23981,EndLine:24544,Instance:"19610001536169"},
{Start:81673485,End:81685482,StartLine:26019,EndLine:26557,Instance:"19610001536169"},
{Start:81731898,End:81743901,StartLine:28274,EndLine:28683,Instance:"19610001536169"},
{Start:81806513,End:81818607,StartLine:31165,EndLine:31796,Instance:"19610001536169"},
{Start:81832817,End:81842733,StartLine:32526,EndLine:33072,Instance:"19610001536169"}
]},
{Name:"izax-damaged-shield-down-8m-v1-case2",WindowName:"Damaged Deflector Shield down",OverrideId:"",Boss:"G-IZ",Area:"833571547775765",Mode:"836045448953655",Start:46478098,Fence:-1,Records:[
{Raw:"[12:57:42.361] [IZAX {4108097563918336}:156458000833530|(23.25,2261.25,792.97,-90.00)|(203475696/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:84534,At:46662361},
{Raw:"[12:58:50.305] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(190218992/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]",Line:87047,At:46730305},
{Raw:"[12:59:02.315] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(188329248/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:87619,At:46742315},
{Raw:"[12:59:14.817] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(188325344/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]",Line:88161,At:46754817},
{Raw:"[12:59:26.815] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(173087232/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:88640,At:46766815},
{Raw:"[13:00:16.537] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(173075040/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]",Line:90418,At:46816537},
{Raw:"[13:00:28.545] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(171582192/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:90871,At:46828545},
{Raw:"[13:00:46.849] [IZAX {4108097563918336}:156458000833530|(101.25,2261.00,792.97,90.00)|(171502752/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]",Line:91557,At:46846849},
{Raw:"[13:01:55.068] [IZAX {4108097563918336}:156458000833530|(62.25,2300.25,792.97,0.00)|(157482720/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]",Line:94343,At:46915068},
{Raw:"[13:02:07.086] [IZAX {4108097563918336}:156458000833530|(62.25,2300.25,792.97,0.00)|(152956224/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]",Line:94984,At:46927086},
{Raw:"[13:02:20.301] [IZAX {4108097563918336}:156458000833530|(62.25,2300.25,792.97,0.00)|(152902624/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]",Line:95673,At:46940301},
{Raw:"[13:02:20.794] [IZAX {4108097563918336}:156458000833530|(62.25,2300.25,792.97,0.00)|(152810128/254712048)] [=] [Missile Launcher Damage {4173226447994880}] [ApplyEffect {836045448945477}: Missile Launcher Damage {4173226447994880}]",Line:95709,At:46940794}
],Expected:[
{Start:46730305,End:46742315,StartLine:87047,EndLine:87619,Instance:"156458000833530"},
{Start:46754817,End:46766815,StartLine:88161,EndLine:88640,Instance:"156458000833530"},
{Start:46816537,End:46828545,StartLine:90418,EndLine:90871,Instance:"156458000833530"},
{Start:46846849,End:46927086,StartLine:91557,EndLine:94984,Instance:"156458000833530"},
{Start:46940301,End:46940794,StartLine:95673,EndLine:95709,Instance:"156458000833530"}
]}
    ]
    return cases
}

; Isolated synthetic clock/order permutations of exact recorded IP-CPT self-effect IDs.
; Requires the existing V73SectionState/V73SectionObserve and V72PW fixtures.
; Does not read user files or change live application state.
V73WORefresh()
{
    seg := V73SectionState()
    V73SectionObserve(seg,"apply",1000,1)
    V73SectionObserve(seg,"apply",1100,2)
    V73SectionObserve(seg,"apply",1100,2)
    V73SectionObserve(seg,"apply",3000,3)
    V73SectionObserve(seg,"remove",4000,4)
    s := IGWCompact(seg),w := seg.PhaseWindows.Windows["droids:1"]
    V48Assert(s.Counts[1].Started=1 && s.Counts[1].Completed=1,"same-instance refreshes remain one completed section")
    V48Assert(w.Start=1000 && w.End=4000 && !s.Limited,"refreshes retain exact original bounds without inventing a gap")
    ledger := seg.PhaseWindows.Meta["Ledger"]
    V48Assert(ledger.Facts.Length=2 && ledger.ReplayBase.Windows["droids:1"].Start=1000,"settled refreshes leave only the bounded recent tail")
}

V73WOLateEnd()
{
    seg := V73SectionState()
    for index,row in [["apply",1000],["apply",3000],["remove",2000],["remove",4000]]
        V73SectionObserve(seg,row[1],row[2],index)
    s := IGWCompact(seg)
    V48Assert(s.Counts[1].Started=2 && s.Counts[1].Completed=2 && !s.Limited,"next start before delayed prior end recovers both recorded cycles")
    one := seg.PhaseWindows.Windows["droids:1"],two := seg.PhaseWindows.Windows["droids:2"]
    V48Assert(one.Start=1000 && one.End=2000 && two.Start=3000 && two.End=4000,"late endpoint cannot stretch, merge or overlap the two intervals")
}

V73WOOrphanIdentities()
{
    seg := V73SectionState()
    V73SectionObserve(seg,"remove",2000,1,100)
    V73SectionObserve(seg,"remove",2100,2,99)
    V73SectionObserve(seg,"apply",1000,3,99)
    s := IGWCompact(seg),w := seg.PhaseWindows.Windows["droids:1"]
    V48Assert(s.Counts[1].Started=1 && s.Counts[1].Completed=1 && w.End=2100,"competing orphan endpoints retain the matching actor instance")
    V48Assert(!s.Limited,"complete matching identity evidence is not lost behind an earlier unrelated endpoint")
    V73SectionObserve(seg,"apply",3000,4,99)
    V48Assert(IGWCompact(seg).Counts[1].Completed=1,"old orphan endpoints cannot close a later occurrence")
    V73SectionObserve(seg,"remove",4000,5,100)
    V48Assert(IGWCompact(seg).Counts[1].Completed=1,"another instance cannot close the later active occurrence")
    V73SectionObserve(seg,"remove",4500,6,99)
    V48Assert(IGWCompact(seg).Counts[1].Completed=2,"correct later endpoint remains usable after mismatching removal")
}

V73WOJournal()
{
    state := IPNewData("Isolated ordering rollback"),seg := V73SectionState()
    V73SectionObserve(seg,"apply",1000,1)
    before := IGVJson(IGVPackProgress(IGPCompact(seg)))
    ledgerBefore := V73WOLedgerSignature(seg)
    IPBBeginUndo(state,seg)
    V73SectionObserve(seg,"apply",3000,2)
    V73SectionObserve(seg,"remove",2000,3)
    V73SectionObserve(seg,"remove",4000,4)
    V48Assert(IGWCompact(seg).Counts[1].Completed=2,"speculative ordering repair actually changed the state being tested")
    IPBRollbackTail(state,seg)
    V48Assert(IGVJson(IGVPackProgress(IGPCompact(seg)))=before,"rollback restores exact compact metadata after recovering a pending start")
    V48Assert(seg.PhaseWindows.Windows.Count=1 && seg.PhaseWindows.Windows["droids:1"].End<0,"recovered windows and endpoints do not leak through undo")
    V48Assert(V73WOLedgerSignature(seg)=ledgerBefore,"rollback restores settled base and pending boundary facts together")
    seg := V73SectionState(),IPBBeginUndo(state,seg)
    V73SectionObserve(seg,"remove",2000,1,100)
    V73SectionObserve(seg,"remove",2100,2,99)
    V73SectionObserve(seg,"apply",1000,3,99)
    V48Assert(IGWCompact(seg).Counts[1].Completed=1,"orphan repair was present before rollback")
    IPBRollbackTail(state,seg)
    V48Assert(!IsObject(IGWCompact(seg)) && seg.PhaseWindows.Windows.Count=0,"rolled-back orphan repair leaves no section evidence")
    V48Assert(!seg.PhaseWindows.Meta.Has("Ledger"),"all newly-created boundary facts are rolled back")
}

V73WOAnalysisFence()
{
    rows := [V72PWEvent("apply",1000,1),V72PWEvent("apply",3000,2),V72PWEvent("remove",2000,3),V72PWEvent("remove",4000,4)]
    seg := V73SectionState(),d := V72PWData(rows,3500),windows := IGWAnalysisWindows(d,seg)
    V48Assert(windows.Length=2 && windows[1].From=1 && windows[1].To=2,"accepted reordered metadata reconstructs the first exact review range")
    V48Assert(windows[2].From=3 && windows[2].To=3.5 && windows[2].Boundary.OpenEnd,"endpoint beyond accepted fight cutoff cannot complete the final range")
    V48Assert(InStr(windows[2].Name,"end not recorded"),"cutoff-truncated endpoint remains visible to the reviewer")
    V48Assert(!seg.HasOwnProp("PhaseWindows"),"Analysis order repair uses private state")
    rows[2].Analysis.Accepted := false
    V48Assert(IGWAnalysisWindows(d,seg).Length=1,"rejected second start cannot be recovered from a pending candidate")
}

V73WOReverseCycles()
{
    ; Entire second short interval arrives first, still within the2500ms allowance.
    seg := V73SectionState()
    for index,row in [["remove",2500],["apply",2000],["apply",1000],["remove",1500]]
        V73SectionObserve(seg,row[1],row[2],index)
    s := IGWCompact(seg)
    V48Assert(s.Counts[1].Started=2 && s.Counts[1].Completed=2,"reverse interval arrival retains two complete witnessed cycles")
    endpoints := []
    for key,w in seg.PhaseWindows.Windows
        endpoints.Push(w.Start ":" w.End)
    V48Assert((endpoints[1]="1000:1500" && endpoints[2]="2000:2500") || (endpoints[2]="1000:1500" && endpoints[1]="2000:2500"),"reverse-arrival repair preserves all four boundaries")
}

V73WOLedgerSignature(seg)
{
    ledger := seg.PhaseWindows.Meta["Ledger"],text := ledger.Floor "|"
    for key,w in ledger.ReplayBase.Windows
        text .= key ":" w.Start ":" w.StartSeq ":" w.End ":" w.EndSeq "|"
    for fact in ledger.Facts
        text .= fact.Identity "|"
    return text
}

V73WOHorizon()
{
    seg := V73SectionState()
    V73SectionObserve(seg,"remove",3500,2),V73SectionObserve(seg,"apply",1000,1)
    V48Assert(IGWCompact(seg).Counts[1].Completed=1 && !IGWCompact(seg).Limited,"exact2500ms reorder horizon includes its oldest boundary")
    seg := V73SectionState()
    V73SectionObserve(seg,"remove",3501,2),V73SectionObserve(seg,"apply",1000,1)
    V48Assert(IGWCompact(seg).Counts[1].Started=0 && IGWCompact(seg).Limited,"outside-horizon boundary is disclosed rather than silently rewriting settled history")
    seg := V73SectionState()
    Loop 64 {
        at := A_Index*5000
        V73SectionObserve(seg,"apply",at,A_Index*2-1),V73SectionObserve(seg,"remove",at+500,A_Index*2)
    }
    r := seg.PhaseWindows,ledger := r.Meta["Ledger"]
    V48Assert(r.Windows.Count=64 && IGWCompact(seg).Counts[1].Completed=64 && !IGWCompact(seg).Limited,"settled windows retain all64 complete occurrences without retaining full history")
    V48Assert(ledger.Facts.Length=2 && ledger.ReplayBase.Windows.Count=63,"only latest short interval remains in the ordered suffix")
    V73SectionObserve(seg,"apply",400000,129)
    V48Assert(r.Windows.Count=64 && IGWCompact(seg).Limited,"65th occurrence marks bounded coverage without exceeding64windows")
}

V73WOOverflow()
{
    seg := V73SectionState()
    Loop 256
        V73SectionObserve(seg,"apply",1000+A_Index,A_Index)
    V48Assert(seg.PhaseWindows.Meta["Ledger"].Facts.Length=256 && !IGWCompact(seg).Limited,"256 distinct recent refresh facts fit the fixed ledger capacity")
    V73SectionObserve(seg,"apply",1256,256)
    V48Assert(seg.PhaseWindows.Meta["Ledger"].Facts.Length=256 && !IGWCompact(seg).Limited,"exact duplicate delivery does not consume another ledger slot")
    V73SectionObserve(seg,"apply",1257,257)
    V48Assert(seg.PhaseWindows.Meta["Ledger"].Facts.Length=256 && IGWCompact(seg).Limited,"overflow is bounded and explicitly disclosed")
    V73SectionObserve(seg,"remove",5000,258)
    V48Assert(IGWCompact(seg).Counts[1].Completed=1 && IGWCompact(seg).Limited,"settling the tail retains a prior coverage warning")
}

V73WOInstanceStream()
{
    c := ""
    for item in V73ModernWindowCases()
        if item.Name="red-bull-8m-v1-case1"
            c := item
    V48Assert(IsObject(c),"recorded Red Bull positive-contact fixture is available")
    ev := IPParseLine(c.Records[1].Raw),seg := V73WitnessSegment(c.Boss,c.Area,c.Mode)
    V48Assert(ev.Kind="Damage","stream fixture exercises the ordinary damage start condition")
    ev.RecordId := 1,IGWObserve(seg,ev,1000)
    Loop 5000 {
        ev.RecordId := A_Index+1
        IGWObserve(seg,ev,1000+A_Index)
    }
    r := seg.PhaseWindows
    V48Assert(r.Meta["Ledger"].Facts.Length=1 && r.Windows.Count=1 && !IGWCompact(seg).Limited,"5000positive hits to one observed NPC retain one compact boundary without overflow")
    V48Assert(r.Windows["stampeding-bull:1"].Start=1000 && r.Windows["stampeding-bull:1"].StartSeq=1,"repeated hits never replace the first positive contact")
    seg := V73WitnessSegment(c.Boss,c.Area,c.Mode),ev.RecordId := 20,IGWObserve(seg,ev,2000)
    ev.RecordId := 10,IGWObserve(seg,ev,1000)
    V48Assert(seg.PhaseWindows.Meta["Ledger"].Facts.Length=1 && seg.PhaseWindows.Windows["stampeding-bull:1"].Start=1000,"an earlier contact replaces the same instance fact instead of losing it or keeping both")
    seg := V73WitnessSegment("G-TY","833571547775765","836045448953655")
    ev.Target.Key := "N:4078423634870272:99",ev.RecordId := 1,IGWObserve(seg,ev,1000)
    Loop 5000 {
        ev.RecordId := A_Index+1
        IGWObserve(seg,ev,1000+A_Index)
    }
    V48Assert(seg.PhaseWindows.Meta["Ledger"].Facts.Length=1 && !IGWCompact(seg).Limited,"5000Tyth hits keep one opening boundary rather than replay every damage row")
    seg := V73WitnessSegment("G-AE","833571547775765","836045448953655")
    ev.Target.Key := "N:4105254295568384:99",ev.RecordId := 1,IGWObserve(seg,ev,1000)
    ev.Target.Key := "N:4088525397950464:100",ev.RecordId := 2,IGWObserve(seg,ev,2000)
    Loop 5000 {
        ev.RecordId := A_Index+2
        IGWObserve(seg,ev,2000+A_Index)
    }
    r := seg.PhaseWindows
    V48Assert(r.Meta["Ledger"].Facts.Length=2 && r.Windows["section-1:1"].End=2000
        && r.Windows["section-2:1"].Start=2000 && !IGWCompact(seg).Limited,"5000Sisters hits preserve both one-off ending and opening with two retained facts")
    seg := V73WitnessSegment("G-AE","833571547775765","836045448953655")
    ev.Target.Key := "N:4105254295568384:99",ev.RecordId := 1,IGWObserve(seg,ev,1000)
    ev.Target.Key := "N:4088525397950464:100",ev.RecordId := 3,IGWObserve(seg,ev,3000)
    ev.RecordId := 2,IGWObserve(seg,ev,2000)
    V48Assert(seg.PhaseWindows.Windows["section-1:1"].End=2000 && seg.PhaseWindows.Windows["section-2:1"].Start=2000,"earlier one-off contact still repairs both boundaries inside the horizon")
}

V73WOSameClock()
{
    seg := V73SectionState(),actions := ["apply","remove","apply","remove"]
    for index in [4,3,2,1]
        V73SectionObserve(seg,actions[index],1000,index)
    r := seg.PhaseWindows
    V48Assert(IGWCompact(seg).Counts[1].Completed=2 && !IGWCompact(seg).Limited,"record IDs order distinct boundaries sharing one timestamp")
    V48Assert(r.Windows["droids:1"].StartSeq=1 && r.Windows["droids:1"].EndSeq=2
        && r.Windows["droids:2"].StartSeq=3 && r.Windows["droids:2"].EndSeq=4,"equal-clock cycles preserve every exact source sequence")
}

V73WOAllOrders()
{
    items := [["apply",1000],["remove",1500],["apply",2000],["remove",2500]],failures := [],checked := 0
    Loop 4 {
        a := A_Index
        Loop 4 {
            b := A_Index
            if b=a
                continue
            Loop 4 {
                c := A_Index
                if c=a || c=b
                    continue
                d := 10-a-b-c,seg := V73SectionState(),order := [a,b,c,d]
                for seq,index in order
                    V73SectionObserve(seg,items[index][1],items[index][2],seq)
                s := IGWCompact(seg),signature := "",checked += 1
                for key,w in seg.PhaseWindows.Windows
                    signature .= w.Start ":" w.End " "
                if s.Counts[1].Started!=2 || s.Counts[1].Completed!=2 || s.Limited
                    || !InStr(signature,"1000:1500 ") || !InStr(signature,"2000:2500 ")
                    failures.Push(a b c d "=" signature)
            }
        }
    }
    message := ""
    for failure in failures
        message .= (message="" ? "" : "; ") failure
    V48Assert(checked=24,"all arrival permutations of two short observed intervals were exercised")
    V48Assert(!failures.Length,"two completed cycles are arrival-order invariant within1500ms; failed " failures.Length ": " message)
}

V73WOOrdinal()
{
    seg := V73WitnessSegment("DP-RA","137438993410","836045448953655")
    actor := "Raptus {3302902865068032}:99|(0,0,0,0)|(10000/10000)"
    for seq,row in [["apply",1000],["first-end",1500],["remove",3000],["apply",2500]] {
        firstEnd := row[1]="first-end",ability := firstEnd ? "3302078231347200" : "3301008784490496"
        action := firstEnd ? "Event {836045448945472}: AbilityActivate {836045448945479}"
            : (row[1]="apply" ? "ApplyEffect {836045448945477}" : "RemoveEffect {836045448945478}") ": Challenge {3301008784490496}"
        ev := IPParseLine("[00:00:01.000] [" actor "] [=] [Challenge {" ability "}] [" action "]")
        ev.RecordId := seq
        IGWObserve(seg,ev,row[2])
    }
    r := seg.PhaseWindows
    V48Assert(r.Meta.Get("Count:raptus",0)=2,"delayed second challenge start still creates its own occurrence")
    V48Assert(r.Windows["raptus:1"].End=1500 && r.Windows["raptus:2"].End=3000,"ordinal-specific second ending is retained until chronology establishes its ordinal")
}

; Isolated native fixtures for v73. Function declarations only: no normal startup.
; Synthetic adversarial records are explicitly separate from literal originals.
; Include after an Iris SELF_TEST runtime and call L73RunAdversarial().

L73Assert(ok,message)
{
    V48Assert(ok,message)
}

L73New(boss,&state)
{
    state := IPNewData("Isolated legacy adversarial fixture")
    state.AreaId := boss="DF-DR" ? "137438993402" : "137438993037"
    state.ModeId := "836045448953655"
    seg := IPNewSegment(state,0,"Synthetic adversarial phase fixture")
    seg.BossKey := boss,seg.Last := 60000,seg.End := 60000,seg.Partial := false
    seg.PhaseProgress := Map()
    return seg
}

L73Event(kind,npc,instance,at,value := 100)
{
    t := "[00:00:" Format("{:02}",Floor(at/1000)) "." Format("{:03}",Mod(at,1000)) "] "
    enemy := "Enemy {" npc "}:" instance "|(0,0,0,0)|(" (kind="Death" ? 0 : 900) "/1000)"
    player := "@Fixture#1|(0,0,0,0)|(1000/1000)"
    switch kind {
        case "Damage":
            line := t "[" player "] [" enemy "] [Diagnostic {123}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (" value " energy {836045448940874}) <" value ".0>"
        case "ReverseDamage":
            line := t "[" enemy "] [" player "] [Diagnostic {123}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (" value " energy {836045448940874}) <" value ".0>"
        case "Death":
            line := t "[] [" enemy "] [] [Event {836045448945472}: Death {836045448945493}]"
        case "Activate":
            line := t "[" enemy "] [=] [Diagnostic {123}] [Event {836045448945472}: AbilityActivate {836045448945479}]"
        case "TargetSet":
            line := t "[" player "] [" enemy "] [] [Event {836045448945472}: TargetSet {836045448953668}]"
        default:
            throw Error("Unsupported fixture record")
    }
    ev := IPParseLine(line)
    L73Assert(IsObject(ev),"Synthetic adversarial record parses natively")
    ev.RecordId := at
    return ev
}

L73Observe(seg,kind,npc,instance,at,value := 100)
{
    ev := L73Event(kind,npc,instance,at,value)
    L73ObservedRule(seg,ev,at)
    return ev
}

L73ObservedRule(seg,ev,at)
{
    if seg.BossKey="DF-DR" {
        ; Draxus has no Parsely phases. Keep the historical mechanic's own
        ; actor/rollback regressions without putting its waves in primary UI.
        p := IGPXProfile(seg),positive := ev.Kind="Damage" && ev.Amount>0 && !ev.Immune && !ev.FullAbsorb
        IGPXObserve(seg,ev,at,p,IPBNpcId(ev.Source),IPBNpcId(ev.Target),positive)
    }
    else
        IGPObserve(seg,ev,at)
}

L73Stage(seg,want,message)
{
    L73Assert(seg.PhaseProgress.Get("Stage",0)=want,message)
}

L73DraxusOldAndNew()
{
    seg := L73New("DF-DR",&state)
    L73Observe(seg,"Damage","3303392491339776",100,500)
    L73Observe(seg,"Damage","3281324949372928",600,1000)
    L73Stage(seg,7,"First Despoiler establishes Wave 6")
    L73Observe(seg,"Damage","3317793516683264",700,2000)
    L73Stage(seg,8,"First Guardian establishes Wave 7")
    L73Observe(seg,"Damage","3281324949372928",600,3000)
    L73Stage(seg,8,"Living Wave 6 Despoiler cannot become Wave 8")
    L73Observe(seg,"TargetSet","3281324949372928",800,3500)
    L73Observe(seg,"Damage","3281324949372928",800,4000,0)
    ev := L73Event("Damage","3281324949372928",800,4200),ev.Immune := true
    L73ObservedRule(seg,ev,4200)
    ev := L73Event("Damage","3281324949372928",800,4300),ev.FullAbsorb := true
    L73ObservedRule(seg,ev,4300)
    L73Observe(seg,"Activate","3281324949372928",800,4400)
    L73Stage(seg,8,"Metadata, zero, immune, absorbed hits and casts do not establish new-wave positive engagement")
    L73Observe(seg,"ReverseDamage","3281324949372928",800,5000)
    L73Stage(seg,9,"New Despoiler attacking a player after Wave 7 establishes Wave 8")
    L73Observe(seg,"Damage","3281324949372928",600,6000)
    L73Stage(seg,9,"Old survivor cannot move progress backward or create another phase")
    primary := L73New("DF-DR",&primaryState)
    for row in [["3303392491339776",100],["3281324949372928",600],["3317793516683264",700],["3281324949372928",800]]
        IGPObserve(primary,L73Event("Damage",row[1],row[2],1000),1000)
    q := IGPCompact(primary)
    L73Assert(q.Profile="hp-only-v1" && q.Stage=1 && q.Hp=90 && q.Targets.Length=1,"primary Draxus progress uses the real boss HP and excludes add-wave health")
    L73Assert(!IsObject(q.Parsely),"Draxus wave mechanics do not manufacture primary phase choices")
}

L73DraxusMissingGuardian()
{
    seg := L73New("DF-DR",&state)
    L73Observe(seg,"Damage","3281324949372928",600,1000)
    L73Observe(seg,"Damage","3281324949372928",601,2000)
    L73Stage(seg,7,"A second Despoiler before any Guardian cannot invent Wave 8")
    L73Observe(seg,"Damage","3317793516683264",700,3000)
    L73Observe(seg,"Damage","3281324949372928",601,4000)
    L73Stage(seg,8,"Despoiler first active before the Guardian remains an old instance")
    L73Observe(seg,"Damage","3281324949372928",800,5000)
    L73Stage(seg,9,"Only a fresh post-Guardian positive instance advances")
}

L73DraxusJournal()
{
    seg := L73New("DF-DR",&state)
    L73Observe(seg,"Damage","3281324949372928",600,1000)
    L73Observe(seg,"Damage","3317793516683264",700,2000)
    before := IGVJson(IGVPackProgress(IGPCompact(seg)))
    IPBBeginUndo(state,seg)
    ev := L73Observe(seg,"Damage","3281324949372928",800,3000)
    L73Stage(seg,9,"Provisional new Despoiler advances the phase")
    key := "Seen:" ev.Target.Key
    L73Assert(seg.PhaseProgress.Has(key),"Provisional actor has a first-positive journal entry")
    IPBRollbackTail(state,seg)
    L73Assert(!seg.PhaseProgress.Has(key),"Rollback removes the provisional first-positive actor entry")
    L73Assert(IGVJson(IGVPackProgress(IGPCompact(seg)))=before,"Rollback restores exact compact phase and HP evidence")
    L73Observe(seg,"Damage","3281324949372928",600,4000)
    L73Stage(seg,8,"Old survivor remains ineligible after rollback")
    L73Observe(seg,"Damage","3281324949372928",800,5000)
    L73Stage(seg,9,"Accepted replay can establish the new Despoiler again")
}

L73WarlordsOrderDuplicateStale()
{
    seg := L73New("SNV-CW",&state)
    ids := ["3054400352288768","3054404647256064","3054408942223360","3156895451840512"]
    for i,id in ids
        L73Observe(seg,"Damage",id,100+i,1000+i*100)
    L73Stage(seg,1,"Four positive boss interactions establish current-pull instances")
    L73Observe(seg,"Death",ids[1],999,2000)
    L73Assert(seg.PhaseProgress.Get("PhaseDeaths",0)=0,"Unengaged stale instance cannot enter death count")
    L73Stage(seg,1,"Stale previous-pull death cannot advance")
    ; Deliberately differs from recorded Horic -> Tuchuk -> Vilus -> Sunder.
    L73Observe(seg,"Death",ids[2],102,3000)
    L73Stage(seg,2,"Sunder dying first advances to three warlords")
    L73Observe(seg,"Death",ids[2],102,3100)
    L73Stage(seg,2,"Duplicate death cannot advance the ordinal")
    L73Assert(seg.PhaseProgress.Get("PhaseDeaths",0)=1,"Duplicate target key is counted once")
    L73Observe(seg,"Death",ids[3],103,4000)
    L73Stage(seg,3,"Vilus dying second advances to two warlords")
    L73Observe(seg,"Death",ids[4],104,5000)
    L73Stage(seg,4,"Tuchuk dying third advances to the last warlord")
    L73Assert(!seg.Terminal,"Phase observation itself never marks a three-death clear")
    L73Observe(seg,"Death",ids[1],101,6000)
    L73Stage(seg,4,"Fourth death does not invent a fifth phase")
    L73Assert(seg.PhaseProgress.Get("PhaseDeaths",0)=4,"All four unique engaged boss deaths are retained")
    fresh := L73New("SNV-CW",&freshState)
    L73Observe(fresh,"Death",ids[1],101,7000)
    L73Assert(fresh.PhaseProgress.Get("PhaseDeaths",0)=0,"A new native segment cannot inherit old engagement or deaths")
}

L73WarlordsInvalidEngagement()
{
    seg := L73New("SNV-CW",&state),id := "3054400352288768"
    L73Observe(seg,"TargetSet",id,999,1000)
    L73Observe(seg,"Damage",id,999,1100,0)
    ev := L73Event("Damage",id,999,1200),ev.Immune := true
    IGPObserve(seg,ev,1200)
    ev := L73Event("Damage",id,999,1300),ev.FullAbsorb := true
    IGPObserve(seg,ev,1300)
    L73Observe(seg,"Activate",id,999,1400)
    L73Observe(seg,"Death",id,999,2000)
    L73Assert(seg.PhaseProgress.Get("PhaseDeaths",0)=0,"Only an accepted positive interaction qualifies an instance for death counting")
    L73Observe(seg,"Damage",id,1000,3000)
    L73Observe(seg,"Death",id,1000,2500)
    L73Assert(seg.PhaseProgress.Get("PhaseDeaths",0)=0,"A death timestamp preceding first engagement cannot count")
    L73Observe(seg,"Death",id,1000,4000)
    L73Stage(seg,2,"Later genuine death still counts after rejected stale record")
}

L73WarlordsJournal()
{
    seg := L73New("SNV-CW",&state)
    L73Observe(seg,"Damage","3054400352288768",101,1000)
    before := IGVJson(IGVPackProgress(IGPCompact(seg)))
    IPBBeginUndo(state,seg)
    seen := L73Observe(seg,"Damage","3054404647256064",102,2000)
    L73Observe(seg,"Death","3054404647256064",102,3000)
    L73Observe(seg,"Death","3054400352288768",101,4000)
    L73Stage(seg,3,"Provisional accepted tail counts two current-pull deaths")
    IPBRollbackTail(state,seg)
    L73Assert(IGVJson(IGVPackProgress(IGPCompact(seg)))=before,"Rollback restores compact Warlords progress")
    L73Assert(!seg.PhaseProgress.Has("Seen:" seen.Target.Key) && !seg.PhaseProgress.Has("PhaseDeath:" seen.Target.Key),"Rollback removes provisional engagement and death identity")
    L73Assert(seg.PhaseProgress.Get("PhaseDeaths",0)=0,"Rollback restores distinct death count")
    L73Observe(seg,"Death","3054404647256064",102,5000)
    L73Assert(seg.PhaseProgress.Get("PhaseDeaths",0)=0,"Rolled-back actor no longer qualifies for death count")
    L73Observe(seg,"Death","3054400352288768",101,6000)
    L73Stage(seg,2,"Preexisting accepted actor can be counted again after rollback")
}

L73RunAdversarial()
{
    global L73Assertions := 0
    groups := [L73DraxusOldAndNew,L73DraxusMissingGuardian,L73DraxusJournal,
        L73WarlordsOrderDuplicateStale,L73WarlordsInvalidEngagement,L73WarlordsJournal]
    for fn in groups
        fn.Call()
    return {Groups:groups.Length,Assertions:L73Assertions}
}

; Actual Parsely phase ranges, native raw-record regression fixtures.
; Source Aug11 recording and site report1307981; precise source hashes/line
; witnesses live in research/gods-parsely-evidence.json. Player names anonymized.
; These tests never open a log, change settings, emit audio or launch the app.
V74GodsParsely01()
{
    V74GodsParselyCase(V74GodsParselyCases()[1])
}

V74GodsParsely02()
{
    V74GodsParselyCase(V74GodsParselyCases()[2])
}

V74GodsParsely03()
{
    V74GodsParselyCase(V74GodsParselyCases()[3])
}

V74GodsParsely04()
{
    V74GodsParselyCase(V74GodsParselyCases()[4])
}

V74GodsParsely05()
{
    V74GodsParselyCase(V74GodsParselyCases()[5])
}

V74GodsParsely06()
{
    V74GodsParselyCase(V74GodsParselyCases()[6])
}

V74GodsParselyProfile(boss)
{
    p := IGPYGodsProfiles()[boss][1],p.Names := Map()
    for def in p.Phases
        p.Names[def.Id] := def.Name
    return p
}

V74GodsParselyCase(c)
{
    p := V74GodsParselyProfile(c.Boss)
    seg := {BossKey:c.Boss,AreaId:p.Area,ModeId:p.Mode,Start:c.Start,End:c.End,Last:c.End,PhaseProgress:Map()}
    for r in c.Records {
        ev := IPParseLine(r.Raw)
        V48Assert(IsObject(ev),"Recorded Gods phase row parses: " r.Line)
        ev.RecordId := r.Line
        IGPYObserve(seg,ev,r.At,p)
    }
    state := seg.PhaseProgress.Get("Parsely","")
    V48Assert(IsObject(state),"Native chronological phase state created")
    V48Assert(state.Windows.Length=c.Expected.Length,"Parsely phase count for " c.Name)
    for i,exp in c.Expected {
        w := state.Windows[i],name := w.Name (w.Ordinal>1 ? " " w.Ordinal : "")
        V48Assert(name=exp.Name,"Actual Parsely label " exp.Name)
        V48Assert(w.Start=exp.Start,"Actual Parsely start " exp.Name)
        V48Assert((w.End<0 ? c.End : w.End)=exp.End,"Actual Parsely end " exp.Name)
        if exp.HasOwnProp("StartLine")
            V48Assert(w.StartSeq=exp.StartLine,"Original boundary record sequence " exp.Name)
        if i<c.Expected.Length && c.Expected[i+1].HasOwnProp("StartLine")
            V48Assert(w.EndSeq=c.Expected[i+1].StartLine,"Next phase closes exact original boundary record")
    }
    V48Assert(!state.Limited,"Recorded fixture stays within bounded phase ledger")
    return state
}

V74GodsParselyWrongScopes()
{
    count := 0
    for boss,rows in IGPYGodsProfiles() {
        p := rows[1],count += 1
        V48Assert(p.Area="833571547775765" && p.Mode="836045448953655","Gods exact 8 Master scope")
        seg := {BossKey:boss,AreaId:p.Area,ModeId:p.Mode}
        found := IGPYProfile(seg)
        V48Assert(IsObject(found) && found.Key=p.Key,"Factory installed under exact boss binding")
        for mode in ["836045448953651","836045448953652","836045448953656","unknown"] {
            seg.ModeId := mode
            V48Assert(!IsObject(IGPYProfile(seg)),"Unverified Gods difficulty/size excluded")
        }
        seg.ModeId := p.Mode,seg.AreaId := "wrong"
        V48Assert(!IsObject(IGPYProfile(seg)),"Same actor outside Gods excluded")
    }
    V48Assert(count=5,"All five Gods encounters receive primary Parsely phases")
}

V74GodsParselyMarkerGuards()
{
    c := V74GodsParselyCases()[5],p := V74GodsParselyProfile("G-IZ"),rec := ""
    for r in c.Records
        if InStr(r.Raw,"Signal Jamming {4163764635042092}")
            rec := r
    V48Assert(IsObject(rec),"Real Signal Jamming boundary fixture exists")
    for kind in ["source","target","effect","action"] {
        ev := IPParseLine(rec.Raw)
        switch kind {
            case "source": ev.Source := IPParseLine(StrReplace(rec.Raw,"4163751750139904","9999999999999999")).Source
            case "target": ev.Target := IPParseLine(StrReplace(rec.Raw,"4108097563918336","9999999999999999")).Target
            case "effect": ev.EffectId := "4163764635042093"
            case "action": ev.ActionId := "836045448945478"
        }
        seg := {Start:0,PhaseProgress:Map()},IGPYObserve(seg,ev,rec.At,p)
        V48Assert(seg.PhaseProgress["Parsely"].Windows.Length=0,"Signal Jamming wrong " kind " cannot fabricate phase")
    }
    c := V74GodsParselyCases()[1],r := ""
    for candidate in c.Records
        if candidate.At=c.Expected[1].Start && InStr(candidate.Raw,"Damage {836045448945501}") {
            r := candidate
            break
        }
    for kind in ["zero","immune","absorbed","cast","source"] {
        ev := IPParseLine(r.Raw)
        switch kind {
            case "zero": ev.Amount := 0
            case "immune": ev.Immune := true
            case "absorbed": ev.FullAbsorb := true
            case "cast": ev.Kind := "Activate"
            case "source": ev.Source.Kind := "NPC"
        }
        seg := {Start:0,PhaseProgress:Map()},IGPYObserve(seg,ev,r.At,V74GodsParselyProfile("G-TY"))
        V48Assert(seg.PhaseProgress["Parsely"].Windows.Length=0,"Rejected Tyth opener: " kind)
    }
}

V74GodsParselySettledDamage()
{
    c := V74GodsParselyCases()[1],p := V74GodsParselyProfile("G-TY")
    seg := {Start:c.Start,PhaseProgress:Map()},hit := ""
    for r in c.Records {
        if r.At>c.Expected[2].Start
            break
        ev := IPParseLine(r.Raw),ev.RecordId := r.Line
        if ev.Kind="Damage" && !IsObject(hit)
            hit := ev
        IGPYObserve(seg,ev,r.At,p)
    }
    V48Assert(IsObject(hit) && seg.PhaseProgress["Parsely"].Windows.Length=2,"Real opening and first Inversion establish Tyth")
    Loop 1000 {
        ev := hit.Clone(),ev.RecordId := 500000+A_Index
        IGPYObserve(seg,ev,c.Expected[2].Start+3000+A_Index*2,p)
    }
    state := seg.PhaseProgress["Parsely"]
    V48Assert(state.Windows.Length=2 && state.Current="tyth","Heavy ordinary damage never recreates Magma")
    V48Assert(!state.Limited && state.Facts.Length<256,"Settled opening damage does not exhaust the phase journal")
}

V74GodsParselyCases()
{
    return [
        {Boss:"G-TY",Name:"Tyth",Start:74688406,End:74977847,Expected:[{Name:"Magma",Start:74703406,End:74729279,StartLine:74929},{Name:"Tyth",Start:74729279,End:74940890,StartLine:77163},{Name:"Burn",Start:74940890,End:74977847,StartLine:89492}],Records:[
            {Line:74929,At:74703406,Raw:"[20:45:03.406] [@Recorded Player#1|(811.94,2341.70,228.52,159.98)|(503131/503131)] [TYTH {4078423634870272}:11204000545052|(806.20,2345.08,228.52,-55.44)|(19976854/19989636)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8673 ~8674 energy {836045448940874}) <26020.0>"}
            ,{Line:74944,At:74703867,Raw:"[20:45:03.867] [@Recorded Player#1|(799.50,2349.08,228.52,-77.92)|(443634/443634)] [TYTH {4078423634870272}:11204000545052|(806.20,2345.08,228.52,-125.03)|(19928872/19989636)] [Back Blast {981331307659264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22120 kinetic {836045448940873}) <22120.0>"}
            ,{Line:74951,At:74704067,Raw:"[20:45:04.067] [@Recorded Player#1|(808.23,2340.17,228.52,157.57)|(480157/480157)] [TYTH {4078423634870272}:11204000545052|(806.20,2345.08,228.52,-167.56)|(19923626/19989636)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4108 kinetic {836045448940873}) <12325.0>"}
            ,{Line:76744,At:74724173,Raw:"[20:45:24.173] [TYTH {4078423634870272}:11204000545052|(804.83,2347.42,228.52,102.86)|(17360592/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:77163,At:74729279,Raw:"[20:45:29.279] [TYTH {4078423634870272}:11204000545052|(804.80,2347.43,228.50,-63.61)|(16858598/19989636)] [@Recorded Player#1|(802.06,2359.47,228.52,5.70)|(427324/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77164,At:74729279,Raw:"[20:45:29.279] [TYTH {4078423634870272}:11204000545052|(804.80,2347.43,228.50,-63.61)|(16858598/19989636)] [@Recorded Player#1|(807.74,2334.67,228.52,176.15)|(363318/441600)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77165,At:74729279,Raw:"[20:45:29.279] [@Recorded Player#1|(794.67,2339.02,228.52,-129.69)|(207612/503131)] [=] [Harnessed Darkness {2312741104648192}] [RemoveEffect {836045448945478}: Harnessed Darkness {2312741104648192}]"}
            ,{Line:77166,At:74729279,Raw:"[20:45:29.279] [@Recorded Player#1|(794.67,2339.02,228.52,-129.69)|(207612/503131)] [=] [Depredating Volts {3408949902573568}] [RemoveEffect {836045448945478}: Unshakable {3408949902573878}]"}
            ,{Line:77169,At:74729280,Raw:"[20:45:29.280] [TYTH {4078423634870272}:11204000545052|(804.80,2347.43,228.50,-63.61)|(16858598/19989636)] [@Recorded Player#1|(794.67,2339.02,228.52,-129.69)|(207612/503131)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77170,At:74729280,Raw:"[20:45:29.280] [TYTH {4078423634870272}:11204000545052|(804.80,2347.43,228.50,-63.61)|(16858598/19989636)] [@Recorded Player#1|(797.06,2358.22,228.52,2.56)|(123135/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77171,At:74729280,Raw:"[20:45:29.280] [TYTH {4078423634870272}:11204000545052|(804.80,2347.43,228.50,-63.61)|(16858598/19989636)] [@Recorded Player#1|(791.86,2351.44,228.52,-16.98)|(202222/439833)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77172,At:74729280,Raw:"[20:45:29.280] [TYTH {4078423634870272}:11204000545052|(804.80,2347.43,228.50,-63.61)|(16858598/19989636)] [@Recorded Player#1|(794.83,2356.78,228.52,-34.81)|(437508/438823)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77173,At:74729280,Raw:"[20:45:29.280] [TYTH {4078423634870272}:11204000545052|(804.80,2347.43,228.50,-63.61)|(16858598/19989636)] [@Recorded Player#1|(801.34,2360.71,228.52,-22.01)|(329812/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77174,At:74729280,Raw:"[20:45:29.280] [TYTH {4078423634870272}:11204000545052|(804.80,2347.43,228.50,-63.61)|(16858598/19989636)] [@Recorded Player#1|(821.58,2337.40,228.52,152.06)|(316201/480157)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:77232,At:74729692,Raw:"[20:45:29.692] [TYTH {4078423634870272}:11204000545052|(804.80,2347.43,228.50,-63.61)|(16847392/19989636)] [@Recorded Player#1|(807.34,2349.54,231.77,-129.69)|(0/503131)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77588,At:74737284,Raw:"[20:45:37.284] [TYTH {4078423634870272}:11204000545052|(794.87,2354.49,228.52,146.73)|(16175234/19989636)] [@Recorded Player#1|(802.83,2345.51,228.52,148.14)|(427427/443752)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77589,At:74737284,Raw:"[20:45:37.284] [TYTH {4078423634870272}:11204000545052|(794.87,2354.49,228.52,146.73)|(16175234/19989636)] [@Recorded Player#1|(802.33,2348.29,228.52,59.29)|(316278/441600)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77590,At:74737284,Raw:"[20:45:37.284] [TYTH {4078423634870272}:11204000545052|(794.87,2354.49,228.52,146.73)|(16175234/19989636)] [@Recorded Player#1|(799.91,2346.98,228.52,146.15)|(243180/443782)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77591,At:74737285,Raw:"[20:45:37.285] [TYTH {4078423634870272}:11204000545052|(794.87,2354.49,228.52,146.73)|(16175234/19989636)] [@Recorded Player#1|(805.80,2347.78,228.52,54.19)|(350347/439833)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77592,At:74737285,Raw:"[20:45:37.285] [TYTH {4078423634870272}:11204000545052|(794.87,2354.49,228.52,146.73)|(16175234/19989636)] [@Recorded Player#1|(798.05,2345.92,228.52,143.69)|(323644/438823)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77593,At:74737285,Raw:"[20:45:37.285] [TYTH {4078423634870272}:11204000545052|(794.87,2354.49,228.52,146.73)|(16175234/19989636)] [@Recorded Player#1|(804.68,2346.56,228.52,127.96)|(426042/443634)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:77782,At:74741291,Raw:"[20:45:41.291] [TYTH {4078423634870272}:11204000545052|(793.50,2356.13,228.52,158.06)|(15837446/19989636)] [@Recorded Player#1|(791.82,2360.81,228.52,-43.90)|(261715/480157)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:78948,At:74761818,Raw:"[20:46:01.818] [TYTH {4078423634870272}:11204000545052|(796.27,2358.95,228.52,-147.40)|(15597077/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:79172,At:74766920,Raw:"[20:46:06.920] [TYTH {4078423634870272}:11204000545052|(796.22,2359.05,228.50,-39.89)|(15528487/19989636)] [@Recorded Player#1|(791.01,2368.40,228.52,-29.11)|(409202/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79174,At:74766920,Raw:"[20:46:06.920] [TYTH {4078423634870272}:11204000545052|(796.22,2359.05,228.50,-39.89)|(15528487/19989636)] [@Recorded Player#1|(788.48,2368.87,228.52,-46.09)|(232037/438823)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79175,At:74766920,Raw:"[20:46:06.920] [TYTH {4078423634870272}:11204000545052|(796.22,2359.05,228.50,-39.89)|(15528487/19989636)] [@Recorded Player#1|(798.97,2371.33,228.52,21.06)|(273425/480157)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79176,At:74766920,Raw:"[20:46:06.920] [TYTH {4078423634870272}:11204000545052|(796.22,2359.05,228.50,-39.89)|(15528487/19989636)] [@Recorded Player#1|(787.51,2368.30,228.52,-61.84)|(352369/439833)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79177,At:74766921,Raw:"[20:46:06.921] [TYTH {4078423634870272}:11204000545052|(796.22,2359.05,228.50,-39.89)|(15528487/19989636)] [@Recorded Player#1|(789.98,2370.24,228.52,-19.57)|(440410/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79178,At:74766921,Raw:"[20:46:06.921] [TYTH {4078423634870272}:11204000545052|(796.22,2359.05,228.50,-39.89)|(15528487/19989636)] [@Recorded Player#1|(792.04,2371.38,228.52,58.81)|(443782/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79179,At:74766921,Raw:"[20:46:06.921] [TYTH {4078423634870272}:11204000545052|(796.22,2359.05,228.50,-39.89)|(15528487/19989636)] [@Recorded Player#1|(813.80,2340.93,228.52,-178.47)|(485484/503131)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:79180,At:74766921,Raw:"[20:46:06.921] [TYTH {4078423634870272}:11204000545052|(796.22,2359.05,228.50,-39.89)|(15528487/19989636)] [@Recorded Player#1|(809.54,2333.73,228.52,102.35)|(339878/441600)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:79625,At:74774914,Raw:"[20:46:14.914] [TYTH {4078423634870272}:11204000545052|(809.48,2361.41,228.52,-83.36)|(14916460/19989636)] [@Recorded Player#1|(805.22,2354.36,228.52,-152.40)|(443752/443752)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79626,At:74774914,Raw:"[20:46:14.914] [TYTH {4078423634870272}:11204000545052|(809.48,2361.41,228.52,-83.36)|(14916460/19989636)] [@Recorded Player#1|(802.53,2360.62,228.52,-63.77)|(372254/438823)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79627,At:74774914,Raw:"[20:46:14.914] [TYTH {4078423634870272}:11204000545052|(809.48,2361.41,228.52,-83.36)|(14916460/19989636)] [@Recorded Player#1|(793.38,2347.93,228.52,-51.75)|(441488/480157)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79628,At:74774914,Raw:"[20:46:14.914] [TYTH {4078423634870272}:11204000545052|(809.48,2361.41,228.52,-83.36)|(14916460/19989636)] [@Recorded Player#1|(803.82,2348.60,228.52,-173.05)|(403454/439833)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79629,At:74774914,Raw:"[20:46:14.914] [TYTH {4078423634870272}:11204000545052|(809.48,2361.41,228.52,-83.36)|(14916460/19989636)] [@Recorded Player#1|(798.83,2352.74,228.52,-128.57)|(443634/443634)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79630,At:74774914,Raw:"[20:46:14.914] [TYTH {4078423634870272}:11204000545052|(809.48,2361.41,228.52,-83.36)|(14916460/19989636)] [@Recorded Player#1|(803.03,2358.53,228.52,-128.41)|(443782/443782)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:79884,At:74778917,Raw:"[20:46:18.917] [TYTH {4078423634870272}:11204000545052|(817.19,2359.26,228.52,-128.50)|(14387515/19989636)] [@Recorded Player#1|(821.17,2362.43,228.52,51.23)|(432122/503131)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:79885,At:74778917,Raw:"[20:46:18.917] [TYTH {4078423634870272}:11204000545052|(817.19,2359.26,228.52,-128.50)|(14387515/19989636)] [@Recorded Player#1|(816.41,2355.04,228.52,82.50)|(485802/572768)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:81153,At:74799067,Raw:"[20:46:39.067] [TYTH {4078423634870272}:11204000545052|(821.92,2353.32,228.52,-36.59)|(11919416/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:81382,At:74804083,Raw:"[20:46:44.083] [TYTH {4078423634870272}:11204000545052|(821.26,2353.46,228.50,88.23)|(11408346/19989636)] [@Recorded Player#1|(830.10,2360.24,228.52,61.20)|(387636/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81383,At:74804083,Raw:"[20:46:44.083] [TYTH {4078423634870272}:11204000545052|(821.26,2353.46,228.50,88.23)|(11408346/19989636)] [@Recorded Player#1|(827.83,2363.01,228.52,6.25)|(425097/441600)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81384,At:74804083,Raw:"[20:46:44.083] [TYTH {4078423634870272}:11204000545052|(821.26,2353.46,228.50,88.23)|(11408346/19989636)] [@Recorded Player#1|(832.51,2357.86,228.52,149.09)|(443782/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81386,At:74804083,Raw:"[20:46:44.083] [TYTH {4078423634870272}:11204000545052|(821.26,2353.46,228.50,88.23)|(11408346/19989636)] [@Recorded Player#1|(833.58,2354.86,228.52,83.42)|(398969/503131)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81387,At:74804084,Raw:"[20:46:44.084] [TYTH {4078423634870272}:11204000545052|(821.26,2353.46,228.50,88.23)|(11408346/19989636)] [@Recorded Player#1|(832.08,2359.79,228.52,-16.06)|(443634/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81388,At:74804084,Raw:"[20:46:44.084] [TYTH {4078423634870272}:11204000545052|(821.26,2353.46,228.50,88.23)|(11408346/19989636)] [@Recorded Player#1|(833.26,2357.16,228.52,72.65)|(439833/439833)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81389,At:74804084,Raw:"[20:46:44.084] [TYTH {4078423634870272}:11204000545052|(821.26,2353.46,228.50,88.23)|(11408346/19989636)] [@Recorded Player#1|(833.58,2349.27,228.52,108.86)|(438823/438823)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81390,At:74804084,Raw:"[20:46:44.084] [TYTH {4078423634870272}:11204000545052|(821.26,2353.46,228.50,88.23)|(11408346/19989636)] [@Recorded Player#1|(792.65,2353.27,228.52,-73.56)|(424165/480157)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:81949,At:74812199,Raw:"[20:46:52.199] [TYTH {4078423634870272}:11204000545052|(826.62,2351.50,228.52,-68.34)|(10598070/19989636)] [@Recorded Player#1|(803.90,2335.42,228.52,131.87)|(196892/443752)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81950,At:74812199,Raw:"[20:46:52.199] [TYTH {4078423634870272}:11204000545052|(826.62,2351.50,228.52,-68.34)|(10598070/19989636)] [@Recorded Player#1|(801.29,2335.60,228.52,113.41)|(410490/441600)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81951,At:74812199,Raw:"[20:46:52.199] [TYTH {4078423634870272}:11204000545052|(826.62,2351.50,228.52,-68.34)|(10598070/19989636)] [@Recorded Player#1|(816.31,2352.45,228.52,-50.39)|(422915/443782)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81952,At:74812199,Raw:"[20:46:52.199] [TYTH {4078423634870272}:11204000545052|(826.62,2351.50,228.52,-68.34)|(10598070/19989636)] [@Recorded Player#1|(798.69,2337.14,228.52,-84.97)|(195136/503131)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81953,At:74812199,Raw:"[20:46:52.199] [TYTH {4078423634870272}:11204000545052|(826.62,2351.50,228.52,-68.34)|(10598070/19989636)] [@Recorded Player#1|(805.96,2345.38,228.52,-163.29)|(156264/443634)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81954,At:74812199,Raw:"[20:46:52.199] [TYTH {4078423634870272}:11204000545052|(826.62,2351.50,228.52,-68.34)|(10598070/19989636)] [@Recorded Player#1|(807.86,2345.42,228.52,65.12)|(412516/439833)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:81955,At:74812199,Raw:"[20:46:52.199] [TYTH {4078423634870272}:11204000545052|(826.62,2351.50,228.52,-68.34)|(10598070/19989636)] [@Recorded Player#1|(807.63,2358.79,228.52,171.68)|(410243/438823)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:82289,At:74816101,Raw:"[20:46:56.101] [TYTH {4078423634870272}:11204000545052|(823.28,2351.39,228.52,-90.50)|(10367605/19989636)] [@Recorded Player#1|(828.23,2351.42,228.52,76.52)|(432706/480157)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:83533,At:74837654,Raw:"[20:47:17.654] [TYTH {4078423634870272}:11204000545052|(825.64,2345.47,228.52,-78.74)|(9246250/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:83757,At:74842761,Raw:"[20:47:22.761] [TYTH {4078423634870272}:11204000545052|(825.65,2345.47,228.50,109.94)|(9409846/19989636)] [@Recorded Player#1|(835.18,2350.75,228.52,102.59)|(441600/441600)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:83758,At:74842762,Raw:"[20:47:22.762] [TYTH {4078423634870272}:11204000545052|(825.65,2345.47,228.50,109.94)|(9409846/19989636)] [@Recorded Player#1|(837.19,2342.07,228.52,104.65)|(443782/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:83759,At:74842762,Raw:"[20:47:22.762] [TYTH {4078423634870272}:11204000545052|(825.65,2345.47,228.50,109.94)|(9409846/19989636)] [@Recorded Player#1|(836.91,2349.88,228.52,113.22)|(439833/439833)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:83760,At:74842762,Raw:"[20:47:22.762] [TYTH {4078423634870272}:11204000545052|(825.65,2345.47,228.50,109.94)|(9409846/19989636)] [@Recorded Player#1|(837.14,2349.73,228.52,79.02)|(408548/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:83762,At:74842762,Raw:"[20:47:22.762] [TYTH {4078423634870272}:11204000545052|(825.65,2345.47,228.50,109.94)|(9409846/19989636)] [@Recorded Player#1|(837.60,2348.71,228.52,126.95)|(378733/480157)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:83763,At:74842762,Raw:"[20:47:22.762] [TYTH {4078423634870272}:11204000545052|(825.65,2345.47,228.50,109.94)|(9409846/19989636)] [@Recorded Player#1|(830.22,2357.31,228.52,33.14)|(438823/438823)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:83764,At:74842762,Raw:"[20:47:22.762] [TYTH {4078423634870272}:11204000545052|(825.65,2345.47,228.50,109.94)|(9409846/19989636)] [@Recorded Player#1|(837.33,2339.70,228.52,136.69)|(443634/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:83765,At:74842762,Raw:"[20:47:22.762] [TYTH {4078423634870272}:11204000545052|(825.65,2345.47,228.50,109.94)|(9409846/19989636)] [@Recorded Player#1|(791.80,2353.01,228.52,-90.25)|(476074/503131)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:84277,At:74850873,Raw:"[20:47:30.873] [TYTH {4078423634870272}:11204000545052|(828.84,2343.59,228.52,-66.30)|(9132424/19989636)] [@Recorded Player#1|(794.25,2344.06,228.52,177.73)|(528322/572768)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:84278,At:74850873,Raw:"[20:47:30.873] [TYTH {4078423634870272}:11204000545052|(828.84,2343.59,228.52,-66.30)|(9132424/19989636)] [@Recorded Player#1|(793.22,2348.75,228.52,77.43)|(319418/443782)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:84279,At:74850873,Raw:"[20:47:30.873] [TYTH {4078423634870272}:11204000545052|(828.84,2343.59,228.52,-66.30)|(9132424/19989636)] [@Recorded Player#1|(795.84,2354.60,228.52,37.24)|(315993/439833)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:84280,At:74850873,Raw:"[20:47:30.873] [TYTH {4078423634870272}:11204000545052|(828.84,2343.59,228.52,-66.30)|(9132424/19989636)] [@Recorded Player#1|(792.74,2344.36,228.52,145.22)|(382348/443752)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:84281,At:74850873,Raw:"[20:47:30.873] [TYTH {4078423634870272}:11204000545052|(828.84,2343.59,228.52,-66.30)|(9132424/19989636)] [@Recorded Player#1|(787.55,2343.08,228.52,-140.66)|(261928/480157)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:84282,At:74850873,Raw:"[20:47:30.873] [TYTH {4078423634870272}:11204000545052|(828.84,2343.59,228.52,-66.30)|(9132424/19989636)] [@Recorded Player#1|(812.21,2329.97,228.52,-115.96)|(438823/438823)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:84283,At:74850873,Raw:"[20:47:30.873] [TYTH {4078423634870272}:11204000545052|(828.84,2343.59,228.52,-66.30)|(9132424/19989636)] [@Recorded Player#1|(801.99,2343.01,228.52,-53.33)|(443634/443634)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:84657,At:74854864,Raw:"[20:47:34.864] [TYTH {4078423634870272}:11204000545052|(829.31,2340.63,228.52,-115.96)|(9052561/19989636)] [@Recorded Player#1|(833.71,2343.43,228.52,70.81)|(413672/503131)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:85827,At:74876175,Raw:"[20:47:56.175] [TYTH {4078423634870272}:11204000545052|(809.71,2320.70,228.52,39.81)|(8925045/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:86103,At:74881280,Raw:"[20:48:01.280] [TYTH {4078423634870272}:11204000545052|(809.82,2320.80,228.50,-171.67)|(8652029/19989636)] [@Recorded Player#1|(808.45,2314.63,228.52,-125.01)|(441600/441600)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86104,At:74881280,Raw:"[20:48:01.280] [TYTH {4078423634870272}:11204000545052|(809.82,2320.80,228.50,-171.67)|(8652029/19989636)] [@Recorded Player#1|(808.89,2313.50,228.52,-108.96)|(439833/439833)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86105,At:74881280,Raw:"[20:48:01.280] [TYTH {4078423634870272}:11204000545052|(809.82,2320.80,228.50,-171.67)|(8652029/19989636)] [@Recorded Player#1|(808.57,2313.28,228.52,-169.68)|(422953/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86106,At:74881280,Raw:"[20:48:01.280] [TYTH {4078423634870272}:11204000545052|(809.82,2320.80,228.50,-171.67)|(8652029/19989636)] [@Recorded Player#1|(809.04,2313.17,228.52,-99.45)|(344795/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86107,At:74881280,Raw:"[20:48:01.280] [TYTH {4078423634870272}:11204000545052|(809.82,2320.80,228.50,-171.67)|(8652029/19989636)] [@Recorded Player#1|(806.25,2313.25,228.52,-124.68)|(438823/438823)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86109,At:74881280,Raw:"[20:48:01.280] [TYTH {4078423634870272}:11204000545052|(809.82,2320.80,228.50,-171.67)|(8652029/19989636)] [@Recorded Player#1|(807.36,2312.07,228.52,-151.72)|(282916/503131)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86110,At:74881280,Raw:"[20:48:01.280] [TYTH {4078423634870272}:11204000545052|(809.82,2320.80,228.50,-171.67)|(8652029/19989636)] [@Recorded Player#1|(805.43,2312.78,228.52,-78.61)|(443634/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86111,At:74881280,Raw:"[20:48:01.280] [TYTH {4078423634870272}:11204000545052|(809.82,2320.80,228.50,-171.67)|(8652029/19989636)] [@Recorded Player#1|(815.23,2348.03,228.52,46.26)|(363362/480157)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:86591,At:74889286,Raw:"[20:48:09.286] [TYTH {4078423634870272}:11204000545052|(810.79,2320.98,228.52,-103.71)|(8045645/19989636)] [@Recorded Player#1|(811.44,2352.93,228.52,-131.04)|(381542/441600)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86592,At:74889286,Raw:"[20:48:09.286] [TYTH {4078423634870272}:11204000545052|(810.79,2320.98,228.52,-103.71)|(8045645/19989636)] [@Recorded Player#1|(813.30,2352.36,228.52,-114.85)|(359965/439833)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86593,At:74889287,Raw:"[20:48:09.287] [TYTH {4078423634870272}:11204000545052|(810.79,2320.98,228.52,-103.71)|(8045645/19989636)] [@Recorded Player#1|(809.05,2356.71,228.52,-61.90)|(332808/443752)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86594,At:74889287,Raw:"[20:48:09.287] [TYTH {4078423634870272}:11204000545052|(810.79,2320.98,228.52,-103.71)|(8045645/19989636)] [@Recorded Player#1|(806.78,2323.76,228.52,-104.71)|(443782/443782)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86595,At:74889287,Raw:"[20:48:09.287] [TYTH {4078423634870272}:11204000545052|(810.79,2320.98,228.52,-103.71)|(8045645/19989636)] [@Recorded Player#1|(805.24,2324.98,228.52,-113.13)|(269307/438823)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86596,At:74889287,Raw:"[20:48:09.287] [TYTH {4078423634870272}:11204000545052|(810.79,2320.98,228.52,-103.71)|(8045645/19989636)] [@Recorded Player#1|(821.18,2353.17,228.52,111.47)|(331795/503131)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86597,At:74889287,Raw:"[20:48:09.287] [TYTH {4078423634870272}:11204000545052|(810.79,2320.98,228.52,-103.71)|(8045645/19989636)] [@Recorded Player#1|(813.12,2347.25,228.52,125.43)|(443634/443634)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:86944,At:74893349,Raw:"[20:48:13.349] [TYTH {4078423634870272}:11204000545052|(813.15,2324.91,228.52,-28.83)|(7724580/19989636)] [@Recorded Player#1|(815.25,2321.75,228.52,156.51)|(449944/480157)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:88161,At:74914657,Raw:"[20:48:34.657] [TYTH {4078423634870272}:11204000545052|(825.46,2331.90,228.52,-58.91)|(5757404/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:88354,At:74919764,Raw:"[20:48:39.764] [TYTH {4078423634870272}:11204000545052|(825.72,2331.73,228.50,157.99)|(5750767/19989636)] [@Recorded Player#1|(832.01,2327.56,228.52,123.54)|(443752/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88355,At:74919764,Raw:"[20:48:39.764] [TYTH {4078423634870272}:11204000545052|(825.72,2331.73,228.50,157.99)|(5750767/19989636)] [@Recorded Player#1|(833.45,2326.34,228.52,135.31)|(441600/441600)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88356,At:74919764,Raw:"[20:48:39.764] [TYTH {4078423634870272}:11204000545052|(825.72,2331.73,228.50,157.99)|(5750767/19989636)] [@Recorded Player#1|(832.46,2326.20,228.52,176.13)|(443782/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88357,At:74919764,Raw:"[20:48:39.764] [TYTH {4078423634870272}:11204000545052|(825.72,2331.73,228.50,157.99)|(5750767/19989636)] [@Recorded Player#1|(833.73,2327.04,228.52,146.75)|(438823/438823)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88359,At:74919764,Raw:"[20:48:39.764] [TYTH {4078423634870272}:11204000545052|(825.72,2331.73,228.50,157.99)|(5750767/19989636)] [@Recorded Player#1|(831.63,2324.44,228.52,138.76)|(331240/480157)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88360,At:74919764,Raw:"[20:48:39.764] [TYTH {4078423634870272}:11204000545052|(825.72,2331.73,228.50,157.99)|(5750767/19989636)] [@Recorded Player#1|(835.06,2330.79,228.52,-331.64)|(366978/439833)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88361,At:74919764,Raw:"[20:48:39.764] [TYTH {4078423634870272}:11204000545052|(825.72,2331.73,228.50,157.99)|(5750767/19989636)] [@Recorded Player#1|(833.48,2324.43,228.52,-270.27)|(443634/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88362,At:74919764,Raw:"[20:48:39.764] [TYTH {4078423634870272}:11204000545052|(825.72,2331.73,228.50,157.99)|(5750767/19989636)] [@Recorded Player#1|(813.66,2360.54,228.52,-31.08)|(503131/503131)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:88765,At:74927771,Raw:"[20:48:47.771] [TYTH {4078423634870272}:11204000545052|(819.67,2324.63,228.52,30.46)|(5619491/19989636)] [@Recorded Player#1|(814.16,2335.53,228.52,-61.81)|(420965/443752)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88766,At:74927771,Raw:"[20:48:47.771] [TYTH {4078423634870272}:11204000545052|(819.67,2324.63,228.52,30.46)|(5619491/19989636)] [@Recorded Player#1|(811.83,2336.28,228.52,-72.95)|(419084/441600)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88767,At:74927771,Raw:"[20:48:47.771] [TYTH {4078423634870272}:11204000545052|(819.67,2324.63,228.52,30.46)|(5619491/19989636)] [@Recorded Player#1|(819.35,2336.56,228.52,-30.12)|(266127/443782)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88768,At:74927771,Raw:"[20:48:47.771] [TYTH {4078423634870272}:11204000545052|(819.67,2324.63,228.52,30.46)|(5619491/19989636)] [@Recorded Player#1|(827.88,2348.71,228.52,-3.05)|(438823/438823)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88769,At:74927771,Raw:"[20:48:47.771] [TYTH {4078423634870272}:11204000545052|(819.67,2324.63,228.52,30.46)|(5619491/19989636)] [@Recorded Player#1|(812.05,2337.72,228.52,-4.08)|(480157/480157)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88770,At:74927772,Raw:"[20:48:47.772] [TYTH {4078423634870272}:11204000545052|(819.67,2324.63,228.52,30.46)|(5619491/19989636)] [@Recorded Player#1|(812.35,2341.33,228.52,-19.80)|(435729/439833)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88771,At:74927772,Raw:"[20:48:47.772] [TYTH {4078423634870272}:11204000545052|(819.67,2324.63,228.52,30.46)|(5619491/19989636)] [@Recorded Player#1|(814.33,2342.69,228.52,-14.17)|(438905/443634)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:88996,At:74931776,Raw:"[20:48:51.776] [TYTH {4078423634870272}:11204000545052|(804.06,2321.16,228.52,36.14)|(5576017/19989636)] [@Recorded Player#1|(801.32,2317.30,228.52,-159.33)|(396342/503131)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:89492,At:74940890,Raw:"[20:49:00.890] [TYTH {4078423634870272}:11204000545052|(796.41,2321.17,228.52,68.36)|(4870321/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:89493,At:74940890,Raw:"[20:49:00.890] [@Recorded Player#1|(792.28,2319.31,228.52,-157.23)|(342799/503131)] [=] [Sonic Missile {880189122805760}] [ApplyEffect {836045448945477}: Sonic Rebounder {880189122806402}]"}
            ,{Line:89494,At:74940890,Raw:"[20:49:00.890] [@Recorded Player#1|(802.98,2329.27,228.52,38.91)|(371578/438823)] [=] [Sonic Missile {880189122805760}] [ApplyEffect {836045448945477}: Sonic Rebounder {880189122806402}]"}
            ,{Line:89495,At:74940890,Raw:"[20:49:00.890] [@Recorded Player#1|(802.98,2329.27,228.52,38.91)|(371578/438823)] [TYTH {4078423634870272}:11204000545052|(796.41,2321.17,228.52,68.36)|(4870321/19989636)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5055 elemental {836045448940875}) <5055.0>"}
            ,{Line:89496,At:74940890,Raw:"[20:49:00.890] [@Recorded Player#1|(808.31,2331.66,228.52,45.42)|(377544/443752)] [=] [] [Restore {836045448945476}: energy {836045448938503}] (2.0)"}
            ,{Line:89497,At:74940890,Raw:"[20:49:00.890] [@Recorded Player#1|(808.31,2331.66,228.52,45.42)|(377544/443752)] [=] [Close and Personal {3177532769697792}] [ApplyEffect {836045448945477}: Heal {836045448945500}] (11537) <5768.0>"}
            ,{Line:90237,At:74952300,Raw:"[20:49:12.300] [TYTH {4078423634870272}:11204000545052|(792.90,2323.38,228.52,136.49)|(3319065/19989636)] [=] [Inversion {4071117895499776}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:90514,At:74957398,Raw:"[20:49:17.398] [TYTH {4078423634870272}:11204000545052|(792.84,2323.40,228.50,-130.17)|(2612324/19989636)] [@Recorded Player#1|(789.99,2320.16,228.52,-137.91)|(443752/443752)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:90515,At:74957398,Raw:"[20:49:17.398] [TYTH {4078423634870272}:11204000545052|(792.84,2323.40,228.50,-130.17)|(2612324/19989636)] [@Recorded Player#1|(788.29,2320.77,228.52,-61.81)|(443782/443782)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:90516,At:74957398,Raw:"[20:49:17.398] [TYTH {4078423634870272}:11204000545052|(792.84,2323.40,228.50,-130.17)|(2612324/19989636)] [@Recorded Player#1|(791.55,2316.35,228.52,-78.69)|(439833/439833)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:90517,At:74957398,Raw:"[20:49:17.398] [TYTH {4078423634870272}:11204000545052|(792.84,2323.40,228.50,-130.17)|(2612324/19989636)] [@Recorded Player#1|(786.57,2319.14,228.52,-79.11)|(436948/443634)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:90519,At:74957398,Raw:"[20:49:17.398] [TYTH {4078423634870272}:11204000545052|(792.84,2323.40,228.50,-130.17)|(2612324/19989636)] [@Recorded Player#1|(786.50,2318.45,228.52,-134.90)|(293330/503131)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:90520,At:74957398,Raw:"[20:49:17.398] [TYTH {4078423634870272}:11204000545052|(792.84,2323.40,228.50,-130.17)|(2612324/19989636)] [@Recorded Player#1|(789.81,2315.77,228.52,-176.40)|(438823/438823)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:90521,At:74957398,Raw:"[20:49:17.398] [TYTH {4078423634870272}:11204000545052|(792.84,2323.40,228.50,-130.17)|(2612324/19989636)] [@Recorded Player#1|(792.41,2315.26,228.52,-169.55)|(441600/441600)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:90522,At:74957398,Raw:"[20:49:17.398] [TYTH {4078423634870272}:11204000545052|(792.84,2323.40,228.50,-130.17)|(2612324/19989636)] [@Recorded Player#1|(817.14,2344.49,228.52,119.83)|(460478/480157)] [Inversion {4071117895499776}] [ApplyEffect {836045448945477}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:90670,At:74959934,Raw:"[20:49:19.934] [TYTH {4078423634870272}:11204000545052|(792.69,2323.57,228.52,73.67)|(2434903/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:90997,At:74965416,Raw:"[20:49:25.416] [TYTH {4078423634870272}:11204000545052|(793.49,2324.00,228.52,71.64)|(1746998/19989636)] [@Recorded Player#1|(795.49,2328.33,228.52,52.92)|(189922/443752)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:90998,At:74965417,Raw:"[20:49:25.417] [TYTH {4078423634870272}:11204000545052|(793.49,2324.00,228.52,71.64)|(1746998/19989636)] [@Recorded Player#1|(797.04,2327.59,228.52,91.15)|(92306/443782)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:90999,At:74965417,Raw:"[20:49:25.417] [TYTH {4078423634870272}:11204000545052|(793.49,2324.00,228.52,71.64)|(1746998/19989636)] [@Recorded Player#1|(797.72,2336.34,228.52,-10.52)|(114394/439833)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:91000,At:74965417,Raw:"[20:49:25.417] [TYTH {4078423634870272}:11204000545052|(793.49,2324.00,228.52,71.64)|(1746998/19989636)] [@Recorded Player#1|(799.93,2329.61,228.52,60.45)|(105547/443634)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:91001,At:74965417,Raw:"[20:49:25.417] [TYTH {4078423634870272}:11204000545052|(793.49,2324.00,228.52,71.64)|(1746998/19989636)] [@Recorded Player#1|(822.53,2334.90,228.52,67.00)|(138069/503131)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:91002,At:74965417,Raw:"[20:49:25.417] [TYTH {4078423634870272}:11204000545052|(793.49,2324.00,228.52,71.64)|(1746998/19989636)] [@Recorded Player#1|(796.26,2330.13,228.52,29.31)|(154397/438823)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:91003,At:74965417,Raw:"[20:49:25.417] [TYTH {4078423634870272}:11204000545052|(793.49,2324.00,228.52,71.64)|(1746998/19989636)] [@Recorded Player#1|(796.13,2329.16,228.52,36.62)|(101890/441600)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Short Wave) {4071117895500098}]"}
            ,{Line:91287,At:74969424,Raw:"[20:49:29.424] [TYTH {4078423634870272}:11204000545052|(794.10,2324.67,228.52,42.05)|(1275899/19989636)] [@Recorded Player#1|(790.75,2320.96,228.52,-138.05)|(243913/480157)] [Inversion {4071117895499776}] [RemoveEffect {836045448945478}: Inversion Resonance (Long Wave) {4071117895500102}]"}
            ,{Line:91534,At:74972818,Raw:"[20:49:32.818] [TYTH {4078423634870272}:11204000545052|(794.05,2324.56,228.52,16.34)|(720333/19989636)] [=] [Intensify Rage {4076018453184512}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:91856,At:74977577,Raw:"[20:49:37.577] [@Recorded Player#1|(804.47,2323.51,228.52,95.90)|(308279/443782)] [TYTH {4078423634870272}:11204000545052|(794.05,2324.56,228.50,23.41)|(0/19989636)] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11349* ~5145 internal {836045448940876}) <11349.0>"}
            ,{Line:91859,At:74977577,Raw:"[20:49:37.577] [@Recorded Player#1|(804.47,2323.51,228.52,95.90)|(308279/443782)] [TYTH {4078423634870272}:11204000545052|(794.05,2324.56,228.50,23.41)|(0/19989636)] [Dual Saber Throw {3066602354376704}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (37368* energy {836045448940874}) <37368.0>"}
            ,{Line:91892,At:74977847,Raw:"[20:49:37.847] [@Recorded Player#1|(804.18,2323.69,228.52,32.74)|(310923/443782)] [TYTH {4078423634870272}:11204000545052|(794.05,2324.56,228.50,23.41)|(0/19989636)] [Annihilate {808123866546176}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2105* energy {836045448940874}) <2105.0>"}
        ]}
        ,{Boss:"G-AE",Name:"Aivela and Esne",Start:75258593,End:75694218,Expected:[{Name:"Codex",Start:75273593,End:75358837,StartLine:105759},{Name:"Aivela and Esne",Start:75358837,End:75476294,StartLine:109993},{Name:"Synergy Protocol",Start:75476294,End:75546032,StartLine:117758},{Name:"Aivela and Esne 2",Start:75546032,End:75694218,StartLine:123153}],Records:[
            {Line:105759,At:75273593,Raw:"[20:54:33.593] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(671903/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:105767,At:75273680,Raw:"[20:54:33.680] [@Recorded Player#1|(479.48,2774.59,317.49,96.17)|(441600/441600)] [Codex {4105254295568384}:11204000674202|(475.07,2775.07,317.52,240.00)|(639343/680777)] [Saber Reflect {3126177845739520}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (32315 kinetic {836045448940873}(reflected {836045448953649}))"}
            ,{Line:105770,At:75273681,Raw:"[20:54:33.681] [Codex {4105254295568384}:11204000674202|(475.07,2775.07,317.52,240.00)|(639343/680777)] [@Recorded Player#1|(479.48,2774.59,317.49,96.17)|(441600/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:105775,At:75273805,Raw:"[20:54:33.805] [@Recorded Player#1|(477.30,2774.83,317.52,96.17)|(441600/441600)] [Codex {4105254295568384}:11204000674202|(475.07,2775.07,317.52,240.00)|(631271/680777)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9118 energy {836045448940874}) <9118.0>"}
            ,{Line:105783,At:75274011,Raw:"[20:54:34.011] [@Recorded Player#1|(486.10,2816.49,317.61,175.57)|(480157/480157)] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(673962/680777)] [Heavy Flamethrower {4502852303060992}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6815* elemental {836045448940875}) <20444.0>"}
            ,{Line:105785,At:75274084,Raw:"[20:54:34.084] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(648461/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,96.17)|(441600/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:105787,At:75274084,Raw:"[20:54:34.084] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(636828/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,96.17)|(441600/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:105789,At:75274085,Raw:"[20:54:34.085] [Codex {4105254295568384}:11204000674032|(496.50,2775.25,317.61,120.00)|(675712/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,96.17)|(441600/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -deflect {836045448945508}) <1.0>"}
            ,{Line:105800,At:75274382,Raw:"[20:54:34.382] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(648461/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,96.17)|(441600/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:105802,At:75274383,Raw:"[20:54:34.383] [Codex {4105254295568384}:11204000674542|(504.00,2790.50,317.61,90.00)|(605877/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,96.17)|(441600/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:105810,At:75274584,Raw:"[20:54:34.584] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(648461/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,139.69)|(441600/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:105815,At:75274789,Raw:"[20:54:34.789] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(634776/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,139.75)|(441600/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:105841,At:75275191,Raw:"[20:54:35.191] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(630957/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:105843,At:75275193,Raw:"[20:54:35.193] [Codex {4105254295568384}:11204000674032|(496.50,2775.25,317.61,120.00)|(675712/680777)] [@Recorded Player#1|(496.16,2774.22,317.61,170.04)|(413650/438823)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31351 energy {836045448940874}) <31351.0>"}
            ,{Line:105845,At:75275284,Raw:"[20:54:35.284] [Codex {4105254295568384}:11204000674202|(475.07,2775.07,317.52,240.00)|(562894/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,139.75)|(441600/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:105850,At:75275384,Raw:"[20:54:35.384] [Codex {4105254295568384}:11204000674542|(504.00,2790.50,317.61,90.00)|(605877/680777)] [@Recorded Player#1|(499.72,2791.08,317.41,-127.03)|(414534/443634)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35277 energy {836045448940874}) <35277.0>"}
            ,{Line:105853,At:75275385,Raw:"[20:54:35.385] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(634776/680777)] [@Recorded Player#1|(486.10,2816.49,317.61,175.57)|(461751/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24585 energy {836045448940874}) <24585.0>"}
            ,{Line:105866,At:75275583,Raw:"[20:54:35.583] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(622356/680777)] [@Recorded Player#1|(477.45,2804.19,317.52,145.51)|(421581/443752)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (34674 energy {836045448940874}) <34674.0>"}
            ,{Line:105871,At:75275687,Raw:"[20:54:35.687] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(648461/680777)] [@Recorded Player#1|(477.50,2775.50,317.52,-72.79)|(443782/443782)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -deflect {836045448945508}) <1.0>"}
            ,{Line:105889,At:75275987,Raw:"[20:54:35.987] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(648461/680777)] [@Recorded Player#1|(479.20,2775.09,317.41,-78.08)|(420094/443782)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (36190 energy {836045448940874}) <36190.0>"}
            ,{Line:105898,At:75276093,Raw:"[20:54:36.093] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(648461/680777)] [@Recorded Player#1|(481.10,2774.65,317.41,-78.08)|(420094/443782)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -miss {836045448945502}) <1.0>"}
            ,{Line:105929,At:75276698,Raw:"[20:54:36.698] [Codex {4105254295568384}:11204000674032|(496.50,2775.25,317.61,120.00)|(625995/680777)] [@Recorded Player#1|(496.40,2773.90,317.61,168.85)|(388365/438823)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (28610 energy {836045448940874}) <28610.0>"}
            ,{Line:105931,At:75276700,Raw:"[20:54:36.700] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(642533/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:105942,At:75276793,Raw:"[20:54:36.793] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(608112/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:105944,At:75276794,Raw:"[20:54:36.794] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(642533/680777)] [@Recorded Player#1|(477.45,2804.19,317.52,126.06)|(390268/443752)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (34674 energy {836045448940874}) <34674.0>"}
            ,{Line:105946,At:75276900,Raw:"[20:54:36.900] [Codex {4105254295568384}:11204000674542|(504.00,2790.50,317.61,90.00)|(598826/680777)] [@Recorded Player#1|(499.72,2791.08,317.41,-82.27)|(414534/443634)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>"}
            ,{Line:105948,At:75276900,Raw:"[20:54:36.900] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(604760/680777)] [@Recorded Player#1|(486.10,2816.49,317.61,175.57)|(437166/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24585 energy {836045448940874}) <24585.0>"}
            ,{Line:105960,At:75276903,Raw:"[20:54:36.903] [Codex {4105254295568384}:11204000674202|(475.07,2775.07,317.52,240.00)|(497871/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,96.16)|(441600/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:105967,At:75277296,Raw:"[20:54:37.296] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(597434/680777)] [@Recorded Player#1|(477.45,2804.19,317.52,118.13)|(355594/443752)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (34674 energy {836045448940874}) <34674.0>"}
            ,{Line:105985,At:75277493,Raw:"[20:54:37.493] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(632304/680777)] [@Recorded Player#1|(472.11,2790.63,317.61,87.98)|(439833/439833)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:105988,At:75277594,Raw:"[20:54:37.594] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(617785/680777)] [@Recorded Player#1|(472.11,2790.63,317.61,87.98)|(439833/439833)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:106010,At:75278196,Raw:"[20:54:38.196] [Codex {4105254295568384}:11204000674032|(496.50,2775.25,317.61,120.00)|(577304/680777)] [@Recorded Player#1|(494.17,2775.02,317.61,170.03)|(375275/438823)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (26309 energy {836045448940874}) <26309.0>"}
            ,{Line:106013,At:75278299,Raw:"[20:54:38.299] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(631408/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106027,At:75278398,Raw:"[20:54:38.398] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(570558/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106029,At:75278399,Raw:"[20:54:38.399] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(631408/680777)] [@Recorded Player#1|(477.45,2804.19,317.52,118.14)|(355594/443752)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>"}
            ,{Line:106031,At:75278399,Raw:"[20:54:38.399] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(617785/680777)] [@Recorded Player#1|(486.34,2763.11,317.61,6.25)|(507704/507704)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -deflect {836045448945508}) <1.0>"}
            ,{Line:106041,At:75278499,Raw:"[20:54:38.499] [Codex {4105254295568384}:11204000674542|(504.00,2790.50,317.61,90.00)|(522358/680777)] [@Recorded Player#1|(499.72,2791.08,317.41,-82.27)|(397655/443634)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35277 energy {836045448940874}) <35277.0>"}
            ,{Line:106042,At:75278499,Raw:"[20:54:38.499] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(572419/680777)] [@Recorded Player#1|(486.10,2816.49,317.61,178.74)|(437166/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -miss {836045448945502}) <1.0>"}
            ,{Line:106043,At:75278499,Raw:"[20:54:38.499] [Codex {4105254295568384}:11204000674202|(475.07,2775.07,317.52,240.00)|(435110/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,96.16)|(412629/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (32315 energy {836045448940874}) <32315.0>"}
            ,{Line:106044,At:75278499,Raw:"[20:54:38.499] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(570558/680777)] [@Recorded Player#1|(472.11,2790.63,317.61,87.98)|(439833/439833)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -miss {836045448945502}) <1.0>"}
            ,{Line:106062,At:75278698,Raw:"[20:54:38.698] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(620911/680777)] [@Recorded Player#1|(499.71,2790.98,317.54,-82.27)|(397655/443634)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>"}
            ,{Line:106115,At:75279799,Raw:"[20:54:39.799] [Codex {4105254295568384}:11204000674032|(496.50,2775.25,317.61,120.00)|(509333/680777)] [@Recorded Player#1|(494.51,2774.89,317.61,-148.30)|(357573/438823)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24351 energy {836045448940874}) <24351.0>"}
            ,{Line:106119,At:75279898,Raw:"[20:54:39.898] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(588145/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106125,At:75280007,Raw:"[20:54:40.007] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(509331/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106127,At:75280008,Raw:"[20:54:40.008] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(588145/680777)] [@Recorded Player#1|(477.45,2804.19,317.52,126.06)|(344186/443752)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31351 energy {836045448940874}) <31351.0>"}
            ,{Line:106131,At:75280009,Raw:"[20:54:40.009] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(600116/680777)] [@Recorded Player#1|(486.34,2763.11,317.61,-168.82)|(507704/507704)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6419 energy {836045448940874} -shield {836045448945509} (34092 absorbed {836045448945511})) <6419.0>"}
            ,{Line:106132,At:75280009,Raw:"[20:54:40.009] [Codex {4105254295568384}:11204000674542|(504.00,2790.50,317.61,90.00)|(494017/680777)] [@Recorded Player#1|(501.01,2789.54,317.61,-107.77)|(362378/443634)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35277 energy {836045448940874}) <35277.0>"}
            ,{Line:106139,At:75280103,Raw:"[20:54:40.103] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(547074/680777)] [@Recorded Player#1|(486.10,2816.49,317.61,178.74)|(437166/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>"}
            ,{Line:106141,At:75280103,Raw:"[20:54:40.103] [Codex {4105254295568384}:11204000674202|(475.07,2775.07,317.52,240.00)|(374531/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,109.01)|(400224/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (32315 energy {836045448940874}) <32315.0>"}
            ,{Line:106146,At:75280104,Raw:"[20:54:40.104] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(493173/680777)] [@Recorded Player#1|(472.11,2790.63,317.61,70.18)|(439833/439833)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:106171,At:75280392,Raw:"[20:54:40.392] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(604510/680777)] [@Recorded Player#1|(501.01,2789.54,317.61,-122.90)|(327100/443634)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35277 energy {836045448940874}) <35277.0>"}
            ,{Line:106228,At:75281397,Raw:"[20:54:41.397] [Codex {4105254295568384}:11204000674032|(496.50,2775.25,317.61,120.00)|(422542/680777)] [@Recorded Player#1|(493.66,2775.34,317.58,-88.09)|(364221/438823)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -miss {836045448945502}) <1.0>"}
            ,{Line:106236,At:75281498,Raw:"[20:54:41.498] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(541794/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106240,At:75281500,Raw:"[20:54:41.500] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(589197/680777)] [@Recorded Player#1|(486.34,2763.11,317.61,-170.21)|(501533/507704)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6171 energy {836045448940874} -shield {836045448945509} (34553 absorbed {836045448945511})) <6171.0>"}
            ,{Line:106247,At:75281599,Raw:"[20:54:41.599] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(451516/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106249,At:75281600,Raw:"[20:54:41.600] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(537793/680777)] [@Recorded Player#1|(492.83,2805.24,317.41,-125.71)|(423844/443782)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33832 energy {836045448940874}) <33832.0>"}
            ,{Line:106262,At:75281602,Raw:"[20:54:41.602] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(541794/680777)] [@Recorded Player#1|(477.45,2804.19,317.52,126.06)|(325660/443752)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (28610 energy {836045448940874}) <28610.0>"}
            ,{Line:106264,At:75281602,Raw:"[20:54:41.602] [Codex {4105254295568384}:11204000674542|(504.00,2790.50,317.61,90.00)|(464670/680777)] [@Recorded Player#1|(501.01,2789.54,317.61,-107.78)|(310344/443634)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35277 energy {836045448940874}) <35277.0>"}
            ,{Line:106268,At:75281698,Raw:"[20:54:41.698] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(482017/680777)] [@Recorded Player#1|(486.43,2816.52,317.58,174.47)|(437166/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>"}
            ,{Line:106270,At:75281698,Raw:"[20:54:41.698] [Codex {4105254295568384}:11204000674202|(475.07,2775.07,317.52,240.00)|(302763/680777)] [@Recorded Player#1|(477.30,2774.83,317.52,96.16)|(374599/441600)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (32315 energy {836045448940874}) <32315.0>"}
            ,{Line:106274,At:75281698,Raw:"[20:54:41.698] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(435358/680777)] [@Recorded Player#1|(472.11,2790.63,317.61,87.98)|(439833/439833)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <32315.0>"}
            ,{Line:106357,At:75282899,Raw:"[20:54:42.899] [Codex {4105254295568384}:11204000674032|(496.50,2775.25,317.61,120.00)|(306527/680777)] [@Recorded Player#1|(492.92,2777.29,317.61,-110.77)|(356039/438823)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22664 energy {836045448940874}) <22664.0>"}
            ,{Line:106367,At:75283101,Raw:"[20:54:43.101] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(489041/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106371,At:75283104,Raw:"[20:54:43.104] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(579724/680777)] [@Recorded Player#1|(486.34,2763.11,317.61,6.25)|(501019/507704)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6419 energy {836045448940874} -shield {836045448945509} (34092 absorbed {836045448945511})) <6419.0>"}
            ,{Line:106374,At:75283104,Raw:"[20:54:43.104] [Codex {4105254295568384}:11204000674542|(504.00,2790.50,317.61,90.00)|(453305/680777)] [@Recorded Player#1|(501.01,2789.54,317.61,-107.77)|(275066/443634)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35277 energy {836045448940874}) <35277.0>"}
            ,{Line:106376,At:75283104,Raw:"[20:54:43.104] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(394493/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106381,At:75283204,Raw:"[20:54:43.204] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(537793/680777)] [@Recorded Player#1|(496.03,2806.92,317.52,-43.55)|(425593/443782)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -deflect {836045448945508}) <1.0>"}
            ,{Line:106383,At:75283204,Raw:"[20:54:43.204] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(489041/680777)] [@Recorded Player#1|(477.45,2804.19,317.52,117.54)|(305257/443752)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (26309 energy {836045448940874}) <26309.0>"}
            ,{Line:106386,At:75283298,Raw:"[20:54:43.298] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(394493/680777)] [@Recorded Player#1|(472.11,2790.63,317.61,87.98)|(439833/439833)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>"}
            ,{Line:106388,At:75283299,Raw:"[20:54:43.299] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(461477/680777)] [@Recorded Player#1|(486.43,2816.52,317.58,174.47)|(424787/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23536 energy {836045448940874}) <23536.0>"}
            ,{Line:106445,At:75284601,Raw:"[20:54:44.601] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(566761/680777)] [@Recorded Player#1|(486.34,2763.11,317.61,6.25)|(494848/507704)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6171 energy {836045448940874} -shield {836045448945509} (34553 absorbed {836045448945511})) <6171.0>"}
            ,{Line:106450,At:75284697,Raw:"[20:54:44.697] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(420922/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106451,At:75284698,Raw:"[20:54:44.698] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(389438/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106453,At:75284698,Raw:"[20:54:44.698] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(460214/680777)] [@Recorded Player#1|(494.66,2806.08,317.52,-31.29)|(400572/443782)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33832 energy {836045448940874}) <33832.0>"}
            ,{Line:106455,At:75284699,Raw:"[20:54:44.699] [Codex {4105254295568384}:11204000674542|(504.00,2790.50,317.61,90.00)|(395274/680777)] [@Recorded Player#1|(501.01,2789.54,317.61,-114.62)|(261309/443634)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35277 energy {836045448940874}) <35277.0>"}
            ,{Line:106461,At:75284807,Raw:"[20:54:44.807] [Codex {4105254295568384}:11204000674032|(496.50,2775.25,317.61,120.00)|(284180/680777)] [@Recorded Player#1|(501.81,2789.11,317.61,-132.37)|(333375/438823)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22664 energy {836045448940874}) <22664.0>"}
            ,{Line:106462,At:75284807,Raw:"[20:54:44.807] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(420922/680777)] [@Recorded Player#1|(477.45,2804.19,317.52,126.06)|(280906/443752)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24351 energy {836045448940874}) <24351.0>"}
            ,{Line:106465,At:75284807,Raw:"[20:54:44.807] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(377977/680777)] [@Recorded Player#1|(472.11,2790.63,317.61,87.98)|(413423/439833)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (32315 energy {836045448940874}) <32315.0>"}
            ,{Line:106466,At:75284900,Raw:"[20:54:44.900] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(442972/680777)] [@Recorded Player#1|(486.43,2816.52,317.58,174.47)|(424787/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>"}
            ,{Line:106540,At:75286198,Raw:"[20:54:46.198] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(551448/680777)] [@Recorded Player#1|(486.34,2763.11,317.61,6.25)|(494848/507704)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -deflect {836045448945508}) <1.0>"}
            ,{Line:106541,At:75286199,Raw:"[20:54:46.199] [Codex {4105254295568384}:11204000674542|(504.00,2790.50,317.61,90.00)|(328908/680777)] [@Recorded Player#1|(501.01,2789.54,317.61,-107.77)|(226032/443634)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (35277 energy {836045448940874}) <35277.0>"}
            ,{Line:106543,At:75286303,Raw:"[20:54:46.303] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(372239/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106544,At:75286304,Raw:"[20:54:46.304] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(329689/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106546,At:75286304,Raw:"[20:54:46.304] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(428700/680777)] [@Recorded Player#1|(494.66,2806.08,317.52,-70.51)|(369086/443782)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33832 energy {836045448940874}) <33832.0>"}
            ,{Line:106552,At:75286406,Raw:"[20:54:46.406] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(422679/680777)] [@Recorded Player#1|(486.43,2816.52,317.58,174.47)|(422628/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8076 energy {836045448940874} -shield {836045448945509} (29931 absorbed {836045448945511})) <8076.0>"}
            ,{Line:106553,At:75286406,Raw:"[20:54:46.406] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(344972/680777)] [@Recorded Player#1|(477.45,2804.19,317.52,3.44)|(280906/443752)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -miss {836045448945502}) <1.0>"}
            ,{Line:106561,At:75286502,Raw:"[20:54:46.502] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(329689/680777)] [@Recorded Player#1|(473.84,2790.77,317.41,-12.73)|(382051/439833)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31372 energy {836045448940874}) <31372.0>"}
            ,{Line:106614,At:75287793,Raw:"[20:54:47.793] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(491407/680777)] [@Recorded Player#1|(486.34,2763.11,317.61,6.25)|(494848/507704)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -deflect {836045448945508}) <1.0>"}
            ,{Line:106618,At:75287909,Raw:"[20:54:47.909] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(301905/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106620,At:75287910,Raw:"[20:54:47.910] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(314680/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106625,At:75287911,Raw:"[20:54:47.911] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(385673/680777)] [@Recorded Player#1|(494.18,2806.03,317.52,-26.76)|(349267/443782)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33832 energy {836045448940874}) <33832.0>"}
            ,{Line:106631,At:75287999,Raw:"[20:54:47.999] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(409995/680777)] [@Recorded Player#1|(486.43,2816.52,317.58,170.01)|(422628/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>"}
            ,{Line:106639,At:75288000,Raw:"[20:54:48.000] [Codex {4105254295568384}:11204000675052|(475.75,2805.43,317.51,300.00)|(301905/680777)] [@Recorded Player#1|(477.45,2804.19,317.52,61.82)|(269452/443752)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22664 energy {836045448940874}) <22664.0>"}
            ,{Line:106641,At:75288095,Raw:"[20:54:48.095] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(314680/680777)] [@Recorded Player#1|(473.84,2790.77,317.41,-6.86)|(382051/439833)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -miss {836045448945502}) <1.0>"}
            ,{Line:106691,At:75289305,Raw:"[20:54:49.305] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(448318/680777)] [@Recorded Player#1|(486.34,2763.11,317.61,6.25)|(494848/507704)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -deflect {836045448945508}) <1.0>"}
            ,{Line:106704,At:75289496,Raw:"[20:54:49.496] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(309555/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106705,At:75289497,Raw:"[20:54:49.497] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(358767/680777)] [@Recorded Player#1|(491.62,2803.13,317.41,-5.81)|(368076/443782)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33058 energy {836045448940874}) <33058.0>"}
            ,{Line:106713,At:75289600,Raw:"[20:54:49.600] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(397801/680777)] [@Recorded Player#1|(487.00,2816.57,317.41,174.47)|(422628/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>"}
            ,{Line:106716,At:75289701,Raw:"[20:54:49.701] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(309555/680777)] [@Recorded Player#1|(474.10,2791.46,317.41,66.59)|(356618/439833)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31372 energy {836045448940874}) <31372.0>"}
            ,{Line:106778,At:75290896,Raw:"[20:54:50.896] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(385714/680777)] [@Recorded Player#1|(486.34,2763.11,317.61,-142.86)|(476065/507704)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24727 energy {836045448940874}) <24727.0>"}
            ,{Line:106782,At:75291001,Raw:"[20:54:51.001] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(293928/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106785,At:75291101,Raw:"[20:54:51.101] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(378347/680777)] [@Recorded Player#1|(486.41,2817.09,317.61,174.07)|(405957/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22615 energy {836045448940874}) <22615.0>"}
            ,{Line:106788,At:75291203,Raw:"[20:54:51.203] [Codex {4105254295568384}:11204000675222|(468.50,2790.50,317.61,270.00)|(286771/680777)] [@Recorded Player#1|(474.29,2790.37,317.41,32.69)|(325246/439833)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31372 energy {836045448940874}) <31372.0>"}
            ,{Line:106791,At:75291297,Raw:"[20:54:51.297] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(293529/680777)] [@Recorded Player#1|(486.86,2794.92,317.41,-10.35)|(341838/443782)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33058 energy {836045448940874}) <33058.0>"}
            ,{Line:106854,At:75292397,Raw:"[20:54:52.397] [Codex {4105254295568384}:11204000674372|(486.00,2760.00,317.61,180.00)|(327968/680777)] [@Recorded Player#1|(486.34,2763.11,317.61,2.90)|(462722/507704)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13342 energy {836045448940874} -shield {836045448945509} (21200 absorbed {836045448945511})) <13342.0>"}
            ,{Line:106864,At:75292693,Raw:"[20:54:52.693] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(354175/680777)] [@Recorded Player#1|(486.41,2817.09,317.61,174.07)|(383342/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22615 energy {836045448940874}) <22615.0>"}
            ,{Line:106873,At:75292905,Raw:"[20:54:52.905] [Codex {4105254295568384}:11204000674712|(496.50,2805.43,317.52,60.00)|(272311/680777)] [@Recorded Player#1|(487.27,2793.04,317.41,-81.32)|(308780/443782)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33058 energy {836045448940874}) <33058.0>"}
            ,{Line:106927,At:75294098,Raw:"[20:54:54.098] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(295870/680777)] [=] [Pulse Fire {4105726741970944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:106932,At:75294203,Raw:"[20:54:54.203] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(287445/680777)] [@Recorded Player#1|(486.41,2817.09,317.61,169.02)|(367184/480157)] [Pulse Fire {4105726741970944}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22615 energy {836045448940874}) <22615.0>"}
            ,{Line:109499,At:75344745,Raw:"[20:55:44.745] [@Recorded Player#1|(486.66,2816.18,317.41,-119.40)|(369397/443752)] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(280930/680777)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15320 elemental {836045448940875}) <15320.0>"}
            ,{Line:109502,At:75344927,Raw:"[20:55:44.927] [@Recorded Player#1|(485.74,2816.43,317.60,-2.14)|(409619/507704)] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(273823/680777)] [Discharge {4056527891595264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7107 internal {836045448940876}) <31982.0>"}
            ,{Line:109510,At:75345027,Raw:"[20:55:45.027] [@Recorded Player#1|(487.43,2818.23,317.53,152.62)|(480157/480157)] [Codex {4105254295568384}:11204000674882|(486.00,2821.00,317.61,360.00)|(272311/680777)] [Rail Shot {814278554681344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15724 ~1512 energy {836045448940874}) <47172.0>"}
            ,{Line:109993,At:75358837,Raw:"[20:55:58.837] [@Recorded Player#1|(487.56,2801.48,317.41,40.55)|(443634/443634)] [AIVELA {4088525397950464}:11204000784668|(486.00,2803.00,317.41,-0.33)|(18722830/18734600)] [Bushwhack {3996475658862592}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6709 ~6708 internal {836045448940876}) <5031.0>"}
            ,{Line:110016,At:75359043,Raw:"[20:55:59.043] [@Recorded Player#1|(486.18,2801.62,317.41,-125.80)|(370855/443782)] [AIVELA {4088525397950464}:11204000784668|(486.00,2803.00,317.41,-32.35)|(18705360/18734600)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5529* ~5528 internal {836045448940876}) <5529.0>"}
            ,{Line:110017,At:75359128,Raw:"[20:55:59.128] [@Recorded Player#1|(487.41,2781.26,317.41,40.07)|(434835/438823)] [ESNE {4088538282852352}:11204000784541|(486.00,2778.00,317.41,93.89)|(18704382/18734600)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9501* ~9502 elemental {836045448940875}) <9501.0>"}
            ,{Line:117758,At:75476294,Raw:"[20:57:56.294] [AIVELA {4088525397950464}:11204000784668|(486.00,2803.00,317.41,-177.07)|(13488913/18734600)] [=] [ {4112143423111168}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:117761,At:75476391,Raw:"[20:57:56.391] [ESNE {4088538282852352}:11204000784541|(486.00,2778.00,317.41,-13.06)|(13488913/18734600)] [=] [ {4112143423111168}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:123153,At:75546032,Raw:"[20:59:06.032] [AIVELA {4088525397950464}:11204000784668|(486.00,2803.00,317.41,-85.93)|(7969026/18734600)] [=] [ {4112147718078464}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:123154,At:75546032,Raw:"[20:59:06.032] [@Recorded Player#1|(487.16,2806.06,317.41,-7.83)|(262725/443782)] [=] [Annihilate {808123866546176}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:123165,At:75546229,Raw:"[20:59:06.229] [ESNE {4088538282852352}:11204000784541|(486.00,2778.00,317.41,85.13)|(7999674/18734600)] [=] [ {4112147718078464}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:134413,At:75693887,Raw:"[21:01:33.887] [@Recorded Player#1|(487.15,2779.54,317.41,-54.04)|(327759/439833)] [AIVELA {4088525397950464}:11204000784668|(487.70,2776.15,317.41,0.55)|(8818/18734600)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2552* energy {836045448940874}) <2552.0>"}
            ,{Line:134454,At:75694152,Raw:"[21:01:34.152] [@Recorded Player#1|(486.21,2779.79,317.41,-58.46)|(294229/438823)] [AIVELA {4088525397950464}:11204000784668|(487.70,2776.12,317.41,0.32)|(0/18734600)] [Burning (Primed Rail Shot) {4502517295612162}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16007* ~8818 elemental {836045448940875}) <16007.0>"}
            ,{Line:134474,At:75694218,Raw:"[21:01:34.218] [@Recorded Player#1|(488.07,2778.22,317.41,9.48)|(443782/443782)] [AIVELA {4088525397950464}:11204000784668|(487.70,2776.11,317.41,0.32)|(0/18734600)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14289 energy {836045448940874}) <14289.0>"}
        ]}
        ,{Boss:"G-NA",Name:"Nahut",Start:76404276,End:76825636,Expected:[{Name:"Nahut",Start:76419276,End:76533952,StartLine:164725},{Name:"Couplings",Start:76533952,End:76611663,StartLine:172201},{Name:"Turrets",Start:76611663,End:76725318,StartLine:176517},{Name:"Burn",Start:76725318,End:76825636,StartLine:182347}],Records:[
            {Line:164725,At:76419276,Raw:"[21:13:39.276] [@Recorded Player#1|(-414.33,2605.42,206.41,-2.23)|(439833/439833)] [NAHUT {4122949560827904}:11204001207117|(-414.75,2600.50,206.41,-150.88)|(36493828/36514284)] [Electro Net {3066456325488640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4994* ~4992 energy {836045448940874}) <4994.0>"}
            ,{Line:164749,At:76420101,Raw:"[21:13:40.101] [@Recorded Player#1|(-411.99,2604.66,206.41,42.21)|(438823/438823)] [NAHUT {4122949560827904}:11204001207117|(-414.75,2600.50,206.41,-146.60)|(36488556/36514284)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8770* ~8772 elemental {836045448940875}) <8770.0>"}
            ,{Line:164750,At:76420121,Raw:"[21:13:40.121] [@Recorded Player#1|(-409.53,2600.22,206.41,94.41)|(443782/443782)] [NAHUT {4122949560827904}:11204001207117|(-414.75,2600.50,206.41,-146.60)|(36488556/36514284)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6692 energy {836045448940874}) <6692.0>"}
            ,{Line:172201,At:76533952,Raw:"[21:15:33.952] [NAHUT {4122949560827904}:11204001207117|(-415.66,2604.00,206.41,-180.00)|(23164286/36514284)] [=] [ {4131999056920576}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:176517,At:76611663,Raw:"[21:16:51.663] [NAHUT {4122949560827904}:11204001207117|(-428.82,2644.01,207.91,167.60)|(22164766/36514284)] [=] [ {4134120770764800}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:176518,At:76611663,Raw:"[21:16:51.663] [@Recorded Player#1|(-434.50,2622.43,206.41,83.67)|(338565/439833)] [=] [Power Surge {4625731317399552}] [RemoveEffect {836045448945478}: Power Surge {4625731317399552}]"}
            ,{Line:178585,At:76652480,Raw:"[21:17:32.480] [NAHUT {4122949560827904}:11204001207117|(-403.93,2630.63,206.41,46.61)|(18665520/36514284)] [=] [ {4134120770764800}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:180775,At:76693794,Raw:"[21:18:13.794] [NAHUT {4122949560827904}:11204001207117|(-368.31,2615.99,207.91,-58.00)|(15555565/36514284)] [=] [ {4134120770764800}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:182347,At:76725318,Raw:"[21:18:45.318] [NAHUT {4122949560827904}:11204001207117|(-364.71,2591.32,207.91,96.20)|(13856334/36514284)] [=] [ {4133047028940800}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:188092,At:76824849,Raw:"[21:20:24.849] [@Recorded Player#1|(-448.88,2635.75,207.91,53.69)|(361580/439833)] [NAHUT {4122949560827904}:11204001207117|(-451.85,2633.20,207.91,-164.86)|(17045/36514284)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (77 energy {836045448940874}) <77.0>"}
            ,{Line:188140,At:76824965,Raw:"[21:20:24.965] [@Recorded Player#1|(-451.27,2629.67,207.91,126.48)|(480157/480157)] [NAHUT {4122949560827904}:11204001207117|(-451.85,2633.20,207.91,-165.16)|(0/36514284)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12831* elemental {836045448940875}) <35286.0>"}
            ,{Line:188158,At:76825636,Raw:"[21:20:25.636] [@Recorded Player#1|(-455.35,2628.33,207.91,117.20)|(442215/572768)] [NAHUT {4122949560827904}:11204001207117|(-451.85,2633.20,207.91,-165.16)|(0/36514284)] [Impale {2210507998101504}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31550 ~17044 energy {836045448940874}) <31550.0>"}
        ]}
        ,{Boss:"G-SC",Name:"Scyva",Start:77845799,End:78285125,Expected:[{Name:"Omega Protocol Droid",Start:77860799,End:77927557,StartLine:225224},{Name:"Catalysts",Start:77927557,End:78082792,StartLine:230417},{Name:"Scyva",Start:78082792,End:78148631,StartLine:238208},{Name:"Ignite Core",Start:78148631,End:78158738,StartLine:242015},{Name:"Scyva 2",Start:78158738,End:78234071,StartLine:242780},{Name:"Extinction",Start:78234071,End:78285125,StartLine:247450}],Records:[
            {Line:225224,At:77860799,Raw:"[21:37:40.799] [@Recorded Player#1|(-485.03,2165.28,187.09,-179.49)|(480157/480157)] [Omega Protocol Droid {4126527268585472}:11204001659749|(-485.00,2169.00,186.97,0.00)|(12507825/12531116)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4188 kinetic {836045448940873}) <12564.0>"}
            ,{Line:225244,At:77861170,Raw:"[21:37:41.170] [@Recorded Player#1|(-486.58,2165.82,187.06,-153.77)|(443782/443782)] [Omega Protocol Droid {4126527268585472}:11204001659749|(-484.91,2166.38,186.97,-2.03)|(12489769/12531116)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11348* energy {836045448940874}) <11348.0>"}
            ,{Line:225245,At:77861182,Raw:"[21:37:41.182] [@Recorded Player#1|(-485.00,2165.69,187.10,180.00)|(441600/441600)] [Omega Protocol Droid {4126527268585472}:11204001659749|(-484.90,2166.24,186.97,-2.03)|(12489769/12531116)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7755 energy {836045448940874}) <5816.0>"}
            ,{Line:230416,At:77927557,Raw:"[21:38:47.557] [@Recorded Player#1|(-483.35,2163.17,187.18,-4.90)|(404362/438823)] [Omega Protocol Droid {4126527268585472}:11204001659749|(-485.00,2160.02,186.97,7.28)|(0/18188932)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9983* ~8224 elemental {836045448940875}) <9983.0>"}
            ,{Line:230417,At:77927557,Raw:"[21:38:47.557] [@Recorded Player#1|(-483.35,2163.17,187.18,-4.90)|(404362/438823)] [Omega Protocol Droid {4126527268585472}:11204001659749|(-485.00,2160.02,186.97,7.28)|(0/18188932)] [] [Event {836045448945472}: Death {836045448945493}]"}
            ,{Line:230418,At:77927557,Raw:"[21:38:47.557] [@Recorded Player#1|(-483.35,2163.17,187.18,-4.90)|(404362/438823)] [Omega Protocol Droid {4126527268585472}:11204001659749|(-485.00,2160.02,186.97,7.28)|(0/18188932)] [Flaming Fist {3384704812187648}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8990 elemental {836045448940875}) <8990.0>"}
            ,{Line:230422,At:77927599,Raw:"[21:38:47.599] [@Recorded Player#1|(-481.15,2158.87,186.97,-37.49)|(480157/480157)] [Omega Protocol Droid {4126527268585472}:11204001659749|(-485.00,2160.02,186.97,7.28)|(0/18188932)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12478* elemental {836045448940875}) <37434.0>"}
            ,{Line:238208,At:78082792,Raw:"[21:41:22.792] [@Recorded Player#1|(-479.93,2164.91,187.06,84.88)|(438823/438823)] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,0.00)|(26324112/26373952)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2502 elemental {836045448940875}) <2502.0>"}
            ,{Line:238209,At:78082792,Raw:"[21:41:22.792] [@Recorded Player#1|(-479.93,2164.91,187.06,84.88)|(438823/438823)] [=] [Heatstroke {4499532293341184}] [ApplyEffect {836045448945477}: Heatstroke {4499532293341445}] (1 charges {836045448953667})"}
            ,{Line:238210,At:78082792,Raw:"[21:41:22.792] [@Recorded Player#1|(-479.93,2164.91,187.06,84.88)|(438823/438823)] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,0.00)|(26324112/26373952)] [Flaming Fist {3384704812187648}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10087* ~10086 elemental {836045448940875}) <10087.0>"}
            ,{Line:238214,At:78082900,Raw:"[21:41:22.900] [@Recorded Player#1|(-479.93,2164.91,187.06,84.88)|(438823/438823)] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,0.00)|(26300866/26373952)] [Flaming Fist {3384704812187648}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (27344* kinetic {836045448940873}) <27344.0>"}
            ,{Line:242015,At:78148631,Raw:"[21:42:28.631] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,-143.43)|(17146378/26373952)] [=] [Stabilizing Field {4127300362698752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:242016,At:78148631,Raw:"[21:42:28.631] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,-143.43)|(17146378/26373952)] [=] [Stabilizing Field {4127300362698752}] [ApplyEffect {836045448945477}: Stabilizing Field {4127300362698752}]"}
            ,{Line:242017,At:78148631,Raw:"[21:42:28.631] [@Recorded Player#1|(-488.19,2179.98,186.97,-90.88)|(439833/439833)] [=] [Supercharged Celerity {3409808896032768}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:242018,At:78148631,Raw:"[21:42:28.631] [@Recorded Player#1|(-488.19,2179.98,186.97,-90.88)|(439833/439833)] [=] [Supercharge {3401326335623168}] [RemoveEffect {836045448945478}: Supercharge {3401326335623168}]"}
            ,{Line:242221,At:78150628,Raw:"[21:42:30.628] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,-140.82)|(17146378/26373952)] [=] [Ignite Core {4131981877051392}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:242222,At:78150628,Raw:"[21:42:30.628] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,-140.82)|(17146378/26373952)] [=] [Ignite Core {4131981877051392}] [ApplyEffect {836045448945477}: Ignite Core {4131981877051728}]"}
            ,{Line:242711,At:78158124,Raw:"[21:42:38.124] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,-89.13)|(17085576/26373952)] [=] [Stabilizing Field {4127300362698752}] [RemoveEffect {836045448945478}: Stabilizing Field {4127300362698752}]"}
            ,{Line:242779,At:78158738,Raw:"[21:42:38.738] [@Recorded Player#1|(-480.75,2164.93,187.18,58.27)|(315723/507704)] [=] [Jolt {875060931854336}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:242780,At:78158738,Raw:"[21:42:38.738] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,-89.13)|(16887286/26373952)] [=] [Ignite Core {4131981877051392}] [RemoveEffect {836045448945478}: Ignite Core {4131981877051728}]"}
            ,{Line:242781,At:78158738,Raw:"[21:42:38.738] [@Recorded Player#1|(-480.75,2164.93,187.18,58.27)|(315723/507704)] [] [Ignite Core {4131981877051392}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]"}
            ,{Line:247450,At:78234071,Raw:"[21:43:54.071] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,128.62)|(7597902/26373952)] [=] [Initialize Extinction Protocols {4146653485334528}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:250459,At:78284083,Raw:"[21:44:44.083] [@Recorded Player#1|(-470.06,2171.29,186.99,36.17)|(235586/438823)] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,-69.53)|(0/18188932)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1036 energy {836045448940874}) <1036.0>"}
            ,{Line:250460,At:78284083,Raw:"[21:44:44.083] [@Recorded Player#1|(-470.06,2171.29,186.99,36.17)|(235586/438823)] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,-69.53)|(0/18188932)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1077 energy {836045448940874}) <1077.0>"}
            ,{Line:250497,At:78285125,Raw:"[21:44:45.125] [@Recorded Player#1|(-484.75,2178.52,186.97,-103.05)|(147473/443752)] [SCYVA {4108140513591296}:11204001659862|(-485.00,2165.00,186.97,-69.53)|(0/18188932)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18344 elemental {836045448940875}) <18344.0>"}
        ]}
        ,{Boss:"G-IZ",Name:"Izax",Start:78595898,End:79402937,Expected:[{Name:"Swipes",Start:78610898,End:78664326,StartLine:266098},{Name:"Anchors",Start:78664326,End:78792078,StartLine:269229},{Name:"Interrupts",Start:78792078,End:79026369,StartLine:276108},{Name:"Augment Droid",Start:79026369,End:79150392,StartLine:286559},{Name:"Missiles",Start:79150392,End:79209321,StartLine:295554},{Name:"Scyva",Start:79209321,End:79357451,StartLine:298409},{Name:"Burn",Start:79357451,End:79402937,StartLine:306892}],Records:[
            {Line:266093,At:78610898,Raw:"[21:50:10.898] [@Recorded Player#1|(91.51,2269.83,790.95,-64.32)|(480157/480157)] [=] [Rocket Punch {814300029517824}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:266094,At:78610898,Raw:"[21:50:10.898] [@Recorded Player#1|(91.51,2269.83,790.95,-64.32)|(480157/480157)] [=] [Shield Enhancers {3379460657119232}] [ApplyEffect {836045448945477}: Shield Enhancers {3379460657119232}] (1 charges {836045448953667})"}
            ,{Line:266095,At:78610898,Raw:"[21:50:10.898] [@Recorded Player#1|(91.51,2269.83,790.95,-64.32)|(480157/480157)] [=] [Flame Engine {3182025305489408}] [ApplyEffect {836045448945477}: Flame Engine {3182025305489408}]"}
            ,{Line:266096,At:78610898,Raw:"[21:50:10.898] [@Recorded Player#1|(91.51,2269.83,790.95,-64.32)|(480157/480157)] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(254695568/254712048)] [Ion Gas Cylinder {3960050041225216}] [ApplyEffect {836045448945477}: Shocked {3960050041225514}]"}
            ,{Line:266097,At:78610898,Raw:"[21:50:10.898] [@Recorded Player#1|(91.51,2269.83,790.95,-64.32)|(480157/480157)] [=] [Heat Screen {2841833830875136}] [ApplyEffect {836045448945477}: Heat Screen {2841833830875136}] (1 charges {836045448953667})"}
            ,{Line:266098,At:78610898,Raw:"[21:50:10.898] [@Recorded Player#1|(91.51,2269.83,790.95,-64.32)|(480157/480157)] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(254695568/254712048)] [Shocked {3960050041225514}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (232 ~240 energy {836045448940874}) <2790.0>"}
            ,{Line:266099,At:78610898,Raw:"[21:50:10.898] [@Recorded Player#1|(91.51,2269.83,790.95,-64.32)|(480157/480157)] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(254695568/254712048)] [Ion Gas Cylinder {3960050041225216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1033 ~1040 energy {836045448940874}) <3100.0>"}
            ,{Line:266101,At:78610900,Raw:"[21:50:10.900] [@Recorded Player#1|(91.51,2269.83,790.95,-64.32)|(480157/480157)] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(254695568/254712048)] [Ion Gas Cylinder {3960050041225216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1033 ~1040 energy {836045448940874}) <3100.0>"}
            ,{Line:269229,At:78664326,Raw:"[21:51:04.326] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(246022048/254712048)] [=] [Deflector Pulse {4161075985514496}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:269268,At:78665410,Raw:"[21:51:05.410] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(245843648/254712048)] [=] [Deflector Pulse {4161075985514496}] [ApplyEffect {836045448945477}: Deflector Pulse {4161075985514496}]"}
            ,{Line:269299,At:78666315,Raw:"[21:51:06.315] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(245779328/254712048)] [=] [Deflector Pulse {4161075985514496}] [RemoveEffect {836045448945478}: Deflector Pulse {4161075985514496}]"}
            ,{Line:269866,At:78684433,Raw:"[21:51:24.433] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(245238208/254712048)] [=] [Deflector Pulse {4161075985514496}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:269950,At:78685526,Raw:"[21:51:25.526] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(245231072/254712048)] [=] [Deflector Pulse {4161075985514496}] [ApplyEffect {836045448945477}: Deflector Pulse {4161075985514496}]"}
            ,{Line:270046,At:78686428,Raw:"[21:51:26.428] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(245227552/254712048)] [=] [Deflector Pulse {4161075985514496}] [RemoveEffect {836045448945478}: Deflector Pulse {4161075985514496}]"}
            ,{Line:272919,At:78733944,Raw:"[21:52:13.944] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(222289616/254712048)] [=] [Deflector Pulse {4161075985514496}] [ApplyEffect {836045448945477}: Deflector Pulse {4161075985514496}]"}
            ,{Line:272941,At:78734838,Raw:"[21:52:14.838] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(222289616/254712048)] [=] [Deflector Pulse {4161075985514496}] [RemoveEffect {836045448945478}: Deflector Pulse {4161075985514496}]"}
            ,{Line:273530,At:78752052,Raw:"[21:52:32.052] [IZAX {4108097563918336}:11204001960413|(23.25,2261.25,792.97,-90.00)|(222169424/254712048)] [=] [Deflector Pulse {4161075985514496}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:273597,At:78753145,Raw:"[21:52:33.145] [IZAX {4108097563918336}:11204001960413|(23.25,2261.25,792.97,-90.00)|(222165344/254712048)] [=] [Deflector Pulse {4161075985514496}] [ApplyEffect {836045448945477}: Deflector Pulse {4161075985514496}]"}
            ,{Line:273667,At:78754052,Raw:"[21:52:34.052] [IZAX {4108097563918336}:11204001960413|(23.25,2261.25,792.97,-90.00)|(222161664/254712048)] [=] [Deflector Pulse {4161075985514496}] [RemoveEffect {836045448945478}: Deflector Pulse {4161075985514496}]"}
            ,{Line:276107,At:78792078,Raw:"[21:53:12.078] [IZAX {4108097563918336}:11204001960413|(23.25,2261.25,792.97,-90.00)|(202539184/254712048)] [=] [Feedback Overload {4161715935641600}] [RemoveEffect {836045448945478}: Feedback Overload {4161715935641600}]"}
            ,{Line:276108,At:78792078,Raw:"[21:53:12.078] [IZAX {4108097563918336}:11204001960413|(23.25,2261.25,792.97,-90.00)|(202539184/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]"}
            ,{Line:276109,At:78792078,Raw:"[21:53:12.078] [IZAX {4108097563918336}:11204001960413|(23.25,2261.25,792.97,-90.00)|(202539184/254712048)] [=] [ {4163120389947392}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:277283,At:78819374,Raw:"[21:53:39.374] [IZAX {4108097563918336}:11204001960413|(62.25,2222.25,792.97,180.00)|(202506256/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]"}
            ,{Line:279545,At:78870489,Raw:"[21:54:30.489] [IZAX {4108097563918336}:11204001960413|(23.25,2261.25,792.97,-90.00)|(189060864/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]"}
            ,{Line:281969,At:78931819,Raw:"[21:55:31.819] [IZAX {4108097563918336}:11204001960413|(23.25,2261.25,792.97,-90.00)|(174981056/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]"}
            ,{Line:282444,At:78943921,Raw:"[21:55:43.921] [IZAX {4108097563918336}:11204001960413|(23.25,2261.25,792.97,-90.00)|(173488880/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]"}
            ,{Line:284560,At:78991045,Raw:"[21:56:31.045] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(160257536/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]"}
            ,{Line:285239,At:79003157,Raw:"[21:56:43.157] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(154786224/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [ApplyEffect {836045448945477}: Damaged Deflector Shield {4162922821451776}]"}
            ,{Line:286009,At:79016355,Raw:"[21:56:56.355] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(154765328/254712048)] [=] [Damaged Deflector Shield {4162922821451776}] [RemoveEffect {836045448945478}: Damaged Deflector Shield {4162922821451776}]"}
            ,{Line:286551,At:79026369,Raw:"[21:57:06.369] [@Recorded Player#1|(71.57,2280.04,790.82,166.57)|(443604/443604)] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(152791376/254712048)] [Corrosive Grenade {1703989619982336}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6783* ~6784 internal {836045448940876}) <6783.0>"}
            ,{Line:286552,At:79026369,Raw:"[21:57:06.369] [@Recorded Player#1|(72.35,2290.82,790.95,166.09)|(494868/572768)] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(152791376/254712048)] [Bleeding (Eviscerate) {3426078232150278}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2324 ~2320 internal {836045448940876}) <1743.0>"}
            ,{Line:286553,At:79026369,Raw:"[21:57:06.369] [@Recorded Player#1|(72.35,2290.82,790.95,166.09)|(494868/572768)] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(152791376/254712048)] [Eviscerate {3426078232150016}] [RemoveEffect {836045448945478}: Bleeding (Eviscerate) {3426078232150278}]"}
            ,{Line:286554,At:79026369,Raw:"[21:57:06.369] [@Recorded Player#1|(72.35,2290.82,790.95,166.09)|(494868/572768)] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(152791376/254712048)] [Bleeding (Draining Scream) {807857578574081}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3629* ~3632 internal {836045448940876}) <2721.0>"}
            ,{Line:286555,At:79026369,Raw:"[21:57:06.369] [@Recorded Player#1|(72.35,2290.82,790.95,166.09)|(494868/572768)] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(152791376/254712048)] [Draining Scream {807857578573824}] [RemoveEffect {836045448945478}: Bleeding (Draining Scream) {807857578574081}]"}
            ,{Line:286556,At:79026369,Raw:"[21:57:06.369] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(152791376/254712048)] [=] [Discharge Overload {4163068850339840}] [RemoveEffect {836045448945478}: Accumulated Overload {4163068850340171}]"}
            ,{Line:286557,At:79026369,Raw:"[21:57:06.369] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(152791376/254712048)] [=] [Unshaken {4169996632588288}] [ApplyEffect {836045448945477}: Unshaken {4169996632588552}]"}
            ,{Line:286558,At:79026369,Raw:"[21:57:06.369] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(152791376/254712048)] [=] [Unshaken {4169996632588288}] [RemoveEffect {836045448945478}: Shaken {4169996632588556}]"}
            ,{Line:286559,At:79026369,Raw:"[21:57:06.369] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(152791376/254712048)] [=] [Missile Launcher Damage {4173226447994880}] [ApplyEffect {836045448945477}: Missile Launcher Damage {4173226447994880}]"}
            ,{Line:286560,At:79026369,Raw:"[21:57:06.369] [@Recorded Player#1|(72.35,2290.82,790.95,166.09)|(494868/572768)] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(152791376/254712048)] [Bleeding (Shatter) {1169953386397954}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10330 ~6288 internal {836045448940876}) <7747.0>"}
            ,{Line:286561,At:79026369,Raw:"[21:57:06.369] [@Recorded Player#1|(64.06,2289.44,790.82,118.95)|(443782/443782)] [=] [Vicious Slash {807827513802752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:286562,At:79026369,Raw:"[21:57:06.369] [@Recorded Player#1|(64.06,2289.44,790.82,118.95)|(443782/443782)] [=] [Bleeding (Rupture) {3455541707800846}] [ApplyEffect {836045448945477}: Heal {836045448945500}] (962 ~0)"}
            ,{Line:295551,At:79150392,Raw:"[21:59:10.392] [@Recorded Player#1|(63.89,2286.10,790.82,97.34)|(443604/443604)] [Hull Cutter Drone {4166255716073472}:11204002193012|(64.26,2285.08,790.82,129.85)|(432110/456023)] [Corrosive Grenade {1703989619982336}] [ApplyEffect {836045448945477}: Slowed (Tech) {1703989619982615}]"}
            ,{Line:295552,At:79150392,Raw:"[21:59:10.392] [@Recorded Player#1|(63.89,2286.10,790.82,97.34)|(443604/443604)] [Hull Cutter Drone {4166255716073472}:11204002193012|(64.26,2285.08,790.82,129.85)|(432110/456023)] [Corrosive Grenade {1703989619982336}] [ApplyEffect {836045448945477}: Assailable (Mental) {1703989619982839}]"}
            ,{Line:295553,At:79150392,Raw:"[21:59:10.392] [@Recorded Player#1|(63.89,2286.10,790.82,97.34)|(443604/443604)] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(86547032/254712048)] [Weakening Blast {3440827149844480}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (21954* ~21952 energy {836045448940874}) <21954.0>"}
            ,{Line:295554,At:79150392,Raw:"[21:59:10.392] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(86547032/254712048)] [=] [ {4163854829355008}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:298409,At:79209321,Raw:"[22:00:09.321] [Repurposed GEMINI Droid {4163751750139904}:11204002217809|(67.10,2261.47,790.82,-90.00)|(9094466/9094466)] [IZAX {4108097563918336}:11204001960413|(62.25,2300.25,792.97,0.00)|(84739688/254712048)] [ {4163764635041792}] [ApplyEffect {836045448945477}: Signal Jamming {4163764635042092}]"}
            ,{Line:302627,At:79275246,Raw:"[22:01:15.246] [Repurposed GEMINI Droid {4163751750139904}:11204002217809|(64.71,2275.41,790.82,8.81)|(7384655/9094466)] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(84726864/254712048)] [ {4163764635041792}] [ApplyEffect {836045448945477}: Signal Jamming {4163764635042092}]"}
            ,{Line:306192,At:79328305,Raw:"[22:02:08.305] [Repurposed GEMINI Droid {4163751750139904}:11204002217809|(58.32,2272.20,790.82,-19.31)|(2081442/18188932)] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(84607568/254712048)] [ {4163764635041792}] [RemoveEffect {836045448945478}: Signal Jamming {4163764635042092}]"}
            ,{Line:306892,At:79357451,Raw:"[22:02:37.451] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(5268300/254712048)] [=] [Emergency Override: Fire Omnicannon {4168751092072448}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:306893,At:79357451,Raw:"[22:02:37.451] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(5268300/254712048)] [=] [Emergency Override: Fire Omnicannon {4168751092072448}] [ApplyEffect {836045448945477}: Emergency Override: Fire Omnicannon {4168751092072448}]"}
            ,{Line:306894,At:79357451,Raw:"[22:02:37.451] [@Recorded Player#1|(97.18,2260.86,791.49,-7.63)|(439833/439833)] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(5268300/254712048)] [Electro Net {3066456325488640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5255* energy {836045448940874}) <5255.0>"}
            ,{Line:307819,At:79380567,Raw:"[22:03:00.567] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(2102659/254712048)] [@Recorded Player#1|(97.90,2261.09,791.58,-88.46)|(480157/480157)] [Emergency Override: Fire Omnicannon {4168751092072448}] [ApplyEffect {836045448945477}: Extreme Radiation {4168751092072717}]"}
            ,{Line:307820,At:79380567,Raw:"[22:03:00.567] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(2102659/254712048)] [@Recorded Player#1|(98.15,2262.10,791.42,-70.50)|(443634/443634)] [Emergency Override: Fire Omnicannon {4168751092072448}] [ApplyEffect {836045448945477}: Extreme Radiation {4168751092072717}]"}
            ,{Line:307821,At:79380567,Raw:"[22:03:00.567] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(2102659/254712048)] [@Recorded Player#1|(97.11,2261.56,791.59,-82.23)|(443752/443752)] [Emergency Override: Fire Omnicannon {4168751092072448}] [ApplyEffect {836045448945477}: Extreme Radiation {4168751092072717}]"}
            ,{Line:307822,At:79380567,Raw:"[22:03:00.567] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(2102659/254712048)] [@Recorded Player#1|(95.72,2260.43,791.49,-95.85)|(439833/439833)] [Emergency Override: Fire Omnicannon {4168751092072448}] [ApplyEffect {836045448945477}: Extreme Radiation {4168751092072717}]"}
            ,{Line:307823,At:79380567,Raw:"[22:03:00.567] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(2102659/254712048)] [@Recorded Player#1|(96.86,2265.28,791.21,-45.73)|(441523/441600)] [Emergency Override: Fire Omnicannon {4168751092072448}] [ApplyEffect {836045448945477}: Extreme Radiation {4168751092072717}]"}
            ,{Line:307824,At:79380567,Raw:"[22:03:00.567] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(2102659/254712048)] [@Recorded Player#1|(99.22,2267.36,791.24,-17.71)|(443782/443782)] [Emergency Override: Fire Omnicannon {4168751092072448}] [ApplyEffect {836045448945477}: Extreme Radiation {4168751092072717}]"}
            ,{Line:308678,At:79395085,Raw:"[22:03:15.085] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(1/254712048)] [=] [Emergency Override: Fire Omnicannon {4168751092072448}] [RemoveEffect {836045448945478}: Emergency Override: Fire Omnicannon {4168751092072448}]"}
            ,{Line:308727,At:79396037,Raw:"[22:03:16.037] [@Recorded Player#1|(96.99,2262.29,791.37,-46.91)|(210873/439833)] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(1/254712048)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1693 energy {836045448940874}) <1693.0>"}
            ,{Line:308728,At:79396038,Raw:"[22:03:16.038] [@Recorded Player#1|(96.99,2262.29,791.37,-46.91)|(210873/439833)] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(1/254712048)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (174* energy {836045448940874}) <174.0>"}
            ,{Line:308797,At:79396941,Raw:"[22:03:16.941] [@Recorded Player#1|(97.11,2261.56,791.59,-82.35)|(308224/443752)] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(1/254712048)] [Searing Wave {3915721683763200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (53634* ~6818 elemental {836045448940875}) <53634.0>"}
            ,{Line:309015,At:79400783,Raw:"[22:03:20.783] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(1/254712048)] [@Recorded Player#1|(97.90,2261.09,791.58,-88.46)|(480157/480157)] [Emergency Override: Fire Omnicannon {4168751092072448}] [RemoveEffect {836045448945478}: Extreme Radiation {4168751092072717}]"}
            ,{Line:309016,At:79400783,Raw:"[22:03:20.783] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(1/254712048)] [@Recorded Player#1|(98.15,2262.10,791.42,-1.48)|(266008/443634)] [Emergency Override: Fire Omnicannon {4168751092072448}] [RemoveEffect {836045448945478}: Extreme Radiation {4168751092072717}]"}
            ,{Line:309017,At:79400784,Raw:"[22:03:20.784] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(1/254712048)] [@Recorded Player#1|(97.11,2261.56,791.59,-82.35)|(382565/443752)] [Emergency Override: Fire Omnicannon {4168751092072448}] [RemoveEffect {836045448945478}: Extreme Radiation {4168751092072717}]"}
            ,{Line:309018,At:79400784,Raw:"[22:03:20.784] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(1/254712048)] [@Recorded Player#1|(97.05,2263.04,791.21,-73.96)|(294921/439833)] [Emergency Override: Fire Omnicannon {4168751092072448}] [RemoveEffect {836045448945478}: Extreme Radiation {4168751092072717}]"}
            ,{Line:309019,At:79400784,Raw:"[22:03:20.784] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(1/254712048)] [@Recorded Player#1|(96.86,2265.28,791.21,-45.72)|(488993/572768)] [Emergency Override: Fire Omnicannon {4168751092072448}] [RemoveEffect {836045448945478}: Extreme Radiation {4168751092072717}]"}
            ,{Line:309020,At:79400784,Raw:"[22:03:20.784] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(1/254712048)] [@Recorded Player#1|(99.22,2267.36,791.24,-17.71)|(443782/443782)] [Emergency Override: Fire Omnicannon {4168751092072448}] [RemoveEffect {836045448945478}: Extreme Radiation {4168751092072717}]"}
            ,{Line:309049,At:79401738,Raw:"[22:03:21.738] [IZAX {4108097563918336}:11204001960413|(101.25,2261.00,792.97,90.00)|(1/254712048)] [] [Emergency Override: Fire Omnicannon {4168751092072448}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]"}
        ]}
        ,{Boss:"G-SC",Name:"Scyva repeated Ignite",Start:77520468,End:77715000,Expected:[{Name:"Scyva",Start:77520468,End:77585866},{Name:"Ignite Core",Start:77585866,End:77597873},{Name:"Scyva 2",Start:77597873,End:77702612},{Name:"Ignite Core 2",Start:77702612,End:77714921},{Name:"Scyva 3",Start:77714921,End:77715000}],Records:[
            {Line:213457,At:77520468,Raw:"[21:32:00.468] [@Recorded Player#1|(-481.43,2164.59,187.18,91.71)|(312062/441600)] [SCYVA {4108140513591296}:11204001395410|(-485.00,2165.00,198.58,0.00)|(26352730/26373952)] [Shatter {1169953386397696}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (21221* ~21222 internal {836045448940876}) <21221.0>"}
            ,{Line:216537,At:77585866,Raw:"[21:33:05.866] [SCYVA {4108140513591296}:11204001395410|(-485.00,2165.00,186.97,-123.24)|(19505186/26373952)] [=] [Stabilizing Field {4127300362698752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:217325,At:77597873,Raw:"[21:33:17.873] [SCYVA {4108140513591296}:11204001395410|(-485.00,2165.00,186.97,-71.47)|(19465430/26373952)] [=] [Ignite Core {4131981877051392}] [RemoveEffect {836045448945478}: Ignite Core {4131981877051728}]"}
            ,{Line:222665,At:77702612,Raw:"[21:35:02.612] [SCYVA {4108140513591296}:11204001395410|(-485.00,2165.00,186.97,-125.98)|(8827763/26373952)] [=] [Stabilizing Field {4127300362698752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:223448,At:77714921,Raw:"[21:35:14.921] [SCYVA {4108140513591296}:11204001395410|(-485.00,2165.00,186.97,14.35)|(8827763/26373952)] [=] [Ignite Core {4131981877051392}] [RemoveEffect {836045448945478}: Ignite Core {4131981877051728}]"}
        ]}
    ]
}

; Literal Master opening plus explicitly normalized public-site boundary tests.
; The full local-recording range comparisons are a separate research harness.
V74LegacyParselyProfiles()
{
    count := 0
    for boss,profiles in IGPYLegacyProfiles() {
        for p in profiles {
            count += 1,seg := {BossKey:boss,AreaId:p.Area,ModeId:p.Mode}
            V48Assert(IsObject(IGPYProfile(seg)),"Legacy exact phase scope resolves: " p.Key)
            seg.ModeId := "836045448953651"
            V48Assert(!IsObject(IGPYProfile(seg)),"Legacy Story mode does not inherit another difficulty's phases")
            seg.ModeId := p.Mode,seg.AreaId := "wrong"
            V48Assert(!IsObject(IGPYProfile(seg)),"Legacy actor identity outside its raid cannot supply phase scope")
        }
    }
    V48Assert(count=15,"Fifteen independently scoped legacy Parsely profiles are present")
}

V74LegacyMasterStyrakSegment()
{
    return {Start:0,Last:86400000,BossKey:"SNV-ST",AreaId:"137438993037",ModeId:"836045448953655",PhaseProgress:Map()}
}

V74LegacyMasterStyrakOpening()
{
    ; Literal rows199577 and208542 from Archive-combat_2026-08-16_12_16_56_134008.txt.
    ; Same attempt; the earlier dragon at row193262 belongs to a different wipe.
    rows := [
        "[14:11:42.867] [@Illuminated#689514348678912|(-1004.29,392.13,-35.45,177.78)|(435891/493768)] [Kell Dragon {3067057620910080}:32161001452964|(-1007.00,438.35,-25.98,-2.05)|(16854642/16878712)] [Discharge {4056527891595264}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24071* ~24070 internal {836045448940876}) <108317.0>",
        "[14:14:11.623] [Dread Master Styrak {3152407211016192}:32161001452827|(-1015.13,437.21,-25.98,0.00)|(29706534/29706534)] [@Yälicienta#689984208628929|(-1003.11,372.71,-35.10,176.21)|(488804/498558)] [Mass Force Storm {3218004246528000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9755 energy {836045448940874} -shield {836045448945509} (15332 absorbed {836045448945511})) <9755.0>"
    ]
    seg := V74LegacyMasterStyrakSegment()
    for i,raw in rows {
        ev := IPParseLine(raw),ev.RecordId := i=1 ? 199577 : 208542
        IGPYObserve(seg,ev,ev.RawMs)
    }
    state := seg.PhaseProgress["Parsely"]
    V48Assert(state.Windows.Length=2 && state.Windows[1].Name="Dragon" && state.Windows[2].Name="Styrak","Literal Master opening yields the site phase names")
    V48Assert(state.Windows[1].Start=51102867 && state.Windows[1].End=51251623,"Literal Master opening preserves exact event clocks")
    V48Assert(state.Current="styrak" && !state.Counts.Has("burn"),"Early Master wipe does not invent Burn")
}

V74LegacyMasterStyrakSiteTransitions()
{
    ; Public 8M report1243418/38, NPC3152407211016192:25287003790268.
    ; Parent browser verified the /dragon final row00:53:26.481 and /styrak-6
    ; final row00:59:07.230. Names, unrelated HP and player IDs below are
    ; diagnostic aliases; these are NOT claimed to be literal original rows.
    seg := V74LegacyMasterStyrakSegment(),boss := "Styrak {3152407211016192}:25287003790268"
    rows := [
        "[00:51:26.432] [@Fixture#1] [Dragon {3067057620910080}:1] [Fixture {1}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1)",
        "[00:53:26.481] [" boss "] [@Fixture#1] [Mass Force Storm {3218004246528000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23081)",
        "[00:54:02.069] [@Fixture#1] [Manifestation {3147154466013184}:25287003855839] [] [Event {836045448945472}: TargetSet {836045448953668}]",
        "[00:54:18.042] [@Fixture#1] [Manifestation {3147154466013184}:25287003855839] [] [Event {836045448945472}: Death {836045448945493}]"
    ]
    for i,raw in rows {
        ev := IPParseLine(raw),ev.RecordId := i
        IGPYObserve(seg,ev,ev.RawMs)
    }
    s := seg.PhaseProgress["Parsely"]
    V48Assert(s.Windows.Length=4 && s.Windows[3].Name="CM" && s.Windows[4].Ordinal=2,"Master principal TargetSet and Death form one actual CM occurrence")
    V48Assert(s.Windows[3].Start=3242069 && s.Windows[3].End=3258042,"Public Master CM clocks are retained exactly")
    cast := "[00:59:07.230] [" boss "] [=] [Conjured Kell Dragon {3215422971183104}] [Event {836045448945472}: AbilityActivate {836045448945479}]"
    ev := IPParseLine(cast),ev.RecordId := 5
    bad := ev.Clone(),bad.Kind := "Other",bad.ActionId := "836045448945477",bad.EffectId := "3215422971183104"
    IGPYObserve(seg,bad,bad.RawMs)
    V48Assert(seg.PhaseProgress["Parsely"].Current="styrak","Later apply is not the public Burn activation marker")
    bad := ev.Clone(),bad.Source := IPActor("Kell Dragon {3067057620910080}:2")
    IGPYObserve(seg,bad,bad.RawMs)
    V48Assert(seg.PhaseProgress["Parsely"].Current="styrak","Wrong NPC cannot start Master Burn")
    IGPYObserve(seg,ev,ev.RawMs),s := seg.PhaseProgress["Parsely"]
    V48Assert(s.Current="burn" && s.Windows.Length=5 && s.Windows[5].Start=3547230,"Verified Master Conjured Kell Dragon activation starts Burn at exact site clock")
    IGPYObserve(seg,ev,ev.RawMs)
    V48Assert(seg.PhaseProgress["Parsely"].Windows.Length=5,"Repeated delivery of the public Burn marker cannot add another Burn")
}

; Native exact-record fixtures for the 79 primary Parsely ranges.
; Three original recordings, anonymized player display names; no live file reads.
V74ModernParsely01()
{
    V74ModernParselyCase(V74ModernParselyCases()[1])
}

V74ModernParsely02()
{
    V74ModernParselyCase(V74ModernParselyCases()[2])
}

V74ModernParsely03()
{
    V74ModernParselyCase(V74ModernParselyCases()[3])
}

V74ModernParsely04()
{
    V74ModernParselyCase(V74ModernParselyCases()[4])
}

V74ModernParsely05()
{
    V74ModernParselyCase(V74ModernParselyCases()[5])
}

V74ModernParsely06()
{
    V74ModernParselyCase(V74ModernParselyCases()[6])
}

V74ModernParsely07()
{
    V74ModernParselyCase(V74ModernParselyCases()[7])
}

V74ModernParsely08()
{
    V74ModernParselyCase(V74ModernParselyCases()[8])
}

V74ModernParsely09()
{
    V74ModernParselyCase(V74ModernParselyCases()[9])
}

V74ModernParsely10()
{
    V74ModernParselyCase(V74ModernParselyCases()[10])
}

V74ModernParsely11()
{
    V74ModernParselyCase(V74ModernParselyCases()[11])
}

V74ModernParselyCases()
{
    cases := []
    c := {Boss:"DX-RE",Name:"Red",Start:1340864,End:1568342,Expected:[{Name:"Red",Start:1341102,End:1413794},{Name:"Bull",Start:1413794,End:1429292},{Name:"Red 2",Start:1429292,End:1489111},{Name:"Bull 2",Start:1489111,End:1512252},{Name:"Red 3",Start:1512252,End:1537736},{Name:"Bull 3",Start:1537736,End:1557937},{Name:"Red 4",Start:1557937,End:1568342}]},c.Records := []
    c.Records.Push({Line:7574,At:1341102,Raw:"[00:22:21.102] [@Player72392#687481958772392|(-429.92,-106.09,-38.45,1.29)|(439150/439150)] [Red {4330233272467456}:23320000031847|(-429.35,-116.90,-38.45,90.00)|(33964540/33970452)] [Affliction {808192586022912}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5913* ~5912 internal {836045448940876}) <5913.0>"})
    c.Records.Push({Line:11617,At:1413794,Raw:"[00:23:33.794] [@Player52336#690177435352336|(-530.66,-109.69,-30.77,-105.59)|(502679/503131)] [Stampeding Bull {4246356856143872}:23320000153811|(-525.32,-106.64,-32.23,58.32)|(1001444/1007893)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6449* energy {836045448940874}) <19346.0>"})
    c.Records.Push({Line:12102,At:1421292,Raw:"[00:23:41.292] [Red {4330233272467456}:23320000031847|(-523.25,-118.55,-31.89,174.97)|(21221742/33970452)] [Stampeding Bull {4246356856143872}:23320000153811|(-525.34,-107.14,-32.21,72.68)|(749272/1007893)] [Acidic Jet {4250089182724096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -resist {836045448945507})"})
    c.Records.Push({Line:12622,At:1429292,Raw:"[00:23:49.292] [@Player70218#689906611570218|(-524.01,-107.31,-32.31,-104.04)|(399287/443752)] [Stampeding Bull {4246356856143872}:23320000153811|(-525.18,-110.90,-32.13,-80.92)|(0/1007893)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:12623,At:1429292,Raw:"[00:23:49.292] [@Player70218#689906611570218|(-524.01,-107.31,-32.31,-104.04)|(399287/443752)] [Red {4330233272467456}:23320000031847|(-518.17,-106.27,-31.81,-8.10)|(20188430/33970452)] [Vengeful Slam {3503361873674240}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24264 energy {836045448940874}) <24264.0>"})
    c.Records.Push({Line:12624,At:1429292,Raw:"[00:23:49.292] [@Player72392#687481958772392|(-530.46,-121.18,-31.14,-142.10)|(439150/439150)] [Red {4330233272467456}:23320000031847|(-518.17,-106.27,-31.81,-8.10)|(20188430/33970452)] [Force Lightning {808252715565056}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6723 ~6722 energy {836045448940874}) <6723.0>"})
    c.Records.Push({Line:12654,At:1430007,Raw:"[00:23:50.007] [@Player95554#689887308595554|(-521.97,-99.68,-32.53,-169.24)|(435392/447702)] [Stampeding Bull {4246356856143872}:23320000153811|(-525.08,-110.97,-32.13,-80.92)|(0/1007893)] [Annihilate {808123866546176}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1110 energy {836045448940874}) <1110.0>"})
    c.Records.Push({Line:16491,At:1489111,Raw:"[00:24:49.111] [@Player70218#689906611570218|(-536.97,-56.32,-30.20,-75.79)|(370861/443752)] [Red {4330233272467456}:23320000031847|(-534.46,-57.64,-31.07,-133.03)|(11484716/33970452)] [Ravage {1261367470325760}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10852 energy {836045448940874}) <10852.0>"})
    c.Records.Push({Line:16492,At:1489111,Raw:"[00:24:49.111] [@Player17234#689835408517234|(-554.31,-55.80,-30.93,131.29)|(643468/643961)] [Stampeding Bull {4246356856143872}:23320000186370|(-567.41,-40.17,-30.76,-55.36)|(1000365/1007893)] [Saber Throw {807788859097427}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7528* energy {836045448940874}) <22584.0>"})
    c.Records.Push({Line:17664,At:1507619,Raw:"[00:25:07.619] [Red {4330233272467456}:23320000031847|(-535.91,-57.87,-30.71,97.77)|(9169437/33970452)] [Stampeding Bull {4246356856143872}:23320000186370|(-545.78,-57.71,-31.04,51.18)|(651514/1007893)] [Acidic Jet {4250089182724096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)"})
    c.Records.Push({Line:18065,At:1512252,Raw:"[00:25:12.252] [@Player95554#689887308595554|(-540.36,-61.74,-31.11,-131.12)|(292762/447702)] [Stampeding Bull {4246356856143872}:23320000186370|(-545.78,-57.71,-31.04,16.42)|(0/1007893)] [Rupture {3455541707800576}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12541* ~283 internal {836045448940876}) <12541.0>"})
    c.Records.Push({Line:18066,At:1512252,Raw:"[00:25:12.252] [@Player95554#689887308595554|(-540.36,-61.74,-31.11,-131.12)|(292762/447702)] [Stampeding Bull {4246356856143872}:23320000186370|(-545.78,-57.71,-31.04,16.42)|(0/1007893)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:18068,At:1512252,Raw:"[00:25:12.252] [@Player51594#690159737351594|(-542.84,-63.67,-31.11,143.36)|(414550/453429)] [Red {4330233272467456}:23320000031847|(-535.91,-57.87,-30.71,11.47)|(8632193/33970452)] [Discharge {808235535695872}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (14078* energy {836045448940874}) <14078.0>"})
    c.Records.Push({Line:19632,At:1537736,Raw:"[00:25:37.736] [@Player70218#689906611570218|(-560.24,6.25,-24.82,177.38)|(356232/443752)] [Red {4330233272467456}:23320000031847|(-559.32,10.20,-24.75,-115.20)|(4632327/33970452)] [Bleeding (Draining Scream) {807857578574081}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2190* internal {836045448940876}) <2190.0>"})
    c.Records.Push({Line:19633,At:1537736,Raw:"[00:25:37.736] [@Player70218#689906611570218|(-560.24,6.25,-24.82,177.38)|(356232/443752)] [Red {4330233272467456}:23320000031847|(-559.32,10.20,-24.75,-115.20)|(4632327/33970452)] [Ravage {1261367470325760}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8461* energy {836045448940874}) <8461.0>"})
    c.Records.Push({Line:19634,At:1537736,Raw:"[00:25:37.736] [Red {4330233272467456}:23320000031847|(-559.32,10.20,-24.75,-115.20)|(4632327/33970452)] [Stampeding Bull {4246356856143872}:23320000218840|(-548.63,33.13,-23.35,31.76)|(882032/1007893)] [Acidic Jet {4250089182724096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -)"})
    c.Records.Push({Line:19835,At:1540729,Raw:"[00:25:40.729] [@Player17234#689835408517234|(-564.22,9.36,-24.90,-100.22)|(356716/496489)] [Stampeding Bull {4246356856143872}:23320000218840|(-559.40,6.78,-24.75,147.54)|(728042/1007893)] [Crushing Blow {2211062048882688}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (28130* energy {836045448940874}) <117021.0>"})
    c.Records.Push({Line:20935,At:1557937,Raw:"[00:25:57.937] [@Player51594#690159737351594|(-586.26,1.70,-26.84,-54.36)|(245095/453429)] [Stampeding Bull {4246356856143872}:23320000218840|(-566.05,6.13,-25.31,55.69)|(0/1007893)] [Discharge {808235535695872}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (17401* ~9413 energy {836045448940874}) <17401.0>"})
    c.Records.Push({Line:20936,At:1557937,Raw:"[00:25:57.937] [@Player51594#690159737351594|(-586.26,1.70,-26.84,-54.36)|(245095/453429)] [Stampeding Bull {4246356856143872}:23320000218840|(-566.05,6.13,-25.31,55.69)|(0/1007893)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:20937,At:1557937,Raw:"[00:25:57.937] [@Player51594#690159737351594|(-586.26,1.70,-26.84,-54.36)|(245095/453429)] [Red {4330233272467456}:23320000031847|(-582.51,-0.60,-26.21,-15.26)|(1520168/33970452)] [Crushed (Eradicate) {4035839034130700}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7742* kinetic {836045448940873}) <7742.0>"})
    c.Records.Push({Line:21569,At:1568146,Raw:"[00:26:08.146] [@Player45793#689731184145793|(-597.63,2.29,-26.83,-177.71)|(136445/443782)] [Red {4330233272467456}:23320000031847|(-599.29,9.51,-26.84,103.75)|(0/18188932)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (174* energy {836045448940874}) <130.0>"})
    c.Records.Push({Line:21590,At:1568342,Raw:"[00:26:08.342] [@Player17234#689835408517234|(-597.08,16.25,-26.78,72.41)|(496489/496489)] [Red {4330233272467456}:23320000031847|(-599.29,9.51,-26.84,103.75)|(0/18188932)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9031 energy {836045448940874}) <27092.0>"})
    cases.Push(c)
    c := {Boss:"DX-E1",Name:"Holding Pens",Start:1683778,End:2035003,Expected:[{Name:"Run",Start:1683778,End:1713074},{Name:"Pursuit Droid",Start:1713074,End:1723782},{Name:"Run 2",Start:1723782,End:1766368},{Name:"Pursuit Droid 2",Start:1766368,End:1776910},{Name:"Run 3",Start:1776910,End:1782619},{Name:"Warden Droid",Start:1782619,End:1818379},{Name:"Pursuit Droid 3",Start:1818379,End:1830474},{Name:"Run 4",Start:1830474,End:1835445},{Name:"Reapers",Start:1835445,End:1854206},{Name:"Run 5",Start:1854206,End:1873136},{Name:"Pursuit Droid 4",Start:1873136,End:1885119},{Name:"Run 6",Start:1885119,End:1902977},{Name:"Warden Droid 2",Start:1902977,End:1927705},{Name:"Pursuit Droid 5",Start:1927705,End:1943537},{Name:"Warden Droid 3",Start:1943537,End:1973859},{Name:"Run 7",Start:1973859,End:1985150},{Name:"Pursuit Droid 6",Start:1985150,End:1997551},{Name:"Run 8",Start:1997551,End:2035003}]},c.Records := []
    c.Records.Push({Line:22248,At:1683778,Raw:"[00:28:03.778] [@Player70218#689906611570218|(-236.10,-139.76,0.09,-2.32)|(443752/443752)] [] [] [Event {836045448945472}: EnterCombat {836045448945489}]"})
    c.Records.Push({Line:23420,At:1713074,Raw:"[00:28:33.074] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-338.40,-244.29,0.23,7.07)|(10069617/10078924)] [@Player70218#689906611570218|(-338.86,-247.66,0.09,-128.16)|(443752/443752)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:24092,At:1723782,Raw:"[00:28:43.782] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-317.02,-235.30,0.30,-109.89)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:26636,At:1766368,Raw:"[00:29:26.368] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-222.82,-350.86,0.01,94.51)|(10078924/10078924)] [@Player51594#690159737351594|(-226.21,-350.59,-0.08,-111.59)|(453429/453429)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:26637,At:1766368,Raw:"[00:29:26.368] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-222.82,-350.86,0.01,94.51)|(10078924/10078924)] [@Player91855#690163409991855|(-217.42,-359.47,-0.11,147.82)|(432811/433449)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:27600,At:1776910,Raw:"[00:29:36.910] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-207.73,-344.88,0.01,-112.60)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:27824,At:1782619,Raw:"[00:29:42.619] [@Player52336#690177435352336|(-159.86,-274.48,0.02,-90.94)|(481324/503131)] [Czerka Warden Droid {4245686841245696}:23320000031353|(-148.00,-271.00,-0.08,67.11)|(4461929/4479522)] [Wither {975687720632320}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10246 ~10247 kinetic {836045448940873}) <46109.0>"})
    c.Records.Push({Line:30214,At:1818379,Raw:"[00:30:18.379] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-188.20,-264.67,-0.02,146.73)|(10078924/10078924)] [@Player95554#689887308595554|(-190.07,-261.83,-0.01,-34.92)|(442370/443782)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:30215,At:1818379,Raw:"[00:30:18.379] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-188.20,-264.67,-0.02,146.73)|(10078924/10078924)] [Incendiary Shriek {4250454254944256}:23320000326039|(-181.36,-281.34,-0.01,155.94)|(323637/323637)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:30216,At:1818379,Raw:"[00:30:18.379] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-188.20,-264.67,-0.02,146.73)|(10078924/10078924)] [Incendiary Shriek {4250454254944256}:23320000325896|(-180.14,-278.20,-0.01,148.92)|(320686/323637)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:30217,At:1818379,Raw:"[00:30:18.379] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-188.20,-264.67,-0.02,146.73)|(10078924/10078924)] [Incendiary Shriek {4250454254944256}:23320000326172|(-184.01,-271.84,-0.01,148.94)|(323637/323637)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:30305,At:1819101,Raw:"[00:30:19.101] [@Player51594#690159737351594|(-169.27,-280.65,0.52,-19.10)|(415578/453429)] [Czerka Warden Droid {4245686841245696}:23320000031353|(-169.29,-284.91,0.07,-148.25)|(0/18188932)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:30307,At:1819110,Raw:"[00:30:19.110] [@Player45793#689731184145793|(-165.85,-266.86,0.03,10.78)|(443782/443782)] [Czerka Warden Droid {4245686841245696}:23320000031353|(-169.29,-284.91,0.07,-148.72)|(0/18188932)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2431* energy {836045448940874}) <2431.0>"})
    c.Records.Push({Line:31080,At:1830474,Raw:"[00:30:30.474] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-165.21,-271.67,-0.01,-72.59)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:31322,At:1835445,Raw:"[00:30:35.445] [@Player70218#689906611570218|(-122.09,-271.34,-0.68,-86.30)|(333913/333913)] [Felshade Reaper {4250475729780736}:23320000340991|(-114.84,-271.77,-0.69,93.47)|(2550555/2570226)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (19671* energy {836045448940874}) <19671.0>"})
    c.Records.Push({Line:33116,At:1854206,Raw:"[00:30:54.206] [@Player95554#689887308595554|(-117.54,-275.71,-0.12,60.22)|(443782/443782)] [Felshade Reaper {4250475729780736}:23320000340991|(-122.13,-277.81,0.28,-131.78)|(0/2570226)] [Force Rend {3361615068004352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8342 ~3746 internal {836045448940876}) <6256.0>"})
    c.Records.Push({Line:33117,At:1854206,Raw:"[00:30:54.206] [@Player95554#689887308595554|(-117.54,-275.71,-0.12,60.22)|(443782/443782)] [Felshade Reaper {4250475729780736}:23320000340991|(-122.13,-277.81,0.28,-131.78)|(0/2570226)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:33145,At:1854377,Raw:"[00:30:54.377] [@Player17234#689835408517234|(-118.29,-274.38,-0.33,44.35)|(426519/496489)] [Felshade Reaper {4250475729780736}:23320000340991|(-122.13,-277.81,0.28,-131.78)|(0/2570226)] [Vicious Slash {807827513802752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (19398* energy {836045448940874}) <58195.0>"})
    c.Records.Push({Line:33809,At:1873136,Raw:"[00:31:13.136] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-111.05,-337.74,-1.18,39.59)|(10078924/10078924)] [@Player70218#689906611570218|(-113.71,-340.65,-0.68,-102.13)|(344297/443752)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:34699,At:1885119,Raw:"[00:31:25.119] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(-101.51,-345.96,-0.10,-45.68)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:35545,At:1901134,Raw:"[00:31:41.134] [Czerka Warden Droid {4245686841245696}:23320000031463|(35.00,-271.00,0.00,67.31)|(4479522/4479522)] [@Player52336#690177435352336|(13.07,-280.88,-0.52,-88.62)|(487163/503131)] [Containment Taser {4334163167543296}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (21956 kinetic {836045448940873} -shield {836045448945509} (118765 absorbed {836045448945511})) <21956.0>"})
    c.Records.Push({Line:35604,At:1902977,Raw:"[00:31:42.977] [@Player52336#690177435352336|(25.15,-279.00,-0.70,-49.92)|(496085/503131)] [Czerka Warden Droid {4245686841245696}:23320000031463|(34.45,-271.47,-0.02,51.68)|(4470766/4479522)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8756 energy {836045448940874}) <26268.0>"})
    c.Records.Push({Line:38010,At:1927705,Raw:"[00:32:07.705] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(7.54,-268.45,-0.83,156.21)|(10078924/10078924)] [@Player91855#690163409991855|(6.17,-265.35,-0.90,-25.62)|(433449/433449)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39245,At:1940234,Raw:"[00:32:20.234] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [Crimson Stalker {4333218274738176}:23320000394525|(14.07,-271.03,-0.85,-74.11)|(252135/385536)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39246,At:1940234,Raw:"[00:32:20.234] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [Felshade Hunter {4256042007396352}:23320000394241|(13.26,-272.94,-0.89,-102.99)|(910566/1156606)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39247,At:1940234,Raw:"[00:32:20.234] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [@Player70218#689906611570218|(16.58,-271.48,-0.81,93.04)|(250731/443752)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39248,At:1940234,Raw:"[00:32:20.234] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [@Player51594#690159737351594|(16.88,-272.10,-0.81,112.86)|(354931/453429)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39249,At:1940235,Raw:"[00:32:20.235] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [Crimson Stalker {4333218274738176}:23320000394809|(17.90,-270.81,-0.74,38.41)|(135974/385536)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39250,At:1940235,Raw:"[00:32:20.235] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [Crimson Stalker {4333218274738176}:23320000394667|(17.62,-273.91,-0.80,-190.43)|(182696/385536)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39251,At:1940235,Raw:"[00:32:20.235] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [Felshade Hunter {4256042007396352}:23320000394387|(16.69,-275.62,-0.80,-174.54)|(994310/1156606)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39252,At:1940235,Raw:"[00:32:20.235] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [@Player72392#687481958772392|(19.60,-271.33,-0.73,-44.67)|(398654/439150)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39253,At:1940235,Raw:"[00:32:20.235] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [@Player52336#690177435352336|(13.09,-283.64,-0.37,-134.46)|(314432/503131)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39254,At:1940235,Raw:"[00:32:20.235] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [@Player95554#689887308595554|(16.60,-284.80,-0.33,-112.17)|(263003/443782)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39255,At:1940235,Raw:"[00:32:20.235] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [@Player45793#689731184145793|(25.90,-282.39,-0.37,21.97)|(443782/443782)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39256,At:1940235,Raw:"[00:32:20.235] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-91.55)|(9166089/10078924)] [Shadow Reaper {4334133102772224}:23320000374760|(1.17,-260.15,-0.17,-39.84)|(61603/1285140)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:39548,At:1943537,Raw:"[00:32:23.537] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(13.83,-271.35,-0.86,-87.35)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:41021,At:1973859,Raw:"[00:32:53.859] [@Player70218#689906611570218|(15.20,-289.35,0.09,-41.63)|(140123/443752)] [Czerka Warden Droid {4245686841245696}:23320000031463|(20.00,-291.28,0.11,4.38)|(0/18188932)] [Bleeding (Eviscerate) {3426078232150278}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1372 ~299 internal {836045448940876}) <1372.0>"})
    c.Records.Push({Line:41022,At:1973859,Raw:"[00:32:53.859] [@Player70218#689906611570218|(15.20,-289.35,0.09,-41.63)|(140123/443752)] [Czerka Warden Droid {4245686841245696}:23320000031463|(20.00,-291.28,0.11,4.38)|(0/18188932)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:41251,At:1985150,Raw:"[00:33:05.150] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(7.66,-304.01,0.14,47.45)|(10078924/10078924)] [@Player95554#689887308595554|(7.86,-302.04,0.31,3.45)|(423819/443782)] [Cleaning Field {4389447986577408}] [ApplyEffect {836045448945477}: Ambush Stun Dart {4389447986577664}]"})
    c.Records.Push({Line:41725,At:1997551,Raw:"[00:33:17.551] [Czerka Pursuit Droid {4389417921806336}:23320000018569|(8.83,-310.66,0.00,-9.75)|(9071031/10078924)] [=] [Stealthed Pursuit Mode {4389426511740928}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    cases.Push(c)
    c := {Boss:"DX-E2",Name:"Control Room",Start:2086508,End:2358447,Expected:[{Name:"Run",Start:2086508,End:2222611},{Name:"Control Center",Start:2222611,End:2270924},{Name:"Sanitizer Droid",Start:2270924,End:2358447}]},c.Records := []
    c.Records.Push({Line:43606,At:2086508,Raw:"[00:34:46.508] [@Player70218#689906611570218|(11.07,-370.86,0.22,-179.52)|(443752/443752)] [] [] [Event {836045448945472}: EnterCombat {836045448945489}]"})
    c.Records.Push({Line:49311,At:2222611,Raw:"[00:37:02.611] [@Player91855#690163409991855|(4.85,-109.00,-0.11,68.35)|(433449/433449)] [=] [Closing Door... {4338539739217920}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:49347,At:2223707,Raw:"[00:37:03.707] [@Player17234#689835408517234|(5.40,-105.98,-0.11,67.07)|(482727/496489)] [=] [Closing Door... {4338539739217920}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:49355,At:2223806,Raw:"[00:37:03.806] [@Player95554#689887308595554|(3.65,-109.74,-0.11,8.69)|(365913/443782)] [=] [Closing Door... {4338539739217920}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:52030,At:2270924,Raw:"[00:37:50.924] [@Player45793#689731184145793|(20.73,-105.63,-0.15,-94.48)|(443782/443782)] [Czerka Sanitizer Droid {4390577562976256}:23320000533195|(41.38,-105.65,-0.13,51.40)|(5021740/5038335)] [Unload {814312914419712}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (16594* ~16595 energy {836045448940874}) <16594.0>"})
    c.Records.Push({Line:55469,At:2307740,Raw:"[00:38:27.740] [@Player95554#689887308595554|(26.16,-117.89,-0.13,19.89)|(400922/443782)] [Czerka Sanitizer Droid {4390577562976256}:23320000533195|(24.68,-120.11,-0.13,-12.49)|(0/18188932)] [Vicious Throw {2145542322782208}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (25370 energy {836045448940874}) <19027.0>"})
    cases.Push(c)
    c := {Boss:"DX-TR",Name:"Trandoshan Squad",Start:2654744,End:3028007,Expected:[{Name:"Titax",Start:2655610,End:2806265},{Name:"Trandoshans",Start:2806265,End:2885267},{Name:"Ultimate Hunter",Start:2898158,End:3028007}]},c.Records := []
    c.Records.Push({Line:70940,At:2655610,Raw:"[00:44:15.610] [@Player70218#689906611570218|(41.92,231.29,35.07,-92.71)|(443752/443752)] [Titax {4245987488956416}:23320000603367|(45.42,231.45,35.07,90.00)|(10683374/10696316)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12942* energy {836045448940874}) <9706.0>"})
    c.Records.Push({Line:71027,At:2658454,Raw:"[00:44:18.454] [@Player95554#689887308595554|(42.92,224.11,35.07,-112.85)|(443782/443782)] [Greus {4245978899021824}:23320000717613|(48.24,222.91,35.07,150.00)|(6065678/6092443)] [Bleeding (Deadly Saber) {1259666663276824}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2672 internal {836045448940876}) <2672.0>"})
    c.Records.Push({Line:71080,At:2659730,Raw:"[00:44:19.730] [@Player17234#689835408517234|(46.02,239.74,35.14,-80.05)|(496489/496489)] [Hissyphus {4245970309087232}:23320000717951|(51.03,238.86,35.07,30.00)|(11250931/11255532)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4601 energy {836045448940874}) <13804.0>"})
    c.Records.Push({Line:71155,At:2661052,Raw:"[00:44:21.052] [@Player51594#690159737351594|(47.16,228.16,35.07,-51.14)|(453429/453429)] [Kronissus {4245983193989120}:23320000718341|(53.95,226.90,35.07,105.00)|(9388615/9396820)] [Lacerate {975129374883840}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8205 energy {836045448940874}) <8205.0>"})
    c.Records.Push({Line:80809,At:2806265,Raw:"[00:46:46.265] [] [Titax {4245987488956416}:23320000603367|(74.89,234.23,33.65,-4.06)|(0/18188932)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:86040,At:2885070,Raw:"[00:48:05.070] [] [Kronissus {4245983193989120}:23320000718341|(85.72,233.64,33.65,-40.38)|(0/18188932)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:86053,At:2885072,Raw:"[00:48:05.072] [] [Greus {4245978899021824}:23320000717613|(87.29,236.93,33.65,-37.45)|(0/18188932)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:86073,At:2885267,Raw:"[00:48:05.267] [ {4381540951785472}:23320000005261|(80.84,202.87,33.99,180.00)|(3003295/3003295)] [Hissyphus {4245970309087232}:23320000717951|(81.36,206.33,33.99,177.07)|(0/18188932)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:86231,At:2898158,Raw:"[00:48:18.158] [@Player51594#690159737351594|(55.97,233.36,35.07,-28.68)|(453429/453429)] [The Ultimate Hunter {4381150109761536}:23320000841344|(65.57,231.47,35.07,90.00)|(10543788/10553973)] [Eradicate {4035839034130432}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10185 kinetic {836045448940873}) <7639.0>"})
    cases.Push(c)
    c := {Boss:"DX-HMM",Name:"Huntmaster",Start:3359830,End:3627294,Expected:[{Name:"Huntmaster",Start:3359841,End:3439086},{Name:"Fortress",Start:3439086,End:3477865},{Name:"Holdout",Start:3477865,End:3531413},{Name:"Huntmaster 2",Start:3531413,End:3612577},{Name:"Fortress 2",Start:3612577,End:3619191},{Name:"Holdout 2",Start:3619191,End:3625293},{Name:"Shelleigh",Start:3625293,End:3627294}]},c.Records := []
    c.Records.Push({Line:98045,At:3359841,Raw:"[00:55:59.841] [@Player17234#689835408517234|(269.93,-279.20,-11.13,33.23)|(496489/496489)] [Huntmaster {4265104388390912}:23320000032374|(290.62,-291.45,-10.98,120.00)|(30094976/30102682)] [Saber Throw {807788859097088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7706 energy {836045448940874}) <23118.0>"})
    c.Records.Push({Line:102795,At:3439086,Raw:"[00:57:19.086] [Huntmaster {4265104388390912}:23320000032374|(264.44,-279.75,-11.09,33.03)|(18217436/30102682)] [=] [Fortress {4271405105414144}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:105087,At:3477865,Raw:"[00:57:57.865] [Huntmaster {4265104388390912}:23320000032374|(262.82,-290.02,-11.57,167.83)|(17815700/30102682)] [=] [ {4277521138843648}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:108348,At:3531413,Raw:"[00:58:51.413] [Huntmaster {4265104388390912}:23320000032374|(262.00,-245.50,-9.48,-23.70)|(17700864/30102682)] [=] [Holdout Cover {4277787426816000}] [RemoveEffect {836045448945478}: Holdout Cover {4277787426816333}]"})
    c.Records.Push({Line:112252,At:3612577,Raw:"[01:00:12.577] [Huntmaster {4265104388390912}:23320000032374|(251.73,-294.43,-11.01,83.63)|(10214874/30102682)] [=] [Flying Fortress {4387871733579776}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:112568,At:3619191,Raw:"[01:00:19.191] [Huntmaster {4265104388390912}:23320000032374|(251.73,-294.43,-11.01,-176.71)|(12342748/30102682)] [=] [ {4277521138843648}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:113020,At:3625293,Raw:"[01:00:25.293] [Huntmaster {4265104388390912}:23320000032374|(262.00,-245.50,-9.48,14.06)|(17521918/30102682)] [Shelleigh {4330237567434752}:23320001114764|(259.03,-234.54,-13.05,360.00)|(8838629/11822805)] [Flying Fortress Jet Wash {4387871733580067}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18785 elemental {836045448940875})"})
    cases.Push(c)
    c := {Boss:"DX-AP",Name:"Apex Vanguard",Start:3707689,End:4361156,Expected:[{Name:"Apex",Start:3709001,End:3755496},{Name:"Transformer",Start:3755496,End:3768201},{Name:"Apex 2",Start:3768201,End:3950939},{Name:"Voltinator",Start:3950939,End:3962850},{Name:"Apex 3",Start:3962850,End:4088560},{Name:"Voltinator 2",Start:4088560,End:4100209},{Name:"Apex 4",Start:4100209,End:4221781},{Name:"Voltinator 3",Start:4221781,End:4231784},{Name:"Apex 5",Start:4231784,End:4334655},{Name:"Burn",Start:4334655,End:4361156}]},c.Records := []
    c.Records.Push({Line:113835,At:3709001,Raw:"[01:01:49.001] [@Player51594#690159737351594|(398.38,-280.89,-13.98,157.58)|(459860/459860)] [Apex Vanguard {4350020186800128}:23320001118520|(394.29,-270.95,-13.98,9.91)|(62686108/62726540)] [Shock {808308550139904}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11734 ~11736 energy {836045448940874}) <35202.0>"})
    c.Records.Push({Line:116431,At:3755496,Raw:"[01:02:35.496] [@Player52336#690177435352336|(395.67,-264.33,-13.98,-46.02)|(480912/503131)] [Power Transformer {4297557161279488}:23320001147306|(398.29,-269.90,-14.00,-270.00)|(1348668/1364170)] [Depredating Volts {3408949902573568}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15503* energy {836045448940874}) <48058.0>"})
    c.Records.Push({Line:117088,At:3768201,Raw:"[01:02:48.201] [Apex Vanguard {4350020186800128}:23320001118520|(374.33,-269.42,-13.98,114.55)|(56704200/62726540)] [=] [Darkness Overdrive {4297819154284544}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:127239,At:3950939,Raw:"[01:05:50.939] [Apex Vanguard {4350020186800128}:23320001118520|(386.31,-295.70,-13.98,68.14)|(37394432/62726540)] [=] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:127858,At:3962850,Raw:"[01:06:02.850] [Apex Vanguard {4350020186800128}:23320001118520|(386.54,-295.59,-13.98,68.03)|(37313992/62726540)] [] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]"})
    c.Records.Push({Line:127860,At:3962850,Raw:"[01:06:02.850] [@Player91855#690163409991855|(391.54,-288.96,-13.98,36.80)|(300012/326159)] [Apex Vanguard {4350020186800128}:23320001118520|(386.54,-295.59,-13.98,68.03)|(37313992/62726540)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8526* ~8524 internal {836045448940876}) <6394.0>"})
    c.Records.Push({Line:127861,At:3962850,Raw:"[01:06:02.850] [@Player91855#690163409991855|(391.54,-288.96,-13.98,36.80)|(300012/326159)] [Apex Vanguard {4350020186800128}:23320001118520|(386.54,-295.59,-13.98,68.03)|(37313992/62726540)] [Penetrating Blasts {3394699201085440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18725* ~18724 energy {836045448940874} (2674 absorbed {836045448945511})) <14043.0>"})
    c.Records.Push({Line:127863,At:3962850,Raw:"[01:06:02.850] [@Player95554#689887308595554|(390.37,-296.97,-13.98,54.35)|(331101/333935)] [Apex Vanguard {4350020186800128}:23320001118520|(386.54,-295.59,-13.98,68.03)|(37313992/62726540)] [Force Rend {3361615068004352}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12675* ~12676 internal {836045448940876}) <9506.0>"})
    c.Records.Push({Line:135289,At:4088560,Raw:"[01:08:08.560] [Apex Vanguard {4350020186800128}:23320001118520|(381.63,-248.26,-13.98,59.35)|(22514490/62726540)] [=] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:136176,At:4100209,Raw:"[01:08:20.209] [Apex Vanguard {4350020186800128}:23320001118520|(382.27,-247.83,-13.98,-29.26)|(22483878/62726540)] [] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]"})
    c.Records.Push({Line:142437,At:4221781,Raw:"[01:10:21.781] [Apex Vanguard {4350020186800128}:23320001118520|(375.22,-266.03,-13.98,90.41)|(12944305/62726540)] [=] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:142980,At:4231784,Raw:"[01:10:31.784] [Apex Vanguard {4350020186800128}:23320001118520|(375.22,-266.03,-13.98,92.93)|(14155308/62726540)] [] [The Voltinator {4310755595780096}] [Event {836045448945472}: AbilityInterrupt {836045448945482}]"})
    c.Records.Push({Line:142982,At:4231784,Raw:"[01:10:31.784] [@Player91855#690163409991855|(382.41,-268.51,-13.98,108.02)|(257830/326159)] [Apex Vanguard {4350020186800128}:23320001118520|(375.22,-266.03,-13.98,92.93)|(14155308/62726540)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10086* internal {836045448940876}) <7564.0>"})
    c.Records.Push({Line:142983,At:4231784,Raw:"[01:10:31.784] [@Player91855#690163409991855|(382.41,-268.51,-13.98,108.02)|(257830/326159)] [Apex Vanguard {4350020186800128}:23320001118520|(375.22,-266.03,-13.98,92.93)|(14155308/62726540)] [Penetrating Blasts {3394699201085440}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22486* energy {836045448940874} (18647 absorbed {836045448945511})) <16865.0>"})
    c.Records.Push({Line:148659,At:4334655,Raw:"[01:12:14.655] [Apex Vanguard {4350020186800128}:23320001118520|(396.66,-242.20,-13.98,-119.84)|(3676195/62726540)] [=] [Last Ditch Effort {4329997049266176}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:150000,At:4361156,Raw:"[01:12:41.156] [@Player70218#689906611570218|(395.29,-238.39,-13.98,142.97)|(240180/333913)] [Apex Vanguard {4350020186800128}:23320001118520|(394.91,-234.88,-13.98,136.69)|(0/62726540)] [Furious Strike {3451633287561216}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (70889* ~63907 energy {836045448940874}) <53167.0>"})
    cases.Push(c)
    c := {Boss:"R4-IP",Name:"IP-CPT",Start:73265187,End:73656477,Expected:[{Name:"IP CPT",Start:73265187,End:73337138},{Name:"Bombs",Start:73337138,End:73426067},{Name:"IP CPT 2",Start:73426067,End:73484083},{Name:"Bombs 2",Start:73484083,End:73572806},{Name:"IP CPT 3",Start:73572806,End:73633542},{Name:"Burn",Start:73633542,End:73656477}]},c.Records := []
    c.Records.Push({Line:9208,At:73265187,Raw:"[20:21:05.187] [@Player15509#690172070915509|(-162.29,-17.76,411.97,-112.04)|(443782/443782)] [IP-CPT {4494653210492928}:35601000004009|(-157.70,-15.90,411.98,0.00)|(21873286/21888378)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7022 energy {836045448940874}) <7022.0>"})
    c.Records.Push({Line:11735,At:73337138,Raw:"[20:22:17.138] [@Player15509#690172070915509|(-129.05,-42.85,411.95,-30.23)|(342435/443782)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:11797,At:73340738,Raw:"[20:22:20.738] [@Player00578#689707317800578|(-186.51,12.31,411.95,131.00)|(387604/439135)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:11855,At:73343742,Raw:"[20:22:23.742] [@Player41634#689874925741634|(-188.05,-44.08,411.95,50.19)|(194722/443634)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:11982,At:73347238,Raw:"[20:22:27.238] [@Player63209#689906793163209|(-130.38,12.09,411.95,-121.40)|(325084/444663)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:12064,At:73350235,Raw:"[20:22:30.235] [@Player00578#689707317800578|(-187.04,12.86,411.95,131.00)|(383579/439135)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:12138,At:73353141,Raw:"[20:22:33.141] [@Player63209#689906793163209|(-130.90,12.27,411.95,-161.56)|(325084/444663)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:14022,At:73381660,Raw:"[20:23:01.660] [@Player15509#690172070915509|(-132.19,-41.79,411.95,-97.21)|(424904/443782)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:14198,At:73386158,Raw:"[20:23:06.158] [@Player41634#689874925741634|(-185.08,-40.14,411.95,51.45)|(212331/443634)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:14261,At:73389256,Raw:"[20:23:09.256] [@Player15509#690172070915509|(-131.52,-42.35,411.95,-72.84)|(400697/443782)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:14380,At:73392360,Raw:"[20:23:12.360] [@Player63209#689906793163209|(-130.21,12.76,411.95,-131.18)|(299508/444663)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:14502,At:73395362,Raw:"[20:23:15.362] [@Player15509#690172070915509|(-130.03,-43.93,411.95,-49.61)|(400697/443782)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:14598,At:73398263,Raw:"[20:23:18.263] [@Player41634#689874925741634|(-188.31,-43.69,411.95,51.45)|(159955/443634)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:15711,At:73426067,Raw:"[20:23:46.067] [IP-CPT {4494653210492928}:35601000004009|(-157.70,-15.90,421.98,0.00)|(16405810/21888378)] [=] [Observation Mode {4471627890819072}] [RemoveEffect {836045448945478}: Observation Mode {4471627890819336}]"})
    c.Records.Push({Line:18060,At:73484083,Raw:"[20:24:44.083] [@Player15509#690172070915509|(-131.20,-42.15,411.95,-87.32)|(268878/443782)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:18152,At:73487681,Raw:"[20:24:47.681] [@Player63209#689906793163209|(-133.14,9.92,411.95,-137.10)|(427865/444663)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:18216,At:73490782,Raw:"[20:24:50.782] [@Player15509#690172070915509|(-130.73,-42.93,411.95,-77.66)|(97661/443782)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:18305,At:73493590,Raw:"[20:24:53.590] [@Player63209#689906793163209|(-131.03,12.19,411.95,-137.10)|(444663/444663)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:18379,At:73496587,Raw:"[20:24:56.587] [@Player15509#690172070915509|(-130.73,-42.93,411.95,-77.66)|(135257/443782)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:18428,At:73499486,Raw:"[20:24:59.486] [@Player00578#689707317800578|(-186.93,12.08,411.95,146.23)|(389883/439135)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:18561,At:73503200,Raw:"[20:25:03.200] [@Player00578#689707317800578|(-187.19,13.02,411.95,138.53)|(428412/439135)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:18588,At:73503593,Raw:"[20:25:03.593] [@Player00578#689707317800578|(-187.06,12.86,411.95,138.53)|(428412/439135)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:18719,At:73506591,Raw:"[20:25:06.591] [@Player63209#689906793163209|(-131.03,12.19,411.95,-136.33)|(407756/444663)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:18810,At:73509593,Raw:"[20:25:09.593] [@Player00578#689707317800578|(-187.25,12.83,411.95,140.91)|(376289/439135)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:19655,At:73528193,Raw:"[20:25:28.193] [@Player15509#690172070915509|(-130.18,-42.43,411.95,-50.27)|(306487/443782)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:19703,At:73530993,Raw:"[20:25:30.993] [@Player63209#689906793163209|(-130.80,13.11,411.95,-149.53)|(399410/444663)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:19741,At:73533991,Raw:"[20:25:33.991] [@Player00578#689707317800578|(-187.00,12.54,411.95,144.18)|(392236/439135)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:19833,At:73536802,Raw:"[20:25:36.802] [@Player63209#689906793163209|(-130.80,13.11,411.95,-149.53)|(380883/444663)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:19923,At:73539491,Raw:"[20:25:39.491] [@Player15509#690172070915509|(-131.02,-42.41,411.95,-80.75)|(267607/443782)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:20001,At:73542501,Raw:"[20:25:42.501] [@Player41634#689874925741634|(-187.81,-44.34,411.95,41.97)|(315956/443634)] [=] [Using {810799631171584}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:22249,At:73572806,Raw:"[20:26:12.806] [IP-CPT {4494653210492928}:35601000004009|(-157.70,-15.90,421.98,0.00)|(10894292/21888378)] [=] [Observation Mode {4471627890819072}] [RemoveEffect {836045448945478}: Observation Mode {4471627890819336}]"})
    c.Records.Push({Line:25055,At:73631045,Raw:"[20:27:11.045] [IP-CPT {4494653210492928}:35601000004009|(-157.70,-15.90,421.98,0.00)|(5429566/21888378)] [=] [Observation Mode {4471627890819072}] [RemoveEffect {836045448945478}: Observation Mode {4471627890819336}]"})
    c.Records.Push({Line:25178,At:73633542,Raw:"[20:27:13.542] [IP-CPT {4494653210492928}:35601000004009|(-157.70,-15.90,411.98,0.00)|(5216033/21888378)] [=] [Disproportionate Intrusion Response {4471730970034176}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:26650,At:73656477,Raw:"[20:27:36.477] [@Player41634#689874925741634|(-164.70,-10.60,411.95,-61.61)|(382930/443634)] [IP-CPT {4494653210492928}:35601000004009|(-157.70,-15.90,411.98,0.00)|(0/30828700)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13588* elemental {836045448940875}) <13588.0>"})
    cases.Push(c)
    c := {Boss:"R4-WD",Name:"Watchdog",Start:73779025,End:73994490,Expected:[{Name:"Watchdog",Start:73779025,End:73852071},{Name:"Stalker Protocol",Start:73852071,End:73896680},{Name:"Polarized Beam",Start:73896680,End:73949007},{Name:"Watchdog 2",Start:73949007,End:73970612},{Name:"Burn",Start:73970612,End:73994490}]},c.Records := []
    c.Records.Push({Line:27665,At:73779025,Raw:"[20:29:39.025] [@Player63209#689906793163209|(-171.46,179.97,340.08,157.78)|(444663/444663)] [Watchdog {4494700455133184}:35601000181149|(-177.98,196.04,339.99,315.00)|(54208076/54258512)] [Eradicate {4035839034130432}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (18057* ~18056 kinetic {836045448940873}) <18057.0>"})
    c.Records.Push({Line:31374,At:73840763,Raw:"[20:30:40.763] [Watchdog {4494700455133184}:35601000181149|(-154.72,179.69,340.08,-145.35)|(43036836/54258512)] [=] [Degauss {4472216301338624}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:31994,At:73852071,Raw:"[20:30:52.071] [Watchdog {4494700455133184}:35601000181149|(-177.30,192.71,339.99,-61.83)|(40580140/54258512)] [=] [Stalker Protocol {4472963625648128}] [ApplyEffect {836045448945477}: Stalker Protocol {4472963625648128}]"})
    c.Records.Push({Line:32909,At:73868170,Raw:"[20:31:08.170] [Watchdog {4494700455133184}:35601000181149|(-152.17,180.80,340.08,6.97)|(36638164/54258512)] [=] [Stalker Protocol {4472963625648128}] [ApplyEffect {836045448945477}: Stalker Protocol {4472963625648128}]"})
    c.Records.Push({Line:34602,At:73896680,Raw:"[20:31:36.680] [Watchdog {4494700455133184}:35601000181149|(-162.45,178.76,340.08,-86.71)|(29923986/54258512)] [=] [Polarized Beam {4471709495197696}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:35479,At:73911003,Raw:"[20:31:51.003] [Watchdog {4494700455133184}:35601000181149|(-160.95,179.13,340.08,-67.68)|(25510744/54258512)] [=] [Polarized Beam {4471709495197696}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:36324,At:73925401,Raw:"[20:32:05.401] [Watchdog {4494700455133184}:35601000181149|(-158.09,177.90,340.13,-57.11)|(20773398/54258512)] [=] [Polarized Beam {4471709495197696}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:37146,At:73939800,Raw:"[20:32:19.800] [Watchdog {4494700455133184}:35601000181149|(-153.01,175.10,340.08,-60.59)|(15611066/54258512)] [=] [Polarized Beam {4471709495197696}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:37681,At:73949007,Raw:"[20:32:29.007] [Watchdog {4494700455133184}:35601000181149|(-144.57,166.11,339.99,-99.72)|(12309638/54258512)] [=] [Degauss {4472216301338624}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:38849,At:73970612,Raw:"[20:32:50.612] [Watchdog {4494700455133184}:35601000181149|(-164.67,164.32,339.99,91.02)|(5787443/54258512)] [=] [Hair Trigger Protocol {4474290770542592}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:40296,At:73993996,Raw:"[20:33:13.996] [@Player56727#690522558956727|(-171.95,160.64,339.99,-116.95)|(260573/470907)] [Watchdog {4494700455133184}:35601000181149|(-164.67,164.32,339.99,63.11)|(0/54258512)] [Heavy Flamethrower {4502852303060992}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13553* elemental {836045448940875}) <40660.0>"})
    c.Records.Push({Line:40321,At:73994490,Raw:"[20:33:14.490] [@Player56727#690522558956727|(-171.95,160.64,339.99,-116.95)|(260573/470907)] [Watchdog {4494700455133184}:35601000181149|(-164.67,164.32,339.99,63.11)|(0/54258512)] [Flame Burst {814222720106496}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8382 elemental {836045448940875}) <25145.0>"})
    cases.Push(c)
    c := {Boss:"R4-KN",Name:"Lord Kanoth",Start:74265635,End:74595121,Expected:[{Name:"Kanoth",Start:74265635,End:74348632},{Name:"Monstrosities",Start:74348632,End:74362635},{Name:"Kanoth 2",Start:74362635,End:74410260},{Name:"Monstrosity",Start:74410260,End:74444519},{Name:"Kanoth 3",Start:74444519,End:74523199},{Name:"Monstrosity 2",Start:74523199,End:74532600},{Name:"Burn",Start:74550007,End:74595121}]},c.Records := []
    c.Records.Push({Line:51542,At:74265635,Raw:"[20:37:45.635] [@Player02556#689469415902556|(261.22,-141.53,-232.09,21.23)|(446587/446587)] [Lord Kanoth {4494876548792320}:35601000277655|(260.00,-144.00,-232.06,146.51)|(43866200/43909316)] [Squelch {4036075257331712}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10502 ~10504 kinetic {836045448940873}) <10502.0>"})
    c.Records.Push({Line:57085,At:74348632,Raw:"[20:39:08.632] [Lord Kanoth {4494876548792320}:35601000277655|(255.60,-141.05,-232.02,160.44)|(30317242/43909316)] [=] [Beckon {4603723904974848}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:57087,At:74348632,Raw:"[20:39:08.632] [@Player02556#689469415902556|(256.50,-138.63,-232.03,17.48)|(409281/446587)] [Lord Kanoth {4494876548792320}:35601000277655|(255.60,-141.05,-232.02,160.44)|(30317242/43909316)] [Double Strike {812728071487488}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11086* energy {836045448940874}) <11086.0>"})
    c.Records.Push({Line:57824,At:74362635,Raw:"[20:39:22.635] [Lord Kanoth {4494876548792320}:35601000277655|(259.39,-124.63,-231.97,-42.10)|(29708310/43909316)] [=] [Nihrotic Shield {4601859889168384}] [RemoveEffect {836045448945478}: Nihrotic Shield {4601859889168384}]"})
    c.Records.Push({Line:57825,At:74362635,Raw:"[20:39:22.635] [@Player02556#689469415902556|(258.38,-121.42,-232.06,65.33)|(446587/446587)] [Lord Kanoth {4494876548792320}:35601000277655|(259.39,-124.63,-231.97,-42.10)|(29708310/43909316)] [Force Technique {979789414400000}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3392* kinetic {836045448940873} (2947 absorbed {836045448945511})) <3392.0>"})
    c.Records.Push({Line:60252,At:74390174,Raw:"[20:39:50.174] [@Player02556#689469415902556|(253.42,-125.66,-232.04,21.63)|(446587/446587)] [Nihrotic Monstrosity {4601314428321792}:35601000405437|(249.12,-134.69,-232.11,-166.58)|(0/1425293)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:60440,At:74393167,Raw:"[20:39:53.167] [@Player00578#689707317800578|(257.11,-109.72,-232.06,18.27)|(439135/439135)] [Nihrotic Monstrosity {4601314428321792}:35601000405592|(252.10,-132.83,-232.12,100.15)|(0/1425293)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:61458,At:74410260,Raw:"[20:40:10.260] [Lord Kanoth {4494876548792320}:35601000277655|(247.12,-128.76,-232.08,135.91)|(23436272/43909316)] [=] [Beckon {4601305838387200}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:63669,At:74444519,Raw:"[20:40:44.519] [@Player02556#689469415902556|(258.10,-118.01,-232.02,110.37)|(396769/446587)] [Nihrotic Monstrosity {4601314428321792}:35601000436566|(251.26,-111.93,-231.99,126.51)|(0/1425293)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:68187,At:74523199,Raw:"[20:42:03.199] [Lord Kanoth {4494876548792320}:35601000277655|(242.11,-126.91,-231.97,4.39)|(8965600/43909316)] [=] [Beckon {4601305838387200}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:68789,At:74532600,Raw:"[20:42:12.600] [Lord Kanoth {4494876548792320}:35601000277655|(242.80,-122.64,-231.97,-167.62)|(7464584/43909316)] [=] [Supreme Garden {4602469774524416}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:69740,At:74545715,Raw:"[20:42:25.715] [@Player15509#690172070915509|(263.62,-112.82,-230.88,-28.09)|(362163/443782)] [Nihrotic Monstrosity {4601314428321792}:35601000486465|(267.44,-113.04,-231.98,-121.48)|(0/1425293)] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:69950,At:74550007,Raw:"[20:42:30.007] [Lord Kanoth {4494876548792320}:35601000277655|(257.41,-122.17,-232.07,127.43)|(7464584/43909316)] [=] [Nihrotic Barrier {4602461184589824}] [RemoveEffect {836045448945478}: Nihrotic Barrier {4602461184589824}]"})
    c.Records.Push({Line:72602,At:74595121,Raw:"[20:43:15.121] [@Player15509#690172070915509|(259.13,-117.60,-232.00,-112.52)|(443782/443782)] [Lord Kanoth {4494876548792320}:35601000277655|(262.11,-117.40,-231.97,-177.75)|(0/43909316)] [Annihilate {808123866546176}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (29432 energy {836045448940874}) <29432.0>"})
    cases.Push(c)
    c := {Boss:"R4-LD",Name:"Lady Dominique",Start:74649064,End:75210872,Expected:[{Name:"Dominique",Start:74649064,End:74789224},{Name:"Conduits",Start:74789224,End:74953499},{Name:"Watchdog",Start:74953499,End:74989711},{Name:"Dominique 2",Start:74989711,End:75005207},{Name:"Attractors",Start:75005207,End:75095986},{Name:"Burn",Start:75095986,End:75210872}]},c.Records := []
    c.Records.Push({Line:72966,At:74649064,Raw:"[20:44:09.064] [@Player56727#690522558956727|(-42.18,-0.28,-215.45,-44.71)|(470907/470907)] [Lady Dominique {4608014577303552}:35601000518900|(-39.00,-3.50,-215.45,-90.00)|(66257436/66281708)] [Rising Phoenix {4504978311872512}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4491 ~4492 kinetic {836045448940873}) <13473.0>"})
    c.Records.Push({Line:80830,At:74789224,Raw:"[20:46:29.224] [Lady Dominique {4608014577303552}:35601000518900|(-39.00,-3.50,-215.45,91.55)|(46644396/66281708)] [=] [Separate {4598093202849792}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:92822,At:74953499,Raw:"[20:49:13.499] [@Player19000#689523785319000|(-43.41,5.93,-215.39,-67.63)|(439447/439447)] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-231.25,-270.00)|(5423276/54258512)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2576 ~2577 elemental {836045448940875}) <2576.0>"})
    c.Records.Push({Line:94917,At:74989711,Raw:"[20:49:49.711] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-231.25,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25710666/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94936,At:74989818,Raw:"[20:49:49.818] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-230.43,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25710666/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94942,At:74989908,Raw:"[20:49:49.908] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-229.86,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25710666/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94955,At:74990305,Raw:"[20:49:50.305] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-231.25,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25710666/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94959,At:74990306,Raw:"[20:49:50.306] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-231.25,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25710666/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94963,At:74990401,Raw:"[20:49:50.401] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-230.59,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25710666/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94967,At:74990401,Raw:"[20:49:50.401] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-230.59,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25710666/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94970,At:74990402,Raw:"[20:49:50.402] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-230.59,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25710666/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94974,At:74990499,Raw:"[20:49:50.499] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-230.04,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25710666/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94977,At:74990698,Raw:"[20:49:50.698] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-230.09,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25710666/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94987,At:74991008,Raw:"[20:49:51.008] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-229.88,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25702680/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94990,At:74991008,Raw:"[20:49:51.008] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-229.88,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25702680/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:94998,At:74991206,Raw:"[20:49:51.206] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-230.72,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25702680/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:95008,At:74991306,Raw:"[20:49:51.306] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-230.55,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25702680/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:95033,At:74991609,Raw:"[20:49:51.609] [Watchdog {4488524292161536}:35601000666259|(-10.00,-1.00,-230.16,18.80)|(1/54258512)] [Lady Dominique {4608014577303552}:35601000518900|(-39.90,-4.94,-215.45,-104.94)|(25691938/66281708)] [ {4598007303503872}] [ApplyEffect {836045448945477}:  {4598007303503872}]"})
    c.Records.Push({Line:95578,At:75005207,Raw:"[20:50:05.207] [Lady Dominique {4608014577303552}:35601000518900|(-39.08,-3.63,-215.45,44.99)|(24650992/66281708)] [=] [Deploy Attractor {4599635096109056}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:100975,At:75095986,Raw:"[20:51:35.986] [Lady Dominique {4608014577303552}:35601000518900|(-39.08,-3.63,-215.45,74.50)|(16500899/66281708)] [=] [Unify {4606249345744896}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:108766,At:75210845,Raw:"[20:53:30.845] [@Player15509#690172070915509|(-43.20,-4.91,-215.45,-107.46)|(422865/443782)] [Lady Dominique {4608014577303552}:35601000518900|(-39.08,-3.63,-215.45,166.99)|(0/66281708)] [Annihilate {808123866546176}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (48109* energy {836045448940874}) <48109.0>"})
    c.Records.Push({Line:108771,At:75210872,Raw:"[20:53:30.872] [@Player19000#689523785319000|(-42.63,-6.92,-215.45,-139.37)|(344987/439447)] [Lady Dominique {4608014577303552}:35601000518900|(-39.08,-3.63,-215.45,166.99)|(0/66281708)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (7823* internal {836045448940876}) <7823.0>"})
    cases.Push(c)
    c := {Boss:"TOS-RE",Name:"Revan",Start:54827459,End:55247831,Expected:[{Name:"Revan",Start:54827889,End:54888501},{Name:"HK 47",Start:54897710,End:54958394},{Name:"Focus",Start:54973292,End:55008979},{Name:"Revan 2",Start:55008979,End:55072110},{Name:"Shield",Start:55072110,End:55116632},{Name:"Revan 3",Start:55116632,End:55144744},{Name:"Core",Start:55146754,End:55247831}]},c.Records := []
    c.Records.Push({Line:71250,At:54827889,Raw:"[15:13:47.889] [@Player26958#690567767926958|(466.18,1060.63,273.23,145.20)|(441614/441614)] [Revan {3431605855059968}:7472001032437|(455.50,1076.00,273.23,-34.90)|(26554556/26578348)] [Halted Offensive  {4484383943688192}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23792 energy {836045448940874}) <23792.0>"})
    c.Records.Push({Line:74995,At:54888501,Raw:"[15:14:48.501] [Revan {3431605855059968}:7472001032437|(439.55,1067.00,273.25,63.01)|(17139990/26578348)] [=] [ {3447437104513024}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:75259,At:54897710,Raw:"[15:14:57.710] [@Player50033#690844210250033|(447.82,1072.53,273.24,9.76)|(442258/443426)] [HK-47 {3444310368321536}:7472001032640|(447.28,1067.02,273.24,-150.95)|(8069236/8101783)] [Burning {2020687623487746}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4579 ~4580 elemental {836045448940875}) <4579.0>"})
    c.Records.Push({Line:75260,At:54897710,Raw:"[15:14:57.710] [@Player50033#690844210250033|(447.82,1072.53,273.24,9.76)|(442258/443426)] [HK-47 {3444310368321536}:7472001032640|(447.28,1067.02,273.24,-150.95)|(8069236/8101783)] [Flaming Fist {3384704812187648}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (11710* elemental {836045448940875}) <11710.0>"})
    c.Records.Push({Line:78838,At:54958394,Raw:"[15:15:58.394] [HK-47 {3444310368321536}:7472001032640|(451.82,1070.93,273.23,17.57)|(0/22504952)] [=] [] [Event {836045448945472}: Death {836045448945493}]"})
    c.Records.Push({Line:79233,At:54973292,Raw:"[15:16:13.292] [@Player26958#690567767926958|(431.50,1061.10,293.00,171.54)|(434571/441614)] [Machine Focus {3440805675008000}:7472001097341|(446.80,1088.83,296.00,-60.00)|(552733/556574)] [Affliction {808192586022912}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3841 internal {836045448940876}) <3841.0>"})
    c.Records.Push({Line:79403,At:54980063,Raw:"[15:16:20.063] [@Player04910#690172071104910|(447.05,1066.49,296.05,-27.92)|(381832/438838)] [Machine Focus {3440805675008000}:7472001097455|(446.73,1063.34,296.00,-120.00)|(543594/556574)] [Rupture {3455541707800576}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (12481* energy {836045448940874}) <12481.0>"})
    c.Records.Push({Line:79683,At:54984658,Raw:"[15:16:24.658] [@Player50033#690844210250033|(469.82,1093.19,296.16,-78.31)|(409515/443426)] [Machine Focus {3440805675008000}:7472001097227|(491.23,1088.75,296.00,60.00)|(547116/556574)] [Incendiary Missile {2027022700249088}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9458* elemental {836045448940875}) <9458.0>"})
    c.Records.Push({Line:79717,At:54985331,Raw:"[15:16:25.331] [@Player26958#690567767926958|(467.16,1057.94,296.03,-114.66)|(363199/441614)] [Machine Focus {3440805675008000}:7472001097113|(491.21,1063.25,296.00,120.00)|(536987/556574)] [Lightning Flash {3401218961440768}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (19587 energy {836045448940874}) <19587.0>"})
    c.Records.Push({Line:80333,At:54996927,Raw:"[15:16:36.927] [@Player48053#686905360748053|(473.09,1092.66,296.16,-93.91)|(449583/473951)] [Machine Focus {3440805675008000}:7472001097227|(491.23,1088.75,296.00,60.00)|(0/403023)] [Rapid Shots {814282849648640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (701 energy {836045448940874}) <2102.0>"})
    c.Records.Push({Line:80577,At:55008979,Raw:"[15:16:48.979] [Revan {3431605855059968}:7472001032437|(428.92,1073.99,318.59,-95.93)|(17139990/26578348)] [=] [ {3447523003858944}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:84118,At:55072110,Raw:"[15:17:52.110] [Revan {3431605855059968}:7472001032437|(457.86,1086.96,296.33,107.65)|(7629878/26578348)] [=] [ {3447574543466496}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:85059,At:55116632,Raw:"[15:18:36.632] [Revan {3431605855059968}:7472001032437|(488.00,1076.00,320.06,130.15)|(7137990/26578348)] [=] [Resonance {3447578838433792}] [ApplyEffect {836045448945477}: Backlash {3447578838434092}]"})
    c.Records.Push({Line:86610,At:55144744,Raw:"[15:19:04.744] [Revan {3431605855059968}:7472001032437|(489.99,1068.49,320.04,-66.60)|(2412048/26578348)] [=] [ {3449060602150912}] [Event {836045448945472}: AbilityActivate {836045448945479}]"})
    c.Records.Push({Line:86711,At:55146754,Raw:"[15:19:06.754] [@Player26958#690567767926958|(493.16,1070.09,320.05,36.67)|(350806/437242)] [Machine Core {3447583133401088}:7472001032236|(469.00,1076.10,317.61,-270.00)|(12152673/12152673)] [Lightning Barrier {3968412342550528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -) <11139.0>"})
    c.Records.Push({Line:91813,At:55247831,Raw:"[15:20:47.831] [@Player52515#690567876552515|(479.43,1085.12,320.44,44.37)|(244655/244655)] [Machine Core {3447583133401088}:7472001032236|(469.00,1076.10,317.61,-270.00)|(0/22504952)] [Assassinate {2295741624090624}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15096 energy {836045448940874}) <45287.0>"})
    cases.Push(c)
    return cases
}

V74ModernParselyProfile(boss)
{
    p := IGPYModernProfiles()[boss][1],p.Names := Map()
    for phase in p.Phases
        p.Names[phase.Id] := phase.Name
    return p
}

V74ModernParselyCase(c)
{
    p := V74ModernParselyProfile(c.Boss)
    seg := {BossKey:c.Boss,AreaId:p.Area,ModeId:p.Mode,Start:c.Start,End:c.End,Last:c.End,PhaseProgress:Map()}
    for r in c.Records {
        ev := IPParseLine(r.Raw)
        V48Assert(IsObject(ev),"Original modern phase record parses: " c.Boss " line " r.Line)
        ev.RecordId := r.Line
        IGPYObserve(seg,ev,r.At,p)
    }
    state := seg.PhaseProgress.Get("Parsely","")
    V48Assert(IsObject(state),"Modern phase state exists: " c.Boss)
    V48Assert(state.Windows.Length=c.Expected.Length,"Exact Parsely phase count: " c.Boss)
    for i,expected in c.Expected {
        w := state.Windows[i],name := w.Name (w.Ordinal>1 ? " " w.Ordinal : "")
        V48Assert(name=expected.Name,"Exact Parsely label: " c.Boss " " expected.Name)
        V48Assert(w.Start=expected.Start,"Exact Parsely start: " c.Boss " " expected.Name " expected " expected.Start " got " w.Start)
        V48Assert((w.End<0 ? c.End : w.End)=expected.End,"Exact Parsely end: " c.Boss " " expected.Name " expected " expected.End " got " w.End)
        V48Assert(w.StartSeq>0,"Boundary retains original record order")
        if i>1
            V48Assert(state.Windows[i-1].End<=w.Start,"Gaps preserved without overlap")
    }
    V48Assert(!state.Limited,"Original fixture stays within bounded phase ledger")
    return state
}

V74ModernParselyScopes()
{
    n := 0
    for boss,profiles in IGPYModernProfiles() {
        p := profiles[1],seg := {BossKey:boss,AreaId:p.Area,ModeId:p.Mode},n += 1
        found := IGPYProfile(seg)
        V48Assert(IsObject(found) && found.Key=p.Key,"Modern profile registered: " boss)
        for mode in ["836045448953651","836045448953654","836045448953656","unknown"] {
            seg.ModeId := mode
            V48Assert(!IsObject(IGPYProfile(seg)),"Unverified size/difficulty has no modern profile: " boss)
        }
        seg.ModeId := p.Mode,seg.AreaId := "wrong"
        V48Assert(!IsObject(IGPYProfile(seg)),"NPC outside its exact raid cannot borrow phases")
    }
    V48Assert(n=11,"Six Dxun, four R-4 and Revan profiles")
}

V74ModernParselyCoreAndShield()
{
    c := V74ModernParselyCases()[11],p := V74ModernParselyProfile(c.Boss),core := "",shield := "",backlash := ""
    for r in c.Records {
        ev := IPParseLine(r.Raw)
        if ev.Kind="Damage" && IPBNpcId(ev.Target)="3447583133401088" && !IsObject(core)
            core := r
        if ev.Kind="Activate" && ev.AbilityId="3447574543466496"
            shield := r
        if ev.EffectId="3447578838434092"
            backlash := r
    }
    V48Assert(IsObject(core) && IPParseLine(core.Raw).Amount=0,"Actual Core boundary is zero damage")
    seg := {Start:c.Start,PhaseProgress:Map()},ev := IPParseLine(core.Raw),ev.RecordId := core.Line
    IGPYObserve(seg,ev,core.At,p)
    V48Assert(seg.PhaseProgress["Parsely"].Current="core","Exact zero hit starts Core")
    for field in ["source","target"] {
        seg := {Start:c.Start,PhaseProgress:Map()},bad := IPParseLine(core.Raw)
        if field="source"
            bad.Source.Kind := "NPC"
        else
            bad.Target := IPParseLine(c.Records[1].Raw).Target
        IGPYObserve(seg,bad,core.At,p)
        V48Assert(seg.PhaseProgress["Parsely"].Current!="core","Wrong " field " cannot start Core")
    }
    seg := {Start:c.Start,PhaseProgress:Map()}
    for r in c.Records {
        if r.At>shield.At
            break
        ev := IPParseLine(r.Raw),ev.RecordId := r.Line
        IGPYObserve(seg,ev,r.At,p)
    }
    V48Assert(seg.PhaseProgress["Parsely"].Current="shield","Shield marker reached")
    ev := IPParseLine(c.Records[1].Raw),ev.RecordId := shield.Line+1
    IGPYObserve(seg,ev,shield.At+1,p)
    V48Assert(seg.PhaseProgress["Parsely"].Current="shield","Positive damage does not end Shield")
    ev := IPParseLine(backlash.Raw),ev.RecordId := backlash.Line
    IGPYObserve(seg,ev,backlash.At,p)
    V48Assert(seg.PhaseProgress["Parsely"].Current="revan","Exact Backlash resumes Revan")
}

V74ModernParselyActorGuards()
{
    c := V74ModernParselyCases()[2],p := V74ModernParselyProfile(c.Boss)
    state := V74ModernParselyCase(c)
    V48Assert(state.Counts["warden"]=3,"Living Warden resumes after Pursuit, counted as third section")
    V48Assert(state.Counts["run"]=8,"Dead first Warden does not resume after Pursuit")
    c := V74ModernParselyCases()[4],p := V74ModernParselyProfile(c.Boss),seg := {Start:c.Start,PhaseProgress:Map()},last := ""
    for r in c.Records {
        ev := IPParseLine(r.Raw),ev.RecordId := r.Line
        if ev.Kind="Death" && IPBNpcId(ev.Target)="4245970309087232" {
            last := r
            continue
        }
        if IsObject(last)
            break
        IGPYObserve(seg,ev,r.At,p)
    }
    V48Assert(IsObject(last),"Last remaining Trandoshan Death fixture")
    V48Assert(seg.PhaseProgress["Parsely"].Current="trandoshans","Two remaining-boss deaths do not fabricate transition")
    ev := IPParseLine(last.Raw),ev.RecordId := last.Line
    IGPYObserve(seg,ev,last.At,p)
    V48Assert(seg.PhaseProgress["Parsely"].Current="","Last observed living boss death opens genuine gap")
}

V74ModernParselyMarkerGuards()
{
    c := V74ModernParselyCases()[8],p := V74ModernParselyProfile(c.Boss),marker := c.Records[1]
    for r in c.Records
        if IPParseLine(r.Raw).AbilityId="4472963625648128"
            marker := r
    for field in ["source","action","effect"] {
        seg := {Start:c.Start,PhaseProgress:Map()},ev := IPParseLine(c.Records[1].Raw),ev.RecordId := c.Records[1].Line
        IGPYObserve(seg,ev,c.Records[1].At,p)
        ev := IPParseLine(marker.Raw),ev.RecordId := marker.Line
        switch field {
            case "source": ev.Source.Kind := "Player",ev.Source.Key := "@wrong"
            case "action": ev.ActionId := "836045448945478"
            case "effect": ev.EffectId := "999999"
        }
        IGPYObserve(seg,ev,marker.At,p)
        V48Assert(seg.PhaseProgress["Parsely"].Current="watchdog","Wrong " field " cannot start Stalker Protocol")
    }
}

; Synthetic saved-history tests; no GUI, original log, audio or settings access.
V74PVEntry(ids,id := 1,boss := "G-SC",partial := false)
{
    p := IGPYGodsProfiles()[boss][1],counts := Map(),order := []
    for name in ids {
        counts[name] := counts.Get(name,0)+1
        order.Push({Id:name,Ordinal:counts[name]})
    }
    data := {Key:p.Key,Counts:[],Limited:false,Order:order}
    for def in p.Phases
        data.Counts.Push({Id:def.Id,Started:counts.Get(def.Id,0),Completed:0})
    q := {Profile:"old-internal-map",Phases:["Do not display old mechanics"],Stage:7,Hp:19,Kill:false,Partial:partial,Parsely:data}
    pull := {Id:id,TotalDeaths:0,Boss:boss,Area:p.Area,Mode:p.Mode,Group:boss "|" p.Area "|" p.Mode,
        Start:id*20000,End:id*20000+10000,Ended:true,Included:true,Partial:partial,Progress:q,Players:Map()}
    return {Key:"fixture" id,Date:"20261003",Session:"synthetic",Team:"A",Pull:pull}
}

V74PVNames(model)
{
    names := []
    for row in model.Rows
        names.Push(row.Name)
    return IGVJson(names)
}

V74PVSignature(entries)
{
    out := []
    for e in entries {
        q := e.Pull.Progress
        out.Push([e.Key,e.Pull.Group,e.Pull.Included,e.Pull.Partial,q.Profile,q.Stage,q.Hp,q.Kill,
            IGPYPack(IGPCGet(q,"Parsely"))])
    }
    return IGVJson(out)
}

V74PVRecordedOrder()
{
    a := V74PVEntry(["opd","catalysts","scyva","ignite","scyva","extinction"])
    b := V74PVEntry(["opd","catalysts","scyva","ignite","scyva","ignite","scyva","extinction"],2)
    entries := [a,b],before := V74PVSignature(entries),m := IGPYConsistency(entries,a.Pull.Group)
    V48Assert(V74PVNames(m)=IGVJson(["Omega Protocol Droid","Catalysts","Scyva","Ignite Core","Scyva 2","Ignite Core 2","Scyva 3","Extinction"]),"Repeated primary phases stay in actual chronological order")
    V48Assert(m.Rows[6].Reached=1 && m.Rows[6].Earlier=1 && m.Rows[6].Unknown=0,"Second Ignite counts only its observed occurrence")
    V48Assert(m.Rows[8].Reached=2 && m.Counters.Known=2,"Extinction aligns across different repeat counts")
    for row in m.Rows
        V48Assert(row.Reached+row.Earlier+row.Unknown=2 && row.Known=row.Reached+row.Earlier,"Transparent filtered denominator")
    V48Assert(before=V74PVSignature(entries),"Consistency never rewrites original progress/accounting/history")
}

V74PVPartialAndLegacy()
{
    a := V74PVEntry(["opd","catalysts","scyva","ignite","scyva","extinction"])
    b := V74PVEntry(["extinction"],2,"G-SC",true)
    old := V74PVEntry([],3),old.Pull.Progress.DeleteProp("Parsely"),old.Pull.Progress.Kill := true
    conflict := V74PVEntry(["extinction"],4),conflict.Conflict := "Recorders disagree"
    m := IGPYConsistency([a,b,old,conflict],a.Pull.Group)
    V48Assert(m.Counters.Known=2 && m.Counters.Unknown=2 && m.Counters.Partial=1 && m.Counters.Conflicts=1,"Partial old and conflicting capture evidence stays distinct")
    V48Assert(m.Rows[1].Reached=1 && m.Rows[1].Unknown=3,"Late observed Extinction does not fill unseen OPD")
    V48Assert(m.Rows[6].Reached=2 && m.Rows[6].Unknown=2,"Actual partial Extinction remains observed")
    V48Assert(m.Counters.Kills=1 && m.Rows[6].Reached=2,"Confirmed old kill does not invent phase evidence")
    empty := IGPYConsistency([],a.Pull.Group)
    V48Assert(empty.Rows.Length=5 && empty.Rows[1].Name="Omega Protocol Droid" && InStr(empty.Note,"No attempts"),"No orders uses one catalogue occurrence with useful empty state")
    unknown := IGPYConsistency([old],old.Pull.Group)
    for row in unknown.Rows
        V48Assert(row.Reached=0 && row.Unknown=1,"Old capture remains unknown on default phase list")
}

V74PVFiltersAndOrderConflict()
{
    a := V74PVEntry(["opd","catalysts","scyva","ignite","scyva","extinction"])
    b := V74PVEntry(["ignite","scyva"],2,"G-SC",true)
    m := IGPYConsistency([a,b],a.Pull.Group)
    V48Assert(m.Counters.OrderConflicts=1 && m.Counters.Known=1,"Incompatible partial occurrence order cannot redefine the shared chronology")
    for row in m.Rows
        V48Assert(row.Unknown=1,"Contradictory ordering stays unknown")
    blocked := IGPYConsistency([a],a.Pull.Group,{NeedsTeam:true,TeamPulls:12,AlternativeCaptures:3,Scope:"One team's attended attempts",Note:"Choose a team"})
    V48Assert(blocked.Blocked && blocked.Counters.Known=0 && blocked.Counters.TeamPulls=12 && blocked.Counters.AlternativeCaptures=3,"Team and capture resolution eligibility retained")
    V48Assert(blocked.Scope="One team's attended attempts" && blocked.Note="Choose a team","Scope and attendance description retained")
    a.Pull.Included := false
    V48Assert(IGPYConsistency([a],a.Pull.Group).Counters.Unknown=1,"Excluded pull contributes no phase evidence")
    a.Pull.Included := true,a.Pull.Ended := false
    V48Assert(IGPYConsistency([a],a.Pull.Group).Counters.Unknown=1,"Unfinished pull contributes no saved-history evidence")
    a.Pull.Ended := true,a.Pull.Group := "wrong"
    V48Assert(IGPYConsistency([a],"G-SC|833571547775765|836045448953655").Counters.Unknown=1,"Wrong encounter cannot populate selected phase counts")
}

V74PVMergePrefixAndValidate()
{
    partial := V74PVEntry(["scyva","ignite","scyva","ignite","scyva","ignite","scyva","extinction"],1,"G-SC",true)
    complete := V74PVEntry(["opd","catalysts","scyva","ignite","scyva","extinction"],2)
    m := IGPYConsistency([partial,complete],complete.Pull.Group)
    V48Assert(m.Rows.Length=10 && m.Rows[1].Name="Omega Protocol Droid" && m.Rows[2].Name="Catalysts" && m.Rows[9].Name="Scyva 4","Missing earlier tokens merge before observed body anchors")
    V48Assert(m.Rows[1].Reached=1 && m.Rows[1].Unknown=1,"Partial prefix is not filled in after order merge")
    complete.Pull.Progress.Parsely.Order[1].Ordinal := 2
    V48Assert(IGPYConsistency([complete],complete.Pull.Group).Counters.Known=0,"Invalid ordinal sequence is not accepted")
    complete := V74PVEntry(["opd"],3),complete.Pull.Progress.Parsely.Counts[1].Started := 2
    V48Assert(IGPYConsistency([complete],complete.Pull.Group).Counters.Known=0,"Counts cannot invent a missing order occurrence")
    complete := V74PVEntry(["opd"],3),complete.Pull.Progress.Parsely.Key := "future"
    V48Assert(IGPYConsistency([complete],complete.Pull.Group).Counters.Known=0,"Incompatible profile versions remain unknown")
}

V74PVPhaseGraph()
{
    a := V74PVEntry(["magma"],1,"G-TY"),b := V74PVEntry(["magma","tyth"],2,"G-TY")
    c := V74PVEntry(["magma","tyth","burn"],3,"G-TY"),c.Pull.Progress.Kill := true
    old := V74PVEntry([],4,"G-TY"),old.Pull.Progress.DeleteProp("Parsely"),old.Pull.Progress.Kill := true
    rows := [a,b,c,old],before := V74PVSignature(rows),m := IGPYGraphModel(rows,1000,380,1,a.Pull.Group)
    V48Assert(m.Axis.Kind="parsely" && !m.Axis.Percent && IGVJson(m.Phases)=IGVJson(["Magma","Tyth","Burn"]),"Tyth graph shows actual primary phases, not inversion/rage mechanics")
    V48Assert(m.Points[1].Y=m.YTicks[1].Y && m.Points[2].Y=m.YTicks[2].Y,"Points occupy named phases without invented within-phase HP")
    V48Assert(m.Points[3].Kill && m.Points[3].Y=m.Bottom && m.Points[4].Known && m.Points[4].Kill && m.Points[4].Y=m.Bottom,"Both confirmed kills plot independently of whether phase history exists")
    V48Assert(m.Unknown=0 && m.MappingMismatch=0 && m.BestIndex=3,"Confirmed old kill ties the first kill without becoming an unknown phase point")
    a.Pull.Progress.Hp := 1,m2 := IGPYGraphModel(rows,1000,380,1,a.Pull.Group)
    V48Assert(m2.Points[1].Y=m.Points[1].Y,"Old arbitrary HP cannot change the new phase-only graph position")
    a.Pull.Progress.Hp := 19
    V48Assert(before=V74PVSignature(rows),"Graph never changes stored progress, kill status or history")
    c.Conflict := "Recorder conflict",m3 := IGPYGraphModel(rows,1000,380,1,a.Pull.Group)
    V48Assert(!m3.Points[3].Known && !m3.Points[3].Kill,"Recorder conflict cannot become a green kill point")
}

V74PVIntegratedViews()
{
    a := V74PVEntry(["opd","catalysts","scyva","ignite","scyva","extinction"])
    b := V74PVEntry(["opd","catalysts","scyva","ignite","scyva","ignite","scyva"],2)
    rows := [a,b],before := V74PVSignature(rows),m := IGVPlotModel(rows,1000,380,1,a.Pull.Group)
    V48Assert(m.Axis.Percent && !m.Points[1].Known && !m.Points[2].Known,"production HP graph leaves gaps when captures contain phases without boss HP")
    V48Assert(m.BestIndex=0 && IGVEntryScore(a,m,1)<0 && IGVEntryScore(b,m,2)<0,"phase order does not invent a best-health pull")
    V48Assert(IGPCBuild(rows,a.Pull.Group).Rows[8].Name="Extinction","production consistency wrapper shares the same repeated phase order")
    V48Assert(IGLEntryProgressLabel(a)="Boss HP unavailable" && InStr(IGVPointLabel(a,1),"Extinction") && !InStr(IGVPointLabel(a,1),"old mechanics"),"progression row and point labels do not leak old mechanic names")
    V48Assert(m.Axis.Title="Boss HP remaining (%)" && InStr(IGVPointLabel(b,2),"Scyva 3"),"HP graph keeps the actual repeated primary phase in hover details")
    V48Assert(before=V74PVSignature(rows),"integrated views preserve all original history fields")
}

V74PVHealthFallback()
{
    a := V74PVEntry([],1),a.Pull.Boss := "NO-PHASE-FIXTURE",a.Pull.Group := "NO-PHASE-FIXTURE|area|mode"
    q := a.Pull.Progress,q.Profile := "hp-only-v1",q.Expected := 1,q.Comparable := true,q.Hp := 34.5
    b := IPRCloneSnapshot(a),b.Key := "ordinal",b.Pull.Start += 20000,b.Pull.Progress.Profile := "old-ordinal-profile"
    b.Pull.Progress.Phases := ["Do not show add phase"],b.Pull.Progress.Hp := 1
    c := IPRCloneSnapshot(b),c.Key := "kill",c.Pull.Start += 20000,c.Pull.Progress.Kill := true
    m := IGVPlotModel([a,b,c],1000,380,1,a.Pull.Group)
    V48Assert(m.Axis.Kind="hp" && m.Axis.Percent && m.Phases.Length=1,"encounter without a Parsely catalogue uses only boss health")
    V48Assert(m.Points[1].Known && !m.Points[2].Known && m.Points[3].Kill,"real single-boss health remains usable, old add-phase health stays unknown, actual kill stays confirmed")
    V48Assert(m.Unknown=1 && m.BestIndex=3 && Abs(m.Points[1].Y-(m.Top+0.655*(m.Bottom-m.Top)))<0.001,"fallback uses actual health positions and compatible kill ordering")
    V48Assert(IGLEntryProgressLabel(a)="34.5% boss HP remaining" && InStr(IGVPointLabel(b,2),"Boss HP unavailable"),"all fallback labels suppress stale mechanic names")
    V48Assert(!IGPCBuild([a,b,c],a.Pull.Group).Supported,"no primary phase catalogue does not revive old mechanic consistency")
    q.Expected := 2
    V48Assert(!IGVPlotModel([a],1000,380,1,a.Pull.Group).Points[1].Known,"one target from an old multi-boss HP snapshot cannot stand in for the encounter")
    q.Profile := IGPSistersKey()
    V48Assert(IGVPlotModel([a],1000,380,1,a.Pull.Group).Axis.Kind="combined","verified weighted Sisters health remains distinct when no primary profile applies")
    q.Hp := -1
    V48Assert(!IGVPlotModel([a],1000,380,1,a.Pull.Group).Points[1].Known,"unknown health never becomes zero percent")
}

V74PVNewImportHealth()
{
    seg := V72PhaseSegment("DF-DR"),seg.Required := ["boss"],seg.Partial := false
    V48Assert(!IsObject(IGPYProfile(seg)) && IGPProfile(seg).Kind="HP","Draxus with no Parsely phase menu uses main-boss health on new imports")
    IGPObserve(seg,V63Event("Damage","3303392491339776",72,1000,"900000000000001",true),1000)
    IGPObserve(seg,V63Event("Damage","3281320654405632",1,2000,"900000000000001",true),2000)
    IGPObserve(seg,V63Event("Damage","3303392491339776",41,3000,"900000000000001",true),3000)
    q := IGPCompact(seg)
    V48Assert(q.Profile="hp-only-v1" && q.Expected=1 && q.Targets.Length=1 && q.Hp=41,"Draxus add health cannot replace recorded main-boss HP")
    p := IPRCompact(seg),e := {Key:"new",Date:"20261003",Session:"synthetic",Team:"A",Pull:p}
    old := IPRCloneSnapshot(e),old.Key := "old",old.Pull.Progress.Profile := "draxus-waves-old",old.Pull.Progress.Hp := 1
    old.Pull.Progress.DeleteProp("Health") ; Synthetic old capture predates whole-boss health.
    old.Pull.Progress.Phases := ["Old add phase"],old.Pull.Start += 20000,old.Pull.End += 20000
    m := IGVPlotModel([old,e],1000,380,1,p.Group)
    V48Assert(m.Axis.Kind="hp" && m.Unknown=1 && m.Points[2].Known && m.BestIndex=2,"fresh main-boss HP fixes the graph while old ordinal snapshots stay unknown")
    V48Assert(IGLEntryProgressLabel(e)="41.0% boss HP remaining" && !IGPCBuild([e],p.Group).Supported,"Draxus primary views keep boss health without invented phases")
}

; Isolated image diagnostics. Synthetic observations are labelled in every PNG.
V74RIFixture(boss := "G-IZ")
{
    entries := [],history := Map()
    stages := boss="EC-KE" ? [1,2,3,3,2,4,5,4,6,5,6,7,8,7,8,9,8,9,10,9,10,10,10,10]
        : [1,1,2,1,2,2,2,3,2,3,4,3,4,4,5,4,5,6,5,5,6,7,7,7]
    for i,stage in stages {
        seg := V72PhaseSegment(boss),seg.Id := i,seg.Start := i*600000
        seg.Last := seg.Start+450000,seg.End := seg.Last,seg.Partial := false
        IGPAdvance(seg,Min(stage,IGPProfile(seg).Phases.Length),seg.Start,"Synthetic image observation")
        pull := IPRCompact(seg),pull.Name := IGPProfile(seg).Name
        pull.Progress.Hp := 84-Mod(i*17,69),pull.Progress.Comparable := true
        pull.Progress.Health := IGVDemoHealth(pull,84-Mod(i*17,69),[boss="EC-KE" ? "2876528576692224" : "4108097563918336"])
        V74RIPrimary(pull,stage)
        entry := {Key:"image-demo|" boss "|" i,Date:"20261003",Session:"image-demo",Team:"Raid team",Pull:pull}
        entries.Push(entry),history[entry.Key] := entry
    }
    entries[7].Pull.Progress.Profile := "hp-only-v1",entries[7].Pull.Progress.Phases := ["HP only"]
    entries[7].Pull.Progress.DeleteProp("Parsely")
    entries[7].Pull.Progress.Health.Comparable := false
    entries[12].Pull.Partial := true,entries[12].Pull.Progress.Partial := true
    entries[entries.Length].Pull.Progress.Kill := true
    view := {Boss:entries[1].Pull.Group,Team:"Raid team",Window:"all",Cycle:"",Character:"",Source:"history",DemoHistory:true,History:history}
    return {Entries:entries,View:view}
}

V74RIPrimary(pull,stage)
{
    p := IGPYViewProfile(pull.Group),ids := [],counts := Map(),order := []
    for def in p.Phases
        ids.Push(def.Id)
    if pull.Boss="EC-KE"
        ids := ["siege-droids","walker","trandoshans","walker","pulsar-droids","walker","kephess","walker","kephess","burn"]
    Loop Min(stage,ids.Length) {
        id := ids[A_Index],counts[id] := counts.Get(id,0)+1
        order.Push({Id:id,Ordinal:counts[id]})
    }
    data := {Key:p.Key,Counts:[],Order:order,Limited:false}
    for def in p.Phases
        data.Counts.Push({Id:def.Id,Started:counts.Get(def.Id,0),Completed:0})
    pull.Progress.Parsely := data
}

V74RIBitmap(bitmap)
{
    info := Buffer(A_PtrSize=8 ? 32 : 24,0)
    if !DllCall("Gdi32\GetObjectW","Ptr",bitmap,"Int",info.Size,"Ptr",info)
        throw Error("Expected a live native report bitmap")
    return {W:NumGet(info,4,"Int"),H:NumGet(info,8,"Int"),Stride:NumGet(info,12,"Int"),
        Bpp:NumGet(info,18,"UShort"),Bits:NumGet(info,A_PtrSize=8 ? 24 : 20,"Ptr")}
}

V74RIResolution()
{
    f := V74RIFixture(),m := ISRIBuild(f.Entries,f.View),image := ISRIRender(m)
    try {
        b := V74RIBitmap(image.Bitmap),l := m.Layout
        V48Assert(image.W=2400 && image.H=m.Height*2 && b.W=image.W && b.H=image.H,"PNG renders two physical pixels per layout pixel")
        V48Assert(b.Bpp=24 && b.Bits,"export remains an opaque native24bit bitmap")
        V48Assert(m.Attempts=24 && m.Kills=1 && m.Unknown=1 && m.BestIndex=24,"rendering preserves the actual filtered fixture counts and gap")
        V48Assert(l.PhaseY+l.PhaseH<l.GraphY && l.GraphY+l.GraphH<l.RunY
            && l.RunY+l.RunH<l.FooterY && l.FooterY+l.FooterH<=l.H,"all report blocks and optional final notes fit their allocated regions")
        V48Assert(InStr(m.Title,"SYNTHETIC DEMO"),"synthetic preview cannot be mistaken for recorded raid performance")
    }
    finally DllCall("Gdi32\DeleteObject","Ptr",image.Bitmap)
}

V74RITextQuality()
{
    V48Assert(ISRILabel("Raid | phase: note – extra")="Raid, phase: note, extra","export labels normalize separators while retaining meaningful colons")
    V48Assert(ISRILabel("20:15:03 | 12.5%")="20:15:03, 12.5%","timestamp punctuation and decimal health survive label normalization")
    p := ISRICanvas(500,160)
    try {
        ISRIGraphics(p,2)
        DllCall("Gdiplus\GdipGraphicsClear","Ptr",p.Graphics,"UInt",0xFFFFFFFF)
        ISRIText(p,"Raid report",8,8,230,60,26,"000000",true)
        ISRIFlushText(p)
        b := V74RIBitmap(p.Bitmap),edges := 0,ink := 0,fringes := 0
        Loop 100 {
            y := A_Index-1
            Loop 380 {
                pixel := b.Bits+y*b.Stride+(A_Index-1)*3
                blue := NumGet(pixel,0,"UChar"),green := NumGet(pixel,1,"UChar"),red := NumGet(pixel,2,"UChar")
                if blue!=green || green!=red
                    fringes += 1
                if red>0 && red<255
                    edges += 1
                if red=0
                    ink += 1
            }
        }
        V48Assert(edges>150 && ink>150,"native glyphs contain antialiased edges and solid strokes")
        V48Assert(fringes=0,"black report text uses grayscale antialiasing without ClearType color fringes")
    }
    finally ISRICanvasClose(p)
}

V74RILongLayout()
{
    f := V74RIFixture("EC-KE"),m := ISRIBuild(f.Entries,f.View)
    shown := 0,previous := -1000
    for tick in m.Plot.YTicks {
        if tick.Label=""
            continue
        V48Assert(tick.Y-previous>=24,"percentage-axis labels remain nonoverlapping in a report with repeated phases")
        previous := tick.Y,shown += 1
    }
    V48Assert(shown=5 && m.Plot.YTicks[1].Label="100%" && m.Plot.YTicks[5].Label="0%","report graph retains a fixed full HP scale")
    V48Assert(m.Phase.Rows.Length=10 && m.Phase.Rows[4].Name="Walker 2" && m.Phase.Rows[10].Name="Burn","all ten observed Kephess sections remain available in the phase table")
    ; Stress actual table layout, independently of phase counting semantics.
    Loop 100 {
        row := m.Phase.Rows[1].Clone(),row.Name := "Recorded repeating section " A_Index
        m.Phase.Rows.Push(row)
    }
    m.ShowDetails := true,m.Layout := ISRILayout(m),m.Height := m.Layout.H,image := ISRIRender(m)
    try V48Assert(image.H>4096 && image.H<=16384 && V74RIBitmap(image.Bitmap).Bpp=24,"long reports retain every row beyond the old4096pixel cap")
    finally DllCall("Gdi32\DeleteObject","Ptr",image.Bitmap)
}

V74RIScaleAndResources()
{
    f := V74RIFixture(),m := ISRIBuild(f.Entries,f.View)
    process := DllCall("GetCurrentProcess","Ptr"),before := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    Loop 4 {
        image := ISRIRender(m),scaled := 0
        try {
            scaled := ISRIScale(image,900,Round(image.H*900/image.W)),b := V74RIBitmap(scaled)
            V48Assert(b.W=900 && b.H=Round(m.Height*0.75) && b.Bpp=24,"smooth preview preserves resolution and aspect ratio")
        }
        finally {
            if scaled
                DllCall("Gdi32\DeleteObject","Ptr",scaled)
            DllCall("Gdi32\DeleteObject","Ptr",image.Bitmap)
        }
    }
    after := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    V48Assert(after<=before+2,"render and rescale release every owned native graphic resource")
}

V74RIPngEncoding()
{
    f := V74RIFixture(),m := ISRIBuild(f.Entries,f.View),image := ISRIRender(m)
    path := A_Temp "\IrisV74PNG_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount ".png"
    token := 0,decoded := 0,lib := 0
    try {
        ISRIWritePng(image.Bitmap,path)
        lib := DllCall("LoadLibraryW","WStr","gdiplus.dll","Ptr")
        input := Buffer(A_PtrSize=8 ? 24 : 16,0),NumPut("UInt",1,input)
        V48Assert(DllCall("Gdiplus\GdiplusStartup","Ptr*",&token,"Ptr",input,"Ptr",0)=0,"independent native PNG decoder starts")
        V48Assert(DllCall("Gdiplus\GdipLoadImageFromFile","WStr",path,"Ptr*",&decoded)=0,"saved full-resolution file decodes as a PNG")
        w := 0,h := 0,pixel := 0
        DllCall("Gdiplus\GdipGetImageWidth","Ptr",decoded,"UInt*",&w),DllCall("Gdiplus\GdipGetImageHeight","Ptr",decoded,"UInt*",&h)
        DllCall("Gdiplus\GdipBitmapGetPixel","Ptr",decoded,"Int",1,"Int",1,"UInt*",&pixel)
        V48Assert(w=2400 && h=m.Height*2 && pixel=0xFF000000,"PNG retains physical resolution and the opaque black background")
        V48Assert(FileGetSize(path)>10000,"saved PNG contains a full report rather than an empty canvas")
    }
    finally {
        if decoded
            DllCall("Gdiplus\GdipDisposeImage","Ptr",decoded)
        if token
            DllCall("Gdiplus\GdiplusShutdown","Ptr",token)
        if lib
            DllCall("FreeLibrary","Ptr",lib)
        DllCall("Gdi32\DeleteObject","Ptr",image.Bitmap)
        if FileExist(path)
            FileDelete(path)
    }
}

; Site-confirmed Ravagers 8 Story phase boundaries. Other modes unverified.
; Original May24 log, report1308113 /13 and /19; raw IDs/time retained,
; player tokens anonymized. No files or live app used by these embedded tests.
V74RavParsely01()
{
    V74RavParselyCase(V74RavParselyCases()[1])
}
V74RavParsely02()
{
    V74RavParselyCase(V74RavParselyCases()[2])
}
V74RavParselyProfile(boss)
{
    p := IGPYOtherProfiles()[boss][1],p.Names := Map()
    for def in p.Phases
        p.Names[def.Id] := def.Name
    return p
}
V74RavParselyCase(c)
{
    p := V74RavParselyProfile(c.Boss),seg := {Start:c.Start,End:c.End,PhaseProgress:Map()}
    for r in c.Records {
        ev := IPParseLine(r.Raw),ev.RecordId := r.Line
        V48Assert(IsObject(ev),"Original Ravagers phase row parses")
        IGPYObserve(seg,ev,r.At,p)
        if c.Boss="RAV-CR" && r.At>=c.Expected[1].End && r.At<c.Expected[2].Start && ev.Kind!="Damage" {
            state := seg.PhaseProgress["Parsely"]
            V48Assert(state.Current="" && state.Windows.Length=1,"Coratanni leaves a real unnamed travel gap")
        }
    }
    state := seg.PhaseProgress["Parsely"]
    V48Assert(state.Windows.Length=c.Expected.Length,"Exact Ravagers phase count")
    for i,exp in c.Expected {
        w := state.Windows[i]
        V48Assert(w.Name=exp.Name,"Exact site phase name " exp.Name)
        V48Assert(w.Start=exp.Start,"Exact site phase start " exp.Name)
        V48Assert((w.End<0 ? c.End : w.End)=exp.End,"Exact site phase end " exp.Name)
    }
    V48Assert(!state.Limited,"Ravagers phase ledger bounded")
}
V74RavParselyScopeAndGap()
{
    for boss,profiles in IGPYOtherProfiles() {
        p := profiles[1],seg := {BossKey:boss,AreaId:p.Area,ModeId:p.Mode}
        V48Assert(p.Area="3367421863788544" && p.Mode="836045448953651","Evidence limited to Ravagers 8 Story")
        V48Assert(IsObject(IGPYProfile(seg)),"Ravagers Story phase profile installed")
        for mode in ["836045448953652","836045448953655","836045448953656"] {
            seg.ModeId := mode
            V48Assert(!IsObject(IGPYProfile(seg)),"Story phase rules cannot silently claim another difficulty")
        }
    }
    c := V74RavParselyCases()[2],p := V74RavParselyProfile("RAV-CR"),seg := {Start:c.Start,PhaseProgress:Map()},hit := ""
    for r in c.Records {
        if r.At>c.Expected[1].End
            break
        ev := IPParseLine(r.Raw),ev.RecordId := r.Line
        if ev.Kind="Damage" && !IsObject(hit)
            hit := ev
        IGPYObserve(seg,ev,r.At,p)
    }
    V48Assert(seg.PhaseProgress["Parsely"].Current="","Pearl death closes Coratanni")
    ev := hit.Clone(),ev.RecordId := 900000
    IGPYObserve(seg,ev,c.Expected[1].End+1,p)
    state := seg.PhaseProgress["Parsely"]
    V48Assert(state.Current="" && state.Windows.Length=1,"Lingering post-death damage cannot reopen Coratanni")
}
V74RavParselyCases()
{
    return [
        {Boss:"RAV-MB",Name:"Master and Blaster",Start:19151223,End:19289721,Expected:[{Name:"Blaster",Start:19161223,End:19196204},{Name:"Master and Blaster",Start:19196204,End:19252015},{Name:"Burn",Start:19252015,End:19289721}],Records:[
            {Line:22414,At:19161223,Raw:"[05:19:21.223] [@Recorded Player#1|(909.09,-225.07,496.76,-144.41)|(442873/443752)] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-63.87)|(11370983/11406619)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13482* energy {836045448940874}) <13482.0>"}
            ,{Line:22415,At:19161273,Raw:"[05:19:21.273] [@Recorded Player#1|(917.89,-223.85,496.76,113.82)|(498076/498076)] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-64.04)|(11370983/11406619)] [Spike {808312845107200}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15763* energy {836045448940874}) <47288.0>"}
            ,{Line:22416,At:19161490,Raw:"[05:19:21.490] [@Recorded Player#1|(905.79,-225.83,496.76,-127.25)|(443782/443782)] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-64.04)|(11370983/11406619)] [Jet Charge {814257079844864}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6391 kinetic {836045448940873}) <6391.0>"}
            ,{Line:24043,At:19196204,Raw:"[05:19:56.204] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.77)|(5990273/11406619)] [=] [Calling The Boss {3413408078626816}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:24044,At:19196204,Raw:"[05:19:56.204] [@Recorded Player#1|(906.40,-223.16,496.76,-111.13)|(391641/391641)] [=] [Phantom Stride {3584300532367360}] [RemoveEffect {836045448945478}: Phantom Stride {3584300532367360}]"}
            ,{Line:24045,At:19196204,Raw:"[05:19:56.204] [@Recorded Player#1|(886.35,-240.45,496.75,-127.17)|(374617/433567)] [=] [Tracer Lock {994022936018944}] [ApplyEffect {836045448945477}: Tracer Lock {994022936018944}] (1 charges {836045448953667})"}
            ,{Line:24200,At:19200312,Raw:"[05:20:00.312] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.77)|(5356537/11406619)] [=] [Calling The Boss {3413408078626816}] [ApplyEffect {836045448945477}: Calling The Boss {3413408078626816}]"}
            ,{Line:24325,At:19204117,Raw:"[05:20:04.117] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-52.48)|(5339321/11406619)] [=] [Calling The Boss {3413408078626816}] [RemoveEffect {836045448945478}: Calling The Boss {3413408078626816}]"}
            ,{Line:24423,At:19206411,Raw:"[05:20:06.411] [BO-55 Master Droid {3391100018491392}:151759000190655|(911.98,-239.01,496.74,-180.00)|(528713/528713)] [@Recorded Player#1|(908.45,-237.65,496.75,-156.52)|(284513/410547)] [Overpowered Charge Arm {3397705678192640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (53966 energy {836045448940874}) <53966.0>"}
            ,{Line:24524,At:19208611,Raw:"[05:20:08.611] [@Recorded Player#1|(909.65,-233.11,496.75,-24.62)|(388812/443752)] [BO-55 Master Droid {3391100018491392}:151759000190655|(911.98,-239.01,496.74,-180.00)|(525388/528713)] [Force Scream {998270658674688}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (33252* ~3325 kinetic {836045448940873} (29927 absorbed {836045448945511})) <33252.0>"}
            ,{Line:24560,At:19209117,Raw:"[05:20:09.117] [BO-55 Master Droid {3391100018491392}:151759000190655|(912.41,-237.90,496.75,-158.64)|(525388/528713)] [@Recorded Player#1|(917.43,-225.15,496.76,127.42)|(498076/498076)] [Overpowered Charge Arm {3397705678192640}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (9076 energy {836045448940874} -shield {836045448945509} (50990 absorbed {836045448945511})) <9076.0>"}
            ,{Line:26260,At:19242015,Raw:"[05:20:42.015] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-52.66)|(2687485/11406619)] [=] [ {3427761859330048}] [ApplyEffect {836045448945477}: Blast Shield {3427761859330304}]"}
            ,{Line:26453,At:19247019,Raw:"[05:20:47.019] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.70)|(2687485/11406619)] [=] [Rejiggering {3486259313901568}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:26568,At:19251118,Raw:"[05:20:51.118] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.70)|(2687485/11406619)] [=] [Rejiggering {3486259313901568}] [ApplyEffect {836045448945477}: Rejiggered {3486259313901846}]"}
            ,{Line:26584,At:19252015,Raw:"[05:20:52.015] [@Recorded Player#1|(897.53,-224.72,496.76,-89.66)|(353384/410547)] [@Recorded Player#1|(907.73,-224.60,496.76,-136.01)|(443782/443782)] [Resurgence {3412162538110976}] [ApplyEffect {836045448945477}: Heal {836045448945500}] (7825* ~0)"}
            ,{Line:26585,At:19252015,Raw:"[05:20:52.015] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.70)|(2687485/11406619)] [=] [ {3427761859330048}] [RemoveEffect {836045448945478}: Blast Shield {3427761859330304}]"}
            ,{Line:28072,At:19278838,Raw:"[05:21:18.838] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.70)|(1118104/11406619)] [Incendiary Mortar {3426112591888384}:151759000211791|(860.75,-208.00,496.77,-180.00)|(0/52138)] [] [Event {836045448945472}: Death {836045448945493}]"}
            ,{Line:28073,At:19278838,Raw:"[05:21:18.838] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.70)|(1118104/11406619)] [Incendiary Mortar {3426112591888384}:151759000211707|(956.50,-254.25,496.74,-180.00)|(0/52138)] [] [Event {836045448945472}: Death {836045448945493}]"}
            ,{Line:28295,At:19285536,Raw:"[05:21:25.536] [@Recorded Player#1|(900.41,-261.31,496.73,28.70)|(325287/405076)] [BO-55 Master Droid {3391100018491392}:151759000190655|(928.52,-210.28,650.92,51.54)|(52823/528713)] [Corrosive Dart {3465720780292096}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3533 ~0 internal {836045448940876} (3533 absorbed {836045448945511})) <3533.0>"}
            ,{Line:28302,At:19285637,Raw:"[05:21:25.637] [@Recorded Player#1|(900.41,-261.31,496.73,28.70)|(325287/405076)] [BO-55 Master Droid {3391100018491392}:151759000190655|(928.92,-209.67,651.58,52.91)|(52823/528713)] [Electrified Railgun {2302776780521472}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (3002* ~0 elemental {836045448940875} (3002 absorbed {836045448945511})) <3002.0>"}
            ,{Line:28312,At:19285834,Raw:"[05:21:25.834] [@Recorded Player#1|(882.55,-256.16,498.09,60.49)|(291074/443782)] [BO-55 Master Droid {3391100018491392}:151759000190655|(929.71,-208.47,651.75,39.91)|(52823/528713)] [Burning (Incendiary Missile) {2027022700249344}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (8191* ~0 elemental {836045448940875} (8191 absorbed {836045448945511})) <8191.0>"}
            ,{Line:28372,At:19288937,Raw:"[05:21:28.937] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.70)|(1118104/11406619)] [@Recorded Player#1|(892.98,-259.81,496.73,-150.31)|(288460/443752)] [ {3391331946725376}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (70462 elemental {836045448940875}) <70462.0>"}
            ,{Line:28374,At:19288938,Raw:"[05:21:28.938] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.70)|(1118104/11406619)] [@Recorded Player#1|(876.76,-248.78,496.74,-126.43)|(232942/443782)] [ {3391331946725376}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (73040 elemental {836045448940875}) <73040.0>"}
            ,{Line:28375,At:19288938,Raw:"[05:21:28.938] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.70)|(1118104/11406619)] [@Recorded Player#1|(892.85,-262.65,496.73,-146.22)|(133149/391641)] [ {3391331946725376}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (59807 elemental {836045448940875}) <59807.0>"}
            ,{Line:28412,At:19289716,Raw:"[05:21:29.716] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.70)|(0/15414350)] [=] [Rejiggering {3486259313901568}] [RemoveEffect {836045448945478}: Rejiggered {3486259313901846}]"}
            ,{Line:28433,At:19289721,Raw:"[05:21:29.721] [@Recorded Player#1|(912.41,-221.00,496.76,-53.13)|(415209/498076)] [Blaster {3391095723524096}:151759000172703|(912.00,-221.00,496.76,-58.70)|(0/15414350)] [] [Event {836045448945472}: Death {836045448945493}]"}
            ,{Line:28434,At:19289721,Raw:"[05:21:29.721] [@Recorded Player#1|(882.15,-265.68,496.73,-118.56)|(387152/433567)] [=] [Rapid Scan {3394085020762112}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
        ]}
        ,{Boss:"RAV-CR",Name:"Coratanni / Ruugar",Start:19576709,End:19779639,Expected:[{Name:"Coratanni",Start:19586709,End:19654602},{Name:"Ruugar",Start:19677534,End:19779639}],Records:[
            {Line:34549,At:19586709,Raw:"[05:26:26.709] [@Recorded Player#1|(1335.68,-96.58,380.47,15.93)|(443782/443782)] [Pearl {3374109127868416}:151759000226373|(1334.47,-100.93,380.45,-181.58)|(5539231/5549166)] [Jet Charge {814257079844864}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4384 kinetic {836045448940873}) <4384.0>"}
            ,{Line:34553,At:19587362,Raw:"[05:26:27.362] [@Recorded Player#1|(1334.40,-98.25,380.47,-1.44)|(443752/443752)] [Pearl {3374109127868416}:151759000226373|(1334.47,-100.93,380.45,-181.58)|(5539231/5549166)] [Force Charge {807750204391424}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5552 energy {836045448940874}) <5552.0>"}
            ,{Line:34572,At:19588184,Raw:"[05:26:28.184] [@Recorded Player#1|(1335.21,-98.35,380.47,9.63)|(425535/443782)] [Pearl {3374109127868416}:151759000226373|(1334.47,-100.93,380.45,111.12)|(5520959/5549166)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6708* elemental {836045448940875}) <6708.0>"}
            ,{Line:34575,At:19588459,Raw:"[05:26:28.459] [Coratanni {3371437658210304}:151759000226490|(1330.06,-101.23,380.45,-119.31)|(5549166/5549166)] [@Recorded Player#1|(1335.21,-98.35,380.47,9.63)|(425535/443782)] [Ranged Attack {3372232227160064}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -dodge {836045448945505}) <1.0>"}
            ,{Line:34614,At:19589458,Raw:"[05:26:29.458] [@Recorded Player#1|(1335.44,-68.46,380.49,9.32)|(388640/388640)] [Coratanni {3371437658210304}:151759000226490|(1330.06,-101.23,380.45,106.13)|(5533509/5549166)] [Lightning Flash {3401218961440768}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (15657 energy {836045448940874}) <15657.0>"}
            ,{Line:34634,At:19589763,Raw:"[05:26:29.763] [Coratanni {3371437658210304}:151759000226490|(1330.06,-101.23,380.45,100.04)|(5529474/5549166)] [@Recorded Player#1|(1325.72,-100.51,380.50,-101.15)|(467944/498076)] [Ranged Attack {3372232227160064}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -deflect {836045448945508}) <1.0>"}
            ,{Line:37281,At:19634290,Raw:"[05:27:14.290] [Coratanni {3371437658210304}:151759000226490|(1330.99,-95.63,380.47,55.68)|(973442/5549166)] [=] [ {2068675293085696}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:37352,At:19635071,Raw:"[05:27:15.071] [@Recorded Player#1|(1328.87,-98.35,380.47,146.19)|(318321/443752)] [Coratanni {3371437658210304}:151759000226490|(1330.99,-95.63,380.47,55.68)|(767052/5549166)] [Bleeding (Draining Scream) {807857578574081}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (2213* internal {836045448940876}) <2213.0>"}
            ,{Line:37358,At:19635136,Raw:"[05:27:15.136] [@Recorded Player#1|(1335.44,-68.46,380.49,9.31)|(302167/388640)] [Coratanni {3371437658210304}:151759000226490|(1330.99,-95.63,380.47,55.68)|(767052/5549166)] [Halted Offensive  {4484383943688192}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (31241 energy {836045448940874}) <31241.0>"}
            ,{Line:37359,At:19635187,Raw:"[05:27:15.187] [Coratanni {3371437658210304}:151759000226490|(1330.99,-95.63,380.47,55.68)|(767052/5549166)] [@Recorded Player#1|(1325.04,-99.71,380.50,-122.57)|(428216/498076)] [Ranged Attack {3372232227160064}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -deflect {836045448945508}) <1.0>"}
            ,{Line:38239,At:19654184,Raw:"[05:27:34.184] [@Recorded Player#1|(1323.23,-71.11,380.67,-11.26)|(380285/405076)] [Pearl {3374109127868416}:151759000226373|(1325.44,-81.56,380.50,-191.85)|(70428/5549166)] [Plasma Probe {993073748246528}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (4589* elemental {836045448940875}) <4589.0>"}
            ,{Line:38280,At:19654602,Raw:"[05:27:34.602] [@Recorded Player#1|(1335.44,-68.46,380.49,28.41)|(302167/388640)] [Pearl {3374109127868416}:151759000226373|(1324.27,-76.02,380.50,-191.85)|(0/15414350)] [Thundering Blast {961338234896384}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (22910 ~11730 internal {836045448940876}) <22910.0>"}
            ,{Line:38281,At:19654602,Raw:"[05:27:34.602] [@Recorded Player#1|(1335.44,-68.46,380.49,28.41)|(302167/388640)] [Pearl {3374109127868416}:151759000226373|(1324.27,-76.02,380.50,-191.85)|(0/15414350)] [] [Event {836045448945472}: Death {836045448945493}]"}
            ,{Line:38285,At:19654766,Raw:"[05:27:34.766] [@Recorded Player#1|(1335.44,-68.46,380.49,51.39)|(302167/388640)] [Pearl {3374109127868416}:151759000226373|(1324.48,-76.49,380.50,168.15)|(0/15414350)] [Halted Offensive  {4484383943688192}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (58698* energy {836045448940874}) <58698.0>"}
            ,{Line:38826,At:19677534,Raw:"[05:27:57.534] [Ruugar {3371441953177600}:151759000226873|(1184.02,-411.36,169.07,176.36)|(10188886/10188886)] [@Recorded Player#1|(1187.60,-406.62,169.09,60.97)|(481577/498076)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (23824 ~16499 kinetic {836045448940873} -shield {836045448945509} (7325 absorbed {836045448945511})) <23824.0>"}
            ,{Line:38860,At:19679473,Raw:"[05:27:59.473] [@Recorded Player#1|(1181.46,-410.51,169.08,-68.48)|(438196/443782)] [Ruugar {3371441953177600}:151759000226873|(1184.50,-410.80,169.07,439.21)|(10164140/10188886)] [Jet Charge {814257079844864}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (6894 kinetic {836045448940873}) <6894.0>"}
            ,{Line:38870,At:19679816,Raw:"[05:27:59.816] [@Recorded Player#1|(1182.37,-410.39,169.07,-16.03)|(399223/443752)] [Ruugar {3371441953177600}:151759000226873|(1184.32,-411.07,169.07,470.78)|(10164140/10188886)] [Sundering Assault {807806038966272}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (17852* energy {836045448940874}) <13389.0>"}
            ,{Line:38896,At:19680395,Raw:"[05:28:00.395] [Ruugar {3371441953177600}:151759000226873|(1184.19,-411.28,169.07,504.49)|(10120223/10188886)] [=] [Jet Charge {3514730652106752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:38925,At:19681109,Raw:"[05:28:01.109] [Ruugar {3371441953177600}:151759000226873|(1181.77,-405.04,169.09,160.72)|(10044240/10188886)] [@Recorded Player#1|(1184.14,-402.87,169.09,-41.53)|(474102/498076)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (50502 kinetic {836045448940873}) <50502.0>"}
            ,{Line:39451,At:19693297,Raw:"[05:28:13.297] [Ruugar {3371441953177600}:151759000226873|(1183.35,-398.72,169.09,-164.67)|(8565633/10188886)] [=] [Jet Charge {3514730652106752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:39487,At:19694043,Raw:"[05:28:14.043] [Ruugar {3371441953177600}:151759000226873|(1186.17,-388.43,169.09,-164.62)|(8323168/10188886)] [@Recorded Player#1|(1187.00,-385.41,169.09,43.64)|(433016/498076)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (46245 kinetic {836045448940873}) <46245.0>"}
            ,{Line:40022,At:19705902,Raw:"[05:28:25.902] [Ruugar {3371441953177600}:151759000226873|(1186.36,-387.73,169.09,-334.45)|(6463760/10188886)] [=] [Jet Charge {3514730652106752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:40053,At:19706603,Raw:"[05:28:26.603] [Ruugar {3371441953177600}:151759000226873|(1183.88,-392.86,169.09,25.79)|(6358896/10188886)] [@Recorded Player#1|(1182.08,-397.56,169.09,184.00)|(381243/498076)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (13518 kinetic {836045448940873} -shield {836045448945509} (63737 absorbed {836045448945511})) <13518.0>"}
            ,{Line:40460,At:19714896,Raw:"[05:28:34.896] [Ruugar {3371441953177600}:151759000226873|(1183.60,-393.44,169.09,17.81)|(5175449/10188886)] [=] [Jet Charge {3514730652106752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:40486,At:19715717,Raw:"[05:28:35.717] [Ruugar {3371441953177600}:151759000226873|(1172.75,-427.27,169.27,17.79)|(5133723/10188886)] [@Recorded Player#1|(1170.83,-425.94,169.27,-55.22)|(349217/498076)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (38368 ~38369 kinetic {836045448940873}) <38368.0>"}
            ,{Line:40559,At:19718512,Raw:"[05:28:38.512] [Ruugar {3371441953177600}:151759000226873|(1172.96,-424.56,169.27,-175.77)|(5054484/10188886)] [=] [Jet Charge {3514730652106752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:40585,At:19719221,Raw:"[05:28:39.221] [Ruugar {3371441953177600}:151759000226873|(1171.55,-390.39,169.33,177.73)|(4962442/10188886)] [@Recorded Player#1|(1170.83,-388.04,169.34,6.49)|(300967/433567)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (64331 kinetic {836045448940873}) <64331.0>"}
            ,{Line:40803,At:19725799,Raw:"[05:28:45.799] [Ruugar {3371441953177600}:151759000226873|(1172.80,-387.81,169.34,-9.49)|(4300977/10188886)] [=] [Jet Charge {3514730652106752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:40840,At:19726543,Raw:"[05:28:46.543] [Ruugar {3371441953177600}:151759000226873|(1173.63,-392.87,169.27,-9.67)|(4216204/10188886)] [@Recorded Player#1|(1174.05,-395.34,169.27,-190.70)|(221448/498076)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (49746 kinetic {836045448940873}) <49746.0>"}
            ,{Line:41031,At:19731009,Raw:"[05:28:51.009] [Ruugar {3371441953177600}:151759000226873|(1173.00,-399.22,169.27,6.01)|(3686457/10188886)] [=] [Jet Charge {3514730652106752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:41057,At:19731741,Raw:"[05:28:51.741] [Ruugar {3371441953177600}:151759000226873|(1171.98,-409.04,169.27,5.92)|(3580058/10188886)] [@Recorded Player#1|(1172.09,-407.62,169.27,-174.62)|(301892/498076)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (27866 ~20533 kinetic {836045448940873} (7333 absorbed {836045448945511})) <27866.0>"}
            ,{Line:41560,At:19743422,Raw:"[05:29:03.422] [Ruugar {3371441953177600}:151759000226873|(1170.67,-409.48,169.27,-172.27)|(1803071/10188886)] [=] [Jet Charge {3514730652106752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:41591,At:19744138,Raw:"[05:29:04.138] [Ruugar {3371441953177600}:151759000226873|(1171.38,-404.50,169.34,-172.70)|(1711978/10188886)] [@Recorded Player#1|(1171.72,-399.62,169.27,-10.91)|(374130/498076)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (24960 kinetic {836045448940873} -shield {836045448945509} (43608 absorbed {836045448945511})) <24960.0>"}
            ,{Line:41811,At:19749030,Raw:"[05:29:09.030] [Ruugar {3371441953177600}:151759000226873|(1172.89,-404.31,169.34,87.92)|(1143396/10188886)] [@Recorded Player#1|(1170.49,-404.40,169.34,-130.72)|(0/443782)] [] [Event {836045448945472}: Death {836045448945493}]"}
            ,{Line:41864,At:19750225,Raw:"[05:29:10.225] [Ruugar {3371441953177600}:151759000226873|(1172.89,-404.31,169.34,-5.54)|(1073530/10188886)] [=] [Jet Charge {3514730652106752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:41888,At:19750940,Raw:"[05:29:10.940] [Ruugar {3371441953177600}:151759000226873|(1171.59,-399.24,169.27,165.64)|(1041009/10188886)] [@Recorded Player#1|(1171.15,-397.43,169.27,-16.15)|(379037/498076)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (46245 kinetic {836045448940873}) <46245.0>"}
            ,{Line:42031,At:19755128,Raw:"[05:29:15.128] [Ruugar {3371441953177600}:151759000226873|(1171.59,-399.24,169.27,174.52)|(676576/10188886)] [=] [Jet Charge {3514730652106752}] [Event {836045448945472}: AbilityActivate {836045448945479}]"}
            ,{Line:42053,At:19755845,Raw:"[05:29:15.845] [Ruugar {3371441953177600}:151759000226873|(1185.84,-428.21,169.27,-14.53)|(676576/10188886)] [This Gonna Be Good {3521409326252032}:151759000314976|(1187.97,-434.44,171.36,0.00)|(1043/1043)] [Jet Charge {3514730652106752}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -immune {836045448945506}) <209.0>"}
            ,{Line:42210,At:19770412,Raw:"[05:29:30.412] [@Recorded Player#1|(1208.57,-379.49,169.92,-149.09)|(334364/388640)] [Ruugar {3371441953177600}:151759000226873|(1186.74,-430.05,169.27,-15.50)|(676576/10188886)] [Affliction {808192586022912}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5396* ~0 internal {836045448940876} (5396 absorbed {836045448945511})) <5396.0>"}
            ,{Line:42213,At:19770716,Raw:"[05:29:30.716] [@Recorded Player#1|(1178.47,-393.16,169.09,-122.99)|(158002/443782)] [Ruugar {3371441953177600}:151759000226873|(1186.74,-430.05,169.27,-15.50)|(676576/10188886)] [Scorch {3384812186370048}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10981* ~0 elemental {836045448940875} (10981 absorbed {836045448945511})) <10981.0>"}
            ,{Line:42220,At:19771816,Raw:"[05:29:31.816] [@Recorded Player#1|(1207.57,-380.22,169.27,-142.01)|(391641/391641)] [Ruugar {3371441953177600}:151759000226873|(1186.74,-430.05,169.27,-15.50)|(676576/10188886)] [Creeping Terror {808424514256896}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (5875 ~0 internal {836045448940876} (5875 absorbed {836045448945511})) <5875.0>"}
            ,{Line:42291,At:19779639,Raw:"[05:29:39.639] [@Recorded Player#1|(938.62,962.68,18.01,135.00)|(405076/405076)] [=] [Sprint {810670782152704}] [ApplyEffect {836045448945477}: Sprint {810670782152704}]"}
            ,{Line:42292,At:19779639,Raw:"[05:29:39.639] [@Recorded Player#1|(938.62,962.68,18.01,135.00)|(385006/410547)] [=] [Sprint {810670782152704}] [ApplyEffect {836045448945477}: Sprint {810670782152704}]"}
            ,{Line:42293,At:19779639,Raw:"[05:29:39.639] [@Recorded Player#1|(938.62,962.68,18.01,135.00)|(165935/443782)] [Treasure Chest {3443983950807040}:151759000318138|(931.70,974.87,20.45,0.00)|(0/15414350)] [] [Event {836045448945472}: Death {836045448945493}]"}
        ]}
    ]
}

; Primary phases cross the same observer, compact-history and Analysis boundaries.
; Original witness fixtures are anonymized and run without opening user logs.
V74PIBuild(index)
{
    c := V74ModernParselyCases()[index],p := V74ModernParselyProfile(c.Boss)
    seg := V73WitnessSegment(c.Boss,p.Area,p.Mode),seg.Start := c.Start,seg.End := c.End,seg.Last := c.End
    rows := []
    for r in c.Records {
        ev := IPParseLine(r.Raw),ev.RecordId := r.Line
        ev.Analysis := {Accepted:true,At:r.At,Seq:r.Line}
        IGPObserve(seg,ev,r.At),rows.Push(ev)
    }
    d := {Start:c.Start,Last:c.End,BossKey:c.Boss,AreaId:p.Area,ModeId:p.Mode,Profile:seg.Profile,Rows:rows}
    return {Case:c,Profile:p,Segment:seg,Data:d}
}

V74PhaseHistoryRoundTrip()
{
    Loop 11 {
        f := V74PIBuild(A_Index),p := IGPCompact(f.Segment),a := IGVPackProgress(p),copy := IGVUnpackProgress(a)
        V48Assert(a.Length=(p.HasOwnProp("Health") ? 16 : 15),"primary phases remain field15 with optional whole-boss Health in field16")
        if p.HasOwnProp("Health")
            V48Assert(IGVJson(IGPHPack(copy.Health))=IGVJson(IGPHPack(p.Health)),"observed health and exact target identities survive the same round trip")
        V48Assert(copy.Parsely.Key=f.Profile.Key,"exact scoped phase revision survives history round trip")
        V48Assert(copy.Parsely.Order.Length=f.Case.Expected.Length,"every repeated primary phase retains its chronological position")
        V48Assert(IGVJson(IGVPackProgress(copy))=IGVJson(a),"all compact counters, HP fields and phase order survive round trip")
        V48Assert(IGVJson(IGPYPack(copy.Parsely))=IGVJson(IGPYPack(IGPYCompact(f.Segment))),"observer evidence and restored primary phases are identical")
    }
}

V74PhaseHistoryCompatibility()
{
    f := V74PIBuild(7),p := IGPCompact(f.Segment),a := IGVPackProgress(p)
    a.Length := 15,v74 := IGVUnpackProgress(a)
    V48Assert(IsObject(v74.Parsely) && !v74.HasOwnProp("Health") && IGVJson(IGVPackProgress(v74))=IGVJson(a),"legacy fifteen-field primary phases round trip without invented health")
    a.Pop(),v73 := IGVUnpackProgress(a)
    V48Assert(a.Length=14 && v73.HasOwnProp("Sections") && !v73.HasOwnProp("Parsely"),"old fourteen-field progress keeps sections without adding phase evidence")
    V48Assert(IGVJson(IGVPackProgress(v73))=IGVJson(a),"old section history retains exact serial form")
    a.Pop(),v72 := IGVUnpackProgress(a)
    V48Assert(a.Length=13 && !v72.HasOwnProp("Sections") && !v72.HasOwnProp("Parsely"),"old thirteen-field progress stays a phase-evidence gap")
    V48Assert(IGVJson(IGVPackProgress(v72))=IGVJson(a),"legacy HP/phase arrays remain readable and unchanged")
    p.DeleteProp("Sections")
    if p.HasOwnProp("Health")
        p.DeleteProp("Health")
    a := IGVPackProgress(p),copy := IGVUnpackProgress(a)
    V48Assert(a.Length=15 && a[14].Length=0 && IsObject(copy.Parsely),"primary-only metadata reserves the empty section slot")
    V48Assert(!IsObject(copy.Sections),"empty legacy section slot does not create observations")
}

V74PhaseHistoryInvalid()
{
    valid := ["fixture",0,[["a",2,1],["b",1,0]],[["a",1],["b",1],["a",2]]]
    V48Assert(IGPYUnpack(valid).Order.Length=3,"interleaved repeated sections are a valid chronological sequence")
    bad := [
        ["fixture",0,[["a",2,1]],[]],
        ["fixture",0,[["a",2,1]],[["a",1]]],
        ["fixture",0,[["a",2,1]],[["a",2],["a",1]]],
        ["fixture",0,[["a",2,1]],[["a",1],["a",1]]],
        ["fixture",0,[["a",1,0]],[["b",1]]],
        ["fixture",0,[["a",1,0]],[["a",1.5]]],
        ["fixture",0,[["a",1,2]],[["a",1]]]
    ]
    for value in bad {
        rejected := false
        try IGPYUnpack(value)
        catch Error
            rejected := true
        V48Assert(rejected,"incomplete, reordered, duplicate or inconsistent phase history is rejected")
    }
}

V74PhaseAnalysisIntegration()
{
    Loop 11 {
        f := V74PIBuild(A_Index),before := IGVJson(IGVPackProgress(IGPCompact(f.Segment)))
        copy := IGVUnpackProgress(IGVPackProgress(IGPCompact(f.Segment))),phases := IAAutomaticPhases(f.Data,f.Segment)
        V48Assert(copy.Parsely.Order.Length=phases.Length && phases.Length=f.Case.Expected.Length,"stored observed phases and private Analysis replay agree")
        for i,expected in f.Case.Expected {
            phase := phases[i]
            V48Assert(phase.Kind="Parsely" && phase.Name=expected.Name,"Analysis uses only the verified primary phase name")
            V48Assert(phase.From=(expected.Start-f.Case.Start)/1000 && phase.To=(expected.End-f.Case.Start)/1000,"Analysis preserves exact primary start, end and gaps")
            V48Assert(!phase.Boundary.IncludeStart && phase.Boundary.IncludeEnd,"Analysis retains explicit Parsely boundary ownership")
        }
        V48Assert(IGVJson(IGVPackProgress(IGPCompact(f.Segment)))=before,"private Analysis replay cannot change saved counters, HP or phase order")
    }
}

V74PhaseAnalysisAcceptance()
{
    f := V74PIBuild(11),before := IGVJson(IGVPackProgress(IGPCompact(f.Segment)))
    for ev in f.Data.Rows
        if ev.Kind="Damage" && IPBNpcId(ev.Target)="3447583133401088"
            ev.Analysis.Accepted := false
    phases := IAAutomaticPhases(f.Data,f.Segment)
    V48Assert(phases.Length=6,"rejected Core witnesses cannot create a phase")
    for phase in phases
        V48Assert(phase.Name!="Core","unaccepted rows do not lend primary phase evidence")
    V48Assert(IGVJson(IGVPackProgress(IGPCompact(f.Segment)))=before,"Analysis acceptance changes do not rewrite imported progression")
    f.Segment.ModeId := "unsupported"
    V48Assert(IAAutomaticPhases(f.Data,f.Segment).Length=0,"same raw markers cannot bypass exact encounter difficulty")
}

V74PhaseParselyBoundaries()
{
    d := {Start:0,Last:5000}
    a := {Start:1000,StartSeq:1,IncludeStart:false,End:2000,EndSeq:20,IncludeEnd:true,OpenEnd:false}
    b := {Start:2000,StartSeq:20,IncludeStart:false,End:3000,EndSeq:30,IncludeEnd:true,OpenEnd:false}
    for row in [[1999,99,true,false],[2000,19,true,false],[2000,20,true,false],[2000,21,false,true],[2001,1,false,true]] {
        ev := {RecordId:row[2],Analysis:{At:row[1],Seq:row[2],Accepted:true}}
        left := IAPhaseContains(ev,a,d),right := IAPhaseContains(ev,b,d)
        V48Assert(left=row[3] && right=row[4],"boundary marker stays in the preceding phase; following same-clock rows enter the next")
        V48Assert(left+right=1,"shared Parsely edge creates neither overlap nor a missing record")
    }
    ev := {RecordId:1,Analysis:{At:1000,Seq:1,Accepted:true}}
    V48Assert(!IAPhaseContains(ev,a,d),"the directly observed exclusive opening rule is explicit")
    ordinary := a.Clone(),ordinary.DeleteProp("IncludeEnd"),ev.RecordId := 20,ev.Analysis.At := 2000
    V48Assert(!IAPhaseContains(ev,ordinary,d),"old manually selected boundary behavior remains end-exclusive")
}

; Adversarial native chronological-ledger tests. Exact event shapes come from
; anonymized original-record fixtures; only arrival order/timestamps/instance
; IDs change in the explicitly synthetic stress cases. No files, audio or UI.
V74PEMarkers()
{
    c := V74GodsParselyCases()[5],out := []
    for boundary in c.Expected {
        found := false
        for r in c.Records
            if r.Line=boundary.StartLine {
                ev := IPParseLine(r.Raw),ev.RecordId := r.Line
                out.Push(ev),found := true
                break
            }
        V48Assert(found,"every Izax phase has an independent original boundary record")
    }
    return out
}

V74PEWindows(seg)
{
    out := []
    for w in seg.PhaseProgress["Parsely"].Windows
        out.Push([w.Id,w.Ordinal,w.Start,w.StartSeq,w.End,w.EndSeq,w.SourceKey,w.TargetKey,w.InstanceKey])
    return IGVJson(out)
}

V74PEReplay(markers,order,sameTime := false)
{
    p := IGPYGodsProfiles()["G-IZ"][1],seg := {Start:0,PhaseProgress:Map()}
    for index in order
        IGPYObserve(seg,markers[index],sameTime ? 1000 : 1000+index*150,p)
    return seg
}

V74PEArrivalOrder()
{
    markers := V74PEMarkers(),normal := [1,2,3,4,5,6,7]
    for sameTime in [false,true] {
        expected := V74PEWindows(V74PEReplay(markers,normal,sameTime))
        orders := [[7,6,5,4,3,2,1],[7,1,6,2,5,3,4],[3,2,1,6,5,4,7]]
        Loop 6 {
            order := normal.Clone(),i := A_Index,temp := order[i],order[i] := order[i+1],order[i+1] := temp
            orders.Push(order)
        }
        for order in orders {
            seg := V74PEReplay(markers,order,sameTime)
            V48Assert(V74PEWindows(seg)=expected,"in-horizon arrival permutations preserve exact phase and boundary sequence")
            V48Assert(!seg.PhaseProgress["Parsely"].Limited,"tolerated reordered boundaries do not become missing data")
        }
        for index in normal
            IGPYObserve(seg,markers[index],sameTime ? 1000 : 1000+index*150,IGPYGodsProfiles()["G-IZ"][1])
        V48Assert(V74PEWindows(seg)=expected,"replayed identical boundary rows cannot duplicate phases")
    }
}

V74PEExpiredBoundary()
{
    markers := V74PEMarkers(),p := IGPYGodsProfiles()["G-IZ"][1],seg := {Start:0,PhaseProgress:Map()}
    for i,ev in markers
        IGPYObserve(seg,ev,i*1000,p)
    before := V74PEWindows(seg),old := markers[2].Clone(),old.RecordId := 999999
    IGPYObserve(seg,old,1500,p)
    V48Assert(seg.PhaseProgress["Parsely"].Limited,"a phase boundary older than the journal horizon discloses limited evidence")
    V48Assert(V74PEWindows(seg)=before,"expired evidence never silently rewrites settled phase times")
}

V74PERedRows()
{
    c := V74ModernParselyCases()[1],out := []
    for request in [[c.Expected[1].Start,"Damage","4330233272467456"],
        [c.Expected[2].Start,"Damage","4246356856143872"],
        [c.Expected[2].End,"Death","4246356856143872"],
        [c.Expected[4].Start,"Damage","4246356856143872"]] {
        found := false
        for r in c.Records {
            ev := IPParseLine(r.Raw)
            if r.At=request[1] && ev.Kind=request[2] && IPBNpcId(ev.Target)=request[3] {
                ev.RecordId := r.Line,out.Push(ev),found := true
                break
            }
        }
        V48Assert(found,"recorded Red/Bull boundary selected by exact event identity")
    }
    return out
}

V74PENewInstanceReorder()
{
    r := V74PERedRows(),p := IGPYModernProfiles()["DX-RE"][1]
    reference := {Start:0,PhaseProgress:Map()},late := {Start:0,PhaseProgress:Map()}
    for i,ev in r
        IGPYObserve(reference,ev,i*1000,p)
    for i in [1,2,4,3]
        IGPYObserve(late,r[i],i*1000,p)
    V48Assert(V74PEWindows(late)=V74PEWindows(reference),"Bull2 hit received before Bull1 death remains available for chronological replay")
    state := late.PhaseProgress["Parsely"]
    V48Assert(state.Windows.Length=4 && state.Windows[4].Ordinal=2 && !state.Limited,"distinct Bull instance creates its actual second phase after the late prior death")
    first := r[2],same := {Start:0,PhaseProgress:Map()}
    IGPYObserve(same,r[1],1000,p),IGPYObserve(same,first,2000,p)
    Loop 1000 {
        ev := first.Clone(),ev.RecordId := 100000+A_Index
        IGPYObserve(same,ev,2000+A_Index,p)
    }
    V48Assert(!same.PhaseProgress["Parsely"].Limited && same.PhaseProgress["Parsely"].Windows.Length=2,"1000 hits on the same live Bull do not consume the phase fact limit")
    V48Assert(same.PhaseProgress["Parsely"].Facts.Length<10,"same-instance damage remains bounded without losing the next-instance boundary")
}

V74PEUndo()
{
    markers := V74PEMarkers(),data := IPNewData("Isolated primary phase rollback")
    data.AreaId := "833571547775765",data.ModeId := "836045448953655"
    seg := IPNewSegment(data,0,"isolated"),seg.BossKey := "G-IZ",seg.PhaseProgress := Map()
    IGPYObserve(seg,markers[1],1000),IGPYObserve(seg,markers[2],2000)
    before := V74PEWindows(seg),oldState := seg.PhaseProgress["Parsely"],oldWindow := oldState.Windows[2]
    IPBBeginUndo(data,seg)
    IGPYObserve(seg,markers[4],4000),IGPYObserve(seg,markers[3],3000)
    V48Assert(seg.PhaseProgress["Parsely"].Windows.Length=4 && oldWindow.End=-1,"provisional replay creates new immutable windows without changing the rollback snapshot")
    IPBRollbackTail(data,seg)
    V48Assert(V74PEWindows(seg)=before && seg.PhaseProgress["Parsely"].Current="anchors" && seg.PhaseProgress["Parsely"].Counts.Count=2,"native parser tail rollback restores exact primary phases, counts and boundaries")
    seg := IPNewSegment(data,0,"isolated first marker"),seg.BossKey := "G-IZ",seg.PhaseProgress := Map()
    IPBBeginUndo(data,seg),IGPYObserve(seg,markers[1],1000),IPBRollbackTail(data,seg)
    V48Assert(!seg.PhaseProgress.Has("Parsely"),"rollback of the first provisional boundary leaves no fabricated capture")
}

V74PERepeatCapacity()
{
    r := V74PERedRows(),p := IGPYModernProfiles()["DX-RE"][1],seg := {Start:0,PhaseProgress:Map()}
    IGPYObserve(seg,r[1],1000,p)
    Loop 32 {
        index := A_Index,hit := r[2].Clone(),death := r[3].Clone()
        hit.Target := hit.Target.Clone(),death.Target := death.Target.Clone()
        hit.Target.Key := "N:4246356856143872:stress" index,death.Target.Key := hit.Target.Key
        hit.RecordId := index*2,death.RecordId := index*2+1
        IGPYObserve(seg,hit,2000+index*6000,p),IGPYObserve(seg,death,5000+index*6000,p)
    }
    state := seg.PhaseProgress["Parsely"]
    V48Assert(state.Windows.Length=64 && state.Limited,"pathological repeated phases stop at the persisted limit and disclose truncation")
    V48Assert(state.Counts["red"]=32 && state.Counts["bull"]=32,"overflow cannot count a phase that was never stored")
    V48Assert(state.Windows[64].End>=state.Windows[64].Start,"last supported phase keeps its observed ending even when the next start exceeds capacity")
}

V74PEFactCapacity()
{
    r := V74PERedRows(),p := IGPYModernProfiles()["DX-RE"][1],seg := {Start:0,PhaseProgress:Map()}
    IGPYObserve(seg,r[1],1000,p),IGPYObserve(seg,r[2],2000,p),IGPYObserve(seg,r[3],3000,p)
    ; Distinct raw rows hitting the already defeated instance are retained as
    ; potential reordered evidence, but may never open another Bull phase.
    Loop 300 {
        ev := r[2].Clone(),ev.RecordId := 100000+A_Index
        IGPYObserve(seg,ev,3000+A_Index,p)
    }
    state := seg.PhaseProgress["Parsely"]
    V48Assert(state.Facts.Length<=256 && state.Limited,"a burst beyond the fact budget stays bounded and marks incomplete evidence")
    V48Assert(state.Windows.Length=3 && state.Windows[3].Id="red","old dead-instance hits do not manufacture further Bull phases")
}

V74PEActorCapacity()
{
    p := IGPYModernProfiles()["DX-E1"][1],seg := {Start:0,PhaseProgress:Map()}
    Loop 65 {
        ev := V63Event("Damage","4245686841245696",90,1000,"900000000000001",true)
        ev.Target.Key := "N:4245686841245696:stress" A_Index,ev.RecordId := A_Index
        IGPYObserve(seg,ev,1000+A_Index,p)
    }
    state := seg.PhaseProgress["Parsely"]
    V48Assert(state.Actors.Count=64 && state.Limited,"encounter actor tracking stays bounded and discloses the missing 65th identity")
    V48Assert(!state.Windows.Length,"unopened partial actor evidence does not invent a run or Warden phase")
}

; Saved-format compatibility fixtures. These arrays mirror the supported old
; schema, with synthetic names/values. No user history file is opened or written.
V741SavedEntry(boss := "G-TY",hp := 34.5,id := 1,fields := 13,kill := false)
{
    start := 72000000+id*120000,ending := start+60000,sisters := boss="G-AE"
    profile := sisters ? "sisters-combined-8m-v1" : "hp-only-v1"
    name := sisters ? "Aivela and Esne" : "Tyth",targets := []
    for npc in (sisters ? ["4088525397950464","4088538282852352"] : ["4078423634870272"])
        targets.Push([name,npc,1,Max(0,hp),Max(0,hp),ending,ending,kill ? 1 : 0,1000000])
    progress := [profile,[sisters ? "Combined HP" : "HP only"],1,hp,name,kill ? targets.Length : 0,
        targets.Length,kill ? 1 : 0,0,hp>=0 ? 1 : 0,"Synthetic legacy saved-format fixture",0,targets]
    if fields=14
        progress.Push(["legacy-independent-sections",0,[["observed-section",2,1]]])
    players := [["@Synthetic Raider#1","Synthetic Raider",0,-1,0,0,1,2,[1,60000,[30000,33000,36000,39000,42000,45000],30,2,28,0]]]
    packed := [id,name,boss,"833571547775765","836045448953655",start,ending,1,0,1,
        "Synthetic saved-format fixture","@Synthetic Raider#1",players,[],progress]
    decoded := IGVUnpackPull(ParseJson(IGVJson(packed)))
    return {Key:"legacy|" id,Date:"20260929",Session:"synthetic-legacy",Team:"A",Pull:decoded,
        FixtureJSON:IGVJson(packed),FixtureFields:fields}
}

V741SavedSignature(entries)
{
    rows := []
    for e in entries
        rows.Push([e.Key,e.Date,e.Session,e.Team,IGPCGet(e,"Conflict"),e.Pull.Group,
            e.Pull.Included,IGVPackPull(e.Pull,false)])
    return IGVJson(rows)
}

V741SavedTyth13()
{
    rows := [V741SavedEntry("G-TY",88,1),V741SavedEntry("G-TY",12,2),V741SavedEntry("G-TY",47,3)]
    before := V741SavedSignature(rows),m := IGVPlotModel(rows,900,250,1,rows[1].Pull.Group)
    V48Assert(m.Axis.Kind="hp" && m.Axis.Percent && m.Unknown=0,"old-only Tyth history retains a plotted boss-HP axis")
    V48Assert(m.BestIndex=2 && m.Points[2].Y>m.Points[1].Y && m.Points[3].BestY=m.Points[2].Y,"saved health still ranks attempts and retains best-so-far")
    V48Assert(Abs(m.Points[1].Y-(m.Top+0.12*(m.Bottom-m.Top)))<0.001,"88 percent remaining retains its exact plotted position")
    V48Assert(IGVEntryScore(rows[2],m,2)>IGVEntryScore(rows[3],m,3),"summary and plot use the same saved-HP ordering")
    for e in rows {
        V48Assert(IGVPackProgress(e.Pull.Progress).Length=13 && !e.Pull.Progress.HasOwnProp("Parsely"),"thirteen-field history stays phase-free")
        V48Assert(IGVJson(IGVPackPull(e.Pull,false))=e.FixtureJSON,"entire old compact pull round-trips without synthetic phase fields")
        V48Assert(InStr(IGLEntryProgressLabel(e),Format("{:.1f}% boss HP remaining",e.Pull.Progress.Hp)),"old saved health remains readable in progression labels")
    }
    V48Assert(before=V741SavedSignature(rows),"graph and labels never mutate old saved Tyth history")
}

V741SavedDuplicateTyth()
{
    rows := []
    for id,hp in [42,17] {
        e := V741SavedEntry("G-TY",hp,id),packed := ParseJson(e.FixtureJSON)
        packed[15][7] := 2,packed[15][13].Push(packed[15][13][1].Clone())
        e.FixtureJSON := IGVJson(packed),e.Pull := IGVUnpackPull(ParseJson(e.FixtureJSON)),rows.Push(e)
    }
    before := V741SavedSignature(rows),m := IGVPlotModel(rows,900,250,1,rows[1].Pull.Group)
    V48Assert(rows[1].Pull.Progress.Expected=2 && rows[1].Pull.Progress.Targets.Length=2,"literal thirteen-field history restores two recorded Tyth targets")
    V48Assert(m.Axis.Kind="hp" && m.Unknown=0 && m.Points[1].Known && m.Points[2].Known && m.BestIndex=2,"duplicate entries for the exact same Tyth NPC retain valid saved HP")
    V48Assert(Abs(m.Points[1].Y-(m.Top+0.58*(m.Bottom-m.Top)))<0.001,"duplicate-target compatibility preserves the saved HP value instead of recalculating it")
    V48Assert(before=V741SavedSignature(rows),"duplicate target entries are preserved rather than collapsed or rewritten")
    IGPYDemoPhases(rows[2].Pull,["magma","tyth"])
    before := V741SavedSignature(rows),m := IGVPlotModel(rows,900,250,1,rows[1].Pull.Group)
    V48Assert(m.Axis.Kind="hp" && m.Unknown=0 && m.BestIndex=2,"old and reimported duplicate-Tyth captures retain their shared real HP scale")
    V48Assert(before=V741SavedSignature(rows),"mixed duplicate-Tyth viewing retains both target rows and the newer phase ledger")
    for reason in ["different NPC","missing targets","missing second target","extra target","expected mismatch","missing NPC","unknown HP","invalid HP","not comparable","ordinal profile"] {
        bad := IPRCloneSnapshot(rows[1]),q := bad.Pull.Progress
        switch reason {
            case "different NPC": q.Targets[2].Npc := "4088525397950464"
            case "missing targets": q.Targets := []
            case "missing second target": q.Targets.Pop()
            case "extra target": q.Targets.Push(q.Targets[1].Clone())
            case "expected mismatch": q.Expected := 3
            case "missing NPC": q.Targets[2].Npc := ""
            case "unknown HP": q.Hp := -1
            case "invalid HP": q.Hp := 101
            case "not comparable": q.Comparable := false
            case "ordinal profile": q.Profile := "old-ordinal-progress"
        }
        model := IGVPlotModel([bad],900,250,1,bad.Pull.Group)
        V48Assert(!model.Points[1].Known && model.Points[1].Y=-1 && model.Points[1].Score=-1,"duplicate-Tyth exception rejects " reason)
    }
    V48Assert(IGVJson(IGVPackPull(rows[1].Pull,false))=rows[1].FixtureJSON,"old duplicate-target pull remains byte-for-byte equivalent after all checks")
}

V741SavedSisters14()
{
    rows := [V741SavedEntry("G-AE",25.5,1,13),V741SavedEntry("G-AE",15,2,14),V741SavedEntry("G-AE",22,3,14)]
    before := V741SavedSignature(rows),m := IGVPlotModel(rows,900,250,1,rows[1].Pull.Group)
    V48Assert(m.Axis.Kind="combined" && m.Axis.Percent && m.Unknown=0,"mixed thirteen/fourteen-field Sisters history retains weighted HP")
    V48Assert(m.BestIndex=2 && Abs(m.Points[2].Y-(m.Top+0.85*(m.Bottom-m.Top)))<0.001,"saved 15 percent combined health is the best actual health position")
    V48Assert(InStr(IGLEntryProgressLabel(rows[2]),"15.0% combined HP remaining"),"Sisters label distinguishes combined health from a single target")
    V48Assert(rows[2].Pull.Progress.Sections.Counts[1].Started=2 && !rows[2].Pull.Progress.HasOwnProp("Parsely"),"independent old sections survive without becoming primary phases")
    for e in rows
        V48Assert(IGVJson(IGVPackPull(e.Pull,false))=e.FixtureJSON,"both legacy shapes retain their exact serial representation")
    V48Assert(before=V741SavedSignature(rows),"weighted health and old section counters are unchanged by viewing")
}

V741SavedMissingEvidence()
{
    good := V741SavedEntry(),unknown := V741SavedEntry("G-TY",-1,2),multi := V741SavedEntry("G-TY",1,3)
    multi.Pull.Progress.Expected := 2
    ordinal := V741SavedEntry("G-TY",1,4),ordinal.Pull.Progress.Profile := "old-multi-stage-v1"
    ordinal.Pull.Progress.Phases := ["Old mechanic stage"]
    rows := [good,unknown,multi,ordinal],m := IGVPlotModel(rows,900,250,1,good.Pull.Group)
    V48Assert(m.Axis.Kind="hp" && m.Points[1].Known && m.Unknown=3 && m.BestIndex=1,"only safe comparable single-boss health is plotted")
    Loop 3 {
        point := m.Points[A_Index+1]
        V48Assert(!point.Known && point.Y=-1 && point.Score=-1,"missing, multi-target or old ordinal HP never becomes zero or real boss HP")
    }
    phases := IGPCBuild(rows,good.Pull.Group)
    V48Assert(phases.Counters.Known=0 && phases.Counters.Unknown=4,"HP fallback does not pretend to recover missing phase history")
    for row in phases.Rows
        V48Assert(row.Reached=0 && row.Unknown=4 && row.Earlier=0,"absence of phase evidence stays unknown, not failure to reach")
}

V741SavedMixedPhases()
{
    old := V741SavedEntry("G-TY",12,1),fresh := V741SavedEntry("G-TY",88,2)
    IGPYDemoPhases(fresh.Pull,["magma","tyth"])
    killed := V741SavedEntry("G-TY",0,3,13,true),rows := [old,fresh,killed]
    before := V741SavedSignature(rows),m := IGVPlotModel(rows,900,250,1,old.Pull.Group)
    V48Assert(m.Axis.Kind="hp" && m.Axis.Percent && m.Unknown=0 && m.Points[1].Known && m.Points[2].Known && m.Points[3].Kill,"mixed old/new captures retain their shared genuine HP axis when every eligible result supports it")
    V48Assert(m.Points[1].Score>m.Points[2].Score && m.BestIndex=3,"shared saved health ranks both wipes and the confirmed kill without hiding either capture")
    V48Assert(before=V741SavedSignature(rows),"shared HP compatibility view does not discard the newer phase ledger")
    fresh.Pull.Progress.Profile := "phase-only-internal"
    before := V741SavedSignature(rows),production := IGVPlotModel(rows,900,250,1,old.Pull.Group)
    V48Assert(production.Axis.Kind="hp" && production.Points[1].Known && !production.Points[2].Known && production.Points[3].Kill,"production Tyth graph retains valid HP and a genuine gap without switching scales")
    m := IGPYGraphModel(rows,900,250,1,old.Pull.Group)
    V48Assert(m.Axis.Kind="parsely" && !m.Axis.Percent,"explicit phase-only model remains available separately from the production HP graph")
    V48Assert(!m.Points[1].Known && m.Points[1].Score=-1 && InStr(m.Points[1].Label,"12.0% boss HP remaining") && InStr(m.Points[1].Label,"phase unavailable"),"legacy wipe retains saved HP in its label without inventing a phase position")
    V48Assert(m.Points[2].Known && m.Points[2].Label="Tyth","new phase evidence keeps its actual named position")
    V48Assert(m.Points[3].Known && m.Points[3].Kill && m.Points[3].Y=m.Bottom && m.BestIndex=3,"confirmed old kill plots independently of absent phase fields")
    V48Assert(m.Unknown=1 && m.MappingMismatch=1,"only the unpositionable old wipe is an unknown/mismatched phase point")
    phases := IGPCBuild(rows,old.Pull.Group)
    V48Assert(phases.Counters.Kills=1 && phases.Counters.Known=1 && phases.Counters.Unknown=2,"kill count remains separate from observed phase coverage")
    for row in phases.Rows
        V48Assert(row.Reached=1 && row.Unknown=2,"neither old kill nor old wipe fills an unrecorded phase")
    V48Assert(before=V741SavedSignature(rows),"mixing legacy and current captures never migrates stored evidence")
}

V741SavedEligibility()
{
    base := V741SavedEntry("G-TY",40,1),rows := [base]
    for reason in ["wrong-scope","conflict","excluded","unfinished"] {
        e := V741SavedEntry("G-TY",0,rows.Length+1,13,true)
        IGPYDemoPhases(e.Pull,["magma","tyth","burn"])
        if reason="wrong-scope"
            e.Pull.Group := "G-TY|wrong-area|836045448953655"
        else if reason="conflict"
            e.Conflict := "Synthetic recorder disagreement"
        else if reason="excluded"
            e.Pull.Included := false
        else
            e.Pull.Ended := false
        rows.Push(e)
    }
    before := V741SavedSignature(rows),m := IGVPlotModel(rows,900,250,1,base.Pull.Group)
    V48Assert(m.Axis.Kind="hp" && m.BestIndex=1,"ineligible phase ledgers cannot switch the selected old-HP graph")
    Loop 4 {
        point := m.Points[A_Index+1]
        V48Assert(!point.Known && !point.Kill && point.Y=-1,"wrong-scope, conflict, excluded and unfinished entries cannot plot health or a kill")
    }
    phase := IGPCBuild(rows,base.Pull.Group)
    V48Assert(phase.Counters.Known=0 && phase.Counters.Kills=0,"phase/kill counts respect the same selected-scope and eligibility guards")
    V48Assert(before=V741SavedSignature(rows),"eligibility checks are read-only")
}

V741SavedNoMutation()
{
    for boss in ["G-TY","G-AE"] {
        rows := [V741SavedEntry(boss,42,1,13),V741SavedEntry(boss,17,2,14),V741SavedEntry(boss,0,3,13,true)]
        before := V741SavedSignature(rows),group := rows[1].Pull.Group
        view := {Boss:group,Character:"",Team:"A",Window:"all",Cycle:"",Source:"history",DemoHistory:true}
        graph := IGVPlotModel(rows,900,250,1,group),phase := IGPCBuild(rows,group),image := ISRIBuild(rows,view)
        V48Assert(image.Plot.Axis.Percent && image.Best="Confirmed kill" && image.Kills=1,"PNG snapshot uses the same saved-health fallback and independent kill")
        for i,e in rows {
            IGVEntryScore(e,graph,i),IGVPointLabel(e,i),IGLEntryProgressLabel(e)
            V48Assert(IGVJson(IGVPackPull(e.Pull,false))=e.FixtureJSON,"all old player, activity, target and section fields retain their serial values")
        }
        for row in phase.Rows
            V48Assert(row.Reached=0 && row.Unknown=3,"image/phase summaries do not fill history from a confirmed kill")
        V48Assert(before=V741SavedSignature(rows),"graph, point labels, consistency and export model leave history unchanged")
    }
}

V741SavedNativeGraph()
{
    V61Hidden(V741SavedNativeCase)
}

V741SavedNativeCase()
{
    IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IPRNewData("SYNTHETIC old history",true)
    p.Data.Demo := true,IGVOpen(),v := IGVState()
    try {
        for boss in ["G-TY","G-AE"] {
            rows := [V741SavedEntry(boss,42,1,13),V741SavedEntry(boss,17,2,14)]
            before := V741SavedSignature(rows),v.Source := "history",v.DemoHistory := true,v.History := Map()
            for e in rows
                v.History[e.Key] := e
            v.Boss := rows[1].Pull.Group,v.Character := "",v.Team := "A",v.Window := "all",v.Cycle := ""
            v.DetailVisible := true,IGVFillFilters(),IGVRefresh()
            V48Assert(v.Rows.Length=2 && v.Controls["Rows"].GetCount()=2 && v.Plot.Axis.Percent,"actual graph window retains both old saved attempts")
            V48Assert(InStr(v.Controls["Rows"].GetText(2,3),"17.0%") && !InStr(v.Controls["Rows"].GetText(2,3),"re-import"),"native table displays saved HP rather than a reimport-only message")
            V48Assert(v.Plot.Points[1].Known && v.Plot.Points[2].Known && v.Plot.BestIndex=2,"native graph uses actual saved-health points and best ordering")
            V48Assert(before=V741SavedSignature(rows),"native refresh does not rewrite fixture history")
        }
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",v.Gui.Hwnd),"compatibility GUI is isolated and hidden")
    }
    finally IGVClose()
}

; All-new phase metadata must not replace real boss health with a flat phase line.
V742HPEntries(boss := "G-TY")
{
    rows := [V741SavedEntry(boss,80,1),V741SavedEntry(boss,10,2)]
    for e in rows
        IGPYDemoPhases(e.Pull,boss="G-TY" ? ["magma","tyth"] : ["codex","twins"])
    return rows
}

V742HPReimportedTyth()
{
    rows := V742HPEntries(),before := V741SavedSignature(rows),group := rows[1].Pull.Group
    m := IGVPlotModel(rows,900,250,1,group)
    V48Assert(m.Axis.Kind="hp" && m.Axis.Percent && m.Unknown=0,"fully reimported Tyth stays on a boss-HP graph")
    V48Assert(m.Points[2].Y>m.Points[1].Y && m.BestIndex=2,"80 and 10 percent HP remain different progress even within the same observed phase")
    V48Assert(Abs(m.Points[1].Y-(m.Top+0.2*(m.Bottom-m.Top)))<0.001 && Abs(m.Points[2].Y-(m.Top+0.9*(m.Bottom-m.Top)))<0.001,"both HP positions use their actual percentages")
    V48Assert(IGVEntryScore(rows[2])>IGVEntryScore(rows[1]) && IGVEntryScore(rows[2],m,2)>IGVEntryScore(rows[1],m,1),"default and shared-model scores agree on the lower-HP best pull")
    V48Assert(IGLEntryProgressLabel(rows[2])="10.0% boss HP remaining" && InStr(IGVPointLabel(rows[2],2),"10.0% boss HP remaining"),"default table/detail and hover labels retain HP")
    phases := IGPCBuild(rows,group),explicit := IGPYGraphModel(rows,900,250,1,group)
    V48Assert(phases.Counters.Known=2 && phases.Rows[2].Reached=2 && phases.Rows[2].Name="Tyth","phase consistency still uses both recorded phase ledgers")
    V48Assert(explicit.Axis.Kind="parsely" && explicit.Points[1].Y=explicit.Points[2].Y,"explicit phase-only model remains independently available")
    V48Assert(before=V741SavedSignature(rows),"HP display choice preserves every recorded phase and saved field")
}

V742HPWeightedSisters()
{
    rows := V742HPEntries("G-AE")
    rows[1].Pull.Progress := IGPCompact(V634Pair(200,150,2000,1000))
    rows[2].Pull.Progress := IGPCompact(V634Pair(150,150,1000,1000))
    for e in rows
        IGPYDemoPhases(e.Pull,["codex","twins"])
    before := V741SavedSignature(rows),m := IGVPlotModel(rows,900,250,1,rows[1].Pull.Group)
    V48Assert(m.Axis.Kind="combined" && m.Axis.Percent && m.Unknown=0,"fully new Sisters captures retain their combined-health graph")
    V48Assert(Abs(rows[1].Pull.Progress.Hp-100*350/3000)<0.000001 && m.BestIndex=1,"unequal recorded maxima retain weighted combined HP and the right best pull")
    V48Assert(m.Points[1].Y>m.Points[2].Y && InStr(IGLEntryProgressLabel(rows[1]),"11.7% combined HP remaining"),"combined HP difference remains visible in position and label")
    phase := IGPCBuild(rows,rows[1].Pull.Group)
    V48Assert(phase.Counters.Known=2 && phase.Rows[2].Reached=2,"weighted health display does not remove observed Sisters phases")
    V48Assert(before=V741SavedSignature(rows),"weighted health and phase ledgers are never rewritten by display selection")
}

V742HPMissingAndGuards()
{
    for boss in ["G-TY","G-AE"] {
        rows := V742HPEntries(boss),group := rows[1].Pull.Group,rows[1].Pull.Progress.Hp := -1
        rows[1].Pull.Progress.Comparable := false,rows[2].Pull.Progress.Hp := -1,rows[2].Pull.Progress.Comparable := false
        empty := IGVPlotModel([],900,250,1,group),m := IGVPlotModel(rows,900,250,1,group)
        V48Assert(empty.Axis.Percent && m.Axis.Percent && m.Unknown=2,"empty or missing-HP selections retain the correct health scale")
        V48Assert(!m.Points[1].Known && m.Points[1].Y=-1 && !m.Points[2].Known,"phase evidence does not substitute for unavailable health")
        rows[2].Pull.Progress.Kill := true,m := IGVPlotModel(rows,900,250,1,group)
        V48Assert(m.Points[2].Known && m.Points[2].Kill && m.Points[2].Y=m.Bottom,"confirmed kill remains valid when HP is unavailable")
        for reason in ["conflict","excluded","unfinished","wrong scope"] {
            bad := IPRCloneSnapshot(rows[2])
            switch reason {
                case "conflict": bad.Conflict := "Synthetic conflict"
                case "excluded": bad.Pull.Included := false
                case "unfinished": bad.Pull.Ended := false
                case "wrong scope": bad.Pull.Group := "wrong"
            }
            guarded := IGVPlotModel([bad],900,250,1,group)
            V48Assert(!guarded.Points[1].Known && !guarded.Points[1].Kill,"HP graph rejects " reason)
        }
    }
}

V742HPNativeAndImage()
{
    V61Hidden(V742HPNativeCase)
}

V742HPNativeCase()
{
    IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IPRNewData("SYNTHETIC new phase and HP history",true)
    p.Data.Demo := true,IGVOpen(),v := IGVState()
    try {
        for boss in ["G-TY","G-AE"] {
            rows := V742HPEntries(boss),before := V741SavedSignature(rows)
            v.Source := "history",v.DemoHistory := true,v.History := Map()
            for e in rows
                v.History[e.Key] := e
            v.Boss := rows[1].Pull.Group,v.Character := "",v.Team := "A",v.Window := "all",v.Cycle := ""
            v.DetailVisible := true,IGVFillFilters(),IGVRefresh()
            V48Assert(v.Plot.Axis.Percent && v.Plot.BestIndex=2 && v.Plot.Points[2].Y>v.Plot.Points[1].Y,"actual native graph keeps different HP positions after complete reimport")
            V48Assert(InStr(v.Controls["Rows"].GetText(1,3),"80.0%") && InStr(v.Controls["Rows"].GetText(2,3),"10.0%"),"native progression table shows both HP values")
            image := ISRIBuild(rows,v)
            V48Assert(image.Plot.Axis.Percent && image.BestIndex=2 && InStr(image.Best,"10.0%"),"PNG snapshot uses identical HP progress and best pull")
            V48Assert(image.Phase.Counters.Known=2 && image.Phase.Rows[2].Reached=2,"PNG retains the separate observed phase summary")
            V48Assert(before=V741SavedSignature(rows),"native graph and PNG model do not alter saved evidence")
        }
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",v.Gui.Hwnd),"new-history UI diagnostic remains hidden")
    }
    finally IGVClose()
}

; Hidden native controls only; no live app, settings, audio or gameplay input.
V743RIPreviewPixels()
{
    V58Isolated(V743RIPreviewPixelsCase)
}

V743RIPixelData(bitmap)
{
    b := V74RIBitmap(bitmap),stride := (b.W*3+3)&~3
    info := Buffer(40,0),pixels := Buffer(stride*b.H,0)
    NumPut("UInt",40,"Int",b.W,"Int",-b.H,"UShort",1,"UShort",24,info)
    dc := DllCall("Gdi32\CreateCompatibleDC","Ptr",0,"Ptr")
    if !dc
        throw Error("Could not inspect the displayed image")
    try {
        if DllCall("Gdi32\GetDIBits","Ptr",dc,"Ptr",bitmap,"UInt",0,"UInt",b.H,
            "Ptr",pixels,"Ptr",info,"UInt",0,"Int")!=b.H
            throw Error("Could not read the displayed bitmap pixels")
        return pixels
    }
    finally DllCall("Gdi32\DeleteDC","Ptr",dc)
}

V743RIPreviewPixelsCase()
{
    ISRIClose(),f := V74RIFixture(),m := ISRIBuild(f.Entries,f.View)
    ; Warm shared UI/theme caches before counting owned preview resources.
    ISRISetPreview(m),ISRIClose()
    process := DllCall("GetCurrentProcess","Ptr")
    before := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    try {
        ISRISetPreview(m),s := ISRIState(),source := s.Image.Bitmap
        original := V743RIPixelData(source)
        for size in [[700,620],[940,800],[1200,900]] {
            w := size[1],h := size[2],s.Gui.Show("Hide w" w " h" h),ISRIResize(s.Gui,0,w,h)
            c := s.Controls["Preview"],rect := Buffer(16,0)
            c.GetPos(&x,&y,&lw,&lh)
            V48Assert(DllCall("User32\GetClientRect","Ptr",c.Hwnd,"Ptr",rect),"native preview exposes its physical client size")
            pw := NumGet(rect,8,"Int"),ph := NumGet(rect,12,"Int")
            shown := SendMessage(0x0173,0,0,c),b := V74RIBitmap(shown)
            V48Assert(b.W=pw && b.H=ph,"displayed bitmap matches every physical preview pixel at DPI " A_ScreenDPI)
            V48Assert(x>=0 && y>=120 && x+lw<=w && y+lh<=h,"DPI-correct preview stays inside its logical window bounds")
            V48Assert(Abs(pw/ph-m.Width/m.Height)<0.01,"physical preview preserves the report aspect ratio")
            expected := ISRIRender(s.Model,pw,ph)
            try {
                actualPixels := V743RIPixelData(shown),expectedPixels := V743RIPixelData(expected.Bitmap)
                V48Assert(actualPixels.Size=expectedPixels.Size
                    && DllCall("msvcrt\memcmp","Ptr",actualPixels,"Ptr",expectedPixels,"UPtr",actualPixels.Size,"CDecl Int")=0,
                    "displayed pixels equal text and geometry drawn at the physical preview size, without resampling")
            }
            finally DllCall("Gdi32\DeleteObject","Ptr",expected.Bitmap)
        }
        unchanged := V743RIPixelData(source)
        V48Assert(source=s.Image.Bitmap && original.Size=unchanged.Size
            && DllCall("msvcrt\memcmp","Ptr",original,"Ptr",unchanged,"UPtr",original.Size,"CDecl Int")=0,
            "preview resizing never alters the full-resolution export bitmap")
    }
    finally ISRIClose()
    after := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    V48Assert(after<=before+2,"native preview and pixel inspection release their owned image resources")
}

; Isolated native rendering only. No live application, settings or input.
V744RITextAtPixelSizes()
{
    process := DllCall("GetCurrentProcess","Ptr"),before := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    for scale in [0.75,1,1.25,1.5,2] {
        p := ISRICanvas(Round(320*scale),Round(110*scale))
        try {
            ISRIGraphics(p,scale)
            DllCall("Gdiplus\GdipGraphicsClear","Ptr",p.Graphics,"UInt",0xFFFFFFFF)
            ISRIText(p,"Sisters & Tyth",10,10,210,28,16,"000000")
            ISRIText(p,"This deliberately long label must fit its cell",10,52,110,25,15,"000000")
            ; This paint occurs after text was requested. Native glyphs must
            ; remain visible after the deferred GDI+ geometry is completed.
            ISRIFill(p,0,0,320,110,"FFFFFF")
            ISRIFill(p,260,10,40,30,"4B9AFF")
            ISRIFlushText(p)
            b := V74RIBitmap(p.Bitmap),ink := 0,coverage := 0,edges := 0,fringes := 0,escaped := 0
            Loop b.H {
                y := A_Index-1
                Loop Round(240*scale) {
                    x := A_Index-1,pixel := b.Bits+y*b.Stride+x*3
                    blue := NumGet(pixel,0,"UChar"),green := NumGet(pixel,1,"UChar"),red := NumGet(pixel,2,"UChar")
                    if blue!=green || green!=red
                        fringes += 1
                    coverage += (255-red)/255
                    if red=0
                        ink += 1
                    else if red<255
                        edges += 1
                    allowed := (x>=Round(10*scale) && x<Round(220*scale) && y>=Round(10*scale) && y<Round(38*scale))
                        || (x>=Round(10*scale) && x<Round(120*scale) && y>=Round(52*scale) && y<Round(77*scale))
                    if red!=255 && !allowed
                        escaped += 1
                }
            }
            pixel := b.Bits+Round(20*scale)*b.Stride+Round(280*scale)*3
            V48Assert(NumGet(pixel,0,"UChar")=255 && NumGet(pixel,1,"UChar")=154 && NumGet(pixel,2,"UChar")=75,
                "native text leaves the finished blue geometry intact at scale " scale)
            ; Nunito's tiny stems distribute coverage over grayscale pixels.
            ; Count actual ink coverage rather than Segoe's exact-black area.
            V48Assert(ink>0 && coverage>100 && edges>20,"physical-size text retains visible stroke coverage and grayscale edges at scale " scale)
            V48Assert(fringes=0,"native text has no display-specific color fringes at scale " scale)
            V48Assert(escaped=0,"native text stays within its clipped cells at scale " scale)
            beforeSecond := Buffer(b.Stride*b.H)
            DllCall("msvcrt\memcpy","Ptr",beforeSecond,"Ptr",b.Bits,"UPtr",beforeSecond.Size,"CDecl Ptr")
            ISRIFlushText(p)
            V48Assert(DllCall("msvcrt\memcmp","Ptr",beforeSecond,"Ptr",b.Bits,"UPtr",beforeSecond.Size,"CDecl Int")=0,
                "finishing text twice does not thicken already-drawn glyphs")
        }
        finally ISRICanvasClose(p)
    }
    after := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    V48Assert(after<=before+2,"physical-size fonts and graphics release their native resources")
}

V744RITextLiteralAmpersand()
{
    last := []
    for label in ["HM","H&M"] {
        p := ISRICanvas(180,60)
        try {
            ISRIGraphics(p)
            DllCall("Gdiplus\GdipGraphicsClear","Ptr",p.Graphics,"UInt",0xFFFFFFFF)
            ISRIText(p,label,8,8,160,40,24,"000000"),ISRIFlushText(p)
            b := V74RIBitmap(p.Bitmap),right := 0
            Loop b.H {
                y := A_Index-1
                Loop b.W {
                    x := A_Index-1
                    if NumGet(b.Bits+y*b.Stride+x*3,0,"UChar")<255
                        right := Max(right,x)
                }
            }
            last.Push(right)
        }
        finally ISRICanvasClose(p)
    }
    V48Assert(last[2]>last[1]+8,"boss and team ampersands remain literal text rather than keyboard accelerators")
}

; Observed phase markers only; private synthetic history, no app or settings.
V745RIObservedMilestones()
{
    old := V74PVEntry([],1,"G-TY"),group := old.Pull.Group
    old.Pull.Progress.DeleteProp("Parsely"),old.Pull.Progress.Kill := true,old.Pull.Progress.Hp := 0
    conflict := V74PVEntry(["magma","tyth","burn"],2,"G-TY"),conflict.Conflict := "Recorders disagree"
    excluded := V74PVEntry(["magma","tyth","burn"],3,"G-TY"),excluded.Pull.Included := false
    unfinished := V74PVEntry(["magma","tyth","burn"],4,"G-TY"),unfinished.Pull.Ended := false
    wrongGroup := V74PVEntry(["magma","tyth","burn"],5,"G-TY"),wrongGroup.Pull.Group := "wrong"
    invalid := V74PVEntry(["magma","tyth","burn"],6,"G-TY"),invalid.Pull.Progress.Parsely.Counts[2].Started := 2
    wrongProfile := V74PVEntry(["magma","tyth","burn"],7,"G-TY"),wrongProfile.Pull.Progress.Parsely.Key := "future"
    opening := V74PVEntry(["magma"],8,"G-TY")
    tyth := V74PVEntry(["magma","tyth"],9,"G-TY")
    burn := V74PVEntry(["magma","tyth","burn"],10,"G-TY")
    rows := [old,conflict,excluded,unfinished,wrongGroup,invalid,wrongProfile,opening,tyth,burn]
    before := V74PVSignature(rows),markers := ISRIPhaseMilestones(rows,group)
    V48Assert(markers.Length=2,"Only observed non-opening phases create image milestones")
    V48Assert(markers[1].Index=9 && markers[1].Label="Tyth","First eligible observed Tyth phase retains the filtered row index")
    V48Assert(markers[2].Index=10 && markers[2].Label="Burn","Conflicts exclusions unfinished old and invalid rows cannot invent an earlier Burn")
    V48Assert(before=V74PVSignature(rows) && !unfinished.Pull.Ended && conflict.Conflict="Recorders disagree",
        "Reading milestones preserves phase payloads history eligibility and conflict evidence")
    V48Assert(ISRIPhaseMilestones([old],group).Length=0,"A confirmed old kill at zero HP does not invent phases")
    V48Assert(ISRIPhaseMilestones([opening],group).Length=0,"The opening phase does not add a redundant marker")
    V48Assert(ISRIPhaseMilestones(rows,"unknown|area|mode").Length=0 && ISRIPhaseMilestones([],group).Length=0,
        "Unknown scoped profiles and empty histories have no milestones")
    late := V74PVEntry(["burn"],11,"G-TY",true),late.Pull.Progress.Parsely.Limited := true
    markers := ISRIPhaseMilestones([late],group)
    V48Assert(markers.Length=1 && markers[1].Index=1 && markers[1].Label="Burn",
        "Actual late partial observation remains visible without filling unseen prior phases")
    a := V74PVEntry(["opd","catalysts","scyva","ignite","scyva","ignite","scyva","extinction"],12)
    markers := ISRIPhaseMilestones([a,a],a.Pull.Group)
    V48Assert(markers.Length=4,"Repeated observed phases create one milestone per declared phase")
    V48Assert(markers[1].Label="Catalysts" && markers[2].Label="Scyva" && markers[3].Label="Ignite Core" && markers[4].Label="Extinction",
        "Milestones preserve real names in catalogue declaration order")
    for marker in markers
        V48Assert(marker.Index=1,"Multiple phases may first appear in the same pull")
}

V745RICompactPreview()
{
    V58Isolated(V745RICompactPreviewCase)
}

V745RICompactPreviewCase()
{
    ISRIClose(),rows := V742HPEntries(),group := rows[1].Pull.Group
    view := {Boss:group,Team:"*",Window:"all",Cycle:"",Character:"",Source:"history",DemoHistory:true}
    before := V741SavedSignature(rows),model := ISRIBuild(rows,view),l := model.Layout
    V48Assert(model.Width/model.Height>3.0 && model.Width/model.Height<3.8,"default image follows the supplied wide reference proportions")
    V48Assert(!model.ShowDetails && !l.DetailsH && l.Strip.Cells.Length=model.Phase.Rows.Length,"compact strip retains every phase count with detail table optional")
    for i,cell in l.Strip.Cells {
        row := model.Phase.Rows[i]
        V48Assert(cell.Name=row.Name && cell.Count=row.Reached,"phase badge uses the observed reached count and actual phase name")
        V48Assert(cell.X>=0 && cell.X+cell.W<=l.Strip.W && cell.Y+19<=l.Strip.H,"every badge stays inside its strip")
    }
    try {
        ISRISetPreview(model),s := ISRIState(),frozen := IPRCloneSnapshot(s.Model),h := s.Model.Height
        s.Controls["Details"].Value := 1,ISRIDetailsChanged()
        V48Assert(s.Model.ShowDetails && s.Model.Layout.DetailsH>0 && s.Model.Height>h,"phase details control expands the retained full table")
        V48Assert(s.Model.Plot.Points[2].Score=frozen.Plot.Points[2].Score && s.Model.BestIndex=frozen.BestIndex
            && s.Model.Phase.Rows[2].Reached=frozen.Phase.Rows[2].Reached,"expanding details leaves graph values and phase counts intact")
        s.Controls["Details"].Value := 0,ISRIDetailsChanged()
        V48Assert(!s.Model.ShowDetails && s.Model.Height=h,"turning phase details off restores compact dimensions")
        V48Assert(!model.ShowDetails && V741SavedSignature(rows)=before,"preview options do not rewrite source models or saved pulls")
    }
    finally ISRIClose()
}

; Isolated native image-font diagnostics. No live windows, settings or input.
; Expected hashes are the unmodified official Google Fonts static TTF assets.
V746RIFontFamily()
{
    p := ISRICanvas(360,100)
    try {
        ISRIGraphics(p)
        DllCall("Gdiplus\GdipGraphicsClear","Ptr",p.Graphics,"UInt",0xFFFFFFFF)
        V48Assert(p.FontResources.Length=0,"image fonts are not registered before text is drawn")
        ISRIText(p,"Nunito regular",8,8,330,30,18,"000000")
        ISRIText(p,"Nunito bold",8,40,330,30,18,"000000",true)
        ISRIFlushText(p)
        V48Assert(p.FontResources.Length=2,"both embedded static font faces register privately for this canvas")
        V48Assert(p.Fonts.Count=2,"regular and bold text select separate native font objects")
        for expected in [
            {Key:"18|0",Weight:400,Bytes:39072,Hash:"056899e6fad68f3ba400ea1ae9d1a156e52c6839fca08bf141372e2821f2adb5"},
            {Key:"18|1",Weight:700,Bytes:39040,Hash:"2ff1544d575cd14d3fa7f71ee5349b7f9f609c95d123d92864342d70ce9a89d1"}
        ] {
            V48Assert(p.Fonts.Has(expected.Key),"requested Nunito weight has a native font object")
            old := DllCall("Gdi32\SelectObject","Ptr",p.DC,"Ptr",p.Fonts[expected.Key],"Ptr")
            try {
                face := Buffer(128,0)
                chars := DllCall("Gdi32\GetTextFaceW","Ptr",p.DC,"Int",64,"Ptr",face,"Int")
                ; These official static Nunito files retain the legacy GDI
                ; family name "Nunito ExtraLight". Exact bytes and weight below
                ; distinguish the real 400/700 faces from the misleading name.
                V48Assert(chars>0 && StrGet(face,"UTF-16")="Nunito ExtraLight","GDI selects the bundled Nunito family's actual legacy name instead of substituting another font")
                metrics := Buffer(60,0)
                ok := DllCall("Gdi32\GetTextMetricsW","Ptr",p.DC,"Ptr",metrics,"Int")
                V48Assert(ok && NumGet(metrics,28,"Int")=expected.Weight,"selected native face has the requested text weight")
                bytes := DllCall("Gdi32\GetFontData","Ptr",p.DC,"UInt",0,"UInt",0,"Ptr",0,"UInt",0,"UInt")
                V48Assert(bytes=expected.Bytes,"selected face exposes the expected static TTF size")
                data := Buffer(bytes,0)
                actual := DllCall("Gdi32\GetFontData","Ptr",p.DC,"UInt",0,"UInt",0,"Ptr",data,"UInt",bytes,"UInt")
                V48Assert(actual=bytes && IAIBinaryHash(data)=expected.Hash,
                    "selected font bytes match the bundled real face, including real bold rather than synthesized bold")
            }
            finally DllCall("Gdi32\SelectObject","Ptr",p.DC,"Ptr",old,"Ptr")
        }
        resources := p.FontResources.Clone()
        ISRIText(p,"Second text pass",8,72,330,24,18,"000000")
        ISRIFlushText(p)
        V48Assert(p.FontResources.Length=2 && p.FontResources[1]=resources[1] && p.FontResources[2]=resources[2]
            && p.Fonts.Count=2,"a second text pass reuses this canvas's font registrations and native objects")
    }
    finally ISRICanvasClose(p)
}

V746RIFontCleanup()
{
    process := DllCall("GetCurrentProcess","Ptr"),before := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    released := true
    Loop 8 {
        p := ISRICanvas(240,80),resources := []
        try {
            ISRIGraphics(p)
            DllCall("Gdiplus\GdipGraphicsClear","Ptr",p.Graphics,"UInt",0xFFFFFFFF)
            ISRIText(p,"Regular",8,8,220,26,18,"000000")
            ISRIText(p,"Bold",8,38,220,26,18,"000000",true)
            ISRIFlushText(p)
            resources := p.FontResources.Clone()
        }
        finally ISRICanvasClose(p)
        ; If cleanup leaked a resource, this call removes it before reporting
        ; failure. A resource already removed by the canvas returns zero.
        for resource in resources
            if DllCall("Gdi32\RemoveFontMemResourceEx","Ptr",resource,"Int")
                released := false
        ISRICanvasClose(p)
    }
    after := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    V48Assert(released,"closing every canvas unregisters both of its private memory fonts")
    ; GDI may retain deleted font handles internally. Querying a stale handle's
    ; type cannot prove ownership, so count repeated allocations and releases.
    V48Assert(after<=before+2,"repeated image rendering and repeated close calls do not accumulate native resources")
}

; Saved-format fixtures and hidden native views only. No live history, raw log,
; gameplay hotkey, audio, or settings access.
V748PhaseLegacyAvailability()
{
    entries := []
    Loop 31
        entries.Push(V741SavedEntry("G-AE",70-A_Index,A_Index))
    before := V741SavedSignature(entries),m := IGPCBuild(entries,entries[1].Pull.Group)
    V48Assert(m.Counters.Known=0 && m.Counters.Unknown=31 && m.Counters.NeedsImport=31,
        "Legacy Aivela and Esne pulls have missing phase evidence rather than recorded failures")
    V48Assert(m.Rows.Length=3 && m.Rows[1].Name="Codex" && m.Rows[3].Name="Synergy Protocol",
        "Missing evidence retains the encounter's catalogue without inventing repeated occurrences")
    for row in m.Rows {
        V48Assert(row.Reached=0 && row.Earlier=0 && row.Unknown=31 && row.Total=31,
            "Availability presentation preserves all saved-attempt counts")
        V48Assert(row.Text="Unavailable" && row.Percent=-1,
            "No phase evidence is not displayed as zero reached or zero percent")
    }
    V48Assert(InStr(m.Note,"31 pulls lack phase data") && InStr(m.Note,"Re-add their original logs"),
        "The missing-data message identifies the recovery action")
    V48Assert(before=V741SavedSignature(entries),"Viewing availability never edits old saved pulls")
}

V748PhaseMixedAvailability()
{
    old := V741SavedEntry("G-AE",40,1),short := V741SavedEntry("G-AE",30,2),full := V741SavedEntry("G-AE",10,3)
    IGPYDemoPhases(short.Pull,["codex","twins"])
    IGPYDemoPhases(full.Pull,["codex","twins","synergy","twins"])
    entries := [old,short,full],before := V741SavedSignature(entries),m := IGPCBuild(entries,old.Pull.Group)
    V48Assert(m.Counters.Known=2 && m.Counters.Unknown=1 && m.Counters.NeedsImport=1,
        "Mixed current and legacy histories retain their existing evidence counts")
    V48Assert(V74PVNames(m)=IGVJson(["Codex","Aivela and Esne","Synergy Protocol","Aivela and Esne 2"]),
        "Recorded repeated Aivela and Esne phases remain in order")
    V48Assert(m.Rows[1].Text="2 / 3" && Abs(m.Rows[1].Percent-200.0/3)<0.001,
        "Known observations retain the full filtered denominator")
    V48Assert(m.Rows[3].Reached=1 && m.Rows[3].Earlier=1 && m.Rows[3].Unknown=1 && m.Rows[3].Text="1 / 3",
        "An observed absence and a missing legacy observation stay distinct")
    V48Assert(InStr(m.AvailabilityNote,"1 pull lacks phase data") && InStr(m.Note,"Re-add its original log"),
        "Only the missing pull requests new phase evidence")
    V48Assert(before=V741SavedSignature(entries),"Mixed phase presentation does not migrate source history")
}

V748PhaseAvailabilityGuards()
{
    old := V741SavedEntry("G-AE",40,1),group := old.Pull.Group
    blocked := IGPCBuild([old],group,{NeedsTeam:true,Note:"Choose a team"})
    V48Assert(blocked.Counters.NeedsImport=0 && blocked.Note="Choose a team" && blocked.AvailabilityNote="",
        "Team resolution is not replaced with a misleading reimport instruction")
    for reason in ["conflict","excluded","unfinished","wrong scope"] {
        e := IPRCloneSnapshot(old)
        switch reason {
            case "conflict": e.Conflict := "Recorders disagree"
            case "excluded": e.Pull.Included := false
            case "unfinished": e.Pull.Ended := false
            case "wrong scope": e.Pull.Group := "wrong"
        }
        m := IGPCBuild([e],group)
        V48Assert(m.Counters.NeedsImport=0 && m.AvailabilityNote="" && !InStr(m.Note,"Re-add"),
            "Ineligible or conflicting pulls do not request metadata recovery")
    }
    m := IGPCBuild([],group)
    V48Assert(m.Counters.NeedsImport=0 && InStr(m.Note,"No attempts"),"Empty selection retains its own instruction")
    invalid := V741SavedEntry("G-AE",40,2),IGPYDemoPhases(invalid.Pull,["codex"])
    invalid.Pull.Progress.Parsely.Key := "incompatible-phase-profile"
    m := IGPCBuild([invalid],group)
    V48Assert(m.Counters.NeedsImport=1 && m.Rows[1].Text="Unavailable",
        "An eligible incompatible metadata version is unavailable and needs a fresh import")
}

V748PhaseImageAvailability()
{
    V58Isolated(V748PhaseImageAvailabilityCase)
}

V748PhaseImageAvailabilityCase()
{
    global IP,soundboardsEnabled
    entries := [V741SavedEntry("G-AE",40,1),V741SavedEntry("G-AE",10,2)]
    before := V741SavedSignature(entries),view := {Boss:entries[1].Pull.Group,Team:"A",Window:"all",
        Cycle:"",Character:"",Source:"history",DemoHistory:true}
    model := ISRIBuild(entries,view)
    V48Assert(model.Plot.Axis.Kind="combined" && model.Plot.Unknown=0 && model.Layout.FooterH>0,
        "Valid combined HP remains plotted while missing phase data gets a visible image note")
    for cell in model.Layout.Strip.Cells
        V48Assert(cell.Count="--","Image badges show unavailable phase data instead of a false zero")
    zero := ISRIPhaseStrip({Rows:[{Name:"Known absent phase",Reached:0,Known:2}]})
    V48Assert(zero.Cells[1].Count=0,"A genuinely known zero remains a numerical zero in image badges")
    bitmap := 0
    try {
        IGPCRender(model.Phase),s := IGPCState()
        V48Assert(s.Controls["Rows"].GetText(1,2)="Unavailable" && s.Controls["Rows"].GetText(1,4)="2",
            "The hidden native phase table displays unavailable and retains its unknown count")
        V48Assert(InStr(s.Controls["Scope"].Text,"Re-add their original logs"),
            "The hidden native phase window exposes the recovery instruction")
        rendered := ISRIRender(model),bitmap := rendered.Bitmap
        V48Assert(bitmap && rendered.W=2400 && rendered.H=model.Height*2,
            "Missing phase badges and the note render successfully at normal export resolution")
        V48Assert(before=V741SavedSignature(entries) && !IP.Active && !soundboardsEnabled,
            "Native availability views preserve source data and remain isolated from live parsing and audio")
    }
    finally {
        if bitmap
            DllCall("DeleteObject","Ptr",bitmap)
        IGPCClose()
    }
}

; Isolated main Progression-page regressions. All native windows stay hidden.
; Synthetic compact pulls only: no audio, source import, or history writes.
V749ProgressionTabs() => V58Isolated(V749ProgressionTabsCase)
V749ProgressionHost() => V749ProgressionFixture(V749ProgressionHostCase)
V749ProgressionLayout() => V749ProgressionFixture(V749ProgressionLayoutCase)
V749ProgressionRetention() => V749ProgressionFixture(V749ProgressionRetentionCase)
V749ProgressionHiddenWork() => V749ProgressionFixture(V749ProgressionHiddenWorkCase)

V749ProgressionTabsCase()
{
    global SETTINGS_FILE
    tabs := IPWTabs(),order := IPWTabOrder()
    V48Assert(tabs.Length=13 && order.Length=13 && tabs[1]="Log Library" && tabs[2]="Raid" && tabs[3]="Progression","Library leads the tabs; Progression remains beside Raid")
    names := Map(1,"Overview",2,"Damage",3,"Healing",4,"Damage Taken",5,"Healing Taken",6,"Combat Log",7,"Raid",8,"Analysis",9,"Deaths",10,"Rotation",11,"Progression",12,"Session Deaths",13,"Log Library")
    seen := Map()
    for logical,name in names {
        pos := IPWTabPosition(logical)
        V48Assert(pos>=1 && pos<=tabs.Length && !seen.Has(pos) && tabs[pos]=name && IPWTabLogical(pos)=logical,"tab identity survives insertion: " name)
        seen[pos] := true
        IniWrite(1,SETTINGS_FILE,"IrisWorkspace","RaidHomeVersion")
        IniWrite(logical,SETTINGS_FILE,"IrisWorkspace","Tab"),IPWLoadPrefs()
        V48Assert(IPWState().Tab=logical,"isolated preferences restore logical tab " logical)
    }
}

V749ProgressionFixture(action)
{
    V58Isolated(V749ProgressionFixtureInner.Bind(action))
}

V749ProgressionFixtureInner(action)
{
    global IP,soundboardsEnabled,SETTINGS_FILE,SELF_TEST
    v := IGVState(),batch := IGLState(),savedView := v.Clone(),savedBatch := batch.Clone()
    V48Assert(SELF_TEST && !IPMUiHandle(v.Gui) && !batch.Busy,"main Progression diagnostics require an idle hidden test process")
    try {
        V58UseFixture(),IPWProgressionOpen()
        before := {Live:IP.Live,Offline:IP.Offline,Import:IP.ImportFile,Queue:IP.Queue,Head:IP.Head,
            IniExists:!!FileExist(SETTINGS_FILE),Ini:FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE,"UTF-8") : ""}
        action.Call(v)
        V48Assert(!soundboardsEnabled && !IP.Active && !IP.Follow,"Progression navigation stays silent and does not start parsing")
        V48Assert(IP.Live=before.Live && IP.Offline=before.Offline && IP.ImportFile=before.Import && IP.Queue=before.Queue && IP.Head=before.Head,"Progression leaves parser datasets and pending input untouched")
        V48Assert((!!FileExist(SETTINGS_FILE))=before.IniExists && (!before.IniExists || FileRead(SETTINGS_FILE,"UTF-8")==before.Ini),"hidden Progression actions do not write settings")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"main diagnostic window remains hidden")
    }
    finally {
        ; Restore the inert batch before destroying controls, even if an assertion fails.
        for name,value in savedBatch.OwnProps()
            batch.%name% := value
        IPRState().Busy := false,IPRState().Pumping := false,v.Busy := false
        IGVClose(),IACleanup()
        if IP.HasOwnProp("RotationPage") && IsObject(IP.RotationPage) {
            IPWRotationCancel(),IAVRClose()
            if IPMUiHandle(IP.RotationPage.Gui)
                IP.RotationPage.Gui.Destroy()
            IP.RotationPage := ""
        }
        for name,value in savedView.OwnProps()
            v.%name% := value
    }
}

V749ProgressionHostCase(v)
{
    global IP
    h := v.Gui.Hwnd,style := DllCall("User32\GetWindowLongW","Ptr",h,"Int",-16,"UInt")
    V48Assert(IPWState().Tab=11 && IPWTabLogical(IPWState().Controls["Tabs"].Value)=11,"explicit Progression entry selects its main tab")
    V48Assert(v.Parent=IP.Gui.Hwnd && DllCall("User32\GetParent","Ptr",h,"Ptr")=IP.Gui.Hwnd,"Progression is an actual child of the main workspace")
    V48Assert((style&0x40000000)!=0 && (style&0x80000000)=0 && (style&0x00C00000)=0,"Progression has no popup style or separate caption")
    V48Assert(DllCall("User32\GetMenu","Ptr",h,"Ptr")=0 && !v.Visible && !DllCall("User32\IsWindowVisible","Ptr",h,"Int"),"native construction has no desktop menu and stays hidden")
    for name in ["Source","Boss","AddLogs","Refresh","Character","Team","Window","Cycle","Chart","Toggle","Inspect","Compare","Defensive","More"]
        V48Assert(v.Controls.Has(name) && IPMUiHandle(v.Controls[name]),"existing Progression action remains available: " name)
    for name in ["Save","ManageLogs","Help","Mechanics"]
        V48Assert(!V58ChildVisible(v.Controls[name]),"secondary action leaves the compact toolbar: " name)
    menu := IGVToolsMenu(),items := V749ProgressionMenuItems(menu)
    for name in ["Assign recordings to a team...","Manage sources...","Raid utility timing...","Compare rotations...","Search pull events...","Pull notes","Players and recorded characters...","Export raid-night image","Help"]
        V48Assert(items.Has(name),"native Progress tools retains the action: " name)
    V48Assert(!items.Has("Save pulls / team...") && !items.Has("Manage logs..."),"retired save/manage routes are not duplicated beside their current Library actions")
}

V749ProgressionMenuItems(menu)
{
    items := Map(),count := DllCall("User32\GetMenuItemCount","Ptr",menu.Handle,"Int")
    V48Assert(count>=8,"Progress tools contains the existing actions")
    Loop count {
        text := Buffer(1024,0),index := A_Index-1
        DllCall("User32\GetMenuStringW","Ptr",menu.Handle,"UInt",index,"Ptr",text,"Int",512,"UInt",0x400,"Int")
        name := StrGet(text,"UTF-16")
        if name!=""
            items[name] := DllCall("User32\GetMenuState","Ptr",menu.Handle,"UInt",index,"UInt",0x400,"UInt")
    }
    return items
}

V749ProgressionSetSize(w,h)
{
    global IP
    ; Native hidden windows otherwise retain their tiny construction size.
    IP.Gui.Show("Hide w" w " h" h),Sleep(-1),IPResize(IP.Gui,0,w,h)
    return IPWAnalysisRect(IPWLayout(w,h))
}

V749ProgressionAssertBounds(v,box,label)
{
    global IP
    V48Assert(v.Width=box.W && v.Height=box.H,"Progression follows the available page size: " label)
    rect := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",v.Gui.Hwnd,"Ptr",rect)
    scale := A_ScreenDPI/96
    V48Assert(Abs(NumGet(rect,8,"Int")-Round(box.W*scale))<=2 && Abs(NumGet(rect,12,"Int")-Round(box.H*scale))<=2,"native child dimensions agree with logical layout: " label)
    for name,c in v.Controls {
        if !V58ChildVisible(c)
            continue
        c.GetPos(&x,&y,&w,&h)
        V48Assert(x>=-1 && y>=-1 && w>0 && h>0 && x+w<=box.W+1 && y+h<=box.H+1,"visible control stays inside Progression: " label " / " name " [" x "," y "," w "," h "]")
    }
    V48Assert(V58ChildVisible(v.Controls["Rows"])=v.DetailVisible,"pull table visibility matches its toggle: " label)
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",v.Gui.Hwnd,"Int") && !DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"resize/toggle do not reveal hidden windows: " label)
}

V749ProgressionLayoutCase(v)
{
    global IP
    entries := V749ProgressionSeedHistory(v),before := V741SavedSignature(entries)
    for dims in [[980,650],[1220,780],[1600,1000]] {
        box := V749ProgressionSetSize(dims[1],dims[2])
        if v.DetailVisible
            IGVToggleDetails()
        V749ProgressionAssertBounds(v,box,dims[1] "x" dims[2] " graph")
        IP.Gui.GetClientPos(,,&mainW,&mainH),IGVToggleDetails(),Sleep(-1)
        V749ProgressionAssertBounds(v,box,dims[1] "x" dims[2] " table")
        if dims[1]=980 {
            m := v.Plot,z := m.Scale,original := IGVPlotModel(v.Rows,m.Width,m.Height,z,v.Boss)
            V48Assert(IsObject(v.ImageSummary) && m.Axis.Percent,"minimum-height graph uses the image-style health layout")
            V48Assert(m.Top-8*z>=m.ImageLayout.HeaderBottom && m.Bottom+22*z<=m.Height,"compact axis labels clear the actual header and fit the image")
            lastY := -1.0
            for tick in m.YTicks {
                if tick.Label=""
                    continue
                V48Assert(lastY<0 || tick.Y-lastY>=19*z,"compact Y-axis labels do not overlap")
                lastY := tick.Y
            }
            for i,point in m.Points {
                source := original.Points[i]
                V48Assert(point.Score=source.Score && point.Best=source.Best && point.Known=source.Known && point.Label=source.Label,"compact drawing preserves HP-derived scores and labels")
                V48Assert(point.Y>=m.Top && point.Y<=m.Bottom && point.BestY>=m.Top && point.BestY<=m.Bottom,"compact pull and best-so-far coordinates fit their graph")
            }
        }
        IP.Gui.GetClientPos(,,&afterW,&afterH)
        V48Assert(mainW=afterW && mainH=afterH,"showing the pull table does not resize the main window")
        IGVToggleDetails(),Sleep(-1)
        V749ProgressionAssertBounds(v,box,dims[1] "x" dims[2] " graph restored")
    }
    V48Assert(before=V741SavedSignature(entries),"compact resizing leaves saved HP and all source fields unchanged")
}

V749ProgressionSeedHistory(v)
{
    entries := [V741SavedEntry("G-AE",42,1,13),V741SavedEntry("G-AE",17,2,14)]
    v.Source := "history",v.DemoHistory := true,v.History := Map()
    for entry in entries
        v.History[entry.Key] := entry
    v.Boss := entries[1].Pull.Group,v.Character := "",v.Team := "A",v.Window := "all",v.Cycle := ""
    v.Controls["Source"].Choose(2),IGVFillFilters(),IGVRefresh(),IGVSelect(2)
    return entries
}

V749ProgressionRetentionCase(v)
{
    global IP
    entries := V749ProgressionSeedHistory(v),sig := V741SavedSignature(entries),history := v.History,rows := v.Rows,h := v.Gui.Hwnd
    V48Assert(v.Rows.Length=2 && v.Selected=2 && v.Plot.Axis.Percent,"real compact HP fixtures populate the embedded graph")
    menu := IGVToolsMenu(),items := V749ProgressionMenuItems(menu)
    V48Assert(!items.Has("Save pulls / team...") && items.Has("Assign recordings to a team..."),"saved-history view uses the current Library assignment route without the retired save action")
    for tab in [7,8,10,9,1] {
        V58SelectTab(tab)
        V48Assert(v.Gui.Hwnd=h && v.History=history && v.Rows=rows && v.Selected=2,"leaving Progression retains data and selection: " tab)
        IPWProgressionOpen()
        V48Assert(IPWState().Tab=11 && v.Gui.Hwnd=h && v.History=history && v.Rows=rows && v.Selected=2,"returning to Progression reuses its existing view: " tab)
    }
    V48Assert(v.Source="history" && v.Team="A" && v.Boss=entries[1].Pull.Group && sig=V741SavedSignature(entries),"tab changes preserve filters and every saved pull field")
    V48Assert(InStr(IP.InfoText.Text,"Progression"),"aggregate progression has its own main-window heading")
    IPWProgressionVisible(false)
    V48Assert(!v.Visible && v.Gui.Hwnd=h && v.Selected=2,"hiding Progression retains its selected pull")
    IPWProgressionDismiss()
    V48Assert(IPWState().Tab=7 && v.Gui.Hwnd=h && v.History=history && v.Selected=2,"dismiss returns to Raid without destroying progression")
    IPWProgressionOpen()
    V48Assert(IPWState().Tab=11 && v.Gui.Hwnd=h && v.Selected=2,"Progression remains usable after dismiss")
}

V749ProgressionHiddenWorkCase(v)
{
    entries := V749ProgressionSeedHistory(v),history := v.History,rows := v.Rows,h := v.Gui.Hwnd
    batch := IGLState(),job := {CloseAfter:false},p := IPRState()
    batch.Busy := true,batch.Cancel := false,batch.Job := job,p.Busy := true,v.Busy := true
    try {
        V58SelectTab(7),IPWProgressionVisible(false),IPWProgressionOpen()
        V48Assert(IPWState().Tab=11 && v.Gui.Hwnd=h,"an ongoing batch does not block returning to its Progression tab")
        V48Assert(batch.Busy && batch.Job=job && !batch.Cancel && !job.CloseAfter,"switching and hiding do not cancel or replace pending progression work")
        V48Assert(v.History=history && v.Rows=rows && v.Selected=2,"pending batch navigation leaves the completed graph intact")
        IPWProgressionDismiss()
        V48Assert(IPWState().Tab=7 && batch.Job=job && !batch.Cancel && !job.CloseAfter,"dismiss also preserves pending progression work")
    }
    finally batch.Busy := false,batch.Cancel := false,batch.Job := "",p.Busy := false,v.Busy := false
}

; Utility artwork tests use private icon caches, hidden panels and pure events.
V7410UtilityIconIdentities()
{
    for pair in [["Pyrotech","rebounder","880189122806402"],["Plasmatech","rebounder","801354998088314"],
        ["Fury","predation","2516812180750336"],["Concentration","predation","2528567506239488"],
        ["Fury","bloodthirst","2516846540488704"],["Concentration","bloodthirst","2528576096174080"],
        ["Corruption","rez","808287075303424"],["Seer","rez","812826855735296"],
        ["Medicine","rez","814875555135488"],["Sawbones","rez","807217628446720"],
        ["Bodyguard","rez","2940854301884416"],["Combat Medic","rez","2940764107571200"],
        ["Corruption","power","3415495432732672"],["Seer","power","3429041759584256"],
        ["Medicine","tactical","3462357820899328"],["Sawbones","tactical","3462615518937088"],
        ["Bodyguard","celerity","3409808896032768"],["Combat Medic","celerity","3413304999411712"]] {
        s := IRUNewState(),who := "@Utility#2"
        V67UtilityMeta(s,1000,who,pair[1])
        if pair[2]="power" {
            icon := IRUIconId(s.Players[who],IRUCatalog()["power"])
            V48Assert(icon=pair[3] && IAICatalog().Has(icon),"hidden optional buff retains exact faction artwork")
            found := false
            for item in IRURows(s,IRUUNewState(),1000).Rows {
                if item.Key=who Chr(30) "power"
                    found := true
            }
            V48Assert(!found && s.Timers.Count=0,"artwork metadata alone neither reveals optional raid buff nor invents use")
            continue
        }
        row := V67UtilityRow(s,who,pair[2],1000)
        V48Assert(row.IconId=pair[3] && IAICatalog().Has(row.IconId),"class and faction select the exact bundled utility artwork")
        V48Assert(!row.Unknown && row.Ready && row.Status="Ready ~" && s.Timers.Count=0,"initial availability is assumed without creating a use record")
    }
    p := IRUPlayer(IRUNewState(),{Kind:"Player",Key:"@Unknown#2",Name:"Unknown"},0)
    V48Assert(IRUIconId(p,IRUCatalog()["rez"])="","unknown healer class does not guess a resurrection icon")
}

V7410UtilityIconEvidence()
{
    s := IRUNewState(),who := "@Sentinel#2",id := "2528567506239488"
    V67UtilityFeed(s,1000,who,"=",id)
    row := V67UtilityRow(s,who,"predation",2000),timer := s.Timers[who Chr(30) "predation"]
    V48Assert(row.IconId=id && row.Utility="Transcendence","observed cast identifies the Republic mirror before discipline metadata")
    V48Assert(timer.Used=1000 && timer.Due=31000 && row.Status="~0:29","icon identity leaves cooldown timing unchanged")
    V48Assert(V67UtilityRow(s,who,"predation",31000).Ready,"icon-bearing row retains estimated ready transition")
    V67UtilityMeta(s,32000,who,"Fury")
    V48Assert(V67UtilityRow(s,who,"predation",33000).IconId="2516812180750336","current class metadata supersedes an old mirror after combat-style change")
    s := IRUNewState(),who := "@Healer#2",id := "2940764107571200"
    V67UtilityFeed(s,1000,who,"@Dead#3",id)
    V48Assert(s.Timers.Count=0,"learning battle-rez artwork from a cast does not consume its cooldown")
    V67UtilityFeed(s,2500,who,"=",id,"2940764107571466","apply")
    row := V67UtilityRow(s,who,"rez",2500)
    V48Assert(row.IconId=id && row.Status="~5:00","completed rez uses the ability icon, never the completed-self lockout icon")
    s := IRUNewState()
    V67UtilityMeta(s,1000,"@Sage#2","Seer")
    s.Players["@Sage#2"].Observed["power"] := true ; A previously observed holder receives another caster's lockout.
    V67UtilityFeed(s,2000,"@Sorcerer#3","=","3415495432732672")
    V67UtilityFeed(s,2020,"@Sorcerer#3","@Sage#2","3415495432732672","3415495432732947","apply")
    row := V67UtilityRow(s,"@Sage#2","power",2100)
    V48Assert(row.IconId="3429041759584256" && row.Utility="Force Empowerment","recipient lockout keeps its owner's faction artwork")
    V48Assert(row.Status="~5:00" && !row.Ready,"faction-specific artwork leaves shared lockout intact")
}

V7410UtilityIconControls() => V69IconsFixture(V7410UtilityIconControlsCache)
V7410UtilityIconControlsCache(cache) => V67UtilityUIFixture(V7410UtilityIconControlsCase)
V7410UtilityIconControlsCase()
{
    global IPM,IRUU,IRU
    p := IPM.Panels["RaidUtility"],IPMEnsureGui("RaidUtility",0,p)
    original := ObjPtr(IRU),IPMRender("RaidUtility",{LayoutPreview:true},p)
    expected := IRUUPreviewRows(IRUU)
    V48Assert(p.UtilityIcons.Length=24 && p.VisibleRows=expected.Count,"utility icon controls are owned by the independent panel")
    for i,row in expected.Rows {
        cell := p.UtilityIcons[i]
        V48Assert(cell.Id=row.IconId && cell.HaveIcon && cell.Control.Visible,"preview row uses its exact bundled icon")
        V48Assert(SendMessage(0x173,0,0,cell.Control.Hwnd)!=0,"native picture has an actual loaded bitmap")
    }
    cell := p.UtilityIcons[1],bitmap := SendMessage(0x173,0,0,cell.Control.Hwnd)
    p.Signature := "",IPMRender("RaidUtility",{LayoutPreview:true},p)
    V48Assert(SendMessage(0x173,0,0,cell.Control.Hwnd)=bitmap,"successful artwork is reused across changed render signatures")
    V48Assert(!IRUUSetIcon(cell,"99999999999999999","Battle rez") && !cell.Control.Visible,"unknown exact ID hides stale artwork instead of substituting by label")
    V48Assert(p.Rows[1].Total.Visible && p.Rows[1].Total.Text="Battle rez","missing artwork leaves the utility text legible")
    IRUU.Rebounder := false,IRUU.Predation := false,IRUU.RaidBuffs := false
    IPMRender("RaidUtility",{LayoutPreview:true},p)
    V48Assert(p.VisibleRows=2 && p.UtilityIcons[1].Id="808287075303424","filtered rows replace old row artwork")
    Loop p.UtilityIcons.Length-2
        V48Assert(!p.UtilityIcons[A_Index+2].Control.Visible,"filtering hides every surplus native picture")
    IPMRender("RaidUtility",{State:"LIVE LOG"},p)
    for cell in p.UtilityIcons
        V48Assert(!cell.Control.Visible,"ending preview hides every sample icon")
    V48Assert(ObjPtr(IRU)=original && IRU.LastAt=-1 && IRU.Players.Count=0,"preview creates no live utility evidence")
    oldControl := p.UtilityIcons[1].Control,p.Gui.Destroy()
    IPMEnsureGui("RaidUtility",0,p),IPMRender("RaidUtility",{LayoutPreview:true},p)
    V48Assert(!IPMUiHandle(oldControl) && IPMUiHandle(p.UtilityIcons[1].Control),"destroyed panel artwork is rebuilt with owned controls")
    V48Assert(p.UtilityIcons[1].HaveIcon && p.UtilityIcons[1].Control.Visible,"new panel reloads the visible bitmap")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd),"diagnostic panel remains hidden")
    V48Assert((DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt") & 0x08000020)=0x08000020,"icon controls preserve locked click-through and no-activation")
}

V7410UtilityIconLayout() => V69IconsFixture(V7410UtilityIconLayoutCache)
V7410UtilityIconLayoutCache(cache) => V67UtilityUIFixture(V7410UtilityIconLayoutCase)
V7410UtilityIconLayoutCase()
{
    global IPM,IRUU
    p := IPM.Panels["RaidUtility"],IPMEnsureGui("RaidUtility",0,p)
    for width in [196,400,520] {
        p.Width := width
        for font in [8,12,18] {
            IPM.Font := font,p.Signature := "",IPMRender("RaidUtility",{LayoutPreview:true},p)
            Loop p.VisibleRows {
                cell := p.UtilityIcons[A_Index],r := p.Rows[A_Index]
                cell.Control.GetPos(&ix,&iy,&iw,&ih)
                r.Name.GetPos(&nx,&ny,&nw,&nh),r.Total.GetPos(&tx,&ty,&tw,&th),r.Value.GetPos(&vx,&vy,&vw,&vh)
                V48Assert(iw>0 && ih>0 && ix>=0 && iy>=p.Layout.Header && ix+iw<=nx && ix+iw<=tx,"utility artwork stays separate from both text labels at all requested sizes")
                V48Assert(nx+nw<=vx && tx+tw<=vx && iy+ih<=p.Layout.H && vy+vh<=p.Layout.H,"artwork and text stay within the panel without overlapping status")
                V48Assert(nw>0 && tw>0 && vw>0,"narrow overlay retains all three text fields")
                for line in StrSplit(r.Value.Text,"`n","`r")
                    V48Assert(IUMTextWidth(line,SendMessage(0x31,0,0,r.Value.Hwnd))<=vw,"countdown text fits beside artwork")
            }
        }
    }
    IRUU.Predation := false,p.Width := 400,IPM.Font := 10
    IPMRender("RaidUtility",{LayoutPreview:true},p)
    V48Assert(!p.Layout.TwoLines,"default width retains compact rows with utility artwork")
    Loop p.VisibleRows {
        r := p.Rows[A_Index],r.Total.GetPos(&x,&y,&w,&h)
        V48Assert(IUMTextWidth(r.Total.Text,SendMessage(0x31,0,0,r.Total.Hwnd))<=w,"default width preserves complete utility names")
    }
    p.AutoHeight := false,p.Height := 120,IPMRender("RaidUtility",{LayoutPreview:true},p)
    Loop p.UtilityIcons.Length-p.VisibleRows
        V48Assert(!p.UtilityIcons[A_Index+p.VisibleRows].Control.Visible,"height shrink hides every clipped picture")
}

V7410EffectIconsData()
{
    s := IEFNewState(),prefs := IEFUNewState(),prefs.Slots := "Tank"
    V66EffectsFeed(s,1000,"@Me#1","@Tank#3","Kolto Probe","814832605462528","apply",2)
    V66EffectsFeed(s,1001,"@Me#1","@Tank#3","Static Barrier","3411286364782592")
    V66EffectsFeed(s,1002,"@Other#2","@Tank#3","Kolto Shell","985226842996736","apply",6)
    rev := s.Revision,count := s.Active.Count,rows := IEFGridRows(s,prefs,5000),row := rows[1]
    V48Assert(row.Effects.Length=2 && InStr(row.Text,"Probe×2") && InStr(row.Text,"Barrier") && !InStr(row.Text,"Shell"),"structured icon entries preserve existing own-healer filtering and text")
    probe := "",labels := ""
    for entry in row.Effects {
        labels .= (labels="" ? "" : ", ") entry.Type entry.Status.Stack
        if entry.Effect.Id="814832605462528"
            probe := entry
    }
    V48Assert(labels=row.Text,"structured effects retain the same existing map order as the text view")
    V48Assert(IsObject(probe) && probe.Status.Stack="×2" && probe.Status.Time="4s ago","icon row retains real effect identity, stacks and age")
    V48Assert(s.Revision=rev && s.Active.Count=count && probe.Effect.Start=1000,"view construction leaves live evidence unchanged")
    prefs.Slots := "Missing",rows := IEFGridRows(s,prefs,5000)
    V48Assert(!rows[1].Effects.Length && rows[1].Text="Not observed","missing slot never receives another player's icon")
    preview := IEFPreviewState()
    for key,item in preview.Active
        V48Assert(IAICatalog().Has(item.Id) && item.Id!="99900001","explicit preview uses bundled exact effect IDs")
    unknown := {Id:"99999999999999999999",AbilityId:"",Name:"Kolto Probe"}
    V48Assert(IEFIconId(unknown)="","familiar name cannot guess an unknown effect icon")
    unknown.AbilityId := "985226842996736"
    V48Assert(IEFIconId(unknown)="985226842996736","unknown effect may use its recorded exact originating ability")
    unknown.Id := "814832605462528"
    V48Assert(IEFIconId(unknown)="814832605462528","known effect icon takes priority over originating ability")
}

V7410EffectsIconsFixture(action) => V69IconsFixture(V7410EffectsIconsOuter.Bind(action))
V7410EffectsIconsOuter(action,icons) => V66EffectsUIFixture(action)
V7410EffectsIconsNative() => V7410EffectsIconsFixture(V7410EffectsIconsNativeCase)

V7410EffectsIconsNativeCase()
{
    global IEF,IEFU,IPM
    p := IPM.Panels["Effects"],IPMEnsureGui("Effects",0,p)
    V66EffectsFeed(IEF,1000,"@Me#1","@Tank#3","Kolto Probe","814832605462528","apply",2)
    IPMRender("Effects",{},p),cell := p.EffectCells[1],revision := IEF.Revision
    V48Assert(cell.HaveIcon && cell.Id="814832605462528" && cell.Icon.Visible,"live effect renders its exact bundled icon")
    V48Assert(InStr(p.Rows[1].Name.Text,"Kolto Probe") && InStr(p.Rows[1].Name.Text,"×2"),"icon leaves ability and stack label intact")
    bitmap := SendMessage(0x173,0,0,cell.Icon.Hwnd)
    IEF.LastAt += 1000,IPMRender("Effects",{},p)
    V48Assert(bitmap && bitmap=SendMessage(0x173,0,0,cell.Icon.Hwnd) && IEF.Revision=revision,"age refresh reuses the loaded bitmap without changing evidence")
    IEFU.NameFilter := "not present",IPMRender("Effects",{},p)
    V48Assert(!cell.Icon.Visible && p.Empty.Visible && IEF.Active.Count=1,"filter hides existing icon without deleting evidence")
    IEFU.NameFilter := "",IPMRender("Effects",{},p)
    V48Assert(cell.Icon.Visible,"restoring filter restores icon")
    V66EffectsFeed(IEF,3000,"@Me#1","@Tank#3","Kolto Probe","814832605462528","remove"),IPMRender("Effects",{},p)
    V48Assert(!cell.Icon.Visible && p.Empty.Visible,"recorded removal hides stale picture")
    V66EffectsFeed(IEF,4000,"@Me#1","@Tank#3","Kolto Probe","99999999999999999999"),IPMRender("Effects",{},p)
    V48Assert(!cell.Icon.Visible && p.Rows[1].Name.Visible && p.Rows[1].Name.Text="Kolto Probe","unknown ID retains text without reusing the previous picture")
    IPMRender("Effects",{LayoutPreview:true},p)
    V48Assert(p.EffectCells.Count<=24 && IEF.Active.Count=1,"preview is bounded and isolated from live effects")
    IPMRender("Effects",{},p)
    for index,old in p.EffectCells
        V48Assert(!old.Icon.Visible,"leaving preview hides every preview icon absent from live state")
    IPMRetirePanels([p])
    V48Assert(p.EffectCells.Count=0,"panel retirement clears cached icon controls before rebuilding")
    IPMEnsureGui("Effects",0,p),IPMRender("Effects",{LayoutPreview:true},p)
    V48Assert(IPMUiHandle(p.EffectCells[1].Icon) && p.EffectCells[1].HaveIcon,"retired panel recreates valid native icon controls")
    V48Assert(!DllCall("IsWindowVisible","Ptr",p.Gui.Hwnd),"diagnostic overlay stays hidden")
}

V7410HealerIconsNative() => V7410EffectsIconsFixture(V7410HealerIconsNativeCase)
V7410HealerIconsNativeCase()
{
    global IEF,IEFU,IPM
    p := IPM.Panels["HealerGrid"],IPMEnsureGui("HealerGrid",0,p),IEFU.Slots := "Tank"
    V66EffectsFeed(IEF,1000,"@Me#1","@Tank#3","Kolto Probe","814832605462528","apply",2)
    V66EffectsFeed(IEF,1001,"@Me#1","@Tank#3","Static Barrier","3411286364782592")
    V66EffectsFeed(IEF,1002,"@Me#1","@Tank#3","Kolto Shell","985226842996736","apply",6)
    V66EffectsFeed(IEF,1003,"@Me#1","@Tank#3","Force Armor","812736661422080")
    rev := IEF.Revision,IPMRender("HealerGrid",{},p)
    V48Assert(p.EffectCells.Count=3 && InStr(p.Rows[1].Name.Text,"+1"),"one player receives separate effect icons and an honest bounded overflow count")
    for index,cell in p.EffectCells
        V48Assert(cell.HaveIcon && cell.Icon.Visible && cell.Label.Visible,"each displayed HoT or shield has its own icon and status")
    V48Assert(IEF.Revision=rev && IEF.Active.Count=4,"bounded display never discards overflow effects")
    IEFU.Slots := "Missing",IPMRender("HealerGrid",{},p)
    for index,cell in p.EffectCells
        V48Assert(!cell.Icon.Visible && !cell.Label.Visible,"changing slot hides icons and labels of its previous player")
    IEFU.Slots := "Tank",IEF.LastAt := 100000,IPMRender("HealerGrid",{},p)
    V48Assert(InStr(p.EffectCells[1].Label.Text,"?"),"unremoved old effects remain visibly uncertain")
    IEF.Active.Clear(),IEF.Revision += 1,IPMRender("HealerGrid",{},p)
    for index,cell in p.EffectCells
        V48Assert(!cell.Icon.Visible && !cell.Label.Visible,"empty grid hides old icons after effects clear")
    V48Assert(InStr(p.Rows[1].Name.Text,"No tracked effect"),"empty grid retains understandable text")
}

V7410EffectsIconsBounds() => V7410EffectsIconsFixture(V7410EffectsIconsBoundsCase)
V7410EffectsIconsBoundsCase()
{
    global IEFU,IPM
    for kind in ["Effects","HealerGrid"] {
        p := IPM.Panels[kind],IPMEnsureGui(kind,0,p)
        for width in [196,420] {
            p.Width := width
            for font in [8,12,18] {
                IPM.Font := font
                for columns in [1,2,4] {
                    IEFU.Columns := columns,p.Signature := "",IPMRender(kind,{LayoutPreview:true},p)
                    for index,cell in p.EffectCells {
                        if !cell.Icon.Visible
                            continue
                        cell.Icon.GetPos(&ix,&iy,&iw,&ih)
                        V48Assert(ix>=0 && iy>=p.Layout.Header && iw>0 && ih>0 && ix+iw<=p.Layout.W && iy+ih<=p.Layout.H,"icon remains within narrow or large-font panel bounds")
                        label := kind="HealerGrid" ? cell.Label : p.Rows[index].Name
                        label.GetPos(&x,&y,&w,&h)
                        V48Assert(w>0 && x>=ix+iw && x+w<=p.Layout.W && y+h<=p.Layout.H,"text and icon rectangles do not overlap")
                        if kind="HealerGrid" {
                            row := p.Rows[Ceil(index/3)],row.Name.GetPos(&nx,&ny,&nw,&nh)
                            V48Assert(ny+nh<=iy && ix+iw<=nx+nw && x+w<=nx+nw,"HoT icons and labels stay under their own player's heading and inside its column")
                            if row.Total.Visible {
                                row.Total.GetPos(&bx,&by,&bw,&bh)
                                V48Assert(by>=y+h && bx=nx && bw=nw && by+bh<=p.Layout.H,"frame fill begins after icon labels and stays inside its player cell")
                            }
                        }
                    }
                    V48Assert(p.EffectCells.Count<=24,"repeated widths, fonts and columns reuse a bounded control pool")
                }
            }
        }
    }
}

V7410EffectsIconsMissingArt() => V7410EffectsIconsFixture(V7410EffectsIconsMissingArtCase)
V7410EffectsIconsMissingArtCase()
{
    global IEF,IPM
    state := IAIState(),root := state.Root,blocker := root "_blocked",f := FileOpen(blocker,"w")
    f.Write("isolated unwritable-directory fixture"),f.Close(),state.Root := blocker
    try {
        p := IPM.Panels["Effects"],IPMEnsureGui("Effects",0,p)
        V66EffectsFeed(IEF,1000,"@Me#1","@Tank#3","Kolto Probe","814832605462528","apply",2)
        IPMRender("Effects",{},p)
        V48Assert(!p.EffectCells[1].HaveIcon && !p.EffectCells[1].Icon.Visible
            && p.Rows[1].Name.Visible && InStr(p.Rows[1].Name.Text,"Kolto Probe"),"unavailable artwork keeps the full live-effect text visible")
        state.Root := root,state.Paths.Clear(),IEF.LastAt += 1000,IPMRender("Effects",{},p)
        V48Assert(p.EffectCells[1].HaveIcon && p.EffectCells[1].Icon.Visible,"a later render retries a failed icon when extraction recovers")
    }
    finally {
        state.Root := root
        FileDelete(blocker)
    }
}

; Hidden native controls and generated navigation artwork only. No live parser,
; saved settings, combat data, audio or gameplay hotkeys are touched.
V7411TabIconCatalog()
{
    catalog := IPWTIconsCatalog(),seen := Map()
    V48Assert(catalog.Count=13,"every main parser tab has a navigation symbol")
    for logical in IPWTabOrder() {
        V48Assert(catalog.Has(logical) && !seen.Has(catalog[logical].Key),"stable tab identity has its own symbol: " logical)
        seen[catalog[logical].Key] := true
    }
    for size in [16,24,32] {
        list := IPWTIconsBuild(size)
        V48Assert(list && DllCall("Comctl32\ImageList_GetImageCount","Ptr",list,"Int")=13,"native DPI artwork list contains all twelve icons")
        try {
            w := 0,h := 0
            DllCall("Comctl32\ImageList_GetIconSize","Ptr",list,"Int*",&w,"Int*",&h)
            V48Assert(w=size && h=size,"artwork is rendered at its requested pixel size")
            hashes := Map()
            loop 13 {
                fingerprint := V7411TabIconPixels(list,A_Index-1,size)
                V48Assert(!hashes.Has(fingerprint),"each rendered symbol has distinct actual pixels")
                hashes[fingerprint] := true
            }
        }
        finally IPWTIconsRelease(list)
    }
}

V7411TabIconPixels(list,index,size)
{
    info := Buffer(A_PtrSize=8 ? 40 : 32,0)
    V48Assert(DllCall("Comctl32\ImageList_GetImageInfo","Ptr",list,"Int",index,"Ptr",info,"Int"),"icon has a native bitmap")
    bitmap := NumGet(info,0,"Ptr"),details := Buffer(A_PtrSize=8 ? 32 : 24,0)
    V48Assert(bitmap && DllCall("Gdi32\GetObjectW","Ptr",bitmap,"Int",details.Size,"Ptr",details,"Int") && NumGet(details,4,"Int")>=size && NumGet(details,8,"Int")>=size,"icon bitmap has real pixel storage")
    canvas := ISRICanvas(size,size),pixels := Buffer(size*size*4,0),colored := 0
    try {
        DllCall("Gdi32\PatBlt","Ptr",canvas.DC,"Int",0,"Int",0,"Int",size,"Int",size,"UInt",0x00FF0062)
        V48Assert(DllCall("Comctl32\ImageList_Draw","Ptr",list,"Int",index,"Ptr",canvas.DC,"Int",0,"Int",0,"UInt",1,"Int"),"native image list can paint symbol")
        loop size {
            y := A_Index-1
            loop size {
                x := A_Index-1,pixel := DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",x,"Int",y,"UInt")
                NumPut("UInt",pixel,pixels,(y*size+x)*4)
                if pixel!=0xFFFFFF
                    colored += 1
            }
        }
        V48Assert(colored>size && colored<size*size*0.80,"navigation artwork is visible, with transparent surrounding space")
        V48Assert(NumGet(pixels,0,"UInt")=0xFFFFFF && NumGet(pixels,(size*size-1)*4,"UInt")=0xFFFFFF,"transparent corners follow the tab background")
        return IAIBinaryHash(pixels)
    }
    finally ISRICanvasClose(canvas)
}

V7411TabIconFixture(action)
{
    global SELF_TEST
    V48Assert(SELF_TEST,"tab icon regression runs only inside isolated diagnostics")
    g := Gui("-DPIScale"),g.SetFont("s10","Segoe UI")
    tab := g.AddTab2("x0 y0 w" Round(928*A_ScreenDPI/96) " h" Ceil(34*A_ScreenDPI/96) " -Wrap",IPWTabs()),tab.UseTab()
    try {
        V48Assert(IPWTIconsAttach(tab),"icons attach to a native text tab control")
        action.Call(g,tab)
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"diagnostic GUI remains hidden")
    }
    finally g.Destroy()
}

V7411TabIconItem(tab,index)
{
    text := Buffer(512,0),item := Buffer(A_PtrSize=8 ? 40 : 28,0)
    NumPut("UInt",3,item,0),NumPut("Ptr",text.Ptr,item,A_PtrSize=8 ? 16 : 12)
    NumPut("Int",256,item,A_PtrSize=8 ? 24 : 16)
    V48Assert(SendMessage(0x133C,index-1,item.Ptr,tab.Hwnd),"native tab item can be read")
    return {Text:StrGet(text.Ptr,"UTF-16"),Image:NumGet(item,A_PtrSize=8 ? 28 : 20,"Int")}
}

V7411TabIconNative() => V7411TabIconFixture(V7411TabIconNativeCase)
V7411TabIconNativeCase(g,tab)
{
    original := IPWTabs(),order := IPWTabOrder(),state := IPWTIconsState(),owned := state.Tabs[tab.Hwnd]
    for index,name in original {
        item := V7411TabIconItem(tab,index)
        V48Assert(item.Text=name && item.Image=order[index]-1,"native icon changes preserve full accessible text and logical page identity")
    }
    tab.Choose(8),created := state.Created
    V48Assert(IPWTIconsAttach(tab) && tab.Value=8 && state.Created=created,"reattach reuses its list without changing current selection")
    for theme in ["-Theme","+Theme"] {
        tab.Opt(theme),tab.SetFont("s11","Segoe UI")
        V48Assert(SendMessage(0x1302,0,0,tab.Hwnd)=owned.Images && tab.Value=8,"theme/font updates keep icons and selected page")
    }
    bad := order.Clone(),bad[1] := 999
    V48Assert(!IPWTIconsAttach(tab,bad) && SendMessage(0x1302,0,0,tab.Hwnd)=owned.Images,"unsupported identity safely preserves the current native tabs")
    IPWTIconsDetach(tab)
    for index,name in original {
        item := V7411TabIconItem(tab,index)
        V48Assert(item.Text=name && item.Image=-1,"removing decoration returns intact text-only tabs")
    }
    V48Assert(!SendMessage(0x1302,0,0,tab.Hwnd) && tab.Value=8,"text-only fallback keeps the selected page")
    foreign := DllCall("Comctl32\ImageList_Create","Int",16,"Int",16,"UInt",0x20,"Int",1,"Int",0,"Ptr")
    try {
        SendMessage(0x1303,0,foreign,tab.Hwnd)
        V48Assert(!IPWTIconsAttach(tab) && SendMessage(0x1302,0,0,tab.Hwnd)=foreign,"feature never takes ownership of another component's image list")
    }
    finally {
        SendMessage(0x1303,0,0,tab.Hwnd)
        DllCall("Comctl32\ImageList_Destroy","Ptr",foreign,"Int")
    }
}

V7411TabIconLifecycle()
{
    state := IPWTIconsState(),count := state.Tabs.Count,created := state.Created,released := state.Released
    loop 12 {
        g := Gui(),tab := g.AddTab2("w500 h34 -Wrap",IPWTabs()),h := tab.Hwnd
        V48Assert(IPWTIconsAttach(tab),"rebuilding hidden GUI attaches its own image list")
        if Mod(A_Index,2)=0 {
            IPWTIconsDetach(tab),IPWTIconsDetach(tab)
            V48Assert(!state.Tabs.Has(h),"explicit detach is idempotent")
        }
        g.Destroy()
        V48Assert(!state.Tabs.Has(h),"native tab destruction retires icon ownership immediately")
    }
    V48Assert(state.Tabs.Count=count && state.Created-created=12 && state.Released-released=12,"each destroyed or detached tab releases exactly one image list")
    V48Assert(!IPWTIconsAttach(0),"missing native control falls back safely")
    g := Gui(),tab := g.AddTab2("w500 h34 -Wrap",IPWTabs())
    foreign := DllCall("Comctl32\ImageList_Create","Int",16,"Int",16,"UInt",0x20,"Int",1,"Int",0,"Ptr")
    try {
        V48Assert(IPWTIconsAttach(tab),"additional native tab owns its symbols")
        before := state.Released,SendMessage(0x1303,0,foreign,tab.Hwnd),IPWTIconsDetach(tab)
        V48Assert(state.Released=before+1 && SendMessage(0x1302,0,0,tab.Hwnd)=foreign,"replacement by a foreign list releases only Iris-owned resources")
        SendMessage(0x1303,0,0,tab.Hwnd)
        if count=0 {
            IPWTIconsCleanup(),IPWTIconsCleanup()
            V48Assert(!state.Callback && !state.Tabs.Count,"explicit shutdown is idempotent and frees the native callback")
            V48Assert(IPWTIconsAttach(tab) && state.Callback,"GUI rebuild after cleanup recreates the lifetime callback")
        }
    }
    finally {
        g.Destroy()
        DllCall("Comctl32\ImageList_Destroy","Ptr",foreign,"Int")
    }
}

V7411TabIconLayout() => V7411TabIconFixture(V7411TabIconLayoutCase)
V7411TabIconLayoutCase(g,tab)
{
    for logicalWidth in [688,928,1400] {
        width := Round(logicalWidth*A_ScreenDPI/96),height := Ceil(34*A_ScreenDPI/96)
        tab.Move(0,0,width,height)
        for selected in [1,4,6,12,2] {
            tab.Choose(selected),rect := Buffer(16,0)
            V48Assert(SendMessage(0x130A,selected-1,rect.Ptr,tab.Hwnd),"selected native tab has an item rectangle")
            left := NumGet(rect,0,"Int"),right := NumGet(rect,8,"Int"),top := NumGet(rect,4,"Int"),bottom := NumGet(rect,12,"Int")
            V48Assert(left>=0 && right<=width && right>left && top>=0 && bottom<=height,"selected tab including its icon fits native strip: width=" width " selected=" selected " rect=" left "," top "," right "," bottom)
            V48Assert(SendMessage(0x132C,0,0,tab.Hwnd)=1,"narrow tab strip remains one row and leaves page content uncovered")
            item := V7411TabIconItem(tab,selected)
            V48Assert(item.Text=IPWTabs()[selected] && tab.Value=selected,"native overflow scrolling retains full labels and selection")
        }
    }
}

V7411TabIconWorkspace() => V58Isolated(V7411TabIconWorkspaceCase)
V7411TabIconWorkspaceCase()
{
    global IP,IUB
    savedTheme := IUB.Theme
    try {
        V58UseFixture(),tab := IPWState().Controls["Tabs"],order := IPWTabOrder()
        IPResize(IP.Gui,0,1800,820),tab.Choose(1)
        for theme in ["iris","classic","iris"] {
            IUB.Theme := theme,IUBApplyWindow(IP.Gui,"main")
            style := DllCall("User32\GetWindowLongW","Ptr",tab.Hwnd,"Int",-16,"UInt")
            V48Assert(!(style&0x2000) && tab.Value=1,"workspace palette keeps native icon painting and selection after theme roundtrip")
            client := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",tab.Hwnd,"Ptr",client)
            width := NumGet(client,8,"Int"),height := Ceil(40*A_ScreenDPI/96),canvas := ISRICanvas(width,height)
            try {
                SendMessage(0x317,canvas.DC,0x1C,tab.Hwnd)
                for index,logical in order {
                    item := V7411TabIconItem(tab,index),rect := Buffer(16,0)
                    V48Assert(item.Text=IPWTabs()[index] && item.Image=logical-1,"actual workspace preserves the full label and assigned image")
                    SendMessage(0x130A,index-1,rect.Ptr,tab.Hwnd)
                    left := NumGet(rect,0,"Int"),right := NumGet(rect,8,"Int"),top := NumGet(rect,4,"Int"),bottom := NumGet(rect,12,"Int")
                    V48Assert(left>=0 && right<=width && bottom<=height,"wide workspace exposes each whole native tab")
                    color := IPWTIconsCatalog()[logical].Color&0xFFFFFF
                    wanted := (color&0xFF)<<16 | (color&0xFF00) | ((color>>16)&0xFF),found := 0
                    ; Inspect real native-painted pixels. Correct TCIF_IMAGE
                    ; metadata alone cannot detect AHK's text-only owner draw.
                    loop bottom-top {
                        y := top+A_Index-1
                        loop Min(right-left,Ceil(34*A_ScreenDPI/96)) {
                            x := left+A_Index-1
                            pixel := DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",x,"Int",y,"UInt")
                            ; Native x86 alpha conversion can round opaque RGB
                            ; channels one value lower than x64. A two-value
                            ; channel tolerance still rejects text-only paint.
                            if Abs((pixel&255)-(wanted&255))<=2 && Abs(((pixel>>8)&255)-((wanted>>8)&255))<=2
                                && Abs(((pixel>>16)&255)-((wanted>>16)&255))<=2
                                found += 1
                        }
                    }
                    V48Assert(found>2,"native workspace paints visible " IPWTabs()[index] " icon pixels in " theme " theme")
                }
            }
            finally ISRICanvasClose(canvas)
        }
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"actual workspace pixel regression stays hidden")
    }
    finally IUB.Theme := savedTheme
}

V7412ListIconsNative() => V69IconsFixture(V7412ListIconsNativeCase)
V7412ListIconsNativeCase(cache)
{
    global SELF_TEST
    V48Assert(SELF_TEST,"list artwork checks use isolated diagnostics")
    g := Gui("-DPIScale"),lv := g.AddListView("x0 y0 w480 h160",["Ability","Amount","ID"])
    try {
        V48Assert(IAIListAttach(lv),"native small image list attaches")
        owned := IAIListState().Lists[lv.Hwnd]
        a := IAIListOption(lv,"814218425139200","Energy Shield"),b := IAIListOption(lv,"3384812186370048","Scorch")
        V48Assert(a="Icon1" && b="Icon2" && owned.Paths.Count=2,"exact IDs load distinct bundled artwork")
        lv.Add(a,"Shield",20,"814218425139200"),lv.Add(b,"Scorch",10,"3384812186370048")
        lv.Add(IAIListOption(lv,"99999999999999999999","Scorch"),"Unknown",5,"unknown")
        V48Assert(V7412ListRowImage(lv,1)=0 && V7412ListRowImage(lv,2)=1 && V7412ListRowImage(lv,3)=-1,"known rows get their own icons; unknown remains readable without borrowed art")
        lv.ModifyCol(2,"Integer Sort")
        V48Assert(lv.GetText(1,1)="Unknown" && V7412ListRowImage(lv,1)=-1 && lv.GetText(2,1)="Scorch" && V7412ListRowImage(lv,2)=1,"native numeric sorting carries the row artwork with its data")
        lv.Delete(),lv.Add(IAIListOption(lv,"3384812186370048"),"Scorch",99,"3384812186370048")
        V48Assert(V7412ListRowImage(lv,1)=1 && owned.Paths.Count=2,"refresh and player switches reuse cached artwork without stale row images")
        V48Assert(IAIListPathOption(lv,cache.Root "\missing.png")="Icon0" && owned.Paths.Count=2,"missing assets preserve text without caching a wrong icon")
        canvas := ISRICanvas(owned.Size,owned.Size)
        try {
            DllCall("Gdi32\PatBlt","Ptr",canvas.DC,"Int",0,"Int",0,"Int",owned.Size,"Int",owned.Size,"UInt",0x00FF0062)
            V48Assert(DllCall("Comctl32\ImageList_Draw","Ptr",owned.Images,"Int",1,"Ptr",canvas.DC,"Int",0,"Int",0,"UInt",1,"Int"),"bundled artwork paints through the native image list")
            colors := Map()
            loop owned.Size {
                y := A_Index-1
                loop owned.Size
                    colors[DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",A_Index-1,"Int",y,"UInt")] := true
            }
            V48Assert(colors.Count>20,"rendered ability has real artwork pixels")
        }
        finally ISRICanvasClose(canvas)
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"diagnostic root stays hidden")
    }
    finally g.Destroy()
}

V7412ListRowImage(lv,row)
{
    item := Buffer(A_PtrSize=8 ? 88 : 60,0),NumPut("UInt",2,item,0),NumPut("Int",row-1,item,4)
    V48Assert(SendMessage(0x104B,0,item.Ptr,lv.Hwnd),"native row image can be read")
    return NumGet(item,A_PtrSize=8 ? 36 : 28,"Int")
}

V7412ListIconsLifecycle() => V69IconsFixture(V7412ListIconsLifecycleCase)
V7412ListIconsLifecycleCase(cache)
{
    state := IAIListState(),before := state.Lists.Count,created := state.Created,released := state.Released
    loop 5 {
        g := Gui(),lv := g.AddListView("w300 h100",["Ability"]),h := lv.Hwnd
        try {
            V48Assert(IAIListAttach(lv) && IAIListAttach(lv),"repeated attachment retains one owner")
            owned := state.Lists[h]
            lv.Add(IAIListOption(lv,"814218425139200"),"Energy Shield")
            if Mod(A_Index,2) {
                IAIListDetach(lv),IAIListDetach(lv)
                V48Assert(!SendMessage(0x1002,1,0,h) && V7412ListRowImage(lv,1)=-1,"explicit cleanup clears row images and detaches the native handle")
                V48Assert(IAIListAttach(lv),"control accepts a fresh owner after cleanup")
            }
        }
        finally g.Destroy()
        V48Assert(!state.Lists.Has(h),"direct GUI destruction releases its cache")
    }
    V48Assert(state.Lists.Count=before && state.Created-created=state.Released-released,"every created native list is released exactly once")
    g := Gui(),lv := g.AddListView("w300 h100",["Foreign"]),foreign := DllCall("Comctl32\ImageList_Create","Int",18,"Int",18,"UInt",0x20,"Int",1,"Int",0,"Ptr")
    try {
        SendMessage(0x1003,1,foreign,lv.Hwnd)
        V48Assert(!IAIListAttach(lv) && SendMessage(0x1002,1,0,lv.Hwnd)=foreign,"another feature's list is never replaced")
        SendMessage(0x1003,1,0,lv.Hwnd)
        IAIListAttach(lv),SendMessage(0x1003,1,foreign,lv.Hwnd),IAIListDetach(lv)
        V48Assert(SendMessage(0x1002,1,0,lv.Hwnd)=foreign && DllCall("Comctl32\ImageList_GetImageCount","Ptr",foreign,"Int")=0,"later foreign replacement survives our cleanup")
    }
    finally {
        SendMessage(0x1003,1,0,lv.Hwnd),g.Destroy()
        DllCall("Comctl32\ImageList_Destroy","Ptr",foreign,"Int")
    }
}

; Actual hidden parser pages with synthetic records and a private icon cache.
; No live log, settings, audio, gameplay hotkeys or saved encounter data is used.
V7412MainAbilityRows() => V69IconsFixture((*)=>V58Isolated(V7412MainAbilityRowsCase))
V7412OverviewAbilityIcons() => V69IconsFixture((*)=>V58Isolated(V7412OverviewAbilityIconsCase))
V7412MainIconFallback() => V69IconsFixture((*)=>V58Isolated(V7412MainIconFallbackCase))
V7412MainNativePaint() => V69IconsFixture((*)=>V58Isolated(V7412MainNativePaintCase))

V7412MainIconsSeed()
{
    global IP
    s := IPNewData("SYNTHETIC ABILITY ICON FIXTURE"),who := V51Source(),target := V51Target()
    healer := "@Healer#300|(0,0,0,0)|(1000/1000)",other := "Other NPC {990000000000002}:10|(1,2,3,0)|(999/1000)"
    V51Feed(s,0,"Enter",0,who,"=")
    IPFeedLine(s,IPDemoLine(1000,who,target,"Damage",1000,false,-1,"Scorch","3384812186370048"))
    IPFeedLine(s,IPDemoLine(1100,who,other,"Damage",500,false,-1,"Scorch","3384812186370048"))
    IPFeedLine(s,IPDemoLine(2000,who,target,"Damage",300,true,-1,"Scorch","99999999999999999999"))
    IPFeedLine(s,IPDemoLine(2100,target,who,"Damage",150,false,-1,"Synthetic incoming","814218425139200"))
    IPFeedLine(s,IPDemoLine(2200,healer,who,"Heal",500,false,300,"Kolto Probe","814832605462528"))
    IP.Live := s,IP.Selected := 1,IP.Actor := IPActor(who).Key,IP.Follow := false,IP.View := "Live"
    IPRState().Mode := "pull"
    IPWBuild(),IPRefresh()
    return s.Current
}

V7412MainItemImage(lv,row)
{
    item := Buffer(A_PtrSize=8 ? 88 : 60,0)
    NumPut("UInt",2,item,0),NumPut("Int",row-1,item,4)
    V48Assert(SendMessage(0x104B,0,item.Ptr,lv.Hwnd),"native ability row is readable")
    return NumGet(item,A_PtrSize=8 ? 36 : 28,"Int")
}

V7412MainCheckRows(lv)
{
    loop lv.GetCount() {
        row := A_Index,id := lv.GetText(row,8),expected := Integer(SubStr(IAIListOption(lv,id),5))-1
        V48Assert(V7412MainItemImage(lv,row)=expected,"native row artwork follows exact ID through sorting and filtering: " id)
    }
}

V7412MainAbilityRowsCase()
{
    global IP
    seg := V7412MainIconsSeed(),u := IPWState()
    V58SelectTab(2),lv := IP.AbilitiesLV
    V48Assert(lv.GetCount()=2 && lv.GetText(1,2)="1500" && lv.GetText(2,2)="300","icons preserve complete aggregated damage totals")
    V48Assert(V7412MainItemImage(lv,1)>=0 && V7412MainItemImage(lv,2)=-1,"known Scorch gets its image while an identically named unknown ability stays text-only")
    V7412MainCheckRows(lv)
    IPWSort("Abilities",lv,2)
    V48Assert(lv.GetText(1,2)="300" && V7412MainItemImage(lv,1)=-1,"ascending sort keeps the unknown row's empty image attached")
    u.BreakdownSignature := "",IPRefresh(),V7412MainCheckRows(lv)
    IP.OtherChoice.Choose(3),IPChangeOther()
    V48Assert(lv.GetCount()=1 && lv.GetText(1,2)="500" && V7412MainItemImage(lv,1)>=0,"target filter keeps the correct totals and image")
    V58SelectTab(4)
    V48Assert(lv.GetCount()=1 && lv.GetText(1,2)="150" && V7412MainItemImage(lv,1)>=0,"Damage Taken uses the incoming ability ID")
    V58SelectTab(5)
    V48Assert(lv.GetCount()=1 && lv.GetText(1,2)="500" && lv.GetText(1,8)="814832605462528","Healing Taken keeps raw healing and the recorded heal ID")
    V7412MainCheckRows(lv)
    IP.Actor := "@Healer#300",IP.Other := "",V58SelectTab(3)
    V48Assert(lv.GetCount()=1 && lv.GetText(1,2)="300" && V7412MainItemImage(lv,1)>=0,"changing player updates Healing artwork with direct effective totals")
    IP.MetricChoice.Choose(2),IPWHealingChanged()
    V48Assert(lv.GetText(1,2)="500" && lv.GetText(1,8)="814832605462528","raw healing switch changes the amount without replacing the ability identity")
    V58SelectTab(2)
    V48Assert(lv.GetCount()=0,"player without outgoing damage does not retain another player's rows")
    V48Assert(!IP.Active && !IP.Timer && !DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"native page tests do not start parsing or display the app")
}

V7412OverviewAbilityIconsCase()
{
    global IP
    V7412MainIconsSeed(),V58SelectTab(1),u := IPWState(),first := u.Bars[1],second := u.Bars[2]
    V48Assert(first.HaveIcon && first.IconId="3384812186370048" && V58ChildVisible(first.Icon),"top damage ability has a visible exact-ID Picture")
    V48Assert(second.IconId="99999999999999999999" && !second.HaveIcon && !V58ChildVisible(second.Icon),"unknown second ability retains its label without an invented icon")
    V48Assert(first.Name.Text="Scorch" && first.Bar.Value=833 && first.Value.Text!="","Overview totals and percentage bars are retained")
    bitmap := SendMessage(0x173,0,0,first.Icon.Hwnd),info := Buffer(A_PtrSize=8 ? 32 : 24,0)
    V48Assert(bitmap && DllCall("Gdi32\GetObjectW","Ptr",bitmap,"Int",info.Size,"Ptr",info),"Overview icon is backed by an actual loaded native bitmap")
    for width in [980,1220,1800] {
        IPResize(IP.Gui,0,width,780)
        first.Icon.GetPos(&ix,&iy,&iw,&ih),first.Name.GetPos(&nx,&ny,&nw,&nh),first.Bar.GetPos(&bx,&by,&bw,&bh)
        V48Assert(iw=20 && ih=20 && nx>=ix+iw+6 && bx>=nx+nw,"Overview artwork fits beside labels and bars after resize")
        IPWRepaintPage()
        V48Assert(V58ChildVisible(first.Icon) && !V58ChildVisible(second.Icon),"resize and repaint preserve known versus unknown icon visibility")
    }
    V58SelectTab(2)
    for row in u.Bars
        V48Assert(!V58ChildVisible(row.Icon),"Overview icons do not bleed into a different parser page")
    V58SelectTab(1)
    V48Assert(V58ChildVisible(first.Icon) && !V58ChildVisible(second.Icon),"returning to Overview restores only known images")
    IP.Actor := "@Healer#300",IPRefresh()
    for row in u.Bars
        V48Assert(!row.HaveIcon && row.IconId="" && !V58ChildVisible(row.Icon),"selecting a player with no damage clears all old Overview artwork")
    V48Assert(first.Name.Text="No outgoing damage","empty Overview remains useful without icons")
    IP.Actor := IPActor(V51Source()).Key,IPRefresh(),IPWClearData(true),IPWApplyTab()
    for row in u.Bars
        V48Assert(!row.HaveIcon && !V58ChildVisible(row.Icon),"cleared data cannot resurrect a previous Picture on a tab refresh")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"Overview native fixture remains hidden")
}

V7412MainIconFallbackCase()
{
    global IP
    cache := IAIState(),folder := cache.Root,blocker := folder "\not-a-directory"
    DirCreate(folder),f := FileOpen(blocker,"w"),f.Write("synthetic cache failure"),f.Close(),cache.Root := blocker
    try {
        V7412MainIconsSeed(),V58SelectTab(2)
        V48Assert(IP.AbilitiesLV.GetCount()=2 && IP.AbilitiesLV.GetText(1,2)="1500","unwritable icon cache still renders full damage data")
        loop IP.AbilitiesLV.GetCount()
            V48Assert(V7412MainItemImage(IP.AbilitiesLV,A_Index)=-1,"failed image extraction leaves an empty image slot")
        V58SelectTab(1),u := IPWState()
        V48Assert(u.Bars[1].Name.Text="Scorch" && u.Bars[1].Value.Text!="" && !u.Bars[1].HaveIcon,"Overview label and totals survive missing artwork")
        V48Assert(!InStr(IP.Status,"error",false),"optional artwork failure does not become a parser display failure")
    }
    finally cache.Root := folder
}

V7412MainNativePaintCase()
{
    global IP
    V7412MainIconsSeed(),V58SelectTab(2),lv := IP.AbilitiesLV
    rect := Buffer(16,0),NumPut("Int",1,rect,0)
    V48Assert(SendMessage(0x100E,0,rect.Ptr,lv.Hwnd),"actual damage row exposes its native icon rectangle")
    left := NumGet(rect,0,"Int"),top := NumGet(rect,4,"Int"),right := NumGet(rect,8,"Int"),bottom := NumGet(rect,12,"Int")
    client := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",lv.Hwnd,"Ptr",client)
    width := NumGet(client,8,"Int"),height := Min(170,NumGet(client,12,"Int")),canvas := ISRICanvas(width,height)
    try {
        SendMessage(0x317,canvas.DC,0x1C,lv.Hwnd)
        V48Assert(right>left && bottom>top && right<=width && bottom<=height,"damage image lies inside the native visible row")
        colors := Map(),colored := 0
        loop bottom-top {
            y := top+A_Index-1
            loop right-left {
                x := left+A_Index-1,c := DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",x,"Int",y,"UInt")
                colors[c] := true
                if Max(c&255,(c>>8)&255,(c>>16)&255)-Min(c&255,(c>>8)&255,(c>>16)&255)>30
                    colored += 1
            }
        }
        V48Assert(colors.Count>12 && colored>10,"real ListView paint contains colored ability artwork rather than only an assigned image index")
        ISRIWritePng(canvas.Bitmap,A_ScriptDir "\main-damage-abilities.png")
    }
    finally ISRICanvasClose(canvas)
    V58SelectTab(1),u := IPWState(),l := u.Layout,scale := A_ScreenDPI/96
    ; Compose only actual, visible native Overview controls at their real layout
    ; coordinates. The parent remains hidden; this is not a mocked-up screenshot.
    originX := Round(l.InnerX*scale),originY := Round(166*scale)
    width := Round(l.InnerW*scale),height := Round(440*scale),canvas := ISRICanvas(width,height)
    try {
        color := Integer("0x" IP.Gui.BackColor),brush := DllCall("Gdi32\CreateSolidBrush","UInt",(color&255)<<16|(color&0xFF00)|(color>>16)&255,"Ptr")
        fill := Buffer(16,0),NumPut("Int",width,fill,8),NumPut("Int",height,fill,12)
        DllCall("User32\FillRect","Ptr",canvas.DC,"Ptr",fill,"Ptr",brush),DllCall("Gdi32\DeleteObject","Ptr",brush)
        for c in u.Groups["Overview"] {
            if !V58ChildVisible(c)
                continue
            pos := Buffer(16,0),DllCall("User32\GetWindowRect","Ptr",c.Hwnd,"Ptr",pos)
            DllCall("User32\MapWindowPoints","Ptr",0,"Ptr",IP.Gui.Hwnd,"Ptr",pos,"UInt",2)
            saved := DllCall("Gdi32\SaveDC","Ptr",canvas.DC,"Int")
            try {
                DllCall("Gdi32\SetViewportOrgEx","Ptr",canvas.DC,"Int",NumGet(pos,0,"Int")-originX,"Int",NumGet(pos,4,"Int")-originY,"Ptr",0)
                SendMessage(0x317,canvas.DC,0x1C,c.Hwnd)
            }
            finally DllCall("Gdi32\RestoreDC","Ptr",canvas.DC,"Int",saved)
        }
        ISRIWritePng(canvas.Bitmap,A_ScriptDir "\main-overview-abilities.png")
    }
    finally ISRICanvasClose(canvas)
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"native image capture never opens the normal application or shows its fixture")
}

; Hidden native Analysis tables, synthetic metrics and a private icon cache.
; No normal application launch, parsing, settings, hotkeys or audio.
V7412AnalysisIconsFixture(action) => V69IconsFixture(V7412AnalysisIconsOuter.Bind(action))
V7412AnalysisIconsOuter(action,icons) => V59Hidden(action)

V7412AnalysisIconData()
{
    d := IADemoData()
    ; These sample event totals stay synthetic. Substitute real catalogue IDs
    ; only so the real renderer exercises known and unknown bundled artwork.
    ids := Map("990000000000011","3384812186370048","990000000000012","1582223002173440",
        "990000000000013","814832605462528","990000000000010","3384812186370048")
    names := Map("3384812186370048","Scorch","1582223002173440","Retaliation","814832605462528","Kolto Probe")
    for ev in d.Rows {
        if ids.Has(ev.AbilityId) {
            ev.AbilityId := ids[ev.AbilityId],ev.Ability := names[ev.AbilityId]
        }
    }
    return d
}

V7412AnalysisIconRender(actor := "")
{
    a := IAState()
    if !IsObject(a.Data)
        a.Data := V7412AnalysisIconData()
    a.Query := IANewQuery(a.Data,actor),a.Result := IAQuery(a.Data,a.Query),a.Selected := actor
    IARender(false)
    return a
}

V7412AnalysisTableImages(lv,idColumn)
{
    seen := Map()
    Loop lv.GetCount() {
        n := A_Index,id := lv.GetText(n,idColumn),icon := IATableRowIcon(lv,n)
        V48Assert(icon=IAIListOption(lv,id),"native row keeps the image for its exact ID after render or sort")
        if IAICatalog().Has(id)
            V48Assert(icon!="Icon0","known ability has a native image beside its own label")
        else
            V48Assert(icon="Icon0","unknown ability keeps its name without a guessed icon")
        seen[id] := icon
    }
    return seen
}

V7412AnalysisIconRendering() => V7412AnalysisIconsFixture(V7412AnalysisIconRenderingCase)
V7412AnalysisIconRenderingCase()
{
    a := V7412AnalysisIconRender(),d := a.Data,r := a.Result
    totals := [r.D,r.H,r.E,r.T,r.Casts],known := 0
    for entry in [["Damage",10],["Healing",8],["Tanking",10]] {
        lv := a.Tables[entry[1]],images := V7412AnalysisTableImages(lv,entry[2])
        V48Assert(images.Count>0,"rendered Analysis ability table is populated: " entry[1])
        for id,icon in images
            known += icon!="Icon0"
    }
    V48Assert(known>=4,"all three detailed ability views display bundled artwork")
    effects := a.Tables["Effects"]
    for n,row in r.Effects {
        V48Assert(effects.GetText(n,11)=row.Id && IATableRowIcon(effects,n)=IAIListOption(effects,IAEffectIconId(row)),"effect image keeps original row identity for interval selection")
    }
    for name in ["Shields","Buckets","Cycles","Rotation","Log","TankSummary"]
        V48Assert(!SendMessage(0x1002,1,0,a.Tables[name].Hwnd),"no ability image is attached to an unrelated first column: " name)
    again := IAQuery(d,a.Query)
    V48Assert(again.D=totals[1] && again.H=totals[2] && again.E=totals[3] && again.T=totals[4] && again.Casts=totals[5],"decorating real native rows does not alter calculated metrics")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd,"Int"),"Analysis fixture remains physically hidden")
}

V7412AnalysisIconSorting() => V7412AnalysisIconsFixture(V7412AnalysisIconSortingCase)
V7412AnalysisIconSortingCase()
{
    a := V7412AnalysisIconRender()
    for entry in [["Damage",10],["Healing",8],["Tanking",10]] {
        lv := a.Tables[entry[1]],before := V7412AnalysisTableImages(lv,entry[2]),count := lv.GetCount()
        for col in [1,2,1,2] {
            IATableSort(lv,col)
            V48Assert(lv.GetCount()=count,"sorting preserves every ability row")
            after := V7412AnalysisTableImages(lv,entry[2])
            for id,icon in before
                V48Assert(after.Has(id) && after[id]=icon,"sorting leaves each icon attached to its original ability")
        }
    }
    tank := a.Tables["TankSummary"],text := tank.GetText(1,1),count := tank.GetCount()
    IATableSort(tank,1)
    V48Assert(tank.GetCount()=count && IATableRowIcon(tank,1)="Icon0","text-only metric sorting remains supported")
}

V7412AnalysisIconRerender() => V7412AnalysisIconsFixture(V7412AnalysisIconRerenderCase)
V7412AnalysisIconRerenderCase()
{
    a := V7412AnalysisIconRender(),counts := Map()
    for name in ["Damage","Healing","Effects","Tanking"] {
        list := SendMessage(0x1002,1,0,a.Tables[name].Hwnd)
        counts[name] := list ? DllCall("Comctl32\ImageList_GetImageCount","Ptr",list,"Int") : 0
    }
    V7412AnalysisIconRender("@Absent Player#999999")
    for name in ["Damage","Healing","Effects","Tanking"]
        V48Assert(a.Tables[name].GetCount()=0,"switching to an absent actor clears old decorated rows")
    V7412AnalysisIconRender()
    for name in ["Damage","Healing","Effects","Tanking"] {
        list := SendMessage(0x1002,1,0,a.Tables[name].Hwnd)
        V48Assert((list ? DllCall("Comctl32\ImageList_GetImageCount","Ptr",list,"Int") : 0)=counts[name],"repeated query reuses its bounded artwork list")
    }
    V7412AnalysisTableImages(a.Tables["Damage"],10)
    V7412AnalysisIconRender("@Demo Healer#103")
    V48Assert(a.Tables["Healing"].GetCount()>0 && a.Tables["Damage"].GetCount()=0,"changing players keeps correct per-player metrics")
    V7412AnalysisTableImages(a.Tables["Healing"],8)
}

V7412AnalysisEffectIconIdentity()
{
    row := {Id:"814832605462528",AbilityId:"814218425139200",Name:"Different text"}
    V48Assert(IAEffectIconId(row)="814832605462528","known effect ID takes priority over its originating ability")
    row.Id := "99999999999999999999"
    V48Assert(IAEffectIconId(row)="814218425139200","unknown effect uses its recorded exact originating ability")
    row.AbilityId := "",row.Name := "Kolto Probe"
    V48Assert(IAEffectIconId(row)="","a familiar effect name never selects artwork")
    d := V59EffectData([IAEffectLine(1000,"@A#1","@T#2","Example effect","777000000000000"),
        IAEffectLine(2000,"@A#1","@T#2","Example effect","777000000000000","remove"),
        IAEffectLine(3000,"@A#1","@T#2","Example effect","777000000000000"),
        IAEffectLine(4000,"@A#1","@T#2","Example effect","777000000000000","remove")])
    q := {From:0,To:10000,Actor:"@T#2",EffectDirection:"Received",Full:true,FirstSeq:0,LastSeq:0}
    for span in d.Effects
        span.AbilityId := "814832605462528"
    rows := IAEffectQuery(d,q)
    V48Assert(rows.Length=1 && rows[1].AbilityId="814832605462528" && IAEffectIconId(rows[1])="814832605462528","grouped effect retains agreement across recorded originating abilities")
    d.Effects[2].AbilityId := "814218425139200",rows := IAEffectQuery(d,q)
    V48Assert(rows[1].AbilityId="" && IAEffectIconId(rows[1])="" && rows[1].Seconds=2 && rows[1].Applications=2,"conflicting origin IDs remove only fallback art, preserving effect accounting")
    d.Effects[2].Id := "814832605462528",rows := IAEffectQuery(d,q)
    V48Assert(rows.Length=2 && IAEffectIconId(rows[2])="814832605462528","known exact effect art remains valid independently of its origin")
}

V7412AnalysisIconPaint() => V7412AnalysisIconsFixture(V7412AnalysisIconPaintCase.Bind(false))
V7412AnalysisIconCapture() => V7412AnalysisIconsFixture(V7412AnalysisIconPaintCase.Bind(true))
V7412AnalysisIconPaintCase(save)
{
    a := V7412AnalysisIconRender()
    for entry in [["Damage",2],["Healing",3],["Effects",4],["Tanking",5]] {
        name := entry[1],lv := a.Tables[name],a.Controls["Tabs"].Choose(entry[2]),IATabChanged()
        client := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",lv.Hwnd,"Ptr",client)
        width := NumGet(client,8,"Int"),height := NumGet(client,12,"Int")
        last := Buffer(16,0)
        if SendMessage(0x100E,lv.GetCount()-1,last.Ptr,lv.Hwnd)
            height := Min(height,Max(70,NumGet(last,12,"Int")+10))
        canvas := ISRICanvas(width,height)
        try {
            DllCall("Gdi32\PatBlt","Ptr",canvas.DC,"Int",0,"Int",0,"Int",width,"Int",height,"UInt",0x00FF0062)
            SendMessage(0x317,canvas.DC,0x1C,lv.Hwnd)
            painted := false
            Loop lv.GetCount() {
                if IATableRowIcon(lv,A_Index)="Icon0"
                    continue
                rect := Buffer(16,0),NumPut("Int",1,rect,0)
                V48Assert(SendMessage(0x100E,A_Index-1,rect.Ptr,lv.Hwnd),"native ability image has an item rectangle")
                left := NumGet(rect,0,"Int"),top := NumGet(rect,4,"Int")
                right := NumGet(rect,8,"Int"),bottom := NumGet(rect,12,"Int"),colors := Map()
                loop Min(bottom,height)-Max(0,top) {
                    y := Max(0,top)+A_Index-1
                    loop Min(right,width)-Max(0,left)
                        colors[DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",Max(0,left)+A_Index-1,"Int",y,"UInt")] := true
                }
                V48Assert(colors.Count>20,"actual hidden native " name " table paints its ability artwork")
                painted := true
                break
            }
            V48Assert(painted,"native capture includes a known icon in " name)
            if save
                ISRIWritePng(canvas.Bitmap,A_ScriptDir "\analysis-" StrLower(name) ".png")
        }
        finally ISRICanvasClose(canvas)
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd,"Int"),"native Analysis capture keeps its parent hidden")
    }
}

; Synthetic native checks; separate, explicit cache and hidden windows only.
V7412PlayerIconCatalog() => V7412PlayerIconFixture(V7412PlayerIconCatalogCase)
V7412PlayerIconMetadata() => V7412PlayerIconFixture(V7412PlayerIconMetadataCase)
V7412PlayerIconPictures() => V7412PlayerIconFixture(V7412PlayerIconPicturesCase)
V7412PlayerIconWorkspace() => V7412PlayerIconFixture(V58Isolated.Bind(V7412PlayerIconWorkspaceCase))
V7412PlayerIconAnalysis() => V7412PlayerIconFixture(V591Isolated.Bind(V7412PlayerIconAnalysisCase))

V7412PlayerIconFixture(action)
{
    s := IPIState(),saved := Map(),folder := A_Temp "\Iris7412Players_" DllCall("GetCurrentProcessId") "_" A_TickCount
    for key,value in s.OwnProps()
        saved[key] := value
    s.Catalog := Map(),s.Paths := Map(),s.Root := folder,s.Failures := 0
    try action.Call()
    finally {
        if DirExist(folder) {
            Loop Files folder "\*", "F"
                FileDelete(A_LoopFileFullPath)
            DirDelete(folder)
        }
        for key,value in saved
            s.%key% := value
    }
}

V7412PlayerIconCatalogCase()
{
    s := IPIState(),catalog := IPICatalog(),classes := Map(),paths := Map()
    V48Assert(catalog.Count=48 && IPIEmbeddedImages().Count=48 && !DirExist(s.Root),"all 48 discipline identities are bundled without eager extraction")
    for id,item in catalog {
        path := IPIPath(id),image := IPIEmbeddedImages()[item.File]
        V48Assert(path!="" && FileGetSize(path)=image.Bytes && IAIBinaryHash(FileRead(path,"RAW"))=image.Hash,"exact discipline asset passes native integrity: " item.Name)
        classes[item.Class] := classes.Get(item.Class,0)+1,paths[path] := true
    }
    V48Assert(classes.Count=16 && paths.Count=47,"all 16 combat styles resolve; the upstream Combat and Kinetic Combat files share identical bytes")
    for name,count in classes
        V48Assert(count=3,"three recognized disciplines for " name)
    V48Assert(catalog["2031339142381578"].Name="Rage" && catalog["2031339142381578"].Class="Juggernaut","Rage identifies the Imperial Juggernaut")
    V48Assert(IPIPath("2031339142381578")!=IPIPath("2031339142381607"),"Rage and its Republic Focus mirror use distinct genuine discipline art")
    V48Assert(IPIPath("9999999999999999")="" && IPIPath("Rage")="" && IPIPath("mixed")="","missing, named-only and ambiguous identities never guess class or faction")
    id := "2031339142381578",path := IPIPath(id),f := FileOpen(path,"w"),f.Write("corrupt"),f.Close(),s.Paths.Clear()
    V48Assert(IPIPath(id)=path && IAIBinaryHash(FileRead(path,"RAW"))=IPIEmbeddedImages()[catalog[id].File].Hash,"damaged extracted discipline artwork is rebuilt")
}

V7412PlayerIconMetadataCase()
{
    s := V622Data("Localized name","2031339142381578"),seg := s.Current,key := "@RolePlayer#101"
    V48Assert(IPIDiscipline(seg,key)="2031339142381578" && seg.Totals[key].Damage=1000,"accepted exact discipline survives localized labels without changing damage")
    IPBBeginUndo(s,seg),IURRecord(seg,IPParseLine(V622RoleLine(2500,"Focus","2031339142381607")),2500)
    V48Assert(IPIDiscipline(seg,key)="mixed","conflicting accepted spec records are not shown as a single spec")
    IPBRollbackTail(s,seg)
    V48Assert(IPIDiscipline(seg,key)="2031339142381578","spec identity follows the parser's actual tail rollback")
    clone := IPCDecode(IPCEncode(seg))
    V48Assert(IPIDiscipline(clone,key)=IPIDiscipline(seg,key),"persistent cache serialization retains exact per-pull discipline metadata")
    clone.DisplayDisciplines[key] := "2031339142381607"
    V48Assert(IPIDiscipline(seg,key)="2031339142381578","cache decode does not share mutable metadata with the source")
    review := IAAssemble(s,seg,IACaptureNew(seg.Start,seg.Last)),review.DisplayDisciplines[key] := "2031339142381607"
    V48Assert(IPIDiscipline(seg,key)="2031339142381578" && IPIDiscipline(review,key)="2031339142381607","Analysis gets its own frozen discipline map")
    p := IPRCompact(seg)
    V48Assert(p.Players[key].DisciplineId="2031339142381578","compact raid-session participants retain their observed discipline")
    d := IPRNewData(),p.Ended := true,p.Boss := "TEST",d.Pulls.Push(p)
    V48Assert(IPRSummary(d).Players[key].DisciplineId="2031339142381578","a consistent session row retains its exact spec")
    p2 := IPRCloneSnapshot(p),p2.Players[key].DisciplineId := "2031339142381607",d.Pulls.Push(p2)
    V48Assert(IPRSummary(d).Players[key].DisciplineId="mixed","session class swaps cannot inherit the last spec icon")
    p2.Players[key].DeleteProp("DisciplineId")
    V48Assert(IPRSummary(d).Players[key].DisciplineId="mixed","missing older pull metadata is not filled from another pull")
    p2.Included := false
    V48Assert(IPRSummary(d).Players[key].DisciplineId="2031339142381578","session exclusions also update spec identity")
    IPCloseSegment(s,"test end"),two := IPNewSegment(s,5000,"another pull")
    V48Assert(IPIDiscipline(two,key)="" && IPIDiscipline(seg,key)="2031339142381578","new pulls do not inherit the player's earlier discipline")
}

V7412PlayerIconPicturesCase()
{
    g := Gui("+ToolWindow"),p := g.AddPicture("x0 y0 w20 h20 Hidden","")
    try {
        V48Assert(IPISetPicture(p,"2031339142381578"),"a real native Picture loads the genuine Juggernaut spec icon")
        first := SendMessage(0x173,0,0,p.Hwnd)
        V48Assert(first && IPISetPicture(p,"2031339142381578") && SendMessage(0x173,0,0,p.Hwnd)=first,"unchanged selected-player icon reuses its native bitmap")
        V48Assert(!IPISetPicture(p,"") && !p.Visible && SendMessage(0x173,0,0,p.Hwnd)=0,"unknown selection clears the previous bitmap instead of displaying stale class artwork")
        V48Assert(IPISetPicture(p,"2031339142381607") && !DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"switching to Republic spec remains hidden during diagnostics")
    }
    finally g.Destroy()
}

V7412PlayerIconWorkspaceCase()
{
    global IP
    V58UseFixture(),s := IPSelectedData(),seg := IPSelectedSegment(),key := IP.Actor
    ev := IPParseLine(V622RoleLine(seg.Start,"Rage","2031339142381578",key)),IURRecord(seg,ev,seg.Start)
    seg.SnapshotRevision += 1,s.Changed += 1
    V58SelectTab(7),IPWRaid(seg),IPIMainPicture(),u := IPWState()
    V48Assert(u.Controls["PlayerIcon"].Visible && SendMessage(0x173,0,0,u.Controls["PlayerIcon"].Hwnd),"main selected player gets a native spec image")
    lv := IP.PlayersLV,found := false
    Loop lv.GetCount() {
        row := A_Index
        if lv.GetText(row,9)=key {
            found := true,item := Buffer(A_PtrSize=8 ? 88 : 60,0)
            NumPut("UInt",2,item,0),NumPut("Int",row-1,item,4)
            V48Assert(SendMessage(0x104B,0,item.Ptr,lv.Hwnd) && NumGet(item,A_PtrSize=8 ? 36 : 28,"Int")>=0,"Raid player name row uses a real native image index")
        }
    }
    V48Assert(found,"fixture selected player remains in Raid totals")
    for size in [[980,650],[1220,780],[1600,1000]] {
        IPResize(IP.Gui,0,size[1],size[2]),IPWRepaintPage()
        u.Controls["PlayerIcon"].GetPos(&x,&y,&w,&h),u.Controls["PlayerChoice"].GetPos(&dx,&dy,&dw,&dh)
        V48Assert(x>=0 && y>=0 && x+w<=dx && dx+dw<=268 && y+h<=dy+dh,"player icon and full native dropdown do not overlap at " size[1])
    }
    before := seg.Totals[key].Damage,seg.DisplayDisciplines.Clear(),u.RaidSignature := "",IPRefresh(),IPWRepaintPage()
    V48Assert(!u.Controls["PlayerIcon"].Visible && seg.Totals[key].Damage=before,"missing spec clears through page repaint without changing combat totals")
}

V7412PlayerIconAnalysisCase()
{
    global IP
    a := V598Ready(),d := IADemoData()
    d.DisplayDisciplines := Map("@Demo DPS#102","2031339142381578","@Demo Healer#103","2031339142381596")
    IAInstallData(d,"@Demo DPS#102"),IAQueryPump(),p := a.Controls["PlayerIcon"]
    V48Assert(p.Visible && p.IrisPlayerIconPath=IPIPath("2031339142381578"),"loading frozen Analysis displays its selected player's observed spec")
    for index,key in a.PlayerKeys {
        if key="@Demo Healer#103"
            a.Controls["Player"].Choose(index)
    }
    IAPlayerChanged(),IAQueryPump()
    V48Assert(a.Selected="@Demo Healer#103" && p.IrisPlayerIconPath=IPIPath("2031339142381596"),"changing the Analysis player updates the icon independently of main selection")
    for dims in [[664,428],[904,558],[1300,700]] {
        IAEmbeddedResize(dims[1],dims[2]),p.GetPos(&x,&y,&w,&h),a.Controls["Player"].GetPos(&dx,&dy,&dw,&dh)
        a.Controls["PlayerLabel"].GetPos(&lx,&ly,&lw,&lh)
        V48Assert(lx+lw<=x && x+w<=dx && dx+dw<=dims[1] && y+h<=dy+dh,"embedded Analysis player icon fits without covering label or name")
    }
    d.DisplayDisciplines.Clear(),IPIAnalysisPicture(),IAApplyPageVisibility()
    V48Assert(!p.Visible && SendMessage(0x173,0,0,p.Hwnd)=0,"unknown review metadata clears artwork after native page updates")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd,"Int") && !DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"Analysis icon checks never show a normal window")
}

V7412PlayerIconCapture() => V7412PlayerIconFixture(V591Isolated.Bind(V7412PlayerIconCaptureCase))
V7412PlayerIconCaptureCase()
{
    global IP
    a := V598Ready(),s := IPSelectedData(),seg := IPSelectedSegment(),u := IPWState()
    IURRecord(seg,IPParseLine(V622RoleLine(seg.Start,"Rage","2031339142381578",IP.Actor)),seg.Start)
    IURRecord(seg,IPParseLine(V622RoleLine(seg.Start,"Medicine","2031339142381596","@Healer#300")),seg.Start)
    s.Changed += 1,u.RaidSignature := ""
    IP.Gui.Show("Hide w1220 h780"),IPResize(IP.Gui,0,1220,780),V58SelectTab(7)
    IPIMainPicture(),V7412PlayerPicturePaint(u.Controls["PlayerIcon"])
    V7412PlayerControlsPng("main-player-selector.png",IP.Gui,[u.Controls["PlayerCaption"],u.Controls["PlayerChoice"],u.Controls["PlayerIcon"]],0,50,280,60)
    lv := IP.PlayersLV,client := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",lv.Hwnd,"Ptr",client)
    width := NumGet(client,8,"Int"),height := Min(120,NumGet(client,12,"Int")),canvas := ISRICanvas(width,height)
    try {
        SendMessage(0x317,canvas.DC,0x1C,lv.Hwnd),painted := false
        Loop lv.GetCount() {
            item := Buffer(A_PtrSize=8 ? 88 : 60,0),NumPut("UInt",2,item,0),NumPut("Int",A_Index-1,item,4)
            SendMessage(0x104B,0,item.Ptr,lv.Hwnd)
            if NumGet(item,A_PtrSize=8 ? 36 : 28,"Int")<0
                continue
            rect := Buffer(16,0),NumPut("Int",1,rect,0),SendMessage(0x100E,A_Index-1,rect.Ptr,lv.Hwnd)
            colors := Map(),left := NumGet(rect,0,"Int"),top := NumGet(rect,4,"Int"),right := NumGet(rect,8,"Int"),bottom := NumGet(rect,12,"Int")
            loop Min(bottom,height)-Max(0,top) {
                y := Max(0,top)+A_Index-1
                loop Min(right,width)-Max(0,left)
                    colors[DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",Max(0,left)+A_Index-1,"Int",y,"UInt")] := true
            }
            V48Assert(colors.Count>20,"native Raid row paints genuine player artwork, not only an assigned image index")
            painted := true
        }
        V48Assert(painted,"native Raid capture contains player artwork"),ISRIWritePng(canvas.Bitmap,A_ScriptDir "\main-raid-player-icons.png")
    }
    finally ISRICanvasClose(canvas)
    V58SelectTab(8),d := IADemoData(),d.DisplayDisciplines := Map("@Demo DPS#102","2031339142381578")
    IAInstallData(d,"@Demo DPS#102"),IAQueryPump(),IAEmbeddedResize(904,558)
    V7412PlayerPicturePaint(a.Controls["PlayerIcon"])
    V7412PlayerControlsPng("analysis-player-selector.png",a.Gui,[a.Controls["PlayerLabel"],a.Controls["Player"],a.Controls["PlayerIcon"]],0,51,235,35)
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd,"Int") && !DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"player captures never show or reload the normal app")
}

V7412PlayerPicturePaint(c)
{
    client := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",c.Hwnd,"Ptr",client)
    width := NumGet(client,8,"Int"),height := NumGet(client,12,"Int"),canvas := ISRICanvas(width,height),colors := Map()
    try {
        SendMessage(0x317,canvas.DC,0x1C,c.Hwnd)
        loop height {
            y := A_Index-1
            loop width
                colors[DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",A_Index-1,"Int",y,"UInt")] := true
        }
        V48Assert(colors.Count>20,"actual native selected-player Picture paints detailed colored artwork")
    }
    finally ISRICanvasClose(canvas)
}

V7412PlayerControlsPng(file,g,controls,x,y,w,h)
{
    scale := A_ScreenDPI/96,originX := Round(x*scale),originY := Round(y*scale)
    width := Round(w*scale),height := Round(h*scale),canvas := ISRICanvas(width,height)
    try {
        color := Integer("0x" g.BackColor),brush := DllCall("Gdi32\CreateSolidBrush","UInt",(color&255)<<16|(color&0xFF00)|(color>>16)&255,"Ptr")
        rect := Buffer(16,0),NumPut("Int",width,rect,8),NumPut("Int",height,rect,12)
        DllCall("User32\FillRect","Ptr",canvas.DC,"Ptr",rect,"Ptr",brush),DllCall("Gdi32\DeleteObject","Ptr",brush)
        for c in controls {
            pos := Buffer(16,0),DllCall("User32\GetWindowRect","Ptr",c.Hwnd,"Ptr",pos)
            DllCall("User32\MapWindowPoints","Ptr",0,"Ptr",g.Hwnd,"Ptr",pos,"UInt",2)
            saved := DllCall("Gdi32\SaveDC","Ptr",canvas.DC,"Int")
            try {
                DllCall("Gdi32\SetViewportOrgEx","Ptr",canvas.DC,"Int",NumGet(pos,0,"Int")-originX,"Int",NumGet(pos,4,"Int")-originY,"Ptr",0)
                SendMessage(0x317,canvas.DC,0x1C,c.Hwnd)
            }
            finally DllCall("Gdi32\RestoreDC","Ptr",canvas.DC,"Int",saved)
        }
        ISRIWritePng(canvas.Bitmap,A_ScriptDir "\" file)
    }
    finally ISRICanvasClose(canvas)
}

; Private synthetic tables only. Native painting, sorting and selection are
; checked without showing the application or changing user settings.
V7414TableNotifications() => V622With(V7414TableNotificationsCase)
V7414TableNativePaint() => V622With(V7414TableNativePaintCase)
V7414TableLifecycle() => V622With(V7414TableLifecycleCase)
V7414TableClassNames() => V58Isolated(V7414TableClassNamesCase)

V7414TableNotificationsCase(f)
{
    global IUB
    V48Assert(ITBAttach(f.List,2),"native table styling registers through the shared role handler")
    V48Assert(IURState().Tables[f.List.Hwnd].Styled && IURState().Tables[f.List.Hwnd].Column=2,"one notification owner retains the correct logical role column")
    off := IURDrawOffsets(),f.List.Modify(0,"-Select")
    if IUSHighContrast() {
        V48Assert(V624Dispatch(f.List,0x30001,1).Result=0,"high contrast retains system cell painting")
        return
    }
    for row in [1,2] {
        r := V624Dispatch(f.List,0x30001,1,0,row),palette := ITBPalette()
        V48Assert(r.Result=2 && NumGet(r.Buffer,off.Background,"UInt")=IUBColorRef(row=1 ? palette.Row : palette.Alternate),"alternating row fill follows current visual row position")
        V48Assert(NumGet(r.Buffer,off.Text,"UInt")=IUBColorRef(palette.Text),"ordinary data remains readable dark text")
    }
    r := V624Dispatch(f.List,0x30001,2)
    V48Assert(NumGet(r.Buffer,off.Background,"UInt")=IUBColorRef(IURColors("Tank").Background),"existing role-cell colours take precedence over row shading")
    IUB.RoleColors := false,r := V624Dispatch(f.List,0x30001,2)
    V48Assert(r.Result=2 && NumGet(r.Buffer,off.Background,"UInt")=IUBColorRef(ITBPalette().Row),"role-colour option disables role fill without removing table styling")
    f.List.Modify(1,"Select"),r := V624Dispatch(f.List,0x30001,1,0)
    V48Assert(r.Result=0 && f.List.GetNext()=1,"selected rows keep actual native selection even when draw flags disagree")
    f.List.Modify(0,"-Select"),f.List.Enabled := false,r := V624Dispatch(f.List,0x30001,1)
    V48Assert(r.Result=0,"disabled rows retain native appearance")
    f.List.Enabled := true
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",f.Gui.Hwnd,"Int"),"style notifications never reveal the test window")
}

V7414TableNativePaintCase(f)
{
    global IUB
    f.List.ModifyCol(1,230),f.List.ModifyCol(2,125),f.List.Modify(0,"-Select")
    before := [f.List.GetText(1,1),f.List.GetText(2,1)],count := f.List.GetCount()
    for theme in ["iris","classic","iris"] {
        IUB.Theme := theme,ITBAttach(f.List,2),entry := ITBState().Tables[f.List.Hwnd]
        V48Assert(entry.Font && !entry.Failed,"header owns a valid bold native font")
        V48Assert(!(SendMessage(0x1037,0,0,f.List.Hwnd)&1),"table does not draw a heavy native vertical grid")
        client := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",f.List.Hwnd,"Ptr",client)
        canvas := ISRICanvas(NumGet(client,8,"Int"),NumGet(client,12,"Int"))
        try {
            SendMessage(0x317,canvas.DC,0x1C,f.List.Hwnd)
            if !IUSHighContrast() {
                p := ITBPalette(),header := IUBColorRef(p.Header),found := 0
                loop 20 {
                    y := A_Index-1
                    loop 230
                        found += DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",A_Index-1,"Int",y,"UInt")=header
                }
                V48Assert(found>1500,"actual native header paints the flat theme fill")
                for row in [1,2] {
                    rect := Buffer(16,0),NumPut("Int",0,rect,0),SendMessage(0x100E,row-1,rect.Ptr,f.List.Hwnd)
                    y := (NumGet(rect,4,"Int")+NumGet(rect,12,"Int"))//2,wanted := IUBColorRef(row=1 ? p.Row : p.Alternate)
                    V48Assert(DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",180,"Int",y,"UInt")=wanted,"native row pixels show subtle alternating fill in " theme)
                }
                ISRIWritePng(canvas.Bitmap,A_ScriptDir "\table-" theme ".png")
            }
        }
        finally ISRICanvasClose(canvas)
        V48Assert(!entry.Failed && f.List.GetCount()=count && f.List.GetText(1,1)=before[1] && f.List.GetText(2,1)=before[2],"theme and header drawing preserve native row text/order")
    }
    f.List.ModifyCol(1,"SortDesc")
    V48Assert(f.List.GetText(1,1)="Second" && f.List.GetText(2,1)="Sample","ordinary native sorting still operates")
    f.List.ModifyCol(1,180)
    V48Assert(SendMessage(0x101D,0,0,f.List.Hwnd)=Round(180*A_ScreenDPI/96),"native column resize converts logical width to current DPI pixels")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",f.Gui.Hwnd,"Int"),"native table previews remain hidden")
}

V7414TableLifecycleCase(f)
{
    s := ITBState(),before := s.Tables.Count,created := s.CreatedFonts,released := s.ReleasedFonts
    loop 5 {
        g := Gui(),g.SetFont("s9","Segoe UI"),lv := g.AddListView("w300 h110 Grid",["Player","Amount"]),lv.Add(,"Known",12),h := lv.Hwnd
        V48Assert(ITBAttach(lv),"new native table accepts style lifetime hook")
        font := s.Tables[h].Font,number := s.CreatedFonts
        ITBAttach(lv)
        V48Assert(s.Tables[h].Font=font && s.CreatedFonts=number,"repeated styling reuses its header font")
        if Mod(A_Index,2) {
            ITBDetach(h),ITBDetach(h)
            V48Assert(!s.Tables.Has(h) && !IURState().Tables.Has(h) && (SendMessage(0x1037,0,0,h)&1),"explicit detach restores the original grid and retires both notification owners")
            ITBAttach(lv)
        }
        g.Destroy()
        V48Assert(!s.Tables.Has(h) && !IURState().Tables.Has(h),"direct native destruction retires header and row hooks")
    }
    V48Assert(s.Tables.Count=before && s.CreatedFonts-created=s.ReleasedFonts-released,"every owned header font is released exactly once")
}

V7414TableClassNamesCase()
{
    global IP,IUB
    V58UseFixture(),s := IPSelectedData(),seg := IPSelectedSegment(),key := IP.Actor,u := IPWState(),oldTheme := IUB.Theme
    try {
        IUB.Theme := "iris",IURRecord(seg,IPParseLine(V622RoleLine(seg.Start,"Rage","2031339142381578",key)),seg.Start)
        IURRecord(seg,IPParseLine(V622RoleLine(seg.Start,"Medicine","2031339142381596","@Healer#300")),seg.Start)
        s.Changed += 1,u.RaidSignature := "",V58SelectTab(7),lv := IP.PlayersLV,lv.Modify(0,"-Select")
        IUBApplyWindow(IP.Gui,"main"),expected := Map(key,ITBClassColor("2031339142381578"),"@Healer#300",ITBClassColor("2031339142381596"))
        V7414FightCardOwnership()
        total := seg.Totals[key].Damage
        for sort in ["Sort","SortDesc"] {
            lv.ModifyCol(1,sort)
            Loop lv.GetCount() {
                row := A_Index,actor := lv.GetText(row,9),r := V624Dispatch(lv,0x30001,1,0,row)
                if expected.Has(actor) && !IUSHighContrast()
                    V48Assert(NumGet(r.Buffer,IURDrawOffsets().Text,"UInt")=IUBColorRef(expected[actor]),"class text follows exact actor key when rows sort")
            }
        }
        if !IUSHighContrast()
            V7414ClassNamePaint(lv,expected)
        seg.DisplayDisciplines[key] := "mixed"
        Loop lv.GetCount() {
            if lv.GetText(A_Index,9)=key && !IUSHighContrast() {
                r := V624Dispatch(lv,0x30001,1,0,A_Index)
                V48Assert(NumGet(r.Buffer,IURDrawOffsets().Text,"UInt")=IUBColorRef(IUBPalette().Text),"mixed discipline cannot inherit the player's previous class colour")
            }
        }
        V48Assert(seg.Totals[key].Damage=total,"class name decoration does not modify metrics")
        session := u.Controls["SessionPlayers"],p := IPRState()
        p.Result := {Players:Map(key,{DisciplineId:"2031339142381578"},"@Healer#300",{DisciplineId:"2031339142381596"})}
        session.Delete(),session.Add("","Identical name",4,0,0,100,4,4,key,80,"DPS")
        session.Add("","Identical name",3,0,0,100,3,3,"@Healer#300",80,"Healer")
        for sort in ["Sort Integer","SortDesc Integer"] {
            session.ModifyCol(2,sort)
            Loop session.GetCount() {
                row := A_Index,actor := session.GetText(row,IPRPlayerColumns().Key),r := V624Dispatch(session,0x30001,1,0,row)
                if !IUSHighContrast()
                    V48Assert(NumGet(r.Buffer,IURDrawOffsets().Text,"UInt")=IUBColorRef(expected[actor]),"session class colour follows frozen identity despite identical player labels and sorting")
            }
        }
        p.Result.Players[key].DisciplineId := "mixed"
        Loop session.GetCount() {
            if session.GetText(A_Index,IPRPlayerColumns().Key)=key && !IUSHighContrast() {
                r := V624Dispatch(session,0x30001,1,0,A_Index)
                V48Assert(NumGet(r.Buffer,IURDrawOffsets().Text,"UInt")=IUBColorRef(IUBPalette().Text),"mixed session disciplines do not borrow a spec from the main selected pull")
            }
        }
        for id,item in IPICatalog()
            V48Assert(ITBClassColor(id)!="","every recorded Imperial and Republic combat style has a readable colour")
        V48Assert(ITBClassColor("Rage")="" && ITBClassColor("mixed")="" && ITBClassColor("9999999999999999")="","names, roles and unknown IDs cannot select class colours")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"player-colour checks remain hidden")
    }
    finally IUB.Theme := oldTheme
}

V7414FightCardOwnership()
{
    global IP
    lv := IP.SegmentsLV,h := lv.Hwnd,s := IGFState()
    V48Assert(s.Lists.Has(h) && !ITBState().Tables.Has(h) && !IURState().Tables.Has(h),"specialist fight cards retain sole custom-draw ownership after window styling")
    images := SendMessage(0x1002,1,0,h),entry := s.Lists[h]
    V48Assert(!ITBAttach(lv) && SendMessage(0x1002,1,0,h)=images && entry.Images=images,"direct generic attach cannot claim the fight-card list or replace its row-height image list")
    ; Even before specialist registration, the main-list identity is reserved.
    s.Lists.Delete(h)
    try V48Assert(!ITBAttach(lv) && !IURState().Tables.Has(h),"early theme passes reserve main fight-card identity before its registration")
    finally s.Lists[h] := entry
    if IUSHighContrast()
        return
    lv.Modify(0,"-Select"),client := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",h,"Ptr",client)
    canvas := ISRICanvas(NumGet(client,8,"Int"),NumGet(client,12,"Int"))
    try {
        SendMessage(0x317,canvas.DC,0x1C,h)
        V48Assert(lv.GetCount()>0 && entry.Cards.Has(lv.GetText(1,1)),"native fight-card fixture includes title and timing details")
        rect := Buffer(16,0),NumPut("Int",0,rect,0),SendMessage(0x100E,0,rect.Ptr,h)
        left := Max(0,NumGet(rect,0,"Int")),right := Min(NumGet(client,8,"Int"),NumGet(rect,8,"Int"))
        top := NumGet(rect,4,"Int"),bottom := Min(NumGet(client,12,"Int"),NumGet(rect,12,"Int")),middle := (top+bottom)//2
        found := 0,wanted := IUBColorRef(IUBPalette().Muted)
        Loop bottom-middle-2 {
            y := middle+A_Index-1
            Loop right-left
                found += DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",left+A_Index-1,"Int",y,"UInt")=wanted
        }
        V48Assert(found>3 && !entry.Failed,"native fight card still paints its second timing line after generic theme application")
        ISRIWritePng(canvas.Bitmap,A_ScriptDir "\fight-cards-preserved.png")
    }
    finally ISRICanvasClose(canvas)
}

V7414ClassNamePaint(lv,expected)
{
    client := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",lv.Hwnd,"Ptr",client)
    width := NumGet(client,8,"Int"),height := Min(130,NumGet(client,12,"Int")),canvas := ISRICanvas(width,height)
    try {
        SendMessage(0x317,canvas.DC,0x1C,lv.Hwnd)
        Loop lv.GetCount() {
            row := A_Index,key := lv.GetText(row,9)
            if !expected.Has(key)
                continue
            rect := Buffer(16,0),NumPut("Int",2,rect,0)
            V48Assert(SendMessage(0x100E,row-1,rect.Ptr,lv.Hwnd),"native player label rectangle is available")
            left := NumGet(rect,0,"Int"),top := NumGet(rect,4,"Int"),right := Min(NumGet(rect,8,"Int"),width),bottom := Min(NumGet(rect,12,"Int"),height)
            wanted := IUBColorRef(expected[key]),found := 0
            Loop bottom-top {
                y := top+A_Index-1
                Loop right-left
                    found += DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",left+A_Index-1,"Int",y,"UInt")=wanted
            }
            V48Assert(found>1,"actual native player name contains its exact class-colour pixels")
        }
        ISRIWritePng(canvas.Bitmap,A_ScriptDir "\raid-class-names.png")
    }
    finally ISRICanvasClose(canvas)
}

; Native closed dropdown controls only; no visible popup, live input or settings.
V7414DropdownPolicy()
{
    colors := IUDColors(true,false,IUBPalette("iris"))
    contrast := (V622Luminance(colors.Background)+0.05)/(V622Luminance(colors.Text)+0.05)
    V48Assert(colors.Tint && contrast>=7,"light lavender dropdown field keeps strong dark-text contrast")
    V48Assert(!IUDColors(false,false,IUBPalette("iris")).Tint,"existing tint switch remains authoritative")
    V48Assert(!IUDColors(true,false,IUBPalette("classic")).Tint,"Classic keeps native field appearance")
    colors := IUDColors(true,true,IUBPalette("iris"))
    V48Assert(!colors.Tint && colors.Background="Default" && colors.Text="Default","high contrast retains native system colors")
}

V7414DropdownBehavior() => V623With(V7414DropdownBehaviorCase)
V7414DropdownBehaviorCase(f)
{
    global IUB
    h := f.DDL.Hwnd,style := DllCall("User32\GetWindowLongW","Ptr",h,"Int",-16,"UInt")
    dlgCode := SendMessage(0x87,0,0,h),info := Buffer(A_PtrSize=8 ? 64 : 52,0),NumPut("UInt",info.Size,info,0)
    V48Assert(DllCall("User32\GetComboBoxInfo","Ptr",h,"Ptr",info,"Int"),"native combo exposes its real popup list")
    popup := NumGet(info,A_PtrSize=8 ? 56 : 48,"Ptr"),changes := {Count:0}
    f.DDL.OnEvent("Change",(*)=>changes.Count += 1)
    IUDApplyWindow(f.Gui,"analysis")
    V48Assert(f.DDL.Hwnd=h && f.DDL.Value=2 && f.DDL.Text="Second" && changes.Count=0,"decoration never replaces the control or fires its change callback")
    V48Assert(DllCall("User32\GetWindowLongW","Ptr",h,"Int",-16,"UInt")=style && SendMessage(0x87,0,0,h)=dlgCode,"native style and keyboard routing remain unchanged")
    SendMessage(0x100,0x24,0,h),Sleep(-1)
    V48Assert(f.DDL.Value=1,"native Home key still selects the first item")
    SendMessage(0x100,0x23,0,h),Sleep(-1)
    V48Assert(f.DDL.Value=3,"native End key still selects the last item")
    SendMessage(0x102,Ord("s"),0,h),Sleep(-1)
    V48Assert(f.DDL.Value=2 && changes.Count>=2,"native typeahead and existing selection notifications still work")
    DllCall("User32\GetComboBoxInfo","Ptr",h,"Ptr",info)
    V48Assert(NumGet(info,A_PtrSize=8 ? 56 : 48,"Ptr")=popup && !SendMessage(0x157,0,0,h),"native popup identity and closed state are preserved")
    f.DDL.Enabled := false,IUDApplyWindow(f.Gui,"analysis")
    V48Assert(!f.DDL.Enabled && f.DDL.Value=2,"reapplying appearance does not enable a disabled selector")
    f.DDL.Enabled := true,IUB.DropdownTint := false,IUDApplyWindow(f.Gui,"analysis")
    V48Assert(!IUDStyleState().Controls.Has(h) && f.DDL.Value=2,"switching tint off detaches custom painting without resetting selection")
    IUB.DropdownTint := true,IUB.Theme := "classic",IUDApplyWindow(f.Gui,"analysis")
    V48Assert(!IUDStyleState().Controls.Has(h),"Classic never installs closed-field decoration")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",f.Gui.Hwnd,"Int") && !DllCall("User32\IsWindowVisible","Ptr",popup,"Int"),"keyboard diagnostic keeps the parent and real popup hidden")
}

V7414DropdownPaint() => V623With(V7414DropdownPaintCase)
V7414DropdownPaintCase(f)
{
    if IUSHighContrast()
        return
    f.Gui.BackColor := IUBPalette().Background,IUDApplyWindow(f.Gui,"analysis"),h := f.DDL.Hwnd
    rect := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",h,"Ptr",rect)
    w := NumGet(rect,8,"Int"),height := NumGet(rect,12,"Int"),canvas := ISRICanvas(w,height*3+16)
    paints := IUDStyleState().Paints
    try {
        background := DllCall("Gdi32\CreateSolidBrush","UInt",IUBColorRef(f.Gui.BackColor),"Ptr"),fill := Buffer(16,0)
        NumPut("Int",w,fill,8),NumPut("Int",height*3+16,fill,12)
        DllCall("User32\FillRect","Ptr",canvas.DC,"Ptr",fill,"Ptr",background),DllCall("Gdi32\DeleteObject","Ptr",background)
        for index,state in ["normal","disabled","long"] {
            f.DDL.Enabled := state!="disabled"
            if state="long"
                f.DDL.Add(["A much longer phase name that should remain within the field"]),f.DDL.Choose(4)
            saved := DllCall("Gdi32\SaveDC","Ptr",canvas.DC,"Int")
            try {
                DllCall("Gdi32\SetViewportOrgEx","Ptr",canvas.DC,"Int",0,"Int",(index-1)*(height+8),"Ptr",0)
                SendMessage(0x317,canvas.DC,0x1C,h)
            }
            finally DllCall("Gdi32\RestoreDC","Ptr",canvas.DC,"Int",saved)
        }
        V48Assert(IUDStyleState().Paints>=paints+3 && !IUDStyleState().Controls[h].Failed,"real native WM_PRINT dispatch uses the flat field painter without exceptions")
        expected := IUBColorRef(IUDColors(true,false,IUBPalette()).Background),found := 0
        loop w-8 {
            pixel := DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",A_Index+3,"Int",4,"UInt")
            if pixel=expected
                found += 1
        }
        V48Assert(found>w/2,"actual dropdown pixels use the intended light lavender face")
        border := DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",Floor(w/2),"Int",0,"UInt")
        V48Assert(border=IUBColorRef("C9BDD7"),"actual closed field has a single muted border")
        V48Assert(SendMessage(0x146,0,0,h)=4 && f.DDL.Value=4,"ellipsis painting never shortens or replaces item data")
        ISRIWritePng(canvas.Bitmap,A_ScriptDir "\dropdown-fields.png")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",f.Gui.Hwnd,"Int"),"native dropdown paint preview is hidden")
    }
    finally ISRICanvasClose(canvas)
}

V7414DropdownLifetime()
{
    s := IUDStyleState(),before := s.Controls.Count,attached := s.Attached,detached := s.Detached
    loop 8
        V623With(V7414DropdownLifetimeCase)
    V48Assert(s.Controls.Count=before && s.Attached-attached=s.Detached-detached,"native destruction releases every dropdown subclass after repeated build/theme/destroy cycles")
}

V7414DropdownLifetimeCase(f)
{
    global IUB
    loop 3 {
        IUB.DropdownTint := true,IUDApplyWindow(f.Gui,"analysis")
        IUB.DropdownTint := false,IUDApplyWindow(f.Gui,"analysis")
    }
    IUB.DropdownTint := true,IUDApplyWindow(f.Gui,"analysis")
    V48Assert(!IUDStyleAttach(f.Tab) && !IUDStyleAttach(f.List),"decoration never attaches to tabs or result tables")
}

; Hidden native controls and a separate disposable artwork cache only.
V7414BossPortraitCatalog() => V7414BossPortraitFixture(V7414BossPortraitCatalogCase)
V7414BossPortraitPictures() => V7414BossPortraitFixture(V7414BossPortraitPicturesCase)
V7414BossPortraitWorkspace() => V7414BossPortraitFixture(V58Isolated.Bind(V7414BossPortraitWorkspaceCase))
V7414BossPortraitAnalysis() => V7414BossPortraitFixture(V591Isolated.Bind(V7414BossPortraitAnalysisCase))
V7414BossPortraitCapture() => V7414BossPortraitFixture(V591Isolated.Bind(V7414BossPortraitCaptureCase))

V7414BossPortraitFixture(action) => V7415BossCropFixture(action)

V7414BossPortraitCatalogCase()
{
    s := IBPState(),catalog := IBPCatalog()
    V48Assert(catalog.Count=72 && IBPEmbeddedImages().Count=63 && !DirExist(s.Root),"63 visually reviewed boss portraits are bundled without eager extraction")
    for key,file in catalog {
        path := IBPPath(key),item := IBPEmbeddedImages()[file]
        V48Assert(path!="" && FileGetSize(path)=item.Bytes && IAIBinaryHash(FileRead(path,"RAW"))=item.Hash,"native integrity and private extraction: " key)
    }
    for key in IPXProfiles()
        V48Assert(catalog.Has(key),"recognized encounter and difficulty have portrait coverage: " key)
    for key in ["G-SC","G-IZ","DX-TR"]
        V48Assert(catalog.Has(key),"special encounter adapter has portrait coverage: " key)
    V48Assert(!IBPEmbeddedImages()[catalog["G-AE"]].HasOwnProp("Panels"),"sisters use a single Aivela portrait")
    for key in ["","Trash","UNSUPPORTED-BOSS","Nahut","G-NA/unknown"]
        V48Assert(IBPPath(key)="","unavailable and unknown identity never guesses a boss portrait: " key)
    V48Assert(IBPKey({BossKey:"G-NA",Name:"local name"})="G-NA" && IBPKey({Name:"Nahut"})="","artwork uses accepted encounter identity only")
    path := IBPPath("G-NA"),f := FileOpen(path,"w"),f.Write("corrupt"),f.Close(),s.Paths.Clear()
    V48Assert(IBPPath("G-NA")=path && IAIBinaryHash(FileRead(path,"RAW"))=IBPEmbeddedImages()[catalog["G-NA"]].Hash,"corrupt cached artwork is rebuilt from the verified bundle")
    savedRoot := s.Root,s.Root := "",s.Paths.Clear()
    V48Assert(IBPPath("G-NA")="","SELF_TEST refuses to write the normal artwork cache")
    s.Root := savedRoot
    blocker := s.Root "\blocked",f := FileOpen(blocker,"w"),f.Write("not a directory"),f.Close(),s.Root := blocker
    V48Assert(IBPPath("G-NA")="" && s.Failures=1,"unwritable artwork cache degrades to the existing text title")
    s.Root := savedRoot,s.Paths.Clear()
}

V7414BossPortraitPicturesCase()
{
    g := Gui("+ToolWindow"),p := g.AddPicture("x0 y0 w36 h36 Hidden","")
    try {
        V48Assert(IBPSetPicture(p,"G-NA",36),"native Picture loads genuine Nahut art")
        first := SendMessage(0x173,0,0,p.Hwnd)
        V48Assert(first && IBPSetPicture(p,"G-NA",36) && SendMessage(0x173,0,0,p.Hwnd)=first,"unchanged selection reuses its owned native bitmap")
        V7412PlayerPicturePaint(p)
        V48Assert(!IBPSetPicture(p,"UNSUPPORTED-BOSS",36) && !p.Visible && !SendMessage(0x173,0,0,p.Hwnd),"unsupported boss clears the previous native portrait")
        V48Assert(IBPSetPicture(p,"DF-BR",20),"another boss loads at the compact Analysis size")
        p.GetPos(&x,&y,&w,&h)
        V48Assert(w=20 && h=20,"native Picture keeps the requested logical size")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"portrait diagnostics never show a window")
    }
    finally g.Destroy()
}

V7414BossPortraitWorkspaceCase()
{
    global IP
    V58UseFixture(),seg := IPSelectedSegment(),u := IPWState()
    seg.BossKey := "G-NA",seg.BossName := "Nahut",seg.Opponent := "Nahut",V58SelectTab(1),IPRefresh(),IBPMain()
    p := u.Controls["BossPortrait"],title := IP.InfoText.Text
    V48Assert(p.Visible && SendMessage(0x173,0,0,p.Hwnd),"selected recognized pull displays its genuine portrait")
    for dims in [[980,650],[1220,780],[1600,1000]] {
        IPResize(IP.Gui,0,dims[1],dims[2]),IPWRepaintPage(),p.GetPos(&x,&y,&w,&h),IP.InfoText.GetPos(&tx,&ty,&tw,&th)
        V48Assert(w=36 && h=36 && x+w<tx && tx+tw<=dims[1] && tw>=640,"portrait does not cover the fight title at width " dims[1])
    }
    seg.BossKey := "",seg.BossName := "",seg.Opponent := "Trash",IPRefresh(),IPWRepaintPage()
    V48Assert(!p.Visible && !SendMessage(0x173,0,0,p.Hwnd),"known pull to trash clears the bitmap after actual refresh and repaint")
    seg.BossKey := "G-NA",seg.BossName := "Nahut",seg.Opponent := "Nahut",IPRefresh()
    V58SelectTab(9),IBPMain()
    V48Assert(!p.Visible,"pinned death heading does not inherit the main selected pull portrait")
    V58SelectTab(1),IBPMain()
    V48Assert(p.Visible && IP.InfoText.Text=title,"returning to the selected fight restores its art and complete title")
}

V7414BossPortraitAnalysisCase()
{
    a := V598Ready(),d := IADemoData(),d.BossKey := "DF-BR",d.Name := "Dread Master Brontes"
    IAInstallData(d,"@Demo DPS#102"),IAQueryPump(),p := a.Controls["BossPortrait"]
    V48Assert(p.Visible && InStr(a.Controls["Heading"].Text,d.Name),"frozen Analysis data supplies its own portrait identity and full title")
    for dims in [[664,428],[904,558],[1300,700]] {
        IAEmbeddedResize(dims[1],dims[2]),IAApplyPageVisibility()
        p.GetPos(&x,&y,&w,&h),a.Controls["Heading"].GetPos(&tx,&ty,&tw,&th)
        V48Assert(w=20 && h=20 && x+w<tx && tx+tw<=dims[1] && y+h<=55,"embedded Analysis portrait stays in its existing heading row")
    }
    d.BossKey := "UNSUPPORTED-BOSS",IBPAnalysis(),IAApplyPageVisibility()
    V48Assert(!p.Visible && !SendMessage(0x173,0,0,p.Hwnd),"unavailable Analysis art clears through page visibility refresh")
    a.Controls["Heading"].GetPos(&tx)
    V48Assert(tx=0,"missing portrait returns the whole heading width to text")
    oldParent := a.Parent,a.Parent := 0,a.Width := 1220,d.BossKey := "DF-BR",IBPAnalysis()
    p.GetPos(&x,&y,&w,&h),a.Controls["Heading"].GetPos(&tx,&ty,&tw,&th)
    V48Assert(w=32 && h=32 && x=246 && x+w<tx && tx+tw<=1220,"standalone Analysis geometry preserves a readable heading")
    a.Parent := oldParent,IBPAnalysis()
}

V7414BossPortraitCaptureCase()
{
    global IP
    a := V598Ready(),seg := IPSelectedSegment(),u := IPWState()
    seg.BossKey := "DF-BR",seg.BossName := "Dread Master Brontes",seg.Opponent := "Dread Master Brontes"
    IP.Gui.Show("Hide w1220 h780"),IPResize(IP.Gui,0,1220,780),V58SelectTab(1),IPRefresh(),IBPMain()
    V7412PlayerPicturePaint(u.Controls["BossPortrait"])
    V7412PlayerControlsPng("main-boss-portrait.png",IP.Gui,[IP.InfoText,IP.Subtitle,u.Controls["BossPortrait"]],280,50,928,69)
    V58SelectTab(8),d := IADemoData(),d.BossKey := "DF-BR",d.Name := "Dread Master Brontes"
    IAInstallData(d,"@Demo DPS#102"),IAQueryPump(),IAEmbeddedResize(904,558),IAApplyPageVisibility()
    V7412PlayerPicturePaint(a.Controls["BossPortrait"])
    V7412PlayerControlsPng("analysis-boss-portrait.png",a.Gui,[a.Controls["Heading"],a.Controls["BossPortrait"]],0,30,904,28)
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"portrait captures leave the normal app untouched")
}

; Synthetic color regions prove actual source cropping, not just assigned handles.
; All files and native bitmap caches are private, restored and disposed.
V7415BossCropCatalog() => V7415BossCropFixture(V7415BossCropCatalogCase)
V7415BossCropPixels() => V7415BossCropFixture(V7415BossCropPixelsCase)
V7415BossCropLifetime() => V7415BossCropFixture(V7415BossCropLifetimeCase)

V7415BossCropFixture(action)
{
    s := IBPState(),saved := Map(),folder := A_Temp "\Iris7415Crops_" DllCall("GetCurrentProcessId") "_" A_TickCount
    for key,value in s.OwnProps()
        saved[key] := value
    s.Catalog := Map(),s.Paths := Map(),s.Root := folder,s.Failures := 0
    s.Bitmaps := Map(),s.Clock := 0,s.Created := 0,s.Released := 0,s.Renders := 0
    try action.Call()
    finally {
        IBPCleanup()
        if DirExist(folder) {
            Loop Files folder "\*", "F"
                FileDelete(A_LoopFileFullPath)
            DirDelete(folder)
        }
        for key,value in saved {
            if key!="ExitHook"
                s.%key% := value
        }
    }
}

V7415BossCropCatalogCase()
{
    catalog := IBPCatalog(),large := 0,jpegs := 0,sources := Map()
    for key,file in catalog
        sources[file] := true
    V48Assert(catalog.Count>0 && IBPEmbeddedImages().Count=sources.Count,"every bundled source has a mapping; exact mode aliases may share artwork")
    V48Assert(catalog.Has("DX-HV") && catalog["DX-HV"]=catalog["DX-HMM"]
        && IBPPath("DX-HV")=IBPPath("DX-HMM"),"both recognized Huntmaster modes reuse the same verified source")
    for key,file in catalog {
        item := IBPEmbeddedImages()[file],path := IBPPath(key)
        V48Assert(IBPImageValid(item) && path!="" && IAIBinaryHash(FileRead(path,"RAW"))=item.Hash,"original file and crop metadata verify: " key)
        pixels := IBPBitmap(path,item,36)
        V48Assert(pixels && V7415BossBitmapSize(pixels)=36,"native decoder renders original source and exact crop: " key)
        large += item.Bytes>65536,jpegs += SubStr(file,-3)="jpg"
    }
    V48Assert(large>0 && jpegs>0,"large original screenshots use the scoped PNG/JPEG decoder")
    s := IBPState(),renders := s.Renders
    for key,file in catalog
        IBPBitmap(IBPPath(key),IBPEmbeddedImages()[file],36)
    V48Assert(s.Renders=renders,"repeat views reuse cached cropped bitmaps without decoding source again")
    V48Assert(s.Bitmaps.Count<=64 && s.Created-s.Released=s.Bitmaps.Count,"all cached native objects have matching ownership accounting")
}

V7415BossCropSource()
{
    s := IBPState(),path := s.Root "\color-source.png",canvas := ISRICanvas(80,40)
    DirCreate(s.Root)
    try {
        for part in [[0,0x0000FF],[40,0xFF0000]] {
            rect := Buffer(16,0),NumPut("Int",part[1],rect,0),NumPut("Int",part[1]+40,rect,8),NumPut("Int",40,rect,12)
            brush := DllCall("Gdi32\CreateSolidBrush","UInt",part[2],"Ptr")
            try DllCall("User32\FillRect","Ptr",canvas.DC,"Ptr",rect,"Ptr",brush)
            finally DllCall("Gdi32\DeleteObject","Ptr",brush)
        }
        ISRIWritePng(canvas.Bitmap,path)
    }
    finally ISRICanvasClose(canvas)
    bytes := FileRead(path,"RAW"),chars := 0
    DllCall("Crypt32\CryptBinaryToStringW","Ptr",bytes,"UInt",bytes.Size,"UInt",0x40000001,"Ptr",0,"UInt*",&chars)
    text := Buffer(chars*2,0)
    DllCall("Crypt32\CryptBinaryToStringW","Ptr",bytes,"UInt",bytes.Size,"UInt",0x40000001,"Ptr",text,"UInt*",&chars)
    return {Path:path,Hash:IAIBinaryHash(bytes),Bytes:bytes.Size,Data:StrGet(text,"UTF-16"),Width:80,Height:40,Crop:[40,0,40,40]}
}

V7415BossBitmapSize(bitmap)
{
    info := Buffer(32,0)
    return DllCall("Gdi32\GetObjectW","Ptr",bitmap,"Int",info.Size,"Ptr",info)
        && NumGet(info,4,"Int")=NumGet(info,8,"Int") ? NumGet(info,4,"Int") : 0
}

V7415BossBitmapPixel(bitmap,x,y)
{
    dc := DllCall("Gdi32\CreateCompatibleDC","Ptr",0,"Ptr"),old := DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",bitmap,"Ptr")
    try return DllCall("Gdi32\GetPixel","Ptr",dc,"Int",x,"Int",y,"UInt")
    finally {
        DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",old)
        DllCall("Gdi32\DeleteDC","Ptr",dc)
    }
}

V7415BossCropPixelsCase()
{
    s := IBPState(),item := V7415BossCropSource(),images := IBPEmbeddedImages(),g := Gui("+ToolWindow")
    IBPCatalog(),images["test-crop.png"] := item,s.Catalog["TEST-CROP"] := "test-crop.png"
    p := g.AddPicture("x0 y0 w36 h36 Hidden","")
    try {
        for pixels in [20,32,36,40,64,72,108] {
            bitmap := IBPBitmap(item.Path,item,pixels)
            V48Assert(V7415BossBitmapSize(bitmap)=pixels && V7415BossBitmapPixel(bitmap,pixels//2,pixels//2)=0xFF0000,"actual cropped blue source pixels at native size " pixels)
        }
        item.Crop := [0,0,40,40],bitmap := IBPBitmap(item.Path,item,36)
        V48Assert(V7415BossBitmapPixel(bitmap,18,18)=0x0000FF,"same source hash with changed crop does not reuse the old face region")
        for size in [20,32,36] {
            V48Assert(IBPSetPicture(p,"TEST-CROP",size),"native Picture accepts logical size " size)
            dpi := DllCall("User32\GetDpiForWindow","Ptr",p.Hwnd,"UInt"),bitmap := SendMessage(0x173,0,0,p.Hwnd)
            V48Assert(V7415BossBitmapSize(bitmap)=Round(size*dpi/96),"native bitmap honors actual window DPI without second resizing: logical=" size ", DPI=" dpi ", bitmap=" V7415BossBitmapSize(bitmap))
            p.GetPos(&x,&y,&w,&h)
            V48Assert(w=size && h=size,"control retains logical geometry at size " size)
        }
        savedHash := IAIBinaryHash(FileRead(item.Path,"RAW")),item.Crop := [-1,0,40,40]
        V48Assert(!IBPSetPicture(p,"TEST-CROP",36) && !p.Visible && !SendMessage(0x173,0,0,p.Hwnd),"invalid crop clears stale portrait and keeps text fallback")
        for crop in [[0,0,0,1],[0,0,81,40],[60,0,40,40],[0,39,40,40],[0.5,0,40,40],[0,0,1]] {
            item.Crop := crop
            V48Assert(!IBPImageValid(item),"invalid/out-of-bounds crop metadata is rejected")
        }
        item.Crop := [0,0,40,40],item.Width := 79
        V48Assert(!IBPBitmap(item.Path,item,37),"declared dimensions must match the original decoded image")
        item.Width := 80,item.Bytes := 2097153
        V48Assert(!IBPImageValid(item),"original artwork size is bounded at two MiB")
        item.Bytes := FileGetSize(item.Path),bad := false
        try IBPDecode(item.Data,"jpg")
        catch
            bad := true
        V48Assert(bad && IAIBinaryHash(FileRead(item.Path,"RAW"))=savedHash,"wrong format is rejected and source bytes remain unchanged by rendering")
    }
    finally {
        g.Destroy(),images.Delete("test-crop.png"),s.Catalog.Delete("TEST-CROP")
        if s.Paths.Has("test-crop.png")
            s.Paths.Delete("test-crop.png")
    }
}

V7415BossCropLifetimeCase()
{
    s := IBPState(),item := V7415BossCropSource(),images := IBPEmbeddedImages(),g := Gui("+ToolWindow")
    IBPCatalog(),images["test-crop.png"] := item,s.Catalog["TEST-CROP"] := "test-crop.png"
    p := g.AddPicture("x0 y0 w36 h36 Hidden","")
    try {
        V48Assert(IBPSetPicture(p,"TEST-CROP",36),"lifetime fixture loads a native picture")
        owned := SendMessage(0x173,0,0,p.Hwnd),renders := s.Renders
        Loop 20
            IBPSetPicture(p,"TEST-CROP",36)
        V48Assert(SendMessage(0x173,0,0,p.Hwnd)=owned && s.Renders=renders,"refreshing unchanged artwork does not replace or re-render the bitmap")
        Loop 72
            IBPBitmap(item.Path,item,A_Index+4)
        V48Assert(s.Bitmaps.Count=64 && s.Released>0 && s.Created-s.Released=64,"native crop cache evicts and frees old entries at the fixed limit")
        IBPCleanup()
        V48Assert(s.Bitmaps.Count=0 && s.Created=s.Released,"explicit cleanup releases every cache-owned bitmap")
        V48Assert(V7415BossBitmapSize(owned)=Round(36*DllCall("User32\GetDpiForWindow","Ptr",p.Hwnd,"UInt")/96)
            && V7415BossBitmapPixel(owned,5,5)=0xFF0000,"cache cleanup leaves the control-owned AHK copy intact")
        g.Destroy(),info := Buffer(32,0)
        V48Assert(!DllCall("Gdi32\GetObjectW","Ptr",owned,"Int",info.Size,"Ptr",info),"destroying the GUI frees its final owned bitmap copy")
    }
    finally {
        try g.Destroy()
        images.Delete("test-crop.png"),s.Catalog.Delete("TEST-CROP")
        if s.Paths.Has("test-crop.png")
            s.Paths.Delete("test-crop.png")
    }
}

; Two regions from one untouched source can represent a paired encounter.
; Native pixels prove ordering, preserved proportions and cache separation.
V7416BossPanels() => V7415BossCropFixture(V7416BossPanelsCase)

V7416BossPanelsCase()
{
    s := IBPState(),item := V7415BossCropSource(),images := IBPEmbeddedImages(),g := Gui("+ToolWindow")
    IBPCatalog(),images["test-panels.png"] := item,s.Catalog["TEST-PANELS"] := "test-panels.png"
    p := g.AddPicture("x0 y0 w36 h36 Hidden","")
    try {
        sourceHash := IAIBinaryHash(FileRead(item.Path,"RAW"))
        single := IBPBitmap(item.Path,item,36,0xFF000000)
        item.Panels := [[0,0,20,40],[40,0,20,40]]
        V48Assert(IBPImageValid(item),"two bounded source regions are accepted beside the original crop")
        for size in [20,32,36,37,72,108] {
            bitmap := IBPBitmap(item.Path,item,size,0xFF000000)
            V48Assert(V7415BossBitmapSize(bitmap)=size
                && V7415BossBitmapPixel(bitmap,size//4,size//2)=0x0000FF
                && V7415BossBitmapPixel(bitmap,size*3//4,size//2)=0xFF0000,
                "ordered red and blue source panels fill native halves at " size " pixels")
        }
        paired := IBPBitmap(item.Path,item,36,0xFF000000),renders := s.Renders
        V48Assert(paired!=single && V7415BossBitmapPixel(single,9,18)=0xFF0000,
            "adding panels cannot reuse the single-crop bitmap with the same original hash")
        V48Assert(IBPBitmap(item.Path,item,36,0xFF000000)=paired && s.Renders=renders,
            "unchanged panels reuse one native cached bitmap")
        item.Panels := [[40,0,20,40],[0,0,20,40]],swapped := IBPBitmap(item.Path,item,36,0xFF000000)
        V48Assert(swapped!=paired && V7415BossBitmapPixel(swapped,9,18)=0xFF0000
            && V7415BossBitmapPixel(swapped,27,18)=0x0000FF,
            "panel order participates in the native bitmap cache signature")
        item.Panels := [[0,0,40,40],[40,0,40,40]],square := IBPBitmap(item.Path,item,36,0xFF000000)
        V48Assert(square!=paired && V7415BossBitmapPixel(square,9,18)=0x0000FF
            && V7415BossBitmapPixel(square,27,18)=0xFF0000
            && V7415BossBitmapPixel(square,9,2)=0 && V7415BossBitmapPixel(square,27,33)=0,
            "square source panels preserve proportions and pad above and below")
        V48Assert(!IBPBitmap(item.Path,item,1),"two panels reject an output with fewer than two columns")
        V48Assert(IBPSetPicture(p,"TEST-PANELS",36),"paired artwork uses the existing native Picture API")
        owned := SendMessage(0x173,0,0,p.Hwnd),dpi := DllCall("User32\GetDpiForWindow","Ptr",p.Hwnd,"UInt")
        V48Assert(V7415BossBitmapSize(owned)=Round(36*dpi/96),"paired Picture keeps the window DPI bitmap size")
        validPanels := item.Panels
        for bad in ["invalid",[],[[0,0,1,1]],[[0,0,1,1],[0,0,1,1],[0,0,1,1]],
            [[0,0,0,40],[40,0,40,40]],[[-1,0,40,40],[40,0,40,40]],
            [[0,0,40,40],[40,0,41,40]],[[0,0,40,40],[40,0,40,41]],
            [[0,0,40,40],[40,0,40,39.5]],[[0,0,40,40],[40,0,40]],
            [[0,0,40,40],"invalid"]] {
            item.Panels := bad
            V48Assert(!IBPImageValid(item),"invalid optional panel metadata is rejected instead of showing the wrong region")
        }
        V48Assert(!IBPSetPicture(p,"TEST-PANELS",36) && !p.Visible && !SendMessage(0x173,0,0,p.Hwnd),
            "invalid paired artwork clears a previously shown native portrait")
        item.Panels := validPanels
        V48Assert(IAIBinaryHash(FileRead(item.Path,"RAW"))=sourceHash,
            "all single and paired rendering leaves original source bytes unchanged")
        V48Assert(s.Created-s.Released=s.Bitmaps.Count,"paired native bitmaps retain exact ownership accounting")
        IBPCleanup()
        V48Assert(s.Created=s.Released && s.Bitmaps.Count=0,"cleanup releases every single and paired cached bitmap")
    }
    finally {
        g.Destroy(),images.Delete("test-panels.png"),s.Catalog.Delete("TEST-PANELS")
        if s.Paths.Has("test-panels.png")
            s.Paths.Delete("test-panels.png")
    }
}

; Synthetic saved-format fixtures reproduce a boss and its full-health reset
; instance. They do not read or change the user's progression history.
V7418IzaxEntry(hp := 60.2,id := 1)
{
    e := V741SavedEntry("G-TY",hp,id),packed := ParseJson(e.FixtureJSON)
    packed[2] := "Izax",packed[3] := "G-IZ",packed[5] := "836045448953656"
    progress := packed[15],progress[5] := "IZAX",progress[7] := 2
    target := progress[13][1],target[1] := "IZAX",target[2] := "4108097563918336",target[9] := 434767136
    reset := target.Clone(),reset[4] := 100,reset[5] := 100
    progress[13].Push(reset),e.FixtureJSON := IGVJson(packed)
    e.Pull := IGVUnpackPull(ParseJson(e.FixtureJSON))
    return e
}

V7418IzaxSavedHP()
{
    rows := [V7418IzaxEntry(96.32834805618795,1),V7418IzaxEntry(0.1736,2),V7418IzaxEntry(60.2,3)]
    before := V741SavedSignature(rows),group := rows[1].Pull.Group,m := IGVPlotModel(rows,900,250,1,group)
    V48Assert(m.Axis.Kind="hp" && m.Axis.Percent && m.Unknown=0 && m.BestIndex=2,
        "saved Izax health plots all attempts and ranks the lowest genuine HP")
    for i,e in rows {
        point := m.Points[i],q := e.Pull.Progress
        V48Assert(point.Known && !point.Kill && Abs(point.Y-(m.Top+(1-q.Hp/100)*(m.Bottom-m.Top)))<0.001,
            "reset instance does not replace the saved minimum HP or create a kill")
        V48Assert(IGLEntryProgressLabel(e)=Format("{:.1f}% boss HP remaining",q.Hp),
            "progression labels display stored boss health without requiring reimport")
        V48Assert(IGVJson(IGVPackPull(e.Pull,false))=e.FixtureJSON,
            "all original compact fields and both target snapshots survive read-only viewing")
    }
    V48Assert(m.Points[3].BestY=m.Points[2].Y && IGVEntryScore(rows[2],m,2)>IGVEntryScore(rows[3],m,3),
        "best-so-far line and summary ranking share the actual HP scale")
    phases := IGPCBuild(rows,group)
    V48Assert(!phases.Supported && phases.Counters.Unknown=3,
        "usable 16-player Izax HP does not invent unsupported primary phases")
    view := {Boss:group,Character:"",Team:"A",Window:"all",Cycle:"",Source:"history",DemoHistory:true}
    image := ISRIBuild(rows,view)
    V48Assert(image.Plot.Unknown=0 && image.Plot.Axis.Percent && image.Kills=0
        && InStr(image.Best,"0.2%"),"raid image shares the fixed HP graph and leaves near-zero wipes as wipes")
    V48Assert(before=V741SavedSignature(rows),"graph, phase and image models preserve saved history exactly")
}

V7418IzaxHPGuards()
{
    good := V7418IzaxEntry(),before := V741SavedSignature([good])
    for reason in ["mixed Tyth","unverified NPC","missing NPC","phase mismatch","missing targets",
        "missing second target","extra target","expected mismatch","unknown HP","invalid HP",
        "not comparable","ordinal profile","unknown stage","changed maximum","zero maximum","missing maximum"] {
        bad := IPRCloneSnapshot(good),q := bad.Pull.Progress
        switch reason {
            case "mixed Tyth": q.Targets[2].Npc := "4078423634870272"
            case "unverified NPC":
                q.Targets[1].Npc := "4108140513591296",q.Targets[2].Npc := "4108140513591296"
            case "missing NPC": q.Targets[2].Npc := ""
            case "phase mismatch": q.Targets[2].Phase := 2
            case "missing targets": q.Targets := []
            case "missing second target": q.Targets.Pop()
            case "extra target": q.Targets.Push(q.Targets[1].Clone())
            case "expected mismatch": q.Expected := 3
            case "unknown HP": q.Hp := -1
            case "invalid HP": q.Hp := 101
            case "not comparable": q.Comparable := false
            case "ordinal profile": q.Profile := "izax-8m-v1"
            case "unknown stage": q.Stage := 0
            case "changed maximum": q.Targets[2].Maximum += 1
            case "zero maximum": q.Targets[2].Maximum := 0
            case "missing maximum": q.Targets[2].DeleteProp("Maximum")
        }
        model := IGVPlotModel([bad],900,250,1,bad.Pull.Group)
        V48Assert(!model.Points[1].Known && model.Points[1].Y=-1 && model.Points[1].Score=-1,
            "Izax HP fallback rejects " reason)
    }
    for reason in ["conflict","excluded","unfinished","wrong group"] {
        bad := IPRCloneSnapshot(good)
        switch reason {
            case "conflict": bad.Conflict := "Synthetic recorder conflict"
            case "excluded": bad.Pull.Included := false
            case "unfinished": bad.Pull.Ended := false
            case "wrong group": bad.Pull.Group := "G-IZ|wrong-area|836045448953656"
        }
        model := IGVPlotModel([bad],900,250,1,good.Pull.Group)
        V48Assert(!model.Points[1].Known && !model.Points[1].Kill,"Izax HP retains eligibility guard: " reason)
    }
    V48Assert(before=V741SavedSignature([good]),"adversarial fixtures leave the original saved pull untouched")
}

V7418IzaxNewImport()
{
    seg := V72PhaseSegment("G-IZ"),seg.ModeId := "836045448953656",seg.Required := ["izax"]
    V48Assert(!IsObject(IGPYProfile(seg)) && !IsObject(IGPXProfile(seg)) && IGPProfile(seg).Kind="HP",
        "16-player Izax retains an HP-only profile instead of borrowing 8-player phases")
    IGPObserve(seg,V63Event("Damage","4108097563918336",61,1000,"900000000000001",true),1000)
    ev := V63Event("Damage","4108097563918336",100,2000,"900000000000001",true)
    ev.Target.Key := "N:4108097563918336:100"
    IGPObserve(seg,ev,2000),q := IGPCompact(seg)
    V48Assert(q.Profile="hp-only-v1" && q.Expected=2 && q.Targets.Length=2 && q.Hp=61 && q.Comparable,
        "new imports retain actual boss HP plus a distinct full-health reset instance")
    e := V7418IzaxEntry(),e.Pull.Progress := q,m := IGVPlotModel([e],900,250,1,e.Pull.Group)
    V48Assert(m.Points[1].Known && !m.Points[1].Kill && m.Points[1].Label="61.0% boss HP remaining",
        "new imports and old saved pulls use the same safe health fallback")
    V48Assert(!IsObject(q.Parsely),"HP fallback does not manufacture a Parsely phase ledger")
}

V7418IzaxNativeGraph() => V61Hidden(V7418IzaxNativeGraphCase)

V7418IzaxNativeGraphCase()
{
    IPWBuild(),p := IPRState(),p.Source := "demo",p.Data := IPRNewData("SYNTHETIC Izax history",true)
    p.Data.Demo := true,IGVOpen(),v := IGVState()
    try {
        rows := [V7418IzaxEntry(96.3,1),V7418IzaxEntry(0.2,2),V7418IzaxEntry(60.2,3)]
        before := V741SavedSignature(rows),v.Source := "history",v.DemoHistory := true,v.History := Map()
        for e in rows
            v.History[e.Key] := e
        v.Boss := rows[1].Pull.Group,v.Character := "",v.Team := "A",v.Window := "all",v.Cycle := ""
        v.DetailVisible := true,IGVFillFilters(),IGVRefresh()
        V48Assert(v.Rows.Length=3 && v.Controls["Rows"].GetCount()=3 && v.Plot.Unknown=0,
            "native Progression tab displays every saved Izax HP point")
        V48Assert(InStr(v.Controls["Rows"].GetText(2,3),"0.2%") && v.Plot.BestIndex=2,
            "native table and graph agree on the best near-zero wipe")
        V48Assert(IPRModeLabel("836045448953656")="16-player Master",
            "saved Izax difficulty is readable instead of a numeric mode ID")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",v.Gui.Hwnd),"Izax regression window stays hidden")
        V48Assert(before=V741SavedSignature(rows),"native refresh leaves synthetic history unchanged")
    }
    finally IGVClose()
}

; Native resource/paint checks for the vector renderer, not aesthetic assertions.
V7424LogoPaint() => V659HeaderFixture(V7424LogoPaintBody)
V7424LogoPaintBody(f)
{
    global IUM
    IUMApply(f.Gui),entry := IUM.Items[IUMReadItem(f.Menu,0).Id],c := V658MenuCanvas(380,130)
    try {
        originalFont := DllCall("Gdi32\GetCurrentObject","Ptr",c.DC,"UInt",6,"Ptr")
        for dpi in [96,144,192] {
            IUMFill(c.DC,IUMRect(0,0,c.W,c.H),"AA33CC")
            rect := {L:12,T:12,R:12+Round(160*dpi/96),B:12+Round(42*dpi/96)}
            IUM.Error := ""
            V48Assert(IUMPaint(entry,c.DC,rect,0,dpi) && IUM.Error="" && IsObject(IUM.Logo),
                "native vector artwork paints at " dpi " DPI without falling back")
            DllCall("Gdi32\GdiFlush")
            V48Assert(DllCall("Gdi32\GetPixel","Ptr",c.DC,"Int",11,"Int",11,"UInt")=IUBColorRef("AA33CC")
                && DllCall("Gdi32\GetPixel","Ptr",c.DC,"Int",rect.R,"Int",rect.B,"UInt")=IUBColorRef("AA33CC"),
                "vector painting stays inside the supplied native menu bounds")
            ink := 0
            loop rect.B-rect.T {
                y := rect.T+A_Index-1
                loop rect.R-rect.L {
                    x := rect.L+A_Index-1
                    if (NumGet(c.Bits+(y*c.W+x)*4,0,"UInt")&0xFFFFFF)!=0x2C2436
                        ink += 1
                }
            }
            V48Assert(ink>150,"the native path renderer produces visible artwork rather than only a background")
        }
        V48Assert(DllCall("Gdi32\GetCurrentObject","Ptr",c.DC,"UInt",6,"Ptr")=originalFont,
            "vector branding preserves the caller's selected native font")
    } finally V658MenuCanvasFree(c)
}

V7424LogoLifetime() => V659HeaderFixture(V7424LogoLifetimeBody)
V7424LogoLifetimeBody(f)
{
    global IUM
    logo := IUMLInit(),path := logo.Layers[1].Path,brush := logo.Layers[1].Brush
    V48Assert(path && brush && logo.Token && IUMLInit().Layers[1].Path=path,
        "repeated logo initialization reuses its native paths and brushes")
    clean := true
    loop 8 {
        logo := IUMLInit(),oldLayers := logo.Layers.Clone()
        IUMLDispose(),IUMLDispose()
        clean := clean && !IUM.Logo && !logo.Token && !logo.Library && !logo.Layers.Length
        for layer in oldLayers
            clean := clean && !layer.Path && !layer.Brush
    }
    V48Assert(clean,"repeat disposal clears each owned path, brush, token and library; a second disposal is safe")
    logo := IUMLInit(),IUMShutdown()
    V48Assert(!IUM.Logo && !logo.Token && !logo.Library,
        "normal menu shutdown also releases vector artwork resources")
}

V7424LogoFallback() => V659HeaderFixture(V7424LogoFallbackBody)
V7424LogoFallbackBody(f)
{
    global IUM
    IUMApply(f.Gui),entry := IUM.Items[IUMReadItem(f.Menu,0).Id],c := V658MenuCanvas(160,42)
    first := Buffer(c.W*c.H*4),logo := IUMLInit(),recovered := true
    try {
        for index in [1,2] {
            layer := logo.Layers[index],brush := layer.Brush
            try {
                layer.Brush := 0,IUM.Error := ""
                recovered := recovered && IUMPaint(entry,c.DC,{L:0,T:0,R:160,B:42},0,96) && IUM.Error!=""
                DllCall("Gdi32\GdiFlush")
                if index=1
                    DllCall("Ntdll\RtlMoveMemory","Ptr",first,"Ptr",c.Bits,"UPtr",first.Size)
            } finally layer.Brush := brush
        }
        same := true
        loop c.W*c.H
            if NumGet(first,(A_Index-1)*4,"UInt")!=NumGet(c.Bits+(A_Index-1)*4,0,"UInt")
                same := false
        V48Assert(recovered,"native menu paint recovers when a vector brush becomes unavailable")
        V48Assert(same,"fallback after partial vector painting matches fallback before any paths were drawn")
    } finally V658MenuCanvasFree(c)
}

; v74.26: local speech defaults and retirement of automatic ability hotkeys.
; Hidden native settings and private temporary INIs only. Never run the worker,
; create a speech/HTTP transport, register keys, or start the normal application.
V7426VoiceFixture(fn) => V672LibraryFixture(V7426VoiceInner.Bind(fn))
V7426VoiceInner(fn)
{
    global
    local names := ["bridgeVoiceName","bridgeOutputName","bridgeVoiceNames","bridgeOutputNames",
        "bridgeVoice","bridgeVoiceSignature","DarknessSoundIds","TythRageSoundIds",
        "COMBAT_LOG_ENCODING","activeBossIndex","DiagnosticBuffer"]
    local old := Map(),name,value
    for name in names
        old[name] := %name%
    try {
        bridgeVoice := "",bridgeVoiceSignature := "",DiagnosticBuffer := []
        DarknessSoundIds := DarknessSoundIds.Clone(),TythRageSoundIds := TythRageSoundIds.Clone()
        bridgeVoiceNames := [BRIDGE_DEFAULT_VOICE_LABEL,"Fixture voice"]
        bridgeOutputNames := [BRIDGE_DEFAULT_OUTPUT_LABEL,"Fixture virtual cable"]
        bridgeVoiceName := BRIDGE_DEFAULT_VOICE_LABEL,bridgeOutputName := BRIDGE_DEFAULT_OUTPUT_LABEL
        audioOutputMode := IAVoiceDefaultMode(),inputMode := "CombatLog"
        BridgeVoiceChoice.Delete(),BridgeVoiceChoice.Add(bridgeVoiceNames)
        BridgeOutputChoice.Delete(),BridgeOutputChoice.Add(bridgeOutputNames)
        SyncAudioRoutingControls(),RefreshControlAvailability()
        fn.Call()
    }
    finally {
        for name,value in old
            %name% := value
    }
}

V7426VoiceFreshInstall() => V7426VoiceFixture(V7426VoiceFreshInstallBody)
V7426VoiceFreshInstallBody()
{
    global SETTINGS_FILE,audioOutputMode,inputMode,bridgeVoiceName,bridgeOutputName,Audio
    global AUDIO_MODE_KENKU_BRIDGE_TTS,BRIDGE_DEFAULT_VOICE_LABEL,BRIDGE_DEFAULT_OUTPUT_LABEL
    V48Assert(!FileExist(SETTINGS_FILE),"fresh-install fixture has no previous settings")
    LoadSettings()
    V48Assert(IAVoiceDefaultMode()=AUDIO_MODE_KENKU_BRIDGE_TTS && audioOutputMode=AUDIO_MODE_KENKU_BRIDGE_TTS,
        "fresh install selects Windows speech without a Kenku recordings route")
    V48Assert(inputMode="CombatLog" && bridgeOutputName=BRIDGE_DEFAULT_OUTPUT_LABEL
        && bridgeVoiceName=BRIDGE_DEFAULT_VOICE_LABEL,"fresh install uses recorded events and the Windows default voice/output")
    V48Assert(!FileExist(SETTINGS_FILE) && !Audio.Queue.Length && !IsObject(Audio.Http),
        "loading defaults neither writes a settings file nor starts audio or network work")
}

V7426VoiceLegacyMigration() => V7426VoiceFixture(V7426VoiceLegacyMigrationBody)
V7426VoiceLegacyMigrationBody()
{
    global SETTINGS_FILE,audioOutputMode,inputMode,bridgeVoiceName,bridgeOutputName,BridgeTextById
    global AUDIO_MODE_KENKU_BRIDGE_TTS,BRIDGE_DEFAULT_OUTPUT_LABEL,energyShieldCalloutEnabled
    IniWrite("KenkuSoundboard",SETTINGS_FILE,"Audio","OutputMode")
    IniWrite("Fixture saved voice",SETTINGS_FILE,"Audio","BridgeVoice")
    IniWrite("Old unplugged cable",SETTINGS_FILE,"Audio","BridgeOutput")
    IniWrite("Hotkey",SETTINGS_FILE,"General","InputMode")
    IniWrite(0,SETTINGS_FILE,"Universal","EnergyShield")
    IniWrite("retain me",SETTINGS_FILE,"Unrelated","Note")
    BridgeTextById["FIXTURE_CUSTOM"] := "Keep my custom phrase."
    before := FileRead(SETTINGS_FILE),LoadSettings()
    V48Assert(audioOutputMode=AUDIO_MODE_KENKU_BRIDGE_TTS && inputMode="CombatLog",
        "saved recordings and automatic ability hotkey modes migrate to speech from the combat log")
    V48Assert(bridgeOutputName=BRIDGE_DEFAULT_OUTPUT_LABEL && bridgeVoiceName="Fixture saved voice",
        "retired recording route starts locally without discarding the preferred speech voice")
    V48Assert(!energyShieldCalloutEnabled && BridgeTextById["FIXTURE_CUSTOM"]="Keep my custom phrase."
        && FileRead(SETTINGS_FILE)=before,"migration preserves switches and phrases and does not write while loading")
    SaveSettings(),LoadSettings()
    V48Assert(IniRead(SETTINGS_FILE,"Audio","OutputMode")=AUDIO_MODE_KENKU_BRIDGE_TTS
        && IniRead(SETTINGS_FILE,"General","InputMode")="CombatLog"
        && IniRead(SETTINGS_FILE,"Audio","BridgeOutput")=BRIDGE_DEFAULT_OUTPUT_LABEL,
        "the next normal save persists supported settings and reload remains local")
    V48Assert(IniRead(SETTINGS_FILE,"Unrelated","Note")="retain me"
        && bridgeVoiceName="Fixture saved voice" && !energyShieldCalloutEnabled,
        "saving migrated settings preserves unrelated INI content and chosen callouts")
}

V7426VoiceSavedTTS() => V7426VoiceFixture(V7426VoiceSavedTTSBody)
V7426VoiceSavedTTSBody()
{
    global SETTINGS_FILE,audioOutputMode,inputMode,bridgeVoiceName,bridgeOutputName,bridgeVoiceNames,bridgeOutputNames
    global AUDIO_MODE_KENKU_BRIDGE_TTS,BRIDGE_DEFAULT_OUTPUT_LABEL
    for output in [BRIDGE_DEFAULT_OUTPUT_LABEL,"Fixture virtual cable","Missing saved output"] {
        IniWrite(AUDIO_MODE_KENKU_BRIDGE_TTS,SETTINGS_FILE,"Audio","OutputMode")
        IniWrite("Missing saved voice",SETTINGS_FILE,"Audio","BridgeVoice")
        IniWrite(output,SETTINGS_FILE,"Audio","BridgeOutput")
        IniWrite("Hotkey",SETTINGS_FILE,"General","InputMode")
        before := FileRead(SETTINGS_FILE),LoadSettings()
        V48Assert(audioOutputMode=AUDIO_MODE_KENKU_BRIDGE_TTS && inputMode="CombatLog"
            && bridgeOutputName=output && bridgeVoiceName="Missing saved voice",
            "existing speech output remains exact, including absent devices: " output)
        V48Assert(ArrayContainsText(bridgeOutputNames,output) && ArrayContainsText(bridgeVoiceNames,bridgeVoiceName)
            && FileRead(SETTINGS_FILE)=before,"missing selections remain available without silent fallback or load-time writes")
        SaveSettings(),bridgeOutputName := "changed fixture",bridgeVoiceName := "changed fixture",LoadSettings()
        V48Assert(bridgeOutputName=output && bridgeVoiceName="Missing saved voice",
            "private save/reload preserves the explicit speech voice and endpoint")
    }
}

V7426VoiceUnknownMigration() => V7426VoiceFixture(V7426VoiceUnknownMigrationBody)
V7426VoiceUnknownMigrationBody()
{
    global audioOutputMode,inputMode,bridgeOutputName,bridgeVoiceName,BRIDGE_DEFAULT_OUTPUT_LABEL,SETTINGS_FILE
    for saved in ["","unsupported","KenkuSoundboard"] {
        audioOutputMode := saved,inputMode := "Hotkey",bridgeOutputName := "Old cable",bridgeVoiceName := "Fixture voice"
        IAVoiceMigrate(saved)
        V48Assert(audioOutputMode=IAVoiceDefaultMode() && inputMode="CombatLog"
            && bridgeOutputName=BRIDGE_DEFAULT_OUTPUT_LABEL && bridgeVoiceName="Fixture voice",
            "missing or unsupported old audio settings recover locally without changing the voice")
    }
    inputMode := "Hotkey"
    V48Assert(!HotkeyModeActive(),"retired automatic ability hotkeys cannot become active through stale in-memory mode")
    ToggleInputMode()
    V48Assert(inputMode="CombatLog","old toggle callback cannot restore the retired hotkey mode")
    IniWrite("Old unused cable",SETTINGS_FILE,"Audio","BridgeOutput")
    IniWrite("Fixture voice",SETTINGS_FILE,"Audio","BridgeVoice")
    before := FileRead(SETTINGS_FILE),LoadSettings()
    V48Assert(bridgeOutputName=BRIDGE_DEFAULT_OUTPUT_LABEL && bridgeVoiceName="Fixture voice"
        && audioOutputMode=IAVoiceDefaultMode() && FileRead(SETTINGS_FILE)=before,
        "an INI without an output mode does not promote an old unused cable to the active speech output")
}

V7426VoicePages() => V7426VoiceFixture(V7426VoicePagesBody)
V7426VoicePagesBody()
{
    global IC,BridgeVoiceChoice,BridgeOutputChoice,BridgeTestButton,BackgroundLogCheckbox,AudioModeChoice
    global SETTINGS_FILE,audioOutputMode,bridgeOutputName,Audio,Persist
    before := FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "<absent>",serial := Persist.Serial
    V48Assert(IC.Pages.Has("Voice") && IC.Pages.Has("AudioAdvanced"),"ordinary speech settings and optional Discord setup have separate pages")
    for c in [BridgeVoiceChoice,BridgeOutputChoice,BridgeTestButton,BackgroundLogCheckbox,IC.LocalVoiceButton,IC.VoiceRouteText]
        V48Assert(c.Gui=IC.Pages["Voice"].Gui,"local speech controls belong to the main Voice form")
    V48Assert(!IsSet(AudioModeChoice) || !IsObject(AudioModeChoice),"retired recordings route has no native mode selector")
    ICOpenPage("Voice"),ICOpenPage("AudioAdvanced")
    for key in ["General","Voice","AudioAdvanced"] {
        page := IC.Pages[key]
        V48Assert(!page.Visible && !DllCall("User32\IsWindowVisible","Ptr",page.Gui.Hwnd,"Int"),
            "constructing settings remains hidden in the isolated native harness: " key)
        for control in page.Gui
            V48Assert(!InStr(control.Text,"Existing Kenku recordings") && !InStr(control.Text,"Hotkey mode"),
                "supported settings do not advertise retired recordings or automatic ability hotkeys")
    }
    SyncAudioRoutingControls(),RefreshControlAvailability(),IAVoiceRefresh()
    V48Assert(BridgeVoiceChoice.Enabled && BridgeOutputChoice.Enabled && BridgeTestButton.Enabled
        && BackgroundLogCheckbox.Enabled,"ordinary speech controls are usable without a bot route")
    after := FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "<absent>"
    V48Assert(before=after && Persist.Serial=serial && !Audio.Queue.Length && !IsObject(Audio.Http),
        "opening and refreshing voice settings neither saves preferences nor queues playback")
}

V7426VoiceUseLocal() => V7426VoiceFixture(V7426VoiceUseLocalBody)
V7426VoiceUseLocalBody()
{
    global bridgeVoiceName,bridgeOutputName,BridgeTextById,Audio,bridgeVoice,SETTINGS_FILE,IC
    global BRIDGE_DEFAULT_OUTPUT_LABEL,audioOutputMode
    bridgeVoiceName := "Fixture voice",bridgeOutputName := "Fixture virtual cable",SyncAudioRoutingControls()
    BridgeTextById["FIXTURE_CUSTOM"] := "Keep my words."
    payload := {Ok:true,Message:"",Route:audioOutputMode,Key:"Fixture",Label:"Fixture",SoundId:"FIXTURE",Phrase:"Fixture"}
    V48Assert(QueueCalloutPreview(payload),"isolated local-switch case has an old active speech job")
    old := Audio.Queue.RemoveAt(1),Audio.Current := old,Audio.Queue.Push(old.Clone())
    transport := {Sentinel:"transport must not be called"},Audio.Http := transport,bridgeVoice := transport
    state := RouteState(),state.Paused := true,state.Fault := "Fixture missing device",state.RetryAt := 999999,state.NetFailures := 4
    legacy := RouteState("KenkuSoundboard"),legacy.Paused := true,legacy.Fault := "Unrelated old route"
    old.StopAttempts := 3
    epoch := Audio.Epoch,IAVoiceUseLocal()
    V48Assert(bridgeOutputName=BRIDGE_DEFAULT_OUTPUT_LABEL && bridgeVoiceName="Fixture voice"
        && audioOutputMode=IAVoiceDefaultMode(),"local action selects Windows default playback and retains the chosen voice")
    V48Assert(!Audio.Queue.Length && old.Cancel && Audio.Epoch>epoch && Audio.ResetVoice,
        "switching from cable to local cancels queued speech and marks the active job for stop")
    V48Assert(Audio.Http=transport && bridgeVoice=transport && Audio.Current=old,
        "the UI leaves transport cleanup to its worker without invoking audio or HTTP")
    V48Assert(!state.Paused && state.Fault="" && !state.RetryAt && !state.NetFailures && old.StopAttempts=0
        && legacy.Paused && legacy.Fault="Unrelated old route",
        "explicit local recovery clears the speech fault and resets its stop retry without clearing unrelated route faults")
    V48Assert(BridgeTextById["FIXTURE_CUSTOM"]="Keep my words."
        && IniRead(SETTINGS_FILE,"Audio","BridgeOutput")=BRIDGE_DEFAULT_OUTPUT_LABEL,
        "local action keeps custom phrases and persists only supported routing settings")
    V48Assert(IC.VoiceRouteText.Text!="","the main Voice page describes the selected local output")
    Audio.ResetVoice := false,old.Cancel := false,old.StopAttempts := 2,Audio.Queue.Push(old.Clone())
    state.Paused := true,state.Fault := "Fixture second fault",epoch := Audio.Epoch
    IAVoiceUseLocal()
    V48Assert(!Audio.Queue.Length && old.Cancel && old.StopAttempts=0 && Audio.ResetVoice && Audio.Epoch>epoch
        && !state.Paused && state.Fault="" && Audio.Http=transport && bridgeVoice=transport,
        "explicit local recovery also cancels stale work when the default device was already selected")
}

V7426VoicePreview() => V7426VoiceFixture(V7426VoicePreviewBody)
V7426VoicePreviewBody()
{
    global Audio,Preview,soundboardsEnabled,bridgeOutputName,BRIDGE_DEFAULT_OUTPUT_LABEL,IP
    bridgeOutputName := BRIDGE_DEFAULT_OUTPUT_LABEL,SyncAudioRoutingControls(),TestBridgeVoice()
    V48Assert(Audio.Queue.Length=1,"test voice button queues one isolated preview")
    item := Audio.Queue[1]
    V48Assert(item.Kind="Test" && item.Route=IAVoiceDefaultMode() && Trim(item.Phrase)!=""
        && item.Mode="CombatLog","test voice uses a speech phrase and the supported recorded-event mode")
    V48Assert(!IsObject(Audio.Http) && !IsObject(Audio.Current) && !IP.Active && !IsObject(Preview.Gui),
        "queuing a test never opens the parser, transport or preview dialog")
    Audio.Queue := [],soundboardsEnabled := false,TestBridgeVoice()
    V48Assert(!Audio.Queue.Length && InStr(Preview.Message,"Master audio is off"),
        "local test voice respects master mute")
}

; Actual hidden editor windows, isolated settings/phrases, no playback or network.
V7426RetiredUIFixture(fn) => V672LibraryFixture(V7426RetiredUIInner.Bind(fn))
V7426RetiredUIInner(fn)
{
    global AEManualUI,AE_MANUAL_SOUND_ID,BRIDGE_PHRASES_FILE,localPlayerToken,SELF_TEST
    global NBFloorUI,AEStackUI,NBTurretUI,NBFifthUI,NBRepairUI,NBOrderUI,NBRebounderUI
    old := {Manual:AEManualUI,Id:AE_MANUAL_SOUND_ID,Phrases:BRIDGE_PHRASES_FILE,Player:localPlayerToken}
    phrasePath := A_Temp "\IrisV7426Phrases_" DllCall("GetCurrentProcessId") "_" A_TickCount ".ini"
    V48Assert(SELF_TEST && A_IsSuspended,"editor checks require the suspended native test child")
    try {
        AEManualUI := {Gui:""},BRIDGE_PHRASES_FILE := phrasePath,localPlayerToken := "@EditorTest#123"
        AE_MANUAL_SOUND_ID := "12345678-1234-1234-1234-123456789abc"
        fn.Call()
    }
    finally {
        for refresh in [RefreshNBFloorStatus,RefreshNBTurretStatus,RefreshNBFifthStatus,
            RefreshNBRepairStatus,RefreshNBOrderStatus,RefreshNBRebounderStatus]
            SetTimer(refresh,0)
        for ui in [AEManualUI,AEStackUI,NBFloorUI,NBTurretUI,NBFifthUI,NBRepairUI,NBOrderUI,NBRebounderUI]
            if IsObject(ui.Gui)
                ui.Gui.Destroy()
        AEManualUI := old.Manual,AE_MANUAL_SOUND_ID := old.Id
        BRIDGE_PHRASES_FILE := old.Phrases,localPlayerToken := old.Player
        try FileDelete(phrasePath)
    }
}

V7426RetiredEditorsOpen() => V7426RetiredUIFixture(V7426RetiredEditorsOpenCase)
V7426RetiredEditorsOpenCase()
{
    global AEManualUI,AEStackUI,NBFloorUI,NBTurretUI,NBFifthUI,NBRepairUI,NBOrderUI,NBRebounderUI
    global Audio,Persist,AE_MANUAL_SOUND_ID,SETTINGS_FILE
    before := FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "<absent>",serial := Persist.Serial
    editors := [[OpenAERemoteManualEditor,"AEManualUI"],[OpenAEStackControls,"AEStackUI"],
        [OpenNBFloorControls,"NBFloorUI"],[OpenNBTurretControls,"NBTurretUI"],
        [OpenNBFifthControls,"NBFifthUI"],[OpenNBRepairControls,"NBRepairUI"],
        [OpenNBOrderControls,"NBOrderUI"],[OpenNBRebounderControls,"NBRebounderUI"]]
    for editor in editors {
        editor[1].Call(),name := editor[2],ui := %name%,hwnd := ui.Gui.Hwnd
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int"),name " remains hidden during native diagnostics")
        for prop in ["Sound","SoundId","Recording"]
            V48Assert(!ui.HasOwnProp(prop),name " has no retired " prop " editor")
        for control in ui.Gui {
            V48Assert(!RegExMatch(control.Text,"i)Kenku|recording (?:ID|UUID|mapping)|Save recording"),
                name " has no reachable legacy recording control")
        }
        editor[1].Call()
        V48Assert(ui.Gui.Hwnd=hwnd && !DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int"),
            name " reopens safely without rebuilding or accessing a removed field")
    }
    V48Assert(AEStackUI.Ids.Count=0 && AEStackUI.IdLabels.Count=0,"legacy stack synchronization has empty editor maps")
    after := FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "<absent>"
    V48Assert(before=after && Persist.Serial=serial && AE_MANUAL_SOUND_ID="12345678-1234-1234-1234-123456789abc",
        "browsing all editors preserves saved preferences and the legacy manual ID")
    V48Assert(Audio.Queue.Length=0 && !IsObject(Audio.Current) && !IsObject(Audio.Http),
        "opening and reopening editors never queues speech or network work")
}

V7426RetiredPreviewSelectors() => V7823Fixture(V7426RetiredUIFixture.Bind(V7426RetiredPreviewSelectorsCase))
V7426RetiredPreviewSelectorsCase()
{
    global NBTurretUI,NBFifthUI,NBRepairUI,NBOrderUI,NBRebounderUI,audioOutputMode,Audio,Preview,NBOrder
    OpenNBTurretControls(),OpenNBFifthControls(),OpenNBRepairControls(),OpenNBOrderControls(),OpenNBRebounderControls()
    for control in [NBTurretUI.CloseClock,NBTurretUI.FarClock,NBFifthUI.Clock,NBRepairUI.Part] {
        control.Choose(1)
        SendMessage(0x111,(1<<16)|DllCall("User32\GetDlgCtrlID","Ptr",control.Hwnd,"Int"),control.Hwnd,control.Gui.Hwnd)
        Sleep(-1)
        V48Assert(control.Value=1,"real preview selection notification remains safe after ID editor removal")
    }
    NBTurretUI.FarClock.Choose(5)
    p := NBTurretPreviewPayload({Key:"sample",Label:"sample",CloseClock:Integer(NBTurretUI.CloseClock.Text),
        FarClock:Integer(NBTurretUI.FarClock.Text)},audioOutputMode)
    V48Assert(p.Ok && InStr(p.Phrase,"1") && InStr(p.Phrase,"9"),"opening turret clocks still resolve the selected spoken example")
    p := NBFifthPreviewPayload({Key:"sample",Label:"sample",Clock:Integer(NBFifthUI.Clock.Text)},audioOutputMode)
    V48Assert(p.Ok && InStr(p.Phrase,"1"),"fifth-turret selector still resolves its spoken location")
    p := NBRepairPreviewPayload({Key:"sample",Label:"sample",Part:NBRepairUI.Part.Text},audioOutputMode)
    V48Assert(p.Ok && InStr(p.Phrase,"front",false),"coupling selector still resolves its spoken direction")
    V48Assert(!NBOrderUI.HasOwnProp("Kind") && !NBOrderUI.HasOwnProp("From") && !NBOrderUI.HasOwnProp("To"),
        "candle status window uses the shared preview picker")
    orderHwnd := NBOrderUI.Gui.Hwnd,orderStatus := NBOrderUI.Status.Value,orderState := NBOrder
    V48Assert(ICLNPreview("Nahut P1-P3","Pass"),"candle preview opens through its current shared route")
    entry := Preview.Items[Preview.Choice.Value],p := ResolveCalloutPreview(entry,"Example",20,audioOutputMode)
    V48Assert(p.Ok && p.Phrase!="" && Preview.Play.Enabled,"candle preview resolves with the status window still open")
    V48Assert(NBOrderUI.Gui.Hwnd=orderHwnd && NBOrderUI.Status.Value=orderStatus && NBOrder=orderState,
        "shared preview leaves the candle status window and encounter controller unchanged")
    V48Assert(!NBRebounderUI.HasOwnProp("Sample") && ICLNPreview("Nahut rebounders",NBRebounderRecordKeys()[1]),
        "Rebounder status window uses the shared preview picker")
    entry := Preview.Items[Preview.Choice.Value],p := ResolveCalloutPreview(entry,"Example",20,audioOutputMode)
    V48Assert(p.Ok && p.Phrase!="" && Preview.Play.Enabled,"Rebounder preview resolves with the status window still open")
    V48Assert(Audio.Queue.Length=0 && !IsObject(Audio.Current) && !IsObject(Audio.Http),
        "selector checks resolve payloads without playback or network")
}

V7426ManualPhrasePersistence() => V7426RetiredUIFixture(V7426ManualPhrasePersistenceCase)
V7426ManualPhrasePersistenceCase()
{
    global AEManualUI,AE_MANUAL_SOUND_ID,AE_MANUAL_PHRASE_KEY,BRIDGE_PHRASES_FILE,BridgeTextById
    global SETTINGS_FILE,Persist,Audio
    OpenAERemoteManualEditor()
    before := FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "<absent>",serial := Persist.Serial,id := AE_MANUAL_SOUND_ID
    AEManualUI.Phrase.Value := "  {Toon}, Remote Access.  "
    SaveAERemoteManualConfig()
    V48Assert(IniRead(BRIDGE_PHRASES_FILE,"Phrases",AE_MANUAL_PHRASE_KEY)="{Toon}, Remote Access."
        && BridgeTextById[AE_MANUAL_PHRASE_KEY]="{Toon}, Remote Access.","phrase-only editor saves the real private INI and active phrase")
    V48Assert(AE_MANUAL_SOUND_ID=id,"saving speech never erases the user's legacy recording ID")
    after := FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "<absent>"
    V48Assert(after=before && Persist.Serial=serial,"phrase-only save leaves unrelated settings untouched")
    OpenAERemoteManualEditor()
    V48Assert(AEManualUI.Phrase.Value="{Toon}, Remote Access.","reopening the real editor shows saved wording")
    V48Assert(Audio.Queue.Length=0 && !IsObject(Audio.Current) && !IsObject(Audio.Http),"saving wording never plays a preview")
}

; v74.28: native hidden navigation and death-view layout. Synthetic data only.
V7428DeathsFixture(fn) => V61Hidden(V7428DeathsFixtureInner.Bind(fn))
V7428DeathsFixtureInner(fn)
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"death-view checks require the suspended diagnostic child")
    try fn.Call()
    finally IDTShutdown()
}

V7428DeathViewOwnership()
{
    for tab in [1,2,3,4,5,6,7,8,9,10,11,12] {
        for mode in ["pull","session"] {
            V48Assert(IPWGroupVisible("Raid",tab,mode)=(tab=7),"Raid metrics own tab7 independently of Deaths view")
            V48Assert(!IPWGroupVisible("RaidNav",tab,mode),"retired mode selector is absent from every tab")
            V48Assert(IPWGroupVisible("Deaths",tab,mode)=(tab=9),"recap controls own selected-pull Deaths view")
            V48Assert(IPWGroupVisible("RaidSession",tab,mode)=(tab=12),"session controls own session Deaths view")
        }
    }
}

V7428DeathViewSwitch() => V7428DeathsFixture(V7428DeathViewSwitchCase)
V7428DeathViewSwitchCase()
{
    global IP
    V58UseFixture(),u := IPWState(),c := u.Controls,selected := IP.Selected,actor := IP.Actor,live := IP.Live
    V58SelectTab(7)
    V48Assert(V58ChildVisible(c["Raid"]) && !c.Has("RaidView"),"Raid opens its metrics with no death-mode selector")
    V58SelectTab(9)
    V48Assert(!c.Has("RaidView") && V58ChildVisible(c["DeathList"]),"Deaths defaults to selected-pull recap")
    V58SelectTab(12)
    V48Assert(IPRState().Mode="session" && V58ChildVisible(c["SessionPlayers"]) && V58ChildVisible(c["SessionPulls"]),"session selection shows both survival tables")
    V48Assert(!V58ChildVisible(c["DeathList"]) && !V58ChildVisible(c["DeathChart"]) && !V58ChildVisible(c["Raid"]),"session view hides recap and raid metrics")
    V48Assert(IP.InfoText.Text="Session deaths and survival","session heading belongs to its own tab")
    V58SelectTab(7)
    V48Assert(V58ChildVisible(c["Raid"]) && !V58ChildVisible(c["SessionPlayers"]) && !c.Has("RaidView"),"Raid remains metrics after a session review")
    V58SelectTab(12)
    V48Assert(IPRState().Mode="session" && V58ChildVisible(c["SessionPlayers"]),"Session Deaths restores its summary when returning")
    V58SelectTab(9)
    V48Assert(IPRState().Mode="pull" && V58ChildVisible(c["DeathList"]) && !V58ChildVisible(c["SessionPlayers"]),"Deaths restores its own recap")
    V48Assert(IP.Selected=selected && IP.Actor=actor && IP.Live=live && !IP.Active,"view changes preserve parser selection and collection state")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"navigation never shows the diagnostic window")
}

V7428SessionRecapRoute() => V7428DeathsFixture(V7428SessionRecapRouteCase)
V7428SessionRecapRouteCase()
{
    global IP
    V58UseFixture(),IPRDemo(),u := IPWState(),c := u.Controls,p := IPRState(),data := p.Data
    V48Assert(u.Tab=12 && p.Mode="session","session demo opens Session Deaths")
    V48Assert(c["SessionPlayers"].GetCount()=8 && c["SessionPulls"].GetCount()=17,"existing eight-player/seventeen-pull demo remains intact")
    p.Selected := "@Little Bobby#101",IPRDrawPulls(),player := p.Selected,pull := IDTDemoData()
    V48Assert(IDTOpen(pull,pull.Deaths[2].Key,pull.Deaths[2].Record),"exact death link opens normally from the session view")
    d := IDTState()
    V48Assert(u.Tab=9 && p.Mode="pull","exact recap link selects Deaths")
    V48Assert(d.Pull=pull && d.Selected=2 && d.Recap.At=pull.Deaths[2].At,"exact linked player and death record retained")
    V48Assert(V58ChildVisible(c["DeathList"]) && !V58ChildVisible(c["SessionPlayers"]),"linked recap has no overlapping session table")
    V58SelectTab(12)
    V48Assert(p.Data=data && p.Selected=player && c["SessionPlayers"].GetCount()=8,"returning to session keeps its dataset and player selection")
    V48Assert(d.Pinned=pull && d.Selected=2,"session review retains the pinned recap without clearing its death selection")
    V58SelectTab(9)
    V48Assert(d.Pull=pull && d.Selected=2,"switching back restores the same pinned death")
}

V7428DeathViewRefreshIsolation() => V7428DeathsFixture(V7428DeathViewRefreshIsolationCase)
V7428DeathViewRefreshIsolationCase()
{
    global IP
    V58UseFixture(),IPRDemo(),c := IPWState().Controls,pull := IDTDemoData(),IDTOpen(pull),d := IDTState()
    chart := SendMessage(0x173,0,0,c["DeathChart"])
    V58SelectTab(12),heading := IP.InfoText.Text
    IDTRefresh(true),IDTDraw()
    V48Assert(IP.InfoText.Text=heading,"background recap cannot replace the session heading")
    V48Assert(SendMessage(0x173,0,0,c["DeathChart"])=chart,"hidden recap avoids rebuilding its bitmap")
    IDTFillDeaths()
    V48Assert(!V58ChildVisible(c["DeathList"]) && !V58ChildVisible(c["DeathEvents"]),"recap redraw cannot uncover hidden tables over session view")
    V58SelectTab(7),heading := IP.InfoText.Text
    IPRDraw(),IPRDrawPulls(),IDTRefresh(true)
    V48Assert(IP.InfoText.Text=heading && !V58ChildVisible(c["SessionPlayers"]) && !V58ChildVisible(c["SessionPulls"]),"background session updates keep Raid heading and table ownership")
    V48Assert(V58ChildVisible(c["Raid"]) && !V58ChildVisible(c["DeathList"]),"Raid metrics remain the only visible data table")
    V48Assert(!d.Hook,"diagnostic child never installs live mouse tracking")
}

V7428DeathViewLayout() => V7428DeathsFixture(V7428DeathViewLayoutCase)
V7428DeathViewLayoutCase()
{
    global IP
    V58UseFixture(),IDTOpen(IDTDemoData()),c := IPWState().Controls
    for size in [[980,650],[1220,780],[1920,1080]] {
        IPResize(IP.Gui,0,size[1],size[2]),l := IPWLayout(size[1],size[2]),r := IDTGeometry(l)
        c["DeathSource"].GetPos(&sx,&sy,&sw,&sh)
        V48Assert(sy=l.ContentY,"recap now uses the space previously reserved for the selector")
        V48Assert(r.EventsY+r.EventsH<=r.NoteY && r.NoteY+38<=l.H-58,"recap sections stay above notes and footer")
        V48Assert(r.ChartH>=76 && r.ListH>=68 && r.EventsH>=60,"compact and expanded layouts retain useful review areas")
        for name in ["DeathList","DeathChart","DeathEvents","DeathNote"] {
            c[name].GetPos(&x,&y,&w,&h)
            V48Assert(x>=l.InnerX && x+w<=size[1] && y+h<=size[2]-58,"native recap control fits the workspace: " name)
        }
    }
}

; v74.28: actual hidden Raid-table regressions. Synthetic parser data only.
; These checks never show the application, begin parsing, or invoke audio.
V7428RaidReady()
{
    global IP,SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"Raid checks require the suspended native test child")
    V58UseFixture(),IPRState().Mode := "session"
    V58SelectTab(7)
}

V7428RaidRow(key)
{
    global IP
    Loop IP.PlayersLV.GetCount() {
        if IP.PlayersLV.GetText(A_Index,9)=key
            return A_Index
    }
    return 0
}

V7428RaidRedraw()
{
    IPWState().RaidSignature := ""
    IPRefresh()
}

V7428RaidMetricPage() => V58Isolated(V7428RaidMetricPageCase)
V7428RaidMetricPageCase()
{
    global IP
    V7428RaidReady(),u := IPWState()
    V48Assert(u.Tab=7 && V58ChildVisible(IP.PlayersLV) && IP.PlayersLV.GetCount()=2,
        "Raid always shows observed-player metrics, even when the Deaths session view is selected")
    for name in ["SessionPlayers","SessionPulls","SessionHeading","DeathList","DeathEvents"]
        V48Assert(!V58ChildVisible(u.Controls[name]),"death and session controls do not overlap Raid: " name)
    V48Assert(!InStr(IP.InfoText.Text,"deaths & survival"),"Raid heading remains the selected encounter")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"native Raid fixture stays hidden")
}

V7428RaidArithmetic() => V58Isolated(V7428RaidArithmeticCase)
V7428RaidArithmeticCase()
{
    global IP
    V7428RaidReady(),lv := IP.PlayersLV,seg := IPSelectedSegment(),key := IPActor(V51Source()).Key
    damage := V7428RaidRow(key),healer := V7428RaidRow("@Healer#300")
    V48Assert(damage>0 && healer>0,"damage dealer and zero-damage healer both have rows")
    V48Assert(lv.GetText(damage,2)="1,300" && lv.GetText(damage,3)="650.0",
        "Raid damage is 1300 over the recorded two-second fight")
    V48Assert(lv.GetText(healer,2)="0" && lv.GetText(healer,4)="300" && lv.GetText(healer,5)="150.0",
        "Raid healing remains 300 direct effective healing, excluding the 200 overheal")
    V48Assert(lv.GetText(damage,6)="150" && lv.GetText(damage,7)="75.0",
        "Raid damage taken uses counted incoming damage over the fight interval")
    seg.Totals[key].RawTaken := 3000,seg.Totals[key].ExcludedTaken := 2850
    V7428RaidRedraw(),damage := V7428RaidRow(key)
    V48Assert(lv.GetText(damage,6)="150" && lv.GetText(damage,7)="75.0",
        "a raw incoming total does not replace the existing counted-damage policy")
    seg.Last := seg.Start,V7428RaidRedraw(),damage := V7428RaidRow(key),healer := V7428RaidRow("@Healer#300")
    V48Assert(lv.GetText(damage,3)="--" && lv.GetText(damage,7)="--" && lv.GetText(healer,5)="--",
        "a zero-length interval never invents throughput rates")
}

V7428RaidUnknownValues() => V58Isolated(V7428RaidUnknownValuesCase)
V7428RaidUnknownValuesCase()
{
    global IP
    V7428RaidReady(),seg := IPSelectedSegment(),lv := IP.PlayersLV,key := IPActor(V51Source()).Key
    seg.Totals["@Healer#300"].HealKnown := 0
    seg.Raid.Threat := Map()
    V7428RaidRedraw(),healer := V7428RaidRow("@Healer#300"),damage := V7428RaidRow(key)
    V48Assert(lv.GetText(healer,4)="--" && lv.GetText(healer,5)="--",
        "incomplete effective-heal coverage remains unknown, with no raw-heal fallback")
    V48Assert(lv.GetText(damage,4)="0" && lv.GetText(damage,5)="0.0",
        "an observed player with no heals retains a known zero healing total")
    V48Assert(lv.GetText(damage,10)="--" && lv.GetText(damage,11)="--",
        "absence of threat records is not shown as known zero threat")
    seg.Raid.Threat[key] := {Total:0,Known:1,Missing:0}
    V7428RaidRedraw(),damage := V7428RaidRow(key)
    V48Assert(lv.GetText(damage,10)="0" && lv.GetText(damage,11)="0.0",
        "a recorded zero threat result is distinguished from missing records")
}

V7428RaidSignedThreat() => V58Isolated(V7428RaidSignedThreatCase)
V7428RaidSignedThreatCase()
{
    global IP
    V7428RaidReady(),seg := IPSelectedSegment(),lv := IP.PlayersLV,key := IPActor(V51Source()).Key
    seg.Raid.Threat[key] := {Total:-75,Known:2,Missing:1},seg.Raid.LastThreatAt := 4000
    V7428RaidRedraw(),row := V7428RaidRow(key)
    V48Assert(lv.GetText(row,10)="-75 *" && lv.GetText(row,11)="-18.8 *",
        "negative net threat and its four-second rate both disclose incomplete records")
    V48Assert(lv.GetText(row,3)="650.0","later threat timing does not lengthen the DPS denominator")
    seg.End := seg.Last,V7428RaidRedraw(),row := V7428RaidRow(key)
    V48Assert(lv.GetText(row,11)="-37.5 *",
        "completed-fight threat uses the existing fixed endpoint, not a new UI clock")
    seg.Raid.Threat[key].Known := 0,V7428RaidRedraw(),row := V7428RaidRow(key)
    V48Assert(lv.GetText(row,10)="--" && lv.GetText(row,11)="--",
        "unknown-only threat records never promote a stored amount to a known result")
}

V7428RaidIdentityAndSorting() => V58Isolated(V7428RaidIdentityAndSortingCase)
V7428RaidIdentityAndSortingCase()
{
    global IP
    V7428RaidReady(),s := IP.Live,pet := "@Example Player#101/Companion {123}:99",peer := "@Example Player#202"
    V51Feed(s,2000,"Damage",20,pet,V51Target())
    V51Feed(s,2000,"Damage",100,peer,V51Target())
    V7428RaidRedraw(),lv := IP.PlayersLV,petKey := IPActor(pet).Key,peerKey := IPActor(peer).Key,owner := IPActor(V51Source()).Key
    V48Assert(lv.GetCount()=4 && V7428RaidRow(petKey)>0 && V7428RaidRow(peerKey)>0,
        "companion and same-named player have separate observed rows")
    V48Assert(InStr(lv.GetText(V7428RaidRow(petKey),1),"[companion]")
        && lv.GetText(V7428RaidRow(owner),2)="1,300","pet damage is labelled and never added to its owner")
    IPWSort("Raid",lv,2)
    V48Assert(lv.GetText(1,9)=owner && lv.GetText(2,9)=peerKey && lv.GetText(3,9)=petKey,
        "damage sorting is numeric: 1300, 100, 20")
    IPWSort("Raid",lv,2)
    V48Assert(lv.GetText(1,9)="@Healer#300" && lv.GetText(2,9)=petKey,
        "ascending damage sorting retains the zero-damage healer and companion")
    IPWRaidSelect(lv,V7428RaidRow(peerKey),true)
    V48Assert(IP.Actor=peerKey && IPWState().Tab=7,"selection after sorting uses exact actor identity")
    IPWRaidDetail(lv,V7428RaidRow(petKey))
    V48Assert(IP.Actor=petKey && IPWState().Tab=2,"companion drilldown uses its retained hidden key")
}

V7428RaidResponsiveLayout() => V58Isolated(V7428RaidResponsiveLayoutCase)
V7428RaidResponsiveLayoutCase()
{
    global IP
    V7428RaidReady(),u := IPWState(),c := u.Controls
    for size in [[980,650],[1220,780],[1920,1080],[2560,1440],[980,650]] {
        IPResize(IP.Gui,0,size[1],size[2]),IRTHeaders()
        IP.PlayersLV.GetPos(&lx,&ly,&lw,&lh)
        V48Assert(lx>=280 && lw>0 && lh>0 && lx+lw<=size[1]-12 && ly+lh<size[2]-42,
            "Raid table clears the sidebar and footer at " size[1] " pixels")
        previousRight := lx
        for name in ["RaidGroupDamage","RaidGroupHealing","RaidGroupTaken","RaidGroupThreat"] {
            control := c[name],control.GetPos(&x,&y,&w,&h)
            V48Assert(V58ChildVisible(control) && w>0 && h>0 && x>=previousRight-1
                && x+w<=lx+lw+1 && y+h<=ly+1,
                "metric group remains ordered above its table at " size[1] ": " name)
            previousRight := x+w
        }
        threatW := SendMessage(0x101D,9,0,IP.PlayersLV.Hwnd),tpsW := SendMessage(0x101D,10,0,IP.PlayersLV.Hwnd)
        V48Assert(threatW>0 && tpsW>0,"threat total and TPS remain available even at minimum window width")
        V48Assert(SendMessage(0x101D,7,0,IP.PlayersLV.Hwnd)=0 && SendMessage(0x101D,8,0,IP.PlayersLV.Hwnd)=0,
            "death count and internal actor key do not consume Raid-table width")
        V48Assert(IP.PlayersLV.GetCount("Col")=12,"responsive sizing retains the stable native column identities")
    }
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"layout checks never show the application")
}

V7428RaidHeaderAlignment() => V58Isolated(V7428RaidHeaderAlignmentCase)
V7428RaidHeaderAlignmentCase()
{
    global IP
    V7428RaidReady(),IPResize(IP.Gui,0,1220,780),lv := IP.PlayersLV
    lv.ModifyCol(1,380),lv.ModifyCol(2,140),IRTHeaders()
    V7428RaidCheckHeader("RaidGroupDamage",2,13)
    V7428RaidCheckHeader("RaidGroupHealing",4,15)
    IPWState().Controls["RaidGroupDamage"].GetPos(&beforeX)
    SendMessage(0x1014,180,0,lv.Hwnd),IRTHeaders()
    IPWState().Controls["RaidGroupDamage"].GetPos(&afterX)
    V48Assert(afterX<beforeX,"the native horizontal-scroll fixture actually moves the metric columns")
    V7428RaidCheckHeader("RaidGroupDamage",2,13)
    V7428RaidCheckHeader("RaidGroupTaken",6,17)
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),
        "native column resize and horizontal scroll checks leave the fixture hidden")
}

V7428RaidCheckHeader(name,firstColumn,lastColumn)
{
    global IP
    lv := IP.PlayersLV,header := SendMessage(0x101F,0,0,lv.Hwnd),first := Buffer(16,0),last := Buffer(16,0)
    V48Assert(SendMessage(0x1207,firstColumn-1,first.Ptr,header)
        && SendMessage(0x1207,lastColumn-1,last.Ptr,header),"native headers expose their displayed cell bounds")
    DllCall("User32\MapWindowPoints","Ptr",header,"Ptr",lv.Hwnd,"Ptr",first,"UInt",2)
    DllCall("User32\MapWindowPoints","Ptr",header,"Ptr",lv.Hwnd,"Ptr",last,"UInt",2)
    bounds := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",lv.Hwnd,"Ptr",bounds)
    left := Max(0,NumGet(first,0,"Int")),right := Min(NumGet(bounds,8,"Int"),NumGet(last,8,"Int"))
    lv.GetPos(&lx,&ly),control := IPWState().Controls[name],control.GetPos(&x,&y,&w,&h),scale := A_ScreenDPI/96
    V48Assert(right>left && V58ChildVisible(control) && Abs((x-lx)*scale-left)<=2
        && Abs(w*scale-(right-left))<=2 && y+h<=ly+1,
        "group heading follows the real native columns after resize or scrolling: " name)
}

V7428RaidViewIsolation() => V58Isolated(V7428RaidViewIsolationCase)
V7428RaidViewIsolationCase()
{
    global IP,IPM,Audio,SETTINGS_FILE
    V7428RaidReady(),s := IP.Live,seg := IPSelectedSegment(),before := IPCsvData(s,seg)
    prefs := FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "<absent>"
    queue := Audio.Queue.Length,active := IP.Active,overlaySource := IPM.Source,selected := IP.Selected
    for tab in [9,7,2,7,3,7,4,7,1,7]
        V58SelectTab(tab)
    V48Assert(IPCsvData(s,seg)=before && IP.Selected=selected,
        "moving between Raid, Deaths and detail pages neither reparses nor changes the selected fight")
    V48Assert(Audio.Queue.Length=queue && IP.Active=active && IPM.Source=overlaySource,
        "Raid navigation does not change audio, parsing or overlay source policy")
    V48Assert((FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "<absent>")=prefs,
        "native page and layout checks do not write saved settings")
    V48Assert(V58ChildVisible(IP.PlayersLV) && !V58ChildVisible(IPWState().Controls["SessionPlayers"]),
        "returning to Raid restores metrics without the deaths-session table")
}

V7428RaidCapture() => V7412PlayerIconFixture(V58Isolated.Bind(V7428RaidCaptureCase))
V7428RaidCaptureCase()
{
    global IP,IUB
    V7428RaidReady(),s := IP.Live,seg := IPSelectedSegment(),u := IPWState(),savedTheme := IUB.Theme
    try {
        IUB.Theme := "iris"
        names := ["Sample Juggernaut","Sample Healer","Sample Powertech","Sample Marauder",
            "Sample Sorcerer","Sample Operative","Sample Tank","Sample Assassin"]
        specs := ["Rage","Medicine","Pyrotech","Annihilation","Lightning","Lethality","Shield Tech","Darkness"]
        keys := [IPActor(V51Source()).Key,"@Healer#300"]
        Loop 6 {
            actor := IPActor("@Raid Sample " A_Index "#" (700+A_Index)),IPStoreActor(seg,actor),keys.Push(actor.Key)
        }
        seg.Last := 120000,seg.Raid.LastThreatAt := seg.Last
        for i,key in keys {
            seg.Actors[key].Name := names[i]
            t := seg.Totals[key],t.Damage := i=2 ? 132000 : (i=7 ? 1116600 : 6125400-i*316600)
            t.Taken := 1400400+i*77730,t.Heal := i=2 ? 4770000 : i*30330
            t.Effective := Round(t.Heal*(i=2 ? 0.86 : 0.67)),t.HealKnown := 1,t.HealRecords := 1
            seg.Raid.Threat[key] := {Total:i=7 ? 17284500 : t.Damage+t.Heal*0.5,Known:90,Missing:0}
            for id,item in IPICatalog() {
                if item.Name=specs[i] {
                    IURRecord(seg,IPParseLine(V622RoleLine(seg.Start,item.Name,id,key)),seg.Start)
                    break
                }
            }
        }
        s.Changed += 1,IUBApplyWindow(IP.Gui,"main"),V7428RaidRedraw()
        for size in [[980,650],[1600,900],[1920,1080],[2560,1440]] {
            IP.Gui.Show("Hide w" size[1] " h" size[2]),IPResize(IP.Gui,0,size[1],size[2])
            IP.PlayersLV.Modify(0,"-Select"),IRTHeaders(),l := u.Layout
            geometry := ""
            for control in [IP.PlayersLV,u.Controls["RaidGroupDamage"]] {
                face := V7430RaidFontFace(control)
                V48Assert(face="Quicksand","the native Raid text uses the chosen face, not font substitution: " face " (loader " IRTFont() ")")
                geometry .= "Rendered font: " face "`n"
            }
            for name in ["RaidGroupDamage","RaidGroupHealing","RaidGroupTaken","RaidGroupThreat","Raid","RaidLabel"] {
                u.Controls[name].GetPos(&cx,&cy,&cw,&ch)
                geometry .= name ": " cx "," cy "," cw "," ch "`n"
            }
            FileOpen(A_ScriptDir "\raid-geometry-" size[1] ".txt","w","UTF-8").Write(geometry)
            file := "raid-table-" size[1] ".png"
            V7412PlayerControlsPng(file,IP.Gui,u.Groups["Raid"],l.InnerX,160,l.InnerW,340)
            V48Assert(FileExist(A_ScriptDir "\" file) && FileGetSize(A_ScriptDir "\" file)>1000,
                "offscreen native Raid preview is saved for visual inspection: " file)
        }
        V48Assert(IP.PlayersLV.GetCount()=8 && !DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),
            "eight-player native preview never shows the normal application")
    }
    finally IUB.Theme := savedTheme
}

; Inspect the font GDI actually selects, rather than the requested LOGFONT name.
V7430RaidFontFace(control)
{
    font := SendMessage(0x31,0,0,control.Hwnd),dc := DllCall("Gdi32\CreateCompatibleDC","Ptr",0,"Ptr")
    old := DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",font,"Ptr"),face := Buffer(128,0)
    try {
        DllCall("Gdi32\GetTextFaceW","Ptr",dc,"Int",64,"Ptr",face,"Int")
        return StrGet(face,"UTF-16")
    }
    finally {
        DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",old)
        DllCall("Gdi32\DeleteDC","Ptr",dc)
    }
}

; Native navigation diagnostic: synthetic data, hidden GUI, no log file writes.
V7430TabTrace() => V58Isolated(V7430TabTraceCase)
V7430TabTraceCase()
{
    global DiagnosticBuffer,IP,SELF_TEST
    V48Assert(SELF_TEST,"tab trace regression is isolated")
    savedBuffer := DiagnosticBuffer,DiagnosticBuffer := ["test-only pending entry"]
    try {
        V7428RaidReady(),V58SelectTab(9),t := IPWState().LastTabTrace
        V48Assert(t.From=7 && t.To=9 && t.Stage="complete" && t.Elapsed>=0,
            "native tab navigation records completion and source/destination")
        report := IWWorkspaceDisplayReport()
        V48Assert(InStr(report,"Last tab transition: 7 -> 9") && InStr(report,"stage=complete"),
            "manual workspace report exposes the trace without reading a log")
        old := IPWTabTraceStart(9,11),recent := IPWTabTraceStart(11,9)
        IPWTabTrace(old,"complete")
        V48Assert(IPWState().LastTabTrace=recent && recent.Sequence>old.Sequence,
            "a superseded transition cannot replace the latest diagnostic state")
        IPWTabTrace(recent,"before refresh")
        V48Assert(DiagnosticBuffer.Length=1 && DiagnosticBuffer[1]="test-only pending entry",
            "isolated navigation neither emits nor flushes the live diagnostic buffer")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),
            "navigation diagnostics never show the normal application")
    }
    finally DiagnosticBuffer := savedBuffer
}

; v74.31: hidden native controls and a test-only lower subclass. No app,
; saved files, audio or gameplay input. The shim queues actual WM_PAINT while
; an outer native message is delayed. No Sleep or manual pump occurs inside it.
V7431SubclassProbeState()
{
    static s := {Depth:0,Paints:0,NestedPaints:0,Before:0,After:0,NestedCritical:0,NestedResult:0,Elapsed:0}
    return s
}

V7431SubclassDelay(h,msg,wParam,lParam,id,refData)
{
    s := V7431SubclassProbeState()
    if msg=0x8731 {
        s.Depth += 1,s.Before := A_IsCritical
        DllCall("User32\InvalidateRect","Ptr",h,"Ptr",0,"Int",true)
        DllCall("User32\PostMessageW","Ptr",h,"UInt",0xF,"UPtr",0,"Ptr",0,"Int")
        if wParam
            s.NestedResult := DllCall("User32\SendMessageW","Ptr",h,"UInt",0x8732,"UPtr",0,"Ptr",0,"Ptr")
        started := A_TickCount
        while A_TickCount-started<30
            remaining := 30-(A_TickCount-started)
        s.Elapsed := A_TickCount-started,s.After := A_IsCritical,s.Depth -= 1
        return 0x7431
    }
    if msg=0x8732 {
        s.NestedCritical := A_IsCritical
        return 0x1734
    }
    if msg=0xF {
        s.Paints += 1
        if s.Depth
            s.NestedPaints += 1
    }
    return DllCall("Comctl32\DefSubclassProc","Ptr",h,"UInt",msg,"UPtr",wParam,"Ptr",lParam,"Ptr")
}

V7431SubclassCases()
{
    global SELF_TEST
    if !SELF_TEST || !A_IsSuspended
        throw Error("Subclass regression requires the suspended isolated test child")
    rows := [],savedCritical := A_IsCritical,callback := CallbackCreate(V7431SubclassDelay,"Fast",6)
    try {
        for kind in ["tab-icons","list-icons","table-style","dropdown-style"] {
            Critical("Off")
            g := Gui("-DPIScale"),control := "",h := 0
            try {
                if kind="tab-icons"
                    control := g.AddTab3("x5 y5 w400 h150",["One","Two","Three"])
                else if kind="dropdown-style"
                    control := g.AddDropDownList("x5 y5 w260 Choose2",["One","Two","Three"])
                else {
                    control := g.AddListView("x5 y5 w400 h150",["Name","Amount"])
                    control.Add("","First",10),control.Add("","Second",20)
                }
                h := control.Hwnd
                if !DllCall("Comctl32\SetWindowSubclass","Ptr",h,"Ptr",callback,"UPtr",7431,"UPtr",0,"Int")
                    throw Error("Could not attach the isolated lower subclass")
                switch kind {
                    case "tab-icons": attached := IPWTIconsAttach(control,[1,2,3])
                    case "list-icons": attached := IAIListAttach(control)
                    case "table-style": attached := ITBAttach(control)
                    case "dropdown-style": attached := IUDStyleAttach(control)
                }
                if !attached
                    throw Error("Production subclass did not attach: " kind)
                g.Show("Hide w420 h180")
                for caller in [0,7,100,0xFFFFFFFF] {
                    Critical("Off"),Sleep(-1)
                    s := V7431SubclassProbeState()
                    for key in ["Depth","Paints","NestedPaints","Before","After","NestedCritical","NestedResult","Elapsed"]
                        s.%key% := 0
                    Critical(caller)
                    result := SendMessage(0x8731,1,0,h)
                    restored := A_IsCritical
                    ; A queued paint must still work once the outer call ends.
                    Critical("Off"),Sleep(-1)
                    rows.Push({Kind:kind,Caller:caller,Before:s.Before,After:s.After,Restored:restored,
                        NestedCritical:s.NestedCritical,NestedResult:s.NestedResult,Result:result,
                        Paints:s.Paints,NestedPaints:s.NestedPaints,Elapsed:s.Elapsed,
                        Hidden:!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int")})
                }
                if kind="dropdown-style"
                    control.Choose(3),functional := control.Value=3 && control.Text="Three"
                else if kind="tab-icons"
                    control.Choose(2),functional := control.Value=2
                else {
                    control.Modify(1,"","Updated",30)
                    functional := control.GetCount()=2 && control.GetText(1)="Updated"
                }
                rows[-1].Functional := functional
            }
            finally {
                Critical("Off")
                if h && DllCall("User32\IsWindow","Ptr",h,"Int")
                    DllCall("Comctl32\RemoveWindowSubclass","Ptr",h,"Ptr",callback,"UPtr",7431,"Int")
                g.Destroy()
            }
            rows[-1].Released := !IPWTIconsState().Tabs.Has(h) && !IAIListState().Lists.Has(h)
                && !ITBState().Tables.Has(h) && !IUDStyleState().Controls.Has(h)
        }
    }
    finally {
        CallbackFree(callback)
        Critical(savedCritical)
    }
    return rows
}

V7431SubclassReentrancy()
{
    for row in V7431SubclassCases() {
        label := row.Kind " caller " row.Caller
        V48Assert(row.Result=0x7431 && row.Elapsed>=30,label ": native message reaches the delayed lower subclass")
        V48Assert(row.Before=0xFFFFFFFF && row.After=0xFFFFFFFF,label ": guard covers downstream native dispatch")
        V48Assert(row.NestedCritical=0xFFFFFFFF && row.NestedResult=0x1734,label ": explicit synchronous nesting keeps the guard and return value")
        V48Assert(row.Restored=row.Caller,label ": Fast callback restores the caller's prior Critical interval")
        V48Assert(row.NestedPaints=0,label ": queued paint cannot recursively interrupt the unfinished callback")
        V48Assert(row.Paints>0,label ": deferred paint still dispatches after the outer callback returns")
        V48Assert(row.Hidden,label ": diagnostic never displays or activates its root")
        if row.HasOwnProp("Functional")
            V48Assert(row.Functional && row.Released,label ": native selection/data and destruction remain functional")
    }
}

; v74.32: synthetic saved pulls in the hidden main Progression fixture.
; Native bitmaps only; no original log, saved history, settings or live input.
V7432ProgressionImageModel() => V749ProgressionFixture(V7432ProgressionImageModelCase)
V7432ProgressionImageRender() => V749ProgressionFixture(V7432ProgressionImageRenderCase)

V7432ProgressionEntries(kind := "hp")
{
    if kind="combined" {
        rows := V742HPEntries("G-AE")
        rows[1].Pull.Progress := IGPCompact(V634Pair(200,150,2000,1000))
        rows[2].Pull.Progress := IGPCompact(V634Pair(150,150,1000,1000))
        for row in rows
            IGPYDemoPhases(row.Pull,["codex","twins"])
        return rows
    }
    if kind="parsely" {
        rows := [V741SavedEntry("G-TY",70,1),V741SavedEntry("G-TY",19,2),V741SavedEntry("G-TY",30,3)]
        for row in rows {
            row.Pull.Boss := "G-SC",row.Pull.Name := "Scyva"
            row.Pull.Group := "G-SC|" row.Pull.Area "|" row.Pull.Mode
            row.Pull.Progress.Profile := "old-internal-map",row.Pull.Progress.Phases := ["Legacy detail"]
        }
        IGPYDemoPhases(rows[1].Pull,["opd","catalysts"])
        IGPYDemoPhases(rows[2].Pull,["opd","catalysts","scyva","ignite","scyva"])
        return rows ; Third pull intentionally has no comparable phase evidence.
    }
    rows := []
    for id,hp in [80,-1,10,30] {
        row := V741SavedEntry("G-TY",hp,id)
        IGPYDemoPhases(row.Pull,["magma","tyth"])
        rows.Push(row)
    }
    return rows
}

V7432ProgressionSeed(v,rows)
{
    v.Source := "history",v.DemoHistory := true,v.History := Map()
    for row in rows
        v.History[row.Key] := row
    v.Boss := rows[1].Pull.Group,v.Character := "",v.Team := "A",v.Window := "all",v.Cycle := ""
    v.Selected := 0,v.Hover := 0,v.Controls["Source"].Choose(2)
    IGVFillFilters(),IGVRefresh()
    IGVImageRefresh(v)
}

V7432ProgressionComparePlot(actual,expected,label)
{
    V48Assert(actual.Axis.Kind=expected.Axis.Kind && actual.Axis.Percent=expected.Axis.Percent,
        label ": the same real HP or combined HP axis is retained")
    V48Assert(actual.Count=expected.Count && actual.Unknown=expected.Unknown && actual.BestIndex=expected.BestIndex,
        label ": style does not change pull count, missing evidence or the best pull")
    for i,point in actual.Points {
        old := expected.Points[i]
        V48Assert(point.Index=old.Index && point.Score=old.Score && point.Best=old.Best
            && point.Known=old.Known && point.Kill=old.Kill && point.Label=old.Label,
            label ": pull " i " keeps its identity, value, ranking and label")
        V48Assert(point.X>=actual.Left-0.001 && point.X<=actual.Right+0.001,
            label ": pull " i " fits the horizontal plot bounds")
        if point.Known {
            position := (point.Y-actual.Top)/(actual.Bottom-actual.Top)
            original := (old.Y-expected.Top)/(expected.Bottom-expected.Top)
            V48Assert(Abs(position-original)<0.000001 && point.Y>=actual.Top-0.001 && point.Y<=actual.Bottom+0.001,
                label ": pull " i " retains its exact normalized vertical position")
        }
        else
            V48Assert(point.Y=-1,label ": unknown pull " i " stays a gap, not zero HP")
        if point.Best>=0 {
            position := (point.BestY-actual.Top)/(actual.Bottom-actual.Top)
            original := (old.BestY-expected.Top)/(expected.Bottom-expected.Top)
            V48Assert(Abs(position-original)<0.000001,label ": best-so-far value at pull " i " stays unchanged")
        }
    }
}

V7432ProgressionBlueNear(bitmap,x,y,radius := 4)
{
    dc := DllCall("Gdi32\CreateCompatibleDC","Ptr",0,"Ptr")
    if !dc
        throw Error("Could not inspect native progression pixels")
    old := DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",bitmap,"Ptr"),found := false
    try {
        Loop radius*2+1 {
            py := Round(y)-radius+A_Index-1
            Loop radius*2+1 {
                px := Round(x)-radius+A_Index-1
                color := DllCall("Gdi32\GetPixel","Ptr",dc,"Int",px,"Int",py,"UInt")
                r := color&255,g := (color>>8)&255,b := (color>>16)&255
                if b>90 && b>g*1.45 && g>r*1.65
                    found := true
            }
        }
    }
    finally {
        DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",old)
        DllCall("Gdi32\DeleteDC","Ptr",dc)
    }
    return found
}

V7432ProgressionImageModelCase(v)
{
    for kind in ["hp","combined","parsely"] {
        rows := V7432ProgressionEntries(kind),before := V741SavedSignature(rows)
        V7432ProgressionSeed(v,rows),selectedRows := v.Rows,summary := v.ImageSummary
        expected := IGVPlotModel(v.Rows,900,350,1,v.Boss)
        V48Assert(summary.RowsRef=v.Rows && summary.Boss=v.Boss,"cached image summary follows the selected " kind " rows")
        V48Assert(summary.BasePlot.Axis.Kind=(kind="parsely" ? "hp" : kind),"summary chooses " kind " without substituting another progress measure")
        image := IGVImageDraw(v,960,440,1)
        try {
            plot := image.Plot
            V7432ProgressionComparePlot(plot,expected,kind)
            V48Assert(plot.Left>=0 && plot.Top>40 && plot.Right<960 && plot.Bottom<440
                && plot.Right>plot.Left && plot.Bottom>plot.Top,"summary and axes fit above/around the live " kind " chart")
            center := (plot.Left+plot.Right)/2
            V48Assert(IGVHitIndex(plot,center,0)=0 && IGVHitIndex(plot,center,plot.Top-1)=0
                && IGVHitIndex(plot,center,plot.Bottom+1)=0,"header, phase badges and footer cannot select a " kind " pull")
            for i,point in plot.Points
                V48Assert(IGVHitIndex(plot,point.X,(plot.Top+plot.Bottom)/2)=i,"physical hit testing selects the original " kind " pull " i)
            if kind="hp" {
                a := plot.Points[1],c := plot.Points[3],d := plot.Points[4]
                V48Assert(!V7432ProgressionBlueNear(image.Bitmap,(a.X+c.X)/2,(a.Y+c.Y)/2),
                    "native blue line does not bridge the missing-health pull")
                V48Assert(V7432ProgressionBlueNear(image.Bitmap,(c.X+d.X)/2,(c.Y+d.Y)/2),
                    "native blue line still joins consecutive observed pulls")
            }
        }
        finally DllCall("Gdi32\DeleteObject","Ptr",image.Bitmap)
        V48Assert(v.Rows=selectedRows && v.ImageSummary=summary && before=V741SavedSignature(rows),
            "drawing " kind " keeps the selected row objects, summary cache and complete saved evidence unchanged")
    }
    ; Drive the real mouse handler with chart-local coordinates, without moving
    ; the OS cursor or posting gameplay/native input to any window.
    rows := V7432ProgressionEntries(),V7432ProgressionSeed(v,rows)
    V749ProgressionSetSize(1220,780),IGVSelect(3)
    selected := v.Controls["Selected"].Text,point := v.Plot.Points[1]
    lParam := (Round(point.Y)<<16)|(Round(point.X)&0xFFFF)
    IGVMouseMove(0,lParam,0x200,v.Controls["Chart"].Hwnd)
    V48Assert(v.Selected=3 && v.Hover=1 && InStr(v.Controls["Selected"].Text,"80.0%"),
        "new chart coordinates retain separate selection and hover details")
    IGVMouseMove(0,0,0x200,v.Gui.Hwnd)
    V48Assert(v.Hover=0 && v.Controls["Selected"].Text=selected,"leaving the chart restores the selected pull details")
    IGVMouseMove(0,Round(point.X)&0xFFFF,0x200,v.Controls["Chart"].Hwnd)
    V48Assert(v.Hover=0 && v.Selected=3 && v.Controls["Selected"].Text=selected,
        "hovering the new header leaves the selected pull untouched")
}

V7432ProgressionImageRenderCase(v)
{
    rows := []
    for id,hp in [97,88,94,80,76,90,68,72,58,64,-1,46,61,40,51,32,48,26,35,21,31,14,24,8] {
        row := V741SavedEntry("G-TY",hp,id)
        IGPYDemoPhases(row.Pull,hp>=0 && hp<30 ? ["magma","tyth","burn"] : ["magma","tyth"])
        rows.Push(row)
    }
    before := V741SavedSignature(rows),V7432ProgressionSeed(v,rows),IGVSelect(24)
    for dims in [[980,650,true],[1920,1080,false],[2560,1440,false]] {
        box := V749ProgressionSetSize(dims[1],dims[2])
        if v.DetailVisible!=dims[3]
            IGVToggleDetails()
        V749ProgressionAssertBounds(v,box,dims[1] " image-style chart")
        v.Controls["Chart"].GetPos(,,&width,&height)
        for scale in [1,1.5] {
            pw := Round(width*scale),ph := Round(height*scale)
            image := IGVImageDraw(v,pw,ph,scale)
            try {
                bitmap := V74RIBitmap(image.Bitmap),m := image.Plot
                V48Assert(bitmap.W=pw && bitmap.H=ph && m.Width=pw && m.Height=ph,
                    "native progression render matches every physical pixel at " dims[1] " / " scale)
                V48Assert(m.Left>=0 && m.Top>0 && m.Right<pw && m.Bottom<ph && m.Bottom>m.Top,
                    "plot remains usable inside compact/table and large chart at " dims[1] " / " scale)
                V7432ProgressionComparePlot(m,IGVPlotModel(v.Rows,900,350,1,v.Boss),dims[1] " / " scale)
                V48Assert(IGVHitIndex(m,m.Points[24].X,m.Points[24].Y)=24
                    && IGVHitIndex(m,m.Points[24].X,m.Top-1)=0,"scaled selection stays on pull24 and out of its header")
                path := A_ScriptDir "\progression-live-" dims[1] (dims[3] ? "-table" : "-graph") "-" Round(scale*100) ".png"
                ISRIWritePng(image.Bitmap,path)
                V48Assert(FileGetSize(path)>1000,"native chart preview was written for inspection")
            }
            finally DllCall("Gdi32\DeleteObject","Ptr",image.Bitmap)
        }
    }
    V48Assert(v.Selected=24 && before=V741SavedSignature(rows),"resizing and native image previews preserve selection and every saved pull field")
    ; With the search/filter row added since this fixture was written, a
    ; 462px page leaves 104 chart pixels. Exercise that short native layout.
    batch := IGLState(),savedBusy := batch.Busy
    failures := v.DrawFailures,v.DetailVisible := true
    IPWProgressionResize(600,462)
    try {
        batch.Busy := true
        IGLProgress({Index:1,Items:[1],Snapshot:""},"Opening")
        v.Controls["Chart"].GetPos(,,&cw,&ch)
        V48Assert(v.LoadingView && ch=104 && v.DrawFailures=failures && IsObject(v.Plot),
            "short embedded table retains a usable graph while its loading row is active")
        for kind in ["observed","empty","unknown"] {
            if kind!="observed" {
                v.Rows := kind="empty" ? [] : [V741SavedEntry("G-TY",-1,1)]
                IGVImageRefresh(v)
            }
            for scale in [1,1.5] {
                image := IGVImageDraw(v,Round(cw*scale),Round(ch*scale),scale)
                try {
                    m := image.Plot,lastY := -1.0
                    V48Assert(m.Bottom-m.Top>=30*scale && m.Bottom+39*scale<=m.Height,
                        "short " kind " graph retains plot and full axis labels at " scale)
                    for tick in m.YTicks {
                        if tick.Label=""
                            continue
                        V48Assert(lastY<0 || tick.Y-lastY>=18*scale,"short loading graph keeps Y labels apart")
                        lastY := tick.Y
                    }
                    ISRIWritePng(image.Bitmap,A_ScriptDir "\progression-live-loading-" kind "-" Round(scale*100) ".png")
                }
                finally DllCall("Gdi32\DeleteObject","Ptr",image.Bitmap)
            }
        }
    }
    finally {
        batch.Busy := savedBusy
        IGLProgress()
    }
}

; Native, hidden overlay checks. No parsing, hotkeys, sound or saved settings.
V7433OverlayIconSymbols()
{
    global SELF_TEST
    V48Assert(SELF_TEST,"overlay icon checks are isolated diagnostics")
    seen := Map(),catalog := IOICatalog()
    V48Assert(catalog.Count=18 && catalog["PvP"].Key="damage" && catalog["Achievements"].Key="trophy" && catalog["BossDamage"].Key="target" && catalog["FightFeedback"].Key="feedback","every supported overlay heading has a semantic symbol, including boss damage and fight feedback")
    for size in [16,24,32] {
        hashes := Map()
        for kind,entry in catalog {
            icon := IOIGet(entry.Key,size,entry.Color)
            V48Assert(icon && icon=IOIGet(entry.Key,size,entry.Color),"same native symbol is cached without redrawing")
            info := Buffer(A_PtrSize=8 ? 32 : 20,0)
            V48Assert(DllCall("User32\GetIconInfo","Ptr",icon,"Ptr",info,"Int"),"symbol is a real native icon")
            mask := NumGet(info,A_PtrSize=8 ? 16 : 12,"Ptr"),bitmap := NumGet(info,A_PtrSize=8 ? 24 : 16,"Ptr")
            try {
                detail := Buffer(A_PtrSize=8 ? 32 : 24,0)
                V48Assert(DllCall("Gdi32\GetObjectW","Ptr",bitmap,"Int",detail.Size,"Ptr",detail,"Int") && NumGet(detail,4,"Int")=size && NumGet(detail,8,"Int")=size,"native artwork is generated at exact physical DPI size")
            }
            finally {
                if mask
                    DllCall("Gdi32\DeleteObject","Ptr",mask)
                if bitmap
                    DllCall("Gdi32\DeleteObject","Ptr",bitmap)
            }
            canvas := ISRICanvas(size,size),pixels := Buffer(size*size*4,0),colored := 0
            try {
                DllCall("Gdi32\PatBlt","Ptr",canvas.DC,"Int",0,"Int",0,"Int",size,"Int",size,"UInt",0x00000042)
                V48Assert(DllCall("User32\DrawIconEx","Ptr",canvas.DC,"Int",0,"Int",0,"Ptr",icon,"Int",size,"Int",size,"UInt",0,"Ptr",0,"UInt",3,"Int"),"native symbol paints into the actual pixel canvas")
                loop size {
                    y := A_Index-1
                    loop size {
                        x := A_Index-1,color := DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",x,"Int",y,"UInt")
                        NumPut("UInt",color,pixels,(y*size+x)*4)
                        if color
                            colored += 1
                    }
                }
                V48Assert(colored>size && colored<size*size*0.80,"symbol has visible strokes and open surrounding space")
                V48Assert(!NumGet(pixels,0,"UInt") && !NumGet(pixels,(size*size-1)*4,"UInt"),"transparent icon corners preserve the underlying overlay")
                hash := IAIBinaryHash(pixels)
                V48Assert(!hashes.Has(hash),"each overlay has distinct semantic artwork: " kind),hashes[hash] := true
            }
            finally ISRICanvasClose(canvas)
        }
    }
    V48Assert(!IOIGet("unsupported-symbol",16),"unrecognized identity produces no misleading artwork")
    g := Gui(),cell := IOINewCell(g)
    try {
        V48Assert(IOISet(cell,"clock",16),"picture accepts a cached native icon copy")
        owned := SendMessage(0x173,1,0,cell.Control.Hwnd)
        V48Assert(owned && owned!=IOIGet("clock",16),"picture owns a distinct copy rather than cached icon")
        IOICleanup(),info := Buffer(A_PtrSize=8 ? 32 : 20,0)
        V48Assert(DllCall("User32\GetIconInfo","Ptr",owned,"Ptr",info,"Int"),"cache cleanup leaves displayed native copy alive")
        loaded := Buffer(A_PtrSize=8 ? 32 : 24,0)
        V48Assert(DllCall("Gdi32\GetObjectW","Ptr",NumGet(info,A_PtrSize=8 ? 24 : 16,"Ptr"),"Int",loaded.Size,"Ptr",loaded,"Int")
            && NumGet(loaded,4,"Int")=16 && NumGet(loaded,8,"Int")=16,"Picture's first loaded copy retains requested pixels instead of shrinking to its initial one-pixel placeholder")
        DllCall("Gdi32\DeleteObject","Ptr",NumGet(info,A_PtrSize=8 ? 16 : 12,"Ptr"))
        DllCall("Gdi32\DeleteObject","Ptr",NumGet(info,A_PtrSize=8 ? 24 : 16,"Ptr"))
        V48Assert(IOISet(cell,"damage",24) && cell.Size=24,"existing picture can switch native icon and DPI")
        V48Assert(!IOISet(cell,"bad-identity",24) && !cell.HaveIcon && !cell.Control.Visible,"unavailable artwork hides stale symbol while keeping text control separate")
    }
    finally g.Destroy()
    IOICleanup(),IOICleanup()
    V48Assert(IOIState().Created=IOIState().Released && !IOIState().Icons.Count,"all cached originals release exactly once with idempotent cleanup")
}

V7433OverlayIconControls() => V571Isolated(V7433OverlayIconControlsCase)
V7433OverlayIconControlsCase()
{
    global IPM
    snapshot := V53Snapshot(),p := IPM.Panel
    IPMEnsureGui("Personal"),IPMRender("Personal",snapshot)
    for kind in ["Damage","Heal","Taken","Personal"] {
        IPMRender(kind,snapshot)
        V48Assert(p.HeadingIcon.Key=IOICatalog()[kind].Key && p.HeadingIcon.Control.Visible,"combined overlay switches heading symbol with actual rendered metric")
        V48Assert(InStr(p.Heading.Text,IPMDefinition(kind).Title),"semantic icon retains the existing accessible heading text")
        for row in p.PersonalRows
            V48Assert(row.Icon.Control.Visible=(kind="Personal"),"personal row icons follow the personal page visibility")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"icon render never opens the hidden diagnostic window")
    }
    for kind,entry in IOICatalog() {
        panel := kind="Personal" ? IPM.Panel : IPM.Panels[kind]
        IPMEnsureGui(kind,0,panel),IPMParserArrange(panel,panel.Layout)
        V48Assert(panel.HeadingIcon.Key=entry.Key && SendMessage(0x173,1,0,panel.HeadingIcon.Control.Hwnd),"independent overlay has a loaded native header icon: " kind)
        V48Assert((DllCall("User32\GetWindowLongW","Ptr",panel.Gui.Hwnd,"Int",-20,"UInt")&0x08000020)=0x08000020,"header artwork retains no-activation and locked body clickthrough")
    }
    old := p.HeadingIcon.Control,p.Gui.Destroy(),IPMEnsureGui("Personal"),IPMRender("Personal",snapshot)
    V48Assert(!IPMUiHandle(old) && IPMUiHandle(p.HeadingIcon.Control) && p.HeadingIcon.HaveIcon,"rebuilding an externally destroyed panel recreates owned picture controls")
    V48Assert(!IPM.TimerOn && !IPM.DragHooks && !IPM.ParserHooks,"artwork installs no active timers or input hooks")
    V7433OverlayIconPreview(p,"personal")
    IPMRender("Damage",snapshot),V7433OverlayIconPreview(p,"damage")
}

V7433OverlayIconLayout() => V571Isolated(V7433OverlayIconLayoutCase)
V7433OverlayIconLayoutCase()
{
    global IPM
    IPMEnsureGui("Personal"),p := IPM.Panel
    for dpi in [96,144,192] {
        for width in [196,246,480] {
            for controls in [false,true] {
                IPM.ParserControls := controls
                l := IPMCleanLayout(width,240,10,dpi,3840,2160,true,true,true,6,24)
                IPMArrange(p,l,true)
                p.Heading.GetPos(&hx,&hy,&hw,&hh),p.HeadingIcon.Control.GetPos(&ix,&iy,&iw,&ih)
                rect := IPMParserRect(0,0,l)
                V48Assert(ix>=0 && iy>=0 && ix+iw<=hx && iy+ih<=hh,"header icon remains entirely in its own gutter at every width and DPI")
                V48Assert(hx+hw=(controls ? rect.X : l.W),"icon reservation preserves the exact original parse-button boundary")
                for row in p.PersonalRows {
                    row.Icon.Control.GetPos(&x,&y,&w,&h),row.Name.GetPos(&nx,&ny,&nw,&nh),row.Total.GetPos(&tx,&ty,&tw,&th)
                    V48Assert(x+w<=nx && nx+nw<=tx && y>=l.Header && y+h<=l.H,"personal icon and label stay outside numeric columns")
                    V48Assert(nw>30*l.Scale && w>=Round(12*l.Scale) && w<=Round(14*l.Scale) && h=w,"narrow panels retain readable labels and native-scale artwork: dpi=" dpi " width=" width " nw=" nw " w=" w " expected=" Round(14*l.Scale))
                }
            }
        }
    }
    IPM.Editing := true,IPMStyle(p)
    V48Assert(!(DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt")&0x20),"unlocked overlay still accepts drag and resize input")
    V48Assert(IPMParserIsButton(p,p.ParserButton.Hwnd) && !IPMParserIsButton(p,p.HeadingIcon.Control.Hwnd),"decoration cannot accidentally activate the parser button")
}

V7433OverlayIconPreview(p,name)
{
    root := A_ScriptDir "\overlay-previews"
    if !DirExist(root)
        DirCreate(root)
    canvas := ISRICanvas(p.Layout.W,p.Layout.H)
    try {
        SendMessage(0x317,canvas.DC,0x1C,p.Gui.Hwnd)
        ISRIWritePng(canvas.Bitmap,root "\" name ".png")
    }
    finally ISRICanvasClose(canvas)
}

; Native timer icon checks: real bundled personal-buff rules and copied display
; values, with private icon cache/settings and hidden windows. No live audio.
V7433TimerIconIdentity()
{
    shield := V654BuffDef("Energy Shield"),fuel := V654BuffDef("Explosive Fuel")
    V48Assert(IRTUIconId(shield)="814218425139200" && IRTUIconId(fuel)="986266225082368",
        "reviewed personal-buff rules use their exact bundled game artwork")
    s := V654BuffState(),p := IRTUNewState()
    V654BuffObserve(s,"fuel-gain",1000),V654BuffObserve(s,"shield-gain",1202)
    snap := IRTUSnapshot(s,2000,p)
    V48Assert(snap.Rows.Length=2 && snap.Rows[1].Name="Explosive Fuel" && snap.Rows[1].IconId="986266225082368",
        "observed fuel application keeps its existing ordering and gains exact artwork")
    V48Assert(snap.Rows[2].IconId="814218425139200" && snap.Rows[2].Remaining=14202,
        "observed shield application retains the real deadline")
    original := IRTIClone(shield),p.SelectedPreview := IRTUSelectedPreview(shield,1000,5).Preview
    shield.Trigger.AbilityGuid := "986266225082368",shield.Trigger.EffectGuid := ""
    V48Assert(IRTUIconId(shield)="986266225082368","same display name with a different exact ID changes icon identity")
    V48Assert(IRTUPreviewSnapshot(p,2000).Rows[1].IconId="814218425139200",
        "selected preview copies icon identity rather than aliasing a changing rule")
    shield := original,shield.Trigger.AbilityGuid := "",shield.Trigger.EffectGuid := "986266225082368"
    V48Assert(IRTUIconId(shield)="986266225082368","an exact bundled effect can supply artwork when no ability ID exists")
    shield.Trigger.Type := "ABILITY_ACTIVATED"
    V48Assert(IRTUIconId(shield)="","activation does not use an ignored effect filter as its identity")
    shield.Trigger.Type := "EFFECT_GAINED",shield.Trigger.EffectGuid := "99999999999999999999"
    V48Assert(IRTUIconId(shield)="","a known label never guesses artwork for an unknown ID")
    shield.Trigger.AbilityGuid := "814218425139200|986266225082368"
    V48Assert(IRTUIconId(shield)="","multiple or malformed identifiers never pick an arbitrary icon")
    shield.Trigger.AbilityGuid := "814218425139200",shield.Trigger.Type := "TIMER_STARTED"
    V48Assert(IRTUIconId(shield)="","linked timers do not borrow an unrelated source trigger icon")
    V48Assert(IRTUIconId(IRTDefinition("Energy Shield"))="","custom timers without a log identity use the clock")
    V48Assert(s.Active.Count=2 && s.Alerts.Length=0,"display metadata creates no extra timers or warnings")
}

V7433TimerIconNative() => V69IconsFixture(V7433TimerIconNativeCache)
V7433TimerIconNativeCache(cache) => V65UITimerIsolated(V7433TimerIconNativeCase)
V7433TimerIconNativeCase(path)
{
    global IRT,IRTPrefs,Audio
    IRT := V654BuffState(),p := IRTPrefs,foreground := WinExist("A"),audioCount := Audio.Queue.Length
    V654BuffObserve(IRT,"fuel-gain",1000),V654BuffObserve(IRT,"shield-gain",1202)
    d := IRTDefinition("Next add wave"),d.Enabled := true,d.Color := "AA88E8",d.Interval := 22000
    IRT.Active[d.Id] := {Key:d.Id,Def:d,Name:d.Name,Start:1000,Due:23000,Interval:22000}
    IRTURender(IRT,2000)
    V48Assert(p.LastError="" && p.Rows[1].Icon.TimerKind="ability" && p.Rows[3].Icon.TimerKind="clock",
        "actual native bars render exact artwork and the generic clock together")
    V48Assert(SendMessage(0x173,0,0,p.Rows[1].Icon.Control.Hwnd)!=0
        && SendMessage(0x173,1,0,p.Rows[3].Icon.Control.Hwnd)!=0,"ability bitmap and semantic icon both own native pixel resources")
    first := p.Rows[1].Icon,bitmap := SendMessage(0x173,0,0,first.Control.Hwnd)
    p.BarSignature := "",IRTURender(IRT,2000)
    V48Assert(SendMessage(0x173,0,0,first.Control.Hwnd)=bitmap,"ordinary redraw reuses loaded ability image")
    for key,active in IRT.Active {
        if active.Def.Name="Explosive Fuel" {
            fuelInstance := active
            active.Def.Trigger.AbilityGuid := "814218425139200",active.Def.Trigger.EffectGuid := ""
            break
        }
    }
    IRTURender(IRT,2000)
    V48Assert(first.TimerId="814218425139200" && first.TimerKind="ability" && p.Rows[1].Name.Text="Explosive Fuel",
        "same-name and same-countdown ID change refreshes the actual row")
    fuelInstance.Def.Trigger.AbilityGuid := "",fuelInstance.Def.Trigger.Ability := "Explosive Fuel"
    IRTURender(IRT,2000)
    V48Assert(first.TimerKind="clock" && SendMessage(0x173,1,0,first.Control.Hwnd)!=0,
        "removing exact identity replaces old artwork with a clock rather than a stale icon")
    fuelInstance.Def.Trigger.AbilityGuid := "986266225082368",IRTURender(IRT,2000)
    V48Assert(first.TimerKind="ability" && SendMessage(0x173,0,0,first.Control.Hwnd)!=0,
        "picture ownership safely switches back from semantic icon to ability bitmap")
    for scale in [60,100,150,200] {
        p.Scale := scale
        for width in [180,330,600] {
            p.BarsWidth := width,IRTURender(IRT,2000)
            V48Assert(p.LastError="","supported size and narrow width render without pausing the overlay")
            for index in [1,3] {
                row := p.Rows[index]
                row.Icon.Control.GetPos(&ix,&iy,&iw,&ih),row.Name.GetPos(&nx,&ny,&nw,&nh)
                row.Time.GetPos(&tx,&ty,&tw,&th),row.Bar.GetPos(&bx,&by,&bw,&bh)
                V48Assert(ix>=0 && iy>=by && iy+ih<=by+bh && ix+iw<=bx && bx+bw<=p.Layout.W,
                    "native ability and clock boxes fit their bars without covering text")
                V48Assert(nw>0 && nx>=bx && nx+nw<tx && tx+tw<=p.Layout.W,
                    "timer label and right-aligned countdown retain separate positive widths")
                V48Assert(tw<=Round(62*p.Layout.Scale) && tx+tw=p.Layout.W-Max(1,Round(7*p.Layout.Scale))
                    && IRTUBarNamePixels(row.Time,row.Time.Text)<=tw,
                    "compact timer labels retain the complete countdown and its original right edge")
            }
        }
    }
    p.Scale := 100,p.BarsWidth := 330,IRTURender(IRT,2000)
    V7433TimerIconPreview(p,"timer-icons-normal.png")
    p.BarsWidth := 180,IRTURender(IRT,12000),V7433TimerIconPreview(p,"timer-icons-narrow.png")
    p.Scale := 150,p.BarsWidth := 330,IRTURender(IRT,12000),V7433TimerIconPreview(p,"timer-icons-large.png")
    ; Warm the larger urgent clock once before measuring replacement churn.
    fuelInstance.Def.Trigger.AbilityGuid := "",IRTURender(IRT,12000)
    fuelInstance.Def.Trigger.AbilityGuid := "814218425139200",IRTURender(IRT,12000)
    process := DllCall("GetCurrentProcess","Ptr"),before := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    Loop 30 {
        fuelInstance.Def.Trigger.AbilityGuid := Mod(A_Index,2) ? "814218425139200" : ""
        IRTURender(IRT,12000)
    }
    after := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    V48Assert(after<=before+3,"replacing native row artwork does not grow GDI resources per redraw (" before " to " after ")")
    p.SelectedPreview := IRTUSelectedPreview(V654BuffDef("Energy Shield"),1000,5).Preview
    p.PreviewStart := 1000,p.PreviewUntil := p.SelectedPreview.Until,IRTURender(IRT,2000)
    V48Assert(p.Rows[1].Icon.TimerId="814218425139200" && p.Rows[1].Time.Text="14.0",
        "selected timer preview uses the same artwork and unchanged countdown")
    V48Assert(!p.Rows[2].Icon.Control.Visible && !p.Rows[3].Icon.Control.Visible,"preview hides unused row artwork")
    IRTUReset()
    for row in p.Rows
        V48Assert(!row.Icon.Control.Visible,"reset hides every sample icon")
    IRTURender(IRT,2000),old := p.Rows[1].Icon.Control,p.BarsGui.Destroy(),IRTURender(IRT,2000)
    V48Assert(!IPMUiHandle(old) && IPMUiHandle(p.Rows[1].Icon.Control) && p.Rows[1].Icon.Control.Visible,
        "externally destroyed bars rebuild their owned image controls")
    style := DllCall("User32\GetWindowLongW","Ptr",p.BarsGui.Hwnd,"Int",-20,"UInt")
    V48Assert((style & 0x08000020)=0x08000020 && !DllCall("User32\IsWindowVisible","Ptr",p.BarsGui.Hwnd),
        "icon rows preserve click-through, no-activation and hidden diagnostic windows")
    V48Assert(Audio.Queue.Length=audioCount && WinExist("A")=foreground && !FileExist(path),
        "timer artwork does not play audio, steal focus or write settings")
}

V7433TimerIconPreview(p,name)
{
    canvas := ISRICanvas(p.Width,p.Height)
    try {
        SendMessage(0x317,canvas.DC,0x1C,p.BarsGui.Hwnd)
        ISRIWritePng(canvas.Bitmap,A_ScriptDir "\" name)
    }
    finally ISRICanvasClose(canvas)
}

; Pure events and hidden native panels only. Never starts the live reader,
; changes saved settings, sends audio or installs a gameplay hotkey.
V7434UtilityFind(s,who,key,now,prefs := "")
{
    if !IsObject(prefs)
        prefs := IRUUNewState()
    for row in IRURows(s,prefs,now).Rows {
        if row.Key=who Chr(30) key
            return row
    }
    return ""
}

V7434UtilityOptionalPower()
{
    for pair in [["Lightning","3415495432732672","3415495432732947","Unlimited Power"],
        ["Telekinetics","3429041759584256","3429041759584529","Force Empowerment"]] {
        s := IRUNewState(),caster := "@Caster#2",recipient := "@Recipient#3"
        V67UtilityMeta(s,1000,caster,pair[1])
        V67UtilityMeta(s,1000,recipient,pair[1])
        V48Assert(IRURows(s,IRUUNewState(),1000).Count=0,"Sorc/Sage metadata alone leaves optional raid buffs hidden")
        V67UtilityFeed(s,1100,recipient,"=",pair[2],pair[2],"apply")
        V67UtilityFeed(s,1200,recipient,"=",pair[2],pair[3],"apply")
        V48Assert(!IsObject(V7434UtilityFind(s,recipient,"power",1200)),"self-reported effect and lockout snapshots do not prove a personal cast")
        V67UtilityFeed(s,2000,caster,"=",pair[2])
        row := V7434UtilityFind(s,caster,"power",2000)
        V48Assert(IsObject(row) && row.Utility=pair[4] && row.IconId=pair[2] && row.Status="~5:00","actual cast reveals only its caster with the correct faction artwork and cooldown")
        V67UtilityFeed(s,2010,caster,recipient,pair[2],pair[3],"apply")
        V67UtilityFeed(s,2020,caster,recipient,pair[2],pair[2],"apply")
        V48Assert(!IsObject(V7434UtilityFind(s,recipient,"power",2020)),"receiving another player's active buff and anchored lockout never reveals the recipient")
        t := s.Timers[recipient Chr(30) "power"]
        V48Assert(t.Used<0 && t.LockDue=302000 && t.ActiveUntil=12000,"hidden recipient retains real lockout and effect evidence without becoming a caster")
        V48Assert(V7434UtilityFind(s,caster,"power",302000).Ready,"observed optional buff remains visible when its cooldown finishes")
        V48Assert(!IsObject(V7434UtilityFind(s,recipient,"power",302000)),"expiration of an unproven recipient lockout does not reveal its optional buff")
        V67UtilityFeed(s,303000,recipient,"=",pair[2])
        row := V7434UtilityFind(s,recipient,"power",303000)
        V48Assert(IsObject(row) && row.Status="~5:00" && row.IconId=pair[2],"recipient becomes a holder only after its own later cast")
        ev := IPParseLine(IPDemoLine(304000,recipient,"=","Enter"))
        IRUObserve(s,ev,304000,"",304000,"fixture","@Owner#1")
        V48Assert(V7434UtilityFind(s,recipient,"power",304000).Status="~4:59","a new pull preserves observed use and the remaining cooldown")
        prefs := IRUUNewState(),prefs.RaidBuffs := false
        V48Assert(!IsObject(V7434UtilityFind(s,caster,"power",304000,prefs)) && s.Players[caster].Observed.Has("power"),"category filtering hides rows without forgetting actual use")
    }
    s := IRUNewState()
    V67UtilityFeed(s,1000,"@Unknown#9","=","3429041759584256")
    V48Assert(V7434UtilityFind(s,"@Unknown#9","power",1000).Utility="Force Empowerment","actual use also reveals a caster before discipline metadata arrives")
}

V7434UtilityObservationScope()
{
    s := IRUNewState(),who := "@Sorc#2",id := "3415495432732672"
    V67UtilityFeed(s,1000,who,"=",id)
    V48Assert(IsObject(V7434UtilityFind(s,who,"power",1000)),"initial actual use is visible")
    V67UtilityMeta(s,2000,who,"Lightning","9999","different-source")
    V48Assert(!IsObject(V7434UtilityFind(s,who,"power",2000)),"new source forgets previous roster talent evidence")
    V67UtilityFeed(s,3000,who,"=",id,,,"different-source")
    ev := IPParseLine(IPDemoLine(4000,"@Owner#1","=","Enter"))
    ev.Kind := "Area",ev.AreaId := "1",ev.ModeId := "2"
    IRUObserve(s,ev,4000,"",4000,"different-source","@Owner#1")
    V67UtilityMeta(s,4100,who,"Lightning","9999","different-source")
    V48Assert(!IsObject(V7434UtilityFind(s,who,"power",4100)) && s.Timers.Count=0,"area reset hides the optional buff until fresh caster evidence")
    V67UtilityFeed(s,4200,who,"=",id,,,"different-source")
    V67UtilityMeta(s,4300,who,"Fury","9999","different-source")
    V48Assert(!IsObject(V7434UtilityFind(s,who,"power",4300)),"recorded combat-style change still removes now-ineligible utilities")
}

V7434UtilityPriorityState()
{
    s := IRUNewState()
    for pair in [["@Alpha Damage#2","Fury"],["@Zulu Unknown#3","Corruption"],
        ["@Middle Ready#4","Medicine"],["@Beta Dead#5","Bodyguard"],["@Omega Cooling#6","Seer"]]
        V67UtilityMeta(s,1000,pair[1],pair[2])
    V67UtilityFeed(s,2000,"@Middle Ready#4","@Dead#9","814875555135488")
    V67UtilityFeed(s,2500,"@Middle Ready#4","=","814875555135488","814875555135770","apply")
    ev := IPParseLine(IPDemoLine(3000,"Boss {900}:1","@Beta Dead#5","Death"))
    IRUObserve(s,ev,3000,"",3000,"fixture","@Owner#1")
    V67UtilityFeed(s,302000,"@Omega Cooling#6","@Dead#9","812826855735296")
    V67UtilityFeed(s,302500,"@Omega Cooling#6","=","812826855735296","812826855735572","apply")
    return s
}

V7434UtilityBattleRezPriority()
{
    s := V7434UtilityPriorityState(),prefs := IRUUNewState(),rows := IRURows(s,prefs,303000).Rows
    expected := ["@Beta Dead#5","@Middle Ready#4","@Omega Cooling#6","@Zulu Unknown#3"]
    V48Assert(rows.Length=8,"priority keeps every eligible utility while omitting unobserved Sorc/Sage buff")
    for i,who in expected
        V48Assert(rows[i].Key=who Chr(30) "rez","every healer rez is globally first and retains alphabetical ordering")
    V48Assert(rows[1].Status="Dead" && rows[2].Ready && rows[3].Status="~5:00" && rows[4].Ready,"dead, ready, cooling and assumed-ready rez share the same fixed priority")
    V48Assert(rows[5].Player="Alpha Damage" && rows[6].Player="Alpha Damage","remaining player utilities retain their prior order")
    prefs.BattleRez := false,filtered := IRURows(s,prefs,303000).Rows
    V48Assert(filtered.Length=4 && filtered[1].Key=rows[5].Key,"disabling rez leaves normal utility ordering intact")
    prefs.BattleRez := true,prefs.Rebounder := false,prefs.Predation := false,prefs.RaidBuffs := false
    onlyRez := IRURows(s,prefs,303000).Rows
    V48Assert(onlyRez.Length=4 && onlyRez[4].Key=rows[4].Key,"rez-only filtering preserves all healers")
}

V7434UtilityPriorityUI() => V69IconsFixture(V7434UtilityPriorityUICache)
V7434UtilityPriorityUICache(cache) => V67UtilityUIFixture(V7434UtilityPriorityUICase)
V7434UtilityPriorityUICase()
{
    global IPM,IRU,IRUU
    IRU := V7434UtilityPriorityState(),IRU.LastAt := 303000,IRU.LastTick := ClockMs()
    p := IPM.Panels["RaidUtility"],p.Width := 400,p.AutoHeight := false,p.Height := 120
    IPMEnsureGui("RaidUtility",0,p),IPMRender("RaidUtility",{State:"LIVE LOG"},p)
    V48Assert(p.VisibleRows>0 && p.VisibleRows<8,"small fixed-height overlay actually truncates the utility list")
    V48Assert(p.Rows[1].Name.Text="Beta Dead" && p.Rows[1].Total.Text="Battle rez" && p.UtilityIcons[1].Id="2940854301884416","top visible real row is the prioritized healer with its own class icon")
    Loop Min(4,p.VisibleRows)
        V48Assert(p.Rows[A_Index].Total.Text="Battle rez","truncation gives available space to battle rez first")
    V48Assert(InStr(p.Meta.Text,p.VisibleRows " of 8 shown"),"truncated view reports all remaining utility rows")
    IRUU.BattleRez := false,IPMRender("RaidUtility",{State:"LIVE LOG"},p)
    V48Assert(p.Rows[1].Name.Text="Alpha Damage" && p.Rows[1].Total.Text!="Battle rez","category change immediately replaces the top row")
    IRUU.BattleRez := true,IPMRender("RaidUtility",{LayoutPreview:true},p)
    V48Assert(p.Rows[1].Total.Text="Battle rez" && p.UtilityIcons[1].Id="808287075303424","preview uses the same rez-first presentation")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd),"priority diagnostics never expose the native panel")
}

; Persisted phase replay state must remain plain data. Raw fixtures are already
; anonymized, and these checks never read a user log or use a production cache.
V7435PhaseCacheData()
{
    for fixture in V74GodsParselyCases() {
        profile := V74GodsParselyProfile(fixture.Boss)
        expected := {BossKey:fixture.Boss,AreaId:profile.Area,ModeId:profile.Mode,
            Start:fixture.Start,End:fixture.End,Last:fixture.End,PhaseProgress:Map()}
        restored := IPCDecode(IPCEncode(expected)),didCheckpoint := false
        for index,record in fixture.Records {
            event := IPParseLine(record.Raw),event.RecordId := record.Line
            IGPYObserve(expected,event,record.At,profile),IGPYObserve(restored,event,record.At,profile)
            if !didCheckpoint && restored.PhaseProgress.Has("Parsely") {
                phase := restored.PhaseProgress["Parsely"]
                V48Assert(ObjGetBase(phase)=Object.Prototype && phase.HasOwnProp("ReplayBase"),
                    "observed Parsely phase stores its replay snapshot as ordinary data")
                V48Assert(ObjGetBase(phase.ReplayBase)=Object.Prototype,
                    "phase replay snapshot has no accidental prototype")
                restored := IPCDecode(IPCEncode(restored)),didCheckpoint := true
            }
        }
        V48Assert(didCheckpoint && V74PEWindows(expected)=V74PEWindows(restored),
            "phase transitions continue unchanged after a strict cache round trip")
        before := V74PEWindows(restored),final := IPCDecode(IPCEncode(restored))
        V48Assert(before=V74PEWindows(final),"completed Gods phase boundaries survive native persistence")
        V48Assert(final.PhaseProgress["Parsely"].Current=expected.PhaseProgress["Parsely"].Current
            && final.PhaseProgress["Parsely"].Limited=expected.PhaseProgress["Parsely"].Limited,
            "cache retains current phase and partial-evidence status")
    }
    custom := {Base:{Marker:1},Value:2},rejected := false
    try IPCEncode(custom)
    catch Error as err
        rejected := err.Message="Custom instances are not cache data."
    V48Assert(rejected,"production encoder still rejects unrelated custom prototypes")
}

V7435SectionCacheData()
{
    expected := V73SectionState(),restored := V73SectionState()
    V73SectionObserve(expected,"apply",1000,1),V73SectionObserve(restored,"apply",1000,1)
    ledger := restored.PhaseWindows.Meta["Ledger"]
    V48Assert(ObjGetBase(ledger)=Object.Prototype && ledger.HasOwnProp("ReplayBase"),
        "recorded-section ledger stores its replay base without using reserved Base")
    V48Assert(ObjGetBase(ledger.ReplayBase)=Object.Prototype,"recorded-section replay state remains ordinary data")
    restored := IPCDecode(IPCEncode(restored))
    for row in [["remove",2000,2],["apply",3000,3],["remove",4000,4],["apply",6000,5]] {
        V73SectionObserve(expected,row[1],row[2],row[3])
        V73SectionObserve(restored,row[1],row[2],row[3])
    }
    before := IGVJson(IGWPack(IGWCompact(expected))),after := IGVJson(IGWPack(IGWCompact(restored)))
    V48Assert(before=after,"section windows continue unchanged after a persisted replay checkpoint")
    final := IPCDecode(IPCEncode(restored))
    V48Assert(IGVJson(IGWPack(IGWCompact(final)))=after,
        "completed and open section windows survive strict native persistence")
    V48Assert(final.PhaseWindows.Meta["Ledger"].Floor=restored.PhaseWindows.Meta["Ledger"].Floor,
        "cache preserves the chronological replay horizon")
}

; Isolated observed-health fixtures. No user history, log or live audio.
V7435HPEntry(seg,id := 1)
{
    e := V741SavedEntry("G-TY",40,id),p := e.Pull
    p.Boss := seg.BossKey,p.Name := seg.BossKey,p.Area := seg.AreaId,p.Mode := seg.ModeId
    p.Group := p.Boss "|" p.Area "|" p.Mode,p.Progress := IGPCompact(seg)
    return e
}

V7435HPAllAxes()
{
    for boss,profiles in IGPYProfiles()
        for p in profiles {
            group := boss "|" p.Area "|" p.Mode,m := IGVPlotModel([],900,250,1,group)
            V48Assert(m.Axis.Percent && m.Points.Length=0,"every supported encounter retains an HP axis even without data: " group)
        }
    a := V74PVEntry(["opd","catalysts","scyva","ignite","scyva"])
    m := IGVPlotModel([a],900,250,1,a.Pull.Group)
    V48Assert(m.Axis.Percent && !m.Points[1].Known && m.Points[1].Y=-1,"phase evidence alone cannot fabricate boss health")
    V48Assert(InStr(IGVPointLabel(a,1),"Scyva 2") && InStr(IGVPointLabel(a,1),"Boss HP unavailable"),"unknown-health hover still identifies the observed repeated phase")
}

V7435HPNahutCapture()
{
    seg := V63Segment("G-NA")
    IGPObserve(seg,V63Event("Damage","4122949560827904",48,1000),1000)
    IGPObserve(seg,V63Event("Damage","4131857322999808",2,2000),2000)
    e := V7435HPEntry(seg),q := e.Pull.Progress
    IGPYDemoPhases(e.Pull,["nahut","couplings"])
    V48Assert(q.Stage=2 && q.Hp=2 && q.Health.Hp=48,"Nahut boss HP survives the coupling stage without using coupling HP")
    m := IGVPlotModel([e],900,250,1,e.Pull.Group)
    V48Assert(m.Axis.Kind="hp" && m.Points[1].Known && Abs(m.Points[1].Y-(m.Top+0.52*(m.Bottom-m.Top)))<0.000001,"Nahut plots its observed 48 percent exactly")
    V48Assert(InStr(IGVPointLabel(e,1),"48.0% boss HP remaining") && InStr(IGVPointLabel(e,1),"Couplings"),"Nahut hover gives both actual HP and current phase")
    IGPObserve(seg,V63Event("Damage","4122949560827904",42,3000),3000)
    V48Assert(IGPCompact(seg).Health.Hp=42 && q.Health.Hp=48,"whole-boss HP updates during couplings and previous compact copy stays immutable")
    old := IPRCloneSnapshot(e),old.Pull.Progress.DeleteProp("Health")
    before := V741SavedSignature([old]),m := IGVPlotModel([old],900,250,1,old.Pull.Group)
    V48Assert(!m.Points[1].Known && InStr(IGVPointLabel(old,1),"Couplings"),"saved coupling-only HP stays a gap without losing recorded phase")
    V48Assert(before=V741SavedSignature([old]),"viewing legacy coupling-only history does not migrate it")
}

V7435HPLegacyPrimary()
{
    for pair in [["G-NA","4122949560827904"],["G-SC","4108140513591296"],["G-IZ","4108097563918336"]] {
        seg := V63Segment(pair[1]),IGPObserve(seg,V63Event("Damage",pair[2],37,1000,"900000000000001",true),1000)
        e := V7435HPEntry(seg),e.Pull.Progress.DeleteProp("Health"),before := V741SavedSignature([e])
        m := IGVPlotModel([e],900,250,1,e.Pull.Group)
        V48Assert(m.Points[1].Known && InStr(m.Points[1].Label,"37.0% boss HP remaining"),"valid older primary-boss snapshot is recovered read-only: " pair[1])
        V48Assert(before=V741SavedSignature([e]),"old primary-boss history bytes remain unchanged")
        e.Pull.Progress.Targets[1].Npc := "4131857322999808"
        V48Assert(!IGVPlotModel([e],900,250,1,e.Pull.Group).Points[1].Known,"a coupling substituted into legacy main-boss snapshot is rejected")
    }
}

V7435HPRoundTrip()
{
    seg := V63Segment("G-NA"),IGPObserve(seg,V63Event("Damage","4122949560827904",48,1000),1000)
    e := V7435HPEntry(seg),packed := IGVPackProgress(e.Pull.Progress)
    restored := IGVUnpackProgress(ParseJson(IGVJson(packed)))
    V48Assert(packed.Length=16 && IGVJson(IGVPackProgress(restored))=IGVJson(packed),"new optional health field round-trips exactly")
    V48Assert(restored.Health.Hp=48 && restored.Health.Targets[1].Npc="4122949560827904","exact target identity and actual health survive compact storage")
    for length in [13,14,15] {
        fixture := V741SavedEntry("G-TY",48,1,length=13 ? 13 : 14)
        if length=15
            IGPYDemoPhases(fixture.Pull,["magma","tyth"])
        legacy := IGVPackProgress(fixture.Pull.Progress)
        decoded := IGVUnpackProgress(ParseJson(IGVJson(legacy)))
        V48Assert(!decoded.HasOwnProp("Health") && IGVJson(IGVPackProgress(decoded))=IGVJson(legacy),"old " length "-field history stays compatible and unchanged")
    }
    bad := IPRCloneSnapshot(e),bad.Pull.Progress.Health.Hp := 2
    V48Assert(!IGVPlotModel([bad],900,250,1,bad.Pull.Group).Points[1].Known,"health aggregate inconsistent with its snapshots is rejected")
    bad := IPRCloneSnapshot(e),bad.Pull.Progress.Health.Comparable := false
    V48Assert(!IGVPlotModel([bad],900,250,1,bad.Pull.Group).Points[1].Known,"invalid new evidence cannot fall back to an older phase minimum")
}

V7435HPWeighted()
{
    seg := V63Segment("DP-CO")
    ids := ["3273984850264064","3273989145231360","3273993440198656","3273997735165952"]
    for index,id in ids {
        ev := V63Event("Damage",id,index=1 ? 50 : 100,index*1000)
        ev.SourceHP.Maximum := index=1 ? 200 : 100
        IGPObserve(seg,ev,index*1000)
    }
    e := V7435HPEntry(seg),m := IGVPlotModel([e],900,250,1,e.Pull.Group)
    V48Assert(m.Axis.Kind="combined" && m.Points[1].Known && Abs(e.Pull.Progress.Health.Hp-70)<0.000001,"multiple primary bosses use latest observed HP weighted by maximum health")
    ev := V63Event("Damage",ids[1],150,5000),ev.SourceHP.Maximum := 200
    IGPObserve(seg,ev,5000),IGPObserve(seg,V63Event("Damage",ids[2],20,6000),6000)
    V48Assert(IGPCompact(seg).Health.Hp=70,"independent lifetime minima are not added into a fictional combined sample")
    IGPObserve(seg,V63Event("Damage",ids[3],10,7000),7000)
    V48Assert(IGPCompact(seg).Health.Hp=56,"a new observed weighted pair can improve the best result")
    IGPObserve(seg,V63Event("Death",ids[3],0,8000,"900000000000001",true),8000)
    IGPObserve(seg,V63Event("Damage",ids[3],100,9000),9000)
    V48Assert(IGPCompact(seg).Health.Hp=54 && seg.PhaseProgress["MainHP:raptus"].Dead
        && seg.PhaseProgress["MainHP:raptus"].Last=0,"later corpse health cannot resurrect a defeated boss in a paired snapshot")
    V742HPWeightedSisters()
}

V7435HPJournal()
{
    seg := V63Segment("G-NA"),data := IPNewData("Private whole-boss health journal")
    IGPObserve(seg,V63Event("Damage","4122949560827904",48,1000),1000)
    before := IGVJson(IGVPackProgress(IGPCompact(seg)))
    IPBBeginUndo(data,seg)
    IGPObserve(seg,V63Event("Damage","4122949560827904",12,2000),2000)
    V48Assert(IGPCompact(seg).Health.Hp=12,"provisional event updates whole-boss health")
    IPBRollbackTail(data,seg)
    V48Assert(IGVJson(IGVPackProgress(IGPCompact(seg)))=before,"rollback restores independent HP and all phase observations together")
}

V7435HPGuards()
{
    seg := V63Segment("G-NA"),IGPObserve(seg,V63Event("Damage","4122949560827904",48,1000),1000)
    e := V7435HPEntry(seg),before := IGVJson(IGPHPack(e.Pull.Progress.Health))
    ev := V63Event("Damage","4122949560827904",80,2000),ev.SourceHP.Maximum := 200
    IGPObserve(seg,ev,2000),bad := V7435HPEntry(seg)
    V48Assert(!IGVPlotModel([bad],900,250,1,bad.Pull.Group).Points[1].Known,"changed health maximum is unavailable rather than merged across incompatible scales")
    V48Assert(before=IGVJson(IGPHPack(e.Pull.Progress.Health)),"later invalid scale does not mutate prior compact snapshot")
    for reason in ["excluded","unfinished","conflict"] {
        bad := IPRCloneSnapshot(e)
        switch reason {
            case "excluded": bad.Pull.Included := false
            case "unfinished": bad.Pull.Ended := false
            case "conflict": bad.Conflict := "Synthetic conflict"
        }
        V48Assert(!IGVPlotModel([bad],900,250,1,bad.Pull.Group).Points[1].Known,"universal HP graph respects " reason)
    }
    seg := V63Segment("G-NA"),IGPObserve(seg,V63Event("Damage","4122949560827904",48,2000),2000)
    IGPObserve(seg,V63Event("Damage","4122949560827904",42,1500),1500)
    V48Assert(IGPCompact(seg).Health.Hp=42,"accepted delayed same-scale boss observation can improve the real minimum")
}

V7435HPPrimaryCatalogue()
{
    for boss,p in IPXProfiles() {
        seg := V63Segment(boss),seg.AreaId := p.Area,seg.ModeId := p.Mode,index := 0,expected := ""
        for npc,group in p.Actors {
            rule := IGPHRule(seg,npc)
            if !IsObject(rule)
                continue
            expected := rule.Required,index += 1
            IGPObserve(seg,V63Event("Damage",npc,75,index*1000),index*1000)
        }
        entry := V7435HPEntry(seg),m := IGVPlotModel([entry],900,250,1,entry.Pull.Group)
        if boss="DX-E1" || boss="DX-E2"
            V48Assert(!m.Points[1].Known,"objective encounter has no invented boss HP: " boss)
        else
            V48Assert(m.Points[1].Known && InStr(m.Points[1].Label,"75.0%"),"exact primary boss actors produce real health: " boss)
    }
    seg := V63Segment("EC-ZT"),seg.AreaId := "833571547775688"
    V48Assert(!IsObject(IGPHRule(seg,"2855809654456320")),"Murdok cleanup is excluded from Zorn and Toth HP")
    seg := V63Segment("TFB-TF"),seg.AreaId := "137438992720"
    V48Assert(IGPHRule(seg,"3025220344479744").Group="boss" && IGPHRule(seg,"3025233229381632").Group="boss",
        "both exact Terror boss variants belong to its single HP scale")
}

V7435HPSequential()
{
    cases := [
        ["DX-HMM","4265104388390912","4330237567434752","Huntmaster","Shelleigh"],
        ["DX-HV","4265104388390912","4330237567434752","Huntmaster","Shelleigh"],
        ["RAV-CR","3371437658210304","3371441953177600","Coratanni","Ruugar"],
        ["TOS-RE","3431605855059968","3447583133401088","Revan","Machine Core"]]
    for c in cases {
        profile := IPXProfiles()[c[1]],seg := V63Segment(c[1]),seg.AreaId := profile.Area,seg.ModeId := profile.Mode
        ev := V63Event("Damage",c[2],12,1000),ev.Source.Name := c[4],IGPObserve(seg,ev,1000)
        early := V7435HPEntry(seg),m := IGVPlotModel([early],900,250,1,early.Pull.Group)
        V48Assert(m.Points[1].Known && early.Pull.Progress.Health.Hp=12 && InStr(IGVPointLabel(early,1),c[4]),"early sequential boss has its own real HP and hover identity: " c[1])
        idle := V63Event("Activate",c[3],100,1200),idle.Source.Name := c[5]
        IGPObserve(seg,idle,1200)
        idle.Kind := "Other",IGPObserve(seg,idle,1300)
        V48Assert(IGPCompact(seg).Health.Hp=12 && IGPCompact(seg).Health.Name=c[4],
            "inactive future boss HP and background activation do not replace the current boss: " c[1])
        ev := V63Event("Damage",c[3],72,2000),ev.Source.Name := c[5],IGPObserve(seg,ev,2000)
        late := V7435HPEntry(seg),m := IGVPlotModel([late],900,250,1,late.Pull.Group)
        V48Assert(m.Points[1].Known && late.Pull.Progress.Health.Hp=72 && InStr(IGVPointLabel(late,1),c[5]),"later boss replaces the previous boss's lower HP with its actual current value: " c[1])
        IGPObserve(seg,V63Event("Damage",c[2],1,3000),3000)
        V48Assert(IGPCompact(seg).Health.Hp=72,"old boss's later event cannot replace the active later boss")
        if c[1]="DX-HMM" {
            ev := V63Event("Damage",c[3],0,4000),ev.Source.Name := c[5],IGPObserve(seg,ev,4000)
            zero := V7435HPEntry(seg),m := IGVPlotModel([zero],900,250,1,zero.Pull.Group)
            V48Assert(zero.Pull.Progress.Health.Hp=0 && m.Points[1].Known && !m.Points[1].Kill,"Shelleigh's observed zero is kept, but zero HP alone does not confirm encounter completion")
        }
    }
    seg := V63Segment("DX-TR"),seg.AreaId := "833571547775792"
    for index,id in ["4245970309087232","4245987488956416","4245983193989120","4245978899021824"]
        IGPObserve(seg,V63Event("Damage",id,40,index*1000),index*1000)
    early := V7435HPEntry(seg),m := IGVPlotModel([early],900,250,1,early.Pull.Group)
    V48Assert(m.Axis.Percent && m.Points[1].Known && early.Pull.Progress.Health.Kind="combined"
        && early.Pull.Progress.Health.Hp=40,"Trandoshans opening uses four actual weighted boss snapshots")
    idle := V63Event("Activate","4381150109761536",100,4500),IGPObserve(seg,idle,4500)
    V48Assert(IGPCompact(seg).Health.Kind="combined" && IGPCompact(seg).Health.Hp=40,
        "inactive Ultimate Hunter presence does not replace the active Trandoshans")
    ev := V63Event("Damage","4381150109761536",80,5000),ev.Source.Name := "Ultimate Hunter",IGPObserve(seg,ev,5000)
    late := V7435HPEntry(seg),m := IGVPlotModel([early,late],900,250,1,late.Pull.Group)
    V48Assert(m.Points[1].Known && m.Points[2].Known && late.Pull.Progress.Health.Kind="hp"
        && late.Pull.Progress.Health.Hp=80 && InStr(IGVPointLabel(late,2),"Ultimate Hunter"),
        "Ultimate Hunter uses its own recorded HP instead of the earlier Trandoshans minimum")
    seg := V63Segment("DX-HMM"),seg.AreaId := "833571547775792"
    IGPObserve(seg,V63Event("Damage","4265104388390912",48,1000),1000)
    IGPObserve(seg,V63Event("Damage","4330237567434752",72,2000,"900000000000001",true),2000)
    V48Assert(IGPCompact(seg).Health.Hp=72,"positive player damage to the future boss also confirms takeover")
}

V7435HPLegacyBudget()
{
    seg := V63Segment("G-NA"),IGPObserve(seg,V63Event("Damage","4122949560827904",48,1000),1000)
    while seg.PhaseProgress.Count<96
        seg.PhaseProgress["SyntheticLegacy:" seg.PhaseProgress.Count] := true
    V48Assert(!IGPHLegacyLimit(seg.PhaseProgress),"new whole-boss fields do not consume the old phase metadata allowance")
    ev := V63Event("Damage","4122949560827904",42,2000),ev.Source.Key := "N:4122949560827904:100"
    IGPObserve(seg,ev,2000)
    V48Assert(!seg.PhaseProgress.Get("Limited",false) && seg.PhaseProgress.Has("HP:1:N:4122949560827904:100"),
        "legacy phase observation still fits after whole-boss fields take the map above 96 entries")
    while !IGPHLegacyLimit(seg.PhaseProgress)
        seg.PhaseProgress["SyntheticLegacy:" seg.PhaseProgress.Count] := true
    ev.Source.Key := "N:4122949560827904:101",IGPObserve(seg,ev,3000)
    V48Assert(seg.PhaseProgress.Get("Limited",false),"the original limit still guards genuinely full legacy metadata")
}

; Isolated synthetic roster and hidden panel; no live input or saved settings.
V7436UtilityGroupingState()
{
    s := IRUNewState()
    for pair in [["@Zed Healer#9","Medicine"],["@Alpha Mara#2","Fury"],
        ["@Bravo Vanguard#3","Plasmatech"],["@Charlie Mara#4","Carnage"],
        ["@Delta PT#5","Pyrotech"],["@Echo Sentinel#6","Watchman"],
        ["@Foxtrot Healer#7","Sawbones"]]
        V67UtilityMeta(s,1000,pair[1],pair[2])
    return s
}

V7436UtilityRowKeys(rows)
{
    text := ""
    for row in rows
        text .= row.Key "`n"
    return text
}

V7436UtilityGroupedRows()
{
    s := V7436UtilityGroupingState(),prefs := IRUUNewState(),rows := IRURows(s,prefs,2000).Rows
    expected := [["@Foxtrot Healer#7","rez"],["@Zed Healer#9","rez"],
        ["@Bravo Vanguard#3","rebounder"],["@Delta PT#5","rebounder"],
        ["@Alpha Mara#2","predation"],["@Charlie Mara#4","predation"],["@Echo Sentinel#6","predation"],
        ["@Alpha Mara#2","bloodthirst"],["@Charlie Mara#4","bloodthirst"],["@Echo Sentinel#6","bloodthirst"],
        ["@Foxtrot Healer#7","tactical"],["@Zed Healer#9","tactical"]]
    V48Assert(rows.Length=expected.Length,"grouping keeps every eligible utility exactly once")
    for index,pair in expected
        V48Assert(rows[index].Key=pair[1] Chr(30) pair[2],"utility groups remain contiguous despite interleaved player names")
    V48Assert(rows[3].IconId="801354998088314" && rows[4].IconId="880189122806402",
        "Vanguard and Powertech rebounders share a group while retaining their own icons")
    V48Assert(rows[7].Utility="Transcendence" && rows[10].Utility="Inspiration",
        "faction names remain intact inside the common utility groups")
    before := V7436UtilityRowKeys(rows)
    V67UtilityFeed(s,2100,"@Alpha Mara#2","=","2516812180750336")
    ev := IPParseLine(IPDemoLine(2200,"Boss {900}:1","@Delta PT#5","Death"))
    IRUObserve(s,ev,2200,"",2200,"fixture","@Owner#1")
    rows := IRURows(s,prefs,2300).Rows
    V48Assert(before=V7436UtilityRowKeys(rows) && rows[4].Status="Dead" && rows[5].Status="~0:30",
        "death and active cooldown updates change status without moving utilities")
    V48Assert(before=V7436UtilityRowKeys(IRURows(s,prefs,33000).Rows),"cooldown expiry keeps the same group order")
    prefs.BattleRez := false,prefs.Predation := false
    filtered := IRURows(s,prefs,33000).Rows
    V48Assert(filtered.Length=7 && filtered[1].Key=expected[3][1] Chr(30) "rebounder"
        && filtered[2].Key=expected[4][1] Chr(30) "rebounder","category filtering leaves rebounders together at the top")
    prefs.RaidBuffs := false
    V48Assert(IRURows(s,prefs,33000).Count=2,"rebounder-only selection keeps both holders")
}

V7436UtilityGroupedUI() => V69IconsFixture(V7436UtilityGroupedUICache)
V7436UtilityGroupedUICache(cache) => V67UtilityUIFixture(V7436UtilityGroupedUICase)
V7436UtilityGroupedUICase()
{
    global IPM,IRU,IRUU
    IRU := V7436UtilityGroupingState(),IRU.LastAt := 2000,IRU.LastTick := ClockMs()
    p := IPM.Panels["RaidUtility"],p.Width := 480,p.AutoHeight := true
    IPMEnsureGui("RaidUtility",0,p),IPMRender("RaidUtility",{State:"LIVE LOG"},p)
    V48Assert(p.VisibleRows>=7 && p.Rows[3].Name.Text="Bravo Vanguard" && p.Rows[4].Name.Text="Delta PT"
        && p.Rows[3].Total.Text="Rebounder" && p.Rows[4].Total.Text="Rebounder",
        "native overlay places rebounders next to each other after the battle rez group")
    V48Assert(p.Rows[5].Total.Text="Predation" && p.Rows[6].Total.Text="Predation" && p.Rows[7].Total.Text="Transcendence",
        "native overlay keeps equivalent speed utilities adjacent")
    IRUU.BattleRez := false,IPMRender("RaidUtility",{State:"LIVE LOG"},p)
    V48Assert(p.Rows[1].Total.Text="Rebounder" && p.Rows[2].Total.Text="Rebounder",
        "hiding battle rez immediately moves the complete rebounder group up")
    IRUU.BattleRez := true,IPMRender("RaidUtility",{LayoutPreview:true},p)
    V48Assert(p.Rows[3].Name.Text="Damage One" && p.Rows[4].Name.Text="Tank One",
        "preview also sorts names within the rebounder group")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd),"grouping diagnostics keep the native panel hidden")
}

; Private native font checks. No normal app, saved preferences or live inputs.
V7438FontNative()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"font diagnostics require the isolated suspended child")
    g := Gui(),g.SetFont("s9","Segoe UI")
    lv := g.AddListView("w480 h120",["Player","Damage"])
    lv.Add(,"Sophie",34284512),lv.Add(,"Cîryndà",28405920)
    try {
        for weight in [400,700] {
            lv.SetFont("s11 w" weight,"Segoe UI")
            before := Buffer(92,0),old := SendMessage(0x31,0,0,lv.Hwnd)
            DllCall("Gdi32\GetObjectW","Ptr",old,"Int",92,"Ptr",before)
            V48Assert(ITQApply(lv),"bundled face selects into the native control")
            V48Assert(V7430RaidFontFace(lv)="Quicksand","Windows selects Quicksand instead of a fallback")
            font := SendMessage(0x31,0,0,lv.Hwnd),after := Buffer(92,0)
            DllCall("Gdi32\GetObjectW","Ptr",font,"Int",92,"Ptr",after)
            V48Assert(NumGet(before,0,"Int")=NumGet(after,0,"Int") && NumGet(after,16,"Int")=weight,
                "changing the bundled face preserves pixel height and regular/bold weight")
            dc := DllCall("Gdi32\CreateCompatibleDC","Ptr",0,"Ptr"),prior := DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",font,"Ptr")
            try {
                metrics := Buffer(60,0)
                V48Assert(DllCall("Gdi32\GetTextMetricsW","Ptr",dc,"Ptr",metrics,"Int") && NumGet(metrics,28,"Int")=weight,
                    "selected font exposes the actual requested regular/bold metrics")
            }
            finally {
                DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",prior),DllCall("Gdi32\DeleteDC","Ptr",dc)
            }
            count := ITQState().Fonts.Count
            Loop 30
                ITQApply(lv)
            V48Assert(ITQState().Fonts.Count=count && SendMessage(0x31,0,0,lv.Hwnd)=font,
                "repeated styling reuses the same native font handle")
        }
        V48Assert(!ITQState().Failed && ITQState().Resources.Length=2,"exactly two process-private font faces load once")
        V48Assert(lv.GetText(1,2)="34284512" && lv.GetText(2,1)="Cîryndà","font selection preserves accented names and exact values")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"font probe never opens a visible window")
    }
    finally g.Destroy()
}

V7438FontScope() => V59Hidden(V7438FontScopeCase)
V7438FontScopeCase()
{
    global IP
    V58UseFixture(),a := IAState(),count := 0
    original := V7430RaidFontFace(IP.StartButton)
    for entry in [{Gui:IP.Gui,Role:"main"},{Gui:a.Gui,Role:"analysis"}] {
        ITBApplyWindow(entry.Gui,entry.Role)
        for control in entry.Gui {
            if control.Type!="ListView" || ITBSpecialList(control)
                continue
            count += 1
            V48Assert(V7430RaidFontFace(control)="Quicksand","actual " entry.Role " table selects the embedded family")
        }
    }
    V48Assert(count>=10,"font scope inspects the real parser and analysis tables")
    V48Assert(V7430RaidFontFace(IP.StartButton)=original,"table font does not change the parser toolbar")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int") && !DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd,"Int"),
        "all real-window font inspection remains hidden")
}

; Isolated native desktop controls. Never open a real popup or normal Iris.
V7439InterfaceFonts()
{
    g := Gui(),g.SetFont("s10","Segoe UI")
    controls := [g.AddText("x12 y12 w360 h25","Quicksand interface"),
        g.AddButton("x12 y44 w120 h28","Load fight"),
        g.AddCheckBox("x150 y44 w220 h28","Follow current fight"),
        g.AddEdit("x12 y84 w360 h26","Search abilities"),
        g.AddDropDownList("x12 y122 w360 Choose2",["Overall","Ignite Core","Burn"]),
        g.AddComboBox("x12 y164 w360 Choose1",["Sophie","Cîryndà"]),
        g.AddTab3("x12 y208 w360 h100",["Overview","Damage","Healing"])]
    g.SetFont("s9","Consolas"),raw := g.AddEdit("x12 y320 w360 h26","[00:01:30.000] raw log")
    try {
        IUBApplyWindow(g)
        for c in controls
            V48Assert(V7430RaidFontFace(c)="Quicksand","themed dialog " c.Type " selects Quicksand")
        V48Assert(V7430RaidFontFace(raw)="Consolas","deliberate monospace diagnostics keep their font")
        before := ITQState().Fonts.Count
        loop 10
            IUBApplyWindow(g)
        V48Assert(ITQState().Fonts.Count=before,"repeated appearance changes reuse shared interface fonts")
        for bold in [false,true] {
            font := IUMFont(96,bold),lf := Buffer(92,0)
            DllCall("Gdi32\GetObjectW","Ptr",font,"Int",92,"Ptr",lf)
            V48Assert(StrGet(lf.Ptr+28,32,"UTF-16")="Quicksand","custom menus use the same bundled face")
        }
        g.Show("Hide w390 h364")
        V7412PlayerControlsPng("interface-controls.png",g,controls,0,0,390,310)
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"settings preview stays hidden")
    }
    finally {
        g.Destroy(),IUBPruneWindows(),IUSPrune(),IUDPrune()
    }
}

V7439DropdownFonts()
{
    g := Gui(),g.SetFont("s10","Segoe UI")
    ddl := g.AddDropDownList("w300 Choose2",["Overall","Ignite Core","Burn"])
    combo := g.AddComboBox("w300 Choose2",["Sophie","Cîryndà","Bõõ"])
    try {
        for c in [ddl,combo] {
            info := Buffer(A_PtrSize=8 ? 64 : 52,0),NumPut("UInt",info.Size,info,0)
            V48Assert(DllCall("User32\GetComboBoxInfo","Ptr",c.Hwnd,"Ptr",info,"Int"),"native selector exposes its child controls")
            oldValue := c.Value,oldText := c.Text
            IUBApplyWindow(g),IUDApplyWindow(g,"analysis")
            V48Assert(V7430RaidFontFace(c)="Quicksand","selector font survives the dropdown tint pass")
            for offset in [A_PtrSize=8 ? 48 : 44,A_PtrSize=8 ? 56 : 48] {
                child := NumGet(info,offset,"Ptr")
                if child && child!=c.Hwnd
                    V48Assert(V7430RaidFontFace({Hwnd:child})="Quicksand","native edit/list child inherits Quicksand")
            }
            V48Assert(c.Value=oldValue && c.Text=oldText,"selection and accented text survive font application")
            dc := DllCall("User32\GetDC","Ptr",c.Hwnd,"Ptr")
            prior := DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",SendMessage(0x31,0,0,c.Hwnd),"Ptr")
            try {
                metrics := Buffer(60,0),DllCall("Gdi32\GetTextMetricsW","Ptr",dc,"Ptr",metrics)
                V48Assert(SendMessage(0x154,-1,0,c.Hwnd)>=NumGet(metrics,0,"Int"),"closed selector height fits the actual font")
                V48Assert(SendMessage(0x154,0,0,c.Hwnd)>=NumGet(metrics,0,"Int"),"popup row height fits the actual font")
            }
            finally {
                DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",prior),DllCall("User32\ReleaseDC","Ptr",c.Hwnd,"Ptr",dc)
            }
            V48Assert(!SendMessage(0x157,0,0,c.Hwnd),"font diagnostic never opens the popup")
        }
    }
    finally g.Destroy(),IUBPruneWindows(),IUSPrune(),IUDPrune()
}

V7439WorkspaceFonts() => V59Hidden(V7439WorkspaceFontsCase)
V7439WorkspaceFontsCase()
{
    global IP
    V58UseFixture(),a := IAState(),audit := "",count := 0
    for entry in [{Gui:IP.Gui,Role:"main"},{Gui:a.Gui,Role:"analysis"}] {
        IUBApplyWindow(entry.Gui,entry.Role),types := Map()
        for c in entry.Gui {
            if c.Type="Picture" || c.Type="Progress" || (c.Type="ListView" && ITBSpecialList(c))
                continue
            if !SendMessage(0x31,0,0,c.Hwnd)
                continue
            face := V7430RaidFontFace(c)
            V48Assert(face="Quicksand","real " entry.Role " " c.Type " uses the chosen interface font: " face)
            count += 1,types[c.Type] := types.Get(c.Type,0)+1
        }
        audit .= entry.Role " controls:`n"
        for type,n in types
            audit .= "  " type ": " n "`n"
    }
    V48Assert(count>80,"audit includes real toolbar, tabs, labels and Analysis controls")
    IPRefresh(true)
    V48Assert(V7430RaidFontFace(IPWState().Controls["ParserState"])="Quicksand","status refresh retains the chosen face")
    for width in [980,1920,2560] {
        IP.Gui.Show("Hide w" width " h1080"),IPResize(IP.Gui,0,width,1080),controls := []
        for c in IP.Gui {
            if V58ChildVisible(c)
                controls.Push(c)
        }
        V7412PlayerControlsPng("workspace-header-" width ".png",IP.Gui,controls,0,0,width,160)
    }
    FileOpen(A_ScriptDir "\interface-font-audit.txt","w","UTF-8").Write(audit "Total: " count "`n")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int") && !DllCall("User32\IsWindowVisible","Ptr",a.Gui.Hwnd,"Int"),"workspace font audit keeps both windows hidden")
}

; No normal window launch, saved user settings, audio or gameplay input.
V7440FontPreference()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"font preference tests require the isolated child")
    names := ITQFontChoices(),seen := Map(),seen.CaseSense := "Off"
    V48Assert(names.Length>3 && names[1]="Quicksand","bundled default precedes installed Windows text fonts")
    for name in names {
        V48Assert(!seen.Has(name) && SubStr(name,1,1)!="@","font choices have no duplicate or vertical family")
        seen[name] := true
    }
    names.Push("must not change the cached list")
    V48Assert(ITQFontChoices().Length=seen.Count,"callers cannot change the cached font choices")
    V48Assert(ITQNormalizeFont("segOE ui")="Segoe UI","saved installed names are matched without case sensitivity")
    path := A_Temp "\iris-font-choice-test.ini"
    try {
        if FileExist(path)
            FileDelete(path)
        V48Assert(ITQReadSetting(path)="Quicksand","no saved choice starts with Quicksand")
        IniWrite("preserve",path,"Other","Sentinel")
        for name in ["Segoe UI","Trebuchet MS","Quicksand"] {
            ITQSaveSetting(path,name)
            V48Assert(ITQReadSetting(path)=name,"font preference saves and reloads: " name)
        }
        IniWrite("Font that is not installed 7440",path,"IrisAppearance","FontFamily")
        V48Assert(ITQReadSetting(path)="Quicksand","a missing font in transferred preferences falls back to Quicksand")
        V48Assert(IniRead(path,"Other","Sentinel")="preserve","saving font preference preserves unrelated keys")
    }
    finally {
        if FileExist(path)
            FileDelete(path)
    }
}

V7440FontSwitch() => V59Hidden(V7440FontSwitchCase)
V7440FontSwitchCase()
{
    global IP,IUB
    V58UseFixture(),a := IAState(),original := IUB.FontFamily,selected := IP.Selected,actor := IP.Actor
    text := IP.PlayersLV.GetText(1,1),rows := IP.PlayersLV.GetCount(),handles := Map(),expected := Map()
    for g in [IP.Gui,a.Gui] {
        for c in g {
            if c.Type!="Picture" && c.Type!="Progress" && !(c.Type="ListView" && ITBSpecialList(c)) && SendMessage(0x31,0,0,c.Hwnd)
                expected[c.Hwnd] := true
        }
    }
    V48Assert(expected.Count>0 && expected.Has(IP.StartButton.Hwnd),"capture every current font-bearing control before the first switch")
    try {
        for name in ["Segoe UI","Trebuchet MS","Quicksand","Segoe UI","Trebuchet MS","Quicksand"] {
            V48Assert(ITQChangeFont(name,false),"font can change without a restart: " name)
            count := 0
            for entry in [{Gui:IP.Gui,Role:"main"},{Gui:a.Gui,Role:"analysis"}] {
                for c in entry.Gui {
                    if c.Type="Picture" || c.Type="Progress" || (c.Type="ListView" && ITBSpecialList(c)) || !SendMessage(0x31,0,0,c.Hwnd)
                        continue
                    V48Assert(expected.Has(c.Hwnd) && V7430RaidFontFace(c)=name,"real " entry.Role " " c.Type " changes to " name " (actual " V7430RaidFontFace(c) "; text " SubStr(c.Text,1,80) ")")
                    count += 1
                }
            }
            V48Assert(count=expected.Count,"all captured current controls participate in each font switch")
            lf := Buffer(92,0),font := IUMFont(96)
            DllCall("Gdi32\GetObjectW","Ptr",font,"Int",92,"Ptr",lf)
            V48Assert(StrGet(lf.Ptr+28,32,"UTF-16")=name,"menu cache follows the selected family")
            if handles.Has(name)
                V48Assert(handles[name].Control=SendMessage(0x31,0,0,IP.StartButton.Hwnd) && handles[name].Menu=font,
                    "revisiting a font reuses existing native handles")
            else
                handles[name] := {Control:SendMessage(0x31,0,0,IP.StartButton.Hwnd),Menu:font}
            IP.Gui.Show("Hide w1920 h1080"),IPResize(IP.Gui,0,1920,1080),IPRefresh(true)
            V48Assert(V7430RaidFontFace(IP.PlayersLV)=name && V7430RaidFontFace(IPWState().Controls["ParserState"])=name,
                "responsive layout and parser refresh retain the selected face")
        }
        V48Assert(IP.Selected=selected && IP.Actor=actor && IP.PlayersLV.GetCount()=rows && IP.PlayersLV.GetText(1,1)=text,
            "font changes preserve the fight, player, rows and table data")
        IP.Busy := true
        V48Assert(!ITQChangeFont("Segoe UI",false) && IUB.FontFamily="Quicksand","busy import state rejects the change cleanly")
        IP.Busy := false
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"switching fonts never opens the hidden parser")
    }
    finally {
        IP.Busy := false
        ITQChangeFont(original,false)
    }
}

V7440FontAppearance() => V59Hidden(V7440FontAppearanceCase)
V7440FontAppearanceCase()
{
    global IUB,IP
    V58UseFixture(),oldGui := IUB.Gui,original := IUB.FontFamily
    oldChoice := IUB.Choice,oldFontChoice := IUB.FontChoice,oldFontNames := IUB.FontNames,oldSample := IUB.FontSample
    oldNotice := IUB.NoticeControl,oldRound := IUB.RoundChoice,oldRole := IUB.RoleChoice,oldDropdown := IUB.DropdownChoice
    IUB.Gui := "",g := ""
    try {
        g := IUBBuildAppearance(),IUB.Choice.Choose(1)
        V48Assert(IUB.FontChoice.Text="Quicksand (default)","Appearance marks the bundled default")
        V48Assert(ITQChangeFont("Segoe UI",false) && IUB.FontChoice.Text="Segoe UI","live selection stays synchronized")
        V48Assert(V7430RaidFontFace(IUB.FontSample)="Segoe UI","sample reflects the actual selected font")
        IP.Busy := true
        IUB.FontChoice.Choose(1)
        V48Assert(!ITQChangeFont("Quicksand",false) && IUB.FontChoice.Text="Segoe UI","busy rejection restores the dropdown to the active font")
        IP.Busy := false
        V48Assert(ITQChangeFont("Quicksand",false) && IUB.FontChoice.Value=1,"default restores Quicksand immediately")
        h := IUB.FontChoice.Hwnd
        info := Buffer(A_PtrSize=8 ? 64 : 52,0),NumPut("UInt",info.Size,info,0)
        DllCall("User32\GetComboBoxInfo","Ptr",h,"Ptr",info)
        V48Assert(V7430RaidFontFace({Hwnd:NumGet(info,A_PtrSize=8 ? 56 : 48,"Ptr")})="Quicksand",
            "the font selector's native popup also changes back to the default")
        V48Assert(!ITQFontDefault() && !ITQFontChanged() && !IUBOpenAppearance(),"manual diagnostics cannot invoke real UI launch or save callbacks")
        IUB.Notice := "Interface font: Quicksand. Changes apply immediately.",IUBRefreshNotice()
        g.Show("Hide w530 h632"),controls := []
        for c in g
            controls.Push(c)
        V7412PlayerControlsPng("appearance-font-selector.png",g,controls,0,0,530,632)
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"actual Appearance preview stays hidden")
    }
    finally {
        IP.Busy := false
        if IsObject(g)
            g.Destroy()
        IUB.Gui := oldGui,IUB.Choice := oldChoice,IUB.FontChoice := oldFontChoice,IUB.FontNames := oldFontNames,IUB.FontSample := oldSample
        IUB.NoticeControl := oldNotice,IUB.RoundChoice := oldRound,IUB.RoleChoice := oldRole,IUB.DropdownChoice := oldDropdown
        ITQChangeFont(original,false),IUBPruneWindows(),IUSPrune(),IUDPrune()
    }
}

; Hidden native navigation with synthetic session data, no imports/settings/audio.
V7441SessionTabState() => V7428DeathsFixture(V7441SessionTabStateCase)
V7441SessionTabStateCase()
{
    global IP,Audio,SETTINGS_FILE
    V58UseFixture(),IPRDemo(),u := IPWState(),c := u.Controls,p := IPRState(),data := p.Data
    oldLive := IP.Live,oldSelected := IP.Selected,oldActor := IP.Actor,queuedAudio := Audio.Queue.Length
    prefs := FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "<absent>"
    V48Assert(IPWTabs()[IPWTabPosition(12)]="Session Deaths" && IPWTabPosition(12)=IPWTabPosition(9)+1,
        "Session Deaths is its own main tab immediately after Deaths")
    V48Assert(!c.Has("RaidView") && !u.Groups.Has("RaidNav"),"the old mode selector is removed")
    c["SessionFilter"].Choose(2),IPRFilterChanged(),filter := p.Filter
    V48Assert(filter!="" && c["SessionPulls"].GetCount()>1,"native boss filter has real matching demo pulls")
    IPRSort(c["SessionPlayers"],3),column := p.SortCol,desc := p.SortDesc
    IPRSelectPlayer(c["SessionPlayers"],1,true),player := p.Selected
    c["SessionPulls"].Modify(1,"Select Focus")
    row := c["SessionPulls"].GetNext(),id := c["SessionPulls"].GetText(row,9),excluded := ""
    IPRTogglePull()
    for pull in data.Pulls {
        if pull.Id=id
            excluded := pull
    }
    V48Assert(IsObject(excluded) && !excluded.Included,"selected pull can still be excluded")
    for tab in [9,12,7,12,2,12,9,12] {
        V58SelectTab(tab)
        V48Assert(V58ChildVisible(c["SessionPlayers"])=(tab=12) && V58ChildVisible(c["DeathList"])=(tab=9),
            "only the selected death page owns its native tables")
        names := []
        for entry in IWScrollTables()
            names.Push(entry.Name)
        routes := IPRJoin(names)
        V48Assert(!!InStr(routes,"Main SessionPlayers")=(tab=12) && !!InStr(routes,"Main DeathList")=(tab=9),
            "mouse wheel table routing follows the independent tab")
    }
    V48Assert(p.Data=data && p.Filter=filter && p.Selected=player && p.SortCol=column && p.SortDesc=desc && !excluded.Included,
        "tab navigation retains source, boss filter, selected player, sort and excluded pull")
    V48Assert(IP.Live=oldLive && IP.Selected=oldSelected && IP.Actor=oldActor && Audio.Queue.Length=queuedAudio && !IP.Active,
        "moving session controls leaves parser data and audio untouched")
    V48Assert((FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "<absent>")=prefs,"tab diagnostics never save preferences")
}

V7441SessionTabCapture() => V7428DeathsFixture(V7441SessionTabCaptureCase)
V7441SessionTabCaptureCase()
{
    global IP
    V58UseFixture(),IPRDemo(),u := IPWState(),c := u.Controls
    for size in [[980,650],[1920,1080]] {
        IP.Gui.Show("Hide w" size[1] " h" size[2]),IPResize(IP.Gui,0,size[1],size[2]),IPWRepaintPage()
        l := IPWLayout(size[1],size[2])
        for name in ["SessionHeading","SessionLoaded","SessionScan","SessionFilter","SessionPlayers","SessionPulls","SessionActive"] {
            c[name].GetPos(&x,&y,&w,&h)
            V48Assert(V58ChildVisible(c[name]) && x>=l.InnerX && x+w<=size[1]-12 && y+h<size[2]-42,
                "Session Deaths controls fit at " size[1] " pixels: " name)
        }
        V48Assert(!V58ChildVisible(c["BossPortrait"]),"session summary never borrows an unrelated selected-fight portrait")
        controls := []
        for control in IP.Gui {
            if V58ChildVisible(control)
                controls.Push(control)
        }
        V7412PlayerControlsPng("session-deaths-" size[1] ".png",IP.Gui,controls,l.Right,48,l.RightW,size[2]-48)
    }
    list := IPWTIconsBuild(64),canvas := ISRICanvas(96,96)
    try {
        DllCall("Gdi32\PatBlt","Ptr",canvas.DC,"Int",0,"Int",0,"Int",96,"Int",96,"UInt",0x00FF0062)
        V48Assert(DllCall("Comctl32\ImageList_Draw","Ptr",list,"Int",11,"Ptr",canvas.DC,"Int",16,"Int",16,"UInt",1,"Int"),
            "Session Deaths has real locally rendered ghost artwork")
        ISRIWritePng(canvas.Bitmap,A_ScriptDir "\session-deaths-icon.png")
    }
    finally IPWTIconsRelease(list),ISRICanvasClose(canvas)
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"native captures never open normal Iris")
}

; Isolated native diagnostics. Never load user settings, write real indexes or start audio.
V75LibraryRun(fn) => V68ReviewRun(V75LibraryRunBody.Bind(fn))
V75LibraryRunBody(fn)
{
    s := ILBState(),saved := s.Clone(),aliases := IALTState(),oldAliases := aliases.Clone()
    dir := A_Temp "\iris-library-" A_TickCount "-" DllCall("GetCurrentProcessId"),DirCreate(dir)
    try {
        s.Gui := "",s.Controls := Map(),s.Chart := 0,s.Files := Map(),s.Rows := [],s.Shown := [],s.Trends := []
        s.Loaded := false,s.Error := "",s.Original := "",s.TestPath := dir "\library.json",s.Demo := false,s.Busy := false
        s.Pending := "",s.Filling := false,s.Date := "",s.Characters := [],s.Bosses := [],s.Specs := [],s.Challenges := []
        aliases.Loaded := true,aliases.Error := "",aliases.Groups := []
        fn.Call()
    }
    finally {
        s.Busy := false,ILBClose()
        for key,value in saved.OwnProps()
            s.%key% := value
        for key,value in oldAliases.OwnProps()
            aliases.%key% := value
        DirDelete(dir,true)
    }
}

V75LibraryPull(id := 1,start := 100000,result := "Kill")
{
    return {Id:id,Boss:"G-TY",Name:"Tyth",Area:"833571547775765",Mode:"836045448953655",Start:start,End:start+60000,
        Result:result,Partial:0,Recorder:"@Sophie#1",Metrics:true,
        Players:Map("@Sophie#1",{Name:"Sophie",Spec:"123",Damage:120000,Heal:12000,Effective:9000,HealKnown:3,HealRecords:3,Deaths:0}),
        Challenges:[{Key:"burn-1",Name:"Burn",Duration:10,Partial:0,
            Players:Map("@Sophie#1",{Damage:30000,Heal:5000,Effective:2000,HealKnown:2,HealRecords:2})}]}
}

V75LibraryFiles()
{
    path := A_Temp "\combat_2026-10-03_00_00_00_001.txt",pulls := []
    Loop 5 {
        p := V75LibraryPull(A_Index,100000+(A_Index-1)*120000,A_Index=2 ? "No kill" : "Kill")
        p.Players["@Sophie#1"].Damage := A_Index*120000,pulls.Push(p)
    }
    f := ILBFile(path,"20261003",100,"20261003120000",Format("{:064}",0),pulls)
    return Map(StrLower(path),f)
}

V75LibraryStorage() => V75LibraryRun(V75LibraryStorageCase)
V75LibraryStorageCase()
{
    s := ILBState(),ILBLoad(),files := V75LibraryFiles(),text := IGVJson(ILBPack(files))
    V48Assert(IGVJson(ILBPack(ILBParse(text)))=text,"library totals, Unicode-safe strings and challenge boundaries roundtrip exactly")
    ILBCommit(files),saved := FileRead(s.TestPath,"UTF-8")
    V48Assert(IGVJson(ILBPack(INLibraryRead(saved,s.TestPath)))=text,"atomic save preserves exact catalogue values")
    files := files.Clone(),files.Clear(),ILBCommit(files)
    V48Assert(FileRead(s.TestPath ".bak","UTF-8")=saved,"previous index kept as backup")
    FileAppend(" ",s.TestPath,"UTF-8"),before := FileRead(s.TestPath,"UTF-8")
    V59ExpectError((*)=>ILBCommit(V75LibraryFiles()))
    V48Assert(FileRead(s.TestPath,"UTF-8")=before,"external edits are never silently replaced")
    s.Loaded := false,ILBLoad(),temp := s.TestPath ".pending-" DllCall("GetCurrentProcessId")
    FileAppend("unfinished",temp,"UTF-8"),V59ExpectError((*)=>ILBCommit(V75LibraryFiles()))
    V48Assert(FileRead(temp,"UTF-8")="unfinished","pre-existing pending file is not deleted by another save attempt")
    FileDelete(temp),old := s.TestPath,s.TestPath := A_ScriptDir "\unsafe-library.json"
    V59ExpectError(ILBPath),s.TestPath := old
    bad := ILBPack(V75LibraryFiles()),bad[3][1][7][1][7] := 1
    V59ExpectError((*)=>ILBParse(IGVJson(bad)))
    bad := ILBPack(V75LibraryFiles()),bad[3][1][7][1][11][1][7] := 999
    V59ExpectError((*)=>ILBParse(IGVJson(bad)))
    FileDelete(s.TestPath),FileAppend("broken",s.TestPath,"UTF-8"),s.Loaded := false,s.Error := "",ILBLoad()
    V48Assert(s.Error!="","invalid index is reported rather than treated as an empty library")
    V59ExpectError((*)=>ILBCommit(V75LibraryFiles()))
    V48Assert(FileRead(s.TestPath,"UTF-8")="broken","corrupt source is retained for recovery")
}

V75LibraryDedupAndCalendar() => V75LibraryRun(V75LibraryDedupAndCalendarCase)
V75LibraryDedupAndCalendarCase()
{
    files := V75LibraryFiles(),f := ""
    for path,source in files
        f := source
    duplicate := IPRCloneSnapshot(f),duplicate.Path .= ".copy",duplicate.Pulls[1].Start += 900,duplicate.Pulls[1].End += 900
    files[StrLower(duplicate.Path)] := duplicate,rows := ILBRows(files)
    V48Assert(rows.Length=5 && rows[1].Alternates=1,"multiple recorder copies of the same pull count once")
    duplicate.Pulls[1].Players := Map("@Other#2",{Name:"Other",Spec:"123",Damage:1,Heal:0,Effective:0,HealKnown:0,HealRecords:0,Deaths:0})
    V48Assert(ILBRows(files).Length=6,"same clock and boss without shared identity never merge")
    V48Assert(ILBFilter(rows,"G-TY","836045448953655","@Sophie#1","Kill",0,"20261003","sophie").Length=4,"library filters combine exact character, boss, mode, result, date and text")
    V48Assert(ILBFilter(rows,"","","","",2).Length=0,"minimum duration filter uses minutes")
    f.Pulls := [V75LibraryPull(1,86390000),V75LibraryPull(2,86410000)],files := Map(StrLower(f.Path),f)
    days := ILBActivities(ILBRows(files))
    V48Assert(days["20261003"].Seconds=10 && days["20261004"].Seconds=70,"calendar splits midnight and unions overlapping time instead of double counting")
    V48Assert(days["20261003"].Pulls=1 && days["20261004"].Pulls=1,"pull counts belong to the day the pull began")
}

V75LibraryPerformance() => V75LibraryRun(V75LibraryPerformanceCase)
V75LibraryPerformanceCase()
{
    rows := ILBRows(V75LibraryFiles()),args := [rows,"@Sophie#1","G-TY","836045448953655","123","Kill"]
    points := ILBPerformance(args*)
    V48Assert(points.Length=4 && points[1].Value=2000 && points[4].Value=10000,"personal DPS is accepted damage over each matching complete kill duration")
    V48Assert(ILBPerformance(rows,"@Sophie#1","G-TY","836045448953655","123","No kill").Length=1,"non-kills are a separate comparison")
    V48Assert(ILBPerformance(rows,"@Sophie#1","G-TY","836045448953652","123","Kill").Length=0,"difficulty never mixes")
    V48Assert(ILBPerformance(rows,"@Sophie#1","G-TY","836045448953655","mixed","Kill").Length=0,"mixed and unknown disciplines are not comparable")
    V48Assert(ILBPerformance(rows,"@Sophie#1","G-TY","836045448953655","123","Kill","EHPS")[1].Value=150,"direct effective healing uses accepted known healing")
    V48Assert(ILBPerformance(rows,"@Sophie#1","G-TY","836045448953655","123","Kill","DPS","burn-1")[1].Value=3000,"challenge totals use the challenge duration rather than full fight")
    rows[1].Pull.Players["@Sophie#1"].HealKnown := 2
    V48Assert(ILBPerformance(rows,"@Sophie#1","G-TY","836045448953655","123","Kill","EHPS").Length=3,"unknown EHPS is omitted rather than reported as zero")
    rows[1].Pull.Challenges[1].Partial := 1
    V48Assert(ILBPerformance(rows,"@Sophie#1","G-TY","836045448953655","123","Kill","DPS","burn-1").Length=3,"partial challenge window cannot set a personal best")
    rows[1].Pull.Partial := 1,V48Assert(ILBPerformance(args*).Length=3,"incomplete pulls excluded even if a result was labeled kill")
    IALTState().Groups := [{Id:"sophie",Name:"Sophie",Members:[{Key:"@Sophie#1",Name:"Sophie"},{Key:"@Alt#2",Name:"Alt"}]}]
    rows[3].Pull.Players["@Alt#2"] := rows[3].Pull.Players["@Sophie#1"].Clone()
    V48Assert(ILBPerformance(rows,IALTToken("sophie"),"G-TY","836045448953655","123","Kill").Length=2,"ambiguous linked characters in one pull are never summed")
}

V75LibraryScan() => V75LibraryRun(V75LibraryScanCase)
V75LibraryScanCase()
{
    global IP,Audio
    f := V68ReviewFile(),job := "",live := IP.Live,queue := Audio.Queue
    try {
        job := IGRBegin("library regression"),indexed := ILBScan(f.Path,"20261003",job),IGREnd(job)
        expected := ILBFight(f.State.Segments[f.State.Segments.Length])
        V48Assert(indexed.Pulls.Length=1,"private streaming index keeps only a recognized encounter")
        V48Assert(IGVJson(ILBPack(Map("x",indexed))[3][1][7][1])=IGVJson(ILBPack(Map("x",ILBFile(f.Path,"20261003",indexed.Size,indexed.Modified,indexed.Digest,[expected])))[3][1][7][1]),"index totals and endpoint match full retained parser results")
        f.State.SourceLength := indexed.Size,f.State.SourceModified := indexed.Modified,f.State.ProgressionComplete := true
        loaded := ILBFromLoaded(f.State,f.Path,"20261003")
        V48Assert(loaded.Digest=indexed.Digest && loaded.Pulls[1].Players.Count=expected.Players.Count,"normal completed import can reuse accepted totals without another parse")
        f.State.ProgressionComplete := false,V59ExpectError((*)=>ILBFromLoaded(f.State,f.Path,"20261003"))
        control := {Cancel:false},job := IGRBegin("cancel index",V68ReviewCancelService.Bind(control),control)
        V59ExpectError((*)=>ILBScan(f.Path,"20261003",job)),IGREnd(job)
        FileMove(f.Path,f.Path ".moved"),FileMove(f.Path ".moved",f.Path)
        V48Assert(IP.Live=live && Audio.Queue=queue && !IsObject(IP.ImportFile),"private indexing/cancel releases file and leaves live parser/audio untouched")
    }
    finally {
        if IsObject(job)
            IGREnd(job)
        FileDelete(f.Path)
    }
}

V75LibraryImportSelection() => V75LibraryRun(V75LibraryImportSelectionCase)
V75LibraryImportSelectionCase()
{
    f := V68ReviewFile()
    try {
        s := ILBState(),data := f.State,p := ILBFight(data.Segments[data.Segments.Length])
        app := {ImportPath:f.Path,ImportTiming:{Token:1},Offline:data,Selected:0,Follow:true}
        s.Pending := {Path:f.Path,Pull:p,Timing:{Token:1}},ILBSelectPending(app)
        V48Assert(app.Selected=0 && app.Follow,"an unrelated import cannot consume a stale library selection")
        s.Pending.Timing := app.ImportTiming
        ; A persistent-cache hit replaces the data object, but keeps the import's timing token.
        app.Offline := IPRCloneSnapshot(data),ILBSelectPending(app)
        V48Assert(app.Selected=app.Offline.Segments.Length && !app.Follow && !IsObject(s.Pending),"exact library fight is selected after cache restoration too")
        app.Selected := 0,s.Pending := {Path:f.Path,Pull:p.Clone(),Timing:app.ImportTiming},s.Pending.Pull.Mode := "wrong"
        ILBSelectPending(app),V48Assert(app.Selected=0 && !IsObject(s.Pending),"changed difficulty never opens a near match")
    }
    finally FileDelete(f.Path)
}

V75LibraryWindow() => V75LibraryRun(V75LibraryWindowCase)
V75LibraryWindowCase()
{
    global Audio,IP,SETTINGS_FILE
    s := ILBState(),s.Files := V75LibraryFiles(),s.Loaded := true,before := Audio.Queue.Length,live := IP.Live
    ILBBuildWindow(),ILBRefresh(),c := s.Controls
    V48Assert(c["List"].GetCount()=5 && c["Tabs"].Text="Raids","hidden native library renders persisted compact records")
    c["Search"].Value := "does not exist",ILBFilterChanged()
    V48Assert(!c["List"].GetCount() && !c["Open"].Enabled,"empty filters cannot open a stale previously selected row")
    c["Search"].Value := "",ILBFilterChanged(),c["Month"].Value := "20261001000000",ILBCalendar()
    V48Assert(InStr(c["MonthSummary"].Text,"5 pulls") && InStr(c["MonthSummary"].Text,"4 confirmed kills"),"calendar displays all-character recorded activity")
    for i,date in s.DayDates
        if date="20261003"
            ILBCalendarDay(i)
    V48Assert(s.Date="20261003" && c["List"].GetCount()=5,"calendar day opens matching library pulls")
    for name in ["TrendCharacter","TrendBoss","TrendSpec"]
        c[name].Choose(2)
    c["TrendMode"].Choose(6),ILBTrendChanged(c["TrendBoss"])
    V48Assert(c["TrendList"].GetCount()=4 && s.Chart,"native performance page plots actual matching points")
    V48Assert(c["TrendList"].GetText(1,4)="2,000" && c["TrendList"].GetText(1,5)="120,000","table rates render as numbers, not unsupported format strings")
    for size in [[980,700],[1920,1080]] {
        s.Gui.Show("Hide w" size[1] " h" size[2]),ILBResize(s.Gui,0,size[1],size[2])
        Loop 3 {
            c["Tabs"].Choose(A_Index),page := A_Index,controls := []
            for control in s.Gui {
                if V58ChildVisible(control) {
                    controls.Push(control),control.GetPos(&x,&y,&w,&h)
                    V48Assert(x>=0 && y>=0 && x+w<=size[1] && y+h<=size[2],"library bounds: " control.Type " " SubStr(control.Text,1,35) " " x "," y "," w "," h)
                }
            }
            V7412PlayerControlsPng("library-" size[1] "-" page ".png",s.Gui,controls,0,0,size[1],size[2])
        }
    }
    ILBProgress({Percent:50,Stage:"Test progress",Records:1234})
    s.Busy := true,s.Cancel := {Cancel:false},ILBBusy(),ILBClose()
    V48Assert(s.Cancel.Cancel && IPMGuiAlive(s.Gui),"closing active indexing requests cancellation without destroying live callbacks")
    s.Busy := false,ILBClose(),V48Assert(!IPMGuiAlive(s.Gui) && !s.Chart,"closing frees native chart handles")
    V48Assert(Audio.Queue.Length=before && IP.Live=live,"all library UI diagnostics leave audio and live encounter untouched")
}

V75MechanicCatalog() => V69MechanicRun(V75MechanicCatalogCase)
V75MechanicCatalogCase()
{
    rules := Map()
    for r in IGMBuiltins()
        rules[r.Key] := r
    V48Assert(IGMXCatalog().Count=28 && rules.Count=36,"28 additional observed checks retain all eight prior checks")
    for key,def in IGMXCatalog() {
        d := V69MechanicData(),d.BossKey := def.Boss,d.AreaId := def.Area,d.ModeId := def.Mode
        for pair in def.Pairs {
            ev := V69MechanicAdd(d,IPDemoLine(1000,"Boss {" pair[1] "}:1","@Player#1",def.Event="cast" ? "Activate" : "Damage",10,false,-1,"Example",pair[2]))
            V48Assert(IGMMatches(rules[key],ev,d),"exact observed NPC, ability, kind and scope match: " key)
            ev.Analysis.Accepted := false,V48Assert(!IGMMatches(rules[key],ev,d),"excluded accounting events never count"),ev.Analysis.Accepted := true
            old := d.ModeId,d.ModeId := "836045448953651",V48Assert(!IGMMatches(rules[key],ev,d),"no Story/Veteran bleed into a scoped check"),d.ModeId := old
            d.AreaId := "different",V48Assert(!IGMMatches(rules[key],ev,d),"exact operation scope required"),d.AreaId := def.Area
            ev.Source := IPActor("Other {999999}:1"),V48Assert(!IGMMatches(rules[key],ev,d),"ability name and ID alone cannot match a different source")
        }
    }
}

; Explicit archival regression only. Requires archive-sources.json beside the
; isolated runner; never included in the default user diagnostic run.
V75ArchiveCheck() => V75LibraryRun(V75ArchiveCheckCase)
V75ArchiveCheckCase()
{
    sources := IGJParse(FileRead(A_ScriptDir "\archive-sources.json","UTF-8")),results := [],seen := Map()
    for source in sources {
        path := source[1],digest := source[2],date := IGVSourceIdentity(path).Date
        V48Assert(IPCHashFile(path)=digest,"original archived source hash agrees with evidence manifest")
        FileAppend("Indexing " path "`n",A_ScriptDir "\archive-progress.txt","UTF-8")
        job := IGRBegin("archive library validation")
        try indexed := ILBScan(path,date,job)
        finally IGREnd(job)
        ; Independent retention path with accepted-event journaling enabled.
        s := IPNewData("ISOLATED ARCHIVE JOURNAL"),s.AnalysisCapture := IACaptureNew(0,172800000)
        s.SourcePath := path,s.SourceEncoding := "UTF-8",snap := IASnapshotFile(path,"UTF-8"),pulls := [],counts := Map(),bosses := Map()
        FileAppend("Checking accepted events " path "`n",A_ScriptDir "\archive-progress.txt","UTF-8")
        try {
            while snap.File.Pos<snap.End {
                line := RTrim(snap.File.ReadLine(),"`r`n"),IPFeedLine(s,line),s.AnalysisCapture.Rows := []
                while s.Segments.Length>1 {
                    seg := s.Segments[1]
                    if seg.End<0 || (IsObject(s.Current) && s.Current=seg)
                        break
                    V75ArchiveConsume(seg,pulls,counts,bosses,seen)
                    s.Rows := Max(0,s.Rows-seg.Rows.Count),s.Segments.RemoveAt(1)
                }
            }
            IPFinalizeData(s,"end of library snapshot")
            for seg in s.Segments
                V75ArchiveConsume(seg,pulls,counts,bosses,seen)
        }
        finally snap.File.Close()
        comparison := indexed.Clone(),comparison.Pulls := pulls
        V48Assert(IGVJson(ILBPack(Map("x",comparison)))=IGVJson(ILBPack(Map("x",indexed))),"every fight boundary, participant, discipline, metric and challenge agrees with accepted-event replay")
        saved := ILBParse(IGVJson(ILBPack(Map("x",indexed))))
        V48Assert(saved.Count=1 && ILBRows(saved).Length>0,"real multi-boss archive persists and yields calendar-ready pulls")
        summary := [],observed := []
        for boss,n in bosses
            summary.Push([boss,n])
        for key,n in counts
            observed.Push([key,n])
        results.Push([path,indexed.Digest,indexed.Pulls.Length,summary,observed])
        FileAppend(IGVJson([results[results.Length]]) "`n",A_ScriptDir "\archive-results.jsonl","UTF-8")
        FileAppend("Verified " indexed.Pulls.Length " pulls`n",A_ScriptDir "\archive-progress.txt","UTF-8")
    }
    for key,def in IGMXCatalog()
        V48Assert(seen.Get(key,0)>0,"new mechanic has accepted evidence in the scoped real encounter: " key)
}

V75ArchiveConsume(seg,pulls,counts,bosses,seen)
{
    if seg.BossKey=""
        return
    pulls.Push(ILBFight(seg)),bosses[seg.BossKey] := bosses.Get(seg.BossKey,0)+1
    if !seg.HasOwnProp("AnalysisAccepted")
        return
    rules := []
    for rule in IGMBuiltins()
        if IGMXCatalog().Has(rule.Key) && IGMRuleApplies(rule,seg)
            rules.Push(rule)
    for seq,ev in seg.AnalysisAccepted {
        ; This is the parser's rollback-aware accepted journal. IAAssemble
        ; normally sets this flag from that same membership before review.
        ev.Analysis.Accepted := true
        for rule in rules {
            if IGMMatches(rule,ev,seg)
                counts[rule.Key] := counts.Get(rule.Key,0)+1,seen[rule.Key] := seen.Get(rule.Key,0)+1
        }
    }
}

; Native hidden windows and private temporary files only.
V751LibraryHost() => V75LibraryRun(V751LibraryHostCase)
V751LibraryHostCase()
{
    global IP,Audio
    s := ILBState(),s.Files := V75LibraryFiles(),s.Loaded := true,s.Dirty := true
    s.AutoLoaded := true,s.AutoLive := false,s.LivePending := Map(),s.AutoError := ""
    live := IP.Live,queue := Audio.Queue,IPWLibraryOpen(),c := s.Controls,h := s.Gui.Hwnd
    V48Assert(IPWState().Tab=13 && DllCall("User32\GetParent","Ptr",h,"Ptr")=IP.Gui.Hwnd,"Log Library opens as an actual main-window child")
    style := DllCall("User32\GetWindowLongW","Ptr",h,"Int",-16,"UInt")
    V48Assert((style&0x40000000) && !(style&0x80000000) && !(style&0x00C00000),"library has no popup or caption")
    V48Assert(!c.Has("Title") && !c.Has("Intro") && IP.Subtitle.Text="","no redundant marketing heading or subtitle")
    V48Assert(c.Has("AutoLive") && !c["AutoLive"].Value,"automatic live saving is visible and opt-in")
    for size in [[980,650],[1920,1080]] {
        box := V749ProgressionSetSize(size[1],size[2])
        V48Assert(s.Width=box.W && s.Height=box.H,"library follows the available main page")
        c["Month"].Value := "20261001000000",ILBCalendar()
        for day in c["Days"] {
            if !InStr(day.Text,"pulls")
                continue
            dc := DllCall("User32\GetDC","Ptr",day.Hwnd,"Ptr"),savedDC := DllCall("Gdi32\SaveDC","Ptr",dc,"Int")
            try {
                DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",SendMessage(0x31,0,0,day))
                area := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",day.Hwnd,"Ptr",area)
                pad := Max(3,Round(4*A_ScreenDPI/96)),rect := IUSRect(pad,0,NumGet(area,8,"Int")-pad,0)
                DllCall("User32\DrawTextW","Ptr",dc,"Str",day.Text,"Int",-1,"Ptr",rect,"UInt",0xC11,"Int")
                V48Assert(NumGet(rect,12,"Int")<=NumGet(area,12,"Int")-Max(2,Round(2*A_ScreenDPI/96))*2,"calendar text fits its native card height: text=" NumGet(rect,12,"Int") " card=" NumGet(area,8,"Int") "x" NumGet(area,12,"Int"))
            }
            finally {
                DllCall("Gdi32\RestoreDC","Ptr",dc,"Int",savedDC)
                DllCall("User32\ReleaseDC","Ptr",day.Hwnd,"Ptr",dc)
            }
        }
        Loop 3 {
            c["Tabs"].Choose(A_Index),ILBPageChanged(),controls := []
            for control in s.Gui {
                if V58ChildVisible(control) {
                    controls.Push(control),control.GetPos(&x,&y,&w,&height)
                    V48Assert(x>=0 && y>=0 && x+w<=box.W && y+height<=box.H,"embedded control fits: " control.Type " " SubStr(control.Text,1,20) " at " x "," y " " w "x" height " in " box.W "x" box.H)
                }
            }
            V7412PlayerControlsPng("library-tab-" size[1] "-" A_Index ".png",s.Gui,controls,0,0,box.W,box.H)
        }
    }
    c["Tabs"].Choose(2),c["Search"].Value := "saved filter"
    for tab in [7,9,12,1,13]
        V58SelectTab(tab)
    V48Assert(s.Gui.Hwnd=h && c["Tabs"].Value=2 && c["Search"].Value="saved filter","page switches retain calendar and search state")
    s.Busy := true,s.Cancel := {Cancel:false},IPWLibraryDismiss()
    V48Assert(IPWState().Tab=7 && IPMGuiAlive(s.Gui) && !s.Cancel.Cancel,"leaving tab does not cancel or destroy indexing")
    s.Busy := false
    V48Assert(IP.Live=live && Audio.Queue=queue && !IP.Active,"navigation does not change live data or audio")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int") && !s.Visible,"diagnostics never show the normal app")
}

V751CalendarLabels() => V75LibraryRun(V751CalendarLabelsCase)
V751CalendarLabelsCase()
{
    s := ILBState(),files := V75LibraryFiles()
    for key,f in files {
        f.Pulls := []
        Loop 13
            f.Pulls.Push(V75LibraryPull(A_Index,86400000+A_Index*120000,A_Index<=3 ? "Kill" : "No kill"))
        Loop 19
            f.Pulls.Push(V75LibraryPull(13+A_Index,-86400000+23*3600000+A_Index*1000,"No kill"))
        ; Use positive timestamp offsets from Oct 1 so both days stay valid.
        f.Date := "20261001"
        for i,p in f.Pulls {
            p.Start := (i<=13 ? 3*86400000 : 86400000)+i*120000,p.End := p.Start+60000
        }
    }
    s.Files := files,s.Loaded := true,ILBBuildWindow(),ILBRefresh(),c := s.Controls
    c["Month"].Value := "20261001000000",ILBCalendar()
    for i,date in s.DayDates {
        if date="20261004" {
            V48Assert(InStr(c["Days"][i].Text,"4 Oct`n")=1 && InStr(c["Days"][i].Text,"13 pulls") && InStr(c["Days"][i].Text,"3 kills"),"day 4 is separate from 13 pulls and 3 kills")
            c["Tabs"].Choose(2),SendMessage(0xF5,0,0,c["Days"][i])
            Sleep(-1) ; dispatch the native button's queued AHK Click callback
            V48Assert(c["Tabs"].Value=1 && c["List"].GetCount()=13,"native day button opens thirteen pulls rather than a kill-ratio filter")
        }
        if date="20261002"
            V48Assert(InStr(c["Days"][i].Text,"19 pulls") && InStr(c["Days"][i].Text,"0 kills"),"day 2 with nineteen failed pulls shows zero kills explicitly")
    }
}

V751LiveLibrary() => V75LibraryRun(V751LiveLibraryCase)
V751LiveLibraryCase()
{
    global IP,Audio,SETTINGS_FILE
    s := ILBState(),s.AutoLoaded := false,s.LivePending := Map(),s.AutoError := "",s.Flushing := false
    ILBLivePrefs(),V48Assert(!s.AutoLive,"new live-saving preference defaults off")
    ILBLoad(),ILBBuildWindow(),ILBRefresh(),s.Controls["AutoLive"].Value := 1,ILBLiveToggle()
    s.AutoLoaded := false,s.AutoLive := false,ILBLivePrefs()
    V48Assert(s.AutoLive && IniRead(SETTINGS_FILE,"IrisLibrary","AutoLive",0)=1,"checkbox persists and reloads through isolated settings")
    f := V68ReviewFile(),path := A_Temp "\combat_2026-10-03_01_00_00_001.txt"
    try {
        FileMove(f.Path,path),seg := f.State.Segments[f.State.Segments.Length]
        seg.LibrarySourceKey := path "|" ILBLiveIdentity(path),key := StrLower(path)
        current := IPRCloneSnapshot(seg),current.End := -1
        V48Assert(!ILBLiveQueue(current) && !s.LivePending.Count,"active unfinished pulls are never queued")
        V48Assert(ILBLiveQueue(seg) && s.LivePending.Count=1,"completed accepted pull queues a compact snapshot")
        ILBLiveQueue(seg),batch := s.LivePending[key]
        V48Assert(batch.Pulls.Count=1,"repeat collection of the same pull does not duplicate it")
        live := IP.Live,beforeAudio := Audio.Queue
        ILBCommit(ILBLiveMerge(s.Files,batch)),source := s.Files[key]
        V48Assert(source.Live && source.Pulls.Length=1,"live snapshot is persisted in the catalogue")
        expected := ILBFight(seg),actual := source.Pulls[1]
        V48Assert(actual.End=expected.End && actual.Result=expected.Result && actual.Players.Count=expected.Players.Count,"live catalogue retains exact accepted endpoint, result and roster")
        for who,t in expected.Players {
            a := actual.Players[who]
            V48Assert(a.Damage=t.Damage && a.Heal=t.Heal && a.Effective=t.Effective && a.Deaths=t.Deaths,"live catalogue preserves accepted totals: " who)
        }
        FileAppend("extra record`n",path,"UTF-8"),ILBCommit(ILBLiveMerge(s.Files,batch))
        V48Assert(s.Files[key].Pulls.Length=1 && ILBSourceStatus(ILBEntry(s.Files[key],actual))="Live log","file growth is expected and does not duplicate completed fights")
        later := IPRCloneSnapshot(batch),later.Pulls := Map(),p := IPRCloneSnapshot(expected),p.Start+=120000,p.End+=120000,p.Id:=1
        later.Pulls["later"] := p,ILBCommit(ILBLiveMerge(s.Files,later))
        V48Assert(s.Files[key].Pulls.Length=2 && s.Files[key].Pulls[1].Id!=s.Files[key].Pulls[2].Id,"parser restart IDs cannot collide in saved live history")
        s.Loaded := false,ILBLoad(),V48Assert(s.Files[key].Live && s.Files[key].Pulls.Length=2,"live source metadata and both pulls survive restart")
        before := s.Original,FileMove(path,path ".old"),FileAppend("replacement",path,"UTF-8")
        V59ExpectError((*)=>ILBLiveMerge(s.Files,batch))
        V48Assert(FileRead(s.TestPath,"UTF-8")=before,"a replaced source cannot overwrite saved history")
        IP.Active := true,IP.Live := IPNewData(),IP.Live.Current := {FinishAt:-1}
        V48Assert(!ILBLiveReady(),"disk saves wait during active combat")
        IP.Live.Current := "",IP.Busy := true,V48Assert(!ILBLiveReady(),"disk saves wait for the live pump")
        IP.Busy := false,IP.Active := false,IP.Live := live
        s.Controls["AutoLive"].Value := 0,ILBLiveToggle()
        V48Assert(!s.AutoLive && !s.LivePending.Count && IniRead(SETTINGS_FILE,"IrisLibrary","AutoLive",1)=0,"turning option off cancels pending automatic saves")
        V48Assert(Audio.Queue=beforeAudio,"live library never queues audio")
        old := ILBPack(V75LibraryFiles()),old[3][1].RemoveAt(8,2)
        V48Assert(ILBParse(IGVJson(old)).Count=1,"original v75 seven-field sources remain readable")
    }
    finally {
        if FileExist(f.Path)
            FileDelete(f.Path)
        if FileExist(path)
            FileDelete(path)
        if FileExist(path ".old")
            FileDelete(path ".old")
        SetTimer(ILBLiveFlush,0)
    }
}

V751EmptyNightMechanics() => V69MechanicRun(V751EmptyNightMechanicsCase)
V751EmptyNightMechanicsCase()
{
    v := IGVState(),old := v.Rows
    try {
        v.Rows := [],IGMOpenFromProgression(),s := IGMState()
        V48Assert(IPMGuiAlive(s.Gui) && !s.Controls["Run"].Enabled,"empty graph opens useful mechanics window with Review disabled")
        V48Assert(InStr(s.Controls["Status"].Text,"Progression > Add logs"),"empty graph explains how to add the missing pulls")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",s.Gui.Hwnd,"Int"),"mechanics diagnostic remains hidden")
        v.Rows := [V69MechanicFixture().Entry],IGMOpenFromProgression()
        V48Assert(s.Entries.Length=1 && s.Controls["Run"].Enabled,"opening again after adding pulls enables Review")
    }
    finally v.Rows := old
}

V751SharedImport() => V75LibraryRun(V751SharedImportCase)
V751SharedImportCase()
{
    s := ILBState(),f := V68ReviewFile(),history := s.TestPath ".progression.json",job := ""
    try {
        ILBLoad(),job := IGRBegin("shared fixture"),file := ILBScan(f.Path,"20261003",job),IGREnd(job),job := ""
        V48Assert(file.Pulls.Length=1 && file.ProgressionPulls.Length=1,"one library scan produces both accepted summaries")
        ILBCommit(Map(StrLower(file.Path),file)),result := IUPSaveProgression(file,history)
        V48Assert(result.Added=1 && result.History.Count=1 && s.Files.Count=1,"same recording is persisted in library and progression")
        V48Assert(!s.Files[StrLower(file.Path)].HasOwnProp("ProgressionPulls"),"transient detailed progression copies do not accumulate in the library")
        V48Assert(IUPHasProgression(file,history),"already-shared source can be skipped without reparsing")
        for key,e in result.History {
            V48Assert(e.Team="","new automatically saved progression pull is Untagged")
            expected := IGVJson(IGVPackPull(file.ProgressionPulls[1]))
            V48Assert(IGVJson(IGVPackPull(e.Pull))=expected,"health, phases, deaths and exact boundary survive shared saving")
            e.Team := "Sophie's raid"
        }
        IGVWriteHistory(result.History,history),again := IUPSaveProgression(file,history)
        V48Assert(again.Unchanged=1 && !again.Added && !again.Updated,"reimport is idempotent even after assigning a team")
        for key,e in again.History
            V48Assert(e.Team="Sophie's raid","automatic reimport never removes an existing team")
        f.State.SourceLength := file.Size,f.State.SourceModified := file.Modified,f.State.ProgressionComplete := true
        loaded := ILBFromLoaded(f.State,f.Path,"20261003")
        V48Assert(IGVJson(IGVPackPull(loaded.ProgressionPulls[1]))=expected,"normal completed import supplies the identical progression snapshot")
        prior := FileRead(history,"UTF-8"),changed := IPRCloneSnapshot(file),changed.ProgressionPulls[1].Reason := "different reason"
        V59ExpectError((*)=>IUPSaveProgression(changed,history,V751AbortHistory))
        V48Assert(FileRead(history,"UTF-8")=prior,"cancellation before history commit preserves the complete prior save")
        FileAppend("not json",history ".bad","UTF-8")
        V59ExpectError((*)=>IUPSaveProgression(file,history ".bad"))
        V48Assert(FileRead(history ".bad","UTF-8")="not json","unreadable history is not replaced by an empty catalogue")
        note := IUPSaveImported(file,history ".bad")
        V48Assert(InStr(note,"Progression was not saved") && !InStr(note,"Library was not saved") && s.Files.Count=1,"failure of one catalogue does not prevent saving the other")
        priorLibrary := s.Original,s.Error := "isolated read error"
        note := IUPSaveImported(file,history ".second")
        V48Assert(InStr(note,"Library was not saved") && !InStr(note,"Progression was not saved") && IGVReadHistory(history ".second").Count=1,"progression still saves when library is unavailable")
        V48Assert(FileRead(s.TestPath,"UTF-8")=priorLibrary,"unavailable library remains untouched"),s.Error := ""
        V59ExpectError((*)=>IUPSaveProgression(file))
        V48Assert(!IUPHasProgression(file),"diagnostics cannot read real progression history")
    }
    finally {
        if IsObject(job)
            IGREnd(job)
        FileDelete(f.Path)
    }
}
V751AbortHistory(stage)
{
    if stage="before-commit"
        throw Error("Intentional isolated cancellation")
}

V751SharedBatch() => V635WithBatch(V751SharedBatchCase)
V751SharedBatchCase(root,items)
{
    s := ILBState(),saved := s.Clone()
    try {
        s.Loaded := false,s.Error := "",s.Original := "",s.TestPath := root "\shared-library.json",s.Files := Map()
        s.Busy := false,s.Flushing := false,s.Demo := false,ILBLoad()
        job := IGLBegin(items,"Test raid",root "\shared-progression.json")
        V48Assert(IGLPump() && job.Committed,"native multi-recording progression batch succeeds")
        V48Assert(job.LibraryFiles.Count=items.Length,"each scanned file carries its compact library snapshot")
        total := 0
        for key,file in job.LibraryFiles {
            total += file.Pulls.Length
            V48Assert(file.Pulls.Length>0 && file.Digest=IPCHashFile(file.Path),"shared batch source identity matches its captured file")
        }
        IUPSaveLibraryBatch(job.LibraryFiles)
        V48Assert(s.Files.Count=items.Length && ILBRows(s.Files).Length<=total,"all library summaries commit together after successful progression batch")
        bytes := s.Original
        job := IGLBegin(items,"Test raid",root "\canceled-progression.json")
        V48Assert(!IGLPump(V751CancelBatch) && !job.Committed,"canceled progression batch cannot publish success")
        V48Assert(FileRead(s.TestPath,"UTF-8")=bytes,"canceled batch leaves previous library unchanged")
    }
    finally {
        IGLShutdown()
        for key,value in saved.OwnProps()
            s.%key% := value
    }
}
V751CancelBatch(job,phase)
{
    if phase="after-file"
        IGLCancel()
}

V751AssignTeams() => V645ManagerFixture(V751AssignTeamsCase)
V751AssignTeamsCase(m,path,history)
{
    V48Assert(m.Controls.Has("Team") && !m.Controls["Team"].Enabled,"team action requires an explicit recording selection")
    V645ManagerSelect("wrong-log")
    V48Assert(m.Controls["Team"].Enabled && IHMTeamSelected("New raid"),"selected recording can be assigned without loading its raw log")
    saved := IGVReadHistory(path)
    V48Assert(saved["a"].Team="New raid" && saved["b"].Team="New raid" && saved["c"].Team="Keep","team assignment covers selected recording captures only")
    V48Assert(IGVJson(IGVPackPull(saved["a"].Pull))=IGVJson(IGVPackPull(history["a"].Pull)),"tagging does not change encounter statistics")
    V645ManagerSelect("wrong-log"),before := FileRead(path,"UTF-8")
    V48Assert(!IHMTeamSelected("*") && FileRead(path,"UTF-8")=before,"reserved all-teams marker cannot be stored as a team")
    V48Assert(IHMTeamSelected(""),"blank team returns a recording to Untagged")
    V645ManagerSelect("wrong-log"),newer := IGVReadHistory(path),newer["c"].Team := "External change",IGVWriteHistory(newer,path)
    before := FileRead(path,"UTF-8")
    V48Assert(!IHMTeamSelected("stale") && FileRead(path,"UTF-8")=before,"stale manager cannot overwrite concurrent saved changes")
    IHMRefresh(),m.Controls["Rows"].Modify(0,"Select"),IHMSelectionChanged()
    V48Assert(IHMTeamSelected("Both recordings"),"Ctrl/Shift multi-selection assigns multiple recordings at once")
    for key,e in IGVReadHistory(path)
        V48Assert(e.Team="Both recordings","every selected source receives its assigned team")
    for size in [[920,480],[1920,1080]] {
        IHMResize(m.Gui,0,size[1],size[2]),m.Controls["Team"].GetPos(&x,&y,&w,&h),m.Controls["Close"].GetPos(&cx,&cy)
        V48Assert(x+w<cx && y+h<size[2],"Assign team fits the manager footer")
    }
}

; Native diagnostics with private parser state, temporary files and hidden UI.
V76Run(fn) => V75LibraryRun(V76RunInner.Bind(fn))
V76RunInner(fn)
{
    q := IQIState(),oldQ := q.Clone(),pb := IPBESTState(),oldPB := pb.Clone()
    try {
        q.Loaded := false,q.Error := "",q.Notice := "",q.Running := false,q.Items := [],q.TestService := ""
        q.TestHistory := ILBState().TestPath ".history.json"
        pb.Loaded := true,pb.Enabled := false,pb.Gui := ""
        fn.Call()
    }
    finally {
        IPBESTHide()
        for key,value in oldQ.OwnProps()
            q.%key% := value
        for key,value in oldPB.OwnProps()
            pb.%key% := value
    }
}

V76QueueStorage() => V76Run(V76QueueStorageCase)
V76QueueStorageCase()
{
    q := IQIState(),path := A_Temp "\combat_2026-10-03_20_00_00_001.txt"
    IQIEnqueue([path,path]),V48Assert(q.Items.Length=1,"queue deduplicates repeated source paths")
    q.Items[1].State := "Importing",IQISave(),saved := FileRead(IQIPath(),"UTF-8"),q.Loaded := false,IQILoad()
    V48Assert(q.Items[1].State="Pending" && !q.Running,"crashed importing item becomes pending without auto-start")
    V48Assert(FileRead(IQIPath(),"UTF-8")=saved,"recovery never silently overwrites its source")
    q.Items[1].State := "Done",IQISave(),q.Loaded := false,IQILoad()
    V48Assert(q.Items[1].State="Done","completed status survives native disk round trip")
    FileAppend(" ",IQIPath(),"UTF-8"),before := FileRead(IQIPath(),"UTF-8")
    V59ExpectError((*)=>IQIEnqueue([path],true))
    V48Assert(FileRead(IQIPath(),"UTF-8")=before && q.Items[1].State="Done","external queue edits refuse overwrite and restore in-memory state")
    q.Loaded := false,IQILoad(),FileDelete(IQIPath()),FileAppend("broken",IQIPath(),"UTF-8"),q.Loaded := false,IQILoad()
    V48Assert(q.Error!="","corrupt queue is reported")
    V59ExpectError((*)=>IQIEnqueue([path]))
    V48Assert(FileRead(IQIPath(),"UTF-8")="broken","corrupt queue is retained")
    q.TestHistory := A_ScriptDir "\unsafe.json",V59ExpectError(IQIHistory)
}

V76QueuePause(info)
{
    if IQIState().Current=2
        ILBCancel()
}

V76QueueWorkflow() => V76Run(V76QueueWorkflowCase)
V76QueueWorkflowCase()
{
    global IP,Audio
    q := IQIState(),s := ILBState(),f := V68ReviewFile(),live := IP.Live,audioQueue := Audio.Queue
    SplitPath(s.TestPath,,&folder)
    one := folder "\combat_2026-10-03_20_00_00_001.txt",two := folder "\combat_2026-10-04_20_00_00_002.txt"
    try {
        FileCopy(f.Path,one),FileCopy(f.Path,two),ILBLoad()
        IQIEnqueue([one,two]),q.TestService := V76QueuePause,IQIRun()
        V48Assert(q.Items[1].State="Done" && q.Items[2].State="Pending","pause retains first completed file and keeps unfinished file pending")
        V48Assert(s.Files.Count=1 && IGVReadHistory(q.TestHistory).Count=1,"completed file exists in both catalogues before resume")
        q.Loaded := false,IQILoad(),q.TestService := "",IQIRun()
        V48Assert(q.Items[1].State="Done" && q.Items[2].State="Done" && s.Files.Count=2,"restart then resume imports only remaining source")
        V48Assert(IGVReadHistory(q.TestHistory).Count=2,"both completed recordings reach progression")
        IQIEnqueue([one]),IQIRun()
        V48Assert(q.Items[1].Note="Already current" && s.Files.Count=2,"resume skips unchanged already-shared source")
        missing := folder "\combat_2026-10-05_20_00_00_003.txt",IQIEnqueue([missing]),IQIRun()
        V48Assert(q.Items[3].State="Failed" && q.Items[1].State="Done","missing source remains retryable without losing completed imports")
        FileCopy(f.Path,missing),IQIRetry()
        V48Assert(q.Items[3].State="Done" && s.Files.Count=3,"retry succeeds after missing source is restored")
        prior := s.Original,IQIClear()
        V48Assert(!q.Items.Length && s.Original=prior && FileExist(one),"clear queue leaves catalogues and source logs intact")
        V48Assert(IP.Live=live && Audio.Queue=audioQueue && !IGRIsBusy() && !s.Busy,"queue leaves live/audio state unchanged and releases guard")
    }
    finally FileDelete(f.Path)
}

V76ReviewFixture()
{
    s := V6415CData(),s.AnalysisCapture := IACaptureNew(0,20000)
    boss := "NAHUT {4122949560827904}:1|(0,0,0,0)|(10000/20000)",add := "Rail Turret {4124177921474560}:2"
    V66PhaseAdd(s,1000,"Damage",20,"@Review#66",boss)
    V66PhaseAdd(s,2000,"Damage",100,"@Review#66",add)
    V66PhaseAdd(s,4000,"Damage",200,"@Friend#67",add)
    V66PhaseAdd(s,5000,"Death",0,add,add)
    V66PhaseAdd(s,3000,"Damage",50,"@Review#66",add)
    V66PhaseAdd(s,6000,"Damage",75,"@Review#66","Rail Turret {4124177921474560}:3")
    V66PhaseAdd(s,7000,"Activate",0,"@Review#66","=","4257790059085824")
    V66PhaseAdd(s,7500,"Activate",0,"@Friend#67","=","4258842326073344")
    V66PhaseAdd(s,8000,"Activate",0,"@Friend#67","=","814776770887680")
    V66PhaseAdd(s,10000,"Damage",20,"@Review#66",boss)
    d := IAAssemble(s,s.Current,s.AnalysisCapture)
    for ev in d.Rows
        if ev.AbilityId="4257790059085824"
            ev.Ability := "Advanced Kyrprax Medpac"
        else if ev.AbilityId="4258842326073344"
            ev.Ability := "Advanced Kyrprax Critical Adrenal"
        else if ev.AbilityId="814776770887680"
            ev.Ability := "Adrenaline Probe"
    return d
}

V76AddConsumables() => V76Run(V76AddConsumablesCase)
V76AddConsumablesCase()
{
    d := V76ReviewFixture(),m := IARCBuild(d)
    V48Assert(m.Adds.Length=2,"same-name NPC instances remain separate and boss is excluded")
    a := m.Adds[1]
    V48Assert(a.At=2000 && a.Death=5000 && a.Damage=350,"late damage is counted before the observed death")
    V48Assert(a.People["@Review#66"].Damage=150 && a.People["@Friend#67"].At=4000,"per-player damage and first-hit observations agree")
    V48Assert(m.Adds[2].Death=-1,"disappearance does not invent a death")
    V48Assert(m.Uses.Length=2 && m.Uses[1].Kind="Medpac" && m.Uses[2].Kind="Adrenal","exact activation IDs exclude Adrenaline Probe")
    ev := IPParseLine(IPDemoLine(1000,"@Review#66","=","Activate",0,false,-1,"Slow-release Medpac","123"))
    V48Assert(IARCConsumable(ev)="","HoT is not a consumable")
    ev.Ability := "Advanced Anodyne Attack Adrenal"
    V48Assert(IARCConsumable(ev)="Adrenal","explicit legacy consumable tier works without a new ID mapping")
    ev.Kind := "Heal",V48Assert(IARCConsumable(ev)="","result ticks cannot double-count activations")
    d.Rows.Push(d.Rows[8]),again := IARCBuild(d)
    V48Assert(again.Uses.Length=m.Uses.Length,"same activation cannot count twice")
    d.TargetClasses[a.Key] := "Object",again := IARCBuild(d)
    V48Assert(again.Adds.Length=1,"review-only object override excludes that NPC")
}

V76PersonalBests() => V76Run(V76PersonalBestsCase)
V76PersonalBestsCase()
{
    p := V75LibraryPull(),path := A_Temp "\combat_2026-10-03_00_00_00_001.txt",f := ILBFile(path,"20261003",0,"20261003120000",Format("{:064}",0),[p])
    old := ILBEntry(f,p),new := IPRCloneSnapshot(p),new.Id := 2,new.Start += 120000,new.End += 120000,new.Players[new.Recorder].Damage *= 2
    next := ILBEntry(f,new)
    V48Assert(IPBESTCompare([],next).Length=0,"first result is a baseline with no notice")
    records := IPBESTCompare([old],next)
    V48Assert(records.Length=1 && records[1].Metric="DPS" && records[1].Previous=2000,"same boss/mode/spec complete-kill DPS PB is detected")
    V48Assert(!IPBESTCompare([old,next],next).Length,"already indexed result cannot replay notice")
    new.Partial := 1,V48Assert(!IPBESTCompare([old],next).Length,"partial pulls never win records"),new.Partial := 0
    new.Result := "No kill",V48Assert(!IPBESTCompare([old],next).Length,"whole-fight wipes do not win a DPS record")
    p.Challenges[1].Verified := 1,new.Challenges[1].Verified := 1,new.Challenges[1].Players[new.Recorder].Damage *= 2
    V48Assert(IPBESTCompare([old],next).Length=1,"complete verified challenge may qualify on a wipe")
    new.Challenges[1].Partial := 1,V48Assert(!IPBESTCompare([old],next).Length,"unfinished challenge is excluded"),new.Challenges[1].Partial := 0
    new.Mode := "different",V48Assert(!IPBESTCompare([old],next).Length,"difficulty/group size cannot cross-compare"),new.Mode := p.Mode
    new.Players[new.Recorder].Spec := "different",V48Assert(!IPBESTCompare([old],next).Length,"discipline cannot cross-compare"),new.Players[new.Recorder].Spec := p.Players[p.Recorder].Spec
    new.Challenges[1].Verified := 0,V48Assert(!IPBESTCompare([old],next).Length,"legacy challenge data without completion verification cannot win")
    new.Result := "Kill",new.Players[new.Recorder].Damage := p.Players[p.Recorder].Damage
    V48Assert(!IPBESTCompare([old],next).Length,"ties stay quiet")
    V48Assert(!IPBESTPrefs().Enabled,"notices default off in isolated state")
    IPBESTShow("must not display",true),V48Assert(!IPMGuiAlive(IPBESTState().Gui),"self-tests never display a live overlay")
    p.Challenges[1].Verified := 1,roundtrip := ILBParse(IGVJson(ILBPack(Map(path,f))))
    V48Assert(roundtrip[StrLower(path)].Pulls[1].Challenges[1].Verified=1,"verified complete-window flag survives library storage")
    p.Result := "No kill",new.Result := "Kill",new.Challenges[1].Verified := 1
    new.Challenges[1].Players[new.Recorder].Damage := 10000
    rows := [old,next],shown := ILBPerformance(rows,p.Recorder,p.Boss,p.Mode,p.Players[p.Recorder].Spec,"Kill","DPS","burn-1")
    marks := IPBESTTrendMarks(shown,rows,p.Recorder,p.Boss,p.Mode,p.Players[p.Recorder].Spec,"DPS","burn-1")
    V48Assert(marks.Length=1 && marks[1]="","phase record marker compares earlier complete windows on wipes even in kill-only view")
}

V76PhaseTotals() => V76Run(V76PhaseTotalsCase)
V76PhaseTotalsCase()
{
    s := V6415CData(),seg := s.Current,state := IGPYNewState()
    state.Windows := [{Id:"one",Name:"First",Ordinal:1,Start:0,StartSeq:0,End:-1,EndSeq:0}]
    seg.PhaseProgress := Map("Parsely",state)
    ev := IPParseLine(IPDemoLine(1000,"@Review#66","NAHUT {4122949560827904}:1","Damage",100)),ev.RecordId := 1
    IPBESTPhaseObserve(seg,ev,1000)
    ev.RecordId := 2,ev.Amount := 200,IPBESTPhaseObserve(seg,ev,3000)
    next := IGPYCopy(state),next.Windows[1] := state.Windows[1].Clone(),next.Windows[1].End := 2000,next.Windows[1].EndSeq := 3
    next.Windows.Push({Id:"two",Name:"Second",Ordinal:1,Start:2000,StartSeq:3,End:-1,EndSeq:0}),seg.PhaseProgress["Parsely"] := next
    marker := IPParseLine(IPDemoLine(2000,"NAHUT {4122949560827904}:1","=","Activate",0)),marker.RecordId := 3
    IPBESTPhaseObserve(seg,marker,2000),r := seg.PersonalPhases.Rows
    V48Assert(r["one:1" Chr(30) "@Review#66"].Damage=100 && r["two:1" Chr(30) "@Review#66"].Damage=200,"late phase edge reassigns recent damage exactly once")
    p := V75LibraryPull(),p.Start := 0,p.End := 4000,p.Players := Map("@Review#66",p.Players[p.Recorder]),p.Challenges := [],p.Result := "No kill"
    IPBESTPhaseSummaries(seg,p)
    V48Assert(p.Challenges.Length=1 && p.Challenges[1].Duration=2 && p.Challenges[1].Players["@Review#66"].Damage=100,"only finished phases qualify on a wipe")
    p.Challenges := [],p.Result := "Kill",IPBESTPhaseSummaries(seg,p)
    V48Assert(p.Challenges.Length=2 && p.Challenges[2].Duration=2,"confirmed kill closes final phase denominator")
    IPBBeginUndo(s,seg),ev.RecordId := 4,ev.Amount := 400,IPBESTPhaseObserve(seg,ev,3500),IPBRollbackTail(s,seg)
    V48Assert(r["two:1" Chr(30) "@Review#66"].Damage=200,"speculative-tail rollback restores phase totals")
    restored := IPCDecode(IPCEncode(seg.PersonalPhases))
    V48Assert(restored.Rows["two:1" Chr(30) "@Review#66"].Damage=200 && restored.Meta["State"].Windows.Length=2,"new phase counters and shared boundary references survive binary cache round trip")
    p.Challenges := [],seg.PersonalPhases.Meta["Limited"] := true,IPBESTPhaseSummaries(seg,p)
    V48Assert(!p.Challenges.Length,"limited phase evidence cannot create records")
}

V76ReviewWindow() => V7412AnalysisIconsFixture(V76ReviewWindowCase)
V76ReviewWindowCase()
{
    a := IAState(),a.Data := V76ReviewFixture(),a.Query := IANewQuery(a.Data),a.Result := IAQuery(a.Data,a.Query)
    IARender(false)
    for page in [9,10] {
        V7826SelectReviewPage(page)
        V48Assert(a.Tab=page,"new review page is reachable")
        V48Assert(a.Tables[page=9 ? "Adds" : "ConsumableUses"].GetCount()=2,"new review displays journal evidence")
        for size in [[1020,700],[1920,1080]] {
            IAResize(a.Gui,0,size[1],size[2]),controls := []
            for control in a.Groups[page] {
                control.GetPos(&x,&y,&w,&h),controls.Push(control)
                V48Assert(x>=0 && y>=0 && x+w<=size[1] && y+h<=size[2] && h>20,"review table fits compact/maximized bounds")
            }
            V7412PlayerControlsPng("raid-review-" page "-" size[1] ".png",a.Gui,controls,0,0,size[1],size[2])
        }
    }
}

V76QueueWindow() => V76Run(V76QueueWindowCase)
V76QueueWindowCase()
{
    s := ILBState(),s.Files := V75LibraryFiles(),s.Loaded := true,ILBBuildWindow(),ILBRefresh(),c := s.Controls
    for size in [[664,428],[1920,1080]] {
        s.Gui.Show("Hide w" size[1] " h" size[2]),ILBResize(s.Gui,0,size[1],size[2])
        for page in [3,4] {
            c["Tabs"].Choose(page),ILBPageChanged(),controls := []
            for control in s.Gui {
                if !V58ChildVisible(control)
                    continue
                control.GetPos(&x,&y,&w,&h),controls.Push(control)
                V48Assert(x>=0 && y>=0 && x+w<=size[1] && y+h<=size[2],"queue/record UI fits: " control.Type " " SubStr(control.Text,1,30) " at " x "," y " " w "x" h " in " size[1] "x" size[2])
            }
            V7412PlayerControlsPng("queue-records-" page "-" size[1] ".png",s.Gui,controls,0,0,size[1],size[2])
        }
    }
    g := IPBESTWindow("Personal best preview`nTyth: Whole fight`nDPS 42,000  (+2.1%)"),g.Show("Hide w388 h98")
    ex := DllCall("User32\GetWindowLongW","Ptr",g.Hwnd,"Int",-20,"UInt")
    V48Assert((ex&0x08000000) && (ex&0x20),"notice is nonactivating and click-through")
    V7412PlayerControlsPng("personal-best-notice.png",g,[IPBESTState().Label],0,0,388,98)
    IPBESTHide()
}

; Explicit read-only archive check; not part of the default synthetic suite.
V76Archive() => V76Run(V76ArchiveCase)
V76ArchiveCase()
{
    global COMBAT_LOG_ENCODING
    source := IGJParse(FileRead(A_ScriptDir "\archive-source.json","UTF-8")),path := source[1]
    V48Assert(IPCHashFile(path)=source[2],"archive source digest matches manifest")
    s := IPNewData("PRIVATE ARCHIVE REVIEW"),s.AnalysisCapture := IACaptureNew(0,172800000),s.SourcePath := path
    snap := IASnapshotFile(path,COMBAT_LOG_ENCODING),start := A_TickCount,report := [],phases := 0,uses := 0,adds := 0
    try {
        while snap.File.Pos<snap.End {
            IPFeedLine(s,RTrim(snap.File.ReadLine(),"`r`n"))
            while s.Segments.Length>1 {
                seg := s.Segments[1]
                if seg.End<0 || seg=s.Current
                    break
                V76ArchiveConsume(s,seg,report,&phases,&uses,&adds)
                s.Rows := Max(0,s.Rows-seg.Rows.Count),s.Segments.RemoveAt(1)
            }
        }
        IPFinalizeData(s,"archive review complete")
        for seg in s.Segments
            V76ArchiveConsume(s,seg,report,&phases,&uses,&adds)
    }
    finally snap.File.Close()
    V48Assert(phases>0 && uses>0 && adds>0,"real archive exercises phases, consumables and enemy review")
    V48Assert(IPCHashFile(path)=source[2],"read-only archive replay leaves source unchanged")
    FileAppend(IGVJson([path,(A_TickCount-start)/1000,s.Lines,phases,uses,adds,report]),A_ScriptDir "\archive-review.json","UTF-8")
}

V76ArchiveConsume(s,seg,report,&phases,&uses,&adds)
{
    if seg.BossKey=""
        return
    d := IAAssemble(s,seg,s.AnalysisCapture),p := ILBFight(seg),review := IARCBuild(d),count := 0
    for c in p.Challenges {
        if SubStr(c.Key,1,6)!="phase:"
            continue
        window := ""
        for candidate in d.AutomaticPhases
            if "Phase: " candidate.Name=c.Name
                window := candidate
        V48Assert(IsObject(window),"stored phase exists in independent Analysis boundary replay: " p.Name " " c.Name)
        for key,t in c.Players {
            q := IANewQuery(d,key,window.From,window.To),q.PhaseBoundary := window.Boundary,result := IAQuery(d,q)
            V48Assert(result.D=t.Damage && result.H=t.Heal && result.E=t.Effective,"streamed phase totals exactly match accepted Analysis events: " p.Name " " c.Name)
        }
        count += 1
    }
    phases += count,uses += review.Uses.Length,adds += review.Adds.Length
    report.Push([p.Name,p.Result,p.Partial,count,review.Uses.Length,review.Adds.Length])
    FileAppend(p.Name " phases=" count " uses=" review.Uses.Length " adds=" review.Adds.Length "`n",A_ScriptDir "\archive-progress.txt","UTF-8")
}

; Actual hidden Library handlers, importer and disk cache; private logs/state only.
V761LibraryFixture(action) => V75LibraryRun(V761LibraryFixtureBody.Bind(action))
V761LibraryFixtureBody(action)
{
    global IP,Audio,IPAS
    f := V68ReviewFile(true),cache := IPCState(),oldCache := cache.Clone(),s := ILBState()
    oldAuto := IPAS,IPAS := IPASNewState()
    SplitPath(s.TestPath,,&dir)
    try {
        cache.TestRoot := dir "\cache",cache.Enabled := true,cache.Build := ""
        source := ILBFile(f.Path,"20261003",FileGetSize(f.Path),FileGetTime(f.Path,"M"),IPCHashFile(f.Path),[ILBFight(f.State.Segments[1])])
        s.Files := Map(StrLower(f.Path),source),s.Loaded := true,s.AutoLoaded := true,s.AutoLive := false
        IP.Live := IPNewData("PRIVATE LIVE FIXTURE"),IP.Encoding := "UTF-8",IPWLibraryOpen(),IPWState().HideTrash := false,ILBRefresh()
        e := s.Shown[1],live := IP.Live,queue := Audio.Queue
        action.Call(e,f)
        V48Assert(IP.Live=live && Audio.Queue=queue && !IP.Timer,"opening fixtures never changes live data, audio or scheduling")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"main window stays hidden throughout the native handler test")
    }
    finally {
        if IsObject(IP.ImportFile)
            try IP.ImportFile.Close()
        IP.ImportFile := "",IP.ImportRunning := false,IP.Busy := false,IP.Active := false
        for key,value in oldCache.OwnProps()
            cache.%key% := value
        IPAS := oldAuto
        FileDelete(f.Path)
    }
}

V761LibraryOpenGuards() => V761LibraryFixture(V761LibraryOpenGuardsCase)
V761LibraryOpenGuardsCase(e,f)
{
    global IP
    s := ILBState(),IP.ImportFile := {}
    V48Assert(!ILBOpenEntry(e) && InStr(s.Controls["Status"].Text,"Another log"),"in-progress import is not replaced")
    IP.ImportFile := "",IP.Busy := true
    V48Assert(!ILBOpenEntry(e) && InStr(s.Controls["Status"].Text,"busy"),"busy parser does not pretend to open a fight")
    IP.Busy := false,s.Busy := true
    V48Assert(!ILBOpenEntry(e) && InStr(s.Controls["Status"].Text,"Pause"),"library batch is protected and guidance explains how to proceed")
    s.Busy := false,missing := e.Clone(),missing.Path .= ".missing"
    V48Assert(!ILBOpenEntry(missing) && InStr(s.Controls["Status"].Text,"missing"),"missing original is reported")
    wrong := e.Clone(),wrong.Source := e.Source.Clone(),wrong.Source.Digest := Format("{:064}",0)
    V48Assert(!ILBOpenEntry(wrong) && InStr(s.Controls["Status"].Text,"contents changed"),"digest mismatch cannot reuse stale results")
    wrong.Source := e.Source.Clone(),wrong.Source.Size += 1
    V48Assert(!ILBOpenEntry(wrong) && InStr(s.Controls["Status"].Text,"Reindex source"),"changed source explains repair")
    s.Controls["List"].Modify(0,"-Select")
    V48Assert(!ILBOpenFight() && InStr(s.Controls["Status"].Text,"Select a fight"),"no selected row gets feedback")
}

V761LibraryOpenImport() => V761LibraryFixture(V761LibraryOpenImportCase)
V761LibraryOpenImportCase(e,f)
{
    global IP
    s := ILBState()
    V48Assert(ILBOpenFight() && IsObject(IP.ImportFile) && IPWState().Tab=7,"actual Library handler starts import and navigates to Raid")
    V48Assert(IsObject(s.Pending) && s.Pending.Timing=IP.ImportTiming,"selected fight is attached before import begins")
    IPImportRun(),IPRefresh()
    V48Assert(IP.ImportDone && IP.Offline.ProgressionComplete && IP.Selected=1 && !IP.Follow,"cold import selects the requested earlier fight, not the latest one")
    V48Assert(!IsObject(s.Pending) && IP.Offline.Segments.Length>50,"cold selection is consumed once in multi-pull source")
    first := IP.Offline,timing := IP.ImportTiming,IP.Selected := first.Segments.Length,V58SelectTab(13)
    V48Assert(ILBOpenFight() && IP.Selected=1 && IP.Offline=first && IP.ImportTiming=timing && !IsObject(IP.ImportFile),"verified in-memory recording switches fight without parsing again")
    IP.Offline := "",V58SelectTab(13)
    V48Assert(ILBOpenFight(),"a later cold entry can request the saved cache")
    IPImportRun()
    V48Assert(IP.ImportTiming.Cache="disk hit" && IP.Selected=1 && !IP.Follow && !IsObject(s.Pending),"disk-cache restoration preserves the requested fight too")
    s.Trends := [{Entry:e}],s.Controls["TrendList"].Delete(),s.Controls["TrendList"].Add("Select","saved fixture")
    order := ILBTrendSortState(),savedShown := order.Shown
    try {
        order.Shown := s.Trends,IP.Selected := IP.Offline.Segments.Length
        V48Assert(ILBOpenTrend() && IP.Selected=1,"Performance opening shares the same verified selection path")
    }
    finally order.Shown := savedShown
}

V761LibraryOpenCancel() => V761LibraryFixture(V761LibraryOpenCancelCase)
V761LibraryOpenCancelCase(e,f)
{
    global IP
    s := ILBState(),V48Assert(ILBOpenFight(),"cancel fixture starts actual Library import")
    IP.ImportCancelRequested := true,IPImportRun()
    V48Assert(!IsObject(s.Pending) && !IP.Offline.ProgressionComplete && IP.ImportTiming.Outcome="CANCELED","cancel retires pending selection and does not mark complete")
    IP.Offline := "",V58SelectTab(13),s.Shown[1].Pull := e.Pull.Clone(),s.Shown[1].Pull.Mode := "wrong"
    V48Assert(ILBOpenFight(),"a stale saved pull still opens its original file for inspection")
    IPImportRun()
    V48Assert(!IsObject(s.Pending) && InStr(s.Controls["Status"].Text,"no longer matches"),"unmatched saved bounds are disclosed with reindex guidance")
}

; Native parser/import handoff. Private files and hidden controls only.
V762AutoStopLibrary() => V761LibraryFixture(V762AutoStopLibraryCase)
V762AutoStopOpenRoutes() => V761LibraryFixture(V762AutoStopOpenRoutesCase)
V762AutoStopCancel() => V761LibraryFixture(V762AutoStopCancelCase)
V762AutoStopRecovery() => V761LibraryFixture(V762AutoStopRecoveryCase)

V762QueuedLive(count := 550)
{
    global IP,IPAS
    player := V51Source(),target := V51Target()
    IPFeedLine(IP.Live,IPDemoLine(1000,player,"=","Enter"),"private-live")
    IPFeedLine(IP.Live,IPDemoLine(2000,player,target,"Damage",100),"private-live")
    IP.Queue := [],IP.Head := 1
    Loop count
        IP.Queue.Push({Line:IPDemoLine(2000+A_Index*10,player,target,"Damage",1),Key:"private-live"})
    IP.Active := true,IPAS.Pending := true
}

V762Pump()
{
    global IrisTests,logReadBusy
    wasBusy := IrisTests.Busy,wasRead := logReadBusy
    try {
        ; This isolated diagnostic has no log reader, hotkeys or audio dispatch.
        IrisTests.Busy := false,logReadBusy := false
        IPPump()
    }
    finally IrisTests.Busy := wasBusy,logReadBusy := wasRead
}

V762Drain()
{
    global IP
    Loop 100 {
        if !IsObject(IP.ImportFile) && IP.Head>IP.Queue.Length
            return
        V762Pump()
    }
    throw Error("Private parser did not finish its queued records/import.")
}

V762AutoStopLibraryCase(e,f)
{
    global IP,IPAS
    V762QueuedLive(),live := IP.Live,IPRefresh()
    V48Assert(IP.ImportButton.Enabled && !IP.StartButton.Enabled,"Open log stays available while the live parser runs")
    V48Assert(ILBOpenFight() && !IP.Active && !IPAS.Pending && IsObject(IP.ImportFile),"Library accepts saved fight and stops collection/pending autostart automatically")
    V48Assert(IP.Queue.Length=550 && IP.Live=live && live.Lines=2,"handoff retains all queued live records and existing session")
    IPImportRun()
    V48Assert(IP.Offline.Lines=0 && InStr(IPImportProgress(IP),"queued live records"),"import cannot overtake queued live records and explains the short wait")
    V762Pump()
    V48Assert(IP.Head<=IP.Queue.Length && IP.Offline.Lines=0,"live drain remains bounded per pump rather than blocking on the full queue")
    V762Drain(),IPRefresh()
    V48Assert(live.Lines=552 && live.Finished && !live.Halted && live.Malformed=0,"every queued live record is retained and old session finalizes")
    V48Assert(IP.ImportDone && IP.Offline.ProgressionComplete && IP.Selected=1 && !IP.Follow,"saved import completes and selects the requested earlier fight")
    timing := IP.ImportTiming,data := IP.Offline,IP.Active := true,IPAS.Pending := true,V58SelectTab(13)
    V48Assert(ILBOpenFight() && !IP.Active && !IPAS.Pending && IP.Offline=data && IP.ImportTiming=timing,"in-memory Library opening also stops live parsing without another import")
}

V762AutoStopOpenRoutesCase(e,f)
{
    global IP
    IP.Active := true,IPRefresh()
    missing := e.Clone(),missing.Path .= ".missing"
    V48Assert(!ILBOpenEntry(missing) && IP.Active,"missing Library original does not stop live parsing")
    V48Assert(!IPBeginImport(missing.Path) && IP.Active && !IsObject(IP.ImportFile),"normal import verifies source readability before stopping live parsing")
    wide := f.Path ".utf16"
    try {
        FileAppend("private invalid encoding`n",wide,"UTF-16")
        V48Assert(!IPBeginImport(wide) && IP.Active,"unsupported source encoding leaves live parsing running")
    }
    finally FileDelete(wide)
    IPWDropFiles(IP.Gui,"",[f.Path,f.Path],0,0)
    V48Assert(IP.Active && !IsObject(IP.ImportFile),"invalid file drop does not stop live parsing")
    IPWDropFiles(IP.Gui,"",[f.Path],0,0)
    V48Assert(!IP.Active && IsObject(IP.ImportFile),"valid dragged log uses automatic live stop")
    V762Drain(),V48Assert(IP.ImportDone && IP.Offline.ProgressionComplete,"dragged log finishes through actual saved-file importer")
    IP.Offline := "",IP.Active := true
    V48Assert(IPBeginImport(f.Path) && !IP.Active,"normal Open log selected-file route automatically stops live parsing")
    V762Drain(),V48Assert(IP.ImportTiming.Cache="disk hit","normal route retains cached import support")
}

V762AutoStopCancelCase(e,f)
{
    global IP
    V762QueuedLive(),V48Assert(ILBOpenFight(),"prepare saved import while live records await drain")
    IPStop()
    V48Assert(!IsObject(IP.ImportFile) && !IsObject(ILBState().Pending) && !IP.Offline.ProgressionComplete,"Cancel releases prepared saved file and retires requested fight")
    V48Assert(IP.Queue.Length=550 && !IP.Active,"canceling new import preserves queued live data and does not silently restart live parsing")
    V762Drain(),V48Assert(IP.Live.Finished && IP.Live.Lines=552,"remaining live records finish even when the new import is canceled")
    FileMove(f.Path,f.Path ".probe"),FileMove(f.Path ".probe",f.Path)
    V48Assert(FileExist(f.Path),"canceled source has no leaked file handle")
}

V762AutoStopRecoveryCase(e,f)
{
    global IP
    V762QueuedLive(12),file := FileOpen(f.Path,"r","UTF-8")
    job := IPLateCreate(IP.Live,file,f.Path,"private-recovery",file.Length),IP.LateStart := job
    V48Assert(ILBOpenFight() && !IPLateBusy() && !IsObject(job.File),"selecting saved log cancels unfinished live catch-up and closes its private reader")
    V762Drain()
    V48Assert(IP.ImportDone && IP.Live.Lines=14 && IP.Live.Partial,"unrecovered earlier live history is marked incomplete while queued records are retained")
}

; Private queue snapshots/journals, synthetic sources and hidden native controls.
V763QueueJournalRecovery() => V76Run(V763QueueJournalRecoveryCase)
V763QueueJournalConflict() => V76Run(V763QueueJournalConflictCase)
V763QueueCheckpointRecovery() => V76Run(V763QueueCheckpointRecoveryCase)
V763QueueRowUpdates() => V76Run(V763QueueRowUpdatesCase)
V763QueueEstimates() => V76Run(V763QueueEstimatesCase)
V763QueueCommittedJournalFailure() => V76Run(V763QueueCommittedJournalFailureCase)

V763QueueSeed()
{
    s := ILBState(),SplitPath(s.TestPath,,&dir)
    IQIEnqueue([dir "\combat_2026-10-01_12_00_00_001.txt",dir "\combat_2026-10-02_12_00_00_002.txt"])
    return IQIState()
}

V763QueueHoldJournalBackup()
{
    path := IQIPath() ".journal.bak"
    FileAppend("",path,"UTF-8-RAW")
    held := DllCall("CreateFileW","Str",path,"UInt",0x80000000,"UInt",0,"Ptr",0,"UInt",3,"UInt",0,"Ptr",0,"Ptr")
    V48Assert(held && held!=-1,"private journal backup can be held exclusively")
    return held
}

V763QueueCommittedJournalFailureCase()
{
    q := V763QueueSeed(),held := V763QueueHoldJournalBackup(),failure := ""
    try IQIEnqueue([A_Temp "\combat_2026-11-13_01_02_03_004.txt"])
    catch Error as err
        failure := err
    finally DllCall("CloseHandle","Ptr",held)
    V48Assert(IsObject(failure) && failure.Extra="IRIS_QUEUE_COMMITTED","post-commit journal failure is distinguished from a rejected save")
    V48Assert(q.Items.Length=3 && IQIParse(FileRead(IQIPath(),"UTF-8")).Length=3,"enqueue keeps the published recordings in memory after journal maintenance fails")
    IQISave(),q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items.Length=3,"the next checkpoint and restart retain every newly enqueued recording")

    q.Items[1].State := "Failed",q.Items[1].Note := "Private retry fixture",IQISave()
    held := V763QueueHoldJournalBackup()
    try IQIRetry()
    finally DllCall("CloseHandle","Ptr",held)
    V48Assert(q.Items[1].State="Pending" && IQIParse(FileRead(IQIPath(),"UTF-8"))[1].State="Pending","retry keeps its committed state when journal maintenance fails")
    V48Assert(!q.Running && InStr(q.Notice,"queue was saved"),"retry reports the maintenance failure without starting work")
    IQISave()

    ILBState().Controls["QueueNote"] := {Text:""},held := V763QueueHoldJournalBackup()
    try IQIClear()
    finally DllCall("CloseHandle","Ptr",held)
    V48Assert(!q.Items.Length && !IQIParse(FileRead(IQIPath(),"UTF-8")).Length,"clear keeps the committed empty queue instead of restoring deleted rows")
    IQISave(),q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && !q.Items.Length,"a repaired journal restarts with the committed empty queue")
}

V763QueueJournalRecoveryCase()
{
    q := V763QueueSeed(),snapshot := FileRead(IQIPath(),"UTF-8")
    q.Items[1].State := "Done",q.Items[1].Note := "Saved ✓",q.Items[1].Size := 1234,IQIJournalSave(1)
    q.Items[2].State := "Importing",IQIJournalSave(2)
    V48Assert(FileRead(IQIPath(),"UTF-8")=snapshot,"per-file commits leave the large snapshot untouched")
    q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[1].State="Done" && q.Items[1].Note="Saved ✓" && q.Items[1].Size=1234,"journal restores committed completion, Unicode and source size")
    V48Assert(q.Items[2].State="Pending" && !q.Running,"interrupted importing record resumes safely without automatic work")
    FileAppend("[2,0,99,",IQIPath() ".journal","UTF-8-RAW"),q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[1].State="Done" && q.Items[2].State="Pending","partial last write retains preceding durable completions")
    partial := FileRead(IQIPath() ".journal","UTF-8"),IQISave()
    V48Assert(FileRead(IQIPath() ".journal.bak","UTF-8")=partial,"checkpoint preserves old journal before compacting")
    q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[1].State="Done" && q.Items[2].State="Pending","compacted snapshot roundtrips recovered state")
    V48Assert(StrSplit(q.JournalOriginal,"`n").Length=2,"compaction returns journal to one header")
}

V763QueueJournalConflictCase()
{
    q := V763QueueSeed(),q.Items[1].State := "Done"
    FileAppend(" ",IQIPath(),"UTF-8"),external := FileRead(IQIPath(),"UTF-8")
    V59ExpectError((*)=>IQIJournalSave(1)),V59ExpectError(IQISave)
    V48Assert(FileRead(IQIPath(),"UTF-8")=external,"external snapshot changes are not overwritten by small or full saves")
    ; Restore only this owned fixture, then independently edit its journal.
    FileDelete(IQIPath()),FileAppend(q.Original,IQIPath(),"UTF-8")
    FileAppend(" ",IQIPath() ".journal","UTF-8-RAW"),external := FileRead(IQIPath() ".journal","UTF-8")
    V59ExpectError((*)=>IQIJournalSave(1)),V59ExpectError(IQISave)
    V48Assert(FileRead(IQIPath() ".journal","UTF-8")=external,"concurrent journal changes cannot be silently overwritten")
    FileDelete(IQIPath() ".journal"),FileAppend(q.JournalOriginal "[1,0,1,`"Invalid state`",`"`"]`n",IQIPath() ".journal","UTF-8-RAW")
    q.Loaded := false,IQILoad(),V48Assert(q.Error!="","corrupt complete journal rows are rejected instead of discarded")
    V59ExpectError(IQISave)
}

V763QueueCheckpointRecoveryCase()
{
    q := V763QueueSeed(),q.Items[1].State := "Done",IQIJournalSave(1)
    oldJournal := q.JournalOriginal,IQISave()
    ; Simulate power loss after atomic base replacement and before journal reset.
    FileDelete(IQIPath() ".journal"),FileAppend(oldJournal,IQIPath() ".journal","UTF-8-RAW")
    q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[1].State="Done","new authoritative snapshot survives stale prior journal after interrupted compaction")
    IQISave(),q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items.Length=2 && q.Items[1].State="Done","next checkpoint cleans obsolete journal without losing status")
    FileDelete(IQIPath() ".journal")
    FileAppend(IGVJson(["IrisImportQueueUpdates",1,Format("{:064}",0)]) "`n",IQIPath() ".journal","UTF-8-RAW")
    q.Loaded := false,IQILoad()
    V48Assert(q.Error!="","unrelated snapshot identity never applies row updates to a different queue")
}

V763QueueRowUpdatesCase()
{
    s := ILBState(),q := V763QueueSeed(),q.Items := []
    Loop 5000
        q.Items.Push({Path:A_Temp "\row-" A_Index ".txt",Force:0,Size:2000,State:"Pending",Note:""})
    ILBBuildWindow(),s.Controls["Tabs"].Choose(4),IQIDraw(),lv := s.Controls["QueueList"],builds := q.FullRebuilds,changes := q.RowUpdates
    lv.Modify(2500,"Select Focus Vis"),q.Items[12].State := "Importing",IQIDraw()
    V48Assert(q.FullRebuilds=builds && q.RowUpdates=changes+1 && lv.GetText(12,1)="Importing","one changed item updates one row in a 5000-file queue")
    V48Assert(lv.GetCount()=5000 && lv.GetNext()=2500,"updating current file preserves selection and the rest of the table")
    IQIDraw(),V48Assert(q.RowUpdates=changes+1 && q.FullRebuilds=builds,"unchanged refresh does not repopulate native controls")
    q.Items[12].Note := "Saved ✓",q.Items[12].State := "Done",IQIDraw()
    V48Assert(lv.GetText(12,4)="Saved ✓" && q.RowUpdates=changes+2,"completion details update in place")
}

V763QueueEstimatesCase()
{
    q := IQIState(),s := ILBState(),SplitPath(s.TestPath,,&dir),paths := []
    Loop 3 {
        path := dir "\combat_2026-10-0" A_Index "_12_00_00_001.txt"
        FileAppend(IPDemoLine(1000,"@Private#1","=","Activate") "`n",path,"UTF-8"),paths.Push(path)
    }
    IQIEnqueue(paths),IQIRun(),total := 0
    for path in paths
        total += FileGetSize(path)
    V48Assert(q.Items[3].State="Done" && q.ReadBytes=total,"files shorter than 64 records count every completed byte")
    q.Running := true,q.Remaining := 24000000000,q.CurrentBytes := 0
    V48Assert(IQIEstimate(q,17000)<0,"a few tiny logs cannot extrapolate an enormous false archive ETA")
    q.MeasuredFiles := 0,q.ScanBytes := 0,q.ScanMs := 0,q.OverheadMs := 0,q.SkippedFiles := 0
    Loop 3
        IQIMeasure(1048576,1000,1100)
    q.Remaining := 10485760
    V48Assert(Abs(IQIEstimate(q,10)-11)<0.001,"ETA separates scan throughput from per-file overhead")
    q.CurrentBytes := 5242880
    V48Assert(Abs(IQIEstimate(q,10)-6)<0.001,"current-file progress reduces remaining scan work")
    V48Assert(IQIDuration(1)="1 min" && IQIDuration(3600)="1 hr" && IQIDuration(3720)="1 hr 2 min","ETA displays readable minutes/hours")
    q.MeasuredFiles := 0,q.ScanBytes := 0,q.ScanMs := 0,q.OverheadMs := 0,q.SkippedFiles := 0
    Loop 3
        IQIMeasure(1048576,0,100,true)
    V48Assert(Abs(IQIEstimate(q,10)-1)<0.001,"all-skipped queue estimates from actual checking overhead")
    q.Running := false
}

; Native import handoff checks. Synthetic logs, private catalogues and hidden UI.
V764QueueFixture(action) => V76Run(V764QueueFixtureBody.Bind(action))
V764QueueFixtureBody(action)
{
    global IP,IPAS,IrisTests,Audio
    oldAuto := IPAS,oldBusy := IrisTests.Busy,IPAS := IPASNewState(),f := V68ReviewFile()
    s := ILBState(),q := IQIState(),audioQueue := Audio.Queue
    SplitPath(s.TestPath,,&folder)
    path := folder "\combat_2026-10-05_20_00_00_001.txt"
    try {
        FileCopy(f.Path,path),ILBLoad(),ILBBuildWindow()
        s.Controls["Tabs"].Choose(4),ILBPageChanged()
        IP.Live := IPNewData("PRIVATE QUEUE HANDOFF"),IP.Encoding := "UTF-8"
        ; SELF_TEST prevents scheduling/audio. Allow the actual bounded pump.
        IrisTests.Busy := false
        action.Call(path)
        V48Assert(!q.Running && !s.Busy && !IGRIsBusy(),"queue handoff releases all busy guards")
        V48Assert(!IP.Timer && Audio.Queue=audioQueue,"queue handoff never schedules live timers or touches audio")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",s.Gui.Hwnd,"Int"),"queue diagnostic window remains hidden")
    }
    finally {
        IPLateCancel(),IP.ImportFile := "",IP.ImportRunning := false,IP.Active := false,IP.Busy := false
        IPAS := oldAuto,IrisTests.Busy := oldBusy,FileDelete(f.Path)
    }
}

V764QueueAutoPause() => V764QueueFixture(V764QueueAutoPauseCase)
V764QueueAutoPauseCase(path)
{
    global IP,IPAS
    q := IQIState(),s := ILBState(),IQIEnqueue([path]),V762QueuedLive()
    live := IP.Live,probe := {Calls:0},q.TestService := V764DrainProbe.Bind(probe)
    IQIRun()
    V48Assert(probe.Calls>=3,"queued live work drains in multiple bounded batches before importing: " q.Notice " / " IP.Status)
    V48Assert(!IP.Active && !IPAS.Pending,"Resume automatically pauses live collection and cancels pending autostart")
    V48Assert(IP.Live=live && live.Lines=552 && live.Finished && !live.Halted,"handoff retains every queued record and finalizes the live session")
    V48Assert(q.Items[1].State="Done" && s.Files.Count=1 && IGVReadHistory(q.TestHistory).Count=1,"Resume imports into Library and Progression after live data drains")
    V48Assert(!s.Controls["QueueResume"].Enabled && !s.Controls["QueuePause"].Enabled,"completed queue has no work to resume or pause")
}

V764DrainProbe(probe,info)
{
    global IP,IPAS
    q := IQIState(),s := ILBState()
    if q.Current
        return
    probe.Calls += 1
    V48Assert(!IP.Active && !IPAS.Pending && q.Running && s.Busy,"draining stops collection while reserving queue ownership")
    V48Assert(!s.Files.Count && q.Items[1].State="Pending","saved source has not overtaken pending live data")
    V48Assert(!s.Controls["QueueResume"].Enabled && s.Controls["QueuePause"].Enabled,"Pause stays available during the handoff")
    IQIRun() ; repeated Resume cannot recursively start another queue run
}

V764QueuePauseDrain() => V764QueueFixture(V764QueuePauseDrainCase)
V764QueuePauseDrainCase(path)
{
    global IP,IPAS
    q := IQIState(),s := ILBState(),IQIEnqueue([path]),V762QueuedLive()
    q.TestService := V764CancelDrain,IQIRun()
    V48Assert(!q.Running && !IP.Active && IP.Queue.Length=550 && IP.Head=1,"Pause cancels before draining without discarding live records or restarting live parsing")
    V48Assert(q.Items[1].State="Pending" && !s.Files.Count && InStr(q.Notice,"paused"),"paused handoff keeps the source pending and explains its state")
    V762Drain(),V48Assert(IP.Live.Lines=552 && IP.Live.Finished,"normal pump can finish retained records after cancellation")
    q.Loaded := false,IQILoad(),q.TestService := "",IP.Active := true,IPAS.Pending := true,IQIRun()
    V48Assert(q.Items[1].State="Done" && !IP.Active && !IPAS.Pending,"recovered queue Resume automatically pauses live parsing again")
}
V764CancelDrain(info)
{
    if !IQIState().Current
        ILBCancel()
}

V764QueueGuards() => V764QueueFixture(V764QueueGuardsCase)
V764QueueGuardsCase(path)
{
    global IP,IPAS
    q := IQIState(),a := IAState(),IP.Active := true,IPAS.Pending := true
    IQIRun(),V48Assert(IP.Active && IPAS.Pending && !q.Running,"empty queue Resume leaves live parsing and pending autostart alone")
    IQIEnqueue([path]),q.Items[1].State := "Done",IQISave(),IQIRun()
    V48Assert(IP.Active && IPAS.Pending,"already-completed queue is also a no-op")
    q.Items[1].State := "Pending",IQISave(),a.Busy := true
    try {
        IQIRun(),V48Assert(IP.Active && IPAS.Pending && InStr(q.Notice,"Analysis operation"),"busy Analysis is explained before changing live state")
    }
    finally a.Busy := false
    IP.ImportFile := {},IQIRun()
    V48Assert(IP.Active && IsObject(IP.ImportFile) && InStr(q.Notice,"current import"),"another saved import remains protected")
    IP.ImportFile := "",IP.Busy := true,IQIRun()
    V48Assert(IP.Active && !q.Running,"an executing parser batch is not interrupted")
    IP.Busy := false,guard := IGRModelState(),guard.Busy := true
    try {
        IQIRun(),V48Assert(IP.Active && InStr(q.Notice,"review"),"existing progression review keeps ownership")
    }
    finally guard.Busy := false
    V48Assert(q.Items[1].State="Pending" && !ILBState().Files.Count,"blocked requests never consume pending entries")
}

V764QueueNewWork() => V764QueueFixture(V764QueueNewWorkCase)
V764QueueNewWorkCase(path)
{
    global IP
    q := IQIState(),IQIEnqueue([path]),V762QueuedLive()
    q.TestService := V764SupersedeDrain.Bind("live"),IQIRun()
    V48Assert(IP.Active && !q.Running && InStr(q.Notice,"restarted"),"new explicit live parsing request cancels the waiting import")
    V48Assert(IP.Queue.Length=550 && IP.Head=1 && q.Items[1].State="Pending","superseded queue neither drains nor imports behind the new request")
    IP.Active := false,q.TestService := V764SupersedeDrain.Bind("saved"),IQIRun()
    V48Assert(IsObject(IP.ImportFile) && !q.Running && InStr(q.Notice,"current import"),"new saved-file load takes precedence over the waiting queue")
    IP.ImportFile := "",q.TestService := "",V762Drain()
    V48Assert(!ILBState().Files.Count && q.Items[1].State="Pending","superseded source remains available for later Resume")
}
V764SupersedeDrain(kind,info)
{
    global IP
    if IQIState().Current
        return
    if kind="live"
        IP.Active := true
    else
        IP.ImportFile := {}
}

V764QueueRoutes() => V764QueueFixture(V764QueueRoutesCase)
V764QueueRoutesCase(path)
{
    global IP,IPAS
    q := IQIState(),IP.Active := true,IPAS.Pending := true
    ILBIndexPaths([path]) ; shared Add logs / Add folder / Reindex entry point
    V48Assert(!IP.Active && !IPAS.Pending && q.Items[1].State="Done","Add logs/folder shared route automatically pauses live parsing")
    q.Items[1].State := "Failed",IQISave(),IP.Live := IPNewData("PRIVATE RETRY HANDOFF"),V762QueuedLive(12)
    reader := FileOpen(path,"r","UTF-8"),job := IPLateCreate(IP.Live,reader,path,"private-recovery",reader.Length),IP.LateStart := job
    IQIRetry()
    V48Assert(!IPLateBusy() && !IsObject(job.File),"Retry cancels pending live catch-up and closes its reader")
    V48Assert(!IP.Active && !IPAS.Pending && q.Items[1].State="Done" && q.Items[1].Note="Already current","Retry shares automatic pause and retains already-current detection")
    V48Assert(IP.Live.Lines=14 && IP.Live.Partial,"queued records survive interrupted catch-up with honest incomplete history")
}

; Isolated native single-source saves and archive no-boss fast paths.
V765LibraryEntry() => V75LibraryRun(V765LibraryEntryCase)
V765LibraryEntryCase()
{
    s := ILBState(),ILBLoad(),ILBCommit(V75LibraryFiles()),old := s.Original
    firstKey := "",first := ""
    for key,file in s.Files {
        firstKey := key,first := file
        break
    }
    path := A_Temp "\combat_2026-10-05_00_00_00_001.txt"
    file := ILBFile(path,"20261005",42,"20261005120000",Format("{:064}",0),[V75LibraryPull()])
    file.ProgressionPulls := ["private transient field"],file.Pulls[1].Players[file.Pulls[1].Recorder].Name := "Sophië"
    expected := s.Files.Clone(),expected[StrLower(path)] := file,ILBCommitFile(file)
    V48Assert(IGVJson(ILBPack(INLibraryRead(s.Original,s.TestPath)))==IGVJson(ILBPack(expected)),"single-file write matches full catalogue values including Unicode")
    V48Assert(s.Files[firstKey]=first && FileRead(s.TestPath ".bak","UTF-8")==old,"unchanged validated entries retain identity and prior disk snapshot stays backed up")
    saved := s.Files[StrLower(path)]
    V48Assert(!saved.HasOwnProp("ProgressionPulls") && saved!=file,"only normalized catalogue data is retained, not transient encounter objects")
    file.Pulls[1].Players[file.Pulls[1].Recorder].Name := "changed caller"
    V48Assert(saved.Pulls[1].Players[saved.Pulls[1].Recorder].Name="Sophië","caller mutations cannot change the saved entry")
    V48Assert(IGVJson(ILBPack(INLibraryRead(FileRead(s.TestPath,"UTF-8"),s.TestPath)))==IGVJson(ILBPack(s.Files)),"saved single-entry update passes the complete schema reader")
    before := s.Original,revision := s.Revision,file.Pulls[1].Result := "invalid"
    V59ExpectError((*)=>ILBCommitFile(file))
    V48Assert(s.Original==before && s.Revision=revision && FileRead(s.TestPath,"UTF-8")==before,"invalid incoming data changes neither disk nor in-memory catalogue")
    file.Pulls[1].Result := "No kill",ILBCommitFile(file)
    V48Assert(s.Files.Count=2 && s.Files[StrLower(path)].Pulls[1].Result="No kill","replacing a source updates its normalized entry without duplicating it")
}

V765LibraryEntryConflicts() => V75LibraryRun(V765LibraryEntryConflictsCase)
V765LibraryEntryConflictsCase()
{
    s := ILBState(),ILBLoad(),ILBCommit(V75LibraryFiles())
    for key,file in s.Files
        break
    before := s.Original,revision := s.Revision,temp := s.TestPath ".pending-" DllCall("GetCurrentProcessId")
    FileAppend("unfinished",temp,"UTF-8"),V59ExpectError((*)=>ILBCommitFile(file))
    V48Assert(FileRead(temp,"UTF-8")="unfinished" && FileRead(s.TestPath,"UTF-8")==before,"single-entry writer preserves someone else's pending save")
    FileDelete(temp),FileAppend(" ",s.TestPath,"UTF-8"),external := FileRead(s.TestPath,"UTF-8")
    V59ExpectError((*)=>ILBCommitFile(file))
    V48Assert(FileRead(s.TestPath,"UTF-8")==external && s.Original==before && s.Revision=revision,"single-entry fast path still rejects concurrent disk changes")
    s.Loaded := false,ILBLoad(),s.Demo := true
    V59ExpectError((*)=>ILBCommitFile(file)),s.Demo := false
    V48Assert(FileRead(s.TestPath,"UTF-8")==external,"demo data never overwrites the saved catalogue")
    FileDelete(s.TestPath),FileAppend("broken",s.TestPath,"UTF-8"),s.Loaded := false,ILBLoad()
    V59ExpectError((*)=>ILBCommitFile(file))
    V48Assert(FileRead(s.TestPath,"UTF-8")="broken","corrupt source cannot be replaced by the entry update path")
}

V765LibraryArchiveCapacity() => V75LibraryRun(V765LibraryArchiveCapacityCase)
V765LibraryArchiveCapacityCase()
{
    s := ILBState(),ILBLoad(),files := Map()
    template := ILBFile(A_Temp "\capacity.txt","20261005",20,"20261005120000",Format("{:064}",0),[])
    Loop 10000 {
        f := template.Clone(),f.Path := A_Temp "\capacity-" A_Index ".txt",files[StrLower(f.Path)] := f
    }
    ILBCommit(files),f := template.Clone(),f.Path := A_Temp "\capacity-10001.txt",ILBCommitFile(f)
    V48Assert(s.Files.Count=10001 && INLibraryRead(s.Original,s.TestPath).Count=10001,"large archives can cross the old 10,000-file limit and reopen normally")
    files := s.Files.Clone()
    Loop 89999 {
        f := template.Clone(),f.Path := A_Temp "\capacity-" (10001+A_Index) ".txt",files[StrLower(f.Path)] := f
    }
    ILBCommit(files),before := s.Original
    V48Assert(s.Files.Count=100000,"library supports the import queue's full 100,000-file capacity")
    f := template.Clone(),f.Path := A_Temp "\capacity-extra.txt"
    V59ExpectError((*)=>ILBCommitFile(f))
    V48Assert(s.Files.Count=100000 && FileRead(s.TestPath,"UTF-8")==before,"capacity overflow leaves the entire saved catalogue intact")
}

V765NoBossQueue() => V76Run(V765NoBossQueueCase)
V765NoBossQueueCase()
{
    s := ILBState(),q := IQIState(),SplitPath(s.TestPath,,&dir)
    path := dir "\combat_2026-10-05_20_00_00_001.txt"
    FileAppend(IPDemoLine(1000,"@Private#1","=","Activate") "`n",path,"UTF-8")
    FileAppend("private unreadable history fixture",q.TestHistory,"UTF-8"),original := FileRead(q.TestHistory,"UTF-8")
    IQIEnqueue([path]),IQIRun()
    V48Assert(q.Items[1].State="Done" && InStr(q.Items[1].Note,"No boss fights") && s.Files.Count=1,"boss-free logs get an honest completion note and a deduplication entry")
    V48Assert(FileRead(q.TestHistory,"UTF-8")==original,"boss-free imports neither read nor write unrelated progression history")
    IQIEnqueue([path]),IQIRun()
    V48Assert(q.Items[1].State="Done" && q.Items[1].Note="Already current","boss-free repeated imports skip without reparsing progression history")
    f := V68ReviewFile(),bossPath := dir "\combat_2026-10-05_21_00_00_002.txt"
    try {
        FileCopy(f.Path,bossPath),IQIEnqueue([bossPath]),IQIRun()
        V48Assert(q.Items[2].State="Pending" && s.Files.Count=2,"boss-containing source still requires valid progression storage and remains pending for Resume after a save failure")
        V48Assert(FileRead(q.TestHistory,"UTF-8")==original,"failed boss history read keeps original history intact")
        FileDelete(q.TestHistory),IQIRun()
        V48Assert(q.Items[2].State="Done" && s.Files.Count=2 && IGVReadHistory(q.TestHistory).Count=1,"Resume completes both stores despite an already saved Library source")
    }
    finally FileDelete(f.Path)
}

; Private temporary catalogues, sources and native controls. No real app state.
V766Sources(count := 4)
{
    SplitPath(ILBState().TestPath,,&dir),paths := []
    Loop count {
        path := dir "\combat_2026-10-05_20_00_00_" Format("{:06}",A_Index) ".txt"
        FileAppend(IPDemoLine(1000,"@Private#1","=","Activate") "`n",path,"UTF-8"),paths.Push(path)
    }
    ILBLoad(),IQIEnqueue(paths)
    return paths
}

V766LibraryBatchAtomic() => V75LibraryRun(V766LibraryBatchAtomicCase)
V766LibraryBatchAtomicCase()
{
    s := ILBState(),ILBLoad(),ILBCommit(V75LibraryFiles()),before := s.Original,revision := s.Revision
    one := ILBFile(A_Temp "\one.txt","20261005",1,"20261005120000",Format("{:064}",0),[V75LibraryPull()])
    two := ILBFile(A_Temp "\two.txt","20261005",1,"20261005120000",Format("{:064}",0),[V75LibraryPull()])
    two.Pulls[1].Result := "invalid",updates := Map(StrLower(one.Path),one,StrLower(two.Path),two)
    V59ExpectError((*)=>ILBCommitFiles(updates))
    V48Assert(s.Original==before && s.Revision=revision && FileRead(s.TestPath,"UTF-8")==before,"one invalid entry prevents the entire batch save")
    two.Pulls[1].Result := "Kill",ILBCommitFiles(updates)
    V48Assert(s.Files.Count=3 && s.Revision=revision+1,"valid batch commits all entries in one snapshot")
    V48Assert(FileRead(s.TestPath ".bak","UTF-8")==before && INLibraryRead(s.Original,s.TestPath).Count=3,"batch preserves backup and normal-reader compatibility")
}

V766QueueBatch() => V76Run(V766QueueBatchCase)
V766QueueBatchCase()
{
    q := IQIState(),s := ILBState(),paths := V766Sources(40),revision := s.Revision
    probe := {Seen:false,MaxChecked:0},q.TestService := V766BatchProbe.Bind(probe),IQIRun()
    V48Assert(probe.Seen && probe.MaxChecked<IQIState().BatchPolicy.Files,"pending save batch stays bounded during record processing")
    V48Assert(s.Files.Count=40 && s.Revision-revision<40,"all forty sources save with fewer than one full snapshot per source")
    for item in q.Items
        V48Assert(item.State="Done","every acknowledged source is saved")
    V48Assert(q.MeasuredFiles=40 && q.Counts.Done=40 && !q.Counts.Pending && !q.Checked.Length,"batch completions update timing and counters exactly once")
    q.Loaded := false,IQILoad(),V48Assert(q.Items[40].State="Done" && INLibraryRead(s.Original,s.TestPath).Count=40,"all completions and catalogue entries survive reload")
}
V766BatchProbe(probe,info)
{
    q := IQIState(),s := ILBState()
    probe.MaxChecked := Max(probe.MaxChecked,q.Checked.Length)
    if q.Current=2 && !probe.Seen {
        probe.Seen := true
        V48Assert(q.Items[1].State="Importing" && InStr(q.Items[1].Note,"Waiting to save") && !s.Files.Count,"checked entry is not marked Done before its durable save")
        V48Assert(q.Counts.Done=0 && q.Counts.Pending=40,"pending totals include the waiting save")
    }
}

V766QueuePauseFlush() => V76Run(V766QueuePauseFlushCase)
V766QueuePauseFlushCase()
{
    q := IQIState(),s := ILBState(),V766Sources(),q.TestService := V766PauseThird,IQIRun()
    V48Assert(q.Items[1].State="Done" && q.Items[2].State="Done" && q.Items[3].State="Pending" && q.Items[4].State="Pending","Pause saves already checked files and leaves unprocessed sources pending")
    V48Assert(s.Files.Count=2 && !q.Checked.Length && q.Counts.Done=2 && q.Counts.Pending=2,"Pause flush releases buffered entries and maintains accurate totals")
    q.Loaded := false,IQILoad(),q.TestService := "",IQIRun()
    V48Assert(s.Files.Count=4 && q.Items[4].State="Done","Resume retains prior saved batch and completes remaining files")
}
V766PauseThird(info)
{
    if IQIState().Current=3
        ILBCancel()
}

V766QueueSaveFailure() => V76Run(V766QueueSaveFailureCase)
V766QueueSaveFailureCase()
{
    q := IQIState(),s := ILBState(),V766Sources(),q.TestService := V766ConflictThird,IQIRun()
    V48Assert(!s.Files.Count && q.Items[1].State="Pending" && q.Items[2].State="Pending","failed batch save never publishes unsaved Done entries")
    V48Assert(FileRead(s.TestPath,"UTF-8")="private external change" && q.Notice!="" && !q.Running,"external edit is preserved and failed queue stops")
    q.Loaded := false,IQILoad(),q.TestService := ""
    V48Assert(q.Items[1].State="Pending" && q.Items[2].State="Pending","failed batch stays retryable after queue reload")
    FileDelete(s.TestPath),IQIRun()
    V48Assert(s.Files.Count=4 && q.Items[4].State="Done","Resume can save the batch after the isolated conflict is resolved")
}
V766ConflictThird(info)
{
    if IQIState().Current=3 {
        if !FileExist(ILBState().TestPath)
            FileAppend("private external change",ILBState().TestPath,"UTF-8")
        ILBCancel()
    }
}

V766QueueCrashRecovery() => V76Run(V766QueueCrashRecoveryCase)
V766QueueCrashRecoveryCase()
{
    q := IQIState(),s := ILBState(),paths := V766Sources(2),q.Items[1].State := "Importing",IQIJournalSave(1)
    job := IGRBegin("private crash window")
    try file := ILBScan(paths[1],"20261005",job)
    finally IGREnd(job)
    q.Checked := [{Index:1,File:file,ScanMs:1,Elapsed:1}]
    ; Simulate process loss before the pending save: only persisted states survive.
    q.Checked := [],q.Loaded := false,IQILoad()
    V48Assert(q.Items[1].State="Pending" && !FileExist(s.TestPath),"interruption before save retries the source instead of claiming completion")
    q.Items[1].State := "Importing",IQIJournalSave(1),ILBCommitFiles(Map(StrLower(file.Path),file))
    ; Simulate loss after catalogue save but before the completion journal append.
    q.Loaded := false,IQILoad(),IQIRun()
    V48Assert(q.Items[1].State="Done" && q.Items[1].Note="Already current" && s.Files.Count=2,"interruption after save rechecks source identity without duplicate catalogue entries")
}

V766QueueDirectRow() => V76Run(V766QueueDirectRowCase)
V766QueueDirectRowCase()
{
    s := ILBState(),q := V763QueueSeed(),q.Items := []
    Loop 5000
        q.Items.Push({Path:A_Temp "\row-" A_Index ".txt",Force:0,Size:2000,State:"Pending",Note:""})
    ILBBuildWindow(),s.Controls["Tabs"].Choose(4),ILBPageChanged(),IQIDraw()
    lv := s.Controls["QueueList"],lv.Modify(2500,"Select Focus Vis"),builds := q.FullRebuilds
    q.Running := true,q.Counts := IQICounts(),IQISetState(12,"Importing",""),IQISetState(12,"Done","Saved"),IQISetState(44,"Failed","Unavailable")
    untouched := q.Items[3999],q.Items[3999] := {} ; catches accidental full-queue traversal
    try IQIDraw(true,12),IQIDraw(true,44)
    finally q.Items[3999] := untouched
    V48Assert(lv.GetText(12,1)="Done" && lv.GetText(44,1)="Failed" && lv.GetNext()=2500 && q.FullRebuilds=builds,"direct row updates preserve all other rows and current selection without scanning them")
    V48Assert(q.Counts.Done=1 && q.Counts.Failed=1 && q.Counts.Pending=4998 && InStr(IQISummary(),"4998 remaining"),"running counters report correct completion and failure totals")
    IQISetState(44,"Pending","Retry"),V48Assert(!q.Counts.Failed && q.Counts.Pending=4999,"retry transition maintains counts")
    actual := IQICounts(),V48Assert(actual.Done=q.Counts.Done && actual.Pending=q.Counts.Pending,"incremental totals match full recount")
    q.Running := false
}

V766QueueFlushEdges() => V76Run(V766QueueFlushEdgesCase)
V766QueueFlushEdgesCase()
{
    q := IQIState(),s := ILBState(),paths := V766Sources(3),text := ""
    Loop 2500
        text .= IPDemoLine(1000+A_Index,"@Private#1","=","Activate") "`n"
    FileDelete(paths[2]),FileAppend(text,paths[2],"UTF-8"),IQIEnqueue([paths[2]])
    FileAppend("unrelated unreadable history",q.TestHistory,"UTF-8")
    probe := {LargeSeen:false},q.TestService := V766LargeProbe.Bind(probe),IQIRun()
    V48Assert(probe.LargeSeen && q.Items[2].Size>=262144 && q.Items[2].State="Done","large boss-free file saves independently and skips irrelevant history")
    V48Assert(s.Files.Count=3 && q.Items[3].State="Done" && FileRead(q.TestHistory,"UTF-8")="unrelated unreadable history","small-large-small sequence retains every source without touching progression")
}
V766LargeProbe(probe,info)
{
    q := IQIState()
    if q.Current=2 && !probe.LargeSeen {
        probe.LargeSeen := true
        V48Assert(q.Items[1].State="Done" && ILBState().Files.Count=1 && !q.Checked.Length,"pending small files are durable before starting a large source")
    }
}

V766QueueFlushDeadline() => V76Run(V766QueueFlushDeadlineCase)
V766QueueFlushDeadlineCase()
{
    q := IQIState(),V766Sources(3),probe := {Expired:false,Seen:false}
    q.TestService := V766DeadlineProbe.Bind(probe),IQIRun()
    V48Assert(probe.Expired && probe.Seen && q.Items[3].State="Done","expired save interval flushes at the next source boundary")
}
V766DeadlineProbe(probe,info)
{
    q := IQIState()
    if q.Current=2 && !probe.Expired {
        probe.Expired := true,q.CheckedAt := A_TickCount-2000
    }
    if q.Current=3 && !probe.Seen {
        probe.Seen := true
        V48Assert(q.Items[1].State="Done" && ILBState().Files.Has(StrLower(q.Items[1].Path)),"expired batch is durable even when the next source is still being read")
    }
}

; Real native file I/O under private diagnostic paths only.
V767JournalBatch() => V76Run(V767JournalBatchCase)
V767JournalBatchCase()
{
    q := V763QueueSeed(),base := q.Original,header := q.JournalOriginal
    q.Items[1].State := "Done",q.Items[1].Note := "Saved ✓",q.Items[1].Size := 1234
    q.Items[2].State := "Importing",q.Items[2].Note := "Checking"
    IQIJournalSaveBatch([1,2]),saved := q.JournalOriginal
    V48Assert(FileRead(IQIPath(),"UTF-8")==base && FileRead(IQIPath() ".journal","UTF-8")==saved,"batch appends preserve base snapshot and exact journal bytes")
    V48Assert(StrSplit(saved,"`n").Length=4,"existing journal format retains one complete line per changed entry")
    q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[1].State="Done" && q.Items[1].Note="Saved ✓" && q.Items[1].Size=1234 && q.Items[2].State="Pending","batch reload preserves Unicode, source size and interrupted-entry recovery")
    q.Items[1].State := "Done",q.Items[2].State := "INVALID"
    V59ExpectError((*)=>IQIJournalSaveBatch([1,2]))
    V48Assert(FileRead(IQIPath() ".journal","UTF-8")==saved && q.JournalOriginal==saved,"invalid later row prevents all journal changes")
    q.Items[2].State := "Pending"
    for indices in [[1,1],[1,0],[1,3],[1,1.5]]
        V59ExpectError((*)=>IQIJournalSaveBatch(indices))
    tooMany := []
    Loop 33
        tooMany.Push(1)
    V59ExpectError((*)=>IQIJournalSaveBatch(tooMany))
    IQIJournalSaveBatch([])
    V48Assert(FileRead(IQIPath() ".journal","UTF-8")==saved,"invalid indices and empty batch do not modify the journal")
    FileAppend("external",IQIPath() ".journal","UTF-8-RAW"),external := FileRead(IQIPath() ".journal","UTF-8")
    V59ExpectError((*)=>IQIJournalSaveBatch([1,2]))
    V48Assert(FileRead(IQIPath() ".journal","UTF-8")==external,"batch retains cross-process journal conflict protection")
}

V767JournalPartialBatch() => V76Run(V767JournalPartialBatchCase)
V767JournalPartialBatchCase()
{
    q := V763QueueSeed(),q.Items[1].State := "Done",q.Items[2].State := "Done",IQIJournalSaveBatch([1,2])
    lines := StrSplit(q.JournalOriginal,"`n"),partial := lines[1] "`n" lines[2] "`n" SubStr(lines[3],1,8)
    FileDelete(IQIPath() ".journal"),FileAppend(partial,IQIPath() ".journal","UTF-8-RAW")
    q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[1].State="Done" && q.Items[2].State="Pending","interrupted multi-row append retains complete rows and retries incomplete rows")
    IQISave(),q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[1].State="Done" && q.Items[2].State="Pending","partial-batch recovery survives the next checkpoint")
}

V767CheckedAckConflict() => V76Run(V767CheckedAckConflictCase)
V767CheckedAckConflictCase()
{
    q := IQIState(),s := ILBState(),paths := V766Sources(2),q.Checked := [],job := IGRBegin("private checked batch")
    try {
        for i,path in paths {
            file := ILBScan(path,"20261005",job)
            q.Checked.Push({Index:i,File:file,ScanMs:1,Elapsed:1})
            q.Items[i].State := "Importing"
        }
    }
    finally IGREnd(job)
    probe := {Force:false,Armed:false,Injected:false,External:""}
    ; Forced retry markers now precede both catalogue writes. Inject the
    ; external journal edit only when that marker is restored after commit,
    ; so this still exercises acknowledgement failure rather than preflight.
    q.Items[1].DefineProp("Force",{Get:(*)=>probe.Force,Set:V767CheckedAckConflictInject.Bind(probe)})
    q.Running := true,q.Counts := IQICounts(),V59ExpectError(IQIFlushChecked)
    external := probe.External
    V48Assert(probe.Injected,"external journal conflict is injected at post-commit acknowledgement")
    V48Assert(s.Files.Count=2 && INLibraryRead(FileRead(s.TestPath,"UTF-8"),s.TestPath).Count=2,"catalogue is saved before acknowledgement is attempted")
    V48Assert(q.Items[1].State="Pending" && q.Items[2].State="Pending" && q.Counts.Done=0 && q.Counts.Pending=2,"failed acknowledgement leaves every affected row retryable with accurate counters")
    V48Assert(q.SaveError!="" && !q.Checked.Length && FileRead(IQIPath() ".journal","UTF-8")==external,"conflicting progress is preserved and failure stops the queue")
    FileDelete(IQIPath() ".journal"),FileAppend(q.JournalOriginal,IQIPath() ".journal","UTF-8-RAW")
    q.Running := false,IQISave(),IQIRun()
    V48Assert(s.Files.Count=2 && q.Items[1].Note="Already current" && q.Items[2].State="Done","retry verifies existing saved sources without duplicate catalogue entries")
}

V767CheckedAckConflictInject(probe,item,value)
{
    probe.Force := value
    if value
        probe.Armed := true
    else if probe.Armed && !probe.Injected {
        FileAppend("external",IQIPath() ".journal","UTF-8-RAW")
        probe.External := FileRead(IQIPath() ".journal","UTF-8"),probe.Injected := true
    }
    return value
}

; Native process tests use private sources, outputs, history and runtime copies.
V768Run(fn) => V76Run(V768RunInner.Bind(fn))
V768RunInner(fn)
{
    w := IQWState(),old := w.Clone()
    try {
        w.Active := false,w.Root := "",w.Jobs := Map(),w.Notice := "",w.Loaded := true,w.Mode := 4
        w.TestWorkers := 4,w.TestRuntime := A_ScriptDir "\Iris_Test_Runtime.ahk",w.MinBytes := 0
        fn.Call()
    }
    finally {
        IQWStop()
        for key,value in old.OwnProps()
            w.%key% := value
    }
}

V768Wait(worker)
{
    deadline := A_TickCount+15000
    while worker.Process.Status=0 && A_TickCount<deadline
        Sleep(10)
    V48Assert(worker.Process.Status=1,"private helper completed within diagnostic timeout")
}

V768WorkerParity() => V768Run(V768WorkerParityCase)
V768WorkerParityCase()
{
    w := IQWState(),s := ILBState(),q := IQIState(),fixture := V68ReviewFile(),expected := Map(),paths := V766Sources(5)
    try {
        for path in paths
            FileCopy(fixture.Path,path,true)
        IQIEnqueue(paths)
        job := IGRBegin("private serial comparison")
        try {
            for path in paths
                expected[StrLower(path)] := ILBScan(path,"20261005",job)
        }
        finally IGREnd(job)
        IQIRun()
        V48Assert(w.Started=5 && w.Peak=4 && w.Notice="" && q.Notice="","bounded pool replenishes a fifth source without serial fallback")
        V48Assert(IGVJson(ILBPack(s.Files))==IGVJson(ILBPack(expected)),"worker Library totals and phase/challenge summaries exactly match serial scan")
        history := IGVReadHistory(q.TestHistory),wanted := Map()
        for path,file in expected
            wanted := IUPMerge(wanted,file.ProgressionPulls,IGVSourceIdentity(path).Session,file.Date).History
        V48Assert(history.Count=wanted.Count && history.Count=5,"all worker boss pulls reach Progression")
        for key,entry in history
            V48Assert(IGVJson(IGVPackPull(entry.Pull))==IGVJson(IGVPackPull(wanted[key].Pull)),"worker phases, attendance and complete death recaps match serial scan")
        V48Assert(!w.Active && w.Root="" && !w.Jobs.Count,"completed pool releases children and temporary files")
        IQIEnqueue(paths),IQIRun()
        V48Assert(w.Started=0 && q.Items[5].Note="Already current","unchanged sources retain existing skip detection without spawning workers")
    }
    finally FileDelete(fixture.Path)
}

V768WorkerPause() => V768Run(V768WorkerPauseCase)
V768WorkerPauseCase()
{
    w := IQWState(),q := IQIState(),s := ILBState(),paths := V766Sources(6),probe := {Processes:[],Seen:false}
    q.TestService := V768PauseProbe.Bind(probe),IQIRun()
    V48Assert(probe.Seen && s.Files.Count=1 && q.Items[1].State="Done" && q.Items[2].State="Pending","Pause retains saved checks and leaves unfinished workers pending")
    for process in probe.Processes
        V48Assert(process.Status=1,"Pause stops only the owned helper processes")
    V48Assert(!w.Jobs.Count && w.Root="" && !w.Active,"Pause releases worker ownership and files")
    q.TestService := "",IQIRun()
    V48Assert(s.Files.Count=6 && q.Items[6].State="Done" && w.Notice="","Resume completes pending recordings without duplicates")
}
V768PauseProbe(probe,info)
{
    if IQIState().Current=2 && !probe.Seen {
        probe.Seen := true
        for index,worker in IQWState().Jobs
            probe.Processes.Push(worker.Process)
        ILBCancel()
    }
}

V768WorkerFailure() => V768Run(V768WorkerFailureCase)
V768WorkerFailureCase()
{
    q := IQIState(),s := ILBState(),w := IQWState(),V766Sources(4),probe := {Seen:false,Processes:[]}
    q.TestService := V768FailureProbe.Bind(probe),IQIRun()
    V48Assert(probe.Seen && w.Notice!="" && s.Files.Count=4 && q.Items[4].State="Done","terminated worker falls back without losing work: " IGVJson([probe.Seen,w.Notice,s.Files.Count,q.Items[4].State,q.Notice]))
    for process in probe.Processes
        V48Assert(process.Status=1,"owned helpers have all finished when the queue completes")
    V48Assert(q.Notice="" && !w.Active && w.Root="","single-log retry completes normally and releases temporary ownership")
}
V768FailureProbe(probe,info)
{
    w := IQWState()
    if IQIState().Current=1 && !probe.Seen {
        probe.Seen := true
        for index,worker in w.Jobs
            probe.Processes.Push(worker.Process)
        worker := w.Jobs[1]
        if worker.Process.Status=0
            worker.Process.Terminate()
        V768Wait(worker)
        ; A tiny helper can finish between Status and Terminate. Remove its
        ; completion checksum too so this always exercises missing output.
        if FileExist(worker.Folder "\result.sha256")
            FileDelete(worker.Folder "\result.sha256")
    }
}

V768WorkerChangedSource() => V768Run(V768WorkerChangedSourceCase)
V768WorkerChangedSourceCase()
{
    w := IQWState(),paths := V766Sources(1),IQWBegin(),worker := w.Jobs[1]
    V768Wait(worker),original := IQWReadResult(worker),text := FileRead(paths[1],"UTF-8")
    text := StrReplace(text,"00:00:01.000","00:00:02.000")
    FileDelete(paths[1]),FileAppend(text,paths[1],"UTF-8"),FileSetTime(original.File.Modified,paths[1],"M")
    V48Assert(FileGetSize(paths[1])=original.File.Size && FileGetTime(paths[1],"M")=original.File.Modified,"source mutation deliberately retains size and timestamp")
    job := IGRBegin("private changed-source check")
    try file := IQWScan(1,paths[1],"20261005",job)
    finally IGREnd(job)
    V48Assert(file.Digest!=original.File.Digest && file.Digest=IPCHashFile(paths[1]) && w.Notice!="","prefetched source digest is rechecked and changed source is read afresh")
}

V768WorkerCorruptResult() => V768Run(V768WorkerCorruptResultCase)
V768WorkerCorruptResultCase()
{
    w := IQWState(),paths := V766Sources(1),IQWBegin(),worker := w.Jobs[1]
    V768Wait(worker),FileAppend("corrupt",worker.Folder "\result.bin","UTF-8-RAW")
    V59ExpectError((*)=>IQWReadResult(worker))
    job := IGRBegin("private corrupt-result fallback")
    try file := IQWScan(1,paths[1],"20261005",job)
    finally IGREnd(job)
    V48Assert(file.Digest=IPCHashFile(paths[1]) && w.Notice!="" && w.Active && !w.Jobs.Count,"incomplete output retries its source without disabling the healthy pool")
}

V768WorkerBuildGuard() => V768Run(V768WorkerBuildGuardCase)
V768WorkerBuildGuardCase()
{
    w := IQWState(),s := ILBState(),q := IQIState(),V766Sources(2)
    w.TestRuntime := A_Temp "\mismatched-worker-runtime.ahk",FileAppend("; a different build",w.TestRuntime,"UTF-8")
    try {
        IQIRun()
        V48Assert(w.Started=0 && w.Notice!="" && s.Files.Count=2 && q.Items[2].State="Done","a changed installed build cannot run against the old parent's parser state")
    }
    finally FileDelete(w.TestRuntime)
}

V768WorkerControls() => V768Run(V768WorkerControlsCase)
V768WorkerControlsCase()
{
    w := IQWState(),s := ILBState(),q := IQIState(),ILBBuildWindow()
    s.Controls["Tabs"].Choose(4),ILBPageChanged(),control := s.Controls["QueueSpeed"]
    V48Assert(control.Value=4 && control.Enabled,"Maximum is the default import setting")
    control.Choose(2),IQWChoose(control),V48Assert(w.Mode=2,"Balanced is selectable without touching real settings in diagnostics")
    q.Running := true,q.Counts := IQICounts(),IQIDraw(false)
    V48Assert(!control.Enabled,"speed choice is locked while the import owns worker processes")
    control.Choose(1),IQWChoose(control),V48Assert(w.Mode=2,"an in-flight setting event cannot replace the active pool")
    q.Running := false,IQIDraw(false),V48Assert(control.Enabled,"Pause restores speed selection")
    w.Active := true,q.MeasuredFiles := 4,q.ReadBytes := 2000000,q.CurrentBytes := 0,q.Remaining := 4000000,q.Started := A_TickCount-10000
    seconds := IQIEstimate(q,4)
    V48Assert(seconds>=19.9 && seconds<21,"parallel ETA uses measured wall time rather than summing simultaneous scan time")
    w.Active := false
}

V768WorkerEight() => V768Run(V768WorkerEightCase)
V768WorkerEightCase()
{
    w := IQWState(),q := IQIState(),s := ILBState(),w.TestWorkers := 8,V766Sources(10),IQIRun()
    V48Assert(w.Started=10 && w.Peak=8 && w.Notice="" && q.Notice="","eight-worker pool stays bounded and replenishes for ten sources")
    V48Assert(s.Files.Count=10 && q.Items[10].State="Done" && !w.Active && w.Root="","all eight-worker results save and release temporary files")
    V48Assert(IQWLimit(4,32)=8 && IQWLimit(4,4)=4 && IQWLimit(1,32)=1,"normal speed settings respect the requested cap and available logical processors")
}

V768WorkerParentClosed() => V768Run(V768WorkerParentClosedCase)
V768WorkerParentClosedCase()
{
    w := IQWState(),paths := V766Sources(1),IQWBegin(),original := w.Jobs[1]
    V768Wait(original)
    folder := w.Root "\job-999",DirCreate(folder),request := IGJParse(FileRead(original.Folder "\request.json","UTF-8"))
    anchorPath := w.Root "\anchor.ahk"
    FileAppend("#Requires AutoHotkey v2.0`n#NoTrayIcon`nSleep(60000)`nExitApp()`n",anchorPath,"UTF-8")
    anchor := ComObject("WScript.Shell").Exec(IrisTestQuote(A_AhkPath) " /ErrorStdOut=CP0 " IrisTestQuote(anchorPath)),child := ""
    try {
        request[9] := anchor.ProcessID
        ; Enough harmless activations to observe parent loss during an active scan.
        text := ""
        Loop 100000
            text .= IPDemoLine(1000+A_Index,"@Private#1","=","Activate") "`n"
        FileDelete(paths[1]),FileAppend(text,paths[1],"UTF-8")
        request[10] := FileGetSize(paths[1]),request[11] := FileGetTime(paths[1],"M")
        FileAppend(IGVJson(request),folder "\request.json","UTF-8")
        FileCopy(original.Folder "\worker.ahk",folder "\worker.ahk")
        child := ComObject("WScript.Shell").Exec(IrisTestQuote(A_AhkPath) " /ErrorStdOut=CP0 " IrisTestQuote(folder "\worker.ahk"))
        deadline := A_TickCount+10000
        while !FileExist(folder "\progress.json") && child.Status=0 && A_TickCount<deadline
            Sleep(10)
        V48Assert(FileExist(folder "\progress.json") && child.Status=0,"orphan check starts with a running native scan")
        anchor.Terminate(),V768Wait({Process:child})
        V48Assert(child.ExitCode!=0 && InStr(FileRead(folder "\error.txt","UTF-8"),"instance has closed"),"worker exits when its parent is lost, without publishing a result")
        V48Assert(!FileExist(folder "\result.bin"),"orphaned scan never claims a complete saved result")
    }
    finally {
        if IsObject(child) && child.Status=0
            child.Terminate()
        if anchor.Status=0
            anchor.Terminate()
    }
}

; Private catalogue fixtures only: none of their original combat logs exist.
V769Run(fn) => V75LibraryRun(V769RunInner.Bind(fn))
V769RunInner(fn)
{
    v := IGVState(),old := v.Clone(),q := IQIState(),oldRunning := q.Running
    try {
        v.Busy := false,v.Gui := "",v.Team := "*",q.Running := false
        s := ILBState(),ILBLoad(),SplitPath(s.TestPath,,&dir),files := Map(),history := Map()
        first := dir "\combat_2026-10-03_20_00_00_001.txt",second := dir "\combat_2026-10-04_20_00_00_002.txt"
        missing := dir "\combat_2026-10-05_20_00_00_003.txt",copy := dir "\Archive-combat_2026-10-03_20_00_00_001.txt"
        for i,path in [first,second,missing] {
            date := IGVSourceIdentity(path).Date,session := IGVSourceIdentity(path).Session,pulls := []
            for n in (i=1 ? [1,2] : [3]) {
                p := V635Pull(n),lib := V75LibraryPull(n,p.Start)
                for name in ["Boss","Name","Area","Mode","Start","End"]
                    lib.%name% := p.%name%
                pulls.Push(lib)
                if i<3 {
                    key := i "-" n
                    history[key] := V645HistoryEntry(key,session,date,i=1 ? "Old team" : "Other team",p)
                }
            }
            files[StrLower(path)] := ILBFile(path,date,100,date "210000",Format("{:064}",0),pulls)
        }
        duplicate := files[StrLower(first)].Clone(),duplicate.Path := copy,files[StrLower(copy)] := duplicate
        empty := dir "\combat_2026-10-06_20_00_00_004.txt"
        files[StrLower(empty)] := ILBFile(empty,"20261006",20,"20261006210000",Format("{:064}",0),[])
        history["outside"] := V645HistoryEntry("outside","manual-only.txt","20261002","Keep",V635Pull(4))
        ILBCommit(files),path := s.TestPath ".history.json",IGVWriteHistory(history,path)
        fn.Call({Path:path,Files:files,History:history,First:first,Second:second,Missing:missing})
    }
    finally {
        ILPTState().Busy := false,ILPTClose()
        if IPMUiHandle(v.Gui)
            IGVClose()
        for key,value in old.OwnProps()
            v.%key% := value
        q.Running := oldRunning
    }
}

V769Row(snapshot,path)
{
    id := IGVSourceIdentity(path),wanted := IGVJson([id.Date,IHMCanonicalSession(id.Session,id.Date)])
    for row in snapshot.Rows
        if row.Id=wanted
            return row
    throw Error("Missing fixture row")
}

V769LibraryTeamModel() => V769Run(V769LibraryTeamModelCase)
V769LibraryTeamModelCase(f)
{
    snap := ILPTRead(f.Path),a := V769Row(snap,f.First),b := V769Row(snap,f.Second),missing := V769Row(snap,f.Missing)
    V48Assert(snap.Rows.Length=4 && a.Files.Count=2 && a.Count=2,"recording copies collapse; the shared picker includes Progression-only recordings")
    V48Assert(a.Ready && b.Ready && !missing.Ready && missing.Count=0,"only complete existing Progression matches are ready")
    V48Assert(snap.Rows[1].Date="20261005" && snap.Rows[3].Date="20261003","library dates stay in descending order, including missing Progression rows")
    V48Assert(InStr(a.Names,"Archive-combat_") && InStr(a.Names,"combat_") && a.Teams="Old team","original filenames and existing team are visible")
    newer := f.History.Clone(),newer.Delete("1-2"),rows := ILPTRows(f.Files,newer)
    for row in rows
        if row.Id=a.Id
            V48Assert(!row.Ready && row.Missing.Count=1,"partial recording does not silently assign only its available pull")
    newer := f.History.Clone(),e := newer["1-1"].Clone(),e.Session := SubStr(e.Session,10),newer["1-1"] := e
    rows := ILPTRows(f.Files,newer)
    for row in rows
        if row.Id=a.Id
            V48Assert(row.Ready && row.Count=2,"legacy and date-qualified history sessions resolve to one library recording")
}

V769LibraryTeamSave() => V769Run(V769LibraryTeamSaveCase)
V769LibraryTeamSaveCase(f)
{
    snap := ILPTRead(f.Path),a := V769Row(snap,f.First),b := V769Row(snap,f.Second),library := FileRead(ILBPath(),"UTF-8")
    result := ILPTAssign(snap,[a.Id,b.Id],"  Sophie's Ráîd  ",f.Path),saved := IGVReadHistory(f.Path)
    V48Assert(result.Logs=2 && result.Count=3 && result.Changed=3 && saved.Count=4,"multi-selection tags all chosen captures without adding or deleting pulls")
    for key,e in saved {
        V48Assert(e.Team=(key="outside" ? "Keep" : "Sophie's Ráîd"),"only the chosen recordings receive the normalized Unicode team")
        V48Assert(IGVJson(IGVPackPull(e.Pull))==IGVJson(IGVPackPull(f.History[key].Pull)),"HP, phases, players and death data are unchanged")
    }
    V48Assert(FileRead(ILBPath(),"UTF-8")==library && !FileExist(f.First) && !FileExist(f.Second),"team assignment does not rewrite the Library or require raw combat logs")
    snap := ILPTRead(f.Path),before := FileRead(f.Path,"UTF-8")
    result := ILPTAssign(snap,[a.Id,b.Id],"Sophie's Ráîd",f.Path)
    V48Assert(result.Changed=0 && FileRead(f.Path,"UTF-8")==before,"assigning the same team is a no-op")
    ILPTAssign(snap,[a.Id],"",f.Path),saved := IGVReadHistory(f.Path)
    V48Assert(saved["1-1"].Team="" && saved["1-2"].Team="" && saved["2-3"].Team="Sophie's Ráîd","blank team removes the tag from the selected recording only")
}

V769LibraryTeamGuards() => V769Run(V769LibraryTeamGuardsCase)
V769LibraryTeamGuardsCase(f)
{
    snap := ILPTRead(f.Path),id := V769Row(snap,f.First).Id,missing := V769Row(snap,f.Missing).Id,before := FileRead(f.Path,"UTF-8")
    for team in ["*","bad`nname",Format("{:061}",0)]
        V59ExpectError((*)=>ILPTAssign(snap,[id],team,f.Path))
    for ids in [[],[id,id],["unknown"],[id,missing]]
        V59ExpectError((*)=>ILPTAssign(snap,ids,"Raid",f.Path))
    V48Assert(FileRead(f.Path,"UTF-8")==before,"invalid names, stale identities and missing pulls never partially save")
    V59ExpectError((*)=>ILPTRead(A_ScriptDir "\real-history.json"))
    V59ExpectError((*)=>ILPTAssign(snap,[id],"Raid",A_ScriptDir "\real-history.json"))
    newer := IGVReadHistory(f.Path),newer["outside"].Team := "Changed elsewhere",IGVWriteHistory(newer,f.Path),before := FileRead(f.Path,"UTF-8")
    V59ExpectError((*)=>ILPTAssign(snap,[id],"Raid",f.Path))
    V48Assert(FileRead(f.Path,"UTF-8")==before,"stale history cannot replace concurrent team edits")
    snap := ILPTRead(f.Path),FileAppend(" ",ILBPath(),"UTF-8")
    V59ExpectError((*)=>ILPTAssign(snap,[id],"Raid",f.Path))
    V48Assert(FileRead(f.Path,"UTF-8")==before,"changed library requires refresh before applying old selections")
}

V769LibraryTeamWindow() => V769Run(V769LibraryTeamWindowCase)
V769LibraryTeamWindowCase(f)
{
    IPWBuild(),IGVOpen(),s := ILPTBuild(f.Path)
    V48Assert(!DllCall("IsWindowVisible","Ptr",s.Gui.Hwnd) && !s.Controls["Apply"].Enabled,"picker stays hidden in diagnostics and opens with no selected mutation")
    s.Controls["Search"].Value := "2026-10-03",ILPTFilter()
    V48Assert(s.Shown.Length=1,"date search finds the logical recording rather than duplicate file copies")
    s.Controls["List"].Modify(1,"Select"),ILPTSelection(),s.Controls["Team"].Text := "New team"
    V48Assert(s.Controls["Apply"].Enabled && ILPTApply(),"native selector accepts an existing saved recording and a new team")
    V48Assert(IGVState().Source="history" && IGLSameTeam(IGVState().Team,"New team") && IGVReadHistory(f.Path)["1-1"].Team="New team","graph switches to the chosen team after the save")
    s.Controls["Search"].Value := "New team",ILPTFilter()
    V48Assert(s.Shown.Length=1 && s.Shown[1].Teams="New team","team search reflects the saved assignment")
    s.Controls["Search"].Value := "2026-10-05",ILPTFilter(),s.Controls["List"].Modify(1,"Select"),ILPTSelection()
    V48Assert(!s.Controls["Apply"].Enabled && InStr(s.Controls["Summary"].Text,"missing"),"missing saved pulls have an explicit disabled action")
    for size in [[820,440],[900,540],[1920,1080]] {
        ILPTResize(s.Gui,0,size[1],size[2]),s.Controls["List"].GetPos(&x,&y,&w,&h)
        s.Controls["Summary"].GetPos(&sx,&sy),s.Controls["Team"].GetPos(&tx,&ty,&tw,&th),s.Controls["Apply"].GetPos(&ax,&ay)
        V48Assert(y+h<sy && tx+tw<ax && ay>sy && ty+th<size[2]-52,"table, selection summary and team controls fit supported window sizes: " IGVJson([size,y,h,sy,tx,tw,ax,ay,ty,th]))
    }
    hwnd := s.Gui.Hwnd,IGVClose()
    V48Assert(!DllCall("IsWindow","Ptr",hwnd) && !IsObject(s.Gui),"closing Progression cleans up its library picker")
}

V769LibraryTeamBusy() => V769Run(V769LibraryTeamBusyCase)
V769LibraryTeamBusyCase(f)
{
    s := ILPTBuild(f.Path),s.Controls["Search"].Value := "2026-10-03",ILPTFilter()
    s.Controls["List"].Modify(1,"Select"),ILPTSelection(),s.Controls["Team"].Text := "Blocked"
    before := FileRead(f.Path,"UTF-8"),q := IQIState(),q.Running := true
    V48Assert(!ILPTApply() && !ILPTRefresh() && FileRead(f.Path,"UTF-8")==before,"active bulk import blocks picker writes and refresh without stopping live work")
    V59ExpectError((*)=>ILPTBuild(f.Path)),q.Running := false
    V48Assert(ILPTApply(),"team assignment succeeds after the import is paused")
    s.Busy := true,V48Assert(!ILPTClose(),"picker cannot close during its own write"),s.Busy := false
}

V769LibraryTeamEmpty() => V769Run(V769LibraryTeamEmptyCase)
V769LibraryTeamEmptyCase(f)
{
    ILBCommit(Map()),s := ILPTBuild(f.Path)
    V48Assert(s.Rows.Length=3 && s.Rows[1].Ready && !s.Controls["Apply"].Enabled,"saved Progression recordings remain available with an empty Library; selection is still required")
    ILPTClose(),emptyPath := f.Path ".empty",IGVWriteHistory(Map(),emptyPath),s := ILPTBuild(emptyPath)
    V48Assert(!s.Rows.Length && InStr(s.Controls["Summary"].Text,"No saved boss logs") && !s.Controls["Apply"].Enabled,"empty saved catalogues explain what to do and cannot save")
    ILPTClose(),FileDelete(ILBPath()),FileAppend("broken",ILBPath(),"UTF-8")
    V59ExpectError((*)=>ILPTBuild(f.Path))
    V48Assert(!IPMUiHandle(ILPTState().Gui) && FileRead(ILBPath(),"UTF-8")="broken","corrupt library remains untouched and does not open a misleading empty picker")
}

V78114TeamRepeat() => V769Run(V78114TeamRepeatCase)
V78114TeamRepeatCase(f)
{
    s := ILPTBuild(f.Path),s.Controls["Search"].Value := "2026-10-03",ILPTFilter()
    s.Controls["List"].Modify(1,"Select"),ILPTSelection()
    for team in ["Ráîd one","Ráîd two",""] {
        s.Controls["Team"].Text := team
        V48Assert(ILPTApply(),"repeat assignment works without refreshing or reopening the picker")
        V48Assert(s.Shown.Length=1 && ILPTSelected().Length=1 && s.Controls["Apply"].Enabled,"search and selection survive a successful assignment")
        V48Assert(s.Shown[1].Teams=(team="" ? "Untagged" : team),"visible current-team label matches the committed assignment")
        V48Assert(IGLHistoryUnchanged(s.Snapshot.Original,f.Path),"next assignment uses the newly committed history generation")
        saved := IGVReadHistory(f.Path)
        V48Assert(saved["1-1"].Team=team && saved["1-2"].Team=team && saved["2-3"].Team="Other team","only selected recording is updated on repeated saves")
    }
    before := FileRead(f.Path,"UTF-8")
    V48Assert(ILPTApply() && FileRead(f.Path,"UTF-8")==before,"reassigning the existing blank team does not rewrite the file")
    FileAppend(" ",f.Path,"UTF-8"),before := FileRead(f.Path,"UTF-8"),s.Controls["Team"].Text := "Stale"
    V48Assert(!ILPTApply() && FileRead(f.Path,"UTF-8")==before,"stale snapshot failure preserves external changes")
    for name in ["Apply","Refresh","List","Team","Search","Close"]
        V48Assert(s.Controls[name].Enabled,"controls recover after a failed assignment: " name)
    V48Assert(!s.Busy && !IGVState().Busy && InStr(s.Controls["Status"].Text,"Team not changed"),"failure clears both busy guards and reports the failed save")
}

V78114TeamService() => V769Run(V78114TeamServiceCase)
V78114TeamServiceCase(f)
{
    snap := ILPTRead(f.Path),id := V769Row(snap,f.First).Id,stages := Map()
    result := ILPTAssign(snap,[id],"Responsive",f.Path,V78114TeamCollectStage.Bind(stages))
    V48Assert(stages.Has("reading") && stages.Has("packing") && stages.Has("verifying"),"team save services pending messages through reading, packing and verification")
    updated := ILPTAssignedSnapshot(snap,result,[id])
    V48Assert(IGLHistoryUnchanged(updated.Original,f.Path),"committed snapshot uses writer receipt")
    fresh := ILPTRead(f.Path)
    V48Assert(V78114TeamEqual(updated.History,fresh.History),"in-place picker history agrees with a fresh catalogue read")
    V48Assert(V78114TeamEqual(updated.Rows,fresh.Rows),"in-place picker rows agree with a fresh catalogue read")
    state := {Changed:false},before := FileRead(f.Path,"UTF-8")
    V59ExpectError((*)=>ILPTAssign(fresh,[id],"Must not save",f.Path,V78114TeamConcurrent.Bind(state,f.Path)))
    V48Assert(state.Changed && FileRead(f.Path,"UTF-8")==before " ","a write during a cooperative read cannot be overwritten")
}

V78114TeamCollectStage(stages,stage := "reading")
{
    stages[stage] := true
    ILPTSaveService({Tick:A_TickCount-51},stage)
}

V78114TeamConcurrent(state,path,stage := "reading")
{
    if !state.Changed
        FileAppend(" ",path,"UTF-8"),state.Changed := true
}

V78114TeamEqual(a,b)
{
    if Type(a)!=Type(b)
        return false
    if !IsObject(a)
        return a==b
    if a is Map {
        if a.Count!=b.Count
            return false
        for k,v in a
            if !b.Has(k) || !V78114TeamEqual(v,b[k])
                return false
    } else if a is Array {
        if a.Length!=b.Length
            return false
        for k,v in a
            if !V78114TeamEqual(v,b[k])
                return false
    } else {
        for k,v in b.OwnProps()
            if !a.HasOwnProp(k)
                return false
        for k,v in a.OwnProps()
            if !b.HasOwnProp(k) || !V78114TeamEqual(v,b.%k%)
                return false
    }
    return true
}

; Fake-clock audio queues and private INIs only. No voice, live timer or hotkey.
V7610PullLengths() => V657WithPull(V7610PullLengthsCase)
V7610PullLengthsCase()
{
    global IPull,Audio,testClock
    IPull := IPullNewState()
    V48Assert(IPull.Seconds=3 && IPullStart() && V657PullQueued()[1].Phrase="Pulling in 3","new installs and missing preferences start with the requested three-second default")
    IPullCancel()
    Loop 5 {
        seconds := A_Index,IPull.Seconds := seconds,testClock += 10000
        V48Assert(IPullStart() && IPull.RunSeconds=seconds,"each supported length starts a fresh anchored run")
        start := testClock
        Loop seconds {
            beat := seconds-A_Index+1,testClock := start+(A_Index-1)*1000,IPullTick(),items := V657PullQueued()
            V48Assert(items.Length=1 && items[1].PullBeat=beat,"one current number exists at each chosen countdown second")
            item := items[1]
            V48Assert(item.Phrase=(A_Index=1 ? "Pulling in " seconds : String(beat)) && item.PullOpening=(A_Index=1),"first phrase and later digits agree with the selected length")
            V48Assert(item.Expires=testClock+1000 && item.DispatchBy=testClock+350 && AudioItemEnabled(item),"short countdowns keep the original speech dispatch and expiry deadlines")
            IPullTick(),V48Assert(V657PullQueued().Length=1,"repeat polling cannot duplicate a number"),Audio.Queue := []
        }
        testClock := start+seconds*1000,IPullTick()
        V48Assert(!IPull.Active && !V657PullQueued().Length && IPull.Status="Pull!","countdown ends at exactly its chosen duration with no extra spoken number")
    }
}

V7610PullLengthChanges() => V657WithPull(V7610PullLengthChangesCase)
V7610PullLengthChangesCase()
{
    global IPull,Audio,testClock
    IPull.Seconds := 3,IPullStart(),start := testClock,old := V657PullQueued()[1]
    IPull.Seconds := 1,testClock := start+1000,IPullTick(),item := V657PullQueued()[1]
    V48Assert(IPull.RunSeconds=3 && item.Phrase="2" && AudioItemEnabled(item),"editing the preference cannot shorten a countdown already running")
    V48Assert(!AudioItemEnabled(old),"previous opener stays expired after the preference changes")
    testClock := start+3000,IPullTick(),testClock += 20,IPullStart()
    V48Assert(IPull.RunSeconds=1 && V657PullQueued()[1].Phrase="Pulling in 1","next deliberate start uses the new length")
    IPullCancel(),IPull.Seconds := 3,testClock += 10000,IPullStart(true),start := testClock
    V48Assert(IPull.Preview && IPull.RunSeconds=3,"preview uses the same chosen length")
    testClock := start+1351,IPullTick()
    V48Assert(!V657PullQueued().Length,"late two is skipped instead of being queued behind the opener")
    testClock := start+2000,IPullTick()
    V48Assert(V657PullQueued().Length=1 && V657PullQueued()[1].Phrase="1","next punctual number keeps the original three-second schedule")
    testClock := start+15000,IPullTick()
    V48Assert(!IPull.Active && !V657PullQueued().Length,"a delayed preview never catches up after its deadline")
}

V7610PullLengthPreferences() => V657PullUIIsolated(V7610PullLengthPreferencesCase)
V7610PullLengthPreferencesCase(path)
{
    global IPull,Audio
    queued := Audio.Queue.Length,foreground := WinExist("A"),IPullLoadSettings(),IPullOpen()
    V48Assert(IPull.Seconds=3 && IPull.SecondsControl.Value=3 && !FileExist(path),"opening the length setting defaults to three without writing preferences")
    V48Assert(!DllCall("IsWindowVisible","Ptr",IPull.Gui.Hwnd) && WinExist("A")=foreground,"native length dialog stays hidden and preserves gameplay focus")
    IniWrite("preserve",path,"OtherFeature","Voice"),IniWrite(2,path,"IrisPullTimer","KeyChoice")
    Loop 5 {
        seconds := A_Index,IPull.SecondsControl.Choose(seconds)
        V48Assert(IPullChangeSeconds(IPull.SecondsControl) && IniRead(path,"IrisPullTimer","Seconds")=String(seconds),"choosing a length saves it immediately to its own preference")
        IPull.Seconds := 0,IPullLoadSettings(),IPullOpen()
        V48Assert(IPull.Seconds=seconds && IPull.SecondsControl.Value=seconds && InStr(IPull.DescriptionControl.Text,"Pulling in " seconds),"saved length reloads into the selector and its description")
    }
    V48Assert(IPull.KeyChoice=2 && IniRead(path,"OtherFeature","Voice")="preserve","duration changes preserve the chosen shortcut and unrelated voice preferences")
    for value in ["",0,-1,6,"1.0","invalid"] {
        IniWrite(value,path,"IrisPullTimer","Seconds"),before := FileRead(path),IPullLoadSettings()
        V48Assert(IPull.Seconds=3 && FileRead(path)=before,"invalid saved duration falls back to three without overwriting the INI")
    }
    IPullOpen(),IPull.SecondsControl.GetPos(&x,&y,&w,&h),IPull.KeyControl.GetPos(&kx,&ky,&kw,&kh)
    IPull.DescriptionControl.GetPos(&dx,&dy,&dw,&dh),IPull.StatusControl.GetPos(&sx,&sy,&sw,&sh)
    V48Assert(dy+dh<y && y+h<ky && ky+kh<198 && sy+sh<382,"countdown setting fits above the unchanged shortcut controls")
    V48Assert(Audio.Queue.Length=queued && IPull.Registered=0 && !IPull.Active,"editing duration never binds a key or starts speech")
}

V7610PullOpeningSpeech()
{
    Loop 5 {
        seconds := A_Index
        V48Assert(IPullOpeningSpeech({Kind:"Pull",PullOpening:true,PullBeat:seconds})='<rate absspeed="1">Pulling in ' seconds '</rate>',"every supported opener keeps the short per-utterance speech rate")
    }
    for item in [{Kind:"Manual",PullOpening:true,PullBeat:3},{Kind:"Pull",PullOpening:false,PullBeat:2},
        {Kind:"Pull"},{Kind:"Pull",PullOpening:true,PullBeat:6},{Kind:"Pull",PullOpening:true,PullBeat:0},
        {Kind:"Pull",PullOpening:true,PullBeat:'3</rate><volume level="0">'}]
        V48Assert(IPullOpeningSpeech(item)="","non-opening or invalid values cannot enter trusted speech markup")
}

; Native diagnostics: synthetic recordings, hidden windows and private files.
; No gameplay input, hotkey registration, audio playback or installed settings.
V77Event(at,source,target,id,apply := false,name := "Example")
{
    raw := apply ? IAEffectLine(at,source,target,name,id) : IPDemoLine(at,source,target,"Activate",0,false,-1,name,id)
    ev := IPParseLine(raw),ev.Analysis := {At:at,Seq:at,Accepted:true,Kind:apply ? "Effect gained" : "Ability activated",Raw:raw,GCD:"Unknown"}
    return ev
}

V77UtilityData()
{
    a := "@Alpha#1",b := "@Beta#2",rows := [V77Event(1000,a,"=","880189122805760"),
        V77Event(1100,a,b,"880189122806402",true),V77Event(1100,a,b,"880189122806402",true),
        V77Event(1150,a,a,"880189122806402",true),V77Event(1200,b,"=","880189122805760"),
        V77Event(1300,b,a,"880189122806402",true),V77Event(7000,a,"=","880189122805760"),
        V77Event(9000,a,"=","4258842326073344",false,"Advanced Kyrprax Critical Adrenal")]
    return {Start:0,Last:20000,Rows:rows,Seed:Map()}
}

V77UtilityEvidence()
{
    d := V77UtilityData(),before := IGVJson([d.Rows.Length,d.Rows[1].Analysis.Raw]),uses := ITRModel(d)
    V48Assert(uses.Length=4,"duplicate effect lines do not invent repeated utility uses")
    V48Assert(uses[1].Recipients.Count=2 && uses[1].Confirmed && uses[1].Cast,"observed Rebounder recipients corroborate this caster")
    V48Assert(uses[2].Recipients.Count=1 && uses[2].PlayerKey="@Beta#2","nearby casters keep separate recipients")
    V48Assert(!uses[3].Confirmed && !uses[3].Recipients.Count,"Sonic Missile alone is not proof of Rebounder")
    V48Assert(uses[4].Group="adrenal","known adrenal activations appear on the same timeline")
    d.Rows[1].Analysis.Accepted := false,uses := ITRModel(d)
    V48Assert(!uses[1].Cast && uses[1].Confirmed,"effect-only evidence remains labelled as an application")
    d.Rows[1].Analysis.Accepted := true
    V48Assert(before=IGVJson([d.Rows.Length,d.Rows[1].Analysis.Raw]),"review leaves the input journal unchanged")
}

V77UtilityWindow() => V61Hidden(V77UtilityWindowCase)
V77UtilityWindowCase()
{
    try {
        ITRBuild(V77UtilityData()),s := ITRState()
        V48Assert(s.Controls["List"].GetCount()=4,"native utility table contains all four uses")
        ITRSelect(s.Controls["List"],1,true)
        V48Assert(InStr(s.Controls["Detail"].Value,"Beta") && InStr(s.Controls["Detail"].Value,"within 2 seconds"),"selection explains recipients and nearby utility uses")
        ITRResize(s.Gui,0,1500,920),s.Controls["List"].GetPos(&x,&y,&w,&h),s.Controls["Detail"].GetPos(&dx,&dy)
        V48Assert(y+h<dy && w=1468,"maximized-style layout keeps details below the table")
        ITRPage(1),V48Assert(s.Page=0,"short fight cannot navigate into a blank minute")
    }
    finally ITRClose()
    V48Assert(!IsObject(ITRState().Data),"closing releases the retained dataset")
}

V77RotationAlignment()
{
    d := V69PlannerData(),actor := d.Players[1].Key,q := IANewQuery(d,actor)
    first := V77Event(d.Start+5000,"Synthetic Tyth {4078419339902976}:900","=","12345")
    second := V77Event(d.Start+12000,"Synthetic Tyth {4078419339902976}:900","=","12345")
    d.Rows.Push(second,first),side := {Data:d,Query:q,Model:IAVRModel(d,q)}
    a := IRCPRows(side,"12345",1),b := IRCPRows(side,"12345",2),missing := IRCPRows(side,"12345",3)
    V48Assert(a.Origin=d.Start+5000 && b.Origin=d.Start+12000,"anchor occurrences follow recorded time even with late rows")
    V48Assert(a.Rows.Length=side.Model.Casts.Length && a.Rows[1].Seconds=(a.Rows[1].Cast.At-a.Origin)/1000,"alignment keeps all selected player casts and signed times")
    V48Assert(missing.Origin=-1 && !missing.Rows.Length,"missing occurrence produces no fabricated anchor")
    V48Assert(IRCPRows(side,"",1).Origin=q.From,"default aligns at the selected phase start")
    choices := IRCPAnchors(Map("A",side,"B",side))
    V48Assert(ArrayContainsText(choices.Keys,"12345"),"common enemy cast is offered by exact ID")
}

V77RotationWindow() => V68ReviewUIFixture(V77RotationWindowCase)
V77RotationWindowCase(v)
{
    d := V68ReviewUIDataset({}),actor := d.Players[1].Key
    for which in ["A","B"]
        v.%which%.Data := d,v.%which%.DataKey := v.%which%.Key,v.%which%.Player := actor,v.%which%.Phase := 1
    try {
        V48Assert(IRCPOpen(),"native comparison opens from two already loaded pulls")
        s := IRCPState(),V48Assert(s.Controls["A"].GetCount()>0 && s.Controls["A"].GetCount()=s.Controls["B"].GetCount(),"both sides show the complete matching rotation")
        IRCPResize(s.Gui,0,1600,950),s.Controls["A"].GetPos(&x,&y,&w,&h),s.Controls["B"].GetPos(&bx,&by,&bw,&bh)
        V48Assert(x+w<bx && bx+bw<1600,"side-by-side tables fit a large window")
        IRCPSelect("A",s.Controls["A"],1,true),V48Assert(InStr(s.Controls["Detail"].Value,"["),"selected ability reveals its original record")
    }
    finally IRCPClose()
}

V77ArchiveModel() => V769Run(V77ArchiveModelCase)
V77ArchiveModelCase(f)
{
    snap := IFASnapshot(f.Files,f.History),selected := IFACandidates(snap,"Old team","","",""),unknown := 0
    V48Assert(selected.Length=2,"team search selects two pulls without duplicating Archive copies")
    for item in snap.Rows
        if !IsObject(item.History)
            unknown += 1
    V48Assert(unknown=1,"library-only pull remains explicitly without saved evidence")
    p := selected[1].History.Pull,p.TimingComplete := true,p.Partial := false,p.Included := true,p.FirstAt := p.Start+1000
    p.Players := Map("one",{Name:"Sophie",First:p.FirstAt},"two",{Name:"Other",First:p.FirstAt})
    a := IFAMatch(selected[1],"First death","sophie")
    V48Assert(a.Known && a.Match && InStr(a.Text,"1.0s"),"case-insensitive first-death search supports tied victims")
    p.Partial := true,V48Assert(!IFAMatch(selected[1],"First death","Sophie").Known,"partial recording cannot establish first death")
    V48Assert(!IFAMatch({History:""},"Saved phase","Burn").Known,"missing phases are unavailable rather than a negative match")
    V48Assert(!IFACandidates(snap,"Old team","","20261005","20261006").Length,"date bounds restrict archive search")
}

V77ArchiveWindow() => V769Run(V77ArchiveWindowCase)
V77ArchiveWindowCase(f)
{
    try {
        IFABuild(IFASnapshot(f.Files,f.History)),s := IFAState(),s.Controls["Text"].Value := "Burn",IFASearch()
        V48Assert(InStr(s.Controls["Status"].Text,"matching pulls"),"saved phase search completes inside the native window")
        s.Controls["From"].Value := "not a date",IFASearch()
        V48Assert(!s.Busy && s.Controls["Search"].Enabled,"invalid date releases the UI without beginning a scan")
        IFAResize(s.Gui,0,1400,900),s.Controls["List"].GetPos(&x,&y,&w,&h),s.Controls["Open"].GetPos(&ox,&oy)
        V48Assert(y+h<oy,"archive paging stays below results")
    }
    finally IFAClose()
}

V77SetupRoundtrip()
{
    timer := V65IDef("Portable"),timer.Audio := "private-clip.wav",timer.CountdownVoice := "private-voice",timer.Volume := 80
    call := ICLDefinitions()[1],plan := V69PlannerPlan(),text := ITSPack("Team",[timer],[[call.Id,1]],[plan]),p := ITSParse(text,[])
    V48Assert(!InStr(text,"private-clip") && !InStr(text,"private-voice"),"export contains neither local clips nor voice selections")
    V48Assert(p.Timers.Length=1 && p.Calls[1][1]=call.Id && p.Plans[1].Player=plan.Player,"portable selections survive native XML and JSON round-trip")
    V48Assert(timer.Audio="private-clip.wav" && timer.Volume=80,"export does not mutate original timer preferences")
    merged := ITSMergeTimers([timer],p.Timers)
    V48Assert(merged[1].Audio=timer.Audio && merged[1].CountdownVoice=timer.CountdownVoice && merged[1].Volume=80,"replacing a timer preserves local audio")
    newTimer := ITSMergeTimers([],p.Timers)[1]
    V48Assert(newTimer.Audio="" && newTimer.CountdownVoice="","new imported timers bring no private audio settings")
    extra := V69PlannerPlan("two"),extra.Offset := 9,mergedPlans := ITSMergePlans([plan],[extra])
    V48Assert(mergedPlans.Length=2 && mergedPlans[1].Offset=plan.Offset,"unselected local assignments survive")
}

V77SetupRejects()
{
    timer := V65IDef("Hotkey"),timer.Trigger.Type := "HOTKEY",timer.Trigger.HotkeyKey := "F1",bad := false
    try ITSPack("Team",[timer],[],[])
    catch Error
        bad := true
    V48Assert(bad,"gameplay hotkey timers cannot enter a portable pack")
    valid := IGJParse(ITSPack("Test",[],[],[])),valid[5] := [["voice",1]],bad := false
    try ITSParse(IGVJson(valid),[])
    catch Error
        bad := true
    V48Assert(bad,"audio master and arbitrary INI keys are not shareable callout IDs")
    valid[5] := [],valid[4] := '<!DOCTYPE x [<!ENTITY y SYSTEM "file:///secret">]><x>&y;</x>',bad := false
    try ITSParse(IGVJson(valid),[])
    catch Error
        bad := true
    V48Assert(bad,"timer XML cannot resolve external entities")
    linked := V65IDef("Child","Test","Absent"),bad := false
    try ITSMergeTimers([],[linked])
    catch Error
        bad := true
    V48Assert(bad,"missing timer dependencies cannot be applied silently")
}

V77SetupStorage()
{
    root := V635Temp(),path := root "\settings.ini",old := "[Audio]`r`nDevice=Keep me`r`n[Shortcuts]`r`nPull=^F9`r`n",call := ICLDefinitions()[1]
    try {
        FileAppend(old,path,"UTF-8-RAW"),ITSApplyCalls([[call.Id,1]],path)
        V48Assert(IniRead(path,"Audio","Device")="Keep me" && IniRead(path,"Shortcuts","Pull")="^F9","callout import preserves unrelated audio and shortcut settings")
        V48Assert(IniRead(path,call.Section,call.IniKey)=1 && ITSReadText(path ".bak")=old,"selected callout saved with the original file backed up")
        before := ITSReadText(path),bad := false
        try ITSSaveText(path,"bad",old)
        catch Error
            bad := true
        V48Assert(bad && ITSReadText(path)=before,"stale snapshot cannot overwrite newer preferences")
    }
    finally {
        ILPTPrivatePath(root),DirDelete(root,true)
    }
}

V77SetupWindow() => V61Hidden(V77SetupWindowCase)
V77SetupWindowCase()
{
    try {
        ITSOpen(),s := ITSState(),V48Assert(s.Controls["List"].GetCount()>30,"share picker contains the callout catalogue")
        V48Assert(!ITSSelected().Length,"nothing is exported or applied by default")
        ITSCheck(true),V48Assert(ITSSelected().Length=s.Items.Length,"check all selects the visible portable items")
        ITSCheck(false),V48Assert(!ITSSelected().Length,"clear checks returns to an empty selection")
        ITSResize(s.Gui,0,1600,900),s.Controls["List"].GetPos(&x,&y,&w,&h),s.Controls["Timers"].GetPos(&bx,&by)
        V48Assert(y+h<by,"share buttons do not overlap a tall list")
    }
    finally ITSClose()
}

V77Titles() => V769Run(V77TitlesCase)
V77TitlesCase(f)
{
    snap := IFASnapshot(f.Files,f.History),p := snap.Rows[1].Library.Pull,scope := {Key:p.Area "|" p.Mode,Area:p.Area,Mode:p.Mode,Bosses:Map(p.Boss,p.Name,"absent","Another boss")}
    for item in snap.Rows {
        item.Library.Pull.Partial := false,item.Library.Pull.Result := "No kill"
        if item.Teams.Length && item.Teams[1].Team="Old team"
            item.Library.Pull.Result := "Kill"
    }
    people := ITCModel(snap,"Old team",scope,Map()),count := 0
    for key,person in people {
        V48Assert(person.Kills.Count=1 && !person.Confirmed,"recorded clears never imply title completion or missing boss kills")
        count += 1
    }
    V48Assert(count>0,"team attendees become individual checklist rows")
    V48Assert(!ITCModel(snap,"Not this team",scope,Map()).Count,"unrelated teams cannot acquire clear credit")
    notes := Map(ITCKey("Old team",scope.Key,"manual:New toon"),{Team:"Old team",Scope:scope.Key,Actor:"manual:New toon",Name:"New toon",Confirmed:1})
    restored := ITCParse(ITCPack(notes)),model := ITCModel(snap,"Old team",scope,restored)
    V48Assert(model["manual:New toon"].Confirmed && !model["manual:New toon"].Kills.Count,"manual title confirmation remains independent of combat-log evidence")
    for item in snap.Rows
        item.Library.Pull.Partial := true
    for key,person in ITCModel(snap,"Old team",scope,Map())
        V48Assert(!person.Kills.Count,"partial pulls never grant recorded clears")
}

V77TitleWindow() => V769Run(V77TitleWindowCase)
V77TitleWindowCase(f)
{
    snap := IFASnapshot(f.Files,f.History),p := snap.Rows[1].Library.Pull,scope := {Key:p.Area "|" p.Mode,Area:p.Area,Mode:p.Mode,Name:"Test raid",Bosses:Map(p.Boss,p.Name)},path := f.Path ".titles.json"
    try {
        ITCBuild(snap,Map(scope.Key,scope),path),s := ITCState(),s.Controls["Name"].Value := "New toon",ITCAdd()
        V48Assert(FileExist(path) && s.Notes.Count=1,"adding a manual character persists only the private checklist")
        ITCResize(s.Gui,0,1450,900),s.Controls["List"].GetPos(&x,&y,&w,&h),s.Controls["Confirm"].GetPos(&cx,&cy)
        V48Assert(y+h<cy,"checklist controls remain below the boss matrix")
        V48Assert(s.Controls["List"].GetCount("Col")=4,"each scope boss has a separate visible column")
    }
    finally ITCClose()
}

V77SavedPhases()
{
    p := V635Pull(),p.Boss := "G-TY",p.Area := "833571547775765",p.Mode := "836045448953655",p.Group := p.Boss "|" p.Area "|" p.Mode
    p.Included := true,p.Ended := true,IGPYDemoPhases(p,["tyth","burn"])
    item := {History:V645HistoryEntry("phase","fixture","20261003","A",p)}
    result := IFAMatch(item,"Saved phase","burn")
    V48Assert(result.Known && result.Match && InStr(result.Text,"Burn (1)"),"search uses recorded phase counts, not inferred HP thresholds")
    result := IFAMatch(item,"Saved phase","Magma")
    V48Assert(result.Known && !result.Match,"a valid ledger can establish a genuinely absent phase")
    p.Progress.Parsely.Key := "old-schema"
    V48Assert(!IFAMatch(item,"Saved phase","Burn").Known,"old incompatible phase metadata remains unavailable")
}

V77ArchiveMechanicScan() => V68ReviewRun(V77ArchiveMechanicScanCase)
V77ArchiveMechanicScanCase()
{
    f := V68ReviewFile(),lib := {Path:f.Path,Pull:{Name:"Fixture",Mode:f.Entry.Pull.Mode,Result:"No kill"},Date:"20261003"}
    item := {Library:lib,History:f.Entry,Teams:[f.Entry]}
    try {
        IFABuild({Rows:[item],Teams:Map("", "Untagged")}),s := IFAState()
        s.Controls["Kind"].Choose(3),s.Controls["Text"].Value := "990000000000011",IFASearch()
        V48Assert(s.Results.Length=1 && InStr(s.Results[1].Evidence,"20 recorded matches"),"archive UI scans the original fixture and returns the exact matched fight")
        V48Assert(s.Results[1].Library=lib && !IGRIsBusy(),"open-result identity and private scan ownership survive")
        s.Controls["Text"].Value := "not present",IFASearch()
        V48Assert(!s.Results.Length && s.Controls["Status"].Text="0 matching pulls.","verified zero results differ from missing evidence")
    }
    finally IFAClose(),FileDelete(f.Path)
}

V77BuiltinSetup()
{
    existing := IRTBDefinitions(),d := existing[1],incoming := IRTIClone(d),incoming.Enabled := !d.Enabled
    d.Audio := "keep-local",d.CountdownVoice := "keep-voice",incoming.Color := "123456"
    pack := ITSParse(ITSPack("Built-in",[incoming],[],[]),existing),merged := ITSMergeTimers(existing,pack.Timers)
    V48Assert(merged[1].Enabled=incoming.Enabled && merged[1].Color="123456","selected built-in appearance and enabled setting import correctly")
    V48Assert(merged[1].Builtin && merged[1].Audio="keep-local" && merged[1].CountdownVoice="keep-voice","built-in code and local audio remain local")
    V48Assert(merged.Length=existing.Length && d.Enabled!=incoming.Enabled,"merging does not drop other built-ins or mutate the source")
}

V77TitleScopes()
{
    scopes := ITCScopes(),gods := scopes.Get("833571547775765|836045448953655","")
    V48Assert(IsObject(gods) && gods.Bosses.Count=5 && gods.Bosses.Has("G-TY") && gods.Bosses.Has("G-IZ"),"Gods checklist contains all five distinct bosses in the exact raid/difficulty")
    V48Assert(scopes.Count>=8,"checklist is available across recognised raid instances")
    expected := Map("ec",4,"tfb",5,"snv",7,"df",5,"dp",5,"gods",5,"dxun",6,"r4",4)
    for key,raid in IRNCatalog()
        V48Assert(scopes[raid.AreaIds[1] "|" raid.ModeIds[1]].Bosses.Count=expected[key],"all required encounters appear for " key)
    bad := false
    try ITCParse('["IrisTitleChecklist",2,[]]')
    catch Error
        bad := true
    V48Assert(bad,"unsupported checklist version is never overwritten")
}

; Manual isolated diagnostics only. No settings, audio, input or normal GUI.
V771WipeBase(capture := false, recovery := true)
{
    s := IPNewData("Synthetic wipe recovery")
    if capture
        s.AnalysisCapture := IACaptureNew(0,20000)
    V51Feed(s,0,"Enter",0,V56Who(),"=")
    V51Feed(s,1000,"Damage",100,V56Who(),V56Boss(900,"2017170045272064"))
    V51Feed(s,1500,"Death",0,V56Boss(900,"2017170045272064"),V56Who(0))
    V51Feed(s,1700,"Heal",20,"@Healer#7713","@Peer#7712",false,10)
    V51Feed(s,1800,"Damage",25,V56Boss(900,"2017170045272064"),"@Peer#7712")
    V51Feed(s,1801,"Death",0,V56Boss(900,"2017170045272064"),"@Peer#7712")
    V51Feed(s,1900,"Death",0,V56Who(0),"=")
    if recovery
        V51Feed(s,10000,"Heal",200,"@Healer#7713",V56Who(),false,100)
    return s
}

V771Reset(s)
{
    V51Feed(s,12000,"Enter",0,V56Who(),"=")
    V51Feed(s,12100,"Damage",50,V56Who(),V56Boss(950,"2017170045272064",57))
    return s.Segments[1]
}

V771Recovery()
{
    s := V771WipeBase(),seg := V771Reset(s)
    V48Assert(s.Segments.Length=2 && seg.End=1801,"reset excludes recovery healing and duplicate corpse death")
    V48Assert(!seg.Terminal && seg.FinishAt<0 && !seg.Partial,"wipe stays a complete unsuccessful attempt")
    V48Assert(seg.Totals["@Healer#7713"].Heal=20 && seg.Totals["@Healer#7713"].Effective=10,"in-fight healing retained, recovery healing removed")
    V48Assert(seg.Totals["@Peer#7712"].Taken=25 && seg.Totals["@Peer#7712"].Deaths=1,"incoming damage and final death retained")
    V48Assert(seg.Totals[IPActor(V56Who()).Key].Deaths=1,"duplicate respawn death is excluded")
    V48Assert(IPRCompact(seg).TotalDeaths=2 && IPRCompact(seg).End=1801,"compact Progression uses corrected time and deaths")
    V48Assert(s.Current.Start=12000 && V564Damage(s)=50,"next pull starts independently")
}

V771Continuity()
{
    s := V771WipeBase()
    V51Feed(s,12000,"Enter",0,V56Who(),"=")
    V51Feed(s,12100,"Damage",50,V56Who(),V56Boss(850,"2017170045272064"))
    V48Assert(s.Segments.Length=1 && s.Current.Start=0 && V564Damage(s)=150,"combat revival retains one pull")
    V48Assert(s.Current.Totals["@Healer#7713"].Heal=220,"continued fight retains intervening healing")
    V48Assert(s.Current.Last=12100,"long phase does not truncate at an earlier death")
}

V771Guards()
{
    s := V771WipeBase(),seg := s.Current
    IPFinalizeData(s,"snapshot")
    V48Assert(seg.End=10000 && seg.Partial,"snapshot without reset evidence remains complete evidence, marked partial")
    s := V771WipeBase()
    V51Feed(s,12000,"Enter",0,V56Who(),"=")
    V51Feed(s,30000,"Heal",20,"@Healer#7713",V56Who(),false,10)
    V48Assert(s.Segments[1].Partial && s.Segments[1].End=10000,"unresolved re-entry is not a proved wipe endpoint")
    s := V564Base(false,false)
    V51Feed(s,10000,"Heal",200,"@Healer#7713",V56Who(),false,100)
    V51Feed(s,12000,"Enter",0,V56Who(),"=")
    V51Feed(s,12100,"Activate",0,V56Boss(1000,"9999999999999999"),"=")
    V48Assert(s.Segments[1].End=10000,"unclassified encounters keep existing handling")
    s := V564Base(true,false)
    V51Feed(s,2000,"Death",0,V56Who(),V56Boss(0,"2017170045272064"))
    V51Feed(s,2500,"Damage",50,V56Who(),V56Boss(0,"2017170045272064"))
    V51Feed(s,10000,"Enter",0,V56Who(),"=")
    V48Assert(s.Segments[1].Terminal && s.Segments[1].End=2500,"confirmed kill tail stays unchanged")
}

V771FinalEvents()
{
    s := V771WipeBase(false,false)
    ; Same-ms final heal is accepted even when physically after the Death.
    V51Feed(s,1801,"Heal",30,"@Healer#7713","@Peer#7712",false,0)
    V51Feed(s,10000,"Heal",200,"@Healer#7713",V56Who(),false,100)
    seg := V771Reset(s)
    V48Assert(seg.End=1801 && seg.Totals["@Healer#7713"].Heal=50,"same-ms healing included, later speculative healing discarded")
    s := V771WipeBase()
    V51Feed(s,11000,"Damage",500,V56Boss(900,"2017170045272064"),"@Peer#7712")
    seg := V771Reset(s)
    V48Assert(seg.End=1801 && seg.Totals["@Peer#7712"].Taken=25,"incoming corpse hit does not extend the wipe")
    s := V771WipeBase()
    V51Feed(s,10500,"Activate",0,"@Peer#7712|(0,0,0,0)|(100/100)","=")
    V51Feed(s,11000,"Death",0,V56Boss(900,"2017170045272064"),"@Peer#7712")
    seg := V771Reset(s)
    V48Assert(seg.End=11000 && IPRCompact(seg).TotalDeaths=3,"a recorded new life and later death remain in the attempt")
}

V771AnalysisMembership()
{
    s := V771WipeBase(true),seg := V771Reset(s),included := 0,recovery := 0
    for row in s.AnalysisCapture.Rows {
        if !seg.AnalysisAccepted.Has(row.Analysis.Seq)
            continue
        included += 1
        if row.Analysis.At>1801
            recovery += 1
    }
    V48Assert(included>0 && recovery=0,"Analysis accepted record membership excludes the same recovery tail")
}

V771RosterReset()
{
    for size in [8,16] {
        for missing in [false,true] {
            s := IPNewData("Synthetic full-roster reset")
            s.ModeId := size=8 ? "836045448953655" : "836045448953656"
            V51Feed(s,0,"Enter",0,V56Who(),"=")
            Loop size {
                who := A_Index=1 ? V56Who() : "@Member#771" A_Index
                V51Feed(s,1000+A_Index,"Damage",100,who,V56Boss(900,"2017170045272064"))
            }
            Loop size-(missing ? 1 : 0) {
                who := A_Index=1 ? V56Who(0) : "@Member#771" A_Index
                V51Feed(s,2000+A_Index,"Death",0,V56Boss(900,"2017170045272064"),who)
            }
            line := "[00:00:02.100] [" V56Who(0) "] [" V56Boss(1000,"2017170045272064",57) "] [] [Event {836045448945472}: TargetSet {836045448953668}]"
            IPFeedLine(s,line)
            V51Feed(s,2200,"Activate",0,V56Who(),"=")
            V51Feed(s,2300,"Death",0,V56Who(0),"=")
            V51Feed(s,10000,"Heal",200,V56Who(),"=",false,100)
            seg := V771Reset(s)
            V48Assert(seg.End=(missing ? 2300 : 2000+size),"full roster plus new boss excludes respawn death; missing death cannot prove it")
            V48Assert(IPRCompact(seg).TotalDeaths=(missing ? size : size),"only supported deaths included")
        }
    }
}

V771SavedRefresh()
{
    s := V771WipeBase(),old := IPRCompact(s.Current)
    old.Ended := true,old.End := 10000
    m := IGLMerge(Map(),[old],"recording","20261002","Team A")
    prior := m.History.Clone(),seg := V771Reset(s),p := IPRCompact(seg)
    updated := IUPMerge(prior,[p],"recording","20261002")
    V48Assert(updated.History.Count=1 && updated.Updated=1 && updated.Added=0,"shorter corrected pull updates existing history without duplication")
    for key,e in updated.History
        V48Assert(e.Team="Team A" && e.Pull.End=1801,"reindex preserves team and stores corrected endpoint")
    for key,e in prior
        e.Pull.Included := false
    kept := IUPMerge(prior,[p],"recording","20261002")
    for key,e in kept.History
        V48Assert(!e.Pull.Included && e.Team="Team A","manual exclusions preserved on reindex")
}

; Native manual diagnostics. Synthetic text and private temporary catalogues only.
V773JsonSpans()
{
    for length in [0,1,4095,4096,4097,16383,16384,20000] {
        prefix := ""
        Loop length
            prefix .= "x"
        for ending in ["",Chr(34),Chr(92),"`n",Chr(0x1F33A),"\" Chr(34) "tail"] {
            value := prefix ending,text := IGVJson([value,"next",42])
            V48Assert(V639Equal(IGJParse(text),[value,"next",42]),"chunk edges preserve escapes, Unicode and following tokens")
        }
        V48Assert(V639Reject(Chr(34) prefix "`t" Chr(34)),"raw control at each chunk boundary is rejected")
    }
    text := '["a",["b",2],{"nested":"c"}]',probe := {Count:0}
    parsed := IGJParse(text,(*)=>probe.Count+=1)
    V48Assert(probe.Count>0 && V639Equal(parsed,ParseJson(text)),"optional checkpoint preserves nested arrays and maps")
}

V773CheckpointStop(*)
{
    throw Error("Private checkpoint cancellation")
}

V773ReadCheckpoints()
{
    rows := []
    Loop 8000
        rows.Push([A_Index,"source-" A_Index,"Raïd " Chr(34) "\path",12.5])
    text := IGVJson(rows),before := text,probe := {Count:0}
    parsed := IGJParse(text,(*)=>probe.Count+=1)
    V48Assert(probe.Count>10 && V639Equal(rows,parsed),"large saved-data read yields multiple times without losing rows")
    V59ExpectError((*)=>IGJParse(text,V773CheckpointStop))
    V48Assert(text==before,"cancellation leaves the input unchanged")
    ; Nested parsing owns its own checkpoint cursor and cannot reset the parent.
    nested := {Count:0}
    parsed := IGJParse(text,V773NestedRead.Bind(nested))
    V48Assert(nested.Count=probe.Count && V639Equal(rows,parsed),"reentrant independent read keeps its own checkpoint state")
}
V773NestedRead(probe)
{
    probe.Count += 1
    V48Assert(IGJParse('["inner",3]')[2]=3,"nested reader stays independent")
}

V773LibraryCheckpoints() => V75LibraryRun(V773LibraryCheckpointsCase)
V773LibraryCheckpointsCase()
{
    s := ILBState(),ILBLoad(),files := V75LibraryFiles(),ILBCommit(files),before := s.Original,revision := s.Revision
    file := ILBFile(A_Temp "\checkpoint.txt","20261005",1,"20261005120000",Format("{:064}",0),[V75LibraryPull()])
    V59ExpectError((*)=>ILBCommitFile(file,V773CheckpointStop))
    V48Assert(s.Original==before && s.Revision=revision && FileRead(s.TestPath,"UTF-8")==before,"canceled preparation publishes neither file nor memory state")
    probe := {Count:0},ILBCommitFile(file,(*)=>probe.Count+=1)
    V48Assert(probe.Count>=2 && s.Files.Count=2 && FileRead(s.TestPath ".bak","UTF-8")==before,"successful cooperative save preserves previous snapshot")
    V48Assert(ILBSerialize(s.Files,(*)=>0)==IGVJson(ILBPack(s.Files)),"cooperative library serialization preserves exact bytes")
    V48Assert(ILBSerialize(Map(),(*)=>0)==IGVJson(ILBPack(Map())),"empty catalogue representation is unchanged")
}

V773HistoryCheckpoints() => V76Run(V773HistoryCheckpointsCase)
V773HistoryCheckpointsCase()
{
    path := IQIHistory(),history := V644StorageHistory(),probe := {Count:0}
    IGVWriteHistory(history,path)
    before := FileRead(path,"UTF-8"),copy := IGVReadHistory(path,(*)=>probe.Count+=1)
    V48Assert(copy.Count=history.Count && probe.Count>=2,"history decode and validation both service the caller")
    V59ExpectError((*)=>IGVReadHistory(path,V773CheckpointStop))
    V48Assert(FileRead(path,"UTF-8")==before,"canceled history read leaves all saved bytes intact")
}

; Native manual regressions; private catalogues and synthetic combat only.
V774LibraryResults() => V75LibraryRun(V774LibraryResultsCase)
V774LibraryResultsCase()
{
    files := V75LibraryFiles()
    key := "",f := ""
    for path,entry in files {
        key := path,f := entry
        break
    }
    f.Pulls[2].Result := "Incomplete",f.Pulls[2].Partial := 1
    legacy := IGVJson(ILBPack(files)),saved := ILBParse(legacy),p := saved[key].Pulls[2]
    V48Assert(p.Result="No kill" && p.Partial=1,"legacy outcome normalizes while recording-coverage flag is preserved")
    for actor,totals in f.Pulls[2].Players
        for field,value in totals.OwnProps()
            V48Assert(p.Players[actor].%field%=value,"normalization preserves player " field)
    V48Assert(p.Start=f.Pulls[2].Start && p.End=f.Pulls[2].End,"normalization keeps exact timing")
    rows := ILBRows(saved)
    V48Assert(ILBFilter(rows,"","","","No kill").Length=1,"old incomplete entry appears under No kill filter")
    V48Assert(ILBPerformance(rows,"@Sophie#1","G-TY","836045448953655","123","No kill").Length=0,"uncertain duration stays excluded from comparable performance")
    s := ILBState(),FileAppend(legacy,s.TestPath,"UTF-8"),ILBLoad()
    V48Assert(FileRead(s.TestPath,"UTF-8")==legacy && s.Files[key].Pulls[2].Result="No kill","opening old library displays No kill without rewriting it or reading source logs")
    fixture := V68ReviewFile()
    try {
        seg := fixture.State.Segments[fixture.State.Segments.Length]
        seg.Partial := true,seg.Terminal := false,seg.FinishAt := -1
        V48Assert(ILBFight(seg).Result="No kill" && ILBFight(seg).Partial=1,"new partial non-kill retains coverage separately")
        seg.Terminal := true,seg.FinishAt := seg.Last,seg.WipeEnded := true
        V48Assert(ILBFight(seg).Result="No kill","confirmed wipe is still No kill")
        seg.WipeEnded := false
        V48Assert(ILBFight(seg).Result="Kill" && ILBFight(seg).Partial=1,"confirmed kill is not changed by recording coverage")
    }
    finally FileDelete(fixture.Path)
    ILBBuildWindow(),s.Controls["Result"].Choose("No kill"),ILBRefresh()
    V48Assert(s.Controls["Result"].Text="No kill" && s.Controls["List"].GetCount()=1,"hidden library renders legacy row with No kill selected")
    t := IPNewImportTiming(1,0,0),t.CacheSaveMs := 1250,t.CatalogueSaveMs := 2500
    report := IPImportTimingReport(t,1000)
    V48Assert(InStr(report,"cache write: 1.250 seconds") && InStr(report,"summaries and save: 2.500 seconds"),"timing report exposes separate finishing costs")
}

V774SharedSave() => V75LibraryRun(V774SharedSaveCase)
V774SharedSaveCase()
{
    s := ILBState(),ILBLoad(),ILBCommit(V75LibraryFiles())
    priorKey := "",prior := ""
    for path,entry in s.Files {
        priorKey := path,prior := entry
        break
    }
    path := A_Temp "\combat_2026-10-06_00_00_00_001.txt"
    file := ILBFile(path,"20261006",42,"20261006120000",Format("{:064}",0),[V75LibraryPull()])
    file.ProgressionPulls := ["private transient field"],before := s.Original
    IUPSaveLibraryBatch(Map(StrLower(path),file))
    V48Assert(s.Files.Count=2 && s.Files[priorKey]=prior,"normal import keeps existing validated entries without reconstructing the whole catalogue")
    V48Assert(FileRead(s.TestPath ".bak","UTF-8")==before && !s.Files[StrLower(path)].HasOwnProp("ProgressionPulls"),"old snapshot remains backed up and new entry is normalized")
    file.Pulls[1].Players[file.Pulls[1].Recorder].Damage := 1
    V48Assert(s.Files[StrLower(path)].Pulls[1].Players[file.Pulls[1].Recorder].Damage=120000,"incoming caller mutation cannot alter published data")
    before := s.Original,file.Pulls[1].Result := "invalid"
    V59ExpectError((*)=>IUPSaveLibraryBatch(Map(StrLower(path),file)))
    V48Assert(FileRead(s.TestPath,"UTF-8")==before && s.Original==before,"invalid new data preserves prior snapshot")
    file.Pulls[1].Result := "No kill",FileAppend(" ",s.TestPath,"UTF-8"),external := FileRead(s.TestPath,"UTF-8")
    V59ExpectError((*)=>IUPSaveLibraryBatch(Map(StrLower(path),file)))
    V48Assert(FileRead(s.TestPath,"UTF-8")==external && s.Original==before,"optimized normal save still refuses concurrent changes")
}

; Private temporary files and hidden controls only. No archive or live state writes.
V775BlankQueue() => V76Run(V775BlankQueueCase)
V775BlankMigration() => V76Run(V775BlankMigrationCase)
V775BlankRetry() => V76Run(V775BlankRetryCase)
V775BlankDisplay() => V76Run(V775BlankDisplayCase)

V775BlankPath(number,bytes := -1)
{
    SplitPath(ILBState().TestPath,,&folder)
    path := folder "\combat_2026-10-06_12_00_00_" Format("{:03}",number) ".txt"
    if bytes>=0 {
        f := FileOpen(path,"w","UTF-8-RAW")
        try {
            if bytes
                f.RawWrite(Buffer(bytes,0))
        }
        finally f.Close()
    }
    return path
}

V775BlankQueueCase()
{
    q := IQIState(),s := ILBState(),empty := V775BlankPath(1,0),zeros := V775BlankPath(2,3282)
    text := V775BlankPath(3,0),missing := V775BlankPath(4),late := V775BlankPath(5)
    FileAppend("unfinished text",text,"UTF-8-RAW"),IQIEnqueue([empty,zeros,text,missing,late])
    V48Assert(q.Items[1].State="Skipped" && q.Items[1].Note="Empty file","zero bytes are skipped immediately")
    V48Assert(q.Items[4].State="Pending","nonexistent file is not confused with zero bytes")
    V775BlankPath(5,0),IQIRun()
    V48Assert(q.Items[2].State="Skipped" && q.Items[2].Note="No combat data (zero-filled file)","small null-filled rejected source is skipped")
    V48Assert(q.Items[3].State="Failed" && q.Items[3].Note=IQINoRecordsError(),"unterminated real text remains a retryable error")
    V48Assert(q.Items[4].State="Failed" && q.Items[5].State="Skipped","missing remains Failed and newly empty source is skipped on Resume")
    counts := IQICounts()
    V48Assert(counts.Skipped=3 && counts.Failed=2 && counts.Done=0 && counts.Pending=0,"skips have their own completed queue count")
    V48Assert(q.Remaining=0 && !s.Files.Count && !FileExist(q.TestHistory),"blank sources create no library or progression records")
    q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[1].State="Skipped" && q.Items[2].State="Skipped","skips survive saved queue reload")
    IQIEnqueue([empty],true)
    V48Assert(q.Items[1].State="Skipped","even forced re-add leaves unchanged empty file skipped")
    FileAppend(IPDemoLine(1000,"@Private#1","=","Activate") "`n",empty,"UTF-8-RAW")
    IQIEnqueue([empty]),IQIRun()
    V48Assert(q.Items[1].State="Done" && s.Files.Count=1,"explicitly re-added grown file imports normally")
    large := V775BlankPath(6,65537)
    V48Assert(!IsObject(IQIBlankFile(large,true)),"zero-byte detection is bounded to small rejected files")
}

V775BlankMigrationCase()
{
    q := IQIState(),empty := V775BlankPath(1,0),zeros := V775BlankPath(2,3282)
    text := V775BlankPath(3,0),missing := V775BlankPath(4),done := V775BlankPath(5,0)
    FileAppend("some real text",text,"UTF-8-RAW"),IQIEnqueue([empty,zeros,text,missing,done])
    for item in q.Items
        item.State := "Failed",item.Note := IQINoRecordsError()
    IQISave(),q.Items[5].State := "Done",q.Items[5].Note := "Already current",IQIJournalSave(5)
    snapshot := FileRead(IQIPath(),"UTF-8"),journal := FileRead(IQIPath() ".journal","UTF-8")
    q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[1].State="Skipped" && q.Items[2].State="Skipped","legacy empty and zero-filled failures migrate on load")
    V48Assert(q.Items[3].State="Failed" && q.Items[4].State="Failed","migration retains unreadable text and missing file failures")
    V48Assert(q.Items[5].State="Done","journal completion takes precedence over older failed snapshot")
    V48Assert(q.Original=snapshot && FileRead(IQIPath(),"UTF-8")=snapshot && FileRead(IQIPath() ".journal","UTF-8")=journal,"read-only migration preserves exact snapshot and journal on disk")
    IQIJournalSave(1),q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[1].State="Skipped","journal replays Skipped state")
    IQISave(),q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && IQICounts().Skipped=2 && IQICounts().Done=1,"next normal save persists migrated states")
}

V775BlankRetryCase()
{
    global IP,Audio
    q := IQIState(),s := ILBState(),empty := V775BlankPath(1,0),pending := V775BlankPath(2,0)
    FileAppend(IPDemoLine(1000,"@Private#1","=","Activate") "`n",pending,"UTF-8-RAW"),IQIEnqueue([empty,pending])
    before := FileRead(IQIPath(),"UTF-8"),live := IP.Live,audioQueue := Audio.Queue
    IQIRetry()
    V48Assert(q.Items[1].State="Skipped" && q.Items[2].State="Pending" && !s.Files.Count,"Retry failed cannot resume unrelated pending work when no failures exist")
    V48Assert(FileRead(IQIPath(),"UTF-8")=before && IP.Live=live && Audio.Queue=audioQueue,"empty Retry does not write or touch live/audio state")
    q.Items[1].State := "Failed",q.Items[1].Note := IQINoRecordsError(),IQIRetry()
    V48Assert(q.Items[1].State="Skipped" && q.Items[2].State="Pending","Retry first recognizes old empty failure without sending it to parser")
    q.Items[2].State := "Failed",q.Items[2].Note := "Temporary read failure",IQISave(),IQIRetry()
    V48Assert(q.Items[1].State="Skipped" && q.Items[2].State="Done" && s.Files.Count=1,"real failure retries successfully while empty entry remains skipped")
    q.Items[2].State := "Failed",q.Items[2].Note := "Retry me",IQISave(),FileAppend(" ",IQIPath(),"UTF-8")
    external := FileRead(IQIPath(),"UTF-8"),IQIRetry()
    V48Assert(q.Items[2].State="Failed" && q.Items[2].Note="Retry me" && FileRead(IQIPath(),"UTF-8")=external,"retry save conflict retains retryable status and external contents")
}

V775BlankDisplayCase()
{
    q := IQIState(),s := ILBState(),empty := V775BlankPath(1,0),IQIEnqueue([empty])
    ILBBuildWindow(),s.Controls["Tabs"].Choose(4),IQIDraw(),c := s.Controls
    V48Assert(c["QueueList"].GetText(1,1)="Skipped" && c["QueueList"].GetText(1,4)="Empty file","native queue displays skipped reason")
    V48Assert(InStr(c["QueueNote"].Text,"0 saved, 1 skipped, 0 remaining"),"summary never labels skipped logs as saved")
    V48Assert(!c["QueueRetry"].Enabled && !c["QueueResume"].Enabled,"finished skipped-only queue disables retry and resume")
    missing := V775BlankPath(2),IQIEnqueue([missing]),q.Items[2].State := "Failed",IQIDraw()
    V48Assert(c["QueueRetry"].Enabled && !c["QueueResume"].Enabled,"real failure enables retry only")
    q.Counts := IQICounts(),q.Running := true
    IQISetState(2,"Pending",""),IQISetState(2,"Importing",""),IQISetState(2,"Skipped","Empty file"),IQIDraw(false)
    V48Assert(q.Counts.Skipped=2 && q.Counts.Pending=0 && q.Counts.Failed=0,"running incremental counters include skips")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",s.Gui.Hwnd,"Int"),"queue diagnostic remains hidden")
    q.Running := false
}

V775BossBrowse()
{
    entries := []
    for row in [["G-IZ","Izax"],["G-TY","Tyth"],["G-SC","Scyva"],["G-AE","Aivela and Esne"],["G-NA","Nahut"],
        ["KP-KA","Karagga"],["KP-BO","Bonethrasher"],["KP-JS","Jarg and Sorno"],["KP-FC","Foreman Crusher"],["KP-FA","Fabricator"]]
        entries.Push({Pull:{Boss:row[1],Name:row[2],Group:row[1],Area:"",Mode:"836045448953655"}})
    options := IGVBossBrowseOptions(entries),order := ""
    for option in options
        order .= option.Key " "
    V48Assert(order="KP-BO KP-JS KP-FC KP-FA KP-KA G-TY G-AE G-NA G-SC G-IZ ","shuffled saved sources browse by raid and encounter order")
    V48Assert(IGVBossBrowseOptions(entries,"  gFtM   nIM  ").Length=5,"raid aliases, difficulty and whitespace work together")
    V48Assert(IGVBossBrowseOptions(entries,"A&E")[1].Key="G-AE","common Sisters alias finds the encounter")
    V48Assert(!IGVBossBrowseOptions(entries,"[Tyth]").Length,"search treats regex characters literally")
    V48Assert(IGVBossBrowseOptions(entries,"tyTH")[1].Key="G-TY","boss search is case insensitive")
    variants := []
    for key in ["RAV-TO-V","RAV-SP-V","KP-KA-V","KP-FA-V"]
        variants.Push({Pull:{Boss:key,Name:key,Group:key,Area:"",Mode:"836045448953652"}})
    ordered := IGVBossBrowseOptions(variants)
    V48Assert(ordered[1].Key="KP-FA-V" && ordered[2].Key="KP-KA-V" && ordered[3].Key="RAV-SP-V" && ordered[4].Key="RAV-TO-V","saved Veteran variant IDs use their encounter's raid order")
    V48Assert(IGVBossBrowseOptions(variants,"Ravagers").Length=2,"variant profiles are searchable by full raid name")
    for area in ["833571547775765","833571547775799","3367426158755840","3367421863788544"] {
        for mode in ["836045448953651","836045448953653","836045448953652","836045448953654","836045448953655","836045448953656",""] {
            p := {Mode:mode,Area:area},story := mode="836045448953651" || mode="836045448953653"
            veteran := mode="836045448953652" || mode="836045448953654"
            V48Assert(IGVHiddenDifficulty(p)=(story || (veteran && area="833571547775765")),"8/16 mode filter honors Story and all three Veteran exceptions: " area " / " mode)
        }
    }
}

V775BrowseEntries()
{
    rows := []
    for data in [["G-IZ","Izax","833571547775765","836045448953655"],
        ["G-TY","Tyth","833571547775765","836045448953651"],
        ["G-TY","Tyth","833571547775765","836045448953655"],
        ["R4-IP","IP-CPT","833571547775799","836045448953652"],
        ["TOS-RE","Revan","3367426158755840","836045448953654"],
        ["RAV-TO","Torque","3367421863788544","836045448953652"]] {
        e := V741SavedEntry("G-TY",35,rows.Length+1),p := e.Pull
        p.Boss := data[1],p.Name := data[2],p.Area := data[3],p.Mode := data[4],p.Group := p.Boss "|" p.Area "|" p.Mode
        rows.Push(e)
    }
    return rows
}

V775ProgressionSearch() => V749ProgressionFixture(V775ProgressionSearchCase)
V775ProgressionSearchCase(v)
{
    rows := V775BrowseEntries(),V7432ProgressionSeed(v,rows),before := V741SavedSignature(rows),c := v.Controls
    c["Search"].Value := "tyth",IGVSearchApply()
    V48Assert(v.BossKeys.Length=2 && v.Rows.Length=1 && v.Rows[1].Pull.Mode="836045448953651","native search selects a matching encounter and keeps difficulties separate")
    c["HideLower"].Value := 1,IGVSearchApply()
    V48Assert(v.BossKeys.Length=1 && v.Rows[1].Pull.Mode="836045448953655","hide lower difficulties moves from Story to Master without merging pulls")
    c["Search"].Value := "no such boss",IGVSearchApply()
    V48Assert(!v.BossKeys.Length && !v.Rows.Length && !c["Boss"].Enabled && InStr(c["Status"].Text,"No matching encounters"),"unmatched search clears graph instead of showing unrelated fights")
    V48Assert(v.Team="A" && !c["Team"].Enabled,"empty search results preserve the user's selected team")
    IGVSearchClear()
    V48Assert(v.BossKeys.Length=5 && v.Search="" && v.HideLower,"Clear restores all eligible bosses without resetting difficulty preference")
    c["Search"].Value := "r4",IGVSearchApply()
    V48Assert(v.BossKeys.Length=1 && v.Rows[1].Pull.Boss="R4-IP","R-4 Veteran remains available while hiding lower difficulties")
    c["HideLower"].Value := 0,IGVSearchApply(),IGVSearchClear()
    V48Assert(v.BossKeys.Length=6 && v.Rows[1].Pull.Boss="R4-IP","clear preserves the selected encounter when it still exists")
    V48Assert(V741SavedSignature(rows)=before,"search/filter/order never rewrite saved HP, phase, outcome or team data")
    for dims in [[980,650],[1920,1080]] {
        box := V749ProgressionSetSize(dims[1],dims[2])
        V749ProgressionAssertBounds(v,box,"search " dims[1])
        c["Search"].GetPos(&sx,&sy,&sw,&sh),c["ClearSearch"].GetPos(&cx,&cy,&cw,&ch),c["HideLower"].GetPos(&hx,&hy,&hw,&hh)
        c["Chart"].GetPos(&px,&py)
        V48Assert(sx+sw<=cx && cx+cw<=hx && sy+sh<=py,"search controls fit without overlapping each other or the graph")
        if dims[1]=1920 {
            controls := []
            for name in ["Source","Boss","AddLogs","Refresh","CharacterLabel","Character","TeamLabel","Team","WindowLabel","Window","CycleLabel","Cycle","Search","ClearSearch","HideLower"]
                controls.Push(c[name])
            V7412PlayerControlsPng("progression-search-toolbar.png",v.Gui,controls,0,0,box.W,137)
        }
    }
}

V775BrowsePreferences()
{
    path := A_Temp "\iris-browse-" DllCall("GetCurrentProcessId") "-" A_TickCount ".ini"
    try {
        defaults := IGLReadView(path)
        V48Assert(!defaults.HideLower,"older settings keep every difficulty visible by default")
        v := {Source:"history",Boss:"",Character:"",Team:"*",LastTeam:"",DetailVisible:false,HideLower:true,Window:"all",Cycle:""}
        IGLWriteView(v,path),choice := IGLReadView(path)
        V48Assert(choice.HideLower && choice.Source="history" && choice.Team="*","hide preference survives a private INI round trip")
        v.HideLower := false,IGLWriteView(v,path)
        V48Assert(!IGLReadView(path).HideLower,"showing all difficulties is saved too")
    }
    finally {
        if FileExist(path)
            FileDelete(path)
    }
}

; Large synthetic indexes only; no archive imports, live audio or visible dialogs.
V776ArchiveQueueCapacity() => V76Run(V776ArchiveQueueCapacityCase)
V776ArchiveQueueCapacityCase()
{
    q := IQIState(),IQILoad(),SplitPath(ILBState().TestPath,,&folder)
    Loop 100000
        q.Items.Push({Path:folder "\combat_2024-06-01_12_00_00_" Format("{:06}",A_Index) ".txt",Force:0,Size:1,State:"Pending",Note:""})
    IQISave(),snapshot := q.Original
    V48Assert(StrLen(snapshot)>8388608 && StrLen(snapshot)<33554432,"large archive snapshot crosses old 8 MiB ceiling within bounded new limit")
    q.Items := [],q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items.Length=100000 && IQICounts().Pending=100000,"100,000-source queue survives native save/reload")
    IQISetState(100000,"Done","Saved"),IQIJournalSave(100000),q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[100000].State="Done" && q.Items[99999].State="Pending","journal applies a completion beyond the old index limit without shifting entries")
    before := FileRead(IQIPath(),"UTF-8"),q.Items.Push({Path:folder "\extra.txt",Force:0,Size:0,State:"Pending",Note:""})
    V59ExpectError(IQISave)
    V48Assert(FileRead(IQIPath(),"UTF-8")==before,"over-capacity queue cannot replace the existing snapshot")
    q.Items.Pop(),q.Loaded := false,IQILoad()
    V48Assert(q.Error="" && q.Items[100000].State="Done","last valid queue and journal remain recoverable after overflow")
}

V776ArchiveFolderFiles() => V76Run(V776ArchiveFolderFilesCase)
V776ArchiveFolderFilesCase()
{
    SplitPath(ILBState().TestPath,,&folder)
    backup := folder "\Copied Documents",DirCreate(backup),DirCreate(backup "\Nested")
    first := backup "\combat_2023-03-15_00_15_01_558850.txt"
    second := backup "\Archive-combat_2025-08-17_01_00_00_001.log"
    ignored := backup "\notes.txt",nested := backup "\Nested\combat_2024-01-01_00_00_00_001.txt"
    for path in [first,second,ignored,nested]
        FileAppend("private fixture",path,"UTF-8-RAW")
    paths := ILBFolderPaths(backup),found := Map()
    for path in paths
        found[StrLower(path)] := true
    V48Assert(paths.Length=2 && found.Has(StrLower(first)) && found.Has(StrLower(second)),"selected copied folder accepts both historical combat filenames and .log files")
    V48Assert(!found.Has(StrLower(ignored)) && !found.Has(StrLower(nested)),"folder enumeration excludes unrelated text and does not descend into subfolders")
    V48Assert(FileRead(first,"UTF-8")="private fixture" && !FileExist(IQIPath()),"enumerating a folder neither edits sources nor begins import")
}

; Isolated native controls, catalogue files and queue replay. No visible app,
; real settings, game hotkeys, audio, or live encounter state.
V777LibraryBusySearch() => V76Run(V777LibraryBusySearchCase)
V777LibraryBusySearchCase()
{
    global Audio,IP
    s := ILBState(),q := IQIState(),ILBLoad(),ILBCommit(V75LibraryFiles())
    before := s.Original,revision := s.Revision,live := IP.Live,audioQueue := Audio.Queue
    s.Busy := true,s.Cancel := {Cancel:false},q.Running := true
    try {
        ; First Library visit while the queue is already running.
        IPWLibraryOpen(),c := s.Controls,ILBFilterPending()
        V48Assert(c["List"].GetCount()=5 && s.BrowseFiles=s.Files,"first visit during import loads already-saved pulls")
        c["Status"].Text := "Importing recording 12",c["Progress"].Value := 42
        c["Search"].Value := "tYtH",ILBFilterChanged()
        V48Assert(s.Shown.Length=5,"boss search works case-insensitively while busy")
        c["Search"].Value := "sophie",c["Result"].Choose("No kill"),c["Boss"].Choose(2),c["Character"].Choose(2)
        c["Mode"].Choose(6),s.Date := "20261003",c["Minutes"].Value := "1",ILBFilterChanged()
        V48Assert(s.Shown.Length=1 && s.Shown[1].Pull.Id=2,"all library filters combine during import")
        c["Minutes"].Value := "2",ILBFilterChanged()
        V48Assert(!s.Shown.Length && !c["Open"].Enabled,"minimum-duration filter can yield no matches without a stale selection")
        c["Minutes"].Value := "0",s.Date := "20261002",ILBFilterChanged(),ILBClearDate()
        V48Assert(s.Shown.Length=1 && s.Date="","clear date works during import")
        c["Search"].Value := "combat_2026-10-03",ILBFilterChanged()
        V48Assert(s.Shown.Length=1,"filename search uses the saved source")
        for name in ["Open","Remove","Reindex"]
            V48Assert(!c[name].Enabled,"source-changing action stays disabled: " name)
        ILBReindex(),ILBRemove()
        V48Assert(!q.Items.Length && s.Original==before && s.Revision=revision,"blocked source actions leave queue and catalogue untouched")
        V48Assert(c["Status"].Text="Importing recording 12" && c["Progress"].Value=42,"search preserves import progress and status")
        V48Assert(q.Running && s.Busy && !s.Cancel.Cancel && IP.Live=live && Audio.Queue=audioQueue,"search does not pause import or touch live parsing/audio")
        V48Assert(FileRead(s.TestPath,"UTF-8")==before,"search is read-only on disk")
        oldRows := s.Rows,oldFiles := s.BrowseFiles
        f := ILBFile(A_Temp "\combat_2026-10-04_01_00_00_002.txt","20261004",1,"20261004120000",Format("{:064}",0),[V75LibraryPull()])
        f.Pulls[1].Boss := "G-SC",f.Pulls[1].Name := "Scyva",ILBCommitFile(f)
        V48Assert(s.Rows=oldRows && oldFiles.Count=1 && s.Files.Count=2,"commits do not mutate the visible result snapshot")
        for name in ["Boss","Character","Result","Mode"]
            c[name].Choose(1)
        c["Search"].Value := "scyva",ILBFilterChanged()
        V48Assert(s.Shown.Length=1 && s.Shown[1].Pull.Boss="G-SC" && s.Bosses.Length=2,"next query includes a newly committed recording and boss choice")
        rows := s.Rows,ILBFilterChanged()
        V48Assert(s.Rows=rows,"unchanged catalogue reuses deduplicated rows")
        V48Assert(!ILBOpenFight() && InStr(c["Detail"].Text,"Pause"),"double-click/open guard still requires a paused queue")
    }
    finally q.Running := false,s.Busy := false
}

V777LibraryPages() => V75LibraryRun(V777LibraryPagesCase)
V777LibraryPagesCase()
{
    s := ILBState(),files := V75LibraryFiles()
    for path,f in files {
        f.Pulls := []
        Loop 625
            f.Pulls.Push(V75LibraryPull(A_Index,A_Index*120000))
    }
    s.Files := files,s.Loaded := true,ILBBuildWindow(),ILBFilterChanged(),c := s.Controls
    V48Assert(s.Shown.Length=625 && c["List"].GetCount()=125 && s.PageStart=501,"large result set starts on latest page without losing earlier pulls")
    V48Assert(ILBSelected()=625 && c["Earlier"].Enabled && !c["Later"].Enabled,"latest-page selection maps to correct backing pull")
    ILBResultPage(-1),c["List"].Modify(1,"Select Focus"),ILBSelect()
    V48Assert(c["List"].GetCount()=250 && ILBSelected()=251 && s.Shown[ILBSelected()].Pull.Id=251,"middle-page row maps to its exact saved fight")
    V48Assert(c["List"].GetText(1,1)=ILBStamp(s.Shown[251].At),"displayed timestamp matches backing selection")
    s.Filling := true,V48Assert(!ILBSelected(),"a table mid-redraw cannot expose an old row against a new backing array"),s.Filling := false
    ILBResultPage(-1),ILBResultPage(-1)
    V48Assert(s.PageStart=1 && !c["Earlier"].Enabled && c["Later"].Enabled,"earliest page clamps navigation")
    s.Busy := true,s.Cancel := {Cancel:false},ILBResultPage(1)
    V48Assert(s.PageStart=251 && !s.Cancel.Cancel && !c["Open"].Enabled,"paging remains available during import")
    c["Search"].Value := "no match",ILBFilterChanged()
    V48Assert(!c["List"].GetCount() && !ILBSelected() && !c["Earlier"].Enabled && !c["Later"].Enabled,"empty search clears row mapping and page controls")
    c["Search"].Value := "Tyth",ILBFilterChanged()
    V48Assert(s.PageStart=501 && c["List"].GetCount()=125,"clearing filters restores latest page")
    for size in [[664,428],[980,700],[1920,1080]] {
        ILBResize(s.Gui,0,size[1],size[2])
        previousRight := 0,c["List"].GetPos(,&listTop)
        c["Role"].GetPos(,&roleTop,,&roleHeight),c["Server"].GetPos(,&serverTop,,&serverHeight)
        filterBottom := Max(roleTop+roleHeight,serverTop+serverHeight)
        for name in ["DateFilter","Earlier","Later","ClearDate","ResetFilters"] {
            c[name].GetPos(&x,&y,&w,&h)
            V48Assert(x>=previousRight && x+w<=size[1]-8 && y>=filterBottom && y+h<listTop,"search page controls fit between filters and results without overlap at " size[1] ": " name)
            previousRight := x+w
        }
    }
    s.Busy := false
}

V777LibraryDebounce() => V75LibraryRun(V777LibraryDebounceCase)
V777LibraryDebounceCase()
{
    s := ILBState(),s.Files := V75LibraryFiles(),s.Loaded := true,ILBBuildWindow(),ILBFilterChanged(),c := s.Controls
    c["Search"].Value := "absent",ILBFilterRequested(),c["Search"].Value := "Tyth",ILBFilterRequested()
    V48Assert(c["List"].GetCount()=5,"typing schedules a query without rebuilding every keystroke")
    Sleep(360)
    V48Assert(c["List"].GetCount()=5 && c["Search"].Value="Tyth","timer applies latest query, not an obsolete earlier one")
    c["Search"].Value := "absent",ILBFilterRequested(),Sleep(360)
    V48Assert(!c["List"].GetCount(),"deferred native timer updates search results")
    s.Filling := true,c["Search"].Value := "Tyth",ILBFilterRequested(c["Search"]),ILBFilterPending()
    V48Assert(!c["List"].GetCount(),"pending query does not interrupt a table fill")
    s.Filling := false,Sleep(360)
    V48Assert(c["List"].GetCount()=5,"postponed query runs after fill ends")
    ILBFilterRequested(),ILBClose(),Sleep(360)
    V48Assert(!IPMGuiAlive(s.Gui) && !IsObject(s.BrowseFiles),"closing releases the snapshot and cancels pending queries")
}

V777LibraryQueueSearch() => V76Run(V777LibraryQueueSearchCase)
V777LibraryQueueSearchCase()
{
    global IP,Audio
    q := IQIState(),s := ILBState(),f := V68ReviewFile(),live := IP.Live,audioQueue := Audio.Queue
    SplitPath(s.TestPath,,&folder)
    one := folder "\combat_2026-10-03_20_00_00_001.txt",two := folder "\combat_2026-10-04_20_00_00_002.txt"
    try {
        FileCopy(f.Path,one),FileCopy(f.Path,two),ILBLoad(),ILBBuildWindow()
        ; Cross the 32-log checkpoint, then search its saved results while the
        ; next batch is reading. Pending summaries are intentionally not visible.
        paths := [one]
        Loop 31 {
            extra := folder "\combat_2026-10-03_20_00_00_" Format("{:06}",A_Index+10) ".txt"
            FileCopy(f.Path,extra),paths.Push(extra)
        }
        paths.Push(two)
        IQIEnqueue(paths),probe := {Seen:false,Rows:0},q.TestService := V777LibraryQueueProbe.Bind(probe),IQIRun()
        V48Assert(probe.Seen && probe.Rows>0,"real queue checkpoint allows searching the first committed batch during the next import")
        V48Assert(q.Items[1].State="Done" && q.Items[33].State="Done" && s.Files.Count=33 && !s.Cancel.Cancel,"queue finishes every log after in-flight search without pause or failure")
        V48Assert(IGVReadHistory(q.TestHistory).Count=33,"all logs still reach Progression")
        V48Assert(IP.Live=live && Audio.Queue=audioQueue && !q.Running && !s.Busy,"queue search leaves live/audio state intact and releases guards")
    }
    finally FileDelete(f.Path)
}
V777LibraryQueueProbe(probe,info)
{
    q := IQIState(),s := ILBState(),q.BatchPolicy := {Files:32,Bytes:16777216}
    if q.Current!=33 || probe.Seen
        return
    probe.Seen := true,before := s.Original,revision := s.Revision,c := s.Controls
    status := c["Status"].Text,progress := c["Progress"].Value
    c["Search"].Value := "combat_2026-10-03",ILBFilterChanged(),probe.Rows := s.Shown.Length
    V48Assert(q.Running && s.Busy && !s.Cancel.Cancel && q.Items[1].State="Done","search occurs while an actual queue owns the import guard")
    V48Assert(s.Original==before && s.Revision=revision && c["Status"].Text=status && c["Progress"].Value=progress,"in-flight search leaves committed state and progress intact")
    for e in s.Shown
        V48Assert(InStr(e.Path,"2026-10-03"),"results contain committed source only")
}

V777LibraryLargeSearch() => V75LibraryRun(V777LibraryLargeSearchCase)
V777LibraryLargeSearchCase()
{
    s := ILBState(),s.Files := Map(),s.Loaded := true
    Loop 4 {
        day := Format("202610{:02}",A_Index),path := A_Temp "\combat_2026-10-" Format("{:02}",A_Index) "_20_00_00_001.txt",pulls := []
        Loop 10000
            pulls.Push(V75LibraryPull(A_Index,A_Index*8000))
        f := ILBFile(path,day,100,day "210000",Format("{:064}",0),pulls),s.Files[StrLower(path)] := f
    }
    ILBBuildWindow(),s.Busy := true,s.Cancel := {Cancel:false},started := IPImportNow(),ILBFilterChanged(),cold := IPImportNow()-started
    V48Assert(s.Shown.Length=40000 && s.Controls["List"].GetCount()=250,"forty thousand saved pulls draw only the current page")
    rows := s.Rows,s.Controls["Search"].Value := "combat_2026-10-02",started := IPImportNow(),ILBFilterChanged(),warm := IPImportNow()-started
    V48Assert(s.Rows=rows && s.Shown.Length=10000 && s.Controls["List"].GetCount()=250,"whole-catalogue search includes results beyond the displayed page")
    ILBResultPage(-1),V48Assert(ILBSelected()=9750 && s.Shown[ILBSelected()].Pull.Id=9750,"large paged search retains precise selection")
    V48Assert(s.Busy && !s.Cancel.Cancel,"large search does not request an import pause")
    FileAppend("Synthetic saved-pull search only, not combat-log import speed.`nRows: 40000`nInitial snapshot/filter/page ms: " Round(cold,2)
        . "`nReused snapshot/filter/page ms: " Round(warm,2) "`n",A_ScriptDir "\library-search-timing.txt","UTF-8")
    s.Busy := false
}

; Real background AHK processes, but only private synthetic sources/catalogues.
; The normal Iris app, speech, hotkeys and saved settings are never started.
V778Run(fn) => V768Run(V778RunBody.Bind(fn))
V778RunBody(fn)
{
    global IP,IPAS,IrisTests,currentLogPath
    b := IQBState(),saved := b.Clone(),oldAuto := IPAS,oldBusy := IrisTests.Busy,oldPath := currentLogPath
    try {
        b.Active := false,b.Child := false,b.Process := "",b.Root := "",b.Polling := false
        b.TestEnabled := true,b.TestRuntime := A_ScriptDir "\Iris_Test_Runtime.ahk",b.TestHold := true
        IPAS := IPASNewState(),IrisTests.Busy := false,currentLogPath := "",IP.Live := IPNewData("PRIVATE LIVE"),IP.Active := false
        IQWState().TestWorkers := 1
        fn.Call()
    }
    finally {
        IP.Active := false,IP.Queue := [],IP.Head := 1,IP.Live.Current := "",b.TestHold := false
        if IQBActive() {
            IQBSendControl(true),deadline := A_TickCount+20000
            while IsObject(b.Process) && b.Process.Status=0 && A_TickCount<deadline
                Sleep(20)
            if IsObject(b.Process) && b.Process.Status=0
                b.Process.Terminate()
            b.Active := false,IQBCleanup()
        }
        SetTimer(IQBPoll,0),SetTimer(ILBLiveFlush,0),ILBState().Busy := false,IQIState().Running := false
        for key,value in saved.OwnProps()
            b.%key% := value
        IPAS := oldAuto,IrisTests.Busy := oldBusy,currentLogPath := oldPath
    }
}
V778Sources(count := 2,large := false)
{
    f := V68ReviewFile(),paths := V766Sources(count)
    try {
        text := FileRead(f.Path,"UTF-8"),prefix := ""
        if large {
            line := IPDemoLine(10,"@Private#1","=","Activate") "`n"
            Loop 35000
                prefix .= line
        }
        for path in paths {
            FileDelete(path),FileAppend(prefix text,path,"UTF-8")
        }
        IQIEnqueue(paths),ILBBuildWindow()
    }
    finally FileDelete(f.Path)
    return paths
}
V778Wait(predicate,timeout := 20000)
{
    deadline := A_TickCount+timeout
    while !predicate.Call() && A_TickCount<deadline {
        IQBPoll(),Sleep(20)
    }
    V48Assert(predicate.Call(),"background condition completed: " IQIState().Notice)
}
V778ExitCheck()
{
    b := IQBState(),V778Wait((*)=>b.Process.Status=1,40000),IQBPoll()
    output := b.Process.StdOut.ReadAll() b.Process.StdErr.ReadAll()
    err := FileExist(b.Root "\error.txt") ? FileRead(b.Root "\error.txt","UTF-8") : ""
    V48Assert(b.Process.ExitCode=0 && output="" && err="","helper exits cleanly without warnings: " output " " err " " IQIState().Notice)
}
V778Finish()
{
    b := IQBState(),b.TestHold := false,IQBPoll()
    V48Assert(!b.Active && !IQIState().Running && !ILBState().Busy,"completed helper releases import ownership")
}
V778BackgroundLive() => V778Run(V778BackgroundLiveCase)
V778BackgroundLiveCase()
{
    global IP,Audio
    paths := V778Sources(2,true),s := ILBState(),b := IQBState(),q := IQIState(),audioQueue := Audio.Queue
    V762QueuedLive(),live := IP.Live,IQWState().TestWorkers := 4
    V48Assert(IQIRun() && IP.Active && IP.Live=live && IP.Queue.Length=550,"bulk start returns immediately without stopping or draining live parsing")
    V48Assert(!IGRIsBusy() && b.Process.Status=0,"bulk coordinator runs outside the live process's review guard")
    V778Wait((*)=>q.Current>0 && b.Process.Status=0)
    V762Drain()
    V48Assert(IP.Active && IP.Live=live && live.Lines=552 && !live.Finished && !live.Halted,"actual live pump drains every queued record while the importer is running")
    V778Wait((*)=>q.Current>0 || b.Process.Status=1)
    V48Assert(b.Limit=4,"live parsing preserves the selected four-worker preset")
    pulse := {Ticks:0,Last:A_TickCount,MaxGap:0},tick := V778Pulse.Bind(pulse),SetTimer(tick,20)
    try V778ExitCheck()
    finally SetTimer(tick,0)
    V48Assert(pulse.Ticks>2 && pulse.MaxGap<1000,"native UI-process timers keep running while archive parsing occurs in the helper")
    V48Assert(q.Counts.Done=2 && s.Files.Count=0 && b.Active,"finished imports wait to refresh catalogue data during the live pull")
    V48Assert(IP.Active && IP.Live=live && Audio.Queue=audioQueue && !IP.Timer,"background completion cannot replace live state, audio queue or scheduling")
    live.Current := "",V778Finish()
    V48Assert(s.Files.Count=2 && IGVReadHistory(q.TestHistory).Count=2,"between pulls both saved catalogues become available")
    V48Assert(IP.Active && IP.Live=live && !b.Root,"cleanup leaves live parsing active and removes only the owned helper folder")
}
V778Pulse(pulse)
{
    pulse.Ticks += 1,pulse.MaxGap := Max(pulse.MaxGap,A_TickCount-pulse.Last),pulse.Last := A_TickCount
}
V778BackgroundPause() => V778Run(V778BackgroundPauseCase)
V778BackgroundPauseCase()
{
    global IP
    V778Sources(4,true),b := IQBState(),q := IQIState(),s := ILBState(),IP.Active := true,live := IP.Live
    V48Assert(IQIRun(),"background queue starts")
    V778Wait((*)=>q.Current>=2 && b.Process.Status=0,40000),ILBCancel(),IQBPoll(),V778ExitCheck()
    V48Assert(IP.Active && IP.Live=live,"Pause targets import only")
    V778Finish(),done := IQICounts().Done
    V48Assert(done>=1 && done<4 && IQICounts().Pending>0,"Pause preserves completed files and leaves remaining sources resumable")
    b.TestHold := true,V48Assert(IQIRun(),"same saved queue resumes without re-adding files"),V778ExitCheck(),V778Finish()
    V48Assert(IQICounts().Done=4 && s.Files.Count=4 && IP.Active,"resume state: done=" IQICounts().Done " files=" s.Files.Count " active=" IP.Active " error=" q.Error " notice=" q.Notice)
}
V778BackgroundFailure() => V778Run(V778BackgroundFailureCase)
V778BackgroundFailureCase()
{
    global IP
    paths := V778Sources(3,true),b := IQBState(),q := IQIState(),s := ILBState()
    ; Seed one genuinely durable prefix, then kill the helper with another
    ; completed result still buffered. This covers both sides of batch recovery.
    job := IGRBegin("private durable prefix")
    try file := ILBScan(paths[1],IGVSourceIdentity(paths[1]).Date,job)
    finally IGREnd(job)
    ILBCommitFile(file),IUPSaveProgression(file,q.TestHistory),q.Items[1].State := "Done",IQISave(),IP.Active := true
    V48Assert(IQIRun(),"private failure fixture starts"),V778Wait((*)=>q.Current>=3 && b.Process.Status=0,40000)
    b.Process.Terminate(),V778Wait((*)=>b.Process.Status=1),V778Finish()
    V48Assert(IP.Active && IQICounts().Done>=1 && IQICounts().Pending>0,"helper loss preserves live parsing and durable queue progress")
    V48Assert(INLibraryRead(FileRead(s.TestPath,"UTF-8"),s.TestPath).Count>=1,"last committed catalogue remains readable after process loss")
    b.TestHold := true,V48Assert(IQIRun(),"crash recovery resumes saved queue"),V778ExitCheck(),V778Finish()
    V48Assert(IQICounts().Done=3 && s.Files.Count=3 && IGVReadHistory(q.TestHistory).Count=3,"recovery retries the unacknowledged batch without duplicating completed files")
}
V778BackgroundLiveSave() => V778Run(V778BackgroundLiveSaveCase)
V778BackgroundLiveSaveCase()
{
    global IP,currentLogPath
    paths := V778Sources(2,true),b := IQBState(),q := IQIState(),s := ILBState(),f := V68ReviewFile()
    SplitPath(s.TestPath,,&folder),path := folder "\combat_2026-10-06_01_00_00_001.txt"
    try {
        FileMove(f.Path,path),currentLogPath := path,IP.Active := true
        seg := f.State.Segments[f.State.Segments.Length],seg.LibrarySourceKey := path "|" ILBLiveIdentity(path)
        ILBLiveQueue(seg),key := StrLower(path),IQIEnqueue([path]),V48Assert(IQIRun(),"live-saving background fixture starts")
        IQBOfferLive(),V778ExitCheck()
        V48Assert(!s.LivePending.Count && !IsObject(b.LiveFlight),"live pending summary clears only after helper acknowledges its save")
        V778Finish()
        V48Assert(s.Files.Has(key) && s.Files[key].Live && s.Files[key].Pulls.Length=1,"current live recording is saved through the sole catalogue writer")
        V48Assert(q.Items[3].State="Pending" && InStr(q.Items[3].Note,"Live recording"),"growing active recording is not bulk-imported as a fixed archive")
        V48Assert(IGVReadHistory(q.TestHistory).Count=3 && IP.Active,"live pull and both archive recordings reach Progression")
    }
    finally {
        if FileExist(f.Path)
            FileDelete(f.Path)
        if FileExist(path)
            FileDelete(path)
    }
}
V778BackgroundGuards() => V778Run(V778BackgroundGuardsCase)
V778BackgroundGuardsCase()
{
    global IP
    V778Sources(1,true),b := IQBState(),s := ILBState(),q := IQIState(),live := IP.Live
    V48Assert(IQIRun(),"guard fixture starts")
    V48Assert(IPStartCanCommit(IP,live) && IPStartCommit(live) && IP.Active,"Parse may be started after background importing has begun")
    V48Assert(InStr(IPImportBlockedMessage(true),"Pause bulk import"),"opening an unrelated saved log remains a deliberate paused-import operation")
    V59ExpectError((*)=>ILBCommit(Map())),V59ExpectError((*)=>IGVWriteHistory(Map(),q.TestHistory)),V59ExpectError(IQISave)
    V48Assert(!s.Cancel.Cancel && q.Running,"attempted second writers cannot cancel or replace the active queue")
    IP.Live.Current := "",ILBCancel(),V778ExitCheck(),V778Finish()
    old := b.TestRuntime,b.TestRuntime := A_ScriptDir "\absent-runtime.ahk"
    try {
        IQIEnqueue([q.Items[1].Path],true)
        V48Assert(!IQIRun() && IP.Active && !b.Active && !s.Busy,"failed helper start leaves live parsing and queue usable")
    }
    finally b.TestRuntime := old
}

V778BackgroundProtocol() => V778Run(V778BackgroundProtocolCase)
V778BackgroundProtocolCase()
{
    global IP
    V778Sources(),b := IQBState(),s := ILBState(),q := IQIState()
    V48Assert(IQIRun(),"protocol fixture starts"),V778ExitCheck()
    saved := FileRead(s.TestPath,"UTF-8"),before := IP.Live
    a := IQBReadJson(b.Root "\status.json"),a[1] := "wrong-token",IQBWriteJson(b.Root "\status.json",a)
    IQBPoll()
    V48Assert(b.StatusError!="" && s.Cancel.Cancel && IP.Live=before,"foreign progress is rejected without installing its state")
    V778Finish()
    V48Assert(IQICounts().Done=2 && s.Files.Count=2 && FileRead(s.TestPath,"UTF-8")==saved,"corrupt progress recovers from durable catalogues instead of stranding the UI")
}
V778BackgroundAck() => V778Run(V778BackgroundAckCase)
V778BackgroundAckCase()
{
    s := ILBState(),b := IQBState(),files := V75LibraryFiles(),f := ""
    for key,source in files
        f := source,p := source.Pulls[1]
    key := StrLower(f.Path),s.LivePending := Map(key,{Identity:"private",Pulls:Map("pull",p),Progression:Map("pull",{})})
    b.LiveFlight := {Serial:1,Batches:Map(key,{Identity:"private",Pulls:Map("pull",p)}),Originals:Map(key,Map("pull",p))}
    newer := p.Clone(),newer.End += 1000,s.LivePending[key].Pulls["pull"] := newer
    IQBAcceptLiveAck([1,"saved",""])
    V48Assert(s.LivePending[key].Pulls["pull"]=newer,"acknowledging an older snapshot cannot discard a newer live pull update")
    b.LiveFlight := {Serial:2,Batches:Map(key,{Identity:"private",Pulls:Map("pull",newer)}),Originals:Map(key,Map("pull",newer))}
    IQBAcceptLiveAck([1,"saved",""])
    V48Assert(IsObject(b.LiveFlight) && s.LivePending.Count=1,"stale acknowledgment cannot clear current handoff")
    IQBAcceptLiveAck([2,"failed","private failure"])
    V48Assert(s.LivePending.Count=1 && b.LiveError && InStr(s.AutoError,"private failure"),"failed save retains summary for retry and reports the failure")
    b.LiveFlight := {Serial:3,Batches:Map(key,{Identity:"private",Pulls:Map("pull",newer)}),Originals:Map(key,Map("pull",newer))}
    IQBAcceptLiveAck([3,"saved",""])
    V48Assert(!s.LivePending.Count && s.AutoError="","only the exact successfully saved summary is removed")
}

; Native diagnostics use private synthetic logs/stores and hidden windows.
; No normal application launch, real audio, game input or saved user settings.
V779Run(fn) => V76Run(V779Inner.Bind(fn))
V779Inner(fn)
{
    p := IWPState(),oldP := p.Clone(),m := ISMState(),oldM := m.Clone()
    try {
        p.Active := false,p.Cancel := false,p.TestService := ""
        m.Gui := "",m.Controls := Map(),m.Busy := false,m.Undo := "",m.TestStage := ""
        m.HistoryPath := IQIState().TestHistory
        fn.Call()
    }
    finally {
        p.Active := false,ILBState().Busy := false,ILBState().Flushing := false,IGVState().Busy := false
        m.Busy := false,ISMClose()
        if IPMGuiAlive(m.Gui)
            m.Gui.Destroy()
        for k,v in oldP.OwnProps()
            p.%k% := v
        for k,v in oldM.OwnProps()
            m.%k% := v
    }
}
V779PreparationCancel() => V779Run(V779PreparationCancelCase)
V779PreparationCancelCase()
{
    global IP,Audio
    q := IQIState(),p := IWPState(),s := ILBState(),paths := [],SplitPath(s.TestPath,,&dir)
    Loop 160 {
        path := dir "\combat_2026-10-03_00_00_00_" Format("{:04}",A_Index) ".txt"
        FileAppend("synthetic`n",path,"UTF-8"),paths.Push(path)
    }
    IQIEnqueue([paths[1]]),q.Items[1].State := "Done",IQISave(),before := q.Original,items := q.Items
    ILBBuildWindow(),live := IP.Live,audioQueue := Audio.Queue
    for stage in ["Finding logs...","Preparing queue...","Saving queue...","Checking queue...","Finishing preparation..."] {
        p.TestService := V779CancelAt.Bind(stage)
        V48Assert(!IWPPrepare([],false,dir,false),"cancel works during " stage)
        V48Assert(q.Original==before && FileRead(IQIPath(),"UTF-8")==before && q.Items[1].State="Done" && q.Items.Length=1,"cancel keeps the saved queue and prior item state")
        V48Assert(!p.Active && !s.Busy && s.Controls["Cancel"].Text="Pause","preparation releases UI ownership")
    }
    p.TestService := ""
    prepared := IWPPrepare([],false,dir,false)
    V48Assert(prepared && q.Items.Length=160 && !q.Running,"folder preparation publishes once without starting when requested: ok=" prepared " rows=" q.Items.Length " running=" q.Running " note=" q.Notice)
    V48Assert(p.Committed && q.Items[1].State="Pending" && IQIParse(q.Original).Length=160,"prepared queue roundtrips and re-add retains normal identity checks")
    V48Assert(IP.Live=live && Audio.Queue=audioQueue && !IP.Active,"preparation does not replace parser or audio state")
}
V779CancelAt(stage,state)
{
    if state.Stage=stage
        ILBCancel()
}
V779PreparationGuards() => V779Run(V779PreparationGuardsCase)
V779PreparationGuardsCase()
{
    q := IQIState(),p := IWPState(),s := ILBState()
    IQIEnqueue([A_Temp "\combat_2026-10-03_00_00_00_001.txt"]),before := q.Original,ILBBuildWindow()
    s.Controls["Tabs"].Choose(4),p.Active := true,s.Busy := true,IQIDraw(false)
    try {
        IQIRun(),IQIRetry(),IQIClear()
        V48Assert(!q.Running && q.Original=before,"resume/retry/clear cannot alter a queue being prepared")
        V48Assert(!s.Controls["QueueResume"].Enabled && s.Controls["QueuePause"].Enabled && s.Controls["QueuePause"].Text="Cancel setup","preparation offers cancellation instead of normal queue actions")
        V48Assert(InStr(IPImportBlockedMessage(true),"preparing"),"opening another saved log reports preparation ownership")
        V48Assert(!IWPPrepare([],false,"",false),"nested preparation cannot replace the owner")
    }
    finally p.Active := false,s.Busy := false
    q.Running := true
    try V48Assert(!IWPPrepare([],false,"",false),"active importer blocks adding sources")
    finally q.Running := false
}
V779SourcesFixture()
{
    f := V68ReviewFile(),s := ILBState(),path := s.TestPath ".history.json"
    try {
        file := ILBFile(f.Path,"20261003",FileGetSize(f.Path),FileGetTime(f.Path,"M"),Format("{:064}",0),[ILBFight(f.State.Segments[-1])])
        ILBLoad(),ILBCommit(Map(StrLower(file.Path),file))
        history := IUPMerge(Map(),[f.Entry.Pull],f.Entry.Session,f.Entry.Date).History
        IGVWriteHistory(history,path)
        m := ISMState(),m.HistoryPath := path,m.Snapshot := ISMRead(path),m.Rows := ISMRows(m.Snapshot)
        return {File:f.Path,Snapshot:m.Snapshot,Id:m.Rows[1].Id,Path:path}
    }
    catch {
        FileDelete(f.Path)
        throw
    }
}
V779SourceChoices() => V779Run(V779SourceChoicesCase)
V779SourceChoicesCase()
{
    f := V779SourcesFixture()
    try {
        for scope in ["Library only","Progression only","Both"] {
            plan := ISMPlan(f.Snapshot,[f.Id],scope)
            V48Assert(plan.LibraryChanged=(scope!="Progression only") && plan.HistoryChanged=(scope!="Library only"),"removal scope affects exactly the requested views")
            V48Assert(plan.Files.Count=(scope="Progression only" ? 1 : 0) && plan.History.Count=(scope="Library only" ? 1 : 0),"unselected saved view stays intact")
        }
        V59ExpectError((*)=>ISMPlan(f.Snapshot,["missing"],"Both"))
        V59ExpectError((*)=>ISMPlan(f.Snapshot,[f.Id,f.Id],"Both"))
        V48Assert(FileExist(f.File) && f.Snapshot.Files.Count=1 && f.Snapshot.History.Count=1,"planning cannot mutate records or delete the raw log")
        copy := f.Snapshot.Files.Clone(),base := copy[StrLower(f.File)],second := base.Clone(),second.Path := A_Temp "\copy\" StrSplit(f.File,"\")[-1]
        copy[StrLower(second.Path)] := second
        rows := ISMRows({Files:copy,History:f.Snapshot.History})
        V48Assert(rows.Length=1 && rows[1].Paths.Length=2,"copied paths sharing one recording ID are explicitly grouped")
    }
    finally FileDelete(f.File)
}
V779SourceUndo() => V779Run(V779SourceUndoCase)
V779SourceUndoCase()
{
    f := V779SourcesFixture(),m := ISMState(),s := ILBState()
    try {
        ISMOpen(),V48Assert(m.Rows.Length=1 && !DllCall("IsWindowVisible","Ptr",m.Gui.Hwnd),"source manager builds hidden with both catalogues")
        m.Controls["Rows"].Modify(1,"Select Focus"),ISMSelect()
        V48Assert(ISMSelected()[1]=f.Id && m.Controls["Remove"].Enabled,"native selection resolves the stable recording identity")
        plan := ISMPlan(m.Snapshot,[f.Id],"Both"),ISMApply(plan)
        V48Assert(!s.Files.Count && !IGVReadHistory(f.Path).Count && IsObject(m.Undo),"both records are removed with an undo snapshot")
        V48Assert(FileExist(f.File) && m.Undo.Expected.Backups.Length=2,"raw log is retained and both recovery copies exist")
        V48Assert(ISMUndo() && s.Files.Count=1 && IGVReadHistory(f.Path).Count=1,"undo restores both saved catalogues")
        V48Assert(!IsObject(m.Undo) && !s.Flushing && !IGVState().Busy,"undo clears ownership and one-use undo state")
        m.Controls["Search"].Value := "no such recording",ISMFilter()
        V48Assert(!m.Shown.Length && !m.Controls["Remove"].Enabled,"hidden search selections cannot remove a different recording")
        for dims in [[900,510],[1500,900]] {
            ISMResize(m.Gui,0,dims[1],dims[2])
            m.Controls["Team"].GetPos(&x,&y,&w,&h),m.Controls["Close"].GetPos(&cx)
            V48Assert(x+w<=cx,"source actions remain separate at minimum and maximized-like sizes")
        }
    }
    finally FileDelete(f.File)
}
V779SourceConflict() => V779Run(V779SourceConflictCase)
V779SourceConflictCase()
{
    global IP,currentLogPath
    oldActive := IP.Active,oldPath := currentLogPath
    f := V779SourcesFixture(),s := ILBState(),m := ISMState()
    try {
        plan := ISMPlan(f.Snapshot,[f.Id],"Both"),before := FileRead(f.Path,"UTF-8")
        IP.Active := true,currentLogPath := f.File
        V59ExpectError((*)=>ISMCommit(f.Snapshot,plan,f.Path))
        onlyHistory := ISMPlan(f.Snapshot,[f.Id],"Progression only")
        V59ExpectError((*)=>ISMCommit(f.Snapshot,onlyHistory,f.Path))
        IP.Active := false
        s.LivePending[StrLower(f.File)] := {Path:f.File,Date:f.Snapshot.Files[StrLower(f.File)].Date}
        V59ExpectError((*)=>ISMCommit(f.Snapshot,onlyHistory,f.Path))
        s.LivePending.Clear()
        V48Assert(FileRead(f.Path,"UTF-8")=before,"active and waiting live saves cannot be removed from either view")
        m.TestStage := V779SourceFail
        V59ExpectError((*)=>ISMCommit(f.Snapshot,plan,f.Path))
        V48Assert(s.Files.Count=1 && IGVReadHistory(f.Path).Count=1,"failure between stores rolls history back")
        V48Assert(FileRead(f.Path,"UTF-8")=before && FileRead(s.TestPath,"UTF-8")=f.Snapshot.Text,"rollback keeps exact saved content")
        m.TestStage := "",snap := ISMRead(f.Path),FileAppend(" ",f.Path,"UTF-8")
        V59ExpectError((*)=>ISMCommit(snap,plan,f.Path))
        V48Assert(s.Files.Count=1 && SubStr(FileRead(f.Path,"UTF-8"),-1)=" ","concurrent history edit is not overwritten")
    }
    finally {
        IP.Active := oldActive,currentLogPath := oldPath,s.LivePending.Clear()
        FileDelete(f.File)
    }
}
V779SourceFail(stage)
{
    throw Error("Injected library-save failure")
}
V779CalloutNavigation() => V672LibraryUIFixture(V779CalloutNavigationCase)
V779CalloutNavigationCase()
{
    global Preview,Audio,Persist,IC,AutoBossProfileCheckbox
    old := Preview,Preview := {Gui:"",Items:[],Visible:false,Message:""},before := V672LibraryUIIni(),serial := Persist.Serial,queue := Audio.Queue
    try {
        ICLUOpen(),s := ICLUState(),index := V672LibraryUIRow("your.EnergyShield")
        s.List.Modify(index,"Select"),ICLUSelection()
        V48Assert(ICLUPreview() && Preview.Items[Preview.Choice.Value].Key="EnergyShield" && Preview.Group.Text="Your abilities","switchboard preview opens the exact selected callout")
        V48Assert(!DllCall("IsWindowVisible","Ptr",Preview.Gui.Hwnd),"diagnostic preview construction stays hidden")
        for entry in BuildCalloutPreviewCatalog()
            V48Assert(entry.Group!="Hotkey / generic abilities","retired category is absent")
        ICLNPreview("Tyth","no-such-key")
        V48Assert(!Preview.Play.Enabled && Preview.Choice.Value=0,"missing explicit preview does not arm the wrong sound")
        OpenNBCandlePreview(),V48Assert(Preview.Group.Text="Nahut burn","boss editor opens the shared picker with context")
        V48Assert(ICLNPreviewGroup(ICLDefinition("nahut.order.Enabled"))="Nahut P1-P3","master rows have useful category previews")
        ICLNSetup()
        V48Assert(IC.Current="Boss" && s.Controls.Has("Players") && AutoBossProfileCheckbox.Gui.Hwnd=IC.Pages["Boss"].Gui.Hwnd,"setup opens boss controls with automatic detection; players have a direct action")
        V48Assert(Audio.Queue=queue && Audio.Queue.Length=0 && Persist.Serial=serial && V672LibraryUIIni()=before,"opening previews or setup menus never plays audio or changes settings")
    }
    finally {
        SetTimer(RefreshCalloutPreview,0)
        if IsObject(Preview.Gui)
            Preview.Gui.Destroy()
        Preview := old
    }
}
V779ReviewReuse() => V694RotationPageFixture(V779ReviewReuseCase)
V779ReviewReuseCase(a,source,seg,path,text)
{
    global IP,Audio
    IALoadSelected(),IALoadPump(),IAQueryPump(),d := a.Data,r := IPWRotationState(),generation := a.Generation
    V48Assert(IsObject(d) && d.HasOwnProp("ReviewPull") && r.Data=d,"Analysis shares its verified dataset with Rotation")
    V48Assert(!d.MainSelection.HasOwnProp("Source"),"shared review identity does not retain an entire old imported log")
    V48Assert(IPWRotationLoad() && !r.Pending && !IsObject(a.Work) && a.Generation=generation,"Rotation opens the loaded fight without a second read job")
    entry := {Key:"private",Session:IGVSourceIdentity(path).Session,Date:"20261003",Team:"",Pull:IPRCompact(seg)}
    cached := IGRLoadEntry(entry,path)
    V48Assert(cached.Rows=d.Rows && cached.Entry!=entry && cached.Entry.Pull.Start=seg.Start,"comparison reuses the same event journal with its own selected-entry wrapper")
    snap := IASnapshotFile(path,IP.Encoding)
    try {
        V48Assert(IWFAnalysisData(IAFrozenTarget(seg),snap)=d,"exact Analysis identity can reuse the loaded review")
        wrong := IPRCloneSnapshot(entry),wrong.Pull.Players.Delete(wrong.Pull.RecorderKey)
        V48Assert(!IsObject(IWFProgressionData(wrong,snap)),"mismatched attendance cannot reuse another pull")
        snap.Modified := "20000101000000"
        V48Assert(!IsObject(IWFAnalysisData(IAFrozenTarget(seg),snap)),"changed source snapshot rejects reuse")
    }
    finally snap.File.Close()
    V48Assert(IWFReviewRevision(source,d.MainSelection),"comparison accepts the exact completed revision")
    seg.SnapshotRevision += 1
    V48Assert(!IWFReviewRevision(source,d.MainSelection),"comparison rejects a changed retained fight revision")
    V48Assert(!IWFShareRotation(d),"revised main selection cannot use the old dataset")
    V48Assert(!IP.Active && !Audio.Queue.Length,"review navigation never starts live parsing or audio")
}
V779MenuRoutes() => V779Run(V779MenuRoutesCase)
V779MenuRoutesCase()
{
    IPWBuild(),u := IPWState()
    V48Assert(V779MenuHas(u.FileMenu,"Log library...") && !V779MenuHas(u.FileMenu,"Add logs to progression..."),"File offers the shared manager without a duplicate progression import")
    V48Assert(V779MenuHas(u.CalloutsMenu,"Audio callouts...") && !V779MenuHas(u.CalloutsMenu,"Callout switches..."),"audio has one prominent switchboard")
    V48Assert(!V779MenuHas(u.SettingsMenu,"Audio callouts...") && !V779MenuHas(u.SettingsMenu,"Boss tracking..."),"duplicate Settings routes removed")
    V48Assert(V779MenuHas(u.AnalysisMenu,"Load selected fight for review")
        && V779MenuHas(u.AnalysisMenu,"Mark selected pull") && V779MenuHas(u.AnalysisMenu,"Compare marked pulls")
        && V779MenuHas(u.AnalysisMenu,"Clear marked pulls"),"selected-fight review and marked comparisons share a discoverable menu")
    ILBBuildWindow(),c := ILBState().Controls
    V48Assert(c["Loaded"].Text="Manage raid logs..." && c["Remove"].Text="Assign team...","raid Library toolbar names log management and team assignment")
}
V779MenuHas(menu,label)
{
    count := DllCall("GetMenuItemCount","Ptr",menu.Handle,"Int")
    Loop count {
        b := Buffer(1024,0)
        DllCall("GetMenuStringW","Ptr",menu.Handle,"UInt",A_Index-1,"Ptr",b,"Int",512,"UInt",0x400)
        if StrGet(b)=label
            return true
    }
    return false
}

; Real suspended helpers and private synthetic logs only. No gameplay/UI input.
V7710PathAliases() => V778Run(V7710PathAliasesCase)
V7710PathAliasesCase()
{
    b := IQBState(),w := IQWState(),long := IQBCanonicalPath(A_Temp)
    V48Assert(IQBPrivate(long "\not-created\library.json"),"long temporary path with nonexistent suffix is accepted")
    V48Assert(IQBPrivate(A_Temp "\not-created\library.json"),"environment temporary path is accepted")
    V48Assert(!IQBPrivate(long) && !IQBPrivate(long "-outside\library.json") && !IQBPrivate(long "\..\outside.json"),"temporary root, sibling and traversal outside stay rejected")
    buf := Buffer(65536),n := DllCall("GetShortPathNameW","Str",long,"Ptr",buf,"UInt",32768,"UInt")
    V48Assert(n>0 && IQBPrivate(StrGet(buf) "\not-created\library.json"),"native short path is the same permitted temporary directory")
    root := long "\Iris_Background_Import_" DllCall("GetCurrentProcessId") "_" A_TickCount "_7710"
    DirCreate(root),FileAppend("private",root "\marker.txt"),b.Root := root
    IQBCleanup(),V48Assert(!DirExist(root),"coordinator cleanup handles the full temporary path")
    root := long "\Iris_Import_Workers_" DllCall("GetCurrentProcessId") "_" A_TickCount "_7710"
    DirCreate(root "\job-1"),w.Root := root
    IQWRemove(root "\job-1",false),V48Assert(!DirExist(root "\job-1") && DirExist(root),"worker job cleanup stays inside the owned worker root")
    IQWRemove(root,true),w.Root := "",V48Assert(!DirExist(root),"worker root cleanup resolves the same alias")
    SplitPath(ILBState().TestPath,,&privateDir)
    b.Root := privateDir,IQBCleanup(),V48Assert(DirExist(privateDir),"cleanup refuses unrelated temporary directories")
    FileAppend("TEMP=" A_Temp "`nCanonical=" long "`nShort=" StrGet(buf) "`n",A_ScriptDir "\path-evidence.txt","UTF-8")
}
V7710StartupFailure() => V778Run(V7710StartupFailureCase)
V7710StartupFailureCase()
{
    global IP,Audio
    V778Sources(1),b := IQBState(),s := ILBState(),q := IQIState()
    SplitPath(s.TestPath,,&privateDir),stub := privateDir "\rejected.ahk",runtime := b.TestRuntime
    ; The runner suspends hotkeys before loading even this tiny failure fixture.
    FileAppend("IQBChildMain(*) {`n}`nif !A_IsSuspended`n    ExitApp(99)`nFileAppend(`"Synthetic rejected startup`",A_ScriptDir `"\error.txt`",`"UTF-8`")`nExitApp(1)`n",stub,"UTF-8")
    ILBCommit(Map()),beforeLibrary := FileRead(s.TestPath,"UTF-8"),beforeQueue := FileRead(IQIPath(),"UTF-8")
    files := s.Files,items := q.Items,audioQueue := Audio.Queue,V762QueuedLive(),live := IP.Live
    pending := {Identity:"private",Pulls:Map(),Progression:Map()},s.LivePending := Map("private",pending)
    b.TestRuntime := stub
    try {
        V48Assert(IQIRun(),"native rejected-start helper launches without blocking live parsing")
        IQBOfferLive(),V48Assert(!IsObject(b.LiveFlight) && !FileExist(b.Root "\live.bin"),"live summaries are not offered before the startup handshake")
        V778Wait((*)=>b.Process.Status=1)
        V48Assert(b.Process.ExitCode=1 && !FileExist(b.Root "\ready.json"),"helper exits before permission to modify stores")
        ; If the failure path needlessly parsed saved data, this would fail.
        FileDelete(s.TestPath),FileAppend("deliberately unreadable fixture",s.TestPath,"UTF-8")
        b.TestHold := false,IQBPoll()
        V48Assert(!b.Active && !s.Busy && !q.Running && q.Error="","failed startup releases ownership immediately while live data is queued")
        V48Assert(s.Files=files && q.Items=items && s.LivePending["private"]=pending,"failed startup retains in-memory catalogues, queue and unsaved live summary")
        V48Assert(FileRead(IQIPath(),"UTF-8")==beforeQueue && IP.Active && IP.Live=live && IP.Queue.Length=550 && Audio.Queue=audioQueue,"startup failure does not save or replace live state, audio or queue data")
        V48Assert(InStr(q.Notice,"could not start") && !b.Root,"failure has an actionable notice and cleans up its owned folder")
    }
    finally {
        b.TestRuntime := runtime,FileDelete(s.TestPath),FileAppend(beforeLibrary,s.TestPath,"UTF-8"),s.LivePending := Map()
    }
    V762Drain(),live.Current := "",b.TestHold := true
    V48Assert(IQIRun(),"unchanged saved queue can resume after startup rejection")
    V778ExitCheck(),V778Finish()
    V48Assert(IQICounts().Done=1 && s.Files.Count=1 && IP.Active && IP.Live=live,"retry completes the import and leaves live parsing active")
}
V7710EightLive() => V778Run(V7710EightLiveCase)
V7710EightLiveCase()
{
    global IP,Audio
    paths := V778Sources(10,true),b := IQBState(),s := ILBState(),q := IQIState()
    job := IGRBegin("private eight-worker parity")
    try expected := ILBScan(paths[1],IGVSourceIdentity(paths[1]).Date,job)
    finally IGREnd(job)
    V762QueuedLive(),live := IP.Live,audioQueue := Audio.Queue,IQWState().TestWorkers := 8
    V48Assert(IQIRun(),"Maximum background import launches with live parsing on")
    V778Wait((*)=>b.Ready && q.Current>0,40000),V762Drain()
    V48Assert(b.Ready && b.Limit=8 && live.Lines=552,"confirmed helper uses eight workers while the live pump continues")
    V778ExitCheck(),status := IQBReadJson(b.Root "\status.json")
    V48Assert(status[14]=8 && status[13]=0 && q.Counts.Done=10,"real worker pool reaches eight, replenishes for ten logs and releases its jobs")
    V48Assert(s.Files.Count=0 && b.Active && IP.Active && IP.Live=live && Audio.Queue=audioQueue,"completed archive results wait until the live pull ends")
    live.Current := "",V778Finish(),key := StrLower(paths[1])
    V48Assert(s.Files.Count=10 && IGVReadHistory(q.TestHistory).Count=10,"all ten logs reach both private catalogues")
    V48Assert(IGVJson(ILBPack(Map(key,s.Files[key])))==IGVJson(ILBPack(Map(key,expected))),"eight-worker catalogue result exactly matches the serial parser")
    V48Assert(IQWLimit(4,32)=8 && IQWLimit(3,32)=4 && IQWLimit(2,32)=2 && IQWLimit(1,32)=1 && IQWLimit(4,4)=4,"lower speed presets and logical-processor cap remain available")
}
V7710ReadyProtocol() => V778Run(V7710ReadyProtocolCase)
V7710ReadyProtocolCase()
{
    V778Sources(),b := IQBState(),s := ILBState(),q := IQIState()
    V48Assert(IQIRun(),"startup protocol fixture starts"),V778ExitCheck()
    saved := FileRead(s.TestPath,"UTF-8")
    b.Ready := false,IQBWriteJson(b.Root "\ready.json",["foreign",IPCBuild()]),IQBPoll()
    V48Assert(b.StatusError!="" && s.Cancel.Cancel,"foreign startup handshake is rejected")
    V778Finish()
    V48Assert(s.Files.Count=2 && IQICounts().Done=2 && FileRead(s.TestPath,"UTF-8")==saved,"an existing startup marker conservatively reconciles durable results even when corrupted")
}

V7710MessageSharing() => V778Run(V7710MessageSharingCase)
V7710MessageSharingCase()
{
    b := IQBState(),s := ILBState(),q := IQIState(),SplitPath(s.TestPath,,&folder)
    path := folder "\message.json",IQBWriteJson(path,["previous"])
    f := FileOpen(path,0x700,"UTF-8"),deferred := false
    try {
        try IQBWriteJson(path,["next"])
        catch OSError as err {
            V48Assert(IQBTransientIO(err),"Windows open-destination refusal is a bounded retry condition")
            deferred := true
        }
        V48Assert(IGJParse(f.Read())[1]="previous","an open reader retains a complete previous message during replacement")
    }
    finally f.Close()
    if deferred
        IQBWriteJson(path,["next"])
    V48Assert(IQBReadJson(path)[1]="next","replacement publishes the next complete message after the reader closes")
    V59ExpectError((*)=>IQBReadText(path,1))
    b.Child := true,b.Active := true,b.Root := folder,b.Token := "private",b.Limit := 8,b.LastPulse := 0
    b.Parent := DllCall("OpenProcess","UInt",0x100000,"Int",false,"UInt",DllCall("GetCurrentProcessId"),"Ptr")
    b.Control := [b.Token,0,1,0,"",0],s.Cancel := {Cancel:false},control := folder "\control.json"
    IQBWriteJson(control,b.Control),f := FileOpen(control,0,"UTF-8")
    try {
        IQBChildPulse()
        V48Assert(!s.Cancel.Cancel && !b.Control[2] && b.ControlRetryAt,"a brief exclusive control-file lock retains the last valid control without cancelling")
        b.ControlRetryAt := A_TickCount-6000,b.LastPulse := 0,IQBChildPulse()
        V48Assert(s.Cancel.Cancel && b.Control[2],"persistent control loss still cancels safely after the bounded retry window")
    }
    finally f.Close()
    try {
        s.Cancel.Cancel := false,b.LastPulse := 0,IQBChildPulse()
        V48Assert(!s.Cancel.Cancel && !b.Control[2] && !b.ControlRetryAt,"a readable control message clears transient retry state")
        IQBWriteJson(control,["wrong-token",0,1,0,"",0]),b.LastPulse := 0,IQBChildPulse()
        V48Assert(s.Cancel.Cancel && b.Control[2],"a foreign token fails immediately rather than being treated as a lock conflict")
    }
    finally {
        DllCall("CloseHandle","Ptr",b.Parent),b.Parent := 0,b.Child := false,b.Active := false,b.Root := ""
    }
}
V7710LockedControl() => V778Run(V7710LockedControlCase)
V7710LockedControlCase()
{
    global IP
    V778Sources(4,true),b := IQBState(),s := ILBState(),q := IQIState()
    V48Assert(IQIRun(),"private lock-contention fixture starts"),V778Wait((*)=>b.Ready)
    f := FileOpen(b.Root "\control.json","r-d","UTF-8")
    try {
        IP.Active := true,b.LastControl := "",IQBPoll()
        V48Assert(b.IORetryAt && b.StatusError="" && !s.Cancel.Cancel && b.Active,"a blocked atomic control update retries without cancelling the import")
    }
    finally f.Close()
    IQBPoll(),V48Assert(!b.IORetryAt && b.StatusError="" && !s.Cancel.Cancel,"next poll sends the control successfully after the reader releases it")
    V778ExitCheck(),V778Finish()
    V48Assert(IQICounts().Done=4 && s.Files.Count=4 && IP.Active,"all logs finish after temporary contention and live parsing stays on")
}

 ; Synthetic sources, private catalogues and suspended native runners only.
V7711Policy()
{
    gib := 1073741824
    for sample in [[64,40,64,128,128],[32,10,64,64,64],[64,4,64,32,16],[16,12,64,32,16],[64,40,32,32,16]] {
        policy := IQIBatchPolicy(sample[1]*gib,sample[2]*gib,sample[3])
        V48Assert(policy.Files=sample[4] && policy.Bytes=sample[5]*1048576,"batch allowance respects total RAM, available RAM and process bitness")
    }
    actual := IQIBatchPolicy()
    V48Assert(actual.Files>=32 && actual.Files<=128 && actual.Bytes<=134217728,"native Windows memory query produces a bounded policy")
}
V7711Sources(count := 4)
{
    f := V68ReviewFile(),paths := V766Sources(count)
    try {
        for path in paths
            FileCopy(f.Path,path,true)
        IQIEnqueue(paths)
    }
    finally FileDelete(f.Path)
    return paths
}
V7711Files(paths)
{
    files := [],job := IGRBegin("private batch summaries")
    try {
        for path in paths
            files.Push(ILBScan(path,IGVSourceIdentity(path).Date,job))
    }
    finally IGREnd(job)
    return files
}
V7711HistoryText(history)
{
    rows := []
    for key,e in history
        rows.Push([key,e.Session,e.Date,e.Team,IGVPackPull(e.Pull)])
    return IGVJson(rows)
}
V7711Parity() => V76Run(V7711ParityCase)
V7711ParityCase()
{
    q := IQIState(),s := ILBState(),files := V7711Files(V7711Sources(8)),one := q.TestHistory ".serial"
    for file in files
        IUPSaveProgression(file,one)
    expected := IGVReadHistory(one),n := 0
    for key,e in expected {
        n += 1
        if n=1
            e.Team := "Private Ω team"
        if n=2
            e.Pull.Included := false
    }
    IGVWriteHistory(expected,one),IGVWriteHistory(expected,q.TestHistory)
    for file in files
        IUPSaveProgression(file,one)
    result := IUPSaveProgressionBatch(files,q.TestHistory)
    V48Assert(V7711HistoryText(IGVReadHistory(one))==V7711HistoryText(result.History),"batch and per-file saves preserve identical teams, exclusions, phases, health and deaths")
    before := FileRead(q.TestHistory,"UTF-8"),again := IUPSaveProgressionBatch(files,q.TestHistory)
    V48Assert(!again.Added && !again.Updated && FileRead(q.TestHistory,"UTF-8")==before,"replaying the whole batch is idempotent")
    bad := files.Clone(),bad[2] := files[2].Clone(),bad[2].ProgressionPulls := [files[2].ProgressionPulls[1].Clone()]
    bad[2].ProgressionPulls[1].Reason := "different"
    V59ExpectError((*)=>IUPSaveProgressionBatch(bad,q.TestHistory,V751AbortHistory))
    V48Assert(FileRead(q.TestHistory,"UTF-8")==before,"cancelled multi-source preparation preserves previous history")
}
V7711Burst() => V76Run(V7711BurstCase)
V7711BurstCase()
{
    q := IQIState(),s := ILBState(),V7711Sources(132),revision := s.Revision
    probe := {Peak:0,PendingSeen:false},q.TestService := V7711BurstProbe.Bind(probe),IQIRun()
    V48Assert(probe.PendingSeen && probe.Peak=127,"large-memory batch collects 128 actual boss logs before committing")
    V48Assert(q.Counts.Done=132 && !q.Counts.Pending && !q.Checked.Length && q.MeasuredFiles=132,"all batched sources are acknowledged and measured exactly once")
    V48Assert(s.Revision-revision=2 && s.Files.Count=132 && IGVReadHistory(q.TestHistory).Count=132,"132 boss logs use two Library saves and reach both catalogues")
    q.Loaded := false,IQILoad(),V48Assert(IQICounts().Done=132,"all four journal chunks plus the final batch survive reload")
}
V7711BurstProbe(probe,info)
{
    q := IQIState(),q.BatchPolicy := {Files:128,Bytes:134217728}
    ; Deterministic count-bound exercise; the separate deadline group covers time.
    if q.Checked.Length
        q.CheckedAt := A_TickCount
    probe.Peak := Max(probe.Peak,q.Checked.Length)
    if q.Current=2 && !probe.PendingSeen {
        probe.PendingSeen := true
        V48Assert(q.Items[1].State="Importing" && !FileExist(q.TestHistory),"boss results stay unacknowledged until their progression save")
    }
}
V7711ProgressionFailure() => V76Run(V7711ProgressionFailureCase)
V7711ProgressionFailureCase()
{
    q := IQIState(),s := ILBState(),V7711Sources(4)
    FileAppend("external invalid history",q.TestHistory,"UTF-8"),IQIRun()
    V48Assert(s.Files.Count=4 && IQICounts().Done=0 && IQICounts().Pending=4,"a Library-only save never acknowledges the boss batch")
    V48Assert(FileRead(q.TestHistory,"UTF-8")="external invalid history" && q.SaveError!="" && !q.Checked.Length,"failed Progression is preserved, memory released and the queue stopped")
    q.Loaded := false,IQILoad(),V48Assert(IQICounts().Pending=4,"all four sources remain resumable after process loss")
    FileDelete(q.TestHistory),IQIRun()
    V48Assert(IQICounts().Done=4 && s.Files.Count=4 && IGVReadHistory(q.TestHistory).Count=4,"resume repairs missing Progression without duplicate Library records")
}
V7711AckRecovery() => V76Run(V7711AckRecoveryCase)
V7711AckRecoveryCase()
{
    q := IQIState(),s := ILBState(),files := V7711Files(V7711Sources(35))
    q.Checked := [],q.CheckedBytes := 0,q.SaveError := "",q.FlushBusy := false
    for i,file in files {
        q.Items[i].State := "Importing",IQIJournalSave(i)
        q.Checked.Push({Index:i,File:file,ScanMs:1,Elapsed:1})
    }
    probe := {Force:false,Armed:false,Injected:false,External:""}
    ; Fail the acknowledgement tail after the first 32 completed rows are
    ; durable, rather than failing the precommit forced-retry marker journal.
    q.Items[33].DefineProp("Force",{Get:(*)=>probe.Force,Set:V767CheckedAckConflictInject.Bind(probe)})
    q.Running := true,q.Counts := IQICounts()
    V59ExpectError(IQIFlushChecked)
    V48Assert(probe.Injected && s.Files.Count=35 && IGVReadHistory(q.TestHistory).Count=35 && q.Counts.Done=0 && q.Counts.Pending=35,"failed acknowledgement retains both saved catalogues and retries all rows")
    FileDelete(IQIPath() ".journal"),FileAppend(q.JournalOriginal,IQIPath() ".journal","UTF-8-RAW")
    ; Reload without a queue snapshot, as after process loss before the tail.
    q.Running := false,q.Loaded := false,IQILoad()
    V48Assert(IQICounts().Done=32 && IQICounts().Pending=3 && !q.Items[32].Force && q.Items[33].Force,"partial multi-chunk acknowledgement recovers its exact durable prefix and forced tail")
    revision := s.Revision,IQIRun()
    V48Assert(IQICounts().Done=35 && s.Revision=revision && s.Files.Count=35 && IGVReadHistory(q.TestHistory).Count=35,"remaining verified results resume without rewriting either catalogue")
}
V7711MemoryBound() => V76Run(V7711MemoryBoundCase)
V7711MemoryBoundCase()
{
    q := IQIState(),s := ILBState(),files := V7711Files(V7711Sources(3)),revision := s.Revision
    q.BatchPolicy := {Files:128,Bytes:100},q.Checked := [],q.CheckedBytes := 0,q.CheckedBosses := false,q.FlushBusy := false
    for i,file in files {
        file.ImportPayloadBytes := i=3 ? 250 : 60
        IQIStageChecked(i,file,1)
        V48Assert(q.Checked.Length=1,"byte limit flushes the previous summary before accepting another")
    }
    V48Assert(s.Files.Count=2 && q.CheckedBytes=250,"a single oversized summary is accepted alone without dropping the recording")
    IQIFlushChecked(),V48Assert(s.Files.Count=3 && s.Revision-revision=3 && q.CheckedBytes=0 && IGVReadHistory(q.TestHistory).Count=3,"all memory-limited batches reach both stores and release their weight")
}
V7711BossDeadline() => V76Run(V7711BossDeadlineCase)
V7711BossDeadlineCase()
{
    q := IQIState(),s := ILBState(),V7711Sources(3),probe := {Expired:false,Saved:false}
    q.TestService := V7711DeadlineProbe.Bind(probe),IQIRun()
    V48Assert(probe.Expired && probe.Saved && IQICounts().Done=2 && IQICounts().Pending=1,"boss batches checkpoint during another read and Pause saves the remaining checked prefix")
    q.TestService := "",IQIRun()
    V48Assert(IQICounts().Done=3,"paused boss batch resumes without re-adding sources")
    V48Assert(q.MeasuredFiles=1 && q.FlushMs>0 && q.ScanMs>=0 && q.OverheadMs>=0,"save time is accounted once and excluded from parser time")
}
V7711DeadlineProbe(probe,info)
{
    q := IQIState()
    if q.Current=2 && !probe.Expired
        probe.Expired := true,q.CheckedAt := A_TickCount-6000
    if q.Current=3 {
        probe.Saved := q.Items[1].State="Done" && ILBState().Files.Count>=1 && IGVReadHistory(q.TestHistory).Count>=1
        ILBCancel()
    }
}

V7711QueueAliases() => V76Run(V7711QueueAliasesCase)
V7711QueueAliasesCase()
{
    paths := V766Sources(1),q := IQIState(),original := q.Items[1].Path
    q.Items[1].State := "Done",IQISave(),IQIEnqueue([IQBCanonicalPath(paths[1])],true)
    V48Assert(q.Items.Length=1 && q.Items[1].Path==original && q.Items[1].Force,"equivalent long-path re-add updates the original queue entry without changing saved source identity")
    q.Loaded := false,IQILoad()
    V48Assert(q.Items.Length=1 && q.Items[1].State="Pending","alias deduplication survives queue persistence")
}

 ; Private worker messages, suspended helpers and synthetic sources only.
V7712ProgressLocks() => V76Run(V7712ProgressLocksCase)
V7712ProgressLocksCase()
{
    path := ILBState().TestPath ".progress.json",state := {RetryAt:0}
    IQBWriteJson(path,[1,100,10,1]),reader := FileOpen(path,0,"UTF-8")
    try {
        V48Assert(!IQWPublishProgress(path,[2,200,20,2],state) && state.RetryAt,"a transient exclusive reader defers progress instead of failing the worker")
        V48Assert(IGJParse(reader.Read())[1]=1,"locked readers retain the prior complete progress message")
    }
    finally reader.Close()
    V48Assert(IQWPublishProgress(path,[3,300,30,3],state) && !state.RetryAt && IQBReadJson(path)[1]=3,"next tick publishes current progress after the reader releases it")
    reader := FileOpen(path,0,"UTF-8"),state.RetryAt := A_TickCount-6000
    try V59ExpectError((*)=>IQWPublishProgress(path,[4,400,40,4],state))
    finally reader.Close()
    V48Assert(IQBReadJson(path)[1]=3,"persistent contention still fails safely without damaging the last message")
    V59ExpectError((*)=>IQWPublishProgress(path "\missing\progress.json",[],state))
}
V7712NativeLock() => V768Run(V7712NativeLockCase)
V7712NativeLockCase()
{
    paths := V778Sources(3,true),w := IQWState(),w.TestWorkers := 2,IQWBegin(),worker := w.Jobs[1]
    deadline := A_TickCount+10000
    while !FileExist(worker.Folder "\progress.json") && worker.Process.Status=0 && A_TickCount<deadline
        Sleep(5)
    V48Assert(FileExist(worker.Folder "\progress.json"),"real suspended worker publishes progress")
    reader := FileOpen(worker.Folder "\progress.json","r-d","UTF-8")
    try Sleep(450)
    finally reader.Close()
    V768Wait(worker),V48Assert(worker.Process.ExitCode=0 && !FileExist(worker.Folder "\error.txt"),"real worker survives the lock that terminated the previous release")
    result := IQWReadResult(worker)
    V48Assert(result.File.Digest=IPCHashFile(paths[1]) && result.File.ProgressionPulls.Length=1,"completed locked-worker result retains valid source identity and boss data")
}
V7712HealthyWorkers() => V768Run(V7712HealthyWorkersCase)
V7712HealthyWorkersCase()
{
    paths := V7711Sources(5),w := IQWState(),w.TestWorkers := 3,IQWBegin(),originals := Map()
    for index,worker in w.Jobs
        originals[index] := worker.Process
    first := w.Jobs[1],V768Wait(first),FileDelete(first.Folder "\result.sha256")
    job := IGRBegin("private single-worker retry")
    try {
        file := IQWScan(1,paths[1],"20261005",job)
        V48Assert(w.Active && w.Fallbacks=1 && w.FailureStreak=1 && w.Jobs.Count=3 && w.Started=4,"one bad result retires only its worker and refills the slot")
        V48Assert(w.Jobs[2].Process=originals[2] && w.Jobs[3].Process=originals[3],"healthy prefetched processes and results are retained")
        V48Assert(file.Digest=IPCHashFile(paths[1]),"failed source gets one verified serial retry")
        IQWScan(2,paths[2],"20261005",job)
        V48Assert(w.FailureStreak=0 && w.Active && w.Started=5,"successful worker clears consecutive failures and keeps replenishing")
        Loop 3
            IQWScan(A_Index+2,paths[A_Index+2],"20261005",job)
        V48Assert(w.Active && !w.Jobs.Count && w.Fallbacks=1,"remaining worker outputs finish without further fallback")
    }
    finally IGREnd(job)
}
V7712RepeatedFailures() => V768Run(V7712RepeatedFailuresCase)
V7712RepeatedFailuresCase()
{
    paths := V766Sources(5),w := IQWState(),w.TestWorkers := 2,IQWBegin(),job := IGRBegin("private unhealthy workers")
    try {
        Loop 3 {
            index := A_Index,worker := w.Jobs[index],V768Wait(worker),FileDelete(worker.Folder "\result.sha256")
            file := IQWScan(index,paths[index],"20261005",job)
            V48Assert(file.Digest=IPCHashFile(paths[index]),"each rejected result falls back to a verified source")
        }
        V48Assert(!w.Active && !w.Jobs.Count && w.Fallbacks=3 && InStr(w.Notice,"one log at a time"),"three consecutive failures stop the unhealthy pool with an honest status")
        file := IQWScan(4,paths[4],"20261005",job)
        V48Assert(file.Digest=IPCHashFile(paths[4]),"remaining queue can continue after bounded pool failure")
    }
    finally IGREnd(job)
}
V7712WorkerStatus() => V76Run(V7712WorkerStatusCase)
V7712WorkerStatusCase()
{
    q := IQIState(),b := IQBState(),old := b.Clone(),w := IQWState(),oldW := w.Clone(),V766Sources(10)
    try {
        b.Token := "private",b.Active := true,b.Child := false,b.WorkersActive := false
        q.Running := true,q.Started := A_TickCount-100000
        status := [b.Token,IPCBuild(),2,[2,8,0,0],[104857600,0,209715200,104857600,1,1,5,0],"",8,0,[],[0,"",""],0,["Reading",100,50,0],8,8,[1,"",""]]
        IQBApplyStatus(status),estimate := IQIEstimate(q,8)
        V48Assert(b.WorkersActive && b.WorkerJobs=8 && InStr(IQISummary(),"Up to 8") && estimate>=199 && estimate<=204,"UI receives real parallel mode and ETA uses elapsed throughput instead of the UI process's inactive pool")
        status[13] := 0,status[15] := [0,"Parallel workers failed repeatedly. Continuing one log at a time.","private diagnostic"]
        IQBApplyStatus(status),summary := IQISummary()
        V48Assert(!b.WorkersActive && b.WorkerError="private diagnostic" && InStr(summary,"One log at a time") && !InStr(summary,"Up to 8"),"serial fallback is visible despite the unchanged selected eight-worker limit")
        V48Assert(InStr(summary,"failed repeatedly") && !InStr(summary,"private diagnostic"),"friendly retry status is visible while technical evidence stays separate")
        status[15][1] := 3,V59ExpectError((*)=>IQBApplyStatus(status))
        status[15] := [1,"",""] ,status[13] := 9,V59ExpectError((*)=>IQBApplyStatus(status))
    }
    finally {
        q.Running := false
        for key,value in old.OwnProps()
            b.%key% := value
        for key,value in oldW.OwnProps()
            w.%key% := value
    }
}

; Native fixtures only: no live cache, settings, windows, audio or input.
V7713CacheRun(action) => V70CacheFixture(V7713CacheSettingsCase.Bind(action))

V7713CacheSettingsCase(action,root)
{
    global SETTINGS_FILE,persistenceTestMode
    old := SETTINGS_FILE,oldMode := persistenceTestMode,c := IPCState()
    DirCreate(root),SETTINGS_FILE := root "\settings.ini",persistenceTestMode := false
    c.Gui := "",c.Controls := Map(),c.MaxDisk := 5368709120,c.LimitsLoaded := false
    IniWrite("preserved",SETTINGS_FILE,"Audio","Output")
    try action.Call(root)
    finally {
        IPCSizeClose(),FileDelete(SETTINGS_FILE),SETTINGS_FILE := old,persistenceTestMode := oldMode
    }
}

V7713CachePreferences() => V7713CacheRun(V7713CachePreferencesCase)
V7713CachePreferencesCase(root)
{
    global SETTINGS_FILE
    c := IPCState()
    V48Assert(IPCReadLimit(SETTINGS_FILE)=5,"missing cache preference defaults to 5 GB")
    for value in ["",0,-1,"1.5","abc",201,"99999999999999999999999"] {
        IniWrite(value,SETTINGS_FILE,"SavedCache","MaxDiskGB")
        V48Assert(IPCReadLimit(SETTINGS_FILE)=5,"invalid saved limit falls back to 5 GB")
        before := c.MaxDisk
        V70CacheThrows(IPCSetLimit.Bind(value),"invalid interactive limit rejected")
        V48Assert(c.MaxDisk=before,"invalid interactive value preserves current budget")
    }
    for gb in [1,5,20,200] {
        V48Assert(IPCSetLimit(gb)=gb && c.MaxDisk=gb*1073741824,"disk budget uses 64-bit arithmetic on both runtimes")
        V48Assert(IPCReadLimit(SETTINGS_FILE)=gb,"limit survives preference reread")
    }
    V48Assert(IniRead(SETTINGS_FILE,"Audio","Output")="preserved","only requested cache preference is changed")
    V48Assert(c.MaxBytes=201326592 && c.MaxObjects=1000000,"larger disk budget does not raise per-result allocation guards")
}

V7713CacheManyEntries() => V7713CacheRun(V7713CacheManyEntriesCase)
V7713CacheManyEntriesCase(root)
{
    Loop 40
        V48Assert(IPCWrite("import",IPCTextHash("entry " A_Index),{Value:A_Index}),"small result written")
    V48Assert(IPCFiles(root).Items.Length=40,"byte budget permits more than the old 24 cache files")
    c := IPCState(),found := IPCFiles(root),each := found.Items[1].Bytes
    c.MaxDisk := each*10,IPCPrune(root)
    V48Assert(IPCFiles(root).Bytes<=c.MaxDisk && IPCFiles(root).Items.Length=10,"eviction enforces byte budget")
}

V7713CacheRecentUse() => V7713CacheRun(V7713CacheRecentUseCase)
V7713CacheRecentUseCase(root)
{
    c := IPCState(),ka := IPCTextHash("recent"),kb := IPCTextHash("older"),kc := IPCTextHash("newest")
    IPCWrite("import",ka,{Value:1}),IPCWrite("import",kb,{Value:2}),IPCWrite("analysis",kc,{Value:3})
    a := IPCPath("import",ka),b := IPCPath("import",kb),d := IPCPath("analysis",kc)
    FileSetTime("20200101000000",a,"M"),FileSetTime("20200102000000",b,"M"),FileSetTime("20200103000000",d,"M")
    before := IPCHashFile(a)
    V48Assert(IPCRead("import",ka).Value=1 && FileGetTime(a,"M")>"20200103000000","successful read refreshes recency")
    V48Assert(IPCHashFile(a)=before,"touch changes no cache payload bytes")
    source := root "\source.txt",unrelated := root "\other.ipc"
    FileAppend("original log",source),FileAppend("not cache",unrelated)
    try {
        c.MaxDisk := FileGetSize(a)+FileGetSize(d),IPCPrune(root)
        V48Assert(FileExist(a) && !FileExist(b) && FileExist(d),"least recently used result goes first across both cache kinds")
        f := FileOpen(d,"rw"),f.Pos := 0,f.Write("bad"),f.Close(),FileSetTime("20200101000000",d,"M")
        V48Assert(!IsObject(IPCRead("analysis",kc)) && FileGetTime(d,"M")="20200101000000","corrupt result does not get a recency boost")
        IPCPrune(root,true)
        V48Assert(FileRead(source)="original log" && FileRead(unrelated)="not cache","cache cleanup preserves original and unrelated files")
    }
    finally FileDelete(source),FileDelete(unrelated)
}

V7713CacheLockedEviction() => V7713CacheRun(V7713CacheLockedEvictionCase)
V7713CacheLockedEvictionCase(root)
{
    c := IPCState(),paths := []
    Loop 3 {
        key := IPCTextHash("locked " A_Index),IPCWrite("import",key,{Value:A_Index})
        path := IPCPath("import",key),FileSetTime("2020010" A_Index "000000",path,"M"),paths.Push(path)
    }
    c.MaxDisk := FileGetSize(paths[1]),reader := FileOpen(paths[1],"r-d")
    try {
        IPCPrune(root)
        V48Assert(FileExist(paths[1]) && !FileExist(paths[2]) && !FileExist(paths[3]),"locked file stays counted and other old results are removed")
        V48Assert(IPCFiles(root).Bytes=c.MaxDisk,"locked deletion cannot falsely reduce tracked disk usage")
    }
    finally reader.Close()
}

V7713CacheDialog() => V7713CacheRun(V7713CacheDialogCase)
V7713CacheDialogCase(root)
{
    global SETTINGS_FILE
    c := IPCState(),IPCSetLimit(20),g := IPCSizeOpen(),hwnd := g.Hwnd
    V48Assert(c.Controls["Limit"].Value=20,"dialog shows current limit")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int"),"native diagnostic dialog remains hidden")
    V48Assert(IPCSizeOpen()=g,"repeated opening reuses the same dialog")
    c.Controls["Limit"].Value := "201"
    V48Assert(!IPCSizeSave() && InStr(c.Controls["Status"].Text,"1 to 200"),"invalid entry gives inline feedback without closing")
    V48Assert(IPCReadLimit(SETTINGS_FILE)=20,"invalid save does not overwrite preference")
    IPCSizeDefault()
    V48Assert(c.Controls["Limit"].Value=5 && IPCReadLimit(SETTINGS_FILE)=20,"Default changes only draft before Save")
    IPCSizeClose()
    V48Assert(IPCReadLimit(SETTINGS_FILE)=20 && !DllCall("User32\IsWindow","Ptr",hwnd,"Int"),"Cancel preserves preference and destroys dialog")
    IPCSizeOpen(),c.Controls["Limit"].Value := "30"
    V48Assert(IPCSizeSave() && IPCReadLimit(SETTINGS_FILE)=30 && !IsObject(c.Gui),"Save persists the custom limit and releases dialog")
}

V7713CacheDisabled() => V7713CacheRun(V7713CacheDisabledCase)
V7713CacheDisabledCase(root)
{
    global SETTINGS_FILE
    c := IPCState(),key := IPCTextHash("disabled"),IPCWrite("import",key,{Value:1})
    path := IPCPath("import",key),before := IPCHashFile(path),c.Enabled := false
    IPCSizeOpen()
    V48Assert(!IPCEnabled() && InStr(c.Controls["Used"].Text,"1 saved results"),"disabled cache still shows usage without enabling itself")
    c.Controls["Limit"].Value := "10",IPCSizeSave()
    V48Assert(!IPCEnabled() && IPCReadLimit(SETTINGS_FILE)=10 && IPCHashFile(path)=before,"changing size while disabled leaves reuse off and cached bytes intact")
    V48Assert(!IPCWrite("import",IPCTextHash("must not write"),{Value:2}),"size adjustment does not bypass disabled reuse")
    c.Enabled := true
}

; Suspended native fixtures, private catalogues and hidden controls only.
V7714JsonNumbers()
{
    for token in ["0","-0","12","-23","0.125","-0.25","1e3","2E-3","4e+2","9223372036854775806","-9223372036854775807"] {
        value := IGJParse("[" token "]")[1]
        V48Assert(value=token+0,"numeric token retains exact native value: " token)
    }
    for n in [62,63,64,65,128] {
        token := "0." Format("{:0" n "}",0) "1"
        V48Assert(IGJParse(token)=token+0,"long fraction crosses bounded scan without truncation")
        V59ExpectError((*)=>IGJParse(token "+2"))
    }
    for bad in ["01","-01","+1",".5","1.","--1","1e","1e+","1e-","1e2.3","1-2","1+2","1e2e3","NaN","Infinity","[1,]","[1 2]","1x"]
        V59ExpectError((*)=>IGJParse(bad))
    v := IGJParse(' {"number": -2.5e2, "literal": "123", "unicode": "Sophi\u00eb"} ')
    V48Assert(v["number"]=-250 && Type(v["literal"])="String" && v["unicode"]="Sophië","mixed JSON preserves strings and Unicode")
    probe := {Count:0},text := "[" RTrim(StrReplace(Format("{:06000}",0),"0","123456789,"),",") "]"
    result := IGJParse(text,(*)=>probe.Count+=1)
    V48Assert(result.Length=6000 && probe.Count>1,"large numeric arrays retain progress checkpoints")
    V59ExpectError((*)=>IGJParse(text,V773CheckpointStop))
}

V7714LazyPages() => V76Run(V7714LazyPagesCase)
V7714LazyPagesCase()
{
    s := ILBState(),q := IQIState(),s.Files := V75LibraryFiles(),s.Loaded := true
    q.Loaded := false,q.Items := [{Path:A_Temp "\private-queue.txt",Force:0,Size:20,State:"Pending",Note:""}]
    ILBBuildWindow(),ILBRefresh(),c := s.Controls
    V48Assert(!q.Loaded && c["QueueList"].GetCount()=0 && c["List"].GetCount()=5,"Library opens without loading/rendering the queue")
    V48Assert(!s.Chart && c["TrendList"].GetCount()=0,"unopened Performance page does not build a chart or results")
    q.Loaded := true,q.Path := IQIPath(),c["Tabs"].Choose(4),ILBPageChanged()
    V48Assert(c["QueueList"].GetCount()=1 && c["QueueList"].GetText(1,1)="Pending","opening Import queue renders its current snapshot: items=" q.Items.Length " rows=" c["QueueList"].GetCount() " tab=" c["Tabs"].Value)
    c["Tabs"].Choose(1),q.Items[1].State := "Done",IQIDraw()
    V48Assert(c["QueueList"].GetText(1,1)="Pending","hidden queue defers row updates")
    c["Tabs"].Choose(4),ILBPageChanged()
    V48Assert(c["QueueList"].GetText(1,1)="Done","returning to queue shows changes made while hidden")
    c["Tabs"].Choose(2),c["Month"].Value := "20261001000000",ILBPageChanged()
    V48Assert(InStr(c["MonthSummary"].Text,"5 pulls"),"Calendar computes activity when opened")
    c["Tabs"].Choose(3),ILBPageChanged()
    V48Assert(s.Chart && !s.Trends.Length && !c["TrendOpen"].Enabled,"unselected Performance opens with a valid empty chart")
    for name in ["TrendCharacter","TrendBoss","TrendSpec"]
        c[name].Choose(2)
    c["TrendMode"].Choose(6),ILBTrendChanged(c["TrendBoss"])
    V48Assert(s.Trends.Length=4 && c["TrendList"].GetText(1,4)="2,000","selected comparison still reproduces expected complete kills and rates")
    c["TrendBoss"].Choose(1),ILBTrendChanged(c["TrendBoss"])
    V48Assert(!s.Trends.Length && !s.Challenges.Length && !c["TrendOpen"].Enabled,"clearing selection removes stale comparison rows and challenge choices")
}

V7714UnchangedLibrary() => V75LibraryRun(V7714UnchangedLibraryCase)
V7714UnchangedLibraryCase()
{
    s := ILBState(),ILBLoad(),ILBCommit(V75LibraryFiles()),before := s.Original,revision := s.Revision,files := s.Files
    V48Assert(s.Files.Count>0,"saved fixture has rows: " s.Files.Count)
    clone := ""
    for key,entry in s.Files {
        clone := IPRCloneSnapshot(entry)
        break
    }
    marker := "20200101010101",FileSetTime(marker,s.TestPath,"M")
    FileAppend("backup sentinel",s.TestPath ".bak","UTF-8")
    clone.ProgressionPulls := ["transient summary"]
    ILBCommitFile(clone)
    V48Assert(s.Files=files && s.Revision=revision && s.Original==before,"unchanged normalized entry retains published catalogue identity")
    V48Assert(FileGetTime(s.TestPath,"M")=marker && FileRead(s.TestPath ".bak","UTF-8")="backup sentinel","unchanged reopen does not rewrite the catalogue or its backup")
    clone.Pulls[1].Players[clone.Pulls[1].Recorder].Name := "Changed player",ILBCommitFile(clone)
    V48Assert(s.Revision=revision+1 && s.Files!=files && FileRead(s.TestPath ".bak","UTF-8")==before,"changed data still saves atomically with the prior snapshot")
    latest := s.Original,revision := s.Revision,FileAppend(" ",s.TestPath,"UTF-8")
    V59ExpectError((*)=>ILBCommitFile(clone))
    V48Assert(s.Original==latest && s.Revision=revision && FileRead(s.TestPath,"UTF-8")==latest " ","unchanged fast path refuses an external edit")
}

V7714CacheCompatibility() => V70CacheFixture(V7714CacheCompatibilityCase)
V7714CacheCompatibilityCase(root)
{
    DirCreate(root)
    c := IPCState(),c.Build := "",path := root "\same-source.txt",FileAppend("same bytes",path,"UTF-8")
    try {
        id := IPCIdentity(path,"UTF-8",15000)
        legacy := "950f98268830b5d4e3ab5b54f047c5c2d93f1fb667cd51ea84b71fad39a1b2e8"
        compatible := "0.78.112"="77.14" || "0.78.112"="77.15" || "0.78.112"="77.16"
        expected := compatible ? legacy : IPCBuild()
        V48Assert(id.Build=expected && IPCBuild()!=legacy,"only audited compatible releases reuse old combat caches")
        text := "Iris-cache-1|" expected "|" StrLower(IPCFullPath(path)) "|" id.Length "|" id.Encoding "|15000|" A_AhkVersion "|" id.Digest
        V48Assert(id.Key=IPCTextHash(text),"cache identity uses content and encoding without local-time metadata")
        FileSetTime("20000101000000",path,"M"),touched := IPCIdentity(path,"UTF-8",15000)
        V48Assert(touched.Modified!=id.Modified && touched.Key=id.Key && touched.Digest=id.Digest,"timestamp-only changes retain identical combat content")
        c.Build := compatible ? IPCBuild() : legacy,changed := IPCIdentity(path,"UTF-8",15000)
        V48Assert(changed.Key!=id.Key,"explicit/new build identity still invalidates incompatible results")
    }
    finally FileDelete(path)
}

V7714HistoryMemo() => V76Run(V7714HistoryMemoCase)
V7714HistoryMemoCase()
{
    memo := IHReadMemo(),old := memo.Clone(),path := IQIHistory()
    try {
        memo.Path := "",memo.Root := "",memo.Text := ""
        IGVWriteHistory(V644StorageHistory(),path)
        text := FileRead(path,"UTF-8"),first := IGVReadHistory(path)
        V48Assert(memo.Path=path && IsObject(memo.Root) && StrPut(memo.Text,"UTF-8")-1<=memo.Limit,"history keeps one bounded private snapshot")
        chosen := ""
        for key,entry in first {
            chosen := key
            break
        }
        original := IGVJson(IGVPackPull(first[chosen].Pull)),first[chosen].Team := "unsaved mutation"
        first[chosen].Pull.Included := !first[chosen].Pull.Included
        copy := IGVReadHistory(path)
        V48Assert(copy!=first && copy[chosen].Team!="unsaved mutation" && IGVJson(IGVPackPull(copy[chosen].Pull))==original,"cached history is detached from caller mutations")
        stamp := FileGetTime(path,"M"),edited := StrReplace(text,"Unicode","Updated")
        V48Assert(StrLen(edited)=StrLen(text) && edited!=text,"fixture makes a same-length history edit")
        FileDelete(path),FileAppend(edited,path,"UTF-8"),FileSetTime(stamp,path,"M")
        V48Assert(InStr(IGVReadHistory(path)[chosen].Team,"Updated"),"same-length same-time edit invalidates the memo")
        FileDelete(path),FileAppend("broken",path,"UTF-8"),FileSetTime(stamp,path,"M")
        V59ExpectError((*)=>IGVReadHistory(path))
        V48Assert(FileRead(path,"UTF-8")="broken","corrupt replacement cannot fall back to a stale memo")
        FileDelete(path),FileAppend(text,path,"UTF-8")
        copy := IGVReadHistory(path),ref := ""
        for key,entry in copy
            if entry.Pull.HasOwnProp("DeathRecapRef") {
                ref := entry.Pull.DeathRecapRef
                break
            }
        V48Assert(IsObject(ref),"fixture includes a separately saved recap")
        FileMove(ref.Path,ref.Path ".held")
        try V59ExpectError((*)=>IGVReadHistory(path))
        finally FileMove(ref.Path ".held",ref.Path)
        V59ExpectError((*)=>IGVReadHistory(path,V773CheckpointStop))
        V48Assert(IGVReadHistory(path).Count=first.Count,"valid restored details allow cached history to reopen")
        memo.Root := "",memo.Limit := 1
        V48Assert(IGVReadHistory(path).Count=first.Count && !IsObject(memo.Root),"over-budget history reads normally without retaining a memo")
    }
    finally {
        for key,value in old.OwnProps()
            memo.%key% := value
    }
}

; Native Library opening routes; private fixture files and hidden controls only.
V7715Publication(probe,app) => probe.Calls += 1

V7715LibraryView() => V761LibraryFixture(V7715LibraryViewCase)
V7715LibraryViewCase(e,f)
{
    global IP
    s := ILBState(),probe := {Calls:0},save := V7715Publication.Bind(probe)
    V48Assert(ILBOpenFight() && ILBIsLibraryView(IP),"Library handler marks this import before dispatch")
    timing := IP.ImportTiming
    IPImportRun()
    V48Assert(IP.ImportDone && IP.Selected=1 && !IP.Follow,"uncached Library view finishes and selects its requested pull")
    V48Assert(!IsObject(s.Pending) && ILBIsLibraryView(IP),"consuming selection does not discard view intent")
    ILBImportFinished(IP,save)
    V48Assert(probe.Calls=0,"view does not enter catalogue publication")
    V48Assert(!IP.Offline.HasOwnProp("LibraryViewPath"),"view intent is absent from cached combat data")
    IP.Offline := "",V58SelectTab(13)
    V48Assert(ILBOpenFight() && IP.ImportTiming!=timing,"later Library request owns a fresh timing token")
    IPImportRun(),ILBImportFinished(IP,save)
    V48Assert(IP.ImportTiming.Cache="disk hit" && IP.Selected=1,"disk result opens the same requested pull")
    V48Assert(probe.Calls=0 && !IsObject(s.Pending),"disk result also avoids catalogue publication")
    IP.Selected := IP.Offline.Segments.Length
    s.Trends := [{Entry:e}],s.Controls["TrendList"].Delete(),s.Controls["TrendList"].Add("Select","private fixture")
    order := ILBTrendSortState(),savedShown := order.Shown
    try {
        order.Shown := s.Trends
        V48Assert(ILBOpenTrend() && IP.Selected=1,"Performance keeps its shared selected-pull route")
    }
    finally order.Shown := savedShown
}

V7715LibraryViewMismatch() => V761LibraryFixture(V7715LibraryViewMismatchCase)
V7715LibraryViewMismatchCase(e,f)
{
    global IP
    s := ILBState(),probe := {Calls:0},save := V7715Publication.Bind(probe)
    s.Shown[1].Pull := e.Pull.Clone(),s.Shown[1].Pull.Mode := "private stale mode"
    V48Assert(ILBOpenFight(),"unchanged source with obsolete saved bounds can be inspected")
    IPImportRun()
    V48Assert(IP.ImportDone && IP.Selected=0 && !IP.Follow,"stale selection never silently opens another pull")
    V48Assert(InStr(IUPState().LastNote,"no longer matches") && InStr(s.Controls["Status"].Text,"Reindex"),"stale bounds explain the explicit repair route")
    ILBImportFinished(IP,save)
    V48Assert(probe.Calls=0 && ILBIsLibraryView(IP),"stale Library view does not silently overwrite saved summaries")
}

V7715LibraryViewOwnership() => V761LibraryFixture(V7715LibraryViewOwnershipCase)
V7715LibraryViewOwnershipCase(e,f)
{
    global IP
    probe := {Calls:0},save := V7715Publication.Bind(probe)
    V48Assert(ILBOpenFight(),"cancel fixture starts a Library view")
    cancelled := IP.ImportTiming,IP.ImportCancelRequested := true,IPImportRun()
    V48Assert(IP.ImportTiming.Outcome="CANCELED" && !IsObject(ILBState().Pending),"cancel retires selection")
    IP.Offline := ""
    V48Assert(IPBeginImport(f.Path),"explicit import can start after cancelled Library view")
    V48Assert(IP.ImportTiming!=cancelled && !ILBIsLibraryView(IP),"explicit import never inherits cancelled view intent")
    IPImportRun(),ILBImportFinished(IP,save)
    V48Assert(probe.Calls=1 && IP.ImportDone,"ordinary import retains catalogue publication")
    original := IP.ImportTiming,IP.ImportTiming := cancelled
    IP.ImportPath := f.Path ".other"
    V48Assert(!ILBIsLibraryView(IP),"view marker does not apply to a different source")
    IP.ImportPath := f.Path,IP.ImportTiming := original
    IP.Offline := "",V58SelectTab(13)
    V48Assert(ILBOpenFight(),"Library route can read result created by ordinary import")
    IPImportRun(),ILBImportFinished(IP,save)
    V48Assert(IP.ImportTiming.Cache="disk hit" && probe.Calls=1,"cached result does not dictate whether catalogues are published")
    IP.Offline := ""
    V48Assert(IPBeginImport(f.Path) && !ILBIsLibraryView(IP),"subsequent explicit open gets normal saving behavior")
    IPImportRun(),ILBImportFinished(IP,save)
    V48Assert(IP.ImportTiming.Cache="disk hit" && probe.Calls=2,"ordinary cached import still publishes summaries")
    IP.ImportTiming.LibraryViewPath := ""
    V48Assert(!ILBIsLibraryView(IP),"empty marker cannot suppress publication")
}

V7716Run(action) => V76Run(V7716RunCase.Bind(action))
V7716RunCase(action)
{
    path := IQIHistory(),h := V644StorageHistory(),other := V644HistoryCapture("B","kill")
    other.Boss := "G-IZ",other.Name := "Izax",other.Group := other.Boss "|" other.Area "|" other.Mode
    h["other"] := {Key:"other",Session:"other",Date:"20260930",Team:"Other team",Pull:other}
    view := IGVState(),oldView := view.Clone()
    try {
        IGVWriteHistory(h,path)
        action.Call(path,h)
    }
    finally {
        view.Busy := false,IGVClose()
        for key,value in oldView.OwnProps()
            view.%key% := value
    }
}

V7716BrowseParity() => V7716Run(V7716BrowseParityCase)
V7716BrowseParityCase(path,h)
{
    lazy := IHVReadHistory(path),strict := IGVReadHistory(path)
    V48Assert(lazy.Count=strict.Count && lazy["synthetic"].Pull.HasOwnProp("IHVText"),"initial read owns compact snapshots")
    rows := V644HistoryEntries(lazy),selected := IGVSelectEntries(rows,lazy["other"].Pull.Group)
    V48Assert(selected.Length=1 && !lazy["other"].Pull.HasOwnProp("IHVText") && lazy["synthetic"].Pull.HasOwnProp("IHVText"),"encounter filter expands only matching pulls")
    for key,e in lazy {
        IHVExpand(e.Pull)
        V48Assert(IGVJson(IGVPackPull(e.Pull))==IGVJson(IGVPackPull(strict[key].Pull)),"all accounting, phases, HP, deaths and activity match strict history")
        V48Assert(e.Team==strict[key].Team && e.Session==strict[key].Session && e.Date==strict[key].Date,"identity and Unicode metadata match")
    }
    first := IHVReadHistory(path),second := IHVReadHistory(path)
    IHVExpand(first["other"].Pull),first["other"].Pull.Players.Clear()
    V48Assert(second["other"].Pull.HasOwnProp("IHVText") && IHVExpand(second["other"].Pull).Players.Count>0,"separate readers never share mutable pull objects")
}

V7716BrowseRecaps() => V7716Run(V7716BrowseRecapsCase)
V7716BrowseRecapsCase(path,h)
{
    lazy := IHVReadHistory(path),p := lazy["synthetic"].Pull,ref := p.DeathRecapRef
    body := FileRead(ref.Path,"UTF-8"),before := FileRead(path,"UTF-8")
    FileMove(ref.Path,ref.Path ".held")
    try {
        view := IHVReadHistory(path),IHVExpand(view["synthetic"].Pull)
        V48Assert(view.Count=2,"one missing recap does not block the whole graph")
        V64Reject((*)=>IHLoadDetails(view["synthetic"].Pull),"inspection checks missing recap")
        V64Reject((*)=>IGVReadHistory(path),"strict save reader still checks every referenced recap")
        V64Reject((*)=>IGVWriteHistory(view,path),"writing a view cannot bypass missing recap protection")
        V48Assert(FileRead(path,"UTF-8")==before,"failed save preserves original history bytes")
    }
    finally FileMove(ref.Path ".held",ref.Path)
    corrupt := StrReplace(body,"Demo","Dema"),FileDelete(ref.Path),FileAppend(corrupt,ref.Path,"UTF-8-RAW")
    try V64Reject((*)=>IHLoadDetails(IHVReadHistory(path)["synthetic"].Pull),"lazy inspection checks recap digest, including same-size corruption")
    finally {
        FileDelete(ref.Path),FileAppend(body,ref.Path,"UTF-8-RAW")
    }
    fresh := IHVReadHistory(path)["synthetic"].Pull,IHLoadDetails(fresh)
    V48Assert(fresh.DeathRecaps.Count>0 && !fresh.HasOwnProp("IHVText"),"restored recap hydrates on demand")
}

V7716BrowseLegacy() => V7716Run(V7716BrowseLegacyCase)
V7716BrowseLegacyCase(path,h)
{
    for schema in [1,2] {
        legacy := path ".legacy" schema,rows := []
        for key,e in h
            rows.Push([key,e.Session,e.Date,e.Team,IGVPackPull(e.Pull)])
        FileAppend(IGVJson([schema,rows]),legacy,"UTF-8-RAW")
        lazy := IHVReadHistory(legacy)
        V48Assert(IGVJson(IGVPackPull(lazy["synthetic"].Pull))==IGVJson(IGVPackPull(h["synthetic"].Pull)),"legacy inline recaps remain intact")
        lazy := IHVReadHistory(legacy),IGVWriteHistory(lazy,legacy)
        V48Assert(IGVJson(IGVPackPull(IGVReadHistory(legacy)["synthetic"].Pull))==IGVJson(IGVPackPull(h["synthetic"].Pull)),"saving deferred legacy pull retains inline recaps through migration")
    }
}

V7716BrowseInvalid() => V7716Run(V7716BrowseInvalidCase)
V7716BrowseInvalidCase(path,h)
{
    original := FileRead(path,"UTF-8"),root := ICSExpand(original,path,"history"),bad := path ".bad"
    for text in ["", "[]", "[9,[]]", "[3,[],`"../bad.details`"]", original "0", SubStr(original,1,-1), StrReplace(original,'[3,[[','[3,[[,'),StrReplace(original,',[]',',[,]')] {
        if text==original
            continue
        if FileExist(bad)
            FileDelete(bad)
        FileAppend(text,bad,"UTF-8-RAW")
        V64Reject((*)=>IHVReadHistory(bad),"malformed summary rejected")
    }
    for token in ['[01]','[+2]','[1.]','[1e]','["\q"]','[[1],]','[1,]'] {
        pos := 1
        V64Reject((*)=>IHVSpan(&token,&pos),"invalid deferred JSON rejected")
    }
    token := "0"
    Loop 40
        token := "[" token "]"
    pos := 1,V64Reject((*)=>IHVSpan(&token,&pos),"deep nesting rejected by bounded native pattern")
    root[2].Push(root[2][1]),FileDelete(bad),FileAppend(IGVJson(root),bad,"UTF-8-RAW")
    V64Reject((*)=>IHVReadHistory(bad),"duplicate saved keys rejected")
    root := ICSExpand(original,path,"history"),V7716CorruptPlayer(root)
    FileDelete(bad),FileAppend(IGVJson(root),bad,"UTF-8-RAW"),view := IHVReadHistory(bad)
    V64Reject((*)=>IHVExpand(view["synthetic"].Pull),"selected detail runs full semantic validation")
    V48Assert(view["synthetic"].Pull.HasOwnProp("IHVText") && !view["synthetic"].Pull.HasOwnProp("Players"),"failed hydration leaves no partial metrics")
    V64Reject((*)=>IHVReadHistory(path,V773CheckpointStop),"background reader remains cancellable")
}

V7716BrowseSnapshot() => V7716Run(V7716BrowseSnapshotCase)
V7716BrowseSnapshotCase(path,h)
{
    disk := FileRead(path,"UTF-8"),original := IGVJson(ICSExpand(disk,path,"history"))
    FileDelete(path),FileAppend(original,path,"UTF-8-RAW")
    old := IHVReadHistory(path),stamp := FileGetTime(path,"M")
    updated := StrReplace(original,"Unicode","Updated"),FileDelete(path),FileAppend(updated,path,"UTF-8-RAW"),FileSetTime(stamp,path,"M")
    fresh := IHVReadHistory(path)
    V48Assert(InStr(old["synthetic"].Team,"Unicode") && InStr(fresh["synthetic"].Team,"Updated"),"same-size same-time replacement is read freshly without mutating old snapshot")
    FileDelete(path),FileAppend("broken",path,"UTF-8-RAW")
    V48Assert(IHVExpand(old["synthetic"].Pull).Players.Count>0,"deferred pull belongs to original snapshot after source replacement")
    V64Reject((*)=>IHVReadHistory(path),"corrupt replacement never reuses stale view")
    FileDelete(path),FileAppend(original,path,"UTF-8-RAW")
}

V7716BrowseWindow() => V7716Run(V7716BrowseWindowCase)
V7716BrowseWindowCase(path,h)
{
    IGVEnsure(),v := IGVState(),v.Source := "history",v.History := IHVReadHistory(path),v.Boss := h["other"].Pull.Group
    IGVFillFilters(),IGVRefresh()
    V48Assert(v.Rows.Length=1 && v.History["synthetic"].Pull.HasOwnProp("IHVText"),"hidden native tab draws selected boss without expanding unrelated boss")
    V48Assert(IsObject(v.ImageSummary) && v.ImageSummary.Attempts=1,"graph summary uses expanded selected pull")
    v.Boss := h["synthetic"].Pull.Group,IGVFillFilters(),IGVRefresh()
    V48Assert(v.Rows.Length=1 && !v.History["synthetic"].Pull.HasOwnProp("IHVText"),"switching bosses loads the newly chosen encounter")
    before := FileRead(path,"UTF-8"),root := ICSExpand(before,path,"history"),V7716CorruptPlayer(root)
    FileDelete(path),FileAppend(IGVJson(root),path,"UTF-8-RAW"),v.History := IHVReadHistory(path)
    IGVFillFilters(),IGVRefresh()
    V48Assert(v.Rows.Length=0 && InStr(v.Controls["Status"].Text,"Could not open this encounter") && !v.Busy,"invalid selected details show a clear notice without stale graph or stuck controls")
    FileDelete(path),FileAppend(before,path,"UTF-8-RAW")
}

V7716CorruptPlayer(root)
{
    for row in root[2]
        if row[1]="synthetic"
            row[5][13][1][3] := -1
}

V7716ArchiveFixture(action) => V76Run(V7716ArchiveFixtureCase.Bind(action))
V7716ArchiveFixtureCase(action)
{
    f := V68ReviewFile(),s := ILBState(),SplitPath(s.TestPath,,&dir)
    cache := IPCState(),oldCache := cache.Clone(),cache.TestRoot := dir "\cache",cache.Enabled := true,cache.Build := ""
    original := dir "\combat_2026-10-03_20_00_00_001.txt",DirCreate(dir "\swtorlogsarchive")
    archived := dir "\swtorlogsarchive\Archive-combat_2026-10-03_20_00_00_001.txt"
    try {
        FileCopy(f.Path,original),source := ILBFile(original,"20261003",FileGetSize(original),FileGetTime(original,"M"),IPCHashFile(original),[ILBFight(f.State.Segments[1])])
        ILBLoad(),ILBCommitFile(source),FileMove(original,archived)
        action.Call(original,archived,source,f)
    }
    finally {
        for key,value in oldCache.OwnProps()
            cache.%key% := value
        FileDelete(f.Path)
    }
}

V7716ArchiveIdentity() => V7716ArchiveFixture(V7716ArchiveIdentityCase)
V7716ArchiveIdentityCase(original,archived,source,f)
{
    V48Assert(ILBArchivedPath(original,source)=archived,"moved recording resolves by exact digest")
    e := {Path:original,Source:source,Pull:source.Pulls[1]},copy := ILBArchivedEntry(e)
    V48Assert(copy.Path=archived && copy.Source.Path=archived && e.Path=original,"opening redirects a private entry without mutating catalogue")
    V48Assert(ILBSourceStatus(e)="Archive copy found","selection explains archive relocation")
    wrong := source.Clone(),wrong.Digest := Format("{:064}",0)
    V64Reject((*)=>ILBArchivedPath(original,wrong),"same filename with different contents is rejected")
    SplitPath(original,&name,&dir),DirCreate(dir "\logarchive"),duplicate := dir "\logarchive\Archive-" name
    FileCopy(archived,duplicate)
    V64Reject((*)=>ILBArchivedPath(original,source),"ambiguous matching archive copies require explicit choice")
    FileDelete(duplicate),FileCopy(archived,original)
    V48Assert(ILBArchivedPath(original,wrong)=original,"existing original is never silently redirected")
}

V7716ArchiveOpen() => V7716ArchiveFixture(V7716ArchiveOpenCase)
V7716ArchiveOpenCase(original,archived,source,f)
{
    global IP,Audio
    IP.Encoding := "UTF-8",before := FileRead(ILBState().TestPath,"UTF-8"),live := IP.Live,audioQueue := Audio.Queue
    IPWLibraryOpen(),e := {Path:original,Source:source,Pull:source.Pulls[1]}
    V48Assert(ILBOpenEntry(e),"actual Library handler opens archived recording")
    IPImportRun()
    V48Assert(IP.ImportDone && IP.ImportPath=archived && IP.Selected=1 && ILBIsLibraryView(IP),"archived view retains exact pull selection and fast view-only behavior")
    V48Assert(FileRead(ILBState().TestPath,"UTF-8")==before && IP.Live=live && Audio.Queue=audioQueue,"view does not rewrite catalogues or live/audio state")
}

V7716ArchiveQueue() => V7716ArchiveFixture(V7716ArchiveQueueCase)
V7716ArchiveQueueCase(original,archived,source,f)
{
    global IP
    IP.Encoding := "UTF-8",q := IQIState(),IQIEnqueue([original],true)
    IQIRun()
    V48Assert(q.Items.Length=1 && q.Items[1].State="Done" && q.Items[1].Path=original,"previously queued missing path completes through archive without replacing queue identity")
    files := ILBState().Files
    V48Assert(files.Has(StrLower(archived)) && !files.Has(StrLower(original)),"durable reindex reconnects catalogue and removes only exact stale path")
    V48Assert(IGVReadHistory(IQIHistory()).Count>0,"archive import retains saved Progression")
    V48Assert(ILBArchivedPath(original)=archived,"old queue alias remains resolvable after catalogue reconnection")
    other := source.Clone(),other.Path := original,FileCopy(archived,original)
    ILBCommitFile(other),ILBCommitFile(files[StrLower(archived)])
    V48Assert(ILBState().Files.Has(StrLower(original)),"a real existing source is never removed as a stale alias")
}

V7716ReindexPriority() => V7716ArchiveFixture(V7716ReindexPriorityCase)
V7716ReindexPriorityCase(original,archived,source,f)
{
    q := IQIState(),SplitPath(original,,&dir),one := dir "\combat_2026-10-04_20_00_00_001.txt",two := dir "\combat_2026-10-05_20_00_00_001.txt"
    FileCopy(archived,one),FileCopy(archived,two),IQIEnqueue([one,two,original])
    q.Items[1].State := "Done",IQISave()
    V48Assert(IWPPrepare([archived],true,"",false,true),"priority reindex preparation succeeds without starting a helper")
    V48Assert(q.Items.Length=4 && q.Items[1].Path=archived && q.Items[1].Force && q.Items[1].State="Pending","selected reindex runs before existing pending archive")
    V48Assert(q.Items[2].Path=one && q.Items[2].State="Done" && q.Items[3].Path=two && q.Items[4].Path=original,"completed and waiting queue entries remain intact")
    saved := FileRead(IQIPath(),"UTF-8"),q.Loaded := false,IQILoad()
    V48Assert(q.Items[1].Path=archived && q.Items.Length=4,"priority and rest of queue survive reload")
    FileAppend(" ",IQIPath(),"UTF-8"),disk := FileRead(IQIPath(),"UTF-8")
    V64Reject((*)=>IQIEnqueue([two],true,"",true),"priority preserves external-change guard")
    V48Assert(FileRead(IQIPath(),"UTF-8")==disk && q.Items[1].Path=archived,"failed priority save preserves both disk and memory order")
}

V7717Player(n, hp := 1000, place := "800,2320,228.5,0") => "@Tyth Test " n "#" n "|(" place ")|(" hp "/1000)"
V7717Boss(hp := 9000, instance := 7717) => "TYTH {4078423634870272}:" instance "|(808,2315,228.5,0)|(" hp "/10000)"
V7717Feed(s,at,kind,amount,source,target) => IPFeedLine(s,IPDemoLine(at,source,target,kind,amount))
V7717Other(s,at,source,target,effect) => IPFeedLine(s,"[" IPStamp(at) "] [" source "] [" target "] [] [Event {836045448945472}: Example {" effect "}]")
V7717Fixture()
{
    s := IPNewData(),p := V7717Player(1)
    IPFeedLine(s,"[00:00:00.100] [" p "] [] [] [AreaEntered {836045448953664}: Gods {833571547775765} Master {836045448953655}]")
    V7717Feed(s,1000,"Enter",0,p,"=")
    Loop 8
        V7717Feed(s,1000+A_Index,"Damage",100,V7717Player(A_Index),V7717Boss())
    return s
}
V7717Deaths(s,count := 8)
{
    Loop count
        V7717Feed(s,2000+A_Index,"Death",0,V7717Boss(),V7717Player(A_Index,0))
}
V7717Respawn(s,at := 2200,n := 1,place := "63.84,1553.43,229.61,0",hp := 1000)
{
    V7717Other(s,at,V7717Player(n,hp,place),"=","836045448945494")
}

V7717WipeRespawn() => V75LibraryRun(V7717WipeRespawnCase)
V7717WipeRespawnCase()
{
    global IP,Audio
    s := V7717Fixture(),seg := s.Current,audioQueue := Audio.Queue
    V7717Deaths(s),V7717Feed(s,2100,"Heal",300,V7717Player(1,0),V7717Player(2,0))
    V7717Respawn(s,2200,4)
    V48Assert(!IsObject(s.Current) && s.InCombat=0 && seg.WipeEnded && !seg.Terminal,"entrance respawn after all eight deaths closes wipe without Exit")
    V48Assert(seg.End=2008 && seg.Totals[IPActor(V7717Player(1)).Key].Heal=0,"recovery healing adds neither time nor healing")
    p := IPRCompact(seg)
    V48Assert(p.TotalDeaths=8 && p.Deaths.Length=8 && p.End=2008,"all final deaths and compact endpoint retained")
    V7717Feed(s,15000,"Heal",400,V7717Player(2),V7717Player(1))
    V48Assert(seg.End=2008 && !IsObject(s.Current),"recovery cannot restart or extend the timer")
    app := IPNewApp(),app.Live := s,app.Active := true
    snap := IPMSnapshot(IPMResolve(app,1))
    V48Assert(snap.Closed && snap.State="WIPED" && snap.Duration=1.008,"latest live overlay holds completed wipe time")
    V48Assert(Audio.Queue=audioQueue,"statistics repair never queues audio")
}

V7717BattleRez() => V75LibraryRun(V7717BattleRezCase)
V7717BattleRezCase()
{
    s := V7717Fixture(),seg := s.Current,V7717Deaths(s,1)
    V7717Feed(s,2100,"Damage",55,V7717Player(2),V7717Boss())
    V7717Respawn(s,2200,1,"800,2320,228.5,0",250)
    V7717Feed(s,2300,"Enter",0,V7717Player(1,250),"=")
    V7717Feed(s,2400,"Damage",77,V7717Player(1),V7717Boss())
    V48Assert(s.Current=seg && s.Segments.Length=1 && seg.End<0,"recorder death and battle rez keep same raid pull")
    s := V7717Fixture(),seg := s.Current,V7717Deaths(s)
    V7717Respawn(s,2200,1,"800,2320,228.5,0")
    V48Assert(s.Current=seg,"full-health in-arena resurrection alone is not a reset")
    s := V7717Fixture(),seg := s.Current,V7717Deaths(s,1),V7717Respawn(s)
    V48Assert(s.Current=seg,"one respawn alone never ends a raid with living participants")
}

V7717ResetTail() => V75LibraryRun(V7717ResetTailCase)
V7717ResetTailCase()
{
    s := V7717Fixture(),seg := s.Current,V7717Deaths(s,7)
    V7717Feed(s,2100,"Damage",17,V7717Player(2,0),V7717Boss())
    V7717Other(s,2200,V7717Boss(10000),"","836045448953669")
    V48Assert(s.Current=seg,"reset arriving before the final Death waits for that evidence")
    V7717Feed(s,2217,"Death",0,V7717Player(8,0),"=")
    V7717Other(s,2300,V7717Player(1,0),"","836045448953669")
    V48Assert(!IsObject(s.Current) && seg.End=2217 && seg.WipeEvidenceAt=2300,"same-instance reset plus final falling Death ends before respawn")
    p := IPRCompact(seg)
    V48Assert(p.TotalDeaths=8 && seg.Totals[IPActor(V7717Player(2)).Key].Damage=117,"reset closure retains last tick and all deaths")
}

V7717ResetGuards() => V75LibraryRun(V7717ResetGuardsCase)
V7717ResetGuardsCase()
{
    for variant in ["injured","no-injury","max-change","player-clear","wrong-mode","wrong-area","old-reset"] {
        s := V7717Fixture(),seg := s.Current,V7717Deaths(s)
        source := V7717Boss(10000),target := "",at := 2100
        switch variant {
            case "injured": source := V7717Boss(5000)
            case "no-injury": seg.EnemyVitals[IPActor(source).Key].Injured := false
            case "max-change": seg.EnemyVitals[IPActor(source).Key].Max := 12000
            case "player-clear": source := V7717Player(1),target := V7717Boss(10000)
            case "wrong-mode": s.ModeId := "836045448953652"
            case "wrong-area": s.AreaId := "elsewhere"
            case "old-reset": at := 900
        }
        V7717Other(s,at,source,target,"836045448953669")
        V48Assert(s.Current=seg,"reject false/stale reset: " variant)
    }
    for place in ["800,2320,228.5,0","63.84,1553.43,500,0","bad,coordinates,0,0"] {
        s := V7717Fixture(),seg := s.Current,V7717Deaths(s),V7717Respawn(s,2200,1,place)
        V48Assert(s.Current=seg,"non-entrance or malformed coordinates do not close a pull")
    }
    s := V7717Fixture(),seg := s.Current,V7717Deaths(s,7),V7717Respawn(s)
    V48Assert(s.Current=seg,"incomplete death evidence keeps combat open")
    s := V7717Fixture(),seg := s.Current,V7717Deaths(s,1)
    V7717Other(s,2200,V7717Player(1),"TYTH {4078423634870272}|(808,2315,228.5,0)|(10000/10000)","836045448953668")
    V48Assert(s.Current=seg,"missing instance ID is not proof of a newly spawned boss")
    s := V7717Fixture(),seg := s.Current,V7717Deaths(s,1)
    V7717Feed(s,2200,"Death",0,V7717Player(2),V7717Boss(0))
    V48Assert(seg.Terminal && !seg.HasOwnProp("WipeEnded"),"actual boss defeat remains a kill after recorder death")
}

V7717FreshInstance() => V75LibraryRun(V7717FreshInstanceCase)
V7717FreshInstanceCase()
{
    s := V7717Fixture(),seg := s.Current,V7717Deaths(s,1)
    V7717Feed(s,2100,"Damage",23,V7717Player(2),V7717Boss())
    V7717Other(s,6000,V7717Player(1),V7717Boss(10000,7718),"836045448953668")
    V48Assert(!IsObject(s.Current) && seg.End=2100 && seg.WipeEnded,"new full-health boss metadata closes old attempt before next Enter")
    V7717Feed(s,7000,"Enter",0,V7717Player(1),"=")
    V7717Feed(s,7100,"Damage",40,V7717Player(1),V7717Boss(9990,7718))
    V48Assert(s.Segments.Length=2 && s.Current.Start=7000 && s.Current.End<0,"next pull starts separately and ignores old blocking state")
}

V7717PendingExit() => V75LibraryRun(V7717PendingExitCase)
V7717PendingExitCase()
{
    s := V7717Fixture(),seg := s.Current,V7717Deaths(s)
    V7717Feed(s,2020,"Exit",0,V7717Player(1,0),"=")
    V7717Respawn(s)
    ; Exit rollback keeps deaths in PendingEnd rather than LifeDead. Restore
    ; is deferred until strong evidence is available; re-entry still works.
    V7717Other(s,4000,V7717Player(1),V7717Boss(10000,7718),"836045448953668")
    V48Assert(!IsObject(s.Current) && seg.End=2008 && IPRCompact(seg).TotalDeaths=8,"pending Exit preserves final deaths when new-instance reset confirms wipe")
}

V7717NahutReviveBatch() => V75LibraryRun(V7717NahutReviveBatchCase)
V7717NahutReviveBatchCase()
{
    for variant in ["same batch","late entrance","fight resumed","only seven deaths"] {
        s := IPNewData(),p := V7717Player(1)
        IPFeedLine(s,"[00:00:00.100] [" p "] [] [] [AreaEntered {836045448953664}: Gods {833571547775765} Master {836045448953655}]")
        V7717Feed(s,1000,"Enter",0,p,"=")
        nahut := "Nahut {4122949560827904}:296|(0,0,0,0)|(9000/10000)"
        Loop 8
            V7717Feed(s,1000+A_Index,"Damage",100,V7717Player(A_Index),nahut)
        seg := s.Current
        Loop (variant="only seven deaths" ? 7 : 8)
            V7717Feed(s,2000+A_Index,"Death",0,nahut,V7717Player(A_Index,0))
        V7717Respawn(s,2200,2,"-408.84,2603.01,206.41,0",250)
        V48Assert(s.Current=seg,"an in-room revive alone does not end Nahut")
        if variant="fight resumed"
            V7717Feed(s,2250,"Damage",100,V7717Player(2,250),nahut)
        V7717Respawn(s,variant="late entrance" ? 3201 : 2310,1)
        if variant="same batch" {
            V48Assert(!IsObject(s.Current) && seg.WipeEnded && seg.WipeEvidenceAt=2310,"the following entrance release confirms the same wipe")
            V48Assert(seg.End=2008 && IPRCompact(seg).TotalDeaths=8,"the wipe ends at the last death and keeps the death recap")
        }
        else V48Assert(s.Current=seg && !seg.HasOwnProp("WipeEnded"),"uncertain Nahut ending remains open: " variant)
    }
}

; Private, offscreen, non-activating native window. No real application launch,
; saved settings, source logs, audio, gameplay hotkeys or encounter mutations.
V786ResumePaint() => V58Isolated(V786ResumePaintCase)

V786ResumePaintCase()
{
    global IP,SELF_TEST
    V48Assert(SELF_TEST,"return repaint test requires an isolated diagnostic process")
    state := IWResumePaintState(),old := state.Clone(),g := Gui("+E0x08000000 +ToolWindow +0x02000000")
    foreground := DllCall("User32\GetForegroundWindow","Ptr")
    g.BackColor := "ECE6F2",g.SetFont("s11","Segoe UI")
    label := g.AddText("x10 y10 w240 h28","Text survives returning to Iris")
    list := g.AddListView("x10 y45 w280 h125",["Player","Damage"])
    list.Add(,"First",20),list.Add(,"Second",40),list.ModifyCol(2,"SortDesc"),list.Modify(1,"Select")
    hidden := g.AddText("x10 y180 Hidden","Other page stays hidden")
    child := Gui("+Parent" g.Hwnd " -Caption +0x02000000"),childText := child.AddText("w250 h22","Embedded page text")
    child.Show("NA x10 y175 w270 h35")
    a := IAState(),oldAnalysis := a.Gui,oldBusy := a.RenderBusy
    IP.Gui := g,IP.Rendering := false
    try {
        state.NativeTestHwnd := g.Hwnd,state.Pending := Map(),state.Installed := false
        IWResumePaintInstall()
        V48Assert(state.Installed,"native activation handler installs once")
        g.Show("NA x-30000 y-30000 w320 h220")
        Sleep(-1)
        h := g.Hwnd,selection := list.GetNext(),first := list.GetText(1,1),before := state.Repaints
        V48Assert(DllCall("User32\GetForegroundWindow","Ptr")=foreground,"offscreen fixture never takes foreground")
        ; Actual WM_ACTIVATE notification path; do not activate the desktop window.
        SendMessage(0x6,1,0,h),SendMessage(0x6,2,0,h)
        V48Assert(state.Pending.Count=1 && state.Repaints=before,"duplicate activations only queue work inside native callback")
        SetTimer(IWResumePaintPending,0)
        DllCall("User32\ValidateRect","Ptr",h,"Ptr",0)
        DllCall("User32\ValidateRect","Ptr",label.Hwnd,"Ptr",0)
        DllCall("User32\ValidateRect","Ptr",childText.Hwnd,"Ptr",0)
        IWResumePaintPending()
        V48Assert(state.Repaints=before+1 && !state.Pending.Count,"deferred repaint completes once")
        V48Assert(DllCall("User32\GetUpdateRect","Ptr",h,"Ptr",0,"Int",0,"Int"),"main window receives a native invalidation")
        V48Assert(DllCall("User32\GetUpdateRect","Ptr",label.Hwnd,"Ptr",0,"Int",0,"Int"),"child text receives a native invalidation too")
        V48Assert(DllCall("User32\GetUpdateRect","Ptr",childText.Hwnd,"Ptr",0,"Int",0,"Int"),"embedded page text receives a native invalidation")
        V48Assert(list.GetNext()=selection && list.GetText(1,1)=first && list.GetCount()=2,"repainting preserves table selection, sorting and data")
        V48Assert(!V58ChildVisible(hidden) && label.Text="Text survives returning to Iris","repaint keeps hidden pages hidden and preserves text")
        SendMessage(0x6,1,0,h),SendMessage(0x6,0,0,h)
        V48Assert(!state.Pending.Count,"switching away cancels the pending repaint")
        IP.Rendering := true,SendMessage(0x6,1,0,h),SetTimer(IWResumePaintPending,0)
        IWResumePaintPending(),SetTimer(IWResumePaintPending,0)
        V48Assert(state.Pending.Count=1 && state.Repaints=before+1,"active renderer delays repaint without recursion")
        IP.Rendering := false,IWResumePaintPending()
        V48Assert(state.Repaints=before+2,"repaint resumes after renderer finishes")
        ; Exercise the real one-shot timer, using a bounded message-pumping wait.
        SendMessage(0x6,1,0,h),started := A_TickCount
        while state.Pending.Count && A_TickCount-started<1000
            Sleep(10)
        V48Assert(state.Repaints=before+3 && !state.Pending.Count,"one-shot activation timer runs and then becomes idle")
        Sleep(150)
        V48Assert(state.Repaints=before+3,"no permanent periodic repaint remains")
        ; The same recovery supports a detached Analysis window.
        IP.Gui := "",a.Gui := g,a.RenderBusy := false
        SendMessage(0x6,1,0,h),SetTimer(IWResumePaintPending,0),IWResumePaintPending()
        V48Assert(state.Repaints=before+4,"standalone Analysis receives return-to-window repaint")
        before += 1,IP.Gui := g,a.Gui := oldAnalysis,a.RenderBusy := oldBusy
        IP.Rendering := true,SendMessage(0x6,1,0,h),SetTimer(IWResumePaintPending,0)
        Loop 20 {
            IWResumePaintPending(),SetTimer(IWResumePaintPending,0)
        }
        V48Assert(!state.Pending.Count && state.Repaints=before+3,"busy retries are bounded")
        IP.Rendering := false,SendMessage(0x6,1,0,h),SetTimer(IWResumePaintPending,0),g.Hide()
        IWResumePaintPending()
        V48Assert(!state.Pending.Count && state.Repaints=before+3,"hidden window is not shown or painted")
        savedIP := IP,requests := state.Requests
        try {
            IP := unset
            V48Assert(IWResumePaintTarget(h)="" && IWResumePaintBusy(h),"released parser state cannot be inspected or painted")
            IWResumePaintMessage(1,0,0x6,h),IWResumePaintPending()
            SELF_TEST := unset
            IWResumePaintMessage(1,0,0x6,h),IWResumePaintPending()
            V48Assert(state.Requests=requests && !state.Pending.Count,"late activation and timer callbacks ignore released globals")
        }
        finally IP := savedIP,SELF_TEST := true
        SendMessage(0x6,1,0,h)
        V48Assert(state.Pending.Count=1,"shutdown fixture has a pending native repaint")
        V48Assert(IWResumePaintShutdown()=0 && !state.Installed && !state.Pending.Count,"shutdown clears pending windows and cannot veto exit")
        requests := state.Requests
        SendMessage(0x6,1,0,h),IWResumePaintMessage(1,0,0x6,h),IWResumePaintPending()
        V48Assert(state.Requests=requests && !state.Pending.Count,"unregistered callback and stale calls cannot requeue after shutdown")
        V48Assert(IWResumePaintShutdown()=0,"repeated shutdown is harmless")
        IWResumePaintInstall()
        g.Show("NA"),SendMessage(0x6,1,0,h),SetTimer(IWResumePaintPending,0),g.Destroy()
        IWResumePaintPending()
        V48Assert(!state.Pending.Count && state.Repaints=before+3,"destroyed window cannot receive deferred painting")
        V48Assert(state.Failures=old.Failures,"native painting reports no failures")
        V48Assert(DllCall("User32\GetForegroundWindow","Ptr")=foreground,"all recovery paths preserve the foreground app")
    }
    finally {
        SetTimer(IWResumePaintPending,0)
        OnMessage(0x6,IWResumePaintMessage,0)
        OnExit(IWResumePaintShutdown,0)
        for key,value in old.OwnProps()
            state.%key% := value
        if old.Installed {
            OnMessage(0x6,IWResumePaintMessage)
            OnExit(IWResumePaintShutdown,-1)
        }
        try g.Destroy()
        try child.Destroy()
        a.Gui := oldAnalysis,a.RenderBusy := oldBusy
        IP.Gui := "",IP.Rendering := false
    }
}

V787RefreshDeferral() => V58Isolated(V787RefreshDeferralCase)
V787RefreshStartPull(*)
{
    global IP
    if !IQBState().Refreshing {
        SetTimer(V787RefreshStartPull,-1)
        return
    }
    IP.Active := true,IP.Live.Current := {FinishAt:-1}
}
V787RefreshDeferralCase()
{
    global IP,SELF_TEST
    V48Assert(SELF_TEST,"refresh fixture requires isolated diagnostics")
    b := IQBState(),s := ILBState(),oldB := b.Clone(),oldS := s.Clone(),path := A_Temp "\Iris_Refresh_Test_" INToken() ".json"
    native := INState(),oldHelper := native.TestHelper,oldWorker := native.WorkerHelper
    try {
        native.TestHelper := "",native.WorkerHelper := ""
        IP.Active := false,IP.Queue := [],IP.Head := 1,IP.Live := IPNewData("PRIVATE REFRESH")
        b.Active := true,b.Child := false,b.Refreshing := false,b.Library := path,b.Revision := 5,b.SeenRevision := 4
        s.Loading := false,s.Files := Map("previous",{Marker:1}),s.Original := "previous",s.Loaded := true
        before := s.Files,rows := [],hash := ""
        Loop 64
            hash .= "a"
        Loop 5000
            rows.Push(["C:\IrisPrivate\" A_Index ".txt","20261008",0,"20261008200000",hash,"fixture",[]])
        FileAppend(IGVJson(["IrisLogLibrary",1,rows]),path,"UTF-8")
        V48Assert(IQBQuiet(),"fixture begins between pulls")
        SetTimer(V787RefreshStartPull,-20)
        refreshed := IQBRefreshCatalogues()
        V48Assert(IP.Active && b.RefreshDeferred && !refreshed,"new pull during real catalogue parse defers without exception")
        V48Assert(s.Files=before && s.Original="previous" && b.SeenRevision=4 && !b.Refreshing,"deferred refresh preserves the previous complete snapshot and releases its guard")
        IP.Active := false,IP.Live.Current := ""
        V48Assert(IQBRefreshCatalogues() && s.Files.Count=5000 && b.SeenRevision=5,"quiet retry commits a complete validated snapshot")
        V48Assert(!b.RefreshDeferred && !b.Refreshing,"retry clears transient deferral state")
        before := s.Files,b.Revision += 1,FileDelete(path),FileAppend("[invalid]",path,"UTF-8")
        V59ExpectError(IQBRefreshCatalogues)
        V48Assert(s.Files=before && !b.Refreshing && b.SeenRevision=5,"genuine data error still propagates and never replaces saved results")
    }
    finally {
        SetTimer(V787RefreshStartPull,0)
        native.TestHelper := oldHelper,native.WorkerHelper := oldWorker
        for key,value in oldB.OwnProps()
            b.%key% := value
        for key,value in oldS.OwnProps()
            s.%key% := value
        if FileExist(path)
            FileDelete(path)
    }
}


; Private native fixtures only. No live input, audio, source imports or saved-state writes.
V7810DeferredTable() => V749ProgressionFixture(V7810DeferredTableCase)
V7810SharedPhases() => V58Isolated(V7810SharedPhasesCase)

V7810DeferredTableCase(v)
{
    V749ProgressionSetSize(1220,780)
    v.DetailVisible := false
    rows := V7432ProgressionEntries(),before := V741SavedSignature(rows)
    V7432ProgressionSeed(v,rows),lv := v.Controls["Rows"]
    V48Assert(v.Rows.Length=4 && !v.TableReady && lv.GetCount()=0,"graph opens without constructing its hidden native table")
    IGVSelect(3),label := v.Controls["Selected"].Text
    V48Assert(v.Selected=3 && InStr(label,"10.0%") && !v.TableReady,"graph selection works before the table exists")
    IGVToggleDetails()
    V48Assert(v.DetailVisible && v.TableReady && lv.GetCount()=4 && lv.GetNext()=3,"opening table populates it and restores graph selection")
    for i,e in v.Rows {
        V48Assert(lv.GetText(i,1)=i && lv.GetText(i,3)=v.ImageSummary.BasePlot.Points[i].Label
            && lv.GetText(i,4)=IPRTime(e.Pull.End-e.Pull.Start) && lv.GetText(i,7)=e.Pull.Id,
            "deferred table retains pull identity, HP and duration " i)
    }
    IGVToggleDetails(),IGVSelect(1),IGVToggleDetails()
    V48Assert(v.TableReady && lv.GetCount()=4 && v.Selected=1,"hide/show keeps loaded table and current pull")
    IGVToggleDetails(),v.History.Delete(rows[1].Key),IGVRefresh()
    V48Assert(v.Rows.Length=3 && !v.TableReady && lv.GetCount()=0,"hidden filter refresh invalidates stale table rows")
    IGVSelect(2),IGVToggleDetails()
    V48Assert(v.TableReady && lv.GetCount()=3 && lv.GetText(2,7)=rows[3].Pull.Id && lv.GetNext()=2,"reopening table uses newly filtered rows and selection")
    v.History.Delete(rows[2].Key),IGVRefresh()
    V48Assert(v.TableReady && lv.GetCount()=2 && lv.GetText(1,7)=rows[3].Pull.Id,"visible table refresh stays immediate")
    V48Assert(V741SavedSignature(rows)=before,"table navigation leaves all saved pull evidence unchanged")
}

V7810SharedPhasesCase()
{
    for kind in ["hp","combined","parsely"] {
        rows := V7432ProgressionEntries(kind),group := rows[1].Pull.Group,profile := IGPYViewProfile(group)
        for pass in [1,2,3] {
            if pass=2
                rows[1].Pull.Partial := true
            if pass=3
                rows.Pop()
            contexts := []
            for row in rows
                contexts.Push(IGPYViewData(row,profile,group))
            expected := IGPCBuild(rows,group),markers := ISRIPhaseMilestones(rows,group)
            actual := IGPCBuild(rows,group,"",contexts)
            V48Assert(V7810Signature(actual)=V7810Signature(expected),"shared phase observations preserve full consistency result: " kind " / " pass)
            V48Assert(V7810Signature(ISRIPhaseMilestones(rows,group,contexts))=V7810Signature(markers),
                "shared phase observations preserve milestones after consistency ordering: " kind " / " pass)
        }
    }
}

V7810Signature(value)
{
    if !IsObject(value)
        return IGVJson(value)
    rows := []
    if value is Array {
        for item in value
            rows.Push(V7810Signature(item))
    }
    else if value is Map {
        for key,item in value
            rows.Push([key,V7810Signature(item)])
    }
    else {
        for key,item in value.OwnProps()
            rows.Push([key,V7810Signature(item)])
    }
    return IGVJson(rows)
}

; Native, isolated catalogue/GUI checks. No source imports or live actions.
V7811StatisticsModel() => V75LibraryRun(V7811StatisticsModelCase)
V7811StatisticsNative() => V75LibraryRun(V7811StatisticsNativeCase)
V7811RecoveryProgress() => V58Isolated(V7811RecoveryProgressCase)

V7811StatisticsModelCase()
{
    files := V75LibraryFiles(),rows := ILBRows(files),m := ILBSModel(rows)
    V48Assert(m.Pulls=5 && m.Kills=4 && m.Millis=300000 && m.Days=1 && m.Bosses=1,"statistics count raid pulls once, not once per player")
    f := rows[1].Source,copy := IPRCloneSnapshot(f),copy.Path .= ".copy"
    files[StrLower(copy.Path)] := copy,m := ILBSModel(ILBRows(files))
    V48Assert(m.Pulls=5 && m.Kills=4 && m.Millis=300000 && m.Alternates=5,"matching copied recordings do not double totals")
    files.Delete(StrLower(copy.Path))
    p := V75LibraryPull(6,86410000,"No kill"),p.Boss := "G-IZ",p.Name := "Izax",p.End := p.Start+120000,p.Partial := true
    f.Pulls.Push(p),p := V75LibraryPull(7,86600000),p.Mode := "836045448953651",f.Pulls.Push(p)
    p := V75LibraryPull(8,86800000,"No kill"),p.End := p.Start,f.Pulls.Push(p)
    p := V75LibraryPull(9,87000000),p.Boss := "DUMMY",p.Name := "Operations Training Dummy",p.Mode := "",f.Pulls.Push(p)
    before := IGVJson(ILBPack(files)),rows := ILBRows(files),m := ILBSModel(rows)
    V48Assert(m.Pulls=8 && m.Kills=5 && m.Millis=480000 && m.Partial=1 && m.Days=2 && m.Bosses=2,"partial and zero-duration pulls count, with only captured time added")
    V48Assert(m.First="20261003" && m.Last="20261004" && m.Rows.Length=3,"dates cross midnight and difficulties have separate ranking rows")
    V48Assert(ILBSModel(rows,"",true).Pulls=9 && ILBSModel(rows,"",true).Kills=6,"training dummy sessions are opt-in and excluded from default boss totals")
    master := ILBSModel(rows,"836045448953655")
    V48Assert(master.Pulls=7 && master.Kills=4 && master.Millis=420000 && master.Rows.Length=2,"difficulty applies to cards and every ranking")
    V48Assert(ILBSModel(rows,"missing").Pulls=0 && ILBSModel([]).Rows.Length=0,"empty filters return a valid empty model")
    for metric in ["Pulls","Kills","Millis"] {
        sorted := ILBSSort(m.Rows,metric)
        Loop sorted.Length-1
            V48Assert(sorted[A_Index].%metric%>=sorted[A_Index+1].%metric%,"ranking is numeric descending: " metric)
    }
    tied := [m.Rows[1].Clone(),m.Rows[1].Clone()],tied[1].Name := "Zeta",tied[2].Name := "Alpha"
    V48Assert(ILBSSort(tied)[1].Name="Alpha","ranking ties are deterministic by name")
    V48Assert(ILBSNumber(15493)="15,493" && ILBSHours(7200000)="2.0","large count and hour labels use readable units")
    V48Assert(IGVJson(ILBPack(files))=before,"aggregating and sorting leave every saved field unchanged")
}

V7811StatisticsNativeCase()
{
    global IP,Audio
    lib := ILBState(),s := ILBSState(),lib.Files := V75LibraryFiles(),lib.Loaded := true,lib.Dirty := true
    lib.AutoLoaded := true,lib.AutoLive := false,lib.LivePending := Map(),lib.AutoError := ""
    live := IP.Live,queueBefore := Audio.Queue,before := IGVJson(ILBPack(lib.Files)),builds := s.Builds
    IPWLibraryOpen(),c := lib.Controls
    V48Assert(s.Builds=builds && !IsObject(s.Rows),"opening Library does not calculate hidden Statistics")
    V48Assert(!V58ChildVisible(c["Progress"]),"idle Library does not add another progress bar after startup")
    lib.Busy := true,ILBBusy(),ILBProgress({Percent:45,Stage:"Reading",Records:10})
    V48Assert(V58ChildVisible(c["Progress"]) && c["Progress"].Value=45,"active Library import retains its own progress")
    lib.Busy := false,ILBBusy()
    V48Assert(!V58ChildVisible(c["Progress"]) && c["Progress"].Value=0,"paused or finished Library hides and clears its progress track")
    c["Search"].Value := "does not match",ILBFilterChanged()
    c["Tabs"].Choose(5),ILBPageChanged()
    V48Assert(c["StatsValue1"].Text="5" && c["StatsValue2"].Text="4" && c["StatsList"].GetCount()=1,"Statistics opens as a distinct Library page with full-database totals")
    V48Assert(lib.Shown.Length=0 && c["Search"].Value="does not match","statistics neither applies nor changes Library searches")
    n := s.Builds,rows := s.Rows,c["StatsSort"].Choose(2),ILBSRefresh(),ILBSRefresh()
    V48Assert(s.Builds=n && s.Rows=rows && c["StatsList"].GetText(1,5)="4","changing rankings reuses the aggregate without reading the database")
    c["StatsMode"].Choose(2),ILBSRefresh()
    V48Assert(c["StatsValue1"].Text="0" && c["StatsList"].GetCount()=0 && InStr(c["StatsRange"].Text,"No saved fights"),"empty difficulty displays zeros and a useful message")
    c["StatsMode"].Choose(1),ILBSRefresh()
    replacement := IPRCloneSnapshot(lib.Files)
    for key,f in replacement
        f.Pulls.Pop()
    lib.Files := replacement,lib.Dirty := true,ILBRefresh()
    V48Assert(c["StatsValue1"].Text="4" && c["StatsValue2"].Text="3" && s.Rows!=rows,"committed replacement snapshot invalidates statistics")
    lib.Busy := true,ILBSRefresh(),V48Assert(c["StatsValue1"].Text="4","saved statistics remain usable during an import"),lib.Busy := false
    for dims in [[980,650],[1920,1080]] {
        box := V749ProgressionSetSize(dims[1],dims[2]),controls := []
        for control in lib.Gui {
            if V58ChildVisible(control) {
                control.GetPos(&x,&y,&w,&h),controls.Push(control)
                V48Assert(x>=0 && y>=0 && x+w<=box.W+1 && y+h<=box.H+1,"statistics controls fit the embedded page at " dims[1] ": " control.Type)
            }
        }
        V7412PlayerControlsPng("statistics-" dims[1] ".png",lib.Gui,controls,0,0,box.W,box.H)
    }
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int") && IP.Live=live && Audio.Queue=queueBefore,"statistics stays hidden in diagnostics and leaves live data/audio alone")
    ILBSReset(),V48Assert(!IsObject(s.Rows) && !s.Models.Count,"closing/reset releases the aggregate snapshot")
}

V7811RecoveryProgressCase()
{
    global IP
    IPWBuild(),bar := IP.LoadingBar,handle := bar.Hwnd,IP.LateStart := {File:{Pos:450},Origin:100,End:1100}
    try {
        for size in [[980,650],[1920,1080],[1220,800]] {
            IPResize(IP.Gui,0,size[1],size[2])
            V48Assert(bar.Hwnd=handle && bar.LoadingMode="read" && bar.Value=350 && V58ChildVisible(bar),"startup recovery uses the same visible bar after resize")
            ; The import painter must not hide/reset a recovery it does not own.
            IPImportLoadingPaint(IP)
            V48Assert(bar.LoadingMode="read" && bar.Value=350 && V58ChildVisible(bar),"ordinary status paint preserves recovery without hide/show cycling")
            bar.GetPos(&bx,&by,&bw,&bh),IP.StatusText.GetPos(&sx,&sy,&sw,&sh)
            V48Assert(bx+bw<sx && sx+sw<=size[1]-12 && by>=sy && by+bh<=sy+sh,"recovery text and bar share one status row")
        }
        IPImportLoadingPaint(IP,"hide"),V48Assert(!V58ChildVisible(bar),"explicit hide still hides the recovery bar")
        IPLateLoadingPaint(),V48Assert(bar.Value=350 && V58ChildVisible(bar),"recovery wrapper delegates to the shared painter")
        IP.LateStart := "",IPImportLoadingPaint(IP)
        V48Assert(bar.LoadingMode="hide" && bar.Value=0 && !V58ChildVisible(bar),"ending recovery clears its bar")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"native recovery display checks never reveal a window")
    }
    finally IP.LateStart := ""
}

; Account comparisons resolve only the recording character in each saved pull.
V7811AccountModel() => V75LibraryRun(V7811AccountModelCase)
V7811AccountNative() => V75LibraryRun(V7811AccountNativeCase)
V7811AccountBests() => V76Run(V7811AccountBestsCase)

V7811OwnerFiles()
{
    files := V75LibraryFiles()
    for path,f in files {
        for i,p in f.Pulls {
            key := "@Alt#" i,name := "Alt " i,old := p.Recorder
            player := p.Players[old],player.Name := name
            p.Players := Map(key,player,"@Friend#99",{Name:"Friend",Spec:"123",Damage:9900000,Heal:999999,Effective:999999,HealKnown:3,HealRecords:3,Deaths:0})
            p.Challenges[1].Players := Map(key,p.Challenges[1].Players[old]),p.Challenges[1].Verified := 1
            p.Challenges[1].Players[key].Damage *= i
            p.Recorder := key,p.Result := "Kill"
        }
        f.Pulls[3].Players[f.Pulls[3].Recorder].Spec := "456"
        f.Pulls[4].Recorder := ""
        f.Pulls[5].Partial := 1
    }
    return files
}

V7811AccountModelCase()
{
    files := V7811OwnerFiles(),before := IGVJson(ILBPack(files)),rows := ILBRows(files),token := ILBOwnerToken()
    args := [rows,token,"G-TY","836045448953655","123","Kill"]
    points := ILBPerformance(args*)
    V48Assert(points.Length=2 && points[1].Key="@Alt#1" && points[2].Key="@Alt#2","own comparisons span recording characters without manual links")
    V48Assert(points[1].Value=2000 && points[2].Value=4000,"raid members and different disciplines do not inflate the account result")
    V48Assert(ILBPerformance(rows,"@Friend#99","G-TY","836045448953655","123","Kill").Length=4,"an exact other-player comparison remains available")
    V48Assert(ILBPerformance(rows,token,"G-TY","836045448953655","456","Kill").Length=1,"another discipline stays separately selectable")
    V48Assert(ILBPerformance(rows,token,"G-TY","836045448953652","123","Kill").Length=0,"difficulty remains an exact comparison")
    V48Assert(!ILBCharacterMatches(rows[4].Pull,token),"missing recorder never falls back to the first player")
    V48Assert(ILBPerformance(rows,token,"G-TY","836045448953655","123","Kill","HPS")[2].Value=200,"account healing uses the recording character")
    V48Assert(ILBPerformance(rows,token,"G-TY","836045448953655","123","Kill","EHPS")[2].Value=150,"account effective healing uses known totals")
    phase := ILBPerformance(rows,token,"G-TY","836045448953655","123","Kill","DPS","burn-1")
    V48Assert(phase.Length=2 && phase[2].Amount=60000 && phase[2].Value=6000,"phase and challenge totals resolve the same recording character")
    marks := IPBESTTrendMarks(points,rows,token,"G-TY","836045448953655","123","DPS","")
    V48Assert(marks[1]="Baseline" && marks[2]="PB","personal-best markers carry across alts")
    IALTState().Groups := [{Id:"account",Name:"Linked",Members:[{Key:"@Alt#1",Name:"Alt 1"},{Key:"@Alt#2",Name:"Alt 2"}]}]
    V48Assert(ILBPerformance(rows,IALTToken("account"),"G-TY","836045448953655","123","Kill").Length=2,"manual person links still compare their selected characters")
    V48Assert(IGVJson(ILBPack(files))=before,"account comparisons do not rewrite catalogues or player links")
    roundtrip := ILBRows(ILBParse(before))
    V48Assert(ILBPerformance(roundtrip,token,"G-TY","836045448953655","123","Kill")[2].Value=4000,"existing saved recorder fields work without reindexing")
    rows[2].Pull.Players["@Alt#2"].HealKnown := 1
    V48Assert(ILBPerformance(rows,token,"G-TY","836045448953655","123","Kill","EHPS").Length=1,"unknown effective healing stays excluded across alts")
    rows[2].Pull.Result := "No kill"
    wipe := ILBPerformance(rows,token,"G-TY","836045448953655","123","No kill")
    V48Assert(wipe.Length=1 && !wipe[1].PBEligible && IPBESTMarks(wipe,true)[1]="","wipes remain separate and cannot set a whole-fight best")
}

V7811AccountNativeCase()
{
    global IP,Audio
    s := ILBState(),s.Files := V7811OwnerFiles(),s.Loaded := true,live := IP.Live,queueBefore := Audio.Queue
    IALTState().Groups := [{Id:"account",Name:"Linked",Members:[{Key:"@Alt#1",Name:"Alt 1"},{Key:"@Alt#2",Name:"Alt 2"}]}]
    ILBBuildWindow(),ILBRefresh(),c := s.Controls,c["Tabs"].Choose(3),ILBPageChanged()
    V48Assert(c["TrendCharacter"].Value=1 && c["TrendCharacter"].Text="My characters","Performance defaults to the recorder account")
    c["TrendBoss"].Choose(2),c["TrendSpec"].Choose(2),c["TrendMode"].Choose(6),ILBTrendChanged(c["TrendBoss"])
    V48Assert(s.Trends.Length=2 && c["TrendList"].GetText(1,2)="Alt 1" && c["TrendList"].GetText(2,2)="Alt 2","native results combine alts while naming the actual character")
    V48Assert(c["TrendList"].GetText(2,3)="PB" && InStr(c["TrendNote"].Text,"across your characters"),"UI explains combined results and shows the cross-alt PB")
    for i,key in s.Characters
        if key="@Friend#99"
            c["TrendCharacter"].Choose(i+1)
    ILBTrendChanged(c["TrendCharacter"])
    V48Assert(s.Trends.Length=4 && s.Trends[1].Key="@Friend#99","explicit character choice retains its original offset")
    ILBBrowseSync(true),ILBTrendChanged(c["TrendCharacter"])
    V48Assert(ILBTrendSelection(c["TrendCharacter"],s.Characters)="@Friend#99" && s.Trends.Length=4,"refresh preserves an explicit character selection")
    for i,key in s.Characters
        if key=IALTToken("account")
            c["TrendCharacter"].Choose(i+1)
    ILBTrendChanged(c["TrendCharacter"])
    V48Assert(s.Trends.Length=2 && c["TrendCharacter"].Text="Linked (linked characters)","other accounts can still be selected through manual links")
    c["TrendCharacter"].Choose(1),ILBBrowseSync(true),ILBTrendChanged(c["TrendCharacter"])
    V48Assert(c["TrendCharacter"].Text="My characters" && s.Trends.Length=2,"refresh also preserves the default account choice")
    c["TrendChallenge"].Choose(2),ILBTrendChanged(c["TrendChallenge"])
    V48Assert(s.Trends.Length=2 && s.Trends[2].Value=6000,"native phase/challenge selector works across alts")
    V48Assert(Audio.Queue=queueBefore && IP.Live=live && !DllCall("User32\IsWindowVisible","Ptr",s.Gui.Hwnd,"Int"),"account diagnostics never show UI or disturb live/audio state")
}

V7811AccountBestsCase()
{
    rows := ILBRows(V7811OwnerFiles()),old := rows[1],next := rows[2],p := next.Pull
    records := IPBESTCompare([old],next)
    V48Assert(records.Length=2 && records[1].Previous=2000 && records[1].Value=4000,"optional PB notice compares previous recording alts for whole fight and phase")
    V48Assert(!IPBESTCompare([],next).Length && !IPBESTCompare([old,next],next).Length,"first baseline and already indexed pulls stay quiet")
    p.Players[p.Recorder].Spec := "different"
    V48Assert(!IPBESTCompare([old],next).Length,"account notices never mix disciplines"),p.Players[p.Recorder].Spec := "123"
    p.Area := "different",V48Assert(!IPBESTCompare([old],next).Length,"account notices never mix instances"),p.Area := old.Pull.Area
    p.Mode := "different",V48Assert(!IPBESTCompare([old],next).Length,"account notices never mix difficulty"),p.Mode := old.Pull.Mode
    p.Result := "No kill",records := IPBESTCompare([old],next)
    V48Assert(records.Length=1 && records[1].Name="Burn","only a verified completed window can set a best on a wipe")
    p.Challenges[1].Partial := 1,V48Assert(!IPBESTCompare([old],next).Length,"unfinished challenge never sets an account best")
    p.Result := "Kill",p.Partial := 1,V48Assert(!IPBESTCompare([old],next).Length,"partial recording cannot set an account best"),p.Partial := 0
    p.Recorder := "",V48Assert(!IPBESTCompare([old],next).Length,"missing recorder never attributes a raid member's PB to the owner")
}

V7812StatisticsSorting() => V75LibraryRun(V7812StatisticsSortingCase)

V7812StatisticsSortingCase()
{
    rows := [{Key:"a",Rank:1,Name:"Alpha",Mode:"836045448953655",Pulls:1000,Kills:20,Millis:59000000},
        {Key:"b",Rank:2,Name:"Beta",Mode:"836045448953651",Pulls:20,Kills:2,Millis:1200000},
        {Key:"c",Rank:3,Name:"Gamma",Mode:"836045448953652",Pulls:2,Kills:1,Millis:120100}]
    for metric in ["Rank","Name","Mode","Pulls","Kills","Millis","Average"] {
        asc := ILBSSort(rows,metric,false),desc := ILBSSort(rows,metric,true)
        V48Assert(asc.Length=3 && desc.Length=3 && asc[1]=desc[3] && asc[3]=desc[1],"column direction reverses exact raw ordering: " metric)
    }
    V48Assert(ILBSSort(rows,"Pulls",false)[1].Pulls=2 && ILBSSort(rows,"Pulls")[1].Pulls=1000,"comma-formatted numbers sort numerically")
    V48Assert(ILBSSort(rows,"Average",false)[1].Name="Alpha" && ILBSSort(rows,"Average")[1].Name="Gamma","average duration sorts unrounded milliseconds, including displayed minute ties")
    V48Assert(rows[1].Name="Alpha" && rows[3].Rank=3,"sorting never reorders source rows or changes ranks")
    lib := ILBState(),lib.Files := V75LibraryFiles(),lib.Loaded := true
    for path,f in lib.Files {
        f.Pulls[1].Boss := "G-NA",f.Pulls[1].Name := "Nahut",f.Pulls[1].End += 60000
        f.Pulls[2].Boss := "DF-BR",f.Pulls[2].Name := "Dread Master Brontes"
    }
    before := IGVJson(ILBPack(lib.Files)),ILBBuildWindow(),ILBRefresh(),c := lib.Controls
    c["Tabs"].Choose(5),ILBPageChanged(),s := ILBSState(),builds := s.Builds,lv := c["StatsList"]
    V48Assert(s.Shown[1].Name="Tyth" && InStr(lv.GetText(0,4),"▼"),"default descending pull ranking has an indicator")
    ILBSColumnClick(lv,4)
    V48Assert(!s.Descending && s.Shown[1].Name="Dread Master Brontes" && InStr(lv.GetText(0,4),"▲"),"clicking the active heading reverses it immediately")
    ILBSColumnClick(lv,4),V48Assert(s.Descending && s.Shown[1].Name="Tyth","second click restores descending pulls")
    ILBSColumnClick(lv,2),V48Assert(!s.Descending && s.Shown[1].Name="Dread Master Brontes","new text column starts alphabetically")
    ILBSColumnClick(lv,2),V48Assert(s.Descending && s.Shown[1].Name="Tyth","text direction can be reversed")
    ILBSColumnClick(lv,7),V48Assert(s.Descending && s.Shown[1].Name="Nahut","average pull column starts longest first")
    ILBSColumnClick(lv,7),V48Assert(!s.Descending && s.Shown[3].Name="Nahut","average pull can be sorted shortest first")
    ILBSColumnClick(lv,1),V48Assert(s.Shown[1].Rank=1 && lv.GetText(1,1)="1","rank column keeps ranking numbers independent of display sorting")
    ILBSColumnClick(lv,1),V48Assert(s.Shown[1].Rank=3 && lv.GetText(1,1)="3","rank can be reversed without renumbering rows")
    lib.Busy := true,ILBSColumnClick(lv,5),V48Assert(s.SortColumn=5 && s.Shown[1].Kills=3,"saved statistics can still sort during imports"),lib.Busy := false
    c["StatsSort"].Choose(3),ILBSRankingChanged()
    V48Assert(s.SortColumn=0 && s.Descending && s.Shown[1].Name="Tyth" && InStr(lv.GetText(0,6),"▼"),"ranking dropdown restores its default descending order and indicator")
    ILBSColumnClick(lv,2),ILBBrowseSync(true),ILBSRefresh()
    V48Assert(s.SortColumn=2 && !s.Descending && s.Shown[1].Name="Dread Master Brontes","replacing the snapshot preserves the chosen column and direction")
    V48Assert(s.Builds=builds+1 && IGVJson(ILBPack(lib.Files))=before,"column clicks reuse aggregates and never rewrite saved data")
    for size in [[980,650],[1920,1080]] {
        lib.Gui.Show("Hide w" size[1] " h" size[2]),ILBResize(lib.Gui,0,size[1],size[2]),controls := []
        for control in lib.Gui
            if V58ChildVisible(control)
                controls.Push(control)
        V7412PlayerControlsPng("statistics-sorting-" size[1] ".png",lib.Gui,controls,0,0,size[1],size[2])
    }
}

V7813PerformanceSorting() => V75LibraryRun(V7813PerformanceSortingCase)
V7813EncounterBoundaries() => V75LibraryRun(V7813EncounterBoundariesCase)
V7813ReindexFragments() => V75LibraryRun(V7813ReindexFragmentsCase)

V7813ReindexFragmentsCase()
{
    p := V635Pull(),p.Boss := "DF-BR",p.Group := p.Boss "|" p.Area "|" p.Mode
    p.Players := Map(),p.Deaths := [],p.DeathRecaps := Map()
    p.Start := 1000,p.End := 481000,p.Progress.Kill := true,p.Progress.Hp := 0,p.Partial := false
    first := IPRCloneSnapshot(p),first.End := 440000,first.Progress.Kill := false,first.Progress.Hp := 8
    tail := IPRCloneSnapshot(p),tail.Start := 441000
    history := IGLMerge(Map(),[first,tail],"fixture","20260927","Team").History
    before := IAIBinaryHash(IPCEncode(history)),key := IGVHistoryKey(IGLSession("fixture","20260927"),p)
    result := IGLMerge(history,[p],"fixture","20260927","Team")
    V48Assert(result.History.Count=1 && result.Updated=2 && result.History[key].Pull.End=481000,"reindex retires the old same-source post-exit kill fragment")
    V48Assert(IAIBinaryHash(IPCEncode(history))=before,"reconciliation never mutates the prior saved snapshot")
    again := IGLMerge(result.History,[p],"fixture","20260927","Team")
    V48Assert(again.Unchanged=1 && !again.Updated,"corrected reindex is idempotent")
    for guard in ["source","team","excluded","recorder","outside","root kill","partial"] {
        changed := IPRCloneSnapshot(history),incoming := IPRCloneSnapshot(p)
        for k,e in changed {
            if e.Pull.Start=tail.Start {
                if guard="source"
                    e.Session := "another recording"
                if guard="team"
                    e.Team := "Other"
                if guard="excluded"
                    e.Pull.Included := false
                if guard="recorder"
                    e.Pull.RecorderKey := "@Different#99"
                if guard="outside"
                    e.Pull.End += 1
            }
        }
        if guard="root kill"
            changed[key].Pull.Progress.Kill := true
        if guard="partial"
            incoming.Partial := true
        checked := IGLMerge(changed,[incoming],"fixture","20260927","Team")
        V48Assert(checked.History.Count=2,"fragment retention guard: " guard)
    }
}

V7813PerformanceSortingCase()
{
    lib := ILBState(),lib.Files := V75LibraryFiles(),lib.Loaded := true
    before := IGVJson(ILBPack(lib.Files)),ILBBuildWindow(),ILBRefresh(),c := lib.Controls
    c["Tabs"].Choose(3),c["TrendBoss"].Choose(2),c["TrendSpec"].Choose(2),c["TrendMode"].Choose(6),ILBTrendChanged(c["TrendBoss"])
    s := ILBTrendSortState(),lv := c["TrendList"],chronological := lib.Trends,chart := lib.Chart
    V48Assert(s.Shown.Length=4 && s.Shown[1].Value=2000 && InStr(lv.GetText(0,1),"▲"),"Performance starts in chronological order")
    lv.Modify(1,"Select Focus"),selected := ILBTrendSelected().Entry.Key
    ILBTrendColumnClick(lv,4)
    V48Assert(s.Descending && s.Shown[1].Value=10000 && s.Shown[4].Value=2000,"rates sort by numeric value, not formatted strings")
    V48Assert(ILBTrendSelected().Entry.Key=selected && lv.GetNext()=4,"selected fight stays selected after sorting")
    V48Assert(s.Shown[1].Record="PB" && s.Shown[4].Record="Baseline","PB marks remain attached to their chronological results")
    V48Assert(lib.Trends=chronological && lib.Trends[1].Value=2000 && lib.Chart=chart,"table sorting does not rebuild or reorder the graph")
    ILBTrendColumnClick(lv,4),V48Assert(!s.Descending && s.Shown[1].Value=2000,"second click reverses rates")
    for col in [1,2,3,4,5,6,7,8,9] {
        ILBTrendColumnClick(lv,col),ILBTrendColumnClick(lv,col)
        V48Assert(InStr(lv.GetText(0,col),s.Descending ? "▼" : "▲"),"every heading reports its direction")
    }
    rows := [chronological[1].Clone(),chronological[2].Clone()],rows[1].Seconds := 59.999,rows[2].Seconds := 60.001
    sorted := ILBTrendSorted(rows,["Baseline","PB"],7,true)
    V48Assert(sorted[1].Seconds=60.001 && sorted[2].Seconds=59.999,"length sorts unrounded duration")
    lib.Busy := true,ILBTrendColumnClick(lv,6),V48Assert(s.Shown[1].Amount=600000,"sorting saved rows remains responsive during an import"),lib.Busy := false
    ILBTrendChanged(c["TrendMetric"]),V48Assert(s.Column=6 && s.Descending && s.Shown[1].Amount=600000,"refresh retains sort choice")
    V48Assert(IGVJson(ILBPack(lib.Files))=before,"sorting never rewrites recorded totals")
    for size in [[980,650],[1920,1080]] {
        lib.Gui.Show("Hide w" size[1] " h" size[2]),ILBResize(lib.Gui,0,size[1],size[2]),controls := []
        for control in lib.Gui
            if V58ChildVisible(control)
                controls.Push(control)
        V7412PlayerControlsPng("performance-sorting-" size[1] ".png",lib.Gui,controls,0,0,size[1],size[2])
    }
    lib.Trends := [],s.Marks := [],ILBTrendFill()
    V48Assert(!IsObject(ILBTrendSelected()) && !c["TrendOpen"].Enabled,"empty results cannot open a stale selected fight")
}

V7813AECodex(s,at,n)
{
    src := "Nexus {4101564918661120}:1|(486,2790,317,0)|(5000/10000)"
    line := "[" IPStamp(at) "] [" src "] [" V7717Player(n,0) "] [Codex Feedback Blast {4226763215339788}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (1000)"
    IPFeedLine(s,line),V7717Feed(s,at,"Death",0,src,V7717Player(n,0))
}

V7813AEFixture()
{
    s := IPNewData(),p := V7717Player(1)
    IPFeedLine(s,"[00:00:00.100] [" p "] [] [] [AreaEntered {836045448953664}: Gods {833571547775765} Master {836045448953655}]")
    V7717Feed(s,1000,"Enter",0,p,"=")
    V7717Feed(s,1001,"Damage",1,p,"Codex {4105254295568384}:1|(0,0,0,0)|(999/1000)")
    Loop 8
        V7717Feed(s,1010+A_Index,"Damage",10,V7717Player(A_Index),"Nexus {4101564918661120}:1|(486,2790,317,0)|(5000/10000)")
    return s
}

V7813EncounterBoundariesCase()
{
    s := V7813AEFixture(),seg := s.Current
    Loop 7
        V7813AECodex(s,2000+A_Index,A_Index)
    V7717Other(s,2010,V7717Player(1,0),"=","123")
    V48Assert(IsObject(s.Current),"seven recorded deaths cannot terminate a raid")
    V7813AECodex(s,2011,8),V7717Other(s,2012,V7717Player(8,0),"=","123")
    V48Assert(!IsObject(s.Current) && seg.WipeEnded && !seg.Terminal && !seg.Partial && seg.End=2011,"Codex blast plus eight deaths closes a complete no-kill at the final death")
    V48Assert(IPRCompact(seg).TotalDeaths=8 && ILBFight(seg).Result="No kill","wipe retains every death and never becomes a kill")
    V7717Feed(s,2100,"Heal",30,V7717Player(1),V7717Player(2))
    V48Assert(!IsObject(s.Current) && seg.End=2011,"recovery healing cannot extend the stopped timer")
    V7717Feed(s,10000,"Enter",0,V7717Player(1),"=")
    V7717Feed(s,10001,"Damage",1,V7717Player(1),"Codex {4105254295568384}:2|(0,0,0,0)|(999/1000)")
    V48Assert(s.Segments.Length=2 && !s.Current.Partial,"next Codex pull starts independently without inherited uncertainty")
    for kind in ["no blast","revived","wrong mode","old blast"] {
        s := V7813AEFixture(),seg := s.Current
        Loop 8 {
            if kind!="no blast"
                V7813AECodex(s,2000+A_Index,A_Index)
            else
                V7717Feed(s,2000+A_Index,"Death",0,"Nexus {4101564918661120}:1",V7717Player(A_Index,0))
        }
        ; Disable the close condition before the next record is inspected.
        if kind="revived"
            seg.LifeDead.Delete(IPActor(V7717Player(8)).Key)
        if kind="wrong mode"
            s.ModeId := "836045448953652"
        if kind="old blast"
            seg.AECodexBlastAt := -10000
        V7717Other(s,2010,V7717Player(1,0),"=","123")
        V48Assert(IsObject(s.Current),"no invented wipe for " kind)
    }
    s := V7813AEFixture(),seg := s.Current
    ev := IPParseLine(IPDemoLine(9000,V7717Player(1),"Codex {4105254295568384}:9|(0,0,0,0)|(999/1000)","Damage",1))
    V48Assert(!IPBAECodexReset(seg,ev),"another Codex during Codex phase does not prove a reset")
    seg.BossActors["N:4088525397950464:1:Aivela"] := "aivela"
    V48Assert(IPBAECodexReset(seg,ev),"fresh Codex after recorded Sisters combat proves a new opening")
    seg.Enemies[ev.Target.Key] := true,V48Assert(!IPBAECodexReset(seg,ev),"same Codex instance is not a reset")
    V48Assert(IPXProfiles()["DF-BR"].Continuity,"Brontes checks re-entry evidence instead of cutting at a local exit")
}

V7814FreshScreens() => V75LibraryRun(V7814FreshScreensInner)
V7814ReviewAudioIsolation()
{
    global SELF_TEST,Audio,IP
    V48Assert(SELF_TEST && A_IsSuspended,"audio isolation regression uses synthetic state only")
    oldAudio := Audio,oldIP := IP
    try {
        Audio := Audio.Clone(),Audio.Queue := [{Key:"outer synthetic queue"}]
        Audio.Current := {Key:"outer synthetic current"},Audio.Http := {Marker:"synthetic HTTP sentinel"}
        Audio.Events := Map("outer","event"),Audio.LastAccepted := Map("outer",123)
        Audio.Serial := 456,Audio.Epoch := 123
        IP := IPNewApp(),IP.Active := true
        seed := Audio,parser := IP,queue := Audio.Queue,current := Audio.Current,http := Audio.Http
        for fn in [V779ReviewReuse,V7814FreshScreens] {
            fn.Call()
            V48Assert(Audio=seed && Audio.Queue=queue && Audio.Queue.Length=1 && Audio.Current=current && Audio.Http=http,
                "review/fresh screens restore the exact inherited audio object and pending work")
            V48Assert(IP=parser && IP.Active,"review fixture restores the outer parser without stopping it")
        }
        V591Isolated(V7814AudioProbe.Bind(seed,false))
        failed := false
        try V591Isolated(V7814AudioProbe.Bind(seed,true))
        catch Error as e
            failed := e.Message="synthetic audio fixture failure"
        V48Assert(failed,"exception path reaches the deliberately failing fixture body")
        V48Assert(Audio=seed && Audio.Queue=queue && Audio.Queue.Length=1 && Audio.Current=current && Audio.Http=http,
            "success and exception both restore the exact outer audio object")
        V48Assert(seed.Events.Count=1 && seed.Events["outer"]="event" && seed.LastAccepted.Count=1 && seed.LastAccepted["outer"]=123
            && seed.Serial=456 && seed.Epoch=123,"inner audio maps and counters cannot mutate inherited state")
        V48Assert(IP=parser && IP.Active,"exception cleanup also restores the outer parser")
    }
    finally Audio := oldAudio,IP := oldIP
}
V7814AudioProbe(outer,fail)
{
    global Audio,IP
    V48Assert(Audio!=outer && !Audio.Queue.Length && !IsObject(Audio.Current) && !IsObject(Audio.Http) && !IP.Active,
        "review fixture begins with no inherited audio, HTTP or active parser")
    V48Assert(Audio.Events!=outer.Events && Audio.LastAccepted!=outer.LastAccepted && !Audio.Events.Count && !Audio.LastAccepted.Count,
        "audio deduplication maps are independent empty fixtures")
    Audio.Queue.Push({Key:"inner synthetic queue"}),Audio.Current := {Key:"inner current"},Audio.Http := {Marker:"inner synthetic HTTP"}
    Audio.Events["inner"] := "event",Audio.LastAccepted["inner"] := 1,Audio.Serial += 1,Audio.Epoch += 1
    if fail
        throw Error("synthetic audio fixture failure")
}
V7814FreshScreensInner()
{
    global IP,SETTINGS_FILE,BRIDGE_PHRASES_FILE,COMBAT_LOG_FOLDER,IPAS,Audio,IRT,IUB
    global audioOutputMode,bridgeOutputName,BRIDGE_DEFAULT_OUTPUT_LABEL,inputMode
    oldPhrases := BRIDGE_PHRASES_FILE,oldLogs := COMBAT_LOG_FOLDER
    try {
        V48Assert(SELF_TEST && A_IsSuspended,"fresh-start diagnostic is isolated and hotkeys suspended")
        V48Assert(!FileExist(SETTINGS_FILE),"fresh settings path is empty")
        BRIDGE_PHRASES_FILE := SETTINGS_FILE ".phrases.ini",COMBAT_LOG_FOLDER := A_ScriptDir "\missing-logs"
        LoadBridgePhrases(),LoadSettings(),IPASLoadPrefs(),LoadReliabilitySettings()
        LoadBossAutomationSettings(),LoadAERemoteSettings(),LoadAEStackSettings(),LoadCalloutTuningSettings()
        LoadNahutAssignmentSettings(),LoadNBCandleSettings(),LoadNBFloorSettings(),LoadNBTurretSettings()
        LoadNBRepairSettings(),LoadNBOrderSettings(),LoadNBRebounderSettings()
        IBOLoadSettings(),IPMLoadSettings(),IRLoadSettings(),IRTLoadSettings(),IRTLoadLibrary(),IPullLoadSettings()
        V48Assert(!IPAS.Enabled && !IP.Active,"first launch does not silently enable live parsing")
        V48Assert(audioOutputMode=IAVoiceDefaultMode() && bridgeOutputName=BRIDGE_DEFAULT_OUTPUT_LABEL && inputMode="CombatLog","fresh audio is local Windows speech")
        V48Assert(FindNewestCombatLog()="","missing SWTOR log folder is a valid empty state")
        V48Assert(!INAvailable(),"standalone script without helper enters supported fallback state")
        V48Assert(IRT.Definitions.Length>100,"bundled timers are present without imported XML")
        IP.Live := "",IP.Offline := "",IPWBuild(),IPRefresh()
        report := [],u := IPWState()
        Loop IPWTabs().Length {
            logical := IPWTabLogical(A_Index),V58SelectTab(logical),IPRefresh()
            V48Assert(u.Tab=logical,"empty main tab opens: " IPWTabs()[A_Index])
            report.Push([IPWTabs()[A_Index],IP.Status])
        }
        lib := ILBState(),V48Assert(lib.Loaded && !lib.Files.Count && lib.Error="","empty Library loads without catalogues")
        c := lib.Controls
        Loop 5 {
            c["Tabs"].Choose(A_Index),ILBPageChanged()
            V48Assert(!lib.Rows.Length && !lib.Trends.Length,"empty library page stays empty: " A_Index)
        }
        V48Assert(c["StatsValue1"].Text="0" && c["StatsValue2"].Text="0","empty statistics show zero pulls and kills")
        V48Assert(!Audio.Queue.Length && !IsObject(Audio.Http) && !IP.Active,"browsing empty pages starts no live audio/network/parser")
        V48Assert(InStr(c["TrendNote"].Text,"Add logs"),"empty Performance explains the first step")
        V48Assert(!u.Controls["RaidPhase"].Enabled && !u.Controls["RaidPhaseLoad"].Enabled && !u.Controls["RaidPhaseCancel"].Enabled,"empty Raid has no actionable phase controls")
    }
    finally {
        if FileExist(BRIDGE_PHRASES_FILE)
            FileDelete(BRIDGE_PHRASES_FILE)
        BRIDGE_PHRASES_FILE := oldPhrases,COMBAT_LOG_FOLDER := oldLogs
    }
}

V7815LibraryDuplicates() => V75LibraryRun(V7815LibraryDuplicatesCase)
V7815LibraryRowSignature(rows)
{
    out := []
    for e in rows
        out.Push([e.Key,e.Path,e.At,e.Until,e.Date,e.Alternates,ILBPack(Map(e.Path,e.Source))])
    return IGVJson(out)
}
V7815LibraryDuplicatesCase()
{
    a := ILBState().TestPath ".a.txt",b := ILBState().TestPath ".b.txt"
    one := ILBFile(a,"20261003",1,"20261003120000",Format("{:064}",0),[V75LibraryPull()])
    two := IPRCloneSnapshot(one),two.Path := b,two.Pulls[1].Start += 900,two.Pulls[1].End += 900
    try {
        Loop 4 {
            state := A_Index-1
            for pair in [[a,state&1],[b,state&2]] {
                if FileExist(pair[1])
                    FileDelete(pair[1])
                if pair[2]
                    FileAppend("x",pair[1],"UTF-8-RAW")
            }
            Loop 4 {
                flags := A_Index-1,one.Pulls[1].Partial := flags&1 ? 1 : 0,two.Pulls[1].Partial := flags&2 ? 1 : 0
                Loop 3 {
                    left := IPRCloneSnapshot(one),right := IPRCloneSnapshot(two)
                    if A_Index=2
                        left.Pulls[1].Players["@Extra#2"] := left.Pulls[1].Players["@Sophie#1"].Clone()
                    if A_Index=3
                        right.Pulls[1].Players["@Extra#2"] := right.Pulls[1].Players["@Sophie#1"].Clone()
                    files := Map(a,left,b,right),before := IGVJson(ILBPack(files))
                    actual := ILBRows(files),expected := V7815LegacyRows(files)
                    V48Assert(V7815LibraryRowSignature(actual)=V7815LibraryRowSignature(expected),"duplicate preference matches prior behavior across availability, coverage and roster size")
                    V48Assert(actual.Length=1 && actual[1].Alternates=1,"duplicate count is preserved")
                    V48Assert(IGVJson(ILBPack(files))=before,"browsing never changes saved source metrics")
                }
            }
        }
        one.Pulls[1].Partial := 0,two.Pulls[1].Partial := 0,files := Map(a,one,b,two)
        if !FileExist(a)
            FileAppend("x",a,"UTF-8-RAW")
        if !FileExist(b)
            FileAppend("x",b,"UTF-8-RAW")
        V48Assert(ILBRows(files)[1].Path=a,"equal available copies keep chronological preference")
        FileDelete(a)
        V48Assert(ILBRows(files)[1].Path=b,"next rebuild notices original removal")
        FileAppend("x",a,"UTF-8-RAW"),FileDelete(b)
        V48Assert(ILBRows(files)[1].Path=a,"next rebuild notices source restoration")
        one.Size := FileGetSize(a),one.Modified := FileGetTime(a,"M")
        selected := ILBRows(Map(a,one))[1]
        V48Assert(ILBSourceStatus(selected)="Indexed","selected original is checked when inspected")
        FileAppend("changed",a,"UTF-8-RAW")
        V48Assert(InStr(ILBSourceStatus(selected),"Source changed"),"selected recording detects changes after the list was built")
    }
    finally {
        for path in [a,b]
            if FileExist(path)
                FileDelete(path)
    }
}

V7815LibraryBrowseParity() => V75LibraryRun(V7815LibraryBrowseParityCase)
V7815LibraryBrowseParityCase()
{
    files := V75LibraryFiles(),other := IPRCloneSnapshot(files)
    for key,f in other {
        f.Path .= ".copy",f.Pulls[1].Players := Map("@Other#9",{Name:"Zoë",Spec:"123",Damage:40,Heal:0,Effective:0,HealKnown:0,HealRecords:0,Deaths:0})
        f.Pulls[1].Challenges := [],f.Pulls[5].Mode := "836045448953652"
        f.Pulls.Push(V75LibraryPull(6,86410000)),files[StrLower(f.Path)] := f
    }
    rows := ILBRows(files),expected := V7815LegacyRows(files)
    V48Assert(V7815LibraryRowSignature(rows)=V7815LibraryRowSignature(expected),"different recorders, modes, midnight dates and duplicate ordering remain identical")
    for query in ["tyth","sophie","zoë","no-match"]
        V48Assert(V7815LibraryRowSignature(ILBFilter(rows,"","","","",0,"",query))=V7815LibraryRowSignature(ILBFilter(expected,"","","","",0,"",query)),"search results remain identical: " query)
    actualDays := ILBActivities(rows),expectedDays := ILBActivities(expected)
    for date,day in actualDays
        V48Assert(day.Pulls=expectedDays[date].Pulls && day.Kills=expectedDays[date].Kills && day.Seconds=expectedDays[date].Seconds,"calendar totals remain identical")
}

; Frozen pre-optimization implementation for semantic parity checks only.
V7815LegacyRows(files)
{
    all := [],result := [],buckets := Map()
    for path,f in files {
        if !f.Pulls.Length
            continue
        available := !!FileExist(f.Path)
        for p in f.Pulls {
            e := ILBEntry(f,p),e.Available := available,all.Push(e)
        }
    }
    for e in ILBSort(all) {
        group := e.Pull.Boss "|" e.Pull.Area "|" e.Pull.Mode,matched := 0
        for i in buckets.Get(group,[]) {
            old := result[i]
            if Abs(e.At-old.At)<=2000 && ILBSameFight(old,e) {
                matched := i
                break
            }
        }
        if matched {
            old := result[matched]
            if (old.Pull.Partial && !e.Pull.Partial) || (old.Pull.Partial=e.Pull.Partial
                && (e.Pull.Players.Count>old.Pull.Players.Count || (e.Pull.Players.Count=old.Pull.Players.Count && !old.Available && e.Available)))
                e.Alternates := old.Alternates+1,result[matched] := e
            else
                old.Alternates += 1
        }
        else {
            result.Push(e)
            if !buckets.Has(group)
                buckets[group] := []
            recent := []
            for i in buckets[group]
                if e.At-result[i].At<=2000
                    recent.Push(i)
            recent.Push(result.Length),buckets[group] := recent
        }
    }
    return ILBSort(result)
}

; Native AHK checks. V672 fixture supplies private settings and a fake audio queue.
; Never pumps audio, reads a user's log, presses keys or starts normal Iris.
V7816Fixture(fn) => V672LibraryFixture(V7816Inner.Bind(fn))
V7816Inner(fn)
{
    global SOP,SOPOptions,activeBoss,IP
    SOP := SOPNew(),SOP.Scope := true,SOPOptions := {Hold:true,Kill:true,HoldSoundId:"",KillSoundId:""}
    activeBoss := "GFTM - Scyva"
    try fn.Call()
    finally {
        global SOPUI
        if IsObject(SOPUI.Gui)
            SOPUI.Gui.Destroy()
        SOPUI := {Gui:""}
    }
}
V7816OPD(hp := 1000,id := "555") => "OPD {4126527268585472}:" id "|(0,0,0,0)|(" hp "/1000)"
V7816Array(id := "111") => "Array {4126531563552768}:" id "|(0,0,0,0)|(1000/1000)"
V7816Line(at,kind := "mark",id := "111")
{
    switch kind {
        case "start": return V671FloorLine(at,V7816OPD(),"=","4127098499235840","836045448945477","4127098499236141")
        case "mark": return V671FloorLine(at,V7816Array(id),V671FloorPlayer(),"4143105842348032","836045448945477","4143105842348032")
        case "hit": return V671FloorLine(at,V671FloorPlayer(),V7816OPD(900),"1","836045448945477","836045448945501"," (10)")
        case "death": return V671FloorLine(at,V671FloorPlayer(),V7816OPD(0),"1","836045448945472","836045448945493")
        case "reset": return V671FloorLine(at,V7816OPD(),"","1","836045448945472","836045448953669")
        case "remove": return V671FloorLine(at,V7816OPD(900),"=","4127098499235840","836045448945478","4127098499236141")
        case "exit": return V671FloorLine(at,V671FloorPlayer(),"=","1","836045448945472","836045448945490")
    }
}
V7816Feed(at,kind := "mark",live := true,id := "111")
{
    global testClock
    testClock := at,SOPSafeTrack(V7816Line(at,kind,id),live,at)
}
V7816Arm(live := true)
{
    V7816Feed(98000,"start",live),V7816Feed(100000,"mark",live)
}
V7816Schedule() => V7816Fixture(V7816ScheduleCase)
V7816ScheduleCase()
{
    global SOP,Audio,testClock
    V7816Arm()
    V48Assert(SOP.Pending.Length=2,"two instructions from the initial mark")
    V48Assert(SOP.Pending[1].Due=105870 && SOP.Pending[2].Due=109870,"hold at beam-12 and kill at beam-8")
    V7816Feed(100100,"mark",true,"222")
    V48Assert(SOP.Cycle=1,"partner array does not duplicate the schedule")
    testClock := 103500,SOPPoll()
    V48Assert(Audio.Queue.Length=0,"no kill call for the literal opening beam")
    V7816Feed(105800,"hit"),testClock := 105870,SOPPoll()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="Don't kill.","actual queue receives hold")
    V7816Feed(109800,"hit"),testClock := 109870,SOPPoll()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="Kill.","kill replaces any queued hold")
    V48Assert(SOPAudioEnabled(Audio.Queue[1]),"kill passes dispatch validation at its deadline")
    testClock += 1001
    V48Assert(!SOPAudioEnabled(Audio.Queue[1]),"late queued kill cannot start")
    V48Assert(SOP.Pending.Length=0,"one-shot deadlines are consumed")
}
V7816Cadence() => V7816Fixture(V7816CadenceCase)
V7816CadenceCase()
{
    global SOP
    V7816Arm()
    V7816Feed(107605)
    V48Assert(SOP.Cycle=1,"alternate marker does not schedule an extra beam")
    V7816Feed(115210)
    V48Assert(SOP.Cycle=2 && SOP.Pending[2].Due=125080,"fresh second marker anchors next pair")
    V7816Feed(145630)
    V48Assert(SOP.Cycle=3 && SOP.MarkIndex=6,"missing intermediate markers retain parity")
    V7816Feed(148000)
    V48Assert(SOP.Cycle=3,"irregular marker cannot move the prediction")
    V7816Feed(160840)
    V48Assert(SOP.Cycle=4 && SOP.MarkIndex=8,"normal markers recover after a rejected outlier")
    V7816Feed(160840)
    V48Assert(SOP.Cycle=4,"duplicate source record cannot restart")
    V7816Feed(170000,"mark",true,"333")
    V48Assert(SOP.Cycle=4,"unrelated array cannot shift an established pull")
    V48Assert(SOPRecordTick(86399000,5000,{Tick:5000,LatestStamp:1000})=3000,"batch skew handles midnight")
    V48Assert(SOPRecordTick(100000,5000,{Tick:5000,LatestStamp:104000})=1000,"batched old marker is aged before scheduling")
}
V7816Lifecycle() => V7816Fixture(V7816LifecycleCase)
V7816LifecycleCase()
{
    global SOP,testClock,Audio
    V7816Arm(),V7816Feed(101000,"hit"),V7816Feed(102000,"exit")
    V48Assert(!SOP.Ended && SOP.Pending.Length=2,"one player's combat exit is not a raid wipe")
    V7816Feed(103000,"reset")
    V48Assert(SOP.Ended && !SOP.Pending.Length,"full HP boss reset cancels pending instructions")
    SOP := SOPNew(0,true),V7816Arm(),V7816Feed(103000,"death")
    V48Assert(SOP.Ended && !SOP.Pending.Length,"OPD death stops calls")
    SOP := SOPNew(0,true),V7816Arm(),V7816Feed(103000,"remove")
    V48Assert(SOP.Ended,"encounter buff cleanup stops calls")
    SOP := SOPNew(0,true),V7816Arm(),SOPStop(),V7816Feed(115210)
    V48Assert(SOP.Stopped && !SOP.Pending.Length,"manual stop survives further markers")
    SOPSafeTrack(V671FloorLine(116000,V7816OPD(1000,"556"),"=","4127098499235840","836045448945477","4127098499236141"),true,116000)
    V7816Feed(118000)
    V48Assert(!SOP.Stopped && SOP.Cycle=1,"new OPD instance rearms")
    SOPReset("file change",false)
    V48Assert(!SOP.Scope && SOP.Start<0,"file reset cannot inherit raid difficulty or encounter")
}
V7816Gates() => V7816Fixture(V7816GatesCase)
V7816GatesCase()
{
    global SOP,Audio,testClock,SOPOptions,autoBossCalloutsEnabled,activeBoss,inputMode
    V7816Arm(false),V7816Feed(105800,"hit"),testClock := 105870,SOPPoll()
    V48Assert(!Audio.Queue.Length,"silent replay never queues its old deadlines")
    SOP := SOPNew(0,true),V7816Arm(),testClock := 105870,SOPPoll()
    V48Assert(!Audio.Queue.Length,"missing OPD activity suppresses calls after a wipe or stalled stream")
    V7816Feed(106000,"hit"),SOPPoll()
    V48Assert(!Audio.Queue.Length,"resuming activity does not replay skipped hold")
    SOP := SOPNew(0,true),V7816Arm(),V7816Feed(107000,"hit"),testClock := 107001,SOPPoll()
    V48Assert(!Audio.Queue.Length,"late timer callback skips overdue hold")
    SOP := SOPNew(0,true),V7816Arm(),V7816Feed(105800,"hit"),Audio.Epoch += 1,testClock := 105870,SOPPoll()
    V48Assert(!Audio.Queue.Length,"audio epoch change invalidates old instructions")
    SOP := SOPNew(0,true),V7816Arm(),V7816Feed(105800,"hit"),SOPOptions.Hold := false,testClock := 105870,SOPPoll()
    V48Assert(!Audio.Queue.Length,"individual off toggle suppresses hold")
    SOPOptions.Hold := true,SOPPoll()
    V48Assert(!Audio.Queue.Length,"turning on cannot replay consumed deadline")
    SOP := SOPNew(0,true),V7816Arm(),activeBoss := "GFTM - Tyth",SOPPoll()
    V48Assert(SOP.Stopped,"leaving Scyva profile stops pending calls")
    SOP := SOPNew(0,true),activeBoss := "GFTM - Scyva",V7816Arm(),inputMode := "Hotkey",SOPPoll()
    V48Assert(SOP.Stopped,"changing input mode stops the prediction")
}
V7816ScopeAndUI() => V7816Fixture(V7816ScopeAndUICase)
V7816ScopeAndUICase()
{
    global SOP,SOPOptions,SOPUI,Audio,audioOutputMode,AUDIO_MODE_KENKU_BRIDGE_TTS,SETTINGS_FILE
    SOP := SOPNew(),V7816Arm()
    V48Assert(!SOP.Pending.Length,"unknown mode cannot enable NiM calls")
    area := "[00:01:40.000] [@Test#1|(0,0,0,0)|(100/100)] [] [] [AreaEntered {836045448953664}: Gods {833571547775765} 8 Master {836045448953655}]"
    SOPSafeTrack(area,true,100000)
    V48Assert(SOP.Scope,"numeric area/mode enters supported scope")
    SOPSafeTrack(StrReplace(StrReplace(area,"00:01:40","00:01:41"),"836045448953655","836045448953654"),true,101000)
    V48Assert(!SOP.Scope,"other difficulty clears the scope")
    p := SOPPayload("Hold",AUDIO_MODE_KENKU_BRIDGE_TTS)
    V48Assert(p.Phrase="Don't kill." && p.Id!="","TTS has an explicit usable phrase")
    p := SOPPayload("Kill","Kenku")
    V48Assert(p.Id="","recording route never silently falls back to another output")
    ICLSet("scyva.hold",false),SOPSaveSettings(),FlushSettings()
    SOPOptions.Hold := true,SOPLoadSettings()
    V48Assert(!SOPOptions.Hold && SOPOptions.Kill,"individual preferences persist to the fixture INI")
    found := 0
    for entry in BuildCalloutPreviewCatalog() {
        if entry.Type="ScyvaOPD" {
            found += 1
            p := ResolveCalloutPreview(entry,"Example",0,AUDIO_MODE_KENKU_BRIDGE_TTS)
            V48Assert(p.Ok && p.Phrase!="","native preview resolver accepts Scyva TTS")
        }
    }
    V48Assert(found=2,"both spoken lines appear in the preview catalogue")
    SOPOpen()
    V48Assert(IsObject(SOPUI.Gui) && !SOPUI.Hold.Value && SOPUI.Kill.Value,"hidden setup reflects saved settings")
    V48Assert(Audio.Queue.Length=0,"opening setup does not speak or start a countdown")
    ICLSet("scyva.hold",true)
    V48Assert(SOPUI.Hold.Value,"library toggles synchronize the open setup")
    SOPStop()
    V48Assert(ICLStatus("scyva.kill")="Stopped for this pull","stop latch is visible in callout library")
}

V7816BacklogAndPolicy() => V7816Fixture(V7816BacklogAndPolicyCase)
V7816BacklogAndPolicyCase()
{
    global SOP,ReadClockSample,testClock,Audio,autoBossCalloutsEnabled,soundboardsEnabled
    global inputMode,audioOutputMode
    V7816Arm(),V7816Feed(105800,"hit"),autoBossCalloutsEnabled := false,testClock := 105870,SOPPoll()
    V48Assert(!Audio.Queue.Length,"automatic-callout master gates timed speech")
    autoBossCalloutsEnabled := true
    V7816Feed(109800,"hit"),soundboardsEnabled := false,testClock := 109870,SOPPoll()
    V48Assert(!Audio.Queue.Length,"voice master gates timed speech")
    soundboardsEnabled := true,SOP := SOPNew(0,true),V7816Arm()
    ReadClockSample := {Tick:130000,LatestStamp:130000}
    testClock := 130000,SOPSafeTrack(V7816Line(115210),true,130000)
    V48Assert(SOP.Pending[2].Due=125080,"buffered marker is not scheduled from its late receipt")
    SOPPoll()
    V48Assert(!Audio.Queue.Length && !SOP.Pending.Length,"buffered instructions are discarded without catch-up")
    ReadClockSample := "",SOP := SOPNew(0,true),V7816Arm()
    V7816Feed(105800,"hit"),testClock := 105870,SOPPoll(),item := Audio.Queue[1]
    SOPStop()
    V48Assert(!AudioItemEnabled(item) && !Audio.Queue.Length,"stopped generation rejects a queued or preempted old instruction")
    SOP := SOPNew(0,true),V7816Feed(98000,"hit"),V7816Feed(100000)
    V48Assert(SOP.Start<0 && !SOP.Pending.Length,"joining a damaged OPD mid-pull cannot mistake the next mark for an opener")
    V48Assert(CalloutPriority("Boss","ScyvaOPDKill")>CalloutPriority("Boss","ScyvaOPDHold"),"time-sensitive Kill has urgent boss-call priority")
}

; Private INI + fake audio queue. No playback, live controls, or normal app launch.
V7817Fixture(fn) => V672LibraryFixture(V7817Inner.Bind(fn))
V7817Inner(fn)
{
    global SCAT,SCATOptions,SCATUI,activeBoss,ReadClockSample
    SCAT := SCATNew(0,true),SCATOptions := {Enabled:true,HelpEnabled:true,SoundId:"",RedSoundId:"",BlueSoundId:""}
    activeBoss := "GFTM - Scyva",ReadClockSample := ""
    try fn.Call()
    finally {
        if IsObject(SCATUI.Gui)
            SCATUI.Gui.Destroy()
        SCATUI := {Gui:""}
    }
}
V7817Cat(id,side := "Red",hp := 1000)
{
    pos := side="Red" ? "-500,2173,187.29,90" : (side="Blue" ? "-470,2173,187.28,270" : "0,0,0,0")
    return "Ignition Catalyst {4126553038389248}:" id "|(" pos ")|(" hp "/1000)"
}
V7817Line(at,id,side := "Red",hp := 1000,kind := "set")
{
    cat := V7817Cat(id,side,hp)
    if kind="death"
        return V671FloorLine(at,V671FloorPlayer(),cat,"1","836045448945472","836045448945493")
    if kind="target"
        return V671FloorLine(at,V671FloorPlayer(),cat,"1","836045448945472","836045448953668")
    return V671FloorLine(at,cat,V671FloorPlayer(),"1","836045448945472","836045448953668")
}
V7817Feed(at,id,side := "Red",live := true,hp := 1000,kind := "set")
{
    global testClock
    testClock := at,SCATSafeTrack(V7817Line(at,id,side,hp,kind),live,at)
}
V7817Pair(at := 100000)
{
    V7817Feed(at,"11"),V7817Feed(at+100,"22","Blue")
}
V7817Pairs() => V7817Fixture(V7817PairsCase)
V7817PairsCase()
{
    global SCAT,Audio
    V7817Feed(100000,"11")
    V48Assert(!Audio.Queue.Length,"single catalyst stays silent")
    V7817Feed(100050,"11"),V7817Feed(100100,"22","Blue")
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="Doubles spawning.","second distinct appearance queues the requested wording once")
    V48Assert(AudioItemEnabled(Audio.Queue[1]),"pair passes the real dispatch policy")
    V7817Feed(100101,"22","Blue"),V7817Feed(100102,"11")
    V48Assert(Audio.Queue.Length=1 && SCAT.Pair=1,"repeated source target switches cannot repeat a wave")
    V7817Feed(110000,"33"),V7817Feed(110001,"44","Blue")
    V48Assert(SCAT.Pair=2 && Audio.Queue.Length=2,"later fresh pair has independent identity")
    V48Assert(!AudioItemEnabled(Audio.Queue[1]) && AudioItemEnabled(Audio.Queue[2]),"old queued wave cannot start after newer wave")
    V7817Feed(110002,"44","Blue",true,0,"death")
    V48Assert(!AudioItemEnabled(Audio.Queue[2]),"a catalyst dying invalidates a queued double warning")
    V48Assert(SCATSide(V7817Line(1,"1","Red"))="Red","red spawn maps to High Velocity side")
    V48Assert(SCATSide(V7817Line(1,"1","Blue"))="Blue","blue spawn maps to High Density side")
    V48Assert(SCATSide(V7817Line(1,"1","Unknown"))="","unknown coordinates are not guessed")
}
V7817Windows() => V7817Fixture(V7817WindowsCase)
V7817WindowsCase()
{
    global SCAT,Audio,testClock
    V7817Feed(100000,"11"),V7817Feed(105000,"22","Blue")
    V48Assert(Audio.Queue.Length=1,"five-second maximum paired appearance gap is inclusive")
    SCATReset(),V7817Feed(110000,"11"),V7817Feed(115001,"22","Blue")
    V48Assert(!Audio.Queue.Length,"separate waves beyond five seconds remain silent")
    SCATReset(),V7817Feed(120000,"11"),V7817Feed(120001,"22")
    V48Assert(!Audio.Queue.Length,"two known same-side appearances are not a red/blue double")
    SCATReset(),V7817Feed(130000,"11","Unknown"),V7817Feed(130010,"22","Blue")
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="Doubles spawning.","unknown side never changes the requested warning")
    item := Audio.Queue[1],testClock := 133011
    V48Assert(!AudioItemEnabled(item),"queued warning expires three seconds after second appearance")
    SCATReset(),V7817Feed(140000,"11"),V7817Feed(140010,"11","Red",true,0,"death"),V7817Feed(140100,"22","Blue")
    V48Assert(!Audio.Queue.Length,"already dead catalyst cannot be the first half of a double")
}
V7817Lifecycle() => V7817Fixture(V7817LifecycleCase)
V7817LifecycleCase()
{
    global SCAT,SOP,Audio,testClock
    V7817Pair(),old := Audio.Queue[1]
    SCATReset("new file",false)
    V48Assert(!SCAT.Scope && !Audio.Queue.Length && !AudioItemEnabled(old),"file switch drops queued warnings and difficulty")
    SCAT.Scope := true,V7817Pair(110000)
    SOP := SOPNew(0,true),V7816Arm()
    immune := V671FloorLine(110200,V671FloorPlayer(),"Scyva {4108140513591296}:123|(0,0,0,0)|(1000/1000)","3066602354376704","836045448945477","836045448945501"," (16886 ~0 energy {836045448940874} -immune {836045448945506})")
    testClock := 110200,SCATSafeTrack(immune,true,110200),SOPSafeTrack(immune,true,110200)
    V48Assert(!SCAT.Ended && !SOP.Ended,"immune Saber Throw damage cannot end catalyst or OPD phase")
    immune := StrReplace(StrReplace(immune,"00:01:50.200","00:01:50.300"),"-immune {836045448945506}","(16886 absorbed {836045448945511})")
    SCATSafeTrack(immune,true,110300),SOPSafeTrack(immune,true,110300)
    V48Assert(!SCAT.Ended && !SOP.Ended,"fully absorbed damage cannot end catalyst or OPD phase")
    line := V671FloorLine(111000,V671FloorPlayer(),"Scyva {4108140513591296}:123|(0,0,0,0)|(900/1000)","1","836045448945477","836045448945501"," (10)")
    testClock := 111000,SCATSafeTrack(line,true,111000)
    V48Assert(SCAT.Ended && !Audio.Queue.Length,"Scyva damage ends the catalyst phase")
    SCATSafeTrack(V7816Line(112000,"start"),true,112000)
    V48Assert(!SCAT.Ended && !SCAT.Seen.Count,"new living OPD instance starts a clean encounter")
    V7817Pair(113000)
    gun := "CFA {4126522973618176}:987|(-463.5,2147,187.66,0)|(900/1000)"
    SCATSafeTrack(V671FloorLine(114000,V671FloorPlayer(),gun,"1","836045448945477","836045448945501"," (10)"),true,114000)
    gun := StrReplace(gun,"900/1000","1000/1000")
    SCATSafeTrack(V671FloorLine(115000,gun,"","1","836045448945472","836045448953669"),true,115000)
    V48Assert(SCAT.Ended && !Audio.Queue.Length,"injured turret full-health target-clear reset cancels double warning")
    SCATReset(),V7817Pair(120000)
    SCATSafeTrack(V7816Line(121000,"death"),true,121000)
    V48Assert(!SCAT.Ended,"OPD death is not the end of the later catalyst phase")
}
V7817AudioPolicy() => V7817Fixture(V7817AudioPolicyCase)
V7817AudioPolicyCase()
{
    global SCAT,SCATOptions,Audio,autoBossCalloutsEnabled,soundboardsEnabled,inputMode,audioOutputMode,activeBoss
    SCATOptions.Enabled := false,V7817Pair()
    V48Assert(!Audio.Queue.Length && SCAT.Pair=1,"disabled pair is consumed without audio")
    SCATOptions.Enabled := true,V7817Feed(100200,"22","Blue")
    V48Assert(!Audio.Queue.Length,"turning on cannot replay a consumed pair")
    SCATReset(),autoBossCalloutsEnabled := false,V7817Pair(110000)
    V48Assert(!Audio.Queue.Length,"automatic-callout master controls catalysts")
    autoBossCalloutsEnabled := true,SCATReset(),soundboardsEnabled := false,V7817Pair(120000)
    V48Assert(!Audio.Queue.Length,"audio master controls catalysts")
    soundboardsEnabled := true,SCATReset(),activeBoss := "GFTM - Tyth",V7817Pair(130000)
    V48Assert(!Audio.Queue.Length,"wrong boss profile never queues catalyst call")
    activeBoss := "GFTM - Scyva",SCATReset(),inputMode := "Hotkey",V7817Pair(140000)
    V48Assert(!Audio.Queue.Length,"hotkey input mode cannot receive log call")
    inputMode := "CombatLog",SCATReset(),audioOutputMode := "Kenku",V7817Pair(150000)
    V48Assert(!Audio.Queue.Length,"missing Kenku recording never falls back to local voice")
    V48Assert(SCATPayload("Kenku").Id="","recording output stays explicitly unconfigured")
}
V7817ScopeUI() => V7817Fixture(V7817ScopeUICase)
V7817ScopeUICase()
{
    global SCAT,SCATOptions,SCATUI,Audio,AUDIO_MODE_KENKU_BRIDGE_TTS
    area := "[00:01:39.000] [@Test#1|(0,0,0,0)|(100/100)] [] [] [AreaEntered {836045448953664}: Gods {833571547775765} 8 Master {836045448953655}]"
    SCAT := SCATNew(),SCATSafeTrack(area,true,99000),V7817Pair()
    V48Assert(SCAT.Scope && Audio.Queue.Length=1,"numeric 8M area marker enables detection")
    SCATSafeTrack(StrReplace(StrReplace(area,"00:01:39","00:01:41"),"836045448953655","836045448953654"),true,101000)
    V7817Pair(102000)
    V48Assert(!SCAT.Scope && !Audio.Queue.Length,"non-Master area suppresses calls and clears old queue")
    ICLSet("scyva.catalysts",false),SCATSaveSettings(),FlushSettings()
    SCATOptions := {Enabled:true,HelpEnabled:true,SoundId:"",RedSoundId:"",BlueSoundId:""},SCATLoadSettings()
    V48Assert(!SCATOptions.Enabled,"individual toggle persists privately")
    found := 0
    for entry in BuildCalloutPreviewCatalog() {
        if entry.Type="ScyvaCatalysts" {
            found += 1,p := ResolveCalloutPreview(entry,"Sample",0,AUDIO_MODE_KENKU_BRIDGE_TTS)
            V48Assert(p.Ok && p.Phrase="Doubles spawning.","preview uses saved wording")
        }
    }
    V48Assert(found=1,"one catalyst preview entry")
    SCATOpen()
    V48Assert(IsObject(SCATUI.Gui) && !SCATUI.Enabled.Value,"hidden setup mirrors saved preferences")
    ICLSet("scyva.catalysts",true)
    V48Assert(SCATUI.Enabled.Value,"library toggle updates setup")
    V48Assert(!Audio.Queue.Length,"opening setup and resolving preview do not speak")
}
V7817LateAttachment() => V7817Fixture(V7817LateAttachmentCase)
V7817LateAttachmentCase()
{
    global SCAT,Audio,ReadClockSample,testClock
    V7817Feed(100000,"11","Red",false),V7817Feed(100100,"22","Blue",false)
    V7817Feed(100200,"22","Blue")
    V48Assert(!Audio.Queue.Length && SCAT.Pair=1,"silent hydration consumes pairs without catch-up")
    SCATReset(),V7817Feed(110000,"11","Red",false),V7817Feed(110100,"22","Blue")
    V48Assert(!Audio.Queue.Length,"live second half cannot resurrect a historical first half")
    SCATReset(),ReadClockSample := {Tick:130000,LatestStamp:130000},testClock := 130000
    SCATSafeTrack(V7817Line(120000,"11"),true,130000)
    SCATSafeTrack(V7817Line(120100,"22","Blue"),true,130000)
    V48Assert(!Audio.Queue.Length && SCAT.Pair=1,"old buffered pair is consumed without late speech")
    ReadClockSample := "",SCATReset(),V7817Feed(140000,"11","Red",true,900),V7817Feed(140100,"22","Blue")
    V48Assert(!Audio.Queue.Length,"joining an already damaged catalyst does not call a fresh wave")
    SCATReset(),V7817Feed(150000,"11","Red",true,1000,"target"),V7817Feed(150500,"11"),V7817Feed(150600,"22","Blue")
    V48Assert(Audio.Queue.Length=1,"player target then catalyst source within observed half-second delay counts once")
    SCATReset(),V7817Feed(160000,"11","Red",true,1000,"target"),V7817Feed(165000,"11"),V7817Feed(165100,"22","Blue")
    V48Assert(!Audio.Queue.Length,"much later first source target-set is not treated as a fresh spawn")
    SCATReset(),V7817Pair(170000),old := Audio.Queue[1],Audio.Epoch += 1
    V48Assert(!AudioItemEnabled(old),"audio epoch invalidates old queue items")
}

V7817Cast(at,id,side := "Red",hp := 1000,interrupt := false)
{
    global testClock
    testClock := at
    line := V671FloorLine(at,V7817Cat(id,side,hp),"=","4127205873418240","836045448945472",interrupt ? "836045448945482" : "836045448945479")
    SCATSafeTrack(line,true,at)
}
V7817HelpPace() => V7817Fixture(V7817HelpPaceCase)
V7817HelpPaceCase()
{
    global Audio,SCAT,testClock
    V7817Feed(100000,"11"),V7817Cast(101100,"11")
    V7817Feed(106999,"11","Red",true,900),SCATPoll()
    V48Assert(!Audio.Queue.Length,"first seven seconds are silent even at high HP")
    V7817Feed(108600,"11","Red",true,500),SCATPoll()
    V48Assert(!Audio.Queue.Length,"50 percent HP with 50 percent cast time remaining is on pace")
    testClock := 108700,SCATPoll()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="Red needs help!","HP greater than remaining time warns on the correct side")
    item := Audio.Queue[1]
    V48Assert(!item.SCATHelpData.Estimated && AudioItemEnabled(item),"recorded cast anchor and dispatch check are retained")
    testClock := 108800,SCATPoll()
    V48Assert(Audio.Queue.Length=1,"no repeating help spam for the same catalyst")
    V7817Feed(109000,"11","Red",true,400)
    V48Assert(!AudioItemEnabled(item),"catching up on damage cancels a queued help warning")
    Audio.Queue := [],V7817Feed(110000,"11","Red",true,900),SCATPoll()
    V48Assert(!Audio.Queue.Length,"a second dip behind pace does not repeat the call")
    SCATReset(),V7817Feed(120000,"22","Blue"),V7817Feed(127000,"22","Blue",true,800),SCATPoll()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="Blue needs help!","single blue catalyst can need help too")
    V48Assert(Audio.Queue[1].SCATHelpData.Estimated,"missing cast-start timing is marked estimated in diagnostics")
}
V7817HelpTiming() => V7817Fixture(V7817HelpTimingCase)
V7817HelpTimingCase()
{
    global Audio,SCAT,testClock,ReadClockSample
    V7817Feed(100000,"11"),testClock := 107000,SCATPoll()
    V48Assert(!Audio.Queue.Length,"stale spawn HP is not treated as current seven seconds later")
    V7817Feed(107100,"11","Red",true,800),SCATPoll()
    V48Assert(Audio.Queue.Length=1,"fresh HP resumes the pace check")
    item := Audio.Queue[1],testClock := 108601
    V48Assert(!AudioItemEnabled(item),"queued help expires after 1.5 seconds")
    SCATReset(),V7817Feed(120000,"11"),V7817Cast(122000,"11"),V7817Feed(129000,"11","Red",true,600),SCATPoll()
    V48Assert(Audio.Queue.Length=1 && Abs(Audio.Queue[1].SCATHelpData.Remaining-53.3333)<0.01,"actual later cast start replaces the appearance estimate")
    V7817Cast(129100,"11","Red",600,true)
    V48Assert(!AudioItemEnabled(Audio.Queue[1]) && !SCAT.Active.Count,"interrupt/death cleanup invalidates help")
    SCATReset(),V7817Feed(140000,"11"),V7817Cast(141000,"11"),V7817Feed(156000,"11","Red",true,800),SCATPoll()
    V48Assert(!Audio.Queue.Length && !SCAT.Active.Count,"no warning at or after the cast deadline")
    SCATReset(),V7817Feed(160000,"11","Unknown"),V7817Feed(167000,"11","Unknown",true,900),SCATPoll()
    V48Assert(!Audio.Queue.Length,"unknown side cannot produce a guessed Red or Blue warning")
    SCATReset(),testClock := 190000,ReadClockSample := {Tick:190000,LatestStamp:190000}
    SCATSafeTrack(V7817Line(180000,"11"),true,190000)
    SCATSafeTrack(V7817Line(187000,"11","Red",900),true,190000),SCATPoll()
    V48Assert(!Audio.Queue.Length,"stale batch HP cannot trigger catch-up speech")
}
V7817HelpPolicy() => V7817Fixture(V7817HelpPolicyCase)
V7817HelpPolicyCase()
{
    global Audio,SCATOptions,testClock,soundboardsEnabled,autoBossCalloutsEnabled
    V7817Feed(100000,"11","Red",false),V7817Feed(107000,"11","Red",true,900),SCATPoll()
    V48Assert(!Audio.Queue.Length,"historical catalyst never resumes old help calls")
    SCATReset(),SCATOptions.HelpEnabled := false,V7817Feed(120000,"11"),V7817Feed(127000,"11","Red",true,900),SCATPoll()
    SCATOptions.HelpEnabled := true,testClock := 127100,SCATPoll()
    V48Assert(!Audio.Queue.Length,"disabled warning is consumed without replay when enabled")
    SCATReset(),SCATOptions.Enabled := false,V7817Pair(140000),V7817Feed(147000,"11","Red",true,900),V7817Feed(147100,"22","Blue",true,900),SCATPoll()
    V48Assert(Audio.Queue.Length=2,"independent help calls still work with double-spawn call disabled")
    V48Assert(Audio.Queue[1].Phrase!=Audio.Queue[2].Phrase,"both sides can request help in the same wave")
    ICLSet("scyva.catalysts",true)
    V48Assert(Audio.Queue.Length=2,"double-spawn preference does not cancel unrelated help")
    ICLSet("scyva.catalysthelp",false)
    V48Assert(!Audio.Queue.Length,"help toggle cancels both queued side requests")
    SCATOptions.HelpEnabled := true,SCATReset(),V7817Feed(160000,"11"),V7817Feed(167000,"11","Red",true,900),soundboardsEnabled := false,SCATPoll()
    V48Assert(!Audio.Queue.Length,"voice master still gates help")
    soundboardsEnabled := true,SCATReset(),V7817Feed(180000,"11"),V7817Feed(187000,"11","Red",true,900),autoBossCalloutsEnabled := false,SCATPoll()
    V48Assert(!Audio.Queue.Length,"automatic-callout master still gates help")
}
V7817HelpUI() => V7817Fixture(V7817HelpUICase)
V7817HelpUICase()
{
    global SCATOptions,SCATUI,Audio,AUDIO_MODE_KENKU_BRIDGE_TTS
    SCATOpen(),ICLSet("scyva.catalysthelp",false),SCATSaveSettings(),FlushSettings()
    SCATOptions.HelpEnabled := true,SCATLoadSettings(),SCATSyncUI()
    V48Assert(!SCATOptions.HelpEnabled && !SCATUI.HelpEnabled.Value,"help preference is independent and persists")
    found := 0
    for entry in BuildCalloutPreviewCatalog() {
        if entry.Type="ScyvaCatalystHelp" {
            found += 1,p := ResolveCalloutPreview(entry,"Example",0,AUDIO_MODE_KENKU_BRIDGE_TTS)
            V48Assert(p.Ok && p.Phrase=entry.Part " needs help!","both side previews resolve exactly")
        }
    }
    V48Assert(found=2 && !Audio.Queue.Length,"preview enumeration does not play audio")
    V48Assert(SCATHelpPayload("Kenku","Red").Id="" && SCATHelpPayload("Kenku","Blue").Id="","each side needs its own recording on the recording route")
    SCATUI.RedSoundId.Value := "11111111-1111-1111-1111-111111111111"
    SCATUI.BlueSoundId.Value := "22222222-2222-2222-2222-222222222222",SCATUISave()
    V48Assert(SCATHelpPayload("Kenku","Red").Id=SCATUI.RedSoundId.Value,"red recording is saved independently")
    V48Assert(SCATHelpPayload("Kenku","Blue").Id=SCATUI.BlueSoundId.Value,"blue recording is saved independently")
}


; Native private fixture: suspended hotkeys, private settings, fake audio queue.
V7818Fixture(fn) => V7817Fixture(V7818Inner.Bind(fn))
V7818Inner(fn)
{
    global SCY,SCYOptions,SCYUI
    SCY := SCYNew(0,true),SCYOptions := SCYDefaults(),SCYUI := {Gui:""}
    try fn.Call()
    finally {
        if IsObject(SCYUI.Gui)
            SCYUI.Gui.Destroy()
        SCYUI := {Gui:""}
    }
}
V7818Actor(hp := 900,id := "99") => "SCYVA {4108140513591296}:" id "|(-485,2165,187,0)|(" hp "/1000)"
V7818Feed(at,ability := "hp",hp := 900,live := true,kind := "cast",id := "99")
{
    global testClock
    ids := Map("atomic","4127287477796864","rad","4144050735153152","up","4127296067731456",
        "d","4127291772764160","ignite","4131981877051392","init","4146653485334528",
        "finalatomic","4127304657666048","destroy","4127321837535232","extinction","4127313247600640")
    actor := V7818Actor(hp,id),testClock := at
    ab := ids.Has(ability) ? ids[ability] : "1",action := "836045448945472",effect := "836045448945479"
    src := actor,dst := "="
    if ability="hp"
        src := V671FloorPlayer(),dst := actor,action := "836045448945477",effect := "836045448945501"
    if kind="end"
        action := "836045448945478",effect := "4144050735153471"
    if kind="apply"
        action := "836045448945477",effect := ability="ignite" ? "4131981877051728" : "4144050735153471"
    if kind="interrupt"
        effect := "836045448945482"
    if kind="death"
        src := V671FloorPlayer(),dst := actor,effect := "836045448945493"
    line := V671FloorLine(at,src,dst,ab,action,effect)
    SCYSafeTrack(line,live,at)
}
V7818Take(expected := "")
{
    global Audio
    V48Assert(Audio.Queue.Length=(expected="" ? 0 : 1),"exact pending call count: " expected)
    if expected!="" {
        V48Assert(Audio.Queue[1].Phrase=expected,"exact spoken phrase")
        V48Assert(AudioItemEnabled(Audio.Queue[1]),"actual dispatch policy accepts this call")
    }
    Audio.Queue := []
}
V7818Opening(base := 100000,live := true)
{
    V7818Feed(base,"atomic",970,live),V7818Feed(base+6000,"rad",940,live)
    V7818Feed(base+10100,"up",920,live),V7818Feed(base+16100,"d",880,live)
    V7818Feed(base+20200,"rad",850,live),V7818Feed(base+24200,"d",820,live)
    V7818Feed(base+28300,"up",800,live),V7818Feed(base+34300,"rad",780,live)
    V7818Feed(base+38400,"d",750,live),V7818Feed(base+42400,"d",730,live)
    V7818Feed(base+46500,"up",710,live)
}
V7818FirstOnly() => V7818Fixture(V7818FirstOnlyCase)
V7818FirstOnlyCase()
{
    global SCY,Audio
    V7818Opening(),V7818Take("Last upheaval.")
    V7818Feed(146501,"up",710),V7818Take()
    V7818Feed(152500,"rad",680),V7818Take("Last radiance.")
    V7818Feed(156500,"d",660),V7818Take()
    V7818Feed(162600,"ignite",650),V7818Take("Ignite core.")
    V7818Feed(162600,"ignite",650,true,"apply"),V7818Take()
    V7818Feed(174500,"ignite",650),V7818Take()
    V7818Opening(200000),V7818Take()
    V7818Feed(252500,"rad",500),V7818Feed(258600,"ignite",480),V7818Take()
    V48Assert(SCY.IgniteSeen,"first Ignite latch survives all later cycles")
}
V7818LateCycle() => V7818Fixture(V7818LateCycleCase)
V7818LateCycleCase()
{
    global SCY
    V7818Feed(100000,"atomic",650)
    for at in [106000,119600,133200,146800]
        V7818Feed(at,"rad",600)
    V7818Feed(150900,"atomic",550)
    V7818Feed(157000,"up",530),V7818Feed(163000,"rad",500)
    V7818Feed(175200,"up",450),V7818Feed(181200,"rad",430)
    V7818Feed(193400,"up",380),V7818Feed(199400,"rad",350)
    V7818Feed(209600,"ignite",320),V7818Take()
    V48Assert(!SCY.First && SCY.IgniteSeen,"joining a later cycle cannot call it Ignite1")
    SCYReset(),V7818Feed(300000,"up"),V7818Feed(318000,"up"),V7818Feed(336000,"up")
    V7818Feed(342000,"rad"),V7818Feed(348000,"ignite"),V7818Take()
    SCYReset(),V7818Opening(400000,false),V7818Take()
    V7818Feed(452500,"rad",680,false),V7818Feed(458600,"ignite",650,false),V7818Take()
    V7818Feed(470500,"ignite",650),V7818Take()
}
V7818Under() => V7818Fixture(V7818UnderCase)
V7818UnderCase()
{
    global SCY,Audio
    V7818Feed(100000,"rad",305),V7818Feed(100200,"hp",299),V7818Take()
    V7818Feed(102000,"hp",290),V7818Take()
    V7818Feed(102100,"rad",288,true,"end"),V7818Take("Go under.")
    V7818Feed(104000,"init",270),V7818Take()
    SCYReset(),V7818Feed(200000,"d",320),V7818Feed(200500,"hp",300),V7818Take("Go under.")
    SCYReset(),V7818Feed(300000,"hp",299),V7818Take()
    V7818Feed(303000,"init",280),V7818Take("Go under.")
    SCYReset(),V7818Feed(400000,"rad",299),V7818Take()
    V7818Feed(400100,"rad",299,true,"apply"),V7818Take()
    V7818Feed(402100,"rad",285,true,"end"),V7818Take("Go under.")
    SCYReset(),V7818Opening(500000),V7818Take("Last upheaval.")
    V7818Feed(552500,"rad",299),V7818Take()
    V7818Feed(554600,"rad",280,true,"end"),V7818Take("Go under.")
    V7818Feed(558600,"ignite",270),V7818Take()
    SCYReset(),V7818Feed(600000,"rad",310),V7818Feed(600200,"hp",299,false)
    V7818Feed(602100,"rad",285,true,"end"),V7818Take()
}
V7818Lifecycle() => V7818Fixture(V7818LifecycleCase)
V7818LifecycleCase()
{
    global SCY,Audio,IP,testClock
    V7818Opening(),V48Assert(Audio.Queue.Length=1,"queued before reset")
    V7818Feed(146600,"hp",0,true,"death"),V7818Take()
    V7818Feed(152500,"rad",680),V7818Take()
    V7818Feed(160000,"atomic",970,true,"cast","100")
    V48Assert(!SCY.Ended && SCY.Boss!="","new boss identity rearms")
    SCYReset(),V7818Opening(200000),V48Assert(Audio.Queue.Length=1,"next pull rearms")
    area := "[00:04:10.000] [@Test#1|(0,0,0,0)|(100/100)] [] [] [AreaEntered {836045448953664}: Gods {833571547775765} 8 Veteran {836045448953653}]"
    testClock := 250000,SCYSafeTrack(area,true,testClock),V7818Take()
    V48Assert(!SCY.Scope,"Veteran mode clears NiM cues")
    V7818Opening(300000),V7818Take()
    SCYReset("log changed",false),V48Assert(!SCY.Scope,"log change drops scope")
}
V7818Audio() => V7818Fixture(V7818AudioCase)
V7818AudioCase()
{
    global SCY,SCYOptions,Audio,ReadClockSample,testClock,activeBoss
    SCYOptions.Upheaval := false,V7818Opening(),V7818Take()
    SCYOptions.Upheaval := true,V7818Feed(146501,"up",710),V7818Take()
    V7818Feed(152500,"rad",680),item := Audio.Queue[1],Audio.Epoch += 1
    V48Assert(!AudioItemEnabled(item),"old epoch cannot speak")
    Audio.Queue := [],SCYReset(),V7818Opening(200000),item := Audio.Queue[1]
    testClock := 248501,V48Assert(!AudioItemEnabled(item),"late queue expires after2s")
    Audio.Queue := [],SCYReset(),activeBoss := "GFTM - Tyth",V7818Opening(300000),V7818Take()
    activeBoss := "GFTM - Scyva",SCYReset(),ReadClockSample := {Tick:500000,LatestStamp:500000}
    V7818Opening(400000),V7818Take(),ReadClockSample := ""
    SCYReset(),V7818Opening(600000),V48Assert(Audio.Queue.Length=1,"old prep is queued")
    V7818Feed(652500,"rad",680),V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].SCYData.Part="Radiance","new prep replaces obsolete one")
    V7818Feed(652600,"hp",299),V7818Take()
    Audio.Epoch += 1,V7818Feed(654600,"rad",280,true,"end"),V7818Take()
}
V7818Settings() => V7818Fixture(V7818SettingsCase)
V7818SettingsCase()
{
    global SCY,SCYOptions,SCYUI,Audio,AUDIO_MODE_KENKU_BRIDGE_TTS
    ICLSet("scyva.boss.Upheaval",false),SCYSaveSettings(),FlushSettings()
    SCYOptions := SCYDefaults(),SCYLoadSettings()
    V48Assert(!SCYOptions.Upheaval && SCYOptions.Radiance,"independent switches persist in private INI")
    found := 0
    for entry in BuildCalloutPreviewCatalog() {
        if entry.Type="ScyvaBoss" {
            found += 1,p := ResolveCalloutPreview(entry,"Sample",0,AUDIO_MODE_KENKU_BRIDGE_TTS)
            V48Assert(p.Ok && p.Phrase=SCYPhrase(entry.Part),"each preview resolves the actual phrase")
        }
    }
    V48Assert(found=7,"all seven calls have previews")
    SCYOpen(),V48Assert(IsObject(SCYUI.Gui) && !SCYUI.Upheaval.Value,"hidden setup mirrors saved toggle")
    ICLSet("scyva.boss.Upheaval",true),V48Assert(SCYUI.Upheaval.Value,"library updates setup toggle")
    V48Assert(!Audio.Queue.Length && !SCY.IgniteSeen,"setup and preview resolution do not speak or change fight state")
}

; Native replay through the real parser/controller/queue. Private fixture only.
V7819Start(base := 100000)
{
    V7818Feed(base,"init",290),V7818Take("Go under.")
}
V7819Lead(base := 100000,live := true)
{
    V7818Feed(base+13000,"finalatomic",280,live),V7818Feed(base+19000,"rad",270,live)
    V7818Feed(base+23000,"destroy",260,live),V7818Feed(base+26000,"destroy",250,live)
    V7818Take()
    V7818Feed(base+29000,"destroy",240,live)
}
V7819Sequence() => V7818Fixture(V7819SequenceCase)
V7819SequenceCase()
{
    global SCY
    V7819Start()
    for base in [100000,150000] {
        V7819Lead(base),V7818Take("Last destroy.")
        V7818Feed(base+29001,"destroy",240),V7818Take()
        V7818Feed(base+32000,"finalatomic",230),V7818Take("Last atomic.")
        V7818Feed(base+32001,"finalatomic",230),V7818Take()
        V7818Feed(base+38000,"extinction",220),V7818Take("Extinction.")
        V7818Feed(base+38001,"extinction",220),V7818Take()
        V7818Feed(base+43000,"extinction",200),V7818Take()
        V7818Feed(base+48000,"extinction",190),V7818Take()
    }
    V48Assert(SCY.FinalCycle=2,"next final-phase sequence rearms exactly one pair")
    V7818Feed(205000,"ignite",180),V7818Take()
}
V7819Partial() => V7818Fixture(V7819PartialCase)
V7819PartialCase()
{
    global SCY
    V7819Start()
    ; A missing Destroy never shifts the next Atomic or second Extinction.
    V7818Feed(113000,"finalatomic",280),V7818Feed(119000,"rad",270)
    V7818Feed(123000,"destroy",260),V7818Feed(129000,"destroy",240),V7818Take()
    V7818Feed(132000,"finalatomic",230),V7818Take()
    V7818Feed(138000,"extinction",220),V7818Feed(143000,"extinction",200),V7818Take()
    ; No opening anchor: three Destroys alone are not a confirmed count.
    V7818Feed(160000,"destroy",190),V7818Feed(163000,"destroy",180)
    V7818Feed(166000,"destroy",170),V7818Feed(169000,"finalatomic",160)
    V7818Feed(175000,"extinction",150),V7818Take()
    ; Observed HP and a full sequence allow recovery without the init record.
    SCYReset(),V7818Feed(200000,"hp",290,false)
    V7819Lead(200000),V7818Take("Last destroy.")
    V7818Feed(232000,"finalatomic",230),V7818Take("Last atomic.")
    V7818Feed(238000,"extinction",220),V7818Take("Extinction.")
    ; The other Atomic ability belongs to earlier phases; it must not arm.
    SCYReset(),V7819Start(300000),V7818Feed(313000,"atomic",280)
    V7818Feed(319000,"rad",270),V7818Feed(323000,"destroy",260)
    V7818Feed(326000,"destroy",250),V7818Feed(329000,"destroy",240),V7818Take()
}
V7819Lifetime() => V7818Fixture(V7819LifetimeCase)
V7819LifetimeCase()
{
    global SCY,Audio,testClock
    V7819Start(),V7819Lead(),old := Audio.Queue[1]
    V7818Feed(132000,"finalatomic",230)
    V48Assert(!AudioItemEnabled(old),"last Atomic retires queued last Destroy")
    old := Audio.Queue[1],V7818Feed(138000,"extinction",220)
    V48Assert(!AudioItemEnabled(old),"Extinction retires queued Atomic")
    old := Audio.Queue[1],V7818Feed(143000,"extinction",200),V7818Take()
    V48Assert(!AudioItemEnabled(old),"second cast cannot replay first cast cue")
    V7819Lead(150000),V7818Take("Last destroy.")
    V7818Feed(182000,"finalatomic",230),V7818Take("Last atomic.")
    V7818Feed(183000,"finalatomic",230,true,"interrupt")
    V7818Feed(188000,"extinction",220),V7818Take("Extinction.")
    V7819Lead(200000),V48Assert(Audio.Queue.Length=1,"next confirmed cycle recovers")
    V7818Feed(230000,"hp",0,true,"death"),V7818Take()
    V7818Feed(232000,"finalatomic",230),V7818Feed(238000,"extinction",220),V7818Take()
    SCYReset("new attachment",false),V48Assert(!SCY.Scope && SCY.FinalStage=0,"log reset clears final-phase progress")
    ; Real archives: an interrupted first or third Destroy still advances.
    SCY.Scope := true,V7819Start(300000)
    V7818Feed(313000,"finalatomic",280),V7818Feed(319000,"rad",270)
    V7818Feed(323000,"destroy",260),V7818Feed(323500,"destroy",260,true,"interrupt")
    V7818Feed(324600,"destroy",250),V7818Feed(327700,"destroy",240)
    V7818Take("Last destroy.")
    V7818Feed(328300,"destroy",240,true,"interrupt"),V7818Take()
    V7818Feed(328900,"finalatomic",230),V7818Take("Last atomic.")
    V7818Feed(335000,"extinction",220),V7818Take("Extinction.")
}
V7819Policy() => V7818Fixture(V7819PolicyCase)
V7819PolicyCase()
{
    global SCYOptions,Audio,testClock,ReadClockSample,audioOutputMode,AUDIO_MODE_KENKU_BRIDGE_TTS
    V7819Start(),SCYOptions.Destroy := false,V7819Lead(),V7818Take()
    SCYOptions.Destroy := true,V7818Feed(129001,"destroy",240),V7818Take()
    V7818Feed(132000,"finalatomic",230),item := Audio.Queue[1]
    Audio.Epoch += 1,V48Assert(!AudioItemEnabled(item),"output epoch invalidates queued Atomic"),Audio.Queue := []
    SCYOptions.Extinction := false,V7818Feed(138000,"extinction",220),V7818Take()
    SCYOptions.Extinction := true,V7818Feed(143000,"extinction",200),V7818Take()
    ; Hydrating the first cast consumes the pair; resuming on second stays quiet.
    V7819Lead(200000,false),V7818Take()
    V7818Feed(232000,"finalatomic",230,false),V7818Feed(238000,"extinction",220,false)
    V7818Feed(243000,"extinction",200),V7818Take()
    V7819Lead(300000),item := Audio.Queue[1],testClock := 331001
    V48Assert(!AudioItemEnabled(item),"late Last destroy expires"),Audio.Queue := []
    ReadClockSample := {Tick:500000,LatestStamp:500000}
    V7818Feed(332000,"finalatomic",230),V7818Take(),ReadClockSample := ""
    V7818Feed(338000,"extinction",220),V7818Take("Extinction.")
    V48Assert(CalloutPriority("Boss","ScyvaBossExtinction")<CalloutPriority("Player","Taunt"),"taunt remains higher priority")
}
V7819Settings() => V7818Fixture(V7819SettingsCase)
V7819SettingsCase()
{
    global SCYOptions,SCYUI,SCY,Audio,AUDIO_MODE_KENKU_BRIDGE_TTS
    ICLSet("scyva.boss.Destroy",false),ICLSet("scyva.boss.Atomic",false)
    SCYOptions.ExtinctionSoundId := "12345678-1234-1234-1234-123456789012"
    SCYSaveSettings(),FlushSettings(),SCYOptions := SCYDefaults(),SCYLoadSettings()
    V48Assert(!SCYOptions.Destroy && !SCYOptions.Atomic && SCYOptions.Extinction,"independent final-phase switches persist")
    V48Assert(SCYOptions.ExtinctionSoundId="12345678-1234-1234-1234-123456789012","optional recording persists")
    SCYOpen(),V48Assert(!SCYUI.Destroy.Value && SCYUI.Extinction.Value,"hidden Extinction page reflects settings")
    ICLSet("scyva.boss.Destroy",true),V48Assert(SCYUI.Destroy.Value,"library and setup stay synchronized")
    for part in ["Destroy","Atomic","Extinction"] {
        row := ICLDefinition("scyva.boss." part)
        V48Assert(IsObject(row),"final-phase call is in library")
        V48Assert(SCYPayload(AUDIO_MODE_KENKU_BRIDGE_TTS,part).Phrase=SCYPhrase(part),"TTS uses requested short phrase")
    }
    V48Assert(!Audio.Queue.Length && SCY.FinalStage=0,"settings and previews leave encounter/audio idle")
}

; Private native AHK parser + real queue gating. No speech or live app startup.
V7820Fixture(fn) => V672LibraryFixture(V7820Inner.Bind(fn))
V7820Inner(fn)
{
    global IZT,IZI,IZTOptions,IZTUI,activeBoss
    IZT := IZTNew(0,true),IZI := IZINew(0,true),IZTOptions := IZTDefaults(),activeBoss := "GFTM - Izax"
    try fn.Call()
    finally {
        if IsObject(IZTUI.Gui)
            IZTUI.Gui.Destroy()
        IZTUI := {Gui:""}
    }
}
V7820Boss(hp := 330,id := "99") => "IZAX {4108097563918336}:" id "|(0,0,0,0)|(" hp "/1000)"
V7820Gem(hp := 1000) => "GEMINI {4163751750139904}:88|(0,0,0,0)|(" hp "/1000)"
V7820Drone(id := "11",hp := 1000,npc := "4164821196996608") => "Tether Drone {" npc "}:" id "|(35,2234,0,0)|(" hp "/1000)"
V7820Feed(at,kind := "hit",id := "11",live := true)
{
    global testClock
    src := V7820Boss(),dst := V671FloorPlayer(),ab := "1",act := "836045448945477",ef := "836045448945501",tail := " (10)"
    switch kind {
        case "start": dst := "=",ab := "4163854829355008",act := "836045448945472",ef := "836045448945479"
        case "signal": src := V7820Gem(),dst := V7820Boss(),ab := "4163764635041792",ef := "4163764635042092"
        case "spawn","old","damaged": src := V7820Drone(id,kind="damaged" ? 400 : 1000,kind="old" ? "4159890574540800" : "4164821196996608"),act := "836045448945472",ef := "836045448953668"
        case "death": src := V671FloorPlayer(),dst := V7820Drone(id,0),act := "836045448945472",ef := "836045448945493"
        case "bossdeath": dst := V7820Boss(0),src := V671FloorPlayer(),act := "836045448945472",ef := "836045448945493"
        case "gemdeath": src := V671FloorPlayer(),dst := V7820Gem(0),act := "836045448945472",ef := "836045448945493"
        case "reset": src := V7820Boss(1000),ef := "836045448953669",act := "836045448945472"
        case "impact": dst := "=",ab := "4166556363784192",ef := ab
        case "burn": dst := "=",ab := "4168751092072448",act := "836045448945472",ef := "836045448945479"
        case "indcast": dst := "=",ab := "4168128321814528",act := "836045448945472",ef := "836045448945479"
        case "induction","inddamage","indremove": dst := "@Player Name#" id "|(0,0,0,0)|(1000/1000)",ab := "4168128321814528",ef := kind="inddamage" ? "836045448945501" : ab,act := kind="indremove" ? "836045448945478" : act
    }
    testClock := at,IZTSafeTrack(V671FloorLine(at,src,dst,ab,act,ef,tail),live,at)
}
V7820Arm(base := 100000,live := true)
{
    V7820Feed(base,"start","11",live),V7820Feed(base+58750,"signal","11",live)
}
V7820Take(expected := "") => V7818Take(expected)
V7820First() => V7820Fixture(V7820FirstCase)
V7820FirstCase()
{
    global IZT
    V7820Arm(),V7820Take("Tethers soon.")
    V7820Feed(160000,"signal"),V7820Take()
    V7820Feed(163000),V7820Feed(163800,"spawn"),V7820Take("Tethers spawning.")
    for pair in [[163801,"11"],[164000,"22"],[164200,"33"],[164500,"44"]]
        V7820Feed(pair[1],"spawn",pair[2])
    V7820Take(),V48Assert(IZT.Drones.Count=4,"four distinct drones produce one grouped call")
    V7820Feed(173000,"signal"),V7820Take()
    V48Assert(IZT.Pending.Length=0,"no free-running spawn prediction")
}
V7820Respawn() => V7820Fixture(V7820RespawnCase)
V7820RespawnCase()
{
    global IZT,testClock
    V7820Arm(),V7820Take("Tethers soon.")
    V7820Feed(163000),V7820Feed(163800,"spawn"),V7820Take("Tethers spawning.")
    V7820Feed(164000,"spawn","22"),V7820Feed(174000,"death"),V7820Feed(174100,"death")
    V7820Feed(175000,"death","22")
    V48Assert(IZT.Pending.Length=2,"each drone death schedules only once")
    V7820Feed(200900),testClock := 201000,IZTPoll(),V7820Take("Tethers soon.")
    V7820Feed(202000),V7820Take()
    V7820Feed(205000),V7820Feed(205700,"spawn","55"),V7820Take("Tethers spawning.")
    V7820Feed(206000,"spawn","66"),V7820Take()
    V48Assert(!IZT.Pending.Length,"nearby respawn predictions are coalesced")
    V7820Feed(210000,"death","55"),V7820Feed(220000,"death","66")
    V7820Feed(236900),testClock := 237000,IZTPoll(),V7820Take("Tethers soon.")
    V7820Feed(241000),V7820Feed(241500,"spawn","77"),V7820Take("Tethers spawning.")
    V7820Feed(246900),testClock := 247000,IZTPoll(),V7820Take()
    ; Arrival-based suppression keeps a just-arrived group from saying soon again.
    V7820Feed(251000),V7820Feed(251600,"spawn","88"),V7820Take("Tethers spawning.")
}
V7820Scope() => V7820Fixture(V7820ScopeCase)
V7820ScopeCase()
{
    global IZT,IZI,IP
    V7820Feed(90000,"old"),V7820Take(),V48Assert(!IZT.Drones.Count,"earlier player tether droid ignored")
    V7820Feed(95000,"spawn"),V7820Take(),V48Assert(!IZT.Drones.Count,"no Scyva phase anchor stays quiet")
    V7820Arm(),V7820Take("Tethers soon."),V7820Feed(163000)
    V7820Feed(163800,"damaged"),V7820Feed(164000,"spawn"),V7820Take()
    V48Assert(IZT.Drones.Count=1,"late damaged sighting cannot later become a new spawn")
    IZTReset("new log",false),V7820Arm(200000),V7820Take()
    V48Assert(!IZT.Scope,"unknown difficulty cannot arm")
    for mode in ["836045448953653","836045448953654","836045448953658"] {
        IP.ReaderContext := {AreaId:"833571547775765",ModeId:mode}
        IZTReset("other mode",false),V7820Arm(300000),V7820Take()
        V7820Feed(360000,"indcast"),V7820Feed(361100,"induction"),V7820Take()
    }
}
V7820Lifetime() => V7820Fixture(V7820LifetimeCase)
V7820LifetimeCase()
{
    global IZT,IZI,Audio,testClock
    for i,ending in ["impact","burn","gemdeath","bossdeath","reset"] {
        IZTReset(),IZT.Scope := true,IZI.Scope := true,base := i*300000
        V7820Arm(base),V7820Take("Tethers soon.")
        V7820Feed(base+63000),V7820Feed(base+63800,"spawn"),V7820Take("Tethers spawning.")
        V7820Feed(base+70000,"death"),V7820Feed(base+80000,ending)
        V48Assert(IZT.Ended && !IZT.Pending.Length,"phase end cancels future predictions: " ending)
        V7820Feed(base+97000),V7820Feed(base+100000,"spawn","22"),V7820Take()
    }
    IZTReset(),IZT.Scope := true,V7820Arm(2000000),item := Audio.Queue[1]
    IZTStop(),V48Assert(!AudioItemEnabled(item),"stop retires queued tether warning"),V7820Take()
    V7820Feed(2064000,"spawn"),V7820Take()
    IZTReset("attachment",false),V48Assert(!IZT.Scope && !IZT.Pending.Length,"attachment clears scope and deadlines")
}
V7820Policy() => V7820Fixture(V7820PolicyCase)
V7820PolicyCase()
{
    global IZT,Audio,testClock,soundboardsEnabled,autoBossCalloutsEnabled,activeBoss,ReadClockSample,IZTOptions
    V7820Arm(),V7820Take("Tethers soon."),V7820Feed(164000,"death")
    ICLSet("izax.tethers.Soon",false),ICLSet("izax.tethers.Soon",true)
    V7820Feed(190900),testClock := 191000,IZTPoll(),V7820Take()
    V7820Feed(200000,"death","22"),Audio.Epoch += 1
    V7820Feed(226900),testClock := 227000,IZTPoll(),V7820Take()
    V7820Feed(230000,"death","33"),soundboardsEnabled := false
    V7820Feed(256900),testClock := 257000,IZTPoll(),V7820Take()
    soundboardsEnabled := true,V7820Feed(258000),V7820Take()
    V7820Feed(260000,"death","44"),activeBoss := "GFTM - Scyva"
    V7820Feed(286900),testClock := 287000,IZTPoll(),V7820Take()
    activeBoss := "GFTM - Izax",V7820Feed(289900),V7820Feed(290000,"spawn","55"),item := Audio.Queue[1]
    testClock += 2001,V48Assert(!AudioItemEnabled(item),"stale queued arrival expires"),Audio.Queue := []
    ReadClockSample := {Tick:400000,LatestStamp:400000}
    V7820Feed(305000,"spawn","66"),V7820Take(),ReadClockSample := ""
    V48Assert(CalloutPriority("Boss","IzaxTethersInduction")<CalloutPriority("Player","Taunt"),"taunts retain priority")
}
V7820Recovery() => V7820Fixture(V7820RecoveryCase)
V7820RecoveryCase()
{
    global IZT,testClock
    V7820Arm(100000,false),V7820Feed(163800,"spawn","11",false),V7820Feed(175000,"death","11",false)
    V7820Take(),V7820Feed(201900),testClock := 202000,IZTPoll(),V7820Take()
    V7820Feed(206000),V7820Feed(206500,"spawn","22"),V7820Take("Tethers spawning.")
    V7820Feed(210000,"death","22"),testClock := 237000,IZTPoll(),V7820Take()
    V7820Feed(237100),V7820Take(),V48Assert(!IZT.Pending.Length,"stalled stream consumes deadline without later replay")
    IZTReset(),IZT.Scope := true,V7820Feed(300000,"start"),V7820Feed(380000,"signal"),V7820Take()
    V48Assert(IZT.Signal && !IZT.Pending.Length,"late repeated channel cannot predict first wave")
    ; Backward records do not resurrect old NPC instances or warning clocks.
    V7820Feed(310000,"signal"),V7820Take(),V48Assert(IZT.At=380000,"out-of-order timestamp ignored")
}
V7820Settings() => V7820Fixture(V7820SettingsCase)
V7820SettingsCase()
{
    global IZT,IZTUI,IZTOptions,IZI,Audio,AUDIO_MODE_KENKU_BRIDGE_TTS
    ICLSet("izax.tethers.Soon",false),IZTSaveSettings(),FlushSettings(),IZTOptions := IZTDefaults(),IZTLoadSettings()
    V48Assert(!IZTOptions.Soon && IZTOptions.Spawning && IZTOptions.Induction,"three independent settings persist")
    IZTOpen(),V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IZTUI.Gui.Hwnd),"test setup GUI remains hidden")
    ICLSet("izax.tethers.Soon",true),V48Assert(IZTUI.Soon.Value,"library and setup checkboxes stay synchronized")
    count := 0
    for entry in BuildCalloutPreviewCatalog() {
        if entry.Type!="IzaxTethers"
            continue
        count += 1,p := ResolveCalloutPreview(entry,"Sample Player",3,AUDIO_MODE_KENKU_BRIDGE_TTS)
        V48Assert(p.Ok && p.Phrase=(entry.Part="Induction" ? "Sample Player has induction." : IZTPhrase(entry.Part)),"preview resolves actual spoken text")
    }
    V48Assert(count=3 && !Audio.Queue.Length && IZT.Start=-1 && IZI.Cast=-1,"previews and settings do not create encounter state or audio")
}
V7820Induction() => V7820Fixture(V7820InductionCase)
V7820InductionCase()
{
    global IZI,Audio,testClock,IZTOptions,ReadClockSample
    V7820Feed(100000,"indcast"),V7820Take()
    V7820Feed(101100,"induction"),V7820Take("Player Name has induction.")
    V7820Feed(101101,"induction"),V7820Feed(105100,"induction"),V7820Feed(105101,"inddamage"),V7820Feed(105102,"induction","22"),V7820Take()
    V7820Feed(120000,"indcast"),V7820Feed(121100,"induction"),V7820Take("Player Name has induction.")
    V7820Feed(140000,"indcast"),V7820Feed(141100,"induction","11",false),V7820Feed(145100,"induction"),V7820Take()
    IZTOptions.Induction := false,V7820Feed(160000,"indcast"),V7820Feed(161100,"induction"),V7820Take()
    IZTOptions.Induction := true,V7820Feed(165100,"induction"),V7820Take()
    V7820Feed(180000,"indcast"),V7820Feed(181100,"induction"),item := Audio.Queue[1]
    V7820Feed(181200,"bossdeath"),V48Assert(!AudioItemEnabled(item),"death invalidates named warning"),V7820Take()
    IZTReset(),IZI.Scope := true,V7820Feed(200000,"induction"),V7820Take()
    V7820Feed(201000,"indcast"),V7820Feed(205100,"induction"),V7820Take()
    ReadClockSample := {Tick:300000,LatestStamp:300000}
    V7820Feed(220000,"indcast"),V7820Feed(221100,"induction"),V7820Take(),ReadClockSample := ""
    V7820Feed(240000,"indcast"),V7820Feed(241100,"induction"),item := Audio.Queue[1]
    testClock += 2001,V48Assert(!AudioItemEnabled(item),"Induction queue expires without delayed speech"),Audio.Queue := []
}

; Private native regressions: real line decoder, controller, settings and queue.
; Never run a speaker, gameplay hook or visible desktop window.
V7821Fixture(fn) => V672LibraryFixture(V7821Inner.Bind(fn))
V7821Inner(fn)
{
    global IZP,IZPOptions,IZPUI,IPM,activeBoss
    old := IPM
    IZP := IZPNew(0,true),IZPOptions := IZPDefaults(),activeBoss := "GFTM - Izax",IPM := IPMNewState()
    IZPOptions.Sections := false
    IZPOptions.Slots[2] := {Name:"Sophie",Characters:"First Toon, Alt Toon"}
    IZPOptions.Slots[3] := {Name:"Second",Characters:"Second Toon"}
    try fn.Call()
    finally {
        if IsObject(IZPUI.Gui)
            IZPUI.Gui.Destroy()
        IZPUI := {Gui:""}
        IPMRetirePanels(IPMAllPanels()),IPM := old
    }
}
V7821Feed(at,kind := "start",player := "First Toon",live := true)
{
    global testClock
    src := V7820Boss(750),dst := "=",ability := "1",effect := "836045448945501",action := "836045448945477",tail := " (1)"
    switch kind {
        case "start": ability := "4163120389947392",effect := "836045448945479",action := "836045448945472"
        case "up": ability := "4162922821451776",effect := ability
        case "remove": ability := "4162922821451776",effect := ability,action := "836045448945478"
        case "shake": ability := "4169996632588288",effect := "4169996632588556"
        case "immune": ability := "4169996632588288",effect := "4169996632588552"
        case "half": dst := src,src := "@" player "#111|(0,0,0,0)|(1000/1000)",tail := " (1070000 ~0 energy {836045448940874}) (1070000 absorbed {836045448945511})"
        case "cast": ability := "4162849807007744",action := "836045448945472",effect := "836045448945479"
        case "kick","cancel": ability := "4162849807007744",action := "836045448945472",effect := "836045448945482",dst := "",src := kind="kick" ? "@" player "#111|(0,0,0,0)|(1000/1000)" : src
        case "quell": ability := "2204499338854400",action := "836045448945472",effect := "836045448945479",src := "@" player "#111|(0,0,0,0)|(1000/1000)",dst := V7820Boss(750)
        case "phase4": ability := "4173226447994880",effect := ability
        case "dead": dst := V7820Boss(0),action := "836045448945472",effect := "836045448945493"
        case "reset": src := V7820Boss(1000),action := "836045448945472",effect := "836045448953669"
    }
    testClock := at,IZPSafeTrack(V671FloorLine(at,src,dst,ability,action,effect,tail),live,at)
}
V7821Break(at := 101000,live := true)
{
    V7821Feed(at-1,"shake","First Toon",live),V7821Feed(at,"remove","First Toon",live)
}
V7821Take(phrase := "")
{
    global testClock
    testClock += 60,IZPPoll(),V7818Take(phrase)
}
V7821Arm(base := 100000)
{
    V7821Feed(base),V7821Feed(base+100,"up"),V7821Break(base+1000)
}
V7821Shield() => V7821Fixture(V7821ShieldCase)
V7821ShieldCase()
{
    global IZP
    V7821Feed(100000),V48Assert(IZP.Active && !IZP.Known,"P3 anchor supports a missing initial shield application without inventing HP")
    V7821Feed(100100,"up"),V48Assert(IBMData().Rows[1].Value="~100%","new shield begins estimated full")
    V7821Feed(100200,"half"),V48Assert(IZP.Absorbed=1070000 && IBMData().Rows[1].Value="~50%","explicit absorbed damage reduces only shield estimate")
    V7821Feed(100300,"half"),V7821Take()
    V48Assert(IZP.Shield="Up" && IBMData().Rows[1].Value="~1%","estimated depletion never fabricates break")
    V7821Break(),V7821Take("Sophie, interrupt.")
    V48Assert(IBMData().Rows[1].Value="Broken","actual effect removal overrides estimate")
    V7821Feed(101200,"half"),V48Assert(IZP.Shield="Down","delayed absorption does not resurrect broken shield")
    V7821Feed(104000,"half"),V48Assert(IZP.Shield="Down" && !IZP.Known,"late absorption cannot override actual shield removal")
    V7821Feed(104500,"immune"),V48Assert(IZP.Shield="Up" && !IZP.Known,"immunity restoration without shield application leaves HP unknown")
    V7821Feed(105000,"up"),V48Assert(IBMData().Rows[1].Value="~100%","recorded reapplication starts fresh budget")
    V7821Feed(105100,"half"),V7821Feed(105101,"up")
    V48Assert(IZP.Absorbed=1070000,"duplicate application cannot refill shield estimate")
}
V7821Order() => V7821Fixture(V7821OrderCase)
V7821OrderCase()
{
    global IZP
    V7821Arm(),V7821Take("Sophie, interrupt.")
    V7821Feed(102000,"cast"),V7821Feed(102500,"quell"),V7821Take()
    V48Assert(IZP.Next=1,"ability activation alone is not a landed interrupt")
    V7821Feed(102700,"cancel"),V7821Take(),V48Assert(IZP.Next=1,"boss scripted interruption does not use a player slot")
    V7821Feed(102800,"kick","Alt Toon"),V7821Take("Second next.")
    V48Assert(IZP.Next=2,"alt binding advances to next filled slot")
    V7821Feed(103000,"kick","Second Toon"),V7821Take()
    V48Assert(IZP.Next=2,"overlapping kick of same cast cannot consume another slot")
    V7821Feed(104000,"cast"),V7821Feed(104500,"kick","Second Toon"),V7821Take("Sophie next.")
    V48Assert(IZP.Next=1,"completed order wraps to first slot")
    V7821Feed(106000,"cast"),V7821Feed(106500,"kick","Unbound Toon"),V7821Take("Sophie next.")
    V48Assert(IZP.Next=1,"unknown cover interrupt preserves the assigned next player")
    V7821Feed(108000,"cast"),V7821Feed(108500,"kick"),V7821Take("Second next.")
    V7821Feed(115000,"up"),V7821Break(120000),V7821Take("Sophie, interrupt.")
    V48Assert(IZP.Next=1,"new shield break restarts order as requested")
    V7821Feed(121000,"cast"),V7821Feed(121100,"kick","Second Toon"),V7821Take("Sophie next.")
    V48Assert(IZP.Next=1,"out-of-order assigned interrupt follows actual player instead of blind increment")
}
V7821Scope() => V7821Fixture(V7821ScopeCase)
V7821ScopeCase()
{
    global IZP,IP,Audio
    for mode in ["836045448953653","836045448953654","836045448953658",""] {
        IZPReset("different mode",false),IP.ReaderContext := {AreaId:"833571547775765",ModeId:mode}
        V7821Arm(),V7821Take(),V48Assert(!IZP.Active,"unsupported difficulty cannot arm shield tracker")
    }
    IP.ReaderContext := {AreaId:"833571547775765",ModeId:"836045448953655"}
    for kind in ["phase4","dead","reset"] {
        IZPReset("next test",false),V7821Arm(),V7821Take("Sophie, interrupt.")
        V7821Feed(104000,kind),V48Assert(IZP.Ended && !IZP.Active,"recorded end retires shield: " kind)
        V7821Feed(105000,"cast"),V7821Feed(105500,"kick"),V7821Take()
    }
    IZPReset(),IZP.Scope := true,V7821Arm(),V7821Feed(101001,"phase4"),V7821Take()
    V48Assert(!Audio.Queue.Length,"same-batch phase cleanup cancels pending break")
    IZPReset(),IZP.Scope := true,V7821Feed(200000),V7821Feed(200100,"up"),V7821Feed(201000,"remove"),V7821Take()
    V48Assert(IZP.Shield="Down","missing vulnerability witness displays state but does not call false break")
}
V7821Audio() => V7821Fixture(V7821AudioCase)
V7821AudioCase()
{
    global IZP,Audio,testClock,ReadClockSample,autoBossCalloutsEnabled,soundboardsEnabled,activeBoss
    V7821Arm(),testClock += 60,IZPPoll(),item := Audio.Queue[1]
    V48Assert(AudioItemEnabled(item),"fresh shield warning passes real queue policy")
    V7821Feed(102000,"up"),V48Assert(!AudioItemEnabled(item) && !Audio.Queue.Length,"reshield cancels unplayed warning")
    V7821Break(105000),ICLSet("izax.shield.Break",false),ICLSet("izax.shield.Break",true),V7821Take()
    V7821Feed(110000,"up"),V7821Break(115000),Audio.Epoch += 1,V7821Take()
    for key in ["master","automatic","profile"] {
        V7821Feed(120000,"up")
        if key="master"
            soundboardsEnabled := false
        if key="automatic"
            autoBossCalloutsEnabled := false
        if key="profile"
            activeBoss := "GFTM - Scyva"
        V7821Break(125000),V7821Take()
        soundboardsEnabled := true,autoBossCalloutsEnabled := true,activeBoss := "GFTM - Izax"
        IZPReset(),IZP.Scope := true,V7821Feed(100000)
    }
    V7821Feed(200000,"up"),ReadClockSample := {Tick:210000,LatestStamp:210000}
    V7821Break(205000),V7821Take(),ReadClockSample := ""
    V7821Feed(220000,"up"),V7821Break(225000),testClock := 227000,IZPPoll(),V7818Take()
    V48Assert(!IZP.Pending.Length,"expired cue cannot speak on later activity")
}
V7821Recovery() => V7821Fixture(V7821RecoveryCase)
V7821RecoveryCase()
{
    global IZP,Audio
    V7821Feed(100000,"start","First Toon",false),V7821Feed(100100,"up","First Toon",false)
    V7821Break(101000,false),V7821Feed(102000,"cast","First Toon",false),V7821Feed(102500,"kick","First Toon",false),V7821Take()
    V48Assert(IZP.Next=2 && !Audio.Queue.Length,"silent recovery rebuilds order without old speech")
    V7821Feed(104000,"cast"),V7821Feed(104500,"kick","Second Toon"),V7821Take("Sophie next.")
    V7821Feed(100100,"up"),V48Assert(IZP.Shield="Down" && IZP.At=104500,"old timestamp cannot resurrect shield")
    IZPReset("new attachment",false),V48Assert(!IZP.Scope && !IZP.Active && !IZP.Pending.Length,"new source drops previous pull state")
    IZP.Scope := true,V7821Feed(86399500),V7821Feed(86399600,"up"),V7821Break(86400050),V7821Take("Sophie, interrupt.")
    V48Assert(IZP.At=86400050,"midnight unwrap keeps shield lifecycle ordered")
}
V7821Settings() => V7821Fixture(V7821SettingsCase)
V7821SettingsCase()
{
    global IZPOptions,IZPUI,IZP,Audio,AUDIO_MODE_KENKU_BRIDGE_TTS,SETTINGS_FILE
    IZPOptions.Slots := IZPValidateSlots(IZPOptions.Slots),IZPSaveSettings(),FlushSettings()
    IZPOptions := IZPDefaults(),IZPLoadSettings()
    V48Assert(IZPOptions.Slots[2].Characters="First Toon, Alt Toon" && IZPOrder(IZPOptions.Slots).Length=2,"saved nicknames and alt bindings survive restart")
    bad := V672LibraryCopy(IZPOptions.Slots),bad[3].Characters := "Alt Toon",rejected := false
    try IZPValidateSlots(bad)
    catch ValueError
        rejected := true
    V48Assert(rejected,"duplicate character binding rejected instead of selecting wrong person")
    bad := V672LibraryCopy(IZPOptions.Slots),bad[2].Characters := "First Toon`nNext=0",rejected := false
    try IZPValidateSlots(bad)
    catch ValueError
        rejected := true
    V48Assert(rejected,"pasted newline cannot create settings or speech instructions")
    IZPOpen(),V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IZPUI.Gui.Hwnd),"settings test window stays hidden")
    ICLSet("izax.shield.Next",false),V48Assert(!IZPUI.Next.Value && IZPUI.Break.Value,"independent switches synchronize with setup")
    count := 0
    for e in BuildCalloutPreviewCatalog() {
        if e.Type!="IzaxShield" || (e.Part!="Break" && e.Part!="Next")
            continue
        p := ResolveCalloutPreview(e,"Sample Player",3,AUDIO_MODE_KENKU_BRIDGE_TTS),count += 1
        V48Assert(p.Ok && InStr(p.Phrase,"Sample Player"),"preview exposes actual named phrase")
    }
    V48Assert(count=2 && !Audio.Queue.Length && !IZP.Active,"preview resolution never plays or modifies encounter")
    IniWrite("Alt Toon",SETTINGS_FILE,"IzaxInterrupts","Slot3Characters"),IZPLoadSettings()
    V48Assert(IZPOptions.LoadError!="" && !IZPSaveSettings(),"malformed saved bindings are preserved, not overwritten by blank defaults")
}
V7821Overlay() => V7821Fixture(V7821OverlayCase)
V7821OverlayCase()
{
    global IPM,IP,IZP,testClock
    IP := IPNewApp(),IPM.Enabled := true,IPM.Shown["Damage"] := true,IPMPreviewSet(8)
    snapshot := V53Snapshot(),snapshot.LayoutPreview := true,p := IPM.Panels["BossMechanics"],p.Width := 330
    before := ObjPtr(IZP),IPMEnsureGui("BossMechanics",0,p),IBMRender(snapshot,p)
    V48Assert(p.Rows[1].Value.Text="~45%" && p.Rows[2].Value.Text="Sophie","shared panel renders compact preview")
    V48Assert(ObjPtr(IZP)=before && !IZP.Active && !DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd),"preview does not start encounter or show test GUI")
    V48Assert(IBMVisible(snapshot) && IBMVisible({},true) && IBMVisible({}),"selected mechanics panel remains arrangeable with an idle placeholder")
    for dpi in [96,144,192] {
        p.Width := 196,l := IBMLayout(p,{L:0,T:0,R:1920,B:1080},dpi)
        V48Assert(l.ValueW>0 && l.ValueX+l.ValueW<=l.W && l.Header+2*l.RowH+l.Footer<=l.H,"minimum width and DPI preserve both rows")
    }
    IPMPreviewClear(IPM),IP.Active := true,IP.Live := V7878FHSegment("G-IZ").Data
    V7821Arm(),V48Assert(IBMVisible({}),"live active P3 enables mechanics panel")
    snapshot.LayoutPreview := false,IBMRender(snapshot,p)
    V48Assert(p.Rows[1].Value.Text="Broken" && p.Rows[2].Value.Text="Sophie","real mechanics replaces preview")
    IP.Active := false,IBMRender(snapshot,p)
    V48Assert(IBMVisible({}) && p.VisibleRows=0 && !InStr(p.Heading.Text,"PREVIEW"),"stopping parser clears stale mechanics without restoring samples")
    IP.Active := true,testClock += 6000,IBMRender(snapshot,p)
    V48Assert(IBMVisible({}) && p.Empty.Text="Waiting for the shield / interrupt phase","stalled live stream returns to supported waiting status")
    V7821Feed(110000,"phase4"),IBMRender(snapshot,p)
    V48Assert(IBMVisible({}) && p.Empty.Text="Waiting for the shield / interrupt phase","leaving interrupt phase clears the previous shield")
    V48Assert(IPMPanelFor("BossMechanics")=p && IOICatalog().Has("BossMechanics"),"shared overlay geometry and icon routing registered")
    V48Assert(IPMSizeKeys().Length=IPMSizeLabels().Length,"display size picker remains aligned")
}

; Real decoder and audio queue on a private test clock/settings file.
V7822Fixture(fn) => V7821Fixture(V7822Inner.Bind(fn))
V7822Inner(fn)
{
    global IZPOptions
    IZPOptions.Sections := true
    names := ["Main","Tank","One","Two","Three","Four","Heal One","Heal Two"]
    for i,name in names
        IZPOptions.Slots[i] := {Name:name,Characters:name " Toon"}
    fn.Call()
}
V7822Event(at,kind,live := true,npc := "4167058874957824",instance := "91")
{
    global testClock
    src := V7820Boss(750),dst := "=",ability := "4163068850339840",effect := ability,action := "836045448945477",tail := " ()"
    switch kind {
        case "zero","nonzero": ability := "4162832627138560",effect := ability,action := "836045448953666",tail := " (" (kind="zero" ? "0" : "1") " charges {836045448953667})"
        case "opening": ability := "4163141864783872",effect := "836045448945479",action := "836045448945472"
        case "disabling": src := "@Tank Toon#11|(0,0,0,0)|(1000/1000)",ability := "1798813907943424",effect := "836045448945479",action := "836045448945472"
        case "tether": src := "Electro-Tether Droid {" npc "}:" instance "|(0,0,0,0)|(1000/1000)",dst := "@Tank Toon#11|(0,0,0,0)|(1000/1000)",ability := "",effect := "836045448953668",action := "836045448945472"
    }
    testClock := at,IZPSafeTrack(V671FloorLine(at,src,dst,ability,action,effect,tail),live,at)
}
V7822Reset(at,live := true)
{
    V7822Event(at,"discharge",live),V7822Event(at+1,"zero",live)
}
V7822Break(at)
{
    V7821Feed(at-1000,"up"),V7821Break(at)
}
V7822Sequence() => V7822Fixture(V7822SequenceCase)
V7822SequenceCase()
{
    global IZP,Audio
    V7821Feed(99900,"up"),V7821Feed(100000),V7822Reset(101000),V7822Break(130000),V7821Take("Tank, interrupt.")
    V48Assert(IZP.Anchored,"shield application before P3 marker still anchors the sequence")
    V7821Feed(131000,"cast"),V7821Feed(131100,"kick","Tank Toon"),V7821Take("One next.")
    for i,name in ["One","Two","Three","Four"] {
        at := 132000+i*2000
        V7821Feed(at,"cast"),V7821Feed(at+100,"kick",name " Toon")
        V7821Take((i=4 ? "Tank" : ["Two","Three","Four"][i]) " next.")
    }
    V7822Break(150000),V7821Take("Tank, interrupt.")
    V48Assert(IZP.Resets=1 && IZP.RoundBreaks=2,"multiple breaks do not advance cannon section")
    V7822Reset(160000),V7822Break(180000),V7821Take("One, interrupt.")
    V7821Feed(181000,"cast"),V7821Feed(181100,"kick","Tank Toon"),V7821Take("One next.")
    V48Assert(IZP.Next=1,"off-tank cover cannot add tank to DPS-only order")
    V7821Feed(182000,"cast"),V7821Feed(182100,"kick","Four Toon"),V7821Take("One next.")
    V7822Reset(190000),V7822Break(220000)
    V7821Feed(220010,"cast"),V7821Feed(220020,"kick","Tank Toon")
    V7821Take("Spam interrupts.")
    V48Assert(IBMData().Rows[2].Value="Spam interrupts","overlay shows spam instead of a player's name")
    V7821Feed(222000,"cast"),V7821Feed(222100,"kick","One Toon"),V7821Take()
    V48Assert(!Audio.Queue.Length,"individual names stay quiet throughout spam window")
    V7822Break(240000),V7821Take("Tank, interrupt.")
    V7822Break(250000),V7821Take("Tank, interrupt.")
    V7821Feed(251000,"phase4"),V7821Take()
    V48Assert(IZP.Ended,"P4 retires all P3 sequence calls")
}
V7822Resets() => V7822Fixture(V7822ResetsCase)
V7822ResetsCase()
{
    global IZP
    V7821Feed(100000),V7822Event(101000,"opening"),V7822Event(101100,"zero"),V7822Event(102000,"disabling")
    V48Assert(IZP.Resets=0,"opening shot and console activation are not counted resets")
    V7822Event(110000,"zero"),V7822Event(110002,"discharge")
    V48Assert(IZP.Resets=1,"zero before discharge also confirms one reset")
    V7822Event(110003,"discharge"),V7822Event(110004,"zero")
    V48Assert(IZP.Resets=1,"duplicate effect records cannot advance section")
    V7822Break(111000),V7821Take("Tank, interrupt.")
    V7822Event(120000,"discharge"),V7822Event(120001,"nonzero")
    V7821Feed(120100,"cast"),V7821Feed(120200,"kick","Tank Toon"),V7821Take()
    V48Assert(IZP.OrderMode="Unknown","unconfirmed reset immediately invalidates the previous order")
    V7821Feed(121000,"up")
    V48Assert(!IZP.SequenceKnown && IZP.Resets=1,"unconfirmed reset disables names rather than guessing section")
    V7822Break(125000),V7821Take("Shield broken.")
    V48Assert(IBMData().Rows[2].Value="Section unknown","unknown section is visible")
    V7822Reset(130000),V7822Break(135000),V7821Take("Shield broken.")
    V48Assert(!IZP.SequenceKnown,"later reset cannot restore a missing reset count")
}
V7822Tethers() => V7822Fixture(V7822TethersCase)
V7822TethersCase()
{
    global IZP
    V7821Feed(100000),V7822Reset(101000),V7822Event(121000,"tether"),V7821Take("Tethers spawning.")
    V7822Event(121100,"tether",true,"4167058874957824","92"),V7821Take()
    V48Assert(IZP.WaveSeen && IZP.Tethers.Count=2,"nearby droids give one call per reset")
    V7822Reset(140000),V7822Event(141000,"tether"),V7821Take()
    V48Assert(!IZP.WaveSeen,"old droid target changes do not fabricate a new wave")
    V7822Event(160000,"tether",true,"4164821196996608","93"),V7821Take()
    V48Assert(!IZP.WaveSeen,"Scyva tether droids cannot trigger P3 calls")
    V7822Event(161000,"tether",true,"4167063169925120","94"),V7821Take("Tethers spawning.")
    V7822Reset(170000),V7822Event(191000,"tether",false,"4167058874957824","95"),V7821Take()
    V48Assert(IZP.WaveSeen,"silent hydration consumes old wave without speech")
}
V7822Safety() => V7822Fixture(V7822SafetyCase)
V7822SafetyCase()
{
    global IZP,IZPOptions,Audio,testClock
    V7821Feed(100000,"up"),V7822Reset(101000),V7822Break(121000),V7821Take("Shield broken.")
    V48Assert(!IZP.Anchored,"attachment after P3 start cannot guess reset ordinal")
    IZPReset(),IZP.Scope := true,V7821Feed(130000),V7822Reset(131000)
    V7821Break(131100),V7821Take()
    V48Assert(IZP.RoundBreaks=0,"reset cleanup removal does not consume a shield break")
    V7822Break(150000),V7821Take("Tank, interrupt.")
    for i,name in ["Main Toon","Heal One Toon","Heal Two Toon"] {
        at := 151000+i*2000,V7821Feed(at,"cast"),V7821Feed(at+100,"kick",name),V7821Take("Tank next.")
        V48Assert(IZP.Next=1,"unused roster role never enters interrupt order")
    }
    V7822Reset(170000),V7822Reset(180000),V7822Break(210000)
    ICLSet("izax.shield.Spam",false),ICLSet("izax.shield.Spam",true),V7821Take()
    V7822Reset(220000),V7822Break(240000),V7821Take("Shield broken.")
    V48Assert(IZP.Resets=4 && IZPMode(IZP)="Unknown","unexpected fourth reset does not guess a repeat strategy")
    V7821Feed(241000,"phase4"),V7822Event(242000,"tether",true,"4167058874957824","99"),V7821Take()
    V48Assert(!Audio.Queue.Length,"P3 tethers cannot speak after phase ends")
    IZPOptions.Sections := false
    V48Assert(IZPActiveOrder(IZP,IZPOptions.Slots).Length=5,"manual single-order mode still excludes main tank and healers")
}
V7822Settings() => V7822Fixture(V7822SettingsCase)
V7822SettingsCase()
{
    global IZPOptions,IZPUI,IZP,SETTINGS_FILE,Audio,AUDIO_MODE_KENKU_BRIDGE_TTS
    IZPSaveSettings(),FlushSettings(),IZPOptions := IZPDefaults(),IZPLoadSettings()
    V48Assert(IZPOptions.Slots[1].Name="Main" && IZPOptions.Slots[8].Name="Heal Two" && IZPOptions.Sections,"all eight roles survive save/reload")
    IZPOpen(),V48Assert(IZPUI.Rows.Length=8 && IZPUI.Sections.Value,"full roster and section option displayed")
    for part in ["Tethers","Spam"] {
        ICLSet("izax.shield." part,false),V48Assert(!IZPUI.%part%.Value,"new callout switch synchronizes")
        ICLSet("izax.shield." part,true)
        entry := {Type:"IzaxShield",Part:part,Group:"Izax",Key:"IzaxShield" part,Label:IZPLabel(part)}
        p := ResolveCalloutPreview(entry,"Sample",3,AUDIO_MODE_KENKU_BRIDGE_TTS)
        V48Assert(p.Ok && p.Phrase=IZPPayload(AUDIO_MODE_KENKU_BRIDGE_TTS,part).Phrase,"preview matches actual new phrase")
    }
    V48Assert(!Audio.Queue.Length && !IZP.Active,"setup and previews are isolated from encounter/audio")
    IniDelete(SETTINGS_FILE,"IzaxInterrupts","RoleLayout"),IZPLoadSettings()
    V48Assert(IZPOptions.Slots[2].Name="Main" && IZPOptions.Slots[3].Name="Tank" && IZPOptions.Slots[1].Name="Four","legacy order remaps without losing any binding")
    V48Assert(IZPOptions.Slots[7].Name="Heal One" && IZPOptions.Slots[8].Name="Heal Two","legacy extra bindings remain available in full roster")
}

; Exercise the actual preview picker/navigation, not only phrase resolution.
; Private settings, hidden GUI, fake audio queue, no playback worker.
V7823Fixture(fn) => V7822Fixture(V7823Inner.Bind(fn))
V7823Inner(fn)
{
    global Preview
    old := Preview,Preview := {Gui:"",Items:[],Visible:false,Message:""}
    try fn.Call()
    finally {
        SetTimer(RefreshCalloutPreview,0)
        if IsObject(Preview.Gui)
            Preview.Gui.Destroy()
        Preview := old
    }
}
V7823PreviewNavigation() => V7823Fixture(V7823PreviewNavigationCase)
V7823PreviewNavigationCase()
{
    global Preview,Audio,Persist,IZP
    before := V672LibraryUIIni(),serial := Persist.Serial,queue := Audio.Queue,encounter := ObjPtr(IZP)
    for entry in BuildCalloutPreviewCatalog() {
        V48Assert(ICLNPreview(entry.Group,entry.Key),"registered preview link opens: " entry.Group "/" entry.Key)
        selected := Preview.Items[Preview.Choice.Value]
        V48Assert(Preview.Group.Text=entry.Group && selected.Key=entry.Key,"picker selects the requested category and callout")
    }
    V48Assert(!DllCall("IsWindowVisible","Ptr",Preview.Gui.Hwnd),"native navigation tests do not show a desktop window")
    V48Assert(!ICLNPreview("missing category","missing key"),"unknown category reports unavailable without Choose error")
    V48Assert(Preview.Group.Value=0 && Preview.Choice.Value=0 && !Preview.Items.Length && !Preview.Play.Enabled && Preview.Text.Value="","unknown category clears any previously armed example")
    message := Preview.Status.Text,RefreshCalloutPreview()
    V48Assert(message!="" && Preview.Status.Text=message && !Preview.Play.Enabled,"refresh cannot rearm a stale preview")
    V48Assert(ICLNPreview("Izax","IzaxShieldBreak"),"valid Izax navigation recovers after missing category")
    V48Assert(!ICLNPreview("Izax","missing key") && Preview.Choice.Value=0 && !Preview.Play.Enabled,"missing key cannot leave another Izax sound armed")
    Preview.Group.Choose(0),PopulateCalloutPreviews()
    V48Assert(!Preview.Items.Length && !Preview.Play.Enabled && Preview.Text.Value="","empty category safely clears stale preview controls")
    V48Assert(Audio.Queue=queue && !Audio.Queue.Length && Persist.Serial=serial && V672LibraryUIIni()=before,"opening every preview neither plays audio nor changes settings")
    V48Assert(ObjPtr(IZP)=encounter && !IZP.Active,"preview navigation does not modify the encounter")
}
V7823PreviewNames() => V7823Fixture(V7823PreviewNamesCase)
V7823PreviewNamesCase()
{
    global Preview,Audio
    for part in IZPParts() {
        open := ICLNPreview.Bind("Izax","IzaxShield" part)
        V48Assert(open.Call(),"Izax setup button binding opens its exact preview")
        named := part="Break" || part="Next"
        V48Assert(Preview.Name.Enabled=named,"sample-name field enabled only for a named interrupt")
        Preview.Name.Value := "Test Mara",RefreshCalloutPreview()
        V48Assert(InStr(Preview.Text.Value,IZPPayload(AUDIO_MODE_KENKU_BRIDGE_TTS,part,"Test Mara").Phrase),"preview displays the actual selected phrase and sample name")
    }
    for part in IZTParts() {
        V48Assert(ICLNPreview("Izax","IzaxTethers" part),"existing Izax tether/Induction preview opens")
        V48Assert(Preview.Name.Enabled=(part="Induction"),"Induction has an editable sample name; tether warnings do not")
    }
    Preview.Name.Value := "Test Healer",RefreshCalloutPreview()
    ICLNPreview("Izax","IzaxTethersInduction"),RefreshCalloutPreview()
    V48Assert(InStr(Preview.Text.Value,"Test Healer has induction"),"Induction uses the sample typed into the picker")
    V48Assert(!Audio.Queue.Length,"preview navigation requires an explicit Play action")
}

; Native decoder/controller/queue regressions under the private fixture.
V7824Early() => V7822Fixture(V7824EarlyCase)
V7824Kick(at,player,expected,live := true)
{
    V7821Feed(at,"cast","First Toon",live)
    V7821Feed(at+100,"kick",player,live),V7821Take(expected)
}
V7824EarlyCase()
{
    global IZP,IZPOptions
    IZPOptions.Slots[5].Characters .= ", Third Alt"
    V7821Feed(100000),V7822Reset(101000),V7822Break(120000),V7821Take("Tank, interrupt.")
    V7824Kick(121000,"Third Alt","Tank next.")
    V48Assert(IZP.Next=1 && IZP.Early.Has("three"),"early alt spends its saved player's upcoming turn without jumping over others")
    V48Assert(IBMData().Rows[2].Value="Tank","overlay retains the correct next player")
    V7824Kick(123000,"Tank Toon","One next.")
    V7824Kick(125000,"One Toon","Two next.")
    V7824Kick(127000,"Two Toon","Four next.")
    V48Assert(!IZP.Early.Count,"early Third is skipped once, not removed from the roster")
    V7824Kick(129000,"Four Toon","Tank next.")
    V7824Kick(131000,"Tank Toon","One next.")
    V7824Kick(133000,"One Toon","Two next.")
    V7824Kick(135000,"Two Toon","Three next.")
    V48Assert(IZP.Next=4,"early player returns on the following cycle")
    V7824Kick(137000,"Main Toon","Three next.")
    V7824Kick(139000,"Unbound Toon","Three next.")
    V48Assert(!IZP.Early.Count && IZP.Next=4,"main tank and unbound cover kicks cannot invent a skip")

    V7822Break(145000),V7821Take("Tank, interrupt.")
    V7824Kick(146000,"One Toon","Tank next.")
    V7824Kick(148000,"Two Toon","Tank next.")
    V7821Feed(148150,"kick","Two Toon"),V7821Take()
    V48Assert(IZP.Early.Count=2,"duplicate successful-interrupt record cannot spend another turn")
    V7824Kick(150000,"Tank Toon","Three next.")
    V48Assert(!IZP.Early.Count,"consecutive early players are both skipped")
    V7824Kick(152000,"Tank Toon","Three next.")
    V48Assert(IZP.Early.Has("tank"),"player behind current position spends their next upcoming turn")
    V7824Kick(154000,"Three Toon","Four next.")
    V7824Kick(156000,"Four Toon","One next.")
    V48Assert(!IZP.Early.Count && IZP.Next=2,"skip is consumed across rotation wrap")
}
V7824EarlyLifetime() => V7822Fixture(V7824EarlyLifetimeCase)
V7824EarlyLifetimeCase()
{
    global IZP,IZPOptions,Audio
    V7821Feed(100000),V7822Reset(101000),V7822Break(120000),V7821Take("Tank, interrupt.")
    V7824Kick(121000,"Three Toon","Tank next.")
    V7822Break(130000),V7821Take("Tank, interrupt.")
    V48Assert(!IZP.Early.Count,"new shield break clears skipped turns as requested")
    V7824Kick(131000,"Tank Toon","One next.")
    V7824Kick(133000,"One Toon","Two next.")
    V7824Kick(135000,"Two Toon","Three next.")
    V7824Kick(137000,"Four Toon","Three next.")
    V7822Reset(140000),V7822Break(150000),V7821Take("One, interrupt.")
    V48Assert(!IZP.Early.Count,"cannon reset cannot carry a skip into a different section")
    V7824Kick(151000,"Three Toon","One next.")
    V7824Kick(153000,"Tank Toon","One next.")
    V7824Kick(155000,"One Toon","Two next.")
    V7824Kick(157000,"Two Toon","Four next.")
    V48Assert(IZP.Next=4 && !IZP.Early.Count,"DPS-only order skips the early DPS without adding off-tank")
    V7822Reset(160000),V7822Break(170000),V7821Take("Spam interrupts.")
    V7824Kick(171000,"Four Toon","")
    V48Assert(!IZP.Early.Count && !Audio.Queue.Length,"spam remains free of individual turn accounting")
    V7822Break(180000),V7821Take("Tank, interrupt.")
    V7821Feed(181000,"up"),V7824Kick(182000,"Three Toon","")
    V48Assert(!IZP.Early.Count,"shielded events cannot spend a scheduled turn")
    V7822Break(190000),V7821Take("Tank, interrupt.")
    V7821Feed(191000,"cast"),V7821Feed(191100,"quell","Three Toon"),V7821Take()
    V48Assert(!IZP.Early.Count && IZP.Next=1,"ability use alone is not evidence of a successful early interrupt")
    V7824Kick(193000,"Three Toon","",false)
    V48Assert(IZP.Early.Has("three") && !Audio.Queue.Length,"silent recovery remembers an early turn without old speech")
    IZPPreferenceChanged(),V48Assert(!IZP.Early.Count,"edited assignments retire old turn accounting")
    V7824Kick(195000,"Three Toon","Tank next.")
    IZPReset(),V48Assert(!IZP.Early.Count,"encounter reset cannot leak skips to the next pull")
}

V7824RosterFixture(fn) => V672LibraryFixture(V7824RosterInner.Bind(fn))
V7824RosterInner(fn)
{
    global Roster,NBCandle,NBOrder,testClock
    old := Roster
    try {
        testClock := 100000,NBCandle.At := 100000
        Roster := {Members:Map(),Snapshot:-1,LastFight:100000,ContextAt:100000}
        for i,name in ["Cîryndà","Bõõ","Ri'iwan","Z'aar","Hedgehøg","Longchíss","Sophie","Pika"]
            Roster.Members["@" name "#" i] := {RoleAt:100000,Snapshot:-1,Role:"DPS"}
        fn.Call()
    }
    finally NBRClose(),Roster := old
}
V7824NahutRoster() => V7824RosterFixture(V7824NahutRosterCase)
V7824NahutRosterCase()
{
    global NBCandleUI,NBToonBindings,NahutProfiles,NahutAssignments,Audio,SETTINGS_FILE,IP
    NahutAssignments["Tank1"] := "Tank nickname"
    NahutProfiles.Items["p1"].Assignments := NahutAssignments.Clone()
    NBROpen(),s := NBCandleUI.Arranger
    V48Assert(s.Pool.Length=8 && InStr(IGVJson(s.Pool),"Cîryndà"),"roster copies exact accented character names")
    V48Assert(!DllCall("IsWindowVisible","Ptr",s.Gui.Hwnd),"arranger stays hidden in native self-test")
    V48Assert(s.Roles.Count=8 && s.Draft["Tank1"]="","loading names does not assign roles or save")
    NBRFill(),filled := 0
    for slot,name in s.Draft {
        if name!=""
            filled += 1
    }
    V48Assert(filled=8 && ValidateNBBindings(s.Draft).Ok,"fill places all exact names once in a draft")
    s.Selected := "Cîryndà",NBRAssign("Tank1"),s.Selected := "Bõõ",NBRAssign("DoubleCloseDPS")
    V48Assert(NBCandleBindingMap()["Tank1"]="","draft fill never commits implicitly")
    s.Selected := "Cîryndà",NBRAssign("DoubleCloseDPS")
    V48Assert(s.Draft["Tank1"]="Bõõ" && s.Draft["DoubleCloseDPS"]="Cîryndà","selecting an occupied role swaps characters")
    V48Assert(NahutAssignedName("Tank1")="Tank nickname","Nahut spoken nickname remains separate from toon binding")
    NBRAssign("Tank1"),NBRAssign("DoubleCloseDPS")
    V48Assert(s.Draft["Tank1"]="Cîryndà","clicking assigned role cards swaps back")
    V48Assert(NBRSave(),"explicit Save persists Nahut arrangement")
    V48Assert(IniRead(SETTINGS_FILE,"NahutCandleBindings_p1","Tank1")="Cîryndà","accented binding survives native INI storage")
    NBRClose(),NBToonBindings.Delete("p1")
    V48Assert(NBCandleBindingMap()["Tank1"]="Cîryndà","Nahut binding reloads without re-entry")
    NBROpen(),s := NBCandleUI.Arranger
    s.Selected := "Bõõ",NBRAssign("Tank1"),NBRClose()
    V48Assert(NBCandleBindingMap()["Tank1"]="Cîryndà","closing unsaved arrangement leaves saved bindings unchanged")
    NBROpen(),s := NBCandleUI.Arranger,NahutProfiles.Active := "p2"
    V48Assert(!NBRSave() && InStr(s.Note.Text,"Team changed"),"team change cannot write the wrong profile")
    NahutProfiles.Active := "p1",NBCandleBindingMap()["Tank1"] := "Changed elsewhere"
    V48Assert(!NBRSave() && InStr(s.Note.Text,"another window"),"stale arrangement cannot overwrite newer bindings")
    V48Assert(!Audio.Queue.Length && !IP.Active,"arranging never starts audio or parsing")
}
V7824IzaxRoster() => V7824RosterFixture(V7824IzaxRosterCase)
V7824IzaxRosterCase()
{
    global NBCandleUI,IZPOptions,IZP,Audio,SETTINGS_FILE
    IZPOptions := IZPDefaults(),IZPOptions.Slots[2] := {Name:"Tank nickname",Characters:"Cîryndà, Older Alt"}
    NBROpen("Izax"),s := NBCandleUI.Arranger
    V48Assert(s.Draft["Slot2"]="Cîryndà" && s.Cards["Cîryndà"].Name="Tank nickname","Izax matches the current toon to its saved player")
    NBRFill(),V48Assert(s.Draft["Slot2"]="Cîryndà","fill keeps existing assignment")
    first := s.Draft["Slot1"],s.Selected := "Cîryndà",NBRAssign("Slot3")
    V48Assert(s.Draft["Slot3"]="Cîryndà","Izax player moves to clicked role")
    V48Assert(NBRSave(),"Izax arrangement saves")
    V48Assert(IZPOptions.Slots[3].Name="Tank nickname" && IZPOptions.Slots[3].Characters="Cîryndà, Older Alt","nickname and every saved alt travel with swapped player")
    V48Assert(IZPOptions.Slots[1].Name=first,"new player's exact character name supplies a default spoken name")
    NBRClose(),IZPOptions := IZPDefaults(),IZPLoadSettings()
    V48Assert(IZPOptions.Slots[3].Name="Tank nickname" && InStr(IZPOptions.Slots[3].Characters,"Older Alt"),"Izax bindings and nickname survive reload")
    NBROpen("Izax"),s := NBCandleUI.Arranger,s.Selected := "Cîryndà",NBRAssign("Slot4"),NBRClose()
    V48Assert(IZPOptions.Slots[3].Name="Tank nickname","unsaved Izax arrangement is discarded")
    NBROpen("Izax"),s := NBCandleUI.Arranger,IZPOptions.Slots[3].Characters .= ", New Alt"
    V48Assert(!NBRSave() && InStr(s.Note.Text,"another window"),"stale Izax screen cannot discard a newly added alt")
    V48Assert(!Audio.Queue.Length && !IZP.Active,"Izax setup never starts an encounter or audio")
}
V7824RosterGuards() => V7824RosterFixture(V7824RosterGuardsCase)
V7824RosterGuardsCase()
{
    global Roster,NBCandleUI,NBCandle,IZPOptions
    Roster.Members["@Cîryndà#99"] := {RoleAt:100000,Snapshot:-1,Role:"DPS"}
    names := NBRCurrentNames(),V48Assert(names.Length=7,"ambiguous duplicate character name is not auto-selected")
    Roster.Members := Map(),NBROpen(),s := NBCandleUI.Arranger
    V48Assert(!s.Pool.Length && InStr(s.Note.Text,"No current raid"),"empty roster tells user how to populate it")
    NBRAssign("Tank1"),NBRFill(),V48Assert(s.Draft["Tank1"]="","empty roster cannot fabricate an assignment")
    NBROpen("Izax"),V48Assert(NBCandleUI.Arranger.Mode="Nahut","opening another arranger cannot discard a draft")
    NBRClose(),IZPOptions := IZPDefaults(),IZPOptions.Slots[1] := {Name:"Offline",Characters:"Saved Alt"}
    NBROpen("Izax"),s := NBCandleUI.Arranger
    V48Assert(s.Pool.Length=1 && s.Draft["Slot1"]="Saved Alt","saved Izax players stay rearrangeable without a live roster")
}

; Private INI + sidecar, hidden native controls and fake audio queue only.
V7825Fixture(fn) => V7824RosterFixture(V7825Inner.Bind(fn))
V7825Inner(fn)
{
    global ITeam,ITeamUI,ITeamDemo,NahutAssignmentUI,IZPUI,IZPOptions
    old := {Team:ITeam,UI:ITeamUI,Demo:ITeamDemo,Assignments:NahutAssignmentUI},path := ITeamPath()
    try {
        ITeam := {Loaded:false,Enabled:false,Data:"",Original:"",Error:"",Revision:0}
        ITeamUI := {Gui:""},ITeamDemo := {Running:false},NahutAssignmentUI := {Gui:"",Visible:false}
        IZPOptions := IZPDefaults()
        fn.Call()
    }
    finally {
        ITeamDemoStop(),SetTimer(ITeamRefreshCheck,0)
        if IsObject(ITeamUI.Gui)
            ITeamUI.Gui.Destroy()
        if IsObject(IZPUI.Gui)
            IZPUI.Gui.Destroy(),IZPUI := {Gui:""}
        for f in [path,path ".bak",path ".lock"] {
            ILPTPrivatePath(f)
            if FileExist(f)
                FileDelete(f)
        }
        ITeam := old.Team,ITeamUI := old.UI,ITeamDemo := old.Demo,NahutAssignmentUI := old.Assignments
    }
}
V7825Data()
{
    d := ITeamNew(),n := ["Main","Tank","One","Two","Three","Four","Heal One","Heal Two"]
    c := ["Cîryndà","Bõõ","Ri'iwan","Z'aar","Hedgehøg","Longchíss","Sophie","Pika"]
    for i,name in n {
        id := ITeamAddPerson(d,name,c[i]),d.Teams["p1"].Izax["Slot" i] := id
        d.Teams["p1"].Nahut[NBRSlots("Nahut")[i].Key] := id
    }
    return d
}
V7825Throws(fn,description)
{
    threw := false
    try fn.Call()
    catch Error
        threw := true
    V48Assert(threw,description)
}
V7825Snapshot(value)
{
    if !IsObject(value)
        return value
    out := [Type(value)]
    if value is Array || value is Map {
        for key,item in value
            out.Push([key,V7825Snapshot(item)])
    }
    else {
        for key,item in value.OwnProps()
            out.Push([key,V7825Snapshot(item)])
    }
    return out
}
V7825Migration() => V7825Fixture(V7825MigrationCase)
V7825MigrationCase()
{
    global NahutProfiles,NahutAssignments,NBToonBindings,IZPOptions,ITeam,Audio
    NahutAssignments["Tank1"] := "Sophie",NahutProfiles.Items["p1"].Assignments := NahutAssignments.Clone()
    NBToonBindings["p1"]["Tank1"] := "Cîryndà"
    NahutProfiles.NextId := 2
    second := CreateNahutTeamProfile("Second"),NBToonBindings[second.Id] := NewNahutAssignments()
    IZPOptions.Slots[2] := {Name:"Sophie",Characters:"Cîryndà, Another Alt"}
    before := IGVJson(V7825Snapshot(IZPOptions.Slots))
    V48Assert(ITeamEnsure() && !ITeam.Enabled && !FileExist(ITeamPath()),"migration is a draft, with no file or live assignment changes")
    d := ITeam.Data,t := d.Teams["p1"],id := t.Nahut["Tank1"]
    V48Assert(d.Teams.Count=2 && d.People.Count=1 && t.Izax["Slot2"]=id,"same explicitly saved nickname and toon become one shared player")
    V48Assert(d.People[id].Characters.Length=2 && d.Teams[second.Id].Izax["Slot2"]=id,"legacy global Izax aliases survive in each imported team")
    V48Assert(before=IGVJson(V7825Snapshot(IZPOptions.Slots)) && !Audio.Queue.Length,"migration does not alter controller options or queue speech")
    other := ITeamImportPerson(d,"Sophie","Unknown Alt")
    V48Assert(other!=id,"matching nicknames alone never infer alt ownership")
    NahutProfiles.Items.Delete("p1"),NahutProfiles.Order := [second.Id],NahutProfiles.Active := "missing"
    d := ITeamImportLegacy()
    V48Assert(d.Active=second.Id && ITeamClone(d).Active=second.Id,"migration chooses an existing team when legacy active ID is invalid")
}
V7825Storage() => V7825Fixture(V7825StorageCase)
V7825StorageCase()
{
    global ITeam,IZPOptions,NahutProfiles,Audio,SETTINGS_FILE,IP
    d := V7825Data(),id := d.Teams["p1"].Izax["Slot2"]
    d.People[id].Characters.Push("Tänk's Alt")
    raw := ITeamEncode(d),round := ITeamDecode(raw)
    V48Assert(raw=ITeamEncode(round) && round.People[id].Characters[2]="Tänk's Alt","accented aliases round-trip exactly")
    V7825Throws(ITeamDecode.Bind(StrReplace(raw,'"IrisCalloutTeams",1','"IrisCalloutTeams",99')),"unknown schema is rejected")
    bad := ITeamClone(d),bad.Teams["p1"].Izax["Slot3"] := "u999"
    V7825Throws(ITeamClone.Bind(bad),"unknown role references are rejected")
    bad := ITeamClone(d),bad.Teams["p1"].Izax["Slot3"] := id
    V7825Throws(ITeamClone.Bind(bad),"one person cannot occupy two roles in one encounter")
    IniWrite("keep","" SETTINGS_FILE,"PrivateTest","Marker"),ini := FileRead(SETTINGS_FILE,"UTF-8")
    IZPOptions.Tethers := false,IZPOptions.Next := false
    saved := ITeamCommit(d,"")
    V48Assert(ITeam.Enabled && ITSReadText(ITeamPath())=saved,"explicit commit writes a verified sidecar")
    V48Assert(IZPOptions.Slots[2].Characters="Bõõ, Tänk's Alt" && !IZPOptions.Tethers && !IZPOptions.Next,"roster updates preserve mechanic switches")
    V48Assert(FileRead(SETTINGS_FILE,"UTF-8")=ini && !Audio.Queue.Length,"save preserves unrelated INI settings and never speaks")
    second := ITeamNewPreset(d,"Weekend","p1"),d.Active := second
    d.Teams[second].Izax["Slot2"] := "",saved2 := ITeamCommit(d,saved)
    V48Assert(ITSReadText(ITeamPath() ".bak")=saved && NahutProfiles.Active=second && IZPOptions.Slots[2].Name="","team switch changes both bosses and backs up prior data")
    ITeam := {Loaded:false,Enabled:false,Data:"",Original:"",Error:"",Revision:0}
    ITeamStartup()
    V48Assert(ITeam.Enabled && ITeam.Data.Active=second && ITeamEncode(ITeam.Data)=saved2,"restart reloads selected team and aliases")
    V7825Throws(ITeamCommit.Bind(d,saved),"stale editor cannot overwrite a newer save")
    V48Assert(ITSReadText(ITeamPath())=saved2,"failed concurrent save preserves newest file")
    IP.Active := true,IP.Live := {Finished:false,Halted:false,Current:{End:-1,Terminal:false}}
    V7825Throws(ITeamCommit.Bind(d,saved2),"active pull blocks team activation")
    IP.Active := false
    bad := ITeamClone(d),ITeamAddPerson(bad,"Duplicate","Bõõ")
    V7825Throws(ITeamCommit.Bind(bad,saved2),"duplicate alias ownership cannot be applied")
    V48Assert(ITSReadText(ITeamPath())=saved2,"invalid input never replaces saved teams")
    FileDelete(ITeamPath()),FileAppend("broken",ITeamPath(),"UTF-8-RAW")
    ITeam := {Loaded:false,Enabled:false,Data:"",Original:"",Error:"",Revision:0}
    ITeamStartup()
    V48Assert(!ITeam.Enabled && ITeam.Error!="" && ITSReadText(ITeamPath())="broken","corrupt sidecar is retained and legacy fallback remains available")
}
V7825Roles() => V7825Fixture(V7825RolesCase)
V7825RolesCase()
{
    d := V7825Data(),t := d.Teams["p1"],a := t.Izax["Slot2"],b := t.Izax["Slot3"]
    second := ITeamNewPreset(d,"Weekend","p1")
    ITeamBind(d,second,"Izax","Slot2",b)
    V48Assert(d.Teams[second].Izax["Slot3"]=a && t.Izax["Slot2"]=a,"occupied role swap is independent across team presets")
    V48Assert(ITeamClone(d).Teams[second].Nahut["Tank1"]=t.Nahut["Tank1"],"copy retains independent Nahut assignments")
    alt := ITeamAddPerson(d,"Imported Alt","Tänk's Alt")
    role := NBRSlots("Nahut")[2].Key,d.Teams[second].Nahut[role] := alt
    ITeamMerge(d,alt,a)
    V48Assert(!d.People.Has(alt) && d.People[a].Characters.Length=2 && d.Teams[second].Nahut[role]=a,"explicit combine retains aliases and rewrites existing role references")
    before := ITeamEncode(d)
    V7825Throws(ITeamMerge.Bind(d,a,b),"combining two assigned roles requires an explicit conflict resolution")
    V48Assert(before=ITeamEncode(d),"failed combine leaves every team unchanged")
    many := ""
    Loop 32
        many .= (many="" ? "" : ",") "Alt " A_Index
    d.People[a].Characters := ITeamNames(many)
    V48Assert(ITeamProjection(d).Izax[2].Characters=ITeamJoin(d.People[a].Characters),"all supported aliases reach Izax validation without a smaller legacy cap")
}
V7825Readiness() => V7825Fixture(V7825ReadinessCase)
V7825ReadinessCase()
{
    global ITeam,Roster,Audio
    d := V7825Data(),ready := ITeamReady(d,"p1",ITeamRosterNames()),count := 0
    for row in ready {
        if row.Status="Ready"
            count += 1
    }
    V48Assert(count=16,"full observed raid resolves all sixteen role bindings")
    id := d.Teams["p1"].Nahut["Tank1"],p := d.People[id]
    p.Characters.InsertAt(1,"Offline Alt"),ITeamCommit(d,"")
    V48Assert(ResolveNBCandleActor("Tank1",100000)="@Cîryndà#1","Nahut resolves observed alt rather than first saved character")
    Roster.Members["@Offline Alt#99"] := {RoleAt:100000,Snapshot:-1,Role:"DPS"}
    V48Assert(ResolveNBCandleActor("Tank1",100000)="","two current aliases are ambiguous and fail quietly")
    V48Assert(ITeamReady(d,"p1",ITeamRosterNames())[1].Status="Multiple characters seen","setup check explains alias ambiguity")
    Roster.Members := Map(),rows := ITeamReady(d,"p1",[])
    V48Assert(rows[1].Status="Not seen yet","unobserved player is distinct from missing assignment")
    p.Characters := [],V48Assert(ITeamReady(d,"p1",[])[1].Status="Missing character","nickname without binding is shown explicitly")
    d.Teams["p1"].Nahut["Tank1"] := ""
    V48Assert(ITeamReady(d,"p1",[])[1].Status="Missing player","empty role is shown explicitly")
    V48Assert(!Audio.Queue.Length,"readiness never plays warnings")
}
V7825Window() => V7825Fixture(V7825WindowCase)
V7825WindowCase()
{
    global ITeam,ITeamUI,Audio,IZPOptions
    ITeamEnsure(),ITeam.Data := V7825Data(),ITeamOpen(),u := ITeamUI
    V48Assert(!DllCall("IsWindowVisible","Ptr",u.Gui.Hwnd) && u.List.GetCount()=8,"native setup renders populated and stays hidden under test")
    V48Assert(!FileExist(ITeamPath()) && !Audio.Queue.Length,"opening setup does not save or preview audio")
    ITeamSelectPerson(u.List,2,true),u.Name.Value := "Pika nickname",ITeamPlayerEdited(),ITeamUpdatePerson()
    V48Assert(u.Data.People[u.Person].Name="Pika nickname" && !ITeam.Enabled,"editing a shared player changes draft only")
    u.RoleChoices["Izax"]["Slot3"].Choose(3),ITeamSelectRole("Izax","Slot3",u.RoleChoices["Izax"]["Slot3"])
    V48Assert(u.Data.Teams["p1"].Izax["Slot3"]="u2" && u.Data.Teams["p1"].Izax["Slot2"]="u3","native role dropdown swaps occupied assignments")
    V48Assert(ITeamSaveUI() && IZPOptions.Slots[3].Name="Pika nickname","explicit UI Save applies chosen team")
    V48Assert(ITeamReloadUI() && ITeamUI.Data.People["u2"].Name="Pika nickname","explicit reload uses saved roster without activating a different team")
    ITeamSelectPerson(u.List,2,true),u.Name.Value := "Saved directly",ITeamPlayerEdited()
    V48Assert(ITeamSaveUI() && ITeamUI.Data.People[u.Person].Name="Saved directly","Save and use team includes pending player fields")
    ITeamClose(),ITeamOpen("Setup check")
    V48Assert(ITeamUI.Tabs.Value=4 && ITeamUI.Check.GetCount()=16,"reopen reaches setup check and retains saved draft")
    ITeamPracticeBoss("Izax")
    V48Assert(u.Tabs.Value=5 && u.Scenario.Value=3 && u.Practice.GetCount()>10,"boss practice button selects full sequence")
    IZPOpen()
    global IZPUI
    V48Assert(!IZPUI.Rows[1].Name.Enabled && !IZPUI.SaveOrder.Enabled,"legacy interrupt settings cannot overwrite shared assignments")
    ITeamClose()
}
V7825Sequence() => V7825Fixture(V7825SequenceCase)
V7825SequenceCase()
{
    global audioOutputMode,IZP,NBOrder,NBCandle,Audio,IZPOptions
    d := V7825Data(),IZPOptions.Sections := true,before := IGVJson(V7825Snapshot([IZP,NBOrder,NBCandle]))
    rows := ITeamPracticeRows(d,"p1",3,audioOutputMode),breaks := [],spam := 0
    for row in rows {
        if row.Event="Shield breaks"
            breaks.Push(row.Phrase)
        if row.Phrase="Spam interrupts."
            spam += 1
    }
    V48Assert(IGVJson(breaks)=IGVJson(["Tank, interrupt.","One, interrupt.","Tank, interrupt."]) && spam=1,"P3 practice follows tank then DPS then spam and tank section")
    rows := ITeamPracticeRows(d,"p1",4,audioOutputMode),phrases := []
    for row in rows
        phrases.Push(row.Phrase)
    V48Assert(phrases[1]="Tank, interrupt." && phrases[2]="Tank next." && phrases[5]="Four next.","early DPS3 kick retains tank and earlier DPS turns, then skips DPS3")
    rows := ITeamPracticeRows(d,"p1",1,audioOutputMode),text := IGVJson(V7825Snapshot(rows))
    V48Assert(InStr(text,"Nahut P1") && InStr(text,"Nahut P2") && InStr(text,"Nahut P3") && InStr(text,"conditional return") && InStr(text,"Burn uses live"),"Nahut example covers phases and labels conditional choices")
    rows := ITeamPracticeRows(d,"p1",2,audioOutputMode)
    targetName := ITeamPracticeName(d,d.Teams["p1"],"Nahut","Tank2")
    V48Assert(InStr(rows[3].Phrase,"Incorrect") && InStr(rows[3].Phrase,targetName),"Nahut correction uses actual production phrase with saved target nickname")
    V48Assert(before=IGVJson(V7825Snapshot([IZP,NBOrder,NBCandle])) && !Audio.Queue.Length,"building examples never changes encounter state or queues speech")
    d.Teams["p1"].Izax["Slot2"] := ""
    V48Assert(ITeamPracticeRows(d,"p1",4,audioOutputMode)[1].Missing,"missing practice name yields a setup message rather than fabricated callout")
}
V7825Playback() => V7825Fixture(V7825PlaybackCase)
V7825PlaybackCase()
{
    global ITeam,ITeamUI,ITeamDemo,Audio,IP,testClock,soundboardsEnabled,audioOutputMode
    ITeamEnsure(),ITeam.Data := V7825Data(),ITeamOpen("Rehearsal"),ITeamUI.Scenario.Choose(4),ITeamBuildPractice()
    V48Assert(ITeamDemoStart() && Audio.Queue.Length=1,"only Play explicitly starts practice")
    V48Assert(Audio.Queue[1].Kind="Test" && Audio.Queue[1].Key="Preview|ITeam|1" && Audio.Queue[1].Phrase="Tank, interrupt.","rehearsal uses isolated preview queue with actual phrase")
    Audio.Queue := [],ITeamDemoTick(),V48Assert(PreviewAudioBusy() && Audio.Queue.Length=0,"preview remains busy during quiet gap")
    testClock += 700,ITeamDemoTick()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="Tank next.","next scripted event follows the audio completion gap")
    ITeamDemoStop(),V48Assert(!ITeamDemo.Running && !Audio.Queue.Length,"Stop removes pending sequence audio")
    soundboardsEnabled := false,V48Assert(!ITeamDemoStart() && !Audio.Queue.Length,"master mute blocks Play")
    soundboardsEnabled := true,RouteState().Fault := "test",V48Assert(!ITeamDemoStart(),"route fault blocks Play"),RouteState().Fault := ""
    IP.Active := true,IP.Live := {Finished:false,Halted:false,Current:{End:-1,Terminal:false}}
    V48Assert(!ITeamDemoStart(),"active pull blocks rehearsal")
    IP.Active := false,ITeamDemoStart(),IP.Active := true,ITeamDemoTick()
    V48Assert(!ITeamDemo.Running && !Audio.Queue.Length,"pull starting stops queued practice")
    IP.Active := false,ITeamDemoStart(),Audio.Queue := [],Audio.Epoch += 1
    foreign := {Kind:"Test",Key:"Preview|Other"},Audio.Queue.Push(foreign),ITeamDemoTick()
    V48Assert(!ITeamDemo.Running && Audio.Queue.Length=1 && ObjPtr(Audio.Queue[1])=ObjPtr(foreign),"foreign preview invalidates sequence without cancelling the other preview")
    Audio.Queue := [],ITeamDemoStart(),StopCalloutPreview()
    V48Assert(!ITeamDemo.Running && !Audio.Queue.Length,"global preview stop also stops future sequence items")
}

; Native hidden-UI and private-file regressions for consolidated navigation.
V7826SelectReviewPage(page)
{
    a := IAState()
    if a.Parent
        return IUCOpenReviewPage(page)
    a.Controls["Tabs"].Choose(page),IATabChanged()
}
V7826Views() => V692AnalysisFixture(V7826ViewsCase)
V7826ViewsCase(a,source,seg,path,text)
{
    global IP,Audio
    queue := Audio.Queue,live := IP.Live
    IUCOpenReviewPage(2)
    V48Assert(IPWState().Tab=2 && a.Tab=2,"Damage details have one main-tab home")
    IAOpenSelected()
    V48Assert(IPWState().Tab=2 && IsObject(a.Work),"Load fight stays on the requested detail page")
    IALoadPump(),IAQueryPump(),data := a.Data
    V48Assert(IsObject(data) && a.LoadTiming.Outcome="COMPLETE","real native fixture loads through shared loader")
    for item in [[2,2,"Damage"],[3,3,"Healing"],[5,4,"Tanking"],[7,6,"Log"],[6,10,"Rotation"]] {
        IUCOpenReviewPage(item[1])
        V48Assert(IPWState().Tab=item[2] && a.Tab=item[1],"detail route retains stable metric identity")
        V48Assert(a.Data=data && V58ChildVisible(a.Tables[item[3]]),"same verified dataset and requested detail table stay visible")
        V48Assert(!V58ChildVisible(IP.AbilitiesLV) && !V58ChildVisible(IPWState().Controls["Events"]),"quick tables do not paint over detailed review")
        IPWRepaintPage(),IAApplyPageVisibility()
        V48Assert(V58ChildVisible(a.Tables[item[3]]),"repaint preserves the selected detail table")
        IUCReviewModes()[item[2]] := false,IPWApplyTab()
        V48Assert(!IUCReviewActive(),"quick view restores without a new load")
    }
    V58SelectTab(8)
    V48Assert(IAEmbeddedTabs().Length=5,"Analysis contains only its unique review pages")
    for i,page in [1,4,8,9,10] {
        a.Controls["Tabs"].Choose(i),IATabChanged()
        V48Assert(a.Tab=page,"unique Analysis navigation maps to stable page IDs")
    }
    V48Assert(a.Data=data && IP.Live=live && Audio.Queue=queue && !IP.Active,"navigation preserves data and never starts audio or parsing")
    r := IPWRotationState()
    IAVRClose()
    if IPMUiHandle(r.Gui)
        r.Gui.Destroy()
    IP.RotationPage := ""
}
V7826Range() => V692AnalysisFixture(V7826RangeCase)
V7826RangeCase(a,source,seg,path,text)
{
    global IP
    d := V692AnalysisLoad(a)
    IUCOpenReviewPage(2),a.Controls["From"].Value := "3",a.Controls["To"].Value := "12",IAApplyRange(),IAQueryPump()
    q := a.Query,r := a.Result
    IUCOpenReviewPage(3),IUCOpenReviewPage(5),IUCOpenReviewPage(2)
    V48Assert(a.Data=d && a.Query=q && a.Result=r && q.From=d.Start+3000 && q.To=d.Start+12000,"cross-page review keeps the same time range and calculated results")
    V48Assert(IAVROpenFromAnalysis(),"visual rotation opens from a selected detailed range")
    view := IAVRState(),page := IPWRotationState()
    V48Assert(IPWState().Tab=10 && view.Embedded && view.OwnerHwnd=page.Gui.Hwnd,"visual rotation reuses the main Rotation page")
    V48Assert(view.Model.From=q.From && view.Model.To=q.To,"visual rotation preserves requested time range")
    ; A different review can be retained in Analysis. The activation selector must
    ; adopt the visible Rotation dataset, not silently show that older review.
    a.Data := "",IUCReviewModes()[10] := true,IPWApplyTab(),IAQueryPump()
    V48Assert(a.Data=d && a.Selected=view.Actor,"activation view adopts the same visual rotation dataset")
    V48Assert(a.Query.From=q.From && a.Query.To=q.To,"activation view preserves the visual time interval")
    a.Controls["From"].Value := "6",IAApplyRange(),IAQueryPump()
    IPWState().Controls["ReviewMode"].Choose(1),IUCReviewChanged(IPWState().Controls["ReviewMode"])
    V48Assert(view.Model.From=d.Start+6000,"returning to visual rotation keeps edits to the shared range")
    IAVRClose()
    if IPMUiHandle(page.Gui)
        page.Gui.Destroy()
    IP.RotationPage := ""
}
V7826Layout() => V692AnalysisFixture(V7826LayoutCase)
V7826LayoutCase(a,source,seg,path,text)
{
    global IP
    for size in [[980,650],[1220,780],[1920,1080]] {
        IPResize(IP.Gui,0,size[1],size[2])
        for page in [2,3,5,7,6] {
            IUCOpenReviewPage(page),u := IPWState(),box := IPWAnalysisRect(u.Layout)
            a.Gui.GetClientPos(,,&w,&h)
            V48Assert(w<=box.W+1 && h<=box.H+1,"detail child fits the selected host even at minimum size")
            a.Controls["Status"].GetPos(&x,&y,&cw,&ch)
            V48Assert(y+ch<=h+1,"loading / status text remains inside the detail page")
            V48Assert(!V58ChildVisible(a.Controls["Tabs"]),"duplicate page navigation is hidden on main metric pages")
            V48Assert(!InStr(IP.Status,"layout error") && !InStr(a.LastStatus,"layout:"),"resize completes without a layout error")
        }
    }
    r := IPWRotationState()
    IAVRClose()
    if IPMUiHandle(r.Gui)
        r.Gui.Destroy()
    IP.RotationPage := ""
}
V7826Directory() => V7825Fixture(V7826DirectoryCase)
V7826DirectoryCase()
{
    d := V7825Data(),old := IGVJson(IALTPack([{Id:"older-id",Name:"Tank",Members:[{Key:"@Other#200",Name:"Other"},{Key:"@Cîryndà#201",Name:"Cîryndà"}]}]))
    ITeamDirectoryPrepare(d,old)
    V48Assert(d.People.Count=9 && d.DirectoryVersion=2,"manual historical identity imports without guessing name ownership")
    roundtrip := ITeamClone(d),groups := ITeamDirectoryGroups(roundtrip)
    V48Assert(IALTKeys(IALTToken("older-id"),groups).Length=2,"recorded IDs and old person selection survive round trip")
    V48Assert(roundtrip.People["u1"].Characters[1]="Cîryndà" && roundtrip.People["u9"].Characters.Length=0,"identical name does not silently adopt another recording")
    ITeamMerge(roundtrip,"u9","u1"),groups := ITeamDirectoryGroups(ITeamClone(roundtrip))
    V48Assert(IALTKeys(IALTToken("older-id"),groups).Length=2 && roundtrip.People.Count=8,"explicit combine preserves old filter tokens and all IDs")
    V48Assert(IALTKeys(IALTToken("team-u1"),groups).Length=2,"callout player and historical player now share one directory entry")
    V7825Throws(ITeamDirectoryLink.Bind(roundtrip,"u2",[{Key:"@Other#200",Name:"Other"}]),"one recorded ID cannot be linked to two people")
    ITeamDirectoryLink(roundtrip,"u1",[{Key:"@Other#200",Name:"Other"}],true)
    V48Assert(IALTKeys(IALTToken("older-id"),ITeamDirectoryGroups(roundtrip)).Length=1,"unlink acts on exact ID without rewriting logs")
    before := ITeamEncode(roundtrip),bad := ITeamClone(roundtrip)
    bad.People["u2"].LinkIds := ["older-id"]
    V7825Throws(ITeamClone.Bind(bad),"duplicate stable identity rejected")
    V48Assert(ITeamEncode(roundtrip)=before,"failed validation leaves the source directory intact")
}
V7826DirectorySave() => V7825Fixture(V7826DirectorySaveCase)
V7826DirectorySaveCase()
{
    global ITeam
    state := IALTState(),prior := state.Clone(),path := IALTPath(),old := IGVJson(IALTPack([{Id:"original",Name:"Recorder",Members:[{Key:"@Alt#88",Name:"Alt"}]}]))
    V48Assert(!FileExist(path),"migration fixture does not overwrite a real links file")
    try {
        IALTSave(IALTParse(old),path,"")
        d := ITeamDirectoryPrepare(V7825Data(),old),saved := ITeamCommit(d,"")
        V48Assert(FileRead(path,"UTF-8")=old,"legacy links file remains byte-for-byte intact")
        decoded := ITeamDecode(ITSReadText(ITeamPath()))
        V48Assert(decoded.DirectoryVersion=2 && decoded.People.Count=9,"all players and historical links commit together")
        V48Assert(IALTKeys(IALTToken("original")).Length=1,"Progression reads linked IDs from the unified directory")
        stale := ITeamClone(decoded),stale.LegacyExpected := "changed elsewhere"
        V7825Throws(ITeamCommit.Bind(stale,saved),"stale migration snapshot cannot replace newer settings")
        V48Assert(ITSReadText(ITeamPath())=saved,"failed save leaves the saved roster unchanged")
    }
    finally {
        for name,value in prior.OwnProps()
            state.%name% := value
        for f in [path,path ".bak",path ".lock"]
            if FileExist(f)
                FileDelete(f)
    }
}
V7826DirectoryWindow() => V7825Fixture(V7826DirectoryWindowCase)
V7826DirectoryWindowCase()
{
    global ITeamUI,ITeam,Audio
    links := IALTState(),prior := links.Clone()
    try {
        links.Original := "",ITeamEnsure(),ITeam.Data := V7825Data(),queue := Audio.Queue
        ITeamOpen(),u := ITeamUI
        V48Assert(!u.RecordedLoaded,"opening team roles does not scan historical characters")
        ITeamShowPage("Recorded characters")
        V48Assert(u.Tabs.Text="Recorded characters" && u.RecordedIds.Length=8,"one player window exposes recorded links beside encounter roles")
        u.RecordedRows := [{Key:"@Archive#123",Name:"Archive"}],ITeamDirectoryRender(),u.Recorded.Modify(1,"Check"),ITeamDirectoryAction(false)
        V48Assert(u.Data.People[u.RecordedPerson].Members.Length=1 && u.Dirty,"link edits are visible drafts until Save")
        ITeamDirectoryEdit()
        V48Assert(u.Tabs.Text="Players" && u.Person=u.RecordedPerson,"recorded identity and nickname share the same editor")
        V48Assert(!DllCall("IsWindowVisible","Ptr",u.Gui.Hwnd) && Audio.Queue=queue,"hidden directory navigation stays silent")
    }
    finally {
        for name,value in prior.OwnProps()
            links.%name% := value
    }
}
V7826SettingsUI() => V7825Fixture(V7826SettingsUICase)
V7826SettingsUICase()
{
    global NBCandleUI,NBOrderUI,NBRebounderUI,IZPUI,Audio
    old := {Candle:NBCandleUI,Order:NBOrderUI,Rebounder:NBRebounderUI},queue := Audio.Queue
    try {
        NBCandleUI := {Gui:"",Visible:false}
        NBOrderUI := {Gui:"",Visible:false},NBRebounderUI := {Gui:"",Visible:false}
        OpenNBCandleControls(),OpenNBOrderControls(),OpenNBRebounderControls(),IZPOpen()
        for row in IZPUI.Rows
            V48Assert(!V58ChildVisible(row.Name) && !V58ChildVisible(row.Characters),"Izax has no second editable player grid")
        for key,c in NBCandleUI.Bindings
            V48Assert(!V58ChildVisible(c),"Nahut has no second editable player grid")
        count := 0
        for c in NBOrderUI.Gui
            if c.Type="Button" && c.Text="Players and roles..."
                count += 1
        V48Assert(count=1,"Nahut order has exactly one player setup button")
        for g in [NBCandleUI.Gui,NBOrderUI.Gui,NBRebounderUI.Gui,IZPUI.Gui]
            V48Assert(!DllCall("IsWindowVisible","Ptr",g.Hwnd),"settings regression never displays a desktop window")
        V48Assert(Audio.Queue=queue,"opening settings never triggers preview audio")
    }
    finally {
        for state in [NBCandleUI,NBOrderUI,NBRebounderUI]
            if IPMGuiAlive(state.Gui)
                state.Gui.Destroy()
        NBCandleUI := old.Candle,NBOrderUI := old.Order,NBRebounderUI := old.Rebounder
    }
}

V7826Sources() => V769Run(V7826SourcesCase)
V7826SourcesCase(f)
{
    snapshot := ILPTRead(f.Path),rows := ILPTRows(Map(),snapshot.History)
    V48Assert(rows.Length>0 && rows[1].Ready && rows[1].HistoryOnly,"Progression-only recordings remain assignable without loading their original file")
    s := ILPTBuild(f.Path),id := s.Rows[1].Id
    s.Controls["Search"].Value := "no match",ILPTFilter(),ILPTPreselect([id])
    selected := ILPTSelected()
    V48Assert(selected.Length=1 && selected[1].Id=id,"source-manager selection carries into the shared team picker")
    s.Controls["Search"].Value := "no match",ILPTFilter()
    ILPTPreselect([id,id])
    V48Assert(ILPTSelected().Length=1,"repeated selection does not duplicate an assignment")
}

; Native diagnostics only: synthetic log records and the fake audio queue.
V7827Opening()
{
    global NBOrder,NBCandle,Audio
    for phase,slot in ["Tank1","Healer1","DoubleFarDPS"] {
        V48Setup(phase),PollNBOrder()
        V48Assert(V48Chosen()=slot && !NBOrder.Turns[1].Done,"quiet phase opener stays in the turn ledger")
        V48Assert(!Audio.Queue.Length && NBOrder.Delivery.Attempts=0,"no candle-next audio for P" phase)
        V48Time(102100),PollNBOrder()
        V48Assert(!Audio.Queue.Length && NBOrder.Delivery.Attempts=0,"silent reminder is never retried")
        V48Pass(slot,102200),PollNBOrder()
        V48Assert(NBCandle.Holder=V48Actor(slot) && !Audio.Queue.Length,"correct opening holder remains quiet")
    }
}
V7827Passes()
{
    global NBOrder,NBCandle,Audio
    V48Setup(),V48Pass("Tank1",100100),V48Use("Tank1",100700),PollNBOrder()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="Tank1, pass to Tank2.","P1 reveal still gives actual pass instruction")
    V48Assert(NBOrderAudioItemEnabled(Audio.Queue[1]),"actual pass remains eligible at playback")
    V48Setup(2),V48Pass("Healer1",100100),PollNBOrder()
    V48Assert(!Audio.Queue.Length,"H1 entering P2 has no hold reminder")
    V48Lock("Healer1",100700),PollNBOrder()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="Healer1, pass to Healer2.","snipe lock still releases H1 pass")
    V48Setup(2),V48DoneThrough(5),NBCandle.Holder := V48Actor("DoubleCloseDPS"),PollNBOrder()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="DoubleCloseDPS, pass to DoubleFarDPS.","Close still passes to Far for final hold")
    V48Pass("DoubleFarDPS",100100),V48Lock("DoubleFarDPS",100700),PollNBOrder()
    V48Assert(!Audio.Queue.Length && NBOrder.Phase=2 && !NBOrder.Turns[6].Done,"Far final snipe does not trigger a hold reminder or finish reveal")
    V48Time(170000),PollNBOrder()
    V48Assert(!Audio.Queue.Length && NBOrder.TerminalArmed,"long terminal hold remains quiet and tracked")
    V48Use("DoubleFarDPS",170700),PollNBOrder()
    V48Assert(NBOrder.Phase=3 && NBOrder.Turns[1].Done,"Far reveal still starts P3 and credits the opener once")
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="DoubleFarDPS, pass to Healer1.","P3 handoff to H1 is retained")
}
V7827Recovery()
{
    global NBOrder,NBCandle,Audio
    for phase in [1,2,3] {
        V48Setup(phase),V48Pass("Tank2",100100),PollNBOrder()
        V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].NOData.Correction,"wrong opening recipient still gets a correction in P" phase)
        V48Assert(NBOrderAudioItemEnabled(Audio.Queue[1]),"correction survives playback policy")
    }
    V48Setup(),NBOrderMarkRecovery("synthetic lost-holder recovery"),PollNBOrder()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].NOData.Kind="Next" && Audio.Queue[1].NOData.Correction,"unknown-holder recovery can still name the recipient")
    V48Assert(NBOrderAudioItemEnabled(Audio.Queue[1]),"recovery recipient instruction remains valid")
}
V7827PlaybackPolicy()
{
    global NBOrder,NBOrderOptions,Audio
    V48Setup(),PollNBOrder()
    want := NBOrderDesired(NBOrderReconcile(100000),100000)
    want.Ticket := NBOrder.Ticket,want.Owner := NBOrder.Owner,want.Phase := NBOrder.Phase
    want.Config := NBOrder.Config,want.Receipt := NBOrder.Receipt
    item := {NOData:want}
    V48Assert(!NBOrderAudioItemEnabled(item),"a previously queued ordinary Next is rejected at playback too")
    NBOrderMarkRecovery("synthetic missing holder"),want.Correction := true
    V48Assert(NBOrderAudioItemEnabled(item),"the same recipient remains usable for actual recovery")
    NBOrderOptions.Corrections := false
    V48Assert(!NBOrderAudioItemEnabled(item),"recovery still honors its own mute")
    NBOrderOptions.Corrections := true,NBOrderOptions.Enabled := false
    V48Assert(!NBOrderAudioItemEnabled(item) && !Audio.Queue.Length,"controller mute remains authoritative")
}
V7827Practice() => V7825Fixture(V7827PracticeCase)
V7827PracticeCase()
{
    global audioOutputMode,NBCandle,NBOrder,Audio
    d := V7825Data(),before := IGVJson(V7825Snapshot([NBCandle,NBOrder]))
    rows := ITeamPracticeRows(d,"p1",1,audioOutputMode),starts := 0,passes := 0
    for i,row in rows {
        if RegExMatch(row.Event,"^Nahut P[123] example$") {
            starts += 1
            V48Assert(rows[i+1].Phrase="" && rows[i+1].SoundId="","phase-start context has neither TTS nor recording")
        }
        V48Assert(!InStr(row.Phrase,"candle next"),"ordinary rehearsal has no candle-next reminders")
        if InStr(row.Phrase,"pass to")
            passes += 1
    }
    V48Assert(starts=3 && passes>15,"all three phases and actual passes remain in rehearsal")
    rows := ITeamPracticeRows(d,"p1",2,audioOutputMode)
    V48Assert(rows[1].Phrase="" && rows[1].SoundId="","wrong-pass example also starts silently")
    V48Assert(InStr(rows[2].Phrase,"pass to") && InStr(rows[3].Phrase,"Incorrect pass"),"expected pass and correction still play")
    V48Assert(before=IGVJson(V7825Snapshot([NBCandle,NBOrder])) && !Audio.Queue.Length,"building rehearsal leaves live controller and audio untouched")
}

; Private native controls only. No live UI, settings, audio or gameplay input.
V7828OwnVisible(c) => !!(DllCall("GetWindowLongW","Ptr",c.Hwnd,"Int",-16,"UInt") & 0x10000000)
V7828DropdownState()
{
    g := Gui(),c := g.AddDropDownList("w260",["All characters","Old name"])
    try {
        c.Choose(2),keys := [],labels := ["All characters"]
        Loop 2400
            keys.Push("@Character#" A_Index),labels.Push("Zoë " A_Index)
        before := V7828OwnVisible(c)
        ILBOptions(c,labels,keys,["@Character#2000"])
        V48Assert(V7828OwnVisible(c)=before,"hidden parent does not hide a previously visible child")
        V48Assert(SendMessage(0x146,0,0,c)=2401,"all dropdown entries remain present")
        V48Assert(c.Value=2001 && c.Text="Zoë 2000","selection follows stable character key, not old row number")
        c.Visible := false,ILBOptions(c,labels,keys,keys)
        V48Assert(!V7828OwnVisible(c) && c.Value=2001,"an explicitly hidden dropdown stays hidden and selected")
        c.Visible := true,ILBOptions(c,["All characters","Other"],["@Other#1"],keys)
        V48Assert(V7828OwnVisible(c) && c.Value=1,"removed selection falls back to first option")
        V59ExpectError((*)=>ILBOptions(c,"not an array",[],[]))
        V48Assert(V7828OwnVisible(c) && !DllCall("GetPropW","Ptr",c.Hwnd,"Str","SysSetRedraw","Ptr"),"failed update restores drawing and visibility")
    }
    finally g.Destroy()
}
V7828HiddenLibrary() => V75LibraryRun(V7828HiddenLibraryCase)
V7828HiddenLibraryCase()
{
    s := ILBState(),s.Files := V75LibraryFiles(),s.Loaded := true
    ILBBuildWindow(),c := s.Controls,before := Map()
    for key in ["Boss","Character","TrendBoss","TrendCharacter","TrendSpec"]
        before[key] := V7828OwnVisible(c[key])
    ILBBrowseSync(true)
    for key,visible in before
        V48Assert(V7828OwnVisible(c[key])=visible,"first hidden Library build preserves " key " visibility")
    V48Assert(s.Rows.Length=5 && c["Character"].Value=1,"all first-open rows and default selection retained")
    c["Tabs"].Choose(3),ILBPageChanged(),before.Clear()
    for key in ["Boss","Character","TrendBoss","TrendCharacter","TrendSpec"]
        before[key] := V7828OwnVisible(c[key])
    ILBBrowseSync(true)
    for key,visible in before
        V48Assert(V7828OwnVisible(c[key])=visible,"refresh on Performance preserves " key " visibility")
    V48Assert(!DllCall("IsWindowVisible","Ptr",s.Gui.Hwnd,"Int"),"refresh never shows the hidden Library window")
}
V7828RefreshChoices() => V75LibraryRun(V7828RefreshChoicesCase)
V7828RefreshChoicesCase()
{
    s := ILBState(),s.Files := V75LibraryFiles(),s.Loaded := true
    ILBBuildWindow(),ILBRefresh(),c := s.Controls
    c["Character"].Choose(2),c["TrendCharacter"].Choose(2),c["Boss"].Choose(2),c["TrendBoss"].Choose(2)
    f := s.Files[StrLower(A_Temp "\combat_2026-10-03_00_00_00_001.txt")]
    for p in f.Pulls
        p.Players["@New#2"] := {Name:"À New",Spec:"123",Damage:1,Heal:0,Effective:0,HealKnown:0,HealRecords:0,Deaths:0}
    ILBBrowseSync(true),ILBFilterChanged()
    V48Assert(ILBChoice(c["Character"],s.Characters)="@Sophie#1" && ILBChoice(c["TrendCharacter"],s.Characters)="@Sophie#1","both pages retain their character after option order changes")
    V48Assert(ILBChoice(c["Boss"],s.Bosses)="G-TY" && ILBChoice(c["TrendBoss"],s.Bosses)="G-TY","boss selections survive refresh")
    V48Assert(s.Shown.Length=5 && c["List"].GetCount()=5,"active filters and displayed rows survive refresh")
}

; Actual native menus on a private desktop. Never dispatch demo, speech or import actions.
V7829HelpMenus() => V658MenuFixture(V7829HelpMenusCase)
V7829HelpItem(menu,label)
{
    Loop DllCall("User32\GetMenuItemCount","Ptr",menu.Handle,"Int") {
        item := IUMReadItem(menu.Handle,A_Index-1)
        if item.Text=label
            return item
    }
    throw Error("Missing Help action: " label)
}
V7829HelpMenusCase(f)
{
    global IP,IC,IIF,IPAS,Audio,SELF_TEST
    oldIP := IP,oldIC := IC,oldIIF := IIF,oldStart := IPAS
    g := Gui("+ToolWindow"),queue := Audio.Queue
    try {
        V48Assert(SELF_TEST,"Help checks require the isolated diagnostic harness")
        IP := IPNewApp(),IC := ICNewState(),IIF := IIFNewState(),IPAS := IPASNewState()
        before := {Live:IP.Live,Offline:IP.Offline,Queue:IP.Queue}
        IPWAttachMenus(g),u := IPWState()
        f.OtherBar.Add("Shared Help",u.HelpMenu),IUMApply(g),IUMApply(f.Other)
        root := V658MenuSnapshot(u.HelpMenu.Handle)
        V48Assert(V7829HelpItem(u.HelpMenu,"Demos").Submenu=u.HelpDemosMenu.Handle,"workspace retains the actionable nested demo menu")
        V48Assert(V7829HelpItem(f.OtherBar,"Shared Help").Submenu=u.HelpMenu.Handle,"second host shares the same Help tree, as the tray does")
        for busy in [true,false,true,false] {
            IPWMenuState(!busy,busy,true)
            for name in ["Parser overview","Session deaths"] {
                item := V7829HelpItem(u.HelpDemosMenu,name)
                V48Assert(!!(item.State & 3)=busy,"demo lock follows live/import state inside submenu: " name)
            }
            V48Assert(!!(V7829HelpItem(u.SettingsMenu,"Parser options...").State & 3)=busy,"parser settings lock is preserved")
            V48Assert(!(V7829HelpItem(u.FileMenu,"&Open log...`tCtrl+O").State & 3),"opening a saved log remains independently permitted")
            for name in ["Getting started...","Guides","Demos","Troubleshooting...","Ability icons and credits..."]
                V48Assert(!(V7829HelpItem(u.HelpMenu,name).State & 3),"help remains available during live parsing: " name)
        }
        IUMRestore()
        V48Assert(V658MenuSame(root,V658MenuSnapshot(u.HelpMenu.Handle),true,true),"nested action identities survive styling and state changes")
        V48Assert(IP.Live=before.Live && IP.Offline=before.Offline && IP.Queue=before.Queue && Audio.Queue=queue && !IP.Active,"building and updating Help never replaces data or starts parsing or audio")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",g.Hwnd,"Int"),"Help checks never show the app")
    }
    finally {
        IUMRestore(),g.Destroy(),IP := oldIP,IC := oldIC,IIF := oldIIF,IPAS := oldStart
    }
}

V7830LibraryBrowse()
{
    tab := "`t",header := "C:\Sophië\log.txt" tab "20261008" tab "123" tab "20261008120000" tab "digest" tab "78.29" tab tab "0"
    person := "@Sophië" tab "Sophië 🐇" tab "spec" tab "9007199254740993" tab "20.0" tab "19.5" tab "2" tab "2" tab "1"
    challenge := "burn" tab "Burn" tab "15.0" tab "0" tab "1`n@Sophië" tab "123.25" tab "20" tab "19.5" tab "2" tab "2"
    pull := "1" tab "G-SC" tab "Scyva" tab "area" tab "mode" tab "100.0" tab "200" tab "Incomplete" tab "1" tab "@Sophië"
    root := ["IrisLibraryBrowse",1,[[header,[[pull,[person],[challenge]]]]]]
    files := INLibraryBrowseMaterialize(root),f := files[StrLower("C:\Sophië\log.txt")],p := f.Pulls[1]
    V48Assert(p.GetOwnPropDesc("Challenges").HasOwnProp("Get"),"browse leaves unrequested challenge metrics compact")
    V48Assert(p.Players["@Sophië"].Name="Sophië 🐇" && p.Players["@Sophië"].Damage=9007199254740993,"Unicode and large exact integer totals survive compact cells")
    V48Assert(Type(p.Players["@Sophië"].Heal)="Float" && Type(p.Start)="Float" && p.Result="No kill","numeric types and old outcome normalization are retained")
    rows := ILBRows(files),filtered := ILBFilter(rows,"G-SC","mode","","No kill",0,"","Sophië")
    V48Assert(filtered.Length=1 && p.GetOwnPropDesc("Challenges").HasOwnProp("Get"),"normal Library search does not expand challenge metrics")
    clone := p.Clone(),a := p.Challenges
    V48Assert(p.GetOwnPropDesc("Challenges").HasOwnProp("Value") && clone.GetOwnPropDesc("Challenges").HasOwnProp("Get"),"lazy reads publish atomically on the receiving object only")
    V48Assert(p.Challenges=a && a[1].Verified=1 && a[1].Players["@Sophië"].Damage=123.25,"expanded challenge values and repeat-read identity are preserved")
    V48Assert(Type(a[1].Duration)="Float" && clone.Challenges[1].Name="Burn","lazy copy expands independently with exact duration type")
    packed := ILBPack(files)
    V48Assert(packed[3][1][7][1][12][1][5][1][2]=123.25,"normal persistence includes all deferred totals")
    V64Reject((*)=>INLibraryBrowseMaterialize(["wrong",1,[]]),"wrong compact schema rejected")
    V64Reject((*)=>INLibraryBrowseCells("one`tfield",3),"malformed compact row rejected")
    root[3].Push(root[3][1])
    V64Reject((*)=>INLibraryBrowseMaterialize(root),"duplicate case-normalized paths rejected")
    V64Reject((*)=>INLibraryBrowseMaterialize(["IrisLibraryBrowse",1,[[header,[]]]],V773CheckpointStop),"compact materialization propagates cancellation")
}


V7831RunTrace()
{
    s := IFDState(),root := A_Temp "\IrisTraceTest_" DllCall("GetCurrentProcessId","UInt") "_" A_TickCount
    V48Assert(!s.View && !DirExist(root),"trace test starts with private unused storage")
    V48Assert(!IFDStart() && !s.View && IFDEnter(1)=0,"normal tests and workers do not record diagnostics")
    DirCreate(root)
    try {
        V48Assert(IFDStart(root),"private file mapping opens")
        path := s.Path
        for prior in [0,7,100,-1] {
            saved := Critical(prior),before := A_IsCritical
            token := IFDEnter(1),IFDLeave(token,1)
            V48Assert(A_IsCritical=before,"trace preserves interrupted thread scheduling")
            Critical(saved)
        }
        parent := IFDEnter(3),child := IFDEnter(7),IFDLeave(child,7)
        data := IFDRead(path)
        V48Assert(data.Pending.Count=1 && data.Pending.Has(parent) && data.Pending[parent].Operation=3,"nested stages retain only unfinished parent")
        V48Assert(data.Version="0.78.112" && data.NormalExit=0 && data.Rows.Length=11,"trace header and exact event count")
        V48Assert(IFDEnter(999)=0 && s.Seq=11,"invalid stage cannot corrupt ring")
        IFDLeave(parent,3),data := IFDRead(path)
        V48Assert(!data.Pending.Count,"completed stage pairs match by token")
        loop 4200 {
            token := IFDEnter(4),IFDLeave(token,4)
        }
        data := IFDRead(path)
        V48Assert(data.Rows.Length=8192 && !data.Pending.Count && FileGetSize(path)=262272,"ring is bounded after wraparound")
        V48Assert(data.Rows[1].Seq=data.Last-8191 && data.Rows[-1].Seq=data.Last,"wrapped events preserve sequence order")
        text := IFDReport(root)
        V48Assert(InStr(text,"IPRefresh") && !InStr(text,root) && !InStr(text,"@"),"copy report contains code stages without paths or player data")
        IFDStop(),data := IFDRead(path)
        V48Assert(!s.View && !s.Mapping && data.NormalExit=1,"normal shutdown releases handles and marks completed run")
        IFDStop(),V48Assert(IFDEnter(1)=0,"repeated shutdown is harmless")
        bad := root "\bad.bin",FileAppend("bad",bad)
        V64Reject((*)=>IFDRead(bad),"short or unrelated file cannot be decoded")
        blocker := root "\not-a-directory",FileAppend("blocker",blocker)
        V48Assert(!IFDStart(blocker) && !s.View,"unwritable trace location cannot prevent Iris running")
        loop 10 {
            old := root "\iris-run-20200101000000-" A_Index "-1.bin"
            FileCopy(path,old)
        }
        unrelated := root "\iris-run-20200101000000-0-1.bin",FileAppend("unrelated",unrelated)
        IFDPrune(root),files := IFDPaths(root)
        V48Assert(files.Length=9 && FileExist(unrelated),"retention keeps eight valid traces and never deletes unrelated data")
        V48Assert(IFDStart(root),"recorder can reopen after clean stop")
        V7431SubclassReentrancy()
        V786ResumePaint()
        V48Assert(s.View!=0,"real native paint regressions passed with tracing enabled")
        IFDStop()
    }
    finally {
        IFDStop()
        ; Exact newly-created fixture root, checked before any recursive cleanup.
        if InStr(root,A_Temp "\IrisTraceTest_")=1
            DirDelete(root,true)
    }
}

; The outer native caller is still active after the production core returns.
; Existing lower-subclass checks alone cannot observe this return boundary.
V7831ReturnState()
{
    static s := {Depth:0,Nested:0,After:0}
    return s
}
V7831ReturnFence(h,msg,w,l,id,ref)
{
    prior := Critical(-1),s := V7831ReturnState()
    try {
        if msg=0xF && s.Depth
            s.Nested += 1
        if msg!=0x8731
            return DllCall("Comctl32\DefSubclassProc","Ptr",h,"UInt",msg,"UPtr",w,"Ptr",l,"Ptr")
        s.Depth += 1
        try {
            result := DllCall("Comctl32\DefSubclassProc","Ptr",h,"UInt",msg,"UPtr",w,"Ptr",l,"Ptr")
            s.After := A_IsCritical
            return result
        }
        finally s.Depth -= 1
    }
    finally Critical(prior)
}
V7831CallbackReturn()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"callback return checks require an isolated child")
    lower := CallbackCreate(V7431SubclassDelay,"Fast",6),upper := CallbackCreate(V7831ReturnFence,"Fast",6)
    prior := A_IsCritical
    try {
        for kind in ["tab-icons","list-icons","table-style","dropdown-style","callout-checks"] {
            g := Gui("-DPIScale"),h := 0
            try {
                if kind="tab-icons"
                    c := g.AddTab3("w400 h120",["One","Two"])
                else if kind="dropdown-style"
                    c := g.AddDropDownList("w250 Choose1",["One","Two"])
                else
                    c := g.AddListView("w400 h120" (kind="callout-checks" ? " Checked" : ""),["Name","Damage"]),c.Add(,"Sample",100)
                h := c.Hwnd
                V48Assert(DllCall("Comctl32\SetWindowSubclass","Ptr",h,"Ptr",lower,"UPtr",78310,"UPtr",0,"Int"),"lower native probe attaches")
                switch kind {
                    case "tab-icons": ok := IPWTIconsAttach(c,[1,2])
                    case "list-icons": ok := IAIListAttach(c)
                    case "table-style": ok := ITBAttach(c)
                    case "dropdown-style": ok := IUDStyleAttach(c)
                    case "callout-checks": ok := IDPCheckAttach(c)
                }
                V48Assert(ok,"production drawing callback attaches")
                V48Assert(DllCall("Comctl32\SetWindowSubclass","Ptr",h,"Ptr",upper,"UPtr",78311,"UPtr",0,"Int"),"outer native caller attaches")
                g.Show("Hide w440 h180")
                for caller in [0,7,100,0xFFFFFFFF] {
                    Critical("Off"),Sleep(-1),s := V7831ReturnState(),s.Nested := 0
                    Critical(caller)
                    result := SendMessage(0x8731,1,0,h),restored := A_IsCritical
                    Critical("Off"),Sleep(-1)
                    V48Assert(result=0x7431 && s.After=0xFFFFFFFF,kind ": callback returns into the guarded native caller")
                    V48Assert(restored=caller,kind ": dispatcher restores the caller's scheduling state")
                    V48Assert(s.Nested=0 && !s.Depth,kind ": no queued paint inside the unfinished native return")
                }
            }
            finally {
                Critical("Off")
                if h {
                    DllCall("Comctl32\RemoveWindowSubclass","Ptr",h,"Ptr",upper,"UPtr",78311,"Int")
                    DllCall("Comctl32\RemoveWindowSubclass","Ptr",h,"Ptr",lower,"UPtr",78310,"Int")
                }
                g.Destroy()
            }
        }
    }
    finally {
        CallbackFree(upper),CallbackFree(lower),Critical(prior)
    }
}

V7831CallbackExceptions() => V58Isolated(V7831CallbackExceptionsCase)

V7831CallbackExceptionsCase()
{
    global IUB
    g := Gui(),g.SetFont("s10","Segoe UI"),ddl := g.AddDropDownList("w220",["First","Second"])
    lv := g.AddListView("w220 h90",["Name","Total"]),lv.Add(,"Sample",123)
    tabs := g.AddTab2("w250 h100",["First","Second"])
    canvas := ISRICanvas(320,240)
    try {
        V48Assert(IUDStyleAttach(ddl) && ITBAttach(lv) && IAIListAttach(lv),"private native controls attach")
        Loop 100 {
            marker := "IRIS_SENTINEL_" A_Index,seen := false
            try {
                try throw Error("original exception",,marker)
                finally {
                    SendMessage(0x317,canvas.DC,0x1C,ddl.Hwnd)
                    SendMessage(0x317,canvas.DC,0x1C,lv.Hwnd)
                }
            }
            catch Error as err {
                seen := true
                V48Assert(err.Extra=marker,"native repaint preserves the exception being unwound")
            }
            V48Assert(seen,"original error reaches its handler")
        }
        theme := IUB.Theme,tint := IUB.DropdownTint,IUB.Theme := "iris",IUB.DropdownTint := true
        entry := IUDStyleState().Controls[ddl.Hwnd],entry.Control := {Hwnd:ddl.Hwnd}
        try {
            Loop 5 {
                entry.Failed := false,seen := false
                try {
                    try throw Error("original exception",,"IRIS_CALLBACK_SENTINEL")
                    finally SendMessage(0x317,canvas.DC,0x1C,ddl.Hwnd)
                }
                catch Error as err {
                    seen := true
                    V48Assert(err.Extra="IRIS_CALLBACK_SENTINEL","caught paint failure cannot replace the caller's error")
                }
                V48Assert(seen,"outer error survives a contained callback error")
            }
        }
        finally entry.Control := ddl,IUB.Theme := theme,IUB.DropdownTint := tint
    }
    finally {
        g.Destroy(),ISRICanvasClose(canvas)
    }
}

V7832Fixture(variant := "sparse")
{
    boss := "The Ultimate Hunter {4381150109761536}:123|(1,2,3,0)|(10/1000)"
    player := "@Recorder#1|(1,2,3,0)|(500/1000)"
    peer := "@Peer#2|(1,2,3,0)|(500/1000)"
    lines := ["[00:00:00.000] [" player "] [] [] [AreaEntered {836045448953664}: Dxun {833571547775792} 8 Player Master {836045448953655}]",
        V7832Line(100,player,"=","99","836045448945472","836045448945489"),
        V7832Line(1000,player,boss,"99","836045448945477","836045448945501","(100 kinetic {836045448940873}) <100.0>"),
        V7832Line(1100,peer,boss,"99","836045448945477","836045448945501","(75 kinetic {836045448940873}) <75.0>"),
        V7832Line(1200,"@Healer#3|(1,2,3,0)|(500/1000)",player,"99","836045448945477","836045448945500","(40 ~40) <0.0>"),
        V7832Line(4000,boss,"=","4381085685252096","836045448945472","836045448945479"),
        V7832Line(6000,boss,"=","4381085685252096","836045448945477","4381085685252434"),
        V7832Line(7000,peer,boss,"99","836045448945477","836045448945501","(25 kinetic {836045448940873}) <25.0>"),
        V7832Line(9000,boss,"=","4381085685252096","836045448945478","4381085685252434"),
        V7832Line(9300,player,"=","810670782152704","836045448945477","810670782152704"),
        V7832Line(11501,peer,"=","123","836045448945477","123")]
    if variant="dead recorder"
        lines.InsertAt(9,V7832Line(8999,boss,StrReplace(player,"500/1000","0/1000"),"99","836045448945472","836045448945493")),lines[11] := StrReplace(lines[11],player,peer)
    else if variant="all dead" || variant="revived" {
        for actor in [player,peer,"@Healer#3|(1,2,3,0)|(500/1000)"]
            lines.InsertAt(9,V7832Line(8999,boss,StrReplace(actor,"500/1000","0/1000"),"99","836045448945472","836045448945493"))
        if variant="revived"
            lines.InsertAt(13,V7832Line(9200,player,"=","99","836045448945472","836045448945494"))
    } else if variant="interrupted"
        lines.InsertAt(8,V7832Line(6500,boss,"=","4381085685252096","836045448945472","836045448945482"))
    else if variant="reset"
        lines.InsertAt(8,V7832Line(6500,StrReplace(boss,"10/1000","1000/1000"),"=","99","836045448945472","836045448953669"))
    else if variant="no cast"
        lines.RemoveAt(6)
    else if variant="no flame"
        lines.RemoveAt(7)
    else if variant="no removal"
        lines.RemoveAt(9)
    else if variant="wrong instance"
        lines[9] := StrReplace(lines[9],":123|",":456|")
    else if variant="wrong effect"
        lines[9] := StrReplace(lines[9],"4381085685252434","123")
    else if variant="high cast"
        lines[6] := StrReplace(lines[6],"10/1000","100/1000")
    else if variant="high removal"
        lines[9] := StrReplace(lines[9],"10/1000","100/1000")
    else if variant="unknown hp"
        lines[9] := StrReplace(lines[9],"|(10/1000)","")
    else if variant="no witness"
        lines.RemoveAt(10)
    else if variant="late witness"
        lines[10] := StrReplace(lines[10],"00:00:09.300","00:00:20.001"),lines.RemoveAt(11)
    else if variant="healing only"
        lines[10] := V7832Line(9300,player,"=","99","836045448945477","836045448945500","(100 ~100) <0.0>")
    else if variant="outsider"
        lines[10] := StrReplace(lines[10],"@Recorder#1","@Passerby#90")
    else if variant="late death"
        lines.InsertAt(11,V7832Line(9000,boss,StrReplace(player,"500/1000","0/1000"),"99","836045448945472","836045448945493"))
    else if variant="wrong mode"
        lines[1] := StrReplace(lines[1],"836045448953655","836045448953653")
    return lines
}
V7832Line(at,source,target,ability,action,effect,tail := "")
{
    return "[00:00:" Format("{:02}.{:03}",Floor(at/1000),Mod(at,1000)) "] [" source "] [" target "] [Ability {" ability "}] [Action {" action "}: Effect {" effect "}] " tail
}
V7832TrandosEnding()
{
    for variant in ["sparse","dead recorder","all dead","revived","no witness","late witness","healing only","outsider","late death"] {
        won := variant="sparse" || variant="dead recorder"
        V565Check(V7832Fixture(variant),true,won,200,1,9000,!won)
    }
    for variant in ["interrupted","reset","no cast","no flame","no removal","wrong instance","wrong effect","high cast","high removal","unknown hp","wrong mode"]
        V565Check(V7832Fixture(variant),false,false,0,1,0)
    for variant in ["sparse","dead recorder","all dead","revived","no witness","late witness","healing only","outsider","late death"] {
        data := IPNewData("Trandos catalogue check")
        for line in V7832Fixture(variant)
            IPFeedLine(data,line)
        IPFinalizeData(data,"snapshot"),seg := data.Segments[1]
        won := variant="sparse" || variant="dead recorder"
        V48Assert((ILBFight(seg).Result="Kill")=won,variant " Library requires a surviving participant")
        V48Assert(IGPCompact(seg).Kill=won,variant " Progression requires a surviving participant")
    }
    for pair in [[105540,10553973,true],[105541,10553973,false],[0,10553973,false],[1,1,false]]
        V48Assert(IPTDLowHealth({Known:true,Current:pair[1],Maximum:pair[2]})=pair[3],"integer-rounded 1% endpoint, not zero or full health")
    V48Assert(!IPTDLowHealth({Known:false,Current:1,Maximum:100}),"missing HP cannot arm sparse ending")
    s := IPNewData("Trandos kill proof")
    for line in V7832Fixture()
        IPFeedLine(s,line)
    IPCloseSegment(s,"snapshot")
    proof := IRSProof(s.Segments[1])
    V48Assert(proof.Confirmed && proof.At=9000 && proof.Kind="survival","confirmed kill reaches the shared result used by Library and Progression")
}

V7833RaidStatistics() => V75LibraryRun(V7833RaidStatisticsCase)

V7833RaidStatisticsCase()
{
    lib := ILBState(),files := V75LibraryFiles(),first := ILBRows(files)[1].Source
    first.Pulls[1].Boss := "G-NA",first.Pulls[1].Name := "Nahut"
    first.Pulls[2].Boss := "DF-BR",first.Pulls[2].Name := "Dread Master Brontes"
    p := V75LibraryPull(6,86410000,"No kill"),p.Boss := "G-IZ",p.Name := "Izax"
    p.Mode := "836045448953651",p.End := p.Start+120000,p.Partial := true,first.Pulls.Push(p)
    copy := IPRCloneSnapshot(first),copy.Path .= ".copy",files[StrLower(copy.Path)] := copy
    before := IGVJson(ILBPack(files)),rows := ILBRows(files),m := ILBSModel(rows)
    V48Assert(m.RaidRows.Length=2 && m.Pulls=6 && m.Millis=420000 && m.Alternates=6,"raid totals use deduplicated pulls across characters and modes")
    ranked := ILBSSort(m.RaidRows,"Millis"),gods := ranked[1]
    V48Assert(gods.Name="Gods from the Machine" && gods.Pulls=5 && gods.Millis=360000 && gods.Days=2,"Gods bosses share six minutes in pulls over two days")
    V48Assert(ranked[2].Name="Dread Fortress" && ranked[2].Pulls=1 && ranked[2].Days=1,"another raid retains separate statistics")
    V48Assert(m.Days=2 && gods.Days+ranked[2].Days=3,"overall days are distinct dates, not the sum of per-raid days")
    V48Assert(ILBSSort(m.RaidRows,"Days",false)[1].Days=1 && ILBSSort(m.RaidRows,"Days")[1].Days=2,"raid-day sorting uses numeric counts")
    master := ILBSModel(rows,"836045448953655")
    V48Assert(master.Pulls=5 && master.Millis=300000 && master.RaidRows.Length=2,"difficulty filter applies before raid aggregation")
    for pair in [["G-NA-SM","Gods from the Machine"],["DX-HV","Dxun"],["DF-BR","Dread Fortress"],["MONO","Colossal Monolith"],["UNKNOWN","Example (raid unknown)"]] {
        p := {Boss:pair[1],Name:pair[1]="MONO" ? "Colossal Monolith" : "Example"}
        V48Assert(ILBSRaid(p).Name=pair[2],"raid mapping preserves variants and independent lairs: " pair[1])
    }
    V48Assert(ILBSModel([]).RaidRows.Length=0 && ILBSModel(rows,"missing").RaidRows.Length=0,"empty raid views are valid")
    V48Assert(IGVJson(ILBPack(files))=before,"statistics never mutate library or stored pulls")
    lib.Files := files,lib.Loaded := true,lib.Dirty := true,ILBBuildWindow(),ILBRefresh(),c := lib.Controls
    c["Tabs"].Choose(5),ILBPageChanged(),s := ILBSState(),builds := s.Builds
    c["StatsGroup"].Choose(2),ILBSGroupChanged(),lv := c["StatsList"]
    V48Assert(s.Builds=builds && s.Shown.Length=2 && s.Shown[1].Name="Gods from the Machine","changing to Raids reuses the existing aggregate")
    V48Assert(lv.GetText(0,2)="Raid" && lv.GetText(0,3)="Raid days" && InStr(lv.GetText(0,6),"▼"),"raid headers and initial longest-time ranking are correct")
    ILBSColumnClick(lv,3),V48Assert(s.Descending && s.Shown[1].Days=2,"raid days starts largest first")
    ILBSColumnClick(lv,3),V48Assert(!s.Descending && s.Shown[1].Days=1,"raid days reverses")
    for size in [[980,650],[1920,1080]] {
        lib.Gui.Show("Hide w" size[1] " h" size[2]),ILBResize(lib.Gui,0,size[1],size[2]),controls := []
        for control in lib.Gui
            if V58ChildVisible(control) {
                control.GetPos(&x,&y,&w,&h),controls.Push(control)
                V48Assert(x>=0 && y>=0 && x+w<=size[1]+1 && y+h<=size[2]+1,"raid statistics fit hidden diagnostic page")
            }
        V7412PlayerControlsPng("raid-statistics-" size[1] ".png",lib.Gui,controls,0,0,size[1],size[2])
    }
    c["StatsGroup"].Choose(1),ILBSGroupChanged()
    V48Assert(s.Builds=builds && lv.GetText(0,3)="Difficulty" && c["StatsSort"].Value=1,"return to bosses restores difficulty and pull ranking without recalculating")
    c["StatsGroup"].Choose(2),ILBSGroupChanged(),lib.Files := Map(),lib.Dirty := true,ILBRefresh()
    V48Assert(s.Shown.Length=0 && c["StatsValue1"].Text="0","updated library snapshot refreshes raid totals immediately")
}

V7833TimerWording()
{
    em := Chr(0x2014),d := IRTDefinition("Shield " em " active","Custom " em " timers")
    id := d.Id
    V48Assert(IRTTimerDisplayName(d)="Shield: active" && d.Name="Shield " em " active" && d.Id=id,"display cleanup preserves saved and linked timer identities")
    V48Assert(IRTDisplayText("Fuel" em "ends soon")="Fuel: ends soon","unspaced legacy timer punctuation is readable")
}

V7833DocumentationCatalog()
{
    global SELF_TEST
    V48Assert(SELF_TEST,"catalogue extraction is isolated from user settings")
    timers := [],defs := IRTDefaultLibrary().Definitions
    IRTRepairBundled(defs)
    for d in defs
        timers.Push(V7833CatalogValue(d))
    callouts := []
    for d in ICLDefinitions()
        callouts.Push([d.Group,d.Label,d.Description,d.Id,d.PreviewGroup,d.PreviewKey])
    phases := []
    for boss,profiles in IGPYProfiles()
        for p in profiles {
            names := []
            for phase in p.Phases
                names.Push(phase.Name)
            phases.Push([boss,p.Name,IPRModeLabel(p.Mode),names])
        }
    encounters := []
    for key,p in IPXProfiles()
        encounters.Push([key,p.Name,IPRModeLabel(p.Mode)])
    FileAppend(IGVJson([timers,callouts,phases,encounters]),A_ScriptDir "\catalog.json","UTF-8")
    V48Assert(timers.Length>200 && callouts.Length>80,"current repaired catalogues are populated")
}

V7833CatalogValue(value)
{
    if !IsObject(value)
        return value
    if value is Array {
        out := []
        for item in value
            out.Push(V7833CatalogValue(item))
    } else {
        out := []
        for key,item in value.OwnProps()
            out.Push([key,V7833CatalogValue(item)])
    }
    return out
}

; Real native tab visibility in the isolated Library fixture, no game or user data.
V7834PerformanceSelectors() => V75LibraryRun(V7834PerformanceSelectorsCase)
V7834PerformanceSelectorsCase()
{
    s := ILBState(),s.Files := V75LibraryFiles(),s.Loaded := true
    ILBBuildWindow(),c := s.Controls,ILBRefresh()
    for key in ["TrendBoss","TrendCharacter","TrendSpec"]
        V48Assert(!V7828OwnVisible(c[key]),key " stays hidden while Library is selected")
    c["Tabs"].Choose(3),ILBPageChanged()
    for key in ["TrendBoss","TrendCharacter","TrendSpec","TrendMode"]
        V48Assert(V7828OwnVisible(c[key]),key " appears when Performance is selected after initial dropdown population")
    c["TrendBoss"].Choose(2),c["TrendSpec"].Choose(2),c["TrendMode"].Choose(6),ILBTrendChanged(c["TrendBoss"])
    V48Assert(c["TrendBoss"].Text="Tyth" && s.Trends.Length=4,"boss selector selects matching performance results")
    Loop 3 {
        c["Tabs"].Choose(1),ILBBrowseSync(true)
        V48Assert(V7828OwnVisible(c["Boss"]) && !V7828OwnVisible(c["TrendBoss"]),"refresh stays on Library without showing Performance controls")
        c["Tabs"].Choose(3),ILBPageChanged()
        for key in ["TrendBoss","TrendCharacter","TrendSpec"]
            V48Assert(V7828OwnVisible(c[key]),key " returns after hidden-page refresh")
        V48Assert(ILBChoice(c["TrendBoss"],s.Bosses)="G-TY" && s.Trends.Length=4,"boss choice and filtered results survive tab return")
        ILBBrowseSync(true)
        V48Assert(!V7828OwnVisible(c["Boss"]) && V7828OwnVisible(c["TrendBoss"]),"refresh on Performance keeps other page hidden")
    }
    for width in [904,1920] {
        ILBResize(s.Gui,0,width,768)
        c["TrendBoss"].GetPos(&x,&y,&w,&h)
        V48Assert(x>=0 && y>=0 && w>100 && h>10 && x+w<=width,"boss selector fits normal and maximized layouts")
    }
    V48Assert(!DllCall("IsWindowVisible","Ptr",s.Gui.Hwnd,"Int"),"test never shows the Library window on the desktop")
}

V7835WipePerformance() => V75LibraryRun(V7835WipePerformanceCase)
V7835WipePerformanceCase()
{
    files := V75LibraryFiles()
    for _,item in files {
        f := item
        break
    }
    wipe := f.Pulls[2],wipe.Challenges[1].Partial := 1,wipe.Challenges[1].Verified := 1
    rows := ILBRows(files),args := [rows,ILBOwnerToken(),"G-TY","836045448953655","123","No kill","DPS","burn-1"]
    points := ILBPerformance(args*)
    V48Assert(points.Length=1,"wipe view includes the recorded part of an unfinished burn")
    V48Assert(points[1].Value=3000 && points[1].Seconds=10 && points[1].Amount=30000,"wipe rate uses the saved window total and duration")
    V48Assert(points[1].PartialWindow && !points[1].PBEligible,"partial burn is marked and never qualifies as a PB")
    marks := IPBESTTrendMarks(points,rows,ILBOwnerToken(),"G-TY","836045448953655","123","DPS","burn-1")
    V48Assert(marks[1]="","partial burn gets neither baseline nor PB badge")
    shown := ILBTrendSorted(points,marks,4,true)
    V48Assert(shown[1].Record="Partial window","table explains the shortened challenge window")
    for v in IPBESTValues(wipe,wipe.Recorder)
        V48Assert(v.Name!="Burn","partial burn cannot trigger a PB notification")
    V48Assert(ILBPerformance(rows,ILBOwnerToken(),"G-TY","836045448953655","123","No kill","HPS","burn-1")[1].Value=500,"wipe healing uses the same window")
    V48Assert(ILBPerformance(rows,ILBOwnerToken(),"G-TY","836045448953655","123","No kill","EHPS","burn-1")[1].Value=200,"known effective healing remains available")
    wipe.Challenges[1].Players[wipe.Recorder].HealKnown := 1
    V48Assert(ILBPerformance(rows,ILBOwnerToken(),"G-TY","836045448953655","123","No kill","EHPS","burn-1").Length=0,"unknown effective healing is still excluded")
    wipe.Challenges[1].Players[wipe.Recorder].HealKnown := 2
    whole := ILBPerformance(rows,ILBOwnerToken(),"G-TY","836045448953655","123","No kill")
    V48Assert(whole.Length=1 && !whole[1].PartialWindow && !whole[1].PBEligible,"whole-fight wipes retain their existing behavior")
    wipe.Partial := 1,V48Assert(ILBPerformance(args*).Length=0,"an incomplete recording is still excluded")
    wipe.Partial := 0,wipe.Challenges[1].Duration := 0
    V48Assert(ILBPerformance(args*).Length=0,"zero-length window is excluded")
    wipe.Challenges[1].Duration := 10,wipe.Challenges[1].Partial := 0
    points := ILBPerformance(args*)
    V48Assert(points[1].PBEligible && !points[1].PartialWindow,"completed verified phases on wipes remain eligible")
    f.Pulls[1].Challenges[1].Partial := 1
    V48Assert(ILBPerformance(rows,ILBOwnerToken(),"G-TY","836045448953655","123","Kill","DPS","burn-1").Length=3,"partial kill challenges remain excluded")
    wipe.Challenges[1].Partial := 1
    s := ILBState(),s.Files := files,s.Loaded := true,ILBBuildWindow(),ILBRefresh(),c := s.Controls
    c["Tabs"].Choose(3),ILBPageChanged(),c["TrendBoss"].Choose(2),c["TrendSpec"].Choose(2),c["TrendMode"].Choose(6)
    ILBTrendChanged(c["TrendBoss"]),c["TrendChallenge"].Choose(2),c["TrendResult"].Choose(2),ILBTrendChanged(c["TrendResult"])
    V48Assert(s.Trends.Length=1 && c["TrendList"].GetCount()=1,"native No kill filter displays the partial burn")
    V48Assert(c["TrendList"].GetText(1,3)="Partial window" && InStr(c["TrendNote"].Text,"not personal bests"),"native table and note explain partial comparisons")
    V48Assert(!c["TrendOpen"].Enabled,"a displayed wipe still needs a row selection")
    c["TrendList"].Modify(1,"Select"),ILBActionState()
    V48Assert(c["TrendOpen"].Enabled && ILBTrendSelected().PartialWindow,"selected wipe can be opened")
    c["TrendResult"].Choose(1),ILBTrendChanged(c["TrendResult"])
    V48Assert(s.Trends.Length=3,"switching back to kills keeps partial-window exclusion")
}

; Private native controls and synthetic Library only. No normal app or user files.
V7838LibraryControls() => V75LibraryRun(V7838LibraryControlsCase)
V7838LibraryControlsCase()
{
    global IP,Audio
    s := ILBState(),s.Files := V75LibraryFiles(),s.Loaded := true
    live := IP.Live,queue := Audio.Queue,files := s.Files
    ILBBuildWindow(),ILBRefresh(),c := s.Controls
    c["Search"].Value := "not a recorded boss",c["Minutes"].Value := "90",s.Date := "20200101"
    c["Result"].Choose(3),c["Boss"].Choose(2),ILBFilterChanged(),ILBBusy()
    V48Assert(!s.Shown.Length && !c["Open"].Enabled && !c["Reindex"].Enabled && !c["Remove"].Enabled,"idle refresh cannot enable actions on an empty filtered list")
    V48Assert(InStr(c["Detail"].Text,"Reset filters"),"empty search offers an available recovery action")
    c["TrendBoss"].Choose(2),c["TrendSpec"].Choose(2),c["TrendMode"].Choose(6)
    ILBResetFilters()
    V48Assert(s.Shown.Length=5 && c["List"].GetCount()=5 && c["Open"].Enabled,"reset restores all saved rows with a valid selection")
    V48Assert(s.Date="" && c["Search"].Value="" && c["Minutes"].Value="0" && c["Result"].Value=1,"date, text, minimum length and result reset together")
    V48Assert(c["TrendBoss"].Value=2 && c["TrendSpec"].Value=2 && c["TrendMode"].Value=6,"Library reset does not reset Performance choices")
    c["List"].Modify(0,"-Select"),ILBSelect(),ILBBusy()
    V48Assert(!c["Open"].Enabled && InStr(c["Detail"].Text,"Select a fight"),"deselection asks for a row without falsely claiming filters have no results")
    c["List"].Modify(1,"Select"),ILBSelect(),s.Busy := true,ILBBusy()
    V48Assert(!c["Open"].Enabled && c["Cancel"].Enabled,"import ownership still locks selected actions and exposes Pause")
    s.Busy := false,s.Loading := true,ILBBusy()
    V48Assert(!c["Open"].Enabled,"loading cannot act on a stale selection")
    s.Loading := false,ILBBusy(),c["Tabs"].Choose(3),ILBPageChanged()
    V48Assert(s.Trends.Length=4 && !c["TrendOpen"].Enabled,"Performance requires a selected result, not just a populated table")
    c["TrendList"].Modify(2,"Select"),ILBActionState()
    selected := ILBTrendSelected()
    V48Assert(c["TrendOpen"].Enabled && IsObject(selected),"selecting a Performance result enables opening it")
    ILBTrendColumnClick(c["TrendList"],4)
    V48Assert(c["TrendOpen"].Enabled && ILBTrendSelected().Entry.Key=selected.Entry.Key,"sorting retains the selected fight identity")
    c["TrendList"].Modify(0,"-Select"),ILBBusy()
    V48Assert(!c["TrendOpen"].Enabled,"busy refresh cannot restore a stale Performance selection")
    c["TrendSpec"].Choose(1),ILBTrendChanged(c["TrendSpec"])
    V48Assert(InStr(ILBTrendEmptyText(s),"Choose a boss"),"unconfigured chart explains required choices")
    c["Tabs"].Choose(1),ILBPageChanged()
    for width in [664,904,1920] {
        ILBResize(s.Gui,0,width,768),previous := 0
        for key in ["Earlier","Later","ClearDate","ResetFilters"] {
            c[key].GetPos(&x,,&w)
            V48Assert(x>=previous && x+w<=width,"Library filter controls fit without overlap at " width)
            previous := x+w
        }
    }
    V48Assert(s.Files=files && IP.Live=live && Audio.Queue=queue,"filter and selection operations leave catalogue, live session and audio untouched")
    V48Assert(!DllCall("IsWindowVisible","Ptr",s.Gui.Hwnd),"native checks keep the app hidden")
}

V7838MenuRoutes() => V658MenuFixture(V7838MenuRoutesCase)
V7838MenuRoutesCase(f)
{
    global IP,IC,IIF,IPAS,Audio
    oldIP := IP,oldIC := IC,oldIIF := IIF,oldStart := IPAS
    g := Gui("+ToolWindow"),queue := Audio.Queue
    try {
        IP := IPNewApp(),IC := ICNewState(),IIF := IIFNewState(),IPAS := IPASNewState()
        IPWAttachMenus(g),u := IPWState(),root := V658MenuSnapshot(u.SettingsMenu.Handle)
        advanced := V7829HelpItem(u.SettingsMenu,"Advanced").Submenu,seen := Map()
        for item in V658MenuSnapshot(advanced)
            seen[item.Text] := true
        for label in ["Saved log cache","Cache size...","Cache information","Clear saved results","Discord sharing with Kenku...","Saved-log recovery","Manage saved sources..."]
            V48Assert(seen.Has(label),"Advanced retains access to " label)
        V48Assert(!seen.Has("Diagnostics..."),"diagnostics has one main-menu entry under Help")
        imports := V7829HelpItem(u.FileMenu,"Import to Library and Progression").Submenu
        rows := V658MenuSnapshot(imports)
        V48Assert(rows.Length=2 && rows[1].Text="Add logs..." && rows[2].Text="Add folder...","import choices name their destination and match Library buttons")
        for busy in [true,false] {
            IPWMenuState(!busy,busy,true)
            V48Assert(!!(V7829HelpItem(u.SettingsMenu,"Parser options...").State & 3)=busy,"parser settings retain the live/import lock")
        }
        IUMRestore()
        V48Assert(V658MenuSame(root,V658MenuSnapshot(u.SettingsMenu.Handle),true,true),"Advanced actions survive native menu styling")
        V48Assert(!IP.Active && Audio.Queue=queue,"opening menus does not start parsing or speech")
    }
    finally IUMRestore(),g.Destroy(),IP := oldIP,IC := oldIC,IIF := oldIIF,IPAS := oldStart
}

; Hidden native controls, private settings and fake audio. No normal app startup.
V7839Fixture(fn) => V672LibraryUIFixture(V7839Inner.Bind(fn))
V7839Inner(fn)
{
    global IUB,IPM
    oldTheme := IUB,oldMeters := IPM
    IUB := IUBNewState(),IPM := IPMNewState()
    try fn.Call()
    finally {
        IDPToolsClose("analysis"),IDPToolsClose("progress")
        if IPMGuiAlive(IPM.ConfigGui)
            IPM.ConfigGui.Destroy()
        IUSPrune(),IUB := oldTheme,IPM := oldMeters
    }
}
V7839Displays() => V7839Fixture(V7839DisplaysCase)
V7839DisplaysCase()
{
    global IPM,Audio,IP
    before := V672LibraryUIIni(),IPM.Mode := 3,IPM.MaxRows := 16
    IPMOpenSettings(),g := IPM.ConfigGui,identity := g.Hwnd
    V48Assert(!DllCall("IsWindowVisible","Ptr",g.Hwnd),"settings constructor stays hidden in diagnostics")
    V48Assert(IPM.ModeControl.Value=3 && IPM.RowControl.Value=16,"new layout loads current preferences")
    V48Assert(IUSState().Controls.Has(IPM.EnableControl.Hwnd) && IUDStyleState().Controls.Has(IPM.ModeControl.Hwnd),"native checkbox and dropdown have scoped styling")
    original := IPM.EnableControl.Value
    SendMessage(0xF5,0,0,IPM.EnableControl.Hwnd) ; BM_CLICK on this hidden fixture only
    V48Assert(IPM.EnableControl.Value!=original,"native checkbox click still toggles")
    IPM.EnableControl.Value := original
    for i in [1,2,3] {
        IPM.ModeControl.Choose(i),IPMModeChanged()
        V48Assert(IPM.ModeControl.Value=i,"native layout selection remains usable")
    }
    IPMOpenSettings()
    V48Assert(IPM.ConfigGui.Hwnd=identity && IPM.ModeControl.Value=3,"reopen reuses controls and restores saved layout")
    V48Assert(V672LibraryUIIni()=before && !IP.Active && !Audio.Queue.Length,"opening and arranging settings never saves or parses")
    IPM.RowControl.Value := 12,IPM.FontControl.Value := 11,IPM.OpacityControl.Value := 220
    V48Assert(IPMApplySettings() && IPM.MaxRows=12 && IPM.Font=11 && IPM.Opacity=220,"Save still applies controls through existing settings handler")
    V48Assert(!Audio.Queue.Length && !IP.Active,"saving display preferences does not start parser or audio")
}
V7839Tools() => V7839Fixture(V7839ToolsCase)
V7839ToolsCase()
{
    global Audio,IP
    before := V672LibraryUIIni()
    for kind in ["analysis","progress"] {
        g := kind="analysis" ? IAEmbeddedTools() : IGVMore(),h := g.Hwnd,count := 0
        for c in g
            if c.Type="Button"
                count += 1
        V48Assert(count=(kind="analysis" ? 9 : 10),"all existing tools have an action in " kind)
        V48Assert(!DllCall("IsWindowVisible","Ptr",h),"tools stay hidden in native diagnostics")
        V48Assert(IDPToolsOpen(kind).Hwnd=h,"reopening tools reuses its window")
        if kind="analysis"
            V48Assert(IUCReviewToolsOpen().Hwnd=h,"More button and main Review tools menu open the same panel")
        invoked := false
        IDPToolInvoke(kind,(*) => invoked := true)
        V48Assert(invoked && !DllCall("IsWindow","Ptr",h),"selected action runs once after closing the panel")
    }
    V48Assert(IDPToolGroups("analysis")[1].Rows[1][2]=IACopySummary,"review summary retains its original handler")
    V48Assert(V672LibraryUIIni()=before && !IP.Active && !Audio.Queue.Length,"tools construction changes no settings or live state")
}
V7839Checks() => V7839Fixture(V7839ChecksCase)
V7839ChecksCase()
{
    global IUB,Audio,energyShieldCalloutEnabled,CoTankAbilityEnabled,Persist
    energyShieldCalloutEnabled := true,CoTankAbilityEnabled["EnergyShield"] := true
    g := ICLUOpen(),s := ICLUState(),h := s.List.Hwnd,images := IDPCheckState(),baseline := images.Created-images.Released
    V48Assert(images.Lists.Has(h),"Audio Callouts receives a native state image list")
    original := images.Lists[h].Original,custom := images.Lists[h].Images
    V48Assert(SendMessage(0x1002,2,0,h)=custom && custom!=original,"lavender checks replace only the state images")
    for c in s.Masters
        V48Assert(IUSState().Controls.Has(s.Masters[c].Hwnd),"master checkbox registered without changing handlers")
    serial := Persist.Serial
    loop 4 {
        IUB.Rounded := false,IUBApplyWindow(g,"callout-settings")
        V48Assert(!images.Lists.Has(h) && SendMessage(0x1002,2,0,h)=original,"turning styling off restores original Windows checks")
        IUB.Rounded := true,IUBApplyWindow(g,"callout-settings")
        V48Assert(images.Lists.Has(h) && images.Created-images.Released=baseline,"repeated theme changes retain one owned list")
    }
    V48Assert(Persist.Serial=serial && energyShieldCalloutEnabled,"appearance changes do not alter checked preferences")
    s.Search.Value := "Energy Shield",ICLURefresh(),row := V672LibraryUIRow("your.EnergyShield")
    Sleep(-1)
    lvitem := Buffer(A_PtrSize=8 ? 88 : 60,0)
    NumPut("UInt",0x1000,lvitem,12),NumPut("UInt",0xF000,lvitem,16)
    SendMessage(0x102B,row-1,lvitem.Ptr,h),Sleep(1)
    V48Assert(!energyShieldCalloutEnabled && CoTankAbilityEnabled["EnergyShield"],"native ItemCheck still changes the correct filtered callout")
    V48Assert(!Audio.Queue.Length,"checking callouts does not play them")
    g.Destroy(),s.Gui := ""
    V48Assert(!images.Lists.Has(h) && images.Created-images.Released=baseline-1,"destroy releases our image list and restores native ownership")
}

; Real hidden button clicks against synthetic graph/review data, without log reads.
V7844ToolSelection() => V7839Fixture((*) => V68ReviewUIFixture(V7844ToolSelectionCase))
V7844ToolSelectionCase(review)
{
    global IP,Audio
    graph := IGVState(),rows := graph.Rows,selected := graph.Selected
    oldGraphBusy := graph.Busy,oldBatchBusy := IGLState().Busy,oldReviewBusy := review.Busy
    before := V672LibraryUIIni(),generation := review.Generation
    try {
        graph.Busy := false,IGLState().Busy := false,review.Busy := false,graph.Selected := 0
        g := IDPToolsOpen("progress"),h := g.Hwnd
        for label in ["Raid utility timing...","Compare rotations..."] {
            V7844ToolClick(g,label)
            V48Assert(IPMGuiAlive(g) && g.Hwnd=h,"missing selection leaves the same tools panel open")
            V48Assert(g.IDP.Notice.Text="Select a pull on the Progression graph first.","button explains the missing pull inside the panel")
        }
        V48Assert(review.Generation=generation && !IsObject(ITRState().Data),"missing selection cannot read a log or open unrelated cached utility data")
        graph.Selected := rows.Length+1,V7844ToolClick(g,"Raid utility timing...")
        V48Assert(IPMGuiAlive(g) && InStr(g.IDP.Notice.Text,"Select a pull"),"stale selection is rejected visibly")
        graph.Rows := [],graph.Selected := 1,V7844ToolClick(g,"Raid utility timing...")
        V48Assert(IPMGuiAlive(g) && InStr(g.IDP.Notice.Text,"Select a pull"),"empty graph is rejected visibly")
        graph.Rows := rows,graph.Selected := selected
        for owner in [graph,IGLState(),review] {
            owner.Busy := true
            try {
                V7844ToolClick(g,"Raid utility timing...")
                V48Assert(IPMGuiAlive(g) && InStr(g.IDP.Notice.Text,"finish loading"),"busy work keeps the panel open with a loading explanation")
            }
            finally owner.Busy := false
        }
        V48Assert(IDPToolRequirement("progress",IGVHelp)="","unrelated tools remain available without review prerequisites")
        V68ReviewUILoadedSetup(review)
        data := review.A.Data
        data.Rows.Push(V77Event(data.Start+1000,"@Demo Tank#101","=","880189122805760",false,"Sonic Missile"))
        V7844ToolClick(g,"Raid utility timing...")
        V48Assert(!DllCall("IsWindow","Ptr",h),"valid selection closes the tools panel")
        V48Assert(IPMGuiAlive(ITRState().Gui) && ITRState().Data=data && ITRState().Uses.Length=1,"real button opens the selected pull's utility timing window")
        V48Assert(review.Generation=generation,"already loaded review data needs no additional log read")
        V48Assert(V672LibraryUIIni()=before && !IP.Active && !Audio.Queue.Length,"tool navigation does not alter settings or start parsing or audio")
    }
    finally {
        ITRClose(),IDPToolsClose("progress")
        graph.Rows := rows,graph.Selected := selected,graph.Busy := oldGraphBusy
        IGLState().Busy := oldBatchBusy,review.Busy := oldReviewBusy
    }
}
V7844ToolClick(g,label)
{
    for c in g {
        if c.Type="Button" && c.Text=label {
            SendMessage(0xF5,0,0,c.Hwnd) ; BM_CLICK on this hidden test window only.
            Sleep(20)
            return
        }
    }
    throw Error("Test button not found: " label)
}

; Native offline regressions. Recorded fixtures are in the companion file.
; All writes use temporary test sidecars. No normal startup, hotkeys or audio.
V7845Defs()
{
    defs := IRTDefaultLibrary().Definitions
    IRTRepairBundled(defs),defs := IRTCurateLibrary(defs),IRTValidateDependencies(defs)
    return defs
}
V7845Catalogue()
{
    defs := V7845Defs(),index := V652TimerDefaultsIndex(defs)
    V48Assert(defs.Length=201,"effective stock library excludes twelve retired entries")
    for d in defs
        V48Assert(d.Supported,"every remaining stock timer has valid trigger and dependency support: " d.Name)
    for row in IRTRetiredTimers()
        V48Assert(!index.Has(row[1] Chr(31) row[2]),"retired entry is absent: " row[2])
    xml := IRTSerializeXML(defs)
    IRTRepairBundled(defs),defs := IRTCurateLibrary(defs),IRTValidateDependencies(defs)
    V48Assert(IRTSerializeXML(defs)==xml,"effective catalogue is stable on repeat repair")
    V48Assert(index["R4 Anomaly" Chr(31) "WD - 1° Degauss - Watchdog"].Supported,"working Watchdog repair remains available")
    V48Assert(index["The Nature of Progress" Chr(31) "Titax Strike (NiM)"].IRTTitaxEstimate,"requested Titax estimate is retained")
}
V7845PreservedEdits()
{
    original := IRTDefaultLibrary().Definitions,index := V652TimerDefaultsIndex(original)
    ward := index["Classes - Shadow/Sin" Chr(31) "Dark Ward"]
    ward.Enabled := false,ward.Color := "123456",ward.Audio := "custom.wav",ward.Volume := 17
    ward.IRTIBaseSupported := false,ward.IRTIBaseReason := "Missing linked timer: Scndrl Underworld M.."
    edited := index["Dread Fortress" Chr(31) "Swipe (2)"]
    edited.Trigger.EffectGuid := "836045448945501"
    custom := IRTIClone(edited),custom.Folder := "My timers",custom.Id := custom.Folder Chr(31) custom.Name
    original.Push(custom),IRTRepairBundled(original),clean := IRTCurateLibrary(original),IRTValidateDependencies(clean)
    index := V652TimerDefaultsIndex(clean)
    V48Assert(ward.Supported && !ward.Enabled && ward.Color="123456" && ward.Audio="custom.wav" && ward.Volume=17,"repair preserves all saved presentation choices")
    V48Assert(index.Has(edited.Id) && index.Has(custom.Id),"edited retired rule and same-name custom timer are not deleted")
    ward.Interval := 19000,IRTRepairBundled(clean)
    V48Assert(ward.Interval=19000 && !ward.HasOwnProp("IRTWardDuration"),"custom mechanical edits remove derived buff classification")
    before := IRTSerializeXML(clean),roundtrip := IRTParseXML(before,IRTBDefinitions()).Definitions
    IRTRepairBundled(roundtrip),roundtrip := IRTCurateLibrary(roundtrip)
    V48Assert(V652TimerDefaultsIndex(roundtrip).Has(edited.Id),"user repair survives serialization and curation")
}
V7845SavedPack() => V652TimerDefaultsIsolated(V7845SavedPackCase)
V7845SavedPackCase(path)
{
    global IRT
    IRTWriteLibrary(IRTDefaultLibrary().Definitions),before := FileRead(path ".timers.xml","UTF-8")
    IRTLoadLibrary()
    V48Assert(IRT.Definitions.Length=202,"old saved pack cannot reintroduce retired stock timers")
    V48Assert(IRT.Issues.Length=1 && InStr(IRT.Issues[1],"Audio and countdown voice settings were retained.")=1,"only the retained-imported-audio notice remains")
    V48Assert(FileRead(path ".timers.xml","UTF-8")==before && !FileExist(path ".timers.xml.bak"),"startup does not rewrite the saved pack")
    importPath := path ".import.xml"
    try {
        FileAppend(IRTDefaultXML(),importPath,"UTF-8")
        result := IRTImportFile(importPath,true)
        V48Assert(result.Committed && IRT.Definitions.Length=202 && IRT.Issues.Length=1,"reimporting original v15 pack uses repaired effective catalogue")
        IRTLoadLibrary()
        V48Assert(IRT.Definitions.Length=202 && IRT.Issues.Length=1,"written curated pack reloads with only the imported-audio notice")
    }
    finally FileDelete(importPath)
}
V7845CustomIssues()
{
    d := V65TimerDef("My chain",1000,"TIMER_STARTED"),d.Trigger.Timer := "Missing custom timer"
    defs := [d],issues := IRTValidateDependencies(defs)
    issues.Push("Saved timers could not be loaded: example")
    out := IRTCurrentIssues(IRTCurateLibrary(defs),issues)
    V48Assert(!d.Supported && out.Length=2,"custom dependency and source errors remain visible")
    V48Assert(InStr(out[2],"Missing custom timer"),"current unsupported custom dependency is not hidden")
}
V7845WardRecords()
{
    defs := V7845Defs(),index := V652TimerDefaultsIndex(defs)
    for name in ["Dark Ward","Kinetic Ward"] {
        rows := V7845Recorded(name),start := IPParseLine(rows[1]),lost := IPParseLine(rows[2])
        d := index["Classes - Shadow/Sin" Chr(31) name],s := IRTNewState([d])
        s.Enabled := true,s.Self := start.Source.Key
        V65BObserve(s,start,1000),V65BDue(s,name,21000,"recorded activation starts Ward duration")
        V48Assert(IRTIsBuffDuration(d),"Ward warning describes buff duration")
        ; Explicit synthetic early loss and refresh variants of recorded events.
        other := lost.Clone(),other.Source := IPActor("@Other#999"),other.Target := other.Source
        V65BObserve(s,other,1500),V65BDue(s,name,21000,"another player's loss cannot cancel the Ward")
        bulwark := lost.Clone(),bulwark.EffectId := name="Dark Ward" ? "975760735076621" : "980828796485899"
        V65BObserve(s,bulwark,1700),V65BDue(s,name,21000,"Bulwark loss cannot cancel Ward")
        V65BObserve(s,start,2000),V65BDue(s,name,22000,"activation refreshes Ward without needing another gain")
        V65BObserve(s,lost,3000),V65BIdle(s,name,"actual Ward loss ends its duration")
        V65BPump(s,23000)
        V48Assert(s.Alerts.Length=0,"early loss leaves no stale duration warning")
    }
}
V7845DomRecords()
{
    index := V652TimerDefaultsIndex(V7845Defs())
    for item in [["Dom - Concussive Blast","Dom - Incite"],["Deploy Attractors","TRIGGER Attractor P5"]] {
        a := index["R4 Anomaly" Chr(31) item[1]],b := index[(item[2]="Dom - Incite" ? "R4 Anomaly" : "Z - Triggers") Chr(31) item[2]]
        if item[2]="Dom - Incite"
            defs := [a,b,index["R4 Anomaly" Chr(31) "Dom - Insulate"]]
        else
            defs := [a,b]
        s := IRTNewState(defs),s.Enabled := true,s.Self := "@Timer Tester#65",s.InCombat := true,s.Boss := "Lady Dominique"
        rows := V7845Recorded(item[1]),start := IPParseLine(rows[1]),stop := IPParseLine(rows[2]),delta := stop.RawMs-start.RawMs
        V48Assert(delta>0 && delta<a.Interval,"recorded phase change happens while the forecast is active")
        V65BObserve(s,start,1000),V65BDue(s,a.Name,1000+a.Interval,"recorded activation starts repaired forecast")
        V65BObserve(s,stop,1000+delta),V65BIdle(s,a.Name,"recorded next phase cancels forecast via repaired link")
    }
}
V7845ApexRecords()
{
    rows := V7845Recorded("Apex"),cast := IPParseLine(rows[1]),puddle := IPParseLine(rows[2])
    s := V65BState(),s.Boss := "ApexVanguard"
    V65BObserve(s,puddle,1500),V65BIdle(s,"Apex Acid Blast","recorded puddle effect cannot start forecast")
    V65BObserve(s,cast,2000),V65BDue(s,"Apex Acid Blast",32000,"actual recorded Acid Blast cast anchors forecast")
    V65BObserve(s,cast,2000),V65BDue(s,"Apex Acid Blast",32000,"duplicate activation cannot restart timer")
    V65BObserve(s,puddle,29000),V65BDue(s,"Apex Acid Blast",32000,"late reapplication no longer moves forecast")
    V65BObserve(s,cast,32700),V65BDue(s,"Apex Acid Blast",62700,"next cast reanchors from its own timestamp")
}
V7845Advanced() => V65UITimerIsolated(V7845AdvancedCase)
V7845AdvancedCase(path)
{
    global IRTPrefs
    main := IRTShowManager(),advancedButton := ""
    for c in main {
        V48Assert(c.Text!="New timer...","New timer is absent from main timer controls")
        if c.Type="Button" && c.Text="Advanced..."
            advancedButton := c
    }
    V48Assert(IsObject(advancedButton),"main Timers exposes Advanced")
    SendMessage(0x00F5,0,0,advancedButton.Hwnd),Sleep(20)
    g := IRTPrefs.Advanced,newButton := ""
    V48Assert(IPMGuiAlive(g),"actual Advanced button opens its panel")
    for c in g
        if c.Type="Button" && c.Text="New timer..."
            newButton := c
    V48Assert(IsObject(newButton),"new timer is discoverable in Advanced")
    SendMessage(0x00F5,0,0,newButton.Hwnd),Sleep(20)
    V48Assert(IsObject(IRTPrefs.RuleEditor),"actual New timer button still opens the editor")
    IRTEClose(),IRTUCloseManager()
    V48Assert(!FileExist(path ".timers.xml"),"navigation alone does not write timer preferences")
}

; Literal records from the retained archive audit, source evidence in v78.45 evidence/probe.json.
V7845Recorded(name)
{
    switch name,true {
        case "Dark Ward":
            return ["[23:55:56.324] [@Jerb'le#689491748725361|(368.92,-264.14,-13.98,-0.63)|(498994/498994)] [=] [Dark Ward {975760735076352}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
                "[23:56:16.420] [@Jerb'le#689491748725361|(394.29,-309.50,-13.98,179.72)|(498994/498994)] [=] [Dark Ward {975760735076352}] [RemoveEffect {836045448945478}: Dark Ward {975760735076352}]"]
        case "Kinetic Ward":
            return ["[06:26:02.732] [@Flat#689038118938423|(-30.26,-299.60,54.02,-39.26)|(383556/440452)] [=] [Kinetic Ward {980828796485632}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
                "[06:26:22.744] [@Flat#689038118938423|(-44.75,-299.18,54.02,167.26)|(431432/440452)] [=] [Kinetic Ward {980828796485632}] [RemoveEffect {836045448945478}: Kinetic Ward {980828796485632}]"]
        case "Dom - Concussive Blast":
            return ["[22:36:19.448] [Lady Dominique {4608014577303552}:25483000621931|(-39.00,-3.50,-215.45,-92.17)|(61322012/66281708)] [=] [ {4574698515988480}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
                "[22:36:39.065] [Lady Dominique {4608014577303552}:25483000621931|(-39.00,-3.50,-215.45,91.75)|(58241964/66281708)] [=] [Incite {4590654319493120}] [Event {836045448945472}: AbilityActivate {836045448945479}]"]
        case "Deploy Attractors":
            return ["[22:43:12.377] [Lady Dominique {4608014577303552}:25483000621931|(-39.00,-3.50,-215.45,-93.41)|(18492112/66281708)] [=] [Deploy Attractor {4599635096109056}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
                "[22:44:11.490] [Lady Dominique {4608014577303552}:25483000621931|(-39.00,-3.50,-215.45,-100.22)|(16305554/66281708)] [=] [Deploy Attractor {4605540676141056}] [Event {836045448945472}: AbilityActivate {836045448945479}]"]
        case "Apex":
            return ["[23:59:41.723] [Apex Vanguard {4350020186800128}:16705001327058|(398.70,-307.70,-13.98,-12.61)|(61249856/62726540)] [=] [Acid Blast {4305094828883968}] [Event {836045448945472}: AbilityActivate {836045448945479}]",
                "[23:59:42.737] [Apex Vanguard {4350020186800128}:16705001327058|(398.70,-307.70,-13.98,-12.61)|(61056928/62726540)] [@Baire#688463846904450|(399.98,-313.48,-13.98,167.48)|(488355/488355)] [Acid Blast {4305240857772032}] [ApplyEffect {836045448945477}: Extraordinary Corrosion {4305240857772294}] (1 charges {836045448953667})"]
    }
    throw Error("Unknown recorded fixture")
}

V7845NotesAutosave() => V71BookmarkFixture(V7845NotesAutosaveCase)
V7845NotesAutosaveCase(root)
{
    b := IBKState(),d := V71BookmarkPull(),IBKOpen(d)
    b.Controls["Note"].Value := "Cîryndà takes the first interrupt.",IUXNotesChanged()
    V48Assert(IUXNotesFlush() && b.Rows[d.Key].Note="Cîryndà takes the first interrupt.","autosave persists Unicode draft")
    b.Controls["Note"].Value := "Second draft",IBKClose(),IBKLoad(true)
    V48Assert(b.Rows[d.Key].Note="Second draft","close flushes pending edit")
    IBKOpen(d),b.Controls["Note"].Value := "Keep this draft"
    V71BookmarkWrite(b.TestPath,FileRead(b.TestPath,"UTF-8") " ")
    V48Assert(!IUXNotesFlush() && b.Controls["Note"].Value="Keep this draft","external edit refuses autosave without losing draft")
    V48Assert(!IBKOpen(d) && b.Controls["Note"].Value="Keep this draft","failed save blocks switching notes")
    V48Assert(InStr(b.Controls["Status"].Text,"Not saved"),"failed autosave visible inline")
}
V7845CompareMarks() => V68ReviewUIFixture(V7845CompareMarksCase)
V7845CompareMarksCase(s)
{
    global IP,Audio
    ux := IUXState(),old := ux.Marks,live := IP.Live,queue := Audio.Queue
    try {
        ux.Marks := [],v := IGVState(),a := v.Rows[1],b := v.Rows[2]
        IUXMark(a),IUXMark(b)
        V48Assert(ux.Marks.Length=2 && IUXCompareOpen(),"two marks open a comparison")
        V48Assert(s.A.Key=IGRVEntryKey(a) && s.B.Key=IGRVEntryKey(b),"marked identities preserved independent of prior B")
        V48Assert(!IsObject(s.A.Data) && !IP.Active && IP.Live=live && Audio.Queue=queue,"marking does not alter live parser or play audio")
        IUXMark(a),V48Assert(ux.Marks.Length=1,"repeat mark removes only that pull")
        copied := IPRCloneSnapshot(b),copied.Key := "another page"
        IUXMark(copied),V48Assert(ux.Marks.Length=0,"same recording and pull unmarked across page identities")
        IUXMark(b)
        wrong := IPRCloneSnapshot(a),wrong.Pull.Mode := "different"
        V71BookmarkThrows(IUXMark.Bind(wrong),"cross-difficulty comparison refused")
        IUXCompareClear(),V48Assert(ux.Marks.Length=0,"clear marks leaves loaded data intact")
    }
    finally ux.Marks := old
}
V7845LibraryReview() => V68ReviewRun(V7845LibraryReviewCase)
V7845LibraryReviewCase()
{
    f := V68ReviewFile()
    try {
        p := ILBFight(f.State.Segments[-1]),file := ILBFile(f.Path,f.Entry.Date,FileGetSize(f.Path),FileGetTime(f.Path,"M"),Format("{:064}",0),[p])
        entry := IUXLibraryEntry(ILBEntry(file,p)),d := IGRLoadEntry(entry,f.Path)
        V48Assert(d.BaseVerified && d.ReviewLibrary.Start=p.Start && d.ReviewLibrary.End=p.End,"Library pull opens with exact replay")
        V48Assert(IUXVerifyLibrary(d.ReviewLibrary,p).Length=0,"every saved player amount reconciled")
        bad := IPRCloneSnapshot(entry)
        for key,person in bad.Pull.Players {
            person.Damage += 1
            break
        }
        V71BookmarkThrows(IGRLoadEntry.Bind(bad,f.Path),"mismatched Library totals cannot silently compare")
    }
    finally FileDelete(f.Path)
}
V7845IndexedReview() => V693IxFixture(V7845IndexedReviewCase)
V7845IndexedReviewCase(a,source,seg,path,text)
{
    entry := {Key:"indexed",Session:IGVSourceIdentity(path).Session,Date:"20261003",Team:"",Pull:IPRCompact(seg)}
    baseline := IGRLoadEntry(entry,path),snap := IASnapshotFile(path,"UTF-8"),digest := IPCHashFile(path)
    source.CacheDigest := digest,job := IGRBegin("test selected details")
    try {
        fast := IUXReviewIndexed(entry,snap,digest,job)
        V48Assert(IsObject(fast),"completed import index used by pull review")
        d := IAAssemble(fast.State,fast.Segment,fast.Capture,path,"UTF-8",snap.End)
        IAEffectsBuild(d),IAShieldsBuild(d)
        V48Assert(V692AnalysisSignature(d)=V692AnalysisSignature(baseline),"indexed events, totals, casts, effects and shielding match full replay")
        V48Assert(fast.Records<source.Lines,"selected details avoid later unrelated pulls")
        job.Control.Cancel := true
        V71BookmarkThrows(IUXReviewIndexed.Bind(entry,snap,digest,job),"cancellation cannot fall through to slow replay")
    }
    finally snap.File.Close(),IGREnd(job)
}
V7845SourcesPaging() => V779Run(V7845SourcesPagingCase)
V7845SourcesPagingCase()
{
    f := V779SourcesFixture(),s := ISMState()
    try {
        ISMOpen(),s.Rows := []
        Loop 612
            s.Rows.Push({Id:A_Index,Name:"Recording " A_Index,Date:"20261003",Paths:[],Pulls:1,Captures:1,Teams:"Raid",Search:"Recording " A_Index " Raid"})
        s.Page := 1,ISMFilter()
        V48Assert(s.Shown.Length=250 && s.Controls["Rows"].GetCount()=250,"saved sources bounds native rows")
        IUXSourcePage(1),V48Assert(s.Shown[1].Id=251,"second page maps exact source identities")
        IUXSourcePage(1),V48Assert(s.Shown.Length=112 && !s.Controls["Next"].Enabled,"final page and next boundary")
        s.Controls["Search"].Value := "Recording 612",IUXSourceFilterNow()
        V48Assert(s.Shown.Length=1 && s.Shown[1].Id=612 && s.Page=1,"search finds results beyond rendered page")
    }
    finally {
        if IPMGuiAlive(s.Gui)
            s.Gui.Destroy()
        s.Gui := "",FileDelete(f.Path),FileDelete(f.File)
    }
}
V7845HotsSettings() => V66EffectsUIFixture(V7845HotsSettingsCase)
V7845HotsSettingsCase()
{
    global IEFU,IEF,IP
    try {
        before := IEFU.Durations,g := IUXHotsOpen(),c := IUXState().HotsControls
        V48Assert(!DllCall("IsWindowVisible","Ptr",g.Hwnd),"HoTs settings isolated")
        c["Slots"].Value := "Cîryndà`nTank One",c["Columns"].Choose(3)
        V48Assert(IUXHotsSave() && IEFU.Columns=4 && IEFU.Slots="Cîryndà`nTank One","HoTs saves order and columns")
        V48Assert(IEFU.Durations=before && !IP.Active,"HoTs settings preserve duration rules and live state")
        c["Slots"].Value := "1`n2`n3`n4`n5`n6`n7`n8`n9"
        V48Assert(!IUXHotsSave() && IEFU.Columns=4,"invalid ninth slot rejected")
        IEFOpenOptions(),V48Assert(!IEFU.Controls["Durations"].Visible,"raw duration rules hidden initially")
        IUXAdvancedToggle(IEFU.Gui,true),V48Assert(IEFU.Controls["Durations"].Visible,"advanced rules still available")
    }
    finally IUXHotsClose()
}
V7845CleanMenus() => V7839Fixture(V7845CleanMenusCase)
V7845CleanMenusCase()
{
    global IC,IPM,BackgroundLogCheckbox,AutoBossProfileCheckbox
    IPWBuild(),u := IPWState()
    V48Assert(V779MenuHas(u.SettingsMenu,"Technical") && V779MenuHas(u.SettingsMenu,"Experimental"),"technical and unfinished tools have distinct homes")
    V48Assert(!V779MenuHas(u.InterfaceMenu,"Boss tracking...") && V779MenuHas(u.InterfaceMenu,"Raid HoTs options..."),"ordinary overlays retain HoTs without technical tracking")
    V48Assert(BackgroundLogCheckbox.Gui=IC.Pages["Voice"].Gui && AutoBossProfileCheckbox.Gui=IC.Pages["Boss"].Gui,"normal audio and automatic detection remain primary")
    for group in IDPToolGroups("progress")
        for row in group.Rows
            V48Assert(row[2]!=IGPCOpen && row[2]!=IGMOpenFromProgression && row[2]!=ITSOpen && row[2]!=ITCOpen,"duplicate and experimental tools absent from primary progress panel")
    IPM.Mode := 2,IIFSyncMenus()
    V48Assert(V652TimerMenuState(u.InterfaceMenu,"Next overlay tab") & 3,"next overlay tab disabled in separate mode")
}

V7848Reports()
{
    global IP
    s := IBRState(),root := A_ScriptDir "\beta-fixture-" A_TickCount
    V48Assert(!s.View && !IBRStart(),"isolated workers do not open real diagnostics")
    savedIP := IP
    try {
        V48Assert(IBRStart(root),"private beta journal opens")
        path := s.Path
        IP := IPNewApp(),IP.Live := IPNewData("Secret Character C:\Users\Private")
        IP.Actor := "@Private Character#999",IP.ImportPath := "C:\Users\Private\combat.txt"
        IP.Live.SourceKey := "private source",IP.Live.Parsed := 321,IP.Live.Lines := 400
        IBRTick()
        for prior in [0,7,100,-1] {
            saved := Critical(prior),before := A_IsCritical
            IBRAction(5,3)
            V48Assert(before=A_IsCritical,"beta action preserves scheduling")
            Critical(saved)
        }
        loop 300
            IBRAction(7,A_Index)
        IBRAction(999,"private"),IBRAction(6,"@Private Player"),data := IBRRead(path)
        V48Assert(data.Rows.Length=256 && data.Rows[-1].Value=-1 && FileGetSize(path)=16384,"bounded numeric-only ring wraps")
        V48Assert(data.Rows[-2].Value=300 && data.Rows[1].Seq=data.Last-255,"retained actions remain ordered")
        text := IBRReport(root)
        V48Assert(InStr(text,"Parsed: 321") && !InStr(text,"Some state fields"),"snapshot captures real scalar counters")
        for forbidden in ["Private Character","@Private","private source","C:\Users",root]
            V48Assert(!InStr(text,forbidden),"automatic diagnostics exclude private values")
        err := Error("Access is denied: C:\Users\Private\SECRET.txt @Private Player")
        V48Assert(IBROnError(err)=0,"observer never suppresses errors")
        data := IBRRead(path)
        V48Assert(InStr(data.Error,"Access is denied") && !InStr(data.Error,"SECRET") && !InStr(data.Error,"C:\"),"error stores category and code location only")
        V48Assert(IBRPrevious(root)="" && IBRAlive(data),"active instance is not an unexpected prior exit")
        IBRStop(),data := IBRRead(path)
        V48Assert(data.Normal=1 && !s.View && !s.Mapping,"clean shutdown closes mapping")
        IBRStop()
        f := FileOpen(path,"rw"),f.Pos := 48,f.WriteUInt(0),f.Pos := 16,f.WriteUInt(0xFFFFFFFE),f.Close()
        V48Assert(IBRPrevious(root)=path,"terminated process is offered once")
        IBRSeen(path),V48Assert(IBRPrevious(root)="","acknowledged exit is not offered again")
        data := IBRRead(path),data.Pid := DllCall("GetCurrentProcessId","UInt"),data.Birth := 1
        V48Assert(!IBRAlive(data),"PID reuse cannot hide an old exit")
        bad := root "\bad.bin",FileAppend("bad",bad)
        V64Reject((*)=>IBRRead(bad),"corrupt journal rejected")
        V48Assert(!IBRStart(bad) && !s.View,"unwritable location does not break parsing")
        loop 10 {
            old := root "\iris-beta-20200101000000-" A_Index "-1.bin"
            FileCopy(path,old)
        }
        IBRPrune(root),V48Assert(IBRPaths(root).Length=8,"retention stays at eight completed/dead journals")
        IBRZip(A_ScriptDir "\beta-default.zip",[{Name:"report.txt",Text:text}])
        log := root "\selected.txt",FileAppend("private log deliberately attached`n" log,log,"UTF-8-RAW")
        IBRZip(A_ScriptDir "\beta-attached.zip",[{Name:"report.txt",Text:text},{Name:"attached-combat-log.txt",Path:log},{Name:"user-note.txt",Text:"é test note"}])
        IBRZip(A_ScriptDir "\beta-empty.zip",[{Name:"report.txt",Text:""}])
        big := root "\large.txt",f := FileOpen(big,"w"),f.Length := 3000000,f.Close()
        canceled := root "\cancel.zip",FileAppend("keep existing",canceled)
        V64Reject((*)=>IBRZip(canceled,[{Name:"attached-combat-log.txt",Path:big}],(*)=>V7848CancelZip()),"large attachment cancellation propagates")
        V48Assert(FileRead(canceled)="keep existing","cancel preserves existing destination")
        count := 0
        loop files canceled ".iris-partial-*","F"
            count += 1
        V48Assert(count=0,"cancel removes only temporary archive")
        g := IBROpen(),V48Assert(IsObject(g) && !s.Attach.Value && s.Note.Value="","report dialog starts without optional user data")
        IBRClose(),V48Assert(!IsObject(s.Gui),"report dialog closes without affecting parser")
    }
    finally {
        IBRStop(),IBRClose(),IP := savedIP
        if InStr(root,A_ScriptDir "\beta-fixture-")=1
            DirDelete(root,true)
    }
}
V7848CancelZip()
{
    throw Error("Cancel fixture")
}
V7848TimerSamples() => V65UITimerIsolated(V7848TimerSamplesCase)
V7848TimerSamplesCase(*)
{
    global IPM,IRTPrefs,IRT
    original := IPM.PreviewCount,oldSnapshot := IPM.PreviewSnapshot
    try {
        IRT.Enabled := false,IRTPrefs.ShowBars := false,IRTPrefs.ShowWarnings := false
        before := IRT.Active.Count
        IPM.PreviewCount := 8,IPM.PreviewSnapshot := IPMCreateRaidPreview(8)
        snap := IRTUSnapshot(IRT,1000,IRTPrefs),later := IRTUSnapshot(IRT,999999,IRTPrefs)
        V48Assert(snap.Preview && snap.LayoutSample && snap.Rows.Length=3,"raid samples include timer bars")
        V48Assert(snap.Rows[1].Remaining=later.Rows[1].Remaining && later.Alert!="","sample remains visible for screenshots")
        vis := IRTUOverlayVisibility(IPM,IRTPrefs,IRT,snap,false)
        V48Assert(vis.Bars && vis.Warning,"samples visible without enabling live timers")
        IRTURender(IRT,1000)
        V48Assert(IRTPrefs.LastError="" && IsObject(IRTPrefs.BarsGui),"native sample timer window renders")
        V48Assert(!IRT.Enabled && !IRTPrefs.ShowBars && !IRTPrefs.ShowWarnings && IRT.Active.Count=before,"samples do not change rules or settings")
        IPMPreviewClear(IPM),snap := IRTUSnapshot(IRT,2000,IRTPrefs)
        V48Assert(!snap.Preview && !snap.Rows.Length,"ending preview restores actual timers")
        IRTURender(IRT,2000)
        V48Assert(!IRTPrefs.BarsShown && !IRTPrefs.AlertShown,"sample windows disappear after preview ends")
    }
    finally IPM.PreviewCount := original,IPM.PreviewSnapshot := oldSnapshot
}

V7849PreviewFill() => V65UITimerIsolated(V7849PreviewFillCase)

V7849SavedFixture(name := "Recorded DPS",amount := 1000)
{
    s := IPNewData("Saved fixture"),boss := "Training Example {990000000000001}:1|(0,0,0,0)|(90000/100000)"
    IPFeedLine(s,IPDemoLine(3600000,"@" name "#102","=","Enter"))
    loop 10
        IPFeedLine(s,IPDemoLine(3600000+A_Index*1000,"@" name "#102",boss,"Damage",amount))
    IPCloseSegment(s,"fixture complete"),s.Finished := true
    return s
}

V7849PreviewFillCase(*)
{
    global IP,IPM,IRT,IRTPrefs,IEF,IEFU,IRU,IRUU,IRN,IRNU,IZP
    saved := {IP:IP,IEF:IEF,IEFU:IEFU,IRU:IRU,IRUU:IRUU,IRN:IRN,IRNU:IRNU,IZP:IZP,Enemies:IENState().Actors}
    try {
        IP := IPNewApp(),IEF := IEFNewState(),IEFU := IEFUNewState(),IRU := IRUNewState(),IRUU := IRUUNewState()
        IRN := IRNNewState(),IRNU := IRNUNewState(),IZP := IZP.Clone(),IZP.Active := false
        IENState().Actors := Map(),IPM.Enabled := true,IPM.Mode := 2,IPM.Shown["Damage"] := true
        IPM.Source := 1,IP.View := "Imported",IP.Head := 1
        V48Assert(IPMPreviewSet(8),"preview starts without a loaded fight")
        snap := IPMOverlaySnapshot(IP,IPM)
        for kind in ["Personal","Damage","Heal","Taken","Threat","BossHP","Challenges","RunTimer","Effects","HealerGrid","RaidNotes","RaidUtility","EnemyDebuffs","BossMechanics"]
            V48Assert(IPMPreviewPanel(kind,snap).LayoutPreview,"empty window gets labeled sample: " kind)
        IP.Offline := V7849SavedFixture(),IP.Selected := 1,IP.Actor := "@Recorded DPS#102"
        original := IP.Offline,seg := original.Segments[1],totals := V7849TotalStamp(seg)
        snap := IPMOverlaySnapshot(IP,IPM)
        V48Assert(snap.Id=seg.Id && snap.Actors.Length=1 && snap.Actors[1].Damage=10000,"loaded selection takes precedence over empty latest-live display source")
        V48Assert(snap.PreviewSelected && IPM.Source=1,"preview routing leaves the saved source preference alone")
        for kind in ["Personal","Damage","Heal","Taken","Threat"]
            V48Assert(IPMPreviewPanel(kind,snap)=snap,"recorded metric including zeros stays intact: " kind)
        p := IPM.Panels["Damage"],IPMEnsureGui("Damage",0,p),IPMRender("Damage",snap,p)
        V48Assert(p.VisibleRows=1 && p.Rows[1].Name.Text="Recorded DPS" && !InStr(p.Heading.Text,"PREVIEW"),"native meter displays recorded roster without sample names")
        personal := IPM.Panels["Personal"],IPMEnsureGui("Personal",0,personal),IPMRender("Personal",snap,personal)
        V48Assert(personal.Meta.Text="Recorded DPS","personal panel follows selected player even if saved source preference is latest-live")
        heal := IPM.Panels["Heal"],IPMEnsureGui("Heal",0,heal),IPMRender("Heal",snap,heal)
        V48Assert(heal.VisibleRows=0 && !InStr(heal.Heading.Text,"PREVIEW"),"recorded zero healing never becomes invented healing")
        p.Width := 400,IPM.LastSnapshot := snap,IPMRender("Damage",IPM.LastSnapshot,p)
        V48Assert(p.VisibleRows=1 && p.Rows[1].Name.Text="Recorded DPS","resize reuses actual selected data")
        IPMPreviewSet(16),snap := IPMOverlaySnapshot(IP,IPM),IPMRender("Damage",snap,p)
        V48Assert(p.VisibleRows=1 && snap.Actors.Length=1,"16-player preview never pads an actual roster")
        IRT.Enabled := false
        timer := IRTUSnapshot(IRT,1000,IRTPrefs)
        V48Assert(timer.LayoutSample && timer.Rows.Length=3,"sample timers coexist with actual saved meters")
        for kind in ["Challenges","FightFeedback","Achievements","BossMechanics"]
            V48Assert(IPMPreviewPanel(kind,snap)=IPM.PreviewSnapshot,"explicit preview supplies encounter samples with a saved fight: " kind)
        snap.Challenges.Available := true,snap.Challenges.Rows := []
        V48Assert(IPMPreviewPanel("Challenges",snap)=IPM.PreviewSnapshot && !snap.Challenges.Rows.Length,"challenge preview leaves recorded empty scores intact")
        snap.Raid.Health := [{Name:"Recorded boss",Known:true,Current:0,Maximum:100,Percent:0,Stale:false}]
        V48Assert(IPMPreviewPanel("BossHP",snap)=IPM.PreviewSnapshot && snap.Raid.Health[1].Current=0,"explicit merged HP preview preserves the recorded dead boss in its source")
        IEFU.Notes["general"] := "Our assignments",notes := IPM.Panels["RaidNotes"]
        IPMEnsureGui("RaidNotes",0,notes),IPMRender("RaidNotes",snap,notes)
        V48Assert(notes.Empty.Text="Our assignments" && !InStr(notes.Heading.Text,"PREVIEW"),"existing notes survive layout preview")
        IEF := IEFPreviewState()
        for kind in ["Effects","HealerGrid"] {
            V48Assert(IPMPreviewPanel(kind,snap)=snap,"observed state wins over sample: " kind)
            panel := IPM.Panels[kind],IPMEnsureGui(kind,0,panel),IPMRender(kind,snap,panel)
            V48Assert(!InStr(panel.Heading.Text,"PREVIEW"),"native observed panel stays real: " kind)
        }
        IEF := IEFNewState(),IEFU.Slots := "Assigned healer"
        V48Assert(IPMPreviewPanel("HealerGrid",snap).LayoutPreview && IEFU.Slots="Assigned healer","configured slots stay saved while empty grid gets samples")
        V67UtilityMeta(IRU,1000,"@Observed healer#1","Corruption"),IZP.Active := true
        for kind in ["RaidUtility"]
            V48Assert(IPMPreviewPanel(kind,snap)=snap,"retained observer is not replaced: " kind)
        V48Assert(IPMPreviewPanel("BossMechanics",snap)=IPM.PreviewSnapshot && IZP.Active,"explicit mechanics example does not change retained observer")
        IRNStart(IRN,"gods",IRNUtcMs(),ClockMs()),deadline := IRN.DeadlineUtc
        V48Assert(IPMPreviewPanel("RunTimer",snap)=snap && IRN.DeadlineUtc=deadline,"actual raid run is preserved")
        runPanel := IPM.Panels["RunTimer"],IPMEnsureGui("RunTimer",0,runPanel),IPMRender("RunTimer",snap,runPanel)
        V48Assert(runPanel.Heading.Text="Time remaining in raid","native raid run keeps actual display")
        IRT := V65UITimerFixture(),timer := IRTUSnapshot(IRT,1000,IRTPrefs)
        V48Assert(!timer.Preview && timer.Rows.Length=2 && timer.Rows[1].Remaining=3000,"actual active timers take priority without clock changes")
        selected := IRTUSelectedPreview(IRT.Definitions[1],1000,5)
        IRTPrefs.SelectedPreview := selected.Preview
        timer := IRTUSnapshot(IRT,1000,IRTPrefs)
        V48Assert(timer.Preview && timer.Rows.Length=1 && timer.Rows[1].Name=selected.Preview.Name,"explicit selected timer preview is not replaced by generic samples")
        IRTPrefs.SelectedPreview := "",IRT.Active.Clear(),IRT.Alerts := []
        V48Assert(IRTUSnapshot(IRT,1000,IRTPrefs).LayoutSample,"empty timer window falls back to samples")
        IP.Offline := V7849SavedFixture("Second pull",2000),IP.Actor := "@Second pull#102"
        snap := IPMOverlaySnapshot(IP,IPM),IPMRender("Damage",snap,p)
        V48Assert(p.Rows[1].Name.Text="Second pull" && snap.Actors[1].Damage=20000,"changing selected saved data updates preview meters")
        V48Assert(V7849TotalStamp(seg)=totals && original.Segments.Length=1,"preview never adds actors or writes totals to the loaded log")
        IPM.Source := 3,IPMEndRaidPreview(),snap := IPMOverlaySnapshot(IP,IPM)
        V48Assert(!IPMPreviewActive(IPM) && !snap.HasOwnProp("PreviewFill") && snap.Actors[1].Damage=20000,"stopping removes only sample behavior")
        V48Assert(!IRTUSnapshot(IRT,1000,IRTPrefs).Preview,"timer samples stop with layout preview")
        IP.Active := true
        V48Assert(!IPMPreviewSet(8),"active parser remains protected from preview")
        V7849EncounterPreviewCase()
    }
    finally {
        IPMPreviewClear(IPM),IPMDestroyPanels()
        IP := saved.IP,IEF := saved.IEF,IEFU := saved.IEFU,IRU := saved.IRU,IRUU := saved.IRUU,IRN := saved.IRN,IRNU := saved.IRNU,IZP := saved.IZP
        IENState().Actors := saved.Enemies
    }
}

V7849EncounterPreviewCase()
{
    global IP,IPM
    IP := IPNewApp(),IP.Offline := V7849SavedFixture(),IP.View := "Imported",IP.Selected := 1,IP.Follow := false
    IPM.Source := 2,IPM.Enabled := true,IPM.DesktopPreview := true,IPM.Editing := true
    original := IP.Offline,stamp := V7849TotalStamp(original.Segments[1])
    kinds := ["FightFeedback","Achievements","Challenges","BossMechanics"]
    for count in [8,16] {
        IPMPreviewClear(IPM),snap := IPMOverlaySnapshot(IP,IPM)
        for kind in kinds {
            p := IPM.Panels[kind],IPMEnsureGui(kind,0,p),IPMRender(kind,snap,p)
            V48Assert(!InStr(p.Heading.Text,"PREVIEW") && p.VisibleRows=0,"desktop visibility/unlocking does not create samples: " kind)
        }
        V48Assert(IPMApplyAndPreview(count),"actual Preview button handler starts examples over saved log")
        snap := IPMOverlaySnapshot(IP,IPM),stale := IPM.PreviewSnapshot
        for kind in kinds {
            p := IPM.Panels[kind],IPMRender(kind,snap,p)
            V48Assert(InStr(p.Heading.Text,"PREVIEW") && p.VisibleRows>0,"button renders native example for " kind)
        }
        V48Assert(IPM.Panels["BossMechanics"].Rows[1].Value.Text="~45%","mechanics preview shows sample shield")
        V48Assert(IPM.Panels["Achievements"].Rows[2].Value.Text="Failed","achievement preview includes failed state")
        IPMEndRaidPreview()
        for kind in kinds {
            p := IPM.Panels[kind],IPMRender(kind,stale,p)
            V48Assert(!InStr(p.Heading.Text,"PREVIEW") && p.VisibleRows=0,"ended preview cannot leak through cached sample snapshot: " kind)
        }
        V48Assert(IP.Offline=original && V7849TotalStamp(original.Segments[1])=stamp,"preview preserves loaded log and stats")
    }
    V48Assert(IPMPreviewSet(8),"preview starts for parser handoff test")
    IP.Active := true,IP.Live := V7878FHSegment("Other").Data
    for kind in kinds {
        p := IPM.Panels[kind],IPMRender(kind,IPM.PreviewSnapshot,p)
        V48Assert(!InStr(p.Heading.Text,"PREVIEW") && p.VisibleRows=0,"live parser rejects sample before next poll clears it: " kind)
    }
    IP.Active := false,IPMPreviewClear(IPM)
    xr := V7878XFFixture(V7875XRFixture()),IP.Offline := xr.Data
    V48Assert(IPMPreviewSet(8),"preview starts over supported XR saved fight")
    snap := IPMOverlaySnapshot(IP,IPM)
    for kind in kinds {
        p := IPM.Panels[kind],IPMRender(kind,snap,p)
        V48Assert(InStr(p.Heading.Text,"PREVIEW") && p.VisibleRows>0,"explicit button also previews supported fight: " kind)
    }
    IPMEndRaidPreview(),p := IPM.Panels["Achievements"],IPMRender("Achievements",IPMOverlaySnapshot(IP,IPM),p)
    V48Assert(p.Heading.Text="Special achievements" && p.VisibleRows=3 && !InStr(p.Meta.Text,"Your character"),"stop restores recorded XR achievement results")
}

V7849TotalStamp(seg)
{
    text := seg.Actors.Count ":" seg.Totals.Count
    for key,t in seg.Totals {
        text .= "|" key
        for field in ["Damage","Heal","Taken","Received","Deaths","Effective","HealKnown","HealRecords"]
            text .= ":" t.%field%
    }
    return text
}

; Synthetic diagnostics: no live callout tracking, assignments, audio or settings.
V7850Fixture(boss := "G-AE",at := 40000)
{
    f := V647BossFixture(),f.Seg.BossKey := boss,f.Pull.Boss := boss,f.Pull.End := at
    f.Seg.AreaId := f.Pull.Area,f.Seg.ModeId := f.Pull.Mode
    f.Recap.At := at,f.Recap.From := at-12000
    return f
}
V7850NPC(id,hp := 800,max := 1000,instance := 1) => "NPC {" id "}:" instance "|(" hp "/" max ")"
V7850Event(f,at,src,dst,ability,kind := "Damage",count := 0,effect := "")
{
    action := kind="Remove" ? "836045448945478" : kind="Stack" ? "836045448953666" : kind="Damage" || kind="Apply" || kind="Heal" ? "836045448945477" : "836045448945472"
    eid := effect!="" ? effect : kind="Damage" ? "836045448945501" : kind="Activate" ? "836045448945479" : kind="Death" ? "836045448945493" : kind="Interrupt" ? "836045448945482" : kind="Heal" ? "836045448945500" : ability
    tail := kind="Stack" ? "(" count " charges {836045448953667})" : kind="Damage" || kind="Heal" ? "(" count ")" : ""
    return V647BossFeed(f,at,src,dst,ability,action,eid,tail)
}
V7850Text(f)
{
    IBCFreeze(f.Seg,f.Recap)
    return IBCCheck(f.Pull,f.Recap).Text
}
V7850Role(f,at,key,role)
{
    ev := IPParseLine("[00:00:00.000] [" key "] [=] [] [Event {836045448945472}: TargetSet {836045448953668}]")
    ev.RecordId := f.Next,f.Next += 1,ev.DisplayRole := role
    IBCObserve(f.Seg,ev,at)
}
V7850Sisters()
{
    f := V7850Fixture(),a := V7850NPC("4088525397950464"),b := V7850NPC("4088538282852352"),glare := V7850NPC("4109914335084544")
    V7850Role(f,0,"@Healer#1",4),V7850Role(f,0,"@DPS#1",2)
    V7850Event(f,5000,"@Healer#1","=","4114162057740288","Stack",20,"4114162057740686")
    V7850Event(f,12000,"@Healer#1","=","4114162057740288","Stack",53,"4114162057740686")
    V7850Event(f,14000,"@DPS#1","=","4114162057740288","Stack",80,"4114162057740686")
    V7850Event(f,15000,a,"@Beam#1","4109583622602752","Stack",4,"4109583622603019")
    V7850Event(f,16000,b,"@Beam#1","4109587917570048","Stack",3,"4109587917570315")
    V7850Event(f,17000,a,"@Split#1","4109583622602752","Stack",2,"4109583622603019")
    V7850Event(f,17001,b,"@Split#1","4109587917570048","Stack",2,"4109587917570315")
    V7850Event(f,20000,"@Beam#1","=","4116197872238592","Apply",0,"4116197872238858")
    V7850Event(f,38000,glare,"=","4111258659848192","Apply",0,"4111258659848484")
    V7850Event(f,39000,glare,"@Beam#1","4110403961356288","Damage",100000)
    V7850Event(f,39500,glare,"@Beam#1","4110403961356288","Damage",120000)
    V7850Event(f,39600,glare,"@Other#1","4110403961356288","Damage",50000)
    text := V7850Text(f)
    V48Assert(InStr(text,"Healer: peak 53") && !InStr(text,"DPS: peak 80"),"Countermeasure uses observed roles, not healing rank")
    V48Assert(InStr(text,"Radiance (Aivela): peak 4") && !InStr(text,"Split -") && !InStr(text,"Radiance (Esne): peak"),"Radiance threshold keeps polarities separate")
    V48Assert(InStr(text,"220,000 damage, 2 hits; largest 120,000") && InStr(text,"polarity at that hit: positive; Glare: negative"),"Purification totals, hits and observed polarity")
    V48Assert(InStr(text,"Other: 50,000") && InStr(text,"not recorded"),"missing polarity is not a wrong-colour judgment")
    before := text
    V7850Event(f,41000,glare,"@Beam#1","4110403961356288","Damage",999999)
    V48Assert(IBCCheck(f.Pull,f.Recap).Text=before,"a frozen check excludes damage after death")
    blank := V7850Fixture(),V7850Event(blank,39000,V7850NPC("999"),"@Player#1","4110403961356288","Damage",999999)
    V48Assert(InStr(V7850Text(blank),"No Purification damage"),"same ability ID on a wrong NPC is not matched")
    V7850Event(blank,39500,a,"@P#1","4109583622602752","Apply",0,"4109583622603019")
    V48Assert(InStr(V7850Text(blank),"No recorded count reached 4"),"missing charge payload is not invented")
    f := V7850Fixture(),f.Pull.Players := Map("@Healer#1",{RoleMask:4},"@DPS#1",{RoleMask:2})
    V7850Event(f,39000,"@Healer#1","=","4114162057740288","Stack",18,"4114162057740686")
    V7850Event(f,39001,"@DPS#1","=","4114162057740288","Stack",40,"4114162057740686")
    text := V7850Text(f)
    V48Assert(InStr(text,"Healer: peak 18") && !InStr(text,"DPS: peak 40"),"accepted pull roles include metadata before boss recognition")
}
V7850Mechanics()
{
    f := V7850Fixture("G-NA")
    V7850Event(f,39000,"@DPS#1",V7850NPC("4131870207901696",350),"123","Damage",100)
    V48Assert(InStr(V7850Text(f),"35.0%") && InStr(V7850Text(f),"1.0s before death"),"coupling HP retains sample age")
    f.Recap.At := 80000
    V48Assert(InStr(V7850Text(f),"No recent coupling HP"),"stale coupling HP is not current")
    f := V7850Fixture("G-SC"),npc := V7850NPC("4126527268585472")
    V7850Event(f,1000,npc,"=","123","Activate")
    V7850Event(f,3000,V7850NPC("4108140513591296",1000),"=","123","Activate")
    V7850Event(f,38000,"@DPS#1",V7850NPC("4126527268585472",0),"123","Death")
    V48Assert(InStr(V7850Text(f),"died at 38.0s; 37.0s after first observation"),"OPD lifetime is retained beyond the rolling window")
    f := V7850Fixture("G-SC")
    V7850Event(f,38900,"@DPS#1",V7850NPC("4126553038389248",120),"123","Damage",1)
    V7850Event(f,39000,V7850NPC("4126553038389248",0),"@Victim#1","4127205873418504","Damage",100)
    text := V7850Text(f)
    V48Assert(InStr(text,"Catastrophic Reaction") && InStr(text,"12.0%"),"catalyst HP is attached to the actual explosion")
    f := V7850Fixture("G-SC")
    V7850Event(f,39000,V7850NPC("4108140513591296",690),"@Victim#1","4131981877051657","Damage",100)
    V48Assert(InStr(V7850Text(f),"Supercriticality") && !InStr(V7850Text(f),"69.0%") && InStr(V7850Text(f),"Damage shortfall unavailable"),"boss HP is never presented as Ignite shield HP")
    f := V7850Fixture("G-IZ"),izax := V7850NPC("4108097563918336")
    V7850Event(f,30000,izax,"=","4168128321814528","Activate")
    V7850Event(f,31000,izax,"@Marked#1","4168128321814528","Apply")
    V7850Event(f,35000,izax,"@Marked#1","4168128321814528","Apply")
    V7850Event(f,35001,izax,"@Nearby#1","4168128321814528","Damage",100)
    V7850Event(f,35002,izax,"@Nearby#1","4168128321814528","Apply")
    V7850Event(f,36000,izax,"=","4162849807007744","Activate")
    V7850Event(f,37000,"@Kicker#1","","4162849807007744","Interrupt")
    V7850Event(f,37001,"@Overlapping#1","","4162849807007744","Interrupt")
    V7850Event(f,37500,izax,"=","4162849807007744","Activate")
    V7850Event(f,39000,izax,"@Victim#1","4162905641582592","Damage",100)
    text := V7850Text(f)
    V48Assert(InStr(text,"marked Marked; received induction: Nearby") && !InStr(text,"marked Nearby"),"Induction blast does not replace original mark")
    V48Assert(InStr(text,"Kicker") && InStr(text,"Overlapping") && InStr(text,"unique interrupter uncertain") && InStr(text,"charge at 37.5s"),"overlapping interrupt records retained and missing final kick explicit")
    V48Assert(InStr(text,"does not record assigned interrupt turns"),"missing assignment history cannot blame a player")
    f := V7850Fixture("G-IZ"),scyva := V7850NPC("4163751750139904",500)
    V7850Event(f,35000,izax,scyva,"4169245013311488","Stack",3,"4169245013311748")
    V7850Event(f,39000,izax,V7850NPC("4163751750139904",0),"4169245013311488","Damage",500)
    text := V7850Text(f)
    V48Assert(InStr(text,"Friendly Scyva") && InStr(text,"0.0%") && InStr(text,"Adaptive Shrapnel - 3 stacks"),"friendly Scyva zero HP and missile debuff history: " text)
}
V7850Evidence()
{
    f := V7850Fixture(),glare := V7850NPC("4109914335084544")
    V7850Event(f,39000,glare,"@Victim#1","4110403961356288","Damage",100)
    before := V7850Text(f),packed := IBCPackEvidence(f.Recap.BossEvidence)
    restored := IBCUnpackEvidence(IGJParse(IGVJson(packed)),f.Pull,f.Recap)
    V48Assert(IGVJson(IBCPackEvidence(restored))=IGVJson(packed),"new evidence round-trips exactly")
    cloned := IBCCloneEvidence(restored),cloned.Rows[1].Amount := 123
    V48Assert(restored.Rows[1].Amount=100,"cloning isolates frozen row values")
    for change in [1,2,3,4,5,6] {
        bad := IGJParse(IGVJson(packed))
        switch change {
            case 1: bad[6][1][1] := f.Recap.At+1
            case 2: bad[6][1][3] := "unsupported"
            case 3: bad[6][1][13] := 2000,bad[6][1][14] := 1000
            case 4: bad[6].Push(bad[6][1])
            case 5: bad[6][1][8] := "123"
            case 6: bad[6][1][4] := "N:999:1:Wrong NPC"
        }
        caught := false
        try IBCUnpackEvidence(bad,f.Pull,f.Recap)
        catch ValueError
            caught := true
        V48Assert(caught,"malformed/out-of-window/duplicate evidence rejected " change)
    }
    id := IDTCaseKey(f.Recap),f.Seg.DeathCapture.Cases[id] := f.Recap
    V7850Event(f,39500,glare,"@Victim#1","4110403961356288","Damage",200)
    copy := f.Seg.DeathCapture.Cases[id]
    V48Assert(InStr(IBCCheck(f.Pull,copy).Text,"300 damage, 2 hits") && IBCCheck(f.Pull,f.Recap).Text=before,"accepted late rows replace rather than mutate frozen recaps")
    f := V7850Fixture(),IPBBeginUndo(f.Data,f.Seg)
    V7850Event(f,39000,glare,"@Victim#1","4110403961356288","Damage",100)
    IPBRollbackTail(f.Data,f.Seg)
    V48Assert(InStr(V7850Text(f),"No Purification damage"),"boundary rollback removes speculative mechanic evidence")
    f := V7850Fixture(),state := IBCState(f.Seg)
    row := IGCRow(V7850Event(f,39000,glare,"@Victim#1","4110403961356288","Damage",1),39000,"purification")
    Loop 8200 {
        r := row.Clone(),r.Record := A_Index,state.Rows[IGCKey(r)] := r
    }
    IGCTrim(f.Seg,state,39000)
    V48Assert(state.Rows.Count<=8192 && InStr(V7850Text(f),"incomplete"),"bounded journal marks dropped evidence partial")
    f := V7850Fixture("G-IZ"),izax := V7850NPC("4108097563918336")
    V7850Event(f,7000,izax,"=","4168128321814528","Activate")
    V7850Event(f,7100,izax,"@Marked#1","4168128321814528","Apply")
    V7850Event(f,12000,izax,"@Nearby#1","4168128321814528","Apply")
    V7850Event(f,39900,izax,"=","123","Activate")
    V48Assert(InStr(V7850Text(f),"marked Marked; received induction: Nearby"),"Induction association survives the left edge of the 30-second window")
}
V7850Isolation()
{
    for boss in ["G-AE","G-NA","G-SC","G-IZ"] {
        f := V7850Fixture(boss),legacy := f.Recap.Clone()
        V48Assert(IBCCheck(f.Pull,legacy).Applicable && InStr(IBCCheck(f.Pull,legacy).Text,"Re-add"),"legacy " boss " retains recovery guidance")
    }
    f := V7850Fixture("DF-BR")
    V7850Event(f,39000,V7850NPC("4109914335084544"),"@Victim#1","4110403961356288","Damage",100)
    V48Assert(!f.Seg.HasOwnProp("BossCheckState") && !IBCCheck(f.Pull,f.Recap).Applicable,"other operations have no new observer")
    V61Hidden(V7850HiddenCase)
}
V7850HiddenCase()
{
    try {
        p := V647BossUIPull(false),p.Boss := "G-AE",IDTOpen(p),d := IDTState()
        V48Assert(IPWState().Controls["DeathBoss"].Enabled && IDTBossOpen(),"Sisters native Boss check button and popup")
        V48Assert(InStr(d.BossPopupControls["Details"].Value,"Re-add"),"native popup reports missing legacy context")
    }
    finally IDTShutdown()
}

; Isolated raw-record regressions. No live audio, UI, log files or saved settings.
V7852Absorb(f,at,raw,absorbed,instance := 1,source := "@DPS#1")
{
    return V647BossFeed(f,at,source,V7850NPC("4108140513591296",26000000,26373952,instance),"123",
        "836045448945477","836045448945501","(" raw " ~0 elemental {836045448940875} (" absorbed " absorbed {836045448945511}))")
}
V7852Field(f,at := 20000,kind := "Apply",instance := 1)
{
    return V7850Event(f,at,V7850NPC("4108140513591296",26000000,26373952,instance),"=","4127300362698752",kind)
}
V7852Failure(f,at := 39000)
{
    return V7850Event(f,at,V7850NPC("4108140513591296",26000000,26373952),"@Victim#1","4131981877051657","Damage",999999)
}
V7852IgniteShortfall()
{
    f := V7850Fixture("G-SC"),V7852Field(f)
    V7852Absorb(f,25000,2400000,2100000),V7852Absorb(f,26000,500000,100000)
    V7852Absorb(f,27000,1000000,1000000,2),V7852Failure(f)
    text := V7850Text(f)
    V48Assert(InStr(text,"approximately 290,000 damage short"),"explicit absorbs and target instance determine the deficit, not raw damage: " text)
    V48Assert(!InStr(text,"Logged damage") && !InStr(text,"26,000,000"),"Boss check omits redundant raw damage and unrelated boss HP")
    packed := IBCPackEvidence(f.Recap.BossEvidence),copy := f.Recap.Clone()
    copy.BossEvidence := IBCUnpackEvidence(IGJParse(IGVJson(packed)),f.Pull,f.Recap)
    V48Assert(IBCCheck(f.Pull,copy).Text=text,"new fields and absorbed amounts survive the saved recap round trip")
    before := text,id := IDTCaseKey(f.Recap),f.Seg.DeathCapture.Cases[id] := f.Recap
    V7852Absorb(f,38000,100000,100000)
    newer := f.Seg.DeathCapture.Cases[id]
    V48Assert(InStr(IBCCheck(f.Pull,newer).Text,"approximately 190,000 damage short"),"late delivery of an older hit updates the frozen recap")
    V48Assert(IBCCheck(f.Pull,f.Recap).Text=before,"late update does not mutate a previously frozen recap")
    V7852Absorb(f,39500,900000,900000)
    V48Assert(InStr(V7850Text(f),"approximately 190,000 damage short"),"post-failure damage cannot satisfy the check")
    V7852Field(f,39600,"Remove")
    V48Assert(InStr(V7850Text(f),"approximately 190,000 damage short"),"post-failure shield removal cannot erase the earlier shortfall")
    f := V7850Fixture("G-SC"),V7852Field(f),V7852Absorb(f,25000,2000000,2000000)
    V7852Field(f,38000,"Remove"),V7852Failure(f)
    V48Assert(InStr(V7850Text(f),"removed before Supercriticality") && !InStr(V7850Text(f),"490,000"),"recorded shield removal prevents a false deficit from delayed damage results")
    f := V7850Fixture("G-SC"),V7852Field(f),V7852Absorb(f,25000,2489892,2489892),V7852Failure(f)
    V48Assert(InStr(V7850Text(f),"less than 1,000 damage short"),"near-capacity result does not claim precise shield HP")
    f := V7850Fixture("G-SC"),V7852Field(f),V7852Absorb(f,25000,2600000,2600000),V7852Failure(f)
    V48Assert(InStr(V7850Text(f),"Estimated damage shortfall: 0") && !InStr(V7850Text(f),"-110,000"),"over-threshold evidence cannot produce a negative deficit or certify removal")
}
V7852IgniteBoundaries()
{
    f := V7850Fixture("G-SC"),V7852Field(f),V7852Failure(f)
    V48Assert(InStr(V7850Text(f),"approximately 2,490,000 damage short"),"recorded field with no absorbed damage retains the full check")
    f.Pull.Mode := "836045448953652"
    V48Assert(InStr(V7850Text(f),"applies to 8-player Master"),"capacity is not applied to other modes")
    f.Pull.Mode := "836045448953655",f.Seg.Partial := true
    V48Assert(InStr(V7850Text(f),"incomplete Ignite evidence"),"known partial evidence cannot invent a complete deficit")
    f := V7850Fixture("G-SC"),V7852Field(f,5000),V7852Failure(f)
    V48Assert(InStr(V7850Text(f),"Damage shortfall unavailable"),"an expired start cannot turn a partial window into a full estimate")
    f := V7850Fixture("G-SC")
    V7850Event(f,20000,V7850NPC("4108140513591296"),"=","4127300362698752","Activate"),V7852Failure(f)
    V48Assert(InStr(V7850Text(f),"Re-add older logs"),"old evidence with only activation/raw damage is not reinterpreted as absorbed damage")
    f := V7850Fixture("G-SC"),V7852Field(f),V7852Absorb(f,21000,1000000,1000000)
    V7852Field(f,22000,"Remove"),V7852Field(f,30000),V7852Absorb(f,31000,400000,400000),V7852Failure(f)
    V48Assert(InStr(V7850Text(f),"approximately 2,090,000 damage short"),"a fresh field resets the budget and old removal")
    f := V7850Fixture("G-SC"),V7852Field(f),IPBBeginUndo(f.Data,f.Seg)
    V7852Absorb(f,25000,2000000,2000000),IPBRollbackTail(f.Data,f.Seg),V7852Failure(f)
    V48Assert(InStr(V7850Text(f),"approximately 2,490,000 damage short"),"boundary rollback removes speculative shield damage")
}

V7852NahutBoss(hp := 9000,instance := 1) => "NAHUT {4122949560827904}:" instance "|(-414,2600,206,0)|(" hp "/10000)"
V7852NahutBase()
{
    s := IPNewData("Private Nahut fixture"),s.AreaId := "833571547775765",s.ModeId := "836045448953655"
    V7717Feed(s,1000,"Enter",0,V7717Player(1),"=")
    Loop 8
        V7717Feed(s,1100+A_Index,"Damage",100,V7717Player(A_Index),V7852NahutBoss())
    return s
}
V7852NahutDead(s,count := 8)
{
    Loop count
        V7717Feed(s,2000+A_Index,"Death",0,V7852NahutBoss(),V7717Player(A_Index,0))
}
V7852NahutTiming() => V75LibraryRun(V7852NahutTimingCase)
V7852NahutTimingCase()
{
    s := V7852NahutBase(),seg := s.Current,V7852NahutDead(s)
    V7717Feed(s,2100,"Heal",300,V7717Player(1,0),V7717Player(2,0))
    V7717Respawn(s)
    V48Assert(!IsObject(s.Current) && seg.End=2008 && seg.WipeEnded && !seg.Partial,"eight deaths and entrance respawn stop Nahut without an Exit record")
    V48Assert(seg.Totals[IPActor(V7717Player(1)).Key].Heal=0,"recovery healing does not inflate Nahut totals or timer")
    V7717Feed(s,18000,"Heal",100,V7717Player(1),"=")
    V48Assert(seg.End=2008 && !IsObject(s.Current),"run-back leaves the finished timer fixed")
    V7717Feed(s,20000,"Enter",0,V7717Player(1),"=")
    V7717Feed(s,22000,"Damage",100,V7717Player(1),V7852NahutBoss(8000,2))
    V48Assert(s.Segments.Length=2 && s.Current.Start=20000 && !s.Current.Partial,"next Nahut pull starts at the new entry without inheriting false partial status")
    for variant in ["battle-rez","one-alive","wrong-mode","wrong-area","no-position"] {
        s := V7852NahutBase(),seg := s.Current,V7852NahutDead(s,variant="one-alive" ? 7 : 8)
        if variant="wrong-mode"
            s.ModeId := "836045448953652"
        if variant="wrong-area"
            s.AreaId := "elsewhere"
        if variant="no-position"
            V7717Other(s,2200,"@Tyth Test 1#1|(1000/1000)","=","836045448945494")
        else
            V7717Respawn(s,2200,1,variant="battle-rez" ? "-414,2600,206,0" : "63.84,1553.43,229.61,0")
        V48Assert(s.Current=seg && seg.End<0,"missing death, battle rez or unsupported scope cannot close Nahut")
    }
}
V7852NahutShieldReset()
{
    s := V7852NahutBase(),seg := s.Current,V7852NahutDead(s)
    ev := IPParseLine("[00:00:12.000] [" V7717Player(1) "] [" V7852NahutBoss(10000,2) "] [] [Event {836045448945472}: TargetSet {836045448953668}]")
    V48Assert(IPBReentryEvidence(seg,ev)=-1,"fresh full-health Nahut can prove reset before shielded damage gets through")
    ev.TargetHP.Known := false
    V48Assert(IPBReentryEvidence(seg,ev)=0,"missing HP alone does not prove reset")
    ev.TargetHP.Known := true,ev.TargetHP.Current := 8000
    V48Assert(IPBReentryEvidence(seg,ev)=0,"new injured metadata alone remains unresolved")
    ev.Target := IPActor(V7852NahutBoss()),ev.TargetHP.Current := 9000
    V48Assert(IPBReentryEvidence(seg,ev)=1,"same living Nahut instance retains combat resurrection continuity")
}
V7852NahutCouplings()
{
    s := V6415CData(),s.AnalysisCapture := IACaptureNew(0,10000)
    V66PhaseAdd(s,1000)
    line := "[00:00:02.000] [Power Coupling {4131861617967104}:2|(2251773/2251773)] [@Review#66] [] [Event {836045448945472}: TargetSet {836045448953668}]"
    V66PhaseApplyLine(s,line,2000),V66PhaseAdd(s,3000,"Damage",100,"@Review#66","Power Coupling {4131861617967104}:2")
    d := IAAssemble(s,s.Current,s.AnalysisCapture),p := V66PhaseFind(d,"Couplings")
    V48Assert(IsObject(p) && p.From=2,"observed coupling targeting supplies a phase when the transition cast is missing")
    V48Assert(IRPChoices(s.Current).Length=2 && d.AutomaticPhases.Length=2,"Raid phase choices and accepted Analysis replay agree")
    f := V7850Fixture("G-NA")
    V7850Event(f,39000,"@DPS#1",V7850NPC("4131861617967104",860889,2251773),"123","Damage",100)
    before := V7850Text(f)
    V48Assert(InStr(before,"38.2%") && InStr(before,"860,889 / 2,251,773"),"recent coupling health is retained before death")
    V7850Event(f,41000,V7850NPC("4131861617967104",0,2251773),"=","123","Death")
    V48Assert(IBCCheck(f.Pull,f.Recap).Text=before,"later coupling death or disappearance cannot erase frozen HP")
}

; Exercise real native controls with detached data and private settings.
V7853ChallengeHeader()
{
    V522Isolated(V7853ChallengeHeaderCase)
}

V7853ChallengeHeaderCase()
{
    global IPM,IP
    p := IPM.Panels["Challenges"],snap := V6415ChallengeUISnapshot()
    snap.Challenges.Name := "Ignite Core 1"
    IPMEnsureGui("Challenges",0,p)
    for font in [8,10,18] {
        IPM.Font := font
        for width in [196,320,480] {
            p.Width := width,p.Height := 60,p.AutoHeight := true
            for state in ["Complete","Active","Waiting"] {
                snap.Challenges.State := state,IPMRender("Challenges",snap,p)
                p.Meta.GetPos(&mx,&my,&mw,&mh),p.Scope.GetPos(&sx,&sy,&sw,&sh)
                p.Rows[1].Name.GetPos(&rx,&ry,&rw,&rh)
                V48Assert(p.Meta.Text="Ignite Core 1" && p.Scope.Text=state "   00:10   DPS","name and status remain separate native text controls")
                V48Assert(mx=sx && mw=sw && my+mh<=sy && sy+sh<=ry,"native header lines do not collide with one another or the first player")
                V48Assert((DllCall("User32\GetWindowLongW","Ptr",p.Scope.Hwnd,"Int",-16,"UInt") & 0x3)=0,"status remains left aligned")
                V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int") && !IPM.TimerOn && !IP.Active,"diagnostic remains hidden with parsing and timers off")
            }
        }
    }
}

; Native controls are created on an isolated diagnostic desktop. No live UI.
V7859DeathFeedbackSelection() => V7428DeathsFixture(V7859DeathFeedbackSelectionCase)
V7859DeathFeedbackSelectionCase()
{
    p := V647BossUIPull(),IDTOpen(p),d := IDTState(),c := IPWState().Controls,lv := c["DeathList"]
    V48Assert(d.Selected=1 && lv.GetCount()=2,"fixture has two separate deaths for one player")
    lv.Modify(2,"Select Focus Vis")
    d.Selected := 1,IDTRenderSelected()
    V48Assert(lv.GetNext()=2 && d.Recap.Record=p.Deaths[1].Record,"native selection and cached recap can disagree before the action")
    V48Assert(IDTBossOpen(),"feedback opens for the current native row")
    V48Assert(d.Selected=2 && d.Recap.Record=p.Deaths[2].Record,"feedback resolves the second death rather than the player's first")
    V48Assert(InStr(d.BossPopupControls["Title"].Text,"Death #2") && InStr(d.BossPopupControls["Title"].Text,"0:25.000"),"popup title carries the selected death ordinal and time")
    V48Assert(InStr(StrLower(d.BossPopupControls["Details"].Value),"re-add"),"second death never borrows first death's retained boss evidence")
    IDTDeathClick(lv,1)
    V48Assert(d.Selected=1 && d.Recap.Record=p.Deaths[1].Record,"single click updates the existing recap")
    V48Assert(IDTDeathDouble(lv,2) && d.Selected=2 && lv.GetNext()=2,"double click selects and opens its exact row")
    V48Assert(!IDTDeathDouble(lv,0) && d.Selected=2,"double click in empty space does nothing")
    IDTSelectedDeath(lv,1,true)
    V48Assert(d.Selected=2,"late notification for a previously selected row cannot replace the current selection")
    IDTBossClose(),IDTDeathClick(lv,1)
    V48Assert(!IPMUiHandle(d.BossPopup),"ordinary single click does not open a popup")
}

V7859DeathFilterIdentity() => V7428DeathsFixture(V7859DeathFilterIdentityCase)
V7859DeathFilterIdentityCase()
{
    p := V647BossUIPull(),extra := p.Deaths[1].Clone()
    extra.Key := "@Other#7859",extra.Name := "Other",extra.Record += 1,extra.At += 500
    p.Deaths.Push(extra),p.Players[extra.Key] := p.Players[p.Deaths[1].Key].Clone(),p.Players[extra.Key].Name := "Other"
    IDTOpen(p),d := IDTState(),c := IPWState().Controls,lv := c["DeathList"]
    V48Assert(lv.GetCount()=3 && d.Deaths[3].Record=p.Deaths[2].Record,"mixed-player list places repeated death after another player's death")
    lv.Modify(3,"Select Focus Vis"),d.Selected := 1
    for i,key in d.PlayerKeys {
        if key=p.Deaths[2].Key
            c["DeathPlayer"].Choose(i)
    }
    IDTPlayerChanged()
    V48Assert(lv.GetCount()=2 && d.Selected=2 && d.Recap.Record=p.Deaths[2].Record,"filter preserves death identity while its row number changes")
    c["DeathPlayer"].Choose(1),IDTPlayerChanged()
    V48Assert(lv.GetCount()=3 && d.Selected=3 && d.Recap.Record=p.Deaths[2].Record,"clearing player filter restores the same death among all players")
    IDTRefresh(true)
    V48Assert(d.Selected=3 && d.Recap.Record=p.Deaths[2].Record,"refresh preserves the selected repeat death")
    IDTOpen(p,p.Deaths[2].Key,p.Deaths[2].Record)
    V48Assert(d.Selected=2 && d.Recap.Record=p.Deaths[2].Record,"explicit record navigation still selects the requested death")
    IDTOpen(IDTDemoData()),d := IDTState()
    V48Assert(!IDTDeathDouble(c["DeathList"],2) && d.Selected=2 && !IPMUiHandle(d.BossPopup),"unsupported encounters retain ordinary second-death recap without a feedback popup")
}

; Native diagnostics only: private settings and suspended input, no playback.
V7860ManualCatalogue() => V672LibraryFixture(V7860ManualCatalogueCase)
V7860ManualCatalogueCase()
{
    global BossSounds,TYTH_PROFILE_NAME,TythManualEnabled,AEControls,AUDIO_MODE_KENKU_BRIDGE_TTS
    V48Assert(BossSounds[TYTH_PROFILE_NAME].Count=1 && BossSounds[TYTH_PROFILE_NAME].Has(1),"Tyth only routes the finished add-spawn call")
    V48Assert(TythManualEnabled.Count=1 && TythManualEnabled.Has("Slot1"),"only the active Tyth preference is loaded")
    ids := Map()
    for row in ICLDefinitions()
        ids[row.Id] := row
    V48Assert(ids.Has("manual.TythSlot1") && !ids.Has("manual.TythSlot2") && !ids.Has("manual.TythSlot3"),"library omits unfinished calls")
    V48Assert(ids.Has("manual.AERemote"),"Sisters manual call remains available")
    V48Assert(ids["ae.AERemoteSwap"].Label="Both tanks have Remote Access: swap","tank-swap label names the debuff")
    V48Assert(!InStr(AEControls.Swap.Text,"marked"),"setup does not call Remote Access a mark")
    seen := 0
    for entry in BuildCalloutPreviewCatalog() {
        V48Assert(entry.Key!=TYTH_PROFILE_NAME "|Slot2" && entry.Key!=TYTH_PROFILE_NAME "|Slot3","preview cannot offer retired slots")
        if entry.Key=TYTH_PROFILE_NAME "|Slot1" {
            seen += 1
            payload := ResolveCalloutPreview(entry,"Example",0,AUDIO_MODE_KENKU_BRIDGE_TTS)
            V48Assert(InStr(payload.Phrase,"Adds spawning"),"retained preview resolves the add-spawn wording")
        }
    }
    V48Assert(seen>0,"retained call is previewable")
    phrases := BuildDefaultBridgePhrases()
    V48Assert(!phrases.Has("6bcef6a2-9be5-4f6b-9fe3-47ac41e7007f") && !phrases.Has("39ced276-4e4a-4229-b69e-acefa04bfa34"),"new defaults omit placeholder speech")
    V48Assert(BossSounds["GFTM - Nahut"].Has(2),"other boss bindings remain intact")
}

V7860RetiredManualRoutes() => V672LibraryFixture(V7860RetiredManualRoutesCase)
V7860RetiredManualRoutesCase()
{
    global TythManualEnabled,activeBoss,TYTH_PROFILE_NAME,Audio,SETTINGS_FILE
    oldBoss := activeBoss
    try {
        activeBoss := TYTH_PROFILE_NAME
        IniWrite(1,SETTINGS_FILE,"TythManual","Slot2")
        IniWrite(1,SETTINGS_FILE,"TythManual","Slot3")
        LoadTythToggleSettings()
        V48Assert(TythManualEnabled.Count=1,"old INI values cannot recreate removed calls")
        V48Assert(IniRead(SETTINGS_FILE,"TythManual","Slot2")=1 && IniRead(SETTINGS_FILE,"TythManual","Slot3")=1,"legacy saved values are preserved")
        V48Assert(TythManualSlotActive(TYTH_PROFILE_NAME,"Slot1"),"finished call still passes its enabled gate")
        TythManualEnabled["Slot2"] := true,TythManualEnabled["Slot3"] := true
        V48Assert(!TythManualSlotActive(TYTH_PROFILE_NAME,"Slot2") && !TythManualSlotActive(TYTH_PROFILE_NAME,"Slot3"),"legacy in-memory preferences cannot enable removed routes")
        before := Audio.Queue.Length
        V48Assert(!PlayBossSlot(2) && !PlayBossSlot(3) && Audio.Queue.Length=before,"removed keys cannot enqueue audio")
        V48Assert(TythManualSlotActive("GFTM - Nahut","Slot2"),"shared Numpad gate preserves other bosses")
    }
    finally
        activeBoss := oldBoss
}

; Native, manually invoked diagnostics. Private settings, records and audio.
V7861Storage() => V7825Fixture(V7861StorageCase)
V7861StorageCase()
{
    global ITeam,Audio
    d := V7825Data(),o := d.Teams["p1"].Orders
    o.Phases[1] := [["Healer2","reveal"],["Tank1","reveal"],["Healer2","reveal"],["OffTank","emergency"]]
    o.Phases[2] := [["Mara","bait"],["Tank2","both"],["Healer1","terminal"]]
    o.Phases[3] := [["Healer1","reveal"],["DoubleCloseDPS","return"],["Mara","reveal"]]
    o.Burn := ["Healer2","Healer1","Tank1","Tank2","Mara","FifthDPS","DoubleFarDPS","DoubleCloseDPS"]
    o.Tank := [7,4,2],o.DPS := [6,3,5]
    raw := ITeamEncode(d),round := ITeamDecode(raw)
    V48Assert(raw=ITeamEncode(round),"custom jobs, repeated occurrences, priorities and both interrupt lists round-trip")
    legacy := IGJParse(raw)
    for row in legacy[7]
        row.Pop()
    old := ITeamDecode(IGVJson(legacy))
    V48Assert(!old.Teams["p1"].Orders.Phases[1].Length && !old.Teams["p1"].Orders.Tank.Length,"existing four-field team rows retain defaults")
    copy := ITeamNewPreset(d,"Other team","p1"),d.Teams[copy].Orders.Tank[1] := 8
    V48Assert(o.Tank[1]=7 && d.Teams[copy].Orders.Tank[1]=8,"copying a team deep-copies strategy orders")
    saved := ITeamCommit(d,"")
    V48Assert(ITOIzax("Tank")[1]=7 && NBCandlePriority()[1]="Healer2","saved active team reaches both runtime controllers")
    ITeam := {Loaded:false,Enabled:false,Data:"",Original:"",Error:"",Revision:0},ITeamStartup()
    V48Assert(ITeam.Enabled && ITeamEncode(ITeam.Data)=saved,"restart retains every custom order")
    d.Active := copy,ITeamCommit(d,saved)
    V48Assert(ITOIzax("Tank")[1]=8 && !Audio.Queue.Length,"switching teams changes strategy without playing audio")
}
V7861Invalid() => V7825Fixture(V7861InvalidCase)
V7861InvalidCase()
{
    o := ITODefaults(),o.Tank := [2,2]
    V7825Throws(ITOClone.Bind(o),"duplicate interrupt role rejected")
    o := ITODefaults(),o.DPS := [9]
    V7825Throws(ITOClone.Bind(o),"unknown interrupt role rejected")
    o := ITODefaults(),o.Burn := ["Mara"]
    V7825Throws(ITOClone.Bind(o),"burn must retain all eight roles")
    o := ITODefaults(),o.Phases[2] := [["Tank1","reveal"]]
    V7825Throws(ITOClone.Bind(o),"P2 requires explicit terminal holder")
    o.Phases[2] := [["Tank1","terminal"]]
    V7825Throws(ITOClone.Bind(o),"mismatched P3 opener rejected before saving")
    o.Phases[3] := [["Tank1","reveal"]]
    V48Assert(ITOClone(o).Phases[3][1][1]="Tank1","matching custom terminal and opener accepted")
    o.Phases[2] := [["Tank1","terminal"],["Tank2","terminal"]]
    V7825Throws(ITOClone.Bind(o),"terminal hold cannot appear mid-sequence")
    o := ITODefaults(),o.Phases[1] := [["OffTank","emergency"],["Tank1","reveal"]]
    V7825Throws(ITOClone.Bind(o),"free-tank fallback only at P1 end")
    o := ITODefaults(),o.Phases[3] := [["DoubleFarDPS","return"]]
    V7825Throws(ITOClone.Bind(o),"P3 opener cannot have conditional return job")
}
V7861NahutSetup(o,phase)
{
    global ITeam,NBOrder
    d := ITeamNew(),d.Teams["p1"].Orders := ITOClone(o)
    for slot in ITOBurnDefault()
        d.Teams["p1"].Nahut[slot] := ITeamAddPerson(d,slot,slot)
    ITeam.Data := d,ITeam.Enabled := true
    V48Setup(phase),NBOrder.Config := NBOrderConfigKey()
}
V7861Nahut() => V7825Fixture(V7861NahutCase)
V7861NahutCase()
{
    global NBOrder,NBCandle,Audio,logReadBusy
    o := ITODefaults(),o.Phases[1] := [["Healer2","reveal"],["Tank1","reveal"],["Healer2","reveal"]]
    V7861NahutSetup(o,1),V48Pass("Healer2",100100),PollNBOrder()
    V48Assert(V48Chosen()="Healer2" && !Audio.Queue.Length,"custom P1 opener remains quiet and unfinished on receipt")
    V48Use("Tank1",101000)
    V48Assert(NBOrder.Turns[2].Done && !NBOrder.Turns[1].Done && V48Chosen()="Healer2","early use credits its occurrence without skipping the custom opener")
    V48Use("Healer2",102000),V48Use("Healer2",102001,false)
    V48Assert(NBOrder.Turns[1].Done && !NBOrder.Turns[3].Done && V48Chosen()="","repeated role has a separate occurrence and must wait for real cooldown")
    V482BatteryPickup("Healer2",160000),V48Time(162100)
    V48Assert(V48Chosen()="Healer2","repeated role becomes eligible after 60 seconds")
    V48Use("Healer2",162700)
    V48Assert(NBOrder.Turns[3].Done,"later use completes the repeated turn once")
    o.Phases[1] := [["Tank2","reveal"]],V7861NahutSetup(o,1)
    logReadBusy := true
    try V48Pass("Tank2",100100)
    finally logReadBusy := false
    V48Assert(!NBOrder.Suspended && V48Chosen()="Tank2","short custom P1 handles batched receipt without indexing default turns")
}
V7861Handoff() => V7825Fixture(V7861HandoffCase)
V7861HandoffCase()
{
    global NBOrder,NBCandle,Audio
    o := ITODefaults(),o.Phases[2] := [["Mara","bait"],["Healer2","both"],["Tank1","terminal"]]
    o.Phases[3] := [["Tank1","reveal"],["DoubleCloseDPS","return"],["Healer1","reveal"]]
    V7861NahutSetup(o,2),p := NBCandle.Players[V48Actor("Mara")],p.Battery := 0,p.LastUse := 99999
    V48Pass("Mara",100100),V48Assert(V48Chosen()="Mara","custom hold-only turn ignores battery and reveal cooldown")
    V48Lock("Mara",101000),V48Assert(V48Chosen()="Healer2","Snipe lock advances custom bait turn")
    V48Pass("Healer2",101100),V48Use("Healer2",102000,false),V48Lock("Healer2",102100)
    V48Assert(!NBOrder.Turns[2].Done,"custom both job requires completed Reveal proof, not bare battery loss")
    V48Use("Healer2",102200,true)
    V48Assert(NBOrder.Turns[2].Done && V48Chosen()="Tank1","strong proof upgrades the same use and completes both requirements")
    V48Pass("Tank1",103000),V48Lock("Tank1",103100),V48Time(180000),PollNBOrder()
    V48Assert(NBOrder.Phase=2 && NBOrder.TerminalArmed && !Audio.Queue.Length,"custom terminal holder remains quiet through Snipe and a long hold")
    NBCandle.Players[V48Actor("DoubleCloseDPS")].Pos.X := 60
    V48Use("Tank1",180100)
    V48Assert(NBOrder.Phase=3 && NBOrder.Turns[1].Done && NBOrder.Turns[1].Actor=V48Actor("Tank1"),"custom terminal starts P3 and credits actual opener once")
    V48Assert(V48Chosen()="Healer1" && NBOrder.Turns[2].Skipped,"custom returning role outside 30m is skipped for the next eligible turn")
    V48Use("Tank1",180101,false)
    V48Assert(!NBOrder.Turns[3].Done && NBCandle.Players[V48Actor("Tank1")].LastUse=180100,"evidence upgrade cannot consume another turn or reset phase cooldown")
    V7861NahutSetup(o,3),NBOrder.Turns[1].Done := true
    V48Assert(V48Chosen()="DoubleCloseDPS","custom return job accepts a living ready player back within range")
    NBCandle.Burn := true,NBOrderSetPhase(4,101000,"test burn")
    V48Assert(!NBOrder.Turns.Length && NBCandle.Burn,"burn abandons custom phase sequence")
}
V7861Burn() => V7825Fixture(V7861BurnCase)
V7861BurnCase()
{
    global NBCandle,ITeam
    o := ITODefaults(),o.Burn := ["Healer2","Mara","DoubleCloseDPS","FifthDPS","DoubleFarDPS","Healer1","Tank2","Tank1"]
    V7861NahutSetup(o,3),NBCandle.Burn := true
    V48Assert(NBCandlePriority()[1]="Healer2","custom burn priority reaches production picker")
    V48Assert(PickNBCandle(100000).Slot="Healer2","production picker chooses first eligible custom priority")
    NBCandle.Players[V48Actor("Healer2")].Pos.X := 60
    V48Assert(PickNBCandle(100000).Slot="Mara","nearby lower priority beats distant first priority")
    for actor,p in NBCandle.Players
        p.Pos.X := 60
    V48Assert(PickNBCandle(100000).Slot="Healer2" && PickNBCandle(100000).RangeFallback,"distance fallback restarts at the custom first priority")
    NBCandle.Players[V48Actor("Healer2")].Battery := 0
    V48Assert(PickNBCandle(100000).Slot="Mara","fallback still respects battery eligibility")
    V48Assert(ITOBurn(ITODefaults())[1]="Mara","an explicit default draft does not inherit active custom team")
    base := ITOBurnDefault(),o.Burn[1] := "invalid"
    V48Assert(NBCandlePriority()[1]="Healer2" && base.Length=8,"runtime plan is independent from editor input")
}
V7861Izax() => V7825Fixture(V7861IzaxOuter)
V7861IzaxOuter() => V7822Fixture(V7861IzaxCase)
V7861IzaxCase()
{
    global ITeam,IZP,IZPOptions,Audio
    d := ITeamNew(),o := d.Teams["p1"].Orders,o.Tank := [7,4,2],o.DPS := [6,3,5]
    ITeam.Data := d,ITeam.Enabled := true
    V7821Feed(100000),V7822Reset(101000),V7822Break(120000),V7821Take("Heal One, interrupt.")
    V48Assert(IBMData().Rows[2].Value="Heal One","overlay shows custom first player, including healer when configured")
    V7824Kick(121000,"Tank Toon","Heal One next.")
    V7824Kick(123000,"Heal One Toon","Two next.")
    V7824Kick(125000,"Two Toon","Heal One next.")
    V48Assert(!IZP.Early.Count,"early interrupt skips that role once in the custom order")
    V7822Break(130000),V7821Take("Heal One, interrupt.")
    V7822Reset(140000),V7822Break(150000),V7821Take("Four, interrupt.")
    V7824Kick(151000,"Four Toon","One next.")
    V7822Reset(160000),V7822Break(170000),V7821Take("Spam interrupts.")
    V7824Kick(171000,"One Toon","")
    V48Assert(!Audio.Queue.Length,"custom sections retain quiet individual calls during spam")
    V7822Break(180000),V7821Take("Heal One, interrupt.")
    IZPOptions.Sections := false
    V48Assert(IZPActiveOrder(IZP,IZPOptions.Slots)[1].Name="Heal One","sections disabled uses first custom list")
}
V7861Window() => V7825Fixture(V7861WindowCase)
V7861WindowCase()
{
    global ITeam,ITeamUI,NBCandle,NBOrder,Audio,audioOutputMode
    ITeam.Data := V7825Data(),ITeam.Loaded := true,ITeam.Enabled := false
    ITeamOpen("Nahut"),before := ITeamEncode(ITeamUI.Data),ITOOpen("Nahut"),e := ITeamUI.OrderEditor
    V48Assert(e.Rows.Length=11 && e.Default.Value && !e.Up.Enabled,"new team editor opens on unchanged default")
    e.Default.Value := 0,ITOToggleDefault(),e.List.Modify(2,"Select Focus"),ITOMove(-1)
    V48Assert(e.Rows[1][1]="Tank2" && ITeamEncode(ITeamUI.Data)=before,"editor move changes only its draft")
    e.Sections.Choose(4),ITOSelectSection(),e.Default.Value := 0,ITOToggleDefault()
    e.List.Modify(5,"Select Focus"),ITOMove(-1)
    V48Assert(!e.Remove.Enabled && !e.Add.Enabled && e.Rows.Length=8,"burn editor reorders all eight roles")
    V48Assert(ITOAccept() && ITeamUI.Dirty,"accept stages orders in the team draft")
    V48Assert(ITeamUI.Data.Teams["p1"].Orders.Phases[1][1][1]="Tank2" && !ITeam.Enabled,"staging never changes active runtime")
    draft := ITeamEncode(ITeamUI.Data),ITOOpen("Izax"),e := ITeamUI.OrderEditor
    e.Default.Value := 0,ITOToggleDefault(),e.List.Modify(2,"Select Focus"),ITOMove(-1),ITOClose()
    V48Assert(ITeamEncode(ITeamUI.Data)=draft,"cancel discards interrupt-order draft")
    state := IGVJson(V7825Snapshot([NBCandle,NBOrder]))
    rows := ITeamPracticeRows(ITeamUI.Data,"p1",1,audioOutputMode)
    V48Assert(InStr(rows[2].Event,"Tank2") && state=IGVJson(V7825Snapshot([NBCandle,NBOrder])) && !Audio.Queue.Length,"rehearsal reflects draft custom order without touching live state")
    d := ITeamClone(ITeamUI.Data),d.Teams["p1"].Orders.Tank := [7],d.Teams["p1"].Orders.DPS := [7],d.Teams["p1"].Izax["Slot2"] := ""
    rows := ITeamPracticeRows(d,"p1",4,audioOutputMode)
    V48Assert(rows.Length>3 && !rows[1].Missing,"single-player custom interrupt rehearsal needs only its assigned role")
    d.Teams["p1"].Izax["Slot7"] := "",rows := ITeamPracticeRows(d,"p1",4,audioOutputMode)
    V48Assert(rows[1].Missing && InStr(rows[1].Event,"Slot7"),"rehearsal reports missing custom roles before indexing an empty order")
}

V7863UtilityPreview() => V65UITimerIsolated(V7863UtilityPreviewCase)

V7863UtilityPreviewCase(*)
{
    global IP,IPM,IRU,IRUU,testClock
    saved := {IP:IP,IRU:IRU,IRUU:IRUU}
    try {
        IP := IPNewApp(),IRU := IRUNewState(),IRUU := IRUUNewState()
        IPM.Enabled := true,IPM.Mode := 2,IPM.Font := 10
        V48Assert(IPMPreviewSet(8),"layout preview starts in isolated state")
        snap := IPMOverlaySnapshot(IP,IPM)
        ; A real discipline snapshot can remember a solo player without any
        ; abilities that belong in Raid Utility. It must not suppress samples.
        V67UtilityMeta(IRU,1000,"@Solo player#1","Hatred")
        V48Assert(IRU.Players.Count=1 && IRURows(IRU,IRUU,1000).Count=0,"native log snapshot remembers a player but produces no utility rows")
        before := IGVJson([ObjPtr(IRU),IRU.Players.Count,IRU.Timers.Count,IRU.LastAt,IRU.Revision]),p := IPM.Panels["RaidUtility"],p.Width := 300
        IPMEnsureGui("RaidUtility",0,p),IPMRender("RaidUtility",snap,p)
        V7433OverlayIconPreview(p,"Utility-no-rows")
        V48Assert(p.VisibleRows=7 && InStr(p.Heading.Text,"Preview"),"remembered player without utility rows must show sample cooldowns")
        V48Assert(before=IGVJson([ObjPtr(IRU),IRU.Players.Count,IRU.Timers.Count,IRU.LastAt,IRU.Revision]),"preview leaves the live observer untouched")
        p.Width := 251,p.Height := 347,p.AutoHeight := false
        IPMRender("RaidUtility",snap,p)
        V48Assert(p.VisibleRows>0 && p.Rows[1].Name.Visible,"sample cooldowns remain visible in the user's narrower fixed-size layout")
        p.AutoHeight := true
        IP.Offline := V7849SavedFixture(),IP.Selected := 1,IP.View := "Imported"
        snap := IPMOverlaySnapshot(IP,IPM),IPMRender("RaidUtility",snap,p)
        V48Assert(p.VisibleRows=7 && InStr(p.Heading.Text,"Preview"),"loaded saved fight does not suppress empty live utility samples")
        V48Assert(IPMPreviewPanel("Damage",snap)=snap && snap.Actors[1].Damage=10000,"saved damage totals stay real while utility uses samples")
        ; Retained real cooldowns still take precedence, including dead players
        ; and abilities whose availability is uncertain after the parser stops.
        V67UtilityMeta(IRU,2000,"@Recorded healer#2","Corruption")
        IPMRender("RaidUtility",snap,p)
        V48Assert(p.VisibleRows=1 && p.Rows[1].Name.Text="Recorded healer" && !InStr(p.Heading.Text,"Preview"),"eligible recorded healer retains real rows")
        V48Assert(p.Rows[1].Value.Text="Unknown","paused ready estimate keeps its existing uncertainty")
        healer := IRU.Players["@Recorded healer#2"]
        IRUUse(IRU,healer,IRUCatalog()["rez"],2000)
        IPMRender("RaidUtility",snap,p)
        V48Assert(p.VisibleRows=1 && p.Rows[1].Value.Text="~5:00","recorded battle-rez cooldown is not replaced by a sample")
        healer.Dead := true,IPMRender("RaidUtility",snap,p)
        V48Assert(p.VisibleRows=1 && p.Rows[1].Value.Text="Dead","recorded dead status stays real")
        IRUU.BattleRez := false,IPMRender("RaidUtility",snap,p)
        V48Assert(p.VisibleRows=5 && InStr(p.Heading.Text,"Preview") && p.Rows[1].Total.Text="Rebounder","filtered-out real rows fall back to samples in enabled categories only")
        IRUU.Rebounder := false,IRUU.Predation := false,IRUU.RaidBuffs := false
        IPMRender("RaidUtility",snap,p)
        V48Assert(p.VisibleRows=0 && p.Empty.Text="Choose utilities in Raid utility options","disabling every category remains intentionally empty")
        IRUU := IRUUNewState(),IRU.LastAt := 1802001
        IPMRender("RaidUtility",snap,p)
        V48Assert(p.VisibleRows=7 && InStr(p.Heading.Text,"Preview"),"expired roster entries do not suppress samples")
        IRU.LastAt := 5000,IRU.Snapshot := 2000
        healer.RosterAt := 1000,IPMRender("RaidUtility",snap,p)
        V48Assert(p.VisibleRows=7 && InStr(p.Heading.Text,"Preview"),"players excluded by the latest raid snapshot do not suppress samples")
        ; Use the same current clock as the renderer when the reader is active.
        IRU.Snapshot := -1,IP.Active := true,IP.Live := IPNewData("fixture"),testClock := 1802001,IRU.LastTick := 5000
        IPMRender("RaidUtility",snap,p)
        V48Assert(p.VisibleRows=7 && InStr(p.Heading.Text,"Preview"),"preview selection and renderer agree on roster expiry")
        IP.Active := false,IPMEndRaidPreview(),snap := IPMOverlaySnapshot(IP,IPM)
        IPMRender("RaidUtility",snap,p)
        V48Assert(!InStr(p.Heading.Text,"Preview") && p.VisibleRows=1 && p.Rows[1].Name.Text="Recorded healer","ending preview restores actual retained observer state")
        V48Assert(IRU.Players.Count=2 && IRU.Timers.Count=1,"sample rows never enter live players or cooldown timers")
    }
    finally {
        IPMPreviewClear(IPM),IPMDestroyPanels()
        IP := saved.IP,IRU := saved.IRU,IRUU := saved.IRUU
    }
}

V7863EffectsPreview() => V65UITimerIsolated(V7863EffectsPreviewCase)
V7863EffectsPreviewCase(*)
{
    global IP,IPM,IEF,IEFU
    saved := {IP:IP,IEF:IEF,IEFU:IEFU}
    try {
        IP := IPNewApp(),IEF := IEFPreviewState(),IEFU := IEFUNewState()
        IPM.Enabled := true,IPM.Mode := 2,IPM.Font := 10,IPM.MaxRows := 8
        V48Assert(IPMPreviewSet(8),"effect preview starts without a live reader")
        snap := IPMOverlaySnapshot(IP,IPM),IEF.Active.Clear()
        p := IPM.Panels["HealerGrid"],p.Width := 420,IPMEnsureGui("HealerGrid",0,p)
        IPMRender("HealerGrid",snap,p),V7433OverlayIconPreview(p,"HoTs-roster-only")
        V48Assert(InStr(p.Heading.Text,"Preview") && p.EffectCells.Count>0,"retained roster without HoTs gets a populated sample grid")
        IEFU.Slots := "Custom healer`nCustom tank",IEFU.Columns := 4
        IPMRender("HealerGrid",snap,p)
        V48Assert(InStr(p.Heading.Text,"Preview") && !InStr(p.Rows[1].Name.Text,"Custom"),"custom real slots do not hide sample effects")
        V48Assert(IEFU.Slots="Custom healer`nCustom tank" && IEFU.Columns=4 && IEF.Active.Count=0,"samples preserve configured slots, columns and real effects")
        IEF := IEFPreviewState(),IEFU.Slots := "You`nTank One"
        IPMRender("HealerGrid",snap,p)
        V48Assert(!InStr(p.Heading.Text,"Preview") && p.Rows[1].Name.Text="You","real matching HoTs keep the real grid and assignment order")
        IEFU.Slots := "Player not in log",IPMRender("HealerGrid",snap,p)
        V48Assert(InStr(p.Heading.Text,"Preview"),"effects outside configured slots cannot suppress grid samples")
        IEFU.Slots := "",IEF.Owner := "@Different healer#99"
        IPMRender("HealerGrid",snap,p)
        V48Assert(InStr(p.Heading.Text,"Preview"),"another healer's effects do not suppress sample HoTs")
        IEF := IEFPreviewState()
        for key,item in IEF.Active
            item.Name := "Untracked buff",item.Id := "990000000000009"
        IPMRender("HealerGrid",snap,p)
        V48Assert(InStr(p.Heading.Text,"Preview"),"unrelated player buffs do not count as grid HoTs")
        IEF := IEFPreviewState(),IEFU.NameFilter := "A real effect absent from sample",IEFU.TargetFilter := 3
        effects := IPM.Panels["Effects"],effects.Width := 420,IPMEnsureGui("Effects",0,effects)
        IPMRender("Effects",snap,effects),V7433OverlayIconPreview(effects,"Effects-filtered")
        V48Assert(InStr(effects.Heading.Text,"Preview") && effects.VisibleRows>0,"filtered-out live effects fall back to visible samples")
        V48Assert(IEFU.NameFilter="A real effect absent from sample" && IEFU.TargetFilter=3,"sample filtering never rewrites real display preferences")
        IEFU.NameFilter := "Static Barrier",IEFU.TargetFilter := 1
        IPMRender("Effects",snap,effects)
        V48Assert(!InStr(effects.Heading.Text,"Preview") && effects.VisibleRows=1 && InStr(effects.Rows[1].Name.Text,"Static Barrier"),"matching real effects retain their actual filter and data")
        IEFU.NameFilter := "No match",IPMEndRaidPreview(),snap := IPMOverlaySnapshot(IP,IPM)
        IPMRender("Effects",snap,effects)
        V48Assert(!InStr(effects.Heading.Text,"Preview") && effects.VisibleRows=0,"ending preview restores filtered empty live-effects view")
        IEFU.Slots := "Custom healer",IPMRender("HealerGrid",snap,p)
        V48Assert(!InStr(p.Heading.Text,"Preview") && InStr(p.Rows[1].Name.Text,"Custom healer"),"ending preview restores configured empty HoT slots")
    }
    finally {
        IPMPreviewClear(IPM),IPMDestroyPanels()
        IP := saved.IP,IEF := saved.IEF,IEFU := saved.IEFU
    }
}

V7863EnemyPreview() => V65UITimerIsolated(V7863EnemyPreviewCase)
V7863EnemyPreviewCase(*)
{
    global IP,IPM
    state := IENState(),prefs := IENUState(),saved := {IP:IP,State:state.Clone(),Prefs:prefs.Clone()}
    try {
        IP := IPNewApp(),IPM.Enabled := true,IPM.Mode := 2,IPM.Font := 10
        for field,value in IENPreview().OwnProps()
            state.%field% := value
        prefs.SourceFilter := 1,prefs.NameFilter := "",prefs.OnlyAffected := true
        V48Assert(IPMPreviewSet(8),"enemy preview starts in isolated state")
        snap := IPMOverlaySnapshot(IP,IPM),p := IPM.Panels["EnemyDebuffs"],p.Width := 440
        IPMEnsureGui("EnemyDebuffs",0,p),state.Effects.Active.Clear()
        IPMRender("EnemyDebuffs",snap,p),V7433OverlayIconPreview(p,"Enemy-retained-empty")
        V48Assert(p.VisibleRows=3 && InStr(p.Heading.Text,"Preview"),"remembered enemies without matching debuffs get samples")
        V48Assert(state.Actors.Count=3 && state.Effects.Active.Count=0,"enemy samples never enter the real observer")
        for field,value in IENPreview().OwnProps()
            state.%field% := value
        for key,actor in state.Actors
            actor.Dead := true
        IPMRender("EnemyDebuffs",snap,p)
        V48Assert(p.VisibleRows=3 && InStr(p.Heading.Text,"Preview"),"dead retained enemies do not suppress samples")
        for field,value in IENPreview().OwnProps()
            state.%field% := value
        prefs.NameFilter := "Unmatched raid debuff",IPMRender("EnemyDebuffs",snap,p)
        V48Assert(p.VisibleRows=3 && InStr(p.Heading.Text,"Preview") && prefs.NameFilter="Unmatched raid debuff","sample debuffs ignore real search terms without saving changes")
        prefs.NameFilter := "Scorch",IPMRender("EnemyDebuffs",snap,p)
        V48Assert(!InStr(p.Heading.Text,"Preview") && p.VisibleRows=3,"matching real enemy effects stay real")
        state.Effects.Active.Clear(),prefs.OnlyAffected := false,IPMRender("EnemyDebuffs",snap,p)
        V48Assert(!InStr(p.Heading.Text,"Preview") && p.VisibleRows=3 && p.Rows[1].Total.Text="No tracked debuffs","explicit show-all-enemies mode preserves actual empty enemy rows")
        prefs.OnlyAffected := true,IPMEndRaidPreview(),snap := IPMOverlaySnapshot(IP,IPM)
        IPMRender("EnemyDebuffs",snap,p)
        V48Assert(!InStr(p.Heading.Text,"Preview") && p.VisibleRows=0,"ending preview restores the real empty enemy view")
    }
    finally {
        IPMPreviewClear(IPM),IPMDestroyPanels(),IP := saved.IP
        for field,value in saved.State.OwnProps()
            state.%field% := value
        for field,value in saved.Prefs.OwnProps()
            prefs.%field% := value
    }
}

; Native isolated phase-loading tests. No user settings, live reader or audio.
V7864PhaseLoading() => V75LibraryRun(V7864PhaseLoadingCase)
V7864PhaseGuards() => V75LibraryRun(V7864PhaseGuardsCase)

V7864PhaseFixture(action)
{
    global IP
    static serial := 0
    path := A_ScriptDir "\phase-fixture-" DllCall("GetCurrentProcessId") "-" (++serial) ".txt"
    p := "@Review#66",boss := "NAHUT {4122949560827904}:1|(9000/10000)"
    lines := ["[00:00:00.000] [" p "] [] [] [AreaEntered {836045448953664}: Valley {833571547775765} 8 Player Master {836045448953655}]",
        IPDemoLine(1000,p,"=","Enter"),IPDemoLine(1100,p,boss,"Damage",100),
        "[00:00:02.000] [Power Coupling {4131861617967104}:2|(10000/10000)] [" p "] [] [Event {836045448945472}: TargetSet {836045448953668}]",
        IPDemoLine(3000,p,"Power Coupling {4131861617967104}:2|(9000/10000)","Damage",200),
        IPDemoLine(4000,p,boss,"Damage",300),IPDemoLine(5000,p,"=","Exit"),
        "[00:00:20.000] [" p "] [=] [] [AreaEntered {836045448953664}: Outside {123}] ()"]
    text := "",s := IPNewData("Private phase fixture")
    for line in lines
        text .= line "`n",IPFeedLine(s,line)
    V48Assert(!FileExist(path),"private phase fixture never overwrites a source")
    f := FileOpen(path,"w","UTF-8-RAW"),f.Write(text),f.Close()
    try {
        IP.Live := s,IP.View := "Live",IP.Active := true,IP.Follow := false,IP.Selected := 1
        IP.Queue := [],IP.Head := 1,IP.Encoding := "UTF-8"
        seg := s.Segments[1],seg.SourcePath := path,seg.SourceEncoding := "UTF-8"
        V48Assert(seg.End>=0 && s.InCombat=0 && !IsObject(s.Current) && !s.Finished,"completed live pull between encounters")
        V48Assert(IRPChoices(seg).Length=2,"raw fixture has Nahut and Couplings ranges")
        if !IPMGuiAlive(IP.Gui)
            IPWBuild()
        IPWAnalysisEnsure(),V58SelectTab(7),IRPSync(seg)
        action.Call(s,seg,path,text)
    }
    finally {
        IRPCancel(false),IP.Active := false
        FileDelete(path)
    }
}

V7864PhaseLoadingCase()
{
    for mode in ["normal","append","buff"]
        V7864PhaseFixture(V7864PhaseLoad.Bind(mode))
}
V7864PhaseLoad(mode,s,seg,path,text)
{
    global IP
    a := IAState(),prior := IADemoData(),a.Data := prior,before := IAFrozenTarget(seg)
    V48Assert(IRPLoad(),"Load phases starts between pulls with live parsing on")
    job := a.Work
    if mode="append" {
        writer := FileOpen(path,0x702,"UTF-8-RAW")
        writer.Write(IPDemoLine(25000,"@Review#66","=","Heal",1) "`n"),writer.Close()
    }
    IALoadPump(mode="buff" ? V7864PhaseService.Bind("buff") : ""),IRPPoll()
    r := IRPState()
    V48Assert(job.Timing.Committed && r.Models.Length=2 && !r.Pending,"verified phase totals load: " mode " / " a.LastStatus)
    V48Assert(IP.Active && IP.Live=s && a.Data=prior,"reader and prior Analysis review remain intact")
    V48Assert(!IABaseReconcile(seg,before).Length && seg.Start=before.Start && seg.Last=before.Last && seg.End=before.End,"phase loading does not change the finished pull")
    V48Assert(r.Models[2].Totals["@Review#66"].Damage=500,"Couplings damage comes from accepted events")
    V48Assert(r.Models[1].Seconds>0 && r.Models[2].Seconds>0,"phase durations remain positive")
    V48Assert(SubStr(FileRead(path,"UTF-8"),1,StrLen(text))=text,"captured source prefix remains unchanged")
    c := IPWState().Controls,c["RaidPhase"].Choose(3),IRPChanged()
    V48Assert(c["RaidPhase"].Text="Couplings" && r.Index=3,"loaded phase is selectable with live parsing on")
}

V7864PhaseService(mode,kind,job)
{
    global IP
    if job.HasOwnProp("Injected")
        return
    job.Injected := true
    switch mode {
        case "combat":
            IP.Queue.Push({Line:IPDemoLine(23000,"@Review#66","=","Enter"),Key:""})
        case "buff":
            IP.Queue.Push({Line:"[00:00:22.000] [@Review#66] [=] [Fortitude {123}] [ApplyEffect {836045448945477}: Fortitude {123}]",Key:""})
        case "replacement":
            IP.Live := IPNewData("Private replacement")
        case "revision":
            job.TargetObject.SnapshotRevision += 1
        case "selection":
            IP.Selected := 0
        case "cancel":
            IACancel()
    }
}

V7864PhaseGuardsCase()
{
    for mode in ["combat","replacement","revision","selection","cancel"]
        V7864PhaseFixture(V7864PhaseCancel.Bind(mode))
    V7864PhaseFixture(V7864PhaseBlocked)
}
V7864PhaseCancel(mode,s,seg,path,text)
{
    global IP
    a := IAState(),prior := IADemoData(),a.Data := prior
    V48Assert(IRPLoad(),"phase cancellation fixture starts")
    job := a.Work,IALoadPump(V7864PhaseService.Bind(mode)),IRPPoll()
    V48Assert(!job.Timing.Committed && !IRPState().Pending && !IRPState().Models.Length,"no stale phase result: " mode)
    V48Assert(!IsObject(job.Snapshot.File) && !a.Pumping && !a.Busy,"canceled phase resources close: " mode)
    V48Assert(IP.Active && a.Data=prior,"cancellation preserves live reader and prior review: " mode)
    if mode="combat"
        V48Assert(IP.Live.InCombat=1 && IsObject(IP.Live.Current),"new combat record is processed before replay yields")
}
V7864PhaseBlocked(s,seg,path,text)
{
    global IP
    IP.Live.InCombat := 1,IRPSync(seg)
    c := IPWState().Controls
    V48Assert(!c["RaidPhaseLoad"].Enabled && InStr(c["RaidLabel"].Text,"after combat"),"combat guard explains disabled button")
    V48Assert(!IRPLoad() && InStr(c["RaidLabel"].Text,"after combat"),"refused click updates visible message")
    IP.Live.InCombat := 0,IRPSync(seg)
    V48Assert(c["RaidPhaseLoad"].Enabled,"button becomes available between pulls")
    V48Assert(IAIsBusy() && !IAIsBusy(true),"exception applies only to Raid phases")
    IP.LateStart := {Private:true}
    V48Assert(IAIsBusy(true),"live recovery still blocks phase loading")
    IP.LateStart := ""
    IP.ImportFile := {Private:true}
    V48Assert(IAIsBusy(true),"imports still block phase loading")
    IP.ImportFile := ""
}

; Isolated native decoder/controller checks; no game inputs, settings or speech.
V7865ShieldReset() => V7822Fixture(V7865ShieldResetCase)
V7865ShieldResetCase()
{
    global IZP
    V7821Feed(100000),V7821Feed(100100,"up"),V7821Feed(100200,"half")
    V7822Event(101000,"discharge")
    V48Assert(IZP.Known && IZP.Absorbed=1070000 && IBMData().Rows[1].Value="~50%","discharge preserves the shield already taking damage")
    V7822Event(101001,"zero"),V7822Event(101002,"zero")
    V48Assert(IZP.Resets=1 && IZP.Known && IZP.Absorbed=1070000,"confirmed/duplicate reset changes order without refilling shield")
    V7821Feed(101100,"half")
    V48Assert(IBMData().Rows[1].Value="~1%" && IZP.Shield="Up","absorption continues after reset without fabricating a break")
    V7821Break(102000),V7821Take("Tank, interrupt.")
    V48Assert(IBMData().Rows[1].Value="Broken","actual vulnerability still controls shield break")
    V7821Feed(103000,"up"),V7821Feed(103100,"half")
    V7822Event(104000,"zero"),V7822Event(104001,"discharge")
    V48Assert(IZP.Resets=2 && IZP.Absorbed=1070000 && IZP.Known,"reversed reset witnesses also preserve known HP")
    V7821Feed(105000,"phase4"),V48Assert(!IZP.Active && !IZP.Known,"phase end still retires the estimate")
}
V7865ShieldRecovery() => V7822Fixture(V7865ShieldRecoveryCase)
V7865ShieldRecoveryCase()
{
    global IZP
    V7821Feed(100000),V7821Feed(100100,"up"),V7821Break(101000),V7821Take("Shield broken.")
    V7822Reset(102000),V7821Feed(113000,"immune")
    V48Assert(!IZP.Known && IZP.RecoverAt=113000,"Unshaken after witnessed break arms recovery without claiming HP yet")
    V7822Event(113005,"tether"),cycle := IZP.Cycle
    V7821Feed(113010,"half")
    V48Assert(IZP.Recovered && IZP.Known && IZP.Absorbed=1070000 && IBMData().Rows[1].Value="~50%","fresh absorption confirms missing application estimate, including first hit")
    V48Assert(IZP.Cycle=cycle,"display recovery preserves pending callout identity")
    V7821Take("Tethers spawning.")
    V7821Feed(113100,"immune")
    V48Assert(IZP.Absorbed=1070000,"duplicate immunity cannot refill recovered shield")
    V7821Feed(113110,"up")
    V48Assert(!IZP.Recovered && IZP.Absorbed=1070000,"nearby explicit application confirms recovery without double starting budget")
    V7821Feed(114000,"half"),V7821Break(115000),V7821Take("Tank, interrupt.")
    V48Assert(IZP.Shield="Down" && !IZP.Known && IZP.RecoverAt=-1,"actual break clears recovered HP and pending recovery")
    V7821Feed(115100,"half"),V48Assert(IZP.Shield="Down","late absorption alone cannot resurrect the shield")
    V7821Feed(127000,"immune"),V7821Feed(127001,"up"),V7821Feed(127002,"half")
    V48Assert(!IZP.Recovered && IZP.Absorbed=1070000,"normal logged application takes precedence")
}
V7865ShieldGuards() => V7822Fixture(V7865ShieldGuardsCase)
V7865ShieldGuardsCase()
{
    global IZP,Audio
    V7821Feed(100000),V7821Feed(100100,"immune"),V7821Feed(100200,"half")
    V48Assert(!IZP.Known,"attachment without a previous witnessed break stays unknown")
    IZPReset(),IZP.Scope := true
    V7821Feed(110000,"up"),V7821Break(111000),V7821Take("Shield broken.")
    V7821Feed(123000,"immune"),V7821Feed(123100,"half")
    V48Assert(!IZP.Known,"unanchored P3 cannot recover a full shield")
    IZPReset(),IZP.Scope := true
    V7821Feed(130000),V7821Feed(130100,"up"),V7821Feed(131000,"remove"),V7821Take()
    V7821Feed(143000,"immune"),V7821Feed(143100,"half")
    V48Assert(!IZP.Known,"removal without vulnerability witness cannot seed recovery")
    IZPReset(),IZP.Scope := true
    V7821Feed(150000),V7821Feed(150100,"up"),V7821Break(151000),V7821Take("Shield broken.")
    V7821Feed(163000,"immune"),V7821Feed(168001,"half")
    V48Assert(!IZP.Known && IZP.RecoverAt=-1,"late damage cannot confirm a stale recovery window")
    V7821Feed(169000,"up"),V7821Break(170000),V7821Take("Shield broken.")
    V7821Feed(182000,"immune"),V7821Feed(182001,"phase4"),V7821Feed(182002,"half")
    V48Assert(!IZP.Known && !IZP.Active && IZP.RecoverAt=-1,"phase transition cancels candidate before any absorption")
    IZPReset(),IZP.Scope := true
    V7821Feed(190000),V7821Feed(190100,"up"),V7822Reset(191000),V7821Break(191100),V7821Take()
    V7821Feed(203000,"immune"),V7821Feed(203100,"half")
    V48Assert(!IZP.Known,"cleanup removal near reset cannot seed recovery")
    IZPReset(),IZP.Scope := true
    V7821Feed(210000,"start","First Toon",false),V7821Feed(210100,"up","First Toon",false)
    V7821Break(211000,false),V7821Feed(223000,"immune","First Toon",false),V7821Feed(223100,"half","First Toon",false)
    V48Assert(IZP.Recovered && !Audio.Queue.Length,"silent recovery reconstructs HP without historical speech")
    IZPReset("new source",false)
    V48Assert(!IZP.Known && IZP.RecoverAt=-1 && IZP.WitnessedBreak=-1,"new source discards all recovery evidence")
}

V7866PhaseIndex() => V75LibraryRun(V7866PhaseIndexCase)
V7866PhaseIntegrity() => V75LibraryRun(V7866PhaseIntegrityCase)
V7866PhaseCancel() => V75LibraryRun(V7866PhaseCancelCase)
V7866PhaseCache() => V75LibraryRun(V7866PhaseCacheCase)
V7866PhaseReader() => V673RecordFixture(V7866PhaseReaderCase)

V7866PhaseReaderCase()
{
    global IP,currentLogPath,currentLogIdentity,currentLogPos,COMBAT_LOG_ENCODING,discardOversizedLine,ReadClockSample
    saved := [currentLogIdentity,currentLogPos,COMBAT_LOG_ENCODING,discardOversizedLine]
    path := A_ScriptDir "\live-reader-" DllCall("GetCurrentProcessId") ".txt"
    V48Assert(!FileExist(path),"reader test uses a new private source")
    try {
        player := "@Rëader#66",text := IPDemoLine(1000,player,"=","Enter") "`r`n`r`n"
        text .= IPDemoLine(1100,player,"Training Dummy {2857785339412480}:1","Damage",100) "`r`n"
        f := FileOpen(path,"w","UTF-8-RAW"),f.Write(text),f.Close()
        f := FileOpen(path,"r","UTF-8"),currentLogIdentity := FileIdentity(f),f.Close()
        currentLogPath := path,currentLogPos := 0,COMBAT_LOG_ENCODING := "UTF-8",discardOversizedLine := false
        IP.Live := IPNewData("Private live reader"),IP.Live.SourceKey := path "|" currentLogIdentity
        IP.Active := true,IP.Visible := false
        ReadNewCombatLogText()
        V48Assert(IP.Queue.Length=2 && IsObject(IP.Queue[1].Clock.SourceBlock),"real acquisition attaches byte proof to the queued records")
        V48Assert(IP.Queue[1].Clock.SourceBlock=IP.Queue[2].Clock.SourceBlock && !IsObject(ReadClockSample),"queued proof survives the cleared batch clock")
        V7866DrainReader(),q := IP.Live.AnalysisIndex
        V48Assert(!q.Disabled && q.Sequence=2 && q.HighWater=currentLogPos,"actual queue consumption preserves nonblank sequence and byte boundary")
        before := currentLogPos,tail := IPDemoLine(1200,player,"Training Dummy {2857785339412480}:1","Damage",200)
        f := FileOpen(path,0x702,"UTF-8-RAW"),f.Write(tail),f.Close(),ReadNewCombatLogText()
        V48Assert(currentLogPos=before,"partial final line stays on disk")
        f := FileOpen(path,0x702,"UTF-8-RAW"),f.Write("`r`n"),f.Close(),ReadNewCombatLogText(),V7866DrainReader()
        V48Assert(!q.Disabled && q.Sequence=3 && q.Blocks.Length=2,"appended complete batch joins the original source index")
        V48Assert(IP.Live.Current.Totals[player].Damage=300,"live totals stay exact across chunk and UTF8 boundaries")
    }
    finally {
        IP.Active := false
        currentLogIdentity := saved[1],currentLogPos := saved[2],COMBAT_LOG_ENCODING := saved[3],discardOversizedLine := saved[4]
        if FileExist(path)
            FileDelete(path)
    }
}

V7866Indexed(path,encoding := "UTF-8",limited := false)
{
    global IP
    f := FileOpen(path,"r",encoding),s := IPNewData("Private indexed live session")
    s.SourcePath := path,s.SourceEncoding := f.Encoding,identity := FileIdentity(f)
    s.SourceKey := path "|" identity,block := ""
    try {
        while !f.AtEOF {
            if !IsObject(block) || f.Pos>=block.End
                block := IRPRecoveryBlock(f,f.Length,path,identity)
            IPFeedLine(s,RTrim(f.ReadLine(),"`r`n"),"","",{SourceBlock:block})
            if limited
                s.AnalysisIndex.MaxAccepted := 2
        }
    }
    finally f.Close()
    IP.Live := s,IP.View := "Live",IP.Selected := 1,IP.Active := true,IRPSync(s.Segments[1])
    return s
}
V7866PhaseIndexCase()
{
    for encoding in ["UTF-8","CP1252"]
        V7864PhaseFixture(V7866PhaseIndexLoad.Bind(encoding))
}
V7866PhaseIndexLoad(encoding,old,oldSeg,path,text)
{
    global IP
    ; CRLF, blank lines, non-ASCII names and a fully captured source prefix.
    text := StrReplace(text,"Review","Rëview"),text := StrReplace(text,"`n","`r`n`r`n")
    f := FileOpen(path,"w",encoding="UTF-8" ? "UTF-8-RAW" : encoding),f.Write(text),f.Close()
    s := V7866Indexed(path,encoding),seg := s.Segments[1],a := IAState()
    V48Assert(IRPLoad() && a.Work.IndexPlan.HasOwnProp("Live"),"live index starts for " encoding)
    job := a.Work,IALoadPump(),IRPPoll()
    V48Assert(job.Timing.Committed && InStr(job.Timing.ReplayMode,"live accounting"),"indexed phases commit: " a.LastStatus)
    r := IRPState(),total := 0
    for model in r.Models
        total += model.Totals["@Rëview#66"].Damage
    V48Assert(r.Models.Length=2 && total=500 && r.Models[2].Totals["@Rëview#66"].Damage=500,"indexed phases preserve names and exclude the opening boundary hit")
    V48Assert(!job.Timing.Phases.Has("Effect history") && !job.Timing.Phases.Has("Absorb attribution"),"Raid load skips unrelated Analysis calculations")
    ; A later append does not invalidate a completed fight's source blocks.
    r.Cache := [],r.Models := [],writer := FileOpen(path,0x702,encoding)
    writer.Write(IPDemoLine(26000,"@Rëview#66","=","Heal",1) "`r`n"),writer.Close()
    V48Assert(IRPLoad(),"indexed load accepts an appended source")
    job := a.Work,IALoadPump(),IRPPoll()
    V48Assert(job.Timing.Committed,"new unparsed bytes do not invalidate a settled phase review")
}
V7866PhaseIntegrityCase()
{
    for mode in ["edited","limit","gap","clock","source"]
        V7864PhaseFixture(V7866PhaseIntegrityLoad.Bind(mode))
}
V7866PhaseIntegrityLoad(mode,old,oldSeg,path,text)
{
    s := V7866Indexed(path,"UTF-8",mode="limit"),seg := s.Segments[1],a := IAState()
    if mode="gap"
        IPFeedLine(s,IPDemoLine(21000,"@Review#66","=","Activate"))
    if mode="clock"
        s.ClockBack := 1
    if mode="source"
        s.AnalysisIndex.Identity := "wrong-source"
    V48Assert(IRPLoad(),"integrity case starts")
    job := a.Work
    if mode="edited" {
        stamp := FileGetTime(path,"M"),f := FileOpen(path,0x703,"UTF-8-RAW")
        ; Change a display label, preserving size, timestamp, all totals and IDs.
        f.Pos := 0,f.Write(StrReplace(text,"Valley","Vallez")),f.Close(),FileSetTime(stamp,path,"M")
    }
    else
        V48Assert(!IsObject(job.IndexPlan),"uncertain source falls back: " mode)
    IALoadPump(),IRPPoll()
    if mode="edited"
        V48Assert(!job.Timing.Committed && !IRPState().Models.Length && InStr(a.LastStatus,"changed since"),"same-size, same-time source edit cannot reuse observed accounting")
    else
        V48Assert(job.Timing.Committed && job.Timing.ReplayMode="Full snapshot replay","safe full replay retained: " mode " / " a.LastStatus)
}
V7866PhaseCancelCase()
{
    for mode in ["combat","replacement","revision","selection","cancel"]
        V7864PhaseFixture(V7866PhaseCancelLoad.Bind(mode))
}
V7866PhaseCancelLoad(mode,old,oldSeg,path,text)
{
    s := V7866Indexed(path),a := IAState()
    V48Assert(IRPLoad() && IsObject(a.Work.IndexPlan),"indexed cancellation starts")
    job := a.Work,IALoadPump(V7864PhaseService.Bind(mode)),IRPPoll()
    V48Assert(!job.Timing.Committed && !IRPState().Models.Length && !IRPState().Cache.Length,"no stale phase cache after " mode)
    V48Assert(!IsObject(job.Snapshot.File) && !a.Busy && !a.Pumping,"index cancellation closes its reader")
}
V7866PhaseCacheCase() => V7864PhaseFixture(V7866PhaseCacheLoad)
V7866PhaseCacheLoad(old,oldSeg,path,text)
{
    global IP
    s := V7866Indexed(path),seg := s.Segments[1],a := IAState()
    V48Assert(IRPLoad(),"cache fixture starts"),IALoadPump(),IRPPoll()
    models := IRPState().Models,IP.Selected := 0,IRPSync(seg),IP.Selected := 1,IRPSync(seg)
    V48Assert(IRPState().Models=models && IRPLoad() && !IsObject(a.Work),"returning to the same pull reuses verified phase totals without file work")
    seg.SnapshotRevision += 1,IRPSync(seg)
    V48Assert(!IRPState().Models.Length && !IRPCached(IPWRotationSelection()).Length,"changed fight revision invalidates phase cache")
    Loop 15 {
        other := seg.Clone(),IRPCached({Source:s,Segment:other,Revision:0},models)
    }
    V48Assert(IRPState().Cache.Length=12,"phase cache is bounded to twelve pulls")
    V48Assert(!IRPCached({Source:IPNewData(),Segment:seg,Revision:seg.SnapshotRevision}).Length && !IRPState().Cache.Length,"new dataset releases the prior cache")
}

V7866DrainReader() {
    global IP
    Loop 10 {
        if IP.Head>IP.Queue.Length
            return
        head := IP.Head
        IPPump()
        V48Assert(!IP.Live.Halted && (IP.Head>IP.Queue.Length || IP.Head>head),"reader fixture makes forward progress")
    }
    V48Assert(IP.Head>IP.Queue.Length,"reader fixture drains within ten bounded pumps")
}

; Real native controls and replay lifecycle on a private, hidden test desktop.
V7867PhaseLoadingBar() => V75LibraryRun(V7864PhaseFixture.Bind(V7867PhaseLoadingCase))
V7867PhaseLoadingGuards() => V75LibraryRun(V7867PhaseGuardCases)
V7867PhaseBarVisible()
{
    c := IPWState().Controls
    bar := c["RaidPhaseLoading"],label := c["RaidPhaseStatus"]
    ; Parent stays hidden: inspect child visibility bits, not desktop visibility.
    return (DllCall("GetWindowLongW","Ptr",bar.Hwnd,"Int",-16,"UInt") & 0x10000000)
        && (DllCall("GetWindowLongW","Ptr",label.Hwnd,"Int",-16,"UInt") & 0x10000000)
}
V7867PhaseBarHidden()
{
    c := IPWState().Controls
    for name in ["RaidPhaseLoading","RaidPhaseStatus"]
        if DllCall("GetWindowLongW","Ptr",c[name].Hwnd,"Int",-16,"UInt") & 0x10000000
            return false
    return c["RaidPhaseLoading"].LoadingMode="hide"
}
V7867PhaseLoadingCase(s,seg,path,text)
{
    global IP
    c := IPWState().Controls,a := IAState()
    V48Assert(V7867PhaseBarHidden(),"idle Raid page has no loading indicator")
    V48Assert(IRPLoad() && V7867PhaseBarVisible(),"bar and label are visible before the first replay step")
    V48Assert(c["RaidPhaseLoading"].LoadingMode="finish" && (DllCall("GetWindowLongW","Ptr",c["RaidPhaseLoading"].Hwnd,"Int",-16,"UInt") & 8),"native marquee runs without a guessed percentage")
    V48Assert(a.Controls["Loading"].LoadingMode="hide","Raid work does not display an unrelated Analysis bar")
    for size in [[980,650],[1220,780],[1920,1080],[2560,1440]] {
        IPResize(IP.Gui,0,size[1],size[2])
        c["RaidRange"].GetPos(&cx,&cy,&cw,&ch),c["RaidPhaseLoading"].GetPos(&x,&y,&w,&h)
        c["RaidPhaseStatus"].GetPos(&tx,&ty,&tw,&th),IP.PlayersLV.GetPos(&lx,&ly)
        V48Assert(x>=cx+cw+8 && w>=80 && x+w<=size[1]-12 && ty+th<=y && y+h<ly-24,"loading controls fit beside the time range button at " size[1])
    }
    job := a.Work,IALoadPump(V7867PhaseBarService),IRPPoll()
    V48Assert(job.Timing.Committed && job.HasOwnProp("BarChecked") && IRPState().Models.Length=2,"real replay completes with loading feedback")
    V48Assert(V7867PhaseBarHidden(),"completion removes both loading controls")
    V58SelectTab(1),V58SelectTab(7)
    V48Assert(V7867PhaseBarHidden(),"returning to an idle Raid tab does not reveal stale loading controls")
    V48Assert(IRPLoad() && !IsObject(a.Work) && V7867PhaseBarHidden(),"cached phases do not flash a loading bar")
    IRPState().Cache := [],IRPState().Models := []
    V48Assert(IRPLoad(),"second replay starts")
    V58SelectTab(1),IALoadPump(),IRPPoll(),V58SelectTab(7)
    V48Assert(V7867PhaseBarHidden(),"background completion clears the indicator before returning to Raid")
    V48Assert(!DllCall("IsWindowVisible","Ptr",IP.Gui.Hwnd),"the normal parser window is never shown")
}
V7867PhaseBarService(kind,job)
{
    if job.HasOwnProp("BarChecked")
        return
    job.BarChecked := true
    V48Assert(V7867PhaseBarVisible(),"indicator stays visible during replay")
    V58SelectTab(1)
    V48Assert(V7867PhaseBarHidden(),"other main tabs hide the phase indicator")
    V58SelectTab(7)
    V48Assert(V7867PhaseBarVisible(),"returning to Raid resumes the busy indicator")
}
V7867PhaseGuardCases()
{
    for mode in ["before","cancel","selection","combat","revision","source"]
        V7864PhaseFixture(V7867PhaseGuardCase.Bind(mode))
}
V7867PhaseGuardCase(mode,s,seg,path,text)
{
    a := IAState()
    if mode="source"
        V7866Indexed(path)
    V48Assert(IRPLoad() && V7867PhaseBarVisible(),"guard case starts with visible feedback: " mode)
    job := a.Work
    if mode="before"
        IRPCancel()
    else if mode="source" {
        stamp := FileGetTime(path,"M"),f := FileOpen(path,0x703,"UTF-8-RAW")
        f.Pos := 0,f.Write(StrReplace(text,"Valley","Vallez")),f.Close(),FileSetTime(stamp,path,"M")
        IALoadPump(),IRPPoll()
    } else
        IALoadPump(V7864PhaseService.Bind(mode)),IRPPoll()
    V48Assert(!job.Timing.Committed && !a.Busy && V7867PhaseBarHidden(),"cancellation or failure clears loading feedback: " mode)
}

V7868DropdownRetirement() => V623With(V7868DropdownRetirementCase)
V7868DropdownRetirementCase(f)
{
    IUDApplyWindow(f.Gui,"analysis"),s := IUDState(),h := f.DDL.Hwnd,good := s.Controls[h]
    try {
        for malformed in [{}, {ErrorType:"DropdownFacePaint"}, 0, {Control:0},
            {Control:f.DDL}, {Control:f.Gui,Tint:false,ErrorType:"none",ThemeResult:0}] {
            s.Controls[-7868] := malformed
            IUDPrune()
            V48Assert(!s.Controls.Has(-7868),"incomplete appearance entries cannot break the next review window")
            V48Assert(s.Controls[h]=good && f.DDL.Value=2,"valid selector and selection survive cleanup")
        }
        dead := Gui(),c := dead.AddDropDownList(,["one"]),dh := c.Hwnd
        IUDApplyWindow(dead,"analysis"),dead.Destroy(),IUDPrune()
        V48Assert(!s.Controls.Has(dh),"closed dropdown is retired")
        V48Assert(s.Controls[h]=good,"another window's dropdown stays registered")
    }
    finally {
        if s.Controls.Has(-7868)
            s.Controls.Delete(-7868)
    }
}

V7868CoratanniScope()
{
    area := "3367421863788544",story := "836045448953651",veteran := "836045448953652"
    for mode in [story,veteran] {
        context := {AreaId:area,ModeId:mode},p := IPXScopedProfile(context,"RAV-CR")
        V48Assert(IsObject(p) && p.Mode=mode && p.Key="RAV-CR","recorded Coratanni Story and Veteran scopes are recognized")
        for pair in [["3371437658210304","coratanni"],["3374109127868416","pearl"],["3371441953177600","ruugar"]] {
            actor := IPActor("Recorded NPC {" pair[1] "}:987654321")
            rule := IPBRule(actor,context)
            V48Assert(IsObject(rule) && rule.Key="RAV-CR" && rule.Group=pair[2],"recognition uses observed NPC IDs, not names")
        }
        V48Assert(p.Required="ruugar" && p.Continuity && p.Script="ruugar","Pearl's death and the room transition do not end the encounter")
    }
    for context in [{AreaId:"wrong",ModeId:veteran},{AreaId:area,ModeId:"836045448953654"},{AreaId:area,ModeId:""}] {
        V48Assert(!IsObject(IPXScopedProfile(context,"RAV-CR")),"unsupported areas and difficulties are not inferred")
        V48Assert(!IsObject(IPBRule(IPActor("Coratanni {3371437658210304}:987654321"),context)),"unsupported scopes do not acquire the boss name")
    }
    V48Assert(!IsObject(IPBRule(IPActor("@Coratanni#987654321"),{AreaId:area,ModeId:veteran})),"players with the boss name stay players")
    V48Assert(IPXProfiles()["RAV-CR"].Mode=story,"original Story profile is unchanged")
    V48Assert(IPXScopedProfile({AreaId:area,ModeId:story},"RAV-CR").Marker="3443983950807040","Story completion marker is unchanged")
    V48Assert(IPXScopedProfile({AreaId:area,ModeId:veteran},"RAV-CR").Marker="3468731552366592","Veteran uses its recorded completion marker")
    p := {Boss:"RAV-CR",Name:"Coratanni / Ruugar",Mode:veteran,Area:area,Group:"RAV-CR|" area "|" veteran}
    options := IGVBossBrowseOptions([{Pull:p}],"coratanni",true)
    V48Assert(options.Length=1 && options[1].Key=p.Group,"Veteran Coratanni remains visible with lower difficulties hidden")
}

V7868ProgressionOpen() => V68ReviewUIFixture(V7868ProgressionOpenCase)
V7868ProgressionOpenCase(review)
{
    global IP,Audio
    v := IGVState(),ux := IUXState(),oldMarks := ux.Marks,live := IP.Live,queue := Audio.Queue
    before := V7868RowsJson(v.Rows),registry := IUDState().Controls
    try {
        Loop 3 {
            registry[-7868] := {ErrorType:"DropdownFacePaint"}
            IGVOpenRow(v.Controls["Rows"],1)
            V48Assert(IPMUiHandle(IPRState().DetailGui) && IPRState().DetailPull=v.Rows[1].Pull,"double-click opens the selected pull despite stale appearance data")
            V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IPRState().DetailGui.Hwnd,"Int"),"diagnostic stays hidden")
            IPRCloseDetails()
            ux.Marks := [],IUXMark(v.Rows[1]),IUXMark(v.Rows[2])
            registry[-7868] := {}
            V48Assert(IUXCompareOpen(),"comparison opens after the pull details close")
            V48Assert(review.A.Key=IGRVEntryKey(v.Rows[1]) && review.B.Key=IGRVEntryKey(v.Rows[2]),"comparison retains both marked identities")
        }
        V48Assert(V7868RowsJson(v.Rows)=before && IP.Live=live && Audio.Queue=queue && !IP.Active,"review does not alter history, live data or audio")
    }
    finally {
        IPRCloseDetails(),ux.Marks := oldMarks
        if registry.Has(-7868)
            registry.Delete(-7868)
    }
}
V7868RowsJson(rows)
{
    packed := []
    for row in rows
        packed.Push([row.Key,IGVPackPull(row.Pull)])
    return IGVJson(packed)
}

V7870TrandosHealth()
{
    ids := ["4245970309087232","4245987488956416","4245983193989120","4245978899021824"]
    seg := V63Segment("DX-TR"),seg.AreaId := "833571547775792"
    for i,id in ids
        IGPObserve(seg,V63Event("Damage",id,40,i*1000),i*1000)
    before := IGVJson(IGPHPack(IGPCompact(seg).Health))
    idle := V63Event("Activate",ids[2],100,5000),idle.Kind := "Other",idle.Source.Key .= "new"
    IGPObserve(seg,idle,5000)
    V48Assert(before=IGVJson(IGPHPack(IGPCompact(seg).Health)),"idle full-health respawn cannot erase the previous pull's HP")
    zero := V63Event("Activate",ids[2],0,6000),zero.Kind := "Other",zero.SourceHP.Maximum := 18188932
    IGPObserve(seg,zero,6000)
    p := IGPCompact(seg)
    V48Assert(p.Health.Comparable && p.Health.Hp=30,"zero-HP despawn keeps the observed combat scale in the combined total")
    V48Assert(!p.Kill && !p.Health.Targets[2].Dead,"HP zero alone is neither an NPC death nor an encounter kill")
    dead := V63Event("Death",ids[2],0,6001,"900000000000001",true),dead.TargetHP.Maximum := 18188932
    IGPObserve(seg,dead,6001)
    V48Assert(seg.PhaseProgress["MainHP:two"].Dead,"recorded death still marks the same actor defeated")
    bad := V63Event("Damage",ids[1],40,7000),bad.SourceHP.Maximum := 200
    IGPObserve(seg,bad,7000)
    V48Assert(!IGPCompact(seg).Health.Comparable,"nonzero maximum changes remain guarded")
    IGPObserve(seg,V63Event("Damage","4381150109761536",70,8000),8000)
    V48Assert(IGPCompact(seg).Health.Comparable && IGPCompact(seg).Health.Hp=70,"Hunter engagement has its own HP scale")
    seg := V63Segment("DX-TR"),seg.AreaId := "833571547775792"
    for i,id in ids
        IGPObserve(seg,V63Event("Damage",id,40,i*1000),i*1000)
    idle.Kind := "Damage",idle.Amount := 100,IGPObserve(seg,idle,5000)
    V48Assert(!IGPCompact(seg).Health.Comparable,"damage from a different boss instance cannot silently merge rosters")
}

V7870ChannelFixture(variant := "sparse")
{
    lines := V7832Fixture(variant)
    for i,line in lines {
        line := StrReplace(line,"10/1000","25/1000")
        for pair in [["08.999","12.099"],["09.000","12.100"],["09.200","12.300"],
            ["09.300","12.400"],["11.501","14.601"],["20.001","23.001"]]
            line := StrReplace(line,"00:00:" pair[1],"00:00:" pair[2])
        lines[i] := line
    }
    return lines
}

V7870TrandosEnding()
{
    for variant in ["sparse","dead recorder","all dead","revived","no witness","late witness","healing only","outsider","late death"] {
        won := variant="sparse" || variant="dead recorder"
        V565Check(V7870ChannelFixture(variant),true,won,200,1,12100,!won)
    }
    for variant in ["interrupted","reset","no cast","no flame","no removal","wrong instance","wrong effect","high cast","high removal","unknown hp","wrong mode"]
        V565Check(V7870ChannelFixture(variant),false,false,0,1,0)
    lines := V7870ChannelFixture()
    for i,line in lines
        lines[i] := StrReplace(line,"00:00:12.100","00:00:12.099")
    V565Check(lines,false,false,0,1,0)
    V48Assert(IPTDLowHealth({Known:true,Current:316620,Maximum:10553973},3),"recorded final three-percent range allows integer rounding")
    V48Assert(!IPTDLowHealth({Known:true,Current:316621,Maximum:10553973},3),"above the observed ending range stays unconfirmed")
    data := IPNewData("Trandos partial coverage outcome")
    for line in V7870ChannelFixture()
        IPFeedLine(data,line)
    IPFinalizeData(data,"fixture end"),seg := data.Segments[1],seg.Partial := true
    V48Assert(IPRecordedKill(seg) && ILBFight(seg).Result="Kill" && IGPCompact(seg).Kill,
        "an earlier coverage gap does not erase independently observed completion and survival")
    V48Assert(seg.Partial && IGPCompact(seg).Partial,"incomplete coverage remains disclosed on a confirmed kill")
    seg.Trandos.Status := "survival unconfirmed"
    V48Assert(!IPRecordedKill(seg),"partial terminal with no survivor is still not a kill")
}

; Private fixture logs, hidden controls, no live reader or speech.
V7871ReviewStop() => V694RotationPageFixture(V7871ReviewStopCase)
V7871ReviewGuards() => V694RotationPageFixture(V7871ReviewGuardsCase)
V7871ReviewCancel() => V694RotationPageFixture(V7871ReviewCancelCase)
V7871IntercedeIcon() => V69IconsFixture(V7871IntercedeIconCase)

V7871ReviewFinish()
{
    a := IAState()
    Loop 100 {
        if !IsObject(a.Work)
            break
        IALoadPump()
    }
    IAQueryPump(),IPWRotationPoll()
}

V7871ReviewStopCase(a,source,seg,path,text)
{
    global IP,IPAS
    IP.Live := IPNewData("PRIVATE LIVE"),V762QueuedLive(),live := IP.Live
    V48Assert(IPWRotationLoad(),"Rotation accepts an earlier fight while live collection is active")
    r := IPWRotationState(),job := r.Job
    V48Assert(!IP.Active && !IPAS.Pending && !IP.Follow,"review stops collection and pending autostart")
    V48Assert(IP.Live=live && live.Lines=2 && IP.Queue.Length=550,"review preserves the live session and every queued record")
    V48Assert(r.Controls["Loading"].LoadingMode!="hide" && InStr(IP.Status,"Parse"),"loading indicator and manual restart instruction are visible immediately")
    IALoadPump()
    V48Assert(IP.Head<=IP.Queue.Length && a.Work=job && !IsObject(a.Data),"review waits while the bounded live pump drains its queue")
    V7871ReviewFinish()
    V48Assert(!r.Pending && IsObject(r.Data) && r.Data.BaseVerified && job.Timing.Committed,"rotation loads the verified earlier fight after drain")
    V48Assert(live.Lines=552 && live.Finished && !live.Halted,"all queued live records finish without being dropped")
    V48Assert(!IP.Active && IP.Selected=1 && IP.Offline=source,"review keeps selected fight and does not restart collection")
    data := r.Data,IP.Live := IPNewData("PRIVATE LIVE"),IP.Active := true
    V48Assert(IPWRotationLoad() && !IP.Active && r.Pending,"even a cached rotation stops live collection before reuse")
    V7871ReviewFinish()
    V48Assert(r.Data=data && !IP.Active && !r.Pending,"cached rotation retains its verified dataset")
    IP.Live := IPNewData("PRIVATE LIVE"),IP.Active := true
    V48Assert(IAStartSelected() && !IP.Active,"Analysis Load fight uses the same automatic stop")
    V7871ReviewFinish()
    V48Assert(a.Data=data && !a.Busy,"Analysis completes verified reuse after stopping collection")
}

V7871ReviewGuardsCase(a,source,seg,path,text)
{
    global IP
    IP.Active := true,oldEnd := seg.End,seg.End := -1
    V48Assert(!IPWRotationLoad() && IP.Active,"incomplete fight does not stop collection")
    seg.End := oldEnd,seg.SourcePath := path ".missing"
    V48Assert(!IPWRotationLoad() && IP.Active,"missing original does not stop collection")
    seg.SourcePath := path,IP.Busy := true
    V48Assert(!IAStartSelected() && IP.Active,"a busy parser is not interrupted")
    IP.Busy := false,IP.Live := IPNewData("PRIVATE LIVE")
    V48Assert(IAStartSelected() && !IP.Active,"valid request stops only after source preparation")
    job := a.Work,IP.Selected := 2
    IALoadPump()
    V48Assert(!IsObject(a.Work) && !IsObject(job.Snapshot.File) && !IsObject(a.Data),"changed selection never installs stale Analysis data")
    IP.Selected := 1,IP.Live := IPNewData("PRIVATE LIVE"),IP.Active := true
    V48Assert(IPWRotationLoad(),"prepare restart race check")
    job := IPWRotationState().Job,IP.Active := true
    IALoadPump(),IPWRotationPoll()
    V48Assert(IP.Active && !IsObject(job.Snapshot.File) && !IsObject(a.Data),"new live collection cancels review without stopping the new run")
    IP.Active := false
}

V7871ReviewCancelCase(a,source,seg,path,text)
{
    global IP
    IPWRotationLoad(),previous := V694RotationFinish()
    IP.Live := IPNewData("PRIVATE LIVE"),V762QueuedLive(),live := IP.Live
    V48Assert(IPWRotationLoad(),"start queued handoff with a previous completed result")
    job := IPWRotationState().Job,IPWRotationCancel()
    V48Assert(!IP.Active && IP.Queue.Length=550 && !IsObject(job.Snapshot.File),"cancel closes only the requested review and retains queued live data")
    V762Drain()
    V48Assert(live.Lines=552 && live.Finished && a.Data=previous,"cancel retains previous analysis and completes live records")
    IP.Live := IPNewData("PRIVATE LIVE"),V762QueuedLive(12)
    f := FileOpen(path,"r","UTF-8"),recovery := IPLateCreate(IP.Live,f,path,"private-recovery",f.Length)
    IP.LateStart := recovery
    V48Assert(IPWRotationLoad() && !IPLateBusy() && !IsObject(recovery.File),"review cancels pending live catch-up and releases its reader")
    V7871ReviewFinish()
    V48Assert(!IP.Active && IsObject(a.Data) && !a.Busy,"review finishes after a live catch-up cancellation")
}

V7871IntercedeIconCase(s)
{
    rotation := IAVRState(),saved := rotation.Icons,rotation.Icons := Map()
    try {
        id := "1984695797547441"
        ev := IPParseLine(IPDemoLine(100000,"@Private Fixture#71","=","Activate",0,false,-1,"Intercede",id))
        icon := IAVRIcon(ev.AbilityId,ev.Ability),info := Buffer(A_PtrSize=8 ? 32 : 24)
        V48Assert(ev.Kind="Activate" && ev.AbilityId=id,"recorded Intercede activation retains exact identity")
        V48Assert(IAIIconPath(id)=IAIIconPath("1984695797547008"),"observed Intercede variant uses verified existing artwork")
        V48Assert(IsObject(icon) && DllCall("Gdi32\GetObjectW","Ptr",icon.Handle,"Int",info.Size,"Ptr",info),"Intercede produces a real native Rotation bitmap")
        V48Assert(NumGet(info,4,"Int")=64 && NumGet(info,8,"Int")=64 && NumGet(info,18,"UShort")=24,"Rotation bitmap has valid dimensions and opaque pixels")
        V48Assert(IAIIconPath("1984695797547442","Intercede")="","unverified neighboring IDs are not guessed")
    }
    finally {
        for key,item in rotation.Icons
            if IsObject(item) && item.HasOwnProp("Handle")
                DllCall("Gdi32\DeleteObject","Ptr",item.Handle)
        rotation.Icons := saved
    }
}

; Native, isolated window destruction and the exact production report export.
V7872DropdownLifetime() => V623With(V7872DropdownLifetimeCase)
V7872DropdownLifetimeCase(f)
{
    global IUB
    IUDApplyWindow(f.Gui,"analysis"),s := IUDState(),count := s.Controls.Count
    for tint in [true,false] {
        IUB.DropdownTint := tint
        Loop 12 {
            g := Gui(),ddl := g.AddDropDownList("w220 Choose2",["First","Second"]),h := ddl.Hwnd
            try {
                IUDApplyWindow(g,"analysis"),g.Show("NA w250 h90")
                Sleep(-1)
                V48Assert(ddl.Value=2 && s.Controls.Has(h),"appearance keeps native selection and registers the live window")
                g.Destroy()
                V48Assert(!s.Controls.Has(h),"native destruction retires dropdown metadata immediately, even with tint off")
                V48Assert(!IUDStyleState().Controls.Has(h) && s.Controls.Count=count,"closed review controls cannot accumulate between comparisons")
            }
            finally {
                if IPMGuiAlive(g)
                    g.Destroy()
            }
        }
    }
    h := f.DDL.Hwnd,IUDApplyWindow(f.Gui,"analysis"),first := s.Controls[h].Token
    IUDApplyWindow(f.Gui,"analysis"),current := s.Controls[h]
    IUDForget(h,first)
    V48Assert(s.Controls[h]=current && f.DDL.Value=2,"a stale destruction token cannot remove a newer registration")
    DllCall("User32\RemovePropW","Ptr",h,"Str","Iris.Dropdown.Registration","UPtr")
    IUDPrune()
    V48Assert(!s.Controls.Has(h) && f.DDL.Value=2,"a live but unregistered or reused handle cannot inherit old appearance metadata")
    IUDApplyWindow(f.Gui,"analysis")
    for criticalState in [0,7,100,0xFFFFFFFF] {
        prior := Critical(criticalState)
        try {
            IUDPrune()
            V48Assert(A_IsCritical=criticalState,"registry cleanup restores caller scheduling")
        }
        finally Critical(prior)
    }
    token := s.Controls[h].Token,callback := s.Callback,refData := 0
    V48Assert(DllCall("Comctl32\GetWindowSubclass","Ptr",h,"Ptr",callback,"UPtr",78720,"UPtr*",&refData,"Int") && refData=token,"native lifetime observer installed with current token")
    for criticalState in [0,7,100,0xFFFFFFFF] {
        prior := Critical(criticalState)
        try {
            V48Assert(IUDShutdown()=0 && !s.Controls.Count && A_IsCritical=criticalState,"repeated exit cleanup never vetoes termination and restores scheduling")
        }
        finally Critical(prior)
    }
    V48Assert(!DllCall("Comctl32\GetWindowSubclass","Ptr",h,"Ptr",callback,"UPtr",78720,"UPtr*",&refData,"Int"),"shutdown detaches actual native observer before static teardown")
    V48Assert(!DllCall("User32\GetPropW","Ptr",h,"Str","Iris.Dropdown.Registration","UPtr") && f.DDL.Value=2,"shutdown clears scalar registration without destroying or resetting the dropdown")
    V48Assert(s.Callback=callback,"callback thunk remains valid for native calls already in flight")
    IUDApplyWindow(f.Gui,"analysis"),current := s.Controls[h]
    IUDForget(h,token)
    V48Assert(current.Token>token && s.Controls[h]=current && f.DDL.Value=2,"appearance can register again after an exit veto without accepting stale destruction")
}

V7872CompareLifetime() => V68ReviewUIFixture(V7872CompareLifetimeCase)
V7872CompareLifetimeCase(s)
{
    global IP,Audio
    v := IGVState(),ux := IUXState(),oldMarks := ux.Marks,live := IP.Live,queue := Audio.Queue
    before := V7868RowsJson(v.Rows)
    IGRVClose(),IPRCloseDetails(),IUDPrune(),count := IUDState().Controls.Count
    resources := ""
    try {
        Loop 30 {
            IGVOpenRow(v.Controls["Rows"],1),IPRState().DetailGui.Show("NA")
            Sleep(-1)
            IPRCloseDetails()
            ux.Marks := [],IUXMark(v.Rows[1]),IUXMark(v.Rows[2])
            V48Assert(IUXCompareOpen(),"marked pulls open a fresh comparison after closing pull details")
            s.Gui.Show("NA"),Sleep(-1)
            s.A.Data := V68ReviewUIDataset(v.Rows[1]),s.A.DataKey := s.A.Key
            s.B.Data := V68ReviewUIDataset(v.Rows[2]),s.B.DataKey := s.B.Key
            IGRVSyncSide("A"),IGRVSyncSide("B"),IGRVRefresh()
            V48Assert(s.A.Key=IGRVEntryKey(v.Rows[1]) && s.B.Key=IGRVEntryKey(v.Rows[2]),"A and B keep the exact marked identities")
            V48Assert(s.Controls["Metrics"].GetCount()>0 && !s.Busy,"loaded comparisons populate native result tables")
            Sleep(-1),IGRVClose()
            V48Assert(IUDState().Controls.Count=count,"comparison selectors retire before another window opens")
            if A_Index=5
                resources := DllCall("User32\GetGuiResources","Ptr",DllCall("GetCurrentProcess","Ptr"),"UInt",0,"UInt")
        }
        after := DllCall("User32\GetGuiResources","Ptr",DllCall("GetCurrentProcess","Ptr"),"UInt",0,"UInt")
        V48Assert(after<=resources+4,"repeated comparisons do not accumulate GDI objects after warmup")
        V48Assert(V7868RowsJson(v.Rows)=before && IP.Live=live && Audio.Queue=queue && !IP.Active,"comparison preserves saved data, live state and audio")
    }
    finally {
        IPRCloseDetails(),IGRVClose(),ux.Marks := oldMarks
    }
}

V7872BetaExport() => V58Isolated(V7872BetaExportCase)
V7872BetaExportCase()
{
    s := IBRState(),oldRoot := s.Root,root := A_ScriptDir "\beta-export-private"
    DirCreate(root),s.Root := root
    try {
        path := A_ScriptDir "\beta-production-default.zip"
        IBRSaveReport(path)
        V48Assert(FileGetSize(path)>500,"production default report includes its README and saves successfully")
        attach := root "\chosen log.txt",text := "Explicitly selected fixture é Ω`r`n"
        if FileExist(attach)
            FileDelete(attach)
        FileAppend(text,attach,"UTF-8-RAW")
        IBRSaveReport(A_ScriptDir "\beta production é.zip","A note with é Ω",attach)
        V48Assert(FileRead(attach,"UTF-8")=text,"report attachment leaves the original log untouched")
        V48Assert(FileExist(A_ScriptDir "\beta production é.zip"),"production export accepts spaces and Unicode in the destination")
        FileAppend("keep existing",root "\cancel.zip")
        V64Reject((*)=>IBRSaveReport(root "\cancel.zip","","",V7848CancelZip),"canceling the production exporter propagates cancellation")
        V48Assert(FileRead(root "\cancel.zip")="keep existing","canceling keeps the previous destination intact")
        for name in ["../report.txt","sub/report.txt","C:\report.txt","report.exe"]
            V64Reject((*)=>IBRZip(root "\bad.zip",[{Name:name,Text:"bad"}]),"archive entry validation still rejects paths and non-text names")
        remaining := 0
        loop files root "\*.iris-partial-*","F"
            remaining += 1
        V48Assert(remaining=0 && !FileExist(root "\bad.zip"),"failed and canceled saves leave no partial archive")
    }
    finally {
        s.Root := oldRoot
        DirDelete(root,true)
    }
}

V07872DiagnosticSidecar()
{
    global SELF_TEST
    V48Assert(SELF_TEST, "sidecar checks run only in the isolated harness")
    valid := A_ScriptDir "\IrisDiagnostics.txt"
    code := IrisTestReadSuite(valid)
    V48Assert(StrLen(code)>1000, "matching sidecar is accepted")
    V48Assert(InStr(code,"Suspend(true)"), "suite suspends gameplay hotkeys")
    path := A_ScriptDir "\sidecar-invalid.txt"
    try {
        IrisTestWriteText(path, code "`r`n; mismatch")
        rejected := false
        try IrisTestReadSuite(path)
        catch Error as err
            rejected := InStr(err.Message,"does not match")
        V48Assert(rejected, "edited or stale suite cannot execute")
        FileDelete(path)
        rejected := false
        try IrisTestReadSuite(path)
        catch Error as err
            rejected := InStr(err.Message,"is missing")
        V48Assert(rejected, "missing suite produces a useful error")
        IrisTestWriteText(path, "truncated")
        rejected := false
        try IrisTestReadSuite(path)
        catch Error as err
            rejected := InStr(err.Message,"does not match")
        V48Assert(rejected, "truncated suite cannot execute")
    }
    finally {
        if FileExist(path)
            FileDelete(path)
    }
}

V7875OpacityPanels() => V65UITimerIsolated(V7875OpacityPanelsCase)
V7875OpacityPanelsCase(*)
{
    global IP,IPM,IEF,IEFU
    before := {IP:IP,IEF:IEF,IEFU:IEFU}
    try {
        IP := IPNewApp(),IEF := IEFNewState(),IEFU := IEFUNewState()
        IPM.Enabled := true,IPM.Mode := 2,IPM.Opacity := 150
        IPM.PreviewSnapshot := IPMCreateRaidPreview(8),IPM.PreviewCount := 8
        for kind,entry in IOICatalog() {
            p := IPM.Panels[kind],p.Width := 300
            IPMEnsureGui(kind,0,p),IPMRender(kind,IPM.PreviewSnapshot,p),IPMParserUpdate(p),IOHSyncPanel(p)
            e := p.Gui.IOH
            V48Assert(V7875Alpha(p.Gui)=150 && (NumGet(e.Canvas.Bits,"UInt")>>24)=255,"only the body fades: " kind)
            style := DllCall("GetWindowLongW","Ptr",e.Gui.Hwnd,"Int",-20,"UInt")
            V48Assert((style & 0x08080020)=0x08080020,"title is layered, click-through and non-activating: " kind)
            V48Assert(DllCall("GetWindow","Ptr",e.Gui.Hwnd,"UInt",4,"Ptr")=p.Gui.Hwnd,"title belongs to its panel")
            V48Assert(!DllCall("IsWindowVisible","Ptr",e.Gui.Hwnd,"Int"),"hidden diagnostics do not show titles")
            V7875HeaderPixels(p.Gui,p.Layout.W,p.Layout.Head)
            paints := e.Paints,IOHSyncPanel(p)
            V48Assert(e.Paints=paints,"unchanged title reuses its native bitmap")
            IPM.Editing := true,IPMStyle(p),IOHSyncPanel(p)
            V48Assert(V7875Alpha(p.Gui)=150 && !(WinGetExStyle(p.Gui.Hwnd)&0x20),"preview keeps body opacity and accepts editing")
            IPM.Editing := false
        }
        p := IPM.Panels["Damage"],oldTitle := p.Heading.Text,oldPaints := p.Gui.IOH.Paints
        p.Heading.Text := "Confirm restart?",p.ParserButton.Text := "Confirm",p.ParserAction := "Confirm"
        IOHSyncPanel(p)
        V48Assert(p.Gui.IOH.Paints>oldPaints,"changed title and button refresh together")
        V7875HeaderPixels(p.Gui,p.Layout.W,p.Layout.Head)
        p.Heading.Text := oldTitle
        for dpi in [96,144,192] {
            l := IPMCleanLayout(360,240,12,dpi,3840,2160,false,false,true,8,24)
            IPMArrange(p,l,false),IOHSyncPanel(p)
            p.Gui.IOH.Gui.GetClientPos(,,&w,&h)
            V48Assert(w=l.W && h=l.H,"foreground layer follows resized body at each DPI")
            V7875HeaderPixels(p.Gui,l.W,l.Head)
        }
        headerHwnd := p.Gui.IOH.Gui.Hwnd,p.Gui.Destroy()
        V48Assert(!DllCall("IsWindow","Ptr",headerHwnd,"Int"),"external owner destruction destroys its title too")
        IPMEnsureGui("Damage",0,p),IPMRender("Damage",IPM.PreviewSnapshot,p),IOHSyncPanel(p)
        V48Assert(IPMGuiAlive(p.Gui.IOH.Gui),"destroyed panels rebuild without stale title controls")
        oldTitle := p.Gui.IOH.Gui
        IPMDestroyPanels()
        V48Assert(!IPMGuiAlive(oldTitle),"normal panel retirement releases the title")
    }
    finally {
        IPMDestroyPanels(),IP := before.IP,IEF := before.IEF,IEFU := before.IEFU
    }
}

V7875Alpha(g)
{
    key := 0,alpha := 0,flags := 0
    V48Assert(DllCall("GetLayeredWindowAttributes","Ptr",g.Hwnd,"UInt*",&key,"UChar*",&alpha,"UInt*",&flags,"Int") && flags=2,
        "native constant-alpha layer has no color-key holes")
    return alpha
}

V7875HeaderPixels(owner,w,h)
{
    original := ISRICanvas(w,h),copy := ISRICanvas(w,h)
    try {
        SendMessage(0x317,original.DC,0x1C,owner.Hwnd)
        DllCall("BitBlt","Ptr",copy.DC,"Int",0,"Int",0,"Int",w,"Int",h,"Ptr",owner.IOH.Canvas.DC,"Int",0,"Int",0,"UInt",0xCC0020)
        a := Buffer(A_PtrSize=8 ? 32 : 24,0),b := Buffer(a.Size,0)
        DllCall("GetObjectW","Ptr",original.Bitmap,"Int",a.Size,"Ptr",a)
        DllCall("GetObjectW","Ptr",copy.Bitmap,"Int",b.Size,"Ptr",b)
        DllCall("Gdi32\GdiFlush")
        bytes := NumGet(a,12,"Int")*h,offset := A_PtrSize=8 ? 24 : 20
        same := DllCall("ntdll\RtlCompareMemory","Ptr",NumGet(a,offset,"Ptr"),"Ptr",NumGet(b,offset,"Ptr"),"UPtr",bytes,"UPtr")
        if same!=bytes {
            ISRIWritePng(original.Bitmap,A_ScriptDir "\header-original.png")
            ISRIWritePng(copy.Bitmap,A_ScriptDir "\header-copy.png")
        }
        V48Assert(same=bytes,"opaque title preserves every native header pixel, including icons and actions")
    }
    finally ISRICanvasClose(original),ISRICanvasClose(copy)
}

V7875OpacityTimers() => V65UITimerIsolated(V7875OpacityTimersCase)
V7875OpacityTimersCase(*)
{
    global IPM,IRTPrefs,IRT
    IPM.Opacity := 100,IRTURender(IRT,1000),p := IRTPrefs
    V48Assert(p.LastError="" && p.BarsGui.HasOwnProp("IOH"),"timer render creates a title without errors")
    V48Assert(V7875Alpha(p.BarsGui)=100 && (NumGet(p.BarsGui.IOH.Canvas.Bits,"UInt")>>24)=255,"timer body and title have independent opacity")
    V7875HeaderPixels(p.BarsGui,p.Width,p.Layout.Header)
    IPM.Editing := true,IRTURender(IRT,1100)
    V48Assert(V7875Alpha(p.BarsGui)=100 && !(WinGetExStyle(p.BarsGui.Hwnd)&0x20),"unlocked timer still previews opacity and accepts dragging")
    V7875HeaderPixels(p.BarsGui,p.Width,p.Layout.Header)
    key := 0,alpha := 0,flags := 0
    DllCall("GetLayeredWindowAttributes","Ptr",p.AlertGui.Hwnd,"UInt*",&key,"UChar*",&alpha,"UInt*",&flags)
    V48Assert((flags&1) && key=0x010101 && !p.AlertGui.HasOwnProp("IOH"),"center warning keeps its transparent background")
    IPM.Opacity := 255,IRTURender(IRT,1200)
    V48Assert(V7875Alpha(p.BarsGui)=255 && !DllCall("IsWindowVisible","Ptr",p.BarsGui.IOH.Gui.Hwnd,"Int"),"full opacity needs no visible extra layer")
    title := p.BarsGui.IOH.Gui,IRTUShutdown()
    V48Assert(!IPMGuiAlive(title),"timer shutdown releases its owned title")
}

V7875OpacitySettings() => V7839Fixture(V7875OpacitySettingsCase)
V7875OpacitySettingsCase()
{
    global IPM
    V48Assert(IPM.Opacity=115,"background defaults to 45 percent opacity")
    IPMOpenSettings()
    V48Assert(IPM.OpacityControl.Type="Slider" && IPM.OpacityControl.Value=115 && IPM.OpacityPercent.Text="45%",
        "slider displays percent without rounding the stored value")
    for opacity in [80,150,225,255] {
        IPM.OpacityControl.Value := opacity,IOHOpacityLabel()
        V48Assert(IPM.OpacityPercent.Text=Round(opacity*100/255) "%","percentage tracks slider")
        V48Assert(IPMApplySettings() && IPM.Opacity=opacity,"Save retains exact native opacity value")
        IPMOpenSettings()
        V48Assert(IPM.OpacityControl.Value=opacity,"reopening restores saved opacity")
    }
    IPM.Opacity := 178,ILPSyncOpenControls()
    V48Assert(IPM.OpacityControl.Value=178 && IPM.OpacityPercent.Text="70%","layout presets update both slider and label")
}

V7875OpaqueText() => V65UITimerIsolated(V7875OpaqueTextCase)
V7875OpaqueTextCase(*)
{
    global IPM
    IPM.Opacity := 80
    g := Gui("-Caption -Border -DPIScale"),g.BackColor := "101010"
    try {
        g.SetFont("s14 Bold cFFFFFF","Segoe UI")
        g.AddText("x0 y0 w400 h30 Background202020 +0x200","Opaque header")
        g.AddProgress("x0 y30 w400 h35 Range0-100 -Theme cBD4040 Background101010",100)
        g.AddText("x5 y30 w390 h35 BackgroundTrans +0xC280","White name and 123,456")
        g.AddText("x5 y65 w390 h35 BackgroundTrans cBD4040 +0x280","Coloured text matches the bar")
        g.AddText("x5 y100 w390 h35 BackgroundFFFFFF c202020 +0x280","Dark text on a light fill")
        g.AddText("x5 y135 w390 h35 Background101010 c101010 +0x280","Matching ink and background")
        g.AddText("x5 y170 w150 h64 BackgroundTrans cFFFFFF","Long text wraps across lines")
        disappearing := g.AddText("x200 y170 w190 h64 BackgroundTrans c44DD88 +0xC282","Right-aligned ellipsis text")
        g.Show("Hide w400 h240"),IOHSync(g,30)
        layer := g.IOH.Canvas,parts := IOHParts(g,400,240)
        assertions := 0
        for p in parts {
            if p.Y<30 || p.Type!="Text" || p.Ink=p.Back
                continue
            V7875NativeGlyphs(p,layer),assertions += 1
        }
        V48Assert(assertions=5,"white, coloured, dark, wrapped and truncated native lettering checked")
        V48Assert((NumGet(layer.Bits,(200*400+185)*4,"UInt")>>24)=0,"body gaps remain transparent")
        V48Assert((NumGet(layer.Bits,(40*400+399)*4,"UInt")>>24)=0,"bar colour is not mistakenly copied into the opaque layer")
        sameColour := 0
        Loop 35 {
            y := 135+A_Index-1
            Loop 390 {
                pixel := NumGet(layer.Bits,(y*400+5+A_Index-1)*4,"UInt")
                if (pixel>>24)>=254 && (pixel & 0xFFFFFF)=0x101010
                    sameColour += 1
            }
        }
        V48Assert(sameColour>20,"matching text/background still has solid glyphs")
        oldPaints := g.IOH.Paints,IPM.Opacity := 225,IOHSync(g,30)
        V48Assert(g.IOH.Paints=oldPaints,"changing background alpha never changes lettering")
        disappearing.Visible := false,IOHSync(g,30),nonzero := 0
        Loop 64 {
            y := 170+A_Index-1
            Loop 190
                nonzero += (NumGet(g.IOH.Canvas.Bits,(y*400+200+A_Index-1)*4,"UInt")>>24)>0
        }
        V48Assert(nonzero=0,"hidden text leaves no old glyphs")
        canvas := g.IOH.Canvas,g.Destroy(),IOHDispose(g)
        V48Assert(canvas.Closed,"foreground bitmap and DC retire after external destruction")
    }
    finally IPMDisposeGui(g)
}

V7875NativeGlyphs(p,layer)
{
    native := ISRICanvas(p.W,p.H),brush := DllCall("CreateSolidBrush","UInt",p.Back,"Ptr")
    try {
        rect := IUSRect(0,0,p.W,p.H),DllCall("FillRect","Ptr",native.DC,"Ptr",rect,"Ptr",brush)
        SendMessage(0x317,native.DC,0xC,p.Hwnd),DllCall("GdiFlush")
        info := Buffer(A_PtrSize=8 ? 32 : 24,0),DllCall("GetObjectW","Ptr",native.Bitmap,"Int",info.Size,"Ptr",info)
        bits := NumGet(info,A_PtrSize=8 ? 24 : 20,"Ptr"),stride := NumGet(info,12,"Int"),cores := 0,bad := 0
        expected := ((p.Ink & 255)<<16) | (p.Ink & 0xFF00) | ((p.Ink>>16)&255)
        Loop p.H {
            y := A_Index-1
            Loop p.W {
                x := A_Index-1,at := y*stride+x*3
                rgb := (NumGet(bits,at,"UChar")<<16) | (NumGet(bits,at+1,"UChar")<<8) | NumGet(bits,at+2,"UChar")
                if rgb!=p.Ink
                    continue
                cores += 1,pixel := NumGet(layer.Bits,((p.Y+y)*layer.W+p.X+x)*4,"UInt")
                if (pixel>>24)<254 || Abs(((pixel>>16)&255)-((expected>>16)&255))>1
                    || Abs(((pixel>>8)&255)-((expected>>8)&255))>1 || Abs((pixel&255)-(expected&255))>1
                    bad += 1
            }
        }
        V48Assert(cores>10 && !bad,"native glyph cores retain colour and full alpha: " p.Text " cores=" cores " mismatches=" bad)
    }
    finally DllCall("DeleteObject","Ptr",brush),ISRICanvasClose(native)
}

V7875TextTimerRecovery() => V65UITimerIsolated(V7875TextTimerRecoveryCase)
V7875TextTimerRecoveryCase(*)
{
    global IPM,IRTPrefs,IRT
    IPM.Opacity := 80,IRTURender(IRT,1000)
    p := IRTPrefs,parts := IOHParts(p.BarsGui,p.Width,p.Height)
    for part in parts {
        if part.Type="Text" && part.Y>=p.Layout.Header && part.Text!="" && part.Ink!=part.Back
            V7875NativeGlyphs(part,p.BarsGui.IOH.Canvas)
    }
    before := DllCall("GetGuiResources","Ptr",DllCall("GetCurrentProcess","Ptr"),"UInt",0,"UInt")
    Loop 15 {
        p.BarsGui.Destroy(),IRTURender(IRT,1000)
        V48Assert(p.LastError="" && IPMGuiAlive(p.BarsGui.IOH.Gui),"timer recreates its lettering after external owner destruction")
    }
    after := DllCall("GetGuiResources","Ptr",DllCall("GetCurrentProcess","Ptr"),"UInt",0,"UInt")
    V48Assert(after<=before+2,"external timer replacement releases owned bitmap/DC allocations")
}

; Synthetic raw logs, verified fixture boundaries, hidden native controls.
V7875XRActor(name,x := 0,y := 0,z := 0,h := 0,hp := 1000)
{
    key := name="XR" ? "XR {4847325860069376}:71" : "@" name "#1"
    return key "|(" x "," y "," z "," h ")|(" hp "/1000)"
}
V7875XRFeed(f,at,source,target,kind := "Sample",ability := "4825717879603200",accepted := true)
{
    effects := Map("Target","836045448953668","Activate","836045448945479","Damage","836045448945501","Death","836045448945493","Revive","836045448945494","Sample","2")
    stamp := Format("{:02d}:{:02d}:{:02d}.{:03d}",Floor(at/3600000),Mod(Floor(at/60000),60),Mod(Floor(at/1000),60),Mod(at,1000))
    line := "[" stamp "] [" source "] [" target "] [Spell {" ability "}] [Action {" (kind="Damage" ? "836045448945477" : "836045448945472") "}: Effect {" effects[kind] "}]" (kind="Damage" ? " (0 -)" : "")
    ev := IPParseLine(line)
    V48Assert(IsObject(ev) && ev.ValueOK,"XR fixture raw event parses")
    ev.Analysis := {At:at,Seq:f.Next,Accepted:accepted,Raw:line},f.Next += 1,f.Data.Rows.Push(ev)
    return ev
}
V7875XRFixture(ready := true)
{
    p := {Id:1,Boss:"XR-53",Name:"Synthetic XR",Area:"945872057669657",Mode:"836045448953655",Start:0,End:10000,
        Ended:true,Partial:false,TimingComplete:true,Players:Map(),Deaths:[],TotalDeaths:0,DeathRecaps:Map()}
    for name in ["Tank","Other tank","Inside","Outside"]
        p.Players["@" name "#1"] := {Key:"@" name "#1",Name:name,RoleMask:InStr(name,"tank") ? 1 : 2,
            Deaths:0,First:-1,TimedDeaths:0,TimingComplete:true,FirstOrder:0,Active:true}
    f := {Pull:p,Data:{BaseVerified:true,Demo:false,ReviewPull:p,Rows:[]},Next:1}
    if ready {
        V7875XRFeed(f,100,V7875XRActor("XR"),V7875XRActor("Tank",0,-30),"Target")
        V7875XRFeed(f,1000,V7875XRActor("XR"),"=","Activate")
        V7875XRFeed(f,3900,V7875XRActor("XR"),"=")
        V7875XRFeed(f,3901,V7875XRActor("Other tank",2,-10),"=")
        V7875XRFeed(f,3902,V7875XRActor("Inside",-3,-20),"=")
        V7875XRFeed(f,3903,V7875XRActor("Outside",8,-20),"=")
        V7875XRFeed(f,4000,V7875XRActor("XR"),V7875XRActor("Outside",8,-20),"Damage")
        V7875XRFeed(f,4000,V7875XRActor("XR"),V7875XRActor("Inside",-3,-20),"Damage")
        V7875XRFeed(f,4000,V7875XRActor("XR"),V7875XRActor("Tank",0,-30),"Damage")
        ; Missing coordinates on a hit can use the preceding player sample.
        V7875XRFeed(f,4000,V7875XRActor("XR"),"@Other tank#1","Damage")
    }
    return f
}
V7875XRMarks()
{
    f := V7875XRFixture(),m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
    V48Assert(m.Beams.Length=1 && !b.Uncertain && b.Interceptors.Length=2,"one simultaneous impact marks both unintended players")
    V48Assert(b.Target="@Tank#1" && InStr(m.Text,"Other tank") && InStr(m.Text,"Inside"),"only intended tank is exempt; other tank can intercept")
    V48Assert(!InStr(m.Text,"Outside") && !InStr(m.Text,"Interceptors: Tank"),"first damage / splash recipient and intended tank are unmarked")
    V48Assert(!InStr(m.Text,"experimental") && !InStr(m.Text,"Marks show players") && !InStr(m.Text,"raid testing"),"feedback omits the removed heading tag and explanatory paragraph")
    rows := f.Data.Rows.Clone(),f.Data.Rows := []
    Loop rows.Length
        f.Data.Rows.Push(rows[rows.Length+1-A_Index])
    V48Assert(IXCBuild(f.Data,f.Pull).Text=m.Text,"input iteration order does not change simultaneous impact attribution")
    f.Data.Rows.Push(rows[1])
    V64Reject((*)=>IXCBuild(f.Data,f.Pull),"duplicate accepted records cannot double count beams")
}
V7875XRCollectionFeed(f,at,player := "Inside",apply := true)
{
    stamp := Format("{:02d}:{:02d}:{:02d}.{:03d}",Floor(at/3600000),Mod(Floor(at/60000),60),Mod(Floor(at/1000),60),Mod(at,1000))
    raw := "[" stamp "] [" V7875XRActor(player) "] [=] [Acid Collection Module {4857616601710592}] ["
        . (apply ? "ApplyEffect {836045448945477}" : "RemoveEffect {836045448945478}") ": Accompanied by the Collection Droid {4857616601710868}]"
    ev := IPParseLine(raw)
    V48Assert(IsObject(ev) && ev.ValueOK,"original-format Collection Droid effect parses")
    ev.Analysis := {At:at,Seq:f.Next,Accepted:true,Raw:raw},f.Next += 1,f.Data.Rows.Push(ev)
    return ev
}
V7875XRCollection()
{
    f := V7875XRFixture(),baseline := IXCBuild(f.Data,f.Pull)
    V7875XRCollectionFeed(f,3000),m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
    V48Assert(b.Collection.Length=1 && b.Collection[1]="@Inside#1" && InStr(m.Text,"0:04.000  Collection Droid active (following Inside)"),"active following effect annotates the beam")
    for field in ["Interceptors","Recipients","OlderMarks","FacingMarks"]
        V48Assert(IGVJson(b.%field%)=IGVJson(baseline.Beams[1].%field%),"droid context does not alter " field)
    V48Assert(b.Target=baseline.Beams[1].Target && b.TargetKnown=baseline.Beams[1].TargetKnown,"collection effect does not replace intended tank")
    for kind in ["removed","death","area","remove-after-hit","remove-before-hit","apply-after-hit","apply-before-hit","other-player-removed"] {
        f := V7875XRFixture()
        if !InStr(kind,"apply-")
            V7875XRCollectionFeed(f,3000)
        if kind="removed" || InStr(kind,"remove-") || kind="other-player-removed" {
            ev := V7875XRCollectionFeed(f,InStr(kind,"-hit") ? 4000 : 3500,kind="other-player-removed" ? "Other tank" : "Inside",false)
            if kind="remove-before-hit"
                f.Data.Rows[6].Analysis.Accepted := false,ev.Analysis.Seq := 6
        }
        else if kind="death"
            V7875XRFeed(f,3500,V7875XRActor("Inside"),"=","Death")
        else if kind="area" {
            ev := V7875XRFeed(f,3500,V7875XRActor("Inside"),"="),ev.Kind := "Area"
        }
        else {
            ev := V7875XRCollectionFeed(f,4000)
            if kind="apply-before-hit"
                f.Data.Rows[6].Analysis.Accepted := false,ev.Analysis.Seq := 6
        }
        m := IXCBuild(f.Data,f.Pull)
        expected := kind="remove-after-hit" || kind="apply-before-hit" || kind="other-player-removed"
        V48Assert((m.Beams[1].Collection.Length>0)=expected,"source-ordered lifetime: " kind)
    }
    for kind in ["rejected","invalid","other-ability","other-effect","wrong-action","wrong-source","nonparticipant","outside-pull"] {
        f := V7875XRFixture(),ev := V7875XRCollectionFeed(f,3000)
        if kind="rejected"
            ev.Analysis.Accepted := false
        else if kind="invalid"
            ev.ValueOK := false
        else if kind="other-ability"
            ev.AbilityId := "999"
        else if kind="other-effect"
            ev.EffectId := "999"
        else if kind="wrong-action"
            ev.ActionId := "836045448945472"
        else if kind="wrong-source"
            ev.Source := IPActor("@Other tank#1")
        else if kind="nonparticipant"
            ev.Source := IPActor("@Absent#1"),ev.Target := ev.Source
        else
            ev.Analysis.At := -1
        m := IXCBuild(f.Data,f.Pull)
        V48Assert(!m.Beams[1].Collection.Length && !InStr(m.Text,"Collection Droid active"),"irrelevant or unverified evidence cannot annotate a beam: " kind)
    }
    f := V7875XRFixture(),V7875XRCollectionFeed(f,3000),V7875XRCollectionFeed(f,3100),V7875XRCollectionFeed(f,3200,"Other tank")
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.Beams[1].Collection.Length=2,"refreshes deduplicate carriers without merging different players")
    rows := f.Data.Rows.Clone(),f.Data.Rows := []
    Loop rows.Length
        f.Data.Rows.Push(rows[rows.Length+1-A_Index])
    V48Assert(IXCBuild(f.Data,f.Pull).Text=m.Text,"arrival order does not change source-ordered droid evidence")
    f := V7875XRFixture(),f.Pull.End := 50000
    for ev in f.Data.Rows
        ev.Analysis.At += 31000
    V7875XRCollectionFeed(f,0),m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.Beams[1].Collection.Length=1,"35-second upper lifetime remains supported")
    for ev in f.Data.Rows {
        if ev.AbilityId!="4857616601710592"
            ev.Analysis.At += 1
    }
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(!m.Beams[1].Collection.Length && InStr(m.Debug,"old application without a recorded end; status unclear"),"missing removal cannot keep marking later beams")
    f := V7875XRFixture(),f.Data.Rows[7].Analysis.Accepted := false,f.Data.Rows[8].Analysis.Accepted := false,f.Data.Rows[10].Analysis.Accepted := false
    V7875XRCollectionFeed(f,3000),m := IXCBuild(f.Data,f.Pull)
    V48Assert(!m.Marked && m.TankOnly=1 && InStr(m.Text,"Collection Droid active"),"droid context is visible even when there are no interception candidates")
}
V7875XRHitEvidence()
{
    ; Position-only observations must never become accusations, even with
    ; fresh coordinates, an older sample, or a near-impact edge crossing.
    for kind in ["fresh","older","edge","unknown-target","taunt"] {
        f := V7875XRFixture(),f.Data.Rows[10].Analysis.Accepted := false
        if kind="older"
            f.Data.Rows[4].Analysis.At := 3300
        else if kind="edge"
            V7875XRFeed(f,4050,V7875XRActor("Other tank",9,-10),"=")
        else if kind="unknown-target"
            f.Data.Rows[1].Analysis.Accepted := false
        else if kind="taunt"
            V7875XRTauntFeed(f,2500,"Other tank")
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        V48Assert(!ArrayContainsText(b.Interceptors,"@Other tank#1") && !b.PossibleMarks.Has("@Other tank#1") && !b.OlderMarks.Length,"unhit player is never marked: " kind)
        V48Assert(ArrayContainsText(b.Interceptors,"@Inside#1"),"actual hit inside beam survives position-only filter: " kind)
        if kind!="taunt"
            V48Assert(InStr(m.Debug,"no recorded beam hit; not marked"),"unhit geometry remains inspectable: " kind)
        if kind="taunt"
            V48Assert(InStr(m.Text,"Intended target after taunt: Other tank") && m.Beams[1].TargetKnown,"successful taunt identifies its recipient even if the beam was intercepted before reaching them")
        else
            V48Assert(!InStr(m.Text,"Other tank"),"unhit player is absent from user-facing marks: " kind)
    }
    f := V7875XRFixture(),f.Data.Rows[7].Analysis.Accepted := false,f.Data.Rows[8].Analysis.Accepted := false,f.Data.Rows[10].Analysis.Accepted := false
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.TankOnly=1 && m.Marked=0 && m.OffTarget=0 && !InStr(m.Text,"interceptors:"),"tank-only hits cannot create position-only interception counts")
    for kind in ["rejected","invalid","other-ability","other-instance","outside-pull"] {
        f := V7875XRFixture(),ev := f.Data.Rows[10]
        if kind="rejected"
            ev.Analysis.Accepted := false
        else if kind="invalid"
            ev.ValueOK := false
        else if kind="other-ability"
            ev.AbilityId := "4846213463539712"
        else if kind="other-instance"
            ev.Source.Key .= "different-instance"
        else
            ev.Analysis.At := f.Pull.End+1
        b := IXCBuild(f.Data,f.Pull).Beams[1]
        V48Assert(!ArrayContainsText(b.Interceptors,"@Other tank#1"),"only the selected beam's valid accepted hit can corroborate a sample: " kind)
    }
    f := V7875XRFixture(),m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
    V48Assert(b.Interceptors.Length=2 && b.Recipients.Length=4 && b.ImpactAimSupported,"zero-damage hits and multiple occupants remain candidates even when intended tank is hit")
    V48Assert(!ArrayContainsText(b.Interceptors,"@Outside#1"),"being hit alone does not mark someone outside the box")
    f.Data.Rows[4].Analysis.At := 3300,m := IXCBuild(f.Data,f.Pull)
    V48Assert(InStr(m.Text,"Hit inside recorded beam (older position): Other tank"),"accepted hit without coordinates can use the same qualified one-second window")
}
V7875XRHeadings()
{
    actor := {Key:"@Pose#1",Name:"Pose"},hp := {Known:true,Current:900}
    for pair in [[-367.11,352.89],[463.73,103.73],[-1087.11,352.89],[1183.73,103.73],
        [0,0],[360,0],[-360,0],[720,0],[-720,0],[180,180],[-180,180],[359.99,359.99],[-0.01,359.99]] {
        p := IXCPose(V7875XRActor("Pose",1,2,3,pair[1]),4000,99,actor,hp)
        V48Assert(IsObject(p),"finite wrapped heading retains the position: " pair[1])
        V48Assert(Abs(p.H-pair[2])<0.000001,"heading normalizes to the same direction: " pair[1])
        V48Assert(p.X=1 && p.Y=2 && p.Z=3 && p.At=4000 && p.Record=99 && p.Key=actor.Key && p.HP=900,"heading normalization preserves position and evidence identity")
        a := IXCProject(p,{X:-12,Y:-27,Z:3})
        b := IXCProject({X:1,Y:2,Z:3,H:pair[2]},{X:-12,Y:-27,Z:3})
        V48Assert(a.Inside=b.Inside && Abs(a.Forward-b.Forward)<0.000001 && Abs(a.Side-b.Side)<0.000001,"wrapped headings preserve beam geometry")
    }
    f := V7875XRFixture(),baseline := IXCBuild(f.Data,f.Pull)
    for heading in [360,-360,720,-720,1080,-1080] {
        f := V7875XRFixture()
        for ev in f.Data.Rows
            ev.Analysis.Raw := StrReplace(ev.Analysis.Raw,",0)|","," heading ")|")
        model := IXCBuild(f.Data,f.Pull),beam := model.Beams[1]
        V48Assert(model.Text=baseline.Text && beam.ImpactAimSupported && !beam.Uncertain,"equivalent turns preserve full attribution and tank aim: " heading)
        V48Assert(IGVJson(beam.Interceptors)=IGVJson(baseline.Beams[1].Interceptors),"wrapped player headings retain the same candidates")
    }
    huge := "9"
    Loop 400
        huge .= "9"
    for heading in ["NaN","Infinity","-Infinity","1e999","bad",huge] {
        p := IXCPose(V7875XRActor("Pose",1,2,3,heading),4000,99,actor,hp)
        V48Assert(!IsObject(p),"malformed or overflowing heading does not create a position")
    }
    V48Assert(!IsObject(IXCPose(V7875XRActor("Pose",1000001,2,3,463.73),4000,99,actor,hp)),"wrapping does not relax coordinate validity")
}
V7875XRGeometry()
{
    b := {X:0,Y:0,Z:0,H:0}
    for point in [[5,-80,1],[-5,-80,1],[5.01,-10,0],[0,-80.01,0],[0,0.01,0],[0,-10,1]] {
        p := {X:point[1],Y:point[2],Z:1}
        V48Assert(IXCProject(b,p).Inside=point[3],"nominal 80 by 10 rectangle boundary")
    }
    b.H := 90
    V48Assert(IXCProject(b,{X:-20,Y:3,Z:0}).Inside && !IXCProject(b,{X:20,Y:0,Z:0}).Inside,"rotated forward direction matches log convention")
    V48Assert(IXCAngle(-359,359)=2 && IXCAngle(359,-359)=2 && IXCAngle(131.74,103.49)>28,"angle wrap and observed 95 ms jump")
    f := V7875XRFixture(),V7875XRFeed(f,3905,V7875XRActor("XR",0,0,0,28.25),"=")
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(!b.Uncertain && b.ImpactAimSupported && b.Interceptors.Length=2 && !b.PossibleMarks.Count,"independent tank hit supports consistent impact direction despite earlier turn")
    f := V7875XRFixture(),V7875XRFeed(f,4050,V7875XRActor("Inside",6,-20),"=")
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(b.Uncertain && b.Interceptors.Length=2 && b.PossibleMarks.Has("@Inside#1") && !b.PossibleMarks.Has("@Other tank#1"),"edge crossing qualifies only the ambiguous player")
}
V7875XRTargets()
{
    for kind in ["clear","unknown","mixed"] {
        f := V7875XRFixture()
        if kind="clear"
            V7875XRFeed(f,900,V7875XRActor("XR"),"","Target")
        else
            f.Pull.Players["@Tank#1"].RoleMask := kind="unknown" ? 8 : 3
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        V48Assert(b.Uncertain && !b.TargetKnown && b.Interceptors.Length=3 && InStr(m.Text,"Hit inside recorded beam (intended target unclear)") && !InStr(m.Text,"  Interceptors:"),"ambiguous intended tank " kind " lists occupancy without assigning blame")
    }
    f := V7875XRFixture(),f.Data.Rows[1].Analysis.Accepted := false
    V48Assert(IXCBuild(f.Data,f.Pull).Beams[1].Uncertain,"unaccepted target record is ignored")
    f := V7875XRFixture(),f.Data.Rows[1].Source.Key .= "different-instance"
    V48Assert(IXCBuild(f.Data,f.Pull).Beams[1].Uncertain,"another boss instance cannot supply the intended target")
    f := V7875XRFixture(),f.Data.Rows[2].Analysis.At := 3500
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(b.Uncertain && !b.Interceptors.Length,"implausible cast-to-impact delay stays uncertain without candidates")
    f := V7875XRFixture(),f.Pull.Mode := "836045448953654"
    V48Assert(!IXCSupported(f.Pull),"Hard Mode is outside this check")
    V64Reject((*)=>IXCBuild(f.Data,f.Pull),"unsupported mode cannot be checked")
}
V7875XRIncomplete()
{
    f := V7875XRFixture(),f.Data.Rows[4].Analysis.At := 2800
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(b.Uncertain && b.Interceptors.Length=1 && b.Interceptors[1]="@Inside#1","hit without usable coordinates cannot project a stale sample forward")
    f := V7875XRFixture(),V7875XRFeed(f,3800,V7875XRActor("Other tank",2,-10,0,0,0),"=","Death")
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(!b.Uncertain && b.Interceptors.Length=1,"dead player inside the footprint is not blamed")
    f := V7875XRFixture(),f.Pull.Partial := true
    V48Assert(InStr(IXCBuild(f.Data,f.Pull).Text,"recording is partial"),"partial pull does not claim complete coverage")
    f := V7875XRFixture(false)
    V48Assert(!IXCBuild(f.Data,f.Pull).Beams.Length && InStr(IXCBuild(f.Data,f.Pull).Text,"No Extraneous"),"no impacts is not invented evidence")
    f := V7875XRFixture(),f.Data.BaseVerified := false
    V64Reject((*)=>IXCBuild(f.Data,f.Pull),"unverified raw events are rejected")
    f.Data.BaseVerified := true,f.Data.Demo := true
    V64Reject((*)=>IXCBuild(f.Data,f.Pull),"demo events are rejected")
    f.Data.Demo := false,f.Data.ReviewPull := f.Pull.Clone(),f.Data.ReviewPull.End += 1
    V64Reject((*)=>IXCBuild(f.Data,f.Pull),"wrong fight boundary is rejected")
}
V7875XRWindow() => V61Hidden(V7875XRWindowCase)
V7875XRUsefulReport()
{
    f := V7875XRFixture(false)
    V7875XRFeed(f,100,V7875XRActor("XR"),V7875XRActor("Tank",0,-30),"Target")
    V7875XRFeed(f,1000,V7875XRActor("XR"),"=","Activate")
    V7875XRFeed(f,3900,V7875XRActor("XR"),"=")
    V7875XRFeed(f,4000,V7875XRActor("XR"),V7875XRActor("Tank",0,-30),"Damage")
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.TankOnly=1 && m.OffTarget=0 && m.UnknownTarget=0 && m.Uncertain=1,"recorded tank-only hit is distinct from incomplete player position coverage")
    V48Assert(!InStr(m.Text,"Iris isn't sure") && InStr(m.Text,"only on the intended target") && InStr(m.Debug,"missing for 3 players"),"main report summarizes target-only hits while Debug preserves missing players")
    V7875XRFeed(f,3950,V7875XRActor("XR",0,0,0,28),"=")
    V7875XRFeed(f,4000,V7875XRActor("XR"),V7875XRActor("Inside",0,-20),"Damage")
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.OffTarget=1 && m.TankOnly=0 && m.Marked=1 && m.Beams[1].ImpactAimSupported && InStr(m.Text,"Interceptors: Inside"),"known tank hit supports impact direction for the other occupant")
    f.Data.Rows[1].Analysis.Accepted := false,m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.UnknownTarget=1 && !m.TankOnly && InStr(m.Text,"Hit inside recorded beam (intended target unclear)"),"missing tank evidence shows occupants without becoming a tank-only classification")
    f := V7875XRFixture(),f.Data.Rows[4].Analysis.At := 3300,m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.Beams[1].Interceptors.Length=2 && m.Beams[1].OlderMarks.Length=1,"700 ms player observation can contribute without removing fresh evidence")
    V48Assert(InStr(m.Text,"Hit inside recorded beam (older position): Other tank") && InStr(m.Text,"Interceptors: Inside"),"older mark is visibly tentative and separate from a fresh impact position")
    f.Data.Rows[4].Analysis.At := 3000,m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.Beams[1].OlderMarks.Length=1,"one-second observation is retained")
    f.Data.Rows[4].Analysis.At := 2800,m := IXCBuild(f.Data,f.Pull)
    V48Assert(!m.Beams[1].OlderMarks.Length && m.Beams[1].Interceptors.Length=1 && m.Uncertain,"observation beyond one second is not reused")
    f := V7875XRFixture(),f.Data.Rows[4].Analysis.At := 3300
    V7875XRFeed(f,4050,V7875XRActor("Other tank",9,-10),"=")
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.Beams[1].OlderMarks.Length=1 && m.Beams[1].Interceptors.Length=2 && m.Beams[1].PossibleMarks.Has("@Other tank#1"),"older sample and edge crossing retain a visibly tentative candidate")
    f := V7875XRFixture(),V7875XRFeed(f,3905,V7875XRActor("XR",0,0,0,15),"=")
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.Beams[1].Interceptors.Length=2 && m.Beams[1].ImpactAimSupported,"15 degree earlier turn does not defeat consistent tank-aligned impact poses")
    f := V7875XRFixture(),V7875XRFeed(f,3905,V7875XRActor("XR",3,0),"=")
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.Beams[1].Interceptors.Length=2 && !m.Beams[1].PossibleMarks.Count && m.Beams[1].ImpactAimSupported,"earlier boss movement is resolved by consistent impact poses and tank hit")
    V48Assert(InStr(m.Debug,"Impact direction is supported"),"debug explains the independent aim evidence")
    f := V7875XRFixture(),f.Data.Rows[3].Analysis.Accepted := false,f.Data.Rows[9].Analysis.Accepted := false,m := IXCBuild(f.Data,f.Pull)
    V48Assert(!m.Beams[1].FacingMarks.Length && !m.Beams[1].Uncertain && InStr(m.Text,"Interceptors:"),"fresh impact facing is sufficient without an earlier matching sample or tank hit")
    f := V7875XRFixture()
    V7875XRFeed(f,2000,V7875XRActor("XR"),V7875XRActor("Other tank"),"Target")
    V7875XRFeed(f,3905,V7875XRActor("XR",0,0,0,28),"=")
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.Marked=1 && m.UnknownTarget=0 && InStr(m.Debug,"Target change:") && m.Beams[1].ImpactAimSupported && InStr(m.Text,"Interceptors:"),"target switches retain cast-start baseline; actual aligned tank hit supports direction")
}
V7875XRCandidates()
{
    f := V7875XRFixture(),f.Data.Rows[9].Analysis.Accepted := false,V7875XRFeed(f,3905,V7875XRActor("XR",8,0),"=")
    m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
    V48Assert(!ArrayContainsText(b.Interceptors,"@Outside#1") && !InStr(m.Text,"Outside"),"outside impact box stays unmarked even if an earlier boss pose includes it")
    V48Assert(b.Interceptors.Length=2 && !b.PossibleMarks.Count && !b.Uncertain,"an earlier boss movement does not qualify consistent impact occupants")
    V48Assert(!ArrayContainsText(b.Interceptors,"@Tank#1"),"known intended tank remains exempt during movement")
    f := V7875XRFixture(),f.Data.Rows[1].Analysis.Accepted := false,m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.UnknownTarget=1 && m.Beams[1].Interceptors.Length=3 && InStr(m.Text,"player list may include them"),"absent target shows all known occupants with explicit intended-recipient caveat")
    f := V7875XRFixture(),V7875XRFeed(f,4000,V7875XRActor("XR"),V7875XRActor("Inside",-3,-20,10),"Damage")
    ; Replace the first same-player hit so the high sample is the selected impact.
    f.Data.Rows[8].Analysis.Accepted := false,m := IXCBuild(f.Data,f.Pull)
    V48Assert(!ArrayContainsText(m.Beams[1].Interceptors,"@Inside#1"),"unsupported vertical separation still does not invent a candidate")
}
V7875XRAimEvidence()
{
    for kind in ["supported","no-tank-hit","off-axis","near-origin","height","hit-turn","hit-shift","swapped"] {
        f := V7875XRFixture(),V7875XRFeed(f,3905,V7875XRActor("XR",0,0,0,28),"=")
        if kind="no-tank-hit"
            f.Data.Rows[9].Analysis.Accepted := false
        else if kind="off-axis" || kind="near-origin" || kind="height" {
            f.Data.Rows[9].Analysis.Accepted := false
            V7875XRFeed(f,4000,V7875XRActor("XR"),V7875XRActor("Tank",kind="off-axis" ? 2 : 0,kind="near-origin" ? -2 : -30,kind="height" ? 6 : 0),"Damage")
        }
        else if kind="hit-turn"
            V7875XRFeed(f,4001,V7875XRActor("XR",0,0,0,15),V7875XRActor("Outside",8,-20),"Damage")
        else if kind="hit-shift"
            V7875XRFeed(f,4001,V7875XRActor("XR",8,0),V7875XRActor("Outside",8,-20),"Damage")
        else if kind="swapped"
            V7875XRFeed(f,2000,V7875XRActor("XR"),V7875XRActor("Other tank"),"Target")
        b := IXCBuild(f.Data,f.Pull).Beams[1]
        V48Assert(b.ImpactAimSupported=(kind="supported" || kind="swapped"),"impact aim support requires independent cast-start tank hit and consistent geometry: " kind)
        V48Assert(!ArrayContainsText(b.Interceptors,"@Outside#1"),"aim reconciliation never expands impact box: " kind)
        if kind="hit-shift"
            V48Assert(b.PossibleMarks.Count>0 && b.Uncertain,"conflicting containment within the impact batch remains tentative")
        else if kind="hit-turn"
            V48Assert(b.Uncertain && !b.PossibleMarks.Count && ArrayContainsText(b.Reasons,"XR's facing or position changed during the hit batch"),"a within-batch turn is recorded but does not qualify players who stay inside every impact pose")
        else
            V48Assert(!b.PossibleMarks.Count && !b.FacingMarks.Length,"impact facing does not require tank-hit corroboration: " kind)
    }
    poses := [{X:0,Y:0,Z:0,H:0}]
    V48Assert(IXCImpactAimSupported(poses,{X:0.4,Y:-5,Z:0}) && !IXCImpactAimSupported(poses,{X:0.5,Y:-5,Z:0}),"short-range directional support also needs five-degree angular agreement")
    V48Assert(IXCImpactAimSupported(poses,{X:1,Y:-30,Z:0}) && !IXCImpactAimSupported(poses,{X:1.01,Y:-30,Z:0}),"long-range support has a one-metre axis cap")
}
V7875XRTauntFeed(f,at,player := "Inside",effect := "836045448945488",action := "836045448945472",target := "")
{
    stamp := Format("{:02d}:{:02d}:{:02d}.{:03d}",Floor(at/3600000),Mod(Floor(at/60000),60),Mod(Floor(at/1000),60),Mod(at,1000))
    if target=""
        target := V7875XRActor("XR")
    raw := "[" stamp "] [" V7875XRActor(player,-3,-20) "] [" target "] [Neural Dart {1971557492588544}] [Action {" action "}: Taunt {" effect "}]"
    ev := IPParseLine(raw)
    V48Assert(IsObject(ev) && ev.ValueOK,"raw taunt record parses")
    ev.Analysis := {At:at,Seq:f.Next,Accepted:true,Raw:raw},f.Next += 1,f.Data.Rows.Push(ev)
    return ev
}
V7875XRTargetBaseline()
{
    for name in ["Other tank","Inside","Outside"] {
        f := V7875XRFixture(),V7875XRFeed(f,2000,V7875XRActor("XR"),V7875XRActor(name),"Target")
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        V48Assert(b.TargetKnown && b.Target="@Tank#1" && b.TargetChanged && !m.UnknownTarget,"later target of any role does not replace cast-start tank")
        V48Assert(b.Interceptors.Length=2 && !ArrayContainsText(b.Interceptors,b.Target) && InStr(m.Debug,"Target change:"),"baseline tank excluded and target switch retained in Debug")
        V7875XRFeed(f,3995,V7875XRActor("XR"),V7875XRActor("Tank"),"Target")
        V48Assert(IXCBuild(f.Data,f.Pull).Text=m.Text,"brief switch back preserves report")
    }
    f := V7875XRFixture(),V7875XRFeed(f,900,V7875XRActor("XR"),V7875XRActor("Other tank"),"Target")
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(b.Target="@Other tank#1" && b.TargetKnown && !ArrayContainsText(b.Interceptors,b.Target) && ArrayContainsText(b.Interceptors,"@Tank#1"),"latest pre-cast tank is baseline, not first tank or final impact target")
    f := V7875XRFixture(),V7875XRFeed(f,1000,V7875XRActor("XR"),V7875XRActor("Other tank"),"Target")
    V48Assert(IXCBuild(f.Data,f.Pull).Beams[1].Target="@Tank#1","same-clock target after cast by source order is not the baseline")
    for effect in ["807814628900864","1971557492588806","880189122806063","3436141340524805","801316343382296","801354998087972","812079531426107","3461103690448896","975279698739466","2522790775226628","836045448945488"] {
        f := V7875XRFixture(),V7875XRTauntFeed(f,2500,"Inside",effect,effect="836045448945488" ? "836045448945472" : "836045448945477")
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        V48Assert(b.TargetKnown && b.Target="@Inside#1" && b.Taunters.Has("@Inside#1") && !b.ImpactAimSupported && !b.Uncertain,"successful taunt replaces the intended recipient even for a DPS spec")
        V48Assert(m.Taunted=1 && !m.UnknownTarget && InStr(m.Text,"Intended target after taunt: Inside") && !InStr(m.Text,"Players inside beam (taunt during cast):") && InStr(m.Text,"  Interceptors:") && !ArrayContainsText(b.Interceptors,"@Inside#1"),"the recipient is excluded while other hit occupants retain ordinary marks")
        V48Assert(InStr(m.Text,"Additional details")>InStr(m.Text,"Shut Up Already!:") && InStr(m.Text,"Intended target after taunt: Inside")>InStr(m.Text,"Additional details"),"informational taunt targets follow the complete feedback under Additional details")
        V7875XRTauntFeed(f,2700),m2 := IXCBuild(f.Data,f.Pull)
        V48Assert(m2.Taunted=1 && m2.Beams[1].Taunters.Count=1 && m2.Text=m.Text,"apply and generic events do not duplicate warning")
    }
    for kind in ["before","after","at-impact-after","rejected","invalid","other-instance","other-npc","remove","activation","unknown-effect","baseline-tank"] {
        f := V7875XRFixture(),ev := V7875XRTauntFeed(f,kind="before" ? 999 : kind="after" ? 4001 : kind="at-impact-after" ? 4000 : 2500,kind="baseline-tank" ? "Tank" : "Inside")
        if kind="rejected"
            ev.Analysis.Accepted := false
        else if kind="invalid"
            ev.ValueOK := false
        else if kind="other-instance"
            ev.Target.Key .= "different-instance"
        else if kind="other-npc"
            ev.Target := IPActor("Other boss {12345}:99")
        else if kind="remove"
            ev.ActionId := "836045448945478"
        else if kind="activation"
            ev.EffectId := "836045448945479"
        else if kind="unknown-effect"
            ev.ActionId := "836045448945477",ev.EffectId := "999999"
        b := IXCBuild(f.Data,f.Pull).Beams[1]
        V48Assert(b.TargetKnown && b.Target="@Tank#1" && (b.Taunters.Count=(kind="baseline-tank" ? 1 : 0)) && b.ImpactAimSupported && !b.Uncertain,"out-of-scope or baseline taunt preserves intended target: " kind)
    }
    f := V7875XRFixture(),V7875XRTauntFeed(f,2500),V7875XRTauntFeed(f,2600,"Other tank")
    V7875XRFeed(f,2800,V7875XRActor("XR"),V7875XRActor("Inside"),"Target")
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.Beams[1].Taunters.Count=2 && m.Taunted=1 && m.Beams[1].Target="@Other tank#1" && m.Beams[1].TargetKnown,"last successful taunt wins; a later plain TargetSet does not undo it")
    rows := f.Data.Rows.Clone(),f.Data.Rows := []
    Loop rows.Length
        f.Data.Rows.Push(rows[rows.Length+1-A_Index])
    V48Assert(IXCBuild(f.Data,f.Pull).Text=m.Text,"out-of-order input preserves taunt scope and report")
    f := V7875XRFixture(),f.Data.Rows[1].Analysis.Accepted := false,V7875XRTauntFeed(f,2500)
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(!m.UnknownTarget && m.Taunted=1 && m.Beams[1].Target="@Inside#1","successful taunt resolves a missing cast-start target")
}
V7875XROpeningTarget()
{
    for kind in ["opening","stale","boundary","after-start","wrong-instance","wrong-npc","clear","area","invalid"] {
        f := V7875XRFixture(),f.Pull.Start := 2000
        for row in f.Data.Rows
            row.Analysis.At += 2000
        f.Data.Rows[1].Analysis.Accepted := false
        at := kind="stale" ? 999 : kind="boundary" ? 1000 : kind="after-start" ? 2001 : 1997
        ev := V7875XRFeed(f,at,V7875XRActor("XR"),V7875XRActor("Tank",0,-30),"Target")
        f.Data.Rows.Pop(),w := IACaptureNew(f.Pull.Start,f.Pull.End)
        if kind="wrong-instance"
            ev.Source.Key .= "different-instance"
        else if kind="wrong-npc"
            ev.Source := IPActor("Other boss {12345}:99")
        else if kind="invalid"
            ev.ValueOK := false
        IACaptureRaw(w,ev,ev.Analysis.Raw,at,ev.Analysis.Seq)
        if kind="clear" || kind="area" {
            clear := V7875XRFeed(f,1998,V7875XRActor("XR"),"","Target"),f.Data.Rows.Pop()
            if kind="area"
                clear.Kind := "Area"
            IACaptureRaw(w,clear,clear.Analysis.Raw,1998,clear.Analysis.Seq)
        }
        f.Data.XROpeningTargets := w.HasOwnProp("XROpeningTargets") ? w.XROpeningTargets : Map()
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1],known := kind="opening" || kind="boundary"
        V48Assert(b.TargetKnown=known,"only bounded same-instance opening context resolves target: " kind)
        if known
            V48Assert(b.Target="@Tank#1" && !ArrayContainsText(b.Interceptors,b.Target) && InStr(m.Debug,"before the recorded pull start"),"pre-start tank is excluded with provenance in Debug")
        if kind!="after-start"
            V48Assert(!w.Rows.Length && !w.Observed,"opening context does not become an accepted combat row or affect totals")
    }
    f := V7875XRFixture(),f.Pull.Start := 2000
    for row in f.Data.Rows
        row.Analysis.At += 2000
    f.Data.Rows[1].Analysis.Accepted := false,w := IACaptureNew(2000,10000)
    for spec in [[1998,"Other tank"],[1997,"Tank"]] {
        ev := V7875XRFeed(f,spec[1],V7875XRActor("XR"),V7875XRActor(spec[2]),"Target"),f.Data.Rows.Pop()
        IACaptureRaw(w,ev,ev.Analysis.Raw,spec[1],ev.Analysis.Seq)
    }
    f.Data.XROpeningTargets := w.XROpeningTargets
    V48Assert(IXCBuild(f.Data,f.Pull).Beams[1].Target="@Other tank#1","late arrival of older target does not override newer opening state")
    V7875XRFeed(f,2500,V7875XRActor("XR"),V7875XRActor("Tank"),"Target")
    V48Assert(IXCBuild(f.Data,f.Pull).Beams[1].Target="@Tank#1","accepted pre-cast target overrides opening context")
}
V7875XRReviewStop() => V694RotationPageFixture(V7875XRReviewStopCase)
V7875XRReviewStopCase(a,source,seg,path,text)
{
    global IP,IPAS,IrisTests
    IP.Live := IPNewData("PRIVATE LIVE"),V762QueuedLive(),live := IP.Live,wasBusy := IrisTests.Busy
    try {
        V64Reject((*)=>IXCPrepareReview(path ".missing"),"unavailable log does not stop live collection")
        V48Assert(IP.Active && IPAS.Pending,"source is checked before stopping")
        IrisTests.Busy := false,IXCPrepareReview(path)
        V48Assert(!IP.Active && !IPAS.Pending && !IP.Follow && live.Lines=552 && live.Finished,"XR review stops parsing and preserves every queued live record")
        IP.Active := true,IP.Busy := true
        V64Reject((*)=>IXCPrepareReview(path),"busy import cannot be interrupted")
        V48Assert(IP.Active,"rejected review retains collection")
    }
    finally IrisTests.Busy := wasBusy,IP.Active := false,IP.Busy := false
}
V7875XRWindowCase()
{
    s := IXCState(),f := V7875XRFixture()
    try {
        IDTOpen(V647BossUIPull()),IDTBossOpen()
        V48Assert(IPMUiHandle(IDTState().BossPopup),"existing death popup starts open")
        IDTOpen(f.Pull)
        V48Assert(!IPMUiHandle(IDTState().BossPopup) && IPWState().Controls["DeathBoss"].Enabled && !IDTState().Selected,"XR without deaths retires old popup and enables feedback")
        V48Assert(IXCOpen(f.Pull,f.Data),"native hidden XR window loads without a death")
        V48Assert(!s.Busy && !s.Controls["Progress"].Visible && s.Controls["Debug"].Enabled,"loading ends and evidence controls work")
        V48Assert(InStr(s.Controls["Details"].Value,"Interceptors:"),"native edit contains the result")
        IXCDebug()
        V48Assert(InStr(s.Controls["Details"].Value,"intended target: Tank"),"debug shows source evidence without changing report")
        IXCDebug(),IXCClose()
        V48Assert(!IPMUiHandle(s.Gui),"close retires the native window")
        f.Data.BaseVerified := false
        V48Assert(!IXCOpen(f.Pull,f.Data) && !IsObject(s.Model) && InStr(s.Controls["Details"].Value,"unavailable"),"failed reload cannot show stale marks")
        s.Busy := true,s.Control := {Cancel:false},IXCClose()
        V48Assert(s.Control.Cancel && s.CloseAfter && IPMUiHandle(s.Gui),"cancel waits until background review unwinds")
        V64Reject((*)=>IXCProgress({Percent:30,Stage:"test"}),"cancellation interrupts load service")
    }
    finally {
        s.Busy := false,s.Control := "",s.CloseAfter := false,IDTShutdown(),s.Pull := "",s.Model := ""
    }
}

V7875XRFacingHistory()
{
    for age in [0,49,50,250,251,394,500,501,1001] {
        f := V7875XRFixture()
        f.Data.Rows[3].Analysis.Accepted := false,f.Data.Rows[9].Analysis.Accepted := false
        V7875XRFeed(f,4000-age,V7875XRActor("XR"),"=")
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        V48Assert(!b.ImpactAimSupported,"facing test has no independent tank-hit corroboration")
        V48Assert(b.Interceptors.Length=2 && !ArrayContainsText(b.Interceptors,"@Outside#1"),"impact containment and hit requirements are preserved at history age " age)
        V48Assert(!b.FacingMarks.Length && !b.PossibleMarks.Count && !b.Uncertain,"earlier matching-sample age is not a prerequisite: " age)
        V48Assert(!InStr(m.Text,"limited facing history") && InStr(m.Text,"Interceptors:"),"fresh impact evidence is reported without a history warning: " age)
    }
    for kind in ["turn","move","rejected","future"] {
        f := V7875XRFixture()
        f.Data.Rows[3].Analysis.Accepted := false,f.Data.Rows[9].Analysis.Accepted := false
        V7875XRFeed(f,kind="future" ? 4050 : 3606,V7875XRActor("XR",kind="move" ? 8 : 0,0,0,kind="turn" ? 28 : 0),"=","Sample","4825717879603200",kind!="rejected")
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        V48Assert(b.Interceptors.Length=2 && !ArrayContainsText(b.Interceptors,"@Outside#1"),"history never promotes an outside hit into a candidate: " kind)
        V48Assert(!b.Uncertain && !b.PossibleMarks.Count && !b.FacingMarks.Length,"non-impact boss observations do not qualify fresh impact positions: " kind)
        if kind="turn" || kind="move"
            V48Assert(InStr(b.Debug,"Earlier facing sample (context only)"),"earlier contradictory pose remains inspectable: " kind)
    }
}
V7875XRImpactPoseGuards()
{
    f := V7875XRFixture(false)
    V7875XRFeed(f,100,V7875XRActor("XR"),V7875XRActor("Tank",0,-30),"Target")
    V7875XRFeed(f,1000,V7875XRActor("XR"),"=","Activate")
    V7875XRFeed(f,3999,V7875XRActor("XR"),"=")
    V7875XRFeed(f,4000,"XR {4847325860069376}:71",V7875XRActor("Inside",-3,-20),"Damage")
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(b.Uncertain && !b.Interceptors.Length && ArrayContainsText(b.Reasons,"XR's position was not recorded"),"missing impact pose cannot silently fall back to an earlier boss pose")
    for kind in ["accepted","rejected","separate-batch"] {
        f := V7875XRFixture(),f.Data.Rows[9].Analysis.Accepted := false
        V7875XRFeed(f,kind="separate-batch" ? 4101 : 4001,V7875XRActor("XR",0,0,0,28),V7875XRActor("Outside",8,-20),"Damage","4825717879603200",kind!="rejected")
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        V48Assert(b.Interceptors.Length=2 && !ArrayContainsText(b.Interceptors,"@Outside#1"),"additional hit pose does not expand the first impact box: " kind)
        if kind="accepted" {
            V48Assert(b.Uncertain && b.PossibleMarks.Count=2,"actual same-batch conflicting containment qualifies both candidates")
            V48Assert(InStr(m.Text,"XR pose differs between hit records"),"same-batch conflict is explained in the report")
        }
        else
            V48Assert(!b.Uncertain && !b.PossibleMarks.Count,"rejected or other-batch hit cannot qualify this beam: " kind)
    }
}

V7875XRTauntRedirect()
{
    for kind in ["two","back","same-clock","apply-duplicate","precast-duplicate","late-duplicate"] {
        f := V7875XRFixture()
        a := V7875XRTauntFeed(f,kind="precast-duplicate" ? 900 : 2000,"Inside","1971557492588806","836045448945477")
        if kind="two" || kind="same-clock" || kind="apply-duplicate" || kind="back"
            V7875XRTauntFeed(f,kind="same-clock" ? 2000 : 2200,"Other tank","880189122806063","836045448945477")
        if kind="back"
            V7875XRTauntFeed(f,2400,"Tank","1971557492588806","836045448945477")
        if kind="apply-duplicate" || kind="precast-duplicate" || kind="late-duplicate"
            V7875XRTauntFeed(f,kind="late-duplicate" ? 4100 : 2600,"Inside")
        expected := kind="back" || kind="precast-duplicate" ? "@Tank#1" : kind="late-duplicate" ? "@Inside#1" : "@Other tank#1"
        b := IXCBuild(f.Data,f.Pull).Beams[1]
        V48Assert(b.TargetKnown && b.Target=expected && !ArrayContainsText(b.Interceptors,expected),"successful taunt order and delayed notification scope: " kind)
        V48Assert(!b.Uncertain,"a resolved taunt does not create a warning: " kind)
        if kind="precast-duplicate"
            V48Assert(!b.Taunters.Count && b.TargetBasis="cast-start","delayed acknowledgment cannot move a pre-cast taunt into this cast")
    }
    for kind in ["same-clock-before-cast","same-clock-after-cast","same-clock-before-hit","same-clock-after-hit","unknown-spec","died","death-after-hit","rejected-death","missing-cast","bad-cast-time","missing-player"] {
        f := V7875XRFixture()
        at := InStr(kind,"cast") && InStr(kind,"same-clock") ? 1000 : InStr(kind,"same-clock") ? 4000 : 2500
        ev := V7875XRTauntFeed(f,at,"Inside")
        if kind="same-clock-before-cast"
            ev.Analysis.Seq := 0
        else if kind="same-clock-before-hit"
            ev.Analysis.Seq := 0
        if kind="unknown-spec"
            f.Pull.Players["@Inside#1"].RoleMask := 0
        else if kind="died" || kind="death-after-hit" || kind="rejected-death"
            V7875XRFeed(f,kind="death-after-hit" ? 4001 : 3000,V7875XRActor("Inside"),"=","Death","4825717879603200",kind!="rejected-death")
        else if kind="missing-cast"
            f.Data.Rows[2].Analysis.Accepted := false
        else if kind="bad-cast-time"
            f.Data.Rows[2].Analysis.At := 1800
        else if kind="missing-player"
            f.Pull.Players.Delete("@Inside#1")
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        if kind="same-clock-before-cast" || kind="same-clock-after-hit"
            V48Assert(b.Target="@Tank#1" && b.TargetKnown && !b.Taunters.Count,"source sequence resolves exact boundary: " kind)
        else if kind="died" || kind="missing-cast" || kind="bad-cast-time" || kind="missing-player"
            V48Assert(!b.TargetKnown && b.Uncertain,"unusable target evidence remains qualified: " kind)
        else
            V48Assert(b.Target="@Inside#1" && b.TargetKnown && !b.Uncertain && !ArrayContainsText(b.Interceptors,b.Target),"valid taunt evidence resolves independently of role: " kind)
        if kind="died"
            V48Assert(ArrayContainsText(b.Reasons,"the taunting player died before the beam hit") && InStr(m.Text,"unclear at impact"),"death invalidates taunted recipient instead of guessing the replacement")
    }
    f := V7875XRFixture(),V7875XRTauntFeed(f,2500,"Tank")
    f.Data.Rows[7].Analysis.Accepted := false,f.Data.Rows[8].Analysis.Accepted := false,f.Data.Rows[10].Analysis.Accepted := false
    m := IXCBuild(f.Data,f.Pull)
    V48Assert(m.TankOnly=1 && !m.Marked && !m.Uncertain && InStr(m.Text,"Intended target after taunt: Tank"),"taunted recipient-only hit is clean, with an informational note")
}

V7875XRDeathTargets()
{
    for role in [2,4,8,3] {
        for both in [false,true] {
            f := V7875XRFixture(),f.Pull.Players["@Inside#1"].RoleMask := role
            V7875XRFeed(f,500,V7875XRActor("Tank"),"=","Death")
            if both
                V7875XRFeed(f,600,V7875XRActor("Other tank"),"=","Death")
            V7875XRFeed(f,900,V7875XRActor("XR"),V7875XRActor("Inside",-3,-20),"Target")
            m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
            V48Assert(b.TargetKnown && b.Target="@Inside#1" && !ArrayContainsText(b.Interceptors,b.Target),"recorded recipient of any role is exempt after one or both tanks die")
            V48Assert(!b.Uncertain && !m.UnknownTarget && InStr(b.Debug,"dead at cast start"),"tank death explains the role exception")
            V48Assert(b.Interceptors.Length=(both ? 0 : 1),"other living hit occupants are still marked")
            rows := f.Data.Rows.Clone(),f.Data.Rows := []
            Loop rows.Length
                f.Data.Rows.Push(rows[rows.Length+1-A_Index])
            V48Assert(IXCBuild(f.Data,f.Pull).Text=m.Text,"life states use source order rather than iteration order")
        }
    }
    for kind in ["rejected","invalid","after-cast","outside-pull","revived","zero-hp-revive","positive-hp-cleanup","dps-death","unknown-role-death","mixed-role-death","same-clock-before","same-clock-after"] {
        f := V7875XRFixture()
        V7875XRFeed(f,900,V7875XRActor("XR"),V7875XRActor("Inside",-3,-20),"Target")
        at := kind="after-cast" ? 1500 : kind="outside-pull" ? -1 : InStr(kind,"same-clock") ? 1000 : 500
        ev := V7875XRFeed(f,500,V7875XRActor("Tank"),"=","Death"),ev.Analysis.At := at
        if kind="rejected"
            ev.Analysis.Accepted := false
        else if kind="invalid"
            ev.ValueOK := false
        else if kind="dps-death" || kind="unknown-role-death" || kind="mixed-role-death"
            f.Pull.Players["@Tank#1"].RoleMask := kind="dps-death" ? 2 : kind="unknown-role-death" ? 8 : 3
        else if kind="same-clock-before"
            ev.Analysis.Seq := 0
        else if kind="revived" || kind="zero-hp-revive" {
            returned := V7875XRFeed(f,800,V7875XRActor("Tank",0,0,0,0,kind="revived" ? 1000 : 0),"=","Revive")
            V48Assert(IsObject(IPLifeReturnActor(returned))=(kind="revived"),"only positive-HP revival restores life")
        }
        else if kind="positive-hp-cleanup"
            V7875XRFeed(f,800,V7875XRActor("Tank"),"=")
        b := IXCBuild(f.Data,f.Pull).Beams[1]
        allowed := kind="same-clock-before" || kind="zero-hp-revive" || kind="positive-hp-cleanup"
        V48Assert(b.TargetKnown=allowed,"role exception requires a currently dead recorded tank at cast start: " kind)
    }
    f := V7875XRFixture(),V7875XRFeed(f,500,V7875XRActor("Tank"),"=","Death")
    f.Data.Rows[1].Analysis.Accepted := false
    V48Assert(!IXCBuild(f.Data,f.Pull).Beams[1].TargetKnown,"a tank death cannot invent an unrecorded intended target")
}

V7875XRThreatFeed(f,at,who,value,kind := "direct")
{
    stamp := Format("{:02d}:{:02d}:{:02d}.{:03d}",Floor(at/3600000),Mod(Floor(at/60000),60),Mod(Floor(at/1000),60),Mod(at,1000))
    dest := kind="heal" ? V7875XRActor("Tank") : kind="other-boss" ? StrReplace(V7875XRActor("XR"),":71",":72") : V7875XRActor("XR")
    line := "[" stamp "] [" V7875XRActor(who) "] [" dest "] [Spell {123}] ["
        . (kind="heal" ? "ApplyEffect {836045448945477}: Heal {836045448945500}] (1)" : "Event {836045448945472}: ModifyThreat {836045448945483}]")
        . " <" value ">"
    ev := IPParseLine(line)
    V48Assert(IsObject(ev) && ev.ValueOK,"threat fixture parses signed original-format values")
    ev.Analysis := {At:at,Seq:f.Next,Accepted:true,Raw:line},f.Next += 1,f.Data.Rows.Push(ev)
    return ev
}
V7875XRHandoffFixture()
{
    f := V7875XRFixture(false)
    for spec in [["Tank",1000],["Other tank",800],["Inside",500],["Outside",100]]
        V7875XRThreatFeed(f,100,spec[1],spec[2])
    f.Baseline := V7875XRFeed(f,500,V7875XRActor("XR"),V7875XRActor("Tank"),"Target")
    f.Cast := V7875XRFeed(f,1000,V7875XRActor("XR"),"=","Activate")
    f.Death := V7875XRFeed(f,2000,V7875XRActor("Tank"),"=","Death")
    f.Change := V7875XRFeed(f,2005,V7875XRActor("XR"),V7875XRActor("Other tank"),"Target")
    V7875XRFeed(f,3900,V7875XRActor("Inside",2,-20),"=")
    V7875XRFeed(f,3901,V7875XRActor("Outside",8,-20),"=")
    f.Hit := V7875XRFeed(f,4000,V7875XRActor("XR"),V7875XRActor("Other tank",0,-30),"Damage")
    return f
}
V7875XRThreatHandoff()
{
    f := V7875XRHandoffFixture(),m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
    V48Assert(b.TargetKnown && b.Target="@Other tank#1" && b.TargetBasis="death-threat","matching actual target and living threat resolve a dead recipient")
    V48Assert(!b.Uncertain && !b.Interceptors.Length && m.TankOnly=1 && !m.UnknownTarget,"ordinary handoff creates neither an interception mark nor an unclear-target warning")
    V48Assert(InStr(b.Debug,"Normal handoff") && !InStr(m.Text,"handoff") && !InStr(m.Text,"unclear"),"normal handoff evidence is available in Debug without alarming report text")
    rows := f.Data.Rows.Clone(),f.Data.Rows := []
    Loop rows.Length
        f.Data.Rows.Push(rows[rows.Length+1-A_Index])
    V48Assert(IXCBuild(f.Data,f.Pull).Text=m.Text,"source order governs handoff independently of input iteration")
    V7875XRFeed(f,4001,V7875XRActor("XR"),V7875XRActor("Inside",2,-20),"Damage")
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(b.Interceptors.Length=1 && b.Interceptors[1]="@Inside#1","normal replacement does not suppress another actual beam interceptor")
    for kind in ["mismatch","missing-target","old-target","ten-ms-early","seven-ms-early","no-death","rejected-death","invalid-death","death-after-impact","bad-cast","precast-death","rejected-target","future-target","missing-threat"] {
        f := V7875XRHandoffFixture()
        if kind="mismatch"
            f.Change.Target := IPActor(V7875XRActor("Inside"))
        else if kind="missing-target" || kind="rejected-target"
            f.Change.Analysis.Accepted := false
        else if kind="old-target" || kind="ten-ms-early" || kind="seven-ms-early"
            f.Change.Analysis.At := 2000-(kind="old-target" ? 11 : kind="ten-ms-early" ? 10 : 7)
        else if kind="no-death" || kind="rejected-death"
            f.Death.Analysis.Accepted := false
        else if kind="invalid-death"
            f.Death.ValueOK := false
        else if kind="death-after-impact"
            f.Death.Analysis.At := 4001
        else if kind="bad-cast"
            f.Cast.Analysis.At := 1800
        else if kind="precast-death"
            f.Death.Analysis.At := 900
        else if kind="future-target"
            f.Change.Analysis.At := 4001
        else if kind="missing-threat" {
            Loop 4
                f.Data.Rows[A_Index].Analysis.Accepted := false
        }
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        if kind="ten-ms-early" || kind="seven-ms-early"
            V48Assert(b.TargetKnown && b.TargetBasis="death-threat" && !b.Uncertain,"narrow notification ordering tolerance still requires explicit death: " kind)
        else if kind="no-death" || kind="rejected-death" || kind="invalid-death" || kind="death-after-impact"
            V48Assert(b.TargetKnown && b.Target="@Tank#1" && b.TargetBasis="cast-start","living cast-start target is never replaced by threat or TargetSet alone: " kind)
        else
            V48Assert(!b.TargetKnown && b.Uncertain && b.TargetBasis!="death-threat","unsupported handoff stays unclear: " kind)
    }
}
V7875XRThreatEvidence()
{
    for kind in ["other-boss","rejected","outside-pull","future","invalid","negative","tie","heal-change","heal-stable","unknown-spec","zero","missing"] {
        f := V7875XRHandoffFixture()
        if kind="unknown-spec"
            f.Pull.Players["@Other tank#1"].RoleMask := 8
        else {
            at := kind="outside-pull" ? 10001 : kind="future" ? 4001 : 1500
            value := kind="invalid" ? "10000000000000" : kind="negative" ? -400 : kind="tie" ? 300 : kind="zero" ? 0 : kind="missing" ? "bad" : kind="heal-stable" ? 100 : 900
            who := kind="negative" ? "Other tank" : "Inside"
            ev := V7875XRThreatFeed(f,at,who,value,kind="other-boss" ? "other-boss" : InStr(kind,"heal-") ? "heal" : "direct")
            if kind="rejected"
                ev.Analysis.Accepted := false
        }
        b := IXCBuild(f.Data,f.Pull).Beams[1]
        if kind="negative" || kind="tie" || kind="heal-change"
            V48Assert(!b.TargetKnown && b.Uncertain,"a changed or ambiguous threat ranking cannot resolve the recipient: " kind)
        else
            V48Assert(b.TargetKnown && b.Target="@Other tank#1" && !b.Uncertain,"only applicable current-pull boss threat contributes; role does not veto a supported replacement: " kind)
    }
    f := V7875XRHandoffFixture()
    V7875XRThreatFeed(f,1500,"Inside",900)
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(!b.TargetKnown && InStr(b.Debug,"do not agree"),"conflicting target and threat evidence is explicit in Debug")
}
V7875XRThreatLife()
{
    for kind in ["second-dies","revived","positive-hp-cleanup","zero-hp-revive","damage-after-death","taunt","dead-taunter","impact-recipient-dies"] {
        f := V7875XRHandoffFixture()
        if kind="taunt"
            V7875XRTauntFeed(f,3000,"Inside")
        else if kind="dead-taunter" {
            V7875XRTauntFeed(f,2500,"Inside")
            V7875XRFeed(f,3000,V7875XRActor("Inside"),"=","Death")
            V7875XRFeed(f,3005,V7875XRActor("XR"),V7875XRActor("Other tank"),"Target")
        }
        else if kind="impact-recipient-dies" {
            V7875XRFeed(f,3995,V7875XRActor("XR"),V7875XRActor("Inside"),"Target")
            V7875XRFeed(f,4000,V7875XRActor("Other tank",0,-30,0,0,0),"=","Death")
        }
        else {
            V7875XRFeed(f,3000,V7875XRActor("Other tank"),"=","Death")
            V7875XRFeed(f,3005,V7875XRActor("XR"),V7875XRActor("Inside"),"Target")
            if kind="revived" || kind="zero-hp-revive"
                V7875XRFeed(f,3500,V7875XRActor("Other tank",0,-30,0,0,kind="revived" ? 1000 : 0),"=","Revive")
            else if kind="positive-hp-cleanup"
                V7875XRFeed(f,3500,V7875XRActor("Other tank"),"=")
            else if kind="damage-after-death"
                V7875XRThreatFeed(f,3500,"Other tank",9000)
        }
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        if kind="impact-recipient-dies"
            V48Assert(!b.TargetKnown && b.Uncertain,"impact death/target ordering remains uncertain instead of forcing a match")
        else if kind="taunt"
            V48Assert(b.TargetKnown && b.Target="@Inside#1" && b.TargetBasis="taunt","successful taunt takes priority over the earlier target death")
        else if kind="dead-taunter"
            V48Assert(b.TargetKnown && b.Target="@Other tank#1" && b.TargetBasis="death-threat" && !InStr(m.Text,"Intended target after taunt:"),"death of a taunter can hand off normally without mislabeling the replacement as the taunter")
        else
            V48Assert(b.TargetKnown && b.Target="@Inside#1" && b.TargetBasis="death-threat","highest living threat follows further deaths and resets old lives: " kind)
    }
}
V7875XRTargetLife()
{
    for role in [1,2] {
        for kind in ["before-cast","during-cast","revived-during-cast","revived-before-cast","rejected","invalid","after-hit","same-clock-before-hit","same-clock-after-hit","later-target","later-taunt"] {
            f := V7875XRFixture()
            who := role=1 ? "Tank" : "Inside",key := "@" who "#1"
            if role=2 {
                V7875XRFeed(f,400,V7875XRActor("Tank"),"=","Death")
                V7875XRFeed(f,900,V7875XRActor("XR"),V7875XRActor(who,-3,-20),"Target")
            }
            at := kind="before-cast" || kind="revived-before-cast" ? 600 : kind="after-hit" ? 4001 : InStr(kind,"same-clock") ? 4000 : 2000
            ev := V7875XRFeed(f,at,V7875XRActor(who),"=","Death")
            if kind="rejected"
                ev.Analysis.Accepted := false
            else if kind="invalid"
                ev.ValueOK := false
            else if kind="same-clock-before-hit"
                ev.Analysis.Seq := 0
            else if kind="revived-during-cast" || kind="revived-before-cast"
                V7875XRFeed(f,kind="revived-before-cast" ? 800 : 2500,V7875XRActor(who),"=","Revive")
            else if kind="later-target"
                V7875XRFeed(f,2500,V7875XRActor("XR"),V7875XRActor("Other tank"),"Target")
            else if kind="later-taunt"
                V7875XRTauntFeed(f,2500,"Other tank")
            m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
            known := kind="revived-before-cast" || kind="rejected" || kind="invalid" || kind="after-hit" || kind="same-clock-after-hit" || kind="later-taunt"
            V48Assert(b.TargetKnown=known,"intended recipient life state and event order: " kind)
            if !known
                V48Assert(b.Uncertain && m.UnknownTarget=1 && !InStr(m.Text,"  Interceptors:"),"death leaves occupancy uncertain rather than guessing a replacement")
            if kind="before-cast"
                V48Assert(ArrayContainsText(b.Reasons,"XR's recorded target was dead when the cast started"),"stale dead baseline is explained")
            if kind="during-cast" || kind="revived-during-cast" || kind="later-target"
                V48Assert(ArrayContainsText(b.Reasons,"XR's intended target died before the beam hit"),"death breaks baseline evidence even after revival or plain TargetSet")
            if kind="later-taunt"
                V48Assert(b.Target="@Other tank#1" && b.TargetBasis="taunt" && !b.Uncertain,"successful taunt resolves a dead baseline")
            else
                V48Assert(b.Target=key,"life guard does not infer an alternate recipient")
        }
    }
}

; Actual hidden Progression handlers, complete private recordings and parser handoff.
V7875FullLogOpen() => V761LibraryFixture(V7875FullLogOpenCase)
V7875FullLogGuards() => V761LibraryFixture(V7875FullLogGuardsCase)
V7875FullLogIdentity() => V761LibraryFixture(V7875FullLogIdentityCase)
V7875FullLogCancel() => V761LibraryFixture(V7875FullLogCancelCase)
V7875FullLogSources() => V761LibraryFixture(V7875FullLogSourcesCase)

V7875HistoryEntry(f)
{
    id := IGVSourceIdentity(f.Path)
    return {Key:"private-history",Session:id.Session,Date:id.Date,Team:"Private test",Path:f.Path,Pull:IPRCompact(f.State.Segments[1])}
}

V7875FullLogOpenCase(e,f)
{
    global IP
    entry := V7875HistoryEntry(f),p := IPRState()
    try {
        IGLInspectEntry(entry)
        V48Assert(p.DetailEntry=entry && IPMUiHandle(p.DetailLoadLog),"Progression retains exact recorder context and offers Load full log")
        V48Assert(IPMUiHandle(p.DetailRecap),"existing Death recap remains available")
        IPRDetailResize(p.DetailGui,0,900,640)
        p.DetailLoadLog.GetPos(&x,&y,&w,&h),p.DetailRecap.GetPos(&rx,&ry,&rw)
        V48Assert(x>=rx+rw && x+w<=886 && y=ry,"new button fits beside Death recap at minimum width")
        IDTOpenDetail()
        V48Assert(IsObject(IDTState().SourceEntry) && IDTState().SourceEntry!=entry && IXCSource(entry.Pull)=f.Path,"Death Recap retains an independent history source for Fight Feedback")
        IDTOpen(entry.Pull)
        V48Assert(!IsObject(IDTState().SourceEntry),"ordinary Death Recap cannot inherit a prior history entry")
        IDTOpenDetail()
        catalogue := ILBState().Original,revision := ILBState().Revision
        V762QueuedLive(),live := IP.Live
        V48Assert(IPRDetailLoadLog() && !IP.Active && IPWState().Tab=7,"detail action opens Raid and stops live collection")
        V48Assert(!IsObject(p.DetailGui) && !IsObject(p.DetailEntry),"accepted request closes popup and releases its source reference")
        V48Assert(IXCSource(entry.Pull)=f.Path,"closing Progression detail does not discard the pinned recap source")
        IDTFollow()
        V48Assert(!IsObject(IDTState().SourceEntry),"following the main selection retires the history source")
        V48Assert(ILBState().Pending.Timing=IP.ImportTiming && ILBIsLibraryView(IP),"selection belongs to this import and opening is read-only for catalogues")
        V762Drain(),IPRefresh()
        V48Assert(IP.ImportDone && IP.Offline.Segments.Length>50 && IP.Selected=1 && !IP.Follow,"full recording retains all fights and selects exact requested early pull")
        V48Assert(live.Lines=552 && live.Finished && !IP.Active,"queued live records finish and collection stays paused")
        V48Assert(ILBState().Original=catalogue && ILBState().Revision=revision,"viewing progression leaves saved catalogues unchanged")
        IP.Offline := ""
        V48Assert(IPRLoadFullLog(entry),"same history entry can reopen through disk cache")
        V762Drain()
        V48Assert(IP.ImportTiming.Cache="disk hit" && IP.Selected=1,"cached full import selects the same exact pull")
        IPROpenPull(entry.Pull)
        V48Assert(!IPMUiHandle(p.DetailLoadLog) && !IsObject(p.DetailEntry),"ordinary pull details do not inherit stale progression context")
    }
    finally IPRCloseDetails()
}

V7875FullLogGuardsCase(e,f)
{
    global IP
    entry := V7875HistoryEntry(f),p := IPRState()
    try {
        IGLInspectEntry(entry),IP.Active := true,IP.Busy := true
        V48Assert(!IPRDetailLoadLog() && IP.Active && IsObject(p.DetailGui),"busy parser remains running and popup stays open")
        IP.Busy := false,ILBState().Busy := true
        V48Assert(!IPRDetailLoadLog() && IP.Active && InStr(p.DetailNote.Text,"Pause"),"batch import guard is visible in popup")
        ILBState().Busy := false
        V48Assert(!IPRLoadFullLog(entry,f.Path ".missing") && IP.Active && InStr(p.DetailNote.Text,"missing"),"missing source does not pause live parsing")
        other := entry.Clone(),other.Pull := entry.Pull.Clone(),other.Pull.Ended := false
        V48Assert(!IPRLoadFullLog(other) && IP.Active,"incomplete pull cannot replace data")
    }
    finally ILBState().Busy := false,IP.Busy := false,IP.Active := false,IPRCloseDetails()
}

V7875FullLogIdentityCase(e,f)
{
    global IP
    entry := V7875HistoryEntry(f),entry.Pull.RecorderKey := "@Different Recorder#999"
    V48Assert(IPRLoadFullLog(entry),"original recording still opens when history has stale recorder evidence")
    V762Drain()
    V48Assert(IP.ImportDone && IP.Selected=0 && !IP.Follow && InStr(IP.Status,"could not be matched exactly"),"same boundaries from a different recorder are never selected as the requested pull")
    wanted := {Path:f.Path,Pull:V7875HistoryEntry(f).Pull,VerifyHistory:true,Timing:{}}
    ILBState().Pending := wanted,IP.Selected := 2
    V48Assert(ILBSelectPending(IP)="" && IP.Selected=2,"pending action from another import cannot change selection")
    ILBState().Pending := ""
    data := {Segments:[f.State.Segments[1],f.State.Segments[1]]}
    V48Assert(IPRFindHistoryPull(data,wanted.Pull)=0,"duplicate exact matches remain unselected")
}

V7875FullLogCancelCase(e,f)
{
    global IP
    entry := V7875HistoryEntry(f),V762QueuedLive(12)
    V48Assert(IPRLoadFullLog(entry),"prepare full log with live records pending")
    IPStop(),V762Drain()
    V48Assert(!IsObject(ILBState().Pending) && !IP.Offline.ProgressionComplete && !IP.Active,"cancel retires requested pull without resuming collection")
    V48Assert(IP.Live.Lines=14 && IP.Live.Finished,"cancel preserves previously queued live records")
}

V7875FullLogSourcesCase(e,f)
{
    global IP,currentLogPath,COMBAT_LOG_FOLDER
    entry := V7875HistoryEntry(f),oldCurrent := currentLogPath,oldFolder := COMBAT_LOG_FOLDER
    folder := f.Path ".copies",copy := "",s := ILBState()
    try {
        currentLogPath := "",COMBAT_LOG_FOLDER := f.Path ".no-folder",IP.ImportPath := ""
        paths := IPRFullLogCandidates(entry)
        V48Assert(paths.Length=1 && paths[1]=f.Path,"exact retained recording is preferred")
        entry.DeleteProp("Path")
        paths := IPRFullLogCandidates(entry)
        V48Assert(paths.Length=1 && paths[1]=f.Path,"saved history without a path resolves through Log Library")
        SplitPath(f.Path,&name),DirCreate(folder),copy := folder "\" name,FileCopy(f.Path,copy)
        original := s.Files[StrLower(f.Path)],second := original.Clone(),second.Path := copy,second.Modified := FileGetTime(copy,"M")
        s.Files[StrLower(copy)] := second,IP.ImportPath := copy
        paths := IPRFullLogCandidates(entry)
        V48Assert(paths.Length=2 && IPRKnownFullLog(entry,paths)!="","identical indexed copies open directly without a file picker")
        V48Assert(IPRLoadFullLog(entry),"actual import accepts automatically resolved duplicate copies")
        V762Drain(),V48Assert(IP.Selected=1 && IP.ImportDone,"resolved copy loads whole recording and selects exact pull")
        second.Digest := Format("{:064}",0)
        V64Reject((*)=>IPRKnownFullLog(entry,paths),"different indexed contents cannot silently choose a recording")
        second.Pulls := original.Pulls.Clone(),second.Pulls[1] := second.Pulls[1].Clone(),second.Pulls[1].Recorder := "@Other Recorder#2"
        V48Assert(IPRKnownFullLog(entry,paths)=f.Path,"recorder identity resolves a unique indexed source")
        entry.Session := "missing-session",entry.Date := "",IP.Active := true
        V48Assert(!IPRLoadFullLog(entry) && IP.Active && !IsObject(IP.ImportFile) && InStr(IP.Status,"could not be found"),"missing source shows a message and leaves parse untouched without a file picker")
    }
    finally {
        currentLogPath := oldCurrent,COMBAT_LOG_FOLDER := oldFolder,IP.Active := false
        if copy!="" && FileExist(copy)
            FileDelete(copy)
        if DirExist(folder)
            DirDelete(folder)
    }
}

V7875XDroid(id := 1,hp := 1000) => "Imperfect Construct {4845470434197504}:" id "|(0,0,0,0)|(" hp "/1000)"
V7875XDroidAt(x,hp := 1000) => "Imperfect Construct {4845470434197504}:1|(" x ",0,0,0)|(" hp "/1000)"
V7875XRDroidJumpFilter()
{
    for kind in ["ranged","healer","zero","retarget","first-ranged","close","melee","unknown-role","sparse","other-hit","ambiguous","rejected","late-move"] {
        f := V7875XRFixture(false),f.Pull.End := 40000
        f.Pull.Players["@Outside#1"].DisciplineId := kind="healer" ? "2031339142381596" : kind="melee" ? "2031339142381595" : kind="unknown-role" ? "mixed" : "2031339142381592"
        f.Pull.Players["@Inside#1"].DisciplineId := "2031339142381576"
        distance := kind="close" ? 5 : 30,recipient := kind="first-ranged" ? "Inside" : "Outside"
        V7875XDFeed(f,100,V7875XDroidAt(0),V7875XRActor(kind="first-ranged" ? "Outside" : "Tank"),"Target")
        V7875XDFeed(f,2100,V7875XDroidAt(0),V7875XRActor(recipient,kind="late-move" ? 0 : distance),"Target")
        if kind="ambiguous"
            V7875XDFeed(f,2200,V7875XDroidAt(0),V7875XRActor("Inside",distance+1),"Target")
        if kind="late-move"
            V7875XDFeed(f,11000,V7875XDroidAt(0),V7875XRActor(recipient,distance),"Target")
        land := V7875XDFeed(f,kind="late-move" ? 12000 : kind="sparse" ? 8100 : 3100,V7875XDroidAt(distance),"=","Activate")
        if kind="rejected"
            land.Analysis.Accepted := false
        if kind="retarget"
            V7875XDFeed(f,11100,V7875XDroidAt(distance),V7875XRActor("Inside"),"Target")
        unknown := kind="zero" || kind="late-move"
        if unknown {
            land.Kind := "Sample",land.AbilityId := "2"
            V7875XDFeed(f,18100,V7875XDroidAt(distance,0),"=","Sample")
        }
        else
            V7875XDFeed(f,18100,V7875XDroidAt(distance,0),V7875XRActor(recipient,distance),"Damage")
        if kind="other-hit"
            V7875XDFeed(f,18101,V7875XDroidAt(distance,0),V7875XRActor("Inside",distance),"Damage")
        state := V7875XDRecord(f),baseline := IXASummary(state,f.Pull.End),m := IXCBuild(f.Data,f.Pull).Droids
        ignored := InStr("|ranged|healer|zero|retarget|sparse|late-move|","|" kind "|")>0
        V48Assert(m.IgnoredOutside=(ignored ? 1 : 0),"jump recipient and landing, not first/final target or class alone: " kind)
        V48Assert(m.FightExplosions.Length=(unknown || ignored ? 0 : 1),"normal fight warning filtering: " kind)
        V48Assert(m.Explosions.Length=(unknown ? 0 : 1) && m.Unknown=(unknown ? 1 : 0),"all achievement outcomes survive filtering: " kind)
        for field in ["Explosions","Unknown","Killed","Pending","IgnoredAtKill","Players","ShriekAt","Partial","Seen"]
            V48Assert(XRDiagnosticJSON(m.%field%)=XRDiagnosticJSON(baseline.%field%),"live and review achievement field unchanged: " field "/" kind)
        if ignored
            V48Assert(!InStr(m.Text,"jumped out to a ranged DPS or healer") && InStr(m.Text,"Perfection in Imperfection: " (m.Explosions.Length ? IXAFailureLabel(m,false,f.Pull.Start) : "Possible desync")),"concise feedback retains the achievement outcome without the removed jump explanation: " kind)
        rows := f.Data.Rows.Clone(),f.Data.Rows := []
        Loop rows.Length
            f.Data.Rows.Push(rows[rows.Length+1-A_Index])
        reverse := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(reverse.Text=m.Text && XRDiagnosticJSON(reverse.Jumps)=XRDiagnosticJSON(m.Jumps),"jump reconstruction independent of display row order: " kind)
    }
}
XRDiagnosticJSON(value)
{
    if !IsObject(value)
        return IGVJson(value)
    if value is Array {
        out := "["
        for i,item in value
            out .= (i>1 ? "," : "") XRDiagnosticJSON(item)
        return out "]"
    }
    out := "{",sep := "",table := Map()
    if value is Map {
        for key,item in value
            table[key ""] := item
    }
    else {
        for key,item in value.OwnProps()
            table[key] := item
    }
    for key in IXAKeys(table)
        out .= sep IGVJson(key) ":" XRDiagnosticJSON(table[key]),sep := ","
    return out "}"
}
V7875XRAchievementKillBoundary()
{
    for kind in ["later","same-ms"] {
        f := V7875XRFixture(false),f.Pull.End := 50000
        V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
        V7875XDEnzyme(f,1500,"Inside",20)
        V7875XDFeed(f,2000,V7875XRActor("Tank"),V7875XRActor("XR"),"Death")
        at := kind="later" ? 16000 : 2000
        V7875XDFeed(f,at,V7875XDroid(1,0),"=","Death")
        V7875XDFeed(f,at,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
        V7875XDFeed(f,at,"Supplicant {4831533265321984}:88",V7875XRActor("Inside"),"Damage","4858205012230144")
        V7875XDFeed(f,at,V7875XRActor("Inside"),"=","Death")
        V7875XDEnzyme(f,at,"Outside",20)
        m := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(!m.Explosions.Length && !m.Unknown && !m.Pending && m.IgnoredAtKill=1,"surviving droid stops being pending and cannot expire after kill: " kind)
        V48Assert(m.ShriekAt<0 && m.Players["@Inside#1"].LifePeak=20 && !m.Players.Has("@Outside#1"),"pulse, player death and new stacks after kill do not alter achievements: " kind)
        live := V7875XDRecord(f),s := IXASummary(live,50000)
        V48Assert(!s.Explosions.Length && !s.Unknown && s.IgnoredAtKill=1 && s.ShriekAt<0 && s.Players["@Inside#1"].LifePeak=20,"live observer stops at same boundary: " kind)
        rows := f.Data.Rows.Clone(),f.Data.Rows := []
        Loop rows.Length
            f.Data.Rows.Push(rows[rows.Length+1-A_Index])
        V48Assert(IXCBuild(f.Data,f.Pull).Droids.Text=m.Text,"kill cutoff independent of review row order: " kind)
    }
    f := V7875XRFixture(false),f.Pull.End := 50000
    V7875XDFeed(f,2000,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
    V7875XDFeed(f,2000,"Supplicant {4831533265321984}:88",V7875XRActor("Inside"),"Damage","4858205012230144")
    V7875XDFeed(f,2000,V7875XRActor("Tank"),V7875XRActor("XR"),"Death")
    m := IXCBuild(f.Data,f.Pull).Droids
    V48Assert(m.Explosions.Length=1 && m.ShriekAt=2000,"same-ms failures before boss death still count")
    f := V7875XRFixture(false),f.Pull.End := 50000
    V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
    V7875XDFeed(f,2000,V7875XDroid(1,0),"=","Sample")
    V7875XDFeed(f,3000,V7875XRActor("Tank"),V7875XRActor("XR"),"Death")
    V48Assert(IXCBuild(f.Data,f.Pull).Droids.Unknown=1,"a zero-HP ambiguity before the kill is not erased")
    f := V7875XRFixture(false),f.Pull.End := 50000
    V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
    dead := V7875XDFeed(f,2000,V7875XRActor("Tank"),V7875XRActor("XR"),"Death")
    dead.Analysis.Accepted := false
    V7875XDFeed(f,16000,V7875XDroid(1,0),"=","Death")
    V48Assert(IXCBuild(f.Data,f.Pull).Droids.Explosions.Length=1,"rejected boss death cannot suppress a real explosion")
    f := V7875XRFixture(false),f.Pull.End := 2000,f.Pull.Progress := {Kill:true}
    V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
    m := IXCBuild(f.Data,f.Pull).Droids
    V48Assert(m.IgnoredAtKill=1 && !m.Pending && !m.Unknown,"confirmed killing-damage endpoint works without a Death record in accepted rows")
    f.Pull.Progress.Kill := false
    V48Assert(IXCBuild(f.Data,f.Pull).Droids.Pending=1,"ordinary pull ending is not a confirmed boss kill")
    data := IPNewData("isolated confirmed kill retirement",5000),seg := IPNewSegment(data,0,"observed combat entry")
    seg.XRAchievements := V7875XDRecord(f),seg.End := 2000,seg.Last := 2000,seg.Terminal := true,seg.FinishAt := 2000
    IXARetire(seg)
    V48Assert(seg.XRAchievementResult.IgnoredAtKill=1 && !seg.XRAchievementResult.Pending,"live confirmed-kill retirement matches saved review fallback")
    state := IXANewState(),data := IPNewData("isolated kill boundary rollback",5000)
    seg := IPNewSegment(data,0,"observed combat entry"),seg.XRAchievements := state
    IPBBeginUndo(data,seg),IXAApply(state,dead,2000,2,seg)
    V48Assert(state.Meta["BossDeathAt"]=2000 && state.Meta["BossDeathRecord"]=2,"tentative kill stores full boundary")
    IPBRollbackTail(data,seg)
    V48Assert(state.Meta["BossDeathAt"]=-1 && state.Meta["BossDeathRecord"]=0,"rollback restores both boundary fields")
}
V7875XDFeed(f,at,src,dst,kind := "Sample",ability := "4844766059560960") => V7875XRFeed(f,at,src,dst,kind,ability)
V7875XDRecord(f)
{
    state := IXANewState()
    for ev in f.Data.Rows
        IXDRecord(state,ev,f.Pull)
    return state
}
V7875XDEnzyme(f,at,player,count,action := "836045448953666",effect := "4825043569738028")
{
    stamp := Format("{:02d}:{:02d}:{:02d}.{:03d}",Floor(at/3600000),Mod(Floor(at/60000),60),Mod(Floor(at/1000),60),Mod(at,1000))
    raw := "[" stamp "] [" V7875XRActor(player) "] [=] [Digestive Enzyme Application {4825043569737728}] [Action {" action "}: Digestive Enzyme {" effect "}] (" count " charges {836045448953667})"
    ev := IPParseLine(raw),ev.Analysis := {At:at,Seq:f.Next,Accepted:true,Raw:raw}
    V48Assert(ev.ValueOK,"enzyme raw fixture parses"),f.Next += 1,f.Data.Rows.Push(ev)
    return ev
}
V7875XRDroidHits()
{
    f := V7875XRFixture(false),f.Pull.End := 40000
    V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
    V7875XDFeed(f,16097,V7875XDroid(1,0),"=","Death")
    V7875XDFeed(f,20000,V7875XDroid(2,0),V7875XRActor("Inside"),"Damage")
    V7875XDFeed(f,20001,V7875XDroid(2,0),V7875XRActor("Outside"),"Damage")
    V7875XDFeed(f,20002,V7875XDroid(2,0),V7875XRActor("Inside"),"Damage")
    V7875XDFeed(f,21000,V7875XRActor("Tank"),V7875XDroid(3,0),"Death")
    m := IXCBuild(f.Data,f.Pull).Droids
    V48Assert(m.Explosions.Length=2 && m.Killed=1,"self-destruct without hits, hit explosion and killed droid stay distinct")
    V48Assert(m.Explosions[1].Hits.Count=0 && m.Explosions[2].Hits.Count=2,"recipient records do not double-count explosions")
    V48Assert(!InStr(m.Text,"no player hit recorded") && !InStr(m.Text,"Explosion hit:") && InStr(m.Advanced,"no player hit recorded") && InStr(m.Advanced,"Explosion hit: Inside; Outside"),"recipient and unhit details appear only in Advanced")
    V48Assert(InStr(m.Text,"Perfection in Imperfection: failed at 0:16.097") && !InStr(m.Text,"inferred"),"first unhit self-destruct supplies the failure time without technical labels")
    V48Assert(IXAFailureLabel(m,true,1000)="Failed at 0:15.097","failure time is relative to pull start")
    full := IXCBuild(f.Data,f.Pull),advancedAt := InStr(full.Text,"Additional details")
    V48Assert(advancedAt>InStr(full.Text,"Shut Up Already!:") && !InStr(SubStr(full.Text,1,advancedAt-1),"inferred") && InStr(SubStr(full.Text,advancedAt),"0:16.097  inferred explosion:"),"inference evidence follows the main results under Additional details")
    V48Assert(InStr(m.Text,"2 droid explosions") && !InStr(m.Text,"flagged for review"),"summary counts explosions without the old review label")
    rows := f.Data.Rows.Clone(),f.Data.Rows := []
    Loop rows.Length
        f.Data.Rows.Push(rows[rows.Length+1-A_Index])
    V48Assert(IXCBuild(f.Data,f.Pull).Droids.Text=m.Text,"droid report independent of iteration order")
    V7881XRDroidDamage()
}
V7875XRDroidGuards()
{
    for kind in ["zero","expired","interrupt","early-self","killed","rejected","bad-value","outside","other-npc","other-ability","boss-ended"] {
        f := V7875XRFixture(false),f.Pull.End := 40000
        V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
        at := kind="early-self" ? 4000 : kind="outside" ? 41000 : 16000
        ev := V7875XDFeed(f,at,V7875XDroid(1,0),"=","Death")
        switch kind {
            case "zero": ev.Kind := "Sample",ev.EffectId := "2"
            case "expired": f.Data.Rows.Pop()
            case "interrupt": ev.Kind := "Sample",ev.EffectId := "836045448945482"
            case "killed": ev.Source := IPActor(V7875XRActor("Tank")),ev.Analysis.At := 7000
            case "rejected": ev.Analysis.Accepted := false
            case "bad-value": ev.ValueOK := false
            case "other-npc": ev.Source := IPActor("Other {999}:1"),ev.Target := ev.Source
            case "other-ability": f.Data.Rows[1].AbilityId := "999"
            case "boss-ended": V7875XDFeed(f,15000,V7875XRActor("Tank"),V7875XRActor("XR"),"Death")
        }
        m := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(!m.Explosions.Length,"no false explosion from " kind)
    }
    f := V7875XRFixture(false),V7875XDFeed(f,1000,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
    V7875XRCollectionFeed(f,500,"Inside")
    V48Assert(InStr(IXCBuild(f.Data,f.Pull).Droids.Text,"Collection Droid active: Inside"),"collection context available for a group explosion")
    f.Data.Rows[1].Analysis.Accepted := false
    V48Assert(!IXCBuild(f.Data,f.Pull).Droids.Explosions.Length,"rejected hit cannot fail an achievement")
}
V7881XDDamageFeed(f,at,player,id,amount)
{
    old := V7875XDFeed(f,at,V7875XRActor(player),V7875XDroid(id),"Damage","12345")
    raw := StrReplace(old.Analysis.Raw,"(0 -)","(" amount " energy {836045448940874})")
    ev := IPParseLine(raw),ev.Analysis := old.Analysis.Clone()
    ev.Analysis.Raw := raw,ev.Analysis.D := ev.Amount,f.Data.Rows[-1] := ev
    V48Assert(ev.ValueOK && ev.Amount=amount,"droid damage raw amount parses")
    return ev
}
V7881XRDroidDamage()
{
    V7852FailureDPS()
    f := V7875XRFixture(false),f.Pull.Start := 100,f.Pull.End := 30000
    V7881XDDamageFeed(f,99,"Outside",1,999999)
    V7881XDDamageFeed(f,200,"Inside",1,15000)
    V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
    V7881XDDamageFeed(f,1500,"Inside",1,5000)
    V7881XDDamageFeed(f,1500,"Outside",2,3000)
    V7881XDDamageFeed(f,1500,"Tank",3,888888)
    V7875XDFeed(f,1600,V7875XRActor("Tank"),V7875XDroid(3,0),"Death")
    for kind in ["rejected","bad-value","zero","metric-excluded","non-player"] {
        ev := V7881XDDamageFeed(f,19000,"Outside",1,kind="zero" ? 0 : 999999)
        if kind="rejected"
            ev.Analysis.Accepted := false
        else if kind="bad-value"
            ev.ValueOK := false
        else if kind="metric-excluded"
            ev.Analysis.D := 0
        else if kind="non-player"
            ev.Source := IPActor("Other NPC {123}:9")
    }
    V7881XDDamageFeed(f,20000,"Tank",1,1000)
    V7875XDFeed(f,20000,V7875XDroid(1,0),V7875XRActor("Outside"),"Damage")
    V7881XDDamageFeed(f,20000,"Tank",1,999999)
    V7881XDDamageFeed(f,20001,"Outside",1,999999)
    V7875XDFeed(f,20002,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
    V7875XDFeed(f,25000,V7875XDroid(2,0),V7875XRActor("Tank"),"Damage")
    V7881XDDamageFeed(f,30001,"Tank",2,999999)
    full := IXCBuild(f.Data,f.Pull),m := full.Droids,damage := IXDDetails(f.Data,f.Pull,m.FightExplosions)
    a := damage[IPActor(V7875XDroid()).Key],b := damage[IPActor(V7875XDroid(2)).Key]
    V48Assert(a.Total=21000 && a.Players.Count=2 && a.Players["@Inside#1"].Amount=20000 && a.Players["@Tank#1"].Amount=1000,"exact instance, counted damage, pull bounds and same-ms explosion ordering")
    V48Assert(b.Total=3000 && b.Players.Count=1 && damage.Count=2,"other instances never mix; killed droids receive no explosion breakdown")
    V48Assert(InStr(m.Text,"0:19.900  Droid exploded`r`n    HP: 100.0% (1,000)`r`n    DPS to droid: 1,060.6 DPS`r`n        Inside: 1,010.1 DPS`r`n        Tank: 50.5 DPS"),"main feedback lists HP and sorted exact damage with relative explosion time")
    V48Assert(InStr(m.Text,"0:24.900  Droid exploded`r`n    HP: 100.0% (1,000)`r`n    DPS to droid: 127.7 DPS`r`n        Outside: 127.7 DPS") && !InStr(m.Text,"999,999"),"second explosion has independent HP and damage")
    advanced := InStr(full.Text,"Additional details")
    V48Assert(!InStr(SubStr(full.Text,1,advanced-1),"Explosion hit:") && InStr(SubStr(full.Text,advanced),"0:19.900  Explosion hit: Inside; Outside"),"victims only appear as recipients under Advanced")
    rows := f.Data.Rows.Clone(),f.Data.Rows := []
    Loop rows.Length
        f.Data.Rows.Push(rows[rows.Length+1-A_Index])
    V48Assert(IXCBuild(f.Data,f.Pull).Text=full.Text,"reversing display rows preserves damage and advanced output")
    tied := {Total:2000,Duration:2,Players:Map("@Z#1",{Name:"Z",Amount:1000},"@A#1",{Name:"A",Amount:1000})}
    V48Assert(InStr(IXDDamageText(tied),"A: 500.0 DPS")<InStr(IXDDamageText(tied),"Z: 500.0 DPS"),"equal totals have stable name order")
    V48Assert(IXDDamageText({Total:0,Players:Map()})="    No player damage recorded.`r`n","missing damage is not a claim that every player did zero")
    f := V7875XRFixture(false),f.Pull.End := 40000
    f.Pull.Players["@Outside#1"].DisciplineId := "2031339142381592"
    V7875XDFeed(f,100,V7875XDroidAt(0),V7875XRActor("Tank"),"Target")
    V7875XDFeed(f,2100,V7875XDroidAt(0),V7875XRActor("Outside",30),"Target")
    V7875XDFeed(f,3100,V7875XDroidAt(30),"=","Activate")
    V7881XDDamageFeed(f,500,"Inside",1,4000)
    V7875XDFeed(f,18100,V7875XDroidAt(30,0),V7875XRActor("Outside",30),"Damage")
    m := IXCBuild(f.Data,f.Pull).Droids
    V48Assert(m.OutsideExplosions=1 && !m.FightExplosions.Length && !InStr(m.Text,"DPS to droid:"),"safe outward ranged droid stays out of normal damage report")
    V48Assert(m.Explosions.Length=1 && InStr(m.Advanced,"Explosion hit: Outside"),"outward droid still counts for achievement with victims in Advanced")
    f := V7875XRFixture(false),f.Pull.End := 40000
    V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
    V7881XDDamageFeed(f,10000,"Inside",1,4000)
    V7875XDFeed(f,16097,V7875XDroid(1,0),"=","Death")
    V7881XDDamageFeed(f,17000,"Outside",1,999999)
    m := IXCBuild(f.Data,f.Pull).Droids
    V48Assert(m.InferredExplosions=1 && InStr(m.Text,"DPS to droid: 265.0 DPS") && !InStr(m.Text,"999,999"),"inferred self-death explosion also bounds its damage")
}
V7881XRDroidHP()
{
    for kind in ["direct","fallback","same-ms","old","unknown","zero-before-hit","invalid","death","other-droid","post-hit"] {
        f := V7875XRFixture(false),f.Pull.Start := 100,f.Pull.End := 30000
        V7875XDFeed(f,99,V7875XDroid(1,999),"=","Sample","2")
        if kind!="unknown"
            V7875XDFeed(f,kind="old" ? 100 : kind="same-ms" ? 20000 : 18000,V7875XRActor("Inside"),V7875XDroid(1,360),"Sample","2")
        if kind="zero-before-hit" {
            V7875XDFeed(f,19000,V7875XDroid(1,0),"=","Sample","2")
            V7875XDFeed(f,19500,V7875XDroid(1,900),"=","Sample","2")
        }
        if kind="invalid" {
            for bad in ["unknown","rejected","invalid-value","maximum","over-maximum"] {
                ev := V7875XDFeed(f,19000,V7875XDroid(1,500),V7875XRActor("Inside"),"Sample","2")
                switch bad {
                    case "unknown": ev.SourceHP.Known := false
                    case "rejected": ev.Analysis.Accepted := false
                    case "invalid-value": ev.ValueOK := false
                    case "maximum": ev.SourceHP.Maximum := 0
                    case "over-maximum": ev.SourceHP.Current := 2000
                }
            }
        }
        if kind="death"
            V7875XDFeed(f,19500,V7875XDroid(1,800),"=","Death","2")
        if kind="other-droid"
            V7875XDFeed(f,19999,V7875XDroid(2,100),"=","Sample","2")
        hit := V7875XDFeed(f,20000,V7875XDroid(1,kind="direct" ? 210 : 0),V7875XRActor("Outside"),"Damage")
        if kind="fallback"
            hit.SourceHP.Known := false
        if kind="post-hit" {
            V7875XDFeed(f,20000,V7875XDroid(1,200),"=","Sample","2")
            V7875XDFeed(f,20001,V7875XDroid(1,100),"=","Sample","2")
        }
        full := IXCBuild(f.Data,f.Pull),m := full.Droids
        expected := kind="direct" ? "21.0% (210)" : kind="unknown" ? "unknown" : "36.0% (360)"
        V48Assert(m.Explosions.Length=1 && InStr(m.Text,"Droid exploded`r`n    HP: " expected "`r`n"),"explosion HP source and boundary: " kind)
        V48Assert(!InStr(m.Text,"last known") && !InStr(m.Text,"recorded 2.000s"),"fallback explanation stays out of main feedback: " kind)
        V48Assert(InStr(full.Text,"Additional details") && !InStr(full.Text,"Advanced details"),"renamed additional-details heading")
        if kind="direct"
            V48Assert(!InStr(m.Advanced,"last known"),"positive HP on the explosion hit is direct evidence")
        else if kind="unknown"
            V48Assert(InStr(m.Advanced,"HP unavailable") && !InStr(m.Text,"HP: 0.0%"),"missing HP is unknown rather than explosion zero")
        else {
            V48Assert(InStr(m.Advanced,"last known value: " expected),"fallback is explained in additional details: " kind)
            age := kind="same-ms" ? "earlier record at the same timestamp" : kind="old" ? "19.900s" : "2.000s"
            V48Assert(InStr(m.Advanced,age),"fallback sample age is explicit: " kind)
        }
        rows := f.Data.Rows.Clone(),f.Data.Rows := []
        Loop rows.Length
            f.Data.Rows.Push(rows[rows.Length+1-A_Index])
        V48Assert(IXCBuild(f.Data,f.Pull).Text=full.Text,"HP selection follows record order rather than display order: " kind)
    }
    f := V7875XRFixture(false),f.Pull.End := 30000
    V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
    V7875XDFeed(f,16000,V7875XDroid(1,500),"=","Sample","2")
    V7875XDFeed(f,16100,V7875XDroid(1,0),"=","Death")
    state := V7875XDRecord(f),m := IXCBuild(f.Data,f.Pull).Droids
    V48Assert(m.InferredExplosions=1 && InStr(m.Text,"HP: 50.0% (500)") && InStr(m.Advanced,"0.100s"),"inferred explosions show their last HP without changing the outcome")
    V48Assert(InStr(IXDBuild(state,f.Pull,[]).Text,"HP: 50.0% (500)"),"state-only report can use a bounded last-HP snapshot")
}
V7875XRDroidAchievement()
{
    f := V7875XRFixture(false),f.Pull.End := 40000
    for n in [1,14,15,20,3]
        V7875XDEnzyme(f,n*100,"Inside",n)
    V7875XDEnzyme(f,4000,"Outside",5)
    V7875XDEnzyme(f,5000,"Outside",80,"836045448953666","999")
    for at in [6000,6001,16000,26000]
        V7875XDFeed(f,at,V7875XRActor("XR"),V7875XRActor("Inside"),"Damage","4825876793393152")
    V7875XDFeed(f,27000,"Supplicant {4831533265321984}:88",V7875XRActor("Outside"),"Damage","4858205012230144")
    m := IXCBuild(f.Data,f.Pull).Droids,p := m.Players["@Inside#1"]
    V48Assert(p.Peak=20 && p.LifePeak=20,"peak survives lower stacks without a death")
    V48Assert(!p.HasOwnProp("Bites"),"bite tracker removed")
    V48Assert(m.Players["@Outside#1"].Peak=5,"wrong effect ID cannot corrupt stack counter")
    v := IXAView(m,"@Inside#1")
    V48Assert(v.Rows.Length=3 && v.Rows[2].Failed && v.Rows[3].Value="Max 20 / 20" && v.Rows[3].Active,"only three Master achievement criteria remain")
    V48Assert(IXAView(m,"@Outside#1").Rows[3].Value="Max 5 / 20","personal progress does not leak between players")
    V48Assert(!InStr(m.Text,"Willing Chew Toy") && !InStr(m.Text,"Unpalatable Target"),"trivial achievements removed from loaded-log report")
    f := V7875XRFixture(false),f.Pull.Partial := true
    V48Assert(IXAView(IXCBuild(f.Data,f.Pull).Droids).Rows[1].Value="Unclear","partial pull cannot look confirmed clean")
    s := IXANewState()
    V48Assert(!IXASummary(s,0).Explosions.Length && !s.Players.Count,"new pull starts fresh")
}
V7875XRDroidIntegration()
{
    global IP,IPM
    data := IPNewData("isolated achievement test",5000),seg := IPNewSegment(data,0,"observed combat entry")
    seg.BossKey := "XR-53",seg.AreaId := "945872057669657",seg.ModeId := "836045448953655",seg.LastOutput := 0
    f := V7875XRFixture(false),ev := V7875XDEnzyme(f,1000,"Inside",20),ev.RecordId := 1
    IPBBeginUndo(data,seg),IXASafeObserve(seg,ev,1000)
    V48Assert(seg.XRAchievements.Players["@Inside#1"].Peak=20,"accepted observer stores personal evidence")
    IPBRollbackTail(data,seg)
    V48Assert(!seg.XRAchievements.Players.Count,"parser rollback removes speculative achievement progress")
    IXASafeObserve(seg,ev,1000),seg.Last := 1000,IXARetire(seg)
    V48Assert(!seg.HasOwnProp("XRAchievements") && seg.XRAchievementResult.Players["@Inside#1"].Peak=20,"retired segment retains bounded summary and drops rolling maps")
    seg.ModeId := "wrong",IXASafeObserve(seg,ev,2000)
    V48Assert(!seg.HasOwnProp("XRAchievements"),"wrong difficulty is not tracked")
    savedIP := IP,savedIPM := IPM
    try {
        IP := IPNewApp(),IPM := IPMNewState(),IPM.Editing := true
        V48Assert(!IsObject(IXALiveSegment()) && IXAVisible({}),"idle display remains available without inventing live progress")
        V48Assert(IPM.Panels.Has("Achievements") && !IPM.Shown["Achievements"],"achievement overlay is available and optional")
        V48Assert(IPMDefinition("Achievements").Title="Special achievements","renamed display preserves its stored key")
        for entry in IIFEntries() {
            if entry.Key="Achievements"
                V48Assert(entry.Label="Special achievements","Displays menu uses the new achievement label")
        }
        for i,key in IPMSizeKeys() {
            if key="Achievements"
                V48Assert(IPMSizeLabels()[i]="Special achievements","sizing label changes without moving the saved setting")
        }
        p := IPM.Panels["Achievements"],p.Width := 500,IPMEnsureGui("Achievements",0,p)
        IPM.Enabled := true,IPM.Shown["Damage"] := true,IPMPreviewSet(8)
        IXARender({LayoutPreview:true},p)
        V48Assert(p.VisibleRows=3 && p.Rows[1].Name.Text="Perfection in Imperfection","native overlay renders all three criteria")
        V48Assert(!p.Rows[4].Name.Visible && !p.Rows[5].Name.Visible,"removed tracker rows are hidden")
        V48Assert(InStr(p.Meta.Text,"Your character") && p.Heading.Text="Special achievements (Preview)","renamed native preview remains separate from real progress")
        lastY := 0
        Loop 3 {
            row := p.Rows[A_Index],row.Name.GetPos(&x,&y,&w,&h),row.Value.GetPos(&vx,&vy,&vw,&vh)
            V48Assert(w>0 && h>0 && y>=lastY && vx>=x+w && vx+vw<=p.Layout.W,"native tracker row fits without overlapping")
            lastY := y+h
        }
        seg.ModeId := "836045448953655",seg.RecorderKey := "@Inside#1",seg.Terminal := false
        seg.XRAchievements := V7875XDRecord(f),IP.Live := data,IP.Active := true
        V48Assert(IsObject(IXALiveSegment()) && IXAVisible({}),"active supported pull is visible")
        V48Assert(IXAData().Name="Inside","personal tracker uses log recorder")
        seg.Terminal := true
        V48Assert(!IsObject(IXALiveSegment()),"boss completion hides live tracker")
    }
    finally {
        IPMRetirePanels(IPMAllPanels()),IP := savedIP,IPM := savedIPM
    }
}
V7875XRMarinatedLife()
{
    f := V7875XRFixture(false),f.Pull.End := 50000
    V7875XDEnzyme(f,1000,"Inside",20),V7875XDEnzyme(f,2000,"Outside",21)
    V7875XRFeed(f,3000,V7875XRActor("XR"),V7875XRActor("Inside",0,0,0,0,0),"Death")
    m := IXCBuild(f.Data,f.Pull).Droids,p := m.Players["@Inside#1"]
    V48Assert(p.Peak=20 && p.LifePeak=0 && p.DeathAt=3000,"death resets eligibility while retaining historical evidence")
    V48Assert(IXAView(m,"@Inside#1").Rows[3].Value="Max 20 (reset)" && InStr(m.Text,"reset by death"),"live and loaded-log reports retain peak and explain lost qualification")
    V48Assert(m.Players["@Outside#1"].LifePeak=21,"another player's achievement is unaffected")
    V7875XRFeed(f,4000,V7875XRActor("Outside"),V7875XRActor("Inside"),"Revive")
    V7875XDEnzyme(f,5000,"Inside",19)
    V48Assert(IXCBuild(f.Data,f.Pull).Droids.Players["@Inside#1"].LifePeak=19,"revive and 19 stacks do not restore eligibility")
    V7875XDEnzyme(f,6000,"Inside",20),V7875XDEnzyme(f,7000,"Inside",3)
    m := IXCBuild(f.Data,f.Pull).Droids
    V48Assert(m.Players["@Inside#1"].LifePeak=20 && InStr(m.Text,"20+ reached"),"20 after revival restores eligibility despite later lower stacks")
    rows := f.Data.Rows.Clone(),f.Data.Rows := []
    Loop rows.Length
        f.Data.Rows.Push(rows[rows.Length+1-A_Index])
    V48Assert(IXCBuild(f.Data,f.Pull).Droids.Text=m.Text,"late and out-of-order enzyme/death observations are equivalent")
    f.Data.Rows := rows
    V7875XRFeed(f,8000,V7875XRActor("Inside"),"=","Death")
    V48Assert(IXCBuild(f.Data,f.Pull).Droids.Players["@Inside#1"].LifePeak=0,"a second death resets rebuilt progress again")
    for when in ["before","after"] {
        f := V7875XRFixture(false)
        if when="before"
            V7875XDEnzyme(f,1000,"Inside",20)
        V7875XRFeed(f,1000,V7875XRActor("Inside"),"=","Death")
        if when="after"
            V7875XDEnzyme(f,1000,"Inside",20)
        V48Assert(IXCBuild(f.Data,f.Pull).Droids.Players["@Inside#1"].LifePeak=(when="before" ? 0 : 20),"same-millisecond source order: " when)
    }
    for guard in ["rejected","invalid","outside","hp-only","other-player","boss-dead"] {
        f := V7875XRFixture(false),V7875XDEnzyme(f,1000,"Inside",20)
        if guard="boss-dead"
            V7875XRFeed(f,2000,V7875XRActor("Outside"),V7875XRActor("XR"),"Death")
        ev := V7875XRFeed(f,guard="outside" ? 11000 : 3000,V7875XRActor(guard="other-player" ? "Outside" : "Inside",0,0,0,0,0),"=",guard="hp-only" ? "Sample" : "Death")
        if guard="rejected"
            ev.Analysis.Accepted := false
        if guard="invalid"
            ev.ValueOK := false
        V48Assert(IXCBuild(f.Data,f.Pull).Droids.Players["@Inside#1"].LifePeak=20,"do not reset from " guard)
    }
    f := V7875XRFixture(false),ev := V7875XDEnzyme(f,1000,"Inside",20),state := V7875XDRecord(f)
    seg := {XRAchievements:state},data := IPNewData("isolated reset rollback",5000)
    seg := IPNewSegment(data,0,"observed combat entry"),seg.XRAchievements := state
    IPBBeginUndo(data,seg)
    ev := V7875XRFeed(f,2000,V7875XRActor("Inside"),"=","Death")
    IXAApply(state,ev,2000,2,seg)
    V48Assert(IXASummary(state,2000).Players["@Inside#1"].LifePeak=0,"tentative death resets progress")
    IPBRollbackTail(data,seg)
    V48Assert(IXASummary(state,2000).Players["@Inside#1"].LifePeak=20,"tail rollback restores achievement progress")
    m := IXASummary(IXANewState(),0),v := IXAView(m)
    V48Assert(v.Rows[1].Value="Active" && v.Rows[1].Active && v.Rows[2].Value="Active" && v.Rows[2].Active,"both group criteria start active")
    m.ShriekAt := 1000,m.Explosions.Push({}),v := IXAView(m)
    V48Assert(v.Rows[1].Value="Failed" && v.Rows[1].Failed && v.Rows[2].Value="Failed" && v.Rows[2].Failed,"observed attacks fail both group criteria")
    m := IXASummary(IXANewState(),0,true),v := IXAView(m)
    V48Assert(!v.Rows[1].Active && !v.Rows[2].Active,"incomplete coverage is not shown active")
}
V7876XRMarinatedPeaks()
{
    f := V7875XRFixture(false),f.Pull.End := 50000
    V7875XDEnzyme(f,1000,"Inside",7)
    V7875XDEnzyme(f,1100,"Outside",26)
    V7875XDEnzyme(f,1200,"Tank",0)
    for player in ["Inside","Outside","Tank","Other"]
        V7875XRFeed(f,3000,V7875XRActor(player),"=","Death")
    m := IXCBuild(f.Data,f.Pull).Droids
    V48Assert(InStr(m.Text,"Inside — Well Marinated: max 7 stacks`r`n"),"wipe retains progress below the threshold without a reset warning")
    V48Assert(InStr(m.Text,"Outside — Well Marinated: max 26 stacks; reset by death at 0:03.000"),"real lost qualification retains maximum and death explanation")
    V48Assert(!InStr(m.Text,"Tank — Well Marinated") && !InStr(m.Text,"Other — Well Marinated"),"zero stacks and death-only players do not create feedback rows")
    V48Assert(!InStr(m.Text,"0 / 20"),"wipe does not replace useful maxima with zero progress")
    v := IXAView(m,"@Inside#1").Rows[3]
    V48Assert(v.Value="Max 7 / 20" && !v.Active && !v.Failed,"personal overlay preserves below-threshold peak after death")
    v := IXAView(m,"@Outside#1").Rows[3]
    V48Assert(v.Value="Max 26 (reset)" && !v.Active && !v.Failed,"whole-pull peak does not falsely restore qualification")
    V7875XDEnzyme(f,4000,"Outside",19)
    m := IXCBuild(f.Data,f.Pull).Droids
    V48Assert(m.Players["@Outside#1"].LifePeak=19 && IXAView(m,"@Outside#1").Rows[3].Value="Max 26 (reset)","rebuilding below 20 does not qualify")
    V7875XDEnzyme(f,5000,"Outside",20)
    m := IXCBuild(f.Data,f.Pull).Droids,v := IXAView(m,"@Outside#1").Rows[3]
    V48Assert(m.Players["@Outside#1"].Peak=26 && m.Players["@Outside#1"].LifePeak=20,"maximum and current-life eligibility remain separate")
    V48Assert(v.Value="Max 26 / 20" && v.Active && InStr(m.Text,"max 26 stacks; 20+ reached since last death"),"rebuilding eligibility removes reset while retaining higher earlier peak")
    before := m.Text,rows := f.Data.Rows.Clone(),f.Data.Rows := []
    Loop rows.Length
        f.Data.Rows.Push(rows[rows.Length+1-A_Index])
    V48Assert(IXCBuild(f.Data,f.Pull).Droids.Text=before,"maximum display remains independent of record iteration order")
}

V7852FailureDPS()
{
    V48Assert(IPCheckDPS(233132,10)="23,313.2 DPS","commas and one decimal for rates")
    V48Assert(IPCheckDPS(0,15)="0.0 DPS","observed zero stays zero")
    V48Assert(IPCheckDPS(400,0)="DPS unavailable" && IPCheckDPS(400,-1)="DPS unavailable","missing lifetime never invents a denominator")
    f := V7875XRFixture(false),f.Pull.Start := 100,f.Pull.End := 30000
    V7875XDFeed(f,1000,V7875XDroid(),"=","Sample","2")
    V7881XDDamageFeed(f,3000,"Inside",1,19000)
    V7881XDDamageFeed(f,19000,"Outside",1,9500)
    V7875XDFeed(f,20000,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
    review := IXCBuild(f.Data,f.Pull),live := V7878XFFixture(f),m := IXFBuild(live.Segment,true)
    V48Assert(m.Rows[1].Text="Droid explosion`nLowest DPS: Outside (500.0 DPS)","late attacker shares NPC lifetime instead of getting a one-second active window")
    IXOStore(live.Segment,review,f.Pull)
    V48Assert(XRDiagnosticJSON(live.Segment.XRFeedbackResult.Rows)=XRDiagnosticJSON(m.Rows),"shared duration agrees between live and saved review")
    V48Assert(InStr(review.Droids.Text,"Inside: 1,000.0 DPS") && InStr(review.Droids.Text,"Outside: 500.0 DPS"),"full breakdown uses same denominator for both players")
    V48Assert(InStr(review.Droids.Advanced,"19.000s") && !InStr(review.Droids.Text,"DPS window"),"window explanation stays in additional details")
    ; A late-arriving older observation with unchanged HP still anchors the lifetime.
    early := V7875XDFeed(f,500,V7875XDroid(),"=","Sample","2")
    V7878XFFeed(f,live.Data,live.Segment,early)
    m := IXFBuild(live.Segment,true),review := IXCBuild(f.Data,f.Pull)
    V48Assert(m.Rows[1].Text="Droid explosion`nLowest DPS: Outside (487.2 DPS)","older accepted sample adjusts duration even when HP did not change")
    IXOStore(live.Segment,review,f.Pull)
    V48Assert(XRDiagnosticJSON(live.Segment.XRFeedbackResult.Rows)=XRDiagnosticJSON(m.Rows),"out-of-order first observation parity")
}

V7875TeamPickerSummaries() => V769Run(V7875TeamPickerSummariesCase)
V7875TeamPickerSummariesCase(f)
{
    snapshot := ILPTRead(f.Path),full := ILPTRows(f.Files,f.History)
    V48Assert(snapshot.Rows.Length=full.Length,"summary picker preserves all recording groups")
    for i,row in full {
        summary := snapshot.Rows[i]
        for name in ["Id","Session","Date","FirstAt","Names","Bosses","Teams","Count","First","Ready","Status","Search"]
            V48Assert(summary.%name%==row.%name%,"summary picker preserves " name)
        V48Assert(summary.Files.Count=row.Files.Count && summary.Missing.Count=row.Missing.Count,"copy grouping and missing coverage remain exact")
    }
    for key,e in snapshot.History
        V48Assert(!e.Pull.HasOwnProp("IHVText") && !e.Pull.HasOwnProp("Players"),"picker retains only small headers, with no roster or deferred fight payload")
    before := FileRead(f.Path,"UTF-8"),root := ICSExpand(before,f.Path,"history")
    root[2][1][5][13][1][3] := -1
    FileDelete(f.Path),FileAppend(IGVJson(root),f.Path,"UTF-8-RAW")
    snapshot := ILPTRead(f.Path),before := FileRead(f.Path,"UTF-8")
    id := V769Row(snapshot,f.First).Id
    V59ExpectError((*)=>ILPTAssign(snapshot,[id],"New team",f.Path))
    V48Assert(FileRead(f.Path,"UTF-8")==before,"deferred invalid detail cannot be committed by team assignment")
}

V7875TeamPickerCache() => V769Run(V7875TeamPickerCacheCase)
V7875TeamPickerCacheCase(f)
{
    first := ILPTRead(f.Path),native := INCState(),reads := native.HistoryLoads,libraryReads := native.LibraryLoads
    second := ILPTRead(f.Path)
    V48Assert(native.HistoryLoads=reads && native.LibraryLoads=libraryReads,"unchanged picker reuses validated library and independent history headers")
    second.History["1-1"].Team := "View only",second.History["1-1"].Pull.Start := 0
    third := ILPTRead(f.Path)
    V48Assert(third.History["1-1"].Team=first.History["1-1"].Team && third.History["1-1"].Pull.Start=first.History["1-1"].Pull.Start,"caller mutation cannot alter the header memo")
    view := IHVReadHistory(f.Path),view["1-1"].Team := "Changed view",view["1-1"].Pull.Start := 1
    V48Assert(ILPTRead(f.Path).History["1-1"].Team="Old team","ordinary Progression view objects cannot mutate cached team headers")
    text := IGVJson(ICSExpand(FileRead(f.Path,"UTF-8"),f.Path,"history"))
    FileDelete(f.Path),FileAppend(text,f.Path,"UTF-8-RAW"),ILPTRead(f.Path)
    stamp := FileGetTime(f.Path,"M"),replacement := StrReplace(text,"Old team","New team")
    V48Assert(StrLen(text)=StrLen(replacement) && text!=replacement,"same-size replacement fixture is meaningful")
    FileDelete(f.Path),FileAppend(replacement,f.Path,"UTF-8-RAW"),FileSetTime(stamp,f.Path,"M")
    updated := ILPTRead(f.Path)
    V48Assert(updated.History["1-1"].Team="New team","cache compares contents, not file size or modification time")
    V59ExpectError((*)=>ILPTAssign(first,[V769Row(first,f.First).Id],"Stale",f.Path))
    lib := ILBState(),oldPath := lib.LoadedPath,oldDemo := lib.Demo
    try {
        lib.LoadedPath := f.Path ".different-library"
        V48Assert(ILPTLibraryFiles(ILBPath(),FileRead(ILBPath(),"UTF-8"))!=lib.Files,"library reuse is bound to its source path")
        lib.LoadedPath := oldPath,lib.Demo := true
        V48Assert(ILPTLibraryFiles(ILBPath(),FileRead(ILBPath(),"UTF-8"))!=lib.Files,"demo library data is never reused for saved team assignment")
    }
    finally lib.LoadedPath := oldPath,lib.Demo := oldDemo
}

V7875TeamPickerReadFailure() => V769Run(V7875TeamPickerReadFailureCase)
V7875TeamPickerReadFailureCase(f)
{
    s := ILPTBuild(f.Path),before := FileRead(f.Path,"UTF-8"),rows := s.Rows
    FileDelete(ILBPath()),FileAppend("broken",ILBPath(),"UTF-8-RAW")
    V48Assert(!ILPTRefresh() && !s.Busy && s.Rows=rows,"failed refresh leaves the previous snapshot and releases the loading guard")
    for name in ["Refresh","List","Team","Search","Close"]
        V48Assert(s.Controls[name].Enabled,"failed refresh restores " name)
    V48Assert(FileRead(f.Path,"UTF-8")==before && ILPTClose(),"failed read keeps history unchanged and the picker can close")
}

V7875TeamPickerBackground() => V769Run(V7875TeamPickerBackgroundCase)
V7875TeamPickerBackgroundCase(f)
{
    b := IQBState(),old := b.Clone(),s := ILBState()
    try {
        b.Active := true,b.Child := false,b.Refreshing := false,b.Library := ILBPath(),b.History := f.Path
        s.LoadedPath := ""
        V48Assert(IQBRefreshCatalogues(true),"completed private import refreshes its saved catalogues")
        V48Assert(s.LoadedPath=ILBPath() && ILPTLibraryFiles(ILBPath(),s.Original)=s.Files,"background refresh binds the reusable library to its source")
        headers := ILPTCachedHistory(f.Path,IGLHistoryText(f.Path))
        V48Assert(IsObject(headers) && headers.Count=f.History.Count,"background history refresh primes small team-picker headers")
    }
    finally {
        for key,value in old.OwnProps()
            b.%key% := value
    }
}

V7875XGFixture(kind := "far",healer := false)
{
    f := V7875XRFixture(false),f.Pull.End := 40000
    f.Pull.Players["@Outside#1"].DisciplineId := kind="melee" ? "2031339142381595" : kind="unknown-role" ? "" : (healer || kind="healer") ? "2031339142381596" : "2031339142381592"
    distance := kind="close" ? 19 : 30
    V7875XDFeed(f,100,V7875XDroidAt(0),V7875XRActor("Tank"),"Target")
    for i,name in ["Tank","Other tank","Inside","Peer"] {
        if kind="sparse" && i=4
            continue
        V7875XDFeed(f,kind="stale" ? 101 : 2000,V7875XRActor(name,kind="dispersed" ? i*15 : 0,i-1),"=")
    }
    if kind="dead-peer" || kind="dead-peer-no-pose"
        V7875XDFeed(f,2050,kind="dead-peer-no-pose" ? "@Peer#1" : V7875XRActor("Peer",0,3,0,0,0),"=","Death")
    V7875XDFeed(f,2100,V7875XDroidAt(0),V7875XRActor("Outside",distance),"Target")
    if kind="ambiguous"
        V7875XDFeed(f,2200,V7875XDroidAt(0),V7875XRActor("Inside",distance+1),"Target")
    land := V7875XDFeed(f,kind="stale" ? 4100 : 3100,V7875XDroidAt(distance),"=")
    if kind="rejected"
        land.Analysis.Accepted := false
    if kind="bad-value"
        land.ValueOK := false
    if kind="boss-dead"
        V7875XDFeed(f,10000,V7875XRActor("Tank"),V7875XRActor("XR"),"Death")
    if kind!="pending"
        V7875XDFeed(f,18100,V7875XDroidAt(distance,0),"=")
    if kind="killed"
        V7875XDFeed(f,18100,V7875XRActor("Inside"),V7875XDroidAt(distance,0),"Death")
    if kind="hit"
        V7875XDFeed(f,18100,V7875XDroidAt(distance,0),V7875XRActor("Outside",distance),"Damage")
    return f
}
V7875XGObserveFixture(f)
{
    data := IPNewData("isolated inference",5000),seg := IPNewSegment(data,0,"observed combat entry")
    seg.BossKey := "XR-53",seg.AreaId := f.Pull.Area,seg.ModeId := f.Pull.Mode,seg.DisplayDisciplines := Map()
    for key,p in f.Pull.Players {
        if p.HasOwnProp("DisciplineId")
            seg.DisplayDisciplines[key] := p.DisciplineId
    }
    for item in f.Data.Rows {
        if !item.Analysis.Accepted
            continue
        ev := item.Clone(),ev.RecordId := item.Analysis.Seq
        IXGAnnotate(ev,ev.Analysis.Raw,ev.Analysis.At,ev.RecordId+1000)
        IXASafeObserve(seg,ev,ev.Analysis.At)
    }
    return seg
}
V7875XRInferredExplosions()
{
    for healer in [false,true] {
    for kind in ["far","close","melee","unknown-role","sparse","stale","dispersed","dead-peer","dead-peer-no-pose","ambiguous","rejected","bad-value","boss-dead","pending","killed","hit"] {
        f := V7875XGFixture(kind,healer),m := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(m.InferredExplosions=(kind="far" ? 1 : 0),"inference requires unknown outcome, unique ranged/healer jump and fresh far group: " kind "/" healer)
        if kind="far" {
            V48Assert(m.Unknown=0 && m.Explosions.Length=1 && m.Explosions[1].Inferred,"inferred explosion replaces just the unknown outcome")
            V48Assert(IXAView(m).Rows[1].Value="Failed" && IXAView(m).Rows[1].Failed,"inference still fails the live achievement")
            V48Assert(InStr(m.Text,"failed at 0:18.100") && !InStr(m.Text,"inferred") && InStr(m.Advanced,"0:18.100  inferred explosion:") && InStr(m.Debug,"inferred explosion:"),"outward droid failure keeps timestamp in main results and inference evidence in Advanced details")
            V48Assert(m.FightExplosions.Length=0 && m.OutsideExplosions=1,"safe outward droid stays out of group-danger feedback")
            V48Assert(InStr(m.Explosions[1].Evidence,healer ? "(healer)" : "(ranged DPS)"),"inferred evidence preserves the recipient's actual role")
        }
        seg := V7875XGObserveFixture(f),live := IXASummary(seg.XRAchievements,f.Pull.End)
        for field in ["InferredExplosions","Unknown","Killed","Pending","IgnoredAtKill","Seen"]
            V48Assert(live.%field%=m.%field%,"live and review agree: " field "/" kind)
        V48Assert(live.Explosions.Length=m.Explosions.Length,"live and review explosion count: " kind)
        rows := f.Data.Rows.Clone(),f.Data.Rows := []
        Loop rows.Length
            f.Data.Rows.Push(rows[rows.Length+1-A_Index])
        reverse := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(reverse.Text=m.Text && XRDiagnosticJSON(reverse.Jumps)=XRDiagnosticJSON(m.Jumps),"reverse display order preserves inference: " kind)
    }
    }
    f := V7875XGFixture(),m := IXCBuild(f.Data,f.Pull).Droids
    V7875XDFeed(f,20000,V7875XDroid(2,0),V7875XRActor("Inside"),"Damage")
    m := IXCBuild(f.Data,f.Pull).Droids
    V48Assert(m.InferredExplosions=1 && m.Explosions.Length=2 && IXAView(m).Rows[1].Value="Failed","recorded failure takes label precedence but keeps inference count")
}
V7875XRInferenceRollback()
{
    f := V7875XGFixture("pending"),seg := V7875XGObserveFixture(f)
    before := IXGJumps(seg.XRAchievements),data := IPNewData("isolated geometry rollback",5000)
    ev := V7875XDFeed(f,3200,V7875XDroidAt(31),V7875XRActor("Inside",31),"Target")
    ev.RecordId := f.Next,IXGAnnotate(ev,ev.Analysis.Raw,3200,ev.RecordId)
    IPBBeginUndo(data,seg),IXASafeObserve(seg,ev,3200)
    V48Assert(!IXGJumps(seg.XRAchievements).Count,"new ambiguous jump recipient removes unique inference")
    IPBRollbackTail(data,seg)
    V48Assert(XRDiagnosticJSON(before)=XRDiagnosticJSON(IXGJumps(seg.XRAchievements)),"rollback restores jump candidates and peer snapshots")
    ev := V7875XDFeed(f,18100,V7875XDroidAt(30,0),"="),ev.RecordId := f.Next
    IXGAnnotate(ev,ev.Analysis.Raw,18100,ev.RecordId)
    IPBBeginUndo(data,seg),IXASafeObserve(seg,ev,18100)
    V48Assert(IXASummary(seg.XRAchievements,18100).InferredExplosions=1,"tentative zero-HP can infer")
    IPBRollbackTail(data,seg)
    V48Assert(IXASummary(seg.XRAchievements,18100).InferredExplosions=0,"rollback removes speculative inference")
    ; An expired cast alone, even with a matched outward jump, stays unknown.
    d := {HitAt:-1,SelfAt:-1,KillAt:-1,ZeroAt:-1,CastAt:0,At:0,Record:1}
    for key,jump in before
        V48Assert(IXGOutcome(d,20000,false,jump).Kind="unknown","timer expiry is not disappearance evidence")
    f := V7875XGFixture("pending"),seg := V7875XGObserveFixture(f)
    Loop 130 {
        ev := V7875XDFeed(f,3200+A_Index,V7875XDroidAt(30),"="),ev.RecordId := f.Next
        IXGAnnotate(ev,ev.Analysis.Raw,ev.Analysis.At,ev.RecordId)
        IXASafeObserve(seg,ev,ev.Analysis.At)
    }
    for key,t in seg.XRAchievements.JumpTracks
        V48Assert(!t.Limited && t.Samples<=6 && IsObject(t.Match),"repeated stationary droid observations do not consume path storage")
}

V7875XRDroidLateKills()
{
    for elapsed in [14548,14723,14990,15000,15010,15501,19000,60000] {
        f := V7875XRFixture(false),f.Pull.End := 70000
        V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
        V7875XDFeed(f,1000+elapsed,V7875XRActor("Inside"),V7875XDroid(1,0),"Death")
        m := IXCBuild(f.Data,f.Pull).Droids,live := IXASummary(V7875XDRecord(f),f.Pull.End)
        V48Assert(m.Killed=1 && !m.Unknown && !m.Explosions.Length,"player kill has no timer cutoff: " elapsed)
        V48Assert(IXAView(m).Rows[1].Value="Active" && live.Killed=1 && !live.Explosions.Length,"live and review accept late kill: " elapsed)
        rows := f.Data.Rows.Clone(),f.Data.Rows := []
        Loop rows.Length
            f.Data.Rows.Push(rows[rows.Length+1-A_Index])
        V48Assert(IXCBuild(f.Data,f.Pull).Droids.Text=m.Text,"kill/cast input ordering cannot change outcome")
    }
    for observedHit in [false,true] {
        f := V7875XRFixture(false),f.Pull.End := 40000
        V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
        V7875XDFeed(f,16000,V7875XDroid(1,0),"=","Death")
        if observedHit
            V7875XDFeed(f,16000,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
        V7875XDFeed(f,16010,V7875XRActor("Inside"),V7875XDroid(1,0),"Death")
        m := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(m.Killed=(observedHit ? 0 : 1) && m.Explosions.Length=(observedHit ? 1 : 0),"player kill overrides timed self-death but not an observed explosion")
        V48Assert(!m.InferredExplosions,"observed explosion or player kill replaces timing inference")
    }
    for kind in ["geometry","timed-self"] {
        f := V7875XGFixture("pending",true),f.Pull.End := 40000
        V7875XDFeed(f,3200,V7875XDroidAt(30),"=","Activate")
        V7875XDFeed(f,18200,V7875XDroidAt(30,0),"=",kind="geometry" ? "Sample" : "Death")
        seg := V7875XGObserveFixture(f),state := seg.XRAchievements
        V48Assert(IXAView(IXASummary(state,18200)).Rows[1].Value="Failed","inferred failure exists before delayed kill: " kind)
        ev := V7875XDFeed(f,18210,V7875XRActor("Inside"),V7875XDroidAt(30,0),"Death")
        ev.RecordId := ev.Analysis.Seq
        data := IPNewData("isolated late kill rollback",5000),IPBBeginUndo(data,seg)
        IXASafeObserve(seg,ev,18210)
        s := IXASummary(state,18210),m := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(!s.Explosions.Length && !s.Unknown && s.Killed=1 && IXAView(s).Rows[1].Value="Active","late kill immediately retracts inferred live failure: " kind)
        V48Assert(m.Text!="" && !m.Explosions.Length && m.Killed=1,"saved feedback also retracts inference: " kind)
        IPBRollbackTail(data,seg)
        V48Assert(IXAView(IXASummary(state,18200)).Rows[1].Value="Failed","rollback restores prior inferred state")
        IXASafeObserve(seg,ev,18210)
        hit := V7875XDFeed(f,18211,V7875XDroidAt(30,0),V7875XRActor("Inside"),"Damage")
        hit.RecordId := hit.Analysis.Seq,IXASafeObserve(seg,hit,18211)
        V48Assert(IXAView(IXASummary(state,18211)).Rows[1].Value="Failed","actual explosion overrides earlier kill and inference")
    }
}
V7875XRDroidDelayedSelfDeath()
{
    for elapsed in [14499,14500,14983,15018,15108,15501,19000,60000] {
        f := V7875XRFixture(false),f.Pull.End := 70000
        V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
        V7875XDFeed(f,1000+elapsed,V7875XDroid(1,0),"=","Death")
        m := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(m.Explosions.Length=(elapsed>=14500 ? 1 : 0),"minimum floor retained without maximum: " elapsed)
        if elapsed>=14500 {
            V48Assert(m.InferredExplosions=1 && IXAView(m).Rows[1].Value="Failed","cast/self-death inference preserves the failed state")
            V48Assert(!InStr(m.Text,"inferred") && InStr(m.Advanced,"inferred explosion: self-death") && InStr(m.Debug,"self-death"),"advanced report retains timing evidence")
        }
        V48Assert(IXASummary(V7875XDRecord(f),f.Pull.End).Explosions.Length=m.Explosions.Length,"live and review delayed outcome agree")
    }
    for guard in ["no-cast","boss-dead","rejected","invalid","no-death"] {
        f := V7875XRFixture(false),f.Pull.End := 70000
        if guard!="no-cast"
            V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
        if guard="boss-dead"
            V7875XDFeed(f,15000,V7875XRActor("Tank"),V7875XRActor("XR"),"Death")
        ev := V7875XDFeed(f,60000,V7875XDroid(1,guard="no-death" ? 1000 : 0),"=",guard="no-death" ? "Sample" : "Death")
        if guard="rejected"
            ev.Analysis.Accepted := false
        if guard="invalid"
            ev.ValueOK := false
        V48Assert(!IXCBuild(f.Data,f.Pull).Droids.Explosions.Length,"delayed inference retains evidence/cutoff guard: " guard)
    }
}

V7875XHFixture(kind := "roll")
{
    f := V7875XRFixture(false),f.Pull.End := 40000
    f.Pull.Players["@Outside#1"].DisciplineId := "2031339142381592"
    V7875XDFeed(f,100,V7875XDroidAt(0),V7875XRActor("Tank"),"Target")
    V7875XDFeed(f,200,V7875XRActor("Outside",30,0,0,0,kind="already-dead" ? 0 : 1000),"=")
    if kind="ambiguous"
        V7875XDFeed(f,300,V7875XRActor("Inside",31),"=")
    if kind="dead"
        V7875XDFeed(f,400,V7875XRActor("Outside",30,0,0,0,0),"=","Death")
    if kind="midpoint"
        V7875XDFeed(f,500,V7875XRActor("Inside",15),"=")
    if kind="midpoint"
        V7875XDFeed(f,600,V7875XDroidAt(15),"=")
    if kind!="dead" && kind!="already-dead"
        V7875XDFeed(f,kind="delayed" ? 7000 : 2000,V7875XRActor("Outside",10),"=","Activate","3200519434665984")
    landing := kind="delayed" ? 8100 : 3100
    for i,name in ["Tank","Other tank","Peer","Inside"] {
        if kind="ambiguous" && name="Inside"
            continue
        V7875XDFeed(f,landing-100,V7875XRActor(name,0,i-1),"=")
    }
    V7875XDFeed(f,landing,V7875XDroidAt(30),"=")
    if kind="late-entrant" {
        V7875XDFeed(f,landing+100,V7875XRActor("Inside",30),"=")
        V7875XDFeed(f,landing+200,V7875XDroidAt(30),"=")
    }
    V7875XDFeed(f,18100,V7875XDroidAt(30,0),"=")
    return f
}
V7875XRJumpPaths()
{
    for kind in ["roll","delayed","midpoint","ambiguous","dead","already-dead","late-entrant"] {
        f := V7875XHFixture(kind),model := IXCBuild(f.Data,f.Pull).Droids
        matched := kind!="ambiguous" && kind!="already-dead"
        V48Assert(model.Jumps.Count=(matched ? 1 : 0),"player path recipient: " kind)
        V48Assert(model.InferredExplosions=(matched ? 1 : 0),"outward path inference: " kind)
        for key,jump in model.Jumps
            V48Assert(jump.Player="@Outside#1" && jump.MatchDistance=0,"match the destination to the pre-roll player: " kind)
        seg := V7875XGObserveFixture(f),live := IXASummary(seg.XRAchievements,f.Pull.End)
        V48Assert(live.InferredExplosions=model.InferredExplosions && live.Unknown=model.Unknown,"live/review path parity: " kind)
        V48Assert(!seg.XRAchievements.JumpActive.Count,"terminal observation releases active path tracking: " kind)
        for key,t in seg.XRAchievements.JumpTracks
            V48Assert(t.Closed && !t.Paths.Count,"completed droid releases movement history: " kind)
        rows := f.Data.Rows.Clone(),f.Data.Rows := []
        Loop rows.Length
            f.Data.Rows.Push(rows[rows.Length+1-A_Index])
        reverse := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(XRDiagnosticJSON(reverse.Jumps)=XRDiagnosticJSON(model.Jumps),"display sorting cannot change path matching: " kind)
    }
}
V7875XRJumpPathGuards()
{
    f := V7875XHFixture(),f.Data.Rows.Pop(),seg := V7875XGObserveFixture(f)
    data := IPNewData("isolated path rollback",5000),before := XRDiagnosticJSON(IXGJumps(seg.XRAchievements))
    ev := V7875XDFeed(f,2500,V7875XRActor("Inside",30),"="),ev.RecordId := f.Next
    IXGAnnotate(ev,ev.Analysis.Raw,2500,ev.RecordId)
    IPBBeginUndo(data,seg),IXASafeObserve(seg,ev,2500)
    V48Assert(!IXGJumps(seg.XRAchievements).Count,"late earlier geometry cannot silently manufacture a unique recipient")
    IPBRollbackTail(data,seg)
    V48Assert(before=XRDiagnosticJSON(IXGJumps(seg.XRAchievements)) && seg.XRAchievements.JumpActive.Count=1,"rollback restores active track and match")
    ev := V7875XDFeed(f,18100,V7875XDroidAt(30,0),"="),ev.RecordId := f.Next
    IXGAnnotate(ev,ev.Analysis.Raw,18100,ev.RecordId)
    IPBBeginUndo(data,seg),IXASafeObserve(seg,ev,18100)
    V48Assert(!seg.XRAchievements.JumpActive.Count,"terminal event closes tracking")
    IPBRollbackTail(data,seg)
    V48Assert(seg.XRAchievements.JumpActive.Count=1 && before=XRDiagnosticJSON(IXGJumps(seg.XRAchievements)),"terminal rollback restores full tracking")
    t := {Paths:Map(),Samples:0,Limited:false}
    Loop 4097
        IXGPath(t,{Key:"@Moving#1",At:A_Index,Record:A_Index,HP:1,X:A_Index,Y:0})
    V48Assert(t.Limited && t.Samples=4096 && t.Paths["@Moving#1"].Length=4096,"movement history has a storage bound with explicit abstention")
    t := {Paths:Map(),Samples:0,Limited:false}
    Loop 5000
        IXGPath(t,{Key:"@Still#1",At:A_Index,Record:A_Index,HP:1,X:30,Y:0})
    V48Assert(!t.Limited && t.Samples=1,"stationary repeated rows do not exhaust history")
}

V7875XRHealthFixture(hp := 400,gap := 1000,terminal := "Sample")
{
    f := V7875XRFixture(false),f.Pull.End := 40000
    V7875XDFeed(f,100,V7875XDroid(),"=","Sample","2")
    V7875XDFeed(f,18000-gap,V7875XRActor("Inside"),V7875XDroid(1,hp),"Sample","2")
    V7875XDFeed(f,18000,V7875XDroid(1,0),"=",terminal,"2")
    return f
}
V7875XRHealthInference()
{
    for item in [[400,1000,true],[250,3000,true],[249,1000,false],[400,3001,false],[1,100,false],[1000,0,true]] {
        f := V7875XRHealthFixture(item[1],item[2]),m := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(m.InferredExplosions=(item[3] ? 1 : 0) && m.Unknown=(item[3] ? 0 : 1),"recent substantial HP boundary")
        live := IXASummary(V7875XDRecord(f),f.Pull.End)
        V48Assert(live.InferredExplosions=m.InferredExplosions && live.Unknown=m.Unknown,"live/review health inference parity")
        if item[3]
            V48Assert(InStr(m.Debug,"HP (") && InStr(m.Advanced,"inferred explosion:") && !InStr(m.Text,"inferred") && IXAView(m).Rows[1].Value="Failed","health inference evidence moves to Advanced details")
        rows := f.Data.Rows.Clone(),f.Data.Rows := []
        Loop rows.Length
            f.Data.Rows.Push(rows[rows.Length+1-A_Index])
        V48Assert(IXCBuild(f.Data,f.Pull).Droids.Text=m.Text,"latest health selection independent of display ordering")
    }
    for terminal in ["Sample","Death"] {
        f := V7875XRHealthFixture(400,1000,terminal)
        V48Assert(IXCBuild(f.Data,f.Pull).Droids.InferredExplosions=1,"zero HP and self-death supported without cast")
    }
    for castAt in [3500,3501] {
        f := V7875XRHealthFixture()
        V7875XDFeed(f,castAt,V7875XDroid(),"=","Activate")
        V48Assert(IXCBuild(f.Data,f.Pull).Droids.InferredExplosions=(castAt=3500 ? 1 : 0),"known cast retains existing minimum completion time")
    }
    for kind in ["no-terminal","low-later","positive-after","bad-maximum","invalid","rejected","boss-ended"] {
        f := V7875XRHealthFixture()
        switch kind {
            case "no-terminal": f.Data.Rows.Pop()
            case "low-later": V7875XDFeed(f,17999,V7875XDroid(1,1),"=","Sample","2")
            case "positive-after": V7875XDFeed(f,18001,V7875XDroid(1,400),"=","Sample","2")
            case "bad-maximum": f.Data.Rows[2].TargetHP.Maximum := 0
            case "invalid": f.Data.Rows[2].ValueOK := false
            case "rejected": f.Data.Rows[2].Analysis.Accepted := false
            case "boss-ended": V7875XDFeed(f,17500,V7875XRActor("Inside"),V7875XRActor("XR"),"Death")
        }
        V48Assert(!IXCBuild(f.Data,f.Pull).Droids.Explosions.Length,"health inference guard: " kind)
    }
}
V7875XRHealthPrecedence()
{
    for when in [17999,18000,18010,25000] {
        f := V7875XRHealthFixture()
        V7875XDFeed(f,when,V7875XRActor("Inside"),V7875XDroid(1,0),"Death","2")
        m := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(m.Killed=1 && !m.Explosions.Length && !m.Unknown,"player kill overrides HP inference at any delay")
        V7875XDFeed(f,18000,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
        m := IXCBuild(f.Data,f.Pull).Droids
        V48Assert(m.Explosions.Length=1 && !m.InferredExplosions && !m.Killed,"actual hit still overrides kill")
    }
}
V7875XRHealthRollback()
{
    f := V7875XRHealthFixture(),zero := f.Data.Rows.Pop(),seg := V7875XGObserveFixture(f)
    data := IPNewData("isolated health inference rollback",5000),zero.RecordId := zero.Analysis.Seq
    IPBBeginUndo(data,seg),IXASafeObserve(seg,zero,18000)
    V48Assert(IXASummary(seg.XRAchievements,18000).InferredExplosions=1,"zero transitions pending to inferred")
    IPBRollbackTail(data,seg)
    V48Assert(!IXASummary(seg.XRAchievements,18000).Explosions.Length,"rollback removes terminal inference")
    IXASafeObserve(seg,zero,18000)
    kill := V7875XDFeed(f,18010,V7875XRActor("Inside"),V7875XDroid(1,0),"Death","2"),kill.RecordId := kill.Analysis.Seq
    IPBBeginUndo(data,seg),IXASafeObserve(seg,kill,18010)
    V48Assert(IXASummary(seg.XRAchievements,18010).Killed=1,"late player kill retracts live HP inference")
    IPBRollbackTail(data,seg)
    V48Assert(IXASummary(seg.XRAchievements,18010).InferredExplosions=1,"rollback restores inferred outcome")
}

V7875XRTrackingGap()
{
    f := V7875XRHealthFixture(100,1000),m := IXCBuild(f.Data,f.Pull).Droids
    v := IXAView(m,"@Inside#1"),row := v.Rows[1]
    V48Assert(m.Unknown=1 && !m.Explosions.Length && v.Stopped,"unresolved terminal outcome stops assessment without inventing failure")
    V48Assert(row.Value="Possible desync" && !row.Active && !row.Failed && IXAStatusColor(row)="AEB4BE","unresolved criterion is gray")
    V48Assert(v.Rows[2].Value="Active" && v.Rows[2].Active,"missing droid outcome does not stop Shriek tracking")
    V48Assert(IXAStatusNote(v)="Possible desync" && InStr(m.Text,"Perfection in Imperfection: Possible desync") && !InStr(m.Text,"tracking stopped"),"live and review use the requested possible-desync wording")
    V48Assert(InStr(m.Text,"not confirmed"),"report does not diagnose desync from missing records")
    live := IXAView(IXASummary(V7875XDRecord(f),f.Pull.End))
    V48Assert(live.Stopped && live.Rows[1].Value=row.Value,"live/review gap presentation agrees")
    V7875XDEnzyme(f,18005,"Inside",20)
    V48Assert(IXAView(IXCBuild(f.Data,f.Pull).Droids,"@Inside#1").Rows[3].Active,"Well Marinated continues recording stacks")
    V7875XDFeed(f,18010,V7875XRActor("Inside"),V7875XDroid(1,0),"Death","2")
    m := IXCBuild(f.Data,f.Pull).Droids,v := IXAView(m)
    V48Assert(m.Killed=1 && !v.Stopped && v.Rows[1].Active,"late recorded kill resolves stopped state")
    V7875XDFeed(f,18011,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
    m := IXCBuild(f.Data,f.Pull).Droids,v := IXAView(m)
    V48Assert(v.Rows[1].Failed && !v.Stopped && IXAStatusColor(v.Rows[1])="FF9CA8","recorded explosion still has failure priority")
    f := V7875XRHealthFixture(100,1000)
    V7875XDFeed(f,18010,V7875XDroid(2,0),V7875XRActor("Inside"),"Damage")
    m := IXCBuild(f.Data,f.Pull).Droids,v := IXAView(m)
    V48Assert(m.Unknown=1 && v.Rows[1].Value="Failed" && !v.Stopped,"an unresolved droid cannot hide another droid's established failure")
    V48Assert(!InStr(m.Text,"tracking stopped"),"failed report does not claim assessment stopped")
}
V7875XRTrackingDisplay()
{
    m := IXASummary(IXANewState(),0,true),v := IXAView(m)
    V48Assert(!v.Stopped && v.Rows[1].Value="Unclear" && InStr(IXAStatusNote(v),"Incomplete log"),"generic incomplete log is not relabelled desync")
    m := IXASummary(IXANewState(),0),m.Pending := 1,v := IXAView(m)
    V48Assert(!v.Stopped && v.Rows[1].Active,"still-living droid is not a tracking gap")
    m.Unknown := 1,m.Explosions.Push({Inferred:true}),m.InferredExplosions := 1,v := IXAView(m)
    V48Assert(!v.Stopped && v.Rows[1].Value="Failed","existing inference precedence preserved")
    v := IXAData(true)
    V48Assert(!v.Stopped && v.Rows[1].Value="Active" && v.Rows[2].Value="Failed","preview retains its active/failed examples")
    V48Assert(!InStr(XRDiagnosticJSON(v),"Possible desync") && !InStr(IXAStatusNote(v),"stopped"),"edge case is absent from preview")
}

V7875RaidTargets() => V58Isolated(V7875RaidTargetsCase)
V7875RaidTargetPhases() => V75LibraryRun(V7864PhaseFixture.Bind(V7875RaidTargetPhaseCase))
V7875RaidTargetLayout() => V58Isolated(V7875RaidTargetLayoutCase)

V7875RaidTargetFixture()
{
    global IP
    s := IPNewData("SYNTHETIC RAID TARGETS"),p := "@Damage One#1",q := "@Damage Two#2",h := "@Healer#3"
    a := "Aivela {4088525397950464}:10",b := "Esne {4088538282852352}:11",add := "Countermeasure {4105005613170688}:12"
    for line in ["[00:00:00.000] [" p "] [] [] [AreaEntered {836045448953664}: Valley {833571547775765} 8 Player Master {836045448953655}]",
        IPDemoLine(1000,p,"=","Enter"),IPDemoLine(1100,p,a,"Damage",100),IPDemoLine(1200,p,b,"Damage",200),
        IPDemoLine(1500,q,a,"Damage",300),IPDemoLine(1600,q,add,"Damage",500),IPDemoLine(1700,h,p,"Heal",400),
        IPDemoLine(2000,a,p,"Damage",50),IPDemoLine(2500,p,add,"Damage",100),
        IPDemoLine(3000,p,"Countermeasure {4105005613170688}:13","Damage",75)]
        IPFeedLine(s,line)
    IP.Live := s,IP.View := "Live",IP.Active := false,IP.Follow := false,IP.Selected := 1
    seg := s.Segments[1],seg.End := seg.Last
    if !IPMGuiAlive(IP.Gui)
        IPWBuild()
    V58SelectTab(7),IPWState().RaidSignature := "",IPRefresh()
    return {Data:s,Segment:seg,A:IPActor(a).Key,B:IPActor(b).Key,Add:IPActor(add).Key,P:p,Q:q,H:h}
}

V7875RaidTargetChoose(key)
{
    c := IPWState().Controls,r := IRBTState()
    for i,k in r.Keys {
        if k=key {
            c["RaidTarget"].Choose(i),IRBTChanged()
            return
        }
    }
    throw Error("Missing test target: " key)
}

V7875RaidTargetsCase()
{
    global IP
    f := V7875RaidTargetFixture(),seg := f.Segment,c := IPWState().Controls,lv := IP.PlayersLV
    V48Assert(seg.BossKey="G-AE","fixture is the two-boss encounter")
    V48Assert(lv.GetText(V7428RaidRow(f.P),2)="475" && lv.GetText(V7428RaidRow(f.Q),2)="800","unfiltered totals include adds")
    before := IAFrozenTarget(seg),heal := lv.GetText(V7428RaidRow(f.H),4),taken := lv.GetText(V7428RaidRow(f.P),6)
    V7875RaidTargetChoose("bosses")
    V48Assert(lv.GetText(V7428RaidRow(f.P),2)="300" && lv.GetText(V7428RaidRow(f.Q),2)="300","all bosses combines Aivela and Esne and excludes Countermeasures")
    V48Assert(lv.GetText(V7428RaidRow(f.P),3)="150.0" && lv.GetText(V7428RaidRow(f.H),2)="0","all players use the same two-second denominator, including zero damage")
    V48Assert(lv.GetText(V7428RaidRow(f.H),4)=heal && lv.GetText(V7428RaidRow(f.P),6)=taken,"damage selection leaves healing and incoming damage alone")
    V7875RaidTargetChoose(f.A)
    V48Assert(lv.GetText(V7428RaidRow(f.P),2)="100" && lv.GetText(V7428RaidRow(f.Q),2)="300","specific boss compares both players")
    IPWState().Sorts["Raid"] := {Column:2,Desc:true},V7428RaidRedraw()
    V48Assert(lv.GetText(1,9)=f.Q,"filtered damage sorts numerically")
    V7875RaidTargetChoose(f.B)
    V48Assert(lv.GetText(V7428RaidRow(f.P),2)="200" && lv.GetText(V7428RaidRow(f.Q),2)="0","the other boss has distinct totals")
    V7875RaidTargetChoose(f.Add)
    V48Assert(lv.GetText(V7428RaidRow(f.P),2)="100" && lv.GetText(V7428RaidRow(f.Q),2)="500","same-named add instances are not merged")
    choices := IRBTChoices(seg),duplicates := 0
    for label in choices.Labels
        if InStr(label,"Countermeasure #")
            duplicates += 1
    V48Assert(duplicates=2,"same-named enemies have distinct labels")
    V58SelectTab(2),V58SelectTab(7)
    V48Assert(IRBTState().Key=f.Add,"switching tabs preserves target selection")
    V7875RaidTargetChoose(""),V48Assert(lv.GetText(V7428RaidRow(f.P),2)="475","All targets restores full totals")
    V48Assert(!IABaseReconcile(seg,before).Length,"target browsing never mutates counted metrics")
    V7875RaidTargetChoose(f.A)
    V7875RaidTargetFixture()
    V48Assert(IRBTState().Key="" && c["RaidTarget"].Text="All targets","a different pull resets stale target identity")
    IPWClearData(true)
    V48Assert(!c["RaidTarget"].Enabled,"no fight disables the target selector")
}

V7875RaidTargetPhaseCase(s,seg,path,text)
{
    global IP
    V48Assert(IRPLoad(),"target-phase fixture loads verified phases")
    IALoadPump(),IRPPoll(),r := IRPState(),c := IPWState().Controls,key := "@Review#66"
    V48Assert(r.Models.Length=2,"both recorded phases loaded")
    c["RaidPhase"].Choose(3),IRPChanged(),V7875RaidTargetChoose("bosses")
    model := r.Models[2],row := V7428RaidRow(key)
    V48Assert(model.Totals[key].Damage=500,"phase totals still include 200 add and 300 boss damage")
    V48Assert(IP.PlayersLV.GetText(row,2)="300" && IP.PlayersLV.GetText(row,3)=IPRate(300,model.Seconds),"boss filter uses only phase events and its shared duration")
    c["RaidPhase"].Choose(1),IRPChanged()
    V48Assert(IP.PlayersLV.GetText(V7428RaidRow(key),2)="400","whole-fight selection restores the opening boss hit")
    V48Assert(IRBTState().Key="bosses","changing phase retains the damage target")
}

V7875RaidTargetLayoutCase()
{
    global IP
    V7875RaidTargetFixture(),c := IPWState().Controls
    for size in [[980,650],[1220,780],[1920,1080]] {
        IPResize(IP.Gui,0,size[1],size[2])
        c["RaidTarget"].GetPos(&x,&y,&w,&h),c["RaidTargetCaption"].GetPos(&cx,&cy,&cw,&ch)
        c["RaidPhaseLoading"].GetPos(&px,&py,&pw,&ph),IP.PlayersLV.GetPos(&lx,&ly,&lw,&lh)
        V48Assert(x>=cx+cw && y>py+ph && y+h<=ly-24 && x+w<=lx+lw && lh>150,"target controls fit without covering phase or table at " size[1])
        c["RaidTargetHint"].GetPos(&hx,&hy,&hw,&hh)
        hintWidth := Ceil(IUMTextWidth(c["RaidTargetHint"].Text,SendMessage(0x31,0,0,c["RaidTargetHint"].Hwnd))/(A_ScreenDPI/96))
        V48Assert(hx>=x+w && hw>=hintWidth && hx+hw<=lx+lw,"the actual damage scope explanation fits at " size[1])
    }
    V58SelectTab(2)
    V48Assert(!V58ChildVisible(c["RaidTarget"]) && !V58ChildVisible(c["RaidTargetHint"]),"target controls only appear in Raid")
    V48Assert(!DllCall("IsWindowVisible","Ptr",IP.Gui.Hwnd),"regressions never show the normal app")
}

V7875BossOverlayData() => V58Isolated(V7875BossOverlayDataCase)
V7875BossOverlaySettings() => V55Isolated(V7875BossOverlaySettingsCase)
V7875BossOverlayRender() => V58Isolated(V7875BossOverlayRenderCase)

V7875BossOverlayDataCase()
{
    global IP,IPM
    f := V7875RaidTargetFixture(),seg := f.Segment,before := IAFrozenTarget(seg)
    snap := IPMOverlaySnapshot(IP,IPM)
    V48Assert(!snap.Actors[1].HasOwnProp("BossDamage"),"disabled overlay does no extra aggregation")
    IIFSetChoice(IPM,"BossDamage",true),snap := IPMOverlaySnapshot(IP,IPM)
    ranked := IPMRank(snap.Actors,"BossDamage",24)
    V48Assert(ranked.Count=2 && ranked.Total=600 && ranked.Peak=300,"two bosses combine, adds and zero-damage rows excluded")
    V48Assert(IPMRowText(ranked.Rows[1],snap.Duration).Rate="150.0","same two-second fight duration as raid table")
    V48Assert(IPMRank(snap.Actors,"Damage",24).Total=1275,"ordinary raid damage retains add damage")
    V7875RaidTargetChoose(f.Add)
    V48Assert(IPMRank(IPMOverlaySnapshot(IP,IPM).Actors,"BossDamage",24).Total=600,"browsing a Raid target cannot change the live overlay")
    snap.Actors[1].BossDamage := 99999
    V48Assert(IPMRank(IPMOverlaySnapshot(IP,IPM).Actors,"BossDamage",24).Total=600,"snapshots are numeric copies")
    s := IPNewData("SYNTHETIC SAVED OVERLAY"),p := "@Saved#8",boss := "Aivela {4088525397950464}:90"
    IPFeedLine(s,IPDemoLine(1000,p,"=","Enter")),IPFeedLine(s,IPDemoLine(2000,p,boss,"Damage",70))
    IP.Offline := s,IP.View := "Offline",IP.Selected := 1,IPM.Source := 3,IP.Active := true
    V48Assert(IPMRank(IPMOverlaySnapshot(IP,IPM).Actors,"BossDamage",24).Total=600,"automatic active mode keeps live combat while reviewing a saved log")
    IP.Active := false
    V48Assert(IPMRank(IPMOverlaySnapshot(IP,IPM).Actors,"BossDamage",24).Total=70,"stopped automatic mode follows the selected saved fight")
    IPM.Source := 1
    V48Assert(IPMRank(IPMOverlaySnapshot(IP,IPM).Actors,"BossDamage",24).Total=600,"explicit live source retains latest finished result")
    IP.Live := IPNewData("SYNTHETIC CLEARED")
    V48Assert(!IPMOverlaySnapshot(IP,IPM).Id,"clear removes stale boss results")
    V48Assert(!IABaseReconcile(seg,before).Length,"overlay never changes parser totals or encounter timing")
}

V7875BossOverlaySettingsCase()
{
    global IPM,SETTINGS_FILE,IRTPrefs
    V48Assert(!IPM.Shown["BossDamage"] && IPMPanelFor("BossDamage")=IPM.Panels["BossDamage"],"dedicated panel is opt-in in every layout")
    IIFSetChoice(IPM,"BossDamage",true),IIFSetChoice(IPM,"Damage",true)
    V48Assert(IIFSnapshot(IPM).Selected["BossDamage"] && IIFSnapshot(IPM).Selected["Damage"],"overall and boss damage can be shown together")
    p := IPM.Panels["BossDamage"],p.X := -450,p.Y := 120,p.Width := 340,p.Height := 280,p.AutoHeight := false
    IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings(),p := IPM.Panels["BossDamage"]
    V48Assert(IPM.Shown["BossDamage"] && IniRead(SETTINGS_FILE,"IrisParseDisplay","BossDamageEnabled")="1","selection persists in the existing settings store")
    V48Assert(p.X=-450 && p.Y=120 && p.Width=340 && p.Height=280 && !p.AutoHeight,"independent size and signed position survive reload")
    V48Assert(!IPM.Wanted && !IPM.TimerOn,"restoring preference never auto-starts overlays")
    keys := IPMSizeKeys(),labels := IPMSizeLabels()
    bossIndex := 0
    for i,key in keys {
        if key="BossDamage"
            bossIndex := i
    }
    V48Assert(keys.Length=labels.Length && bossIndex && labels[bossIndex]="Raid Boss Damage","size picker names the boss window")
    IPMOpenSettings(),IPM.GeometryControl.Choose(bossIndex),IPMGeometryChanged()
    V48Assert(IPM.GeometryKey="BossDamage" && IPM.WidthControl.Value=340,"actual geometry settings address the boss panel")
    values := ILPCapture(IPM,IRTPrefs),IPM.Shown["BossDamage"] := false,p.Width := 400
    ILPApplyModel(IPM,IRTPrefs,values)
    V48Assert(IPM.Shown["BossDamage"] && p.Width=340,"saved overlay layouts restore the panel")
}

V7875BossOverlayRenderCase()
{
    global IP,IPM
    f := V7875RaidTargetFixture(),IPM.Shown["BossDamage"] := true
    snap := IPMOverlaySnapshot(IP,IPM),p := IPM.Panels["BossDamage"]
    IPMEnsureGui("BossDamage"),IPMRender("BossDamage",snap),IOHSyncPanel(p)
    V48Assert(p.VisibleRows=2 && InStr(p.Heading.Text,"Raid Boss Damage") && p.Rows[1].Total.Text="300" && p.Rows[1].Value.Text="150.0","native panel shows boss totals and DPS")
    V48Assert(p.HeadingIcon.HaveIcon && p.HeadingIcon.Key="target","boss damage has its own heading icon")
    V48Assert((WinGetExStyle(p.Gui.Hwnd)&0x08000020)=0x08000020 && !DllCall("IsWindowVisible","Ptr",p.Gui.Hwnd),"locked panel stays nonactivating, click-through and hidden in tests")
    V48Assert(V7875Alpha(p.Gui)=115 && (NumGet(p.Gui.IOH.Canvas.Bits,"UInt")>>24)=255,"default body is 45 percent while the header is opaque")
    glyphs := 0
    for part in IOHParts(p.Gui,p.Layout.W,p.Layout.H) {
        if part.Type="Text" && part.Y>=p.Layout.Head && part.Text!="" && part.Ink!=part.Back
            V7875NativeGlyphs(part,p.Gui.IOH.Canvas),glyphs += 1
    }
    V48Assert(glyphs>=6,"player names, damage and DPS retain opaque lettering")
    IPM.Editing := true,IPMStyle(p)
    V48Assert(!(WinGetExStyle(p.Gui.Hwnd)&0x20),"unlock permits ordinary moving and resizing")
    for count in [8,16] {
        sample := IPMCreateRaidPreview(count),IPM.MaxRows := count
        IPMRender("BossDamage",sample)
        V48Assert(p.VisibleRows=count && InStr(p.Heading.Text,"(Preview)"),"eight and sixteen-player layout previews are clearly labelled")
        V48Assert(IPMRank(sample.Actors,"BossDamage",24).Total < IPMRank(sample.Actors,"Damage",24).Total,"preview separates boss and total damage")
    }
    snap.PreviewFill := IPMCreateRaidPreview(8)
    V48Assert(IPMPreviewPanel("BossDamage",snap)=snap,"loaded fight is not replaced by sample players")
    empty := IPMSnapshot({Data:"",Segment:"",State:"EMPTY",Pending:0})
    IPMRender("BossDamage",empty)
    V48Assert(p.VisibleRows=0 && p.Empty.Text="No data","empty source clears the old leaderboard")
    V48Assert(!IP.Active && !IPM.TimerOn && !IPM.DragHooks,"render tests do not start parsing or install input hooks")
}

V7875BetaCompression()
{
    root := A_ScriptDir "\beta compression é ' $ fixture",path := root "\report.zip",polls := 0
    DirCreate(root)
    try {
        log := root "\chosen.txt",f := FileOpen(log,"w","UTF-8-RAW")
        line := "[21:01:02.003] [@Example#1] [Training Droid] [Ability] [ApplyEffect: Damage] (12345) é Ω`r`n"
        loop 30000
            f.Write(line)
        f.Close(),before := FileRead(log,"RAW")
        IBRZip(path,[{Name:"READ-ME.txt",Text:"Compression test"},{Name:"attached-combat-log.txt",Path:log}],CountPoll)
        V48Assert(FileGetSize(path)<FileGetSize(log)/10,"repetitive log is actually compressed")
        V48Assert(polls>2,"export services the UI throughout preparation and compression")
        V48Assert(IAIBinaryHash(FileRead(log,"RAW"))=IAIBinaryHash(before),"compression preserves source bytes")
        FileCopy(path,A_ScriptDir "\beta-compressed.zip",1)
        FileCopy(log,A_ScriptDir "\beta-compressed-source.txt",1)
        FileDelete(path),FileAppend("preserve destination",path)
        V64Reject((*)=>IBRZip(path,[{Name:"attached-combat-log.txt",Path:log}],CancelWorker),"cancel while compression worker is running")
        V48Assert(FileRead(path)="preserve destination","worker cancellation preserves previous destination")
        count := 0
        loop files path ".iris-partial-*","F"
            count += 1
        V48Assert(count=0,"worker cancellation closes handles and removes partial archives")
        V64Reject((*)=>IBRCompressZip(root "\missing.zip",path),"failed compression does not replace a destination")
        V48Assert(FileRead(path)="preserve destination","worker failure preserves previous destination")
        V64Reject((*)=>IBRZip(path,[{Name:"attached-combat-log.txt",Path:root "\missing.txt"}]),"missing attachment fails safely")
        V48Assert(FileRead(path)="preserve destination","unreadable log preserves previous destination")
    }
    finally DirDelete(root,true)
    CountPoll(*) {
        polls += 1
    }
    CancelWorker(*) {
        loop files path ".iris-partial-*.zip","F"
            throw Error("Cancel compression fixture")
    }
}
V7875BetaVersions()
{
    path := A_ScriptDir "\beta-version-fixture.bin",b := Buffer(16384,0)
    NumPut("Int64",0x3141544542535249,"UInt",1,b),NumPut("UInt",256,b,20)
    try {
        for version in ["78.48","0.78.74","0.78.75-dev.37","78.72-beta.1","invalid","1.2-evil","1.2-dev.xyz"] {
            DllCall("RtlZeroMemory","Ptr",b.Ptr+64,"UPtr",32),StrPut(version,b.Ptr+64,16,"UTF-16")
            f := FileOpen(path,"w"),f.RawWrite(b),f.Close()
            if InStr("|invalid|1.2-evil|1.2-dev.xyz|","|" version "|")
                V64Reject((*)=>IBRRead(path),"malformed beta version remains rejected")
            else
                V48Assert(IBRRead(path).Version=version,"release and development journals remain readable")
        }
    }
    finally FileDelete(path)
}

V7878XFFeed(f,data,seg,ev,serialOffset := 0)
{
    x := ev.Analysis
    if !x.Accepted || !ev.ValueOK || x.At<f.Pull.Start || x.At>f.Pull.End
        return
    ev.RecordId := x.Seq+serialOffset,IXGAnnotate(ev,x.Raw,x.At,x.Seq)
    IXASafeObserve(seg,ev,x.At),IXFSafeObserve(data,seg,ev,x.At)
    seg.Last := Max(seg.Last,x.At)
}
V7878XFFixture(f,serialOffset := 0)
{
    data := IPNewData("isolated XR feedback",5000),seg := IPNewSegment(data,f.Pull.Start,"observed combat entry")
    seg.BossKey := "XR-53",seg.AreaId := "945872057669657",seg.ModeId := "836045448953655"
    for key,p in f.Pull.Players {
        seg.Actors[key] := IPActor(key),seg.DisplayRoles[key] := p.RoleMask
        if p.HasOwnProp("DisciplineId") {
            if !seg.HasOwnProp("DisplayDisciplines")
                seg.DisplayDisciplines := Map()
            seg.DisplayDisciplines[key] := p.DisciplineId
        }
    }
    for ev in f.Data.Rows
        V7878XFFeed(f,data,seg,ev,serialOffset)
    return {Data:data,Segment:seg}
}
V7878XFFeedbackParity()
{
    for variant in ["normal","taunt","no-target","no-cast","boss-turn","single-target","distinct-record-counters"] {
        f := V7875XRFixture()
        if variant="taunt"
            V7875XRFeed(f,2000,V7875XRActor("Other tank"),V7875XRActor("XR"),"Sample").EffectId := "836045448945488"
        else if variant="no-target"
            f.Data.Rows[1].Analysis.Accepted := false
        else if variant="no-cast"
            f.Data.Rows[2].Analysis.Accepted := false
        else if variant="boss-turn"
            f.Data.Rows[8].Analysis.Raw := StrReplace(f.Data.Rows[8].Analysis.Raw,"(0,0,0,0)","(0,0,0,35)")
        else if variant="single-target" {
            for i in [7,8,10]
                f.Data.Rows[i].Analysis.Accepted := false
        }
        live := V7878XFFixture(f,variant="distinct-record-counters" ? 1000 : 0),seg := live.Segment,m := IXFBuild(seg,true),review := IXCBuild(f.Data,f.Pull)
        V48Assert(!seg.XRFeedback.Meta["Error"] && m.Beams.Length=review.Beams.Length,"live beam count: " variant)
        for i,b in m.Beams {
            reference := review.Beams[i]
            for field in ["At","Record","Target","TargetKnown","TargetBasis","Uncertain"]
                V48Assert(b.%field%=reference.%field%,"live/saved " field ": " variant)
            for field in ["Interceptors","Recipients","OlderMarks","FacingMarks","PossibleMarks"]
                V48Assert(XRDiagnosticJSON(b.%field%)=XRDiagnosticJSON(reference.%field%),"live/saved " field ": " variant)
        }
        if variant="normal"
            V48Assert(m.Rows.Length=1 && InStr(m.Rows[1].Text,"Inside") && InStr(m.Rows[1].Text,"Other tank") && !InStr(m.Rows[1].Text,"Outside"),"clear interceptors named together; splash unmarked")
        if variant="no-target"
            V48Assert(m.Rows.Length=1 && m.Rows[1].Text="Extraneous Expulsion (possible desync)" && m.Rows[1].Color="AEB4BE","unclear target stays gray and never names a culprit")
        if variant="single-target"
            V48Assert(!m.Rows.Length,"clean beam produces no alert")
    }
}
V7878XFFeedbackLifecycle()
{
    global IP,IPM
    f := V7875XRFixture(),live := V7878XFFixture(f),seg := live.Segment
    V48Assert(!IXFBuild(seg).Rows.Length && IXFBuild(seg).Pending,"incomplete live batch waits for reorder window")
    tick := V7875XRFeed(f,6200,V7875XRActor("Outside",8,-20),"=")
    V7878XFFeed(f,live.Data,seg,tick),model := IXFBuild(seg)
    V48Assert(model.Rows.Length=1 && !model.Pending,"completed impact appears during the pull")
    tick := V7875XRFeed(f,35000,V7875XRActor("Outside",8,-20),"="),f.Pull.End := 40000
    V7878XFFeed(f,live.Data,seg,tick),model := IXFBuild(seg)
    V48Assert(IXFView(model).Rows.Length=1 && IXFView(model,true).Rows.Length=1,"early finding remains throughout live pull and in end summary")
    V48Assert(InStr(IXFView(model).Note,"This pull") && !InStr(IXFView(model).Note,"30 seconds"),"live label describes the entire pull")
    savedIP := IP,savedIPM := IPM
    try {
        IP := IPNewApp(),IP.Live := live.Data,IP.Active := true,IPM := IPMNewState()
        V48Assert(IsObject(IXFSegment()) && IXFVisible({}),"active XR source selected")
        seg.End := seg.Last,IXFRetire(seg),IXARetire(seg),live.Data.Current := ""
        V48Assert(!seg.HasOwnProp("XRFeedback") && !seg.HasOwnProp("XRAchievements"),"completed pull drops working journals")
        V48Assert(IXFData().Finished && IXFData().Rows.Length=1,"last pull remains after combat closes")
        IP.Active := false
        V48Assert(IXFData().Rows.Length=1,"parser Stop retains completed result")
        next := IPNewSegment(live.Data,40000,"observed combat entry")
        V48Assert(!IsObject(IXFSegment()),"next fight clears old findings even when unsupported")
        next.BossKey := "XR-53",next.AreaId := seg.AreaId,next.ModeId := seg.ModeId
        V48Assert(IXFVisible({}) && !IXFData().Rows.Length,"new XR has its own waiting state, not prior findings")
        IP.Live := ""
        V48Assert(!IXFVisible({}) && IXFVisible({},true),"new session clears; explicit preview remains available")
    }
    finally IP := savedIP,IPM := savedIPM
}
V7878XFFeedbackRollback()
{
    f := V7875XRFixture(false),f.Pull.End := 40000
    V7875XRFeed(f,100,V7875XRActor("XR"),V7875XRActor("Tank",0,-30),"Target")
    V7875XRFeed(f,1000,V7875XRActor("XR"),"=","Activate")
    live := V7878XFFixture(f),seg := live.Segment,seg.LastOutput := 1000
    before := XRDiagnosticJSON(seg.XRFeedback)
    IPBBeginUndo(live.Data,seg)
    ev := V7875XRFeed(f,4000,V7875XRActor("XR"),V7875XRActor("Inside",-3,-20),"Damage")
    V7878XFFeed(f,live.Data,seg,ev)
    V48Assert(seg.XRFeedback.Groups.Count=1,"speculative impact retained reversibly")
    IPBRollbackTail(live.Data,seg)
    V48Assert(XRDiagnosticJSON(seg.XRFeedback)=before,"rollback restores every live feedback map and revision")
    V7878XFFeed(f,live.Data,seg,ev)
    V48Assert(seg.XRFeedback.Groups.Count=1 && IXFBuild(seg,true).Beams.Length=1,"replayed tail does not duplicate beam")
    seg.ModeId := "wrong",count := seg.XRFeedback.Meta["Revision"]
    IXFSafeObserve(live.Data,seg,ev,5000)
    V48Assert(seg.XRFeedback.Meta["Revision"]=count,"unsupported mode is not tracked")
    raw := IPParseLine(f.Data.Rows[1].Analysis.Raw),live.Data.Lines := 37
    live.Data.AreaId := "945872057669657",live.Data.ModeId := "836045448953655"
    IXFOpening(live.Data,raw,-3)
    V48Assert(live.Data.XRFeedbackOpening.Record=37,"pre-combat targets use source record without an accepted-event counter")
}
V7878XFFeedbackDroids()
{
    f := V7875XRFixture(false),f.Pull.End := 40000
    V7875XDFeed(f,1000,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
    V7875XDFeed(f,1001,V7875XDroid(1,0),V7875XRActor("Outside"),"Damage")
    V7875XDFeed(f,2000,"Supplicant {4831533265321984}:88",V7875XRActor("Inside"),"Damage","4858205012230144")
    V7875XDEnzyme(f,3000,"Inside",7)
    V7875XRFeed(f,4000,V7875XRActor("Inside"),"=","Death")
    live := V7878XFFixture(f),m := IXFBuild(live.Segment,true)
    V48Assert(m.Rows.Length=1 && m.Rows[1].Text="Droid explosion","normal assistance contains the explosion but no achievement failure")
    V48Assert(!InStr(XRDiagnosticJSON(m.Rows),"Marinated"),"ordinary wipe stacks do not spam feedback")
    seg := live.Segment,seg.RecorderKey := "@Inside#1",seg.Start := 500
    summary := IXASummary(seg.XRAchievements,f.Pull.End),view := IXOAchievementView(summary,seg,false)
    V48Assert(view.Rows[1].Value="Failed at 0:00.500" && view.Rows[2].Value="Failed at 0:01.500","special achievements retains both failure times relative to pull start")
    V48Assert(view.Rows[1].Failed && view.Rows[2].Failed && view.Rows[3].Value="Max 7 / 20","all three achievement results remain available")
    V48Assert(IXAStatusColor(view.Rows[2])="FF9CA8","special achievement failure stays red")
    seg.Start := 0,review := IXCBuild(f.Data,f.Pull),IXOStore(seg,review,f.Pull)
    V48Assert(XRDiagnosticJSON(seg.XRFeedbackResult.Rows)=XRDiagnosticJSON(m.Rows),"loaded-pull assistance also omits achievement failures")
    view := IXOAchievementView(seg.XRAchievementResult,seg,true)
    V48Assert(view.Rows[2].Value="Failed at 0:02.000" && view.Rows[2].Failed,"loaded-pull special achievement keeps its timestamp and failure")
    f := V7875XRFixture(false)
    V7875XDFeed(f,2000,"Supplicant {4831533265321984}:88",V7875XRActor("Inside"),"Damage","4858205012230144")
    live := V7878XFFixture(f)
    V48Assert(!IXFBuild(live.Segment,true).Rows.Length,"a special-achievement failure alone produces no normal assistance alert")
    f := V7875XRFixture(false),f.Pull.End := 40000
    V7875XDFeed(f,1000,V7875XRActor("Tank"),V7875XRActor("XR"),"Death")
    V7875XDFeed(f,2000,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
    live := V7878XFFixture(f)
    V48Assert(!IXFBuild(live.Segment,true).Rows.Length,"post-kill explosions do not enter overlay")
    f := V7875XRHealthFixture(100,1000),live := V7878XFFixture(f),m := IXFBuild(live.Segment,true)
    V48Assert(m.Rows.Length=1 && m.Rows[1].Text="Droid outcome (possible desync)","unknown droid outcome stays neutral")
    V7881XFLowestDamage()
}
V7878XFFeedbackUI()
{
    global IP,IPM
    savedIP := IP,savedIPM := IPM
    try {
        IP := IPNewApp(),IPM := IPMNewState(),IPM.Editing := true
        V48Assert(IPM.Panels.Has("FightFeedback") && !IPM.Shown["FightFeedback"],"new overlay is optional and default off")
        found := false
        for entry in IIFEntries() {
            if entry.Key="FightFeedback"
                found := true
        }
        V48Assert(found && ArrayContainsText(IPMExtraKinds(),"FightFeedback"),"Displays and sizing include feedback")
        p := IPM.Panels["FightFeedback"],p.Width := 500
        IPM.Enabled := true,IPM.Shown["Damage"] := true,IPMPreviewSet(8)
        IPMEnsureGui("FightFeedback",0,p),IPMRender("FightFeedback",{LayoutPreview:true},p)
        V48Assert(p.VisibleRows=2 && InStr(p.Heading.Text,"(Preview)") && InStr(p.Heading.Text,"Progression Assistance") && p.RenderedMetric="FightFeedback","native XR preview is explicit")
        for i in [1,2] {
            p.Rows[i].Value.GetPos(&x,&y,&w,&h),p.Rows[i].Name.GetPos(&nx,&ny,&nw,&nh)
            V48Assert(nx>=x+w && nx+nw<=p.Layout.W && ny+nh<=p.Layout.H,"time and finding fit without overlap")
        }
        V48Assert(!p.Rows[5].Name.Visible && !p.Rows[5].Value.Visible,"unused rows hidden")
        model := {Rows:[],Start:0,End:100000,Pending:false,Partial:false}
        Loop 9
            model.Rows.Push({At:1000*A_Index,Record:A_Index,Text:"finding",Color:"FFFFFF"})
        view := IXFView(model)
        V48Assert(view.Rows.Length=9 && view.Rows[1].At=1000 && view.Rows[9].At=9000 && !InStr(view.Note,"latest 4"),"all pull findings remain available beyond four rows and thirty seconds")
        V48Assert(model.Rows.Length=9 && model.Rows[1].At=1000,"view cap preserves all findings in the underlying pull")
        V48Assert(XRDiagnosticJSON(view.Rows)=XRDiagnosticJSON(IXFView(model,true).Rows),"live and finished views retain the complete pull")
        empty := {Rows:[],Start:0,End:100000,Pending:false,Partial:false}
        V48Assert(IXFView(empty).Empty="No findings recorded in this pull","live empty message refers to the whole pull")
        empty.Pending := true
        V48Assert(IXFView(empty).Empty="Checking latest beam…","pending impact settling message is unchanged")
        V48Assert(!InStr(XRDiagnosticJSON(IXFData(true)),"desync"),"desync edge cases are not included in preview")
        IOHSyncPanel(p)
        V48Assert(p.Gui.HasOwnProp("IOH"),"opacity renderer includes feedback text")
    }
    finally {
        IPMRetirePanels(IPMAllPanels()),IP := savedIP,IPM := savedIPM
    }
}
V7881XFLowestDamage()
{
    for variant in ["normal","zero","tie","healer-discipline","unknown","discipline-only"] {
        f := V7875XRFixture(false),f.Pull.Start := 100,f.Pull.End := 40000
        for name in ["Healer","Unknown","Late"] {
            player := f.Pull.Players["@Inside#1"].Clone(),player.Name := name,player.Key := "@" name "#1"
            player.RoleMask := name="Healer" ? 4 : name="Unknown" ? 8 : 2,f.Pull.Players[player.Key] := player
        }
        if variant="healer-discipline"
            f.Pull.Players["@Inside#1"].DisciplineId := "2031339142381596"
        if variant="unknown"
            f.Pull.Players["@Inside#1"].RoleMask := 8,f.Pull.Players["@Outside#1"].RoleMask := 8
        if variant="discipline-only"
            f.Pull.Players["@Inside#1"].RoleMask := 8,f.Pull.Players["@Inside#1"].DisciplineId := "2031339142381576"
        V7881XDDamageFeed(f,99,"Inside",1,999999)
        V7881XDDamageFeed(f,200,"Inside",1,1000)
        V7875XRFeed(f,200,V7875XRActor("Outside"),"=")
        if variant!="zero"
            V7881XDDamageFeed(f,300,"Outside",1,variant="tie" ? 1500 : 2000)
        V7881XDDamageFeed(f,300,"Tank",1,1)
        V7881XDDamageFeed(f,300,"Other tank",1,2)
        V7881XDDamageFeed(f,300,"Healer",1,3)
        V7881XDDamageFeed(f,300,"Unknown",1,4)
        V7881XDDamageFeed(f,400,"Inside",2,999999)
        V7881XDDamageFeed(f,500,"Inside",1,999999).Analysis.Accepted := false
        V7881XDDamageFeed(f,501,"Inside",1,999999).ValueOK := false
        V7881XDDamageFeed(f,20000,"Inside",1,500)
        V7875XDFeed(f,20000,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
        V7881XDDamageFeed(f,20000,"Inside",1,999999)
        V7881XDDamageFeed(f,21000,"Late",1,1)
        live := V7878XFFixture(f),seg := live.Segment,model := IXFBuild(seg,true)
        review := IXCBuild(f.Data,f.Pull),expected := "Droid explosion"
        if variant="normal" || variant="discipline-only"
            expected .= "`nLowest DPS: Inside (75.8 DPS)"
        else if variant="zero"
            expected .= "`nLowest DPS: Outside (0.0 DPS)"
        else if variant="tie"
            expected .= "`nLowest DPS: Inside; Outside (75.8 DPS)"
        else if variant="healer-discipline"
            expected .= "`nLowest DPS: Outside (101.0 DPS)"
        V48Assert(!seg.XRFeedback.Meta["Error"] && model.Rows[1].Text=expected,"lowest DPS only, exact instance and explosion boundary: " variant)
        offset := V7878XFFixture(f,1000)
        V48Assert(IXFBuild(offset.Segment,true).Rows[1].Text=expected,"accepted event counter differs from source line number: " variant)
        IXOStore(seg,review,f.Pull)
        V48Assert(XRDiagnosticJSON(seg.XRFeedbackResult.Rows)=XRDiagnosticJSON(model.Rows),"live and saved lowest damage parity: " variant)
        rows := f.Data.Rows.Clone(),f.Data.Rows := []
        Loop rows.Length
            f.Data.Rows.Push(rows[rows.Length+1-A_Index])
        IXOStore(seg,IXCBuild(f.Data,f.Pull),f.Pull)
        V48Assert(XRDiagnosticJSON(seg.XRFeedbackResult.Rows)=XRDiagnosticJSON(model.Rows),"display row order cannot change lowest DPS: " variant)
    }
    for mask in [1,3,4,5,6,7,8,9,12]
        V48Assert(!IXDDamageDPS({RoleMask:mask}),"tank, healer, mixed or unknown role excluded: " mask)
    for id in ["2031339142381604","2031339142381577","2031339142381596","2031339142381600"]
        V48Assert(!IXDDamageDPS({RoleMask:2,DisciplineId:id}),"explicit tank/healer discipline overrides stale DPS label")
    f := V7875XRFixture(false),f.Pull.End := 40000
    V7881XDDamageFeed(f,1000,"Inside",1,100)
    live := V7878XFFixture(f),seg := live.Segment,seg.LastOutput := 1000,before := XRDiagnosticJSON(seg.XRFeedback)
    IPBBeginUndo(live.Data,seg)
    hit := V7881XDDamageFeed(f,19000,"Outside",1,10)
    V7878XFFeed(f,live.Data,seg,hit)
    boom := V7875XDFeed(f,20000,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
    V7878XFFeed(f,live.Data,seg,boom)
    V48Assert(IXFBuild(seg).Rows[1].Text="Droid explosion","live damage ranking waits for accepted reorder window")
    IPBRollbackTail(live.Data,seg)
    V48Assert(XRDiagnosticJSON(seg.XRFeedback)=before,"rollback removes new damage and candidate presence")
    V7878XFFeed(f,live.Data,seg,boom),V7878XFFeed(f,live.Data,seg,hit)
    tick := V7875XRFeed(f,22100,V7875XRActor("Inside"),"=")
    V7878XFFeed(f,live.Data,seg,tick)
    V48Assert(IXFBuild(seg).Rows[1].Text="Droid explosion`nLowest DPS: Outside (0.5 DPS)","late accepted damage counts once after settling")
    IXFRetire(seg)
    V48Assert(!seg.HasOwnProp("XRFeedback") && InStr(seg.XRFeedbackResult.Rows[1].Text,"Outside (0.5 DPS)"),"retirement drops damage journal but retains concise finding")
}

V7878XOSavedSelection()
{
    global IP,IPM
    oldIP := IP,oldIPM := IPM
    try {
        IP := IPNewApp(),IPM := IPMNewState(),IP.View := "Imported"
        f := V7875XRFixture(),offline := V7878XFFixture(f),seg := offline.Segment
        seg.RecorderKey := "@Inside#1",seg.End := seg.Last,IXFRetire(seg),IXARetire(seg)
        IP.Offline := offline.Data,offline.Data.Current := "",IP.Follow := false,IP.Selected := 1
        V48Assert(IXFVisible({}) && IXAVisible({}),"saved XR displays visible with live parsing off")
        V48Assert(IXFData().Rows.Length=1 && InStr(IXFData().Note,"Selected pull"),"real saved beam result in overlay")
        V48Assert(IXAData().Rows[2].Value="No failure recorded","wipe result does not promise achievement pass")
        V48Assert(IXAData().Name="Inside","saved achievement uses the selected pull recorder")
        next := IPNewSegment(offline.Data,10000,"observed combat entry"),IP.Selected := 2
        V48Assert(!IsObject(IXOContext()) && IXAVisible({}) && IFHVisible({}),"unsupported selected pull keeps placeholders without XR results")
        next.BossKey := seg.BossKey,next.AreaId := seg.AreaId,next.ModeId := seg.ModeId,next.End := 20000,next.Last := 20000
        V48Assert(IXFVisible({}) && IXAVisible({}),"native import without journals remains visible")
        V48Assert(!IXFData().Rows.Length && InStr(IXFData().Empty,"Loading"),"new selected pull never borrows findings")
        V48Assert(IXAData().Rows[1].Value="—" && InStr(IXAStatusNote(IXAData()),"Loading"),"loading does not invent achievement progress")
        IP.Selected := 1
        V48Assert(IXFData().Rows.Length=1,"selection back reuses compact result")
        live := V7878XFFixture(V7875XRFixture()),IP.Live := live.Data,IP.Active := true
        V48Assert(IXOContext().Segment=live.Segment && IXOContext().Live,"automatic live parsing wins over saved selection")
        IP.Active := false,IPM.Source := 1
        V48Assert(IXOContext().Segment=live.Segment,"explicit latest-live source respected")
        IPM.Source := 2
        V48Assert(IXOContext().Segment=seg,"explicit parser selection respected")
    }
    finally {
        IP := oldIP,IPM := oldIPM,IXOState().Context := ""
    }
}
V7878XOReviewParity()
{
    f := V7875XRFixture(),f.Pull.End := 40000
    V7875XDFeed(f,1000,V7875XDroid(),"=","Activate")
    V7875XDFeed(f,16097,V7875XDroid(1,0),"=","Death")
    live := V7878XFFixture(f),seg := live.Segment
    expected := IXFBuild(seg,true),review := IXCBuild(f.Data,f.Pull)
    IXOStore(seg,review,f.Pull)
    V48Assert(XRDiagnosticJSON(expected.Rows)=XRDiagnosticJSON(seg.XRFeedbackResult.Rows),"saved conversion matches live findings")
    V48Assert(!InStr(XRDiagnosticJSON(expected.Rows),"inferred") && InStr(review.Advanced,"inferred explosion:"),"live and saved overlay rows keep inference wording in review Advanced details")
    V48Assert(!seg.XRAchievementResult.HasOwnProp("Debug") && !seg.XRAchievementResult.HasOwnProp("Jumps"),"cached result omits replay detail")
    V48Assert(IXOReady(seg),"both overlays share one review")
    s := IXASummary(IXANewState(),0),s.Players[seg.RecorderKey] := {Name:"Recorder",Peak:21,LifePeak:0,DeathAt:100}
    view := IXOAchievementView(s,seg,true)
    V48Assert(view.Rows[3].Value="Max 21 (reset)","saved death keeps historical max stacks")
    seg.End := seg.Last,seg.Terminal := true,seg.FinishAt := seg.Last
    V48Assert(IXOAchievementView(s,seg,true).Rows[1].Value="Passed (observed)","complete recorded kill distinguishes observed pass")
    s.Partial := true
    V48Assert(IXOAchievementView(s,seg,true).Rows[1].Value="Unclear","partial kill cannot claim achievement pass")
    s.Partial := false
    s.Pending := 1
    V48Assert(IXOAchievementView(s,seg,true).Rows[1].Value="Outcome unknown","unfinished droid cannot imply success")
    s.Unknown := 1,s.Pending := 0
    V48Assert(IXOAchievementView(s,seg,true).Rows[1].Value="Possible desync","unknown droid preserves neutral status")
    s.Explosions.Push({At:1,Inferred:true}),s.InferredExplosions := 1
    V48Assert(IXOAchievementView(s,seg,true).Rows[1].Value="Failed at 0:00.001","saved failure includes its first timestamp without technical labels")
    V48Assert(IXOAchievementView(s,seg,false).Rows[1].Value="Failed at 0:00.001","live achievement uses the same failure timestamp")
}
V7878XOReviewGuards()
{
    global IP,IPM
    oldIP := IP,oldIPM := IPM,s := IXOState()
    try {
        IP := IPNewApp(),IPM := IPMNewState(),IP.View := "Imported"
        f := V7878XFFixture(V7875XRFixture()),IP.Offline := f.Data,seg := f.Segment,seg.End := seg.Last
        ctx := IXOContext(),control := {Cancel:false}
        IXOProgress(ctx,control,{})
        IP.Active := true
        failed := false
        try IXOProgress(ctx,control,{})
        catch
            failed := true
        V48Assert(failed && IP.Active,"starting live cancels review without stopping parser")
        IP.Active := false,IP.Selected := 2,IP.Follow := false
        next := IPNewSegment(f.Data,10000,"observed combat entry")
        failed := false
        try IXOProgress(ctx,control,{})
        catch
            failed := true
        V48Assert(failed,"selection change cancels stale result")
        s.Context := ctx,s.Queued := true
        IXOLoad()
        V48Assert(!s.Busy && !s.Queued && !seg.HasOwnProp("XRFeedbackResult"),"stale queued work cannot publish")
        IP.Selected := 1,ctx := IXOContext(),s.Context := ctx
        IXOLoad()
        V48Assert(seg.HasOwnProp("XROverlayError"),"missing original is an explicit unavailable state")
    }
    finally {
        s.Context := "",s.Control := "",s.Busy := false,s.Queued := false,IP := oldIP,IPM := oldIPM
    }
}

V7878FHSegment(boss,start := 90000)
{
    data := IPNewData("Private assistance test"),data.AreaId := "833571547775765",data.ModeId := "836045448953655"
    seg := IPNewSegment(data,start,"observed combat entry"),seg.BossKey := boss,seg.BossName := boss
    return {Data:data,Segment:seg}
}
V7878FHFeed(f,line,record)
{
    ev := IPParseLine(line),ev.RecordId := record
    IPXLethalLife(f.Segment,ev,ev.RawMs)
    IFHSafeObserve(f.Segment,ev,ev.RawMs),f.Segment.Last := Max(f.Segment.Last,ev.RawMs)
    return ev
}
V7878FHTyth()
{
    f := V7878FHSegment("G-TY"),seg := f.Segment,boss := "Tyth {4078423634870272}:123|(0,0,0,0)|(1000/1000)"
    for i,n in [3,4,3,6] {
        V7878FHFeed(f,V671FloorLine(100000+i*100,boss,"=","4086833180835840","836045448953666","4086833180836195"," (" n " charges {836045448953667})"),i)
        model := IFHModel(seg),view := IFHView(seg,model,true,seg.Last)
        V48Assert(model.Rage=n,"Tyth actual charge count " i)
        if i>1
            V48Assert(InStr(view.Rows[1].Text,i=2 ? "+1" : i=3 ? "-1" : "+3"),"Tyth signed delta " i)
        else
            V48Assert(!InStr(view.Rows[1].Text,"(+"),"joining mid-pull does not invent a gain")
    }
    V48Assert(!InStr(IFHView(seg,model,true,seg.Last+4001).Rows[1].Text,"(+"),"delta expires while stack count persists")
    seg.LastOutput := seg.Last,before := XRDiagnosticJSON(IFHModel(seg)),IPBBeginUndo(f.Data,seg)
    V7878FHFeed(f,V671FloorLine(101000,boss,"=","4086833180835840","836045448953666","4086833180836195"," (9 charges {836045448953667})"),5)
    V48Assert(IFHModel(seg).Rage=9,"provisional rage visible")
    IPBRollbackTail(f.Data,seg)
    V48Assert(XRDiagnosticJSON(IFHModel(seg))=before,"rolled-back rage and peak rebuilt from accepted records")
    V7878FHFeed(f,V671FloorLine(100250,boss,"=","4086833180835840","836045448953666","4086833180836195"," (5 charges {836045448953667})"),6)
    V48Assert(IFHModel(seg).Rage=6 && IFHModel(seg).Peak=6,"late accepted charge cannot replace latest state")
    IFHRetire(seg),V48Assert(!seg.HasOwnProp("Assistance") && IFHView(seg,IFHModel(seg),false,seg.Last).Rows[1].Text="6 stacks reached","retired pull retains compact peak summary")
    V48Assert(!IsObject(IFHModel(V7878FHSegment("G-TY").Segment)),"new pull starts without previous stacks")
    seg.ModeId := "836045448953652",V48Assert(!IFHSupported(seg),"scope does not guess Master mechanics in Veteran")
}
V7878FHSisters()
{
    f := V7878FHSegment("G-AE"),seg := f.Segment,healer := "@Healer#123|(0,0,0,0)|(1000/1000)",dps := "@Damage#456|(0,0,0,0)|(1000/1000)"
    seg.DisplayRoles[IPActor(healer).Key] := 4,seg.DisplayRoles[IPActor(dps).Key] := 2
    for i,actor in [healer,dps]
        V7878FHFeed(f,V671FloorLine(100000+i,actor,"=","4114162057740288","836045448953666","4114162057740686"," (51 charges {836045448953667})"),i)
    boss := "Aivela {4088525397950464}:1|(0,0,0,0)|(1000/1000)"
    V7878FHFeed(f,V671FloorLine(100010,boss,dps,"4109583622602752","836045448953666","4109583622603019"," (6 charges {836045448953667})"),3)
    model := IFHModel(seg),view := IFHView(seg,model,true,100010)
    V48Assert(view.Rows.Length=2 && InStr(view.Rows[1].Text,"Healer") && view.Rows[1].Color="FF9CA8","only healer Countermeasure stacks shown, with high warning")
    V48Assert(view.Rows[2].Label="Peak rad" && InStr(view.Rows[2].Text,"Damage: 6"),"high Radiance names any role")
    V7878FHFeed(f,V671FloorLine(100020,"",dps,"4109583622602752","836045448945478","4109583622603019"),4)
    V48Assert(IFHView(seg,IFHModel(seg),true,100020).Rows.Length=2,"Radiance peak persists after removal")
    V7878FHFeed(f,V671FloorLine(100030,boss,healer,"1","836045448945472","836045448945493"),5)
    V48Assert(InStr(IFHView(seg,IFHModel(seg),true,100030).Rows[1].Text,"dead"),"healer death clears current stack display")
    V7878FHFeed(f,V671FloorLine(100040,dps,healer,"1","836045448945472","836045448945494"),6)
    V48Assert(InStr(IFHView(seg,IFHModel(seg),true,100040).Rows[1].Text,"Healer: 0"),"recorded resurrection clears dead label before the next stack change")
    view := IFHView(seg,IFHModel(seg),false,100030)
    V48Assert(view.Rows.Length=2 && InStr(view.Rows[1].Text,"51") && InStr(view.Rows[2].Text,"6"),"end summary keeps peaks through death and effect removal")
}
V7878FHScyva() => V7816Fixture(V7878FHScyvaCase)
V7878FHScyvaCase()
{
    global Audio,SOP
    f := V7878FHSegment("G-SC"),before := XRDiagnosticJSON(SOP)
    V7878FHFeed(f,V7816Line(98000,"start"),1),V7878FHFeed(f,V7816Line(100000),2)
    model := IFHModel(f.Segment)
    view := IFHView(f.Segment,model,true,105870)
    V48Assert(view.Rows[1].Text="Don't kill" && view.Rows[1].Color="AEB4BE","OPD hold is gray")
    view := IFHView(f.Segment,model,true,109870)
    V48Assert(view.Rows[1].Text="Kill" && view.Rows[1].Color="FF6E78" && InStr(view.Rows[2].Text,"8.0s"),"OPD kill is red at predicted beam minus eight")
    V48Assert(InStr(IFHView(f.Segment,model,true,117871).Rows[1].Text,"Waiting"),"expired prediction never loops on its own")
    V7878FHFeed(f,V7816Line(107605),3),V7878FHFeed(f,V7816Line(115210),4)
    V48Assert(IFHModel(f.Segment).BeamAt=133080,"second fresh marker resynchronizes")
    view := IFHView(f.Segment,IFHModel(f.Segment),true,115210)
    V48Assert(view.Rows[1].Text="Kill" && InStr(view.Rows[2].Text,"2.7s"),"future schedule cannot replace the current kill window early")
    V48Assert(IFHView(f.Segment,IFHModel(f.Segment),true,121080).Rows[1].Text="Don't kill","new hold begins on its actual deadline")
    V7878FHFeed(f,V7816Line(115300,"death"),5)
    V48Assert(IFHView(f.Segment,IFHModel(f.Segment),true,115300).Rows[1].Text="Phase finished","OPD death retires kill instruction")
    V48Assert(!Audio.Queue.Length && XRDiagnosticJSON(SOP)=before,"display model cannot play audio or mutate the audio engine")
    V48Assert(!InStr(IFHView(f.Segment,IFHModel(f.Segment),false,115300).Rows[1].Text,"Kill"),"saved pull is a summary, not a stale kill command")
}
V7878FHIzax() => V7821Fixture(V7878FHIzaxCase)
V7878FHIzaxCase()
{
    global IZP,Audio
    f := V7878FHSegment("G-IZ"),boss := V7820Boss(750),before := XRDiagnosticJSON(IZP)
    records := [V671FloorLine(100000,boss,"=","4163120389947392","836045448945472","836045448945479"),
        V671FloorLine(100100,boss,"=","4162922821451776","836045448945477","4162922821451776"),
        V671FloorLine(100999,boss,"=","4169996632588288","836045448945477","4169996632588556"),
        V671FloorLine(101000,boss,"=","4162922821451776","836045448945478","4162922821451776")]
    for i,line in records
        V7878FHFeed(f,line,i)
    V48Assert(IFHView(f.Segment,IFHModel(f.Segment),true,101000).Rows[1].Text="Sophie","assigned first interrupter shown")
    V7878FHFeed(f,V671FloorLine(101100,boss,"=","4162849807007744","836045448945472","836045448945479"),5)
    line := V671FloorLine(101200,"@First Toon#111|(0,0,0,0)|(1000/1000)","","4162849807007744","836045448945472","836045448945482")
    V7878FHFeed(f,line,6),V7878FHFeed(f,line,7)
    model := IFHModel(f.Segment),view := IFHView(f.Segment,model,true,101200)
    V48Assert(view.Rows[1].Text="Second" && model.Interrupts=1,"successful interrupt advances once despite duplicate records")
    V48Assert(!Audio.Queue.Length && XRDiagnosticJSON(IZP)=before,"independent model leaves live audio order untouched")
    ev := IPParseLine(V671FloorLine(101300,boss,"=","4162832627138560","836045448953666","4162832627138560"," (0 charges {836045448953667})"))
    V48Assert(ev.IZPZero,"parser preserves cannon reset zero-charge evidence for assistance")
}
V7878FHNahut() => V673OrderFixture(V7878FHNahutCase)
V7878FHNahutCase()
{
    global NBOrder,NBCandle,NBRebounder,Audio,autoBossCalloutsEnabled,NBOrderOptions
    V48Setup(),autoBossCalloutsEnabled := false,NBOrderOptions.Enabled := false
    V48Pass("Tank1",100000),V48Use("Tank1",100500)
    f := V7878FHSegment("G-NA"),seg := f.Segment,seg.Last := NBCandle.At
    actor := IPActor(NBCandle.Boss.Token),seg.Actors[actor.Key] := actor
    before := XRDiagnosticJSON(NBOrder),audioBefore := XRDiagnosticJSON(Audio.Queue)
    view := IFHNahut(seg,true,100500)
    V48Assert(view.Rows.Length>=1 && InStr(view.Rows[1].Text,"Tank2"),"next candle player shown with speech and controller audio muted")
    V48Assert(XRDiagnosticJSON(NBOrder)=before && XRDiagnosticJSON(Audio.Queue)=audioBefore,"rendering never consumes order/recovery or changes the queue")
    NBRebounder := NewNBRebounderState(),NBRebounder.Owner := NBOrder.Owner,NBRebounder.Config := NBOrderConfigKey(),NBRebounder.Phase := 3
    NBRebounderOffer("Mit","",2,100500,false,"private test")
    V48Assert(IFHRebounder(100500)="Use mitigation","mitigation slot retains planned instruction")
    NBRebounder.Pending.Phase := 1
    V48Assert(IFHRebounder(100500)="Waiting for the next assignment","old phase assignment never survives into next phase")
    seg.Start := 200000
    V48Assert(!IFHNahut(seg,true,200000).Rows.Length,"prior pull global candle state is not displayed for a new pull")
    V48Assert(IFHNahut(seg,false,200000).Finished,"loaded Nahut log cannot show live team's current orders")
}
V7878FHSource()
{
    global IP,IPM
    oldIP := IP,oldIPM := IPM
    try {
        f := V7878FHSegment("G-NA"),IP := IPNewApp(),IPM := IPMNewState(),IP.Live := f.Data,IP.Active := true
        V48Assert(IFHVisible({}) && IFHContext().Live,"supported live pull appears")
        for boss in ["G-TY","G-AE","G-NA","G-SC"] {
            f.Segment.BossKey := boss
            V48Assert(IFHReleased(f.Segment) && IFHContext().Live,"released Gods assistance appears for " boss)
        }
        for item in [{Boss:"G-IZ",Area:"833571547775765"},{Boss:"DF-BR",Area:"137438993402"},{Boss:"TFB-TF",Area:"137438992720"}] {
            f.Segment.BossKey := item.Boss,f.Segment.AreaId := item.Area
            V48Assert(!IFHReleased(f.Segment) && !IsObject(IFHContext()),"unreleased encounter stays hidden: " item.Boss)
        }
        f.Segment.BossKey := "XR-53",f.Segment.AreaId := "945872057669657"
        V48Assert(IFHReleased(f.Segment) && IFHContext().Live,"existing XR-53 assistance remains released")
        f.Segment.AreaId := "833571547775765"
        for boss in ["G-TY","G-AE"] {
            f.Segment.BossKey := boss,f.Segment.ModeId := "836045448953652"
            V48Assert(!IFHReleased(f.Segment) && !IsObject(IFHContext()),"new assistance is not exposed in Veteran: " boss)
            f.Segment.ModeId := "836045448953655",f.Segment.AreaId := "other"
            V48Assert(!IFHReleased(f.Segment) && !IsObject(IFHContext()),"new assistance requires the recorded Gods area: " boss)
            f.Segment.AreaId := "833571547775765"
        }
        f.Segment.BossKey := "G-SC"
        V48Assert(IFHReleased(f.Segment) && IFHContext().Live,"Scyva live assistance is released")
        f.Segment.End := f.Segment.Last,IP.Active := false
        V48Assert(IFHVisible({}) && !IFHContext().Live,"completed source retains display")
        f.Segment.BossKey := "Other"
        V48Assert(IFHVisible({}) && !IsObject(IFHContext()),"unsupported fight keeps a placeholder without supported findings")
        preview := IFHData(true)
        V48Assert(preview.Rows.Length=2 && preview.Note="XR-53 Master (sample findings)" && InStr(preview.Rows[1].Text,"Interception:") && InStr(preview.Rows[2].Text,"Droid explosion`nLowest DPS:"),"preview uses XR interception and droid examples")
    }
    finally IP := oldIP,IPM := oldIPM
}

V7878BRBoss() => "Brontes {3303529930293248}:1|(0,-787,16,0)|(10000/20000)"
V7878BRDroid() => "D-09 {3300910000242688}:1|(-28,-771,16,0)|(1000/2000)"
V7878BRFixture()
{
    s := IPNewData(),p := V7717Player(1)
    IPFeedLine(s,"[00:00:00.100] [" p "] [] [] [AreaEntered {836045448953664}: DF {137438993402} Master {836045448953655}]")
    V7717Feed(s,1000,"Enter",0,p,"=")
    Loop 8
        V7717Feed(s,1000+A_Index,"Damage",100,V7717Player(A_Index),V7878BRBoss())
    V7717Feed(s,1100,"Damage",100,p,V7878BRDroid())
    return s
}
V7878BRWipe() => V75LibraryRun(V7878BRWipeCase)
V7878BRWipeCase()
{
    global Audio
    s := V7878BRFixture(),seg := s.Current,queue := Audio.Queue
    Loop 7
        V7717Feed(s,2000+A_Index,"Death",0,V7878BRDroid(),V7717Player(A_Index,0))
    V7717Other(s,2010,V7717Player(1,0),"=","123")
    V48Assert(s.Current=seg,"seven deaths do not close Brontes")
    V7717Feed(s,2011,"Death",0,V7878BRDroid(),V7717Player(8,0))
    V7717Other(s,2012,V7717Player(8,0),"=","123")
    V48Assert(!IsObject(s.Current) && s.InCombat=0 && seg.WipeEnded && !seg.Terminal && !seg.Partial && seg.End=2011,"failed check closes at eighth accepted death without Exit")
    V48Assert(IPRCompact(seg).TotalDeaths=8 && ILBFight(seg).Result="No kill","all death recaps survive; never a kill")
    V7717Feed(s,2200,"Heal",300,V7717Player(1),V7717Player(2))
    V7717Feed(s,2300,"Damage",30,V7717Player(1,0),V7878BRDroid())
    V48Assert(!IsObject(s.Current) && seg.End=2011 && seg.Totals[IPActor(V7717Player(1)).Key].Damage=200,"recovery and late corpse missile do not restart or inflate the result")
    app := IPNewApp(),app.Live := s,app.Active := true,snap := IPMSnapshot(IPMResolve(app,1))
    V48Assert(snap.Closed && snap.State="WIPED" && snap.Duration=1.011,"live meter freezes on completed wipe")
    V7717Feed(s,10000,"Enter",0,V7717Player(1),"=")
    V7717Feed(s,10001,"Damage",100,V7717Player(1),StrReplace(V7878BRBoss(),":1|",":2|"))
    V48Assert(s.Segments.Length=2 && s.Current.Start=10000 && !s.Current.Partial,"next pull has fresh independent totals")
    V48Assert(Audio.Queue=queue,"boundary does not queue audio")
}
V7878BRGuards() => V75LibraryRun(V7878BRGuardsCase)
V7878BRGuardsCase()
{
    for guard in ["wrong area","wrong mode","revived","reordered","no recorder","terminal","reentry","recorder alive"] {
        s := V7878BRFixture(),seg := s.Current
        Loop 8
            V7717Feed(s,2000+A_Index,"Death",0,V7878BRDroid(),V7717Player(A_Index,0))
        at := 2010
        if guard="wrong area"
            s.AreaId := "other"
        if guard="wrong mode"
            s.ModeId := "836045448953652"
        if guard="revived"
            seg.LifeDead.Delete(IPActor(V7717Player(8)).Key)
        if guard="reordered"
            at := 2005
        if guard="terminal"
            seg.Terminal := true
        if guard="reentry"
            s.Reentry := {At:at,Events:[]}
        if guard="recorder alive"
            s.DiedSinceEntry := false
        if guard="no recorder"
            s.Owner := "@absent"
        V48Assert(!IPRosterWipeIntercept(s,"",at) && s.Current=seg,"no false Brontes wipe: " guard)
    }
    s := V7878BRFixture(),seg := s.Current
    V7717Feed(s,2000,"Death",0,V7717Player(1),V7878BRDroid())
    V7717Other(s,2100,V7717Player(1),"=","123")
    V48Assert(s.Current=seg,"successful droid kill cannot end pull")
    V7717Feed(s,3000,"Death",0,V7878BRBoss(),V7717Player(1,0))
    V7717Other(s,3100,V7717Player(1),"=","836045448945494")
    V7717Feed(s,3200,"Damage",100,V7717Player(1),V7878BRBoss())
    V48Assert(s.Current=seg,"individual death and battle resurrection keep the encounter")
}

V7878BRBurn() => V75LibraryRun(V7878BRBurnCase)
V7878BRBurnCase()
{
    ; A tank dies and is battle-rezzed, then the raid wipes to mixed burn enemies.
    s := V7878BRFixture(),seg := s.Current
    V7717Feed(s,2000,"Death",0,V7878BRBoss(),V7717Player(8,0))
    V7717Other(s,2100,V7717Player(8),"=","836045448945494")
    Loop 7
        V7717Feed(s,3000+A_Index,"Death",0,V7878BRBoss(),V7717Player(A_Index,0))
    V7717Other(s,3010,V7717Player(1,0),"=","123")
    V48Assert(s.Current=seg && seg.LifeDead.Count=7,"rezzed tank still alive, eight total deaths do not end pull")
    sphere := "Energy Sphere {3303718908854272}:9|(0,0,0,0)|(1000/1000)"
    V7717Feed(s,4000,"Death",0,sphere,V7717Player(8,0))
    V7717Other(s,4001,V7717Player(1,0),"=","123")
    V48Assert(!IsObject(s.Current) && s.InCombat=0 && seg.End=4000 && seg.WipeEnded,"mixed-source burn wipe ends on last actual death")
    V48Assert(IPRCompact(seg).TotalDeaths=9 && !seg.Terminal && !seg.Partial,"all nine deaths retained, no inferred kill")
    V7717Other(s,5000,V7717Player(1),"=","836045448945494")
    V7717Feed(s,5001,"Heal",100,V7717Player(1),V7717Player(2))
    V48Assert(!IsObject(s.Current) && seg.End=4000,"entrance recovery cannot extend burn result")
    s := V7878BRFixture(),seg := s.Current
    Loop 8
        V7717Feed(s,6000+A_Index,"Death",0,V7878BRBoss(),V7717Player(A_Index,0))
    V7717Other(s,10000,V7717Player(1,0),"=","123")
    V48Assert(!IsObject(s.Current) && seg.End=6008,"sparse next record does not lose complete wipe evidence")
    s := V7878BRFixture(),seg := s.Current
    Loop 8
        V7717Feed(s,7000+A_Index,"Death",0,V7878BRBoss(),V7717Player(A_Index,0))
    V7717Feed(s,7009,"Damage",100,V7717Player(1,0),V7878BRBoss())
    V7717Feed(s,7010,"Death",0,V7717Player(1,0),StrReplace(V7878BRBoss(),"(10000/20000)","(0/20000)"))
    V7717Other(s,7011,V7717Player(1,0),"=","123")
    V48Assert(seg.Terminal && !seg.HasOwnProp("WipeEnded"),"simultaneous boss kill is not swallowed by wipe check")
}

V240Kephess(hp := 2000) => "Warlord Kephess {2876528576692224}:1|(0,0,0,0)|(" hp "/4000)"

V240KephessPull()
{
    s := IPNewData(), p := V7717Player(1)
    IPFeedLine(s,"[00:00:00.100] [" p "] [] [] [AreaEntered {836045448953664}: Denova {833571547775688} Master {836045448953655}]")
    V7717Feed(s,1000,"Enter",0,p,"=")
    Loop 8
        V7717Feed(s,1000+A_Index,"Damage",100,V7717Player(A_Index),V240Kephess())
    return s
}

V240KephessBoundaries() => V75LibraryRun(V240KephessBoundariesCase)

V240KephessBoundariesCase()
{
    s := V240KephessPull(), seg := s.Current, player := V7717Player(1)
    V7717Feed(s,3000,"Exit",0,player,"=")
    V48Assert(!seg.Terminal && s.Current=seg,"recorder exit keeps the pending Kephess result recoverable")
    V7717Feed(s,3019,"Damage",100,V7717Player(2),V240Kephess(0))
    V7717Feed(s,3019,"Death",0,V7717Player(2),V240Kephess(0))
    V7717Other(s,6510,player,"=","836045448953669")
    V48Assert(!IsObject(s.Current) && seg.Terminal && seg.End=3019 && seg.RequiredDeathAt=3019,
        "Kephess kill closes on the original endpoint after the normal settling window")

    s := V240KephessPull(), seg := s.Current
    Loop 8
        V7717Feed(s,4000+A_Index,"Death",0,V240Kephess(),V7717Player(A_Index,0))
    V7717Other(s,4100,V7717Player(1,0),"=","836045448953669")
    V48Assert(s.Current=seg && !seg.Terminal,"cleanup alone leaves time for a simultaneous boss death")
    V7717Other(s,5200,player,"=","836045448945494")
    V48Assert(!IsObject(s.Current) && s.InCombat=0 && seg.WipeEnded && !seg.Terminal && seg.End=4008,
        "the full raid's deaths and first respawn close the wipe without a combat exit")
    V48Assert(IPRCompact(seg).TotalDeaths=8 && ILBFight(seg).Result="No kill","the wipe retains all eight deaths")

    s := V240KephessPull(), seg := s.Current
    Loop 7
        V7717Feed(s,6000+A_Index,"Death",0,V240Kephess(),V7717Player(A_Index,0))
    V7717Other(s,6200,player,"=","836045448945494")
    V48Assert(s.Current=seg && !seg.Terminal,"a combat resurrection with a survivor preserves the pull")
}

V7878ClosePreferences() => V58Isolated(V7878ClosePreferencesCase)
V7878ClosePreferencesCase()
{
    global IP,SETTINGS_FILE,SELF_TEST,Persist
    oldPersist := Persist,oldTest := SELF_TEST
    try {
        Persist := {Last:Map(),Pending:Map(),Serial:0,Busy:false,Error:"",Status:""}
        IniWrite("keep",SETTINGS_FILE,"Unrelated","Value")
        IPWLoadPrefs(),u := IPWState()
        V48Assert(u.ExitOnClose,"main close exits by default")
        IPWBuild()
        V48Assert(V7878CloseChecked(u.SettingsMenu),"default is checked in shared settings menu")
        V48Assert(!(V7829HelpItem(u.FileMenu,"Restart Iris`tCtrl+R").State & 3),"File menu exposes Restart Iris with its window accelerator")
        V48Assert(!ICRestart() && IsObject(IP.Gui),"diagnostics cannot accidentally restart the app")
        ; Only the save path temporarily leaves diagnostic mode; its file is private.
        V48Assert(InStr(SETTINGS_FILE,A_Temp "\")=1,"preference test uses a temporary INI")
        for enabled in [false,true,false] {
            SELF_TEST := false
            try IPWToggleExitOnClose()
            finally SELF_TEST := oldTest
            SetTimer(FlushSettings,0)
            V48Assert(FlushSettings(),"close preference flush succeeds")
            V48Assert(u.ExitOnClose=enabled && V7878CloseChecked(u.SettingsMenu)=enabled,"menu check follows choice")
            u.ExitOnClose := !enabled,IPWLoadPrefs()
            V48Assert(u.ExitOnClose=enabled,"close choice survives settings reload")
            V48Assert(IniRead(SETTINGS_FILE,"Unrelated","Value")="keep","unrelated settings retained")
        }
        V48Assert(!IP.Active,"setting does not start or restart parser")
    }
    finally {
        SELF_TEST := oldTest,SetTimer(FlushSettings,0),Persist := oldPersist
    }
}

V7878CloseChecked(menu)
{
    Loop DllCall("GetMenuItemCount","Ptr",menu.Handle,"Int") {
        text := Buffer(256*2,0)
        DllCall("GetMenuStringW","Ptr",menu.Handle,"UInt",A_Index-1,"Ptr",text,"Int",256,"UInt",0x400)
        if StrGet(text)="Close button exits Iris"
            return !!(DllCall("GetMenuState","Ptr",menu.Handle,"UInt",A_Index-1,"UInt",0x400,"UInt")&8)
    }
    throw Error("Close preference menu item missing")
}

V7878CloseHides() => V58Isolated(V7878CloseHidesCase)
V7878CloseHidesCase()
{
    global IP
    V58UseFixture(),live := IP.Live,IP.Active := true,IP.Visible := true
    IPWState().ExitOnClose := false
    IPClose()
    V48Assert(!IP.Visible && IP.Active && IP.Live=live,"opt-out hides without stopping parsing or changing data")
    IPWState().ExitOnClose := true,IP.Visible := true
    IPHide()
    V48Assert(!IP.Visible && IP.Active && IP.Live=live,"explicit Hide remains available with exit enabled")
}

V7880LiveRun(fn) => V75LibraryRun(V7880LiveRunBody.Bind(fn))
V7880LiveRunBody(fn)
{
    r := ILBLiveStore(),saved := r.Clone(),s := ILBState(),f := V68ReviewFile()
    SplitPath(s.TestPath,,&folder)
    path := folder "\combat_2026-10-22_01_00_00_001.txt"
    try {
        r.Path := "",r.Lock := 0,r.Recovered := false,r.Stopping := false,r.Retry := 0,r.TestHistory := folder "\history.json"
        s.LivePending := Map(),s.AutoError := "",s.Flushing := false,s.AutoLoaded := true,s.AutoLive := true
        FileMove(f.Path,path),seg := f.State.Segments[f.State.Segments.Length]
        seg.LibrarySourceKey := path "|" ILBLiveIdentity(path)
        ILBLiveQueue(seg),ILBLoad()
        fn.Call(seg,StrLower(path))
    }
    finally {
        SetTimer(ILBLiveFlush,0),ILBLiveJournalClose()
        for key,value in saved.OwnProps()
            r.%key% := value
        if FileExist(f.Path)
            FileDelete(f.Path)
    }
}

V7880LiveRetry() => V7880LiveRun(V7880LiveRetryCase)
V7880LiveRetryCase(seg,key)
{
    s := ILBState(),history := ILBLiveHistoryPath(),lock := IHAcquireLock(s.TestPath)
    try V48Assert(ILBLiveFlushPending(history)=1 && s.LivePending.Count=1 && !FileExist(history),"locked library retains pull without writing Progression")
    finally DllCall("CloseHandle","Ptr",lock)
    lock := IHAcquireLock(history)
    try V48Assert(ILBLiveFlushPending(history)=1 && s.LivePending.Count=1 && s.Files.Has(key),"partial save retains retry after Library succeeded and Progression failed")
    finally DllCall("CloseHandle","Ptr",lock)
    V48Assert(ILBLiveFlushPending(history)=0 && !s.LivePending.Count && s.AutoError="","transient fault recovers without another pull")
    V48Assert(s.Files[key].Pulls.Length=1 && IGVReadHistory(history).Count=1,"both stores contain exactly one recovered pull")
    ILBLiveQueue(seg),ILBLiveFlushPending(history)
    V48Assert(s.Files[key].Pulls.Length=1 && IGVReadHistory(history).Count=1,"replaying a successfully saved batch is idempotent")
}

V7880LiveConcurrent() => V7880LiveRun(V7880LiveConcurrentCase)
V7880LiveConcurrentCase(seg,key)
{
    s := ILBState(),state := {Ran:false,Seg:seg},history := ILBLiveHistoryPath()
    ILBLiveFlushPending(history,V7880LiveDuringSave.Bind(state))
    V48Assert(state.Ran && s.LivePending[key].Pulls.Count=2,"newer same-token update and another completed pull survive acknowledgement")
    ILBLiveFlushPending(history)
    V48Assert(!s.LivePending.Count && s.Files[key].Pulls.Length=2 && IGVReadHistory(history).Count=2,"subsequent save persists queued updates without duplicates")
    V48Assert(s.Files[key].Pulls[1].End=seg.End+10,"newer accepted endpoint replaces the older snapshot")
}
V7880LiveDuringSave(state,*)
{
    if state.Ran
        return
    state.Ran := true
    newer := IPRCloneSnapshot(state.Seg),newer.End += 10,newer.Last += 10
    ILBLiveQueue(newer)
    another := IPRCloneSnapshot(state.Seg),another.Start += 120000,another.End += 120000,another.Last += 120000
    ILBLiveQueue(another)
}

V7880LiveRecovery() => V7880LiveRun(V7880LiveRecoveryCase)
V7880LiveRecoveryCase(seg,key)
{
    s := ILBState(),r := ILBLiveStore(),ILBLiveJournalSave(),oldPath := r.Path
    V48Assert(FileExist(oldPath) && ILBLiveJournalRead(oldPath)[key].Pulls.Count=1,"checksum-protected journal contains pending pull and progression summary")
    owner := r.Lock,r.Lock := 0,r.Path := "",s.LivePending := Map()
    try V48Assert(!ILBLiveRecoverPending() && !s.LivePending.Count,"a running journal owner is never stolen")
    finally DllCall("CloseHandle","Ptr",owner)
    V48Assert(ILBLiveRecoverPending()=1 && s.LivePending.Count=1,"next owner recovers abandoned completed pull")
    V48Assert(!FileExist(oldPath) && FileExist(r.Path),"old journal retires only after replacement journal is durable")
    ILBLiveFlushPending(r.TestHistory),ILBLiveJournalSave()
    V48Assert(!FileExist(r.Path) && s.Files[key].Pulls.Length=1 && IGVReadHistory(r.TestHistory).Count=1,"successful recovery saves both catalogues then removes recovery payload")
}

V7880LiveCorruptRecovery() => V7880LiveRun(V7880LiveCorruptRecoveryCase)
V7880LiveCorruptRecoveryCase(seg,key)
{
    s := ILBState(),r := ILBLiveStore(),ILBLiveJournalSave(),path := r.Path
    ILBLiveJournalClose(),s.LivePending := Map()
    f := FileOpen(path,"rw")
    try f.Pos := 70,f.WriteUChar(255)
    finally f.Close()
    V48Assert(!ILBLiveRecoverPending() && !s.LivePending.Count && FileExist(path),"corrupt journal is retained and never committed")
    V48Assert(InStr(s.AutoError,"integrity"),"recovery corruption produces an actionable error")
}

V7880LiveExit() => V7880LiveRun(V7880LiveExitCase)
V7880LiveExitCase(seg,key)
{
    s := ILBState(),r := ILBLiveStore(),s.Flushing := true
    ILBLivePreserveExit(),path := r.Path
    V48Assert(r.Stopping && FileExist(path) && !FileExist(s.TestPath) && !FileExist(r.TestHistory),"immediate exit preserves pending data without opening or rebuilding either catalogue")
    s.Flushing := false,ILBLiveJournalClose(),s.LivePending := Map(),r.Stopping := false
    ILBLiveRecoverPending(),ILBLiveFlushPending(r.TestHistory),ILBLiveJournalSave()
    V48Assert(!s.LivePending.Count && s.Files[key].Pulls.Length=1 && IGVReadHistory(r.TestHistory).Count=1,"restart after immediate exit completes both saves")
}

V7880LiveJournalRetry() => V7880LiveRun(V7880LiveJournalRetryCase)
V7880LiveJournalRetryCase(seg,key)
{
    s := ILBState(),r := ILBLiveStore(),ILBLiveJournalSave(),original := IPCHashFile(r.Path)
    another := IPRCloneSnapshot(seg),another.Start += 120000,another.End += 120000,another.Last += 120000
    ILBLiveQueue(another)
    held := DllCall("CreateFileW","Str",r.Path ".pending","UInt",0xC0000000,"UInt",0,"Ptr",0,"UInt",4,"UInt",0x80,"Ptr",0,"Ptr")
    if held=-1 || !held
        throw Error("Could not establish the diagnostic journal write lock.")
    try {
        V59ExpectError(ILBLiveJournalSave)
        V48Assert(s.LivePending[key].Pulls.Count=2 && IPCHashFile(r.Path)=original,"failed journal replacement retains both memory queue and previous durable journal")
    }
    finally DllCall("CloseHandle","Ptr",held)
    ILBLiveJournalSave()
    V48Assert(ILBLiveJournalRead(r.Path)[key].Pulls.Count=2,"journal retry preserves both completed pulls")
}

V7880LiveRecoveryMerge() => V7880LiveRun(V7880LiveRecoveryMergeCase)
V7880LiveRecoveryMergeCase(seg,key)
{
    s := ILBState(),r := ILBLiveStore(),ILBLiveJournalSave(),ILBLiveJournalClose()
    newer := IPRCloneSnapshot(seg),newer.End += 100,newer.Last += 100
    ILBLiveQueue(newer),ILBLiveRecoverPending(),ILBLiveFlushPending(r.TestHistory)
    V48Assert(s.Files[key].Pulls.Length=1 && s.Files[key].Pulls[1].End=newer.Last,"older recovery data cannot replace a newer queued pull")
    ILBLiveQueue(seg),ILBLiveJournalSave(),ILBLiveJournalClose(),partial := IPRCloneSnapshot(seg),partial.Partial := true
    s.LivePending := Map(),ILBLiveQueue(partial),ILBLiveRecoverPending()
    for token,p in s.LivePending[key].Pulls
        V48Assert(!p.Partial,"a complete recovered pull replaces a partial snapshot with the same endpoint")
}

V7880MechanicsOtherBoss() => V7821Fixture(V7880MechanicsOtherBossCase)
V7880MechanicsOtherBossCase()
{
    global IPM,IP
    IP.Active := true,IP.Live := V7878FHSegment("G-NA").Data
    IPM.Editing := true,snapshot := V53Snapshot(),p := IPM.Panels["BossMechanics"],p.Width := 330
    IPMEnsureGui("BossMechanics",0,p),IBMRender(snapshot,p)
    V48Assert(!InStr(p.Heading.Text,"PREVIEW") && p.Rows[1].Value.Text!="~45%","unlocked live parser must not fabricate the 45 percent Izax example on another boss")
    V48Assert(p.Empty.Text="Boss support coming soon" && IBMVisible(snapshot,true),"unlocked panel shows unsupported boss status")
    V48Assert(IBMVisible(snapshot),"locked selected panel keeps its support status")
    snapshot.LayoutPreview := true
    V48Assert(IBMVisible(snapshot),"unsupported live panel remains visible despite stale sample flag")
    IBMRender(snapshot,p)
    V48Assert(p.Empty.Text="Boss support coming soon" && !p.Rows[1].Bar.Visible && p.VisibleRows=0,"stale sample data never supplies a fake live shield bar")
}

V7880MechanicsLiveSwitch() => V7821Fixture(V7880MechanicsLiveSwitchCase)
V7880MechanicsLiveSwitchCase()
{
    global IPM,IP,IZP,testClock
    IP.Active := true,IP.Live := V7878FHSegment("G-IZ").Data
    IPM.Editing := true,snapshot := V53Snapshot(),snapshot.LayoutPreview := true,p := IPM.Panels["BossMechanics"],p.Width := 330
    IPMEnsureGui("BossMechanics",0,p)
    V7821Feed(100000),V7821Feed(100100,"up"),IBMRender(snapshot,p)
    V48Assert(!InStr(p.Heading.Text,"PREVIEW") && p.Rows[1].Value.Text="~100%","live Izax overrides a stale layout preview even while unlocked")
    V7821Feed(100200,"half"),IBMRender(snapshot,p)
    V48Assert(p.Rows[1].Value.Text="~50%" && p.Rows[1].Bar.Value=500,"native panel updates from recorded shield absorption")
    V7821Break(),IBMRender(snapshot,p)
    V48Assert(p.Rows[1].Value.Text="Broken" && IBMVisible({}),"actual break replaces the estimated shield")
    testClock += 6000,IBMRender(snapshot,p)
    V48Assert(p.Empty.Text="Waiting for the shield / interrupt phase" && IBMVisible({}) && p.VisibleRows=0,"stale stream clears its shield and retains a supported waiting status")
    V7821Feed(110000,"phase4"),IBMRender(snapshot,p)
    V48Assert(p.Empty.Text="Waiting for the shield / interrupt phase" && !InStr(p.Heading.Text,"PREVIEW"),"leaving the interrupt phase does not restore fake sample data")
}

V7880MechanicsIdlePreview() => V7821Fixture(V7880MechanicsIdlePreviewCase)
V7880MechanicsIdlePreviewCase()
{
    global IPM,IP,IZP
    IP := IPNewApp(),IPM.Editing := true,snapshot := V53Snapshot(),p := IPM.Panels["BossMechanics"]
    IPMEnsureGui("BossMechanics",0,p),before := ObjPtr(IZP),IBMRender(snapshot,p)
    V48Assert(!InStr(p.Heading.Text,"PREVIEW") && p.Empty.Text="Waiting for a boss","unlocking alone never invents example data")
    V48Assert(ObjPtr(IZP)=before && !IZP.Active,"layout example cannot start or change encounter tracking")
    IPM.Enabled := true,IPM.Shown["Damage"] := true,IPMPreviewSet(8),snapshot.LayoutPreview := true,IBMRender(snapshot,p)
    V48Assert(IBMVisible(snapshot) && InStr(p.Heading.Text,"PREVIEW"),"explicit idle preview remains available")
    IPMPreviewClear(IPM),snapshot.LayoutPreview := false
    IBMRender(snapshot,p)
    V48Assert(IBMVisible(snapshot) && p.VisibleRows=0 && p.Empty.Text="Waiting for a boss","saving layout returns the selected panel to idle status")
}

V7881SupportTransitions() => V7821Fixture(V7881SupportTransitionsCase)
V7881SupportTransitionsCase()
{
    global IP,IPM,IZP
    IP := IPNewApp(),IPM.Source := 1,IPM.Enabled := true,IPM.Wanted := true,IPM.DesktopPreview := true,snapshot := V53Snapshot()
    for kind in ["FightFeedback","Achievements","BossMechanics"] {
        p := IPM.Panels[kind],p.Width := 230,IPMEnsureGui(kind,0,p)
        IPMRender(kind,snapshot,p)
        V48Assert(p.VisibleRows=0 && p.Empty.Text="Waiting for a boss" && !InStr(p.Heading.Text,"PREVIEW"),"idle placeholder: " kind)
        V48Assert(p.FeedbackState.Data.Finished && !p.FeedbackState.Follow,"static placeholder supplies the scrolling renderer's completion state: " kind)
        IPMPreviewSet(8),snapshot.LayoutPreview := true,IPMRender(kind,snapshot,p)
        V48Assert(p.VisibleRows>0 && InStr(p.Heading.Text,"PREVIEW"),"explicit idle preview: " kind)
        IP.Live := V7878FHSegment("Other").Data,IP.Active := true
        IPMRender(kind,snapshot,p)
        expected := kind="Achievements" ? "No special achievements tracked for this fight" : "Boss support coming soon"
        V48Assert(p.VisibleRows=0 && p.Empty.Text=expected && !InStr(p.Heading.Text,"PREVIEW"),"live unsupported fight replaces sample: " kind)
        IPMPreviewClear(IPM)
        IP.Active := false,IP.Offline := IP.Live,IP.Live := IPNewData(),IP.View := "Imported",IP.Selected := 1,IP.Follow := false,IPM.Source := 2
        IPMRender(kind,IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(p.VisibleRows=0 && p.Empty.Text=expected && IIFSnapshot(IPM).Visible,"saved unsupported fight renders on desktop without losing Show Overlays: " kind)
        IPM.Source := 1
        for row in p.Rows
            V48Assert(!row.Name.Visible && !row.Value.Visible && !row.Bar.Visible,"old sample controls hidden: " kind)
        V48Assert(!IPM.Shown[kind],"render does not enable optional display: " kind)
        IP := IPNewApp(),snapshot.LayoutPreview := false
    }
    f := V7878FHSegment("G-TY"),IP.Live := f.Data,IP.Active := true,p := IPM.Panels["FightFeedback"]
    model := IFHNew("G-TY"),model.Rage := 4,model.Peak := 4,f.Segment.AssistanceResult := model
    IPMRender("FightFeedback",snapshot,p)
    V48Assert(p.VisibleRows>0 && InStr(p.Rows[1].Name.Text,"4"),"supported assistance renders actual stacks")
    f.Segment.ModeId := "wrong",IPMRender("FightFeedback",snapshot,p)
    V48Assert(p.VisibleRows=0 && p.Empty.Text="Boss support coming soon","wrong difficulty cannot keep supported results")
    f.Segment.ModeId := "836045448953655",IPMRender("FightFeedback",snapshot,p)
    V48Assert(p.VisibleRows>0 && InStr(p.Rows[1].Name.Text,"4"),"return to supported fight restores recorded data")
    xr := V7878XFFixture(V7875XRFixture()),IP.Offline := xr.Data,IPM.Source := 2,IP.View := "Imported",IP.Selected := 1,IP.Follow := false
    IP.Active := false,p := IPM.Panels["Achievements"],IPMRender("Achievements",snapshot,p)
    V48Assert(p.VisibleRows=3 && p.Heading.Text="Special achievements","saved supported achievement results retained")
    IPM.Source := 1,IPMRender("Achievements",snapshot,p)
    V48Assert(p.VisibleRows=0 && p.Empty.Text="No special achievements tracked for this fight","placeholder follows selected source without stale achievement rows")
    V48Assert(xr.Segment.BossKey="XR-53" && model.Rage=4,"display switches preserve encounter state")
    challenge := IPM.Panels["Challenges"],IPMEnsureGui("Challenges",0,challenge)
    snapshot.Challenges := IRCSnapshot({Segment:f.Segment}),IPMRender("Challenges",snapshot,challenge)
    V48Assert(challenge.VisibleRows=0 && challenge.Empty.Text="No raid challenge tracked for this fight","unavailable challenge does not promise future support")
    f.Segment.BossKey := "G-NA",snapshot.Challenges := IRCSnapshot({Segment:f.Segment})
    IPMRender("Challenges",snapshot,challenge)
    V48Assert(challenge.Empty.Text="Waiting for a challenge","supported challenge waits for actual phase instead of claiming no support")
    IPM.Source := 1,IP.Live := V7878FHSegment("G-NA").Data,IP.Active := true
    V7821Feed(100000),V7821Feed(100100,"up")
    p := IPM.Panels["BossMechanics"],IPMRender("BossMechanics",snapshot,p)
    V48Assert(IZP.Active && p.VisibleRows=0 && p.Empty.Text="Boss support coming soon","retained Izax observer cannot leak into another boss")
}

; Synthetic raw records; no live app, audio, settings or archive writes.
V7880CatalystHP()
{
    f := V7850Fixture("G-SC"),id := "4126553038389248"
    V7850Event(f,38000,"@DPS#1",V7850NPC(id,172173,937150),"123","Damage",1)
    V7850Event(f,38108,"@DPS#1",V7850NPC(id,117918,937150),"123","Damage",1)
    V7850Event(f,38305,"@DPS#1",V7850NPC(id,58012,937150),"123","Damage",1)
    V7850Event(f,38770,V7850NPC(id,0,18188932),"","123","Activate")
    V7850Event(f,38821,V7850NPC(id,0,18188932),"@Victim#1","4127205873418504","Damage",619495)
    text := V7850Text(f)
    V48Assert(InStr(text,"last living HP 6.2%") && InStr(text,"58,012 / 937,150"),"final subsecond catalyst HP is retained: " text)
    V48Assert(InStr(text,"0.5s before the explosion") && !InStr(text,"0.0%"),"terminal zero is not shown as the explosion's pre-death health")
    packed := IBCPackEvidence(f.Recap.BossEvidence),copy := f.Recap.Clone()
    copy.BossEvidence := IBCUnpackEvidence(IGJParse(IGVJson(packed)),f.Pull,f.Recap)
    V48Assert(IBCCheck(f.Pull,copy).Text=text,"living catalyst sample survives saved evidence")
}
V7880CatalystMissing()
{
    id := "4126553038389248",f := V7850Fixture("G-SC")
    V7850Event(f,38000,"@DPS#1",V7850NPC(id,900,1000,2),"123","Damage",1)
    V7850Event(f,39000,V7850NPC(id,0,18188932),"@Victim#1","4127205873418504","Damage",100)
    text := V7850Text(f)
    V48Assert(InStr(text,"Living HP before the explosion was not recorded."),"another catalyst cannot fill the missing source HP")
    V48Assert(!InStr(text,"last living HP 90.0%") && !InStr(text,"0.0% (0 /"),"missing evidence is not zero or another instance")
    f := V7850Fixture("G-SC")
    V7850Event(f,39000,V7850NPC(id,120),"@Victim#1","4127205873418504","Damage",100)
    V48Assert(InStr(V7850Text(f),"Living HP before the explosion was not recorded."),"HP only on the damage record is not called pre-explosion HP")
}
V7880CatalystBoundary()
{
    id := "4126553038389248",f := V7850Fixture("G-SC")
    V7850Event(f,38000,"@DPS#1",V7850NPC(id,200),"123","Damage",1)
    IPBBeginUndo(f.Data,f.Seg)
    V7850Event(f,38100,"@DPS#1",V7850NPC(id,10),"123","Damage",1)
    IPBRollbackTail(f.Data,f.Seg)
    V7850Event(f,39000,V7850NPC(id,0,18188932),"@Victim#1","4127205873418504","Damage",100)
    V48Assert(InStr(V7850Text(f),"last living HP 20.0%"),"rollback removes the speculative lower sample")
    f := V7850Fixture("G-SC")
    V7850Event(f,39000,"@DPS#1",V7850NPC(id,200),"123","Damage",1)
    V7850Event(f,39000,V7850NPC(id,0,18188932),"","123","Activate")
    V7850Event(f,39000,"@DPS#1",V7850NPC(id,100),"123","Damage",1)
    V7850Event(f,39000,V7850NPC(id,0,18188932),"@Victim#1","4127205873418504","Damage",100)
    V7850Event(f,39500,"@DPS#1",V7850NPC(id,50),"123","Damage",1)
    text := V7850Text(f)
    V48Assert(InStr(text,"last living HP 20.0%") && !InStr(text,"last living HP 10.0%"),"same-time record order excludes positive snapshots after terminal zero")
    V48Assert(!InStr(text,"last living HP 5.0%"),"post-explosion HP cannot replace the earlier sample")
}

; v0.78.80: Boss HP defaults only. Synthetic parser data; no GUI, files, settings,
; audio, timers, or live encounter state. IDs below are independent source examples
; from StarParse DreadFortress/Iokath and BARAS propagator_core.toml.
V7880BossHPCatalogue()
{
    for id in ["3275625527771136","3277721471811584", ; opening hands
        "3303276527222784","3314013945462784","3314958838267904", ; P5/burn hands
        "4131728473980928","4131857322999808","4131861617967104", ; Nahut couplings
        "4131865912934400","4131870207901696","4132746381230080", ; couplings/turret
        "4126522973618176","4126518678650880","4126527268585472"] ; Scyva railguns/OPD
        V48Assert(IRKnownBoss(id),"StarParse default HP target is recognized: " id)
    for id in ["3303289412124672","3275642707640320","3315362565193728", ; commented fingers
        "4132742086262784","4148908343164928", ; commented Extermination/Swarm droids
        "123","990000000000001"]
        V48Assert(!IRKnownBoss(id),"commented or unknown NPC is not a default HP target: " id)
}

V7880BossHPXR()
{
    for id in ["4824927605620736","4847325860069376", ; XR-53 variants
        "4831241207545856","4831722243883008","4831533265321984"] ; Defender/Rampaging/Supplicant
        V48Assert(IRKnownBoss(id),"BARAS XR-53 encounter HP target is recognized: " id)
}

V7880BossHPIsolated(action)
{
    global IR
    old := IR
    try {
        IR := IRNewUI()
        action.Call()
    }
    finally IR := old
}

V7880BossHPHands() => V7880BossHPIsolated(V7880BossHPHandsCase)
V7880BossHPPins() => V7880BossHPIsolated(V7880BossHPPinsCase)
V7880BossHPFallback() => V7880BossHPIsolated(V7880BossHPFallbackCase)

IRH150OperatorCores() => V7880BossHPIsolated(IRH150OperatorCoresCase)

IRH150OperatorCoresCase()
{
    global IPM
    s := IPNewData("SYNTHETIC Operator IX HP"),owner := "@Tank#1|(0,0,0,0)|(1000/1000)"
    north := "Data Core {2994867810598912}:111",south := "Data Core {2994867810598912}:222"
    unknown := "Data Core {2994867810598912}:333"
    IPFeedLine(s,V54Line(1000,owner,"","836045448945489"))
    IPFeedLine(s,V54Line(2000,owner,north "|(-468.19,769.82,6.05,60)|(1140000/1840000)","836045448945501","(100 energy {836045448940874}) <100.0>","836045448945477"))
    IPFeedLine(s,V54Line(2010,south "|(-468.54,825.08,6.05,120)|(1840000/1840000)",owner,"836045448953668"))
    IPFeedLine(s,V54Line(2020,unknown "|(0,0,0,0)|(1840000/1840000)",owner,"836045448953668"))
    IPFeedLine(s,V54Line(2030,north "|(0,0,0,0)|(1120000/1840000)",owner,"836045448953668"))
    snap := V54Snapshot(s),labels := Map()
    for row in snap.Raid.Health
        labels[row.Instance] := IRHealthText(row)
    V48Assert(labels.Count=3 && labels["111"].Name="N. Core" && labels["222"].Name="S. Core","shared NPC template keeps the two HP instances and short directional names")
    V48Assert(InStr(labels["333"].Name,"Data Core") && !InStr(labels["333"].Name,". Core"),"unknown position keeps the generic identity")
    V48Assert(labels["111"].Total="1.12m/1.84m" && labels["222"].Rate="100.0%","compact HP keeps current, maximum and percentage")
    V48Assert(labels["333"].Total="1.84 m/1.84 m","other HP rows keep their existing formatting")
    saved := IPM,IPM := IPMNewState()
    try {
        p := IPM.Panels["BossHP"],p.Width := 196
        IPMEnsureGui("BossHP",0,p),IPMRender("BossHP",snap,p)
        for row in p.Rows {
            if row.Name.Text!="N. Core" && row.Name.Text!="S. Core"
                continue
            for cell in [row.Name,row.Total,row.Value] {
                cell.GetPos(,,&width)
                V48Assert(IXFTextWidth(cell,cell.Text)<=width,"core text fits the smallest supported Boss HP width")
            }
        }
        V48Assert(s.Current.Totals["@Tank#1"].Damage=100,"side metadata does not change combat totals")
    }
    finally IPMDestroyPanels(),IPM := saved
}

V7880BossHPHandsCase()
{
    s := IPNewData("SYNTHETIC P5 hand health"),owner := "@Tank#1|(0,0,0,0)|(100/100)"
    first := "Hand of Brontes {3303276527222784}:100001",second := "Hand of Brontes {3303276527222784}:100002"
    IPFeedLine(s,V54Line(1000,owner,"","836045448945489"))
    IPFeedLine(s,V54Line(2000,owner,first "|(0,0,0,0)|(900/1000)","836045448945501","(100 energy {836045448940874}) <150.0>","836045448945477"))
    IPFeedLine(s,V54Line(3000,first "|(0,0,0,0)|(650/1000)",owner,"836045448953668"))
    IPFeedLine(s,V54Line(3100,second "|(0,0,0,0)|(400/1000)","@DPS#2","836045448953668"))
    before := V596Signature(s),snap := V54Snapshot(s),rows := Map()
    for row in snap.Raid.Health
        rows[row.Instance] := row
    V48Assert(rows.Count=2 && rows.Has("100001") && rows.Has("100002") && !snap.Raid.Fallback,"both P5 hands display by instance although the recorder only damaged one")
    a := rows["100001"],b := rows["100002"]
    V48Assert(a.Id=b.Id && a.Key!=b.Key && a.Recognized && b.Recognized,"shared NPC class never merges the two hand instances")
    V48Assert(a.Current=650 && b.Current=400 && a.Percent=65 && b.Percent=40,"each hand uses its latest recorded HP, independently of damage dealt")
    V48Assert(a.Damage=100 && b.Damage=0 && a.Name!=b.Name,"undamaged observed hand remains visible and duplicate names are distinguished")
    V48Assert(s.Current.Totals["@Tank#1"].Damage=100 && snap.Duration=1,"health-only observations do not add damage or extend combat metric time")
    a.Current := 1,b.Current := 2
    again := V54Snapshot(s),check := Map()
    for row in again.Raid.Health
        check[row.Instance] := row.Current
    V48Assert(check["100001"]=650 && check["100002"]=400 && V596Signature(s)=before,"changing display copies cannot alter saved HP, metrics, events, or encounter bounds")
    IPFeedLine(s,V54Line(3200,first "|(0,0,0,0)|(0/1000)",owner,"836045448953668"))
    ended := V54Snapshot(s).Raid,visible := IRVisibleHealth(ended.Health)
    V48Assert(ended.Health.Length=2 && visible.Count=1 && visible.Rows[1].Instance="100002","zero HP removes only the dead instance from the overlay")
    V48Assert(ended.AllHealth.Length=2,"historical zero-HP observation remains available")
    V7881BossHPDeadUI()
}

V7881BossHPDeadUI()
{
    global IPM
    old := IPM
    try {
        IPM := IPMNewState(),IPM.MaxRows := 8,snap := V53Snapshot(),rows := []
        Loop 30
            rows.Push({Name:"Dead tentacle " A_Index,Known:true,Current:0,Maximum:1000,Percent:0,Stale:false})
        rows.Push({Name:"Living tentacle",Known:true,Current:500,Maximum:1000,Percent:50,Stale:false})
        rows.Push({Name:"Unknown HP",Known:false,Current:0,Maximum:0,Percent:-1,Stale:true})
        rows.Push({Name:"Almost dead",Known:true,Current:1,Maximum:1000000,Percent:0.0001,Stale:false})
        snap.Raid.Health := rows,p := IPM.Panels["BossHP"],IPMEnsureGui("BossHP",0,p)
        IPMRender("BossHP",snap,p)
        V48Assert(p.VisibleRows=3 && p.Rows[1].Name.Text="Living tentacle","dead rows do not consume the display row limit")
        V48Assert(p.Rows[2].Value.Text="--" && p.Rows[3].Name.Text="Almost dead","unknown HP and positive HP rounded to zero percent remain visible")
        V48Assert(rows.Length=33 && rows[1].Current=0,"render filtering leaves health history intact")
        rows[31].Current := 0,rows[31].Percent := 0,IPMRender("BossHP",snap,p)
        V48Assert(p.VisibleRows=2 && p.Rows[1].Value.Text="--" && !p.Rows[3].Name.Visible,"a new zero update clears and compacts existing controls")
        snap.Raid.Health := [rows[1]],IPMRender("BossHP",snap,p)
        V48Assert(p.VisibleRows=0 && p.Empty.Visible && !p.Rows[1].Name.Visible,"all dead rows leave no stale HP text visible")
    }
    finally IPMRetirePanels(IPMAllPanels()),IPM := old
}

V7880BossHPPinsCase()
{
    global IR
    s := V54Fixture(),unknown := "Additional target {990000000000001}:101|(0,0,0,0)|(75/100)"
    IPFeedLine(s,V54Line(4500,unknown,"@Tank#1","836045448953668"))
    before := V596Signature(s),r := V54Snapshot(s).Raid
    V48Assert(r.Health.Length=1 && r.Health[1].Id="2857785339412480" && r.AllHealth.Length=2 && !r.Fallback,"an unpinned unknown does not replace the recognized default target")
    IR.PinSet := IRParsePins("990000000000001"),r := V54Snapshot(s).Raid,ids := Map()
    for row in r.Health
        ids[row.Id] := row
    V48Assert(ids.Count=2 && ids.Has("2857785339412480") && ids.Has("990000000000001") && !r.Fallback,"additional pin coexists with the known default row")
    V48Assert(ids["990000000000001"].Pinned && !ids["990000000000001"].Recognized && ids["990000000000001"].Current=75,"explicit pin keeps its own identity and recorded health")
    IR.PinSet := Map(),r := V54Snapshot(s).Raid
    V48Assert(r.Health.Length=1 && r.AllHealth.Length=2 && V596Signature(s)=before,"removing a pin changes display selection only; underlying observations and statistics remain intact")
}

V7880BossHPFallbackCase()
{
    global IR
    s := V52Fixture(),before := V596Signature(s),r := V54Snapshot(s).Raid
    V48Assert(r.Fallback && r.Health.Length=1 && !r.Health[1].Recognized && !r.Health[1].Pinned,"without any known or pinned target the existing damaged-target fallback still operates")
    V48Assert(r.Health[1].Id="990000000000001" && r.Health[1].Damage=14000,"fallback retains total observed raid damage on its selected NPC")
    IR.PinSet := IRParsePins("990000000000001"),r := V54Snapshot(s).Raid
    V48Assert(!r.Fallback && r.Health.Length=1 && r.Health[1].Pinned,"pinning the fallback target promotes it to an explicit tracked row")
    V48Assert(V596Signature(s)=before && s.Current.Totals["@A#1"].Damage=10000 && s.Current.Totals["@B#2"].Damage=4000,"HP classification and pins leave player metrics and parser history unchanged")
}

PAFTestActor(name,id := 1,hp := 1000) => "@" name "#" id "|(0,0,0,0)|(" hp "/1000)"
PAFTestNPC(id,instance := 1,hp := 1000) => "NPC {" id "}:" instance "|(0,0,0,0)|(" hp "/1000)"
PAFTestFeed(f,at,src,dst,ability,kind := "hit",tail := " (100 energy {836045448940874})",effect := "")
{
    action := kind="apply" || kind="hit" || kind="heal" ? "836045448945477" : kind="remove" ? "836045448945478" : "836045448945472"
    e := effect!="" ? effect : kind="hit" ? "836045448945501" : kind="heal" ? "836045448945500" : kind="cast" ? "836045448945479" : kind="kick" ? "836045448945482" : kind="death" ? "836045448945493" : ability
    if !f.HasOwnProp("Seq")
        f.Seq := 0
    return V7878FHFeed(f,V671FloorLine(at,src,dst,ability,action,e,tail),++f.Seq)
}
PAFTestRoster(f)
{
    for i,p in [{Name:"Tank",Role:1},{Name:"Healer",Role:4},{Name:"Damage A",Role:2},{Name:"Damage B",Role:2}] {
        a := IPActor(PAFTestActor(p.Name,i))
        f.Segment.Actors[a.Key] := a,f.Segment.DisplayRoles[a.Key] := p.Role
    }
}
PAFTestRage(f,at,boss,n) => PAFTestFeed(f,at,boss,"=","4086833180835840","apply"," (" n " charges {836045448953667})","4086833180836195")
PAFTestTyth()
{
    f := V7878FHSegment("G-TY"),boss := PAFTestNPC("4078423634870272"),grace := PAFTestNPC("4078440814739456",2)
    a := PAFTestActor("Damage A",3),b := PAFTestActor("Damage B",4)
    PAFTestFeed(f,100000,grace,boss,"4071199499878400","cast")
    V48Assert(IFHModel(f.Segment).Findings.Heals.Count=0,"Grace cast start is not a heal")
    PAFTestFeed(f,100100,grace,boss,"4071199499878400","heal"," (100 ~0)")
    V48Assert(IFHModel(f.Segment).Findings.Heals.Count=0,"explicit zero effective healing does not inflate heal counter")
    PAFTestFeed(f,101000,grace,boss,"4071199499878400","heal")
    PAFTestFeed(f,101000,grace,boss,"4071199499878400","heal")
    V48Assert(IFHModel(f.Segment).Findings.Heals.Count=1,"one completed heal counted once")
    PAFTestFeed(f,102000,grace,"=","4088443793571840","cast")
    PAFTestFeed(f,102800,a,"","4088443793571840","kick")
    PAFTestFeed(f,102850,b,"","4088443793571840","kick")
    V48Assert(IFHModel(f.Segment).Findings.DRs.Count=1,"overlapping kicks count one observed DR cast")
    PAFTestFeed(f,105000,grace,"=","4088443793571840","cast")
    PAFTestFeed(f,105800,PAFTestNPC("4078440814739456",2,0),"","4088443793571840","kick")
    PAFTestFeed(f,105801,PAFTestNPC("4078440814739456",2,0),"","4088443793571840","kick")
    V48Assert(IFHModel(f.Segment).Findings.DRs.Count=2,"exact DR interruption on dead Grace counts once")
    PAFTestFeed(f,105400,a,PAFTestNPC("4078440814739456",9,0),"1","death","")
    V48Assert(IFHModel(f.Segment).Findings.DRs.Count=2,"Grace death alone does not imply DR interruption")
    PAFTestFeed(f,105950,PAFTestNPC("4078440814739456",10,0),"","4088443793571840","kick")
    V48Assert(IFHModel(f.Segment).Findings.DRs.Count=3,"explicit dead-Grace interrupt needs no visible cast start")
    tank := PAFTestActor("Tank"),justice := PAFTestNPC("4078432224804864",7)
    PAFTestRage(f,105999,boss,1)
    PAFTestFeed(f,106000,boss,tank,"","event","","836045448953668")
    PAFTestFeed(f,106100,boss,justice,"4080279060742144")
    PAFTestFeed(f,106200,PAFTestNPC("4078432224804864",7,0),"=","1","death","")
    V48Assert(IFHView(f.Segment,IFHModel(f.Segment),false,107000).Findings.Length=4,"only the heal and three DR interruptions appear without matching Rage evidence")
    PAFTestRage(f,106201,boss,4)
    v := IFHView(f.Segment,IFHModel(f.Segment),false,107000)
    V48Assert(v.Findings.Length=5 && InStr(v.Findings[5].Text,"Tank"),"Rage-supported cleave keeps current tank target after Grace findings")
    f2 := V7878FHSegment("G-TY")
    PAFTestFeed(f2,100000,boss,"=","4076168777039872","cast")
    for i,id in ["4078432224804864","4078445109706752","4078445109706752","4078445109706752","4078445109706752","4078445109706752","4078445109706752","4078445109706752"]
        PAFTestFeed(f2,100100+i,a,PAFTestNPC(id,i),"123")
    PAFTestRage(f2,100999,boss,1)
    PAFTestFeed(f2,101000,boss,PAFTestNPC("4078432224804864",1),"4080279060742144")
    PAFTestFeed(f2,101100,PAFTestNPC("4078432224804864",1,0),"=","1","death","")
    PAFTestRage(f2,101101,boss,4)
    V48Assert(!IFHView(f2.Segment,IFHModel(f2.Segment),false,103000).Findings.Length,"Justice cleave in eight-add wave omitted")
    f.Segment.LastOutput := f.Segment.Last,IPBBeginUndo(f.Data,f.Segment)
    before := XRDiagnosticJSON(IFHView(f.Segment,IFHModel(f.Segment),false,107000))
    PAFTestFeed(f,108000,grace,boss,"4071199499878400","heal")
    IPBRollbackTail(f.Data,f.Segment)
    V48Assert(XRDiagnosticJSON(IFHView(f.Segment,IFHModel(f.Segment),false,107000))=before,"rollback removes findings and counters from provisional tail")
    f3 := V7878FHSegment("G-TY"),add := PAFTestNPC("4078445109706752",55)
    PAFTestRage(f3,99999,boss,1)
    PAFTestFeed(f3,100000,boss,add,"4080279060742144")
    PAFTestFeed(f3,100100,PAFTestNPC("4078445109706752",55,0),"=","1","death","")
    PAFTestRage(f3,100101,boss,4)
    V48Assert(IFHView(f3.Segment,IFHModel(f3.Segment),false,103000).Findings.Length=1,"cleave can precede the zero-HP record")
    PAFTestFeed(f3,100050,a,PAFTestNPC("4078445109706752",55,0),"1")
    V48Assert(!IFHView(f3.Segment,IFHModel(f3.Segment),false,103000).Findings.Length,"late competing player kill removes unsupported cleave attribution")
    f4 := V7878FHSegment("G-TY")
    PAFTestRage(f4,99999,boss,1)
    for i in [1,2] {
        PAFTestFeed(f4,100000+i,boss,PAFTestNPC("4078445109706752",70+i),"4080279060742144")
        PAFTestFeed(f4,100010+i,PAFTestNPC("4078445109706752",70+i,0),"=","1","death","")
    }
    PAFTestRage(f4,100020,boss,4)
    V48Assert(!IFHView(f4.Segment,IFHModel(f4.Segment),false,103000).Findings.Length,"one shared plus-three cannot fund two cleaves")
    f5 := V7878FHSegment("G-TY")
    PAFTestRage(f5,99999,boss,1)
    PAFTestFeed(f5,100000,boss,"=","4076018453184512","cast")
    PAFTestFeed(f5,100700,boss,PAFTestNPC("4078445109706752",81),"4080279060742144")
    PAFTestFeed(f5,100750,PAFTestNPC("4078445109706752",81,0),"=","1","death","")
    PAFTestRage(f5,100800,boss,4)
    V48Assert(!IFHView(f5.Segment,IFHModel(f5.Segment),false,103000).Findings.Length,"Intensify contribution reserved before cleave attribution")
}
PAFTestSisters()
{
    f := V7878FHSegment("G-AE"),p := PAFTestActor("Wrong colour",3),glare := PAFTestNPC("4109914335084544")
    PAFTestFeed(f,100000,p,"=","4116197872238592","apply","","4116197872238858")
    PAFTestFeed(f,100010,glare,"=","4111258659848192","apply","","4111258659848484")
    PAFTestFeed(f,101000,glare,PAFTestActor("Wrong colour",3,0),"4110403961356288")
    PAFTestFeed(f,101001,glare,PAFTestActor("Wrong colour",3,0),"1","death","")
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=1,"recorded opposite-polarity lethal beam identified")
    good := PAFTestActor("Matching colour",4)
    PAFTestFeed(f,102000,good,"=","4116202167205888","apply","","4116202167206154")
    PAFTestFeed(f,102100,glare,PAFTestActor("Matching colour",4,0),"4110403961356288")
    PAFTestFeed(f,102101,glare,PAFTestActor("Matching colour",4,0),"1","death","")
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=1,"matching colour never called a wrong-colour death")
    PAFTestFeed(f,103000,glare,PAFTestActor("Unknown colour",5,0),"4110403961356288")
    PAFTestFeed(f,103001,glare,PAFTestActor("Unknown colour",5,0),"1","death","")
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=1,"missing polarity does not name a player")
}
PAFTestNahut()
{
    f := V7878FHSegment("G-NA"),boss := PAFTestNPC("4122949560827904"),p := PAFTestActor("Passer",3)
    PAFTestFeed(f,100000,p,"=","4132059186462720","cast")
    PAFTestFeed(f,101199,boss,"=","4132059186462720","apply","","4132059186463009")
    V48Assert(InStr(IFHView(f.Segment,IFHModel(f.Segment),false,103500).Rows[1].Text,"Passer"),"boss-specific Pass Candle effect links to recent passer")
    PAFTestFeed(f,110000,p,"=","4132059186462720","cast")
    PAFTestFeed(f,110100,PAFTestActor("Other",4),"=","4132059186462720","cast")
    PAFTestFeed(f,111200,boss,"=","4132059186462720","apply","","4132059186463009")
    v := IFHView(f.Segment,IFHModel(f.Segment),false,113500)
    V48Assert(InStr(v.Rows[2].Text,"not recorded") && v.Rows[2].Color="AEB4BE","ambiguous pass does not accuse either player")
    PAFTestFeed(f,120000,boss,"=","4137075708264448","cast")
    PAFTestFeed(f,121000,boss,p,"4137075708264448")
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=2,"unassigned Slice is not mislabeled a missed Rebounder")
    m := IFHNew("G-NA")
    ev := IPParseLine(V671FloorLine(130000,boss,"=","4137075708264448","836045448945472","836045448945479")),ev.PAFExpectedRebounder := "Assigned PT"
    IFHObserve(m,ev,130000,1)
    ev := IPParseLine(V671FloorLine(131000,boss,p,"4137075708264448","836045448945477","836045448945501"," (100 energy {836045448940874})"))
    IFHObserve(m,ev,131000,2)
    V48Assert(m.Findings.Findings.Count=1 && InStr(m.Findings.Findings["slice:130000"].Text,"Assigned PT"),"captured assignment identifies missed Rebounder")
    f2 := V7878FHSegment("G-NA"),PAFTestRoster(f2),a := PAFTestActor("Damage A",3),c := PAFTestNPC("4131857322999808")
    PAFTestFeed(f2,100000,a,c,"1","hit"," (600 energy {836045448940874})")
    PAFTestFeed(f2,102000,PAFTestActor("Damage B",4),c,"1","hit"," (300 energy {836045448940874})")
    PAFTestFeed(f2,103000,PAFTestNPC("4122580193640448"),a,"4132961129594880")
    v := IFHView(f2.Segment,IFHModel(f2.Segment),false,105500)
    V48Assert(v.Rows.Length=1 && InStr(v.Rows[1].Text,"Damage B (100.0 DPS)"),"failed coupling ranks DPS over the coupling damage window")
    PAFTestFeed(f2,103100,a,c,"1","hit"," (900000 energy {836045448940874})")
    V48Assert(IFHModel(f2.Segment).Findings.CouplingFailure.Damage[IPActor(a).Key]=600,"coupling ranking stops at failure")
    f3 := V7878FHSegment("G-NA")
    PAFTestFeed(f3,100000,a,PAFTestNPC("4131857322999808",1,1),"1")
    PAFTestFeed(f3,103000,PAFTestNPC("4122580193640448"),a,"4132961129594880")
    V48Assert(!IsObject(IFHModel(f3.Segment).Findings.CouplingFailure),"finished coupling plus later burn damage is not a coupling failure")
}
PAFTestScyva() => V7816Fixture(PAFTestScyvaCase)
PAFTestScyvaCase()
{
    f := V7878FHSegment("G-SC"),PAFTestRoster(f),cat := StrReplace(PAFTestNPC("4126553038389248"),"(0,0,0,0)","(-500,2160,187,0)"),a := PAFTestActor("Damage A",3)
    PAFTestFeed(f,100000,a,cat,"1","hit"," (500 energy {836045448940874})")
    PAFTestFeed(f,101000,PAFTestActor("Tank",1),cat,"1","hit"," (1 energy {836045448940874})")
    PAFTestFeed(f,102000,cat,a,"4127205873418504")
    v := IFHView(f.Segment,IFHModel(f.Segment),false,105000)
    V48Assert(v.Rows[1].Text="Only one DPS went to Red catalyst: Damage A","only the DPS hitting this catalyst is counted, with recorded colour")
    PAFTestFeed(f,103000,PAFTestActor("Damage B",4),cat,"1","hit"," (900 energy {836045448940874})")
    V48Assert(IFHView(f.Segment,IFHModel(f.Segment),false,105000).Rows[1].Text=v.Rows[1].Text,"post-explosion hits do not add participants")
    pair := V7878FHSegment("G-SC"),PAFTestRoster(pair),b := PAFTestActor("Damage B",4)
    PAFTestFeed(pair,100000,a,cat,"1","hit"," (500 energy {836045448940874})")
    PAFTestFeed(pair,100100,b,cat,"1","hit"," (200 energy {836045448940874})")
    PAFTestFeed(pair,101000,PAFTestActor("Tank",1),cat,"1","hit"," (1 energy {836045448940874})")
    PAFTestFeed(pair,102000,cat,a,"4127205873418504")
    V48Assert(IFHView(pair.Segment,IFHModel(pair.Segment),false,105000).Rows[1].Text="Red catalyst exploded`nLowest DPS: Damage B (100.0 DPS)","lower damage of participating DPS, excluding tanks")
    blue := V7878FHSegment("G-SC"),PAFTestRoster(blue),other := StrReplace(StrReplace(cat,"-500","-470"),"}:1|","}:2|")
    PAFTestFeed(blue,100000,a,cat,"1","hit"," (500 energy {836045448940874})")
    PAFTestFeed(blue,100100,b,other,"1","hit"," (200 energy {836045448940874})")
    PAFTestFeed(blue,102000,other,a,"4127205873418504")
    V48Assert(IFHView(blue.Segment,IFHModel(blue.Segment),false,105000).Rows[1].Text="Only one DPS went to Blue catalyst: Damage B","the other catalyst's attackers are excluded")
    none := V7878FHSegment("G-SC"),PAFTestRoster(none)
    PAFTestFeed(none,100000,PAFTestActor("Healer",2),cat,"1","hit"," (100 energy {836045448940874})")
    PAFTestFeed(none,102000,cat,a,"4127205873418504")
    V48Assert(InStr(IFHView(none.Segment,IFHModel(none.Segment),false,105000).Rows[1].Text,"no DPS damage recorded"),"healer contribution does not become a lone DPS")
    f2 := V7878FHSegment("G-SC")
    V7878FHFeed(f2,V7816Line(98000,"start"),1),V7878FHFeed(f2,V7816Line(100000),2),V7878FHFeed(f2,V7816Line(106000,"death"),3)
    V48Assert(IFHModel(f2.Segment).Findings.Findings.Count=0,"Omega Protocol Droid death is a phase end, never a mistimed swarm kill")
    f3 := V7878FHSegment("G-SC")
    V7878FHFeed(f3,V7816Line(98000,"start"),1),V7878FHFeed(f3,V7816Line(100000),2),V7878FHFeed(f3,V7816Line(110000,"death"),3)
    V48Assert(IFHModel(f3.Segment).Findings.Findings.Count=0,"OPD death inside kill window stays clean")
}
PAFTestIzax() => V7821Fixture(PAFTestIzaxCase)
PAFTestIzaxCase()
{
    f := V7878FHSegment("G-IZ"),boss := V7820Boss(750),a := PAFTestActor("Carrier",3),b := PAFTestActor("Other",4)
    PAFTestFeed(f,100000,boss,"=","4168128321814528","cast")
    PAFTestFeed(f,100010,boss,a,"4168128321814528","apply","")
    PAFTestFeed(f,108000,boss,a,"4168128321814528")
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=0,"Induction hitting only the carrier is clean")
    PAFTestFeed(f,108001,boss,b,"4168128321814528")
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=0,"clipped damage without the induction debuff is not a spread")
    PAFTestFeed(f,108002,boss,b,"4168128321814528","apply","")
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=1 && InStr(IFHModel(f.Segment).Findings.Findings["induction:1"].Text,"Carrier"),"splash debuff does not replace original Induction carrier")
    PAFTestFeed(f,110000,boss,"=","4162849807007744","cast")
    PAFTestFeed(f,112000,boss,"=","4162905641582592","cast")
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=1,"shielded or unopened cannon is not a missed interrupt")
    m := IFHModel(f.Segment),m.Izax.Active := true,m.Izax.Ended := false,m.Izax.Shield := "Down",m.Izax.OrderMode := "Tank"
    PAFTestFeed(f,114000,boss,"=","4162849807007744","cast")
    PAFTestFeed(f,116000,boss,"=","4162905641582592","cast")
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=2,"uninterrupted kickable cannon creates one missed interrupt")
    PAFTestFeed(f,117000,boss,"=","4162849807007744","cast")
    PAFTestFeed(f,117500,a,"","4162849807007744","kick")
    PAFTestFeed(f,118000,boss,"=","4162905641582592","cast")
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=2,"covered kick never becomes a missed interrupt")
}
PAFTestAssignments() => V673OrderFixture(PAFTestAssignmentsCase)
PAFTestAssignmentsCase()
{
    global NBOrder,NBCandle,NBRebounder,Audio,logReadBusy
    context := {AreaId:"833571547775765",ModeId:"836045448953655"}
    V48Setup(),V48Pass("Tank1",100000),V48Use("Tank1",100100),V48Chosen()
    before := XRDiagnosticJSON(NBOrder),audioBefore := XRDiagnosticJSON(Audio.Queue)
    line := V671FloorLine(100200,V48Field("Tank1"),"=","4132059186462720","836045448945472","836045448945479")
    logReadBusy := true,snapshot := PAFCaptureAssignment(line,context),logReadBusy := false
    V48Assert(IsObject(snapshot) && snapshot.Candle=GetToonName(V48Actor("Tank2")),"candle assignment captured before asynchronous queue drain, including busy read")
    V48Assert(XRDiagnosticJSON(NBOrder)=before && XRDiagnosticJSON(Audio.Queue)=audioBefore,"snapshot neither consumes a turn nor changes audio")
    V48Pass("Tank2",100300),V48Use("Tank2",100400),V48Chosen()
    V48Assert(snapshot.Candle=GetToonName(V48Actor("Tank2")),"later rotation cannot rewrite captured expectation")
    f := V7878FHSegment("G-NA")
    IPFeedLine(f.Data,line,"","","",snapshot)
    IPFeedLine(f.Data,V671FloorLine(101300,V48Field("Healer1"),"=","4132016236789760","836045448945477","4132016236789760"))
    m := IFHModel(f.Segment)
    V48Assert(IsObject(m) && m.Findings.Findings.Count=1,"queued assignment reaches accepted parser journal")
    row := IBCOrdered(m.Findings.Findings)[1]
    V48Assert(InStr(row.Text,"expected Tank2"),"drained pass retains its original expected recipient")
    V49Setup(4),NBCandle.At := 100000
    NBRebounderOffer("Next","DoubleCloseDPS",1,100000,false,"test")
    line := V671FloorLine(100100,NBCandle.Boss.Token,"=","4137075708264448","836045448945472","836045448945479")
    s := PAFCaptureAssignment(line,context)
    V48Assert(IsObject(s) && s.Rebounder=GetToonName(V48Actor("DoubleCloseDPS")),"muted assignment snapshot identifies the actual toon")
    NBRebounder.Pending.Kind := "Mit"
    V48Assert(PAFCaptureAssignment(line,context).Rebounder="","planned mitigation never assigns Rebounder blame")
    context.ModeId := "836045448953652"
    V48Assert(!IsObject(PAFCaptureAssignment(line,context)),"wrong difficulty cannot capture Master assignments")
}

PAFTestFullPull()
{
    f := V7878FHSegment("G-TY"),m := IFHNew("G-TY"),m.Rage := 5
    Loop 40
        PAFAdd(m.Findings,A_Index,100000+A_Index*1000,A_Index,"Finding " A_Index)
    view := IFHView(f.Segment,m,true,200000)
    V48Assert(view.Rows.Length=43 && view.Findings.Length=40,"live counters do not displace findings")
    V48Assert(view.Rows[4].Text="Finding 1" && view.Rows[43].Text="Finding 40","all findings retained in chronological order")
    long := [],LoopCount := 100
    Loop LoopCount
        long.Push(30)
    page := IXFPage(long,300,100)
    V48Assert(page.Max=90 && page.Offset=90 && page.Count=10,"last page contains final ten rows without dropping earlier ones")
    V48Assert(IXFPage(long,300,-20).Offset=0,"scroll clamps at beginning")
    V48Assert(IXFPage([20,80,30,50],100,1).Count=1,"wrapped rows fit as complete units")
}
PAFTestScrollUI()
{
    global IP,IPM
    savedIP := IP,savedIPM := IPM
    try {
        IP := IPNewApp(),IPM := IPMNewState(),IPM.Editing := true
        p := IPM.Panels["FightFeedback"],p.Width := 350,p.Height := 280,p.AutoHeight := false
        IPMEnsureGui("FightFeedback",0,p)
        data := {Rows:[{At:0,Label:"Rage",Text:"5 stacks",Color:"FFFFFF"}],Start:100000,Note:"Live · Tyth",Empty:"",Finished:false}
        Loop 60
            data.Rows.Push({At:100000+A_Index*1000,Label:IPMTime(A_Index),Text:"Finding " A_Index " with wrapped explanatory text",Color:"FF9CA8"})
        IXFRender({},p,data,"Progression Assistance"),p.Gui.Show("NA x20 y20")
        V48Assert(p.VisibleRows>1 && p.VisibleRows<=24 && p.FeedbackState.Max>0,"large history uses the existing control pool")
        V48Assert(p.Rows[1].Name.Text="5 stacks" && InStr(p.Rows[p.VisibleRows].Name.Text,"Finding 60"),"counter stays pinned while live view follows newest finding")
        V48Assert(p.FeedbackScroll.Visible && p.FeedbackScroll.Enabled,"unlocked history has a usable scrollbar")
        IXFScrollMessage(6,p.FeedbackScroll.Hwnd,0x115,p.Gui.Hwnd)
        V48Assert(p.FeedbackState.Offset=0 && InStr(p.Rows[2].Name.Text,"Finding 1 "),"scrollbar can reach earliest finding")
        data.Rows.Push({At:200000,Label:"01:40",Text:"New finding",Color:"FFFFFF"})
        IXFRender({},p,data,"Progression Assistance")
        V48Assert(p.FeedbackState.Offset=0,"new events do not pull the user away from older history")
        IXFScrollMessage(7,p.FeedbackScroll.Hwnd,0x115,p.Gui.Hwnd)
        V48Assert(p.Rows[p.VisibleRows].Name.Text="New finding","bottom command restores latest finding")
        IXFWheelMessage((-120 & 0xFFFF)<<16,0,0x20A,p.Rows[2].Name.Hwnd)
        V48Assert(p.FeedbackState.Offset<=p.FeedbackState.Max,"wheel messages remain within range")
        IPM.Editing := false,offset := p.FeedbackState.Offset
        IXFScrollMessage(6,p.FeedbackScroll.Hwnd,0x115,p.Gui.Hwnd)
        V48Assert(p.FeedbackState.Offset=offset,"locked game overlay does not consume scrolling")
        for i in [1,p.VisibleRows] {
            p.Rows[i].Name.GetPos(&x,&y,&w,&h)
            V48Assert(x+w<=p.Layout.W && y+h<=p.Layout.H,"scrolled text fits the body")
        }
        data.Rows := [data.Rows[1]],data.Start := 300000
        IXFRender({},p,data,"Progression Assistance")
        V48Assert(!p.FeedbackScroll.Visible && p.VisibleRows=1 && p.FeedbackState.Offset=0,"next pull resets scroll and hides surplus controls")
        IPMRetirePanels([p])
        V48Assert(!p.HasOwnProp("FeedbackState") && !IPMUiHandle(p.FeedbackScroll),"teardown clears scrollbar and retained data")
        IXFScrollMessage(0,0,0x115,0)
    }
    finally {
        IPMRetirePanels(IPMAllPanels()),IP := savedIP,IPM := savedIPM
    }
}

IPLRTestPrefs()
{
    global IPLR,IP,SETTINGS_FILE,persistenceTestMode
    old := {State:IPLR,App:IP,Path:SETTINGS_FILE,Mode:persistenceTestMode}
    path := A_Temp "\Iris-reopen-prefs-" DllCall("GetCurrentProcessId") ".ini"
    try {
        if FileExist(path)
            FileDelete(path)
        SETTINGS_FILE := path,persistenceTestMode := false,IP := IPNewApp(),IPLR := IPLRNewState()
        IPLRLoadPrefs(),IPLRSave()
        V48Assert(!IPLR.Enabled && !FileExist(path),"remembering is opt-in and default load/save is inert")
        IniWrite("keep",path,"Other","Setting"),popup := Menu(),IPLRAttachMenu(popup),IPLRSetEnabled(true)
        V48Assert(DllCall("GetMenuState","Ptr",popup.Handle,"UInt",0,"UInt",0x400,"UInt") & 8,"native setting checkmark turns on")
        d := IPNewData("private"),d.SourcePath := A_Temp "\a log Ω.txt",d.SourceEncoding := "UTF-8"
        d.Finished := true,d.ProgressionComplete := true,d.Segments := [{Start:12345}]
        IP.Offline := d,IP.View := "Imported",IP.Selected := 1,IP.Actor := "@Player#123",IPLRSave()
        IPLR := IPLRNewState(),IPLRLoadPrefs()
        V48Assert(IPLR.Enabled && IPLR.Saved.Path=d.SourcePath && IPLR.Saved.Start=12345 && IPLR.Saved.Actor=IP.Actor,"next initialization restores Unicode path and selected fight/player")
        before := IniRead(path,"IrisWorkspace","LastLoadedLog"),d.ProgressionComplete := false,IPLRSave()
        V48Assert(IniRead(path,"IrisWorkspace","LastLoadedLog")==before,"incomplete import preserves previous bookmark")
        d.ProgressionComplete := true,IP.ImportRunning := {},IPLRSave()
        V48Assert(IniRead(path,"IrisWorkspace","LastLoadedLog")==before,"exit during import cannot replace bookmark")
        IP.ImportRunning := false,IPLRSetEnabled(false)
        V48Assert(IniRead(path,"IrisWorkspace","ReopenLastLog",1)="0" && IniRead(path,"IrisWorkspace","LastLoadedLog","bad")="","disabling forgets saved file")
        V48Assert(IniRead(path,"Other","Setting")="keep","unrelated settings preserved")
        for invalid in ["bad","[]",'[1,"","UTF-8",0,""]','[1,"x","UTF-8",-2,""]','[1,"x","UTF-8",0,[]]']
            V48Assert(!IsObject(IPLRDecode(invalid)),"invalid bookmark is ignored")
    }
    finally {
        IPLRCancel(),IPLR := old.State,IP := old.App,SETTINGS_FILE := old.Path,persistenceTestMode := old.Mode
        if FileExist(path)
            FileDelete(path)
    }
}
IPLRTestGuards()
{
    global IPLR,IP
    old := IPLR
    try {
        s := IPLRNewState(),app := IPNewApp(),s.Saved := {Path:"private",Encoding:"UTF-8",Start:-1,Actor:""}
        V48Assert(!IPLRArm(s,app),"disabled cannot arm")
        s.Enabled := true
        V48Assert(!IPLRArm(s,app,true),"test startup never arms")
        V48Assert(IPLRArm(s,app) && !IPLRArm(s,app),"startup request arms once")
        V48Assert(IPLRDecision(s,app)="Open" && IPLRDecision(s,app,true)="Wait","reader waits without taking over")
        V48Assert(IPLRDecision(s,app,false,true)="Cancel","diagnostics cancels restore")
        for prop in ["Live","Offline","ImportFile"] {
            app.%prop% := {}
            V48Assert(IPLRDecision(s,app)="Cancel","manual work takes precedence: " prop)
            app.%prop% := ""
        }
        app.Active := true
        V48Assert(IPLRDecision(s,app)="Cancel","active parser is not replaced")
        app.Active := false,app.Queue.Push({})
        V48Assert(IPLRDecision(s,app)="Cancel","queued live data is not replaced")
        IPLR := s,live := IP.Live,offline := IP.Offline
        V48Assert(!IPLRRun() && !IPLR.Pending && IP.Live=live && IP.Offline=offline,"startup callback is inert in diagnostics")
    }
    finally IPLRCancel(),IPLR := old
}
IPLRTestRestore() => V761LibraryFixture(IPLRTestRestoreBody)
IPLRTestRestoreBody(e,f)
{
    global IP,IPLR,SETTINGS_FILE,persistenceTestMode,Audio
    old := {State:IPLR,Path:SETTINGS_FILE,Mode:persistenceTestMode,Live:IP.Live}
    path := A_Temp "\Iris-reopen-import-" DllCall("GetCurrentProcessId") ".ini"
    hash := IPCHashFile(f.Path),audioCount := Audio.Queue.Length
    try {
        SETTINGS_FILE := path,persistenceTestMode := false,IPLR := IPLRNewState(),IPLRSetEnabled(true)
        IP.Live := "",IP.Offline := ""
        IPLR.Saved := {Path:f.Path,Encoding:"UTF-8",Start:f.State.Segments[1].Start,Actor:"@Demo Tank#101"}
        V48Assert(IPLRBegin(IPLR,IP) && IsObject(IPLR.Loading),"bookmark enters actual importer")
        IPImportRun(),IPRefresh()
        V48Assert(IP.Offline.ProgressionComplete && IP.Selected=1 && !IP.Follow && IP.Actor="@Demo Tank#101","completed multi-pull file restores selected earlier fight/player: " IP.Selected " / " IP.Follow " / " IP.Actor " / " IP.Status)
        V48Assert(InStr(IP.Status,"Reopened last loaded log") && !IsObject(IPLR.Loading),"one-shot restore finishes cleanly")
        IPLRSave(),IPLR := IPLRNewState(),IPLRLoadPrefs(),IP.Offline := "",IP.Selected := 0
        V48Assert(IPLRBegin(IPLR,IP),"saved bookmark survives a fresh initialization")
        IPImportRun(),IPRefresh()
        V48Assert(IP.ImportTiming.Cache="disk hit" && IP.Selected=1 && !IP.Follow,"normal saved-result cache restores same selection")
        IP.Offline := "",saved := IPLR.Saved,IPLR.Saved := saved.Clone(),IPLR.Saved.Path .= ".missing"
        V48Assert(!IPLRBegin(IPLR,IP) && InStr(IP.Status,"moved or deleted") && !IsObject(IP.ImportFile),"missing log reports status without creating an import")
        IPLR.Saved := saved
        V48Assert(IPLRBegin(IPLR,IP),"prepare cancellable restore")
        IPStop()
        V48Assert(!IsObject(IPLR.Loading) && !IP.Offline.ProgressionComplete,"cancelled restore cannot reselect an old fight")
        V48Assert(IPCHashFile(f.Path)=hash && Audio.Queue.Length=audioCount && !IP.Active,"restore preserves source and does not start parsing or queue audio")
    }
    finally {
        IPLRCancel(),IPLR := old.State,SETTINGS_FILE := old.Path,persistenceTestMode := old.Mode,IP.Live := old.Live
        if FileExist(path)
            FileDelete(path)
    }
}

; Public aggregate fixtures are independent target totals from Parsely, not raid replays.
V7881ParselyBossTargets() => V58Isolated(V7881ParselyBossTargetsCase)
V7881ParselyBossPipeline() => V58Isolated(V7881ParselyBossPipelineCase)

V7881ParselyBossTargetsCase()
{
    fixtures := V7881ParselyPublicFixtures()
    for f in fixtures {
        p := IPXProfiles().Get(f.Key,"")
        ctx := {BossKey:f.Key,Profile:p,AreaId:IsObject(p) ? p.Area : "",ModeId:IsObject(p) ? p.Mode : "",
            Actors:Map(),Rows:Map(),Totals:Map("@Fixture#1",{})}
        cached := {TargetDamage:Map()},total := 0
        for i,row in f.Targets {
            actor := IPActor(row.Name " {" row.Id "}:" i)
            ctx.Actors[actor.Key] := actor
            ctx.Rows[i] := {Kind:"Damage",Actor:"@Fixture#1",Other:actor.Key,Total:row.Damage}
            IRBTAdd(cached.TargetDamage,"@Fixture#1",actor.Key,row.Damage)
            actual := IADefaultTargetClass(ctx,actor)="Boss"
            V48Assert(actual=row.Boss,f.Name " / " row.Name " has the published target membership")
            if actual
                total += row.Damage
        }
        V48Assert(total=f.Damage,f.Name " reproduces public boss damage total")
        V48Assert(Abs(total/f.Seconds-f.DPS)<0.1,f.Name " reproduces published Boss DPS within endpoint rounding")
        V48Assert(IRBTDamage(ctx,ctx,"bosses").Get("@Fixture#1",0)=f.Damage,f.Name " counted-row Raid path")
        V48Assert(IRBTDamage(ctx,cached,"bosses").Get("@Fixture#1",0)=f.Damage,f.Name " cached-target Raid path")
    }
    V48Assert(fixtures.Length=35,"35 independently collected public encounter examples")
    ctx := {BossKey:"TFB-TF",Profile:"",AreaId:"",ModeId:""}
    V48Assert(IADefaultTargetClass(ctx,IPActor("Localized name {3025284768989184}:1"))="Boss","NPC identity survives translated names")
    V48Assert(IADefaultTargetClass(ctx,IPActor("Grasping Tentacle {9999999999999999}:1"))!="Boss","display-name match alone never counts")
    V48Assert(IADefaultTargetClass(ctx,IPActor("@Grasping Tentacle#1"))="Player / companion","player cannot become a boss by name")
    ctx.BossKey := "G-NA"
    V48Assert(IADefaultTargetClass(ctx,IPActor("Grasping Tentacle {3025284768989184}:1"))!="Boss","another encounter cannot claim a known target")
    ctx.BossKey := ""
    V48Assert(IADefaultTargetClass(ctx,IPActor("Grasping Tentacle {3025284768989184}:1"))="Boss","partial encounter still recognizes known boss parts")
    ctx.BossKey := "TFB-TF-SM"
    V48Assert(IADefaultTargetClass(ctx,IPActor("Tentacle {2988545618739200}:1"))="Boss","known alternate-mode identity matches encounter family")
    ctx.BossKey := "DX-E1",ctx.Profile := IPXProfiles()["DX-E1"]
    V48Assert(IADefaultTargetClass(ctx,IPActor("Secondary Generator {4258451484049408}:1"))!="Boss","objective used for completion is not a boss damage target")
    ctx.BossKey := "DP-BE",ctx.Profile := IPXProfiles()["DP-BE"]
    V48Assert(IADefaultTargetClass(ctx,IPActor("Reward {3313339635597312}:1"))="Object","reward marker remains an object")
    ctx.BossKey := "DF-BR",ctx.Profile := IPXProfiles()["DF-BR"]
    actor := IPActor("Hand of Brontes {3303276527222784}:1")
    V48Assert(IRDefaultHPTargetIds().Has("3303276527222784") && IADefaultTargetClass(ctx,actor)!="Boss","six-finger phase hand remains an HP target but is excluded from Parsely boss damage")
}

V7881ParselyBossPipelineCase()
{
    global IP,IPM
    s := IPNewData("Synthetic Terror target regression")
    s.AreaId := "137438992720",s.ModeId := "836045448953655"
    seg := IPNewSegment(s,0,"observed combat entry"),seg.BossKey := "TFB-TF",seg.Profile := IPXProfiles()["TFB-TF"]
    s.AnalysisCapture := IACaptureNew(0,10000)
    p := "@Damage One#1",q := "@Damage Two#2"
    left := "Tunneling Tentacle {3025258999185408}:10",right := "Tunneling Tentacle {3025271884087296}:11"
    grasp := "Grasping Tentacle {3025284768989184}:12",body := "Terror {3025233229381632}:13"
    larva := "Unstable Larva {3025155919970304}:14",irregularity := "Hypergate Irregularity {3051204896620544}:15"
    for row in [[1000,p,left,100],[2000,q,right,200],[4000,p,grasp,300],[7000,q,body,400],
        [8000,p,larva,500],[9000,q,irregularity,600],[10000,body,p,50]]
        V66PhaseApplyLine(s,IPDemoLine(row[1],row[2],row[3],"Damage",row[4]),row[1])
    seg.End := seg.Last,before := IAFrozenTarget(seg)
    d := IAAssemble(s,seg,s.AnalysisCapture),d.BaseVerified := true
    IAEffectsBuild(d),IAShieldsBuild(d)
    r := IAQuery(d,IANewQuery(d,"",0,-1,"Bosses"))
    V48Assert(r.D=1000 && r.BossD=1000 && r.Duration=10,"Analysis counts both kinds of tentacles and body over whole-fight duration")
    V48Assert(IAQuery(d,IANewQuery(d,p)).D=900 && IAQuery(d,IANewQuery(d,q)).D=1200,"ordinary outgoing damage stays unchanged")
    V48Assert(IAQuery(d,IANewQuery(d,p,0,-1,"Bosses")).D=400,"player analysis has the same membership")
    phase := IAQuery(d,IANewQuery(d,"",4,10,"Bosses"))
    V48Assert(phase.D=700 && phase.Duration=6,"Analysis phase counts only interval boss hits with interval denominator")
    raid := IRBTDamage(seg,seg,"bosses")
    V48Assert(raid[p]=400 && raid[q]=600,"Raid all-bosses matches Analysis")
    cached := {TargetDamage:Map()}
    for ev in d.Rows {
        if ev.Analysis.Accepted && ev.Analysis.At>=4000 && ev.Analysis.D>0
            IRBTAdd(cached.TargetDamage,ev.Source.Key,ev.Target.Key,ev.Analysis.D)
    }
    phaseRaid := IRBTDamage(seg,cached,"bosses")
    V48Assert(phaseRaid[p]=300 && phaseRaid[q]=400,"cached phase targets agree with cropped Analysis")
    IPM.Shown["BossDamage"] := true,snapshot := {Actors:[{Key:p},{Key:q}]}
    IRBOSnapshot(seg,snapshot)
    V48Assert(snapshot.Actors[1].BossDamage=400 && snapshot.Actors[2].BossDamage=600,"Boss Damage overlay uses the same totals")
    ; Native calculations enter this same assembly stage after event values exist.
    w := {Rows:s.AnalysisCapture.Rows,Seed:s.AnalysisCapture.Seed,
        NativeCalculation:{AutomaticPhases:[],Totals:Map()}}
    native := IAAssemble(s,seg,w)
    V48Assert(IAQuery(native,IANewQuery(native,"",0,-1,"Bosses")).D=1000,"precalculated native-analysis path shares membership")
    V48Assert(!IABaseReconcile(seg,before).Length && seg.Last=10000 && !s.Current.Terminal,"filters preserve counted totals, duration, and encounter completion")
}

; Aggregate fixtures from public reports; no private player identities.
V7881ParselyPublicFixtures()
{
    cases := []
    ; https://parsely.io/parser/view/1247900/0/690074400458869
    cases.Push({Key:"DF-BR",Name:"Dread Master Brontes",Seconds:429.176,Damage:8001428,DPS:18643.7,Targets:[
        {Id:"3275625527771136",Name:"Right Hand of Brontes",Damage:910954,Boss:true},
        {Id:"3275642707640320",Name:"Finger of Brontes",Damage:226402,Boss:false},
        {Id:"3277721471811584",Name:"Left Hand of Brontes",Damage:975451,Boss:true},
        {Id:"3280057934020608",Name:"Energy Sphere",Damage:11629,Boss:false},
        {Id:"3298281480257536",Name:"Reach of Brontes",Damage:78576,Boss:false},
        {Id:"3298281480257536",Name:"Reach of Brontes",Damage:169688,Boss:false},
        {Id:"3303529930293248",Name:"Dread Master Brontes",Damage:6039407,Boss:true},
        {Id:"3309040373334016",Name:"Corrupted Clone",Damage:206754,Boss:false},
        {Id:"3300910000242688",Name:"Unshielded D-09 Droid",Damage:1000570,Boss:false},
        {Id:"3275642707640320",Name:"Finger of Brontes",Damage:1082130,Boss:false},
        {Id:"3303276527222784",Name:"Hand of Brontes",Damage:660821,Boss:false},
        {Id:"3314958838267904",Name:"Hand of Brontes",Damage:21280,Boss:true},
        {Id:"3314013945462784",Name:"Hand of Brontes",Damage:54336,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1268805/0/690048597752185
    cases.Push({Key:"TFB-OP",Name:"Operator IX",Seconds:348.325,Damage:7025760,DPS:20170.13,Targets:[
        {Id:"3014487221207040",Name:"Defragmenter",Damage:25868,Boss:false},
        {Id:"2994915055239168",Name:"Master Control",Damage:0,Boss:false},
        {Id:"2965571838672896",Name:"Blue Sphere",Damage:99682,Boss:false},
        {Id:"2994953709944832",Name:"Recognizer",Damage:336541,Boss:false},
        {Id:"2994867810598912",Name:"Data Core",Damage:2287118,Boss:true},
        {Id:"2994880695500800",Name:"Regulator",Damage:65899,Boss:false},
        {Id:"2965649148084224",Name:"Yellow Sphere",Damage:24672,Boss:false},
        {Id:"2994837745827840",Name:"Operator IX",Damage:4738642,Boss:true},
        {Id:"2994953709944832",Name:"Recognizer",Damage:117252,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1235388/24/689861198314476
    cases.Push({Key:"SNV-ST",Name:"Dread Master Styrak",Seconds:583.917,Damage:13689570,DPS:23444.38,Targets:[
        {Id:"3067057620910080",Name:"Kell Dragon",Damage:3444554,Boss:true},
        {Id:"3141665497808896",Name:"Dread Master Styrak",Damage:5975,Boss:false},
        {Id:"3152407211016192",Name:"Dread Master Styrak",Damage:7320824,Boss:true},
        {Id:"3210887485718528",Name:"Ashara Zavros",Damage:290945,Boss:false},
        {Id:"3141665497808896",Name:"Dread Master Styrak",Damage:26096,Boss:false},
        {Id:"3141665497808896",Name:"Dread Master Styrak",Damage:2712330,Boss:false},
        {Id:"3141665497808896",Name:"Dread Master Styrak",Damage:26881,Boss:false},
        {Id:"3141665497808896",Name:"Dread Master Styrak",Damage:33641,Boss:false},
        {Id:"3141665497808896",Name:"Dread Master Styrak",Damage:1179192,Boss:false},
        {Id:"3225679353085952",Name:"Kell Dragon",Damage:2924192,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1274600/23/690171057950654
    cases.Push({Key:"G-NA",Name:"Nahut",Seconds:417.837,Damage:10558225,DPS:25268.77,Targets:[
        {Id:"4122949560827904",Name:"NAHUT",Damage:10558225,Boss:true},
        {Id:"4122580193640448",Name:"Singularity Chamber",Damage:0,Boss:false},
        {Id:"4131857322999808",Name:"Power Coupling",Damage:843543,Boss:false},
        {Id:"4131857322999808",Name:"Power Coupling",Damage:917051,Boss:false},
        {Id:"4132742086262784",Name:"Extermination Droid",Damage:283738,Boss:false},
        {Id:"4183169297285120",Name:"Maintenance Drone",Damage:91391,Boss:false},
        {Id:"4132746381230080",Name:"Rail Turret",Damage:413265,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1211788/38/689481191312961
    cases.Push({Key:"G-SC",Name:"Scyva",Seconds:450.716,Damage:7414433,DPS:16450.34,Targets:[
        {Id:"4126527268585472",Name:"Omega Protocol Droid",Damage:1922052,Boss:false},
        {Id:"4126540153487360",Name:"Stasis Swarm Droid",Damage:693670,Boss:false},
        {Id:"4126522973618176",Name:"CFA-Railgun",Damage:714388,Boss:false},
        {Id:"4126553038389248",Name:"Ignition Catalyst",Damage:1493304,Boss:false},
        {Id:"4126522973618176",Name:"CFA-Railgun",Damage:2716020,Boss:false},
        {Id:"4126690477342720",Name:"Purge Beam Emitter",Damage:606791,Boss:false},
        {Id:"4108140513591296",Name:"SCYVA",Damage:7414433,Boss:true},
        {Id:"4158786767945728",Name:"Iokath Control Center",Damage:0,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1251730/52/689276242697095
    cases.Push({Key:"G-IZ",Name:"Izax",Seconds:817.302,Damage:29886748,DPS:36567.57,Targets:[
        {Id:"4108097563918336",Name:"IZAX",Damage:29886748,Boss:true},
        {Id:"4159890574540800",Name:"Electro-Tether Droid",Damage:259951,Boss:false},
        {Id:"4161084575449088",Name:"Energy Drone",Damage:37136,Boss:false},
        {Id:"4160740978065408",Name:"Anchor Drone",Damage:590996,Boss:false},
        {Id:"4160753862967296",Name:"Amplifier",Damage:0,Boss:false},
        {Id:"4166255716073472",Name:"Hull Cutter Drone",Damage:11094534,Boss:false},
        {Id:"4159890574540800",Name:"Electro-Tether Droid",Damage:140766,Boss:false},
        {Id:"4159890574540800",Name:"Electro-Tether Droid",Damage:668247,Boss:false},
        {Id:"4163412447723520",Name:"Makeshift Energy Drone",Damage:210454,Boss:false},
        {Id:"4163309368508416",Name:"Makeshift Amplifier Drone",Damage:0,Boss:false},
        {Id:"4164821196996608",Name:"Tether Drone",Damage:427739,Boss:false},
        {Id:"4164872736604160",Name:"Combat Mine",Damage:95802,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1207343/0/689216292828545
    cases.Push({Key:"TOS-RE",Name:"Revan",Seconds:391.319,Damage:10375369,DPS:26513.84,Targets:[
        {Id:"3431605855059968",Name:"Revan",Damage:4986360,Boss:true},
        {Id:"3444310368321536",Name:"HK-47",Damage:1230061,Boss:true},
        {Id:"3514880975962112",Name:"Meatbag Entropy Enhancer",Damage:159053,Boss:false},
        {Id:"3440805675008000",Name:"Machine Focus",Damage:454879,Boss:false},
        {Id:"3452578180366336",Name:"Blade of Revan",Damage:81029,Boss:false},
        {Id:"3449584588161024",Name:"Unstable Aberration",Damage:8411,Boss:false},
        {Id:"3447583133401088",Name:"Machine Core",Damage:4158948,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1290407/0/689521909456184
    cases.Push({Key:"DX-HMM",Name:"The Huntmaster",Seconds:132.481,Damage:4029214,DPS:30413.52,Targets:[
        {Id:"4265104388390912",Name:"Huntmaster",Damage:2669437,Boss:true},
        {Id:"4383765744844800",Name:"Venomous Flier",Damage:88357,Boss:false},
        {Id:"4330237567434752",Name:"Shelleigh",Damage:1359777,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1207973/0/689893714260604
    cases.Push({Key:"EC-KE",Name:"Warlord Kephess",Seconds:417.43399999999997,Damage:6271915,DPS:15024.93,Targets:[
        {Id:"2876515691790336",Name:"Imperial Siege Droid",Damage:1694384,Boss:false},
        {Id:"2876532871659520",Name:"Warstrider Battlewalker",Damage:2517220,Boss:true},
        {Id:"2876524281724928",Name:"Baradium Bomber",Damage:917317,Boss:false},
        {Id:"2876511396823040",Name:"Trandoshan Warrior",Damage:141903,Boss:false},
        {Id:"2876507101855744",Name:"Trandoshan Trenchcutter",Damage:816416,Boss:false},
        {Id:"2876519986757632",Name:"Pulsar Power Droid",Damage:1922926,Boss:false},
        {Id:"2876528576692224",Name:"Warlord Kephess",Damage:3754695,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1206533/20/690526847130024
    cases.Push({Key:"SNV-OL",Name:"Olok the Shadow",Seconds:688.919,Damage:7031150,DPS:10206.06,Targets:[
        {Id:"3061057551597568",Name:"Bodyguard",Damage:1390443,Boss:false},
        {Id:"3067130635354112",Name:"Wealthy Buyer",Damage:788673,Boss:false},
        {Id:"3256920945197056",Name:"IA-82 Artillery Droid",Damage:1628495,Boss:false},
        {Id:"3016810798514176",Name:"MA-9 Frontline Droid",Damage:1427225,Boss:false},
        {Id:"3016819388448768",Name:"P-2B Assault Droid",Damage:3166694,Boss:false},
        {Id:"3129794208202752",Name:"PX-7 Recon Droid",Damage:2384069,Boss:false},
        {Id:"3154662068846592",Name:"Olok the Shadow",Damage:7031150,Boss:true},
        {Id:"3235506238259200",Name:"Shady Customer",Damage:336941,Boss:false},
        {Id:"3252041862348800",Name:"Underworld Arms Trader",Damage:335937,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1182231/0/689144463775817
    cases.Push({Key:"EC-VO",Name:"Colonel Vorgath",Seconds:239.96,Damage:6642863,DPS:27683.21,Targets:[
        {Id:"2813182104043520",Name:"Colonel Vorgath",Damage:0,Boss:false},
        {Id:"2854151797080064",Name:"Imperial Demolitions Probe",Damage:2400058,Boss:true},
        {Id:"2854177566883840",Name:"Defected Imperial Trooper",Damage:131905,Boss:false},
        {Id:"2854147502112768",Name:"Imperial Assassin Droid",Damage:2732,Boss:false},
        {Id:"2854117437341696",Name:"Colonel Vorgath",Damage:4242805,Boss:true},
        {Id:"2854164681981952",Name:"Defected Imperial Commander",Damage:118988,Boss:false},
        {Id:"2854211926622208",Name:"Automated Defense Turret",Damage:2538,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1234652/7/690127008483680
    cases.Push({Key:"DP-CA",Name:"Dread Master Calphayus",Seconds:374.786,Damage:3750931,DPS:10008.19,Targets:[
        {Id:"3273946195558400",Name:"Dread Master Calphayus",Damage:3750931,Boss:true},
        {Id:"3284949901770752",Name:"Dread Master Calphayus",Damage:1319795,Boss:false},
        {Id:"3298453278949376",Name:"Dread Ravager",Damage:704533,Boss:false},
        {Id:"3298457573916672",Name:"Dread Despoiler",Damage:638703,Boss:false},
        {Id:"3298461868883968",Name:"Dread Corruptor",Damage:0,Boss:false},
        {Id:"3284949901770752",Name:"Dread Master Calphayus",Damage:1372004,Boss:false},
        {Id:"3349915577090048",Name:"Empowering Energy",Damage:840024,Boss:false},
        {Id:"3350598476890112",Name:"Guardian of Knowledge",Damage:254539,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1239314/0/690115468962455
    cases.Push({Key:"RAV-MB",Name:"Master & Blaster",Seconds:319.67,Damage:9610465,DPS:30063.71,Targets:[
        {Id:"3458148752949248",Name:"Blaster",Damage:4725002,Boss:true},
        {Id:"3391100018491392",Name:"BO-55 Master Droid",Damage:4885463,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1191420/0/689879859255265
    cases.Push({Key:"EC-ZT",Name:"Toth & Zorn",Seconds:255.007,Damage:9090490,DPS:35648.0,Targets:[
        {Id:"2857549116211200",Name:"Toth",Damage:2599457,Boss:true},
        {Id:"2857544821243904",Name:"Zorn",Damage:5312521,Boss:true},
        {Id:"2855809654456320",Name:"Handler Murdok",Damage:1178512,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1247529/0/690078345634340
    cases.Push({Key:"DP-CO",Name:"Dread Council",Seconds:364.127,Damage:13786339,DPS:37861.35,Targets:[
        {Id:"3273993440198656",Name:"Dread Master Raptus",Damage:5097935,Boss:true},
        {Id:"3273997735165952",Name:"Dread Master Tyrans",Damage:3097125,Boss:true},
        {Id:"3273989145231360",Name:"Dread Master Calphayus",Damage:1037023,Boss:true},
        {Id:"3273984850264064",Name:"Dread Master Bestia",Damage:959742,Boss:true},
        {Id:"3274019210002432",Name:"Dread Master Brontes",Damage:2066592,Boss:true},
        {Id:"3303830578003968",Name:"Dread Master Styrak",Damage:1527922,Boss:true},
        {Id:"3355541984247808",Name:"Dread Master Styrak",Damage:216650,Boss:false},
        {Id:"3355894171566080",Name:"Reach of Brontes",Damage:49197,Boss:false},
        {Id:"3355894171566080",Name:"Reach of Brontes",Damage:83928,Boss:false},
        {Id:"3355894171566080",Name:"Reach of Brontes",Damage:121003,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1223300/11/689144290704850
    cases.Push({Key:"R4-IP",Name:"IP-CPT",Seconds:407.136,Damage:5753213,DPS:14130.94,Targets:[
        {Id:"4494653210492928",Name:"IP-CPT",Damage:5753213,Boss:true},
        {Id:"4470451069779968",Name:"Intrusion ID Unit",Damage:117741,Boss:false},
        {Id:"4470451069779968",Name:"Intrusion ID Unit",Damage:71649,Boss:false},
        {Id:"4480196350574592",Name:"Overload Enforcer",Damage:1025425,Boss:false},
        {Id:"4480200645541888",Name:"Inferno Enforcer",Damage:1000868,Boss:false},
        {Id:"4471288588402688",Name:"Pulse Turret",Damage:1112403,Boss:false},
        {Id:"4470451069779968",Name:"Intrusion ID Unit",Damage:37436,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1257425/14/689286266122640
    cases.Push({Key:"R4-LD",Name:"Lady Dominique",Seconds:531.271,Damage:16558713,DPS:31168.11,Targets:[
        {Id:"4608014577303552",Name:"Lady Dominique",Damage:16558713,Boss:true},
        {Id:"4594966466658304",Name:"Grey Swarm Thrall",Damage:715970,Boss:false},
        {Id:"4594979351560192",Name:"Grey Detonator",Damage:525699,Boss:false},
        {Id:"4488524292161536",Name:"Watchdog",Damage:442720,Boss:false},
        {Id:"4598393850560512",Name:"Attractor",Damage:552979,Boss:false},
        {Id:"4598393850560512",Name:"Attractor",Damage:268222,Boss:false},
        {Id:"4594975056592896",Name:"Grey Reaper",Damage:295063,Boss:false},
        {Id:"4598380965658624",Name:"Hulking Monstrosity",Damage:133088,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1198742/8/689898503193425
    cases.Push({Key:"DX-E1",Name:"Breach CI-004: Lights Out",Seconds:363.342,Damage:4728236,DPS:13013.18,Targets:[
        {Id:"4333218274738176",Name:"Crimson Stalker",Damage:2875484,Boss:false},
        {Id:"4333218274738176",Name:"Crimson Stalker",Damage:1778384,Boss:false},
        {Id:"4389417921806336",Name:"Czerka Pursuit Droid",Damage:1722798,Boss:true},
        {Id:"4250514384486400",Name:"Rampaging Charger",Damage:500799,Boss:false},
        {Id:"4250686183178240",Name:"Shadow Walker",Damage:642604,Boss:false},
        {Id:"4250454254944256",Name:"Incendiary Shriek",Damage:220272,Boss:false},
        {Id:"4245686841245696",Name:"Czerka Warden Droid",Damage:3005438,Boss:true},
        {Id:"4256042007396352",Name:"Felshade Hunter",Damage:3163467,Boss:false},
        {Id:"4333471677808640",Name:"Felshade Reaper",Damage:391866,Boss:false},
        {Id:"4333471677808640",Name:"Felshade Reaper",Damage:839366,Boss:false},
        {Id:"4256042007396352",Name:"Felshade Hunter",Damage:463536,Boss:false},
        {Id:"4251424917553152",Name:"Living Smoke",Damage:0,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1211239/8/689439997665998
    cases.Push({Key:"DX-E2",Name:"Breach CI-004: According to Plan",Seconds:124.716,Damage:1881464,DPS:15085.99,Targets:[
        {Id:"4256042007396352",Name:"Felshade Hunter",Damage:1702864,Boss:false},
        {Id:"4333458792906752",Name:"Crimson Stalker",Damage:98777,Boss:false},
        {Id:"4250686183178240",Name:"Shadow Walker",Damage:311397,Boss:false},
        {Id:"4338552624119808",Name:"Czerka Warden Enforcer Droid",Damage:548990,Boss:true},
        {Id:"4390577562976256",Name:"Czerka Sanitizer Droid",Damage:1332474,Boss:true},
        {Id:"4250475729780736",Name:"Felshade Reaper",Damage:118071,Boss:false},
        {Id:"4250475729780736",Name:"Felshade Reaper",Damage:115433,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1192453/9/690051315895910
    cases.Push({Key:"DP-RA",Name:"Dread Master Raptus",Seconds:71.178,Damage:1617630,DPS:22726.54,Targets:[
        {Id:"3302902865068032",Name:"Dread Master Raptus",Damage:1617630,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1314814/0/690583009356395
    cases.Push({Key:"RAV-CR",Name:"Coratanni",Seconds:344.183,Damage:11165431,DPS:32440.39,Targets:[
        {Id:"3371437658210304",Name:"Coratanni",Damage:2264050,Boss:true},
        {Id:"3374109127868416",Name:"Pearl",Damage:2791497,Boss:true},
        {Id:"3378206526668800",Name:"Weapons Specialist",Damage:135262,Boss:false},
        {Id:"3378197936734208",Name:"Navigator",Damage:93577,Boss:false},
        {Id:"3378202231701504",Name:"Security Chief",Damage:87511,Boss:false},
        {Id:"3378210821636096",Name:"Pilot",Damage:62994,Boss:false},
        {Id:"3371441953177600",Name:"Ruugar",Damage:6109884,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1181535/0/688250065447455
    cases.Push({Key:"G-AE",Name:"Aivela and Esne",Seconds:479.578,Damage:11992947,DPS:25007.29,Targets:[
        {Id:"4105254295568384",Name:"Codex",Damage:818155,Boss:false},
        {Id:"4101564918661120",Name:"Nexus",Damage:1505399,Boss:false},
        {Id:"4088525397950464",Name:"AIVELA",Damage:8751189,Boss:true},
        {Id:"4109905745149952",Name:"Countermeasure",Damage:1137381,Boss:false},
        {Id:"4088538282852352",Name:"ESNE",Damage:3241758,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1314630/0/690129569085075
    cases.Push({Key:"XR-53",Name:"Propagator Core XR-53",Seconds:386.595,Damage:11813984,DPS:30559.07,Targets:[
        {Id:"4847325860069376",Name:"Propagator Core XR-53",Damage:11813984,Boss:true},
        {Id:"4845470434197504",Name:"Imperfect Construct",Damage:2339842,Boss:false},
        {Id:"4829566170300416",Name:"Prey Seeker Droid",Damage:342312,Boss:false},
        {Id:"4831722243883008",Name:"Rampaging Construct",Damage:819059,Boss:false},
        {Id:"4831533265321984",Name:"Supplicant Construct",Damage:554444,Boss:false},
        {Id:"4861868619333632",Name:"Collection Droid",Damage:0,Boss:false},
        {Id:"4831241207545856",Name:"Defender Construct",Damage:835286,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1298933/3/688517103794210
    cases.Push({Key:"DX-TR",Name:"Mutant Trandoshan Squad",Seconds:292.737,Damage:10677796,DPS:36475.73,Targets:[
        {Id:"4245987488956416",Name:"Titax",Damage:271972,Boss:true},
        {Id:"4245978899021824",Name:"Greus",Damage:3543608,Boss:true},
        {Id:"4245983193989120",Name:"Kronissus",Damage:2056458,Boss:true},
        {Id:"4245970309087232",Name:"Hissyphus",Damage:2076756,Boss:true},
        {Id:"4381150109761536",Name:"The Ultimate Hunter",Damage:2729002,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1282314/5/690159649510088
    cases.Push({Key:"DP-BE",Name:"Dread Master Bestia",Seconds:267.224,Damage:8880420,DPS:33232.12,Targets:[
        {Id:"3273941900591104",Name:"Dread Master Bestia",Damage:4966509,Boss:true},
        {Id:"3292079547482112",Name:"Dread Larva",Damage:613428,Boss:false},
        {Id:"3291675820556288",Name:"Dread Monster",Damage:3913911,Boss:true},
        {Id:"3292083842449408",Name:"Dread Tentacle",Damage:675607,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1229871/8/690134132765057
    cases.Push({Key:"DF-DR",Name:"Draxus",Seconds:261.5,Damage:3477012,DPS:13296.36,Targets:[
        {Id:"3303392491339776",Name:"Gate Commander Draxus",Damage:3477012,Boss:true},
        {Id:"3281320654405632",Name:"Subteroth",Damage:1212208,Boss:false},
        {Id:"3288141062471680",Name:"Dread Guard Dispatcher",Damage:700891,Boss:false},
        {Id:"3281329244340224",Name:"Dread Guard Dismantler",Damage:445130,Boss:false},
        {Id:"3281329244340224",Name:"Dread Guard Dismantler",Damage:137169,Boss:false},
        {Id:"3288136767504384",Name:"Dread Guard Corrupter",Damage:603508,Boss:false},
        {Id:"3288145357438976",Name:"Dread Guard Bulwark",Damage:403429,Boss:false},
        {Id:"3281324949372928",Name:"Dread Guard Despoiler",Damage:107676,Boss:false},
        {Id:"3317793516683264",Name:"Guardian of the Fortress",Damage:1161742,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1300286/0/690099400628640
    cases.Push({Key:"TFB-WH",Name:"The Writhing Horror",Seconds:231.106,Damage:7954498,DPS:34419.26,Targets:[
        {Id:"3010424182145024",Name:"The Writhing Horror",Damage:7954498,Boss:true},
        {Id:"3010441362014208",Name:"Foul Offspring",Damage:1367852,Boss:false},
        {Id:"3010454246916096",Name:"Jealous Male",Damage:860406,Boss:false},
        {Id:"3020465815683072",Name:"Twisted Spawn",Damage:47170,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1269133/0/689738486271108
    cases.Push({Key:"G-TY",Name:"Tyth",Seconds:276.468,Damage:7580040,DPS:27417.42,Targets:[
        {Id:"4078423634870272",Name:"TYTH",Damage:7580040,Boss:true},
        {Id:"4179016063909888",Name:"Magma Droid",Damage:209739,Boss:false},
        {Id:"4078449404674048",Name:"Lance",Damage:193616,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1233891/19/689631503803560
    cases.Push({Key:"DX-RE",Name:"The Pack Leader",Seconds:119.38900000000001,Damage:5311882,DPS:44492.22,Targets:[
        {Id:"4330233272467456",Name:"Red",Damage:5311882,Boss:true},
        {Id:"4246356856143872",Name:"Stampeding Bull",Damage:157011,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1252855/23/690030066323408
    cases.Push({Key:"DX-AP",Name:"Apex Vanguard",Seconds:781.511,Damage:27756337,DPS:35516.25,Targets:[
        {Id:"4350020186800128",Name:"Apex Vanguard",Damage:27756337,Boss:true},
        {Id:"4297557161279488",Name:"Power Transformer",Damage:316208,Boss:false},
        {Id:"4383022715502592",Name:"CI Anti-Theft Droid",Damage:197978,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1210171/0/689940352919453
    cases.Push({Key:"SNV-TH",Name:"Thrasher",Seconds:99.911,Damage:4001174,DPS:40047.38,Targets:[
        {Id:"3154563284598784",Name:"Thrasher",Damage:4001174,Boss:true},
        {Id:"3048576376635392",Name:"Mercenary Sniper",Damage:106559,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1231650/12/689329949579441
    cases.Push({Key:"SNV-OC",Name:"Operations Chief",Seconds:102.575,Damage:3544262,DPS:34552.88,Targets:[
        {Id:"3157548286869504",Name:"Operations Chief",Damage:3544262,Boss:true},
        {Id:"3158020733272064",Name:"Rail Turret",Damage:220373,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1274543/3/689620634210125
    cases.Push({Key:"TOS-CO",Name:"Revanite Commanders",Seconds:332.332,Damage:6061335,DPS:18238.79,Targets:[
        {Id:"3456894622498816",Name:"Sano Thrica",Damage:1860471,Boss:true},
        {Id:"3457818040467456",Name:"Outlaw Revanite",Damage:2353420,Boss:false},
        {Id:"3457813745500160",Name:"Sith Revanite",Damage:831359,Boss:false},
        {Id:"3457809450532864",Name:"Mandalorian Revanite",Damage:1745451,Boss:false},
        {Id:"3456890327531520",Name:"Deron Cadoruso",Damage:2309643,Boss:true},
        {Id:"3456898917466112",Name:"Lord Kurse",Damage:1891221,Boss:true}
    ]})
    ; https://parsely.io/parser/view/1302825/25/690109797556486
    cases.Push({Key:"TFB-TF",Name:"The Terror From Beyond",Seconds:744.544,Damage:20956624,DPS:28146.92,Targets:[
        {Id:"3025258999185408",Name:"Tunneling Tentacle",Damage:6701040,Boss:true},
        {Id:"3025155919970304",Name:"Unstable Larva",Damage:696760,Boss:false},
        {Id:"3025271884087296",Name:"Tunneling Tentacle",Damage:246286,Boss:true},
        {Id:"3025155919970304",Name:"Unstable Larva",Damage:42120,Boss:false},
        {Id:"3025284768989184",Name:"Grasping Tentacle",Damage:10333433,Boss:true},
        {Id:"3025233229381632",Name:"The Terror From Beyond",Damage:3675865,Boss:true},
        {Id:"3051204896620544",Name:"Hypergate Irregularity",Damage:1125979,Boss:false}
    ]})
    ; https://parsely.io/parser/view/1280867/8/689522095022801
    cases.Push({Key:"EV-IC",Name:"Infernal Council",Seconds:46.665,Damage:1722513,DPS:36912.31,Targets:[
        {Id:"2289840339025920",Name:"Kahesh, the Reborn",Damage:485430,Boss:true},
        {Id:"2289878993731584",Name:"Luthro the Kinslayer",Damage:1237083,Boss:true}
    ]})
    return cases
}

; Native, suspended diagnostic runner only. Audio stays in the test queue;
; V673RecordFixture owns temporary settings and restores runtime state.
V7881RepublicRows()
{
    ; Exact activation IDs independently present in the archived combat logs.
    return [
        ["1003974375243776","Battle Focus","ExplosiveFuel","Battle Focus"],
        ["4547060401438720","Infused Kolto Packs","EnergyYield","Infused Kolto Packs"],
        ["3396893929373696","Riot Gas","OilSlick","Riot Gas"],
        ["801329228283904","Reactive Shield","EnergyShield","Reactive Shield"],
        ["801251918872576","Adrenaline Rush","KoltoOverload","Adrenaline Rush"],
        ["2027503736586240","Neural Surge","Carbonize","Neural Surge"],
        ["812822560768000","Resilience","ForceShroud","Resilience"],
        ["2271612497821696","Force Cloak","ForceCloak","Force Cloak"],
        ["2271612497822035","Force Cloak","ForceCloak","Force Cloak"],
        ["812719481552896","Deflection","Deflection","Deflection"],
        ["979849543942144","Battle Readiness","OverchargeSaber","Battle Readiness"],
        ["3428015262400512","Force Potency","Recklessness","Force Potency"],
        ["966818613166080","Spinning Kick","Spike","Spinning Kick"],
        ["801354998087680","Sonic Round","AOETaunt","A O E taunt"],
        ["2522765005422592","Mass Mind Control","AOETaunt","A O E taunt"],
        ["812079531425792","Challenging Call","AOETaunt","A O E taunt"]
    ]
}

V7881RepublicSetup()
{
    global TrackedAbilityDefinitions,CoTankAbilityEnabled,DarknessAbilityEnabled
    global Roster,playerTankRoles,tauntLocalInCombat,Audio
    V673DispatchSetup()
    for key in TrackedAbilityDefinitions {
        ICLSet("your." key,true)
        CoTankAbilityEnabled[key] := true
    }
    tauntLocalInCombat := true
    Roster.Members["@OtherTank#674"] := {RoleAt:100000,Snapshot:-1,Role:"Tank"}
    Roster.Members["@OtherDps#675"] := {RoleAt:100000,Snapshot:-1,Role:"DPS"}
    playerTankRoles["@OtherTank#674"] := true,playerTankRoles["@OtherDps#675"] := false
    Audio.Queue := [],Audio.LastAccepted := Map(),Audio.Events := Map()
}

V7881RepublicLine(row, actor := "@Owner#673", at := 100000, action := "")
{
    if action=""
        action := "[Event {836045448945472}: AbilityActivate {836045448945479}] ()"
    return V551Line(at,actor "|(0,0,0,0)|(100/100)","=",row[2] " {" row[1] "}",action)
}

V7881RepublicMappings()
{
    global TrackedAbilityDefinitions
    for row in V7881RepublicRows() {
        V48Assert(ResolveUniversalCalloutKey(row[1],row[2])=row[3],"recorded Republic activation: " row[2])
        V48Assert(ResolveUniversalCalloutKey(row[1],"localized ability")=row[3],"ID works without English text: " row[2])
    }
    for row in [["3461103690448896","Taunt"],["801316343382016","Neural Jolt"],["979772234530816","Mind Control"]]
        V48Assert(ResolveUniversalCalloutKey(row[1],"localized taunt")="Taunt","exact Republic single taunt ID")
    for row in [["986266225082368","ExplosiveFuel"],["4504089253642240","EnergyYield"],
        ["2264298168516608","OilSlick"],["814218425139200","EnergyShield"],
        ["2264285283614720","KoltoOverload"],["2027628290637824","Carbonize"],
        ["4258855210975232","ShieldAdrenal"],["954616611078144","ForceShroud"],
        ["2271329029980518","ForceCloak"],["2271329029980160","ForceCloak"],
        ["3421834804461568","Deflection"],["975430022594560","OverchargeSaber"],
        ["975399957823488","Recklessness"],["808312845107200","Spike"]]
        V48Assert(ResolveUniversalCalloutKey(row[1],"")=row[2],"Imperial/shared activation retained")
    V48Assert(ResolveUniversalCalloutKey("3870310994542592","Resilience")="","story ability with same name stays excluded")
    V48Assert(ResolveUniversalCalloutKey("801329228284194","Reactive Shield")="","buff effect ID cannot become an activation")
    ids := Map()
    for key,def in TrackedAbilityDefinitions
        for id in def.Ids {
            V48Assert(!ids.Has(id),"each ability ID has one callout owner")
            ids[id] := key
        }
}

V7881RepublicDispatch() => V673RecordFixture(V7881RepublicDispatchCase)
V7881RepublicDispatchCase()
{
    global Audio,TrackedAbilityDefinitions
    for row in V7881RepublicRows() {
        V7881RepublicSetup()
        line := V7881RepublicLine(row)
        V673DispatchFeed(line),V673DispatchFeed(line)
        V48Assert(Audio.Queue.Length=1,"one call for duplicate Republic activation: " row[2])
        V48Assert(Audio.Queue[1].Key=row[3] && Audio.Queue[1].Phrase="Owner used " row[4] ".",
            "local Republic name is captured in queued speech: " row[2])
        V673DispatchFeed(V7881RepublicLine(row,"@OtherTank#674"))
        V48Assert(Audio.Queue.Length=2 && Audio.Queue[2].Actor="@OtherTank#674"
            && Audio.Queue[2].Phrase="OtherTank used " row[4] ".","simultaneous co-tank use keeps independent actor")
        V673DispatchFeed(V7881RepublicLine(row,"@OtherDps#675"))
        V673DispatchFeed(V7881RepublicLine(row,"@Unknown#676"))
        V48Assert(Audio.Queue.Length=2,"DPS and unknown players remain excluded")
    }
    V7881RepublicSetup()
    V673DispatchFeed(V7881RepublicLine(["2271612497821696","Force Cloak"]))
    V673DispatchFeed(V7881RepublicLine(["2271612497822035","Force Cloak"],"@Owner#673",100001))
    V48Assert(Audio.Queue.Length=1,"Force Cloak base/trigger variants share cooldown deduplication")
    V673DispatchFeed(V7881RepublicLine(["812822560768000","Resilience"],"@Owner#673",100002,
        "[ApplyEffect {836045448945477}: Resilience {2271612497821998}]"))
    V48Assert(Audio.Queue.Length=1,"cloak-granted Resilience buff does not announce a second ability")
}

V7881RepublicGates() => V673RecordFixture(V7881RepublicGatesCase)
V7881RepublicGatesCase()
{
    global Audio,universalCalloutsEnabled,soundboardsEnabled,inputMode,CoTankAbilityEnabled
    for row in V7881RepublicRows() {
        V7881RepublicSetup(),ICLSet("your." row[3],false)
        V673DispatchFeed(V7881RepublicLine(row))
        V48Assert(Audio.Queue.Length=0,"existing personal switch mutes its Republic mirror")
        V673DispatchFeed(V7881RepublicLine(row,"@OtherTank#674"))
        V48Assert(Audio.Queue.Length=1,"muting personal switch keeps co-tank switch independent")
        V7881RepublicSetup(),CoTankAbilityEnabled[row[3]] := false
        V673DispatchFeed(V7881RepublicLine(row,"@OtherTank#674"))
        V48Assert(Audio.Queue.Length=0,"existing co-tank switch mutes Republic mirror")
    }
    row := ["801329228283904","Reactive Shield"]
    V7881RepublicSetup(),universalCalloutsEnabled := false
    V673DispatchFeed(V7881RepublicLine(row))
    V48Assert(Audio.Queue.Length=0,"universal master mute retained")
    V7881RepublicSetup(),soundboardsEnabled := false
    V673DispatchFeed(V7881RepublicLine(row))
    V48Assert(Audio.Queue.Length=0,"audio master mute retained")
    V7881RepublicSetup(),inputMode := "Hotkeys"
    V673DispatchFeed(V7881RepublicLine(row))
    V48Assert(Audio.Queue.Length=0,"no log announcements in physical-hotkey mode")
    V7881RepublicSetup()
    V673DispatchFeed(V7881RepublicLine(row),false)
    V48Assert(Audio.Queue.Length=0,"silent historical replay cannot speak")
}

V7881RepublicPhrases() => V673RecordFixture(V7881RepublicPhrasesCase)
V7881RepublicPhrasesCase()
{
    global Audio,AbilityPhraseTemplates,audioOutputMode,TrackedAbilityDefinitions
    row := ["801329228283904","Reactive Shield"]
    V7881RepublicSetup(),AbilityPhraseTemplates["YourEnergyShield"] := "{Toon}, shield on."
    V673DispatchFeed(V7881RepublicLine(row))
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].Phrase="Owner, shield on.","custom phrase preserved")
    V48Assert(AbilityPhraseTemplates["YourEnergyShield"]="{Toon}, shield on.","dispatch does not rewrite saved template")
    V7881RepublicSetup(),AbilityPhraseTemplates["YourEnergyShield"] := "{Toon}: {Ability}!"
    V673DispatchFeed(V7881RepublicLine(row))
    V48Assert(Audio.Queue[1].Phrase="Owner: Reactive Shield!","optional Ability token follows actual combat style")
    V7881RepublicSetup(),AbilityPhraseTemplates["YourEnergyShield"] := ""
    V673DispatchFeed(V7881RepublicLine(row))
    V48Assert(Audio.Queue.Length=0,"explicitly blank template remains disabled")
    V7881RepublicSetup()
    V673DispatchFeed(V7881RepublicLine(["814218425139200","Energy Shield"]))
    V48Assert(Audio.Queue[1].Phrase="Owner used Energy Shield.","Imperial default speech retained")
    V48Assert(AbilityPhraseTemplates["YourEnergyShield"]="{Toon} used Energy Shield.","default template is not migrated on disk")
    V7881RepublicSetup(),audioOutputMode := "KenkuSoundboard"
    V673DispatchFeed(V7881RepublicLine(row))
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].SoundId=TrackedAbilityDefinitions["EnergyShield"].SoundId,
        "existing personal recording reused; no fabricated recording")
    V673DispatchFeed(V7881RepublicLine(row,"@OtherTank#674"))
    V48Assert(Audio.Queue.Length=1,"co-tank cannot play owner's personal recording")
}

V7881RepublicSettings() => V673RecordFixture(V7881RepublicSettingsCase)
V7881RepublicSettingsCase()
{
    V7881RepublicSetup()
    for row in V7881RepublicRows() {
        key := row[3]
        for prefix in ["your.","cotank."] {
            def := ICLDefinition(prefix key)
            V48Assert(IsObject(def) && def.IniKey=key,"mirror keeps original persisted setting identity")
            if key!="AOETaunt"
                V48Assert(InStr(def.Label,row[2]),"Republic name is visible/searchable in callout library")
        }
    }
}

; Native controls on the isolated diagnostic desktop; no normal app or audio.
V7881RaidRoleIcons() => V7412PlayerIconFixture(V58Isolated.Bind(V7881RaidRoleIconsCase))
V7881RaidRoleLifecycle() => V7412PlayerIconFixture(V7881RaidRoleLifecycleCase)

V7881RoleImage(lv,row) => (SendMessage(0x102C,row-1,0xF000,lv.Hwnd)>>12)&15

V7881RaidRoleIconsCase()
{
    global IP,IUB
    V7428RaidReady(),seg := IPSelectedSegment(),lv := IP.PlayersLV,u := IPWState()
    keys := [IP.Actor,"@Healer#300","@Role Tank#808","@Unknown#809","@Mixed#810"]
    specs := ["Rage","Medicine","Darkness"]
    for key in [keys[3],keys[4],keys[5]]
        IPStoreActor(seg,IPActor(key))
    for i,spec in specs {
        for id,item in IPICatalog() {
            if item.Name=spec {
                IURRecord(seg,IPParseLine(V622RoleLine(seg.Start,spec,id,keys[i])),seg.Start)
                break
            }
        }
    }
    seg.DisplayRoles[keys[5]] := 3
    before := seg.Totals[keys[1]].Damage,V7428RaidRedraw()
    IUBApplyWindow(IP.Gui,"main"),lv.Modify(0,"-Select")
    for sort in [1,2,12,1] {
        IPWSort("Raid",lv,sort),lv.Modify(0,"-Select")
        for i,expected in [2,3,1,0,0] {
            row := V7428RaidRow(keys[i])
            V48Assert(row>0 && V7881RoleImage(lv,row)=expected,"sorting retains each actor's own role icon")
            V48Assert((V7412ListRowImage(lv,row)>=0)=(i<=3),"class artwork remains beside the independent role icon")
            V48Assert(lv.GetText(row,12)=["DPS","Healer","Tank","Unknown","Mixed"][i],"role labels preserve unknown and mixed evidence")
            if !IUSHighContrast() && i<=3 {
                draw := V624Dispatch(lv,0x30001,12,0,row),off := IURDrawOffsets()
                V48Assert(NumGet(draw.Buffer,off.Background,"UInt")=IUBColorRef(IURColors(lv.GetText(row,12)).Background),"Raid uses the same role colours as Session Deaths")
            }
        }
    }
    V48Assert(!(SendMessage(0x1037,0,0,lv.Hwnd)&4),"role artwork does not enable checkboxes")
    for size in [[980,650],[1600,900],[2560,1440]] {
        IPResize(IP.Gui,0,size[1],size[2])
        V48Assert(SendMessage(0x101D,11,0,lv.Hwnd)>=Round(72*A_ScreenDPI/96),"role column remains visible across window sizes")
    }
    row := V7428RaidRow(keys[3]),IRTSetRoleIcon(lv,row,8)
    V48Assert(V7881RoleImage(lv,row)=0,"a reused row clears its icon when the role becomes unknown")
    seg.DisplayRoles[keys[3]] := 8,V7428RaidRedraw()
    V48Assert(V7881RoleImage(lv,V7428RaidRow(keys[3]))=0 && lv.GetText(V7428RaidRow(keys[3]),12)="Unknown","refresh does not borrow a previous role")
    V48Assert(seg.Totals[keys[1]].Damage=before,"role presentation leaves damage totals unchanged")
    V48Assert(IURState().Tables[u.Controls["SessionPlayers"].Hwnd].Column=10,"Session Deaths retains its own role-column mapping")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"Raid role checks keep the app hidden")
}

V7881RaidRoleLifecycleCase()
{
    state := IAIListState(),count := state.Lists.Count,created := state.Created,released := state.Released
    loop 4 {
        g := Gui(),lv := g.AddListView("w360 h140",["Player"]),hwnd := lv.Hwnd
        try {
            lv.Add("","Tank"),lv.Add("","DPS"),lv.Add("","Healer")
            for i,mask in [1,2,4]
                V48Assert(IRTSetRoleIcon(lv,i,mask),"native role image attaches")
            owned := state.Lists[hwnd],images := owned.RoleImages
            V48Assert(images && DllCall("Comctl32\ImageList_GetImageCount","Ptr",images,"Int")=3,"one owned image list contains three distinct roles")
            V48Assert(IRTRoleAttach(lv) && state.Lists[hwnd].RoleImages=images,"repeat attachment reuses the role image list")
            if Mod(A_Index,2) {
                IAIListDetach(lv),IAIListDetach(lv)
                V48Assert(!SendMessage(0x1002,2,0,hwnd) && V7881RoleImage(lv,1)=0,"explicit detach clears role state and releases its image list")
                V48Assert(IRTSetRoleIcon(lv,1,1),"control accepts role icons again after detach")
            }
        }
        finally g.Destroy()
        V48Assert(!state.Lists.Has(hwnd),"GUI destruction removes the role-image owner")
    }
    g := Gui(),lv := g.AddListView("w360 h140",["Player"])
    foreign := DllCall("Comctl32\ImageList_Create","Int",18,"Int",18,"UInt",0x20,"Int",1,"Int",0,"Ptr")
    try {
        lv.Add("","Foreign"),SendMessage(0x1003,2,foreign,lv.Hwnd)
        V48Assert(!IRTSetRoleIcon(lv,1,1) && SendMessage(0x1002,2,0,lv.Hwnd)=foreign,"foreign state artwork is preserved")
        SendMessage(0x1003,2,0,lv.Hwnd),IRTSetRoleIcon(lv,1,1)
        SendMessage(0x1003,2,foreign,lv.Hwnd),IAIListDetach(lv)
        V48Assert(SendMessage(0x1002,2,0,lv.Hwnd)=foreign && DllCall("Comctl32\ImageList_GetImageCount","Ptr",foreign,"Int")=0,"later replacement survives our cleanup")
    }
    finally {
        SendMessage(0x1003,2,0,lv.Hwnd),g.Destroy()
        DllCall("Comctl32\ImageList_Destroy","Ptr",foreign,"Int")
    }
    V48Assert(state.Lists.Count=count && state.Created-created=state.Released-released,"all class and role lists are released once")
}

DarkControls() => V601Isolated(V623With.Bind(DarkControlsCase))
DarkControlsCase(f)
{
    global IUB
    p := IUBPalette("dark"),prior := [f.Tab.Value,f.DDL.Value,f.List.GetText(1,1)]
    V48Assert(IUBThemeFromChoice(IUBThemeChoice("dark"))="dark","dark palette is selectable and restores its choice")
    for theme in ["dark","classic","iris","dark"] {
        IUB.Theme := theme,IUBApplyWindow(f.Gui,"analysis")
        V48Assert(f.Tab.Value=prior[1] && f.DDL.Value=prior[2] && f.List.GetText(1,1)=prior[3],"theme switching preserves native selections and table contents")
        f.List.Modify(0,"-Select")
        colors := V624Dispatch(f.List,0x30001,1),off := IURDrawOffsets()
        V48Assert(NumGet(colors.Buffer,off.Text,"UInt")=IUBColorRef(IUBPalette().Text),"actual table notification selects the current text colour")
        controls := [f.Tab,f.List,f.DDL]
        V7412PlayerControlsPng("controls-" theme ".png",f.Gui,controls,0,0,420,200)
    }
    V48Assert(IUBDarkState().Paints>0 && IUBDarkState().Failures=0,"native tab print uses the dark item painter without errors")
    info := V623Colors(f.DDL)
    V48Assert(info.Text=IUBColorRef(p.Text),"native dropdown reports light text")
    IUB.DropdownTint := false,IUB.Rounded := false,IUBApplyWindow(f.Gui,"analysis")
    V48Assert(IUDStyleState().Controls.Has(f.DDL.Hwnd),"dark fields remain readable with lavender tint disabled")
    SendMessage(0x100,0x24,0,f.DDL.Hwnd),Sleep(-1)
    V48Assert(f.DDL.Value=1,"native keyboard Home still selects the first item")
    SendMessage(0x100,0x23,0,f.DDL.Hwnd),Sleep(-1)
    V48Assert(f.DDL.Value=3,"native keyboard End still selects the last item")
    V48Assert(!DllCall("IsWindowVisible","Ptr",f.Gui.Hwnd,"Int"),"all checks use hidden diagnostic windows")
    for text in [p.Text,p.Muted,p.Accent,IRTColor("Damage"),IRTColor("Healing"),IRTColor("Taken"),IRTColor("Threat")] {
        ratio := (V622Luminance(text)+0.05)/(V622Luminance(p.Field)+0.05)
        V48Assert(ratio>=4.5,"dark interface text has readable contrast: " text)
    }
    for id,item in IPICatalog() {
        ink := ITBClassColor(id)
        if ink!=""
            V48Assert((V622Luminance(ink)+0.05)/(V622Luminance("292630")+0.05)>=4.5,"class names stay readable on alternating dark rows")
    }
}

DarkMenus() => V658MenuFixture(DarkMenusCase)
DarkMenusCase(f)
{
    global IUB,IUM,V658MenuCalls
    before := V658MenuSnapshot(f.Bar.Handle),brushes := []
    for theme in ["iris","dark","classic","dark","iris"] {
        IUB.Theme := theme,IUMApply(f.Gui,f.Bar)
        after := V658MenuSnapshot(f.Bar.Handle)
        V48Assert(V658MenuSame(before,after),"theme changes preserve menu IDs, checks and disabled actions")
        if theme!="classic" {
            brush := IUMMenuBrush(f.Menu.Handle),logical := Buffer(16,0)
            DllCall("GetObjectW","Ptr",brush,"Int",logical.Size,"Ptr",logical)
            V48Assert(NumGet(logical,4,"UInt")=IUBColorRef(IUBPalette().Field),"native popup brush follows the selected palette")
        }
    }
    V48Assert(V658MenuCalls=0,"theme updates never execute menu commands")
}

DarkWorkspace()
{
    s := ITBState(),created := s.CreatedFonts,released := s.ReleasedFonts
    V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(DarkWorkspaceCase)))
    V48Assert(s.CreatedFonts-created=s.ReleasedFonts-released,"Raid label and numeric fonts are released on shutdown")
}
DarkWorkspaceCase()
{
    global IUB,IP
    V7428RaidReady(),seg := IPSelectedSegment(),u := IPWState()
    specs := ["Rage","Medicine","Pyrotech","Annihilation","Lightning","Lethality","Shield Tech","Darkness"]
    names := ["Sample Juggernaut","Sample Healer","Sample Powertech","Sample Marauder","Sample Sorcerer","Sample Operative","Sample Tank","Sample Assassin"]
    keys := [IPActor(V51Source()).Key,"@Healer#300"]
    Loop 6 {
        actor := IPActor("@Raid Sample " A_Index "#" (700+A_Index)),IPStoreActor(seg,actor),keys.Push(actor.Key)
    }
    seg.Last := 120000,seg.Raid.LastThreatAt := seg.Last
    for i,key in keys {
        seg.Actors[key].Name := names[i],t := seg.Totals[key]
        t.Damage := i=2 ? 132000 : (i=7 ? 1116600 : 6125400-i*316600)
        t.Taken := 1400400+i*77730,t.Heal := i=2 ? 4770000 : i*30330
        t.Effective := Round(t.Heal*(i=2 ? 0.86 : 0.67)),t.HealKnown := 1,t.HealRecords := 1
        seg.Raid.Threat[key] := {Total:i=7 ? 17284500 : t.Damage+t.Heal*0.5,Known:90,Missing:0}
        for id,item in IPICatalog() {
            if item.Name=specs[i] {
                IURRecord(seg,IPParseLine(V622RoleLine(seg.Start,item.Name,id,key)),seg.Start)
                break
            }
        }
    }
    IP.Live.Changed += 1,V7428RaidRedraw()
    DarkNumberChecks(IP.PlayersLV)
    IP.Gui.Show("Hide w1600 h820"),IPResize(IP.Gui,0,1600,820)
    snapshot := IP.PlayersLV.GetText(1,9),tab := u.Controls["Tabs"],images := SendMessage(0x1302,0,0,tab.Hwnd)
    for theme in ["dark","iris","dark"] {
        IUB.Theme := theme,IUBApplyWindow(IP.Gui,"main"),V7428RaidRedraw(),IRTHeaders()
        V48Assert(IP.PlayersLV.GetText(1,9)=snapshot && IP.PlayersLV.GetCount()=8,"theme leaves Raid row identities and totals intact")
        V48Assert(SendMessage(0x1302,0,0,tab.Hwnd)=images,"tab icon list survives theme changes")
        IP.PlayersLV.Modify(0,"-Select")
        controls := []
        for c in IP.Gui {
            if V58ChildVisible(c)
                controls.Push(c)
        }
        V7412PlayerControlsPng("workspace-" theme ".png",IP.Gui,controls,0,0,1600,820)
    }
    for page in [2,3,9,7] {
        V58SelectTab(page)
        V48Assert(IP.Workspace.Tab=page,"dark theme keeps native tab navigation: " page)
    }
    g := IUBBuildAppearance(),g.Show("Hide w530 h632"),IUB.Choice.Choose(3)
    IUBApplyWindow(g,"dialog"),all := []
    for c in g
        all.Push(c)
    V7412PlayerControlsPng("appearance-dark.png",g,all,0,0,530,632)
    V48Assert(IUB.Choice.Text="Iris dark","Appearance offers the new named palette")
    g.Destroy()
}

DarkNumberChecks(lv)
{
    entry := ITBState().Tables[lv.Hwnd],font := entry.NumberFont,s := ITBState(),created := s.CreatedFonts
    V48Assert(font!=0 && font!=entry.SourceFont,"Raid metrics have a separate tabular font")
    ITBAttach(lv,12,"pull")
    V48Assert(entry.NumberFont=font && s.CreatedFonts=created,"repeated table styling reuses both fonts")
    dc := DllCall("Gdi32\CreateCompatibleDC","Ptr",0,"Ptr"),saved := DllCall("Gdi32\SaveDC","Ptr",dc,"Int")
    try {
        DllCall("Gdi32\SelectObject","Ptr",dc,"Ptr",font)
        widths := Buffer(40,0)
        V48Assert(DllCall("Gdi32\GetCharWidth32W","Ptr",dc,"UInt",48,"UInt",57,"Ptr",widths,"Int"),"measure the actual GDI digit advances")
        loop 10
            V48Assert(NumGet(widths,(A_Index-1)*4,"Int")=NumGet(widths,0,"Int"),"all digits have the same width")
        for text in ["13,284,684","10,260,646"] {
            size := Buffer(8,0),DllCall("Gdi32\GetTextExtentPoint32W","Ptr",dc,"Str",text,"Int",StrLen(text),"Ptr",size)
            if A_Index=1
                totalWidth := NumGet(size,0,"Int")
            else
                V48Assert(NumGet(size,0,"Int")=totalWidth,"the two reported totals occupy exactly the same width")
        }
        for selected in [false,true] {
            lv.Modify(0,"-Select")
            if selected
                lv.Modify(1,"Select")
            for column in [2,3,1,12,10,11] {
                b := V622Notification(lv,0x30001,column,0),off := IURDrawOffsets(),NumPut("UPtr",0,b,off.Item)
                NumPut("Ptr",dc,b,A_PtrSize=8 ? 32 : 16)
                id := DllCall("User32\GetDlgCtrlID","Ptr",lv.Hwnd,"Int")
                NumPut("UPtr",id,b,A_PtrSize),NumPut("Int",-12,b,2*A_PtrSize)
                result := SendMessage(0x4E,id,b.Ptr,lv.Gui.Hwnd)
                expected := column=1 || column=12 ? entry.SourceFont : font
                actual := DllCall("Gdi32\GetCurrentObject","Ptr",dc,"UInt",6,"UPtr")
                if A_PtrSize=4
                    expected := expected&0xFFFFFFFF
                V48Assert(result=2 && actual=expected,"native cell font matches, including selected rows: " column " / " actual " / " expected " / " result)
            }
        }
    }
    finally {
        lv.Modify(0,"-Select")
        DllCall("Gdi32\RestoreDC","Ptr",dc,"Int",saved),DllCall("Gdi32\DeleteDC","Ptr",dc)
    }
}

DarkAnalysis() => V601Isolated(V591Isolated.Bind(DarkAnalysisCase))
DarkAnalysisCase()
{
    global IP,IUB
    V591Ready(),a := V591Data(),query := a.Query,result := a.Result
    IP.Gui.Show("Hide w1600 h820"),IPResize(IP.Gui,0,1600,820)
    for theme in ["dark","iris","dark"] {
        IUB.Theme := theme,IUBApplyWindow(IP.Gui,"main"),IUBApplyWindow(a.Gui,"analysis"),IAChartChanged()
        V48Assert(a.Query=query && a.Result=result,"Analysis range and calculation remain unchanged after a theme switch")
        controls := []
        for c in a.Gui {
            if V58ChildVisible(c)
                controls.Push(c)
        }
        a.Gui.GetClientPos(,,&w,&h)
        V7412PlayerControlsPng("analysis-" theme ".png",a.Gui,controls,0,0,w,h)
    }
    V48Assert(IUBDarkState().Failures=0,"Analysis tabs render without a paint failure")
    V48Assert(!IP.Visible && !IP.Active,"native Analysis checks do not show Iris or start parsing")
}

MergedHPNames()
{
    labels := Map()
    for e in IIFEntries()
        labels[e.Key] := e.Label
    V48Assert(labels["BossHP"]="Boss HP" && labels["RunTimer"]="Time remaining in raid","clear display names")
    V48Assert(!labels.Has("BossMechanics"),"no separate mechanics choice")
    V48Assert(IPMSizeKeys().Length=IPMSizeLabels().Length,"size picker keys and labels stay paired")
    for k in IPMSizeKeys()
        V48Assert(k!="BossMechanics","retired panel absent from size picker")
}
MergedHPSettings()
{
    m := IPMNewState(),m.Shown["BossMechanics"] := true,m.Shown["BossHP"] := false
    p := m.Panels["BossMechanics"],p.X := 111,p.Y := 222,p.Width := 333,p.Height := 190,p.AutoHeight := false
    saved := ILPCapture(m,IRTUNewState())
    IBMMergeChoice(m)
    V48Assert(m.Shown["BossHP"] && !m.Shown["BossMechanics"],"old selected mechanics becomes Boss HP")
    hp := m.Panels["BossHP"]
    V48Assert(hp.X=111 && hp.Y=222 && hp.Width=333 && !hp.AutoHeight,"old mechanics placement retained if HP was off")
    V48Assert(!IBMMergeChoice(m),"migration is idempotent")
    m.Shown["BossMechanics"] := true,hp.X := 999,IBMMergeChoice(m)
    V48Assert(hp.X=999,"existing enabled HP position wins")
    n := IPMNewState(),ILPApplyModel(n,IRTUNewState(),saved)
    V48Assert(n.Shown["BossHP"] && !n.Shown["BossMechanics"] && n.Panels["BossHP"].X=111,"old named layouts migrate too")
    count := 0
    for t in IPMDisplayTargets(n) {
        V48Assert(t.Kind!="BossMechanics","no retired window rendered")
        if t.Kind="BossHP"
            count++
    }
    V48Assert(count=1,"one HP window after migration")
    IIFSetChoice(n,"BossMechanics",false)
    V48Assert(!n.Shown["BossHP"],"legacy commands select the merged panel")
    off := IPMNewState(),IBMMergeChoice(off)
    V48Assert(!off.Shown["BossHP"],"disabled old panels stay disabled")
}
MergedHPLive() => V7821Fixture(MergedHPLiveCase)
MergedHPLiveCase()
{
    global IPM,IP,IZP,testClock
    IP := IPNewApp(),IP.Active := true,IP.Live := V7878FHSegment("G-IZ").Data,IPM.Source := 1
    snap := V53Snapshot(),snap.Raid.Health := [{Name:"Izax",Known:true,Current:500,Maximum:1000,Percent:50,Stale:false}]
    p := IPM.Panels["BossHP"],p.Width := 330,IPM.MaxRows := 1
    IPMEnsureGui("BossHP",0,p)
    V7821Feed(100000),V7821Feed(100100,"up"),IRRender("BossHP",snap,p)
    V48Assert(p.VisibleRows=3 && p.Rows[1].Name.Text="Izax" && p.Rows[2].Name.Text="Izax shield","HP and shield share native panel")
    V48Assert(p.Rows[2].Value.Text="~100%" && p.Rows[3].Value.Text="Sophie","real shield and configured first interrupt")
    V7821Feed(100200,"half"),IRRender("BossHP",snap,p)
    V48Assert(p.Rows[2].Value.Text="~50%" && p.Rows[2].Bar.Value=500,"shield absorption updates merged panel")
    controls := []
    for c in p.Gui {
        if V58ChildVisible(c)
            controls.Push(c)
    }
    V7412PlayerControlsPng("boss-hp-merged.png",p.Gui,controls,0,0,p.Layout.W,p.Layout.H)
    V7821Break(),IRRender("BossHP",snap,p)
    V48Assert(p.Rows[2].Value.Text="Broken" && p.Rows[3].Name.Text="Next interrupt","shield break switches interrupt label")
    p.AutoHeight := false,p.Height := 30,IRRender("BossHP",snap,p)
    V48Assert(p.Layout.H>=p.Layout.Header+3*p.Layout.RowH+p.Layout.Footer,"small fixed panel still fits merged rows")
    V7821Feed(102000,"cast"),V7821Feed(102100,"kick","First Toon"),IRRender("BossHP",snap,p)
    V48Assert(p.Rows[3].Value.Text="Second","next interrupt follows actual kick")
    IP.Active := false,IRRender("BossHP",snap,p)
    V48Assert(p.VisibleRows=1 && !p.Rows[2].Name.Visible,"stopping clears live mechanics but keeps HP")
    IP.Active := true,IP.Live.Current.BossKey := "G-TY",IRRender("BossHP",snap,p)
    V48Assert(p.VisibleRows=1,"another boss never inherits Izax mechanics")
    IP.Live.Current.BossKey := "G-IZ",IP.View := "Offline",IP.Offline := V7878FHSegment("G-IZ").Data,IPM.Source := 2
    IRRender("BossHP",snap,p)
    V48Assert(p.VisibleRows=1,"saved fight never displays current live shield")
    IPM.Source := 1,testClock += 6000,IRRender("BossHP",snap,p)
    V48Assert(p.VisibleRows=1,"stale stream clears shield")
    V7821Feed(110000,"phase4"),IRRender("BossHP",snap,p)
    V48Assert(p.VisibleRows=1,"phase transition retires shield rows")
    V48Assert(!DllCall("IsWindowVisible","Ptr",p.Gui.Hwnd),"diagnostics never show game overlay")
}
MergedHPPreview() => V7821Fixture(MergedHPPreviewCase)
MergedHPPreviewCase()
{
    global IP,IPM
    IP := IPNewApp(),IPM.Enabled := true,IPM.Shown["BossHP"] := true
    IPMPreviewSet(8),snap := IPM.PreviewSnapshot,p := IPM.Panels["BossHP"]
    IPMEnsureGui("BossHP",0,p),IRRender("BossHP",snap,p)
    V48Assert(IBMHealthRows(snap).Length=2 && InStr(p.Heading.Text,"PREVIEW"),"explicit preview includes shield sample")
    IPMPreviewClear(IPM)
    V48Assert(!IBMHealthRows(snap).Length,"old preview flags cannot leak a sample")
}

; Pure arena fixtures. Do not open windows, load settings, or touch live state.
V7838ArenaLine(at,a,b,action,effect,amount := "",area := "")
{
    stamp := Format("{:02}:{:02}:{:02}.{:03}",Mod(at//3600000,24),Mod(at//60000,60),Mod(at//1000,60),Mod(at,1000))
    fields := area!="" ? "AreaEntered {836045448953664}: Test arena {" area "}"
        : action " {" (action="ApplyEffect" ? "836045448945477" : "836045448945472") "}: Fixture {" effect "}"
    return "[" stamp "] [" a "] [" b "] [] [" fields "]" (amount!="" ? " (" amount ")" : "") " (test-server) <v7.0>"
}

V7838ArenaFeed(s,at,a,b,action,effect,amount := "",area := "")
{
    line := V7838ArenaLine(at,a,b,action,effect,amount,area)
    ev := IPParseLine(line)
    V48Assert(IsObject(ev),"arena fixture parses")
    IPVConsume(s,ev,at,line)
}

V7838ArenaActor(id,hp := 100) => "@Player" id "#" id "|(0,0,0,0)|(" hp "/100)"

V7838ArenaFixture(results,zeroOnly := false)
{
    s := IPNewData("isolated arena fixture")
    V7838ArenaFeed(s,0,V7838ArenaActor(1),"","Area","",,"137438993370")
    for round,outcome in results {
        at := round*5000
        ; Team 1: player 1 and 2. Team 2: player 3. Underfilled is valid.
        V7838ArenaFeed(s,at,V7838ArenaActor(1),V7838ArenaActor(2),"ApplyEffect","836045448945500",1)
        V7838ArenaFeed(s,at+10,V7838ArenaActor(1),V7838ArenaActor(3),"ApplyEffect","836045448945501",1)
        V7838ArenaFeed(s,at+20,V7838ArenaActor(1),"=","ApplyEffect","3297813328822272")
        for id in (outcome="win" ? [3] : [1,2])
            V7838ArenaFeed(s,at+100,V7838ArenaActor(id,0),"=","Event",zeroOnly ? "900001" : "836045448945493")
        if round<results.Length {
            V7838ArenaFeed(s,at+2000,V7838ArenaActor(1),"=","Event","836045448945494")
            V7838ArenaFeed(s,at+2010,V7838ArenaActor(3),"=","Event","836045448945494")
        }
    }
    return s
}

V7838ArenaSession()
{
    global SELF_TEST
    V48Assert(SELF_TEST,"arena checks require isolation")
    for pattern in [["win","win"],["loss","loss"],["loss","win","win"],["win","loss","loss"]] {
        s := V7838ArenaFixture(pattern),before := IPVSnapshot(s.Arena)
        expected := pattern[pattern.Length]
        V48Assert(before.Current.Outcome=expected,"live score reconstructs a valid match")
        V48Assert(before.Wins=0 && before.Losses=0,"open visit stays separate from completed totals")
        IPVBoundary(s,"EOF"),IPVBoundary(s,"EOF")
        after := IPVSnapshot(s.Arena)
        V48Assert(after.Matches=1 && after.Last.Outcome=expected,"one result per visit despite repeated finalization")
        V48Assert(after.WinRate=(expected="win" ? 100 : 0),"win percentage uses resolved matches")
    }
    s := V7838ArenaFixture(["win","win"],true)
    IPVBoundary(s,"EOF")
    V48Assert(IPVSnapshot(s.Arena).Wins=1,"zero HP counts without a Death record")
    s := V7838ArenaFixture(["win"])
    IPVBoundary(s,"EOF")
    V48Assert(IPVSnapshot(s.Arena).Unknown=1,"EOF after one round is unresolved")
    s := V7838ArenaFixture(["win"])
    V7838ArenaFeed(s,20000,V7838ArenaActor(1),"","Area","",,"123")
    V48Assert(IPVSnapshot(s.Arena).Losses=1,"observed early area departure counts as loss")
    s := V7838ArenaFixture(["win","loss"])
    IPVBoundary(s,"EOF")
    V48Assert(IPVSnapshot(s.Arena).Unknown=1,"1-1 EOF is not a loss")
    s := V7838ArenaFixture(["win","win","loss"])
    IPVBoundary(s,"EOF")
    V48Assert(IPVSnapshot(s.Arena).Unknown=1,"third active round after 2-0 remains unresolved")
    s := V7838ArenaFixture(["win","win"])
    V7838ArenaFeed(s,12000,V7838ArenaActor(1),V7838ArenaActor(3),"ApplyEffect","836045448945500",1)
    IPVBoundary(s,"EOF")
    V48Assert(IPVSnapshot(s.Arena).Unknown=1,"contradictory team graph cannot award a win")
    s := V7838ArenaFixture(["win","win"])
    IPVProblem(s,"malformed input"),IPVBoundary(s,"EOF")
    V48Assert(IPVSnapshot(s.Arena).Unknown=1,"missing input invalidates result")
    s := IPNewData("unrelated PvE")
    IPFeedLine(s,V7838ArenaLine(0,V7838ArenaActor(1),"","Area","",,"945872057669657"),"fixture")
    V48Assert(!s.HasOwnProp("Arena"),"PvE does not allocate an arena ledger")
    s := IPNewData("parser hook")
    IPFeedLine(s,V7838ArenaLine(0,V7838ArenaActor(1),"","Area","",,"137438993370"),"fixture")
    V48Assert(s.HasOwnProp("Arena") && s.Arena.Current.Server="test-server","normal parser feeds arena entry and server")
    IPFeedLine(s,V7838ArenaLine(10,V7838ArenaActor(1),V7838ArenaActor(3),"ApplyEffect","836045448945501",1),"fixture")
    IPBSourceBoundary(s,"next-file")
    V48Assert(IPVSnapshot(s.Arena).Unknown=1,"source changes do not imply departure losses")
    s := V7838ArenaFixture(["win","win"]),records := s.Arena.Current.Records.Length
    one := IPVSnapshot(s.Arena),two := IPVSnapshot(s.Arena)
    V48Assert(one.Current.Outcome=two.Current.Outcome && s.Arena.Current.Records.Length=records,"snapshot reads are repeatable")
    other := IPNewData("independent source")
    V48Assert(!other.HasOwnProp("Arena"),"independent imported/live datasets cannot share session totals")
    s := V7838ArenaFixture(["win","win"])
    IPVBoundary(s,"EOF")
    view := IPVSnapshot(s.Arena)
    view.Last.Rounds[1].Outcome := "loss"
    view.Last.Teammates[1].Name := "changed by UI"
    V48Assert(IPVSnapshot(s.Arena).Last.Rounds[1].Outcome="win","display snapshots cannot rewrite round results")
    V48Assert(IPVSnapshot(s.Arena).Last.Teammates[1].Name!="changed by UI","display snapshots cannot rewrite player names")
    s := IPNewData("midstream attachment")
    context := {Key:"fixture",Owner:"@Player1#1",AreaId:"137438993370",ModeId:""}
    IPFeedLine(s,V7838ArenaLine(1000,V7838ArenaActor(1),V7838ArenaActor(3),"ApplyEffect","836045448945501",1),"fixture",context)
    V48Assert(s.Arena.Current.Problem="attached during arena","metadata-only attachment is identified as incomplete")
    IPFinalizeData(s,"stopped")
    V48Assert(IPVSnapshot(s.Arena).Unknown=1 && IPVSnapshot(s.Arena).Losses=0,"stopping mid-match never invents a departure")
    s := IPNewData("preparation")
    V7838ArenaFeed(s,0,V7838ArenaActor(1),"","Area","",,"137438993370")
    IPVBoundary(s,"EOF")
    V48Assert(IPVSnapshot(s.Arena).Matches=0,"visiting an arena without an active round creates no result")
    ; Round two has only a marker and HP-zero /stuck, no damage or Death.
    s := V7838ArenaFixture(["win"])
    V7838ArenaFeed(s,7000,V7838ArenaActor(3),"=","Event","836045448945494")
    V7838ArenaFeed(s,7010,V7838ArenaActor(1),"=","Event","836045448945494")
    V7838ArenaFeed(s,9000,V7838ArenaActor(1),V7838ArenaActor(2),"ApplyEffect","836045448945500",1)
    V7838ArenaFeed(s,9010,V7838ArenaActor(1),"=","ApplyEffect","3297813328822272")
    V7838ArenaFeed(s,9100,V7838ArenaActor(3,0),"=","Event","900001")
    IPVBoundary(s,"EOF")
    V48Assert(IPVSnapshot(s.Arena).Wins=1,"an entire known-team round may end at zero HP without any damage")
}

V7842PvPStates()
{
    app := IPNewApp(),state := IPMNewState(),p := state.Panels["PvP"]
    V48Assert(!state.Shown["PvP"] && IPMDefinition("PvP").Title="PvP","PvP starts off with a simple title")
    IIFSetChoice(state,"PvP",true),n := 0
    for target in IPMDisplayTargets(state)
        n += target.Kind="PvP"
    V48Assert(n=1,"a single menu selection adds exactly one PvP panel")
    V48Assert(IPVUView(app,state,p,0).Message="Waiting for an arena","no data never shows fake statistics")
    app.Live := V7838ArenaFixture(["win","win"]),app.Active := true,app.View := "Live"
    data := app.Live,v := data.Arena.Current
    a := IPVUView(app,state,p,10000)
    V48Assert(a.Rows[1].Value="Won" && a.Rows[2].Value="2 – 0","live match shows reconstructed rounds")
    V48Assert(a.Rows.Length=3 && a.Rows[3].Value="0W / 0L","current result remains separate from completed totals")
    snap := data.Arena.DisplayCache.Snapshot,v.Revision += 1
    V48Assert(IPVUCached(data,10500)=snap,"changed live evidence is throttled between display refreshes")
    V48Assert(IPVUCached(data,12000)!=snap,"new evidence refreshes after two seconds")
    frozen := IPVUFrozen(data.Arena)
    frozen.Current.Names["1"] := "changed"
    frozen.Current.Seen["1"][2] := 123456
    V48Assert(v.Names["1"]!="changed" && v.Seen["1"][2]!=123456,"reconstruction uses isolated metadata")
    IPVBoundary(data,"stopped"),app.Active := false
    a := IPVUView(app,state,p,12001)
    V48Assert(a.Rows[1].Label="Last match" && a.Rows[2].Value="1W / 0L (100.0%)","closed visit updates immediately and remains after Stop")
    V48Assert(InStr(a.Note,"stopped") && a.Rows.Length=2 && InStr(a.Rows[2].Value,"100.0%"),"stopped session retains the resolved win percentage")
    before := IPVSnapshot(data.Arena)
    for id in ["137438956902","137438992654","137438993104","137438989517","833571547775744","945872057669561","137438988866","137438953518","833571547775746"] {
        IPFeedLine(data,V7838ArenaLine(30000,V7838ArenaActor(1),"","Area","",,id),"fixture")
        a := IPVUView(app,state,p,13000)
        V48Assert(a.Message="Iris does not currently support warzones" && !a.Rows.Length,"warzone " id " shows the unsupported message")
    }
    after := IPVSnapshot(data.Arena)
    V48Assert(before.Matches=after.Matches && before.Wins=after.Wins && before.Losses=after.Losses && before.Unknown=after.Unknown,"warzone visits cannot enter arena W/L totals")
    data.AreaId := "123"
    V48Assert(IPVUView(app,state,p,14000).Rows[2].Value="1W / 0L (100.0%)","leaving a warzone restores the retained arena session")
    app.Offline := IPNewData("native saved fixture"),app.Offline.AreaId := "137438993370",app.View := "Imported",state.Source := 2
    V48Assert(IPVUView(app,state,p,15000).Message="Select an arena fight","saved view asks for a selected arena fight")
    app.Offline := V7849SavedFixture(),seg := app.Offline.Segments[1],seg.AreaId := "137438989517"
    app.Selected := 1
    V48Assert(IPVUView(app,state,p,15001).Note="The Voidstar","saved selected warzone wins over the file's final area")
    app.View := "Live",state.Source := 1,app.Live := IPNewData("new parser session")
    V48Assert(IPVUView(app,state,p,16000).Message="Waiting for an arena","new parser session cannot retain previous cached totals")
}

V7842PvPNative() => V65UITimerIsolated(V7842PvPNativeCase)
V7842PvPNativeCase(*)
{
    global IP,IPM,SELF_TEST,SETTINGS_FILE
    old := IP
    try {
        V48Assert(SELF_TEST && A_IsSuspended,"native PvP checks are isolated")
        IP := IPNewApp(),IPM.Mode := 2,IPM.Shown["PvP"] := true
        p := IPM.Panels["PvP"],p.Width := 340
        IPMEnsureGui("PvP",0,p),snap := IPMOverlaySnapshot(IP,IPM),IPMRender("PvP",snap,p)
        V48Assert(p.Heading.Text="PvP" && p.Meta.Text="Waiting for an arena" && p.VisibleRows=0,"normal empty panel contains no sample rows")
        IPMPreviewSet(8),IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(InStr(p.Heading.Text,"PREVIEW") && p.VisibleRows=13,"explicit preview shows arena and player records")
        V7842PvPCapture("pvp-preview.png",p)
        IPMPreviewClear(IPM),IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(p.Heading.Text="PvP" && p.VisibleRows=0,"sample disappears immediately on preview exit")
        IP.Live := V7838ArenaFixture(["win"]),IP.View := "Live",IP.Active := true,IPM.PvPRecordsExpanded := false
        IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(p.Rows[2].Value.Text="1 – 0" && p.VisibleRows=3,"real arena rendering uses live rounds")
        V7842PvPCapture("pvp-live.png",p)
        IP.Live.AreaId := "137438989517"
        for width in [196,340,500] {
            p.Width := width
            IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
            V48Assert(p.VisibleRows=0 && InStr(p.Meta.Text,"Iris does not currently support warzones"),"warzone clears previously rendered arena rows")
            p.Meta.GetPos(&x,&y,&w,&h)
            V48Assert(x>=0 && x+w<=p.Layout.W && y+h<=p.Layout.H,"wrapped message fits at width " width)
        }
        p.Width := 340,IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V7842PvPCapture("pvp-warzone.png",p)
        IPM.Shown["PvP"] := false
        for target in IPMDisplayTargets()
            V48Assert(target.Kind!="PvP","unchecking PvP removes it from display polling")
        V48Assert(!FileExist(SETTINGS_FILE),"preview/render creates no saved preferences")
    }
    finally {
        IPMPreviewClear(IPM),IPMDestroyPanels(),IP := old
    }
}

V7842PvPCapture(name,p)
{
    controls := []
    for c in p.Gui {
        if V58ChildVisible(c)
            controls.Push(c)
    }
    V7412PlayerControlsPng(name,p.Gui,controls,0,0,p.Layout.W,p.Layout.H)
}


V7843TextMatch(start,results,leave := true)
{
    text := V7838ArenaLine(start,V7838ArenaActor(1),"","Area","",,"137438993370") "`n"
    for round,outcome in results {
        at := start+round*5000
        text .= V7838ArenaLine(at,V7838ArenaActor(1),V7838ArenaActor(2),"ApplyEffect","836045448945500",1) "`n"
        text .= V7838ArenaLine(at+10,V7838ArenaActor(1),V7838ArenaActor(3),"ApplyEffect","836045448945501",1) "`n"
        text .= V7838ArenaLine(at+20,V7838ArenaActor(1),"=","ApplyEffect","3297813328822272") "`n"
        for id in (outcome="win" ? [3] : [1,2])
            text .= V7838ArenaLine(at+100,V7838ArenaActor(id,0),"=","Event","836045448945493") "`n"
        if round<results.Length {
            text .= V7838ArenaLine(at+2000,V7838ArenaActor(1),"=","Event","836045448945494") "`n"
            text .= V7838ArenaLine(at+2010,V7838ArenaActor(3),"=","Event","836045448945494") "`n"
        }
    }
    if leave
        text .= V7838ArenaLine(start+results.Length*5000+3000,V7838ArenaActor(1),"","Area","",,"123") "`n"
    return text
}

V7843PvPSaved()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"saved arena diagnostics are isolated")
    path := A_Temp "\IrisPvPSavedTest-" INToken() ".txt"
    try {
        ; The first match crosses midnight. All later visits must retain +1 day.
        text := V7843TextMatch(86395000,["win","win"])
        text .= V7838ArenaLine(86415000,V7838ArenaActor(1),"","Area","",,"137438989517") "`n"
        text .= V7843TextMatch(86420000,["loss","win","loss"])
        text .= V7843TextMatch(86450000,["win"],false)
        FileAppend(text,path,"UTF-8")
        s := IPVSScan(path,"UTF-8"),snap := IPVSnapshot(s)
        V48Assert(s.Matches.Length=3 && snap.Wins=1 && snap.Losses=1 && snap.Unknown=1,"whole log counts matches once and excludes warzones")
        V48Assert(s.Matches[1].End>=86400000 && s.Matches[2].Start=86420000,"arena clocks remain aligned across midnight")
        V48Assert(s.Matches[2].RoundWins=1 && s.Matches[2].RoundLosses=2,"three rounds belong to one arena match")
        filtered := IPWFightIndices({Segments:[{BossKey:"",AreaId:"137438993370"},{BossKey:"",AreaId:"137438989517"},{BossKey:"",AreaId:"123"}]},true)
        V48Assert(filtered.Length=2 && filtered[1]=1 && filtered[2]=2,"Hide trash retains arenas and warzones while hiding PvE trash")
        V48Assert(s.Matches[3].Outcome="unknown","EOF does not invent an early departure loss")
        seg := {Start:86430000,AreaId:"137438993370"}
        V48Assert(IPVSSelected(s,seg)=s.Matches[2],"selecting the second round finds the complete match")
        seg.Start := 86402000
        V48Assert(IPVSSelected(s,seg)=s.Matches[1],"selecting a later round after midnight finds the first match")
        seg.Start := 86417000
        V48Assert(!IsObject(IPVSSelected(s,seg)),"gaps never borrow the next or previous result")
        seg.Start := 86430000,seg.AreaId := "137438993381"
        V48Assert(!IsObject(IPVSSelected(s,seg)),"different arena cannot match by timestamp alone")
        app := IPNewApp(),d := IPNewData("saved"),d.Finished := true,d.Arena := s
        seg.AreaId := "137438993370",out := IPVSSaved(d,seg,app)
        V48Assert(out.Rows[1].Value="Lost" && out.Rows[2].Value="1 – 2","saved overlay renders the selected match")
        V48Assert(out.Rows[3].Label="Loaded log" && out.Rows[3].Value="1W / 1L (50.0%)","saved totals clearly cover the loaded file")
        V48Assert(out.Rows[4].Value="1","unresolved results stay separate from win rate")
        seg.Start := 86455000
        V48Assert(IPVSSaved(d,seg,app).Rows[1].Value="Unresolved","partial EOF match is never displayed as a definite result")
        seg.AreaId := "123"
        V48Assert(IPVSSaved(d,seg,app).Message="Select an arena fight","PvE does not display a stale arena as the selected match")
        FileDelete(path),FileAppend(V7843TextMatch(0,["win"],true),path,"UTF-8")
        V48Assert(IPVSnapshot(IPVSScan(path,"UTF-8")).Losses=1,"observed early departure still counts as a loss")
        ; Clock samples outside arenas must carry midnight across a zone gap.
        FileDelete(path)
        outside := V7838ArenaLine(86399000,V7838ArenaActor(1),"=","Event","900001") "`n"
            . V7838ArenaLine(86401000,V7838ArenaActor(1),"=","Event","900001") "`n"
        FileAppend(outside V7843TextMatch(86420000,["win","win"]),path,"UTF-8")
        V48Assert(IPVSScan(path,"UTF-8").Matches[1].Start=86420000,"midnight outside arena preserves native timeline alignment")
        FileDelete(path),FileAppend(V7843TextMatch(0,["win","win"],false) "broken arena record`n",path,"UTF-8")
        V48Assert(IPVSnapshot(IPVSScan(path,"UTF-8")).Unknown=1,"missing arena input remains unresolved")
    }
    finally {
        if FileExist(path)
            FileDelete(path)
    }
}

V7843WorkerData(path)
{
    d := IPNewData("private saved log"),d.SourcePath := path,d.SourceKey := path
    d.SourceEncoding := "UTF-8",d.SourceLength := FileGetSize(path),d.SourceModified := FileGetTime(path,"M")
    d.CacheDigest := IPCHashFile(path),d.Finished := true
    seg := IPNewSegment(d,5000,"observed combat entry"),seg.Last := 5100,seg.End := 5100
    seg.AreaId := "137438993370",d.Segments.Push(seg),d.Current := ""
    return d
}

V7843WorkerWait()
{
    deadline := A_TickCount+20000
    while IsObject(IPVSState().Job) && A_TickCount<deadline
        Sleep(25)
    V48Assert(!IsObject(IPVSState().Job),"background arena worker finishes without blocking UI")
}

V7843PvPWorker() => V65UITimerIsolated(V7843PvPWorkerCase)
V7843PvPWorkerCase(*)
{
    global IP,IPM,SELF_TEST,SETTINGS_FILE
    old := IP,state := IPVSState(),oldRuntime := state.TestRuntime
    path := A_Temp "\IrisPvPWorkerTest-" INToken() ".txt"
    try {
        V48Assert(SELF_TEST && A_IsSuspended && !IsObject(state.Job),"worker tests require an isolated idle instance")
        state.TestRuntime := A_ScriptDir "\Iris_Test_Runtime.ahk"
        FileAppend(V7843TextMatch(0,["win","win"]) V7843TextMatch(20000,["loss","loss"]),path,"UTF-8")
        IP := IPNewApp(),IP.View := "Imported",IP.Selected := 1,IP.Follow := false
        IP.Offline := V7843WorkerData(path),IPM.Source := 2,IPM.Mode := 2,IPM.Shown["PvP"] := true
        ; Exercise session-only mode without opening the history catalogue.
        IPM.PvPRecordsExpanded := false
        p := IPM.Panels["PvP"],IPMEnsureGui("PvP",0,p)
        IPMPreviewSet(8),IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(!IsObject(state.Job) && !IP.Offline.HasOwnProp("ArenaLoad"),"explicit preview does not scan the saved log")
        IPMPreviewClear(IPM),IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(InStr(p.Meta.Text,"Loading arena results") && IsObject(state.Job),"saved rendering starts an isolated background scan")
        root := state.Job.Root
        V7843WorkerWait()
        V48Assert(IP.Offline.HasOwnProp("Arena"),"background results arrive: " (IP.Offline.HasOwnProp("ArenaLoad") ? IP.Offline.ArenaLoad.Message : "cancelled"))
        V48Assert(!FileExist(root),"completed worker removes only its private job files")
        IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(p.Rows[1].Value.Text="Won" && p.Rows[3].Value.Text="1W / 1L (50.0%)","native saved overlay shows selected match and whole-log W/L")
        V7842PvPCapture("pvp-saved.png",p)
        IP.Offline.Segments[1].Start := 25000,IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(p.Rows[1].Value.Text="Lost" && !IsObject(state.Job),"changing selected match reuses the completed scan")
        IP.Offline.Segments[1].AreaId := "137438989517",IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(p.VisibleRows=0 && InStr(p.Meta.Text,"does not currently support warzones"),"saved warzone selection clears all arena rows")
        IP.Offline := V7843WorkerData(path),IP.Offline.CacheDigest := StrReplace(IP.Offline.CacheDigest,SubStr(IP.Offline.CacheDigest,1,1),"z")
        IPVSRequest(IP.Offline),V7843WorkerWait()
        V48Assert(!IP.Offline.HasOwnProp("Arena") && InStr(IP.Offline.ArenaLoad.Message,"changed after loading"),"changed contents cannot be attached to old imported metrics")
        IP.Offline := V7843WorkerData(path),IPVSRequest(IP.Offline),prior := IP.Offline,root := state.Job.Root
        IP.Offline := IPNewData("different source"),IPVSPoll()
        V48Assert(!IsObject(state.Job) && !prior.HasOwnProp("ArenaLoad") && !IP.Offline.HasOwnProp("Arena"),"source replacement cancels stale result delivery")
        V48Assert(!FileExist(root),"cancelled worker releases its files")
        IP.Offline := V7843WorkerData(path),IPVSRequest(IP.Offline),IPM.Shown["PvP"] := false,IPVSPoll()
        V48Assert(!IsObject(state.Job) && !IP.Offline.HasOwnProp("ArenaLoad"),"disabling PvP cancels its background job")
        IPM.Shown["PvP"] := true,IPVSRequest(IP.Offline),IP.Active := true,IPVSPoll()
        V48Assert(!IsObject(state.Job),"live parsing cancels the saved job")
        IP.Active := false
        V48Assert(!FileExist(SETTINGS_FILE),"background scan and preview preserve preferences")
    }
    finally {
        IPVSStop(state),state.TestRuntime := oldRuntime
        IPMPreviewClear(IPM),IPMDestroyPanels(),IP := old
        if FileExist(path)
            FileDelete(path)
    }
}


V7844Run(fn) => V75LibraryRun(V7844Body.Bind(fn))
V7844Body(fn)
{
    s := IPVLState(),before := s.Clone()
    try {
        s.Mode := "Raids",s.Files := Map(),s.LoadedPath := "",s.Error := "",s.Notice := "",s.Shown := [],s.Characters := [],s.Servers := []
        s.SortColumn := 1,s.SortDescending := true
        s.Queue := [],s.Active := false,s.Current := "",s.Pending := "",s.Page := 1,s.Filling := false
        s.Started := 0,s.NativeBusy := false,s.PendingFiles := [],s.LastSave := 0,s.LastPaint := 0
        s.QueueId := "",s.QueuePath := "",s.QueueForced := Map(),s.QueueRetry := [],s.QueueError := "",s.QueueLock := 0
        s.Next := 1,s.Done := 0,s.Failed := 0,s.Skipped := 0
        s.Worker := {Job:"",ExitHook:"",TestRuntime:A_ScriptDir "\Iris_Test_Runtime.ahk"},s.ExitHook := ""
        fn.Call()
    }
    finally {
        IPVLStop()
        for key,value in before.OwnProps()
            s.%key% := value
    }
}

V7844File()
{
    SplitPath(ILBPath(),,&dir),path := dir "\combat_2026-10-25_00_00_00_001.txt"
    FileAppend(V7843TextMatch(0,["win","win"]) V7843TextMatch(20000,["loss","loss"]),path,"UTF-8")
    return {Path:path,Date:"20261025",Size:FileGetSize(path),Modified:FileGetTime(path,"M"),
        Digest:IPCHashFile(path),Encoding:"UTF-8",Matches:IPVSScan(path,"UTF-8").Matches}
}

V7844PvPLibrary() => V7844Run(V7844PvPLibraryCase)
V7844PvPLibraryCase()
{
    f := V7844File(),s := IPVLState(),files := Map(StrLower(f.Path),f)
    ILBLoad(),ILBCommit(V75LibraryFiles()),raid := FileRead(ILBPath(),"UTF-8")
    text := IGVJson(IPVLPack(files)),parsed := IPVLParse(text)
    V48Assert(IGVJson(IPVLPack(parsed))=text,"PvP results, roster, reasons and round times persist exactly")
    duplicate := f.Clone(),duplicate.Path .= ".copy",files[StrLower(duplicate.Path)] := duplicate
    rows := IPVLRows(files)
    V48Assert(rows.Length=2 && rows[1].Match.Outcome="loss","identical log copies count once and newest match comes first")
    V48Assert(IPVLRows(files,"corellia","","win").Length=1 && IPVLRows(files,"","missing").Length=0,"PvP search, character and result filters combine")
    bad := IPVLPack(Map(StrLower(f.Path),f)),bad[3] := 900
    V59ExpectError((*)=>IPVLParse(IGVJson(bad)))
    bad := IPVLPack(Map(StrLower(f.Path),f)),bad[4][1][7][1][6] := -1
    V59ExpectError((*)=>IPVLParse(IGVJson(bad)))
    IPVLLoad(),IPVLCommit(f),first := FileRead(IPVLPath(),"UTF-8")
    IPVLCommit(duplicate)
    V48Assert(s.Files.Count=2 && IPVLRows(s.Files).Length=2,"atomic merge preserves sources while copied matches remain deduplicated")
    V48Assert(FileRead(IPVLPath() ".bak","UTF-8")=first,"PvP save keeps the previous snapshot")
    V48Assert(FileRead(ILBPath(),"UTF-8")=raid,"arena storage never rewrites raid progression")
    FileAppend("changed",f.Path,"UTF-8")
    V48Assert(!IPVLSourceCurrent(f),"modified recordings need rescanning")
    FileDelete(IPVLPath()),FileAppend("broken",IPVLPath(),"UTF-8"),IPVLLoad(true)
    V59ExpectError((*)=>IPVLCommit(f))
    V48Assert(FileRead(IPVLPath(),"UTF-8")="broken" && s.Error!="","corrupt PvP catalogue is reported and preserved")
}

V7844Wait()
{
    deadline := A_TickCount+20000
    while IPVLState().Active && A_TickCount<deadline
        Sleep(25)
    V48Assert(!IPVLState().Active,"PvP library background queue finishes")
}

V7848PvPUnknownTime() => V7844Run(V7848PvPUnknownTimeCase)
V7848PvPUnknownTimeCase()
{
    f := V7844File(),s := IPVLState(),m := f.Matches[1]
    m.Outcome := "unknown",m.Reason := "insufficient_round_results",m.RoundWins := 1
    m.Rounds[2] := {Outcome:"unknown",Reason:"ambiguous_reset",At:-1}
    other := f.Clone(),other.Path := StrReplace(f.Path,"_001.txt","_002.txt"),other.Matches := [f.Matches[2]]
    FileCopy(f.Path,other.Path),other.Modified := FileGetTime(other.Path,"M")
    IPVLLoad(),s.QueueLock := IHAcquireLock(IPVLQueuePath()),IPVLQueueSave([f.Path,other.Path],Map())
    s.PendingFiles.Push(f),s.Done := 1,s.Next := 2,IPVLFlush()
    V48Assert(!s.PendingFiles.Length && s.Files.Count=1,"a missing round time no longer prevents saving the batch")
    checkpoint := IGJParse(FileRead(IPVLQueuePath() ".progress","UTF-8"))
    V48Assert(checkpoint[4]=2 && checkpoint[5]=1,"unknown round time allows checkpoint only after results are saved")
    V7847QueueFreshProcess()
    s.PendingFiles.Push(other),s.Done := 2,s.Next := 3,IPVLFlush(),IPVLStop()
    packed := IGVJson(IPVLPack(s.Files)),s.Files := Map(),s.Queue := [],s.QueuePath := ""
    IPVLLoad(true),IPVLQueueLoad(true)
    V48Assert(s.Error="" && s.QueueError="" && IGVJson(IPVLPack(s.Files))=packed,"known and unresolved results survive save and reload exactly")
    restored := s.Files[StrLower(f.Path)].Matches[1]
    V48Assert(restored.Rounds[2].At=-1 && restored.Rounds[2].Outcome="unknown" && restored.Rounds[2].Reason="ambiguous_reset","unknown time remains unknown without inventing a timestamp or result")
    V48Assert(IPVLRows(s.Files,"","","unknown").Length=1 && IPVLRows(s.Files,"","","loss").Length=1,"unresolved and known matches stay separately filterable and copies stay deduplicated")
    V48Assert(!IPVLQueueRemaining() && !s.Active,"saved queue finishes and reload does not restart it")
    for invalid in [-2,-0.5,"-1",1000000000001] {
        bad := IPVLPack(Map(StrLower(f.Path),f)),bad[4][1][7][1][11][2][3] := invalid
        V59ExpectError((*)=>IPVLParse(IGVJson(bad)))
    }
    V48Assert(IGVJson(IPVLPack(s.Files))=packed,"rejecting malformed times preserves the loaded catalogue")
}

V7844PvPLibraryUI() => V7844Run(V7844PvPLibraryUICase)
V7849LibraryRestart() => V7844Run(V7849LibraryRestartCase)
V7849LibraryRestartCase()
{
    keys := Buffer(256,0),oldKeys := Buffer(256,0),outside := Gui("+ToolWindow","Private unrelated window")
    DllCall("GetKeyboardState","Ptr",oldKeys),edit := outside.AddEdit()
    try {
        ILBBuildWindow(),s := ILBState(),s.Gui.Show("NA w1120 h760")
        s.Controls["Tabs"].Choose(6),IPVLModeChanged(),target := s.Controls["PvPSearch"].Hwnd
        NumPut("UChar",0x80,keys,0x11),DllCall("SetKeyboardState","Ptr",keys)
        V48Assert(ILBRestartKey(0x52,1,0x100,target)=0,"Ctrl+R is handled inside the PvP child controls")
        Sleep(20)
        V48Assert(IPMGuiAlive(s.Gui),"diagnostic guard prevents actual restart from queued shortcut")
        V48Assert(ILBRestartKey(0x52,0x40000001,0x100,target)=0,"held Ctrl+R is consumed without scheduling another restart")
        V48Assert(ILBRestartKey(0x52,1,0x100,edit.Hwnd)="","shortcut ignores messages from unrelated windows")
        V48Assert(ILBRestartKey(0x41,1,0x100,target)="","Ctrl+A remains available to edit controls")
        for key in [0x10,0x12,0x5B,0x5C] {
            NumPut("UChar",0x80,keys,key),DllCall("SetKeyboardState","Ptr",keys)
            V48Assert(ILBRestartKey(0x52,1,0x100,target)="","extra modifiers do not trigger restart")
            NumPut("UChar",0,keys,key)
        }
        NumPut("UChar",0,keys,0x11),DllCall("SetKeyboardState","Ptr",keys)
        V48Assert(ILBRestartKey(0x52,1,0x100,target)="","plain R remains available for searching")
        NumPut("UChar",0x80,keys,0x11),DllCall("SetKeyboardState","Ptr",keys),s.Gui.Hide()
        V48Assert(ILBRestartKey(0x52,1,0x100,target)="","hidden library cannot consume the shortcut")
        ILBClose()
        V48Assert(ILBRestartKey(0x52,1,0x100,target)="","closed library ignores stale control handles")
    }
    finally {
        SetTimer(ICRestart,0),DllCall("SetKeyboardState","Ptr",oldKeys),outside.Destroy()
    }
}

V7844PvPLibraryUICase()
{
    global IP,IPM,Audio
    s := IPVLState(),lib := ILBState(),f := V7844File(),live := IP.Live,queuedAudio := Audio.Queue
    ILBLoad(),ILBCommit(V75LibraryFiles()),raid := FileRead(ILBPath(),"UTF-8")
    ILBBuildWindow(),ILBRefresh(),c := lib.Controls
    V48Assert(c["Tabs"].Text="Raids" && !V7828OwnVisible(c["PvPList"]),"Library opens in Raids with PvP controls hidden")
    c["Search"].Value := "Tyth",c["Tabs"].Choose(6),ILBPageChanged()
    V48Assert(s.Mode="PvP" && V7828OwnVisible(c["Tabs"]) && V7828OwnVisible(c["PvPList"]) && !V7828OwnVisible(c["List"]),"PvP page keeps the native tab navigation visible without raid rows underneath")
    V48Assert(InStr(c["PvPDetail"].Text,"Warzones are not currently supported"),"unsupported warzones are clearly described")
    IPVLStart([f.Path,f.Path]),V7844Wait()
    V48Assert(s.Done=1 && !s.Failed && c["PvPList"].GetCount()=2,"real background scan indexes each log once: " s.Notice)
    V48Assert(InStr(c["PvPSummary"].Text,"1 W / 1 L") && InStr(c["PvPSummary"].Text,"50.0%"),"library shows filtered match totals")
    c["PvPResult"].Choose(2),IPVLFilter()
    V48Assert(c["PvPList"].GetCount()=1 && c["PvPList"].GetText(1,4)="Won","result filter shows matching arena result")
    c["PvPResult"].Choose(1),IPVLFilter()
    c["PvPList"].Modify(2,"Select Focus"),IPVLSelect()
    V48Assert(c["PvPOpen"].Enabled && InStr(c["PvPDetail"].Text,f.Path),"selection enables opening and identifies its source")
    IP.Offline := V7843WorkerData(f.Path),IP.View := "Imported",IP.Follow := false
    V48Assert(IPVLOpen() && IP.Selected=1 && IP.Offline.Arena.Matches.Length=2,"open reuses a verified loaded log and attaches the complete arena session")
    timing := {},IP.ImportTiming := timing,IP.ImportPath := f.Path,entry := IPVLSelected(),IPVLPrepareOpen(entry,timing)
    V48Assert(InStr(IPVLSelectPending(IP),"Selected arena match") && IP.Selected=1,"completed import selects the arena by identity and time")
    IP.ImportTiming := {},IPVLPrepareOpen(entry,{}),IP.Selected := 99
    V48Assert(IPVLSelectPending(IP)="" && IP.Selected=99,"an unrelated import cannot receive a stale match selection")
    s.Pending := ""
    IPVLStart([f.Path]),V48Assert(!s.Active && InStr(s.Notice,"up to date"),"unchanged indexed logs are skipped")
    c["Tabs"].Choose(1),ILBPageChanged()
    V48Assert(c["Search"].Text="Tyth" && !V7828OwnVisible(c["PvPList"]) && V7828OwnVisible(c["Tabs"]),"switching back restores raid filters")
    for page in [2,3,4,5] {
        c["Tabs"].Choose(page),ILBPageChanged()
        V48Assert(s.Mode="Raids" && V7828OwnVisible(c["Tabs"]) && !V7828OwnVisible(c["PvPList"]),"existing library page stays reachable after PvP: " page)
    }
    c["Tabs"].Choose(6),ILBPageChanged()
    previousCancel := lib.Cancel,lib.Cancel := {Cancel:false},lib.Busy := true
    try {
        ILBBusy()
        V48Assert(c["Cancel"].Enabled && !c["Loaded"].Enabled,"PvP page keeps Pause available for an existing raid import")
        ILBCancel()
        V48Assert(lib.Cancel.Cancel,"Pause still targets the actual raid import from the PvP page")
    } finally lib.Busy := false,lib.Cancel := previousCancel,ILBBusy()
    for size in [[664,428],[1120,760]] {
        ILBResize(lib.Gui,0,size[1],size[2]),controls := []
        for key in ["Tabs","PvPSearch","PvPCharacter","PvPResult","PvPRole","PvPServer","PvPSummary","PvPList","PvPDetail","PvPOpen","PvPReindex","PvPEarlier","PvPLater"] {
            control := c[key],control.GetPos(&x,&y,&w,&h)
            V48Assert(x>=0 && y>=0 && x+w<=size[1] && y+h<=size[2],"PvP controls fit at " size[1] " pixels: " key)
            controls.Push(control)
        }
        for key in ["Add","Folder","Loaded","Cancel","Status"]
            controls.Push(c[key])
        V7412PlayerControlsPng("pvp-library-" size[1] ".png",lib.Gui,controls,0,0,size[1],size[2])
    }
    IPVLStart([f.Path],true),IPVLTick(),root := s.Worker.Job.Root,IPVLStop("Paused")
    V48Assert(!s.Active && !IsObject(s.Worker.Job) && !FileExist(root),"pause kills only the owned worker and cleans its temporary files")
    V48Assert(s.Files.Count=1 && c["PvPList"].GetCount()=2,"pause preserves previously completed matches")
    s.Queue := [],s.QueuePath := "",IPVLRefresh()
    V48Assert(c["Cancel"].Enabled && c["Cancel"].Text="Resume" && InStr(c["Status"].Text,"1 log waiting"),"reopened PvP page shows saved queue and Resume")
    ILBCancel(),V7844Wait()
    V48Assert(s.Done=1 && !c["Cancel"].Enabled,"Resume button actually completes the pending scan and retires itself")
    V48Assert(FileRead(ILBPath(),"UTF-8")=raid && IP.Live=live && Audio.Queue=queuedAudio,"arena indexing and navigation preserve raid catalogue, live data and audio")
}

V7875PvPLibraryRoles() => V7844Run(V7875PvPLibraryRolesCase)
V7875PvPLibraryRolesCase()
{
    f := V7844File(),first := f.Matches[1],second := f.Matches[2]
    first.Role := 1,first.Server := "he3000",second.Role := 2,second.Server := "he3001"
    files := Map(StrLower(f.Path),f),packed := IPVLPack(files),text := IGVJson(packed),parsed := IPVLParse(text)
    V48Assert(IGVJson(IPVLPack(parsed))=text && IPVLMetadataCurrent(parsed[StrLower(f.Path)]),"roles and server survive exact save/reload")
    V48Assert(IPVLRows(files,"", "", "", "Tank",ILBServerFilterKey("he3000")).Length=1,"role and server filters combine")
    V48Assert(IPVLRows(files,"", "", "", "Tank",ILBServerFilterKey("he3001")).Length=0,"different server excludes the role match")
    V48Assert(IPVLRows(files,ILBServerLabel("he3000")).Length=1,"friendly server names can be searched")
    legacy := first.Clone(),legacy.DeleteProp("Role"),old := f.Clone(),old.Matches := [legacy],old.Path .= ".copy"
    older := Map(StrLower(old.Path),old),legacyText := IGVJson(IPVLPack(older)),legacyParsed := IPVLParse(legacyText)
    V48Assert(IGVJson(IPVLPack(legacyParsed))=legacyText && !IPVLMetadataCurrent(legacyParsed[StrLower(old.Path)]),"legacy summaries remain readable and marked for explicit metadata refresh")
    V48Assert(IPVLSourceCurrent(f),"metadata freshness never changes source identity verification")
    older[StrLower(f.Path)] := f
    V48Assert(IPVLRows(older).Length=2 && IPVLRows(older,"","","","Unknown").Length=0,"duplicate old copy does not hide updated role evidence")
    unknown := first.Clone(),unknown.Role := 8,unknown.Server := "",empty := f.Clone(),empty.Matches := []
    V48Assert(IPVLMetadataCurrent({Matches:[unknown]}) && IPVLMetadataCurrent(empty),"new unknown roles and old zero-match sources do not trigger repeated scans")
    unknownFile := f.Clone(),unknownFile.Matches := [unknown,second]
    V48Assert(IPVLRows(Map(StrLower(f.Path),unknownFile),"","","","Unknown","@unknown").Length=1,"Unknown server is distinct from All servers")
    for invalid in [0,3,5,7,9,1.5,"2"] {
        bad := IPVLPack(files),bad[4][1][7][1][14] := invalid
        V59ExpectError((*)=>IPVLParse(IGVJson(bad)))
    }
    many := f.Clone(),many.Matches := []
    Loop 502 {
        m := first.Clone(),m.Start := A_Index*1000,m.End := m.Start+500,m.Owner := "owner" A_Index
        m.Role := A_Index=502 ? 2 : 4,m.Server := A_Index=502 ? "he4000" : "he3000"
        many.Matches.Push(m)
    }
    rows := IPVLRows(Map(StrLower(many.Path),many),"","","","","",7,false)
    V48Assert(rows.Length=502 && rows[1].Match.Owner="owner502","role sorting covers all matches before page selection")
    rows := IPVLRows(Map(StrLower(many.Path),many),"","","","","",8,false)
    V48Assert(rows[1].Match.Owner="owner502","server sorting covers all matches before page selection")
    IPVLLoad(),IPVLCommit(many),ILBBuildWindow(),c := ILBState().Controls,c["Tabs"].Choose(6),IPVLModeChanged()
    s := IPVLState(),lv := c["PvPList"]
    V48Assert(lv.GetCount()=500 && lv.GetCount("Col")=8,"PvP list displays eight columns and pages at 500 matches")
    order := Buffer(32,0),SendMessage(0x103B,8,order.Ptr,lv)
    V48Assert(NumGet(order,12,"Int")=6 && NumGet(order,16,"Int")=7,"recorder role and server display beside the character without changing native column identities")
    c["PvPRole"].Choose(3),IPVLFilter()
    V48Assert(lv.GetCount()=1 && lv.GetText(1,7)="DPS","role dropdown filters visible matches")
    c["PvPRole"].Choose(1),IPVLFilter(),lv.Modify(2,"Select Focus"),IPVLSelect(),selected := IPVLRowKey(IPVLSelected())
    IPVLSort(lv,7)
    V48Assert(IPVLRowKey(IPVLSelected())=selected && c["PvPOpen"].Enabled,"sorting preserves selected match identity and open action")
    lv.Modify(0,"-Select"),IPVLSort(lv,8)
    V48Assert(s.Page=1 && s.Shown[1].Match.Owner="owner502","clicking Server sorts the complete set before the first page")
    IPVLSort(lv,8)
    V48Assert(s.Shown[1].Server=ILBServerLabel("he3000"),"clicking the same column reverses its order")
    for i,server in s.Servers
        if server=ILBServerFilterKey("he4000")
            c["PvPServer"].Choose(i+1)
    IPVLFilter()
    V48Assert(lv.GetCount()=1 && lv.GetText(1,8)=ILBServerLabel("he4000"),"server dropdown filters visible matches")
    legacyFile := f.Clone(),legacyFile.Matches := []
    for m in f.Matches {
        item := m.Clone(),item.DeleteProp("Role"),legacyFile.Matches.Push(item)
    }
    IPVLCommit(legacyFile),IPVLStart([f.Path]),V7844Wait()
    V48Assert(s.Done=1 && !s.Failed && IPVLMetadataCurrent(s.Files[StrLower(f.Path)]),"explicit scan refreshes legacy role metadata even when the raw source is unchanged")
    IPVLStart([f.Path])
    V48Assert(!s.Active && s.Skipped=1,"refreshed Unknown roles are current and skipped on later scans")
}


V7846PvPEstimate()
{
    s := {Next:1,Queue:[],Started:1000},s.Queue.Length := 44000
    V48Assert(InStr(IPVLProgressText(s,2000),"Estimating"),"first file does not invent an ETA")
    s.Next := 101
    V48Assert(InStr(IPVLProgressText(s,61000),"100 of 44,000") && InStr(IPVLProgressText(s,61000),"about 7 hr 19 min left"),"remaining time uses actual completed-file throughput")
    s.Next := 44000
    V48Assert(InStr(IPVLProgressText(s,61000),"under 1 min left"),"final file does not show a zero-minute estimate")
    s.Next := 1,s.Started := 62000
    V48Assert(InStr(IPVLProgressText(s,63000),"Estimating"),"resumed scan builds a new timing sample")
}

V7846PvPCapacity() => V7844Run(V7846PvPCapacityCase)
V7846PvPCapacityCase()
{
    f := V7844File(),files := [f],s := IPVLState(),path := f.Path
    Loop 44000 {
        item := f.Clone(),item.Path := path "." A_Index,item.Matches := []
        files.Push(item)
    }
    IPVLLoad(),IPVLCommit(files),s.Files := Map(),IPVLLoad(true)
    V48Assert(s.Error="" && s.Files.Count=44001 && IPVLRows(s.Files).Length=2,"44k empty/non-arena sources plus matches survive actual disk save/reload")
    item := f.Clone(),item.Path := path ".later",s.PendingFiles.Push(item)
    IPVLStop("Paused"),s.Files := Map(),IPVLLoad(true)
    V48Assert(s.Files.Count=44002 && !s.PendingFiles.Length,"Pause saves the pending batch without rescanning completed files")
    V48Assert(IPVLRows(s.Files).Length=2,"copied arena results remain deduplicated at archive size")
}

V7846PvPNative() => V7844Run(V7846PvPNativeCase)
V7846Matches(matches)
{
    return IGVJson(IPVLPack(Map("fixture",{Path:"fixture",Date:"20261025",Size:0,Modified:"20261025000000",
        Digest:Format("{:064}",0),Encoding:"UTF-8",Matches:matches})))
}
V7846PvPNativeCase()
{
    global IP
    previous := INState().TestHelper
    INState().TestHelper := A_ScriptDir "\iris-native-engine.exe"
    try {
        f := V7844File(),s := IPVLState()
        V48Assert(INAvailable(),"native PvP test requires the built helper")
        text := V7838ArenaLine(86399000,V7838ArenaActor(1),"=","Event","900001") "`n"
            . V7838ArenaLine(86401000,V7838ArenaActor(1),"=","Event","900001") "`n"
            . V7843TextMatch(86420000,["loss","win","loss"])
            . V7843TextMatch(86450000,["win"],false) "broken arena record`n"
        FileAppend(text,f.Path,"UTF-8")
        d := V7843WorkerData(f.Path),context := INContext(d),result := INLoad(context,,,"pvp-scan")
        native := IPVLNativeSession(result.Data,f.Path),reference := IPVSScan(f.Path,"UTF-8")
        V48Assert(V7846Matches(native.Matches)=V7846Matches(reference.Matches),"Rust evidence matches AHK results, names, roster order, midnight, EOF and malformed records")
        V48Assert(result.SourceDigest=IPCHashFile(f.Path),"Rust scan hashes the complete original file")
        context.Digest := Format("{:064}",0)
        V59ExpectError((*)=>INLoad(context,,,"pvp-scan"))
        s.Active := true,s.Current := d,IPVLNativeScan(d)
        V48Assert(d.ArenaLoad.HasOwnProp("Reader") && d.ArenaLoad.Reader="Rust" && !IsObject(s.Worker.Job),"supported input finishes through Rust without an AHK child")
        s.Active := false,s.Current := ""
        IPVLStart([f.Path]),V7844Wait()
        V48Assert(s.Done=1 && !s.Failed && s.Files.Count=1,"actual native queue completes and saves")
        V48Assert(V7846Matches(s.Files[StrLower(f.Path)].Matches)=V7846Matches(reference.Matches),"persisted native scan preserves every reference arena result")
        IPVLStart([f.Path])
        V48Assert(!s.Active && s.Skipped=1,"native completed source is skipped on next scan")
        s.Active := false,s.Current := d
        V59ExpectError((*)=>IPVLNativeCheck(d))
        V48Assert(INState().Jobs.Count=0,"native jobs are cleaned up after success and rejection")
        s.Active := true,s.Current := d
        context := INContext(d)
        V59ExpectError((*)=>INLoad(context,IPVLNativeCheck.Bind(d),V7846PauseNative,"pvp-scan"))
        V48Assert(!s.Active && INState().Jobs.Count=0 && !IsObject(s.Worker.Job),"pausing a native job retires its owned process without starting a fallback")
        SplitPath(f.Path,,&dir),badPath := dir "\combat_2026-10-25_00_00_00_002.txt"
        FileAppend(StrReplace(V7843TextMatch(0,["win","win"]),"Player","Pl" Chr(233) "yer"),badPath,"CP1252")
        FileAppend("[00:00:19.000] " Chr(233) "`n",badPath,"CP1252")
        bad := V7843WorkerData(badPath),s.Active := true,s.Current := bad,IPVLNativeScan(bad)
        V48Assert(IsObject(s.Worker.Job),"unsupported byte encoding uses the reference worker")
        deadline := A_TickCount+10000
        while IsObject(s.Worker.Job) && A_TickCount<deadline
            Sleep(10)
        V48Assert(bad.HasOwnProp("Arena") && V7846Matches(bad.Arena.Matches)=V7846Matches(IPVSScan(badPath,"UTF-8").Matches),"reference fallback preserves results with malformed input encoding")
        s.Active := false,s.Current := ""
        s.PendingFiles.Push(f),s.Error := "damaged catalogue"
        V59ExpectError(IPVLFlush)
        V48Assert(s.PendingFiles.Length=1,"failed batch save retains completed results for retry")
        s.Error := "",IPVLFlush()
        V48Assert(!s.PendingFiles.Length && s.Files.Count=1,"retry saves the retained batch without a rescan")
    }
    finally INState().TestHelper := previous
}

V7846PauseNative(*) => IPVLStop("Paused")

V7846QuietWorker()
{
    root := A_Temp "\IrisQuietTest-" INToken(),DirCreate(root),handle := 0
    try {
        text := '#Requires AutoHotkey v2.0`n#NoTrayIcon`nSuspend(true)`ns := Buffer(A_PtrSize=8 ? 104 : 68,0)`nDllCall("GetStartupInfoW","Ptr",s)`nFileAppend(NumGet(s,A_PtrSize=8 ? 60 : 44,"UInt") "|" NumGet(s,A_PtrSize=8 ? 64 : 48,"UShort"),A_ScriptDir "\flags.txt")`nExitApp()`n'
        FileAppend(text,root "\quiet.ahk","UTF-8"),handle := INLaunch(A_AhkPath,["/ErrorStdOut=UTF-8",root "\quiet.ahk"])
        V48Assert(INWait(handle,10000),"hidden test worker exits")
        V48Assert(FileRead(root "\flags.txt")="129|0","actual child receives no startup cursor feedback and SW_HIDE")
    }
    finally {
        if handle {
            if !INWait(handle)
                DllCall("TerminateProcess","Ptr",handle,"UInt",10),INWait(handle,1000)
            DllCall("CloseHandle","Ptr",handle)
        }
        for name in ["flags.txt","quiet.ahk"]
            if FileExist(root "\" name)
                FileDelete(root "\" name)
        DirDelete(root)
    }
}

V7847PvPResume() => V7844Run(V7847PvPResumeCase)
V7847PvPResumeCase()
{
    global IP
    f := V7844File(),s := IPVLState(),other := StrReplace(f.Path,"_001.txt","_002.txt")
    FileCopy(f.Path,other),IPVLLoad()
    s.QueueLock := IHAcquireLock(IPVLQueuePath()),IPVLQueueSave([f.Path,other],Map())
    s.PendingFiles.Push(f),s.Done := 1,s.Next := 2,IPVLStop("Paused")
    V48Assert(!s.QueueLock && !s.PendingFiles.Length,"pause saves completed results before releasing queue ownership")
    V7847QueueFreshProcess()
    s.Queue := [],s.QueuePath := "",s.QueueId := "",s.Files := Map(),IPVLLoad(true),IPVLQueueLoad()
    V48Assert(s.Queue.Length=2 && s.Next=2 && s.Done=1 && s.Files.Count=1,"restart restores exact position and saved results")
    V48Assert(!s.Active && !IsObject(s.Worker.Job) && IPVLQueueRemaining()=1,"reloading a queue never starts it automatically")
    V48Assert(InStr(IPVLQueueStatus(),"1 log waiting") && InStr(IPVLQueueStatus(),"Resume"),"paused scan exposes remaining count and Resume action")
    IP.Active := true,IPVLResume()
    V48Assert(!s.Active && IPVLQueueRemaining()=1,"live parsing cannot discard or start the saved queue")
    IP.Active := false,IPVLResume(),V7844Wait()
    V48Assert(s.Done=1 && s.Files.Count=2 && !IPVLQueueRemaining(),"resume scans only the unfinished file")
    IPVLQueueLoad(true)
    V48Assert(s.Next>s.Queue.Length && !IPVLQueueRemaining(),"completed queue stays completed across restart")
    s.QueueLock := IHAcquireLock(IPVLQueuePath()),IPVLQueueSave([f.Path],Map(StrLower(f.Path),true)),IPVLStop()
    IPVLQueueLoad(true),IPVLResume(),V7844Wait()
    V48Assert(s.Done=1 && !s.Skipped,"forced reindex survives restart even when source is unchanged")
    IPVLStart([f.Path])
    V48Assert(!s.Active && s.Skipped=1,"completed forced reindex does not force future ordinary scans")
}

V7847QueueFreshProcess()
{
    SplitPath(ILBPath(),,&dir),script := dir "\queue-child.ahk",result := dir "\queue-child.json",handle := 0
    text := '#Requires AutoHotkey v2.0`n#NoTrayIcon`nSuspend(true)`nSOPHIE_TEST_HARNESS := true`nIRIS_V48_TEST_ENTRY := QueueChild`n'
        . '#Include ' A_ScriptDir '\Iris_Test_Runtime.ahk`n'
        . 'QueueChild(*) {`nILBState().TestPath := A_Args[1]`nIPVLLoad(),IPVLQueueLoad()`ns := IPVLState()`n'
        . 'FileAppend(IGVJson([s.Queue.Length,s.Next,s.Done,s.Files.Count,s.Active ? 1 : 0]),A_Args[2],"UTF-8")`nExitApp()`n}`n'
    FileAppend(text,script,"UTF-8")
    try {
        handle := INLaunch(A_AhkPath,["/ErrorStdOut=UTF-8",script,ILBPath(),result])
        V48Assert(INWait(handle,10000),"separate diagnostic process reads the saved queue and exits")
        V48Assert(FileExist(result) && Trim(FileRead(result,"UTF-8"))="[2,2,1,1,0]","fresh process restores position and results without starting the scan")
    }
    finally {
        if handle {
            if !INWait(handle)
                DllCall("TerminateProcess","Ptr",handle,"UInt",10),INWait(handle,1000)
            DllCall("CloseHandle","Ptr",handle)
        }
    }
}

V7847PvPQueueGuards() => V7844Run(V7847PvPQueueGuardsCase)
V7847PvPQueueGuardsCase()
{
    f := V7844File(),s := IPVLState(),path := IPVLQueuePath()
    IPVLLoad(),s.QueueLock := IHAcquireLock(path),IPVLQueueSave([f.Path],Map()),IPVLQueueCheckpoint()
    initial := FileRead(path ".progress")
    s.PendingFiles.Push(f),s.Next := 2,s.Error := "save denied"
    V59ExpectError(IPVLFlush)
    V48Assert(FileRead(path ".progress")=initial && s.PendingFiles.Length=1,"failed index save cannot advance durable scan progress")
    s.Error := "",IPVLFlush(),IPVLStop(),IPVLQueueLoad(true)
    V48Assert(!IPVLQueueRemaining() && s.Files.Count=1,"successful retry commits results before the checkpoint")
    ; Stale checkpoint from a previous queue is harmless after root replacement.
    s.QueueLock := IHAcquireLock(path),IPVLQueueSave([f.Path],Map(StrLower(f.Path),true)),IPVLQueueLoad(true)
    V48Assert(s.Next=1 && IPVLQueueRemaining()=1,"new queue ignores a checkpoint with a different identity")
    IPVLStop()
    lock := IHAcquireLock(path)
    try {
        before := FileRead(path),IPVLResume()
        V48Assert(!s.Active && FileRead(path)=before,"another instance owning the scan prevents replacement")
    }
    finally DllCall("CloseHandle","Ptr",lock)
    FileDelete(path),FileAppend("broken",path,"UTF-8")
    s.QueuePath := "",IPVLQueueLoad(),IPVLResume()
    V48Assert(s.QueueError!="" && FileRead(path)="broken" && !s.Active,"damaged queue is reported and preserved")
    V59ExpectError((*)=>IPVLQueueParse(IGVJson(["IrisPvPQueue",1,INToken(),[["relative.txt",0]]])))
}

V7847PvPQueueMerge() => V7844Run(V7847PvPQueueMergeCase)
V7847PvPQueueMergeCase()
{
    f := V7844File(),s := IPVLState(),other := StrReplace(f.Path,"_001.txt","_002.txt")
    FileCopy(f.Path,other),IPVLLoad()
    s.QueueLock := IHAcquireLock(IPVLQueuePath()),IPVLQueueSave([f.Path],Map()),IPVLStop()
    IPVLStart([other,f.Path]),V7844Wait()
    V48Assert(s.Done=2 && s.Files.Count=2 && !IPVLQueueRemaining(),"adding files preserves pending work and deduplicates repeated sources")
    missing := StrReplace(f.Path,"_001.txt","_003.txt"),IPVLStart([missing]),V7844Wait()
    IPVLQueueLoad(true)
    V48Assert(s.Failed=1 && IPVLQueueRemaining()=1,"unavailable source remains available for retry after restart")
    FileCopy(f.Path,missing),IPVLResume(),V7844Wait()
    V48Assert(s.Done=1 && !s.Failed && !IPVLQueueRemaining(),"Resume recovers an unavailable file without rescanning completed sources")
}

V7847PvPQueueLarge() => V7844Run(V7847PvPQueueLargeCase)
V7847PvPQueueLargeCase()
{
    f := V7844File(),s := IPVLState(),paths := []
    Loop 44000
        paths.Push(f.Path "." A_Index)
    s.QueueLock := IHAcquireLock(IPVLQueuePath()),IPVLQueueSave(paths,Map()),s.Next := 129,s.Done := 128
    IPVLStop(),size := FileGetSize(IPVLQueuePath()),s.Queue := [],s.QueuePath := "",IPVLQueueLoad()
    V48Assert(s.Queue.Length=44000 && s.Next=129 && IPVLQueueRemaining()=43872,"44k-source queue survives disk checkpoint and restart")
    V48Assert(FileGetSize(IPVLQueuePath() ".progress")<1024 && size>1000000,"batch checkpoints stay small instead of rewriting the entire path list")
}

; Isolated final-sequence and debuff regressions; no audio or live settings.
V7850IzaxFinal(s,at := 2900,boss := "")
{
    boss := boss!="" ? boss : V56Boss(1,"4108097563918336")
    IPFeedLine(s,V671FloorLine(at,boss,"=","4168751092072448","836045448945472","836045448945482",""))
}
V7850IzaxCompletion()
{
    ally := "@Survivor#561|(0,0,0,0)|(900/1000)"
    relay := "Relay {4163128979881984}:561|(0,0,0,0)|(0/1)"
    for deadExit in [false,true] {
        s := V561Izax()
        V51Feed(s,2400,"Damage",10,ally,V56Boss(1,"4108097563918336"))
        V51Feed(s,2500,"Death",0,V56Boss(),V56Who(0))
        if deadExit
            V51Feed(s,2501,"Exit",0,V56Who(0),"=")
        V7850IzaxFinal(s)
        V48Assert(!s.Current.Terminal,"final cast ending alone leaves the encounter open")
        V51Feed(s,3066,"Death",0,ally,relay),seg := s.Current
        V48Assert(seg.Terminal && seg.Last=3066 && seg.ScriptClosedAt=3066 && s.InCombat=0,"relay ends the final sequence with a dead recorder")
        V48Assert(seg.ScriptExitAt=-1 && IRSProof(seg).Confirmed && IRSProof(seg).At=3066,"timer gets the relay split without inventing a living recorder exit")
        V51Feed(s,3066,"Heal",20,ally,"=",false,20)
        V51Feed(s,3067,"Heal",100,ally,"=",false,100)
        V51Feed(s,6000,"Activate",0,ally,"=")
        V48Assert(!IsObject(s.Current) && seg.End=3066 && seg.Totals[IPActor(ally).Key].Effective=20,"inclusive final millisecond; later activity does not extend the fight")
        V51Feed(s,6100,"Damage",100,V56Who(),V56Boss(1,"4108097563918336"))
        V48Assert(!IsObject(s.Current),"late old-boss damage does not reopen the kill")
        V51Feed(s,10000,"Enter",0,V56Who(),"=")
        V51Feed(s,10100,"Damage",100,V56Who(),V56Boss(900,"4108097563918336",57))
        V48Assert(s.Segments.Length=2 && !s.Current.Terminal && s.Current.ScriptFinalAt=-1,"fresh pull has no inherited final-sequence evidence")
    }
    for scenario in ["no final","wrong instance","reset","stale","no survivor","wrong relay","no stage","no one","wrong mode"] {
        s := V561Izax(scenario!="no stage",scenario!="no one",scenario="wrong mode" ? "836045448953652" : "836045448953655")
        if scenario!="no final"
            V7850IzaxFinal(s,2900,scenario="wrong instance" ? V56Boss(1,"4108097563918336",999) : scenario="no one" ? V56Boss(100,"4108097563918336") : "")
        if scenario="reset"
            V51Feed(s,2950,"Damage",10,V56Who(),V56Boss(900,"4108097563918336"))
        V51Feed(s,scenario="stale" ? 40000 : 3066,"Death",0,V56Who(scenario="no survivor" ? 0 : 900),scenario="wrong relay" ? V56Boss(0,"4163128979881984") : relay)
        V48Assert(!s.Current.Terminal,"no inferred kill for " scenario)
    }
}
V7850InductionDebuff() => V7821Fixture(V7850InductionDebuffCase)
V7850InductionDebuffCase()
{
    f := V7878FHSegment("G-IZ"),boss := V7820Boss(750),a := PAFTestActor("Carrier",3),b := PAFTestActor("Clipped",4)
    PAFTestFeed(f,100000,boss,"=","4168128321814528","cast")
    PAFTestFeed(f,101000,boss,a,"4168128321814528","apply","")
    PAFTestFeed(f,105000,boss,a,"4168128321814528","apply","")
    PAFTestFeed(f,105001,boss,b,"4168128321814528")
    PAFTestFeed(f,105002,boss,b,"4168128321814528","apply"," (1 charges {836045448953667})","4168128321814821")
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=0,"damage and Building Cascade are not a transferred induction")
    PAFTestFeed(f,107000,boss,b,"4168128321814528","apply","")
    m := IFHModel(f.Segment),item := m.Findings.Findings["induction:1"]
    V48Assert(item.At=107000 && InStr(item.Text,"Carrier") && InStr(item.Details,"Clipped"),"debuff transfer records its actual time and recipient")
    PAFTestFeed(f,107001,boss,b,"4168128321814528","apply","")
    PAFTestFeed(f,107002,boss,PAFTestActor("Second",5),"4168128321814528","apply","")
    V48Assert(m.Findings.Findings.Count=1 && InStr(item.Details,"Second"),"one cast groups multiple actual recipients")
    PAFTestFeed(f,130000,boss,"=","4168128321814528","cast")
    PAFTestFeed(f,135000,boss,b,"4168128321814528","apply","")
    V48Assert(m.Findings.Findings.Count=1,"no carrier attribution without an original mark")
    f := V7850Fixture("G-IZ"),izax := V7850NPC("4108097563918336")
    V7850Event(f,30000,izax,"=","4168128321814528","Activate")
    V7850Event(f,31000,izax,"@Marked#1","4168128321814528","Apply")
    V7850Event(f,35001,izax,"@Nearby#1","4168128321814528","Damage",100)
    V48Assert(!InStr(V7850Text(f),"received induction:"),"death feedback also ignores clipped damage")
    f.Recap := f.Recap.Clone()
    V7850Event(f,37000,izax,"@Nearby#1","4168128321814528","Apply")
    V48Assert(InStr(V7850Text(f),"marked Marked; received induction: Nearby"),"death feedback recognizes the actual transferred debuff")
}

; Isolated catalogue transactions. Failure leaves Progression at the old build
; with unchanged fight bounds while Library already contains the corrected pull.
V7851ImportRetry() => V76Run(V7851ImportRetryCase)
V7851ImportRetryCase()
{
    V7851ImportRetryScenario(false)
}

V7851ImportCrashWindow() => V76Run(V7851ImportCrashWindowCase)
V7851ImportCrashWindowCase()
{
    V7851ImportRetryScenario(true)
}

V7851ImportRetryScenario(crashWindow)
{
    q := IQIState(),s := ILBState(),fixture := V68ReviewFile(),job := "",lock := 0
    SplitPath(s.TestPath,,&folder)
    path := folder "\combat_2026-10-03_20_00_00_785151.txt"
    try {
        FileCopy(fixture.Path,path),ILBLoad(),job := IGRBegin("private retry audit")
        file := ILBScan(path,"20261003",job),IGREnd(job),job := ""
        V48Assert(file.Pulls.Length=1 && file.ProgressionPulls.Length=1,"retry audit has one recorded boss pull")
        expected := IGVJson(IGVPackPull(file.ProgressionPulls[1]))
        stale := IPRCloneSnapshot(file),stale.Version := "prior-audit-build"
        stale.ProgressionPulls[1].Reason := "old parser result before correction"
        stale.ProgressionPulls[1].Progress.Kill := !file.ProgressionPulls[1].Progress.Kill
        stale.Pulls[1].Result := stale.ProgressionPulls[1].Progress.Kill ? "Kill" : "No kill"
        ILBCommit(Map(StrLower(path),stale)),IUPSaveProgression(stale,q.TestHistory)
        IQIEnqueue([path]),lock := IHAcquireLock(q.TestHistory)
        if crashWindow {
            q.Items[1].State := "Importing",IQIJournalSave(1)
            q.Checked := [{Index:1,File:file,ScanMs:1,Elapsed:1}]
            V59ExpectError(IQIFlushChecked)
            ; No queue snapshot or graceful shutdown runs after the failed save.
        }
        else
            IQIRun()
        V48Assert(s.Files[StrLower(path)].Version="0.78.112","Library commits the corrected build before the history lock failure")
        V48Assert(IUPHasProgression(file,q.TestHistory),"old Progression still has matching bounds, exercising the fast-skip hazard")
        oldHistory := IGVReadHistory(q.TestHistory)
        for key,e in oldHistory
            V48Assert(IGVJson(IGVPackPull(e.Pull))!=expected,"failed Progression commit retains the previous pull")
        DllCall("CloseHandle","Ptr",lock),lock := 0
        q.Loaded := false,IQILoad()
        retryPersisted := q.Items[1].State="Pending" && q.Items[1].Force
        IQIRun(),corrected := IGVReadHistory(q.TestHistory)
        V48Assert(q.Items[1].State="Done" && q.Items[1].Note!="Already current","Resume retries both catalogues instead of accepting matching bounds")
        for key,e in corrected
            V48Assert(IGVJson(IGVPackPull(e.Pull))=expected,"successful retry restores the corrected result and full Progression snapshot")
        V48Assert(retryPersisted,"unacknowledged paired save persists a forced retry")
        IQIEnqueue([path]),IQIRun()
        V48Assert(q.Items[1].Note="Already current","acknowledged unchanged recordings retain normal fast reuse")
    }
    finally {
        if lock
            DllCall("CloseHandle","Ptr",lock)
        if IsObject(job)
            IGREnd(job)
        FileDelete(fixture.Path)
    }
}

V7851ImportForcePreserved() => V76Run(V7851ImportForcePreservedCase)
V7851ImportForcePreservedCase()
{
    q := IQIState(),paths := V766Sources(2)
    q.Items[2].Force := true,IQISave(),IQIRun()
    V48Assert(q.Items[1].State="Done" && !q.Items[1].Force,"ordinary successful imports restore their original nonforced flag")
    V48Assert(q.Items[2].State="Done" && q.Items[2].Force,"explicitly forced imports remain forced after success")
    q.Loaded := false,IQILoad()
    V48Assert(!q.Items[1].Force && q.Items[2].Force,"original force flags survive the completed queue journal")
}

V7851ImportJournalPrefix() => V76Run(V7851ImportJournalPrefixCase)
V7851ImportJournalPrefixCase()
{
    q := IQIState(),s := ILBState(),files := V7711Files(V7711Sources(33))
    probe := {Force:false,Lock:0},q.Checked := [],libraryBefore := s.Original,revisionBefore := s.Revision
    for i,file in files {
        q.Items[i].State := "Importing"
        q.Checked.Push({Index:i,File:file,ScanMs:1,Elapsed:1})
    }
    IQISave()
    ; Take the journal lock immediately after the first 32 retry markers have
    ; persisted. The second append fails before either catalogue can change.
    q.Items[33].DefineProp("Force",{Get:(*)=>probe.Force,Set:V7851ImportJournalLock.Bind(probe)})
    try {
        V59ExpectError(IQIFlushChecked)
        V48Assert(probe.Lock && q.SaveError!="","second retry-marker append fails on the private queue lock")
        V48Assert(s.Original=libraryBefore && s.Revision=revisionBefore && !s.Files.Count,"partial retry-marker journal leaves Library unmodified")
        V48Assert(!FileExist(q.TestHistory),"partial retry-marker journal leaves Progression unmodified")
        for item in q.Items
            V48Assert(item.State="Pending","every uncommitted source remains pending after journal failure")
        DllCall("CloseHandle","Ptr",probe.Lock),probe.Lock := 0
        q.Loaded := false,IQILoad()
        V48Assert(q.Items[1].Force && q.Items[32].Force && !q.Items[33].Force,"journal reload recovers its complete forced-retry prefix")
        V48Assert(q.Items[1].State="Pending" && q.Items[33].State="Pending","interrupted imports resume from both sides of the journal boundary")
        IQIRun()
        V48Assert(s.Files.Count=33 && IGVReadHistory(q.TestHistory).Count=33,"Resume saves every source in both catalogues after a partial marker journal")
        for item in q.Items
            V48Assert(item.State="Done","all 33 sources finish after journal recovery")
    }
    finally {
        if probe.Lock
            DllCall("CloseHandle","Ptr",probe.Lock)
    }
}

V7851ImportJournalLock(probe,item,value)
{
    probe.Force := value
    if value && !probe.Lock
        probe.Lock := IHAcquireLock(IQIPath())
    return value
}

V7851MergedHealthPreview() => V7821Fixture(V7851MergedHealthPreviewCase)
V7851MergedHealthPreviewCase()
{
    global IP,IPM
    IP := IPNewApp(),IPM.Enabled := true,IPM.Shown["BossHP"] := true,IPM.Source := 2
    IP.Offline := V7849SavedFixture(),IP.View := "Imported",IP.Selected := 1,IP.Follow := false
    selected := IP.Offline.Segments[1],stamp := V7849TotalStamp(selected)
    snapshot := IPMOverlaySnapshot(IP,IPM),p := IPM.Panels["BossHP"]
    V48Assert(snapshot.Raid.Health.Length>0,"saved fixture has a real HP display before preview")
    IPMEnsureGui("BossHP",0,p),IPMRender("BossHP",snapshot,p)
    before := [p.Rows[1].Name.Text,p.Rows[1].Total.Text,p.Rows[1].Value.Text,p.VisibleRows]
    for count in [8,16] {
        V48Assert(IPMPreviewSet(count),"explicit preview starts over the saved boss")
        preview := IPMOverlaySnapshot(IP,IPM),IPMRender("BossHP",preview,p)
        V48Assert(p.VisibleRows=4 && InStr(p.Heading.Text,"Preview"),"the complete merged HP panel is a clearly labelled sample")
        V48Assert(p.Rows[1].Name.Text="Sample Boss A" && p.Rows[3].Name.Text="Izax shield" && p.Rows[3].Value.Text="~45%",
            "saved HP cannot suppress the merged shield preview or mix with sample mechanics")
        V48Assert(p.Rows[4].Name.Text="Next interrupt" && p.Rows[4].Value.Text="Sophie","the interrupt sample is visible too")
        stale := IPM.PreviewSnapshot,IPMEndRaidPreview()
        IPMRender("BossHP",stale,p)
        V48Assert(!InStr(p.Heading.Text,"Preview") && p.VisibleRows=before[4],"cached preview snapshots are rejected after Stop")
        V48Assert(p.Rows[1].Name.Text=before[1] && p.Rows[1].Total.Text=before[2] && p.Rows[1].Value.Text=before[3],
            "the selected boss HP values return unchanged")
        V48Assert(IP.Offline.Segments[1]=selected && IP.Selected=1 && V7849TotalStamp(selected)=stamp,
            "preview leaves the saved selection and combat totals intact")
    }
    V48Assert(IPMPreviewSet(8),"preview can be entered again")
    stale := IPM.PreviewSnapshot,IP.Active := true,IP.Live := V7878FHSegment("Other").Data
    IPM.Source := 1,IPMRender("BossHP",stale,p)
    V48Assert(!InStr(p.Heading.Text,"Preview") && !IBMHealthRows(IPMPreviewPanel("BossHP",stale)).Length,
        "starting live parsing rejects the old sample before the next poll")
    IP.Active := false,IPMPreviewClear(IPM)
}

V7851RaidPhaseStatus() => V75LibraryRun(V7864PhaseFixture.Bind(V7851RaidPhaseStatusCase))
V7851RaidPhaseStatusCase(s,seg,path,text)
{
    global IP
    c := IPWState().Controls,status := c["RaidPhaseStatus"],hwnd := status.Hwnd,scale := A_ScreenDPI/96
    V48Assert(IRPLoad() && V7867PhaseBarVisible(),"phase loading feedback starts before replay")
    for font in ["Quicksand","Segoe UI","Trebuchet MS"] {
        status.SetFont("s9",font)
        for width in [980,1000,1220,1920,980] {
            IPResize(IP.Gui,0,width,780)
            status.GetPos(&x,&y,&w,&h),c["RaidRange"].GetPos(&rx,,&rw)
            full := IUMTextWidth("Loading phases…",SendMessage(0x31,0,0,hwnd))
            actual := IUMTextWidth(status.Text,SendMessage(0x31,0,0,hwnd))
            expected := full<=Floor(w*scale) ? "Loading phases…" : "Loading…"
            V48Assert(status.Text=expected && actual<=Floor(w*scale),"loading label fits its actual native font at " width " / " font)
            V48Assert(x>=rx+rw+8 && x+w<=width-12 && status.Hwnd=hwnd,"label remains beside time range without replacing controls")
            V48Assert(V7867PhaseBarVisible(),"responsive status keeps busy feedback visible")
            if width>=1220
                V48Assert(status.Text="Loading phases…","wide windows retain the full phase-loading description")
        }
    }
    IRPCancel()
    V48Assert(V7867PhaseBarHidden(),"cancelling phase load hides both responsive status and marquee")
}

V7851ProgressionDemoHealth()
{
    for d in [IGVDemoData(),IGKDemoData(),IGVSistersDemoData()] {
        entries := []
        for i,p in d.Pulls
            entries.Push({Key:"demo-audit|" i,Date:"20260927",Team:"Demo",Pull:p})
        model := IGVPlotModel(entries,900,250)
        V48Assert(d.Demo && model.Count=d.Pulls.Length && model.Unknown=0,"explicit progression demos provide usable health for every example pull")
        for i,point in model.Points {
            p := d.Pulls[i],health := IGPYEntryHealth(entries[i])
            V48Assert(IsObject(health) && point.Known,"demo health passes the same strict checks as saved observations")
            V48Assert(point.Y>=model.Top && point.Y<=model.Bottom,"demo points stay inside the plot")
            V48Assert(point.Kill=!!p.Progress.Kill,"health examples do not invent kills")
            restored := p.Clone(),restored.Progress := IGVUnpackProgress(IGVPackProgress(p.Progress))
            restoredEntry := entries[i].Clone(),restoredEntry.Pull := restored
            restoredHealth := IGPYEntryHealth(restoredEntry)
            V48Assert(IsObject(restoredHealth) && restoredHealth.Hp=health.Hp && restoredHealth.Targets.Length=health.Targets.Length,"compact demo health survives the real history format")
        }
    }
}

PANTTestNPC(hour,instance,hp := 1000)
{
    for site in NBTurretSites() {
        if site.Id=hour
            return "Rail Turret {4132746381230080}:" instance "|(" site.X "," site.Y ",207.94,0)|(" hp "/1000)"
    }
}
PANTTestBoss(f,at,x := -448,y := 2566)
{
    return PAFTestFeed(f,at,"Nahut {4122949560827904}:9|(" x "," y ",207.94,0)|(1000/1000)","=","123","cast","")
}
PANTTestPulse(f,at)
{
    return PAFTestFeed(f,at,PAFTestNPC("4122580193640448",8),PAFTestActor("Tank"),"4133016964169728")
}
PANTTestOpening()
{
    f := V7878FHSegment("G-NA",0)
    PANTTestBoss(f,9000)
    PAFTestFeed(f,10000,PANTTestNPC(3,1),PAFTestActor("Tank"),"","event","","836045448953668")
    PAFTestFeed(f,11000,PANTTestNPC(11,2),PAFTestActor("Tank"),"","event","","836045448953668")
    PANTTestPulse(f,18000),PANTTestPulse(f,18001)
    return f
}
PANTDead(f,at,hour,id) => PAFTestFeed(f,at,PAFTestNPC("4122580193640448",8),PANTTestNPC(hour,id,0),"4132991194366258")
PANTAttack(f,at,hour,id,hp := 1000) => PAFTestFeed(f,at,PANTTestNPC(hour,id,hp),PAFTestActor("Tank"),"4134064936189952")
PANTTestDeadlines()
{
    f := PANTTestOpening(),n := IFHModel(f.Segment).Findings.Turrets
    V48Assert(n.Count=1 && n.Waves[1][1].Label="1st far" && n.Waves[1][2].Label="1st close","opening uses boss distance and batches shockwave hits")
    PANTAttack(f,31000,11,2),V48Assert(!IFHModel(f.Segment).Findings.Findings.Count,"first pull-in has no turret due")
    PANTTestPulse(f,43500),PANTAttack(f,45499,11,2)
    V48Assert(!IFHModel(f.Segment).Findings.Findings.Count,"activity before two seconds fits grace")
    PANTDead(f,45499,11,2),PANTAttack(f,45500,11,2)
    V48Assert(!IFHModel(f.Segment).Findings.Findings.Count,"accepted death suppresses stale later positive HP")
    PANTTestPulse(f,69000),PANTAttack(f,71000,3,1)
    model := IFHModel(f.Segment),v := IFHView(f.Segment,model,false,90000)
    V48Assert(v.Findings.Length=1 && v.Findings[1].Text="1st far failed at 3 o’clock","far failure has short clock label")
    PANTDead(f,95000,3,1)
    V48Assert(IFHModel(f.Segment).Findings.Findings.Count=1,"later consumption keeps earlier missed deadline")
    f2 := PANTTestOpening(),PANTTestPulse(f2,43500)
    PAFTestFeed(f2,60000,PANTTestNPC(11,2),PAFTestActor("Tank"),"","event","","836045448953668")
    V48Assert(!IFHModel(f2.Segment).Findings.Findings.Count,"missing death and target/HP samples do not prove activity")
    PANTAttack(f2,60001,11,2,0)
    V48Assert(!IFHModel(f2.Segment).Findings.Findings.Count,"zero HP source cannot establish failure")
}
PANTTestTwoSecondView()
{
    f := PANTTestOpening(),PANTTestPulse(f,43500)
    PANTAttack(f,45499,11,2)
    V48Assert(!IFHView(f.Segment,IFHModel(f.Segment),true,45500).Findings.Length,"crossing deadline alone cannot reuse old HP")
    PANTAttack(f,45500,11,2)
    model := IFHModel(f.Segment),v := IFHView(f.Segment,model,true,45500)
    V48Assert(v.Findings.Length=1 && v.Findings[1].At=45500,"fresh activity at exactly two seconds displays immediately")
    V48Assert(v.Findings[1].Text="1st close failed at 7 o’clock","two-second finding keeps assigned turret and location")
    PAFAdd(model.Findings,"other",45500,9999,"Other mechanic","FF9CA8","")
    V48Assert(IFHView(f.Segment,model,true,47599).Findings.Length=1,"other mechanics retain settling delay")
    V48Assert(IFHView(f.Segment,model,true,47600).Findings.Length=2,"other mechanics appear after settling delay")
    V48Assert(IFHView(f.Segment,model,false,45500).Findings.Length=2,"saved view retains complete findings")
    PANTDead(f,53914,11,2)
    V48Assert(IFHModel(f.Segment).Findings.Turrets.Failures.Count=1,"consumption after observed missed deadline retains failure")
}
PANTTestAssignments()
{
    f := PANTTestOpening(),a := PAFTestActor("Damage A",3),b := PAFTestActor("Damage B",4)
    PAFTestFeed(f,20000,a,PANTTestNPC(11,2),"123"),PAFTestFeed(f,20001,b,PANTTestNPC(3,1),"123")
    PANTTestPulse(f,43500),PANTDead(f,44000,11,2)
    PANTTestBoss(f,49000),PAFTestFeed(f,50000,a,PANTTestNPC(9,3),"123"),PAFTestFeed(f,51000,b,PANTTestNPC(7,4),"123")
    PANTTestPulse(f,69000),PANTDead(f,70000,3,1)
    PANTTestBoss(f,89000)
    for i,hour in [1,5,7]
        PAFTestFeed(f,89000+i*1000,PANTTestNPC(hour,4+i),PAFTestActor("Tank"),"","event","","836045448953668")
    PANTTestPulse(f,94500),PANTAttack(f,106501,9,3)
    n := IFHModel(f.Segment).Findings.Turrets
    V48Assert(n.Waves[2][1].Label="2nd close" && n.Waves[2][2].Label="2nd far","double-close follows operator, not nearest to boss")
    V48Assert(n.Waves[3][3].Label="5th" && n.Failures.Count=1,"fifth selected from three new spawns, excluding survivors")
    PANTTestPulse(f,120000),PANTAttack(f,132001,7,4),PANTAttack(f,132002,7,7)
    n := IFHModel(f.Segment).Findings.Turrets
    V48Assert(n.Failures.Count=3,"fourth flags second-close; fifth flags second-far and fifth")
    r := {At:180000,Record:99999,Partial:false},pull := {Boss:"G-NA",Start:0}
    e := IGCBuild(f.Segment,r),packed := IGCPack(e),copy := IGCUnpack(packed,pull,r),r.BossEvidence := copy
    V48Assert(copy.Anchors.Length=3 && InStr(IGCCheck(pull,r).Text,"2nd close failed at 9 o’clock"),"whole-pull failures survive persisted death evidence beyond 30 seconds")
    r.At := 100000,r.Record := 99999,e := IGCBuild(f.Segment,r)
    V48Assert(!e.Rows.Length && !e.Anchors.Length,"earlier death never shows later failures")
    packed[7][1][9] := "made up"
    caught := false
    try IGCUnpack(packed,pull,{At:180000,Record:99999})
    catch Error
        caught := true
    V48Assert(caught,"persisted label validated")
}
PANTTestGapsAndRollback()
{
    f := PANTTestOpening(),PANTTestPulse(f,69000),PANTAttack(f,90000,3,1)
    V48Assert(!IFHModel(f.Segment).Findings.Findings.Count,"missing pulse does not renumber later deadlines")
    f := PANTTestOpening(),PANTTestPulse(f,43500)
    f.Segment.LastOutput := f.Segment.Last,IPBBeginUndo(f.Data,f.Segment)
    PANTAttack(f,56001,11,2),V48Assert(IFHModel(f.Segment).Findings.Findings.Count=1,"accepted activity establishes failure")
    IPBRollbackTail(f.Data,f.Segment)
    V48Assert(!IFHModel(f.Segment).Findings.Findings.Count,"rollback removes provisional failure")
    PANTDead(f,44500,11,2),PANTAttack(f,56001,11,2)
    V48Assert(!IFHModel(f.Segment).Findings.Findings.Count,"rebuild uses accepted death")
    f := PANTTestOpening(),PANTTestPulse(f,43500)
    PAFTestFeed(f,45000,PAFTestNPC("4122949560827904",9),"=","4133047028940800","cast","")
    PANTAttack(f,57000,11,2),V48Assert(!IFHModel(f.Segment).Findings.Findings.Count,"burn retires outstanding checks")
    f := V7878FHSegment("G-NA",0)
    PAFTestFeed(f,10000,PANTTestNPC(3,1,500),"=","123","cast","")
    PANTTestBoss(f,11000),PANTTestPulse(f,18000),PANTTestPulse(f,43500),PANTAttack(f,56001,3,1)
    V48Assert(!IFHModel(f.Segment).Findings.Findings.Count,"partial turret phase cannot pretend to be opening sequence")
}
PANTTestNativeAndOrder()
{
    f := PANTTestOpening(),PANTTestPulse(f,43500),PANTAttack(f,56001,11,2)
    rows := IBCOrdered(f.Segment.Assistance.Events),reversed := V7878FHSegment("G-NA",0)
    Loop rows.Length {
        x := rows[rows.Length-A_Index+1]
        IFHSafeObserve(reversed.Segment,x.Event,x.At)
    }
    x := rows[-1],IFHSafeObserve(reversed.Segment,x.Event,x.At)
    V48Assert(XRDiagnosticJSON(IFHModel(f.Segment))=XRDiagnosticJSON(IFHModel(reversed.Segment)),"late order and duplicate record replay are identical")
    line := V671FloorLine(56001,PANTTestNPC(11,2),"=","4134064936189952","836045448945472","836045448945479","")
    e := IPParseLine(line)
    result := {Actors:Map(1,e.Source,2,e.Target),Descriptors:Map(1,[e.Ability,e.AbilityId,e.Kind,e.Effect,e.ActionId,e.EffectId,e.AreaId,e.ModeId]),Extras:Map()}
    r := [56001,1,0,0,line,99,56001,1,2,1,e.Amount,e.Effective,e.EffectiveSource,e.Crit,e.ValueOK,e.TargetAlive,
        e.SourceHP.Known,e.SourceHP.Current,e.SourceHP.Maximum,e.TargetHP.Known,e.TargetHP.Current,e.TargetHP.Maximum,
        e.Threat.Expected,e.Threat.Known,e.Threat.Invalid,e.Threat.Value,e.Immune,e.FullAbsorb,"","",0,"",-1]
    native := IANativeRow(r,result)
    V48Assert(XRDiagnosticJSON(e.TurretPositions)=XRDiagnosticJSON(native.TurretPositions),"native hydration and AHK annotate identical NPC positions including equals target")
    IFHRetire(f.Segment)
    V48Assert(IFHModel(f.Segment).Findings.Turrets.Failures.Count=1,"retiring pull retains turret failures")
}
PANTFifthSetup(dummy)
{
    f := PANTTestOpening()
    PANTTestPulse(f,43500),PANTDead(f,44000,11,2)
    PANTTestBoss(f,49000)
    for i,hour in [9,7]
        PAFTestFeed(f,50000+i*1000,PANTTestNPC(hour,2+i),PAFTestActor("Tank"),"","event","","836045448953668")
    PANTTestPulse(f,69000),PANTDead(f,70000,3,1)
    PANTTestBoss(f,89000)
    for i,hour in [1,5,7]
        PAFTestFeed(f,89000+i*1000,PANTTestNPC(hour,4+i),PAFTestActor("Tank"),"","event","","836045448953668")
    PANTTestPulse(f,94500),PANTDead(f,95000,9,3),PANTDead(f,95001,7,4)
    return f
}
PANTTestFifthChoice()
{
    f := PANTFifthSetup(0),a := PAFTestActor("Damage A",3),b := PAFTestActor("Damage B",4)
    PAFTestFeed(f,100000,a,PANTTestNPC(7,7),"123","hit"," (10 energy {836045448940874})")
    PAFTestFeed(f,101000,a,PANTTestNPC(5,6),"123"),PAFTestFeed(f,102000,b,PANTTestNPC(5,6),"124")
    V48Assert(!IsObject(IFHModel(f.Segment).Findings.Turrets.Choice),"choice waits for fifth pull-in")
    PANTTestPulse(f,120000),PANTTestPulse(f,120000)
    n := IFHModel(f.Segment).Findings.Turrets
    V48Assert(n.Waves[3][2].Label="5th" && n.Waves[3][2].Deadline=120000 && n.Waves[3][3].Due=0,"focus outweighs chip damage and transfers deadline")
    v := IFHView(f.Segment,IFHModel(f.Segment),true,120000)
    V48Assert(v.Findings.Length=1 && v.Findings[1].Text="Went to 6th at 1 o’clock" && v.Findings[1].Color="B8B8B8","alternate note is immediate and gray; pulse batch does not duplicate")
    PANTAttack(f,122000,7,7),PANTAttack(f,122001,5,6)
    n := IFHModel(f.Segment).Findings.Turrets
    V48Assert(n.Failures.Count=1 && n.Failures.Has(n.Waves[3][2].Key),"only actual chosen turret fails two-second check")
    PAFTestFeed(f,123000,a,PANTTestNPC(1,5),"123","hit"," (900 energy {836045448940874})")
    V48Assert(IFHModel(f.Segment).Findings.Turrets.Waves[3][2].Label="5th","later cleanup cannot change choice")
    r := {At:180000,Record:99999,Partial:false},pull := {Boss:"G-NA",Start:0}
    e := IGCBuild(f.Segment,r),packed := IGCPack(e),r.BossEvidence := IGCUnpack(packed,pull,r)
    text := IGCCheck(pull,r).Text
    V48Assert(r.BossEvidence.Anchors.Length=2 && InStr(text,"Went to 6th at 1 o’clock") && InStr(text,"5th failed at 1 o’clock"),"choice and failure persist independently beyond 30 seconds")
    early := IGCBuild(f.Segment,{At:119999,Record:99999})
    V48Assert(!early.Rows.Length && !early.Anchors.Length,"earlier recap does not reveal later choice")
    packed[7][1][9] := "7th",caught := false
    try IGCUnpack(packed,pull,r)
    catch Error
        caught := true
    V48Assert(caught,"unsupported alternate label rejected")
    reversed := V7878FHSegment("G-NA",0),rows := IBCOrdered(f.Segment.Assistance.Events)
    Loop rows.Length {
        x := rows[rows.Length-A_Index+1]
        IFHSafeObserve(reversed.Segment,x.Event,x.At)
    }
    V48Assert(XRDiagnosticJSON(IFHModel(f.Segment))=XRDiagnosticJSON(IFHModel(reversed.Segment)),"choice is identical after out-of-order saved replay")
}
PANTTestFifthChoiceFallbacks()
{
    a := PAFTestActor("Damage A",3)
    for mode in ["none","tie","expected","other","single ability"] {
        f := PANTFifthSetup(0)
        if mode!="none" {
            alternate := mode="other" || mode="single ability"
            PAFTestFeed(f,100000,a,PANTTestNPC(alternate ? 1 : 7,alternate ? 5 : 7),"123")
            PAFTestFeed(f,100001,a,PANTTestNPC(alternate ? 1 : 7,alternate ? 5 : 7),mode="single ability" ? "123" : "124")
            if mode="tie"
                PAFTestFeed(f,100002,a,PANTTestNPC(5,6),"123","hit"," (200 energy {836045448940874})")
        }
        if mode="other"
            PANTDead(f,119000,1,5)
        PANTTestPulse(f,120000),PANTAttack(f,122000,7,7)
        n := IFHModel(f.Segment).Findings.Turrets
        if mode="other"
            V48Assert(n.Choice.Charges=1 && n.Choice.Name="6th" && !n.Failures.Count,"either alternate is sixth; already consumed choice is not failed")
        else
            V48Assert(!IsObject(n.Choice) && n.Failures.Count=1,"no unique alternative focus retains expected fifth: " mode)
    }
    ; Tank/healer chip damage must not redirect the DPS assignment.
    f := PANTFifthSetup(0)
    PAFTestFeed(f,100000,a,PANTTestNPC(7,7),"123")
    tank := PAFTestActor("Tank",1),healer := PAFTestActor("Healer",2)
    PAFTestFeed(f,100001,tank,PANTTestNPC(5,6),"123","hit"," (900 energy {836045448940874})")
    PAFTestFeed(f,100002,healer,PANTTestNPC(1,5),"123","hit"," (900 energy {836045448940874})")
    PAFTestFeed(f,100003,tank,PANTTestNPC(5,6),"124")
    PAFTestFeed(f,100004,healer,PANTTestNPC(1,5),"124")
    s := IFHModel(f.Segment).Findings,s.Roles[IPActor(tank).Key] := 1,s.Roles[IPActor(healer).Key] := 4
    ev := IPParseLine(V671FloorLine(120000,PAFTestNPC("4122580193640448",8),a,"4133016964169728","836045448945477","836045448945501"," (100 energy {836045448940874})"))
    ev.RecordId := 999,s.Turrets.Count := 5,s.Turrets.Pulse := 120000
    PANTChooseFifth(s,ev,120000,999)
    V48Assert(!IsObject(s.Turrets.Choice),"known tanks and healers do not choose fifth")
}
PANTTestFifthChoiceRollback()
{
    f := PANTFifthSetup(0),a := PAFTestActor("Damage A",3)
    PAFTestFeed(f,100000,a,PANTTestNPC(5,6),"123"),PAFTestFeed(f,100001,a,PANTTestNPC(5,6),"124")
    f.Segment.LastOutput := f.Segment.Last,IPBBeginUndo(f.Data,f.Segment)
    PANTTestPulse(f,120000)
    V48Assert(IsObject(IFHModel(f.Segment).Findings.Turrets.Choice),"provisional pulse selects alternative")
    IPBRollbackTail(f.Data,f.Segment)
    V48Assert(!IFHModel(f.Segment).Findings.Turrets.FifthChosen && !IsObject(IFHModel(f.Segment).Findings.Turrets.Choice),"rollback removes choice and its freeze")
    PAFTestFeed(f,110000,a,PANTTestNPC(7,7),"123","hit"," (300 energy {836045448940874})")
    PANTTestPulse(f,120000)
    V48Assert(!IsObject(IFHModel(f.Segment).Findings.Turrets.Choice),"accepted replacement replay uses corrected focus")
}
PANTTestSameMillisecondOpening()
{
    for hp in [1000,984] {
        f := V7878FHSegment("G-NA",0),a := PAFTestActor("Damage A",3)
        ; A cleave can record its boss and turret hits in the same millisecond.
        PAFTestFeed(f,10000,a,"Nahut {4122949560827904}:9|(-448,2566,207.94,0)|(1000/1000)","123")
        PAFTestFeed(f,10000,a,PANTTestNPC(3,1,hp),"123")
        PAFTestFeed(f,11000,PANTTestNPC(11,2),PAFTestActor("Tank"),"","event","","836045448953668")
        PANTTestPulse(f,18000),PANTTestPulse(f,43500)
        n := IFHModel(f.Segment).Findings.Turrets
        V48Assert(n.Sequence && n.Waves[1][1].Label="1st far" && n.Waves[1][2].Label="1st close","same-millisecond opening retains close/far assignments")
        V48Assert(n.Waves[1][2].Deadline=43500 && n.Waves[1][1].Deadline<0,"only first close is due on second pull-in")
        PANTAttack(f,45499,11,2)
        V48Assert(!n.Failures.Count,"same-millisecond opening preserves two-second grace")
        PANTAttack(f,45500,11,2),PANTTestPulse(f,69000),PANTAttack(f,71000,3,1)
        v := IFHView(f.Segment,IFHModel(f.Segment),true,71000)
        V48Assert(n.Failures.Count=2 && v.Findings.Length=2,"both assigned failures appear at their deadlines")
        r := {At:180000,Record:99999,Partial:false},pull := {Boss:"G-NA",Start:0}
        r.BossEvidence := IGCUnpack(IGCPack(IGCBuild(f.Segment,r)),pull,r),text := IGCCheck(pull,r).Text
        V48Assert(InStr(text,"1st close failed at 7 o’clock") && InStr(text,"1st far failed at 3 o’clock"),"same-millisecond sequence survives saved feedback")
        reversed := V7878FHSegment("G-NA",0),rows := IBCOrdered(f.Segment.Assistance.Events)
        Loop rows.Length {
            x := rows[rows.Length-A_Index+1]
            IFHSafeObserve(reversed.Segment,x.Event,x.At)
        }
        V48Assert(XRDiagnosticJSON(IFHModel(f.Segment))=XRDiagnosticJSON(IFHModel(reversed.Segment)),"source record order resolves equal timestamps during saved rebuild")
    }
}
PANTTestOpeningPositionGuards()
{
    for mode in ["missing","late same millisecond","stale","future","damaged","age boundary"] {
        f := V7878FHSegment("G-NA",0),at := 20000
        if mode="stale" || mode="age boundary"
            PANTTestBoss(f,mode="stale" ? 7999 : 8000)
        else if mode="future" || mode="damaged"
            PANTTestBoss(f,at)
        if mode="future"
            IFHModel(f.Segment).Findings.Turrets.Boss.At := at+1
        PAFTestFeed(f,at,PANTTestNPC(3,1,mode="damaged" ? 979 : 1000),PAFTestActor("Tank"),"","event","","836045448953668")
        if mode="late same millisecond"
            PANTTestBoss(f,at)
        PAFTestFeed(f,at+1000,PANTTestNPC(11,2),PAFTestActor("Tank"),"","event","","836045448953668")
        n := IFHModel(f.Segment).Findings.Turrets
        V48Assert(n.Sequence=(mode="age boundary"),"opening guard retained: " mode)
        if mode="late same millisecond" {
            reversed := V7878FHSegment("G-NA",0),rows := IBCOrdered(f.Segment.Assistance.Events)
            Loop rows.Length {
                x := rows[rows.Length-A_Index+1]
                IFHSafeObserve(reversed.Segment,x.Event,x.At)
            }
            V48Assert(!IFHModel(reversed.Segment).Findings.Turrets.Sequence,"later source record at equal time cannot retroactively supply opening position")
        }
    }
}
PANTTestSnipeFailure()
{
    for kind in ["cast","apply","hit"] {
        f := PANTTestOpening()
        PAFTestFeed(f,20000,PANTTestNPC(3,1),PAFTestActor("Tank"),"4134082116059136",kind)
        m := IFHModel(f.Segment),v := IFHView(f.Segment,m,true,20000)
        V48Assert(v.Findings.Length=1 && v.Findings[1].Text="1st far failed at 3 o’clock","Snipe establishes failure immediately without a due pulse: " kind)
        V48Assert(m.Findings.Turrets.Failures.Count=1 && InStr(v.Findings[1].Details,"enraged"),"failure explains the fully charged attack")
        PAFTestFeed(f,20001,PANTTestNPC(3,1),PAFTestActor("Tank"),"4134082116059136","apply")
        PAFTestFeed(f,25000,PANTTestNPC(3,1),PAFTestActor("Tank"),"4134082116059136")
        V48Assert(m.Findings.Turrets.Failures.Count=1,"cast, marker and damage keep one finding per turret")
    }
    for kind in ["remove","event"] {
        f := PANTTestOpening()
        PAFTestFeed(f,20000,PANTTestNPC(3,1),PAFTestActor("Tank"),"4134082116059136",kind)
        V48Assert(!IFHModel(f.Segment).Findings.Turrets.Failures.Count,"removal and unrelated events do not establish new Snipe activity")
    }
    f := PANTTestOpening()
    PAFTestFeed(f,20000,PANTTestNPC(3,1),PAFTestActor("Tank"),"4134064936189952","cast")
    PAFTestFeed(f,20001,PAFTestNPC("4122949560827904",9),PAFTestActor("Tank"),"4134082116059136","apply")
    V48Assert(!IFHModel(f.Segment).Findings.Turrets.Failures.Count,"normal Rail Shot and Nahut source do not bypass deadlines")
    PANTTestPulse(f,43500),PANTAttack(f,45500,11,2)
    before := XRDiagnosticJSON(IFHModel(f.Segment).Findings.Turrets.Failures)
    PAFTestFeed(f,50000,PANTTestNPC(11,2),PAFTestActor("Tank"),"4134082116059136","apply")
    V48Assert(XRDiagnosticJSON(IFHModel(f.Segment).Findings.Turrets.Failures)=before,"later enrage preserves the original deadline failure timestamp")
}
PANTTestSnipePersistence()
{
    for unknownHP in [false,true] {
        f := V7878FHSegment("G-NA",0),turret := PANTTestNPC(5,15,500)
        if unknownHP
            turret := "Rail Turret {4132746381230080}:15"
        expected := unknownHP ? "Turret failed" : "Turret failed at 1 o’clock"
        PAFTestFeed(f,10000,turret,PAFTestActor("Tank"),"4134082116059136","apply")
        model := IFHModel(f.Segment),v := IFHView(f.Segment,model,true,10000)
        V48Assert(v.Findings.Length=1 && v.Findings[1].Text=expected,"partial opening or unknown HP still permits direct Snipe evidence without inventing a position")
        r := {At:60000,Record:99999,Partial:false},pull := {Boss:"G-NA",Start:0}
        e := IGCBuild(f.Segment,r),packed := IGCPack(e),r.BossEvidence := IGCUnpack(packed,pull,r)
        V48Assert(r.BossEvidence.Anchors.Length=1 && InStr(IGCCheck(pull,r).Text,expected),"unassigned Snipe failure survives persisted feedback beyond 30 seconds")
        early := IGCBuild(f.Segment,{At:9999,Record:99999})
        V48Assert(!early.Rows.Length && !early.Anchors.Length,"earlier recap cannot show a later enrage")
        packed[7][1][8] := "4134064936189952",caught := false
        try IGCUnpack(packed,pull,r)
        catch Error
            caught := true
        V48Assert(caught,"normal Rail Shot cannot use unassigned-enrage persistence exemption")
    }
    f := PANTTestOpening()
    PAFTestFeed(f,20000,PANTTestNPC(3,1),PAFTestActor("Tank"),"4134082116059136","apply")
    r := {At:60000,Record:99999,Partial:false},pull := {Boss:"G-NA",Start:0}
    r.BossEvidence := IGCUnpack(IGCPack(IGCBuild(f.Segment,r)),pull,r)
    V48Assert(InStr(IGCCheck(pull,r).Text,"1st far failed at 3 o’clock"),"known assignment retained in saved enrage finding")
}
PANTTestSnipeLifecycle()
{
    f := PANTTestOpening(),PANTDead(f,19000,3,1)
    PAFTestFeed(f,20000,PANTTestNPC(3,1),PAFTestActor("Tank"),"4134082116059136","apply")
    PAFTestFeed(f,20001,PANTTestNPC(11,2,0),PAFTestActor("Tank"),"4134082116059136","apply")
    V48Assert(!IFHModel(f.Segment).Findings.Turrets.Failures.Count,"consumed turrets and explicit zero HP are not resurrected by Snipe")
    f := PANTTestOpening()
    PAFTestFeed(f,19000,PAFTestNPC("4122949560827904",9),"=","4133047028940800","cast","")
    PAFTestFeed(f,20000,PANTTestNPC(3,1),PAFTestActor("Tank"),"4134082116059136","apply")
    V48Assert(!IFHModel(f.Segment).Findings.Turrets.Failures.Count,"burn cleanup remains outside turret failure checks")
    f := PANTTestOpening()
    f.Segment.LastOutput := f.Segment.Last,IPBBeginUndo(f.Data,f.Segment)
    PAFTestFeed(f,20000,PANTTestNPC(3,1),PAFTestActor("Tank"),"4134082116059136","apply")
    V48Assert(IFHModel(f.Segment).Findings.Turrets.Failures.Count=1,"provisional Snipe establishes failure")
    IPBRollbackTail(f.Data,f.Segment)
    V48Assert(!IFHModel(f.Segment).Findings.Turrets.Failures.Count,"rollback removes provisional Snipe failure")
    PAFTestFeed(f,20000,PANTTestNPC(3,1),PAFTestActor("Tank"),"4134082116059136","apply")
    rows := IBCOrdered(f.Segment.Assistance.Events),reversed := V7878FHSegment("G-NA",0)
    Loop rows.Length {
        x := rows[rows.Length-A_Index+1]
        IFHSafeObserve(reversed.Segment,x.Event,x.At)
    }
    V48Assert(XRDiagnosticJSON(IFHModel(f.Segment))=XRDiagnosticJSON(IFHModel(reversed.Segment)),"out-of-order saved records rebuild the same Snipe finding")
}

PAS56Opening(unused := false)
{
    f := V7878FHSegment("G-SC")
    V7878FHFeed(f,V7816Line(98000,"start"),1),V7878FHFeed(f,V7816Line(100000),2),f.Seq := 2
    return f
}
PAS56Rows(f) => IFHView(f.Segment,IFHModel(f.Segment),false,f.Segment.Last).Findings
PAS56Kill(f,at,who,id,instance := 11,deathWho := "")
{
    d := PAFTestNPC("4126540153487360",instance,0)
    PAFTestFeed(f,at,who,d,id,"hit"," (300 ~25 energy {836045448940874})")
    PAFTestFeed(f,at+1,deathWho!="" ? deathWho : who,d,"1","death","")
}
PAS56Early() => V7816Fixture(PAS56EarlyCase)
PAS56EarlyCase()
{
    a := PAFTestActor("Finisher",3),b := PAFTestActor("Other DPS",4)
    f := PAS56Opening(),PAS56Kill(f,106000,a,"2020687623487746")
    rows := PAS56Rows(f)
    V48Assert(rows.Length=1 && InStr(rows[1].Text,"DoT from Finisher"),"known Burning tick at death identifies credited finisher")
    PAFTestFeed(f,106050,b,PAFTestNPC("4126540153487360",11,0),"1","death","")
    V48Assert(PAS56Rows(f).Length=1,"repeated death cannot change or duplicate blame")
    PAS56Kill(f,107000,b,"3066520749998354",12)
    rows := PAS56Rows(f)
    V48Assert(rows.Length=2 && InStr(rows[2].Text,"Hit by Other DPS"),"separate swarm instance records its own direct finisher")
    PAFTestFeed(f,107500,a,PAFTestNPC("4126540153487360",13),"2020687623487746")
    PAFTestFeed(f,107501,b,PAFTestNPC("4126540153487360",13),"3066520749998354")
    PAFTestFeed(f,107502,a,PAFTestNPC("4126540153487360",13,0),"1","death","")
    rows := PAS56Rows(f)
    V48Assert(InStr(rows[3].Text,"DoT from Finisher"),"death credit wins over the most recent different player's hit")
    PAS56Kill(f,108000,a,"3066520749998354",14,b)
    rows := PAS56Rows(f)
    V48Assert(rows[4].Color="AEB4BE" && !InStr(rows[4].Text,"Finisher"),"missing credited finisher damage does not blame another attacker")
    PAFTestFeed(f,108100,a,PAFTestNPC("4126540153487360",15),"3066520749998354")
    PAFTestFeed(f,108800,a,PAFTestNPC("4126540153487360",15,0),"1","death","")
    V48Assert(PAS56Rows(f)[5].Color="AEB4BE","stale hit does not establish the cause")
    PAS56Kill(f,110000,a,"3066520749998354",16)
    V48Assert(PAS56Rows(f).Length=5,"kill window is allowed")
    PAS56Kill(f,118000,a,"3066520749998354",17)
    V48Assert(PAS56Rows(f).Length=5,"late kills deliberately have no classifier")
    g := PAS56Opening(),d := PAFTestNPC("4126540153487360",20)
    PAFTestFeed(g,106000,a,d,"3384812186370048","cast","")
    PAS56Kill(g,106020,a,"3384812186370048",20)
    V48Assert(InStr(PAS56Rows(g)[1].Text,"Hit by Finisher"),"fresh Scorch application hit is distinguished from a later tick")
    d := PAFTestNPC("4126540153487360",21)
    PAFTestFeed(g,103000,a,d,"3384812186370048","cast","")
    PAS56Kill(g,107000,a,"3384812186370048",21)
    V48Assert(InStr(PAS56Rows(g)[2].Text,"DoT from Finisher"),"observed older application supports a lingering Scorch tick")
    PAS56Kill(g,108000,a,"3384812186370048",22)
    V48Assert(InStr(PAS56Rows(g)[3].Text,"Killing hit by Finisher"),"mixed ID without activation timing stays neutral")
    h := PAS56Opening()
    V7878FHFeed(h,V7816Line(106000,"death"),3),h.Seq := 3
    PAS56Kill(h,106100,a,"3066520749998354")
    V48Assert(PAS56Rows(h).Length=0,"phase-end OPD death and subsequent cleanup are excluded")
}
PAS56IgniteRoster(f)
{
    PAFTestRoster(f)
    for i,name in ["Mara","Sentinel"] {
        a := IPActor(PAFTestActor(name,i+4)),f.Segment.Actors[a.Key] := a,f.Segment.DisplayRoles[a.Key] := 2
    }
    ; Use parser actor keys so this fixture also verifies key compatibility.
    f.Segment.DisplayDisciplines := Map()
    for name,id in Map("Damage A","2031339142381602","Damage B","2031339142381591","Mara","2031339142381572","Sentinel","2031339142381613") {
        for key,actor in f.Segment.Actors {
            if actor.Name=name
                f.Segment.DisplayDisciplines[key] := id
        }
    }
}
PAS56Field(f,at,kind := "apply") => PAFTestFeed(f,at,PAFTestNPC("4108140513591296"),"=","4127300362698752",kind,"")
PAS56Fail(f,at) => PAFTestFeed(f,at,PAFTestNPC("4108140513591296"),PAFTestActor("Tank",1),"4131981877051657")
PAS56Ignite()
{
    f := V7878FHSegment("G-SC"),PAS56IgniteRoster(f),boss := PAFTestNPC("4108140513591296")
    a := PAFTestActor("Damage A",3),b := PAFTestActor("Damage B",4)
    PAFTestFeed(f,99000,b,boss,"1","hit"," (900000 energy {836045448940874})")
    PAFTestFeed(f,100000,b,boss,"1","hit"," (900000 energy {836045448940874})")
    PAS56Field(f,100000),PAS56Field(f,100001)
    PAFTestFeed(f,101000,a,boss,"1","hit"," (1000 ~0 energy {836045448940874} (1000 absorbed {836045448945511}))")
    PAFTestFeed(f,102000,b,boss,"1","hit"," (500 ~0 energy {836045448940874} (500 absorbed {836045448945511}))")
    PAFTestFeed(f,103000,PAFTestActor("Mara",5),boss,"1","hit"," (1 energy {836045448940874})")
    PAFTestFeed(f,103001,PAFTestActor("Sentinel",6),boss,"1","hit"," (1 energy {836045448940874})")
    PAFTestFeed(f,103002,b,PAFTestNPC("4108140513591296",2),"1","hit"," (900000 energy {836045448940874})")
    PAS56Field(f,112000,"remove"),PAS56Fail(f,112380),PAS56Fail(f,112381)
    row := PAS56Rows(f)[1]
    V48Assert(PAS56Rows(f).Length=1 && row.Text="Ignite Core failed`nLowest non-Mara DPS: Damage B (41.7 DPS)","failed shield window counts absorption and excludes mirrors, tanks, healers, other bosses and earlier damage")
    PAFTestFeed(f,113000,b,boss,"1","hit"," (900000 energy {836045448940874})")
    V48Assert(PAS56Rows(f)[1].Text=row.Text,"post-failure damage cannot alter ranking")
    PAS56Field(f,200000),PAFTestFeed(f,201000,b,boss,"1"),PAS56Field(f,212000,"remove")
    V48Assert(PAS56Rows(f).Length=1,"completed window without Supercriticality is not a failure")
    PAS56Field(f,300000),PAFTestFeed(f,301000,a,boss,"1"),PAS56Fail(f,312000)
    V48Assert(PAS56Rows(f).Length=2 && InStr(PAS56Rows(f)[2].Text,"Damage B (0.0 DPS)"),"fresh window includes zero-contributing eligible DPS")
    f.Segment.DisplayDisciplines.Delete(IPActor(b).Key)
    V48Assert(InStr(PAS56Rows(f)[1].Text,"classes incomplete"),"unknown DPS class prevents false non-Mara attribution")
    f.Segment.DisplayDisciplines[IPActor(b).Key] := "2031339142381591"
    f.Segment.DisplayRoles[IPActor(b).Key] := 3
    V48Assert(InStr(PAS56Rows(f)[1].Text,"classes incomplete"),"ambiguous mixed role prevents attribution")
    empty := V7878FHSegment("G-SC"),PAS56Fail(empty,100000),PAS56Fail(empty,100001)
    V48Assert(PAS56Rows(empty).Length=1 && PAS56Rows(empty)[1].Text="Ignite Core failed","actual failure remains visible without inventing a missing damage window")
}
PAS56Lifecycle() => V7816Fixture(PAS56LifecycleCase)
PAS56LifecycleCase()
{
    f := PAS56Opening(),a := PAFTestActor("Finisher",3),PAS56Kill(f,106000,a,"2020687623487746")
    before := XRDiagnosticJSON(PAS56Rows(f)),m := IFHNew("G-SC")
    for row in IBCOrdered(f.Segment.Assistance.Events)
        IFHObserve(m,row.Event,row.At,row.Record)
    V48Assert(XRDiagnosticJSON(IFHView(f.Segment,m,false,f.Segment.Last).Findings)=before,"ordered saved replay matches accepted live journal")
    f.Segment.LastOutput := f.Segment.Last,IPBBeginUndo(f.Data,f.Segment)
    PAS56Kill(f,107000,a,"3066520749998354",12)
    IPBRollbackTail(f.Data,f.Segment)
    V48Assert(XRDiagnosticJSON(PAS56Rows(f))=before,"rolled-back provisional kill leaves no stale failure")
    PAFTestFeed(f,105999,a,PAFTestNPC("4126540153487360",11),"3066520749998354")
    V48Assert(XRDiagnosticJSON(PAS56Rows(f))=before,"out-of-order earlier hit rebuilds without replacing actual finishing tick")
    parts := IXFRowParts({At:106001,Label:"00:16",Text:PAS56Rows(f)[1].Text,Color:"FF9CA8"},"Progression Assistance")
    V48Assert(InStr(parts.Detail,"Finisher") && !InStr(parts.Label,"Finisher"),"credited finisher uses existing emphasized detail text")
    V48Assert(!IsObject(IFHModel(V7878FHSegment("G-SC").Segment)),"new pull has no old swarm deaths or Ignite window")
}

PAS57RoundTrip(f,at := 200000,record := 999999)
{
    r := {At:at,Record:record,Partial:false},p := {Boss:"G-SC",Start:f.Segment.Start,Area:f.Segment.AreaId,Mode:f.Segment.ModeId}
    e := IGCBuild(f.Segment,r),packed := IGCPack(e),r.BossEvidence := IGCUnpack(packed,p,r)
    return {Evidence:r.BossEvidence,Packed:packed,Text:IGCCheck(p,r).Text,Pull:p,Recap:r}
}
PAS57Persistence() => V7816Fixture(PAS57PersistenceCase)
PAS57PersistenceCase()
{
    f := PAS56Opening(),a := PAFTestActor("Finisher",3)
    PAS56Kill(f,106000,a,"2020687623487746"),PAS56Kill(f,107000,a,"3066520749998354",12)
    x := PAS57RoundTrip(f)
    V48Assert(x.Evidence.Anchors.Length=2 && InStr(x.Text,"DoT from Finisher") && InStr(x.Text,"Hit by Finisher"),"both early kills survive saved evidence beyond 30 seconds")
    V48Assert(!InStr(x.Text,"No OPD-phase death"),"retained early kills do not show an empty-window message")
    early := PAS57RoundTrip(f,106001,3)
    V48Assert(!early.Evidence.Rows.Length && !early.Evidence.Anchors.Length,"death before same-timestamp record excludes later failure")
    early := PAS57RoundTrip(f,106001,99999)
    V48Assert(early.Evidence.Rows.Length=1,"first death sees only the first established failure")
    bad := IFHClone(x.Packed),bad[7][1][6] := "N:999:11:Other"
    caught := false
    try IGCUnpack(bad,x.Pull,x.Recap)
    catch Error
        caught := true
    V48Assert(caught,"persisted early kill must have a real swarm droid target")
    bad := IFHClone(x.Packed),bad[7][1][9] := "invented"
    caught := false
    try IGCUnpack(bad,x.Pull,x.Recap)
    catch Error
        caught := true
    V48Assert(caught,"persisted early-kill label is validated")
    g := V7878FHSegment("G-SC")
    V48Assert(!PAS57RoundTrip(g).Evidence.Anchors.Length,"new pull does not inherit findings")
}
PAS57Damage()
{
    f := V7878FHSegment("G-SC"),PAS56IgniteRoster(f)
    a := PAFTestActor("Damage A",3),b := PAFTestActor("Damage B",4),cat := PAFTestNPC("4126553038389248")
    PAFTestFeed(f,100000,a,cat,"1","hit"," (1000 energy {836045448940874})")
    PAFTestFeed(f,101000,b,cat,"1","hit"," (500 energy {836045448940874})")
    PAFTestFeed(f,110000,cat,a,"4127205873418504")
    PAS56Field(f,120000),PAFTestFeed(f,121000,a,PAFTestNPC("4108140513591296"),"1")
    PAS56Fail(f,132000)
    x := PAS57RoundTrip(f),view := PAS56Rows(f)
    V48Assert(x.Evidence.Anchors.Length=2,"catalyst and Ignite survive evidence serialization")
    for row in view
        for line in StrSplit(row.Text,"`n","`r")
            V48Assert(InStr(x.Text,line),"report retains every line's content from the overlay DPS result")
    V48Assert(InStr(x.Text,"Damage B (50.0 DPS)") && InStr(x.Text,"lowest non-Mara DPS: Damage B (0.0 DPS)"),"DPS windows and exclusions are unchanged")
    p := {Boss:"G-SC",Start:0,End:200000,Players:Map(),Area:f.Segment.AreaId,Mode:f.Segment.ModeId}
    p.ScyvaReportSegment := f.Segment,r := {At:200000,Record:999999,Partial:false}
    merged := PASReportRecap(p,r)
    V48Assert(!r.HasOwnProp("BossEvidence") && merged.BossEvidence.Anchors.Length=2,"saved native recap enriched without modifying its source")
    mergedAgain := PASReportRecap(p,merged)
    V48Assert(IGVJson(IGCPack(merged.BossEvidence))=IGVJson(IGCPack(mergedAgain.BossEvidence)),"reopening report does not duplicate findings")
    single := V7878FHSegment("G-SC"),PAFTestRoster(single)
    PAFTestFeed(single,100000,a,cat,"1"),PAFTestFeed(single,110000,cat,a,"4127205873418504")
    V48Assert(InStr(PAS57RoundTrip(single).Text,"Only one DPS went to this catalyst: Damage A"),"single participating DPS message persists")
}
PAS57Ordering() => V7816Fixture(PAS57OrderingCase)
PAS57OrderingCase()
{
    f := PAS56Opening(),a := PAFTestActor("Finisher",3),PAS56Kill(f,106000,a,"2020687623487746")
    before := PAS57RoundTrip(f).Text
    f.Segment.LastOutput := f.Segment.Last,IPBBeginUndo(f.Data,f.Segment)
    PAS56Kill(f,107000,a,"3066520749998354",12)
    IPBRollbackTail(f.Data,f.Segment)
    V48Assert(PAS57RoundTrip(f).Text=before,"rollback also removes provisional persisted finding")
    model := IFHNew("G-SC")
    for row in IBCOrdered(f.Segment.Assistance.Events)
        IFHObserve(model,row.Event,row.At,row.Record)
    f.Segment.AssistanceResult := model
    V48Assert(PAS57RoundTrip(f).Text=before,"saved review model produces identical report evidence")
}

IUN58Format() => V601Isolated(IUN58FormatCase)
IUN58FormatCase()
{
    global IUB
    V48Assert(IUNStyle()="us","existing number format remains the default")
    cases := [["28133.9","28,133.9","28.133,9"],["1000.00","1,000.00","1.000,00"],
        ["-1234567.8 *","-1,234,567.8 *","-1.234.567,8 *"],
        ["9223372036854775807","9,223,372,036,854,775,807","9.223.372.036.854.775.807"],
        ["0.0","0.0","0,0"],["--","--","--"],["","",""],["Unknown","Unknown","Unknown"]]
    for i,mode in ["us","eu"] {
        IUB.NumberFormat := mode
        for c in cases {
            V48Assert(IPMNumber(c[1])=c[i+1],"separator format preserves precision and markers: " c[1])
            V48Assert(IUNInvariant(IPMNumber(c[1]))=c[1],"display roundtrip preserves original numeric text")
        }
        V48Assert(IANumber(9223372036854775807)=cases[4][i+1],"large integers never convert through floating point")
        V48Assert(IPMShortNumber(1250000)=(mode="eu" ? "1,25 m" : "1.25 m"),"compact meters use the chosen decimal separator")
        V48Assert(IARate(281339,10)=(mode="eu" ? "28133,9" : "28133.9"),"analysis rates use the chosen separator")
        V48Assert(IPCheckDPS(281339,10)=(mode="eu" ? "28.133,9 DPS" : "28,133.9 DPS"),"progression assistance DPS follows the preference")
        V48Assert(IPRate(281339,10)="28133.9","raw rate helper remains invariant for file formats")
        V48Assert(IUNDecimal("49.7%")=(mode="eu" ? "49,7%" : "49.7%"),"display percentages retain their suffix")
        V48Assert(IUNFormat("Player 1.5")="Player 1.5","labels are not rewritten as numbers")
    }
}

IUN58Raid() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IUN58RaidCase)))
IUN58RaidCase()
{
    global IP,IUB
    V7428RaidReady(),seg := IPSelectedSegment(),lv := IP.PlayersLV,u := IPWState()
    keys := [IP.Actor,"@Healer#300","@Large#811","@NegativeThreat#812"]
    for key in [keys[3],keys[4]]
        IPStoreActor(seg,IPActor(key))
    seg.End := seg.Last,seg.Raid.LastThreatAt := seg.Last
    values := [1000,999,12345,1000000]
    for i,key in keys {
        t := seg.Totals[key],t.Damage := values[i]*2,t.Heal := values[i]*3,t.Effective := values[i]*2
        t.HealKnown := 1,t.HealRecords := 1,t.Taken := values[i]*2,t.Deaths := values[i]
        seg.Raid.Threat[key] := {Total:values[i]*2*(i=4 ? -1 : 1),Known:1,Missing:i=4 ? 1 : 0}
    }
    csv := IPCsvData(IPSelectedData(),seg),selected := IP.Selected,actor := IP.Actor
    for mode in ["us","eu","us"] {
        IUB.NumberFormat := mode,IUNRefresh()
        row := V7428RaidRow(keys[1])
        for pair in [[2,"2000"],[3,"1000.0"],[4,"2000"],[5,"1000.0"],[6,"2000"],[7,"1000.0"],[8,"1000"],[10,"2000"],[11,"1000.0"]]
            V48Assert(lv.GetText(row,pair[1])=IUNFormat(pair[2]),"changing preference refreshes the existing Raid values")
        row := V7428RaidRow(keys[4])
        V48Assert(lv.GetText(row,10)=IUNFormat("-2000000 *"),"signed missing-threat marker survives")
        for column in [2,3,4,5,6,7,8,10,11] {
            u.Sorts["Raid"] := {Column:1,Desc:false},IPWSort("Raid",lv,column)
            order := column>=10 ? [keys[3],keys[1],keys[2],keys[4]] : [keys[4],keys[3],keys[1],keys[2]]
            for i,key in order
                V48Assert(lv.GetText(i,9)=key,"descending sort uses full numeric value in " mode)
            IPWSort("Raid",lv,column)
            for i,key in order
                V48Assert(lv.GetText(5-i,9)=key,"ascending sort uses full numeric value in " mode)
            V7428RaidRedraw()
            V48Assert(lv.GetText(1,9)=order[4],"numeric sort survives a live-style refresh")
        }
        V48Assert(IPCsvData(IPSelectedData(),seg)=csv,"raw CSV is byte-for-byte unchanged")
        V48Assert(IP.Selected=selected && IP.Actor=actor && seg.Totals[keys[1]].Damage=2000,"selection and calculated damage stay unchanged")
        V48Assert(!IP.Active && !DllCall("IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"native checks do not launch parsing or show normal Iris")
        for i,key in keys
            lv.Modify(V7428RaidRow(key),"Col12",["Tank","DPS","Unknown","Healer"][i])
        u.Sorts["Raid"] := {Column:12,Desc:false},IPWSortSaved("Raid",lv)
        V48Assert(lv.GetText(1,12)="DPS" && lv.GetText(4,12)="Unknown","Role column still sorts as text")
    }
    IUB.NumberFormat := "eu",seg.Totals[keys[1]].HealKnown := 0,seg.Last := seg.Start,seg.End := seg.Start
    IUNRefresh(),row := V7428RaidRow(keys[1])
    V48Assert(lv.GetText(row,3)="--" && lv.GetText(row,4)="--","unknown values remain unknown")
    IP.Gui.Show("Hide w1600 h820"),IPResize(IP.Gui,0,1600,820),controls := []
    for c in IP.Gui {
        if V58ChildVisible(c)
            controls.Push(c)
    }
    V7412PlayerControlsPng("number-format-raid-eu.png",IP.Gui,controls,0,0,1600,820)
}

IUN58Analysis() => V601Isolated(V591Isolated.Bind(IUN58AnalysisCase))
IUN58AnalysisCase()
{
    global IUB
    V591Ready(),a := V591Data(),query := a.Query,result := a.Result
    for mode in ["us","eu","us"] {
        IUB.NumberFormat := mode,IUNRefresh()
        V48Assert(a.Query=query && a.Result=result,"format switching retains Analysis range and calculated data")
        lv := a.Tables["Damage"]
        for id,row in result.Abilities {
            found := false
            loop lv.GetCount() {
                if lv.GetText(A_Index,10)=row.Id {
                    found := true
                    V48Assert(lv.GetText(A_Index,2)=IANumber(row.Total) && lv.GetText(A_Index,3)=IARate(row.Total,result.Duration),"actual Analysis totals and rates follow chosen format")
                }
            }
            V48Assert(found,"every ability remains in Analysis after the switch")
        }
        g := Gui(),table := g.AddListView("w400 h180",["Name","Rate"])
        try {
            for pair in [["Small","999.9"],["Thousand","1000.0"],["Large","12345.6"],["Negative","-54321.8"]]
                table.Add("",pair[1],IUNFormat(pair[2]))
            IATableSort(table,2)
            V48Assert(table.GetText(1,1)="Large" && table.GetText(4,1)="Negative","Analysis descending sort crosses grouping boundaries")
            IATableSort(table,2)
            V48Assert(table.GetText(1,1)="Negative" && table.GetText(4,1)="Large","Analysis ascending sort preserves negatives")
        }
        finally g.Destroy()
    }
}

IUN58Settings() => V601Isolated(IUN58SettingsCase)
IUN58SettingsCase()
{
    global IUB,SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"preference checks only run in the isolated diagnostic child")
    path := A_Temp "\Iris_number_format_" DllCall("GetCurrentProcessId","UInt") ".ini"
    try {
        V48Assert(!FileExist(path) && IUNReadSetting(path)="us","missing preference preserves current format")
        IniWrite("preserve",path,"Audio","Sentinel")
        for mode in ["eu","us","eu"] {
            IUNSaveSetting(path,mode)
            V48Assert(IUNReadSetting(path)=mode,"preference survives an INI reload")
        }
        IniWrite("invalid",path,"IrisAppearance","NumberFormat")
        V48Assert(IUNReadSetting(path)="us" && IniRead(path,"Audio","Sentinel")="preserve","invalid setting defaults safely and unrelated settings survive")
    }
    finally {
        if FileExist(path)
            FileDelete(path)
    }
    IUB.NumberFormat := "eu",g := IUBBuildAppearance()
    V48Assert(IUB.NumberChoice.Value=2 && IUB.NumberChoice.Text="28.133,9 (decimal comma)","Appearance shows the saved choice with a real example")
    V48Assert(!IUBApplyAppearance() && !IUBOpenAppearance(),"diagnostics cannot invoke real settings save or open callbacks")
    g.Show("Hide w530 h676"),controls := []
    for c in g
        controls.Push(c)
    V7412PlayerControlsPng("number-format-appearance.png",g,controls,0,0,530,676)
    V48Assert(!DllCall("IsWindowVisible","Ptr",g.Hwnd,"Int"),"Appearance test stays hidden")
    g.Destroy(),IUB.Gui := ""
}

; Isolated native UI and parser state only; no normal launch, log attachment or audio.
IAC63Start() => V571Isolated(IAC63StartCase)
IAC63StartCase()
{
    global IP,IPM,Audio
    V48Assert(IPM.AutoShowOnParse && !IPM.Wanted,"auto-show defaults on without showing anything at construction")
    IPM.Mode := 2
    for kind in IPM.Shown
        IPM.Shown[kind] := kind="RaidUtility"
    V48Assert(IPStartCommit(IP.Live) && IP.Active && IPM.Wanted,"successful Parse reveals selected utility without opening its options")
    V48Assert(IPMDisplayTargets().Length=1 && IPMDisplayTargets()[1].Kind="RaidUtility","Parse preserves selected panels")
    V48Assert(!IPM.TimerOn && !IPM.DesktopPreview && !IPMPreviewActive(IPM) && !Audio.Queue.Length,"diagnostics do not show overlays or start previews/audio")
    IPM.Wanted := false
    V48Assert(!IPStartCommit(IP.Live) && !IPM.Wanted,"repeated Start does not undo an explicit hide")
    IPStop(),IPM.AutoShowOnParse := false
    V48Assert(IPStartCommit(IP.Live) && !IPM.Wanted,"saved opt-out leaves hidden overlays hidden")
    IPStop(),IPM.AutoShowOnParse := true,IPM.Enabled := false
    V48Assert(IPStartCommit(IP.Live) && !IPM.Wanted && !IPM.Enabled,"disabled combat displays stay disabled")
    IPStop(),IPM.Enabled := true,IPM.Shown["RaidUtility"] := false
    V48Assert(IPStartCommit(IP.Live) && !IPM.Wanted,"no selected windows does not invent panels")
    IPStop(),IPM.Shown["RaidUtility"] := true,IP.ImportFile := {Fixture:true}
    V48Assert(!IPStartCommit(IP.Live) && !IPM.Wanted,"failed Parse never exposes overlays")
    IP.ImportFile := ""
}

IAC63Preferences() => V571Isolated(IAC63PreferencesCase)
IAC63PreferencesCase()
{
    global IPM,SETTINGS_FILE,IP
    IniWrite("keep",SETTINGS_FILE,"Audio","Sentinel")
    IPMLoadSettings()
    V48Assert(IPM.AutoShowOnParse && !IPM.Wanted && !IP.Active,"missing setting defaults on without parsing")
    for wanted in [false,true,false] {
        IPM.AutoShowOnParse := wanted,IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings()
        V48Assert(IPM.AutoShowOnParse=wanted && !IPM.Wanted,"auto-show survives preference roundtrip")
    }
    V48Assert(IniRead(SETTINGS_FILE,"Audio","Sentinel")="keep","unrelated settings preserved")
}

IAC63Controls() => V7839Fixture(IAC63ControlsCase)
IAC63ControlsCase()
{
    global IPM,IP
    IPMOpenSettings(),g := IPM.ConfigGui
    V48Assert(IPM.AutoShowOnParseControl.Value=1,"new display checkbox defaults checked")
    IPM.AutoShowOnParseControl.Value := 0
    V48Assert(IPMApplySettings() && !IPM.AutoShowOnParse && !IP.Active,"settings Save applies opt-out without starting Parse")
    IPMOpenSettings()
    V48Assert(IPM.AutoShowOnParseControl.Value=0,"reopening displays retains opt-out")
    g.Show("Hide w760 h627"),controls := []
    for c in g
        controls.Push(c)
    V7412PlayerControlsPng("auto-show-settings.png",g,controls,0,0,760,627)
}

IAC63CompactFormat() => V601Isolated(IAC63CompactFormatCase)
IAC63CompactFormatCase()
{
    global IUB
    V48Assert(!IRCEnabled() && IRCDamage(21227156)="21,227,156","full totals remain the default")
    IUB.CompactDamage := true
    for pair in [[0,"0"],[999,"999"],[1000,"1K"],[12400,"12.4K"],[999999,"1M"],[21227156,"21.23M"],[1000000000,"1B"]]
        V48Assert(IRCDamage(pair[1])=pair[2],"compact damage formats units and boundary: " pair[1])
    IUB.NumberFormat := "eu"
    V48Assert(IRCDamage(21227156)="21,23M","compact damage honours decimal comma")
}

IAC63CompactRaid() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IAC63CompactRaidCase)))
IAC63CompactRaidCase()
{
    global IP,IUB,SETTINGS_FILE
    V7428RaidReady(),u := IPWState(),lv := IP.PlayersLV,seg := IPSelectedSegment(),keys := [IP.Actor,"@Healer#300"]
    seg.Totals[keys[1]].Damage := 21227156,seg.Totals[keys[2]].Damage := 21227157
    V7428RaidRedraw(),rate := lv.GetText(V7428RaidRow(keys[1]),3),heal := lv.GetText(V7428RaidRow(keys[1]),4)
    csv := IPCsvData(IPSelectedData(),seg)
    for mode in ["us","eu"] {
        IUB.NumberFormat := mode,u.Controls["RaidCompactDamage"].Value := 1,IRCChanged()
        V48Assert(lv.GetText(V7428RaidRow(keys[1]),2)=IRCDamage(21227156),"native Raid column displays compact total")
        V48Assert(lv.GetText(V7428RaidRow(keys[1]),3)=IUNFormat(IUNInvariant(lv.GetText(V7428RaidRow(keys[1]),3))),"DPS retains full numeric formatting")
        u.Sorts["Raid"] := {Column:2,Desc:true},IPWSortSaved("Raid",lv)
        V48Assert(lv.GetText(1,9)=keys[2],"equal rounded display values still sort by exact damage")
        IPWSort("Raid",lv,2)
        V48Assert(lv.GetText(1,9)=keys[1],"ascending exact sort survives compact values")
        V7428RaidRedraw()
        V48Assert(lv.GetText(1,9)=keys[1],"exact numeric order survives redraw")
        rect := Buffer(16,0),NumPut("Int",0,"Int",1,rect)
        SendMessage(0x1038,0,rect.Ptr,lv.Hwnd) ; LVM_GETSUBITEMRECT, damage column
        x := NumGet(rect,0,"Int")+4,y := NumGet(rect,4,"Int")+4
        V48Assert(InStr(IRCExactAt(lv,x,y),IPMNumber("21227156")),"hover resolves the exact current-row damage")
        V48Assert(IRCExactAt(lv,-5,-5)="","no tooltip for empty space")
        V48Assert(IPCsvData(IPSelectedData(),seg)=csv,"compact formatting does not change CSV data")
    }
    IUB.NumberFormat := "us",u.Controls["RaidCompactDamage"].Value := 0,IRCChanged()
    V48Assert(lv.GetText(V7428RaidRow(keys[1]),2)="21,227,156","turning compact off restores exact totals")
    V48Assert(lv.GetText(V7428RaidRow(keys[1]),3)=rate && lv.GetText(V7428RaidRow(keys[1]),4)=heal,"DPS and healing unchanged")
    u.Controls["RaidCompactDamage"].Value := 1,IRCChanged()
    V48Assert(ReadBoolSetting("IrisAppearance","CompactDamage",false),"compact choice persists")
    IP.Gui.Show("Hide w1600 h820"),IPResize(IP.Gui,0,1600,820),controls := []
    for c in IP.Gui
        if V58ChildVisible(c)
            controls.Push(c)
    V7412PlayerControlsPng("compact-raid.png",IP.Gui,controls,0,0,1600,820)
    IPWClearData()
    V48Assert(!u.RaidDamageTotals.Count && IRCExactAt(lv,20,20)="","clearing the fight drops exact hover values")
    IRCShutdown()
    V48Assert(!IRCHoverState().Hook && IRCHoverState().Text="","shutdown releases the hover handler and tooltip")
}

PAI64ScyvaFeed(f,at,ability,hp := 900,kind := "cast",effect := "",id := "99")
{
    ids := Map("atomic","4127287477796864","rad","4144050735153152","up","4127296067731456",
        "d","4127291772764160","ignite","4131981877051392","field","4127300362698752","fail","4131981877051657",
        "init","4146653485334528")
    return PAFTestFeed(f,at,V7818Actor(hp,id),"=",ids[ability],kind,"",effect)
}
PAI64Opening(f,base := 100000)
{
    for pair in [[0,"atomic"],[6000,"rad"],[10100,"up"],[16100,"d"],[20200,"rad"],[24200,"d"],
        [28300,"up"],[34300,"rad"],[38400,"d"],[42400,"d"],[46500,"up"]]
        PAI64ScyvaFeed(f,base+pair[1],pair[2])
}
PAI64Ignite() => V7818Fixture(PAI64IgniteCase)
PAI64IgniteCase()
{
    global SCY,Audio,autoBossCalloutsEnabled,SCYOptions
    autoBossCalloutsEnabled := false
    for part in SCYParts()
        SCYOptions.%part% := false
    before := XRDiagnosticJSON(SCY),audioBefore := XRDiagnosticJSON(Audio.Queue)
    f := V7878FHSegment("G-SC"),seg := f.Segment
    PAI64ScyvaFeed(f,100000,"atomic"),PAI64ScyvaFeed(f,106000,"rad"),PAI64ScyvaFeed(f,110100,"up")
    V48Assert(IFHView(seg,IFHModel(seg),true,110100).Rows[1].Text="Upheaval 1 / 3","first verified Ignite cycle shows progress with all speech off")
    PAI64ScyvaFeed(f,116100,"d"),PAI64ScyvaFeed(f,120200,"rad"),PAI64ScyvaFeed(f,124200,"d"),PAI64ScyvaFeed(f,128300,"up")
    V48Assert(IFHIgniteRow(IFHModel(seg)).Text="Upheaval 2 / 3","second upheaval advances the current display")
    PAI64ScyvaFeed(f,134300,"rad"),PAI64ScyvaFeed(f,138400,"d"),PAI64ScyvaFeed(f,142400,"d"),PAI64ScyvaFeed(f,146500,"up")
    V48Assert(IFHView(seg,IFHModel(seg),true,146500).Rows[1].Text="Last upheaval","third upheaval matches the callout")
    PAI64ScyvaFeed(f,152500,"rad")
    V48Assert(IFHIgniteRow(IFHModel(seg)).Text="Last radiance","recorded last Radiance replaces last Upheaval")
    PAI64ScyvaFeed(f,156500,"d"),PAI64ScyvaFeed(f,162600,"ignite")
    row := IFHIgniteRow(IFHModel(seg))
    V48Assert(row.Text="Ignite Core" && row.Color="FF6E78","recorded Ignite is prominent")
    PAI64ScyvaFeed(f,162600,"ignite",900,"apply","4131981877051728")
    V48Assert(IFHIgniteRow(IFHModel(seg)).Text="Ignite Core","paired cast and apply do not duplicate the row")
    view := IFHView(seg,IFHModel(seg),false,162600)
    for row in view.Rows
        V48Assert(row.Label!="Ignite","completed saved pull contains no current Ignite instruction")
    PAI64ScyvaFeed(f,170000,"field",900,"remove","4127300362698752")
    V48Assert(!IsObject(IFHIgniteRow(IFHModel(seg))),"recorded shield removal clears Ignite before next Atomic")
    PAI64ScyvaFeed(f,171000,"ignite",900,"remove","4131981877051728")
    PAI64Opening(f,200000)
    V48Assert(!IsObject(IFHIgniteRow(IFHModel(seg))),"later cycle does not invent first-Ignite preparation")
    V48Assert(XRDiagnosticJSON(SCY)=before && XRDiagnosticJSON(Audio.Queue)=audioBefore,"silent model and rendering leave live callout state and audio queue untouched")
}
PAI64IgniteGuards()
{
    f := V7878FHSegment("G-SC")
    for at in [100000,118000,136000]
        PAI64ScyvaFeed(f,at,"up")
    PAI64ScyvaFeed(f,142000,"rad"),PAI64ScyvaFeed(f,148000,"ignite")
    V48Assert(!IsObject(IFHIgniteRow(IFHModel(f.Segment))),"partial cycle cannot fabricate Ignite coaching")
    for ending in ["remove","fail","low","death","reset"] {
        f := V7878FHSegment("G-SC"),PAI64Opening(f),PAI64ScyvaFeed(f,152500,"rad"),PAI64ScyvaFeed(f,162600,"ignite")
        if ending="remove"
            PAI64ScyvaFeed(f,170000,"ignite",900,"remove","4131981877051728")
        else if ending="fail"
            PAI64ScyvaFeed(f,170000,"fail")
        else if ending="low"
            PAI64ScyvaFeed(f,170000,"init",299)
        else if ending="death"
            PAFTestFeed(f,170000,PAFTestActor("Player"),V7818Actor(0),"1","death","")
        else
            PAI64ScyvaFeed(f,170000,"atomic",900,"cast","","100")
        V48Assert(!IsObject(IFHIgniteRow(IFHModel(f.Segment))),"Ignite clears on " ending)
    }
    V48Assert(!IsObject(IFHIgniteRow(IFHNew("G-SC"))),"new pull has no previous instruction")
}
PAI64Turrets() => V673OrderFixture(PAI64TurretsCase)
PAI64TurretsCase()
{
    global NBTurretOptions,NBTurrets,NBOrderOptions,NahutProfiles,Audio,autoBossCalloutsEnabled
    oldOptions := NBTurretOptions
    try {
        NBTurretOptions := {Enabled:false,FlipVertical:false},NBOrderOptions.Enabled := false,autoBossCalloutsEnabled := false
        NahutProfiles.LoadError := "Unconfigured team"
        before := XRDiagnosticJSON(NBTurrets),audioBefore := XRDiagnosticJSON(Audio.Queue)
        f := PANTTestOpening(),seg := f.Segment,model := IFHModel(seg),rows := IFHTurretRows(model)
        V48Assert(rows.Length=2 && rows[1].Text="1st close at 7 o’clock" && rows[2].Text="1st far at 3 o’clock","opening assignments use validated roles and spawn clocks")
        view := IFHView(seg,model,true,seg.Last),count := 0
        for row in view.Rows {
            if row.Label="Turret"
                count += 1
        }
        V48Assert(count=2,"generic turret guidance survives missing team configuration and muted callouts")
        snapshot := XRDiagnosticJSON(model),NBTurretOptions.FlipVertical := true,rows := IFHTurretRows(model)
        V48Assert(rows[1].Text="1st close at 7 o’clock" && rows[2].Text="1st far at 3 o’clock","all progression rows keep the same canonical clock as failure findings")
        V48Assert(XRDiagnosticJSON(model)=snapshot,"clock orientation never changes stored sites or failure rules")
        NBTurretOptions.FlipVertical := false
        PANTTestPulse(f,43500),PANTAttack(f,45500,11,2),model := IFHModel(seg),rows := IFHTurretRows(model)
        V48Assert(rows.Length=1 && InStr(rows[1].Text,"1st far"),"failed turret only remains in the failure list")
        view := IFHView(seg,model,true,45500)
        V48Assert(view.Findings.Length=1 && InStr(view.Findings[1].Text,"1st close failed"),"failure survives retirement of current assignment")
        PANTDead(f,46000,3,1)
        V48Assert(!IFHTurretRows(IFHModel(seg)).Length,"consumed turret clears its current assignment")
        f := PANTTestOpening(),PAFTestFeed(f,20000,PAFTestActor("Player"),PANTTestNPC(11,2,0),"1","death","")
        V48Assert(IFHTurretRows(IFHModel(f.Segment)).Length=1,"recorded player kill clears assignment")
        PAFTestFeed(f,21000,PAFTestNPC("4122949560827904",9),"=","4133047028940800","cast","")
        V48Assert(!IFHTurretRows(IFHModel(f.Segment)).Length,"burn clears all current turret assignments")
        f := PANTFifthSetup(0),rows := IFHTurretRows(IFHModel(f.Segment))
        V48Assert(rows.Length=1 && rows[1].Text="5th at 11 o’clock","fifth appears once the complete third wave identifies it")
        for row in IFHView(f.Segment,IFHModel(f.Segment),false,f.Segment.Last).Rows
            V48Assert(row.Label!="Turret","saved pulls do not show current turret instructions")
        V48Assert(XRDiagnosticJSON(NBTurrets)=before && XRDiagnosticJSON(Audio.Queue)=audioBefore,"live turret audio state and queue unchanged")
        f := PANTTestOpening(),a := PAFTestActor("Damage A",3),b := PAFTestActor("Damage B",4)
        PAFTestFeed(f,20000,a,PANTTestNPC(11,2),"123"),PAFTestFeed(f,20001,b,PANTTestNPC(3,1),"123")
        PANTTestPulse(f,43500),PANTDead(f,44000,11,2),PANTTestBoss(f,49000)
        PAFTestFeed(f,50000,a,PANTTestNPC(9,3),"123"),PAFTestFeed(f,51000,b,PANTTestNPC(7,4),"123")
        PANTTestPulse(f,69000),PANTDead(f,70000,3,1)
        V48Assert(!IFHTurretRows(IFHModel(f.Segment)).Length,"second pair has no early role assignment before the fourth pulse")
        PANTTestPulse(f,94500),rows := IFHTurretRows(IFHModel(f.Segment))
        V48Assert(rows.Length=2 && rows[1].Text="2nd close at 9 o’clock" && rows[2].Text="2nd far at 11 o’clock","second pair appears only when existing operator evidence establishes the roles")
    }
    finally NBTurretOptions := oldOptions
}
PAI64Ordering()
{
    f := V7878FHSegment("G-SC"),PAI64Opening(f),seg := f.Segment,before := XRDiagnosticJSON(IFHModel(seg))
    seg.LastOutput := seg.Last,IPBBeginUndo(f.Data,seg),PAI64ScyvaFeed(f,152500,"rad")
    V48Assert(IFHIgniteRow(IFHModel(seg)).Text="Last radiance","provisional cue shown")
    IPBRollbackTail(f.Data,seg)
    V48Assert(XRDiagnosticJSON(IFHModel(seg))=before,"rollback reconstructs earlier Ignite state")
    ordered := IBCOrdered(seg.Assistance.Events),other := V7878FHSegment("G-SC")
    Loop ordered.Length {
        row := ordered[ordered.Length-A_Index+1]
        IFHSafeObserve(other.Segment,row.Event,row.At)
    }
    row := ordered[-1],IFHSafeObserve(other.Segment,row.Event,row.At)
    V48Assert(XRDiagnosticJSON(IFHModel(other.Segment))=XRDiagnosticJSON(IFHModel(seg)),"out-of-order and duplicate accepted records rebuild identical guidance")
    IFHRetire(seg)
    for row in IFHView(seg,IFHModel(seg),false,seg.Last).Rows
        V48Assert(row.Label!="Ignite","retired selected pull does not render a stale current cue")
}

V7865PvPLoadRetry() => V7844Run(V7865PvPLoadRetryCase)
V7865PvPLoadRetryCase()
{
    f := V7844File(),s := IPVLState(),path := IPVLPath()
    IPVLLoad(),IPVLCommit(f),saved := FileRead(path,"UTF-8"),before := s.Files
    held := DllCall("CreateFileW","Str",path,"UInt",0x80000000,"UInt",0,"Ptr",0,"UInt",3,"UInt",0,"Ptr",0,"Ptr")
    V48Assert(held && held!=-1,"private PvP catalogue can be held exclusively")
    try {
        IPVLLoad(true)
        V48Assert(s.Error!="" && s.Files=before,"temporary read failure preserves the last loaded PvP results")
    }
    finally DllCall("CloseHandle","Ptr",held)
    IPVLLoad()
    V48Assert(s.Error="" && s.Files.Count=1,"ordinary PvP refresh retries a failed read after the lock clears")
    V48Assert(FileRead(path,"UTF-8")=saved,"retry reads the existing catalogue without rewriting it")
    FileDelete(path),FileAppend("broken",path,"UTF-8-RAW"),IPVLLoad(true)
    V48Assert(s.Error!="","malformed PvP catalogue remains an error")
    V59ExpectError((*)=>IPVLCommit(f))
    V48Assert(FileRead(path,"UTF-8")="broken","retry support never overwrites a malformed catalogue")
    FileDelete(path),FileAppend(saved,path,"UTF-8-RAW"),IPVLLoad()
    V48Assert(s.Error="" && s.Files.Count=1,"ordinary refresh also reads a recovered catalogue")
}

PAF65MixedRoles() => V7816Fixture(PAF65MixedRolesCase)
PAF65MixedRolesCase()
{
    f := V7878FHSegment("G-SC"),PAFTestRoster(f)
    a := PAFTestActor("Damage A",3),b := PAFTestActor("Damage B",4),cat := PAFTestNPC("4126553038389248")
    PAFTestFeed(f,100000,a,cat,"1","hit"," (1000 energy {836045448940874})")
    PAFTestFeed(f,101000,b,cat,"1","hit"," (500 energy {836045448940874})")
    PAFTestFeed(f,110000,cat,a,"4127205873418504")
    m := IFHModel(f.Segment),key := IPActor(b).Key,n := m.Findings.NPCs[IPActor(cat).Key]
    V48Assert(PAFLowest(f.Segment,m.Findings,n.FailureDamage,true).Known,"known participants can be ranked")
    ev := IPParseLine(V671FloorLine(109000,b,"=","1","836045448945472","836045448945479"))
    ev.DisplayRole := 1,IURRecord(f.Segment,ev,109000)
    V48Assert(IURLabel(f.Segment.DisplayRoles[key])="Mixed","conflicting observed roles accumulate as Mixed")
    V48Assert(!PAFLowest(f.Segment,m.Findings,n.FailureDamage,true).Known,"mixed catalyst participant must not silently disappear from ranking")
    V48Assert(InStr(IFHView(f.Segment,m,false,110000).Findings[1].Text,"DPS roles incomplete"),"catalyst overlay does not blame the remaining DPS")
    for role in [3,5,6,7] {
        f.Segment.DisplayRoles[key] := role
        V48Assert(!PAFLowest(f.Segment,m.Findings,n.FailureDamage,true).Known,"all ambiguous role masks remain incomplete: " role)
        V48Assert(!PAFLowest(f.Segment,m.Findings,n.FailureDamage).Known,"whole-group coupling attribution also rejects mixed roles: " role)
    }
    f.Segment.DisplayRoles[key] := 2
    V48Assert(PAFLowest(f.Segment,m.Findings,n.FailureDamage,true).Names="Damage B","restoring known DPS metadata restores correct ranking")
    other := IPActor(PAFTestActor("Unrelated",5)),f.Segment.Actors[other.Key] := other,f.Segment.DisplayRoles[other.Key] := 3
    V48Assert(PAFLowest(f.Segment,m.Findings,n.FailureDamage,true).Known,"mixed role on the other catalyst does not block participant-only ranking")
    V48Assert(!PAFLowest(f.Segment,m.Findings,n.FailureDamage).Known,"mixed role in a whole-group check is still incomplete")
}

PAF65TimerCaption() => V65UITimerIsolated(PAF65TimerCaptionCase)
PAF65TimerCaptionCase(path)
{
    global IRT,IRTPrefs
    IRTShowManager(),p := IRTPrefs,count := IRT.Active.Count
    p.WarningBox.Value := 0,IRTUToggleDisplay("ShowWarnings",p.WarningBox)
    V48Assert(!p.ShowWarnings && p.ShowBars && IRT.Active.Count=count,"warnings toggle preserves countdown engine and bars")
    V48Assert(IniRead(path,"IrisTimers","ShowWarnings")=0,"warnings preference writes only the isolated test INI")
    p.BarBox.Value := 0,IRTUToggleDisplay("ShowBars",p.BarBox)
    V48Assert(!p.ShowBars && !p.ShowWarnings && IRT.Enabled,"hidden views keep configured encounter timers enabled")
    IRTUOpenTimers()
    V48Assert(p.ShowBars && !p.ShowWarnings && IRT.Active.Count=count,"opening countdowns does not enable warnings or reset timers")
    IRT.Active.Clear(),IRT.Alerts := [],IRTURender(IRT,1000)
    V48Assert(IPMGuiAlive(p.BarsGui) && p.Header.Text="Encounter timers" && p.Empty.Text="Waiting for timers","renamed encounter timers retain header and waiting state")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.BarsGui.Hwnd,"Int"),"native diagnostics keep the timer window hidden")
}

PAF65RunCaption() => V6510RunUIFixture(PAF65RunCaptionCase)
PAF65RunCaptionCase()
{
    global IPM,IP,IRN
    p := IPM.Panels["RunTimer"],IPM.ParserControls := false
    IPMEnsureGui("RunTimer",0,p)
    IPMRender("RunTimer",{State:"IMPORTED",Duration:999999},p),IPMParserUpdate(p)
    V48Assert(p.ParserButton.Text="Start" && p.ParserAction="Start","raid clock Start remains independent of parser controls")
    V48Assert(p.Heading.Text="Time remaining in raid" && p.Meta.Text="Gods","renamed raid clock and selected operation are shown")
    V48Assert(!p.ParserDrawn && !DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"diagnostics expose no overlay hit surface")
    V48Assert((DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt") & 0x08000020)=0x08000020,"locked raid clock is click-through and nonactivating")
    V48Assert(IRN.Status="Armed" && !IP.Active,"rendering cannot start the clock or parser")
    IPM.Editing := true,IPMStyle(p)
    V48Assert(!(DllCall("User32\GetWindowLongW","Ptr",p.Gui.Hwnd,"Int",-20,"UInt") & 0x20),"unlocking allows movement")
}

IUI65XRCachedLocale() => V601Isolated(IUI65XRCachedLocaleCase)
IUI65XRCachedLocaleCase()
{
    global IP,IPM,IUB
    priorIP := IP,priorIPM := IPM
    try {
        IUB.NumberFormat := "us",IP := IPNewApp(),IPM := IPMNewState()
        f := V7875XRFixture(false),f.Pull.Start := 100,f.Pull.End := 40000
        V7881XDDamageFeed(f,200,"Inside",1,100000)
        V7881XDDamageFeed(f,300,"Outside",1,200000)
        V7875XDFeed(f,20000,V7875XDroid(1,0),V7875XRActor("Inside"),"Damage")
        V7875XRFeed(f,22100,V7875XRActor("Inside"),"=")
        live := V7878XFFixture(f),seg := live.Segment,IP.Live := live.Data,IP.Active := true
        initial := IXFData(),cache := seg.XRFeedbackCache.Model
        V48Assert(initial.Rows.Length=1 && InStr(initial.Rows[1].Text,"5,050.5 DPS"),"settled live droid result starts with US separators")
        IUB.NumberFormat := "eu"
        V48Assert(InStr(IXFData().Rows[1].Text,"5.050,5 DPS"),"cached live droid finding follows the current number preference")
        V48Assert(seg.XRFeedbackCache.Model=cache && InStr(initial.Rows[1].Text,"5,050.5 DPS"),"formatting retains the cached classification and prior returned view")
        IUB.NumberFormat := "us",seg.End := seg.Last,IXFRetire(seg),IXARetire(seg),live.Data.Current := "",IP.Active := false
        retired := seg.XRFeedbackResult,raw := XRDiagnosticJSON(retired)
        for mode in ["eu","us"] {
            IUB.NumberFormat := mode
            V48Assert(InStr(IXFData().Rows[1].Text,mode="eu" ? "5.050,5 DPS" : "5,050.5 DPS"),"retired pull reformats without reopening its discarded journal")
            V48Assert(seg.XRFeedbackResult=retired && XRDiagnosticJSON(retired)=raw,"rendering never rewrites the compact stored finding")
        }
        IUB.NumberFormat := "us",review := IXCBuild(f.Data,f.Pull),IXOStore(seg,review,f.Pull)
        raw := XRDiagnosticJSON(seg.XRFeedbackResult),IUB.NumberFormat := "eu"
        V48Assert(InStr(IXFData().Rows[1].Text,"5.050,5 DPS"),"saved-log review reformats without rereading the file")
        V48Assert(XRDiagnosticJSON(seg.XRFeedbackResult)=raw,"saved review retains identical result evidence")
        V48Assert(InStr(IXFData(true).Rows[2].Text,"2.824,1 DPS"),"explicit XR sample uses the selected decimal style")
        V48Assert(!IP.Active && !IPM.TimerOn && !IPM.Wanted,"format checks never start parsing or show overlays")
    }
    finally IP := priorIP,IPM := priorIPM
}

; Arena release checks use parsed fixture records and private model instances.
; No windows, timers, live parser state, settings, audio or external files.
V7868ArenaNew()
{
    global SELF_TEST
    V48Assert(SELF_TEST,"arena release checks require isolation")
    s := IPNewData("arena release fixture")
    V7838ArenaFeed(s,0,V7838ArenaActor(1),"","Area","",,"137438993370")
    return s
}

V7868ArenaRoster(s,at,own,opponents)
{
    V7838ArenaFeed(s,at,V7838ArenaActor(1),"=","ApplyEffect","3297813328822272")
    tick := at+10
    for id in own {
        if id!=1
            V7838ArenaFeed(s,tick,V7838ArenaActor(1),V7838ArenaActor(id),"ApplyEffect","836045448945500",1)
        tick += 10
    }
    for id in opponents {
        V7838ArenaFeed(s,tick,V7838ArenaActor(1),V7838ArenaActor(id),"ApplyEffect","836045448945501",1)
        tick += 10
    }
}

V7868ArenaDeaths(s,at,players,zeroOnly := false)
{
    for i,id in players
        V7838ArenaFeed(s,at+i*10,V7838ArenaActor(id,0),"=","Event",zeroOnly ? "900001" : "836045448945493")
}

V7868ArenaReset(s,at,players,revive := true)
{
    ; Put a previously dead player first when testing a full-HP-only reset.
    for i,id in players
        V7838ArenaFeed(s,at+(i-1)*10,V7838ArenaActor(id),"=","Event",revive ? "836045448945494" : "900001")
}

V7868ArenaUnevenTeams()
{
    cases := [
        {Own:[1,2,3,4],Other:[11,12],Results:["loss","win","win"]},
        {Own:[1,2,3,4],Other:[11,12,13],Results:["win","win"]},
        {Own:[1],Other:[11],Results:["loss","loss"]}]
    for c in cases {
        s := V7868ArenaNew()
        for n,result in c.Results {
            at := n*30000
            V7868ArenaRoster(s,at,c.Own,c.Other)
            victims := result="win" ? c.Other : c.Own
            V7868ArenaDeaths(s,at+1000,victims,n=2)
            if n<c.Results.Length {
                restored := c.Own.Clone()
                for id in c.Other
                    restored.Push(id)
                V7868ArenaReset(s,at+5000,restored)
            }
        }
        IPVBoundary(s,"EOF"),snap := IPVSnapshot(s.Arena),expected := c.Results[c.Results.Length]
        V48Assert(snap.Matches=1 && snap.Last.Outcome=expected,"uneven arena produces one correct match result")
        V48Assert(snap.Last.Rounds.Length=c.Results.Length,"uneven arena keeps the played round count")
        V48Assert(snap.Last.RoundWins=(expected="win" ? 2 : 0),"uneven arena records the correct winning-round score")
        V48Assert(snap.Last.RoundLosses=(expected="loss" ? 2 : c.Results.Length-2),"uneven arena records the correct losing-round score")
    }
}

V7868ArenaResetInference()
{
    own := [1,2,3,4],other := [11,12,13,14],s := V7868ArenaNew()
    V7868ArenaRoster(s,5000,own,other)
    V7868ArenaDeaths(s,6000,[11,12,13])
    ; The fourth opponent's death is absent. The first full-HP snapshot alone
    ; must not immediately turn that incomplete round into a win.
    V7838ArenaFeed(s,10000,V7838ArenaActor(11),"=","Event","900001")
    before := IPVSnapshot(s.Arena)
    V48Assert(before.Current.RoundWins=0 && before.Current.Outcome="unknown","partial live reset does not award an early win")
    V7868ArenaReset(s,10010,[1,2,3,4,12,13,14],false)
    V48Assert(IPVSnapshot(s.Arena).Current.RoundWins=0,"a reset batch remains provisional during its first second")
    V7838ArenaFeed(s,11010,V7838ArenaActor(1),"=","Event","900001")
    after := IPVSnapshot(s.Arena)
    V48Assert(after.Current.RoundWins=1 && after.Current.RoundLosses=0,"complete full-HP reset resolves the single missing final death")
    V48Assert(after.Wins=0 && after.Matches=0,"one inferred round does not award a completed match")
    V7868ArenaRoster(s,30000,own,other),V7868ArenaDeaths(s,31000,other)
    IPVBoundary(s,"EOF"),snap := IPVSnapshot(s.Arena)
    V48Assert(snap.Wins=1 && snap.Last.RoundWins=2,"inferred first round and recorded second round form one win")

    s := V7868ArenaNew(),V7868ArenaRoster(s,5000,own,other)
    V7868ArenaDeaths(s,6000,[1,2,11,12])
    V7868ArenaReset(s,10000,[1,11,2,3,4,12,13,14],false)
    V7868ArenaRoster(s,30000,own,other),V7868ArenaDeaths(s,31000,other)
    IPVBoundary(s,"EOF"),snap := IPVSnapshot(s.Arena)
    V48Assert(snap.Unknown=1 && snap.Wins=0 && snap.Losses=0,"two surviving players on each side cannot establish the missing round winner")
    V48Assert(snap.Last.RoundWins=1 && snap.Last.RoundLosses=0,"ambiguous reset preserves the independently recorded second-round win")
}

V7868ArenaReplacement()
{
    s := V7868ArenaNew(),other := [11,12,13,14]
    V7868ArenaRoster(s,5000,[1,2,3,4],other)
    V7868ArenaDeaths(s,6000,[1,2,3,4])
    V7868ArenaReset(s,10000,[1,2,3,4,11,12,13,14])
    ; Player 2 leaves after the first round; player 5 takes that slot.
    V7868ArenaRoster(s,30000,[1,3,4,5],other)
    V7868ArenaDeaths(s,31000,[1,3,4,5])
    IPVBoundary(s,"EOF"),snap := IPVSnapshot(s.Arena)
    V48Assert(snap.Losses=1 && snap.Last.RoundLosses=2,"a replacement player does not leave an immortal departed teammate in round two")
    V48Assert(snap.Last.Rounds.Length=2,"a replacement does not invent another round")
    V48Assert(snap.Last.Teammates.Length=5,"match history retains both the departed and replacement teammate")
}

V7868ArenaPostmatch()
{
    s := V7838ArenaFixture(["win","win"])
    V7868ArenaReset(s,15000,[3,1,2])
    V7838ArenaFeed(s,17000,V7838ArenaActor(1),V7838ArenaActor(3),"ApplyEffect","836045448945501",1)
    IPVBoundary(s,"EOF"),snap := IPVSnapshot(s.Arena)
    V48Assert(snap.Wins=1 && snap.Last.Rounds.Length=2,"postmatch damage without a new-round marker does not erase a 2-0 win")

    s := V7838ArenaFixture(["win","win"])
    V7868ArenaReset(s,15000,[3,1,2])
    V7868ArenaRoster(s,17000,[1,2],[3])
    V7868ArenaDeaths(s,18000,[1,2])
    IPVBoundary(s,"EOF"),snap := IPVSnapshot(s.Arena)
    V48Assert(snap.Unknown=1 && snap.Wins=0,"explicit third-round evidence after an apparent 2-0 score stays unresolved")
    V48Assert(snap.Last.Rounds.Length=3,"a contradictory real round is retained for review")
}

V7868ArenaDepartureBoundaries()
{
    for reason in ["EOF","stopped","log source changed"] {
        s := V7838ArenaFixture(["win"]),IPVBoundary(s,reason),snap := IPVSnapshot(s.Arena)
        V48Assert(snap.Unknown=1 && snap.Losses=0,"ending input after one round cannot manufacture a departure loss")
        s := V7838ArenaFixture(["win","win"]),IPVBoundary(s,reason),snap := IPVSnapshot(s.Arena)
        V48Assert(snap.Wins=1 && snap.Last.RoundWins=2,"ending input preserves an already established match win")
    }
    s := V7838ArenaFixture(["win"])
    V7838ArenaFeed(s,20000,V7838ArenaActor(1),"","Area","",,"123")
    snap := IPVSnapshot(s.Arena)
    V48Assert(snap.Losses=1 && snap.Last.RoundWins=1,"observed early departure records a match loss while preserving the won round")
    ; Preserve the deliberately narrow departure policy from the October 22
    ; reconstruction: a tied score is unresolved, rather than guessed here.
    s := V7838ArenaFixture(["win","loss"])
    V7838ArenaFeed(s,20000,V7838ArenaActor(1),"","Area","",,"123")
    snap := IPVSnapshot(s.Arena)
    V48Assert(snap.Unknown=1 && snap.Last.RoundWins=1 && snap.Last.RoundLosses=1,"leaving at a tied score retains the current unresolved policy")
}

V7868PvPDuplicateSources() => V7844Run(V7868PvPDuplicateSourcesCase)
V7868PvPDuplicateSourcesCase()
{
    f := V7844File(),s := IPVLState(),copy := f.Clone()
    copy.Path := StrReplace(f.Path,"_001.txt","_002.txt")
    FileCopy(f.Path,copy.Path),copy.Modified := FileGetTime(copy.Path,"M")
    s.Files := Map(StrLower(f.Path),f,StrLower(copy.Path),copy)
    rows := IPVLRows(s.Files,"_002.txt")
    V48Assert(rows.Length=2 && rows[1].Source.Path=copy.Path,"filename search includes an indexed duplicate copy")
    V48Assert(IPVLRows(s.Files).Length=2 && IPVLRows(s.Files,"corellia").Length=2,"identical matches still count once without a source-specific filter")
    V48Assert(IPVLRows(s.Files,"_002.txt","","win").Length=1,"source filtering combines with outcome filtering before deduplication")
    copy.Matches := []
    for m in f.Matches {
        current := m.Clone(),current.Role := 2,copy.Matches.Push(current)
        if m.HasOwnProp("Role")
            m.DeleteProp("Role")
    }
    rows := IPVLRows(s.Files,"_001.txt","","","DPS")
    V48Assert(rows.Length=2 && rows[1].Source.Path==f.Path && rows[1].Match.Role=2,"matching older filename retains newer recorder metadata from its identical copy")
    V48Assert(IPVLRows(s.Files,"_001.txt","","","Unknown").Length=0,"filename search cannot resurrect stale unknown roles")
    V48Assert(IPVLRows(s.Files).Length=2 && IPVLRows(s.Files,"_002.txt","","","DPS").Length=2,"metadata selection and filename aliases still count each match once")
    entry := {Source:f,Match:f.Matches[1]}
    V48Assert(IPVLResolveOpen(entry)=entry,"a valid selected source is retained")
    FileDelete(f.Path)
    resolved := IPVLResolveOpen(entry)
    V48Assert(resolved.Source.Path=copy.Path && resolved.Match.Start=entry.Match.Start,"an unavailable original opens the verified identical copy of the same match")
    V48Assert(s.Files.Count=2 && entry.Source.Path=f.Path,"opening an alternate preserves indexed sources and selected metadata")
    originalDate := copy.Date,copy.Date := "20261024"
    V59ExpectError((*)=>IPVLResolveOpen(entry))
    copy.Date := originalDate
    mismatch := copy.Clone(),mismatch.Matches := [],s.Files := Map(StrLower(copy.Path),mismatch)
    V59ExpectError((*)=>IPVLResolveOpen(entry))
    s.Files := Map(StrLower(copy.Path),copy)
    text := FileRead(copy.Path,"UTF-8"),FileDelete(copy.Path)
    FileAppend(StrReplace(text,"Player1","Player9"),copy.Path,"UTF-8")
    FileSetTime(copy.Modified,copy.Path,"M")
    V48Assert(IPVLSourceCurrent(copy),"modified-copy fixture retains the indexed size and modification time")
    V59ExpectError((*)=>IPVLResolveOpen(entry))
    V48Assert(IPVLRows(s.Files).Length=2,"failed verification does not remove the user's stored matches")
}

V7868PvPLibraryLocale() => V7844Run(V7868PvPLibraryLocaleCase)
V7868PvPLibraryLocaleCase()
{
    global IUB
    previous := IUB.NumberFormat
    try {
        f := V7844File(),s := IPVLState(),lib := ILBState()
        IPVLLoad(),IPVLCommit(f),ILBBuildWindow(),c := lib.Controls
        c["Tabs"].Choose(6),ILBPageChanged()
        app := IPNewApp(),state := IPMNewState(),session := IPVNewSession()
        session.Matches := f.Matches,app.Live := IPNewData("live arena locale")
        app.Live.Arena := session,app.View := "Live",state.Source := 1
        saved := IPNewData("saved arena locale"),saved.Finished := true,saved.Arena := session
        segment := {Start:f.Matches[1].Start+5000,AreaId:"137438993370"}
        for mode in ["us","eu"] {
            IUB.NumberFormat := mode,IPVLDraw()
            expected := mode="eu" ? "50,0%" : "50.0%"
            V48Assert(InStr(c["PvPSummary"].Text,expected),"PvP library win rate follows " mode " number formatting")
            live := IPVUView(app,state,state.Panels["PvP"],0),loaded := IPVSSaved(saved,segment,app)
            V48Assert(live.Rows[2].Value="1W / 1L (" expected ")" && loaded.Rows[3].Value="1W / 1L (" expected ")","live and saved arena rates follow " mode " number formatting")
            V48Assert(IPVUPreview().Rows[3].Value="5W / 2L (" (mode="eu" ? "71,4%" : "71.4%") ")","explicit preview rate follows " mode " number formatting")
            V48Assert(c["PvPList"].GetCount()=2 && InStr(c["PvPSummary"].Text,"1 W / 1 L"),"number formatting preserves match rows and totals")
            c["PvPResult"].Choose(2),IPVLFilter()
            V48Assert(c["PvPList"].GetCount()=1 && c["PvPList"].GetText(1,4)="Won","result filter remains usable in " mode)
            c["PvPResult"].Choose(1),IPVLFilter()
        }
        lib.Gui.Show("Hide w1120 h760"),ILBResize(lib.Gui,0,1120,760),controls := []
        for c in lib.Gui {
            if V58ChildVisible(c)
                controls.Push(c)
        }
        V7412PlayerControlsPng("pvp-library-eu-dev68.png",lib.Gui,controls,0,0,1120,760)
    }
    finally IUB.NumberFormat := previous
}

; Pure historical-summary diagnostics; no scans, files, app settings or live UI.
V7869HistoryMatch(owner,outcome,start,teammates := "",opponents := "",server := "server-one",path := "C:\logs\combat_2026-10-28_00_00_00_001.txt")
{
    m := {Area:"Corellia Square",Owner:owner,Player:"Recorder " owner,Server:server,Source:path,
        Start:start,End:start+1000,Outcome:outcome,Reason:"fixture",RoundWins:outcome="win" ? 2 : 0,
        RoundLosses:outcome="loss" ? 2 : 0,Rounds:[],Teammates:[{Id:owner,Name:"Recorder " owner}],Opponents:[],Closed:true}
    if teammates is Array
        for id in teammates
            m.Teammates.Push({Id:id,Name:"Player " id})
    if opponents is Array
        for id in opponents
            m.Opponents.Push({Id:id,Name:"Player " id})
    return m
}

V7869HistoryFile(matches,path := "C:\logs\combat_2026-10-28_00_00_00_001.txt",digest := 1,date := "20261028")
{
    return {Path:path,Date:date,Size:1000,Modified:"20261028120000",Digest:Format("{:064}",digest),Encoding:"UTF-8",Matches:matches}
}

V7869HistoryRow(rows,id)
{
    for row in rows
        if row.Id=id
            return row
    throw Error("Missing fixture history person " id)
}

V7869HistoryIdentityScope()
{
    one := V7869HistoryMatch("1","win",1000,["10"],["20"])
    two := V7869HistoryMatch("2","loss",3000,["10"],["20"])
    sameName := V7869HistoryMatch("1","win",5000,["11"],["21"])
    sameName.Teammates[2].Name := one.Teammates[2].Name
    otherServer := V7869HistoryMatch("1","loss",7000,["10"],["20"],"server-two")
    files := Map("one",V7869HistoryFile([one,two,sameName,otherServer])),cache := IPVHNewCache()
    current := V7869HistoryMatch("1","unknown",10000,["10","11"],["20","21"])
    current.Teammates[2].Name := "Renamed teammate"
    all := IPVHQuery(cache,files,current),with := V7869HistoryRow(all.Teammates,"10"),against := V7869HistoryRow(all.Opponents,"20")
    V48Assert(with.Wins=1 && with.Losses=1 && with.WinRate=50 && with.Name="Renamed teammate","all characters combines recorder IDs using the current display name")
    V48Assert(against.Wins=1 && against.Losses=1,"against opponents uses the recorder's wins and losses")
    V48Assert(V7869HistoryRow(all.Teammates,"11").Wins=1,"same-name characters keep independent records")
    V48Assert(all.Teammates.Length=2 && all.IdentityKnown,"the recorder is omitted from teammate rows")
    scoped := IPVHQuery(cache,files,current,"current"),with := V7869HistoryRow(scoped.Teammates,"10")
    V48Assert(with.Wins=1 && with.Losses=0 && with.WinRate=100,"current-character history filters by server and recorder ID")
    V48Assert(cache.Builds=1 && cache.SessionBuilds=1,"changing character scope reuses the history index")
    current.Server := "server-two",other := IPVHQuery(cache,files,current)
    V48Assert(V7869HistoryRow(other.Teammates,"10").Wins=0 && V7869HistoryRow(other.Teammates,"10").Losses=1,"identical character IDs on different servers never mix")
}

V7869HistoryDedup()
{
    m := V7869HistoryMatch("1","win",1000,["10","10"],["20","20"]),a := V7869HistoryFile([m],,1)
    copy := V7869HistoryFile([IPVCopyView(m)],"D:\copies\combat_2026-10-29_00_00_00_001.txt",1,"20261029")
    files := Map("a",a,"copy",copy),current := V7869HistoryMatch("1","unknown",10000,["10"],["20"]),cache := IPVHNewCache()
    result := IPVHQuery(cache,files,current)
    V48Assert(result.Teammates[1].Wins=1 && result.Opponents[1].Wins=1,"copied files and repeated roster members count once")
    selected := IPVCopyView(m),selected.Source := copy.Path
    excluded := IPVHQuery(cache,files,selected)
    V48Assert(!excluded.Teammates[1].HasHistory && !excluded.Opponents[1].HasHistory,"opening a renamed duplicate excludes the selected match through its alias")
    first := IPVCopyView(m),first.Outcome := "unknown",files := Map("a",V7869HistoryFile([first],,1),"copy",copy)
    result := IPVHQuery(cache,files,current),excluded := IPVHQuery(cache,files,selected)
    V48Assert(result.Teammates[1].Wins=1 && !excluded.Teammates[1].HasHistory,"a resolved duplicate replaces an unresolved summary and keeps copy exclusion")
    conflict := IPVCopyView(m),conflict.Outcome := "loss"
    files := Map("a",a,"conflict",V7869HistoryFile([conflict],,2))
    result := IPVHQuery(cache,files,current)
    V48Assert(result.Teammates[1].Resolved=0 && result.Teammates[1].Unknown=1,"contradictory summaries for one match never become two results")
}

V7869HistoryUnknown()
{
    unknown := V7869HistoryMatch("1","unknown",1000,["10"],["20"])
    win := V7869HistoryMatch("1","win",3000,["11"],["21"])
    loss := V7869HistoryMatch("1","loss",5000,["11"],["21"])
    another := V7869HistoryMatch("1","unknown",7000,["11"],["21"])
    files := Map("a",V7869HistoryFile([unknown,win,loss,another])),cache := IPVHNewCache()
    current := V7869HistoryMatch("1","unknown",10000,["10","11","12"],["20","21","22"])
    result := IPVHQuery(cache,files,current),unresolved := V7869HistoryRow(result.Teammates,"10"),none := V7869HistoryRow(result.Teammates,"12")
    V48Assert(unresolved.HasHistory && unresolved.Unknown=1 && unresolved.Resolved=0 && unresolved.WinRate=-1,"unresolved-only history remains distinguishable from no history")
    V48Assert(!none.HasHistory && none.Matches=0 && none.WinRate=-1,"absent history has no fabricated zero-percent win rate")
    mixed := V7869HistoryRow(result.Teammates,"11")
    V48Assert(mixed.Matches=3 && mixed.Resolved=2 && mixed.WinRate=50,"unknown outcomes are excluded from the win-rate denominator")
    current.Server := "",result := IPVHQuery(cache,files,current)
    V48Assert(!result.IdentityKnown && result.Teammates.Length=3,"missing server keeps the recorder hidden and reports identity unavailable")
    V48Assert(!result.Teammates[1].IdentityKnown && !result.Teammates[1].HasHistory,"missing server never matches another server by character name or ID")
    current.Server := "server-one",current.Teammates[2].Id := ""
    result := IPVHQuery(cache,files,current)
    V48Assert(!result.Teammates[1].IdentityKnown && !result.Teammates[1].HasHistory,"missing character ID never falls back to the visible name")
    current := V7869HistoryMatch("1","unknown",10000,["11"],["21"]),current.HistoryTimeKnown := false
    result := IPVHQuery(cache,files,current)
    V48Assert(IPVHMatchKey(current)="" && !result.IdentityKnown && !result.Teammates[1].HasHistory,"unproven postmidnight live time cannot include the selected match in its own history")
}

V7869HistorySelected()
{
    a := V7869HistoryMatch("1","win",1000,["10"],["20"]),b := V7869HistoryMatch("1","loss",3000,["10"],["20"])
    files := Map("a",V7869HistoryFile([a,b],,3)),cache := IPVHNewCache()
    files := IPVLParse(IGVJson(IPVLPack(files)))
    selected := IPVCopyView(a),selected.Source .= "|live-file-identity"
    result := IPVHQuery(cache,files,selected)
    V48Assert(result.Teammates[1].Wins=0 && result.Teammates[1].Losses=1,"a selected saved or live match excludes itself after catalogue roundtrip")
    V48Assert(result.Opponents[1].Wins=0 && result.Opponents[1].Losses=1,"selected-match exclusion also applies against opponents")
    selected := IPVCopyView(b),result := IPVHQuery(cache,files,selected,"current")
    V48Assert(result.Teammates[1].Wins=1 && result.Teammates[1].Losses=0,"changing selected match updates exclusion without rebuilding")
    V48Assert(cache.Builds=1,"selection changes do not rescan the historical catalogue")
    midnight := V7869HistoryMatch("1","win",86401000,["10"],["20"])
    later := IPVCopyView(midnight),later.Start := 1000,later.End := 2000,later.Source := "C:\logs\combat_2026-10-29_00_00_00_002.txt"
    files := Map("before",V7869HistoryFile([midnight],,1),"after",V7869HistoryFile([later],later.Source,2,"20261029"))
    result := IPVHQuery(cache,files,later)
    V48Assert(!result.Teammates[1].HasHistory,"equivalent midnight dates and unwrapped offsets deduplicate and exclude by absolute log time")
}

V7869HistoryLive()
{
    old := V7869HistoryMatch("1","win",1000,["10"],["20"]),live := V7869HistoryMatch("1","loss",3000,["10"],["20"])
    files := Map("a",V7869HistoryFile([old],,4)),completed := [IPVCopyView(old)],cache := IPVHNewCache()
    current := V7869HistoryMatch("1","unknown",10000,["10"],["20"])
    result := IPVHQuery(cache,files,current,,completed)
    V48Assert(result.Teammates[1].Wins=1 && result.Teammates[1].Matches=1,"indexed matches also present in the live session count once")
    completed.Push(live),result := IPVHQuery(cache,files,current,,completed)
    V48Assert(result.Teammates[1].Wins=1 && result.Teammates[1].Losses=1,"completed live matches contribute before the library indexes them")
    result := IPVHQuery(cache,files,live,,completed)
    V48Assert(result.Teammates[1].Wins=1 && result.Teammates[1].Losses=0,"the just-finished current live match remains excluded")
    active := V7869HistoryMatch("1","win",5000,["10"],["20"]),active.Closed := false,completed.Push(active)
    result := IPVHQuery(cache,files,current,,completed)
    V48Assert(result.Teammates[1].Matches=2,"a provisional live result cannot enter historical totals")
    unproven := V7869HistoryMatch("1","win",8000,["10"],["20"]),unproven.HistoryTimeKnown := false,completed.Push(unproven)
    result := IPVHQuery(cache,files,current,,completed)
    V48Assert(result.Teammates[1].Matches=2,"completed live rows with unknown calendar offsets do not enter history")
    files := Map("a",V7869HistoryFile([old,IPVCopyView(live)],,5)),result := IPVHQuery(cache,files,current,,completed)
    V48Assert(result.Teammates[1].Wins=1 && result.Teammates[1].Losses=1,"indexing a previously live match does not count it twice")
}

V7869HistoryCache()
{
    old := V7869HistoryMatch("1","win",1000,["10"],["20"]),files := Map("a",V7869HistoryFile([old],,6))
    current := V7869HistoryMatch("1","unknown",10000,["10"],["20"]),completed := [],cache := IPVHNewCache()
    Loop 20
        IPVHQuery(cache,files,current,A_Index=10 ? "current" : "all",completed)
    V48Assert(cache.Builds=1 && cache.SessionBuilds=1,"repeated overlay frames and scope changes perform no catalogue traversal")
    current.Teammates.Push({Id:"11",Name:"New teammate"}),result := IPVHQuery(cache,files,current,,completed)
    V48Assert(result.Teammates.Length=2 && !result.Teammates[2].HasHistory && cache.Builds=1,"a new current roster appears without rebuilding history")
    files["a"].Matches.Push(V7869HistoryMatch("1","loss",3000,["10"],["20"]))
    result := IPVHQuery(cache,files,current,,completed,1)
    V48Assert(result.Teammates[1].Losses=1 && cache.Builds=2,"an explicit revision invalidates an in-place catalogue edit")
    completed.Push(V7869HistoryMatch("1","win",5000,["10"],["20"]))
    result := IPVHQuery(cache,files,current,,completed,1)
    V48Assert(result.Teammates[1].Wins=2 && cache.Builds=2 && cache.SessionBuilds=3,"appending a closed live match refreshes only the small session index")
    completed[1].Outcome := "loss",result := IPVHQuery(cache,files,current,,completed,1,1)
    V48Assert(result.Teammates[1].Wins=1 && result.Teammates[1].Losses=2 && cache.Builds=2,"explicit session revision updates a corrected completed summary")
    files := files.Clone(),result := IPVHQuery(cache,files,current,,completed,1,1)
    V48Assert(cache.Builds=3 && result.Teammates[1].Matches=3,"load or commit map replacement refreshes the cached base index")
}

; Current arena rosters are presentation-only; historical unions/results remain.
; Uses private parsed fixtures, without windows, saved settings or live state.
V7869RosterIds(people)
{
    ids := Map()
    for person in people
        ids[person.Id] := true
    return ids
}

V7869CurrentRosterPreparation()
{
    s := V7868ArenaNew()
    V7838ArenaFeed(s,10,V7838ArenaActor(99),"=","Event","900001")
    view := IPVSnapshot(s.Arena).Current
    V48Assert(view.CurrentOpponents.Length=0,"seeing an unknown player does not identify an opponent")
    V48Assert(!V7869RosterIds(view.CurrentTeammates).Has("99"),"unknown-side players do not become teammates")
    V7838ArenaFeed(s,20,V7838ArenaActor(1),V7838ArenaActor(2),"ApplyEffect","836045448945500",1)
    view := IPVSnapshot(s.Arena).Current,own := V7869RosterIds(view.CurrentTeammates)
    V48Assert(own.Count=2 && own.Has("1") && own.Has("2"),"observed preparation healing establishes connected teammates")
    V48Assert(view.CurrentOpponents.Length=0,"preparation healing does not manufacture an opposing team")
    V48Assert(view.Teammates.Length=0 && view.Rounds.Length=0,"preparation roster does not add historical participation or a round")
    V7838ArenaFeed(s,30,V7838ArenaActor(1),V7838ArenaActor(3),"ApplyEffect","836045448945501",1)
    view := IPVSnapshot(s.Arena).Current
    V48Assert(view.CurrentOpponents.Length=1 && view.CurrentOpponents[1].Id="3","first observed damage establishes the opposing player")
    V7838ArenaFeed(s,40,V7838ArenaActor(1),V7838ArenaActor(3),"ApplyEffect","836045448945500",1)
    view := IPVSnapshot(s.Arena).Current
    V48Assert(view.CurrentTeammates.Length=0 && view.CurrentOpponents.Length=0,"contradictory team evidence leaves the current roster unassigned")
    s := V7838ArenaFixture(["win","win"]),view := IPVSnapshot(s.Arena).Current
    own := V7869RosterIds(view.CurrentTeammates)
    V48Assert(own.Count=2 && own.Has("2"),"preparation-healed teammate remains visible after the next round marker")
    V48Assert(view.Outcome="win" && view.RoundWins=2 && view.Teammates.Length=2,"presentation preparation evidence preserves result and historical union")
}

V7869CurrentRosterReplacement()
{
    s := V7868ArenaNew(),other := [11,12,13,14]
    V7868ArenaRoster(s,5000,[1,2,3,4],other),V7868ArenaDeaths(s,6000,[1,2,3,4])
    V7868ArenaReset(s,10000,[1,2,3,4,11,12,13,14])
    ; Player 2 appears briefly during preparation, then leaves before player 5
    ; replaces them. Other previous-round players have not been seen again.
    V7838ArenaFeed(s,11500,V7838ArenaActor(1),V7838ArenaActor(2),"ApplyEffect","836045448945500",1)
    V7838ArenaFeed(s,12000,V7838ArenaActor(1),V7838ArenaActor(5),"ApplyEffect","836045448945500",1)
    view := IPVSnapshot(s.Arena).Current,own := V7869RosterIds(view.CurrentTeammates)
    V48Assert(own.Count=2 && own.Has("1") && own.Has("5"),"next preparation shows observed known-side players after replacement filtering")
    V48Assert(!own.Has("2") && !own.Has("3") && !own.Has("4"),"previous-round teammates are not carried into the preparation roster")
    V48Assert(view.CurrentOpponents.Length=0,"previous-round opponents are not carried into an unseen preparation team")
    V48Assert(view.Teammates.Length=4 && view.RoundLosses=1 && view.Rounds.Length=1,"preparation leaves historical round-one participation and score unchanged")
    V7868ArenaRoster(s,30000,[1,3,4,5],other)
    view := IPVSnapshot(s.Arena).Current,own := V7869RosterIds(view.CurrentTeammates)
    V48Assert(own.Count=4 && own.Has("5") && !own.Has("2"),"active second round replaces departed teammate")
    V48Assert(view.Teammates.Length=5,"historical match union still includes the departed and replacement players")
    V7868ArenaDeaths(s,31000,[1,3,4,5]),IPVBoundary(s,"EOF")
    view := IPVSnapshot(s.Arena).Last,own := V7869RosterIds(view.CurrentTeammates)
    V48Assert(view.Outcome="loss" && view.RoundLosses=2 && view.Rounds.Length=2,"current roster does not change reconstructed match result")
    V48Assert(own.Count=4 && own.Has("5") && !own.Has("2") && view.Teammates.Length=5,"closed summary retains final roster separately from participation union")
}

V7869CurrentRosterPostmatch()
{
    s := V7838ArenaFixture(["win"])
    V7868ArenaReset(s,10000,[3,1,2])
    V7838ArenaFeed(s,12000,"","","Event","900001")
    view := IPVSnapshot(s.Arena).Current
    V48Assert(view.CurrentTeammates.Length=0 && view.CurrentOpponents.Length=0,"confirmed reset without current-span player observations has no current roster")
    V48Assert(view.Teammates.Length=2 && view.Opponents.Length=1 && view.RoundWins=1,"empty current roster preserves the preceding round history")
    s := V7838ArenaFixture(["win","win"])
    V7868ArenaReset(s,15000,[3,1,2])
    V7838ArenaFeed(s,17000,V7838ArenaActor(1),V7838ArenaActor(99),"ApplyEffect","836045448945501",1)
    view := IPVSnapshot(s.Arena).Current,other := V7869RosterIds(view.CurrentOpponents)
    V48Assert(view.Outcome="win" && view.RoundWins=2 && view.Rounds.Length=2,"ignored postmatch damage still leaves a decisive two-round result")
    V48Assert(other.Count=1 && other.Has("3") && !other.Has("99"),"decisive live match retains final active roster instead of ignored postmatch opponents")
    V48Assert(view.Opponents.Length=1,"ignored postmatch opponent is absent from historical union too")
    IPVBoundary(s,"EOF"),view := IPVSnapshot(s.Arena).Last
    V48Assert(view.CurrentTeammates.Length=2 && view.CurrentOpponents[1].Id="3","closed match retains final active roster after trailing cleanup")
}

V7869CurrentRosterCopies()
{
    s := V7838ArenaFixture(["win","win"]),IPVBoundary(s,"EOF")
    one := IPVSnapshot(s.Arena).Last,count := one.CurrentTeammates.Length
    one.CurrentTeammates[1].Name := "UI changed",one.CurrentOpponents[1].Name := "UI changed"
    one.CurrentTeammates.RemoveAt(1)
    two := IPVSnapshot(s.Arena).Last
    V48Assert(two.CurrentTeammates.Length=count && two.CurrentTeammates[1].Name!="UI changed","display copy cannot mutate stored current teammates")
    V48Assert(two.CurrentOpponents[1].Name!="UI changed","display copy cannot mutate stored current opponents")
    ; Persisted v1 catalogues predate the optional presentation fields.
    two.DeleteProp("CurrentTeammates"),two.DeleteProp("CurrentOpponents"),legacy := IPVCopyView(two)
    V48Assert(legacy.Teammates.Length=2 && legacy.Opponents.Length=1,"legacy catalogue summaries remain copyable")
    V48Assert(!legacy.HasOwnProp("CurrentTeammates"),"legacy match union is not mislabeled as a current roster")
}

; Actual native UI and temporary settings. No normal app, game or real catalogue.
V7869PvPStatsSelection()
{
    s := IPMNewState(),entries := IIFEntries(),found := 0
    V48Assert(!s.Shown["PvP"] && !s.Panels.Has("PvPStats") && s.PvPStatsScope="all","one optional PvP panel with all-character history")
    for e in entries {
        V48Assert(e.Key!="PvPStats","Interface contains no separate Stats item")
        found += e.Key="PvP"
    }
    V48Assert(found=1,"Interface contains exactly one PvP entry")
    IIFSetChoice(s,"Combined",false),IIFSetChoice(s,"PvP",true)
    targets := IPMDisplayTargets(s)
    V48Assert(targets.Length=1 && targets[1].Kind="PvP","one selection displays one combined panel")
    s.PvPRecordsExpanded := false
    V48Assert(IPMDisplayTargets(s).Length=1,"collapsing records preserves session display")
    V48Assert(IPVSTScopeKey("current")="current" && IPVSTScopeKey("obsolete")="all","scope normalization retained")
    keys := IPMSizeKeys(),labels := IPMSizeLabels(),found := 0
    for i,key in keys {
        V48Assert(key!="PvPStats","size controls contain no obsolete panel")
        if key="PvP"
            found += labels[i]="PvP"
    }
    V48Assert(keys.Length=labels.Length && found=1,"one PvP size option")
}

V7869PvPStatsSettings() => V55Isolated(V7869PvPStatsSettingsCase)
V7869PvPStatsSettingsCase()
{
    global IPM,IIF,SETTINGS_FILE,SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended && InStr(SETTINGS_FILE,A_Temp)=1,"settings are isolated")
    IPMLoadSettings()
    V48Assert(!IPM.Shown["PvP"] && IPM.PvPRecordsExpanded && IPM.Panels["PvP"].Width=400,"fresh PvP is optional, with expanded player records")
    IIFCreateMenu(),IPVSTSetScope("current"),IPVUSetExpanded(false)
    V48Assert(!IPM.Wanted && !IPM.TimerOn,"setting scope/disclosure never starts the overlay")
    IIFSetChoice(IPM,"PvP",true),p := IPM.Panels["PvP"]
    p.X := -450,p.Y := 120,p.Width := 460,p.Height := 380,p.AutoHeight := false
    IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings(),p := IPM.Panels["PvP"]
    V48Assert(IPM.Shown["PvP"] && !IPM.PvPRecordsExpanded && IPM.PvPStatsScope="current","enabled, scope and collapse preferences round-trip")
    V48Assert(p.X=-450 && p.Y=120 && p.Width=460 && p.Height=380 && !p.AutoHeight,"geometry retained")
    V48Assert(!IPM.Wanted && !IPM.TimerOn && !IsObject(p.Gui),"loading does not show or poll")
    IPVSTSetScope("bogus")
    V48Assert(IPM.PvPStatsScope="all","invalid scope normalizes")
}

V7869PvPStatsNative() => V65UITimerIsolated(V7869PvPStatsNativeCase)
V7869PvPStatsNativeCase(*)
{
    global IP,IPM,IUB,SELF_TEST,SETTINGS_FILE
    old := IP
    try {
        V48Assert(SELF_TEST && A_IsSuspended,"native rendering is isolated")
        IP := IPNewApp(),IPM.Mode := 2,IPM.Shown["PvP"] := true
        p := IPM.Panels["PvP"],p.Width := 400,IPMEnsureGui("PvP",0,p)
        empty := {Note:"",Message:"Waiting for an arena",Rows:[]}
        IPVURenderData(empty,empty,p)
        V48Assert(p.Heading.Text="PvP" && p.VisibleRows=0 && p.Meta.Text="Waiting for an arena" && !V58ChildVisible(p.Empty),"shared waiting message appears once without fake history")
        V48Assert((WinGetExStyle(p.Gui.Hwnd)&0x08000020)=0x08000020 && !DllCall("IsWindowVisible","Ptr",p.Gui.Hwnd),"body is nonactivating and click-through")
        IPMPreviewSet(8)
        for format in ["us","eu"] {
            IUB.NumberFormat := format,IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
            V48Assert(InStr(p.Heading.Text,"PREVIEW") && p.VisibleRows=13,"one preview includes session and seven player records")
            V48Assert(p.Rows[1].Name.Text="Current match" && p.Rows[3].Value.Text="5W / 2L (" IUNDecimal("71.4%") ")" && p.Rows[5].Name.Text="With" && p.Rows[9].Name.Text="Against","summary precedes teammate/opponent groups")
            V48Assert(p.Rows[7].Total.Text="1 unresolved" && V58ChildVisible(p.Rows[7].Total),"unknown results remain separately labelled")
            V48Assert(InStr(p.Rows[7].Value.Text,format="eu" ? "71,4%" : "71.4%"),"history respects number preference")
        }
        IUB.NumberFormat := "us",IPM.PvPStatsScope := "current"
        IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(V58ChildVisible(p.Tabs["current"]),"scope remains inside expanded records")
        IP.Offline := V7849SavedFixture(),IP.View := "Offline",IP.Selected := 1,IPM.Source := 2
        IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(p.VisibleRows=13 && InStr(p.Heading.Text,"PREVIEW"),"explicit preview overrides saved context")
        sample := IPVSTPreview(),sample.Rows[2].Label := "A very long character name that must not cover the result"
        for width in [196,400,600] {
            p.Width := width,IPM.Font := 18,IPVURenderData(IPVUPreview(),sample,p,true)
            p.Meta.GetPos(&x,&y,&w,&h)
            V48Assert(x>=0 && x+w<=p.Layout.W && y+h<=p.Layout.H,"metadata fits")
            for key,c in p.Tabs {
                c.GetPos(&sx,&sy,&sw,&sh)
                V48Assert(sx>=0 && sx+sw<=p.Layout.W && sy>=p.Layout.ControlsY && sy+sh<=p.Layout.HistoryY,"record controls fit below session")
            }
            for i,row in p.Rows {
                if i>13
                    break
                row.Name.GetPos(&x,&y,&w,&h)
                V48Assert(x>=0 && x+w<=p.Layout.W && y+h<=p.Layout.H,"name fits at width " width " row " i)
                if V58ChildVisible(row.Value) {
                    row.Value.GetPos(&vx,&vy,&vw,&vh)
                    V48Assert(x+w<=vx && vx+vw<=p.Layout.W && vy+vh<=p.Layout.H,"result does not overlap name or escape panel")
                }
            }
        }
        p.Width := 400,IPM.Font := 10,IPVURenderData(IPVUPreview(),IPVSTPreview(),p,true)
        V7869PvPStatsCapture("pvp-combined-dev72.png",p)
        IPM.PvPRecordsExpanded := false,IPVURenderData(IPVUPreview(),"",p,true)
        V48Assert(p.VisibleRows=4 && !V58ChildVisible(p.Rows[7].Total) && !V58ChildVisible(p.Tabs["all"]),"collapse clears old history and scope")
        IPMPreviewClear(IPM),IPVURenderData(empty,"",p)
        V48Assert(p.VisibleRows=0 && p.Heading.Text="PvP","preview exits cleanly")
        V48Assert(!FileExist(SETTINGS_FILE),"rendering never writes settings")
    }
    finally IPMPreviewClear(IPM),IPMDestroyPanels(),IP := old
}

V7869PvPStatsCapture(name,p)
{
    controls := []
    for c in p.Gui {
        if V58ChildVisible(c)
            controls.Push(c)
    }
    ; Overlay layout uses physical pixels (-DPIScale); capture helper accepts
    ; logical dimensions, so avoid padding the evidence image at higher DPI.
    scale := A_ScreenDPI/96
    V7412PlayerControlsPng(name,p.Gui,controls,0,0,p.Layout.W/scale,p.Layout.H/scale)
}

V7869StatsContext()
{
    global IUB
    before := IUB.NumberFormat
    try {
        app := IPNewApp(),state := IPMNewState(),p := state.Panels["PvP"]
        old := V7869HistoryMatch("1","win",1000,["10"],["20"])
        alt := V7869HistoryMatch("2","loss",3000,["10"],["20"])
        selected := V7869HistoryMatch("1","loss",5000,["10","11"],["20","21"])
        f := V7869HistoryFile([old,alt,selected]),library := {Files:Map("f",f),Error:""}
        V48Assert(IPVStatsView(app,state,p,10000,library).Message="Waiting for an arena","empty context has no invented stats")
        data := IPNewData("saved fixture"),data.Finished := true,data.SourcePath := f.Path
        data.Arena := IPVNewSession(),data.Arena.Matches := f.Matches
        seg := IPNewSegment(data,selected.Start+100,"fixture"),seg.AreaId := "137438993370",seg.End := selected.End,seg.Last := selected.End
        data.Segments.Push(seg),data.Current := ""
        app.Offline := data,app.View := "Imported",app.Selected := 1,app.Follow := false,state.Source := 2
        IUB.NumberFormat := "us",view := IPVStatsView(app,state,p,10000,library)
        V48Assert(view.Note="Corellia Square (selected match)" && view.Rows[1].Label="With" && view.Rows[4].Label="Against","saved selection shows participants grouped with before against")
        V48Assert(view.Rows[2].Value="1 W / 1 L (50.0%)" && view.Rows[3].Value="No history","selected match excluded and first-time teammate labeled accurately")
        state.PvPStatsScope := "current",view := IPVStatsView(app,state,p,10001,library)
        V48Assert(view.Rows[2].Value="1 W / 0 L (100.0%)","scope uses recorder rather than selected raid player")
        IUB.NumberFormat := "eu",view := IPVStatsView(app,state,p,10002,library)
        V48Assert(view.Rows[2].Value="1 W / 0 L (100,0%)" && data.PvPStatsCache.Builds=1,"format and scope changes reuse history without stale text")
        V48Assert(!data.HasOwnProp("ArenaLoad"),"indexed saved result needs no reconstruction worker")
        seg.AreaId := "137438989517",view := IPVStatsView(app,state,p,10003,library)
        V48Assert(!view.Rows.Length && view.Message="Iris does not currently support warzones","warzone selection clears history rows")
        seg.AreaId := "137438993370",library.Error := "fixture read error",view := IPVStatsView(app,state,p,10004,library)
        V48Assert(!view.Rows.Length && InStr(view.Message,"unavailable"),"library read failure does not pretend there is no history")
        library.Error := "",library.Files := Map(),view := IPVStatsView(app,state,p,10005,library)
        V48Assert(InStr(view.Message,"Log Library"),"empty library exposes the way to add history")
    }
    finally IUB.NumberFormat := before
}

V7869StatsLiveContext()
{
    app := IPNewApp(),state := IPMNewState(),p := state.Panels["PvP"]
    app.Live := V7838ArenaFixture(["win","win"]),app.Active := true,app.View := "Live",state.Source := 1
    visit := app.Live.Arena.Current,visit.Source := "C:\logs\combat_2026-10-28_00_00_00_001.txt",visit.Server := "he3000"
    visit.HistoryTimeKnown := true,visit.HistoryStart := visit.Start
    previous := V7869HistoryMatch("1","win",500000,["2"],["3"],"he3000",visit.Source)
    library := {Files:Map("history",V7869HistoryFile([previous])),Error:""}
    view := IPVStatsView(app,state,p,10000,library)
    V48Assert(InStr(view.Note,"Current match") && view.Rows.Length=4,"live roster routes to teammate and opponent history: " view.Note " / " view.Message " / " view.Rows.Length)
    V48Assert(InStr(view.Rows[2].Value,"1 W / 0 L"),"current live match is not added to past results")
    cache := app.Live.PvPStatsCache
    view := IPVStatsView(app,state,p,10001,library)
    V48Assert(cache.Builds=1 && cache.SessionBuilds=1,"repeated draws reuse catalogue and session index")
    IPVBoundary(app.Live,"stopped"),app.Active := false,view := IPVStatsView(app,state,p,10002,library)
    V48Assert(InStr(view.Note,"Last match") && InStr(view.Note,"stopped") && InStr(view.Rows[2].Value,"1 W / 0 L"),"last match stays visible but excluded from its own historical rows")
    match := app.Live.Arena.Matches[1],match.HistoryTimeKnown := false
    app.Live.Arena.DeleteProp("DisplayCache"),view := IPVStatsView(app,state,p,12003,library)
    V48Assert(!view.Rows.Length && InStr(view.Message,"identity"),"unproven live date cannot produce potentially duplicated history")
}

V7869StatsSavedWorker() => V65UITimerIsolated(V7869StatsSavedWorkerCase)
V7869StatsSavedWorkerCase(*)
{
    global IP,IPM,SELF_TEST,SETTINGS_FILE
    old := IP,worker := IPVSState(),oldRuntime := worker.TestRuntime
    path := A_Temp "\IrisPvPStatsWorker-" INToken() ".txt"
    try {
        V48Assert(SELF_TEST && A_IsSuspended && !IsObject(worker.Job),"Stats worker test is isolated")
        worker.TestRuntime := A_ScriptDir "\Iris_Test_Runtime.ahk"
        FileAppend(V7843TextMatch(0,["win","win"]),path,"UTF-8")
        IP := IPNewApp(),IP.View := "Imported",IP.Selected := 1,IP.Follow := false
        IP.Offline := V7843WorkerData(path),IPM.Source := 2,IPM.Shown["PvP"] := true
        library := {Files:Map(),Error:""},p := IPM.Panels["PvP"]
        view := IPVStatsView(IP,IPM,p,10000,library)
        V48Assert(IsObject(worker.Job) && InStr(view.Message,"Loading arena results"),"Merged PvP saved view starts the shared worker")
        V7843WorkerWait()
        V48Assert(IP.Offline.HasOwnProp("Arena"),"Merged PvP worker remains enabled and attaches its result")
        view := IPVStatsView(IP,IPM,p,11000,library)
        V48Assert(InStr(view.Note,"Selected match") && !IsObject(worker.Job),"Merged PvP view reuses completed saved result")
        IP.Offline := V7843WorkerData(path),IPVSRequest(IP.Offline),IPM.Shown["PvP"] := false,IPVSPoll()
        V48Assert(!IsObject(worker.Job),"hiding PvP cancels the shared worker")
        V48Assert(!FileExist(SETTINGS_FILE),"Stats view and worker preserve settings")
    }
    finally {
        IPVSStop(worker),worker.TestRuntime := oldRuntime,IP := old
        if FileExist(path)
            FileDelete(path)
    }
}

; Separate history clock only: parser-relative timestamps and outcomes stay intact.
V7869HistoryClockSource()
{
    key := "C:\logs\combat_2026-10-28_23_00_00_001.txt|identity",c := IPReaderNew(key,true)
    c := IPReaderNext(c,"[23:59:59.900] unrelated record",key),queued := c
    c := IPReaderNext(c,"[00:00:00.100] unrelated record",key)
    V48Assert(IPReaderHistory(c,key,100).Known && IPReaderHistory(c,key,100).At=86400100,"the full reader clock crosses midnight even outside arenas")
    V48Assert(queued.HistoryDayOffset=0 && c.HistoryDayOffset=86400000,"queued contexts preserve their own immutable day offset")
    late := IPReaderNext(c,"[23:59:59.950] slightly reordered record",key)
    V48Assert(IPReaderHistory(late,key,86399950).At=86399950,"a late pre-midnight event retains its original day")
    c := IPReaderNext(late,"[00:00:00.200] next record",key)
    V48Assert(IPReaderHistory(c,key,200).At=86400200,"a reordered event does not roll the reader back")
    V48Assert(!IPReaderHistory(c,"different|source",200).Known && !IPReaderHistory(c,key,-1).Known,"wrong source and invalid clocks cannot provide historical identity")
    partial := IPReaderNext(IPReaderNew(key),"[00:00:00.200] partial attachment",key)
    V48Assert(!IPReaderHistory(partial,key,200).Known,"a reader not anchored to file start stays explicitly unknown")
    changed := IPReaderNext(c,"[00:00:00.200] replacement",key "-new")
    V48Assert(!IPReaderHistory(changed,key "-new",200).Known,"source replacement cannot inherit another file's day offset")
}

V7869HistoryClockQueue()
{
    key := "C:\logs\combat_2026-10-28_23_00_00_001.txt|identity",c := IPReaderNew(key,true)
    c := IPReaderNext(c,"[23:59:59.900] hydration before midnight",key)
    c := IPReaderNext(c,"[00:00:00.100] hydration after midnight",key)
    line := V7838ArenaLine(1000,V7838ArenaActor(1),"","Area","",,"137438993370")
    context := IPReaderNext(c,line,key),data := IPNewData("history clock diagnostic")
    IPFeedLine(data,line,key,context)
    view := IPVSnapshot(data.Arena).Current
    V48Assert(view.Start=1000 && data.LastStamp=1000,"starting Parse after midnight retains the existing parser-relative clock")
    V48Assert(view.HistoryTimeKnown && view.HistoryStart=86401000,"the arena view also carries its independently hydrated full-file time")
    saved := IPVCopyView(view),saved.Start := 86401000,saved.Source := StrSplit(key,"|")[1]
    saved.DeleteProp("HistoryStart"),saved.DeleteProp("HistoryTimeKnown")
    V48Assert(IPVHMatchKey(view)=IPVHMatchKey(saved),"live and saved summaries identify the same postmidnight match")
    later := IPReaderNext(context,"[23:59:59.900] following evening",key)
    later := IPReaderNext(later,"[00:00:00.100] second midnight",key)
    V48Assert(IPReaderHistory(context,key,1000).At=86401000,"queued event identity does not change while the reader advances another day")
    unanchored := IPNewData("unanchored live diagnostic"),empty := IPReaderNew(key)
    IPFeedLine(unanchored,line,key,empty),unknown := IPVSnapshot(unanchored.Arena).Current
    V48Assert(!unknown.HistoryTimeKnown && IPVHMatchKey(unknown)="","live parsing without hydration does not invent a calendar identity")
    offline := IPNewData("saved diagnostic"),offline.SourceKey := StrSplit(key,"|")[1]
    IPFeedLine(offline,line),plain := IPVSnapshot(offline.Arena).Current
    V48Assert(!plain.HasOwnProp("HistoryTimeKnown") && plain.Start=1000,"ordinary saved parsing keeps the existing full-file timestamp convention")
}

V7869HistoryClockFileStart()
{
    global SELF_TEST
    V48Assert(SELF_TEST,"clock file checks require isolated diagnostics")
    dir := A_Temp "\iris-history-clock-" DllCall("GetCurrentProcessId") "-" A_TickCount
    DirCreate(dir),file := ""
    try {
        text := "[23:59:59.900] first`n[00:00:00.100] second`n"
        for encoding in ["UTF-8","UTF-8-RAW","CP1252"] {
            path := dir "\" encoding ".txt",FileAppend(text,path,encoding),file := FileOpen(path,"r",encoding)
            before := file.Pos,fromStart := IPReaderAtStart(file)
            V48Assert(fromStart && file.Pos=before,"file-start detection accepts a genuine initial BOM and preserves the reader position")
            c := IPReaderNew(path,fromStart)
            while !file.AtEOF
                c := IPReaderNext(c,file.ReadLine(),path)
            V48Assert(IPReaderHistory(c,path,100).Known && IPReaderHistory(c,path,100).At=86400100,"a silent full-file pass supplies the same midnight offset for supported encodings")
            file.Pos := before,file.ReadLine(),partial := file.Pos
            V48Assert(!IPReaderAtStart(file) && file.Pos=partial,"a partial-file reader cannot claim full-file history")
            file.Close(),file := ""
        }
        file := FileOpen(dir "\UTF-8-RAW.txt","r","UTF-8-RAW"),file.Pos := 3
        V48Assert(!IPReaderAtStart(file) && file.Pos=3,"byte three is not treated as a BOM without verifying its bytes")
        file.Close(),file := ""
    }
    finally {
        if IsObject(file)
            file.Close()
        if SubStr(StrLower(dir),1,StrLen(A_Temp)+1)=StrLower(A_Temp "\")
            DirDelete(dir,true)
    }
}

V7870PvPScopeInput() => V65UITimerIsolated(V7870PvPScopeInputCase)
V7870PvPScopeInputCase(*)
{
    global IPM,SELF_TEST,SETTINGS_FILE
    V48Assert(SELF_TEST && A_IsSuspended,"scope input tests run in the diagnostic sandbox")
    IPM.Enabled := true,IPM.Wanted := true,IPM.Mode := 2,IPM.Shown["PvP"] := true
    IPM.ClickTabs := false,IPM.ParserControls := false
    V48Assert(IPVSTScopeSurfaceNeeded(IPM,true,true),"scope is available without Personal tabs or parser controls")
    for state in ["hidden","outside","edit","disabled"] {
        IPM.Editing := state="edit",IPM.Enabled := state!="disabled"
        V48Assert(!IPVSTScopeSurfaceNeeded(IPM,state!="hidden",state!="outside"),"scope hit surface suppressed when " state)
    }
    IPM.Editing := false,IPM.Enabled := true
    V48Assert(IPVSTScopeAllowed(IPM,"locked",true,true),"visible locked overlay accepts scope input in display context")
    V48Assert(!IPVSTScopeAllowed(IPM,"locked",true,false) && !IPVSTScopeAllowed(IPM,"locked",false,true),"hidden and out-of-context controls cannot change scope")
    IPM.Drag := {}
    V48Assert(!IPVSTScopeAllowed(IPM,"locked",true,true),"drag blocks scope switches")
    IPM.Drag := "",IPM.Busy := true
    V48Assert(!IPVSTScopeAllowed(IPM,"locked",true,true),"busy overlay blocks scope switches")
    IPM.Busy := false,p := IPM.Panels["PvP"],IPMEnsureGui("PvP",0,p)
    try {
        IPVURenderData(IPVUPreview(),IPVSTPreview(),p,true)
        V48Assert(IPVSTEnsureScopeSurface(p) && IPVSTPlaceScopeSurface(p),"native scope surface can be built and aligned while hidden")
        V48Assert((WinGetExStyle(p.TabGui.Hwnd)&0x08000000)!=0 && (WinGetExStyle(p.TabGui.Hwnd)&0x20)=0,"scope strip receives clicks without activating the window")
        V48Assert((WinGetExStyle(p.Gui.Hwnd)&0x08000020)=0x08000020,"statistics body retains click-through and no-activation styles")
        p.TabGui.GetPos(&x,&y,&w,&h),p.Gui.GetClientPos(&gx,&gy)
        V48Assert(x=gx+p.Layout.Margin && y=gy+p.Layout.ControlsY && w=p.Layout.W-2*p.Layout.Margin && h=p.Layout.ControlsH,"input surface covers exactly the disclosure and scope strip")
        V48Assert(!DllCall("IsWindowVisible","Ptr",p.TabGui.Hwnd) && !IPVSTScopeClicked("current",p.TabButtons["current"]),"hidden controls cannot save a preference")
        V48Assert(!FileExist(SETTINGS_FILE),"rejected clicks do not create settings")
        p.TabDrawn := true
        V48Assert(IPMTabMessage(0,0,0x21,p.TabButtons["all"].Hwnd)=3,"scope click retains foreground keyboard focus")
        V48Assert(IPMTabMessage(0,0,0x21,p.Rows[1].Name.Hwnd)="","scope handling does not capture statistics rows")
        IPMHideTabSurface(p)
        V48Assert(!p.TabDrawn && !DllCall("IsWindowVisible","Ptr",p.TabGui.Hwnd),"hide retires scope input")
        old := p.TabButtons["current"],p.TabGui.Destroy()
        V48Assert(IPVSTEnsureScopeSurface(p) && p.TabButtons["current"]!=old,"destroyed surface is rebuilt with fresh controls")
        V48Assert(!IPVSTScopeClicked("current",old),"stale control cannot change scope")
        IPM.Editing := true,IPMStyle(p),p.Gui.Show("NA")
        V48Assert(IPVSTScopeClicked("current",p.Tabs["current"]),"unlocked visible scope button switches through the real click handler")
        V48Assert(IPM.PvPStatsScope="current" && IniRead(SETTINGS_FILE,"IrisParseDisplay","PvPStatsScope")="current","scope click persists the preference")
        IPVURenderData(IPVUPreview(),IPVSTPreview(),p,true)
        expandedH := p.Layout.H
        V48Assert(IPVSTScopeClicked("records",p.Tabs["records"]) && !IPM.PvPRecordsExpanded,"disclosure click collapses player records")
        V48Assert(!IPVSTScopeClicked("all",p.Tabs["all"]),"collapsed scope control cannot change the preference")
        IPVURenderData(IPVUPreview(),"",p,true)
        V48Assert(p.VisibleRows=4 && p.Layout.H<expandedH && !V58ChildVisible(p.Tabs["all"]),"collapse hides scope and shrinks auto-height while retaining session")
        V48Assert(IniRead(SETTINGS_FILE,"IrisParseDisplay","PvPRecordsExpanded")="0","collapsed preference persists")
        V7869PvPStatsCapture("pvp-collapsed-dev72.png",p)
        V48Assert(IPVSTPlaceScopeSurface(p),"collapsed input geometry can be refreshed")
        p.TabGui.GetPos(&cx,&cy,&cw,&ch)
        V48Assert(ch=p.Layout.DisclosureH && !V58ChildVisible(p.TabButtons["all"]),"collapsed input surface only covers disclosure")
        V48Assert(IPVSTScopeClicked("records",p.Tabs["records"]) && IPM.PvPRecordsExpanded,"records reopen through the same button")
        IPVURenderData(IPVUPreview(),IPVSTPreview(),p,true)
        V7869PvPStatsCapture("pvp-expanded-dev72.png",p)
        V48Assert(IPMIsTab(p,p.Tabs["all"].Hwnd),"scope controls are excluded from overlay dragging")
    }
    finally IPMDestroyPanels()
}

V7871Activation(at,id,key := "@Opponent#900")
{
    return IPParseLine("[" IPStamp(at) "] [" key "] [=] [Localized {" id "}] [Event {836045448945472}: AbilityActivate {836045448945479}]")
}
V7871Infer(seg,id,key := "@Opponent#900",at := -1)
{
    at := at<0 ? seg.Start+100 : at
    IURInferRecord(seg,V7871Activation(at,id,key),at)
}
V7871DisciplineEvidence()
{
    s := IPNewData(),seg := IPNewSegment(s,1000,"fixture"),key := "@Opponent#900"
    for index,pair in [["1259670958243840","2031339142381573"],["961338234896384","2031339142381586"],
        ["3400587601248256","2031339142381584"],["3408941312638976","2031339142381583"],
        ["975760735076352","2031339142381582"],["3401961990782976","2031339142381596"],
        ["3404620575539200","2031339142381625"],["3393462250504192","2031339142381637"]] {
        actor := key index,ev := V7871Activation(1100,pair[1],actor)
        IPApplyEvent(s,ev,1100)
        V48Assert(IPIDiscipline(seg,actor)=pair[2] && IURMask(seg,actor)=[2,2,2,2,1,4,2,4][index],"accepted activation identifies discipline and role with localized ability label")
    }
    for id in ["3434638101970944","1148263801552896","3451633287561216"]
        V7871Infer(seg,id,key)
    V48Assert(IURMask(seg,key)=2 && IPIDiscipline(seg,key)="","shared Fury/Rage activations identify DPS without choosing class artwork")
    V7871Infer(seg,"3387565260406784","@Thermal#1")
    V48Assert(IURMask(seg,"@Thermal#1")=2 && IPIDiscipline(seg,"@Thermal#1")="","Thermal Detonator alone does not imply Powertech")
    V7871Infer(seg,"3394707791020032","@Thermal#1")
    V48Assert(IPIDiscipline(seg,"@Thermal#1")="2031339142381598","distinct IO evidence resolves the shared thermal ability")
    V7871Infer(seg,"961338234896384",key),V7871Infer(seg,"3434638101970944",key)
    V48Assert(IURMask(seg,key)=8 && IPIDiscipline(seg,key)="","conflicting activations remain unresolved for the pull")
    IURRecord(seg,IPParseLine(V622RoleLine(1200,"Medicine","2031339142381596",key)),1200)
    V48Assert(IURMask(seg,key)=4 && IPIDiscipline(seg,key)="2031339142381596","explicit discipline takes precedence over inference conflicts")
    V7871Infer(seg,"961338234896384",key)
    V48Assert(IURMask(seg,key)=4,"later activations cannot replace explicit metadata")
    IURRecord(seg,IPParseLine(V622RoleLine(1300,"Rage","2031339142381578",key)),1300)
    V48Assert(IURMask(seg,key)=6 && IPIDiscipline(seg,key)="mixed","explicit mixed roles remain mixed")
}
V7871DisciplineGuards()
{
    s := IPNewData(),seg := IPNewSegment(s,1000,"fixture"),key := "@Opponent#900"
    V7871Infer(seg,"961338234896384",key,999)
    V7871Infer(seg,"961338234896384","NPC {9}:1")
    V7871Infer(seg,"not-a-signature",key)
    ev := V7871Activation(1100,"961338234896384",key),ev.Kind := "Damage",IURInferRecord(seg,ev,1100)
    V48Assert(IURMask(seg,key)=8 && !seg.HasOwnProp("InferredDisciplines"),"earlier events, NPCs, unknown and non-activation events supply no discipline evidence")
    V7871Infer(seg,"961338234896384",key)
    IPBBeginUndo(s,seg),V7871Infer(seg,"3400587601248256",key),V7871Infer(seg,"3401961990782976","@Tail#2")
    V48Assert(IURMask(seg,key)=8 && IURMask(seg,"@Tail#2")=4,"speculative tail can change inferred evidence")
    IPBRollbackTail(s,seg)
    V48Assert(IPIDiscipline(seg,key)="2031339142381586" && IURMask(seg,"@Tail#2")=8,"tail rollback restores prior evidence and removes new actors")
    clone := IPCDecode(IPCEncode(seg)),clone.InferredDisciplines[key] := 0
    V48Assert(IURMask(clone,key)=8 && IURMask(seg,key)=2,"cache round trip makes independent inference state")
    review := IAAssemble(s,seg,IACaptureNew(seg.Start,seg.Last))
    V48Assert(IPIDiscipline(review,key)=IPIDiscipline(seg,key),"Analysis receives inferred discipline")
    review.InferredDisciplines[key] := 0
    V48Assert(IURMask(seg,key)=2,"Analysis snapshot does not mutate parser evidence")
    IPCloseSegment(s,"fixture"),next := IPNewSegment(s,5000,"new pull")
    V48Assert(IURMask(next,key)=8 && IPIDiscipline(next,key)="","previous pull does not supply roles to a new pull")
    loop 513
        V7871Infer(next,"961338234896384","@Cap#" A_Index)
    V48Assert(next.InferredDisciplines.Count=512 && IURMask(next,"@Cap#513")=8,"inference metadata has a bounded actor count")
    V7871Infer(next,"3400587601248256","@Cap#1")
    V48Assert(IURMask(next,"@Cap#1")=8,"existing actors still update at the limit")
}
V7871DisciplineUI() => V7412PlayerIconFixture(V58Isolated.Bind(V7871DisciplineUICase))
V7871DisciplineUICase()
{
    global IP
    V7428RaidReady(),seg := IPSelectedSegment(),lv := IP.PlayersLV
    for pair in [["@Ahwoo#1","1259670958243840"],["@Zroni#2","961338234896384"],
        ["@Simon Judeau#3","3400587601248256"],["@Lamentation#4","3408941312638976"]] {
        IPStoreActor(seg,IPActor(pair[1])),V7871Infer(seg,pair[2],pair[1])
    }
    V7428RaidRedraw()
    for key in ["@Ahwoo#1","@Zroni#2","@Simon Judeau#3","@Lamentation#4"] {
        row := V7428RaidRow(key)
        V48Assert(row && lv.GetText(row,12)="DPS" && V7881RoleImage(lv,row)=2 && V7412ListRowImage(lv,row)>=0,"Raid paints inferred role text, role icon and class artwork")
    }
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"inferred role UI test stays hidden")
}

V7872PvPMigration()
{
    V55Isolated(V7872PvPMigrationCase)
    V7844Run(V7872PvPCombinedIsolated)
}
V7872PvPMigrationCase()
{
    global IPM,SETTINGS_FILE
    section := "IrisParseDisplay"
    for pair in [["PvPEnabled",0],["PvPStatsEnabled",1],["PvPStatsX",45],["PvPStatsY",90],["PvPStatsWidth",430],["PvPStatsScope","current"]]
        IniWrite(pair[2],SETTINGS_FILE,section,pair[1])
    before := FileRead(SETTINGS_FILE)
    IPMLoadSettings(),p := IPM.Panels["PvP"]
    V48Assert(IPM.Shown["PvP"] && IPM.PvPStatsScope="current" && p.X=45 && p.Y=90 && p.Width=430,"Stats-only users retain enabled state, scope and geometry")
    V48Assert(FileRead(SETTINGS_FILE)=before,"startup migration is read-only")
    IPM.Shown["PvP"] := false,IPVUSetExpanded(false),IPMSaveSettings()
    IPM := IPMNewState(),IPMLoadSettings()
    V48Assert(!IPM.Shown["PvP"] && !IPM.PvPRecordsExpanded,"legacy enabled flag cannot resurrect a deliberately disabled merged panel")
    IniDelete(SETTINGS_FILE,section,"PvPMerged")
    IniWrite(1,SETTINGS_FILE,section,"PvPEnabled"),IniWrite(750,SETTINGS_FILE,section,"PvPX")
    IPM := IPMNewState(),IPMLoadSettings()
    V48Assert(IPM.Shown["PvP"] && IPM.Panels["PvP"].X=750,"both-enabled users keep session panel placement")
    m := IPMNewState()
    ; Legacy layouts are applied to the same complete timer state used at startup.
    timers := IRTUNewState(),timers.BarsWidth := 300,timers.BarsHeight := 200
    old := Map("Shown.PvP",0,"Shown.PvPStats",1,"Panel.PvPStats.X",25,"Panel.PvPStats.Y",80,"Panel.PvPStats.Width",450)
    ILPApplyModel(m,timers,old)
    V48Assert(m.Shown["PvP"] && m.Panels["PvP"].X=25 && m.Panels["PvP"].Width=450 && !m.Panels.Has("PvPStats"),"old named layout restores into one panel")
    V48Assert(!timers.SeparatePanels && timers.PersonalWidth=330 && timers.PersonalX="" && timers.PersonalHeight=0,"legacy PvP layout preserves defaults for later timer fields")
    saved := ILPCapture(m,timers),saved["Shown.PvP"] := 0
    ILPApplyModel(m,timers,saved)
    V48Assert(!m.Shown["PvP"],"new named layouts preserve disabled PvP")
}

V7872PvPCombinedIsolated() => V65UITimerIsolated(V7872PvPCombinedCase)
V7872PvPCombinedCase(*)
{
    global IP,IPM
    old := IP
    try {
        prior := V7869HistoryMatch("1","win",1000,["10"],["20"])
        alt := V7869HistoryMatch("2","loss",3000,["10"],["20"])
        selected := V7869HistoryMatch("1","loss",5000,["10","11"],["20","21"])
        f := V7869HistoryFile([prior,alt,selected]),lib := IPVLState()
        lib.Files := Map("fixture",f),lib.LoadedPath := IPVLPath(),lib.Error := ""
        data := IPNewData("saved fixture"),data.Finished := true,data.SourcePath := f.Path
        data.Arena := IPVNewSession(),data.Arena.Matches := f.Matches
        seg := IPNewSegment(data,selected.Start+100,"fixture"),seg.AreaId := "137438993370",seg.End := selected.End,seg.Last := selected.End
        data.Segments.Push(seg),data.Current := ""
        IP := IPNewApp(),IP.Offline := data,IP.View := "Imported",IP.Selected := 1,IP.Follow := false
        IPM.Source := 2,IPM.Shown["PvP"] := true,p := IPM.Panels["PvP"],IPMEnsureGui("PvP",0,p)
        IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(p.VisibleRows=10 && p.Rows[1].Value.Text="Lost" && p.Rows[3].Value.Text="1W / 2L (33.3%)","combined saved overlay retains match and whole-log summary")
        V48Assert(p.Rows[4].Name.Text="Log streak" && p.Rows[4].Value.Text="2 losses","saved loss streak appears before player records")
        V48Assert(p.Rows[5].Name.Text="With" && p.Rows[6].Value.Text="1 W / 1 L (50.0%)" && p.Rows[8].Name.Text="Against","real participant records follow summary and exclude selected match")
        IPM.PvPStatsScope := "current",IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(p.Rows[6].Value.Text="1 W / 0 L (100.0%)","character scope changes player records inside the merged panel")
        IPM.PvPRecordsExpanded := false,IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(p.VisibleRows=4 && !V58ChildVisible(p.Rows[6].Value),"collapsing a real saved match removes old player rows")
        IPM.PvPRecordsExpanded := true,seg.AreaId := "137438989517",IPMRender("PvP",IPMOverlaySnapshot(IP,IPM),p)
        V48Assert(p.VisibleRows=0 && !V58ChildVisible(p.Empty) && InStr(p.Meta.Text,"does not currently support warzones"),"switching to a warzone clears both sections and shows one message")
    }
    finally IPMDestroyPanels(),IP := old
}

V7873SessionData(outcomes)
{
    data := IPNewData("isolated session streak"),data.Arena := IPVNewSession()
    for i,outcome in outcomes {
        sample := V7838ArenaFixture(outcome="unknown" ? ["win"] : [outcome,outcome])
        IPVBoundary(sample,"EOF"),m := sample.Arena.Matches[1]
        m.Start += i*60000,m.End += i*60000
        data.Arena.Matches.Push(m)
    }
    return data
}

V7873SessionStreak()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"streak diagnostics are isolated")
    for fixture in [
        {Results:[],Wins:0,Losses:0,Unknown:0,Streak:0},
        {Results:["win"],Wins:1,Losses:0,Unknown:0,Streak:1},
        {Results:["win","win","win"],Wins:3,Losses:0,Unknown:0,Streak:3},
        {Results:["win","win","loss"],Wins:2,Losses:1,Unknown:0,Streak:-1},
        {Results:["win","loss","loss"],Wins:1,Losses:2,Unknown:0,Streak:-2},
        {Results:["loss","loss","loss"],Wins:0,Losses:3,Unknown:0,Streak:-3},
        {Results:["loss","loss","win"],Wins:1,Losses:2,Unknown:0,Streak:1},
        {Results:["loss","loss","unknown"],Wins:0,Losses:2,Unknown:1,Streak:0},
        {Results:["unknown","loss","loss"],Wins:0,Losses:2,Unknown:1,Streak:-2},
        {Results:["win","unknown","win"],Wins:2,Losses:0,Unknown:1,Streak:1},
        {Results:["loss","unknown","win","win"],Wins:2,Losses:1,Unknown:1,Streak:2}] {
        data := V7873SessionData(fixture.Results),snap := IPVSnapshot(data.Arena)
        V48Assert(snap.Streak=fixture.Streak,"consecutive completed outcomes determine the current streak")
        V48Assert(snap.Wins=fixture.Wins && snap.Losses=fixture.Losses && snap.Unknown=fixture.Unknown,"streak calculation preserves session totals")
        expected := fixture.Wins+fixture.Losses ? 100*fixture.Wins/(fixture.Wins+fixture.Losses) : -1
        V48Assert(snap.WinRate=expected,"session win rate uses only resolved matches from this dataset")
    }
    data := V7873SessionData(["win","win"]),open := V7838ArenaFixture(["win","win"])
    data.Arena.Current := open.Arena.Current,snap := IPVSnapshot(data.Arena)
    V48Assert(snap.Current.Outcome="win" && snap.Streak=2 && snap.Wins=2,"an open provisional win cannot increment the completed streak")
    IPVBoundary(data,"EOF"),snap := IPVSnapshot(data.Arena)
    V48Assert(snap.Streak=3 && snap.Wins=3,"closing the visit adds exactly one win")
    IPVBoundary(data,"EOF")
    V48Assert(IPVSnapshot(data.Arena).Streak=3,"repeated finalization cannot duplicate a win")
    open := V7838ArenaFixture(["loss","loss"]),data.Arena.Current := open.Arena.Current
    V48Assert(IPVSnapshot(data.Arena).Streak=3,"an open provisional loss cannot break the completed streak early")
    IPVBoundary(data,"EOF"),snap := IPVSnapshot(data.Arena)
    V48Assert(snap.Streak=-1 && snap.Losses=1,"a completed loss starts the opposite streak")
    V48Assert(IPVSnapshot(IPVNewSession()).Streak=0,"new parser session starts a fresh streak")
}

V7873SessionSummary()
{
    global IUB
    old := IUB.NumberFormat
    try {
        app := IPNewApp(),state := IPMNewState(),app.Live := V7873SessionData(["loss","win","win"])
        app.View := "Live",app.Active := true,state.Source := 1,p := state.Panels["PvP"]
        saved := app.Live,saved.Finished := true
        segment := {AreaId:"137438993370",Start:saved.Arena.Matches[1].Start+5000}
        for locale in ["us","eu"] {
            IUB.NumberFormat := locale,expected := locale="eu" ? "66,7%" : "66.7%"
            for scope in ["all","current"] {
                state.PvPStatsScope := scope,out := IPVUView(app,state,p,0)
                V48Assert(out.Rows.Length=3 && out.Rows[2].Label="Session" && out.Rows[2].Value="2W / 1L (" expected ")","character-history scope cannot alter the session summary")
                V48Assert(out.Rows[3].Label="Current streak" && out.Rows[3].Value="2 wins" && out.Rows[3].Color="85DF9A","two completed wins show a green streak")
            }
            out := IPVSSaved(saved,segment,app)
            V48Assert(out.Rows[3].Label="Loaded log" && out.Rows[3].Value="2W / 1L (" expected ")","saved summary explicitly covers the loaded log")
            V48Assert(out.Rows[4].Label="Log streak" && out.Rows[4].Value="2 wins","saved streak is distinguished from the active session")
            preview := IPVUPreview()
            V48Assert(preview.Rows.Length=4 && InStr(preview.Rows[3].Value,locale="eu" ? "71,4%" : "71.4%") && preview.Rows[4].Value="3 wins","explicit preview uses the compact localized session summary")
        }
        rows := IPVUSessionRows(IPVSnapshot(V7873SessionData([]).Arena))
        V48Assert(rows.Length=1 && rows[1].Value="0W / 0L","empty session has no invented percentage or streak")
        rows := IPVUSessionRows(IPVSnapshot(V7873SessionData(["win"]).Arena))
        V48Assert(rows.Length=1,"one win does not add a streak row")
        rows := IPVUSessionRows(IPVSnapshot(V7873SessionData(["loss"]).Arena))
        V48Assert(rows.Length=1,"one loss does not add a streak row")
        rows := IPVUSessionRows(IPVSnapshot(V7873SessionData(["win","loss","loss"]).Arena))
        V48Assert(rows.Length=2 && rows[2].Label="Current streak" && rows[2].Value="2 losses" && rows[2].Color="FF9CA8","two completed losses show a red streak")
        rows := IPVUSessionRows(IPVSnapshot(V7873SessionData(["loss","loss"]).Arena),"Loaded log")
        V48Assert(rows[2].Label="Log streak" && rows[2].Value="2 losses","saved log also shows loss streaks")
        rows := IPVUSessionRows(IPVSnapshot(V7873SessionData(["win","win","unknown"]).Arena))
        V48Assert(rows.Length=2 && rows[2].Label="Unresolved","an unknown result removes the streak and retains the unknown count")
    }
    finally IUB.NumberFormat := old
}

V7873SessionLayout() => V65UITimerIsolated(V7873SessionLayoutCase)
V7873SessionLayoutCase(*)
{
    global IPM,SELF_TEST,SETTINGS_FILE
    V48Assert(SELF_TEST && A_IsSuspended,"layout checks run on an isolated desktop")
    IPM.PvPRecordsExpanded := false,IPM.Font := 10,p := IPM.Panels["PvP"],p.AutoHeight := true
    IPMEnsureGui("PvP",0,p)
    try {
        for width in [246,340] {
            p.Width := width,IPVURenderData(IPVUPreview(),"",p,true)
            V48Assert(p.VisibleRows=4 && p.Rows[4].Value.Text="3 wins","streak replaces the separate percentage row")
            for index in [3,4] {
                c := p.Rows[index].Value,c.GetPos(&x,&y,&w,&h)
                V48Assert(x>=0 && x+w<=p.Layout.W && y+h<=p.Layout.H,"session and streak stay inside the panel")
                V48Assert(IXFTextHeight(c,c.Text,w)<=h,"session and streak text fit their allocated heights")
            }
            V7842PvPCapture("pvp-session-streak-" width ".png",p)
            view := IPVUPreview(),rows := IPVUSessionRows(IPVSnapshot(V7873SessionData(["win","loss","loss"]).Arena))
            view.Rows[3] := rows[1],view.Rows[4] := rows[2],IPVURenderData(view,"",p,true)
            V48Assert(p.VisibleRows=4 && p.Rows[4].Name.Text="Current streak" && p.Rows[4].Value.Text="2 losses","loss streak uses the same row")
            for c in [p.Rows[4].Name,p.Rows[4].Value] {
                c.GetPos(&x,&y,&w,&h)
                V48Assert(IXFTextHeight(c,c.Text,w)<=h,"current streak label and loss text fit")
            }
            V7842PvPCapture("pvp-session-loss-streak-" width ".png",p)
        }
        V48Assert(!FileExist(SETTINGS_FILE),"rendering does not save settings")
    }
    finally IPMDestroyPanels()
}

; Server metadata is attached to the pull in which it was recorded. These
; fixtures never open a window, write settings, or invoke live parsing/audio.
V7875ServerLine(server := "he3000",at := 100,player := 1)
{
    return V615AreaLine(player,at) (server="" ? "" : " (" server ") <v7.7>")
}

V7875ServerCapture()
{
    s := IPNewData(),owner := V615Player(1),npc := V615NPC()
    IPFeedLine(s,V7875ServerLine("he3000"),"server-test|1")
    IPFeedLine(s,IPDemoLine(1000,owner,"=","Enter",0),"server-test|1")
    IPFeedLine(s,IPDemoLine(1500,owner,npc,"Damage",123),"server-test|1")
    first := s.Current
    V48Assert(s.Server="he3000" && first.Server="he3000","area server belongs to its current pull")
    IPFeedLine(s,V7875ServerLine("he4000",2000),"server-test|1")
    IPFeedLine(s,IPDemoLine(2500,owner,"=","Enter",0),"server-test|1")
    IPFeedLine(s,IPDemoLine(2700,owner,npc,"Damage",456),"server-test|1")
    V48Assert(s.Current!=first && s.Current.RecorderKey=first.RecorderKey,"same actor can have separate server-qualified pulls")
    V48Assert(first.Server="he3000" && s.Current.Server="he4000","later server cannot rewrite earlier pull")
    IPFeedLine(s,V7875ServerLine("",3000,2),"server-test|1")
    IPFeedLine(s,IPDemoLine(3500,V615Player(2),"=","Enter",0),"server-test|1")
    V48Assert(s.Server="" && s.Current.Server="","new character with no server record does not inherit earlier server")
    IPFeedLine(s,V7875ServerLine("HE600",4000),"server-test|1")
    IPFeedLine(s,IPDemoLine(4500,owner,"=","Enter",0),"server-test|1")
    V48Assert(s.Current.Server="HE600","raw server spelling is preserved without guessing display names")
    IPFeedLine(s,IPDemoLine(1000,owner,"=","Enter",0),"server-test|2")
    V48Assert(s.Server="" && s.Current.Server="","new log source clears server without area metadata")
    V48Assert(IPParseLine(V7875ServerLine("new-server-code")).Server="new-server-code","unknown server code remains distinguishable")
    V48Assert(IPParseLine(V615AreaLine() " (100 damage)").Server="","nonserver parenthesis is not accepted without version suffix")
}

V7875ServerReader()
{
    old := IPReaderNext(IPReaderNew(),V7875ServerLine("he3000"),"server-test|1")
    next := IPReaderNext(old,V7875ServerLine("he4000",200,2),"server-test|1")
    V48Assert(old.Server="he3000" && next.Server="he4000" && old!=next,"reader snapshots retain their original server")
    s := IPNewData(),s.SourceKey := old.Key
    V48Assert(IPSeedReaderContext(s,old,old.Key) && s.Server="he3000","midstream attachment uses matching reader server")
    V48Assert(!IPSeedReaderContext(s,next,next.Key) && s.Server="he3000","later reader snapshot does not overwrite active identity")
    IPNewSegment(s,1000,"observed combat entry")
    V48Assert(s.Current.Server="he3000","seeded server reaches the next segment")
    changed := IPReaderNext(old,IPDemoLine(1000,V615Player(2),"=","Enter",0),"server-test|2")
    V48Assert(changed.Server="" && old.Server="he3000","reader source replacement cannot carry old server")
    missing := IPReaderNext(old,V7875ServerLine("",2000),"server-test|1")
    V48Assert(missing.Server="","area without server explicitly clears reader metadata")
}

V7875ServerCache()
{
    s := IPNewData(),s.Server := "he3000",s.Owner := V615Player(1)
    first := IPNewSegment(s,1000,"observed combat entry")
    IPCloseSegment(s,"fixture"),s.Server := "he4000"
    second := IPNewSegment(s,2000,"observed combat entry")
    restored := IPCDecode(IPCEncode(s))
    V48Assert(restored.Server="he4000","generic saved-cache graph retains dataset server")
    V48Assert(restored.Segments[1].Server="he3000" && restored.Segments[2].Server="he4000","saved-cache graph preserves per-pull servers independently")
    V48Assert(restored.Current=restored.Segments[2],"server fields preserve shared current-segment identity")
}

V7875LibraryFields() => V75LibraryRun(V7875LibraryFieldsCase)
V7875LibraryFieldsCase()
{
    files := V75LibraryFiles()
    f := files[StrLower(A_Temp "\combat_2026-10-03_00_00_00_001.txt")]
    roles := [1,2,4,8,2],servers := ["he3000","he4000","he3000","","he4000"]
    for i,p in f.Pulls
        p.Role := roles[i],p.Server := servers[i]
    text := IGVJson(ILBPack(files)),parsed := ILBParse(text)
    V48Assert(IGVJson(ILBPack(parsed))=text,"new recorder metadata roundtrips with all fight totals")
    V48Assert(IGVJson(ILBPack(INLibraryMaterialize(ILBPack(parsed))))=text,"validated legacy transport retains extended fields too")
    rows := ILBRows(parsed)
    V48Assert(ILBFilter(rows,"","","","",0,"","",2).Length=2,"role filter follows recorder per pull")
    V48Assert(ILBFilter(rows,"","","","",0,"","",2,"he4000").Length=2,"role and server combine")
    V48Assert(ILBFilter(rows,"","","","Kill",0,"","",2,"he4000").Length=1,"new filters retain existing result restriction")
    V48Assert(ILBFilter(rows,"","","","",0,"","",8,"@unknown").Length=1,"unknown metadata has explicit filter without matching all")
    V48Assert(ILBFilter(rows,"","","","",0,"","Star Forge").Length=2,"friendly server name is searchable")
    V48Assert(ILBServerLabel(" HE3000 ")="Star Forge" && ILBServerLabel("he600")="PTS","known server codes are case insensitive")
    V48Assert(ILBServerLabel("he-unmapped")="he-unmapped","unknown server codes remain distinguishable")
    old := ILBPack(V75LibraryFiles())
    V48Assert(old[3][1][7][1].Length=12 && ILBPack(ILBParse(IGVJson(old)))[3][1][7][1].Length=12,"legacy metadata stays missing until refreshed")
    bad := ILBPack(files),bad[3][1][7][1][14] := 3
    V59ExpectError((*)=>ILBParse(IGVJson(bad)))
    one := rows[1],other := IPRCloneSnapshot(one),other.Pull.Server := "he4000"
    V48Assert(!ILBSameFight(one,other),"same actor and timestamp from different servers cannot fold together")
    legacy := V75LibraryPull(),legacy.Players[legacy.Recorder].Spec := "2031339142381576"
    expected := IURDiscipline(legacy.Players[legacy.Recorder].Spec,"")
    V48Assert(expected!=8 && ILBOwnerRole(legacy)=expected,"old stored specialization supplies recorder role without rescanning")
    for spec,role in Map("2031339142381586",2,"2031339142381587",4,"2031339142381619",4,"2031339142381609",1) {
        legacy.Players[legacy.Recorder].Spec := spec
        V48Assert(ILBOwnerRole(legacy)=role,"legacy role resolves complete Republic and Imperial discipline catalogue")
    }
    legacy.Role := 8
    V48Assert(ILBOwnerRole(legacy)=8,"current explicit unknown role does not borrow a conflicting specialization")
    legacyFiles := V75LibraryFiles(),copy := IPRCloneSnapshot(f),copy.Path .= ".metadata-copy"
    legacyFiles[StrLower(copy.Path)] := copy,merged := ILBRows(legacyFiles)
    V48Assert(merged.Length=5 && ILBPullServer(merged[1].Pull)="he3000" && ILBOwnerRole(merged[1].Pull)=1,"refreshed duplicate metadata wins an otherwise equal old copy")
    if INAvailable() {
        s := ILBState(),ILBLoad(),ILBCommit(files)
        loaded := INLibraryRead(ILBReadText(s.TestPath),s.TestPath)
        V48Assert(IGVJson(ILBPack(loaded))=text,"native catalogue commit and compact browse preserve new fields")
    }
}

V7875LibrarySorting() => V75LibraryRun(V7875LibrarySortingCase)
V7875LibrarySortingCase()
{
    s := ILBState(),files := V75LibraryFiles()
    f := files[StrLower(A_Temp "\combat_2026-10-03_00_00_00_001.txt")]
    f.Pulls := []
    Loop 503 {
        p := V75LibraryPull(A_Index,A_Index*120000)
        p.Role := Mod(A_Index,3)=0 ? 1 : Mod(A_Index,3)=1 ? 2 : 4
        p.Server := Mod(A_Index,2) ? "he3000" : "he4000",f.Pulls.Push(p)
    }
    s.Files := files,s.Loaded := true
    ILBBuildWindow(),ILBRefresh(),c := s.Controls
    V48Assert(s.Shown.Length=503 && c["List"].GetCount()=3,"all matches retained while only latest page renders")
    selected := s.Shown[ILBSelected()].Key
    ILBResultColumnClick(c["List"],8)
    V48Assert(s.SortColumn=8 && s.Shown[ILBSelected()].Key=selected,"role sort preserves selected pull across paging")
    prior := ""
    for e in s.Shown {
        now := ILBRoleLabel(ILBOwnerRole(e.Pull))
        V48Assert(StrCompare(prior,now,false)<=0,"role sorting covers every result before paging"),prior := now
    }
    ILBResultColumnClick(c["List"],9),ILBResultColumnClick(c["List"],9)
    V48Assert(s.SortDescending && s.Shown[ILBSelected()].Key=selected,"reverse server sort keeps correct backing row")
    c["Role"].Choose(2),ILBFilterChanged()
    V48Assert(s.Shown.Length=167 && ILBOwnerRole(s.Shown[1].Pull)=1,"recorder tank filter applies to current table")
    ILBResetFilters()
    V48Assert(s.Shown.Length=503 && c["Role"].Value=1 && c["Server"].Value=1,"reset clears both new filters")
    for size in [[664,428],[904,558],[1120,760]] {
        ILBResize(s.Gui,0,size[1],size[2])
        c["Server"].GetPos(&x,&y,&w,&h),c["List"].GetPos(&lx,&ly,&lw,&lh),c["Portrait"].GetPos(,&py)
        V48Assert(x>=0 && x+w<=size[1] && y+h<ly && ly+lh<py,"filter row and result table fit supported size")
    }
    c["Tabs"].Choose(3),ILBBrowseSync(true)
    V48Assert(!V7828OwnVisible(c["Server"]) && !V7828OwnVisible(c["Role"]),"refresh cannot leak new controls onto another tab")
}

; Owner metadata only: no live UI, audio, preferences, or archive-wide work.
V7875PvPRoleLine(at,kind:="DPS",player:=1)
{
    stamp := Format("{:02}:{:02}:{:02}.{:03}",Mod(at//3600000,24),Mod(at//60000,60),Mod(at//1000,60),Mod(at,1000))
    prefix := "[" stamp "] [" V7838ArenaActor(player) "] [=] "
    if kind="DPS"
        return prefix "[Furious Strike {3434638101970944}] [Event {836045448945472}: AbilityActivate {836045448945479}] ()"
    return prefix "[] [DisciplineChanged {836045448953665}: Mercenary {99} / "
        . (kind="Healer" ? "Bodyguard {2031339142381600}" : "Arsenal {2031339142381601}") "] ()"
}
V7875PvPRoleFeed(s,at,kind:="DPS",player:=1)
{
    line := V7875PvPRoleLine(at,kind,player),ev := IPParseLine(line)
    V48Assert(IsObject(ev),"owner-role fixture parses")
    IPVConsume(s,ev,at,line)
}
V7875PvPRoleCapture()
{
    s := V7838ArenaFixture(["win","win"])
    V7875PvPRoleFeed(s,11000,"DPS",3)
    V48Assert(s.Arena.Current.Role=8,"opponent evidence cannot determine owner role")
    V7875PvPRoleFeed(s,11010)
    V48Assert(s.Arena.Current.Role=2,"shared DPS signatures determine role without guessing class")
    V7875PvPRoleFeed(s,11020,"Healer")
    V48Assert(s.Arena.Current.Role=4,"explicit role overrides inference")
    V7875PvPRoleFeed(s,11030,"Explicit DPS")
    V48Assert(s.Arena.Current.Role=8,"contradictory explicit role remains unknown")
    IPVBoundary(s,"EOF")
    V48Assert(s.Arena.Matches[1].Role=8,"completed summaries retain unknown metadata")
    V7838ArenaFeed(s,20000,V7838ArenaActor(1),"","Area","",,"137438993370")
    V48Assert(s.Arena.Current.Role=8 && !s.Arena.Current.HasOwnProp("DisplayRoles"),"new visit does not inherit an earlier discipline")
    V7875PvPRoleFeed(s,21000)
    V48Assert(s.Arena.Current.Role=2,"next visit can independently identify a role")
    s := IPNewData("partial arena metadata"),s.AreaId := "137438993370",s.Owner := "@Player1#1",s.Server := "he4000"
    V7875PvPRoleFeed(s,1000)
    V48Assert(s.Arena.Current.Server="he4000" && s.Arena.Current.Role=2,"partial visit retains reader server and current evidence")
}
V7875PvPRoleNative() => V7844Run(V7875PvPRoleNativeCase)
V7875PvPRoleNativeCase()
{
    previous := INState().TestHelper,INState().TestHelper := A_ScriptDir "\iris-native-engine.exe"
    try {
        f := V7844File(),text := ""
        for i,kind in ["DPS","Healer",""] {
            start := (i-1)*20000,part := V7843TextMatch(start,["win","win"])
            first := InStr(part,"`n")
            part := SubStr(part,1,first) (kind!="" ? V7875PvPRoleLine(start+1000,kind) "`n" : "") SubStr(part,first+1)
            text .= StrReplace(part,"test-server",i=2 ? "he4000" : "he3000")
        }
        FileDelete(f.Path),FileAppend(text,f.Path,"UTF-8")
        d := V7843WorkerData(f.Path),result := INLoad(INContext(d),,,"pvp-scan")
        native := IPVLNativeSession(result.Data,f.Path),reference := IPVSScan(f.Path,"UTF-8")
        V48Assert(V7846Matches(native.Matches)=V7846Matches(reference.Matches),"native/reference metadata and complete results match")
        V48Assert(native.Matches.Length=3,"three arena visits retained")
        for i,role in [2,4,8]
            V48Assert(native.Matches[i].Role=role,"owner role is isolated to visit " i)
        V48Assert(native.Matches[1].Server="he3000" && native.Matches[2].Server="he4000","match server survives native bridge")
    }
    finally INState().TestHelper := previous
}

; Isolated evidence fixtures for a beam turning away from its living cast target.
; No live parser, saved settings, audio or gameplay hotkeys are used.
V7876XRConflictFixture(targetY := 20,targetAge := 100,targetHP := 1000,targetZ := 0)
{
    f := V7875XRFixture(false)
    f.Baseline := V7875XRFeed(f,100,V7875XRActor("XR",0,0,0,180),V7875XRActor("Tank",0,20),"Target")
    f.Cast := V7875XRFeed(f,1000,V7875XRActor("XR",0,0,0,180),"=","Activate")
    f.Switch := V7875XRFeed(f,3500,V7875XRActor("XR",0,0,0,180),V7875XRActor("Inside",-3,-20),"Target")
    f.TargetSample := V7875XRFeed(f,4000-targetAge,V7875XRActor("Tank",0,targetY,targetZ,0,targetHP),"=")
    V7875XRFeed(f,3901,V7875XRActor("Inside",-3,-20),"=")
    V7875XRFeed(f,3902,V7875XRActor("Other tank",2,-10),"=")
    ; Keep the target notification separate from its latest positional evidence.
    f.Return := V7875XRFeed(f,3998,V7875XRActor("XR"),"@Tank#1","Target")
    f.InsideHit := V7875XRFeed(f,4000,V7875XRActor("XR"),V7875XRActor("Inside",-3,-20),"Damage")
    f.OtherHit := V7875XRFeed(f,4001,V7875XRActor("XR"),V7875XRActor("Other tank",2,-10),"Damage")
    f.OutsideHit := V7875XRFeed(f,4001,V7875XRActor("XR"),V7875XRActor("Outside",8,-20),"Damage")
    return f
}
V7876XRConflictSuppression()
{
    for variant in ["normal","no-return","one-candidate"] {
        f := V7876XRConflictFixture()
        if variant="no-return"
            f.Return.Analysis.Accepted := false
        if variant="one-candidate"
            f.OtherHit.Analysis.Accepted := false
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        V48Assert(b.AttributionConflict && b.Uncertain,"conflicting aim is explicitly uncertain: " variant)
        V48Assert(b.TargetKnown && b.Target="@Tank#1" && b.TargetBasis="cast-start","uncertainty does not invent a new intended target: " variant)
        V48Assert(!b.Interceptors.Length && !b.OlderMarks.Length && !b.FacingMarks.Length && !b.PossibleMarks.Count,"no offender or individual qualifier remains on conflicted beam: " variant)
        V48Assert(b.Recipients.Length=(variant="one-candidate" ? 2 : 3) && ArrayContainsText(b.Recipients,"@Inside#1"),"accepted hit recipients remain raw evidence: " variant)
        V48Assert(m.Marked=0 && m.PossibleDesync=1 && m.OffTarget=1 && m.UnknownTarget=0,"conflicted beam is counted once as possible desync, never as marked: " variant)
        V48Assert(InStr(m.Text,"Possible desync") && !InStr(m.Text,"Interceptors:"),"normal report shows neutral finding: " variant)
        for name in ["Inside","Other tank","Outside"] {
            V48Assert(!InStr(m.Text,name) && !InStr(m.Advanced,name),"suppressed offender is absent from normal and additional details: " variant " / " name)
        }
        V48Assert(InStr(m.Debug,"Inside") && InStr(m.Debug,"Recorded hits:"),"raw hit evidence stays available in Debug: " variant)
        rows := IXFBeamRows(b,f.Pull)
        V48Assert(rows.Length=1 && rows[1].Text="Extraneous Expulsion (possible desync)" && rows[1].Color="AEB4BE","overlay has one anonymous gray row: " variant)
    }
}
V7876XRConflictPositionGuards()
{
    for spec in [["ordinary interception",-30,100,1000,0,false],
        ["behind threshold",1,100,1000,0,false],["just behind",1.01,100,1000,0,true],
        ["one-second boundary",20,1000,1000,0,true],["stale",20,1001,1000,0,false],
        ["zero HP",20,100,0,0,false],["same-floor boundary",20,100,1000,5,true],
        ["different height",20,100,1000,5.01,false]] {
        f := V7876XRConflictFixture(spec[2],spec[3],spec[4],spec[5]),m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        V48Assert(b.AttributionConflict=spec[6],"intended-position evidence guard: " spec[1])
        if !spec[6]
            V48Assert(b.Interceptors.Length=2 && InStr(m.Text,"Interceptors:"),"new guard preserves existing marks without qualifying contradiction: " spec[1])
    }
    f := V7876XRConflictFixture(),f.TargetSample.Analysis.Accepted := false
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(!b.AttributionConflict && b.Interceptors.Length=2,"missing recent intended-target pose cannot create a conflict")
    f := V7876XRConflictFixture()
    f.OtherHit.Analysis.Raw := StrReplace(f.OtherHit.Analysis.Raw,"(0,0,0,0)","(0,0,0,180)")
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(!b.AttributionConflict && b.Interceptors.Length=2 && b.PossibleMarks.Count,"behind evidence must agree across every actual impact pose")
    f := V7876XRConflictFixture()
    V7875XRFeed(f,4001,V7875XRActor("XR"),V7875XRActor("Tank",0,20),"Damage")
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(!b.AttributionConflict && b.Interceptors.Length=2,"a hit intended recipient does not match the unhit-target conflict")
}
V7876XRConflictTargetGuards()
{
    for variant in ["missing","rejected","invalid","different-instance","unhit-target","outside-target","not-late","window-boundary"] {
        f := V7876XRConflictFixture()
        if variant="missing" || variant="rejected"
            f.Switch.Analysis.Accepted := false
        else if variant="invalid"
            f.Switch.ValueOK := false
        else if variant="different-instance"
            f.Switch.Source.Key .= "different-instance"
        else if variant="unhit-target"
            f.InsideHit.Analysis.Accepted := false
        else if variant="outside-target"
            f.Switch.Target := IPActor("@Outside#1")
        else
            f.Switch.Analysis.At := variant="window-boundary" ? 3000 : 2999
        b := IXCBuild(f.Data,f.Pull).Beams[1]
        V48Assert(b.AttributionConflict=(variant="window-boundary"),"late switch must be accepted, same boss, and select an actual in-box hit: " variant)
        if variant!="window-boundary"
            V48Assert(b.Interceptors.Length>0,"ineligible switch does not erase legitimate candidates: " variant)
    }
    f := V7876XRConflictFixture(),f.Baseline.Analysis.Accepted := false
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(!b.TargetKnown && !b.AttributionConflict,"unknown baseline keeps its existing uncertainty instead of claiming directional conflict")
    f := V7876XRConflictFixture(),f.InsideHit.Analysis.Accepted := false,f.OtherHit.Analysis.Accepted := false
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(!b.Interceptors.Length && !b.AttributionConflict,"an outside-only hit is not relabeled as suppressed in-box attribution")
}
V7876XRConflictLifeGuards()
{
    for who in ["Tank","Inside"] {
        f := V7876XRConflictFixture(),V7875XRTauntFeed(f,3700,who)
        b := IXCBuild(f.Data,f.Pull).Beams[1]
        V48Assert(b.TargetKnown && b.TargetBasis="taunt" && !b.AttributionConflict,"successful taunt remains authoritative: " who)
        V48Assert(b.Interceptors.Length=(who="Tank" ? 2 : 1),"resolved taunt preserves other actual interceptors: " who)
    }
    for revived in [false,true] {
        f := V7876XRConflictFixture()
        V7875XRFeed(f,3600,V7875XRActor("Tank",0,20),"=","Death")
        if revived
            V7875XRFeed(f,3700,V7875XRActor("Tank",0,20),"=","Revive")
        b := IXCBuild(f.Data,f.Pull).Beams[1]
        V48Assert(!b.TargetKnown && !b.AttributionConflict,"target death cannot become a living-baseline conflict, including later revival")
    }
    f := V7875XRHandoffFixture(),f.Hit.Analysis.Accepted := false
    V7875XRFeed(f,3500,V7875XRActor("XR"),V7875XRActor("Inside",2,-20),"Target")
    V7875XRFeed(f,3900,V7875XRActor("Other tank",0,20),"=")
    V7875XRFeed(f,3998,V7875XRActor("XR"),"@Other tank#1","Target")
    V7875XRFeed(f,4000,V7875XRActor("XR"),V7875XRActor("Inside",2,-20),"Damage")
    b := IXCBuild(f.Data,f.Pull).Beams[1]
    V48Assert(b.TargetKnown && b.TargetBasis="death-threat" && !b.AttributionConflict,"guard does not override a validated target-death handoff")
    V48Assert(b.Interceptors.Length=1 && b.Interceptors[1]="@Inside#1","other interceptor survives even when replacement target is unhit and behind")
}
V7876XRConflictSourceOrder()
{
    for after in [false,true] {
        f := V7876XRConflictFixture(),f.Switch.Analysis.At := 4000
        if after
            f.Switch.Analysis.Seq := f.Next+10
        m := IXCBuild(f.Data,f.Pull),b := m.Beams[1]
        V48Assert(b.AttributionConflict=!after,"same-clock switch is eligible only before first impact in source order")
        ordered := f.Data.Rows.Clone(),f.Data.Rows := []
        Loop ordered.Length
            f.Data.Rows.Push(ordered[ordered.Length+1-A_Index])
        reversed := IXCBuild(f.Data,f.Pull)
        V48Assert(reversed.Text=m.Text && reversed.Summary=m.Summary && reversed.Advanced=m.Advanced,"display iteration order cannot change attribution or counts")
        V48Assert(reversed.Beams[1].AttributionConflict=b.AttributionConflict,"source ordering controls the dedicated conflict flag")
    }
}
V7876XRConflictParity()
{
    for offset in [0,1000] {
        f := V7876XRConflictFixture(),review := IXCBuild(f.Data,f.Pull)
        live := V7878XFFixture(f,offset),seg := live.Segment,m := IXFBuild(seg,true)
        V48Assert(!seg.XRFeedback.Meta["Error"] && m.Beams.Length=1,"live fixture builds one complete batch")
        b := m.Beams[1],reference := review.Beams[1]
        for field in ["AttributionConflict","TargetKnown","Target","TargetBasis","Uncertain"]
            V48Assert(b.%field%=reference.%field%,"live/review conflict evidence parity: " field)
        for field in ["Interceptors","Recipients","OlderMarks","FacingMarks","PossibleMarks"]
            V48Assert(XRDiagnosticJSON(b.%field%)=XRDiagnosticJSON(reference.%field%),"live/review retained and suppressed lists agree: " field)
        V48Assert(m.Rows.Length=1 && m.Rows[1].Text="Extraneous Expulsion (possible desync)" && m.Rows[1].Color="AEB4BE","live feedback is anonymous and gray")
        IXOStore(seg,review,f.Pull)
        V48Assert(XRDiagnosticJSON(seg.XRFeedbackResult.Rows)=XRDiagnosticJSON(m.Rows),"saved review conversion preserves anonymous gray feedback")
        for name in ["Inside","Other tank","Outside"]
            V48Assert(!InStr(XRDiagnosticJSON(seg.XRFeedbackResult.Rows),name),"saved compact rows do not retain suppressed offender names")
    }
}

; Private catalogue fixtures only; never change real indexes or start live parsing.
V7877RecoveryFiles()
{
    files := V75LibraryFiles()
    for key,f in files
        f.Digest := Format("{:064}",7)
    return files
}
V7877RecoveryResult(request)
{
    rows := []
    for f in request[3] {
        patches := []
        for p in f[5]
            patches.Push([p[1],p[2],p[3],p[4],"he4000"])
        rows.Push([f[1],f[2],f[3],"ok",patches])
    }
    return ["IrisLibraryServerRecovery",1,rows]
}
V7877RecoveryRequests()
{
    files := V7877RecoveryFiles(),request := ILSRRequest(files),f := files[StrLower(request[3][1][1])]
    V48Assert(request[3].Length=1 && request[3][1][5].Length=5,"one source request groups all missing pulls")
    f.Pulls[2].Server := "he3000"
    V48Assert(ILSRRequest(files)[3][1][5].Length=4,"existing servers are excluded from recovery")
    V48Assert(ILSRRequest(files,Map(ILSRKey(f),true))[3].Length=0,"unresolved source is not repeatedly scanned in the same session")
    f.Modified := "20261004120000"
    V48Assert(ILSRRequest(files,Map(ILSRKey(f) "old",true))[3].Length=1,"changed source can be retried")
    f.Digest := Format("{:064}",0)
    V48Assert(ILSRRequest(files)[3].Length=0,"unverified live snapshot is not treated as a stable log")
    before := ILSRState().Running,ILSRAuto(),ILSRSchedule()
    V48Assert(ILSRState().Running=before,"self tests never schedule automatic recovery")
}
V7877RecoveryPatches()
{
    files := V7877RecoveryFiles(),request := ILSRRequest(files),before := IGVJson(ILBPack(files))
    result := V7877RecoveryResult(request),patch := ILSRUpdates(files,request,result)
    V48Assert(patch.Count=5 && patch.Files.Count=1,"all five validated metadata patches accepted")
    V48Assert(IGVJson(ILBPack(files))==before,"patch construction leaves its original snapshot unchanged")
    for key,f in patch.Files {
        old := files[key]
        for i,p in f.Pulls {
            V48Assert(p.Server="he4000","server is set on copied pull")
            p.DeleteProp("Server")
        }
        V48Assert(IGVJson(ILBPack(Map(key,f)))==IGVJson(ILBPack(Map(key,old))),"all source data, results, totals, challenge values and order stay exact")
    }
    key := StrLower(request[3][1][1]),files[key].Pulls[1].Server := "he3001"
    V48Assert(ILSRUpdates(files,request,result).Count=4,"newly known metadata wins over the in-flight worker")
    files[key].Digest := Format("{:064}",8)
    V48Assert(ILSRUpdates(files,request,result).Count=0,"a newer source snapshot rejects old patches")
    files := V7877RecoveryFiles(),request := ILSRRequest(files)
    for field,value in Map(1,999,2,123,3,124,4,"@SOPHIE#1",5,"") {
        bad := V7877RecoveryResult(request),bad[3][1][5][1][field] := value
        V59ExpectError((*)=>ILSRUpdates(files,request,bad))
    }
    bad := V7877RecoveryResult(request),bad[3][1][5].Push(bad[3][1][5][1])
    V59ExpectError((*)=>ILSRUpdates(files,request,bad))
    bad := V7877RecoveryResult(request),bad[3][1][4] := "changed"
    V59ExpectError((*)=>ILSRUpdates(files,request,bad))
    bad := V7877RecoveryResult(request),bad[3][1][3] := Format("{:064}",9)
    V59ExpectError((*)=>ILSRUpdates(files,request,bad))
    bad := V7877RecoveryResult(request),bad[3][1][1] .= ".other"
    V59ExpectError((*)=>ILSRUpdates(files,request,bad))
}
V7877RecoveryCommit() => V75LibraryRun(V7877RecoveryCommitCase)
V7877RecoveryCommitCase()
{
    s := ILBState(),ILBLoad(),files := V7877RecoveryFiles(),f := files[StrLower(A_Temp "\combat_2026-10-03_00_00_00_001.txt")]
    SplitPath(s.TestPath,,&folder)
    f.Path := folder "\combat_2026-10-03_00_00_00_001.txt"
    archive := IPRCloneSnapshot(f),archive.Path := folder "\archive\Archive-combat_2026-10-03_00_00_00_001.txt"
    archive.Pulls[1].Players["@Sophie#1"].Damage := 765432
    for p in f.Pulls
        p.Server := "he3000"
    files := Map(StrLower(f.Path),f,StrLower(archive.Path),archive),ILBCommit(files)
    request := ILSRRequest(s.Files),patch := ILSRUpdates(s.Files,request,V7877RecoveryResult(request))
    V48Assert(ILBArchiveReplaced(s.Files,patch.Files).Length=1,"fixture exercises normal archive replacement path")
    original := IGVJson(ILBPack(Map(StrLower(f.Path),s.Files[StrLower(f.Path)])))
    ILBCommitFiles(patch.Files,,true),s.Loaded := false,ILBLoad()
    V48Assert(s.Files.Count=2,"metadata-only save retains original and archive summaries independently")
    V48Assert(IGVJson(ILBPack(Map(StrLower(f.Path),s.Files[StrLower(f.Path)])))==original,"already-known original summaries stay byte-equivalent")
    V48Assert(s.Files[StrLower(archive.Path)].Pulls[1].Players["@Sophie#1"].Damage=765432,"different archived totals are preserved")
    rows := ILBRows(s.Files)
    V48Assert(ILBFilter(rows,"","","","",0,"","","","he4000").Length=5,"recovered rows are immediately server-filterable")
    V48Assert(ILBFilter(rows,"","","","",0,"","","","he3000").Length=5,"existing server rows still filter independently")
    V48Assert(FileExist(s.TestPath ".bak"),"atomic metadata save keeps catalogue backup")
}
V7877RecoveryNative() => V75LibraryRun(V7877RecoveryNativeCase)
V7877RecoveryNativeCase()
{
    helper := INState().TestHelper,INState().TestHelper := A_ScriptDir "\iris-native-engine.exe"
    try {
        s := ILBState(),ILBLoad(),SplitPath(s.TestPath,,&folder)
        pulse := {Count:0},service := V7877RecoveryPulse.Bind(pulse)
        packed := ILBPack(V7877RecoveryFiles())
        Loop 33
            packed[3].Push(packed[3][1])
        payload := ["IrisStoreRequest",1,"library",s.TestPath,"","replace",[],packed]
        streamPath := folder "\stream.json",ICSWriteRequest(payload,streamPath,service)
        V48Assert(FileRead(streamPath,"UTF-8")==IGVJson(payload),"checkpointed Library request is byte-equivalent to original JSON")
        V48Assert(pulse.Count>=3,"large request serialization services input between sources")
        V59ExpectError((*)=>ICSWriteRequest(payload,folder "\cancelled.json",V7877RecoveryCancel))
        FileMove(folder "\cancelled.json",folder "\released.json")
        path := folder "\combat_2026-10-03_00_00_00_001.txt"
        p := V75LibraryPull(1,100000)
        line := "[00:00:01.000] [" p.Recorder "] [] [] [AreaEntered {836045448953664}: Tyth {" p.Area "} NiM {" p.Mode "}] (he4001) <v7.0>`n"
        FileAppend(line,path,"UTF-8-RAW")
        f := ILBFile(path,"20261003",FileGetSize(path),FileGetTime(path,"M"),IPCHashFile(path),[p])
        ILBCommit(Map(StrLower(path),f)),request := ILSRRequest(s.Files)
        requestPath := folder "\request.json",FileAppend(IGVJson(request),requestPath,"UTF-8-RAW")
        result := INLoad(INCContext(requestPath),,,"library-servers")
        patch := ILSRUpdates(s.Files,request,result.Data)
        V48Assert(patch.Count=1 && patch.Files[StrLower(path)].Pulls[1].Server="he4001","native framed job recovers verified server from source header")
        ILBCommitFiles(patch.Files,service,true),s.Loaded := false,ILBLoad()
        V48Assert(s.Files[StrLower(path)].Pulls[1].Server="he4001","metadata survives native catalogue save and reload")
        before := FileRead(s.TestPath,"UTF-8")
        V59ExpectError((*)=>INLoad(INCContext(requestPath),V7877RecoveryCancel,,"library-servers"))
        V48Assert(FileRead(s.TestPath,"UTF-8")==before,"cancelled native work cannot mutate saved catalogue")
        FileAppend("changed",path,"UTF-8-RAW")
        changed := INLoad(INCContext(requestPath),,,"library-servers")
        V48Assert(changed.Data[3][1][4]="changed" && changed.Data[3][1][5].Length=0,"changed original source returns no patches")
    }
    finally INState().TestHelper := helper
}
V7877RecoveryCancel(*)
{
    throw Error("cancel",,"IRIS_NATIVE_CANCEL")
}
V7877RecoveryPulse(control,*)
{
    control.Count += 1
    Sleep(-1)
}

V7879RecoveryLiveFiles()
{
    files := V75LibraryFiles()
    for key,f in files
        f.Live := 1,f.Identity := "123:0:456:134000000000000000"
    return files
}
V7879RecoveryLiveRequests()
{
    files := V7879RecoveryLiveFiles(),request := ILSRRequest(files),f := files[StrLower(request[3][1][1])]
    V48Assert(request[3].Length=1 && request[3][1].Length=7,"verified legacy live snapshots can request metadata recovery")
    V48Assert(request[3][1][7][1]=1 && request[3][1][7][2]==f.Identity,"request carries exact original Win32 identity")
    for id in ["","1:2:3","1:2:3:4:5","-1:2:3:4","1:4294967296:3:4","1:2:3:9999999999999999999"] {
        f.Identity := id
        V48Assert(ILSRRequest(files)[3].Length=0,"malformed or overflowing live identity is rejected: " id)
    }
    f.Identity := "123:0:456:134000000000000000",key := ILSRKey(f)
    for flag in [0,2,-1] {
        f.Live := flag
        V48Assert(ILSRRequest(files)[3].Length=0,"only exact live flag 1 authorizes zero-digest recovery")
    }
    f.Live := 1,f.Identity := "123:0:457:134000000000000000"
    V48Assert(ILSRRequest(files,Map(key,true))[3].Length=1,"changed identity is not hidden by prior attempted key")
    f.Digest := Format("{:064}",7)
    V48Assert(ILSRRequest(files)[3][1].Length=6,"hashed sources retain strict digest-based protocol")
}
V7879RecoveryLivePatches()
{
    files := V7879RecoveryLiveFiles(),request := ILSRRequest(files),result := V7877RecoveryResult(request)
    key := StrLower(request[3][1][1]),before := IGVJson(ILBPack(files)),patch := ILSRUpdates(files,request,result)
    V48Assert(patch.Count=5 && IGVJson(ILBPack(files))==before,"live server patches do not change original catalogue")
    updated := patch.Files[key]
    for p in updated.Pulls
        p.DeleteProp("Server")
    V48Assert(IGVJson(ILBPack(patch.Files))==before,"live identity, snapshot size, zero digest, results and all totals remain exact")
    files[key].Identity := "123:0:457:134000000000000000"
    V48Assert(ILSRUpdates(files,request,result).Count=0,"replacement catalogue identity rejects in-flight metadata")
    files[key].Identity := request[3][1][7][2],files[key].Live := 0
    V48Assert(ILSRUpdates(files,request,result).Count=0,"no-longer-live catalogue rejects zero-digest patches")
    files[key].Live := 1,files[key].Size += 1
    V48Assert(ILSRUpdates(files,request,result).Count=0,"new live snapshot wins over older recovery request")
}
V7879RecoveryLiveSnapshotRoundtrip() => V75LibraryRun(V7879RecoveryLiveSnapshotRoundtripCase)
V7879RecoveryLiveSnapshotRoundtripCase()
{
    s := ILBState(),s.LivePending := Map(),ILBLoad(),fixture := V68ReviewFile()
    SplitPath(s.TestPath,,&folder)
    path := folder "\combat_2026-10-03_01_00_00_001.txt"
    try {
        FileMove(fixture.Path,path),seg := fixture.State.Segments[fixture.State.Segments.Length]
        seg.LibrarySourceKey := path "|" ILBLiveIdentity(path),seg.Server := "he4001",seg.DisplayRoles := Map(seg.RecorderKey,4)
        expected := ILBFight(seg),key := StrLower(path)
        V48Assert(expected.Server="he4001" && expected.Role=4,"live fight captures known recorder server and healer role")
        V48Assert(ILBLiveQueue(seg),"completed current live pull enters pending queue")
        batch := s.LivePending[key],merged := ILBLiveMerge(s.Files,batch)
        V48Assert(merged[key].Pulls[1].Server="he4001" && merged[key].Pulls[1].Role=4,"queue and deep snapshot merge preserve scalar metadata")
        ILBCommit(merged),s.Loaded := false,ILBLoad(),actual := s.Files[key].Pulls[1]
        V48Assert(actual.Server="he4001" && actual.Role=4,"current live server and role survive catalogue save and reload")
        V48Assert(s.Files[key].Live=1 && s.Files[key].Identity==ILBLiveIdentity(path),"live snapshot identity survives save and reload")
        actual.Id := expected.Id
        V48Assert(IGVJson(ILBPack(Map(key,ILBFile(path,"20261003",1,"20261003120000",Format("{:064}",0),[actual]))))
            ==IGVJson(ILBPack(Map(key,ILBFile(path,"20261003",1,"20261003120000",Format("{:064}",0),[expected])))),"all accepted fight fields survive live roundtrip")
    }
    finally {
        if FileExist(fixture.Path)
            FileDelete(fixture.Path)
    }
}
V7879RecoveryLiveNative() => V75LibraryRun(V7879RecoveryLiveNativeCase)
V7879RecoveryLiveNativeCase()
{
    helper := INState().TestHelper,INState().TestHelper := A_ScriptDir "\iris-native-engine.exe"
    try {
        s := ILBState(),ILBLoad(),SplitPath(s.TestPath,,&folder)
        path := folder "\combat_2026-10-03_00_00_00_001.txt",p := V75LibraryPull()
        line := "[00:00:01.000] [" p.Recorder "] [] [] [AreaEntered {836045448953664}: Tyth {" p.Area "} NiM {" p.Mode "}] (he4001) <v7.0>`n"
        FileAppend(line,path,"UTF-8-RAW")
        f := ILBFile(path,"20261003",FileGetSize(path),FileGetTime(path,"M"),Format("{:064}",0),[p]),f.Live := 1
        files := Map(StrLower(path),f),request := ILSRRequest(files)
        FileAppend(line,path,"UTF-8-RAW"),requestPath := folder "\live-request.json"
        FileAppend(IGVJson(request),requestPath,"UTF-8-RAW")
        result := INLoad(INCContext(requestPath),,,"library-servers"),patch := ILSRUpdates(files,request,result.Data)
        V48Assert(patch.Count=1 && patch.Files[StrLower(path)].Pulls[1].Server="he4001","native validates AHK Win32 identity and recovers server after source growth")
        V48Assert(result.Data[3][1][2]=f.Size && result.Data[3][1][3]==f.Digest,"live response binds to stored snapshot size and zero digest")
    }
    finally INState().TestHelper := helper
}

; Pure decoded-record and analysis tally checks; no app or live settings.
V78AuditAnalysisMitigation()
{
    incoming := Map(),count := 0
    for row in [["836045448945503","Parry",true],["836045448945505","Dodge",true],
        ["836045448945508","Deflect",true],["836045448945507","Resist",true],
        ["836045448945504","",false],["836045448945509","Shield",false]] {
        line := "[00:00:01.000] [Boss {999}:9] [@Tank#1] [Hit {123}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (0 -localized {" row[1] "}) <1.0>"
        ev := V59Parsed(line)
        V48Assert(ev.Analysis.Mit=row[2] && IAIsAvoided(ev)=row[3],"Analysis classifies numeric mitigation " row[1])
        IATally(incoming,"123","Hit",0,ev,"Taken")
        count += row[3] ? 1 : 0
    }
    V48Assert(incoming["123"].N=6 && incoming["123"].Avoided=count && count=4,"zero damage Dodge contributes to avoided incoming attempts")
    V48Assert(incoming["123"].Shielded=1 && incoming["123"].Total=0,"shield outcome stays distinct and damage totals are unchanged")
    line := "[00:00:01.000] [Boss {999}:9] [@Tank#1] [Hit {123}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10 -localized {836045448945505}) <10.0>"
    V48Assert(!IAIsAvoided(V59Parsed(line)),"positive damage is not counted as avoided even with a mitigation tag")
}

V78AuditDeflectedCleave()
{
    ; A localized outcome has no English fallback. It must not become contact
    ; evidence merely because the add later reaches zero near a Rage increase.
    tail := "(0 -localized {836045448945508})"
    V48Assert(TythCleaveContactAvoided(tail),"live cleave numeric Deflect is independent of language")
    f := V647BossFixture(),V647BossRage(f,5000,6)
    ev := V6412BossMelee(f,11000,,,tail)
    V647BossRage(f,13090,9),V647BossZero(f,13100),V647BossEnd(f)
    check := IBCDebugCheck(f.Pull,f.Recap)
    V48Assert(ev.BossAvoided && V6412MeleeRows(f)[1].Avoided && check.History.Possible=0,"Deflected Melee does not falsely establish a Tyth add cleave")
    V48Assert(!TythCleaveContactAvoided("(0 -)"),"untagged zero damage keeps the existing contact semantics")
}

; Concurrent case-only edits must invalidate the exact saved-data snapshot.
; Fixtures are private V75/V769 temporary catalogues, with no raw logs or audio.
V78AuditCaseRewrite(path)
{
    before := FileRead(path,"UTF-8"),after := StrReplace(before,"Sophie","SOPHIE",true)
    V48Assert(!(before==after) && before=after,"fixture changes only letter case")
    f := FileOpen(path,"w","UTF-8-RAW")
    try f.Write(after)
    finally f.Close()
    return after
}
V78AuditLibraryCaseGuard() => V75LibraryRun(V78AuditLibraryCaseGuardBody)
V78AuditLibraryCaseGuardBody()
{
    s := ILBState(),ILBLoad(),ILBCommit(V75LibraryFiles())
    before := s.Original,revision := s.Revision,external := V78AuditCaseRewrite(s.TestPath)
    ; This is also the final fence after a native candidate has been prepared.
    V59ExpectError((*)=>ILBWriteValidated(s.Files,before))
    V48Assert(FileRead(s.TestPath,"UTF-8")==external && s.Original==before && s.Revision=revision,"late case-only edit cannot be overwritten by an already-prepared save")
    V48Assert(!FileExist(s.TestPath ".pending-" DllCall("GetCurrentProcessId")),"conflict creates no pending replacement")
}
V78AuditLibraryCaseFallback() => V75LibraryRun(V78AuditLibraryCaseFallbackBody)
V78AuditLibraryCaseFallbackBody()
{
    native := INState(),oldTest := native.TestHelper,oldWorker := native.WorkerHelper
    native.TestHelper := "",native.WorkerHelper := ""
    try {
        s := ILBState(),ILBLoad(),ILBCommit(V75LibraryFiles()),before := s.Original
        for key,entry in s.Files {
            next := IPRCloneSnapshot(entry)
            break
        }
        next.Pulls[1].Players["@Sophie#1"].Damage += 1
        external := V78AuditCaseRewrite(s.TestPath)
        V59ExpectError((*)=>ILBCommitFile(next))
        V48Assert(FileRead(s.TestPath,"UTF-8")==external && s.Original==before,"fallback entry update preserves a concurrent case-only correction")
    }
    finally native.TestHelper := oldTest,native.WorkerHelper := oldWorker
}
V78AuditSourceCaseGuard() => V769Run(V78AuditSourceCaseGuardBody)
V78AuditSourceCaseGuardBody(f)
{
    s := ILBState(),snap := ISMRead(f.Path),history := FileRead(f.Path,"UTF-8")
    external := V78AuditCaseRewrite(ILBPath())
    V59ExpectError((*)=>ISMRead(f.Path))
    V59ExpectError((*)=>ISMCheck(snap,f.Path))
    V48Assert(FileRead(ILBPath(),"UTF-8")==external && FileRead(f.Path,"UTF-8")==history,"stale source management leaves both catalogues intact")
    file := FileOpen(ILBPath(),"w","UTF-8-RAW")
    try file.Write(snap.Text)
    finally file.Close()
    s.Original := external
    V59ExpectError((*)=>ISMCheck(snap,f.Path))
}
V78AuditTeamCaseGuard() => V769Run(V78AuditTeamCaseGuardBody)
V78AuditTeamCaseGuardBody(f)
{
    snap := ILPTRead(f.Path),id := V769Row(snap,f.First).Id,history := FileRead(f.Path,"UTF-8")
    external := V78AuditCaseRewrite(ILBPath())
    V59ExpectError((*)=>ILPTAssign(snap,[id],"New team",f.Path))
    V48Assert(FileRead(ILBPath(),"UTF-8")==external && FileRead(f.Path,"UTF-8")==history,"case-only source correction invalidates the stale team selection without partial write")
}

V78AuditDeadHolderPolicy() => V673OrderFixture(V78AuditDeadHolderPolicyCase)
V78AuditDeadHolderPolicyCase()
{
    global NBCandle,NBOrder,NBOrderOptions,Audio,logReadBusy,inLogDispatch
    V48Setup(),V48Pass("Tank1",100000),V48Use("Tank1",100100,true)
    NBOrderOptions.NextEnabled := false,NBOrderOptions.Phases[1] := false,NBOrderOptions.Corrections := false
    V48Event(100101,V48Field("Tank1"),"=","0","836045448945472","836045448945493"),PollNBOrder()
    V48Assert(NBOrder.Recovery && !Audio.Queue.Length,"dead-holder recovery is recognized while correction audio is muted")
    NBOrderOptions.Corrections := true,PollNBOrder()
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].NOData.Correction && Audio.Queue[1].NOData.Kind="Next","dead-holder recovery honors correction switch independently of normal speech switches")
    item := Audio.Queue[1]
    V48Assert(AudioItemEnabled(item) && item.NOData.Actual="" && item.NOData.ActualName="","real queue policy accepts recovery without inventing a living sender")
    NBOrderOptions.Corrections := false
    V48Assert(!AudioItemEnabled(item),"correction mute also rejects already-queued dead-holder advice")
    NBOrderOptions.Corrections := true,V48Pass("Tank2",100102)
    V48Assert(!NBOrder.Recovery && !Audio.Queue.Length && !AudioItemEnabled(item),"actual receipt resolves recovery and retires its previous queue item")

    V48Setup(),V48Pass("Tank1",100000)
    V48Event(100101,V48Field("Mara"),"=","0","836045448945472","836045448945493"),PollNBOrder()
    V48Assert(!NBOrder.Recovery && !Audio.Queue.Length && NBCandle.Holder=V48Actor("Tank1"),"a different player's death does not manufacture holder recovery")

    for busyKind in ["read","dispatch"] {
        V48Setup(),V48Pass("Tank1",100000),V48Use("Tank1",100100,true)
        logReadBusy := busyKind="read",inLogDispatch := busyKind="dispatch"
        V48Event(100101,V48Field("Tank1"),"=","0","836045448945472","836045448945493"),PollNBOrder()
        V48Assert(!NBOrder.Recovery && !Audio.Queue.Length,"death waits for complete " busyKind " evidence")
        V48Pass("Tank2",100102)
        logReadBusy := false,inLogDispatch := false,PollNBOrder()
        V48Assert(!NBOrder.Recovery && !Audio.Queue.Length && NBCandle.Holder=V48Actor("Tank2"),"same-batch reacquisition avoids obsolete holder-death recovery during " busyKind)
    }
}

; Case-only edits are real edits. All files are private temporary fixtures.
V78AuditCaseSidecar(action,parse)
{
    root := V635Temp(),path := root "\case-sidecar.json"
    try {
        action.Call(path,""),original := FileRead(path,"UTF-8")
        external := StrReplace(original,"AuditCase","auditcase",true)
        V48Assert(original!= "" && original!==external,"fixture changes only the case of persisted text")
        parse.Call(external)
        V71BookmarkWrite(path,external),message := ""
        try action.Call(path,original)
        catch Error as err
            message := err.Message
        V48Assert(InStr(message,"changed"),"case-only external edit rejects a stale save")
        V48Assert(FileRead(path,"UTF-8")==external,"rejected save preserves external text exactly")
        V48Assert(!FileExist(path ".bak"),"rejected stale save does not replace the backup")
        action.Call(path,external)
        V48Assert(FileRead(path,"UTF-8")==original && FileRead(path ".bak","UTF-8")==external,
            "a freshly acknowledged snapshot can save and retains the exact prior content")
    }
    finally {
        Loop Files root "\*","F"
            FileDelete(A_LoopFileFullPath)
        DirDelete(root)
    }
}

V78AuditCaseCooldown()
{
    plan := V69PlannerPlan(),plan.Player := "AuditCase"
    V78AuditCaseSidecar(ICPSave.Bind([plan]),ICPParse)
}

V78AuditCaseSplits()
{
    f := V70SplitFixture(),f.Run.Invalid := "AuditCase"
    V78AuditCaseSidecar(IRSSave.Bind(f.State),IRSParse)
}

V78AuditCaseRunDetails()
{
    f := V71BreakdownFixture(),f.Detail.Limit := "AuditCase"
    V78AuditCaseSidecar(IRBSave.Bind(f.State),IRBParse)
}

V78AuditCaseAliases()
{
    groups := V71ALGroups(),groups[1].Name := "AuditCase"
    V78AuditCaseSidecar(IALTSave.Bind(groups),IALTParse)
}

V78AuditCaseTeamSetup()
{
    text := ITSPack("AuditCase",[],[],[])
    V78AuditCaseSidecar((path,expected) => ITSSaveText(path,text,expected),IGJParse)
}

V78AuditCaseBookmarks() => V71BookmarkFixture(V78AuditCaseBookmarksInner)
V78AuditCaseBookmarksInner(root)
{
    b := IBKLoad(),d := V71BookmarkPull(),d.Note := "AuditCase",IBKStore(d)
    path := IBKPath(),original := b.Expected,external := StrReplace(original,"AuditCase","auditcase",true)
    IBKDecode(external),V71BookmarkWrite(path,external),message := ""
    try IBKStore(d)
    catch Error as err
        message := err.Message
    V48Assert(InStr(message,"changed"),"case-only bookmark edit rejects a stale save")
    V48Assert(FileRead(path,"UTF-8")==external && b.Expected==original && b.Rows[d.Key].Note=="AuditCase",
        "rejected bookmark save preserves exact external file and loaded state")
    V48Assert(!FileExist(path ".bak"),"rejected bookmark save preserves backup state")
    IBKLoad(true),IBKStore(d)
    V48Assert(FileRead(path,"UTF-8")==original && FileRead(path ".bak","UTF-8")==external,
        "reopened bookmark snapshot saves and retains case-only edit in backup")
}

SavedHPReset()
{
    s := V54Fixture(), seg := s.Current, r := seg.Raid
    a := IPActor("Operations Training Dummy {2857785339412480}:99")
    IRRecordHealth(r,a,{Known:true,Current:258,Maximum:1000},5000)
    ev := IPParseLine(V54Line(5100,"Operations Training Dummy {2857785339412480}:99|(0,0,0,0)|(1000/1000)","","836045448953669"))
    IRObserve(s,ev,5100)
    IRRecordHealth(r,a,{Known:true,Current:1000,Maximum:1000},5200)
    V48Assert(r.Health[a.Key].Current=1000 && r.Health[a.Key].ResetCurrent=258,"live snapshot and pre-reset HP retained separately")
    live := IRSnapshot({Segment:seg,State:"STOPPED"}).Health[1]
    V48Assert(live.Current=1000,"unfinished pull continues showing current HP")
    seg.End := 5300
    saved := IRSnapshot({Segment:seg,State:"SAVED LOG"}).Health[1]
    V48Assert(saved.Current=258 && saved.Maximum=1000 && saved.Percent=25.8 && saved.At=5000,"finished pull displays last HP before reset, with original timestamp")
    V48Assert(r.Health[a.Key].Current=1000,"display does not mutate recorded latest HP")
    bytes := IPCEncode(seg), copy := IPCDecode(bytes)
    V48Assert(IRSnapshot({Segment:copy,State:"SAVED LOG"}).Health[1].Current=258,"reset snapshot survives saved cache roundtrip")
}

SavedHPResetGuards()
{
    a := IPActor("Boss {10}:1"), b := IPActor("Boss {10}:2")
    for action in ["heal","cast","target","damage","death","maximum"] {
        r := IRNewMetrics()
        IRRecordHealth(r,a,{Known:true,Current:25,Maximum:100},1000)
        IRRecordHealth(r,a,{Known:true,Current:40,Maximum:100},2000)
        IRRecordHealth(r,a,{Known:true,Current:100,Maximum:100},3000,true)
        V48Assert(r.Health[a.Key].ResetCurrent=40,"use latest HP after healing, never minimum HP")
        IRRecordHealth(r,b,{Known:true,Current:100,Maximum:100},3100,true)
        V48Assert(r.Health[b.Key].ResetAt<0,"another instance cannot inherit wipe HP")
        if action="damage" || action="death" || action="maximum"
            IRRecordHealth(r,a,{Known:true,Current:action="death" ? 0 : 90,Maximum:action="maximum" ? 200 : 100},4000)
        else
            IRRecordHealth(r,a,{Known:true,Current:100,Maximum:100},4000,false,true)
        V48Assert(r.Health[a.Key].ResetAt<0,"activity / changing HP cancels reset: " action)
    }
    r := IRNewMetrics()
    IRRecordHealth(r,a,{Known:true,Current:25,Maximum:100},2000)
    IRRecordHealth(r,a,{Known:true,Current:100,Maximum:100},1900,true)
    V48Assert(r.Health[a.Key].ResetAt<0 && r.Health[a.Key].Current=25,"older reset event ignored")
    IRRecordHealth(r,a,{Known:true,Current:100,Maximum:100},3000,false,true,true)
    IRRecordHealth(r,a,{Known:true,Current:100,Maximum:100},3100,true)
    V48Assert(r.Health[a.Key].ResetAt<0,"legitimate full heal before target clear stays full")
    ; Reset batches may start with damage, player target selection or charges.
    for first in ["Damage","TargetSet","Charges","Remove"] {
        s := V54Fixture(), seg := s.Current, r := seg.Raid
        token := "Operations Training Dummy {2857785339412480}:99"
        npc := IPActor(token)
        IRRecordHealth(r,npc,{Known:true,Current:258,Maximum:1000},5000)
        suffix := first="Damage" ? "[ApplyEffect {836045448945477}: Damage {836045448945501}] (20 energy {836045448940874}) <20>"
            : first="TargetSet" ? "[Event {836045448945472}: TargetSet {836045448953668}]"
            : first="Charges" ? "[ModifyCharges {836045448953666}: Test {99}] (2 charges {836045448953667})"
            : "[RemoveEffect {836045448945478}: Test {99}]"
        ev := IPParseLine("[00:00:05.100] [@Tester#1|(0,0,0,0)|(0/100)] [" token "|(0,0,0,0)|(1000/1000)] [Test {99}] " suffix)
        IRObserve(s,ev,5100)
        V48Assert(r.Health[npc.Key].ResetAt=(first="Remove" ? 5000 : -1),"full HP needs cleanup confirmation: " first)
        ev := IPParseLine("[00:00:05.105] [@Tester#1|(0,0,0,0)|(0/100)] [" token "|(0,0,0,0)|(1000/1000)] [Test {99}] [RemoveEffect {836045448945478}: Test {99}]")
        IRObserve(s,ev,5105)
        seg.End := 5200
        V48Assert(IRSnapshot({Segment:seg,State:"SAVED LOG"}).Health[1].Current=258,"cleanup preserves pre-batch HP: " first)
        IRRecordHealth(r,npc,{Known:true,Current:1000,Maximum:1000},5110,false,true)
        V48Assert(r.Health[npc.Key].ResetAt=5000,"same reset batch queued hit does not erase evidence")
        IRRecordHealth(r,npc,{Known:true,Current:1000,Maximum:1000},5300,false,true)
        V48Assert(r.Health[npc.Key].ResetAt<0,"later combat activity cancels reset batch")
    }
    for reason in ["heal","cast","late cleanup","changed max","death"] {
        r := IRNewMetrics()
        IRRecordHealth(r,a,{Known:true,Current:25,Maximum:100},2000)
        IRRecordHealth(r,a,{Known:true,Current:100,Maximum:100},3000)
        if reason="late cleanup"
            IRRecordHealth(r,a,{Known:true,Current:100,Maximum:100},4101,true)
        else {
            IRRecordHealth(r,a,{Known:true,Current:reason="death"?0:100,Maximum:reason="changed max"?200:100},3010,
                false,reason="heal"||reason="cast",reason="heal",reason="cast")
            IRRecordHealth(r,a,{Known:true,Current:reason="death"?0:100,Maximum:reason="changed max"?200:100},3020,true)
        }
        V48Assert(r.Health[a.Key].ResetAt<0,"pending reset rejected: " reason)
    }
    s := V54Fixture(),seg := s.Current,r := seg.Raid
    token := "Operations Training Dummy {2857785339412480}:99",npc := IPActor(token)
    IRRecordHealth(r,npc,{Known:true,Current:258,Maximum:1000},5000)
    ev := IPParseLine("[00:00:05.100] [" token "|(0,0,0,0)|(1000/1000)] [@Tester#1|(0,0,0,0)|(0/100)] [Slam {99}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (100 energy {836045448940874}) <100>")
    IRObserve(s,ev,5100)
    ev := IPParseLine("[00:00:05.100] [" token "|(0,0,0,0)|(1000/1000)] [@Tester#1|(0,0,0,0)|(0/100)] [] [Event {836045448945472}: Death {836045448945493}]")
    IRObserve(s,ev,5100)
    V48Assert(r.Health[npc.Key].ResetAt=5000,"full-health final lethal hit retains prior NPC HP")
    IRRecordHealth(r,npc,{Known:true,Current:900,Maximum:1000},5200,false,true)
    V48Assert(r.Health[npc.Key].ResetAt<0,"combat continuing after that death cancels reset")
}

SavedHPResetRollback()
{
    s := V54Fixture(),seg := s.Current,r := seg.Raid
    a := IPActor("Operations Training Dummy {2857785339412480}:99")
    IPBBeginUndo(s,seg)
    IPBRemember(seg,"Health",r.Health,a.Key)
    IRRecordHealth(r,a,{Known:true,Current:1000,Maximum:1000},5000,true)
    V48Assert(r.Health[a.Key].ResetAt=4000,"speculative reset recorded")
    IPBRollbackTail(s,seg)
    V48Assert(r.Health[a.Key].Current=900 && r.Health[a.Key].ResetAt<0,"rollback removes speculative reset evidence")
}

; Isolated reproduction of the Oct 31 Bestia pull with an expired manual Gods
; clock. No live reader, persisted user settings, input, or audio are used.
StaleRunBestiaLine()
{
    return "[01:48:39.183] [Dread Master Bestia {3273941900591104}:39768000006105|(169.86,-119.99,-8.72,90.00)|(19129210/19129210)] [=] [ {3297821918756864}] [ApplyEffect {836045448945477}:  {3297821918757137}]"
}

StaleRunFixture(key := "gods",remaining := 0)
{
    f := V6510RunFixture("dp",1250),s := f.State
    IRNStart(s,key,f.Utc,f.Tick)
    s.AnchorRemaining := remaining
    f.Event := IPParseLine(StaleRunBestiaLine())
    return f
}

StaleRunFeed(f,autoDetect := true)
{
    return IRNObserveAutomatic(f.State,f.Event,f.Context,f.Stamp,f.Utc,f.Tick,"private-log",autoDetect)
}

StaleRunBestia()
{
    f := StaleRunFixture(),old := f.State
    V48Assert(IsObject(f.Event) && IRNFirstBossContact(f.Event,old.Catalog["dp"]),"actual Bestia opener is valid start evidence")
    V48Assert(!V6510RunFeed(f),"old Armed-only observer reproduces the reported blocked timer")
    next := StaleRunFeed(f)
    V48Assert(IsObject(next) && next!=old && next.Key="dp" && next.Status="Running","fresh DP pull replaces expired Gods clock")
    V48Assert(next.AnchorRemaining=3598750 && next.Basis="First boss attack","backlog is deducted from DP's sixty-minute estimate")
    V48Assert(old.Key="gods" && old.AnchorRemaining=0 && !old.Seen.Has("private-log"),"old run stays intact for split archival before commit")
    V48Assert(next.RunId!=old.RunId && next.Changed>old.Changed,"replacement gets a fresh run identity")
    f.State := next,f.Utc += 1000,f.Tick += 1000,f.Stamp += 1000
    V48Assert(!IsObject(StaleRunFeed(f)) && next.AnchorRemaining=3598750,"following Bestia hits do not replace new timer")
    V6510RunPrivateFile(StaleRunPersistence)
}

StaleRunPersistence(path)
{
    f := StaleRunFixture(),old := f.State
    V48Assert(IRNSaveState(old,path,f.Utc,f.Tick),"expired manual fixture saved privately")
    f.State := IRNLoadState(path,f.Utc+60000,f.Tick)
    V48Assert(f.State.Status="Running" && f.State.AnchorRemaining=0,"restored expired clock matches reported state")
    next := StaleRunFeed(f)
    V48Assert(IsObject(next) && IRNSaveState(next,path,f.Utc,f.Tick),"replacement persists")
    loaded := IRNLoadState(path,f.Utc+1000,f.Tick+1000)
    V48Assert(loaded.Key="dp" && loaded.RunId=next.RunId && loaded.AnchorRemaining=3597750,"new countdown survives restart without adding time")
}

StaleRunGuards()
{
    f := StaleRunFixture("dp")
    V48Assert(!IsObject(StaleRunFeed(f)),"expired same-raid wipe cannot start another clock")
    f := StaleRunFixture()
    V48Assert(!IsObject(StaleRunFeed(f,false)),"manual raid selection disables automatic replacement")
    for state in ["Stopped","Finished"] {
        f := StaleRunFixture(),f.State.Status := state
        V48Assert(!IsObject(StaleRunFeed(f)),state " is never silently rearmed")
    }
    f := StaleRunFixture("gods",300000)
    V48Assert(!IsObject(StaleRunFeed(f)) && f.State.Key="gods","unexpired clock is preserved")
    for field in ["ModeId","AreaId"] {
        f := StaleRunFixture(),f.Context.%field% := "wrong"
        V48Assert(!IsObject(StaleRunFeed(f)) && f.State.Key="gods","wrong " field " cannot replace old run")
    }
    for age in [-1,30001] {
        f := StaleRunFixture(),f.Context.AgeMs := age
        V48Assert(!IsObject(StaleRunFeed(f)),"stale or invalid record age cannot replace run")
    }
    f := StaleRunFixture(),f.Event.EffectId := "999"
    V48Assert(!IsObject(StaleRunFeed(f)) && f.State.Key="gods","wrong self effect leaves expired clock intact")
    f := StaleRunFixture(),f.State.Seen["private-log"] := f.Stamp
    V48Assert(!IsObject(StaleRunFeed(f)),"consumed timestamps survive automatic replacement")
    f := StaleRunFixture()
    V48Assert(!IsObject(IRNObserveAutomatic(f.State,f.Event,f.Context,f.Stamp,f.Utc,f.Tick,"",true)),"missing source is rejected")
    V48Assert(!IsObject(IRNObserveAutomatic(f.State,f.Event,f.Context,f.Stamp,-1,f.Tick,"private-log",true)),"invalid clock is rejected")
}

StaleRunHistory()
{
    f := StaleRunFixture(),s := f.State
    IRNObserveHistory(s,f.Event,f.Context,"private-log")
    V48Assert(!IsObject(StaleRunFeed(f)) && s.Key="gods","startup history cannot resurrect a full timer halfway through Bestia")
    f := StaleRunFixture("gods",1000),s := f.State
    V48Assert(!IsObject(StaleRunFeed(f)),"Bestia pull cannot replace still-active Gods clock")
    f.Utc += 2000,f.Tick += 2000,f.Stamp += 2000
    V48Assert(!IsObject(StaleRunFeed(f)) && s.Key="gods","later expiry cannot turn an ongoing fight into a new start")
    IRNArm(s,"auto")
    V48Assert(IsObject(StaleRunFeed(f)),"explicit New run still permits a new start")
}

StaleRunPrefilter()
{
    global IRN,IRNU,IP
    oldRun := IRN,oldUI := IRNU,oldIP := IP
    try {
        f := StaleRunFixture(),IRN := f.State,IRNU := IRNUNewState(),IP := {ReaderContext:f.Context}
        line := StaleRunBestiaLine()
        V48Assert(IRNMayStartLine(line,"private-log"),"live prefilter admits another raid while holding an expired clock")
        IRN.AnchorRemaining := 100000
        V48Assert(IRNMayStartLine(line,"private-log"),"prefilter preserves earlier pull history before old timer expires")
        IRNU.AutoDetect := false
        V48Assert(!IRNMayStartLine(line,"private-log"),"prefilter respects manual selection")
        IRNU.AutoDetect := true,IRN.Key := "dp"
        V48Assert(!IRNMayStartLine(line,"private-log"),"same-raid running clock avoids repeat trigger work")
        IRN.Key := "gods",IRN.Status := "Stopped"
        V48Assert(!IRNMayStartLine(line,"private-log"),"Stop remains authoritative before parsing")
        IRN.Status := "Running",IP.ReaderContext.ModeId := "836045448953652"
        V48Assert(!IRNMayStartLine(line,"private-log"),"Veteran DP cannot start a Master raid timer")
        IP.ReaderContext.ModeId := "836045448953655",IRN := IRNNewState()
        V48Assert(IRNMayStartLine(line,"private-log") && IsObject(IRNObserveAutomatic(IRN,f.Event,f.Context,f.Stamp,f.Utc,f.Tick,"private-log",true)),"ordinary first auto start still works")
    }
    finally IRN := oldRun,IRNU := oldUI,IP := oldIP
}

RaptusTestData()
{
    s := V6415CData(),s.AreaId := "137438993410",s.Current.AreaId := s.AreaId,s.Current.BossKey := "DP-RA"
    return s
}
RaptusTestHit(s,at,amount,who := "@A#6415",npc := "3355490444640256",kind := "Damage",effective := -1)
{
    ev := V6415CEvent(s,at,kind,amount,who,"Captive {" npc "}:2",effective)
    IPApplyEvent(s,ev,at)
    return ev
}
RaptusTestSpin(s,at,remove := false)
{
    ev := V6415CEvent(s,at,"Activate",0,"Raptus {3302902865068032}:1","=")
    ev.Kind := "Other",ev.AbilityId := "3301008784490496",ev.EffectId := ev.AbilityId
    ev.ActionId := remove ? "836045448945478" : "836045448945477",ev.ValueOK := false
    IPApplyEvent(s,ev,at)
}
RaptusTestRow(s,key := "@A#6415",choice := "auto")
{
    for row in V6415CSnapshot(s,choice).Rows
        if row.Key=key
            return row
    throw Error("Missing Raptus test participant")
}
RaptusPersonalTiming()
{
    s := RaptusTestData(),RaptusTestSpin(s,1000)
    V48Assert(!V6415CSnapshot(s).Available,"portal waiting alone has no captive score")
    RaptusTestHit(s,30000,100),RaptusTestHit(s,32000,200,"@B#6415"),RaptusTestHit(s,40000,300)
    a := RaptusTestRow(s),b := RaptusTestRow(s,"@B#6415"),q := V6415CSnapshot(s)
    V48Assert(a.Damage=400 && a.DamageDuration=10,"includes first captive hit and excludes portal wait")
    V48Assert(b.Damage=200 && b.DamageDuration=1,"each player has their own minimum-one-second duration")
    ranking := IRCURank(q.Rows,"Damage")
    V48Assert(ranking.Rows[1].Key=b.Key && ranking.Peak=200,"rank and bars follow DPS when active durations differ")
    V48Assert(q.Selected="raptus-captive:1" && q.PersonalTiming,"new scoring cannot share legacy personal-best identity")
    RaptusTestSpin(s,41000,true)
    V48Assert(IPBESTChallengeComplete(s.Current,q.Selected,false),"recorded return closes first challenge")
    RaptusTestSpin(s,100000),RaptusTestHit(s,130000,100),RaptusTestHit(s,132000,100),RaptusTestSpin(s,133000,true)
    t := RaptusTestRow(s,"@A#6415","raptus-captive:total")
    V48Assert(t.Damage=600 && t.DamageDuration=12,"total score sums personal activity and excludes time between rounds")
}
RaptusPersonalTargets()
{
    s := RaptusTestData()
    RaptusTestHit(s,1000,900,"@Tank#6415","3289498272137216")
    V48Assert(!V6415CSnapshot(s).Available,"Doomed captive does not create a DPS result")
    RaptusTestHit(s,2000,100,"@Heal#6415","3289335063379968","Heal",60)
    RaptusTestHit(s,4000,200,"@Heal#6415","3289335063379968","Heal",120)
    IPApplyEvent(s,V6415CEvent(s,4500,"Heal",900,"@Heal#6415","@A#6415",800),4500)
    a := RaptusTestRow(s,"@Heal#6415")
    V48Assert(a.Heal=300 && a.Effective=180 && a.HealDuration=2,"healing score includes only Dying Captive")
    V48Assert(RaptusTestRow(s,"@Tank#6415").Damage=0,"tank captive damage stays out of DPS score")
    RaptusTestHit(s,5000,100,"@Heal#6415","3289335063379968","Heal")
    V48Assert(IRCURank(V6415CSnapshot(s).Rows,"Heal").Unknown=1,"missing effective healing remains unknown")
    s := RaptusTestData(),ev := V6415CEvent(s,1000,"Activate",0,"Captive {3289335063379968}:2","@Heal#6415")
    ev.ValueOK := false,ev.EffectId := "3289309293576476",IPApplyEvent(s,ev,1000)
    RaptusTestHit(s,5000,100,"@Heal#6415","3289335063379968","Heal",80)
    V48Assert(RaptusTestRow(s,"@Heal#6415").HealDuration=4,"curse starts healer clock before first heal")
}
RaptusPersonalBoundaries()
{
    s := RaptusTestData(),RaptusTestHit(s,1000,100),RaptusTestHit(s,22000,200),RaptusTestHit(s,22001,900)
    row := RaptusTestRow(s)
    V48Assert(row.Damage=300 && row.DamageDuration=21,"timeout excludes transition record and includes exact boundary")
    RaptusTestHit(s,23000,50)
    V48Assert(RaptusTestRow(s).Damage=350,"subsequent captive interaction can reenter after timeout")
    s := RaptusTestData(),RaptusTestHit(s,1000,100)
    IPApplyEvent(s,V6415CEvent(s,2000,"Damage",500,"Raptus {3302902865068032}:1","@B#6415"),2000)
    V48Assert(IPBESTChallengeComplete(s.Current,"raptus-captive:1",false),"Raptus hitting any player ends active challenge")
    s := RaptusTestData(),RaptusTestHit(s,1000,100),ev := V6415CEvent(s,4000,"Activate",0,"@A#6415","Captive {3355490444640256}:2")
    IPApplyEvent(s,ev,4000)
    V48Assert(RaptusTestRow(s).DamageDuration=3,"filtered last target event contributes real duration without extra damage")
    V48Assert(!IPBESTChallengeComplete(s.Current,"raptus-captive:1",false),"unclosed attempt is ineligible for a personal best")
}
RaptusPersonalReorder()
{
    s := RaptusTestData(),RaptusTestHit(s,3000,100),RaptusTestHit(s,2000,50)
    V48Assert(RaptusTestRow(s).Damage=150 && RaptusTestRow(s).DamageDuration=1,"late first hit repairs personal start")
    IPBBeginUndo(s,s.Current),RaptusTestHit(s,4000,200),IPBRollbackTail(s,s.Current)
    V48Assert(RaptusTestRow(s).Damage=150 && RaptusTestRow(s).DamageDuration=1,"tail rollback restores ledger and duration")
    RaptusTestHit(s,4000,200),RaptusTestSpin(s,3500,true)
    V48Assert(RaptusTestRow(s).Damage=350 && RaptusTestRow(s).DamageDuration=2,"late stop closes first attempt and following hit begins another")
    RaptusTestHit(s,100,999)
    V48Assert(V6415CSnapshot(s).Note="Partial log","beyond-buffer late record is disclosed")
}
RaptusPersonalStorage()
{
    files := V75LibraryFiles()
    for path,f in files {
        p := f.Pulls[1]
        break
    }
    c := p.Challenges[1],c.Key := "raptus-captive:1",c.Verified := 1
    t := c.Players["@Sophie#1"],t.DamageDuration := 2,t.HealDuration := 4
    text := IGVJson(ILBPack(files)),parsed := ILBParse(text)
    V48Assert(IGVJson(ILBPack(parsed))=text,"personal challenge durations survive Library persistence")
    expanded := INLibraryMaterialize(ILBPack(files))
    V48Assert(IGVJson(ILBPack(expanded))=text,"native catalogue materialization preserves durations")
    values := IPBESTValues(p,"@Sophie#1"),found := 0
    for v in values {
        if InStr(v.Key,"raptus-captive:") {
            found += 1
            V48Assert(v.Value=(v.Metric="DPS" ? 15000 : v.Metric="HPS" ? 1250 : 500),"personal best uses metric-specific captive duration")
        }
    }
    V48Assert(found=3,"all three personal metrics remain available")
    pull := {},chunks := ["raptus-captive:1`tRaptus Challenges 1`t10`t0`t1`n@Sophie#1`t30000`t5000`t2000`t2`t2`t2`t4"]
    decoded := INLibraryBrowseChallenges(chunks,pull)
    V48Assert(decoded[1].Players["@Sophie#1"].DamageDuration=2 && decoded[1].Players["@Sophie#1"].HealDuration=4,"compact catalogue retains personal durations")
    bad := ILBPack(files),bad[3][1][7][1][12][1][5][1].Pop()
    V59ExpectError((*)=>ILBParse(IGVJson(bad)))
    V48Assert(!V75LibraryPull().Challenges[1].Players["@Sophie#1"].HasOwnProp("DamageDuration"),"legacy catalogue shape is unchanged")
}

V7885QueueClear() => V7844Run(V7885QueueClearCase)
V7885QueueClearCase()
{
    f := V7844File(),s := IPVLState(),missing := f.Path ".missing",IPVLLoad()
    s.QueueLock := IHAcquireLock(IPVLQueuePath()),IPVLQueueSave([f.Path,missing],Map())
    s.PendingFiles.Push(f),s.Next := 3,s.Done := 1,s.Failed := 1,s.QueueRetry := [2],IPVLStop()
    before := FileRead(IPVLPath()),held := IHAcquireLock(IPVLQueuePath())
    try V48Assert(!IPVLClearQueue() && IPVLQueueRemaining()=1,"cannot clear another process's queue")
    finally DllCall("CloseHandle","Ptr",held)
    s.NativeBusy := true
    V48Assert(!IPVLClearQueue() && IPVLQueueRemaining()=1,"cannot clear an active native scan")
    s.NativeBusy := false
    V48Assert(IPVLClearQueue(),"failed file can be dismissed")
    s.QueuePath := "",IPVLQueueLoad(true)
    V48Assert(!IPVLQueueRemaining() && FileRead(IPVLPath())=before,"clear survives reload and preserves saved matches")
    V48Assert(FileExist(f.Path) && s.Files.Count=1,"clearing work never deletes logs or saved results")
    IPVLStart([missing]),V7844Wait()
    s.PendingFiles.Push(f),s.Error := "save denied"
    V48Assert(!IPVLClearQueue() && s.PendingFiles.Length=1 && IPVLQueueRemaining()=1,"unsaved results block clear")
    s.Error := ""
}

V7885RoleRefresh() => V7844Run(V7885RoleRefreshCase)
V7885RoleRefreshCase()
{
    f := V7844File(),s := IPVLState(),IPVLLoad()
    for m in f.Matches
        if m.HasOwnProp("Role")
            m.DeleteProp("Role")
    IPVLCommit(f)
    empty := f.Clone(),empty.Path .= ".empty",empty.Matches := []
    IPVLCommit(empty),IPVLRefreshRoles(),V7844Wait()
    V48Assert(s.Done=1 && s.Failed=0 && s.Files.Count=2,"role refresh scans only older matched logs")
    V48Assert(IPVLMetadataCurrent(s.Files[StrLower(f.Path)]),"new summaries retain a role even if evidence is unknown")
    IPVLRefreshRoles()
    V48Assert(!s.Active && !IPVLQueueRemaining(),"repeat refresh does not rescan current or empty sources")
}

V7885TyransEnding()
{
    a := "[@Tester#57|(0,0,0,0)|(1000/1000)]",boss := "[NPC {3273954785492992}:10|(0,0,0,0)|(0/1000)]"
    base := ["[00:00:00.000] " a " [] [] [AreaEntered {836045448953664}: Area {137438993410} Mode {836045448953655}]",
        "[00:00:00.100] " a " [] [] [Event {836045448945472}: EnterCombat {836045448945489}]",
        "[00:00:01.000] " a " " StrReplace(boss,"(0/1000)","(900/1000)") " [Hit {123}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10 kinetic {836045448940873})",
        "[00:00:02.625] " a " [] [] [Event {836045448945472}: ExitCombat {836045448945490}]",
        "[00:00:02.958] " a " " boss " [Hit {123}] [ApplyEffect {836045448945477}: Damage {836045448945501}] (10 kinetic {836045448940873})",
        "[00:00:03.018] " a " [] [] [Event {836045448945472}: EnterCombat {836045448945489}]",
        "[00:00:04.125] " a " [] [] [Event {836045448945472}: ExitCombat {836045448945490}]",
        "[00:00:04.133] " a " [Holocron {3312845714358272}:88|(0,0,0,0)|(0/1)] [] [Event {836045448945472}: Death {836045448945493}]"]
    for variant in ["kill","no marker","alive","late","reset"] {
        lines := base.Clone()
        if variant="no marker"
            lines.Pop()
        if variant="alive"
            lines[5] := StrReplace(lines[5],"(0/1000)","(500/1000)")
        if variant="late"
            lines[8] := StrReplace(lines[8],"04.133","08.133")
        if variant="reset"
            lines.InsertAt(6,"[00:00:03.000] " a " " StrReplace(boss,"(0/1000)","(1000/1000)") " [] [Event {836045448945472}: TargetSet {836045448953668}]")
        s := IPNewData("Tyrans missing Death fixture")
        for line in lines
            IPFeedLine(s,line)
        IPFinalizeData(s,"fixture end"),found := false
        for seg in s.Segments {
            if seg.BossKey="DP-TY" {
                found := true
                V48Assert(IPRecordedKill(seg)=(variant="kill"),"Tyrans completion guard: " variant)
                if variant="kill"
                    V48Assert(seg.Last=4133 && seg.RequiredDead.Count=0,"reward confirms kill without inventing a boss Death")
            }
        }
        V48Assert(found,"Tyrans fixture preserved: " variant)
    }
}


V7888DstCache(a,original,seg,path,text)
{
    global IP
    data := V70CacheImport(path),signature := V596Signature(data),id := IPCIdentity(path,"UTF-8",data.Gap)
    for hours in [-1,1,5] {
        FileSetTime(DateAdd(FileGetTime(path,"M"),hours,"Hours"),path,"M")
        current := IPCIdentity(path,"UTF-8",data.Gap)
        V48Assert(current.Key=id.Key,"timestamp-only changes preserve content cache identity")
        reopened := V70CacheImport(path)
        V48Assert(IP.ImportTiming.Cache="disk hit" && V596Signature(reopened)=signature,"DST cache reopen preserves exact combat results")
        V48Assert(reopened.SourceModified=current.Modified,"restored cache carries current source metadata")
    }
}
V7888DstPvp()
{
    global IP
    f := V7844File(),s := IPVLState(),stamp := f.Modified
    IPVLLoad(),IPVLCommit(f)
    entry := {Source:f,Match:f.Matches[1]}
    for hours in [-1,1,5] {
        f.Modified := DateAdd(stamp,hours,"Hours")
        resolved := IPVLResolveOpen(entry)
        V48Assert(resolved.Source.Modified=stamp && resolved.Source.Matches=f.Matches,"PvP opening accepts unchanged contents across DST/time-zone changes")
        V48Assert(f.Modified!=stamp,"opening does not rewrite catalogue timestamps")
        IP.Offline := V7843WorkerData(f.Path),IP.ImportPath := f.Path,IP.ImportTiming := {}
        IPVLPrepareOpen(resolved,IP.ImportTiming)
        V48Assert(InStr(IPVLSelectPending(IP),"Selected arena match"),"PvP selection survives legacy shifted metadata")
        V48Assert(ILBSourceStatus({Path:f.Path,Source:f})="Indexed","timestamp-only change does not demand reindexing in raid Library")
    }
    IPVLCommit(f)
    IPVLStart([f.Path]),V7844Wait()
    V48Assert(s.Done=0 && s.Skipped=1 && !s.Failed,"PvP existing scan verifies shifted bytes without reparsing matches")
    V48Assert(s.Files[StrLower(f.Path)].Modified=stamp && s.Files[StrLower(f.Path)].Matches.Length=2,"PvP verified metadata refresh retains matches")
    s.Files[StrLower(f.Path)].Modified := DateAdd(stamp,-1,"Hours")
    IPVLStart([f.Path]),SetTimer(IPVLTick,0),IPVLStop("Paused")
    V48Assert(!s.Active && s.Next=1 && !s.PendingFiles.Length,"pause preserves unverified queued source")
    ; An equal length and a one-hour timestamp shift are never proof of identity.
    text := FileRead(f.Path,"UTF-8"),FileDelete(f.Path)
    FileAppend(StrReplace(text,"Player1","Player9"),f.Path,"UTF-8"),FileSetTime(stamp,f.Path,"M")
    V59ExpectError((*)=>IPVLResolveOpen(entry))
    V48Assert(s.Files.Count=1 && f.Matches.Length=2,"changed bytes are rejected without deleting saved arena history")
}
V7888PublicDST() {
 V761LibraryFixture(V7888PublicRaid)
 V7844Run(V7888DstPvp)
 V70CacheFixture((root)=>V692AnalysisFixture(V7888DstCache))
}
V7888PublicRaid(e,f) {
 global IP
 stamp:=e.Source.Modified
 for hours in [-1,1,5] {
  e.Source.Modified:=DateAdd(stamp,hours,"Hours")
  V48Assert(ILBSourceStatus(e)="Indexed","DST no longer demands reindex")
  V48Assert(ILBOpenEntry(e),"public Library opens shifted timestamp")
  IPImportRun()
  V48Assert(IP.ImportDone && IP.Selected=1,"public Library selects indexed pull")
 }
}
I93TimerSelection() => V65UITimerIsolated(I93TimerSelectionCase)
I93TimerSelectionCase(path)
{
    global IRT,IRTPrefs
    defs := [],library := IRTLibraryPath()
    for item in [["Z personal","Personal"],["HATEFUL PULL IN","Scum and Villainy"],["Hateful sparks","Scum and Villainy"],["Hateful sparks","Personal"]] {
        d := IRTDefinition(item[1],item[2]),d.Enabled := true,d.Interval := 10000,d.Color := "AABBCC"
        d.Trigger := IRTCondition("COMBAT_START"),defs.Push(d)
    }
    try {
        IRTConfigure(IRT,defs),IRTShowManager(),lv := IRTPrefs.List
        V48Assert(!IsObject(IRTUSelected()),"no selection never resolves a timer")
        for col in [2,3,1,4] {
            for order in ["Sort","SortDesc"] {
                lv.ModifyCol(col,order)
                Loop lv.GetCount() {
                    row := A_Index,lv.Modify(0,"-Select"),lv.Modify(row,"Select Focus")
                    d := IRTUSelected(),wanted := lv.GetText(row,3) Chr(31) lv.GetText(row,2)
                    V48Assert(IsObject(d) && d.Id==wanted,"sorted native row resolves exact timer including duplicate names")
                }
            }
        }
        lv.ModifyCol(2,"SortDesc"),target := "Scum and Villainy" Chr(31) "Hateful sparks"
        Loop lv.GetCount() {
            if lv.GetText(A_Index,5)==target
                lv.Modify(0,"-Select"),lv.Modify(A_Index,"Select Focus")
        }
        V48Assert(IRTUToggleSelected(false),"disable selected saves successfully after sorting")
        for d in IRT.Definitions
            V48Assert(d.Enabled=(d.Id!=target),"only selected timer changes enabled state")
        V48Assert(IRTUSelected().Id==target && !IRTUSelected().Enabled,"selection remains on disabled timer after refresh")
        parsed := IRTParseXML(FileRead(library,"UTF-8"),[])
        V48Assert(parsed.Definitions.Length=4,"all timer definitions survive save")
        for d in parsed.Definitions
            V48Assert(d.Enabled=(d.Id!=target),"saved XML preserves disabled choice and unrelated timers")
        IRTLoadLibrary(),IRTURefreshManager(target)
        V48Assert(!IRTUSelected().Enabled,"disabled timer stays off after full library reload and bundled repairs")
        V48Assert(IRTUToggleSelected(true) && IRTUSelected().Enabled,"enable uses the same stable identity")
    } finally {
        for p in [library,library ".bak"]
            try FileDelete(p)
    }
}

I94TimerRouting()
{
    d := IRTDefinition("Discharge","Classes - Shadow/Sin")
    V48Assert(IRTSTimerPanel(d)="Personal","class folder routes to personal")
    d := IRTDefinition("HATEFUL PULL IN","Scum and Villainy")
    d.Trigger := IRTCondition("EFFECT_GAINED"),d.Trigger.Target := "@Self"
    V48Assert(IRTSTimerPanel(d)="Boss","boss effect on self remains a boss timer")
    d := IRTDefinition("My DoT"),d.Trigger := IRTCondition("ABILITY_ACTIVATED"),d.Trigger.Source := "@Self"
    V48Assert(IRTSTimerPanel(d)="Personal","unfiled self ability automatically personal")
    d.Trigger.Boss := "Hateful Entity"
    V48Assert(IRTSTimerPanel(d)="Boss","boss-scoped custom timer remains boss")
    d.Panel := "Personal",d.Enabled := true,d.Interval := 12000,d.Color := "AA88E8"
    decoded := IRTParseXML(IRTSerializeXML([d])).Definitions[1]
    V48Assert(decoded.Panel="Personal" && decoded.Supported,"explicit personal assignment roundtrips through native XML")
    d.Builtin := true,d.Panel := "Personal"
    merged := IRTMergeDefinitions([IRTDefinition("My DoT")],[],false)
    original := d.Clone(),original.Panel := "Auto"
    parsed := IRTParseXML(IRTSerializeXML([d]))
    merged := IRTMergeDefinitions([original],parsed,true)
    V48Assert(merged.Definitions[1].Panel="Personal","built-in override survives library merge")
    bad := StrReplace(IRTSerializeXML([d]),"<irisPanel>Personal</irisPanel>","<irisPanel>Invalid</irisPanel>"),caught := false
    try IRTParseXML(bad)
    catch Error
        caught := true
    V48Assert(caught,"unknown panel value is rejected")
    snapshot := {Rows:[],Alert:"One warning",AlertLines:[],More:0,Preview:false}
    Loop 15
        snapshot.Rows.Push({Name:"Boss " A_Index,Panel:"Boss",Due:A_Index})
    Loop 14
        snapshot.Rows.Push({Name:"Personal " A_Index,Panel:"Personal",Due:100+A_Index})
    boss := IRTSFilterSnapshot(snapshot,"Boss"),personal := IRTSFilterSnapshot(snapshot,"Personal"),combined := IRTSFilterSnapshot(snapshot)
    V48Assert(boss.Rows.Length=12 && boss.More=3 && personal.Rows.Length=12 && personal.More=2,"each panel has its own row cap; personal timers survive a busy boss panel")
    V48Assert(combined.Rows.Length=12 && combined.More=17 && snapshot.Rows.Length=29,"combined layout retains original cap without modifying snapshot")
    V48Assert(boss.Alert="One warning" && personal.Alert="","big warning shown once")
    sample := IRTULayoutSample(1000)
    V48Assert(IRTSFilterSnapshot(sample,"Boss").Rows.Length=2 && IRTSFilterSnapshot(sample,"Personal").Rows.Length=1,"desktop preview demonstrates both panels")
    p := IRTUNewState(),m := IPMNewState()
    p.SeparatePanels := true,p.PersonalX := -500,p.PersonalWidth := 420
    layout := ILPCapture(m,p),p.PersonalX := 0,p.SeparatePanels := false
    ILPApplyModel(m,p,layout)
    V48Assert(p.SeparatePanels && p.PersonalX=-500 && p.PersonalWidth=420,"named layouts preserve split choice and personal geometry")
    layout.Delete("Timer.PersonalX"),layout.Delete("Timer.SeparatePanels")
    ILPApplyModel(m,p,layout)
    V48Assert(p.SeparatePanels && p.PersonalX=-500,"older layouts keep new panel preferences")
}

I94TimerPanels() => V65UITimerIsolated(I94TimerPanelsCase)
I94TimerPanelsCase(path)
{
    global IRT,IRTPrefs,IPM
    p := IRTPrefs,s := IRT,library := IRTLibraryPath()
    try {
        for d in s.Definitions
            d.Trigger := IRTCondition("COMBAT_START"),d.Interval := 15000
        p.SeparatePanels := true,IPM.Enabled := true,IPM.Wanted := true,IPM.DesktopPreview := true
        s.Definitions[1].Panel := "Personal"
        p.BarsX := 800,p.BarsY := 100,p.PersonalX := 200,p.PersonalY := 150
        before := s.Active.Count,due := s.Active[s.Definitions[1].Id].Due
        IRTURender(s,1000),q := p.PersonalPanel
        V48Assert(p.LastError="" && IPMGuiAlive(q.BarsGui),"both native panel HWNDs render")
        V48Assert(p.Header.Text="Boss timers" && q.Header.Text="Personal timers","distinct panel headings")
        V48Assert(p.Rows[1].Name.Text="Move away" && q.Rows[1].Name.Text="Later cast","native controls display the correct timer sets")
        V48Assert(!DllCall("IsWindowVisible","Ptr",q.BarsGui.Hwnd) && !p.DragHooks,"test windows remain hidden without gameplay input hooks")
        V48Assert(s.Active.Count=before && s.Active[s.Definitions[1].Id].Due=due,"render never resets countdowns")
        IPM.Editing := true,IRTUSyncEditMode()
        for panel in [p,q] {
            style := DllCall("GetWindowLongW","Ptr",panel.BarsGui.Hwnd,"Int",-20,"UInt")
            V48Assert((style & 0x08000000) && !(style & 0x20),"each unlocked panel accepts mouse without activation")
        }
        V48Assert(IRTUEditTarget(q,q.Header.Hwnd) && !IRTUEditTarget(p,q.Header.Hwnd),"personal header belongs exclusively to personal drag handler")
        q.Drag := {Hwnd:q.BarsGui.Hwnd,Gui:q.BarsGui,Busy:false}
        DllCall("SetWindowPos","Ptr",q.BarsGui.Hwnd,"Ptr",0,"Int",320,"Int",240,"Int",550,"Int",220,"UInt",0x14)
        q.BarsX := 320,q.BarsY := 240,q.BarsWidth := 410,q.BarsHeight := 120,q.GeometryDirty := true
        IRTURender(s,1100),q.BarsGui.GetPos(&x,&y,&w,&h)
        V48Assert(x=320 && y=240 && w=550 && h=220 && q.BarsX=320,"render does not snap a personal drag to old saved geometry")
        IRTUDragStop(q)
        V48Assert(p.PersonalX=320 && p.PersonalY=240 && p.PersonalWidth=410 && p.BarsX=800,"personal drag saves only its own geometry")
        V48Assert(IniRead(path,"IrisTimers","PersonalX")=320 && IniRead(path,"IrisTimers","BarsX","missing")="missing","personal coordinates persist independently")
        IRTUSavePrefs(p),restored := IRTUNewState(),IRTSLoadPrefs(restored)
        V48Assert(restored.SeparatePanels && restored.PersonalX=320 && restored.PersonalWidth=410,"settings restore separate panels and dimensions")
        IPM.Editing := false,IRTUSyncEditMode()
        for panel in [p,q] {
            style := DllCall("GetWindowLongW","Ptr",panel.BarsGui.Hwnd,"Int",-20,"UInt")
            V48Assert((style & 0x08000020)=0x08000020,"locking restores click-through on both panels")
        }
        IRTShowManager(),p.List.ModifyCol(6,"SortDesc")
        target := s.Definitions[2].Id
        Loop p.List.GetCount() {
            if p.List.GetText(A_Index,5)==target
                p.List.Modify(0,"-Select"),p.List.Modify(A_Index,"Select Focus")
        }
        p.PanelChoice.Choose(3),IRTSAssignSelected(p.PanelChoice)
        V48Assert(IRTUSelected().Id==target && IRTUSelected().Panel="Personal","panel reassignment follows the selected row after new-column sorting")
        V48Assert(s.Active.Count=before && s.Active[s.Definitions[1].Id].Due=due,"changing assignment leaves active countdowns intact")
        V48Assert(IRTParseXML(FileRead(library,"UTF-8")).Definitions[2].Panel="Personal","custom assignment is saved")
        selected := IRTUSelected(),preview := IRTUSelectedPreview(selected,1000,5)
        p.SelectedPreview := preview.Preview
        V48Assert(IRTUSnapshot(s,1100,p,"Boss").Rows.Length=0 && IRTUSnapshot(s,1100,p,"Personal").Rows.Length=1,"selected personal preview is routed to only its assigned panel")
        p.SelectedPreview := ""
        p.SplitBox.Value := 0,IRTSToggleSeparate(p.SplitBox)
        V48Assert(!p.SeparatePanels && p.Header.Text="Encounter timers" && !q.BarsShown,"turning split off returns to one panel and hides personal panel")
        V48Assert(IRTUSnapshot(s,1000,p).Rows.Length=2 && s.Active.Count=before,"combined panel still has all visible timers")
        p.SplitBox.Value := 1,IRTSToggleSeparate(p.SplitBox)
        V48Assert(p.SeparatePanels && p.PersonalX=320,"switching back retains placement")
        q.BarsGui.Destroy(),IRTURender(s,1200)
        V48Assert(p.LastError="" && IPMGuiAlive(q.BarsGui),"personal panel safely recovers a destroyed window")
        IRTUHideOverlays()
        V48Assert(!q.BarsShown && !p.BarsShown && !q.Editing,"global hide includes both panels")
        V48Assert(s.Active.Count=before,"hiding preserves timers")
        IRTLoadLibrary(),IRTURefreshManager(target)
        V48Assert(IRTUSelected().Panel="Personal","assignment survives full library reload and bundled repairs")
        IRTUShutdown(),IRTUShutdown()
        V48Assert(!IsObject(p.PersonalPanel),"shutdown disposes both panels and is idempotent")
    } finally {
        for file in [library,library ".bak"]
            try FileDelete(file)
    }
}

NBC98ActualPair()
{
    ; Recorded Nov 1 kill: combat_2026-11-01_20_08_09_416425.txt,
    ; lines 263160, 263253, 263255. User independently confirmed close=7, far=11.
    far := NBCandleActor("Rail Turret {4132746381230080}:62527002020734|(-439.88,2556.98,207.94,210.00)|(1260576/1260576)",28150)
    boss := NBCandleActor("NAHUT {4122949560827904}:62527001917600|(-427.32,2643.66,207.91,103.82)|(21577296/36514284)",29765)
    near := NBCandleActor("Rail Turret {4132746381230080}:62527002021249|(-439.92,2644.09,207.97,-94.34)|(1260576/1260576)",29862)
    pair := NBTurretCompare(far,near,boss,29862)
    V48Assert(pair.Ok && pair.CloseClock=7 && pair.FarClock=11,"actual raid matches confirmed minimap clocks")
    V48Assert(pair.Close=near && pair.Far=far && 29862-pair.BossAt=97,"same actors and fresh boss snapshot retained")
    V48Assert(Round(pair.CloseDistance,1)=12.6 && Round(pair.FarDistance,1)=87.6,"actual logged geometry reproduces live diagnostic")
    reverse := NBTurretCompare(near,far,boss,29862)
    V48Assert(reverse.Close=near && reverse.CloseClock=7,"spawn order does not decide close/far")
    flipped := NBTurretCompare(far,near,boss,29862,true)
    V48Assert(flipped.Close=near && flipped.CloseClock=11,"explicit alternate orientation changes labels only")
    laterBoss := boss.Clone(),laterBoss.Y := 2565,laterBoss.At := 30000
    moved := NBTurretCompare(far,near,laterBoss,30000)
    V48Assert(moved.Close=far && moved.CloseClock=11,"fresh boss movement changes distance assignment, never physical clock")
    V48Assert(pair.Close=near && pair.CloseClock=7,"original pair remains fixed after later movement")
    V48Assert(!NBTurretCompare(far,near,boss,41766).Ok,"stale boss guard remains active")
    for row in [[-389,2645.09,5],[-364.62,2600.50,3],[-389,2555.90,1],[-439.88,2556.98,11],[-466.12,2600.46,9],[-439.92,2644.09,7]]
        V48Assert(NBTurretSite({X:row[1],Y:row[2],Z:207.94})=row[3],"fixed room orientation " row[3])
    V48Assert(!NBTurretSite({X:-414.75,Y:2600.50,Z:207.94}),"moving/central position remains unlabelled")
    third := NBCandleActor("Rail Turret {4132746381230080}:123|(-364.62,2600.50,207.94,0)|(100/100)",29862)
    fifth := NBFifthNearest([far,near,third],boss,29862)
    V48Assert(fifth.Ok && fifth.Selected=near && fifth.Location=7,"fifth-turret call uses same corrected clock")
}
NBC98PersistedClocks()
{
    ; Site IDs are deliberately stable so v1 cached feedback needs no rewrite.
    f := PANTTestOpening(),PANTTestPulse(f,43500),PANTAttack(f,45500,11,2)
    r := {At:180000,Record:99999,Partial:false},pull := {Boss:"G-NA",Start:0}
    packed := IGCPack(IGCBuild(f.Segment,r))
    V48Assert(packed[1]=1 && packed[7][1][16]=11,"legacy physical site ID and evidence format retained")
    r.BossEvidence := IGCUnpack(packed,pull,r)
    V48Assert(InStr(IGCCheck(pull,r).Text,"1st close failed at 7 o’clock"),"legacy persisted failure presents corrected clock")
    V48Assert(XRDiagnosticJSON(IGCPack(r.BossEvidence))=XRDiagnosticJSON(packed),"reading/repacking never flips stored site a second time")
    rows := IFHTurretRows(IFHModel(PANTTestOpening().Segment))
    V48Assert(rows[1].Text="1st close at 7 o’clock","current overlay and failure agree")
    V48Assert(PANTChoiceText(5)="Went to 6th at 1 o’clock" && PANTText("Turret",0)="Turret failed","alternate turret and unknown-site wording remain consistent")
}
NBC98Settings()
{
    for legacy in [false,true]
        V48Assert(!NBTurretConfiguredFlip(legacy,"1"),"legacy default/workaround both resolve to corrected minimap orientation")
    V48Assert(!NBTurretConfiguredFlip(false,"2") && NBTurretConfiguredFlip(true,"2"),"new explicit orientation preference round-trips")
}

; Private settings, fake audio and hidden native controls only.
IOS109Lifecycle() => V571Isolated(IOS109LifecycleCase)
IOS109LifecycleCase()
{
    global IP,IPM,Audio,soundboardsEnabled
    V48Assert(!IPM.AutoHideOnStop && IPM.AutoShowOnParse,"hide on Stop is opt-in; existing show on Parse stays on")
    V48Assert(IPStartCommit(IP.Live) && IPM.Wanted,"Parse shows chosen overlays")
    IPStop()
    V48Assert(!IP.Active && IPM.Wanted,"default Stop retains visible results")
    IPM.AutoHideOnStop := true
    V48Assert(IPStartCommit(IP.Live),"next session starts")
    V51Feed(IP.Live,0,"Enter",0,V51Source(),"=")
    V51Feed(IP.Live,1000,"Damage",123)
    data := IP.Live,mode := IPM.Mode
    p := IPM.Panel,p.X := 31,p.Y := 47,p.Width := 310
    IPMEnsureGui("Personal",0,p),p.Gui.Show("Hide"),p.Drawn := true
    geometry := [p.X,p.Y,p.Width]
    V48Assert(IPMParserRun("Stop") && !IPM.Wanted && !p.Drawn,"overlay Stop hides visible panel state")
    V48Assert(!DllCall("IsWindowVisible","Ptr",p.Gui.Hwnd),"native panel is hidden")
    V48Assert(data=IP.Live && data.Finished && data.Segments[1].Totals[IPActor(V51Source()).Key].Damage=123,"stopped results are retained and finalized")
    V48Assert(IPM.Mode=mode && p.X=geometry[1] && p.Y=geometry[2] && p.Width=geometry[3],"Stop preserves selected layout and geometry")
    V48Assert(!Audio.Queue.Length && !soundboardsEnabled && !IPM.TimerOn,"visibility does not enable audio or diagnostic timers")
    IPMToggle()
    V48Assert(IPM.Wanted && !IP.Active,"manual Show still permits stopped results")
    IPStop()
    V48Assert(IPM.Wanted,"Stop while already stopped does not hide manually shown results")
    IPM.ParserWarnRestart := false
    V48Assert(IPMParserRun("Start") && IPM.Wanted,"overlay Start uses existing show-on-Parse behavior")
    IPStop(),IPM.AutoShowOnParse := false
    V48Assert(IPStartCommit(IP.Live) && !IPM.Wanted,"separate show-on-Parse opt-out remains respected")
    IPStop(),IPM.Wanted := true,IP.ImportFile := {Fixture:true},IP.Busy := true
    IPStop()
    V48Assert(IP.ImportCancelRequested && IPM.Wanted,"canceling an import does not hide saved-log overlays")
    IP.Busy := false,IP.ImportFile := ""
    IPStopLiveForImport()
    V48Assert(IPM.Wanted,"switching to a saved log is not an explicit Stop")
}

IOS109Deferred() => V571Isolated(IOS109DeferredCase)
IOS109DeferredCase()
{
    global IP,IPM
    IPM.AutoHideOnStop := true,IPStartCommit(IP.Live),IPM.Busy := true
    IPStop()
    V48Assert(IPM.HideOnStopPending && IPM.Wanted,"interrupted repaint queues the hide")
    IPM.Busy := false
    V48Assert(IPMFinishHideOnStop() && !IPM.Wanted && !IPM.HideOnStopPending,"repaint completion applies Stop hide")
    IPStartCommit(IP.Live),IPM.Busy := true,IPStop(),IPM.Busy := false
    V48Assert(IPStartCommit(IP.Live) && IPM.Wanted && !IPMFinishHideOnStop(),"new Parse cancels old pending hide")
    IPM.Busy := true,IPStop(),IPM.Busy := false,IPMToggle(),IPMToggle()
    V48Assert(IPM.Wanted && !IPMFinishHideOnStop(),"manual visibility changes supersede deferred Stop")
    IPStartCommit(IP.Live),IPM.Busy := true,IPStop(),IPM.Busy := false,IPM.AutoHideOnStop := false
    V48Assert(!IPMFinishHideOnStop() && IPM.Wanted && !IPM.HideOnStopPending,"opting out cancels pending hide")
}

IOS109Preferences() => V571Isolated(IOS109PreferencesCase)
IOS109PreferencesCase()
{
    global IPM,SETTINGS_FILE
    IniWrite("keep",SETTINGS_FILE,"Audio","Sentinel")
    IPMLoadSettings()
    V48Assert(!IPM.AutoHideOnStop,"absent setting preserves existing behavior")
    for value in [true,false,true] {
        IPM.AutoHideOnStop := value,IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings()
        V48Assert(IPM.AutoHideOnStop=value && IPM.AutoShowOnParse && !IPM.Wanted,"hide setting roundtrips independently without displaying overlays")
    }
    V48Assert(IniRead(SETTINGS_FILE,"Audio","Sentinel")="keep","unrelated preference preserved")
}

IOS109Controls() => V7839Fixture(IOS109ControlsCase)
IOS109ControlsCase()
{
    global IP,IPM
    IPMOpenSettings(),g := IPM.ConfigGui,c := IPM.AutoHideOnStopControl
    V48Assert(c.Value=0 && IPM.AutoShowOnParseControl.Value=1,"settings clearly expose independent Stop and Start options")
    c.Value := 1
    V48Assert(IPMApplySettings() && IPM.AutoHideOnStop && !IP.Active,"Save enables preference without starting parser")
    IPMOpenSettings()
    V48Assert(c.Value=1,"reopened settings retain the checkbox")
    IPM.AutoShowOnParseControl.GetPos(,&sy,,&sh),c.GetPos(&x,&y,&w,&h)
    V48Assert(y>=sy+sh && y+h<=573,"new control sits below Start and above the action buttons")
    V48Assert(IUMTextWidth(c.Text,SendMessage(0x31,0,0,c.Hwnd))+24<=w*A_ScreenDPI/96,"checkbox label fits the native font")
    V48Assert(!DllCall("IsWindowVisible","Ptr",g.Hwnd),"settings stay hidden in test mode")
}

IOS109Timers() => V652TimerOverlayIsolated(IOS109TimersCase)
IOS109TimersCase(path)
{
    global IP,IPM,IRT,IRTPrefs
    IPM.AutoHideOnStop := true,IP.Active := true,IPM.Wanted := true
    active := IRT.Active.Count,alerts := IRT.Alerts.Length
    IPStop()
    vis := IRTUOverlayVisibility(IPM,IRTPrefs,IRT,{Preview:false,Alert:"Move away"},true)
    V48Assert(!IPM.Wanted && !vis.Bars && !vis.Warning,"Stop hides timer bars and large warning text")
    V48Assert(IRT.Active.Count=active && IRT.Alerts.Length=alerts && IRT.Enabled,"hiding leaves the timer engine untouched")
    V48Assert(IRTPrefs.ShowBars && IRTPrefs.ShowWarnings,"timer selections remain enabled")
    V48Assert(IPMShowOnParse() && IPM.Wanted,"timer-only selection can be shown again")
    vis := IRTUOverlayVisibility(IPM,IRTPrefs,IRT,{Preview:false,Alert:"Move away"},true)
    V48Assert(vis.Bars && vis.Warning,"Start visibility restores enabled timer displays")
}

; Private fixtures only: evidence compatibility, publication and sorted identity.
I115EvidencePull()
{
    f := PAS56Opening(),a := PAFTestActor("Finisher",3)
    PAS56Kill(f,106000,a,"2020687623487746"),PAS56Kill(f,107000,a,"3066520749998354",12)
    seg := f.Segment
    r := {Key:"@Audit#1",At:200000,Record:999999,From:188000,Source:"NPC",SourceKey:"N:4108140513591296:2:NPC",Partial:false,Rows:[]}
    r.BossEvidence := IGCBuild(seg,r)
    death := {Key:r.Key,Name:"Audit",At:r.At,Order:1,Clock:"00:03:20.000",Record:r.Record}
    player := {Key:r.Key,Name:"Audit",Deaths:1,First:r.At,FirstOrder:1,TimedDeaths:1,TimingComplete:true,RoleMask:2}
    return {Id:1,Name:"Synthetic Scyva",Boss:seg.BossKey,Area:seg.AreaId,Mode:seg.ModeId,Start:seg.Start,End:210000,
        Ended:true,Partial:false,TimingComplete:true,Reason:"audit",RecorderKey:r.Key,Players:Map(r.Key,player),Deaths:[death],
        Progress:"",DeathRecaps:Map(IDTCaseKey(r),r)}
}
I115EvidenceRoundTrip()
{
    f := PAS56Opening(),a := PAFTestActor("Finisher",3)
    PAS56Kill(f,106000,a,"2020687623487746"),PAS56Kill(f,107000,a,"3066520749998354",12)
    x := PAS57RoundTrip(f)
    V48Assert(x.Evidence.Anchors.Length=2,"generated Scyva early kills pass the saved-evidence reader")
    for r in x.Evidence.Anchors
        V48Assert(!RegExMatch(r.Name,"[\r\n]") && InStr(r.Name,"Finisher"),"stored finding keeps attribution without overlay line breaks")
    p := I115EvidencePull(),packed := IDTPack(p.DeathRecaps),copy := IDTUnpack(IGJParse(IGVJson(packed)),p)
    V48Assert(IGVJson(IDTPack(copy))=IGVJson(packed),"generated Scyva findings round trip through actual JSON")
    r := copy[IDTCaseKey(p.Deaths[1])]
    V48Assert(InStr(r.BossEvidence.Anchors[1].Name,"Finisher"),"saved evidence retains the reducer's attribution")
    V48Assert(InStr(IGCCheck(p,r).Text,"Finisher"),"reopened death report can render the saved finding")
}
I115EvidenceLegacy()
{
    p := I115EvidencePull(),packed := IDTPack(p.DeathRecaps)
    for separator in ["`n","`r`n"] {
        legacy := IFHClone(packed),legacy[1][9][7][1][9] := StrReplace(legacy[1][9][7][1][9]," ",separator,,,1)
        copy := IDTUnpack(IGJParse(IGVJson(legacy)),p)
        V48Assert(IGVJson(IDTPack(copy))=IGVJson(packed),"existing multiline Scyva recap normalizes without losing content")
    }
    for kind in ["scyva-early","scyva-catalyst","scyva-ignite","brontes-droids"]
        V48Assert(IGCStoredName("First`nSecond",kind)="First Second","only affected finding labels accept legacy line breaks: " kind)
    for text in ["bad`tlabel","bad`rlabel",4]
        V59ExpectError((*)=>IGCStoredName(text,"brontes-droids"))
    V59ExpectError((*)=>IGCStoredName("First`nSecond","brontes-orb"))
    bad := IFHClone(packed),bad[1][9][7][1][5] := "bad`nsource"
    V59ExpectError((*)=>IDTUnpack(bad,p))
    V59ExpectError((*)=>IGVString("bad`nordinary history label"))
}
I115EvidenceStorage()
{
    root := A_Temp "\Iris115Evidence-" INToken(),DirCreate(root)
    state := INState(),oldHelper := state.TestHelper,oldWorker := state.WorkerHelper
    helper := oldHelper!="" ? oldHelper : A_ScriptDir "\iris-native-engine.exe"
    try {
        for native in [false,true] {
            if native && !FileExist(helper)
                continue
            state.TestHelper := native ? helper : "",state.WorkerHelper := ""
            p := I115EvidencePull(),path := root "\history-" native ".json"
            history := Map("audit",{Key:"audit",Session:"combat_2026-11-03_00_00_00_001",Date:"20261103",Team:"",Pull:p})
            IGVWriteHistory(history,path),next := IGVReadHistory(path)
            IHLoadDetails(next["audit"].Pull)
            V48Assert(IGVJson(IDTPack(next["audit"].Pull.DeathRecaps))=IGVJson(IDTPack(p.DeathRecaps)),"saved details reopen intact; native=" native)
            before := FileRead(path,"UTF-8")
            p.DeathRecaps[IDTCaseKey(p.Deaths[1])].BossEvidence.Anchors[1].SourceName := "bad`tname"
            V59ExpectError((*)=>IGVWriteHistory(history,path))
            V48Assert(FileRead(path,"UTF-8")==before,"invalid new details cannot replace published history; native=" native)
        }
        p := I115EvidencePull(),legacy := IDTPack(p.DeathRecaps)
        legacy[1][9][7][1][9] := StrReplace(legacy[1][9][7][1][9]," ","`n",,,1)
        text := IGVJson(legacy),path := root "\legacy-detail.json",FileAppend(text,path,"UTF-8-RAW")
        p.DeathRecaps := Map(),p.DeathRecapRef := {Path:path,Hash:IHHash(text),Bytes:StrPut(text,"UTF-8")-1}
        IHLoadDetails(p)
        V48Assert(p.DeathRecaps.Count=1 && !InStr(IGVJson(IDTPack(p.DeathRecaps)),"\u000a"),"already-written multiline detail blob reopens through lazy loading")
    }
    finally {
        state.TestHelper := oldHelper,state.WorkerHelper := oldWorker
        ; Unique fixture root only; enumerate direct children, never recursive.
        Loop Files root "\*","D" {
            dir := A_LoopFileFullPath
            Loop Files dir "\*","F"
                FileDelete(A_LoopFileFullPath)
            DirDelete(dir)
        }
        Loop Files root "\*","F"
            FileDelete(A_LoopFileFullPath)
        DirDelete(root)
    }
}
I115BookmarkSort() => V71BookmarkFixture(I115BookmarkSortCase)
I115BookmarkSortCase(root)
{
    b := IBKLoad(),d := V71BookmarkPull()
    d := IBKMark(d,12000,"Zulu"),d := IBKMark(d,18000,"Alpha"),d := IBKMark(d,24000,"Alpha")
    IBKStore(d),IBKOpen(d),lv := b.Controls["List"]
    for column in [1,2] {
        for order in ["Sort","SortDesc"] {
            lv.ModifyCol(column,order)
            Loop lv.GetCount() {
                row := A_Index,id := lv.GetText(row,3),IBKSelect(lv,row,true)
                mark := b.Editor.Marks[b.SelectedMark]
                V48Assert(mark.Id==id,"selection/navigation resolves the native sorted row's stable identity")
                V48Assert(b.Controls["Label"].Value=lv.GetText(row,2) && Format("{:.3f}",(mark.At-d.Start)/1000)=b.Controls["Time"].Value,"editor matches sorted label and time, including duplicate labels")
            }
        }
    }
    lv.ModifyCol(2,"Sort"),selectedId := lv.GetText(1,3),IBKSelect(lv,1,true),IBKDeleteClick()
    saved := IBKDecode(FileRead(IBKPath(),"UTF-8")).Rows[d.Key]
    V48Assert(saved.Marks.Length=2,"sorted deletion persists exactly one removal")
    for mark in saved.Marks
        V48Assert(mark.Id!=selectedId,"sorted deletion removes the selected identity, retaining the others")
    V48Assert(b.SelectedMark=0,"refresh after deletion clears the former selection")
    lv.ModifyCol(2,"SortDesc"),IBKSelect(lv,1,true)
    V48Assert(b.Editor.Marks[b.SelectedMark].Id==lv.GetText(1,3),"selection remains correct after deletion and another sort")
    IBKRender(),V48Assert(b.SelectedMark=0,"explicit render clears a stale model selection")
}

I115TeamNative(fn) => V769Run(I115TeamNativeCase.Bind(fn))
I115TeamNativeCase(fn,f)
{
    s := INState(),old := s.TestHelper,worker := s.WorkerHelper
    helper := A_ScriptDir "\iris-native-engine.exe"
    if !FileExist(helper)
        helper := A_ScriptDir "\IrisNative\" INEngineVersion() "\iris-native-engine.exe"
    try {
        s.TestHelper := helper,s.WorkerHelper := ""
        V48Assert(INAvailable(),"date-scoped team diagnostics require the native helper")
        h := IGVReadHistory(f.Path)
        h["same-day"] := V645HistoryEntry("same-day","another-recording","20261003","Leave same date",V635Pull())
        h["outside"].Pull := I115EvidencePull()
        IGVWriteHistory(h,f.Path)
        V48Assert(ICSIsManifest(FileRead(f.Path,"UTF-8")),"private fixture uses actual date-bucket storage")
        fn.Call(f)
    }
    finally s.TestHelper := old,s.WorkerHelper := worker
}
I115TeamDates() => I115TeamNative(I115TeamDatesCase)
I115TeamDatesCase(f)
{
    snap := ILPTRead(f.Path),ids := [V769Row(snap,f.First).Id,V769Row(snap,f.Second).Id]
    before := IGVReadHistory(f.Path),packed := Map(),original := ICSManifest(FileRead(f.Path,"UTF-8"),"history")
    for key,e in before
        packed[key] := IGVJson(IGVPackPull(e.Pull))
    result := ILPTAssign(snap,ids,"Together",f.Path)
    V48Assert(result.Dates is Map && result.Dates.Count=2,"multi-date team edit uses only its affected date buckets")
    V48Assert(result.History.Count=4 && !result.History.Has("outside"),"write materializes selected dates, including their unselected recording, but excludes other dates")
    saved := IGVReadHistory(f.Path),current := ICSManifest(FileRead(f.Path,"UTF-8"),"history")
    V48Assert(saved.Count=5 && result.Changed=3,"two selected recordings change exactly three pulls")
    for key,e in saved {
        expected := key="outside" ? "Keep" : key="same-day" ? "Leave same date" : "Together"
        V48Assert(e.Team=expected,"selection preserves unselected recordings on both same and other dates")
        V48Assert(IGVJson(IGVPackPull(e.Pull))==packed[key],"date-scoped save preserves all pull data and recap details")
    }
    for bucket in original[6] {
        if bucket[1]!="20261002"
            continue
        for after in current[6]
            if after[1]=bucket[1]
                V48Assert(IGVJson(after)=IGVJson(bucket),"untouched date retains exactly its original immutable bucket reference")
    }
    next := ILPTAssignedSnapshot(snap,result,ids),fresh := ILPTRead(f.Path)
    V48Assert(V78114TeamEqual(next.History,fresh.History) && V78114TeamEqual(next.Rows,fresh.Rows),"merged picker snapshot matches a complete fresh read")
    result := ILPTAssign(next,[ids[1]],"",f.Path),next := ILPTAssignedSnapshot(next,result,[ids[1]])
    V48Assert(next.History.Count=5 && next.History["1-1"].Team="" && next.History["2-3"].Team="Together","repeat edit uses the committed generation and retains all other headers")
    unchanged := FileRead(f.Path,"UTF-8"),noop := ILPTAssign(next,[ids[1]],"",f.Path)
    V48Assert(noop.Changed=0 && !IsObject(noop.Dates) && FileRead(f.Path,"UTF-8")==unchanged,"no-op does not rewrite a catalogue or pass partial data to the graph")
}
I115TeamDateGuards() => I115TeamNative(I115TeamDateGuardsCase)
I115TeamDateGuardsCase(f)
{
    snap := ILPTRead(f.Path),id := V769Row(snap,f.First).Id,before := FileRead(f.Path,"UTF-8")
    for stage in ["packing","serializing","writing","verifying","before-commit"] {
        state := {Reached:false},failure := ""
        try ILPTAssign(snap,[id],"Must not publish",f.Path,I115TeamStopAt.Bind(state,stage))
        catch Error as err
            failure := err.Message
        V48Assert(state.Reached && failure="Injected private-fixture interruption","requested failure stage reached: " stage " / " failure)
        V48Assert(FileRead(f.Path,"UTF-8")==before,"failure at " stage " leaves published history unchanged")
    }
    state := {Changed:false}
    V59ExpectError((*)=>ILPTAssign(snap,[id],"Must not publish",f.Path,I115TeamConcurrent.Bind(state,f.Path)))
    V48Assert(state.Changed && FileRead(f.Path,"UTF-8")==before " ","concurrent edit before commit is preserved by the generation guard")
}
I115TeamStopAt(state,wanted,stage := "reading")
{
    if stage=wanted {
        state.Reached := true
        throw Error("Injected private-fixture interruption")
    }
}
I115TeamConcurrent(state,path,stage := "reading")
{
    if stage="before-commit" && !state.Changed
        FileAppend(" ",path,"UTF-8"),state.Changed := true
}
I115TeamDateFallback() => I115TeamNative(I115TeamDateFallbackCase)
I115TeamDateFallbackCase(f)
{
    snap := ILPTRead(f.Path),id := V769Row(snap,f.First).Id,old := INState().TestHelper
    try {
        INState().TestHelper := ""
        result := ILPTAssign(snap,[id],"Fallback",f.Path),saved := IGVReadHistory(f.Path)
        V48Assert(!IsObject(result.Dates) && saved.Count=5,"helper absence keeps the complete reference save path")
        V48Assert(saved["1-1"].Team="Fallback" && saved["same-day"].Team="Leave same date" && saved["outside"].Team="Keep","reference fallback preserves same-date and other-date unselected pulls")
        IHLoadDetails(saved["outside"].Pull)
        V48Assert(saved["outside"].Pull.DeathRecaps.Count=1,"fallback preserves untouched death-recap references")
    }
    finally INState().TestHelper := old
}
I115TeamDateWindow() => I115TeamNative(V78114TeamRepeatCase)

; Native suspended diagnostics only. Private INI/state, test queue, no audio pump.
V78124FreshAbilityDefaults()
{
    V78124AssertAbilityDefaults()
    V673RecordFixture(V78124FreshAbilityProfile)
}
V78124AssertAbilityDefaults()
{
    global tauntCalloutEnabled,coTankTauntCalloutEnabled,aoeTauntCalloutEnabled
    global explosiveFuelCalloutEnabled,energyYieldCalloutEnabled,oilSlickCalloutEnabled
    global energyShieldCalloutEnabled,koltoOverloadCalloutEnabled,shieldAdrenalCalloutEnabled,carbonizeCalloutEnabled
    global DarknessAbilityEnabled,CoTankAbilityEnabled,recklessnessTankOnly
    V48Assert(tauntCalloutEnabled && coTankTauntCalloutEnabled && aoeTauntCalloutEnabled,"fresh taunts remain on")
    for value in [explosiveFuelCalloutEnabled,energyYieldCalloutEnabled,oilSlickCalloutEnabled,energyShieldCalloutEnabled,
        koltoOverloadCalloutEnabled,shieldAdrenalCalloutEnabled,carbonizeCalloutEnabled]
        V48Assert(!value,"fresh other personal ability calls are off")
    for key,value in DarknessAbilityEnabled
        V48Assert(!value,"fresh Assassin/Shadow call off: " key)
    for key,value in CoTankAbilityEnabled
        V48Assert(value=(key="Taunt" || key="AOETaunt"),"fresh co-tank choice: " key)
    V48Assert(recklessnessTankOnly,"tank requirement defaults on")
}

V78124FreshAbilityProfile()
{
    global SETTINGS_FILE,RecklessnessTankOnlyCheckbox,TauntCheckbox,AOETauntCheckbox
    global DarknessAbilityCheckboxes,CoTankAbilityCheckboxes,CoTankTauntCheckbox
    V48Assert(!FileExist(SETTINGS_FILE),"new profile has no saved settings")
    LoadSettings(),SyncCalloutCheckboxes()
    V78124AssertAbilityDefaults()
    V48Assert(RecklessnessTankOnlyCheckbox.Value=1,"fresh UI shows tank-only protection")
    V48Assert(TauntCheckbox.Value=1 && AOETauntCheckbox.Value=1 && CoTankTauntCheckbox.Value=1,
        "fresh UI shows enabled taunts")
    for key,checkbox in DarknessAbilityCheckboxes
        V48Assert(checkbox.Value=0,"fresh UI cooldown off: " key)
    for key,checkbox in CoTankAbilityCheckboxes
        V48Assert(checkbox.Value=(key="Taunt" || key="AOETaunt"),"fresh co-tank UI choice: " key)
    V48Assert(!FileExist(SETTINGS_FILE),"reading new defaults does not write preferences")
}

V78124RoleLine(name,id,at := 100000)
{
    return V551Line(at,"@Owner#673|(0,0,0,0)|(100/100)","=","",
        "[DisciplineChanged {836045448953656}: Inquisitor/" name " {" id "}]")
}
V78124RecklessnessRoles() => V673RecordFixture(V78124RecklessnessRolesCase)
V78124RecklessnessRolesCase()
{
    global Audio,playerTankRoles,Roster,localPlayerToken,recklessnessTankOnly
    recklessnessTankOnly := true
    for ability in [["975399957823488","Recklessness"],["3428015262400512","Force Potency"]] {
        for role in [["Darkness","2031339142381582",true],["Kinetic Combat","2031339142381622",true],
            ["Madness","2031339142381586",false],["Corruption","2031339142381584",false]] {
            V7881RepublicSetup()
            V673DispatchFeed(V78124RoleLine(role[1],role[2]))
            V673DispatchFeed(V7881RepublicLine(ability,localPlayerToken,100001))
            V48Assert(Audio.Queue.Length=(role[3] ? 1 : 0),"default role gate: " ability[2] " / " role[1])
        }
        V7881RepublicSetup()
        playerTankRoles.Delete(localPlayerToken),Roster.Members.Delete(localPlayerToken)
        V673DispatchFeed(V7881RepublicLine(ability,localPlayerToken,100001))
        V48Assert(Audio.Queue.Length=0,"unknown local role cannot announce " ability[2])
        V7881RepublicSetup()
        Roster.Members[localPlayerToken].RoleAt := 100002
        V673DispatchFeed(V7881RepublicLine(ability,localPlayerToken,100001))
        V48Assert(Audio.Queue.Length=0,"future role evidence cannot authorize an older activation: " ability[2])
        V7881RepublicSetup()
        V673DispatchFeed(V7881RepublicLine(ability,localPlayerToken,1900001))
        V48Assert(Audio.Queue.Length=1,"confirmed logger tank remains valid after a long idle: " ability[2])
        ResetTauntMetadata(true)
        V48Assert(Audio.Queue.Length=0 && !UniversalAbilityRoleAllowed("Recklessness",localPlayerToken,1900002),
            "zone/source reset clears role evidence and pending " ability[2])
    }
    V7881RepublicSetup(),recklessnessTankOnly := false
    V673DispatchFeed(V78124RoleLine("Corruption","2031339142381584"))
    V673DispatchFeed(V7881RepublicLine(["975399957823488","Recklessness"],localPlayerToken,100001))
    V48Assert(Audio.Queue.Length=1,"explicit opt-out permits an enabled local healer call")
    recklessnessTankOnly := true,RevalidateAudio()
    V48Assert(Audio.Queue.Length=0,"restoring tank requirement retires the queued non-tank call")
    V7881RepublicSetup()
    V673DispatchFeed(V78124RoleLine("Madness","2031339142381586"))
    V673DispatchFeed(V7881RepublicLine(["814218425139200","Energy Shield"],localPlayerToken,100001))
    V48Assert(Audio.Queue.Length=1,"role restriction is specific to Recklessness, not other explicitly enabled abilities")
}

V78124RecklessnessQueue() => V673RecordFixture(V78124RecklessnessQueueCase)
V78124RecklessnessQueueCase()
{
    global Audio,localPlayerToken,recklessnessTankOnly,playerTankRoles,Roster
    V7881RepublicSetup(),recklessnessTankOnly := true
    V673DispatchFeed(V7881RepublicLine(["975399957823488","Recklessness"],localPlayerToken,100001))
    V48Assert(Audio.Queue.Length=1,"confirmed tank can queue Recklessness")
    V673DispatchFeed(V78124RoleLine("Madness","2031339142381586",100002))
    V48Assert(Audio.Queue.Length=0,"fresh DPS metadata removes a previously queued tank call")
    V673DispatchFeed(V78124RoleLine("Darkness","2031339142381582",99999))
    V48Assert(!playerTankRoles[localPlayerToken],"older tank record cannot roll DPS role back")
    V673DispatchFeed(V7881RepublicLine(["3428015262400512","Force Potency"],localPlayerToken,100003))
    V48Assert(Audio.Queue.Length=0,"no announcement after stale tank metadata")
    V7881RepublicSetup()
    V673DispatchFeed(V7881RepublicLine(["975399957823488","Recklessness"],localPlayerToken,100001))
    item := Audio.Queue[1],Audio.Queue := [],Audio.Current := item
    V673DispatchFeed(V78124RoleLine("Corruption","2031339142381584",100002))
    V48Assert(item.Cancel,"fresh healer role cancels the active test owner")
    V7881RepublicSetup()
    V673DispatchFeed(V7881RepublicLine(["3428015262400512","Force Potency"],"@OtherTank#674",100001))
    V48Assert(Audio.Queue.Length=1,"confirmed co-tank mirror is retained")
    V673DispatchFeed(V7881RepublicLine(["975399957823488","Recklessness"],"@OtherDps#675",100002))
    V48Assert(Audio.Queue.Length=1,"other DPS remains excluded")
    V48Assert(ICLStatus("your.Recklessness")="On","confirmed own tank shown ready")
    playerTankRoles[localPlayerToken] := false
    V48Assert(ICLStatus("your.Recklessness")="Needs a confirmed tank role","UI explains why an enabled DPS call stays silent")
}

V78124AbilityPreferences() => V673RecordFixture(V78124AbilityPreferencesCase)
V78124AbilityPreferencesCase()
{
    global SETTINGS_FILE,recklessnessTankOnly,DarknessAbilityEnabled,CoTankAbilityEnabled
    global Audio,localPlayerToken
    V7881RepublicSetup()
    IniWrite(1,SETTINGS_FILE,"Universal","Recklessness")
    IniWrite(0,SETTINGS_FILE,"Universal","EnergyShield")
    recklessnessTankOnly := false
    LoadSettings()
    V48Assert(recklessnessTankOnly,"old settings without the new key get tank-only protection")
    V48Assert(DarknessAbilityEnabled["Recklessness"],"existing explicit enabled choice is preserved")
    V673DispatchFeed(V78124RoleLine("Madness","2031339142381586"))
    V673DispatchFeed(V7881RepublicLine(["975399957823488","Recklessness"],localPlayerToken,100001))
    V48Assert(Audio.Queue.Length=0,"saved enabled legacy choice does not bypass the new role default")
    recklessnessTankOnly := false,SaveSettings(),FlushSettings()
    V48Assert(IniRead(SETTINGS_FILE,"Universal","RecklessnessTankOnly","missing")="0","explicit role opt-out saves")
    recklessnessTankOnly := true,LoadSettings()
    V48Assert(!recklessnessTankOnly,"explicit role opt-out reloads")
    IniWrite(0,SETTINGS_FILE,"Universal","Recklessness")
    LoadSettings()
    V48Assert(!DarknessAbilityEnabled["Recklessness"],"saved disabled choice remains disabled")
    IniWrite(1,SETTINGS_FILE,"CoTankAbilities","AOETaunt")
    IniWrite(0,SETTINGS_FILE,"CoTankAbilities","Recklessness")
    LoadSettings()
    V48Assert(CoTankAbilityEnabled["AOETaunt"] && !CoTankAbilityEnabled["Recklessness"],"independent saved co-tank preferences preserved")
}

V78124AbilityControls() => V673RecordFixture(V78124AbilityControlsCase)
V78124AbilityControlsCase()
{
    global IC,RecklessnessTankOnlyCheckbox,recklessnessTankOnly,SETTINGS_FILE,Audio
    V48Assert(RecklessnessTankOnlyCheckbox.Gui=IC.Pages["Your"].Gui,"role option belongs to Your ability settings")
    recklessnessTankOnly := true,SyncCalloutCheckboxes()
    V48Assert(RecklessnessTankOnlyCheckbox.Value=1,"role checkbox synchronizes on")
    RecklessnessTankOnlyCheckbox.Value := 0,UpdateCalloutControls(),FlushSettings()
    V48Assert(!recklessnessTankOnly && IniRead(SETTINGS_FILE,"Universal","RecklessnessTankOnly","missing")="0",
        "role checkbox saves explicit opt-out")
    RecklessnessTankOnlyCheckbox.Value := 1,UpdateCalloutControls(),FlushSettings()
    V48Assert(recklessnessTankOnly && IniRead(SETTINGS_FILE,"Universal","RecklessnessTankOnly","missing")="1",
        "role checkbox saves restored protection")
    V7881RepublicSetup()
    EnableAllCallouts(),FlushSettings()
    V78124AssertAbilityDefaults()
    V48Assert(IniRead(SETTINGS_FILE,"Universal","Recklessness","missing")="0"
        && IniRead(SETTINGS_FILE,"CoTankAbilities","AOETaunt","missing")="1",
        "standard preset persists quiet cooldowns and enabled taunts")
    V48Assert(Audio.Queue.Length=0 && !IsObject(Audio.Http),"editing preferences does not start audio")
}

V7886TitleArchiveCommand()
{
    cmd := ITTCommand("C:\Private path\pythonw.exe","C:\Private path\title_app.py","C:\Iris","C:\Iris\Data",12345)
    V48Assert(InStr(cmd,'"C:\Private path\pythonw.exe" -E -s -X utf8')=1,"title worker executable is quoted")
    V48Assert(InStr(cmd,'--iris-dir "C:\Iris" --data-dir "C:\Iris\Data"'),"archive and settings roots are explicit")
    V48Assert(InStr(cmd,' --iris-pid 12345'),"title helper follows its launching Iris process")
    bad := false
    try ITTCommand("python" Chr(34),"script","base","data",12345)
    catch
        bad := true
    V48Assert(bad,"untrusted quote cannot alter worker arguments")
    for pid in [0,-1,1.5,0x100000000,"123 --other"] {
        bad := false
        try ITTCommand("python","script","base","data",pid)
        catch
            bad := true
        V48Assert(bad,"invalid parent process cannot launch an unowned title helper")
    }
    V48Assert(!ITTOpen() && ITTState().Pid=0,"diagnostics cannot launch the title UI or scan live logs")
    V48Assert(InStr(ITTCommand("python","script","base","data",12,123),"--iris-window 123"),"helper receives its parent window")
    V48Assert(!InStr(cmd,"--background"),"explicit opening remains visible")
    V48Assert(InStr(ITTCommand("python","script","base","data",12,123,true),"--background"),"automatic title archive starts hidden")
    V48Assert(!ITTAutoStart() && !ITTStart(true),"diagnostics never start the title watcher")
    text := "IRIS-TITLES-1`t" Format("{:064x}",1) "`tDF-BR`t836045448953655`t1793500000000`tC:\archive\log.txt"
    req := ITTParseOpen(text)
    V48Assert(req.Boss="DF-BR" && req.End=1793500000000 && req.Path="C:\archive\log.txt","source request round trips")
    for badText in ["",text "`tstuff",StrReplace(text,"DF-BR","unknown"),StrReplace(text,"1793500000000","-1"),StrReplace(text,"IRIS-TITLES-1","RUN"),StrReplace(text,"log.txt","log`n.txt"),StrReplace(text,"836045448953655","1")] {
        failed := false
        try ITTParseOpen(badText)
        catch
            failed := true
        V48Assert(failed,"malformed open request rejected")
    }
    pull := {Boss:req.Boss,Mode:req.Mode,Result:"Kill",End:Mod(req.End,86400000)},source := {Pulls:[pull]}
    V48Assert(ITTMatchingPull(source,req)=pull,"midnight absolute timestamp maps to saved log clock")
    source.Pulls.Push(pull.Clone())
    V48Assert(!IsObject(ITTMatchingPull(source,req)),"ambiguous source fights are not selected")
    source.Pulls := [{Boss:req.Boss,Mode:req.Mode,Result:"No kill",End:pull.End}]
    V48Assert(!IsObject(ITTMatchingPull(source,req)),"no kill fragment not selected as record")
    V48Assert(ITTReceiveOpen(0,0)=0,"unsolicited sender cannot import a log")
    V761LibraryFixture(V7889TitleOpenCase)
    V75LibraryRun(V7890TitleColdOpen)
    V7844Run(V7890DstPvp)
    V70CacheFixture((root) => V692AnalysisFixture(V7890DstCache))
}

V7890DstCache(a,original,seg,path,text)
{
    global IP
    data := V70CacheImport(path),signature := V596Signature(data),id := IPCIdentity(path,"UTF-8",data.Gap)
    for hours in [-1,1,5] {
        FileSetTime(DateAdd(FileGetTime(path,"M"),hours,"Hours"),path,"M")
        current := IPCIdentity(path,"UTF-8",data.Gap)
        V48Assert(current.Key=id.Key,"timestamp-only changes preserve content cache identity")
        reopened := V70CacheImport(path)
        V48Assert(IP.ImportTiming.Cache="disk hit" && V596Signature(reopened)=signature,"DST cache reopen preserves exact combat results")
        V48Assert(reopened.SourceModified=current.Modified,"restored cache carries current source metadata")
    }
}

V7890DstPvp()
{
    global IP
    f := V7844File(),s := IPVLState(),stamp := f.Modified
    IPVLLoad(),IPVLCommit(f)
    entry := {Source:f,Match:f.Matches[1]}
    for hours in [-1,1,5] {
        f.Modified := DateAdd(stamp,hours,"Hours")
        resolved := IPVLResolveOpen(entry)
        V48Assert(resolved.Source.Modified=stamp && resolved.Source.Matches=f.Matches,"PvP opening accepts unchanged contents across DST/time-zone changes")
        V48Assert(f.Modified!=stamp,"opening does not rewrite catalogue timestamps")
        IP.Offline := V7843WorkerData(f.Path),IP.ImportPath := f.Path,IP.ImportTiming := {}
        IPVLPrepareOpen(resolved,IP.ImportTiming)
        V48Assert(InStr(IPVLSelectPending(IP),"Selected arena match"),"PvP selection survives legacy shifted metadata")
        V48Assert(ILBSourceStatus({Path:f.Path,Source:f})="Indexed","timestamp-only change does not demand reindexing in raid Library")
    }
    IPVLCommit(f)
    IPVLStart([f.Path]),V7844Wait()
    V48Assert(s.Done=0 && s.Skipped=1 && !s.Failed,"PvP existing scan verifies shifted bytes without reparsing matches")
    V48Assert(s.Files[StrLower(f.Path)].Modified=stamp && s.Files[StrLower(f.Path)].Matches.Length=2,"PvP verified metadata refresh retains matches")
    s.Files[StrLower(f.Path)].Modified := DateAdd(stamp,-1,"Hours")
    IPVLStart([f.Path]),SetTimer(IPVLTick,0),IPVLStop("Paused")
    V48Assert(!s.Active && s.Next=1 && !s.PendingFiles.Length,"pause preserves unverified queued source")
    ; An equal length and a one-hour timestamp shift are never proof of identity.
    text := FileRead(f.Path,"UTF-8"),FileDelete(f.Path)
    FileAppend(StrReplace(text,"Player1","Player9"),f.Path,"UTF-8"),FileSetTime(stamp,f.Path,"M")
    V59ExpectError((*)=>IPVLResolveOpen(entry))
    V48Assert(s.Files.Count=1 && f.Matches.Length=2,"changed bytes are rejected without deleting saved arena history")
}

V7890TitleColdOpen()
{
    global IP
    f := V68ReviewFile(true),s := ILBState(),t := ITTState(),old := t.Clone()
    try {
        p := ILBFight(f.State.Segments[1]),p.Result := "Kill"
        source := ILBFile(f.Path,"20261003",FileGetSize(f.Path),FileGetTime(f.Path,"M"),IPCHashFile(f.Path),[p])
        source.Modified := DateAdd(source.Modified,1,"Hours"),oldStamp := source.Modified
        s.Files := Map(StrLower(f.Path),source),s.Loaded := true,s.AutoLoaded := true,s.AutoLive := false
        t.Pending := {Digest:source.Digest,Boss:p.Boss,Mode:p.Mode,End:p.End,Path:f.Path}
        V48Assert(!s.Controls.Count,"title cold fixture has never built Library controls")
        ok := ITTLoadRequested()
        V48Assert(ok,"title opens without Library UI: " (s.HasOwnProp("OpenMessage") ? s.OpenMessage : "no error"))
        IPImportRun()
        V48Assert(IP.ImportDone && IP.Selected=1,"cold title request finishes on selected fight")
        V48Assert(source.Modified=oldStamp && IP.Offline.SourceModified=FileGetTime(f.Path,"M"),"DST verification preserves the catalogue and imports current source metadata")
        IP.Offline := ""
        original := FileRead(f.Path,"RAW"),changed := Buffer(original.Size)
        DllCall("RtlMoveMemory","Ptr",changed,"Ptr",original,"UPtr",original.Size)
        NumPut("UChar",Mod(NumGet(changed,0,"UChar")+1,256),changed,0)
        file := FileOpen(f.Path,"w"),file.RawWrite(changed),file.Close()
        FileSetTime(DateAdd(oldStamp,-1,"Hours"),f.Path,"M")
        t.Pending := {Digest:source.Digest,Boss:p.Boss,Mode:p.Mode,End:p.End,Path:f.Path}
        V48Assert(!ITTLoadRequested() && InStr(s.OpenMessage,"contents changed"),"same-size changed contents remain rejected and explain the error without Library UI")
    } finally {
        if IsObject(IP.ImportFile)
            IP.ImportFile.Close()
        IP.ImportFile := "",IP.ImportRunning := false,IP.Busy := false
        for key,value in old.OwnProps()
            t.%key% := value
        FileDelete(f.Path)
    }
}

V7889TitleOpenCase(e,f)
{
    global IP
    s := ITTState(),saved := s.Clone(),e.Pull.Result := "Kill"
    request := {Digest:e.Source.Digest,Boss:e.Pull.Boss,Mode:e.Pull.Mode,End:e.Pull.End,Path:e.Path}
    try {
        s.Pending := request,ILBState().Busy := true
        V48Assert(!ITTLoadRequested() && !IsObject(IP.ImportFile),"title opening respects queue guards")
        ILBState().Busy := false,s.Pending := request
        V48Assert(ITTLoadRequested() && IsObject(IP.ImportFile),"title request starts actual private log import")
        IPImportRun(),IPRefresh()
        V48Assert(IP.ImportDone && IP.Selected=1 && IP.ImportPath=e.Path,"title request selects its exact saved fight")
        e.Source.Modified := DateAdd(e.Source.Modified,-1,"Hours")
        IP.Selected := IP.Offline.Segments.Length,s.Pending := request
        V48Assert(ITTLoadRequested() && IP.Selected=1 && !IsObject(IP.ImportFile),"title record uses verified loaded log without reparsing")
        IP.Offline := "",fallback := request.Clone(),fallback.End+=123,s.Pending := fallback
        V48Assert(ITTLoadRequested() && IsObject(IP.ImportFile),"reviewed endpoint absent from index still opens the exact source log")
        IPImportRun(),IPRefresh()
        V48Assert(IP.ImportDone && !IsObject(ILBState().Pending),"fallback does not invent a matching pull")
        IP.Offline := "",missing := request.Clone(),missing.Digest := Format("{:064}",0),s.Pending := missing
        V48Assert(!ITTLoadRequested() && !IsObject(IP.ImportFile),"unknown source hash cannot open an arbitrary path")
    } finally {
        for key,value in saved.OwnProps()
            s.%key% := value
    }
}

V7894TitlePublicPackage()
{
    root := A_Temp "\IrisTitlePublic-" DllCall("Kernel32\GetCurrentProcessId","UInt") "-" A_TickCount
    DirCreate(root "\IrisRuntime"),DirCreate(root "\IrisTitleArchive")
    try {
        V59ExpectError((*)=>ITTConfig(root))
        FileAppend("fixture",root "\IrisRuntime\pythonw.exe","UTF-8")
        V59ExpectError((*)=>ITTConfig(root))
        FileAppend("fixture",root "\IrisTitleArchive\title_app.py","UTF-8")
        config := ITTConfig(root)
        V48Assert(config.Python=root "\IrisRuntime\pythonw.exe","a clean install locates its own interpreter")
        V48Assert(config.Script=root "\IrisTitleArchive\title_app.py" && config.Folder=root "\IrisTitleArchive","title modules are local to this package")
        V48Assert(config.Data=root "\IrisTitleArchiveData" && config.AppDir=root,"existing title data stays in its established location")
        V48Assert(!DirExist(config.Data),"config discovery does not create or seed personal data")
        V48Assert(!ITTAutoPreference(root),"an absent auto-add module cannot enable capture")
        FileAppend("fixture",root "\IrisTitleArchive\title_auto.py","UTF-8")
        V48Assert(ITTAutoPreference(root),"a new profile defaults to automatic title additions")
        DirCreate(config.Data)
        IniWrite(0,config.Data "\preferences.ini","Titles","AutoAdd")
        V48Assert(!ITTAutoPreference(root),"an existing opt-out is preserved")
        IniWrite(1,config.Data "\preferences.ini","Titles","AutoAdd")
        V48Assert(ITTAutoPreference(root),"an existing enabled preference is read")
        cmd := ITTCommand(config.Python,config.Script,config.AppDir,config.Data,123,456,true)
        V48Assert(InStr(cmd,'" -E -s -X utf8 "'),"title runtime ignores Python environment and user site overrides")
        V48Assert(!InStr(cmd,"AchievementSearch") && !InStr(cmd,"integration.ini"),"standalone title launch has no other feature dependency")
        for invalid in ["file`nname","file`rname",'file"name']
            V59ExpectError((*)=>ITTQuote(invalid))
        titleMenu := Menu(),ITTAttachMenu(titleMenu),caption := Buffer(128,0)
        V48Assert(DllCall("User32\GetMenuItemCount","Ptr",titleMenu.Handle,"Int")=1,"public Interface menu attachment contains the title entry")
        DllCall("User32\GetMenuStringW","Ptr",titleMenu.Handle,"UInt",0,"Ptr",caption,"Int",64,"UInt",0x400)
        V48Assert(StrGet(caption,"UTF-16")="Timed titles...","title menu is available without a development version gate")
        V48Assert(!ITTAutoEnabled() && !ITTAutoStart(),"native diagnostics cannot launch background title scanning")
    } finally DirDelete(root,true)
}

IWS87Commands()
{
    config := IWSConfig(A_Temp "\Iris launch test","HKCU\Software\IrisSelfTest\Launch",A_ScriptFullPath,A_AhkPath)
    V48Assert(InStr(IWSCommand(config),Chr(34) config.WorkerRuntime Chr(34) " /ErrorStdOut=UTF-8 ")=1,"separate startup executable is quoted")
    V48Assert(InStr(IWSCommand(config),'"' config.Worker '"'),"startup script path is quoted")
    bad := false
    try IWSQuote("bad" Chr(34) "path")
    catch
        bad := true
    V48Assert(bad,"quotes cannot add startup arguments")
    V48Assert(!IWSIsAutomatic([]) && !IWSIsAutomatic(["--self-test"]) && IWSIsAutomatic(["--iris-with-swtor"]),"only explicit automatic launches are hidden")
    V48Assert(IWSAutomaticStartAllowed([],A_ScriptFullPath,A_ScriptHwnd),"manual restart path preserved")
    V48Assert(IWSAutomaticStartAllowed(["--iris-with-swtor"],A_ScriptFullPath,A_ScriptHwnd),"automatic launch excludes itself")
    V48Assert(!IWSAutomaticStartAllowed(["--iris-with-swtor"],A_ScriptFullPath,0),"existing hidden instance blocks automatic launch")
    V48Assert(InStr(IWSRestartCommand()," /restart ") && !InStr(IWSRestartCommand(),"--iris-with-swtor"),"explicit restart clears automatic startup guard")
}
IWS87Preferences()
{
    folder := A_Temp "\IrisStart-" A_TickCount
    registry := "HKCU\Software\IrisSelfTest\Start-" A_TickCount
    config := IWSConfig(folder,registry,A_ScriptFullPath,A_AhkPath)
    try {
        V48Assert(!IWSIsEnabled(config),"fresh installation defaults off")
        V48Assert(IWSSetEnabled(true,config,false) && IWSIsEnabled(config),"explicit enable registers startup")
        V48Assert(FileRead(config.Worker,"UTF-8")=IWSWorkerSource(),"exact embedded watcher is written")
        V48Assert(FileGetSize(config.WorkerRuntime)=FileGetSize(A_AhkPath),"watcher runtime is separate from installed runtime")
        V48Assert(IniRead(config.Ini,"Launch","Target")=A_ScriptFullPath,"watcher follows this installation")
        other := IWSConfig(folder,registry,A_Temp "\another.ahk",A_AhkPath)
        IWSSetEnabled(false,other,false)
        V48Assert(IWSIsEnabled(config),"other installations cannot disable this target")
        V48Assert(!IWSSetEnabled(false,config,false) && !IWSIsEnabled(config),"disable removes startup and signals watcher")
        V48Assert(RegRead(registry,"IrisWithSWTOR","")="","startup entry removed")
        V48Assert(IniRead(config.Ini,"Launch","Enabled")="0","running watcher sees disable")
        V48Assert(IniRead(config.Ini,"Launch","Target")=config.Target && IniRead(config.Ini,"Launch","Interpreter")=config.Interpreter,"disabled watcher retains exact installation ownership for uninstall")
        IWSSetEnabled(true,config,false)
        RegDelete(registry,"IrisWithSWTOR")
        V48Assert(!IWSIsEnabled(config),"externally removed registration is not shown enabled")
        bad := false
        try IWSSetEnabled(true)
        catch
            bad := true
        V48Assert(bad && !IWSToggle(),"diagnostics cannot register or launch real watcher")
    } finally {
        try RegDeleteKey(registry)
        if DirExist(folder)
            DirDelete(folder,true)
    }
}

IWS91Ready()
{
    config := IWSConfig(A_Temp "\IrisReady-" A_TickCount,"HKCU\Software\IrisSelfTest\Ready-" A_TickCount,A_ScriptFullPath,A_AhkPath)
    try {
        V48Assert(!IWSStartupReady([],config,123),"manual starts do not create readiness files")
        V48Assert(!IWSStartupReady(["--iris-with-swtor"],config,123),"older watcher arguments remain supported without acknowledgement")
        V48Assert(!IWSStartupReady(["--iris-with-swtor","../bad"],config,123),"invalid tokens cannot write outside watcher folder")
        V48Assert(!IWSStartupReady(["--iris-with-swtor","1-2-3"],config,123),"disabled configuration cannot acknowledge")
        IWSSetEnabled(true,config,false)
        V48Assert(IWSStartupReady(["--iris-with-swtor","1-2-3"],config,123),"ready app acknowledges matching registration")
        V48Assert(FileRead(config.Folder "\ready-1-2-3.txt","UTF-8")="123","readiness identifies the exact child process")
        V48Assert(!IWSStartupReady(["--iris-with-swtor","1-2-4"]),"diagnostics cannot acknowledge real startup")
        IWSSetEnabled(false,config,false)
        V48Assert(!IWSStartupReady(["--iris-with-swtor","1-2-5"],config,123),"disable during launch is respected")
    } finally {
        try RegDeleteKey(config.Registry)
        if DirExist(config.Folder)
            DirDelete(config.Folder,true)
    }
}

I93StartupPriority()
{
    bookmark := {Path:"private-log.txt",Encoding:"UTF-8",Start:123,Actor:"@Crafter#1"}
    app := IPNewApp(),restore := IPLRNewState(),restore.Enabled := true,restore.Saved := bookmark
    live := IPASNewState(),live.Enabled := true
    V48Assert(!IPLRArm(restore,app,false,true),"game-triggered startup does not arm old-log import")
    V48Assert(!restore.Pending && !restore.Attempted && restore.Saved=bookmark,"saved bookmark and preferences retained for later manual launches")
    V48Assert(IPASArm(live,app) && IPASDecision(live,app)="Start","enabled live parsing can start despite the saved-log preference")
    app := IPNewApp(),live := IPASNewState()
    V48Assert(!IPASArm(live,app),"automatic game startup does not enable parsing against preference")
    restore := IPLRNewState(),restore.Enabled := true,restore.Saved := bookmark
    V48Assert(IPLRArm(restore,app,false,false) && IPLRDecision(restore,app)="Open","manual startup keeps old-log restore behavior")
    restore := IPLRNewState(),restore.Enabled := true,restore.Saved := bookmark
    V48Assert(!IPLRArm(restore,app,true,false) && !IPLRArm(restore,app,true,true),"diagnostics never schedule a real import")
    V48Assert(IWSIsAutomatic(["--iris-with-swtor","1-2-3"]) && !IWSIsAutomatic([]),"watcher and manual launches distinguished")
}

PTG97NPC(instance,x,y := 0,hp := 1000) => "Grace {4078440814739456}:" instance "|(" x "," y ",0,0)|(" hp "/1000)"
PTG97Boss(x := 0) => "TYTH {4078423634870272}:90|(" x ",0,0,0)|(1000/1000)"
PTG97Wave(f,at := 100000,x := 0) => PAFTestFeed(f,at,PTG97Boss(x),"=","4076168777039872","cast","")
PTG97Spawn(f,at,actor) => PAFTestFeed(f,at,actor,PAFTestActor("Tank"),"","event","","836045448953668")
PTG97Key(instance) => IPActor(PTG97NPC(instance,0)).Key
PTG97Labels()
{
    f := V7878FHSegment("G-TY"),PTG97Wave(f),PTG97Spawn(f,100100,PTG97NPC(1,20))
    PAFTestFeed(f,106000,PTG97NPC(1,20),PTG97Boss(),"4071199499878400","heal")
    m := IFHModel(f.Segment),v := IFHView(f.Segment,m,false,106000)
    V48Assert(v.Findings.Length=1 && v.Findings[1].Text="Primary Grace healed Tyth","single Grace heal is primary")
    V48Assert(!IFHView(f.Segment,m,true,108099).Findings.Length && IFHView(f.Segment,m,true,108100).Findings.Length=1,"live findings use the existing settling delay")
    PTG97Wave(f,120000),PTG97Spawn(f,120100,PTG97NPC(2,30)),PTG97Spawn(f,120100,PTG97NPC(3,8))
    PAFTestFeed(f,126000,PTG97NPC(2,1),PTG97Boss(30),"4071199499878400","heal")
    PAFTestFeed(f,126001,PTG97NPC(3,100),PTG97Boss(30),"4071199499878400","heal")
    s := IFHModel(f.Segment).Findings
    V48Assert(PTGLabel(s,PTG97Key(2))="Secondary Grace" && PTGLabel(s,PTG97Key(3))="Primary Grace","reversed arrival order ranks spawn distance; later movement cannot swap labels")
    V48Assert(PTGLabel(s,PTG97Key(1))="Primary Grace","earlier wave identity survives a new wave")
    PAFTestFeed(f,127000,PTG97NPC(2,1),"=","4088443793571840","cast")
    PAFTestFeed(f,127001,PTG97NPC(3,100),"=","4088443793571840","cast")
    PAFTestFeed(f,127500,PAFTestActor("Interrupter"),PTG97NPC(2,1),"4088443793571840","kick")
    PAFTestFeed(f,127501,PAFTestActor("Interrupter"),PTG97NPC(2,1),"4088443793571840","kick")
    PAFTestFeed(f,128000,PTG97NPC(3,100,0,0),"","4088443793571840","kick")
    v := IFHView(f.Segment,IFHModel(f.Segment),false,130000)
    V48Assert(v.Findings.Length=5 && v.Findings[4].Text="Secondary Grace DR interrupted" && v.Findings[5].Text="Primary Grace DR interrupted","targeted and dead-Grace interruption identities stay distinct and duplicate kicks collapse")
    V48Assert(v.Rows[1].Text="2 primary, 1 secondary went out" && v.Rows[2].Text="1 primary, 1 secondary interrupted","summary totals retain completed event counts by Grace")
}
PTG97Guards()
{
    f := V7878FHSegment("G-TY"),PTG97Spawn(f,100000,PTG97NPC(1,5))
    V48Assert(PTGLabel(IFHModel(f.Segment).Findings,PTG97Key(1))="Grace","mid-wave entry cannot establish a single-Grace spawn")
    PTG97Wave(f,120000),PTG97Spawn(f,125000,PTG97NPC(2,10)),PTG97Spawn(f,125000,PTG97NPC(3,20))
    V48Assert(PTGLabel(IFHModel(f.Segment).Findings,PTG97Key(2))="Grace","stale boss position does not decide primary")
    PAFTestFeed(f,125100,PTG97Boss(),"=","1","cast","")
    V48Assert(PTGLabel(IFHModel(f.Segment).Findings,PTG97Key(2))="Primary Grace","fresh boss position immediately after spawn is accepted")
    PTG97Wave(f,140000),PTG97Spawn(f,140100,PTG97NPC(4,10)),PTG97Spawn(f,140100,PTG97NPC(5,-10))
    V48Assert(PTGLabel(IFHModel(f.Segment).Findings,PTG97Key(4))="Grace","equidistant spawn does not invent a primary")
    PTG97Wave(f,160000),PTG97Spawn(f,160100,"Grace {4078440814739456}:6"),PTG97Spawn(f,160100,PTG97NPC(7,30))
    PTG97Spawn(f,165000,PTG97NPC(6,10))
    V48Assert(PTGLabel(IFHModel(f.Segment).Findings,PTG97Key(7))="Grace","missing initial position cannot be filled with later movement")
    PTG97Wave(f,180000),PTG97Spawn(f,180100,PTG97NPC(8,8)),PTG97Spawn(f,180100,PTG97NPC(9,20))
    for i in [8,9]
        PAFTestFeed(f,185000,PTG97NPC(i,10),"=","4088443793571840","cast")
    PAFTestFeed(f,185100,PAFTestActor("Interrupter"),"","4088443793571840","kick")
    v := IFHView(f.Segment,IFHModel(f.Segment),false,188000)
    V48Assert(v.Findings.Length=1 && v.Findings[1].Text="Grace DR interrupted","ambiguous simultaneous casts retain interruption without guessing a Grace")
    PTG97Wave(f,200000),PTG97Spawn(f,205000,PTG97NPC(10,10)),PTG97Spawn(f,205000,PTG97NPC(11,20))
    PAFTestFeed(f,209000,PTG97Boss(30),"=","1","cast","")
    V48Assert(PTGLabel(IFHModel(f.Segment).Findings,PTG97Key(10))="Grace","late boss movement never backfills the spawn reference")
}
PTG97Replay()
{
    f := V7878FHSegment("G-TY"),PTG97Wave(f),PTG97Spawn(f,100100,PTG97NPC(1,5)),PTG97Spawn(f,100100,PTG97NPC(2,30))
    PAFTestFeed(f,105000,PTG97NPC(2,30),PTG97Boss(),"4071199499878400","heal")
    before := XRDiagnosticJSON(IFHView(f.Segment,IFHModel(f.Segment),false,109000))
    rows := IBCOrdered(f.Segment.Assistance.Events),reversed := V7878FHSegment("G-TY")
    Loop rows.Length {
        x := rows[rows.Length-A_Index+1]
        IFHSafeObserve(reversed.Segment,x.Event,x.At)
    }
    IFHSafeObserve(reversed.Segment,x.Event,x.At)
    V48Assert(XRDiagnosticJSON(IFHView(reversed.Segment,IFHModel(reversed.Segment),false,109000))=before,"late/duplicate journal records rebuild identical Grace identities")
    f.Segment.LastOutput := f.Segment.Last,IPBBeginUndo(f.Data,f.Segment)
    PTG97Wave(f,120000),PTG97Spawn(f,120100,PTG97NPC(3,20))
    PAFTestFeed(f,125000,PTG97NPC(3,20),PTG97Boss(),"4071199499878400","heal")
    IPBRollbackTail(f.Data,f.Segment)
    V48Assert(XRDiagnosticJSON(IFHView(f.Segment,IFHModel(f.Segment),false,109000))=before,"rollback removes provisional wave, identity and failure")
    IFHRetire(f.Segment)
    V48Assert(XRDiagnosticJSON(IFHView(f.Segment,IFHModel(f.Segment),false,109000))=before,"retiring the pull preserves identity and findings")
    line := V671FloorLine(56001,PTG97Boss(15),PTG97NPC(7,30),"0","836045448945472","836045448953668","")
    e := IPParseLine(line)
    result := {Actors:Map(1,e.Source,2,e.Target),Descriptors:Map(1,[e.Ability,e.AbilityId,e.Kind,e.Effect,e.ActionId,e.EffectId,e.AreaId,e.ModeId]),Extras:Map()}
    r := [56001,1,0,0,line,99,56001,1,2,1,e.Amount,e.Effective,e.EffectiveSource,e.Crit,e.ValueOK,e.TargetAlive,
        e.SourceHP.Known,e.SourceHP.Current,e.SourceHP.Maximum,e.TargetHP.Known,e.TargetHP.Current,e.TargetHP.Maximum,
        e.Threat.Expected,e.Threat.Known,e.Threat.Invalid,e.Threat.Value,e.Immune,e.FullAbsorb,"","",0,"",-1]
    native := IANativeRow(r,result)
    V48Assert(XRDiagnosticJSON(e.GracePositions)=XRDiagnosticJSON(native.GracePositions),"native saved analysis and AHK parsing retain identical Grace and Tyth positions")
    data := {BaseVerified:true,Demo:false,ReviewPull:{},Rows:[]}
    ; Saved review consumes these same accepted Analysis rows through IFHObserve.
    for row in rows {
        ev := row.Event.Clone(),ev.Analysis := {Accepted:true,At:row.At,Seq:row.Record}
        data.Rows.Push(ev)
    }
    saved := IFHNew("G-TY")
    for ev in data.Rows
        IFHObserve(saved,ev,ev.Analysis.At,ev.Analysis.Seq)
    V48Assert(XRDiagnosticJSON(IFHView(f.Segment,saved,false,109000))=before,"saved ordered observations match live journal findings")
}

PTG108Fixture()
{
    f := V7878FHSegment("G-TY"),PTG97Wave(f),PTG97Spawn(f,100100,PTG97NPC(1,5)),PTG97Spawn(f,100100,PTG97NPC(2,30))
    Loop 7
        PAFTestFeed(f,101000+A_Index*1000,PTG97NPC(A_Index<=4 ? 1 : 2,10),PTG97Boss(),"4071199499878400","heal")
    Loop 3 {
        id := A_Index<=2 ? 1 : 2,at := 110000+A_Index*2000
        PAFTestFeed(f,at,PTG97NPC(id,10),"=","4088443793571840","cast")
        PAFTestFeed(f,at+100,PAFTestActor("Interrupter"),PTG97NPC(id,10),"4088443793571840","kick")
    }
    return f
}
PTG108Summary()
{
    f := PTG108Fixture(),m := IFHModel(f.Segment)
    for live in [false,true] {
        v := IFHView(f.Segment,m,live,120000)
        V48Assert(v.Rows.Length=2,"ten Grace events use only two pinned summary rows")
        V48Assert(v.Rows[1].Label="Heals" && v.Rows[1].Text="4 primary, 3 secondary went out","heal summary separates the primary and secondary totals")
        V48Assert(v.Rows[2].Label="DR" && v.Rows[2].Text="2 primary, 1 secondary interrupted","DR summary separates interruption totals")
        for r in v.Rows
            V48Assert(r.At=0 && r.Color="FFFFFF","Grace summaries are pinned white text")
        V48Assert(v.Findings.Length=10,"detailed Grace events are retained independently of overlay rows")
    }
    ; Do not silently assign a targetless interrupt to either Grace.
    PAFTestFeed(f,121000,PTG97NPC(1,10),"=","4088443793571840","cast")
    PAFTestFeed(f,121001,PTG97NPC(2,10),"=","4088443793571840","cast")
    PAFTestFeed(f,121100,PAFTestActor("Interrupter"),"","4088443793571840","kick")
    v := IFHView(f.Segment,IFHModel(f.Segment),false,125000)
    V48Assert(v.Rows[2].Text="2 primary, 1 secondary, 1 unknown interrupted","unknown Grace still contributes without inventing an identity")
    fresh := V7878FHSegment("G-TY"),model := IFHNew("G-TY")
    v := IFHView(fresh.Segment,model,true,100000)
    V48Assert(v.Rows.Length=2 && v.Rows[1].Text="0 primary, 0 secondary went out" && v.Rows[2].Text="0 primary, 0 secondary interrupted","new pull resets both totals")
}
PTG108Overlay()
{
    global IP,IPM
    savedIP := IP,savedIPM := IPM
    try {
        IP := IPNewApp(),IPM := IPMNewState(),IPM.Editing := true
        f := PTG108Fixture(),boss := PTG97Boss(),add := PAFTestNPC("4078445109706752",80)
        PAFTestRage(f,120000,boss,1)
        PAFTestFeed(f,120001,boss,PAFTestActor("Tank"),"","event","","836045448953668")
        PAFTestFeed(f,120100,boss,add,"4080279060742144")
        PAFTestFeed(f,120101,PAFTestNPC("4078445109706752",80,0),"=","1","death","")
        PAFTestRage(f,120102,boss,4)
        v := IFHView(f.Segment,IFHModel(f.Segment),false,125000)
        V48Assert(v.Rows.Length=4 && v.Findings.Length=11,"Rage, two Grace summaries and one actual cleave row replace the Grace flood")
        V48Assert(v.Rows[4].Color="FF9CA8" && InStr(v.Rows[4].Text,"Tank"),"tank cleave retains its red timestamped finding")
        p := IPM.Panels["FightFeedback"],p.Width := 350,p.Height := 250,p.AutoHeight := false
        IPMEnsureGui("FightFeedback",0,p)
        IXFRender({},p,v,"Progression Assistance")
        V48Assert(p.FeedbackState.Pin=3 && p.FeedbackState.Visible.Length=4,"native renderer pins the summaries and leaves the cleave visible")
        V48Assert(p.Rows[2].Name.Text="4 primary, 3 secondary went out" && p.Rows[3].Name.Text="2 primary, 1 secondary interrupted","native overlay displays cumulative Grace counts")
        V48Assert(p.Rows[4].Name.Visible && !p.Rows[5].Name.Visible,"no individual Grace rows consume finding space")
    }
    finally {
        IPMRetirePanels(IPMAllPanels()),IP := savedIP,IPM := savedIPM
    }
}

; Native editor and XML tests run with temporary settings and no game input.
I95TimerPanelEditor() => V65UITimerIsolated(I95TimerPanelEditorCase)
I95TimerPanelEditorCase(path)
{
    global IRT,IRTPrefs
    library := IRTLibraryPath()
    try {
        ; Representative ungrouped proc rule, not the reporter's unseen XML.
        d := IRTDefinition("Raze"),d.Enabled := true,d.Interval := 10000,d.Color := "AA88E8"
        d.Trigger := IRTCondition("EFFECT_GAINED"),d.Trigger.Target := "@Self",d.Trigger.Effect := "Raze"
        IRTConfigure(IRT,[d]),IRTShowManager()
        before := IRTSerializeXML(IRT.Definitions)
        e := IRTEOpen(d,d.Id)
        V48Assert(e.Controls["Panel"].Text="Automatic" && IRTSTimerPanel(d)="Boss","ungrouped custom proc exposes its current automatic assignment")
        e.Controls["Panel"].Choose(3)
        draft := IRTEReadDraft(e)
        V48Assert(draft.Panel="Personal" && IRTSTimerPanel(draft)="Personal","editor can override ungrouped proc as personal")
        V48Assert(draft.Trigger.Type=d.Trigger.Type && draft.Trigger.Target=d.Trigger.Target && draft.Trigger.Effect=d.Trigger.Effect && draft.Interval=d.Interval,"panel selection leaves the actual trigger and duration intact")
        IRTEClose()
        V48Assert(IRTSerializeXML(IRT.Definitions)==before && !FileExist(library),"cancel does not change routing or save a file")
        e := IRTEOpen(d,d.Id),e.Controls["Panel"].Choose(3)
        V48Assert(IRTESave(),"native editor saves personal choice")
        saved := IRTParseXML(FileRead(library,"UTF-8")).Definitions[1]
        V48Assert(saved.Panel="Personal" && saved.Trigger.Target="@Self" && saved.Trigger.Effect="Raze","saved XML keeps panel and proc condition")
        V48Assert(IRTUSelected().Panel="Personal" && IRTPrefs.PanelChoice.Text="Personal timers","manager and its quick selector reflect editor choice")
        IRTLoadLibrary(),IRTURefreshManager(d.Id),d := IRTUSelected()
        e := IRTEOpen(d,d.Id)
        V48Assert(e.Controls["Panel"].Text="Personal timers" && IRTSTimerPanel(d)="Personal","personal assignment survives complete library reload and editor reopen")
        e.Controls["Panel"].Choose(2)
        V48Assert(IRTESave() && IRTUSelected().Panel="Boss","editor also supports an explicit boss assignment")
        d := IRTUSelected(),e := IRTEOpen(d,d.Id),e.Controls["Panel"].Choose(1)
        V48Assert(IRTESave() && IRTUSelected().Panel="Auto","editor can restore automatic routing")
        V48Assert(!InStr(IRTSerializeXML([IRTUSelected()]),"irisPanel"),"automatic removes the XML override")
        d := V65IDef("Built-in","Built-in: Tests"),d.Builtin := true
        IRTConfigure(IRT,[d]),IRTURefreshManager(d.Id),e := IRTEOpen(d,d.Id)
        V48Assert(e.Controls["Panel"].Enabled && !e.Controls["Interval"].Enabled,"built-in panel selection is editable while mechanics remain locked")
        e.Tab.Choose(2),IRTEApplyLocks(e)
        V48Assert(!e.Controls["TriggerType"].Enabled,"built-in trigger stays locked on its active tab")
        e.Tab.Choose(1),IRTEApplyLocks(e)
        e.Controls["Panel"].Choose(3),draft := IRTEReadDraft(e)
        draft.Interval := 1,draft.Trigger.Ability := "wrong"
        out := IRTEPrepare([d],d.Id,draft).Definitions[1]
        V48Assert(out.Panel="Personal" && out.Interval=d.Interval && out.Trigger.Ability=d.Trigger.Ability,"built-in limited edit allows panel only without changing mechanic")
        V48Assert(IRTESave(),"built-in editor can persist panel override")
        merged := IRTMergeDefinitions([d],IRTParseXML(FileRead(library,"UTF-8")),true)
        V48Assert(merged.Definitions[1].Panel="Personal","built-in panel survives override import")
    } finally {
        IRTEClose()
        for file in [library,library ".bak"]
            try FileDelete(file)
    }
}

; Offscreen synthetic main workspace; no live app, imports, settings or input.
I129WorkspaceResume() => V58Isolated(I129WorkspaceResumeCase)

I129GeometryMatches(g)
{
    global IP
    u := IPWState(),g.GetClientPos(,,&w,&h),l := IPWLayout(w,h)
    u.Controls["Tabs"].GetPos(&tx,&ty,&tw,&th)
    IP.Footer.GetPos(&fx,&fy,&fw,&fh)
    return u.Width=l.W && u.Height=l.H
        && Abs(tx-l.Right)<=1 && Abs(ty-l.TabY)<=1 && Abs(tw-l.RightW)<=1 && Abs(th-l.TabH)<=1
        && Abs(fx-12)<=1 && Abs(fy-l.FooterY)<=1 && Abs(fw-(l.W-24))<=1 && Abs(fh-17)<=1
}

I129Activate(g)
{
    SendMessage(0x6,1,0,g.Hwnd)
    SetTimer(IWResumePaintPending,0)
    IWResumePaintPending()
    SetTimer(IWResumePaintPending,0)
}

I129WorkspaceResumeCase()
{
    global IP,SELF_TEST,SETTINGS_FILE,Audio
    V48Assert(SELF_TEST,"workspace resume requires isolated diagnostics")
    V58UseFixture(),V58SelectTab(7)
    g := IP.Gui,u := IPWState(),state := IWResumePaintState(),old := state.Clone()
    foreground := DllCall("User32\GetForegroundWindow","Ptr")
    data := IPCsvData(IP.Live,IP.Live.Segments[1]),actor := IP.Actor,selected := IP.Selected,tab := u.Tab
    settings := FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "",audioCount := Audio.Queue.Length
    try {
        g.Opt("+E0x08000000 +ToolWindow +MaxSize10000x10000")
        state.NativeTestHwnd := g.Hwnd,state.Pending := Map(),state.Installed := false
        IWResumePaintInstall()
        scale := A_ScreenDPI/96
        g.Show("NA x-16000 y-16000 w" Max(1600,Round(3814/scale)) " h" Max(1000,Round(2026/scale))),Sleep(-1)
        g.GetClientPos(,,&cw,&ch)
        rect := Buffer(16),DllCall("User32\GetClientRect","Ptr",g.Hwnd,"Ptr",rect)
        V48Assert(Abs(cw*scale-NumGet(rect,8,"Int"))<=scale && Abs(ch*scale-NumGet(rect,12,"Int"))<=scale,"client query already uses logical GUI units")
        V48Assert(cw>1220 && ch>780,"native window exceeds stale restore dimensions")
        IPResize(g,0,1220,780),before := state.Layouts
        V48Assert(!I129GeometryMatches(g),"old controls occupy only part of the real larger client")
        I129Activate(g)
        V48Assert(I129GeometryMatches(g) && state.Layouts=before+1,"return activation repairs stale cache and native control geometry once")
        I129Activate(g)
        V48Assert(state.Layouts=before+1 && !state.Pending.Count,"already-correct activation does not repeat layout")

        IPResize(g,0,1220,780),u.Width := cw,u.Height := ch,u.Layout := IPWLayout(cw,ch)
        I129Activate(g)
        V48Assert(I129GeometryMatches(g) && state.Layouts=before+2,"native control sentinels repair a cache that is already current")

        IPResize(g,0,1220,780),IP.Rendering := true,I129Activate(g)
        V48Assert(state.Pending.Count=1 && u.Width=1220,"rendering defers reconciliation")
        IP.Rendering := false,IWResumePaintPending(),SetTimer(IWResumePaintPending,0)
        V48Assert(I129GeometryMatches(g),"deferred recovery runs after rendering")
        IPResize(g,0,1220,780),u.LayoutBusy := true,I129Activate(g)
        V48Assert(state.Pending.Count=1 && u.Width=1220,"active layout defers reconciliation")
        u.LayoutBusy := false,IWResumePaintPending(),SetTimer(IWResumePaintPending,0)
        V48Assert(I129GeometryMatches(g),"deferred recovery runs after layout")
        u.LayoutBusy := true,IPResize(g,0,cw,ch)
        V48Assert(u.LayoutBusy && I129GeometryMatches(g),"nested layout preserves the caller's busy marker without discarding Size work")
        u.LayoutBusy := false

        ; Force an ordinary control-layout error after the size cache is updated.
        IPResize(g,0,1220,780),rule := u.Controls["Rule"],status := IP.Status
        try {
            u.Controls["Rule"] := "",ok := IPResize(g,0,cw,ch)
            V48Assert(!ok && !u.LayoutBusy && InStr(IP.Status,"Workspace layout error:"),"layout failure releases its busy marker")
        }
        finally u.Controls["Rule"] := rule,IP.Status := status,IP.StatusText.Text := status
        I129Activate(g)
        V48Assert(I129GeometryMatches(g),"next activation repairs the partial layout after its control is restored")

        g.Hide(),IPResize(g,0,1220,780),I129Activate(g)
        V48Assert(u.Width=1220 && !DllCall("User32\IsWindowVisible","Ptr",g.Hwnd),"hidden workspace is neither shown nor resized")
        g.Show("NA"),DllCall("User32\ShowWindow","Ptr",g.Hwnd,"Int",7),Sleep(-1)
        IPResize(g,0,1220,780),I129Activate(g)
        V48Assert(DllCall("User32\IsIconic","Ptr",g.Hwnd) && u.Width=1220,"minimized workspace is neither restored nor resized")
        V48Assert(IPCsvData(IP.Live,IP.Live.Segments[1])=data && IP.Actor=actor && IP.Selected=selected && u.Tab=tab,"recorded data and selections survive every recovery")
        V48Assert(!IP.Active && !IP.Timer && !IsObject(IP.ImportFile) && Audio.Queue.Length=audioCount,"recovery starts no parser, import, pump or audio")
        V48Assert((FileExist(SETTINGS_FILE) ? FileRead(SETTINGS_FILE) : "")=settings,"recovery writes no preferences")
        V48Assert(DllCall("User32\GetForegroundWindow","Ptr")=foreground,"offscreen window and recovery never take foreground")
    }
    finally {
        IP.Rendering := false,u.LayoutBusy := false
        IWResumePaintShutdown()
        for key,value in old.OwnProps()
            state.%key% := value
        if old.Installed
            OnMessage(0x6,IWResumePaintMessage),OnExit(IWResumePaintShutdown,-1)
    }
}

; Audit regressions use detached state and parsed synthetic events only.
Audit132TimerChainContext()
{
    for type in ["TIMER_STARTED","TIMER_FINISHED"] {
        for action in ["Trigger","Cancel"] {
            for field in ["Boss","Mode","Size"] {
                matching := field="Boss" ? "Tyth" : field="Mode" ? "HM" : "Eight"
                other := field="Boss" ? "Brontes" : field="Mode" ? "NiM" : "Sixteen"
                for scenario in [[matching,matching,true],[other,matching,false],[matching,"",false],["","",true]] {
                    parent := V65TimerDef("Audit parent",1000),child := V65TimerDef("Audit child",20000)
                    c := IRTCondition(type),c.Timer := parent.Name,c.%field% := scenario[1],child.%action% := c
                    parsed := IRTParseXML(IRTSerializeXML([parent,child])).Definitions
                    V48Assert(parsed.Length=2 && parsed[2].Supported && parsed[2].%action%.%field%==scenario[1],
                        "linked condition preserves supported " field " filter through XML")
                    parent := parsed[1],child := parsed[2],s := V65TimerState(parsed),s.%field% := scenario[2]
                    if action="Cancel"
                        IRTStart(s,child,s.Now)
                    IRTStart(s,parent,s.Now)
                    if type="TIMER_FINISHED"
                        IRTPump(s,101000,false)
                    active := s.Active.Has(child.Id Chr(30)),expected := action="Trigger" ? scenario[3] : !scenario[3]
                    V48Assert(active=expected,type " " action " honors " field " configured='" scenario[1] "' current='" scenario[2] "'")
                }
            }
            parent := V65TimerDef("Alias parent",1000),child := V65TimerDef("Alias child",20000)
            c := IRTCondition(type),c.Timer := parent.Name,c.Boss := "Brontes",c.Mode := "NiM",c.Size := "Eight",child.%action% := c
            s := V65TimerState([parent,child]),s.Boss := "Dread Master Brontes",s.Mode := "NiM",s.Size := "Eight"
            if action="Cancel"
                IRTStart(s,child,s.Now)
            IRTStart(s,parent,s.Now)
            if type="TIMER_FINISHED"
                IRTPump(s,101000,false)
            V48Assert(s.Active.Has(child.Id Chr(30))=(action="Trigger"),"matching combined filters retain boss alias support")
        }
    }
}

Audit132TimerChainLifecycle()
{
    parent := V65TimerDef("Parent",1000),child := V65TimerDef("Child",20000,"TIMER_STARTED","unrelated")
    child.Trigger.Timer := parent.Name,child.Trigger.Boss := "Tyth",child.Trigger.Source := "Unrelated actor"
    s := V65TimerState([parent,child]),s.Boss := "TYTH",ev := V65TimerEvent()
    ev.IRTTriggerAt := 100000,ev.IRTTriggerBoss := "Tyth"
    IRTStart(s,parent,100000,ev)
    inst := s.Active[child.Id Chr(30)]
    V48Assert(inst.Start=100000 && inst.Due=120000 && inst.Event=ev,
        "timer links preserve original time/evidence without treating origin actor/ability as the linked event")
    child.Trigger.Timer := "Different parent",s := V65TimerState([parent,child]),s.Boss := "TYTH"
    IRTStart(s,parent,100000)
    V48Assert(!s.Active.Has(child.Id Chr(30)),"matching context cannot replace required parent timer identity")

    child.Trigger.Timer := parent.Name,child.Trigger.Source := "",child.Cancel := IRTCondition("TIMER_STARTED")
    child.Cancel.Timer := parent.Name,child.Cancel.Boss := "Tyth"
    next := V65TimerDef("After child",30000,"TIMER_STARTED"),next.Trigger.Timer := child.Name
    s := V65TimerState([parent,child,next]),s.Boss := "TYTH"
    IRTStart(s,child,99000),IRTStop(s,next.Id),IRTStart(s,parent,100000)
    V48Assert(s.Active[child.Id Chr(30)].Start=100000 && s.Active[next.Id Chr(30)].Start=100000,
        "matching chain cancels before starting so the replacement emits its own start event")
    child.Trigger.Timer := "Different parent",s := V65TimerState([parent,child]),s.Boss := "TYTH",s.Now := 102000
    IRTStart(s,child,102000),IRTStart(s,parent,100000)
    V48Assert(s.Active[child.Id Chr(30)].Start=102000,"historical matching cancellation still protects a newer timer instance")

    parent := V65TimerDef("Timed parent",1000),child := V65TimerDef("After finish",20000,"TIMER_FINISHED")
    child.Trigger.Timer := parent.Name,child.Trigger.Boss := "Tyth"
    s := V65TimerState([parent,child]),s.Boss := "TYTH"
    IRTStart(s,parent,100000),s.Boss := "Brontes",IRTPump(s,101000,false)
    V48Assert(!s.Active.Has(child.Id Chr(30)),"finish checks current encounter context before starting its child")
    s := V65TimerState([parent,child]),s.Boss := "TYTH"
    IRTStart(s,parent,100000),IRTPump(s,101000,false)
    V48Assert(s.Active[child.Id Chr(30)].Start=101000 && s.Active[child.Id Chr(30)].Due=121000,
        "matching finish retains the exact deadline with no originating event required")
}

Audit132UtilityDeathVictim()
{
    who := "@Audit healer#1",other := "@Other healer#2"
    for target in ["Audit NPC {900}:1","@Other#2/Companion {901}:2","Explicit unrecognized actor"] {
        s := IRUNewState(),V67UtilityMeta(s,0,who,"Corruption")
        line := IPDemoLine(1000,who,target,"Death"),ev := IPParseLine(line)
        V48Assert(IsObject(ev) && ev.Kind="Death" && ev.Target.Key!="?" && ev.Target.Kind!="Player",
            "death fixture has an explicit non-player target")
        IRUObserve(s,ev,1000,line,1000,"fixture","@Owner#1")
        V48Assert(!s.Players[who].Dead && s.Players[who].DeathAt=-1 && V67UtilityRow(s,who,"rez",1000).Ready,
            "an explicit non-player death leaves the player source and battle-rez availability alive")
        V48Assert(V67UtilityRow(s,who,"rez",60000).Ready,"non-player death does not leave a delayed dead status")
    }
    for target in ["","=",who,other] {
        s := IRUNewState(),V67UtilityMeta(s,0,who,"Corruption"),V67UtilityMeta(s,0,other,"Corruption")
        line := IPDemoLine(1000,who,target,"Death"),ev := IPParseLine(line)
        IRUObserve(s,ev,1000,line,1000,"fixture","@Owner#1")
        victim := target=other ? other : who,survivor := victim=who ? other : who
        row := V67UtilityRow(s,victim,"rez",1000)
        V48Assert(s.Players[victim].Dead && s.Players[victim].DeathAt=1000 && row.Status="Dead" && !row.Ready,
            "explicit player, self-target and absent-target deaths retain the actual victim")
        V48Assert(!s.Players[survivor].Dead && V67UtilityRow(s,survivor,"rez",1000).Ready,
            "a different tracked player stays available")
        line := IPDemoLine(1100,victim,"=","Enter")
        IRUObserve(s,IPParseLine(line),1100,line,1100,"fixture","@Owner#1")
        V48Assert(!s.Players[victim].Dead && V67UtilityRow(s,victim,"rez",1100).Ready,
            "later recorded return to combat still clears death status")
    }
    for kind in ["Enter","Activate"] {
        s := IRUNewState(),V67UtilityMeta(s,0,who,"Corruption")
        death := IPParseLine(IPDemoLine(1000,who,"=","Death"))
        IRUObserve(s,death,1000,"",1000,"fixture","@Owner#1")
        live := IPParseLine(IPDemoLine(3000,who,"=",kind))
        IRUObserve(s,live,3000,"",3000,"fixture","@Owner#1")
        V48Assert(!s.Players[who].Dead,"recorded " kind " restores availability")
        IRUObserve(s,death,2500,"",3000,"fixture","@Owner#1")
        V48Assert(!s.Players[who].Dead && V67UtilityRow(s,who,"rez",3000).Ready,
            "an older delayed death cannot replace newer living evidence")
        IRUObserve(s,death,3000,"",3000,"fixture","@Owner#1")
        V48Assert(s.Players[who].Dead && !V67UtilityRow(s,who,"rez",3000).Ready,
            "a death at the newest living timestamp remains authoritative")
    }
}

; Native sorted controls in private fixtures; no real team save or tool dispatch.
Audit132TeamOrderIdentity() => V7825Fixture(Audit132TeamOrderCase)
Audit132TeamOrderCase()
{
    global ITeam,ITeamUI
    ITeam.Data := V7825Data(),ITeam.Loaded := true,ITeam.Enabled := false
    ITeamOpen("Izax"),original := ITeamEncode(ITeamUI.Data),ITOOpen("Izax"),e := ITeamUI.OrderEditor
    e.Default.Value := 0,ITOToggleDefault(),before := e.Rows.Clone()
    e.List.ModifyCol(3,"Sort"),e.List.Modify(0,"-Select"),e.List.Modify(1,"Select Focus")
    selected := Integer(e.List.GetText(1,1)),slot := before[selected]
    V48Assert(selected!=1,"fixture visibly sorts a different plan turn into first row")
    ITOSelectRow()
    V48Assert(e.RoleKeys[e.Role.Value]=slot,"selection editor follows sorted visible turn")
    ITORemove(),expected := before.Clone(),expected.RemoveAt(selected)
    V48Assert(IGVJson(e.Rows)=IGVJson(expected),"Remove deletes selected visible turn only")

    ITOSet(e.Plan,e.Boss,e.Section,before.Clone()),ITORender()
    Audit132SelectSortedTurn(e,selected),ITOMove(-1)
    expected := before.Clone(),moved := expected.RemoveAt(selected),expected.InsertAt(selected-1,moved)
    V48Assert(IGVJson(e.Rows)=IGVJson(expected),"Move changes selected turn's plan order after sort")

    ITOSet(e.Plan,e.Boss,e.Section,before.Clone()),ITORender()
    Audit132SelectSortedTurn(e,selected),replacement := 0
    for n,key in e.RoleKeys {
        used := false
        for current in before
            if current=key
                used := true
        if !used {
            replacement := key,e.Role.Choose(n)
            break
        }
    }
    V48Assert(replacement>0,"fixture has a valid unused role for editing")
    ITOEditRow(true),expected := before.Clone(),expected[selected] := replacement
    V48Assert(IGVJson(e.Rows)=IGVJson(expected),"Update replaces selected sorted turn only")
    e.List.Modify(0,"-Select"),snapshot := IGVJson(e.Rows)
    ITORemove(),ITOMove(-1),ITOEditRow(true)
    V48Assert(IGVJson(e.Rows)=snapshot,"no selection cannot mutate an order")
    ITOClose()

    ITOOpen("Nahut"),e := ITeamUI.OrderEditor,e.Default.Value := 0,ITOToggleDefault()
    before := e.Rows.Clone(),before.Push(before[1].Clone()),ITOSet(e.Plan,e.Boss,e.Section,before),ITORender()
    repeated := before.Length,Audit132SelectSortedTurn(e,repeated),ITORemove()
    expected := before.Clone(),expected.RemoveAt(repeated)
    V48Assert(IGVJson(e.Rows)=IGVJson(expected),"repeated roles remain distinct turns after sorting")
    ITOClose()
    V48Assert(ITeamEncode(ITeamUI.Data)=original,"draft edits and cancel preserve stored team")
}
Audit132SelectSortedTurn(e,number)
{
    e.List.ModifyCol(3,"Sort"),e.List.Modify(0,"-Select")
    Loop e.List.GetCount() {
        if e.List.GetText(A_Index,1)=number {
            e.List.Modify(A_Index,"Select Focus"),ITOSelectRow()
            return
        }
    }
    throw Error("Fixture turn not found")
}
Audit132DiagnosticToolIdentity()
{
    s := IUCDiagnosticsState(),old := {Gui:s.Gui,List:s.List,Items:s.Items},receipt := {Label:""}
    try {
        s.Gui := "",IUCDiagnosticsOpen()
        for item in s.Items
            item[2] := Audit132RecordTool.Bind(receipt,item[1])
        for order in ["Sort","SortDesc"] {
            s.List.ModifyCol(1,order),s.List.Modify(0,"-Select"),s.List.Modify(1,"Select Focus")
            selected := s.List.GetText(1,1),receipt.Label := ""
            IUCDiagnosticRun()
            V48Assert(receipt.Label=selected,"sorted tool selection dispatches its displayed tool: " order)
        }
        s.List.Modify(0,"-Select"),receipt.Label := "",IUCDiagnosticRun()
        V48Assert(receipt.Label="","no selection dispatches no diagnostic tool")
    }
    finally {
        if IsObject(s.Gui)
            s.Gui.Destroy()
        s.Gui := old.Gui,s.List := old.List,s.Items := old.Items
    }
}
Audit132RecordTool(receipt,label,*) => receipt.Label := label

; Confirmed live kills reach durable summaries before a later area/combat boundary.
V7895LiveCompletionSegment(sourceKey)
{
    data := IPNewData("Private R4 completion"),owner := "@Timer#135",boss := "Lady Dominique {4608014577303552}:135"
    IPFeedLine(data,"[00:00:00.000] [" owner "] [] [] [AreaEntered {836045448953664}: R-4 Anomaly {833571547775799} 8 Player Veteran {836045448953652}] (he4000)",sourceKey)
    IPFeedLine(data,IPDemoLine(1000,owner,"=","Enter"),sourceKey)
    IPFeedLine(data,IPDemoLine(2000,owner,boss,"Damage",100),sourceKey)
    IPFeedLine(data,IPDemoLine(3000,owner,boss,"Death"),sourceKey)
    return data.Current
}

V7895LiveCompletion() => V7880LiveRun(V7895LiveCompletionCase)
V7895LiveCompletionCase(seg,key)
{
    s := ILBState(),s.LivePending := Map()
    seg := V7895LiveCompletionSegment(seg.LibrarySourceKey)
    V48Assert(seg.Terminal && seg.FinishAt>=0,"fixture has an observed completed boss with an open statistical tail")
    liveToken := IPRSegmentToken(seg),liveSnapshot := seg.HasOwnProp("CompactSnapshot") ? seg.CompactSnapshot : ""
    V48Assert(ILBLiveQueueCompleted(seg),"confirmed last boss queues without leaving the operation")
    V48Assert(seg.End=-1 && IPRSegmentToken(seg)=liveToken,"checkpoint does not close or change the live encounter")
    V48Assert((seg.HasOwnProp("CompactSnapshot") ? seg.CompactSnapshot : "")=liveSnapshot,"checkpoint does not replace the live display cache")
    batch := s.LivePending[key]
    V48Assert(batch.Pulls.Count=1 && batch.Progression.Count=1,"both Library and Progression snapshots are queued")
    for token,p in batch.Pulls {
        V48Assert(p.Result="Kill" && p.End=seg.Last && p.Partial=seg.Partial,"completed summary retains the actual endpoint and coverage")
        before := p
    }
    V48Assert(!ILBLiveQueueCompleted(seg) && batch.Pulls.Count=1,"idle pumps do not repeatedly queue the same completed snapshot")
    V48Assert(!ILBLiveCheckpoint(IPNewData("not the running dataset")),"diagnostics cannot schedule a live save or touch the installed Library")
    seg.Last += 10,seg.LastOutput += 10,seg.SnapshotRevision += 1
    V48Assert(ILBLiveQueueCompleted(seg) && batch.Pulls.Count=1,"a later accepted tail revision replaces the same pull")
    for token,p in batch.Pulls
        V48Assert(p!=before && p.End=seg.Last,"the newer snapshot is detached from the already queued view")
    for kind in ["open","exit","wipe","marker","closed"] {
        other := seg.Clone()
        if other.HasOwnProp("LibraryCheckpointToken")
            other.DeleteProp("LibraryCheckpointToken")
        if kind="open"
            other.FinishAt := -1
        else if kind="exit"
            other.Terminal := false
        else if kind="wipe"
            other.WipeEnded := true
        else if kind="marker" {
            other.Profile := {Marker:"required"},other.XPFixed := false
        }
        else
            other.End := other.Last
        V48Assert(!ILBLiveQueueCompleted(other),"checkpoint does not publish an unfinished, unconfirmed or already closed result: " kind)
    }
}

V7895LiveCompletionSave() => V7880LiveRun(V7895LiveCompletionSaveCase)
V7895LiveCompletionSaveCase(seg,key)
{
    s := ILBState(),s.LivePending := Map(),seg := V7895LiveCompletionSegment(seg.LibrarySourceKey)
    V48Assert(ILBLiveQueueCompleted(seg),"last boss is queued while the live dataset remains open")
    V48Assert(ILBLiveFlushPending(ILBLiveHistoryPath())=0,"existing durable retry path saves the completed checkpoint")
    V48Assert(s.Files[key].Pulls.Length=1 && s.Files[key].Pulls[1].Result="Kill","Library already contains the last boss before a zone change")
    V48Assert(IGVReadHistory(ILBLiveHistoryPath()).Count=1,"Progression receives the same completed pull")
    V48Assert(seg.End=-1 && !s.LivePending.Count,"successful persistence leaves the live encounter intact")
    V48Assert(!ILBLiveQueueCompleted(seg),"acknowledged checkpoints are not offered again on idle")
    seg.End := seg.Last,seg.EndReason := seg.FinishReason,seg.SnapshotRevision += 1
    V48Assert(ILBLiveQueue(seg) && ILBLiveFlushPending(ILBLiveHistoryPath())=0,"the later real encounter closure uses the normal save path")
    V48Assert(s.Files[key].Pulls.Length=1 && IGVReadHistory(ILBLiveHistoryPath()).Count=1,"final closure updates the same pull without duplicate clears")
}

; Native timer-label sizing. Private HWNDs, synthetic deadlines, no gameplay input.
IRT148TimerLabelFit() => V65UITimerIsolated(IRT148TimerLabelFitCase)

IRT148TimerLabelState()
{
    s := IRTNewState(),s.Enabled := true
    for item in [{Name:"Challenging Call",Panel:"Boss",Due:4000},
        {Name:"Hydraulic Overrides",Panel:"Boss",Due:18000},
        {Name:"Creeping Terror",Panel:"Personal",Due:4500},
        {Name:"Adrenaline Rush",Panel:"Personal",Due:21000}] {
        d := IRTDefinition(item.Name,"Timer label fixture"),d.Enabled := true,d.Color := "AA88E8",d.Panel := item.Panel
        s.Definitions.Push(d)
        s.Active[d.Id] := {Key:d.Id,Def:d,Name:d.Name,Start:0,Due:item.Due,Interval:30000}
    }
    return s
}

IRT148TimerLabelRow(p,text)
{
    for row in p.Rows
        if row.Name.Text=text && row.Name.Visible
            return row
    throw Error("Missing timer label fixture: " text)
}

IRT148TimerLabelPointSize(control)
{
    font := SendMessage(0x31,0,0,control.Hwnd),lf := Buffer(92,0)
    if !DllCall("Gdi32\GetObjectW","Ptr",font,"Int",lf.Size,"Ptr",lf)
        throw Error("Could not inspect native timer font")
    return Round(Abs(NumGet(lf,0,"Int"))*72/A_ScreenDPI,1)
}

IRT148TimerLabelGeometry(p)
{
    for i,row in p.Rows {
        if !row.Name.Visible
            continue
        row.Name.GetPos(&nx,&ny,&nw,&nh),row.Time.GetPos(&tx,&ty,&tw,&th)
        row.Icon.Control.GetPos(&ix,&iy,&iw,&ih),row.Bar.GetPos(&bx,&by,&bw,&bh)
        V48Assert(nx>=bx && nx+nw<tx && ix+iw<=bx && bx+bw=p.Layout.W,
            "auto-fit preserves separate icon, label, countdown and bar geometry")
        V48Assert(tx+tw=p.Layout.W-Max(1,Round(7*p.Layout.Scale)) && tw<=Round(62*p.Layout.Scale),
            "compact countdown retains its exact right edge and original width ceiling")
        V48Assert(IRTUBarNamePixels(row.Time,row.Time.Text)<=tw,
            "the full native countdown fits its reserved column")
        V48Assert(row.NameFit.Font>=6 && row.NameFit.Font<=p.Layout.Rows[i].Font,
            "name font has a readable floor and never exceeds the configured normal/urgent size")
        V48Assert(Abs(IRT148TimerLabelPointSize(row.Time)-p.Layout.Rows[i].Font)<=0.5,
            "fitting a name never shrinks or enlarges countdown text")
        V48Assert(IRTUBarNamePixels(row.Name,row.Name.Text)<=nw-2 || row.NameFit.Font=6,
            "labels fit their actual native font or retain ellipsis only at the minimum")
    }
}

IRT148TimerLabelFitCase(path)
{
    global IRT,IRTPrefs,Audio
    IRT := IRT148TimerLabelState(),p := IRTPrefs,foreground := WinExist("A"),queue := Audio.Queue.Length
    due := Map()
    for key,item in IRT.Active
        due[key] := item.Due
    for scale in [60,100,150,200] {
        p.Scale := scale
        for width in [180,240,330,600] {
            p.BarsWidth := width,IRTURender(IRT,1000)
            V48Assert(p.LastError="" && p.Rows[1].Name.Text="Challenging Call",
                "normal and urgent names render throughout supported global sizes and widths")
            IRT148TimerLabelGeometry(p)
            row := IRT148TimerLabelRow(p,"Hydraulic Overrides"),cached := row.LabelFit
            IRTURender(IRT,1100)
            V48Assert(row.LabelFit=cached,"countdown-only changes reuse the cached text measurement")
        }
    }
    p.Scale := 100,p.BarsWidth := 180,IRTURender(IRT,1000)
    for name in ["Challenging Call","Hydraulic Overrides","Creeping Terror","Adrenaline Rush"] {
        row := IRT148TimerLabelRow(p,name),row.Name.GetPos(&x,&y,&w,&h)
        V48Assert(IRTUBarNamePixels(row.Name,name)<=w-2,
            "common long ability names fit the minimum-width normal/urgent native panel")
    }
    row := IRT148TimerLabelRow(p,"Hydraulic Overrides"),narrowFont := row.NameFit.Font
    row.Time.GetPos(&x,&y,&compactWidth,&h)
    V48Assert(narrowFont<11 && compactWidth<Round(62*p.Layout.Scale),
        "narrow rows reclaim unused countdown space and choose a smaller fitting name font")
    p.BarsWidth := 600,IRTURender(IRT,1000)
    for i,control in p.Rows {
        if !control.Name.Visible
            continue
        control.Time.GetPos(&x,&y,&w,&h)
        V48Assert(control.NameFit.Font=p.Layout.Rows[i].Font && w=Round(62*p.Layout.Scale),
            "widening restores both the configured name font and normal countdown reservation")
    }
    ; Different numeric digits of the same length cannot make the label jump.
    p.BarsWidth := 180
    target := IRT.Active[IRT.Definitions[2].Id]
    for index,value in [11800,11100,12900,19000,19900] {
        target.Due := value,IRTURender(IRT,1000)
        control := IRT148TimerLabelRow(p,"Hydraulic Overrides")
        if index=1
            cached := control.LabelFit,control.Name.GetPos(&x,&y,&savedWidth,&h)
        else {
            control.Name.GetPos(&x,&y,&w,&h)
            V48Assert(control.LabelFit=cached && w=savedWidth,
                "widest-digit reservations remain steady while countdown digits change")
        }
    }
    target.Due := due[IRT.Definitions[2].Id]
    for key,item in IRT.Active
        V48Assert(item.Due=due[key],"font and spacing changes leave timer deadlines unchanged")
    process := DllCall("GetCurrentProcess","Ptr"),before := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    loop 30
        IRTURender(IRT,1000+A_Index*5)
    after := DllCall("GetGuiResources","Ptr",process,"UInt",0,"UInt")
    V48Assert(after<=before+2,"cached label fits do not accumulate native font/GDI resources")
    V48Assert(WinExist("A")=foreground && Audio.Queue.Length=queue && !FileExist(path),
        "sizing labels neither steals focus, plays audio nor writes user settings")
}

IRT148TimerLabelPanels() => V65UITimerIsolated(IRT148TimerLabelPanelsCase)
IRT148TimerLabelPanelsCase(path)
{
    global IRT,IRTPrefs,IPM,Audio
    IRT := IRT148TimerLabelState(),p := IRTPrefs,p.SeparatePanels := true
    IPM.Enabled := true,IPM.Wanted := true,IPM.DesktopPreview := true
    p.BarsWidth := 180,p.PersonalWidth := 180,IRTURender(IRT,1000),q := p.PersonalPanel
    V48Assert(p.LastError="" && IPMGuiAlive(p.BarsGui) && IPMGuiAlive(q.BarsGui),
        "both existing native Boss and Personal windows receive the shared label fit")
    for panel in [p,q] {
        IRT148TimerLabelGeometry(panel)
        V48Assert(!DllCall("IsWindowVisible","Ptr",panel.BarsGui.Hwnd) && !panel.DragHooks,
            "native diagnostics remain hidden and register no live input hooks")
        style := DllCall("GetWindowLongW","Ptr",panel.BarsGui.Hwnd,"Int",-20,"UInt")
        V48Assert((style & 0x08000020)=0x08000020,"timer labels preserve click-through and no-activation styles")
    }
    boss := IRT148TimerLabelRow(p,"Hydraulic Overrides"),personal := IRT148TimerLabelRow(q,"Creeping Terror")
    oldBossFont := boss.NameFit.Font,oldPersonalFont := personal.NameFit.Font
    p.BarsWidth := 600,IRTURender(IRT,1000)
    V48Assert(boss.NameFit.Font=11 && personal.NameFit.Font=oldPersonalFont,
        "resizing Boss timers does not change the separate Personal panel's fit")
    p.PersonalWidth := 600,IRTURender(IRT,1000)
    V48Assert(personal.NameFit.Font=13,"widening Personal timers restores its configured urgent font")
    oldName := personal.Name,p.PersonalPanel.BarsGui.Destroy(),IRTURender(IRT,1000)
    V48Assert(!IPMUiHandle(oldName) && IPMGuiAlive(p.PersonalPanel.BarsGui),
        "rebuilding a destroyed panel does not reuse the old HWND's cached fit")
    ; The fit uses measured native font widths rather than a fixed DPI estimate.
    ; Exercise additional pixel geometries corresponding to96/144/192dpi.
    native := p.Rows[1],base := 11
    for dpi in [96,144,192] {
        factor := dpi/96,cells := IRTUIconRowLayout(Round(180*factor),{Y:0,H:Round(28*factor)},factor)
        native.Time.SetFont("s11 Bold")
        fitted := IRTUFitBarLabels(native,"Hydraulic Overrides","19.9",cells,base,factor)
        V48Assert(native.NameFit.Font>=6 && native.NameFit.Font<=base
            && IRTUBarNamePixels(native.Time,"19.9")<=fitted.TimeW,
            "DPI-scaled pixel geometries preserve readable label bounds and complete countdown text")
    }
    V48Assert(!FileExist(path),"all shared-panel sizing checks leave saved settings untouched")
}

; Offline native fixtures only. No real recording, account, browser or HTTP.
VDev136Fixture(callback)
{
    global IPU,IPUA,IP,SETTINGS_FILE
    oldU := IPU,oldA := IPUA,oldIP := IP,oldFile := SETTINGS_FILE
    dir := A_Temp "\Iris-parsely136-" INToken(),DirCreate(dir)
    try {
        SETTINGS_FILE := dir "\private.ini",IPU := IPUNewState(),IPUA := IPUANewState(),IP := IPNewApp()
        callback.Call(dir)
        V48Assert(!IPU.Handle && !IsObject(IPUA.Worker),"offline feature tests never launch the uploader")
    } finally {
        if IPMGuiAlive(IPU.Gui)
            IPU.Gui.Destroy()
        if IPMGuiAlive(IPUA.HistoryGui)
            IPUA.HistoryGui.Destroy()
        IPU := oldU,IPUA := oldA,IP := oldIP,SETTINGS_FILE := oldFile
        if DirExist(dir)
            DirDelete(dir,true)
    }
}

VDev136Log(dir,name := "combat_fixture.txt")
{
    path := dir "\" name
    FileAppend(IPDemoLine(1000,"@FakeRecorder#1","=","Enter") "`r`n" IPDemoLine(2000,"@FakeRecorder#1","Dummy {123}:1","Damage",100) "`r`n",path,"UTF-8")
    return path
}

VDev136LoadedLog() => VDev136Fixture(VDev136LoadedCase)
VDev136LoadedCase(dir)
{
    global IPU,IP
    path := VDev136Log(dir),live := VDev136Log(dir,"combat_live.txt"),IPUOpen()
    IP.Offline := IPNewData("saved"),IP.Offline.SourcePath := path,IP.View := "Imported"
    IP.ImportPath := dir "\stale.txt",IPUUseLoaded()
    V48Assert(IPU.Path=path && IPU.Scope="file" && !IsObject(IPU.Selection),"saved view selects the actual full source, ignoring a stale import bookmark")
    V48Assert(InStr(IPU.InfoControl.Text,"Whole loaded log") && IPU.StartButton.Enabled,"scope and public visibility stay explicit")
    IP.Live := IPNewData("live"),IP.Live.SourceKey := live "|identity",IP.View := "Live",IPUUseLoaded()
    V48Assert(IPU.Path=live,"live view never uploads the previously viewed saved log")
    IP.Live.SourceKey := "",IP.Selected := 0,IPUUseLoaded()
    V48Assert(IPU.Path="" && !IPU.StartButton.Enabled,"an unavailable current file clears the previous target")
    IP.View := "Imported",IP.Offline.Demo := true,IPUUseLoaded()
    V48Assert(IPU.Path="" && !IPU.StartButton.Enabled,"synthetic demonstration data cannot select a real recording")
}

VDev136Context(area := "833571547775799",mode := "836045448953652")
{
    return {AreaId:area,ModeId:mode,Owner:"@FakeRecorder#1"}
}
VDev136Area(area,mode := "",owner := "@FakeRecorder#1")
{
    return {Kind:"Area",AreaId:area,ModeId:mode,Source:IPActor(owner)}
}
VDev136Watch()
{
    s := IPUANewState(),s.Enabled := true,s.Tracking := true
    IPUAObserve(s,{Kind:"Damage"},"C:\fake\combat.txt|identity",VDev136Context())
    return s
}

VDev136SessionTriggers()
{
    key := "C:\fake\combat.txt|identity",s := VDev136Watch()
    V48Assert(s.Requests.Count=0,"combat records do not trigger an upload")
    for kind in ["Death","Exit","Activate"]
        IPUAObserve(s,{Kind:kind},key,VDev136Context())
    V48Assert(s.Requests.Count=0,"boss deaths, combat exit and ability casts never trigger an upload")
    IPUAObserve(s,VDev136Area("833571547775799","836045448953652"),key,VDev136Context())
    V48Assert(s.Requests.Count=0,"a duplicate room/area record inside the same operation is harmless")
    IPUAObserve(s,VDev136Area("833571547775799",""),key,VDev136Context())
    IPUAObserve(s,VDev136Area("",""),key,VDev136Context())
    V48Assert(s.Requests.Count=0,"partial same-area metadata and empty locations cannot invent an exit")
    IPUAObserve(s,VDev136Area("12345"),key,VDev136Context())
    V48Assert(s.Requests.Count=1 && s.Requests[key].Reason="leave","leaving the operation creates one whole-log request")
    IPUARequest(s,s.Watching[key],"stop")
    V48Assert(s.Requests.Count=1 && s.Requests[key].Reason="stop","Stop coalesces with a pending exit instead of duplicating it")
    for mode in ["836045448953651","836045448953652","836045448953653","836045448953654","836045448953655","836045448953656"]
        V48Assert(IPUAOperation("area",mode)!="","all six operation modes can detect departure")
    V48Assert(IPUAOperation("area","836045448953657")="" && IPUAOperation("","836045448953652")="","unknown or missing operation evidence is not guessed")
}

VDev136SessionGuards()
{
    key := "C:\fake\combat.txt|identity",s := IPUANewState(),s.Tracking := true
    IPUAObserve(s,{Kind:"Damage"},key,VDev136Context())
    V48Assert(s.Watching.Count=0 && s.Requests.Count=0,"disabled mode never observes or schedules uploads")
    s.Enabled := true,IPUAObserve(s,VDev136Area("fleet"),key,VDev136Context())
    V48Assert(s.Requests.Count=0,"a log containing only location metadata is not auto-uploaded")
    s := VDev136Watch(),s.OnLeave := false,IPUAObserve(s,VDev136Area("fleet"),key,VDev136Context())
    V48Assert(s.Requests.Count=0,"the departure trigger has an independent off switch")
    s.OnStop := false
    V48Assert(!IPUARequest(s,s.Watching[key],"stop"),"the Stop trigger has an independent off switch")
    s := VDev136Watch(),IPUAObserve(s,VDev136Area("fleet","","@SomeoneElse#2"),key,VDev136Context())
    V48Assert(s.Requests.Count=0,"another player's area record cannot end the recorder's session")
    IPUAObserve(s,VDev136Area("fleet"),key,VDev136Context())
    IPUAObserve(s,VDev136Area("833571547775799","836045448953652"),key,VDev136Context("fleet",""))
    V48Assert(s.Requests.Count=0,"returning to the instance during the departure grace period cancels that request")
    s := VDev136Watch(),IPUAObserve(s,VDev136Area("fleet"),"C:\fake\other.txt|identity2",VDev136Context("fleet",""))
    V48Assert(s.Requests.Count=0,"changing files cannot transfer the previous log's operation or combat evidence")
}

VDev136SessionStop() => VDev136Fixture(VDev136StopCase)
VDev136StopCase(dir)
{
    global IPUA,IP
    IPUA := VDev136Watch(),IPUA.StopData := IPNewData("old live data"),IPUACommitStop()
    V48Assert(IPUA.Requests.Count=1 && !IPUA.Tracking && IPUA.Watching.Count=0,"draining a stopped live session preserves one request before a new parse can replace it")
    IPUACommitStop()
    V48Assert(IPUA.Requests.Count=1,"repeated Stop completion does not create additional requests")
    IPUA := IPUANewState(),IPUA.Enabled := true,IPUA.Tracking := true,IPUA.StopData := IPNewData("empty")
    IPUACommitStop()
    V48Assert(IPUA.Requests.Count=0,"stopping without observed combat does not upload a historical log")
    IPUA := VDev136Watch(),IPUA.OnStop := false,IPUA.StopData := IPNewData("disabled Stop"),IPUACommitStop()
    V48Assert(IPUA.Requests.Count=0,"Stop disabled remains disabled after session drain")
}

VDev136UploadLedger() => VDev136Fixture(VDev136LedgerCase)
VDev136LedgerCase(dir)
{
    path := VDev136Log(dir),info := IPUDescribe(path),row := IPUARow(info,"leave",false),saved := IPUALedgerChange(row)
    V48Assert(saved.Status="queued" && IPUALedgerRead(IPUALedgerPath()).Count=1,"an observed log is saved before any upload starts")
    FileAppend(IPDemoLine(3000,"@FakeRecorder#1","=","Exit") "`r`n",path,"UTF-8")
    again := IPUARow(IPUDescribe(path),"stop",false),IPUALedgerChange(again)
    V48Assert(again.Key=row.Key && IPUALedgerRead(IPUALedgerPath()).Count=1,"later writes and Stop still refer to the same physical log")
    claim := row.Clone(),claim.Status := "sending"
    V48Assert(IsObject(IPUALedgerChange(claim,"claim")) && !IPUALedgerChange(claim,"claim"),"an exclusive durable claim allows only one sender")
    reloaded := IPUALedgerRead(IPUALedgerPath())
    V48Assert(reloaded[row.Key].Status="sending" && !IPUALedgerChange(claim,"claim"),"an interrupted upload is never automatically resubmitted after reload")
    claim.Status := "success",claim.Url := "https://parsely.io/parser/view/136001",IPUALedgerChange(claim,"update")
    IPUALedgerChange(again)
    V48Assert(IPUALedgerRead(IPUALedgerPath())[row.Key].Url=claim.Url,"a later trigger preserves the existing result link")
    other := VDev136Log(dir,"combat_other.txt"),otherRow := IPUARow(IPUDescribe(other),"stop",false)
    IPUALedgerChange(otherRow)
    V48Assert(otherRow.Key!=row.Key && IPUALedgerRead(IPUALedgerPath()).Count=2,"different recordings are not suppressed as duplicates")
    leave := otherRow.Clone(),leave.Reason := "leave",IPUALedgerChange(leave,"update")
    IPUALedgerChange(otherRow)
    V48Assert(IPUALedgerRead(IPUALedgerPath())[otherRow.Key].Reason="stop","Stop upgrades an already durable departure request")
    otherRow.Status := "failed",IPUALedgerChange(otherRow,"update")
    V48Assert(!IPUALedgerChange(otherRow,"claim"),"failed results require an explicit manual retry")
    V48Assert(IPUALedgerPack(IPUALedgerParse(IPUALedgerPack(IPUALedgerRead(IPUALedgerPath()))))=IPUALedgerPack(IPUALedgerRead(IPUALedgerPath())),"durable state round-trips without credentials or raw recording contents")
}

VDev136LedgerGuards() => VDev136Fixture(VDev136LedgerGuardsCase)
VDev136LedgerGuardsCase(dir)
{
    path := VDev136Log(dir),row := IPUARow(IPUDescribe(path),"stop",true,"FictitiousAccount")
    text := IPUALedgerPack(Map(row.Key,row)),caught := false
    try IPUALedgerParse(StrReplace(text,row.Key,"bad-key"))
    catch Error
        caught := true
    V48Assert(caught,"history identity corruption fails closed")
    FileAppend("broken history",IPUALedgerPath(),"UTF-8"),caught := false
    try IPUALedgerChange(row)
    catch Error
        caught := true
    V48Assert(caught && FileRead(IPUALedgerPath(),"UTF-8")="broken history","unreadable history cannot be overwritten to permit duplicate uploads")
    FileDelete(IPUALedgerPath()),IPUALedgerChange(row)
    held := IHAcquireLock(IPUALedgerPath()),caught := false
    try IPUALedgerChange(row)
    catch Error
        caught := true
    finally DllCall("Kernel32\CloseHandle","Ptr",held)
    V48Assert(caught,"another sender's lock prevents a concurrent state overwrite")
    IPUACancelQueued()
    V48Assert(IPUALedgerRead(IPUALedgerPath())[row.Key].Status="canceled","turning off auto-upload cancels unsent durable requests")
}

VDev136AutoQueue() => VDev136Fixture(VDev136AutoQueueCase)
VDev136AutoQueueCase(dir)
{
    global IPUA,IPU
    path := VDev136Log(dir),row := IPUARow(IPUDescribe(path),"stop",false)
    row.Updated := DateAdd(A_NowUTC,-60,"Seconds")
    V48Assert(!IPUAReady(row,1000) && !IPUAReady(row,5999) && IPUAReady(row,6000),"a whole-log upload waits for five seconds of unchanged writes")
    FileAppend(IPDemoLine(3000,"@FakeRecorder#1","=","Exit") "`r`n",path,"UTF-8")
    V48Assert(!IPUAReady(row,6001) && IPUAReady(row,11001),"later log output restarts the settling delay")
    IPUA.Enabled := true,IPUALedgerChange(row)
    V48Assert(!IPUADispatch(row) && IPUALedgerRead(IPUALedgerPath())[row.Key].Status="queued","SELF_TEST blocks automatic transport before claiming or spawning")
    caught := false
    try IPUCreateWorker(IPUDescribe(path),IPUJobXml(IPUDescribe(path),""))
    catch Error
        caught := true
    V48Assert(caught,"the shared worker factory independently refuses transport in diagnostics")
    IPUATick()
    V48Assert(!IsObject(IPUA.Worker),"the timer's independent diagnostic gate never starts HTTP")
    replacement := VDev136Log(dir,"combat_replaced.txt"),oldId := IPUALogIdentity(replacement)
    FileDelete(replacement),Sleep(2),VDev136Log(dir,"combat_replaced.txt")
    admitted := IPUAAdmitRequest({Key:oldId.Path "|" oldId.Identity,Path:oldId.Path,Reason:"stop"})
    V48Assert(admitted.Status="failed","a replacement file cannot be substituted for the observed recording")
    oldId := IPUALogIdentity(replacement),FileDelete(replacement)
    missing := IPUAAdmitRequest({Key:oldId.Path "|" oldId.Identity,Path:oldId.Path,Reason:"stop"})
    V48Assert(missing.Status="failed","a removed file is recorded as a local failure")
    V48Assert(IPUA.Queued.Length=1 && IPUA.Rows[row.Key].Status="queued","bad recordings do not erase or block an unrelated queued log")
}

VDev136UploadUI() => VDev136Fixture(VDev136UploadUICase)
VDev136UploadUICase(dir)
{
    global IPU,IPUA,SETTINGS_FILE
    IPUOpen()
    V48Assert(!IPUA.Enabled && IPU.AutoBox.Value=0,"new installations leave auto-upload off")
    IPU.Gui.GetClientPos(,,&width,&height)
    previous := IPU.FileControl
    for c in [IPU.LoadedButton,IPU.PullButton,IPU.PickButton] {
        previous.GetPos(&x,&y,&w,&h),c.GetPos(&nx,&ny,&nw,&nh)
        V48Assert(x+w<=nx && nx+nw<=width && y=ny,"all four selection controls fit on one native row")
        previous := c
    }
    IPU.AutoStatusControl.GetPos(&x,&y,&w,&h)
    V48Assert(x+w<=width && y+h<=height,"auto-upload status fits in the native window")
    IPU.AutoBox.Value := 1,IPUAAutoToggle()
    V48Assert(!IPUA.Enabled && !FileExist(SETTINGS_FILE),"UI diagnostics cannot opt in, create settings or start a timer")
    V48Assert(!DllCall("IsWindowVisible","Ptr",IPU.Gui.Hwnd),"the test window never appears on the user's desktop")
}

VDev136HistoryUI() => VDev136Fixture(VDev136HistoryUICase)
VDev136HistoryUICase(dir)
{
    global IPUA
    first := IPUARow(IPUDescribe(VDev136Log(dir,"combat_first.txt")),"leave",false)
    first.Status := "success",first.Url := "https://parsely.io/parser/view/136001",first.Updated := "20261107100000",IPUALedgerChange(first)
    second := IPUARow(IPUDescribe(VDev136Log(dir,"combat_second.txt")),"stop",false)
    second.Status := "success",second.Url := "https://parsely.io/parser/view/136002",second.Updated := "20261107110000",IPUALedgerChange(second)
    IPUAHistory(),IPUA.HistoryList.Modify(1,"Select Focus")
    V48Assert(IPUA.HistoryList.GetText(1,2)="combat_second.txt" && IPUAHistoryUrl()=second.Url,"sorting keeps each result URL attached to its own recording")
    IPUA.HistoryList.ModifyCol(2,"Sort"),IPUA.HistoryList.Modify(1,"Select Focus")
    V48Assert(IPUA.HistoryList.GetText(1,2)="combat_first.txt" && IPUAHistoryUrl()=first.Url,"resorting cannot open another log's link")
    V48Assert(!DllCall("IsWindowVisible","Ptr",IPUA.HistoryGui.Hwnd),"the history fixture stays on the private diagnostic desktop")
}

; Offline snapshot and hidden native Raid regressions. No gameplay or requests.
IQT138Buckets()
{
    r := {Curve:[]}
    loop 101
        r.Curve.Push((A_Index-1)*4)
    for pair in [[0,1],[97.96,1],[98,2],[197.96,2],[198,3],[297.96,3],[298,4],[357.96,4],[358,5],[999999,5],[-1,0],["--",0],["",0]]
        V48Assert(IQTBucket(pair[1],r)=pair[2],"displayed estimate determines the color: " pair[1])
    for bucket in [1,2,3,4,5]
        V48Assert(IQTColor(bucket,{Key:"iris"})!="" && IQTColor(bucket,{Key:"dark"})!="","both palettes retain readable percentile ink")
    V48Assert(IQTColor(0,{Key:"iris"})="","unavailable never becomes the lowest color")
}

IQT138Reference()
{
    refs := IQTReferences()
    V48Assert(refs.Rows.Count=1820 && refs.Bosses.Count=38,"exactly 910 captured rows map to both faction IDs")
    pyro := refs.Rows["DF-NE|2031339142381602"],mirror := refs.Rows["DF-NE|2031339142381638"]
    V48Assert(pyro=mirror && pyro.P25=31324 && pyro.P50=33360 && pyro.P75=35032 && pyro.Count=1544,"Nefra cutoffs match the recorded page and both mirror specs")
    V48Assert(!refs.Bosses.Has("R4-LD") && !refs.Bosses.Has("RAV-SP"),"no other-difficulty substitute is manufactured")
    for key,r in refs.Rows {
        V48Assert(r.Minimum<=r.P25 && r.P25<=r.P50 && r.P50<=r.P75 && r.P75<=r.Maximum && r.Count>0,"valid captured cutoffs: " key)
        id := StrSplit(key,"|")[2]
        V48Assert(IPICatalog().Has(id),"every mapped discipline is an actual parser icon/spec ID")
    }
}

IQT138Ready()
{
    global IP
    V7428RaidReady(),data := IPSelectedData(),seg := IPSelectedSegment()
    seg.SourcePath := "combat_2026-11-08_01_00_00_000001.txt"
    seg.BossKey := "DF-NE",seg.BossName := "Nefra",seg.Opponent := "Nefra (8 NiM)"
    seg.AreaId := "137438993402",seg.ModeId := "836045448953655",seg.Profile := IPXProfiles()["DF-NE"]
    seg.Partial := false,data.Partial := false,seg.Terminal := true,seg.FinishAt := seg.Last,seg.End := seg.Last,seg.XPFixed := true
    seg.DisplayDisciplines := Map(),keys := []
    for key,a in seg.Actors
        if a.Kind="Player"
            keys.Push(key)
    while keys.Length<8 {
        key := "@Quartile Player " keys.Length "#" (9010+keys.Length)
        IPStoreActor(seg,IPActor(key)),keys.Push(key)
    }
    ids := ["2031339142381602","2031339142381576","2031339142381586","2031339142381572","2031339142381580","2031339142381601","2031339142381577","2031339142381587"]
    names := ["Astra","Cairn","Dawn","Ember","Flint","Gale","Harbor","Ivy"]
    for i,key in keys {
        seg.Actors[key].Name := names[i],seg.DisplayDisciplines[key] := ids[i]
        r := IQTReferences().Rows["DF-NE|" ids[i]],bucket := [1,1,2,2,3,3,4,5][i]
        dps := r.Curve[[10,20,30,40,55,65,85,95][i]+1]
        seg.Totals[key].Damage := dps*IPDuration(seg)
    }
    IRPState().Index := 1,IRBTState().Segment := "",IPWState().RaidSignature := "",IPRefresh()
    return {Data:data,Segment:seg,Keys:keys,Ids:ids}
}

IQT138Context() => V58Isolated(IQT138ContextCase)
IQT138ContextCase()
{
    f := IQT138Ready(),seg := f.Segment,view := IRPWhole(seg),before := IAFrozenTarget(seg)
    V48Assert(IQTContext(f.Data,seg,view,1,"")="","completed matching full kill is eligible")
    V48Assert(IQTContext(f.Data,seg,view,2,"")!="","a phase is never compared with full-fight data")
    V48Assert(IQTContext(f.Data,seg,view,1,"bosses")!="","boss-only damage is not compared with all-target DPS")
    seg.End := -1
    V48Assert(IQTKill(seg) && seg.End=-1,"confirmed live kill can grade without closing its reconciliation tail")
    seg.Terminal := false,V48Assert(!IQTKill(seg),"active combat is not a kill"),seg.Terminal := true
    seg.WipeEnded := true,V48Assert(!IQTKill(seg),"wipe cannot be graded"),seg.WipeEnded := false
    seg.ModeId := "836045448953657",V48Assert(IQTContext(f.Data,seg,view,1,"")!="","an unrecognized operation mode has no matching snapshot")
    seg.ModeId := "",V48Assert(IQTContext(f.Data,seg,view,1,"")!="","an unrecorded mode is not silently treated as a supported size and difficulty")
    seg.ModeId := "836045448953655",seg.Partial := true
    V48Assert(IQTContext(f.Data,seg,view,1,"")!="","partial pull is ungraded"),seg.Partial := false
    f.Data.Partial := true,V48Assert(IQTContext(f.Data,seg,view,1,"")="","a recovered complete pull is not rejected by an older source warning"),f.Data.Partial := false
    f.Data.Halted := true,V48Assert(IQTContext(f.Data,seg,view,1,"")!="","halted imports remain ungraded"),f.Data.Halted := false
    seg.End := seg.Last,seg.DisplayDisciplines[f.Keys[1]] := "mixed"
    IQTSync(f.Data,seg,view,1,"")
    V48Assert(IQTState().Rows[f.Keys[1]].Bucket=0 && IQTState().Graded=7,"a mixed spec leaves only that player ungraded")
    seg.DisplayDisciplines[f.Keys[1]] := f.Ids[1],before := IAFrozenTarget(seg)
    IQTSync(f.Data,seg,view,1,"")
    V48Assert(IQTState().Graded=8,"all observed players can have independent grades")
    V48Assert(!IABaseReconcile(seg,before).Length,"classification never changes captured damage, durations or events")
    IQTReset()
}

IQT138Raid() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQT138RaidCase)))
IQT138RaidCase()
{
    global IP,IUB
    f := IQT138Ready(),seg := f.Segment,lv := IP.PlayersLV,u := IPWState(),text := []
    V48Assert(lv.GetCount()=8 && IQTState().Graded=8,"the entire eight-player roster receives grades")
    V48Assert(SendMessage(0x1200,0,0,SendMessage(0x101F,0,0,lv.Hwnd))=18,"appended rank fields preserve the original twelve column identities")
    for i,key in f.Keys {
        row := V7428RaidRow(key),bucket := [1,1,2,2,3,3,4,5][i]
        V48Assert(IQTState().Rows[key].Bucket=bucket,"each actor uses their own discipline's thresholds")
        text.Push([key,lv.GetText(row,2),lv.GetText(row,3)])
        V48Assert(lv.GetText(row,13)=IQTLabel(IQTState().Rows[key].Percentile),"the Raid cell displays the estimated percentile")
        for theme in ["iris","dark"] {
            IUB.Theme := theme,p := IUBPalette(),colors := ITBCellColors({NameScope:"pull"},lv,row-1,3,p)
            V48Assert(colors.Text=IRTMetricColor(3),"Raid DPS retains its ordinary metric ink")
        }
    }
    IUB.Theme := "iris",IUB.CompactDamage := false
    row := V7428RaidRow(f.Keys[1]),rect := Buffer(16,0),NumPut("Int",2,rect,4)
    V48Assert(SendMessage(0x1038,row-1,rect.Ptr,lv.Hwnd),"native DPS cell has hit-test bounds")
    tip := IRCExactAt(lv,NumGet(rect,0,"Int")+2,(NumGet(rect,4,"Int")+NumGet(rect,12,"Int"))//2)
    V48Assert(tip="","DPS has no hover text")
    rect := Buffer(16,0),NumPut("Int",12,rect,4),SendMessage(0x1038,row-1,rect.Ptr,lv.Hwnd)
    tip := IRCExactAt(lv,NumGet(rect,0,"Int")+2,(NumGet(rect,4,"Int")+NumGet(rect,12,"Int"))//2)
    V48Assert(InStr(tip,"more damage per second") && InStr(tip,"Nefra"),"the separate percentile cell explains its displayed rank without adding a rate-cell tooltip")
    IPWSort("Raid",lv,3)
    for i,key in f.Keys
        V48Assert(IQTState().Rows[lv.GetText(V7428RaidRow(key),9)].Bucket=[1,1,2,2,3,3,4,5][i],"sort retains actor identity and grade")
    V7428RaidRedraw()
    for value in text {
        row := V7428RaidRow(value[1])
        V48Assert(lv.GetText(row,2)=value[2] && lv.GetText(row,3)=value[3],"grading leaves totals and numeric sorting text unchanged")
    }
    V7875RaidTargetChoose("bosses")
    V48Assert(IQTState().Graded=0,"target filtering clears grades and legend")
    V7875RaidTargetChoose("")
    V48Assert(IQTState().Graded=8,"whole damage restores all matching grades")
    IPWClearData()
    V48Assert(IQTState().Rows.Count=0 && IQTState().Graded=0,"clearing data cannot leave stale player grades")
    V48Assert(!IP.Active && !DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"native fixture never starts parsing or opens normal Iris")
    IQTReset()
}

; Percentiles now live in the existing Raid table. Overlay fixture identity stays stable.
IQV139Ready()
{
    global IUB
    IUB.QuartileColors := true
    f := IQT138Ready(),V58SelectTab(7)
    return f
}
IQV139Row(lv,key) => V7428RaidRow(key)
IQV139Page() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQR145RaidCase)))
IQV139SourceIsolation() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQR145SourceCase)))
IQV139Overlay() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQV139OverlayCase)))
IQV139OverlayCase()
{
    global IPM
    saved := IPM,IPM := IPMNewState()
    try {
        f := IQV139Ready()
        V48Assert(IPM.DamageQuartiles && !IPM.Wanted,"percentile view defaults on without showing the overlay")
        IPM.Mode := 2,IPM.DamageQuartiles := true,IPM.Font := 24
        snap := IPMSnapshot({Data:f.Data,Segment:f.Segment,State:"IMPORTED",Pending:0}),p := IPMPanelFor("Damage")
        V48Assert(p=IPM.Panels["Damage"] && p!=IPM.Panel,"overlay has independent window identity")
        V48Assert(IIFSnapshot(IPM).Selected["Damage"],"Interface selection exposes new overlay")
        IPMEnsureGui("Damage",0,p)
        for width in [196,246,300] {
            p.Width := width,p.Signature := "",IPMRender("Damage",snap,p)
            V48Assert(p.VisibleRows=8 && p.RenderedMetric="DamageQuartiles","all eight player rows render at width " width)
            V48Assert(p.QuartileHeadings[3].Text="Percentile","the DPS overlay spells out Percentile")
            previous := 0
            for heading in p.QuartileHeadings {
                heading.GetPos(&x,&y,&w,&h)
                V48Assert(x>=previous && x+w<=p.Layout.W,"column headings fit without overlap")
                previous := x+w
                V48Assert(IUMTextWidth(heading.Text,SendMessage(0x31,0,0,heading.Hwnd))<=w,"column label fits its width")
            }
            for i,row in p.Rows {
                if i>8
                    break
                row.Value.GetPos(&x,&y,&w,&h)
                V48Assert(RegExMatch(row.Value.Text,"^\d{1,3}[.,]\d{2}$") && IUMTextWidth(row.Value.Text,SendMessage(0x31,0,0,row.Value.Hwnd))<=w,"decimal percentile fits at width " width)
                row.Total.GetPos(&x,&y,&w,&h)
                V48Assert(IUMTextWidth(row.Total.Text,SendMessage(0x31,0,0,row.Total.Hwnd))<=w,"DPS fits at width " width)
            }
        }
        IOHSyncPanel(p)
        V48Assert(p.Gui.HasOwnProp("IOH") && p.Gui.IOH.Canvas.Bits,"quartile rows participate in the normal opaque-text compositor")
        V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int"),"native render does not show a normal overlay")
    }
    finally {
        IPMDestroyPanels(),IPM := saved
    }
}


IQV139ColorChoice() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQR145ColorsCase)))

IQO140OnlyDamage()
{
    global IPM
    IPM.Mode := 2
    for kind in IPMViews()
        IPM.Shown[kind] := kind="Damage"
}

IQO140Unified() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQO140UnifiedCase)))
IQO140UnifiedCase()
{
    global IPM,IP
    saved := IPM,IPM := IPMNewState()
    try {
        f := IQV139Ready(),before := IAFrozenTarget(f.Segment),IQO140OnlyDamage()
        V48Assert(!IPM.Panels.Has("Quartiles") && IPMDisplayTargets().Length=1,"one DPS window, no separately selectable Quartiles panel")
        for entry in IIFEntries()
            V48Assert(entry.Key!="Quartiles","duplicate Interface choice removed")
        p := IPMPanelFor("Damage"),IPMEnsureGui("Damage",0,p),hwnd := p.Gui.Hwnd
        snap := IPMSnapshot({Data:f.Data,Segment:f.Segment,State:"IMPORTED",Pending:0}),IPMRender("Damage",snap,p)
        dps := p.Rows[1].Total.Text,rank := p.Rows[1].Value.Text,width := p.Width,x := p.X,y := p.Y
        barColor := SendMessage(0x40F,0,0,p.Rows[1].Bar.Hwnd)
        V48Assert(IQOMode() && p.RenderedMetric="DamageQuartiles" && RegExMatch(rank,"^\d{1,3}$"),"DPS and percentile are visible by default")
        IQOApplyMode(IPM,false),IPMRender("Damage",snap,p)
        V48Assert(p.RenderedMetric="Damage" && p.Rows[1].Value.Text=dps && p.Rows[1].Total.Text!=dps,"totals mode displays the ordinary damage total and DPS")
        V48Assert(barColor=IUBColorRef("BD4040") && barColor=SendMessage(0x40F,0,0,p.Rows[1].Bar.Hwnd),"both native DPS views use the red meter bar")
        for c in p.QuartileHeadings
            V48Assert(!V58ChildVisible(c),"percentile headings hide in totals mode")
        IQOApplyMode(IPM,true)
        snap := IPMSnapshot({Data:f.Data,Segment:f.Segment,State:"IMPORTED",Pending:0}),IPMRender("Damage",snap,p)
        V48Assert(p.Gui.Hwnd=hwnd && p.Width=width && p.X=x && p.Y=y,"view toggle reuses exact panel and geometry")
        V48Assert(p.Rows[1].Total.Text=dps && p.Rows[1].Value.Text=rank,"switching back restores the same DPS and percentile")
        V48Assert(IPMDisplayTargets().Length=1 && p.RenderedMetric="DamageQuartiles","mode never creates a second DPS target")
        IPM.Mode := 1,IPM.Metric := "Damage",IQOApplyMode(IPM,true),p := IPMPanelFor("Damage")
        IPMEnsureGui("Damage",0,p),IPMRender("Damage",snap,p)
        V48Assert(p.Key="Combined" && p.Tabs.Count=4 && p.VisibleRows=8,"same switch works inside existing four-tab overlay")
        IPM.Metric := "Heal",IPMRender("Heal",snap,p),IPMParserUpdate(p)
        V48Assert(p.RenderedMetric="Heal" && !V58ChildVisible(p.QuartileHeadings[3]),"a retained DPS-only snapshot keeps ordinary healing until a valid healing result is available")
        snap := IPMSnapshot({Data:f.Data,Segment:f.Segment,State:"IMPORTED",Pending:0}),IPMRender("Heal",snap,p),IPMParserUpdate(p)
        V48Assert(p.RenderedMetric="HealingPercentiles" && V58ChildVisible(p.QuartileHeadings[3]),"Healing defaults to its own percentile view in the tabbed overlay")
        IPM.Metric := "Taken",IPMRender("Taken",snap,p),IPMParserUpdate(p)
        V48Assert(p.RenderedMetric="Taken" && !V58ChildVisible(p.QuartileHeadings[3]),"Damage Taken keeps its ordinary display")
        V48Assert(!IABaseReconcile(f.Segment,before).Length && !IP.Active,"view changes never touch parser data or start parsing")
    }
    finally IPMDestroyPanels(),IPM := saved
}

IQO140Input() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQO140InputCase)))
IQO140InputCase()
{
    global IPM
    saved := IPM,IPM := IPMNewState()
    try {
        f := IQV139Ready(),IQO140OnlyDamage(),p := IPMPanelFor("Damage")
        snap := IPMSnapshot({Data:f.Data,Segment:f.Segment,State:"IMPORTED",Pending:0}),IPMEnsureGui("Damage",0,p)
        for width in [196,246] {
            p.Width := width,p.Signature := "",IPMRender("Damage",snap,p)
            for controls in [false,true] {
                IPM.ParserControls := controls,IPMParserArrange(p,p.Layout)
                rect := IPMParserRect(0,0,p.Layout)
                p.Heading.GetPos(&hx,&hy,&hw,&hh)
                V48Assert(Abs(hx+hw-(controls ? rect.X : p.Layout.W))<=1,"the title reclaims the old toggle space")
                V48Assert(!p.HasOwnProp("QuartileButton") && !p.HasOwnProp("QuartileHit"),"percentile display has no click target")
                if controls {
                    V48Assert(IPMParserEnsureSurface(p) && IPMParserPlaceSurface(p),"Start and Stop keep their locked input surface")
                    p.ParserHit.GetPos(&px,&py,&pw,&ph)
                    V48Assert(px=0 && py=0 && pw=rect.W && ph=rect.H,"only the parser button receives clicks")
                    V48Assert((WinGetExStyle(p.ParserGui.Hwnd)&0x08000020)=0x08000000,"parser input surface remains nonactivating")
                    IPMParserDestroySurface(p)
                } else {
                    V48Assert(!IPMParserEnsureSurface(p) && !IsObject(p.ParserGui),"a parser-free header has no input window")
                }
                V48Assert((WinGetExStyle(p.Gui.Hwnd)&0x08000020)=0x08000020,"statistics body remains click-through")
            }
        }
    }
    finally IPMDestroyPanels(),IPM := saved
}

IQO140Migration() => V55Isolated(IQO140MigrationCase)
IQO140MigrationCase()
{
    global IPM,SETTINGS_FILE,IRTPrefs
    for pair in [["Mode",1],["QuartilesEnabled",1],["QuartilesX",-450],["QuartilesY",120],["QuartilesWidth",330],["QuartilesHeight",280],["QuartilesAutoHeight",0]]
        IniWrite(pair[2],SETTINGS_FILE,"IrisParseDisplay",pair[1])
    IPM := IPMNewState(),IPMLoadSettings(),p := IPM.Panels["Damage"]
    V48Assert(IPM.DamageQuartiles && IPM.Shown["Damage"] && IPM.Mode=3,"old standalone selection becomes Damage quartile mode")
    V48Assert(p.X=-450 && p.Y=120 && p.Width=330 && p.Height=280 && !p.AutoHeight,"old single-window geometry is preserved")
    V48Assert(!IPM.Panels.Has("Quartiles") && !IPM.Wanted && !IPM.TimerOn,"migration never creates duplicate window or starts overlays")
    IPM.DamageQuartiles := false,IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings()
    V48Assert(!IPM.DamageQuartiles,"explicit new preference wins over retained legacy key")
    IniDelete(SETTINGS_FILE,"IrisParseDisplay","DamageTotals"),IniWrite(2,SETTINGS_FILE,"IrisParseDisplay","Mode")
    IniWrite(1,SETTINGS_FILE,"IrisParseDisplay","DamageEnabled"),IniWrite(340,SETTINGS_FILE,"IrisParseDisplay","DamageWidth")
    IPM := IPMNewState(),IPMLoadSettings()
    V48Assert(IPM.Panels["Damage"].Width=340,"existing Damage placement wins when both old overlays were selected")
    values := ILPCapture(IPM,IRTPrefs),values.Delete("Display.DamageQuartiles")
    values["Shown.Quartiles"] := 1,values["Shown.Damage"] := 0,values["Display.Mode"] := 1,values["Panel.Quartiles.Width"] := 360
    ILPApplyModel(IPM,IRTPrefs,values)
    V48Assert(IPM.DamageQuartiles && IPM.Mode=3 && IPM.Shown["Damage"] && IPM.Panels["Damage"].Width=360,"legacy named layout migrates the same way")
    V48Assert(!values.Has("Display.DamageQuartiles"),"migration does not mutate saved layout input")
    IniDelete(SETTINGS_FILE,"IrisParseDisplay","HealingTotals")
    IniWrite(0,SETTINGS_FILE,"IrisParseDisplay","DamageQuartiles"),IniWrite(0,SETTINGS_FILE,"IrisParseDisplay","HealingPercentiles")
    IPM := IPMNewState(),IPMLoadSettings()
    V48Assert(IQOMode(IPM,"Damage") && IQOMode(IPM,"Heal"),"old overlay defaults adopt the new percentile defaults")
}

IQO140Readability() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQO140ReadabilityCase)))
IQO140ReadabilityCase()
{
    global IP,IPM,IUB
    saved := IPM,IPM := IPMNewState()
    try {
        f := IQV139Ready(),u := IPWState(),lv := IP.PlayersLV
        V48Assert(SendMessage(0x1200,0,0,SendMessage(0x101F,0,0,lv.Hwnd))=18,"original native identities and DPS rank fields remain before appended percentile fields")
        for theme in ["iris","dark"] {
            IUB.Theme := theme,palette := IUBPalette()
            for i,key in f.Keys {
                row := IQV139Row(lv,key)
                V48Assert(ITBCellColors({NameScope:"pull"},lv,row-1,3,palette).Text=IRTMetricColor(3),"DPS stays ordinary readable ink")
                V48Assert(ITBCellColors({NameScope:"pull"},lv,row-1,13,palette).Text=IQTColor([1,1,2,2,3,3,4,5][i],palette),"colored range replaces square marker")
            }
        }
        IQO140OnlyDamage(),IQOApplyMode(IPM,true)
        snap := IPMSnapshot({Data:f.Data,Segment:f.Segment,State:"IMPORTED",Pending:0}),p := IPMPanelFor("Damage")
        IPMEnsureGui("Damage",0,p),IPMRender("Damage",snap,p),IOHSyncPanel(p)
        parts := IOHParts(p.Gui,p.Layout.W,p.Layout.H)
        for part in parts {
            for i,row in p.Rows {
                if i>8
                    break
                if part.Hwnd=row.Total.Hwnd
                    V48Assert(part.Ink=0xFFFFFF,"DPS stays opaque white")
                if part.Hwnd=row.Value.Hwnd {
                    bucket := 0
                    for actorKey,item in snap.Quartiles.Rows
                        if item.Name=row.Name.Text
                            bucket := item.Bucket
                    V48Assert(bucket && part.Ink=IUBColorRef(IQTColor(bucket,{Key:"dark"})),"range uses vivid quartile ink")
                }
            }
        }
        ranges := []
        loop 8
            ranges.Push(p.Rows[A_Index].Value.Text)
        IUB.QuartileColors := false,p.Signature := "",IPMRender("Damage",snap,p)
        loop 8
            V48Assert(p.Rows[A_Index].Value.Text=ranges[A_Index],"color-off retains the same percentile")
    }
    finally IPMDestroyPanels(),IPM := saved
}

IQT141BoldNative() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQT141BoldCase)))
IQT141Weight(font)
{
    logfont := Buffer(92,0)
    return font && DllCall("Gdi32\GetObjectW","Ptr",font,"Int",92,"Ptr",logfont,"Int") ? NumGet(logfont,16,"Int") : -1
}

IQT141BoldCase()
{
    global IP,IPM,IUB
    saved := IPM,IPM := IPMNewState()
    try {
        f := IQV139Ready(),lv := IP.PlayersLV,dc := DllCall("User32\GetDC","Ptr",lv.Hwnd,"Ptr")
        prior := DllCall("Gdi32\SaveDC","Ptr",dc,"Int"),notification := Buffer(80,0)
        NumPut("Ptr",dc,notification,A_PtrSize=8 ? 32 : 16)
        try {
            for column in [13,3,13,1,13,2] {
                V48Assert(ITBCellFont(lv,column,notification),"range and ordinary cells select their own cached font")
                font := DllCall("Gdi32\GetCurrentObject","Ptr",dc,"UInt",6,"Ptr")
                V48Assert(IQT141Weight(font)=(column=13 ? 700 : 400),"bold stays confined to quartile column")
            }
        }
        finally DllCall("Gdi32\RestoreDC","Ptr",dc,"Int",prior),DllCall("User32\ReleaseDC","Ptr",lv.Hwnd,"Ptr",dc)
        IQO140OnlyDamage(),IQOApplyMode(IPM,true)
        snap := IPMSnapshot({Data:f.Data,Segment:f.Segment,State:"IMPORTED",Pending:0}),p := IPMPanelFor("Damage")
        IPMEnsureGui("Damage",0,p),IPMRender("Damage",snap,p)
        loop 8 {
            V48Assert(IQT141Weight(SendMessage(0x31,0,0,p.Rows[A_Index].Value.Hwnd))=700,"overlay quartile range is bold")
            V48Assert(IQT141Weight(SendMessage(0x31,0,0,p.Rows[A_Index].Total.Hwnd))=400,"DPS remains normal weight")
        }
        IUB.QuartileColors := false,p.Signature := "",IPMRender("Damage",snap,p)
        V48Assert(IQT141Weight(SendMessage(0x31,0,0,p.Rows[1].Value.Hwnd))=700,"color-off retains readable bold range")
        IQOApplyMode(IPM,false),IPMRender("Damage",snap,p)
        loop 8
            V48Assert(IQT141Weight(SendMessage(0x31,0,0,p.Rows[A_Index].Value.Hwnd))=400,"ordinary Damage view restores normal DPS weight")
    }
    finally IPMDestroyPanels(),IPM := saved
}

; Native estimates, ties, identity/sorting and independent source regressions.
IQP143Math()
{
    r := {Curve:[]}
    loop 101
        r.Curve.Push((A_Index-1)*100)
    for pair in [[0,0],[49,0.49],[50,0.50],[1250,12.50],[4999,49.99],[9550,95.50],[9999.9,99.99],[10000,100],[999999,100]]
        V48Assert(IQTEstimate(pair[1],r)=pair[2],"interpolation keeps two decimals without promoting a submaximum result: " pair[1])
    for invalid in [-1,"","--"]
        V48Assert(!IsNumber(IQTEstimate(invalid,r)),"invalid DPS has no fabricated estimate")
    for invalid in ["",{}, {Curve:[]}, {P25:100,P50:200,P75:300}]
        V48Assert(!IsNumber(IQTEstimate(100,invalid)),"no fallback interpolation from quartiles or missing curves")
    V48Assert(IQTLabel(0)==IUNDecimal("0.00") && IQTLabel(95.5)==IUNDecimal("95.50")
        && IQTLabel(100)==IUNDecimal("100.00") && IQTLabel("")="—","labels display two decimals and keep unavailable values distinct")
    for pair in [[0,1],[24.99,1],[25,2],[49.99,2],[50,3],[74.99,3],[75,4],[89.99,4],[90,5],[99.99,5],[100,5],["",0]]
        V48Assert(IQTPercentileBucket(pair[1])=pair[2],"color band for displayed percentile " pair[1])
    br := IQTReferences().Rows["DF-BR|2031339142381602"]
    V48Assert(br.Count=2548 && br.Curve[96]=26875 && br.Curve[97]=27068,"Brontes values match independent captured UI evidence")
    V48Assert(IQTEstimate(27000,br)=95.65 && IQTEstimate(28106,br)=99,"real captured Brontes thresholds produce the interpolated and exact boundary values")
}

IQP143Ties()
{
    r := {Curve:[]}
    loop 101
        r.Curve.Push(100)
    V48Assert(IQTEstimate(100,r)=50,"constant reference has a midpoint estimate, never automatic 100")
    V48Assert(IQTEstimate(99,r)=0 && IQTEstimate(101,r)=100,"outside a constant reference is clamped")
    loop 101
        r.Curve[A_Index] := Floor((A_Index-1)/10)*100
    V48Assert(IQTEstimate(200,r)=24.5,"a rounded internal plateau uses its percentile midpoint")
    V48Assert(IQTEstimate(250,r)=29.5,"interpolation proceeds from the end of the lower plateau")
    loop 101
        r.Curve[A_Index] := Min((A_Index-1)*100,9000)
    V48Assert(IQTEstimate(9000,r)=95,"a maximum plateau does not automatically become 100")
    V48Assert(IQTEstimate(9001,r)=100,"a result above the captured maximum is capped")
}

IQP143References()
{
    refs := IQTReferences(),seen := Map()
    V48Assert(refs.Date="2026-11-08" && refs.Bosses.Count=38 && refs.Rows.Count=1820,"new dated snapshot covers the actual available MM references")
    for key,r in refs.Rows {
        if seen.Has(r)
            continue
        seen[r] := true
        V48Assert(r.Curve.Length=101,"every distinct boss/spec reference has 101 points")
        previous := -1
        for value in r.Curve {
            V48Assert(IsInteger(value) && value>=previous,"captured integer curve is monotonic")
            previous := value
        }
        V48Assert(r.Minimum=r.Curve[1] && r.P25=r.Curve[26] && r.P50=r.Curve[51]
            && r.P75=r.Curve[76] && r.Maximum=r.Curve[101] && r.Count>0,"metadata and compatibility cutoffs match the full curve")
    }
    V48Assert(seen.Count=910,"mirrors share 910 curve objects, avoiding duplicate reference allocations")
}

IQP143Sorting() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQR145SortCase)))

; Generic fixtures only. Real-file integration is additionally exercised outside the shipped diagnostics.
IQR145RaidCase()
{
    global IP
    f := IQV139Ready(),u := IPWState(),lv := IP.PlayersLV,before := IAFrozenTarget(f.Segment)
    V48Assert(u.Tab=7 && lv.GetCount()=8 && IQTState().Graded=8,"existing Raid table shows every eligible player")
    V48Assert(!u.Controls.Has("QuartilePlayers") && IPWTabs().Length=13,"no extra percentile page is constructed")
    for i,key in f.Keys {
        row := V7428RaidRow(key),item := IQTState().Rows[key]
        V48Assert(lv.GetText(row,13)=IQTLabel(item.Percentile) && lv.GetText(row,14)=item.Percentile,"each visible rank has its own numeric sort value")
        V48Assert(lv.GetText(row,3)=IPMNumber(IPRate(f.Segment.Totals[key].Damage,IPDuration(f.Segment))),"DPS arithmetic and formatting stay unchanged")
    }
    rect := Buffer(16,0),NumPut("Int",12,rect,4),row := V7428RaidRow(f.Keys[1])
    V48Assert(SendMessage(0x1038,row-1,rect.Ptr,lv.Hwnd),"native rank column has real bounds")
    tip := IRCExactAt(lv,NumGet(rect,0,"Int")+2,(NumGet(rect,4,"Int")+NumGet(rect,12,"Int"))//2)
    V48Assert(InStr(tip,"more damage per second") && InStr(tip,"Nefra") && InStr(tip,IQPHSpec(f.Segment,f.Keys[1])),"the native rank cell explains the displayed DPS estimate for this spec and fight")
    V48Assert(!IABaseReconcile(f.Segment,before).Length,"new visible column never changes the encounter ledger")
    IPWClearData(),V48Assert(lv.GetCount()=0 && IQTState().Rows.Count=0,"clearing the source clears all ranks")
}

IQR145SourceCase()
{
    global IP,IPM
    saved := IPM,IPM := IPMNewState()
    try {
        f := IQV139Ready(),q := IQTState(),IPM.Mode := 2,IPM.DamageQuartiles := true
        other := f.Segment.Clone(),other.ModeId := "unrecognized-mode"
        snapshot := IPMSnapshot({Data:f.Data,Segment:other,State:"IMPORTED",Pending:0})
        V48Assert(snapshot.Quartiles.Graded=0 && q.Graded=8,"an unsupported overlay source cannot clear Raid estimates")
        V7875RaidTargetChoose("bosses")
        V48Assert(q.Graded=0,"boss-only filtering does not reuse all-target references")
        snapshot := IPMSnapshot({Data:f.Data,Segment:f.Segment,State:"IMPORTED",Pending:0})
        V48Assert(snapshot.Quartiles.Graded=8,"Raid filters do not change the independent overlay source")
        V7875RaidTargetChoose("")
        V48Assert(q.Graded=8,"all targets restores matching Raid estimates")
        IPM.DamageQuartiles := false
        V48Assert(IPMSnapshot({Data:f.Data,Segment:f.Segment,State:"IMPORTED",Pending:0}).Quartiles.Rows.Count=0,"ordinary overlay mode does no percentile work")
    }
    finally IPM := saved
}

IQR145ColorsCase()
{
    global IP,IUB
    f := IQV139Ready(),u := IPWState(),lv := IP.PlayersLV,row := V7428RaidRow(f.Keys[1])
    dps := lv.GetText(row,3),rank := lv.GetText(row,13)
    V48Assert(IQVCellColor(lv,row,IUBPalette())!="","percentile colors initially available")
    u.Controls["RaidPercentileColors"].Value := 0,IQVColorsChanged(u.Controls["RaidPercentileColors"]),row := V7428RaidRow(f.Keys[1])
    V48Assert(!IUB.QuartileColors && IQVCellColor(lv,row,IUBPalette())="","Raid checkbox disables rank ink")
    V48Assert(ITBCellColors({NameScope:"pull"},lv,row-1,13,IUBPalette()).Text=IUBPalette().Text,"plain rank uses ordinary readable text")
    V48Assert(lv.GetText(row,3)=dps && lv.GetText(row,13)=rank && IQTState().Graded=8,"color choice preserves numeric values")
    u.Controls["RaidPercentileColors"].Value := 1,IQVColorsChanged(u.Controls["RaidPercentileColors"]),row := V7428RaidRow(f.Keys[1])
    V48Assert(IUB.QuartileColors && IQVCellColor(lv,row,IUBPalette())!="" && !IP.Active,"reenabling colors never starts the parser")
}

IQR145SortCase()
{
    global IP
    f := IQV139Ready(),lv := IP.PlayersLV
    IPWSort("Raid",lv,13),previous := 101
    loop lv.GetCount() {
        value := lv.GetText(A_Index,14)+0,key := lv.GetText(A_Index,9)
        V48Assert(value<=previous && lv.GetText(A_Index,13)=IQTLabel(IQTState().Rows[key].Percentile),"descending rank sort preserves actor identity")
        previous := value
    }
    IPWSort("Raid",lv,13),previous := -1
    loop lv.GetCount() {
        value := lv.GetText(A_Index,14)+0,V48Assert(value>=previous,"ascending ranks sort numerically"),previous := value
    }
    key := f.Keys[1],f.Segment.Totals[key].Damage := 0,V7428RaidRedraw(),row := V7428RaidRow(key)
    V48Assert(lv.GetText(row,13)==IUNDecimal("0.00") && lv.GetText(row,14)="0","zero remains a valid rank")
    f.Segment.DisplayDisciplines[key] := "mixed",V7428RaidRedraw(),row := V7428RaidRow(key)
    V48Assert(lv.GetText(row,13)="—" && lv.GetText(row,14)="-1","missing spec clears visible and sort values")
    loop lv.GetCount()
        lv.Modify(A_Index,"Col14",40)
    lv.Modify(1,"Col14",98.11),lv.Modify(2,"Col14",98.92)
    IPWState().Sorts["Raid"] := {Column:13,Desc:true}
    IPWSortSaved("Raid",lv)
    V48Assert(lv.GetText(1,14)=98.92 && lv.GetText(2,14)=98.11,"Raid sorts the fraction within the same whole percentile")
}

IQR145RetiredTab() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQR145RetiredCase)))
IQR145RetiredCase()
{
    global IP,SETTINGS_FILE
    f := IQV139Ready(),tabs := IPWTabs(),order := IPWTabOrder()
    V48Assert(tabs.Length=13 && order.Length=13 && IPWTIconsCatalog().Count=13,"thirteen original pages retain matching native artwork")
    for name in tabs
        V48Assert(name!="Percentiles" && name!="Quartiles","no separate percentile tab remains")
    for id in order
        V48Assert(IPWTabLogical(IPWTabPosition(id))=id,"all original logical tab IDs stay stable")
    V48Assert(IPWTabPosition(14)=IPWTabPosition(7),"retired page links lead to Raid")
    IniWrite(1,SETTINGS_FILE,"IrisWorkspace","RaidHomeVersion"),IniWrite(14,SETTINGS_FILE,"IrisWorkspace","Tab"),IPWLoadPrefs()
    V48Assert(IPWState().Tab=7,"saved percentile-page preference migrates to Raid")
}

IQR145UnavailableReason() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQR145UnavailableCase)))
IQR145UnavailableCase()
{
    global IP
    f := IQV139Ready(),seg := f.Segment,lv := IP.PlayersLV
    seg.ModeId := "unrecognized-mode",V7428RaidRedraw()
    V48Assert(!IQTState().Graded && InStr(IQTState().Reason,"Choose a recorded Story, Veteran or Master / NiM operation"),"unrecognized modes have no estimates")
    for key in f.Keys {
        row := V7428RaidRow(key)
        V48Assert(lv.GetText(row,13)="—","unsupported saved-mode rows show a dash")
    }
    seg.ModeId := "836045448953655",seg.Terminal := false,V7428RaidRedraw()
    V48Assert(!IQTState().Graded && InStr(IQTState().Reason,"confirmed boss kill"),"active or failed pulls have no final estimate")
    seg.Terminal := true,seg.Partial := true,V7428RaidRedraw()
    V48Assert(!IQTState().Graded && InStr(IQTState().Reason,"incomplete"),"partial pulls have no estimate")
    seg.Partial := false,V7428RaidRedraw(),V48Assert(IQTState().Graded=8,"returning to a complete eligible kill restores grades")
}

IQR145RecoveredCoverage() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQR145RecoveredCase)))
IQR145RecoveredCase()
{
    global IPM
    f := IQV139Ready(),source := IPNewData("Recovered source",3000),saved := IPM,IPM := IPMNewState()
    try {
        IPMarkQuality(source,"earlier coverage gap")
        selected := IPNewSegment(source,f.Segment.Start,"observed combat entry")
        V48Assert(source.Partial && !selected.Partial && !selected.QualityReasons.Count,"real quality journal retains the source warning but clears a new trustworthy interval")
        for name,value in f.Segment.OwnProps()
            if name!="Partial" && name!="QualityReasons"
                selected.%name% := value
        view := {Totals:selected.Totals,Seconds:IPDuration(selected)},before := IAFrozenTarget(selected)
        model := IQTEvaluate(source,selected,view)
        V48Assert(model.Graded=8,"complete kill after the recovered boundary receives per-player estimates")
        V48Assert(model.Rows[f.Keys[1]].SourceWarning,"complete selected pull retains the source warning")
        IPM.Mode := 2,IPM.DamageQuartiles := true
        snapshot := IPMSnapshot({Data:source,Segment:selected,State:"IMPORTED",Pending:0})
        V48Assert(snapshot.Partial && snapshot.Quartiles.Graded=8,"source warning badge remains while the complete selected pull is graded")
        selected.Partial := true
        V48Assert(!IQTEvaluate(source,selected,view).Graded && !IPMSnapshot({Data:source,Segment:selected,State:"IMPORTED",Pending:0}).Quartiles.Graded,"an actually partial selected pull remains ungraded in both views")
        selected.Partial := false,source.Halted := true
        V48Assert(!IQTEvaluate(source,selected,view).Graded,"halted source still refuses a grade")
        V48Assert(!IABaseReconcile(selected,before).Length,"coverage presentation never changes the metric ledger")
    }
    finally IPM := saved
}

; Independent VM snapshot and source routing; no game/audio/settings interaction.
IQP146References()
{
    mm := IQTReferences(),vm := IQTReferences("VM"),seen := Map()
    V48Assert(mm.Rows.Count=1820 && mm.Bosses.Count=38,"existing MM snapshot remains intact")
    V48Assert(vm.Rows.Count=3334 && vm.Bosses.Count=70,"VM aliases and spec references match the independently validated capture manifest")
    V48Assert(vm.Mode="VM" && vm.Date="2026-11-08" && vm!=mm,"difficulty caches are independent")
    for key,r in vm.Rows {
        V48Assert(r.Mode="VM","each VM lookup retains its difficulty")
        if seen.Has(r)
            continue
        seen[r] := true,previous := -1
        V48Assert(r.Curve.Length=101 && r.Count>0,"each VM curve has a complete nonempty reference")
        for value in r.Curve {
            V48Assert(IsInteger(value) && value>=previous,"all 101 VM cutoffs remain monotonic integers")
            previous := value
        }
    }
    V48Assert(seen.Count=1502,"aliases and faction mirrors share their curve objects")
    pyro := "2031339142381602",v := vm.Rows["DF-BR|" pyro],m := mm.Rows["DF-BR|" pyro]
    V48Assert(v.Count=260 && v.Curve[51]=21834 && m.Count=2548 && m.Curve[51]=23463,"independent Brontes VM and MM source rows remain different")
    V48Assert(IQTEstimate(21834,v)=50 && IQTEstimate(21834,m)!=50,"the same DPS receives the appropriate difficulty's estimate")
    V48Assert(vm.Rows["RAV-SP-V|" pyro]=vm.Rows["RAV-SP|" pyro],"equivalent Veteran Sparky keys share one curve")
    V48Assert(vm.Rows["DX-HV|" pyro]=vm.Rows["DX-HMM|" pyro],"the two stored Huntmaster keys resolve within the selected VM pool")
    V48Assert(!IQTReferences("unsupported").Rows.Count && !IQTReferences("").Rows.Count,"unsupported modes never fall back to another pool")
}

IQP146Difficulty() => V58Isolated(IQP146DifficultyCase)
IQP146DifficultyCase()
{
    f := IQT138Ready(),seg := f.Segment,view := IRPWhole(seg),key := f.Keys[1]
    mm := IQTEvaluate(f.Data,seg,view),reference := mm.Rows[key].Reference
    seg.ModeId := "836045448953652",vm := IQTEvaluate(f.Data,seg,view)
    V48Assert(vm.Graded=8 && vm.Mode="VM","completed 8-player Veteran kills grade every known spec")
    for actor,item in vm.Rows
        V48Assert(item.Reference=IQTReferences("VM").Rows[seg.BossKey "|" IPIDiscipline(seg,actor)],"every VM player uses the VM boss/spec pool")
    V48Assert(mm.Mode="MM" && mm.Rows[key].Reference=reference && reference.Mode="MM","evaluating VM never mutates an earlier MM result")
    for mode in ["unrecognized-mode","836045448953657",""] {
        seg.ModeId := mode
        V48Assert(!IQTEvaluate(f.Data,seg,view).Graded,"unknown and unrecorded modes never use a supported snapshot")
    }
    seg.ModeId := "836045448953652",seg.BossKey := "missing-boss"
    model := IQTEvaluate(f.Data,seg,view)
    V48Assert(!model.Graded && InStr(model.Reason,"No captured 8-player VM reference"),"missing VM bosses receive no fabricated size or difficulty fallback")
    seg.BossKey := "DF-NE",seg.Partial := true
    V48Assert(!IQTEvaluate(f.Data,seg,view).Graded,"VM still rejects incomplete recordings")
    seg.Partial := false,seg.Terminal := false
    V48Assert(!IQTEvaluate(f.Data,seg,view).Graded,"VM still requires a confirmed kill")
    seg.Terminal := true
    V48Assert(!IQTEvaluate(f.Data,seg,view,2,"").Graded && !IQTEvaluate(f.Data,seg,view,1,"bosses").Graded,"VM whole-fight/all-target rules match MM")
}

IQP146RaidAndOverlay() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQP146RaidAndOverlayCase)))
IQP146RaidAndOverlayCase()
{
    global IP,IPM
    f := IQV139Ready(),seg := f.Segment,lv := IP.PlayersLV,saved := IPM,IPM := IPMNewState()
    try {
        seg.ModeId := "836045448953652",V7428RaidRedraw(),q := IQTState()
        V48Assert(q.Graded=8 && q.Mode="VM" && IPWTabs().Length=13,"VM uses the same existing Raid page")
        for key in f.Keys {
            row := V7428RaidRow(key),item := q.Rows[key]
            V48Assert(lv.GetText(row,13)=IQTLabel(item.Percentile) && lv.GetText(row,14)=item.Percentile,"native VM cells display the calculated estimate and numeric sort key")
        }
        IPM.Mode := 2,IPM.DamageQuartiles := true
        snap := IPMSnapshot({Data:f.Data,Segment:seg,State:"IMPORTED",Pending:0})
        V48Assert(snap.Quartiles.Graded=8 && snap.Quartiles.Mode="VM","existing single Damage overlay supports VM")
        other := seg.Clone(),other.ModeId := "836045448953655"
        snap := IPMSnapshot({Data:f.Data,Segment:other,State:"IMPORTED",Pending:0})
        V48Assert(snap.Quartiles.Graded=8 && snap.Quartiles.Mode="MM" && q.Mode="VM","overlay MM source and Raid VM selection remain independent")
        seg.ModeId := "836045448953655",V7428RaidRedraw()
        V48Assert(q.Mode="MM" && q.Rows[f.Keys[1]].Reference.Mode="MM","switching back restores the Master reference")
    }
    finally IPM := saved
}

; Offline six-scope references and hidden native presentation regressions.
; Capture-manifest counts are hydrated before this file enters diagnostics.
IQP147Scopes()
{
    return [
        {Mode:"MM",Size:8,Id:"836045448953655",References:1820,Bosses:38,Curves:910,New:false},
        {Mode:"VM",Size:8,Id:"836045448953652",References:3334,Bosses:70,Curves:1502,New:false},
        {Mode:"SM",Size:8,Id:"836045448953651",References:3456,Bosses:72,Curves:1512,New:true},
        {Mode:"SM",Size:16,Id:"836045448953653",References:3216,Bosses:67,Curves:1392,New:true},
        {Mode:"VM",Size:16,Id:"836045448953654",References:3158,Bosses:67,Curves:1365,New:true},
        {Mode:"MM",Size:16,Id:"836045448953656",References:1652,Bosses:38,Curves:805,New:true}]
}

IQP147References()
{
    prior := [],owners := Map()
    for scope in IQP147Scopes() {
        refs := IQTReferences(scope.Mode,scope.Size),label := IQTModeLabel(scope.Mode,scope.Size),seen := Map()
        V48Assert(refs.Rows.Count=scope.References && refs.Bosses.Count=scope.Bosses,label " counts match the validated capture manifest")
        V48Assert(refs.Mode=scope.Mode && refs.Size=scope.Size && RegExMatch(refs.Date,"^\d{4}-\d{2}-\d{2}$"),label " pool retains its exact source metadata and ISO capture date")
        V48Assert(IQTReferences(scope.Mode,scope.Size)=refs,label " reuses its own lazy cache")
        V48Assert(IQTMode({ModeId:scope.Id})=scope.Mode && IQTSize({ModeId:scope.Id})=scope.Size,label " has the exact recorded game mode ID")
        V48Assert(label=scope.Size "-player " scope.Mode,"visible reference labels identify both size and difficulty")
        for other in prior
            V48Assert(refs!=other,"each size and difficulty has an independent reference map")
        prior.Push(refs)
        for key,r in refs.Rows {
            V48Assert(r.Mode=scope.Mode && r.Size=scope.Size && r.Date=refs.Date,label " lookup retains its own size, difficulty and capture date")
            V48Assert(IPICatalog().Has(StrSplit(key,"|")[2]),label " uses a recognized mirrored discipline ID")
            if seen.Has(r)
                continue
            V48Assert(!owners.Has(r),"a curve object never leaks into another size or difficulty")
            seen[r] := true,owners[r] := label
            if !scope.New
                continue
            V48Assert(r.Curve.Length=101 && r.Count>0,label " curve has 101 cutoffs and a nonempty sample")
            previous := -1
            for value in r.Curve {
                V48Assert(IsInteger(value) && value>=previous,label " cutoffs are complete monotonic integers")
                previous := value
            }
        }
        V48Assert(seen.Count=scope.Curves,label " aliases and faction mirrors share exactly the captured curves")
    }
    V48Assert(IQTReferences()=IQTReferences("MM",8) && IQTReferences("VM")=IQTReferences("VM",8),"existing default callers retain their 8-player pools")
    ; Independently recorded Brontes Pyrotech medians and counts, not derived
    ; from the runtime's own parser or percentile estimator.
    for golden in [["SM",8,696,13611],["SM",16,131,12978],["VM",16,70,18898],["MM",16,322,22642]] {
        r := IQTReferences(golden[1],golden[2]).Rows["DF-BR|2031339142381602"]
        V48Assert(r.Count=golden[3] && r.Curve[51]=golden[4],"independent Brontes source median and count identify " IQTModeLabel(golden[1],golden[2]))
        V48Assert(IQTEstimate(golden[4],r)=50,"independent unique median grades as 50 in the correct size/difficulty pool")
    }
    for id in ["2031339142381613","2031339142381573"]
        V48Assert(IQTReferences("VM",8).Rows.Has("G-AE|" id) && !IQTReferences("VM",16).Rows.Has("G-AE|" id),"Sisters Combat/Carnage reference presence remains different between 8VM and 16VM")
    for unsupported in [["unsupported",8],["",8],["SM",0],["VM",32],["MM",0],["unsupported",16],["",16]]
        V48Assert(!IQTReferences(unsupported[1],unsupported[2]).Rows.Count,"unsupported scope never falls back to an available pool")
    for id in ["unrecognized-mode","836045448953657",""]
        V48Assert(IQTMode({ModeId:id})="" && IQTSize({ModeId:id})=0,"unrecorded size/difficulty stays unknown")
}

IQP147Probe(refs)
{
    preferred := "DF-NE|2031339142381602"
    if refs.Rows.Has(preferred)
        return {Key:preferred,Boss:"DF-NE",Spec:"2031339142381602",Reference:refs.Rows[preferred]}
    for key,r in refs.Rows {
        parts := StrSplit(key,"|")
        ; This presentation fixture does not exercise the Trandoshan kill ledger.
        if parts[1]!="DX-TR"
            return {Key:key,Boss:parts[1],Spec:parts[2],Reference:r}
    }
    return ""
}

IQP147Ready(scope,native := false)
{
    global IP
    ; V58UseFixture constructs a main window each time. Release the preceding
    ; fixture and its workspace-owned row arrays before building the next one.
    ; The separate Damage overlay remains alive for the window-reuse checks.
    if IsObject(IP.Gui)
        IP.Gui.Destroy()
    IP.Gui := "",IP.Workspace := IPWNewState()
    ; Synthetic completed encounter: tests source routing, not encounter detection.
    f := native ? IQV139Ready() : IQT138Ready(),seg := f.Segment
    seg.ModeId := scope.Id,seg.Opponent := "Synthetic " IQTModeLabel(scope.Mode,scope.Size)
    probe := IQP147Probe(IQTReferences(scope.Mode,scope.Size))
    while f.Keys.Length<scope.Size {
        key := "@Scope Player " f.Keys.Length "#" (9500+f.Keys.Length)
        IPStoreActor(seg,IPActor(key)),f.Keys.Push(key)
    }
    if IsObject(probe) {
        seg.BossKey := probe.Boss
        for i,key in f.Keys {
            seg.Actors[key].Name := "Scope Player " i,seg.DisplayDisciplines[key] := probe.Spec
            seg.Totals[key].Damage := probe.Reference.Curve[Min(100,i*5)+1]*IPDuration(seg)
        }
    }
    f.Probe := probe
    if native
        V7428RaidRedraw()
    return f
}

IQP147ScopeRouting() => V58Isolated(IQP147ScopeRoutingCase)
IQP147ScopeRoutingCase()
{
    models := []
    for scope in IQP147Scopes() {
        f := IQP147Ready(scope),seg := f.Segment,view := IRPWhole(seg),label := IQTModeLabel(scope.Mode,scope.Size)
        before := IAFrozenTarget(seg),model := IQTEvaluate(f.Data,seg,view)
        V48Assert(model.Mode=scope.Mode && model.Size=scope.Size && model.Date=IQTReferences(scope.Mode,scope.Size).Date,label " model preserves exact scope and capture date")
        if !scope.Curves {
            V48Assert(!model.Graded && InStr(model.Reason,"No captured " label " reference"),label " absent capture remains honestly ungraded")
            continue
        }
        V48Assert(IsObject(f.Probe) && model.Graded=scope.Size,label " complete known-spec roster is graded")
        for key in f.Keys {
            item := model.Rows[key]
            V48Assert(item.Reference=f.Probe.Reference && item.Reference.Mode=scope.Mode && item.Reference.Size=scope.Size,label " every player uses the exact boss/spec pool")
        }
        models.Push({Model:model,Reference:f.Probe.Reference,Key:f.Keys[1],Mode:scope.Mode,Size:scope.Size,Date:model.Date})
        V48Assert(!IABaseReconcile(seg,before).Length,label " grading never changes recorded metrics")
        seg.Partial := true,V48Assert(!IQTEvaluate(f.Data,seg,view).Graded,label " partial pull is ungraded"),seg.Partial := false
        f.Data.Halted := true,V48Assert(!IQTEvaluate(f.Data,seg,view).Graded,label " halted source is ungraded"),f.Data.Halted := false
        seg.Terminal := false,V48Assert(!IQTEvaluate(f.Data,seg,view).Graded,label " active or unconfirmed pull is ungraded"),seg.Terminal := true
        seg.WipeEnded := true,V48Assert(!IQTEvaluate(f.Data,seg,view).Graded,label " wipe is ungraded"),seg.WipeEnded := false
        V48Assert(!IQTEvaluate(f.Data,seg,view,2,"").Graded && !IQTEvaluate(f.Data,seg,view,1,"bosses").Graded,label " phase and target filters do not reuse full-fight references")
        seg.DisplayDisciplines[f.Keys[1]] := "mixed"
        V48Assert(IQTEvaluate(f.Data,seg,view).Graded=scope.Size-1,label " mixed spec affects only that actor")
        seg.DisplayDisciplines[f.Keys[1]] := "9999999999999999",missing := IQTEvaluate(f.Data,seg,view)
        V48Assert(!missing.Rows[f.Keys[1]].Bucket && !IsObject(missing.Rows[f.Keys[1]].Reference),label " missing spec receives no other-spec or other-pool substitute")
        seg.DisplayDisciplines[f.Keys[1]] := f.Probe.Spec,seg.BossKey := "missing-boss",missing := IQTEvaluate(f.Data,seg,view)
        V48Assert(!missing.Graded && InStr(missing.Reason,"No captured " label " reference"),label " missing boss receives no size or difficulty fallback")
        for id in ["unrecognized-mode","836045448953657",""] {
            seg.BossKey := f.Probe.Boss,seg.ModeId := id,unknown := IQTEvaluate(f.Data,seg,view)
            V48Assert(!unknown.Graded && unknown.Mode="" && unknown.Size=0,"unknown recorded mode never borrows a six-scope pool")
        }
    }
    for kept in models
        V48Assert(kept.Model.Mode=kept.Mode && kept.Model.Size=kept.Size && kept.Model.Date=kept.Date && kept.Model.Rows[kept.Key].Reference=kept.Reference,"evaluating later scopes never changes a previously returned model")
    f := IQP147Ready(IQP147Scopes()[5]),seg := f.Segment,key := f.Keys[1],seg.BossKey := "G-AE"
    seg.DisplayDisciplines[key] := "2031339142381573",view := IRPWhole(seg),missing := IQTEvaluate(f.Data,seg,view)
    V48Assert(missing.Eligible && !missing.Rows[key].Bucket && !IsObject(missing.Rows[key].Reference) && InStr(missing.Rows[key].Reason,"No captured samples"),"real missing 16VM Sisters Carnage samples never borrow the available 8VM reference")
    seg.ModeId := "836045448953652",available := IQTEvaluate(f.Data,seg,view)
    V48Assert(available.Rows[key].Bucket && available.Rows[key].Reference=IQTReferences("VM",8).Rows["G-AE|2031339142381573"],"the same known Sisters spec grades only when its actual 8VM pool is selected")
    IQTReset(),V48Assert(IQTState().Mode="" && IQTState().Size=0 && IQTState().Date="" && !IQTState().Rows.Count,"reset clears stale size/difficulty, date and estimates together")
}

IQP147RaidAndOverlay() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQP147RaidAndOverlayCase)))
IQP147RaidAndOverlayCase()
{
    global IP,IPM
    saved := IPM,IPM := IPMNewState()
    try {
        IQO140OnlyDamage(),IQOApplyMode(IPM,true),IPM.MaxRows := 16
        p := IPMPanelFor("Damage"),IPMEnsureGui("Damage",0,p),hwnd := p.Gui.Hwnd
        for scope in IQP147Scopes() {
            f := IQP147Ready(scope,true),seg := f.Segment,lv := IP.PlayersLV,q := IQTState(),label := IQTModeLabel(scope.Mode,scope.Size)
            before := IAFrozenTarget(seg)
            V48Assert(IPWTabs().Length=13 && lv.GetCount()=scope.Size,"all six scopes use the original Raid table and roster")
            V48Assert(q.Mode=scope.Mode && q.Size=scope.Size && q.Date=IQTReferences(scope.Mode,scope.Size).Date,label " Raid state follows the selected pull and its capture date")
            snap := IPMSnapshot({Data:f.Data,Segment:seg,State:"IMPORTED",Pending:0})
            p.Signature := "",IPMRender("Damage",snap,p)
            V48Assert(p.Gui.Hwnd=hwnd && IPMDisplayTargets().Length=1 && !IPM.Panels.Has("Quartiles"),"size/difficulty switches reuse one existing Damage overlay")
            V48Assert(p.RenderedMetric="DamageQuartiles" && p.VisibleRows=scope.Size,label " native overlay renders the full requested roster")
            V48Assert(snap.Quartiles.Mode=scope.Mode && snap.Quartiles.Size=scope.Size,label " overlay model retains independent exact scope")
            if !scope.Curves {
                V48Assert(!q.Graded && !snap.Quartiles.Graded && lv.GetText(V7428RaidRow(f.Keys[1]),13)="—",label " absent captures stay visibly ungraded")
                continue
            }
            V48Assert(q.Graded=scope.Size && snap.Quartiles.Graded=scope.Size,label " both native views grade every eligible player")
            for key in f.Keys {
                row := V7428RaidRow(key),item := q.Rows[key]
                V48Assert(lv.GetText(row,13)=IQTLabel(item.Percentile) && lv.GetText(row,14)=item.Percentile,label " native cells contain the visible estimate and numeric sort key")
                V48Assert(snap.Quartiles.Rows[key].Reference=f.Probe.Reference,label " overlay source never borrows another size or difficulty")
            }
            other := seg.Clone(),other.ModeId := "unrecognized-mode"
            absent := IPMSnapshot({Data:f.Data,Segment:other,State:"IMPORTED",Pending:0})
            V48Assert(!absent.Quartiles.Graded && q.Graded=scope.Size && q.Size=scope.Size,"unsupported overlay source does not clear selected Raid estimates")
            V48Assert(!IABaseReconcile(seg,before).Length && !IP.Active,"native presentation changes no encounter metrics and never starts parsing")
        }
        IPWClearData()
        V48Assert(!IQTState().Rows.Count && IQTState().Size=0 && IQTState().Mode="" && IQTState().Date="","clearing the source removes stale size/difficulty and date from Raid")
    }
    finally IPMDestroyPanels(),IPM := saved
}

; Hidden synthetic fixtures. References are hydrated from validated EHPS captures.
IQH148Scopes()
{
    return [
        {Mode:"MM",Size:8,Id:"836045448953655",References:1866,Bosses:39,Curves:910},
        {Mode:"VM",Size:8,Id:"836045448953652",References:3426,Bosses:72,Curves:1502},
        {Mode:"SM",Size:8,Id:"836045448953651",References:3456,Bosses:72,Curves:1512},
        {Mode:"MM",Size:16,Id:"836045448953656",References:1646,Bosses:38,Curves:802},
        {Mode:"VM",Size:16,Id:"836045448953654",References:3156,Bosses:67,Curves:1364},
        {Mode:"SM",Size:16,Id:"836045448953653",References:3216,Bosses:67,Curves:1392}]
}

IQH148Probe(refs)
{
    preferred := "DF-NE|2031339142381600"
    if refs.Rows.Has(preferred)
        return {Key:preferred,Boss:"DF-NE",Spec:"2031339142381600",Reference:refs.Rows[preferred]}
    for key,r in refs.Rows {
        parts := StrSplit(key,"|")
        if parts[1]!="DX-TR"
            return {Key:key,Boss:parts[1],Spec:parts[2],Reference:r}
    }
    return ""
}

IQH148Ready(scope,native := false)
{
    f := IQP147Ready(scope,native),seg := f.Segment
    probe := IQH148Probe(IQHReferences(scope.Mode,scope.Size))
    if IsObject(probe) {
        seg.BossKey := probe.Boss,seg.BossName := probe.Boss,seg.Opponent := "Synthetic EHPS " IQTModeLabel(scope.Mode,scope.Size)
        for i,key in f.Keys {
            t := seg.Totals[key],amount := probe.Reference.Curve[Min(100,i*5)+1]*IPDuration(seg)
            seg.DisplayDisciplines[key] := probe.Spec
            t.Heal := amount*2+9999,t.Effective := amount,t.HealKnown := 1,t.HealRecords := 1
        }
    }
    f.Probe := probe
    if native
        V7428RaidRedraw()
    return f
}

IQH148References()
{
    owners := Map(),prior := []
    for scope in IQH148Scopes() {
        refs := IQHReferences(scope.Mode,scope.Size),label := IQTModeLabel(scope.Mode,scope.Size),seen := Map()
        V48Assert(refs.Rows.Count=scope.References && refs.Bosses.Count=scope.Bosses,label " EHPS counts match the validated capture manifest")
        V48Assert(refs.Mode=scope.Mode && refs.Size=scope.Size && RegExMatch(refs.Date,"^\d{4}-\d{2}-\d{2}$"),label " healing references retain exact scope and source date")
        V48Assert(IQHReferences(scope.Mode,scope.Size)=refs && refs!=IQTReferences(scope.Mode,scope.Size),label " healing cache is stable and separate from DPS")
        for other in prior
            V48Assert(refs!=other,"healing size/difficulty caches are independent")
        prior.Push(refs)
        for key,r in refs.Rows {
            V48Assert(r.Mode=scope.Mode && r.Size=scope.Size && r.Date=refs.Date,label " lookup retains exact healing source metadata")
            V48Assert(IPICatalog().Has(StrSplit(key,"|")[2]),label " uses a real discipline ID")
            if seen.Has(r)
                continue
            V48Assert(!owners.Has(r),"EHPS curve objects never leak into another pool")
            seen[r] := true,owners[r] := label
            V48Assert(r.Curve.Length=101 && r.Count>0,label " captured healing curve is complete")
            previous := -1
            for value in r.Curve {
                V48Assert(IsInteger(value) && value>=previous,label " cutoffs are monotonic integers")
                previous := value
            }
        }
        V48Assert(seen.Count=scope.Curves,label " faction mirrors and aliases share exactly the expected healing curves")
    }
    ; Values come directly from six visible source tables, independently of the
    ; generated AHK data/dispatcher. Matching counts alone cannot catch swaps.
    for gold in [
        {Mode:"MM",Size:8,Count:2241,P50:23129,Maximum:40321},
        {Mode:"VM",Size:8,Count:565,P50:22367,Maximum:34533},
        {Mode:"SM",Size:8,Count:756,P50:17007,Maximum:29935},
        {Mode:"MM",Size:16,Count:242,P50:23421,Maximum:38140},
        {Mode:"VM",Size:16,Count:122,P50:23402,Maximum:33273},
        {Mode:"SM",Size:16,Count:219,P50:16891,Maximum:31327}] {
        r := IQHReferences(gold.Mode,gold.Size).Rows["DF-BR|2031339142381600"]
        V48Assert(r.Count=gold.Count && r.Curve[51]=gold.P50 && r.Maximum=gold.Maximum,"Brontes Bodyguard literal source values select the correct EHPS pool: " IQTModeLabel(gold.Mode,gold.Size))
    }
    ; Independently observed live leaderboards identify hps-route curves as EHPS.
    V48Assert(IQHReferences("MM",8).Rows["DF-BR|2031339142381600"].Maximum=40321,"Bodyguard maximum matches Parsely EHPS40321.08, not raw HPS41489.68")
    V48Assert(IQHReferences("MM",8).Rows["DF-BR|2031339142381596"].Maximum=37643,"Medicine maximum matches independently observed EHPS37642.68")
    for unsupported in [["",8],["unsupported",16],["MM",0],["VM",32]]
        V48Assert(!IQHReferences(unsupported[1],unsupported[2]).Rows.Count,"unknown healing scope never borrows DPS or another healing pool")
}

IQH148Metrics() => V58Isolated(IQH148MetricsCase)
IQH148MetricsCase()
{
    global IPM,IRTPrefs
    for scope in IQH148Scopes() {
        f := IQH148Ready(scope),seg := f.Segment,view := IRPWhole(seg),before := IAFrozenTarget(seg),model := IQHEvaluate(f.Data,seg,view),label := IQTModeLabel(scope.Mode,scope.Size)
        V48Assert(model.Graded=scope.Size && model.Mode=scope.Mode && model.Size=scope.Size && model.Date=IQHReferences(scope.Mode,scope.Size).Date,label " eligible healer roster uses exact source")
        for key in f.Keys {
            item := model.Rows[key],t := seg.Totals[key]
            V48Assert(item.EHPS=IPRate(t.Effective,view.Seconds) && item.Reference=f.Probe.Reference,label " numerator is effective healing, not larger raw healing")
            V48Assert(item.Percentile=IQTEstimate(item.EHPS,f.Probe.Reference),label " estimates use the displayed effective healing rate")
        }
        V48Assert(!IABaseReconcile(seg,before).Length,"healing evaluation never changes existing recorded totals")
        key := f.Keys[1],t := seg.Totals[key],savedRaw := t.Heal
        t.Heal += 1000000000,rawChange := IQHEvaluate(f.Data,seg,view)
        V48Assert(rawChange.Rows[key].Percentile=model.Rows[key].Percentile,"overheal alone never improves an EHPS grade"),t.Heal := savedRaw
        t.HealKnown := 0,unknown := IQHEvaluate(f.Data,seg,view)
        V48Assert(unknown.Graded=scope.Size-1 && !unknown.Rows[key].Bucket && unknown.Rows[key].Amount=-1,"unknown effective values remain ungraded without raw or zero fallback"),t.HealKnown := 1
        ISHInitSegment(seg),seg.ShieldCredit[key] := 8000
        withShield := IQHEvaluate(f.Data,seg,view,1,"",true)
        V48Assert(withShield.Rows[key].Amount=t.Effective+8000 && model.Rows[key].Amount=t.Effective,"overlay shield setting does not change direct-only Raid healing")
        seg.ShieldCredit[key] := 0
        seg.Partial := true,V48Assert(!IQHEvaluate(f.Data,seg,view).Graded,"partial healing pull is ungraded"),seg.Partial := false
        f.Data.Halted := true,V48Assert(!IQHEvaluate(f.Data,seg,view).Graded,"halted healing source is ungraded"),f.Data.Halted := false
        seg.Terminal := false,V48Assert(!IQHEvaluate(f.Data,seg,view).Graded,"unconfirmed healing fight is ungraded"),seg.Terminal := true
        seg.WipeEnded := true,V48Assert(!IQHEvaluate(f.Data,seg,view).Graded,"wipe healing is ungraded"),seg.WipeEnded := false
        V48Assert(!IQHEvaluate(f.Data,seg,view,2).Graded,"filtered phases do not borrow whole-fight healing ranks")
        filtered := IQHEvaluate(f.Data,seg,view,1,"bosses")
        V48Assert(filtered.Graded=scope.Size && !IQTEvaluate(f.Data,seg,view,1,"bosses").Graded,"damage-only target filters preserve all-target healing grades while DPS stays ungraded")
        for key in f.Keys
            V48Assert(filtered.Rows[key].EHPS=model.Rows[key].EHPS && filtered.Rows[key].Percentile=model.Rows[key].Percentile,"damage targeting leaves healing numerator and grade identical")
        seg.DisplayDisciplines[key] := "mixed",V48Assert(IQHEvaluate(f.Data,seg,view).Graded=scope.Size-1,"changed healing spec is not graded"),seg.DisplayDisciplines[key] := f.Probe.Spec
        seg.DisplayDisciplines[key] := "9999999999999999",absent := IQHEvaluate(f.Data,seg,view)
        V48Assert(!absent.Rows[key].Bucket && !IsObject(absent.Rows[key].Reference),"missing healing spec never uses a DPS or another-spec reference"),seg.DisplayDisciplines[key] := f.Probe.Spec
        seg.BossKey := "missing-boss",V48Assert(!IQHEvaluate(f.Data,seg,view).Graded,"missing healing boss stays ungraded"),seg.BossKey := f.Probe.Boss
        seg.ModeId := "unrecognized-mode",V48Assert(!IQHEvaluate(f.Data,seg,view).Graded,"unknown mode stays ungraded"),seg.ModeId := scope.Id
    }
    IQTReset(),V48Assert(!IQHState().Rows.Count && !IQHState().Graded && IQHState().Date="","shared source reset clears stale healing ranks")
    IPM.HealingPercentiles := true,IPM.DamageQuartiles := false,IPMSaveSettings(),IPM := IPMNewState(),IPMLoadSettings()
    V48Assert(IQOMode(IPM,"Heal") && !IQOMode(IPM),"healing preference persists independently from DPS")
    values := ILPCapture(IPM,IRTPrefs),values["Display.HealingPercentiles"] := 0,ILPApplyModel(IPM,IRTPrefs,values)
    V48Assert(!IQOMode(IPM,"Heal") && !IQOMode(IPM),"named layouts can restore the independent healing preference")
}

IQH148OnlyHealing()
{
    global IPM
    IPM.Mode := 2
    for kind in IPMViews()
        IPM.Shown[kind] := kind="Heal"
}

IQH148RaidAndOverlay() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQH148RaidAndOverlayCase)))

IQH148CheckCenteredColumn(lv,column)
{
    nativeColumn := Buffer(56,0),NumPut("UInt",1,nativeColumn,0)
    readable := SendMessage(0x105F,column-1,nativeColumn.Ptr,lv.Hwnd) ; LVM_GETCOLUMNW with LVCF_FMT
    V48Assert(readable && (NumGet(nativeColumn,4,"Int")&3)=2,"percentile values are centered in the native column")
    header := SendMessage(0x101F,0,0,lv.Hwnd),item := Buffer(A_PtrSize=8 ? 72 : 48,0)
    NumPut("UInt",4,item,0)
    readable := SendMessage(0x120B,column-1,item.Ptr,header) ; HDM_GETITEMW with HDI_FORMAT
    V48Assert(readable && (NumGet(item,A_PtrSize=8 ? 28 : 20,"Int")&3)=2,"the native and themed percentile headings are centered")
}

IQH148MetricWidths(lv,model)
{
    entry := ITBState().Tables.Get(lv.Hwnd,0)
    V48Assert(IsObject(entry) && entry.NumberFont && entry.Font,"metric width check uses the renderer's actual numeric and header fonts")
    dpsWidth := SendMessage(0x101D,2,0,lv.Hwnd),ehpsWidth := SendMessage(0x101D,4,0,lv.Hwnd)
    V48Assert(ehpsWidth>=dpsWidth,"EHPS retains the same readable rate allocation as DPS")
    headerPadding := 2*Max(5,Round(8*A_ScreenDPI/96))
    V48Assert(IUMTextWidth(lv.GetText(0,7),entry.Font)+headerPadding<=SendMessage(0x101D,6,0,lv.Hwnd),"complete DTPS heading fits the real native header with the renderer's padding")
    for column in [13,15,17] {
        V48Assert(lv.GetText(0,column)="Percentile" && IUMTextWidth("Percentile",entry.Font)+headerPadding<=SendMessage(0x101D,column-1,0,lv.Hwnd),
            "each full percentile heading fits in the Raid table")
        IQH148CheckCenteredColumn(lv,column)
    }
    padding := Ceil(8*A_ScreenDPI/96)
    loop lv.GetCount() {
        key := lv.GetText(A_Index,9),item := model.Rows[key]
        V48Assert(item.EHPS>=10000 && item.EHPS<100000,"width fixture exercises captured five-digit EHPS rather than short placeholder values")
        V48Assert(IUMTextWidth(lv.GetText(A_Index,5),entry.NumberFont)+padding<=ehpsWidth,"complete displayed five-digit EHPS fits its real native cell without ellipsis")
        V48Assert(IUMTextWidth(lv.GetText(A_Index,3),entry.NumberFont)+padding<=dpsWidth,"the adjacent DPS rate remains fully readable")
    }
}

IQH148RaidAndOverlayCase()
{
    global IP,IPM,IUB
    saved := IPM,IPM := IPMNewState()
    try {
        IQH148OnlyHealing(),IQOApplyMode(IPM,true,"Heal"),IPM.MaxRows := 16
        p := IPMPanelFor("Heal"),p.Width := 196,IPMEnsureGui("Heal",0,p),hwnd := p.Gui.Hwnd
        for scope in IQH148Scopes() {
            f := IQH148Ready(scope,true),seg := f.Segment,lv := IP.PlayersLV,model := IQHState(),before := IAFrozenTarget(seg)
            V48Assert(IPWTabs().Length=13 && lv.GetCount("Col")=18 && lv.GetCount()=scope.Size,"healing ranks share original Raid page and stable identity columns")
            V48Assert(model.Graded=scope.Size && IQTState().Graded=scope.Size,"both DPS and healing grades coexist")
            if scope.Size=8 && scope.Mode="MM" {
                previousTheme := IUB.Theme
                try {
                    for theme in ["iris","dark"] {
                        IUB.Theme := theme,IUBApplyWindow(IP.Gui,"main")
                        for size in [[980,650],[1600,820]] {
                            IPResize(IP.Gui,0,size[1],size[2]),IPRefresh()
                            IQH148MetricWidths(lv,model)
                        }
                    }
                }
                finally IUB.Theme := previousTheme,IUBApplyWindow(IP.Gui,"main")
            }
            for key in f.Keys {
                row := V7428RaidRow(key),item := model.Rows[key]
                V48Assert(lv.GetText(row,15)=IQTLabel(item.Percentile) && lv.GetText(row,16)=item.Percentile,"native healing visible and numeric-sort columns contain real grades")
                V48Assert(lv.GetText(row,5)=IPMNumber(item.EHPS) && lv.GetText(row,13)=IQTLabel(IQTState().Rows[key].Percentile),"EHPS grade matches displayed direct value and preserves DPS13/14")
            }
            IPWState().Sorts["Raid"] := {Column:15,Desc:true},IPWSortSaved("Raid",lv)
            V48Assert(lv.GetText(1,16)>=lv.GetText(lv.GetCount(),16),"healing sorting uses numeric column16")
            first := f.Keys[1],rankBefore := IQHState().Rows[first].Percentile,ehpsBefore := lv.GetText(V7428RaidRow(first),5)
            V7875RaidTargetChoose("bosses")
            V48Assert(!IQTState().Graded && IQHState().Graded=scope.Size && IQHState().Rows[first].Percentile=rankBefore && lv.GetText(V7428RaidRow(first),5)=ehpsBefore,"native damage-only selector leaves healing grades and displayed EHPS unchanged")
            V7875RaidTargetChoose("")
            snap := IPMSnapshot({Data:f.Data,Segment:seg,State:"IMPORTED",Pending:0}),p.Signature := "",IPMRender("Heal",snap,p)
            V48Assert(p.Gui.Hwnd=hwnd && p.RenderedMetric="HealingPercentiles" && p.VisibleRows=scope.Size,"healing switch reuses the existing window and full roster")
            heading := p.QuartileHeadings[3],heading.GetPos(,,&width)
            V48Assert(heading.Text="Percentile" && IUMTextWidth(heading.Text,SendMessage(0x31,0,0,heading.Hwnd))<=width,
                "the full percentile heading fits the narrow healing overlay")
            V48Assert(snap.HealerPercentiles.Graded=scope.Size && IPMDisplayTargets().Length=1,"no extra overlay reader or window appears")
            barColor := SendMessage(0x40F,0,0,p.Rows[1].Bar.Hwnd)
            IQOApplyMode(IPM,false,"Heal"),IPMRender("Heal",snap,p)
            V48Assert(p.Gui.Hwnd=hwnd && p.RenderedMetric="Heal","normal effective-healing view remains available")
            V48Assert(barColor=IUBColorRef("329F38") && barColor=SendMessage(0x40F,0,0,p.Rows[1].Bar.Hwnd),"both native healing views use the green meter bar")
            IQOApplyMode(IPM,true,"Heal")
            V48Assert(!IABaseReconcile(seg,before).Length && !IP.Active,"native healing presentation never changes parser totals or starts parsing")
        }
        IPM.Mode := 1,IPM.Metric := "Heal",p := IPMPanelFor("Heal"),IPMEnsureGui("Heal",0,p),IPMRender("Heal",snap,p)
        V48Assert(p.Key="Combined" && p.RenderedMetric="HealingPercentiles" && V58ChildVisible(p.QuartileHeadings[3]),"existing Combined Healing tab shows percentiles")
        IPM.Metric := "Damage",IQOApplyMode(IPM,false,"Damage"),IPMRender("Damage",snap,p)
        V48Assert(!IQOMode() && IQOMode(IPM,"Heal") && p.RenderedMetric="Damage","DPS and healing presentation preferences are independent")
        IUB.QuartileColors := false
        V48Assert(IQHCellColor(IP.PlayersLV,1,{Key:"dark"})="","existing optional-color switch also controls healing ranks")
        IPWClearData(),V48Assert(!IQHState().Rows.Count && IQHState().Mode="" && IQHState().Date="","clearing the source removes stale healing estimates")
    }
    finally IPMDestroyPanels(),IPM := saved
}

IQH149LockedHealingInput() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQH149LockedHealingInputCase)))
IQH149LockedHealingInputCase()
{
    global IP,IPM
    saved := IPM,IPM := IPMNewState()
    try {
        IQH148OnlyHealing()
        snap := IPMOverlaySnapshot(IP,IPM),p := IPMPanelFor("Heal")
        IPMEnsureGui("Heal",0,p)
        for ranks in [false,true] {
            IQOApplyMode(IPM,ranks,"Heal"),IPMRender("Heal",snap,p)
            IPM.ParserControls := false
            V48Assert(!IPMParserEnsureSurface(p) && !p.HasOwnProp("QuartileHit"),"Healing modes have no independent click target")
            IPM.ParserControls := true
            V48Assert(IPMParserEnsureSurface(p) && IPMParserPlaceSurface(p),"Healing still exposes the enabled parser control")
            V48Assert(V58ChildVisible(p.ParserHit) && IPMParserSurfaceOwns(p,p.ParserHit.Hwnd),"locked header accepts clicks only for Start and Stop")
            IPMParserDestroySurface(p)
        }
    }
    finally IPMDestroyPanels(),IPM := saved
}

IQA159Periods()
{
    data := IPNewData("Saved"),seg := {Start:0,SourcePath:""}
    for entry in [["2023-12-04",""],["2023-12-05","7.5.1"],["2024-08-20","7.5.1"],
        ["2024-12-09","7.5.1"],["2024-12-10","7.7.1"],["2025-05-19","7.7.1"],
        ["2025-12-08","7.7.1"],["2025-12-09","live"],["2026-11-10","live"]] {
        seg.SourcePath := "Archive-combat_" entry[1] "_23_10_00_000123.txt"
        V48Assert(IQAPeriod(data,seg).Patch=entry[2],"log date selects the matching dataset on " entry[1])
    }
    seg.SourcePath := "combat_2025-12-08_23_10_00_000123.txt",seg.Start := 86401000
    V48Assert(IQAPeriod(data,seg).Patch="live","the pull date follows the recording past midnight")
    seg.SourcePath := "renamed.txt",seg.Start := 0
    V48Assert(IQAPeriod(data,seg).Patch="","undated imports stay ungraded")
    seg.SourcePath := "",data.SourcePath := "combat_2025-01-02_01_00_00_000123.txt"
    V48Assert(IQAPeriod(data,seg).Patch="7.7.1","cached segments can use the original recording path")
}

IQA159References()
{
    key := "DF-NE|2031339142381602"
    for gold in [["7.5.1",31874,2195,12687,75923,297557,3180,84.29],["7.7.1",32970,2262,13424,99851,293003,2034,75.44]] {
        patch := gold[1]
        V48Assert(IQTReferences("MM",8,patch).Rows[key].P50=gold[2],"Nefra DPS matches the captured " patch " median")
        V48Assert(IQHReferences("MM",8,patch).Rows[key].P50=gold[3],"Nefra EHPS matches the captured " patch " median")
        taken := IQAReferences("DTPS","MM",8,patch).Rows[key],kill := IQAReferences("TTK","MM",8,patch).Rows["DF-NE"]
        V48Assert(taken.P50=gold[4] && IQTEstimate(gold[4],taken)=50,"Nefra DTPS decodes the captured median")
        V48Assert(IQTEstimate(taken.Minimum-1,taken)=100 && IQTEstimate(taken.Maximum+1,taken)=0,"lower damage taken ranks higher")
        V48Assert(kill.Count=gold[7] && !kill.Capped && kill.Samples[1]=gold[5] && kill.Samples[-1]=gold[6],"Nefra uses the captured ranked kill-time range")
        V48Assert(IQAKillRank(kill.Samples[500],kill)=gold[8] && IQAKillRank(gold[6]+1,kill)=0,"TTK ranks within the sample and keeps slower sampled results at its lower bound")
    }
    taken := IQAReferences("DTPS","MM",8,"live").Rows[key]
    V48Assert(taken.P50=13427 && taken.Count=1550,"Live has its own DTPS curve")
    r := {Samples:[1000,2000,2000,4000],Count:4,Capped:false}
    V48Assert(IQAKillRank(2000,r)=50 && IQAKillRank(3000,r)=25 && IQAKillRank(5000,r)=0,"kill-time midranks handle ties and slower uncapped results")
    V48Assert(IQAKillRank(2500,{Samples:[1000,2000,3000],Count:3})=33.33,"kill-time ranks retain fractional precision")
    V48Assert(!IQAReferences("TTK","MM",8,"live").Rows.Has("EV-XR"),"an empty NiM pool cannot borrow a Story kill time")
    V48Assert(!IQTReferences("MM",8,"7.3.1").Rows.Count,"an unavailable archive cannot borrow Live data")
}

IQA159Raid() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQA159RaidCase)))

IQA159RaidCase()
{
    global IP,IUB
    f := IQV139Ready(),seg := f.Segment,data := f.Data,key := f.Keys[1],lv := IP.PlayersLV
    seg.SourcePath := "Archive-combat_2025-08-20_21_00_00_000001.txt"
    seg.FinishAt := seg.Start+129991,seg.Totals[key].Taken := Round(IPDuration(seg)*13424)
    V7428RaidRedraw(),row := V7428RaidRow(key),state := IQARaidState(),c := IPWState().Controls
    V48Assert(IQTState().Patch="7.7.1" && IQHState().Patch="7.7.1" && state.Taken.Patch="7.7.1","all whole-fight player metrics select the archived dataset")
    V48Assert(lv.GetCount("Col")=18 && lv.GetText(row,9)=key && lv.GetText(row,17)==IUNDecimal("50.00")
        && lv.GetText(row,18)+0=50,"Raid shows the historical DTPS estimate beside the existing rate")
    V48Assert(!c.Has("RaidKillTime") && IQF162SelectedCard().TTK=75.44,"TTK percentile appears beside the existing fight duration")
    V48Assert(!c.Has("RaidPercentileNotice") && c["RaidPercentileColors"].Enabled,"Raid has the color control without a percentile footer")
    oldCompact := IUB.CompactDamage,IUB.CompactDamage := true
    try {
        for column in [3,5,7,13,15,17] {
            rect := Buffer(16,0),NumPut("Int",column-1,rect,4)
            V48Assert(SendMessage(0x1038,row-1,rect.Ptr,lv.Hwnd),"Raid metric cell has native hit-test bounds")
            x := NumGet(rect,0,"Int")+2,y := (NumGet(rect,4,"Int")+NumGet(rect,12,"Int"))//2
            tip := IRCExactAt(lv,x,y)
            if column<13
                V48Assert(tip="","rates retain no hover text with Compact damage enabled")
            else if lv.GetText(row,column)!="—"
                V48Assert(InStr(tip,Map(13,"more damage per second",15,"healed more per second",17,"less damage per second")[column]) && InStr(tip,"Nefra"),"graded archived percentile cells explain their own displayed metric")
            else
                V48Assert(tip="","ungraded archived percentile cells have no stale hover text")
        }
    }
    finally IUB.CompactDamage := oldCompact
    oldColors := IUB.QuartileColors
    try {
        IUB.QuartileColors := true
        V48Assert(IQADTPSColor(lv,row,IUBPalette())!="","DTPS uses the established color palette")
        IUB.QuartileColors := false
        V48Assert(IQADTPSColor(lv,row,IUBPalette())="","DTPS follows the shared color toggle")
    }
    finally IUB.QuartileColors := oldColors
    IPWSort("Raid",lv,17),previous := 101
    loop lv.GetCount() {
        score := lv.GetText(A_Index,18)+0
        V48Assert(score<=previous,"DTPS rank sorts numerically")
        previous := score
    }
    V7875RaidTargetChoose("bosses")
    V48Assert(!IQTState().Graded && IQHState().Graded && state.Taken.Graded && state.Kill.Text!="","damage target filtering leaves whole-fight EHPS, DTPS and TTK intact")
    V7875RaidTargetChoose("")
    IQARaidSync(data,seg,IRPWhole(seg),2)
    V48Assert(!state.Taken.Graded && state.Kill.Text!="","phase filtering clears DTPS ranks while the whole-fight TTK remains")
    seg.BossKey := "SNV-OC",V7428RaidRedraw()
    V48Assert(!IQTState().Graded && !IQHState().Graded && !state.Taken.Graded && state.Kill.Text="","Operations Chief avoids unmatched infiltration timing")
    seg.BossKey := "DF-NE",seg.WipeEnded := true,V7428RaidRedraw()
    V48Assert(!state.Taken.Graded && state.Kill.Text="","a wipe clears previous grades")
    IPWClearData()
    V48Assert(!state.Taken.Rows.Count && state.Kill.Text="","clearing the recording clears both metrics")
}

IQA159Challenge() => V58Isolated(IQA159ChallengeCase)

IQA159ChallengeCase()
{
    f := IQT138Ready(),seg := f.Segment,key := f.Keys[1],seg.BossKey := "DF-BR"
    c := {Selected:"brontes:1",Note:"",Duration:20,State:"Completed",Rows:[{Kind:"Player",Key:key,Damage:470000}]}
    resolved := {Segment:seg,Data:f.Data,State:"IMPORTED"}
    id := IPIDiscipline(seg,key)
    for entry in [["2024-08-20","7.5.1"],["2025-08-20","7.7.1"],["2026-11-10","live"]] {
        seg.SourcePath := "combat_" entry[1] "_01_00_00_000123.txt"
        ref := entry[2]="live" ? IQCBrontesReferences()[id] : IQAReferences("Brontes","MM",8,entry[2]).Rows["DF-BR|" id]
        estimates := IQCBrontesEstimate(resolved,c)
        V48Assert(estimates.Get(key,-1)=IQTEstimate(c.Rows[1].Damage/c.Duration,ref),"Brontes Burn uses the saved fight's dataset")
    }
    seg.SourcePath := "undated.txt"
    V48Assert(!IQCBrontesEstimate(resolved,c).Count,"undated Brontes Burn has no reference")
}

IQE161Settings() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQE161SettingsCase)))

IQE161SettingsCase()
{
    global IP,IPM,IUB,SETTINGS_FILE
    f := IQV139Ready(),seg := f.Segment,key := f.Keys[1],lv := IP.PlayersLV,u := IPWState()
    seg.SourcePath := "combat_2025-08-20_21_00_00_000001.txt"
    seg.FinishAt := seg.Start+129991,seg.Last := seg.FinishAt
    seg.Totals[key].Taken := Round(IPDuration(seg)*13424),V7428RaidRedraw()
    dataBefore := IAFrozenTarget(seg),extraMenu := Menu(),IIFAddPercentileSetting(extraMenu)
    V48Assert(IQTEnabled() && (V652TimerMenuState(u.SettingsMenu,"Enable percentiles") & 8),"percentiles default on in the Settings menu")
    V48Assert(IQF162SelectedCard().TTK=75.44 && !InStr(IP.Subtitle.Text,"TTK") && !u.Controls.Has("RaidKillTime"),"TTK is beside the duration in the fight list")
    IPM.Mode := 2,IPM.Shown["Damage"] := true,IPM.Shown["Heal"] := true
    damage := IPM.Panels["Damage"],healing := IPM.Panels["Heal"]
    IPMEnsureGui("Damage",0,damage),IPMEnsureGui("Heal",0,healing)
    V48Assert(IQVTogglePercentiles() && !IQTEnabled(),"Settings disables percentiles")
    V48Assert(!ReadBoolSetting("IrisAppearance","PercentilesEnabled",true),"the disabled preference is saved")
    V48Assert(!(V652TimerMenuState(u.SettingsMenu,"Enable percentiles") & 8)
        && !(V652TimerMenuState(extraMenu,"Enable percentiles") & 8),"registered Settings menus synchronize the preference")
    for column in [13,15,17]
        V48Assert(SendMessage(0x101D,column-1,0,lv.Hwnd)=0,"disabled percentile columns have no width")
    V48Assert(!InStr(IP.Subtitle.Text,"TTK") && !V58ChildVisible(u.Controls["RaidPercentileColors"]),"disabled percentiles have no header or color control")
    V48Assert(!IQTState().Graded && !IQHState().Graded && !IQARaidState().Taken.Graded,"display models clear their old grades")
    snap := IPMSnapshot({Data:f.Data,Segment:seg,State:"IMPORTED",Pending:0})
    IPMRender("Damage",snap,damage),IPMRender("Heal",snap,healing)
    V48Assert(damage.RenderedMetric="Damage" && healing.RenderedMetric="Heal","disabled overlays use their ordinary totals views")
    V48Assert(!snap.Quartiles.Graded && !snap.HealerPercentiles.Graded,"disabled overlay snapshots omit percentile work")
    IPWSort("Raid",lv,17)
    V48Assert(lv.GetText(1,9)=key,"a hidden percentile sort uses its corresponding rate")
    V58SelectTab(1),V58SelectTab(7)
    V48Assert(!V58ChildVisible(u.Controls["RaidPercentileColors"]) && SendMessage(0x101D,12,0,lv.Hwnd)=0,"tab changes preserve the disabled presentation")
    V48Assert(IQVTogglePercentiles() && IQTEnabled(),"Settings enables percentiles again")
    V48Assert(ReadBoolSetting("IrisAppearance","PercentilesEnabled",false)
        && (V652TimerMenuState(extraMenu,"Enable percentiles") & 8),"the enabled preference persists and synchronizes")
    V48Assert(IQTState().Graded && IQHState().Graded && IQARaidState().Taken.Graded && IQF162SelectedCard().TTK=75.44,"enabling restores the selected fight grades")
    for column in [13,15,17]
        V48Assert(SendMessage(0x101D,column-1,0,lv.Hwnd)>0,"enabling restores percentile column widths")
    snap := IPMSnapshot({Data:f.Data,Segment:seg,State:"IMPORTED",Pending:0})
    IPMRender("Damage",snap,damage),IPMRender("Heal",snap,healing)
    V48Assert(damage.RenderedMetric="DamageQuartiles" && healing.RenderedMetric="HealingPercentiles","enabling restores the saved overlay presentations")
    IQOApplyMode(IPM,false,"Damage"),IQVTogglePercentiles(),IQVTogglePercentiles()
    V48Assert(!IQOMode(IPM,"Damage") && IQOMode(IPM,"Heal"),"the master switch preserves independent totals preferences")
    V48Assert(!IABaseReconcile(seg,dataBefore).Length && !IP.Active,"the preference preserves the recorded fight and parser state")
}

IQE161Header() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQE161HeaderCase)))

IQE161HeaderCase()
{
    global IP
    f := IQV139Ready(),seg := f.Segment,f.Data.Label := "Saved recording"
    seg.SourcePath := "combat_2025-08-20_21_00_00_000001.txt"
    seg.FinishAt := seg.Start+129991,seg.Last := seg.FinishAt,V7428RaidRedraw()
    for tab in [1,2,7] {
        V58SelectTab(tab)
        V48Assert(IQF162SelectedCard().TTK=75.44 && !InStr(IP.Subtitle.Text,"TTK"),"the fight list retains TTK across main pages")
    }
    IPResize(IP.Gui,0,980,650),IP.Subtitle.GetPos(&x,&y,&width,&height)
    line := StrSplit(IP.Subtitle.Text,Chr(10))[1],font := SendMessage(0x31,0,0,IP.Subtitle.Hwnd)
    V48Assert(IUMTextWidth(line,font)<=width*A_ScreenDPI/96,"the duration and TTK percentile fit the minimum-width header")
    seg.SourcePath := "undated.txt",V7428RaidRedraw()
    V48Assert(IQF162SelectedCard().TTK="","an undated fight clears the previous TTK estimate")
    seg.SourcePath := "combat_2025-08-20_21_00_00_000001.txt"
    ref := IQAReferences("TTK","MM",8,"7.7.1").Rows[seg.BossKey]
    seg.FinishAt := seg.Start+ref.Samples[-1]+1000,seg.Last := seg.FinishAt,V7428RaidRedraw()
    V48Assert(IGFPercentileLabel(IQF162SelectedCard().TTK)="<1","a kill outside the captured sample uses the requested lower-bound label beside its duration")
    seg.Terminal := false,V7428RaidRedraw()
    V48Assert(IQF162SelectedCard().TTK="","an active or failed pull clears the previous completed TTK estimate")
}

IQF162SelectedCard()
{
    global IP
    return IGFState().Lists[IP.SegmentsLV.Hwnd].Cards[IPSelectedSegment().Id ""]
}

IQF162Cards() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQF162CardsCase)))

IQF162CardsCase()
{
    global IP,IUB
    f := IQV139Ready(),seg := f.Segment
    seg.SourcePath := "combat_2025-08-20_21_00_00_000001.txt"
    seg.FinishAt := seg.Start+129991,seg.Last := seg.FinishAt,V7428RaidRedraw()
    card := IQF162SelectedCard(),selected := IQARaidState().Kill
    V48Assert(card.TTK=75.44 && card.Bucket=4 && card.Duration=" (02:09)","the selected fight card keeps the duration and TTK estimate together")
    V48Assert(!InStr(IP.Subtitle.Text,"TTK"),"TTK is absent from the main fight header")
    cached := IGFCachedCard(seg,f.Data)
    V48Assert(cached=IGFCachedCard(seg,f.Data),"unchanged completed cards reuse their cached estimate")
    other := seg.Clone(),other.Id := 9002,other.FinishAt := other.Start+129023,other.Last := other.FinishAt
    otherCard := IGFCachedCard(other,f.Data),expected := IQAKillRank(129023,IQAReferences("TTK","MM",8,"7.7.1").Rows[seg.BossKey])
    V48Assert(otherCard.TTK=79.50 && otherCard.TTK=expected && otherCard.TTK!=card.TTK,"another fight gets its own independent TTK estimate")
    V48Assert(IQARaidState().Kill=selected,"reading unselected fight cards preserves the selected Raid model")
    seg.WipeEnded := true,V7428RaidRedraw()
    V48Assert(IQF162SelectedCard().TTK="","a newly marked wipe invalidates its completed card cache")
    seg.WipeEnded := false,seg.SourcePath := "undated.txt",V7428RaidRedraw()
    V48Assert(IQF162SelectedCard().TTK="","an undated recording clears the card's previous grade")
    seg.SourcePath := "combat_2025-08-20_21_00_00_000001.txt",V7428RaidRedraw()
    V48Assert(IQF162SelectedCard().TTK=75.44,"restoring its original source restores the correct archive grade")
    sourceKey := f.Data.SourceKey,f.Data.SourceKey := "",seg.SourcePath := ""
    V48Assert(IGFCachedCard(seg,f.Data).TTK="","a new session without a source path or key stays ungraded without a refresh error")
    f.Data.SourceKey := sourceKey,seg.SourcePath := "combat_2025-08-20_21_00_00_000001.txt"
    f.Data.Halted := true,V7428RaidRedraw()
    V48Assert(IQF162SelectedCard().TTK="","a halted source clears cached card grades")
    f.Data.Halted := false,V7428RaidRedraw()
    IQVTogglePercentiles()
    V48Assert(IQF162SelectedCard().TTK="","the master preference removes card estimates")
    IQVTogglePercentiles()
    V48Assert(IQF162SelectedCard().TTK=75.44,"the master preference restores card estimates")
    lv := IP.SegmentsLV,entry := IGFState().Lists[lv.Hwnd]
    V48Assert(!IGFUpdate(lv,f.Data,IPWState().FightRows),"an unchanged list avoids another paint")
    IUB.QuartileColors := false
    V48Assert(IGFUpdate(lv,f.Data,IPWState().FightRows),"the color preference invalidates the list's paint")
    V48Assert(IGFPercentileColor(IQF162SelectedCard(),IUBPalette(),false)="","disabled colors use the timing text color")
}

IQF162Paint() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQF162PaintCase)))

IQF162PaintCase()
{
    global IP,IUB
    f := IQV139Ready(),seg := f.Segment
    seg.SourcePath := "combat_2025-08-20_21_00_00_000001.txt"
    seg.FinishAt := seg.Start+129991,seg.Last := seg.FinishAt,V7428RaidRedraw()
    lv := IP.SegmentsLV,entry := IGFState().Lists[lv.Hwnd],card := IQF162SelectedCard()
    V48Assert(IsNumber(card.TTK) && card.TTK>=1 && IGFPercentileLabel(card.TTK)==IUNDecimal(Format("{:.2f}",card.TTK))
        && card.Bucket=IQTPercentileBucket(card.TTK),"the archived kill displays the exact two-place estimate")
    scale := A_ScreenDPI/96,pad := Round(7*scale)
    client := Buffer(16,0),DllCall("User32\GetClientRect","Ptr",lv.Hwnd,"Ptr",client)
    width := NumGet(client,8,"Int"),height := NumGet(client,12,"Int")
    layout := IGFTimingLayout(card,width-2*pad,entry.Normal,entry.Bold)
    V48Assert(layout.GradeX+layout.GradeW<=width-2*pad && layout.ClockW=IUMTextWidth(card.Clock,entry.Normal),"ordinary timing and grade fit the sidebar without abbreviating clocks")
    wide := card.Clone(),wide.Clock := "+123d 17:29:10 - +123d 17:33:05",wide.Detail := wide.Clock wide.Duration
    small := IGFTimingLayout(wide,Round(150*scale),entry.Normal,entry.Bold)
    V48Assert(small.GradeX+small.GradeW<=Round(150*scale) && small.ClockW<IUMTextWidth(wide.Clock,entry.Normal),"long clocks yield space to the intact duration and grade")
    if IUSHighContrast()
        return
    for theme in ["iris","dark"] {
        IUB.Theme := theme,IUBApplyWindow(IP.Gui,"main")
        for selected in [false,true] {
            lv.Modify(0,"-Select")
            if selected
                lv.Modify(1,"Select")
            canvas := ISRICanvas(width,height)
            try {
                SendMessage(0x317,canvas.DC,0x1C,lv.Hwnd)
                rect := Buffer(16,0),NumPut("Int",0,rect,0),SendMessage(0x100E,0,rect.Ptr,lv.Hwnd)
                middle := (NumGet(rect,4,"Int")+NumGet(rect,12,"Int"))//2
                wanted := IUBColorRef(IGFPercentileColor(card,IUBPalette(),selected)),found := 0
                loop Max(0,NumGet(rect,12,"Int")-middle-2) {
                    y := middle+A_Index-1
                    loop layout.GradeW
                        found += DllCall("Gdi32\GetPixel","Ptr",canvas.DC,"Int",pad+layout.GradeX+A_Index-1,"Int",y,"UInt")=wanted
                }
                V48Assert(found>2 && !entry.Failed,"the actual sidebar paints the grade in its percentile color, theme " theme " selected " selected)
                ISRIWritePng(canvas.Bitmap,A_ScriptDir "\ttk-card-" theme "-" selected ".png")
            }
            finally ISRICanvasClose(canvas)
        }
    }
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"the native fight-card verification never shows the application")
}

IQC164References()
{
    for item in [
        ["7.5.1",8,"DPS",5291,26194],["7.5.1",16,"DPS",109,24109],
        ["7.5.1",8,"EHPS",1495,38082],["7.5.1",16,"EHPS",29,36241],
        ["7.7.1",8,"DPS",5065,26768],["7.7.1",16,"DPS",153,26077],
        ["7.7.1",8,"EHPS",1499,38179],["7.7.1",16,"EHPS",29,35130],
        ["live",8,"DPS",4443,27123],["live",16,"DPS",83,25762],
        ["live",8,"EHPS",1349,37826],["live",16,"EHPS",21,34389]] {
        pool := IQCReferences(item[1],item[2],item[3])
        ids := item[3]="DPS" ? ["2031339142381602","2031339142381638"] : ["2031339142381587","2031339142381619"]
        ref := pool.Rows["nahut|" ids[1]]
        V48Assert(ref=pool.Rows["nahut|" ids[2]] && ref.Count=item[4] && ref.Curve[51]=item[5],"Nahut source median, count and faction mirrors match " item[1] " " item[2] " " item[3])
        V48Assert(ref.Patch=item[1] && ref.Size=item[2] && ref.Metric=item[3],"reference scope stays explicit")
        V48Assert(pool=IQCReferences(item[1],item[2],item[3]),"reference pools are reused")
        for target in ["brontes","raptus","nahut","brontes-and-styrak","voltinator-total"]
            V48Assert(pool.Targets.Has(target),"all common captured challenge types are connected")
    }
    V48Assert(!IQCReferences("live",12).Rows.Count,"a missing size has no reference fallback")
}

IQC164Mapping() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQC164MappingCase)))

IQC164MappingCase()
{
    global IUB
    f := IQV139Ready(),seg := f.Segment,key := f.Keys[1]
    seg.SourcePath := "combat_2026-11-10_17_20_12_000001.txt",resolved := {Data:f.Data,Segment:seg,State:"IMPORTED"}
    aliases := Map("walker","battlewalker","council","brontes-and-styrak")
    for def in IRCVerifiedDefinitions() {
        seg.BossKey := def.Boss!="" ? def.Boss : "SNV-ST",seg.AreaId := def.Area,seg.ModeId := def.Mode
        id := def.Id="raptus" ? "raptus-captive" : def.Id
        c := {Selected:id ":1",Note:"",Duration:20,State:"Complete",Rows:[]}
        target := aliases.Get(def.Id,def.Id)
        V48Assert(IQCTargetKey(seg,c)=target,"the recorded challenge maps to its explicit source key: " def.Id)
        for metric in ["DPS","EHPS"] {
            spec := metric="DPS" ? "2031339142381602" : "2031339142381587",seg.DisplayDisciplines[key] := spec
            ref := IQCReferences("live",8,metric).Rows[target "|" spec],amount := Max(1,ref.Curve[101])*20
            row := V6415ChallengeUIActor(key,"Tracked player",amount,amount,amount,1,1),c.Rows := [row]
            ranks := IQCEstimate(resolved,c,metric)
            V48Assert(ranks.Get(key,-1)=IQTEstimate(amount/20,ref),"the source uses challenge-local " metric " for " def.Id)
        }
        if InStr("|walker|manifestation|pursuit-droid|voltinator|","|" def.Id "|") {
            c.Selected := id ":total"
            V48Assert(IQCTargetKey(seg,c)=target "-total","a repeated total selects its total dataset")
        }
    }
    seg.BossKey := "DP-RA",seg.AreaId := "137438993410",seg.ModeId := "836045448953655"
    seg.DisplayDisciplines[key] := "2031339142381587"
    row := V6415ChallengeUIActor(key,"Personal clock",120000,400000,300000,1,1)
    row.DamageDuration := 5,row.HealDuration := 10
    c := {Selected:"raptus-captive:total",Note:"",Duration:1000,State:"Complete",Rows:[row]}
    for metric in ["DPS","EHPS"] {
        amount := metric="DPS" ? 120000 : 300000,duration := metric="DPS" ? 5 : 10
        ref := IQCReferences("live",8,metric).Rows["raptus|2031339142381587"]
        V48Assert(IQCEstimate(resolved,c,metric).Get(key,-1)=IQTEstimate(amount/duration,ref),"personal challenges use each player's matching damage/healing clock")
    }
    row.HealKnown := 0
    V48Assert(!IQCEstimate(resolved,c,"EHPS").Count,"unknown effective healing cannot use raw HPS")
    row.HealKnown := 1,seg.End := -1,seg.FinishAt := -1,seg.Terminal := false
    V48Assert(IQCEstimate(resolved,c).Count=1,"a completed occurrence may grade while the enclosing fight is live")
    seg.End := seg.Last
    V48Assert(!IQCEstimate(resolved,c).Count,"a failed ended pull clears challenge grades")
    seg.Terminal := true,seg.FinishAt := seg.Last
    c.Note := "Partial log"
    V48Assert(!IQCEstimate(resolved,c).Count,"incomplete windows remain ungraded")
    c.Note := "",seg.SourcePath := "undated.txt"
    V48Assert(!IQCEstimate(resolved,c).Count,"a missing recording date cannot select a newer archive")
    seg.SourcePath := "combat_2026-11-10_17_20_12_000001.txt",IUB.PercentilesEnabled := false
    V48Assert(!IQCEstimate(resolved,c).Count,"the master preference disables challenge calculations")
    IUB.PercentilesEnabled := true,seg.ModeId := "836045448953656"
    V48Assert(!IsObject(IQCEstimate(resolved,c)),"untracked size variants cannot borrow an eight-player challenge")
}

IQC164UI() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQC164UICase)))

IQC164UICase()
{
    global IPM,IP,SETTINGS_FILE,IRTPrefs
    f := IQV139Ready(),seg := f.Segment,key := f.Keys[1],healKey := f.Keys[-1]
    seg.BossKey := "G-NA",seg.AreaId := "833571547775765",seg.ModeId := "836045448953655"
    seg.SourcePath := "combat_2026-11-10_17_20_12_000001.txt",seg.Challenges := IRCNewState()
    IRCBegin(seg,IRCDefinitions(seg)[1],seg.Start+1000,1)
    window := seg.Challenges.Windows["nahut:1"]
    window.End := seg.Start+11000,seg.Last := seg.Start+12000,seg.FinishAt := seg.Last
    for actor in [[key,"2031339142381602",271230,0],[healKey,"2031339142381587",1000,378260]] {
        seg.DisplayDisciplines[actor[1]] := actor[2]
        row := V6415ChallengeUIActor(actor[1],actor[1]=key ? "Damage player" : "Healer",actor[3],actor[4],actor[4],1,1)
        seg.Challenges.Rows["nahut:1" Chr(30) actor[1]] := row
    }
    resolved := {Data:f.Data,Segment:seg,State:"IMPORTED",Pending:0}
    IPM.Shown["Challenges"] := true,IPM.ChallengeMetric := "DamagePercentile"
    p := IPM.Panels["Challenges"],p.Width := 246,IPMEnsureGui("Challenges",0,p)
    c := IRCUGetSnapshot(resolved),snap := IPMSnapshot(resolved)
    V48Assert(c.Estimate.Get(key,-1)=50 && c.EstimateMetric="DPS","the ordinary Nahut snapshot produces the captured DPS median")
    IPMRender("Challenges",snap,p)
    V48Assert(InStr(p.Scope.Text,"DPS   Percentile") && p.Rows[1].Value.Text=IQTLabel(50),"Nahut renders a real grade instead of a dash")
    IPM.ChallengeMetric := "HealPercentile",IPMRender("Challenges",snap,p)
    V48Assert(!InStr(p.Scope.Text,"Percentile"),"a retained DPS snapshot cannot be rendered as an EHPS percentile")
    c := IRCUGetSnapshot(resolved),snap := IPMSnapshot(resolved),IPMRender("Challenges",snap,p)
    V48Assert(c.Estimate.Get(healKey,-1)=50 && InStr(p.Scope.Text,"EHPS   Percentile") && p.Rows[1].Name.Text=seg.Actors[healKey].Name && p.Rows[1].Value.Text=IQTLabel(50),"EHPS percentile uses effective healing and the correct source curve")
    IRCUSaveMetric(),IPMSaveSettings(),IPM.ChallengeMetric := "Damage",IPMLoadSettings()
    V48Assert(IPM.ChallengeMetric="HealPercentile" && IRCUMetricIndex(IPM.ChallengeMetric)=4,"the new healing view persists")
    values := ILPCapture(IPM,IRTPrefs)
    V48Assert(ILPValidated(values,IPM,IRTPrefs)["Display.ChallengeMetric"]="HealPercentile","saved layouts accept the healing percentile view")
    IQVTogglePercentiles(),snap := IPMSnapshot(resolved),IPMRender("Challenges",snap,p)
    V48Assert(!InStr(p.Scope.Text,"Percentile") && p.Rows[1].Value.Text=IPMNumber(IPRate(378260,10)),"disabled estimates retain the correct ordinary EHPS view")
    IQVTogglePercentiles()
    for kind in ["Damage","Heal"] {
        panel := IPM.Panels[kind],IPMEnsureGui(kind,0,panel),IPMRender(kind,IPMSnapshot(resolved),panel)
        V48Assert(!InStr(panel.ParserHeading,"Percentile"),"overlay titles omit the extra percentile label")
    }
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",p.Gui.Hwnd,"Int") && !IPM.TimerOn,"challenge verification stays hidden and timer-free")
}

IQC165Fixture()
{
    f := IQV139Ready(),seg := f.Segment,key := f.Keys[1],heal := f.Keys[-1]
    seg.BossKey := "G-NA",seg.AreaId := "833571547775765",seg.ModeId := "836045448953655"
    seg.SourcePath := "combat_2026-11-10_17_20_12_000001.txt",seg.Challenges := IRCNewState()
    start := seg.Start+1000,finish := start+10000
    IRCBegin(seg,IRCDefinitions(seg)[1],start,1)
    seg.Challenges.Windows["nahut:1"].End := finish,seg.Last := finish+1000,seg.FinishAt := seg.Last
    totals := Map()
    for actor in [[key,"2031339142381602",271230,0],[heal,"2031339142381587",1000,378260]] {
        who := actor[1],seg.DisplayDisciplines[who] := actor[2]
        row := V6415ChallengeUIActor(who,seg.Actors[who].Name,actor[3],actor[4],actor[4],1,1)
        seg.Challenges.Rows["nahut:1" Chr(30) who] := row
        t := IPNewTotals(),t.Damage := actor[3],t.Heal := actor[4],t.Effective := actor[4],t.HealKnown := 1,t.HealRecords := 1
        totals[who] := t
    }
    boundary := {Start:start,StartSeq:1,End:finish,EndSeq:100,IncludeStart:false,IncludeEnd:true,OpenEnd:false}
    phase := IAPhaseRange(seg,"Burn",start,finish,boundary,"Parsely")
    f.Phase := phase,f.View := {Phase:phase,Totals:totals,Seconds:10,Threat:Map(),ThreatSeconds:10,TargetDamage:Map()}
    return f
}

IQC165Rows() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQC165RowsCase)))
IQC165RowsCase()
{
    f := IQC165Fixture(),seg := f.Segment,view := f.View,key := f.Keys[1],heal := f.Keys[-1]
    before := IAFrozenTarget(seg),resolved := {Data:f.Data,Segment:seg,State:"IMPORTED",Pending:0}
    c := IQCPhaseChallenge(f.Data,seg,view)
    V48Assert(IsObject(c) && c.Selected="nahut:1","the exact recorded phase maps to its challenge occurrence")
    dps := IQTEvaluate(f.Data,seg,view,2),ehps := IQHEvaluate(f.Data,seg,view,2)
    V48Assert(dps.Graded=2 && dps.Rows[key].Percentile=50 && dps.Rows[key].DPS=IPRate(271230,10),"phase DPS grades the rate shown in Raid")
    V48Assert(ehps.Graded=1 && ehps.Rows[heal].Percentile=50 && ehps.Rows[heal].EHPS=IPRate(378260,10),"phase EHPS grades its effective healing rate")
    V48Assert(dps.Rows[key].Percentile=IQCEstimate(resolved,c)[key]
        && ehps.Rows[heal].Percentile=IQCEstimate(resolved,c,"EHPS")[heal],"Raid and the challenge overlay use the same phase reference")
    V48Assert(dps.Challenge="nahut:1" && ehps.Patch="live" && !IABaseReconcile(seg,before).Length,"phase grading preserves the parsed encounter")
    for item in [["2024-08-20","7.5.1"],["2025-08-20","7.7.1"]] {
        seg.SourcePath := "combat_" item[1] "_17_20_12_000001.txt"
        q := IQTEvaluate(f.Data,seg,view,2)
        V48Assert(q.Patch=item[2] && q.Rows[key].Percentile=IQCEstimate(resolved,c)[key],"the parser phase uses the original archive")
    }
}

IQC165Guards() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQC165GuardsCase)))
IQC165GuardsCase()
{
    f := IQC165Fixture(),seg := f.Segment,view := f.View,key := f.Keys[1],heal := f.Keys[-1]
    view.Totals[key].Damage+=1
    V48Assert(!IQTEvaluate(f.Data,seg,view,2).Rows[key].Bucket,"extra phase damage is not compared with a narrower challenge target scope")
    view.Totals[key].Damage-=1
    view.TargetDamage["different-target"] := Map(key,100)
    V48Assert(!IQTEvaluate(f.Data,seg,view,2,"different-target").Rows[key].Bucket,"a different target selection cannot inherit the challenge grade")
    V48Assert(IQHEvaluate(f.Data,seg,view,2,"different-target").Rows[heal].Bucket,"damage target selection leaves matching healing grades intact")
    view.Totals[heal].HealKnown := 0
    V48Assert(!IQHEvaluate(f.Data,seg,view,2).Rows[heal].Bucket,"missing effective healing is ungraded")
    view.Totals[heal].HealKnown := 1
    V48Assert(!IQHEvaluate(f.Data,seg,view,2,"",true).Graded,"whole-fight shield credits cannot be inserted into a phase reference")
    view.Phase.Boundary.Start-=1
    V48Assert(!IQTEvaluate(f.Data,seg,view,2).Graded && !IQHEvaluate(f.Data,seg,view,2).Graded,"a merely overlapping phase cannot borrow challenge percentiles")
    view.Phase.Boundary.Start+=1,seg.Partial := true
    V48Assert(!IQTEvaluate(f.Data,seg,view,2).Graded,"incomplete recorded phases remain ungraded")
    seg.Partial := false,seg.WipeEnded := true
    V48Assert(!IQHEvaluate(f.Data,seg,view,2).Graded,"an ended failed phase clears its old grade")
}

IQC165RaidUI() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQC165RaidUICase)))
IQC165RaidUICase()
{
    global IP
    f := IQC165Fixture(),seg := f.Segment,key := f.Keys[1],heal := f.Keys[-1]
    u := IPWState(),r := IRPState(),r.Selection := IPWRotationSelection(),r.LiveSegment := seg
    r.Models := [f.View],r.Choices := [f.Phase],r.Index := 2,r.Revision+=1
    u.Controls["RaidPhase"].Delete(),u.Controls["RaidPhase"].Add(["Whole fight","Burn"]),u.Controls["RaidPhase"].Choose(2)
    u.RaidSignature := "",IPRefresh(),lv := IP.PlayersLV
    row := V7428RaidRow(key),hrow := V7428RaidRow(heal)
    V48Assert(r.Index=2 && lv.GetText(row,13)==IUNDecimal("50.00") && lv.GetText(hrow,15)==IUNDecimal("50.00"),"the actual Raid phase table displays both percentile columns")
    V48Assert(lv.GetText(row,3)=IPMNumber(IPRate(271230,10)) && lv.GetText(hrow,5)=IPMNumber(IPRate(378260,10)),"the displayed phase rates stay unchanged")
    V48Assert(!IQARaidState().Taken.Graded,"phase DTPS does not use a whole-fight reference")
    IPWSort("Raid",lv,13)
    V48Assert(IQTState().Rows[lv.GetText(1,9)].Percentile>=50,"phase grades retain numeric sorting")
    u.Controls["RaidPhase"].Choose(1),IRPChanged()
    V48Assert(r.Index=1 && !IQTState().HasOwnProp("Challenge") && IQTState().Graded,"Whole fight restores whole-fight estimates")
    u.Controls["RaidPhase"].Choose(2),IRPChanged()
    V48Assert(lv.GetText(V7428RaidRow(key),13)==IUNDecimal("50.00"),"returning to the phase restores its challenge grade")
}

IRP166Fixture()
{
    f := IQC165Fixture(),seg := f.Segment
    seg.BossKey := "DX-E1",seg.AreaId := "833571547775792",seg.ModeId := "836045448953655"
    seg.Challenges := IRCNewState(),seg.PhaseProgress := Map("Parsely",{Limited:false,Windows:[]})
    def := IRCDefinitions(seg)[1],start := seg.Start+1000,finish := start+10000
    IRCBegin(seg,def,start,1),w := seg.Challenges.Windows["pursuit-droid:1"]
    w.End := finish,w.EndSeq := 100
    for key,t in f.View.Totals {
        row := IRCRow(key,seg.Actors[key].Name,"Player")
        for field in ["Damage","Heal","Effective","HealKnown","HealRecords"]
            row.%field% := t.%field%
        seg.Challenges.Rows["pursuit-droid:1" Chr(30) key] := row
    }
    boundary := {Start:start,StartSeq:1,End:finish,EndSeq:100,IncludeStart:false,IncludeEnd:true,OpenEnd:false}
    phase := IAPhaseRange(seg,"Pursuit Droid",start,finish,boundary,"Parsely")
    model := {Phase:phase,Totals:f.View.Totals,Seconds:10,Threat:Map(),ThreatSeconds:10,TargetDamage:Map()}
    priorBounds := boundary.Clone(),priorBounds.Start := seg.Start,priorBounds.StartSeq := 0,priorBounds.End := start,priorBounds.EndSeq := 1
    prior := {Phase:IAPhaseRange(seg,"Run",seg.Start,start,priorBounds,"Parsely"),
        Totals:Map(),Seconds:1,Threat:Map(),ThreatSeconds:1,TargetDamage:Map()}
    native := seg.Clone(),native.Error := "",native.Review := {Models:[prior,model],Threat:seg.Raid.Threat}
    f.Native := {Closed:[native]},f.Model := model,f.Window := w
    return f
}

IRP166HoldingMenu() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IRP166HoldingMenuCase)))
IRP166HoldingMenuCase()
{
    f := IRP166Fixture(),seg := f.Segment
    choices := IRPChoices(seg)
    V48Assert(choices.Length=1,"an empty Holding Pens import ledger still exposes its observed Pursuit Droid phase")
    V48Assert(choices[1].Name="Pursuit Droid" && choices[1].ChallengeKey="pursuit-droid:1","the fallback keeps the replay's occurrence label and explicit challenge identity")
    V48Assert(choices[1].Boundary.Start=f.Window.Start && choices[1].Boundary.End=f.Window.End,"fallback boundaries are recorded, never reconstructed from a duration")
    seg.Partial := true
    V48Assert(!IRPChoices(seg).Length,"an incomplete import cannot add inferred phase choices")
    seg.Partial := false,seg.Challenges.Meta["Limited"] := true
    V48Assert(!IRPChoices(seg).Length,"a limited challenge ledger cannot seed phase choices")
    seg.Challenges.Meta["Limited"] := false,f.Window.End := -1
    V48Assert(!IRPChoices(seg).Length,"an unfinished Pursuit Droid cannot seed an ended range")
    f.Window.End := seg.Last,seg.ModeId := "836045448953656"
    V48Assert(!IRPChoices(seg).Length,"unverified sixteen-player mechanics are not borrowed from eight-player ledgers")
}

IRP166HoldingReplay() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IRP166HoldingReplayCase)))
IRP166HoldingReplayCase()
{
    f := IRP166Fixture(),seg := f.Segment,models := IRPNativeModels(f.Native,seg)
    V48Assert(models.Length=1 && models[1].Totals=f.Model.Totals && models[1].Phase.Boundary=f.Model.Phase.Boundary,"native review selects the exact observed window from the complete verified phase replay")
    q := IQTEvaluate(f.Data,seg,models[1],2),h := IQHEvaluate(f.Data,seg,models[1],2)
    V48Assert(q.Graded>0 && h.Graded>0 && q.Challenge="pursuit-droid:1","both percentile metrics use the Pursuit Droid source after loading")
    f.Model.Phase.Name := "Pursuit Droid 2",renamed := IRPNativeModels(f.Native,seg)
    V48Assert(renamed[1].Phase.Name="Pursuit Droid" && f.Model.Phase.Name="Pursuit Droid 2","different replay ordinals retain the observed menu label without changing the native phase")
    f.Model.Phase.Name := "Pursuit Droid"
    review := {BaseVerified:true,Start:seg.Start,Last:seg.Last,Rows:[],AutomaticPhases:[]},copy := seg.Clone(),copy.Raid := seg.Raid.Clone(),copy.Raid.Threat := Map()
    for m in f.Native.Closed[1].Review.Models
        review.AutomaticPhases.Push(m.Phase)
    ahk := IRPBuild(review,copy)
    V48Assert(ahk.Length=1 && ahk[1].Phase.Name="Pursuit Droid" && ahk[1].Seconds=10,"the isolated AHK fallback selects the same verified window from the full replay")
    correct := f.Model.Phase,f.Model.Phase := correct.Clone(),f.Model.Phase.Boundary := correct.Boundary.Clone()
    f.Model.Phase.Boundary.End-=1,failed := false
    try IRPNativeModels(f.Native,seg)
    catch
        failed := true
    V48Assert(failed,"an overlapping but different replay window is rejected")
    f.Model.Phase := correct,f.Native.Closed[1].Review.Models.Push(f.Model),failed := false
    try IRPNativeModels(f.Native,seg)
    catch
        failed := true
    V48Assert(failed,"duplicate matching replay windows are rejected")
    f.Native.Closed[1].Review.Models.Pop()
    seg.PhaseProgress["Parsely"].Windows := [{Id:"pursuit",Name:"Pursuit Droid",Ordinal:1,
        Start:f.Window.Start,StartSeq:1,End:f.Window.End,EndSeq:100}],failed := false
    try IRPNativeModels(f.Native,seg)
    catch
        failed := true
    V48Assert(failed,"a nonempty primary phase ledger retains its strict full-replay validation")
}

IQS167Fixture()
{
    global IP
    f := IQC165Fixture(),seg := f.Segment,old := seg.Challenges
    seg.BossKey := "DF-BR",seg.AreaId := "137438993402",seg.ModeId := "836045448953655"
    seg.Challenges := IRCNewState(),IRCBegin(seg,IRCDefinitions(seg)[1],f.Phase.Boundary.Start,1)
    seg.Challenges.Windows["brontes:1"].End := f.Phase.Boundary.End
    for _,row in old.Rows
        seg.Challenges.Rows["brontes:1" Chr(30) row.Key] := row
    f.View.Totals[f.Keys[1]].Damage+=1000
    r := IRPState(),r.Selection := IPWRotationSelection(),r.LiveSegment := seg
    r.Models := [f.View],r.Choices := [f.Phase],r.Index := 1,r.Revision+=1
    control := IPWState().Controls["RaidPhase"],control.Delete(),control.Add(["Whole fight","Burn"]),control.Choose(2),IRPChanged()
    return f
}

IQS167Default() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQS167DefaultCase)))
IQS167DefaultCase()
{
    global IP
    f := IQS167Fixture(),seg := f.Segment,key := f.Keys[1],before := IAFrozenTarget(seg)
    c := IQCPhaseChallenge(f.Data,seg,f.View),ranks := IQCEstimate({Data:f.Data,Segment:seg,State:"IMPORTED",Pending:0},c)
    V48Assert(IRBTState().Key=":challenge" && IPWState().Controls["RaidTarget"].Text="Challenge targets","selecting a filtered challenge phase defaults its visible damage scope to the challenge")
    V48Assert(IPWState().Controls["RaidGroupDamage"].Text="Challenge damage","the displayed damage group identifies its challenge scope")
    row := V7428RaidRow(key),lv := IP.PlayersLV
    V48Assert(lv.GetText(row,2)=IRCDamage(271230) && lv.GetText(row,3)=IPMNumber(IPRate(271230,10)),"the parser displays the same filtered amount and rate that the challenge grades")
    V48Assert(lv.GetText(row,13)=IQTLabel(ranks[key]) && IQHState().Graded=1,"the parser grades the challenge DPS while preserving existing healing grades")
    V48Assert(f.View.Totals[key].Damage=272230 && !IABaseReconcile(seg,before).Length,"default challenge presentation does not rewrite counted phase or encounter damage")
    IPWSort("Raid",lv,13),IPRefresh()
    V48Assert(IRBTState().Key=":challenge" && lv.GetText(V7428RaidRow(key),13)=IQTLabel(ranks[key]),"sorting and refreshing retain the selected challenge scope")
    IPWState().Controls["RaidPhase"].Choose(1),IRPChanged()
    V48Assert(IRBTState().Key="" && IPWState().Controls["RaidTarget"].Text="All targets","Whole fight restores its ordinary damage scope")
}

IQS167Manual() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQS167ManualCase)))
IQS167ManualCase()
{
    global IP,IUB
    f := IQS167Fixture(),key := f.Keys[1],hrow := V7428RaidRow(f.Keys[-1]),healing := IP.PlayersLV.GetText(hrow,15)
    V7875RaidTargetChoose("")
    V48Assert(IP.PlayersLV.GetText(V7428RaidRow(key),2)=IRCDamage(272230) && IP.PlayersLV.GetText(V7428RaidRow(key),13)="—","explicit All targets preserves extra damage without attaching a different-scope grade")
    IPRefresh()
    V48Assert(IRBTState().Key="" && IPWState().Controls["RaidTarget"].Text="All targets","ordinary refresh does not override a manual target choice")
    V48Assert(IP.PlayersLV.GetText(V7428RaidRow(f.Keys[-1]),15)=healing,"changing damage scope leaves effective-healing percentiles alone")
    V7875RaidTargetChoose(":challenge"),IUB.PercentilesEnabled := false,IPWState().RaidSignature := "",IPRefresh()
    V48Assert(IRBTState().Key=":challenge" && IP.PlayersLV.GetText(V7428RaidRow(key),2)=IRCDamage(271230),"disabling percentile display preserves the explicitly selected damage scope")
    IUB.PercentilesEnabled := true,IPWState().RaidSignature := "",IPRefresh()
    V48Assert(IQTState().Graded>0,"reenabling percentile display restores the matching challenge grade")
}

IQS167TTK() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQS167TTKCase)))
IQS167TTKCase()
{
    f := IQV139Ready(),seg := f.Segment,seg.BossKey := "DF-BR",seg.ModeId := "836045448953655"
    seg.SourcePath := "combat_2026-09-20_01_12_27_153880.txt",seg.FinishAt := seg.Start+464377,seg.Last := seg.FinishAt
    ref := IQAReferences("TTK","MM",8,"live").Rows["DF-BR"]
    V48Assert(ref.Count=2274 && !ref.Capped && ref.Samples[-1]=535767,"the expanded Brontes sample includes the genuine kill duration")
    estimate := IQAKillEstimate(f.Data,seg),card := IGFCachedCard(seg,f.Data)
    V48Assert(estimate.Percentile=20.14 && estimate.Bucket=1 && estimate.Reason="","the real Brontes witness matches the independent expanded-sample rank")
    V48Assert(IGFPercentileLabel(card.TTK)==IUNDecimal("20.14"),"the fight sidebar shows the newly covered Brontes result")
    V48Assert(IGFPercentileLabel(0)="<1" && IGFPercentileLabel(1)==IUNDecimal("1.00")
        && IGFPercentileLabel(99)==IUNDecimal("99.00"),"the TTK label displays two decimals above its existing lower bound")
    seg.FinishAt := seg.Start+535768,seg.Last := seg.FinishAt
    V48Assert(IQAKillEstimate(f.Data,seg).Percentile=0 && IGFPercentileLabel(IGFCachedCard(seg,f.Data).TTK)="<1","kills beyond the expanded sample retain the requested lower-bound label")
    seg.WipeEnded := true
    V48Assert(IQAKillEstimate(f.Data,seg).Percentile="" && IGFCachedCard(seg,f.Data).TTK="","unconfirmed kills remain ungraded rather than receiving a low TTK label")
    seg.WipeEnded := false,seg.BossKey := "NO-REFERENCE"
    V48Assert(IQAKillEstimate(f.Data,seg).Percentile="","a missing TTK reference does not receive the sample's lower-bound marker")
}

IQW167Run(action) => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQW167Inner.Bind(action))))
IQW167Inner(action)
{
    global IPM
    saved := IPM,IPM := IPMNewState()
    try action.Call()
    finally IPMDestroyPanels(),IPM := saved
}
IQW167Ready()
{
    global IPM
    f := IQV139Ready(),IPM.Mode := 2,IPM.Shown["Damage"] := true,IPM.Shown["Heal"] := true
    IQOApplyMode(IPM,true,"Damage"),IQOApplyMode(IPM,true,"Heal")
    for key in f.Keys {
        t := f.Segment.Totals[key],t.Heal := 2000,t.Effective := 1500,t.HealKnown := 1,t.HealRecords := 1
    }
    return f
}
IQW167Both(resolved,percentiles)
{
    global IPM
    snap := IPMSnapshot(resolved)
    for kind in ["Damage","Heal"] {
        p := IPMPanelFor(kind),IPMEnsureGui(kind,0,p),hwnd := p.Gui.Hwnd
        IPMRender(kind,snap,p)
        expected := percentiles ? (kind="Damage" ? "DamageQuartiles" : "HealingPercentiles") : kind
        V48Assert(p.RenderedMetric=expected,"the existing " kind " panel selects the requested live/result presentation")
        V48Assert(p.Gui.Hwnd=hwnd && !DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int") && !IPM.TimerOn,"presentation changes reuse the hidden panel without starting a timer")
    }
    return snap
}
IQW167Combat() => IQW167Run(IQW167CombatCase)
IQW167CombatCase()
{
    f := IQW167Ready(),seg := f.Segment,data := f.Data,resolved := {Data:data,Segment:seg,State:"LIVE LOG",Pending:0}
    seg.End := -1,seg.FinishAt := -1,seg.Terminal := false,data.Current := seg,data.InCombat := 1
    snap := IQW167Both(resolved,false)
    V48Assert(!snap.PercentileReady && !snap.Quartiles.Graded && !snap.HealerPercentiles.Graded,"active combat never switches to an empty percentile view")
    seg.FinishAt := seg.Last,seg.Terminal := true
    V48Assert(IQTKill(seg),"the finishing fixture has a confirmed kill")
    snap := IQW167Both(resolved,false)
    V48Assert(snap.Closed && !snap.PercentileReady,"a confirmed terminal marker still waits for local combat to end")
    data.InCombat := 0,snap := IQW167Both(resolved,true)
    V48Assert(snap.PercentileReady && snap.Quartiles.Graded>0 && snap.HealerPercentiles.Graded>0,"after combat both valid completed results become available")
    seg.Id+=100,seg.FinishAt := -1,seg.Terminal := false,data.InCombat := 1
    snap := IQW167Both(resolved,false)
    V48Assert(!snap.Quartiles.Graded && !snap.HealerPercentiles.Graded,"the next combat clears the old result presentation")
}
IQW167Missing() => IQW167Run(IQW167MissingCase)
IQW167MissingCase()
{
    global IPM,IUB
    f := IQW167Ready(),seg := f.Segment,resolved := {Data:f.Data,Segment:seg,State:"IMPORTED",Pending:0}
    valid := IQW167Both(resolved,true),boss := seg.BossKey,seg.BossKey := "NO-REFERENCE"
    missing := IQW167Both(resolved,false)
    V48Assert(!missing.Quartiles.Graded && !missing.HealerPercentiles.Graded,"a completed fight without a reference keeps normal totals and rates")
    seg.BossKey := boss,IUB.PercentilesEnabled := false
    IQW167Both(resolved,false)
    for kind in ["Damage","Heal"] {
        p := IPMPanelFor(kind),IPMRender(kind,valid,p)
        V48Assert(p.RenderedMetric=kind,"the global disabled setting also rejects a retained percentile snapshot")
    }
    IUB.PercentilesEnabled := true
    for kind in ["Damage","Heal"]
        IQOApplyMode(IPM,false,kind)
    IQW167Both(resolved,false)
    V48Assert(!IQOMode(IPM,"Damage") && !IQOMode(IPM,"Heal"),"post-combat switching does not overwrite explicit per-overlay totals preferences")
    IQOApplyMode(IPM,true,"Damage"),valid.Quartiles.Rows := Map(),valid.Quartiles.Graded := 1
    V48Assert(!IQOCanRender(valid,"Damage"),"an empty retained model is not a valid percentile result")
}
IQW167Challenge() => IQW167Run(IQW167ChallengeCase)
IQW167ChallengeCase()
{
    global IPM,IUB
    f := IQC165Fixture(),seg := f.Segment,data := f.Data,resolved := {Data:data,Segment:seg,State:"LIVE LOG",Pending:0}
    IPM.Mode := 2,IPM.Shown["Challenges"] := true,IPM.ChallengeMetric := "DamagePercentile"
    p := IPM.Panels["Challenges"],IPMEnsureGui("Challenges",0,p),hwnd := p.Gui.Hwnd
    seg.End := -1,seg.FinishAt := -1,seg.Terminal := false,data.Current := seg,data.InCombat := 1
    c := IRCSnapshot(resolved)
    V48Assert(c.State="Complete" && IQCEstimate(resolved,c).Count>0,"an individual challenge can finish while its enclosing fight remains live")
    snap := IPMSnapshot(resolved),IPMRender("Challenges",snap,p)
    V48Assert(!InStr(p.Scope.Text,"Percentile") && p.Rows[1].Value.Text=IPMNumber(IPRate(271230,10)),"a completed mid-fight challenge retains its ordinary live damage view")
    seg.FinishAt := seg.Last,seg.Terminal := true,data.InCombat := 0
    completed := IPMSnapshot(resolved),IPMRender("Challenges",completed,p)
    V48Assert(InStr(p.Scope.Text,"Percentile") && p.Rows[1].Value.Text=IQTLabel(50),"a valid challenge percentile appears after the whole combat ends")
    IPM.ChallengeMetric := "HealPercentile",snap := IPMSnapshot(resolved),IPMRender("Challenges",snap,p)
    V48Assert(InStr(p.Scope.Text,"Percentile") && p.Rows[1].Value.Text=IQTLabel(50),"effective-healing challenge results use the same completion rule")
    for key in f.Keys
        seg.DisplayDisciplines[key] := "mixed"
    snap := IPMSnapshot(resolved),IPMRender("Challenges",snap,p)
    V48Assert(!InStr(p.Scope.Text,"Percentile"),"zero valid challenge grades retain the ordinary result view")
    IUB.PercentilesEnabled := false,IPM.ChallengeMetric := "DamagePercentile",IPMRender("Challenges",completed,p)
    V48Assert(!InStr(p.Scope.Text,"Percentile") && p.Gui.Hwnd=hwnd,"disabled percentiles keep the old challenge view even with a retained valid result")
    V48Assert(!IQOHasEstimates(Map("x","")) && IQOHasEstimates(Map("x",0)),"a real zero percentile is valid but an empty result is not")
}

IQA168Expanded()
{
    for gold in [["7.5.1","MM","DF-BR",2747,324575,545297,0,434936,85],
        ["7.5.1","MM","DF-CZ",1315,186586,562512,0,374549,1],
        ["7.5.1","MM","DF-DR",1380,238534,516688,0,377611,25],
        ["7.5.1","MM","DF-GR",1397,198697,445622,0,322159,28],
        ["7.5.1","MM","DF-NE",3180,75923,297557,0,186740,14],
        ["7.5.1","MM","DP-BE",882,194199,568993,0,381596,31],
        ["7.5.1","MM","DP-CA",657,358680,552878,0,455779,94],
        ["7.5.1","MM","DP-CO",729,167693,654561,0,411127,92],
        ["7.5.1","MM","DP-RA",596,41938,688059,0,364998,73],
        ["7.5.1","MM","DP-TY",817,202597,445784,0,324190,43],
        ["7.5.1","MM","DX-AP",706,437860,1369946,0,903903,1],
        ["7.5.1","MM","DX-E1",882,255657,637776,0,446716,14],
        ["7.5.1","MM","DX-E2",839,2191,469513,0,235852,95],
        ["7.5.1","MM","DX-HV,DX-HMM",535,135600,726882,0,431241,0],
        ["7.5.1","MM","DX-RE",1223,130012,417572,0,273792,28],
        ["7.5.1","MM","DX-TR",888,234393,1264835,0,749614,0],
        ["7.5.1","MM","EC-KE",765,375652,943305,0,659478,0],
        ["7.5.1","MM","EC-TK",850,216282,478469,0,347375,74],
        ["7.5.1","MM","EC-VO",720,204242,542374,0,373308,83],
        ["7.5.1","MM","EC-ZT",912,221462,1076422,0,648942,0],
        ["7.5.1","MM","G-AE",1225,367575,558737,0,463156,40],
        ["7.5.1","MM","G-IZ",692,709168,941780,0,825474,68],
        ["7.5.1","MM","G-NA",1277,368795,518962,0,443878,32],
        ["7.5.1","MM","G-SC",1007,379811,631221,0,505516,12],
        ["7.5.1","MM","G-TY",1250,119069,507604,0,313336,53],
        ["7.5.1","MM","SNV-CW",725,234558,726586,0,480572,0],
        ["7.5.1","MM","SNV-DA",2838,180618,2308366,0,1244492,0],
        ["7.5.1","MM","SNV-OC",740,65981,372245,0,219113,10],
        ["7.5.1","MM","SNV-OL",728,135615,839221,0,487418,80],
        ["7.5.1","MM","SNV-ST",842,472030,1326476,0,899253,68],
        ["7.5.1","MM","SNV-TH",823,83687,432739,0,258213,7],
        ["7.5.1","MM","SNV-TI",1002,142403,420923,0,281663,18],
        ["7.5.1","MM","TFB-DG",1061,285831,477761,0,381796,72],
        ["7.5.1","MM","TFB-KE",896,128838,360114,0,244476,32],
        ["7.5.1","MM","TFB-OP",855,292726,674323,0,483524,38],
        ["7.5.1","MM","TFB-TF",926,480452,897690,0,689071,95],
        ["7.5.1","MM","TFB-WH",1230,178163,388218,0,283190,42],
        ["7.5.1","VM","DF-BR",483,274337,570382,0,422359,62],
        ["7.5.1","VM","DF-CZ",504,163406,617717,0,390561,1],
        ["7.5.1","VM","DF-DR",505,224448,553440,0,388944,13],
        ["7.5.1","VM","DF-GR",530,172862,414779,0,293820,45],
        ["7.5.1","VM","DF-NE",523,84225,238277,0,161251,16],
        ["7.5.1","VM","DP-BE",326,191294,493750,0,342522,13],
        ["7.5.1","VM","DP-CA",293,356808,546999,0,451903,69],
        ["7.5.1","VM","DP-CO",267,97858,587887,0,342872,91],
        ["7.5.1","VM","DP-RA",278,173830,501994,0,337912,68],
        ["7.5.1","VM","DP-TY",330,138533,378179,0,258356,22],
        ["7.5.1","VM","DX-AP",169,339522,864553,0,602037,71],
        ["7.5.1","VM","DX-E1",87,252486,534092,0,393289,25],
        ["7.5.1","VM","DX-E2",226,112051,555967,0,334009,20],
        ["7.5.1","VM","DX-HV,DX-HMM",157,110723,340701,0,225712,91],
        ["7.5.1","VM","DX-RE",291,111811,509847,0,310829,4],
        ["7.5.1","VM","DX-TR",206,175539,1083816,0,629677,4],
        ["7.5.1","VM","EC-KE",312,361264,565513,0,463388,44],
        ["7.5.1","VM","EC-TK",338,250215,457352,0,353783,39],
        ["7.5.1","VM","EC-VO",306,133003,552194,0,342598,62],
        ["7.5.1","VM","EC-ZT",373,207285,499176,0,353230,9],
        ["7.5.1","VM","EV-GH",1191,119843,716029,0,417936,0],
        ["7.5.1","VM","EV-SO",927,362185,1008614,0,685399,1],
        ["7.5.1","VM","EV-XR",1167,138203,378314,0,258258,36],
        ["7.5.1","VM","G-AE",153,278032,422112,0,350072,35],
        ["7.5.1","VM","G-IZ",75,621067,868564,0,744815,32],
        ["7.5.1","VM","G-NA",137,331166,505729,0,418447,41],
        ["7.5.1","VM","G-SC",113,287986,449541,0,368763,32],
        ["7.5.1","VM","G-TY",235,70024,269081,0,169552,9],
        ["7.5.1","VM","KP-BO",1226,122426,748683,0,435554,0],
        ["7.5.1","VM","KP-FA-V,KP-FA",1281,96676,520727,0,308701,6],
        ["7.5.1","VM","KP-FC",1238,132278,420440,0,276359,18],
        ["7.5.1","VM","KP-JS",1283,124656,463546,0,294101,7],
        ["7.5.1","VM","KP-KA-V,KP-KA",1389,141258,423086,0,282172,16],
        ["7.5.1","VM","MONO,MONO-SM",102,331249,586654,0,458951,53],
        ["7.5.1","VM","QUEEN-VM,QUEEN,QUEEN-SM",61,119088,386929,0,253008,34],
        ["7.5.1","VM","R4-IP",234,391552,429265,0,410408,21],
        ["7.5.1","VM","R4-KN",329,323934,728496,0,526215,14],
        ["7.5.1","VM","R4-LD",133,468185,710228,0,589206,19],
        ["7.5.1","VM","R4-WD",238,201903,383475,0,292689,15],
        ["7.5.1","VM","RAV-BU-V,RAV-BU",305,120704,304051,0,212377,10],
        ["7.5.1","VM","RAV-CR",82,200913,1090769,0,645841,18],
        ["7.5.1","VM","RAV-MB",115,299442,469232,0,384337,31],
        ["7.5.1","VM","RAV-SP-V,RAV-SP",302,138525,480339,0,309432,5],
        ["7.5.1","VM","RAV-TO-V,RAV-TO",271,78768,239143,0,158955,6],
        ["7.5.1","VM","SNV-CW",626,170420,501440,0,335930,23],
        ["7.5.1","VM","SNV-DA",667,116329,751972,0,434150,1],
        ["7.5.1","VM","SNV-OC",589,41002,459911,0,250456,2],
        ["7.5.1","VM","SNV-OL",569,89219,871995,0,480607,76],
        ["7.5.1","VM","SNV-ST",709,252047,556287,0,404167,65],
        ["7.5.1","VM","SNV-TH",600,74038,383537,0,228787,8],
        ["7.5.1","VM","SNV-TI",640,146462,509691,0,328076,12],
        ["7.5.1","VM","TFB-DG",371,152647,457041,0,304844,33],
        ["7.5.1","VM","TFB-KE",346,121490,379743,0,250616,20],
        ["7.5.1","VM","TFB-OP",322,231490,648170,0,439830,28],
        ["7.5.1","VM","TFB-TF",263,354084,823970,0,589027,62],
        ["7.5.1","VM","TFB-WH",374,87601,258423,0,173012,38],
        ["7.5.1","VM","TOS-CO",293,269700,694722,0,482211,4],
        ["7.5.1","VM","TOS-MA",385,80272,253697,0,166984,18],
        ["7.5.1","VM","TOS-RE",252,332208,658130,0,495169,41],
        ["7.5.1","VM","TOS-SS",348,181750,381490,0,281620,70],
        ["7.5.1","VM","TOS-UL",306,120282,324429,0,222355,22],
        ["7.5.1","VM","XENO",178,207699,544037,0,375868,27],
        ["7.5.1","SM","DF-BR",1634,137982,647500,0,392741,0],
        ["7.5.1","SM","DF-CZ",1581,50238,567173,0,308705,1],
        ["7.5.1","SM","DF-DR",1611,66822,738180,0,402501,1],
        ["7.5.1","SM","DF-GR",1665,60735,745197,0,402966,0],
        ["7.5.1","SM","DF-NE",1722,36918,405622,0,221270,1],
        ["7.5.1","SM","DP-BE",1387,141787,493171,0,317479,0],
        ["7.5.1","SM","DP-CA",1356,211411,595048,0,403229,0],
        ["7.5.1","SM","DP-CO",1435,142436,666109,0,404272,0],
        ["7.5.1","SM","DP-RA",1369,121060,727401,0,424230,1],
        ["7.5.1","SM","DP-TY",1434,75091,495363,0,285227,0],
        ["7.5.1","SM","DX-AP",181,106517,770944,0,438730,2],
        ["7.5.1","SM","DX-E1",27,162843,724031,0,443437,4],
        ["7.5.1","SM","DX-E2",146,76829,469220,0,273024,15],
        ["7.5.1","SM","DX-HV,DX-HMM",163,66616,485806,0,276211,2],
        ["7.5.1","SM","DX-RE",182,40431,210894,0,125662,3],
        ["7.5.1","SM","DX-TR",151,123816,481809,0,302812,3],
        ["7.5.1","SM","EC-KE",364,99083,666069,0,382576,2],
        ["7.5.1","SM","EC-TK",366,84987,454762,0,269874,4],
        ["7.5.1","SM","EC-VO",334,52246,435005,0,243625,29],
        ["7.5.1","SM","EC-ZT",402,67801,332099,0,199950,3],
        ["7.5.1","SM","EV-GH",683,61679,442516,0,252097,1],
        ["7.5.1","SM","EV-SO",527,283185,549107,0,416146,5],
        ["7.5.1","SM","EV-XR",672,55420,331108,0,193264,1],
        ["7.5.1","SM","G-AE",42,146764,662910,0,404837,5],
        ["7.5.1","SM","G-IZ",98,443194,1104213,0,773703,12],
        ["7.5.1","SM","G-NA",108,256619,621268,0,438943,6],
        ["7.5.1","SM","G-SC",108,211095,562524,0,386809,6],
        ["7.5.1","SM","G-TY",108,30452,284520,0,157486,2],
        ["7.5.1","SM","KP-BO",1057,71984,589633,0,330808,0],
        ["7.5.1","SM","KP-FA,KP-FA-V",1069,60139,488736,0,274437,0],
        ["7.5.1","SM","KP-FC",1075,73417,388637,0,231027,1],
        ["7.5.1","SM","KP-JS",1087,53772,441318,0,247545,1],
        ["7.5.1","SM","KP-KA,KP-KA-V",1147,72380,318502,0,195441,1],
        ["7.5.1","SM","MONO-SM,MONO",147,134218,524945,0,329581,22],
        ["7.5.1","SM","QUEEN-SM,QUEEN,QUEEN-VM",63,58819,487998,0,273408,16],
        ["7.5.1","SM","R4-IP",202,391433,832808,0,612120,1],
        ["7.5.1","SM","R4-KN",174,166564,889550,0,528057,2],
        ["7.5.1","SM","R4-LD",118,436018,680643,0,558330,19],
        ["7.5.1","SM","R4-WD",186,112198,530232,0,321215,13],
        ["7.5.1","SM","RAV-BU,RAV-BU-V",440,62922,226890,0,144906,6],
        ["7.5.1","SM","RAV-CR",442,104254,590545,0,347399,1],
        ["7.5.1","SM","RAV-MB",425,99352,468419,0,283885,1],
        ["7.5.1","SM","RAV-SP,RAV-SP-V",449,69964,375057,0,222510,1],
        ["7.5.1","SM","RAV-TO,RAV-TO-V",470,25491,144381,0,84936,6],
        ["7.5.1","SM","SNV-CW",647,109093,624118,0,366605,1],
        ["7.5.1","SM","SNV-DA",606,60502,306108,0,183305,3],
        ["7.5.1","SM","SNV-OC",589,21723,225055,0,123389,5],
        ["7.5.1","SM","SNV-OL",555,47174,692124,0,369649,67],
        ["7.5.1","SM","SNV-ST",660,110625,660894,0,385759,1],
        ["7.5.1","SM","SNV-TH",623,47609,82860671,0,41454140,0],
        ["7.5.1","SM","SNV-TI",613,71577,466973,0,269275,1],
        ["7.5.1","SM","TFB-DG",362,64562,289529,0,177045,6],
        ["7.5.1","SM","TFB-KE",354,88257,317865,0,203061,3],
        ["7.5.1","SM","TFB-OP",343,148525,523715,0,336120,8],
        ["7.5.1","SM","TFB-TF",311,222868,549582,0,386225,11],
        ["7.5.1","SM","TFB-WH",333,38783,143552,0,91167,14],
        ["7.5.1","SM","TOS-CO",376,246837,609150,0,427993,3],
        ["7.5.1","SM","TOS-MA",427,49796,231104,0,140450,0],
        ["7.5.1","SM","TOS-RE",390,216788,597906,0,407347,9],
        ["7.5.1","SM","TOS-SS",379,70637,369216,0,219926,2],
        ["7.5.1","SM","TOS-UL",382,52913,312440,0,182676,3],
        ["7.5.1","SM","XENO",55,115516,336880,0,226198,5],
        ["7.7.1","MM","DF-BR",2702,321453,553520,0,437486,74],
        ["7.7.1","MM","DF-CZ",1367,195459,462843,0,329151,4],
        ["7.7.1","MM","DF-DR",1446,229811,512524,0,371167,25],
        ["7.7.1","MM","DF-GR",1425,201543,444579,0,323061,23],
        ["7.7.1","MM","DF-NE",2034,99851,293003,0,196427,3],
        ["7.7.1","MM","DP-BE",986,221024,538910,0,379967,32],
        ["7.7.1","MM","DP-CA",819,370405,553617,0,462011,93],
        ["7.7.1","MM","DP-CO",786,117215,643139,0,380177,99],
        ["7.7.1","MM","DP-RA",754,119410,562382,0,340896,92],
        ["7.7.1","MM","DP-TY",925,233182,465323,0,349252,18],
        ["7.7.1","MM","DX-AP",594,408152,1241062,0,824607,5],
        ["7.7.1","MM","DX-E1",882,275921,578201,0,427061,28],
        ["7.7.1","MM","DX-E2",856,2134,427905,0,215019,97],
        ["7.7.1","MM","DX-HV,DX-HMM",579,250944,711504,0,481224,0],
        ["7.7.1","MM","DX-RE",1196,161423,404394,0,282908,17],
        ["7.7.1","MM","DX-TR",874,272164,805312,0,538738,2],
        ["7.7.1","MM","EC-KE",896,405171,589493,0,497332,63],
        ["7.7.1","MM","EC-TK",973,252489,472995,0,362742,60],
        ["7.7.1","MM","EC-VO",876,298115,671654,0,484884,3],
        ["7.7.1","MM","EC-ZT",980,254423,519765,0,387094,3],
        ["7.7.1","MM","G-AE",1231,342575,554681,0,448628,53],
        ["7.7.1","MM","G-IZ",560,757266,931944,0,844605,33],
        ["7.7.1","MM","G-NA",1271,368062,495015,0,431538,37],
        ["7.7.1","MM","G-SC",921,403598,597929,0,500763,11],
        ["7.7.1","MM","G-TY",1247,110590,496560,0,303575,51],
        ["7.7.1","MM","SNV-CW",701,250535,2036131,0,1143333,0],
        ["7.7.1","MM","SNV-DA",1553,193368,1699304,0,946336,0],
        ["7.7.1","MM","SNV-OC",732,71117,209348,0,140232,29],
        ["7.7.1","MM","SNV-OL",752,512398,4375270,0,2443834,0],
        ["7.7.1","MM","SNV-ST",694,577594,1387916,0,982755,31],
        ["7.7.1","MM","SNV-TH",806,110344,456429,0,283386,3],
        ["7.7.1","MM","SNV-TI",966,169194,427222,0,298208,13],
        ["7.7.1","MM","TFB-DG",1156,309429,478039,0,393734,56],
        ["7.7.1","MM","TFB-KE",1015,150047,343064,0,246555,34],
        ["7.7.1","MM","TFB-OP",1001,333725,715280,0,524502,9],
        ["7.7.1","MM","TFB-TF",978,434373,1066620,0,750496,66],
        ["7.7.1","MM","TFB-WH",1312,189743,359342,0,274542,47],
        ["7.7.1","MM","XR-53",566,369647,656655,0,513151,62],
        ["7.7.1","VM","DF-BR",636,290728,589731,0,440229,43],
        ["7.7.1","VM","DF-CZ",658,162247,475663,0,318955,6],
        ["7.7.1","VM","DF-DR",682,228028,1042219,0,635123,0],
        ["7.7.1","VM","DF-GR",676,188947,432426,0,310686,32],
        ["7.7.1","VM","DF-NE",699,84554,251518,0,168036,11],
        ["7.7.1","VM","DP-BE",352,193294,452354,0,322824,20],
        ["7.7.1","VM","DP-CA",315,356251,551205,0,453728,58],
        ["7.7.1","VM","DP-CO",302,148767,712941,0,430854,25],
        ["7.7.1","VM","DP-RA",285,137320,778534,0,457927,2],
        ["7.7.1","VM","DP-TY",351,142447,416953,0,279700,13],
        ["7.7.1","VM","DX-AP",161,442015,864655,0,653335,64],
        ["7.7.1","VM","DX-E1",263,224349,562944,0,393646,27],
        ["7.7.1","VM","DX-E2",255,135730,476346,0,306038,38],
        ["7.7.1","VM","DX-HV,DX-HMM",189,145446,429476,0,287461,8],
        ["7.7.1","VM","DX-RE",302,111078,600575,0,355826,2],
        ["7.7.1","VM","DX-TR",225,199957,1326839,0,763398,3],
        ["7.7.1","VM","EC-KE",451,307748,587412,0,447580,46],
        ["7.7.1","VM","EC-TK",490,180080,462007,0,321043,73],
        ["7.7.1","VM","EC-VO",449,255528,466256,0,360892,39],
        ["7.7.1","VM","EC-ZT",505,198559,518011,0,358285,7],
        ["7.7.1","VM","EV-GH",1655,117241,437215,0,277228,22],
        ["7.7.1","VM","EV-SO",1384,363876,733286,0,548581,14],
        ["7.7.1","VM","EV-XR",1656,140600,374207,0,257403,29],
        ["7.7.1","VM","G-AE",220,263072,436211,0,349641,32],
        ["7.7.1","VM","G-IZ",75,612704,871171,0,741937,43],
        ["7.7.1","VM","G-NA",160,325389,485207,0,405298,44],
        ["7.7.1","VM","G-SC",127,286783,511403,0,399093,16],
        ["7.7.1","VM","G-TY",316,70945,264649,0,167797,3],
        ["7.7.1","VM","KP-BO",1648,122276,492938,0,307607,10],
        ["7.7.1","VM","KP-FA-V,KP-FA",1660,93044,514919,0,303981,6],
        ["7.7.1","VM","KP-FC",1643,135498,416365,0,275931,14],
        ["7.7.1","VM","KP-JS",1674,115938,520282,0,318110,3],
        ["7.7.1","VM","KP-KA-V,KP-KA",1737,131954,402298,0,267126,21],
        ["7.7.1","VM","MONO,MONO-SM",97,316631,585073,0,450852,47],
        ["7.7.1","VM","QUEEN-VM,QUEEN,QUEEN-SM",101,134593,296991,0,215792,51],
        ["7.7.1","VM","R4-IP",1075,391048,524733,0,457890,0],
        ["7.7.1","VM","R4-KN",1023,267054,668768,0,467911,23],
        ["7.7.1","VM","R4-LD",767,467509,724716,0,596112,7],
        ["7.7.1","VM","R4-WD",1017,176515,416695,0,296605,7],
        ["7.7.1","VM","RAV-BU-V,RAV-BU",309,114306,284101,0,199203,17],
        ["7.7.1","VM","RAV-CR",83,211598,1181216,0,696407,11],
        ["7.7.1","VM","RAV-MB",140,268485,444341,0,356413,44],
        ["7.7.1","VM","RAV-SP-V,RAV-SP",307,122258,393638,0,257948,13],
        ["7.7.1","VM","RAV-TO-V,RAV-TO",291,75289,336205,0,205747,1],
        ["7.7.1","VM","SNV-CW",797,157976,575026,0,366501,7],
        ["7.7.1","VM","SNV-DA",833,116637,1063607,0,590122,0],
        ["7.7.1","VM","SNV-OC",757,43741,223466,0,133603,5],
        ["7.7.1","VM","SNV-OL",743,443805,867588,0,655696,3],
        ["7.7.1","VM","SNV-ST",856,256288,534621,0,395454,57],
        ["7.7.1","VM","SNV-TH",790,67010,520539,0,293774,1],
        ["7.7.1","VM","SNV-TI",808,124242,461903,0,293072,17],
        ["7.7.1","VM","TFB-DG",451,178667,462423,0,320545,24],
        ["7.7.1","VM","TFB-KE",417,124345,360030,0,242187,27],
        ["7.7.1","VM","TFB-OP",393,248958,835115,0,542036,3],
        ["7.7.1","VM","TFB-TF",319,351357,843676,0,597516,49],
        ["7.7.1","VM","TFB-WH",454,84484,337738,0,211111,11],
        ["7.7.1","VM","TOS-CO",326,264451,516460,0,390455,50],
        ["7.7.1","VM","TOS-MA",419,71878,276839,0,174358,11],
        ["7.7.1","VM","TOS-RE",271,343596,640856,0,492226,32],
        ["7.7.1","VM","TOS-SS",363,170249,379592,0,274920,75],
        ["7.7.1","VM","TOS-UL",345,83733,291925,0,187829,48],
        ["7.7.1","VM","XENO",168,203584,521501,0,362542,27],
        ["7.7.1","VM","XR-53",1634,230786,1383949,0,807367,0],
        ["7.7.1","SM","DF-BR",2299,130060,569089,0,349574,1],
        ["7.7.1","SM","DF-CZ",2260,42185,533115,0,287650,0],
        ["7.7.1","SM","DF-DR",2264,39199,1223451,0,631325,0],
        ["7.7.1","SM","DF-GR",2326,55853,466573,0,261213,0],
        ["7.7.1","SM","DF-NE",2370,33911,317455,0,175683,0],
        ["7.7.1","SM","DP-BE",2040,135885,393156,0,264520,0],
        ["7.7.1","SM","DP-CA",2001,203842,502163,0,353002,1],
        ["7.7.1","SM","DP-CO",2070,92199,612841,0,352520,0],
        ["7.7.1","SM","DP-RA",2005,123732,628690,0,376211,1],
        ["7.7.1","SM","DP-TY",2066,58838,422518,0,240678,0],
        ["7.7.1","SM","DX-AP",256,100299,667776,0,384037,1],
        ["7.7.1","SM","DX-E1",240,137893,905581,0,521737,3],
        ["7.7.1","SM","DX-E2",238,33788,423990,0,228889,34],
        ["7.7.1","SM","DX-HV,DX-HMM",238,63952,487959,0,275955,1],
        ["7.7.1","SM","DX-RE",258,40221,194583,0,117402,2],
        ["7.7.1","SM","DX-TR",234,121129,498801,0,309965,3],
        ["7.7.1","SM","EC-KE",618,102512,616354,0,359433,1],
        ["7.7.1","SM","EC-TK",624,73165,445791,0,259478,4],
        ["7.7.1","SM","EC-VO",586,32369,515124,0,273746,13],
        ["7.7.1","SM","EC-ZT",637,64793,370343,0,217568,1],
        ["7.7.1","SM","EV-GH",2231,57974,429079,0,243526,1],
        ["7.7.1","SM","EV-SO",1691,285121,700632,0,492876,1],
        ["7.7.1","SM","EV-XR",2158,57287,426536,0,241911,1],
        ["7.7.1","SM","G-AE",184,96933,523030,0,309981,5],
        ["7.7.1","SM","G-IZ",170,428838,1055279,0,742058,12],
        ["7.7.1","SM","G-NA",173,97297,582096,0,339696,26],
        ["7.7.1","SM","G-SC",169,188340,395054,0,291697,14],
        ["7.7.1","SM","G-TY",184,34675,213882,0,124278,6],
        ["7.7.1","SM","KP-BO",2530,70679,576765,0,323722,0],
        ["7.7.1","SM","KP-FA,KP-FA-V",2526,56847,357700,0,207273,1],
        ["7.7.1","SM","KP-FC",2566,71869,400258,0,236063,0],
        ["7.7.1","SM","KP-JS",2531,56392,386935,0,221663,0],
        ["7.7.1","SM","KP-KA,KP-KA-V",2615,72724,473582,0,273153,0],
        ["7.7.1","SM","MONO-SM,MONO",163,125981,503993,0,314987,13],
        ["7.7.1","SM","QUEEN-SM,QUEEN,QUEEN-VM",75,63698,495575,0,279636,13],
        ["7.7.1","SM","R4-IP",325,386846,1017618,0,702232,2],
        ["7.7.1","SM","R4-KN",287,151539,594511,0,373025,24],
        ["7.7.1","SM","R4-LD",215,382343,722493,0,552418,14],
        ["7.7.1","SM","R4-WD",317,139960,824154,0,482057,2],
        ["7.7.1","SM","RAV-BU,RAV-BU-V",693,50092,254135,0,152113,3],
        ["7.7.1","SM","RAV-CR",714,129524,489663,0,309593,2],
        ["7.7.1","SM","RAV-MB",720,99739,340398,0,220068,3],
        ["7.7.1","SM","RAV-SP,RAV-SP-V",753,60415,315287,0,187851,2],
        ["7.7.1","SM","RAV-TO,RAV-TO-V",751,36349,219320,0,127834,1],
        ["7.7.1","SM","SNV-CW",1068,99014,465550,0,282282,2],
        ["7.7.1","SM","SNV-DA",1008,65407,636810,0,351108,0],
        ["7.7.1","SM","SNV-OC",995,19951,168140,0,94045,1],
        ["7.7.1","SM","SNV-OL",945,319453,706550,0,513001,3],
        ["7.7.1","SM","SNV-ST",1067,103886,675091,0,389488,1],
        ["7.7.1","SM","SNV-TH",1032,42975,301089,0,172032,4],
        ["7.7.1","SM","SNV-TI",1025,63753,349186,0,206469,2],
        ["7.7.1","SM","TFB-DG",708,70015,387835,0,228925,1],
        ["7.7.1","SM","TFB-KE",703,84695,311538,0,198116,4],
        ["7.7.1","SM","TFB-OP",685,135020,537756,0,336388,7],
        ["7.7.1","SM","TFB-TF",596,215361,682026,0,448693,1],
        ["7.7.1","SM","TFB-WH",659,39710,313084,0,176397,0],
        ["7.7.1","SM","TOS-CO",537,229479,529312,0,379395,5],
        ["7.7.1","SM","TOS-MA",582,43464,216781,0,130122,1],
        ["7.7.1","SM","TOS-RE",568,195200,739831,0,467515,3],
        ["7.7.1","SM","TOS-SS",549,57817,389800,0,223808,2],
        ["7.7.1","SM","TOS-UL",550,36906,275063,0,155984,5],
        ["7.7.1","SM","XENO",78,110442,277892,0,194167,9],
        ["7.7.1","SM","XR-53",1903,147633,623963,0,385798,13],
        ["live","MM","DF-BR",2274,320264,535767,0,428015,79],
        ["live","MM","DF-CZ",1679,189386,473183,0,331284,3],
        ["live","MM","DF-DR",1750,249713,621197,0,435455,1],
        ["live","MM","DF-GR",1738,201277,431327,0,316302,21],
        ["live","MM","DF-NE",2120,98252,283275,0,190763,1],
        ["live","MM","DP-BE",1068,229550,610780,0,420165,12],
        ["live","MM","DP-CA",931,369720,554581,0,462150,90],
        ["live","MM","DP-CO",747,122345,576501,0,349423,97],
        ["live","MM","DP-RA",870,61045,526661,0,293853,97],
        ["live","MM","DP-TY",1013,240944,446990,0,343967,16],
        ["live","MM","DX-AP",617,368861,1349482,0,859171,2],
        ["live","MM","DX-E1",1166,263991,534387,0,399189,42],
        ["live","MM","DX-E2",1144,2012,506645,0,254328,84],
        ["live","MM","DX-HV,DX-HMM",751,132481,356943,0,244712,99],
        ["live","MM","DX-RE",1394,119389,411485,0,265437,15],
        ["live","MM","DX-TR",985,275150,871820,0,573485,1],
        ["live","MM","EC-KE",1037,378858,664774,0,521816,22],
        ["live","MM","EC-TK",1176,264155,529388,0,396771,17],
        ["live","MM","EC-VO",1088,239960,586123,0,413041,32],
        ["live","MM","EC-ZT",1204,239751,630269,0,435010,1],
        ["live","MM","G-AE",1650,325115,543880,0,434497,66],
        ["live","MM","G-IZ",575,698563,929985,0,814274,68],
        ["live","MM","G-NA",1405,369910,510764,0,440337,29],
        ["live","MM","G-SC",1059,375832,550764,0,463298,35],
        ["live","MM","G-TY",1723,136000,445522,0,290761,56],
        ["live","MM","SNV-CW",837,237323,3926950,0,2082136,0],
        ["live","MM","SNV-DA",1411,175828,1094067,0,634947,1],
        ["live","MM","SNV-OC",914,65697,208752,0,137224,23],
        ["live","MM","SNV-OL",895,487513,889148,0,688330,5],
        ["live","MM","SNV-ST",686,450447,1277215,0,863831,58],
        ["live","MM","SNV-TH",944,79773,685568,0,382670,0],
        ["live","MM","SNV-TI",1045,154691,350025,0,252358,28],
        ["live","MM","TFB-DG",1063,261583,477477,0,369530,73],
        ["live","MM","TFB-KE",930,163094,3845960,0,2004527,0],
        ["live","MM","TFB-OP",958,297108,696421,0,496764,16],
        ["live","MM","TFB-TF",898,521023,864754,0,692888,88],
        ["live","MM","TFB-WH",1184,166785,359469,0,263127,45],
        ["live","MM","XR-53",705,376292,3453107,0,1914699,1],
        ["live","VM","DF-BR",649,266909,573229,0,420069,54],
        ["live","VM","DF-CZ",696,165035,549959,0,357497,2],
        ["live","VM","DF-DR",702,218912,584825,0,401868,7],
        ["live","VM","DF-GR",711,165632,424045,0,294838,38],
        ["live","VM","DF-NE",731,80433,295396,0,187914,3],
        ["live","VM","DP-BE",391,199986,490784,0,345385,12],
        ["live","VM","DP-CA",348,369416,553107,0,461261,51],
        ["live","VM","DP-CO",295,105820,1133606,0,619713,1],
        ["live","VM","DP-RA",316,138595,533391,0,335993,59],
        ["live","VM","DP-TY",380,155188,393110,0,274149,13],
        ["live","VM","DX-AP",138,372122,872610,0,622366,70],
        ["live","VM","DX-E1",263,230035,1160032,0,695033,0],
        ["live","VM","DX-E2",263,75268,418681,0,246974,77],
        ["live","VM","DX-HV,DX-HMM",204,109814,416699,0,263256,38],
        ["live","VM","DX-RE",284,104823,468294,0,286558,9],
        ["live","VM","DX-TR",242,157899,1298426,0,728162,3],
        ["live","VM","EC-KE",484,334350,570784,0,452567,38],
        ["live","VM","EC-TK",508,212138,663183,0,437660,2],
        ["live","VM","EC-VO",481,232718,915293,0,574005,0],
        ["live","VM","EC-ZT",537,200142,498680,0,349411,8],
        ["live","VM","EV-GH",1366,127261,593025,0,360143,1],
        ["live","VM","EV-SO",1099,369762,882391,0,626076,2],
        ["live","VM","EV-XR",1357,149582,370178,0,259880,19],
        ["live","VM","G-AE",205,220912,435770,0,328341,55],
        ["live","VM","G-IZ",78,606296,813917,0,710106,42],
        ["live","VM","G-NA",154,310656,517677,0,414166,30],
        ["live","VM","G-SC",129,272772,462398,0,367585,32],
        ["live","VM","G-TY",235,65902,222745,0,144323,10],
        ["live","VM","KP-BO",1378,137123,502226,0,319674,5],
        ["live","VM","KP-FA-V,KP-FA",1349,100541,592921,0,346731,3],
        ["live","VM","KP-FC",1380,152202,419570,0,285886,6],
        ["live","VM","KP-JS",1381,112199,423284,0,267741,12],
        ["live","VM","KP-KA-V,KP-KA",1402,143602,395137,0,269369,15],
        ["live","VM","MONO,MONO-SM",107,317045,580580,0,448812,38],
        ["live","VM","QUEEN-VM,QUEEN,QUEEN-SM",106,116114,305046,0,210580,40],
        ["live","VM","R4-IP",1349,387072,830765,0,608918,0],
        ["live","VM","R4-KN",1096,258353,859830,0,559091,2],
        ["live","VM","R4-LD",588,459343,681013,0,570178,12],
        ["live","VM","R4-WD",1213,174917,372065,0,273491,14],
        ["live","VM","RAV-BU-V,RAV-BU",328,103732,423716,0,263724,2],
        ["live","VM","RAV-CR",109,211959,1026069,0,619014,22],
        ["live","VM","RAV-MB",147,303679,439235,0,371457,29],
        ["live","VM","RAV-SP-V,RAV-SP",316,112912,488129,0,300520,4],
        ["live","VM","RAV-TO-V,RAV-TO",303,72392,223452,0,147922,7],
        ["live","VM","SNV-CW",754,164366,489201,0,326783,19],
        ["live","VM","SNV-DA",780,112465,743027,0,427746,1],
        ["live","VM","SNV-OC",743,45429,224367,0,134898,4],
        ["live","VM","SNV-OL",742,396501,799070,0,597785,10],
        ["live","VM","SNV-ST",784,253702,570479,0,412090,46],
        ["live","VM","SNV-TH",770,70785,468515,0,269650,1],
        ["live","VM","SNV-TI",780,141856,445936,0,293896,17],
        ["live","VM","TFB-DG",411,154977,450052,0,302514,30],
        ["live","VM","TFB-KE",389,131406,358069,0,244737,26],
        ["live","VM","TFB-OP",380,273453,698607,0,486030,7],
        ["live","VM","TFB-TF",307,384029,863360,0,623694,35],
        ["live","VM","TFB-WH",425,88842,317846,0,203344,10],
        ["live","VM","TOS-CO",331,283659,528322,0,405990,34],
        ["live","VM","TOS-MA",409,71117,283594,0,177355,8],
        ["live","VM","TOS-RE",254,343600,657848,0,500724,25],
        ["live","VM","TOS-SS",370,191036,382430,0,286733,67],
        ["live","VM","TOS-UL",340,92494,340607,0,216550,26],
        ["live","VM","XENO",220,191152,552685,0,371918,20],
        ["live","VM","XR-53",959,247200,5556704,0,2901952,0],
        ["live","SM","DF-BR",1992,140558,589124,0,364841,0],
        ["live","SM","DF-CZ",1974,50213,356362,0,203287,0],
        ["live","SM","DF-DR",1988,62373,1117051,0,589712,0],
        ["live","SM","DF-GR",2028,62944,431043,0,246993,0],
        ["live","SM","DF-NE",2046,40092,310886,0,175489,0],
        ["live","SM","DP-BE",1778,144914,473835,0,309374,0],
        ["live","SM","DP-CA",1742,212570,596137,0,404353,0],
        ["live","SM","DP-CO",1768,128189,613185,0,370687,0],
        ["live","SM","DP-RA",1744,133501,794649,0,464075,0],
        ["live","SM","DP-TY",1772,68209,454167,0,261188,0],
        ["live","SM","DX-AP",279,102880,725845,0,414362,1],
        ["live","SM","DX-E1",281,140870,1222364,0,681617,1],
        ["live","SM","DX-E2",275,43465,463284,0,253374,16],
        ["live","SM","DX-HV,DX-HMM",271,72358,469914,0,271136,1],
        ["live","SM","DX-RE",291,39198,326594,0,182896,1],
        ["live","SM","DX-TR",272,119277,669420,0,394348,2],
        ["live","SM","EC-KE",699,100354,705318,0,402836,1],
        ["live","SM","EC-TK",722,83694,481992,0,282843,2],
        ["live","SM","EC-VO",672,45120,568440,0,306780,4],
        ["live","SM","EC-ZT",719,65013,588881,0,326947,1],
        ["live","SM","EV-GH",2252,61409,616998,0,339203,0],
        ["live","SM","EV-SO",1700,280824,648513,0,464668,1],
        ["live","SM","EV-XR",2173,16800,378337,0,197568,0],
        ["live","SM","G-AE",195,101958,505648,0,303803,4],
        ["live","SM","G-IZ",177,417648,971051,0,694349,11],
        ["live","SM","G-NA",187,89619,620347,0,354983,11],
        ["live","SM","G-SC",185,196543,403615,0,300079,6],
        ["live","SM","G-TY",207,34672,373902,0,204287,1],
        ["live","SM","KP-BO",2503,71282,580925,0,326103,0],
        ["live","SM","KP-FA,KP-FA-V",2478,57035,364122,0,210578,1],
        ["live","SM","KP-FC",2542,72111,378908,0,225509,1],
        ["live","SM","KP-JS",2510,51168,278630,0,164899,1],
        ["live","SM","KP-KA,KP-KA-V",2567,68634,283579,0,176106,2],
        ["live","SM","MONO-SM,MONO",274,128467,549341,0,338904,7],
        ["live","SM","QUEEN-SM,QUEEN,QUEEN-VM",94,55877,479627,0,267752,16],
        ["live","SM","R4-IP",428,385663,968989,0,677326,1],
        ["live","SM","R4-KN",394,157952,1072422,0,615187,1],
        ["live","SM","R4-LD",290,392576,677236,0,534906,16],
        ["live","SM","R4-WD",423,111421,611513,0,361467,6],
        ["live","SM","RAV-BU,RAV-BU-V",671,58331,787786,0,423058,0],
        ["live","SM","RAV-CR",651,103552,849825,0,476688,0],
        ["live","SM","RAV-MB",708,101317,571621,0,336469,0],
        ["live","SM","RAV-SP,RAV-SP-V",704,64584,394187,0,229385,1],
        ["live","SM","RAV-TO,RAV-TO-V",709,32990,357628,0,195309,0],
        ["live","SM","SNV-CW",1194,86852,938097,0,512474,0],
        ["live","SM","SNV-DA",1167,63322,552041,0,307681,0],
        ["live","SM","SNV-OC",1168,18473,144977,0,81725,1],
        ["live","SM","SNV-OL",1114,322993,612442,0,467717,12],
        ["live","SM","SNV-ST",1202,98717,551439,0,325078,1],
        ["live","SM","SNV-TH",1207,39163,299417,0,169290,6],
        ["live","SM","SNV-TI",1186,58662,308945,0,183803,2],
        ["live","SM","TFB-DG",752,68705,481195,0,274950,0],
        ["live","SM","TFB-KE",739,84258,347543,0,215900,1],
        ["live","SM","TFB-OP",738,153126,570620,0,361873,4],
        ["live","SM","TFB-TF",676,229221,703750,0,466485,1],
        ["live","SM","TFB-WH",752,36825,306493,0,171659,1],
        ["live","SM","TOS-CO",631,220883,564609,0,392746,3],
        ["live","SM","TOS-MA",669,42247,311504,0,176875,1],
        ["live","SM","TOS-RE",651,201334,643041,0,422187,4],
        ["live","SM","TOS-SS",647,62922,378035,0,220478,1],
        ["live","SM","TOS-UL",650,49254,275613,0,162433,3],
        ["live","SM","XENO",101,96046,383652,0,239849,4],
        ["live","SM","XR-53",1250,171099,1489432,0,830265,0]] {
        refs := IQAReferences("TTK",gold[2],8,gold[1])
        for key in StrSplit(gold[3],",") {
            ref := refs.Rows.Get(key,"")
            V48Assert(IsObject(ref) && ref.Count=gold[4],"the native expanded reference retains the independently captured fight count")
            V48Assert(ref.Samples[1]=gold[5] && ref.Samples[-1]=gold[6] && ref.Capped=gold[7],"the native sample range and final cutoff status match the verified source")
            V48Assert(Abs(IQAKillRank(gold[8],ref)-gold[9])<=0.5,"the native midrank agrees with the independently rounded source rank")
            V48Assert(IQAKillRank(ref.Samples[-1]+1,ref)=0,"the lower sample boundary remains defined")
        }
    }
}

ITR169Actor(npc,instance,hp := 1000) => "The Terror From Beyond {" npc "}:" instance "|(0,0,0,0)|(" hp "/1000)"
ITR169Fixture()
{
    s := IPNewData("Terror reset fixture",3000),p := "@Terror Test#1|(0,0,0,0)|(1000/1000)"
    IPFeedLine(s,"[00:00:00.001] [" p "] [] [] [AreaEntered {836045448953664}: Asation {137438992720} Master {836045448953655}]")
    IPFeedLine(s,IPDemoLine(100,p,"","Enter"))
    old := ITR169Actor("3025220344479744",1,900)
    IPFeedLine(s,IPDemoLine(110,p,old,"Damage",100))
    s.DiedSinceEntry := true,s.LocalDead := true
    fresh := ITR169Actor("3025220344479744",2)
    ev := IPParseLine("[00:00:02.000] [" p "] [" fresh "] [] [Event {836045448945472}: TargetSet {836045448953668}]")
    return {Data:s,Player:p,Old:old,Fresh:fresh,Event:ev,Segment:s.Current}
}

ITR169Reset()
{
    f := ITR169Fixture(),s := f.Data,ev := f.Event,seg := f.Segment
    V48Assert(IPTerrorSurfaceResetObserved(seg,ev,2000),"fresh full surface instance proves reset after recorded surface combat")
    same := ev.Clone(),same.Target := IPActor(ITR169Actor("3025220344479744",1))
    V48Assert(!IPTerrorSurfaceResetObserved(seg,same,2000),"an existing surface actor is not a fresh instance")
    injured := ev.Clone(),injured.TargetHP := {Known:true,Current:999,Maximum:1000}
    V48Assert(!IPTerrorSurfaceResetObserved(seg,injured,2000),"partial-health first contact does not prove a complete new opening")
    unknown := ev.Clone(),unknown.TargetHP := {Known:false,Current:0,Maximum:0}
    V48Assert(!IPTerrorSurfaceResetObserved(seg,unknown,2000),"missing health is not reset evidence")
    phase := ev.Clone(),phase.Target := IPActor(ITR169Actor("3025233229381632",3))
    V48Assert(!IPTerrorSurfaceResetObserved(seg,phase,2000),"a hypergate phase actor does not reset the fight")
    wave := ev.Clone(),wave.Target := IPActor(ITR169Actor("3025258999185408",4))
    V48Assert(!IPTerrorSurfaceResetObserved(seg,wave,2000),"new tentacles within a wave do not reset the fight")
    V48Assert(!IPTerrorSurfaceResetObserved(seg,ev,100),"an earlier observation cannot reset later committed combat")
    seg.ModeId := "836045448953652"
    V48Assert(!IPTerrorSurfaceResetObserved(seg,ev,2000),"the observed Master rule is not applied to Veteran")
    seg.ModeId := "836045448953655",seg.AreaId := "elsewhere"
    V48Assert(!IPTerrorSurfaceResetObserved(seg,ev,2000),"same NPC outside Asation does not establish this boundary")
    seg.AreaId := "137438992720",seg.Terminal := true
    V48Assert(!IPTerrorSurfaceResetObserved(seg,ev,2000),"completed kills keep their endpoint")
    seg.Terminal := false
    IPBFeedEvent(s,ev,2000)
    V48Assert(!IsObject(s.Current) && s.Segments.Length=1,"the pre-entry reset closes only the preceding attempt")
    IPFeedLine(s,IPDemoLine(2001,f.Player,"","Enter"))
    IPFeedLine(s,IPDemoLine(2010,f.Player,f.Fresh,"Damage",50))
    V48Assert(s.Segments.Length=2 && s.Current.Start=2001 && !s.Current.Partial,"the fresh observed pull starts complete")
    V48Assert(s.Current.Totals[IPActor(f.Player).Key].Damage=50,"the new pull retains its first damage")

    f := ITR169Fixture(),s := f.Data
    IPFeedLine(s,IPDemoLine(1900,f.Player,"","Enter"))
    V48Assert(IsObject(s.Reentry),"fixture exercises queued re-entry after recorder death")
    IPBFeedEvent(s,f.Event,2000)
    V48Assert(!IsObject(s.Reentry) && s.Segments.Length=2 && s.Current.Start=1900 && !s.Current.Partial,"post-entry fresh surface evidence resolves the queue without uncertainty")
    IPFeedLine(s,"malformed record during the new pull")
    V48Assert(s.Current.Partial && s.Malformed=1,"actual missing or malformed data stays incomplete")

    f := ITR169Fixture(),s := f.Data,s.Current.BossActors := Map()
    V48Assert(!IPTerrorSurfaceResetObserved(s.Current,f.Event,2000),"unknown opening history does not get a clean reset")
    late := IPNewData("Late start",3000),late.AreaId := "137438992720",late.ModeId := "836045448953655"
    IPFeedLine(late,IPDemoLine(3000,f.Player,ITR169Actor("3025233229381632",5,500),"Damage",20))
    V48Assert(late.Current.Partial,"a genuine mid-fight recording retains its partial flag")
}

; Presentation-only filters, private fixture settings and hidden native GUI.
IHW170Data()
{
    s := V625Data()
    s.Segments[2].Terminal := true,s.Segments[2].FinishAt := s.Segments[2].Last
    s.Segments[4].Terminal := false,s.Segments[4].FinishAt := -1
    return s
}

IHW170Filtering()
{
    s := IHW170Data(),original := s.Segments.Clone()
    V48Assert(!IPWNewState().HideWipes,"wipe filtering defaults off")
    V48Assert(IPWFightIndices(s,false,false).Length=5,"default preserves all attempts")
    rows := IPWFightIndices(s,false,true)
    V48Assert(rows.Length=4 && rows[1]=1 && rows[2]=2 && rows[3]=3 && rows[4]=5,"wipe filter retains unrecognized combat and confirmed kill at original indices")
    rows := IPWFightIndices(s,true,true)
    V48Assert(rows.Length=1 && rows[1]=2,"both filters compose and retain the recorded kill")
    seg := s.Segments[4],seg.End := -1
    V48Assert(IPWFightIndices(s,true,true).Length=2,"current boss pull stays visible")
    seg.End := seg.Last,seg.Terminal := true,seg.FinishAt := seg.Last,seg.Partial := true
    V48Assert(!IPWFightIsWipe(seg),"recorded kill remains visible despite partial recording coverage")
    seg.WipeEnded := true
    V48Assert(IPWFightIsWipe(seg),"an explicit wipe overrides a stale terminal marker using the existing outcome rule")
    seg.AreaId := "137438993370"
    V48Assert(!IPWFightIsWipe(seg),"arena results are not boss wipes")
    V48Assert(IPWFightIndices("",true,true).Length=0,"empty input stays empty")
    for i,item in original
        V48Assert(item=s.Segments[i],"filter does not replace or delete source segments")
}

IHW170Sources()
{
    app := IPNewApp(),app.Offline := IHW170Data(),app.Live := IHW170Data(),app.View := "Imported",app.Follow := false,app.Selected := 4
    app.Workspace := IPWNewState(),app.Workspace.HideTrash := true,app.Workspace.HideWipes := true
    r := IPMResolve(app,3)
    V48Assert(r.Segment=app.Offline.Segments[2],"parser-linked meter selection cannot leak a hidden wipe")
    V48Assert(IPMResolve(app,1).Segment=app.Live.Segments[5],"explicit latest live routing remains independent of the sidebar filters")
    app.Offline.Segments[2].Terminal := false,app.Offline.Segments[2].FinishAt := -1
    V48Assert(!IsObject(IPMResolve(app,3).Segment),"all hidden fights produce no substitute overlay result")
    app.Workspace.HideWipes := false
    V48Assert(IPMResolve(app,3).Segment=app.Offline.Segments[4],"turning off the wipe filter restores existing pinned selection")
}

IHW170UI() => V61Hidden(IHW170UICase)
IHW170UICase()
{
    global IP
    u := V625Ready(),IP.Offline := IHW170Data(),s := IP.Offline,IPRefresh()
    wipe := u.Controls["HideWipes"],wipe.Value := 1,IPWFilterWipes(wipe)
    V48Assert(u.HideWipes && !u.HideTrash && IP.SegmentsLV.GetCount()=4,"native checkbox filters wipes independently")
    V625Toggle(true)
    V48Assert(IP.SegmentsLV.GetCount()=1 && IP.Selected=2 && u.Controls["FightCount"].Text="1 / 5 fights","composed filters select a visible fight and show filtered count")
    V48Assert(IP.SegmentsLV.GetText(1,1)="20" && IP.Offline=s && s.Segments.Length=5,"original numbering and full data remain intact")
    for size in [[980,650],[1220,780],[1600,1000]] {
        IPResize(IP.Gui,0,size[1],size[2])
        u.Controls["HideTrash"].GetPos(&x,&y,&w,&h),wipe.GetPos(&wx,&wy,&ww,&wh)
        IP.SegmentsLV.GetPos(&lx,&ly,&lw,&lh)
        V48Assert(wx>=x+w && wy=y && wx+ww<=268 && ly>=wy+wh,"both checkboxes fit side by side above the fight list")
    }
    s.Segments[4].End := -1,IPRefresh()
    V48Assert(IP.SegmentsLV.GetCount()=2 && IP.Selected=4,"active attempt remains visible while filtering wipes")
    s.Segments[4].End := s.Segments[4].Last,IPRefresh()
    V48Assert(IP.SegmentsLV.GetCount()=1 && IP.Selected=2,"finishing a wipe removes it without a second checkbox click")
    IP.ImportRunning := true
    try {
        wipe.Value := 0,IPWFilterWipes(wipe)
        V48Assert(u.HideWipes && wipe.Value=1,"ongoing import rejects and restores a changed checkbox")
        IPImportReviewControls(u,false)
        V48Assert(!wipe.Enabled && !u.Controls["HideTrash"].Enabled,"import disables both presentation filters")
    }
    finally IP.ImportRunning := false,IPImportReviewControls(u,true)
    V48Assert(wipe.Enabled && u.Controls["HideTrash"].Enabled,"both controls restore after import")
    s.Segments[2].Terminal := false,s.Segments[2].FinishAt := -1,IPRefresh()
    V48Assert(IP.SegmentsLV.GetCount()=0 && IP.Selected=0 && IP.InfoText.Text="No fights match the filters","all-hidden source renders a clean empty selection")
    wipe.Value := 0,IPWFilterWipes(wipe)
    V48Assert(IP.SegmentsLV.GetCount()=2 && !u.HideWipes,"unchecking restores hidden attempts")
    V48Assert(!DllCall("User32\IsWindowVisible","Ptr",IP.Gui.Hwnd,"Int"),"native GUI stays hidden")
}

IHW170Prefs() => V61Hidden(IHW170PrefsCase)
IHW170PrefsCase()
{
    global SETTINGS_FILE,SELF_TEST
    V48Assert(SELF_TEST && !InStr(StrLower(SETTINGS_FILE),"\documents\autohotkey\"),"preference exercise uses the isolated diagnostic settings path")
    IniDelete(SETTINGS_FILE,"IrisWorkspace","HideWipes"),IPWLoadPrefs()
    V48Assert(!IPWState().HideWipes,"missing preference preserves the old default")
    IniWrite(1,SETTINGS_FILE,"IrisWorkspace","HideWipes"),IPWLoadPrefs()
    V48Assert(IPWState().HideWipes,"saved opt-in loads")
    u := IPWState(),u.HideWipes := false,old := SELF_TEST
    try SELF_TEST := false,IPWSavePrefs()
    finally SELF_TEST := old
    SetTimer(FlushSettings,0)
    V48Assert(FlushSettings(),"queued preference save flushes only the private diagnostic INI")
    u.HideWipes := true,IPWLoadPrefs()
    V48Assert(!u.HideWipes,"actual preference save and reload retain opt-out")
}

IQO172Health()
{
    r := IRNewMetrics(),actor := IPActor("Siege Droid {2876515691790336}:123")
    IRRecordHealth(r,actor,{Known:false,Current:0,Maximum:0},1000)
    h := r.Health[actor.Key]
    V48Assert(h.FirstAt=1000 && h.FirstHealthAt=-1,"unknown first observation is not opening-health proof")
    IRRecordHealth(r,actor,{Known:true,Current:72,Maximum:100},1100)
    IRRecordHealth(r,actor,{Known:true,Current:100,Maximum:100},1200,true)
    V48Assert(h.FirstHealthAt=1100 && h.FirstCurrent=72 && h.FirstMaximum=100,"later full health cannot overwrite an injured first sample")
    V48Assert(h.Current=100 && h.At=1200,"live health display continues updating independently")
    IRRecordHealth(r,actor,{Known:true,Current:0,Maximum:100},1300)
    V48Assert(h.FirstCurrent=72 && h.Current=0,"ending health does not replace opening evidence")
    actor := IPActor("Siege Droid {2876515691790336}:456")
    IRRecordHealth(r,actor,{Known:true,Current:100,Maximum:0},1000)
    V48Assert(r.Health[actor.Key].FirstHealthAt=-1,"invalid maximum is not retained as first valid health")
    actor := IPActor("Siege Droid {2876515691790336}:999")
    IRRecordHealth(r,actor,{Known:false,Current:0,Maximum:0},1000)
    IRRecordHealth(r,actor,{Known:false,Current:0,Maximum:0},3000)
    IRRecordHealth(r,actor,{Known:true,Current:100,Maximum:100},2000)
    V48Assert(r.Health[actor.Key].FirstHealthAt=-1,"out-of-order ignored health cannot introduce opening proof")
}

IQO172Segment(boss := "DF-DR",id := "3303392491339776",current := 99,first := 1000)
{
    seg := {BossKey:boss,Start:1000,FinishAt:301000,Raid:{Health:Map()}}
    seg.Raid.Health["N:" id ":1:fixture"] := {Id:id,Instance:"1",FirstAt:first,FirstHealthAt:first,FirstCurrent:current,FirstMaximum:100,Current:0,Maximum:100}
    return seg
}

IQO172Gate()
{
    for pair in [["EC-KE","2876515691790336"],["DF-DR","3303392491339776"],["TFB-TF","3025220344479744"],["SNV-OL","3067130635354112"]] {
        seg := IQO172Segment(pair[1],pair[2])
        V48Assert(IQOOpeningReason(seg)="","recorded near-full opening permits TTK")
        seg.Raid.Health["N:" pair[2] ":1:fixture"].FirstCurrent := 26
        V48Assert(IQOOpeningReason(seg)!="","late injured opening cannot be replaced with final known health")
        seg.Raid.Health["N:" pair[2] ":1:fixture"].FirstCurrent := 100
        seg.Raid.Health["N:" pair[2] ":1:fixture"].FirstHealthAt := 32000
        V48Assert(IQOOpeningReason(seg)!="","late full-health NPC cannot manufacture an opening")
    }
    seg := IQO172Segment("TFB-TF","3025233229381632",50)
    V48Assert(IQOOpeningReason(seg)!="","Terror final-phase boss is not the surface boss")
    seg := IQO172Segment("EC-KE","2876532871659520",100)
    V48Assert(IQOOpeningReason(seg)!="","full-health walker alone does not establish opening siege droids")
    seg := IQO172Segment("SNV-OL","3154662068846592",100)
    V48Assert(IQOOpeningReason(seg)!="","full-health final Olok does not establish buyer/bodyguard phase")
    seg := IQO172Segment(),h := seg.Raid.Health["N:3303392491339776:1:fixture"]
    h.DeleteProp("FirstAt")
    V48Assert(IQOOpeningReason(seg)!="","old cache lacking first-health proof stays ungraded")
    seg := IQO172Segment("TFB-OP","2994867810598912")
    for i in [2,3,4,5,6,7,8] {
        h := seg.Raid.Health["N:2994867810598912:1:fixture"].Clone(),h.Instance := String(i)
        h.FirstAt := h.FirstHealthAt := 1000+i*10000
        seg.Raid.Health["N:2994867810598912:" i ":fixture"] := h
    }
    V48Assert(IQOOpeningReason(seg)="","all eight fresh Operator cores retain the whole-fight comparison")
    seg.Raid.Health.Delete("N:2994867810598912:1:fixture")
    V48Assert(IQOOpeningReason(seg)!="","later core pairs alone cannot pass the Operator opening gate")
}

IQO172Scope()
{
    for boss in ["EC-KE","DF-DR","TFB-TF","TFB-OP","SNV-OL"] {
        rule := IQOOpeningRule(boss)
        for id in StrSplit(rule.Ids," ") {
            seg := IQO172Segment(boss,id)
            if rule.Count=1
                V48Assert(IQOOpeningReason(seg)="","catalogued raid-size/difficulty variant has its own valid opening proof")
        }
        V48Assert(IQOOpeningReason({BossKey:boss})!="","missing opening metadata cannot be inferred from the ending")
    }
    V48Assert(IQOOpeningReason({BossKey:"G-SC"})="","unaffected encounter grading is preserved")
    data := IPNewData(),seg := IPNewSegment(data,1000,"observed combat entry")
    seg.BossKey := "DF-DR",seg.ModeId := "836045448953655",seg.Terminal := true,seg.End := seg.Last := seg.FinishAt := 301000
    before := IQAFightReason(data,seg),q := IQAEvaluateKill(seg,{Patch:"live"},"")
    V48Assert(before="" && q.Percentile="" && q.Text="" && q.Reason!="","TTK-only opening gate leaves other metric eligibility unchanged")
}

IQO172Rollback()
{
    s := IPNewData(),seg := IPNewSegment(s,1000,"observed combat entry")
    actor := IPActor("Siege Droid {2876515691790336}:789"),seg.Raid := IRNewMetrics()
    IRRecordHealth(seg.Raid,actor,{Known:false,Current:0,Maximum:0},1000)
    IPBBeginUndo(s,seg),IPBRemember(seg,"Health",seg.Raid.Health,actor.Key)
    IRRecordHealth(seg.Raid,actor,{Known:true,Current:100,Maximum:100},1100)
    IPBRollbackTail(s,seg)
    V48Assert(seg.Raid.Health[actor.Key].FirstHealthAt=-1,"row rollback restores absence of first known health")
    restored := IPCDecode(IPCEncode(s))
    V48Assert(restored.Current.Raid.Health[actor.Key].FirstAt=1000 && restored.Current.Raid.Health[actor.Key].FirstHealthAt=-1,"persistent graph round-trip retains opening metadata")
}

; Private display regressions: synthetic parser records, hidden HWNDs, temporary
; settings and no live reader, audio, gameplay input or original-log access.
IPM175Isolated(action) => V65UITimerIsolated(IPM175IsolatedCase.Bind(action))
IPM175IsolatedCase(action,*)
{
    global IP,IR,IRN,IRNU,IEF,IEFU,IRU,IRUU,IZP
    before := {IP:IP,IR:IR,IRN:IRN,IRNU:IRNU,IEF:IEF,IEFU:IEFU,IRU:IRU,IRUU:IRUU,IZP:IZP,Enemies:IENState().Actors}
    try {
        IP := IPNewApp(),IR := IRNewUI(),IRN := IRNNewState(),IRNU := IRNUNewState()
        IEF := IEFNewState(),IEFU := IEFUNewState(),IRU := IRUNewState(),IRUU := IRUUNewState()
        IZP := IZP.Clone(),IZP.Active := false,IENState().Actors := Map()
        IPM175Setup(),action.Call()
    }
    finally {
        IPM175Cleanup()
        IP := before.IP,IR := before.IR,IRN := before.IRN,IRNU := before.IRNU
        IEF := before.IEF,IEFU := before.IEFU,IRU := before.IRU,IRUU := before.IRUU,IZP := before.IZP
        IENState().Actors := before.Enemies
    }
}
IPM175Setup()
{
    global IPM
    IPM.Enabled := true,IPM.Mode := 2,IPM.Source := 2,IPM.Shown["Damage"] := true
}
IPM175Cleanup()
{
    global IPM
    IPMPreviewClear(IPM),IPMDestroyPanels()
    if IPMGuiAlive(IPM.ConfigGui)
        IPM.ConfigGui.Destroy()
    IPM.ConfigGui := "",IUSPrune()
}
IPM175LogKinds() => ["Personal","Damage","BossDamage","Heal","Taken","Threat","BossHP","Challenges",
    "Achievements","FightFeedback","BossMechanics","PvP"]
IPM175Sample(snap) => snap.HasOwnProp("LayoutPreview") && snap.LayoutPreview
IPM175ViewStamp()
{
    global IP,IPM
    return IGVJson([IPM.Source,IPM.PersonalKey,IP.Actor,IP.Selected,IP.Follow,IP.View,IPM.ChallengeSource,IPM.ChallengeChoice])
}
IPM175Select(data,name := "")
{
    global IP
    IP.Offline := data,IP.View := "Imported",IP.Selected := 1,IP.Follow := false
    if name!=""
        IP.Actor := name
}

IPM175LoadedNahut() => IPM175Isolated(IPM175LoadedNahutCase)
IPM175LoadedNahutCase()
{
    global IP,IPM,IUB
    ; Replay accepted turret observations, then retain their saved-pull result.
    f := PANTTestOpening(),PANTTestPulse(f,43500),PANTAttack(f,45500,11,2)
    seg := f.Segment,key := "@Recorded Nahut#175",actor := IPActor(key)
    actor.Name := "Recorded Nahut",IPStoreActor(seg,actor),seg.RecorderKey := key
    seg.BossName := "Nahut",seg.Opponent := "Nahut (8 NiM)",seg.SourcePath := "combat_2026-11-10_17_20_12_000001.txt"
    seg.AreaId := "833571547775765",seg.ModeId := "836045448953655",seg.Partial := false
    seg.Terminal := true,seg.XPFixed := true,seg.End := 60000,seg.Last := 60000,seg.FinishAt := 60000
    f.Data.Finished := true,f.Data.Partial := false,f.Data.Halted := false,seg.Totals[key].Damage := 271230
    seg.DisplayDisciplines := Map(key,"2031339142381602"),seg.DisplayRoles[key] := 2
    IFHRetire(seg),IPM175Select(f.Data,key)
    seg.Challenges := IRCNewState(),IRCBegin(seg,IRCDefinitions(seg)[1],46000,1)
    seg.Challenges.Windows["nahut:1"].End := 56000
    seg.Challenges.Rows["nahut:1" Chr(30) key] := V6415ChallengeUIActor(key,"Recorded Nahut",271230,0,0,1,1)
    IPM.Shown["Challenges"] := true,IPM.ChallengeMetric := "DamagePercentile",IUB.PercentilesEnabled := true
    resolved := IPMResolve(IP,IPM.Source),IRCUSelectContext(resolved),IPM.ChallengeChoice := "nahut:1"
    original := IP.Offline,totals := V7849TotalStamp(seg),model := XRDiagnosticJSON(IFHModel(seg))
    scope := IPM.ChallengeSource,choice := IPM.ChallengeChoice,player := IP.Actor,IPM.PersonalKey := key
    viewBefore := IPM175ViewStamp()
    assist := IPM.Panels["FightFeedback"],challenge := IPM.Panels["Challenges"]
    IPMEnsureGui("FightFeedback",0,assist),IPMEnsureGui("Challenges",0,challenge)
    base := IPMOverlaySnapshot(IP,IPM),IPMRender("FightFeedback",base,assist),IPMRender("Challenges",base,challenge)
    V48Assert(assist.VisibleRows=1 && InStr(assist.Rows[1].Name.Text,"1st close failed"),"loaded Nahut replays its actual turret finding")
    V48Assert(base.Challenges.Estimate.Get(key,-1)=50 && challenge.Rows[1].Value.Text="50","recorded ten-second Nahut burn renders its exact bundled median")
    finding := assist.Rows[1].Name.Text,grade := challenge.Rows[1].Value.Text
    IPMOpenSettings()
    V48Assert(IPM175ViewStamp()=viewBefore && !DllCall("User32\IsWindowVisible","Ptr",IPM.ConfigGui.Hwnd,"Int"),"opening actual hidden display settings preserves every loaded-log selection")
    for count in [8,16] {
        V48Assert(IPMApplyAndPreview(count),"actual Preview button handler starts samples beside a loaded Nahut log")
        V48Assert(IPM175ViewStamp()=viewBefore,"Preview button preserves source, personal player, actor, fight, follow, view and challenge occurrence exactly")
        snap := IPMOverlaySnapshot(IP,IPM)
        for kind in IPM175LogKinds()
            V48Assert(IPMPreviewPanel(kind,snap)=snap,"loaded Nahut protects the whole log-backed display: " kind)
        IPMEnsureGui("FightFeedback",0,assist),IPMEnsureGui("Challenges",0,challenge)
        IPMRender("FightFeedback",snap,assist),IPMRender("Challenges",snap,challenge)
        V48Assert(assist.Rows[1].Name.Text=finding && !InStr(assist.Heading.Text,"Preview"),"preview preserves the actual Nahut finding and boss identity")
        V48Assert(challenge.Rows[1].Value.Text=grade && InStr(challenge.Meta.Text,"Nahut Burn") && !InStr(challenge.Heading.Text,"Preview"),"preview preserves the real burn name and percentile")
        V48Assert(IPM.ChallengeSource=scope && IPM.ChallengeChoice=choice && IP.Actor=player,"preview preserves challenge occurrence and actor selection")
        V48Assert(IP.Offline=original && V7849TotalStamp(seg)=totals && XRDiagnosticJSON(IFHModel(seg))=model,"preview preserves loaded records, counters and retained assistance")
    }
    IPMEndRaidPreview()
    V48Assert(IPM175ViewStamp()=viewBefore,"stopping the button-started preview preserves every loaded-log selection exactly")
    V48Assert(IP.View="Imported" && IP.Selected=1 && !IP.Follow && IPM.Source=2 && IPM.ChallengeChoice=choice,"stopping samples preserves the loaded fight and phase")
}

IPM175SourceAndStale() => IPM175Isolated(IPM175SourceAndStaleCase)
IPM175SourceAndStaleCase()
{
    global IP,IPM
    IP.Live := V7849SavedFixture("Retained live result",700),IPM175Select(V7849SavedFixture("Selected saved result",1700),"@Selected saved result#102")
    IPM.Source := 1,IPM.Shown["Challenges"] := true,IRCUSelectContext(IPMResolve(IP,IPM.Source)),IPM.ChallengeChoice := "nahut:2"
    normal := IPMOverlaySnapshot(IP,IPM),scope := IPM.ChallengeSource
    V48Assert(IPMPreviewSet(8),"preview starts for a stopped retained live source")
    snap := IPMOverlaySnapshot(IP,IPM),stale := IPM.PreviewSnapshot
    V48Assert(snap.Actors[1].Name="Retained live result" && snap.Actors[1].Damage=7000 && IPM.Source=1,"preview keeps the configured latest-live source instead of switching to a saved fight")
    V48Assert(IPM.ChallengeSource=scope && IPM.ChallengeChoice="nahut:2","preview source routing cannot reset the selected challenge occurrence")
    for kind in IPM175LogKinds()
        V48Assert(!IPM175Sample(IPMPreviewPanel(kind,stale)),"cached sample is rejected while real source content exists: " kind)
    IPM.Source := 2,snap := IPMOverlaySnapshot(IP,IPM)
    V48Assert(snap.Actors[1].Name="Selected saved result" && snap.Actors[1].Damage=17000 && IPM.Source=2,"explicit source changes retain ordinary source behavior during preview")
    V48Assert(IPM.ChallengeChoice="auto" && IPM.ChallengeSource!=scope,"an explicit real source change still retires the old phase selection")
    IPM.Source := 3,snap := IPMOverlaySnapshot(IP,IPM)
    V48Assert(snap.Actors[1].Name="Selected saved result" && IPM.Source=3,"stopped automatic source remains automatic and follows the saved view")
    IPMEndRaidPreview()
    for kind in IPM175LogKinds()
        V48Assert(!IPM175Sample(IPMPreviewPanel(kind,stale)),"stopping preview rejects a retained sample snapshot: " kind)
    V48Assert(IP.Actor="@Selected saved result#102" && IP.Selected=1 && !IP.Follow && IP.View="Imported","preview and source changes preserve the selected actor and workspace view")
}

IPM175ZeroAndRun() => IPM175Isolated(IPM175ZeroAndRunCase)
IPM175ZeroAndRunCase()
{
    global IP,IPM,IRN
    s := IPNewData("Private recorded zero HP"),owner := "@Zero healer#175|(0,0,0,0)|(100/100)"
    boss := "Hand of Brontes {3303276527222784}:175"
    IPFeedLine(s,V54Line(1000,owner,"","836045448945489"))
    IPFeedLine(s,V54Line(2000,owner,boss "|(0,0,0,0)|(100/100)","836045448945501","(100 energy {836045448940874}) <150.0>","836045448945477"))
    IPFeedLine(s,V54Line(3000,boss "|(0,0,0,0)|(0/100)",owner,"836045448953668"))
    IPCloseSegment(s,"private zero HP complete"),s.Finished := true,IPM175Select(s,"@Zero healer#175")
    snap := IPMOverlaySnapshot(IP,IPM),before := V7849TotalStamp(s.Segments[1])
    V48Assert(snap.Raid.Health.Length=1 && snap.Raid.Health[1].Current=0 && snap.Actors[1].Heal=0,"actual parser snapshot retains observed dead boss and zero healing")
    hp := IPM.Panels["BossHP"],heal := IPM.Panels["Heal"],run := IPM.Panels["RunTimer"]
    IPMEnsureGui("BossHP",0,hp),IPMEnsureGui("Heal",0,heal),IPMEnsureGui("RunTimer",0,run)
    IRNStart(IRN,"gods",IRNUtcMs(),ClockMs()),deadline := IRN.DeadlineUtc
    IPMRender("RunTimer",snap,run),runText := run.Empty.Text,runName := run.Meta.Text,button := run.ParserButton.Text
    for count in [8,16] {
        V48Assert(IPMPreviewSet(count),"preview starts beside recorded zero metrics")
        snap := IPMOverlaySnapshot(IP,IPM),IPMRender("BossHP",snap,hp),IPMRender("Heal",snap,heal),IPMRender("RunTimer",snap,run)
        V48Assert(hp.VisibleRows=0 && !InStr(hp.Heading.Text,"Preview") && snap.Raid.Health[1].Current=0,"dead boss stays empty instead of becoming a fake living sample boss")
        V48Assert(heal.VisibleRows=0 && !InStr(heal.Heading.Text,"Preview") && snap.Actors[1].Heal=0,"recorded zero healing stays zero rather than sample throughput")
        V48Assert(run.Empty.Text=runText && run.Meta.Text=runName && run.ParserButton.Text=button && !InStr(run.ParserButton.Text,"Preview"),"retained real run keeps its time, raid and header during samples")
        V48Assert(IRN.DeadlineUtc=deadline && V7849TotalStamp(s.Segments[1])=before,"preview does not advance run deadlines or rewrite recorded counters")
    }
}

IPM175EmptyAndGuards() => IPM175Isolated(IPM175EmptyAndGuardsCase)
IPM175EmptyAndGuardsCase()
{
    global IP,IPM,IRT,IRTPrefs
    IP.View := "Imported",IRT.Enabled := false
    p := IPM.Panels["Damage"],IPMEnsureGui("Damage",0,p)
    for count in [8,16] {
        IPM.MaxRows := count,V48Assert(IPMPreviewSet(count),"no-log layout preview remains available")
        snap := IPMOverlaySnapshot(IP,IPM),stale := IPM.PreviewSnapshot
        for kind in IPM175LogKinds()
            V48Assert(IPM175Sample(IPMPreviewPanel(kind,snap)),"empty log-backed panel receives a labeled sample: " kind)
        IPMRender("Damage",snap,p)
        V48Assert(p.VisibleRows=count && InStr(p.Heading.Text,"Preview"),"native no-log preview retains the chosen eight or sixteen sample rows")
        V48Assert(IRTUSnapshot(IRT,1000,IRTPrefs).LayoutSample,"empty independent timer display can receive samples")
        IPM175Select(V7849SavedFixture("Newly loaded",1000),"@Newly loaded#102")
        for kind in IPM175LogKinds()
            V48Assert(!IPM175Sample(IPMPreviewPanel(kind,stale)),"loading real content immediately rejects an older no-log sample: " kind)
        IPMRender("Damage",stale,p)
        V48Assert(p.VisibleRows=1 && p.Rows[1].Name.Text="Newly loaded" && !InStr(p.Heading.Text,"Preview"),"cached native sample refreshes to newly loaded real data")
        IPMEndRaidPreview(),IP.Offline := ""
        IP.Active := true
        V48Assert(!IPMPreviewSet(count),"active parsing prevents layout samples from starting")
        V48Assert(!IPM175Sample(IPMPreviewPanel("Damage",stale)),"a parser handoff cannot keep a cached sample")
        IP.Active := false,IP.Queue := ["pending"],IP.Head := 1
        V48Assert(!IPMPreviewSet(count),"queued parser records prevent preview from starting")
        IP.Queue := [],IP.Head := 1
    }
    V48Assert(!IP.Active && !IPM.TimerOn && !IPM.DragHooks,"private render tests leave the reader and input hooks stopped")
}

; Native keyboard routing under SELF_TEST. Temporary controls; no normal restart.
IGV176RestartControls() => V749ProgressionFixture(IGV176RestartControlsCase)
IGV176RestartScope() => V749ProgressionFixture(IGV176RestartScopeCase)
IGV176RestartStandalone() => V58Isolated(IGV176RestartStandaloneCase)

IGV176Keys(action)
{
    keys := Buffer(256,0),previous := Buffer(256,0)
    DllCall("GetKeyboardState","Ptr",previous)
    try {
        NumPut("UChar",0x80,keys,0x11),DllCall("SetKeyboardState","Ptr",keys)
        action.Call(keys)
    }
    finally SetTimer(ICRestart,0),DllCall("SetKeyboardState","Ptr",previous)
}
IGV176RestartControlsCase(v) => IGV176Keys(IGV176RestartControlsWithKeys.Bind(v))
IGV176RestartControlsWithKeys(v,keys)
{
    global IP,SELF_TEST
    u := IPWState(),before := u.Controls["Tabs"].Value
    try {
        IP.Gui.Show("NA w1220 h780"),v.Gui.Show("NA")
        V48Assert(SELF_TEST && DllCall("IsWindowVisible","Ptr",v.Gui.Hwnd),"Progression controls are exposed only inside the private diagnostic")
        for name in ["Search","Source","Window","AddLogs","Refresh","Toggle","More"] {
            target := v.Controls[name].Hwnd
            V48Assert(IGVRestartKey(0x52,1,0x100,target)=0,"exact Ctrl+R reaches restart from Progression " name)
            Sleep(10)
            V48Assert(IPMGuiAlive(IP.Gui) && IPMGuiAlive(v.Gui),"SELF_TEST refuses actual restart from " name)
        }
        for target in [v.Gui.Hwnd,v.Controls["Rows"].Hwnd,v.Controls["Chart"].Hwnd]
            V48Assert(IGVRestartKey(0x52,1,0x100,target)=0,"Progression root and native graph/table descendants share restart")
        V48Assert(IGVRestartKey(0x52,0x40000001,0x100,v.Controls["Search"].Hwnd)=0,"held Ctrl+R is consumed without another restart")
        V48Assert(u.Controls["Tabs"].Value=before && u.Tab=11,"restart shortcut does not select a different main tab")
    }
    finally IP.Gui.Hide(),v.Gui.Hide()
}
IGV176RestartScopeCase(v) => IGV176Keys(IGV176RestartScopeWithKeys.Bind(v))
IGV176RestartScopeWithKeys(v,keys)
{
    global IP
    outside := Gui("+ToolWindow","Private unrelated window"),edit := outside.AddEdit(),target := v.Controls["Search"].Hwnd
    try {
        IP.Gui.Show("NA w1220 h780"),v.Gui.Show("NA")
        V48Assert(IGVRestartKey(0x52,1,0x100,edit.Hwnd)="","unrelated application controls are outside Progression shortcut scope")
        V48Assert(IGVRestartKey(0x52,1,0x100,IP.Gui.Hwnd)="","Progression bridge leaves main menu accelerator to its existing owner")
        V48Assert(IGVRestartKey(0x41,1,0x100,target)="","other edit shortcuts remain available")
        for key in [0x10,0x12,0x5B,0x5C] {
            NumPut("UChar",0x80,keys,key),DllCall("SetKeyboardState","Ptr",keys)
            V48Assert(IGVRestartKey(0x52,1,0x100,target)="","extra modifiers do not restart Iris")
            NumPut("UChar",0,keys,key)
        }
        NumPut("UChar",0,keys,0x11),DllCall("SetKeyboardState","Ptr",keys)
        V48Assert(IGVRestartKey(0x52,1,0x100,target)="","plain R remains available for searching")
        NumPut("UChar",0x80,keys,0x11),DllCall("SetKeyboardState","Ptr",keys),v.Gui.Hide()
        V48Assert(IGVRestartKey(0x52,1,0x100,target)="","hidden Progression cannot consume the shortcut")
        v.Gui.Show("NA"),IP.Gui.Hide()
        V48Assert(IGVRestartKey(0x52,1,0x100,target)="","hidden host also disables the embedded shortcut")
        IGVClose()
        V48Assert(IGVRestartKey(0x52,1,0x100,target)="","closed Progression ignores stale control handles")
    }
    finally IP.Gui.Hide(),outside.Destroy()
}
IGV176RestartStandaloneCase() => IGV176Keys(IGV176RestartStandaloneWithKeys)
IGV176RestartStandaloneWithKeys(keys)
{
    IGVEnsure(),v := IGVState(),target := v.Controls["Search"].Hwnd
    try {
        v.Gui.Show("NA w960 h570")
        V48Assert(!v.Parent && IGVRestartKey(0x52,1,0x100,target)=0,"standalone Progression uses the same scoped restart route")
        Sleep(10)
        V48Assert(IPMGuiAlive(v.Gui),"SELF_TEST also refuses standalone restart")
    }
    finally IGVClose()
}

; Synthetic native controls only. No parser/overlay timers, gameplay input,
; file imports, network, capture, speech or persistent settings are enabled.
IPF180RaidMenu() => V58Isolated(IPF180RaidMenuCase)
IPF180RaidGrowth() => V58Isolated(IPF180RaidGrowthCase)
IPF180Context() => V58Isolated(IPF180ContextCase)
IPF180Breakdown() => V58Isolated(IPF180BreakdownCase)
IPF180ActorMenu() => V58Isolated(IPF180ActorMenuCase)
IPF180Headers() => V58Isolated(IPF180HeadersCase)

IPF180Show(control)
{
    global IP,SELF_TEST
    V48Assert(SELF_TEST && !IP.Active && !IP.Timer,"native menu fixture does not start collection")
    IP.Gui.Show("NA w1220 h780"),Sleep(-1)
    SendMessage(0x14F,1,0,control)
    V48Assert(SendMessage(0x157,0,0,control)=1,"the real native popup is open")
}
IPF180Hide(control)
{
    global IP
    SendMessage(0x14F,0,0,control)
    IP.Gui.Hide()
}
IPF180Index(keys,key)
{
    for i,k in keys
        if k=key
            return i
    throw Error("Missing synthetic menu key")
}
IPF180RaidMenuCase()
{
    global IP
    f := V7875RaidTargetFixture(),c := IPWState().Controls["RaidTarget"],r := IRBTState()
    before := IAFrozenTarget(f.Segment),index := IPF180Index(r.Keys,f.B),revision := r.Revision
    IPF180Show(c)
    try {
        SendMessage(0x14E,index-1,0,c)
        Loop 4
            IPRefresh()
        V48Assert(SendMessage(0x157,0,0,c)=1 && c.Value=index,"background refresh preserves an open menu's tentative target")
        V48Assert(r.Key="" && r.Revision=revision,"a tentative native highlight does not silently change the committed damage filter")
        V48Assert(IP.PlayersLV.GetText(V7428RaidRow(f.P),2)="475","until committed, the existing All targets output stays visible")
        SendMessage(0x14F,0,0,c),c.Choose(index),IRBTChanged()
        V48Assert(r.Key=f.B && IP.PlayersLV.GetText(V7428RaidRow(f.P),2)="200","committing the same displayed target applies its real counted damage")
        IPF180Show(c),SendMessage(0x14E,0,0,c),IPRefresh()
        SendMessage(0x14F,0,0,c),IPRefresh()
        V48Assert(r.Key=f.B && c.Text="Esne","closing an uncommitted browse restores the committed filter without changing it")
        V48Assert(!IABaseReconcile(f.Segment,before).Length,"menu interaction does not edit the counted source ledger")
    }
    finally IPF180Hide(c)
}
IPF180RaidGrowthCase()
{
    global IP
    f := V7875RaidTargetFixture(),c := IPWState().Controls["RaidTarget"],r := IRBTState()
    V7875RaidTargetChoose(f.A),keys := r.Keys,signature := r.Signature,count := SendMessage(0x146,0,0,c)
    IPF180Show(c)
    try {
        add := IPActor("New countermeasure {4105005613170688}:88"),f.Segment.Actors[add.Key] := add
        IPRefresh()
        V48Assert(r.Keys=keys && r.Signature=signature && SendMessage(0x146,0,0,c)=count,"new enemies leave both displayed options and their index-to-key map unchanged while open")
        V48Assert(IPWDropdownOpen(c) && c.Text="Aivela" && r.Key=f.A,"new enemies do not interrupt the existing selected boss")
        SendMessage(0x14F,0,0,c),IPRefresh()
        V48Assert(SendMessage(0x146,0,0,c)=count+1 && r.Keys.Length=count+1,"closing the menu reconciles the newly available enemy")
        V48Assert(r.Key=f.A && IP.PlayersLV.GetText(V7428RaidRow(f.P),2)="100","list reconciliation keeps the old target and its counted damage")
        V7875RaidTargetChoose(add.Key)
        V48Assert(r.Key=add.Key && IP.PlayersLV.GetText(V7428RaidRow(f.P),2)="0","the newly added target can subsequently be selected without an index mismatch")
    }
    finally IPF180Hide(c)
}
IPF180ContextCase()
{
    global IP
    f := V7875RaidTargetFixture(),c := IPWState().Controls["RaidTarget"]
    V7875RaidTargetChoose(f.Add),IPF180Show(c)
    try {
        next := V7875RaidTargetFixture()
        V48Assert(!IPWDropdownOpen(c),"a genuinely different recording closes the obsolete popup")
        V48Assert(IRBTState().Segment=next.Segment && IRBTState().Key="" && c.Text="All targets","a different recording resets stale target identity rather than reusing its popup index")
        IPWClearData(true)
        V48Assert(!c.Enabled && IP.OtherKeys.Length=1,"clearing the view removes selectable stale target state")
    }
    finally IPF180Hide(c)
}
IPF180BreakdownCase()
{
    global IP
    f := V7875RaidTargetFixture(),IP.Actor := f.P,V58SelectTab(2)
    c := IP.OtherChoice,index := IPF180Index(IP.OtherKeys,f.B),keys := IP.OtherKeys
    IPF180Show(c)
    try {
        SendMessage(0x14E,index-1,0,c)
        f.Segment.End := -1
        IPFeedLine(f.Data,IPDemoLine(3500,f.P,"New damage target {123456789}:99","Damage",50))
        IPRefresh()
        V48Assert(IPWDropdownOpen(c) && c.Value=index && IP.OtherKeys=keys,"live Damage-tab records preserve tentative target selection and its old index map")
        V48Assert(IP.Other="","a highlighted target remains distinct from the committed damage breakdown filter")
        SendMessage(0x14F,0,0,c),c.Choose(index),IPChangeOther()
        V48Assert(IP.Other=f.B && c.Text="Esne [11]","Damage-tab commit selects the original displayed enemy while deferred options reconcile")
        V48Assert(IP.OtherKeys.Length=keys.Length+1,"the new live target appears after the menu closes")
        V48Assert(IP.AbilitiesLV.GetCount()>0 && IP.AbilitiesLV.GetText(1,2)="200","the selected target's ability breakdown retains its counted damage")
        V58SelectTab(4)
        V48Assert(IPWState().BreakdownContext!=(IPWKey(f.Data,f.Segment) "|" f.P "|Damage"),"switching metric replaces its independent target/source context")
    }
    finally IPF180Hide(c)
}
IPF180ActorMenuCase()
{
    global IP
    f := V7875RaidTargetFixture(),u := IPWState(),c := u.Controls["PlayerChoice"]
    index := IPF180Index(u.ActorKeys,f.Q),keys := u.ActorKeys
    IPF180Show(c)
    try {
        SendMessage(0x14E,index-1,0,c)
        actor := IPActor("@Late player#777"),f.Segment.Actors[actor.Key] := actor
        IPRefresh()
        V48Assert(IPWDropdownOpen(c) && c.Value=index && u.ActorKeys=keys,"an arriving player preserves a user-browsed player menu and its index map")
        SendMessage(0x14F,0,0,c),c.Choose(index),IPWChoosePlayer()
        V48Assert(IP.Actor=f.Q && c.Text="Damage Two","committing after roster growth selects the original displayed player")
        V48Assert(u.ActorKeys.Length=keys.Length+1,"the next closed-menu refresh includes the newly observed player")
        source := IP.ViewChoice
        IPF180Show(source)
        try {
            SendMessage(0x14E,1,0,source),IPRefresh()
            V48Assert(IPWDropdownOpen(source) && source.Value=2 && IP.View="Live","refresh leaves a tentative source choice alone without silently switching datasets")
        }
        finally SendMessage(0x14F,0,0,source)
        IPRefresh()
        V48Assert(source.Value=1 && IP.View="Live","closing an uncommitted source browse retains the actual data source")
    }
    finally IPF180Hide(c)
}
IPF180HeadersCase()
{
    global IP
    V7875RaidTargetFixture(),u := IPWState()
    for tab in [11,13] {
        u.Tab := tab,IPRefresh(),caption := IP.InfoText.Text,subtitle := IP.Subtitle.Text
        IPWSetFightText(IP.InfoText,"Obsolete fight heading"),IPWSetFightText(IP.Subtitle,"Obsolete fight subtitle")
        V48Assert(IP.InfoText.Text=caption && IP.Subtitle.Text=subtitle,"a page-owned heading is not replaced by the intermediate fight heading")
        IPRefresh()
        V48Assert(IP.InfoText.Text=caption && IP.Subtitle.Text=subtitle,"an unchanged refresh preserves the page's final heading")
    }
    u.Tab := 7,IPRefresh()
    V48Assert(IP.InfoText.Text=IPSelectedSegment().Opponent,"returning to Raid restores the selected fight heading")
    IP.Status := "Synthetic changed status",IPRefresh()
    V48Assert(IP.StatusText.Text="Synthetic changed status","changed status text still reaches the real control")
    IP.Active := true,IPRefresh()
    V48Assert(u.Controls["ParserState"].Text="Parsing" && !IP.StartButton.Enabled && IP.StopButton.Enabled,"changed parsing state still updates labels and enabled controls")
    IP.Active := false,IPRefresh()
    V48Assert(u.Controls["ParserState"].Text="Stopped" && IP.StartButton.Enabled,"stopping restores the idle controls without starting a timer")
}

; Synthetic native-table paint regressions. Fixtures remain hidden and do not
; enable parsing, overlays, input, speech, capture, settings or network access.
IMP179Dispatch(control,stage,dc := 0,row := 1,column := 2,reportedSelected := false)
{
    off := IURDrawOffsets(),b := V622Notification(control,stage,column,reportedSelected ? 1 : 0)
    NumPut("Ptr",dc,b,A_PtrSize=8 ? 32 : 16),NumPut("UPtr",row-1,b,off.Item)
    NumPut("UInt",0x123456,b,off.Text),NumPut("UInt",0x654321,b,off.Background)
    return {Result:IURNotify(control,b.Ptr),Buffer:b}
}

IMP179PaintLifetime()
{
    V622With(IMP179LifetimeFixture)
}
IMP179LifetimeFixture(f)
{
    IURRegister(f.List,2)
    V621Surface(400,200,IMP179LifetimeDC.Bind(f))
}
IMP179LifetimeDC(f,dc)
{
    e := IURState().Tables[f.List.Hwnd],high := IUSHighContrast()
    pre := IMP179Dispatch(f.List,1,dc)
    V48Assert(pre.Result=(high ? 0 : 0x30),"native paint requests bounded row and completion notifications")
    if high
        return
    V48Assert(IsObject(e.Paint),"native paint metadata exists only while painting")
    IMP179Dispatch(f.List,0x10001,dc),cell := IMP179Dispatch(f.List,0x30001,dc)
    V48Assert(cell.Result=2 && NumGet(cell.Buffer,IURDrawOffsets().Background,"UInt")=IUBColorRef("205A96"),"paint retains native role colors")
    V48Assert(IMP179Dispatch(f.List,2,dc).Result=0 && !IsObject(e.Paint),"POSTPAINT releases metadata instead of retaining a selection snapshot")
    f.List.Modify(1,"Select")
    selected := IMP179Dispatch(f.List,0x30001,dc)
    V48Assert(selected.Result=0 && NumGet(selected.Buffer,IURDrawOffsets().Background,"UInt")=0x654321,"standalone callback after paint reads the new real selection and preserves native colors")
    f.List.Modify(1,"-Select")
    plain := IMP179Dispatch(f.List,0x30001)
    V48Assert(plain.Result=2 && !IsObject(e.Paint),"no-DC standalone drawing remains uncached and usable")
}

IMP179Selection()
{
    V622With(IMP179SelectionFixture)
}
IMP179SelectionFixture(f)
{
    IURRegister(f.List,2)
    V621Surface(400,200,IMP179SelectionDC.Bind(f))
}
IMP179SelectionDC(f,dc)
{
    if IUSHighContrast()
        return
    o := IURDrawOffsets()
    for selected in [true,false,true] {
        f.List.Modify(1,selected ? "Select" : "-Select")
        IMP179Dispatch(f.List,1,dc),IMP179Dispatch(f.List,0x10001,dc)
        cell := IMP179Dispatch(f.List,0x30001,dc,1,2,!selected)
        V48Assert(selected ? cell.Result=0 && NumGet(cell.Buffer,o.Background,"UInt")=0x654321
            : cell.Result=2 && NumGet(cell.Buffer,o.Background,"UInt")=IUBColorRef("205A96"),"each new paint trusts actual selection instead of reported CDIS_SELECTED")
        IMP179Dispatch(f.List,2,dc)
    }
    f.List.Modify(1,"Select"),f.List.Modify(2,"-Select")
    IMP179Dispatch(f.List,1,dc)
    first := IMP179Dispatch(f.List,0x30001,dc,1),second := IMP179Dispatch(f.List,0x30001,dc,2)
    V48Assert(first.Result=0 && second.Result=2 && NumGet(second.Buffer,o.Background,"UInt")=IUBColorRef("9D3545"),"subitem-only row fallback cannot reuse another row's selection")
    IMP179Dispatch(f.List,2,dc)
}

IMP179DisabledTheme()
{
    V622With(IMP179ThemeFixture)
}
IMP179ThemeFixture(f)
{
    IURRegister(f.List,2,true)
    V621Surface(400,200,IMP179ThemeDC.Bind(f))
}
IMP179ThemeDC(f,dc)
{
    global IUB
    if IUSHighContrast() {
        V48Assert(IMP179Dispatch(f.List,1,dc).Result=0,"real high contrast retains wholly native rendering")
        V48Assert(IMP179Dispatch(f.List,0x30001,dc).Result=0,"standalone high-contrast rendering stays native")
        return
    }
    o := IURDrawOffsets()
    for enabled in [false,true,false,true] {
        f.List.Enabled := enabled
        IMP179Dispatch(f.List,1,dc),cell := IMP179Dispatch(f.List,0x30001,dc)
        V48Assert(enabled ? cell.Result=2 : cell.Result=0 && NumGet(cell.Buffer,o.Background,"UInt")=0x654321,"each new paint reads current disabled state and preserves disabled native colors")
        IMP179Dispatch(f.List,2,dc)
    }
    for theme in ["iris","dark","iris"] {
        IUB.Theme := theme
        IMP179Dispatch(f.List,1,dc),cell := IMP179Dispatch(f.List,0x30001,dc,1,1),p := ITBPalette(IUBPalette())
        V48Assert(cell.Result=2 && NumGet(cell.Buffer,o.Text,"UInt")=IUBColorRef(p.Text)
            && NumGet(cell.Buffer,o.Background,"UInt")=IUBColorRef(p.Row),"repainting after a theme change uses its current text and row palette")
        IMP179Dispatch(f.List,2,dc)
    }
}

IMP179Bounds()
{
    V622With(IMP179BoundsFixture)
}
IMP179BoundsFixture(f)
{
    IURRegister(f.List,2)
    V621Surface(400,200,IMP179BoundsDC.Bind(f))
}
IMP179BoundsDC(f,dc)
{
    if IUSHighContrast()
        return
    o := IURDrawOffsets()
    IMP179Dispatch(f.List,1,dc)
    for request in [[3,2],[1,0],[1,3]] {
        cell := IMP179Dispatch(f.List,0x30001,dc,request[1],request[2])
        V48Assert(cell.Result=0 && NumGet(cell.Buffer,o.Background,"UInt")=0x654321,"out-of-range row and column callbacks do not alter native color storage")
    }
    IMP179Dispatch(f.List,2,dc),f.List.Delete(2)
    IMP179Dispatch(f.List,1,dc),removed := IMP179Dispatch(f.List,0x30001,dc,2)
    V48Assert(removed.Result=0,"the next paint sees a row removed since the previous paint")
    IMP179Dispatch(f.List,2,dc),f.List.Add("","Replacement","Healer")
    IMP179Dispatch(f.List,1,dc),added := IMP179Dispatch(f.List,0x30001,dc,2)
    V48Assert(added.Result=2 && NumGet(added.Buffer,o.Background,"UInt")=IUBColorRef("216747"),"the next paint sees a newly added row with its own role")
    IMP179Dispatch(f.List,2,dc),f.List.InsertCol(3,0,"Extra")
    IMP179Dispatch(f.List,1,dc),column := IMP179Dispatch(f.List,0x30001,dc,1,3)
    V48Assert(column.Result=2,"the next paint accepts a newly added valid column")
    IMP179Dispatch(f.List,2,dc)
}

IMP179Reregister()
{
    V622With(IMP179ReregisterFixture)
}
IMP179ReregisterFixture(f)
{
    IURRegister(f.List,2)
    V621Surface(400,200,IMP179ReregisterDC.Bind(f))
}
IMP179ReregisterDC(f,dc)
{
    e := IURState().Tables[f.List.Hwnd]
    IMP179Dispatch(f.List,1,dc),IURRegister(f.List,2)
    V48Assert(!IsObject(e.Paint),"re-registering clears an unfinished paint snapshot")
    f.List.Modify(1,"Select"),cell := IMP179Dispatch(f.List,0x30001,dc)
    V48Assert(cell.Result=0,"re-registering cannot retain a prior unselected row state")
    hwnd := f.List.Hwnd,IURDetach(hwnd)
    V48Assert(!IURState().Tables.Has(hwnd) && IMP179Dispatch(f.List,0x30001,dc).Result=0,"detached controls cannot reuse old paint metadata")
    V48Assert(IURRegister(f.List,2) && !IsObject(IURState().Tables[hwnd].Paint),"registering again begins without a cached paint")
}

IMP179NativePaint()
{
    ; Real Windows paint sequences, including selected rows, already verify the
    ; pixels rather than trusting synthetic notification buffers.
    V624TestNativeRoleBitmap(),V624TestNativeSelectionBitmap()
}

; Explanation text follows existing displayed grades. Native fixtures are hidden;
; no gameplay input, capture, speech, network, normal-app reload or extra grading.
IQPH181Text()
{
    dps := IQPHText("DPS",90.37,"Pyrotech Powertech","Dread Master Brontes","Feline")
    V48Assert(dps="Feline did more damage per second than about " IUNDecimal("90.37") "% of Pyrotech Powertech results on Dread Master Brontes.","DPS explanation names the displayed player, spec, fight and exact displayed estimate")
    V48Assert(IQPHText("EHPS",75,"Corruption Sorcerer","Nahut","Healer","Burn")="Healer healed more per second than about " IUNDecimal("75.00") "% of Corruption Sorcerer results on Nahut (Burn).","healing explanation retains its phase and its own metric")
    V48Assert(IQPHText("DTPS",95,"Immortal Juggernaut","Tyth","Tank")="Tank took less damage per second than about " IUNDecimal("95.00") "% of Immortal Juggernaut results on Tyth.","a higher DTPS rank explains lower incoming damage")
    V48Assert(IQPHText("TTK",80,"","Nefra")="This kill was faster than about " IUNDecimal("80.00") "% of recorded kills on Nefra.","TTK compares kill times without inventing a class comparison")
    for rank in [0,0.5,"<1"]
        V48Assert(InStr(IQPHText("DPS",rank,"Pyrotech Powertech","Nefra"),"under 1%"),"a valid lowest displayed rank keeps its lower-bound wording")
    V48Assert(InStr(IQPHText("DPS",100,"Pyrotech Powertech","Nefra"),"about " IUNDecimal("100.00") "%"),"the upper endpoint remains a valid displayed estimate")
    V48Assert(InStr(IQPHText("DPS",50,"Pyrotech Powertech","Nefra"),"You did"),"an unnamed local subject still has a short grammatical explanation")
    for rank in [-1,101,"","—","unknown"]
        V48Assert(IQPHText("DPS",rank,"Pyrotech Powertech","Nefra")="","unavailable and invalid values do not become a claimed percentile")
    V48Assert(IQPHText("DPS",50,"","Nefra")="" && IQPHText("DPS",50,"Pyrotech Powertech","")="","a missing comparison class or fight is not described as a valid result")
    V48Assert(IQPHText("unknown",50,"Pyrotech Powertech","Nefra")="","an unsupported metric cannot inherit DPS wording")
}

IQPH181RaidCells() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQPH181RaidCellsCase)))
IQPH181RaidGuards() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQPH181RaidGuardsCase)))
IQPH181Phase() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQPH181PhaseCase)))
IQPH181TTK() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQPH181TTKCase)))
IQPH181TipLifecycle() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQPH181TipLifecycleCase)))

IQPH181Cell(lv,row,column)
{
    rect := Buffer(16,0),NumPut("Int",column-1,rect,4)
    V48Assert(SendMessage(0x1038,row-1,rect.Ptr,lv.Hwnd),"the requested native cell has real bounds")
    return {X:NumGet(rect,0,"Int")+2,Y:(NumGet(rect,4,"Int")+NumGet(rect,12,"Int"))//2}
}
IQPH181Hover(lv,row,column)
{
    point := IQPH181Cell(lv,row,column)
    return IRCExactAt(lv,point.X,point.Y)
}
IQPH181Ready()
{
    global IP
    f := IQV139Ready(),key := f.Keys[1],t := f.Segment.Totals[key]
    t.HealRecords := 1,t.HealKnown := 1,t.Effective := 5000,t.Heal := 10000,t.Taken := 20000
    V7428RaidRedraw(),IPResize(IP.Gui,0,1600,820)
    return f
}
IQPH181RaidCellsCase()
{
    global IP,IUB
    f := IQPH181Ready(),lv := IP.PlayersLV,key := f.Keys[1],before := IAFrozenTarget(f.Segment)
    actions := Map(13,"more damage per second",15,"healed more per second",17,"less damage per second")
    for compact in [false,true] {
        IUB.CompactDamage := compact,V7428RaidRedraw(),row := V7428RaidRow(key)
        for column,action in actions {
            tip := IQPH181Hover(lv,row,column)
            V48Assert(InStr(tip,action) && InStr(tip,f.Segment.Actors[key].Name) && InStr(tip,IQPHSpec(f.Segment,key)) && InStr(tip,"Nefra"),"each native percentile column explains its own metric and actor with either damage format")
        }
        for column in [3,5,7]
            V48Assert(IQPH181Hover(lv,row,column)="","ordinary rate cells retain no percentile tooltip")
        tip := IQPH181Hover(lv,row,2)
        V48Assert(compact ? InStr(tip,"Damage:") : tip="","the existing exact-total hint remains tied to Compact damage")
    }
    IPWSort("Raid",lv,13)
    for key in f.Keys {
        row := V7428RaidRow(key),tip := IQPH181Hover(lv,row,13)
        V48Assert(InStr(tip,f.Segment.Actors[key].Name) && InStr(tip,"about " IQTLabel(IQTState().Rows[key].Percentile) "%"),"sorting preserves each row's captured actor and displayed rank")
    }
    IPAColumnOrder(lv,[0,11,1,12,2,3,14,4,5,16,6,7,9,10,8,13,15,17])
    row := V7428RaidRow(f.Keys[1])
    for column,action in actions
        V48Assert(InStr(IQPH181Hover(lv,row,column),action),"native column reordering preserves logical metric hit testing")
    IUB.QuartileColors := false
    V48Assert(InStr(IQPH181Hover(lv,row,13),"more damage per second"),"disabling rank colors preserves the explanation")
    V48Assert(!IABaseReconcile(f.Segment,before).Length && !IP.Active,"hover queries do not change the parsed metric ledger or start collection")
}
IQPH181RaidGuardsCase()
{
    global IP,IUB
    f := IQPH181Ready(),seg := f.Segment,lv := IP.PlayersLV,u := IPWState(),key := f.Keys[1]
    seg.Totals[key].Damage := 0,V7428RaidRedraw(),row := V7428RaidRow(key)
    V48Assert(InStr(IQPH181Hover(lv,row,13),"under 1%"),"an actual zero-output grade has a lower-bound explanation rather than an unavailable tooltip")
    seg.DisplayDisciplines[key] := "mixed",V7428RaidRedraw(),row := V7428RaidRow(key)
    for column in [13,15,17]
        V48Assert(IQPH181Hover(lv,row,column)="","an unknown or mixed spec cannot reuse the previous actor explanation")
    other := f.Keys[2]
    V48Assert(InStr(IQPH181Hover(lv,V7428RaidRow(other),13),seg.Actors[other].Name),"one ungraded actor does not clear another player's valid explanation")
    seg.DisplayDisciplines[key] := f.Ids[1],seg.ModeId := "unrecognized-mode",V7428RaidRedraw()
    for column in [13,15,17]
        V48Assert(IQPH181Hover(lv,V7428RaidRow(key),column)="","an unsupported fight clears all three previous metric explanations")
    seg.ModeId := "836045448953655",V7428RaidRedraw(),point := IQPH181Cell(lv,V7428RaidRow(other),13)
    IUB.PercentilesEnabled := false
    V48Assert(IQPHRaidAt(lv,point.X,point.Y)="","the master percentile preference immediately hides existing hints")
    IUB.PercentilesEnabled := true,u.Tab := 2
    V48Assert(IQPHRaidAt(lv,point.X,point.Y)="","the hidden Raid page does not supply a tooltip for a different tab")
    u.Tab := 7
    V48Assert(IQPHRaidAt(u.Controls["Events"],point.X,point.Y)="" && IQPHRaidAt(lv,-20,-20)="","foreign controls and empty native hit regions have no stale explanation")
    IPWClearData()
    V48Assert(!u.RaidPercentileHints.Count && IQPHRaidAt(lv,point.X,point.Y)="","clearing the recording also clears its captured hints")
}
IQPH181PhaseCase()
{
    global IP
    f := IQC165Fixture(),seg := f.Segment,key := f.Keys[1],healer := f.Keys[-1],u := IPWState(),r := IRPState()
    seg.BossName := "Nahut",seg.Opponent := "Nahut (8 NiM)"
    r.Selection := IPWRotationSelection(),r.LiveSegment := seg,r.Models := [f.View],r.Choices := [f.Phase],r.Index := 2,r.Revision+=1
    u.Controls["RaidPhase"].Delete(),u.Controls["RaidPhase"].Add(["Whole fight","Burn"]),u.Controls["RaidPhase"].Choose(2)
    V7428RaidRedraw(),lv := IP.PlayersLV
    dps := IQPH181Hover(lv,V7428RaidRow(key),13),ehps := IQPH181Hover(lv,V7428RaidRow(healer),15)
    V48Assert(InStr(dps,"more damage per second") && InStr(dps,"Nahut (Burn)") && InStr(dps,"about " IUNDecimal("50.00") "%"),"a real Raid phase DPS cell explains the captured Burn comparison")
    V48Assert(InStr(ehps,"healed more per second") && InStr(ehps,"Nahut (Burn)") && InStr(ehps,"about " IUNDecimal("50.00") "%"),"phase healing retains its independently displayed grade and comparison")
    V48Assert(IQPH181Hover(lv,V7428RaidRow(key),17)="","a phase without a valid DTPS grade has no whole-fight DTPS explanation")
    f.Phase.Name := "Different phase name"
    V48Assert(IQPH181Hover(lv,V7428RaidRow(key),13)=dps,"hovering consumes the displayed capture rather than a newly mutated phase object")
    f.Phase.Name := "Burn",u.Controls["RaidPhase"].Choose(1),IRPChanged()
    V48Assert(!InStr(IQPH181Hover(lv,V7428RaidRow(key),13),"(Burn)"),"Whole fight removes a previously captured phase name")
}
IQPH181TTKPoint(lv,row,card)
{
    entry := IGFState().Lists[lv.Hwnd],rect := Buffer(16,0),client := Buffer(16,0)
    V48Assert(SendMessage(0x100E,row-1,rect.Ptr,lv.Hwnd) && DllCall("User32\GetClientRect","Ptr",lv.Hwnd,"Ptr",client),"the actual fight card exposes native timing bounds")
    pad := Round(7*A_ScreenDPI/96),left := Max(0,NumGet(rect,0,"Int"))+pad,right := NumGet(client,8,"Int")-pad
    layout := IGFTimingLayout(card,right-left,entry.Normal,entry.Bold)
    return {X:left+layout.GradeX+Max(1,layout.GradeW//2),Y:(NumGet(rect,4,"Int")+NumGet(rect,12,"Int"))//2+2,
        Top:NumGet(rect,4,"Int")+1,Left:left}
}
IQPH181TTKCase()
{
    global IP,IUB
    f := IQV139Ready(),seg := f.Segment,seg.SourcePath := "combat_2025-08-20_21_00_00_000001.txt"
    seg.FinishAt := seg.Start+129991,seg.Last := seg.FinishAt,V7428RaidRedraw()
    lv := IP.SegmentsLV,entry := IGFState().Lists[lv.Hwnd],card := IQF162SelectedCard()
    V48Assert(card.TTK=75.44,"the fixture uses an actual archived TTK estimate")
    if IUSHighContrast()
        return
    point := IQPH181TTKPoint(lv,1,card),tip := IQPHTTKAt(lv,point.X,point.Y)
    V48Assert(InStr(tip,"faster than about " IUNDecimal("75.44") "%") && InStr(tip,"Nefra") && !InStr(tip,"Powertech"),"the native sidebar grade explains kill speed without a player-spec claim")
    V48Assert(IQPHTTKAt(lv,point.X,point.Top)="" && IQPHTTKAt(lv,point.Left,point.Y)="","the fight title and ordinary time text do not act as percentile hover regions")
    IUB.PercentilesEnabled := false
    V48Assert(IQPHTTKAt(lv,point.X,point.Y)="","the master preference hides a cached TTK explanation immediately")
    IUB.PercentilesEnabled := true,ref := IQAReferences("TTK","MM",8,"7.7.1").Rows[seg.BossKey]
    seg.FinishAt := seg.Start+ref.Samples[-1]+1,seg.Last := seg.FinishAt,V7428RaidRedraw()
    card := IQF162SelectedCard(),point := IQPH181TTKPoint(lv,1,card)
    V48Assert(IGFPercentileLabel(card.TTK)="<1" && InStr(IQPHTTKAt(lv,point.X,point.Y),"faster than under 1%"),"a real lower-bound TTK label retains its explanation")
    seg.WipeEnded := true,V7428RaidRedraw()
    V48Assert(IQF162SelectedCard().TTK="" && IQPHTTKAt(lv,point.X,point.Y)="","an ungraded card clears the previous TTK hover result")
    entry.Failed := true
    V48Assert(IQPHTTKAt(lv,point.X,point.Y)="","a failed native card renderer does not expose stale hit geometry")
    entry.Failed := false
}

IQPH181ScreenPoint(lv,point)
{
    native := Buffer(8,0),NumPut("Int",point.X,"Int",point.Y,native)
    DllCall("User32\MapWindowPoints","Ptr",lv.Hwnd,"Ptr",0,"Ptr",native,"UInt",1)
    return {X:NumGet(native,0,"Int"),Y:NumGet(native,4,"Int")}
}
IQPH181VisibleTips()
{
    count := 0
    for hwnd in WinGetList("ahk_class tooltips_class32 ahk_pid " DllCall("GetCurrentProcessId"))
        count += !!DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int")
    return count
}
IQPH181ShowAt(hwnd,point)
{
    ; Exercise the production tooltip path once. Its normal poll timer is
    ; immediately stopped so its periodic mouse watcher does not run in tests.
    IQPHShowAt(hwnd,point.X,point.Y),SetTimer(IRCHoverPoll,0)
    Sleep(-1)
}
IQPH181TipLifecycleCase()
{
    global IP,IUB,SELF_TEST
    V48Assert(SELF_TEST,"the native tooltip lifecycle is confined to manual synthetic diagnostics")
    IQPHClearAll(),f := IQPH181Ready(),lv := IP.PlayersLV,row := V7428RaidRow(f.Keys[1]),saved := IUB.PercentilesEnabled
    try {
        IP.Gui.Show("NA w1600 h820"),Sleep(-1)
        point := IQPH181Cell(lv,row,13),screen := IQPH181ScreenPoint(lv,point)
        expected := IQPHRaidAt(lv,point.X,point.Y)
        V48Assert(expected!="" && DllCall("User32\IsWindowVisible","Ptr",lv.Hwnd,"Int"),"the lifecycle starts at a visible native percentile cell on the private desktop")
        IQPH181ShowAt(lv.Hwnd,screen),hover := IRCHoverState()
        V48Assert(hover.Hwnd=lv.Hwnd && hover.Text=expected,"the real tooltip path captures this value's short explanation")
        V48Assert(IQPH181VisibleTips()>0,"ToolTip20 creates an actual visible tooltip window owned by the fixture process")
        IUB.PercentilesEnabled := false,IQPH181ShowAt(lv.Hwnd,screen)
        V48Assert(hover.Hwnd=0 && hover.Text="" && IQPH181VisibleTips()=0,"disabling percentiles clears both shared state and the actual tooltip window")
        IUB.PercentilesEnabled := true,IQPH181ShowAt(lv.Hwnd,screen)
        V48Assert(hover.Text=expected && IQPH181VisibleTips()>0,"a valid cell can show the tooltip again after reenabling percentiles")
        rate := IQPH181ScreenPoint(lv,IQPH181Cell(lv,row,3)),IQPH181ShowAt(lv.Hwnd,rate)
        V48Assert(hover.Hwnd=0 && hover.Text="" && IQPH181VisibleTips()=0,"moving the synthetic hit away from the percentile clears the visible tooltip")
        IQPH181ShowAt(lv.Hwnd,screen),IP.Gui.Hide(),IQPH181ShowAt(lv.Hwnd,screen)
        V48Assert(hover.Hwnd=0 && hover.Text="" && IQPH181VisibleTips()=0,"hiding the main fixture invalidates the previous cell and hides the real tooltip")
    }
    finally {
        IRCHide(),SetTimer(IRCHoverPoll,0),IQPHClearAll(),IUB.PercentilesEnabled := saved
        IP.Gui.Hide()
    }
}

; Native value controls on the private test desktop only. No tooltip is shown
; and SELF_TEST keeps the hover watch, capture, audio and parser timers off.
IQPH181OverlayRegistry() => V601Isolated(IQPH181OverlayRegistryCase)
IQPH181OverlaySources() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQPH181OverlaySourcesCase)))

IQPH181Point(control)
{
    rect := Buffer(16,0)
    V48Assert(DllCall("User32\GetWindowRect","Ptr",control.Hwnd,"Ptr",rect,"Int"),"the synthetic value control has an actual screen rectangle")
    return {X:Floor((NumGet(rect,0,"Int")+NumGet(rect,8,"Int"))/2),Y:Floor((NumGet(rect,4,"Int")+NumGet(rect,12,"Int"))/2)}
}

IQPH181OverlayRegistryCase()
{
    global SELF_TEST,IUB
    V48Assert(SELF_TEST,"overlay hint registry fixture cannot start the normal hover watcher")
    IQPHClearAll(),g := Gui("+ToolWindow -Caption +AlwaysOnTop +E0x08000020")
    ctrl := g.AddText("x10 y10 w80 h24","90"),hint := IQPHText("DPS",90,"Pyrotech","Nahut","Synthetic player")
    try {
        g.Show("NA x50 y50 w120 h50"),point := IQPH181Point(ctrl)
        style := DllCall("User32\GetWindowLongW","Ptr",g.Hwnd,"Int",-20,"UInt")
        V48Assert(IQPHBind(ctrl,hint) && IQPHOverlayActive(),"a visible rendered percentile registers a nonempty hover hint")
        hit := IQPHOverlayAt(point.X,point.Y)
        V48Assert(IsObject(hit) && hit.Control=ctrl && hit.Text=hint,"screen-coordinate hit testing finds the exact value without requiring mouse input messages")
        V48Assert(!IsObject(IQPHOverlayAt(point.X+200,point.Y)),"hovering outside the value does not expose its hint")
        V48Assert(DllCall("User32\GetWindowLongW","Ptr",g.Hwnd,"Int",-20,"UInt")=style && (style&0x20),"binding and hit testing preserve the locked click-through window style")
        ctrl.Text := "91"
        V48Assert(!IQPHOverlayActive() && !IsObject(IQPHOverlayAt(point.X,point.Y)),"changed displayed values cannot reuse a hint captured for the old grade")
        ctrl.Text := "90",IQPHBind(ctrl,hint),IUB.PercentilesEnabled := false
        V48Assert(!IQPHOverlayActive(),"globally disabled percentiles do not expose stale overlay hints")
        IUB.PercentilesEnabled := true,g.Hide()
        V48Assert(!IQPHOverlayActive(),"hidden overlay windows have no active hover values")
        panel := {Rows:[{Value:ctrl}]},entry := IQPHOverlayState().Controls[ctrl.Hwnd]
        V48Assert(!IQPHPanelShown(panel),"a still-hidden panel cannot restart hover watching")
        g.Show("NA")
        V48Assert(IQPHPanelShown(panel) && IQPHOverlayState().Controls[ctrl.Hwnd]=entry && ctrl.IrisPercentileHint=hint,"reshowing unchanged percentile values resumes watching without forcing a new binding")
        IQPHBind(ctrl,"")
        V48Assert(!IQPHOverlayState().Controls.Has(ctrl.Hwnd) && ctrl.IrisPercentileHint="","unbinding removes both the handle registry and value metadata")
        IQPHBind(ctrl,hint),hwnd := ctrl.Hwnd,g.Destroy()
        V48Assert(!IQPHOverlayActive() && !IQPHOverlayState().Controls.Has(hwnd),"destroyed value windows are pruned instead of leaking stale handles")
    }
    finally {
        if IPMUiHandle(g)
            g.Destroy()
        IQPHClearAll()
    }
}

IQPH181OverlaySourcesCase()
{
    global IPM
    saved := IPM,IPM := IPMNewState()
    try {
        IQPHClearAll(),f := IQV139Ready(),IPM.Mode := 2
        snap := IPMSnapshot({Data:f.Data,Segment:f.Segment,State:"IMPORTED",Pending:0})
        V48Assert(snap.Quartiles.Graded>0 && snap.QuartileBoss=IQPHOverlayBoss(f.Segment),"the reference model captures its own source's fight caption")
        p := IPMPanelFor("Damage"),IPMEnsureGui("Damage",0,p),snap.QuartileBoss := "Saved overlay fight"
        IPMRender("Damage",snap,p),control := p.Rows[1].Value
        V48Assert(control.HasOwnProp("IrisPercentileHint") && InStr(control.IrisPercentileHint,"Saved overlay fight"),"DPS value hints use the source caption captured in the rendered snapshot")
        snap.QuartileBoss := "Second saved fight",IPMRender("Damage",snap,p)
        V48Assert(InStr(control.IrisPercentileHint,"Second saved fight") && !InStr(control.IrisPercentileHint,"Saved overlay fight"),"identical numbers with different source metadata refresh their hint instead of retaining the previous fight")
        oldHint := control.IrisPercentileHint,IPM.MaxRows := 1,IPMRender("Damage",snap,p)
        V48Assert(p.Rows[1].Value.IrisPercentileHint!="" && p.Rows[2].Value.IrisPercentileHint="","hidden rows clear their captured percentile metadata")
        IQOApplyMode(IPM,false,"Damage"),IPMRender("Damage",snap,p)
        V48Assert(p.RenderedMetric="Damage" && control.IrisPercentileHint="","ordinary damage totals cannot inherit a percentile tooltip")
        IQH148OnlyHealing(),IQOApplyMode(IPM,true,"Heal"),IPM.MaxRows := 8
        hf := IQH148Ready(IQH148Scopes()[1]),hs := IPMSnapshot({Data:hf.Data,Segment:hf.Segment,State:"IMPORTED",Pending:0})
        hp := IPMPanelFor("Heal"),IPMEnsureGui("Heal",0,hp),IPMRender("Heal",hs,hp)
        V48Assert(hs.HealerPercentiles.Graded>0 && hp.Rows[1].Value.HasOwnProp("IrisPercentileHint") && hp.Rows[1].Value.IrisPercentileHint!="","effective-healing overlay values capture their own graded spec and fight")
        IQOApplyMode(IPM,false,"Heal"),IPMRender("Heal",hs,hp)
        V48Assert(hp.Rows[1].Value.IrisPercentileHint="","normal healing presentation clears the percentile binding")
    }
    finally {
        IQPHClearAll(),IPMDestroyPanels(),IPM := saved
    }
}

; Actual native z-order on the private SELF_TEST desktop. No pointer movement,
; activation, input simulation, parser/capture/audio work or normal-app windows.
IQPH181OverlayOverlap() => V601Isolated(IQPH181OverlayOverlapCase)

IQPH181OverlapFront(g)
{
    V48Assert(DllCall("User32\SetWindowPos","Ptr",g.Hwnd,"Ptr",-1,"Int",0,"Int",0,"Int",0,"Int",0,"UInt",0x13,"Int"),
        "the synthetic private window moves to the top without activation")
}

IQPH181OverlayOverlapCase()
{
    global SELF_TEST,IUB
    V48Assert(SELF_TEST,"overlap checks require the isolated diagnostic runtime")
    IQPHClearAll(),IUB.PercentilesEnabled := true
    lower := Gui("+ToolWindow -Caption +AlwaysOnTop +E0x08000020")
    upper := Gui("+ToolWindow -Caption +AlwaysOnTop +E0x08000020")
    cover := Gui("+ToolWindow -Caption +AlwaysOnTop +E0x08000000")
    first := lower.AddText("x10 y10 w120 h24","90")
    second := upper.AddText("x10 y10 w120 h24","80")
    cover.AddText("x10 y10 w120 h24","Synthetic dialog")
    firstHint := IQPHText("DPS",90,"Pyrotech","First fight","First player")
    secondHint := IQPHText("DPS",80,"Vengeance","Second fight","Second player")
    try {
        lower.Show("NA x140 y140 w180 h60"),upper.Show("NA x140 y140 w180 h60")
        point := IQPH181Point(first)
        IQPHBind(first,firstHint),IQPHBind(second,secondHint)
        firstStyle := DllCall("User32\GetWindowLongW","Ptr",lower.Hwnd,"Int",-20,"UInt")
        secondStyle := DllCall("User32\GetWindowLongW","Ptr",upper.Hwnd,"Int",-20,"UInt")
        IQPH181OverlapFront(upper),hit := IQPHOverlayAt(point.X,point.Y)
        V48Assert(IsObject(hit) && hit.Control=second && hit.Text=secondHint,
            "the visually upper meter wins despite its later registry insertion")
        IQPH181OverlapFront(lower),hit := IQPHOverlayAt(point.X,point.Y)
        V48Assert(IsObject(hit) && hit.Control=first && hit.Text=firstHint,
            "reversing native z-order reverses the hovered source without rebinding")
        cover.Show("NA x140 y140 w180 h60"),IQPH181OverlapFront(cover)
        V48Assert(!IsObject(IQPHOverlayAt(point.X,point.Y)),
            "an opaque Iris-owned dialog above both meters suppresses their hints")
        IQPH181OverlapFront(upper),hit := IQPHOverlayAt(point.X,point.Y)
        V48Assert(IsObject(hit) && hit.Control=second,
            "a matching meter above the covering dialog remains the visible source")
        IQPH181OverlapFront(cover),cover.Hide(),hit := IQPHOverlayAt(point.X,point.Y)
        V48Assert(IsObject(hit) && hit.Control=second,
            "a hidden covering dialog does not suppress the current upper meter")
        upper.Hide(),hit := IQPHOverlayAt(point.X,point.Y)
        V48Assert(IsObject(hit) && hit.Control=first,
            "hiding the upper meter exposes the lower meter's own explanation")
        upper.Show("NA"),IQPH181OverlapFront(upper),second.Text := "81"
        V48Assert(!IsObject(IQPHOverlayAt(point.X,point.Y)),
            "a visible upper meter with invalidated metadata cannot expose a covered lower result")
        upper.Hide(),hit := IQPHOverlayAt(point.X,point.Y)
        V48Assert(IsObject(hit) && hit.Control=first,
            "hiding that stale surface restores the valid lower source")
        V48Assert(DllCall("User32\GetWindowLongW","Ptr",lower.Hwnd,"Int",-20,"UInt")=firstStyle
            && DllCall("User32\GetWindowLongW","Ptr",upper.Hwnd,"Int",-20,"UInt")=secondStyle
            && (firstStyle&0x20) && (secondStyle&0x20),
            "all overlap and occlusion checks preserve locked click-through styles")
    }
    finally {
        lower.Destroy(),upper.Destroy(),cover.Destroy(),IQPHClearAll()
    }
}

; Native menus and synthetic values only. Tests keep SELF_TEST enabled and use
; private desktops plus temporary INIs, never user settings or game input.
IQPH101Preferences() => V652TimerOverlayIsolated(IQPH101PreferencesCase)
IQPH101PreferencesCase(path)
{
    global IUB
    V48Assert(IUB.PercentileHints && IQPHHintsEnabled() && IQPHReadSetting(path),"new users default to explanations on")
    SettingsWrite(0,path,"IrisAppearance","PercentilesEnabled")
    SettingsWrite("keep",path,"Other","Marker")
    V48Assert(IQPHReadSetting(path),"an older INI without the new key defaults on independently of its master preference")
    IQPHSaveSetting(path,false),IUB := IUBNewState(),IUB.PercentileHints := IQPHReadSetting(path)
    V48Assert(!IQPHHintsEnabled() && !IQPHEnabled(),"the saved off choice survives a fresh appearance-state load")
    V48Assert(IniRead(path,"Other","Marker")="keep" && IniRead(path,"IrisAppearance","PercentilesEnabled")="0","saving explanations preserves unrelated and master preferences")
    IQPHSaveSetting(path,true),IUB.PercentileHints := IQPHReadSetting(path),IUB.PercentilesEnabled := false
    V48Assert(IQPHHintsEnabled() && !IQPHEnabled(),"an enabled explanation preference does not override disabled grading")
    IUB.PercentilesEnabled := true
    V48Assert(IQPHEnabled(),"reenabling grading uses the independently saved explanation preference")
}

IQPH101Menus() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQPH101MenusCase)))
IQPH101MenusCase()
{
    global IP,IUB,IIF
    f := IQPH181Ready(),u := IPWState(),extra := Menu()
    IIFAddPercentileSetting(extra)
    V48Assert(u.SettingsMenu.HasOwnProp("IrisPercentileOptions") && extra.HasOwnProp("IrisPercentileOptions"),"both Settings menu hosts own the nested percentile choices")
    for parent in [u.SettingsMenu,extra] {
        child := parent.IrisPercentileOptions
        V48Assert(DllCall("User32\GetMenuItemCount","Ptr",child.Handle,"Int")=3,"the submenu includes the shared decimal setting")
        V48Assert(V652TimerMenuState(child,"Enabled")&8,"the existing master defaults checked inside the submenu")
        V48Assert(V652TimerMenuState(child,"Precise percentiles")&8,"both menus default to displaying two decimal places")
        V48Assert(V652TimerMenuState(child,"Show hover explanations")&8,"the new hover choice defaults checked inside the submenu")
    }
    before := IAFrozenTarget(f.Segment),rank := IQTState().Rows[f.Keys[1]].Percentile,colors := IUB.QuartileColors
    V48Assert(IQTToggleDecimals() && !IQTDecimalsEnabled() && !ReadBoolSetting("IrisAppearance","PercentileDecimals",true),"whole-number display is saved")
    for parent in [u.SettingsMenu,extra]
        V48Assert(!(V652TimerMenuState(parent.IrisPercentileOptions,"Precise percentiles")&8),"both menus reflect whole-number display")
    row := V7428RaidRow(f.Keys[1])
    V48Assert(IP.PlayersLV.GetText(row,13)==(Floor(rank) "") && IQTState().Rows[f.Keys[1]].Percentile=rank,
        "the open Raid view updates its label and retains the precise grade")
    V48Assert(IQTLabel(99.99)=="99" && IQTLabel(100)=="100" && IQTLabel("")=="—","whole-number labels preserve the top grade and unavailable values")
    V48Assert(IQTToggleDecimals() && IQTDecimalsEnabled() && IP.PlayersLV.GetText(V7428RaidRow(f.Keys[1]),13)==IQTLabel(rank)
        && IQTLabel(99.99)==IUNDecimal("99.99"),"the Raid view restores two decimal places without reopening")
    V48Assert(IQPHToggleHints() && !IQPHHintsEnabled() && IQTEnabled(),"the submenu callback turns only explanations off")
    for parent in [u.SettingsMenu,extra] {
        V48Assert((V652TimerMenuState(parent,"Enable percentiles")&8)
            && (V652TimerMenuState(parent.IrisPercentileOptions,"Enabled")&8)
            && !(V652TimerMenuState(parent.IrisPercentileOptions,"Show hover explanations")&8),"both menu hosts synchronize without unchecking percentiles")
    }
    V48Assert(IQTState().Rows[f.Keys[1]].Percentile=rank && IUB.QuartileColors=colors && !IABaseReconcile(f.Segment,before).Length,"explanations do not recalculate grades, change colors or mutate combat data")
    IUB.PercentilesEnabled := false,IIFSyncMenus()
    for parent in [u.SettingsMenu,extra]
        V48Assert(!(V652TimerMenuState(parent,"Enable percentiles")&8) && !(V652TimerMenuState(parent.IrisPercentileOptions,"Enabled")&8),"parent and child reflect a disabled master")
    V48Assert(IQPHToggleHints() && IQPHHintsEnabled() && !IQTEnabled(),"the saved hover preference can change without enabling grades")
    for parent in [u.SettingsMenu,extra]
        V48Assert(V652TimerMenuState(parent.IrisPercentileOptions,"Show hover explanations")&8,"the independent checked hover preference is synchronized while grading is off")
}

IQPH101TooltipToggle() => V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(IQPH101TooltipToggleCase)))
IQPH101TooltipToggleCase()
{
    global IP,IUB
    IQPHClearAll(),f := IQPH181Ready(),lv := IP.PlayersLV,key := f.Keys[1]
    IUB.CompactDamage := true,V7428RaidRedraw(),row := V7428RaidRow(key)
    IP.Gui.Show("NA w1600 h820"),Sleep(-1)
    try {
        point := IQPH181Cell(lv,row,13),screen := IQPH181ScreenPoint(lv,point)
        expected := IQPHRaidAt(lv,point.X,point.Y),rank := IQTState().Rows[key].Percentile
        IQPH181ShowAt(lv.Hwnd,screen),state := IRCHoverState()
        V48Assert(state.Kind="percentile" && state.Text=expected && IQPH181VisibleTips()>0,"an actual visible tooltip is marked as a percentile explanation")
        IQPHToggleHints()
        V48Assert(state.Text="" && state.Hwnd=0 && IQPH181VisibleTips()=0,"turning explanations off immediately removes the actual visible tooltip")
        V48Assert(IQPHRaidAt(lv,point.X,point.Y)="" && IQTState().Rows[key].Percentile=rank,"the cached grade remains visible but supplies no explanation")
        IQPHToggleHints(),IQPH181ShowAt(lv.Hwnd,screen)
        V48Assert(state.Text=expected && state.Kind="percentile" && IQPH181VisibleTips()>0,"turning explanations back on restores a loaded-log tooltip without redrawing or restarting")
        damage := IQPH181ScreenPoint(lv,IQPH181Cell(lv,row,2))
        IQPH181ShowAt(lv.Hwnd,damage),exact := state.Text
        V48Assert(state.Kind="exact" && InStr(exact,"Damage:") && IQPH181VisibleTips()>0,"the existing Compact damage exact-total tooltip still works")
        IQPHToggleHints()
        V48Assert(state.Kind="exact" && state.Text=exact && IQPH181VisibleTips()>0,"turning explanations off preserves an already-visible non-percentile tooltip")
        IQPH181ShowAt(lv.Hwnd,damage)
        V48Assert(state.Text=exact,"non-percentile hovering continues while explanations are disabled")
    }
    finally {
        IRCHide(),SetTimer(IRCHoverPoll,0),IQPHClearAll(),IP.Gui.Hide()
    }
}

IQPH101OverlayToggle() => V652TimerOverlayIsolated(IQPH101OverlayToggleCase)
IQPH101OverlayToggleCase(path)
{
    global IUB
    IQPHClearAll(),g := Gui("+AlwaysOnTop -Caption +ToolWindow +E0x08000020"),value := g.AddText("x10 y10 w120 h24","90")
    first := IQPHText("DPS",90,"Pyrotech","Nefra","First"),second := IQPHText("EHPS",75,"Corruption","Tyth","Second")
    try {
        g.Show("NA x140 y140 w180 h60"),point := IQPH181Point(value)
        IQPHBind(value,first)
        V48Assert(IQPHOverlayActive() && IQPHOverlayAt(point.X,point.Y).Text=first,"a real native value has a valid captured explanation")
        IQPHToggleHints()
        V48Assert(!IQPHOverlayActive() && !IsObject(IQPHOverlayAt(point.X,point.Y)) && IQPHOverlayState().Controls.Count=1,"turning explanations off suppresses lookup without discarding captured metadata")
        value.Text := "75",IQPHBind(value,second)
        V48Assert(!IsObject(IQPHOverlayAt(point.X,point.Y)),"a value updated while explanations are off cannot show a hint")
        IQPHToggleHints()
        V48Assert(IQPHOverlayActive() && IQPHOverlayAt(point.X,point.Y).Text=second,"reenabling uses the latest captured metric and actor without rerendering")
    }
    finally g.Destroy(),IQPHClearAll(),SetTimer(IRCHoverPoll,0)
}

; Real native message probes on private fixture windows. No timers or user data.
IAF187EmptyRefresh() => V58Isolated(IAF187EmptyCase)
IAF187FilteredRefresh() => V58Isolated(IAF187FilteredCase)
IAF187State()
{
    static s := {Writes:0}
    return s
}
IAF187Messages(hwnd,msg,wp,lp,id,ref)
{
    prior := Critical(-1)
    try {
        if msg=0xC || msg=0x143 || msg=0x14B || msg=0x1009
            IAF187State().Writes += 1
        return DllCall("Comctl32\DefSubclassProc","Ptr",hwnd,"UInt",msg,"UPtr",wp,"Ptr",lp,"Ptr")
    }
    finally Critical(prior)
}
IAF187Watch()
{
    global IP
    u := IPWState(),windows := [],callback := CallbackCreate(IAF187Messages,"Fast",6)
    try {
        for c in [u.Controls["PlayerChoice"],IP.OtherChoice,u.StatRows[1].Total,u.Controls["RaidLabel"],IP.PlayersLV,IP.Footer] {
            hwnd := c.Hwnd
            V48Assert(DllCall("Comctl32\SetWindowSubclass","Ptr",hwnd,"Ptr",callback,"UPtr",18701,"UPtr",0,"Int"),"private mutation probe attaches")
            windows.Push(hwnd)
        }
        IAF187State().Writes := 0
        Loop 4
            IPRefresh()
        return IAF187State().Writes
    }
    finally {
        for hwnd in windows
            DllCall("Comctl32\RemoveWindowSubclass","Ptr",hwnd,"Ptr",callback,"UPtr",18701,"Int")
        CallbackFree(callback)
    }
}
IAF187EmptyCase()
{
    global IP
    V58UseFixture(),u := IPWState(),IP.Live := "",IPRefresh()
    V48Assert(!IP.PlayersLV.GetCount() && !IP.SegmentsLV.GetCount(),"leaving a populated source clears real rows")
    writes := IAF187Watch()
    V48Assert(writes=0,"unchanged empty refresh does not rewrite labels, reset placeholder menus or delete empty rows; writes=" writes)
    V48Assert(u.Controls["PlayerChoice"].Text="No player yet" && IP.OtherChoice.Text="All sources and targets","placeholder values remain correct")
    IP.Live := V58Seed(),IP.Selected := 1,IPRefresh()
    V48Assert(IP.SegmentsLV.GetCount()=1 && u.Controls["PlayerChoice"].Text!="No player yet","a later recording repopulates the same controls")
    IP.Live := "",IPRefresh()
    V48Assert(!IP.SegmentsLV.GetCount() && u.StatRows[1].Total.Text="--","the next real transition still clears rows and totals")
}
IAF187FilteredCase()
{
    global IP
    V58UseFixture(),u := IPWState(),data := IP.Live,u.HideTrash := true,IPRefresh()
    V48Assert(IPWFightIndices(data,true).Length=0 && !IPSelectedSegment(),"fixture is fully filtered while source data stays loaded")
    writes := IAF187Watch()
    V48Assert(writes=0,"unchanged fully filtered refresh does not mutate empty result controls; writes=" writes)
    V48Assert(IP.Live=data && data.Segments.Length=1 && u.HideTrash,"empty rendering preserves its source and selected filter")
    u.HideTrash := false,IPRefresh()
    V48Assert(IP.SegmentsLV.GetCount()=1 && IsObject(IPSelectedSegment()),"removing the filter restores the original fight")
}

; Keybind regressions use pure models, temporary INIs and a fake registration
; adapter. They never register physical keys, send input, play audio or start Iris.
V210KeybindSameMap(a,b)
{
    if !(a is Map) || !(b is Map) || a.Count!=b.Count
        return false
    for key,value in a {
        if !b.Has(key) || !(String(value)==String(b[key]))
            return false
    }
    return true
}

V210KeybindDefaults()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"keybind diagnostics require the suspended isolated child")
    defaults := IKBDefaults(),seen := Map(),reason := ""
    V48Assert(IKBValidate(defaults,&reason),"existing shortcut defaults form a valid complete configuration: " reason)
    for def in IKBDefinitions() {
        V48Assert(!seen.Has(def.Id),"each action has a unique persistent identity: " def.Id)
        seen[def.Id] := true
        V48Assert(defaults.Has(def.Id),"every available action receives a default: " def.Id)
        V48Assert(def.Scope!="" && def.Description!="","scope and behavior remain visible for: " def.Id)
    }
    V48Assert(seen.Count=defaults.Count,"defaults contain only known available actions")
    V48Assert(!defaults.Has("bossPrevious") && !defaults.Has("bossNext"),"retired profile-cycling actions have no default bindings")
    for id,key in defaults
        V48Assert(key!="F8" && key!="F9","fresh defaults leave the former cycling keys available: " id)
    for id,key in Map("workspace","F10","voice","F11")
        V48Assert(defaults[id]=key,"an existing user's shortcut is preserved: " id)
    for n in [1,2,3,4,5,6,7,8,9]
        V48Assert(defaults["bossSlot" n]="Numpad" n,"manual slot default preserved: " n)
    fresh := IKBDefaults(),defaults["workspace"] := ""
    V48Assert(fresh["workspace"]="F10","a settings draft cannot mutate future default configurations")
    for context in ["game","workspace","pull","bookmark"]
        V48Assert(!IKBContext(context).Call(""),"diagnostics never activate a physical shortcut scope: " context)
    for context,callback in IKBExtensions().Contexts
        V48Assert(!callback.Call(""),"diagnostics never activate an available extension scope: " context)
    guarded := false
    try IKBNative(IKBPlan(fresh)[1],true)
    catch Error
        guarded := true
    V48Assert(guarded,"native registration explicitly refuses a diagnostic caller before touching Windows hotkeys")
}

V210KeybindValidation()
{
    reason := "sentinel"
    V48Assert(IKBNormalize("!^f3",&reason)="^!F3" && reason="","modifier order and key case normalize before duplicate checks")
    V48Assert(IKBNormalize("",&reason)="" && reason="","empty means explicitly unbound, not invalid")
    V48Assert(IKBNormalize("not a real key",&reason)="" && reason!="","unsupported keys produce a useful rejection")
    V48Assert(IKBNormalize("NumpadHome",&reason)="NumpadHome" && reason="","Num Lock-off numpad names retain their physical keypad identity")
    defaults := IKBDefaults(),draft := defaults.Clone()
    draft["workspace"] := "",draft["voice"] := ""
    V48Assert(IKBValidate(draft,&reason),"retained workspace and voice shortcuts may both be cleared")
    draft := defaults.Clone(),draft["workspace"] := "F11"
    V48Assert(!IKBValidate(draft,&reason) && reason!="","two actions cannot silently capture the same shortcut")
    V48Assert(defaults["workspace"]="F10" && defaults["voice"]="F11","rejection leaves the source model unchanged")
    draft := defaults.Clone(),draft["workspace"] := "!^F7",draft["voice"] := "^!f7"
    V48Assert(!IKBValidate(draft,&reason),"equivalent modifier orders cannot evade duplicate detection")
    for key in ["Enter","NumpadEnter","Esc","Numpad0","NumpadIns","^o","^r"] {
        draft := defaults.Clone(),draft["workspace"] := key
        V48Assert(!IKBValidate(draft,&reason) && reason!="","fixed observation or app commands cannot be stolen: " key)
    }
    draft := defaults.Clone(),draft.Delete("workspace")
    V48Assert(!IKBValidate(draft,&reason),"partial snapshots cannot reset unrelated keys by accident")
    draft := defaults.Clone(),draft["unrecognized-action"] := "F23"
    V48Assert(!IKBValidate(draft,&reason),"unknown actions cannot create unreviewed key handlers")
    draft := defaults.Clone(),draft["workspace"] := "F11",draft["voice"] := "F10"
    V48Assert(IKBValidate(draft,&reason),"a complete two-way swap is valid even though one-at-a-time assignment would conflict")
}

V210KeybindStorage()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"storage fixture cannot run inside normal Iris")
    path := A_Temp "\IrisKeybind210_" DllCall("GetCurrentProcessId") "_" A_TickCount ".ini"
    try {
        defaults := IKBDefaults(),first := IKBRead(path)
        V48Assert(V210KeybindSameMap(first,defaults) && !FileExist(path),"first read migrates defaults without writing a new settings file")
        migrated := defaults.Clone(),migrated["meterToggle"] := "^!F20"
        V48Assert(V210KeybindSameMap(IKBRead(path,migrated),migrated),"a caller-supplied legacy meter choice survives migration into the new page")
        IniWrite("preserved",path,"Unrelated","Sentinel")
        draft := defaults.Clone(),draft["workspace"] := "",draft["voice"] := "^!F21"
        IKBWrite(path,draft)
        loaded := IKBRead(path)
        V48Assert(V210KeybindSameMap(loaded,draft),"custom shortcuts and an explicit unbind survive a restart")
        V48Assert(V210KeybindSameMap(IKBRead(path,migrated),draft),"persisted explicit choices take precedence over a legacy preset fallback")
        V48Assert(IniRead(path,"Unrelated","Sentinel")="preserved","keybind persistence preserves unrelated settings")
        IKBWrite(path,loaded),again := IKBRead(path)
        V48Assert(again["workspace"]="" && again["voice"]="^!F21","a second restart never restores a deliberately cleared workspace shortcut")
        before := FileRead(path),bad := draft.Clone(),bad["workspace"] := bad["voice"],rejected := false
        try IKBWrite(path,bad)
        catch Error
            rejected := true
        V48Assert(rejected && FileRead(path)==before,"invalid shortcuts cannot partially overwrite an existing persisted configuration")
        IniWrite("not a valid bindings snapshot",path,"IrisKeybinds","Bindings")
        V48Assert(V210KeybindSameMap(IKBRead(path),defaults),"a malformed persisted snapshot falls back as a whole")
        IniWrite("workspace=F12",path,"IrisKeybinds","Bindings")
        V48Assert(V210KeybindSameMap(IKBRead(path),defaults),"a truncated but syntactically valid snapshot cannot partially replace default keys")
        IniWrite("v1:" defaults.Count "|workspace=F12",path,"IrisKeybinds","Bindings")
        V48Assert(V210KeybindSameMap(IKBRead(path),defaults),"a v1 header count detects a truncated snapshot before applying any shortcut")
        V48Assert(IniRead(path,"Unrelated","Sentinel")="preserved","corruption recovery preserves unrelated INI data")
        V213KeybindRetirementStorage(path)
    }
    finally {
        if FileExist(path)
            FileDelete(path)
    }
}

V213KeybindRetirementStorage(path)
{
    ; Simulate upgrading a complete old snapshot, including optional preferences
    ; that are unavailable in this public-shaped registry. No real INI is read.
    e := IKBExtensions(),oldRows := e.Rows,oldContexts := e.Contexts,oldCallbacks := e.Callbacks
    try {
        e.Rows := [],e.Contexts := Map(),e.Callbacks := Map()
        for retired in [["F8","F9"],["^!F18","^!F19"]] {
            legacy := IKBDefaults(),legacy["workspace"] := "^!F20",legacy["voice"] := ""
            legacy["meterToggle"] := "^!F21",legacy["bossPrevious"] := retired[1],legacy["bossNext"] := retired[2]
            legacy["unavailableFixture"] := "^!F22",packed := ""
            for id,key in legacy
                packed .= (packed="" ? "" : "|") id "=" key
            IniWrite("v1:" legacy.Count "|" packed,path,"IrisKeybinds","Bindings")
            before := FileRead(path),loaded := IKBRead(path)
            V48Assert(loaded.Count=17 && !loaded.Has("bossPrevious") && !loaded.Has("bossNext"),
                "old complete snapshots discard retired cycling actions instead of resetting all shortcuts")
            V48Assert(loaded["workspace"]="^!F20" && loaded["voice"]="" && loaded["meterToggle"]="^!F21",
                "surviving custom bindings and explicit unbinds survive cycling retirement")
            V48Assert(FileRead(path)==before,"reading legacy shortcuts does not rewrite the settings file")
            for entry in IKBPlan(loaded)
                V48Assert(entry.Id!="bossPrevious" && entry.Id!="bossNext" && entry.Key!=retired[1] && entry.Key!=retired[2],
                    "neither former default nor customized cycling shortcuts enter the registration plan")
            IKBWrite(path,loaded),saved := IniRead(path,"IrisKeybinds","Bindings")
            V48Assert(!InStr(saved,"bossPrevious=") && !InStr(saved,"bossNext="),
                "saving surviving choices does not preserve retired actions as unavailable extensions")
            V48Assert(InStr(saved,"unavailableFixture=^!F22"),"saving public choices still preserves unavailable optional preferences")
            V48Assert(V210KeybindSameMap(IKBRead(path),loaded),"cleaned shortcut snapshots survive another restart")
            V48Assert(IniRead(path,"Unrelated","Sentinel")="preserved","retirement migration keeps unrelated INI data")
            freed := loaded.Clone(),freed["workspace"] := "F8",freed["voice"] := "F9",reason := ""
            V48Assert(IKBValidate(freed,&reason),"former cycling keys remain available for explicitly chosen surviving actions: " reason)
            observed := Map()
            for entry in IKBPlan(freed)
                observed[entry.Id] := entry.Key
            V48Assert(observed["workspace"]="F8" && observed["voice"]="F9",
                "explicit reassignment of freed F8/F9 registers the selected actions rather than boss cycling")
        }
    }
    finally e.Rows := oldRows,e.Contexts := oldContexts,e.Callbacks := oldCallbacks
}

V210KeybindExtensions()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"extension checks require the isolated suspended child")
    e := IKBExtensions(),beforeRows := e.Rows,beforeContexts := e.Contexts,beforeCallbacks := e.Callbacks
    path := A_Temp "\IrisKeybind210Extensions_" DllCall("GetCurrentProcessId") "_" A_TickCount ".ini"
    try {
        e.Rows := [],e.Contexts := Map(),e.Callbacks := Map(),base := IKBDefaults()
        V48Assert(base.Count=17,"public registry contains only its seventeen shared actions")
        V210KeybindFixtureExtension(),extended := IKBDefaults()
        V48Assert(extended.Count=base.Count+1 && extended.Has("optionalFixture"),"a synthetic extension contributes its own action")
        V48Assert(!IKBContext("fixture").Call(""),"an optional scope refuses diagnostic activation")
        extended["workspace"] := "",extended["optionalFixture"] := "^!F21",IKBWrite(path,extended)
        e.Rows := [],e.Contexts := Map(),e.Callbacks := Map(),public := IKBRead(path,base)
        V48Assert(public.Count=base.Count && !public.Has("optionalFixture") && public["workspace"]="",
            "public reads retain shared choices while omitting unavailable actions")
        IKBWrite(path,public),V210KeybindFixtureExtension(),reopened := IKBRead(path)
        V48Assert(reopened["workspace"]="" && reopened["optionalFixture"]="^!F21",
            "editing public shortcuts preserves unavailable action preferences")
    }
    finally {
        e.Rows := beforeRows,e.Contexts := beforeContexts,e.Callbacks := beforeCallbacks
        if FileExist(path)
            FileDelete(path)
    }
}

class V210KeybindAdapter
{
    __New(plan)
    {
        this.Active := Map(),this.Calls := [],this.FailId := "",this.Failed := false
        for entry in plan
            this.Active[this.Identity(entry)] := entry.Id
    }
    Identity(entry) => entry.Context "|" entry.Key
    Call(entry,on)
    {
        this.Calls.Push({Id:entry.Id,On:on,Key:entry.Key,Context:entry.Context})
        identity := this.Identity(entry)
        if on {
            if !this.Failed && entry.Id=this.FailId {
                this.Failed := true
                throw Error("Injected registration failure for " entry.Id)
            }
            if this.Active.Has(identity) && this.Active[identity]!=entry.Id
                throw Error("Existing handler would collide with " entry.Id)
            this.Active[identity] := entry.Id
        }
        else if this.Active.Has(identity)
            this.Active.Delete(identity)
    }
}

class V210KeybindWriter
{
    __New(path)
    {
        this.Path := path,this.Fail := true,this.Calls := 0,this.Last := ""
    }
    Call(candidate)
    {
        this.Calls += 1,this.Last := candidate.Clone()
        if this.Fail
            throw Error("Injected settings write failure")
        IKBWrite(this.Path,candidate)
    }
}

V210KeybindPlanMap(plan)
{
    out := Map()
    for entry in plan
        out[entry.Context "|" entry.Key] := entry.Id
    return out
}

V210KeybindRegistry()
{
    defaults := IKBDefaults(),old := IKBPlan(defaults),draft := defaults.Clone()
    draft["workspace"] := "F11",draft["voice"] := "F10"
    next := IKBPlan(draft),adapter := V210KeybindAdapter(old),reason := ""
    V48Assert(IKBTransition(old,next,adapter,&reason),"a two-way shortcut swap succeeds as one registration change: " reason)
    V48Assert(V210KeybindSameMap(adapter.Active,V210KeybindPlanMap(next)),"registered handlers exactly match the swapped configuration")
    for n in [1,2,3,4,5,6,7,8,9] {
        found := false
        for entry in next {
            if entry.Id="bossSlot" n
                found := entry.PassThrough
        }
        V48Assert(found,"rebindable manual slots retain pass-through behavior: " n)
    }
    firstOn := 0
    for n,call in adapter.Calls {
        if call.On {
            firstOn := n
            break
        }
    }
    V48Assert(firstOn=old.Length+1,"all old registrations are disabled before the first replacement is enabled")
    draft["workspace"] := "",draft["voice"] := "",unbound := IKBPlan(draft)
    V48Assert(IKBTransition(next,unbound,adapter,&reason),"clearing retained actions succeeds without replacing them")
    V48Assert(V210KeybindSameMap(adapter.Active,V210KeybindPlanMap(unbound)),"cleared workspace and voice keys leave no orphan registrations")
    for entry in unbound
        V48Assert(entry.Key!="" && entry.Id!="workspace" && entry.Id!="voice","unbound actions never enter the registration plan")
}

V210KeybindRollback()
{
    defaults := IKBDefaults(),old := IKBPlan(defaults),draft := defaults.Clone(),reason := ""
    draft["workspace"] := "^!F20",draft["voice"] := "^!F21"
    next := IKBPlan(draft),adapter := V210KeybindAdapter(old),adapter.FailId := "voice"
    V48Assert(!IKBTransition(old,next,adapter,&reason) && reason!="","a Windows registration failure is surfaced instead of reporting success")
    V48Assert(adapter.Failed,"fixture reached the intended mid-transition native failure")
    V48Assert(V210KeybindSameMap(adapter.Active,V210KeybindPlanMap(old)),"mid-transition failure removes new handlers and restores every previous shortcut")
    V48Assert(defaults["workspace"]="F10" && defaults["voice"]="F11","failed native installation leaves the previous settings model intact")
    V48Assert(IKBTransition(old,next,adapter,&reason),"registration can be retried successfully after the transient failure")
    V48Assert(V210KeybindSameMap(adapter.Active,V210KeybindPlanMap(next)),"retry does not leave a mix of old and new shortcuts")
    path := A_Temp "\IrisKeybind210Commit_" DllCall("GetCurrentProcessId") "_" A_TickCount ".ini"
    try {
        IKBWrite(path,defaults),before := FileRead(path),writer := V210KeybindWriter(path),adapter := V210KeybindAdapter(old)
        V48Assert(!IKBCommit(old,next,draft,adapter,writer,&reason) && reason!="","failed persistence cannot leave a newly registered configuration reported as saved")
        V48Assert(writer.Calls=1 && V210KeybindSameMap(writer.Last,draft),"failure fixture reaches the save step after registration")
        V48Assert(V210KeybindSameMap(adapter.Active,V210KeybindPlanMap(old)) && FileRead(path)==before,
            "a save failure restores previous registrations and preserves the previous INI bytes")
        writer.Fail := false
        V48Assert(IKBCommit(old,next,draft,adapter,writer,&reason),"the complete change can be retried after persistence recovers")
        V48Assert(V210KeybindSameMap(adapter.Active,V210KeybindPlanMap(next)) && V210KeybindSameMap(IKBRead(path),draft),
            "successful retry keeps registered and persisted shortcut configurations aligned")
    }
    finally {
        if FileExist(path)
            FileDelete(path)
    }
}

V210KeybindUI()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"keybind UI checks require the isolated suspended child")
    ui := IKBUIState(),beforeUI := ui.Clone(),before := Map(),owned := !IPMGuiAlive(ui.Gui)
    for d in IKBDefinitions()
        before[d.Id] := IKBGet(d.Id)
    try {
        s := IKBOpenPage()
        V48Assert(IPMGuiAlive(s.Gui) && !DllCall("IsWindowVisible","Ptr",s.Gui.Hwnd),"opening keybinds in diagnostics builds an owned hidden window")
        V48Assert(s.Rows.Has("workspace") && s.Rows.Has("voice"),"the retained workspace and voice actions are available on the page")
        V48Assert(!s.Rows.Has("bossPrevious") && !s.Rows.Has("bossNext"),"retired cycling actions are not presented as editable shortcuts")
        V48Assert(IKBUISelect("workspace"),"the workspace shortcut can be selected for editing")
        IKBUIClear()
        V48Assert(IKBUIDraftKey()="" && IKBGet("workspace")=before["workspace"],"Clear edits the draft without silently changing active shortcuts")
        IKBUITakeDefault()
        V48Assert(IKBUIDraftKey()=s.Rows["workspace"].Default,"Restore default prepares an editable draft")
        IKBUISetDraft("#^!F7"),reason := ""
        V48Assert(IKBNormalize(IKBUIDraftKey(),&reason)="^!#F7" && reason="","native editor and Windows checkbox preserve modifier combinations")
        IKBUISelect("voice"),IKBUISelect("workspace")
        V48Assert(IKBUIDraftKey()=before["workspace"],"leaving an unsaved draft returns to the saved shortcut")
        IKBUIClear(),IKBUIClose()
        V48Assert(!DllCall("IsWindowVisible","Ptr",s.Gui.Hwnd),"Done hides the keybind editor")
        for id,key in before
            V48Assert(IKBGet(id)=key,"opening, drafting and closing never commits an action: " id)
    }
    finally {
        if owned && IPMGuiAlive(ui.Gui)
            ui.Gui.Destroy()
        if owned {
            keys := []
            for key in ui.OwnProps()
                keys.Push(key)
            for key in keys
                if !beforeUI.HasOwnProp(key)
                    ui.DeleteProp(key)
            for key,value in beforeUI.OwnProps()
                ui.%key% := value
        }
    }
    V601Isolated(V7412PlayerIconFixture.Bind(V58Isolated.Bind(V210KeybindMenuCase)))
}

V210KeybindMenuCase()
{
    global IP
    V58UseFixture()
    V48Assert(IPMGuiAlive(IP.Gui) && !DllCall("IsWindowVisible","Ptr",IP.Gui.Hwnd),"workspace menu accessibility is checked on an owned hidden fixture")
    V48Assert(V779MenuHas(IPWState().SettingsMenu,"Keybinds..."),"the workspace exposes Settings > Keybinds directly")
}

V210KeybindFixtureContext(*) => false
V210KeybindFixtureAction(*) => false
V210KeybindFixtureExtension()
{
    e := IKBExtensions()
    e.Rows := [{Id:"optionalFixture",Name:"Optional fixture",Label:"Optional fixture",Group:"Optional fixture",
        Default:"^!F22",Context:"fixture",Scope:"Fixture only",PassThrough:false,Description:"Synthetic extension"}]
    e.Contexts := Map("fixture",V210KeybindFixtureContext),e.Callbacks := Map("optionalFixture",V210KeybindFixtureAction)
}


V104KeybindPublic()
{
    global SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"public checks require the isolated suspended child")
    extensions := IKBExtensions()
    V48Assert(!extensions.Rows.Length && !extensions.Contexts.Count && !extensions.Callbacks.Count,
        "a fresh public registry has no optional helper actions or handlers")
    allowed := Map("General",true,"Boss callouts",true,"Overlays",true,"Performance",true,"Raid tools",true)
    definitions := IKBUIOrderedDefinitions()
    V48Assert(definitions.Length=17,"public page contains only seventeen shared shortcuts")
    for d in definitions
        V48Assert(allowed.Has(d.Group),"public page exposes only public categories: " d.Id)
    for n,id in ["workspace","meterToggle","meterCycle","voice","pull","bookmark","bossSlot1","bossSlot2"]
        V48Assert(definitions[n].Id=id,"everyday shortcut display ordering is preserved: " id)
    s := IKBState(),before := s.Keys.Clone(),ready := s.Ready,plan := s.Plan
    V48Assert(!IKBStartup(),"diagnostic startup refuses native shortcut registration")
    V48Assert(V210KeybindSameMap(before,s.Keys) && s.Ready=ready && s.Plan==plan,
        "blocked diagnostic startup leaves registry state unchanged")
}

; Coverage decisions from the Codex wipe and shielded Nahut opening recordings.
IC214Codex(n) => "Codex {4105254295568384}:" n "|(0,0,0,0)|(999/1000)"
IC214CodexState(count := 8)
{
    s := V7813AEFixture()
    Loop count-1
        V7717Feed(s,1100+A_Index,"Damage",10,V7717Player(1),IC214Codex(A_Index+1))
    return s
}

IC214CodexResets() => V75LibraryRun(IC214CodexResetsCase)
IC214CodexResetsCase()
{
    s := IC214CodexState(),prior := s.Current
    Loop 8
        V7717Feed(s,2000+A_Index,"Death",0,"",V7717Player(A_Index,0))
    V7717Respawn(s,2300)
    V7717Feed(s,10000,"Enter",0,V7717Player(1),"=")
    V7717Feed(s,10020,"Damage",10,V7717Player(1),IC214Codex(99))
    V48Assert(s.Segments.Length=2 && s.Current!=prior && s.Current.Start=10000,"Codex-only wipe gets a new pull at its recorded entry")
    V48Assert(!prior.Partial && !s.Current.Partial && !IsObject(s.Reentry),"eight observed old Codices prove a reset without making either pull incomplete")
    V48Assert(prior.Totals[IPActor(V7717Player(1)).Key].Deaths=1,"reset retains the recorder death")
    for count in [1,7] {
        s := IC214CodexState(count),prior := s.Current
        ev := IPParseLine(IPDemoLine(10000,V7717Player(1),IC214Codex(99),"Damage",10))
        V48Assert(!IPBAECodexReset(prior,ev),"fewer than eight Codices cannot prove a replacement cohort")
    }
    s := IC214CodexState(),prior := s.Current
    ev := IPParseLine(IPDemoLine(10000,V7717Player(1),IC214Codex(99),"Damage",10))
    for variant in ["known","immune","absorbed","invalid","zero","wrong-mode","wrong-area"] {
        copy := ev.Clone(),seg := prior.Clone()
        switch variant {
            case "known": copy.Target := IPActor(IC214Codex(1))
            case "immune": copy.Immune := true
            case "absorbed": copy.FullAbsorb := true
            case "invalid": copy.ValueOK := false
            case "zero": copy.Amount := 0
            case "wrong-mode": seg.ModeId := "836045448953652"
            case "wrong-area": seg.AreaId := "elsewhere"
        }
        V48Assert(!IPBAECodexReset(seg,copy),"reject unsupported Codex reset: " variant)
    }
}

IC214Nahut() => "NAHUT {4122949560827904}:214|(0,0,0,0)|(10000/10000)"
IC214Shield(at,kind := "Damage",target := "")
{
    target := target="" ? IC214Nahut() : target
    return "[" IPStamp(at) "] [" V7717Player(1) "] [" target "] [Hit {1}] [ApplyEffect {836045448945477}: " kind " {836045448945501}] (100 ~0 energy {836045448940874} (100 absorbed {836045448945511}))"
}
IC214TrashState()
{
    s := IPNewData(),p := V7717Player(1)
    IPFeedLine(s,"[00:00:00.100] [" p "] [] [] [AreaEntered {836045448953664}: Gods {833571547775765} Master {836045448953655}]")
    V7717Feed(s,1000,"Enter",0,p,"=")
    V7717Feed(s,1010,"Damage",10,p,"Trash {4118122017587200}:1|(0,0,0,0)|(900/1000)")
    V7717Feed(s,2000,"Exit",0,p,"=")
    V7717Other(s,6000,p,"=","123")
    ; Lingering trash damage may omit its source entirely, as in the recording.
    V7717Feed(s,15000,"Damage",10,"",V7717Player(2))
    V7717Feed(s,30000,"Enter",0,p,"=")
    return s
}

IC214NahutOpeners() => V75LibraryRun(IC214NahutOpenersCase)
IC214NahutOpenersCase()
{
    s := IC214TrashState(),prior := s.Current,before := s.Segments.Length
    V48Assert(IsObject(s.Reentry) && prior.Enemies.Count=0 && prior.DamageEvents>0,"new entry holds lingering source-less trash damage until evidence arrives")
    IPFeedLine(s,IC214Shield(41000))
    V48Assert(s.Segments.Length=before+1 && s.Current.Start=30000 && s.Current.BossKey="G-NA","shielded opener resolves Nahut at the original entry before timeout")
    V48Assert(!s.Current.Partial && !IsObject(s.Reentry),"first Nahut does not inherit uncertain trash coverage")
    kill := s.Current
    V7717Feed(s,60000,"Death",0,V7717Player(1),StrReplace(IC214Nahut(),"10000/10000","0/10000"))
    V7717Feed(s,60001,"Exit",0,V7717Player(1),"=")
    IPFinalizeData(s,"fixture complete")
    V48Assert(IPRecordedKill(kill) && !ILBFight(kill).Partial,"confirmed shielded Nahut remains complete in Library")
    for variant in ["target-only","injured","missing-hp","zero","immune","wrong-mode","wrong-area"] {
        s := IC214TrashState(),ev := IPParseLine(IC214Shield(41000))
        switch variant {
            case "target-only": ev.Kind := "Other"
            case "injured": ev.TargetHP.Current := 9900
            case "missing-hp": ev.TargetHP.Known := false
            case "zero": ev.Amount := 0
            case "immune": ev.Immune := true
            case "wrong-mode": s.Current.ModeId := "836045448953652"
            case "wrong-area": s.Current.AreaId := "elsewhere"
        }
        V48Assert(IPBReentryEvidence(s.Current,ev,41000)=0,"reject unsupported shielded opener: " variant)
    }
}

ITL215Sides()
{
    for side,ids in Map("L",["2938891501830144","3025258999185408","3025263294152704","3025267589120000"],
        "R",["2938895796797440","3025271884087296","3025276179054592","3025280474021888"]) {
        for id in ids {
            actor := IPActor("Localized name {" id "}:1"),hp := {Known:false}
            ITLAnnotate(hp,actor,"")
            V48Assert(hp.TentacleSide=side && ITLHealthLabel({Id:id,Name:actor.Name})=side ". Tentacle","surface tentacle side is fixed by NPC ID for every known mode/size")
        }
    }
    for row in [["336.88,805.34,-202.59,120","L"],["380.10,802.93,-204.76,-114.03","R"],
        ["334.35,764.53,-205.69,68.88","L"],["380.01,763.63,-202.73,-58.95","R"],
        ["0,0,0,0",""],["358,784,-204,0",""],["336,805,0,0",""],["336,850,-204,0",""]] {
        actor := IPActor("Grasping Tentacle {3025284768989184}:2"),hp := {Known:false}
        ITLAnnotate(hp,actor,"Grasping Tentacle {3025284768989184}:2|(" row[1] ")|(1000/1000)")
        V48Assert((hp.HasOwnProp("TentacleSide") ? hp.TentacleSide : "")=row[2],"inside tentacle uses bounded recorded platform positions: " row[1])
    }
    for token in ["@Grasping Tentacle#1","Fake Tentacle {9999999999999999}:1"] {
        hp := {},ITLAnnotate(hp,IPActor(token),token "|(336.88,805.34,-202.59,120)|(1000/1000)")
        V48Assert(!hp.HasOwnProp("TentacleSide"),"names and players never acquire a tentacle side")
    }
    V48Assert(ITLHealthLabel({Id:"3025284768989184",Name:"Grasping Tentacle"})="Grasping Tentacle","unavailable position keeps original name")
    h := {Name:"Data Core",Known:true,Current:1000,Maximum:1000,Percent:100,Stale:false,CoreSide:"N"}
    V48Assert(IRHealthText(h).Name="N. Core","Operator IX core labels remain unchanged")
}

ITL215Fixture()
{
    s := IPNewData("SYNTHETIC left/right tentacles"),s.AreaId := "137438992720",s.ModeId := "836045448953655"
    p := "@Tentacle Tester#215|(0,0,0,0)|(1000/1000)"
    IPFeedLine(s,IPDemoLine(1000,p,"=","Enter"))
    for row in [[1100,"Tunneling Tentacle {3025258999185408}:11|(290.51,778.35,0.30,0)|(900/1000)"],
        [1200,"Tunneling Tentacle {3025271884087296}:12|(287.97,799.82,0.15,0)|(900/1000)"],
        [1300,"Grasping Tentacle {3025284768989184}:21|(336.88,805.34,-202.59,120)|(900/1000)"],
        [1400,"Grasping Tentacle {3025284768989184}:22|(380.10,802.93,-204.76,-114.03)|(900/1000)"],
        [1500,"Grasping Tentacle {3025284768989184}:23|(0,0,0,0)|(900/1000)"]]
        IPFeedLine(s,IPDemoLine(row[1],p,row[2],"Damage",10))
    return s
}

ITL215Choices() => V7880BossHPIsolated(ITL215ChoicesCase)
ITL215ChoicesCase()
{
    s := ITL215Fixture(),seg := s.Current,before := V596Signature(s)
    choices := IRBTChoices(seg),names := Map(),health := Map()
    for i,key in choices.Keys
        names[key] := choices.Labels[i]
    for key,h in seg.Raid.Health
        health[h.Instance] := IRHealthText({Id:h.Id,Name:h.Name,TentacleSide:h.HasOwnProp("TentacleSide") ? h.TentacleSide : "",Known:true,Current:900,Maximum:1000,Percent:90,Stale:false})
    V48Assert(InStr(names["N:3025258999185408:11:Tunneling Tentacle"],"L. Tentacle")=1 && InStr(names["N:3025271884087296:12:Tunneling Tentacle"],"R. Tentacle")=1,"Raid target selector identifies both surface sides")
    V48Assert(health["21"].Name="L. Tentacle" && health["22"].Name="R. Tentacle","Boss HP uses inside position metadata")
    V48Assert(InStr(names["N:3025284768989184:21:Grasping Tentacle"],"L. Tentacle")=1 && InStr(names["N:3025284768989184:22:Grasping Tentacle"],"R. Tentacle")=1,"Raid target selector uses the same inside sides")
    V48Assert(health["23"].Name="Grasping Tentacle","unmapped inside position remains generic")
    V48Assert(choices.Keys.Length=7 && seg.Actors["N:3025258999185408:11:Tunneling Tentacle"].Name="Tunneling Tentacle","target identities and raw names are preserved")
    wrong := seg.Clone(),wrong.BossKey := "G-AE"
    V48Assert(ITLActorLabel(wrong,seg.Actors["N:3025258999185408:11:Tunneling Tentacle"])="Tunneling Tentacle","a different recorded boss does not acquire Terror target labels")
    variant := seg.Clone(),variant.BossKey := "TFB-TF-SM"
    V48Assert(ITLActorLabel(variant,seg.Actors["N:3025258999185408:11:Tunneling Tentacle"])="L. Tentacle","supported encounter variants retain the same side labels")
    V48Assert(IRBTDamage(seg,seg,"bosses")["@Tentacle Tester#215"]=50 && V596Signature(s)=before,"labels do not change counted boss damage or accepted records")
    ev := IPParseLine(IPDemoLine(1600,"Grasping Tentacle {3025284768989184}:21|(0,0,0,0)|(800/1000)","@Tentacle Tester#215","Damage",10))
    IPBFeedEvent(s,ev,1600)
    V48Assert(seg.Raid.Health[ev.Source.Key].TentacleSide="L","later missing/unknown coordinates keep the established instance side")
}

IPP216Point(metric := "DPS",patch := "live")
{
    p := V75LibraryPull(1,1000),p.Boss := "DF-NE",p.Name := "Nefra",p.Area := "137438993402"
    spec := metric="EHPS" ? "2031339142381587" : "2031339142381602",p.Players[p.Recorder].Spec := spec
    date := patch="live" ? "2026-11-15" : patch="7.7.1" ? "2025-08-20" : "2024-08-20"
    ref := IQAReferences(metric,"MM",8,patch).Rows[p.Boss "|" spec],amount := ref.Curve[51]*60
    player := p.Players[p.Recorder],player.Damage := amount,player.Heal := amount,player.Effective := amount
    f := {Path:A_Temp "\combat_" date "_01_00_00_001.txt",Date:StrReplace(date,"-",""),Pulls:[p]}
    e := ILBEntry(f,p)
    return {Entry:e,At:e.At,Value:amount/60,Amount:amount,Seconds:60,Character:player.Name,Key:p.Recorder,PBEligible:true,PartialWindow:false}
}

IPP216References() => V75LibraryRun(IPP216ReferencesCase)
IPP216ReferencesCase()
{
    global IUB
    IUB.PercentilesEnabled := true
    for metric in ["DPS","EHPS"] {
        for patch in ["7.5.1","7.7.1","live"] {
            p := IPP216Point(metric,patch),before := IGVJson(ILBPack(Map("fixture",{Path:p.Entry.Path,Date:p.Entry.Date,Size:0,Modified:"20261115000000",Digest:Format("{:064}",0),Version:"fixture",Pulls:[p.Entry.Pull]})))
            q := ILBPercentileEstimate(p,metric),spec := p.Entry.Pull.Players[p.Key].Spec
            ref := IQAReferences(metric,"MM",8,patch).Rows["DF-NE|" spec]
            V48Assert(q.Rank=IQTEstimate(p.Value,ref) && q.Patch=patch && q.Mode="MM" && q.Size=8 && q.Samples=ref.Count,"Performance matches the exact saved-date " metric " reference for " patch)
            ILBPercentileGrade([p],metric)
            V48Assert(ILBPercentileValue(p)=q.Rank && InStr(ILBPercentileCaption(p),patch="live" ? "Live" : patch),"grade and selected-row caption retain the dataset")
            V48Assert(p.Value*60=p.Amount && p.Entry.Pull.Players[p.Key].Damage=p.Amount,"grading never rewrites the saved rate or total")
        }
    }
    p := IPP216Point(),p.Entry.Pull.Boss := "G-NA",p.Entry.Pull.Area := "833571547775765"
    ref := IQCReferences("live",8,"DPS").Rows["nahut|2031339142381602"],p.Value := ref.Curve[51]
    V48Assert(ILBPercentileEstimate(p,"DPS","nahut:1").Rank=IQTEstimate(p.Value,ref),"a verified exact challenge uses its challenge reference")
    V48Assert(!IsNumber(ILBPercentileEstimate(p,"DPS","phase:burn:1").Rank),"an arbitrary phase never borrows a whole-fight percentile")
}

IPP216Guards() => V75LibraryRun(IPP216GuardsCase)
IPP216GuardsCase()
{
    global IUB
    IUB.PercentilesEnabled := true
    for guard in ["HPS","wipe","partial","partial window","spec","mode","undated","old","chief","unverified phase"] {
        p := IPP216Point(),metric := "DPS",challenge := ""
        switch guard {
            case "HPS": metric := "HPS"
            case "wipe": p.Entry.Pull.Result := "No kill"
            case "partial": p.Entry.Pull.Partial := 1
            case "partial window": p.PartialWindow := true
            case "spec": p.Entry.Pull.Players[p.Key].Spec := "mixed"
            case "mode": p.Entry.Pull.Mode := "unknown"
            case "undated": p.Entry.Path := "undated.txt"
            case "old": p.Entry.Path := "combat_2023-12-04_01_00_00_001.txt"
            case "chief": p.Entry.Pull.Boss := "SNV-OC"
            case "unverified phase": challenge := "nahut:1",p.PBEligible := false
        }
        q := ILBPercentileEstimate(p,metric,challenge)
        V48Assert(!IsNumber(q.Rank) && q.Reason!="","unavailable comparisons stay ungraded: " guard)
    }
    p := IPP216Point(),p.Value := 0,ILBPercentileGrade([p],"DPS")
    V48Assert(IsNumber(ILBPercentileValue(p)) && ILBPercentileValue(p)=0 && IQTLabel(ILBPercentileValue(p))==IUNDecimal("0.00"),"a real zero percentile is not a missing estimate")
    IUB.PercentilesEnabled := false
    V48Assert(ILBPercentileValue(p)="" && ILBPercentileCaption(p)="Percentiles are disabled." && !IsNumber(ILBPercentileEstimate(p,"DPS").Rank),"master preference hides and disables Performance estimates")
    IUB.PercentilesEnabled := true
    points := [IPP216Point(),IPP216Point(),IPP216Point()]
    for i,point in points
        point.Entry.Key := "sort-" i,point.At += i,point.Percentile := {Rank:i=1 ? 10 : i=2 ? 100 : ""}
    for descending in [true,false] {
        rows := ILBTrendSorted(points,[],5,descending)
        V48Assert(rows[1].Percentile.Rank=(descending ? 100 : 10) && rows[3].Percentile.Rank="","numeric percentile sorting keeps unavailable grades last in both directions")
    }
}

IPP216UI() => V601Isolated(V75LibraryRun.Bind(IPP216UICase))
IPP216UICase()
{
    global IUB
    IUB.PercentilesEnabled := true,IUB.QuartileColors := true
    lib := ILBState(),lib.Files := V75LibraryFiles(),lib.Loaded := true
    ref := IQAReferences("DPS","MM",8,"live").Rows["DF-NE|2031339142381602"]
    for _,file in lib.Files {
        for i,p in file.Pulls {
            p.Boss := "DF-NE",p.Name := "Nefra",p.Area := "137438993402",p.Players[p.Recorder].Spec := "2031339142381602"
            p.Players[p.Recorder].Damage := ref.Curve[20+i*10]*60
        }
    }
    before := IGVJson(ILBPack(lib.Files))
    ILBBuildWindow(),ILBRefresh(),c := lib.Controls,c["Tabs"].Choose(3)
    c["TrendBoss"].Choose(2),c["TrendSpec"].Choose(2),c["TrendMode"].Choose(6),ILBTrendChanged(c["TrendBoss"])
    lv := c["TrendList"],sort := ILBTrendSortState(),chart := lib.Chart,chronology := lib.Trends
    V48Assert(lv.GetCount("Col")=9 && lv.GetText(0,5)="Percentile" && IsNumber(lv.GetText(1,5)),"Performance labels its grade column Percentile")
    IQH148CheckCenteredColumn(lv,5)
    lv.Modify(1,"Select Focus"),ILBActionState(),selected := ILBTrendSelected().Entry.Key
    V48Assert(InStr(c["TrendFooter"].Text,"Live") && InStr(c["TrendFooter"].Text,"8-player MM"),"selected result explains its actual reference scope")
    V48Assert(IURState().Tables[lv.Hwnd].NameScope="performance" && ILBPercentileColor(lv,1,IUBPalette())!="","estimates use the existing percentile colors")
    palette := IUBPalette(),entry := IURState().Tables[lv.Hwnd]
    V48Assert(ITBCellColors(entry,lv,0,5,palette).Text=ILBPercentileColor(lv,1,palette)
        && ITBCellColors(entry,lv,0,4,palette).Text=ITBPalette(palette).Text,"only the percentile column receives percentile colors")
    ILBTrendColumnClick(lv,5)
    V48Assert(sort.Descending && sort.Shown[1].Percentile.Rank>=sort.Shown[4].Percentile.Rank && ILBTrendSelected().Entry.Key=selected,"clicking Percentile sorts numerically and keeps selection")
    IQH148CheckCenteredColumn(lv,5)
    V48Assert(lib.Chart=chart && lib.Trends=chronology && IGVJson(ILBPack(lib.Files))=before,"sorting grades leaves graph chronology and stored data intact")
    row := lv.GetNext(),rank := ILBPercentileValue(ILBTrendSelected())
    V48Assert(c["TrendDecimals"].Value && lv.GetText(row,5)==IQTLabel(rank),"Performance initially shows two decimal places")
    SendMessage(0xF5,0,0,c["TrendDecimals"].Hwnd),Sleep(20)
    V48Assert(!c["TrendDecimals"].Value && !IQTDecimalsEnabled() && lv.GetText(row,5)==(Floor(rank) "")
        && InStr(c["TrendFooter"].Text,"Percentile: " Floor(rank) "  |"),"the Performance checkbox updates the visible row and its caption")
    V48Assert(lv.GetNext()=row && ILBTrendSelected().Entry.Key=selected && ILBPercentileValue(ILBTrendSelected())=rank
        && sort.Descending && lib.Chart=chart && lib.Trends=chronology,"changing precision retains the selection, sort, chart and grade")
    IQTToggleDecimals()
    V48Assert(c["TrendDecimals"].Value && lv.GetText(row,5)==IQTLabel(rank),"changing the shared setting restores the Performance labels and checkbox")
    c["TrendMetric"].Choose(2),ILBTrendChanged(c["TrendMetric"])
    lv.Modify(1,"Select Focus"),ILBActionState()
    V48Assert(lv.GetText(1,5)="—" && InStr(c["TrendFooter"].Text,"Raw HPS"),"raw HPS shows an unavailable grade with its reason")
    c["TrendMetric"].Choose(1),ILBTrendChanged(c["TrendMetric"])
    lv.Modify(1,"Select Focus"),ILBActionState()
    controls := []
    for control in lib.Gui
        if V58ChildVisible(control)
            controls.Push(control)
    V7412PlayerControlsPng("performance-percentiles.png",lib.Gui,controls,0,0,1120,770)
    IUB.QuartileColors := false
    V48Assert(ILBPercentileColor(lv,1,IUBPalette())="","Performance respects the shared color preference")
}

; Isolated timer/audio objects, temp fixture files, fake monotonic clock.
; SELF_TEST prevents every MCI open/play command; no game or live audio touched.
I96WithVoices(callback) => V657WithPull(I96WithVoicesCase.Bind(callback))
I96WithVoicesCase(callback)
{
    global IRT,IRTPrefs
    old := {Timer:IRT,Prefs:IRTPrefs}
    folder := A_Temp "\IrisVoiceTest-" DllCall("GetCurrentProcessId") "-" A_TickCount
    try {
        DirCreate(folder "\Amy")
        loop 10
            FileAppend("fixture",folder "\Amy\" A_Index ".mp3")
        IRTPrefs := IRTUNewState(),IRTPrefs.CountdownFolder := folder
        IRTPrefs.CountdownVoices := IRTVScanFolder(folder),IRTPrefs.CountdownEnabled := true,IRTPrefs.CalloutsEnabled := true
        IRT := IRTNewState(),IRT.Enabled := true,IRT.AnchorLog := 0
        callback.Call()
    } finally {
        IRTVCloseOptions()
        IRT := old.Timer,IRTPrefs := old.Prefs
        DirDelete(folder,true)
    }
}

I96StartTimer()
{
    global IRT,testClock
    d := IRTDefinition("Test countdown"),d.Enabled := true,d.Interval := 5000
    d.CountdownVoice := "Amy",d.CountdownCount := 5,d.CountdownVolume := 18
    d.PlayCountdown := true
    IRTStartNow(IRT,d,testClock,"")
    return IRT.Active[d.Id Chr(30)]
}

I96VoiceScheduler() => I96WithVoices(I96VoiceSchedulerCase)
I96VoiceSchedulerCase()
{
    global IRT,IRTPrefs,Audio,testClock,soundboardsEnabled,inputMode
    V48Assert(!IRTUNewState().CountdownEnabled,"countdowns default off")
    inst := I96StartTimer(),start := testClock
    for i,expected in [5,4,3,2,1] {
        testClock := start+(i-1)*1000
        IRTVTick(testClock),IRTVTick(testClock)
        V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].TimerBeat=expected,"only one number at its correct second")
        V48Assert(AudioItemEnabled(Audio.Queue[1]) && Audio.Queue[1].ClipVolume=18,"fresh number validates and retains volume")
        Audio.Queue := []
    }
    testClock := start+5000,IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length && !IRT.Active.Count,"expiry produces no zero or catch-up audio")
    testClock += 10000,inst := I96StartTimer(),testClock += 700,IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"late number is skipped")
    testClock += 300,IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].TimerBeat=4,"next on-time number works after a skipped digit")
    old := Audio.Queue[1],Audio.Queue := [],IRTStartNow(IRT,inst.Def,testClock,"")
    V48Assert(!AudioItemEnabled(old),"retrigger invalidates queued old countdown")
    IRTVTick(testClock),old := Audio.Queue[1],Audio.Queue := [],IRTStop(IRT,inst.Def.Id)
    V48Assert(!AudioItemEnabled(old),"cancellation invalidates number")
    inst := I96StartTimer(),inst.Def.Repeat := 2,IRT.LastPump := testClock,IRTVTick(testClock),Audio.Queue := []
    IRTPump(IRT,testClock,false)
    testClock += 5000,IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].TimerBeat=5 && inst.Occurrence=2,"repeat has a fresh countdown identity")
    old := Audio.Queue[1],Audio.Queue := [],IRTReset(IRT)
    V48Assert(!AudioItemEnabled(old),"context reset invalidates all old digits")
    IRT.AnchorLog := 0,inst := I96StartTimer(),inst.Def.CountdownVoice := "../Amy",IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length && IRTVClip(IRTPrefs,"../Amy",1)="","XML cannot supply traversal paths")
    V48Assert(IRTVClip(IRTPrefs,"https://example.test/Amy",1)="" && IRTVClip(IRTPrefs,"Amy",61)="","URLs and unsupported numbers rejected")
    V48Assert(IRTVClip(IRTPrefs,"Missing",1)="" && IRTVClip(IRTPrefs,"Amy",11)="","missing voice/digit is skipped without TTS substitution")
    inst.Def.CountdownVoice := "Amy",inst.Def.CountdownVolume := 0,testClock += 1000,IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"zero countdown volume remains muted")
    inst.Def.CountdownVolume := 18,soundboardsEnabled := false,IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"F11 master mute prevents scheduling")
    soundboardsEnabled := true,IRTPrefs.CountdownEnabled := false,IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"feature off prevents scheduling")
    IRTPrefs.CountdownEnabled := true,inputMode := "Hotkey",IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"hotkey mode does not schedule log timer audio")
    inputMode := "CombatLog",IRT.Enabled := false,IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"disabled timer engine is silent")
    IRT.Enabled := true,IRT.AnchorLog := -1,IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"unanchored timer model is silent")
    IRT.Active := IRTMap(),IRT.AnchorLog := 0,IRTPrefs.PreviewStart := testClock,IRTPrefs.PreviewUntil := testClock+15000
    IRTUDataSnapshot(IRT,testClock,IRTPrefs),IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"visual preview cannot produce countdown speech")
}

I96VoiceWorker() => I96WithVoices(I96VoiceWorkerCase)
I96VoiceWorkerCase()
{
    global IRT,IRTPrefs,Audio,testClock,soundboardsEnabled,audioOutputMode
    for route in ["KenkuBridgeTTS","KenkuSoundboard"] {
        audioOutputMode := route
        for cause in ["mute","off","cancel","reset","route","epoch","expiry","priority","volume","late"] {
            Audio.Queue := [],Audio.Current := "",IRT.Active := IRTMap(),IRT.AnchorLog := 0,IRT.Enabled := true
            soundboardsEnabled := true,IRTPrefs.CountdownEnabled := true,testClock += 10000
            inst := I96StartTimer(),IRTVTick(testClock),item := Audio.Queue[1]
            if cause="late" {
                testClock += 351,PumpAudio()
                V48Assert(!IsObject(Audio.Current) && !Audio.Queue.Length,"worker never starts a late number")
                continue
            }
            PumpAudio()
            V48Assert(IsObject(Audio.Current) && item.Stage="local-countdown" && item.ClipAlias!="" && !IsObject(Audio.Http),"both selected routes dispatch numbers locally through the single worker")
            switch cause {
                case "mute": soundboardsEnabled := false
                case "off": IRTPrefs.CountdownEnabled := false
                case "cancel": IRTStop(IRT,inst.Def.Id)
                case "reset": IRTReset(IRT)
                case "route": audioOutputMode := route="KenkuBridgeTTS" ? "KenkuSoundboard" : "KenkuBridgeTTS"
                case "epoch": CancelAllAudio("test cancel")
                case "expiry": testClock += 1000
                case "volume": inst.Def.CountdownVolume := 0
                case "priority":
                    higher := item.Clone(),higher.Serial += 1,higher.Priority := 3,higher.ClipAlias := ""
                    Audio.Queue.Push(higher)
            }
            PumpAudio()
            V48Assert(!IsObject(Audio.Current) && item.ClipAlias="","worker closes its owned clip on " cause)
            if cause="priority"
                V48Assert(Audio.Queue.Length=1,"interrupted countdown is not replayed")
            audioOutputMode := route
        }
    }
}

I96VoiceOptions() => V65UITimerIsolated(I96VoiceOptionsCase)
I96VoiceOptionsCase(path)
{
    global IRTPrefs,SETTINGS_FILE
    folder := A_Temp "\IrisVoiceOptions-" DllCall("GetCurrentProcessId") "-" A_TickCount
    try {
        DirCreate(folder "\Amy"),FileAppend("fixture",folder "\Amy\1.mp3")
        SettingsWrite(folder,SETTINGS_FILE,"IrisTimers","CountdownFolder")
        IRTVLoadPrefs(IRTPrefs)
        V48Assert(!IRTPrefs.CountdownEnabled && IRTPrefs.CountdownVoices.Has("Amy"),"load locates local sounds without opting in")
        IRTShowManager(),e := IRTVOptions(),e.Enabled.Value := 1
        V48Assert(InStr(e.Status.Text,"Amy"),"options show discovered voice")
        IRTVCloseOptions()
        V48Assert(!IRTPrefs.CountdownEnabled,"cancel leaves prefs unchanged")
        e := IRTVOptions(),e.Enabled.Value := 1,e.Folder.Value := folder "\absent"
        V48Assert(IRTVSaveOptions() && IRTPrefs.CountdownEnabled && IRTPrefs.CountdownFolder=IRTVBundledFolder(),"missing custom folder uses bundled recordings")
        e := IRTVOptions(),e.Folder.Value := folder
        V48Assert(IRTVSaveOptions() && IRTPrefs.CountdownEnabled,"valid folder and checkbox save")
        fresh := IRTUNewState(),IRTVLoadPrefs(fresh)
        V48Assert(fresh.CountdownEnabled && fresh.CountdownFolder=folder && IRTVClip(fresh,"Amy",1)!="","countdown choice survives load")
        IRTVOptions(),IRTUCloseManager()
        V48Assert(!IsObject(IRTPrefs.CountdownDialog),"closing manager closes its options")
        xml := V65IWrap(V65IXML("Voice",'<interval>5</interval><trigger><type>ABILITY_ACTIVATED</type><ability>Test</ability></trigger><countdownVoice>Amy</countdownVoice><countdownCount>5</countdownCount>'))
        report := IRTParseXML(xml)
        V48Assert(report.Definitions.Length=1 && report.Definitions[1].CountdownVolume=80,"missing volume in fresh import gets default")
        xml := StrReplace(xml,"<countdownCount>","<countdownVolume>0</countdownVolume><countdownCount>")
        d := IRTParseXML(xml).Definitions[1]
        V48Assert(d.CountdownVolume=0 && IRTParseXML(IRTSerializeXML([d])).Definitions[1].CountdownVolume=0,"explicit zero survives import and round trip")
    } finally {
        IRTVCloseOptions()
        DirDelete(folder,true)
    }
}

; Isolated clocks, copied definitions, temp settings, and SELF_TEST MCI stubs.
I220WithAlarms(callback) => I96WithVoices(I220WithAlarmsCase.Bind(callback))
I220WithAlarmsCase(callback)
{
    global IRTPrefs
    FileAppend("fixture",IRTPrefs.CountdownFolder "\Alarm.mp3")
    IRTPrefs.TimerSounds := IRTAScanSounds(IRTPrefs.CountdownFolder),IRTPrefs.AlarmsEnabled := true
    callback.Call()
}

I220StartAlarm(duration := 0,offset := 0)
{
    global IRT,testClock
    d := IRTDefinition("Corruption","Test audio"),d.Enabled := true,d.Interval := duration
    d.Audio := "Alarm.mp3",d.Volume := 16,d.PlaySound := true,d.SoundOffset := offset
    IRT.Now := testClock,IRT.LastPump := testClock,IRTStartNow(IRT,d,testClock,"")
    return d
}

I220AlarmLifecycle() => I220WithAlarms(I220AlarmLifecycleCase)
I220AlarmLifecycleCase()
{
    global IRT,IRTPrefs,Audio,testClock,soundboardsEnabled
    V48Assert(!IRTUNewState().AlarmsEnabled && !IRTDefinition("quiet").PlaySound,"alarms remain opt-in globally and per timer")
    d := I220StartAlarm(),IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(!IRT.Active.Count && Audio.Queue.Length=1 && Audio.Queue[1].Kind="TimerAlarm","instant Revan-style alarm survives natural timer expiry")
    item := Audio.Queue[1]
    V48Assert(AudioItemEnabled(item) && item.ClipVolume=16,"instant alarm keeps imported volume and validates")
    IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=1,"same instant alarm is not emitted twice")
    IRTStop(IRT,d.Id)
    V48Assert(!AudioItemEnabled(item),"cancel invalidates an expired alarm waiting in the worker")
    Audio.Queue := [],testClock += 10000,d := I220StartAlarm(),IRTPump(IRT,testClock,false),IRTVTick(testClock)
    old := Audio.Queue[1],Audio.Queue := [],I220StartAlarm()
    V48Assert(!AudioItemEnabled(old),"retrigger invalidates earlier instant alarm")
    IRTPump(IRT,testClock,false),IRTVTick(testClock),old := Audio.Queue[1],IRTReset(IRT)
    V48Assert(!AudioItemEnabled(old),"reset invalidates all queued alarms")
    Audio.Queue := [],IRT.AnchorLog := 0,testClock += 10000,d := I220StartAlarm(5000,3)
    IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"offset alarm does not play before its imported threshold")
    testClock += 2000,IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=1 && AudioItemEnabled(Audio.Queue[1]),"three-second imported lead plays at the correct time")
    Audio.Queue := [],testClock += 3000,IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"lead alarm is not repeated at final expiry")
    testClock += 10000,d := I220StartAlarm(1000),d.Repeat := 2
    testClock += 1000,IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=1 && AudioItemEnabled(Audio.Queue[1]),"repeat alarm remains valid after next occurrence starts")
    Audio.Queue := [],testClock += 1000,IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=1 && AudioItemEnabled(Audio.Queue[1]),"final occurrence emits its own fresh alarm")
    Audio.Queue := [],testClock += 10000,d := I220StartAlarm(),testClock += 600
    IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"late alarm from a blocked read is not replayed")
    testClock += 10000,d := I220StartAlarm(),soundboardsEnabled := false
    IRTPump(IRT,testClock,false),IRTVTick(testClock),soundboardsEnabled := true,testClock += 100,IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"F11 mute consumes an alarm without replaying it after unmute")
    testClock += 10000,d := I220StartAlarm(),IRTPrefs.AlarmsEnabled := false
    IRTPump(IRT,testClock,false),IRTVTick(testClock),IRTPrefs.AlarmsEnabled := true,IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"enabling alarms cannot replay a cue observed while disabled")
    V48Assert(IRTASoundPath(IRTPrefs,"../Alarm.mp3")="" && IRTASoundPath(IRTPrefs,"https://example.test/Alarm.mp3")=""
        && IRTASoundPath(IRTPrefs,"C:\Alarm.mp3")="" && IRTASoundPath(IRTPrefs,"Missing.mp3")="","only scanned local alarm filenames can play")
    V48Assert(IRTASoundPath(IRTPrefs,"ALARM.MP3")!="","Windows filename case is preserved without losing a match")
}

I220AlarmWorker() => I220WithAlarms(I220AlarmWorkerCase)
I220AlarmWorkerCase()
{
    global IRT,IRTPrefs,Audio,testClock,soundboardsEnabled,audioOutputMode
    for cause in ["mute","off","per-timer","cancel","reset","epoch","expiry","volume","late"] {
        CancelAllAudio("fixture reset"),Audio.Current := "",Audio.Queue := []
        IRTReset(IRT),IRT.AnchorLog := 0,IRT.Enabled := true,soundboardsEnabled := true,IRTPrefs.AlarmsEnabled := true
        testClock += 10000,d := I220StartAlarm(),IRTPump(IRT,testClock,false),IRTVTick(testClock),item := Audio.Queue[1]
        if cause="late" {
            testClock += 501,PumpAudio()
            V48Assert(!IsObject(Audio.Current),"busy worker skips an alarm past its dispatch window")
            continue
        }
        PumpAudio()
        V48Assert(IsObject(Audio.Current) && item.Stage="local-timer-alarm" && item.ClipAlias!="" && !IsObject(Audio.Http),"alarm uses the existing serial worker with a local recording")
        switch cause {
            case "mute": soundboardsEnabled := false
            case "off": IRTPrefs.AlarmsEnabled := false
            case "per-timer": d.PlaySound := false
            case "cancel": IRTStop(IRT,d.Id)
            case "reset": IRTReset(IRT)
            case "epoch": CancelAllAudio("fixture epoch")
            case "expiry": testClock += 5000
            case "volume": d.Volume := 0
        }
        PumpAudio()
        V48Assert(!IsObject(Audio.Current) && item.ClipAlias="","worker closes its alarm when " cause)
    }
}

I220ImportedAudio() => I220WithAlarms(I220ImportedAudioCase)
I220ImportedAudioCase()
{
    global IRT,IRTPrefs,Audio,testClock
    defs := IRTDefaultLibrary().Definitions,doom := "",corruption := ""
    for d in defs {
        if d.Name="Doom" && d.Folder="Terror From Beyond"
            doom := d
        if d.Name="ToS Revan Corruption"
            corruption := d
    }
    V48Assert(IsObject(doom) && doom.Supported && doom.Interval=34000 && doom.CountdownVoice="Amy" && doom.CountdownCount=5,"actual bundled Doom retains its Amy five-number configuration")
    V48Assert(IsObject(corruption) && corruption.Supported && corruption.Interval=0 && corruption.Audio="Alarm.mp3","actual bundled Revan timer is an instant alarm")
    corruption.PlaySound := true,IRT.Now := testClock,IRTStartNow(IRT,corruption,testClock,"")
    IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].ClipVolume=corruption.Volume,"bundled Revan alarm reaches the serial audio queue")
    Audio.Queue := [],doom.Enabled := true,doom.PlayCountdown := true
    IRT.Now := testClock,IRTStartNow(IRT,doom,testClock-29000,"")
    IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].TimerBeat=5,"bundled personal Doom starts its five-second spoken countdown")
    old := Audio.Queue[1],doom.PlayCountdown := false
    V48Assert(!AudioItemEnabled(old),"per-timer countdown checkbox immediately mutes queued numbers")
    xml := IRTSerializeXML([doom,corruption]),round := IRTParseXML(xml).Definitions
    V48Assert(!round[1].PlayCountdown && round[2].PlaySound && round[2].Volume=corruption.Volume,"per-timer audio choices survive XML persistence")
    fresh := IRTParseXML(V65IWrap(V65IXML("Alarm default",'<interval>0</interval><trigger><type>ABILITY_ACTIVATED</type><ability>Test</ability></trigger><audio>Alarm.mp3</audio>'))).Definitions[1]
    V48Assert(fresh.Volume=80 && !fresh.PlaySound,"fresh sound import gets usable volume without enabling alarms")
    fresh.Volume := 0
    V48Assert(IRTParseXML(IRTSerializeXML([fresh])).Definitions[1].Volume=0,"explicit alarm mute survives reload")
}

I220AudioEditor() => V65UITimerIsolated(I220AudioEditorCase)
I220AudioEditorCase(path)
{
    global IRT,IRTPrefs
    folder := A_Temp "\Iris220Editor-" DllCall("GetCurrentProcessId") "-" A_TickCount
    try {
        DirCreate(folder "\Amy"),FileAppend("fixture",folder "\Amy\1.mp3"),FileAppend("fixture",folder "\Alarm.mp3")
        IRTPrefs.CountdownFolder := folder,IRTPrefs.CountdownVoices := IRTVScanFolder(folder),IRTPrefs.TimerSounds := IRTAScanSounds(folder)
        d := V65IDef("Editable audio"),IRTConfigure(IRT,[d]),IRTShowManager(),e := IRTEOpen(d,d.Id)
        V48Assert(e.Tab.Text="Timer" && e.Controls.Has("PlaySound") && e.Controls.Has("PlayCountdown"),"editor exposes audio settings in a separate tab")
        e.Controls["PlaySound"].Value := 1,e.Controls["Audio"].Choose("Alarm.mp3"),e.Controls["Volume"].Value := 16
        e.Controls["PlayCountdown"].Value := 1,e.Controls["CountdownVoice"].Choose("Amy"),e.Controls["CountdownCount"].Value := 5,e.Controls["CountdownVolume"].Value := 18
        draft := IRTEReadDraft(e)
        V48Assert(draft.PlaySound && draft.PlayCountdown && draft.Audio="Alarm.mp3" && draft.CountdownVoice="Amy" && draft.Volume=16 && draft.CountdownVolume=18,"both audio types are independently editable")
        V48Assert(IRTESave() && IRT.Definitions[1].PlaySound && IRT.Definitions[1].CountdownCount=5,"editor atomically saves per-timer audio with the existing library")
        persisted := IRTParseXML(FileRead(path ".timers.xml","UTF-8")).Definitions[1]
        V48Assert(persisted.PlaySound && persisted.Audio="Alarm.mp3" && persisted.CountdownCount=5,"saved timer XML keeps the chosen recordings and enable flags")
        e := IRTVOptions(),e.Enabled.Value := 1,e.Folder.Value := folder
        V48Assert(IRTVSaveOptions() && IRTPrefs.AlarmsEnabled && IRTPrefs.CountdownEnabled,"one timer-callouts switch enables alarms and countdowns")
        fresh := IRTUNewState(),IRTVLoadPrefs(fresh)
        V48Assert(fresh.CalloutsEnabled && fresh.AlarmsEnabled && fresh.TimerSounds.Has("Alarm.mp3") && fresh.CountdownEnabled,"audio options and selected local folder survive restart")
    } finally {
        IRTEClose(),IRTVCloseOptions(),DirDelete(folder,true)
        try FileDelete(path ".timers.xml")
    }
}

; Public promotion keeps every previously silent stock countdown opt-in.
I106AudioOptIn() => I96WithVoices(I106AudioOptInCase)
I106AudioOptInCase()
{
    global IRT,IRTPrefs,Audio,testClock
    configured := 0
    for d in IRTDefaultLibrary().Definitions {
        wall := d.Builtin && d.Folder="Built-in: R4 Anomaly" && InStr(d.Name,"IP - Grenade: ",true)=1
        V48Assert(d.PlayCountdown=wall && !d.PlaySound && !IRTCalloutsAllowed(d,false),
            "only wall timers have a preselected countdown and they still follow the global switch")
        if d.CountdownVoice!="" && d.CountdownCount>0
            configured += 1
    }
    V48Assert(configured>=20,"opt-in guard covers the real bundled voice-configured catalogue")
    selected := IRTDefinition("Chosen countdown"),selected.Enabled := true,selected.Interval := 5000
    selected.Trigger := IRTCondition("ABILITY_ACTIVATED"),selected.Trigger.Ability := "Test"
    selected.CountdownVoice := "Amy",selected.CountdownCount := 5,selected.CountdownVolume := 18
    quiet := IRTIClone(selected),quiet.Name := "Not selected",quiet.Id := "" Chr(31) quiet.Name
    selected.PlayCountdown := true
    IRTStartNow(IRT,quiet,testClock,""),IRTStartNow(IRT,selected,testClock,""),IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].TimerInstance.Def.Name="Chosen countdown","global countdown enable plays only the individually selected timer")
    saved := IRTParseXML(IRTSerializeXML([quiet,selected])).Definitions
    V48Assert(!saved[1].PlayCountdown && saved[2].PlayCountdown,"unselected and selected countdowns retain independent choices after restart")
}

; Temp libraries, fake clocks and SELF_TEST only. No normal app or playback.
I221MasterPlan()
{
    a := V65IDef("Configured"),a.Audio := "Alarm.mp3",a.Volume := 0
    a.CountdownVoice := "Amy",a.CountdownCount := 5,a.CountdownVolume := 18
    a.PlaySound := false,a.PlayCountdown := false
    b := V65IDef("No recording"),b.PlaySound := true,b.PlayCountdown := true,b.Enabled := false
    c := IRTIClone(a),c.Id := "bad",c.Supported := false,c.PlaySound := false,c.PlayCountdown := false
    before := IRTSerializeXML([a,b]),out := IRTMConfigured([a,b,c])
    V48Assert(out[1].PlaySound && out[1].PlayCountdown,"one plan enables both configured types")
    V48Assert(!out[2].PlaySound && !out[2].PlayCountdown && !out[2].Enabled,"missing metadata is not invented and disabled timers remain disabled")
    V48Assert(!out[3].PlaySound && !out[3].PlayCountdown,"unsupported rules are not activated")
    V48Assert(out[1].Volume=0 && out[1].CountdownVolume=18 && out[1].Audio=a.Audio,"explicit volume mutes and recordings are preserved")
    V48Assert(IRTSerializeXML([a,b])==before && out[1]!=a,"bulk preparation never mutates the live library")
}

I221MasterPreferences() => V65UITimerIsolated(I221MasterPreferencesCase)
I221MasterPreferencesCase(path)
{
    global IRT,IRTPrefs,SETTINGS_FILE,Audio,testClock,audioOutputMode
    previousAudio := Audio,Audio := Audio.Clone(),Audio.Queue := [],Audio.Current := ""
    folder := path "-sounds"
    try {
        DirCreate(folder "\Amy"),FileAppend("fixture",folder "\Amy\1.mp3"),FileAppend("fixture",folder "\Alarm.mp3")
        SettingsWrite(1,path,"IrisTimers","CountdownEnabled"),SettingsWrite(1,path,"IrisTimers","AlarmsEnabled")
        SettingsWrite("keep",path,"Unrelated","Marker"),SettingsWrite(folder,path,"IrisTimers","CountdownFolder")
        fresh := IRTUNewState(),IRTVLoadPrefs(fresh)
        V48Assert(!fresh.CalloutsEnabled && !fresh.CountdownEnabled && !fresh.AlarmsEnabled,"new master defaults off even with legacy separate masters saved on")
        IRTPrefs := fresh,IRTConfigure(IRT,IRTDefaultLibrary().Definitions),IRT.Enabled := false
        d := V65IDef("Live visual"),d.Enabled := true,d.Interval := 10000,d.Audio := "Alarm.mp3",d.Volume := 16
        d.PlaySound := false,d.PlayCountdown := false,d.CountdownVoice := "Amy",d.CountdownCount := 5,d.CountdownVolume := 18
        IRT.Definitions.Push(d),IRT.ById[d.Id] := d,IRTStartNow(IRT,d,testClock,"")
        inst := IRT.Active[d.Id Chr(30)],generation := IRT.Generation,start := inst.Start,due := inst.Due
        IRTShowManager()
        V48Assert(!IRTPrefs.CalloutsBox.Value && IRTPrefs.CalloutsBox.Text="Enable all timer callouts","the one-click switch is visible and initially off")
        IRTMSetEnabled(true)
        V48Assert(IRTPrefs.CalloutsEnabled && IRTPrefs.CountdownEnabled && IRTPrefs.AlarmsEnabled && IRT.Enabled,"one choice activates both audio types and timer processing")
        V48Assert(IRTPrefs.CalloutsBox.Value && IRTPrefs.Master.Value,"both manager checkboxes reflect actual enabled processing/audio")
        V48Assert(IRT.Generation=generation && IRT.Active[inst.Key]==inst && inst.Start=start && inst.Due=due,"enabling audio preserves the active visual timer and schedule")
        configured := 0
        for def in IRT.Definitions {
            if def.Supported && def.CountdownVoice!="" && def.CountdownCount>0
                configured += 1,V48Assert(def.PlayCountdown,"every configured stock or custom countdown is selected")
            if def.Supported && def.Audio!=""
                V48Assert(def.PlaySound,"every configured stock or custom alarm is selected")
        }
        V48Assert(configured>=20 && inst.Def.PlaySound && inst.HasOwnProp("SoundSerial"),"real stock catalogue and an already running upcoming alarm are included")
        saved := IRTParseXML(FileRead(path ".timers.xml","UTF-8"),IRTBDefinitions())
        V48Assert(saved.Definitions.Length+saved.Overrides.Length>20,"all selections are atomically persisted in the ordinary library")
        reloaded := IRTUNewState(),IRTVLoadPrefs(reloaded)
        V48Assert(reloaded.CalloutsEnabled && reloaded.CountdownEnabled && reloaded.AlarmsEnabled && IniRead(path,"IrisTimers","Enabled")="1","single master and engine choice survive reload")
        d.PlayCountdown := false,IRTWriteLibrary(IRT.Definitions)
        options := IRTVOptions(),options.Enabled.Value := 1,options.Folder.Value := folder
        V48Assert(IRTVSaveOptions() && !d.PlayCountdown,"saving an already enabled master or folder preserves manual per-timer mutes")
        Audio.Queue.Push({Kind:"TimerCountdown",Key:"TimerCountdown",Epoch:Audio.Epoch,Route:audioOutputMode,Expires:testClock+1000,Created:testClock})
        IRTMSetEnabled(false)
        V48Assert(!IRTPrefs.CalloutsEnabled && !Audio.Queue.Length && IRT.Enabled && IRT.Active[inst.Key]==inst,"switching off retires queued timer speech but keeps visual processing and active bars")
        V48Assert(IRT.Generation=generation && d.PlaySound && !d.PlayCountdown,"muting does not reset visuals or overwrite individual audio choices")
        IRTMSetEnabled(true)
        V48Assert(d.PlayCountdown && IRT.Active[inst.Key]==inst,"turning on again explicitly selects all configured audio without restarting timers")
        V48Assert(IniRead(path,"Unrelated","Marker")="keep","global audio changes preserve unrelated preferences")
    } finally {
        IRTVCloseOptions(),Audio := previousAudio
        DirDelete(folder,true)
        for suffix in [".timers.xml",".timers.xml.bak"]
            try FileDelete(path suffix)
    }
}

I221MasterImport() => V65UITimerIsolated(I221MasterImportCase)
I221MasterImportCase(path)
{
    global IRT,IRTPrefs
    imported := path "-import.xml"
    try {
        IRTConfigure(IRT,[]),IRTMSetEnabled(true)
        xml := V65IWrap(V65IXML("Fresh StarParse",'<interval>5</interval><trigger><type>ABILITY_ACTIVATED</type><ability>Test</ability></trigger><audio>Alarm.mp3</audio><countdownVoice>Amy</countdownVoice><countdownCount>5</countdownCount>'))
        FileAppend(xml,imported,"UTF-8"),IRTImportFile(imported)
        d := IRT.Definitions[1]
        V48Assert(d.PlaySound && d.PlayCountdown && d.Volume=80 && d.CountdownVolume=80,"a later StarParse import uses its configured recordings without another per-timer opt-in")
        d.PlayCountdown := false,d.PlaySound := false,IRTWriteLibrary(IRT.Definitions)
        next := V65IDef("Explicit Iris mute"),next.Audio := "Alarm.mp3",next.PlaySound := false,next.CountdownVoice := "Amy",next.CountdownCount := 5,next.PlayCountdown := false
        FileDelete(imported),FileAppend(IRTSerializeXML([next]),imported,"UTF-8"),IRTImportFile(imported)
        V48Assert(!IRT.ById[d.Id].PlaySound && !IRT.ById[d.Id].PlayCountdown,"importing other timers preserves an existing manual mute")
        V48Assert(!IRT.ById[next.Id].PlaySound && !IRT.ById[next.Id].PlayCountdown,"an Iris export's explicit per-timer choices survive import")
        IRTMSetEnabled(false)
        FileDelete(imported),FileAppend(StrReplace(xml,"Fresh StarParse","Imported while off"),imported,"UTF-8"),IRTImportFile(imported)
        quiet := ""
        for candidate in IRT.Definitions {
            if candidate.Name="Imported while off"
                quiet := candidate
        }
        V48Assert(IsObject(quiet),"the new timer was imported while the master was off")
        V48Assert(!quiet.PlaySound && !IRTPrefs.CalloutsEnabled,"importing never turns the default-off master on")
        IRTMSetEnabled(true)
        V48Assert(quiet.PlaySound && quiet.PlayCountdown,"the next explicit enable-all includes newly imported configured timers")
    } finally {
        try FileDelete(imported)
        for suffix in [".timers.xml",".timers.xml.bak"]
            try FileDelete(path suffix)
    }
}

I221MasterFailure() => V65UITimerIsolated(I221MasterFailureCase)
I221MasterFailureCase(path)
{
    global IRT,IRTPrefs
    target := path ".timers.xml",generation := IRT.Generation,active := IRT.Active.Count
    before := IRTSerializeXML(IRT.Definitions)
    try {
        DirCreate(target)
        failed := false
        try IRTMSetEnabled(true)
        catch
            failed := true
        V48Assert(failed && !IRTPrefs.CalloutsEnabled,"a failed library save cannot enable timer audio")
        V48Assert(IRTSerializeXML(IRT.Definitions)==before && IRT.Generation=generation && IRT.Active.Count=active,"failure leaves live definitions and visual timers intact")
    } finally DirDelete(target)
}

; Isolated temp settings, fake clocks and SELF_TEST audio only.
I224Find(defs,id)
{
    for d in defs {
        if d.Id==id
            return d
    }
    return ""
}

I224Configured(name)
{
    d := V65IDef(name),d.Enabled := true,d.Audio := "Alarm.mp3",d.Volume := 16,d.PlaySound := true
    d.CountdownVoice := "Amy",d.CountdownCount := 5,d.CountdownVolume := 18,d.PlayCountdown := true
    return d
}

I224ExclusionPersistence()
{
    a := I224Configured("Excluded"),a.CalloutsDisabled := true,b := I224Configured("Allowed")
    xml := IRTSerializeXML([a,b]),round := IRTParseXML(xml).Definitions
    V48Assert(IRTCalloutsDisabled(round[1]) && !IRTCalloutsDisabled(round[2]),"only the selected timer's exclusion survives an XML round trip")
    V48Assert(!InStr(IRTSerializeXML([b]),"irisCalloutsDisabled"),"default unexcluded rules add no new XML field")
    before := IRTSerializeXML([a,b]),planned := IRTMConfigured([a,b])
    V48Assert(IRTCalloutsDisabled(planned[1]) && !IRTCalloutsDisabled(planned[2]) && planned[2].PlaySound && planned[2].PlayCountdown,"enable-all preserves the hard exclusion and enables other configured audio")
    V48Assert(IRTSerializeXML([a,b])==before,"preparing global audio does not mutate saved exclusions")
    fresh := IRTParseXML(V65IWrap(V65IXML(a.Name,'<interval>5</interval><trigger><type>ABILITY_ACTIVATED</type><ability>Test</ability></trigger>')))
    fresh.Definitions[1].Folder := a.Folder,fresh.Definitions[1].Id := a.Id
    merged := IRTMergeDefinitions([a],fresh,true)
    V48Assert(IRTCalloutsDisabled(merged.Definitions[1]),"ordinary StarParse replacement cannot clear a local exclusion")
    explicit := IRTParseXML(StrReplace(IRTSerializeXML([a]),"<irisCalloutsDisabled>true</irisCalloutsDisabled>","<irisCalloutsDisabled>false</irisCalloutsDisabled>"))
    V48Assert(!IRTCalloutsDisabled(IRTMergeDefinitions([a],explicit,true).Definitions[1]),"an explicit native false override can clear an exclusion")
    stock := IRTBDefinitions(),builtin := IRTIClone(stock[1]),builtin.CalloutsDisabled := true
    saved := IRTParseXML(IRTSerializeXML([builtin]),stock),restored := IRTMergeDefinitions(stock,saved,true)
    V48Assert(IRTCalloutsDisabled(I224Find(restored.Definitions,builtin.Id)),"built-in preference overrides keep their exclusion after restart")
    draft := IRTIClone(builtin),draft.CalloutsDisabled := false
    V48Assert(!IRTCalloutsDisabled(I224Find(IRTEPrepare(restored.Definitions,builtin.Id,draft).Definitions,builtin.Id)),"the built-in editor can remove its own exclusion")
    failed := false
    try IRTParseXML(StrReplace(xml,"<irisCalloutsDisabled>true</irisCalloutsDisabled>","<irisCalloutsDisabled>maybe</irisCalloutsDisabled>"))
    catch
        failed := true
    V48Assert(failed,"exclusion metadata is validated as a boolean")
}

I224ExclusionMaster() => V65UITimerIsolated(I224ExclusionMasterCase)
I224ExclusionMasterCase(path)
{
    global IRT,IRTPrefs
    try {
        a := I224Configured("Excluded master"),a.CalloutsDisabled := true,b := I224Configured("Allowed master")
        IRTConfigure(IRT,[a,b]),IRTPrefs.CalloutsEnabled := false,IRT.Enabled := true
        IRTMSetEnabled(true),IRTMSetEnabled(false),IRTMSetEnabled(true)
        V48Assert(IRTCalloutsDisabled(IRT.Definitions[1]) && !IRTCalloutsDisabled(IRT.Definitions[2]),"global off/on never clears the selected timer's exclusion")
        V48Assert(IRTPrefs.CalloutsEnabled && IRT.Definitions[2].PlaySound && IRT.Definitions[2].PlayCountdown,"all other configured timer callouts remain globally enabled")
        reloaded := IRTParseXML(FileRead(path ".timers.xml","UTF-8")).Definitions
        IRTConfigure(IRT,reloaded),IRTMSetEnabled(false),IRTMSetEnabled(true)
        V48Assert(IRTCalloutsDisabled(IRT.Definitions[1]) && IRT.Definitions[1].Enabled && IRT.Definitions[2].Enabled,"the exclusion and enabled visual timers survive persisted reload and another global activation")
    } finally {
        for suffix in [".timers.xml",".timers.xml.bak"]
            try FileDelete(path suffix)
    }
}

I224ExclusionCountdown() => I220WithAlarms(I224ExclusionCountdownCase)
I224ExclusionCountdownCase()
{
    global IRT,IRTPrefs,Audio,testClock
    a := I224Configured("Voice excluded"),b := I224Configured("Voice allowed"),a.Interval := 5000,b.Interval := 5000
    IRTConfigure(IRT,[a,b]),IRT.Enabled := true,IRT.AnchorLog := 0,IRT.Now := testClock,IRT.LastPump := testClock
    a := IRT.Definitions[1],b := IRT.Definitions[2]
    IRTStartNow(IRT,a,testClock,""),IRTStartNow(IRT,b,testClock,""),IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=2,"two eligible timers initially produce their own voice cues")
    first := "",other := "",gen := IRT.Generation
    for item in Audio.Queue {
        if item.TimerInstance.Def.Id==a.Id
            first := item
        else if item.TimerInstance.Def.Id==b.Id
            other := item
    }
    V48Assert(IsObject(first) && IsObject(other),"voice cues are matched by timer identity, independent of map enumeration order")
    instA := IRT.Active[a.Id Chr(30)],instB := IRT.Active[b.Id Chr(30)],dueA := instA.Due,dueB := instB.Due
    planned := IRTIClone(IRT.Definitions),planned[1].CalloutsDisabled := true,IRTAApplyExclusions(planned)
    V48Assert(!AudioItemEnabled(first) && AudioItemEnabled(other) && Audio.Queue.Length=1,"excluding one timer retires only its queued countdown")
    V48Assert(IRT.Generation=gen && IRT.Active[instA.Key]==instA && IRT.Active[instB.Key]==instB && instA.Due=dueA && instB.Due=dueB,"changing the exclusion preserves both live visual bars and schedules")
    PumpAudio()
    V48Assert(IsObject(Audio.Current) && Audio.Current.TimerInstance.Def.Id==b.Id,"the other timer still reaches the audio worker")
    planned := IRTIClone(IRT.Definitions),planned[2].CalloutsDisabled := true,IRTAApplyExclusions(planned)
    V48Assert(IsObject(Audio.Current) && Audio.Current.Cancel,"excluding an in-flight countdown requests worker cancellation")
    PumpAudio()
    V48Assert(!IsObject(Audio.Current) && other.ClipAlias="","the next worker tick closes the excluded countdown clip")
    testClock += 1000,IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length && IRT.Active.Count=2,"excluded timers stay visually active without enqueueing later countdown numbers")
    planned := IRTIClone(IRT.Definitions),planned[1].CalloutsDisabled := false,IRTAApplyExclusions(planned)
    IRTVTick(testClock)
    V48Assert(!Audio.Queue.Length,"removing an exclusion does not replay the current partial second")
    testClock += 1000,IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].TimerInstance.Def.Id==a.Id,"removing the exclusion permits the next on-time countdown number")
}

I224ExclusionAlarm() => I220WithAlarms(I224ExclusionAlarmCase)
I224ExclusionAlarmCase()
{
    global IRT,Audio,testClock
    a := I224Configured("Alarm excluded"),b := I224Configured("Alarm allowed")
    a.Interval := 0,b.Interval := 0,a.CalloutsDisabled := true,a.PlayCountdown := false,b.PlayCountdown := false
    IRTConfigure(IRT,[a,b]),IRT.Enabled := true,IRT.AnchorLog := 0,IRT.Now := testClock,IRT.LastPump := testClock
    a := IRT.Definitions[1],b := IRT.Definitions[2]
    IRTStartNow(IRT,a,testClock,""),IRTStartNow(IRT,b,testClock,""),IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(Audio.Queue.Length=1 && Audio.Queue[1].AlarmCue.Def.Id==b.Id,"the excluded instant alarm produces no cue while another still queues")
    item := Audio.Queue[1],PumpAudio()
    V48Assert(IsObject(Audio.Current) && item.ClipAlias!="","the allowed instant alarm enters the worker normally")
    planned := IRTIClone(IRT.Definitions),planned[2].CalloutsDisabled := true,IRTAApplyExclusions(planned)
    V48Assert(!AudioItemEnabled(item) && IsObject(Audio.Current) && Audio.Current.Cancel,"excluding an expired timer invalidates its alarm and requests cancellation")
    PumpAudio()
    V48Assert(!IsObject(Audio.Current) && item.ClipAlias="","the worker closes the excluded expired alarm clip")
}

I224ExclusionEditor() => V65UITimerIsolated(I224ExclusionEditorCase)
I224ExclusionEditorCase(path)
{
    global IRT,IRTPrefs,Audio,testClock
    previousAudio := Audio,Audio := Audio.Clone(),Audio.Queue := [],Audio.Current := "",folder := path "-sounds"
    try {
        DirCreate(folder "\Amy"),FileAppend("fixture",folder "\Amy\1.mp3"),FileAppend("fixture",folder "\Alarm.mp3")
        IRTPrefs.CountdownFolder := folder,IRTPrefs.CountdownVoices := IRTVScanFolder(folder),IRTPrefs.TimerSounds := IRTAScanSounds(folder)
        a := I224Configured("Editor excluded"),b := I224Configured("Editor allowed")
        IRTConfigure(IRT,[a,b]),IRTMSetEnabled(true),IRT.AnchorLog := 0,IRT.Now := testClock,IRT.LastPump := testClock
        a := IRT.Definitions[1],b := IRT.Definitions[2]
        IRTStartNow(IRT,a,testClock,""),IRTStartNow(IRT,b,testClock,"")
        gen := IRT.Generation,instA := IRT.Active[a.Id Chr(30)],instB := IRT.Active[b.Id Chr(30)]
        IRTShowManager(),IRTURefreshManager(a.Id),e := IRTAOpenSelected()
        V48Assert(e.Tab.Value=4 && e.Controls.Has("CalloutsMode") && e.Controls["CalloutsMode"].Value=1,"the direct Callouts editor exposes the saved exclusion")
        e.Controls["CalloutsMode"].Choose(3),IRTAExclusionControls(e)
        V48Assert(!e.Controls["PlaySound"].Enabled && !e.Controls["PlayCountdown"].Enabled && e.Controls["PlayCountdown"].Value,"an excluded timer keeps its chosen audio while making the override clear")
        V48Assert(IRTESave() && IRTCalloutsDisabled(IRT.Definitions[1]) && !IRTCalloutsDisabled(IRT.Definitions[2]),"Save excludes only the selected timer")
        V48Assert(IRT.Generation=gen && IRT.Active[instA.Key]==instA && IRT.Active[instB.Key]==instB && a.Enabled && b.Enabled,"saving only the exclusion does not reset any active visual timer")
        persisted := IRTParseXML(FileRead(path ".timers.xml","UTF-8")).Definitions
        V48Assert(IRTCalloutsDisabled(persisted[1]) && !IRTCalloutsDisabled(persisted[2]),"the explicit exclusion is persisted for restart")
        IRTMSetEnabled(false),IRTMSetEnabled(true)
        V48Assert(IRTCalloutsDisabled(a) && IRTPrefs.CalloutsEnabled && !IRTCalloutsDisabled(b),"the saved per-timer exclusion wins over another global off/on")
        IRTURefreshManager(a.Id),e := IRTAOpenSelected(),e.Controls["CalloutsMode"].Choose(1),IRTAExclusionControls(e)
        V48Assert(e.Controls["PlaySound"].Enabled && IRTESave() && !IRTCalloutsDisabled(a),"unchecking the exclusion restores the same configured timer")
        V48Assert(IRT.Generation=gen && IRT.Active[instA.Key]==instA && IRT.Active[instB.Key]==instB,"removing the exclusion also preserves live visual timers")
    } finally {
        IRTEClose(),Audio := previousAudio,DirDelete(folder,true)
        for suffix in [".timers.xml",".timers.xml.bak"]
            try FileDelete(path suffix)
    }
}

I224ExclusionFailure() => V65UITimerIsolated(I224ExclusionFailureCase)
I224ExclusionFailureCase(path)
{
    global IRT,testClock
    a := I224Configured("Cannot save exclusion"),IRTConfigure(IRT,[a]),IRT.Enabled := true,IRT.Now := testClock,IRT.LastPump := testClock
    a := IRT.Definitions[1],IRTStartNow(IRT,a,testClock,""),gen := IRT.Generation,inst := IRT.Active[a.Id Chr(30)]
    before := IRTSerializeXML(IRT.Definitions),draft := IRTIClone(a),draft.CalloutsDisabled := true,target := path ".timers.xml"
    try {
        DirCreate(target),failed := false
        try IRTECommit(a.Id,draft,before)
        catch
            failed := true
        V48Assert(failed && !IRTCalloutsDisabled(a) && IRTSerializeXML(IRT.Definitions)==before,"failed persistence does not change a live timer's exclusion")
        V48Assert(IRT.Generation=gen && IRT.Active[inst.Key]==inst,"failed persistence preserves active visuals")
    } finally DirDelete(target)
}

; Isolated libraries and SELF_TEST audio worker only; no user settings or playback.
I226ModePersistence()
{
    a := I224Configured("Individual"),a.CalloutsEnabled := true
    b := I224Configured("Excluded"),b.CalloutsDisabled := true
    c := I224Configured("Global")
    round := IRTParseXML(IRTSerializeXML([a,b,c])).Definitions
    V48Assert(IRTCalloutsIndependent(round[1]) && !IRTCalloutsDisabled(round[1]),"individual enable survives native XML")
    V48Assert(IRTCalloutsDisabled(round[2]) && !IRTCalloutsIndependent(round[3]),"existing exclusion and global default survive native XML")
    V48Assert(!InStr(IRTSerializeXML([c]),"irisCalloutsEnabled"),"ordinary timers add no new audio metadata unless individually enabled")
    V48Assert(IRTCalloutsAllowed(a,false) && !IRTCalloutsAllowed(c,false) && IRTCalloutsAllowed(c,true),"explicit enable is independent while ordinary timers follow the global setting")
    b.CalloutsEnabled := true
    V48Assert(!IRTCalloutsAllowed(b,true) && !IRTCalloutsAllowed(b,false),"explicit disable wins even over contradictory input or enable-all")
    fresh := IRTParseXML(V65IWrap(V65IXML(a.Name,'<interval>5</interval><trigger><type>ABILITY_ACTIVATED</type><ability>Test</ability></trigger>')))
    fresh.Definitions[1].Folder := a.Folder,fresh.Definitions[1].Id := a.Id
    V48Assert(IRTCalloutsIndependent(IRTMergeDefinitions([a],fresh,true).Definitions[1]),"a StarParse replacement preserves local individual enable")
    explicit := IRTParseXML(StrReplace(IRTSerializeXML([a]),"<irisCalloutsEnabled>true</irisCalloutsEnabled>","<irisCalloutsEnabled>false</irisCalloutsEnabled>"))
    V48Assert(!IRTCalloutsIndependent(IRTMergeDefinitions([a],explicit,true).Definitions[1]),"a native explicit false can restore global control")
    stock := IRTBDefinitions(),builtin := IRTIClone(stock[1]),builtin.CalloutsEnabled := true
    saved := IRTParseXML(IRTSerializeXML([builtin]),stock),restored := IRTMergeDefinitions(stock,saved,true)
    V48Assert(IRTCalloutsIndependent(I224Find(restored.Definitions,builtin.Id)),"a bundled timer retains individual enable after restart")
    planned := IRTMConfigured([a,b,c])
    V48Assert(IRTCalloutsIndependent(planned[1]) && IRTCalloutsDisabled(planned[2]),"enable-all preserves both explicit per-timer choices")
    failed := false
    try IRTParseXML(StrReplace(IRTSerializeXML([a]),"<irisCalloutsEnabled>true</irisCalloutsEnabled>","<irisCalloutsEnabled>maybe</irisCalloutsEnabled>"))
    catch
        failed := true
    V48Assert(failed,"individual enable metadata is validated as a boolean")
}

I226IndividualCountdown() => I220WithAlarms(I226IndividualCountdownCase)
I226IndividualCountdownCase()
{
    global IRT,IRTPrefs,Audio,testClock,soundboardsEnabled
    a := I224Configured("Only this countdown"),b := I224Configured("Global countdown"),c := I224Configured("Disabled countdown")
    a.CalloutsEnabled := true,c.CalloutsEnabled := true,c.CalloutsDisabled := true
    for d in [a,b,c]
        d.Interval := 5000,d.PlaySound := false
    IRTConfigure(IRT,[a,b,c]),IRT.Enabled := true,IRT.AnchorLog := 0,IRT.Now := testClock,IRT.LastPump := testClock
    IRTPrefs.CalloutsEnabled := false,IRTPrefs.CountdownEnabled := false,IRTPrefs.AlarmsEnabled := false
    for d in IRT.Definitions
        IRTStartNow(IRT,d,testClock,"")
    IRTVTick(testClock)
    V48Assert(IRT.IndividualCallouts && Audio.Queue.Length=1 && Audio.Queue[1].TimerInstance.Def.Id==a.Id,"with all-timers off only the individually enabled timer queues a number")
    item := Audio.Queue[1]
    V48Assert(AudioItemEnabled(item) && !IRTPrefs.CalloutsEnabled,"the worker accepts the individual timer without enabling the global switch")
    PumpAudio()
    V48Assert(IsObject(Audio.Current) && item.ClipAlias!="","the individual countdown reaches the SELF_TEST audio worker")
    soundboardsEnabled := false
    V48Assert(!AudioItemEnabled(item),"individual enable never bypasses the ordinary master audio mute")
    soundboardsEnabled := true,gen := IRT.Generation,active := IRT.Active.Count
    planned := IRTIClone(IRT.Definitions),planned[1].CalloutsEnabled := false,IRTAApplyExclusions(planned)
    V48Assert(!IRT.IndividualCallouts && !AudioItemEnabled(item) && Audio.Current.Cancel,"restoring global control while global is off cancels the individual countdown")
    PumpAudio()
    V48Assert(!IsObject(Audio.Current) && IRT.Generation=gen && IRT.Active.Count=active,"mode changes close audio without resetting visual bars")
}

I226IndividualAlarm() => I220WithAlarms(I226IndividualAlarmCase)
I226IndividualAlarmCase()
{
    global IRT,IRTPrefs,Audio,testClock
    a := I224Configured("Only this alarm"),b := I224Configured("Global alarm"),c := I224Configured("Excluded alarm")
    a.CalloutsEnabled := true,c.CalloutsEnabled := true,c.CalloutsDisabled := true
    for d in [a,b,c]
        d.Interval := 0,d.PlayCountdown := false
    IRTConfigure(IRT,[a,b,c]),IRT.Enabled := true,IRT.AnchorLog := 0,IRT.Now := testClock,IRT.LastPump := testClock
    IRTPrefs.CalloutsEnabled := false,IRTPrefs.CountdownEnabled := false,IRTPrefs.AlarmsEnabled := false
    for d in IRT.Definitions
        IRTStartNow(IRT,d,testClock,"")
    IRTPump(IRT,testClock,false),IRTVTick(testClock)
    V48Assert(!IRT.Active.Count && Audio.Queue.Length=1 && Audio.Queue[1].AlarmCue.Def.Id==a.Id,"only the individual instant alarm queues even after its visual timer expired")
    item := Audio.Queue[1],PumpAudio()
    V48Assert(IsObject(Audio.Current) && AudioItemEnabled(item) && !IRTPrefs.CalloutsEnabled,"individual alarm playback does not need the global option")
    planned := IRTIClone(IRT.Definitions),planned[1].CalloutsEnabled := false,IRTAApplyExclusions(planned)
    V48Assert(!AudioItemEnabled(item) && Audio.Current.Cancel,"an expired timer's individual alarm is invalidated by a mode change")
    PumpAudio()
    V48Assert(!IsObject(Audio.Current) && item.ClipAlias="","the worker closes the invalidated individual alarm")
}

I226IndividualMaster() => V65UITimerIsolated(I226IndividualMasterCase)
I226IndividualMasterCase(path)
{
    global IRT,IRTPrefs
    try {
        a := I224Configured("Individual bulk"),b := I224Configured("Global bulk"),c := I224Configured("Excluded bulk")
        a.CalloutsEnabled := true,c.CalloutsEnabled := true,c.CalloutsDisabled := true
        IRTConfigure(IRT,[a,b,c]),IRT.Enabled := true,gen := IRT.Generation
        IRT.SoundCues := [{Def:IRT.Definitions[1]},{Def:IRT.Definitions[2]},{Def:IRT.Definitions[3]}]
        IRTMSetEnabled(false)
        V48Assert(!IRTPrefs.CalloutsEnabled && IRT.SoundCues.Length=1 && IRT.SoundCues[1].Def.Id==a.Id,"turning global off retains pending individually enabled alarms only")
        V48Assert(IRTCalloutsAllowed(a,false) && !IRTCalloutsAllowed(b,false) && !IRTCalloutsAllowed(c,false),"global off leaves just the chosen individual timer eligible")
        IRTMSetEnabled(true),IRTMSetEnabled(false)
        V48Assert(!IRTPrefs.CalloutsEnabled && IRTCalloutsIndependent(a) && IRTCalloutsDisabled(c),"global on/off retains explicit individual and disabled choices")
        V48Assert(IRT.Generation=gen && IRT.Enabled,"global changes preserve timer processing and generation")
        persisted := IRTParseXML(FileRead(path ".timers.xml","UTF-8")).Definitions
        V48Assert(IRTCalloutsIndependent(persisted[1]) && IRTCalloutsDisabled(persisted[3]),"both explicit modes remain saved after a global cycle")
        reloaded := IRTUNewState(),IRTVLoadPrefs(reloaded)
        V48Assert(!reloaded.CalloutsEnabled,"the global option itself stays off on restart")
    } finally {
        for suffix in [".timers.xml",".timers.xml.bak"]
            try FileDelete(path suffix)
    }
}

I226IndividualEditor() => V65UITimerIsolated(I226IndividualEditorCase)
I226IndividualEditorCase(path)
{
    global IRT,IRTPrefs,Audio,testClock
    previousAudio := Audio,Audio := Audio.Clone(),Audio.Queue := [],Audio.Current := "",folder := path "-sounds"
    try {
        DirCreate(folder "\Amy"),FileAppend("fixture",folder "\Amy\1.mp3"),FileAppend("fixture",folder "\Alarm.mp3")
        IRTPrefs.CountdownFolder := folder,IRTPrefs.CountdownVoices := IRTVScanFolder(folder),IRTPrefs.TimerSounds := IRTAScanSounds(folder)
        a := I224Configured("Editor individual"),b := I224Configured("Editor global")
        IRTConfigure(IRT,[a,b]),IRT.Enabled := true,IRT.AnchorLog := 0,IRT.Now := testClock,IRT.LastPump := testClock
        IRTMSetEnabled(false)
        for d in IRT.Definitions
            IRTStartNow(IRT,d,testClock,"")
        gen := IRT.Generation,instA := IRT.Active[a.Id Chr(30)],instB := IRT.Active[b.Id Chr(30)]
        IRTShowManager(),IRTURefreshManager(a.Id),e := IRTAOpenSelected()
        V48Assert(e.Controls["CalloutsMode"].Text="Use global setting","existing timers default to following global control")
        e.Controls["CalloutsMode"].Choose(2),IRTAExclusionControls(e)
        V48Assert(e.Controls["PlayCountdown"].Enabled && IRTESave(),"the Audio editor saves Enable this timer")
        V48Assert(IRTCalloutsIndependent(a) && !IRTCalloutsIndependent(b) && !IRTPrefs.CalloutsEnabled && !IRTPrefs.CalloutsBox.Value,"saving one individual choice leaves all-timers unchecked and other timers unchanged")
        V48Assert(IRT.Generation=gen && IRT.Active[instA.Key]==instA && IRT.Active[instB.Key]==instB,"saving only the callout mode preserves all active bars and schedules")
        persisted := IRTParseXML(FileRead(path ".timers.xml","UTF-8")).Definitions
        V48Assert(IRTCalloutsIndependent(persisted[1]) && !IRTCalloutsIndependent(persisted[2]),"the single selected timer's mode is persisted")
        IRTURefreshManager(a.Id),e := IRTAOpenSelected()
        V48Assert(e.Controls["CalloutsMode"].Value=2,"reopening the timer shows its individual enable")
        e.Controls["CalloutsMode"].Choose(3),IRTAExclusionControls(e)
        V48Assert(!e.Controls["PlayCountdown"].Enabled && IRTESave() && IRTCalloutsDisabled(a) && !IRTCalloutsIndependent(a),"Disable this timer replaces individual enable and disables its audio controls")
        IRTURefreshManager(a.Id),e := IRTAOpenSelected(),e.Controls["CalloutsMode"].Choose(1),IRTAExclusionControls(e)
        V48Assert(IRTESave() && !IRTCalloutsDisabled(a) && !IRTCalloutsIndependent(a) && !IRT.IndividualCallouts,"Use global setting clears both explicit modes")
    } finally {
        IRTEClose(),Audio := previousAudio,DirDelete(folder,true)
        for suffix in [".timers.xml",".timers.xml.bak"]
            try FileDelete(path suffix)
    }
}

I226IndividualFailure() => V65UITimerIsolated(I226IndividualFailureCase)
I226IndividualFailureCase(path)
{
    global IRT,testClock
    a := I224Configured("Cannot save individual"),IRTConfigure(IRT,[a]),IRT.Enabled := true,IRT.Now := testClock,IRT.LastPump := testClock
    a := IRT.Definitions[1],IRTStartNow(IRT,a,testClock,""),gen := IRT.Generation,inst := IRT.Active[a.Id Chr(30)]
    before := IRTSerializeXML(IRT.Definitions),draft := IRTIClone(a),draft.CalloutsEnabled := true,target := path ".timers.xml"
    try {
        DirCreate(target),failed := false
        try IRTECommit(a.Id,draft,before)
        catch
            failed := true
        V48Assert(failed && !IRTCalloutsIndependent(a) && !IRT.IndividualCallouts && IRTSerializeXML(IRT.Definitions)==before,"failed persistence cannot enable an individual timer")
        V48Assert(IRT.Generation=gen && IRT.Active[inst.Key]==inst,"failed persistence preserves the active visual timer")
    } finally DirDelete(target)
}

I226IndividualImport() => V65UITimerIsolated(I226IndividualImportCase)
I226IndividualImportCase(path)
{
    global IRT,IRTPrefs
    imported := path "-individual-import.xml"
    try {
        a := I224Configured("Individual imported audio"),b := I224Configured("Global imported audio"),a.CalloutsEnabled := true
        IRTConfigure(IRT,[a,b]),IRT.Enabled := true,IRTMSetEnabled(false)
        body := '<enabled>true</enabled><interval>5</interval><trigger><type>ABILITY_ACTIVATED</type><ability>Test</ability></trigger><audio>Alarm.mp3</audio><countdownVoice>Amy</countdownVoice><countdownCount>5</countdownCount>'
        xml := V65IWrap(V65IXML(a.Name,body) V65IXML(b.Name,body))
        FileAppend(xml,imported,"UTF-8"),IRTImportFile(imported,true)
        current := IRT.ById[a.Id],other := IRT.ById[b.Id]
        V48Assert(IRTCalloutsIndependent(current) && current.PlaySound && current.PlayCountdown,"a StarParse replacement retains and activates configured audio for the individually enabled timer")
        V48Assert(!IRTCalloutsIndependent(other) && !other.PlaySound && !IRTPrefs.CalloutsEnabled,"the same import leaves global-controlled audio off and never enables all-timers")
        V48Assert(IRT.IndividualCallouts,"the loaded library retains the individual eligibility cache")
        native := IRTIClone(current),native.PlaySound := false,native.PlayCountdown := false
        FileDelete(imported),FileAppend(IRTSerializeXML([native]),imported,"UTF-8"),IRTImportFile(imported,true)
        V48Assert(IRTCalloutsIndependent(IRT.ById[a.Id]) && !IRT.ById[a.Id].PlaySound && !IRT.ById[a.Id].PlayCountdown,"native per-type audio mutes remain explicit even with individual enable")
    } finally {
        try FileDelete(imported)
        for suffix in [".timers.xml",".timers.xml.bak"]
            try FileDelete(path suffix)
    }
}

; Owned temporary files/settings only. The native harness disables real playback.
I227BundledClips()
{
    folder := IRTVBundledFolder(),voices := IRTVScanFolder(folder)
    V48Assert(voices.Count=4,"download contains all four StarParse voices")
    for voice in ["Amy","Jim","Nerevar","Yolo"] {
        V48Assert(voices.Has(voice) && voices[voice].Count=10,"each bundled voice contains ten numbers")
        loop 10
            V48Assert(FileExist(voices[voice][A_Index]) && FileGetSize(voices[voice][A_Index])>0,"bundled number is present")
    }
    V48Assert(!IRTAScanSounds(folder).Count,"countdown pack does not add unrelated alarm effects")
    V48Assert(InStr(FileRead(folder "\ATTRIBUTION.txt","UTF-8"),"StarParse"),"pack retains StarParse attribution")
}

I227WithPack(callback)
{
    folder := A_Temp "\Iris227-" DllCall("GetCurrentProcessId") "-" A_TickCount
    try {
        for name in ["bundled\Amy","bundled\Jim","custom\Amy","custom\Echo"]
            DirCreate(folder "\" name)
        for name in ["bundled\Amy\1.mp3","bundled\Amy\2.mp3","bundled\Jim\1.mp3","custom\Amy\1.mp3","custom\Amy\3.mp3","custom\Echo\1.mp3","custom\Alarm.mp3"]
            FileAppend("fixture",folder "\" name)
        callback.Call(folder)
    } finally DirDelete(folder,true)
}

I227VoiceOverrides() => I227WithPack(I227VoiceOverridesCase)
I227VoiceOverridesCase(folder)
{
    voices := IRTVLibrary(folder "\custom",folder "\bundled"),p := {CountdownVoices:voices}
    V48Assert(voices.Count=3,"custom voices join the bundled library")
    V48Assert(IRTVClip(p,"Amy",1)=folder "\custom\Amy\1.mp3","custom number wins")
    V48Assert(IRTVClip(p,"Amy",2)=folder "\bundled\Amy\2.mp3","missing custom number falls back")
    V48Assert(IRTVClip(p,"Amy",3)=folder "\custom\Amy\3.mp3","extra custom numbers remain available")
    V48Assert(IRTVClip(p,"Jim",1)=folder "\bundled\Jim\1.mp3","unmodified bundled voice remains available")
    V48Assert(IRTVClip(p,"Echo",1)=folder "\custom\Echo\1.mp3","additional custom voice remains available")
    V48Assert(IRTVClip(p,"Amy",11)="" && IRTVClip(p,"../Amy",1)="","missing digits and XML paths stay silent")
    V48Assert(IRTAScanSounds(folder "\custom").Has("Alarm.mp3"),"custom alarms retain separate lookup")
}

I227FolderSelection() => I227WithPack(I227FolderSelectionCase)
I227FolderSelectionCase(folder)
{
    V48Assert(IRTVNormalizeFolder(folder "\custom\Amy")=folder "\custom","selecting Amy recognizes the sounds root")
    V48Assert(IRTVNormalizeFolder(folder "\custom")=folder "\custom","root selection remains unchanged")
    voices := IRTVLibrary(folder "\custom\Amy",folder "\bundled")
    V48Assert(voices.Has("Echo") && voices["Amy"][1]=folder "\custom\Amy\1.mp3","leaf correction includes sibling voices")
    V48Assert(IRTVNormalizeFolder(folder "\missing")="","missing selected folder is rejected")
    V48Assert(IRTVNormalizeFolder("https://example.test/voices")="" && IRTVNormalizeFolder("\\server\share")="","remote folders are not scanned")
    V48Assert(IRTVSelectedFolder(folder "\missing")=IRTVBundledFolder(),"unavailable installation uses included recordings")
}

I227BundledPreferences() => V65UITimerIsolated(I227BundledPreferencesCase)
I227BundledPreferencesCase(path)
{
    global SETTINGS_FILE
    missing := path "-missing"
    SettingsWrite(missing,SETTINGS_FILE,"IrisTimers","CountdownFolder")
    SettingsWrite("keep",SETTINGS_FILE,"Unrelated","Marker")
    fresh := IRTUNewState(),IRTVLoadPrefs(fresh)
    V48Assert(fresh.CountdownFolder=IRTVBundledFolder() && fresh.CountdownVoices.Count=4,"stale StarParse path recovers using the pack")
    V48Assert(!fresh.CalloutsEnabled && !fresh.CountdownEnabled && !fresh.AlarmsEnabled,"discovery does not enable callouts")
    V48Assert(IniRead(SETTINGS_FILE,"IrisTimers","CountdownFolder")=missing,"load never rewrites the user's chosen path")
    V48Assert(IniRead(SETTINGS_FILE,"Unrelated","Marker")="keep","unrelated settings are preserved")
    V48Assert(IRTVClip(fresh,"Amy",5)!="" && IRTVClip(fresh,"Unknown",5)="","configured voice resolves without guessing another voice")
}

I227BundledOptions() => V65UITimerIsolated(I227BundledOptionsCase)
I227BundledOptionsCase(path)
{
    global IRTPrefs,SETTINGS_FILE
    IRTPrefs.CountdownFolder := IRTVBundledFolder(),IRTPrefs.CountdownVoices := IRTVLibrary(IRTVBundledFolder())
    IRTPrefs.TimerSounds := IRTAScanSounds(IRTPrefs.CountdownFolder)
    e := IRTVOptions()
    V48Assert(InStr(e.Credit.Text,"StarParse") && InStr(e.Status.Text,"Nerevar"),"audio panel credits StarParse and lists bundled voices")
    e.Enabled.Value := 0,e.Folder.Value := path "-missing"
    V48Assert(IRTVSaveOptions() && !IRTPrefs.CalloutsEnabled,"saving fallback does not change the callout mode")
    fresh := IRTUNewState(),IRTVLoadPrefs(fresh)
    V48Assert(fresh.CountdownFolder=IRTVBundledFolder() && fresh.CountdownVoices.Count=4,"included voice path survives save and load")
    e := IRTVOptions(),e.Folder.Value := IRTVBundledFolder() "\Amy",e.Enabled.Value := 1
    V48Assert(IRTVSaveOptions() && IRTPrefs.CalloutsEnabled && IRTPrefs.CountdownFolder=IRTVBundledFolder(),"saving a voice leaf keeps all voices available")
    V48Assert(IniRead(SETTINGS_FILE,"IrisTimers","CountdownFolder")=IRTVBundledFolder(),"normalized root is saved explicitly")
}

; Native list filtering with isolated settings and timer state; no live input/audio.
I228Fixture()
{
    global IRT
    a := V65IDef("Doom","Terror From Beyond"),b := V65IDef("Doom","Other operation"),c := V65IDef("Puddle","Terror From Beyond")
    IRTConfigure(IRT,[a,b,c]),IRTShowManager()
    return IRT.Definitions
}

I228Filter(text)
{
    global IRTPrefs
    IRTPrefs.Search.Value := text
    IRTUSearchChanged(IRTPrefs.Search)
}

I228SearchFiltering() => V65UITimerIsolated(I228SearchFilteringCase)
I228SearchFilteringCase(path)
{
    global IRT,IRTPrefs
    I228Fixture(),p := IRTPrefs
    V48Assert(p.List.GetCount()=3 && p.Search.Value="","all timers shown initially")
    I228Filter("  dOoM  ")
    V48Assert(p.List.GetCount()=2,"search is trimmed and case-insensitive")
    I228Filter("Terror From Beyond")
    V48Assert(p.List.GetCount()=2,"search matches timer groups")
    I228Filter("Doom Terror")
    V48Assert(p.List.GetCount()=1 && p.List.GetText(1,2)="Doom","search can span the name and group")
    I228Filter("[not a pattern]")
    V48Assert(p.List.GetCount()=0 && InStr(p.Detail.Value,"No timers match"),"literal unmatched text has an empty state")
    V48Assert(!IsObject(IRTUSelected()) && !IRTAOpenSelected(),"empty search results cannot open a stale timer")
    IRTUSearchClear()
    V48Assert(p.Search.Value="" && p.List.GetCount()=3,"Clear restores the full list")

    IRTConfigure(IRT,[V65IDef("IP - EXPLOSION","R4 Anomaly")])
    for query in ["bomb explosion","ip - explosion"] {
        I228Filter(query)
        V48Assert(p.List.GetCount()=1 && p.List.GetText(1,2)="IP - Bomb Explosion"
            && p.List.GetText(1,5)==IRTIPBombTimerId(),"either name finds the bomb timer by its saved identity")
    }
}

I228SearchIdentity() => V65UITimerIsolated(I228SearchIdentityCase)
I228SearchIdentityCase(path)
{
    global IRT,IRTPrefs
    defs := I228Fixture(),p := IRTPrefs
    I228Filter("Doom"),p.List.ModifyCol(3,"SortDesc"),p.List.Modify(1,"Select Focus")
    id := p.List.GetText(1,5),other := p.List.GetText(2,5)
    V48Assert(IRTUSelected().Id=id,"filtered sorted row resolves its hidden identity")
    e := IRTADoubleClick(p.List,1)
    V48Assert(IsObject(e) && e.OriginalId=id && e.Tab.Value=4,"double-click opens the filtered timer's Audio tab")
    IRTEClose()
    V48Assert(IRTUToggleSelected(true),"selected filtered timer can be enabled")
    V48Assert(IRT.ById[id].Enabled && !IRT.ById[other].Enabled,"enable changes only the selected timer")
    V48Assert(p.Search.Value="Doom" && p.List.GetCount()=2 && IRTUSelected().Id=id,"refresh retains the filter and selected timer")
    IRTURefreshManager(id),IRTUSearchChanged()
    V48Assert(IRTUSelected().Id=id,"matching selection survives a search refresh")
}

I228SearchIsolation() => V65UITimerIsolated(I228SearchIsolationCase)
I228SearchIsolationCase(path)
{
    global IRT,IRTPrefs,Audio
    defs := I228Fixture(),defs[1].Enabled := true
    IRTStartNow(IRT,defs[1],1000,"")
    active := IRT.Active,generation := IRT.Generation,xml := IRTSerializeXML(IRT.Definitions),queue := Audio.Queue.Length
    I228Filter("no matches"),IRTUSearchClear(),I228Filter("Doom")
    V48Assert(IRT.Active=active && IRT.Active.Count=1 && IRT.Generation=generation,"search does not reset active timers or generation")
    V48Assert(IRTSerializeXML(IRT.Definitions)==xml && Audio.Queue.Length=queue,"search does not change definitions or audio queue")
    V48Assert(!FileExist(path ".timers.xml") && !FileExist(path),"search writes no settings or timer library")
    IRTUCloseManager(),IRTShowManager()
    V48Assert(IRTPrefs.Search.Value="Doom" && IRTPrefs.List.GetCount()=2,"reopening the manager keeps the current search")
}

; Exact placement math and a hidden Displays settings fixture. No real drag or input.
V231OverlayGrid()
{
    bounds := {L:103,T:57,R:1103,B:857}
    before := {X:129,Y:73,W:251,H:183}
    point := IPMGridPoint(before,bounds)
    V48Assert(point.X=130 && point.Y=70,"placement rounds to the shared desktop grid even when the work-area origin is off-grid")
    V48Assert(point.W=251 && point.H=183 && before.X=129 && before.Y=73,
        "snap preserves both dimensions and does not change the input rectangle")
    point := IPMGridPoint({X:1120,Y:860,W:251,H:183},bounds)
    V48Assert(point.X=850 && point.Y=670 && point.X+point.W<=bounds.R && point.Y+point.H<=bounds.B,
        "bottom-right overflow clamps to the last fitting grid point")
    point := IPMGridPoint({X:-400,Y:-400,W:251,H:183},bounds)
    V48Assert(point.X=110 && point.Y=60,"top-left overflow clamps to the first fitting desktop grid point")

    leftMonitor := {L:-1923,T:-1077,R:-3,B:3}
    point := IPMGridPoint({X:-1916,Y:-1064,W:251,H:183},leftMonitor)
    V48Assert(point.X=-1920 && point.Y=-1060,"negative monitor coordinates use the same desktop grid")
    point := IPMGridPoint({X:-1915,Y:-1065,W:251,H:183},leftMonitor)
    V48Assert(point.X=-1910 && point.Y=-1060,"halfway positions on negative monitors round toward the larger coordinate")
    point := IPMGridPoint({X:10,Y:12,W:251,H:183},leftMonitor)
    V48Assert(point.X=-260 && point.Y=-180 && point.X+point.W<=leftMonitor.R && point.Y+point.H<=leftMonitor.B,
        "signed bottom-right placement never rounds past a fitting point")
    point := IPMGridPoint({X:-1907,Y:-1064,W:2200,H:183},leftMonitor)
    V48Assert(point.X=leftMonitor.L && point.Y=-1060 && point.W=2200 && point.H=183,
        "oversized width anchors one axis without moving the other axis off its grid")
    point := IPMGridPoint({X:130,Y:78,W:1200,H:1200},bounds)
    V48Assert(point.X=bounds.L && point.Y=bounds.T && point.W=1200 && point.H=1200,
        "oversized overlays are positioned at the work-area origin without shrinking")
    point := IPMGridPoint({X:120,Y:79,W:251,H:183},bounds,16)
    V48Assert(point.X=128 && point.Y=80,"grid size uses physical screen pixels on both axes")
    point := IPMGridPoint({X:200,Y:-200,W:2,H:2},{L:103,T:57,R:107,B:61})
    V48Assert(point.X=105 && point.Y=57,"a work area without a fitting grid point can still keep the overlay reachable")

    V55Isolated(V231OverlayGridSettings)
}

V231OverlayGridSettings()
{
    global IPM, SETTINGS_FILE, SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"only the suspended diagnostic child can construct the settings fixture")
    IniWrite("keep",SETTINGS_FILE,"Unrelated","GridFixture")
    IPMLoadSettings()
    V48Assert(!IPM.SnapToGrid,"an existing INI with no snap preference remains in free-move mode")

    drag := {X:103,Y:207,W:251,H:183,MouseX:150,MouseY:260}
    cursor := {X:166,Y:272}
    point := IPMDragMovePoint(drag,cursor)
    V48Assert(point.X=119 && point.Y=219,"drag uses the unchanged grab offset when snap is off")
    resize := V53ResizeFixture("RB")
    oldSize := IPMResizePoint(resize,400,550)

    try {
        IPMOpenSettings()
        control := IPM.SnapToGridControl
        V48Assert(control.Type="CheckBox" && control.Text="Snap to grid (10 px)" && !control.Value,
            "the native checkbox identifies snapping and starts off")
        V48Assert(!DllCall("IsWindowVisible","Ptr",IPM.ConfigGui.Hwnd),"diagnostics create only a hidden Displays window")
        control.Value := 1
        IDPSnapGridChanged(control)
        V48Assert(IPM.SnapToGrid && IniRead(SETTINGS_FILE,"IrisParseDisplay","SnapToGrid","")="1",
            "the checkbox updates its movement preference and stores it in the existing INI")
        MonitorGetWorkArea(MonitorGetPrimary(),&left,&top)
        gx := Ceil((left+40)/10)*10,gy := Ceil((top+40)/10)*10
        primaryDrag := {X:gx+3,Y:gy+4,W:51,H:33,MouseX:gx+8,MouseY:gy+8}
        point := IPMDragMovePoint(primaryDrag,{X:gx+22,Y:gy+25})
        V48Assert(point.X=gx+20 && point.Y=gy+20 && point.W=51 && point.H=33,
            "the overlay moves onto the grid during the drag, preserving its size and grab offset")
        nearby := IPMDragMovePoint(primaryDrag,{X:gx+24,Y:gy+26})
        next := IPMDragMovePoint(primaryDrag,{X:gx+31,Y:gy+26})
        V48Assert(nearby.X=point.X && nearby.Y=point.Y && next.X=point.X+10 && next.Y=point.Y,
            "live cursor movements only reposition the overlay when crossing into another grid cell")
        point := IPMDragMovePoint(drag,{X:drag.MouseX,Y:drag.MouseY})
        V48Assert(point.X=drag.X && point.Y=drag.Y,"an unmoved cursor keeps the original overlay position")
        size := IPMResizePoint(resize,400,550)
        V48Assert(size.X=oldSize.X && size.Y=oldSize.Y && size.W=oldSize.W && size.H=oldSize.H,
            "enabling snap does not affect edge resizing")
    }
    finally {
        if IPMGuiAlive(IPM.ConfigGui)
            IPM.ConfigGui.Destroy()
    }

    IPM := IPMNewState(), IPMLoadSettings()
    V48Assert(IPM.SnapToGrid && !IPM.Editing && !IPM.TimerOn && !IPM.DragHooks,
        "reloading remembers snapping without enabling edit mode, timers or hooks")
    try {
        IPMOpenSettings()
        control := IPM.SnapToGridControl
        V48Assert(control.Value=1,"reopening the hidden settings reflects the saved opt-in")
        control.Value := 0
        IDPSnapGridChanged(control)
        V48Assert(!IPM.SnapToGrid && IniRead(SETTINGS_FILE,"IrisParseDisplay","SnapToGrid","")="0",
            "disabling snapping restores free movement and persists the opt-out")
        V48Assert(IniRead(SETTINGS_FILE,"Unrelated","GridFixture","")="keep","snap persists only its own preference")
    }
    finally {
        if IPMGuiAlive(IPM.ConfigGui)
            IPM.ConfigGui.Destroy()
    }
}

; Native guide windows exercise only the drawing helper. The real drag hooks
; remain suspended and no cursor, capture, or settings are changed by the test.
V236SnapGuides() => V651TimerEditIsolated(V236SnapGuidesCase)

V236SnapGuidesCase(*)
{
    global IPM,IRTPrefs,SELF_TEST
    V48Assert(SELF_TEST && A_IsSuspended,"diagnostics leave the real drag hooks suspended")
    MonitorGetWorkArea(MonitorGetPrimary(),&left,&top,&right,&bottom)
    x := Ceil((left+40)/10)*10,y := Ceil((top+40)/10)*10
    drag := {X:x+3,Y:y+4,W:51,H:33,MouseX:x+8,MouseY:y+8}
    cursor := {X:x+22,Y:y+25}
    free := IPMDragMovePoint(drag,cursor)
    V48Assert(!free.HasOwnProp("SnapBounds"),"ordinary moves do not request guides")
    IPM.SnapToGrid := true
    still := IPMDragMovePoint(drag,{X:drag.MouseX,Y:drag.MouseY})
    V48Assert(!still.HasOwnProp("SnapBounds"),"an unmoved cursor does not request guides")
    snapped := IPMDragMovePoint(drag,cursor)
    V48Assert(snapped.HasOwnProp("SnapBounds"),"a snapped move carries the destination monitor work area")
    bounds := snapped.SnapBounds
    V48Assert(bounds.L=left && bounds.T=top && bounds.R=right && bounds.B=bottom
        && snapped.X=x+20 && snapped.Y=y+20 && snapped.W=51 && snapped.H=33,
        "guide bounds and the snapped overlay share physical screen coordinates without resizing")

    ; Public diagnostics can also run on the ordinary desktop. Never draw on it.
    if !V236SnapPrivateDesktop()
        return
    meter := Gui("+ToolWindow -Caption -DPIScale"),timer := Gui("+ToolWindow -Caption -DPIScale")
    meterHwnd := meter.Hwnd,timerHwnd := timer.Hwnd,s := IPMGuideState()
    capture := DllCall("User32\GetCapture","Ptr"),focus := DllCall("User32\GetForegroundWindow","Ptr")
    beforeCursor := V236SnapCursor()
    try {
        V48Assert(IPMGuideUpdate(meterHwnd,snapped) && s.Owner=meterHwnd,"a snapped move displays both guides for its owner")
        vertical := s.Vertical.Hwnd,horizontal := s.Horizontal.Hwnd
        V236SnapGuideWindow(s.Vertical,snapped.X,top,2,bottom-top)
        V236SnapGuideWindow(s.Horizontal,left,snapped.Y,right-left,2)

        signed := {X:-1400,Y:-670,SnapBounds:{L:-1723,T:-905,R:-33,B:-19}}
        V48Assert(IPMGuideUpdate(meterHwnd,signed) && s.Vertical.Hwnd=vertical && s.Horizontal.Hwnd=horizontal,
            "moving to a signed work area reuses each native guide window")
        V236SnapGuideWindow(s.Vertical,-1400,-905,2,886)
        V236SnapGuideWindow(s.Horizontal,-1723,-670,1690,2)
        IPMGuideHide(timerHwnd),IPMGuideUpdate(timerHwnd,free)
        V48Assert(s.Owner=meterHwnd && DllCall("User32\IsWindowVisible","Ptr",vertical,"Int")
            && DllCall("User32\IsWindowVisible","Ptr",horizontal,"Int"),
            "a different owner cannot remove the meter guides")
        IRTPrefs.Drag := {Hwnd:timerHwnd}
        IRTUDragStop(IRTPrefs)
        V48Assert(!IsObject(IRTPrefs.Drag) && s.Owner=meterHwnd,"stopping another timer drag leaves the meter guides owned")
        IPM.Drag := {Hwnd:meterHwnd}
        IPMDragStop(),IPMDragStop()
        V48Assert(!IsObject(IPM.Drag),"meter stop clears its drag on repeated cleanup")
        V236SnapGuidesHidden(s,vertical,horizontal)

        V48Assert(IPMGuideUpdate(timerHwnd,snapped) && s.Owner=timerHwnd
            && s.Vertical.Hwnd=vertical && s.Horizontal.Hwnd=horizontal,
            "a later timer drag reuses the hidden meter guide windows")
        IPMDragStop()
        V48Assert(s.Owner=timerHwnd,"an idle meter stop leaves timer guides alone")
        IPMGuideUpdate(timerHwnd,free)
        V236SnapGuidesHidden(s,vertical,horizontal)
        V48Assert(IPMGuideUpdate(timerHwnd,snapped),"guides can return after a placement without snapping")
        IRTPrefs.Drag := {Hwnd:timerHwnd}
        IRTUDragStop(IRTPrefs),IRTUDragStop(IRTPrefs)
        V48Assert(!IsObject(IRTPrefs.Drag),"timer stop clears its drag on repeated cleanup")
        V236SnapGuidesHidden(s,vertical,horizontal)

        V48Assert(DllCall("User32\GetCapture","Ptr")=capture && DllCall("User32\GetForegroundWindow","Ptr")=focus,
            "guide drawing and cleanup leave mouse capture and foreground focus alone")
        afterCursor := V236SnapCursor()
        if IsObject(beforeCursor)
            V48Assert(IsObject(afterCursor) && beforeCursor.X=afterCursor.X && beforeCursor.Y=afterCursor.Y,
                "guide drawing leaves the queryable cursor in place")
    }
    finally {
        IPMGuideHide()
        meter.Destroy(),timer.Destroy()
    }
}

V236SnapPrivateDesktop()
{
    thread := DllCall("Kernel32\GetCurrentThreadId","UInt"),name := Buffer(512,0),length := 0
    desktop := DllCall("User32\GetThreadDesktop","UInt",thread,"Ptr")
    return desktop && DllCall("User32\GetUserObjectInformationW","Ptr",desktop,"Int",2,"Ptr",name,
        "UInt",name.Size,"UInt*",&length,"Int") && InStr(StrGet(name,"UTF-16"),"IrisDiagnostic_")=1
}

V236SnapCursor()
{
    point := Buffer(8,0)
    return DllCall("User32\GetCursorPos","Ptr",point,"Int") ? {X:NumGet(point,0,"Int"),Y:NumGet(point,4,"Int")} : ""
}

V236SnapGuideWindow(gui,x,y,w,h)
{
    hwnd := gui.Hwnd,rect := Buffer(16,0)
    V48Assert(DllCall("User32\IsWindowVisible","Ptr",hwnd,"Int")
        && DllCall("User32\GetWindowRect","Ptr",hwnd,"Ptr",rect,"Int"),"guide is a visible native window on the private desktop")
    V48Assert(NumGet(rect,0,"Int")=x && NumGet(rect,4,"Int")=y
        && NumGet(rect,8,"Int")=x+w && NumGet(rect,12,"Int")=y+h,"guide has exact screen-pixel bounds")
    style := DllCall("User32\GetWindowLongW","Ptr",hwnd,"Int",-20,"UInt"),alpha := 0,flags := 0
    V48Assert((style & 0x080800A8)=0x080800A8,"guide is click-through, layered, non-activating, topmost and a tool window")
    V48Assert(gui.BackColor="FF3333" && DllCall("User32\GetLayeredWindowAttributes","Ptr",hwnd,"Ptr",0,
        "UChar*",&alpha,"UInt*",&flags,"Int") && (flags & 2) && alpha=225,"guide draws the intended red at its configured opacity")
}

V236SnapGuidesHidden(state,vertical,horizontal)
{
    V48Assert(!state.Owner && !DllCall("User32\IsWindowVisible","Ptr",vertical,"Int")
        && !DllCall("User32\IsWindowVisible","Ptr",horizontal,"Int"),"cleanup hides both native guides and releases their logical owner")
}

V237IPWallState(mode := "836045448953652",area := "833571547775799",defs := "")
{
    s := IRTNewState(IsObject(defs) ? defs : IRTBDefinitions())
    s.Enabled := true,s.AreaId := area,s.ModeId := mode,s.Self := "@Timer Tester#65"
    V65BObserve(s,V65BEv("Enter"),1000)
    return s
}

V237IPWallCast(s,at,instance := "100")
{
    V65BObserve(s,V65BEv("Activate","IP-CPT {4494653210492928}:" instance,"=","4471271408533504"),at)
}

V237IPWallMark(s,at,target := "@Timer Tester#65",effect := "4471271408533778",instance := "100")
{
    V65BObserve(s,V65BEv("Other","IP-CPT {4494653210492928}:" instance,target,"4471271408533504",effect,"836045448945477"),at)
}

V237IPWallPhaseEnd(s,at)
{
    V65BObserve(s,V65BEv("Other","IP-CPT {4494653210492928}:100","=",
        "4471627890819072","4471627890819336","836045448945478"),at)
}

V237IPGrenadeSequence()
{
    s := V237IPWallState()
    expected := ["","","Back wall","Side wall","Exit","","","Side wall","Back wall","Entrance","","","","",""]
    anchors := [20000,44000,56000,68000,80000,178000,190000,202000,214000,226000,324000,336000,348000,360000,372000]
    for wave,at in anchors {
        if wave=6 || wave=11
            V237IPWallPhaseEnd(s,at-800)
        V237IPWallCast(s,at)
        V237IPWallCast(s,at)
        V237IPWallMark(s,at+100,"@Other Target#66","4471271408533794")
        V48Assert(s.Active.Count=0 && s.BuiltinState["ipcptGrenades"].Wave=wave,
            "one wave per cast and no warning before the first Major marker")
        V237IPWallMark(s,at+300)
        name := expected[wave]="" ? "" : "IP - Grenade: " expected[wave] " unsafe"
        if name!=""
            V65BDue(s,name,at+8800,"wall warning starts with the first Major marker")
        V237IPWallMark(s,at+1400,"@Other Target#66")
        V48Assert(s.Active.Count=(name="" ? 0 : 1),"the second target never adds another wall warning")
        if name!=""
            V65BDue(s,name,at+8800,"late second target does not extend the fuse")
    }
    V237IPWallPhaseEnd(s,383000)
    V48Assert(s.BuiltinState["ipcptGrenades"].Valid,"normal Observation ends preserve wave numbering")
}

V237IPGrenadeGuards()
{
    for mode in ["836045448953651","836045448953654",""] {
        s := V237IPWallState(mode)
        V237IPWallCast(s,20000),V237IPWallMark(s,20300)
        V48Assert(!s.BuiltinState.Has("ipcptGrenades") && s.Active.Count=0,"no wall sequence outside eight-player Veteran")
    }
    s := V237IPWallState("836045448953652","999")
    V237IPWallCast(s,20000),V237IPWallMark(s,20300)
    V48Assert(!s.BuiltinState.Has("ipcptGrenades"),"boss and effect IDs outside R-4 do not arm this warning")

    s := V237IPWallState()
    V237IPWallMark(s,20300),V237IPWallCast(s,44000),V237IPWallMark(s,44300)
    V48Assert(!s.BuiltinState["ipcptGrenades"].Valid && s.Active.Count=0,"an orphan marker cannot renumber a partial pull")
    s := V237IPWallState()
    V237IPWallCast(s,20000),V237IPWallCast(s,44000),V237IPWallCast(s,68000),V237IPWallMark(s,68300)
    V48Assert(!s.BuiltinState["ipcptGrenades"].Valid && s.Active.Count=0,"a missed wave gap cannot shift the unsafe-wall map")
    s := V237IPWallState()
    V237IPWallCast(s,20000),V237IPWallCast(s,44000,"200"),V237IPWallMark(s,44300,"@Timer Tester#65","4471271408533778","200")
    V48Assert(!s.BuiltinState["ipcptGrenades"].Valid,"a different boss instance cannot continue the old sequence")

    s := V237IPWallState()
    V237IPWallCast(s,20000),V237IPWallCast(s,44000),V237IPWallCast(s,56000)
    V65BObserve(s,V65BEv("Death"),56100)
    V237IPWallMark(s,56300,"@Other Target#66")
    V65BDue(s,"IP - Grenade: Back wall unsafe",64800,"one logged target starts the timer even when the recorder is dead")
    V65BObserve(s,V65BEv("Exit"),56400)
    V48Assert(!s.BuiltinState.Has("ipcptGrenades") && s.Active.Count=0,"local combat exit clears wall timer and numbering")
    V65BObserve(s,V65BEv("Enter"),70000)
    V237IPWallCast(s,90000,"200"),V237IPWallMark(s,90300,"@Other Target#66","4471271408533778","200")
    V48Assert(s.BuiltinState["ipcptGrenades"].Wave=1 && s.Active.Count=0,"a fresh attempt starts again at wave one")
}

V237IPGrenadeLibrary()
{
    library := IRTDefaultLibrary(),defs := library.Definitions,index := V652TimerDefaultsIndex(defs)
    old := index["R4 Anomaly" Chr(31) "IP - Big Grenade"]
    V48Assert(!old.Builtin && old.Trigger.AbilityGuid="4605008100196352"
        && old.Trigger.EffectGuid="4605008100196669" && old.Interval=8500,
        "the original imported grenade timer keeps its identity and trigger")
    folder := "Built-in: R4 Anomaly" Chr(31)
    for side in ["Back wall","Side wall","Exit","Entrance"] {
        id := folder "IP - Grenade: " side " unsafe",d := index[id]
        V48Assert(d.Builtin && d.Enabled && d.Supported && d.Scope="COMBAT" && d.Interval=8500
            && !d.PlaySound && d.PlayCountdown && d.CountdownVoice="Yolo" && d.CountdownCount=5 && d.CountdownVolume=41
            && IRTCalloutsAllowed(d,true) && !IRTCalloutsAllowed(d,false),"walls have the stock Yolo preset and follow global callouts")
    }
    previous := IRTIClone(d),previous.CountdownVoice := "",previous.CountdownCount := 0,previous.CountdownVolume := 0
    parsed := IRTParseXML(IRTSerializeXML([previous]),IRTBDefinitions())
    restored := IRTMergeDefinitions(IRTBDefinitions(),parsed,true).Definitions
    IRTRepairBundled(restored)
    loaded := V652TimerDefaultsIndex(restored)[d.Id]
    V48Assert(loaded.CountdownVoice="Yolo" && loaded.CountdownCount=5 && loaded.CountdownVolume=41,
        "a library saved with the original unconfigured preset picks up Yolo on reload")
    previous.PlayCountdown := false
    IRTIPApplyWallCountdownPreset(previous)
    V48Assert(previous.CountdownVoice="Yolo" && !previous.PlayCountdown,"the voice preset preserves an existing countdown mute")

    draft := IRTIClone(d),draft.Enabled := false,draft.CalloutsEnabled := true
    draft.CountdownVoice := "Amy",draft.CountdownCount := 5,draft.CountdownVolume := 40
    saved := IRTEPrepare(defs,d.Id,draft)
    parsed := IRTParseXML(IRTSerializeXML(saved.Definitions),IRTBDefinitions())
    restored := IRTMergeDefinitions(IRTBDefinitions(),parsed,true).Definitions
    IRTRepairBundled(restored)
    loaded := V652TimerDefaultsIndex(restored)[d.Id]
    V48Assert(!loaded.Enabled && IRTCalloutsIndependent(loaded) && loaded.CountdownVoice="Amy"
        && loaded.CountdownCount=5 && loaded.CountdownVolume=40 && loaded.Interval=8500 && loaded.Scope="COMBAT",
        "saved preferences round-trip while the built-in cadence stays fixed")
}

; Optional local replay of sanitized raw combat-log frames. Portable runs do no archive IO.
V237IPGrenadeArchive()
{
    path := EnvGet("IRIS_IP_CPT_REPLAY")
    if path=""
        return
    stream := FileOpen(path,"r","UTF-8")
    V48Assert(IsObject(stream),"the supplied sanitized IP-CPT archive fixture opens")
    pulls := [],rows := []
    try {
        while !stream.AtEOF {
            line := RTrim(stream.ReadLine(),"`r`n")
            if line="---" {
                if rows.Length
                    pulls.Push(rows),rows := []
            } else if line!="" {
                ev := IPParseLine(line)
                V48Assert(IsObject(ev),"Iris parses each sanitized raw archive frame")
                rows.Push(ev)
            }
        }
    }
    finally stream.Close()
    if rows.Length
        pulls.Push(rows)
    V48Assert(pulls.Length>=2,"the fixture contains at least two independent archived IP-CPT pulls")
    for rows in pulls
        V237IPGrenadeArchivePull(rows)
}

V237IPGrenadeArchivePull(rows)
{
    static directions := Map(3,"Back wall",4,"Side wall",5,"Exit",8,"Side wall",9,"Back wall",10,"Entrance")
    V48Assert(rows.Length=45,"a full archive pull has fifteen casts and thirty Major markers")
    s := IRTNewState(IRTBDefinitions())
    s.Enabled := true,s.Self := "@Replay Owner#1000"
    s.AreaId := "833571547775799",s.ModeId := "836045448953652"
    V65BObserve(s,V65BEv("Enter",s.Self),rows[1].RawMs-1000)
    wave := 0,marks := 0,firstMark := 0,marked := "",warnings := 0
    for ev in rows {
        V48Assert(ev.AbilityId="4471271408533504" && IPBNpcId(ev.Source)="4494653210492928",
            "archive frame has the exact HM boss and grenade ability")
        if ev.Kind="Activate" && ev.EffectId="836045448945479" {
            V48Assert(wave=0 || marks=2,"each completed wave has two Major markers")
            wave+=1,marks := 0,firstMark := 0,marked := ""
        } else {
            V48Assert(wave>0 && marks<2 && ev.ActionId="836045448945477" && ev.EffectId="4471271408533778"
                && ev.Target.Kind="Player" && ev.Target.Key!=marked,"Major applications follow the cast and identify two distinct targets")
            marks+=1
            if marks=1
                firstMark := ev.RawMs,marked := ev.Target.Key
        }
        V65BObserve(s,ev,ev.RawMs)
        V48Assert(s.Mode="HM" && s.Size="Eight" && IRTBBossAlias(s.Boss)="ipcpt",
            "raw archive frames run through the normal HM IP-CPT timer context")
        active := ""
        for _,item in s.Active {
            if InStr(item.Def.Name,"IP - Grenade: ")=1 {
                V48Assert(!IsObject(active),"a wave never starts duplicate grenade warnings")
                active := item
            }
        }
        if !marks || !directions.Has(wave) {
            V48Assert(!IsObject(active),"casts and unlisted waves never display wall warnings")
            continue
        }
        expected := "IP - Grenade: " directions[wave] " unsafe"
        V48Assert(IsObject(active) && active.Def.Name=expected && active.Start=firstMark && active.Due=firstMark+8500,
            "archived wave " wave " has the expected warning and the second marker leaves its deadline anchored")
        warnings += marks=1
    }
    V48Assert(wave=15 && marks=2 && warnings=6,"a complete pull produces six wall warnings in the observed order")
}

V239IPBombPhase(withReturn := true, lastCastOffset := 50000, mode := "836045448953652", editedDuration := 30000)
{
    defs := IRTDefaultLibrary().Definitions
    for d in defs {
        if d.Id=IRTIPBombTimerId() {
            d.Interval := editedDuration
            d.CountdownVoice := "Amy",d.CountdownCount := 5,d.CountdownVolume := 100
            d.PlayCountdown := true,d.CalloutsEnabled := true
        }
    }
    s := V237IPWallState(mode,"833571547775799",defs)
    for at in [10000,34000,46000,58000,70000]
        V237IPWallCast(s,at)
    anchor := 168000
    if withReturn
        V237IPWallPhaseEnd(s,anchor)
    for at in [2000,14000,26000,38000,lastCastOffset]
        V237IPWallCast(s,anchor+at)
    return {Engine:s,Anchor:anchor}
}

V239IPBombDeadlines()
{
    p := V239IPBombPhase(),s := p.Engine,key := IRTIPBombEstimateKey(),start := p.Anchor+58600
    V65BPump(s,start-1)
    V48Assert(!s.Active.Has(key),"no estimated timer before the expected fuse starts")
    V65BPump(s,start)
    est := s.Active[key]
    V48Assert(est.Start=start && est.Due=p.Anchor+88600 && est.Name="IP - Bomb Explosion (estimated)",
        "set three has a single, explicitly estimated deadline")
    V48Assert(est.Def==s.ById[IRTIPBombTimerId()] && est.Def.CountdownVoice="Amy" && est.Def.CalloutsEnabled,
        "the estimate shares the existing timer's audio settings")
    V48Assert(est.Def.Name="IP - EXPLOSION" && InStr(IRTSerializeXML([est.Def]),"<name>IP - EXPLOSION</name>"),
        "the displayed label keeps the saved bomb timer name and link target")
    V65BObserve(s,V65BEv("Death"),start+1000)
    V48Assert(s.Active.Has(key),"a recorder's death alone keeps the estimate running")
    V65BObserve(s,V65BEv("Activate","Intrusion ID Unit {4470451069779968}:2","=","4470747422523392"),start+1500)
    exact := s.Active[IRTIPBombTimerId() Chr(30)]
    V48Assert(!s.Active.Has(key) && exact.Start=start+1500 && exact.Due=start+31500 && exact.Name="IP - Bomb Explosion",
        "a real cast replaces the estimate and keeps its precise 30-second fuse")
    start4 := p.Anchor+103600
    V65BPump(s,start4)
    V48Assert(s.Active[key].Due=p.Anchor+133600,"set four remains on the same phase clock")
    for idx,type in ["4470442479845376","4470442479845376","4470446774812672","4470455364747264"] {
        at := start4+idx*2000
        V65BObserve(s,V65BEv("Death","@Other Player#101","Intrusion ID Unit {" type "}:" idx),at)
        V48Assert(s.Active.Has(key)=(idx<4),"only three distinct bomb types resolve the whole set")
    }
}

V239IPBombDeadlineGuards()
{
    key := IRTIPBombEstimateKey()
    for p in [V239IPBombPhase(false), V239IPBombPhase(true,54000), V239IPBombPhase(true,50000,"836045448953651"),
        V239IPBombPhase(true,50000,"836045448953652",31000)] {
        V65BPump(p.Engine,p.Anchor+58600)
        V48Assert(!p.Engine.Active.Has(key),"scope, phase evidence and a stock timer are required")
    }
    p := V239IPBombPhase(),s := p.Engine
    V65BPump(s,p.Anchor+58600)
    V65BObserve(s,V65BEv("Exit"),p.Anchor+61000)
    V65BPump(s,p.Anchor+103600)
    V48Assert(!s.Active.Has(key) && !s.BuiltinState.Has("ipcptBombs"),"combat exit drops the current and future estimates")
    p := V239IPBombPhase(),s := p.Engine
    V65BPump(s,p.Anchor+58600)
    V65BObserve(s,V65BEv("Damage","Intrusion ID Unit {4470442479845376}:2","@Other Player#101","4470747422523392"),
        p.Anchor+88400)
    V48Assert(!s.Active.Has(key),"an observed blast stops any remaining estimate")
}

V243IPCPEvent(f,at,src,dst,ability,action,effect,tail := "")
    => V7878FHFeed(f,V671FloorLine(at,src,dst,ability,action,effect,tail),++f.Record)

V243IPCPFixture(late := false)
{
    f := V7878FHSegment("R4-IP",90000),f.Record := 0,f.Observation := 120000,f.Return := 247500
    f.Data.AreaId := f.Segment.AreaId := "833571547775799"
    f.Data.ModeId := f.Segment.ModeId := "836045448953652"
    f.Segment.BossName := "IP-CPT"
    boss := "IP-CPT {4494653210492928}:10"
    V243IPCPEvent(f,f.Observation,boss,"=","4471627890819072","836045448945477","4471627890819336")
    if late {
        V243IPCPEvent(f,f.Return,boss,"=","4471627890819072","836045448945478","4471627890819336")
        V243IPCPEvent(f,f.Return+34000,boss,"=","4471627890819072","836045448945477","4471627890819336")
    }
    return f
}

V243IPCPBomb(bomb,lateSet := 4)
{
    id := ["4470442479845376","4470446774812672",lateSet=3 ? "4470451069779968" : "4470455364747264"][bomb]
    return "Intrusion ID Unit {" id "}:" (20+bomb)
}

V243IPCPClick(f,at,name,color,canceled := false)
{
    static positions := Map("Blue","-131,-44", "Green","-131,11", "Purple","-187,11", "Red","-187,-44", "Other","-158,-16")
    actor := "@" name "#33|(" positions[color] ",411.95,0)|(100/100)"
    return V243IPCPEvent(f,at,actor,"=","810799631171584","836045448945472",canceled ? "836045448945481" : "836045448945479")
}

V243IPCPDrop(f,at,bomb,lateSet := 4)
    => V243IPCPEvent(f,at,V243IPCPBomb(bomb,lateSet),"=","4470429594943488","836045448945478","4470429594943770")

V243IPCPBlast(f,at,bomb := 1,lateSet := 4)
    => V243IPCPEvent(f,at,V243IPCPBomb(bomb,lateSet),"@Raid Member#101","4470747422523392","836045448945477","836045448945501"," (0)")

V243IPCPRows(f)
    => IFHView(f.Segment,IFHModel(f.Segment),false,f.Segment.Last).Rows

V243IPCPFeedback()
{
    f := V243IPCPFixture(),V243IPCPBlast(f,190000),V243IPCPBlast(f,190001,2),V243IPCPBlast(f,235000)
    rows := V243IPCPRows(f)
    V48Assert(rows.Length=2 && rows[1].Text=="Bomb exploded (1st set)`nNo color clicks recorded"
        && rows[2].Text=="Bomb exploded (2nd set)`nNo color clicks recorded","a real blast gives one report per set without requiring clicks")

    f := V243IPCPFixture(true),t := f.Return+58600
    V243IPCPClick(f,t+500,"Opener","Blue"),V243IPCPClick(f,t+3100,"Middle","Red")
    V243IPCPClick(f,t+6200,"Last","Purple"),V243IPCPDrop(f,t+6800,1)
    V243IPCPClick(f,t+7490,"Canceled","Purple"),V243IPCPClick(f,t+7650,"Canceled","Purple",true)
    V243IPCPClick(f,t+8400,"Récover","Red"),V243IPCPClick(f,t+11000,"Next","Green")
    V243IPCPClick(f,t+25000,"Slow Toon","Blue"),V243IPCPBlast(f,t+30200,3,3)
    rows := V243IPCPRows(f)
    V48Assert(rows.Length=1 && rows[1].Text=="Bomb exploded (3rd set)`nIncorrect click: Récover (Red)`nSlowest click: Slow Toon (Blue)",
        "the third set reports the verified wrong opener and the click after the longest recorded gap")
    layout := IXFRowParts(rows[1],"Progression Assistance")
    V48Assert(layout.Label==rows[1].Text && layout.Detail="","both click labels stay with their names on their own lines")
    IFHRetire(f.Segment)
    V48Assert(V243IPCPRows(f)[1].Text==rows[1].Text,"completed pulls keep the same Progression Assistance finding")

    f := V243IPCPFixture(),t := f.Observation+40000
    V243IPCPClick(f,t+120,"Opener","Blue"),V243IPCPClick(f,t+3000,"Middle","Green")
    V243IPCPClick(f,t+6000,"Wrong Toon","Blue"),V243IPCPClick(f,t+9000,"Last","Purple"),V243IPCPDrop(f,t+9600,1)
    V243IPCPClick(f,t+11000,"Green Start","Green"),V243IPCPClick(f,t+13800,"Purple Middle","Purple")
    V243IPCPClick(f,t+16800,"Green End","Green"),V243IPCPDrop(f,t+17400,2),V243IPCPBlast(f,t+30000,2)
    V48Assert(InStr(V243IPCPRows(f)[1].Text,"Incorrect click: Wrong Toon (Blue)`n"),"completion evidence identifies an incorrect middle press and permits a nonconsecutive repeat")
    f.Segment.ModeId := "836045448953653"
    V48Assert(!IFHSupported(f.Segment),"IP-CPT color findings are scoped to eight-player Veteran")
}

V243IPCPFourthSet()
{
    f := V243IPCPFixture(true),t := f.Return+103600
    V243IPCPClick(f,t+1000,"Blue Opener","Blue"),V243IPCPDrop(f,t+6000,1)
    V243IPCPClick(f,t+9000,"Green Opener","Green"),V243IPCPDrop(f,t+14000,2)
    V243IPCPClick(f,t+16000,"Unrelated Use","Other"),V243IPCPBlast(f,t+30000,3)
    V48Assert(!V243IPCPRows(f).Length,"clicks on the first two codes do not count as a third-bomb attempt")
    V243IPCPBlast(f,t+30001,2)
    V48Assert(V243IPCPRows(f).Length=1 && InStr(V243IPCPRows(f)[1].Text,"Bomb exploded (4th set)"),
        "another bomb exploding in the same set is reported even when the third bomb is ignored")

    f := V243IPCPFixture(true)
    V243IPCPDrop(f,t+6000,1),V243IPCPDrop(f,t+14000,2)
    V243IPCPClick(f,t+16000,"Third Attempt","Red"),V243IPCPBlast(f,t+30000,3)
    V48Assert(V243IPCPRows(f)[1].Text=="Bomb exploded (4th set)`nIncorrect click: None confirmed`nOnly click: Third Attempt (Red)",
        "a logged attempt on the third code lifts the set-four suppression")

    f := V243IPCPFixture(true),V243IPCPDrop(f,t+21000,3),V243IPCPBlast(f,t+30000,3)
    V48Assert(V243IPCPRows(f)[1].Text=="Bomb exploded (4th set)`nNo color clicks recorded",
        "an observed third shield drop proves an attempt even when its clicks are outside the recording")

    f := V243IPCPFixture(true)
    V243IPCPEvent(f,t+18000,V243IPCPBomb(2),"","4470747422523392","836045448945472","836045448945482")
    V243IPCPClick(f,t+20100,"Third Attempt","Red"),V243IPCPBlast(f,t+30000,3)
    V48Assert(V243IPCPRows(f).Length=1,"a click after the second bomb stopped can prove an attempt without a shield-drop line")
}

V243IPCPNativeColor()
{
    line := V671FloorLine(161000,"@Tést Toon#33|(-187,11,411.95,0)|(100/100)","=",
        "810799631171584","836045448945472","836045448945479")
    e := IPParseLine(line)
    result := {Actors:Map(1,e.Source,2,e.Target),Descriptors:Map(1,[e.Ability,e.AbilityId,e.Kind,e.Effect,e.ActionId,e.EffectId,e.AreaId,e.ModeId]),Extras:Map()}
    r := [161000,1,0,0,line,99,161000,1,2,1,e.Amount,e.Effective,e.EffectiveSource,e.Crit,e.ValueOK,e.TargetAlive,
        e.SourceHP.Known,e.SourceHP.Current,e.SourceHP.Maximum,e.TargetHP.Known,e.TargetHP.Current,e.TargetHP.Maximum,
        e.Threat.Expected,e.Threat.Known,e.Threat.Invalid,e.Threat.Value,e.Immune,e.FullAbsorb,"","",0,"",-1]
    native := IANativeRow(r,result)
    V48Assert(e.IPCPColor=="Purple" && e.Source.Name=="Tést Toon" && native.IPCPColor==e.IPCPColor,
        "native saved-pull hydration uses the same console color as live parsing")

    f := V243IPCPFixture(true)
    bad := V7878FHSegment("R4-IP",f.Return),bad.Segment.AreaId := f.Segment.AreaId,bad.Segment.ModeId := f.Segment.ModeId
    bad.Record := 0
    V243IPCPEvent(bad,f.Return+89000,"IP-CPT {4494653210492928}:10","=","4471627890819072","836045448945477","4471627890819336")
    V243IPCPBlast(bad,f.Return+133700,3)
    V48Assert(!V243IPCPRows(bad).Length,"an unanchored later observation cannot be numbered as the start of a pull")
}

V252IPCPStackDeaths()
{
    f := V243IPCPFixture(),t := f.Observation+2000
    inferno := "Inferno Enforcer {4480200645541888}:31",overload := "Overload Enforcer {4480196350574592}:32"
    boss := "IP-CPT {4494653210492928}:10"
    alive := "@Aria#33|(0,0,0,0)|(90/100)",dead := "@Aria#33|(0,0,0,0)|(0/100)"
    infernoAbility := "4480204940509184",infernoStack := "4480204940509454"
    overloadAbility := "4480209235476480",overloadStack := "4480209235476742"
    modify := "836045448953666",apply := "836045448945477",remove := "836045448945478"
    death := "836045448945493",event := "836045448945472"
    V243IPCPEvent(f,t,inferno,alive,infernoAbility,apply,infernoStack," (1 charges {836045448953667})")
    V243IPCPEvent(f,t+10,inferno,alive,infernoAbility,modify,infernoStack," (3 charges {836045448953667})")
    V243IPCPEvent(f,t+20,overload,alive,overloadAbility,modify,overloadStack," (4 charges {836045448953667})")
    V243IPCPEvent(f,t+29,inferno,dead,infernoAbility,modify,infernoStack," (2 charges {836045448953667})")
    V243IPCPEvent(f,t+30,inferno,dead,infernoAbility,remove,infernoStack)
    V48Assert(!V243IPCPRows(f).Length,"high stacks and a zero-HP cleanup alone do not create a death finding")
    V243IPCPEvent(f,t+1030,inferno,dead,"0",event,death)
    V243IPCPEvent(f,t+1031,overload,dead,"0",event,death)
    rows := V243IPCPRows(f)
    V48Assert(rows.Length=1 && rows[1].Text=="Aria high Inferno stacks (3) on death",
        "the matching droid's count survives death cleanup and both counts reset after the death")

    V243IPCPEvent(f,t+4000,overload,alive,overloadAbility,modify,overloadStack," (4 charges {836045448953667})")
    V243IPCPEvent(f,t+4500,"",dead,overloadAbility,remove,overloadStack)
    V243IPCPEvent(f,t+4501,overload,dead,"0",event,death)
    rows := V243IPCPRows(f)
    V48Assert(rows.Length=2 && rows[2].Text=="Aria high Overload stacks (4) on death",
        "Overload uses its own current count and accepts cleanup with an omitted source")
    V48Assert(IXFRowParts(rows[2],"Progression Assistance").Label==rows[2].Text,
        "the overlay receives one concise row")

    V243IPCPEvent(f,t+5000,overload,alive,overloadAbility,modify,overloadStack," (2 charges {836045448953667})")
    V243IPCPEvent(f,t+5001,overload,dead,"0",event,death)
    V243IPCPEvent(f,t+5500,inferno,alive,infernoAbility,modify,infernoStack," (4 charges {836045448953667})")
    V243IPCPEvent(f,t+5501,inferno,alive,infernoAbility,remove,infernoStack)
    V243IPCPEvent(f,t+5502,inferno,dead,"0",event,death)
    V243IPCPEvent(f,t+6000,inferno,alive,infernoAbility,modify,infernoStack," (3 charges {836045448953667})")
    V243IPCPEvent(f,t+6001,boss,dead,"0",event,death)
    V243IPCPEvent(f,t+8000,inferno,dead,"0",event,death)
    V243IPCPEvent(f,t+9500,inferno,alive,infernoAbility,modify,infernoStack," (3 charges {836045448953667})")
    V243IPCPEvent(f,t+10000,inferno,dead,infernoAbility,remove,infernoStack)
    V243IPCPEvent(f,t+12000,inferno,dead,"0",event,death)
    V48Assert(V243IPCPRows(f).Length=2,"low, cleared, unrelated or stale counts do not produce findings")
    IFHRetire(f.Segment)
    V48Assert(V243IPCPRows(f)[2].Text==rows[2].Text,"completed pulls keep the stack death finding")
}

V253IPCPExposureEvent(f,at,src,dst,ability,action,effect,tail := "")
{
    ev := V243IPCPEvent(f,at,src,dst,ability,action,effect,tail)
    IDTObserve(f.Segment,ev,at)
    if ev.Kind="Death"
        IDTFreeze(f.Segment,ev,{Key:ev.Target.Key,At:at,Record:ev.RecordId})
    ev.Analysis := {Accepted:true,At:at,Seq:ev.RecordId+1000}
    f.ReviewRows.Push(ev)
}

V253IPCPExposureFixture(stacks := 4,damage := 39782,killer := "",floor := "4471254228664580")
{
    f := V243IPCPFixture(),at := f.Observation+12000
    f.ReviewRows := []
    alive := "@Aria#85|(0,0,0,0)|(321717/391638)",dead := "@Aria#85|(0,0,0,0)|(0/391638)"
    V253IPCPExposureEvent(f,at-2000,alive,"=","4472005847941120","836045448953666","4472005847941376",
        " (" stacks " charges {836045448953667})")
    V253IPCPExposureEvent(f,at-111,"@Healer#86",alive,"3412162538110976","836045448945477","836045448945500"," (5018)")
    V253IPCPExposureEvent(f,at-4," {4475974397722624}:10",dead,floor,"836045448945477","836045448945501"," (" damage ")")
    V253IPCPExposureEvent(f,at-2,dead,"=","4472005847941120","836045448945478","4472005847941376")
    V253IPCPExposureEvent(f,at,killer,dead,"0","836045448945472","836045448945493")
    return f
}

V253IPCPExposureDeaths()
{
    f := V253IPCPExposureFixture(),seg := f.Segment,model := IFHModel(seg)
    V48Assert(!IFHView(seg,model,true,seg.Last+1000).Rows.Length,"the live note waits for the death recap to settle")
    rows := IFHView(seg,model,true,seg.Last+2100).Rows
    V48Assert(rows.Length=1 && rows[1].Text=="Aria possible 5 stack death",
        "four recorded stacks, a zero-HP cleanup, and a floor hit below recent HP produce the requested note")
    pull := IPRCompact(seg),pull.DeathRecaps := seg.DeathCapture.Cases
    review := IFHReview({BaseVerified:true,Demo:false,ReviewPull:pull,Rows:f.ReviewRows},pull)
    rows := IFHView(seg,review,false,seg.Last).Rows
    V48Assert(rows.Length=1 && rows[1].Text=="Aria possible 5 stack death",
        "saved-pull review finds the same result across different event sequence numbers")

    V253IPCPExposureEvent(f,seg.Last-50,"Pulse Turret {4471288588402688}:20",
        "@Aria#85|(0,0,0,0)|(0/391638)","4471606415982592","836045448945477","836045448945501"," (320000)")
    V48Assert(!V243IPCPRows(f).Length,"late accepted damage can explain the death and remove the inferred note")

    f := V253IPCPExposureFixture(4,320000,"IP-CPT {4494653210492928}:10")
    V48Assert(!V243IPCPRows(f).Length,"an exact NPC death source does not get an inferred exposure note")
    f := V253IPCPExposureFixture(4,335000)
    V48Assert(!V243IPCPRows(f).Length,"a normal lethal floor hit does not get an exposure note")
    f := V253IPCPExposureFixture(3)
    V48Assert(!V243IPCPRows(f).Length,"three recorded exposure stacks do not qualify")
    f := V253IPCPExposureFixture(4,39782,"","4471262818598912")
    V48Assert(!V243IPCPRows(f).Length,"an unrelated hit does not qualify as a floor hit")
}

V254IPCPGrenadeSplash()
{
    f := V243IPCPFixture(),at := f.Observation+35000,blast := at+8500
    boss := "IP-CPT {4494653210492928}:10",cast := "4471271408533504"
    major := "4471271408533778",minor := "4471271408533794"
    apply := "836045448945477",remove := "836045448945478",damage := "836045448945501"
    mira := "@Mira#43",lena := "@Lena#44",finn := "@Finn#45",nox := "@Nox#46",aria := "@Aria#47"
    V243IPCPEvent(f,at,boss,mira,cast,apply,major)
    V243IPCPEvent(f,at,boss,lena,cast,apply,major)
    V243IPCPEvent(f,at,boss,aria,cast,apply,minor)
    V243IPCPEvent(f,blast,boss,aria,minor,apply,damage," (20000)")
    V243IPCPEvent(f,blast,boss,mira,major,apply,damage," (100000)")
    V243IPCPEvent(f,blast,boss,nox,major,apply,damage," (100000)")
    V243IPCPEvent(f,blast,boss,nox,major,apply,damage," (100000)")
    V243IPCPEvent(f,blast,boss,finn,major,apply,damage," (100000)")
    V243IPCPEvent(f,blast,boss,finn,minor,apply,damage," (20000)")
    V243IPCPEvent(f,blast,"",aria,cast,remove,minor)
    V243IPCPEvent(f,blast,boss,mira,cast,remove,major)
    V243IPCPEvent(f,blast,boss,lena,major,apply,damage," (100000)")
    V243IPCPEvent(f,blast,boss,lena,cast,remove,major)
    rows := V243IPCPRows(f)
    V48Assert(rows.Length=1 && rows[1].Text=="Mira's major grenade hit 2 teammates",
        "only Major Grenade splash is reported, with simultaneous carriers and duplicate hits handled correctly")

    at += 12000
    V243IPCPEvent(f,at,boss,mira,cast,apply,major)
    V243IPCPEvent(f,at+3000,boss,mira,major,apply,damage," (100000)")
    V243IPCPEvent(f,at+3000,boss,finn,major,apply,damage," (100000)")
    V243IPCPEvent(f,at+3000,boss,mira,cast,remove,major)
    V243IPCPEvent(f,at+4000,boss,lena,cast,apply,major)
    V243IPCPEvent(f,at+12500,boss,finn,major,apply,damage," (100000)")
    V243IPCPEvent(f,at+12500,boss,nox,major,apply,damage," (100000)")
    V243IPCPEvent(f,at+12500,boss,lena,cast,remove,major)
    V48Assert(V243IPCPRows(f).Length=1,"a premature removal or a missing hit on the carrier cannot assign a splash finding")
    IFHRetire(f.Segment)
    V48Assert(V243IPCPRows(f)[1].Text==rows[1].Text,"the splash remains in the completed pull")
}

I246RatingMath()
{
    body := '{"version":1,"boss":"nefra","patch":"live","mode":"MM","size":8,"rows":'
        . '[["dps",["Pyrotech","Plasmatech"],5,"40000,100,0,100,100"],'
        . '["hps",["Bodyguard","Combat Medic"],3,"20000,100,100"]]}'
    pools := IStatsRatingParse(body,"nefra","MM")
    dps := pools["DPS|pyrotech"],rates := IQAReadValues(dps.Packed,dps.Count,true,true)
    V48Assert(dps=pools["DPS|plasmatech"] && dps!=pools["EHPS|bodyguard"],"mirror disciplines share one DPS cohort, independent of EHPS")
    for pair in [[400,100],[401,100],[399.0051,75],[399,75],[399.004,75],[398.50,25],[398,25],[397,0],[1,0]]
        V48Assert(IStatsRatingPercentile(pair[1],rates)=pair[2],"competition rank for rate " pair[1])
    V48Assert(IStatsRatingPercentile(399.01,[40000,39901,39901,39000])=66.67,"two decimals come from rank and cohort size")
    for bad in [StrReplace(body,'"version":1','"version":2'),StrReplace(body,'"size":8','"size":16'),
            StrReplace(body,'"MM"','"VM"'),StrReplace(body,'"nefra"','"tyth"'),StrReplace(body,'"live"','"7.7.1"'),
            StrReplace(body,'"hps"','"bossdps"'),StrReplace(body,'"Plasmatech"','"Pyrotech"')] {
        rejected := false
        try IStatsRatingParse(bad,"nefra","MM")
        catch ValueError
            rejected := true
        V48Assert(rejected,"wrong scope and ambiguous or mismatched metric data are rejected")
    }
}

I246RatingFight() => V58Isolated(I246RatingFightCase)

I246RatingFightCase()
{
    s := IStatsRatingState(),cache := s.Cache
    s.Cache := Map()
    try {
        f := IQT138Ready(),seg := f.Segment,key := f.Keys[1],view := IRPWhole(seg)
        ref := IQTReferences().Rows["DF-NE|2031339142381602"],scope := IStatsRatingKey(ref)
        V48Assert(scope="MM|nefra","real Nefra reference resolves to the site's scope")
        original := IQTEvaluate(f.Data,seg,view).Rows[key]
        V48Assert(!original.SWTORStats && !s.Queue.Length,"bundled estimates work without calling the site in diagnostics")
        dps := {Packed:"3250000,50000,50000,50000",Count:4,Rates:""}
        healing := {Packed:"2400000,400000,100000,100000",Count:4,Rates:""}
        s.Cache[scope] := {Expires:ClockMs()+5000,Used:ClockMs(),Pools:Map("DPS|pyrotech",dps,"EHPS|pyrotech",healing)}
        view.Totals[key].Damage := 32000*view.Seconds
        rated := IQTEvaluate(f.Data,seg,view).Rows[key]
        V48Assert(rated.SWTORStats && rated.Percentile=66.67,"a complete pull with no upload receives the exact two-decimal grade")
        V48Assert(InStr(IQPHOverlayItemText("DPS",rated,"Nefra",rated.Name),"SWTORStats"),"the overlay identifies the grade source")
        V48Assert(!IQTEvaluate(f.Data,seg,view,1,"bosses").Graded,"target-filtered damage is never compared to total DPS")
        V48Assert(!IQTEvaluate(f.Data,seg,view).Rows[f.Keys[2]].SWTORStats,"an absent discipline keeps its matching bundled estimate")
        seg.ModeId := "836045448953656"
        V48Assert(!IQTEvaluate(f.Data,seg,view).Rows[key].SWTORStats,"16-player kills cannot use the 8-player cohort")
        seg.ModeId := "836045448953655"
        seg.Partial := true
        V48Assert(!IQTEvaluate(f.Data,seg,view).Graded,"partial pulls remain ungraded")
        seg.Partial := false

        total := view.Totals[key],total.Heal := 19000*view.Seconds,total.Effective := total.Heal
        total.HealKnown := 1,total.HealRecords := 1
        seg.ShieldVersion := 1,seg.ShieldCredit := Map(key,1000*view.Seconds)
        V48Assert(!IQHEvaluate(f.Data,seg,view).Rows[key].SWTORStats,"direct healing cannot use the absorb-inclusive site data")
        healed := IQHEvaluate(f.Data,seg,view,1,"",true).Rows[key]
        V48Assert(healed.SWTORStats && healed.Percentile=66.67,"absorb-inclusive EHPS matches its own site cohort")
    }
    finally s.Cache := cache
}

V247IPCPIncomplete()
{
    f := V243IPCPFixture(),t := f.Observation+40000
    V243IPCPClick(f,t+500,"First click","Blue"),V243IPCPClick(f,t+3000,"Second click","Green")
    V243IPCPClick(f,t+8000,"Canceled click","Purple"),V243IPCPClick(f,t+8200,"Canceled click","Purple",true)
    V243IPCPBlast(f,t+30000,2),V243IPCPBlast(f,t+30005,1),V243IPCPBlast(f,t+30006,1)
    rows := V243IPCPRows(f)
    V48Assert(rows.Length=1 && rows[1].Text=="Bomb exploded (1st set)`nBomb 1 had 2 color clicks recorded and no shield drop"
        . "`nIncorrect click: None confirmed`nSlowest click: Second click (Green)",
        "simultaneous bombs share a report and a canceled press cannot become the slowest click")
    V48Assert(IXFRowParts(rows[1],"Progression Assistance").Label==rows[1].Text,
        "partial code evidence and both review fields stay in the same finding")

    f := V243IPCPFixture(),t := f.Observation+40000
    V243IPCPClick(f,t+500,"First click","Blue"),V243IPCPClick(f,t+3500,"Second click","Green")
    V243IPCPDrop(f,t+5500,1),V243IPCPBlast(f,t+30000,1)
    V48Assert(!InStr(V243IPCPRows(f)[1].Text,"no shield drop"),"a recorded shield drop overrides the two-click observation")

    f := V243IPCPFixture(),t := f.Observation+40000
    V243IPCPClick(f,t+500,"First click","Blue")
    V243IPCPEvent(f,t+5000,"@Unknown Position#73","=","810799631171584","836045448945472","836045448945479")
    V243IPCPClick(f,t+9000,"Last click","Green"),V243IPCPBlast(f,t+30000,1)
    message := V243IPCPRows(f)[1].Text
    V48Assert(InStr(message,"Slowest click: Unclear") && !InStr(message,"2 color clicks"),
        "unknown console positions cannot prove a missing click or the longest delay")

    f := V243IPCPFixture(),t := f.Observation+40000
    V243IPCPClick(f,t+500,"Canceled click","Blue"),V243IPCPClick(f,t+650,"Canceled click","Blue",true),V243IPCPBlast(f,t+30000)
    V48Assert(V243IPCPRows(f)[1].Text=="Bomb exploded (1st set)`nNo completed color clicks recorded",
        "an interrupted press alone names nobody as slowest")
}

V249IPCleanse() => V652TimerDefaultsIsolated((*) => I96WithVoices(V249IPCleanseCase))

V249IPCleanseCase()
{
    global IRT,IRTPrefs,Roster,Audio,testClock,audioOutputMode,AUDIO_MODE_KENKU_BRIDGE_TTS
    savedRoster := Roster
    try {
        Roster := {Members:IRTMap()}
        IRT := V237IPWallState(),s := IRT,IRT.AnchorLog := 0
        Roster.Members[s.Self] := {Role:"Healer"}
        V48Assert(!IRTIPCleanseScope(s),"wait until the live IP-CPT engagement is identified")
        V237IPWallCast(s,20000)
        id := IRTIPCleanseTimerId(),d := s.ById[id]
        V48Assert(IRTTimerLabel(d)="IP - Don't cleanse grenade DoT" && d.Name="IP - Hold Shrapnel cleanse",
            "the new timer label retains the ID used by saved settings")
        V237IPWallMark(s,20300,"@Heat#90")
        V237IPWallMark(s,20301,"@Sword#91")
        V249CleanseEffect(s,20800,"@Heat#90","4502478640906508","4502478640906240")
        V249CleanseEffect(s,22000,"@Sword#91","2793644297814016","2793644297814016")
        audioOutputMode := AUDIO_MODE_KENKU_BRIDGE_TTS,testClock := 23802
        IRTIPCleanseSpeak(s,testClock)
        V48Assert(!d.Enabled && !IRTUDataSnapshot(s,testClock,IRTPrefs).AlertLines.Length && !Audio.Queue.Length,
            "the new timer shows and speaks nothing by default when a healer could receive the warning")
        d.Enabled := true
        V48Assert(!IRTIPCleanseWarnings(s,23799).Length,"Major Grenade is outside the last five seconds")
        snap := IRTUDataSnapshot(s,23802,IRTPrefs)
        V48Assert(snap.AlertLines.Length=2 && InStr(snap.Alert,"Don't cleanse grenade DoT on Heat")
            && InStr(snap.Alert,"Don't cleanse grenade DoT on Sword"),
            "both grenade carriers have a named healer warning on the actual timer display")
        Roster.Members[s.Self].Role := "DPS"
        V48Assert(!IRTIPCleanseWarnings(s,23802).Length,"a non-healer sees no Shrapnel warnings")
        Roster.Members[s.Self].Role := "Healer"

        IRTIPCleanseSpeak(s,testClock),IRTIPCleanseSpeak(s,testClock)
        V48Assert(Audio.Queue.Length=2 && Audio.Queue[1].Phrase="Don't cleanse grenade DoT on Heat" && AudioItemEnabled(Audio.Queue[1]),
            "TTS queues at most one named call per carrier")
        heatCall := Audio.Queue[1],swordCall := Audio.Queue[2]
        V249CleanseEffect(s,24300,"@Sword#91","2793644297814016","2793644297814016",false)
        testClock := 24300
        V48Assert(IRTIPCleanseWarnings(s,testClock).Length=1 && !AudioItemEnabled(swordCall),
            "a defensive removal immediately clears that player's warning and invalidates queued speech")
        V249CleanseEffect(s,24000,"@Sword#91","2793644297814016","2793644297814016")
        V48Assert(IRTIPCleanseWarnings(s,testClock).Length=1,"an older gain cannot resurrect a removed defensive")

        state := IRTIPCleanseState(s),heat := state.Players["@Heat#90"]
        V249CleanseEffect(s,28820,"@Heat#90","4471271408533778","4471271408533504",false,"IP-CPT {4494653210492928}:100")
        V249CleanseEffect(s,28832,"@Heat#90","4471271408533822","4471271408533504",true,"IP-CPT {4494653210492928}:100")
        testClock := 28832,Audio.Queue := []
        IRTIPCleanseSpeak(s,testClock)
        V48Assert(heat.Major.Cue=heat.Wound.Cue && IRTIPCleanseWarnings(s,testClock).Length=1 && !Audio.Queue.Length,
            "Shrapnel Wound takes over the warning without speaking a second time")
        V249CleanseEffect(s,29800,"@Heat#90","4471271408533822","0",false,"@Healer#98")
        V48Assert(!IRTIPCleanseWarnings(s,29800).Length,"the logged wound removal stops the warning")
        V48Assert(!AudioItemEnabled(heatCall),"a finished cue cannot speak late")

        V249CleanseEffect(s,31400,"@Guard#92","2793700132388864","2793700132388864")
        V237IPWallMark(s,32000,"@Guard#92","4471271408533794")
        V48Assert(!IRTIPCleanseWarnings(s,33000).Length,"Minor Grenade cannot trigger a Shrapnel warning")
        V249CleanseEffect(s,34000,"@Guard#92","4471271408533822","4471271408533504",true,"IP-CPT {4494653210492928}:100")
        V48Assert(IRTIPCleanseWarnings(s,34000)[1].Name="Don't cleanse grenade DoT on Guard",
            "a real wound also catches grenade splash and the Guardian mirror")
        drained := IPParseLine("[00:00:34.000] [@Guard#92] [=] [Focused Defense {2793700132388864}] [ModifyCharges {836045448953666}: Focused Defense {2793700132388864}] (0 charges {836045448953667})")
        V48Assert(drained.IPCleanseZero,"the parser recognizes explicit zero defensive charges")
        IRTObserve(s,drained,34100)
        V48Assert(!IRTIPCleanseWarnings(s,34100).Length,"depleted defense charges clear the warning before a removal line")

        V249CleanseEffect(s,35000,"@Splash#93","4471271408533822","4471271408533504",true,"IP-CPT {4494653210492928}:100")
        V65BObserve(s,V65BEv("Activate","@Splash#93","=","4546987386994688"),35400)
        V48Assert(!IRTIPCleanseWarnings(s,35400).Length,"a Durasteel Armor activation alone does not prove the buff is active")
        V249CleanseEffect(s,35500,"@Splash#93","4546987386994952","4546987386994688")
        V48Assert(IRTIPCleanseWarnings(s,35500)[1].Name="Don't cleanse grenade DoT on Splash",
            "Durasteel Armor gained while wounded qualifies for the named warning")
        V65BObserve(s,V65BEv("Death","IP-CPT {4494653210492928}:100","@Splash#93"),35600)
        V48Assert(!IRTIPCleanseWarnings(s,35600).Length,"the target's death invalidates the wound and defensive")

        V249CleanseEffect(s,36400,"@Heat#90","4471271408533822","4471271408533504",true,"IP-CPT {4494653210492928}:100")
        V48Assert(IRTIPCleanseWarnings(s,36400).Length=1,"a separate Shrapnel application has its own active warning")
        d := IRTIPCleanseRule(s),d.Enabled := false
        V48Assert(!IRTIPCleanseWarnings(s,36400).Length,"the built-in can be disabled in Timers")
        d.Enabled := true,s.ModeId := "836045448953651"
        V48Assert(!IRTIPCleanseWarnings(s,36400).Length,"Story Mode cannot borrow Veteran evidence")
        s.ModeId := "836045448953652"
        IRTPause(s,36500)
        V48Assert(!IRTIPCleanseWarnings(s,36500).Length,"suspension discards cached Shrapnel evidence")

        IRTLoadLibrary(),path := IRTLibraryPath()
        V48Assert(!IRT.ById[id].Enabled && !FileExist(path),"startup loads the disabled default without saving it")
        IRTSetDefinitionEnabled(id,true)
        saved := FileRead(path,"UTF-8")
        IRTLoadLibrary()
        V48Assert(IRT.ById[id].Enabled && FileRead(path,"UTF-8")==saved,"startup honors a saved opt-in without rewriting the library")
    }
    finally Roster := savedRoster
}

V249CleanseEffect(s,at,actor,effect,ability,apply := true,source := "")
{
    if source=""
        source := actor
    ev := V65BEv("Other",source,actor,ability,effect,apply ? "836045448945477" : "836045448945478")
    V65BObserve(s,ev,at)
}
