Repository navigation
Shaders: VICTORY_WAVE_WIDE_ONLY turns the wave-wide form on for named programs (the two water volumetrics computes on NVIDIA) - #695
Open
FrancescoGelosoEterea wants to merge 1 commit into
Conversation
…amed containers alone Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note for the two water volumetrics this PR puts in AI-assisted (Claude Code). |
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
On current
main(310c6eb), twowater_shadingcompute programs translate but stay atWaveSize(64), so a 32-lane host refuses them:They are
CS_TransmissionVolumetrics_TiledandCS_TransmissionVolumetrics_Tiled_LocalLights. Their thread groups are one console wave (64 threads).VICTORY_WAVE_WHYgivesLDS in a group over 32, an LDS read and write in one lane-branch region, v_readlane. The forms tried after that stop at "a first-lane read where not every lane runs" and "a wave reduction where not every lane runs".The wave-wide form (
widen) handles exactly this case: it takes the lane branches around that code with the whole wave. With it, the two programs lower toWaveSize(32), with 4 and 7 branches taken wave-wide. Sincee9765a7, that form is off unlessVICTORY_WAVE_WIDE=1, because it left the particle light-atlas programs standing on the card. So it can only be turned on for every program at once.What
VICTORY_WAVE_WIDE_ONLY=<hash prefix>,...turns the wave-wide form on only for the containers it names. A container is named by the hash the log uses: the first 16 hex digits of the container's BLAKE3.emit::wave_wide_only(hash)reads the list.emit::with_wave_wide(on, f)sets a thread-local flag around one translation, which the retry ladder reads next toVICTORY_WAVE_WIDE.shader_cache::host_shader) andvictory translateuse it.VICTORY_WAVE_WIDE_ONLYis part of the shader cache key, asVICTORY_WAVE_WIDEis.Without the variable nothing changes.
Tested
RTX 5070 Ti, driver 621.24, Ryzen 7 9800X3D, Windows 11. Own 1.0.2.1 copy.
translate --pipelines --validate --listonshaders.rpf,VICTORY_HOST_MAX_WAVE=32, this branch):pipeline: E_INVALIDARG;VICTORY_WAVE_WIDE_ONLY=5dc3b259,6f225b64: bothpipeline created, and both validate.310c6ebplus this change and other open PRs (GPU: no blending on integer render targets in host pipelines (port of upstream #806) #51, wave64: halve programs whose every LDS access names only its own lane's words #158, Certify Wave32 LDS synchronization for visibility dispatch #368, Fill table constant buffers that flights write on the card #522, Shaders: a lane-branch region that only raises an LDS flag runs as two host waves (one more wave64 compute on NVIDIA) #592 among them), withVICTORY_WAVE_WIDE_ONLY=5dc3b259,6f225b64.first bindat frame 1702). No dispatch of theirs is dropped.02384a60…and6b82bc7d…. Their thread groups are 128 and 1024 threads (several console waves), where the wave-wide form does not apply.cargo test -p victory-shader --lib: 214 passed.cargo test -p victory-gpu --lib: 118 passed.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.Not tested
🤖 Generated with Claude Code