From 21171dec69002c01e448e561e8202afef3a9b9e1 Mon Sep 17 00:00:00 2001 From: axiomlogicnexus Date: Wed, 29 Apr 2026 17:01:27 +0200 Subject: [PATCH] Explain drill packet structure in recovery coaching --- .../HyperTwistTrainingCoachLibrary.cpp | 80 +++++++++--- .../HyperTwistTrainingRepositoryLibrary.cpp | 119 +++++++++++++----- 2 files changed, 155 insertions(+), 44 deletions(-) diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp index a4ad8cb..ecbff6a 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp @@ -78,7 +78,9 @@ namespace HyperTwistTrainingCoachLibraryInternal || SourceLabel == TEXT("coach-memory-method-drill-recovery-posture-strong") || SourceLabel == TEXT("coach-memory-method-drill-recovery-posture-weak") || SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-strong") - || SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-weak"); + || SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-weak") + || SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-narrow") + || SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-broad"); } bool IsMethodDrillRecoveryPacketSource(const FString& SourceLabel) @@ -91,6 +93,16 @@ namespace HyperTwistTrainingCoachLibraryInternal return SourceLabel.Contains(TEXT("method-drill-follow-up-packet-")); } + bool IsNarrowMethodDrillFollowUpPacketStructureSource(const FString& SourceLabel) + { + return SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-narrow"); + } + + bool IsBroadMethodDrillFollowUpPacketStructureSource(const FString& SourceLabel) + { + return SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-broad"); + } + bool IsStrongMethodDrillFollowUpPacketMemorySource(const FString& SourceLabel) { return SourceLabel.StartsWith(TEXT("coach-memory-dashboard-method-drill-follow-up-packet-strong-")) @@ -98,7 +110,7 @@ namespace HyperTwistTrainingCoachLibraryInternal || SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up-packet-strong-follow-up") || SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up-packet-strong-recommended") || SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-strong") - || SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-narrow"); + || IsNarrowMethodDrillFollowUpPacketStructureSource(SourceLabel); } bool IsWeakMethodDrillFollowUpPacketMemorySource(const FString& SourceLabel) @@ -108,7 +120,7 @@ namespace HyperTwistTrainingCoachLibraryInternal || SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up-packet-weak-follow-up") || SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up-packet-weak-recommended") || SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-weak") - || SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-broad"); + || IsBroadMethodDrillFollowUpPacketStructureSource(SourceLabel); } bool IsStrongMethodDrillRecoveryMemorySource(const FString& SourceLabel) @@ -128,7 +140,8 @@ namespace HyperTwistTrainingCoachLibraryInternal || SourceLabel == TEXT("coach-memory-method-drill-recovery-strong") || SourceLabel == TEXT("coach-memory-method-drill-recovery-packet-strong") || SourceLabel == TEXT("coach-memory-method-drill-recovery-posture-strong") - || SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-strong"); + || SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-strong") + || IsNarrowMethodDrillFollowUpPacketStructureSource(SourceLabel); } bool IsWeakMethodDrillRecoveryMemorySource(const FString& SourceLabel) @@ -148,7 +161,8 @@ namespace HyperTwistTrainingCoachLibraryInternal || SourceLabel == TEXT("coach-memory-method-drill-recovery-weak") || SourceLabel == TEXT("coach-memory-method-drill-recovery-packet-weak") || SourceLabel == TEXT("coach-memory-method-drill-recovery-posture-weak") - || SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-weak"); + || SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-weak") + || IsBroadMethodDrillFollowUpPacketStructureSource(SourceLabel); } FString DescribeRetainedMethodDrillRecoveryStanceLabel(const FString& SourceLabel) @@ -1551,6 +1565,14 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna HyperTwistTrainingCoachLibraryInternal::IsMethodDrillDashboardHandoffSource( CoachMemorySnapshot.PreferredCoachHandoffSourceLabel ); + const bool bNarrowMethodDrillPacketStructureHandoff = + HyperTwistTrainingCoachLibraryInternal::IsNarrowMethodDrillFollowUpPacketStructureSource( + CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + ); + const bool bBroadMethodDrillPacketStructureHandoff = + HyperTwistTrainingCoachLibraryInternal::IsBroadMethodDrillFollowUpPacketStructureSource( + CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + ); const bool bStrongMethodDrillDashboardHandoff = HyperTwistTrainingCoachLibraryInternal::IsStrongMethodDrillRecoveryMemorySource( CoachMemorySnapshot.PreferredCoachHandoffSourceLabel @@ -1588,6 +1610,14 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna HyperTwistTrainingCoachLibraryInternal::IsWeakMethodDrillRecoveryMemorySource( CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel ); + const bool bNarrowMethodDrillPacketStructureRecoveryActionSource = + HyperTwistTrainingCoachLibraryInternal::IsNarrowMethodDrillFollowUpPacketStructureSource( + CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel + ); + const bool bBroadMethodDrillPacketStructureRecoveryActionSource = + HyperTwistTrainingCoachLibraryInternal::IsBroadMethodDrillFollowUpPacketStructureSource( + CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel + ); const float Score = 66.0f + FMath::Min(CoachMemorySnapshot.ScheduleExecutionPressureScore * 0.25f, 20.0f) + (bArchiveAware ? 5.0f : 0.0f) @@ -1604,7 +1634,11 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna FString Headline; if (bDashboardQueuedHandoff) { - Headline = bStrongMethodDrillDashboardHandoff + Headline = bNarrowMethodDrillPacketStructureHandoff + ? (bPromoteQueueRecovery + ? TEXT("Accepted narrow retained drill-follow-up-packet structure keeps the queue-first continuation slice active") + : TEXT("Accepted narrow retained drill-follow-up-packet structure favors a queue-first continuation launch")) + : (bStrongMethodDrillDashboardHandoff ? (bPromoteQueueRecovery ? TEXT("Accepted strong retained drill-recovery queued handoffs keep the queue-first continuation slice active") : TEXT("Accepted strong retained drill-recovery queued handoffs favor a queue-first continuation launch")) @@ -1618,11 +1652,15 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna : TEXT("Accepted deferred-overflow queued handoffs favor a queue-first narrowed recovery launch")) : (bPromoteQueueRecovery ? TEXT("Accepted queued handoffs favor promoting queued work first") - : TEXT("Accepted queued handoffs favor a queue-first recovery launch")))); + : TEXT("Accepted queued handoffs favor a queue-first recovery launch"))))); } else if (bDashboardFollowUpHandoff) { - Headline = bStrongMethodDrillDashboardHandoff + Headline = bNarrowMethodDrillPacketStructureHandoff + ? (bPromoteQueueRecovery + ? TEXT("Accepted narrow retained drill-follow-up-packet structure keeps the continuation lane active") + : TEXT("Accepted narrow retained drill-follow-up-packet structure favors recovering the continuation lane next")) + : (bStrongMethodDrillDashboardHandoff ? (bPromoteQueueRecovery ? TEXT("Accepted strong retained drill-recovery follow-up handoffs keep the narrowed continuation lane active") : TEXT("Accepted strong retained drill-recovery follow-up handoffs favor recovering the narrowed continuation lane next")) @@ -1636,11 +1674,15 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna : TEXT("Accepted deferred-overflow follow-up handoffs favor recovering narrowed follow-up work next")) : (bPromoteQueueRecovery ? TEXT("Accepted follow-up handoffs keep the deferred follow-up lane active") - : TEXT("Accepted follow-up handoffs favor recovering the follow-up lane next")))); + : TEXT("Accepted follow-up handoffs favor recovering the follow-up lane next"))))); } else if (bDashboardRecommendedHandoff) { - Headline = bWeakMethodDrillDashboardHandoff + Headline = bBroadMethodDrillPacketStructureHandoff + ? (bPromoteQueueRecovery + ? TEXT("Accepted broad retained drill-follow-up-packet structure keeps broader redirect work active") + : TEXT("Accepted broad retained drill-follow-up-packet structure favors a broader redirect next")) + : (bWeakMethodDrillDashboardHandoff ? (bPromoteQueueRecovery ? TEXT("Accepted weak retained drill-recovery history keeps broader recommended redirect work active") : TEXT("Accepted weak retained drill-recovery history favors a broader recommended redirect next")) @@ -1654,11 +1696,15 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna : TEXT("Accepted deferred-overflow recommended handoffs favor restoring narrowed recommended work next")) : (bPromoteQueueRecovery ? TEXT("Accepted recommended handoffs keep the deferred recommended lane active") - : TEXT("Accepted recommended handoffs favor restoring the recommended lane next")))); + : TEXT("Accepted recommended handoffs favor restoring the recommended lane next"))))); } else if (bQueueRecoveryFollowUp) { - Headline = bStrongMethodDrillRecoveryActionSource + Headline = bNarrowMethodDrillPacketStructureRecoveryActionSource + ? (bPromoteQueueRecovery + ? TEXT("Promote the narrow retained drill-follow-up-packet structure back into active queue flow") + : TEXT("Recover the narrow retained drill-follow-up-packet structure before the queue drifts further")) + : (bStrongMethodDrillRecoveryActionSource ? (bPromoteQueueRecovery ? TEXT("Promote the strong retained drill-recovery continuation lane back into active queue flow") : TEXT("Recover the strong retained drill-recovery continuation lane before the queue drifts further")) @@ -1668,11 +1714,15 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna : TEXT("Recover the drill-derived follow-up lane before the queue drifts further")) : (bPromoteQueueRecovery ? TEXT("Promote the deferred follow-up lane back into active queue flow") - : TEXT("Recover the deferred follow-up lane before the queue drifts further"))); + : TEXT("Recover the deferred follow-up lane before the queue drifts further")))); } else if (bQueueRecoveryRecommended) { - Headline = bWeakMethodDrillRecoveryActionSource + Headline = bBroadMethodDrillPacketStructureRecoveryActionSource + ? (bPromoteQueueRecovery + ? TEXT("Promote the broad retained drill-follow-up-packet redirect back into the active queue") + : TEXT("Recover the broad retained drill-follow-up-packet redirect and restore queue cadence")) + : (bWeakMethodDrillRecoveryActionSource ? (bPromoteQueueRecovery ? TEXT("Promote the weak retained drill-recovery redirect lane back into the active queue") : TEXT("Recover the weak retained drill-recovery redirect lane and restore queue cadence")) @@ -1682,7 +1732,7 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna : TEXT("Recover the drill-tipped recommended lane and restore queue cadence")) : (bPromoteQueueRecovery ? TEXT("Promote the deferred recommended lane back into the active queue") - : TEXT("Recover the deferred recommended lane and restore queue cadence"))); + : TEXT("Recover the deferred recommended lane and restore queue cadence")))); } else if (bBlockedFollowUp) { diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp index d72e321..b3548ef 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp @@ -157,6 +157,39 @@ namespace HyperTwistTrainingRepositoryLibraryInternal || SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up-packet-weak-recommended"); } + bool IsNarrowMethodDrillFollowUpPacketStructureCoachMemorySource(const FString& SourceLabel) + { + return SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-narrow"); + } + + bool IsBroadMethodDrillFollowUpPacketStructureCoachMemorySource(const FString& SourceLabel) + { + return SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-broad"); + } + + FString ResolveMethodDrillFollowUpPacketStructureRecoverySourceLabel( + const FString& PreferredCoachHandoffSourceLabel, + const FString& PreferredGuidanceSourceLabel) + { + if (IsNarrowMethodDrillFollowUpPacketStructureCoachMemorySource( + PreferredCoachHandoffSourceLabel) + || IsBroadMethodDrillFollowUpPacketStructureCoachMemorySource( + PreferredCoachHandoffSourceLabel)) + { + return PreferredCoachHandoffSourceLabel; + } + + if (IsNarrowMethodDrillFollowUpPacketStructureCoachMemorySource( + PreferredGuidanceSourceLabel) + || IsBroadMethodDrillFollowUpPacketStructureCoachMemorySource( + PreferredGuidanceSourceLabel)) + { + return PreferredGuidanceSourceLabel; + } + + return FString(); + } + bool IsStrongRetainedMethodDrillRecoveryPostureDashboardHandoffSource( const FString& SourceLabel) { @@ -1034,20 +1067,31 @@ namespace HyperTwistTrainingRepositoryLibraryInternal + (static_cast(RetainedMethodDrillRecoveryPostureLaunchBias) * 2.25f); if (PromoteRecoveryActionPressure > 0.0f || LaunchRecoveryActionPressure > 0.0f) { + const FString PacketStructureRecoverySourceLabel = + HyperTwistTrainingRepositoryLibraryInternal:: + ResolveMethodDrillFollowUpPacketStructureRecoverySourceLabel( + Snapshot.PreferredCoachHandoffSourceLabel, + Snapshot.PreferredGuidanceSourceLabel + ); if (PromoteRecoveryActionPressure > LaunchRecoveryActionPressure) { Snapshot.PreferredQueueRecoveryAction = EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred; - Snapshot.PreferredQueueRecoveryActionSourceLabel = TEXT("queue-history-promote-pressure"); + Snapshot.PreferredQueueRecoveryActionSourceLabel = + !PacketStructureRecoverySourceLabel.IsEmpty() + ? PacketStructureRecoverySourceLabel + : TEXT("queue-history-promote-pressure"); } else if (LaunchRecoveryActionPressure > PromoteRecoveryActionPressure) { Snapshot.PreferredQueueRecoveryAction = EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery; Snapshot.PreferredQueueRecoveryActionSourceLabel = - !Snapshot.PreferredCoachHandoffSourceLabel.IsEmpty() + !PacketStructureRecoverySourceLabel.IsEmpty() + ? PacketStructureRecoverySourceLabel + : (!Snapshot.PreferredCoachHandoffSourceLabel.IsEmpty() ? Snapshot.PreferredCoachHandoffSourceLabel - : TEXT("queue-history-launch-pressure"); + : TEXT("queue-history-launch-pressure")); } else { @@ -1056,7 +1100,10 @@ namespace HyperTwistTrainingRepositoryLibraryInternal && !QueueExecutionSummary.bHasCompletionGap ? EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred : EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery; - Snapshot.PreferredQueueRecoveryActionSourceLabel = TEXT("queue-history-balanced-pressure"); + Snapshot.PreferredQueueRecoveryActionSourceLabel = + !PacketStructureRecoverySourceLabel.IsEmpty() + ? PacketStructureRecoverySourceLabel + : TEXT("queue-history-balanced-pressure"); } } if (Snapshot.PreferredQueueRecoveryAction == EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery @@ -7483,33 +7530,47 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der + (static_cast(MethodDrillRecoveryLaunchBias) * 1.75f) + (static_cast(RetainedMethodDrillRecoveryLaunchBias) * 2.0f) + (static_cast(RetainedMethodDrillRecoveryPostureLaunchBias) * 2.25f); - if (PromoteRecoveryActionPressure > 0.0f || LaunchRecoveryActionPressure > 0.0f) + if (PromoteRecoveryActionPressure > 0.0f || LaunchRecoveryActionPressure > 0.0f) + { + const FString PacketStructureRecoverySourceLabel = + HyperTwistTrainingRepositoryLibraryInternal:: + ResolveMethodDrillFollowUpPacketStructureRecoverySourceLabel( + Snapshot.PreferredCoachHandoffSourceLabel, + Snapshot.PreferredGuidanceSourceLabel + ); + if (PromoteRecoveryActionPressure > LaunchRecoveryActionPressure) { - if (PromoteRecoveryActionPressure > LaunchRecoveryActionPressure) - { - Snapshot.PreferredQueueRecoveryAction = - EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred; - Snapshot.PreferredQueueRecoveryActionSourceLabel = TEXT("queue-history-promote-pressure"); - } - else if (LaunchRecoveryActionPressure > PromoteRecoveryActionPressure) - { - Snapshot.PreferredQueueRecoveryAction = - EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery; - Snapshot.PreferredQueueRecoveryActionSourceLabel = - !Snapshot.PreferredCoachHandoffSourceLabel.IsEmpty() - ? Snapshot.PreferredCoachHandoffSourceLabel - : TEXT("queue-history-launch-pressure"); - } - else - { - Snapshot.PreferredQueueRecoveryAction = - QueueExecutionSummary.bHasOutstandingDeferredWork - && !QueueExecutionSummary.bHasCompletionGap - ? EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred - : EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery; - Snapshot.PreferredQueueRecoveryActionSourceLabel = TEXT("queue-history-balanced-pressure"); - } + Snapshot.PreferredQueueRecoveryAction = + EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred; + Snapshot.PreferredQueueRecoveryActionSourceLabel = + !PacketStructureRecoverySourceLabel.IsEmpty() + ? PacketStructureRecoverySourceLabel + : TEXT("queue-history-promote-pressure"); } + else if (LaunchRecoveryActionPressure > PromoteRecoveryActionPressure) + { + Snapshot.PreferredQueueRecoveryAction = + EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery; + Snapshot.PreferredQueueRecoveryActionSourceLabel = + !PacketStructureRecoverySourceLabel.IsEmpty() + ? PacketStructureRecoverySourceLabel + : (!Snapshot.PreferredCoachHandoffSourceLabel.IsEmpty() + ? Snapshot.PreferredCoachHandoffSourceLabel + : TEXT("queue-history-launch-pressure")); + } + else + { + Snapshot.PreferredQueueRecoveryAction = + QueueExecutionSummary.bHasOutstandingDeferredWork + && !QueueExecutionSummary.bHasCompletionGap + ? EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred + : EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery; + Snapshot.PreferredQueueRecoveryActionSourceLabel = + !PacketStructureRecoverySourceLabel.IsEmpty() + ? PacketStructureRecoverySourceLabel + : TEXT("queue-history-balanced-pressure"); + } + } if (Snapshot.PreferredQueueRecoveryAction == EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery && HyperTwistTrainingRepositoryLibraryInternal::IsStrongMethodDrillRecoveryPacketCoachMemorySource( Snapshot.PreferredCoachHandoffSourceLabel))