The test-gate and the workflow shape checks: a green run must have run something #1294

Open
github-bot wants to merge 3 commits from github-bot/gh-1294 into main AGit
Owner

@⁠HailLucifer666 on GitHub · 2026-11-28 17:02 UTC · original
HailLucifer666:port/test-gate → main · +2725 −14 · 14 files · 3 commits · open

Follows #1290 (merge that first — this branch sits on top of it, so its diff shows #1290's fixes until that lands). This is Offer 2 from #1267, made concrete.

What this adds

  • cargo xtask test-gate — runs the tests, then checks the run against its own account of itself: every binary's running N tests must be closed by a matching test result:, a run that executed nothing is refused (the empty-filter class), reports that cannot be attributed to a binary cargo named are refused rather than called green, and CI's colored output (CARGO_TERM_COLOR=always) parses. What it cannot see is stated in the module doc rather than left implied.
  • cargo xtask workflows — every file under .github/workflows/ must pass the shape checks this repository can make: one document, a trigger that names an event, jobs that either call or run, steps that do exactly one of uses/run, and two classes a plain YAML load cannot see: duplicate keys (yaml-rust2 keeps the later value; GitHub refuses the document and creates no run) and typechanged entries. A file GitHub cannot load produces no run at all — this is the only check that catches it for ci.yml itself.
  • policy --staged fails closed — a staged entry the index cannot serve (a gitlink, an unspellable name) stops the commit instead of being skipped under a "deleted in the index" comment that --diff-filter never triggers.
  • The pre-commit hook runs both checks and is committed 100755 — it was 100644 on main, which makes every POSIX clone skip it in silence (same defect the Marvisak line shipped and fixed).
  • CI builds first, then runs the gated binaries, so a red run cannot hide behind a compile — which is what the last four pushes on main actually did (#1267).

Deliberately not in this PR: turning the WARP skips (WarpHarness::new() → Option) into loud failures. Before we know whether CI's runner has a WARP adapter, panicking on skip could turn CI red on machines that were honestly skipping; the first CI run of this PR answers that question, and the change is a one-line-per-site follow-up.

Local verification (Windows 11, MSVC, branch head 8494e4c): cargo test -p xtask — 65 passed, 0 failed (their policy suite + the ported gate/workflows/hook suites), both CI clippy variants (--all-targets and --all-targets --all-features, -D warnings) finish clean, and the gate dogfooded its own suite on the Marvisak twin before the port (67 executed, exit 0). Full-workspace test run pending — CI will exercise it once approved.

Provenance. Ported from our Marvisak/VIctory branch (PR #2854); the same-line staging-bounds and library-serialization fixes landed upstream there as #1658/#1660. The port carries that branch's second-review fixes: fail-closed policy, duplicate-key refusal, typechange visibility, and the skip message naming both checks. Every mutation probe is recorded in the test files.

**@⁠HailLucifer666** on GitHub · 2026-11-28 17:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1294) `HailLucifer666:port/test-gate` → `main` · +2725 −14 · 14 files · 3 commits · open Follows #1290 (merge that first — this branch sits on top of it, so its diff shows #1290's fixes until that lands). This is Offer 2 from #1267, made concrete. **What this adds** - **`cargo xtask test-gate`** — runs the tests, then checks the run against its own account of itself: every binary's `running N tests` must be closed by a matching `test result:`, a run that executed nothing is refused (the empty-filter class), reports that cannot be attributed to a binary cargo named are refused rather than called green, and CI's colored output (`CARGO_TERM_COLOR=always`) parses. What it cannot see is stated in the module doc rather than left implied. - **`cargo xtask workflows`** — every file under `.github/workflows/` must pass the shape checks this repository can make: one document, a trigger that names an event, jobs that either call or run, steps that do exactly one of `uses`/`run`, and two classes a plain YAML load cannot see: **duplicate keys** (yaml-rust2 keeps the later value; GitHub refuses the document and creates no run) and **typechanged entries**. A file GitHub cannot load produces no run at all — this is the only check that catches it for `ci.yml` itself. - **`policy --staged` fails closed** — a staged entry the index cannot serve (a gitlink, an unspellable name) stops the commit instead of being skipped under a "deleted in the index" comment that `--diff-filter` never triggers. - **The pre-commit hook runs both checks** and is committed `100755` — it was `100644` on main, which makes every POSIX clone skip it in silence (same defect the Marvisak line shipped and fixed). - **CI** builds first, then runs the gated binaries, so a red run cannot hide behind a compile — which is what the last four pushes on main actually did (#1267). **Deliberately not in this PR:** turning the WARP skips (`WarpHarness::new()` → `Option`) into loud failures. Before we know whether CI's runner has a WARP adapter, panicking on skip could turn CI red on machines that were honestly skipping; the first CI run of this PR answers that question, and the change is a one-line-per-site follow-up. **Local verification** (Windows 11, MSVC, branch head `8494e4c`): `cargo test -p xtask` — **65 passed, 0 failed** (their policy suite + the ported gate/workflows/hook suites), both CI clippy variants (`--all-targets` and `--all-targets --all-features`, `-D warnings`) finish clean, and the gate dogfooded its own suite on the Marvisak twin before the port (67 executed, exit 0). Full-workspace test run pending — CI will exercise it once approved. **Provenance.** Ported from our Marvisak/VIctory branch (PR [#2854](https://github.com/Marvisak/VIctory/pull/2854)); the same-line staging-bounds and library-serialization fixes landed upstream there as #1658/#1660. The port carries that branch's second-review fixes: fail-closed policy, duplicate-key refusal, typechange visibility, and the skip message naming both checks. Every mutation probe is recorded in the test files.
THE BUG. Main failed four CI pushes in a row (runs 46154038190, 46154833762,
46155565404, 46157117122). The build died on clippy -D warnings before any test
ran: let_and_return (emit/mod.rs:2756), manual_is_multiple_of
(shadow.rs:1708), some_filter (gameinput.rs:1383) and -- only under
--all-features, which is why fewer showed at first -- manual_is_multiple_of
(descriptor.rs:1234). Separately, repository_passes_policy has been failing
since 4715a42 committed bindings.ini without an allowlist entry; it could not
be seen for the same reason.

THE FIX. Each lint's suggested form; is_multiple_of twice, the let binding
returned directly, the scripted-key filter written as the condition first (vk
is a plain local, so the evaluation-order note is immaterial). And the ini
extension joins the allowlist for bindings.ini, with a comment naming the
commit that needs it -- veto and remove if the file should live outside the
repo instead.

SCOPE. Nothing else; these are the minimum to make main's CI able to reach the
tests again.
THE BUG. Three classes, all found on main today: (1) the GPU tests silently
report as passed on any machine without a WARP adapter -- WarpHarness::new()
returns an Option and every acquire site does `let Some(...) = ... else
{ return }` (indirect.rs around 894, 970, 1025 and more), so the suite's green
says nothing about whether the GPU tests executed; (2) cargo reports a filter
that matched no test as exit 0, so a narrowed command reads as a pass; (3) a
workflow file GitHub cannot load produces no run at all, and nothing in CI
reads ci.yml itself before GitHub does. The pre-commit hook was also committed
100644, which makes every POSIX clone skip it in silence (found with
git ls-tree; the same defect the Marvisak line shipped and fixed).

THE FIX. Port the checks our Marvisak PR #2854 lineage shipped there: `cargo
xtask test-gate` counts what each test binary announced (running N tests)
against what it reported (test result: ...), refuses a run that executed
nothing, refuses reports it cannot attribute to a binary cargo named, and
parses CI's colored output; `cargo xtask workflows` shape-checks every file
under .github/workflows, including duplicate keys (yaml-rust2 keeps the later
value; GitHub refuses the document outright) and typechanged entries; policy
--staged now fails closed on a staged entry the index cannot serve (a gitlink,
an unspellable name) instead of skipping it; the hook runs both checks and its
skip message names both; the hook is committed 100755; CI builds first and runs
the gated binaries after, so a red run cannot hide behind a compile.

WHY NOT HYPOTHETICAL. Main is red right now (issue #1267) precisely because the
suite's own account was unreadable; on our Marvisak twin the same tooling
refused a green-but-empty run in CI and caught a lost hook mode a green run
missed.

SCOPE. The WARP skip is made loud in a follow-up, not here: turning skips into
panics before we know whether CI's runner has a WARP adapter could turn CI red
on machines that were honestly skipping. The first CI run of this PR answers
that question. The gate parses cargo's output shapes as they exist today; a
--format json run is refused rather than guessed at.

PROVENANCE. Ported from our Marvisak/VIctory PR #2854 branch (staging-bounds
and pipeline-library fixes from the same line landed upstream as #1658/#1660);
carries that branch's second-review fixes: policy --staged fails closed like
its sibling, duplicate keys are refused, typechanged staged entries are listed,
and the hook's skip message names both checks.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 17:03:37 +00:00
Author
Owner

@⁠HailLucifer666 on GitHub · 2026-11-28 17:16 UTC · original

Full cargo test --workspace --locked on this branch's head (8494e4c): exit 0, zero failures. Per binary: victory-gpu 454 passed / 0 failed / 36 ignored (15.5s — the WARP-gated tests executed on this machine, so they do run wherever a WARP adapter exists), victory-shader 293 / 0 / 5 ignored (436s, device tests included), victory-hle 191, victory-loader 48, victory-pe 36, victory-pipeline 7, xtask 66 (the ported gate/workflows/hook suites). Both clippy variants (-D warnings, plain and --all-features) finish clean. One observation for the WARP follow-up: this machine has WARP, so the silent-skip class bites only on machines without one — whether CI's runner is in that class is still exactly what this PR's first CI run will answer.

**@⁠HailLucifer666** on GitHub · 2026-11-28 17:16 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1294#issuecomment-7242888598) Full `cargo test --workspace --locked` on this branch's head (`8494e4c`): **exit 0, zero failures**. Per binary: victory-gpu **454 passed / 0 failed / 36 ignored** (15.5s — the WARP-gated tests executed on this machine, so they do run wherever a WARP adapter exists), victory-shader 293 / 0 / 5 ignored (436s, device tests included), victory-hle 191, victory-loader 48, victory-pe 36, victory-pipeline 7, xtask 66 (the ported gate/workflows/hook suites). Both clippy variants (`-D warnings`, plain and `--all-features`) finish clean. One observation for the WARP follow-up: this machine has WARP, so the silent-skip class bites only on machines without one — whether CI's runner is in that class is still exactly what this PR's first CI run will answer.
Author
Owner

@⁠ANDREANIADS on GitHub · 2026-11-28 20:12 UTC · original

On 8494e4c, cargo xtask workflows accepts two steps with - name: ... but reports duplicate name and run when each dash is on its own line before the same mapping. Both documents parse to the same YAML. Locally I reset the duplicate-key scanner’s deeper mapping scopes on a bare sequence dash (including a trailing comment). The CLI then returned 0 for both layouts and still returned 1 for a repeated run inside a single step. All 67 xtask tests passed on Linux, as did Clippy with warnings denied. This checks the local workflow validator; no Actions job or WARP adapter was involved.

**@⁠ANDREANIADS** on GitHub · 2026-11-28 20:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1294#issuecomment-7245112192) On `8494e4c`, `cargo xtask workflows` accepts two steps with `- name: ...` but reports duplicate `name` and `run` when each dash is on its own line before the same mapping. Both documents parse to the same YAML. Locally I reset the duplicate-key scanner’s deeper mapping scopes on a bare sequence dash (including a trailing comment). The CLI then returned 0 for both layouts and still returned 1 for a repeated `run` inside a single step. All 67 xtask tests passed on Linux, as did Clippy with warnings denied. This checks the local workflow validator; no Actions job or WARP adapter was involved.
Author
Owner

@⁠babuakhil on GitHub · 2026-11-28 22:33 UTC · original

A gap the gate can't see as it stands: CI's tests never build the diagnostics feature. Clippy runs with --all-features, but the test step doesn't, so everything under #[cfg(feature = "diagnostics")] (all of victory-gpu's replay, among others) is compiled for clippy and never run. #1524 and #1530 both add tests there that CI won't run.

Measured on main (d4b5d51), Windows 11, RTX 3060, cargo test --workspace --locked --no-fail-fast:

tests passed failed
as CI runs it 1305 1 (repository_passes_policy, #1429)
with --all-features 1363 2 (the same, and views_off_their_elements_get_a_copy_of_their_bytes)

So 58 tests only run with the feature, and none of them fails. The second failure is a victory-gpu test that also runs without the feature and fails now and then on main (1 of 10 runs alone, earlier); cargo test -p victory-gpu --lib --all-features then passed 604/604 in 5 of 5 runs, with the 24 replay tests among them.

Since this PR reworks the test step, it seems the natural place for the gate to cover both builds, e.g. a second cargo xtask test-gate --workspace --locked --all-features (with its --no-run build). Happy to open it separately instead if you'd rather keep this one as it is.

**@⁠babuakhil** on GitHub · 2026-11-28 22:33 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1294#issuecomment-7246819449) A gap the gate can't see as it stands: CI's tests never build the `diagnostics` feature. Clippy runs with `--all-features`, but the test step doesn't, so everything under `#[cfg(feature = "diagnostics")]` (all of `victory-gpu`'s `replay`, among others) is compiled for clippy and never run. #1524 and #1530 both add tests there that CI won't run. Measured on `main` (`d4b5d51`), Windows 11, RTX 3060, `cargo test --workspace --locked --no-fail-fast`: | | tests passed | failed | |---|---:|---:| | as CI runs it | 1305 | 1 (`repository_passes_policy`, #1429) | | with `--all-features` | 1363 | 2 (the same, and `views_off_their_elements_get_a_copy_of_their_bytes`) | So 58 tests only run with the feature, and none of them fails. The second failure is a `victory-gpu` test that also runs without the feature and fails now and then on `main` (1 of 10 runs alone, earlier); `cargo test -p victory-gpu --lib --all-features` then passed 604/604 in 5 of 5 runs, with the 24 `replay` tests among them. Since this PR reworks the test step, it seems the natural place for the gate to cover both builds, e.g. a second `cargo xtask test-gate --workspace --locked --all-features` (with its `--no-run` build). Happy to open it separately instead if you'd rather keep this one as it is.
github-bot force-pushed github-bot/gh-1294 from 8494e4c427 to 61951cd624 2026-11-29 00:21:47 +00:00 Compare
This pull request has changes conflicting with the target branch.
  • Cargo.lock
  • crates/victory-hle/src/modules/gameinput.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1294/head:github-bot/gh-1294'
git switch 'github-bot/gh-1294'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1294'
git switch 'github-bot/gh-1294'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1294'
git switch 'github-bot/gh-1294'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1294'
git switch 'main'
git merge --squash 'github-bot/gh-1294'
git switch 'main'
git merge --ff-only 'github-bot/gh-1294'
git switch 'main'
git merge 'github-bot/gh-1294'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1294
No description provided.