Shaders: root-view buffer accesses ignore OOB_SELECT 1 (index-only bounds), out-of-range stores land in memory #690

Closed
opened 2026-11-28 03:35:34 +00:00 by Machad3x · 4 comments
Machad3x commented 2026-11-28 03:35:34 +00:00 (Migrated from github.com)
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Machad3x on 2026-11-28T03:35:34Z.


Setup: Windows 11, RTX 3080 Ti 12 GB, Ryzen 7 5700X, 32 GB RAM, Series X profile, title ray tracing on (VICTORY_BVH_BUILDER=1), 240 s runs from the prison cell scene.

Related upstream: Marvisak/VIctory#3486.

What happens
Buffer descriptors built in SGPRs with OOB_SELECT 1 bound-check the index alone against num_records. Our lowering did not honour that. Lanes whose index was at or past num_records loaded and stored real memory, including stores at index 0xFFFFFFFF.

Fix we run
In emit/lower.rs, for OOB_SELECT 1 with idxen, lanes with index >= num_records go to the null address. Their loads read 0 and their stores are dropped, as on hardware. Offsets stay signed, because an unsigned version broke negative offsets in an earlier attempt. Commits ab2963ab and 84e97b37 on Machad3x/VIctory-nvidia tn1-base.

Result
Tested in batch 8 (see the compacted-size issue): no regressions, picture unchanged, 0 refused shaders.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:6658626481 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/690). Originally posted by [Machad3x](https://github.com/Machad3x) on 2026-11-28T03:35:34Z. --- **Setup:** Windows 11, RTX 3080 Ti 12 GB, Ryzen 7 5700X, 32 GB RAM, Series X profile, title ray tracing on (VICTORY_BVH_BUILDER=1), 240 s runs from the prison cell scene. Related upstream: Marvisak/VIctory#3486. **What happens** Buffer descriptors built in SGPRs with OOB_SELECT 1 bound-check the index alone against `num_records`. Our lowering did not honour that. Lanes whose index was at or past `num_records` loaded and stored real memory, including stores at index 0xFFFFFFFF. **Fix we run** In `emit/lower.rs`, for OOB_SELECT 1 with idxen, lanes with index >= `num_records` go to the null address. Their loads read 0 and their stores are dropped, as on hardware. Offsets stay signed, because an unsigned version broke negative offsets in an earlier attempt. Commits ab2963ab and 84e97b37 on Machad3x/VIctory-nvidia `tn1-base`. **Result** Tested in batch 8 (see the compacted-size issue): no regressions, picture unchanged, 0 refused shaders.
github-actions[bot] commented 2026-11-28 03:35:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by github-actions[bot] on 2026-11-28T03:35:42Z.


Please attach both logs from the run that went wrong. Without them we can only guess. Paste %LOCALAPPDATA% into the address bar of File Explorer to get there.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7233201445 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/690#issuecomment-7233201445). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T03:35:42Z. --- Please attach both logs from the run that went wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address bar of File Explorer to get there. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
Machad3x commented 2026-11-28 03:37:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Machad3x on 2026-11-28T03:37:59Z.


GPU: RTX 3080 Ti 12 GB, driver 621.40. Windows 11 (build 26300). Built from source, diag profile. Not a crash: the session stays alive for the whole 240 s run, so there is no crashes.log for it. The full play logs contain local paths, so these are the relevant lines with paths removed. More lines on request.
This fix has no log line of its own. The run's summary: 0 untranslated shaders, 0 refused pipelines, 0 dropped draws. Average of the last 120 s: 66.8 ms/frame.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7233233001 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/690#issuecomment-7233233001). Originally posted by [Machad3x](https://github.com/Machad3x) on 2026-11-28T03:37:59Z. --- GPU: RTX 3080 Ti 12 GB, driver 621.40. Windows 11 (build 26300). Built from source, diag profile. Not a crash: the session stays alive for the whole 240 s run, so there is no crashes.log for it. The full play logs contain local paths, so these are the relevant lines with paths removed. More lines on request. This fix has no log line of its own. The run's summary: 0 untranslated shaders, 0 refused pipelines, 0 dropped draws. Average of the last 120 s: 66.8 ms/frame.
tharun-37 commented 2026-11-28 03:45:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tharun-37 on 2026-11-28T03:45:24Z.


claiming: #690 — I’ll port the OOB_SELECT 1, index-only bounds fix with a focused shader test and PR.

AI-assisted (OpenCode).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7233350292 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/690#issuecomment-7233350292). Originally posted by [tharun-37](https://github.com/tharun-37) on 2026-11-28T03:45:24Z. --- claiming: #690 — I’ll port the OOB_SELECT 1, index-only bounds fix with a focused shader test and PR. AI-assisted (OpenCode).
tharun-37 commented 2026-11-28 04:06:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tharun-37 on 2026-11-28T04:06:41Z.


done: claim 7233350292 -> #709

AI-assisted (OpenCode).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7233702189 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/690#issuecomment-7233702189). Originally posted by [tharun-37](https://github.com/tharun-37) on 2026-11-28T04:06:41Z. --- done: claim 7233350292 -> #709 AI-assisted (OpenCode).
Sign in to join this conversation.
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
trustno1-coder/VIctory-NVIDIA#690
No description provided.