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

# --- TECZA search ranges ---
TECZA_SEARCH_NUM_DIRECTIONS = (1, 2, 3, 5)
TECZA_SEARCH_OPT_STEPS = (50, 100)
TECZA_SEARCH_RETAIN_WEIGHTS = (0.0, 0.1, 0.3)

# --- TETNO search ranges ---
TETNO_SEARCH_STEERING_LAYERS = ("single", "range_3", "range_5")
TETNO_SEARCH_CONDITION_THRESHOLDS = (0.3, 0.5, 0.7)
TETNO_SEARCH_GATE_TEMPERATURES = (0.1, 0.5, 1.0)
TETNO_SEARCH_MAX_ALPHAS = (1.5, 2.0, 3.0)

# --- GROM search ranges ---
GROM_SEARCH_NUM_DIRECTIONS = (2, 3, 5)
GROM_SEARCH_STEERING_LAYERS = ("range_3", "range_5")
GROM_SEARCH_GATE_HIDDEN_DIMS = (32, 64, 128)
GROM_SEARCH_INTENSITY_HIDDEN_DIMS = (16, 32, 64)
GROM_SEARCH_OPT_STEPS = (100, 200)
GROM_SEARCH_BEHAVIOR_WEIGHTS = (0.5, 1.0)
GROM_SEARCH_RETAIN_WEIGHTS = (0.1, 0.2, 0.5)
GROM_SEARCH_SPARSE_WEIGHTS = (0.0, 0.05)
GROM_SEARCH_MAX_ALPHAS = (2.0, 3.0)

# --- Steering application defaults ---
STEERING_APP_INITIAL_TOKENS = 10
STEERING_APP_INITIAL_TOKENS_SHORT = 5
STEERING_APP_INITIAL_TOKENS_LONG = 20
STEERING_APP_DECAY_RATE = 0.1
STEERING_APP_DECAY_RATE_SLOW = 0.05
STEERING_APP_GAUSSIAN_CENTER = 0.5
STEERING_APP_GAUSSIAN_WIDTH = 0.2

# --- GROM loss weights ---
GROM_LOSS_CONTRASTIVE_WEIGHT = 2.0
GROM_LOSS_UTILITY_WEIGHT = 0.5
GROM_LOSS_CONCENTRATION_WEIGHT = 0.3
GROM_LOSS_GATE_WARMUP_WEIGHT = 0.5
GROM_LOSS_CONTRASTIVE_MARGIN = 2.0

# --- GROM geometry adaptation ---
GROM_ADAPT_CONE_THRESHOLD = 0.7
GROM_ADAPT_MANIFOLD_THRESHOLD = 0.8
GROM_ADAPT_LINEAR_DIRECTIONS = 1
GROM_ADAPT_COMPLEX_DIRECTIONS = 5
GROM_ADAPT_MAX_DIRECTIONS = 7

# --- GROM network dimension bounds ---
GROM_GATE_DIM_MIN = 32
GROM_GATE_DIM_MAX = 512
GROM_GATE_DIM_DIVISOR = 16
GROM_INTENSITY_DIM_MIN = 16
GROM_INTENSITY_DIM_MAX = 256
GROM_INTENSITY_DIM_DIVISOR = 32

# --- GROM loss: CAA alignment weight ---
GROM_LOSS_CAA_ALIGNMENT_WEIGHT = 0.5

# --- TECZA training ---
TECZA_SEPARATION_MARGIN = 1.0
TECZA_PERTURBATION_SCALE = 0.3
TECZA_UNIVERSAL_BASIS_NOISE = 0.1
TECZA_LOGGING_INTERVAL = 10

# --- TETNO training ---
TETNO_CONDITION_MARGIN = 0.5
TETNO_CONDITION_LOGGING_INTERVAL = 20
TETNO_MIN_LAYER_SCALE = 0.1

# --- MLP method ---
MLP_EARLY_STOPPING_PATIENCE = 20
MLP_INPUT_DIVISOR = 4

# --- Null test / metrics subsampling ---
MAX_PAIRS_FOR_NULL_TEST = 1000
MAX_PAIRS_FOR_METRICS = 1000

# --- Signal null test thresholds ---
NULL_TEST_Z_SCORE_NORMALIZER = 0.1

# --- Nonsense baseline defaults ---
NONSENSE_PAIRS_MIN = 30
NONSENSE_PAIRS_MAX = 100

# --- Threshold calibration quantiles ---
CALIBRATION_Q_NLI_MARGIN = 0.15
CALIBRATION_Q_NLI_ENT = 0.25
CALIBRATION_Q_EMB_DELTA = 0.10
CALIBRATION_Q_EMB_MATCH = 0.20
CALIBRATION_Q_PROBE_HIGH = 0.85
CALIBRATION_Q_PROBE_LOW = 0.35

# --- Optimize weights comparisons ---
WEIGHT_MIN_DISTANCE_FRACTION = 0.6

# --- Optimizer base thresholds ---
OPTIMIZER_CONSISTENCY_THRESHOLD = 0.5

# --- Diversity processor defaults ---
DIVERSITY_OPENER_PENALTY = -2.0
DIVERSITY_OPENER_CUTOFF_POS = 5
DIVERSITY_TRIE_PENALTY = -1.0
DIVERSITY_TRIE_MAX_DEPTH = 6
DIVERSITY_LEDGER_MAX_ITEMS = 200
DIVERSITY_SAMPLE_K = 5
DIVERSITY_MIN_CLAUSE_LENGTH = 12
DIVERSITY_MAX_CLAUSE_LENGTH = 80
DIVERSITY_WINDOW_SIZE = 6

# --- Clustering validation thresholds ---
CLUSTERING_MIN_SAMPLES = 20
CLUSTERING_STABILITY_THRESHOLD = 0.8
CLUSTERING_MAX_K_SEARCH = 6
CLUSTERING_BALANCE_THRESHOLD = 0.2
CLUSTERING_QUALITY_W_STABILITY = 0.4
CLUSTERING_QUALITY_W_K_CONF = 0.3
CLUSTERING_QUALITY_W_BALANCE = 0.3

# --- Intervention selection thresholds ---
INTERVENTION_CONFIDENCE_BASE = 0.5
INTERVENTION_MARGIN_WEIGHT = 0.3
INTERVENTION_Z_NORMALIZER = 3.0
INTERVENTION_CONF_STD_FACTOR = 0.1
INTERVENTION_MIN_SILHOUETTE = 0.1

# --- Advanced steering defaults ---
CLAMPING_MARGIN_DEFAULT = 0.1
CENTROID_SHIFT_FACTOR = 0.1
ADAPTIVE_MAX_STRENGTH = 2.0
ADVANCED_DEFAULT_STRENGTHS = (0.5, 1.0, 2.0, 5.0)

# --- Linearity test parameters ---
LINEARITY_TEST_GAP_THRESHOLD = 0.05
LINEARITY_TEST_P_THRESHOLD = 0.05
LINEARITY_TEST_RESIDUAL_THRESHOLD = 0.3
LINEARITY_TEST_RAMSEY_THRESHOLD = 0.03
LINEARITY_TEST_N_BOOTSTRAP = 30
LINEARITY_CONFIDENCE_HIGH = 0.8
LINEARITY_CONFIDENCE_LOW = 0.2
LINEARITY_CROSS_CONTEXT_THRESHOLD = 0.7

# --- Decomposition metrics ---
DECOMP_ADAPTIVE_K_MIN = 2
DECOMP_ADAPTIVE_K_MAX = 15
DECOMP_MIN_CLUSTER_SIZE_BASE = 5
DECOMP_CLUSTER_SIZE_RATIO = 20
DECOMP_MIN_SILHOUETTE = 0.3
DECOMP_MAX_SILHOUETTE_SAMPLES = 1000
DECOMP_MIN_CONCEPT_SAMPLES = 10
DECOMP_MIN_CONCEPT_SAMPLES_CHOW = 20
DECOMP_THRESHOLD_BASE = 0.5
DECOMP_THRESHOLD_MIN = 0.02
DECOMP_THRESHOLD_MAX = 0.1
DECOMP_COSINE_SIM_THRESHOLD = 0.8

# --- Intrinsic dimensionality ---
INTRINSIC_DIM_K = 10
PCA_VARIANCE_THRESHOLDS = (0.90, 0.95, 0.99)
TWO_NN_MU_THRESHOLD = 1.0

# --- Cloud metrics ---
CLOUD_MAX_SAMPLES_MANIFOLD = 500
CLOUD_MAX_SAMPLES_TOPOLOGY = 300
CLOUD_CONE_PERCENTILE = 90

# --- Concept pairs ---
CONCEPT_MIN_SAMPLES = 10
CONCEPT_SEPARABILITY_HIGH = 0.95
CONCEPT_MIXED_PAIR_THRESHOLD = 0.3

# --- Configurable recommendation ---
RECOMMEND_CONFIDENCE_MARGIN_WEIGHT = 0.5
RECOMMEND_BASELINE_CONFIDENCE = 0.3

# --- Strategy diagnostics scoring ---
STRATEGY_DIAG_W_LINEAR = 0.3
STRATEGY_DIAG_W_CONSISTENCY = 0.4
STRATEGY_DIAG_W_STEERING = 0.3
STRATEGY_DIAG_AB_THRESHOLD = 0.5
STRATEGY_DIAG_AB_PENALTY = 0.5
STRATEGY_DIAG_NONLINEAR_GAP = 0.05
STRATEGY_DIAG_LOW_CONSISTENCY = 0.1
STRATEGY_DIAG_LOW_LINEAR_ACC = 0.7
STRATEGY_DIAG_LOW_SEMANTIC = 0.05

# --- Direction stability metrics ---
DIRECTION_N_BOOTSTRAP = 30
DIRECTION_SUBSET_FRACTION = 0.5
DIRECTION_STD_PENALTY = 0.5
CONSISTENCY_W_COSINE = 0.4
CONSISTENCY_W_POSITIVE = 0.3
CONSISTENCY_W_HIGH_SIM = 0.3

# --- Statistical power analysis ---
POWER_EXCELLENT_THRESHOLD = 0.9
POWER_LOW_THRESHOLD = 0.5
MDE_SMALL_THRESHOLD = 0.3
MDE_MEDIUM_THRESHOLD = 0.6
MDE_LARGE_THRESHOLD = 1.0

# --- Shrinkage interpretation ---
SHRINKAGE_LOW = 0.1
SHRINKAGE_MODERATE = 0.3
SHRINKAGE_HIGH = 0.6

# --- Guided weight modification ---
GUIDED_MIN_LINEAR_SCORE = 0.5
GUIDED_SURGICAL_TOP_K = 3
GUIDED_FISHER_WEIGHT_MIN = 0.1
GUIDED_FISHER_WEIGHT_MAX = 2.0
GUIDED_MAX_DEGRADATION = 0.1

# --- Probe k-NN default ---
PROBE_KNN_K = 10

# --- Sparsity metrics ---
SPARSITY_THRESHOLD_FRACTION = 0.01

# --- Concept stability ---
CONCEPT_STABILITY_N_BOOTSTRAP = 20

# --- SimHash deduplication ---
DEDUP_WORD_NGRAM = 3
DEDUP_CHAR_NGRAM = 4

# --- Guided modification scoring ---
GUIDED_VARIANCE_THRESHOLD = 0.05
GUIDED_STRONG_SIGNAL = 0.8
GUIDED_MODERATE_SIGNAL = 0.6
GUIDED_FISHER_MAX_BOOST = 0.3
GUIDED_FISHER_BOOST_SCALE = 0.1
GUIDED_FISHER_LOG_DIVISOR = 5.0
GUIDED_EFFECT_MAX_BOOST = 0.2
GUIDED_EFFECT_BOOST_SCALE = 0.1
GUIDED_COHENS_D_NORMALIZER = 2.0
GUIDED_NONLINEAR_PENALTY = 0.5
GUIDED_WEIGHT_MAX = 1.5

# --- TETNO export/load ---
TETNO_HYBRID_STRENGTH_FACTOR = 0.5
TETNO_GATE_TEMPERATURE_LEGACY = 0.5
TETNO_DYNAMIC_BASE_STRENGTH = 1.0

# --- Kernel-based baking ---
KERNEL_MIN_ALPHA = 0.5

# --- HuggingFace upload retry ---
HF_UPLOAD_MAX_RETRIES = 8
HF_UPLOAD_BASE_WAIT = 120
HF_UPLOAD_BACKOFF_MAX_EXPONENT = 3
HF_UPLOAD_JITTER_MIN = 0.5
HF_UPLOAD_JITTER_MAX = 1.5

# --- Evaluator scoring ---
EVAL_WEIGHT_EMBEDDING = 0.4
EVAL_WEIGHT_NLI = 0.6
EVAL_MIN_MARGIN = 0.05
EVAL_CONFIDENCE_CEILING = 0.95
EVAL_CONFIDENCE_BASELINE = 0.6
EVAL_NLI_THRESHOLD = 0.5
EVAL_NLI_CONF_CEILING = 0.85
EVAL_NLI_CONF_BASE = 0.6
EVAL_NLI_CONF_SCALE = 0.3
EVAL_EMB_THRESHOLD = 0.6
EVAL_EMB_CONF_CEILING = 0.8
EVAL_EMB_CONF_BASE = 0.5
EVAL_EMB_CONF_SCALE = 0.3
EVAL_F1_MATCH_THRESHOLD = 0.8
EVAL_F1_PARTIAL_THRESHOLD = 0.5
EVAL_DEFAULT_DIFFERENCE_SCORE = 50.0
EVAL_DIFFERENCE_CUTOFF = 70
EVAL_W_DIFFERENCE = 0.2
EVAL_W_QUALITY = 0.3
EVAL_W_ALIGNMENT = 0.5

# --- Geometry adaptive thresholds ---
GEOMETRY_ADAPT_THRESHOLD_NUMERATOR = 0.5
GEOMETRY_ADAPT_THRESHOLD_MIN = 0.02
GEOMETRY_ADAPT_THRESHOLD_MAX = 0.1
