mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:20:53 +01:00
[PR #1653] sdwa_diff: guard asm.family() oracle leak, validate oracle/CLI/reference inputs, and restore KNOWN #1666
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1666
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1653
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/sdwa-diff-oracle-cli-and-ref📝 Commits (1)
1d155fesdwa_diff: handle unknown hw arch without oracle leak, validate oracle results/CLI/ref, and restore KNOWN📊 Changes
2 files changed (+163 additions, -8 deletions)
View changed files
📝
tests/test_sdwa_diff.py(+107 -0)📝
tools/sdwa_diff.py(+56 -8)📄 Description
Item ID:
SDWA-DIFF-ORACLE-CLI-AND-REFClaim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7155622653
Summary
tools/sdwa_diff.py): catchValueErrorfromasm.family(oracle.arch)(e.g.gfx900or unsupported arch strings), closeoracle, printhardware oracle unavailable: ..., and return exit77instead of crashing and leaking the oracle handle.KNOWNinmain()'sfinallyblock (and handle--list-ops/--self-testbefore mutating it) so in-process calls do not permanently leakKNOWN = True.oracle is not None, exact result-list length inhw_prepare(), and 4-word tuples/lists in_diff()(turning short/malformed oracle or shrink responses into cleanRuntimeError-> exit2instead ofAttributeError/IndexError). Catch transientSkipduring the final shrunk recheck and fall back to the original failure detail.--hw-arch,--build, and--work.RefErroron unknown SDWA selectors (src*_sel/dst_sel), unknowndst_unusedmodes (previously fell through silently toUNUSED_PAD), wrong operand counts, non-VGPR destinations, and unparseable operands.tests/test_sdwa_diff.py): add 5 regression tests covering all of the above.Verification
python3 -W error -I tests/test_sdwa_diff.py -v: 27 passed, 0 failed (2.469s).main: ran=27, failures=4, errors=6.python3 -m compileall -q tools/sdwa_diff.py tests/test_sdwa_diff.py,python3 -I tests/test_text_write_line_endings.py,python3 -I scripts/check_no_game_data.py: all pass.AI-assisted: yes
GPUs tested: none (CPU unit tests with stubbed hardware oracle and
spirv_mini_interp; no game data)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.