Skip to content

tests: fix descriptor-fetch runner mocks and cover all fetch modes - #7122

Draft
richardsenra wants to merge 3 commits into
ItsNotRexed:mainfrom
richardsenra:contribution/table-fetch-checks
Draft

richardsenra wants to merge 3 commits into
ItsNotRexed:mainfrom
richardsenra:contribution/table-fetch-checks

Conversation

@richardsenra

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: TEST-PS-TABLE-FETCH-CHECKS, #6910 (comment)

Depends on: #6866
Depends on: #6833

The descriptor-fetch fixtures in #6866 make 15 existing shader-check subcases crash: the mock runner does not accept cwd. Teach the mock to accept the shader directory and write a fresh synthetic framebuffer for the five fetch modes; include both new cases in the expected summary count. The standalone command now also runs the four existing tests declared after unittest.main().

Four added tests exercise the actual table_fetch_test helper across all five modes: ordered successful runs, immediate failure/skip propagation, rejection of another mode's success line, and rejection of a stale framebuffer when the current invocation writes nothing. Pixel values remain checked by the native texture harness.

Validation on Windows 11, Ryzen 7 5700X, 32 GB RAM, NVIDIA GeForce RTX 3070 Ti (8 GB), driver 621.24 / 32.0.16.2124; Python 3.12.10, MSVC 19.44.35230, LLVM 23.1.6, SPIRV-Tools 2026.4, Vulkan SDK 1.4.363.0:

This PR adds only the test-file change on top of #6866; the other files in the stacked diff belong to its dependencies. No translator implementation or contract rule changes. No game files or corpus run.

AI-assisted: Codex.

@devnull34 devnull34 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on Windows 11:

  • python -m unittest tests/test_shader_checks.py passed all 92 tests (1.200s).
  • Validated TableFetchChecks covering all 5 descriptor fetch modes (fetch-sint, fetch-uint, fetch-miss, fetch-mixed, fetch-mixed-swap) and fixed shader-check runner mocks with cwd handling.
  • Whitespace clean (git diff HEAD~1..HEAD --check).

@illusionart453-max

Copy link
Copy Markdown

Independent native Windows/Python 3.15 verification at a233123 in an isolated detached worktree: python -I tests/test_shader_checks.py passes 92/92, no skips. This includes the Wave64 mocks affected by the cwd launch argument and the descriptor-fetch mode tests. Existing #7094 edits the same Wave64 harness signature, so keep that overlap in view at merge time. Synthetic CPU inputs only; no GPU/game files. AI-assisted (Codex).

@Cryserrrrr

Copy link
Copy Markdown

On main at 86d1c862d, this PR conflicts in runtime/test/shaders/check.py, runtime/test/vk_texture_test.cpp, scripts/run_gpu_tests.py and tests/test_shader_checks.py.

tests/test_shader_checks.py is red on main in the meantime (15 errors). There are two causes, both from #6833:

  • table_fetch_test calls the mocked run with cwd=spirv, and the harness fake in run_checks doesn't accept cwd, so it raises TypeError: ... unexpected keyword argument 'cwd'.
  • ps_table_fetch is one more case, and TOTAL doesn't count it, so the "N of M pass" lines are off by one.

If the rebase takes a while, this turns the file green on main (checked on Windows 11, Python 3.14, 84 tests OK). It stubs the new test the way the other pixel tests are already stubbed:

-         + len(check.TEXTURE_CONSTANTS) + 15)
+         + len(check.TEXTURE_CONSTANTS) + 16)   # ... and ps_table_fetch
 ...
                   patch.object(check, "texture_gradient_a16_test", return_value=""),
+                  patch.object(check, "table_fetch_test", return_value=""),

The full Windows test report is in #7333. 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.

5 participants