From dbcc0986ee0bf5f4603d9846871c4d0607c10088 Mon Sep 17 00:00:00 2001 From: lukaslw-lab <291379150+lukaslw-lab@users.noreply.github.com> Date: Mon, 30 Nov 2026 15:09:37 +0100 Subject: [PATCH] test: expect clamped mesh output counts in native_direct_mesh #3537 replaced the "mesh count exchange exceeds declared range" refusal with a clamp to the declared output range, but the too-many-primitives case still expected the refusal, so native_direct_mesh failed on main. The case now checks that the vertex and primitive counts are clamped to 3 and 1 and that the clamped values reach setMeshOutputCounts. Co-Authored-By: Claude Opus 5.5 --- tests/native_direct_mesh_check.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/native_direct_mesh_check.py b/tests/native_direct_mesh_check.py index fef936e83d..8329a7d32c 100644 --- a/tests/native_direct_mesh_check.py +++ b/tests/native_direct_mesh_check.py @@ -518,7 +518,17 @@ def movv(v,s): return 0x7e000200|(v<<17)|s run('wrong-count-slot',count_setup+bad_slot+program[3:],'mesh count exchange shape or entry state is not covered') overflow=count_setup.copy() overflow[-1]=0x87238315 - run('too-many-primitives',overflow+allocate+program[3:],'exceeds declared range') + # Counts above the declared output range are clamped to it (#3537): at most 3 vertices and 1 primitive. + text=run('too-many-primitives',overflow+allocate+program[3:]) + clamped={} + for limit in ('3','1'): + compare=re.search(r'(%[\w.]+) = icmp ugt i32 (%[\w.]+), '+limit+r'\n', text) + assert compare, text + chosen=re.search(r'(%[\w.]+) = select i1 '+re.escape(compare[1])+r', i32 '+limit+', i32 '+ + re.escape(compare[2])+r'\n', text) + assert chosen, text + clamped[limit]=chosen[1] + assert ('setMeshOutputCounts(i32 168, i32 %s, i32 %s)' % (clamped['3'], clamped['1'])) in text, text # Write v10 for threads 0..2, then export it after the count exchange. # v10 is outside the exchange's scratch set but its write is partial.