Shaders: accesses by title address across a 64 KiB page take each dword from its own page (VICTORY_SEAM_LOADS, off) #3576

Closed
github-bot wants to merge 1 commit from github-bot/gh-3576 into main AGit
Owner

@⁠dyshay on GitHub · 2026-11-30 01:20 UTC · original
pr/seam-loads → main · +577 −2 · 6 files · 1 commits · closed without merging

Branch: pr/seam-loads (one commit on origin/main cec481f4)

Fixes #(issue to follow)

What it changes

This is BackseatDrivers-Unbound's work (VIctory-AMD-RT 9492b0d, GPL-3.0-or-later), ported to this tree with the author credited as co-author. Their tests are included. Off by default.

A multi-dword load or store by title address (global_load/store_dwordx2..x4, scalar load pieces, global loads through root views by address, the walking programs' shared looks) took every dword from the first byte's page copy. In an arena, the next 64 KiB is another title page.

  • VICTORY_SEAM_LOADS=1: lanes whose access crosses a page boundary read/write each dword through its own page, in a branch. The other lanes are unchanged (emit/lower.rs, emit/mod.rs).
  • VICTORY_SEAM_LOADS=count (diagnostics builds): only counts crossing accesses, into dword 0 of the faults buffer, reported on the memory frame line (memory.rs).
  • shader_cache.rs: keyed only while the switch is set, so the default retranslates nothing.
  • emit/seam_tests.rs: 5 tests, 2 of them on WARP, reproduce the wrong page without the switch and the right one with it, for a store and for a load.

How it was tested

  • GPU and profile: RTX 4090 24 GB, Windows 11, Series S 1440p, DLSS Quality, ray tracing on, house scene.
  • Before / After (300 s, same scene): with VICTORY_SEAM_LOADS=1, median 45.8 ms, p95 72.9 ms; our same-scene runs without it on the same base are 43.5–47.8 ms median. No regression in frame time, no device loss, ray tracing ran. The original author reports no measurable change from this switch alone on AMD with ray tracing (it was on in every good run of theirs).
  • For shader changes, the wave sizes tested: WARP (32-lane) in the unit tests. Card: RTX 4090 (wave32), the run above.
  • cargo test passed for the crates it touches: yes. cargo test -p victory-shader --lib seam: 5 passed (2 on WARP). cargo test -p victory-gpu --lib shader_cache: 10 passed, 1 failed: every_switch_of_the_translator_is_in_the_key ("VICTORY_SCALAR_SPLITS is not read by the translator any more"). That test fails on main too, and #3061 fixes it. clippy (-A clippy::while_immutable_condition, which main's victory-shader trips at emit/lower/analysis.rs:467) reports nothing in the lines this changes; the findings it lists are already on main.

Closes #3283.

Checked for overlap

  • I searched open and closed PRs and issues for SEAM_LOADS, 64 KiB page, seam and for the author's PRs. The author has no PR for this upstream (their only one is #559). Related: none on this path.

Provenance: ported from BackseatDrivers-Unbound/VIctory-AMD-RT 9492b0d (GPL-3.0-or-later). Co-authored-by: BackseatDrivers-Unbound in the commit.

AI-assisted: ported with Claude Code; reviewed by me.

🤖 Generated with Claude Code

**@⁠dyshay** on GitHub · 2026-11-30 01:20 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3576) `pr/seam-loads` → `main` · +577 −2 · 6 files · 1 commits · closed without merging **Branch:** `pr/seam-loads` (one commit on `origin/main` cec481f4) Fixes #(issue to follow) ## What it changes This is **BackseatDrivers-Unbound's work** (VIctory-AMD-RT 9492b0d, GPL-3.0-or-later), ported to this tree with the author credited as co-author. Their tests are included. Off by default. A multi-dword load or store by title address (`global_load/store_dwordx2..x4`, scalar load pieces, global loads through root views by address, the walking programs' shared looks) took every dword from the first byte's page copy. In an arena, the next 64 KiB is another title page. - `VICTORY_SEAM_LOADS=1`: lanes whose access crosses a page boundary read/write each dword through its own page, in a branch. The other lanes are unchanged (`emit/lower.rs`, `emit/mod.rs`). - `VICTORY_SEAM_LOADS=count` (diagnostics builds): only counts crossing accesses, into dword 0 of the faults buffer, reported on the memory frame line (`memory.rs`). - `shader_cache.rs`: keyed only while the switch is set, so the default retranslates nothing. - `emit/seam_tests.rs`: 5 tests, 2 of them on WARP, reproduce the wrong page without the switch and the right one with it, for a store and for a load. ## How it was tested - GPU and profile: RTX 4090 24 GB, Windows 11, Series S 1440p, DLSS Quality, ray tracing on, house scene. - Before / After (300 s, same scene): with `VICTORY_SEAM_LOADS=1`, median 45.8 ms, p95 72.9 ms; our same-scene runs without it on the same base are 43.5–47.8 ms median. No regression in frame time, no device loss, ray tracing ran. The original author reports no measurable change from this switch alone on AMD with ray tracing (it was on in every good run of theirs). - For shader changes, the wave sizes tested: WARP (32-lane) in the unit tests. Card: RTX 4090 (wave32), the run above. - `cargo test` passed for the crates it touches: yes. `cargo test -p victory-shader --lib seam`: 5 passed (2 on WARP). `cargo test -p victory-gpu --lib shader_cache`: 10 passed, 1 failed: `every_switch_of_the_translator_is_in_the_key` ("VICTORY_SCALAR_SPLITS is not read by the translator any more"). That test fails on main too, and #3061 fixes it. clippy (`-A clippy::while_immutable_condition`, which main's victory-shader trips at `emit/lower/analysis.rs:467`) reports nothing in the lines this changes; the findings it lists are already on main. Closes #3283. ## Checked for overlap - [x] I searched open and closed PRs and issues for `SEAM_LOADS`, `64 KiB page`, `seam` and for the author's PRs. The author has no PR for this upstream (their only one is #559). Related: none on this path. Provenance: ported from BackseatDrivers-Unbound/VIctory-AMD-RT 9492b0d (GPL-3.0-or-later). `Co-authored-by: BackseatDrivers-Unbound` in the commit. AI-assisted: ported with Claude Code; reviewed by me. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A multi-dword load or store by title address (global_load/store_dwordx2..x4,
scalar load pieces, global loads through root views by address, the walking
programs' shared looks) took every dword from the first byte's page copy; in
an arena the next 64 KiB is another title page. With VICTORY_SEAM_LOADS=1 lanes
whose access crosses read/write each dword through its own page, in a branch;
=count (diagnostic builds) only counts, into dword 0 of the faults buffer,
reported on the memory frame line. Keyed in the shader cache only while set.

WARP tests (seam_tests.rs) reproduce the wrong result without the switch and
the right one with it, for a store and a load across a page.

Ported from BackseatDrivers-Unbound/VIctory-AMD-RT 9492b0d (GPL-3.0-or-later).

This is BackseatDrivers-Unbound's work, ported to this tree with its switch off by default, tests included.

Co-authored-by: BackseatDrivers-Unbound <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 01:25:44 +00:00
github-bot closed this pull request 2026-12-01 12:37:39 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3576
No description provided.