Shaders: lane masks a traversal keeps as numbers #1883
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1883
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1883"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@powplusplus on GitHub · 2026-11-25 00:03 UTC · original
powplusplus:shader/traversal-lane-masks→main· +54 −5 · 2 files · 1 commits · closed without mergingThe ray-tracing shadow passes keep the lanes still walking the BVH in a lane mask, and push that mask on an LDS stack as a number. On main they stop at "a register joining a lane mask and data, read as data" (a register that holds the mask on one path and a popped number on the other, read as a number) or at "a lane-mask join of an untracked mask".
In compute, with console lanes (
fill_phis):mask_numberfor one holding lanes elsewhere), as the console holds it;never_taken,dead_on_edge) joins any mask, as data joins already take any number there.Results
translate --validateover shaders.rpf against70564ae: 45 more compute programs emit and validate (2,621 to 2,666), none lost.CS_RTShadowTrace32HQand its temporal, 1/2, 1/4 and 1/8 RPP, FarOnly and tiled variants (20),CS_RTDistantShadowTrace*_Tiled(4),CS_RTDistantLODLightShadow,CS_TraceShadowRays_*(Checkerboard, Eighth, Quarter, Half, FullAdaptive),CS_RaytraceShadows_Shared,CS_LaserLightShadowRaytracing.CS_RaytraceVBuffer_ShaderBinningand_RayBinning_ShaderBinning_Shared(with and without far),CS_ScreenProbes_TraceRays_RayBinning_BVH_Shared_ShaderBinning(2),CS_DeferredGather_Shared_Wave32,CS_ComputeClosestDepth.CS_Subdivision_*(5).Under vkd3d-proton (RTX 3080, Proton), 35 of the 45 hang pipeline creation, each created on its own with a 120 s limit; 10 create pipelines. #1885 fixes the hang (one back edge per loop header, a larger stack for pipeline threads): with both, the 35 of the 45 run so far all create pipelines, 30 of them ones that hung.
Testing
vccon one path and a number on the other and is read after the join; hardware adapter and WARP. main refuses it.cargo test -p victory-shaderunder Proton (RTX 3080 and WARP): 205 passed. The 5 that fail (stub_pipeline_is_created, three insemantics_tests,a_heap_buffer_read_where_no_buffer_view_is_reads_zeros) fail on main there too.@zed6000 on GitHub · 2026-11-25 04:23 UTC · original
Measured offline on the title's shaders (the method in #1247): merged onto main
940d32f(a clean merge) and compared program by program (victory translate --validate --list,shaders.rpf1.0.2.1, dxil.dll 1.8.2502).+21 programs, 0 lost. On main they failed with "a register joining a lane mask and data, read as data" (16 of the 40 still failing for that reason) and "a lane-mask join of an untracked mask" (5). It also merges cleanly together with #1989, #1065 and #1971: the four together give +1,683 programs and 0 lost, and
cargo test -p victory-shader --libpasses (252/0) on an RX 7900 XTX. Offline counts only; no program names or data.@r4tedx on GitHub · 2026-11-25 04:47 UTC · original
An independent offline count, with one addition to @zed6000's: what the programs this PR does not finish stop at next, and the result together with #2027.
Method:
victory translate <shaders.rpf> --validate --list --jobs 6, release builds, Windows SDK 10.0.26100.0dxil.dll, compared program by program (25,889 programs). CPU only; nothing was run on a GPU or in the title.mainmain940d32fa31d8cc, clean merge)34d0b4e, clean merge of both)The 40 programs
mainrefuses witha register joining a lane mask and data, read as data:CS_RTShadowTrace32HQ/TemporalHQvariants, with and without_TiledandFarOnly, andCS_TraceShadowRays_Eighth,_Quarter,_Half,_FullAdaptive) then fail the validator withEntry function performs some operation that is incompatible with the shader stage, which is #2027's class, not this PR's.The 5 programs at
a lane-mask join of an untracked maskthat this PR clears are in the +21; one program is left at that reason after both PRs.Not checked here: the value a joined mask reads on a GPU (the PR's own VALU test covers that; I ran no test), and pipeline creation.
A local copy of the title's shader archive was used for these counts, offline; only counts, program names and refusal reasons are given. AI-assisted.
@Marvisak on GitHub · 2026-11-25 08:16 UTC · original · edited 2026-11-25 15:59 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-shader/src/emit/lower.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (merge candidate) was for an older state ofmain.Generated by Claude Code
@catminou4 on GitHub · 2026-11-25 02:17 UTC · original · approved these changes
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.144 passed / 0 failed / 2 ignored. Lane masks kept as numbers through traversal — extends the masks-as-data work (#1788); no regressions.
@powplusplus on GitHub · 2026-11-26 11:37 UTC · original
Closing as superseded by
e8e9f0cand4a3166eonmain, which cover this with stricteruniform_join/no_mask_lane_on_edgeguards.Pull request closed