upleb.uk

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

summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMoonEyes <ducoinbenjamin@yahoo.fr>2026-11-30 14:54:12 +0100
committerGitHub <noreply@github.com>2026-11-30 14:54:12 +0100
commitf44904d21cb64c7c2121905f49ff50f6cd2b132d (patch)
tree2589ba8e28c4b7f0f7625c33bb9bb2dd1a9a411d /scripts
parentac0e33f7820659400b7266cc00fd009618b003d8 (diff)
parentc3f63575a260a24a815b03a3dec3653fa6607078 (diff)
Merge pull request #2718 from OreoFR/carry/pr-1726
reprend #1726: run_gpu_tests: sort cs_dump tables one entry per line (TEST-RUN-GPU-SORTED-TABLES)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/run_gpu_tests.py307
1 files changed, 156 insertions, 151 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 92d0e61b5..c3b73d098 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -474,6 +474,155 @@ def subgroup_pin_skip(msg: str, cs_env: dict | None) -> Skip | None:
474# report a failure that is really an unpinnable wave size (GCN3/GCN4 expose 64..64 only). 474# report a failure that is really an unpinnable wave size (GCN3/GCN4 expose 64..64 only).
475WAVE32_PIN_DUMPS = ("cs_barrier_loop",) 475WAVE32_PIN_DUMPS = ("cs_barrier_loop",)
476 476
477# Compute dump fixtures (sorted one entry per line to avoid horizontal-tuple merge conflicts).
478# Adding a fixture edits only CS_DUMP_WANTS (and CS_DUMP_NON_WAVE64 / CS_DUMP_HEXWORDS if applicable).
479CS_DUMP_WANTS: dict[str, list[int]] = {
480 "cs_barrier_divergent": [127, 126, 125, 124, 123, 122, 121, 120],
481 "cs_barrier_early_end": [127, 126, 125, 124, 123, 122, 121, 120],
482 "cs_barrier_loop": [128, 96, 64, 32, 128, 96, 64, 0xEEEEEEEE],
483 "cs_bpermute32": [0, 50, 162, 99, 36, 218, 183, 15],
484 "cs_dpp": [1, 0, 3, 2, 5, 4, 7, 6],
485 "cs_dpp8": [7, 6, 5, 4, 3, 2, 1, 0],
486 "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7],
487 "cs_dpp_bound": [10, 10, 11, 12, 13, 14, 15, 16],
488 "cs_dpp_cmp": [3, 2, 3, 2, 1, 0, 1, 0],
489 "cs_dpp_cmpx": [1, 1, 0, 0, 3, 3, 2, 2],
490 "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777],
491 "cs_dpp_mask": [1, 0, 3, 2, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE],
492 "cs_dpp_ops": [100, 10, 11, 12, 13, 14, 15, 16],
493 "cs_dpp_row": [0, 0, 1, 2, 3, 4, 5, 6],
494 "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6],
495 "cs_exec_const": [16, 8, 2, 16, 0, 16],
496 "cs_lds_atomics_ext": [0xF0F11234, 0xAB34CD78, 0x12345678, 0xF0F00F0F, 0xA5A55A5A, 0x00AA00AA, 0x7FB00000, 0xFE090700],
497 "cs_lds_b64_cmpst": [0x11110001, 0x22220002, 0x33330003, 0x44440004, 0xCCCC000C, 0x44440004, 0xBBBB000B, 0x3579BADC],
498 "cs_lds_xchg64_ext": [0x11110003, 0x33333333, 0xF00FF000, 0x04030201, 0x40302010, 0x70500705, 0x3FC00000, 0x80000000],
499 "cs_mask_vgpr_exec": [0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF],
500 "cs_movrelsd_2": [11, 33, 33, 55, 1717, 77, 1515, 1717],
501 "cs_signed_zero_nan": [0x80000000, 0x80000000, 0x80008000, 0x00008000, 1, 1, 1, 0x00007C00],
502 "cs_smem_soffset_imm": [0x5EED0024, 0x5EED0028, 0x5EED002C, 0x5EED0030, 0x5EED0010, 0x5EED0014, 0x5EED0018, 0x5EED001C],
503 "cs_smem_vcc_base": CS_SMEM_VCC,
504 "cs_store": [0x400080FF, 0xE00003FF, 0x3C004000, 0xEEEEEEEE, 0x40003C00, 0xBC003800, 0x40FF8000, 0x3FF00000],
505 "cs_w32_andn2_exec": [1, 8, 16, 2064, 2068, 3, 20, 1544],
506 "cs_w32_buffer_store_sub": [0x1122AB44, 0xCDEF7788, 0x34AABBCC, 0xDDDDDD12, 0x0102035A, 0x05061234, 0xAB, 0xFFFFCDEF],
507 "cs_w32_buffer_sub16": [0xBEEF00AA, 0x00AA1234, 0xBEEFFFAA, 0xFFAA1234, 0xBEEF8899, 0x88991234, 0x1122CD44, 0xABCD7788],
508 "cs_w32_cvt_f16_mods": CVT_F16_MODS_WORDS,
509 "cs_w32_exec_computed": [259, 1028, 3088, 7682, 512, 4100, 0, 3],
510 "cs_w32_fcmpswap": [0, 0x3F800000, 0x7FC00000, 0x3F800000, 0x80000000, 0x40400000, 0x3F800000, 0x7FC00000],
511 "cs_w32_int_ext": [1, 27, 1, 0x33332222, 0xC0000000, 0x4000, 18, 0x20304050],
512 "cs_w32_lane_wrap": [25, 16, 777, 777],
513 "cs_w32_lds_subdword": [0x11B2D444, 0xA1B2C3D4, 0xFFFFFFB2, 0x000000B2, 0x00000011, 0xFFFFA1B2, 0x0000A1B2, 0xFFFFC3D4],
514 "cs_w32_lds_u8_d16": [0xBEEF00FF, 0x00FF1234, 0xBEEFFF80, 0xFF801234, 0xBEEF007F, 0x007F1234, 0xBEEF0080, 0xFFFF1234],
515 "cs_w32_lds_wide": [0xCAFEF00D, 0xFEEDFACE, 0x600DD00D, 0x00000000, 0x8BADF00D, 0xDEADC0DE, 0x12345678, 0x9ABCDEF0],
516 "cs_w32_mask_imm": [2056, 20, 2, 6152, 2050, 4112, 258, 32],
517 "cs_w32_misc_ext": [0x0FFF0FFF, 0xE2C4A688, 0x0007FFFF, 0x7FFF8000, 0xFFFE0002, 0xFFFF0005, 0x509, 0xCAFEF00D],
518 "cs_w32_new_ops": [0x55, 0x8001, 0xC0000000, 0x80014000, 0x4000FFFF, 0x77, 0x99, 0x1234],
519 "cs_w32_partial_permute": [0, 29, 127, 0, 1, 0, 134, 113],
520 "cs_w32_partial_scmp": [0, 1, 1, 0, 1, 1, 1, 1],
521 "cs_w32_permlane_fi": [1000, 0, 4, 1, 1000, 0, 52, 49],
522 "cs_w32_permute": [218, 29, 8, 211, 0, 15, 99, 15],
523 "cs_w32_salu64": [0x1E6A2C48, 0x1234, 0xFFFFFFFF, 0x100, 47, 48, 0xFFFF8000, 0xFFFFFFFE],
524 "cs_w32_sincos": [1, 1, 1, 1, 1, 1],
525 "cs_w32_wrxchg2_ext": [0x77777777, 0x88880008, 0x99990009, 0xDEADBEEF, 0xAAAAAAAA, 0xBBBBBBBB, 0x12341234, 0x56785678],
526 "cs_w32_wrxchg2st64": [0x33333333, 0x44444444, 0x55550005, 0x66660006, 0xB0B00084, 0xB0B00088, 0xB0B00140, 0xB0B002C0],
527 "cs_w64_exec_computed": [291, 1028, 11264, 771, 8192, 4132, 0, 3],
528 "cs_w64_mask_detect": [48],
529 "cs_w64_mask_imm": [2056, 1084, 828, 2052, 319, 2104, 516, 2064],
530 "cs_w64x_andn2_exec": [1, 16, 32, 4144, 2052, 3, 8, 1544],
531 "cs_w64x_ballot": [2053, 2061, 2069, 2077, 2085, 2093, 2101, 2109],
532 "cs_w64x_bpermute": [36, 316, 253, 218, 435, 225, 0, 442],
533 "cs_w64x_branch": [0, 0, 0, 0, 5, 5, 9, 9],
534 "cs_w64x_chain_barrier": [564, 563, 500, 627],
535 "cs_w64x_cmp_sdst": [10240, 6144, 2053, 8224, 7714, 6184, 4144, 5],
536 "cs_w64x_lds_raw": [132, 137, 100, 108, 131, 101, 149, 118],
537 "cs_w64x_lds_war": [1032, 1063, 1000, 1031, 2032, 2063, 2000, 2031],
538 "cs_w64x_load_ballot_load": [43, 74, 75, 42, 42, 18, 41, 32],
539 "cs_w64x_mask_reuse": [8, 40, 8, 40, 2, 20, 10, 64],
540 "cs_w64x_mask_reuse2": [10, 20, 8, 8, 5, 2, 132, 131],
541 "cs_w64x_partial": [40, 40, 528, 0, 0, 532, 539, 524820],
542 "cs_w64x_partial_scmp": [0, 1, 0, 1, 1, 1, 1, 0],
543 "cs_w64x_partial_swizzle": [508, 523, 0, 0, 528, 0, 531, 0],
544 "cs_w64x_permute": [218, 442, 435, 239, 0, 99, 239, 232],
545 "cs_w64x_readfirstlane": [140, 140, 163, 132, 100, 105, 133, 48],
546 "cs_w64x_readlane": [121, 121, 16, 97, 16, 100, 100, 121],
547 "cs_w64x_saveexec_b64": [6160, 12304, 5120, 2088, 6168, 8192, 7176, 1837171],
548 "cs_w64x_sbarrier": [605, 605, 686, 686, 3032, 3013, 3032, 3031],
549 "cs_w64x_wg128_branches": [121, 121, 343, 343, 14, 31, 19812, 22728],
550 "cs_w64x_writelane": [4660, 77, 99, 2748, 0, 0, 4660, 99],
551 "cs_wave64_ballot": [32, 16, 24, 40, 8, 48],
552 "cs_wm_bfm64": [16, 8, 8, 40],
553 "cs_wm_half_cmp": [1, 0, 1, 1],
554 "cs_wm_half_ops": [32, 16, 16, 0, 16],
555 "cs_wm_scc_rfl": [55, 48],
556 "cs_wqm_w32": [12, 1, 4, 0, 8, 15728880, 4, 32],
557 "cs_wqm_w64": [20, 4, 12, 8, 1, 0, 15728895, 20],
558 "cs_wqm_w64_half": [11, 14, 0, 1, 6, 8, 12, 2],
559}
560
561# Fixtures in CS_DUMP_WANTS that run without --require-wave64 (wave32, scalar, barrier, and DPP tests).
562CS_DUMP_NON_WAVE64: frozenset[str] = frozenset({
563 "cs_barrier_divergent",
564 "cs_barrier_early_end",
565 "cs_barrier_loop",
566 "cs_bpermute32",
567 "cs_dpp",
568 "cs_dpp8",
569 "cs_dpp_bank",
570 "cs_dpp_bound",
571 "cs_dpp_cmp",
572 "cs_dpp_cmpx",
573 "cs_dpp_fi",
574 "cs_dpp_mask",
575 "cs_dpp_ops",
576 "cs_dpp_row",
577 "cs_exec_const",
578 "cs_lds_atomics_ext",
579 "cs_lds_b64_cmpst",
580 "cs_lds_xchg64_ext",
581 "cs_mask_vgpr_exec",
582 "cs_movrelsd_2",
583 "cs_signed_zero_nan",
584 "cs_smem_soffset_imm",
585 "cs_store",
586 "cs_w32_andn2_exec",
587 "cs_w32_buffer_store_sub",
588 "cs_w32_buffer_sub16",
589 "cs_w32_cvt_f16_mods",
590 "cs_w32_exec_computed",
591 "cs_w32_fcmpswap",
592 "cs_w32_int_ext",
593 "cs_w32_lane_wrap",
594 "cs_w32_lds_subdword",
595 "cs_w32_lds_u8_d16",
596 "cs_w32_lds_wide",
597 "cs_w32_mask_imm",
598 "cs_w32_misc_ext",
599 "cs_w32_new_ops",
600 "cs_w32_partial_permute",
601 "cs_w32_partial_scmp",
602 "cs_w32_permlane_fi",
603 "cs_w32_permute",
604 "cs_w32_salu64",
605 "cs_w32_sincos",
606 "cs_w32_wrxchg2_ext",
607 "cs_w32_wrxchg2st64",
608 "cs_wqm_w32",
609})
610
611# Fixtures in CS_DUMP_WANTS whose mismatch diagnostics format output words in hex.
612CS_DUMP_HEXWORDS: frozenset[str] = frozenset({
613 "cs_lds_atomics_ext",
614 "cs_lds_b64_cmpst",
615 "cs_lds_xchg64_ext",
616 "cs_signed_zero_nan",
617 "cs_smem_soffset_imm",
618 "cs_store",
619 "cs_w32_lds_subdword",
620 "cs_w32_lds_u8_d16",
621 "cs_w32_lds_wide",
622 "cs_w32_wrxchg2_ext",
623 "cs_w32_wrxchg2st64",
624})
625
477 626
478def judge_cs_dump(rc: int, msg: str, want: list[int], *, wave64: bool, partial: bool, emulated: bool, 627def judge_cs_dump(rc: int, msg: str, want: list[int], *, wave64: bool, partial: bool, emulated: bool,
479 hexwords: bool = False) -> tuple[bool | None, str]: 628 hexwords: bool = False) -> tuple[bool | None, str]:
@@ -1276,160 +1425,18 @@ def run_suite(a, work: str) -> int:
1276 # Whole-wave mask test, as in check.py: needs a 64-wide subgroup, skipped where the device has none. 1425 # Whole-wave mask test, as in check.py: needs a 64-wide subgroup, skipped where the device has none.
1277 # With LEONIDA_W64_EMULATE=1 it was translated with --wave64-emulate and runs on any subgroup size. 1426 # With LEONIDA_W64_EMULATE=1 it was translated with --wave64-emulate and runs on any subgroup size.
1278 results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated())) 1427 results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated()))
1279 elif name in ("cs_smem_vcc_base", "cs_store", "cs_signed_zero_nan", "cs_smem_soffset_imm", "cs_w32_lane_wrap", "cs_movrelsd_2", "cs_w32_permute", "cs_w32_sincos", "cs_w32_buffer_sub16", "cs_w32_buffer_store_sub", "cs_w32_fcmpswap", "cs_w32_permlane_fi", "cs_exec_const", "cs_w32_mask_imm", "cs_w64_mask_imm", "cs_w32_lds_u8_d16", "cs_w32_lds_subdword", "cs_w32_lds_wide", "cs_w32_int_ext", "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops", "cs_wave64_ballot", "cs_wm_half_ops", "cs_wm_half_cmp", "cs_wm_bfm64", "cs_wm_scc_rfl", "cs_wqm_w64", "cs_wqm_w32", "cs_wqm_w64_half", 1428 elif name in CS_DUMP_WANTS:
1280 "cs_w32_cvt_f16_mods", "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi", 1429 want = CS_DUMP_WANTS[name]
1281 "cs_dpp_bound", "cs_dpp_cmp", "cs_dpp_cmpx", "cs_dpp_w64", 1430 # Every dump outside CS_DUMP_NON_WAVE64 is a whole-wave (wave64) test: ask for a 64-wide subgroup and
1282 "cs_w64_mask_detect", 1431 # skip, as check.py does, where the device has none (vk_compute_test exits 77). With
1283 "cs_w64x_readlane", "cs_w64x_writelane", "cs_w64x_readfirstlane", "cs_w64x_bpermute", "cs_w64x_permute", 1432 # LEONIDA_W64_EMULATE=1 they were translated with --wave64-emulate and run on any subgroup size.
1284 "cs_w64x_branch", "cs_w64x_ballot", "cs_w64x_wg128_branches", "cs_w64x_lds_raw",
1285 "cs_w64x_lds_war", "cs_w64x_partial", "cs_w64x_sbarrier", "cs_w64x_load_ballot_load",
1286 "cs_w64x_mask_reuse", "cs_w64x_mask_reuse2", "cs_w64x_chain_barrier", "cs_barrier_divergent",
1287 "cs_bpermute32", "cs_w64x_partial_scmp", "cs_w64x_partial_swizzle", "cs_w32_partial_scmp", "cs_w32_partial_permute", "cs_barrier_early_end",
1288"cs_barrier_loop", "cs_w64x_andn2_exec", "cs_w64x_saveexec_b64", "cs_w64x_cmp_sdst", "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_w32_wrxchg2_ext", "cs_w32_wrxchg2st64", "cs_w32_andn2_exec",
1289 "cs_mask_vgpr_exec", "cs_w32_exec_computed", "cs_w64_exec_computed"):
1290 cs_dump_wants = {
1291 "cs_store": [0x400080FF, 0xE00003FF, 0x3C004000, 0xEEEEEEEE, 0x40003C00, 0xBC003800, 0x40FF8000, 0x3FF00000],
1292 # base + soffset + imm (cs_smem_soffset_imm.asm); out[4..7] are seeds the shader leaves alone
1293 "cs_smem_vcc_base": CS_SMEM_VCC,
1294 "cs_smem_soffset_imm": [0x5EED0024, 0x5EED0028, 0x5EED002C, 0x5EED0030,
1295 0x5EED0010, 0x5EED0014, 0x5EED0018, 0x5EED001C],
1296 # SHADER-52: wave32 lane select & 31 (40 → 8)
1297 "cs_w32_lane_wrap": [25, 16, 777, 777],
1298 # v_movrelsd_2_b32: VGPR[D + M0[25:16]] = VGPR[S0 + M0[9:0]] (cs_movrelsd_2.asm)
1299 "cs_movrelsd_2": [11, 33, 33, 55, 1717, 77, 1515, 1717],
1300 # SHADER-90: ds_permute_b32 (cs_w32_permute.asm): scatter, unwritten lane = 0, EXEC gates the write
1301 "cs_w32_permute": [218, 29, 8, 211, 0, 15, 99, 15],
1302 # integer ops with CPU-only checks until now (cs_w32_int_ext.asm)
1303 "cs_w32_int_ext": [1, 27, 1, 0x33332222, 0xC0000000, 0x4000, 18, 0x20304050],
1304 # 64-bit scalar data ops and v_mad_u64_u32 (cs_w32_salu64.asm)
1305 # more ops with CPU-only checks until now (cs_w32_misc_ext.asm)
1306 # ops merged on 2026-11-22 with CPU-only checks (cs_w32_new_ops.asm)
1307 # plain 8/16-bit MUBUF stores, one crossing a dword (cs_w32_buffer_store_sub.asm)
1308 "cs_w32_buffer_store_sub": [0x1122AB44, 0xCDEF7788, 0x34AABBCC, 0xDDDDDD12, 0x0102035A, 0x05061234, 0xAB, 0xFFFFCDEF],
1309 # 8/16-bit MUBUF d16 loads and stores (cs_w32_buffer_sub16.asm)
1310 "cs_w32_buffer_sub16": [0xBEEF00AA, 0x00AA1234, 0xBEEFFFAA, 0xFFAA1234, 0xBEEF8899, 0x88991234, 0x1122CD44, 0xABCD7788],
1311 # ds_cmpst_f32 and buffer_atomic_fcmpswap: float compare (cs_w32_fcmpswap.asm)
1312 "cs_w32_fcmpswap": [0, 0x3F800000, 0x7FC00000, 0x3F800000, 0x80000000, 0x40400000, 0x3F800000, 0x7FC00000],
1313 "cs_w32_new_ops": [0x55, 0x8001, 0xC0000000, 0x80014000, 0x4000FFFF, 0x77, 0x99, 0x1234],
1314 "cs_w32_cvt_f16_mods": CVT_F16_MODS_WORDS,
1315 "cs_w32_misc_ext": [0x0FFF0FFF, 0xE2C4A688, 0x0007FFFF, 0x7FFF8000, 0xFFFE0002, 0xFFFF0005, 0x509, 0xCAFEF00D],
1316 "cs_w32_salu64": [0x1E6A2C48, 0x1234, 0xFFFFFFFF, 0x100, 47, 48, 0xFFFF8000, 0xFFFFFFFE],
1317 # SHADER-85: ds_read_u8/i8_d16[_hi] (cs_w32_lds_u8_d16.asm header)
1318 "cs_w32_lds_u8_d16": [0xBEEF00FF, 0x00FF1234, 0xBEEFFF80, 0xFF801234, 0xBEEF007F, 0x007F1234, 0xBEEF0080, 0xFFFF1234],
1319 # 8/16-bit and 64/96/128-bit LDS accesses (cs_w32_lds_subdword.asm / cs_w32_lds_wide.asm headers)
1320 "cs_w32_lds_subdword": [0x11B2D444, 0xA1B2C3D4, 0xFFFFFFB2, 0x000000B2, 0x00000011, 0xFFFFA1B2, 0x0000A1B2, 0xFFFFC3D4],
1321 "cs_w32_lds_wide": [0xCAFEF00D, 0xFEEDFACE, 0x600DD00D, 0x00000000, 0x8BADF00D, 0xDEADC0DE, 0x12345678, 0x9ABCDEF0],
1322 # ds_cmpst_b32 and the b64 2-address forms (cs_lds_b64_cmpst.asm header)
1323 "cs_lds_b64_cmpst": [0x11110001, 0x22220002, 0x33330003, 0x44440004,
1324 0xCCCC000C, 0x44440004, 0xBBBB000B, 0x3579BADC],
1325 # ds_wrxchg*_rtn_b64, ds_or_rtn_b64, ds_min_f32, ds_max_rtn_f32 (cs_lds_xchg64_ext.asm header)
1326 "cs_lds_xchg64_ext": [0x11110003, 0x33333333, 0xF00FF000, 0x04030201,
1327 0x40302010, 0x70500705, 0x3FC00000, 0x80000000],
1328 # ds_wrxchg2_rtn_b32's pair cases and ds_wrxchg2st64_rtn_b32
1329 # (cs_w32_wrxchg2_ext.asm / cs_w32_wrxchg2st64.asm headers)
1330 "cs_w32_wrxchg2_ext": [0x77777777, 0x88880008, 0x99990009, 0xDEADBEEF,
1331 0xAAAAAAAA, 0xBBBBBBBB, 0x12341234, 0x56785678],
1332 "cs_w32_wrxchg2st64": [0x33333333, 0x44444444, 0x55550005, 0x66660006,
1333 0xB0B00084, 0xB0B00088, 0xB0B00140, 0xB0B002C0],
1334 # ds_mskor, ds_and/xor_b64, ds_add_rtn_f32, ds_inc/dec/rsub_u32 (cs_lds_atomics_ext.asm header)
1335 "cs_lds_atomics_ext": [0xF0F11234, 0xAB34CD78, 0x12345678, 0xF0F00F0F,
1336 0xA5A55A5A, 0x00AA00AA, 0x7FB00000, 0xFE090700],
1337 # constant EXEC masks (cs_exec_const.asm): each lane takes its own bit of the constant
1338 "cs_exec_const": [16, 8, 2, 16, 0, 16],
1339 # constant lane masks: lane L takes bit L (cs_w32_mask_imm.asm / cs_w64_mask_imm.asm headers)
1340 "cs_w32_mask_imm": [2056, 20, 2, 6152, 2050, 4112, 258, 32],
1341 "cs_w64_mask_imm": [2056, 1084, 828, 2052, 319, 2104, 516, 2064],
1342 "cs_dpp": [1, 0, 3, 2, 5, 4, 7, 6],
1343 "cs_dpp_row": [0, 0, 1, 2, 3, 4, 5, 6],
1344 "cs_dpp_mask": [1, 0, 3, 2, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE],
1345 "cs_dpp8": [7, 6, 5, 4, 3, 2, 1, 0],
1346 "cs_dpp_ops": [100, 10, 11, 12, 13, 14, 15, 16],
1347 "cs_dpp_bound": [10, 10, 11, 12, 13, 14, 15, 16],
1348 "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7],
1349 "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777],
1350 "cs_dpp_cmp": [3, 2, 3, 2, 1, 0, 1, 0],
1351 "cs_dpp_cmpx": [1, 1, 0, 0, 3, 3, 2, 2],
1352 "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6],
1353 # SHADER-99: -0 and NaN survive (SignedZeroInfNanPreserve, cs_signed_zero_nan.asm); 0 in out[4..7]
1354 # without it
1355 "cs_signed_zero_nan": [0x80000000, 0x80000000, 0x80008000, 0x00008000, 1, 1, 1, 0x00007C00],
1356 "cs_wave64_ballot": [32, 16, 24, 40, 8, 48],
1357 "cs_wm_half_ops": [32, 16, 16, 0, 16],
1358 "cs_wm_half_cmp": [1, 0, 1, 1],
1359 "cs_wm_bfm64": [16, 8, 8, 40],
1360 "cs_wm_scc_rfl": [55, 48],
1361 "cs_w64_mask_detect": [48],
1362 "cs_wqm_w64": [20, 4, 12, 8, 1, 0, 15728895, 20], # cs_wqm_w64.asm / cs_wqm_w32.asm headers
1363 "cs_wqm_w32": [12, 1, 4, 0, 8, 15728880, 4, 32],
1364 "cs_wqm_w64_half": [11, 14, 0, 1, 6, 8, 12, 2],
1365 # cross-half tests (derivations in each .asm); need exact wave64 or its emulation
1366 "cs_w64x_readlane": [121, 121, 16, 97, 16, 100, 100, 121],
1367 "cs_w64x_writelane": [4660, 77, 99, 2748, 0, 0, 4660, 99],
1368 "cs_w64x_readfirstlane": [140, 140, 163, 132, 100, 105, 133, 48],
1369 "cs_w64x_bpermute": [36, 316, 253, 218, 435, 225, 0, 442],
1370 "cs_w64x_permute": [218, 442, 435, 239, 0, 99, 239, 232], # SHADER-90, cs_w64x_permute.asm
1371 "cs_w64x_branch": [0, 0, 0, 0, 5, 5, 9, 9],
1372 "cs_w64x_mask_reuse": [8, 40, 8, 40, 2, 20, 10, 64],
1373 "cs_w64x_mask_reuse2": [10, 20, 8, 8, 5, 2, 132, 131],
1374 "cs_w64x_chain_barrier": [564, 563, 500, 627],
1375 "cs_w64x_ballot": [2053, 2061, 2069, 2077, 2085, 2093, 2101, 2109],
1376 "cs_w64x_wg128_branches": [121, 121, 343, 343, 14, 31, 19812, 22728],
1377 "cs_w64x_lds_raw": [132, 137, 100, 108, 131, 101, 149, 118],
1378 "cs_w64x_lds_war": [1032, 1063, 1000, 1031, 2032, 2063, 2000, 2031],
1379 "cs_w64x_partial": [40, 40, 528, 0, 0, 532, 539, 524820],
1380 "cs_w64x_partial_scmp": [0, 1, 0, 1, 1, 1, 1, 0], # s_cmp mask, -1 in a partial wave
1381 "cs_w64x_partial_swizzle": [508, 523, 0, 0, 528, 0, 531, 0], # swizzle from a missing lane: 0
1382 "cs_w32_partial_scmp": [0, 1, 1, 0, 1, 1, 1, 1], # the same in a 20-thread wave32
1383 # ds_permute_b32 in a 20-thread wave32: a never-launched source lane sends nothing (.asm header)
1384 "cs_w32_partial_permute": [0, 29, 127, 0, 1, 0, 134, 113],
1385 "cs_w32_andn2_exec": [1, 8, 16, 2064, 2068, 3, 20, 1544], # s_andn2_saveexec/wrexec_b32 (.asm header)
1386 # SHADER-1264: a computed value written to exec_lo / exec_hi gives each lane its own bit
1387 # (cs_w32_exec_computed.asm / cs_w64_exec_computed.asm headers)
1388 "cs_w32_exec_computed": [259, 1028, 3088, 7682, 512, 4100, 0, 3],
1389 "cs_w64_exec_computed": [291, 1028, 11264, 771, 8192, 4132, 0, 3],
1390 "cs_w32_sincos": [1, 1, 1, 1, 1, 1], # SHADER-88 (cs_w32_sincos.asm): angles in turns
1391 # SHADER-74: v_permlane16/x16 FI / BOUND_CTRL with the source lane off in EXEC (cs_w32_permlane_fi.asm)
1392 "cs_w32_permlane_fi": [1000, 0, 4, 1, 1000, 0, 52, 49],
1393 "cs_w64x_sbarrier": [605, 605, 686, 686, 3032, 3013, 3032, 3031],
1394 "cs_w64x_load_ballot_load": [43, 74, 75, 42, 42, 18, 41, 32],
1395 "cs_w64x_andn2_exec": [1, 16, 32, 4144, 2052, 3, 8, 1544], # s_andn2_saveexec/wrexec_b64 (.asm header)
1396 "cs_w64x_saveexec_b64": [6160, 12304, 5120, 2088, 6168, 8192, 7176, 1837171], # .asm header
1397 "cs_w64x_cmp_sdst": [10240, 6144, 2053, 8224, 7714, 6184, 4144, 5], # .asm header
1398 "cs_bpermute32": [0, 50, 162, 99, 36, 218, 183, 15], # wave32: needs 32 lanes
1399 # SHADER-91: s_barrier sites in different wave-uniform branches meet (cs_barrier_divergent.asm)
1400 "cs_barrier_divergent": [127, 126, 125, 124, 123, 122, 121, 120],
1401 # SHADER-91: other waves end without s_barrier (cs_barrier_early_end.asm); a loop whose trip count
1402 # differs per wave (cs_barrier_loop.asm)
1403 "cs_barrier_early_end": [127, 126, 125, 124, 123, 122, 121, 120],
1404 "cs_barrier_loop": [128, 96, 64, 32, 128, 96, 64, 0xEEEEEEEE],
1405 # SHADER-21 part 2: a mask copied to a VGPR with v_mov_b32 respects EXEC —
1406 # inactive lanes keep the old VGPR (cs_mask_vgpr_exec.asm)
1407 "cs_mask_vgpr_exec": [0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
1408 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF],
1409 }
1410 want = cs_dump_wants[name]
1411 # Every dump but cs_store / cs_smem_soffset_imm / cs_w32_lane_wrap / cs_movrelsd_2 / cs_w32_permute /
1412 # cs_w32_lds_u8_d16 / cs_w32_sincos / cs_w32_int_ext / cs_w32_salu64 / cs_w32_misc_ext / cs_w32_new_ops / cs_signed_zero_nan, the wave32
1413 # cs_w32_cvt_f16_mods / cs_wqm_w32 / cs_bpermute32 and the DPP tests is a whole-wave (wave64) mask test:
1414 # ask for a 64-wide subgroup and skip,
1415 # as check.py does, where the device has none
1416 # (vk_compute_test exits 77) instead of reporting a failure. With LEONIDA_W64_EMULATE=1 they were
1417 # translated with --wave64-emulate and run on any subgroup size.
1418 # cs_w64x_partial, cs_w64x_partial_scmp and cs_w64x_partial_swizzle (40-thread groups) can't have full 1433 # cs_w64x_partial, cs_w64x_partial_scmp and cs_w64x_partial_swizzle (40-thread groups) can't have full
1419 # subgroups: they ask for size 64 without them. With LEONIDA_W64_EMULATE=1 they ask for 32, the width the 1434 # subgroups: they ask for size 64 without them. With LEONIDA_W64_EMULATE=1 they ask for 32, the width the
1420 # emulation is for, as check.py's partial_wave_test does. RADV defaults compute to 64, and there 1435 # emulation is for, as check.py's partial_wave_test does. RADV defaults compute to 64, and there
1421 # cs_w64x_partial_swizzle came out right even before its missing-lane reads were fixed; at 32 it did not. 1436 # cs_w64x_partial_swizzle came out right even before its missing-lane reads were fixed; at 32 it did not.
1422 emulated = w64_emulated() 1437 emulated = w64_emulated()
1423 partial = name in ("cs_w64x_partial", "cs_w64x_partial_scmp", "cs_w64x_partial_swizzle") 1438 partial = name in ("cs_w64x_partial", "cs_w64x_partial_scmp", "cs_w64x_partial_swizzle")
1424 wave64 = name not in ("cs_store", "cs_signed_zero_nan", "cs_smem_soffset_imm", "cs_wqm_w32", "cs_w32_lane_wrap", "cs_movrelsd_2", 1439 wave64 = name not in CS_DUMP_NON_WAVE64 and not emulated and not partial
1425 "cs_w32_permute", "cs_barrier_divergent", "cs_barrier_early_end", "cs_barrier_loop",
1426 "cs_w32_lds_u8_d16", "cs_w32_int_ext", "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops", "cs_w32_cvt_f16_mods",
1427 "cs_w32_lds_subdword", "cs_w32_lds_wide",
1428 "cs_bpermute32", "cs_w32_partial_scmp", "cs_w32_partial_permute", "cs_w32_permlane_fi", "cs_w32_sincos", "cs_w32_buffer_sub16", "cs_w32_buffer_store_sub", "cs_w32_fcmpswap",
1429 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_w32_wrxchg2_ext", "cs_w32_wrxchg2st64", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec",
1430 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8",
1431 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_dpp_cmp", "cs_dpp_cmpx", "cs_w32_andn2_exec",
1432 "cs_w32_exec_computed") and not emulated and not partial
1433 if partial: 1440 if partial:
1434 cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="32" if emulated else "64") 1441 cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="32" if emulated else "64")
1435 if name in WAVE32_LANE_DUMPS: # 32 lanes even without index.json, as check.py requests (#774) 1442 if name in WAVE32_LANE_DUMPS: # 32 lanes even without index.json, as check.py requests (#774)
@@ -1451,9 +1458,7 @@ def run_suite(a, work: str) -> int:
1451 else: 1458 else:
1452 want = judged_words(name, msg, want) # cs_signed_zero_nan on Apple and llvmpipe (check.py) 1459 want = judged_words(name, msg, want) # cs_signed_zero_nan on Apple and llvmpipe (check.py)
1453 ok, detail = judge_cs_dump(rc, msg, want, wave64=wave64, partial=partial, emulated=emulated, 1460 ok, detail = judge_cs_dump(rc, msg, want, wave64=wave64, partial=partial, emulated=emulated,
1454 hexwords=name in ("cs_store", "cs_smem_soffset_imm", "cs_w32_lds_u8_d16", 1461 hexwords=name in CS_DUMP_HEXWORDS)
1455 "cs_w32_lds_subdword", "cs_w32_lds_wide",
1456 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_w32_wrxchg2_ext", "cs_w32_wrxchg2st64", "cs_signed_zero_nan"))
1457 if ok and None in want: 1462 if ok and None in want:
1458 unjudged = ", ".join(str(i) for i, w in enumerate(want) if w is None) 1463 unjudged = ", ".join(str(i) for i, w in enumerate(want) if w is None)
1459 detail += f" (words {unjudged} not judged on this device: UNJUDGED_WORDS in check.py)" 1464 detail += f" (words {unjudged} not judged on this device: UNJUDGED_WORDS in check.py)"