Skip to content

test(semantic): add translator tests for v_pk_min_u16 - #5645

Open
slopgobblercobbler wants to merge 1 commit into
ItsNotRexed:mainfrom
slopgobblercobbler:test/semantic-valu-pk-min-u16-suite
Open

slopgobblercobbler wants to merge 1 commit into
ItsNotRexed:mainfrom
slopgobblercobbler:test/semantic-valu-pk-min-u16-suite

Conversation

@slopgobblercobbler

Copy link
Copy Markdown
Contributor

What

Adds translator-backed regression tests for v_pk_min_u16 in tests/semantic/test_valu_pk_min_u16_hw.py.

Covers:

  • Hand-written RDNA2 shader assembly translation through tools/rdna2spirv.py
  • Execution of translated SPIR-V via spirv_mini_interp
  • Reference mathematical verification across standard and edge-case inputs
  • Boundary checks, unsigned comparison (e.g. 32767 < 32768), boundary extremes (0, 0xFFFF)
  • Half-register routing via op_sel and op_sel_hi, register aliasing, and scalar SGPR operand variations

Tested

  • Tested with Python 3.9+ (python -I)
  • python -I tests/test_semantic_translator_use.py (Passes translator reachability check)
  • python -I tests/semantic/test_valu_pk_min_u16_hw.py (All tests passed, OK)
  • Standard library Python only (unittest, struct, math)
  • Clean merge against upstream/main
  • Strictly zero game data, binaries, or proprietary keys

@mrbean56

Copy link
Copy Markdown

Tested 1b4252b63e on Linux (Debian 13), Python 3.13.5: pass, mutation caught.

No GPU, no game data. AI-assisted.

@kapitche

Copy link
Copy Markdown
Contributor

Tested 1b4252b merged with main 561b65a on Linux (WSL2) with Python 3.12.16: pass

tests/semantic/test_valu_pk_min_u16_hw.py: 5 run, 5 passed, 0 failed, 0 skipped. Tests only (no tools/ change), so I did not run the full semantic suite. 5 of the 5 tests reach rdna2spirv.translate() (counted by wrapping it).

All 5 tests call rdna2spirv.translate().

Negative control (v_pk_min_u16): making the min case of the packed 16-bit integer branch use Max in tools/rdna2spirv.py gives: 8 subtest failures. File restored afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants