Skip to content

Lab: corpus diff prints total time and folds noise from a corpus repeat label #90

Done

Description

@mareklangiewicz

Lab issue (neospector lua/myemmylab.lua diff, myemmylabcli.lua corpus diff). Part of #17.

What happened

Judging #86 and upstream PR 1458 against upnoise-1124-{1,2,3} (corpus repeat of upstream main) meant summing per-tree times by hand. The noisy trees (blink.cmp, diffview, gitsigns) also had to be told apart from real changes by hand.

Proposed (unprobed)

corpus diff prints each side's total wall time over the compared trees. With --noise=LABEL (a corpus repeat label), it folds a changed line whose count varies within that repeat set into a noise group, as moved pairs are folded now.

Activity

  1. mareklangiewicz commented on Nov 24, 2026

    @mareklangiewicz
    OwnerAuthor

    Fixed: neospector myvi a64e537, fork docs (measuring.md, "Corpus bases and diffs"), both unpushed.

    • corpus diff A B --noise=LABEL loads the corpus repeat runs LABEL-1..N (it needs at least 2, and fails with exit 2 when they are not comparable). It folds each changed hit whose key varies between them into a noise group, the same way moved hits fold: the hit leaves the lines, the per-code counts and the --against tags. Lines print as noise … without --summary. Matching is per key and only on the same checkout of the tree, so a real change in a noisy file still shows. lab.variance now records its varying keys (keys, heads) and takes the diff's keying, so --exact and --by-line fold alike.
    • corpus diff prints cpu A -> B summed over the compared trees. It prints ? for a side that has a tree with no recorded time (a gate base).
    • Driven: corpus diff up-14607355-1124 upnamed-1124 --noise=upnoise-1124 gives 11 → 2 changed lines, 9 noise lines folded, cpu 53.9 s → 53.4 s. The 2 left are a diffview/config.lua 322 ↔ 330 assign-type-mismatch pair, the same hit 8 lines apart. It looks like a run-to-run flip, but that key did not vary in the 3 repeats, so the fold rightly leaves it. More repeat runs would show whether it varies.
    • The exit stays 2 on this pair of runs: both sides crash on the same 5 trees. That is Lab: corpus diff treats trees that fail the same way on both sides as excluded, not NOT COMPARABLE #39, still open.
    • Tests: aChangedHitThatVariesInTheNoiseRunsIsFolded, noiseFromAnotherCheckoutFoldsNothing and eachSideCpuIsSummedOverTheComparedTrees were red before the change. gndx gate PASS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions