Skip to content

Linux: the emulator tests build and pass again (#277) - #279

Merged
phantoslayer21 merged 5 commits into
phantoslayer21:mainfrom
j0nsh1n:fix/linux-emulator-tests
Nov 20, 2026
Merged

phantoslayer21 merged 5 commits into
phantoslayer21:mainfrom
j0nsh1n:fix/linux-emulator-tests

Conversation

@j0nsh1n

@j0nsh1n j0nsh1n commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Fixes the Linux-only test failures of #277 (the open questions in #278 are not touched). Five small commits, each one fix:

  • swin.hip builds for the host lane emulator again: wg_uniform instead of __builtin_amdgcn_readfirstlane (the same builtin on the GPU), and the "+s" asm guarded with #ifndef WG_EMU. The 49 gfx1201 code objects built with ROCm 10.1 are byte-identical before and after; no HLSL or shader header changes.
  • test_model_wgcm links the converter sources it needs (lz4block.cpp, convert5.cpp, ops5.cpp, api.cpp).
  • check_no_dev_diagnostics.py reads the packager's backslash paths on Linux too (Windows unchanged).
  • test_post_emu compares post_filter_quality9 with its own reference.
  • FP16 output expectations clip to +-65504 before the cast, as the kernels' saturating RGBA16F store does (test_runtime, test_runtime_external, the post emulator tests).

Tested on Linux (Fedora 44 with clang 22, and Ubuntu 24.04 with clang 18): test_post_emu, test_model_wgcm, test_dev_diagnostics_off and the post emulator tests pass; test_runtime goes from 8 to 6 failures, test_runtime_external keeps 2, both left for #278. CI's Python jobs run on Windows, where these tests skip, so CI cannot show the change; a Linux shard would.

Checklist

swin.hip:486 called __builtin_amdgcn_readfirstlane directly and :504 used the AMDGCN-only "+s" asm constraint, so the host emulator build (WG_EMU) failed with every compiler. Use wg_uniform (the same builtin on the GPU) and guard the asm with #ifndef WG_EMU. gfx1201 code objects are byte-identical before and after.

Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
CONV_SOURCES missed lz4block.cpp, convert5.cpp, ops5.cpp and api.cpp, so the converter link failed on Linux.

Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
…x too

check_no_dev_diagnostics.py used os.path.basename on the packager's Windows-style paths, so dx12\manifest.json was never checked on Linux. Windows behaviour is unchanged.

Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
The quality9 (Lanczos-3) filter was compared with the default filter's reference.

Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
The kernels store RGBA16F output saturated to +-65504 on purpose (post.hip); the tests expected the infinity of a plain astype(np.float16). Clip the f32 reference before the FP16 conversion in test_runtime, test_runtime_external and the post emulator tests.

Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
j0nsh1n added a commit to j0nsh1n/wronggpu that referenced this pull request Nov 18, 2026
The block kernel called __builtin_amdgcn_readfirstlane directly and
held a "+s" asm constraint for the RESIDENT kernels. Neither exists in
the host build (-DWG_EMU), so build.py --emu-only and every emulator test
failed with "use of undeclared identifier '__builtin_amdgcn_readfirstlane'"
and "invalid output constraint '+s' in asm".

The wave index now goes through wg_uniform, which is readfirstlane on the
device and the value itself on the host. The asm is left out of the host
build (#ifndef WG_EMU), the same form as upstream PR phantoslayer21#279 for this line.
Device code is unchanged.

Verified: build.py --emu-only fails with those two errors before and
builds after; TestLayoutIndependence passes (27 s); the 27 gfx1201 code
objects have identical SHA-256 before and after (clang 20, ROCm 7.1.1).

Signed-off-by: Jonathan Shin <85975340+j0nsh1n@users.noreply.github.com>
@phantoslayer21
phantoslayer21 merged commit 0bf6aa4 into phantoslayer21:main Nov 20, 2026
10 checks passed
@j0nsh1n
j0nsh1n deleted the fix/linux-emulator-tests branch November 21, 2026 02:07
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.

2 participants