startup: re-key slot 57 mesh requests in shader_cache_rekey.py (Part of #2413) #2634

Manually merged
github merged 1 commit from gh-pr/2634/head into gh-pr/2634/base 2026-11-27 01:09:40 +00:00
Owner

@⁠Leyukaka on GitHub · 2026-11-25 23:50 UTC · original
Leyukaka:rekey-mesh57 → main · +63 −34 · 4 files · 1 commits · merged 2026-11-25 23:56 UTC

Part of #2413 (claim).

tools/startup/shader_cache_rekey.py (from #2401) re-keyed graphics, RTV variant and slot 67 compute requests, and only counted slot 57 mesh requests. mesh57_key hashes the request files under a versioned prefix (x2w-startup-mesh-57-2), so after a revision that changes that prefix a kept cache lost every slot 57 request: --pending refuses a file under its old name with slot 57 mesh request key mismatch.

This re-keys them:

  • A slot 57 request is .ps57, .root and the .m57 ready marker; .ps57 is empty without a pixel stage. The new key is mesh57_key(m57, ps57, root).
  • The rules the tool applies to the other kinds hold. Every request is read first, nothing is written when a part is missing or unreadable (exit 1), each file goes to a temporary name and is renamed with the ready marker last, and an existing target is left alone. The summary gains an m57: line.
  • Slot 86 requests (mesh86_cache.py, their own key and a .stream86 part) are still only counted.
  • docs/startup-runtime.md describes the slot 57 parts.

#2592 also edits this tool, for the pixel input masks in the graphics key. Whichever lands second will need a small textual rebase in the docstring, PARTS and current_key.

Tests (Windows 11, Python 3.14), on main 66026a3 plus this commit:

  • python -B tests/startup_shader_cache_rekey_check.py: all checks passed.
    • A slot 57 request under a stale name and one under its current name are each written under their current name with the same bytes, and gfx2hlsl.pending_keys lists them.
    • A second run keeps every name. A missing slot 57 .root or .ps57 exits with 1 and writes nothing.
    • A slot 86 marker is only counted.
  • python -B tests/startup_shader_cache_rekey_cli_check.py: ok (its summary assertion now reads not re-keyed (own key strings): m86 1).
  • Also ok: docs_links_check, bidi_controls_check, startup_translator_check.
  • Mutation, run by hand: keeping the old mesh key instead of mesh57_key fails the check (the old name is written instead of the current one).

Measured on a local cache (counts only, inputs private) kept from an earlier revision: the tool wrote 497 slot 57 requests under current names, next to 2,689 compute requests and 95 RTV variants.

AI-assisted.

**@⁠Leyukaka** on GitHub · 2026-11-25 23:50 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2634) `Leyukaka:rekey-mesh57` → `main` · +63 −34 · 4 files · 1 commits · merged 2026-11-25 23:56 UTC Part of #2413 ([claim](https://git.gtahub.st/github/R0Y00--Xbox2Windows/issues/2413)). `tools/startup/shader_cache_rekey.py` (from #2401) re-keyed graphics, RTV variant and slot 67 compute requests, and only counted slot 57 mesh requests. `mesh57_key` hashes the request files under a versioned prefix (`x2w-startup-mesh-57-2`), so after a revision that changes that prefix a kept cache lost every slot 57 request: `--pending` refuses a file under its old name with `slot 57 mesh request key mismatch`. This re-keys them: - A slot 57 request is `.ps57`, `.root` and the `.m57` ready marker; `.ps57` is empty without a pixel stage. The new key is `mesh57_key(m57, ps57, root)`. - The rules the tool applies to the other kinds hold. Every request is read first, nothing is written when a part is missing or unreadable (exit 1), each file goes to a temporary name and is renamed with the ready marker last, and an existing target is left alone. The summary gains an `m57:` line. - Slot 86 requests (`mesh86_cache.py`, their own key and a `.stream86` part) are still only counted. - `docs/startup-runtime.md` describes the slot 57 parts. #2592 also edits this tool, for the pixel input masks in the graphics key. Whichever lands second will need a small textual rebase in the docstring, `PARTS` and `current_key`. **Tests** (Windows 11, Python 3.14), on main `66026a3` plus this commit: - `python -B tests/startup_shader_cache_rekey_check.py`: all checks passed. - A slot 57 request under a stale name and one under its current name are each written under their current name with the same bytes, and `gfx2hlsl.pending_keys` lists them. - A second run keeps every name. A missing slot 57 `.root` or `.ps57` exits with 1 and writes nothing. - A slot 86 marker is only counted. - `python -B tests/startup_shader_cache_rekey_cli_check.py`: ok (its summary assertion now reads `not re-keyed (own key strings): m86 1`). - Also ok: `docs_links_check`, `bidi_controls_check`, `startup_translator_check`. - Mutation, run by hand: keeping the old mesh key instead of `mesh57_key` fails the check (the old name is written instead of the current one). **Measured on a local cache** (counts only, inputs private) kept from an earlier revision: the tool wrote 497 slot 57 requests under current names, next to 2,689 compute requests and 95 RTV variants. AI-assisted.
shader_cache_rekey.py re-keyed graphics, RTV and slot 67 compute requests
and only counted slot 57 mesh requests. mesh57_key hashes the request
files under a versioned prefix, so after a revision that changes it a
kept cache lost every slot 57 request. The tool now recomputes that key
with mesh57_key and copies .ps57, .root and the .m57 ready marker under
the new name, with the rules the other kinds follow: everything read
first, nothing written on a missing or unreadable part, temporary name
then rename, an existing target left alone. Slot 86 is still only
counted.

AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:09:38 +00:00
github manually merged commit bba44089f4 into gh-pr/2634/base 2026-11-27 01:09:40 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 23:56 UTC · original · reviewed

Review of head bba44089 against main (comment only, no code changes).

What I checked:

  • mesh57_key(ms, ps, root) in gfx2hlsl.py:7733 takes (m57, ps57, root). current_key passes the same order. Good.
  • PARTS['m57'] has the ready marker last, so the existing write order rule holds. .ps57 stays a required part, an empty file is fine.
  • Slot 86 is still only counted, and the summary line matches the new behavior.
  • Sibling kinds (graphics, compute, RTV) are unchanged. Docs match the code.

Commands run locally on the exact head:

  • python3 -B tests/startup_shader_cache_rekey_check.py: all checks passed
  • python3 -B tests/startup_shader_cache_rekey_cli_check.py: OK
  • python3 tests/docs_links_check.py: 506 links ok
  • python3 tests/bidi_controls_check.py: no controls
  • git diff --check origin/main...HEAD: clean
  • Mutation 1: swap the argument order in mesh57_key(...) call -> the rekey test fails (6 failed).
  • Mutation 2: drop .ps57 from PARTS['m57'] -> the rekey test crashes.

No blocking findings. Note: #2592 touches the same file, a small rebase is expected for whichever lands second.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 23:56 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2634#pullrequestreview-6066672921) · **reviewed** Review of head bba44089 against main (comment only, no code changes). What I checked: - `mesh57_key(ms, ps, root)` in `gfx2hlsl.py:7733` takes (m57, ps57, root). `current_key` passes the same order. Good. - `PARTS['m57']` has the ready marker last, so the existing write order rule holds. `.ps57` stays a required part, an empty file is fine. - Slot 86 is still only counted, and the summary line matches the new behavior. - Sibling kinds (graphics, compute, RTV) are unchanged. Docs match the code. Commands run locally on the exact head: - `python3 -B tests/startup_shader_cache_rekey_check.py`: all checks passed - `python3 -B tests/startup_shader_cache_rekey_cli_check.py`: OK - `python3 tests/docs_links_check.py`: 506 links ok - `python3 tests/bidi_controls_check.py`: no controls - `git diff --check origin/main...HEAD`: clean - Mutation 1: swap the argument order in `mesh57_key(...)` call -> the rekey test fails (6 failed). - Mutation 2: drop `.ps57` from `PARTS['m57']` -> the rekey test crashes. No blocking findings. Note: #2592 touches the same file, a small rebase is expected for whichever lands second. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.