victory-gpu native tests fail cryptically without Apple's Metal Shader Converter; GPTK's bundled dylib is not a substitute #382

Closed
opened 2026-11-27 15:01:08 +00:00 by github-bot · 5 comments
Owner

@⁠wz11wz on GitHub · 2026-11-27 14:57 UTC · original

Environment

M1 Max, macOS 26 (Darwin 27.2), clean main (728845d1), no Metal Shader Converter installed.

What happens

cargo test -p victory-gpu --lib fails 3 native::tests::texture_tests cases on main:

  • a_drawn_target_is_not_filled_from_title_memory_again
  • an_indirect_dispatch_mesh_x_draws_the_groups_its_record_holds
  • described_rectangle_list_draw_uses_supplied_triangles

Two panic with no mesh pipeline (texture_tests.rs:1154 / 1207), one with the dlopen directly:

dlopen /usr/local/lib/libmetalirconverter.dylib: no such file

Why it is easy to miss

native-setup.sh warns when the Metal Shader Converter is missing, but nothing stops a test run without it: 356 of 359 tests still pass, and the 3 failures only name the missing dylib indirectly. They look like GPU bugs but are a missing prerequisite.

GPTK's bundled dylib is not a substitute

VICTORY_MSC_DYLIB is honoured by msc.rs, and D3DMetal 4.0b3 ships a libmetalirconverter.dylib inside its framework. Pointing VICTORY_MSC_DYLIB at that copy makes it dramatically worse: 129 of 359 fail (shader_tests included, e.g. render_pipelines_come_from_the_translated_shaders_and_the_streams_state). The converter ABI the code expects matches Apple's standalone distribution only.

Suggestion

verify.sh / native-setup.sh could fail fast with "install Apple's Metal Shader Converter" when VICTORY_MSC_DYLIB is unset and the default path is missing, instead of letting 3 tests fail with an indirect panic. Found while wiring victory-gpu into a verification gate (#373).

Happy to send that small check as a PR.

**@⁠wz11wz** on GitHub · 2026-11-27 14:57 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/379) ## Environment M1 Max, macOS 26 (Darwin 27.2), clean `main` (`728845d1`), no Metal Shader Converter installed. ## What happens `cargo test -p victory-gpu --lib` fails 3 `native::tests::texture_tests` cases on `main`: - `a_drawn_target_is_not_filled_from_title_memory_again` - `an_indirect_dispatch_mesh_x_draws_the_groups_its_record_holds` - `described_rectangle_list_draw_uses_supplied_triangles` Two panic with `no mesh pipeline` (texture_tests.rs:1154 / 1207), one with the dlopen directly: ``` dlopen /usr/local/lib/libmetalirconverter.dylib: no such file ``` ## Why it is easy to miss `native-setup.sh` warns when the Metal Shader Converter is missing, but nothing stops a test run without it: 356 of 359 tests still pass, and the 3 failures only name the missing dylib indirectly. They look like GPU bugs but are a missing prerequisite. ## GPTK's bundled dylib is not a substitute `VICTORY_MSC_DYLIB` is honoured by `msc.rs`, and D3DMetal 4.0b3 ships a `libmetalirconverter.dylib` inside its framework. Pointing `VICTORY_MSC_DYLIB` at that copy makes it dramatically worse: **129 of 359 fail** (shader_tests included, e.g. `render_pipelines_come_from_the_translated_shaders_and_the_streams_state`). The converter ABI the code expects matches Apple's standalone distribution only. ## Suggestion `verify.sh` / `native-setup.sh` could fail fast with "install Apple's Metal Shader Converter" when `VICTORY_MSC_DYLIB` is unset and the default path is missing, instead of letting 3 tests fail with an indirect panic. Found while wiring victory-gpu into a verification gate (#373). Happy to send that small check as a PR.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 15:01:08 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-27 15:07 UTC · original

Please send it as a PR, thank you

**@⁠LakshanSivakumar** on GitHub · 2026-11-27 15:07 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/379#issuecomment-7221657242) Please send it as a PR, thank you
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 16:11 UTC · original

/claim

**@⁠AnastasisKon** on GitHub · 2026-11-27 16:11 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/379#issuecomment-7222974696) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-27 16:12 UTC · original

Claimed by @⁠AnastasisKon. Open a draft pull request with Refs #379 in its description within 24 hours, or the claim expires.

**@⁠github-actions[bot]** on GitHub · 2026-11-27 16:12 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/379#issuecomment-7222979920) Claimed by @⁠AnastasisKon. Open a draft pull request with `Refs #379` in its description within 24 hours, or the claim expires.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 22:18 UTC · original

Evidence that this one is resolved on main, so it can close:

  • tools/macos/test-native.sh is on main and fails fast exactly as you asked, before cargo runs. With VICTORY_MSC_DYLIB=/nonexistent/x.dylib:

    fail: Metal Shader Converter not found at /nonexistent/x.dylib
          Download "Metal shader converter" from https://developer.apple.com/metal/shader-converter/
          and run its installer (free with an Apple ID), or point VICTORY_MSC_DYLIB at Apple's
          libmetalirconverter.dylib. A copy bundled with another tool is not a substitute (#379).
    

    and it exits 1 without invoking the test binary, so the dlopen panic it used to produce is gone.

  • tools/macos/verify.sh fails the same way (tools/macos/tests/verify-msc.sh and tests/msc-check.sh pin both, and run in the macos-scripts CI job).

  • With Apple's converter installed (I have it here now, /usr/local/lib/libmetalirconverter.dylib), test-native.sh -p victory-gpu runs the suite whole: 402 passed, 0 failed, 3 ignored. So the cryptic failure was the missing library, not the tests.

Nothing left to do in this issue as far as I can see; the only thing worth adding later is a note in docs/macos.md about the install, if you want the download steps written down outside the script.

**@⁠AnastasisKon** on GitHub · 2026-11-27 22:18 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/379#issuecomment-7229211982) Evidence that this one is resolved on main, so it can close: - `tools/macos/test-native.sh` is on `main` and fails fast exactly as you asked, before cargo runs. With `VICTORY_MSC_DYLIB=/nonexistent/x.dylib`: ``` fail: Metal Shader Converter not found at /nonexistent/x.dylib Download "Metal shader converter" from https://developer.apple.com/metal/shader-converter/ and run its installer (free with an Apple ID), or point VICTORY_MSC_DYLIB at Apple's libmetalirconverter.dylib. A copy bundled with another tool is not a substitute (#379). ``` and it exits 1 without invoking the test binary, so the `dlopen` panic it used to produce is gone. - `tools/macos/verify.sh` fails the same way (`tools/macos/tests/verify-msc.sh` and `tests/msc-check.sh` pin both, and run in the `macos-scripts` CI job). - With Apple's converter installed (I have it here now, `/usr/local/lib/libmetalirconverter.dylib`), `test-native.sh -p victory-gpu` runs the suite whole: 402 passed, 0 failed, 3 ignored. So the cryptic failure was the missing library, not the tests. Nothing left to do in this issue as far as I can see; the only thing worth adding later is a note in `docs/macos.md` about the install, if you want the download steps written down outside the script.
Author
Owner

@⁠wz11wz on GitHub · 2026-11-27 23:14 UTC · original

Resolved - thanks for the fast fail in test-native.sh/verify.sh and for confirming the full suite runs green (402 passed) once Apple's standalone converter is installed. The install steps are now written down too: #515. Closing as done.

**@⁠wz11wz** on GitHub · 2026-11-27 23:14 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/379#issuecomment-7229990600) Resolved - thanks for the fast fail in test-native.sh/verify.sh and for confirming the full suite runs green (402 passed) once Apple's standalone converter is installed. The install steps are now written down too: #515. Closing as done.
This discussion has been locked. Commenting is limited to contributors.
No description provided.