Skip to content

no-game-data: block carved .code/.state programs, .xvc, .lpk and .smh by extension - #9127

Closed
berkay8987 wants to merge 2 commits into
ProjectLeonida:mainfrom
berkay8987:no-game-data-extensions
Closed

berkay8987 wants to merge 2 commits into
ProjectLeonida:mainfrom
berkay8987:no-game-data-extensions

Conversation

@berkay8987

@berkay8987 berkay8987 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: new BUILD item, #9065 (comment)

Depends on: #9000, in the sense the template asks for: it rewrites the same grep line of the workflow step into an ext= variable, so git merge-tree reports a conflict. The resolution is to add these five to its ext list; there is no code dependency. #8986 adds the LPK1 magic to the other step.

What and why

The workflow's extension check is the only one that sees a file without a magic. tools/fspx_unpack.py writes the native compute programs it carves out of the package's FidelityFX DLL as fspx/<name>.code (the program's machine code) and fspx/<name>.state; tools/shader_library.py writes .code files too (docs/fspx.md). Raw machine code has no magic, so scripts/check_no_game_data.py cannot catch it, and the extension list did not name it: a carved game shader under its own extension passed both checks.

added what it is why it is blocked by name
.code, .state the carved native programs no magic for the other step to read
.xvc a package container make_game.py's CONTAINER_SUFFIXES lists .xvc with .msixvc and .xvd; only the last two were here
.lpk world_build.py's packs of the game's geometry #8986 adds its magic; this catches it by name as well
.smh the package's groom files, which tools/smh_groom.py reads game files, never a fixture

No tracked file has any of the five extensions. A short comment above the grep line says why each is there.

.gitignore already listed every extension the step refused, so a plain git add never stages one; the five are added there too, and a new test, RefusedExtensionsAreIgnored, reads the step's own list and checks that each extension in it is in .gitignore, so the two cannot drift apart again. Nothing tracked is newly ignored.

Tested

  • python -I tests/test_no_game_data_workflow.py: 5 tests, OK, run through Git's bash on Windows. The new case runs the workflow's own step (read from the file, as the other cases do) on one file of each extension plus two near misses, codes.txt and state.md. With the workflow change taken out, it fails. The .gitignore test fails without the five .gitignore lines, naming them, and passes on main as it is.
  • The step itself over every tracked file of the repository: exit 0.
  • The other tests that read workflow files: test_ci_registration, test_check_apt_key and test_cmake_vulkan_missing pass. test_runtime_paths fails the same way on main without this change (tools/replace_retry.py missing from runtime.yml's path filter, which CI: the runtime workflow's path filter lists tools/replace_retry.py (test_runtime_paths red since #2721) #7029 fixes).
  • Windows 11 Pro 26200, Python 3.12.7, Git for Windows 2.52.0. No GPU and no game files.

AI-assisted: yes (Claude Code)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator rule here.)

🤖 Generated with Claude Code

… by name

tools/fspx_unpack.py writes the native programs it carves out of the
package as fspx/<name>.code and .state: raw machine code with no magic,
so check_no_game_data.py cannot see them and the extension check did
not list them. The same check also missed .xvc, which make_game.py's
CONTAINER_SUFFIXES names next to .msixvc and .xvd; world_build.py's .lpk
packs of the game's geometry; and the package's .smh groom files.

No tracked file has any of the five extensions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@catminou4

Copy link
Copy Markdown
Contributor

Tested on Apple M1 Max, macOS 27.2.1 arm64, Python 3.12.16: python -I tests/test_no_game_data_workflow.py → 4 tests OK. No game files. AI-assisted (Devin).

.gitignore listed every extension the workflow's extension check
refused, so a plain `git add` never staged one, but the five this PR
adds to the step were not ignored. Add them, and test that each
extension the step refuses is in .gitignore; the test reads the step
itself, not a copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@YordiLorenzo

Copy link
Copy Markdown

Tested 648640e on Linux, Python 3.14.4, git 2.53.0: pass

  • python -I tests/test_no_game_data_workflow.py: 5 tests OK; tests/test_ci_registration.py: 14 OK
  • Negative controls: with main's no-game-data.yml the new extension test fails; with main's .gitignore the new ignore test fails and names exactly xvc, code, state, lpk, smh
  • No tracked file on main has any of the five extensions
  • Not from this change, only a note: the step greps with -i, but .gitignore patterns match case on Linux, so PROG.CODE is refused by CI yet still staged by a plain git add. The new test compares the lowercase lists only.

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.

4 participants