Skip to content

with reduce --baseline <compiler> (#1100) - #3389

Merged
ehartford merged 1 commit into
mainfrom
reduce-baseline
Nov 17, 2026
Merged

ehartford merged 1 commit into
mainfrom
reduce-baseline

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Fixes #1100.

with reduce … --contains "<diagnostic>" -- <compiler> check {file} keeps the smallest file that still prints the diagnostic, whatever else is wrong with it: during a regression hunt it deleted a declaration the program needs, and the result carried a second, unrelated error.

--baseline <compiler> also requires <compiler> check {file} to accept each candidate, the original included (a baseline that refuses the original is an error that says so). A regression then reduces to a program the good compiler takes and the one under test does not.

$ with reduce in.w --contains "helper(3)" -- with ast {file}
fn main:
    print(helper(3))
$ with reduce in.w --baseline with --contains "helper(3)" -- with ast {file}
fn helper(x: i32) -> i32: x
fn main:
    print(helper(3))

deep-debug-tool-tests runs that pair and asserts both results (the plain run must drop the declaration, so the fixture keeps distinguishing). The option is in with reduce --help, in deep-debugging-tools.md, and in the inventory's list of debugging-tool flags beside --contains.

Battery GREEN (1950a6c). The first battery was red on spec-inventory-check (the flag was not yet listed); fixed and rerun.

…ed by that compiler, so a regression reduces to a program the good compiler takes with nothing else wrong in it (#1100)
@ehartford
ehartford merged commit eaeca85 into main Nov 17, 2026
@ehartford
ehartford deleted the reduce-baseline branch November 17, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reducer: preserve baseline acceptance when minimizing semantic regressions

1 participant