Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5262. Fixes #5273.
Both are in
mesh_w64x_testinruntime/test/shaders/check.py, which serves two meshes:ms_w64x_ballotandms_wave_info_s3.#5262: a NaN frame read as success
The comparison was
abs(p[i] - want) > 1e-3. Every comparison against NaN is false, so a frame entirely of NaNs producedwrong == 0and the check returned the empty success string. A single NaN channel was enough, because that channel's comparison simply never counted as wrong.It now uses
math.isclose(..., abs_tol=1e-3)and negates it, so a NaN channel counts as a mismatch.math.iscloseis false for NaN, andnot FalseisTrue. This is the same fix #1100 made inscripts/run_gpu_tests.py; the standalone path had its own copy of the comparison, which is why it stayed.Reproduced and fixed with a synthetic harness writing a full 64x64 frame of NaNs:
''(success)4096 of 4096 pixels differ (blue nan at pixel 0, want 0.5)#5273: a valid 32-wide draw skipped
The 64-wide subgroup gate applied to both meshes:
Only
ms_w64x_ballotneeds 64 lanes; its ballot is taken across both halves.ms_wave_info_s3is valid at a 32-wide subgroup, and the skip made the standalone checker report it as untested there while the main runner checked it. The gate now applies toname == "ms_w64x_ballot"only.Against a harness reporting
subgroup 32..32:ms_w64x_ballotNone(skip)None(skip, still)ms_wave_info_s3None(skip)''(passes)The ballot mesh keeps its width requirement, which is the behaviour the reviewer asked to retain on #5264.
Tests
Five cases added to
tests/test_run_gpu_pixel_checks.py(MeshW64xChecks), using a syntheticvk_harnesswritten into a temporary directory, so no GPU and no game data are involved:ms_w64x_ballotstill skips on a 32..32 device;ms_wave_info_s3passes on a 32..32 device.Mutation-checked: reverting the four comparisons to
abs(...) > 1e-3failstest_a_nan_frame_failsandtest_one_nan_channel_fails, and reverting the gate to apply to both meshes failstest_the_wave_info_mesh_runs_on_a_32_wide_subgroup. So none of the new cases passes vacuously.Tested
CPU only, no GPU, no game files.
python -I tests/test_run_gpu_pixel_checks.py— Ran 16 tests, OKpython -I tests/test_shader_checks.py— Ran 82 tests, OKpython -m compileall -q runtime/test/shaders/check.py— passesNote for whoever lands this: #6030 also edits
check.py, but only by addingms_wave0_alloc_roundsto two name lists; it does not touchmesh_w64x_test, so the two should merge cleanly either way round.AI-assisted.