"""
Arbitrary constants. Migrated from _constants_part4.py.
"""
from wisent.core.grp_05.sub_constants.arbitrary.sub_arb import *  # noqa: F401,F403

# --- Coherence detection thresholds ---
COHERENCE_FUNCTION_WORD_THRESHOLD = 0.15
COHERENCE_SPACE_RATIO_MIN = 0.08
COHERENCE_LONG_TOKEN_LEN = 25
COHERENCE_LONG_TOKEN_RATIO = 0.1
COHERENCE_VALIDITY_RATIO_MIN = 0.3
COHERENCE_UNIQUE_TOKEN_RATIO_MIN = 0.4
COHERENCE_REPETITION_RATIO_MAX = 0.3
COHERENCE_SPECIAL_CHAR_RATIO_MAX = 0.2
COHERENCE_SPECIAL_CHAR_PENALTY = 0.7
COHERENCE_SHORT_RESPONSE_PENALTY = 0.1
COHERENCE_NONSENSE_WORD_RATIO_MAX = 0.15
COHERENCE_TRIGRAM_REPEAT_THRESHOLD = 3
COHERENCE_CONTENT_WORD_REPEAT_THRESHOLD = 3

# --- Perplexity evaluator ---
EVAL_PERPLEXITY_DIFF_THRESHOLD = 1.0

# --- Intervention scoring increments ---
INTERVENTION_SCORE_LOW_DIM_CAA = 1.0
INTERVENTION_SCORE_LOW_DIM_OSTRZE = 0.5
INTERVENTION_SCORE_NO_LOW_DIM = 0.5
INTERVENTION_SCORE_LINEAR_CAA = 2.0
INTERVENTION_SCORE_LINEAR_OSTRZE = 1.5
INTERVENTION_SCORE_NONLINEAR_MLP = 1.5
INTERVENTION_SCORE_NONLINEAR_OSTRZE = 1.0
INTERVENTION_SCORE_NONLINEAR_GROM = 0.5
INTERVENTION_SCORE_FRAGMENTED_TECZA = 2.0
INTERVENTION_SCORE_FRAGMENTED_GROM = 1.0
INTERVENTION_SCORE_FRAGMENTED_CAA_PENALTY = -1.0
INTERVENTION_SCORE_SINGLE_CAA = 0.5
INTERVENTION_SCORE_TRANSLATION_CAA = 1.0

# --- Agent defaults ---
AGENT_DEFAULT_SAMPLES = 25
AGENT_STEERING_THRESHOLD = 0.6
AGENT_QUALITY_THRESHOLD = 0.3
AGENT_DEFAULT_TIME_BUDGET = 5.0
AGENT_DEFAULT_TIME_BUDGET_INIT = 10.0
AGENT_DEMO_TIME_BUDGET = 2.0
TASK_FUZZY_MATCH_THRESHOLD = 0.6
# TASK_MIN_RELEVANCE_SCORE defined in _arb_09 (=0.1)

# --- PaCMAP optimization phases ---
PACMAP_INITIAL_SCALE = 0.01
PACMAP_W_NEAR = 1.0
PACMAP_W_MID = 0.5
PACMAP_W_FAR = 0.1
PACMAP_PHASE_1_END = 0.1
PACMAP_PHASE_2_END = 0.35
PACMAP_P1_NEAR = 2.0
PACMAP_P1_MID = 0.5
PACMAP_P1_FAR = 0.01
PACMAP_P2_NEAR = 3.0
PACMAP_P2_MID = 1.0
PACMAP_P2_FAR = 0.1
PACMAP_P3_NEAR = 1.0
PACMAP_P3_MID = 0.5
PACMAP_P3_FAR = 1.0
PACMAP_FAR_REPULSE_EPS = 0.01

# --- Optuna search bounds (shared across methods) ---
OPTUNA_OPT_STEPS_MIN = 50
OPTUNA_OPT_STEPS_MAX = 500
OPTUNA_MAX_ALPHA_MIN = 0.5
OPTUNA_MAX_ALPHA_MAX = 5.0
OPTUNA_RETAIN_WEIGHT_MIN = 0.0
OPTUNA_RETAIN_WEIGHT_MAX = 1.0
OPTUNA_NUM_DIRECTIONS_MIN = 1
OPTUNA_NUM_DIRECTIONS_MAX = 10
OPTUNA_INFERENCE_K_MIN = 1
OPTUNA_INFERENCE_K_MAX = 15
OPTUNA_TEMPERATURE_MIN = 0.01
OPTUNA_TEMPERATURE_MAX = 2.0
OPTUNA_VARIANCE_MIN = 0.5
OPTUNA_VARIANCE_MAX = 0.99

# --- Optuna MLP bounds ---
OPTUNA_MLP_HIDDEN_DIM_MIN = 32
OPTUNA_MLP_HIDDEN_DIM_MAX = 1024
OPTUNA_MLP_NUM_LAYERS_MIN = 1
OPTUNA_MLP_NUM_LAYERS_MAX = 5

# --- Optuna GROM architecture bounds ---
OPTUNA_GROM_GATE_DIM_MIN = 16
OPTUNA_GROM_GATE_DIM_MAX = 256
OPTUNA_GROM_INTENSITY_DIM_MIN = 8
OPTUNA_GROM_INTENSITY_DIM_MAX = 128
OPTUNA_GROM_SPARSE_WEIGHT_MIN = 0.0
OPTUNA_GROM_SPARSE_WEIGHT_MAX = 0.5

# --- Optuna NURT integration ---
OPTUNA_NURT_STEPS_MIN = 2
OPTUNA_NURT_STEPS_MAX = 8

# --- Optuna SZLAK (log-scale needs non-zero min) ---
OPTUNA_SZLAK_REG_MIN = 0.01

# --- Optuna WICHER ---
OPTUNA_WICHER_CONCEPT_DIMS = (0, 8, 16)
OPTUNA_WICHER_STEPS_MIN = 1
OPTUNA_WICHER_STEPS_MAX = 5

# --- Optuna PRZELOM ---
OPTUNA_PRZELOM_TARGET_MODES = ("uniform", "nearest")

# --- Default steering layers (TETNO/GROM optimizer configs) ---
DEFAULT_STEERING_LAYERS = (20, 21, 22)

# --- Search space: MLP ---
SEARCH_MLP_HIDDEN_DIMS = (128, 256, 512)
SEARCH_MLP_NUM_LAYERS = (1, 2, 3)

# --- Search space: TETNO/GROM shared ---
SEARCH_STEERING_RANGES = (3, 5)

# --- Search space: GROM ---
SEARCH_GROM_GATE_HIDDEN_DIMS = (32, 64)
SEARCH_GROM_INTENSITY_HIDDEN_DIMS = (16, 32)

# --- Hierarchical config: strengths ---
HIERARCHICAL_STRENGTHS = (0.3, 0.5, 0.7, 1.0, 1.3, 1.5, 2.0, 2.5, 3.0)

# --- Hierarchical config: MLP ---
HIERARCHICAL_MLP_HIDDEN_DIMS = (64, 128, 256, 512)
HIERARCHICAL_MLP_NUM_LAYERS_LIST = (1, 2, 3)

# --- Hierarchical config: TECZA ---
HIERARCHICAL_TECZA_DIRECTIONS = (1, 2, 3, 5)
HIERARCHICAL_TECZA_OPT_STEPS_LIST = (50, 100, 200)

# --- Hierarchical config: TETNO ---
HIERARCHICAL_TETNO_THRESHOLDS = (0.3, 0.5, 0.7)
HIERARCHICAL_TETNO_TEMPERATURES = (0.05, 0.1, 0.2, 0.5)

# --- Hierarchical config: GROM ---
HIERARCHICAL_GROM_DIRECTIONS = (3, 5, 8)
HIERARCHICAL_GROM_TEMPERATURES = (0.3, 0.5, 1.0)

# --- Agent generation ---
AGENT_STEERING_INITIAL_STRENGTH = 0.5
AGENT_STEERING_INCREMENT = 0.2
AGENT_STEERING_MAX_STRENGTH = 1.5
AGENT_STEERING_INITIAL_MIN = 0.1
AGENT_STEERING_INITIAL_MAX = 2.0
AGENT_STEERING_INCREMENT_MIN = 0.1
AGENT_STEERING_INCREMENT_MAX = 0.5
AGENT_STEERING_MAX_MIN = 0.5
AGENT_STEERING_MAX_MAX = 3.0
AGENT_QUALITY_STORAGE_THRESHOLD = 0.7

# --- Continual learning ---
CONTINUAL_SHARED_UPDATE_RATE = 0.1

# --- Classifier training ---
# CLASSIFIER_TEST_SIZE defined in _arb_01 (=0.2)

# --- Viz steering method presets ---
VIZ_PROJECTION_COMPONENTS = 5
VIZ_REPLACEMENT_BLEND = 0.5
VIZ_MLP_EPOCHS = 100
VIZ_CLAMPING_MARGIN = 0.1

# --- GROM optimization ---
GROM_ETA_MIN_FACTOR = 0.1
GROM_MAX_GRAD_NORM = 1.0
GROM_CAA_ALIGNMENT_THRESHOLD = 0.9
GROM_ROUTING_TEMP_EPS = 0.1

# --- SZLAK transport ---
SZLAK_GEODESIC_INF_MULTIPLIER = 2.0

# --- Evaluation ground-truth generation ---
PERPLEXITY_WIKITEXT_THRESHOLD = 100

# --- Agent decision pipeline ---
AGENT_DECISION_NUM_SAMPLES = 50

# --- Geometry cross-validation ---
GEOMETRY_CV_FOLDS = 3

# --- Cluster benchmark layer selections ---
CLUSTER_SMALL_MAX_LAYERS = 16
CLUSTER_MEDIUM_MAX_LAYERS = 32
CLUSTER_LAYERS_SMALL = (4, 6, 8, 10, 12, 14)
CLUSTER_LAYERS_MEDIUM = (8, 12, 16, 20, 24, 28)
CLUSTER_LAYERS_LARGE = (10, 20, 30, 40, 50, 60)

