Shaders: guard conditional exports #655
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!655
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/655/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?
@Halfect on GitHub · 2026-11-24 06:16 UTC · original
Halfect:fix/pixel-conditional-export→main· +76 −4 · 2 files · 1 commits · closed without mergingWhat
Non-final exports under an EXEC mask now use the existing guarded-block lowering, so disabled lanes do not overwrite their previous output. The final pixel
doneexport keeps its existingdiscardbehavior, and mesh exports are unchanged.Adds a synthetic pixel regression that narrows EXEC around a non-final MRT0 export. The old lowering rejects it with
a conditional export; the new lowering emits DXIL that passes the validator.Offline title measurement
Compared 25,889 matched program labels from the local shader archive with
translate --validate --list --jobs 4:a conditional exportblockers are gone.A local compatibility run combined with #621 also removed all eight blockers with no validation regressions. This branch itself is based directly on main and does not include #621.
Checks
cargo test --locked -p victory-shader --lib -- --test-threads=1: 70 passed, 0 failed.cargo clippy --locked -p victory-shader --lib --tests -- -D warnings: clean.cargo xtask policy: 151 files ok.Offline translation and DXIL validation only; no title executable or world run, and no shader contents or extracted data included. AI-assisted (Kimi).
@justr4mzi on GitHub · 2026-11-24 09:38 UTC · original
Independently measured PR #655 (
b9c7699c) merged cleanly ontomain(8e79c80) on Windows 11 with an AMD Radeon RX 6700 XT (RDNA2), Rust 1.98.1 (x86_64-pc-windows-msvc), anddxil.dllfrom Windows SDK10.0.26100.0, againstmain(02f404e) baseline.victory translate --validate(26,599 containers / 26,148 programs)emit: a conditional export: 8 -> 0 (all 8 cleared).emit: a scalar memory read as data: 604 -> 610 (+6)emit: a packed input half no element holds: 166 -> 168 (+2)Build and checks
8e79c80(crates/victory-shader/src/emit/lower.rs,emit/mod.rs).cargo clippy -p victory-shader --lib -- -D warnings: clean.cargo xtask policy:153 files ok.cargo build --release -p victory: succeeded.AI-assisted test execution and comparison (reviewed locally).
@Halfect on GitHub · 2026-11-24 13:23 UTC · original
Rebased onto current main
ffe310eand fixed the call flagged in #801: the new regression now passes the fourthresource::trackargument asNone(the test has no per-lane descriptors, so this keeps the old behavior). Head is now1bd52dc.Validation on Windows:
a_conditional_pixel_export_is_guarded: passed, including its Windows DXIL validation (dxil.dll 10.0.26100.0).cargo check --locked -p victory-shader --tests: passed.diff_tests,valu_tests,waterfall_tests, andstub_pipeline_is_created: 98 passed, 0 failed, 1 ignored.cargo clippy --locked -p victory-shader --lib --tests -- -D warnings: clean.cargo xtask policy: 154 files ok.No GPU execution was used for this validation.
@DeerSilver on GitHub · 2026-11-24 14:04 UTC · original
Re-tested head
1bd52dcmerged ontomainffe310e(clean merge) on NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1. No game files: the test suite only. Pass, with no local change: theresource::trackcall from #801 now builds.a_conditional_pixel_export_is_guardedpasses. It doesn't use the GPU, but its DXIL check did run: the Windows SDK10.0.26100.0\x64\dxil.dllis installed here, soValidator::loadfound it.cargo test --workspace --locked, the full workspace including the VALU and waterfall GPU groups (which ran on the RTX 5060): 343 passed, 0 failed, 6 ignored, against 342 / 6 onmain.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.AI-assisted (Claude Code).
@molodayamama on GitHub · 2026-11-24 14:04 UTC · original
Independent Windows check of
1bd52dcc9e4d2f863123f32a944c7ee4412c6852(Windows 10 22H2 19045, Rust 1.98.1, MSVC x64).cargo test -p victory-shader --locked --lib a_conditional_pixel_export_is_guarded -- --test-threads=1 --nocapture: 1 passed.The synthetic pixel shader fixture verified that a conditional export is emitted with a guard. This was a lowering check without rendering.
Only source-built synthetic fixtures were used. AI-assisted verification.
@Halfect on GitHub · 2026-11-24 14:22 UTC · original
Thanks @DeerSilver and @molodayamama for the quick re-tests of
1bd52dc— good to have the full workspace suite green on the RTX 5060 and the guarded-export fixture confirmed on a second Windows setup. Nothing further from my side on this head; ready for review.@fuzeofficlal on GitHub · 2026-11-24 14:31 UTC · original
I ran a synthetic raster comparison on
1bd52dc. A 4×2 full-screen triangle uses complementary EXEC masks for two non-final exports to MRT0, then restores EXEC and exports to MRT1. On the Windows default hardware adapter and explicit WARP, MRT0 was red in the left two columns and green in the right two. All eight pixels in MRT1 were blue. Both images matched an independent DXC HLSL reference pixel for pixel.In a local control with the non-final export guard removed, the shader still passed DXIL validation, but the second MRT0 export painted all eight pixels green on the hardware adapter. MRT1 still read back blue.
Test commit adds the dual-target readback to the test harness and keeps the original lowering test.
victory-shader --libpassed 122 tests with one benchmark ignored. Clippy and the asset check passed.@Halfect on GitHub · 2026-11-24 14:48 UTC · original
Thanks @fuzeofficlal for the raster cross-check on
1bd52dc. The result matches the intended semantics exactly: with complementary EXEC masks, the guarded non-final exports leave the disabled lanes' previous MRT0 values untouched (red/green split), and your control without the guard painting all eight pixels green confirms the guard is what carries the behavior. Pixel-for-pixel agreement with the independent DXC HLSL reference on both hardware and WARP is a strong signal.I'll keep this branch as-is: its synthetic regression covers the lowering plus DXIL validation, and your dual-target readback harness is a useful external check on top of it. Nothing further from my side on this head; ready for review.
@Marvisak on GitHub · 2026-11-25 00:27 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Main handles the title's 8 conditional exports (
13091f6e: a non-done pixel export stores in every lane when the done export discards the lanes its guard leaves out; emit/lower.rs export()).If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed