Skip to content

Scripts: smoke blocks name the game folder by a hash, not its name - #689

Merged
raylitebull merged 1 commit into
xcl-dev:mainfrom
grahamster2:scripts-smoke-title-hash
Nov 24, 2026
Merged

raylitebull merged 1 commit into
xcl-dev:mainfrom
grahamster2:scripts-smoke-title-hash

Conversation

@grahamster2

Copy link
Copy Markdown
Collaborator

scripts/smoke.ps1 printed the game folder's name on the title: line of every xcl-smoke block, so PR descriptions named people's copies of a retail game. It now prints the first 8 hex digits of the SHA-256 of the folder name (trimmed, UTF-8), the same as Python's hashlib.sha256(name.strip().encode()).hexdigest()[:8], so existing blocks can be converted and keep matching. pr_check.py only compares the main and PR titles for equality, so the check is unchanged. -Title <label> prints a label of your choice instead. Fixes #677

What is in it

  • scripts/smoke.ps1: the title: line is the hash of the folder name, or the -Title label (trimmed; empty labels, control/format/line-separator characters and backticks are refused, since pr_check.py splits lines with str.splitlines() and a U+2028 would add keys like commit: to the block)
  • scripts/smoke-title.tests.ps1: checks the hash of ASCII, accented, CJK and emoji names against Python's values, a trailing \ on -Game, -Title, and the refused labels, with a stand-in for xcl.exe (same pattern as test-native-stderr.tests.ps1)

Tested

  • Windows 11 Pro 10.0.26200, AMD Ryzen 5 7600X, Windows PowerShell 5.1.26100.9818, pwsh 7.7.0, Python 3.12
  • powershell.exe -File scripts/smoke-title.tests.ps1 and pwsh -File scripts/smoke-title.tests.ps1: smoke-title: ok on both; the test fails on main's smoke.ps1 (prints the name, not the hash)
  • hashes from both shells compared with Python's for 8 invented folder names (ASCII, padded, accented, CJK, emoji): identical
  • python -m unittest test_pr_check in scripts/: 3 tests, OK
  • pr_check.check() on sample descriptions: hash/hash and label/label pairs pass; a main block with the plain name against a PR block with the hash is refused as different titles

Not tested

  • cargo build / cargo test not run, and no regression run: the change is only in scripts/, not the runtime
  • not run with a real xcl.exe or a real title (the tests use a stand-in that prints a log path)
  • during the switchover, a branch that is not rebased still prints the folder name, while main prints the hash, so the two blocks won't match: rebase, or pass the same -Title to both runs
  • the hash keeps the name out of the text, but it isn't anonymous: anyone who guesses the name can check it. Use -Title with a neutral label if that matters. The hash is case-sensitive, so type the folder's name with the same casing in both runs

AI use

  • Claude Code with Claude Opus 5.5 (claude-opus-5-5): wrote the change, the test and this description, ran the tests above; a separate Claude Code agent (same model) reviewed the diff adversarially, and the U+2028 label finding was fixed

The `title:` line of an xcl-smoke block printed the game folder's name,
and folder names are whatever people called their copy, so PR
descriptions ended up naming specific copies of a commercial game
(xcl-dev#677). It now prints the first 8 hex digits of the SHA-256 of the
folder name (trimmed, UTF-8). pr_check.py only compares the main and PR
blocks' titles for equality, so the check is unchanged, and two
different folders still get different titles. Existing blocks can be
converted with the same function (Python:
hashlib.sha256(name.strip().encode()).hexdigest()[:8]).

-Title <label> prints a label of your choice instead. Control, format
and line/paragraph separator characters and backticks are refused:
pr_check.py splits lines with str.splitlines(), so a U+2028 in a label
would otherwise add keys such as `commit:` to the block.

scripts/smoke-title.tests.ps1 checks hashes of ASCII, accented, CJK and
emoji names against Python's, a trailing backslash, -Title, and the
refused labels, with a stand-in for xcl.exe.

Fixes xcl-dev#677
@thehollowedone

Copy link
Copy Markdown
Contributor

Tested

I ran the old and new smoke scripts with the real xcl.exe and XCL’s synthetic test title. The title fixture used a generated folder name containing CJK characters and an emoji. I removed its test-only --hello assertion so it could run under the unmodified smoke scripts.

  • 91f9a5e printed the synthetic folder’s basename.
  • 9683e7a printed the same independently computed Python SHA-256 prefix in PowerShell 7 and Windows PowerShell 5.1. The explicit -Title 'Synthetic fixture' worked in 5.1. None of the three patched blocks contained the synthetic basename or full path.

cargo build --offline --locked --workspace passed. All four scripts/smoke.ps1 invocations used the same debug launcher, a fresh title-data directory and a 20-second limit. Each block identified the script tree’s expected commit, with exit 0x0, zero crashes and zero device removals. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC.

Not tested

Retail titles or failure output.

AI use

Codex with GPT-6.2 Sol prepared the synthetic fixture, ran the checks, and drafted this report.

@upipibi

upipibi commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Full-suite run on this PR's head 9683e7a, for the counts CONTRIBUTING.md item 2 asks for:

Tested

  • NVIDIA GeForce RTX 3070 (driver 616.56, wave32), Ryzen 9 5950X, Windows 11 Pro 26100, rustc 1.100.0 MSVC, debug
  • cargo build --workspace then cargo test --workspace --no-fail-fast -- --test-threads=4: 692 passed, 0 failed, 41 ignored (16 test binaries, the e2e title included)
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)

Not tested: AMD / wave64; no retail title (this PR changes only scripts/).

AI-assisted (Claude Code).

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.

Scripts: smoke blocks print the game folder's name

4 participants