Skip to content

Reducer: preserve baseline acceptance when minimizing semantic regressions #1100

Closed

Description

@ehartford

During the C4 NLL hunt, with reduce test/behavior/behav_d27_view_nll_before_owner_consume.w --contains 'may outlive its origin' -- with check {file} deleted the identity function declaration. The resulting candidate retained the target diagnostic but also had an undefined-variable error. It was not a clean semantic regression repro.

The general predicate interface is sufficient, but the common diagnostic-only invocation does not preserve acceptance by a known-good compiler. Add a supported comparison predicate/mode (or a documented With helper) that requires the baseline compiler to accept each candidate while the candidate compiler retains the target failure.

The hunt used a With helper over std.process.command: if the baseline check fails, return 0; otherwise return the candidate check's status. Reduce then requires exit 1 and the original diagnostic text. This produced a seven-line repro retaining identity's definition. Evidence: out/c4-validation/nll-reduced.w (noisy), nll-reduced-check.log, nll-predicate.w, nll-reduced-clean.w (baseline accepted). Related general test-mode work: #1015. This is a tooling capability gap; the original --contains predicate did exactly what it was asked to do.

Activity

  1. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): reproduced: still missing. with reduce --help lists --out, --contains, --exit-code and --test; there is no mode that also requires a known-good compiler to accept the candidate.

    post-release: a reducer feature, with the general predicate as today's route.

  2. added this to the post-v0.16.0 milestone on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions