Skip to content

check_no_game_data: --commits also checks files a pull request adds and deletes again - #6079

Open
Jadiac5 wants to merge 1 commit into
ItsNotRexed:mainfrom
Jadiac5:fix/no-game-data-history
Open

Jadiac5 wants to merge 1 commit into
ItsNotRexed:mainfrom
Jadiac5:fix/no-game-data-history

Conversation

@Jadiac5

@Jadiac5 Jadiac5 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claim: #5934 (comment)

The No Game Data job checked only the pull request's last tree. A file added in one commit and deleted in a later one passed, but a merge commit keeps it in main's history.

  • check_no_game_data.py --commits BASE..HEAD checks every file version reachable from HEAD and not from BASE (git rev-list --objects), with the same magic-number rules as the tree check.
  • The workflow fetches history without blobs (fetch-depth: 0, filter: blob:none) and runs the new mode on HEAD^1..HEAD for pull requests. The checkout is the merge commit, so that range is what the merge would bring in.
  • One new test builds a throwaway repo with a renamed DDS (hand-written bytes) that is added, deleted and merged.

Tested on Windows 11, Python 3.12, CPU only (no GPU involved): python -I tests/test_check_no_game_data.py 9/9; the new test fails without the change. On this repository's real history the new mode reports 0 matches on the tip and on the last 50 commits of main.

Not done:

  • The workflow change has not run on GitHub yet; this pull request's own run is its first test. The blob-less checkout fetches each blob the pull request adds on demand, so a very large pull request could come near the job's 5-minute limit (about 3,000 objects took 30 s locally with all blobs present).
  • Text formats (disassembly, SPIR-V assembly) that are added and deleted again are still caught only by the extension check on the last tree.
  • Direct pushes to main are not range-checked.

AI-assisted (Claude Code).

…t adds, so one deleted again in a later commit no longer passes
@leozinhoszg

Copy link
Copy Markdown
Contributor

Tested f89f750a on Windows 11 Pro (26200), CPython 3.14.7, git 2.55.0.windows.4, CPU only, no game files: pass with notes.

  • python -I tests/test_check_no_game_data.py 9/9, compileall and git diff --check clean. On synthetic repos --commits HEAD^1..HEAD also catches a DDS renamed to .txt, one added and deleted on a side branch merged into the PR, and one re-added after main deleted it. It passes a mode-only change and game data main added and deleted while the PR was open. No ${{ }} in any run: step, so no branch name or title reaches the shell. GitHub's refs/pull/6079/merge has two parents (base 561b65a8, head f89f750a), so HEAD^1 is the base.
  • Negative control: with main's scripts/check_no_game_data.py, test_commits_mode_finds_a_file_deleted_again fails (0 != 1). Main reads --commits as a path and skips it.
  1. With filter: blob:none, every file version that is not in the merge tree (deleted files, earlier versions of edited files) is fetched by its own git fetch. git rev-list --objects at scripts/check_no_game_data.py:249 triggers them one at a time. I copied the workflow's checkout against a local partial-clone server: 20 such versions gave 20 fetches and took 63 s, 100 gave 100 fetches and 267 s. Real open PRs with 16 to 28 commits have 30 to 150 such versions each (Runtime: ExecuteIndirect with multi-argument command signatures (root constants/descriptors, VB/IB views per record) on VK_EXT_device_generated_commands #2077: 147, Runtime tests: run the M5 mesh gate on 32-wide GPUs through --wave64-emulate (depends on #3777) #4236: 133, Runtime: ExecuteIndirect with DISPATCH_MESH signatures and the M5 mesh gate (translated mesh shader) #3777: 120). I couldn't time a fetch on a GitHub runner, but this grows with commit count and could hit the 5-minute timeout-minutes. Fetching them in one go first solved it here: 0 lazy fetches, 8.6 s for the 20-version case:
    git rev-list --objects --missing=print HEAD^1..HEAD | sed -n 's/^?//p' \
      | git -c fetch.negotiationAlgorithm=noop fetch -q --no-tags --no-write-fetch-head --filter=blob:none --stdin origin
    Put it in the workflow step before the check, or in commit_blobs when a ? line shows up.
  2. Optional: commit_blobs already has each blob's path, so the workflow's extension list could run on those paths too. An added-then-deleted text x.spvasm passes now (exit 0) even though rev-list prints its name.

AI-assisted.

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.

2 participants