Repository navigation
tests/semantic: restore test_int_to_float.py, the int-to-float translator test - #4114
slint6614-dev wants to merge 1 commit into
Conversation
…ator test 9a2db92 added tests/semantic/test_int_to_float.py as a translator test: v_cvt_f32_i32, v_cvt_f32_u32 and v_cvt_f32_ubyte0..3 translated, run in spirv_mini_interp and compared with a float32 reference, with negative controls on the emitted SPIR-V. 791c9e5, 3fff9fd and 514cbff then overwrote it with checks of Python's own float()/struct conversions that import nothing from the repository, and the file went into DEBT in tests/test_semantic_translator_use.py. Bring back 9a2db92's file unchanged (5/5 pass on main) and drop it from DEBT. With v_cvt_f32_i32 converted as unsigned, v_cvt_f32_u32 as signed, or v_cvt_f32_ubyteN reading the wrong byte, the restored file fails; the current one passes all three. Co-Authored-By: Ritolino <230431388+Ritolino@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013nWg6BssUf8MjNaKuMSkfc
Kam471
left a comment
There was a problem hiding this comment.
Ran this at bb4320ed on Windows 11:
python tests/semantic/test_int_to_float.py-> 5 tests, OK; the file importsrdna2spirvandspirv_mini_interp, translates eachv_cvt_f32_i32/u32/ubyte0..3listing, runs it, and has in-memory SPIR-V sabotage controls.python -I tests/test_semantic_translator_use.py-> 3 tests, OK, with the file no longer inDEBT.compileallandgit diff --checkclean.
This is the correct resolution of #4083: rather than deleting the overwritten file, it restores the translator-driven test that was there before the model-only commits. No blocking issue.
|
Tested at the head on Windows 11 / Python 3.13.0: 5/5 new tests, the guard 3 OK, line endings 3 OK, Importantly, this is not a pure oracle: it imports #4108 still open and touches the same Approve. AI-assisted review, no game files, no GPU. |
Claimed in the coordination issue as: new TEST item, #3918 (comment). This replaces my #4083: I had proposed deleting the file there, before I found it was an overwritten translator test.
Depends on: #4108 (conflict only: both remove adjacent lines from
DEBTintests/test_semantic_translator_use.py; whichever lands second needs a one-line rebase, which I will do).What and why
@Ritolino added
tests/semantic/test_int_to_float.pyin 9a2db92 as a translator test. It translatesv_cvt_f32_i32,v_cvt_f32_u32andv_cvt_f32_ubyte0..3, runs them inspirv_mini_interp, and compares the result with a float32 reference, with negative controls on the emitted SPIR-V. Three later commits (791c9e5, 3fff9fd, 514cbff) overwrote it with checks of Python's ownfloat()/structconversions that import nothing from the repository, and the file went intoDEBTintests/test_semantic_translator_use.py.This brings back 9a2db92's file unchanged (
git diff 9a2db924 -- tests/semantic/test_int_to_float.pyis empty) and removes it fromDEBT. Same pattern as #4108 (test_alu_u16_clamp.py).Tested
Linux (WSL2), CPython 3.14.4, CPU only, no GPU, no game files, at
aa2988cc:python -m unittest discover -s tests/semantic -p test_int_to_float.py: 5/5 pass on today'smain.python -I tests/test_semantic_translator_use.py: pass.python -I tests/test_text_write_line_endings.py: pass.git diff --check: clean.Mutation check in
tools/rdna2spirv.py:mainmainv_cvt_f32_i32converted as unsignedtest_alu_vop3_mods_hw,test_f32_fuzz,test_values,test_translatev_cvt_f32_u32converted as signedtest_f32_fuzz,test_values,test_translatev_cvt_f32_ubyteNreads byte N-1test_f32_fuzzonlyChecklist
docs/design.md, with how it was confirmed. (No new rule: test-only.)AI-assisted (Claude Code).
🤖 Generated with Claude Code
https://claude.ai/code/session_013nWg6BssUf8MjNaKuMSkfc