Shaders: the code table starts after the instructions (fixes RTX 5090 Xid 13; port of Marvisak/VIctory#2143) #1004

Open
OctoAlgo wants to merge 1 commit from upstream-pr/1006 into main
OctoAlgo commented 2026-11-25 15:53:28 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by OctoAlgo on 2026-11-25T15:53:28Z.


Fixes #861.

Problem

On an RTX 5090 (GB202), this fork faults at every world entry (Linux, Proton, vkd3d-proton, NVIDIA 620.73.04): NVRM Xid 13, "SM Warp Exception: MMU Fault", shader writes to unmapped GPU addresses. The same build runs clean on an RTX 5070 Ti in the same PC. On other NVIDIA cards the same cause costs video memory instead: Marvisak/VIctory#2143 reports GBs of VRAM reserved on an RTX 5080.

Cause

code_dword (crates/victory-shader/src/emit/lower.rs) turns the program's code, starting at the lowest offset any load or descriptor names, into a constant array. A load at a computed offset names offset 0, so the array is the whole program. In 12 lighting computes reached at world entry, that is 4160–4596 dwords (16.3–18 KiB).

Under vkd3d-proton the array becomes a private one. NVIDIA's compiler keeps up to 16 KiB of such arrays in constant memory and copies a bigger one into each thread's local memory: 16–18 KB per thread in those 12 shaders. On GB202 this local memory faults.

Change

This is a port of Marvisak/VIctory#2143 by @desplmfao: its two commits squashed into one, with desplmfao kept as the author. The only difference from upstream is the test module's import list.

The table now starts where the instructions end, because the program's constants follow its instructions and a computed load reads them. It keeps the old start if a load at a fixed offset reads below the end. A computed index below the start is clamped like one past the end, as before.

No follow-up change was needed. A 15-minute run logged all 1149 code-table reads in 114 programs:

  • None is a fixed-offset load inside the instructions.
  • Every s_getpc_b64 + literal table base, as the translator computes it, sits at or after the instructions' end.
  • So no real read falls below the new start. The 9 programs whose tables were 3200–4600 dwords now have 154–177 dwords.

Evidence (RTX 5090 + RTX 5070 Ti, one PC)

  • Nsight Aftermath dumps of the 5090 faults always named a shader whose NVIDIA compile uses local memory.
  • Refusing every shader with local memory gave a clean 15-minute run, twice.
  • Refusing only the 12 computes with 16–18 KB of local memory also gave a clean run, so they are the trigger. The other ~1000 shaders with 16–240 B of local memory are fine.
  • A local switch with the same rule (table from the end of the instructions; it also kept a 256 B margin and a cap) gave two clean 15-minute 5090 runs with all shaders on and the world lit. It reached frames 3232 and 3272 with 0 Xid.
    • The executables' local memory, as reported by the driver, no longer reaches 16 KB anywhere (the largest compute uses 128 B, the largest pixel shader 192 B; before: 16–18 KB in 12 executables).
    • An A/B on the 5070 Ti, switch on vs. off, lit alike: mean luminance 0.161 vs. 0.162, and the per-frame difference is within run-to-run noise.
  • This branch on the 5090: clean: full 15 minutes (frame 3059), 0 Xid, lit. The window scene's mean luminance is 0.141, vs. 0.143 with the local switch and 0.003 with the 12 computes refused. Local memory per the driver: at most 128 B (compute) and 192 B (pixel), over 997 compute and 782 pixel executables.

Testing

  • cargo test -p victory-shader --lib (Linux host): 172 passed, 2 ignored, including #2143's the_code_table_starts_after_the_instructions.
  • cargo build --locked --target x86_64-pc-windows-msvc --release -p victory (cross-built with xwin): OK. Also --profile diag --features diagnostics.
  • One 15-minute RTX 5090 run of this branch, built with --profile diag --features diagnostics, with this PC's Linux-only additions on top (not part of this PR): the DXC fallback from #20 and the VICTORY_NO_WATCHDOG loader hook.

Credit for the fix goes to @desplmfao (Marvisak/VIctory#2143).

(Investigated and prepared with an AI coding assistant; all numbers are from runs on this PC.)

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:5494644986 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1006). Originally posted by [OctoAlgo](https://github.com/OctoAlgo) on 2026-11-25T15:53:28Z. --- Fixes #861. ## Problem On an **RTX 5090 (GB202)**, this fork faults at every world entry (Linux, Proton, vkd3d-proton, NVIDIA 620.73.04): NVRM Xid 13, "SM Warp Exception: MMU Fault", shader writes to unmapped GPU addresses. The same build runs clean on an RTX 5070 Ti in the same PC. On other NVIDIA cards the same cause costs video memory instead: Marvisak/VIctory#2143 reports GBs of VRAM reserved on an RTX 5080. ## Cause `code_dword` (`crates/victory-shader/src/emit/lower.rs`) turns the program's code, starting at the lowest offset any load or descriptor names, into a constant array. A load at a computed offset names offset 0, so the array is the whole program. In 12 lighting computes reached at world entry, that is 4160–4596 dwords (16.3–18 KiB). Under vkd3d-proton the array becomes a private one. NVIDIA's compiler keeps up to 16 KiB of such arrays in constant memory and copies a bigger one into each thread's **local memory**: 16–18 KB per thread in those 12 shaders. On GB202 this local memory faults. ## Change This is a port of Marvisak/VIctory#2143 by @desplmfao: its two commits squashed into one, with desplmfao kept as the author. The only difference from upstream is the test module's import list. The table now starts where the instructions end, because the program's constants follow its instructions and a computed load reads them. It keeps the old start if a load at a fixed offset reads below the end. A computed index below the start is clamped like one past the end, as before. No follow-up change was needed. A 15-minute run logged all 1149 code-table reads in 114 programs: - None is a fixed-offset load inside the instructions. - Every `s_getpc_b64` + literal table base, as the translator computes it, sits at or after the instructions' end. - So no real read falls below the new start. The 9 programs whose tables were 3200–4600 dwords now have 154–177 dwords. ## Evidence (RTX 5090 + RTX 5070 Ti, one PC) - Nsight Aftermath dumps of the 5090 faults always named a shader whose NVIDIA compile uses local memory. - Refusing every shader with local memory gave a clean 15-minute run, twice. - Refusing only the 12 computes with 16–18 KB of local memory also gave a clean run, so they are the trigger. The other ~1000 shaders with 16–240 B of local memory are fine. - A local switch with the same rule (table from the end of the instructions; it also kept a 256 B margin and a cap) gave two clean 15-minute 5090 runs with all shaders on and the world lit. It reached frames 3232 and 3272 with 0 Xid. - The executables' local memory, as reported by the driver, no longer reaches 16 KB anywhere (the largest compute uses 128 B, the largest pixel shader 192 B; before: 16–18 KB in 12 executables). - An A/B on the 5070 Ti, switch on vs. off, lit alike: mean luminance 0.161 vs. 0.162, and the per-frame difference is within run-to-run noise. - **This branch** on the 5090: clean: full 15 minutes (frame 3059), 0 Xid, lit. The window scene's mean luminance is 0.141, vs. 0.143 with the local switch and 0.003 with the 12 computes refused. Local memory per the driver: at most 128 B (compute) and 192 B (pixel), over 997 compute and 782 pixel executables. ## Testing - `cargo test -p victory-shader --lib` (Linux host): 172 passed, 2 ignored, including #2143's `the_code_table_starts_after_the_instructions`. - `cargo build --locked --target x86_64-pc-windows-msvc --release -p victory` (cross-built with xwin): OK. Also `--profile diag --features diagnostics`. - One 15-minute RTX 5090 run of this branch, built with `--profile diag --features diagnostics`, with this PC's Linux-only additions on top (not part of this PR): the DXC fallback from #20 and the `VICTORY_NO_WATCHDOG` loader hook. Credit for the fix goes to @desplmfao (Marvisak/VIctory#2143). (Investigated and prepared with an AI coding assistant; all numbers are from runs on this PC.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Ym1r1710 commented 2026-11-25 16:12:54 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Ym1r1710 on 2026-11-25T16:04:23Z.


Ran this on an RTX 5080 16 GB, Windows 11 (native D3D12, not Proton), on top of current main plus a few open PRs.

No faults before or after on this card, so I can't say anything about the Xid itself. What I can say: the picture in the first cell is the same as without it (lit the same, window and walls unchanged), frame time is within run to run noise (~155-170 ms either way), and video memory in use was the same in both runs, 12.4 GB per the memory line. So at least on Windows I don't see the multi-GB reservation from #2143 going away or coming back, it just doesn't show up here.

Keeping it in my build since it removes the 16-18 KB local arrays and costs nothing that I can measure.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7167568240 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1006#issuecomment-7167568240). Originally posted by [Ym1r1710](https://github.com/Ym1r1710) on 2026-11-25T16:04:23Z. --- Ran this on an RTX 5080 16 GB, Windows 11 (native D3D12, not Proton), on top of current main plus a few open PRs. No faults before or after on this card, so I can't say anything about the Xid itself. What I can say: the picture in the first cell is the same as without it (lit the same, window and walls unchanged), frame time is within run to run noise (~155-170 ms either way), and video memory in use was the same in both runs, 12.4 GB per the memory line. So at least on Windows I don't see the multi-GB reservation from #2143 going away or coming back, it just doesn't show up here. Keeping it in my build since it removes the 16-18 KB local arrays and costs nothing that I can measure.
ThomasHFWright commented 2026-11-25 17:08:04 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ThomasHFWright on 2026-11-25T16:40:39Z.


Independent positive result on CachyOS, RTX 5090, NVIDIA 620.73.04 and GE-Proton 11-14, testing the exact change at 4e7af7b013.

Before this change, the immediately preceding build hit Xid 13 at world entry after 131 seconds. With this change, the run lasted 583.74 seconds with no NVIDIA Xid and produced textured in-world characters, floor geometry and lighting for the first time in this investigation. It eventually exited with a title breakpoint (0x80000003), so this is not a claim of complete stability or playable performance. Frame times remained highly variable.

The captured production SPIR-V confirms two private tables shrinking from 18,368 to 632 bytes and from 16,640 to 616 bytes. Each new initializer matches the corresponding old table's trailing data exactly.

Checks: native shader suite 179 passed / 2 ignored; Windows shader suite 225 passed / 1 existing stub-pipeline failure / 3 ignored; diagnostic cross-build and Clippy passed. Restoring the old table-start rule makes the new regression fail.

Context: this is atop existing Linux descriptor/subresource corrections. Runtime is vkd3d-proton cae8353e with local allocator/null-CBV fixes and a patched DXIL converter. Those fixes were also present in the preceding failing run. Normal shaders and default loop limits; watchdog disabled; Vulkan core/synchronization validation enabled. A repeat with the same executable/runtime and validation disabled lasted 534.58 seconds, again rendered world scenes without Xid, then hit the same title breakpoint. Memory/swap-limit and OOM counters remained zero; memory pressure was substantial, but allocation failure is not established as the assertion's cause.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7168360845 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1006#issuecomment-7168360845). Originally posted by [ThomasHFWright](https://github.com/ThomasHFWright) on 2026-11-25T16:40:39Z. --- Independent positive result on CachyOS, RTX 5090, NVIDIA 620.73.04 and GE-Proton 11-14, testing the exact change at 4e7af7b01356417864b935bd1fffc7d0dece266f. Before this change, the immediately preceding build hit Xid 13 at world entry after 131 seconds. With this change, the run lasted 583.74 seconds with **no NVIDIA Xid** and produced textured in-world characters, floor geometry and lighting for the first time in this investigation. It eventually exited with a title breakpoint (0x80000003), so this is not a claim of complete stability or playable performance. Frame times remained highly variable. The captured production SPIR-V confirms two private tables shrinking from 18,368 to 632 bytes and from 16,640 to 616 bytes. Each new initializer matches the corresponding old table's trailing data exactly. Checks: native shader suite 179 passed / 2 ignored; Windows shader suite 225 passed / 1 existing stub-pipeline failure / 3 ignored; diagnostic cross-build and Clippy passed. Restoring the old table-start rule makes the new regression fail. Context: this is atop existing Linux descriptor/subresource corrections. Runtime is vkd3d-proton cae8353e with local allocator/null-CBV fixes and a patched DXIL converter. Those fixes were also present in the preceding failing run. Normal shaders and default loop limits; watchdog disabled; Vulkan core/synchronization validation enabled. A repeat with the same executable/runtime and validation disabled lasted 534.58 seconds, again rendered world scenes without Xid, then hit the same title breakpoint. Memory/swap-limit and OOM counters remained zero; memory pressure was substantial, but allocation failure is not established as the assertion's cause.
ArturoWolff commented 2026-11-25 19:09:48 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ArturoWolff on 2026-11-25T19:02:35Z.


Incremental asset-free regression on the receiving fork, before attempting another physical-GPU run: c5820acd4fc24a387396dc6ccef051115cbe9813 (#1056) with the exact delta from this PR at 4e7af7b01356417864b935bd1fffc7d0dece266f. The delta applies cleanly. Credit to @desplmfao (Marvisak/VIctory#2143) and @OctoAlgo for the port.

In addition to this PR's table-start helper test, I exercised the actual Lower::code_dword allocation path with a synthetic 4,251-dword instruction prefix, 160 dwords of trailing constants, and controlled CODE resource addresses. No title assets, driver pipeline creation, or GPU dispatch involved.

Case Before With #1006
Computed address (offset 0) base 0, 4,411 dwords base 17,004, 160 dwords
Computed address plus fixed instruction read at byte 4 — base 0, 4,411 dwords

The baseline regression failed at the expected table extent assertion (17,644 bytes vs expected 640). Patched full native cargo test --locked --offline -p victory-shader --lib: 173 passed, 0 failed, 2 ignored, including the upstream test and this additional witness. Rust 1.98.1 on Linux. This tests the emitter's table extent, not driver local-memory allocation or correctness of executed loads. The fixed-read case is deliberately preserved.

The motivation is our separate Linux/Proton DXC integration test on #20. This makes #1006 a candidate for that integration, but it does not establish that the RTX 4060 host hang reported on #20 shares the RTX 5090 Xid mechanism. No new gameplay, FPS or hardware stability claim.

Integration follow-up: this exact #1006 delta also cross-builds cleanly on c5820ac + #830 (951dc00) + #20 (d4a36b1, manifest-only context adaptation). Rust 1.98.1, locked/offline GNU/LLVM Windows diagnostics release. On a separately linked victory-gpu --lib test executable from the integrated tree, the strict production argument-clamp witness still behaves as expected under GE-Proton11-14 / llvmpipe 26.3.1: with the Wine builtin compiler forced and no DXC DLLs, actual FL11_0 device creation succeeds but clamp construction fails (0x8007007E, test exit 101); with DXC DLLs, the production root signature and PSO are created (1 passed, exit 0). Separate copies of the same software-only prefix, identical test executable; no physical GPU or title files exposed. This is integration compatibility evidence only. Marvisak/VIctory#144 and #2723 describe another converter/handle-typing problem that still deserves separate testing before a physical NVIDIA run.

AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7171742284 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1006#issuecomment-7171742284). Originally posted by [ArturoWolff](https://github.com/ArturoWolff) on 2026-11-25T19:02:35Z. --- Incremental asset-free regression on the receiving fork, before attempting another physical-GPU run: `c5820acd4fc24a387396dc6ccef051115cbe9813` (#1056) with the exact delta from this PR at `4e7af7b01356417864b935bd1fffc7d0dece266f`. The delta applies cleanly. Credit to @desplmfao (Marvisak/VIctory#2143) and @OctoAlgo for the port. In addition to this PR's table-start helper test, I exercised the actual `Lower::code_dword` allocation path with a synthetic 4,251-dword instruction prefix, 160 dwords of trailing constants, and controlled CODE resource addresses. No title assets, driver pipeline creation, or GPU dispatch involved. | Case | Before | With #1006 | |---|---:|---:| | Computed address (offset 0) | base 0, 4,411 dwords | base 17,004, 160 dwords | | Computed address plus fixed instruction read at byte 4 | — | base 0, 4,411 dwords | The baseline regression failed at the expected table extent assertion (17,644 bytes vs expected 640). Patched full native `cargo test --locked --offline -p victory-shader --lib`: **173 passed, 0 failed, 2 ignored**, including the upstream test and this additional witness. Rust 1.98.1 on Linux. This tests the emitter's table extent, not driver local-memory allocation or correctness of executed loads. The fixed-read case is deliberately preserved. The motivation is our separate Linux/Proton DXC integration [test on #20](https://github.com/fxceless/victory-fork/pull/20#issuecomment-7171551883). This makes #1006 a candidate for that integration, but it does not establish that the RTX 4060 host hang reported on #20 shares the RTX 5090 Xid mechanism. No new gameplay, FPS or hardware stability claim. **Integration follow-up:** this exact #1006 delta also cross-builds cleanly on `c5820ac` + #830 (`951dc00`) + #20 (`d4a36b1`, manifest-only context adaptation). Rust 1.98.1, locked/offline GNU/LLVM Windows diagnostics release. On a separately linked `victory-gpu --lib` test executable from the integrated tree, the strict production argument-clamp witness still behaves as expected under GE-Proton11-14 / llvmpipe 26.3.1: with the Wine builtin compiler forced and no DXC DLLs, actual FL11_0 device creation succeeds but clamp construction fails (`0x8007007E`, test exit 101); with DXC DLLs, the production root signature and PSO are created (1 passed, exit 0). Separate copies of the same software-only prefix, identical test executable; no physical GPU or title files exposed. This is integration compatibility evidence only. Marvisak/VIctory#144 and #2723 describe another converter/handle-typing problem that still deserves separate testing before a physical NVIDIA run. AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High)
tylerstraub commented 2026-11-26 07:03:54 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by tylerstraub on 2026-11-26T06:55:49Z.


Confirming on a second RTX 5090, on a different fork (trustno1-coder/VIctory-NVIDIA, 0a43566 line), Linux/Proton Experimental, NVIDIA 595.99.02: without this change the world entry hung every time, showing as Xid 109 only rather than Xid 13. With a hand port of this fix plus VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains, there were no GPU errors through 20+ minutes of gameplay. (Applied together, not yet A/B'd.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7184922701 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1006#issuecomment-7184922701). Originally posted by [tylerstraub](https://github.com/tylerstraub) on 2026-11-26T06:55:49Z. --- Confirming on a second RTX 5090, on a different fork (trustno1-coder/VIctory-NVIDIA, 0a43566 line), Linux/Proton Experimental, NVIDIA 595.99.02: without this change the world entry hung every time, showing as **Xid 109 only** rather than Xid 13. With a hand port of this fix plus `VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains`, there were no GPU errors through 20+ minutes of gameplay. (Applied together, not yet A/B'd.)
Filip722 commented 2026-11-27 07:47:23 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-27T07:47:23Z.


I carried the source change from 4e7af7b onto current fork main 9a9091d with the code-table regression in the current test module. The focused code-table test passed under GE-Proton11-14 and vkd3d-proton 3.2.0 on Bazzite, with an RTX 5060 Laptop (8 GiB), driver 615.78.08.

The known #861 report was an MMU fault. This laptop reproduced a different subtype, Xid 13 SKEDCHECK36_DEPENDENCE_COUNTER_UNDERFLOW with D3D12 0x887A0005, both before and after this change. Both replays used bounded compute waits and identical starting native caches. This comparison effectively used cold shader translations because the offline seed missed the runtime cache key. The patched arm submitted more world draws and survived longer, but its output stayed black and it eventually had the same subtype. This leaves the #861 fix and the 5060 failure as separate observations.

Assisted by Codex (GPT-6.2-Sol High).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7212820072 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1006#issuecomment-7212820072). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-27T07:47:23Z. --- I carried the source change from `4e7af7b` onto current fork main `9a9091d` with the code-table regression in the current test module. The focused code-table test passed under GE-Proton11-14 and vkd3d-proton 3.2.0 on Bazzite, with an RTX 5060 Laptop (8 GiB), driver 615.78.08. The known #861 report was an MMU fault. This laptop reproduced a different subtype, Xid 13 `SKEDCHECK36_DEPENDENCE_COUNTER_UNDERFLOW` with D3D12 `0x887A0005`, both before and after this change. Both replays used bounded compute waits and identical starting native caches. This comparison effectively used cold shader translations because the offline seed missed the runtime cache key. The patched arm submitted more world draws and survived longer, but its output stayed black and it eventually had the same subtype. This leaves the #861 fix and the 5060 failure as separate observations. Assisted by Codex (GPT-6.2-Sol High).
OctoAlgo commented 2026-11-27 08:22:15 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by OctoAlgo on 2026-11-27T08:22:15Z.


Thanks for carrying it forward and for the careful before/after. Agreed: the 5060's Xid 13 SKEDCHECK36_DEPENDENCE_COUNTER_UNDERFLOW with 0x887A0005 shows with and without this change, so it looks like a separate problem from #861's MMU fault.

I've rebased the branch onto current main (9a9091d18), so it merges cleanly again. The only conflict was the test module moving out of lower.rs; the regression test now sits in emit/lower_tests.rs. It passes here (run natively on Linux, with the Windows-only validator test left out), and the test build for the Windows target compiles.

If you have a recipe for the 5060 case, we can run it on an RTX 5090 and an RTX 5070 Ti under Proton to see whether that subtype shows up on desktop cards.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7213464095 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1006#issuecomment-7213464095). Originally posted by [OctoAlgo](https://github.com/OctoAlgo) on 2026-11-27T08:22:15Z. --- Thanks for carrying it forward and for the careful before/after. Agreed: the 5060's Xid 13 `SKEDCHECK36_DEPENDENCE_COUNTER_UNDERFLOW` with `0x887A0005` shows with and without this change, so it looks like a separate problem from #861's MMU fault. I've rebased the branch onto current main (`9a9091d18`), so it merges cleanly again. The only conflict was the test module moving out of `lower.rs`; the regression test now sits in `emit/lower_tests.rs`. It passes here (run natively on Linux, with the Windows-only validator test left out), and the test build for the Windows target compiles. If you have a recipe for the 5060 case, we can run it on an RTX 5090 and an RTX 5070 Ti under Proton to see whether that subtype shows up on desktop cards.
OctoAlgo commented 2026-11-27 15:57:28 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by OctoAlgo on 2026-11-27T15:57:28Z.


main was replaced today (5dbf5ce22, the tree of trustno1-coder/VIctory-NVIDIA 959dcaf; now 919578001), so this PR conflicted. The fix is still missing on the new main: code_dword in crates/victory-shader/src/emit/lower.rs still builds the code table from the lowest offset any load names, so a load at a computed offset makes the table the whole program (16-18 KiB private arrays on the lighting computes; Xid 13 on an RTX 5090 under vkd3d-proton, and GBs of VRAM reserved on other cards).

I re-ported it onto 919578001 and updated the branch. The lower.rs change is the same as before (desplmfao's fix from Marvisak/VIctory#2143). This tree has no lower_tests.rs, so the regression test the_code_table_starts_after_the_instructions now sits in emit's own test module and code_table_start is pub(super) for it.

Run on Linux: cargo test -p victory-shader --lib 206 passed, 0 failed (the new test included); cargo check --target x86_64-pc-windows-msvc -p victory-shader --tests clean.

One data point from today on another fork that lacks the fix (edsuuu/VI-BR-PORT main), RTX 5090, Proton 11: 94 Xid 13 at 78 s after start and the world never loads; with this patch applied unchanged, no Xid in any later run. We have not yet run the new main itself on the 5090; that run is next and I'll report it here.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7222684971 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1006#issuecomment-7222684971). Originally posted by [OctoAlgo](https://github.com/OctoAlgo) on 2026-11-27T15:57:28Z. --- main was replaced today (5dbf5ce22, the tree of trustno1-coder/VIctory-NVIDIA 959dcaf; now 919578001), so this PR conflicted. The fix is still missing on the new main: `code_dword` in `crates/victory-shader/src/emit/lower.rs` still builds the code table from the lowest offset any load names, so a load at a computed offset makes the table the whole program (16-18 KiB private arrays on the lighting computes; Xid 13 on an RTX 5090 under vkd3d-proton, and GBs of VRAM reserved on other cards). I re-ported it onto 919578001 and updated the branch. The `lower.rs` change is the same as before (desplmfao's fix from Marvisak/VIctory#2143). This tree has no `lower_tests.rs`, so the regression test `the_code_table_starts_after_the_instructions` now sits in emit's own test module and `code_table_start` is `pub(super)` for it. Run on Linux: `cargo test -p victory-shader --lib` 206 passed, 0 failed (the new test included); `cargo check --target x86_64-pc-windows-msvc -p victory-shader --tests` clean. One data point from today on another fork that lacks the fix (edsuuu/VI-BR-PORT `main`), RTX 5090, Proton 11: 94 Xid 13 at 78 s after start and the world never loads; with this patch applied unchanged, no Xid in any later run. We have not yet run the new main itself on the 5090; that run is next and I'll report it here.
OctoAlgo commented 2026-11-27 16:58:44 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by OctoAlgo on 2026-11-27T16:58:44Z.


Follow-up as promised: fork main 919578001 plus this fix under Proton on the RTX 5090 (CachyOS, NVIDIA 620.73.04, Series X profile).

  • With this fix there were no Xid 13 errors in any 5090 run. I did not run this main without the fix on the 5090; on the previous line the same start gave 94 of them.
  • This fix alone is not enough under Proton. Wine's HLSL compiler refuses the indirect-argument clamp shader (E5005: Method 'InterlockedOr' is not defined on type 'RWByteAddressBuffer'), indirect executions are dropped, and the GPU hangs at the third world frame (Xid 109, device removed). With a DXC fallback for that one shader it plays, at about 2.6 fps. One run each.
  • Every run also logs "no host pipeline library: pipelines are not kept"; a small fix makes the cache save.

I'll send those two as separate small PRs.

(written with AI assistance)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7223887178 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1006#issuecomment-7223887178). Originally posted by [OctoAlgo](https://github.com/OctoAlgo) on 2026-11-27T16:58:44Z. --- Follow-up as promised: fork main `919578001` plus this fix under Proton on the RTX 5090 (CachyOS, NVIDIA 620.73.04, Series X profile). - With this fix there were no Xid 13 errors in any 5090 run. I did not run this main without the fix on the 5090; on the previous line the same start gave 94 of them. - This fix alone is not enough under Proton. Wine's HLSL compiler refuses the indirect-argument clamp shader (`E5005: Method 'InterlockedOr' is not defined on type 'RWByteAddressBuffer'`), indirect executions are dropped, and the GPU hangs at the third world frame (Xid 109, device removed). With a DXC fallback for that one shader it plays, at about 2.6 fps. One run each. - Every run also logs "no host pipeline library: pipelines are not kept"; a small fix makes the cache save. I'll send those two as separate small PRs. *(written with AI assistance)*
OctoAlgo commented 2026-11-27 18:29:02 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by OctoAlgo on 2026-11-27T18:29:02Z.


Update on the two follow-ups mentioned above:

  • The pipeline library fix is #1494.
  • The DXC fallback for the clamp is already covered, more fully, by #1489 from @Filip722, so I am not opening a duplicate. I will test that branch on the RTX 5090 and report there.

(written with AI assistance)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7225534441 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1006#issuecomment-7225534441). Originally posted by [OctoAlgo](https://github.com/OctoAlgo) on 2026-11-27T18:29:02Z. --- Update on the two follow-ups mentioned above: - The pipeline library fix is #1494. - The DXC fallback for the clamp is already covered, more fully, by #1489 from @Filip722, so I am not opening a duplicate. I will test that branch on the RTX 5090 and report there. *(written with AI assistance)*
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/1006:upstream-pr/1006'
git switch 'upstream-pr/1006'

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/1006'
git switch 'upstream-pr/1006'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1006'
git switch 'upstream-pr/1006'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1006'
git switch 'main'
git merge --squash 'upstream-pr/1006'
git switch 'main'
git merge --ff-only 'upstream-pr/1006'
git switch 'main'
git merge 'upstream-pr/1006'
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
fxceless/victory-fork!1004
No description provided.