"""Method-specific constants organized by steering method."""
from wisent.core.infrastructure.constant_definitions.for_experiments.by_method._grom import *  # noqa: F401,F403
from wisent.core.infrastructure.constant_definitions.for_experiments.by_domain import *  # noqa: F401,F403

# --- Common steering defaults ---
DEFAULT_STRENGTH = 1.0
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
DEFAULT_OPTIMIZATION_STEPS = 100
DEFAULT_WEIGHT_DECAY = 0.01
BEHAVIOR_THRESHOLD = 0.0
DEFAULT_LAYER_WEIGHT = 1.0
DEFAULT_METHOD_LAYER_RANGE_END = 37
DEFAULT_STEERING_LAYERS = (20, 21, 22)
GATING_HIDDEN_DIM_DIVISOR = 2

# --- 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

# --- Advanced steering ---
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)
CLAMPING_STEERING_MARGIN = 0.5
BETA_SEARCH_GRID = (0.3, 0.5, 0.7, 0.9)
ADAPTIVE_STRENGTH_MULTIPLIER = 2

# --- Steering alpha range ---
STEERING_ALPHA_MIN = -3.0
STEERING_ALPHA_MAX = 3.0
STEERING_BASE_STRENGTH_DEFAULT = 0.5
STEERING_LOSS_MARGIN = 0.5
TEST_STEERING_SCALE = 0.5

# --- Detection / config ---
DETECTION_THRESHOLD = 0.6
CONFIG_MAX_ALPHA = 2.0

# --- Temporal ramp ---
TEMPORAL_RAMP_MIN = 0.1
TEMPORAL_RAMP_MAX = 1.0

# --- Layer thresholds (model size) ---
LAYER_THRESHOLD_SMALL = 16
LAYER_THRESHOLD_MEDIUM = 32
LAYER_THRESHOLD_LARGE = 48

# --- Layer sampling divisors ---
LAYER_SAMPLING_DIVISOR_TRAINING = 4
SENSOR_LAYER_SAMPLING_DIVISOR = 6

# --- Layer defaults ---
QUALITY_CLASSIFIER_DEFAULT_LAYER = 20
TEST_DETECTOR_DEFAULT_LAYER = 6
QWEN3_4B_DEFAULT_LAYER = 17

# --- 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)

# --- Comparison module ---
COMPARISON_EVAL_BATCH_SIZE = 64
COMPARISON_NUM_PAIRS = 50
COMPARISON_TEST_SIZE = 20
COMPARISON_STEERING_LAYER = 12
COMPARISON_LORA_LEARNING_RATE = 2e-4
COMPARISON_REFT_LEARNING_RATE = 5e-4
COMPARISON_NUM_EPOCHS_DEFAULT = 3
COMPARISON_STEERING_SCALES = (1.0, 2.0, 4.0)
TRAINING_WARMUP_RATIO = 0.1

# --- LoRA / LoReFT ---
LORA_DEFAULT_DROPOUT = 0.05
LORA_DPO_LEARNING_RATE = 5e-5
LORA_DPO_NUM_EPOCHS = 1
LOREFT_DEFAULT_RANK = 4

# --- SAE ---
SAE_N_EPOCHS_DEFAULT = 500
SAE_L1_COEF_DEFAULT = 5e-4
SAE_TOP_K_DEFAULT = 4
SAE_HIDDEN_DIM_MULTIPLIER = 4
SAE_TOP_K_ANALYSIS = 20

# --- BOS feature detection ---
BOS_NUM_SAMPLES_DEFAULT = 2000
BOS_MIN_LENGTH_DEFAULT = 50
BOS_TOP_K_DEFAULT = 20
BOS_ARGPARSE_NUM_SAMPLES = 1000

# --- Abliteration ---
ABLITERATION_BASELINE_ACC = 0.44
ABLITERATION_NUM_PAIRS = 300
ABLITERATION_DEFAULT_POSITION = 8.0
ABLITERATION_DEFAULT_DISTANCE = 6.0
ABLITERATION_BINARY_SEARCH_LOW = 0.5
ABLITERATION_BINARY_SEARCH_HIGH = 3.0
ABLITERATION_BINARY_SEARCH_ITERS = 5

# --- FGAA comparison ---
FGAA_DENSITY_THRESHOLD = 0.01
FGAA_TOP_K_POSITIVE = 50
FGAA_TOP_K_NEGATIVE = 0

# --- K-values for benchmarks ---
LIVEMATHBENCH_K_VALUES = (4, 8, 16)
LIVEMATHBENCH_K_VALUES_SMALL = (2, 4, 8)
LIVEMATHBENCH_TAU_VALUES = (0.25, 0.5, 0.75, 1.0)
LIVEMATHBENCH_NUM_SAMPLES = 48
BIGCODE_K_VALUES = (1, 10, 100)
CONCEPT_DETECTION_COARSE_K = (
    2, 3, 5, 8, 10, 15, 20, 30, 50, 75, 100, 150, 200,
)

# --- LM harness sample counts ---
LM_HARNESS_NUM_SAMPLES_SMALL = 3
LM_HARNESS_NUM_SAMPLES_DEFAULT = 5

# --- Neuron analysis ---
TOP_NEURONS_COUNT = 20
TOP_NEURONS_SHORT_COUNT = 10
HIGH_DIM_THRESHOLD = 1000
THRESHOLD_HIDDEN_DIM_LARGE = 4096
THRESHOLD_HIDDEN_DIM_DEFAULT = 100

# --- Test/split/benchmark defaults ---
TEST_DEFAULT_LIMIT = 10
TEST_BENCHMARK_TOP_K = 3
BENCH_TEST_SAMPLE_SIZE = 3
BENCH_TEST_SAMPLE_MIN = 2
SPLIT_RATIO_HALF = 0.5
SPLIT_RATIO_70 = 0.7
CODING_BENCHMARK_DEFAULT_LIMIT = 5
N_BOOTSTRAP_DEFAULT = 100
MAX_K_DEFAULT = 6
NOISE_BASELINE_N_SAMPLES = 5
POLICY_LAYER_COUNT = 5
MODEL_COLLECT_TOPK = 5
RANDOM_MATH_ANSWER_MAX = 1000
KNN_DEFAULT_K = 10
POLYMATH_DEFAULT_K = 16
SYNTHETIC_EVAL_NUM_PROMPTS = 10

# --- Quality eval bounds ---
QUALITY_EVAL_LAYER_MIN = 8
QUALITY_EVAL_LAYER_MAX = 20
QUALITY_EVAL_SAMPLES_MIN = 10
QUALITY_EVAL_SAMPLES_MAX = 50

# --- Threshold search init ---
THRESHOLD_SEARCH_INIT_VALUE = 0.5
