| 2477 | } |
| 2478 | |
| 2479 | if (max_prompt_out) *max_prompt_out = max_prompt; |
| 2480 | if (max_case_out) *max_case_out = max_case; |
| 2481 | return ctx; |
| 2482 | } |
| 2483 | |
| 2484 | static void eval_warn_think_max_downgraded(const eval_config *cfg) { |
| 2485 | if (cfg->think_mode != DS4_THINK_MAX || |
| 2486 | ds4_think_mode_for_context(cfg->think_mode, cfg->ctx_size) == DS4_THINK_MAX) { |
| 2487 | return; |
| 2488 | } |
| 2489 | fprintf(stderr, |
| 2490 | "ds4-eval: warning: --think-max needs --ctx >= %u; ctx=%d uses normal thinking instead\n", |
| 2491 | ds4_think_max_min_context(), |
| 2492 | cfg->ctx_size); |
| 2493 | } |
| 2494 | |
| 2495 | static void eval_warn_context_budget(const eval_config *cfg, int max_prompt_tokens, int max_prompt_case) { |
| 2496 | if (max_prompt_tokens >= cfg->ctx_size) { |
| 2497 | fprintf(stderr, |
| 2498 | "ds4-eval: warning: largest prompt (%d tokens, case=%d) does not fit ctx=%d\n", |
| 2499 | max_prompt_tokens, |
| 2500 | max_prompt_case + 1, |
| 2501 | cfg->ctx_size); |
| 2502 | return; |