Skip to content

Scripts: a test of smoke.ps1's block (adapter from report.json, fallback, counts) - #282

Open
NiiRoZz wants to merge 1 commit into
xcl-dev:mainfrom
NiiRoZz:nii/smoke-gpu
Open

NiiRoZz wants to merge 1 commit into
xcl-dev:mainfrom
NiiRoZz:nii/smoke-gpu

Conversation

@NiiRoZz

@NiiRoZz NiiRoZz commented Nov 23, 2026 •

Copy link
Copy Markdown

scripts/smoke.ps1 now takes its gpu: line from the run's report.json (#281, on main as 97dc49c), which fixes what this PR set out to fix from the log. That change is dropped here. What is left is the test it came with, rewritten for main's script: nothing on main runs smoke.ps1, whose block every runtime PR pastes as its evidence.

No open PR tests smoke.ps1 that I found: #285 changes the same gpu: line (from the log), #296 tests test.ps1.

What is in it

  • scripts/smoke.tests.ps1: runs the script against a stand-in xcl and a written log and report, the way test-native-stderr.tests.ps1 does for test.ps1:
    • gpu: is the adapter of report.json with its VRAM suffix dropped; a report without an adapter (the null backend) and no report at all fall back to the first video controller;
    • title, seconds, exit code, frames, presents and peak commit;
    • a device removal and an unhandled exception in the log are counted.

Tested

  • NVIDIA GeForce RTX 5090 (driver 621.35) plus AMD Radeon integrated graphics (the one Windows lists first), Ryzen 7 9800X3D, Windows 11 Pro 26300, Windows PowerShell 5.1.
  • powershell -File scripts\smoke.tests.ps1 on main a6f5f7a: passes. With smoke.ps1 as it was before Scripts: smoke.ps1 names the adapter XCL ran on, from report.json #281 (9ab7d76) it fails on the gpu: line (AMD Radeon(TM) Graphics where the report names another adapter).
  • cargo test --workspace -- --test-threads=4 was run for this PR's first version on 9ab7d76 (651 passed, 0 failed, 40 ignored; SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, no wave64). It was not run again on this head: the PR adds one PowerShell file and no Rust.

Regression run

Not needed: scripts only, nothing under crates/xcl/src changes.

Not tested

  • PowerShell 7 (pwsh): not installed here.
  • The Rust suite on this head (see above).

AI use

  • Claude Code with Claude Fable 5.2 wrote the test and this description. The commands above were run on my machine, and I have read the diff.

Nothing ran scripts/smoke.ps1, whose block is the evidence every runtime PR
pastes. scripts/smoke.tests.ps1 runs it against a stand-in xcl and a written
log and report, as test-native-stderr.tests.ps1 does for test.ps1:

- gpu: is the adapter of the run's report.json with its VRAM suffix dropped;
  a report without an adapter (the null backend) and no report at all fall
  back to the first video controller;
- title, seconds, exit code, frames, presents and peak commit come from the
  run and its log;
- a device removal and an unhandled exception in the log are counted.

Against smoke.ps1 as it was before its gpu: line came from the report, the
test fails on that line.

AI-assisted.
@NiiRoZz NiiRoZz changed the title Scripts: smoke.ps1 names the adapter the title ran on Scripts: a test of smoke.ps1's block (adapter from report.json, fallback, counts) Nov 24, 2026
@wileyGray

Copy link
Copy Markdown

PowerShell 7.6.9 passes the smoke fixture at 791fbe135db894cfcea8f1699a91f46dc5ac82a3. I also confirmed the same result on Windows PowerShell 5.1.26100.9818.

Tested

On Windows 11 build 26300 (Core i9-14900K, RTX 4080 SUPER driver 32.0.16.2114 and Intel UHD 770), both commands exited 0. All 13 assertions across four fixture runs passed in each shell.

pwsh.exe -NoProfile -NonInteractive -File .\scripts\smoke.tests.ps1
powershell.exe -NoProfile -NonInteractive -File .\scripts\smoke.tests.ps1

Not tested

This run exercised the PowerShell script with its stand-in executable and synthetic logs. I did not run a retail title or the Rust suite.

AI use

Codex (GPT-6.2 Astra) inspected the fixture, ran both commands and wrote this report.

@throny throny added off-goal Does not bear on the current goal (world loading); waits until it is reached and removed off-goal Does not bear on the current goal (world loading); waits until it is reached labels Nov 25, 2026
@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

Osanchez pushed a commit to Osanchez/xcl that referenced this pull request Nov 25, 2026
Reading a diff is safe; building one is not. `cargo build` runs a pull
request's build.rs and procedural macros as the user, `cargo test` runs its
test code, and anything under scripts/ runs as the user during build, test
and the smoke run. So the decision to trust a branch has to be made before
the first build, not after it.

- scripts/dev/pr-gate.py classifies a pull request's changed files from the
  GitHub API only - no checkout, nothing executed - against eight high-risk
  buckets (build.rs, .github, .cargo, Cargo.toml/lock, scripts, generated
  tables, stubdb.toml, binaries) plus a short content scan of added lines for
  network fetches, base64/eval, process spawning, link-section tricks and
  credential access. Fail-closed: an API error exits 3, never 0. A CLEAR
  verdict writes a receipt keyed by the pull request's head commit, so a
  force-push has to pass the gate again.
- scripts/dev/merge-pr.py is the only sanctioned merge path: gate, require a
  receipt for that exact commit, fetch pull/<N>/head, verify what arrived is
  what was reviewed (the window a push could otherwise slip through), then
  merge --no-ff.
- scripts/dev/merge-guard.py, wired as a PreToolUse hook, refuses git merge,
  cherry-pick, pull without --ff-only, am, apply, revert and gh pr merge
  unless they go through the wrapper. Recovery and read-only forms stay
  allowed.
- .githooks/pre-merge-commit backstops a merge made by hand, allowing commits
  already in our own history through.

Verified on xcl-dev#1193 (clean: exit 0, fetch matched the reviewed
commit), xcl-dev#282 (scripts/ touched: exit 2, nothing fetched), and xcl-dev#282 with
--ack (exit 0, acknowledgement recorded in the receipt). merge-guard decided
13 command forms correctly. pre-merge-commit tested in a throwaway repo for
own-history, no-receipt and receipted cases.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018RbZXznytQeB5KoWdhtdy5
@RavenCurseBurg

RavenCurseBurg commented Nov 25, 2026 •

Copy link
Copy Markdown

The fallback assertion on 791fbe135db894cfcea8f1699a91f46dc5ac82a3 queries the host and calculates its expected GPU with the same filter as the script. I replaced the host query in the test with three fixed controllers in order: Microsoft Basic Display Adapter, an integrated GPU, and the GPU named in the synthetic report. Test-only commit.

-NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/smoke.tests.ps1 passed in Windows PowerShell 5.1 and PowerShell 7.6.9. The valid report selected the third listed adapter. A null adapter, malformed JSON and a missing report each selected the integrated GPU.

I then ran the test against three separate local changes to smoke.ps1: allow the Basic adapter, select the last usable controller, and always ignore the report. Each failed the expected GPU assertion in both shells (6/6). Windows 11 26100.9711, i7-13700. The runs used the stand-in executable and synthetic logs, with no host GPU enumeration or game launch. OpenAI Codex (GPT-6) wrote and tested the fixture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants