Repository navigation
Conversation
|
Windows-side verification at head
I reviewed the Metal runner and Swift probe. The runner requires native Apple Silicon macOS and exits before creating its temporary lab or invoking Swift, the converter, or GPU commands on other platforms. Therefore the Metal conversion, shader execution, pixel readback and compute-buffer checks were not reproduced here; those hardware results remain unverified by this Windows run. This verification was AI-assisted. |
|
Automated triage for the maintainers. Closing because it is outside the project's scope (VIctory targets Windows hosts; ports, launchers and tooling for other platforms are not being taken). Out of scope: a macOS/Apple Silicon Metal harness (Python and Swift, needs Apple's Metal Shader Converter and the conflicting Linux-build PR #235), and it adds three path exceptions for .py/.swift files to the asset-policy allowlist in xtask/src/policy.rs. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Overview
This PR introduces an experimental native Metal GPU conformance harness for Apple Silicon.
It demonstrates that synthetic Xbox GFX10 shaders translated by VIctory can be converted from DXIL to Metal libraries and executed on Apple GPU hardware, with their outputs verified against independent CPU references.
The complete test path is:
GFX10 → VIctory → DXIL → Metal Shader Converter → Metal GPU execution → readback verificationNo Wine, Rosetta, Windows VM or game assets are required.
Hardware validation
Apple M5 with 16 GB unified memory
macOS 27.2.1
Native ARM64 executable
Rust 1.98.1
Xcode and macOS SDK 27.0
Metal Shader Converter 4.0.3
Metal API and GPU validation enabled
Results
Verification | Result -- | -- Automated checks with optional A/B comparison | 58/58 passed Translated shader pixel comparisons | 16,384/16,384 RGBA channel comparisons | 65,536 Maximum observed channel error in positive tests | 0 Compute buffer values | 64/64 Buffer guard values | 16/16 Failed checks | 0 Blocked checks | 0 Asset policy | 155 files passed Xtask unit tests | 5/5 passed Xtask Clippy | PassedGPU coverage
Constant pixel colors
Position-dependent floating-point arithmetic
Integer and floating-point conversions
Bitwise operations
Conditional selection
Dynamic byte permutation covering all 256 selector values in each output byte, using two operand pairs
Translated vertex shaders
Combined translated vertex and pixel pipelines
Native versus translated vertex pipeline equivalence
Compute dispatch with writable raw buffers
GPU memory readback and trailing guard verification
A negative control deliberately compares a red output against a checkerboard reference. The harness correctly detects the mismatch and rejects the result.
Optional differential testing
The harness accepts a second VIctory executable for A/B testing.
During development, the dynamic
v_perm_b32changes from #423 were tested against the original lowering. Both operand sets produced byte-identical GPU outputs, while the candidate no longer declared the INT64 shader feature.Reproduction
Install Apple's Metal Shader Converter and Xcode, then run:
All generated artifacts remain in a temporary directory outside the repository.
The runner produces detailed logs, GPU readbacks and a JSON summary. Failed or blocked checks return a nonzero exit status.
Asset policy
Only the three specifically named Python and Swift test sources are newly permitted. All existing file-size, binary-content, magic-signature and encoded-data checks remain enforced.
No generated binaries, proprietary assets or Apple converter components are committed.
Relationship to other PRs
The harness is independent of the implementation changes in #235, #423 and #438.
A working macOS VIctory executable is required. Native build portability was validated using #235 by @SkippySteve. The optional #423 comparison is not required for normal use.
Limitations
This is a GPU testing infrastructure, not a complete Metal backend or Xbox title runtime.
It does not establish game compatibility, general resource binding support, mesh shader compatibility or performance improvements.
Independent testing on other Apple Silicon generations is welcome.
AI-assisted implementation, reviewed and validated on physical Apple Silicon hardware.