fix(shader): reset dirty/e_written at fold branch leaders and restore self.cur in half_meet_at #3946
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3946
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3946"
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?
@qlfu on GitHub · 2026-11-30 12:36 UTC · original
qlfu:pr/fix-shader-fold-leaders-and-half-meet→main· +4 −0 · 2 files · 1 commits · openSummary
Two targeted shader compiler correctness fixes:
crates/victory-shader/src/fold.rs: at branch-targetleaders, resetf.dirty = trueandf.e_written = trueafterf.flush(). Previously, a fallthrough predecessor withdirty == falsecould causes_cbranch_execz(!live) at a merge block to skips_or_b32 EXEC_LO, e, e+1when another incoming edge arrived withdirty == trueor pendinge_written.crates/victory-shader/src/emit/lower.rs: save and restoreself.curinhalf_meet_ataround the tally block emission so callers invokinghalf_meet_at(block)withblock != self.cur(if block == self.cur { self.cur = done; }) do not haveself.curoverwritten.Verification
cargo test -p victory-shader --lib --locked(466 passed, 0 failed on combined build;fold::unit tests +cargo check -p victory-shader --all-targets --all-features --lockedexit 0 on this branch).0failures).@VibeCodeGuy on GitHub · 2026-11-30 22:48 UTC · original
Offline corpus check (every shader container in a v1.0.2.1 dump: 25,699 unique programs),
maine1251c31againstmain+ this PR at3dd3d4de.The 123 changed programs by family
sr_denoising:CS_TemporalResolveAlphasr_denoising:CS_TemporalResolveWaterGpuParticleCollision:CS_CollisionRaytracedGpuParticleEmit:CS_EmitCounts_Dynamic_EdgeGpuParticleEmit:CS_Emit_Dynamic_Model_AttachMesh_SkinnedGpuParticleEmit:CS_Emit_Dynamic_Model_AttachMeshGpuParticleEmit:CS_Emit_Dynamic_Model_EdgeHashGridGpuParticleEmit:CS_Emit_Dynamic_Model_EdgeGpuParticleEmit:CS_Emit_Dynamic_Model_SkinnedGpuParticleEmit:CS_Emit_Dynamic_ModelGpuParticleUpdate:CS_DrawBatchGpuParticleUpdate:CS_UpdateAttachMeshParticlesGpuParticleUpdate:CS_UpdateParticlesGpuParticleUpdate:CS_UpdateSkinnedAttachMeshParticlesGpuParticleUpdate:CS_UpdateSkinnedAttachMeshTreeParticlesInstanceCulling:CS_Tree_BatchCullReflectInstanceCulling:CS_Tree_BatchCull_ImposterOnlyInstanceCulling:CS_Tree_BatchCull_ValidateInstInvInstanceCulling:CS_Tree_BatchCull_ValidateInstInstanceCulling:CS_Tree_BatchCullInstanceCulling:CS_Tree_BatchNoCullTAA_Utilities:CS_SceneColorTemporalResolveDOFAwareTAA_Utilities:CS_SceneColorTemporalResolveDualOutputDOFAwareTAA_Utilities:CS_SceneColorTemporalResolveDualOutputWithLumaDOFAwareTAA_Utilities:CS_SceneColorTemporalResolveDualOutputWithLumaTAA_Utilities:CS_SceneColorTemporalResolveDualOutputTAA_Utilities:CS_SceneColorTemporalResolveWithLumaDOFAwareTAA_Utilities:CS_SceneColorTemporalResolveWithLumaTAA_Utilities:CS_SceneColorTemporalResolvecascadeshadows_classify:CS_CalcRTClassificationListCountscascadeshadows_classify:CS_CalcRasterClassificationListCountscascadeshadows_rendering:CS_ShadowRenderTiledCascadesAlphaCBPPPCcascadeshadows_rendering:CS_ShadowRenderTiledCascadesAlphaCBcascadeshadows_rendering:CS_ShadowRenderTiledCascadesAlphaPPPCcascadeshadows_rendering:CS_ShadowRenderTiledCascadesAlphacascadeshadows_rendering:CS_ShadowRenderTiledCascadesCBPPPCcascadeshadows_rendering:CS_ShadowRenderTiledCascadesCBcascadeshadows_rendering:CS_ShadowRenderTiledCascadesPPPCcascadeshadows_rendering:CS_ShadowRenderTiledCascadescascadeshadows_rendering:CS_ShadowRenderTiledMiscAlphaPPPCcascadeshadows_rendering:CS_ShadowRenderTiledMiscAlphacascadeshadows_rendering:CS_ShadowRenderTiledMiscCBPPPCcascadeshadows_rendering:CS_ShadowRenderTiledMiscCBcascadeshadows_rendering:CS_ShadowRenderTiledMiscHairAlphaPPPCcascadeshadows_rendering:CS_ShadowRenderTiledMiscHairAlphacascadeshadows_rendering:CS_ShadowRenderTiledMiscHairPPPCcascadeshadows_rendering:CS_ShadowRenderTiledMiscHaircascadeshadows_rendering:CS_ShadowRenderTiledMiscPPPCcascadeshadows_rendering:CS_ShadowRenderTiledMiscfirevbuffer:CS_EntityFireClassifyfirevbuffer:CS_EntityFireReduceClassification_Scalarizedfirevbuffer:CS_EntityFireResolve_Scalarizedfirevbuffer_emissive:CS_EntityFireResolve_Scalarizedindirect_diffuse_lighting:CS_DeferredFallback_BVHindirect_diffuse_lighting:CS_DeferredFallback_Fallbackindirect_diffuse_lighting:CS_DeferredFallback_Voxelsindirect_diffuse_lighting:CS_ResolveVBuffer_Voxelsindirect_light_probes:CS_IrradianceCache_IntegrateIrradianceSHindirect_light_probes:CS_IrradianceCache_ShadeSecondaryindirect_light_probes:CS_IrradianceCache_Shadelens_flares:CS_ScanMip0lens_flares:CS_ScanMip1lens_flares:CS_ScanMip2lens_flares:CS_ScanMip3ptx_prerender:ptfx_CS_PreRenderSpriteptx_prerender:ptfx_CS_PreRenderTrailscattering_transmittance_system:CS_GatherDensityAreaForReadBackscattering_transmittance_system:CS_GatherDiffusionscattering_transmittance_system:CS_Gatherscattering_transmittance_system:CS_Gather_Referencescattering_transmittance_system:CS_SortRayTilesshader_binning_utils:CS_GenerateShaderBinOffsetsshadowmask:CS_DenoiseShadowMaskPoissonDiscPackedshadowmask:CS_DenoiseShadowMaskPoissonDiscshadowmask:CS_GenerateShadowMasksHairOnly_SampleHairScreenSpaceshadowmask:CS_GenerateShadowMasksshadowmask:CS_GenerateShadowMasks_HairOnlyshadowmask:CS_GenerateShadowMasks_Raytracedshadowmask:CS_GenerateShadowMasks_SampleHairScreenSpaceshadowmask:CS_TraceShadowRays_Fullshadowmask:CS_TraceShadowRays_Fullresshadowmask:CS_TraceShadowRays_ScreenSpaceOnlyFullRessr_denoising:CS_TemporalResolve1_Alphasr_denoising:CS_TemporalResolve1_Opaque_FrameStatisticssr_denoising:CS_TemporalResolve1_Opaquesr_denoising:CS_TemporalResolve1_Watersr_denoising:CS_TemporalResolve2_Opaque_FrameStatisticssr_denoising:CS_TemporalResolveOpaque2sr_denoising:CS_TemporalResolveOpaque_FrameStatisticssr_tracing:CS_DeferredFallbacksAlpha_SkyProbesr_tracing:CS_RayPrePass_Alphasr_tracing:CS_RayPrePass_Opaque_SSRsr_tracing:CS_RayPrePass_Water_SSRsr_tracing:CS_ResolveVolumetricssr_tracing:CS_Tiling_Generate_Opaquevfx_proj_decal_trail:CS_BuildProjDecalTrailProjectionBoxInstancesvfx_proj_decal_trail:CS_BuildProjDecalTrailVertexBufferFromNodesvfx_proj_decal_trail:CS_DefragHeap_ComputeRelocationsvfx_proj_decal_trail:CS_DefragHeap_Defragvfx_proj_decal_trail:CS_RelocateProjDecalTrailAltvfx_proj_decal_trail:CS_RelocateProjDecalTrailNodesAltvfx_proj_decal_trail:CS_SpawnLiquidTrail_SampleDecalRaycastTriangleTestvfx_proj_decal_trail:CS_SpawnLiquidTrail_SampleDecalRaycastTriangleTest_Nodesvfx_proj_decal_trail:CS_UpdateProjDecalTrailAttachmentvfx_proj_decal_trail:CS_UpdateProjDecalTrailAttachment_Nodesvfx_proj_decal_trail:CS_UpdateProjDecalTrailMeshIndicesvfx_proj_decal_vbuffer:CS_ProjDecalReduceClassification_Scalarizedvfx_proj_decal_vbuffer:CS_ProjDecalResolve_Vectorizedvfx_triangleClip:CS_CollectTriangles_Meshletsvfx_triangleClip:CS_CollectTrianglesvfx_triangleClip:CS_DefragHeap_ComputeRelocationsvfx_triangleClip:CS_DefragHeap_Defragvfx_triangleClip:CS_RelocateVfxStartIndexLocationAltwater_compressed_simulation_rendertarget:CS_MinMax_Float_DualPlane_Parallelwater_compressed_simulation_rendertarget:CS_MinMax_Float_SinglePlane_Parallelwater_compressed_simulation_rendertarget:CS_MinMax_Int_SinglePlane_Parallelwater_shading:CS_TransmissionVolumetricsSubmergedwater_shading:CS_TransmissionVolumetrics_Tiled_LocalLightswater_shading:CS_TransmissionVolumetrics_Tiledwater_shading:CS_TransmissionVolumetrics_VolumePortalsOnlywater_shading:CS_TransmissionVolumetricsHow:
victory translate <dump> --validate --listbuilt for each side (release, cross-built with cargo-xwin, run under Wine),VICTORY_HOST_WAVE=32, plus the four shader-cache-key settingsplaystarts with (VICTORY_EARLY_DEPTH=1,VICTORY_NAN_SCRUB=1,VICTORY_BVH_MISS=1,VICTORY_SAMPLED_MARKS=1). Validator:dxil.dllfrom DXC v1.9.2609. "Changed" compares translate'semittedhash of each module and its bindings. There was no GPU on this side, so no host pipelines were made and nothing was run on a card. Onmainthe same run has 72 failures: 71 mesh programs over the 32 KiB output limit (the known shortcut inmesh_prologue) andCS_TraceShadowRays_FullAdaptive(#2993).@mstrmoos on GitHub · 2026-12-01 09:29 UTC · original
The
fold.rshalf of this fails one of the shader crate's own tests, and CI hasn't caught it: thecheckjob stops earlier, at an unrelated dead-code error invictory-loader(function unwind_copy is never used), before any test runs.On
main5fabb46ewith this PR's commit (3dd3d4de) on top,cargo test --locked -p victory-shader --lib:fold.rslines taken back out (thehalf_meet_atchange kept), it passes again.mainpasses it too.dirty/e_writtenat every branch leader. With that, the back edge of that loop no longer brings in a mask join that only the header reads.I can't tell from here whether the test is pinning a shape that is now allowed to change, or whether the extra flush at every leader costs real work in loops. That might also be behind some of the 123 compute shaders that VibeCodeGuy's corpus run shows as changed. One option is to set them only at leaders that a jump reaches with a different
dirty/e_writtenstate from the fallthrough, the case the description names, rather than at all of them.(The other failure in that crate,
split_lds_wave32_read_after_read_barrier_coalescing_and_parity, already fails onmainand is unrelated.)RTX 5080, Windows 11, Rust 1.98.1. For now I've picked only the
half_meet_athalf into my build.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.