Skip to content

WIP: test framework P3 — platform whitelist split, normalization layer, baseline only-grows gate, i18n drift CI (Refs #1127) - #1463

Merged
caomengxuan666 merged 6 commits into
mainfrom
fix/1127-p3-test-framework
Oct 31, 2026
Merged

caomengxuan666 merged 6 commits into
mainfrom
fix/1127-p3-test-framework

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Implements issue #1127 P3 (test-framework iteration), all four items. Infrastructure only — no applet behavior changes, no corpus case changes, baseline.json untouched. Full design + local verification evidence: REPORT.md in the cluster workdir (summary below).

  • (1) Runner platform split — whitelist.txt is now the platform-independent list; runner.sh detects the oracle platform before loading and additionally loads whitelist-linux.txt (WSL-oracle shape) or whitelist-msys.txt (MSYS2/Git Bash oracle); a platform entry overrides a common one and the report header names the loaded files. Migration was evidence-bound: baseline.json is recorded in the WSL shape, so every case recorded non-PASS keeps its excuse under Linux (linux load set 23), and only recorded-PASS cases with MSYS-oracle evidence moved (msys load set 16). Verified mechanically (all 27 entries + 57 comment lines preserved) and end-to-end with a stub subject: a linux-only excuse flips KNOWN_DIFF→OUT_DIFF when the platform is flipped to MSYS via a uname stub, and vice versa.
  • (2) Normalization layer — the inline sed becomes tests/differential/normalize.sed: the dd rules verbatim, plus timestamp rules masking only time-of-day (ISO/stat and ctime forms) while calendar dates still compare. The header documents what is deliberately not masked (dates, epoch numbers, quote style) and why — locale sensitivity stays with the runner's ORACLE_LOCALE pinning. Verified: time-of-day-only differences PASS via the normalized tier; a differing date stays OUT_DIFF.
  • (3) baseline.json only-grows gate — new check-baseline-growth.py + a static baseline-growth CI job comparing the proposed ledger against the base revision's: fails on a dropped case, a worsened recorded bucket (ranking imported from compare-baseline.py), or a shrunken recorded PASS count. By construction it cannot false-red on the live 70-env noise (byte-identical in both ledger files) or on setup-wsl/cache infra failures (no WSL, build, or cache). Job already green on this PR.
  • (4) i18n drift detection — new scripts/check_i18n_drift.py + i18n-drift CI job: extract the English catalog from source and diff against the published catalogs in unixwin/winuxcmd-i18n, reusing i18n_batch.validate as the definition of drift. A fresh diff is not empty today (measured standing drift: 111 items — zh-CN 68 missing / 42 extra / 1 placeholder), because translations land in reviewed batches; so, like the differential baseline, the gate is a ratchet over scripts/i18n-drift-baseline.json and fails only on growth (a forgotten catalog sync). Job already green on this PR; grow/shrink behavior verified locally against catalog copies.

Refs #1127

…lization layer (Refs #1127)

Item P3-1: whitelist.txt held excuses recorded against different
oracle runtimes in one list, so an MSYS2/newlib excuse also excused
the case in the WSL-oracle shape and vice versa. runner.sh now
detects the oracle platform before loading and loads whitelist.txt
(platform-independent) plus whitelist-linux.txt or whitelist-msys.txt
for the detected platform; a platform entry overrides a common one,
and the report header names the loaded files. Entries moved only on
recorded evidence: baseline.json is recorded in the WSL shape, so
every case recorded non-PASS keeps its excuse under linux, and the
four entries that moved to the msys file (printf newlib rounding x3,
Git Bash stdbuf) are all recorded PASS. Linux load set = common +
linux (23), msys load set = common + msys (16).

Item P3-2: the inline normalize_output sed expressions become the
documented normalization layer normalize.sed (same dd rules,
verbatim) plus timestamp rules that mask only the time-of-day of
ISO/stat timestamps and of ctime-form date(1) output - the part that
differs between the two sides' setup-created files - while calendar
dates still compare. The file header records what is deliberately
not masked (dates, epoch numbers, quote style) and why: locale
sensitivity is handled by the runner's ORACLE_LOCALE pinning, not by
masking.
Item P3-3. compare-baseline.py guards a live run against the ledger;
nothing guarded the ledger itself, and update-baseline.py re-records
whatever a run produced - a bad run committed as the new baseline
would lower the bar silently.

check-baseline-growth.py statically compares the proposed
baseline.json against the base revision's: it fails on a dropped
case, on any case whose recorded bucket worsens (same ORDER ranking
compare-baseline.py uses, imported from it so the two gates cannot
drift apart), or on a shrunken recorded PASS count - the last rule
also catches PASS -> KNOWN_DIFF, which the shared ranking treats as
equal. New cases and improved buckets pass.

The new baseline-growth job in gnu-master-differential.yml is
deliberately not the WSL baseline job: it runs no corpus case, so
live-run noise (the case that is red on main in the live shape is
byte-identical in both ledger files) cannot false-red it, and it
needs no WSL setup, build or cache, so setup-wsl/cache
infrastructure failures cannot fail it either.
Item P3-4. Nothing in CI noticed when source strings and the
published locale catalogs drifted apart; the sync rule in AGENTS.md
was enforced by memory. check_i18n_drift.py extracts the English
catalog from source and computes the drift diff against every
catalog in a unixwin/winuxcmd-i18n checkout, reusing
i18n_batch.validate as the single definition of drift (missing keys,
extra keys, placeholder and option-token divergence).

A fresh diff is not empty today - translations are reviewed
artifacts that land in batches, and the measured standing lag is
111 items (zh-CN: 68 missing, 42 extra, 1 placeholder). A gate that
failed on any drift would be born red and stay red for reasons
unrelated to the change under review, so, like the differential
baseline, the gate is a ratchet: scripts/i18n-drift-baseline.json
records the standing drift and CI fails only on growth - a source
string change whose catalog sync was forgotten, or a broken catalog
key. Deliberate new strings record their growth in the same PR with
--update-baseline; sync batches shrink the record the same way.

The new i18n-drift job in build-winuxcmd.yml checks out both repos
(the i18n repo is public; an anonymous read clone suffices) and runs
the checker on every PR and push.
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 31, 2026 18:45
…1127)

Conflict resolution (tests/differential/whitelist.txt, the only conflict): P3's platform split survives - the common file keeps HEAD's platform-independent list; main's four post-split additions are classified by their own reasons under the P3 rule: corpus/sed/02, sed/03, sed/05 (generic GNU sed script-error prefix format gap, holds against any oracle) join the common whitelist.txt; corpus/updatedb/01 (WSL-image environment: GNU updatedb.sh cannot execute frcode in the baseline image) joins whitelist-linux.txt. The cal/ncal, 9p (56/57) and interop-locale (42) entries visible in the conflict block were unchanged base context that P3 had already relocated to whitelist-linux.txt and are NOT duplicated back into the common file. Verified mechanically: the resolved three files hold exactly the union of both sides' entries (31 unique case paths, no duplicates, no markers). All other paths (baseline.json incl. the merged waves' new corpus cases, runner harness, sources) auto-merged; merged PRs' test/case changes survive untouched.
Whitelist conflict (tests/differential/whitelist.txt) resolved by P3 classification: main added six entries since the branch point (corpus/ln/39, corpus/readlink/02-04, corpus/realpath/37-38); all six hold only in the WSL-oracle runner shape (9p share / UNC spelling - same class as corpus/ln/35-hard and corpus/readlink/01-resolve), so they land in whitelist-linux.txt next to their class anchors. Union across the three files: 15 common + 18 linux + 4 msys = 37 unique paths, no duplicates, no entries dropped from either side.
whitelist.txt conflict: kept the branch's 15 common entries, adopting main's converged reason for corpus/namei/02-no-exist. Main's post-split additions classified into whitelist-linux.txt: corpus/cal/03..10 (ncal baseline-job family, joining cal/01-02) and corpus/whereis/02-03 (WSL-runner sandbox spelling split, joining the readlink/realpath block). Entry union is exact: 15 common + 28 linux + 4 msys = 47 paths, no duplicates, nothing dropped from either side, all reasons byte-identical to main's current text. baseline.json auto-merged as the exact key union (441 cases, no cross-side value differences).

Refs #1127
@caomengxuan666
caomengxuan666 merged commit 8100d91 into main Oct 31, 2026
9 of 11 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/1127-p3-test-framework branch November 2, 2026 01:12
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