Shaders: retire VICTORY_FIRSTLANE_OWN, first-lane reads only of values shown alike (#101) #173

Open
HamudL wants to merge 3 commits from upstream-pr/173 into main
HamudL commented 2026-11-26 10:06:41 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by HamudL on 2026-11-26T10:06:41Z.


Closes #101 once a run confirms it (see "Needs a game run").

What changes

  • VICTORY_FIRSTLANE_OWN is no longer read. On a host of 32-lane waves it took each host wave's own first lane of any value read where the two halves cannot meet, so a read of a value that differs between the halves gave the upper half the wrong lane instead of failing the build. The builder's three prefix scans (39321a95223001ed, 77360df21e12ea43, 9fc111d3be79364f), which it was made for, have been shown alike by lane_uniform since the merge of #142. Without the switch any other such read is refused again ("a first-lane read where not every lane runs"), with its block named for the wave-wide forms (widen).
  • Shader cache key unchanged for everyone who did not set it. The name stays in the key as if unset (RETIRED_FIRSTLANE_OWN in shader_cache.rs). Nothing is translated again. A run that still sets the switch is served what the translator makes now, not translations the shortcut once made.
  • Lowering tests that run on every platform. The programs and lowering helpers of wave64_tests (Windows-only) move to emit/wave64_programs.rs, which builds everywhere. Three new tests of the lowering alone run on Linux too:
    • the builder-like scan (wave_prefix_program(false)) lowers for waves of 32 with no switch, and no block is named;
    • the lane-dependent one is refused, naming its block (moved from wave64_tests);
    • the lane-dependent one lowers for waves of 64.
  • A separate commit fixes a CI blocker that is already on main: clippy::missing_transmute_annotations in the descriptor_sites test of victory-loader fails cargo clippy --workspace --all-targets -- -D warnings with the pinned 1.98.1. The transmutes now name usize -> F.

Checked

  • cargo test -p victory-shader (default and --all-features) on Linux: 212 passed (209 before, plus the 3 new tests).
  • cargo test -p xtask: policy and switch checks pass.
  • cargo clippy --workspace --all-targets [--all-features] --target x86_64-pc-windows-msvc -- -D warnings: clean for both feature sets. This was a cross-check from Linux, with CARGO_FEATURE_PURE=1 so that blake3 builds without MSVC.
  • Not run: the Windows tests that need a GPU (wave64_tests on a card with waves of 32).

Needs a game run

On a host that runs waves of 32 (NVIDIA, or AMD forced to wave32), with VICTORY_BVH_BUILDER=1 and without VICTORY_FIRSTLANE_OWN, check that the log still says all 53 builder programs have host pipelines (no missing=3 of=53).

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6624252518 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/173). Originally posted by [HamudL](https://github.com/HamudL) on 2026-11-26T10:06:41Z. --- Closes #101 once a run confirms it (see "Needs a game run"). ## What changes - **`VICTORY_FIRSTLANE_OWN` is no longer read.** On a host of 32-lane waves it took each host wave's own first lane of *any* value read where the two halves cannot meet, so a read of a value that differs between the halves gave the upper half the wrong lane instead of failing the build. The builder's three prefix scans (`39321a95223001ed`, `77360df21e12ea43`, `9fc111d3be79364f`), which it was made for, have been shown alike by `lane_uniform` since the merge of #142. Without the switch any other such read is refused again ("a first-lane read where not every lane runs"), with its block named for the wave-wide forms (`widen`). - **Shader cache key unchanged for everyone who did not set it.** The name stays in the key as if unset (`RETIRED_FIRSTLANE_OWN` in `shader_cache.rs`). Nothing is translated again. A run that still sets the switch is served what the translator makes now, not translations the shortcut once made. - **Lowering tests that run on every platform.** The programs and lowering helpers of `wave64_tests` (Windows-only) move to `emit/wave64_programs.rs`, which builds everywhere. Three new tests of the lowering alone run on Linux too: - the builder-like scan (`wave_prefix_program(false)`) lowers for waves of 32 with no switch, and no block is named; - the lane-dependent one is refused, naming its block (moved from `wave64_tests`); - the lane-dependent one lowers for waves of 64. - **A separate commit fixes a CI blocker** that is already on `main`: `clippy::missing_transmute_annotations` in the `descriptor_sites` test of `victory-loader` fails `cargo clippy --workspace --all-targets -- -D warnings` with the pinned 1.98.1. The transmutes now name `usize -> F`. ## Checked - `cargo test -p victory-shader` (default and `--all-features`) on Linux: 212 passed (209 before, plus the 3 new tests). - `cargo test -p xtask`: policy and switch checks pass. - `cargo clippy --workspace --all-targets [--all-features] --target x86_64-pc-windows-msvc -- -D warnings`: clean for both feature sets. This was a cross-check from Linux, with `CARGO_FEATURE_PURE=1` so that blake3 builds without MSVC. - Not run: the Windows tests that need a GPU (`wave64_tests` on a card with waves of 32). ## Needs a game run On a host that runs waves of 32 (NVIDIA, or AMD forced to wave32), with `VICTORY_BVH_BUILDER=1` and **without** `VICTORY_FIRSTLANE_OWN`, check that the log still says all 53 builder programs have host pipelines (no `missing=3 of=53`).
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/173:upstream-pr/173'
git switch 'upstream-pr/173'

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/173'
git switch 'upstream-pr/173'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/173'
git switch 'upstream-pr/173'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/173'
git switch 'main'
git merge --squash 'upstream-pr/173'
git switch 'main'
git merge --ff-only 'upstream-pr/173'
git switch 'main'
git merge 'upstream-pr/173'
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
avatarmanz/VIctory-7900XTX!173
No description provided.