Repository navigation
buffer_format_fuzz: an unknown --formats is a usage error before the GPU oracle (EGEN-BUFFMT-EXPLICIT-FIRST) - #6310
Open
evilclanker9000 wants to merge 2 commits into
Conversation
… opens A typo in --formats was found only after runner.open_oracle(): without the oracle the tool answered 'hardware oracle unavailable' (77) and never named the bad token, and with one select_formats raised SystemExit (1). It is now a usage error (2) before the oracle: select_formats raises ValueError and main reports it through ap.error.
Fails on 561b65a (77 != 2: the typo is masked by 'hardware oracle unavailable', and select_formats raises SystemExit instead of ValueError) and passes with the fix; no GPU.
Contributor
|
Tested fa88474 on Windows with CPython 3.14.7, CPU only: pass. All three tests passed with I checked each of the 77 table entries as an explicit numeric code and as a name. Both forms selected the same entry for each family argument (gfx10 and gfx11). This checks format selection only. I did not submit GPU work. AI-assisted. |
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.
What and why
tools/buffer_format_fuzz.pyparsed an explicit--formatsonly afterrunner.open_oracle(). A typo therefore never reached the user as a usage error:hardware oracle unavailable: ...and exited 77, never naming the bad token;SystemExitfromselect_formats, exit 1.An explicit
--formatsneeds no GPU to be parsed (select_formatsonly usesfamilyfor the default list), so this parses it up front:select_formatsraisesValueErrorandmainreports it throughap.error— exit 2, before any oracle work. A valid list still reaches the oracle unchanged, and the module docstring's exit-code line now says usage error as well.Task: EGEN-BUFFMT-EXPLICIT-FIRST.
Tested
New test
tests/test_buffer_format_fuzz_cli.py(CPU only, no GPU):561b65a8, tool file taken fromupstream/main, same test file):CLI, this branch:
python -m compileall -q tools/buffer_format_fuzz.py tests/test_buffer_format_fuzz_cli.pypasses.No GPU was used for this change and none is needed: the fix moves a check that never needed hardware. (The oracle on this machine reports
no AMD clang; I did not run the fuzz itself.)Notes
select_formatsexception type changed with the tool commit, so the helper test belongs with it.explicit) and reused after the oracle opens, so a valid--formatsis parsed once and the default list is still built from the family the oracle reports.tools/buffer_format_fuzz.py.AI-assisted.