Repository navigation
TEST-362: compare Vulkan mesh pass coverage with a CPU reference - #4770
illusionart453-max wants to merge 1 commit into
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 1fc8fc75e on Windows 11: pytest tests/test_mesh_pass_coverage.py -q -> 1 passed, 4 subtests passed; git diff --check clean.
The new tools/mesh_pass_coverage.py compares the Vulkan mesh pass coverage against a CPU reference over the same primitives; the synthetic subtests cover full coverage, partial coverage and a missing primitive. I cannot run it against a translated game mesh here. No blocking issue.
|
I found a case where the default IoU threshold flags a correct draw. On an RTX 3080 Ti (NVIDIA 620.73.04, CachyOS,
The first two GPU readbacks are byte-identical. Feeding the middle readback to the comparator with the two x coordinates snapped to 4.5 restores IoU 1.0. The CPU edge test uses the full projected precision, so a subpixel displacement alone can look like a binding or projection error. This also crosses the 0.99 threshold discussed in #1889. A regression with the middle triangle would help pin the distinction. For this device, snapping projected vertices to the nearest 1/256 pixel before the CPU edge test resolves it. If the comparator keeps full-precision inputs, documenting the rasterizer precision assumption would help users interpret missing and extra pixels. AI-assisted. Synthetic inputs only. |
|
At current head |
|
At I tested a local version that stores the CPU mask in a To repeat the measurement on the PR, save the script below as import json, struct, sys, tracemalloc, runpy
from pathlib import Path
from tempfile import TemporaryDirectory
n=int(sys.argv[1])
with TemporaryDirectory() as d:
t=Path(d,"triangles.json")
r=Path(d,"out.raw")
t.write_text(json.dumps([[[0,0],[n,0],[0,n]],[[n,0],[n,n],[0,n]]]))
r.write_bytes(struct.pack("<4f",1,1,1,1)*(n*n))
sys.argv=["tools/mesh_pass_coverage.py",str(t),str(r),str(n),str(n)]
main=runpy.run_path(sys.argv[0])["main"]
tracemalloc.start()
result=main()
print("input bytes",r.stat().st_size,"peak",tracemalloc.get_traced_memory()[1],"exit",result)AI-assisted. |
|
Half-subpixel ties on Windows RTX 3070 Following the quarter-step report, I measured the exact half-step on two adjacent subpixel intervals at
For each interval, I added 0, 3/8, 1/2, 5/8 and 1 times Windows, RTX 3070, NVIDIA 617.14, CPython 3.14.10 and SPIRV-Tools 2026.4. Used synthetic mesh/fragment SPIR-V with |
|
Picking TEST-362 up per the release in #4683. I will base a branch on |
|
@Idealism3937 I'm doing the TEST-362 game-drawable slice on top of the comparator: a real drawable through its translated game mesh shader on
AI-assisted (Claude Code). |
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.
TEST-362 adds a CPU coverage comparator for a Vulkan mesh pass. Give it preprojected framebuffer triangles and the RGBA32F readback from vk_harness. It reports mask intersection over union and the counts of missing and extra pixels.
Claim: #4683 (comment)
Workflow discussion: #1889
Tested on Windows 11. Four CPU-only synthetic mask cases passed. A synthetic mesh and fragment shader rendered at 16 x 16 on an RTX 5060 with driver 610.88 and matched the CPU mask exactly (IoU 1.0, zero missing or extra pixels).
This draft covers the comparator. Running the translated game shader pair with its matching local drawable and descriptor bindings remains pending. No game data is included. AI-assisted (Codex).