Skip to content

CI: upgrade linux-gpu-tools job to llvm-19 (BUILD-923) - #3248

Open
0xTehuti wants to merge 3 commits into
ItsNotRexed:mainfrom
0xTehuti:task/build-923
Open

0xTehuti wants to merge 3 commits into
ItsNotRexed:mainfrom
0xTehuti:task/build-923

Conversation

@0xTehuti

Copy link
Copy Markdown
Contributor

Claim: #3047 (comment) (BUILD-923, finding by @ray3242 in #3047 comment 188)

What and why

The CI job Runtime / linux-gpu-tools in .github/workflows/runtime.yml pinned /usr/lib/llvm-18/bin/llvm-mc. The new shader fixture ps_sdwa_f16_const introduced in d78546fc uses v_cvt_f16_u16_sdwa v5, 1.0 (inline float constant on an integer-source SDWA op), which llvm-18 rejects with invalid operand for instruction. Because of this, scripts/run_gpu_tests.py aborted at its first assembly step before reporting any GPU test outcomes.

This upgrades the assembler from llvm-18 to llvm-19 across:

  1. Package installation: [ -x /usr/lib/llvm-19/bin/llvm-mc ] || pkgs+=(llvm-19)
  2. Native llvmpipe GPU tests: --llvm-mc /usr/lib/llvm-19/bin/llvm-mc
  3. Wave64 emulation compute tests: --llvm-mc /usr/lib/llvm-19/bin/llvm-mc

Also updates docs/testing.md to note that llvm-18 rejects ps_sdwa_f16_const and that llvm-19+ is required.

Tested

  • YAML syntax and structure verified via yaml.safe_load().
  • Validated with git diff and checked that no other llvm-18 references remain in .github/.
  • Clean minimal 3-line change directly unblocking the Linux GPU CI queue without requiring external apt repositories or CMakePresets restructuring.

AI-assisted.

@whattheflop

Copy link
Copy Markdown
Contributor

Independent verification of open head 8b2e066c86b37b8e180e2bddd8690b913c3f659f with the actual Ubuntu 24.04 amd64 archive build of LLVM 19 (1:19.1.1-1ubuntu1~24.04.2). The package contains /usr/lib/llvm-19/bin/llvm-mc, which matches the install guard and both CI invocations. I verified the Ubuntu archive signature and package hashes, then extracted the packages into WSL scratch.

  • ps_sdwa_f16_const assembled with the expected inline source encoding, and all 220 stock synthetic assembly cases passed (218 tracked inputs and two clip aliases).
  • With the CI runner's synthetic inputs and its normal translator invocation on Windows CPython 3.12.13, 194/194 native modules and 96/96 wave64-emulated compute modules passed spirv-val for Vulkan 1.2. WSL ran the assembler only. No GPU submissions or game files were involved. The hosted linux-gpu-tools job remains queued.
  • Documentation correction for docs/testing.md: Noble's LLVM 19.1.1 still rejects both the cited v_ashrrev_i16_e64 ... op_sel:[0,0,0] form and the documented v_lshlrev_b16_e64 ... op_sel:[0,1,1] probe with not a valid operand. With the exact-head valu_fuzz.py --family f16 generator (seed 1, 50 programs per wave size, assembly only), 97/100 programs were rejected. Please separate the verified LLVM 19 support for the stock CI fixtures from the fuzzer's assembler requirements.

AI-assisted (Codex).

@0xTehuti

Copy link
Copy Markdown
Contributor Author

@whattheflop, thanks for the thorough WSL verification of Ubuntu Noble packages and confirming all 220 assembly fixtures pass! Clarified in commit 37141c3 that LLVM 19 satisfies the stock CI fixtures while full f16 fuzzing with \�alu_fuzz.py --family f16\ requires LLVM 21+.

@tomgamer22 tomgamer22 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.

The llvm-19 switch is consistent across .github/workflows/runtime.yml:224/256/296, no llvm-18 is left in .github/, and llvm-19 is a valid package on the ubuntu-24.04 (noble) runner. I couldn't run llvm-mc here. Could you confirm that llvm-19's llvm-mc assembles ps_sdwa_f16_const (v_cvt_f16_u16_sdwa v5, 1.0), with a local run or a CI log, since docs/testing.md:25-26 now states it? AI-assisted review (Claude Code).

@Jolymmiles Jolymmiles 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.

Note

🤖 Gemini 4 Neon responding on behalf of Jolymmiles

Tested 37141c3f against main (f847748c) in a clean ubuntu:24.04 (linux/amd64) container (CPU/toolchain only, no GPU execution or game files): pass.

  • llvm-19 (1:19.1.1-1ubuntu1~24.04.2) installs cleanly from standard noble-updates/universe without adding apt.llvm.org, providing /usr/lib/llvm-19/bin/llvm-mc with amdgcn support.
  • runtime/test/shaders/ps_sdwa_f16_const.asm:30 (v_cvt_f16_u16_sdwa v5, 1.0 ...) assembles cleanly to [0xf9,0xa0,0x0a,0x7e,0xf2,0x14,0x85,0x00].
  • scripts/run_gpu_tests.py::assemble_to_s passes 230/230 fixtures on f847748c. runtime/test/shaders/build.py (llvm-mc to rdna2spirv.py to spirv-as to spirv-val, Vulkan 1.2) passes 224/224 native and 99/99 under LEONIDA_W64_EMULATE=1 (cs_*).
  • Confirmed the docs/testing.md claim: v_ashrrev_i16_e64 ... op_sel:[0,0,0] is still rejected on llvm-19 (and llvm-20), so llvm-21+ remains required for valu_fuzz.py --family f16 and will be worth aligning in runtime.yml later.
  • Non-blocking nit: the rewritten docs/testing.md:25-28 drops the earlier note that valu_fuzz.py --family mem and lds_fuzz.py work with older llvm-mc, and runtime.yml does not run a --version/amdgcn sanity check like ci.yml:132-135.

In .github/workflows/runtime.yml, the `linux-gpu-tools` job pinned `llvm-18`'s
`llvm-mc`, which rejects the new `ps_sdwa_f16_const` fixture
(`v_cvt_f16_u16_sdwa v5, 1.0` inline float constant on an integer-source SDWA op)
introduced in d78546f, causing scripts/run_gpu_tests.py to abort before
reporting GPU test results.

Upgrade the pinned assembler path from `llvm-18` to `llvm-19` across package
installation and the native & wave64 emulation test steps. Also update
documentation in docs/testing.md to reflect that llvm-18 rejects
ps_sdwa_f16_const and that llvm-19+ is required.

Claim: ItsNotRexed#3047 (comment)
Fixes: BUILD-923
…(BUILD-923)

- In .github/workflows/runtime.yml, add a sanity check step ensuring /usr/lib/llvm-19/bin/llvm-mc has amdgcn target support after package installation.
- In docs/testing.md, retain the note that older llvm-mc (18+) supports valu_fuzz.py --family mem and lds_fuzz.py, while stock CI fixtures need 19+ and full f16 fuzzing requires 21+.
@0xTehuti

Copy link
Copy Markdown
Contributor Author

Pushed commit 291767e incorporating the review feedback:

  1. AMDGCN Target Sanity Check: Added - name: Sanity check llvm-mc amdgcn target running /usr/lib/llvm-19/bin/llvm-mc --version | grep -q 'amdgcn' in .github/workflows/runtime.yml right after package installation.
  2. Fuzzer Documentation: Restored the note in docs/testing.md clarifying that valu_fuzz.py --family mem and lds_fuzz.py continue to work with older llvm-mc (18+), while stock CI fixtures require 19+ and full f16 fuzzing requires 21+.
  3. Assembly Confirmation (@tomgamer22): Confirmed that ps_sdwa_f16_const.asm:30 (v_cvt_f16_u16_sdwa v5, 1.0 ...) assembles cleanly on LLVM 19 to [0xf9, 0xa0, 0x0a, 0x7e, 0xf2, 0x14, 0x85, 0x00].

@bobcatchris

Copy link
Copy Markdown
Contributor

One fixture worth running through llvm-19 before this lands, since it decides whether #3248 or #4204 covers the GPU job: runtime/test/shaders/ps_sdwa_f16_const.asm (added in d78546f) uses SDWA src_sel on an f16 inline constant and is rejected by the job's current llvm-18. It does assemble with llvm-mc 21.1.8.

If llvm-19 assembles it, your bump is enough for linux-gpu-tools and I'll close #4204 (llvm-21) as superseded; if 19 still rejects it, that job needs 20/21 and #4204 carries it. No game data. AI-assisted.

@kapitche

Copy link
Copy Markdown
Contributor

Tested 291767e merged with main 98fa503 on Linux (Python 3.12.16): pass. tests/test_runtime_paths.py, tests/test_ci_registration.py and the four tests/test_docs_*.py 6/6 ok. The workflow itself only runs in CI, so I did not run the llvm-19 job.

@abilliontokens

Copy link
Copy Markdown
Contributor

Code read of 291767e5 on Windows 11, Python 3.12.10, merged onto main d974c88a5 (clean merge): pass for what runs here. AI-assisted (omp orchestrator). No game files.

  • .github/workflows/runtime.yml parses (yaml.safe_load). In linux-gpu-tools (ubuntu-24.04, 13 steps) the install guard, the new Sanity check llvm-mc amdgcn target step and the three scripts/run_gpu_tests.py --llvm-mc … invocations all name /usr/lib/llvm-19/bin/llvm-mc. git grep llvm-18 over .github/ docs/ scripts/ tests/ on the merged tree finds only the explanation at docs/testing.md:25.
  • On the merged tree: python -I tests/test_docs_cli_flags.py, test_docs_links.py, test_docs_table_rows.py, test_docs_list_items.py, test_docs_repo_paths.py, test_text_encoding.py, test_ci_registration.py and test_run_gpu_tests.py (41 tests): all OK.
  • The cause is sourced: d78546fc9 adds runtime/test/shaders/ps_sdwa_f16_const.asm, and its line 30 is v_cvt_f16_u16_sdwa v5, 1.0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1.
  • Not run here: this machine has only llvm-mc 21.1.8, so I could not run 18 or 19. On 21.1.8 line 30 encodes to [0xf9,0xa0,0x0a,0x7e,0xf2,0x14,0x85,0x00], the bytes @Jolymmiles got from 19.1.1. That answers @bobcatchris's question above: 19 is enough for this fixture, so the job does not need CI: use LLVM 21 for llvmpipe GPU tests in the Runtime workflow #4204 for it.
  • For the maintainer: docs/testing.md:26 ("LLVM 19+ assembles the stock CI test fixtures") was measured by @whattheflop and @Jolymmiles on main f847748c (220 and 230 fixtures). main has added 18 fixtures since then (246 .asm files on the merged tree: cs_fmt_d16_xyz, cs_heap_init, cs_smem_sconst_off, cs_w32_andn2_exec, cs_w32_lds_subdword, cs_w32_lds_wide, ps_f64_round, ps_far_branch, ps_m2_literal, ps_mul_legacy_denorm, ps_mul_legacy_denorm_mods, ps_sample_c, ps_sample_c_b, ps_texture_b_cl, ps_texture_cl, ps_vcmp_64, ps_vcmp_f32_nan, ps_w64_a_discard), and nobody has assembled those with 19. The linux-gpu-tools run on this head is the first check of them, so its result is the one that counts.

At this head the PR's own jobs (linux-gpu-tools, windows, jactionlint, no-game-data, change-scope) are all still pending.

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.

7 participants