Shaders: restore parked lane-mask pairs a few instructions apart; relative VGPR reads keep parked lanes #11
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!11
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/11/head"
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?
@cxchhh on GitHub · 2026-11-24 19:48 UTC · original
cxchhh:fix/parked-mask-pairs→main· +56 −3 · 2 files · 1 commits · merged 2026-11-24 20:35 UTCThree shaders that
maindrops every frame in the prologue now translate. The main one is the irradiance cache's shading pass. Without it, the bounce light in the probes is never computed, and everything the sun does not reach directly renders black.main(7b0f736)indirect_light_probes:CS_IrradianceCache_Shade#a53a7977fe762268indirect_light_probes:CS_IrradianceCache_ShadeSecondary#be14e72d86362031billboard_nobump:CS_RaytracingResolve_a56bfb9c#7f05ddab771799a9Tested on an RTX 4070, Series X profile
main,578d459, plus this change.)cargo test -p victory-shader --lib: 198 passed.shaders.rpf: 1132 validate, against 1130 onmain. None that validates onmainfails here.What was wrong (
ir.rs,unspill)A mask restored with work between its two halves. The console compiler parks a wave64 lane mask in two lanes of a spare VGPR. When it takes the mask back, it may schedule other instructions between the two
v_readlane_b32(Shade:v_readlane s10, v113, 6, thenv_rcp_f32, thenv_readlane s11, v113, 7). The pair rule only accepted the second restore right after the first, so the halves came back as two plain scalars. The mask was then read as data where it holds lanes that are not running.The restore now looks ahead within the block, the same way the save already did. The rule refuses the pair if anything in between:
An
M0-relative read turned unspilling off for a whole program.effectslistsv_movrels_b32as reading every VGPR from its base up. That marked the parking VGPR (v144in the billboard resolve) as an ordinary register, and no lane of it was unspilled. Relative reads no longer count against parking VGPRs. Relative writes (v_movreld,v_movrelsd,v_swaprel) still do.Offline tooling (
translate)VICTORY_TRANSLATE_ONLY=<hash prefix>,...translates only those containers; the hash is the one run logs print. One shader takes seconds instead of a pass over the whole archive.VICTORY_HOST_MAX_WAVE=32callsset_host_max_wavethe way the runtime does on NVIDIA. Without it,--pipelinesreportsE_INVALIDARG("wave lane count of 64") for programs the runtime actually splits into two 32-lane waves.Still failing on this card (not changed here)
sr_tracing:CS_Tiling_Generate_Opaque#2cc4c197ee29e291: it keeps 64-lane waves (LDS in a group of 64, mask as data,v_mbcnt) and is refused every frame. It may be behind blocky artifacts in reflections.cascadeshadows_rendering:CS_ShadowRenderTiledCascadesAlphaCBPPPC: a lane mask exchanged where not every lane runs.shadowmask:CS_TraceShadowRays_{Full,Half,Quarter,Eighth,FullAdaptive}: a descriptor read only as data.🤖 Generated with Claude Code
@fxceless on GitHub · 2026-11-24 20:35 UTC · original
Merged, thank you. Built, tested and run here on an RTX 4070: both irradiance programs translate and are bound with no errors, at a cost of about 40 ms of GPU time per frame. I could not yet make a like-for-like picture comparison (the camera differs between runs), so whether the shadowed areas gain light is still to be confirmed on this machine.
@Mesrine67 on GitHub · 2026-11-24 20:58 UTC · original
Additional RDNA 2 verification on the merged change, using
fxceless/victory-forkmain at4e17478:VICTORY_TRANSLATE_ONLY=a53a7977fe762268,be14e72d86362031,7f05ddab771799a9victory translate shaders.rpf --validate --pipelinesAll three targeted compute shaders translated, passed DXIL validation, and created D3D12 pipelines on this AMD card (3/3). This is translator/pipeline verification only; I did not run the title executable or claim a visual/gameplay result. No game assets are attached.
@SkillIssueXO on GitHub · 2026-11-24 20:58 UTC · original
Independent Series X checkpoint test on an RTX 5070 Ti, native D3D12,
4e17478built from source with diagnostics. Default watchdog and shader settings.CS_IrradianceCache_Shade(a53a7977fe762268) and two for the billboard resolve (7f05ddab771799a9).ShadeSecondary(be14e72d86362031) bound, with zero dispatches in those four traces.CS_TraceShadowRays_Checkerboard(559d9f0184e15fe3) dispatched once andCS_ShadowRenderTiledCascadesAlphaCBPPPC(f133e35efed2a48a) was dropped once. At an effective host wave width of 32, the latter still failed offline at0x1eb4, including with the wide-wave retry enabled offline. The five descriptor-read trace variants listed above also failed offline. None of those five appeared in the live first-bind log for this checkpoint run.Counts and shader identifiers only. Test and report assisted by Codex.
@Mesrine67 on GitHub · 2026-11-24 21:00 UTC · original
Wave-width cross-check on
4e17478, using an AMD Radeon RX 6750 XT (driver 32.0.21045.29003) and the two shader hashes from the recent checkpoint report:VICTORY_HOST_MAX_WAVE=32:559d9f0184e15fe3still passes;f133e35efed2a48a(CS_ShadowRenderTiledCascadesAlphaCBPPPC) is refused at0x1eb4witha lane mask exchanged where not every lane runs. Totals are 1 emitted, validated, and created pipeline out of 2.This reproduces the reported 32-lane limitation on a second GPU vendor. These are offline translate/pipeline tests only; no title executable was run.
@SkillIssueXO on GitHub · 2026-11-24 21:26 UTC · original
Follow-up with a direct GPU readback of
CS_IrradianceCache_Shade(a53a7977fe762268). Same RTX 5070 Ti and Series X checkpoint, on4e17478with a local diagnostics-only probe. For the first matching indirect call at each frame, I copied the clamped dispatch arguments and the bound 1280 × 2560R11G11B10_FLOATatlas before and after the call in the same command list. CPU reads ran after the submission fence. There were no pipeline skips or external count buffers.The nonzero-work calls changed atlas contents. I sampled one call per frame, and this check does not measure the contribution to presented lighting. Aggregate counts only. Codex assisted with instrumentation and verification.