Repository navigation
f64_diff: match single-thread --oracle hw exec_lo and zero output VGPRs - #6403
Open
Alpaca-exe wants to merge 1 commit into
Open
Alpaca-exe wants to merge 1 commit into
Alpaca-exe wants to merge 1 commit into
Conversation
Contributor
|
Overlap note: the EXEC half of this fix is already in #4536 (open, FUZZ-55, The two PRs conflict in 3 hunks: Checked with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
lucas-lachaud's finding in #6214 (claim).Problem
tools/f64_diff.pyruns--oracle hwas a single-threadhw_oracle.asm.Kernel(..., threads=1)where hardwareexec_lostarts at1, whileref_program()initializedactive = M32(0xffffffff, 32 lanes). Onv_cmpx_*_f64andv_cmpx_class_f64, every matching case therefore produced0xffffffffin the reference vs1on AMD hardware (exec_lo & M32 == 1).In addition,
hw_kernel()did not zerov8..v11before executing the test body, whereasref_program()initializes VGPRs to0on read. Duringshrink(), reducing down to[]stored uninitializedv8..v11on hardware instead of[0, 0, 0, 0], lettingshrink()collapse a falsev_cmpx_*mismatch to an empty minimal program.Fix
tools/f64_diff.py:init_exec=M32toref_program()so--oracle hwpassesinit_exec=1(threads=1) while 32-lane translator/Vulkan runs keepM32.v_mov_b32 v{8..11}, 0inhw_kernel()so uninitialized output VGPRs matchref_program()and empty shrink trials return zero.tests/test_f64_diff.py:init_exec = fd.M32 if kernel.threads >= 32 else (1 << kernel.threads) - 1inFakeHW.run()so the fake hardware oracle matchesthreads=1.test_hw_oracle_v_cmpx_matches_single_thread_exec_maskandtest_hw_kernel_zeroes_output_vgprs_and_shrink_stays_nonempty.Verification (Windows 11, Python 3.11)
python -m compileall -q tools/f64_diff.py tests/test_f64_diff.py: exit0python -I tools/f64_diff.py --self-test:10/10reference invariants + planted mismatch OKpython -I tests/test_f64_diff.py -v:31/31tests OK (FakeHWmocked oracle for--oracle hw; not run on a physicalhw_oracle_drmLinux launcher)python -I scripts/check_no_game_data.py: exit0python -I tests/test_text_write_line_endings.py:3OKpython -I tests/test_tool_startup.py:2OKpython -I tests/test_tool_stdout_encoding.py:4OKgit diff --check: cleanAI-assisted; no game data.