Repository navigation
Top 10 GTA VI Betrayals (#11 will shock you): 11 RDNA2 ops the translator refused - #1976
IAmNotSiob wants to merge 22 commits into
Conversation
…, f16 norm conversions, fma_legacy, f16 fmaak/fmamk)
|
Tested
|
|
Tested 99c2651 on NVIDIA GeForce GTX 1660 (Turing, TU116, subgroup 32..32), driver 620.73.04 (proprietary, Vulkan 1.4.357), Arch Linux (kernel 6.18): pass, no regression. Native build of runtime/ from this head (Ninja, RelWithDebInfo, clang 23.1.5), llvm-mc 23.1.5, SPIRV-Tools v2026.4.
The PR adds no GPU fixture, so the 11 ops are covered only by the semantic tests here. AI-assisted run (Claude). Synthetic programs only, no game files involved. |
…e/fract_f64, f64<->f32/i32/u32 conversions), GPU fixture cs_w32_f64_ops
…it (as ItsNotRexed#2057 does for v_add_f64)
# Conflicts: # tools/rdna2spirv.py
…ed result left by 16
|
thx @Youssefrah16 @Impre-visible :D fyi pushed 916f904: packed |
|
merged main again; main now has its own hw-verified v_cvt_norm_*_f16 (6958558), so i dropped those two from this pr and kept only the packed pknorm f16 forms. tests green ^^ |
|
Tested 3caf7a6 merged with main 98fa503 (merged tree 2a0b88dc1d) on Windows 11, RTX 4080 SUPER + Intel UHD 770 (MSVC 14.51), Python 3.13.1: pass. Rebuilt the runtime from the merged tree (C++ changed).
|
…l_f64 of 1.0000000000000002 read as 1.0; found by @kapitche)
|
Tested 68d225a on RTX 5070, driver 616.86, Windows 10.0.26200: pass. Built The translator side ( |
|
Tested 68d225a on NVIDIA GeForce RTX 3060 Ti (Ampere), driver 610.88, Vulkan 1.4.341, Windows 11 (26200): pass. Test programs built from this commit (MSVC from VS 2026 + Ninja, including its runtime changes); llvm-mc 23.1.6 (conda-forge llvm-tools); SPIRV-Tools from Vulkan SDK 1.4.357.0.
This adds Ampere to the RTX 5070 run on this head. No game files. AI-assisted (Claude Code). |
|
Tested Worktree at the PR head, runtime built with Commands and results: The 47 skips are the usual device-dependent ones on a 32-lane-subgroup RTX 50 part (64-wide wave64/fragment-subgroup cases and the package/SDL-gated entries). Synthetic fixtures only, no game files. |
illusionart453-max
left a comment
There was a problem hiding this comment.
Independent review of the subgroup CMake fix only, commit 99c26513 carried by current head 68d225ad. Applied that unchanged commit to my local main 3faac557 + open-PR integration tree; I am not claiming a review of the other translator/DXGI changes in this PR.
Windows 11 build 26200, MSVC 19.44, Visual Studio generator, RelWithDebInfo; native AMDGPU llvm-mc 23.1.6 and SDK 1.4.363.0 tools configured by absolute CMake paths, spirv-as/spirv-val absent from PATH:
- Without the fix:
d3d12_subgroup_testfails inrdna2spirv.assemble_spirvwithFileNotFoundErrorfor spirv-as. The sibling M1.5/M2/M3/M4/buffer-UAV targets build in the same setup. - With your unchanged CMake hunk: forced regeneration of all four subgroup shader variants succeeds; each translates and passes spirv-val without adding the SDK to the caller's PATH.
- With SPIR-V tools unavailable at configure time: the subgroup target is omitted with the documented dependency message. Restoring the configured tool paths registers it again. This verifies the added tool guard as well as the environment forwarding.
ctest -R '^d3d12_subgroup$'passes on RTX 5060 / NVIDIA 610.88 with Khronos validation and synchronization validation enabled. The seven other newly available translated-shader checks also pass in this local tree.
No new competing PR from me: this exact fix is already yours. For integration with #3279, retain both this LEONIDA_SPIRV_TOOLS environment entry and its LEONIDA_PC_TAIL_UBO entry in the shader-generation command.
AI-assisted (Codex). Synthetic inputs only; no game files.
|
Independent hardware review of
Synthetic fixtures only; C++ runtime changes ( AI-assisted (Gemini 4 Neon). |
|
merged main again: main now has its own hw-verified v_ldexp_f64 (bit-exact, integer-only) and v_cvt_f64_i32/u32, so i dropped those from this pr; the -floor(-x) ceil fix still applies on main's rounding block. f64 tests green ^^ |
|
Found with a local f64 differential fuzzer (tools/f64_diff.py from #4536 plus extra references on a local branch, not published): a 32-bit literal operand of v_min_f64 / v_max_f64 (and v_mul_f64 / v_fma_f64 in directed probes) is read as the low half of the f64 instead of the high half. Example: Tested at 68d225a (head alone): 19/27 mismatches on CPU seeds 1/2 and 19 on GPU seed 1 ( Cause: AI-assisted (OpenBot team). |
…2_f64 is the high half (found by @iurysf); test_valu_cvt_int_f64 runs the conversions instead of pinning them Unsupported
|
Tested on NVIDIA GeForce RTX 5080, driver 621.24, Windows 11 (10.0.26200), Vulkan device API 1.4.357: pass Checked out PR head
| |
|
Tested
|
|
Two bits from my closed duplicate #6229 (commit DeSunShine/Leonida@4afd70682) that this PR doesn't have, in case they're useful here:
Happy to send either as a follow-up PR on top of this one once it lands. AI-assisted (Claude Code). |
|
Tested 2404f9d on NVIDIA RTX 4070 SUPER (driver 616.92), Windows 11 26200, MSVC 14.44, Vulkan SDK 1.4.363, RelWithDebInfo: pass, no regression against main 561b65a.
|
# Conflicts: # runtime/test/shaders/check.py # scripts/run_gpu_tests.py
|
Measured since my note above: on an RTX 4090 (NVIDIA 621.24, Windows) a binary64 |
|
Tested
AI-assisted (Claude Code). |
claimed in #1745.
tools/isa_coverage.pylists 246 RDNA2 instructions with no translator rule. these 11 are the ones that are plain ALU, stillUnsupportedon main (checked by translating each), and not in an open PR (thev_dot*ones are #1808's).the list
v_add_nc_i16minemain now has it (#2029), so this PR uses main's and keeps only the testv_sub_nc_i16v_sat_pk_u8_i16v_cvt_norm_i16_f16v_cvt_pknorm_i16_f32(clamp, ×32767, round to nearest even, NaN -> 0), low half, op_sel keptv_cvt_norm_u16_f16v_cvt_pknorm_i16_f16v_cvt_pknorm_u16_f16v_fma_legacy_f32v_mad_legacy_f32but with no flush and one roundingv_fmac_legacy_f32v_fmaak_f16S0*S1 + K, through the existing single-roundedv_fma_f16pathv_fmamk_f16S0*K + S1, same. print order matchesv_fma_f32's fmaak/fmamk handlingclamp/omod on the norm conversions and op_sel destination on the clamped i16 add/sub are refused, not guessed, as the neighbouring ops do.
tested
tests/semantic/test_top10_betrayals.py(new): every op against a plain-Python reference over edge values (±0, ±1, ±inf, NaN, 0x7fff/0x8000 overflow, an f16 denormal, fma cancellations). all OK, and each fails on main withUnsupportedtests/semanticfull suite: OKisa_coverage.pywith AMD's RDNA2 XML: handled-exact 476 -> 487, unknown 246 -> 235no GPU run (none of these touch the runtime). no game files.
TL;DR: 11 RDNA2 instructions the shader translator used to refuse now translate, each checked against a reference, so ISA coverage goes up 11. the title is clickbait, the code isn't. AI-assisted (Claude Code).
also in here (draft: collecting more wins before review)
d3d12_subgroup_testnever built without the Vulkan SDK on PATH. its shader-generation step was the only one not givenLEONIDA_SPIRV_TOOLS, sobuild.py'sspirv-ascall failed and stopped ninja. it now gets the tools path like the M1.5–M5 blocks, and is gated onspirv-as/spirv-vallike them. Windows 10 VM + RTX 6000 Ada:d3d12_subgroupbuilds and passes, fullctest116/116.DXGI
GetFullscreenStatenow reports whatSetFullscreenStateset (M7, alt-tab). measured on host DXGI (Win10 22H2, flip-discard):SetFullscreenState(TRUE)->GetFullscreenStateTRUE,FALSE-> FALSE; the layer always said FALSE. same probe: a minimised flip-model window still getsS_OKfromPresent(notDXGI_STATUS_OCCLUDED), so that part already matched and is left alone.dxgi_swapchain_testgets the round-trip and passes in a desktop session.15 f64 instructions (more of the isa_coverage unknown list;
v_mul_f64/v_fma_f64are the ones #503's review noted were missing):v_mul_f64,v_fma_f64,v_min_f64,v_max_f64,v_ldexp_f64,v_floor_f64,v_ceil_f64,v_trunc_f64,v_rndne_f64,v_fract_f64,v_cvt_f64_f32,v_cvt_f64_i32,v_cvt_f64_u32,v_cvt_i32_f64,v_cvt_u32_f64. same conventions as their f32 siblings andv_add_f64: f64 -> int truncates and saturates with NaN -> 0,fractkeeps results below 1.0, clamp/omod throughclamp_mods_f64; refused (not guessed) under a non-default MODE rounding.ldexpinto a denormal) on NVIDIA RTX 6000 Ada (615.71, Linux), all bit-exact against an exact-arithmetic Python reference (integral results keep the operand's sign:ceil(-0.75)is -0)cs_w32_f64_ops(8 words: fma, ldexp to the smallest denormal, both saturating conversions, ceil's -0, fract's below-one clamp), registered incheck.pyandrun_gpu_tests.py: PASSrun_gpu_tests.pyfull run: the same 12 failures as on main with the same (older) harness build, none new;pytest tests/test_shader_checks.py tests/test_run_gpu_tests.py92 passedisa_coverage on this branch (merged with current main): handled-exact 510, unknown 212 (476 and 246 on the main this PR started from).
self-review before undrafting
v_add_f64's literal handling, which fix(shader): place f64 literal words in the upper half (SHADER-366) #2057 shows is wrong (a 32-bit literal is the upper half of an f64). the new ops now take the samef64_literalbranch fix(shader): place f64 literal words in the upper half (SHADER-366) #2057 adds, so it does nothing until fix(shader): place f64 literal words in the upper half (SHADER-366) #2057 lands and is right after, and fix(shader): place f64 literal words in the upper half (SHADER-366) #2057 doesn't need to touch thesetests/semanticOK,tests/test_f64_*.pyOK, mergeableTL;DR: 26 RDNA2 instructions the translator refused now translate (11 integer/f16 checked on the CPU, 15 f64 checked bit-exact on a GPU, with a new GPU fixture). also a build fix that makes
d3d12_subgroup_testactually build without the SDK on PATH, andGetFullscreenStatenow matching host DXGI. ISA coverage 476 -> 510. AI-assisted (Claude Code).