"""
Named numeric constants for the wisent package.
ALL numeric defaults MUST be defined here and imported by name.
"""
from wisent.core._constants_part2 import *  # noqa: F401,F403
# --- Numerical stability ---
NORM_EPS = 1e-8
LOG_EPS = 1e-12
ZERO_THRESHOLD = 1e-10
COMPARE_TOL = 1e-6
NEAR_ZERO_TOL = 1e-9
SHERMAN_MORRISON_EPS = 1e-12

# --- Regularization / tolerances ---
TIKHONOV_REG = 1e-4
EARLY_STOP_TOL = 1e-4
MIN_NORM_THRESHOLD = 1e-4
DEFAULT_CLASSIFIER_LR = 1e-3
L1_DEFAULT_COEF = 1e-3
MATH_REL_TOL = 1e-4
MATH_PERCENT_REL_TOL = 1e-3
SYMPY_REL_TOL = 1e-9

# --- Optuna search bounds ---
LR_LOWER_BOUND = 1e-4
LR_UPPER_BOUND = 1e-2
ALPHA_LOWER_BOUND = 1e-4
ALPHA_UPPER_BOUND = 1e-1

# --- SVD / subspace ---
MIN_CONCEPT_DIM = 2
MAX_CONCEPT_DIM = 32
DEFAULT_VARIANCE_THRESHOLD = 0.80
MARGINAL_VARIANCE_THRESHOLD = 0.05
UNIVERSAL_SUBSPACE_RANK = 16

# --- Broyden solver ---
BROYDEN_DEFAULT_NUM_STEPS = 3
BROYDEN_DEFAULT_ALPHA = 1.0
BROYDEN_DEFAULT_ETA = 0.5
BROYDEN_DEFAULT_BETA = 0.0
BROYDEN_DEFAULT_ALPHA_DECAY = 1.0

# --- Common defaults ---
DEFAULT_STRENGTH = 1.0
DEFAULT_RANDOM_SEED = 42
DEFAULT_LAYER = 16
DEFAULT_LAYER_CONFIG = 12
DEFAULT_NUM_HIDDEN_LAYERS = 32
DEFAULT_SCORE = 0.0
SIMILARITY_THRESHOLD = 0.8
BLEND_DEFAULT = 0.5
DEFAULT_SCALE = 1.0

# --- TECZA method ---
TECZA_NUM_DIRECTIONS = 3
TECZA_MARGINAL_THRESHOLD = 0.05
TECZA_MAX_DIRECTIONS = 10
TECZA_OPTIMIZATION_STEPS = 100
TECZA_LEARNING_RATE = 0.01
TECZA_RETAIN_WEIGHT = 0.1
TECZA_INDEPENDENCE_WEIGHT = 0.05
TECZA_ABLATION_WEIGHT = 1.0
TECZA_ADDITION_WEIGHT = 1.0
TECZA_MIN_COSINE_SIM = 0.3
TECZA_MAX_COSINE_SIM = 0.95

# --- TETNO method ---
TETNO_CONDITION_THRESHOLD = 0.5
TETNO_GATE_TEMPERATURE = 0.1
TETNO_ENTROPY_FLOOR = 0.5
TETNO_ENTROPY_CEILING = 2.0
TETNO_MAX_ALPHA = 2.0
TETNO_OPTIMIZATION_STEPS = 100
TETNO_LEARNING_RATE = 0.01
TETNO_THRESHOLD_SEARCH_STEPS = 20

# --- GROM method ---
GROM_NUM_DIRECTIONS = 5
GROM_OPTIMIZATION_STEPS = 200
GROM_LEARNING_RATE = 0.005
GROM_WARMUP_STEPS = 20
GROM_BEHAVIOR_WEIGHT = 1.0
GROM_RETAIN_WEIGHT = 0.2
GROM_SPARSE_WEIGHT = 0.05
GROM_SMOOTH_WEIGHT = 0.02
GROM_INDEPENDENCE_WEIGHT = 0.03
GROM_MAX_ALPHA = 3.0
GROM_GATE_TEMPERATURE = 0.5
GROM_MIN_COSINE_SIM = 0.2
GROM_MAX_COSINE_SIM = 0.9
GROM_LINEAR_THRESHOLD = 0.8
GROM_HIDDEN_DIM = 128
GROM_ROUTER_HIDDEN_DIM = 64
GROM_INTENSITY_HIDDEN_DIM = 32
GROM_ROUTER_TEMPERATURE = 0.5

# --- NURT method ---
NURT_NUM_DIMS = 0
NURT_TRAINING_EPOCHS = 300
NURT_LR = 0.001
NURT_LR_MIN = 0.0001
NURT_NUM_INTEGRATION_STEPS = 4
NURT_T_MAX = 1.0

# --- SZLAK method ---
SZLAK_SINKHORN_REG = 0.1
SZLAK_INFERENCE_K = 5
SZLAK_MAX_ITER = 100
SZLAK_HIGH_REG = 1.0
SZLAK_SPARSE_K = 10

# --- PRZELOM method ---
PRZELOM_EPSILON = 1.0
PRZELOM_INFERENCE_K = 5
# --- WICHER method ---
WICHER_CONCEPT_DIM = 0
# --- OSTRZE method ---
OSTRZE_C = 1.0

# --- MLP method ---
MLP_HIDDEN_DIM = 256
MLP_NUM_LAYERS = 2
MLP_DROPOUT = 0.1
MLP_OPTIMIZATION_STEPS = 100
MLP_LEARNING_RATE = 0.001
MLP_WEIGHT_DECAY = 0.01

# --- Generation / inference ---
DEFAULT_MAX_NEW_TOKENS = 128
DEFAULT_MAX_NEW_TOKENS_EVAL = 100
DEFAULT_MAX_NEW_TOKENS_LONG = 32768
DEFAULT_MAX_NEW_TOKENS_ADAPTER = 256
DEFAULT_MAX_NEW_TOKENS_EVAL_DOCKER = 200
DEFAULT_INFERENCE_TEMPERATURE = 0.7
DEFAULT_TOP_P = 0.9
DEFAULT_TOP_K = 50
DEFAULT_REPETITION_PENALTY = 1.0
DEFAULT_NO_REPEAT_NGRAM = 0

# --- Optimization / evaluation ---
DEFAULT_N_TRIALS = 100
DEFAULT_LIMIT = 100
DEFAULT_NUM_EVAL_PROMPTS = 30
DEFAULT_NUM_STRENGTH_STEPS = 5
DEFAULT_CHECKPOINT_INTERVAL = 5
OPTUNA_N_TRIALS_SMALL = 20
LAYER_SWEEP_STRENGTH = 1.0
DEFAULT_SHOW_COMPARISONS = 0

# --- Classifier ---
CLASSIFIER_TEST_SIZE = 0.2
CLASSIFIER_NUM_EPOCHS = 50
CLASSIFIER_BATCH_SIZE = 32
CLASSIFIER_HIDDEN_DIM = 128
CLASSIFIER_DROPOUT = 0.2
CLASSIFIER_THRESHOLD = 0.5

# --- Diagnostics / quality ---
QUALITY_THRESHOLD = 50.0
MAX_REGENERATION_ATTEMPTS = 3
DIAG_MIN_DIVERGENCE = 0.3
DIAG_MAX_LOW_DIV_FRACTION = 0.1
DIAG_NEAR_DUPLICATE_THRESHOLD = 0.9
DIAG_NUM_COMPONENTS = 5
DIAG_OPTIMIZATION_STEPS = 50
DIAG_MAX_PAIR_COMBINATIONS = 50

# --- Geometry / visualization ---
VIZ_N_COMPONENTS_2D = 2
VIZ_PCA_COMPONENTS = 50
VIZ_MAX_SAMPLES = 200
VIZ_PERPLEXITY = 30
VIZ_N_NEIGHBORS = 15
VIZ_MIN_DIST = 0.1
VIZ_N_NEIGHBORS_TRIMAP = 10
VIZ_NUM_ITERS = 50
VIZ_PCA_DIMS_TRIMAP = 30
VIZ_LIMIT = 200

# --- Statistical testing ---
STAT_ALPHA = 0.05
TARGET_POWER = 0.80
N_BOOTSTRAP = 10
CONFIDENCE_LEVEL = 0.95

# --- Continual learning ---
REPLAY_BUFFER_MAX_SIZE = 200
EWC_PERTURBATION_SCALE = 0.01
EWC_LEARNING_RATE = 1.0
CONTINUAL_EWC_LAMBDA = 1000.0
CONTINUAL_FORGETTING_THRESHOLD = 0.9
CONTINUAL_CONVERGENCE_WINDOW = 10
CONTINUAL_REPLAY_INTERVAL = 5

# --- Data loading ---
DATA_LOAD_LIMIT = 200
DATA_CHUNK_SIZE = 50
NONSENSE_N_PAIRS = 50
NONSENSE_N_FOLDS = 5
DEFAULT_SPLIT_RATIO = 0.8
SAMPLES_PER_BENCHMARK = 10
DEFAULT_NUM_SAMPLES = 5

# --- Agent ---
AGENT_MAX_WORKERS = 4
AGENT_CLASSIFIER_EPOCHS = 50

# --- Docker / sandbox ---
DOCKER_CPU_LIMIT_S = 3
DOCKER_WALL_TIMEOUT_S = 8
DOCKER_MEM_LIMIT_MB = 4096
DOCKER_FSIZE_MB = 16
DOCKER_NPROC = 128
DOCKER_NOFILE = 512
FEEDBACK_MAX_CHARS = 2000
EVAL_TIME_LIMIT_S = 8
EVAL_CPU_LIMIT_S = 3
EVAL_MEM_LIMIT_MB = 768

# --- Evaluator thresholds ---
NLI_MARGIN = 0.12
NLI_ENT_MIN = 0.40
EMB_DELTA_MIN = 0.04
EMB_MATCH_MIN = 0.35
TRUTHFUL_MIN_SIMILARITY = 0.3
TRUTHFUL_MIN_MARGIN = 0.05

# --- Multimodal ---
AUDIO_SAMPLE_RATE = 16000
VIDEO_KEYFRAME_INTERVAL = 4
VIDEO_TEMPORAL_DECAY = 0.9
VIDEO_NUM_FRAMES = 16
VIDEO_FRAME_SAMPLE_RATE = 4

# --- Steering analysis ---
STEERING_N_RANDOM = 20
STEERING_N_PCA = 10
STEERABILITY_AMBIENT_DIM = 4096
CONE_THRESHOLD = 0.7
CONE_DIRECTIONS = 5
MANIFOLD_NEIGHBORS = 10
MAX_CLUSTERS = 5
MOVEMENT_THRESHOLD = 0.6
BEHAVIOR_THRESHOLD = 0.0

# --- Recommendation ---
RECOMMEND_LINEAR_PROBE_HIGH = 0.85
RECOMMEND_LINEAR_PROBE_LOW = 0.65
RECOMMEND_NONLINEARITY_GAP = 0.05
RECOMMEND_ICD_HIGH = 0.7
RECOMMEND_ICD_LOW = 0.3
RECOMMEND_STABILITY_HIGH = 0.8
RECOMMEND_STABILITY_LOW = 0.5
RECOMMEND_TOP_K = 2
RECOMMEND_N_TRIALS = 500
RECOMMEND_COLLECTOR_PER_TYPE = 2

# --- Personalization / welfare ---
PERSONALIZATION_N_TRIALS = 20
PERSONALIZATION_LIMIT = 100
WELFARE_LIMIT = 50

# --- Transport RL ---
RL_NUM_EPISODES = 10
RL_EPSILON = 0.1
RL_BASELINE = 0.5
RL_DISCOUNT = 1.0
RL_BATCH_LIMIT = 100

# --- Timing ---
TIMING_SAMPLES_PER_TASK = 1000

# --- Pairs generation ---
PAIRS_NUM_PAIRS = 100
PAIRS_MIN_LENGTH = 100
PAIRS_MAX_LENGTH = 500
# --- Geometry search ---
GEO_PAIRS_PER_BENCHMARK = 50
GEO_MAX_LAYER_COMBO_SIZE = 3
GEO_ESTIMATED_TIME_PER_EXTRACTION = 120.0
# --- Weight modification ---
WM_TOLERANCE = 0.01
WM_MAX_INTERFERENCE = 0.3
WM_BRANDING_WIDTH = 48
# --- Misc ---
N_STABILITY_RUNS = 5
CV_FOLDS = 5
VAL_SPLIT = 0.2
MAX_COMBINATIONS = 1000
BENCHMARK_WEIGHT = 0.7
PROBE_WEIGHT = 0.3
DEFAULT_BATCH_SIZE = 8
ACTIVATIONS_BATCH_SIZE = 8
BLEU_THRESHOLD = 0.5
BLEU_MAX_ORDER = 4
EVAL_BATCH_SIZE = 4
MAX_NEW_TOKENS_STEERED = 50
TRACKING_SAMPLING_INTERVAL = 0.1
MAX_DEPTH = 3
