Skip to content

--budget, --order and --seed are accepted and ignored by --backend model, silently #38

Description

@vyncint

Good first issue. One small inconsistency, findable and fixable without
knowing the tool.

What 2.0.0 established

tune --backend model writes no run directory, so
#22 made it answer an
--out that the caller took the trouble to type, rather than accept it and do
nothing:

$ launchbound tune reduce-flip --backend model --cc 8.6 --out /tmp/run
note: --out is unused with --backend model — it prints the ranking and writes
      no run directory. `launchbound stage` writes one that `launchbound
      report` can read.

The flags that still go quiet

Two others are accepted and ignored, with nothing said:

$ launchbound tune reduce-flip --backend model --cc 8.6 --order random --seed 42
$ launchbound tune reduce-flip --backend model --cc 8.6 --budget 30m
  • --order and --seed are for measured backends — the help says so
    ("Search order for measured backends") — and the model backend ranks the
    whole admitted set analytically, in cost order. There is nothing to order and
    no sampling for a seed to control.
  • --budget bounds a measured sweep. The model path measures nothing, so the
    value is parsed and then never consulted.
  • --seed is equally inert with --order exhaustive on any backend: an
    exhaustive sweep has no random choice to seed.

Each is silently accepted. Someone who passes --budget 30m --backend model
reasonably believes something is bounded.

Fix

Same shape as #22 — one eprintln! per case, saying what was ignored and what
would honour it. Roughly:

if backend == "model" {
    if budget.is_some() {
        eprintln!("note: --budget is unused with --backend model — nothing is measured, \
                   so there is no sweep to bound");
    }
    if order != "exhaustive" || seed != 0 {
        eprintln!("note: --order and --seed are unused with --backend model — the ranking \
                   is analytic and always in cost order");
    }
} else if order == "exhaustive" && seed != 0 {
    eprintln!("note: --seed has no effect with --order exhaustive");
}

Worth checking whether --allow-unsafe and --reason have the same shape on
any path — those two already reject each other properly on stage, which is
the standard the rest should meet.

Done when

No flag on tune is accepted and silently ignored; each says so once, the way
--out already does.

Getting started

CONTRIBUTING.md has the setup and the DCO sign-off (git commit -s). AI help
is welcome; AI attribution is not. The --out note added in #22 lives in
cmd_tune in crates/launchbound-cli/src/main.rs and is the pattern to copy —
including where it sits relative to the work, so a note about an ignored flag
is printed before the output it does not affect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions