GPU and shaders: Grand Theft Auto VI runs its first 3D scene on a 32-lane laptop GPU (wave64 split and fallback, capped heaps, null root views, castable stand-in views, mapped pipeline library) #3145

Open
RaghavVijayanand wants to merge 20 commits from upstream-pr/3147 into main
RaghavVijayanand commented 2026-11-26 10:16:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by RaghavVijayanand on 2026-11-26T10:16:01Z.


Fixes found while running Grand Theft Auto VI in Series S mode on a laptop: RTX 5060 Laptop (8 GB, 32-lane waves only), Radeon 780M iGPU beside it, 23 GB RAM, Windows 11. With these it gets past the hangs at the first 3D scene and runs it, with the camera moving. The lit image is still black at the end: what remains is in the lighting pass, below.

This is one branch on top of main 63bcca4. It carries #1960 (wave64 on 32-lane hosts), rebased onto today's main, so it supersedes that PR. It also carries #2126 by @0xkn0wh3r3, which keeps relabelled thread ids unique in tiled group layouts, as one commit. On top of that is the split_ids fix by @0xkn0wh3r3 and @stem23456-coder: a 32x4 wave64 group paired the wrong host waves on NVIDIA. Its regression test fails without the fix on an RTX 5060.

What is in it

Hosts this title did not run on

  • wave64 compute on 32-lane hosts (#1960, rebased): each console wave becomes two host waves, cross-half reads go through group-shared memory, and a program that cannot be split is refused. The rebase follows main's ds_bpermute, which reads within its 32-lane half, and keeps v_readfirstlane reading the first lane of EXEC after #2468 (scalar results unguarded).
  • VICTORY_WAVE64_APPROX (opt-in): runs the refused wave64 programs in 32-lane waves anyway. They can be wrong, but they are not missing. Their loops stop after VICTORY_WAVE64_LOOPS iterations (64 by default). At 64, some of the title's programs still kept the GPU busy for minutes at the first 3D scene. At 8 they all finish.
  • Capped view heaps (NVIDIA and AMD cap shader-visible heaps at 1,000,000 views): the heap is probed and the title's slots are clamped to it, keeping 2^18 dynamic slots (2^16 ran out). The device is made on the high-performance adapter, so the RTX is used, not the 780M. Render targets and storage in formats the host lacks get stand-ins.

Rendering

  • A root view that the title did not set, or that lies outside title buffers, is the null buffer view. Before, the whole dispatch was dropped. About 190 dispatches a frame ran just before the lighting (f6e47efa50226beb, 3b90165a77d95cdf, …). Each case is logged once, with the address.
  • A view in a format its stand-in texture is castable to now reads that format. One R11G11B10 texture (the stand-in for R9G9B9E5) is made castable to R32_UINT and R9G9B9E5. The title's compute writes it as R32_UINT and its lighting reads it as R9G9B9E5. The view was rewritten to R11G11B10, so the bits were decoded wrongly.
  • Format twins: removed after review (they missed writes earlier in the same list). The castable view above is the path the title takes; @steven-seagull27's test packed_lighting_uav_write_is_visible_to_a_same_list_rgb9e5_srv (ignored by default, needs a GPU) covers it.

Memory and tools

  • The pipeline library is memory-mapped from its file. It was read whole into process memory, and every save serialised it into another buffer of its size. For this title that is 2.4 GB of private memory, plus 2.4 GB allocated at every save. Saves now write generations, host-pipelines-<n>.bin, because Windows refuses to replace a mapped file. They come every 5 minutes, not every 20 s. A run that made no pipeline writes only the early list.
  • VICTORY_PATCH=<rva>:<hex>,... writes title bytes once, before the title runs. I used it to make the title render at 720p by rewriting its display-mode table. VICTORY_DISPLAY_MODE lists another display mode.

Where the black image comes from (for whoever continues)

From VICTORY_CAPTURE_WORLD=30 and VICTORY_DUMP_TARGETS=1: geometry and materials render. f0c91b4d2578f5bf's 853x480 targets show the characters and the room. The lit HDR target stays black: 348e1e8c414c7eca and 63381c3250b287fa write it, at 853x480, format 10. With this branch nothing is skipped and no root view drops a dispatch, so the next suspect is one of the lighting inputs. VICTORY_TRACE_SHADERS=348e1e8c414c7eca lists them.

Testing

On the machine above, Windows 11 26300:

  • cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings: clean.
  • cargo test --workspace --locked: passes, with two exceptions that behave the same on unmodified main 63bcca4 on this machine. emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index crashes with STATUS_ACCESS_VIOLATION, so it was skipped. The two stride_tests::a_heap_buffer_* tests and synthetic_tests::gathers_at_a_level_match_the_hardware fail.
  • All 16 wave64_tests pass on the RTX 5060 (split programs) and on the 780M. On a machine without a GPU (CI) they skip.
  • In the title: Series S, 720p. Intro and menus at about 30 fps. The 3D scene runs at about 0.6 fps, with camera input working.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5508114976 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147). Originally posted by [RaghavVijayanand](https://github.com/RaghavVijayanand) on 2026-11-26T10:16:01Z. --- Fixes found while running Grand Theft Auto VI in Series S mode on a laptop: RTX 5060 Laptop (8 GB, 32-lane waves only), Radeon 780M iGPU beside it, 23 GB RAM, Windows 11. With these it gets past the hangs at the first 3D scene and runs it, with the camera moving. The lit image is still black at the end: what remains is in the lighting pass, below. This is one branch on top of `main` 63bcca4. It carries #1960 (wave64 on 32-lane hosts), rebased onto today's `main`, so it supersedes that PR. It also carries #2126 by @0xkn0wh3r3, which keeps relabelled thread ids unique in tiled group layouts, as one commit. On top of that is the `split_ids` fix by @0xkn0wh3r3 and @stem23456-coder: a 32x4 wave64 group paired the wrong host waves on NVIDIA. Its regression test fails without the fix on an RTX 5060. ## What is in it **Hosts this title did not run on** - **wave64 compute on 32-lane hosts** (#1960, rebased): each console wave becomes two host waves, cross-half reads go through group-shared memory, and a program that cannot be split is refused. The rebase follows `main`'s `ds_bpermute`, which reads within its 32-lane half, and keeps `v_readfirstlane` reading the first lane of EXEC after #2468 (scalar results unguarded). - **`VICTORY_WAVE64_APPROX`** (opt-in): runs the refused wave64 programs in 32-lane waves anyway. They can be wrong, but they are not missing. Their loops stop after `VICTORY_WAVE64_LOOPS` iterations (64 by default). At 64, some of the title's programs still kept the GPU busy for minutes at the first 3D scene. At 8 they all finish. - **Capped view heaps** (NVIDIA and AMD cap shader-visible heaps at 1,000,000 views): the heap is probed and the title's slots are clamped to it, keeping 2^18 dynamic slots (2^16 ran out). The device is made on the high-performance adapter, so the RTX is used, not the 780M. Render targets and storage in formats the host lacks get stand-ins. **Rendering** - **A root view that the title did not set, or that lies outside title buffers, is the null buffer view.** Before, the whole dispatch was dropped. About 190 dispatches a frame ran just before the lighting (`f6e47efa50226beb`, `3b90165a77d95cdf`, …). Each case is logged once, with the address. - **A view in a format its stand-in texture is castable to now reads that format.** One R11G11B10 texture (the stand-in for R9G9B9E5) is made castable to R32_UINT and R9G9B9E5. The title's compute writes it as R32_UINT and its lighting reads it as R9G9B9E5. The view was rewritten to R11G11B10, so the bits were decoded wrongly. - ~~Format twins~~: removed after review (they missed writes earlier in the same list). The castable view above is the path the title takes; @steven-seagull27's test `packed_lighting_uav_write_is_visible_to_a_same_list_rgb9e5_srv` (ignored by default, needs a GPU) covers it. **Memory and tools** - **The pipeline library is memory-mapped from its file.** It was read whole into process memory, and every save serialised it into another buffer of its size. For this title that is 2.4 GB of private memory, plus 2.4 GB allocated at every save. Saves now write generations, `host-pipelines-<n>.bin`, because Windows refuses to replace a mapped file. They come every 5 minutes, not every 20 s. A run that made no pipeline writes only the early list. - **`VICTORY_PATCH=<rva>:<hex>,...`** writes title bytes once, before the title runs. I used it to make the title render at 720p by rewriting its display-mode table. **`VICTORY_DISPLAY_MODE`** lists another display mode. ## Where the black image comes from (for whoever continues) From `VICTORY_CAPTURE_WORLD=30` and `VICTORY_DUMP_TARGETS=1`: geometry and materials render. `f0c91b4d2578f5bf`'s 853x480 targets show the characters and the room. The lit HDR target stays black: `348e1e8c414c7eca` and `63381c3250b287fa` write it, at 853x480, format 10. With this branch nothing is skipped and no root view drops a dispatch, so the next suspect is one of the lighting inputs. `VICTORY_TRACE_SHADERS=348e1e8c414c7eca` lists them. ## Testing On the machine above, Windows 11 26300: - `cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings`: clean. - `cargo test --workspace --locked`: passes, with two exceptions that behave the same on unmodified `main` 63bcca4 on this machine. `emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index` crashes with STATUS_ACCESS_VIOLATION, so it was skipped. The two `stride_tests::a_heap_buffer_*` tests and `synthetic_tests::gathers_at_a_level_match_the_hardware` fail. - All 16 `wave64_tests` pass on the RTX 5060 (split programs) and on the 780M. On a machine without a GPU (CI) they skip. - In the title: Series S, 720p. Intro and menus at about 30 fps. The 3D scene runs at about 0.6 fps, with camera input working. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
copilot-pull-request-reviewer[bot] commented 2026-11-26 10:16:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-26T10:16:13Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

<!-- greyfinch-sync:Marvisak/VIctory:review:6072240422 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#pullrequestreview-6072240422). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-26T10:16:13Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
steven-seagull27 commented 2026-11-26 11:04:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T10:41:53Z.


I found an ordering case in the fallback format twin on 7e641689. I extended your 8×4 lighting-texture fixture (R32_UINT source, R9G9B9E5 twin) so it reads back both resources. Every texel gets a distinct seed; a second upload flips every bit. Both devices produced the following counts in two fresh processes each, with the D3D12 debug layer enabled.

Ordering Source with expected bytes Twin with expected bytes
Seed written on a previous submission (original control) 32/32 32/32
Source rewritten, then twin read later in the same command list 32/32 0/32
Same resources read again on the next submission 32/32 32/32

In the middle row all 32 twin texels still contained their own previous seed. This reproduced on the RTX 5080 (621.40) and Windows inbox WARP. It matches the placement of format_twin::refresh in the prelude. If a lighting input uses this fallback and its producer writes earlier in that same list, the consumer can read the previous contents. The synthetic fixture uses a texture copy as its producer.

Which path did the descriptor builder actually take? I also created 853×480 guest textures through the production resource and SRV paths, requested either R9G9B9E5 or R32_UINT as the resource format, and bound an R9G9B9E5 SRV. I tried UAV and RT+UAV flags for both formats. All four combinations on each adapter bound the original resource with effective SRV format 67, with zero view-creation diagnostics. For the RGB9E5 resource, RTX used a castable R11G11B10 stand-in and WARP kept native RGB9E5. This rules out the fallback-twin ordering issue for those eight descriptor combinations here. A trace showing a lighting input actually binds a different underlying texture would be the discriminator in-game.

I then dispatched a typed R32_UINT UAV write followed by an R9G9B9E5 shader read on the same list, using those production descriptors. Each adapter matched 128/128 sampled texels and 512/512 float components per run, twice, against a CPU shared-exponent decode. Pixel (108,60) held 0x87251229 and returned exactly (41/256, 137/256, 457/256, 1). The passing control is independently applicable to your PR and runs with cargo test --locked -p victory-gpu --all-features --lib packed_lighting_uav_write_is_visible -- --ignored --nocapture. Direct lighting-path test

The separate fallback test keeps your existing control and adds an opt-in same-list regression that currently fails after checking the next-submission recovery. Fallback reproduction commit

git fetch https://github.com/steven-seagull27/VIctory.git codex/pr3147-format-twin-order
git cherry-pick bc9f2f405de02df83a620ddd8557196d6ab7a707
$env:VICTORY_D3D12_DEBUG = '1'
$env:VICTORY_D3D12_WARP = '0'
cargo test --locked -p victory-gpu --features diagnostics --lib format_twin::tests:: -- --include-ignored --nocapture --test-threads=1

Set VICTORY_D3D12_WARP=1 to repeat on the software adapter. AI-assisted testing with synthetic texture data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7189712493 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7189712493). Originally posted by [steven-seagull27](https://github.com/steven-seagull27) on 2026-11-26T10:41:53Z. --- I found an ordering case in the fallback format twin on `7e641689`. I extended your 8×4 lighting-texture fixture (`R32_UINT` source, `R9G9B9E5` twin) so it reads back both resources. Every texel gets a distinct seed; a second upload flips every bit. Both devices produced the following counts in two fresh processes each, with the D3D12 debug layer enabled. | Ordering | Source with expected bytes | Twin with expected bytes | |---|---:|---:| | Seed written on a previous submission (original control) | 32/32 | 32/32 | | Source rewritten, then twin read later in the **same command list** | 32/32 | **0/32** | | Same resources read again on the next submission | 32/32 | 32/32 | In the middle row all 32 twin texels still contained their own previous seed. This reproduced on the RTX 5080 (621.40) and Windows inbox WARP. It matches the placement of `format_twin::refresh` in the prelude. If a lighting input uses this fallback and its producer writes earlier in that same list, the consumer can read the previous contents. The synthetic fixture uses a texture copy as its producer. **Which path did the descriptor builder actually take?** I also created 853×480 guest textures through the production resource and SRV paths, requested either `R9G9B9E5` or `R32_UINT` as the resource format, and bound an `R9G9B9E5` SRV. I tried UAV and RT+UAV flags for both formats. All four combinations on each adapter bound the original resource with effective SRV format 67, with zero view-creation diagnostics. For the RGB9E5 resource, RTX used a castable R11G11B10 stand-in and WARP kept native RGB9E5. This rules out the fallback-twin ordering issue for those eight descriptor combinations here. A trace showing a lighting input actually binds a different underlying texture would be the discriminator in-game. I then dispatched a typed `R32_UINT` UAV write followed by an `R9G9B9E5` shader read on the **same list**, using those production descriptors. Each adapter matched **128/128 sampled texels and 512/512 float components per run**, twice, against a CPU shared-exponent decode. Pixel `(108,60)` held `0x87251229` and returned exactly `(41/256, 137/256, 457/256, 1)`. The passing control is independently applicable to your PR and runs with `cargo test --locked -p victory-gpu --all-features --lib packed_lighting_uav_write_is_visible -- --ignored --nocapture`. [Direct lighting-path test](https://github.com/steven-seagull27/VIctory/commit/fb329ac85d11be2d3f5b6e2f37e1e8b89caf493b) The separate fallback test keeps your existing control and adds an opt-in same-list regression that currently fails after checking the next-submission recovery. [Fallback reproduction commit](https://github.com/steven-seagull27/VIctory/commit/bc9f2f405de02df83a620ddd8557196d6ab7a707) ```powershell git fetch https://github.com/steven-seagull27/VIctory.git codex/pr3147-format-twin-order git cherry-pick bc9f2f405de02df83a620ddd8557196d6ab7a707 $env:VICTORY_D3D12_DEBUG = '1' $env:VICTORY_D3D12_WARP = '0' cargo test --locked -p victory-gpu --features diagnostics --lib format_twin::tests:: -- --include-ignored --nocapture --test-threads=1 ``` Set `VICTORY_D3D12_WARP=1` to repeat on the software adapter. AI-assisted testing with synthetic texture data.
pickles976 commented 2026-11-26 12:05:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-26T11:10:10Z.


Offscreen verification of 7e64168 on Wine 11.0/Linux 6.17, RTX 4060 Laptop 8 GB (32-lane waves only, like your 5060), NVIDIA 590.48.1, DXVK 3.1.1, Rust 1.98.1. Caveat: locally built diagnostic-relaxed vkd3d-proton 3.2.0 2576c0b4adfae4a+ (assertions disabled, allocator/list from_iface vtable identity checks removed, null checks kept) — not stock-runtime certification. Local edits: the format_twin and a small HRESULT probe test made fail-closed on a missing host (they otherwise return silently); no production changes. One test thread, 9 GiB/512 MiB cgroup scope.

Passing: all 11 emit::wave64_tests pass on the real adapter (split-program dispatch/readback; fresh 6.04 s compile, 1.17 s run), including v_readfirstlane's EXEC-lane fix at the head. format_twin::tests::a_twin_takes_its_textures_bytes_at_submission passes — the R9G9B9E5-of-R32_UINT twin takes the texture's bytes and keeps its format.

pipeline::library::tests: 11/14 under Wine; three failures share one root cause — this host refuses an empty pipeline library. A local probe calling ID3D12Device1::CreatePipelineLibrary directly records:

CreatePipelineLibrary(empty)   -> hr=0x80070057  (E_INVALIDARG)
CreatePipelineLibrary(garbage) -> hr=0x887E0002  (D3D12_ERROR_DRIVER_VERSION_MISMATCH)

vkd3d-proton matches Windows' incompatible-blob semantics (your open fallback arm is reached correctly), but unlike Windows it refuses zero-length data, so the empty-library bootstrap at the end of open always fails here. Failing on that path: a_library_loads_from_a_mapped_file, a_rejected_blob_gives_an_empty_library, pipelines_load_on_many_threads_at_once — all three panic at open(...).expect("an empty library"). mapped_files_round_trip, the generation naming/cleanup tests and a_pipeline_loads_while_a_save_holds_the_library pass (a valid serialized blob does load). Runtime consequence under Wine/vkd3d-proton: first run (or any rejected blob) degrades exactly as your code intends — "no host pipeline library: pipelines are not kept" — so the title still runs, but the memory-mapped cache this PR adds gives no cross-run pipeline reuse on such stacks. On Windows, where you tested, the empty bootstrap succeeds; nothing here contradicts your results. Log verify-pr3147-gates.log / verify-pr3147-library-hr-probe.log (kept locally).

Next for me is a guarded title trial of this branch (720p, Series S mode) — the wave64 split plus your capped view heaps and the null-buffer-view root fallback are exactly the loading-stage blockers I measured on this machine (310,720 title slot past the host heap warnings, three refused compute IDs on the emulation approach). I will report the RAM trajectory and whether the first 3D scene is reached here.

AI use: omp, harness model openai-codex/gpt-6-astra, ran the checks and drafted this report. No upstream code changes or assets attached.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7190365501 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7190365501). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-26T11:10:10Z. --- Offscreen verification of `7e64168` on Wine 11.0/Linux 6.17, RTX 4060 Laptop 8 GB (32-lane waves only, like your 5060), NVIDIA 590.48.1, DXVK 3.1.1, Rust 1.98.1. **Caveat: locally built diagnostic-relaxed vkd3d-proton 3.2.0 `2576c0b4adfae4a+` (assertions disabled, allocator/list `from_iface` vtable identity checks removed, null checks kept) — not stock-runtime certification.** Local edits: the `format_twin` and a small HRESULT probe test made fail-closed on a missing host (they otherwise `return` silently); no production changes. One test thread, 9 GiB/512 MiB cgroup scope. **Passing:** all 11 `emit::wave64_tests` pass on the real adapter (split-program dispatch/readback; fresh 6.04 s compile, 1.17 s run), including `v_readfirstlane`'s EXEC-lane fix at the head. `format_twin::tests::a_twin_takes_its_textures_bytes_at_submission` passes — the R9G9B9E5-of-R32_UINT twin takes the texture's bytes and keeps its format. **`pipeline::library::tests`: 11/14 under Wine; three failures share one root cause — this host refuses an empty pipeline library.** A local probe calling `ID3D12Device1::CreatePipelineLibrary` directly records: ``` CreatePipelineLibrary(empty) -> hr=0x80070057 (E_INVALIDARG) CreatePipelineLibrary(garbage) -> hr=0x887E0002 (D3D12_ERROR_DRIVER_VERSION_MISMATCH) ``` vkd3d-proton matches Windows' incompatible-blob semantics (your `open` fallback arm is reached correctly), but unlike Windows it refuses zero-length data, so the empty-library bootstrap at the end of `open` always fails here. Failing on that path: `a_library_loads_from_a_mapped_file`, `a_rejected_blob_gives_an_empty_library`, `pipelines_load_on_many_threads_at_once` — all three panic at `open(...).expect("an empty library")`. `mapped_files_round_trip`, the generation naming/cleanup tests and `a_pipeline_loads_while_a_save_holds_the_library` pass (a valid serialized blob does load). Runtime consequence under Wine/vkd3d-proton: first run (or any rejected blob) degrades exactly as your code intends — `"no host pipeline library: pipelines are not kept"` — so the title still runs, but the memory-mapped cache this PR adds gives no cross-run pipeline reuse on such stacks. On Windows, where you tested, the empty bootstrap succeeds; nothing here contradicts your results. Log `verify-pr3147-gates.log` / `verify-pr3147-library-hr-probe.log` (kept locally). Next for me is a guarded title trial of this branch (720p, Series S mode) — the wave64 split plus your capped view heaps and the null-buffer-view root fallback are exactly the loading-stage blockers I measured on this machine (310,720 `title slot past the host heap` warnings, three refused compute IDs on the emulation approach). I will report the RAM trajectory and whether the first 3D scene is reached here. AI use: omp, harness model `openai-codex/gpt-6-astra`, ran the checks and drafted this report. No upstream code changes or assets attached.
stem23456-coder commented 2026-11-26 12:05:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by stem23456-coder on 2026-11-26T11:10:42Z.


Following the move from #1960, here is the integration patch, regression shader and CPU probe for the overlap with #2126. The original fix and RTX 5070 Ti test are by @0xkn0wh3r3 in their demo branch.

The patch was prepared on the combined #1960 (fc61f2e) and #2126 (e214ce4) heads. It uses the logical Xbox thread ID in split_ids for both the half and the wave base. In our CPU probe the 32×4 layout went from 64 output slots written twice to all 128 written once, each with (id % 64, 64). The 128×1 and 16×8 controls passed too. Could whichever PR lands second carry the change and regression test? This patch needs both prerequisites and may need rebasing onto the current heads. Earlier verification. AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7190378797 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7190378797). Originally posted by [stem23456-coder](https://github.com/stem23456-coder) on 2026-11-26T11:10:42Z. --- Following the move from #1960, here is the [integration patch, regression shader and CPU probe](https://gist.github.com/stem23456-coder/14a4788ec408364054c33f32789728ca) for the overlap with #2126. The original fix and RTX 5070 Ti test are by @0xkn0wh3r3 in [their demo branch](https://github.com/Marvisak/VIctory/pull/1960#issuecomment-7155260393). The patch was prepared on the combined #1960 (`fc61f2e`) and #2126 (`e214ce4`) heads. It uses the logical Xbox thread ID in `split_ids` for both the half and the wave base. In our CPU probe the 32×4 layout went from 64 output slots written twice to all 128 written once, each with `(id % 64, 64)`. The 128×1 and 16×8 controls passed too. Could whichever PR lands second carry the change and regression test? This patch needs both prerequisites and may need rebasing onto the current heads. [Earlier verification](https://github.com/Marvisak/VIctory/pull/1960#issuecomment-7167770572). AI-assisted with Codex.
pickles976 commented 2026-11-26 12:05:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-26T11:14:51Z.


Follow-up as promised: guarded title trial of 7e64168 on this machine (same Wine/RTX 4060 Laptop 8 GB stack; 16 GiB RAM, cgroup 9 GiB/512 MiB, available-RAM guard floor 2,048 MiB).

Result: stopped by the RAM guard during loading at 112.9 s, 1,757 MiB available (GPU 3,263 MiB) — the loading-stage memory wall on this machine is unchanged by this PR, and the empty-library refusal above means its pipeline-library lever is inert here.

What the run shows:

  • host view heap capped: title slots past the room left read null count=1245184 room=737853 views=1000000 — the cap engages exactly as designed (1,000,000-view host limit probed), and the title's 1,245,184 slots leave 507,331 past the room; those read null, matching the count of title slot past the host heap warnings one-for-one. Cleaner than before (a single explicit line, views accounted), but on a host that caps at 1M views the overflow slots are still null — the paging in #2121 is what would address them.
  • no host pipeline library yet; starting an empty one → no host pipeline library: pipelines are not kept: the runtime consequence of the zero-length CreatePipelineLibrary E_INVALIDARG from my previous comment. First-run behavior is correct-graceful, but on vkd3d-proton every run is a first run: the library is never saved or re-mapped, so this PR's 2.4 GB private-copy savings never materialize on stacks like this one. A warm-cache trial on Windows is where that part pays off.
  • Captures at 45 s and 60 s show GTA VI loading artwork (the trunk/duffle-bag illustration with storefronts); no 3D scene, no menu after. The wall I hit is before the 3D scene your branch reaches: on 16 GiB RAM the title's loading-stage XMemAllocatePhysicalPages/MapViewOfFile3 tmpfs sections (measured at cgroup level: shmem 787→3,980 MiB over 80 s in a prior attribution run) exhaust available RAM before the world. That is not something this PR or #2121 addresses — it is title memory behavior on hosts with half your machine's RAM.

No FPS, world-entry, or input-response claim. Logs kept locally (20261126T111205Z*, captures menu-20261126T1112*.png).

AI use: omp, harness model openai-codex/gpt-6-astra, ran the checks and drafted this report. No upstream code changes or assets attached.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7190478233 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7190478233). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-26T11:14:51Z. --- Follow-up as promised: guarded title trial of `7e64168` on this machine (same Wine/RTX 4060 Laptop 8 GB stack; 16 GiB RAM, cgroup 9 GiB/512 MiB, available-RAM guard floor 2,048 MiB). **Result: stopped by the RAM guard during loading at 112.9 s, 1,757 MiB available (GPU 3,263 MiB) — the loading-stage memory wall on this machine is unchanged by this PR, and the empty-library refusal above means its pipeline-library lever is inert here.** What the run shows: - `host view heap capped: title slots past the room left read null count=1245184 room=737853 views=1000000` — the cap engages exactly as designed (1,000,000-view host limit probed), and the title's 1,245,184 slots leave 507,331 past the room; those read null, matching the count of `title slot past the host heap` warnings one-for-one. Cleaner than before (a single explicit line, views accounted), but on a host that caps at 1M views the overflow slots are still null — the paging in #2121 is what would address them. - `no host pipeline library yet; starting an empty one` → `no host pipeline library: pipelines are not kept`: the runtime consequence of the zero-length `CreatePipelineLibrary` E_INVALIDARG from my previous comment. First-run behavior is correct-graceful, but on vkd3d-proton every run is a first run: the library is never saved or re-mapped, so this PR's 2.4 GB private-copy savings never materialize on stacks like this one. A warm-cache trial on Windows is where that part pays off. - Captures at 45 s and 60 s show GTA VI loading artwork (the trunk/duffle-bag illustration with storefronts); no 3D scene, no menu after. The wall I hit is before the 3D scene your branch reaches: on 16 GiB RAM the title's loading-stage `XMemAllocatePhysicalPages`/`MapViewOfFile3` tmpfs sections (measured at cgroup level: shmem 787→3,980 MiB over 80 s in a prior attribution run) exhaust available RAM before the world. That is not something this PR or #2121 addresses — it is title memory behavior on hosts with half your machine's RAM. No FPS, world-entry, or input-response claim. Logs kept locally (`20261126T111205Z*`, captures `menu-20261126T1112*.png`). AI use: omp, harness model `openai-codex/gpt-6-astra`, ran the checks and drafted this report. No upstream code changes or assets attached.
RaghavVijayanand commented 2026-11-26 12:05:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by RaghavVijayanand on 2026-11-26T11:24:41Z.


@steven-seagull27 thank you. Your same-list case is right: the twin was only refreshed in the submission's prelude, so a write earlier in the same list never reached it. And your second finding agrees with what I saw in the title: in a run with the logging from 372d56f, the lighting textures took the castable view, and no twin was made.

So in 4596ccb the twin is gone. A fallback that misses same-list writes is worse than refusing the view. The castable-view fix (372d56f) stays, along with its once-per-format-pair log of views in a format of another family. I cherry-picked your direct-path test as 0ddd54c, with you as the author. Here it passes on the RTX 5060 Laptop (--ignored, all features).

The CI failure was the wave64_tests: they asserted that some device ran each program, and the runner has no GPU (WARP's 4-lane waves run neither the split nor the WaveSize(64) form). They now print that they skipped, like the other hardware-only tests.

Locally (RTX 5060 Laptop):

  • clippy with and without --all-features: clean.
  • cargo test --workspace: passes, except stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride, stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros and synthetic_tests::gathers_at_a_level_match_the_hardware. All three fail the same way on unmodified main 63bcca4 here, which I re-checked just now.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7190690306 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7190690306). Originally posted by [RaghavVijayanand](https://github.com/RaghavVijayanand) on 2026-11-26T11:24:41Z. --- @steven-seagull27 thank you. Your same-list case is right: the twin was only refreshed in the submission's prelude, so a write earlier in the same list never reached it. And your second finding agrees with what I saw in the title: in a run with the logging from 372d56f, the lighting textures took the castable view, and no twin was made. So in 4596ccb the twin is gone. A fallback that misses same-list writes is worse than refusing the view. The castable-view fix (372d56f) stays, along with its once-per-format-pair log of views in a format of another family. I cherry-picked your direct-path test as 0ddd54c, with you as the author. Here it passes on the RTX 5060 Laptop (`--ignored`, all features). The CI failure was the `wave64_tests`: they asserted that some device ran each program, and the runner has no GPU (WARP's 4-lane waves run neither the split nor the WaveSize(64) form). They now print that they skipped, like the other hardware-only tests. Locally (RTX 5060 Laptop): - clippy with and without `--all-features`: clean. - `cargo test --workspace`: passes, except `stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride`, `stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` and `synthetic_tests::gathers_at_a_level_match_the_hardware`. All three fail the same way on unmodified `main` 63bcca4 here, which I re-checked just now.
RaghavVijayanand commented 2026-11-26 13:04:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by RaghavVijayanand on 2026-11-26T12:40:59Z.


@stem23456-coder @0xkn0wh3r3: done. This PR now carries both, so it is the "second to land" you asked about:

  • 0167517: #2126's three commits (console_flat, the LDS rounding, the thread_ids module) as one commit, with @0xkn0wh3r3 as author. They are squashed because the first one alone takes lower.rs past the 512 KiB limit. Conflicts: Lower::thread_id takes console_flat, as you resolved it. Host::wave_lanes is #2126's Result version, which the split's tests now unwrap. Both test-only Lowered fields are kept. If #2126 lands first, this commit drops out on a rebase.
  • 2eb38bb: the split_ids fix (half and wave base from console_flat), with @0xkn0wh3r3 as author and @stem23456-coder as co-author, plus the 128x1 / 16x8 / 32x4 regression test as lane_order_tests::a_wave64_program_runs_as_the_console_runs_it_on_a_32_lane_host. synthetic_tests::lowered_for is from the patch. I left out the patch's comment and flag cleanups in lower.rs to stay under the size limit; they do not change behaviour.

On an RTX 5060 Laptop, the new test fails at 32x4 without the split_ids change and passes with it, so this card tiles 32x4 groups too. All 11 wave64_tests, the lane_order_tests and #2126's own tests pass.

Workspace tests: 313 of 316 in victory-shader; the other crates all pass. The three failures are the ones that also fail on unmodified main here (stride_tests::a_heap_buffer_*, gathers_at_a_level_match_the_hardware). Clippy is clean with and without --all-features, and the asset policy passes.

@pickles976: thanks for the Wine run. The empty-library refusal is real, and it predates this PR (main's open makes the same empty library). I'll look at starting without an empty library in a separate change, so vkd3d-proton stacks keep pipelines across runs too.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7192321601 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7192321601). Originally posted by [RaghavVijayanand](https://github.com/RaghavVijayanand) on 2026-11-26T12:40:59Z. --- @stem23456-coder @0xkn0wh3r3: done. This PR now carries both, so it is the "second to land" you asked about: - **0167517:** #2126's three commits (`console_flat`, the LDS rounding, the `thread_ids` module) as one commit, with @0xkn0wh3r3 as author. They are squashed because the first one alone takes `lower.rs` past the 512 KiB limit. Conflicts: `Lower::thread_id` takes `console_flat`, as you resolved it. `Host::wave_lanes` is #2126's `Result` version, which the split's tests now unwrap. Both test-only `Lowered` fields are kept. If #2126 lands first, this commit drops out on a rebase. - **2eb38bb:** the `split_ids` fix (half and wave base from `console_flat`), with @0xkn0wh3r3 as author and @stem23456-coder as co-author, plus the 128x1 / 16x8 / 32x4 regression test as `lane_order_tests::a_wave64_program_runs_as_the_console_runs_it_on_a_32_lane_host`. `synthetic_tests::lowered_for` is from the patch. I left out the patch's comment and flag cleanups in `lower.rs` to stay under the size limit; they do not change behaviour. On an RTX 5060 Laptop, **the new test fails at 32x4 without the `split_ids` change and passes with it**, so this card tiles 32x4 groups too. All 11 `wave64_tests`, the `lane_order_tests` and #2126's own tests pass. Workspace tests: 313 of 316 in `victory-shader`; the other crates all pass. The three failures are the ones that also fail on unmodified `main` here (`stride_tests::a_heap_buffer_*`, `gathers_at_a_level_match_the_hardware`). Clippy is clean with and without `--all-features`, and the asset policy passes. @pickles976: thanks for the Wine run. The empty-library refusal is real, and it predates this PR (`main`'s `open` makes the same empty library). I'll look at starting without an empty library in a separate change, so vkd3d-proton stacks keep pipelines across runs too.
lhnizdo commented 2026-11-26 15:02:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-26T14:23:43Z.


@RaghavVijayanand, an offer for this PR's split, in case you'd like it: lhnizdo:pr/first-lane-scalars, one commit (809c945) on top of this PR's head 2eb38bb.

What it does: the split refuses v_readfirstlane_b32 in a block not every thread reaches (NOT_EVERY_THREAD), because the read goes through the halves' exchange. The title often does this for values that are the same in every lane: spilled SGPRs combined as v_sub_f32 v, s, s and read back into an SGPR inside a lane branch, or an integer division's reciprocal of a scalar. Its cloud program 8b9483919d8d5e99 is refused for 23 such reads.

The commit follows the value back. If it was made by lane-wise arithmetic, selects and compares of scalars and constants only, with each step either earlier in the block with no EXEC write in between, or unguarded in a dominating block, then every lane active at the read holds it, and the read is the lane's own. No exchange, no sync.

Where it lives: in a new lower/uniform.rs, with 6 lines in lower.rs, because lower.rs is 343 bytes from the asset policy's limit on this head.

Test: wave64_tests::a_first_lane_read_of_scalars_in_a_lane_branch_needs_no_exchange. A spill, then the read in a lane branch of one console wave.

  • Without the change, the split refuses the program.
  • With it, it's taken with 0 group syncs and gives the console's values on an RTX 2080 (32-lane waves).
  • The other wave64 tests pass.

The hardware run needs the Agility SDK in the test binary, which #2878 does; without it the GPU part skips here.

On a local stack (this split plus more of mine on top, so not this branch exactly):

  • 7 of the title's 2,527 compute programs no longer need a fallback, and none stopped translating.
  • The cloud program's submissions on the RTX 2080 went from about 12 s to normal.

Take it, change it, or leave it, whatever suits the PR.

AI-assisted (Claude Code); tests on my machine. No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7194758531 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7194758531). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-26T14:23:43Z. --- @RaghavVijayanand, an offer for this PR's split, in case you'd like it: [`lhnizdo:pr/first-lane-scalars`](https://github.com/lhnizdo/VIctory/tree/pr/first-lane-scalars), one commit (`809c945`) on top of this PR's head `2eb38bb`. **What it does:** the split refuses `v_readfirstlane_b32` in a block not every thread reaches (`NOT_EVERY_THREAD`), because the read goes through the halves' exchange. The title often does this for values that are the same in every lane: spilled SGPRs combined as `v_sub_f32 v, s, s` and read back into an SGPR inside a lane branch, or an integer division's reciprocal of a scalar. Its cloud program `8b9483919d8d5e99` is refused for 23 such reads. The commit follows the value back. If it was made by lane-wise arithmetic, selects and compares of scalars and constants only, with each step either earlier in the block with no EXEC write in between, or unguarded in a dominating block, then every lane active at the read holds it, and the read is the lane's own. No exchange, no sync. **Where it lives:** in a new `lower/uniform.rs`, with 6 lines in `lower.rs`, because `lower.rs` is 343 bytes from the asset policy's limit on this head. **Test:** `wave64_tests::a_first_lane_read_of_scalars_in_a_lane_branch_needs_no_exchange`. A spill, then the read in a lane branch of one console wave. - Without the change, the split refuses the program. - With it, it's taken with 0 group syncs and gives the console's values on an RTX 2080 (32-lane waves). - The other wave64 tests pass. The hardware run needs the Agility SDK in the test binary, which #2878 does; without it the GPU part skips here. **On a local stack** (this split plus more of mine on top, so not this branch exactly): - 7 of the title's 2,527 compute programs no longer need a fallback, and none stopped translating. - The cloud program's submissions on the RTX 2080 went from about 12 s to normal. Take it, change it, or leave it, whatever suits the PR. AI-assisted (Claude Code); tests on my machine. No game data.
Kajanos commented 2026-11-26 16:06:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Kajanos on 2026-11-26T16:06:05Z.


Windows 11 / RTX 5080 (32-lane waves) world run of this branch: the wave64 split removes the ~2.3 s loop-cap submissions with the default loop limit. VICTORY_WAVE64_APPROX=1 crashed at world load.

Setup: Windows 11 Home build 26300, RTX 5080 16 GB, NVIDIA 621.40, Ryzen 9 9950X3D (with its Radeon iGPU beside the RTX), 64 GB. Retail 1.0.2.1, default console (Series X). Head 7e64168 as is (on main 63bcca4), --profile diag --features diagnostics. translate --cache --pipelines was run on the desktop before each mode. The title was played by hand to the same spot in the world, about 3 minutes there per run.

Startup: host adapter (high performance) adapter="NVIDIA GeForce RTX 5080", host wave lanes min=32 max=32 wave64=false. The adapter choice works on this two-GPU box.

Build (same machine, same save) World GPU ms/frame Slow host submissions
main 63bcca4 black screen, stuck after frame 1 (heap capped, no room for the null buffer views) – –
main + #2461 + 2^18 dynamic slots, loop limit 2^20 0.4–0.6 fps ~2,700 57, nearly all 2,331–2,339 ms
same, diag, VICTORY_SHADER_LOOP_LIMIT=4096 ~3.1 fps ~200 0
this PR, default loop limit 2.7–2.9 fps 190–235 18–24, 264–915 ms
this PR, VICTORY_WAVE64_APPROX=1 crash at world load (below) – –

Plain mode (no approx)

  • translate: 543 of 25,985 shader containers refused. Pipelines: the host refuses it 397 → 1, compute shader does not translate 24 → 333.
  • At runtime, 148 programs are dropped as not translating. 77: LDS shared without barriers by a wave64 group of 33 to 64 threads. 65: a wave64 cross-lane operation spanning both halves. 2: a lane mask read as data. 1 each: v_permlanex16_b32, barycentrics read directly, a descriptor read only as data, a 16-bit wave reduction in a wave64 program.
  • A typical frame at the spot: 2.6 fps, 387.4 ms/frame (114.3 preparing: copies 74.6 ms 436.3 MB …; 234.9 on the GPU; 35.7 copying back), about 3,000 draws/frame, dropped 337 without a host pipeline … and 67 indirect. Task Manager shows the GPU at 50–60%.
  • 0 ERROR lines, no device removal, no crashes.log. Clean exit on closing the window.

GPU timing (VICTORY_GPU_TIMING=1 + VICTORY_D3D12_DRED=1, plain mode, default loop limit): lists 189.1 ms/frame of wall time, their commands 173.2 ms/frame. Top programs by average ms per frame:

Program Kind This PR, limit 2^20 #2461 + 2^18, limit 4096
compute 0184869d6e47e5fa indirect kind 2 38.1 37.9
compute 5552dac6a2b7a1fd dispatch 25.6 –
compute ce30cb330ef34306 indirect kind 2 17.9 20.8
compute c7feccae4e01e454 indirect kind 2 38.1 (10 of 43 frames) 35.2
compute 3b90165a77d95cdf dispatch 13.0 –
compute 512416d975ace48b dispatch 6.8 6.6
mesh 857b2e13c9cc107f + pixel 63051e97862e7dad mesh 6.3 4.0
compute 00167d58cc5a78d7 dispatch 5.1 4.7

With the default limit, the three indirect programs (0184869d, ce30cb33, c7feccae, also in #71 / #898 / #1465) now cost what they cost on the other build at a 4096 cap, so they no longer run to the cap. Together they are still about half of the frame's GPU command time. 5552dac6 and 3b90165a are new in the ranking. I have not checked whether they are programs this PR splits.

VICTORY_WAVE64_APPROX=1

  • translate: 229 containers refused (plain: 543), pipelines compute shader does not translate 24.
  • The menu ran at ~28–30 fps. At world load the process died with unhandled exception 0xc0000005 at victory-image-…dll+0x23cf683 (write 0x0: nothing mapped there), on a thread that starts from KERNEL32 (title code, not VIctory).
  • It came right after first bind … stage=compute … hash=c06aa62112ffba4c. In the 100 ms before it, a burst of refused buffer view: empty or past its copy start=0x0 first=0 count=0 element=4, one unordered buffer view empty or past its host copy, and one a shader view in a format of another family than its host texture. GPU load showed 100% around that time, unlike plain mode.
  • One run only. Plain mode with the same build and save loads the world every time, so this looks approx-specific (an approximated program writing data the title uses as a pointer). That is not verified, and c06aa621 is only the program bound at that frame.

Not run: cargo test on this head, VICTORY_WAVE64_LOOPS other than the default, a second approx run.

AI-assisted (Claude Code)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7197181357 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7197181357). Originally posted by [Kajanos](https://github.com/Kajanos) on 2026-11-26T16:06:05Z. --- **Windows 11 / RTX 5080 (32-lane waves) world run of this branch: the wave64 split removes the ~2.3 s loop-cap submissions with the default loop limit. `VICTORY_WAVE64_APPROX=1` crashed at world load.** Setup: Windows 11 Home build 26300, RTX 5080 16 GB, NVIDIA 621.40, Ryzen 9 9950X3D (with its Radeon iGPU beside the RTX), 64 GB. Retail 1.0.2.1, default console (Series X). Head `7e64168` as is (on `main` `63bcca4`), `--profile diag --features diagnostics`. `translate --cache --pipelines` was run on the desktop before each mode. The title was played by hand to the same spot in the world, about 3 minutes there per run. Startup: `host adapter (high performance) adapter="NVIDIA GeForce RTX 5080"`, `host wave lanes min=32 max=32 wave64=false`. The adapter choice works on this two-GPU box. | Build (same machine, same save) | World | GPU ms/frame | Slow host submissions | |---|---|---|---| | `main` `63bcca4` | black screen, stuck after frame 1 (heap capped, `no room for the null buffer views`) | – | – | | `main` + #2461 + 2^18 dynamic slots, loop limit 2^20 | 0.4–0.6 fps | ~2,700 | 57, nearly all 2,331–2,339 ms | | same, diag, `VICTORY_SHADER_LOOP_LIMIT=4096` | ~3.1 fps | ~200 | 0 | | **this PR, default loop limit** | **2.7–2.9 fps** | **190–235** | 18–24, 264–915 ms | | this PR, `VICTORY_WAVE64_APPROX=1` | crash at world load (below) | – | – | **Plain mode (no approx)** - `translate`: 543 of 25,985 shader containers refused. Pipelines: `the host refuses it` 397 → 1, `compute shader does not translate` 24 → 333. - At runtime, 148 programs are dropped as not translating. 77: `LDS shared without barriers by a wave64 group of 33 to 64 threads`. 65: `a wave64 cross-lane operation spanning both halves`. 2: `a lane mask read as data`. 1 each: `v_permlanex16_b32`, barycentrics read directly, a descriptor read only as data, a 16-bit wave reduction in a wave64 program. - A typical frame at the spot: `2.6 fps, 387.4 ms/frame (114.3 preparing: copies 74.6 ms 436.3 MB …; 234.9 on the GPU; 35.7 copying back)`, about 3,000 draws/frame, `dropped 337 without a host pipeline … and 67 indirect`. Task Manager shows the GPU at 50–60%. - 0 ERROR lines, no device removal, no `crashes.log`. Clean exit on closing the window. **GPU timing** (`VICTORY_GPU_TIMING=1` + `VICTORY_D3D12_DRED=1`, plain mode, default loop limit): `lists 189.1 ms/frame of wall time, their commands 173.2 ms/frame`. Top programs by average ms per frame: | Program | Kind | This PR, limit 2^20 | #2461 + 2^18, limit 4096 | |---|---|---:|---:| | compute `0184869d6e47e5fa` | indirect kind 2 | 38.1 | 37.9 | | compute `5552dac6a2b7a1fd` | dispatch | 25.6 | – | | compute `ce30cb330ef34306` | indirect kind 2 | 17.9 | 20.8 | | compute `c7feccae4e01e454` | indirect kind 2 | 38.1 (10 of 43 frames) | 35.2 | | compute `3b90165a77d95cdf` | dispatch | 13.0 | – | | compute `512416d975ace48b` | dispatch | 6.8 | 6.6 | | mesh `857b2e13c9cc107f` + pixel `63051e97862e7dad` | mesh | 6.3 | 4.0 | | compute `00167d58cc5a78d7` | dispatch | 5.1 | 4.7 | With the default limit, the three indirect programs (`0184869d`, `ce30cb33`, `c7feccae`, also in #71 / #898 / #1465) now cost what they cost on the other build at a 4096 cap, so they no longer run to the cap. Together they are still about half of the frame's GPU command time. `5552dac6` and `3b90165a` are new in the ranking. I have not checked whether they are programs this PR splits. **`VICTORY_WAVE64_APPROX=1`** - `translate`: 229 containers refused (plain: 543), pipelines `compute shader does not translate` 24. - The menu ran at ~28–30 fps. At world load the process died with `unhandled exception 0xc0000005 at victory-image-…dll+0x23cf683 (write 0x0: nothing mapped there)`, on a thread that starts from `KERNEL32` (title code, not VIctory). - It came right after `first bind … stage=compute … hash=c06aa62112ffba4c`. In the 100 ms before it, a burst of `refused buffer view: empty or past its copy start=0x0 first=0 count=0 element=4`, one `unordered buffer view empty or past its host copy`, and one `a shader view in a format of another family than its host texture`. GPU load showed 100% around that time, unlike plain mode. - One run only. Plain mode with the same build and save loads the world every time, so this looks approx-specific (an approximated program writing data the title uses as a pointer). That is not verified, and `c06aa621` is only the program bound at that frame. Not run: `cargo test` on this head, `VICTORY_WAVE64_LOOPS` other than the default, a second approx run. AI-assisted (Claude Code)
Kajanos commented 2026-11-26 16:32:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Kajanos on 2026-11-26T16:32:31Z.


Follow-up at 2eb38bb, same machine as my earlier comment (Windows 11 Home build 26300, RTX 5080, NVIDIA 621.40): plain mode is unchanged, and the VICTORY_WAVE64_APPROX=1 crash reproduces at the same address.

Head 2eb38bb as is, on main 63bcca4, diag build, fresh translate --cache --pipelines per mode on the desktop. Same save and spot as before.

Plain mode (with VICTORY_GPU_TIMING=1 + VICTORY_D3D12_DRED=1)

  • translate gives the same counts as 7e64168: 543 of 25,985 containers refused; pipelines skipped as compute shader does not translate 333, the host refuses it 1. The same 148 programs are dropped at runtime, for the same reasons.
  • World: 2.5–2.6 fps, ~383–393 ms/frame, ~237 ms on the GPU, preparing 110–120 ms (copies 61–70 ms, 408–428 MB/frame). lists 184.7 ms/frame of wall time, their commands 168.7 ms/frame.
  • Top programs, avg ms per frame at 2eb38bb [7e64168]: compute 0184869d6e47e5fa 35.9 [38.1], 5552dac6a2b7a1fd 31.4 [25.6], ce30cb330ef34306 18.0 [17.9], c7feccae4e01e454 37.5 [38.1], 3b90165a77d95cdf 16.5 [13.0].
  • 0 ERROR lines, no device removal, no crashes.log, clean exit.

VICTORY_WAVE64_APPROX=1: the crash at world load reproduces. The menu runs at ~22–30 fps, then:

unhandled exception 0xc0000005 at victory-image-…dll+0x23cf683 (write 0x0: nothing mapped there)
rax 0x0 rbx 0x0 rcx 0xd0024c348 rdx 0x1 … rbp 0x0
r8 0xd074d8c40 r9 0xd074d8e20 r10 0xd074d8ad8 r11 0xd074d8c40 …
#0 +0x23cf683  #1 +0x2215c35  #2 +0x2215eca  #3 KERNEL32+0x2dda7  #4 ntdll+0xc9c5c
  • The address, the stack and rcx/r8–r11 are identical to the 7e64168 run. Only the stack and heap pointers differ.
  • In the ~2 s before it, there is the same burst: 199× refused buffer view: empty or past its copy start=0x0 first=0 count=0 element=4, 1× unordered buffer view empty or past its host copy, 2× a shader view in a format of another family than its host texture.
  • The crash frame (1120 → 1213) and the compute programs bound just before it differ between the two runs, so the last-bound program is not a lead.
  • So the thread-id and half-pairing fixes in 0167517/2eb38bb don't change it. It still looks like an approximated program writing data the title later dereferences, but which program is not known. Not tried: VICTORY_WAVE64_LOOPS other than the default, or narrowing the approximated set.

AI-assisted (Claude Code)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7197779969 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7197779969). Originally posted by [Kajanos](https://github.com/Kajanos) on 2026-11-26T16:32:31Z. --- **Follow-up at `2eb38bb`, same machine as [my earlier comment](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7197181357) (Windows 11 Home build 26300, RTX 5080, NVIDIA 621.40): plain mode is unchanged, and the `VICTORY_WAVE64_APPROX=1` crash reproduces at the same address.** Head `2eb38bb` as is, on `main` `63bcca4`, diag build, fresh `translate --cache --pipelines` per mode on the desktop. Same save and spot as before. **Plain mode (with `VICTORY_GPU_TIMING=1` + `VICTORY_D3D12_DRED=1`)** - `translate` gives the same counts as `7e64168`: 543 of 25,985 containers refused; pipelines skipped as `compute shader does not translate` 333, `the host refuses it` 1. The same 148 programs are dropped at runtime, for the same reasons. - World: 2.5–2.6 fps, ~383–393 ms/frame, ~237 ms on the GPU, preparing 110–120 ms (copies 61–70 ms, 408–428 MB/frame). `lists 184.7 ms/frame of wall time, their commands 168.7 ms/frame`. - Top programs, avg ms per frame at `2eb38bb` [`7e64168`]: compute `0184869d6e47e5fa` 35.9 [38.1], `5552dac6a2b7a1fd` 31.4 [25.6], `ce30cb330ef34306` 18.0 [17.9], `c7feccae4e01e454` 37.5 [38.1], `3b90165a77d95cdf` 16.5 [13.0]. - 0 ERROR lines, no device removal, no `crashes.log`, clean exit. **`VICTORY_WAVE64_APPROX=1`**: the crash at world load reproduces. The menu runs at ~22–30 fps, then: ``` unhandled exception 0xc0000005 at victory-image-…dll+0x23cf683 (write 0x0: nothing mapped there) rax 0x0 rbx 0x0 rcx 0xd0024c348 rdx 0x1 … rbp 0x0 r8 0xd074d8c40 r9 0xd074d8e20 r10 0xd074d8ad8 r11 0xd074d8c40 … #0 +0x23cf683 #1 +0x2215c35 #2 +0x2215eca #3 KERNEL32+0x2dda7 #4 ntdll+0xc9c5c ``` - The address, the stack and `rcx`/`r8`–`r11` are identical to the `7e64168` run. Only the stack and heap pointers differ. - In the ~2 s before it, there is the same burst: 199× `refused buffer view: empty or past its copy start=0x0 first=0 count=0 element=4`, 1× `unordered buffer view empty or past its host copy`, 2× `a shader view in a format of another family than its host texture`. - The crash frame (1120 → 1213) and the compute programs bound just before it differ between the two runs, so the last-bound program is not a lead. - So the thread-id and half-pairing fixes in `0167517`/`2eb38bb` don't change it. It still looks like an approximated program writing data the title later dereferences, but which program is not known. Not tried: `VICTORY_WAVE64_LOOPS` other than the default, or narrowing the approximated set. AI-assisted (Claude Code)
lhnizdo commented 2026-11-26 17:11:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-26T17:11:41Z.


@RaghavVijayanand, a second idea for this PR's split, from the same local stack as the first-lane offer, in case it fits. No branch yet: on this head it needs rebuilding around VICTORY_WAVE64_APPROX, and I'd rather ask first whether you want it here.

The case: a group of one console wave (33 to 64 threads) that the split refuses with NOT_EVERY_THREAD. In the title most of those programs use the console compiler's atomic optimizer inside a lane branch: a lane count (s_bcnt1 of EXEC) or a sum over the wave (DPP, v_permlanex16, v_readlane …, 32), one atomic by the first lane (s_ff1 + v_cmpx_eq against the v_mbcnt rank), and each lane's slot = the returned base + its rank. The split can't exchange there.

What I do with them: run each half as a wave of its own, lowered exactly as a group of 32 threads is today (no split, WaveSize(32)), with v_readlane of a constant lane ≥ 32 reading 0. HLSL's wave operations hold for any wave size, so this is the program as it would run on 32-lane hardware. Per half, each half takes its own slots with its own atomic, and every lane still gets a unique one. The order between the halves differs, but that was never fixed between waves anyway.

Only where that's safe: a classification over the IR (per_half_ok):

  • Values computed over lanes (counts, first lanes, sums, readlanes) may only flow into an atomic's data (combining ops only: add, sub, and, or, xor, min, max) or into choosing the lane that does it.
  • An atomic's result, plus ranks, counts as a slot and may go anywhere.
  • Refused: a value over lanes that is stored, used as an address or an atomic's address, or that decides a branch or EXEC. LDS anywhere is refused too.
  • Accepted as each lane's own: waterfall reads and tests (res.waterfall); a first-lane read used only as a scalar load's address (a resource index HLSL holds alike in the wave); and the first-lane reads of values made of scalars (the other offer).

Measured on the local stack:

  • Census of the title's 2,527 compute programs: 28 run per half, none stopped translating.
  • In the world on an RTX 2080, the three costliest programs on the GPU all used it: 9d1d228b02e56a96 (457 ms a frame), 2809db6c31de483d (245 ms) and 73ac67482f6b6a5d (131 ms). After, each was under 9.4 ms, below the GPU timing's top 25. GPU time went from about 1.67 s to 0.97 s a frame, frame time from 3.6 to 1.8 s (one run each; the GPU part is the steady one).

Tests, all on hand-encoded GFX10, run on an RTX 2080:

  • The atomic optimizer in a lane branch of one console wave: per half, the counter ends at 40 and slots 1–40 hold 1–40 in any order.
  • A stored lane count is not run per half.
  • A first-lane resource index keeps a program per half; the same value stored does not.
  • A wave64 waterfall over table entries, alone (the split) and beside the atomic optimizer (per half), with each lane loading from its own buffer.

On this PR it would be an alternative to VICTORY_WAVE64_APPROX for the programs the classification accepts: exact by HLSL's rules where approx can be wrong. If that's of interest, I can port it onto this head as a branch.

AI-assisted (Claude Code); runs on my machine. No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7198633522 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7198633522). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-26T17:11:41Z. --- @RaghavVijayanand, a second idea for this PR's split, from the same local stack as the first-lane offer, in case it fits. No branch yet: on this head it needs rebuilding around `VICTORY_WAVE64_APPROX`, and I'd rather ask first whether you want it here. **The case:** a group of one console wave (33 to 64 threads) that the split refuses with `NOT_EVERY_THREAD`. In the title most of those programs use the console compiler's **atomic optimizer** inside a lane branch: a lane count (`s_bcnt1` of EXEC) or a sum over the wave (DPP, `v_permlanex16`, `v_readlane …, 32`), one atomic by the first lane (`s_ff1` + `v_cmpx_eq` against the `v_mbcnt` rank), and each lane's slot = the returned base + its rank. The split can't exchange there. **What I do with them:** run each half as a wave of its own, lowered exactly as a group of 32 threads is today (no split, `WaveSize(32)`), with `v_readlane` of a constant lane ≥ 32 reading 0. HLSL's wave operations hold for any wave size, so this is the program as it would run on 32-lane hardware. Per half, each half takes its own slots with its own atomic, and every lane still gets a unique one. The order between the halves differs, but that was never fixed between waves anyway. **Only where that's safe:** a classification over the IR (`per_half_ok`): - Values computed over lanes (counts, first lanes, sums, readlanes) may only flow into an atomic's data (combining ops only: add, sub, and, or, xor, min, max) or into choosing the lane that does it. - An atomic's result, plus ranks, counts as a slot and may go anywhere. - Refused: a value over lanes that is stored, used as an address or an atomic's address, or that decides a branch or EXEC. LDS anywhere is refused too. - Accepted as each lane's own: waterfall reads and tests (`res.waterfall`); a first-lane read used only as a scalar load's address (a resource index HLSL holds alike in the wave); and the first-lane reads of values made of scalars (the other offer). **Measured on the local stack:** - Census of the title's 2,527 compute programs: 28 run per half, none stopped translating. - In the world on an RTX 2080, the three costliest programs on the GPU all used it: `9d1d228b02e56a96` (457 ms a frame), `2809db6c31de483d` (245 ms) and `73ac67482f6b6a5d` (131 ms). After, each was under 9.4 ms, below the GPU timing's top 25. GPU time went from about 1.67 s to 0.97 s a frame, frame time from 3.6 to 1.8 s (one run each; the GPU part is the steady one). **Tests,** all on hand-encoded GFX10, run on an RTX 2080: - The atomic optimizer in a lane branch of one console wave: per half, the counter ends at 40 and slots 1–40 hold 1–40 in any order. - A stored lane count is not run per half. - A first-lane resource index keeps a program per half; the same value stored does not. - A wave64 waterfall over table entries, alone (the split) and beside the atomic optimizer (per half), with each lane loading from its own buffer. On this PR it would be an alternative to `VICTORY_WAVE64_APPROX` for the programs the classification accepts: exact by HLSL's rules where approx can be wrong. If that's of interest, I can port it onto this head as a branch. AI-assisted (Claude Code); runs on my machine. No game data.
pickles976 commented 2026-11-26 19:16:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-26T19:16:05Z.


Wine follow-through: mmap library works with #1722's cold-bootstrap fix

Mixed integration, not an exact PR-head result: 2eb38bb1185f1b1b077da398b8e435787c0c6356 plus only #1722 ee84a44859d4384ea5b945fa59e09ad9f9ac8d61's explicit-null empty-library creation block in production. Kept this PR's Blob::Mapped ownership and generation logic unchanged. Separate local checkout VIctory-pr3147-cache; the earlier dirty checkout was not switched or overwritten.

pipeline::library::tests::: 14 passed, 0 failed/ignored, 0.89 s after fresh8.25s compilation of the intended GPU crate and local dependencies:

cargo test --locked --target x86_64-pc-windows-msvc -p victory-gpu --lib pipeline::library::tests:: -- --nocapture --test-threads=1

Local test-only strengthening:

  • Six absent-device/library/compiler returns now panic, so those paths cannot silently pass.
  • The concurrent fixture still builds/stores48 synthetic compute PSOs, but now serializes the populated library directly into a writable file mapping, flushes/drops that mapping, opens a read-only mapping, and passes Blob::Mapped to open. It asserts the mapping was accepted rather than rejected into an empty library, retains the Library owner during all operations, then runs the original eight-thread matching/mismatched/missing-entry checks and adds48 more entries. All96 eventual loads pass. This extends the existing mapped-file fixture, which only round-trips an empty library.
  • a_pipeline_loads_while_a_save_holds_the_library also executes successfully with a real library required; it is no longer able to pass by returning because Wine bootstrap failed.

Host: physical NVIDIA RTX4060 Laptop8GiB, driver590.48.1; Linux/Wine11.0, Rust1.98.1 Windows MSVC target, vendor masking disabled. Diagnostic-relaxed vkd3d-proton3.2.0 2576c0b4adfae4a+, not stock-driver certification. Single test thread,9GiB memory/512MiB swap scope,180s timeout. Evidence: .compat-runtime/logs/verify-pr3147-pr1722-wine-mapped-library.log.

This clears the previously observed Wine empty-library prerequisite for the mapped-cache path in this disclosed combination. I did not rerun the unchanged empty-blob failure. No title launch, shader dispatch, new wave64/lighting validation, large-cache resident-memory measurement, or demonstrated loading-RAM improvement. The earlier loading guard stop remains valid; the author's2.4GB saving is not a measurement from this laptop. Suggested integration: carry the owner #1722 bootstrap fix and retain a populated mapped-library regression, rather than relying only on empty-library roundtrips.

Separate diagnostic lead for the reported approx-mode crash

@Kajanos: the +0x2215c35 / +0x2215eca frames in your follow-up deserve checking before attributing +0x23cf683 to an arbitrary corrupted pointer. On our retail1.0.2.1 executable, bounded static analysis of the unchanged code at +0x2215c35 identifies an explicit absolute-null store followed by INT3, reached by the title's job-system watchdog (unchanged-heartbeat countdown or a separate timed-entry fatal route). Our XCL minidump also has the worker-pool frames; details are in the existing report.

[INFERENCE] The shared watchdog frames make a stall-triggered deliberate crash a lead for your Windows approx-mode report too; they do not establish identical causality or prove what +0x23cf683 does in your prepared image. Please inspect the crash context/minidump and heartbeat/worker state before treating the final null write as evidence of an approximated shader manufacturing a bad pointer. I did not reproduce your crash or enable approximation, and this is not a claim that VIctory and XCL have the same underlying stall.

AI-assisted verification/source review (OpenAI GPT-6 Astra).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7201387561 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7201387561). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-26T19:16:05Z. --- ### Wine follow-through: mmap library works with #1722's cold-bootstrap fix **Mixed integration, not an exact PR-head result:** `2eb38bb1185f1b1b077da398b8e435787c0c6356` plus only #1722 `ee84a44859d4384ea5b945fa59e09ad9f9ac8d61`'s explicit-null empty-library creation block in production. Kept this PR's `Blob::Mapped` ownership and generation logic unchanged. Separate local checkout `VIctory-pr3147-cache`; the earlier dirty checkout was not switched or overwritten. `pipeline::library::tests::`: **14 passed, 0 failed/ignored**, 0.89 s after fresh8.25s compilation of the intended GPU crate and local dependencies: ```text cargo test --locked --target x86_64-pc-windows-msvc -p victory-gpu --lib pipeline::library::tests:: -- --nocapture --test-threads=1 ``` Local test-only strengthening: - Six absent-device/library/compiler returns now panic, so those paths cannot silently pass. - The concurrent fixture still builds/stores48 synthetic compute PSOs, but now **serializes the populated library directly into a writable file mapping**, flushes/drops that mapping, opens a read-only mapping, and passes `Blob::Mapped` to `open`. It asserts the mapping was accepted rather than rejected into an empty library, retains the `Library` owner during all operations, then runs the original eight-thread matching/mismatched/missing-entry checks and adds48 more entries. All96 eventual loads pass. This extends the existing mapped-file fixture, which only round-trips an empty library. - `a_pipeline_loads_while_a_save_holds_the_library` also executes successfully with a real library required; it is no longer able to pass by returning because Wine bootstrap failed. Host: physical NVIDIA RTX4060 Laptop8GiB, driver590.48.1; Linux/Wine11.0, Rust1.98.1 Windows MSVC target, vendor masking disabled. Diagnostic-relaxed vkd3d-proton3.2.0 `2576c0b4adfae4a+`, **not stock-driver certification**. Single test thread,9GiB memory/512MiB swap scope,180s timeout. Evidence: `.compat-runtime/logs/verify-pr3147-pr1722-wine-mapped-library.log`. This clears the previously observed Wine empty-library prerequisite for the mapped-cache path **in this disclosed combination**. I did not rerun the unchanged empty-blob failure. No title launch, shader dispatch, new wave64/lighting validation, large-cache resident-memory measurement, or demonstrated loading-RAM improvement. The earlier loading guard stop remains valid; the author's2.4GB saving is not a measurement from this laptop. Suggested integration: carry the owner #1722 bootstrap fix and retain a populated mapped-library regression, rather than relying only on empty-library roundtrips. ### Separate diagnostic lead for the reported approx-mode crash @Kajanos: the `+0x2215c35` / `+0x2215eca` frames in your follow-up deserve checking before attributing `+0x23cf683` to an arbitrary corrupted pointer. On our retail1.0.2.1 executable, bounded static analysis of the unchanged code at `+0x2215c35` identifies an **explicit absolute-null store followed by INT3**, reached by the title's job-system watchdog (unchanged-heartbeat countdown or a separate timed-entry fatal route). Our XCL minidump also has the worker-pool frames; details are in [the existing report](https://github.com/xcl-dev/xcl/pull/850#issuecomment-7190646148). **[INFERENCE]** The shared watchdog frames make a stall-triggered deliberate crash a lead for your Windows approx-mode report too; they do not establish identical causality or prove what `+0x23cf683` does in your prepared image. Please inspect the crash context/minidump and heartbeat/worker state before treating the final null write as evidence of an approximated shader manufacturing a bad pointer. I did not reproduce your crash or enable approximation, and this is not a claim that VIctory and XCL have the same underlying stall. AI-assisted verification/source review (OpenAI GPT-6 Astra).
kilolimaVI commented 2026-11-26 21:21:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kilolimaVI on 2026-11-26T21:21:13Z.


The ignored hardware test passes on AMD: Windows 11, AMD Radeon 780M (RDNA3 iGPU), toolchain 1.98.1, branch as-is.

cargo test -p victory-gpu --lib --locked -- packed_lighting --ignored --test-threads=1: draw::tests::packed_lighting::packed_lighting_uav_write_is_visible_to_a_same_list_rgb9e5_srv ok. So this adapter supports the direct R32_UINT/RGB9E5 cast and the UAV write is visible to the same list's RGB9E5 SRV.

AI-assisted (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7203642834 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7203642834). Originally posted by [kilolimaVI](https://github.com/kilolimaVI) on 2026-11-26T21:21:13Z. --- The ignored hardware test passes on AMD: Windows 11, AMD Radeon 780M (RDNA3 iGPU), toolchain 1.98.1, branch as-is. `cargo test -p victory-gpu --lib --locked -- packed_lighting --ignored --test-threads=1`: `draw::tests::packed_lighting::packed_lighting_uav_write_is_visible_to_a_same_list_rgb9e5_srv` ok. So this adapter supports the direct R32_UINT/RGB9E5 cast and the UAV write is visible to the same list's RGB9E5 SRV. AI-assisted (Claude).
lhnizdo commented 2026-11-26 22:21:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-26T22:21:37Z.


@RaghavVijayanand, two small fixes for this PR's split, found while running the console BVH builder's programs on an RTX 2080. Both make lanes 32–63 of each console wave read 0. They're one commit on this PR's head 2eb38bb, branch lhnizdo:pr/split-upper-half (7c65f54), if you'd like to take it.

  1. src_lane_active (ds_swizzle). It tests the source lane, a console lane from lane_index(), in the host wave's ballot, which has 32 lanes. For every upper-half lane the source reads as inactive, and the swizzle returns 0. The fix tests half_local(src).
  2. pair_high. It finds a mask's high dword only when one instruction wrote both dwords. The console compiler writes "the upper half" as s_mov_b32 s20, 0 and s_mov_b32 s21, -1, so a v_cndmask on s[20:21] tested the low dword in both halves. The fix: when the writer has no high dword, take what the pair's readers read there, as long as they all agree (Lower::high_read_with in wave64.rs, which keeps lower.rs under the 512 KiB policy).

Tests. Two new ones in wave64_tests.rs, using your run_everywhere and its models, for groups of 128, 96 and 64:

  • swizzles_read_within_their_own_half (offsets 30 and 120);
  • a_mask_written_by_dwords_gives_each_half_its_own.

Both fail without the fix on the 2080 ("result 0 of thread 32 (wave 0, lane 32) is 0x0") and pass with it. To run them here I staged the Agility SDK as #2878 does; without it this machine reports no SM 6.6 device, and the tests skip.

Where it matters. The builder's block-wide prefix sums (39321a95, 77360df2, 9fc111d3, f6eb6498, 5e19e7c7) use both patterns. With the fix all five match a CPU reference when run from the real containers. The builder still hangs on 32-lane cards for another reason, which I'm tracking on #2703. So this is a correctness fix, not the end of that hang.

AI-assisted (Claude Code). Synthetic tests only, no game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7204605615 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7204605615). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-26T22:21:37Z. --- @RaghavVijayanand, two small fixes for this PR's split, found while running the console BVH builder's programs on an RTX 2080. Both make lanes 32–63 of each console wave read 0. They're one commit on this PR's head `2eb38bb`, branch `lhnizdo:pr/split-upper-half` (`7c65f54`), if you'd like to take it. 1. **`src_lane_active` (ds_swizzle).** It tests the source lane, a console lane from `lane_index()`, in the host wave's ballot, which has 32 lanes. For every upper-half lane the source reads as inactive, and the swizzle returns 0. The fix tests `half_local(src)`. 2. **`pair_high`.** It finds a mask's high dword only when one instruction wrote both dwords. The console compiler writes "the upper half" as `s_mov_b32 s20, 0` and `s_mov_b32 s21, -1`, so a `v_cndmask` on `s[20:21]` tested the low dword in both halves. The fix: when the writer has no high dword, take what the pair's readers read there, as long as they all agree (`Lower::high_read_with` in `wave64.rs`, which keeps `lower.rs` under the 512 KiB policy). **Tests.** Two new ones in `wave64_tests.rs`, using your `run_everywhere` and its models, for groups of 128, 96 and 64: - `swizzles_read_within_their_own_half` (offsets 30 and 120); - `a_mask_written_by_dwords_gives_each_half_its_own`. Both fail without the fix on the 2080 ("result 0 of thread 32 (wave 0, lane 32) is 0x0") and pass with it. To run them here I staged the Agility SDK as #2878 does; without it this machine reports no SM 6.6 device, and the tests skip. **Where it matters.** The builder's block-wide prefix sums (`39321a95`, `77360df2`, `9fc111d3`, `f6eb6498`, `5e19e7c7`) use both patterns. With the fix all five match a CPU reference when run from the real containers. The builder still hangs on 32-lane cards for another reason, which I'm tracking on #2703. So this is a correctness fix, not the end of that hang. AI-assisted (Claude Code). Synthetic tests only, no game data.
pickles976 commented 2026-11-27 01:23:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-27T01:23:51Z.


Wine/RTX4060: packed-lighting fixture fails at clean head; #2101's capability filter makes all four cases pass

Matched same-fixture comparison: #3147 2eb38bb1185f1b1b077da398b8e435787c0c6356, first clean in VIctory-pr3147-format/, then the same checkout with only the production host_has/castable_formats.retain change from #2101 4d8c89a86ac968d9e7687bec6fafcd0b9eef2405. No shader, descriptor, fixture or expected-pixel changes in the passing leg. No title launch.

Environment: physical RTX4060 Laptop8 GiB, NVIDIA590.48.1, Wine11, Linux6.17,15693 MiB RAM, Rust1.98.1/Windows-MSVC. dxgi.hideNvidiaGpu = False, VICTORY_IN_PLACE=0. vkd3d is the local diagnostic-relaxed 2576c0b4adfae4a+; not stock certification. Fresh intended-worktree compilation recorded for every leg; external9 GiB/512 MiB scope and GPU/RAM/disk guards unchanged.

Command, through the existing Wine wrapper (supplies locked Windows target):

VICTORY_SOURCE_DIR="$PWD/VIctory-pr3147-format" \
  /usr/bin/bash .compat-tools/cargo-victory-wine.sh \
  test -p victory-gpu --all-features --lib \
  packed_lighting_uav_write_is_visible_to_a_same_list_rgb9e5_srv \
  -- --ignored --nocapture --test-threads=1
Source Result
Clean #3147 2eb38bb 0/1,0.68 s; fails before dispatch at draw.rs:2775, host resource for the view
Same head + #2101 production filter 1/1,0.67 s; all four format/flag combinations match32/32 pixels and128/128 components each

Passing combinations: requested formats67 and42, each with flags4 and5. That is128 pixel observations /512 float-bit components total, through real R32_UINT UAV writes and same-list RGB9E5 SRV loads. No adapter skip. Wine lacks independent D3D12 debug-layer coverage; log_messages()==None is not native debug-layer certification. No matched title, CPU-upload, RTV-write, guest-readback or frame-time claim.

A temporary diagnostic run between those legs identified the refusal:

CreateCommittedResource3: format=26 flags=4
castable=[24,25,28,29,30,31,32,34,35,36,37,38,41,42,43,67,87,88,89,91,93]
HRESULT=0x80070057
fallback resource: format=26 flags=4 castable=[]
slot0 (R32_UINT UAV): rejected before dispatch
OPTIONS12: RelaxedFormatCastingSupported=true, EnhancedBarriersSupported=true
native CreateCommittedResource3 with no extra formats: success
native CreateCommittedResource3 with only required [42,67]: success

Thus this is not lack of native support for the required pair: the broad castable list is refused, fallback clears the list, and the production fits check correctly refuses the now-unpermitted cross-family UAV. #2101's existing capability filtering resolves this fixture without bypassing that check. The diagnostic additions were removed before the passing leg. I did not separately census which individual formats were filtered, so format89's identity here remains the owner's mechanism report rather than a new per-format measurement.

Suggested integration: retain the castable-list capability filter alongside the direct packed-lighting path, and keep this pixel test in the Wine gate. Do not substitute an uncastable R11G11B10 view and call allocation success a colour fix. This result does not supersede other reports involving different base formats/flags or certify every stand-in/upload/readback path.

Evidence under .compat-runtime/logs/:

  • verify-pr3147-packed-lighting-20261127T010428Z/ — clean failure; fresh build9.57 s
  • verify-pr3147-cast-diagnostic-20261127T011015Z/ — native-call/metadata diagnostic, not a pixel pass
  • verify-pr3147-pr2101-packed-lighting-20261127T011454Z/ — matched passing integration; fresh build5.90 s

Relevance: our separate RAM-tested mixed title stack now reaches the prologue card but logs format67 failures plus43 Wave64 translation refusals. That stack is not #3147, and this offscreen result does not establish the cause of its black frame or clear its shader gates. Memory/runtime provenance: https://github.com/Marvisak/VIctory/pull/2519#issuecomment-7205904648.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7207254013 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7207254013). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T01:23:51Z. --- ### Wine/RTX4060: packed-lighting fixture fails at clean head; #2101's capability filter makes all four cases pass **Matched same-fixture comparison:** #3147 `2eb38bb1185f1b1b077da398b8e435787c0c6356`, first clean in `VIctory-pr3147-format/`, then the same checkout with only the production `host_has`/`castable_formats.retain` change from #2101 `4d8c89a86ac968d9e7687bec6fafcd0b9eef2405`. No shader, descriptor, fixture or expected-pixel changes in the passing leg. No title launch. Environment: physical RTX4060 Laptop8 GiB, NVIDIA590.48.1, Wine11, Linux6.17,15693 MiB RAM, Rust1.98.1/Windows-MSVC. `dxgi.hideNvidiaGpu = False`, `VICTORY_IN_PLACE=0`. vkd3d is the local diagnostic-relaxed `2576c0b4adfae4a+`; **not stock certification**. Fresh intended-worktree compilation recorded for every leg; external9 GiB/512 MiB scope and GPU/RAM/disk guards unchanged. Command, through the existing Wine wrapper (supplies locked Windows target): ```sh VICTORY_SOURCE_DIR="$PWD/VIctory-pr3147-format" \ /usr/bin/bash .compat-tools/cargo-victory-wine.sh \ test -p victory-gpu --all-features --lib \ packed_lighting_uav_write_is_visible_to_a_same_list_rgb9e5_srv \ -- --ignored --nocapture --test-threads=1 ``` |Source|Result| |---|---| |Clean #3147 `2eb38bb`|0/1,0.68 s; fails before dispatch at `draw.rs:2775`, `host resource for the view`| |Same head + #2101 production filter|1/1,0.67 s; all four format/flag combinations match32/32 pixels and128/128 components each| Passing combinations: requested formats67 and42, each with flags4 and5. That is128 pixel observations /512 float-bit components total, through real R32_UINT UAV writes and same-list RGB9E5 SRV loads. No adapter skip. Wine lacks independent D3D12 debug-layer coverage; `log_messages()==None` is not native debug-layer certification. No matched title, CPU-upload, RTV-write, guest-readback or frame-time claim. A temporary diagnostic run between those legs identified the refusal: ```text CreateCommittedResource3: format=26 flags=4 castable=[24,25,28,29,30,31,32,34,35,36,37,38,41,42,43,67,87,88,89,91,93] HRESULT=0x80070057 fallback resource: format=26 flags=4 castable=[] slot0 (R32_UINT UAV): rejected before dispatch OPTIONS12: RelaxedFormatCastingSupported=true, EnhancedBarriersSupported=true native CreateCommittedResource3 with no extra formats: success native CreateCommittedResource3 with only required [42,67]: success ``` Thus this is not lack of native support for the required pair: the broad castable list is refused, fallback clears the list, and the production `fits` check correctly refuses the now-unpermitted cross-family UAV. #2101's existing capability filtering resolves this fixture without bypassing that check. The diagnostic additions were removed before the passing leg. I did not separately census which individual formats were filtered, so format89's identity here remains the owner's mechanism report rather than a new per-format measurement. **Suggested integration:** retain the castable-list capability filter alongside the direct packed-lighting path, and keep this pixel test in the Wine gate. Do not substitute an uncastable R11G11B10 view and call allocation success a colour fix. This result does not supersede other reports involving different base formats/flags or certify every stand-in/upload/readback path. Evidence under `.compat-runtime/logs/`: - `verify-pr3147-packed-lighting-20261127T010428Z/` — clean failure; fresh build9.57 s - `verify-pr3147-cast-diagnostic-20261127T011015Z/` — native-call/metadata diagnostic, not a pixel pass - `verify-pr3147-pr2101-packed-lighting-20261127T011454Z/` — matched passing integration; fresh build5.90 s Relevance: our separate RAM-tested mixed title stack now reaches the prologue card but logs format67 failures plus43 Wave64 translation refusals. That stack is not #3147, and this offscreen result does not establish the cause of its black frame or clear its shader gates. Memory/runtime provenance: https://github.com/Marvisak/VIctory/pull/2519#issuecomment-7205904648.
kilolimaVI commented 2026-11-27 10:31:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kilolimaVI on 2026-11-27T10:31:07Z.


Data point for @pickles976's report: on the same head 2eb38bb, packed_lighting_uav_write_is_visible_to_a_same_list_rgb9e5_srv (--ignored) passes without #2101's filter on native Windows 11 with an AMD Radeon 780M (RDNA3), as in my earlier comment. So the refusal of the broad castable list looks host-specific (vkd3d/Wine on the RTX 4060 here), not a general one; #2101's filter fixes that host and should be a no-op where the full list is accepted.

AI-assisted (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7215979072 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7215979072). Originally posted by [kilolimaVI](https://github.com/kilolimaVI) on 2026-11-27T10:31:07Z. --- Data point for @pickles976's report: on the same head 2eb38bb, `packed_lighting_uav_write_is_visible_to_a_same_list_rgb9e5_srv` (`--ignored`) passes without #2101's filter on native Windows 11 with an AMD Radeon 780M (RDNA3), as in my earlier comment. So the refusal of the broad castable list looks host-specific (vkd3d/Wine on the RTX 4060 here), not a general one; #2101's filter fixes that host and should be a no-op where the full list is accepted. AI-assisted (Claude).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3147:upstream-pr/3147'
git switch 'upstream-pr/3147'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3147'
git switch 'upstream-pr/3147'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3147'
git switch 'upstream-pr/3147'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3147'
git switch 'main'
git merge --squash 'upstream-pr/3147'
git switch 'main'
git merge --ff-only 'upstream-pr/3147'
git switch 'main'
git merge 'upstream-pr/3147'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!3145
No description provided.