"""Constants requiring experimental optimization."""
from wisent.core.grp_05.sub_constants.for_experiments.sub_exp._exp_06 import *  # noqa: F401,F403

DETECTOR_CONE_THRESHOLD_LOW = 0.1
DETECTOR_CONE_RANGE_MID = 0.3
DETECTOR_CONE_SCALE_MID = 0.2
DETECTOR_CONE_RANGE_HIGH = 0.7
DETECTOR_CONE_SCALE_HIGH = 0.4
DETECTOR_CONE_OFFSET_TOP = 0.8
DETECTOR_CONE_RANGE_TOP = 0.7
DETECTOR_CONE_SCALE_TOP = 0.3
DETECTOR_SMALL_SAMPLE_N = 20
DETECTOR_CLUSTER_SAMPLE_N = 30

# --- Subspace validation dynamic thresholds ---
SUBSPACE_NORM_TOLERANCE = 0.05
SUBSPACE_SPECTRAL_RATIO_LOW = 0.1
SUBSPACE_SPECTRAL_RATIO_HIGH = 0.2
SUBSPACE_VAR_THRESHOLD_MAX = 0.95
SUBSPACE_VAR_THRESHOLD_ADJUST = 0.1
SUBSPACE_CONE_MIN_DYNAMIC = 0.5
SUBSPACE_CONE_ADJUST = 0.1
SUBSPACE_VAR_THRESHOLD_MIN = 0.75
SUBSPACE_VAR_FINE_ADJUST = 0.05
SUBSPACE_HIDDEN_DIM_LARGE = 4096
SUBSPACE_SILHOUETTE_MIN_DYNAMIC = 0.4
SUBSPACE_SILHOUETTE_ADJUST = 0.1

# --- Diagnostic significance markers ---
DIAG_SIGNIFICANCE_STRONG = 0.3
DIAG_SIGNIFICANCE_MODERATE = 0.1
DIAG_SIGNIFICANCE_WEAK = 0.05
DIAG_SCORE_HIGH = 0.8
DIAG_SCORE_MODERATE = 0.6
DIAG_SCORE_LOW = 0.4

# --- Diagnose vectors thresholds ---
DIAG_NORM_TOLERANCE = 0.01
DIAG_ZERO_PCT_THRESHOLD = 50
DIAG_MEAN_MAGNITUDE_THRESHOLD = 0.5
DIAG_NORM_MIN = 0.01
DIAG_NORM_MAX = 100

# --- Marketplace quality scoring ---
MARKETPLACE_QUALITY_MAX = 0.80
MARKETPLACE_QUALITY_BASE = 0.60
MARKETPLACE_QUALITY_INCREMENT = 0.05
MARKETPLACE_QUALITY_DEFAULT = 0.55

# --- Decomposition PCA ---
DECOMP_PCA_DIMS_MAX = 50
DECOMP_KMEANS_N_INIT_MIN = 3
DECOMP_KMEANS_N_INIT_MAX = 10
DECOMP_KMEANS_SCALING_FACTOR = 1000

# --- Cloud metrics ---
CLOUD_VAR_PERCENTILE_50 = 0.5
CLOUD_VAR_PERCENTILE_90 = 0.9
CLOUD_VAR_PERCENTILE_99 = 0.99
CLOUD_K_NEIGHBORS_DEFAULT = 10

# --- Intrinsic dim top eigenvalues ---
INTRINSIC_DIM_TOP_N = 10

# --- Steering autotuner ---
AUTOTUNER_ACCURACY_DECREMENT = 0.01
AUTOTUNER_ACCURACY_FILTER = 0.5

# --- Steering layer bounds ---
STEERING_LOSS_MARGIN = 0.5

# --- Multi-layer improvement ---
MULTI_LAYER_IMPROVEMENT_THRESHOLD = 0.05
MULTI_LAYER_AGREEMENT_THRESHOLD = 0.8

# --- Logistic regression bounds ---
GEOMETRY_LOGISTIC_C_MIN = 0.01
GEOMETRY_LOGISTIC_C_MAX = 10.0

# --- Agent synthetic pair generation ---
AGENT_SYNTH_MIN_PAIRS = 5
AGENT_SYNTH_TIME_MULTIPLIER = 3

# --- Parser optimization defaults ---
PARSER_DEFAULT_SAMPLE_LIMIT = 100
PARSER_DEFAULT_MAX_ITERATIONS = 10
PARSER_DEFAULT_NOISE_SCALE = 0.1
PARSER_DEFAULT_NUM_STRENGTHS = 10

# --- Parser continual learning defaults ---
PARSER_CONTINUAL_MAX_CYCLES = 100
PARSER_CONTINUAL_REPLAY_SIZE = 50

# --- Parser Optuna defaults ---
PARSER_OPTUNA_TRIALS = 300
PARSER_OPTUNA_STARTUP_TRIALS = 10
PARSER_OPTUNA_EARLY_STOP_PATIENCE = 10
PARSER_OPTUNA_NUM_PAIRS = 100

# --- Parser full optimize defaults ---
PARSER_FULL_OPTIMIZE_TRIALS = 50
PARSER_FULL_OPTIMIZE_MIN_QUALITY = 2
PARSER_FULL_OPTIMIZE_MAX_TIME = 20.0
PARSER_FULL_OPTIMIZE_SAMPLE_SIZES = (5, 10, 20, 50, 100, 200, 500)

# --- Verify steering parser ---
VERIFY_STEERING_THRESHOLD = 0.3

# --- Geometry search parser ---
GEOMETRY_SEARCH_LIMIT = 50
GEOMETRY_SEARCH_PARAM_COUNT = 3

# --- Diagnose vectors parser ---
DIAG_PARSER_THRESHOLD = 0.7
DIAG_PARSER_COUNT_SMALL = 5
DIAG_PARSER_COUNT_LARGE = 10

# --- Optimize sample size parser ---
OPTIMIZE_SAMPLE_TEST_SIZE = 200
OPTIMIZE_SAMPLE_TEST_SPLIT = 0.2

# --- Cluster benchmarks ---
CLUSTER_PROGRESS_INTERVAL = 20
CLUSTER_MIN_PAIRS = 10
CLUSTER_PROMPT_TRUNCATION = 500
CLUSTER_RESPONSE_TRUNCATION = 200

# --- Steering method architectural ---
GATING_HIDDEN_DIM_DIVISOR = 2

# --- EOT survival ratio clamping ---
EOT_SURVIVAL_MIN_RATIO = 1.0


# --- OSTRZE parser defaults ---
OSTRZE_DEFAULT_ITERATIONS = 1000
# --- TETNO parser defaults ---
TETNO_DEFAULT_NUM_DIRECTIONS = 3
TETNO_DEFAULT_STEP_SIZE = 0.01
TETNO_GATE_SCALE_FACTOR = 0.1
# --- GROM parser defaults ---
GROM_DEFAULT_LAMBDA = 0.5
GROM_DEFAULT_LR = 0.1
GROM_DEFAULT_NUM_ITER = 5
GROM_GATING_SHRINK_FACTOR = 2
# --- NURT parser defaults ---
NURT_DEFAULT_STRENGTH = 3.0
NURT_DEFAULT_TEMPERATURE = 0.5
# --- SZLAK parser defaults ---
SZLAK_DEFAULT_EPSILON = 0.80
SZLAK_DEFAULT_MAX_ITER = 300
SZLAK_DEFAULT_STEP_SIZE = 0.001
SZLAK_DEFAULT_ITER_PER_SCALE = 4
# --- PRZELOM parser defaults ---
PRZELOM_DEFAULT_INFERENCE_K = 1.0
# --- Model config parser defaults ---
MODEL_CONFIG_DETECTION_THRESHOLD = 0.6
MODEL_CONFIG_TEST_SAMPLE_LIMIT = 5
# --- Weight modification parser defaults ---
MODIFY_WEIGHTS_MAX_ITERATIONS = 100
MODIFY_WEIGHTS_LR_SCHEDULES = 3
MODIFY_WEIGHTS_DEFAULT_ALPHA = 1.0
MODIFY_WEIGHTS_ADDITIVE_ALPHA = 1.0
MODIFY_WEIGHTS_MAX_ALPHA = 1.5
MODIFY_WEIGHTS_MIN_ALPHA = 0.3
MODIFY_WEIGHTS_SURGICAL_TOP_K = 3
MODIFY_WEIGHTS_MIN_LINEAR_SCORE = 0.5
MODIFY_WEIGHTS_MAX_DEGRADATION = 0.1
# --- Additive method ---
ADDITIVE_METHOD_MAX_ALPHA = 2.0
ADDITIVE_KERNEL_CENTER_DIVISOR = 2.0
ADDITIVE_KERNEL_SIGMA_DIVISOR = 2.0
# --- Agent parser defaults ---
AGENT_MAX_PARALLEL_WORKERS = 4
AGENT_DEFAULT_STEERING_STRENGTH = 1.0
# --- Generate responses parser defaults ---
GENERATE_RESPONSES_STRENGTH_MULT = 1.0
# --- Optimize weights parser defaults ---
OPTIMIZE_WEIGHTS_CHECKPOINT_INTERVAL = 5
OPTIMIZE_WEIGHTS_NUM_EVAL_PROMPTS = 30
OPTIMIZE_WEIGHTS_TARGET_VALUE = 0.95
# --- Optimize steering comprehensive parser ---
OPTIMIZE_COMPREHENSIVE_SAMPLE_LIMIT = 100
OPTIMIZE_COMPREHENSIVE_TIME_LIMIT = 20.0
OPTIMIZE_COMPREHENSIVE_GEN_EXAMPLES = 3
OPTIMIZE_COMPREHENSIVE_MAX_STRENGTH = 5.0
OPTIMIZE_COMPREHENSIVE_MIN_THRESHOLD = 0.1
OPTIMIZE_COMPREHENSIVE_OPTUNA_TRIALS = 300
OPTIMIZE_COMPREHENSIVE_STARTUP_TRIALS = 10
# --- Sensitivity parser ---
SENSITIVITY_DEFAULT_THRESHOLD = 0.01
# --- Synthetic parser ---
SYNTHETIC_DEDUP_SIMILARITY = 0.95
SYNTHETIC_QUALITY_THRESHOLD = 0.7
SYNTHETIC_MIN_QUALITY = 0.3
# --- Optimization core thresholds ---
OPTIMIZE_CLASSIFICATION_THRESHOLDS = (0.3, 0.5, 0.7)
OPTIMIZE_WEIGHT_MOD_TARGET = 0.8
# --- Intervention selection min pairs ---
MIN_PAIRS_CAA = 10
MIN_PAIRS_OSTRZE = 20
MIN_PAIRS_MLP = 50
MIN_PAIRS_TECZA = 30
MIN_PAIRS_GROM = 100
# --- Steerability and geometry sample limits ---
STEERABILITY_SILHOUETTE_SAMPLE_LIMIT = 200
MANIFOLD_LINEARITY_SAMPLE_LIMIT = 50
STABILITY_LOO_SAMPLE_LIMIT = 100
# --- Power analysis search ranges ---
POWER_ANALYSIS_MIN_N = 8
POWER_ANALYSIS_MAX_N = 10000
POWER_ANALYSIS_STEP = 2
SAMPLE_ADEQUACY_MAX_N = 20000
# --- Layer defaults ---
QUALITY_CLASSIFIER_DEFAULT_LAYER = 20
GROM_SENSOR_LAYER_DEFAULT = 15
# --- Neuron analysis ---
TOP_NEURONS_COUNT = 20
TOP_NEURONS_SHORT_COUNT = 10
# --- Concept correlation thresholds ---
CONCEPT_CORRELATION_HIGH = 0.5
CONCEPT_CORRELATION_MODERATE = 0.2
CLUSTERING_MEANINGFUL_THRESHOLD = 0.1
# --- Multi-layer helpers ---
MULTI_LAYER_WEIGHT_MIN = 0.5
MULTI_LAYER_WEIGHT_MAX = 1.5
MULTI_LAYER_SCORE_THRESHOLD = 0.1
MULTI_LAYER_LOW_AGREEMENT = 0.4
# --- Timing estimation ---
TIME_ESTIMATOR_CLASSIFICATION_LAYERS = 5
TIME_ESTIMATOR_CV_LAYERS = 10
TIMING_CALIBRATION_BASE_SAMPLES = 10
LAYER_COMBOS_PREVIEW_LIMIT = 20
DEFAULT_CODE_EVAL_LIMIT = 20
# --- Percentile values ---
PERCENTILE_HIGH = 95
PERCENTILE_CRITICAL = 99
# --- Score adjustments ---
CLASSIFIER_RECENCY_BONUS = 0.1
COHERENCE_DEGENERATION_PENALTY = 0.5
# --- Dimension thresholds ---
HIGH_DIM_THRESHOLD = 1000


# --- Marketplace helpers ---
MARKETPLACE_BASE_TRAINING_TIME = 8.0
MARKETPLACE_PER_BENCHMARK_TIME = 2.0
MARKETPLACE_SYNTHETIC_TRAINING_TIME = 6.0
MARKETPLACE_SYNTHETIC_SAMPLES = 50
MARKETPLACE_DEFAULT_OPTIMAL_LAYER = 14
MARKETPLACE_MAX_TASKS_TO_SEARCH = 1000
MARKETPLACE_MAX_RELEVANT_BENCHMARKS = 30
MARKETPLACE_MAX_RELEVANT_TO_RETURN = 15
MARKETPLACE_MAX_SIMILARITY_SCORE = 10.0
MARKETPLACE_LAYER_MIN = 8
MARKETPLACE_LAYER_MAX = 20
MARKETPLACE_CONFIDENCE_WITH_BENCHMARKS = 0.8
MARKETPLACE_CONFIDENCE_WITHOUT_BENCHMARKS = 0.6
MARKETPLACE_CUDA_SPEED_MULTIPLIER = 0.3
MARKETPLACE_MPS_SPEED_MULTIPLIER = 0.5
MARKETPLACE_MAX_TASKS_DEFAULT = 10
# --- Synthetic system costs ---
AGENT_SYNTH_TRAIT_DISCOVERY_COST_S = 10.0
AGENT_SYNTH_DATA_GEN_COST_PER_PAIR_S = 30.0
AGENT_SYNTH_CLASSIFIER_TRAINING_COST_S = 180.0
AGENT_SYNTH_PAIRS_PER_TRAIT = 12
AGENT_SYNTH_DEFAULT_PAIRS = 15
# --- Device benchmark defaults ---
AGENT_BENCH_EVAL_DEFAULT_SECONDS = 60.0
AGENT_CLASSIFIER_TRAINING_DEFAULT_SECONDS = 600.0
# --- Classifier scoring weights ---
CLASSIFIER_SCORE_DIRECT_MATCH = 5.0
CLASSIFIER_SCORE_EXACT_CONCEPT = 4.0
CLASSIFIER_SCORE_PARTIAL_CONCEPT = 2.0
CLASSIFIER_SCORE_SEMANTIC_SIMILAR = 1.5
CLASSIFIER_SCORE_TOKEN_EXACT = 3.0
