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

Open
github-bot wants to merge 3 commits from github-bot/gh-173 into main AGit
Owner

@⁠HamudL on GitHub · 2026-11-26 10:06 UTC · original
HamudL:fix/first-lane-shortcut-retired → main · +269 −191 · 6 files · 3 commits · open

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).

**@⁠HamudL** on GitHub · 2026-11-26 10:06 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/173) `HamudL:fix/first-lane-shortcut-retired` → `main` · +269 −191 · 6 files · 3 commits · open 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`).
On a host of 32-lane waves the switch took each host wave's own first lane
of any value read where the two halves cannot meet, and gave the upper half
its own lane's value where the console's first lane was in the lower one.
The ray-tracing builder's three prefix scans (39321a95223001ed,
77360df21e12ea43, 9fc111d3be79364f), for which it was made, are shown alike
by lane_uniform since the merge of #142, so they translate without it; any
other such read is refused again, with its block named for the wave-wide
forms (widen).

The shader cache keeps the switch's name in its key as if unset: a run
without it keeps its key and its translations; a run that still sets it is
served what the translator makes now.

The programs and lowering helpers of wave64_tests move to wave64_programs,
which builds on every platform, with three tests of the lowering alone that
run on Linux too: the builder-like scan lowers for waves of 32 without a
switch, the lane-dependent one is refused naming its block, and lowers for
waves of 64.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:21:44 +00:00
#169 keeps the (F, F) annotation and breaks the line; the same text here
leaves nothing to resolve whichever of the two lands first.
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/173/head:github-bot/gh-173'
git switch 'github-bot/gh-173'

Merge

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