Repository navigation
Conversation
… and wave32 vcc_hi masks
|
Verified on Windows 11 x64 (Python 3.14.0rc2, CPU-only; pure synthetic fixtures, zero game data). Head verificationOn HEAD (
Negative control (discrimination check)Checking out
Repository hygiene
LGTM! |
|
Verified commit AI-assisted verification. |
|
Tested 47494e7 on Arch Linux, Python 3. pesticide: SKIPPED |
|
Correction to my previous comment on this PR, which was garbled — please disregard it. Real result: Tested 47494e7 on Arch Linux, Python 3.14.10, CPU only: pass. New tests/semantic/test_vcmp_dst_wave32_vcchi.py 7/7 OK + test_lane_masks 38/38 OK (via discover runner; the file needs the tests/semantic path). Negative control: base translator errors on all 7 new subtests; restored, green again. No game files. AI-assisted. |
|
Independent run of the CPU side of
Negative control: restoring Not run: the Vulkan part. I have an RTX 4080 SUPER (NVIDIA 620.73.04, so AI-assisted. |
tupacfan04
left a comment
There was a problem hiding this comment.
Two real defects remain.
- A valid wave32
vcc_hibitwise mask is still treated as data.tools/rdna2spirv.py:5579-5580_mask_b32_dst_halfreturns a mask destination only forexec_lo,vcc_lo,execandvccin wave32;vcc_hiis missing, sosop2_b32_srcs(:5620-5624) falls back to rawsrc_uand_store_b32_mask_dst(:5604-5611) stores the raw constant word instead of a per-lane 0/~0 mask.tools/lane_masks.py:233-251likewise has only awave64dst_t == "vcc_hi"branch (:247), so wave32 dropsvcc_hifrom the mask state. Withvcc_lo = 0x00100000(lane 20) ands_and_b32 vcc_hi, vcc_lo, 0xFFFF, hardware gives a zero mask, but the raw0xFFFFmakesmask_src(:5991-5994,_scalar_word_lane_bit) inspect bit20 & 31 = 4and enable lane 20.v_cndmask_b32_e64,s_bcnt1_i32_b32andv_mbcnt_lo_u32_b32then read the wrong mask. Includevcc_hiin the wave32 mask destination and havelane_masks.stepputMASKfor it.
Test gap: tests/test_lane_masks.py:341-350 lists the wave32 producers but no s_and_b32/s_or_b32/s_cselect_b32 into vcc_hi; tests/semantic/test_vcmp_dst_wave32_vcchi.py:273-320 has no bitwise producer and its vcc_lo is lane 7 only, hiding the high-lane raw-word bug. Add a s_and_b32 vcc_hi, vcc_lo, 0xFFFF case with a lane ≥ 16 (or a unit assertion that vcc_hi is MASK).
exec_hicompare SDSTs are accepted by ordinary compares but rejected bycmp_class_f64.Gen.mask_dstnow accepts wave64exec_hiviaexec_half_write(:6098-6101), but the only validatorGen.is_mask_dst(:6087-6096) excludesexec_hiand is used only bycmp_class_f64(:4367).write_compare_result(:1852),cmp_classf32/f16 (:4348) and the 64-bit ordered/equality paths (:8244,:9033) callmask_dstwithout it, sov_cmp_lt_f32/f64,v_cmp_eq_u64andv_cmp_class_f32withexec_hitranslate, whilev_cmp_class_f64raises. The negative test only covers class_f64 (tests/semantic/test_vcmp_dst_wave32_vcchi.py:471-486, line 480). The docs (docs/design.md:497) list null,exec_lo/execand wave32vcc_hi, notexec_hi; ifexec_hiis invalid, the ordinary paths are wrong; if valid, the class_f64 test is wrong. Make one rule apply to all compare/class families and test the ordinary ones;v_cmp_class_f32/f16 are untested.
Synthetic only; no game files. AI-assisted (OpenCode).
|
Tested 47494e7 on Windows 11, Python 3.14.4, no GPU or LLVM: pass. |
|
Local integration test of #8448 at 47494e7 together with #6446 at fb40ed3, on top of the same #7529 library extraction. The two semantic fixtures passed (7 cases each). Across the full library, all 2,492 translated modules passed spirv-val, up from 1,773. The combined result covers 492 of 524 distinct compute lookups missing in the original boot run, up from 429. On the same Wine 11.22 runtime and RTX 5070 Ti (NVIDIA 620.73.04), comparing the first 1,000 successful PresentX calls, distinct FSPX compute misses dropped from 36 to 8. There were still 4 CreatePipelineState failures and the presenter remained hidden. The counts describe the combined integration, so they cannot be attributed to either PR individually. AI-assisted verification. No game files, shaders, identifiers or traces attached. |
|
Independent check of the exact translator changes from 47494e7 (applied on top of e5658e4) on Windows build 26300, RTX 2060 driver 616.64, SPIRV-Tools 2026.4. All seven new semantic tests and the lane_masks suite passed. I also dispatched three synthetic compute modules on Vulkan with validation enabled: wave32 vcc_hi compare/consume while keeping vcc_lo distinct and discarding a null compare (32/32 expected lane results), wave32 exec_lo compare (32/32, lanes after 12 untouched), and emulated wave64 exec compare (64/64, lanes after 32 untouched). The unmodified base refused all three at v_cmp destination. No validation errors in the GPU runs. I retested the 2,128 graphics-library programs rejected by the baseline VS/PS offline pass, same disassembly and flags. None translated after this change. At aggregate level the former 161 v_cmp destination and 83 mask destination refusals are now 244 mask destination refusals. All four output parts were empty; the merge guard correctly declined to publish an empty index. This was a targeted retry of previous failures, so it gives no regression count for previously successful modules or boot coverage. AI-assisted. Counts and synthetic cases only. |
Validated against the real retail compute corpusApplied this PR's translator change (
+633 programs, every one also passing The PR clears both first-blocker classes it targets — Your own tests pass: Env: Windows 11 x64, Python 3.12.10, SPIRV-Tools v2026.4. GPU: none available — translate + |
|
Corpus check of #8448 (head 47494e7) together with #6446 (head fb40ed3), CPU only, Debian 13 (kernel 6.12.115), LLVM 23.1.6, SPIRV-Tools 2025.5. Both PRs merged onto ladder-frame a1751a9; the pipeline library's compute programs (2,684,
0 of the previously translated programs were lost. The +719 is the two PRs together; I did not measure each alone, but the "v_cmp destination" and "mask destination" rows are this PR's refusal classes. The rest of the newly reachable refusals (s_load_dwordx4 operands sgpr vcc 73, ds_append 29, s_bitreplicate_b64_b32 on a lane mask 26, ...) are unchanged by either. #8448's own unit test (test_vcmp_dst_wave32_vcchi, 7 tests) and #6446's (test_cs_tg_size) pass on this stack. Retail boot use: of 31 compute programs the title asked for and did not find, 24 are found with the new set; AI-assisted: yes |
Claimed on #8186: #8186 (comment)
Problem
v_cmp_*_e64andv_cmp_class_f64_e64rejectednull,exec/exec_lo, and wave32vcc_hiSDSTs:On RDNA2 (
gfx1013),llvm-mcacceptsnull(0x7d),exec_lo(wave32,0x7e) /exec(wave64,0x7e), and wave32vcc_hi(0x6b) as scalar destinations on VOPC/VOP3 compare and class instructions. While 64-bit integer compares (v_cmp_*_u64/i64) andv_cmp_class_f32/f16already delegated their destinations toGen.mask_dst,Gen.compare(f64branch),Gen.write_compare_result(f32,f16,u16,i16,u32,i32, and constantf/t/tru64-bit compares), andGen.cmp_class_f64only acceptedvcc/vcc_loandsgpr, raisingUnsupportedonnull,exec/exec_lo, and wave32vcc_hi.vcc_hiwas not tracked or lowered as an independent 32-bit scalar/mask register:In wave32 (
not wave64),vcc_loisVCC[31:0](%vcc) andvcc_hi(0x6b) is an independent 32-bit scalar/mask register (%vcc_hi). Previously:tools/lane_masks.py(kind,put,step) always treatedvcc_hias the upper half ofstate["vcc"], so writing plain scalar data tovcc_hiin wave32 clearedstate["vcc"](vcc_lo), and writing a mask tovcc_hioverwrotestate["vcc"]instead of tracking"vcc_hi".Gen.mask_dstrejectedvcc_hiin wave32 withUnsupported("mask destination").Gen.holds_lane_maskreturnedFalseforvcc_hiin wave32,Gen.mask_halfreturned"hi"forvcc_hiin wave32, andGen.mask_srcunconditionally emittedOpLoad %uint %vcc(vcc_lo) when readingvcc_hias a mask operand (v_cndmask_b32_e64,v_add_co_ci_u32_e64,s_bcnt1_i32_b32, etc.).Fix
tools/lane_masks.py:wave64=Truethroughkind()andput()fromstep(). Whennot wave64, trackvcc_hiunder its own"vcc_hi"key andvcc_lounder"vcc", while keeping existing wave64 half-VCC behavior unchanged.tools/rdna2spirv.py:Gen.compare(f64branch),Gen.write_compare_result,Gen.cmp_class,Gen.cmp_class_f64(validated viaGen.is_mask_dst), and 64-bit integer compare destinations throughGen.mask_dst.Gen.mask_dst: acceptvcc_hiwhennot self.wave64(OpStore %vcc_hi), and useself.exec_half_writeifself.wave64andd["t"] in ("exec_lo", "exec_hi"). Malformed VGPR/immediate destinations and wave64vcc_hicompare destinations continue to raiseUnsupported.Gen.holds_lane_mask,Gen.mask_half(Nonewhennot self.wave64),Gen.wave_mask,Gen.wqm, andGen.mask_src(sharingGen._scalar_word_lane_bit): load%vcc_hidirectly when wave32vcc_hiholds a tracked lane mask, and extract bitlane & 31when%vcc_hiholds plain scalar data.docs/design.md:SDST(null,exec/exec_lo) and wave32vcc_hilane masks" with confirmation methods and scope.tests/test_lane_masks.py&tests/semantic/test_vcmp_dst_wave32_vcchi.py:test_lane_masks.py(test_wave32_vcc_hi_isolation) covering wave32vcc_hi/vcc_loisolation, mask producers (v_cmp,v_add_co_u32,v_mad_u64_u32,s_and_saveexec_b32,s_wqm_b32), CFG joins, and wave64 preservation.spirv_mini_interp,spirv_wave_interp) andspirv-val --target-env vulkan1.2tests intests/semantic/test_vcmp_dst_wave32_vcchi.pyacross 12 compare/class families (nullandexec_lo/execin wave32, wave64 native, and--wave64-emulate), 9 wave32vcc_himask producers + consumers, plain-datavcc_hireads, and negative controls.Verification
Tested on Windows 11, Python 3.14.6 (
python -I), LLVMllvm-mc21.1.8, Vulkan SDKspirv-as/spirv-val(Vulkan 1.2), andruntime/build/vk_compute_test.exeon AMD Radeon(TM) Graphics (gfx1036, driver32.0.21045.29003) and AMD Radeon RX 9070 XT (driver32.0.32029.2010). No game files used.python -m compileall -q make_game.py tools tests— pass (exit 0)python -I tests/test_lane_masks.py— pass (ok)python -I tests/test_semantic_translator_use.py— pass (3/3)python -I tests/test_design_contract_rows.py— pass (4/4)python -I tests/test_runner_calls_all_tests.py— pass (3/3)python -I tests/semantic/test_vcmp_dst_wave32_vcchi.py -v— pass (7/7)python -I tests/semantic/test_wave64_vcc_half_write.py— pass (7/7)python -I tests/semantic/test_cmp_class_f64.py— pass (6/6)python -I tests/semantic/test_carry_exec_mask.py— pass (9/9)python -I tests/semantic/test_salu_b32_lane_masks.py— pass (8/8)python -I tools/cf_diff.py --programs 20— 40 pass, 0 mismatchpython -I tools/salu_diff.py --programs 20— 20 pass, 0 mismatchpython -I scripts/check_no_game_data.py --diff main— pass (exit 0)python -I scripts/run_semantic_tests.py tests/semantic— 445/448 files passed (5,963 tests total); the 3 failing files (test_image_atomics_guard,test_image_cube_store_glc,test_image_store_d16) fail identically on unmodifiedmain(dde82f27e).vk_compute_test.exeonAMD Radeon(TM) Graphicsgfx1036andAMD Radeon RX 9070 XT): wave32 (vcc_hicompare/mask/data +null+exec_lo) and wave64 (native--require-wave64and--wave64-emulatef64/class_f64null+exec) all passed with 0 mismatches.AI-assisted.