Skip to content

fix(differential): adjudicate the 23 gate-blocking cases (#1486 baseline half) - #1494

Merged
caomengxuan666 merged 7 commits into
mainfrom
fix/1486-baseline-23
Nov 1, 2026
Merged

caomengxuan666 merged 7 commits into
mainfrom
fix/1486-baseline-23

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Fixes the GNU master differential half of #1486. Main's baseline gate has been red since 2026-10-29 (first failing run 41241726504, red through 41297024203) because the audit waves landed corpus cases whose product side never matched: PR #1468 (audit-w7-util-linux) even recorded them as OUT_DIFF/EXIT_DIFF in baseline.json, and the runner's zero-unexplained-diff rule fails on every run since.

Adjudication of all 23 (oracle: GNU_BIN=/usr/bin, Ubuntu 24.04, coreutils 9.4, /usr/bin/kill = procps-ng 4.0.4 — verified kill --version)

Product fixes — 22 cases

kill ×11 — /usr/bin/kill is procps-ng 4.0.4, not util-linux and not uutils kill; the previous rewrite modeled uutils (name operands, -p/--pid, exit 64). Rewritten to the probed procps contract:

  • -l NAME prints the NUMBER, -l NUM (1..31) prints the NAME (Linux ABI: USR1=10; no RTMIN/RTMAX)
  • out-of-range numbers and unknown names warn kill: unknown signal name X on stderr with exit 0
  • -l converts only its first operand (kill -l 9 extra → KILL, 0)
  • no-args and unknown options (-p, -n, …) print the byte-exact procps usage block, exit 1
  • operands are PIDs only (kill: failed to parse argument: 'x'); delivery errors read kill: (PID): <errno> with ESRCH before EINVAL (-s INVALID <dead-pid> → "No such process"); exit 0/1
  • new allow_unknown_long_options_as_positionals parse policy so kill can deliver its own option diagnostic
  • kill unit tests moved to the same contract (27 tests, incl. new invalid-argument and first-operand coverage)

date ×3 — %+ passes through literally (glibc has no such conversion; the %c-with-zone expansion was local invention); -I argmatch list order is hours, minutes, date, seconds, ns; -r FILE error uses quotef semantics (quote only when needed → plain names unquoted) via the shared gnu_quotearg::shell_escape_quote.

env ×1 — glibc putenv() performs no name validation, so env '=x' ... is an accepted assignment (coreutils 9.4 exits 0; probe-verified). Child env blocks drop empty-name entries — CreateProcessW rejects the whole block otherwise (documented [DIFFERS]). Case reshaped to env -i =x (the old shape compared a full env dump, unmatchable through interop).

printenv ×2 — the cases looked up LC_ALL, which the interop launch never delivers to the Windows subject (probe-verified; WSLENV /u forwarding tried and insufficient). The runner now exports WINUX_DIFFVAR=differential to both sides (WSLENV no-flag = verbatim sharing) and the cases use it — premise deliverable by construction.

nice ×1 — invalid adjustment prints one line; coreutils error() adds no Try tail.

pathchk ×1 — MSVC filesystem reports ENOTDIR as system-category ERROR_DIRECTORY; routed through the shared Win32→POSIX map so the message reads "Not a directory".

stty ×1 — GNU's recover form is exactly 36 fields; stty -g now emits 36 (round-trip preserved) so the 10-field case is "invalid argument" before -F is opened, like the oracle.

timeout ×1 — missing operand prints only Try 'timeout --help' for more information. (GNU has no message line), exit 125.

regressions/70 — passes with the #1352 ordered-entries fix already on main.

Whitelist — 1 case

mktemp/05 — mkstemp names are random by contract; both sides print well-formed ./sub/<random>; shape pinned natively by the mktemp unit tests.

baseline.json

Only the 12 entries these fixes flip (OUT_DIFF/EXIT_DIFF → PASS) are re-recorded; the 116 never-recorded and 18 mismatched census items from #1483 stay untouched for #1462.

Verification

  • Full corpus locally (WSL GNU oracle, coreutils 9.4, WINUXCMD_BIN=build-vs): 642 cases → 598 PASS / 35 KNOWN_DIFF / 5 SKIP / 4 EXIT_DIFF, where the four (diff3/25, install/02, locate/01, locate/02) are local host-allowlist noise — this machine resolves the allowlisted host binaries into the local Niubash install while CI resolves Git-for-Windows ones; they are recorded PASS in CI's runs and are untouched by this PR.
  • Unit tests for every touched command: 260/260 (ctest -R kill/nice/pathchk/stty/printenv/env_/timeout_/date_).
  • No formatting script run repo-wide (no CI format gate; the local clang-format version drifts from the tree).

…ine half)

The GNU master differential gate has been red on main since 2026-10-29:
the audit waves landed corpus cases whose product behavior was never
matched, and the merge of #1468 (audit-w7-util-linux) recorded them as
OUT_DIFF/EXIT_DIFF in baseline.json without whitelisting or fixing -
the runner's zero-unexplained-diff rule then fails every run.  All 23
cases adjudicated against the pinned oracle (GNU_BIN=/usr/bin, Ubuntu
24.04, coreutils 9.4, /usr/bin/kill = procps-ng 4.0.4):

Product fixes (22 cases):
- kill (11): /usr/bin/kill is procps-ng 4.0.4, not util-linux/uutils
  kill.  Rewritten to the procps contract: -l NAME prints the NUMBER and
  -l NUM (1..31) the NAME; 0/32+/unknown names warn 'unknown signal
  name X' on stderr at exit 0; -l converts only its first operand;
  Linux ABI table (USR1=10, no RTMIN); no-args and unknown options (-p,
  -n, ...) print the procps usage block at exit 1; operands are PIDs
  only ('failed to parse argument: X'); delivery errors read
  'kill: (PID): <errno>' with ESRCH before EINVAL; exit 0/1.  New
  opt.cppm policy allow_unknown_long_options_as_positionals so kill can
  deliver its own option diagnostic.  kill unit tests moved to the same
  contract.
- date (3): %+ passes through literally (no local %c-with-zone
  expansion); -I argmatch list order hours,minutes,date,seconds,ns;
  -r FILE error uses quotef (quote only when needed, so plain names
  print unquoted).
- env (1): '=x' empty-name assignments are accepted like glibc putenv
  does (child blocks drop them - CreateProcessW rejects empty-name
  entries, documented divergence); case reshaped to 'env -i =x' since a
  full env dump can never byte-match through interop.
- printenv (2): cases looked up LC_ALL, which the WSL-side launch never
  delivers to the Windows subject; the runner now exports WINUX_DIFFVAR
  to both sides (WSLENV no-flag = verbatim) and the cases use it.
- nice (1): invalid adjustment prints one line (no Try tail).
- pathchk (1): route system-category error codes through the shared
  Win32->POSIX mapping so ENOTDIR reads 'Not a directory'.
- stty (1): the recover form is exactly 36 fields (GNU termios shape);
  stty -g emits 36 to keep the round-trip, so the 10-field case is
  'invalid argument' before -F is opened.
- timeout (1): missing operand prints only the Try line (GNU has no
  message there), exit 125.
- regressions/70: passes with the ordered env entries fix from #1352.

Whitelist (1):
- mktemp/05: mkstemp names are random by contract; the shape is pinned
  natively by the unit tests.

baseline.json: the 12 entries recorded OUT_DIFF/EXIT_DIFF for these
cases are re-recorded PASS (ratchet tightened; nothing else touched -
the 116 never-recorded and 18 mismatched entries stay for #1462/#1483).

Verified locally (Ubuntu-GitLab WSL, coreutils 9.4, WINUXCMD_BIN=
build-vs): full corpus 642 cases -> 598 PASS / 35 KNOWN_DIFF / 5 SKIP /
4 EXIT_DIFF, where the four (diff3/25, install/02, locate/01,
locate/02) are local host-allowlist noise (this machine resolves the
allowlisted host binaries into the local Niubash install; CI resolves
Git-for-Windows ones and records them PASS).  Unit tests for the
touched commands: 260/260.
caomengxuan666 and others added 6 commits November 1, 2026 23:44
… across filesystem views

- runner.sh appends a 'Failing case evidence' section to the report for
  every unexplained mismatch: both sides' rc, stdout and stderr.  A
  CI-only divergence is otherwise undiagnosable from its bucket alone
  (whitelist entries are expected to cite byte-level evidence).
- pathchk: POSIX lstat answers ENOTDIR when a non-final component is a
  file, but the not-found verdict for 'regfile/file' depends on which
  Win32 filesystem view answers (NTFS gives ERROR_DIRECTORY; the 9p/UNC
  view of the WSL work directory can give a not-found class, which made
  differential pathchk/01 exit 0 on the CI runner while passing
  locally).  The not-there path now walks the component chain: the
  first existing prefix that is not a directory pins 'Not a
  directory'.
…ent noise

The recorded evidence (baseline-report.md, run 41323739882) shows both
sides agree on the -i block and the assignment order (Z=1, A=2, rc 0);
the CI subject's extra TERM/HOME lines come from the inner env resolving
to the WSL /usr/bin/env through the interop bridge, because the baseline
workflow builds only the winuxcmd target and build-vs carries no
per-command env.exe.  Same environment category as whereis/02; passes in
the full-build shape.
…n clobbered it; the previous commit intended only to append the regressions/70 entry)
compare-baseline demands every corpus case be recorded; the audit waves
added 124 case files without ledger entries, which kept the baseline job
red behind the runner gate (and 3 msys-oracle cases were recorded PASS
instead of the linux shape's SKIP).  This records every case's verdict
from the verified CI run 41324820632 (642 cases: 599 PASS, 38
KNOWN_DIFF, 5 SKIP; the runner gate reported Differences: 0), including
the whitelist-driven reclassifications the linux shape carries (cal
ncal artifacts, updatedb/01, regressions/12/42/56/57/70, mkdir/30).

This absorbs the never-recorded census from #1483's survey into the
ledger as data; the 18 recorded-but-mismatched investigations remain
with #1462.
A case whose file declares 'oracle:' or 'subject:' runs only in that
shape; under the recorded linux/interop shape runner.sh SKIPs it by
construction.  Recording that skip clashed with the growth gate (PASS ->
SKIP counts as worsening), while not recording it tripped 'unexplained
skip' - the two gates disagreed about msys-oracle cases (basename/50,
dirname/03, test/13).  The declaration in the case file is itself the
explanation, so compare-baseline now accepts such skips regardless of
the recorded bucket, and the ledger keeps those cases' recorded PASS
(the verdict of the shape that can actually run them).
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.

1 participant