Repository navigation
TEST-362: mesh pass coverage comparator fixes + synthetic MS/PS acceptance slice - #4809
Idealism3937 wants to merge 2 commits into
Conversation
Based on ItsNotRexed#4770's 1fc8fc7 by @illusionart453-max (commit retained). - VKH_COVERAGE_MASK reads a stencil mask, so a fragment writing (-1,-1,-1,-1) is still covered; ps_coverage_clear regression. - CPU projection snaps vertices to the 8-bit subpixel grid, ties to even; Kev-Ball 4.5009765625 and CuteBooty half-tie cases. - Coverage and raw readbacks are streamed; CPU mask is a bytearray. 512x512 peak 591,276 bytes traced. - ms_coverage fetches six synthetic vertices through a 4-dword V# at 0x1000 and samples an 8-dword T# at 0x100; 52x52 mask, IoU 1.0 on RTX 3060 / NVIDIA 617.14 / Vulkan 1.4.351. - Docs describe the no-game fixture and leave the game-drawable pass chain as the coordinator's follow-up. AI-assisted.
|
Verified
AI-assisted (Devin); no game files. |
|
I tested the integration with #4815’s real one-meshlet draw. I used its drawable selector, translated mesh shader, CPU camera and projection at Across 48 poses at 128×128, the 8-bit CPU mask matched the GPU stencil at every pixel. On this fixture the independently decoded colour coverage also matched the stencil on every draw. One pose distinguishes the subpixel fix from disabling it: yaw −128°, pitch 13°, 1,403 covered GPU pixels. I repeated the draw and ran the comparator CLI twice on the same readback:
That pose is a reproducible integration check for #4815 when switching to the shared comparator. RTX 3080 Ti (8 subpixel precision bits), driver 620.73.04, CachyOS, own 1.0.2.1 copy. Aggregate counts only. AI-assisted. |
kacper-serewis
left a comment
There was a problem hiding this comment.
At d0b5d21, the ms_coverage branch labels UNSUPPORTED draws SKIP but sets ok_all=False. When both draws are unsupported this reports failure and exits 1 even without --require-pass. Please propagate the suite’s skip sentinel and cover both-unsupported and mixed outcomes. Found by source inspection. Five comparator tests passed, and independent synthetic CPU checks confirmed IoU threshold and mask-length behavior. AI-assisted.
whattheflop
left a comment
There was a problem hiding this comment.
Independent Windows CPU review, AI-assisted, with uv CPython 3.12.13. All five comparator tests and all three synthetic shader validations passed. Independently decoded vertices yielded 2,704 covered pixels with no shared-edge overlap. The stencil mask also gave the same coverage with red, black, and clear-colored readback.
Three adjacent test failures are new versus #4770 at 1fc8fc75:
test_run_gpu_tests.py(40/41) andtest_run_gpu_tests_paths.py(19/20) both still treat everyDRAWN_WITHvalue as a string. Thecs_bench_mixno-runnable-filter path passes the new tuple tosplitextat line 1485, and the dependency-path test passes it directly to its path join. Please normalize the partner list consistently in both paths.test_text_write_line_endings.py(2/3) flags the fixture triangle JSON open at line 118. Setnewline="\n".
The textured acceptance case also needs an independent color assertion. With only vk_harness mocked, I kept the exact 2,704-pixel stencil mask and replaced the expected covered red with transparent black. The runner still exited 0 at IoU 1.0. A wrong clear-color pixel in its separate case correctly failed. Keep coverage independent of RGBA and assert the expected textured RGBA on covered pixels. CPU/stub evidence only.
…iser); NaN is a wrong colour PingasMech found two faults in the saved-draw check (ItsNotRexed#4815): an unsnapped CPU rasteriser fails correct draws whose edges sit between two 1/256-pixel steps (IoU 0.79 on a 16x16 draw), and a NaN channel passed the colour test because abs(NaN - x) > 1e-6 is false. The branch now sits on ItsNotRexed#4809. GPU coverage is vk_harness's VKH_COVERAGE_MASK stencil readback, so a covered pixel counts whatever its colour. CPU coverage is mesh_pass_coverage.rasterize with the vertices snapped to the subpixel grid (--subpixel-bits, default 8, recorded in manifest.json). The silhouette band, the colour check (math.isclose, so NaN fails) and the negative controls stay in ms_pass. On the Radeon 760M the real draw is still exact in both poses, natively and emulated, and the three controls still fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BzPoR7BgcXfXLLrqxDrn7Y
|
Small CI item at if __name__ == "__main__":
try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode
sys.stdout.reconfigure(errors="replace")
except (AttributeError, ValueError, OSError):
pass
...(It also needs AI-assisted (Claude Code). |
|
FAIL, reproduced against main 3faac55: merges cleanly and the new test_mesh_pass_coverage.py passes 5/5, but the tuple value your d0b5d21 adds to DRAWN_WITH breaks the pre-existing consumer — python -I tests/test_run_gpu_tests.py fails with TypeError: expected str, bytes or os.PathLike object, not tuple at scripts/run_gpu_tests.py:1485 (the splitext filter added by acbb574 on main), where the same suite is green on main. Please flatten tuple values there (or keep one partner per key), and pin newline="\n" on the new ms_coverage.triangles.json write. Heads-up: #4815 contains these commits and evolves the comparator — one fix, then rebase the other; as-is neither head is clean against test_run_gpu_tests.py. No CI checks on the branch. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
At
This fix makes both OK here, and diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 0caecbaf..7ed96b89 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -1482,7 +1482,8 @@ def run_suite(a, work: str) -> int:
if a.filter and not results: # the filter matched only inputs/partners: say so rather than "0/0 passed"
names = [os.path.splitext(f)[0] for f in asm_files]
- partners = {os.path.splitext(f)[0] for f in DRAWN_WITH.values()} | set(TEXTURE_MIP_DEPENDENCIES)
+ partners = {os.path.splitext(f)[0] for v in DRAWN_WITH.values()
+ for f in (v if isinstance(v, (list, tuple)) else (v,))} | set(TEXTURE_MIP_DEPENDENCIES)
shown = ", ".join(names[:5]) + (", ..." if len(names) > 5 else "")
role = "partners built for other tests" if partners.issuperset(names) else "inputs without a GPU test row"
hint = ("; cs_bench_* shaders are benchmark inputs, run them with the benchmark tool"
diff --git a/tests/test_run_gpu_tests_paths.py b/tests/test_run_gpu_tests_paths.py
index 7400a7be..30effc35 100644
--- a/tests/test_run_gpu_tests_paths.py
+++ b/tests/test_run_gpu_tests_paths.py
@@ -45,7 +45,8 @@ class DrawShaders(unittest.TestCase):
# the clip cases (#193) are variants of vs_clip.asm with different signatures, not files of their own
source = "vs_clip" if name in run_gpu_tests.CLIP_CASES else name
self.assertTrue((shaders / f"{source}.asm").is_file(), name)
- self.assertTrue((shaders / extra).is_file(), extra)
+ for partner in (extra if isinstance(extra, (list, tuple)) else (extra,)):
+ self.assertTrue((shaders / partner).is_file(), partner)
class FilterSelection(unittest.TestCase):A minor one, also from memorypressure: I've put the same fix on top of #4815 so it's green meanwhile. I'll drop that commit once it's in this branch. AI-assisted (Claude Code). |
…s DRAWN_WITH has one (stacked fix) ItsNotRexed#4809 made DRAWN_WITH["ms_coverage"] a tuple; with_draw_shaders handles that, but the partners set of an inputs-only --filter (scripts/run_gpu_tests.py) and test_every_shader_named_exists (tests/test_run_gpu_tests_paths.py) still take one file name, so tests/test_run_gpu_tests.py and tests/test_run_gpu_tests_paths.py each fail with a TypeError (found by memorypressure on ItsNotRexed#4815). Both now iterate a tuple. The same diff is offered on ItsNotRexed#4809; this commit goes away when that branch has it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BzPoR7BgcXfXLLrqxDrn7Y
|
Tested d0b5d21 at the stack head (1fc8fc7 from #4770, which is closed, is an ancestor of the head). On an AMD Radeon 610M (RADV, subgroup 32..64), Linux: ms_coverage passes with the mesh fixtures running (texture and clear-colour, IoU 1.000000, missing 0, extra 0 each), ps_coverage_clear passes 4096/4096 pixels exact, and tests/test_mesh_pass_coverage.py passes (5 tests). A nonexistent device name fails ms_coverage with "no Vulkan physical device matches". On an Intel UHD 630 (Mesa 25.2.8 ANV, Ubuntu 24.04), the same tests pass 5 of 5 and ps_coverage_clear passes 4096/4096, but both ms_coverage rows skip with "unsupported: no VK_EXT_mesh_shader", so the mesh result is not confirmed on that GPU. The RTX 3060 result in the PR body was not reproduced. AI-assisted. |
|
Tested
|
TEST-362 (workflow: #1889). Replaces #4770: this branch is based on its
1fc8fc75by @illusionart453-max (Chris) and retains that commit and attribution. #4770 can be closed if this lands.Depends on: #4770
What changed:
VKH_COVERAGE_MASKinvk_harnesswrites a stencil mask (one byte/pixel), so a fragment writing(-1,-1,-1,-1)still counts as covered.ps_coverage_clearproves it on the GPU.mesh_pass_coverage.pyuses that mask, snaps CPU-projected vertices to the 8-bit subpixel grid (ties to even), streams the coverage/raw readbacks and keeps the CPU mask in abytearray.ms_coverage.asm: a 4-dword V# at heap0x1000points at six synthetic vertices at0x2000;ps_texture_samplereads an 8-dword T# at0x100. One 64x64 draw, with the same two triangles projected on the CPU.run_gpu_tests.pybuilds the PSV0 fixture and runs both the textured and clear-colour regressions;docs/testing.mddocuments it.Verification:
python -I tests/test_mesh_pass_coverage.py -v-> 5 tests OK; 512x512 peak 591,276 bytes traced (target <= 2 MB).python -I scripts/run_gpu_tests.py --build runtime/build --filter ms_coverage --require-pass->texture: IoU 1.000000, missing 0, extra 0; clear-colour: IoU 1.000000, missing 0, extra 0. The mask is 2704/4096 bytes set, matching the 52x52 CPU projection; the first covered raw pixel is(1,0,0,1).LEONIDA_VK_DEVICE=3060; CMake with VS 18 / MSVC 19.51.ms_suite is 6/7 pass, 1 SKIP (ms_w64x_ballot, no 64-wide subgroup).git diff --checkclean. No game files, archives, executables, game shaders, textures or logs.Limits: this is the synthetic no-game slice. The real game drawable plus its carved MS/PS, and the pass-by-pass chain, are the coordinator's follow-up and need a package. AI-assisted.