Repository navigation
Conversation
…control flow When the narrow-wave translation refuses a wave64 compute program of exactly 64 threads at a cross-half gate (a lane mask read as data, LDS one wave shares without a barrier, a reduction, first-lane or lane read across the halves), it is translated again with whole-wave control flow: every lane follows the console wave's blocks, raw EXEC guards vector instructions, and per-lane branch predicates become whole-wave votes (Atom::Any). Mask equality sets SCC only when all lanes compare equal, v_writelane_b32 writes its lane outside EXEC, and LDS barriers go outside per-lane guards. Ported onto halves from an earlier split-waves prototype. VICTORY_LITERAL_HALVES=0 turns the retry off (own cache key). An offline replay of Grand Theft Auto VI's Series S shaders recovers 68 of the 107 compute shaders refused before. Tests: 378 victory-shader and 364 victory-gpu under Wine/D3DMetal, 223 victory-shader native. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017tiHubszVmvo5uoUAc34Br
de49289 to
9a4652e
Compare
|
Independent M4 Pro result on D3DMetal 4.0 beta 3, using Kolkka’s updated #435 head The already accepted tagged half reduction and broadcast copy from earpjonathan and draggygaggy-maker also kept 8/8 DXIL pairs byte-identical with retry allowed or disabled, across 32/64/96/128 threads. All 640 hardware lane results matched. This covers the tested ordinary conversion after EXEC restore. earpjonathan’s #425 · draggygaggy-maker’s #3342 Prepared and tested with Codex. |
|
In-game test on an M5 Pro (18-core CPU, 20-core GPU, 64 GB), macOS 27.2.1, CrossOver Wine with D3DMetal 4.0b3, Series X, build 1.0.2.1 from my own dump. Diagnostics build, same prologue autosave and scripted input in both runs. Text and numbers only, no game data.
What it changes on screen: without #435, the producers of the opaque-lighting indirect records were among the refused wave64 programs. So the lighting dispatches ran with zero groups, and the lit HDR target kept pixels from shots many frames old. That showed up as the stale, ghosted layers and the flat dark player silhouette that testers keep reporting, plus overexposure metered from a near-black scene. With #435 the cell scene is correctly lit, the stale layers are gone, and walking and camera input through the movement tutorial look right. I applied #433 together with #435 and have not separated their effects. Still refused here, by dispatches per frame: Prepared with Claude Code. |
|
In-game check on an M5 Pro (macOS 27.0.1, CrossOver 26.3 Wine with the repo's current patches, D3DMetal 4.0 beta 3, Series X), with #435 applied on
Only #435 was needed for the picture. #433 on top made no visible difference. Prepared with Claude Code. |
In halves (#180), a console wave64 program runs as two host waves of 32 lanes. Some programs are still refused at a cross-half gate: a lane mask read as data, LDS one wave shares without a barrier, or a reduction, first-lane read or lane read across the halves. In GTA VI (Series S) 107 compute shaders were refused this way.
How
structure::split_literal):Atom::Any, a 64-lane ballot through the existing exchange).s_cmp_eqon lane masks) sets SCC only when all lanes compare equal, so its scc0/scc1 polarity is the vote's inverse.v_writelane_b32writes its lane regardless of EXEC.group_uniforminbarriers.rs), and lane reads need a uniform selector. First-lane reads ballot EXEC before choosing the source half. FP16 reductions keep the original order and rounding.VICTORY_LITERAL_HALVES=0turns the retry off and gets its own shader cache key.lower.rsstays under the asset policy's 512 KiB limit (521,528 bytes).Still refused
Tests
halves_tests.rs. 12 synthetic programs run on the host GPU, and every lane matches the expected console result.cargo clippy --workspace --all-targets -- -D warnings, with and without--all-features, for x86_64-pc-windows-gnullvm.cargo test --workspace: RESULT_NATIVEWINEDLLOVERRIDES="d3d12,d3d12core,dxgi=b" tools/macos/test-wine.sh --workspace --no-fail-fastwith D3DMetal 4.0 beta 3 on an M5: RESULT_WINECost: only for programs refused before. They pay a 64-lane ballot per lane-dependent branch, and the barriers the hazard pass adds.