Apple Silicon: unified experimental GPU and runtime integration #1007

Closed
github-bot wants to merge 4 commits from gh-pr/1007/head into gh-pr/1007/base
Owner

@⁠pedrofort on GitHub · 2026-11-24 14:55 UTC · original
pedrofort:apple-silicon-unified-9c747a6 → main · +9898 −554 · 30 files · 4 commits · closed without merging

Purpose

Experimental integration snapshot for Apple Silicon
through Wine, Rosetta and D3DMetal.

This draft is a reproducible integration candidate for
review and synthetic conformance testing.

It is not ready for immediate merging.

Scope

Graphics:

  • Wave64 compute emulation on Wave32 hosts.
  • Split constant EXEC mask handling.
  • Dynamic mask lowering preserving both SSA values.
  • Texture sampling, comparison and gather integration.
  • Indirect argument clamping without a runtime compiler.
  • Indirect mesh dispatch integration.

Systems:

  • Pipeline library fallback.
  • Shadow memory pooling.
  • Experimental queue scheduling and resource retention.
  • Shared async timers and worker lifecycle improvements.
  • Blocking fence waits and dependency tickets.

Attribution

This snapshot includes existing upstream contributions:

  • #24 by @⁠artor410
  • #190 by @⁠LaunchDoesntCode
  • #160 by @⁠r4tedx
  • #189 by @⁠alfycs

Their inclusion is for integration testing, not a claim
of original authorship.

Related contributions requiring reconciliation:
#646, #660, #687 and #961.

Some of these upstream PRs have newer revisions than
the snapshots integrated here.

Integrated candidate verification

Hardware: Apple M5, ARM64, 16 GB RAM.
Environment: macOS, Sikarugir Wine 10.0, Rosetta.

Verification Result
Native shader tests 116 passed, 0 failed, 1 ignored
Windows x64 runtime build PASS
Windows shader test build PASS
Windows GPU test build PASS
Windows HLE test build PASS
Windows loader test build PASS
Runtime CLI startup under Wine PASS
DXC startup PASS
Loader tests under Wine 22 passed
Blocking CPU fence tests 2 passed
Integrated Wave64 GPU suite 2 passed, 9 failed
Repository asset policy PASS before submission

Wave64 investigation

The nine integrated Wave64 failures occur at the
assertion that Native Wave64 should fail to create
a pipeline on the selected adapter.

The Apple Silicon environment unexpectedly accepts
the Native PSO. Acceptance alone does not demonstrate
correct Native Wave64 execution.

The previous graphics control binary, using a diagnostic
instead of that assertion, passed 23 tests in the same
recovered Wine environment.

Earlier component-level numerical verification reported:

  • 84 verified GPU executions.
  • 8,064 verified output words.
  • 24 verified dynamic-mask executions.

Those numbers belong to the earlier graphics candidate,
not the fully integrated executable.

Remaining work

  • Recover the additional dynamic-mask regression fixtures.
  • Complete integrated Wave32 and Emulate numerical tests.
  • Confirm DXIL validation and the active graphics backend.
  • Reconcile overlapping upstream contributions.
  • Verify sampling and indirect mesh dispatch end to end.
  • Complete HLE, queue and GPU fence regressions.
  • Validate transitive GPU resource lifetimes.
  • Run prolonged stability and memory tests.
  • Complete native Windows CI and formatting checks.

No claim of commercial title compatibility is made.

Reproducibility

Base:
ffe310eb20

Integrated source patch SHA-256:
9c747a6f07f9d1e4a94fcfdb3c3236ef98e229f1f4b51427c166b7a4cca805b3

Debug runtime SHA-256:
f13f976c48c0782d758789241b1d3b3aba146a74600b7ee45ed56ce1122ce13b

The runtime binary is not included in this PR.

Asset policy and AI disclosure

Only source changes and synthetic test code are included.
No commercial game files, extracted shaders, proprietary
SDKs or runtime binaries are submitted.

Development, integration and test automation were
AI-assisted with OpenAI ChatGPT.

Builds and tests were performed locally on the
contributor's Apple Silicon machine.

This draft is intentionally experimental.

Follow-up validation (631fff9)

  • Native shader tests: 116 passed, 0 failed, 1 ignored.
  • Asset policy: 157 files OK.
  • Updated Wave64 GPU diagnostic and numerical readback harness.
  • Native warning cleanup and integrated GPU rerun pending.

The previous binary and patch hashes describe the original
integration snapshot, not this follow-up commit.

Earlier GPU results are historical and should not be
attributed to this exact revision until retested.

Related Apple Silicon investigation: #1128.

This PR remains experimental and is not merge-ready.

Integrated GPU follow-up (9f2177c)

  • Native shader tests passed with warnings denied.
  • Windows x64 shader test executable built successfully.
  • Wave64 GPU tests: 23 passed, 0 failed.
  • Hardware GPU executions verified: 44.
  • Hardware output words verified: 5504.
  • Hardware DXIL validations: 44.
  • Tested modes: Emulate, Wave32.

Synthetic fixtures only, using the configured Apple Silicon
Wine/D3DMetal environment.

Native Wave64 PSO acceptance is diagnostic information,
not evidence of native Wave64 correctness.

This is not a claim of commercial-title compatibility.
The PR remains experimental.

**@⁠pedrofort** on GitHub · 2026-11-24 14:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/1007) `pedrofort:apple-silicon-unified-9c747a6` → `main` · +9898 −554 · 30 files · 4 commits · closed without merging ## Purpose Experimental integration snapshot for Apple Silicon through Wine, Rosetta and D3DMetal. This draft is a reproducible integration candidate for review and synthetic conformance testing. It is not ready for immediate merging. ## Scope Graphics: - Wave64 compute emulation on Wave32 hosts. - Split constant EXEC mask handling. - Dynamic mask lowering preserving both SSA values. - Texture sampling, comparison and gather integration. - Indirect argument clamping without a runtime compiler. - Indirect mesh dispatch integration. Systems: - Pipeline library fallback. - Shadow memory pooling. - Experimental queue scheduling and resource retention. - Shared async timers and worker lifecycle improvements. - Blocking fence waits and dependency tickets. ## Attribution This snapshot includes existing upstream contributions: - #24 by @⁠artor410 - #190 by @⁠LaunchDoesntCode - #160 by @⁠r4tedx - #189 by @⁠alfycs Their inclusion is for integration testing, not a claim of original authorship. Related contributions requiring reconciliation: #646, #660, #687 and #961. Some of these upstream PRs have newer revisions than the snapshots integrated here. ## Integrated candidate verification Hardware: Apple M5, ARM64, 16 GB RAM. Environment: macOS, Sikarugir Wine 10.0, Rosetta. | Verification | Result | |---|---| | Native shader tests | 116 passed, 0 failed, 1 ignored | | Windows x64 runtime build | PASS | | Windows shader test build | PASS | | Windows GPU test build | PASS | | Windows HLE test build | PASS | | Windows loader test build | PASS | | Runtime CLI startup under Wine | PASS | | DXC startup | PASS | | Loader tests under Wine | 22 passed | | Blocking CPU fence tests | 2 passed | | Integrated Wave64 GPU suite | 2 passed, 9 failed | | Repository asset policy | PASS before submission | ## Wave64 investigation The nine integrated Wave64 failures occur at the assertion that Native Wave64 should fail to create a pipeline on the selected adapter. The Apple Silicon environment unexpectedly accepts the Native PSO. Acceptance alone does not demonstrate correct Native Wave64 execution. The previous graphics control binary, using a diagnostic instead of that assertion, passed 23 tests in the same recovered Wine environment. Earlier component-level numerical verification reported: - 84 verified GPU executions. - 8,064 verified output words. - 24 verified dynamic-mask executions. Those numbers belong to the earlier graphics candidate, not the fully integrated executable. ## Remaining work - Recover the additional dynamic-mask regression fixtures. - Complete integrated Wave32 and Emulate numerical tests. - Confirm DXIL validation and the active graphics backend. - Reconcile overlapping upstream contributions. - Verify sampling and indirect mesh dispatch end to end. - Complete HLE, queue and GPU fence regressions. - Validate transitive GPU resource lifetimes. - Run prolonged stability and memory tests. - Complete native Windows CI and formatting checks. No claim of commercial title compatibility is made. ## Reproducibility Base: ffe310eb2098e52169f4c44db5ffdabf43a72622 Integrated source patch SHA-256: 9c747a6f07f9d1e4a94fcfdb3c3236ef98e229f1f4b51427c166b7a4cca805b3 Debug runtime SHA-256: f13f976c48c0782d758789241b1d3b3aba146a74600b7ee45ed56ce1122ce13b The runtime binary is not included in this PR. ## Asset policy and AI disclosure Only source changes and synthetic test code are included. No commercial game files, extracted shaders, proprietary SDKs or runtime binaries are submitted. Development, integration and test automation were AI-assisted with OpenAI ChatGPT. Builds and tests were performed locally on the contributor's Apple Silicon machine. This draft is intentionally experimental. ## Follow-up validation (631fff9) - Native shader tests: 116 passed, 0 failed, 1 ignored. - Asset policy: 157 files OK. - Updated Wave64 GPU diagnostic and numerical readback harness. - Native warning cleanup and integrated GPU rerun pending. The previous binary and patch hashes describe the original integration snapshot, not this follow-up commit. Earlier GPU results are historical and should not be attributed to this exact revision until retested. Related Apple Silicon investigation: #1128. This PR remains experimental and is not merge-ready. ## Integrated GPU follow-up (9f2177c) - Native shader tests passed with warnings denied. - Windows x64 shader test executable built successfully. - Wave64 GPU tests: 23 passed, 0 failed. - Hardware GPU executions verified: 44. - Hardware output words verified: 5504. - Hardware DXIL validations: 44. - Tested modes: Emulate, Wave32. Synthetic fixtures only, using the configured Apple Silicon Wine/D3DMetal environment. Native Wave64 PSO acceptance is diagnostic information, not evidence of native Wave64 correctness. This is not a claim of commercial-title compatibility. The PR remains experimental.
Integrates snapshots of upstream PRs #24, #190, #160 and #189, together with experimental split EXEC mask, OpaquePair, memory pooling, scheduling, fence and HLE changes.

AI-assisted development. Synthetic test data only. Not runtime-qualified.
Document existing unsafe contracts, preserve test assertions, simplify timer type notation and organize test modules. No lint suppressions. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:16:48 +00:00
github-bot closed this pull request 2026-11-26 04:16:48 +00:00
Author
Owner

@⁠wwwwwwww3333333 on GitHub · 2026-11-24 20:08 UTC · original

modules::xasync::tests::terminate_cancels_what_is_queued hangs with this PR. That test is on main unchanged, and the PR leaves it as it is.

Setup: head 9f2177c on main ffe310e (clean merge), Windows 11, RX 6750 XT, i5-13400F, Rust 1.98.1 MSVC. cargo test -p victory-hle --lib -- --test-threads=1 printed terminate_cancels_what_is_queued ... and then nothing for 10 minutes, so I stopped it. On main the whole victory-hle suite (94 tests) finishes in about 1 s. The 80 tests that ran before it pass. The victory-gpu (59) and victory-shader (173) suites pass with this PR.

Why, from the source: the test creates the queue with XTaskQueueCreate(0, 0, ...), so both ports are Mode::Manual. It then calls XTaskQueueTerminate(q, true, ...). With wait == true, terminate runs finish() on the calling thread. cancel_stage(WORK, ...) then submits a DispatchKind::Cancel for the queued callback, and Port::submit only pushes it onto the manual port's list, then calls stage.wait(). Nothing dispatches a manual port while its only thread sits in Terminate, so the stage never reaches 0. The Notify stage for the terminated callback would block the same way.

On main, termination runs the canceled callbacks itself, which is what the test expects: the callback sees canceled == true and the terminated callback has run before Terminate returns.

A possible fix: for Mode::Manual ports (and probably Immediate), run Cancel and Notify inline in cancel_stage and finish rather than submitting them. Keep the staged hand-off for the thread-pool and serialized ports.

Unit tests only, no game files. AI-assisted (Claude found the hang in a batch run and traced it in the source; I ran the tests on my machine).

**@⁠wwwwwwww3333333** on GitHub · 2026-11-24 20:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/1007#issuecomment-7143104127) `modules::xasync::tests::terminate_cancels_what_is_queued` hangs with this PR. That test is on main unchanged, and the PR leaves it as it is. Setup: head 9f2177c on main ffe310e (clean merge), Windows 11, RX 6750 XT, i5-13400F, Rust 1.98.1 MSVC. `cargo test -p victory-hle --lib -- --test-threads=1` printed `terminate_cancels_what_is_queued ...` and then nothing for 10 minutes, so I stopped it. On main the whole victory-hle suite (94 tests) finishes in about 1 s. The 80 tests that ran before it pass. The victory-gpu (59) and victory-shader (173) suites pass with this PR. Why, from the source: the test creates the queue with `XTaskQueueCreate(0, 0, ...)`, so both ports are `Mode::Manual`. It then calls `XTaskQueueTerminate(q, true, ...)`. With `wait == true`, `terminate` runs `finish()` on the calling thread. `cancel_stage(WORK, ...)` then `submit`s a `DispatchKind::Cancel` for the queued callback, and `Port::submit` only pushes it onto the manual port's list, then calls `stage.wait()`. Nothing dispatches a manual port while its only thread sits in `Terminate`, so the stage never reaches 0. The `Notify` stage for the terminated callback would block the same way. On main, termination runs the canceled callbacks itself, which is what the test expects: the callback sees `canceled == true` and the terminated callback has run before `Terminate` returns. A possible fix: for `Mode::Manual` ports (and probably `Immediate`), run `Cancel` and `Notify` inline in `cancel_stage` and `finish` rather than submitting them. Keep the staged hand-off for the thread-pool and serialized ports. Unit tests only, no game files. AI-assisted (Claude found the hang in a batch run and traced it in the source; I ran the tests on my machine).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:29 UTC · original

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).

Draft 'integration snapshot' for Apple Silicon through Wine/Rosetta/D3DMetal, 9,900 lines across gpu, hle and the shader emitter, which its own body calls not ready for merging: an out-of-scope port.

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.

**@⁠Marvisak** on GitHub · 2026-11-25 00:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/1007#issuecomment-7148571237) 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). Draft 'integration snapshot' for Apple Silicon through Wine/Rosetta/D3DMetal, 9,900 lines across gpu, hle and the shader emitter, which its own body calls not ready for merging: an out-of-scope port. 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.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1007
No description provided.