From 6df13d2d7a279f26f7f140c7a428f687797256f9 Mon Sep 17 00:00:00 2001 From: axiomlogicnexus Date: Mon, 27 Apr 2026 19:59:29 +0200 Subject: [PATCH] Reinforce queue suppression through coach memory --- .../HyperTwistTrainingCoachLibrary.cpp | 4 ++++ .../HyperTwistTrainingRepositoryLibrary.cpp | 20 +++++++++++++++++++ .../HyperTwistTrainingTypes.h | 6 ++++++ 3 files changed, 30 insertions(+) diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp index 92fab77..7c93324 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp @@ -31,6 +31,7 @@ namespace HyperTwistTrainingCoachLibraryInternal return FMath::Clamp( 4.0f + static_cast(CoachMemorySnapshot.FollowUpGuidanceContinueBias) + + (static_cast(CoachMemorySnapshot.SuppressedPrimaryQueuePressureCount) * 1.5f) + (static_cast(CoachMemorySnapshot.FollowUpReadyCoachSequenceCount) * 1.5f) + (static_cast(CoachMemorySnapshot.ScheduleBlockedFollowUpEventCount) * 2.0f), 0.0f, @@ -41,6 +42,7 @@ namespace HyperTwistTrainingCoachLibraryInternal return FMath::Clamp( 4.0f + static_cast(CoachMemorySnapshot.RecommendedGuidanceContinueBias) + + (static_cast(CoachMemorySnapshot.SuppressedFollowUpQueuePressureCount) * 1.5f) + (static_cast(CoachMemorySnapshot.RepeatRecommendationSequenceCount) * 1.5f) + (CoachMemorySnapshot.bHasRepeatRecommendationPressure ? 4.0f : 0.0f), 0.0f, @@ -220,6 +222,7 @@ namespace HyperTwistTrainingCoachLibraryInternal const float FollowUpPressureScore = FollowUpBrief.PriorityScore + static_cast(CoachMemorySnapshot.FollowUpGuidanceContinueBias) + + (static_cast(CoachMemorySnapshot.SuppressedPrimaryQueuePressureCount) * 2.0f) + (FollowUpBrief.bNeedsCoachReview ? 8.0f : 0.0f); const bool bShouldCreate = RecommendedRetentionScore >= FollowUpPressureScore + 8.0f; if (!bShouldCreate && OutSuppressionReason != nullptr) @@ -262,6 +265,7 @@ namespace HyperTwistTrainingCoachLibraryInternal const float RecommendedPressureScore = CurrentBrief.PriorityScore + static_cast(CoachMemorySnapshot.RecommendedGuidanceContinueBias) + + (static_cast(CoachMemorySnapshot.SuppressedFollowUpQueuePressureCount) * 2.0f) + (CoachMemorySnapshot.bHasRepeatRecommendationPressure ? 4.0f : 0.0f); const float FollowUpRetentionScore = FollowUpBrief.PriorityScore diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp index af33b8c..5abe0c0 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp @@ -5286,6 +5286,26 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der - (QueueExecutionSummary.bHasBlockedFollowUpFriction ? 1 : 0) ); } + if (bQueueHistoryPrefersFollowUp + && Snapshot.PreferredQueueRecoveryAction == EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred) + { + Snapshot.SuppressedPrimaryQueuePressureCount += FMath::Max( + 1, + DeferredRecoverySignal + + ExplicitFollowUpRecoverySignal + + (QueueExecutionSummary.bHasBlockedFollowUpFriction ? 1 : 0) + ); + } + if (bQueueHistoryPrefersRecommended + && Snapshot.PreferredQueueRecoveryAction == EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery) + { + Snapshot.SuppressedFollowUpQueuePressureCount += FMath::Max( + 1, + PromotionRecoverySignal + + ExplicitRecommendedRecoverySignal + + (QueueExecutionSummary.bHasCompletionGap ? 1 : 0) + ); + } if (!QueueExecutionSummary.FocusDeckId.IsEmpty() && (Snapshot.FocusDeckId.IsEmpty() || Snapshot.bNeedsScheduleFrictionRecovery)) diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistTraining/HyperTwistTrainingTypes.h b/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistTraining/HyperTwistTrainingTypes.h index 9aca47e..dd6c462 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistTraining/HyperTwistTrainingTypes.h +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistTraining/HyperTwistTrainingTypes.h @@ -1864,6 +1864,12 @@ struct FHyperTwistTrainingCoachMemorySnapshot UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") int32 FollowUpGuidanceContinueBias = 0; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") + int32 SuppressedPrimaryQueuePressureCount = 0; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") + int32 SuppressedFollowUpQueuePressureCount = 0; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bNeedsCoachIntervention = false;