Turn on the shorter code table on RTX 50 cards (#221) #428

Open
github-bot wants to merge 1 commit from github-bot/gh-428 into main AGit
Owner

@⁠zmelumian972 on GitHub · 2026-11-28 21:12 UTC · original
zmelumian972:fix/221-code-table-start → main · +17 −0 · 1 files · 1 commits · open

Main has the #221 fix (code_table_start, ce27154a), but only behind VICE_TAY_CODE_TABLE_AFTER=1. It is off by default after the RTX 3080 Ti regression on #550. Nothing turns it on, so the cards that need it still crash: an RTX 5090 gets Xid 13 at the start of the intro, and an RTX 5080 reserves gigabytes of video memory.

vice-tay play now sets VICE_TAY_CODE_TABLE_AFTER=1 when the adapter is an RTX 50 card (Blackwell, workstation cards included, via rtx_generation). A value from F1 or --set (including 0) wins. Older cards are unchanged. The switch is already part of the shader cache key.

  • rtx_generations_from_names now also covers needs_code_table_after (passes under Wine).
  • Earlier evidence, from before main's rewrite, on an RTX 5090 with this table start: single-shader repro clean for 150 s (was 18/18 failing); full game clean for 240 s past the intro in 2 of 2 runs (was Xid 13 at about 65 s).

Fixes #221 on RTX 50 cards.

🤖 Generated with Claude Code

**@⁠zmelumian972** on GitHub · 2026-11-28 21:12 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/428) `zmelumian972:fix/221-code-table-start` → `main` · +17 −0 · 1 files · 1 commits · open Main has the #221 fix (`code_table_start`, ce27154a), but only behind `VICE_TAY_CODE_TABLE_AFTER=1`. It is off by default after the RTX 3080 Ti regression on #550. Nothing turns it on, so the cards that need it still crash: an RTX 5090 gets Xid 13 at the start of the intro, and an RTX 5080 reserves gigabytes of video memory. `vice-tay play` now sets `VICE_TAY_CODE_TABLE_AFTER=1` when the adapter is an RTX 50 card (Blackwell, workstation cards included, via `rtx_generation`). A value from F1 or `--set` (including `0`) wins. Older cards are unchanged. The switch is already part of the shader cache key. - `rtx_generations_from_names` now also covers `needs_code_table_after` (passes under Wine). - Earlier evidence, from before main's rewrite, on an RTX 5090 with this table start: single-shader repro clean for 150 s (was 18/18 failing); full game clean for 240 s past the intro in 2 of 2 runs (was Xid 13 at about 65 s). Fixes #221 on RTX 50 cards. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The table code_dword reads was the program's code from the lowest offset
any load or descriptor names, and a load at a computed offset names
offset 0: the table was the whole program. Under vkd3d-proton that
constant array becomes a private one, which NVIDIA keeps in every
thread's local memory. For smh_gen_130 CS_InterpolateStrands
(f7c4f227a2a4c4b2) that is 4,352 dwords per thread, and the GPU then
writes outside its memory: an MMU fault (Xid 13) at the start of the
intro, or command-stream errors (Xid 32/11/69/109) whose method data are
dwords of this shader's code.

The program's constants follow its instructions, and a load at a
computed offset reads them, so the table now starts where the
instructions end, unless a load at a fixed offset reads below that. For
this shader it is 175 dwords from 0x4144. TRANSLATOR_VERSION goes to 16
so cached translations are made again.

Ported from Marvisak/VIctory e04c078 (#2143).

Co-authored-by: desp <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013YhYvcLBjaGbDCQ5ckiBtQ
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 21:14:36 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-11-28 21:47 UTC · original

For whoever merges: the change to lower.rs here is line for line the same as #408 (same code_table_start, same TRANSLATOR_VERSION 16 bump), ported from the same upstream commit. This PR adds the #221 explanation (the per-thread local array on vkd3d-proton/NVIDIA), which is a good reason on its own, but only one of the two should land. I ran the full victory-shader suite natively on Windows for #408: 344 passed against 343 on main, with the GPU execution tests included.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-11-28 21:47 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/428#issuecomment-7246276405) For whoever merges: the change to `lower.rs` here is line for line the same as #408 (same `code_table_start`, same `TRANSLATOR_VERSION` 16 bump), ported from the same upstream commit. This PR adds the #221 explanation (the per-thread local array on vkd3d-proton/NVIDIA), which is a good reason on its own, but only one of the two should land. I ran the full `victory-shader` suite natively on Windows for #408: 344 passed against 343 on `main`, with the GPU execution tests included. AI-assisted: yes
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 11:35 UTC · original

Thanks for identifying the duplicate implementation with #408. We should land the constant-table correction only once and preserve the Linux explanation and native Windows test evidence in the surviving change. I'll keep the translator version bump coordinated.

**@⁠TaynanGT** on GitHub · 2026-11-29 11:35 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/428#issuecomment-7255216457) Thanks for identifying the duplicate implementation with #408. We should land the constant-table correction only once and preserve the Linux explanation and native Windows test evidence in the surviving change. I'll keep the translator version bump coordinated.
github-bot referenced this pull request from a commit 2026-11-30 15:24:03 +00:00
github-bot closed this pull request 2026-11-30 17:08:19 +00:00
Author
Owner

@⁠zmelumian972 on GitHub · 2026-11-30 17:04 UTC · original

Superseded by the new main: ce27154a has this code-table start as the opt-in VICE_TAY_CODE_TABLE_AFTER=1, left off by default after the A/B test on #550.

**@⁠zmelumian972** on GitHub · 2026-11-30 17:04 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/428#issuecomment-7285677705) Superseded by the new main: ce27154a has this code-table start as the opt-in `VICE_TAY_CODE_TABLE_AFTER=1`, left off by default after the A/B test on #550.
github-bot changed title from Shaders: a program's constant table starts after its instructions (#221) to Turn on the shorter code table on RTX 50 cards (#221) 2026-11-30 17:27:06 +00:00
github-bot reopened this pull request 2026-11-30 17:27:06 +00:00
github-bot force-pushed github-bot/gh-428 from 85a3ebffa9 to 09dcfa447d 2026-11-30 17:27:08 +00:00 Compare
Author
Owner

@⁠zmelumian972 on GitHub · 2026-11-30 17:25 UTC · original

Reopened and rebased onto the rewritten main. The table-start logic is already on main behind VICE_TAY_CODE_TABLE_AFTER (ce27154a). This PR now only turns it on for RTX 50 cards, which are the ones that fault with the whole-program table, and leaves older cards as #550 decided.

**@⁠zmelumian972** on GitHub · 2026-11-30 17:25 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/428#issuecomment-7286254690) Reopened and rebased onto the rewritten main. The table-start logic is already on main behind `VICE_TAY_CODE_TABLE_AFTER` (ce27154a). This PR now only turns it on for RTX 50 cards, which are the ones that fault with the whole-program table, and leaves older cards as #550 decided.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/428/head:github-bot/gh-428'
git switch 'github-bot/gh-428'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-428'
git switch 'github-bot/gh-428'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-428'
git switch 'github-bot/gh-428'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-428'
git switch 'main'
git merge --squash 'github-bot/gh-428'
git switch 'main'
git merge --ff-only 'github-bot/gh-428'
git switch 'main'
git merge 'github-bot/gh-428'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.