"""Registry data for Group D (ML hyperparameters affecting steering quality).

Each entry is a dict matching the ConstantMeta constructor signature.
Group E thresholds are in registry_data_thresholds.py.
"""

from wisent.core import constants as _C
from wisent.core.constants import (
    LR_LOWER_BOUND, DEFAULT_CLASSIFIER_LR,
    REGISTRY_LR_FLOOR, REGISTRY_LR_SUB_FLOOR,
    GROM_NUM_DIRECTIONS, GROM_OPTIMIZATION_STEPS, GROM_LEARNING_RATE,
    GROM_WARMUP_STEPS, GROM_BEHAVIOR_WEIGHT, GROM_RETAIN_WEIGHT,
    GROM_SPARSE_WEIGHT, GROM_SMOOTH_WEIGHT, GROM_INDEPENDENCE_WEIGHT,
    GROM_MAX_ALPHA, GROM_GATE_TEMPERATURE, GROM_HIDDEN_DIM,
    GROM_ROUTER_HIDDEN_DIM, GROM_INTENSITY_HIDDEN_DIM, GROM_ROUTER_TEMPERATURE,
    TECZA_NUM_DIRECTIONS, DEFAULT_OPTIMIZATION_STEPS, TECZA_LEARNING_RATE,
    TECZA_RETAIN_WEIGHT, TECZA_INDEPENDENCE_WEIGHT,
    TECZA_ABLATION_WEIGHT, TECZA_ADDITION_WEIGHT,
    TETNO_CONDITION_THRESHOLD, TETNO_GATE_TEMPERATURE,
    TETNO_ENTROPY_FLOOR, TETNO_ENTROPY_CEILING, TETNO_MAX_ALPHA,
    DEFAULT_OPTIMIZATION_STEPS, TECZA_LEARNING_RATE,
    NURT_TRAINING_EPOCHS, MLP_LEARNING_RATE, NURT_LR_MIN,
    NURT_NUM_INTEGRATION_STEPS, NURT_T_MAX,
    SZLAK_SINKHORN_REG, SZLAK_INFERENCE_K, SZLAK_MAX_ITER,
    SZLAK_HIGH_REG, SZLAK_SPARSE_K,
    PRZELOM_EPSILON, SZLAK_INFERENCE_K, OSTRZE_C,
    MLP_HIDDEN_DIM, MLP_NUM_LAYERS, MLP_DROPOUT,
    DEFAULT_OPTIMIZATION_STEPS, MLP_LEARNING_RATE, DEFAULT_WEIGHT_DECAY,
    CLASSIFIER_NUM_EPOCHS, CLASSIFIER_HIDDEN_DIM, CLASSIFIER_DROPOUT,
    BENCHMARK_WEIGHT, PROBE_WEIGHT,
    EWC_LEARNING_RATE, CONTINUAL_EWC_LAMBDA,
    RL_EPSILON, RL_BASELINE, RL_DISCOUNT,
)
from .registry_data_thresholds import GROUP_E_ENTRIES

_D = "D"
_I = "int"
_F = "float"

GROUP_D_ENTRIES = [
    dict(name="GROM_NUM_DIRECTIONS", group=_D, current_value=GROM_NUM_DIRECTIONS,
         dtype=_I, low=1, high=15, log_scale=False, method="grom",
         description="Number of steering directions for GROM method"),
    dict(name="GROM_OPTIMIZATION_STEPS", group=_D, current_value=GROM_OPTIMIZATION_STEPS,
         dtype=_I, low=50, high=500, log_scale=False, method="grom",
         description="Training optimization steps for GROM"),
    dict(name="GROM_LEARNING_RATE", group=_D, current_value=GROM_LEARNING_RATE,
         dtype=_F, low=LR_LOWER_BOUND, high=_C.GROM_LR_UPPER, log_scale=True, method="grom",
         description="Learning rate for GROM optimization"),
    dict(name="GROM_WARMUP_STEPS", group=_D, current_value=GROM_WARMUP_STEPS,
         dtype=_I, low=0, high=50, log_scale=False, method="grom",
         description="Warmup steps for GROM learning rate scheduler"),
    dict(name="GROM_BEHAVIOR_WEIGHT", group=_D, current_value=GROM_BEHAVIOR_WEIGHT,
         dtype=_F, low=0.1, high=5.0, log_scale=False, method="grom",
         description="Weight for behavior-matching loss in GROM"),
    dict(name="GROM_RETAIN_WEIGHT", group=_D, current_value=GROM_RETAIN_WEIGHT,
         dtype=_F, low=0.0, high=_C.GROM_LAMBDA_UPPER, log_scale=False, method="grom",
         description="Regularization weight for retaining original behavior"),
    dict(name="GROM_SPARSE_WEIGHT", group=_D, current_value=GROM_SPARSE_WEIGHT,
         dtype=_F, low=0.0, high=0.5, log_scale=False, method="grom",
         description="Sparsity regularization weight for GROM"),
    dict(name="GROM_SMOOTH_WEIGHT", group=_D, current_value=GROM_SMOOTH_WEIGHT,
         dtype=_F, low=0.0, high=_C.GROM_SPARSE_UPPER, log_scale=False, method="grom",
         description="Smoothness regularization weight for GROM"),
    dict(name="GROM_INDEPENDENCE_WEIGHT", group=_D,
         current_value=GROM_INDEPENDENCE_WEIGHT,
         dtype=_F, low=0.0, high=_C.GROM_RETAIN_UPPER, log_scale=False, method="grom",
         description="Independence regularization between GROM directions"),
    dict(name="GROM_MAX_ALPHA", group=_D, current_value=GROM_MAX_ALPHA,
         dtype=_F, low=1.0, high=_C.GROM_BEHAVIOR_UPPER, log_scale=False, method="grom",
         description="Maximum steering intensity for GROM"),
    dict(name="GROM_GATE_TEMPERATURE", group=_D, current_value=GROM_GATE_TEMPERATURE,
         dtype=_F, low=0.01, high=2.0, log_scale=True, method="grom",
         description="Temperature for gating network softmax in GROM"),
    dict(name="GROM_HIDDEN_DIM", group=_D, current_value=GROM_HIDDEN_DIM,
         dtype=_I, low=32, high=512, log_scale=False, method="grom",
         description="Hidden dimension for GROM networks"),
    dict(name="GROM_ROUTER_HIDDEN_DIM", group=_D, current_value=GROM_ROUTER_HIDDEN_DIM,
         dtype=_I, low=16, high=256, log_scale=False, method="grom",
         description="Hidden dimension for GROM router network"),
    dict(name="GROM_INTENSITY_HIDDEN_DIM", group=_D,
         current_value=GROM_INTENSITY_HIDDEN_DIM,
         dtype=_I, low=8, high=128, log_scale=False, method="grom",
         description="Hidden dimension for GROM intensity network"),
    dict(name="GROM_ROUTER_TEMPERATURE", group=_D,
         current_value=GROM_ROUTER_TEMPERATURE,
         dtype=_F, low=0.01, high=2.0, log_scale=True, method="grom",
         description="Temperature for GROM router softmax"),
    dict(name="TECZA_NUM_DIRECTIONS", group=_D, current_value=TECZA_NUM_DIRECTIONS,
         dtype=_I, low=1, high=10, log_scale=False, method="tecza",
         description="Number of steering directions for TECZA"),
    dict(name="DEFAULT_OPTIMIZATION_STEPS", group=_D,
         current_value=DEFAULT_OPTIMIZATION_STEPS,
         dtype=_I, low=20, high=300, log_scale=False, method="tecza",
         description="Training optimization steps for TECZA"),
    dict(name="TECZA_LEARNING_RATE", group=_D, current_value=TECZA_LEARNING_RATE,
         dtype=_F, low=LR_LOWER_BOUND, high=0.1, log_scale=True, method="tecza",
         description="Learning rate for TECZA optimization"),
    dict(name="TECZA_RETAIN_WEIGHT", group=_D, current_value=TECZA_RETAIN_WEIGHT,
         dtype=_F, low=0.0, high=_C.TECZA_RETAIN_UPPER, log_scale=False, method="tecza",
         description="Regularization weight for retaining behavior in TECZA"),
    dict(name="TECZA_INDEPENDENCE_WEIGHT", group=_D,
         current_value=TECZA_INDEPENDENCE_WEIGHT,
         dtype=_F, low=0.0, high=_C.TECZA_INDEPENDENCE_UPPER, log_scale=False, method="tecza",
         description="Independence regularization between TECZA directions"),
    dict(name="TECZA_ABLATION_WEIGHT", group=_D, current_value=TECZA_ABLATION_WEIGHT,
         dtype=_F, low=0.1, high=_C.TECZA_DIRECTIONS_UPPER, log_scale=False, method="tecza",
         description="Weight for ablation objective in TECZA"),
    dict(name="TECZA_ADDITION_WEIGHT", group=_D, current_value=TECZA_ADDITION_WEIGHT,
         dtype=_F, low=0.1, high=_C.TECZA_DIRECTIONS_UPPER, log_scale=False, method="tecza",
         description="Weight for addition objective in TECZA"),
    dict(name="TETNO_CONDITION_THRESHOLD", group=_D,
         current_value=TETNO_CONDITION_THRESHOLD,
         dtype=_F, low=0.1, high=_C.TETNO_CONDITION_UPPER, log_scale=False, method="tetno",
         description="Condition threshold for TETNO gating"),
    dict(name="TETNO_GATE_TEMPERATURE", group=_D,
         current_value=TETNO_GATE_TEMPERATURE,
         dtype=_F, low=0.01, high=_C.TETNO_GATE_TEMP_UPPER, log_scale=True, method="tetno",
         description="Temperature for TETNO gate softmax"),
    dict(name="TETNO_ENTROPY_FLOOR", group=_D, current_value=TETNO_ENTROPY_FLOOR,
         dtype=_F, low=_C.TETNO_GATE_TEMP_LOWER, high=_C.TETNO_DIRECTIONS_UPPER, log_scale=False, method="tetno",
         description="Entropy floor for TETNO scaling"),
    dict(name="TETNO_ENTROPY_CEILING", group=_D, current_value=TETNO_ENTROPY_CEILING,
         dtype=_F, low=1.0, high=_C.TETNO_ALPHA_UPPER, log_scale=False, method="tetno",
         description="Entropy ceiling for TETNO scaling"),
    dict(name="TETNO_MAX_ALPHA", group=_D, current_value=TETNO_MAX_ALPHA,
         dtype=_F, low=0.5, high=10.0, log_scale=False, method="tetno",
         description="Maximum steering intensity for TETNO"),
    dict(name="DEFAULT_OPTIMIZATION_STEPS", group=_D,
         current_value=DEFAULT_OPTIMIZATION_STEPS,
         dtype=_I, low=20, high=300, log_scale=False, method="tetno",
         description="Training optimization steps for TETNO"),
    dict(name="TECZA_LEARNING_RATE", group=_D, current_value=TECZA_LEARNING_RATE,
         dtype=_F, low=LR_LOWER_BOUND, high=0.1, log_scale=True, method="tetno",
         description="Learning rate for TETNO optimization"),
    dict(name="NURT_TRAINING_EPOCHS", group=_D, current_value=NURT_TRAINING_EPOCHS,
         dtype=_I, low=50, high=1000, log_scale=False, method="nurt",
         description="Training epochs for NURT transport flow"),
    dict(name="MLP_LEARNING_RATE", group=_D, current_value=MLP_LEARNING_RATE,
         dtype=_F, low=REGISTRY_LR_FLOOR, high=0.01, log_scale=True, method="nurt",
         description="Learning rate for NURT training"),
    dict(name="NURT_LR_MIN", group=_D, current_value=NURT_LR_MIN,
         dtype=_F, low=REGISTRY_LR_SUB_FLOOR, high=DEFAULT_CLASSIFIER_LR,
         log_scale=True, method="nurt",
         description="Minimum learning rate for NURT cosine schedule"),
    dict(name="NURT_NUM_INTEGRATION_STEPS", group=_D,
         current_value=NURT_NUM_INTEGRATION_STEPS,
         dtype=_I, low=2, high=16, log_scale=False, method="nurt",
         description="Integration steps for NURT ODE solver"),
    dict(name="NURT_T_MAX", group=_D, current_value=NURT_T_MAX,
         dtype=_F, low=0.5, high=3.0, log_scale=False, method="nurt",
         description="Maximum transport time for NURT flow"),
    dict(name="SZLAK_SINKHORN_REG", group=_D, current_value=SZLAK_SINKHORN_REG,
         dtype=_F, low=DEFAULT_CLASSIFIER_LR, high=1.0, log_scale=True,
         method="szlak",
         description="Sinkhorn regularization for SZLAK optimal transport"),
    dict(name="SZLAK_INFERENCE_K", group=_D, current_value=SZLAK_INFERENCE_K,
         dtype=_I, low=1, high=20, log_scale=False, method="szlak",
         description="k-NN neighbors for SZLAK inference"),
    dict(name="SZLAK_MAX_ITER", group=_D, current_value=SZLAK_MAX_ITER,
         dtype=_I, low=20, high=500, log_scale=False, method="szlak",
         description="Max Sinkhorn iterations for SZLAK"),
    dict(name="SZLAK_HIGH_REG", group=_D, current_value=SZLAK_HIGH_REG,
         dtype=_F, low=0.1, high=5.0, log_scale=False, method="szlak",
         description="High regularization alternative for SZLAK"),
    dict(name="SZLAK_SPARSE_K", group=_D, current_value=SZLAK_SPARSE_K,
         dtype=_I, low=3, high=50, log_scale=False, method="szlak",
         description="Sparse k for SZLAK transport plan"),
    dict(name="PRZELOM_EPSILON", group=_D, current_value=PRZELOM_EPSILON,
         dtype=_F, low=0.01, high=5.0, log_scale=True, method="przelom",
         description="Entropic regularization temperature for PRZELOM"),
    dict(name="SZLAK_INFERENCE_K", group=_D, current_value=SZLAK_INFERENCE_K,
         dtype=_I, low=1, high=20, log_scale=False, method="przelom",
         description="k-NN neighbors for PRZELOM inference"),
    dict(name="OSTRZE_C", group=_D, current_value=OSTRZE_C,
         dtype=_F, low=0.01, high=10.0, log_scale=True, method="ostrze",
         description="Regularization constant C for OSTRZE hyperplane"),
    dict(name="MLP_HIDDEN_DIM", group=_D, current_value=MLP_HIDDEN_DIM,
         dtype=_I, low=32, high=1024, log_scale=False, method="mlp",
         description="Hidden dimension for MLP steering method"),
    dict(name="MLP_NUM_LAYERS", group=_D, current_value=MLP_NUM_LAYERS,
         dtype=_I, low=1, high=5, log_scale=False, method="mlp",
         description="Number of hidden layers in MLP method"),
    dict(name="MLP_DROPOUT", group=_D, current_value=MLP_DROPOUT,
         dtype=_F, low=0.0, high=0.5, log_scale=False, method="mlp",
         description="Dropout rate for MLP method"),
    dict(name="DEFAULT_OPTIMIZATION_STEPS", group=_D,
         current_value=DEFAULT_OPTIMIZATION_STEPS,
         dtype=_I, low=20, high=500, log_scale=False, method="mlp",
         description="Training steps for MLP method"),
    dict(name="MLP_LEARNING_RATE", group=_D, current_value=MLP_LEARNING_RATE,
         dtype=_F, low=REGISTRY_LR_FLOOR, high=0.01, log_scale=True, method="mlp",
         description="Learning rate for MLP method"),
    dict(name="DEFAULT_WEIGHT_DECAY", group=_D, current_value=DEFAULT_WEIGHT_DECAY,
         dtype=_F, low=REGISTRY_LR_FLOOR, high=0.1, log_scale=True, method="mlp",
         description="Weight decay for MLP method optimizer"),
    dict(name="CLASSIFIER_NUM_EPOCHS", group=_D, current_value=CLASSIFIER_NUM_EPOCHS,
         dtype=_I, low=10, high=200, log_scale=False, method="classifier",
         description="Training epochs for binary classifier"),
    dict(name="CLASSIFIER_HIDDEN_DIM", group=_D, current_value=CLASSIFIER_HIDDEN_DIM,
         dtype=_I, low=32, high=512, log_scale=False, method="classifier",
         description="Hidden dimension for classifier network"),
    dict(name="CLASSIFIER_DROPOUT", group=_D, current_value=CLASSIFIER_DROPOUT,
         dtype=_F, low=0.0, high=0.5, log_scale=False, method="classifier",
         description="Dropout rate for classifier"),
    dict(name="DEFAULT_CLASSIFIER_LR", group=_D, current_value=DEFAULT_CLASSIFIER_LR,
         dtype=_F, low=REGISTRY_LR_FLOOR, high=0.01, log_scale=True,
         method="classifier",
         description="Learning rate for classifier training"),
    dict(name="BENCHMARK_WEIGHT", group=_D, current_value=BENCHMARK_WEIGHT,
         dtype=_F, low=0.1, high=1.0, log_scale=False, method="evaluator",
         description="Weight for benchmark score in combined metric"),
    dict(name="PROBE_WEIGHT", group=_D, current_value=PROBE_WEIGHT,
         dtype=_F, low=0.0, high=0.9, log_scale=False, method="evaluator",
         description="Weight for probe score in combined metric"),
    dict(name="EWC_LEARNING_RATE", group=_D, current_value=EWC_LEARNING_RATE,
         dtype=_F, low=0.01, high=10.0, log_scale=True, method="continual",
         description="Learning rate for EWC parameter updates"),
    dict(name="CONTINUAL_EWC_LAMBDA", group=_D, current_value=CONTINUAL_EWC_LAMBDA,
         dtype=_F, low=10.0, high=10000.0, log_scale=True, method="continual",
         description="EWC penalty strength for forgetting prevention"),
    dict(name="RL_EPSILON", group=_D, current_value=RL_EPSILON,
         dtype=_F, low=0.01, high=0.5, log_scale=False, method="transport_rl",
         description="Exploration epsilon for RL transport optimization"),
    dict(name="RL_BASELINE", group=_D, current_value=RL_BASELINE,
         dtype=_F, low=0.0, high=1.0, log_scale=False, method="transport_rl",
         description="Baseline reward for REINFORCE variance reduction"),
    dict(name="RL_DISCOUNT", group=_D, current_value=RL_DISCOUNT,
         dtype=_F, low=0.9, high=1.0, log_scale=False, method="transport_rl",
         description="Discount factor for RL returns"),
]

REGISTRY_ENTRIES = GROUP_D_ENTRIES + GROUP_E_ENTRIES
