Skip to content

test(runtime): require a fresh complete texture readback - #4215

Open
Vonsek wants to merge 1 commit into
ItsNotRexed:mainfrom
Vonsek:codex/texture-readback-freshness
Open

Vonsek wants to merge 1 commit into
ItsNotRexed:mainfrom
Vonsek:codex/texture-readback-freshness

Conversation

@Vonsek

@Vonsek Vonsek commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: EGEN-TEXTURE-READBACK-FRESHNESS (Codex)

What and why

The synchronization check accepted the harness markers even when the cube readback was missing, stale, or truncated. Resolve the requested file relative to the harness working directory, clear an earlier output before the run, and require a new 65,536-byte readback for the 64 × 64 RGBA32F cube. Keep the validation-log checks.

Tested

Linux cloud, CMake 3.31.6, CPU-only stand-in harness. Before the change, missing, stale and truncated output were accepted. They now fail. A fresh file and a valid rerun with a relative path pass, and a synchronization hazard still fails. All six cases passed in python -I tests/test_texture_readback_sync.py -v. All eight CI-registration tests and git diff --check passed. Tested commit 683402e1dc43a07e2c76d8a88a98c62500ae24e2. Native Windows, Wine and GPU execution were outside this check.

Checklist

  • No game data, keys or decryption, including in logs or reports.

AI-assisted.

@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 683402e1 with the real harness: a native Linux build of vk_texture_test on main aa2988c, run on Mesa llvmpipe 23.2.1 with the Khronos validation layer from Vulkan SDK 1.4.363.1, using vs_ids and ps_cube_sample built by runtime/test/shaders/build.py.

  • vk_texture_test cube writes exactly 65,536 bytes, both for a relative -DOUTPUT="cube out.raw", which lands in the -DSPIRV directory as the new resolution expects, and for an absolute path. So the size constant and the path handling match the real tool.
  • python -I tests/test_texture_readback_sync.py: OK with CMake 4.4.5.
  • llvmpipe can't give a full end-to-end pass on either main or this PR. Validation reports VUID-RuntimeSpirv-shaderDenormPreserveFloat16-06296 and VUID-VkShaderModuleCreateInfo-pCode-08740 (DenormPreserve) for both shaders, because the device lacks shaderDenormPreserveFloat16. That's a device limit, the same on both sides, and the script correctly fails on it.

Note that nothing in CMake or CI registers check_texture_readback_sync.cmake on main, so it only runs when invoked by hand.

AI-assisted (Devin).

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ran this at 683402e1 on Windows 11: python -I tests/test_texture_readback_sync.py -> 1 test, OK; git diff --check clean.

The check now refuses to run without OUTPUT, resolves a relative readback path the same way the harness will (WORKING_DIRECTORY absolute, BASE_DIR that directory), deletes any previous file, and fails if it still exists; after the run it requires a regular file of exactly 64 * 64 * 16 = 65,536 bytes. That closes the stale/truncated/missing-readback cases the markers alone accepted, while the validation-layer and PASSED checks stay. No blocking issue.

@Gabzinnn12

Copy link
Copy Markdown

Tested 683402e on AMD Radeon RX 7600 (RDNA3), AMD 26.11.2 (LLPC), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363.0, adding a real-hardware run to the llvmpipe one above.

  • tests/test_texture_readback_sync.py: passes with CMake on PATH. With main aa2988c's check_texture_readback_sync.cmake in its place it fails 3 subtests (missing, stale and short readbacks), so it catches what it should. Without cmake on PATH it skips (e.g. a setup where cmake only lives inside Visual Studio).
  • The real check on this GPU (ps_cube_sample translated by run_gpu_tests.py, then cmake -P with vk_texture_test): the harness prints vk_texture_test cube: PASSED and writes the 65,536-byte readback, but the check stops at its existing "Validation Error" match, before the new size check: VUID-VkShaderModuleCreateInfo-pCode-08740, here for DrawParameters declared without shaderDrawParameters (not the DenormPreserve device limit seen on llvmpipe). main's version of the check fails the same way, so it isn't from this PR: in vk_texture_test.cpp, enabling maintenance8 sets f12.pNext = &m8, which drops the Vulkan 1.1 struct that carries shaderDrawParameters. tests: preserve DrawParameters when enabling Vulkan maintenance8 #3347 fixes that.
  • ctest: 0 failed out of 153 (145 passed, 8 skipped).

AI-assisted (Claude Code, reviewed with Codex). No game files.

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