Skip to content

test(semantic): add semantic interpreter tests for ds_dec_src2_f64 - #3762

Closed
slopgobblercobbler wants to merge 8 commits into
ItsNotRexed:mainfrom
slopgobblercobbler:test/semantic-lds-dec-src2-f64
Closed

slopgobblercobbler wants to merge 8 commits into
ItsNotRexed:mainfrom
slopgobblercobbler:test/semantic-lds-dec-src2-f64

Conversation

@slopgobblercobbler

Copy link
Copy Markdown
Contributor

What

Adds reference oracle and semantic interpreter tests for ds_dec_src2_f64 in tests/semantic/test_lds_dec_src2_f64.py.

  • Architectural reference model and bitfield verification
  • SIMD multi-lane divergence under Wave32 / Wave64 EXEC masking
  • IEEE 754 float boundaries, subnormals, and signed zeros
  • Negative rejection and syntax validation

Tested

  • Tested with Python 3.9+ (python -I)
  • python -m compileall -q tests (Passed)
  • python -I tests/semantic/test_lds_dec_src2_f64.py (Passed)
  • Standard library only (unittest, struct, math), strictly zero game data

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as #3759, plus the encoding caveat in TEST-738: ds_dec_src2_f64 is a ds_*_src2_* form that exists on GFX10.1 but not on the console's gfx1013/gfx103x set, and it has no handling in tools/rdna2spirv.py on f847748c. The file imports neither rdna2spirv nor spirv_mini_interp, so it tests a local model of an unhandled, encoding-specific instruction. Please check the encoding against gfx1013 first (see #3574/TEST-738), then make it a translator test or drop it; see #3759.

@tupacfan04

Copy link
Copy Markdown
Contributor

This file never runs the translator, and the instruction it describes is not implemented there.

  • Zero occurrences of rdna2spirv, support, subprocess or open(; imports are math, struct, unittest, typing only. ref_ds_dec_src2_f64 / LDSModel64.atomic_dec_src2_f64 reimplement the rule in Python.
  • support.translate_lines(..., ['ds_dec_src2_f64 ...']) raises Unsupported: ds_dec_src2_f64, and grep finds no other mention of the mnemonic in tools/, docs/ or tests/.
  • Mutation: baseline 40 tests OK. Making Gen.lds_op emit a wrong constant for ds_dec_src2_f64 still passes 40; replacing translate()'s body with raise RuntimeError(...) still passes 40. The file cannot notice a translator regression.
  • The "mutant" cases compare against a locally defined mutant_dec, not the translator.
  • PR tests: a semantic test must reach tools/rdna2spirv.py #2992's guard flags it at line 1: "imports no rdna2spirv and no helper that does".

Suggested shape: implement ds_dec_src2_f64 in tools/rdna2spirv.py with a docs/design.md row (and how it was confirmed), then assert through support.translate_fixture/translate_lines + spirv_mini_interp, the way tests/semantic/test_buffer_atomics_x2.py does. Until the opcode exists there is nothing for this file to regress.

AI-assisted review, no game files, no GPU.

@ItsNotRexed

Copy link
Copy Markdown
Owner

Closing: the tests never exercise the translator (they model the instruction in Python without calling tools/rdna2spirv.py), so tests/test_semantic_translator_use.py rejects them. Please translate a listing through support.translate_* and check its result instead.

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.

4 participants