upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNotRexed <therealnothingfn@gmail.com>2026-12-01 03:18:05 -0500
committerNotRexed <therealnothingfn@gmail.com>2026-12-01 03:18:05 -0500
commitcd73ddab7b5b3e2bd7c2088ee939b2ce2efc5fc4 (patch)
treeb346ee1844cf42c7626719f1fc71865f939bb960
parent10d8223336a38c1306b5b3afe06a0f23ba188863 (diff)
parent2e822df666ad103b82ed088f89338e747c9727c9 (diff)
Merge remote-tracking branch 'origin/main' into push/main-1130
-rw-r--r--docs/game_gate.md2
-rw-r--r--scripts/game-gate.ps11
-rw-r--r--tests/semantic/test_wave64_emulate_opt.py27
-rw-r--r--tests/test_game_gate.py5
-rw-r--r--tests/test_make_game_argparse.py4
-rw-r--r--tools/game_gate.py2
6 files changed, 39 insertions, 2 deletions
diff --git a/docs/game_gate.md b/docs/game_gate.md
index 2a4f44c37..7aed4339c 100644
--- a/docs/game_gate.md
+++ b/docs/game_gate.md
@@ -6,6 +6,8 @@ The script is `scripts/game-gate.ps1` (Windows, PowerShell 7). The parser is `to
6 6
7## Running it 7## Running it
8 8
9It needs PowerShell 7 (`pwsh`). Windows PowerShell 5.1 (`powershell.exe`) refuses the script with a message before anything runs, from its `#Requires -Version 7.0` line.
10
9Build the runtime first (`d3d12\scripts\build-nvidia.ps1`). The gate refuses to start without `d3d12\target\diag\leonida.exe`, because the play script would build it inside the timed run. 11Build the runtime first (`d3d12\scripts\build-nvidia.ps1`). The gate refuses to start without `d3d12\target\diag\leonida.exe`, because the play script would build it inside the timed run.
10 12
11Make a data template once: 13Make a data template once:
diff --git a/scripts/game-gate.ps1 b/scripts/game-gate.ps1
index ad02a6c3b..7d38505ce 100644
--- a/scripts/game-gate.ps1
+++ b/scripts/game-gate.ps1
@@ -1,3 +1,4 @@
1#Requires -Version 7.0
1# The in-game gate for the D3D12 runtime (leonida.exe): one run, measured the same way on every machine. 2# The in-game gate for the D3D12 runtime (leonida.exe): one run, measured the same way on every machine.
2# 3#
3# pwsh -NoProfile -File scripts\game-gate.ps1 run -Game <dir> -Data <dir> -DataTemplate <dir> -Name <label> [options] 4# pwsh -NoProfile -File scripts\game-gate.ps1 run -Game <dir> -Data <dir> -DataTemplate <dir> -Name <label> [options]
diff --git a/tests/semantic/test_wave64_emulate_opt.py b/tests/semantic/test_wave64_emulate_opt.py
index 5e63033c1..f7528bc2a 100644
--- a/tests/semantic/test_wave64_emulate_opt.py
+++ b/tests/semantic/test_wave64_emulate_opt.py
@@ -1439,6 +1439,33 @@ class StructuredEmulationTests(unittest.TestCase):
1439 for l in range(threads): 1439 for l in range(threads):
1440 self.assertEqual(mem[512 + l * 4], v4[l] & 0xFFFFFFFF, f"lane {l} rev={rev}") 1440 self.assertEqual(mem[512 + l * 4], v4[l] & 0xFFFFFFFF, f"lane {l} rev={rev}")
1441 1441
1442 def test_append_consume_in_one_wave_branch_keeps_workgroup_barriers(self):
1443 # Wave 0 enters the SCC branch, wave 1 skips it. The wave-wide LDS counter and its exchange still need an
1444 # isolated scheduler with real workgroup barriers. Removing either op from _ALWAYS_BARRIER_OPS previously
1445 # let every existing test pass even though this shape reaches the sync-free-block assertion in rdna2spirv.
1446 for op in ("ds_append", "ds_consume"):
1447 with self.subTest(op=op):
1448 insns = [
1449 ("v_and_b32_e32 v1, 63, v0", 4),
1450 ("v_lshlrev_b32_e32 v6, 2, v0", 4),
1451 ("v_readfirstlane_b32 s20, v0", 4),
1452 ("s_cmp_eq_u32 s20, 0", 4),
1453 ("s_cbranch_scc0 4", 4), # Wave 0 enters; wave 1 skips all three instructions.
1454 ("v_mov_b32_e32 v8, 0xdead", 4),
1455 (f"{op} v8", 4),
1456 ("buffer_store_dword v8, v6, s[0:3], 0 offen", 8),
1457 ("s_mov_b64 exec, -1", 4),
1458 ("s_endpgm", 4),
1459 ]
1460 spv, gen = _translate_encoded(f"cs_{op}_one_wave_branch", insns, (128, 1, 1), emulate=True)
1461 self.assertEqual(gen.emulate_plan["mode"], "structured_hybrid")
1462 self.assertIn("mini_scheduler", [step[0] for step in gen.emulate_plan["steps"]])
1463 self.assertGreaterEqual(spv.count("OpControlBarrier"), 3)
1464 if op == "ds_append":
1465 self.assertIn("OpAtomicIAdd", spv)
1466 else:
1467 self.assertIn("OpAtomicISub", spv)
1468
1442 def test_mask_flbit_is_synchronized_in_a_branch_taken_by_only_one_wave(self): 1469 def test_mask_flbit_is_synchronized_in_a_branch_taken_by_only_one_wave(self):
1443 # One wave takes the SCC branch body. Its bit scan still needs a workgroup exchange. 1470 # One wave takes the SCC branch body. Its bit scan still needs a workgroup exchange.
1444 for op, ext_inst in (("s_flbit_i32_b32", "FindUMsb"), ("s_flbit_i32", "FindSMsb")): 1471 for op, ext_inst in (("s_flbit_i32_b32", "FindUMsb"), ("s_flbit_i32", "FindSMsb")):
diff --git a/tests/test_game_gate.py b/tests/test_game_gate.py
index 9da60f265..6062b29c6 100644
--- a/tests/test_game_gate.py
+++ b/tests/test_game_gate.py
@@ -310,6 +310,11 @@ class Command(unittest.TestCase):
310 310
311 311
312class Script(unittest.TestCase): 312class Script(unittest.TestCase):
313 def test_it_needs_powershell_7(self):
314 # Under Windows PowerShell 5.1 it failed in about 2 s without saying why: it now says so before running.
315 with open(os.path.join(ROOT, "scripts", "game-gate.ps1"), encoding="utf-8") as f:
316 self.assertEqual(f.readline().strip(), "#Requires -Version 7.0")
317
313 def test_no_variable_takes_a_parameters_name_in_another_case(self): 318 def test_no_variable_takes_a_parameters_name_in_another_case(self):
314 # PowerShell names ignore case: a `$game` process held in the `[string]$Game` parameter became its name, 319 # PowerShell names ignore case: a `$game` process held in the `[string]$Game` parameter became its name,
315 # and the stop could not wait for it. 320 # and the stop could not wait for it.
diff --git a/tests/test_make_game_argparse.py b/tests/test_make_game_argparse.py
index 8a96c6958..a92934bff 100644
--- a/tests/test_make_game_argparse.py
+++ b/tests/test_make_game_argparse.py
@@ -365,7 +365,9 @@ class JobsHandlingTest(unittest.TestCase):
365 patch("make_game.runtime_gpu_per_vertex", return_value=None), \ 365 patch("make_game.runtime_gpu_per_vertex", return_value=None), \
366 patch("make_game.runtime_gpu_barycentric_fallback", return_value=None), \ 366 patch("make_game.runtime_gpu_barycentric_fallback", return_value=None), \
367 patch("make_game.runtime_gpu_max_push_constants", return_value=None), \ 367 patch("make_game.runtime_gpu_max_push_constants", return_value=None), \
368 patch("make_game.runtime_gpu_mesh_draws_crash", return_value=None): 368 patch("make_game.runtime_gpu_mesh_draws_crash", return_value=None), \
369 patch("make_game.runtime_gpu_integer_dot_product", return_value=None), \
370 patch("make_game.runtime_gpu_denorm_ftz_f32", return_value=None):
369 ret = make_game.main() 371 ret = make_game.main()
370 self.assertEqual(ret, 0) 372 self.assertEqual(ret, 0)
371 probe.assert_called_once_with("auto", mesh_compute=False) 373 probe.assert_called_once_with("auto", mesh_compute=False)
diff --git a/tools/game_gate.py b/tools/game_gate.py
index 5a69e8995..fee55866b 100644
--- a/tools/game_gate.py
+++ b/tools/game_gate.py
@@ -67,7 +67,7 @@ SOURCES = {
67 "Leonida: {what} {:#010x} at {}{detail}": "d3d12/crates/leonida-loader/src/crash.rs", 67 "Leonida: {what} {:#010x} at {}{detail}": "d3d12/crates/leonida-loader/src/crash.rs",
68 "unhandled exception": "d3d12/crates/leonida-loader/src/crash.rs", 68 "unhandled exception": "d3d12/crates/leonida-loader/src/crash.rs",
69 "shaders in the cache, {} do not translate, {:.0} s": "d3d12/apps/leonida/src/translate.rs", 69 "shaders in the cache, {} do not translate, {:.0} s": "d3d12/apps/leonida/src/translate.rs",
70 "pipelines known, {} made before ({fingerprint}), {} bad; {} to make": "d3d12/apps/leonida/src/warm.rs", 70 "pipelines known, {} made before ({mark}), {} bad; {} to make": "d3d12/apps/leonida/src/warm.rs",
71 "made in {:.0} s (": "d3d12/apps/leonida/src/warm.rs", 71 "made in {:.0} s (": "d3d12/apps/leonida/src/warm.rs",
72 "memory: {:.0} MB private ({:.0} MB of it in memory; the PC has {:.0} MB free and {:.0} MB": 72 "memory: {:.0} MB private ({:.0} MB of it in memory; the PC has {:.0} MB free and {:.0} MB":
73 "d3d12/crates/leonida-gpu/src/copystat.rs", 73 "d3d12/crates/leonida-gpu/src/copystat.rs",